v1.14.0 — Global Classes write tools (v4 design-system CRUD)
Elementor v4 Global Classes — write tools (CRUD + apply)
The write half of the design system. Where list-global-classes reads the Class Manager, these four tools let an AI agent author it. All manage_options-gated; register only when Elementor exposes a supported Global Classes write API.
create-global-class— label + ergonomicstylesmap ({"color":"#111","padding":24}, auto-wrapped to atomic$$typeprops) + optional responsive/statevariants. Mints ag-<7hex>editor-format id; validates against Elementor's atomicStyle_Schema(unknown props / type mismatches rejected with the schema embedded in the error for self-correction); refuses at Elementor's 100-class cap.update-global-class— edits in place, preserving theg-id so bindings survive; replaces only the base variant (keeps others) or matching breakpoint/state variants; renames vialabel.delete-global-class— removes by id (Elementor ignores dangling refs, no cascade).apply-global-class— binds a class to an atomic element'ssettings.classes; non-atomic targets rejected with their compact schema (schema-in-error); re-apply is a no-op.
Correctness (verified against Elementor core source + git history)
- Writes use Elementor's touched-item
apply_changes()API (bulkput()fallback on older builds) so a mutation reconciles only that class's editor-preview state — never clobbering a user's unpublished drafts for other classes. Writes target the published/frontend context, respecting the publish boundary. - Base variant stored as the string
desktopbreakpoint (parser round-trip); numeric props wrapped as atomicnumber; flexgap(structuredlayout-direction) andbackground(structured) deliberately excluded from the flat map rather than mis-typed. - Availability gated on a supported write API (touched-item
apply_changes, or a reflection-verified bulkput(array,…)) — the tools don't register on ancient per-class-put()alphas instead of failing at call time.
Enabled by default (atomic-capable installs). Suite: 558 tests green. Converged over 11 Codex review rounds.