feat: lit/library-save creates library entries like Divi (E4)

Reuses NewDraft for insert and rollback (P6), requires edit_global_library
for scope global (P7), refuses opaque and global roots before wrapping (P11)
and checks the node with StoredNodeGuard. The source page is never written.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-27 02:12:50 +02:00
co-authored by Claude Opus 5.5
parent 8fa285a265
commit 5035092805
14 changed files with 1112 additions and 21 deletions
+24 -10
View File
@@ -100,15 +100,7 @@ final class DiviIntegration implements Integration
public function abilities(): array
{
$loader = $this->loader();
$composition = new DiviComposition($this->modules, $this->design);
$writer = new DiviWriter(
$loader,
new DiviSaver(),
$this->log,
$this->design,
$composition,
new GlobalEdits($this->access, new GlobalUsages())
);
$writer = $this->writer($loader);
return [
new DiviOutlineAbility($loader, $this->design),
@@ -127,7 +119,29 @@ final class DiviIntegration implements Integration
/** The group "Divi-Bibliothek" (lit/library-*), sharing this integration's library access. */
public function library(): LibraryIntegration
{
return new LibraryIntegration($this->access, $this->loader(), $this->design);
$loader = $this->loader();
return new LibraryIntegration(
$this->access,
$loader,
$this->design,
$this->writer($loader),
new DiviSaver(),
$this->log,
$this->modules
);
}
private function writer(DiviPageLoader $loader): DiviWriter
{
return new DiviWriter(
$loader,
new DiviSaver(),
$this->log,
$this->design,
new DiviComposition($this->modules, $this->design),
new GlobalEdits($this->access, new GlobalUsages())
);
}
private function loader(): DiviPageLoader