refactor: Kern ohne Divi – Ports BuilderDetector, MediaUsageSource, EnvironmentComponent und ausgeschlossene Post-Typen im ContentSchema; Divi-Implementierungen und Verdrahtung über DiviIntegration/Plugin; CoreIndependenceTest
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
abeb4b0eed
commit
06148fb8c1
@@ -53,7 +53,10 @@ use LIT\MCP\Integrations\Divi\ThemeBuilder\DiviThemeBuilder;
|
||||
use LIT\MCP\Integrations\Divi\ThemeBuilder\ThemeBuilderAccess;
|
||||
use LIT\MCP\Integrations\Divi\ThemeBuilder\ThemeBuilderEdits;
|
||||
use LIT\MCP\Integrations\Divi\ThemeBuilder\ThemeBuilderIntegration;
|
||||
use LIT\MCP\Integrations\Core\EnvironmentComponent;
|
||||
use LIT\MCP\Integrations\Integration;
|
||||
use LIT\MCP\Integrations\Media\MediaUsageSource;
|
||||
use LIT\MCP\Integrations\WordPress\BuilderDetector;
|
||||
use LIT\MCP\Integrations\WordPress\Content\ContentComposer;
|
||||
use LIT\MCP\Integrations\WordPress\Schema\ContentSchema;
|
||||
|
||||
@@ -131,6 +134,45 @@ final class DiviIntegration implements Integration
|
||||
return DiviModules::isAvailable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Divi's own post types (library, Theme Builder, canvases, speculation), which the content tools leave alone:
|
||||
* ContentSchema's excluded post types. Static because the schema is built before this integration (Plugin).
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function internalPostTypes(): array
|
||||
{
|
||||
return DiviModules::INTERNAL_POST_TYPES;
|
||||
}
|
||||
|
||||
/** Whether Divi's builder is switched on for $postType: ContentSchema::diviEnabled() (static, like above). */
|
||||
public static function builderEnabledFor(string $postType): bool
|
||||
{
|
||||
return DiviModules::builderEnabledFor($postType);
|
||||
}
|
||||
|
||||
/** Port for the content tools: Divi's builder flag and availability (PostPresenter). */
|
||||
public function builderDetector(): BuilderDetector
|
||||
{
|
||||
return new DiviBuilderDetector();
|
||||
}
|
||||
|
||||
/**
|
||||
* Port for the media tools: places outside the library where Divi stores an attachment (its logo).
|
||||
*
|
||||
* @return list<MediaUsageSource>
|
||||
*/
|
||||
public function mediaUsageSources(): array
|
||||
{
|
||||
return [new DiviLogoUsage()];
|
||||
}
|
||||
|
||||
/** Port for lit-site-status: Divi's version, missing internals and release status. */
|
||||
public function environmentComponent(): EnvironmentComponent
|
||||
{
|
||||
return new DiviEnvironmentComponent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Divi short form for lit/content-create; available() reports whether Divi 5 is loaded,
|
||||
* writable() asks $writable (the Tools-tab gate, security M2).
|
||||
|
||||
Reference in New Issue
Block a user