feat: lit/divi-presets-set – Presets anlegen und ändern mit Probelauf und Snapshot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-16 17:47:16 +02:00
co-authored by Claude Sonnet 5.5
parent 341782a34f
commit b3c3e69a53
8 changed files with 682 additions and 0 deletions
+30
View File
@@ -10,7 +10,11 @@ use LIT\MCP\Integrations\Divi\BlockTree\Parser;
use LIT\MCP\Integrations\Divi\Design\DesignSystemReader;
use LIT\MCP\Integrations\Divi\Design\DesignSystemWriter;
use LIT\MCP\Integrations\Divi\Design\DiviDesignSystemAbility;
use LIT\MCP\Integrations\Divi\Design\DesignChange;
use LIT\MCP\Integrations\Divi\Design\DiviPresetGetAbility;
use LIT\MCP\Integrations\Divi\Design\DiviPresetsSetAbility;
use LIT\MCP\Integrations\Divi\Design\PresetComposer;
use LIT\MCP\Integrations\Divi\Design\SnapshotStore;
use LIT\MCP\Integrations\Divi\Library\DiviLibraryStore;
use LIT\MCP\Integrations\Divi\Library\DiviRoles;
use LIT\MCP\Integrations\Divi\Library\GlobalEdits;
@@ -155,6 +159,13 @@ final class DiviIntegration implements Integration
new DiviNodeCopyAbility($writer, $loader, $this->diviWritable, $this->libraryInsertable),
new DiviDynamicSourcesAbility($this->schema, new DynamicContentMap(), $this->access->roles()),
new DiviPresetGetAbility($this->designWriter, $this->globalUsages()),
new DiviPresetsSetAbility(
$this->designWriter,
$this->designChange(),
$this->globalUsages(),
$loader,
$this->presetComposer(...)
),
];
}
@@ -217,6 +228,25 @@ final class DiviIntegration implements Integration
);
}
private function designChange(): DesignChange
{
return new DesignChange(new SnapshotStore(), $this->log);
}
private function presetComposer(): PresetComposer
{
$composition = new DiviComposition($this->modules, $this->design);
return new PresetComposer(
$composition->composer(),
$composition->storedGuard(),
$this->designWriter->presetAttrs(...),
$this->designWriter->groupsOf(...),
$this->modules->builderVersion(),
static fn (): int => (int) floor(microtime(true) * 1000)
);
}
private function loader(): DiviPageLoader
{
return new DiviPageLoader($this->schema, new Parser(), $this->access, $this->themeBuilderAccess);