host: style the /new editor — inline sx-editor styles via render-page
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 30s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 30s
The editor was unstyled: editor.css is .koenig-lexical-scoped (the OTHER editor);
the sx-editor's .sx-* styles live in the ~editor/sx-editor-styles component
(inline <style> in blog/sx/editor.sx). Inline them into /new by rendering that
component with the 5.1 render-page primitive (dogfooding the capability live), +
FontAwesome for the +/slash-menu icons. 79 .sx- rules now inlined.
Also: the sx_host container only mounted spec+lib, so web/adapter-html.sx (and
now blog/sx/{layouts,editor}.sx) silently failed to load at boot -> render-page
errored -> /new 502. Mount ./web + ./blog (ro) so they load. (Transitional reuse
of the legacy blog editor component + its styles; retire via the asset-manifest +
native SX-island editor.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,10 @@ services:
|
||||
# SX source (hot-reload on container restart)
|
||||
- ./spec:/app/spec:ro
|
||||
- ./lib:/app/lib:ro
|
||||
- ./web:/app/web:ro
|
||||
# blog app SX — reused for the editor's style component (transitional;
|
||||
# retire when the editor + its styles are host-owned / asset-managed)
|
||||
- ./blog:/app/blog:ro
|
||||
# OCaml server binary — this worktree's build (has the SX_HTTP_HOST bind fix)
|
||||
- ./hosts/ocaml/_build/default/bin/sx_server.exe:/app/bin/sx_server:ro
|
||||
# Durable persist store (the SX op-log/kv on disk) — survives restarts.
|
||||
|
||||
@@ -111,7 +111,10 @@
|
||||
(dream-html
|
||||
(str
|
||||
"<!doctype html><html><head><meta charset=\"utf-8\"><title>New post</title>"
|
||||
"<link rel=\"stylesheet\" href=\"" host/blog--asset "/editor.css\">"
|
||||
;; FontAwesome for the editor's +/slash-menu icons.
|
||||
"<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css\">"
|
||||
;; The sx-editor's own styles (.sx-*), rendered from its component via 5.1.
|
||||
(render-page (quote (~editor/sx-editor-styles)))
|
||||
"<style>body{max-width:768px;margin:2rem auto;padding:0 1rem;font-family:system-ui}"
|
||||
"#title-input{width:100%;font-size:1.9em;font-weight:700;border:none;outline:none;margin:.5rem 0}"
|
||||
".bar{display:flex;gap:1rem;align-items:center;margin-top:1.5rem;border-top:1px solid #eee;padding-top:1rem}</style>"
|
||||
|
||||
@@ -63,6 +63,8 @@ MODULES=(
|
||||
"lib/persist/durable.sx"
|
||||
"spec/render.sx"
|
||||
"web/adapter-html.sx"
|
||||
"blog/sx/layouts.sx"
|
||||
"blog/sx/editor.sx"
|
||||
"lib/dream/types.sx"
|
||||
"lib/dream/json.sx"
|
||||
"lib/dream/auth.sx"
|
||||
|
||||
@@ -68,6 +68,8 @@ MODULES=(
|
||||
"lib/persist/durable.sx"
|
||||
"spec/render.sx"
|
||||
"web/adapter-html.sx"
|
||||
"blog/sx/layouts.sx"
|
||||
"blog/sx/editor.sx"
|
||||
"lib/dream/types.sx"
|
||||
"lib/dream/json.sx"
|
||||
"lib/dream/auth.sx"
|
||||
|
||||
Reference in New Issue
Block a user