feat: lit/divi-insert and lit/divi-update
All-or-nothing at ability level (S39), duplicate ids refused (S14), set and attrs on the same path refused (S38), invalid_attr_path error. 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:
@@ -72,6 +72,25 @@ final class ShortformWriter
|
||||
return ['attrs' => $attrs, 'errors' => $errors];
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute paths the given short-form fields of $type write to (unknown fields left out).
|
||||
*
|
||||
* @param list<string> $names Field names.
|
||||
* @return array<string, string> Field => attribute path.
|
||||
*/
|
||||
public function paths(string $type, array $names): array
|
||||
{
|
||||
$fields = $this->modules === null ? ShortformMap::fields($type) : ($this->modules[$type] ?? []);
|
||||
$paths = [];
|
||||
foreach ($names as $name) {
|
||||
if (isset($fields[$name]['path'])) {
|
||||
$paths[$name] = (string) $fields[$name]['path'];
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* The short-form color check (ruling S13; Task 3 reuses it for background_color): a
|
||||
* placeholder or reference that is a color reference, or a plain CSS color – checked
|
||||
|
||||
Reference in New Issue
Block a user