From 50c7a54b1e92f13f4f7f5ceb074189b3912395bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Sun, 5 Jul 2026 01:41:10 +0200 Subject: [PATCH] XSLT refactoring prep + ldh/ fork entry point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prep 1: uncomment @typeof on all block outer divs (typed/XHTML/SaxonJS wrapper) in resource.xsl so CSS [typeof~="..."] selectors and depth- independent handler anchors work. Prep 2: emit aria-current="page" on active mode link; emit and keep aria-expanded in sync on left-sidebar show/hide in navigation.xsl. Prep 3: replace depth-locked axes in block.xsl with ancestor::*[...][1] traversal (ondragover/enter/leave/drop document-body lookup, drag-handle span12 lookup); replace sibling-relative btn-edit match with ancestor RDFa match; replace ixsl:style() readback in onmousemove with aria-expanded attribute check. Fork: add xsl/ldh/layout.xsl — imports bootstrap/2.3.2/layout.xsl and overrides structural templates to remove Bootstrap grid classes (row-fluid, span7, span2, container-fluid) while keeping load-bearing DOM anchor classes (document-body, content-body, block, span12). Introduces ldh:BlockContent mode to share SSR/CSR content dispatch without the Bootstrap SaxonJS wrapper's hardcoded div.span12. Add css/ldh.css — initial design layer keyed on RDFa typeof selectors and ARIA state attributes; flex layout for .ldh-content/.ldh-block. Activate the ldh tree by changing the import in static/xsl/layout.xsl from ../bootstrap/2.3.2/layout.xsl to ../ldh/layout.xsl. Co-Authored-By: Claude Sonnet 4.6 --- .../com/atomgraph/linkeddatahub/css/ldh.css | 73 +++++ .../xsl/bootstrap/2.3.2/client/block.xsl | 14 +- .../xsl/bootstrap/2.3.2/client/navigation.xsl | 3 + .../xsl/bootstrap/2.3.2/resource.xsl | 16 +- .../linkeddatahub/xsl/ldh/layout.xsl | 273 ++++++++++++++++++ 5 files changed, 367 insertions(+), 12 deletions(-) create mode 100644 src/main/webapp/static/com/atomgraph/linkeddatahub/css/ldh.css create mode 100644 src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/ldh/layout.xsl diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/css/ldh.css b/src/main/webapp/static/com/atomgraph/linkeddatahub/css/ldh.css new file mode 100644 index 000000000..abaa38f0d --- /dev/null +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/css/ldh.css @@ -0,0 +1,73 @@ +/* LinkedDataHub design layer — loaded on top of the Bootstrap stack. + * Selectors key on RDFa (@typeof, @about) and ARIA, never on Bootstrap grid classes. + * Bootstrap grid classes (span2, span7, row-fluid, etc.) intentionally absent here. + */ + +/* ─── Document layout ────────────────────────────────────────── */ + +.ldh-document { + display: grid; + grid-template-rows: auto 1fr; +} + +/* ─── Content area: stacked blocks ───────────────────────────── */ + +.ldh-content { + display: flex; + flex-direction: column; + gap: 1rem; + padding: 1rem; +} + +/* ─── Generic resource block ──────────────────────────────────── */ + +.ldh-block { + display: flex; + gap: 1rem; +} + +.ldh-block-body { + flex: 1 1 auto; + min-width: 0; +} + +.ldh-block-nav { + flex: 0 0 200px; +} + +/* ─── Resource header ─────────────────────────────────────────── */ + +.ldh-header { + padding: 0.75rem 0; + border-bottom: 1px solid #e0e0e0; + margin-bottom: 0.75rem; +} + +/* ─── RDFa typeof selectors (examples; extend per vocabulary) ─── */ + +/* Containers get a subtle left border */ +[typeof~="https://www.w3.org/ns/ldt/document-hierarchy#Container"] > .ldh-block-body { + border-left: 3px solid #5b9bd5; + padding-left: 0.75rem; +} + +/* XHTML content blocks — full width, no nav sidebar */ +[typeof~="https://w3id.org/atomgraph/linkeddatahub#XHTML"] { + flex-direction: column; +} + +[typeof~="https://w3id.org/atomgraph/linkeddatahub#XHTML"] > .ldh-block-nav { + display: none; +} + +/* ─── ARIA state selectors ────────────────────────────────────── */ + +/* Active mode link */ +a[aria-current="page"] { + font-weight: bold; +} + +/* Collapsed left sidebar */ +.left-sidebar[aria-expanded="false"] { + display: none; +} diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl index 96fa08abf..3046087f6 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block.xsl @@ -237,7 +237,7 @@ exclude-result-prefixes="#all" - + @@ -258,7 +258,7 @@ exclude-result-prefixes="#all" - + @@ -311,7 +311,7 @@ exclude-result-prefixes="#all" - + @@ -419,7 +419,7 @@ exclude-result-prefixes="#all" - + @@ -438,7 +438,7 @@ exclude-result-prefixes="#all" - + @@ -455,7 +455,7 @@ exclude-result-prefixes="#all" - + @@ -478,7 +478,7 @@ exclude-result-prefixes="#all" - + diff --git a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl index ba5c52a93..553edf89a 100644 --- a/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl +++ b/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/navigation.xsl @@ -105,6 +105,7 @@ ORDER BY DESC(?created) +