From 11bb8c058cfac0938485d7734897c006605221fe Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 19 Jun 2026 20:19:12 +0000 Subject: [PATCH] host: /new mounts the real WYSIWYG editor (sx-editor.js), 181/181 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the plain textarea at GET /new with the real Ghost/Koenig-style block editor (shared/static/scripts/sx-editor.js): a #sx-editor mount point + hidden sx_content field + title + status; on submit getSx() fills sx_content and POSTs to /new (the proven ingest). Assets (sx-browser.js, sx-editor.js, editor.css) referenced from the docs static host (sx.rose-ash.com/static/scripts) — STOPGAP hardcoded URLs pending an asset-manifest (Phase 5.2) and a native SX-island editor. SxEditor.mount({}) is safe (all opts guarded); getSx() needs no SX runtime. Wiring + assets + mount-safety validated; browser mount needs visual check (no Playwright in this worktree). Co-Authored-By: Claude Opus 4.8 --- lib/host/blog.sx | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/lib/host/blog.sx b/lib/host/blog.sx index c2efd087..f880db78 100644 --- a/lib/host/blog.sx +++ b/lib/host/blog.sx @@ -98,21 +98,40 @@ (define host/blog-index (fn (req) (host/ok (host/blog-list)))) -;; ── create form (GET /new) — minimal chrome; the SX editor posts here too ── +;; ── create page (GET /new) — the real WYSIWYG block editor ────────── +;; Mounts the self-contained sx-editor.js (Ghost/Koenig-style block editor) that +;; serializes the visual edit to `sx_content`. Assets (sx-browser.js for Sx.parse, +;; sx-editor.js, editor.css) are referenced from the docs static host +;; (sx.rose-ash.com/static/scripts) — no host static-serving needed. On submit the +;; handle's getSx() fills the hidden sx_content field, then it POSTs to /new. +;; (This reuses the legacy JS editor; a native SX-island editor is the future.) +(define host/blog--asset "https://sx.rose-ash.com/static/scripts") (define host/blog-new-form (fn (req) (dream-html - (host/blog--page "New post" - (str - "

New post

" - "
" - "

" - "

" - "

" - "

" - "

← all posts

"))))) + (str + "New post" + "" + "" + "" + "
" + "" + "" + "
" + "
" + "" + "" + "all posts
" + "
" + "" + "" + "" + "")))) ;; ── write handlers ────────────────────────────────────────────────── ;; POST /new — form-urlencoded ingest (the editor's submit shape: title,