refactor: small Divi tree helpers out of DiviWriter (M3)
Block::isPlaceholder replaces the divi/placeholder literals (ledger T4); NodeIndex::parentBlock/sectionLabel replace the two parentBlock copies and DiviWriter::sectionLabel; DiviChange::idOf and Outline::summary replace the duplicated id resolution and outline text; DiviSchema holds the shared input properties. Behaviour unchanged. 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:
@@ -71,15 +71,14 @@ final class DiviContentComposer implements ContentComposer
|
||||
|
||||
$index = NodeIndex::build($layout['document']);
|
||||
$warnings = $composition->warnings()->collect($index, $layout['blocks']);
|
||||
$outline = new Outline($this->design->read()->presetNames());
|
||||
$text = $outline->text($outline->rows($index));
|
||||
if ($outline->wasTruncated()) {
|
||||
$outline = (new Outline($this->design->read()->presetNames()))->summary($index);
|
||||
if ($outline['truncated']) {
|
||||
$warnings[] = DiviWriter::OUTLINE_TRUNCATED;
|
||||
}
|
||||
|
||||
$saved = $this->saver->saveNew($postId, Serializer::document($layout['document']));
|
||||
|
||||
return ['warnings' => array_merge($warnings, $saved), 'outline' => $text];
|
||||
return ['warnings' => array_merge($warnings, $saved), 'outline' => (string) $outline['text']];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user