From f5fa224cd4fd513d88cc7f83eed44e56a0e0859e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Mon, 27 Jul 2026 12:02:35 +0300 Subject: [PATCH] Add LDH integration seams: init-state/init-editor/init-region/toolbar-host - Extract local:init-state and local:init-editor from main; hosts can call init-state from their own entry point and init-editor lazily on first region - Extract local:init-region from init-editing's per-root body; seeds


in empty regions so they can hold a caret; callable per-region for hosts that render editable regions after the initial page load - Add local:toolbar-host() seam function (default: ixsl:page()//nav); hosts without a nav element override this to point at their own chrome - Rename breadcrumb ids to rdfa-editor-breadcrumb-* to avoid collisions with host page ids; update CSS and navigate.xsl references accordingly Co-Authored-By: Claude Sonnet 4.6 --- docs/ldh/MIGRATION.md | 4 ++- rdfa-editor.css | 4 +-- src/edit.xsl | 56 ++++++++++++++++++++++++++----------- src/index.xsl | 26 ++++++++++++----- src/navigate.xsl | 16 +++++------ tests/browser/features.mjs | 10 +++---- tests/browser/hardening.mjs | 2 +- 7 files changed, 77 insertions(+), 41 deletions(-) diff --git a/docs/ldh/MIGRATION.md b/docs/ldh/MIGRATION.md index 3f22502..a5da131 100644 --- a/docs/ldh/MIGRATION.md +++ b/docs/ldh/MIGRATION.md @@ -67,7 +67,9 @@ kept the textarea in sync continuously; the replacement syncs once, declarativel Key points: serialize the container's **children only** (no wrapper element — parse-rdf-post adds the div); `mode="canonical"` guarantees the stored literal is sanitized and free of editing ephemera (chrome, contenteditable, classes, on* -handlers, unsafe URLs). +handlers, unsafe URLs). SaxonJS 3 applies `ixsl:set-property` immediately +(verified in-browser), so the value is readable by `ldh:parse-rdf-post` within +the same submit event. ### 4. Asset loading — `layout.xsl` diff --git a/rdfa-editor.css b/rdfa-editor.css index ed87253..60aa7c4 100644 --- a/rdfa-editor.css +++ b/rdfa-editor.css @@ -536,7 +536,7 @@ } /* Breadcrumb bar (Fonto-style element path + RDFa subject) */ - #breadcrumb { + #rdfa-editor-breadcrumb { position: fixed; left: 0; right: 0; @@ -565,7 +565,7 @@ margin: 0 4px; } -#breadcrumb-subject { +#rdfa-editor-breadcrumb-subject { font-family: 'Courier New', monospace; font-size: 12px; color: #1565c0; diff --git a/src/edit.xsl b/src/edit.xsl index e830f2b..9ad2987 100644 --- a/src/edit.xsl +++ b/src/edit.xsl @@ -35,6 +35,12 @@ version="3.0"> + + + + + @@ -346,7 +352,7 @@ version="3.0"> - + @@ -362,23 +368,39 @@ version="3.0"> - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + diff --git a/src/index.xsl b/src/index.xsl index cbfdfd2..29fd278 100644 --- a/src/index.xsl +++ b/src/index.xsl @@ -52,19 +52,31 @@ version="3.0"> documents into the SaxonJS document pool (SaxonJS.getResource + documentPool), keyed by page-relative URI --> - - + + + + + + + + - + - - - + + + + + + diff --git a/src/navigate.xsl b/src/navigate.xsl index 7778afc..a655c8b 100644 --- a/src/navigate.xsl +++ b/src/navigate.xsl @@ -35,10 +35,10 @@ version="3.0">

-