feat: design-system filters and global module ids in node-get/outline (S19)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-27 00:44:58 +02:00
co-authored by Claude Opus 5.5
parent 858aa6a182
commit a3a807051f
8 changed files with 187 additions and 19 deletions
@@ -85,6 +85,7 @@ final class DiviNodeGetAbility implements Ability
],
'builder_version' => ['type' => ['string', 'null']],
'children' => ['type' => 'array', 'items' => ['type' => 'string']],
'global' => ['type' => ['object', 'null']],
],
'required' => ['post_id', 'tree_rev', 'rev', 'id', 'type', 'editable', 'attrs', 'shortform', 'children'],
];
@@ -128,6 +129,16 @@ final class DiviNodeGetAbility implements Ability
$editable = $block->isDivi() && ! $block->isOpaque();
$version = $block->attrs()['builderVersion'] ?? null;
$global = NodeSummary::globalRef($block);
if ($global !== null) {
$global['hint'] = sprintf(
'Globales Modul: Inhalt im Bibliothekseintrag %s bearbeiten (lit-divi-outline mit post_id %s); '
. 'jede Änderung dort wirkt auf alle Seiten mit diesem Modul.',
$global['id'],
$global['id']
);
}
return [
'post_id' => (int) $page->post->ID,
'tree_rev' => $page->treeRev(),
@@ -147,6 +158,7 @@ final class DiviNodeGetAbility implements Ability
'children' => $editable
? array_values(array_filter(array_map([$page->index, 'idOf'], $block->children())))
: [],
'global' => $global,
];
}
}