Skip to content

v1.14.0 — Global Classes write tools (v4 design-system CRUD)

Choose a tag to compare

@BenKalsky BenKalsky released this 06 Jul 20:21
· 55 commits to main since this release
e9fc3be

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 + ergonomic styles map ({"color":"#111","padding":24}, auto-wrapped to atomic $$type props) + optional responsive/state variants. Mints a g-<7hex> editor-format id; validates against Elementor's atomic Style_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 the g- id so bindings survive; replaces only the base variant (keeps others) or matching breakpoint/state variants; renames via label.
  • delete-global-class — removes by id (Elementor ignores dangling refs, no cascade).
  • apply-global-class — binds a class to an atomic element's settings.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 (bulk put() 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 desktop breakpoint (parser round-trip); numeric props wrapped as atomic number; flex gap (structured layout-direction) and background (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 bulk put(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.