Publishing 0.2.1: Editor without inline scripts, and working video inserts
Publishing 0.2.1 fixes videos inserted from the editor toolbar. They were inserted as image Markdown, which the page rendered as a broken image. The toolbar now inserts the <Video url="…"> component that the renderer supports.
The post editor also no longer uses inline scripts or onclick handlers, so it works under a strict Content Security Policy and after LiveView navigation:
- Inserting an image no longer needs a page refresh.
- The unsaved-changes warning is a modal from the server instead of a browser
confirm(). - The AI translation dialog pre-selects an endpoint, the last one used or else a chat endpoint, and closes itself after a successful translation.
Full release notes: Publishing 0.2.1
0.2.1 · 18 June 2026
PR #26 — rewires the post editor onto the core MarkdownEditor hook so it renders zero inline <script> and zero onclick (CSP-safe and navigation-safe), plus a post-merge review pass. No public API breaks. Built against phoenix_kit ~> 1.7.162 / phoenix_kit_ai ~> 0.9 (existing constraints unchanged; the editor-hook and smart-default behaviors light up on those releases and degrade gracefully on older ones).
Changed
- Editor media insertion flows through the core
MarkdownEditor— images via:insert_at_cursorand video via the:prompt_insertaction — so insertion no longer needs a module-owned inline<script>and survives LiveView navigation (image insert previously required a manual page refresh). - Unsaved-changes confirmation is a server-rendered modal instead of a JS
confirm()(which broke under CSP / on navigation). - The AI-translation modal pre-selects the endpoint from core’s smart default (last-used from history, else a non-reasoning chat endpoint) and auto-closes on a successful translation, so you no longer re-pick the endpoint or close the modal by hand.
- The auto-generated slug renders straight from the form assign, dropping the dead
update-slugpush andForms.push_slug_events/2.
Fixed
- Video toolbar inserts the renderer-supported
<Video url="…">component instead ofmarkdown, which the renderer turned into a broken<img>. Now matches the image-insert path and theinsert_component/insert_video_componenthandlers. - Reformatted
editor_forms_test.exs(stray trailing blank line left by thepush_slug_events/2test removal).
Publishing 0.2.1. Install or update: {:phoenix_kit_publishing, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.