feat(css): globales CSS bearbeiten (lit/divi-custom-css-get und -update)

WordPress „Zusätzliches CSS“ (in Divi „Eigenes CSS“) über die Design-Pipeline: Probelauf mit Zeilen-Diff,
design_rev, Bestätigung, Snapshot, Rollback und Wiederherstellen (Bereich custom_css). Der Guard lehnt </style,
<script, expression(, javascript: und neue @import ab und warnt bei fremden Hosts; nur Neues zählt, Bestehendes
blockiert keine Änderung. Erfordert edit_css und die Divi-Rolle Theme-Anpassung.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-11-05 16:36:16 +01:00
co-authored by Claude Sonnet 5.5
parent 96fa58188b
commit ac333a164c
26 changed files with 1719 additions and 12 deletions
+15 -1
View File
@@ -41,6 +41,11 @@ use LIT\MCP\Integrations\Divi\Design\PresetComposer;
use LIT\MCP\Integrations\Divi\Design\PresetRestorePlanner;
use LIT\MCP\Integrations\Divi\Design\SnapshotStore;
use LIT\MCP\Integrations\Divi\Design\ThemeOptionsAdapter;
use LIT\MCP\Integrations\Divi\Design\CustomCssGuard;
use LIT\MCP\Integrations\Divi\Design\CustomCssRestorePlanner;
use LIT\MCP\Integrations\Divi\Design\CustomCssStore;
use LIT\MCP\Integrations\Divi\Design\DiviCustomCssGetAbility;
use LIT\MCP\Integrations\Divi\Design\DiviCustomCssUpdateAbility;
use LIT\MCP\Integrations\Divi\Design\ThemeOptionsRestorePlanner;
use LIT\MCP\Integrations\Divi\Design\VariableRestorePlanner;
use LIT\MCP\Integrations\Divi\Library\DiviLibraryStore;
@@ -263,6 +268,7 @@ final class DiviIntegration implements Integration, Bootable
{
$loader = $this->loader();
$writer = $this->writer($loader);
$customCss = new CustomCssStore();
return [
new DiviOutlineAbility($loader, $this->design),
@@ -304,7 +310,8 @@ final class DiviIntegration implements Integration, Bootable
new PresetRestorePlanner($this->designWriter, $this->globalUsages(), DesignRights::unfilteredHtml()),
new ColorRestorePlanner($this->designWriter, $this->colorsAdapter, $this->globalUsages()),
new VariableRestorePlanner($this->designWriter, $this->variablesAdapter, $this->globalUsages()),
new ThemeOptionsRestorePlanner($this->themeOptionsAdapter)
new ThemeOptionsRestorePlanner($this->themeOptionsAdapter),
new CustomCssRestorePlanner($customCss, $this->themeOptionsAdapter)
),
new DiviPresetsAssignAbility(
$this->designWriter,
@@ -338,6 +345,13 @@ final class DiviIntegration implements Integration, Bootable
$this->fontCatalog,
$this->designChange()
),
new DiviCustomCssGetAbility($customCss, $this->themeOptionsAdapter),
new DiviCustomCssUpdateAbility(
$customCss,
$this->themeOptionsAdapter,
$this->designChange(),
new CustomCssGuard()
),
new DiviFontsUploadAbility(
$this->fontCatalog,
$this->fontInstaller,