lit/divi-catalog's path_kinds previously named one kind per whole attribute path, built from Divi's metadata component name alone. For a composite path (Divi groups several named sub-fields, "subName", under one path – e.g. buttonOne.innerContent holds "text" and "linkUrl") that was wrong: the whole path got one guessed kind (or none), even though the sub-fields can differ (fullwidth-header's buttonOne/buttonTwo.innerContent -> "text", though it also carries a "linkUrl"; image.innerContent -> "image", though the value also carries alt/id/titleText the metadata never names on its own). AttrPathIndex::kinds() now resolves a composite path to a map subName => kind instead, preferring Divi's features.dynamicContent.type over the (often shared/generic) field component for a named sub-field – this is what tells a button's plain text sub-field apart from its linkUrl sub-field, both of which use the same generic "divi/text" component. A plain (non- composite) path is unaffected. Any subName the metadata never names (or that disagrees between candidates) is therefore simply absent from the map, and ModuleCatalog::pathKind() defaults it, like every unresolved path, to "unknown" - the strictest routing for 2b's sanitizer, never a guess. ModuleCatalog::pathKind() gains an optional $subName parameter to read a composite path's map. docs/guides/divi-attrs.md documents the new shape and that lit-divi-catalog without `module` lists all modules. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
36 lines
2.1 KiB
Markdown
36 lines
2.1 KiB
Markdown
# Divi-Einstellungen (Vollform)
|
||
|
||
Jedes Divi-5-Modul speichert seine Einstellungen unter **Attributpfaden**, z. B.
|
||
|
||
- `title.innerContent` – Text der Überschrift,
|
||
- `title.decoration.font.font` – Schrift der Überschrift (Farbe, Größe, Ebene `headingLevel`),
|
||
- `button.innerContent` – Beschriftung und Link eines Buttons (`text`, `linkUrl`, `linkTarget`),
|
||
- `module.decoration.background` – Hintergrund, `module.decoration.spacing` – Innen-/Außenabstand,
|
||
- `module.meta.adminLabel` – Admin-Label im Divi-Builder.
|
||
|
||
Der Wert eines Pfads ist eine Zuordnung **Breakpoint → Zustand → Wert**:
|
||
|
||
```json
|
||
{ "desktop": { "value": { "color": "#1a1a1a", "headingLevel": "h2" }, "hover": { "color": "#000000" } },
|
||
"phone": { "value": { "size": "28px" } } }
|
||
```
|
||
|
||
Breakpoints: `desktop`, `tablet`, `phone` (je nach Website auch `tabletWide`, `phoneWide`, `widescreen`,
|
||
`ultraWide`); Zustände: `value`, `hover`, `sticky`.
|
||
|
||
## Pfade finden
|
||
|
||
- `lit-divi-catalog` ohne `module` listet alle Module dieser Website; mit `module` (z. B. `"heading"`) alle
|
||
gültigen Pfade dieses Moduls auf dieser Website (live aus Divi) und die Kurzform-Felder mit ihrem Pfad.
|
||
`path_kinds` nennt die Feldart eines Pfads (`text`, `richtext`, `code`, `url`, `image`, `color`, `enum`,
|
||
`onoff`, `number`, `list`, `icon`), soweit aus den Divi-Metadaten ableitbar. Bei einem zusammengesetzten
|
||
Pfad (mehrere benannte Unterfelder unter einem Pfad, z. B. `buttonOne.innerContent` mit `text` und
|
||
`linkUrl`) ist der Eintrag stattdessen eine Zuordnung Unterfeld → Feldart (`{"text": "text", "linkUrl":
|
||
"url"}`), soweit für die einzelnen Unterfelder ableitbar; fehlende Pfade oder Unterfelder gelten als
|
||
unbekannt, statt eine Feldart zu raten.
|
||
- `lit-divi-node-get` zeigt die gesetzten Werte eines vorhandenen Knotens in genau dieser Form (`attrs`).
|
||
- Schrift-Gruppen liegen eine Ebene tiefer: `…decoration.font.font`, `…decoration.bodyFont.body.font`,
|
||
`…decoration.headingFont.h2.font`, `module.advanced.text.text`.
|
||
- Werte wie `$variable({…})$` sind Verweise auf globale Farben, Variablen oder dynamische Inhalte – nicht
|
||
durch feste Werte ersetzen (siehe `divi-design-system`).
|