• v0.2.2 2ce7e72dfe

    UltimateByte released this 2026-05-22 02:20:38 +02:00 | 92 commits to main since this release

    Foundation work for the upcoming Newsletter module: the Contact Form's form-builder (drag-and-drop editor, structure normalisation, field renderers, anti-spam wiring) has been extracted from src/Modules/ContactForm/ into a new shared src/Forms/ namespace. Newsletter (landing in v0.3.0) will mount the same editor with its own field types and CPT — zero JS duplication.

    Plus the small WP 7.0 cosmetic fix that was sitting on main between v0.2.0 and now.

    Form-builder refactor

    • New LRob\EmailToolkit\Forms\ namespace under src/Forms/: FormStructure, FormContext, FormEditorRenderer, FieldRenderHelpers, FieldTypeInterface, FieldTypeRegistry, plus the 10 stock field types (Text, Email, Textarea, Number, Phone, Date, Select, Radio, Checkbox, Submit) under Fields/.
    • FieldTypeRegistry is keyed by CPT slug — each consumer module declares its allowed types for its own form CPT. Contact Form keeps all 11 of its types (including its module-specific captcha); Newsletter will register a smaller set plus its own picker types.
    • Plugin::boot() wires the registry into the container before module boot, so modules can register types immediately.
    • FormContext is host-neutral: start($form_id, $instance, $name_prefix, $id_prefix, $editor) accepts module-specific prefixes. Contact Form passes lrob_etk_cf / lrob-etk-cf; Newsletter will pass lrob_etk_nl / lrob-etk-nl.
    • Contact Form's captcha field is now src/Modules/ContactForm/Fields/CaptchaField.php — captcha routing stays tied to its module's meta key + Captcha-module context.

    Asset rename + CSS namespace flip

    • Editor JS renamed admin/js/contact-form-fields-editor.jsadmin/js/form-fields-editor.js (handle: lrob-etk-form-fields-editor).
    • Form-builder DOM classes renamed lrob-etk-cf-*lrob-etk-form-* (form wrapper, row/col/field, label/helper/error, overlay/insert/edit-shell, options, submit, required toggles, inline-settings strip, type picker, preset modifier — about 35 classes across CSS/JS/PHP).
    • Module-specific admin chrome keeps its own prefix: Contact Form's form cards, recipients picker, modals, submissions panel etc. stay lrob-etk-cf-*; Newsletter's admin chrome will be lrob-etk-nl-*. Per-module captcha field types keep their own CSS namespace too (lrob-etk-cf-captcha-* for Contact Form).

    Other

    • WP 7.0 button line-height (the 0.2.1 fix bundled into this release): override the new core rule .button .dashicons { line-height: 1.9 } so toolkit buttons with leading icons keep their vertical centering.

    Design spec

    newsletter.md at the repo root documents the full Newsletter module design — data model, send pipeline, tracking, import/export, system email templates as a CPT, scale targets, implementation slicing. Referenced from CLAUDE.md. Worth reading if you want a preview of what v0.3.0 will land.

    No behavior change

    Existing Contact Forms continue to work unchanged. No DB migration. CSS rename is a like-for-like flip with no functional impact. Form-builder editor, frontend rendering, submissions, anti-spam, captcha — all behaviorally identical.

    Downloads