Commit 8476cd2
Replace WYMEditor with the RDFa editor for XMLLiteral editing (#336)
* Replace WYMEditor with the RDFa editor for XMLLiteral editing
- 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>
* Fix RDFa editor-bar visual alignment
- 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>
* Add click-to-edit and autosave for XHTML blocks
- 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>
* Suppress form-actions for XHTML blocks and exit edit mode on column click
- bs2:RowForm gains $show-form-actions param (default true); XHTML blocks
pass false via xsl:next-match, omitting the Save/Reset/Cancel buttons
since autosave-on-blur already handles submission
- ixsl:onclick on XHTML blocks in edit mode submits the form when the
click target is outside the editor canvas; interactive elements are
excluded (they steal focus, triggering focusout + autosave instead)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Override RDFa editor annotation typeahead and dialog with LDH's Bootstrap UI
Intercepts local:typeahead-field, local:typeahead-set-value,
local:typeahead-value, and local:render-overlay in form.xsl (which has
higher import precedence than the vendored rdfa-editor/ stylesheets) to
replace the upstream's doc()-on-vocabs typeahead with LDH's /ns-querying
bs2:Lookup widget and to re-style the annotation dialog using Bootstrap
2.3.2 form classes (.well, .form-horizontal, .control-group, .btn).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Refine RDFa editor LDH integration: CSS split, overlay id, modal structure, fieldset fix
- Remove host-UI sections (overlay + toolbar) from vendored rdfa-editor.css; host styles now live only in bootstrap.css
- Replace !important overlay overrides in bootstrap.css with clean rules scoped to #rdfa-editor-overlay; add full #edit-toolbar layout rules
- Parameterize overlay element id via $local:overlay-id in vendored overlay.xsl (matches upstream feature/ldh-integration-seams)
- Restructure RDFa Annotation dialog to follow LDH modal convention: div.modal > div.modal-header + div.modal-body; add label @for attributes
- Suppress fieldset border inside XHTML block edit form to avoid spurious outline around div.main in edit mode
- Mention in-place RDFa editing in README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Extract .edit-dialog styles from vendored rdfa-editor.css; add Bootstrap overrides
Follows upstream feature/ldh-integration-seams: .edit-dialog host-UI rules
(border, border-radius, box-shadow, label/input sizing, action-buttons,
checkbox-label) removed from rdfa-editor.css; Bootstrap-compatible replacements
added to bootstrap.css so toolbar dialogs (insert link, table, figure) inherit
the host UI without Material-blue borders or Roboto sizing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Override toolbar dialog templates in form.xsl with Bootstrap-compatible HTML
Add LDH-layer overrides for all five rdfa-editor named dialog templates
(local:render-table-dialog, local:render-link-dialog, local:render-figure-dialog,
local:render-find-dialog, local:render-extra-dialogs). Each override preserves
the upstream element ids, name attributes, and semantic button classes that the
event handlers depend on, while replacing btn-primary/btn-secondary with Bootstrap's
btn btn-primary / btn / btn btn-danger, adding label @for attributes, and using
Bootstrap's checkbox label pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Handle empty XHTML block in ldh:load-edited-resource
When a block is referenced in the document container (rdf:_N) but has no own
triples, key('resources', \$about) returns empty and the as="element()" type
assertion crashes the promise chain. Synthesise a minimal rdf:Description
from the block element's @typeof attribute so the edit form can open normally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Revert "Handle empty XHTML block in ldh:load-edited-resource"
This reverts commit e6acae8.
* Auto-focus first contenteditable block after editor init to trigger autosave
When a new XHTML block is added via [ + XHTML ] and the user clicks away
without entering the editor, ixsl:onfocusout never fires (focus was never
in the region), so requestSubmit() is never called and the block is not
persisted.
Calling focus() on the first contenteditable block after local:init-region
(or local:init-editor) ensures that any subsequent click outside the region
triggers focusout → requestSubmit() → POST to server.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Forward caller params through the XHTML bs2:RowForm override
Non-tunnel params do not survive xsl:next-match, so the override added
for autosave (show-form-actions=false) dropped the ADD flow's
method='post' along with about and show-cancel-button. The new-block
form fell back to the base template's default method='patch', and the
autosave PATCH's DELETE/INSERT/WHERE update matched zero solutions for
a resource with no triples yet — a silent no-op. The block was never
persisted, and re-editing it failed with an empty key('resources', ...)
cardinality error.
Re-declare the params with the base template's defaults and forward
them, so new XHTML blocks are created via POST again (as they were in
the WYMEditor era) and PATCH only ever targets existing blocks.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Adopt the RDFa editor's w3id.org namespaces (rdfae:, rdfax:)
Vendored editor stylesheets re-synced from RDFa-Editor after its
urn: -> https://w3id.org/atomgraph/rdfa-editor# namespace switch;
client.xsl, form.xsl and document.xsl updated to match.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 11d589d commit 8476cd2
30 files changed
Lines changed: 8882 additions & 66 deletions
File tree
- src/main/webapp/static/com/atomgraph/linkeddatahub
- css
- xsl
- bootstrap/2.3.2
- client
- imports
- rdfa-editor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| 186 | + | |
| 187 | + | |
183 | 188 | | |
184 | 189 | | |
| 190 | + | |
185 | 191 | | |
186 | 192 | | |
187 | 193 | | |
| |||
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
213 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
0 commit comments