PhoenixKit 1.7.162: Registration geolocation works, markdown editor fixed
PhoenixKit 1.7.162 fixes two things that quietly did not work: the country, region and city of new registrations, and the markdown editor’s toolbar after LiveView navigation.
Every IP lookup at registration failed in the background, so only the IP was saved and the location fields stayed empty. Lookups now work with no extra setup.
The markdown editor’s toolbar and image insertion worked only after a full page reload, and not at all under a strict Content-Security-Policy. The editor now runs as a LiveView hook, so it works after navigation and under such a policy. Its leave-page warning no longer fires after a successful save. The script_nonce attribute is gone.
Confirmation dialogs now disable their confirm button while the action runs, so a double click cannot run it twice.
Full release notes: PhoenixKit 1.7.162
1.7.162 · 18 June 2026
Added
MarkdownEditor:prompt_insertaction — a host can trigger a client-sidewindow.prompt(e.g. a video URL) and insert the result by substituting%{value}in a template, viasend_update(..., action: :prompt_insert, prompt:, template:), with no inline script of its own. (#601)
Changed
Components.Core.MarkdownEditoris now driven by a LiveView hook (window.PhoenixKitHooks.MarkdownEditorinphoenix_kit.js) instead of an inline<script>plus inlineonclick/onmousedownhandlers. The old approach broke under a strict Content-Security-Policy (a nonce never authorizes inline event handlers; an absent nonce blocks the<script>) and failed on LiveView navigation (a patched-in<script>never re-executes), so the toolbar and image insertion only worked after a full page refresh. Toolbar buttons now carrydata-md-actionattributes; server commands (insert-at-cursor,set-content) arrive viahandleEventfiltered byglobal_idso multiple editors on one page don’t cross-fire; toolbars ship hidden and the hook reveals them, with a<noscript>hint when JS is off. The public component API (:insert_at_cursor, the{:editor_content_changed}host message, the attrs) is unchanged. (#601)confirm_modalconfirm button gainsphx-disable-withso a fast double-click can’t fireon_confirmtwice (e.g. double-enqueue an AI translation). Applies to every confirm modal; no behavior change beyond the in-flight disable. (#601)
Fixed
Utils.Geolocationnow usesReqinstead of calling Finch directly against aPhoenixKit.Finchpool that nothing starts (not PhoenixKit’s empty supervisor, not the installer, which only startsSwoosh.Finch). Every lookup previously raised “unknown registry”, was swallowed by the rescue, and registration fell back to IP-only — soregistration_country/region/citywere never populated. IP geolocation now works with no host supervisor setup (Reqrides its own auto-started pool).retry: falsekeeps the lookup single-shot on the registration path.MarkdownEditor’s unsaved-changesbeforeunloadprompt no longer fires after a successful save — the hook’s local dirty flag now resets when the server reportssave_status"saved", instead of staying armed for the page’s life after the first keystroke (most hosts never push thechanges-statusevent that previously cleared it).
Removed
MarkdownEditorscript_nonceattr — unused now that the editor is hook-driven. (#601)- Orphaned
priv/static/assets/phoenix_kit_markdown_editor.js— the old standalone inline-script implementation, superseded by theMarkdownEditorhook inphoenix_kit.jsand referenced by nothing (the installer copies onlyphoenix_kit.js).
i18n
- Gettext-wrapped the
MarkdownEditorheading-button title (Heading %{level}, previously a hardcoded string) and refreshed the JS-disabled<noscript>hint copy. Both are translatable; the translation catalogs pick them up on the next resync. (#601)
PhoenixKit 1.7.162. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.