Repository navigation
Editor fixes: isolate native events, label every slot type, theme closure - #5
Merged
Merged
Conversation
…sure - The browser's native change and input events from the editor's fields no longer bubble out of it, and the Filament component ignores any event that is not the editor's own. This removed a TypeError on blur. - The schema export carries a label for every slot type, so a block that is not editable yet shows its name. - MailEditor::theme() accepts a closure, evaluated for each preview and winning over a theme from the browser, so the preview can follow the form's theme fields. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three things found when the editor was tried in a real Marketing admin on staging, for a 2.2.0 release.
changeevent from an input inside the editor bubbled up to<odden-mail-editor>, where the Filament component readevent.detail.slotsand threw aTypeError. The editor now stops nativechangeandinputevents at its root (a surrounding form no longer sees every keystroke either), and the Filament component ignores any event that is not the editor's ownCustomEventwith a document. In the workbench: 0 native events escape, and no page errors.labelsmap for every slot type (SlotType::label()), and the editor uses it. Additive: the schemaversionstays 1.MailEditor::theme()now takes an array or a closure, evaluated for every preview (fn (Get $get): array => $get('theme') ?? []). The field's theme is applied on the server and wins over a theme sent by the browser, so the Alpine component no longer sends one.Tests: 111 PHP (new: labels for all 29 types; closure theme re-evaluated per preview; the field's theme beats a browser theme; a closure returning null means no theme) and 21 JS pass; PHPStan and Pint pass;
resources/distrebuilt and checked. Checked in a browser in the Filament workbench (now with an undescribedtestimonialblock).Needs a
crm-prochange to use the theme closure (one line inMarketingTemplateResource, plus a Livewire test that the form's theme reaches the preview), then the 2.2.0 tag and bumps.🤖 Generated with Claude Code