Skip to content

Replace WYMEditor with the RDFa editor for XMLLiteral editing#336

Open
namedgraph wants to merge 3 commits into
developfrom
rdfa-editor-integration
Open

Replace WYMEditor with the RDFa editor for XMLLiteral editing#336
namedgraph wants to merge 3 commits into
developfrom
rdfa-editor-integration

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Summary

Replaces the jQuery/iframe WYMEditor with the XSLT/SaxonJS RDFa editor for editing rdf:XMLLiteral values (ldh:XHTML blocks), per the upstream docs/ldh/MIGRATION.md contract. The editor modules are vendored byte-identical under xsl/rdfa-editor/ and imported from client.xsl at lower precedence; all LDH-specific behavior lives in LDH's own layer as overrides.

  • Form control (imports/default.xsl): XMLLiteral values render as editable div.rdfa-editor-content regions with hidden ol/lt inputs instead of a serialized textarea.wymeditor
  • Initialization (client.xsl, form.xsl): editor state container created in the main template; the first rendered region brings up the full editor chrome via local:init-editor, subsequent regions init via local:init-region
  • Toolbar hosting (document.xsl, form.xsl, bootstrap.css): the singleton toolbar mounts in a per-document div.editor-bar below the action bar (LDH pages have no nav element, which upstream's default host lookup expects); sticky, styled to match the action bar, hidden together with the editor breadcrumb footer while no editable region is open
  • Submit (form.xsl, block.xsl): ldh:FormPreSubmit serializes the canonicalized region content into the ol input. The block-POST and generic row-form submit handlers previously parsed the RDF/POST inputs in xsl:param defaults — before the FormPreSubmit pass could sync them — which dropped the empty ol and tripped the ldh:XHTML :MissingValue SPIN constraint; both handlers now run the pass first and canonicalize XMLLiterals in the request body
  • Event handlers (navigation.xsl): the body onmousemove sidebar-reveal handler chains via xsl:next-match to the editor's sweep-selection tracker it shadowed by import precedence
  • Assets (layout.xsl): WYMEditor script/skin gone; rdfa-editor.css loads under the same conditions

Test plan

  • Upstream headless suites (extractor, canonical, lint) pass
  • Upstream Playwright browser suites pass
  • Manual: add [+ XHTML] block, edit (blocks, formatting, breadcrumb), save — literal round-trips without SPIN violations
  • Manual: second concurrent editor region inits without duplicate chrome
  • Manual: toolbar/breadcrumb hidden when no editor is open; sticky below action bar while editing

🤖 Generated with Claude Code

namedgraph and others added 3 commits July 27, 2026 02:14
- vendor the RDFa editor XSLT modules under xsl/rdfa-editor/ (synced
  from the RDFa-Editor repo) and import them from client.xsl
- render XMLLiteral form controls as editable div.rdfa-editor-content
  regions with hidden ol/lt inputs (imports/default.xsl)
- create the editor state container in the client main template;
  full chrome bring-up on the first region, per-region init afterwards
  via the upstream local:init-editor/local:init-region seams (form.xsl)
- serialize canonicalized editor content into the ol input in
  ldh:FormPreSubmit
- run the ldh:FormPreSubmit pass before ldh:parse-rdf-post in the block
  POST and generic row-form submit handlers (previously the param
  defaults parsed the inputs before the pass could sync them, dropping
  the empty ol and tripping the ldh:XHTML MissingValue constraint) and
  canonicalize XMLLiterals in the request body (block.xsl, form.xsl)
- chain body onmousemove to the editor's sweep-selection tracker
  which it shadowed by import precedence (navigation.xsl)
- host the singleton toolbar in a per-document editor-bar below the
  action bar (document.xsl slot + local:toolbar-host override); sticky,
  matching action-bar chrome, hidden while no editable region is open
  along with the editor breadcrumb footer (bootstrap.css)
- drop the WYMEditor assets from layout.xsl; load rdfa-editor.css
  under the same conditions instead

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Move border to action-bar bottom (border-top on editor-bar was hidden under action-bar's higher z-index)
- Flex-center editor-bar content (Bootstrap navbar-inner has min-height: 50px with no vertical centering)
- Fix select vertical alignment via auto margins (Firefox ignores align-items: center on native select)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Click anywhere on .main content to enter edit mode (skips if text selected)
- Autosave XMLLiteral on focusout unless focus moved to toolbar/editor UI
- Hide .btn-edit on XHTML blocks (entry point is now content click)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant