refactor: one VariableRef per composition, design lookups in DesignSystem (H3)
- DiviComposition::references() builds the one VariableRef with the entry's
live map (S22/S31) and passes it to AttrWriter; Placeholders only needs the
design system now, Placeholders::references() is gone (no reach-through).
- DesignSystem::colorIdFor()/variableFor() replace the dead colorId()/variable()
and carry Placeholders' lookup incl. the S13a ambiguity check (byLabel moved,
messages unchanged); isColorVariable() decides color vs content for {{var:}}.
- DesignSystem::colorReferenceIds() (VariableRef color names) and
contentVariableIds() (DynamicContentRules design names) replace the two
inline computations; same lists, same order.
Tests: fixtures/tests get the VariableRef from ComposeFixture::references() or
build it with the map; DesignSystemTest uses the new lookups (+2 tests).
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:
@@ -116,13 +116,7 @@ final class DynamicContentRules
|
||||
));
|
||||
}
|
||||
|
||||
$design = array_values(DesignSystem::FONT_VARIABLES);
|
||||
foreach ($this->design->variables() as $variable) {
|
||||
if ($variable['type'] !== 'colors') {
|
||||
$design[] = $variable['id'];
|
||||
}
|
||||
}
|
||||
if (in_array($name, $design, true)) {
|
||||
if (in_array($name, $this->design->contentVariableIds(), true)) {
|
||||
return self::DESIGN_SETTINGS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user