Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix(examples): refresh README architecture viewers

sunsunsune6aa4ebb035b
diff --git a/archify/test/share-card-export.test.mjs b/archify/test/share-card-export.test.mjs
index b1529810..36510cb2 100644
--- a/archify/test/share-card-export.test.mjs
+++ b/archify/test/share-card-export.test.mjs
@@ -44,6 +44,14 @@ test('all five renderers remove ordinary share cards while retaining other expor
}
});
+test('README architecture examples do not retain ordinary share-card entries', () => {
+ for (const file of ['archify-repo.html', 'archify-repo-grid.html', 'maka-architecture.html']) {
+ const html = fs.readFileSync(path.join(skillRoot, '..', 'examples', file), 'utf8');
+ assert.equal(/data-format="share-card"|data-action="copy-share-card"/.test(html), false,
+ `${file}: regenerate this README example to remove the old share-card entries`);
+ }
+});
+
test('Share Card uses contain-only canonical geometry with fixed safe areas', () => {
const html = render('architecture');
assert.match(html, /var panelWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING \* 2;[\s\S]*?var availableWidth = panelWidth - inset \* 2;/);
diff --git a/examples/archify-repo-grid.html b/examples/archify-repo-grid.html
index 5b053f7c..b35243e6 100644
--- a/examples/archify-repo-grid.html
+++ b/examples/archify-repo-grid.html
@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="archify 2.17.0-dev.1">
+ <meta name="archify-reader-contract" content="declared-wide-v1">
<title>Archify Pipeline Diagram</title>
<script>
// Resolve the theme before first paint so light-preference users don't
@@ -173,6 +174,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
[data-theme="dark"] {
--bg: #020617;
--grid: #1e293b;
+ --canvas-dot: rgba(148, 163, 184, 0.16);
--text: #ffffff;
--text-muted: #94a3b8;
--text-dim: #475569;
@@ -214,15 +216,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
[data-theme="light"] {
- --bg: #f8fafc;
- --grid: #e2e8f0;
- --text: #0f172a;
- --text-muted: #64748b;
- --text-dim: #94a3b8;
- --text-faint: #64748b;
+ --bg: #f4f5f7;
+ --grid: #e9edf2;
+ --canvas-dot: #d9dee5;
+ --text: #111827;
+ --text-muted: #5b6474;
+ --text-dim: #9aa3b2;
+ --text-faint: #6b7280;
--panel: #ffffff;
- --panel-border: #e2e8f0;
+ --panel-border: #e5e7eb;
--lane-fill: rgba(248, 250, 252, 0.65);
--lane-stroke: #cbd5e1;
@@ -231,20 +234,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
--mask: #ffffff;
- --frontend-fill: rgba(34, 211, 238, 0.15);
- --frontend-stroke: #0891b2;
- --backend-fill: rgba(52, 211, 153, 0.18);
- --backend-stroke: #059669;
- --database-fill: rgba(167, 139, 250, 0.2);
- --database-stroke: #7c3aed;
- --cloud-fill: rgba(251, 191, 36, 0.18);
- --cloud-stroke: #d97706;
- --security-fill: rgba(251, 113, 133, 0.15);
- --security-stroke: #e11d48;
- --messagebus-fill: rgba(251, 146, 60, 0.15);
- --messagebus-stroke:#ea580c;
- --external-fill: rgba(148, 163, 184, 0.18);
- --external-stroke: #64748b;
+ --frontend-fill: rgba(34, 211, 238, 0.15);
+ --frontend-stroke: #0891b2;
+ --backend-fill: rgba(52, 211, 153, 0.18);
+ --backend-stroke: #059669;
+ --database-fill: rgba(167, 139, 250, 0.2);
+ --database-stroke: #7c3aed;
+ --cloud-fill: rgba(251, 191, 36, 0.18);
+ --cloud-stroke: #d97706;
+ --security-fill: rgba(251, 113, 133, 0.15);
+ --security-stroke: #e11d48;
+ --messagebus-fill: rgba(251, 146, 60, 0.15);
+ --messagebus-stroke: #ea580c;
+ --external-fill: rgba(148, 163, 184, 0.18);
+ --external-stroke: #64748b;
--toolbar-bg: rgba(255, 255, 255, 0.92);
--toolbar-border: #cbd5e1;
@@ -477,12 +480,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
- font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
+ --archify-page-top: 2rem;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
background: var(--bg);
min-height: 100vh;
- padding: 2rem;
+ padding: var(--archify-page-top) 2rem 2rem;
color: var(--text);
- transition: background 0.2s ease, color 0.2s ease;
+ /* Theme surfaces change together; animating the page background leaves it
+ visibly out of sync with the SVG and panel for the first 200ms. */
}
html[data-preset="signal-flow"] body {
@@ -530,7 +536,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-embed="true"] .semantic-lens,
html[data-embed="true"] .diagram-guide,
html[data-embed="true"] .node-finder,
- html[data-embed="true"] .guided-views { display: none !important; }
+ html[data-embed="true"] .node-outline { display: none !important; }
html[data-embed="true"] .container { max-width: none; }
html[data-embed="true"] .diagram-container {
padding: 0.5rem;
@@ -540,142 +546,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-embed="true"] .diagram-container svg { min-width: 0; }
- /* Share Chapter Cue lives in the HTML viewer layer, not inside the SVG.
- It gives one-shot embeds a title, authored note, truthful stop order,
- and lifecycle state while canonical diagram geometry stays untouched. */
- .share-chapter-cue { display: none; }
- html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),
- html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {
- position: absolute;
- z-index: 18;
- top: 0.85rem;
- left: 50%;
- display: grid;
- grid-template-columns: auto minmax(9rem, 13.5rem) minmax(0, 1fr);
- align-items: center;
- gap: 0.45rem 0.85rem;
- width: min(52rem, calc(100% - 1.5rem));
- min-height: 3.35rem;
- padding: 0.55rem 0.75rem 0.65rem;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));
- border-radius: 0.75rem;
- background:
- linear-gradient(115deg, color-mix(in srgb, var(--frontend-fill) 52%, transparent), transparent 45%),
- color-mix(in srgb, var(--toolbar-menu-bg) 92%, transparent);
- color: var(--toolbar-text);
- box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);
- backdrop-filter: blur(16px);
- pointer-events: none;
- animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- html[data-preset="blueprint"] .share-chapter-cue {
- border-radius: 0.2rem;
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 46%, transparent), transparent 36%),
- var(--toolbar-menu-bg);
- box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
- backdrop-filter: none;
- }
- html[data-preset="editorial"] .share-chapter-cue {
- border-color: var(--panel-border);
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 42%),
- var(--toolbar-menu-bg);
- box-shadow: 0 10px 30px color-mix(in srgb, #000 18%, transparent);
- backdrop-filter: none;
- }
- html[data-preset="editorial"] .share-chapter-state { color: var(--arrow-emphasis); }
- html[data-preset="editorial"] .share-chapter-state::before {
- border-radius: 0;
- box-shadow: none;
- transform: rotate(45deg) scale(0.8);
- }
- .share-chapter-index {
- display: grid;
- gap: 0.12rem;
- min-width: 5rem;
- padding-right: 0.75rem;
- border-right: 1px solid var(--toolbar-border);
- }
- .share-chapter-state {
- display: inline-flex;
- align-items: center;
- gap: 0.36rem;
- color: var(--frontend-stroke);
- font-size: 0.5rem;
- font-weight: 800;
- letter-spacing: 0.14em;
- text-transform: uppercase;
- }
- .share-chapter-state::before {
- width: 0.38rem;
- height: 0.38rem;
- border-radius: 50%;
- background: currentColor;
- box-shadow: 0 0 10px currentColor;
- content: '';
- }
- .share-chapter-cue[data-state="playing"] .share-chapter-state::before {
- animation: archify-share-cue-pulse 1.15s ease-in-out infinite;
- }
- .share-chapter-count {
- color: var(--text-faint);
- font-size: 0.5rem;
- font-weight: 700;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- }
- .share-chapter-copy { min-width: 0; }
- .share-chapter-copy strong,
- .share-chapter-copy small,
- .share-chapter-route {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .share-chapter-copy strong {
- color: var(--toolbar-text);
- font-size: 0.6875rem;
- line-height: 1.35;
- }
- .share-chapter-copy small {
- margin-top: 0.08rem;
- color: var(--text-muted);
- font-size: 0.5rem;
- line-height: 1.35;
- }
- .share-chapter-route {
- color: color-mix(in srgb, var(--frontend-stroke) 76%, var(--text-muted));
- font-size: 0.5625rem;
- font-weight: 650;
- letter-spacing: 0.015em;
- text-align: right;
- }
- .share-chapter-progress {
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- height: 2px;
- overflow: hidden;
- background: color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- .share-chapter-progress span {
- display: block;
- width: 100%;
- height: 100%;
- background: linear-gradient(90deg, var(--frontend-stroke), var(--database-stroke));
- box-shadow: 0 0 12px var(--frontend-stroke);
- transform: scaleX(0);
- transform-origin: left center;
- }
-
/* Presentation Stage is a viewer-only layer: it gives the live diagram
the viewport while keeping guided views, theme, focus, and exports real.
Embed mode wins when both query parameters are present. */
html[data-present="true"]:not([data-embed="true"]) body {
+ --archify-page-top: 1rem;
height: 100dvh;
min-height: 0;
padding: 1rem;
@@ -701,10 +576,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
text-overflow: ellipsis;
white-space: nowrap;
}
- html[data-present="true"]:not([data-embed="true"]) .guided-views {
- flex: none;
- margin-bottom: 0;
- }
+
html[data-present="true"]:not([data-embed="true"]) .diagram-container {
display: flex;
flex: 1 1 auto;
@@ -727,7 +599,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--frontend-stroke);
}
- /* The reader owns only the outer scale. Wide diagrams keep one authored
+ /* The reader owns only the outer scale. Wide diagrams and measured tall workflows keep one authored
SVG/viewBox while the runtime chooses a desktop width from the actual
vertical budget. This avoids device-specific files and breakpoint
jumps between a laptop and a tall monitor. */
@@ -752,15 +624,18 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.header-row {
display: flex;
align-items: center;
- gap: 1rem;
- margin-bottom: 0.5rem;
+ gap: 0.75rem;
+ min-height: 2.75rem;
+ margin-bottom: 0.25rem;
}
.pulse-dot {
- width: 12px;
- height: 12px;
+ flex: none;
+ width: 10px;
+ height: 10px;
background: var(--frontend-stroke);
border-radius: 50%;
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--frontend-stroke) 16%, transparent);
animation: none;
}
@@ -773,19 +648,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
h1 {
font-size: 1.5rem;
- font-weight: 700;
- letter-spacing: -0.025em;
+ font-weight: 650;
+ line-height: 1.25;
+ letter-spacing: -0.015em;
}
.subtitle {
color: var(--text-muted);
font-size: 0.875rem;
- margin-left: 1.75rem;
+ line-height: 1.55;
+ margin-left: 1.375rem;
}
html[data-preset="signal-flow"] .header-row::after {
content: attr(data-preset-badge-signal-flow);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
color: var(--frontend-stroke);
border: 1px solid var(--frontend-stroke);
border-radius: 999px;
@@ -809,7 +687,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-preset="blueprint"] .header-row::after {
content: attr(data-preset-badge-blueprint);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
padding: 0.28rem 0.55rem;
border-top: 1px solid var(--frontend-stroke);
border-bottom: 1px solid var(--frontend-stroke);
@@ -838,7 +717,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-preset="editorial"] .header-row::after {
content: attr(data-preset-badge-editorial);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
padding: 0.32rem 0 0.24rem;
border-bottom: 2px solid var(--arrow-emphasis);
color: var(--arrow-emphasis);
@@ -855,6 +735,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
background: var(--panel);
border-radius: 1rem;
border: 1px solid var(--panel-border);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -20px rgba(15, 23, 42, 0.18);
padding: 1.5rem;
padding-bottom: calc(1.5rem + var(--archify-nav-reserve));
overflow: hidden;
@@ -942,6 +823,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-animate] {
animation: none !important;
}
+ html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: none !important;
+ }
html[data-motion="still"] .pulse-dot,
html[data-motion="still"] .diagram-container::before,
html[data-motion="still"] svg[data-animation="trace"] [data-animate],
@@ -954,7 +838,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-share-playback="true"] .diagram-container::before,
html[data-document-hidden="true"] .pulse-dot,
html[data-document-hidden="true"] .diagram-container::before,
- html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate] {
+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate],
+ html[data-motion="still"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-motion-owner] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
animation: none !important;
}
html[data-motion="still"] .diagram-container::before,
@@ -963,43 +852,21 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-share-playback="true"] .diagram-container::before {
opacity: 0;
}
- html[data-motion="still"] .guided-view-progress span,
- html[data-motion="still"] .guided-story-caption,
- html[data-motion="still"] .story-trail-flow,
html[data-motion="still"] .intent-trace-flow,
html[data-motion="still"] .route-probe-flow,
html[data-motion="still"] .route-journey-flow,
html[data-motion="still"] .semantic-lens-flow,
html[data-motion="still"] .diagram-guide,
- html[data-motion="still"] [data-story-step],
html[data-motion="still"] .overview-map-live,
- html[data-motion="still"] .guided-view-stop,
- html[data-motion="still"] .share-chapter-cue,
- html[data-motion="still"] .share-chapter-state::before,
- html[data-motion="still"] .share-chapter-progress span,
- html[data-document-hidden="true"] .guided-view-progress span,
- html[data-document-hidden="true"] .story-trail-flow,
html[data-document-hidden="true"] .intent-trace-flow,
html[data-document-hidden="true"] .route-probe-flow,
html[data-document-hidden="true"] .route-journey-flow,
html[data-document-hidden="true"] .semantic-lens-flow,
html[data-document-hidden="true"] .diagram-guide,
- html[data-document-hidden="true"] [data-story-step],
- html[data-document-hidden="true"] .overview-map-live,
- html[data-document-hidden="true"] .guided-view-stop,
- html[data-document-hidden="true"] .share-chapter-cue,
- html[data-document-hidden="true"] .share-chapter-state::before,
- html[data-document-hidden="true"] .share-chapter-progress span {
+ html[data-document-hidden="true"] .overview-map-live {
animation: none !important;
}
- html[data-motion="still"] .guided-view-progress span {
- transform: scaleX(1) !important;
- }
- html[data-motion="still"] svg[data-story-playing="true"] .story-trail-flow {
- stroke-dasharray: none;
- stroke-dashoffset: 0;
- opacity: 0.55;
- }
+
html[data-motion="still"] .intent-trace-flow,
html[data-motion="still"] .route-probe-flow {
stroke-dasharray: none;
@@ -1008,12 +875,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-motion="still"] .route-journey-overlay,
html[data-document-hidden="true"] .route-journey-overlay { display: none !important; }
- html[data-motion="still"] .relationship-pulse-overlay,
- html[data-motion="still"] .story-carrier-overlay,
- html[data-document-hidden="true"] .story-carrier-overlay { display: none !important; }
- html[data-motion="still"] .chapter-handoff-overlay { display: none !important; }
- html[data-motion="still"] .chapter-handoff-anchor { animation: none !important; }
- html[data-motion="still"] .guided-view-chapter,
+ html[data-motion="still"] .relationship-pulse-overlay { display: none !important; }
+
html[data-motion="still"] svg [data-node-id],
html[data-motion="still"] svg [data-edge-from],
html[data-motion="still"] svg [data-detail],
@@ -1024,6 +887,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg {
+ font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
width: 100%;
min-width: min(900px, 100%);
display: block;
@@ -1044,23 +908,23 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
- padding: 0.15rem;
- gap: 0;
+ padding: 0.25rem;
+ gap: 0.0625rem;
overflow-x: auto;
- border: 1px solid color-mix(in srgb, var(--toolbar-border) 48%, transparent);
- border-radius: 0.58rem;
- background: color-mix(in srgb, var(--toolbar-bg) 82%, transparent);
- box-shadow: 0 5px 14px rgba(0, 0, 0, 0.07);
- backdrop-filter: blur(10px);
+ border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
+ border-radius: 0.75rem;
+ background: color-mix(in srgb, var(--panel) 84%, transparent);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -14px rgba(15, 23, 42, 0.28);
+ backdrop-filter: blur(14px) saturate(1.2);
scrollbar-width: none;
}
.diagram-nav::-webkit-scrollbar { display: none; }
.diagram-nav button,
- .focus-chip button,
- .guided-views button {
+ .focus-chip button {
border: 0;
background: transparent;
color: var(--toolbar-text);
@@ -1070,56 +934,62 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.diagram-nav button {
min-width: 2rem;
height: 2rem;
- padding: 0 0.35rem;
- border-radius: 0.35rem;
- color: color-mix(in srgb, var(--toolbar-text) 68%, transparent);
- font-size: 0.56rem;
- font-weight: 600;
- letter-spacing: 0.02em;
+ padding: 0 0.4rem;
+ border-radius: 0.5rem;
+ color: var(--text-muted);
+ font-size: 0.75rem;
+ font-weight: 500;
+ letter-spacing: 0;
transition: background 0.15s, color 0.15s;
}
.diagram-nav button:hover,
+ .diagram-nav button:focus-visible {
+ color: var(--text);
+ background: color-mix(in srgb, var(--text) 6%, transparent);
+ }
+ .diagram-nav button:hover,
.diagram-nav button:focus-visible,
.focus-chip button:hover,
- .focus-chip button:focus-visible,
- .guided-views button:hover,
- .guided-views button:focus-visible { background: var(--toolbar-hover); }
+ .focus-chip button:focus-visible { background: var(--toolbar-hover); }
.diagram-nav button:focus-visible,
- .focus-chip button:focus-visible,
- .guided-views button:focus-visible {
+ .focus-chip button:focus-visible {
outline: 2px solid var(--frontend-stroke);
outline-offset: 1px;
}
.diagram-nav button:disabled { opacity: 0.38; cursor: default; }
+ /* The Guide stays on the ? shortcut; Map only earns dock space once the
+ reader has zoomed past the full diagram (or opened it from the keyboard). */
+ .diagram-nav button[hidden] { display: none; }
+ .diagram-container:not(.is-pannable) #btn-overview-map:not([data-radar-requested]):not(:focus) { display: none; }
.diagram-nav button:disabled:hover { background: transparent; }
.diagram-nav #btn-route-probe,
.diagram-nav #btn-overview-map,
.diagram-nav #btn-semantic-lens {
min-width: auto;
- padding-inline: 0.5rem;
- color: color-mix(in srgb, var(--toolbar-text) 86%, transparent);
- font-weight: 650;
+ padding-inline: 0.6rem;
+ color: var(--text-muted);
+ font-weight: 500;
}
.diagram-nav #btn-node-finder,
.diagram-nav [data-view="out"] {
position: relative;
- margin-left: 0.25rem;
+ margin-left: 0.375rem;
}
.diagram-nav #btn-node-finder::before,
.diagram-nav [data-view="out"]::before {
position: absolute;
- top: 0.4rem;
- bottom: 0.4rem;
- left: -0.13rem;
+ top: 0.55rem;
+ bottom: 0.55rem;
+ left: -0.19rem;
width: 1px;
- background: color-mix(in srgb, var(--toolbar-border) 62%, transparent);
+ background: color-mix(in srgb, var(--panel-border) 90%, transparent);
content: "";
pointer-events: none;
}
.diagram-nav-icon {
display: block;
- width: 0.72rem;
- height: 0.72rem;
+ width: 0.875rem;
+ height: 0.875rem;
margin: auto;
background: currentColor;
-webkit-mask-position: center;
@@ -1164,11 +1034,56 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
letter-spacing: 0.07em;
}
.diagram-nav-percent {
- color: color-mix(in srgb, var(--toolbar-text) 84%, transparent);
- font-size: 0.55rem;
- font-weight: 650;
+ color: var(--text-muted);
+ font-size: 0.75rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
line-height: 1;
}
+ /* Mode buttons carry a small glyph so the dock reads as one icon language. */
+ .diagram-nav #btn-route-probe,
+ .diagram-nav #btn-overview-map,
+ .diagram-nav #btn-semantic-lens {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+ padding-inline: 0.55rem 0.65rem;
+ }
+ .diagram-nav #btn-route-probe::before,
+ .diagram-nav #btn-overview-map::before,
+ .diagram-nav #btn-semantic-lens::before {
+ flex: none;
+ width: 0.875rem;
+ height: 0.875rem;
+ background: currentColor;
+ content: "";
+ opacity: 0.85;
+ -webkit-mask: var(--nav-glyph) center / contain no-repeat;
+ mask: var(--nav-glyph) center / contain no-repeat;
+ }
+ .diagram-nav #btn-route-probe { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='4.8' cy='14.8' r='2.2'/%3E%3Ccircle cx='15.2' cy='5.2' r='2.2'/%3E%3Cpath d='M6.9 13.9c3.8-1.4 2.6-6.3 6.2-7.8'/%3E%3C/g%3E%3C/svg%3E"); }
+ .diagram-nav #btn-overview-map { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2.8 5.4 7.4 3.5l5.2 2 4.6-1.9v11l-4.6 1.9-5.2-2-4.6 1.9z'/%3E%3Cpath d='M7.4 3.5v11M12.6 5.5v11'/%3E%3C/g%3E%3C/svg%3E"); }
+ .diagram-nav #btn-semantic-lens { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='6.8'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/g%3E%3C/svg%3E"); }
+ /* Zoom out / level / zoom in join into one stepper well. */
+ .diagram-nav [data-view="out"],
+ .diagram-nav [data-view="reset"],
+ .diagram-nav [data-view="in"] {
+ border-radius: 0;
+ background: color-mix(in srgb, var(--text) 4.5%, transparent);
+ }
+ .diagram-nav [data-view="out"] { margin-left: 0.375rem; border-radius: 0.5rem 0 0 0.5rem; }
+ .diagram-nav [data-view="out"]::before { display: none; }
+ .diagram-nav [data-view="reset"],
+ .diagram-nav [data-view="in"] { margin-left: -0.0625rem; }
+ .diagram-nav [data-view="in"] { border-radius: 0 0.5rem 0.5rem 0; }
+ .diagram-nav [data-view="out"]:hover,
+ .diagram-nav [data-view="reset"]:hover,
+ .diagram-nav [data-view="in"]:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
+ .diagram-nav [data-view="out"]:disabled,
+ .diagram-nav [data-view="in"]:disabled { opacity: 1; color: color-mix(in srgb, var(--text-muted) 40%, transparent); }
+ .diagram-nav [data-view="out"]:disabled:hover,
+ .diagram-nav [data-view="in"]:disabled:hover { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
+ .diagram-nav [data-view="reset"] { min-width: 3.25rem; }
.diagram-container[data-camera-indicator="true"] .diagram-nav-detail,
.diagram-container[data-camera-indicator="true"] .diagram-nav-percent { color: var(--frontend-stroke); }
.diagram-nav #btn-diagram-guide[aria-expanded="true"] {
@@ -1392,7 +1307,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.diagram-nav #btn-overview-map[aria-expanded="true"] {
color: var(--frontend-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--frontend-stroke) 11%, transparent);
}
.overview-map-feedback {
position: absolute;
@@ -1414,12 +1329,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.focus-chip[data-radar-yielded="true"] { display: none !important; }
.diagram-nav #btn-route-probe[aria-pressed="true"] {
color: var(--backend-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--backend-stroke) 11%, transparent);
}
.diagram-nav #btn-semantic-lens[aria-expanded="true"],
.diagram-nav #btn-semantic-lens[aria-pressed="true"] {
color: var(--database-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--database-stroke) 11%, transparent);
}
/* Semantic Lens turns the compiled node-kind palette into an analytical
@@ -1616,9 +1531,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--toolbar-text);
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(16px);
- font-size: 0.625rem;
+ font-size: 0.75rem;
}
.route-probe[hidden] { display: none; }
+ /* Picking needs one line of guidance, not a wide empty card; the panel
+ widens only when there is a traced route to show. */
+ .route-probe:not([data-state="result"]) { width: min(22rem, calc(100% - 2rem)); min-width: 0; }
+ .route-probe-path:has(> .route-probe-placeholder:only-child) { display: none; }
.route-probe[data-route-dock="top"] {
top: 1rem;
bottom: auto;
@@ -1629,25 +1548,25 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
gap: 0.65rem;
- padding: 0.52rem 0.58rem 0.44rem;
+ padding: 0.625rem 0.75rem 0.5rem;
border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);
}
.route-probe-copy { min-width: 0; }
.route-probe-eyebrow {
display: block;
color: var(--backend-stroke);
- font-size: 0.48rem;
- font-weight: 800;
- letter-spacing: 0.15em;
- text-transform: uppercase;
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.02em;
}
.route-probe-title {
display: block;
margin-top: 0.14rem;
overflow: hidden;
color: var(--toolbar-text);
- font-size: 0.72rem;
- line-height: 1.25;
+ font-size: 0.875rem;
+ font-weight: 600;
+ line-height: 1.3;
white-space: nowrap;
text-overflow: ellipsis;
}
@@ -1728,16 +1647,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.route-probe-placeholder {
color: var(--text-faint);
- font-size: 0.56rem;
- letter-spacing: 0.03em;
+ font-size: 0.75rem;
}
.route-probe-status {
display: block;
min-height: 1.45rem;
- padding: 0.08rem 0.58rem 0.44rem;
- color: var(--text-faint);
- font-size: 0.52rem;
- line-height: 1.35;
+ padding: 0.5rem 0.75rem 0.625rem;
+ color: var(--text-muted, var(--text-faint));
+ font-size: 0.75rem;
+ line-height: 1.45;
}
.route-journey-controls {
display: grid;
@@ -1795,14 +1713,40 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
font-size: 0.625rem;
}
.relationship-lens-head {
+ position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
gap: 0.75rem;
- padding: 0.7rem 0.75rem 0.65rem;
+ padding: 0.9rem 0.75rem 0.65rem;
border-bottom: 1px solid var(--toolbar-border);
background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);
}
+ .relationship-lens-drag-handle {
+ position: absolute;
+ top: 0.12rem;
+ left: 50%;
+ width: 2.5rem;
+ height: 0.78rem;
+ padding: 0 !important;
+ transform: translateX(-50%);
+ color: var(--text-faint) !important;
+ cursor: grab;
+ touch-action: none;
+ user-select: none;
+ }
+ .relationship-lens-drag-handle::before {
+ content: "";
+ display: block;
+ width: 1.25rem;
+ margin: auto;
+ border-top: 2px dotted currentColor;
+ opacity: 0.72;
+ }
+ .focus-chip[data-panel-dragging="true"] .relationship-lens-drag-handle { cursor: grabbing; }
+ @media (hover: none), (pointer: coarse) {
+ .relationship-lens-drag-handle { display: none; }
+ }
.relationship-lens-copy { min-width: 0; }
.relationship-lens-actions {
display: flex;
@@ -1950,8 +1894,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--text-muted);
text-decoration: none;
}
- .semantic-passport-source:hover,
- .semantic-passport-source:focus-visible {
+ a.semantic-passport-source:hover,
+ a.semantic-passport-source:focus-visible {
border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);
background: color-mix(in srgb, var(--backend-fill) 32%, transparent);
color: var(--text);
@@ -2228,7 +2172,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.diagram-guide-action[data-guide-action="route"] { --guide-accent: var(--backend-stroke); }
.diagram-guide-action[data-guide-action="map"] { --guide-accent: var(--database-stroke); }
.diagram-guide-action[data-guide-action="lens"] { --guide-accent: var(--messagebus-stroke); }
- .diagram-guide-action[data-guide-action="story"] { --guide-accent: var(--security-stroke); }
+
.diagram-guide-action[data-guide-action="present"] {
--guide-accent: var(--cloud-stroke);
}
@@ -2502,564 +2446,443 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
font-size: 0.5625rem;
}
- .guided-views {
+ .cards {
display: grid;
- grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem auto;
- align-items: stretch;
- gap: 0.35rem;
- min-width: 0;
- margin: 0 0 0.75rem;
- padding: 0.35rem;
- border: 1px solid var(--toolbar-border);
- border-radius: 0.85rem;
- background: var(--toolbar-bg);
- background: linear-gradient(120deg, var(--toolbar-bg), color-mix(in srgb, var(--toolbar-bg) 82%, var(--frontend-fill)));
- box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
- backdrop-filter: blur(12px);
+ grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
+ gap: 1rem;
+ margin-top: 2rem;
}
- .guided-views[hidden] { display: none; }
- html[data-preset="blueprint"] .guided-views {
- border-color: var(--panel-border);
- border-radius: 0.35rem;
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 36%, transparent), transparent 24%),
- var(--toolbar-bg);
- box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
- }
- html[data-preset="blueprint"] .guided-views button { border-radius: 0.2rem; }
- html[data-preset="blueprint"] .guided-view-progress { border-radius: 0; }
- html[data-preset="blueprint"] .guided-view-progress span { border-radius: 0; }
- .guided-views button {
- min-width: 0;
- padding: 0.45rem 0.6rem;
- border-radius: 0.55rem;
- font-size: 0.75rem;
- }
- .guided-views > #guided-view-prev,
- .guided-views > #guided-view-next { min-width: 2.75rem; min-height: 2.75rem; }
- .guided-views button:disabled { opacity: 0.3; cursor: default; }
- .guided-view-copy {
- min-width: 0;
- padding: 0.2rem 0.5rem;
- border-left: 1px solid var(--toolbar-border);
- overflow: hidden;
+ .card {
+ background: var(--panel);
+ border-radius: 0.75rem;
+ border: 1px solid var(--panel-border);
+ padding: 1.125rem 1.25rem;
}
- .guided-view-meta {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- min-height: 1rem;
- margin-bottom: 0.12rem;
- color: var(--frontend-stroke);
- font-size: 0.5625rem;
- font-weight: 700;
- letter-spacing: 0.12em;
- text-transform: uppercase;
+
+ html[data-preset="signal-flow"] .card {
+ background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
- .guided-view-handoff {
- box-sizing: border-box;
- height: 1rem;
- min-width: 0;
- max-width: 15rem;
- overflow: hidden;
- padding: 0 0.38rem;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 46%, transparent);
- border-radius: 999px;
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-fill) 44%, transparent);
- font-size: 0.5rem;
- line-height: calc(1rem - 2px);
- letter-spacing: 0.06em;
- text-overflow: ellipsis;
- white-space: nowrap;
+ html[data-preset="signal-flow"][data-theme="light"] .card {
+ background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
}
- .guided-view-handoff[hidden] { display: none; }
- html[data-preset="blueprint"] .guided-view-handoff { border-radius: 0.15rem; }
- .chapter-handoff-overlay { pointer-events: none; }
- .chapter-handoff-anchor {
- fill: color-mix(in srgb, var(--frontend-fill) 10%, transparent);
- stroke: var(--frontend-stroke);
- stroke-width: 2;
- stroke-dasharray: 4 4;
- vector-effect: non-scaling-stroke;
- opacity: 0.96;
- animation: archify-chapter-anchor 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
+
+ /* Preserve the one-screen guarantee on ordinary laptop displays. The
+ high-screen expansion above must not trade a fuller canvas for page
+ scrolling at 900–1080px heights. */
+ @media (min-width: 768px) and (max-height: 1100px) {
+ .header { margin-bottom: 1rem; }
+ .diagram-container {
+ padding: 0.875rem;
+ padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
+ }
+ .cards { margin-top: 1rem; }
+ .card { padding: 1rem; }
}
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="stay"] { opacity: 1; }
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="enter"] { opacity: 0.78; }
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="leave"] { opacity: 0.26; }
- @keyframes archify-chapter-anchor {
- 0% { opacity: 0.35; stroke-dashoffset: 8; }
- 45% { opacity: 1; }
- 100% { opacity: 0.72; stroke-dashoffset: 0; }
+ @media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
+ body { --archify-page-top: 1.25rem; }
+ .header { margin-bottom: 0.875rem; }
+ .cards { margin-top: 0.75rem; }
+ html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
+ /* Align the fixed toolbar with the compact title row. Reserve its hit area
+ above the guide without taking extra height from a fitted diagram. */
+ html[data-nav-stage-rail="true"] .toolbar { top: 0.25rem; }
+ html[data-nav-stage-rail="true"] .header { min-height: 2.625rem; margin-bottom: 0.5rem; }
+ html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
+ html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
}
- .guided-view-progress {
- width: 3.5rem;
- height: 2px;
- overflow: hidden;
- border-radius: 999px;
- background: var(--toolbar-border);
+
+ html[data-preset="blueprint"] .card {
+ position: relative;
+ border-color: var(--panel-border);
+ border-radius: 0.3rem;
+ background: var(--panel);
+ box-shadow: none;
}
- .guided-view-progress span {
- display: block;
- width: 100%;
- height: 100%;
- border-radius: inherit;
- background: var(--frontend-stroke);
- transform: scaleX(0);
- transform-origin: left center;
- }
- .guided-view-copy strong,
- .guided-view-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
- .guided-view-copy strong { color: var(--toolbar-text); font-size: 0.75rem; line-height: 1.35; }
- .guided-view-copy small { margin-top: 0; color: var(--text-muted); font-size: 0.625rem; line-height: 1.35; }
- .guided-story-caption {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) auto;
- gap: 0.12rem 0.55rem;
- align-items: center;
- min-width: 0;
- margin-top: 0.18rem;
- padding: 0.3rem 0.5rem;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 32%, var(--toolbar-border));
- border-radius: 0.58rem;
- background: color-mix(in srgb, var(--frontend-fill) 26%, transparent);
- animation: archify-story-caption-in 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- .guided-story-caption[hidden] { display: none; }
- .guided-story-caption-index {
- grid-row: 1 / span 2;
- align-self: stretch;
- display: inline-grid;
- min-width: 3.3rem;
- place-items: center;
- padding-right: 0.52rem;
- border-right: 1px solid color-mix(in srgb, var(--frontend-stroke) 28%, var(--toolbar-border));
- color: var(--frontend-stroke);
- font-size: 0.5625rem;
- font-weight: 800;
- letter-spacing: 0.08em;
- text-transform: uppercase;
+ html[data-preset="blueprint"] .card::before {
+ content: "";
+ position: absolute;
+ top: -1px;
+ left: 1rem;
+ width: 2.5rem;
+ border-top: 2px solid var(--frontend-stroke);
}
- .guided-story-caption strong,
- .guided-story-caption small {
- display: block;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+
+ html[data-preset="editorial"] .card {
+ position: relative;
+ border-radius: 0.28rem;
+ background: var(--panel);
+ box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
}
- .guided-story-caption strong { color: var(--toolbar-text); font-size: 0.6875rem; line-height: 1.3; }
- .guided-story-caption small { color: var(--text-muted); font-size: 0.5625rem; line-height: 1.35; }
- .guided-story-caption-next {
- grid-column: 3;
- grid-row: 1 / span 2;
- display: grid;
- min-width: 6.4rem;
- max-width: 9.5rem;
- align-self: stretch;
- align-content: center;
- padding-left: 0.58rem;
- border-left: 1px solid color-mix(in srgb, var(--frontend-stroke) 22%, var(--toolbar-border));
+ html[data-preset="editorial"] .card::before {
+ position: absolute;
+ top: -1px;
+ left: 1.25rem;
+ width: 3.25rem;
+ border-top: 3px solid var(--arrow-emphasis);
+ content: "";
}
- .guided-story-caption-next[hidden] { display: none; }
- .guided-story-caption-next small {
- color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--text-muted));
- font-weight: 800;
- letter-spacing: 0.09em;
- text-transform: uppercase;
+ html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
+
+ /* Summary rail: the reader measures the viewport and enables it only when the
+ diagram keeps its readable width beside the notes. */
+ .reader-rail { display: contents; }
+ html[data-reader-rail="true"] .container {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) var(--archify-rail-width);
+ grid-auto-flow: row dense;
+ column-gap: var(--archify-rail-gap);
+ align-items: start;
}
- .guided-story-caption-next strong { color: var(--text-muted); font-weight: 700; }
- html[data-preset="blueprint"] .guided-story-caption { border-radius: 0.2rem; }
- .guided-views[data-story-beat] .guided-view-copy > #guided-view-label,
- .guided-views[data-story-beat] .guided-view-copy > #guided-view-note { display: none; }
- @keyframes archify-story-caption-in {
- from { opacity: 0; transform: translateY(3px); }
- to { opacity: 1; transform: translateY(0); }
+ html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
+ html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
+ the index keeps a usable share instead of collapsing to its header. */
+ html[data-reader-rail="true"] .reader-rail {
+ display: flex;
+ flex-direction: column;
+ grid-column: 2;
+ align-self: stretch;
+ min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
- .guided-view-trail {
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
display: flex;
- align-items: center;
- gap: 0.28rem;
- min-width: 0;
- min-height: 1.7rem;
+ flex: 0 1 auto;
+ flex-direction: column;
+ gap: 0;
+ min-height: 0;
margin-top: 0;
- padding: 0;
- overflow-x: auto;
- color: var(--text-faint);
- overscroll-behavior-x: contain;
- touch-action: pan-x;
+ padding: 0.125rem 0 0;
+ overflow-y: auto;
scrollbar-width: none;
- white-space: nowrap;
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
}
- .guided-view-trail[hidden] { display: none; }
- .guided-view-trail::-webkit-scrollbar { display: none; }
- .guided-view-trail .guided-view-stop {
- appearance: none;
- box-sizing: border-box;
- display: inline-flex;
- flex: 0 0 auto;
- align-items: center;
- gap: 0.28rem;
- min-height: 1.5rem;
- padding: 0.1rem 0.3rem 0.1rem 0.18rem;
- border: 1px solid transparent;
- border-radius: 999px;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards::-webkit-scrollbar { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card { flex: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card {
+ padding: 0 0.25rem 1.125rem;
+ border: 0;
+ border-radius: 0;
background: transparent;
- color: var(--text-muted);
- cursor: pointer;
- font-family: inherit;
- font-size: 0.5625rem;
- font-weight: 650;
- letter-spacing: 0.02em;
- line-height: 1;
- transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
+ box-shadow: none;
}
- .guided-view-stop:hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);
- background: color-mix(in srgb, var(--frontend-fill) 34%, transparent);
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card + .card {
+ padding-top: 1.125rem;
+ border-top: 1px solid var(--panel-border);
}
- .guided-view-stop:focus-visible {
- outline: 2px solid var(--frontend-stroke);
- outline-offset: 1px;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card::before { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .card-header { gap: 0.55rem; margin-bottom: 0.45rem; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card h3 { font-size: 0.875rem; letter-spacing: -0.005em; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card ul { font-size: 0.8125rem; line-height: 1.6; }
+
+ .node-outline { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .node-outline:not([hidden]) {
+ display: flex;
+ flex: 1 0 min(13rem, 55%);
+ flex-direction: column;
+ min-height: 0;
+ margin-top: 0.25rem;
+ overflow: hidden;
+ border-top: 1px solid var(--panel-border);
}
- .guided-view-stop:disabled { cursor: wait; }
- .guided-view-stop::before {
- display: inline-grid;
- width: 1rem;
- height: 1rem;
- place-items: center;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));
- border-radius: 50%;
- background: color-mix(in srgb, var(--frontend-fill) 58%, var(--toolbar-bg));
- color: var(--frontend-stroke);
- content: attr(data-story-number);
- font-size: 0.5rem;
- line-height: 1;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty + .node-outline:not([hidden]) { margin-top: 0; border-top: 0; }
+ /* Collapsed: only the reveal control remains, so the diagram takes the width. */
+ html[data-reader-rail="collapsed"] .reader-rail { display: none; }
+ /* Overlay: a drawer for diagrams whose readable floor leaves no room to dock. */
+ html[data-reader-rail="overlay"] .reader-rail {
+ position: fixed;
+ z-index: 150;
+ top: 1rem;
+ right: 1rem;
+ bottom: 1rem;
+ display: flex;
+ flex-direction: column;
+ width: var(--archify-rail-width);
+ padding: 0.75rem 1rem 0.5rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
+ border-radius: 1rem;
+ background: var(--toolbar-menu-bg);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 28px 64px -18px rgba(15, 23, 42, 0.38);
+ animation: rail-drawer-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
- .guided-view-stop + .guided-view-stop::after {
- order: -1;
- color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--text-faint));
- content: '\00b7';
- font-size: 0.65rem;
+ @keyframes rail-drawer-in {
+ from { opacity: 0; transform: translateX(0.75rem); }
+ to { opacity: 1; transform: translateX(0); }
}
- .guided-view-stop[data-story-link="forward"]::after { content: '\2192'; }
- .guided-view-stop[data-story-link="reverse"]::after { content: '\2190'; }
- .guided-view-stop[data-story-link="multiple"]::after { content: '\21c4'; }
- .guided-view-stop[data-story-beat-state="pending"] { opacity: 0.38; }
- .guided-view-stop[data-story-beat-state="next"] {
- border-style: dashed;
- border-color: color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));
- color: color-mix(in srgb, var(--toolbar-text) 68%, var(--text-muted));
- opacity: 0.58;
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
+ html[data-reader-rail="bottom"] .reader-rail {
+ display: grid;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
+ margin-top: 1rem;
}
- .guided-view-stop[data-story-beat-state="past"] { color: var(--text-muted); opacity: 0.76; }
- .guided-view-stop[data-story-beat-state="active"] {
- border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border));
- background: color-mix(in srgb, var(--frontend-fill) 42%, transparent);
- color: var(--toolbar-text);
- font-weight: 800;
- opacity: 1;
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards:empty { display: none; }
+ html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
+ border: 1px solid var(--panel-border);
+ border-radius: 0.75rem;
+ background: var(--panel);
}
- .guided-view-stop[data-story-beat-state="active"]::before {
- border-color: var(--frontend-stroke);
- box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 54%, transparent);
- }
- html[data-preset="blueprint"] .guided-view-stop,
- html[data-preset="blueprint"] .guided-view-stop::before { border-radius: 0.1rem; }
- html[data-preset="blueprint"] .guided-view-stop[data-story-beat-state="active"]::before { box-shadow: none; }
- .guided-view-actions { display: flex; align-items: stretch; gap: 0.2rem; }
- .guided-view-actions button { white-space: nowrap; }
- .guided-view-play {
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
+ .rail-controls { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
+ display: flex;
+ flex: none;
+ justify-content: flex-end;
+ gap: 0.125rem;
+ margin: -0.25rem -0.25rem 0.25rem 0;
+ }
+ .rail-control {
+ display: inline-grid;
+ place-items: center;
+ width: 1.875rem;
+ height: 1.875rem;
+ border: 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: background 0.14s ease, color 0.14s ease;
+ }
+ .rail-control[hidden] { display: none; }
+ .rail-control:hover,
+ .rail-control:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
+ .rail-control:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: -1.5px; }
+ .rail-control-icon,
+ .rail-reveal-icon {
+ width: 1rem;
+ height: 1rem;
+ background: currentColor;
+ -webkit-mask: var(--rail-glyph) center / contain no-repeat;
+ mask: var(--rail-glyph) center / contain no-repeat;
+ }
+ /* Panel glyphs: a frame with the panel drawn on the side it moves to. */
+ .rail-control-icon.placement,
+ #rail-placement[data-placement="right"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M2.8 12h14.4'/%3E%3C/g%3E%3C/svg%3E"); }
+ #rail-placement[data-placement="bottom"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4'/%3E%3C/g%3E%3C/svg%3E"); }
+ .rail-control-icon.collapse { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m8 5.5 4.5 4.5L8 14.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
+ .rail-reveal-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4M14.4 7.2h1M14.4 9.6h1M14.4 12h1'/%3E%3C/g%3E%3C/svg%3E"); }
+ .rail-reveal[hidden] { display: none; }
+ /* The collapsed rail leaves one quiet pill in the canvas corner. */
+ .rail-reveal {
+ position: absolute;
+ z-index: 13;
+ top: 0.75rem;
+ right: 0.75rem;
display: inline-flex;
align-items: center;
- justify-content: center;
- gap: 0.38rem;
- min-width: 6.25rem !important;
- color: var(--frontend-stroke) !important;
- font-size: 0.625rem !important;
+ gap: 0.45rem;
+ min-height: 2rem;
+ padding: 0 0.75rem 0 0.625rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--panel) 86%, transparent);
+ color: var(--text-muted);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px -12px rgba(15, 23, 42, 0.28);
+ backdrop-filter: blur(12px);
+ font: inherit;
+ font-size: 0.75rem;
+ font-weight: 500;
+ cursor: pointer;
+ transition: color 0.14s ease, background 0.14s ease;
}
- .guided-view-play[aria-pressed="true"] { background: var(--toolbar-hover); }
- .guided-view-all { min-width: 3.25rem !important; color: var(--text-muted) !important; font-size: 0.625rem !important; }
- .guided-view-beat-link {
- display: inline-flex;
+ .rail-reveal:hover,
+ .rail-reveal:focus-visible { color: var(--text); background: var(--panel); }
+ .rail-reveal:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: 2px; }
+ html[data-motion="still"] .reader-rail { animation: none !important; }
+ .node-outline-head {
+ display: flex;
align-items: center;
- justify-content: center;
- gap: 0.3rem;
- min-width: 5.4rem !important;
- min-height: 1.5rem;
- color: var(--text-muted) !important;
- font-size: 0.5625rem !important;
- letter-spacing: 0.025em;
- transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
+ gap: 0.5rem;
+ padding: 1.125rem 0.25rem 0.375rem;
}
- .guided-view-beat-link:not(:disabled):hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));
- color: var(--frontend-stroke) !important;
+ .node-outline-head strong {
+ color: var(--text);
+ font-size: 0.875rem;
+ font-weight: 600;
+ letter-spacing: -0.005em;
}
- .guided-view-beat-link[data-copy-state="copied"] {
- border-color: color-mix(in srgb, var(--backend-stroke) 58%, var(--toolbar-border));
- background: color-mix(in srgb, var(--backend-fill) 46%, transparent);
- color: var(--backend-stroke) !important;
+ .node-outline-count {
+ min-width: 1.35rem;
+ padding: 0.1rem 0.4rem;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 6%, transparent);
+ color: var(--text-muted);
+ font-size: 0.6875rem;
+ font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
+ font-variant-numeric: tabular-nums;
}
- .guided-view-index {
- grid-column: 1 / -1;
- min-width: 0;
- padding: 0.28rem 0.12rem 0.08rem;
- overflow: hidden;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- @media (min-width: 721px) {
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-index,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-beat-link,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-all,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-trail,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-label,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-note { display: none; }
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-story-caption { margin-top: 0.08rem; }
- }
- .guided-view-chapters {
- display: flex;
- gap: 0.28rem;
- min-width: 0;
- margin: 0;
- padding: 0.08rem 0.05rem 0.2rem;
- overflow-x: auto;
+ .node-outline-list {
+ flex: 1 1 auto;
+ min-height: 0;
+ margin: 0 -0.375rem;
+ padding: 0 0 1.25rem;
+ overflow-y: auto;
list-style: none;
- scroll-padding-inline: 0.05rem;
- scroll-snap-type: x proximity;
scrollbar-width: none;
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
+ }
+ .node-outline-list::-webkit-scrollbar { display: none; }
+ .node-outline-group + .node-outline-group { margin-top: 0.25rem; }
+ .node-outline-group > ul {
+ position: relative;
+ list-style: none;
}
- .guided-view-chapters::-webkit-scrollbar { display: none; }
- .guided-view-chapters li {
+ /* A quiet spine ties each group's swatches together like a lane. */
+ .node-outline-group > ul::before {
+ position: absolute;
+ top: 0.95rem;
+ bottom: 0.95rem;
+ left: calc(0.625rem + 0.3125rem - 0.5px);
+ width: 1px;
+ background: var(--panel-border);
+ content: "";
+ }
+ .node-outline-heading {
display: flex;
- flex: 1 1 0;
- min-width: 9.5rem;
- scroll-snap-align: center;
+ align-items: baseline;
+ justify-content: space-between;
+ padding: 0.7rem 0.625rem 0.25rem;
+ color: var(--text-faint);
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.02em;
}
- .guided-view-chapter {
+ .node-outline-heading small {
+ color: var(--text-dim);
+ font-size: 0.6875rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
+ }
+ /* The rail frees the vertical budget, so compact viewports keep the normal
+ title spacing instead of the stacked layout's tight stage rail. */
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
+ .node-outline-item {
position: relative;
- display: grid !important;
- grid-template-columns: 1.55rem minmax(0, 1fr) auto;
+ display: grid;
+ grid-template-columns: 0.625rem minmax(0, auto) minmax(0, 1fr) 0.75rem;
align-items: center;
+ column-gap: 0.625rem;
width: 100%;
- min-height: 2.75rem;
- padding: 0.36rem 0.48rem !important;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent) !important;
- border-radius: 0.48rem !important;
- background: color-mix(in srgb, var(--toolbar-bg) 88%, transparent) !important;
- color: var(--text-muted) !important;
+ min-height: 1.95rem;
+ padding: 0.28rem 0.5rem 0.28rem 0.625rem;
+ border: 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ color: var(--text);
+ font: inherit;
text-align: left;
- transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
- }
- .guided-view-chapter:hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--toolbar-border)) !important;
- background: color-mix(in srgb, var(--frontend-fill) 42%, var(--toolbar-bg)) !important;
- }
- .guided-view-chapter:focus-visible {
- outline: 2px solid var(--frontend-stroke);
- outline-offset: 1px;
- }
- .guided-view-chapter-index {
- display: inline-grid;
- width: 1.32rem;
- height: 1.32rem;
- place-items: center;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));
- border-radius: 50%;
- color: var(--frontend-stroke);
- font-size: 0.5rem;
- font-weight: 800;
- letter-spacing: 0.03em;
+ cursor: pointer;
+ transition: background 0.16s ease;
}
- .guided-view-chapter-title {
- min-width: 0;
+ /* Trailing chevron hints that a click focuses the node. */
+ .node-outline-item::after {
+ grid-column: 4;
+ width: 0.75rem;
+ height: 0.75rem;
+ background: currentColor;
+ color: var(--text-muted);
+ content: "";
+ opacity: 0;
+ transform: translateX(-3px);
+ transition: opacity 0.16s ease, transform 0.16s ease;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
+ }
+ .node-outline-item:hover,
+ .node-outline-item:focus-visible,
+ .node-outline-item[data-previewing] { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
+ .node-outline-item:hover::after,
+ .node-outline-item:focus-visible::after { opacity: 0.7; transform: translateX(0); }
+ .node-outline-item:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--outline-tone) 60%, transparent); outline-offset: -1.5px; }
+ .node-outline-item[aria-current="true"] { background: color-mix(in srgb, var(--outline-tone) 10%, transparent); }
+ .node-outline-item[aria-current="true"]::after { opacity: 0; }
+ /* Swatches echo the diagram's node cards: tinted fill, hairline stroke. */
+ .node-outline-dot {
+ width: 0.625rem;
+ height: 0.5rem;
+ border: 1.25px solid var(--outline-tone);
+ border-radius: 0.15rem;
+ background: color-mix(in srgb, var(--outline-tone) 16%, var(--bg));
+ transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
+ }
+ .node-outline-item:hover .node-outline-dot,
+ .node-outline-item:focus-visible .node-outline-dot,
+ .node-outline-item[data-previewing] .node-outline-dot,
+ .node-outline-item[aria-current="true"] .node-outline-dot {
+ background: var(--outline-tone);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--outline-tone) 18%, transparent);
+ transform: scale(1.08);
+ }
+ .node-outline-item strong {
overflow: hidden;
- color: var(--toolbar-text);
- font-size: 0.625rem;
- font-weight: 700;
- line-height: 1.3;
+ font-size: 0.8125rem;
+ font-weight: 500;
text-overflow: ellipsis;
white-space: nowrap;
}
- .guided-view-chapter-count {
- grid-column: 3;
- grid-row: 1;
- margin-left: 0.38rem;
- color: var(--text-faint);
- font-size: 0.5rem;
- font-style: normal;
- font-weight: 650;
- white-space: nowrap;
- }
- .guided-view-chapter-delta {
- display: inline-flex;
- grid-column: 3;
- grid-row: 1;
- align-items: center;
- gap: 0.22rem;
- margin-left: 0.38rem;
+ .node-outline-item[aria-current="true"] strong { font-weight: 600; }
+ .node-outline-item small {
+ overflow: hidden;
color: var(--text-faint);
- font-size: 0.5rem;
- font-weight: 750;
- letter-spacing: 0.01em;
+ font-size: 0.6875rem;
+ text-align: right;
+ text-overflow: ellipsis;
white-space: nowrap;
+ transition: color 0.16s ease;
}
- .guided-view-chapter-delta[hidden] { display: none; }
- .guided-view-chapter-delta [data-delta-kind="stay"] { color: var(--text-muted); }
- .guided-view-chapter-delta [data-delta-kind="enter"] { color: var(--frontend-stroke); }
- .guided-view-chapter-delta [data-delta-kind="leave"] { color: var(--security-stroke); }
- .guided-view-chapter[data-preview-active="true"] {
- border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border)) !important;
- background: color-mix(in srgb, var(--frontend-fill) 54%, var(--toolbar-bg)) !important;
- }
- .guided-view-chapter[data-chapter-position="current"] {
- border: 2px solid var(--frontend-stroke) !important;
- padding: calc(0.36rem - 1px) calc(0.48rem - 1px) !important;
- box-shadow: inset 3px 0 0 var(--frontend-stroke);
- color: var(--toolbar-text) !important;
- }
- .guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index {
- background: var(--frontend-stroke);
- color: var(--bg);
- }
- .guided-view-chapter[data-chapter-position="before"] {
- border-style: solid !important;
- opacity: 0.72;
- }
- .guided-view-chapter[data-chapter-position="after"] { border-style: dashed !important; }
- html[data-preset="signal-flow"] .guided-view-chapter[data-chapter-position="current"] {
- box-shadow: inset 3px 0 0 var(--frontend-stroke), 0 0 18px color-mix(in srgb, var(--frontend-stroke) 18%, transparent);
- }
- html[data-preset="blueprint"] .guided-view-chapter,
- html[data-preset="blueprint"] .guided-view-chapter-index { border-radius: 0.12rem !important; }
+ .node-outline-item:hover small,
+ .node-outline-item[data-previewing] small,
+ .node-outline-item[aria-current="true"] small { color: var(--text-muted); }
- /* Story Shelf — keep every authored chapter and the Play action visible,
- but do not spend a second row on unavailable director controls before
- the reader enters a chapter. Existing data-active-view state expands
- the full guided surface without a new toggle or stored preference. */
- .guided-views[data-active-view="all"] {
- grid-template-columns: minmax(11rem, .72fr) auto minmax(0, 2fr);
+ .card-header {
+ display: flex;
align-items: center;
- padding: 0.28rem 0.35rem;
- }
- .guided-views[data-active-view="all"] > #guided-view-prev,
- .guided-views[data-active-view="all"] > #guided-view-next,
- .guided-views[data-active-view="all"] .guided-view-beat-link,
- .guided-views[data-active-view="all"] .guided-view-all { display: none; }
- .guided-views[data-active-view="all"] .guided-view-copy {
- grid-column: 1;
- grid-row: 1;
- padding: 0.1rem 0.55rem;
- }
- .guided-views[data-active-view="all"] .guided-view-copy > #guided-view-note { display: none; }
- .guided-views[data-active-view="all"] .guided-view-actions {
- display: block;
- grid-column: 2;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-play { min-height: 2.75rem; }
- .guided-views[data-active-view="all"] .guided-view-index {
- grid-column: 3;
- grid-row: 1;
- padding: 0 0.08rem 0 0.42rem;
- border-top: 0;
- border-left: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- .guided-views[data-active-view="all"] .guided-view-chapters {
- gap: 0.3rem;
- padding: 0;
- }
-
- .cards {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
- gap: 1rem;
- margin-top: 2rem;
- }
-
- .card {
- background: var(--panel);
- border-radius: 0.75rem;
- border: 1px solid var(--panel-border);
- padding: 1.25rem;
- }
-
- html[data-preset="signal-flow"] .card {
- background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
- }
- html[data-preset="signal-flow"][data-theme="light"] .card {
- background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
- }
-
- /* Preserve the one-screen guarantee on ordinary laptop displays. The
- high-screen expansion above must not trade a fuller canvas for page
- scrolling at 900–1080px heights. */
- @media (min-width: 768px) and (max-height: 1100px) {
- .header { margin-bottom: 1rem; }
- .diagram-container {
- padding: 0.875rem;
- padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
- }
- .cards { margin-top: 1rem; }
- .card { padding: 1rem; }
- }
- @media (min-width: 768px) and (max-height: 920px) {
- body { padding-block: 1.25rem; }
- .header { margin-bottom: 0.875rem; }
- .cards { margin-top: 0.75rem; }
- html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
- html[data-nav-stage-rail="true"] .header { margin-bottom: 0.5rem; }
- html[data-nav-stage-rail="true"] .guided-views { margin-bottom: 0.375rem; }
- html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
- html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
- }
-
- html[data-preset="blueprint"] .card {
- position: relative;
- border-color: var(--panel-border);
- border-radius: 0.3rem;
- background: var(--panel);
- box-shadow: none;
- }
- html[data-preset="blueprint"] .card::before {
- content: "";
- position: absolute;
- top: -1px;
- left: 1rem;
- width: 2.5rem;
- border-top: 2px solid var(--frontend-stroke);
- }
-
- html[data-preset="editorial"] .card {
- position: relative;
- border-radius: 0.28rem;
- background: var(--panel);
- box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
- }
- html[data-preset="editorial"] .card::before {
- position: absolute;
- top: -1px;
- left: 1.25rem;
- width: 3.25rem;
- border-top: 3px solid var(--arrow-emphasis);
- content: "";
- }
- html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
-
- .card-header {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- margin-bottom: 0.75rem;
+ gap: 0.5rem;
+ margin-bottom: 0.625rem;
}
.card-dot {
+ flex: none;
width: 8px;
height: 8px;
border-radius: 50%;
@@ -3073,15 +2896,40 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.card-dot.orange { background: var(--messagebus-stroke); }
.card-dot.slate { background: var(--external-stroke); }
- .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }
+ .card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.card ul {
list-style: none;
color: var(--text-muted);
- font-size: 0.75rem;
+ font-size: 0.8125rem;
+ line-height: 1.6;
}
- .card li { margin-bottom: 0.375rem; }
+ .card li {
+ position: relative;
+ margin-bottom: 0.3rem;
+ padding-left: 0.9rem;
+ }
+ .card li:last-child { margin-bottom: 0; }
+ /* Hanging markers take the card's tone so wrapped lines align under text. */
+ .card li::before {
+ position: absolute;
+ top: calc(0.8em - 2px);
+ left: 0.2rem;
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ background: color-mix(in srgb, var(--card-tone, var(--text-muted)) 70%, transparent);
+ content: "";
+ }
+ .card:has(.card-dot.cyan) { --card-tone: var(--frontend-stroke); }
+ .card:has(.card-dot.emerald) { --card-tone: var(--backend-stroke); }
+ .card:has(.card-dot.violet) { --card-tone: var(--database-stroke); }
+ .card:has(.card-dot.amber) { --card-tone: var(--cloud-stroke); }
+ .card:has(.card-dot.rose) { --card-tone: var(--security-stroke); }
+ .card:has(.card-dot.orange) { --card-tone: var(--messagebus-stroke); }
+ .card:has(.card-dot.slate) { --card-tone: var(--external-stroke); }
+ .card-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-tone, transparent) 16%, transparent); }
/* ==========================================================
Print stylesheet — hide interactive controls, force light,
@@ -3126,11 +2974,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
body { background: #ffffff !important; padding: 0; }
.container { max-width: none; }
- .toolbar, .diagram-nav, .focus-chip, .guided-views, .archify-toast, .no-print { display: none !important; }
- .chapter-handoff-overlay { display: none !important; }
- svg [data-node-id][data-chapter-role] { opacity: 1 !important; }
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] { opacity: 1 !important; filter: none !important; }
+ .toolbar, .diagram-nav, .focus-chip, .archify-toast, .no-print { display: none !important; }
+
.diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }
.diagram-container { --archify-nav-reserve: 0px !important; }
html[data-preset="signal-flow"] .diagram-container,
@@ -3156,16 +3001,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.relationship-hit-overlay { display: none !important; }
.relationship-pulse-overlay { display: none !important; }
.route-probe-overlay, .route-journey-overlay { display: none !important; }
- .story-trail-overlay,
- .story-carrier-overlay { display: none !important; }
.diagram-container svg[data-focus-active] [data-node-id],
.diagram-container svg[data-focus-active] [data-edge-from],
+ .diagram-container svg[data-focus-active] [data-graph-role="automatic-crossover-underlay"],
.diagram-container svg[data-reach-active] [data-node-id],
.diagram-container svg[data-reach-active] [data-edge-from],
- .diagram-container svg[data-story-beat] [data-story-step],
- .diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],
+ .diagram-container svg[data-reach-active] [data-graph-role="automatic-crossover-underlay"],
.diagram-container svg[data-route-active] [data-node-id],
- .diagram-container svg[data-route-active] [data-edge-from] {
+ .diagram-container svg[data-route-active] [data-edge-from],
+ .diagram-container svg[data-route-active] [data-graph-role="automatic-crossover-underlay"] {
opacity: 1 !important;
filter: none !important;
animation: none !important;
@@ -3176,61 +3020,162 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ==========================================================
TOOLBAR (theme toggle + export menu)
========================================================== */
+ /* The toolbar tracks the centered reader column and the title row, so
+ an adaptive narrow reader does not leave its controls stranded at the
+ viewport edge. */
.toolbar {
- position: fixed;
- top: 1rem;
- right: 1rem;
+ position: absolute;
+ top: var(--archify-page-top);
+ right: max(1rem, calc((100vw - min(100vw - 4rem, var(--archify-reader-width, 1440px))) / 2));
display: flex;
align-items: center;
- gap: 0.5rem;
+ gap: 0.125rem;
padding: 0;
border: 0;
background: transparent;
box-shadow: none;
z-index: 100;
}
+ /* Ghost controls keep a 44px hit area while the visible pill stays compact;
+ Export is the one primary action. */
.toolbar button {
- background: var(--toolbar-bg);
- color: var(--toolbar-text);
- border: 1px solid var(--toolbar-border);
- padding: 0.5rem 0.875rem;
- border-radius: 0.625rem;
+ position: relative;
+ isolation: isolate;
+ background: transparent;
+ color: var(--text-muted);
+ border: 0;
+ padding: 0.5rem 0.75rem;
+ border-radius: 0.5625rem;
font-family: inherit;
- font-size: 0.75rem;
+ font-size: 0.8125rem;
font-weight: 500;
cursor: pointer;
white-space: nowrap;
- backdrop-filter: blur(10px);
- box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
- transition: background 0.15s, border-color 0.15s, color 0.15s;
+ box-shadow: none;
+ transition: color 0.15s;
display: inline-flex;
align-items: center;
- gap: 0.375rem;
+ gap: 0.4rem;
min-height: 2.75rem;
}
- .toolbar button:hover {
- background: var(--toolbar-hover);
- border-color: color-mix(in srgb, var(--arrow) 62%, var(--toolbar-border));
+ .toolbar button::before {
+ position: absolute;
+ z-index: -1;
+ inset: 0.375rem 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ content: "";
+ transition: background 0.15s, box-shadow 0.15s;
}
+ .toolbar button:hover { color: var(--text); }
+ .toolbar button:hover::before { background: color-mix(in srgb, var(--text) 6%, transparent); }
.toolbar button[aria-expanded="true"],
- .toolbar button[aria-pressed="true"]:not(#btn-theme) {
- background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));
- border-color: color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));
+ .toolbar button[aria-pressed="true"]:not(#btn-theme) { color: var(--text); }
+ .toolbar button[aria-expanded="true"]::before,
+ .toolbar button[aria-pressed="true"]:not(#btn-theme)::before {
+ background: color-mix(in srgb, var(--text) 8%, transparent);
}
.toolbar #btn-export {
- padding-right: 0.82rem;
- padding-left: 0.82rem;
+ margin-left: 0.375rem;
+ padding-right: 0.95rem;
+ padding-left: 1rem;
+ color: var(--bg);
+ font-weight: 550;
}
- .toolbar #btn-export:hover,
- .toolbar #btn-export[aria-expanded="true"] {
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));
- border-color: color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));
+ .toolbar #btn-export::before {
+ background: var(--text);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -8px rgba(15, 23, 42, 0.4);
}
+ .toolbar #btn-export:hover,
+ .toolbar #btn-export[aria-expanded="true"] { color: var(--bg); }
+ .toolbar #btn-export:hover::before,
+ .toolbar #btn-export[aria-expanded="true"]::before { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.toolbar button:focus-visible {
outline: 2px solid var(--frontend-stroke);
- outline-offset: 2px;
+ outline-offset: -4px;
+ }
+ .toolbar { gap: 0.5rem; }
+ .toolbar #btn-export { margin-left: 0; }
+ .toolbar #btn-export::before { inset: 0.25rem 0; border-radius: 0.6875rem; }
+ /* Tools share one quiet capsule; the capsule is drawn inside the 44px row
+ so the controls keep their hit area without a tall visible box. */
+ .toolbar-group {
+ position: relative;
+ isolation: isolate;
+ display: flex;
+ align-items: center;
+ gap: 0.0625rem;
+ padding: 0 0.25rem;
+ }
+ .toolbar-group::before {
+ position: absolute;
+ z-index: -1;
+ inset: 0.25rem 0;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
+ border-radius: 0.6875rem;
+ background: color-mix(in srgb, var(--panel) 78%, transparent);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.22);
+ backdrop-filter: blur(12px);
+ content: "";
+ }
+ .toolbar-group button { padding-inline: 0.625rem; }
+ .toolbar-group button::before { inset: 0.5rem 0; border-radius: 0.5rem; }
+ /* Theme becomes a sliding switch; its label stays for assistive tech. */
+ .toolbar #theme-label,
+ .toolbar #present-label {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip: rect(0 0 0 0);
+ white-space: nowrap;
}
+ .toolbar #btn-theme {
+ width: 3.5rem;
+ padding: 0;
+ justify-content: center;
+ }
+ .toolbar #btn-theme::before {
+ inset: 0.75rem 0.4375rem;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 9%, transparent);
+ box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
+ }
+ .toolbar #btn-theme:hover::before { background: color-mix(in srgb, var(--text) 13%, transparent); }
+ .toolbar #btn-theme::after {
+ position: absolute;
+ z-index: 0;
+ top: 50%;
+ left: 0.5625rem;
+ width: 1.125rem;
+ height: 1.125rem;
+ border-radius: 50%;
+ background: var(--panel);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.12);
+ content: "";
+ transform: translateY(-50%);
+ transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ .toolbar #theme-icon {
+ position: absolute;
+ z-index: 1;
+ top: 50%;
+ left: calc(0.5625rem + 0.1875rem);
+ width: 0.75rem;
+ height: 0.75rem;
+ color: var(--cloud-stroke);
+ transform: translateY(-50%);
+ transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ [data-theme="dark"] .toolbar #btn-theme::before { background: rgba(148, 163, 184, 0.16); }
+ [data-theme="dark"] .toolbar #btn-theme::after { left: calc(100% - 0.5625rem - 1.125rem); background: #3b4a63; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
+ [data-theme="dark"] .toolbar #theme-icon { left: calc(100% - 0.5625rem - 1.125rem + 0.1875rem); color: #c7d2fe; }
+ .toolbar #btn-present { width: 2.5rem; padding: 0; justify-content: center; }
+ .toolbar #btn-present .toolbar-icon { width: 1rem; height: 1rem; }
+ html[data-motion="still"] .toolbar #btn-theme::after,
+ html[data-motion="still"] .toolbar #theme-icon { transition: none; }
+ html[data-present="true"]:not([data-embed="true"]) .toolbar { right: 1rem; }
+ html[data-preset="editorial"] .toolbar { border-radius: 0.45rem; }
.toolbar #btn-motion[hidden] { display: none !important; }
.toolbar #btn-motion { min-width: 4.4rem; }
.toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }
@@ -3304,19 +3249,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);
transform: rotate(45deg) scale(0.72);
}
+ /* Menus anchor to the tools capsule so they open flush under it. */
+ .toolbar-group .preset-wrap { position: static; }
.toolbar .preset-menu {
position: absolute;
- top: calc(100% + 0.375rem);
+ top: calc(100% + 0.125rem);
right: 0;
display: none;
- width: 18.5rem;
+ width: 17.5rem;
max-width: calc(100vw - 2rem);
- padding: 0.45rem;
- border: 1px solid var(--toolbar-border);
+ padding: 0.375rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
border-radius: 0.875rem;
background: var(--toolbar-menu-bg);
- box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
+ }
+ [data-theme="dark"] .toolbar .preset-menu,
+ [data-theme="dark"] .toolbar .export-menu {
+ border-color: rgba(148, 163, 184, 0.16);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.6);
}
+ /* Menu rows are not toolbar pills: drop the ghost-button pseudo surface. */
+ .toolbar .preset-menu button,
+ .toolbar .export-menu button { isolation: auto; min-height: 0; }
+ .toolbar .preset-menu button::before { display: none; }
.toolbar .preset-menu.open { display: block; }
.toolbar .preset-menu.open,
.toolbar .export-menu.open {
@@ -3329,50 +3285,74 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.preset-menu-heading {
display: flex;
- align-items: baseline;
+ align-items: center;
justify-content: space-between;
gap: 1rem;
- padding: 0.42rem 0.6rem 0.55rem;
+ padding: 0.45rem 0.55rem 0.4rem;
color: var(--text-faint);
- font-size: 0.56rem;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.01em;
}
- .preset-menu-heading span:last-child {
- font-size: 0.52rem;
- letter-spacing: 0.04em;
- text-transform: none;
+ .preset-menu-shortcut {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.35rem;
+ font-weight: 500;
+ }
+ .preset-menu-shortcut kbd {
+ min-width: 1.125rem;
+ padding: 0.05rem 0.3rem;
+ border: 1px solid var(--panel-border);
+ border-bottom-width: 2px;
+ border-radius: 0.3rem;
+ background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
+ color: var(--text-muted);
+ font-family: inherit;
+ font-size: 0.625rem;
+ font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
}
.toolbar .preset-option {
display: grid;
- grid-template-columns: 2rem minmax(0, 1fr) 1rem;
+ grid-template-columns: 2.375rem minmax(0, 1fr) 1rem;
align-items: center;
- gap: 0.68rem;
+ gap: 0.75rem;
width: 100%;
- min-height: 3.35rem;
- padding: 0.5rem 0.62rem;
+ min-height: 3.125rem;
+ margin-top: 0.125rem;
+ padding: 0.45rem 0.6rem 0.45rem 0.5rem;
border: 0;
- border-radius: 0.5rem;
+ border-radius: 0.625rem;
background: transparent;
+ color: var(--text);
box-shadow: none;
backdrop-filter: none;
text-align: left;
+ transition: background 0.14s ease;
}
.toolbar .preset-option:hover,
- .toolbar .preset-option:focus-visible { background: var(--toolbar-hover); }
- .toolbar .preset-option[aria-checked="true"] {
- background: color-mix(in srgb, var(--frontend-stroke) 9%, transparent);
- border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);
+ .toolbar .preset-option:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
+ .toolbar .preset-option[aria-checked="true"] { background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent); }
+ .toolbar .preset-option:focus-visible {
+ outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
+ outline-offset: -1.5px;
}
.preset-option-swatch {
position: relative;
- width: 2rem;
- height: 1.55rem;
+ width: 2.375rem;
+ height: 1.75rem;
overflow: hidden;
- border: 1px solid #64748b;
- border-radius: 0.24rem;
+ border: 0;
+ border-radius: 0.4375rem;
background: #0f172a;
- box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
+ box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);
+ transition: box-shadow 0.14s ease, transform 0.14s ease;
+ }
+ .toolbar .preset-option:hover .preset-option-swatch { transform: translateY(-1px); }
+ .toolbar .preset-option[aria-checked="true"] .preset-option-swatch {
+ box-shadow: 0 0 0 2px var(--toolbar-menu-bg), 0 0 0 3.5px var(--frontend-stroke);
}
.preset-option-swatch::before,
.preset-option-swatch::after { position: absolute; content: ""; }
@@ -3385,6 +3365,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
border-radius: 0.16rem;
background: rgba(34, 211, 238, 0.14);
}
+ /* Classic previews the canvas it will actually produce in this theme. */
+ [data-theme="light"] .preset-option-swatch.classic {
+ background:
+ radial-gradient(circle at 1px 1px, #d9dee5 0.6px, transparent 0.9px) 0 0 / 5px 5px,
+ #ffffff;
+ }
+ [data-theme="light"] .preset-option-swatch.classic::before {
+ border-color: #1b87a3;
+ background: rgba(14, 116, 144, 0.08);
+ box-shadow: 0 2px 4px rgba(17, 24, 39, 0.12);
+ }
.preset-option-swatch.signal-flow {
border-color: #29415f;
background: linear-gradient(135deg, #07101e 10%, #10243c 100%);
@@ -3447,15 +3438,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.preset-option-copy strong,
.preset-option-copy small { display: block; }
.preset-option-copy strong {
- color: var(--toolbar-text);
- font-size: 0.72rem;
- font-weight: 600;
+ color: var(--text);
+ font-size: 0.8125rem;
+ font-weight: 550;
+ letter-spacing: -0.005em;
}
+ .toolbar .preset-option[aria-checked="true"] .preset-option-copy strong { font-weight: 650; }
.preset-option-copy small {
- margin-top: 0.16rem;
+ margin-top: 0.125rem;
overflow: hidden;
color: var(--text-faint);
- font-size: 0.57rem;
+ font-size: 0.6875rem;
font-weight: 400;
white-space: nowrap;
text-overflow: ellipsis;
@@ -3485,9 +3478,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-preset="editorial"] .route-probe,
html[data-preset="editorial"] .focus-chip,
html[data-preset="editorial"] .diagram-guide,
- html[data-preset="editorial"] .node-finder,
- html[data-preset="editorial"] .guided-views,
- html[data-preset="editorial"] .share-chapter-cue {
+ html[data-preset="editorial"] .node-finder {
border-radius: 0.3rem;
}
.motion-control-dot {
@@ -3505,19 +3496,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.toolbar .export-menu {
position: absolute;
- top: calc(100% + 0.375rem);
+ top: calc(100% + 0.125rem);
right: 0;
background: var(--toolbar-menu-bg);
- border: 1px solid var(--toolbar-border);
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
width: 19rem;
max-width: calc(100vw - 2rem);
max-height: calc(100vh - 5.5rem);
overflow-y: auto;
border-radius: 0.875rem;
- padding: 0.55rem;
+ padding: 0.375rem;
display: none;
flex-direction: column;
- box-shadow: 0 18px 48px rgba(0,0,0,0.24);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
+ scrollbar-width: thin;
}
.toolbar .export-menu.open { display: flex; }
.export-menu-header {
@@ -3525,94 +3517,111 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
- padding: 0.5rem 0.55rem 0.72rem;
+ padding: 0.55rem 0.6rem 0.6rem;
}
.export-menu-header strong,
.export-menu-header span { display: block; }
.export-menu-header strong {
- color: var(--toolbar-text);
- font-size: 0.78rem;
- font-weight: 650;
- letter-spacing: -0.015em;
+ color: var(--text);
+ font-size: 0.875rem;
+ font-weight: 600;
+ letter-spacing: -0.005em;
}
.export-menu-header span {
- margin-top: 0.16rem;
+ margin-top: 0.15rem;
color: var(--text-faint);
- font-size: 0.56rem;
+ font-size: 0.75rem;
}
.export-menu-header kbd {
- padding: 0.16rem 0.36rem;
- border: 1px solid var(--toolbar-border);
+ min-width: 1.125rem;
+ padding: 0.05rem 0.3rem;
+ border: 1px solid var(--panel-border);
+ border-bottom-width: 2px;
border-radius: 0.3rem;
- color: var(--text-faint);
- background: color-mix(in srgb, var(--toolbar-border) 16%, transparent);
+ background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
+ color: var(--text-muted);
font-family: inherit;
- font-size: 0.54rem;
+ font-size: 0.625rem;
font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
}
.export-menu-section {
display: grid;
grid-template-columns: minmax(0, 1fr);
- gap: 0.18rem;
+ gap: 0.0625rem;
}
.export-menu-section + .export-menu-section {
- margin-top: 0.42rem;
- padding-top: 0.42rem;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 68%, transparent);
+ margin-top: 0.3rem;
+ padding-top: 0.3rem;
+ border-top: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
}
.export-menu-heading {
grid-column: 1 / -1;
display: block;
- padding: 0.24rem 0.55rem 0.2rem;
+ padding: 0.4rem 0.6rem 0.25rem;
color: var(--text-faint);
- font-size: 0.54rem;
+ font-size: 0.6875rem;
font-weight: 600;
- letter-spacing: 0.12em;
- text-transform: uppercase;
+ letter-spacing: 0.01em;
}
.toolbar .export-menu button {
display: grid;
- grid-template-columns: 1.15rem minmax(0, 1fr);
+ grid-template-columns: 1rem minmax(0, 1fr);
align-items: center;
- column-gap: 0.52rem;
+ column-gap: 0.7rem;
background: transparent;
- border: 1px solid transparent;
+ border: 0;
box-shadow: none;
backdrop-filter: none;
width: 100%;
- min-height: 3rem;
+ min-height: 2.5rem;
text-align: left;
- padding: 0.48rem 0.55rem;
- border-radius: 0.5rem;
+ padding: 0.4rem 0.6rem;
+ border-radius: 0.5625rem;
+ color: var(--text);
white-space: nowrap;
+ transition: background 0.14s ease;
+ }
+ .toolbar .export-menu button:hover,
+ .toolbar .export-menu button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
+ .toolbar .export-menu button:focus-visible {
+ outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
+ outline-offset: -1.5px;
}
+ /* Name and format hint share one line, so each row stays compact. */
.export-item-copy {
- display: block;
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 0.75rem;
min-width: 0;
}
- .export-item-copy strong,
- .export-item-copy small { display: block; }
.export-item-copy strong {
overflow: hidden;
color: inherit;
- font-size: 0.7rem;
- font-weight: 550;
+ font-size: 0.8125rem;
+ font-weight: 500;
text-overflow: ellipsis;
}
.export-item-copy small {
- margin-top: 0.12rem;
- overflow: hidden;
+ flex: none;
color: var(--text-faint);
- font-size: 0.55rem;
+ font-size: 0.6875rem;
font-weight: 450;
- text-overflow: ellipsis;
}
.toolbar .export-menu button::before {
+ position: static;
+ z-index: auto;
+ inset: auto;
+ border-radius: 0;
+ display: block;
width: 1rem;
height: 1rem;
background: currentColor;
+ color: var(--text-muted);
content: "";
- opacity: 0.72;
+ opacity: 0.8;
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
@@ -3620,7 +3629,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
mask-repeat: no-repeat;
mask-size: contain;
}
- .toolbar .export-menu button[data-format="share-card"]::before,
.toolbar .export-menu button[data-action="route-share-card"]::before,
.toolbar .export-menu button[data-action="reach-share-card"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");
@@ -3636,38 +3644,32 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
}
- .toolbar .export-menu button[data-format="svg"]::before,
+ .toolbar .export-menu button[data-format^="svg"]::before,
.toolbar .export-menu button[data-format="webm"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
}
- .toolbar .export-menu button[data-format="share-card"],
.toolbar .export-menu button[data-action="route-share-card"],
.toolbar .export-menu button[data-action="reach-share-card"] {
- min-height: 3.35rem;
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent);
- border-color: color-mix(in srgb, var(--frontend-stroke) 24%, var(--toolbar-border));
+ color: var(--text);
+ background: color-mix(in srgb, var(--frontend-stroke) 7%, transparent);
}
+ .toolbar .export-menu button[data-action="route-share-card"]::before,
+ .toolbar .export-menu button[data-action="reach-share-card"]::before { color: var(--frontend-stroke); opacity: 1; }
.toolbar .export-menu button[hidden] { display: none; }
- .toolbar .export-menu button:hover {
- background: var(--toolbar-hover);
- }
- .toolbar .export-menu button:focus-visible {
- background: var(--toolbar-hover);
- outline-offset: -2px;
+ .toolbar .export-menu button[data-action="route-share-card"]:hover,
+ .toolbar .export-menu button[data-action="reach-share-card"]:hover {
+ background: color-mix(in srgb, var(--frontend-stroke) 12%, transparent);
}
.toolbar .export-menu button:disabled {
color: var(--text-faint);
- background: color-mix(in srgb, var(--toolbar-border) 18%, transparent);
+ background: transparent;
+ opacity: 0.55;
cursor: not-allowed;
}
- .toolbar .export-menu button:disabled:hover {
- border-color: transparent;
- }
.toolbar .export-menu .hint {
color: var(--text-faint);
- font-size: 0.55rem;
+ font-size: 0.6875rem;
}
/* Toast — brief feedback for actions like "copied" */
@@ -3707,6 +3709,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.toolbar {
position: relative;
+ top: auto;
+ right: auto;
justify-content: flex-end;
width: max-content;
max-width: 100%;
@@ -3809,6 +3813,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
width: calc(100% - 1rem);
max-width: none;
}
+ .relationship-lens-head { padding-top: 0.7rem; }
+ .relationship-lens-drag-handle { display: none; }
.relationship-lens-list { max-height: min(12rem, 38vh); }
.relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }
.focus-chip:not([data-relations-expanded="true"]) .relationship-lens-head { border-bottom-color: transparent; }
@@ -3891,95 +3897,24 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.route-journey-controls button { min-height: 2.75rem; }
.route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }
.route-probe-node { max-width: 7.5rem; }
- .guided-views {
- grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
- gap: 0.2rem;
- padding: 0.25rem;
- }
- .guided-view-actions {
- grid-column: 1 / -1;
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- }
- .guided-views > #guided-view-prev,
- .guided-views > #guided-view-next {
- align-self: center;
- height: 2.75rem;
+
+
+
+
+
+
+
+
+
+
+
+ html[data-embed="true"][data-share-playback="true"] .diagram-container {
+ padding-top: 4.25rem;
}
- .guided-view-play,
- .guided-view-all,
- .guided-view-beat-link { min-height: 2.75rem; }
- .guided-view-copy small { white-space: normal; }
- .guided-story-caption { padding: 0.32rem 0.45rem; }
- .guided-story-caption-index { min-width: 2.9rem; padding-right: 0.42rem; }
- .guided-story-caption strong,
- .guided-story-caption small { white-space: normal; }
- .guided-story-caption-next { display: none; }
- .guided-view-trail { min-height: 2rem; }
- .guided-view-trail .guided-view-stop {
- min-height: 2rem;
- padding: 0.22rem 0.42rem 0.22rem 0.28rem;
- }
- .guided-view-handoff { max-width: min(9rem, 32vw); }
- .guided-view-index { padding-top: 0.35rem; }
- .guided-view-chapters {
- gap: 0.35rem;
- scroll-padding-inline: 0.2rem;
- }
- .guided-view-chapters li {
- flex: 0 0 min(14rem, 78vw);
- min-width: 0;
- }
- .guided-view-chapter { min-height: 2.75rem; }
- .guided-views[data-active-view="all"] {
- grid-template-columns: minmax(0, 1fr) auto;
- gap: 0.2rem;
- padding: 0.25rem;
- }
- .guided-views[data-active-view="all"] .guided-view-copy {
- grid-column: 1;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-actions {
- grid-column: 2;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-play {
- min-width: 6rem !important;
- min-height: 2.75rem;
- }
- .guided-views[data-active-view="all"] .guided-view-index {
- grid-column: 1 / -1;
- grid-row: 2;
- padding: 0.3rem 0.08rem 0;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- border-left: 0;
- }
- html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),
- html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {
- top: 0.5rem;
- grid-template-columns: auto minmax(0, 1fr);
- gap: 0.28rem 0.55rem;
- width: calc(100% - 1rem);
- min-height: 0;
- padding: 0.45rem 0.55rem 0.55rem;
- }
- html[data-embed="true"][data-share-playback="true"] .diagram-container {
- padding-top: 4.25rem;
- }
- html[data-embed="true"][data-share-moment="true"] .diagram-container {
- padding-top: 4.25rem;
- }
- .share-chapter-index {
- min-width: 4.4rem;
- padding-right: 0.5rem;
- }
- .share-chapter-copy small { font-size: 0.46rem; }
- .share-chapter-route {
- grid-column: 1 / -1;
- font-size: 0.5rem;
- text-align: left;
+ html[data-embed="true"][data-share-moment="true"] .diagram-container {
+ padding-top: 4.25rem;
}
+
.cards {
grid-template-columns: 1fr;
margin-top: 1rem;
@@ -4022,11 +3957,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
text-overflow: ellipsis;
white-space: nowrap;
}
- html[data-present="true"]:not([data-embed="true"]) .guided-views {
- padding: 0.2rem;
- }
- html[data-present="true"]:not([data-embed="true"]) .guided-view-copy small { display: none; }
- html[data-present="true"]:not([data-embed="true"]) .guided-story-caption small { display: block; }
+
html[data-present="true"]:not([data-embed="true"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }
html[data-present="true"]:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {
width: 720px;
@@ -4038,13 +3969,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
@media (max-width: 420px) {
.export-menu-section { grid-template-columns: 1fr; }
.export-menu-heading,
- .toolbar .export-menu button[data-format="share-card"],
.toolbar .export-menu button[data-action="route-share-card"],
.toolbar .export-menu button[data-action="reach-share-card"] { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
- .guided-story-caption { animation: none !important; }
.toolbar .preset-menu.open,
.toolbar .export-menu.open { animation: none; }
.toolbar-chevron { transition: none; }
@@ -4055,7 +3984,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }
.toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }
#theme-label, #preset-label, #present-label { display: none; }
- .guided-view-handoff { max-width: 6.5rem; }
}
/* ==========================================================
@@ -4063,6 +3991,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
========================================================== */
.c-grid { stroke: var(--grid); fill: none; }
.c-mask { fill: var(--mask); stroke: none; }
+ .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }
+ .c-lane-wash { fill: var(--lane-fill); stroke: none; }
.c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }
.c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }
@@ -4084,6 +4014,41 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.t-messagebus { fill: var(--messagebus-stroke); }
.t-external { fill: var(--external-stroke); }
+ /* Relationship labels share the exact color token used by their path. */
+ .t-edge-default { fill: var(--arrow); }
+ .t-edge-emphasis { fill: var(--arrow-emphasis); }
+ .t-edge-security { fill: var(--security-stroke); }
+ .t-edge-dashed { fill: var(--database-stroke); }
+
+ /* Classic canvas: a quiet dot field replaces drafting grid lines, and nodes
+ read as lifted cards with hairline strokes. Paint only; authored geometry,
+ hit areas and exports keep their canonical shapes. */
+ html[data-preset="classic"] .diagram-container {
+ background:
+ radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 1.4px) 0 0 / 20px 20px,
+ var(--panel);
+ }
+ html[data-preset="classic"] .diagram-container > svg .c-grid { stroke: transparent; }
+ html[data-preset="classic"][data-theme="light"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
+ filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.05)) drop-shadow(0 6px 12px rgba(17, 24, 39, 0.06));
+ }
+ html[data-preset="classic"][data-theme="dark"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
+ filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
+ }
+ html[data-preset="classic"] .diagram-container > svg [data-edge-from] {
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ }
+ html[data-preset="classic"] .diagram-container > svg .c-lane-wash { fill: color-mix(in srgb, var(--text) 2.6%, transparent); }
+ html[data-preset="classic"] .diagram-container > svg .c-lane-rule { stroke: var(--panel-border); opacity: 1; }
+ html[data-preset="classic"][data-theme="dark"] .diagram-container > svg .c-lane-rule { stroke: rgba(148, 163, 184, 0.16); }
+ html[data-preset="classic"] .diagram-container > svg [data-node-id] {
+ transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ html[data-preset="classic"]:not([data-motion="still"]) .diagram-container > svg [data-node-id]:hover {
+ transform: translateY(-1.5px);
+ }
+
/* Semantic Sigils are small authored role stamps, not icons from a brand
pack and not viewer controls. Prefix selectors with svg so the canonical
export's SVG-only stylesheet collector keeps them automatically. */
@@ -4161,8 +4126,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],
svg[data-route-active] [data-route-match][data-detail],
svg[data-route-active] [data-route-match] [data-detail],
- svg[data-story-active] [data-story-step][data-detail],
- svg[data-story-active] [data-story-step] [data-detail],
svg[data-relationship-preview-active] [data-relationship-preview][data-detail],
svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],
svg [data-node-id]:hover [data-detail],
@@ -4176,7 +4139,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],
svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],
svg[data-route-active] [data-route-match] [data-detail-anchor],
- svg[data-story-active] [data-story-step] [data-detail-anchor],
svg [data-node-id]:hover [data-detail-anchor],
svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }
@@ -4195,9 +4157,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* Stable semantic exploration hooks emitted by every renderer. */
svg [data-node-id] {
cursor: pointer;
- transition: opacity 0.18s ease, filter 0.18s ease;
+ transition: opacity 0.18s ease, fill-opacity 0.18s ease, stroke-opacity 0.18s ease, filter 0.18s ease;
}
- svg [data-edge-from] { transition: opacity 0.18s ease, filter 0.18s ease; }
+ svg [data-edge-from],
+ svg [data-graph-role="automatic-crossover-underlay"] { transition: opacity 0.18s ease, filter 0.18s ease; }
svg [data-node-id]:hover,
svg [data-node-id]:focus-visible {
filter: drop-shadow(0 0 7px var(--frontend-stroke));
@@ -4346,9 +4309,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
opacity: 0.78;
}
html[data-embed="true"] .semantic-lens-overlay { display: none; }
+ /* Automatic crossover masks are visual companions of their one semantic
+ edge. Keep the mask free of data-edge-* identity so graph traversal and
+ export still observe exactly one edge, then mirror reader emphasis from
+ the paired foreground path in this presentation-only wrapper. */
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-match]) > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-peer]) > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-peer]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
svg[data-focus-active] [data-node-id],
svg[data-focus-active] [data-edge-from] { opacity: 0.13; }
+ svg[data-focus-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.13; }
+ svg[data-focus-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-focus-active] [data-focus-match] { opacity: 1; }
+ svg[data-focus-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-focus-active] [data-focus-selected] {
filter: drop-shadow(0 0 10px var(--frontend-stroke));
}
@@ -4359,7 +4335,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
changes only viewer emphasis, not canonical geometry or export bytes. */
svg[data-reach-active] [data-node-id],
svg[data-reach-active] [data-edge-from] { opacity: 0.09; }
+ svg[data-reach-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.09; }
svg[data-reach-active] [data-reach-match] { opacity: 1; }
+ svg[data-reach-active] [data-graph-role="automatic-crossover"]:has(> [data-reach-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-reach-active="upstream"] [data-reach-origin] {
filter: drop-shadow(0 0 11px var(--database-stroke));
}
@@ -4413,14 +4391,14 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg[data-relationship-direct-active] [data-node-id],
svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }
+ svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.16; }
svg[data-relationship-direct-active] [data-relationship-preview],
svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }
+ svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,
- svg[data-story-active] .relationship-hit-rail,
svg[data-route-picking] .relationship-hit-rail,
svg[data-route-active] .relationship-hit-rail,
- svg[data-lens-active] .relationship-hit-rail,
- svg[data-chapter-preview] .relationship-hit-rail { pointer-events: none; }
+ svg[data-lens-active] .relationship-hit-rail { pointer-events: none; }
html[data-embed="true"] .relationship-hit-overlay { display: none; }
@media (hover: none), (pointer: coarse) {
.relationship-hit-rail { stroke-width: 24; }
@@ -4430,8 +4408,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
neighborhood focus. It changes emphasis only; exported geometry and the
relationship's original solid/dashed visual language stay untouched. */
svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }
+ svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.18; }
+ svg[data-relationship-preview-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-relationship-preview-active] [data-relationship-preview],
svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }
+ svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-relationship-preview-active] [data-relationship-preview] {
filter: drop-shadow(0 0 5px var(--arrow-emphasis));
}
@@ -4485,9 +4466,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.relationship-flow-token {
animation: archify-relationship-token-life 1.2s linear 1 both;
}
- .story-flow-token {
- animation: archify-relationship-token-life 0.78s linear 1 both;
- }
+
.semantic-flow-token-halo {
fill: var(--mask);
stroke: currentColor;
@@ -4525,9 +4504,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* Intent Trace is a temporary, pre-click exploration layer. Related
topology stays readable while a short viewer-only signal runs over
cloned edge geometry; the authored edge remains untouched underneath. */
- svg[data-intent-trace-active] [data-node-id],
+ /* Keep the node's opaque backing mask intact while its visible ink dims.
+ Fading the whole group also fades that mask and briefly exposes arrows
+ routed underneath the node when the pointer leaves. */
+ svg[data-intent-trace-active] [data-node-id] { fill-opacity: 0.2; stroke-opacity: 0.2; }
+ svg [data-node-id] > .c-mask { fill-opacity: 1; }
+ svg[data-intent-trace-active] [data-node-id][data-intent-trace-match] { fill-opacity: 1; stroke-opacity: 1; }
svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }
+ svg[data-intent-trace-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.2; }
+ svg[data-intent-trace-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }
+ svg[data-intent-trace-active] [data-graph-role="automatic-crossover"]:has(> [data-intent-trace-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-intent-trace-active] [data-intent-trace-selected] {
filter: drop-shadow(0 0 10px var(--frontend-stroke));
}
@@ -4590,7 +4577,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg[data-route-active] [data-node-id],
svg[data-route-active] [data-edge-from] { opacity: 0.11; }
+ svg[data-route-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
svg[data-route-active] [data-route-match] { opacity: 1; }
+ svg[data-route-active] [data-graph-role="automatic-crossover"]:has(> [data-route-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-route-active] [data-route-start] {
filter: drop-shadow(0 0 11px var(--frontend-stroke));
}
@@ -4603,6 +4592,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-route-journey] [data-route-match][data-route-journey-state="past"] { opacity: 0.62; }
svg[data-route-journey] [data-route-match][data-route-journey-state="future"] { opacity: 0.34; }
svg[data-route-journey] [data-route-match][data-route-journey-state="current"] { opacity: 1; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="past"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="future"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.34; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="current"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-route-journey] [data-node-id][data-route-journey-current] {
filter: drop-shadow(0 0 10px var(--backend-stroke));
}
@@ -4694,93 +4686,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: drop-shadow(0 0 3px var(--frontend-stroke));
}
- /* Story Trail is a viewer-only overlay derived from the ordered focus IDs
- of the active guided view. The authored edge stays underneath with its
- original color, dash pattern, marker, and geometry intact. */
- .story-trail-overlay { pointer-events: none; }
- .story-carrier-overlay { pointer-events: none; }
- .story-trail-flow {
- fill: none;
- stroke: var(--frontend-stroke);
- stroke-width: 2.8;
- stroke-linecap: round;
- vector-effect: non-scaling-stroke;
- opacity: 0.34;
- filter: drop-shadow(0 0 2px var(--frontend-stroke));
- }
- svg[data-story-beat] [data-story-step] {
- opacity: 0.22;
- filter: saturate(0.42);
- transition: opacity 180ms ease, filter 180ms ease;
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="past"] {
- opacity: 0.72;
- filter: saturate(0.82);
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="next"] {
- opacity: 0.5;
- filter: saturate(0.66);
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="active"] {
- opacity: 1;
- filter: drop-shadow(0 0 7px var(--frontend-stroke));
- animation: archify-story-beat-node 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- svg[data-story-beat] [data-edge-from][data-story-beat-step] {
- opacity: 0.16;
- transition: opacity 160ms ease;
- }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="past"] { opacity: 0.58; }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="next"] { opacity: 0.34; }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="active"] { opacity: 1; }
- svg[data-story-beat] .story-trail-flow { opacity: 0; transition: opacity 160ms ease; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="past"] { opacity: 0.34; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="next"] { opacity: 0.2; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="active"] { opacity: 0.92; }
- svg[data-story-beat] .story-trail-flow[data-story-pulse="true"] {
- stroke-dasharray: 2 13;
- stroke-dashoffset: 30;
- opacity: 0.92;
- animation: archify-story-flow 0.78s linear 1 both;
- }
- svg[data-preset="blueprint"] .story-trail-flow {
- stroke-linecap: square;
- filter: none;
- opacity: 0.5;
- }
- svg[data-preset="blueprint"][data-story-beat] [data-story-step][data-story-beat-state="active"] {
- filter: none;
- animation: none;
- }
- svg[data-preset="editorial"] .story-trail-flow { filter: none; }
- svg[data-preset="editorial"][data-story-beat] [data-story-step][data-story-beat-state="active"] {
- filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 16%, transparent));
- }
-
- /* Chapter Delta Preview is a static, pre-commit comparison between two
- chapter focus sets. Symbols in the rail carry the meaning without color;
- these SVG rules only make exact stable-ID membership easier to scan. */
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] {
- opacity: 0.1 !important;
- filter: none !important;
- transition: none !important;
- }
- svg[data-chapter-preview] .story-trail-overlay { opacity: 0.08 !important; }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="stay"] {
- opacity: 0.76 !important;
- filter: saturate(0.7) !important;
- }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="enter"] {
- opacity: 1 !important;
- filter: saturate(1.2) !important;
- }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="leave"] {
- opacity: 0.28 !important;
- filter: grayscale(0.72) !important;
- }
- svg[data-preset="blueprint"][data-chapter-preview] [data-node-id] { filter: none !important; }
-
/* Dashed boundary variants */
.c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }
.c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }
@@ -4794,6 +4699,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
animation: archify-edge-flow 2.4s linear 1;
animation-delay: calc(var(--step, 0) * 160ms);
}
+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: archify-edge-flow 2.4s linear 1;
+ animation-delay: calc(var(--step, 0) * 160ms);
+ }
html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="node"] {
transform-box: fill-box;
transform-origin: center;
@@ -4805,6 +4714,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: drop-shadow(0 0 3px var(--arrow-emphasis));
animation-duration: 1.75s;
}
+ svg[data-preset="signal-flow"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 1.75s; }
svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {
animation-duration: 3.1s;
}
@@ -4813,6 +4723,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
animation-duration: 2.15s;
}
+ svg[data-preset="blueprint"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 2.15s; }
svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {
animation-name: archify-blueprint-node-pulse;
animation-duration: 3.8s;
@@ -4821,18 +4732,23 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
animation-duration: 2.2s;
}
+ svg[data-preset="editorial"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 2.2s; }
svg[data-preset="editorial"][data-animation="trace"] [data-animate="node"] {
animation-name: archify-editorial-node-pulse;
animation-duration: 3.5s;
}
- /* Embedded proofs are static until a named Story Trail chapter is played.
- This keeps proof grids calm and ensures ?play=1 stops all viewer motion
- after one 3.2 second chapter instead of leaving ambient trace loops on. */
+ /* Embedded proofs stay static so proof grids are calm instead of leaving
+ ambient trace loops on. */
html[data-embed="true"] svg[data-animation="trace"] [data-animate],
html[data-share-playback="true"] svg[data-animation="trace"] [data-animate] {
animation: none !important;
stroke-dashoffset: 0;
}
+ html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: none !important;
+ stroke-dashoffset: 0;
+ }
@keyframes archify-edge-flow {
0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }
88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }
@@ -4863,13 +4779,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }
55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }
}
- @keyframes archify-guided-progress {
- from { transform: scaleX(var(--guided-progress-start, 0)); }
- to { transform: scaleX(1); }
- }
- @keyframes archify-story-flow {
- to { stroke-dashoffset: 0; }
- }
+
@keyframes archify-intent-trace-flow {
0% { opacity: 0.28; stroke-dashoffset: 0; }
12%, 78% { opacity: 0.94; }
@@ -4900,11 +4810,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
13%, 82% { opacity: 1; }
100% { opacity: 0; }
}
- @keyframes archify-story-beat-node {
- from { opacity: 0.48; filter: saturate(0.6); }
- 58% { opacity: 1; filter: drop-shadow(0 0 10px var(--frontend-stroke)); }
- to { opacity: 1; filter: drop-shadow(0 0 7px var(--frontend-stroke)); }
- }
+
@keyframes archify-share-cue-enter {
from { opacity: 0; transform: translate(-50%, -0.45rem); }
to { opacity: 1; transform: translate(-50%, 0); }
@@ -4922,30 +4828,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
animation: none !important;
stroke-dashoffset: 0;
}
- .guided-view-progress span {
+ svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
animation: none !important;
- transform: scaleX(1) !important;
+ stroke-dashoffset: 0;
}
- .story-trail-flow,
.intent-trace-flow,
.route-probe-flow,
.semantic-lens,
.diagram-guide,
- [data-story-step],
- .overview-map-live,
- .guided-view-stop,
- .share-chapter-cue,
- .chapter-handoff-anchor,
- .share-chapter-state::before,
- .share-chapter-progress span { animation: none !important; }
- .guided-view-chapter,
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] { transition: none !important; }
- svg[data-story-playing="true"] .story-trail-flow {
- stroke-dasharray: none;
- stroke-dashoffset: 0;
- opacity: 0.55;
- }
+ .overview-map-live { animation: none !important; }
+
.intent-trace-flow {
animation: none !important;
stroke-dasharray: none;
@@ -4958,8 +4850,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
stroke-dashoffset: 0;
opacity: 0.78;
}
- .route-journey-overlay,
- .story-carrier-overlay { display: none !important; }
+ .route-journey-overlay { display: none !important; }
.semantic-lens-flow {
animation: none !important;
stroke-dasharray: none;
@@ -4968,7 +4859,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
}
.relationship-pulse-overlay { display: none !important; }
- .guided-view-chapter { transition: none !important; }
.source-evidence-beacon,
svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }
}
@@ -4979,6 +4869,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Motion appears only for trace-enabled artifacts and has no shortcut;
Keyboard: T toggles theme, S cycles style, F toggles the stage, E opens export. -->
<div class="toolbar" role="toolbar" aria-label="Diagram actions">
+ <div class="toolbar-group">
<button id="btn-theme" type="button"
title="Toggle theme (T)"
aria-label="Toggle color theme"
@@ -4999,7 +4890,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>
</button>
<div class="preset-menu" id="preset-menu" role="menu" aria-label="Visual style">
- <div class="preset-menu-heading" role="presentation"><span>Visual identity</span><span>S cycles</span></div>
+ <div class="preset-menu-heading" role="presentation"><span>Visual identity</span><span class="preset-menu-shortcut"><kbd>S</kbd>to cycle</span></div>
<button class="preset-option" data-preset-value="classic" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
<span class="preset-option-swatch classic" aria-hidden="true"></span>
<span class="preset-option-copy"><strong>Classic</strong><small>Stable technical default</small></span>
@@ -5036,6 +4927,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span id="present-icon" class="toolbar-icon" aria-hidden="true"></span>
<span id="present-label">Present</span>
</button>
+ </div>
<div class="export-wrap">
<button id="btn-export" type="button"
title="Export diagram (E)"
@@ -5052,10 +4944,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="export-menu-section" role="group" aria-label="Share">
<span class="export-menu-heading" aria-hidden="true">Share</span>
- <button data-format="share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
<button data-action="route-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>Route Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
<button data-action="reach-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>Reach Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
- <button data-action="copy-share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Copy Share Card</strong><small class="hint">PNG to clipboard</small></span></button>
<button data-action="copy" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Copy diagram</strong><small class="hint">PNG to clipboard</small></span></button>
</div>
<div class="export-menu-section" role="group" aria-label="Raster images">
@@ -5066,7 +4956,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="export-menu-section" role="group" aria-label="Vector and motion">
<span class="export-menu-heading" aria-hidden="true">Vector &amp; motion</span>
- <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG</strong><small class="hint">Editable vector</small></span></button>
+ <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Auto</strong><small class="hint">Matches host theme</small></span></button>
+ <button data-format="svg-light" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Light</strong><small class="hint">Always light</small></span></button>
+ <button data-format="svg-dark" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Dark</strong><small class="hint">Always dark</small></span></button>
<button data-format="webm" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebM</strong><small class="hint">6s motion</small></span></button>
</div>
</div>
@@ -5086,52 +4978,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<p class="subtitle">Grid placement demo — row/col instead of manual pos</p>
</div>
- <script id="archify-guided-views-data" type="application/json">[]</script>
-
- <script id="archify-i18n-data" type="application/json">{"locale":"en","messages":{"viewer.kind.frontend":"Frontend","viewer.kind.backend":"Backend","viewer.kind.database":"Database","viewer.kind.cloud":"Cloud","viewer.kind.security":"Security","viewer.kind.messagebus":"Message bus","viewer.kind.external":"External","viewer.kind.neutral":"Neutral","viewer.kind.node":"Node","viewer.kind.start":"Start","viewer.kind.active":"Active","viewer.kind.waiting":"Waiting","viewer.kind.decision":"Decision","viewer.kind.success":"Success","viewer.kind.failure":"Failure","viewer.toolbar.actions":"Diagram actions","viewer.theme.toggle.title":"Toggle theme (T)","viewer.theme.toggle":"Toggle color theme","viewer.theme.dark":"Dark","viewer.theme.light":"Light","viewer.preset.choose.title":"Choose visual style (S cycles)","viewer.preset.choose":"Choose visual style","viewer.preset.style":"Style","viewer.preset.menu":"Visual style","viewer.preset.identity":"Visual identity","viewer.preset.cycles":"S cycles","viewer.preset.classic":"Classic","viewer.preset.classic.short":"Classic","viewer.preset.classic.hint":"Stable technical default","viewer.preset.flow":"Signal Flow","viewer.preset.flow.short":"Flow","viewer.preset.flow.hint":"Motion-forward presentation","viewer.preset.blueprint":"Blueprint","viewer.preset.blueprint.hint":"Engineering review","viewer.preset.editorial":"Editorial","viewer.preset.editorial.hint":"Publication and launch notes","viewer.preset.badge.signalFlow":"SIGNAL FLOW","viewer.preset.badge.blueprint":"BLUEPRINT / REV 01","viewer.preset.badge.editorial":"EDITORIAL / FIELD NOTE","viewer.preset.badge.editorialPlate":"ARCHIFY / PLATE 04","viewer.preset.current":"Visual style: {style}. Choose visual style","viewer.motion.live":"Live","viewer.motion.still":"Still","viewer.motion.pause":"Pause motion","viewer.motion.resume":"Resume motion","viewer.motion.reduced":"Motion paused by reduced-motion preference","viewer.motion.hidden":"Motion paused while this page is hidden","viewer.motion.yielding":"Pause motion; currently yielding to {owner}","viewer.motion.yielding.title":"Live preview enabled · yielding to {owner}","viewer.owner.story":"the guided story","viewer.owner.chapter":"the active chapter","viewer.owner.chapterPreview":"the chapter delta preview","viewer.owner.handoff":"the chapter handoff","viewer.owner.route":"Route Probe","viewer.owner.lens":"Semantic Lens","viewer.owner.relationship":"Relationship Preview","viewer.owner.intent":"Intent Trace","viewer.owner.focus":"semantic focus","viewer.owner.legend":"legend preview","viewer.owner.reader":"reader interaction","viewer.present.enter":"Enter presentation stage","viewer.present.enter.title":"Presentation stage (F)","viewer.present.exit":"Exit presentation stage","viewer.present.exit.title":"Exit presentation stage (F or Escape)","viewer.present.present":"Present","viewer.present.exit.label":"Exit","viewer.export.button":"Export","viewer.export.button.title":"Export diagram (E)","viewer.export.diagram":"Export diagram","viewer.export.menu":"Export","viewer.export.subtitle":"Portable, clean outputs","viewer.export.share":"Share","viewer.export.shareCard":"Share Card","viewer.export.routeShareCard":"Route Share Card","viewer.export.reachShareCard":"Reach Share Card","viewer.export.copyShareCard":"Copy Share Card","viewer.export.copyDiagram":"Copy diagram","viewer.export.clipboardPng":"PNG to clipboard","viewer.export.raster":"Raster images","viewer.export.image":"Image","viewer.export.lossless":"Lossless image","viewer.export.compact":"Compact image","viewer.export.modern":"Modern image","viewer.export.vectorMotion":"Vector and motion","viewer.export.vectorMotion.heading":"Vector \u0026 motion","viewer.export.editable":"Editable vector","viewer.export.motion6s":"6s motion","viewer.export.unsupported":"Not supported by this browser","viewer.export.clipboardUnsupported":"Clipboard image write not supported by this browser","viewer.export.clipboardUnsupported.period":"Clipboard image write not supported by this browser.","viewer.export.clipboardUnsupported.short":"Clipboard image write not supported in this browser.","viewer.export.motionUnavailable":"Motion capture unavailable in this browser","viewer.export.webmUnavailable":"WebM unavailable in this browser","viewer.export.failed":"Export failed: {message}","viewer.export.unknownVariant":"Unknown Share Card variant: {variant}","viewer.export.routeRequired":"Trace a route before exporting a Route Share Card","viewer.export.reachRequired":"Trace authored reach before exporting a Reach Share Card","viewer.export.unknown":"unknown","viewer.export.routeFailed":"Route Share Card export failed: {message}","viewer.export.reachFailed":"Reach Share Card export failed: {message}","viewer.export.copyFailed":"Copy failed: {message}","viewer.export.copiedPng":"Copied PNG to clipboard","viewer.export.copiedShare":"Copied Share Card","viewer.export.downloadedShare":"Downloaded Share Card","viewer.export.downloadedRoute":"Downloaded Route Share Card","viewer.export.downloadedReach":"Downloaded Reach Share Card","viewer.export.downloadedWebm":"Downloaded WebM","viewer.export.recording":"Recording 6 seconds of motion…","viewer.export.card.routeSummary.one":"Route: {source} → {target} · {count} directed hop","viewer.export.card.routeSummary.other":"Route: {source} → {target} · {count} directed hops","viewer.export.card.reachSummary":"Authored {direction} from {origin} · {nodes} · {links} · max {hops}","viewer.export.card.node.one":"{count} node","viewer.export.card.node.other":"{count} nodes","viewer.export.card.link.one":"{count} link","viewer.export.card.link.other":"{count} links","viewer.export.card.hop.one":"{count} hop","viewer.export.card.hop.other":"{count} hops","viewer.export.card.routeBadge":"ARCHIFY · ROUTE · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction} REACH","viewer.export.card.defaultBadge":"ARCHIFY · {preset} · {theme}","viewer.export.direction.upstream":"Upstream","viewer.export.direction.downstream":"Downstream","viewer.export.error.canvasUnavailable":"Canvas unavailable for {label}","viewer.export.error.contextUnavailable":"2D canvas context unavailable for {label}","viewer.export.error.toBlobUnavailable":"canvas.toBlob unavailable for {label}","viewer.export.error.toBlobNull":"canvas.toBlob returned no data for {label}","viewer.export.error.variantsCombined":"Share Card variants cannot be combined","viewer.export.error.viewerState":"Share Card export could not remove temporary viewer state","viewer.export.error.routeState":"Route Card export could not preserve the resolved route safely","viewer.export.error.reachState":"Reach Card export could not preserve authored reach safely","viewer.export.error.webmRequirements":"WebM motion export requires a trace animation and browser MediaRecorder support","viewer.export.error.mediaRecorder":"MediaRecorder failed","viewer.export.error.emptyWebm":"MediaRecorder produced an empty WebM","viewer.export.error.webmBackground":"SVG background could not be loaded for WebM export","viewer.guided.region":"Guided diagram views","viewer.guided.previous":"Previous guided view","viewer.guided.previous.title":"Previous guided view ([)","viewer.guided.next":"Next guided view","viewer.guided.next.title":"Next guided view (])","viewer.guided.views":"Guided views","viewer.guided.explore":"Explore this system","viewer.guided.intro":"Step through curated paths without changing the source diagram.","viewer.guided.trail":"Story trail","viewer.guided.beat":"Beat","viewer.guided.nextBeat":"Next","viewer.guided.play":"Play guided story","viewer.guided.play.title":"Play guided story (P)","viewer.guided.pause":"Pause guided story","viewer.guided.pause.title":"Pause guided story (P)","viewer.guided.replay":"Replay guided story","viewer.guided.replay.title":"Replay guided story (P)","viewer.guided.playStory":"Play story","viewer.guided.pauseStory":"Pause","viewer.guided.replayStory":"Replay story","viewer.guided.motionUnavailable":"Story playback unavailable while motion is Still","viewer.guided.enableMotion":"Switch motion to Live to play the guided story","viewer.guided.selectBeatLink":"Select a Story Beat to copy its exact link","viewer.guided.copyMoment":"Copy moment","viewer.guided.momentCopied":"Moment link copied","viewer.guided.momentCopyFailed":"Could not copy story moment link","viewer.guided.copied":"Copied","viewer.guided.copyFailed":"Copy failed","viewer.guided.showAll":"Show all","viewer.guided.showAll.aria":"Show entire diagram","viewer.guided.chapters":"Story chapters","viewer.guided.storyTrail":"Story trail for {label}: {count} beats","viewer.guided.chapter.open":"Open chapter {index} of {total}: {label}, {count} stops","viewer.guided.chapter.current":"Current chapter {index} of {total}: {label}, {count} stops","viewer.guided.chapter.selectedNodes":"{count} selected nodes","viewer.guided.chapter.stops":"{count} stops","viewer.guided.chapter.stop.one":"{count} stop","viewer.guided.chapter.stop.other":"{count} stops","viewer.guided.chapter.current.title":"{label} — current chapter, {count} stops","viewer.guided.chapter.delta.expanded":"{stay} stay, {enter} enter, {leave} leave","viewer.guided.chapter.delta.aria":"Open chapter {index} of {total}: {label}. Chapter focus delta: {delta}","viewer.guided.chapter.delta.title":"{label} — {delta} chapter focus","viewer.guided.handoff":"{from} → {to} · via {label}","viewer.guided.share.chapter":"Chapter {index} / {total}","viewer.guided.share.initial":"Chapter 01 / 01","viewer.guided.share.default":"Guided chapter","viewer.guided.state.ready":"Ready","viewer.guided.state.playing":"Playing","viewer.guided.state.settled":"Settled","viewer.guided.state.paused":"Paused","viewer.guided.state.pinned":"Pinned","viewer.guided.state.still":"Still","viewer.guided.share.step":"Step {index} / {total} · {label}","viewer.guided.share.staticMoment":"{step} · Static moment","viewer.guided.share.complete":"{count} steps complete · {note}","viewer.guided.share.settled":"Path settled for reading.","viewer.guided.share.staticPath":"{count} steps · Static path","viewer.guided.share.ready":"{count} steps · Ready","viewer.guided.share.aria":"{state} chapter {index} of {total}: {label}. {beat}. {route}","viewer.guided.beat.start":"Beat {index} / {total} · {label} · starting point","viewer.guided.beat.forward":"Beat {index} / {total} · {from} → {to}","viewer.guided.beat.reverse":"Beat {index} / {total} · {from} → {to} · reverse authored link","viewer.guided.beat.multiple":"Beat {index} / {total} · {from} ⇄ {to} · {count} authored links","viewer.guided.beat.group":"Beat {index} / {total} · {from} · {to} · grouped · no direct link","viewer.guided.beat.aria.prefix":"Story beat {index} of {total}: {label}. ","viewer.guided.beat.aria.start":"Starting point.","viewer.guided.beat.aria.forward":"From {from} through one authored forward relationship.","viewer.guided.beat.aria.reverse":"From {from}; the authored relationship points from {to} to {from}.","viewer.guided.beat.aria.multiple":"From {from} through {count} authored relationships; shown without arbitrary motion.","viewer.guided.beat.aria.group":"Grouped from {from} with no direct authored relationship.","viewer.guided.caption.start":"Starting point","viewer.guided.caption.grouped":"Grouped transition · no direct authored link","viewer.guided.caption.more":" +{count} more","viewer.guided.caption.reverse":"Reverse authored relationship","viewer.guided.caption.relationships":"{count} authored relationships","viewer.guided.caption.relationship":"Authored relationship","viewer.guided.caption.direction":"authored direction: {from} → {to}","viewer.guided.caption.starting":"Authored starting point","viewer.guided.beatLink":"Copy link to current story moment: Beat {index} of {total}: {label}","viewer.guided.noStory":"This diagram has no authored guided story.","viewer.guide.eyebrow":"Diagram guide","viewer.guide.close":"Close diagram guide","viewer.guide.inspecting":"Inspecting compiled semantics","viewer.guide.actions":"Diagram exploration actions","viewer.guide.find":"Find any node","viewer.guide.find.hint":"Search labels, responsibilities, kinds, and stable IDs.","viewer.guide.route":"Trace a route","viewer.guide.route.aria":"Trace a directed route","viewer.guide.route.hint":"Ask how two semantic nodes connect in authored direction.","viewer.guide.map":"See the whole system","viewer.guide.map.hint":"Open Semantic Radar with a live viewport and stable nodes.","viewer.guide.lens":"Compare semantic kinds","viewer.guide.lens.hint":"Count roles, reveal their traffic, and compare direct authored links.","viewer.guide.story":"Play the guided story","viewer.guide.story.hint":"Walk the authored chapters and real relationships.","viewer.guide.present":"Enter Presentation Stage","viewer.guide.present.hint":"Give the live diagram the viewport without changing export.","viewer.guide.shortcuts":"Additional keyboard shortcuts","viewer.guide.shortcut.export":"Export","viewer.guide.shortcut.theme":"Theme","viewer.guide.shortcut.style":"Style","viewer.guide.shortcut.reset":"Reset","viewer.guide.shortcut.zoomIn":"Zoom in","viewer.guide.shortcut.zoomOut":"Zoom out","viewer.guide.shortcut.close":"Close","viewer.guide.facts":"{nodes} · {relationships} · {views}","viewer.guide.fact.node.one":"{count} semantic node","viewer.guide.fact.node.other":"{count} semantic nodes","viewer.guide.fact.relationship.one":"{count} relationship","viewer.guide.fact.relationship.other":"{count} relationships","viewer.guide.fact.view.one":"{count} guided view","viewer.guide.fact.view.other":"{count} guided views","viewer.guide.story.available.one":"Walk {count} authored chapter and its real relationships.","viewer.guide.story.available.other":"Walk {count} authored chapters and their real relationships.","viewer.guide.story.unavailable":"No authored guided story in this diagram.","viewer.guide.open":"Open diagram guide","viewer.guide.noStory":"This diagram has no authored guided story.","viewer.finder.title":"Find a node","viewer.finder.close":"Close node finder","viewer.finder.placeholder":"Search labels or IDs","viewer.finder.search":"Search diagram nodes","viewer.finder.results":"Diagram nodes","viewer.finder.empty":"No matching nodes","viewer.finder.result.focus":"Focus {label}","viewer.finder.result.routeStart":"Choose {label} as route start","viewer.finder.result.routeTarget":"Choose {label} as route destination, {links}","viewer.finder.status.empty":"No matching nodes","viewer.finder.status.count.one":"{count} matching node","viewer.finder.status.count.other":"{count} matching nodes","viewer.finder.noun.nodes":"nodes","viewer.finder.link.one":"{count} link","viewer.finder.link.other":"{count} links","viewer.finder.result.focus.one":"Focus {label}, {count} related connection","viewer.finder.result.focus.other":"Focus {label}, {count} related connections","viewer.finder.status.filtered":"{visible} of {available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"Semantic passport","viewer.passport.metadata":"Node metadata","viewer.passport.evidence":"Verified source evidence","viewer.passport.verified":"Verified source","viewer.passport.reach":"Authored reach","viewer.passport.reach.trace":"Trace authored reachability","viewer.passport.upstream":"Upstream","viewer.passport.downstream":"Downstream","viewer.passport.upstream.trace":"Trace upstream authored reachability","viewer.passport.downstream.trace":"Trace downstream authored reachability","viewer.passport.close":"Close semantic passport","viewer.passport.copy":"Copy link","viewer.passport.copy.focus":"Copy link to focused node","viewer.passport.relations":"Relations","viewer.passport.relations.show":"Show connected relationships","viewer.passport.relations.hide":"Hide connected relationships","viewer.passport.relations.list":"Connected relationships","viewer.passport.copyRelation":"Copy relation","viewer.passport.copyNode":"Copy node","viewer.passport.copyPinned":"Copy link to pinned relationship","viewer.passport.copySource":"Copy link to source node","viewer.passport.copy.focused.success":"Focused node link copied","viewer.passport.copy.pinned.success":"Pinned relationship link copied","viewer.passport.copy.focused.failed":"Could not copy focused node link","viewer.passport.copy.pinned.failed":"Could not copy pinned relationship link","viewer.passport.relationship.none":"No connected relationships","viewer.passport.relationship.count.one":"{count} relation","viewer.passport.relationship.count.other":"{count} relations","viewer.passport.relationship.show.one":"Show {count} connected relationship","viewer.passport.relationship.show.other":"Show {count} connected relationships","viewer.passport.relationship.summary":"{out} outgoing · {in} incoming{loops}","viewer.passport.relationship.loops":" · {count} loop","viewer.passport.relationship.explorer":"Direct relationship explorer","viewer.passport.relationship.help":"Use arrow keys to explore relationships. Press Enter or Space to pin details; Escape clears.","viewer.passport.relationship.loopsBack":"loops back","viewer.passport.relationship.connectsTo":"connects to","viewer.passport.relationship.connectsFrom":"connects from","viewer.passport.relationship.pinned":"Pinned relationship · {from} → {to} · {label}","viewer.passport.relationship.inspect":"Inspect relationship {index} of {total}: {from} to {to}, {label}. Press Enter for details.","viewer.passport.relationship.group.out":"Outgoing","viewer.passport.relationship.group.in":"Incoming","viewer.passport.relationship.group.loop":"Self loops","viewer.passport.relationship.row":"{group}: {relationship}, {neighbor}","viewer.passport.relationship.direction.out":"OUT →","viewer.passport.relationship.direction.in":"← IN","viewer.passport.relationship.direction.loop":"LOOP","viewer.passport.sourceCount.one":"{count} verified source reference","viewer.passport.sourceCount.other":"{count} verified source references","viewer.passport.sourceMarker":"SRC","viewer.passport.beacon.one":"{count} verified source; focus this node to inspect","viewer.passport.beacon.other":"{count} verified sources; focus this node to inspect","viewer.passport.repository.open":"Open verified repository revision {revision}","viewer.passport.source.open":"Open verified source {path} at revision {revision}","viewer.passport.source.openLink":"Open ↗","viewer.passport.reach.upstream.one":"Trace {count} upstream authored node","viewer.passport.reach.upstream.other":"Trace {count} upstream authored nodes","viewer.passport.reach.downstream.one":"Trace {count} downstream authored node","viewer.passport.reach.downstream.other":"Trace {count} downstream authored nodes","viewer.passport.reach.noUpstream":"No upstream authored nodes","viewer.passport.reach.noDownstream":"No downstream authored nodes","viewer.passport.reach.status":"{direction} · {nodes} nodes · {links} links · max {hops} hops","viewer.route.eyebrow":"Route probe","viewer.route.start":"Choose a start node","viewer.route.start.find":"Find start","viewer.route.start.find.aria":"Find a route start","viewer.route.copy":"Copy link","viewer.route.copy.aria":"Copy link to traced route","viewer.route.clear":"Clear","viewer.route.clear.aria":"Clear route probe","viewer.route.traced":"Traced route","viewer.route.pickTwo":"Pick two semantic nodes on the diagram","viewer.route.pickOne":"Pick a semantic node on the diagram","viewer.route.controls":"Route journey controls","viewer.route.previous":"Previous route position","viewer.route.play":"Play route journey","viewer.route.pause":"Pause route journey","viewer.route.replay":"Replay route journey","viewer.route.next":"Next route position","viewer.route.journey":"Journey","viewer.route.pause.label":"Pause","viewer.route.replay.label":"Replay","viewer.route.overview":"Overview","viewer.route.overview.aria":"Show complete route overview","viewer.route.instructions":"Choose the source, then the destination. Direction matters.","viewer.route.destination":"Choose a destination from {label}","viewer.route.destination.find":"Find target","viewer.route.destination.find.aria":"Find a reachable route destination","viewer.route.differentDestination":"Choose a different destination","viewer.route.distinct":"A route needs two distinct semantic nodes.","viewer.route.unreachable":"No directed route to {label}","viewer.route.unreachable.detail":"{target} is not reachable from {source}. Pick a highlighted destination.","viewer.route.start.instructions":"Select the source. The next step will reveal only directed destinations.","viewer.route.copy.success":"Traced route link copied","viewer.route.copy.failed":"Could not copy traced route link","viewer.route.position":"Route position {index} of {total}: {label}","viewer.route.step":"Step {index} of {total} · {phase} · {label}","viewer.route.motionRequired":"Automatic journey requires Live motion","viewer.route.trigger.clear":"Clear traced route","viewer.route.overview.status":"{nodes} · {hops} · shortest authored route","viewer.route.overview.node.one":"{count} node","viewer.route.overview.node.other":"{count} nodes","viewer.route.overview.hop.one":"{count} directed hop","viewer.route.overview.hop.other":"{count} directed hops","viewer.route.phase.playing":"Playing","viewer.route.phase.complete":"Complete","viewer.route.phase.inspecting":"Inspecting","viewer.route.destination.count.one":"{count} directed destination available. Pick a highlighted node.","viewer.route.destination.count.other":"{count} directed destinations available. Pick a highlighted node.","viewer.route.noOutgoing":"No outgoing route starts here. Clear and choose another source.","viewer.route.result.title":"{source} to {target}","viewer.route.finder.source.title":"Choose route start","viewer.route.finder.source.placeholder":"Search route sources","viewer.route.finder.source.empty":"No matching route sources","viewer.route.finder.source.results":"Nodes that can start a route","viewer.route.finder.source.noun":"route sources","viewer.route.finder.source.badge":"start","viewer.route.finder.target.title":"Destination from {label}","viewer.route.finder.target.placeholder":"Search reachable destinations","viewer.route.finder.target.empty":"No matching reachable destinations","viewer.route.finder.target.results":"Reachable route destinations","viewer.route.finder.target.noun":"reachable destinations","viewer.route.hop.one":"{count} hop","viewer.route.hop.other":"{count} hops","viewer.lens.eyebrow":"Semantic lens","viewer.lens.title":"Compare system roles","viewer.lens.close":"Close semantic lens","viewer.lens.instruction":"Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.","viewer.lens.kinds":"Semantic kinds","viewer.lens.choose":"Choose a kind to inspect its nodes and touching relationships.","viewer.lens.copy":"Copy link to semantic lens","viewer.lens.clear":"Clear semantic lens","viewer.lens.open":"Open semantic lens","viewer.lens.openActive":"Open active semantic lens","viewer.lens.legend":"Semantic legend","viewer.lens.legend.inspect.one":"Inspect {label}, {count} node","viewer.lens.legend.inspect.other":"Inspect {label}, {count} nodes","viewer.lens.kind.count.one":"{label}, {count} node","viewer.lens.kind.count.other":"{label}, {count} nodes","viewer.lens.compare.one":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationship","viewer.lens.compare.other":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationships","viewer.lens.single":"{nodes} · {relationships} · connected peers remain visible","viewer.lens.node.one":"{count} {label} node","viewer.lens.node.other":"{count} {label} nodes","viewer.lens.relationship.one":"{count} touching relationship","viewer.lens.relationship.other":"{count} touching relationships","viewer.radar.title":"Semantic radar","viewer.radar.building":"Building overview","viewer.radar.openFull":"Open full semantic radar","viewer.radar.open":"Open radar","viewer.radar.close":"Close semantic radar","viewer.radar.surface":"Diagram overview. Click a node to focus it, or use arrow keys to pan.","viewer.radar.click":"Click node","viewer.radar.drag":"Drag to pan","viewer.radar.space":"Semantic radar needs more MAP space.","viewer.radar.nodes":"Semantic diagram radar nodes","viewer.radar.focus":"Focus {label} from Semantic Radar","viewer.radar.status":"{count} nodes · {viewport}","viewer.radar.fullMap":"{count} nodes · full map","viewer.radar.compacted":"Radar compacted to avoid covering the Semantic Passport or MAP controls.","viewer.radar.cancelWaiting":"Cancel semantic radar waiting for more MAP space","viewer.radar.needsSpace":"Semantic radar needs more visible MAP space","viewer.radar.viewport.full":"full map","viewer.radar.viewport.width":"{percent}% width","viewer.radar.viewport.scale":"{percent}% viewport","viewer.nav.controls":"Diagram view controls","viewer.nav.route":"Trace a directed route","viewer.nav.route.title":"Trace route (R)","viewer.nav.route.short":"PATH","viewer.nav.radar":"Open semantic radar","viewer.nav.radar.title":"Semantic radar (M)","viewer.nav.radar.short":"MAP","viewer.nav.lens":"Open semantic lens","viewer.nav.lens.title":"Semantic lens (L)","viewer.nav.lens.short":"LENS","viewer.nav.find":"Find a node","viewer.nav.find.title":"Find a node (/)","viewer.nav.guide":"Open diagram guide","viewer.nav.guide.title":"Diagram guide (?)","viewer.nav.zoomOut":"Zoom out","viewer.nav.zoomOut.title":"Zoom out (-)","viewer.nav.reset":"Reset diagram view","viewer.nav.reset.title":"Reset view (0)","viewer.nav.read":"READ","viewer.nav.zoomIn":"Zoom in","viewer.nav.zoomIn.title":"Zoom in (+)","viewer.nav.camera":"{hint}. Reset diagram view","viewer.nav.camera.title":"{semantic}{hint} · reset view (0)","viewer.nav.camera.semantic":"Semantic camera active · ","viewer.nav.level.map":"MAP","viewer.nav.level.read":"READ","viewer.nav.level.full":"FULL","viewer.nav.level.auto":"AUTO","viewer.nav.detail.map":"Zoom in to reveal relationship labels and node context","viewer.nav.detail.read":"Zoom in again to reveal tags and annotations","viewer.nav.detail.full":"Full diagram detail","viewer.intent.summary":"{label}. {out} outgoing, {in} incoming{loops}. {total} connections. Press Enter for details.","viewer.intent.loops":", {count} self loop","viewer.common.copied":"Copied","viewer.common.copyFailed":"Copy failed","viewer.common.copyLink":"Copy link","viewer.common.clear":"Clear","viewer.common.close":"Close"}}</script>
- <div class="guided-views no-print" id="guided-views" hidden aria-label="Guided diagram views">
- <button id="guided-view-prev" type="button" aria-label="Previous guided view" title="Previous guided view ([)">&#8592;</button>
- <div class="guided-view-copy">
- <div class="guided-view-meta">
- <span>Guided views</span>
- <span id="guided-view-count"></span>
- <span class="guided-view-progress" aria-hidden="true"><span id="guided-view-progress-bar"></span></span>
- <span class="guided-view-handoff" id="guided-view-handoff" hidden aria-hidden="true"></span>
- </div>
- <strong id="guided-view-label">Explore this system</strong>
- <small id="guided-view-note" aria-live="polite" aria-atomic="true">Step through curated paths without changing the source diagram.</small>
- <div class="guided-view-trail" id="guided-view-trail" hidden role="group" aria-label="Story trail"></div>
- <div class="guided-story-caption" id="guided-story-caption" hidden aria-live="polite" aria-atomic="true">
- <span class="guided-story-caption-index" id="guided-story-caption-index">Beat</span>
- <strong id="guided-story-caption-route"></strong>
- <small id="guided-story-caption-detail"></small>
- <span class="guided-story-caption-next" id="guided-story-caption-next" hidden aria-hidden="true">
- <small>Next</small>
- <strong id="guided-story-caption-next-label"></strong>
- </span>
- </div>
- </div>
- <button id="guided-view-next" type="button" aria-label="Next guided view" title="Next guided view (])">&#8594;</button>
- <div class="guided-view-actions">
- <button class="guided-view-play" id="guided-view-play" type="button" aria-label="Play guided story" aria-pressed="false" title="Play guided story (P)">
- <span id="guided-view-play-icon" aria-hidden="true">&#9654;</span>
- <span id="guided-view-play-label">Play story</span>
- </button>
- <button class="guided-view-beat-link" id="guided-view-beat-link" type="button" aria-label="Select a Story Beat to copy its exact link" title="Select a Story Beat to copy its exact link" disabled>
- <span aria-hidden="true">&#35;</span>
- <span id="guided-view-beat-link-label">Copy moment</span>
- </button>
- <button class="guided-view-all" id="guided-view-all" type="button" aria-label="Show entire diagram">Show all</button>
- </div>
- <nav class="guided-view-index" id="guided-view-index" aria-label="Story chapters">
- <ol class="guided-view-chapters" id="guided-view-chapters"></ol>
- </nav>
- </div>
+ <script id="archify-i18n-data" type="application/json">{"locale":"en","messages":{"viewer.kind.frontend":"Frontend","viewer.kind.backend":"Backend","viewer.kind.database":"Database","viewer.kind.cloud":"Cloud","viewer.kind.security":"Security","viewer.kind.messagebus":"Message bus","viewer.kind.external":"External","viewer.kind.neutral":"Neutral","viewer.kind.node":"Node","viewer.kind.start":"Start","viewer.kind.active":"Active","viewer.kind.waiting":"Waiting","viewer.kind.decision":"Decision","viewer.kind.success":"Success","viewer.kind.failure":"Failure","viewer.toolbar.actions":"Diagram actions","viewer.theme.toggle.title":"Toggle theme (T)","viewer.theme.toggle":"Toggle color theme","viewer.theme.dark":"Dark","viewer.theme.light":"Light","viewer.preset.choose.title":"Choose visual style (S cycles)","viewer.preset.choose":"Choose visual style","viewer.preset.style":"Style","viewer.preset.menu":"Visual style","viewer.preset.identity":"Visual identity","viewer.preset.cycles":"to cycle","viewer.preset.classic":"Classic","viewer.preset.classic.short":"Classic","viewer.preset.classic.hint":"Stable technical default","viewer.preset.flow":"Signal Flow","viewer.preset.flow.short":"Flow","viewer.preset.flow.hint":"Motion-forward presentation","viewer.preset.blueprint":"Blueprint","viewer.preset.blueprint.hint":"Engineering review","viewer.preset.editorial":"Editorial","viewer.preset.editorial.hint":"Publication and launch notes","viewer.preset.badge.signalFlow":"SIGNAL FLOW","viewer.preset.badge.blueprint":"BLUEPRINT / REV 01","viewer.preset.badge.editorial":"EDITORIAL / FIELD NOTE","viewer.preset.badge.editorialPlate":"ARCHIFY / PLATE 04","viewer.preset.current":"Visual style: {style}. Choose visual style","viewer.motion.live":"Live","viewer.motion.still":"Still","viewer.motion.pause":"Pause motion","viewer.motion.resume":"Resume motion","viewer.motion.reduced":"Motion paused by reduced-motion preference","viewer.motion.hidden":"Motion paused while this page is hidden","viewer.motion.yielding":"Pause motion; currently yielding to {owner}","viewer.motion.yielding.title":"Live preview enabled · yielding to {owner}","viewer.owner.route":"Route Probe","viewer.owner.lens":"Semantic Lens","viewer.owner.relationship":"Relationship Preview","viewer.owner.intent":"Intent Trace","viewer.owner.focus":"semantic focus","viewer.owner.legend":"legend preview","viewer.owner.reader":"reader interaction","viewer.present.enter":"Enter presentation stage","viewer.present.enter.title":"Presentation stage (F)","viewer.present.exit":"Exit presentation stage","viewer.present.exit.title":"Exit presentation stage (F or Escape)","viewer.present.present":"Present","viewer.present.exit.label":"Exit","viewer.export.button":"Export","viewer.export.button.title":"Export diagram (E)","viewer.export.diagram":"Export diagram","viewer.export.menu":"Export","viewer.export.subtitle":"Portable, clean outputs","viewer.export.share":"Share","viewer.export.shareCard":"Share Card","viewer.export.routeShareCard":"Route Share Card","viewer.export.reachShareCard":"Reach Share Card","viewer.export.copyDiagram":"Copy diagram","viewer.export.clipboardPng":"PNG to clipboard","viewer.export.raster":"Raster images","viewer.export.image":"Image","viewer.export.lossless":"Lossless image","viewer.export.compact":"Compact image","viewer.export.modern":"Modern image","viewer.export.vectorMotion":"Vector and motion","viewer.export.vectorMotion.heading":"Vector \u0026 motion","viewer.export.editable":"Editable vector","viewer.export.svg.auto":"SVG · Auto","viewer.export.svg.auto.hint":"Matches host theme","viewer.export.svg.light":"SVG · Light","viewer.export.svg.light.hint":"Always light","viewer.export.svg.dark":"SVG · Dark","viewer.export.svg.dark.hint":"Always dark","viewer.export.motion6s":"6s motion","viewer.export.unsupported":"Not supported by this browser","viewer.export.clipboardUnsupported":"Clipboard image write not supported by this browser","viewer.export.clipboardUnsupported.short":"Clipboard image write not supported in this browser.","viewer.export.motionUnavailable":"Motion capture unavailable in this browser","viewer.export.webmUnavailable":"WebM unavailable in this browser","viewer.export.failed":"Export failed: {message}","viewer.export.unknownVariant":"Unknown Share Card variant: {variant}","viewer.export.routeRequired":"Trace a route before exporting a Route Share Card","viewer.export.reachRequired":"Trace authored reach before exporting a Reach Share Card","viewer.export.unknown":"unknown","viewer.export.routeFailed":"Route Share Card export failed: {message}","viewer.export.reachFailed":"Reach Share Card export failed: {message}","viewer.export.copyFailed":"Copy failed: {message}","viewer.export.copiedPng":"Copied PNG to clipboard","viewer.export.downloadedRoute":"Downloaded Route Share Card","viewer.export.downloadedReach":"Downloaded Reach Share Card","viewer.export.downloadedWebm":"Downloaded WebM","viewer.export.recording":"Recording 6 seconds of motion…","viewer.export.card.routeSummary.one":"Path: {source} → {target} · {count} step","viewer.export.card.routeSummary.other":"Path: {source} → {target} · {count} steps","viewer.export.card.reachSummary":"Authored {direction} from {origin} · {nodes} · {links} · max {hops}","viewer.export.card.node.one":"{count} node","viewer.export.card.node.other":"{count} nodes","viewer.export.card.link.one":"{count} link","viewer.export.card.link.other":"{count} links","viewer.export.card.hop.one":"{count} hop","viewer.export.card.hop.other":"{count} hops","viewer.export.card.routeBadge":"ARCHIFY · ROUTE · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction} REACH","viewer.export.direction.upstream":"Upstream","viewer.export.direction.downstream":"Downstream","viewer.export.error.canvasUnavailable":"Canvas unavailable for {label}","viewer.export.error.contextUnavailable":"2D canvas context unavailable for {label}","viewer.export.error.toBlobUnavailable":"canvas.toBlob unavailable for {label}","viewer.export.error.toBlobNull":"canvas.toBlob returned no data for {label}","viewer.export.error.variantsCombined":"Share Card variants cannot be combined","viewer.export.error.viewerState":"Share Card export could not remove temporary viewer state","viewer.export.error.routeState":"Route Card export could not preserve the resolved route safely","viewer.export.error.reachState":"Reach Card export could not preserve authored reach safely","viewer.export.error.webmRequirements":"WebM motion export requires a trace animation and browser MediaRecorder support","viewer.export.error.mediaRecorder":"MediaRecorder failed","viewer.export.error.emptyWebm":"MediaRecorder produced an empty WebM","viewer.export.error.webmBackground":"SVG background could not be loaded for WebM export","viewer.guide.title":"Explore this system","viewer.focus.selectedNodes":"{count} selected nodes","viewer.guide.eyebrow":"Diagram guide","viewer.guide.close":"Close diagram guide","viewer.guide.inspecting":"Inspecting compiled semantics","viewer.guide.actions":"Diagram exploration actions","viewer.guide.find":"Find any node","viewer.guide.find.hint":"Search labels, responsibilities, kinds, and stable IDs.","viewer.guide.route":"Trace a route","viewer.guide.route.aria":"Trace a directed route","viewer.guide.route.hint":"Ask how two semantic nodes connect in authored direction.","viewer.guide.map":"See the whole system","viewer.guide.map.hint":"Open Semantic Radar with a live viewport and stable nodes.","viewer.guide.lens":"Compare semantic kinds","viewer.guide.lens.hint":"Count roles, reveal their traffic, and compare direct authored links.","viewer.guide.present":"Enter Presentation Stage","viewer.guide.present.hint":"Give the live diagram the viewport without changing export.","viewer.guide.shortcuts":"Additional keyboard shortcuts","viewer.guide.shortcut.export":"Export","viewer.guide.shortcut.theme":"Theme","viewer.guide.shortcut.style":"Style","viewer.guide.shortcut.reset":"Reset","viewer.guide.shortcut.zoomIn":"Zoom in","viewer.guide.shortcut.zoomOut":"Zoom out","viewer.guide.shortcut.close":"Close","viewer.guide.facts":"{nodes} · {relationships}","viewer.guide.fact.node.one":"{count} semantic node","viewer.guide.fact.node.other":"{count} semantic nodes","viewer.guide.fact.relationship.one":"{count} relationship","viewer.guide.fact.relationship.other":"{count} relationships","viewer.guide.open":"Open diagram guide","viewer.finder.title":"Find a node","viewer.finder.close":"Close node finder","viewer.finder.placeholder":"Search labels or IDs","viewer.finder.search":"Search diagram nodes","viewer.finder.results":"Diagram nodes","viewer.finder.empty":"No matching nodes","viewer.finder.result.focus":"Focus {label}","viewer.finder.result.routeStart":"Choose {label} as route start","viewer.finder.result.routeTarget":"Choose {label} as route destination, {links}","viewer.finder.status.empty":"No matching nodes","viewer.finder.status.count.one":"{count} matching node","viewer.finder.status.count.other":"{count} matching nodes","viewer.finder.noun.nodes":"nodes","viewer.finder.link.one":"{count} link","viewer.finder.link.other":"{count} links","viewer.finder.result.focus.one":"Focus {label}, {count} related connection","viewer.finder.result.focus.other":"Focus {label}, {count} related connections","viewer.finder.status.filtered":"{visible} of {available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"Semantic passport","viewer.passport.metadata":"Node metadata","viewer.passport.evidence":"Verified source evidence","viewer.passport.verified":"Verified source","viewer.passport.verificationScope":"Verified against local Git at the pinned revision. Remote access has not been checked.","viewer.passport.reach":"Authored reach","viewer.passport.reach.trace":"Trace authored reachability","viewer.passport.upstream":"Upstream","viewer.passport.downstream":"Downstream","viewer.passport.upstream.trace":"Trace upstream authored reachability","viewer.passport.downstream.trace":"Trace downstream authored reachability","viewer.passport.close":"Close semantic passport","viewer.passport.move":"Move semantic passport. Drag, use arrow keys, or press Home to reset.","viewer.passport.copy":"Copy link","viewer.passport.copy.focus":"Copy link to focused node","viewer.passport.relations":"Relations","viewer.passport.relations.show":"Show connected relationships","viewer.passport.relations.hide":"Hide connected relationships","viewer.passport.relations.list":"Connected relationships","viewer.passport.copyRelation":"Copy relation","viewer.passport.copyNode":"Copy node","viewer.passport.copyPinned":"Copy link to pinned relationship","viewer.passport.copySource":"Copy link to source node","viewer.passport.copy.focused.success":"Focused node link copied","viewer.passport.copy.pinned.success":"Pinned relationship link copied","viewer.passport.copy.focused.failed":"Could not copy focused node link","viewer.passport.copy.pinned.failed":"Could not copy pinned relationship link","viewer.passport.relationship.none":"No connected relationships","viewer.passport.relationship.count.one":"{count} relation","viewer.passport.relationship.count.other":"{count} relations","viewer.passport.relationship.show.one":"Show {count} connected relationship","viewer.passport.relationship.show.other":"Show {count} connected relationships","viewer.passport.relationship.summary":"{out} outgoing · {in} incoming{loops}","viewer.passport.relationship.loops":" · {count} loop","viewer.passport.relationship.explorer":"Direct relationship explorer","viewer.passport.relationship.help":"Use arrow keys to explore relationships. Press Enter or Space to pin details; Escape clears.","viewer.passport.relationship.loopsBack":"loops back","viewer.passport.relationship.connectsTo":"connects to","viewer.passport.relationship.connectsFrom":"connects from","viewer.passport.relationship.pinned":"Pinned relationship · {from} → {to} · {label}","viewer.passport.relationship.inspect":"Inspect relationship {index} of {total}: {from} to {to}, {label}. Press Enter for details.","viewer.passport.relationship.group.out":"Outgoing","viewer.passport.relationship.group.in":"Incoming","viewer.passport.relationship.group.loop":"Self loops","viewer.passport.relationship.row":"{group}: {relationship}, {neighbor}","viewer.passport.relationship.direction.out":"OUT →","viewer.passport.relationship.direction.in":"← IN","viewer.passport.relationship.direction.loop":"LOOP","viewer.passport.sourceCount.one":"{count} verified source reference","viewer.passport.sourceCount.other":"{count} verified source references","viewer.passport.sourceMarker":"SRC","viewer.passport.beacon.one":"{count} verified source; focus this node to inspect","viewer.passport.beacon.other":"{count} verified sources; focus this node to inspect","viewer.passport.repository.open":"Open verified repository revision {revision}","viewer.passport.source.open":"Open verified source {path} at revision {revision}","viewer.passport.source.openLink":"Open ↗","viewer.passport.reach.upstream.one":"Trace {count} upstream authored node","viewer.passport.reach.upstream.other":"Trace {count} upstream authored nodes","viewer.passport.reach.downstream.one":"Trace {count} downstream authored node","viewer.passport.reach.downstream.other":"Trace {count} downstream authored nodes","viewer.passport.reach.noUpstream":"No upstream authored nodes","viewer.passport.reach.noDownstream":"No downstream authored nodes","viewer.passport.reach.status":"{direction} · {nodes} nodes · {links} links · max {hops} hops","viewer.route.eyebrow":"Path","viewer.route.start":"Click where the path starts","viewer.route.start.find":"Find start","viewer.route.start.find.aria":"Find a route start","viewer.route.copy":"Copy link","viewer.route.copy.aria":"Copy link to traced route","viewer.route.clear":"Clear","viewer.route.clear.aria":"Clear route probe","viewer.route.traced":"Path","viewer.route.pickTwo":"Click two nodes on the diagram","viewer.route.pickOne":"Click a node on the diagram","viewer.route.controls":"Route journey controls","viewer.route.previous":"Previous route position","viewer.route.play":"Play route journey","viewer.route.pause":"Pause route journey","viewer.route.replay":"Replay route journey","viewer.route.next":"Next route position","viewer.route.journey":"Journey","viewer.route.pause.label":"Pause","viewer.route.replay.label":"Replay","viewer.route.overview":"Overview","viewer.route.overview.aria":"Show complete route overview","viewer.route.instructions":"Click a start, then an end. Paths follow the arrows.","viewer.route.destination":"Where does the path from {label} end?","viewer.route.destination.find":"Find target","viewer.route.destination.find.aria":"Find a reachable route destination","viewer.route.differentDestination":"Choose a different destination","viewer.route.distinct":"Pick two different nodes.","viewer.route.unreachable":"Cannot reach {label} from here","viewer.route.unreachable.detail":"{target} cannot be reached from {source} along the arrows. Pick a highlighted node.","viewer.route.start.instructions":"Next, pick the end. Only nodes you can reach will light up.","viewer.route.copy.success":"Traced route link copied","viewer.route.copy.failed":"Could not copy traced route link","viewer.route.position":"Route position {index} of {total}: {label}","viewer.route.step":"Step {index} of {total} · {phase} · {label}","viewer.route.motionRequired":"Automatic journey requires Live motion","viewer.route.trigger.clear":"Clear traced route","viewer.route.overview.status":"{nodes} · {hops} · shortest path","viewer.route.overview.node.one":"{count} node","viewer.route.overview.node.other":"{count} nodes","viewer.route.overview.hop.one":"{count} step","viewer.route.overview.hop.other":"{count} steps","viewer.route.phase.playing":"Playing","viewer.route.phase.complete":"Complete","viewer.route.phase.inspecting":"Inspecting","viewer.route.destination.count.one":"{count} reachable node is highlighted. Click it.","viewer.route.destination.count.other":"{count} reachable nodes are highlighted. Click one.","viewer.route.noOutgoing":"No arrows lead out of this node. Clear it and pick another start.","viewer.route.result.title":"{source} to {target}","viewer.route.finder.source.title":"Choose route start","viewer.route.finder.source.placeholder":"Search route sources","viewer.route.finder.source.empty":"No matching route sources","viewer.route.finder.source.results":"Nodes that can start a route","viewer.route.finder.source.noun":"route sources","viewer.route.finder.source.badge":"start","viewer.route.finder.target.title":"Destination from {label}","viewer.route.finder.target.placeholder":"Search reachable destinations","viewer.route.finder.target.empty":"No matching reachable destinations","viewer.route.finder.target.results":"Reachable route destinations","viewer.route.finder.target.noun":"reachable destinations","viewer.route.hop.one":"{count} hop","viewer.route.hop.other":"{count} hops","viewer.lens.eyebrow":"Semantic lens","viewer.lens.title":"Compare system roles","viewer.lens.close":"Close semantic lens","viewer.lens.instruction":"Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.","viewer.lens.kinds":"Semantic kinds","viewer.lens.choose":"Choose a kind to inspect its nodes and touching relationships.","viewer.lens.copy":"Copy link to semantic lens","viewer.lens.clear":"Clear semantic lens","viewer.lens.open":"Open semantic lens","viewer.lens.openActive":"Open active semantic lens","viewer.lens.legend":"Semantic legend","viewer.lens.legend.inspect.one":"Inspect {label}, {count} node","viewer.lens.legend.inspect.other":"Inspect {label}, {count} nodes","viewer.lens.kind.count.one":"{label}, {count} node","viewer.lens.kind.count.other":"{label}, {count} nodes","viewer.lens.compare.one":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationship","viewer.lens.compare.other":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationships","viewer.lens.single":"{nodes} · {relationships} · connected peers remain visible","viewer.lens.node.one":"{count} {label} node","viewer.lens.node.other":"{count} {label} nodes","viewer.lens.relationship.one":"{count} touching relationship","viewer.lens.relationship.other":"{count} touching relationships","viewer.radar.title":"Semantic radar","viewer.radar.building":"Building overview","viewer.radar.openFull":"Open full semantic radar","viewer.radar.open":"Open radar","viewer.radar.close":"Close semantic radar","viewer.radar.surface":"Diagram overview. Click a node to focus it, or use arrow keys to pan.","viewer.radar.click":"Click node","viewer.radar.drag":"Drag to pan","viewer.radar.space":"Semantic radar needs more MAP space.","viewer.radar.nodes":"Semantic diagram radar nodes","viewer.radar.focus":"Focus {label} from Semantic Radar","viewer.radar.status":"{count} nodes · {viewport}","viewer.radar.fullMap":"{count} nodes · full map","viewer.radar.compacted":"Radar compacted to avoid covering the Semantic Passport or MAP controls.","viewer.radar.cancelWaiting":"Cancel semantic radar waiting for more MAP space","viewer.radar.needsSpace":"Semantic radar needs more visible MAP space","viewer.radar.viewport.full":"full map","viewer.radar.viewport.width":"{percent}% width","viewer.radar.viewport.scale":"{percent}% viewport","viewer.nav.controls":"Diagram view controls","viewer.nav.route":"Trace a directed route","viewer.nav.route.title":"Trace route (R)","viewer.nav.route.short":"PATH","viewer.nav.radar":"Open semantic radar","viewer.nav.radar.title":"Semantic radar (M)","viewer.nav.radar.short":"MAP","viewer.nav.lens":"Open semantic lens","viewer.nav.lens.title":"Semantic lens (L)","viewer.nav.lens.short":"LENS","viewer.nav.find":"Find a node","viewer.nav.find.title":"Find a node (/)","viewer.outline.title":"Node index","viewer.rail.show":"Notes \u0026 index","viewer.rail.controls":"Side panel","viewer.rail.collapse":"Collapse side panel","viewer.rail.bottom":"Move panel below the diagram","viewer.rail.right":"Move panel beside the diagram","viewer.nav.guide":"Open diagram guide","viewer.nav.guide.title":"Diagram guide (?)","viewer.nav.zoomOut":"Zoom out","viewer.nav.zoomOut.title":"Zoom out (-)","viewer.nav.reset":"Reset diagram view","viewer.nav.reset.title":"Reset view (0)","viewer.nav.read":"READ","viewer.nav.zoomIn":"Zoom in","viewer.nav.zoomIn.title":"Zoom in (+)","viewer.nav.camera":"{hint}. Reset diagram view","viewer.nav.camera.title":"{semantic}{hint} · reset view (0)","viewer.nav.camera.semantic":"Semantic camera active · ","viewer.nav.level.map":"MAP","viewer.nav.level.read":"READ","viewer.nav.level.full":"FULL","viewer.nav.level.auto":"AUTO","viewer.nav.detail.map":"Zoom in to reveal relationship labels and node context","viewer.nav.detail.read":"Zoom in again to reveal tags and annotations","viewer.nav.detail.full":"Full diagram detail","viewer.intent.summary":"{label}. {out} outgoing, {in} incoming{loops}. {total} connections. Press Enter for details.","viewer.intent.loops":", {count} self loop","viewer.common.copied":"Copied","viewer.common.copyFailed":"Copy failed","viewer.common.copyLink":"Copy link","viewer.common.clear":"Clear","viewer.common.close":"Close"}}</script>
<!-- Main Diagram -->
<div class="diagram-container" data-detail-level="read"
data-preset-badge-editorial-plate="ARCHIFY / PLATE 04">
- <svg viewBox="0 0 1064 356" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="standard" data-quality-gates="advisory">
+ <svg viewBox="0 0 1064 356" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="standard" data-quality-gates="advisory" data-reader-fit="intrinsic-height" data-reader-min-text="7.5" data-reader-primary-text="14">
<title id="archify-diagram-title">Archify Pipeline</title>
<desc id="archify-diagram-description">Grid placement demo — row/col instead of manual pos</desc>
<!-- Definitions -->
@@ -5160,14 +5012,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="archify/ skill package" x="298" y="70" width="612" height="218" rx="12" class="c-region" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
- <path data-edge-from="user" data-edge-to="agents" data-edge-key="0" data-composition-points="160,238;184,238" d="M 160 238 L 184 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="agents" data-edge-to="skill" data-edge-key="1" data-composition-points="244,208;244,160" d="M 244 208 L 244 160" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>
- <path data-edge-from="agents" data-edge-to="ir" data-edge-key="2" data-composition-points="304,238;328,238" d="M 304 238 L 328 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="ir" data-edge-to="schemas" data-edge-key="3" data-composition-points="388,208;388,160" d="M 388 208 L 388 160" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
- <path data-edge-from="ir" data-edge-to="renderers" data-edge-key="4" data-composition-points="448,238;472,238" d="M 448 238 L 472 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="renderers" data-edge-to="template" data-edge-key="5" data-composition-points="592,238;616,238" d="M 592 238 L 616 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="template" data-edge-to="checker" data-edge-key="6" data-composition-points="736,238;760,238" d="M 736 238 L 760 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="checker" data-edge-to="html" data-edge-key="7" data-composition-points="880,238;904,238" d="M 880 238 L 904 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <g data-graph-role="automatic-crossover" style="--step:0">
+ <path data-graph-role="automatic-crossover-underlay" d="M 160 238 L 184 238" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="user" data-edge-to="agents" data-edge-key="0" data-composition-points="160,238;184,238" data-composition-crossover="halo" data-composition-independent="true" d="M 160 238 L 184 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:1">
+ <path data-graph-role="automatic-crossover-underlay" d="M 244 208 L 244 160" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agents" data-edge-to="skill" data-edge-key="1" data-composition-points="244,208;244,160" data-composition-crossover="halo" data-composition-independent="true" d="M 244 208 L 244 160" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:2">
+ <path data-graph-role="automatic-crossover-underlay" d="M 304 238 L 328 238" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agents" data-edge-to="ir" data-edge-key="2" data-composition-points="304,238;328,238" data-composition-crossover="halo" data-composition-independent="true" d="M 304 238 L 328 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:3">
+ <path data-graph-role="automatic-crossover-underlay" d="M 388 208 L 388 160" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="ir" data-edge-to="schemas" data-edge-key="3" data-composition-points="388,208;388,160" data-composition-crossover="halo" data-composition-independent="true" d="M 388 208 L 388 160" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:4">
+ <path data-graph-role="automatic-crossover-underlay" d="M 448 238 L 472 238" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="ir" data-edge-to="renderers" data-edge-key="4" data-composition-points="448,238;472,238" data-composition-crossover="halo" data-composition-independent="true" d="M 448 238 L 472 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:5">
+ <path data-graph-role="automatic-crossover-underlay" d="M 592 238 L 616 238" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="renderers" data-edge-to="template" data-edge-key="5" data-composition-points="592,238;616,238" data-composition-crossover="halo" data-composition-independent="true" d="M 592 238 L 616 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:6">
+ <path data-graph-role="automatic-crossover-underlay" d="M 736 238 L 760 238" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="template" data-edge-to="checker" data-edge-key="6" data-composition-points="736,238;760,238" data-composition-crossover="halo" data-composition-independent="true" d="M 736 238 L 760 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:7">
+ <path data-graph-role="automatic-crossover-underlay" d="M 880 238 L 904 238" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="checker" data-edge-to="html" data-edge-key="7" data-composition-points="880,238;904,238" data-composition-crossover="halo" data-composition-independent="true" d="M 880 238 L 904 238" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
<!-- Components -->
<g id="node-user" data-node-id="user" data-node-label="You" tabindex="0" role="button" aria-label="Focus You, NL / Mermaid, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="NL / Mermaid" data-node-context="Architecture component">
@@ -5327,18 +5203,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</g>
</svg>
<p class="intent-trace-status no-print" id="intent-trace-status" role="status" aria-live="polite" aria-atomic="true"></p>
- <div class="share-chapter-cue no-print" id="share-chapter-cue" hidden role="status" aria-live="polite">
- <div class="share-chapter-index">
- <span class="share-chapter-state" id="share-chapter-state">Ready</span>
- <span class="share-chapter-count" id="share-chapter-count">Chapter 01 / 01</span>
- </div>
- <div class="share-chapter-copy">
- <strong id="share-chapter-label">Guided chapter</strong>
- <small id="share-chapter-note"></small>
- </div>
- <span class="share-chapter-route" id="share-chapter-route"></span>
- <span class="share-chapter-progress" aria-hidden="true"><span id="share-chapter-progress-bar"></span></span>
- </div>
<div class="diagram-guide no-print" id="diagram-guide" hidden role="dialog" aria-modal="false" aria-labelledby="diagram-guide-title">
<div class="diagram-guide-head">
<span>
@@ -5369,13 +5233,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span class="diagram-guide-action-copy"><strong>Compare semantic kinds</strong><small>Count roles, reveal their traffic, and compare direct authored links.</small></span>
<kbd aria-hidden="true">L</kbd>
</button>
- <button class="diagram-guide-action" type="button" data-guide-action="story" aria-label="Play the guided story">
- <span class="diagram-guide-index" aria-hidden="true">05</span>
- <span class="diagram-guide-action-copy"><strong>Play the guided story</strong><small id="diagram-guide-story-copy">Walk the authored chapters and real relationships.</small></span>
- <kbd aria-hidden="true">P</kbd>
- </button>
<button class="diagram-guide-action" type="button" data-guide-action="present" aria-label="Enter presentation stage">
- <span class="diagram-guide-index" aria-hidden="true">06</span>
+ <span class="diagram-guide-index" aria-hidden="true">05</span>
<span class="diagram-guide-action-copy"><strong>Enter Presentation Stage</strong><small>Give the live diagram the viewport without changing export.</small></span>
<kbd aria-hidden="true">F</kbd>
</button>
@@ -5401,6 +5260,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="focus-chip relationship-lens no-print" id="focus-chip" hidden role="region" aria-labelledby="relationship-lens-title">
<div class="relationship-lens-head">
+ <button class="relationship-lens-drag-handle" id="btn-focus-move" type="button" data-focus-drag-handle aria-label="Move semantic passport. Drag, use arrow keys, or press Home to reset." title="Move semantic passport. Drag, use arrow keys, or press Home to reset."></button>
<div class="relationship-lens-copy">
<span class="relationship-lens-eyebrow">Semantic passport</span>
<strong class="relationship-lens-title" id="relationship-lens-title"><span id="focus-label"></span></strong>
@@ -5444,8 +5304,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<div class="route-probe no-print" id="route-probe" hidden role="region" aria-labelledby="route-probe-title" data-state="idle">
<div class="route-probe-head">
<span class="route-probe-copy">
- <span class="route-probe-eyebrow">Route probe</span>
- <strong class="route-probe-title" id="route-probe-title">Choose a start node</strong>
+ <span class="route-probe-eyebrow">Path</span>
+ <strong class="route-probe-title" id="route-probe-title">Click where the path starts</strong>
</span>
<span class="route-probe-actions">
<button class="route-probe-find" id="route-probe-find" type="button" aria-label="Find a route start" data-node-finder-trigger>Find start</button>
@@ -5453,8 +5313,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<button id="route-probe-clear" type="button" aria-label="Clear route probe">Clear</button>
</span>
</div>
- <div class="route-probe-path" id="route-probe-path" aria-label="Traced route">
- <span class="route-probe-placeholder">Pick two semantic nodes on the diagram</span>
+ <div class="route-probe-path" id="route-probe-path" aria-label="Path">
+ <span class="route-probe-placeholder">Click two nodes on the diagram</span>
</div>
<div class="route-journey-controls" id="route-journey-controls" hidden role="group" aria-label="Route journey controls" data-playing="false">
<button id="route-journey-prev" type="button" aria-label="Previous route position" title="Previous route position">&#8592;</button>
@@ -5465,7 +5325,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<button id="route-journey-next" type="button" aria-label="Next route position" title="Next route position">&#8594;</button>
<button class="route-journey-overview" id="route-journey-overview" type="button" aria-label="Show complete route overview" title="Show complete route overview">Overview</button>
</div>
- <small class="route-probe-status" id="route-probe-status" aria-live="polite">Choose the source, then the destination. Direction matters.</small>
+ <small class="route-probe-status" id="route-probe-status" aria-live="polite">Click a start, then an end. Paths follow the arrows.</small>
</div>
<div class="semantic-lens no-print" id="semantic-lens" hidden role="dialog" aria-modal="false" aria-labelledby="semantic-lens-title">
<div class="semantic-lens-head">
@@ -5497,18 +5357,24 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<div class="overview-map-hint" aria-hidden="true"><span>Click node</span><span>Drag to pan</span></div>
</div>
<p class="overview-map-feedback no-print" id="overview-map-feedback" role="status" aria-live="polite" hidden>Semantic radar needs more MAP space.</p>
+ <button class="rail-reveal no-print" id="rail-reveal" type="button" hidden aria-controls="reader-rail" aria-expanded="false"><span class="rail-reveal-icon" aria-hidden="true"></span><span>Notes &amp; index</span></button>
<div class="diagram-nav no-print" role="toolbar" aria-label="Diagram view controls">
<button id="btn-route-probe" type="button" aria-label="Trace a directed route" aria-pressed="false" aria-controls="route-probe" title="Trace route (R)">PATH</button>
<button id="btn-overview-map" type="button" aria-label="Open semantic radar" aria-expanded="false" aria-controls="overview-map" title="Semantic radar (M)">MAP</button>
<button id="btn-semantic-lens" type="button" aria-label="Open semantic lens" aria-haspopup="dialog" aria-expanded="false" aria-pressed="false" aria-controls="semantic-lens" title="Semantic lens (L)">LENS</button>
<button id="btn-node-finder" type="button" aria-label="Find a node" aria-haspopup="dialog" aria-expanded="false" aria-controls="node-finder" title="Find a node (/)" data-node-finder-trigger><span class="diagram-nav-icon find" aria-hidden="true"></span></button>
- <button id="btn-diagram-guide" type="button" aria-label="Open diagram guide" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="Diagram guide (?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
+ <button id="btn-diagram-guide" type="button" hidden aria-label="Open diagram guide" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="Diagram guide (?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
<button data-view="out" type="button" aria-label="Zoom out" title="Zoom out (-)"><span class="diagram-nav-icon minus" aria-hidden="true"></span></button>
<button data-view="reset" type="button" aria-label="Reset diagram view" title="Reset view (0)"><span class="diagram-nav-detail" data-view-detail hidden>READ</span><span class="diagram-nav-percent" data-view-percent>100%</span></button>
<button data-view="in" type="button" aria-label="Zoom in" title="Zoom in (+)"><span class="diagram-nav-icon plus" aria-hidden="true"></span></button>
</div>
</div>
+ <aside class="reader-rail" id="reader-rail">
+ <div class="rail-controls no-print" role="toolbar" aria-label="Side panel">
+ <button class="rail-control" id="rail-placement" type="button" hidden aria-label="Move panel below the diagram" title="Move panel below the diagram" data-placement="right"><span class="rail-control-icon placement" aria-hidden="true"></span></button>
+ <button class="rail-control" id="rail-collapse" type="button" hidden aria-controls="reader-rail" aria-expanded="true" aria-label="Collapse side panel" title="Collapse side panel"><span class="rail-control-icon collapse" aria-hidden="true"></span></button>
+ </div>
<!-- Info Cards -->
<div class="cards">
<div class="card">
@@ -5517,12 +5383,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Grid mode</h3>
</div>
<ul>
- <li>&bull; Set layout.mode grid and place components with row/col</li>
- <li>&bull; pos still overrides a cell when you need fine tuning</li>
- <li>&bull; Not auto-layout — fixed cell spacing only</li>
+ <li>Set layout.mode grid and place components with row/col</li>
+ <li>pos still overrides a cell when you need fine tuning</li>
+ <li>Not auto-layout — fixed cell spacing only</li>
</ul>
</div>
</div>
+ <nav class="node-outline no-print" id="node-outline" hidden aria-labelledby="node-outline-title">
+ <div class="node-outline-head">
+ <strong id="node-outline-title">Node index</strong>
+ <span class="node-outline-count" id="node-outline-count"></span>
+ </div>
+ <ol class="node-outline-list" id="node-outline-list"></ol>
+ </nav>
+ </aside>
</div>
@@ -5780,8 +5654,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var MOTION_FPS = 30;
var SHARE_CARD_WIDTH = 1200;
var SHARE_CARD_HEIGHT = 630;
- var SHARE_CARD_PADDING = 36;
- var SHARE_CARD_HEADER = 112;
+ var SHARE_CARD_PADDING = 40;
+ var SHARE_CARD_HEADER = 124;
function exportError(key, values) {
var error = new Error(viewerText(key, values));
@@ -5809,6 +5683,156 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return getComputedStyle(document.body).backgroundColor || '#ffffff';
}
+ function cleanExportClone(clone) {
+ // View transforms and neighborhood focus are HTML exploration state,
+ // never part of a downloaded full-diagram artifact.
+ clone.style.removeProperty('transform');
+ clone.style.removeProperty('clip-path');
+ clone.removeAttribute('data-view-scale');
+ clone.removeAttribute('data-focus-active');
+ clone.removeAttribute('data-reach-active');
+ clone.removeAttribute('data-lens-active');
+ clone.removeAttribute('data-lens-flow-count');
+ clone.removeAttribute('data-lens-flow-density');
+ clone.removeAttribute('data-legend-preview-active');
+ clone.removeAttribute('data-relationship-preview-active');
+ clone.removeAttribute('data-relationship-direct-active');
+ clone.removeAttribute('data-relationship-pin-active');
+ clone.removeAttribute('data-intent-trace-active');
+ clone.removeAttribute('data-route-picking');
+ clone.removeAttribute('data-route-active');
+ clone.removeAttribute('data-route-journey');
+ clone.removeAttribute('data-share-route');
+ clone.removeAttribute('data-share-reach');
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
+ el.removeAttribute('data-legend-kind');
+ el.removeAttribute('data-legend-label');
+ el.removeAttribute('data-legend-count');
+ el.removeAttribute('data-legend-zero');
+ el.removeAttribute('data-legend-selected');
+ el.removeAttribute('role');
+ el.removeAttribute('tabindex');
+ el.removeAttribute('aria-label');
+ el.removeAttribute('aria-pressed');
+ el.removeAttribute('aria-haspopup');
+ el.removeAttribute('aria-controls');
+ el.removeAttribute('aria-expanded');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
+ el.removeAttribute('data-legend-bridge');
+ el.removeAttribute('role');
+ el.removeAttribute('aria-label');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
+ var originalLabel = el.getAttribute('data-source-evidence-original-label');
+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');
+ else el.setAttribute('aria-label', originalLabel);
+ el.removeAttribute('data-source-evidence-count');
+ el.removeAttribute('data-source-evidence-original-label');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
+ el.removeAttribute('data-focus-match');
+ el.removeAttribute('data-focus-selected');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
+ el.removeAttribute('data-reach-match');
+ el.removeAttribute('data-reach-origin');
+ el.removeAttribute('data-reach-depth');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
+ el.removeAttribute('data-lens-match');
+ el.removeAttribute('data-lens-selected');
+ el.removeAttribute('data-lens-peer');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
+ el.removeAttribute('data-legend-preview-match');
+ el.removeAttribute('data-legend-preview-selected');
+ el.removeAttribute('data-legend-preview-peer');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
+ el.removeAttribute('data-relationship-preview');
+ el.removeAttribute('data-relationship-preview-node');
+ el.removeAttribute('data-relationship-preview-source');
+ el.removeAttribute('data-relationship-preview-target');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
+ el.removeAttribute('data-intent-trace-match');
+ el.removeAttribute('data-intent-trace-selected');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
+ el.removeAttribute('data-route-match');
+ el.removeAttribute('data-route-start');
+ el.removeAttribute('data-route-end');
+ el.removeAttribute('data-route-step');
+ el.removeAttribute('data-route-candidate');
+ el.removeAttribute('data-route-journey-state');
+ el.removeAttribute('data-route-journey-current');
+ el.style.removeProperty('--route-step');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
+ el.removeAttribute('data-share-route-match');
+ el.removeAttribute('data-share-route-step');
+ el.removeAttribute('data-share-route-start');
+ el.removeAttribute('data-share-route-end');
+ el.removeAttribute('data-share-route-middle');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
+ el.removeAttribute('data-share-reach-match');
+ el.removeAttribute('data-share-reach-origin');
+ el.removeAttribute('data-share-reach-depth');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
+ el.removeAttribute('data-detail');
+ el.removeAttribute('data-detail-anchor');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
+ el.setAttribute('aria-pressed', 'false');
+ });
+ return !clone.hasAttribute('data-view-scale') &&
+ !clone.hasAttribute('data-focus-active') &&
+ !clone.hasAttribute('data-reach-active') &&
+ !clone.hasAttribute('data-lens-active') &&
+ !clone.hasAttribute('data-lens-flow-count') &&
+ !clone.hasAttribute('data-lens-flow-density') &&
+ !clone.hasAttribute('data-legend-preview-active') &&
+ !clone.hasAttribute('data-relationship-preview-active') &&
+ !clone.hasAttribute('data-relationship-direct-active') &&
+ !clone.hasAttribute('data-intent-trace-active') &&
+ !clone.hasAttribute('data-route-picking') &&
+ !clone.hasAttribute('data-route-active') &&
+ !clone.hasAttribute('data-route-journey') &&
+ !clone.hasAttribute('data-share-route') &&
+ !clone.hasAttribute('data-share-reach') &&
+ !clone.style.getPropertyValue('transform') &&
+ !clone.style.getPropertyValue('clip-path') &&
+ clone.querySelectorAll('[data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;
+ }
+
+
/**
* Serialize the main SVG into a standalone document.
*
@@ -5818,10 +5842,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
* (PNG/JPEG/WebP/clipboard) because canvas rasterization needs
* deterministic colors; a raster cannot react to
* prefers-color-scheme after encoding.
- * - autoTheme=true — emits BOTH dark and light variable sets plus a
+ * - theme=auto — emits BOTH dark and light variable sets plus a
* `@media (prefers-color-scheme)` rule so the resulting SVG
* self-themes when embedded in GitHub READMEs or other hosts that
- * expose a color scheme. Used for "Download SVG".
+ * expose a color scheme. Used for the default "Download SVG".
+ * - theme=light|dark — locks the standalone SVG to the requested
+ * theme, independently of its source Viewer and host OS themes.
*/
function applyRouteSnapshot(clone, snapshot) {
if (!snapshot || !Array.isArray(snapshot.nodeIds) || !Array.isArray(snapshot.edges) ||
@@ -5986,194 +6012,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function serializeSvg(scale, opts) {
- // scale: integer multiplier for intrinsic SVG pixel dimensions used by
+ // scale: multiplier (integer unless the figure is oversized) for intrinsic SVG pixel dimensions used by
// the raster path. Defaults to 1 (natural size) for SVG download.
scale = scale || 1;
opts = opts || {};
- var autoTheme = opts.autoTheme === true;
+ var requestedTheme = opts.theme || (opts.autoTheme === true ? 'auto' : null);
+ if (requestedTheme && requestedTheme !== 'auto' && requestedTheme !== 'light' && requestedTheme !== 'dark') {
+ throw new Error('Unsupported SVG theme: ' + requestedTheme);
+ }
+ var autoTheme = requestedTheme === 'auto';
var svg = document.querySelector('.diagram-container svg');
var clone = svg.cloneNode(true);
- // View transforms and neighborhood focus are HTML exploration state,
- // never part of a downloaded full-diagram artifact.
- clone.style.removeProperty('transform');
- clone.style.removeProperty('clip-path');
- clone.removeAttribute('data-view-scale');
- clone.removeAttribute('data-focus-active');
- clone.removeAttribute('data-reach-active');
- clone.removeAttribute('data-lens-active');
- clone.removeAttribute('data-lens-flow-count');
- clone.removeAttribute('data-lens-flow-density');
- clone.removeAttribute('data-legend-preview-active');
- clone.removeAttribute('data-relationship-preview-active');
- clone.removeAttribute('data-relationship-direct-active');
- clone.removeAttribute('data-relationship-pin-active');
- clone.removeAttribute('data-intent-trace-active');
- clone.removeAttribute('data-route-picking');
- clone.removeAttribute('data-route-active');
- clone.removeAttribute('data-route-journey');
- clone.removeAttribute('data-share-route');
- clone.removeAttribute('data-share-reach');
- clone.removeAttribute('data-story-active');
- clone.removeAttribute('data-story-playing');
- clone.removeAttribute('data-story-beat');
- clone.removeAttribute('data-story-next');
- clone.removeAttribute('data-story-follow');
- clone.removeAttribute('data-chapter-handoff');
- clone.removeAttribute('data-chapter-anchor');
- clone.removeAttribute('data-chapter-preview');
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {
- el.removeAttribute('data-chapter-role');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {
- el.removeAttribute('data-chapter-preview-role');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
- el.removeAttribute('data-legend-kind');
- el.removeAttribute('data-legend-label');
- el.removeAttribute('data-legend-count');
- el.removeAttribute('data-legend-zero');
- el.removeAttribute('data-legend-selected');
- el.removeAttribute('role');
- el.removeAttribute('tabindex');
- el.removeAttribute('aria-label');
- el.removeAttribute('aria-pressed');
- el.removeAttribute('aria-haspopup');
- el.removeAttribute('aria-controls');
- el.removeAttribute('aria-expanded');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
- el.removeAttribute('data-legend-bridge');
- el.removeAttribute('role');
- el.removeAttribute('aria-label');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
- var originalLabel = el.getAttribute('data-source-evidence-original-label');
- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');
- else el.setAttribute('aria-label', originalLabel);
- el.removeAttribute('data-source-evidence-count');
- el.removeAttribute('data-source-evidence-original-label');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {
- el.removeAttribute('data-story-step');
- el.removeAttribute('data-story-beat-state');
- el.removeAttribute('data-story-beat-step');
- el.style.removeProperty('--story-step');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
- el.removeAttribute('data-focus-match');
- el.removeAttribute('data-focus-selected');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
- el.removeAttribute('data-reach-match');
- el.removeAttribute('data-reach-origin');
- el.removeAttribute('data-reach-depth');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
- el.removeAttribute('data-lens-match');
- el.removeAttribute('data-lens-selected');
- el.removeAttribute('data-lens-peer');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
- el.removeAttribute('data-legend-preview-match');
- el.removeAttribute('data-legend-preview-selected');
- el.removeAttribute('data-legend-preview-peer');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
- el.removeAttribute('data-relationship-preview');
- el.removeAttribute('data-relationship-preview-node');
- el.removeAttribute('data-relationship-preview-source');
- el.removeAttribute('data-relationship-preview-target');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
- el.removeAttribute('data-intent-trace-match');
- el.removeAttribute('data-intent-trace-selected');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
- el.removeAttribute('data-route-match');
- el.removeAttribute('data-route-start');
- el.removeAttribute('data-route-end');
- el.removeAttribute('data-route-step');
- el.removeAttribute('data-route-candidate');
- el.removeAttribute('data-route-journey-state');
- el.removeAttribute('data-route-journey-current');
- el.style.removeProperty('--route-step');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
- el.removeAttribute('data-share-route-match');
- el.removeAttribute('data-share-route-step');
- el.removeAttribute('data-share-route-start');
- el.removeAttribute('data-share-route-end');
- el.removeAttribute('data-share-route-middle');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
- el.removeAttribute('data-share-reach-match');
- el.removeAttribute('data-share-reach-origin');
- el.removeAttribute('data-share-reach-depth');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
- el.removeAttribute('data-detail');
- el.removeAttribute('data-detail-anchor');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
- el.setAttribute('aria-pressed', 'false');
- });
- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&
- !clone.hasAttribute('data-focus-active') &&
- !clone.hasAttribute('data-reach-active') &&
- !clone.hasAttribute('data-lens-active') &&
- !clone.hasAttribute('data-lens-flow-count') &&
- !clone.hasAttribute('data-lens-flow-density') &&
- !clone.hasAttribute('data-legend-preview-active') &&
- !clone.hasAttribute('data-relationship-preview-active') &&
- !clone.hasAttribute('data-relationship-direct-active') &&
- !clone.hasAttribute('data-intent-trace-active') &&
- !clone.hasAttribute('data-route-picking') &&
- !clone.hasAttribute('data-route-active') &&
- !clone.hasAttribute('data-route-journey') &&
- !clone.hasAttribute('data-share-route') &&
- !clone.hasAttribute('data-share-reach') &&
- !clone.hasAttribute('data-story-active') &&
- !clone.hasAttribute('data-story-playing') &&
- !clone.hasAttribute('data-story-beat') &&
- !clone.hasAttribute('data-story-next') &&
- !clone.hasAttribute('data-story-follow') &&
- !clone.hasAttribute('data-chapter-handoff') &&
- !clone.hasAttribute('data-chapter-anchor') &&
- !clone.hasAttribute('data-chapter-preview') &&
- !clone.style.getPropertyValue('transform') &&
- !clone.style.getPropertyValue('clip-path') &&
- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;
+ var canonicalStateClean = cleanExportClone(clone);
var vb = svg.viewBox.baseVal;
var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&
@@ -6190,6 +6041,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// canvas upscaling.
clone.setAttribute('width', vb.width * scale);
clone.setAttribute('height', vb.height * scale);
+ // Keep copied Viewer layout rules from overriding the export's size.
+ clone.style.width = vb.width * scale + 'px';
+ clone.style.height = vb.height * scale + 'px';
+ clone.style.minWidth = '0';
clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
// Only the SVG-relevant rules: semantic classes, markers, and the
@@ -6210,6 +6065,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var sel = rule.selectorText || '';
if (/(^|,)\s*(svg|:root|\[data-theme|\[data-preset|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {
out.push(rule.cssText);
+ } else if (opts.figure && sel.indexOf('.diagram-container > svg') !== -1) {
+ // Figures look like the Viewer canvas: keep its preset/theme paint
+ // (quiet grid, lifted nodes) by rescoping matching rules to svg.
+ var scoped = sel.split(',').map(function (part) {
+ var at = part.indexOf('.diagram-container > svg');
+ if (at === -1) return null;
+ var prefix = part.slice(0, at).trim();
+ try { if (prefix && !document.documentElement.matches(prefix)) return null; } catch (_) { return null; }
+ return 'svg' + part.slice(at + '.diagram-container > svg'.length);
+ }).filter(Boolean);
+ if (scoped.length) out.push(scoped.join(', ') + ' { ' + rule.style.cssText + ' }');
}
});
});
@@ -6238,9 +6104,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6252,25 +6121,29 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');
var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- bgRect.setAttribute('width', '100%');
- bgRect.setAttribute('height', '100%');
+ // Cover the real viewBox: auto-cropped canvases start below y=0, and a
+ // 100% rect anchored at the origin left an unpainted band at the bottom.
+ bgRect.setAttribute('x', vb.x);
+ bgRect.setAttribute('y', vb.y);
+ bgRect.setAttribute('width', vb.width);
+ bgRect.setAttribute('height', vb.height);
if (autoTheme) {
// Dual-theme SVG. Dark is the default (so hosts without
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6279,11 +6152,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// swaps with the media query.
bgRect.setAttribute('class', 'c-bg-rect');
} else {
- // Raster path: lock to the viewer's current theme.
- var theme = document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ // Raster exports keep the viewer's current theme. Explicit SVG
+ // exports instead select their own stable light/dark source.
+ var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6297,30 +6171,37 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
hostStyle + "\n" +
":root, svg { " + vars + " }\n";
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
- style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from] { opacity: 0.18; }\n" +
- "svg[data-share-route] [data-share-route-match] { opacity: 1; }\n" +
+ style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from], svg[data-share-route] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.18; }\n" +
+ "svg[data-share-route] [data-share-route-match], svg[data-share-route] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-route-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
"svg[data-share-route] [data-share-route-start] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3; stroke-dasharray: 5 3; }\n" +
"svg[data-share-route] [data-share-route-middle] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 2.2; }\n" +
"svg[data-share-route] [data-share-route-end] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3.4; stroke-dasharray: 1 0; }\n";
}
if (opts.reachSnapshot) {
- style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from] { opacity: 0.14; }\n" +
- "svg[data-share-reach] [data-share-reach-match] { opacity: 1; }\n" +
+ style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from], svg[data-share-reach] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.14; }\n" +
+ "svg[data-share-reach] [data-share-reach-match], svg[data-share-reach] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-reach-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
"svg[data-share-reach] [data-edge-from][data-share-reach-match] { stroke-width: 1.55; }\n" +
"svg[data-share-reach=\"upstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--database-stroke); stroke-width: 3.4; stroke-dasharray: 5 3; }\n" +
"svg[data-share-reach=\"downstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--backend-stroke); stroke-width: 3.4; stroke-dasharray: 1 0; }\n" +
"svg[data-preset=\"blueprint\"][data-share-reach] [data-share-reach-origin], svg[data-preset=\"blueprint\"][data-share-reach] [data-edge-from][data-share-reach-match] { filter: none; }\n";
}
+ // Figures draw the diagram on a painted canvas card, like the Viewer.
+ if (opts.figure) bgRect.setAttribute('fill', 'none');
+
clone.insertBefore(style, clone.firstChild);
clone.insertBefore(bgRect, style.nextSibling);
+ // The XML declaration pins UTF-8: without it, consumers that guess an
+ // encoding instead of defaulting to UTF-8 mangle non-ASCII text.
return {
- svgString: new XMLSerializer().serializeToString(clone),
+ svgString: '<?xml version="1.0" encoding="UTF-8"?>\n' +
+ new XMLSerializer().serializeToString(clone),
width: vb.width * scale,
height: vb.height * scale,
canonicalStateClean: canonicalStateClean,
@@ -6344,14 +6225,114 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /
// desktop Safari are far higher but start failing on memory-constrained
// devices. We pick the largest integer scale in {4,3,2,1} whose target
- // pixel count fits under this cap.
+ // pixel count fits under this cap; a figure too large even at 1x is
+ // downscaled to fit rather than allocating an oversized canvas.
var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;
function pickSafeScale(vbW, vbH) {
for (var s = RASTER_SCALE; s >= 1; s--) {
if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;
}
- return 1;
+ return Math.sqrt(MAX_CANVAS_PIXELS / (vbW * vbH)) * 0.999;
+ }
+
+ // Raster exports reproduce the Viewer page without its controls: the
+ // title row with its accent dot, then the diagram on the same rounded
+ // canvas card (fill, hairline, shadow, dot field). CSS pixels.
+ var FIGURE_MARGIN = 28;
+ var FIGURE_CARD_PADDING = 24;
+ var FIGURE_TITLE_SIZE = 24;
+ var FIGURE_SUBTITLE_SIZE = 14;
+
+ function figureLayout(vb) {
+ var titleNode = document.querySelector('.header h1');
+ var subtitleNode = document.querySelector('.header .subtitle');
+ var container = document.querySelector('.diagram-container');
+ var root = getComputedStyle(document.documentElement);
+ var card = container ? getComputedStyle(container) : null;
+ var title = titleNode ? titleNode.textContent.trim() : '';
+ var subtitle = subtitleNode ? subtitleNode.textContent.trim() : '';
+ var header = title ? 32 + (subtitle ? 24 : 0) + 18 : 0;
+ var cardWidth = vb.width + FIGURE_CARD_PADDING * 2;
+ var cardHeight = vb.height + FIGURE_CARD_PADDING * 2;
+ var cardFill = card && card.backgroundColor && !/rgba\(0, 0, 0, 0\)|transparent/.test(card.backgroundColor)
+ ? card.backgroundColor : (root.getPropertyValue('--panel').trim() || 'transparent');
+ return {
+ title: title,
+ subtitle: subtitle,
+ family: titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif',
+ text: root.getPropertyValue('--text').trim() || '#111827',
+ muted: root.getPropertyValue('--text-muted').trim() || '#64748b',
+ accent: root.getPropertyValue('--frontend-stroke').trim() || '#0891b2',
+ bg: root.getPropertyValue('--bg').trim() || currentBg(),
+ cardFill: cardFill,
+ cardBorder: root.getPropertyValue('--panel-border').trim() || 'transparent',
+ dot: card && /radial-gradient/.test(card.backgroundImage) ? (root.getPropertyValue('--canvas-dot').trim() || '') : '',
+ light: (document.documentElement.getAttribute('data-theme') || 'dark') === 'light',
+ header: header,
+ cardWidth: cardWidth,
+ cardHeight: cardHeight,
+ width: cardWidth + FIGURE_MARGIN * 2,
+ height: cardHeight + FIGURE_MARGIN * 2 + header
+ };
+ }
+
+ function paintFigure(ctx, layout) {
+ var m = FIGURE_MARGIN;
+ ctx.fillStyle = layout.bg;
+ ctx.fillRect(0, 0, layout.width, layout.height);
+ if (layout.title) {
+ var titleMid = m + 16;
+ ctx.fillStyle = layout.accent;
+ ctx.globalAlpha = 0.16;
+ ctx.beginPath(); ctx.arc(m + 5, titleMid, 9, 0, Math.PI * 2); ctx.fill();
+ ctx.globalAlpha = 1;
+ ctx.beginPath(); ctx.arc(m + 5, titleMid, 5, 0, Math.PI * 2); ctx.fill();
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = layout.text;
+ ctx.fillText(fitCanvasText(ctx, layout.title, layout.width - m * 2 - 22, FIGURE_TITLE_SIZE, 14, '650', layout.family), m + 22, titleMid + 1);
+ if (layout.subtitle) {
+ ctx.fillStyle = layout.muted;
+ ctx.fillText(fitCanvasText(ctx, layout.subtitle, layout.width - m * 2, FIGURE_SUBTITLE_SIZE, 11, '400', layout.family), m, titleMid + 30);
+ }
+ ctx.textBaseline = 'alphabetic';
+ }
+ var x = m, y = m + layout.header, w = layout.cardWidth, h = layout.cardHeight, r = 16;
+ function cardPath() {
+ ctx.beginPath();
+ if (typeof ctx.roundRect === 'function') ctx.roundRect(x, y, w, h, r);
+ else ctx.rect(x, y, w, h);
+ }
+ ctx.save();
+ if (layout.light) {
+ ctx.shadowColor = 'rgba(15, 23, 42, 0.08)';
+ ctx.shadowBlur = 28;
+ ctx.shadowOffsetY = 10;
+ }
+ cardPath();
+ ctx.fillStyle = layout.bg;
+ ctx.fill();
+ ctx.restore();
+ cardPath();
+ ctx.fillStyle = layout.cardFill;
+ ctx.fill();
+ if (layout.dot) {
+ ctx.save();
+ cardPath();
+ ctx.clip();
+ ctx.fillStyle = layout.dot;
+ for (var dy = y + 1; dy < y + h; dy += 20) {
+ for (var dx = x + 1; dx < x + w; dx += 20) {
+ ctx.beginPath(); ctx.arc(dx, dy, 1, 0, Math.PI * 2); ctx.fill();
+ }
+ }
+ ctx.restore();
+ }
+ cardPath();
+ ctx.strokeStyle = layout.cardBorder;
+ ctx.lineWidth = 1;
+ ctx.stroke();
+ return { x: x + FIGURE_CARD_PADDING, y: y + FIGURE_CARD_PADDING };
}
function rasterize(format) {
@@ -6361,8 +6342,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// size — no upsampling blur.
var svg = document.querySelector('.diagram-container svg');
var vb = svg.viewBox.baseVal;
- var scale = pickSafeScale(vb.width, vb.height);
- var data = serializeSvg(scale);
+ var layout = figureLayout(vb);
+ var scale = pickSafeScale(layout.width, layout.height);
+ var data = serializeSvg(scale, { figure: true });
var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });
var svgUrl = URL.createObjectURL(svgBlob);
@@ -6371,15 +6353,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
img.onload = function () {
try {
var canvas = document.createElement('canvas');
- canvas.width = data.width;
- canvas.height = data.height;
+ canvas.width = Math.round(layout.width * scale);
+ canvas.height = Math.round(layout.height * scale);
var ctx = canvas2dOrThrow(canvas, format);
- if (format === 'jpeg') {
- ctx.fillStyle = currentBg();
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- }
- // Draw at natural size — SVG was already rasterized at target res.
- ctx.drawImage(img, 0, 0);
+ // Paint in CSS pixels; the SVG image is already rendered at scale,
+ // so drawing it at CSS size under this transform stays 1:1.
+ ctx.setTransform(scale, 0, 0, scale, 0, 0);
+ var origin = paintFigure(ctx, layout);
+ ctx.drawImage(img, origin.x, origin.y, vb.width, vb.height);
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
URL.revokeObjectURL(svgUrl);
var mime = format === 'jpeg' ? 'image/jpeg' :
format === 'webp' ? 'image/webp' : 'image/png';
@@ -6401,10 +6383,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
});
}
- function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight) {
+ function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight, fontFamily) {
var value = String(text || '').trim();
var size = startSize;
- var family = "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
+ var family = fontFamily || "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
while (size > minSize) {
ctx.font = (weight || '600') + ' ' + size + 'px ' + family;
if (ctx.measureText(value).width <= maxWidth) return value;
@@ -6430,14 +6412,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function renderShareCard(options) {
- options = options || {};
var routeSnapshot = options.routeSnapshot || null;
var reachSnapshot = options.reachSnapshot || null;
if (routeSnapshot && reachSnapshot) return Promise.reject(exportError('viewer.export.error.variantsCombined'));
var svg = document.querySelector('.diagram-container svg');
var vb = svg.viewBox.baseVal;
var sourceScale = Math.min(2, pickSafeScale(vb.width, vb.height));
- var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot });
+ var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot, figure: true });
if (!data.canonicalStateClean) return Promise.reject(exportError('viewer.export.error.viewerState'));
if (routeSnapshot && !data.routeStateClean) return Promise.reject(exportError('viewer.export.error.routeState'));
if (reachSnapshot && !data.reachStateClean) return Promise.reject(exportError('viewer.export.error.reachState'));
@@ -6462,7 +6443,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
: '--frontend-stroke';
var accent = computed.getPropertyValue(accentProperty).trim() || '#22d3ee';
var titleNode = document.querySelector('.header h1');
- var subtitleNode = document.querySelector('.header .subtitle');
var title = titleNode ? titleNode.textContent : document.title;
var directionLabel = reachSnapshot
? viewerText('viewer.export.direction.' + reachSnapshot.direction)
@@ -6472,62 +6452,65 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
source: routeSnapshot.source.label,
target: routeSnapshot.target.label
})
- : reachSnapshot
- ? viewerText('viewer.export.card.reachSummary', {
- direction: directionLabel,
- origin: reachSnapshot.origin.label,
- nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
- links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
- hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
- })
- : subtitleNode ? subtitleNode.textContent : '';
- var preset = document.documentElement.getAttribute('data-preset') || 'classic';
- var theme = document.documentElement.getAttribute('data-theme') || 'dark';
- var presetKey = preset === 'signal-flow'
- ? 'viewer.preset.flow.short'
- : 'viewer.preset.' + preset;
- var presetLabel = viewerText(presetKey).toUpperCase();
- var themeLabel = viewerText('viewer.theme.' + theme).toUpperCase();
+ : viewerText('viewer.export.card.reachSummary', {
+ direction: directionLabel,
+ origin: reachSnapshot.origin.label,
+ nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
+ links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
+ hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
+ });
var cardLabel = routeSnapshot
? viewerText('viewer.export.card.routeBadge', {
hops: viewerCount('viewer.export.card.hop', routeSnapshot.hops).toUpperCase()
})
- : reachSnapshot
- ? viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() })
- : viewerText('viewer.export.card.defaultBadge', { preset: presetLabel, theme: themeLabel });
+ : viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() });
+
+ var family = titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif';
+ var panelFill = bg;
ctx.fillStyle = bg;
ctx.fillRect(0, 0, SHARE_CARD_WIDTH, SHARE_CARD_HEIGHT);
+ // Header: a short accent rule and badge over the title and summary.
ctx.fillStyle = accent;
- ctx.fillRect(SHARE_CARD_PADDING, 27, 42, 3);
-
+ ctx.fillRect(SHARE_CARD_PADDING, 34, 28, 3);
ctx.textBaseline = 'alphabetic';
+ ctx.font = '600 12px ' + family;
+ ctx.textAlign = 'right';
+ ctx.fillStyle = muted;
+ ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 40);
+ ctx.textAlign = 'left';
+
ctx.fillStyle = text;
- var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 330, 29, 18, '700');
- ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 62);
+ var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 260, 30, 18, '650', family);
+ ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 74);
ctx.fillStyle = muted;
- var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 280, 13, 11, '500');
- ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 87);
-
- ctx.font = "600 12px 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
- ctx.textAlign = 'right';
- ctx.fillStyle = accent;
- ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 50);
- ctx.textAlign = 'left';
+ var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2, 15, 12, '400', family);
+ ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 99);
+
+ // The diagram sits on one soft rounded panel with an even inset.
+ var panelX = SHARE_CARD_PADDING;
+ var panelY = SHARE_CARD_HEADER;
+ var panelWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
+ var panelHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
+ var inset = 18;
+ ctx.beginPath();
+ if (typeof ctx.roundRect === 'function') ctx.roundRect(panelX, panelY, panelWidth, panelHeight, 14);
+ else ctx.rect(panelX, panelY, panelWidth, panelHeight);
+ ctx.fillStyle = panelFill;
+ ctx.fill();
+ ctx.strokeStyle = border;
+ ctx.lineWidth = 1;
+ ctx.stroke();
- var availableWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
- var availableHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
+ var availableWidth = panelWidth - inset * 2;
+ var availableHeight = panelHeight - inset * 2;
var fit = Math.min(availableWidth / data.width, availableHeight / data.height);
var drawWidth = data.width * fit;
var drawHeight = data.height * fit;
- var drawX = SHARE_CARD_PADDING + (availableWidth - drawWidth) / 2;
- var drawY = SHARE_CARD_HEADER + (availableHeight - drawHeight) / 2;
-
- ctx.strokeStyle = border;
- ctx.lineWidth = 1;
- ctx.strokeRect(drawX - 0.5, drawY - 0.5, drawWidth + 1, drawHeight + 1);
+ var drawX = panelX + inset + (availableWidth - drawWidth) / 2;
+ var drawY = panelY + inset + (availableHeight - drawHeight) / 2;
ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);
URL.revokeObjectURL(svgUrl);
@@ -6550,7 +6533,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function rasterizeShareCard(options) {
options = options || {};
- if (!options.variant) return renderShareCard();
if (options.variant !== 'route' && options.variant !== 'reach') {
return Promise.reject(exportError('viewer.export.unknownVariant', { variant: options.variant }));
}
@@ -6863,8 +6845,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// canvas.toBlob('image/webp') silently returns a PNG on browsers without
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
- if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
@@ -6880,7 +6861,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
it.disabled = true;
it.title = viewerText('viewer.export.unsupported');
}
- if ((it.dataset.action === 'copy' || it.dataset.action === 'copy-share-card') && !canCopyImage()) {
+ if (it.dataset.action === 'copy' && !canCopyImage()) {
it.disabled = true;
it.title = viewerText('viewer.export.clipboardUnsupported');
}
@@ -6970,21 +6951,21 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
});
function runExport(format) {
+ if (['svg', 'svg-light', 'svg-dark', 'png', 'jpeg', 'webp', 'webm'].indexOf(format) === -1) {
+ return Promise.reject(exportError('viewer.export.unsupported'));
+ }
var base = diagramFilename();
+ var svgTheme = format === 'svg' ? 'auto' :
+ format === 'svg-light' ? 'light' :
+ format === 'svg-dark' ? 'dark' : null;
close(true);
clearExportReceipt();
if (format === 'webm') toast(viewerText('viewer.export.recording'));
- return (format === 'share-card'
- ? rasterizeShareCard().then(function (blob) {
- recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });
- download(blob, base + '-share-card.png');
- toast(viewerText('viewer.export.downloadedShare'));
- })
- : format === 'svg'
- ? Promise.resolve(serializeSvg(1, { autoTheme: true })).then(function (d) {
+ return (svgTheme
+ ? Promise.resolve(serializeSvg(1, { theme: svgTheme })).then(function (d) {
var blob = new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' });
recordExportReceipt('svg', blob, d.canonicalStateClean);
- download(blob, base + '.svg');
+ download(blob, base + (svgTheme === 'auto' ? '' : '-' + svgTheme) + '.svg');
})
: format === 'webm'
? recordWebm().then(function (blob) {
@@ -7120,29 +7101,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
}
- function runCopyShareCard() {
- close(true);
- clearExportReceipt();
- if (!canCopyImage()) {
- alert(viewerText('viewer.export.clipboardUnsupported.period'));
- return;
- }
- var blobPromise = rasterizeShareCard();
- return writePngToClipboard(blobPromise).then(function () {
- return blobPromise.then(function (blob) {
- recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });
- toast(viewerText('viewer.export.copiedShare'));
- });
- }).catch(function (err) {
- console.error(err);
- var technicalMessage = err && err.message ? err.message : 'share-card';
- var message = exportMessage(err);
- document.documentElement.setAttribute('data-last-export-error-format', 'share-card');
- document.documentElement.setAttribute('data-last-export-error', technicalMessage);
- alert(viewerText('viewer.export.copyFailed', { message: message }));
- });
- }
-
function runCopy() {
close(true);
clearExportReceipt();
@@ -7168,9 +7126,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var reachShareCardBtn = e.target.closest('button[data-action="reach-share-card"]');
if (reachShareCardBtn && !reachShareCardBtn.disabled && !reachShareCardBtn.hidden) { runReachShareCard(); return; }
- var copyShareCardBtn = e.target.closest('button[data-action="copy-share-card"]');
- if (copyShareCardBtn && !copyShareCardBtn.disabled) { runCopyShareCard(); return; }
-
var copyBtn = e.target.closest('button[data-action="copy"]');
if (copyBtn && !copyBtn.disabled) { runCopy(); return; }
@@ -7188,8 +7143,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
downloadRouteShareCard: runRouteShareCard,
downloadReachShareCard: runReachShareCard,
syncRouteShare: syncRouteShareItem,
- syncReachShare: syncReachShareItem,
- copyShareCard: runCopyShareCard
+ syncReachShare: syncReachShareItem
};
// Auto-open on page load for demo/screenshot purposes: ?openExport=1
@@ -7210,6 +7164,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
} catch (_) {}
})();
+
/* ============================================================
Motion Governor — one reader switch and one motion budget. Ambient
trace yields to the strongest semantic owner; Still also parks bounded
@@ -7283,10 +7238,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return readerPaused || reducedMotion() || hasSuspension();
}
function ownerLabel(value) {
- if (value === 'story') return viewerText('viewer.owner.story');
- if (value === 'chapter') return viewerText('viewer.owner.chapter');
- if (value === 'chapter-preview') return viewerText('viewer.owner.chapterPreview');
- if (value === 'handoff') return viewerText('viewer.owner.handoff');
if (value === 'route') return viewerText('viewer.owner.route');
if (value === 'lens') return viewerText('viewer.owner.lens');
if (value === 'relationship') return viewerText('viewer.owner.relationship');
@@ -7308,12 +7259,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
btn.setAttribute('aria-pressed', paused ? 'false' : 'true');
btn.disabled = systemPaused;
label.textContent = viewerText(paused ? 'viewer.motion.still' : 'viewer.motion.live');
- if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
- if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.settleHandoff) {
- Archify.guidedViews.settleHandoff(systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still'));
- }
if (paused && lastEffectivePaused !== true && Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still') });
}
@@ -7352,8 +7297,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function deriveOwner() {
if (!svg) return '';
- if (svg.hasAttribute('data-story-playing') || svg.hasAttribute('data-story-follow')) return 'story';
- if (svg.hasAttribute('data-story-active')) return 'chapter';
if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return 'route';
if (svg.hasAttribute('data-lens-active')) return 'lens';
if (svg.hasAttribute('data-relationship-preview-active')) return 'relationship';
@@ -7447,7 +7390,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
ownerObserver.observe(svg, {
attributes: true,
attributeFilter: [
- 'data-story-playing', 'data-story-follow', 'data-story-active', 'data-route-picking', 'data-route-active',
+ 'data-route-picking', 'data-route-active',
'data-lens-active', 'data-relationship-preview-active', 'data-intent-trace-active',
'data-focus-active', 'data-legend-preview-active'
]
@@ -7576,6 +7519,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var copyBtn = document.getElementById('btn-focus-copy');
var relationsBtn = document.getElementById('btn-focus-relations');
var clearBtn = document.getElementById('btn-focus-clear');
+ var moveBtn = document.getElementById('btn-focus-move');
var activeIds = [];
var hoveredRelationship = null;
var focusedRelationship = null;
@@ -7585,6 +7529,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var relationshipHitOverlay = null;
var relationshipHitTargets = [];
var directPreviewTimer = null;
+ var lensDrag = null;
+ var lensDragClickPointer = null;
+ var manualLensPosition = null;
var reachabilityMode = null;
var activeReachability = null;
var svgNamespace = 'http://www.w3.org/2000/svg';
@@ -7723,9 +7670,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var result = reachabilityFor(activeIds[0], direction);
if (!result || result.nodeIds.length <= 1) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });
- }
clearRelationshipPreview({ clearPin: true });
clearReachability({ updateUrl: false });
reachabilityMode = direction;
@@ -7779,7 +7723,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {
Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });
}
- requestLensPlacement();
+ placeRelationshipLens();
return true;
}
function reachabilitySnapshot() {
@@ -7882,6 +7826,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function renderSourceEvidence(id) {
evidenceLinks.textContent = '';
repositoryLink.removeAttribute('href');
+ repositoryLink.removeAttribute('aria-label');
repositoryLink.textContent = '';
var sources = Archify.sourceEvidence.node(id);
var repository = Archify.sourceEvidence.repository();
@@ -7889,24 +7834,28 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
evidence.hidden = true;
return;
}
- var slug = repository.url.replace(/^https:\/\/github\.com\//, '').replace(/\/$/, '');
- repositoryLink.href = repository.url + '/tree/' + repository.revision;
- repositoryLink.textContent = slug + ' @ ' + repository.shortRevision;
- repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
+ repositoryLink.textContent = repository.label + ' @ ' + repository.shortRevision;
+ if (repository.href) {
+ repositoryLink.href = repository.href;
+ repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
+ }
+ evidence.title = viewerText('viewer.passport.verificationScope');
sources.forEach(function (source) {
- var link = document.createElement('a');
+ var link = document.createElement(source.href ? 'a' : 'div');
link.className = 'semantic-passport-source';
- link.href = source.href;
- link.target = '_blank';
- link.rel = 'noopener noreferrer';
- link.referrerPolicy = 'no-referrer';
- link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
+ if (source.href) {
+ link.href = source.href;
+ link.target = '_blank';
+ link.rel = 'noopener noreferrer';
+ link.referrerPolicy = 'no-referrer';
+ link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
+ }
var name = document.createElement('strong');
name.textContent = source.label || source.path.split('/').pop() || source.path;
var location = document.createElement('code');
location.textContent = source.line
- ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + ' ↗'
- : viewerText('viewer.passport.source.openLink');
+ ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + (source.href ? ' ↗' : '')
+ : source.href ? viewerText('viewer.passport.source.openLink') : '';
var sourcePath = document.createElement('small');
sourcePath.textContent = source.path;
link.appendChild(name);
@@ -7965,8 +7914,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function relationshipHitRecords() {
var recordsByKey = {};
- var recordsById = {};
- var byId = {};
+ var recordsById = Object.create(null);
+ var byId = Object.create(null);
nodes().forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var records = [];
edges().forEach(function (edge) {
@@ -8254,7 +8203,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
target.removeAttribute('data-preview-active');
});
renderRelationshipCopyAction();
- requestLensPlacement();
+ placeRelationshipLens();
}
function previewRelationship(button, options) {
options = options || {};
@@ -8281,7 +8230,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!chip.hidden && options.direct !== true) chip.setAttribute('data-relationship-previewing', 'true');
activeRelationshipPreview = button;
renderRelationshipPulse(key);
- requestLensPlacement();
+ placeRelationshipLens();
}
function syncRelationshipPreview() {
var next = pinnedRelationship || focusedRelationship || hoveredRelationship;
@@ -8293,11 +8242,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.getAttribute('data-guide-open') === 'true' ||
container.classList.contains('is-panning') ||
(activeIds.length > 0 && !pinnedRelationshipKey) ||
- svg.hasAttribute('data-story-active') ||
svg.hasAttribute('data-route-picking') ||
svg.hasAttribute('data-route-active') ||
- svg.hasAttribute('data-lens-active') ||
- svg.hasAttribute('data-chapter-preview');
+ svg.hasAttribute('data-lens-active');
}
function scheduleDirectRelationshipPreview(target) {
if (directPreviewTimer) window.clearTimeout(directPreviewTimer);
@@ -8336,9 +8283,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var record = relationshipRecordForKey(key);
if (!record) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
set(record.from, { toggle: false, updateUrl: false });
var row = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-key]')).find(function (candidate) {
return candidate.getAttribute('data-relationship-key') === key;
@@ -8560,9 +8504,148 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationshipList.appendChild(section);
});
}
+ function lensPlacementBounds() {
+ var containerRect = container.getBoundingClientRect();
+ if (containerRect.width <= 0 || containerRect.height <= 0 || chip.offsetWidth <= 0 || chip.offsetHeight <= 0) return null;
+ var padding = window.innerWidth <= 720 ? 8 : 16;
+ var visibleLeft = Math.max(padding, -containerRect.left + padding);
+ var visibleRight = Math.min(
+ container.clientWidth - padding,
+ window.innerWidth - containerRect.left - padding
+ );
+ var visibleTop = Math.max(padding, -containerRect.top + padding);
+ var visibleBottom = Math.min(
+ container.clientHeight - padding,
+ window.innerHeight - containerRect.top - padding
+ );
+ var minLeft = visibleLeft;
+ var minTop = Math.min(visibleTop, Math.max(padding, visibleBottom - chip.offsetHeight));
+ return {
+ containerRect: containerRect,
+ minLeft: minLeft,
+ maxLeft: Math.max(minLeft, visibleRight - chip.offsetWidth),
+ minTop: minTop,
+ maxTop: Math.max(minTop, visibleBottom - chip.offsetHeight)
+ };
+ }
+ function manualLensPlacementAvailable() {
+ return window.innerWidth > 720 && (!finePointerQuery || finePointerQuery.matches);
+ }
+ function clampLensPosition(position, bounds) {
+ if (!position || !bounds) return null;
+ return {
+ left: Math.max(bounds.minLeft, Math.min(bounds.maxLeft, position.left)),
+ top: Math.max(bounds.minTop, Math.min(bounds.maxTop, position.top))
+ };
+ }
+ function currentLensPosition() {
+ var bounds = lensPlacementBounds();
+ if (!bounds) return null;
+ var rect = chip.getBoundingClientRect();
+ return clampLensPosition({
+ left: rect.left - bounds.containerRect.left,
+ top: rect.top - bounds.containerRect.top
+ }, bounds);
+ }
+ function applyManualLensPosition(position) {
+ if (!manualLensPlacementAvailable()) return false;
+ var bounds = lensPlacementBounds();
+ var clamped = clampLensPosition(position, bounds);
+ if (!clamped) return false;
+ manualLensPosition = clamped;
+ chip.setAttribute('data-manual-placement', 'true');
+ chip.style.left = Math.round(clamped.left) + 'px';
+ chip.style.top = Math.round(clamped.top) + 'px';
+ if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
+ return true;
+ }
+ function resetLensPlacement(options) {
+ options = options || {};
+ manualLensPosition = null;
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ chip.style.removeProperty('top');
+ if (options.reposition !== false && !chip.hidden) requestLensPlacement();
+ }
+ function beginLensDrag(event) {
+ if (!manualLensPlacementAvailable() || event.button !== 0 || lensDrag) return;
+ var start = currentLensPosition();
+ if (!start) return;
+ event.preventDefault();
+ event.stopPropagation();
+ lensDrag = {
+ pointerId: event.pointerId,
+ originX: event.clientX,
+ originY: event.clientY,
+ start: start,
+ previousManual: manualLensPosition ? { left: manualLensPosition.left, top: manualLensPosition.top } : null,
+ moved: false
+ };
+ chip.setAttribute('data-panel-dragging', 'true');
+ try { moveBtn.setPointerCapture(event.pointerId); } catch (_) {}
+ }
+ function moveLensDrag(event) {
+ if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
+ var dx = event.clientX - lensDrag.originX;
+ var dy = event.clientY - lensDrag.originY;
+ if (!lensDrag.moved && Math.hypot(dx, dy) <= 3) return;
+ lensDrag.moved = true;
+ event.preventDefault();
+ event.stopPropagation();
+ applyManualLensPosition({ left: lensDrag.start.left + dx, top: lensDrag.start.top + dy });
+ }
+ function finishLensDrag(event, cancel) {
+ if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
+ event.preventDefault();
+ event.stopPropagation();
+ var activeDrag = lensDrag;
+ lensDrag = null;
+ if (activeDrag.moved) lensDragClickPointer = activeDrag.pointerId;
+ chip.removeAttribute('data-panel-dragging');
+ try { moveBtn.releasePointerCapture(event.pointerId); } catch (_) {}
+ if (!cancel) return;
+ manualLensPosition = activeDrag.previousManual
+ ? { left: activeDrag.previousManual.left, top: activeDrag.previousManual.top }
+ : null;
+ if (manualLensPosition && manualLensPlacementAvailable()) {
+ applyManualLensPosition(manualLensPosition);
+ } else {
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ chip.style.removeProperty('top');
+ if (!chip.hidden) requestLensPlacement();
+ }
+ }
+ function moveLensWithKeyboard(event) {
+ if (event.key === 'Home') {
+ event.preventDefault();
+ resetLensPlacement();
+ return;
+ }
+ if (event.metaKey || event.ctrlKey || event.altKey || !manualLensPlacementAvailable()) return;
+ var directions = {
+ ArrowLeft: [-1, 0],
+ ArrowRight: [1, 0],
+ ArrowUp: [0, -1],
+ ArrowDown: [0, 1]
+ };
+ var direction = directions[event.key];
+ if (!direction) return;
+ event.preventDefault();
+ var current = manualLensPosition || currentLensPosition();
+ if (!current) return;
+ var distance = event.shiftKey ? 4 : 16;
+ applyManualLensPosition({
+ left: current.left + direction[0] * distance,
+ top: current.top + direction[1] * distance
+ });
+ }
var lensFrame = 0;
function placeRelationshipLens() {
- lensFrame = 0;
+ if (lensFrame) {
+ cancelAnimationFrame(lensFrame);
+ lensFrame = 0;
+ }
if (chip.hidden || activeIds.length !== 1) return;
var node = svg.querySelector('[data-node-id="' + activeIds[0] + '"]');
if (!node) return;
@@ -8574,8 +8657,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var visibleBottom = Math.min(containerRect.height - padding, window.innerHeight - containerRect.top - padding);
var maxTop = Math.max(padding, visibleBottom - chip.offsetHeight);
var minTop = Math.min(visibleTop, maxTop);
- var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
var mobile = window.innerWidth <= 720;
+ if (!manualLensPlacementAvailable()) {
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ } else if (manualLensPosition) {
+ applyManualLensPosition(manualLensPosition);
+ return;
+ }
+ var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
var previewingOnMobile = mobile && chip.getAttribute('data-relationship-previewing') === 'true';
var compactOnMobile = mobile && chip.getAttribute('data-relations-expanded') !== 'true';
var preferred;
@@ -8646,6 +8736,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function clear(options) {
options = options || {};
+ if (lensDrag) {
+ var dragPointerId = lensDrag.pointerId;
+ lensDrag = null;
+ chip.removeAttribute('data-panel-dragging');
+ try { moveBtn.releasePointerCapture(dragPointerId); } catch (_) {}
+ }
var restoreNode = options.restoreFocus === true && activeIds.length === 1
? svg.querySelector('[data-node-id="' + activeIds[0] + '"]')
: null;
@@ -8693,7 +8789,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationsBtn.setAttribute('aria-label', viewerText('viewer.passport.relations.show'));
relationsBtn.setAttribute('aria-expanded', 'false');
chip.removeAttribute('data-relations-expanded');
- chip.style.removeProperty('top');
+ if (options.preserveLensPlacement !== true) resetLensPlacement({ reposition: false });
if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {
Archify.view.reset({ automatic: true });
}
@@ -8716,7 +8812,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
}
var nodeList = nodes();
- var byId = {};
+ var byId = Object.create(null);
nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var normalized = [];
(ids || []).forEach(function (id) {
@@ -8728,10 +8824,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return true;
}
- clear({ updateUrl: false, preserveView: true });
+ var preserveLensPlacement = activeIds.length === 1 && normalized.length === 1 && !chip.hidden;
+ clear({ updateUrl: false, preserveView: true, preserveLensPlacement: preserveLensPlacement });
activeIds = normalized;
- var selected = {};
- var related = {};
+ var selected = Object.create(null);
+ var related = Object.create(null);
var seenEdges = {};
var matchedEdges = 0;
normalized.forEach(function (id) { selected[id] = true; related[id] = true; });
@@ -8758,12 +8855,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg.setAttribute('data-focus-active', normalized.join(' '));
var defaultLabel = normalized.length === 1
? nodeLabel(byId[normalized[0]], normalized[0])
- : viewerText('viewer.guided.chapter.selectedNodes', { count: normalized.length });
+ : viewerText('viewer.focus.selectedNodes', { count: normalized.length });
label.textContent = options.label || defaultLabel;
chip.hidden = options.hideChip === true || normalized.length !== 1 || selectionMode;
if (!chip.hidden) {
renderRelationshipLens(normalized[0], byId);
- requestLensPlacement();
+ placeRelationshipLens();
}
if (options.updateUrl !== false) {
var key = options.urlKey || 'focus';
@@ -8837,6 +8934,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });
}
});
+ moveBtn.addEventListener('pointerdown', beginLensDrag);
+ moveBtn.addEventListener('pointermove', moveLensDrag);
+ moveBtn.addEventListener('pointerup', function (event) { finishLensDrag(event, false); });
+ moveBtn.addEventListener('pointercancel', function (event) { finishLensDrag(event, true); });
+ moveBtn.addEventListener('lostpointercapture', function (event) { finishLensDrag(event, true); });
+ moveBtn.addEventListener('dblclick', function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+ resetLensPlacement();
+ });
+ moveBtn.addEventListener('keydown', moveLensWithKeyboard);
clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });
copyBtn.addEventListener('click', copyFocusLink);
upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });
@@ -8849,15 +8957,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationsBtn.setAttribute('aria-label', viewerText(expanded
? 'viewer.passport.relations.show'
: 'viewer.passport.relations.hide'));
- requestLensPlacement();
+ placeRelationshipLens();
});
relationshipList.addEventListener('click', function (event) {
var button = event.target.closest('[data-relationship-target]');
if (!button) return;
var id = button.getAttribute('data-relationship-target');
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
set(id, { toggle: false });
if (Archify.view && typeof Archify.view.reveal === 'function') {
Archify.view.reveal([id], { includeNeighbors: true, reason: 'relationship' });
@@ -8906,7 +9011,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
event.preventDefault();
buttons[index].focus();
});
+ document.addEventListener('pointerdown', function () {
+ lensDragClickPointer = null;
+ }, true);
document.addEventListener('click', function (event) {
+ // Losing capture (for example when a resize hides the handle) can
+ // retarget this drag's final click to the page. It is not dismissal.
+ // A new pointerdown releases the guard; keyboard clicks remain live.
+ if (lensDragClickPointer != null && event.detail > 0 &&
+ (event.pointerId == null || event.pointerId === lensDragClickPointer)) {
+ lensDragClickPointer = null;
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
var target = event.target;
if (chip.hidden || !target || typeof target.closest !== 'function' || chip.contains(target)) return;
if (container.getAttribute('data-just-panned') === 'true') return;
@@ -8948,7 +9066,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });
}
}
- else if (!params.get('view')) clear({ updateUrl: false });
+ else clear({ updateUrl: false });
} catch (_) {}
}
@@ -8965,7 +9083,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reachabilitySnapshot: reachabilitySnapshot,
inspectRelationship: inspectRelationship,
inspectRelationshipById: inspectRelationshipById,
- reposition: requestLensPlacement,
+ reposition: placeRelationshipLens,
relationship: function () {
var record = pinnedRelationshipRecord();
return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;
@@ -8983,6 +9101,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
})();
+
/* ============================================================
Intent Trace — temporary one-hop topology before durable focus.
Fine-pointer hover and keyboard focus share the same stable-ID preview;
@@ -9020,7 +9139,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.getAttribute('data-guide-open') === 'true' ||
container.classList.contains('is-panning') ||
svg.hasAttribute('data-lens-active') ||
- svg.hasAttribute('data-story-active') ||
svg.hasAttribute('data-relationship-preview-active') ||
!!(Archify.routeProbe && typeof Archify.routeProbe.active === 'function' && Archify.routeProbe.active()) ||
!!(Archify.focus && typeof Archify.focus.active === 'function' && Archify.focus.active());
@@ -9082,7 +9200,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
clear({ announce: false });
var nodeList = nodes();
var edgeList = edges();
- var byId = {};
+ var byId = Object.create(null);
nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var selected = byId[id];
if (!selected) return false;
@@ -9091,7 +9209,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
overlay.setAttribute('class', 'intent-trace-overlay');
overlay.setAttribute('data-intent-trace-overlay', '');
overlay.setAttribute('aria-hidden', 'true');
- var related = {};
+ var related = Object.create(null);
var seen = {};
var counts = { out: 0, in: 0, loop: 0 };
related[id] = true;
@@ -9106,1836 +9224,107 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!seen[key]) {
seen[key] = true;
counts[direction] += 1;
- }
- related[from] = true;
- related[to] = true;
- edge.setAttribute('data-intent-trace-match', '');
- var wrapper = document.createElementNS(namespace, 'g');
- if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
- edgeShapes(edge).forEach(function (shape) {
- wrapper.appendChild(traceGeometry(shape, direction));
- });
- if (wrapper.childNodes.length) overlay.appendChild(wrapper);
- });
-
- nodeList.forEach(function (node) {
- var nodeId = node.getAttribute('data-node-id');
- if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
- if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
- });
- if (overlay.childNodes.length) {
- var firstEdge = edgeList[0];
- var firstNode = svg.querySelector('[data-node-id]');
- if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
- else if (firstNode) svg.insertBefore(overlay, firstNode);
- else svg.appendChild(overlay);
- }
- activeId = id;
- svg.setAttribute('data-intent-trace-active', id);
- if (options.announce === true) {
- var total = counts.out + counts.in + counts.loop;
- status.textContent = viewerText('viewer.intent.summary', {
- label: nodeLabel(selected, id),
- out: counts.out,
- in: counts.in,
- loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
- total: total
- });
- }
- return true;
- }
- function schedule(node) {
- if (enterTimer) window.clearTimeout(enterTimer);
- enterTimer = window.setTimeout(function () {
- enterTimer = null;
- if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
- }, reducedMotion() ? 0 : 90);
- }
- function sync() {
- var candidate = focusedNode || hoveredNode;
- if (!candidate) {
- clear();
- return;
- }
- show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
- }
-
- svg.addEventListener('pointerover', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || !finePointer() || event.pointerType === 'touch') return;
- if (event.relatedTarget && node.contains(event.relatedTarget)) return;
- hoveredNode = node;
- schedule(node);
- });
- svg.addEventListener('pointerout', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
- if (hoveredNode === node) hoveredNode = null;
- sync();
- });
- svg.addEventListener('focusin', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node) return;
- focusedNode = node;
- show(node.getAttribute('data-node-id'), { announce: true });
- });
- svg.addEventListener('focusout', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
- if (focusedNode === node) focusedNode = null;
- sync();
- });
- container.addEventListener('pointerdown', function (event) {
- if (!event.target.closest('[data-node-id]')) clear({ announce: false });
- });
- window.addEventListener('blur', function () { clear({ announce: false }); });
-
- return {
- show: show,
- clear: clear,
- active: function () { return activeId; }
- };
- })();
-
- Archify.guidedViews = (function () {
- var data = document.getElementById('archify-guided-views-data');
- var panel = document.getElementById('guided-views');
- var prev = document.getElementById('guided-view-prev');
- var next = document.getElementById('guided-view-next');
- var all = document.getElementById('guided-view-all');
- var play = document.getElementById('guided-view-play');
- var playIcon = document.getElementById('guided-view-play-icon');
- var playLabel = document.getElementById('guided-view-play-label');
- var beatLink = document.getElementById('guided-view-beat-link');
- var beatLinkLabel = document.getElementById('guided-view-beat-link-label');
- var progressBar = document.getElementById('guided-view-progress-bar');
- var count = document.getElementById('guided-view-count');
- var handoffReceipt = document.getElementById('guided-view-handoff');
- var label = document.getElementById('guided-view-label');
- var note = document.getElementById('guided-view-note');
- var trail = document.getElementById('guided-view-trail');
- var storyCaption = document.getElementById('guided-story-caption');
- var storyCaptionIndex = document.getElementById('guided-story-caption-index');
- var storyCaptionRoute = document.getElementById('guided-story-caption-route');
- var storyCaptionDetail = document.getElementById('guided-story-caption-detail');
- var storyCaptionNext = document.getElementById('guided-story-caption-next');
- var storyCaptionNextLabel = document.getElementById('guided-story-caption-next-label');
- var chapterIndex = document.getElementById('guided-view-index');
- var chapterList = document.getElementById('guided-view-chapters');
- var shareCue = document.getElementById('share-chapter-cue');
- var shareCueState = document.getElementById('share-chapter-state');
- var shareCueCount = document.getElementById('share-chapter-count');
- var shareCueLabel = document.getElementById('share-chapter-label');
- var shareCueNote = document.getElementById('share-chapter-note');
- var shareCueRoute = document.getElementById('share-chapter-route');
- var shareCueProgress = document.getElementById('share-chapter-progress-bar');
- var svg = document.querySelector('.diagram-container svg');
- var views = [];
- var activeIndex = -1;
- var playing = false;
- var storyBeatTimer = null;
- var storyBeatIndex = -1;
- var storyBeatStartedAt = 0;
- var storyBeatElapsedMs = 0;
- var storyBeatDwellMs = 0;
- var storyPlaybackGeneration = 0;
- var storyFollowGeneration = 0;
- var storyPlaybackScope = 'story';
- var storyPlaybackComplete = false;
- var beatLinkFeedbackTimer = null;
- var momentRestoreGeneration = 0;
- var storySteps = [];
- var storyPulseOwnerToken = 0;
- var storyPulseGeneration = 0;
- var autoplayPending = false;
- var VIEW_INTERVAL_MS = 3200;
- var STORY_FOLLOW_MIN_DWELL_MS = 1100;
- var STORY_FOLLOW_DURATION_MS = 320;
- var chapterButtons = [];
- var handoffGeneration = 0;
- var currentHandoff = null;
- var previewGeneration = 0;
- var pointerPreviewIntent = null;
- var focusPreviewIntent = null;
- var activePreviewIndex = -1;
- var previewOwnerToken = 0;
-
- try { views = JSON.parse(data.textContent || '[]'); } catch (_) { views = []; }
- if (!views.length) return { count: 0, active: function () { return null; } };
- var canonicalNodeIds = {};
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- canonicalNodeIds[node.getAttribute('data-node-id')] = true;
- });
- views.forEach(function (view) {
- var seen = {};
- view.focus = (view.focus || []).filter(function (id) {
- if (!canonicalNodeIds[id] || seen[id]) return false;
- seen[id] = true;
- return true;
- });
- });
- // Establish the compact cold state before exposing the panel so the
- // full Director cannot flash during first paint. Hash restoration runs
- // in the same task and replaces this state before paint when valid.
- panel.setAttribute('data-active-view', 'all');
- panel.hidden = false;
- panel.setAttribute('data-view-interval-ms', String(VIEW_INTERVAL_MS));
- panel.setAttribute('data-story-follow-min-dwell-ms', String(STORY_FOLLOW_MIN_DWELL_MS));
- buildChapterIndex();
-
- function reducedMotion() {
- return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
- }
-
- function findNode(id) {
- return Array.prototype.find.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- return node.getAttribute('data-node-id') === id;
- }) || null;
- }
-
- function chapterDelta(previous, destination) {
- var previousFocus = previous ? previous.focus : [];
- var destinationFocus = destination ? destination.focus : [];
- var previousIds = {};
- var destinationIds = {};
- previousFocus.forEach(function (id) { previousIds[id] = true; });
- destinationFocus.forEach(function (id) { destinationIds[id] = true; });
- return {
- stay: previousFocus.filter(function (id) { return destinationIds[id]; }),
- enter: destinationFocus.filter(function (id) { return !previousIds[id]; }),
- leave: previousFocus.filter(function (id) { return !destinationIds[id]; })
- };
- }
-
- function chapterAnchor(previous, destination, outgoingBeatIndex, delta) {
- if (!previous || !destination) return '';
- var stayIds = {};
- delta.stay.forEach(function (id) { stayIds[id] = true; });
- var activeBeat = outgoingBeatIndex >= 0 ? previous.focus[outgoingBeatIndex] : '';
- if (activeBeat && stayIds[activeBeat]) return activeBeat;
- for (var index = previous.focus.length - 1; index >= 0; index -= 1) {
- if (stayIds[previous.focus[index]]) return previous.focus[index];
- }
- return '';
- }
-
- function handoffMotionAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (document.documentElement.getAttribute('data-embed') === 'true') return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- return !(Archify.motionGovernor && Archify.motionGovernor.capable && Archify.motionGovernor.isPaused());
- }
-
- function classifyHandoff(delta, anchor) {
- var roles = {};
- delta.stay.forEach(function (id) { roles[id] = 'stay'; });
- delta.enter.forEach(function (id) { roles[id] = 'enter'; });
- delta.leave.forEach(function (id) { roles[id] = 'leave'; });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- var id = node.getAttribute('data-node-id');
- var role = roles[id] || '';
- if (role) node.setAttribute('data-chapter-role', role);
- else node.removeAttribute('data-chapter-role');
- });
- svg.setAttribute('data-chapter-handoff', anchor ? 'anchor' : 'no-anchor');
- if (anchor) svg.setAttribute('data-chapter-anchor', anchor);
- else svg.removeAttribute('data-chapter-anchor');
- }
-
- function drawHandoffAnchor(id) {
- var node = findNode(id);
- if (!node) return null;
- var box;
- try { box = node.getBBox(); } catch (_) { return null; }
- var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- var ring = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- overlay.setAttribute('class', 'chapter-handoff-overlay');
- overlay.setAttribute('data-chapter-handoff-overlay', '');
- overlay.setAttribute('aria-hidden', 'true');
- ring.setAttribute('class', 'chapter-handoff-anchor');
- ring.setAttribute('x', String(box.x - 8));
- ring.setAttribute('y', String(box.y - 8));
- ring.setAttribute('width', String(box.width + 16));
- ring.setAttribute('height', String(box.height + 16));
- ring.setAttribute('rx', '10');
- overlay.appendChild(ring);
- svg.appendChild(overlay);
- return overlay;
- }
-
- function clearHandoffPresentation() {
- svg.removeAttribute('data-chapter-handoff');
- svg.removeAttribute('data-chapter-anchor');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-handoff-overlay]'), function (overlay) { overlay.remove(); });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-role]'), function (node) { node.removeAttribute('data-chapter-role'); });
- if (handoffReceipt) {
- handoffReceipt.hidden = true;
- handoffReceipt.textContent = '';
- }
- }
-
- function completeHandoff(handoff, outcome) {
- if (!handoff || currentHandoff !== handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- currentHandoff = null;
- clearHandoffPresentation();
- if (handoff.ownerToken && Archify.motionGovernor) Archify.motionGovernor.release(handoff.ownerToken);
- handoff.resolve({ id: handoff.id, state: outcome || 'complete', anchor: handoff.anchor || null });
- syncStoryControlsDisabled();
- syncChapterPreview();
- return true;
- }
-
- function settleHandoff(reason) {
- var handoff = currentHandoff;
- if (!handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'settled', true);
- else if (Archify.view && Archify.view.reveal) Archify.view.reveal(handoff.focus, { instant: true, reason: reason || 'settled' });
- completeHandoff(handoff, reason || 'settled');
- return true;
- }
-
- function cancelHandoff(reason) {
- var handoff = currentHandoff;
- if (!handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'manual', false);
- completeHandoff(handoff, reason || 'manual');
- return true;
- }
-
- function afterHandoff(callback) {
- if (!currentHandoff) { callback(); return; }
- currentHandoff.finished.then(callback);
- }
-
- function beginHandoff(previousIndex, nextIndex, previous, destination, outgoingBeatIndex, reason) {
- if (!Archify.view || !Archify.view.reveal) return null;
- if (!previous || previousIndex === nextIndex) {
- Archify.view.reveal(destination.focus, { reason: reason });
- return null;
- }
- var delta = chapterDelta(previous, destination);
- var anchor = chapterAnchor(previous, destination, outgoingBeatIndex, delta);
- if (!handoffMotionAllowed()) {
- Archify.view.reveal(destination.focus, { instant: true, reason: reason });
- return null;
- }
- var resolver;
- var handoff = {
- id: ++handoffGeneration,
- mode: anchor ? 'holding' : 'no-anchor',
- anchor: anchor,
- focus: destination.focus.slice(),
- holdTimer: null,
- camera: null,
- ownerToken: 0,
- finished: new Promise(function (resolve) { resolver = resolve; }),
- resolve: resolver
- };
- currentHandoff = handoff;
- classifyHandoff(delta, anchor);
- if (anchor) {
- drawHandoffAnchor(anchor);
- var node = findNode(anchor);
- var nodeLabel = node ? (node.getAttribute('data-node-label') || anchor) : anchor;
- handoffReceipt.textContent = viewerText('viewer.guided.handoff', {
- from: (previousIndex + 1 < 10 ? '0' : '') + (previousIndex + 1),
- to: (nextIndex + 1 < 10 ? '0' : '') + (nextIndex + 1),
- label: nodeLabel
- });
- handoffReceipt.hidden = false;
- }
- if (Archify.motionGovernor) {
- handoff.ownerToken = Archify.motionGovernor.claim('handoff', function () {
- if (currentHandoff === handoff) settleHandoff('preempted');
- });
- }
- var startCamera = function () {
- if (currentHandoff !== handoff) return;
- handoff.holdTimer = null;
- handoff.mode = 'settling';
- svg.setAttribute('data-chapter-handoff', anchor ? 'settling' : 'no-anchor');
- handoff.camera = Archify.view.reveal(destination.focus, { reason: reason, duration: 420 });
- if (handoff.camera && handoff.camera.finished) {
- handoff.camera.finished.then(function (outcome) {
- if (currentHandoff === handoff) completeHandoff(handoff, outcome && outcome.state || 'complete');
- });
- } else {
- completeHandoff(handoff, 'complete');
- }
- };
- if (anchor) handoff.holdTimer = setTimeout(startCamera, 110);
- else startCamera();
- return handoff;
- }
-
- function centerChapterButton(button) {
- if (!button || !chapterList) return false;
- var target = Math.max(0, button.offsetLeft - (chapterList.clientWidth - button.offsetWidth) / 2);
- if (typeof chapterList.scrollTo === 'function') chapterList.scrollTo({ left: target, behavior: 'auto' });
- else chapterList.scrollLeft = target;
- return true;
- }
-
- function focusChapterButton(index) {
- if (!chapterButtons.length) return false;
- index = Math.max(0, Math.min(chapterButtons.length - 1, index));
- chapterButtons.forEach(function (button, buttonIndex) {
- button.setAttribute('tabindex', buttonIndex === index ? '0' : '-1');
- });
- chapterButtons[index].focus();
- centerChapterButton(chapterButtons[index]);
- return true;
- }
-
- function buildChapterIndex() {
- chapterButtons = [];
- chapterList.textContent = '';
- views.forEach(function (view, index) {
- var item = document.createElement('li');
- var button = document.createElement('button');
- button.type = 'button';
- button.className = 'guided-view-chapter';
- button.setAttribute('data-guided-view-id', view.id);
- button.setAttribute('aria-pressed', 'false');
- button.setAttribute('tabindex', index === 0 ? '0' : '-1');
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.open', {
- index: index + 1,
- total: views.length,
- label: view.label,
- count: view.focus.length
- }));
- button.title = view.label + ' — ' + (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }));
- var position = document.createElement('span');
- position.className = 'guided-view-chapter-index';
- position.setAttribute('aria-hidden', 'true');
- position.textContent = (index + 1 < 10 ? '0' : '') + (index + 1);
- var title = document.createElement('span');
- title.className = 'guided-view-chapter-title';
- title.textContent = view.label;
- var stops = document.createElement('em');
- stops.className = 'guided-view-chapter-count';
- stops.textContent = viewerCount('viewer.guided.chapter.stop', view.focus.length);
- var delta = document.createElement('span');
- delta.className = 'guided-view-chapter-delta';
- delta.hidden = true;
- delta.setAttribute('aria-hidden', 'true');
- ['stay', 'enter', 'leave'].forEach(function (kind) {
- var value = document.createElement('span');
- value.setAttribute('data-delta-kind', kind);
- delta.appendChild(value);
- });
- button.appendChild(position);
- button.appendChild(title);
- button.appendChild(stops);
- button.appendChild(delta);
- item.appendChild(button);
- chapterList.appendChild(item);
- chapterButtons.push(button);
- });
- }
-
- function syncChapterIndex() {
- chapterButtons.forEach(function (button, index) {
- var current = index === activeIndex;
- var stops = button.querySelector('.guided-view-chapter-count');
- var deltaLabel = button.querySelector('.guided-view-chapter-delta');
- var position = activeIndex < 0 ? 'available' : (current ? 'current' : (index < activeIndex ? 'before' : 'after'));
- button.setAttribute('data-chapter-position', position);
- button.setAttribute('aria-pressed', current ? 'true' : 'false');
- button.setAttribute('tabindex', current || (activeIndex < 0 && index === 0) ? '0' : '-1');
- if (current) {
- stops.hidden = false;
- deltaLabel.hidden = true;
- button.removeAttribute('data-chapter-delta');
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.current', {
- index: index + 1,
- total: views.length,
- label: views[index].label,
- count: views[index].focus.length
- }));
- button.title = viewerText('viewer.guided.chapter.current.title', {
- label: views[index].label,
- count: views[index].focus.length
- });
- } else {
- var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- var compact = '=' + delta.stay.length + ' +' + delta.enter.length + ' \u2212' + delta.leave.length;
- var expanded = viewerText('viewer.guided.chapter.delta.expanded', {
- stay: delta.stay.length,
- enter: delta.enter.length,
- leave: delta.leave.length
- });
- stops.hidden = true;
- deltaLabel.hidden = false;
- deltaLabel.querySelector('[data-delta-kind="stay"]').textContent = '=' + delta.stay.length;
- deltaLabel.querySelector('[data-delta-kind="enter"]').textContent = '+' + delta.enter.length;
- deltaLabel.querySelector('[data-delta-kind="leave"]').textContent = '\u2212' + delta.leave.length;
- button.setAttribute('data-chapter-delta', compact);
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.delta.aria', {
- index: index + 1,
- total: views.length,
- label: views[index].label,
- delta: expanded
- }));
- button.title = viewerText('viewer.guided.chapter.delta.title', {
- label: views[index].label,
- delta: compact
- });
- }
- if (current) button.setAttribute('aria-current', 'step');
- else button.removeAttribute('aria-current');
- if (button.parentElement) button.parentElement.setAttribute('data-chapter-position', position);
- });
- if (activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);
- }
-
- function chapterPreviewBlocked() {
- if (document.hidden || playing || currentHandoff) return true;
- if (document.documentElement.getAttribute('data-embed') === 'true') return true;
- if (window.matchMedia && window.matchMedia('print').matches) return true;
- if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return true;
- if (svg.hasAttribute('data-lens-active') || svg.hasAttribute('data-legend-preview-active')) return true;
- if (svg.hasAttribute('data-relationship-preview-active') || svg.hasAttribute('data-intent-trace-active')) return true;
- return activeIndex < 0 && svg.hasAttribute('data-focus-active');
- }
-
- function clearChapterPreviewPresentation() {
- svg.removeAttribute('data-chapter-preview');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-preview-role]'), function (node) {
- node.removeAttribute('data-chapter-preview-role');
- });
- chapterButtons.forEach(function (button) { button.removeAttribute('data-preview-active'); });
- activePreviewIndex = -1;
- if (previewOwnerToken && Archify.motionGovernor) {
- var token = previewOwnerToken;
- previewOwnerToken = 0;
- Archify.motionGovernor.release(token);
- }
- }
-
- function clearChapterPreview(options) {
- options = options || {};
- previewGeneration += 1;
- if (options.clearIntents !== false) {
- pointerPreviewIntent = null;
- focusPreviewIntent = null;
- }
- clearChapterPreviewPresentation();
- return true;
- }
-
- function winningChapterPreviewIntent() {
- return [pointerPreviewIntent, focusPreviewIntent].filter(function (intent) {
- return intent && intent.index >= 0 && intent.index < views.length && intent.index !== activeIndex;
- }).sort(function (left, right) { return right.generation - left.generation; })[0] || null;
- }
-
- function showChapterPreview(index) {
- if (index < 0 || index >= views.length || index === activeIndex || chapterPreviewBlocked()) {
- clearChapterPreviewPresentation();
- return false;
- }
- if (activePreviewIndex === index && svg.getAttribute('data-chapter-preview') === views[index].id) return true;
- clearChapterPreviewPresentation();
- var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- var roles = {};
- delta.stay.forEach(function (id) { roles[id] = 'stay'; });
- delta.enter.forEach(function (id) { roles[id] = 'enter'; });
- delta.leave.forEach(function (id) { roles[id] = 'leave'; });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- var role = roles[node.getAttribute('data-node-id')];
- if (role) node.setAttribute('data-chapter-preview-role', role);
- });
- svg.setAttribute('data-chapter-preview', views[index].id);
- chapterButtons[index].setAttribute('data-preview-active', 'true');
- activePreviewIndex = index;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) {
- previewOwnerToken = Archify.motionGovernor.claim('chapter-preview', function () {
- previewOwnerToken = 0;
- clearChapterPreviewPresentation();
- });
- }
- return true;
- }
-
- function syncChapterPreview() {
- var intent = winningChapterPreviewIntent();
- if (!intent || chapterPreviewBlocked()) {
- clearChapterPreviewPresentation();
- return false;
- }
- return showChapterPreview(intent.index);
- }
-
- function setChapterPreviewIntent(source, index) {
- var intent = { index: index, generation: ++previewGeneration };
- if (source === 'pointer') pointerPreviewIntent = intent;
- else focusPreviewIntent = intent;
- if (playing) pausePlayback();
- return syncChapterPreview();
- }
-
- function clearChapterPreviewIntent(source, index) {
- var intent = source === 'pointer' ? pointerPreviewIntent : focusPreviewIntent;
- if (intent && (typeof index !== 'number' || intent.index === index)) {
- if (source === 'pointer') pointerPreviewIntent = null;
- else focusPreviewIntent = null;
- previewGeneration += 1;
- }
- return syncChapterPreview();
- }
-
- function hoverCapable() {
- return !!(window.matchMedia && window.matchMedia('(hover: hover)').matches);
- }
-
- function sharePlaybackRequested() {
- try { return new URLSearchParams(location.search).get('play') === '1'; }
- catch (_) { return false; }
- }
-
- autoplayPending = sharePlaybackRequested();
- if (autoplayPending) {
- document.documentElement.setAttribute('data-share-playback', 'true');
- setAutoplayState('pending');
- }
-
- function setAutoplayState(state) {
- if (state) panel.setAttribute('data-autoplay', state);
- else panel.removeAttribute('data-autoplay');
- renderShareCue();
- }
-
- function shareCueStatus(state) {
- return {
- pending: viewerText('viewer.guided.state.ready'),
- playing: viewerText('viewer.guided.state.playing'),
- complete: viewerText('viewer.guided.state.settled'),
- interrupted: viewerText('viewer.guided.state.paused'),
- pinned: viewerText('viewer.guided.state.pinned'),
- 'reduced-motion': viewerText('viewer.guided.state.still')
- }[state] || viewerText('viewer.guided.state.ready');
- }
-
- function shareCueBeatCopy(state, view, stops) {
- var total = stops.length;
- var activeStop = storyBeatIndex >= 0 ? stops[storyBeatIndex] : null;
- if ((state === 'playing' || state === 'interrupted') && activeStop) {
- return viewerText('viewer.guided.share.step', {
- index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),
- total: (total < 10 ? '0' : '') + total,
- label: activeStop.textContent
- });
- }
- if (state === 'pinned' && activeStop) {
- return storyBeatCopy(storySteps[storyBeatIndex], total);
- }
- if (state === 'reduced-motion' && activeStop && hashBeatMatchesCurrent()) {
- return viewerText('viewer.guided.share.staticMoment', {
- step: viewerText('viewer.guided.share.step', {
- index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),
- total: (total < 10 ? '0' : '') + total,
- label: activeStop.textContent
- })
- });
- }
- if (state === 'complete') return viewerText('viewer.guided.share.complete', {
- count: total,
- note: view.note || viewerText('viewer.guided.share.settled')
- });
- if (state === 'reduced-motion') return viewerText('viewer.guided.share.staticPath', { count: total });
- if (state === 'pending') return viewerText('viewer.guided.share.ready', { count: total });
- return view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length });
- }
-
- function renderShareCue() {
- if (!shareCue) return;
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var shareMode = document.documentElement.getAttribute('data-share-playback') === 'true';
- var embedMode = document.documentElement.getAttribute('data-embed') === 'true';
- var pinnedMode = !shareMode && embedMode && hashBeatMatchesCurrent();
- if (pinnedMode) document.documentElement.setAttribute('data-share-moment', 'true');
- else document.documentElement.removeAttribute('data-share-moment');
- shareCue.hidden = !(embedMode && view && (shareMode || pinnedMode));
- if (shareCue.hidden) return;
- var state = pinnedMode ? 'pinned' : (panel.getAttribute('data-autoplay') || 'pending');
- var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));
- var route = stops.map(function (stop, index) {
- if (index === 0) return stop.textContent;
- var kind = stop.getAttribute('data-story-link');
- var separator = kind === 'forward' ? '\u2192' : (kind === 'reverse' ? '\u2190' : (kind === 'multiple' ? '\u21c4' : '\u00b7'));
- return separator + ' ' + stop.textContent;
- }).join(' ');
- var beatCopy = shareCueBeatCopy(state, view, stops);
- shareCue.setAttribute('data-state', state);
- shareCue.setAttribute('aria-live', state === 'playing' ? 'off' : 'polite');
- shareCueState.textContent = shareCueStatus(state);
- shareCueCount.textContent = viewerText('viewer.guided.share.chapter', {
- index: (activeIndex + 1 < 10 ? '0' : '') + (activeIndex + 1),
- total: (views.length < 10 ? '0' : '') + views.length
- });
- shareCueLabel.textContent = view.label;
- shareCueNote.textContent = beatCopy;
- shareCueRoute.textContent = route;
- shareCue.setAttribute('aria-label', viewerText('viewer.guided.share.aria', {
- state: shareCueStatus(state),
- index: activeIndex + 1,
- total: views.length,
- label: view.label,
- beat: beatCopy,
- route: route
- }));
- }
-
- function setShareCueProgress(fraction) {
- if (!shareCueProgress) return;
- shareCueProgress.style.animation = 'none';
- shareCueProgress.style.setProperty('--guided-progress-start', String(Math.max(0, Math.min(1, fraction))));
- shareCueProgress.style.transform = 'scaleX(' + Math.max(0, Math.min(1, fraction)) + ')';
- }
-
- function startShareCueProgress(fraction, duration) {
- if (!shareCueProgress) return;
- setShareCueProgress(fraction || 0);
- void shareCueProgress.offsetWidth;
- shareCueProgress.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';
- }
-
- function storyNodeLabel(node, fallback) {
- if (!node) return fallback;
- return node.getAttribute('data-node-label') ||
- (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');
- }
-
- function storyEdgeKey(edge) {
- return edge.getAttribute('data-edge-key') || (
- edge.getAttribute('data-edge-from') + '\u0000' +
- edge.getAttribute('data-edge-to') + '\u0000' +
- (edge.getAttribute('data-edge-label') || '')
- );
- }
-
- function uniqueStoryEdges(edgeList) {
- var positions = {};
- var unique = [];
- edgeList.forEach(function (edge) {
- var key = storyEdgeKey(edge);
- if (!Object.prototype.hasOwnProperty.call(positions, key)) {
- positions[key] = unique.length;
- unique.push(edge);
- return;
- }
- var index = positions[key];
- if (!storyGeometry(unique[index]).length && storyGeometry(edge).length) unique[index] = edge;
- });
- return unique;
- }
-
- function storyStep(view, index, edgeList, byId) {
- var id = view.focus[index];
- var node = byId[id];
- var previousId = index > 0 ? view.focus[index - 1] : '';
- var forward = [];
- var reverse = [];
- if (previousId) {
- edgeList.forEach(function (edge) {
- var from = edge.getAttribute('data-edge-from');
- var to = edge.getAttribute('data-edge-to');
- if (from === previousId && to === id) forward.push(edge);
- else if (from === id && to === previousId) reverse.push(edge);
- });
- }
- forward = uniqueStoryEdges(forward);
- reverse = uniqueStoryEdges(reverse);
- var edges = forward.concat(reverse).sort(function (left, right) {
- return edgeList.indexOf(left) - edgeList.indexOf(right);
- });
- var relation = index === 0 ? 'start' : (!edges.length ? 'group' : (
- edges.length === 1 && forward.length === 1 ? 'forward' :
- (edges.length === 1 && reverse.length === 1 ? 'reverse' : 'multiple')
- ));
- return {
- index: index,
- nodeId: id,
- nodeLabel: storyNodeLabel(byId[id], id),
- previousId: previousId,
- previousLabel: previousId ? storyNodeLabel(byId[previousId], previousId) : '',
- relation: relation,
- edges: edges,
- edgeKeys: edges.map(storyEdgeKey),
- edgeLabels: edges.map(function (edge) { return edge.getAttribute('data-edge-label') || ''; }).filter(function (value, edgeIndex, values) {
- return value && values.indexOf(value) === edgeIndex;
- }),
- responsibility: node ? (node.getAttribute('data-node-sublabel') || '') : '',
- context: node ? (node.getAttribute('data-node-context') || '') : ''
- };
- }
-
- function storyBeatCopy(step, total) {
- if (!step) return '';
- var position = (step.index + 1 < 10 ? '0' : '') + (step.index + 1);
- var countValue = (total < 10 ? '0' : '') + total;
- if (step.relation === 'start') return viewerText('viewer.guided.beat.start', { index: position, total: countValue, label: step.nodeLabel });
- if (step.relation === 'forward') return viewerText('viewer.guided.beat.forward', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });
- if (step.relation === 'reverse') return viewerText('viewer.guided.beat.reverse', { index: position, total: countValue, from: step.nodeLabel, to: step.previousLabel });
- if (step.relation === 'multiple') return viewerText('viewer.guided.beat.multiple', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel, count: step.edges.length });
- return viewerText('viewer.guided.beat.group', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });
- }
-
- function storyBeatAria(step, total) {
- var prefix = viewerText('viewer.guided.beat.aria.prefix', { index: step.index + 1, total: total, label: step.nodeLabel });
- if (step.relation === 'start') return prefix + viewerText('viewer.guided.beat.aria.start');
- if (step.relation === 'forward') return prefix + viewerText('viewer.guided.beat.aria.forward', { from: step.previousLabel });
- if (step.relation === 'reverse') return prefix + viewerText('viewer.guided.beat.aria.reverse', { from: step.previousLabel, to: step.nodeLabel });
- if (step.relation === 'multiple') return prefix + viewerText('viewer.guided.beat.aria.multiple', { from: step.previousLabel, count: step.edges.length });
- return prefix + viewerText('viewer.guided.beat.aria.group', { from: step.previousLabel });
- }
-
- function storyCaptionRouteCopy(step) {
- if (step.relation === 'start') return step.nodeLabel + ' · ' + viewerText('viewer.guided.caption.start');
- if (step.relation === 'reverse') return step.previousLabel + ' ← ' + step.nodeLabel;
- if (step.relation === 'multiple') return step.previousLabel + ' ⇄ ' + step.nodeLabel;
- if (step.relation === 'group') return step.previousLabel + ' · ' + step.nodeLabel;
- return step.previousLabel + ' → ' + step.nodeLabel;
- }
-
- function storyCaptionDetailCopy(step) {
- var facts = [];
- if (step.relation === 'group') facts.push(viewerText('viewer.guided.caption.grouped'));
- else if (step.edgeLabels.length) facts.push(step.edgeLabels.slice(0, 3).join(' + ') + (step.edgeLabels.length > 3 ? viewerText('viewer.guided.caption.more', { count: step.edgeLabels.length - 3 }) : ''));
- else if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.reverse'));
- else if (step.relation === 'multiple') facts.push(viewerText('viewer.guided.caption.relationships', { count: step.edges.length }));
- else if (step.relation !== 'start') facts.push(viewerText('viewer.guided.caption.relationship'));
- if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.direction', { from: step.nodeLabel, to: step.previousLabel }));
- if (step.responsibility) facts.push(step.responsibility);
- if (step.context) facts.push(step.context);
- if (!facts.length) facts.push(viewerText('viewer.guided.caption.starting'));
- return facts.join(' · ');
- }
-
- function renderStoryCaption(step, total, nextStep) {
- if (!storyCaption) return;
- if (!step) {
- storyCaption.hidden = true;
- storyCaption.removeAttribute('data-story-caption');
- storyCaptionNext.hidden = true;
- storyCaptionNextLabel.textContent = '';
- return;
- }
- storyCaption.hidden = false;
- storyCaption.setAttribute('data-story-caption', step.relation);
- storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');
- storyCaptionIndex.textContent = (step.index + 1 < 10 ? '0' : '') + (step.index + 1) + ' / ' + (total < 10 ? '0' : '') + total;
- storyCaptionRoute.textContent = storyCaptionRouteCopy(step);
- storyCaptionDetail.textContent = storyCaptionDetailCopy(step);
- storyCaptionNext.hidden = !nextStep;
- storyCaptionNextLabel.textContent = nextStep
- ? ((nextStep.index + 1 < 10 ? '0' : '') + (nextStep.index + 1) + ' · ' + nextStep.nodeLabel)
- : '';
- storyCaption.style.animation = 'none';
- void storyCaption.offsetWidth;
- storyCaption.style.removeProperty('animation');
- }
-
- function storyMomentLink() {
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- if (!view || !step) return '';
- var url = new URL(location.href);
- url.searchParams.delete('play');
- url.hash = 'view=' + encodeURIComponent(view.id) + '&beat=' + encodeURIComponent(step.nodeId);
- return url.href;
- }
-
- function fallbackCopyStoryMoment(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
- function resetBeatLinkFeedback() {
- if (beatLinkFeedbackTimer) clearTimeout(beatLinkFeedbackTimer);
- beatLinkFeedbackTimer = null;
- beatLink.removeAttribute('data-copy-state');
- beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');
- }
-
- function syncBeatLink() {
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- var available = !!(activeIndex >= 0 && step && !currentHandoff);
- beatLink.disabled = !available;
- if (!beatLink.hasAttribute('data-copy-state')) beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');
- var description = available
- ? viewerText('viewer.guided.beatLink', { index: step.index + 1, total: storySteps.length, label: step.nodeLabel })
- : viewerText('viewer.guided.selectBeatLink');
- beatLink.setAttribute('aria-label', description);
- beatLink.title = description;
- }
-
- function setBeatLinkFeedback(copied) {
- resetBeatLinkFeedback();
- beatLink.setAttribute('data-copy-state', copied ? 'copied' : 'failed');
- beatLinkLabel.textContent = viewerText(copied ? 'viewer.guided.copied' : 'viewer.guided.copyFailed');
- beatLink.setAttribute('aria-label', viewerText(copied ? 'viewer.guided.momentCopied' : 'viewer.guided.momentCopyFailed'));
- beatLinkFeedbackTimer = setTimeout(function () {
- resetBeatLinkFeedback();
- syncBeatLink();
- }, 1600);
- }
-
- function copyStoryMomentLink() {
- if (playing) pausePlayback();
- var value = storyMomentLink();
- if (!value) return Promise.resolve(false);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopyStoryMoment(value); })
- : Promise.resolve(fallbackCopyStoryMoment(value));
- return copy.then(function (copied) {
- setBeatLinkFeedback(copied);
- return copied;
- });
- }
-
- function hashBeatMatchesCurrent() {
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- if (!view || !step) return false;
- try {
- var params = new URLSearchParams(location.hash.replace(/^#/, ''));
- return params.get('view') === view.id && params.get('beat') === step.nodeId;
- } catch (_) { return false; }
- }
-
- function storyMotionAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (document.documentElement.getAttribute('data-motion') !== 'live') return false;
- if (document.documentElement.getAttribute('data-embed') === 'true' &&
- document.documentElement.getAttribute('data-share-playback') !== 'true') return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- return !(Archify.motionGovernor && Archify.motionGovernor.isPaused());
- }
-
- function storyAutomaticPlaybackAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) return !Archify.motionGovernor.isPaused();
- return true;
- }
-
- function clearStoryPulse(options) {
- options = options || {};
- storyPulseGeneration += 1;
- Array.prototype.forEach.call(svg.querySelectorAll('.story-trail-flow[data-story-pulse]'), function (flow) {
- flow.removeAttribute('data-story-pulse');
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-carrier-overlay]'), function (overlay) {
- overlay.remove();
- });
- if (storyPulseOwnerToken && options.release !== false && Archify.motionGovernor) {
- var token = storyPulseOwnerToken;
- storyPulseOwnerToken = 0;
- Archify.motionGovernor.release(token);
- } else if (options.release === false) storyPulseOwnerToken = 0;
- }
-
- function pulseStoryStep(step) {
- clearStoryPulse();
- if (!step || (step.relation !== 'forward' && step.relation !== 'reverse') || step.edges.length !== 1 || !storyMotionAllowed()) return false;
- var flows = Array.prototype.slice.call(svg.querySelectorAll('.story-trail-flow[data-story-beat-step="' + step.index + '"]'));
- if (!flows.length) return false;
- var pulseGeneration = storyPulseGeneration;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) {
- storyPulseOwnerToken = Archify.motionGovernor.claim('story', function () {
- clearStoryPulse({ release: false });
- });
- }
- flows.forEach(function (flow) { flow.setAttribute('data-story-pulse', 'true'); });
- if (Archify.flowTokens && typeof Archify.flowTokens.create === 'function') {
- var edge = step.edges[0];
- var shapes = storyGeometry(edge);
- var carrier = shapes.length ? Archify.flowTokens.create(edge, shapes[0], {
- className: 'story-flow-token',
- duration: '0.78s'
- }) : null;
- if (carrier) {
- var carrierOverlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- var carrierWrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- carrierOverlay.setAttribute('class', 'story-carrier-overlay');
- carrierOverlay.setAttribute('data-story-carrier-overlay', '');
- carrierOverlay.setAttribute('aria-hidden', 'true');
- if (edge.hasAttribute('transform')) carrierWrapper.setAttribute('transform', edge.getAttribute('transform'));
- carrier.setAttribute('data-story-carrier-token', '');
- carrier.setAttribute('data-story-beat-step', String(step.index));
- carrierWrapper.appendChild(carrier);
- carrierOverlay.appendChild(carrierWrapper);
- var firstNode = svg.querySelector('[data-node-id]');
- while (firstNode && firstNode.parentNode !== svg) firstNode = firstNode.parentNode;
- if (firstNode) svg.insertBefore(carrierOverlay, firstNode);
- else svg.appendChild(carrierOverlay);
- }
- }
- void flows[0].getBoundingClientRect();
- flows[0].addEventListener('animationend', function () {
- if (pulseGeneration === storyPulseGeneration) clearStoryPulse();
- }, { once: true });
- return true;
- }
-
- function stopStoryBeatTimer(options) {
- options = options || {};
- storyPlaybackGeneration += 1;
- if (storyBeatTimer && options.preserveElapsed === true && storyBeatStartedAt) {
- storyBeatElapsedMs = Math.min(storyBeatDwellMs, storyBeatElapsedMs + Math.max(0, Date.now() - storyBeatStartedAt));
- }
- if (storyBeatTimer) clearTimeout(storyBeatTimer);
- storyBeatTimer = null;
- storyBeatStartedAt = 0;
- }
-
- function centerStoryStop(stop) {
- if (!stop || !trail) return false;
- var bounds = stop.getBoundingClientRect();
- var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;
- var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);
- trail.scrollLeft = target;
- return true;
- }
-
- function storyBeatDwell(total) {
- return Math.max(STORY_FOLLOW_MIN_DWELL_MS, VIEW_INTERVAL_MS / Math.max(1, total));
- }
-
- function clearStoryFollow() {
- storyFollowGeneration += 1;
- svg.removeAttribute('data-story-follow');
- panel.removeAttribute('data-story-follow');
- panel.removeAttribute('data-story-follow-node');
- }
-
- function storyFrameIds(step) {
- if (!step) return [];
- var ids = [];
- if (step.index > 0 && storySteps[step.index - 1]) ids.push(storySteps[step.index - 1].nodeId);
- ids.push(step.nodeId);
- if (step.index + 1 < storySteps.length) ids.push(storySteps[step.index + 1].nodeId);
- return ids;
- }
-
- function followStoryStep(step, options) {
- options = options || {};
- if (!step || document.hidden) return false;
- if (!Archify.view || typeof Archify.view.reveal !== 'function') {
- var deferredIndex = step.index;
- var deferredGeneration = ++storyFollowGeneration;
- requestAnimationFrame(function () {
- if (deferredGeneration !== storyFollowGeneration || storyBeatIndex !== deferredIndex) return;
- if (Archify.view && typeof Archify.view.reveal === 'function') followStoryStep(step, options);
- });
- return true;
- }
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- var embed = document.documentElement.getAttribute('data-embed') === 'true';
- var explicitEmbedPlayback = document.documentElement.getAttribute('data-share-playback') === 'true';
- if (embed && !explicitEmbedPlayback && options.linked !== true) return false;
- var ids = storyFrameIds(step);
- var generation = ++storyFollowGeneration;
- svg.setAttribute('data-story-follow', step.nodeId);
- panel.setAttribute('data-story-follow', 'moving');
- panel.setAttribute('data-story-follow-node', step.nodeId);
- var receipt = Archify.view.reveal(ids, {
- reason: options.manual === true ? 'story-beat' : 'story-follow',
- padding: 64,
- maxScale: 1.65,
- duration: STORY_FOLLOW_DURATION_MS,
- instant: options.instant === true || reducedMotion() || document.documentElement.getAttribute('data-motion') !== 'live'
- });
- if (receipt && receipt.finished && typeof receipt.finished.then === 'function') {
- receipt.finished.then(function (result) {
- if (generation !== storyFollowGeneration || storyBeatIndex !== step.index) return;
- svg.removeAttribute('data-story-follow');
- panel.setAttribute('data-story-follow', result && result.state === 'complete' ? 'settled' : 'interrupted');
- });
- } else if (generation === storyFollowGeneration) {
- panel.setAttribute('data-story-follow', 'settled');
- }
- return receipt;
- }
-
- function setStoryBeat(index, options) {
- options = options || {};
- var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));
- if (!stops.length) return false;
- resetBeatLinkFeedback();
- storyBeatIndex = Math.max(0, Math.min(stops.length - 1, index));
- var nextStep = storyBeatIndex + 1 < storySteps.length ? storySteps[storyBeatIndex + 1] : null;
- svg.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);
- panel.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);
- if (nextStep) {
- svg.setAttribute('data-story-next', nextStep.nodeId);
- panel.setAttribute('data-story-next', nextStep.nodeId);
- } else {
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-next');
- }
- function storyBeatState(step) {
- if (step < storyBeatIndex) return 'past';
- if (step === storyBeatIndex) return 'active';
- if (step === storyBeatIndex + 1) return 'next';
- return 'pending';
- }
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step]'), function (node) {
- var step = Number(node.getAttribute('data-story-step'));
- node.setAttribute('data-story-beat-state', storyBeatState(step));
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-step]'), function (edge) {
- var step = Number(edge.getAttribute('data-story-beat-step'));
- edge.setAttribute('data-story-beat-state', storyBeatState(step));
- });
- stops.forEach(function (stop, step) {
- stop.setAttribute('data-story-beat-state', storyBeatState(step));
- if (step === storyBeatIndex) stop.setAttribute('aria-current', 'step');
- else stop.removeAttribute('aria-current');
- });
- note.setAttribute('aria-live', 'off');
- note.textContent = storyBeatCopy(storySteps[storyBeatIndex], stops.length);
- renderStoryCaption(storySteps[storyBeatIndex], stops.length, nextStep);
- if (options.center === true) centerStoryStop(stops[storyBeatIndex]);
- if (options.pulse === true) pulseStoryStep(storySteps[storyBeatIndex]);
- else clearStoryPulse();
- if (options.follow === true) followStoryStep(storySteps[storyBeatIndex], {
- manual: options.manual === true,
- linked: options.linked === true,
- instant: options.followInstant === true
- });
- renderShareCue();
- syncBeatLink();
- return true;
- }
-
- function settleStoryBeats() {
- stopStoryBeatTimer();
- clearStoryPulse();
- clearStoryFollow();
- resetBeatLinkFeedback();
- storyBeatIndex = -1;
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = 0;
- svg.removeAttribute('data-story-beat');
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-beat');
- panel.removeAttribute('data-story-next');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-state]'), function (el) {
- el.removeAttribute('data-story-beat-state');
- });
- Array.prototype.forEach.call(trail.querySelectorAll('[data-story-beat-state]'), function (stop) {
- stop.removeAttribute('data-story-beat-state');
- stop.removeAttribute('aria-current');
- });
- note.setAttribute('aria-live', 'polite');
- if (activeIndex >= 0) note.textContent = views[activeIndex].note || viewerText('viewer.guided.chapter.selectedNodes', { count: views[activeIndex].focus.length });
- renderStoryCaption(null, 0);
- renderShareCue();
- syncBeatLink();
- }
-
- function clearStoryTrail() {
- stopStoryBeatTimer();
- clearStoryPulse();
- clearStoryFollow();
- resetBeatLinkFeedback();
- storyBeatIndex = -1;
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = 0;
- storySteps = [];
- svg.removeAttribute('data-story-active');
- svg.removeAttribute('data-story-playing');
- svg.removeAttribute('data-story-beat');
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-beat');
- panel.removeAttribute('data-story-next');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-overlay]'), function (overlay) {
- overlay.remove();
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step], [data-story-beat-state]'), function (node) {
- node.removeAttribute('data-story-step');
- node.removeAttribute('data-story-beat-state');
- node.style.removeProperty('--story-step');
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-story-beat-step]'), function (edge) {
- edge.removeAttribute('data-story-beat-step');
- edge.removeAttribute('data-story-beat-state');
- });
- trail.textContent = '';
- trail.hidden = true;
- trail.removeAttribute('aria-label');
- renderStoryCaption(null, 0);
- syncBeatLink();
- }
-
- function storyGeometry(edge) {
- if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];
- return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));
- }
-
- function renderStoryTrail(view) {
- if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
- clearStoryTrail();
- if (!view) return;
-
- var nodeList = Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));
- var edgeList = Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));
- var byId = {};
- nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
- storySteps = view.focus.map(function (_, index) { return storyStep(view, index, edgeList, byId); });
- var labels = [];
- storySteps.forEach(function (step, index) {
- var id = step.nodeId;
- var node = byId[id];
- if (!node) return;
- node.setAttribute('data-story-step', String(index));
- node.style.setProperty('--story-step', String(index));
- var nodeLabel = step.nodeLabel;
- labels.push(nodeLabel);
- var stop = document.createElement('button');
- stop.type = 'button';
- stop.className = 'guided-view-stop';
- stop.setAttribute('data-story-node', id);
- stop.setAttribute('data-story-index', String(index));
- stop.setAttribute('data-story-relation', step.relation);
- stop.setAttribute('data-story-number', (index + 1 < 10 ? '0' : '') + (index + 1));
- if (index > 0) stop.setAttribute('data-story-link', step.relation);
- stop.style.setProperty('--story-step', String(index));
- stop.setAttribute('aria-label', storyBeatAria(step, storySteps.length));
- stop.title = storyBeatCopy(step, storySteps.length);
- stop.textContent = nodeLabel;
- trail.appendChild(stop);
- });
- trail.hidden = labels.length === 0;
- trail.setAttribute('aria-label', viewerText('viewer.guided.storyTrail', { label: view.label, count: labels.length }));
- trail.scrollLeft = 0;
- svg.setAttribute('data-story-active', view.id);
-
- var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- overlay.setAttribute('class', 'story-trail-overlay');
- overlay.setAttribute('data-story-overlay', '');
- overlay.setAttribute('aria-hidden', 'true');
- var copied = 0;
- storySteps.forEach(function (step) {
- step.edges.forEach(function (edge) {
- var edgeBeat = step.index;
- edge.setAttribute('data-story-beat-step', String(edgeBeat));
- var wrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
- storyGeometry(edge).forEach(function (shape) {
- var clone = shape.cloneNode(false);
- clone.removeAttribute('id');
- clone.removeAttribute('marker-start');
- clone.removeAttribute('marker-mid');
- clone.removeAttribute('marker-end');
- clone.removeAttribute('aria-label');
- clone.removeAttribute('role');
- clone.removeAttribute('data-animate');
- clone.removeAttribute('data-edge-from');
- clone.removeAttribute('data-edge-to');
- clone.removeAttribute('data-edge-key');
- clone.removeAttribute('data-edge-id');
- clone.removeAttribute('data-edge-label');
- clone.setAttribute('class', 'story-trail-flow');
- clone.setAttribute('data-story-beat-step', String(edgeBeat));
- clone.style.setProperty('--story-step', String(edgeBeat));
- wrapper.appendChild(clone);
- copied += 1;
- });
- if (wrapper.childNodes.length) overlay.appendChild(wrapper);
+ }
+ related[from] = true;
+ related[to] = true;
+ edge.setAttribute('data-intent-trace-match', '');
+ var wrapper = document.createElementNS(namespace, 'g');
+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
+ edgeShapes(edge).forEach(function (shape) {
+ wrapper.appendChild(traceGeometry(shape, direction));
});
+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);
+ });
+
+ nodeList.forEach(function (node) {
+ var nodeId = node.getAttribute('data-node-id');
+ if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
+ if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
});
- if (copied) {
+ if (overlay.childNodes.length) {
var firstEdge = edgeList[0];
+ var firstNode = svg.querySelector('[data-node-id]');
if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
- else svg.insertBefore(overlay, svg.firstChild);
- }
- }
-
- function syncStoryPlayback() {
- var shouldPlay = playing && activeIndex >= 0;
- if (shouldPlay && svg.getAttribute('data-story-playing') !== 'true') svg.setAttribute('data-story-playing', 'true');
- else if (!shouldPlay && svg.hasAttribute('data-story-playing')) svg.removeAttribute('data-story-playing');
- }
-
- function resetProgress(fraction) {
- fraction = Math.max(0, Math.min(1, Number(fraction) || 0));
- progressBar.style.animation = 'none';
- progressBar.style.setProperty('--guided-progress-start', String(fraction));
- progressBar.style.transform = 'scaleX(' + fraction + ')';
- }
-
- function startProgress(fraction, duration) {
- resetProgress(fraction);
- void progressBar.offsetWidth;
- progressBar.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';
- }
-
- function currentStoryProgress() {
- var total = storySteps.length;
- if (!total || storyBeatIndex < 0) return 0;
- var elapsed = storyBeatElapsedMs;
- if (playing && storyBeatTimer && storyBeatStartedAt) elapsed += Math.max(0, Date.now() - storyBeatStartedAt);
- var dwell = storyBeatDwellMs || storyBeatDwell(total);
- return Math.max(0, Math.min(1, (storyBeatIndex + Math.min(1, elapsed / dwell)) / total));
- }
-
- function renderPlayback() {
- var automaticPlaybackAllowed = storyAutomaticPlaybackAllowed();
- panel.setAttribute('data-playing', playing ? 'true' : 'false');
- syncStoryPlayback();
- play.disabled = !playing && !automaticPlaybackAllowed;
- play.setAttribute('aria-pressed', playing ? 'true' : 'false');
- play.setAttribute('aria-label', viewerText(playing
- ? 'viewer.guided.pause'
- : !automaticPlaybackAllowed
- ? 'viewer.guided.motionUnavailable'
- : storyPlaybackComplete
- ? 'viewer.guided.replay'
- : 'viewer.guided.play'));
- play.title = viewerText(playing
- ? 'viewer.guided.pause.title'
- : !automaticPlaybackAllowed
- ? 'viewer.guided.enableMotion'
- : storyPlaybackComplete
- ? 'viewer.guided.replay.title'
- : 'viewer.guided.play.title');
- playIcon.textContent = playing ? '\u2016' : '\u25b6';
- playLabel.textContent = viewerText(playing
- ? 'viewer.guided.pauseStory'
- : storyPlaybackComplete
- ? 'viewer.guided.replayStory'
- : 'viewer.guided.playStory');
- if (storyCaption && !storyCaption.hidden) storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');
- }
-
- function render() {
- var view = views[activeIndex];
- count.textContent = activeIndex < 0 ? '0 / ' + views.length : (activeIndex + 1) + ' / ' + views.length;
- label.textContent = view ? view.label : viewerText('viewer.guided.explore');
- note.setAttribute('aria-live', storyBeatIndex >= 0 ? 'off' : 'polite');
- note.textContent = storyBeatIndex >= 0
- ? storyBeatCopy(storySteps[storyBeatIndex], storySteps.length)
- : (view
- ? (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }))
- : viewerText('viewer.guided.intro'));
- prev.disabled = activeIndex < 0;
- next.disabled = activeIndex >= views.length - 1;
- all.disabled = activeIndex < 0;
- panel.setAttribute('data-active-view', view ? view.id : 'all');
- syncChapterIndex();
- renderShareCue();
- renderPlayback();
- syncBeatLink();
- }
-
- function pausePlayback(options) {
- options = options || {};
- var progress = options.complete === true ? 1 : currentStoryProgress();
- if (panel.getAttribute('data-autoplay') === 'playing') {
- setShareCueProgress(progress);
- setAutoplayState(options.complete === true ? 'complete' : 'interrupted');
- }
- stopStoryBeatTimer({ preserveElapsed: options.complete !== true });
- clearStoryPulse();
- clearStoryFollow();
- playing = false;
- storyPlaybackComplete = options.complete === true;
- resetProgress(progress);
- renderPlayback();
- renderShareCue();
- }
-
- function finishStoryChapter() {
- if (!playing) return false;
- if (storyPlaybackScope === 'chapter') {
- pausePlayback({ complete: true });
- return true;
+ else if (firstNode) svg.insertBefore(overlay, firstNode);
+ else svg.appendChild(overlay);
}
- if (activeIndex < views.length - 1) {
- var destinationIndex = activeIndex + 1;
- activate(destinationIndex, { playback: true });
- afterHandoff(function () {
- if (!playing || activeIndex !== destinationIndex) return;
- storyBeatElapsedMs = 0;
- setStoryBeat(0, { pulse: true, follow: true });
- scheduleStoryPlayback();
+ activeId = id;
+ svg.setAttribute('data-intent-trace-active', id);
+ if (options.announce === true) {
+ var total = counts.out + counts.in + counts.loop;
+ status.textContent = viewerText('viewer.intent.summary', {
+ label: nodeLabel(selected, id),
+ out: counts.out,
+ in: counts.in,
+ loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
+ total: total
});
- return true;
- }
- pausePlayback({ complete: true });
- return true;
- }
-
- function scheduleStoryPlayback() {
- var total = storySteps.length;
- if (!playing || !total || reducedMotion()) {
- if (playing) pausePlayback();
- return false;
- }
- storyBeatDwellMs = storyBeatDwell(total);
- if (storyBeatIndex < 0) {
- storyBeatElapsedMs = 0;
- setStoryBeat(0, { pulse: true, follow: true });
- }
- storyBeatElapsedMs = Math.max(0, Math.min(storyBeatDwellMs, storyBeatElapsedMs));
- var remainingDwell = Math.max(1, storyBeatDwellMs - storyBeatElapsedMs);
- var progress = (storyBeatIndex + storyBeatElapsedMs / storyBeatDwellMs) / total;
- var remainingChapter = remainingDwell + Math.max(0, total - storyBeatIndex - 1) * storyBeatDwellMs;
- startProgress(progress, remainingChapter);
- if (panel.getAttribute('data-autoplay') === 'playing') startShareCueProgress(progress, remainingChapter);
- var generation = ++storyPlaybackGeneration;
- storyBeatStartedAt = Date.now();
- storyBeatTimer = setTimeout(function () {
- if (!playing || generation !== storyPlaybackGeneration) return;
- storyBeatTimer = null;
- storyBeatStartedAt = 0;
- storyBeatElapsedMs = 0;
- if (storyBeatIndex < total - 1) {
- setStoryBeat(storyBeatIndex + 1, { pulse: true, follow: true });
- scheduleStoryPlayback();
- } else finishStoryChapter();
- }, remainingDwell);
- return true;
- }
-
- function startPlayback() {
- if (!storyAutomaticPlaybackAllowed()) {
- renderPlayback();
- return false;
- }
- autoplayPending = false;
- setAutoplayState(null);
- setShareCueProgress(0);
- document.documentElement.removeAttribute('data-share-playback');
- storyPlaybackScope = 'story';
- if (storyPlaybackComplete) showAll({ updateUrl: false });
- storyPlaybackComplete = false;
- if (activeIndex < 0) activate(0, { playback: true });
- playing = true;
- renderPlayback();
- afterHandoff(function () {
- if (!playing) return;
- if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);
- scheduleStoryPlayback();
- });
- return true;
- }
-
- function startCurrentViewPlayback() {
- if (document.hidden) return false;
- autoplayPending = false;
- document.documentElement.setAttribute('data-share-playback', 'true');
- storyPlaybackScope = 'chapter';
- storyPlaybackComplete = false;
- if (activeIndex < 0) activate(0, { playback: true, updateUrl: false });
- if (!storyAutomaticPlaybackAllowed()) {
- var preserveMoment = hashBeatMatchesCurrent();
- setShareCueProgress(preserveMoment && storySteps.length ? (storyBeatIndex + 1) / storySteps.length : 1);
- setAutoplayState('reduced-motion');
- playing = false;
- if (preserveMoment) {
- clearStoryPulse();
- renderShareCue();
- } else settleStoryBeats();
- renderPlayback();
- return false;
}
- playing = true;
- setAutoplayState('playing');
- renderPlayback();
- afterHandoff(function () {
- if (!playing) return;
- if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);
- scheduleStoryPlayback();
- });
- return true;
- }
-
- function maybeStartSharePlayback() {
- if (!autoplayPending || document.hidden) return false;
- return startCurrentViewPlayback();
- }
-
- function togglePlayback() {
- return playing ? (pausePlayback(), false) : startPlayback();
- }
-
- function syncStoryControlsDisabled() {
- Array.prototype.forEach.call(trail.querySelectorAll('[data-story-node]'), function (stop) {
- stop.disabled = !!currentHandoff;
- });
- syncBeatLink();
- }
-
- function selectStoryBeat(index) {
- if (currentHandoff || activeIndex < 0 || index < 0 || index >= storySteps.length) return false;
- momentRestoreGeneration += 1;
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else {
- stopStoryBeatTimer();
- clearStoryPulse();
- }
- storyPlaybackComplete = false;
- storyPlaybackScope = 'story';
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = storyBeatDwell(storySteps.length);
- var view = views[activeIndex];
- Archify.focus.setMany(view.focus, {
- toggle: false,
- updateUrl: false,
- mode: 'selection',
- label: view.label,
- hideChip: true
- });
- setStoryBeat(index, { manual: true, center: true, pulse: true, follow: true });
- resetProgress(index / storySteps.length);
- renderPlayback();
- return true;
- }
-
- function selectStoryBeatById(id, options) {
- options = options || {};
- var index = storySteps.findIndex(function (step) { return step.nodeId === id; });
- if (index < 0) return false;
- if (playing) pausePlayback();
- else {
- stopStoryBeatTimer();
- clearStoryPulse();
- }
- storyPlaybackComplete = false;
- storyPlaybackScope = 'story';
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = storyBeatDwell(storySteps.length);
- setStoryBeat(index, {
- manual: false,
- center: true,
- pulse: false,
- follow: options.follow === true,
- linked: options.linked === true,
- followInstant: options.followInstant === true
- });
- resetProgress(index / storySteps.length);
- renderPlayback();
return true;
}
-
- function updateUrl(view) {
- try {
- history.replaceState(null, '', location.pathname + location.search + (view ? '#view=' + encodeURIComponent(view.id) : ''));
- } catch (_) {}
+ function schedule(node) {
+ if (enterTimer) window.clearTimeout(enterTimer);
+ enterTimer = window.setTimeout(function () {
+ enterTimer = null;
+ if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
+ }, reducedMotion() ? 0 : 90);
}
-
- function showAll(options) {
- options = options || {};
- if (options.restore !== true) momentRestoreGeneration += 1;
- clearChapterPreview({ clearIntents: true });
- if (playing && options.playback !== true) pausePlayback();
- if (options.playback !== true) storyPlaybackComplete = false;
- cancelHandoff('overview');
- activeIndex = -1;
- renderStoryTrail(null);
- if (options.clearFocus !== false) Archify.focus.clear({ updateUrl: false });
- if (options.resetView !== false && Archify.view && typeof Archify.view.reset === 'function') {
- Archify.view.reset({ automatic: true });
+ function sync() {
+ var candidate = focusedNode || hoveredNode;
+ if (!candidate) {
+ clear();
+ return;
}
- render();
- if (options.updateUrl !== false) updateUrl(null);
- }
-
- function activate(index, options) {
- options = options || {};
- if (options.restore !== true) momentRestoreGeneration += 1;
- if (playing && options.playback !== true) pausePlayback();
- if (options.playback !== true) storyPlaybackComplete = false;
- if (index < 0) { showAll(options); return true; }
- if (index >= views.length) return false;
- clearChapterPreview({ clearIntents: true });
- var previousIndex = activeIndex;
- var previous = previousIndex >= 0 ? views[previousIndex] : null;
- var outgoingBeatIndex = storyBeatIndex;
- cancelHandoff('replaced');
- activeIndex = index;
- var view = views[index];
- Archify.focus.setMany(view.focus, {
- toggle: false,
- updateUrl: false,
- mode: 'selection',
- label: view.label,
- hideChip: true
- });
- renderStoryTrail(view);
- beginHandoff(previousIndex, index, previous, view, outgoingBeatIndex, options.playback === true ? 'playback' : 'guided');
- syncStoryControlsDisabled();
- render();
- if (options.updateUrl !== false) updateUrl(view);
- return true;
- }
-
- function activateById(id, options) {
- var index = views.findIndex(function (view) { return view.id === id; });
- return index >= 0 && activate(index, options);
+ show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
}
- prev.addEventListener('click', function () { activate(activeIndex - 1); });
- next.addEventListener('click', function () { activate(activeIndex + 1); });
- all.addEventListener('click', function () { showAll(); });
- play.addEventListener('click', togglePlayback);
- beatLink.addEventListener('click', copyStoryMomentLink);
- trail.addEventListener('focusin', function (event) {
- if (!event.target.closest('[data-story-node]')) return;
- if (playing) pausePlayback();
- });
- trail.addEventListener('click', function (event) {
- var stop = event.target.closest('[data-story-node]');
- if (!stop || stop.disabled) return;
- selectStoryBeat(Number(stop.getAttribute('data-story-index')));
- });
- trail.addEventListener('keydown', function (event) {
- if (event.key !== 'Enter' && event.key !== ' ') return;
- var stop = event.target.closest('[data-story-node]');
- if (!stop || stop.disabled) return;
- event.preventDefault();
- selectStoryBeat(Number(stop.getAttribute('data-story-index')));
- });
- chapterList.addEventListener('click', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button) return;
- activateById(button.getAttribute('data-guided-view-id'));
- });
- chapterList.addEventListener('pointerover', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || !hoverCapable() || event.pointerType === 'touch') return;
- if (event.relatedTarget && button.contains(event.relatedTarget)) return;
- setChapterPreviewIntent('pointer', chapterButtons.indexOf(button));
- });
- chapterList.addEventListener('pointerout', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
- clearChapterPreviewIntent('pointer', chapterButtons.indexOf(button));
- });
- chapterIndex.addEventListener('focusin', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button) return;
- setChapterPreviewIntent('focus', chapterButtons.indexOf(button));
+ svg.addEventListener('pointerover', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || !finePointer() || event.pointerType === 'touch') return;
+ if (event.relatedTarget && node.contains(event.relatedTarget)) return;
+ hoveredNode = node;
+ schedule(node);
});
- chapterIndex.addEventListener('focusout', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
- clearChapterPreviewIntent('focus', chapterButtons.indexOf(button));
+ svg.addEventListener('pointerout', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
+ if (hoveredNode === node) hoveredNode = null;
+ sync();
});
- chapterList.addEventListener('keydown', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- var index = chapterButtons.indexOf(button);
- if (index < 0) return;
- var target = null;
- if (event.key === 'ArrowRight') target = Math.min(chapterButtons.length - 1, index + 1);
- else if (event.key === 'ArrowLeft') target = Math.max(0, index - 1);
- else if (event.key === 'Home') target = 0;
- else if (event.key === 'End') target = chapterButtons.length - 1;
- if (target === null) return;
- event.preventDefault();
- focusChapterButton(target);
+ svg.addEventListener('focusin', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node) return;
+ focusedNode = node;
+ show(node.getAttribute('data-node-id'), { announce: true });
});
-
- // A direct node exploration supersedes the curated view. Capture phase
- // releases the view before the focus explorer writes its own deep link.
- function releaseForNode(event) {
- if (activeIndex >= 0 && event.target.closest('[data-node-id]')) {
- pausePlayback();
- showAll({ clearFocus: false, updateUrl: false });
- }
- }
- svg.addEventListener('click', releaseForNode, true);
- svg.addEventListener('keydown', function (event) {
- if (event.key === 'Enter' || event.key === ' ') releaseForNode(event);
- }, true);
-
- document.addEventListener('keydown', function (event) {
- if (event.metaKey || event.ctrlKey || event.altKey) return;
- if (document.documentElement.getAttribute('data-guide-open') === 'true') return;
- var target = event.target;
- if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return;
- if (event.key === ']') {
- event.preventDefault();
- if (activeIndex < views.length - 1) activate(activeIndex + 1);
- } else if (event.key === '[') {
- event.preventDefault();
- if (activeIndex >= 0) activate(activeIndex - 1);
- } else if (event.key.toLowerCase() === 'p') {
- event.preventDefault();
- togglePlayback();
- } else if (event.key === 'Escape' && activePreviewIndex >= 0) {
- event.preventDefault();
- event.stopImmediatePropagation();
- clearChapterPreview({ clearIntents: true });
- } else if (event.key === 'Escape' && activeIndex >= 0) {
- event.preventDefault();
- showAll();
- }
- }, true);
-
- function syncViewFromHash() {
- try {
- var params = new URLSearchParams(location.hash.replace(/^#/, ''));
- var initial = params.get('view');
- var requestedBeat = params.get('beat');
- var restoreGeneration = ++momentRestoreGeneration;
- if (initial) {
- var activated = activateById(initial, { updateUrl: false, restore: true });
- if (!activated) {
- showAll({ updateUrl: false, restore: true });
- return;
- }
- if (requestedBeat) afterHandoff(function () {
- if (restoreGeneration !== momentRestoreGeneration) return;
- var latest = new URLSearchParams(location.hash.replace(/^#/, ''));
- if (latest.get('view') !== initial || latest.get('beat') !== requestedBeat) return;
- if (activeIndex < 0 || views[activeIndex].id !== initial) return;
- selectStoryBeatById(requestedBeat, { linked: true, follow: true, followInstant: true });
- });
- } else if (params.get('focus') || params.get('relation')) {
- activeIndex = -1;
- render();
- } else {
- showAll({ updateUrl: false, restore: true });
- }
- } catch (_) { showAll({ updateUrl: false, restore: true }); }
- }
-
- window.addEventListener('hashchange', syncViewFromHash);
- document.addEventListener('visibilitychange', function () {
- if (document.hidden) {
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('hidden');
- }
- else if (!document.hidden) maybeStartSharePlayback();
+ svg.addEventListener('focusout', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
+ if (focusedNode === node) focusedNode = null;
+ sync();
});
- if (window.matchMedia) {
- var guidedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
- var onGuidedMotionChange = function () {
- if (guidedMotionQuery.matches) {
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('reduced-motion');
- }
- };
- if (typeof guidedMotionQuery.addEventListener === 'function') guidedMotionQuery.addEventListener('change', onGuidedMotionChange);
- else if (typeof guidedMotionQuery.addListener === 'function') guidedMotionQuery.addListener(onGuidedMotionChange);
- }
- if (document.documentElement.getAttribute('data-embed') !== 'true' && typeof MutationObserver !== 'undefined' && typeof Node !== 'undefined' && svg instanceof Node && document.documentElement instanceof Node) {
- var chapterPreviewOwnerObserver = new MutationObserver(syncChapterPreview);
- chapterPreviewOwnerObserver.observe(svg, {
- attributes: true,
- attributeFilter: [
- 'data-route-picking', 'data-route-active', 'data-lens-active',
- 'data-legend-preview-active', 'data-relationship-preview-active',
- 'data-intent-trace-active', 'data-focus-active'
- ]
- });
- var storyMotionObserver = new MutationObserver(function () {
- if (document.documentElement.getAttribute('data-motion') !== 'live') clearStoryPulse();
- renderPlayback();
- });
- storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });
- }
- if (typeof ResizeObserver === 'function') {
- var chapterViewportWidth = chapterList.clientWidth;
- var trailViewportWidth = trail.clientWidth;
- var storyScrollObserver = new ResizeObserver(function () {
- var chapterWidth = chapterList.clientWidth;
- var trailWidth = trail.clientWidth;
- if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);
- if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {
- centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);
- }
- chapterViewportWidth = chapterWidth;
- trailViewportWidth = trailWidth;
- });
- storyScrollObserver.observe(chapterList);
- storyScrollObserver.observe(trail);
- }
- window.addEventListener('beforeprint', function () {
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('print');
+ container.addEventListener('pointerdown', function (event) {
+ if (!event.target.closest('[data-node-id]')) clear({ announce: false });
});
- syncViewFromHash();
- if (autoplayPending) {
- requestAnimationFrame(function () {
- requestAnimationFrame(maybeStartSharePlayback);
- });
- }
+ window.addEventListener('blur', function () { clear({ announce: false }); });
return {
- count: views.length,
- activate: activateById,
- showAll: showAll,
- play: startPlayback,
- playCurrent: startCurrentViewPlayback,
- pause: pausePlayback,
- beatLink: storyMomentLink,
- copyBeatLink: copyStoryMomentLink,
- cancelHandoff: cancelHandoff,
- settleHandoff: settleHandoff,
- clearPreview: function () { return clearChapterPreview({ clearIntents: true }); },
- isPlaying: function () { return playing; },
- handoff: function () {
- return currentHandoff ? { id: currentHandoff.id, mode: currentHandoff.mode, anchor: currentHandoff.anchor || null } : null;
- },
- active: function () { return activeIndex < 0 ? null : views[activeIndex].id; },
- preview: function () { return activePreviewIndex < 0 ? null : views[activePreviewIndex].id; },
- delta: function (id) {
- var index = views.findIndex(function (view) { return view.id === id; });
- if (index < 0) return null;
- var value = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- return { stay: value.stay.slice(), enter: value.enter.slice(), leave: value.leave.slice() };
- },
- beat: function () {
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- return step ? {
- index: step.index,
- position: step.index + 1,
- total: storySteps.length,
- nodeId: step.nodeId,
- relation: step.relation,
- edgeKeys: step.edgeKeys.slice()
- } : null;
- },
- focus: function () { return activeIndex < 0 ? [] : views[activeIndex].focus.slice(); }
+ show: show,
+ clear: clear,
+ active: function () { return activeId; }
};
})();
/* ============================================================
Adaptive Reader Shell — one diagram across laptop and monitor.
The canonical SVG and viewBox never change. On ordinary desktop pages,
- wide diagrams receive only enough outer width to use the available
+ wide diagrams and measured intrinsic tall workflows receive enough outer width to use the available
height without pushing summary cards below the viewport. Mobile,
- embed, presentation, print, and non-wide diagrams retain their own
+ embed, presentation, print, and unmarked non-wide diagrams retain their own
established layout contracts.
============================================================ */
+ // Fixed script-private participants; the CLI sees only the joint wait below.
+ const archifyLayoutOwners = { reader: null, viewerChrome: null };
Archify.waitForStableLayout = function (options) {
options = options || {};
var maximumFrames = Math.max(1, Number(options.maximumFrames) || 240);
@@ -10983,18 +9372,54 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var diagram = document.querySelector('.diagram-container');
var svg = diagram && diagram.querySelector(':scope > svg');
var header = shell && shell.querySelector('.header');
- var guided = shell && shell.querySelector('.guided-views');
var cards = shell && shell.querySelector('.cards');
var viewBox = svg && svg.viewBox && svg.viewBox.baseVal;
var ratio = viewBox && viewBox.height > 0 ? viewBox.width / viewBox.height : 0;
+ var measuredHeightFit = svg && svg.getAttribute('data-reader-fit') === 'intrinsic-height';
var frame = 0;
var settleFrame = 0;
var lastWidth = 0;
+ // Widest reader the overflow settle has accepted for this viewport (0 =
+ // uncapped). Card copy rewraps as the reader narrows, so recomputing
+ // from fixed heights alone would widen again and oscillate; only a
+ // resize lifts the cap.
+ var settledCap = 0;
var WIDE_RATIO = 1.55;
var MIN_DESKTOP_WIDTH = 1024;
var MIN_READER_WIDTH = 960;
var MAX_READER_WIDTH = 1920;
+ var MIN_PROJECTED_NODE_TEXT_PX = 6;
+ var declaredMinimumText = svg ? parseFloat(svg.getAttribute('data-reader-min-text') || '') : null;
+ var requestedMinimumText = Number.isFinite(declaredMinimumText)
+ ? Math.max(MIN_PROJECTED_NODE_TEXT_PX, declaredMinimumText)
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var declaredPrimaryText = svg ? parseFloat(svg.getAttribute('data-reader-primary-text') || '') : null;
var SAFE_BOTTOM_GAP = 12;
+ // Wide viewports move summary cards beside the diagram, so the height
+ // budget belongs to the diagram and spare width holds the notes.
+ var RAIL_MIN_VIEWPORT = 1280;
+ var RAIL_WIDTH = 288;
+ var RAIL_GAP = 20;
+ // A default rail must leave primary node labels comfortably readable;
+ // otherwise it starts collapsed and the reader can still open it.
+ var RAIL_COMFORT_PRIMARY_PX = 12;
+ var railPanel = shell && shell.querySelector('.reader-rail');
+ var railReveal = document.getElementById('rail-reveal');
+ var railCollapse = document.getElementById('rail-collapse');
+ var railPlacement = document.getElementById('rail-placement');
+ var RAIL_COLLAPSED_KEY = 'archify-rail-collapsed';
+ var RAIL_PLACEMENT_KEY = 'archify-rail-placement';
+ // Memory is the page's source of truth; storage only carries the choice
+ // to later artifacts, so a blocked or full localStorage cannot freeze it.
+ var preferences = Object.create(null);
+ function readPreference(key) {
+ if (key in preferences) return preferences[key];
+ try { return localStorage.getItem(key); } catch (_) { return null; }
+ }
+ function writePreference(key, value) {
+ preferences[key] = value;
+ try { localStorage.setItem(key, value); } catch (_) {}
+ }
if (diagram && ratio >= WIDE_RATIO) {
diagram.setAttribute('data-wide-diagram', 'true');
@@ -11013,9 +9438,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ function minimumReadableScale() {
+ var sourceMinimum = null;
+ var selectors = [
+ 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
+ ];
+ if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
+ selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
+ }
+ Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
+ if (Number.isFinite(sourceFontPx)) {
+ sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ }
+ });
+ return sourceMinimum != null
+ ? Math.min(1, requestedMinimumText / sourceMinimum)
+ : 1;
+ }
+ var sourcePrimary = null;
+ if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
+ var size = parseFloat(text.getAttribute('font-size') || '');
+ if (Number.isFinite(size) && size > 0) sourcePrimary = sourcePrimary == null ? size : Math.max(sourcePrimary, size);
+ });
+ // SVG width at which the largest node label renders at targetPx. Every
+ // renderer writes label font sizes, so the rail comfort check works for
+ // all diagram types; only the renderer-declared floor needs metadata.
+ function labelWidth(targetPx) {
+ return sourcePrimary == null || !viewBox ? 0 : viewBox.width * targetPx / sourcePrimary;
+ }
+ function primaryReadingWidth() {
+ if (!measuredHeightFit || !Number.isFinite(declaredPrimaryText) || declaredPrimaryText <= 0) return 0;
+ // Primary labels should remain comfortable to read when cards or
+ // auxiliary rows make a one-screen fit too small. Ordinary page
+ // scroll preserves that reading size; viewport width still caps it.
+ // A long title may already use a smaller fitted font. Preserve that
+ // hierarchy rather than enlarging every other node to compensate.
+ return labelWidth(declaredPrimaryText);
+ }
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && (ratio >= WIDE_RATIO || measuredHeightFit) &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11026,7 +9490,52 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.style.removeProperty('--archify-reader-width');
html.removeAttribute('data-reader-layout');
html.removeAttribute('data-reader-overflow');
+ setRail(false);
lastWidth = 0;
+ settledCap = 0;
+ }
+ // Rail modes: "true" docks beside the diagram, "collapsed" leaves only the
+ // reveal control, "overlay" opens a drawer when docking would break the
+ // readable floor, and "bottom" stacks notes and index below the diagram.
+ function setRail(mode) {
+ if (mode) {
+ html.setAttribute('data-reader-rail', mode);
+ html.style.setProperty('--archify-rail-width', RAIL_WIDTH + 'px');
+ html.style.setProperty('--archify-rail-gap', RAIL_GAP + 'px');
+ } else {
+ html.removeAttribute('data-reader-rail');
+ html.style.removeProperty('--archify-rail-width');
+ html.style.removeProperty('--archify-rail-gap');
+ }
+ if (railReveal) railReveal.hidden = mode !== 'collapsed';
+ if (railCollapse) {
+ railCollapse.hidden = mode !== 'true' && mode !== 'overlay';
+ railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
+ }
+ if (railPlacement) {
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
+ railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
+ railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
+ railPlacement.title = railPlacement.getAttribute('aria-label');
+ }
+ }
+ var outline = document.getElementById('node-outline');
+ function hasCards() {
+ return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
+ }
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
}
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
@@ -11040,8 +9549,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)
};
}
- function applyWidth(width) {
- var rounded = Math.round(width);
+ function applyWidth(width, minWidth) {
+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));
if (Math.abs(rounded - lastWidth) < 1) return false;
lastWidth = rounded;
html.style.setProperty('--archify-reader-width', rounded + 'px');
@@ -11053,12 +9562,14 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
- if (overflow > 1 && lastWidth > minWidth) {
- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));
+ ) - window.innerHeight - belowFold();
+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
+ settledCap = lastWidth;
html.setAttribute('data-reader-overflow', 'reduced');
} else if (overflow > 1) {
html.setAttribute('data-reader-overflow', 'authored');
@@ -11075,18 +9586,58 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var readableWidth = viewBox && viewBox.width > 0
+ ? viewBox.width * minimumReadableScale() + chrome.diagramX
+ : MIN_READER_WIDTH;
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
+ var readableMinimumWidth = measuredHeightFit && ratio < WIDE_RATIO
+ ? readableWidth
+ : measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? Math.max(MIN_READER_WIDTH, readableWidth)
+ : MIN_READER_WIDTH;
+ var minWidth;
+ if (measuredHeightFit && ratio < WIDE_RATIO) {
+ minWidth = Math.min(readableMinimumWidth, viewportCap);
+ } else if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
+ minWidth = Math.min(readableMinimumWidth, maxWidth);
+ } else {
+ minWidth = Math.min(readableMinimumWidth, viewportCap);
+ }
+ var primaryWidth = primaryReadingWidth();
+ var railExtra = RAIL_WIDTH + RAIL_GAP;
+ var mode = null;
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
+ var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
+ var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
+ var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
+ var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ else mode = fitsReadable ? 'true' : 'overlay';
+ }
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
+ var docked = mode === 'true';
+ setRail(mode);
+ chrome = chromeMetrics();
+ if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
- outerHeight(header) + outerHeight(guided) + outerHeight(cards);
+ outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
- var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;
- var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));
- applyWidth(width);
+ var desiredWidth = availableSvgHeight * ratio + chrome.diagramX + (docked ? railExtra : 0);
+ var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth, settledCap || desiredWidth));
+ applyWidth(width, minWidth);
settleOverflow(minWidth);
return {
ratio: ratio,
- width: Math.round(width),
+ width: lastWidth,
availableSvgHeight: Math.round(availableSvgHeight),
fixedHeight: Math.round(fixedHeight)
};
@@ -11112,28 +9663,58 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Math.round(diagramRect.height * 100) / 100
].join('|');
}
+ function layoutPending() { return Boolean(frame || settleFrame); }
function whenStable() {
return Archify.waitForStableLayout({
schedule: schedule,
- pending: function () { return Boolean(frame || settleFrame); },
+ pending: layoutPending,
snapshot: stableSnapshot,
timeoutMessage: 'Adaptive reader layout did not reach stable dimensions.'
});
}
+ archifyLayoutOwners.reader = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
- window.addEventListener('resize', schedule, { passive: true });
+ window.addEventListener('resize', function () {
+ settledCap = 0;
+ schedule();
+ }, { passive: true });
window.addEventListener('load', schedule, { once: true });
if (document.fonts && document.fonts.ready) document.fonts.ready.then(schedule).catch(function () {});
if (typeof ResizeObserver === 'function') {
var resizeObserver = new ResizeObserver(schedule);
- [header, guided, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
+ [header, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
}
if (typeof MutationObserver === 'function') {
var contentObserver = new MutationObserver(schedule);
- if (guided) contentObserver.observe(guided, { attributes: true, childList: true, subtree: true });
if (cards) contentObserver.observe(cards, { attributes: true, childList: true, subtree: true });
contentObserver.observe(html, { attributes: true, attributeFilter: ['data-embed', 'data-present'] });
}
+ // Reader choices persist across artifacts; a resize-style remeasure
+ // applies them without reloading.
+ function chooseRail(key, value) {
+ writePreference(key, value);
+ settledCap = 0;
+ schedule();
+ }
+ function collapseRail() {
+ chooseRail(RAIL_COLLAPSED_KEY, '1');
+ if (railReveal) requestAnimationFrame(function () { try { railReveal.focus({ preventScroll: true }); } catch (_) {} });
+ }
+ if (railReveal) railReveal.addEventListener('click', function () { chooseRail(RAIL_COLLAPSED_KEY, '0'); });
+ if (railCollapse) railCollapse.addEventListener('click', collapseRail);
+ if (railPlacement) railPlacement.addEventListener('click', function () {
+ var toBottom = html.getAttribute('data-reader-rail') !== 'bottom';
+ if (!toBottom) writePreference(RAIL_COLLAPSED_KEY, '0');
+ chooseRail(RAIL_PLACEMENT_KEY, toBottom ? 'bottom' : 'right');
+ });
+ document.addEventListener('keydown', function (event) {
+ if (event.key === 'Escape' && html.getAttribute('data-reader-rail') === 'overlay') collapseRail();
+ });
+ document.addEventListener('pointerdown', function (event) {
+ if (html.getAttribute('data-reader-rail') !== 'overlay' || !railPanel) return;
+ if (!railPanel.contains(event.target) && !(railReveal && railReveal.contains(event.target))) chooseRail(RAIL_COLLAPSED_KEY, '1');
+ });
+ if (typeof ResizeObserver === 'function' && railPanel) new ResizeObserver(schedule).observe(railPanel);
schedule();
return {
@@ -11288,8 +9869,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -11303,7 +9912,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -11323,7 +9932,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -11345,7 +9954,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -11400,7 +10009,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -11414,16 +10023,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
lastReceipt ? lastReceipt.stageGap : ''
].join('|');
}
+ function layoutPending() { return Boolean(frame || settleFrame || probingBaseline); }
function whenStable() {
return Archify.waitForStableLayout({
schedule: schedule,
- pending: function () { return Boolean(frame || settleFrame || probingBaseline); },
+ pending: layoutPending,
snapshot: stableSnapshot,
timeoutMessage: 'Viewer chrome layout did not reach stable dimensions.'
});
}
+ archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -11434,7 +10046,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
if (typeof MutationObserver === 'function') {
var contentObserver = new MutationObserver(function (records) {
- var viewerModeChanged = records.some(function (record) { return record.target === html; });
+ // A theme switch changes paint, not the stage geometry. Reprobing
+ // drops the bottom rail for several frames and makes the diagram jump.
+ var viewerModeChanged = records.some(function (record) {
+ return record.target === html && record.attributeName !== 'data-theme';
+ });
if (viewerModeChanged) reprobe();
else schedule();
});
@@ -11452,11 +10068,55 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
})();
+ Archify.layoutStability = {
+ whenStable: function () {
+ var reader = archifyLayoutOwners.reader;
+ var chrome = archifyLayoutOwners.viewerChrome;
+ if (!reader || !chrome) {
+ return Promise.reject(new Error('Joint layout owners are unavailable.'));
+ }
+ var observedFontsReady = document.fonts && document.fonts.ready;
+ var fontCyclePending = false;
+ var fontGeneration = 0;
+ function scheduleOwners() { reader.schedule(); chrome.schedule(); }
+ function fontsPending() {
+ var fonts = document.fonts;
+ var ready = fonts && fonts.ready;
+ if (ready && (ready !== observedFontsReady || (fonts.status === 'loading' && !fontCyclePending))) {
+ observedFontsReady = ready;
+ fontCyclePending = true;
+ var generation = ++fontGeneration;
+ ready.catch(function () {}).then(function () {
+ if (generation !== fontGeneration) return;
+ fontCyclePending = false;
+ scheduleOwners();
+ });
+ }
+ return fontCyclePending || Boolean(fonts && fonts.status === 'loading');
+ }
+ return Archify.waitForStableLayout({
+ maximumFrames: 960,
+ schedule: scheduleOwners,
+ pending: function () {
+ // Recapture readiness for font cycles that begin during sampling.
+ return fontsPending() || reader.pending() || chrome.pending();
+ },
+ snapshot: function () {
+ return JSON.stringify([
+ ['reader', reader.snapshot()],
+ ['viewerChrome', chrome.snapshot()]
+ ]);
+ },
+ timeoutMessage: 'Joint reader and viewer chrome layout did not reach stable dimensions.'
+ });
+ }
+ };
Archify.view = (function () {
var container = document.querySelector('.diagram-container');
var svg = container.querySelector('svg');
@@ -11678,18 +10338,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
container.removeAttribute('data-camera-transaction');
}
function interruptCamera(reason) {
- if (Archify.guidedViews && Archify.guidedViews.cancelHandoff) {
- Archify.guidedViews.cancelHandoff(reason || 'manual');
- }
var rendered = sampleRenderedState();
stopCameraMotion(reason || 'manual', false);
state = rendered;
state.mode = 'manual';
apply();
renderControls();
- if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: reason || 'manual' });
}
@@ -11749,8 +10403,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return true;
}
function semanticIds(ids, includeNeighbors) {
- var seeds = {};
- var wanted = {};
+ var seeds = Object.create(null);
+ var wanted = Object.create(null);
(ids || []).forEach(function (id) { seeds[id] = true; wanted[id] = true; });
if (includeNeighbors) {
Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
@@ -11784,8 +10438,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
var maxY = Math.max.apply(Math, boxes.map(function (box) { return box.y + box.height; }));
var bounds = {
- x: contentOffsetX + minX * contentScale,
- y: contentOffsetY + minY * contentScale,
+ x: contentOffsetX + (minX - viewBox.x) * contentScale,
+ y: contentOffsetY + (minY - viewBox.y) * contentScale,
width: Math.max(1, (maxX - minX) * contentScale),
height: Math.max(1, (maxY - minY) * contentScale)
};
@@ -11889,7 +10543,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!boxes.length || !viewBox || viewBox.width <= 0) return false;
var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));
var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
- var center = ((minX + maxX) / 2 / viewBox.width) * (svg.clientWidth || 1);
+ var center = (((minX + maxX) / 2 - viewBox.x) / viewBox.width) * (svg.clientWidth || 1);
var target = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, center - container.clientWidth / 2));
var transaction = cameraReceipt({ scrollLeft: target }, options);
cameraTransaction = transaction;
@@ -11907,9 +10561,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return transaction;
}
function syncSemantic() {
- var guided = Archify.guidedViews && typeof Archify.guidedViews.focus === 'function'
- ? Archify.guidedViews.focus() : [];
- if (guided && guided.length) return reveal(guided, { reason: 'guided-sync' });
var active = Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null;
if (typeof active === 'string') return reveal([active], { includeNeighbors: true, reason: 'focus-sync' });
if (Array.isArray(active) && active.length) return reveal(active, { reason: 'selection-sync' });
@@ -12366,8 +11017,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
: viewerText('viewer.radar.viewport.scale', { percent: Math.round(visible.scale * 100) }));
status.textContent = viewerText('viewer.radar.status', { count: nodes.length, viewport: viewportCopy });
nodes.forEach(function (item) {
- var active = item.node.hasAttribute('data-focus-selected') ||
- item.node.getAttribute('data-story-beat-state') === 'active';
+ var active = item.node.hasAttribute('data-focus-selected');
if (active) item.rect.setAttribute('data-radar-active', 'true');
else item.rect.removeAttribute('data-radar-active');
});
@@ -12391,6 +11041,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (next) {
clearSpaceRetry();
spaceRetryCount = 0;
+ trigger.setAttribute('data-radar-requested', 'true');
build();
attemptRequestedOpen(options);
} else {
@@ -12403,11 +11054,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
resetDockingStyles();
restorePassport();
feedback.hidden = true;
+ // Focus before collapsing: the dock hides this trigger at 100% unless it holds focus.
+ if (options.restoreFocus === true) trigger.focus();
trigger.setAttribute('aria-expanded', 'false');
+ trigger.removeAttribute('data-radar-requested');
trigger.removeAttribute('data-radar-space-limited');
trigger.setAttribute('aria-label', viewerText('viewer.nav.radar'));
trigger.title = viewerText('viewer.nav.radar.title');
- if (options.restoreFocus === true) trigger.focus();
}
return next;
}
@@ -12428,9 +11081,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function focusNode(id) {
var main = diagram.querySelector('[data-node-id="' + id + '"]');
if (!main) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.focus && typeof Archify.focus.set === 'function') {
Archify.focus.set(id, { toggle: false });
}
@@ -12615,8 +11265,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Presentation Stage — a shareable, viewport-filling live view.
It changes only HTML layout and URL state; SVG semantics and export
- serialization remain untouched. Escape first clears an active guided
- view/focus, then exits the stage.
+ serialization remain untouched. Escape first clears an active
+ focus, then exits the stage.
============================================================ */
Archify.presentation = (function () {
var html = document.documentElement;
@@ -12689,7 +11339,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Node Finder — stable-ID search over the existing semantic SVG.
Search never changes the IR or SVG geometry: selecting a result resets
- the viewport, releases a guided view, and delegates to semantic focus.
+ the viewport and delegates to semantic focus.
============================================================ */
Archify.finder = (function () {
var html = document.documentElement;
@@ -12811,9 +11461,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }
return true;
}
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.view && typeof Archify.view.reset === 'function') Archify.view.reset({ automatic: true });
Archify.focus.set(id, { toggle: false });
if (Archify.view && typeof Archify.view.reveal === 'function') {
@@ -12952,6 +11599,145 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
})();
+ /* ============================================================
+ Node Outline — a rail index of the semantic nodes, grouped by their
+ authored context. Hover previews neighbors through Intent Trace;
+ selection delegates to the Finder's focus-and-reveal path. It reads
+ the canonical SVG and never changes geometry or export state.
+ ============================================================ */
+ Archify.outline = (function () {
+ var panel = document.getElementById('node-outline');
+ var list = document.getElementById('node-outline-list');
+ var count = document.getElementById('node-outline-count');
+ var svg = document.querySelector('.diagram-container > svg');
+ if (!panel || !list || !svg) return { count: 0 };
+ var TONES = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];
+ var nodes = Array.from(svg.querySelectorAll('[data-node-id]')).filter(function (node) {
+ return !node.closest('[data-legend-hit], .legend') && node.getAttribute('data-node-label');
+ });
+ var buttons = Object.create(null);
+
+ function tone(node) {
+ var shape = node.querySelector('[class*="c-"]:not(.c-mask)');
+ var match = shape && /(?:^|\s)c-([a-z]+)/.exec(shape.getAttribute('class') || '');
+ return match && TONES.indexOf(match[1]) !== -1 ? match[1] : 'external';
+ }
+ function preview(id) {
+ if (Archify.intentTrace && typeof Archify.intentTrace.show === 'function') Archify.intentTrace.show(id);
+ }
+ function clearPreview() {
+ if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
+ }
+ function select(id) {
+ clearPreview();
+ var finder = Archify.finder;
+ if (finder && typeof finder.select === 'function') {
+ if (finder.select(id)) return;
+ var routeMode = Archify.routeProbe && typeof Archify.routeProbe.active === 'function' ? Archify.routeProbe.active() : 'idle';
+ // Only an active endpoint picker owns a refused selection.
+ if (routeMode === 'source' || routeMode === 'target') return;
+ }
+ if (Archify.focus && typeof Archify.focus.set === 'function') Archify.focus.set(id, { toggle: false });
+ }
+
+ var groups = [];
+ var byContext = Object.create(null);
+ nodes.forEach(function (node) {
+ // Group by the outermost context (lane or stage); deeper segments
+ // such as workflow groups and columns would split the index into
+ // one-node sections.
+ var context = (node.getAttribute('data-node-context') || '').split(' \u203a ')[0];
+ if (!byContext[context]) {
+ byContext[context] = { label: context, nodes: [] };
+ groups.push(byContext[context]);
+ }
+ byContext[context].nodes.push(node);
+ });
+
+ groups.forEach(function (group) {
+ var section = document.createElement('li');
+ section.className = 'node-outline-group';
+ if (groups.length > 1 && group.label) {
+ var heading = document.createElement('span');
+ heading.className = 'node-outline-heading';
+ var headingLabel = document.createElement('span');
+ headingLabel.textContent = group.label;
+ var headingCount = document.createElement('small');
+ headingCount.textContent = String(group.nodes.length);
+ heading.appendChild(headingLabel);
+ heading.appendChild(headingCount);
+ section.appendChild(heading);
+ }
+ var items = document.createElement('ul');
+ group.nodes.forEach(function (node) {
+ var id = node.getAttribute('data-node-id');
+ var item = document.createElement('li');
+ var button = document.createElement('button');
+ button.type = 'button';
+ button.className = 'node-outline-item';
+ button.setAttribute('data-outline-node', id);
+ button.style.setProperty('--outline-tone', 'var(--' + tone(node) + '-stroke)');
+ var dot = document.createElement('span');
+ dot.className = 'node-outline-dot';
+ dot.setAttribute('aria-hidden', 'true');
+ var label = document.createElement('strong');
+ label.textContent = node.getAttribute('data-node-label');
+ button.appendChild(dot);
+ button.appendChild(label);
+ var sublabel = node.getAttribute('data-node-sublabel');
+ if (sublabel) {
+ var detail = document.createElement('small');
+ detail.textContent = sublabel;
+ button.appendChild(detail);
+ }
+ button.addEventListener('pointerenter', function () { preview(id); });
+ button.addEventListener('focus', function () { preview(id); });
+ button.addEventListener('pointerleave', clearPreview);
+ button.addEventListener('blur', clearPreview);
+ button.addEventListener('click', function () { select(id); });
+ buttons[id] = button;
+ item.appendChild(button);
+ items.appendChild(item);
+ });
+ section.appendChild(items);
+ list.appendChild(section);
+ });
+
+ var previewing = null;
+ function syncCurrent() {
+ nodes.forEach(function (node) {
+ var button = buttons[node.getAttribute('data-node-id')];
+ if (!button) return;
+ if (node.getAttribute('aria-pressed') === 'true') button.setAttribute('aria-current', 'true');
+ else button.removeAttribute('aria-current');
+ });
+ // Mirror a diagram-side hover so the index answers "where is this?".
+ var active = buttons[svg.getAttribute('data-intent-trace-active') || ''] || null;
+ if (active === previewing) return;
+ if (previewing) previewing.removeAttribute('data-previewing');
+ previewing = active;
+ if (!active) return;
+ active.setAttribute('data-previewing', '');
+ if (!active.matches(':hover') && panel.offsetParent) {
+ var box = list.getBoundingClientRect();
+ var item = active.getBoundingClientRect();
+ if (item.top < box.top || item.bottom > box.bottom - 24) {
+ list.scrollTop += item.top - box.top - box.height / 2 + item.height / 2;
+ }
+ }
+ }
+ if (typeof MutationObserver === 'function') {
+ new MutationObserver(syncCurrent).observe(svg, { attributes: true, subtree: true, attributeFilter: ['aria-pressed', 'data-intent-trace-active'] });
+ }
+ if (count) count.textContent = String(nodes.length);
+ panel.hidden = nodes.length < 2;
+ syncCurrent();
+ if (Archify.readerLayout && typeof Archify.readerLayout.schedule === 'function') Archify.readerLayout.schedule();
+
+ return { count: nodes.length, select: select };
+ })();
+
+
/* ============================================================
Route Probe — shortest directed path over compiled semantics.
The graph is read from renderer-owned stable IDs and relationship
@@ -13218,7 +12004,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function outgoingByNode() {
var byId = nodesById();
- var outgoing = {};
+ var outgoing = Object.create(null);
edges().forEach(function (edge) {
var from = edge.getAttribute('data-edge-from');
var to = edge.getAttribute('data-edge-to');
@@ -13230,7 +12016,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function reachableFrom(source) {
var outgoing = outgoingByNode();
- var reached = {};
+ var reached = Object.create(null);
var queue = [source];
reached[source] = true;
for (var cursor = 0; cursor < queue.length; cursor += 1) {
@@ -13245,7 +12031,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function hopDistancesFrom(source) {
var outgoing = outgoingByNode();
- var distances = {};
+ var distances = Object.create(null);
var queue = [source];
distances[source] = 0;
for (var cursor = 0; cursor < queue.length; cursor += 1) {
@@ -13261,7 +12047,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function shortestDirectedPath(source, target) {
if (source === target) return null;
var outgoing = outgoingByNode();
- var previous = {};
+ var previous = Object.create(null);
var queue = [source];
previous[source] = null;
for (var cursor = 0; cursor < queue.length && !Object.prototype.hasOwnProperty.call(previous, target); cursor += 1) {
@@ -13748,9 +12534,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Array.isArray(focused)) focused = null;
clear({ updateUrl: false, preserveView: true, restoreFocus: false });
if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.focus && typeof Archify.focus.clear === 'function') {
Archify.focus.clear({ updateUrl: false, preserveView: true });
}
@@ -13791,7 +12574,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var sourceIds = nodes().map(function (node) { return node.getAttribute('data-node-id'); }).filter(function (id) {
return outgoing[id] && outgoing[id].length;
});
- var sourceBadges = {};
+ var sourceBadges = Object.create(null);
sourceIds.forEach(function (id) { sourceBadges[id] = viewerText('viewer.route.finder.source.badge'); });
return {
kind: 'route-source',
@@ -13807,7 +12590,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (mode === 'target' && startId && byId[startId]) {
var distances = hopDistancesFrom(startId);
var targetIds = Object.keys(distances).filter(function (id) { return id !== startId && byId[id]; });
- var targetBadges = {};
+ var targetBadges = Object.create(null);
targetIds.forEach(function (id) {
targetBadges[id] = viewerCount('viewer.route.hop', distances[id]);
});
@@ -14016,7 +12799,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var MAX_LENS_FLOW_EDGES = 24;
function nodesById() {
- var byId = {};
+ var byId = Object.create(null);
Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id][data-node-kind]'), function (node) {
var id = node.getAttribute('data-node-id');
if (id && !byId[id]) byId[id] = node;
@@ -14172,7 +12955,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return selectedKinds.length > 0 || !panel.hidden || html.getAttribute('data-present') === 'true' ||
svg.hasAttribute('data-focus-active') || svg.hasAttribute('data-intent-trace-active') ||
svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active') ||
- svg.hasAttribute('data-story-active') || svg.hasAttribute('data-relationship-preview-active');
+ svg.hasAttribute('data-relationship-preview-active');
}
function previewLegendKind(entry) {
clearLegendPreview();
@@ -14183,7 +12966,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return (byId[id].getAttribute('data-node-kind') || 'neutral') === kind;
});
if (!matches.length) return false;
- var chosen = {};
+ var chosen = Object.create(null);
matches.forEach(function (id) {
chosen[id] = true;
byId[id].setAttribute('data-legend-preview-match', '');
@@ -14359,7 +13142,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
options = options || {};
cleanSvgState();
var byId = nodesById();
- var nodeKind = {};
+ var nodeKind = Object.create(null);
Object.keys(byId).forEach(function (id) { nodeKind[id] = byId[id].getAttribute('data-node-kind') || 'neutral'; });
if (!selectedKinds.length) {
status.textContent = viewerText('viewer.lens.choose');
@@ -14444,9 +13227,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {
Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
}
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {
Archify.intentTrace.clear({ announce: false });
}
@@ -14666,7 +13446,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Diagram Guide — a factual command deck over existing interactions.
Counts come from compiled semantics; actions delegate to Finder, Route
- Probe, Semantic Radar, Semantic Lens, Story Trail, Presentation, theme, export, and
+ Probe, Semantic Radar, Semantic Lens, Presentation, theme, export, and
camera without adding a second command implementation or SVG state.
============================================================ */
Archify.guide = (function () {
@@ -14679,13 +13459,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var stats = document.getElementById('diagram-guide-stats');
var actions = document.getElementById('diagram-guide-actions');
var feedback = document.getElementById('diagram-guide-feedback');
- var storyBtn = actions.querySelector('[data-guide-action="story"]');
- var storyCopy = document.getElementById('diagram-guide-story-copy');
var routePanel = document.getElementById('route-probe');
+ var returnFocus = null;
- function viewCount() {
- return Archify.guidedViews && Number(Archify.guidedViews.count) || 0;
- }
function relationshipCount() {
var seen = {};
Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
@@ -14701,17 +13477,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function renderFacts() {
var nodes = svg.querySelectorAll('[data-node-id]').length;
var relationships = relationshipCount();
- var views = viewCount();
stats.textContent = viewerText('viewer.guide.facts', {
nodes: viewerCount('viewer.guide.fact.node', nodes),
- relationships: viewerCount('viewer.guide.fact.relationship', relationships),
- views: viewerCount('viewer.guide.fact.view', views)
+ relationships: viewerCount('viewer.guide.fact.relationship', relationships)
});
- storyBtn.disabled = views === 0;
- storyBtn.setAttribute('aria-disabled', views === 0 ? 'true' : 'false');
- storyCopy.textContent = views
- ? viewerCount('viewer.guide.story.available', views)
- : viewerText('viewer.guide.story.unavailable');
}
function actionButtons() {
return Array.prototype.slice.call(actions.querySelectorAll('.diagram-guide-action:not(:disabled)'));
@@ -14724,7 +13493,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
trigger.setAttribute('aria-expanded', 'false');
trigger.setAttribute('aria-label', viewerText('viewer.guide.open'));
feedback.textContent = '';
- if (options.restoreFocus !== false) trigger.focus();
+ if (options.restoreFocus !== false) {
+ var target = trigger.hidden ? returnFocus : trigger;
+ if (target && typeof target.focus === 'function') target.focus();
+ }
return false;
}
function open() {
@@ -14734,12 +13506,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });
if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });
if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });
- if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: 'guide' });
}
+ returnFocus = document.activeElement;
renderFacts();
panel.hidden = false;
html.setAttribute('data-guide-open', 'true');
@@ -14756,16 +13526,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function toggle() { return panel.hidden ? open() : close(); }
function execute(action) {
feedback.textContent = '';
- if (action === 'story' && !viewCount()) {
- feedback.textContent = viewerText('viewer.guide.noStory');
- return false;
- }
close({ restoreFocus: false });
if (action === 'find') return Archify.finder.open();
if (action === 'route') return Archify.routeProbe.begin({ focusNode: true });
if (action === 'map') return Archify.radar.open();
if (action === 'lens') return Archify.semanticLens.open();
- if (action === 'story') return Archify.guidedViews.play();
if (action === 'present') return Archify.presentation.enter();
if (action === 'export') return Archify.exportMenu.open();
if (action === 'theme') return Archify.theme.toggle();
@@ -14781,7 +13546,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
r: 'route',
m: 'map',
l: 'lens',
- p: 'story',
f: 'present',
e: 'export',
t: 'theme',
@@ -14843,8 +13607,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
facts: function () {
return {
nodes: svg.querySelectorAll('[data-node-id]').length,
- relationships: relationshipCount(),
- views: viewCount()
+ relationships: relationshipCount()
};
}
};
diff --git a/examples/archify-repo.html b/examples/archify-repo.html
index 7c6d936a..313847ce 100644
--- a/examples/archify-repo.html
+++ b/examples/archify-repo.html
@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="archify 2.17.0-dev.1">
+ <meta name="archify-reader-contract" content="declared-wide-v1">
<title>Archify Diagram</title>
<script>
// Resolve the theme before first paint so light-preference users don't
@@ -173,6 +174,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
[data-theme="dark"] {
--bg: #020617;
--grid: #1e293b;
+ --canvas-dot: rgba(148, 163, 184, 0.16);
--text: #ffffff;
--text-muted: #94a3b8;
--text-dim: #475569;
@@ -214,15 +216,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
[data-theme="light"] {
- --bg: #f8fafc;
- --grid: #e2e8f0;
- --text: #0f172a;
- --text-muted: #64748b;
- --text-dim: #94a3b8;
- --text-faint: #64748b;
+ --bg: #f4f5f7;
+ --grid: #e9edf2;
+ --canvas-dot: #d9dee5;
+ --text: #111827;
+ --text-muted: #5b6474;
+ --text-dim: #9aa3b2;
+ --text-faint: #6b7280;
--panel: #ffffff;
- --panel-border: #e2e8f0;
+ --panel-border: #e5e7eb;
--lane-fill: rgba(248, 250, 252, 0.65);
--lane-stroke: #cbd5e1;
@@ -231,20 +234,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
--mask: #ffffff;
- --frontend-fill: rgba(34, 211, 238, 0.15);
- --frontend-stroke: #0891b2;
- --backend-fill: rgba(52, 211, 153, 0.18);
- --backend-stroke: #059669;
- --database-fill: rgba(167, 139, 250, 0.2);
- --database-stroke: #7c3aed;
- --cloud-fill: rgba(251, 191, 36, 0.18);
- --cloud-stroke: #d97706;
- --security-fill: rgba(251, 113, 133, 0.15);
- --security-stroke: #e11d48;
- --messagebus-fill: rgba(251, 146, 60, 0.15);
- --messagebus-stroke:#ea580c;
- --external-fill: rgba(148, 163, 184, 0.18);
- --external-stroke: #64748b;
+ --frontend-fill: rgba(34, 211, 238, 0.15);
+ --frontend-stroke: #0891b2;
+ --backend-fill: rgba(52, 211, 153, 0.18);
+ --backend-stroke: #059669;
+ --database-fill: rgba(167, 139, 250, 0.2);
+ --database-stroke: #7c3aed;
+ --cloud-fill: rgba(251, 191, 36, 0.18);
+ --cloud-stroke: #d97706;
+ --security-fill: rgba(251, 113, 133, 0.15);
+ --security-stroke: #e11d48;
+ --messagebus-fill: rgba(251, 146, 60, 0.15);
+ --messagebus-stroke: #ea580c;
+ --external-fill: rgba(148, 163, 184, 0.18);
+ --external-stroke: #64748b;
--toolbar-bg: rgba(255, 255, 255, 0.92);
--toolbar-border: #cbd5e1;
@@ -477,12 +480,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
- font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
+ --archify-page-top: 2rem;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
background: var(--bg);
min-height: 100vh;
- padding: 2rem;
+ padding: var(--archify-page-top) 2rem 2rem;
color: var(--text);
- transition: background 0.2s ease, color 0.2s ease;
+ /* Theme surfaces change together; animating the page background leaves it
+ visibly out of sync with the SVG and panel for the first 200ms. */
}
html[data-preset="signal-flow"] body {
@@ -530,7 +536,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-embed="true"] .semantic-lens,
html[data-embed="true"] .diagram-guide,
html[data-embed="true"] .node-finder,
- html[data-embed="true"] .guided-views { display: none !important; }
+ html[data-embed="true"] .node-outline { display: none !important; }
html[data-embed="true"] .container { max-width: none; }
html[data-embed="true"] .diagram-container {
padding: 0.5rem;
@@ -540,142 +546,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-embed="true"] .diagram-container svg { min-width: 0; }
- /* Share Chapter Cue lives in the HTML viewer layer, not inside the SVG.
- It gives one-shot embeds a title, authored note, truthful stop order,
- and lifecycle state while canonical diagram geometry stays untouched. */
- .share-chapter-cue { display: none; }
- html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),
- html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {
- position: absolute;
- z-index: 18;
- top: 0.85rem;
- left: 50%;
- display: grid;
- grid-template-columns: auto minmax(9rem, 13.5rem) minmax(0, 1fr);
- align-items: center;
- gap: 0.45rem 0.85rem;
- width: min(52rem, calc(100% - 1.5rem));
- min-height: 3.35rem;
- padding: 0.55rem 0.75rem 0.65rem;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));
- border-radius: 0.75rem;
- background:
- linear-gradient(115deg, color-mix(in srgb, var(--frontend-fill) 52%, transparent), transparent 45%),
- color-mix(in srgb, var(--toolbar-menu-bg) 92%, transparent);
- color: var(--toolbar-text);
- box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);
- backdrop-filter: blur(16px);
- pointer-events: none;
- animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- html[data-preset="blueprint"] .share-chapter-cue {
- border-radius: 0.2rem;
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 46%, transparent), transparent 36%),
- var(--toolbar-menu-bg);
- box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
- backdrop-filter: none;
- }
- html[data-preset="editorial"] .share-chapter-cue {
- border-color: var(--panel-border);
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 42%),
- var(--toolbar-menu-bg);
- box-shadow: 0 10px 30px color-mix(in srgb, #000 18%, transparent);
- backdrop-filter: none;
- }
- html[data-preset="editorial"] .share-chapter-state { color: var(--arrow-emphasis); }
- html[data-preset="editorial"] .share-chapter-state::before {
- border-radius: 0;
- box-shadow: none;
- transform: rotate(45deg) scale(0.8);
- }
- .share-chapter-index {
- display: grid;
- gap: 0.12rem;
- min-width: 5rem;
- padding-right: 0.75rem;
- border-right: 1px solid var(--toolbar-border);
- }
- .share-chapter-state {
- display: inline-flex;
- align-items: center;
- gap: 0.36rem;
- color: var(--frontend-stroke);
- font-size: 0.5rem;
- font-weight: 800;
- letter-spacing: 0.14em;
- text-transform: uppercase;
- }
- .share-chapter-state::before {
- width: 0.38rem;
- height: 0.38rem;
- border-radius: 50%;
- background: currentColor;
- box-shadow: 0 0 10px currentColor;
- content: '';
- }
- .share-chapter-cue[data-state="playing"] .share-chapter-state::before {
- animation: archify-share-cue-pulse 1.15s ease-in-out infinite;
- }
- .share-chapter-count {
- color: var(--text-faint);
- font-size: 0.5rem;
- font-weight: 700;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- }
- .share-chapter-copy { min-width: 0; }
- .share-chapter-copy strong,
- .share-chapter-copy small,
- .share-chapter-route {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .share-chapter-copy strong {
- color: var(--toolbar-text);
- font-size: 0.6875rem;
- line-height: 1.35;
- }
- .share-chapter-copy small {
- margin-top: 0.08rem;
- color: var(--text-muted);
- font-size: 0.5rem;
- line-height: 1.35;
- }
- .share-chapter-route {
- color: color-mix(in srgb, var(--frontend-stroke) 76%, var(--text-muted));
- font-size: 0.5625rem;
- font-weight: 650;
- letter-spacing: 0.015em;
- text-align: right;
- }
- .share-chapter-progress {
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- height: 2px;
- overflow: hidden;
- background: color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- .share-chapter-progress span {
- display: block;
- width: 100%;
- height: 100%;
- background: linear-gradient(90deg, var(--frontend-stroke), var(--database-stroke));
- box-shadow: 0 0 12px var(--frontend-stroke);
- transform: scaleX(0);
- transform-origin: left center;
- }
-
/* Presentation Stage is a viewer-only layer: it gives the live diagram
the viewport while keeping guided views, theme, focus, and exports real.
Embed mode wins when both query parameters are present. */
html[data-present="true"]:not([data-embed="true"]) body {
+ --archify-page-top: 1rem;
height: 100dvh;
min-height: 0;
padding: 1rem;
@@ -701,10 +576,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
text-overflow: ellipsis;
white-space: nowrap;
}
- html[data-present="true"]:not([data-embed="true"]) .guided-views {
- flex: none;
- margin-bottom: 0;
- }
+
html[data-present="true"]:not([data-embed="true"]) .diagram-container {
display: flex;
flex: 1 1 auto;
@@ -727,7 +599,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--frontend-stroke);
}
- /* The reader owns only the outer scale. Wide diagrams keep one authored
+ /* The reader owns only the outer scale. Wide diagrams and measured tall workflows keep one authored
SVG/viewBox while the runtime chooses a desktop width from the actual
vertical budget. This avoids device-specific files and breakpoint
jumps between a laptop and a tall monitor. */
@@ -752,15 +624,18 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.header-row {
display: flex;
align-items: center;
- gap: 1rem;
- margin-bottom: 0.5rem;
+ gap: 0.75rem;
+ min-height: 2.75rem;
+ margin-bottom: 0.25rem;
}
.pulse-dot {
- width: 12px;
- height: 12px;
+ flex: none;
+ width: 10px;
+ height: 10px;
background: var(--frontend-stroke);
border-radius: 50%;
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--frontend-stroke) 16%, transparent);
animation: none;
}
@@ -773,19 +648,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
h1 {
font-size: 1.5rem;
- font-weight: 700;
- letter-spacing: -0.025em;
+ font-weight: 650;
+ line-height: 1.25;
+ letter-spacing: -0.015em;
}
.subtitle {
color: var(--text-muted);
font-size: 0.875rem;
- margin-left: 1.75rem;
+ line-height: 1.55;
+ margin-left: 1.375rem;
}
html[data-preset="signal-flow"] .header-row::after {
content: attr(data-preset-badge-signal-flow);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
color: var(--frontend-stroke);
border: 1px solid var(--frontend-stroke);
border-radius: 999px;
@@ -809,7 +687,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-preset="blueprint"] .header-row::after {
content: attr(data-preset-badge-blueprint);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
padding: 0.28rem 0.55rem;
border-top: 1px solid var(--frontend-stroke);
border-bottom: 1px solid var(--frontend-stroke);
@@ -838,7 +717,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-preset="editorial"] .header-row::after {
content: attr(data-preset-badge-editorial);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
padding: 0.32rem 0 0.24rem;
border-bottom: 2px solid var(--arrow-emphasis);
color: var(--arrow-emphasis);
@@ -855,6 +735,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
background: var(--panel);
border-radius: 1rem;
border: 1px solid var(--panel-border);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -20px rgba(15, 23, 42, 0.18);
padding: 1.5rem;
padding-bottom: calc(1.5rem + var(--archify-nav-reserve));
overflow: hidden;
@@ -942,6 +823,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-animate] {
animation: none !important;
}
+ html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: none !important;
+ }
html[data-motion="still"] .pulse-dot,
html[data-motion="still"] .diagram-container::before,
html[data-motion="still"] svg[data-animation="trace"] [data-animate],
@@ -954,7 +838,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-share-playback="true"] .diagram-container::before,
html[data-document-hidden="true"] .pulse-dot,
html[data-document-hidden="true"] .diagram-container::before,
- html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate] {
+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate],
+ html[data-motion="still"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-motion-owner] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
animation: none !important;
}
html[data-motion="still"] .diagram-container::before,
@@ -963,43 +852,21 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-share-playback="true"] .diagram-container::before {
opacity: 0;
}
- html[data-motion="still"] .guided-view-progress span,
- html[data-motion="still"] .guided-story-caption,
- html[data-motion="still"] .story-trail-flow,
html[data-motion="still"] .intent-trace-flow,
html[data-motion="still"] .route-probe-flow,
html[data-motion="still"] .route-journey-flow,
html[data-motion="still"] .semantic-lens-flow,
html[data-motion="still"] .diagram-guide,
- html[data-motion="still"] [data-story-step],
html[data-motion="still"] .overview-map-live,
- html[data-motion="still"] .guided-view-stop,
- html[data-motion="still"] .share-chapter-cue,
- html[data-motion="still"] .share-chapter-state::before,
- html[data-motion="still"] .share-chapter-progress span,
- html[data-document-hidden="true"] .guided-view-progress span,
- html[data-document-hidden="true"] .story-trail-flow,
html[data-document-hidden="true"] .intent-trace-flow,
html[data-document-hidden="true"] .route-probe-flow,
html[data-document-hidden="true"] .route-journey-flow,
html[data-document-hidden="true"] .semantic-lens-flow,
html[data-document-hidden="true"] .diagram-guide,
- html[data-document-hidden="true"] [data-story-step],
- html[data-document-hidden="true"] .overview-map-live,
- html[data-document-hidden="true"] .guided-view-stop,
- html[data-document-hidden="true"] .share-chapter-cue,
- html[data-document-hidden="true"] .share-chapter-state::before,
- html[data-document-hidden="true"] .share-chapter-progress span {
+ html[data-document-hidden="true"] .overview-map-live {
animation: none !important;
}
- html[data-motion="still"] .guided-view-progress span {
- transform: scaleX(1) !important;
- }
- html[data-motion="still"] svg[data-story-playing="true"] .story-trail-flow {
- stroke-dasharray: none;
- stroke-dashoffset: 0;
- opacity: 0.55;
- }
+
html[data-motion="still"] .intent-trace-flow,
html[data-motion="still"] .route-probe-flow {
stroke-dasharray: none;
@@ -1008,12 +875,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-motion="still"] .route-journey-overlay,
html[data-document-hidden="true"] .route-journey-overlay { display: none !important; }
- html[data-motion="still"] .relationship-pulse-overlay,
- html[data-motion="still"] .story-carrier-overlay,
- html[data-document-hidden="true"] .story-carrier-overlay { display: none !important; }
- html[data-motion="still"] .chapter-handoff-overlay { display: none !important; }
- html[data-motion="still"] .chapter-handoff-anchor { animation: none !important; }
- html[data-motion="still"] .guided-view-chapter,
+ html[data-motion="still"] .relationship-pulse-overlay { display: none !important; }
+
html[data-motion="still"] svg [data-node-id],
html[data-motion="still"] svg [data-edge-from],
html[data-motion="still"] svg [data-detail],
@@ -1024,6 +887,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg {
+ font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
width: 100%;
min-width: min(900px, 100%);
display: block;
@@ -1044,23 +908,23 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
- padding: 0.15rem;
- gap: 0;
+ padding: 0.25rem;
+ gap: 0.0625rem;
overflow-x: auto;
- border: 1px solid color-mix(in srgb, var(--toolbar-border) 48%, transparent);
- border-radius: 0.58rem;
- background: color-mix(in srgb, var(--toolbar-bg) 82%, transparent);
- box-shadow: 0 5px 14px rgba(0, 0, 0, 0.07);
- backdrop-filter: blur(10px);
+ border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
+ border-radius: 0.75rem;
+ background: color-mix(in srgb, var(--panel) 84%, transparent);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -14px rgba(15, 23, 42, 0.28);
+ backdrop-filter: blur(14px) saturate(1.2);
scrollbar-width: none;
}
.diagram-nav::-webkit-scrollbar { display: none; }
.diagram-nav button,
- .focus-chip button,
- .guided-views button {
+ .focus-chip button {
border: 0;
background: transparent;
color: var(--toolbar-text);
@@ -1070,56 +934,62 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.diagram-nav button {
min-width: 2rem;
height: 2rem;
- padding: 0 0.35rem;
- border-radius: 0.35rem;
- color: color-mix(in srgb, var(--toolbar-text) 68%, transparent);
- font-size: 0.56rem;
- font-weight: 600;
- letter-spacing: 0.02em;
+ padding: 0 0.4rem;
+ border-radius: 0.5rem;
+ color: var(--text-muted);
+ font-size: 0.75rem;
+ font-weight: 500;
+ letter-spacing: 0;
transition: background 0.15s, color 0.15s;
}
.diagram-nav button:hover,
+ .diagram-nav button:focus-visible {
+ color: var(--text);
+ background: color-mix(in srgb, var(--text) 6%, transparent);
+ }
+ .diagram-nav button:hover,
.diagram-nav button:focus-visible,
.focus-chip button:hover,
- .focus-chip button:focus-visible,
- .guided-views button:hover,
- .guided-views button:focus-visible { background: var(--toolbar-hover); }
+ .focus-chip button:focus-visible { background: var(--toolbar-hover); }
.diagram-nav button:focus-visible,
- .focus-chip button:focus-visible,
- .guided-views button:focus-visible {
+ .focus-chip button:focus-visible {
outline: 2px solid var(--frontend-stroke);
outline-offset: 1px;
}
.diagram-nav button:disabled { opacity: 0.38; cursor: default; }
+ /* The Guide stays on the ? shortcut; Map only earns dock space once the
+ reader has zoomed past the full diagram (or opened it from the keyboard). */
+ .diagram-nav button[hidden] { display: none; }
+ .diagram-container:not(.is-pannable) #btn-overview-map:not([data-radar-requested]):not(:focus) { display: none; }
.diagram-nav button:disabled:hover { background: transparent; }
.diagram-nav #btn-route-probe,
.diagram-nav #btn-overview-map,
.diagram-nav #btn-semantic-lens {
min-width: auto;
- padding-inline: 0.5rem;
- color: color-mix(in srgb, var(--toolbar-text) 86%, transparent);
- font-weight: 650;
+ padding-inline: 0.6rem;
+ color: var(--text-muted);
+ font-weight: 500;
}
.diagram-nav #btn-node-finder,
.diagram-nav [data-view="out"] {
position: relative;
- margin-left: 0.25rem;
+ margin-left: 0.375rem;
}
.diagram-nav #btn-node-finder::before,
.diagram-nav [data-view="out"]::before {
position: absolute;
- top: 0.4rem;
- bottom: 0.4rem;
- left: -0.13rem;
+ top: 0.55rem;
+ bottom: 0.55rem;
+ left: -0.19rem;
width: 1px;
- background: color-mix(in srgb, var(--toolbar-border) 62%, transparent);
+ background: color-mix(in srgb, var(--panel-border) 90%, transparent);
content: "";
pointer-events: none;
}
.diagram-nav-icon {
display: block;
- width: 0.72rem;
- height: 0.72rem;
+ width: 0.875rem;
+ height: 0.875rem;
margin: auto;
background: currentColor;
-webkit-mask-position: center;
@@ -1164,11 +1034,56 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
letter-spacing: 0.07em;
}
.diagram-nav-percent {
- color: color-mix(in srgb, var(--toolbar-text) 84%, transparent);
- font-size: 0.55rem;
- font-weight: 650;
+ color: var(--text-muted);
+ font-size: 0.75rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
line-height: 1;
}
+ /* Mode buttons carry a small glyph so the dock reads as one icon language. */
+ .diagram-nav #btn-route-probe,
+ .diagram-nav #btn-overview-map,
+ .diagram-nav #btn-semantic-lens {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+ padding-inline: 0.55rem 0.65rem;
+ }
+ .diagram-nav #btn-route-probe::before,
+ .diagram-nav #btn-overview-map::before,
+ .diagram-nav #btn-semantic-lens::before {
+ flex: none;
+ width: 0.875rem;
+ height: 0.875rem;
+ background: currentColor;
+ content: "";
+ opacity: 0.85;
+ -webkit-mask: var(--nav-glyph) center / contain no-repeat;
+ mask: var(--nav-glyph) center / contain no-repeat;
+ }
+ .diagram-nav #btn-route-probe { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='4.8' cy='14.8' r='2.2'/%3E%3Ccircle cx='15.2' cy='5.2' r='2.2'/%3E%3Cpath d='M6.9 13.9c3.8-1.4 2.6-6.3 6.2-7.8'/%3E%3C/g%3E%3C/svg%3E"); }
+ .diagram-nav #btn-overview-map { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2.8 5.4 7.4 3.5l5.2 2 4.6-1.9v11l-4.6 1.9-5.2-2-4.6 1.9z'/%3E%3Cpath d='M7.4 3.5v11M12.6 5.5v11'/%3E%3C/g%3E%3C/svg%3E"); }
+ .diagram-nav #btn-semantic-lens { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='6.8'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/g%3E%3C/svg%3E"); }
+ /* Zoom out / level / zoom in join into one stepper well. */
+ .diagram-nav [data-view="out"],
+ .diagram-nav [data-view="reset"],
+ .diagram-nav [data-view="in"] {
+ border-radius: 0;
+ background: color-mix(in srgb, var(--text) 4.5%, transparent);
+ }
+ .diagram-nav [data-view="out"] { margin-left: 0.375rem; border-radius: 0.5rem 0 0 0.5rem; }
+ .diagram-nav [data-view="out"]::before { display: none; }
+ .diagram-nav [data-view="reset"],
+ .diagram-nav [data-view="in"] { margin-left: -0.0625rem; }
+ .diagram-nav [data-view="in"] { border-radius: 0 0.5rem 0.5rem 0; }
+ .diagram-nav [data-view="out"]:hover,
+ .diagram-nav [data-view="reset"]:hover,
+ .diagram-nav [data-view="in"]:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
+ .diagram-nav [data-view="out"]:disabled,
+ .diagram-nav [data-view="in"]:disabled { opacity: 1; color: color-mix(in srgb, var(--text-muted) 40%, transparent); }
+ .diagram-nav [data-view="out"]:disabled:hover,
+ .diagram-nav [data-view="in"]:disabled:hover { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
+ .diagram-nav [data-view="reset"] { min-width: 3.25rem; }
.diagram-container[data-camera-indicator="true"] .diagram-nav-detail,
.diagram-container[data-camera-indicator="true"] .diagram-nav-percent { color: var(--frontend-stroke); }
.diagram-nav #btn-diagram-guide[aria-expanded="true"] {
@@ -1392,7 +1307,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.diagram-nav #btn-overview-map[aria-expanded="true"] {
color: var(--frontend-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--frontend-stroke) 11%, transparent);
}
.overview-map-feedback {
position: absolute;
@@ -1414,12 +1329,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.focus-chip[data-radar-yielded="true"] { display: none !important; }
.diagram-nav #btn-route-probe[aria-pressed="true"] {
color: var(--backend-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--backend-stroke) 11%, transparent);
}
.diagram-nav #btn-semantic-lens[aria-expanded="true"],
.diagram-nav #btn-semantic-lens[aria-pressed="true"] {
color: var(--database-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--database-stroke) 11%, transparent);
}
/* Semantic Lens turns the compiled node-kind palette into an analytical
@@ -1616,9 +1531,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--toolbar-text);
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(16px);
- font-size: 0.625rem;
+ font-size: 0.75rem;
}
.route-probe[hidden] { display: none; }
+ /* Picking needs one line of guidance, not a wide empty card; the panel
+ widens only when there is a traced route to show. */
+ .route-probe:not([data-state="result"]) { width: min(22rem, calc(100% - 2rem)); min-width: 0; }
+ .route-probe-path:has(> .route-probe-placeholder:only-child) { display: none; }
.route-probe[data-route-dock="top"] {
top: 1rem;
bottom: auto;
@@ -1629,25 +1548,25 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
gap: 0.65rem;
- padding: 0.52rem 0.58rem 0.44rem;
+ padding: 0.625rem 0.75rem 0.5rem;
border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);
}
.route-probe-copy { min-width: 0; }
.route-probe-eyebrow {
display: block;
color: var(--backend-stroke);
- font-size: 0.48rem;
- font-weight: 800;
- letter-spacing: 0.15em;
- text-transform: uppercase;
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.02em;
}
.route-probe-title {
display: block;
margin-top: 0.14rem;
overflow: hidden;
color: var(--toolbar-text);
- font-size: 0.72rem;
- line-height: 1.25;
+ font-size: 0.875rem;
+ font-weight: 600;
+ line-height: 1.3;
white-space: nowrap;
text-overflow: ellipsis;
}
@@ -1728,16 +1647,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.route-probe-placeholder {
color: var(--text-faint);
- font-size: 0.56rem;
- letter-spacing: 0.03em;
+ font-size: 0.75rem;
}
.route-probe-status {
display: block;
min-height: 1.45rem;
- padding: 0.08rem 0.58rem 0.44rem;
- color: var(--text-faint);
- font-size: 0.52rem;
- line-height: 1.35;
+ padding: 0.5rem 0.75rem 0.625rem;
+ color: var(--text-muted, var(--text-faint));
+ font-size: 0.75rem;
+ line-height: 1.45;
}
.route-journey-controls {
display: grid;
@@ -1795,14 +1713,40 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
font-size: 0.625rem;
}
.relationship-lens-head {
+ position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
gap: 0.75rem;
- padding: 0.7rem 0.75rem 0.65rem;
+ padding: 0.9rem 0.75rem 0.65rem;
border-bottom: 1px solid var(--toolbar-border);
background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);
}
+ .relationship-lens-drag-handle {
+ position: absolute;
+ top: 0.12rem;
+ left: 50%;
+ width: 2.5rem;
+ height: 0.78rem;
+ padding: 0 !important;
+ transform: translateX(-50%);
+ color: var(--text-faint) !important;
+ cursor: grab;
+ touch-action: none;
+ user-select: none;
+ }
+ .relationship-lens-drag-handle::before {
+ content: "";
+ display: block;
+ width: 1.25rem;
+ margin: auto;
+ border-top: 2px dotted currentColor;
+ opacity: 0.72;
+ }
+ .focus-chip[data-panel-dragging="true"] .relationship-lens-drag-handle { cursor: grabbing; }
+ @media (hover: none), (pointer: coarse) {
+ .relationship-lens-drag-handle { display: none; }
+ }
.relationship-lens-copy { min-width: 0; }
.relationship-lens-actions {
display: flex;
@@ -1950,8 +1894,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--text-muted);
text-decoration: none;
}
- .semantic-passport-source:hover,
- .semantic-passport-source:focus-visible {
+ a.semantic-passport-source:hover,
+ a.semantic-passport-source:focus-visible {
border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);
background: color-mix(in srgb, var(--backend-fill) 32%, transparent);
color: var(--text);
@@ -2228,7 +2172,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.diagram-guide-action[data-guide-action="route"] { --guide-accent: var(--backend-stroke); }
.diagram-guide-action[data-guide-action="map"] { --guide-accent: var(--database-stroke); }
.diagram-guide-action[data-guide-action="lens"] { --guide-accent: var(--messagebus-stroke); }
- .diagram-guide-action[data-guide-action="story"] { --guide-accent: var(--security-stroke); }
+
.diagram-guide-action[data-guide-action="present"] {
--guide-accent: var(--cloud-stroke);
}
@@ -2502,564 +2446,443 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
font-size: 0.5625rem;
}
- .guided-views {
+ .cards {
display: grid;
- grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem auto;
- align-items: stretch;
- gap: 0.35rem;
- min-width: 0;
- margin: 0 0 0.75rem;
- padding: 0.35rem;
- border: 1px solid var(--toolbar-border);
- border-radius: 0.85rem;
- background: var(--toolbar-bg);
- background: linear-gradient(120deg, var(--toolbar-bg), color-mix(in srgb, var(--toolbar-bg) 82%, var(--frontend-fill)));
- box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
- backdrop-filter: blur(12px);
+ grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
+ gap: 1rem;
+ margin-top: 2rem;
}
- .guided-views[hidden] { display: none; }
- html[data-preset="blueprint"] .guided-views {
- border-color: var(--panel-border);
- border-radius: 0.35rem;
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 36%, transparent), transparent 24%),
- var(--toolbar-bg);
- box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
- }
- html[data-preset="blueprint"] .guided-views button { border-radius: 0.2rem; }
- html[data-preset="blueprint"] .guided-view-progress { border-radius: 0; }
- html[data-preset="blueprint"] .guided-view-progress span { border-radius: 0; }
- .guided-views button {
- min-width: 0;
- padding: 0.45rem 0.6rem;
- border-radius: 0.55rem;
- font-size: 0.75rem;
- }
- .guided-views > #guided-view-prev,
- .guided-views > #guided-view-next { min-width: 2.75rem; min-height: 2.75rem; }
- .guided-views button:disabled { opacity: 0.3; cursor: default; }
- .guided-view-copy {
- min-width: 0;
- padding: 0.2rem 0.5rem;
- border-left: 1px solid var(--toolbar-border);
- overflow: hidden;
+ .card {
+ background: var(--panel);
+ border-radius: 0.75rem;
+ border: 1px solid var(--panel-border);
+ padding: 1.125rem 1.25rem;
}
- .guided-view-meta {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- min-height: 1rem;
- margin-bottom: 0.12rem;
- color: var(--frontend-stroke);
- font-size: 0.5625rem;
- font-weight: 700;
- letter-spacing: 0.12em;
- text-transform: uppercase;
+
+ html[data-preset="signal-flow"] .card {
+ background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
- .guided-view-handoff {
- box-sizing: border-box;
- height: 1rem;
- min-width: 0;
- max-width: 15rem;
- overflow: hidden;
- padding: 0 0.38rem;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 46%, transparent);
- border-radius: 999px;
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-fill) 44%, transparent);
- font-size: 0.5rem;
- line-height: calc(1rem - 2px);
- letter-spacing: 0.06em;
- text-overflow: ellipsis;
- white-space: nowrap;
+ html[data-preset="signal-flow"][data-theme="light"] .card {
+ background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
}
- .guided-view-handoff[hidden] { display: none; }
- html[data-preset="blueprint"] .guided-view-handoff { border-radius: 0.15rem; }
- .chapter-handoff-overlay { pointer-events: none; }
- .chapter-handoff-anchor {
- fill: color-mix(in srgb, var(--frontend-fill) 10%, transparent);
- stroke: var(--frontend-stroke);
- stroke-width: 2;
- stroke-dasharray: 4 4;
- vector-effect: non-scaling-stroke;
- opacity: 0.96;
- animation: archify-chapter-anchor 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
+
+ /* Preserve the one-screen guarantee on ordinary laptop displays. The
+ high-screen expansion above must not trade a fuller canvas for page
+ scrolling at 900–1080px heights. */
+ @media (min-width: 768px) and (max-height: 1100px) {
+ .header { margin-bottom: 1rem; }
+ .diagram-container {
+ padding: 0.875rem;
+ padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
+ }
+ .cards { margin-top: 1rem; }
+ .card { padding: 1rem; }
}
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="stay"] { opacity: 1; }
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="enter"] { opacity: 0.78; }
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="leave"] { opacity: 0.26; }
- @keyframes archify-chapter-anchor {
- 0% { opacity: 0.35; stroke-dashoffset: 8; }
- 45% { opacity: 1; }
- 100% { opacity: 0.72; stroke-dashoffset: 0; }
+ @media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
+ body { --archify-page-top: 1.25rem; }
+ .header { margin-bottom: 0.875rem; }
+ .cards { margin-top: 0.75rem; }
+ html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
+ /* Align the fixed toolbar with the compact title row. Reserve its hit area
+ above the guide without taking extra height from a fitted diagram. */
+ html[data-nav-stage-rail="true"] .toolbar { top: 0.25rem; }
+ html[data-nav-stage-rail="true"] .header { min-height: 2.625rem; margin-bottom: 0.5rem; }
+ html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
+ html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
}
- .guided-view-progress {
- width: 3.5rem;
- height: 2px;
- overflow: hidden;
- border-radius: 999px;
- background: var(--toolbar-border);
+
+ html[data-preset="blueprint"] .card {
+ position: relative;
+ border-color: var(--panel-border);
+ border-radius: 0.3rem;
+ background: var(--panel);
+ box-shadow: none;
}
- .guided-view-progress span {
- display: block;
- width: 100%;
- height: 100%;
- border-radius: inherit;
- background: var(--frontend-stroke);
- transform: scaleX(0);
- transform-origin: left center;
- }
- .guided-view-copy strong,
- .guided-view-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
- .guided-view-copy strong { color: var(--toolbar-text); font-size: 0.75rem; line-height: 1.35; }
- .guided-view-copy small { margin-top: 0; color: var(--text-muted); font-size: 0.625rem; line-height: 1.35; }
- .guided-story-caption {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) auto;
- gap: 0.12rem 0.55rem;
- align-items: center;
- min-width: 0;
- margin-top: 0.18rem;
- padding: 0.3rem 0.5rem;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 32%, var(--toolbar-border));
- border-radius: 0.58rem;
- background: color-mix(in srgb, var(--frontend-fill) 26%, transparent);
- animation: archify-story-caption-in 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- .guided-story-caption[hidden] { display: none; }
- .guided-story-caption-index {
- grid-row: 1 / span 2;
- align-self: stretch;
- display: inline-grid;
- min-width: 3.3rem;
- place-items: center;
- padding-right: 0.52rem;
- border-right: 1px solid color-mix(in srgb, var(--frontend-stroke) 28%, var(--toolbar-border));
- color: var(--frontend-stroke);
- font-size: 0.5625rem;
- font-weight: 800;
- letter-spacing: 0.08em;
- text-transform: uppercase;
+ html[data-preset="blueprint"] .card::before {
+ content: "";
+ position: absolute;
+ top: -1px;
+ left: 1rem;
+ width: 2.5rem;
+ border-top: 2px solid var(--frontend-stroke);
}
- .guided-story-caption strong,
- .guided-story-caption small {
- display: block;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+
+ html[data-preset="editorial"] .card {
+ position: relative;
+ border-radius: 0.28rem;
+ background: var(--panel);
+ box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
}
- .guided-story-caption strong { color: var(--toolbar-text); font-size: 0.6875rem; line-height: 1.3; }
- .guided-story-caption small { color: var(--text-muted); font-size: 0.5625rem; line-height: 1.35; }
- .guided-story-caption-next {
- grid-column: 3;
- grid-row: 1 / span 2;
- display: grid;
- min-width: 6.4rem;
- max-width: 9.5rem;
- align-self: stretch;
- align-content: center;
- padding-left: 0.58rem;
- border-left: 1px solid color-mix(in srgb, var(--frontend-stroke) 22%, var(--toolbar-border));
+ html[data-preset="editorial"] .card::before {
+ position: absolute;
+ top: -1px;
+ left: 1.25rem;
+ width: 3.25rem;
+ border-top: 3px solid var(--arrow-emphasis);
+ content: "";
}
- .guided-story-caption-next[hidden] { display: none; }
- .guided-story-caption-next small {
- color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--text-muted));
- font-weight: 800;
- letter-spacing: 0.09em;
- text-transform: uppercase;
+ html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
+
+ /* Summary rail: the reader measures the viewport and enables it only when the
+ diagram keeps its readable width beside the notes. */
+ .reader-rail { display: contents; }
+ html[data-reader-rail="true"] .container {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) var(--archify-rail-width);
+ grid-auto-flow: row dense;
+ column-gap: var(--archify-rail-gap);
+ align-items: start;
}
- .guided-story-caption-next strong { color: var(--text-muted); font-weight: 700; }
- html[data-preset="blueprint"] .guided-story-caption { border-radius: 0.2rem; }
- .guided-views[data-story-beat] .guided-view-copy > #guided-view-label,
- .guided-views[data-story-beat] .guided-view-copy > #guided-view-note { display: none; }
- @keyframes archify-story-caption-in {
- from { opacity: 0; transform: translateY(3px); }
- to { opacity: 1; transform: translateY(0); }
+ html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
+ html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
+ the index keeps a usable share instead of collapsing to its header. */
+ html[data-reader-rail="true"] .reader-rail {
+ display: flex;
+ flex-direction: column;
+ grid-column: 2;
+ align-self: stretch;
+ min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
- .guided-view-trail {
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
display: flex;
- align-items: center;
- gap: 0.28rem;
- min-width: 0;
- min-height: 1.7rem;
+ flex: 0 1 auto;
+ flex-direction: column;
+ gap: 0;
+ min-height: 0;
margin-top: 0;
- padding: 0;
- overflow-x: auto;
- color: var(--text-faint);
- overscroll-behavior-x: contain;
- touch-action: pan-x;
+ padding: 0.125rem 0 0;
+ overflow-y: auto;
scrollbar-width: none;
- white-space: nowrap;
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
}
- .guided-view-trail[hidden] { display: none; }
- .guided-view-trail::-webkit-scrollbar { display: none; }
- .guided-view-trail .guided-view-stop {
- appearance: none;
- box-sizing: border-box;
- display: inline-flex;
- flex: 0 0 auto;
- align-items: center;
- gap: 0.28rem;
- min-height: 1.5rem;
- padding: 0.1rem 0.3rem 0.1rem 0.18rem;
- border: 1px solid transparent;
- border-radius: 999px;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards::-webkit-scrollbar { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card { flex: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card {
+ padding: 0 0.25rem 1.125rem;
+ border: 0;
+ border-radius: 0;
background: transparent;
- color: var(--text-muted);
- cursor: pointer;
- font-family: inherit;
- font-size: 0.5625rem;
- font-weight: 650;
- letter-spacing: 0.02em;
- line-height: 1;
- transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
+ box-shadow: none;
}
- .guided-view-stop:hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);
- background: color-mix(in srgb, var(--frontend-fill) 34%, transparent);
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card + .card {
+ padding-top: 1.125rem;
+ border-top: 1px solid var(--panel-border);
}
- .guided-view-stop:focus-visible {
- outline: 2px solid var(--frontend-stroke);
- outline-offset: 1px;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card::before { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .card-header { gap: 0.55rem; margin-bottom: 0.45rem; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card h3 { font-size: 0.875rem; letter-spacing: -0.005em; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card ul { font-size: 0.8125rem; line-height: 1.6; }
+
+ .node-outline { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .node-outline:not([hidden]) {
+ display: flex;
+ flex: 1 0 min(13rem, 55%);
+ flex-direction: column;
+ min-height: 0;
+ margin-top: 0.25rem;
+ overflow: hidden;
+ border-top: 1px solid var(--panel-border);
}
- .guided-view-stop:disabled { cursor: wait; }
- .guided-view-stop::before {
- display: inline-grid;
- width: 1rem;
- height: 1rem;
- place-items: center;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));
- border-radius: 50%;
- background: color-mix(in srgb, var(--frontend-fill) 58%, var(--toolbar-bg));
- color: var(--frontend-stroke);
- content: attr(data-story-number);
- font-size: 0.5rem;
- line-height: 1;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty + .node-outline:not([hidden]) { margin-top: 0; border-top: 0; }
+ /* Collapsed: only the reveal control remains, so the diagram takes the width. */
+ html[data-reader-rail="collapsed"] .reader-rail { display: none; }
+ /* Overlay: a drawer for diagrams whose readable floor leaves no room to dock. */
+ html[data-reader-rail="overlay"] .reader-rail {
+ position: fixed;
+ z-index: 150;
+ top: 1rem;
+ right: 1rem;
+ bottom: 1rem;
+ display: flex;
+ flex-direction: column;
+ width: var(--archify-rail-width);
+ padding: 0.75rem 1rem 0.5rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
+ border-radius: 1rem;
+ background: var(--toolbar-menu-bg);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 28px 64px -18px rgba(15, 23, 42, 0.38);
+ animation: rail-drawer-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
- .guided-view-stop + .guided-view-stop::after {
- order: -1;
- color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--text-faint));
- content: '\00b7';
- font-size: 0.65rem;
+ @keyframes rail-drawer-in {
+ from { opacity: 0; transform: translateX(0.75rem); }
+ to { opacity: 1; transform: translateX(0); }
}
- .guided-view-stop[data-story-link="forward"]::after { content: '\2192'; }
- .guided-view-stop[data-story-link="reverse"]::after { content: '\2190'; }
- .guided-view-stop[data-story-link="multiple"]::after { content: '\21c4'; }
- .guided-view-stop[data-story-beat-state="pending"] { opacity: 0.38; }
- .guided-view-stop[data-story-beat-state="next"] {
- border-style: dashed;
- border-color: color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));
- color: color-mix(in srgb, var(--toolbar-text) 68%, var(--text-muted));
- opacity: 0.58;
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
+ html[data-reader-rail="bottom"] .reader-rail {
+ display: grid;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
+ margin-top: 1rem;
}
- .guided-view-stop[data-story-beat-state="past"] { color: var(--text-muted); opacity: 0.76; }
- .guided-view-stop[data-story-beat-state="active"] {
- border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border));
- background: color-mix(in srgb, var(--frontend-fill) 42%, transparent);
- color: var(--toolbar-text);
- font-weight: 800;
- opacity: 1;
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards:empty { display: none; }
+ html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
+ border: 1px solid var(--panel-border);
+ border-radius: 0.75rem;
+ background: var(--panel);
}
- .guided-view-stop[data-story-beat-state="active"]::before {
- border-color: var(--frontend-stroke);
- box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 54%, transparent);
- }
- html[data-preset="blueprint"] .guided-view-stop,
- html[data-preset="blueprint"] .guided-view-stop::before { border-radius: 0.1rem; }
- html[data-preset="blueprint"] .guided-view-stop[data-story-beat-state="active"]::before { box-shadow: none; }
- .guided-view-actions { display: flex; align-items: stretch; gap: 0.2rem; }
- .guided-view-actions button { white-space: nowrap; }
- .guided-view-play {
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
+ .rail-controls { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
+ display: flex;
+ flex: none;
+ justify-content: flex-end;
+ gap: 0.125rem;
+ margin: -0.25rem -0.25rem 0.25rem 0;
+ }
+ .rail-control {
+ display: inline-grid;
+ place-items: center;
+ width: 1.875rem;
+ height: 1.875rem;
+ border: 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: background 0.14s ease, color 0.14s ease;
+ }
+ .rail-control[hidden] { display: none; }
+ .rail-control:hover,
+ .rail-control:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
+ .rail-control:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: -1.5px; }
+ .rail-control-icon,
+ .rail-reveal-icon {
+ width: 1rem;
+ height: 1rem;
+ background: currentColor;
+ -webkit-mask: var(--rail-glyph) center / contain no-repeat;
+ mask: var(--rail-glyph) center / contain no-repeat;
+ }
+ /* Panel glyphs: a frame with the panel drawn on the side it moves to. */
+ .rail-control-icon.placement,
+ #rail-placement[data-placement="right"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M2.8 12h14.4'/%3E%3C/g%3E%3C/svg%3E"); }
+ #rail-placement[data-placement="bottom"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4'/%3E%3C/g%3E%3C/svg%3E"); }
+ .rail-control-icon.collapse { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m8 5.5 4.5 4.5L8 14.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
+ .rail-reveal-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4M14.4 7.2h1M14.4 9.6h1M14.4 12h1'/%3E%3C/g%3E%3C/svg%3E"); }
+ .rail-reveal[hidden] { display: none; }
+ /* The collapsed rail leaves one quiet pill in the canvas corner. */
+ .rail-reveal {
+ position: absolute;
+ z-index: 13;
+ top: 0.75rem;
+ right: 0.75rem;
display: inline-flex;
align-items: center;
- justify-content: center;
- gap: 0.38rem;
- min-width: 6.25rem !important;
- color: var(--frontend-stroke) !important;
- font-size: 0.625rem !important;
+ gap: 0.45rem;
+ min-height: 2rem;
+ padding: 0 0.75rem 0 0.625rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--panel) 86%, transparent);
+ color: var(--text-muted);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px -12px rgba(15, 23, 42, 0.28);
+ backdrop-filter: blur(12px);
+ font: inherit;
+ font-size: 0.75rem;
+ font-weight: 500;
+ cursor: pointer;
+ transition: color 0.14s ease, background 0.14s ease;
}
- .guided-view-play[aria-pressed="true"] { background: var(--toolbar-hover); }
- .guided-view-all { min-width: 3.25rem !important; color: var(--text-muted) !important; font-size: 0.625rem !important; }
- .guided-view-beat-link {
- display: inline-flex;
+ .rail-reveal:hover,
+ .rail-reveal:focus-visible { color: var(--text); background: var(--panel); }
+ .rail-reveal:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: 2px; }
+ html[data-motion="still"] .reader-rail { animation: none !important; }
+ .node-outline-head {
+ display: flex;
align-items: center;
- justify-content: center;
- gap: 0.3rem;
- min-width: 5.4rem !important;
- min-height: 1.5rem;
- color: var(--text-muted) !important;
- font-size: 0.5625rem !important;
- letter-spacing: 0.025em;
- transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
+ gap: 0.5rem;
+ padding: 1.125rem 0.25rem 0.375rem;
}
- .guided-view-beat-link:not(:disabled):hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));
- color: var(--frontend-stroke) !important;
+ .node-outline-head strong {
+ color: var(--text);
+ font-size: 0.875rem;
+ font-weight: 600;
+ letter-spacing: -0.005em;
}
- .guided-view-beat-link[data-copy-state="copied"] {
- border-color: color-mix(in srgb, var(--backend-stroke) 58%, var(--toolbar-border));
- background: color-mix(in srgb, var(--backend-fill) 46%, transparent);
- color: var(--backend-stroke) !important;
+ .node-outline-count {
+ min-width: 1.35rem;
+ padding: 0.1rem 0.4rem;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 6%, transparent);
+ color: var(--text-muted);
+ font-size: 0.6875rem;
+ font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
+ font-variant-numeric: tabular-nums;
}
- .guided-view-index {
- grid-column: 1 / -1;
- min-width: 0;
- padding: 0.28rem 0.12rem 0.08rem;
- overflow: hidden;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- @media (min-width: 721px) {
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-index,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-beat-link,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-all,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-trail,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-label,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-note { display: none; }
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-story-caption { margin-top: 0.08rem; }
- }
- .guided-view-chapters {
- display: flex;
- gap: 0.28rem;
- min-width: 0;
- margin: 0;
- padding: 0.08rem 0.05rem 0.2rem;
- overflow-x: auto;
+ .node-outline-list {
+ flex: 1 1 auto;
+ min-height: 0;
+ margin: 0 -0.375rem;
+ padding: 0 0 1.25rem;
+ overflow-y: auto;
list-style: none;
- scroll-padding-inline: 0.05rem;
- scroll-snap-type: x proximity;
scrollbar-width: none;
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
+ }
+ .node-outline-list::-webkit-scrollbar { display: none; }
+ .node-outline-group + .node-outline-group { margin-top: 0.25rem; }
+ .node-outline-group > ul {
+ position: relative;
+ list-style: none;
}
- .guided-view-chapters::-webkit-scrollbar { display: none; }
- .guided-view-chapters li {
+ /* A quiet spine ties each group's swatches together like a lane. */
+ .node-outline-group > ul::before {
+ position: absolute;
+ top: 0.95rem;
+ bottom: 0.95rem;
+ left: calc(0.625rem + 0.3125rem - 0.5px);
+ width: 1px;
+ background: var(--panel-border);
+ content: "";
+ }
+ .node-outline-heading {
display: flex;
- flex: 1 1 0;
- min-width: 9.5rem;
- scroll-snap-align: center;
+ align-items: baseline;
+ justify-content: space-between;
+ padding: 0.7rem 0.625rem 0.25rem;
+ color: var(--text-faint);
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.02em;
}
- .guided-view-chapter {
+ .node-outline-heading small {
+ color: var(--text-dim);
+ font-size: 0.6875rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
+ }
+ /* The rail frees the vertical budget, so compact viewports keep the normal
+ title spacing instead of the stacked layout's tight stage rail. */
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
+ .node-outline-item {
position: relative;
- display: grid !important;
- grid-template-columns: 1.55rem minmax(0, 1fr) auto;
+ display: grid;
+ grid-template-columns: 0.625rem minmax(0, auto) minmax(0, 1fr) 0.75rem;
align-items: center;
+ column-gap: 0.625rem;
width: 100%;
- min-height: 2.75rem;
- padding: 0.36rem 0.48rem !important;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent) !important;
- border-radius: 0.48rem !important;
- background: color-mix(in srgb, var(--toolbar-bg) 88%, transparent) !important;
- color: var(--text-muted) !important;
+ min-height: 1.95rem;
+ padding: 0.28rem 0.5rem 0.28rem 0.625rem;
+ border: 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ color: var(--text);
+ font: inherit;
text-align: left;
- transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
- }
- .guided-view-chapter:hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--toolbar-border)) !important;
- background: color-mix(in srgb, var(--frontend-fill) 42%, var(--toolbar-bg)) !important;
- }
- .guided-view-chapter:focus-visible {
- outline: 2px solid var(--frontend-stroke);
- outline-offset: 1px;
- }
- .guided-view-chapter-index {
- display: inline-grid;
- width: 1.32rem;
- height: 1.32rem;
- place-items: center;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));
- border-radius: 50%;
- color: var(--frontend-stroke);
- font-size: 0.5rem;
- font-weight: 800;
- letter-spacing: 0.03em;
+ cursor: pointer;
+ transition: background 0.16s ease;
}
- .guided-view-chapter-title {
- min-width: 0;
+ /* Trailing chevron hints that a click focuses the node. */
+ .node-outline-item::after {
+ grid-column: 4;
+ width: 0.75rem;
+ height: 0.75rem;
+ background: currentColor;
+ color: var(--text-muted);
+ content: "";
+ opacity: 0;
+ transform: translateX(-3px);
+ transition: opacity 0.16s ease, transform 0.16s ease;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
+ }
+ .node-outline-item:hover,
+ .node-outline-item:focus-visible,
+ .node-outline-item[data-previewing] { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
+ .node-outline-item:hover::after,
+ .node-outline-item:focus-visible::after { opacity: 0.7; transform: translateX(0); }
+ .node-outline-item:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--outline-tone) 60%, transparent); outline-offset: -1.5px; }
+ .node-outline-item[aria-current="true"] { background: color-mix(in srgb, var(--outline-tone) 10%, transparent); }
+ .node-outline-item[aria-current="true"]::after { opacity: 0; }
+ /* Swatches echo the diagram's node cards: tinted fill, hairline stroke. */
+ .node-outline-dot {
+ width: 0.625rem;
+ height: 0.5rem;
+ border: 1.25px solid var(--outline-tone);
+ border-radius: 0.15rem;
+ background: color-mix(in srgb, var(--outline-tone) 16%, var(--bg));
+ transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
+ }
+ .node-outline-item:hover .node-outline-dot,
+ .node-outline-item:focus-visible .node-outline-dot,
+ .node-outline-item[data-previewing] .node-outline-dot,
+ .node-outline-item[aria-current="true"] .node-outline-dot {
+ background: var(--outline-tone);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--outline-tone) 18%, transparent);
+ transform: scale(1.08);
+ }
+ .node-outline-item strong {
overflow: hidden;
- color: var(--toolbar-text);
- font-size: 0.625rem;
- font-weight: 700;
- line-height: 1.3;
+ font-size: 0.8125rem;
+ font-weight: 500;
text-overflow: ellipsis;
white-space: nowrap;
}
- .guided-view-chapter-count {
- grid-column: 3;
- grid-row: 1;
- margin-left: 0.38rem;
- color: var(--text-faint);
- font-size: 0.5rem;
- font-style: normal;
- font-weight: 650;
- white-space: nowrap;
- }
- .guided-view-chapter-delta {
- display: inline-flex;
- grid-column: 3;
- grid-row: 1;
- align-items: center;
- gap: 0.22rem;
- margin-left: 0.38rem;
+ .node-outline-item[aria-current="true"] strong { font-weight: 600; }
+ .node-outline-item small {
+ overflow: hidden;
color: var(--text-faint);
- font-size: 0.5rem;
- font-weight: 750;
- letter-spacing: 0.01em;
+ font-size: 0.6875rem;
+ text-align: right;
+ text-overflow: ellipsis;
white-space: nowrap;
+ transition: color 0.16s ease;
}
- .guided-view-chapter-delta[hidden] { display: none; }
- .guided-view-chapter-delta [data-delta-kind="stay"] { color: var(--text-muted); }
- .guided-view-chapter-delta [data-delta-kind="enter"] { color: var(--frontend-stroke); }
- .guided-view-chapter-delta [data-delta-kind="leave"] { color: var(--security-stroke); }
- .guided-view-chapter[data-preview-active="true"] {
- border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border)) !important;
- background: color-mix(in srgb, var(--frontend-fill) 54%, var(--toolbar-bg)) !important;
- }
- .guided-view-chapter[data-chapter-position="current"] {
- border: 2px solid var(--frontend-stroke) !important;
- padding: calc(0.36rem - 1px) calc(0.48rem - 1px) !important;
- box-shadow: inset 3px 0 0 var(--frontend-stroke);
- color: var(--toolbar-text) !important;
- }
- .guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index {
- background: var(--frontend-stroke);
- color: var(--bg);
- }
- .guided-view-chapter[data-chapter-position="before"] {
- border-style: solid !important;
- opacity: 0.72;
- }
- .guided-view-chapter[data-chapter-position="after"] { border-style: dashed !important; }
- html[data-preset="signal-flow"] .guided-view-chapter[data-chapter-position="current"] {
- box-shadow: inset 3px 0 0 var(--frontend-stroke), 0 0 18px color-mix(in srgb, var(--frontend-stroke) 18%, transparent);
- }
- html[data-preset="blueprint"] .guided-view-chapter,
- html[data-preset="blueprint"] .guided-view-chapter-index { border-radius: 0.12rem !important; }
+ .node-outline-item:hover small,
+ .node-outline-item[data-previewing] small,
+ .node-outline-item[aria-current="true"] small { color: var(--text-muted); }
- /* Story Shelf — keep every authored chapter and the Play action visible,
- but do not spend a second row on unavailable director controls before
- the reader enters a chapter. Existing data-active-view state expands
- the full guided surface without a new toggle or stored preference. */
- .guided-views[data-active-view="all"] {
- grid-template-columns: minmax(11rem, .72fr) auto minmax(0, 2fr);
+ .card-header {
+ display: flex;
align-items: center;
- padding: 0.28rem 0.35rem;
- }
- .guided-views[data-active-view="all"] > #guided-view-prev,
- .guided-views[data-active-view="all"] > #guided-view-next,
- .guided-views[data-active-view="all"] .guided-view-beat-link,
- .guided-views[data-active-view="all"] .guided-view-all { display: none; }
- .guided-views[data-active-view="all"] .guided-view-copy {
- grid-column: 1;
- grid-row: 1;
- padding: 0.1rem 0.55rem;
- }
- .guided-views[data-active-view="all"] .guided-view-copy > #guided-view-note { display: none; }
- .guided-views[data-active-view="all"] .guided-view-actions {
- display: block;
- grid-column: 2;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-play { min-height: 2.75rem; }
- .guided-views[data-active-view="all"] .guided-view-index {
- grid-column: 3;
- grid-row: 1;
- padding: 0 0.08rem 0 0.42rem;
- border-top: 0;
- border-left: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- .guided-views[data-active-view="all"] .guided-view-chapters {
- gap: 0.3rem;
- padding: 0;
- }
-
- .cards {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
- gap: 1rem;
- margin-top: 2rem;
- }
-
- .card {
- background: var(--panel);
- border-radius: 0.75rem;
- border: 1px solid var(--panel-border);
- padding: 1.25rem;
- }
-
- html[data-preset="signal-flow"] .card {
- background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
- }
- html[data-preset="signal-flow"][data-theme="light"] .card {
- background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
- }
-
- /* Preserve the one-screen guarantee on ordinary laptop displays. The
- high-screen expansion above must not trade a fuller canvas for page
- scrolling at 900–1080px heights. */
- @media (min-width: 768px) and (max-height: 1100px) {
- .header { margin-bottom: 1rem; }
- .diagram-container {
- padding: 0.875rem;
- padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
- }
- .cards { margin-top: 1rem; }
- .card { padding: 1rem; }
- }
- @media (min-width: 768px) and (max-height: 920px) {
- body { padding-block: 1.25rem; }
- .header { margin-bottom: 0.875rem; }
- .cards { margin-top: 0.75rem; }
- html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
- html[data-nav-stage-rail="true"] .header { margin-bottom: 0.5rem; }
- html[data-nav-stage-rail="true"] .guided-views { margin-bottom: 0.375rem; }
- html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
- html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
- }
-
- html[data-preset="blueprint"] .card {
- position: relative;
- border-color: var(--panel-border);
- border-radius: 0.3rem;
- background: var(--panel);
- box-shadow: none;
- }
- html[data-preset="blueprint"] .card::before {
- content: "";
- position: absolute;
- top: -1px;
- left: 1rem;
- width: 2.5rem;
- border-top: 2px solid var(--frontend-stroke);
- }
-
- html[data-preset="editorial"] .card {
- position: relative;
- border-radius: 0.28rem;
- background: var(--panel);
- box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
- }
- html[data-preset="editorial"] .card::before {
- position: absolute;
- top: -1px;
- left: 1.25rem;
- width: 3.25rem;
- border-top: 3px solid var(--arrow-emphasis);
- content: "";
- }
- html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
-
- .card-header {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- margin-bottom: 0.75rem;
+ gap: 0.5rem;
+ margin-bottom: 0.625rem;
}
.card-dot {
+ flex: none;
width: 8px;
height: 8px;
border-radius: 50%;
@@ -3073,15 +2896,40 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.card-dot.orange { background: var(--messagebus-stroke); }
.card-dot.slate { background: var(--external-stroke); }
- .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }
+ .card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.card ul {
list-style: none;
color: var(--text-muted);
- font-size: 0.75rem;
+ font-size: 0.8125rem;
+ line-height: 1.6;
}
- .card li { margin-bottom: 0.375rem; }
+ .card li {
+ position: relative;
+ margin-bottom: 0.3rem;
+ padding-left: 0.9rem;
+ }
+ .card li:last-child { margin-bottom: 0; }
+ /* Hanging markers take the card's tone so wrapped lines align under text. */
+ .card li::before {
+ position: absolute;
+ top: calc(0.8em - 2px);
+ left: 0.2rem;
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ background: color-mix(in srgb, var(--card-tone, var(--text-muted)) 70%, transparent);
+ content: "";
+ }
+ .card:has(.card-dot.cyan) { --card-tone: var(--frontend-stroke); }
+ .card:has(.card-dot.emerald) { --card-tone: var(--backend-stroke); }
+ .card:has(.card-dot.violet) { --card-tone: var(--database-stroke); }
+ .card:has(.card-dot.amber) { --card-tone: var(--cloud-stroke); }
+ .card:has(.card-dot.rose) { --card-tone: var(--security-stroke); }
+ .card:has(.card-dot.orange) { --card-tone: var(--messagebus-stroke); }
+ .card:has(.card-dot.slate) { --card-tone: var(--external-stroke); }
+ .card-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-tone, transparent) 16%, transparent); }
/* ==========================================================
Print stylesheet — hide interactive controls, force light,
@@ -3126,11 +2974,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
body { background: #ffffff !important; padding: 0; }
.container { max-width: none; }
- .toolbar, .diagram-nav, .focus-chip, .guided-views, .archify-toast, .no-print { display: none !important; }
- .chapter-handoff-overlay { display: none !important; }
- svg [data-node-id][data-chapter-role] { opacity: 1 !important; }
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] { opacity: 1 !important; filter: none !important; }
+ .toolbar, .diagram-nav, .focus-chip, .archify-toast, .no-print { display: none !important; }
+
.diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }
.diagram-container { --archify-nav-reserve: 0px !important; }
html[data-preset="signal-flow"] .diagram-container,
@@ -3156,16 +3001,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.relationship-hit-overlay { display: none !important; }
.relationship-pulse-overlay { display: none !important; }
.route-probe-overlay, .route-journey-overlay { display: none !important; }
- .story-trail-overlay,
- .story-carrier-overlay { display: none !important; }
.diagram-container svg[data-focus-active] [data-node-id],
.diagram-container svg[data-focus-active] [data-edge-from],
+ .diagram-container svg[data-focus-active] [data-graph-role="automatic-crossover-underlay"],
.diagram-container svg[data-reach-active] [data-node-id],
.diagram-container svg[data-reach-active] [data-edge-from],
- .diagram-container svg[data-story-beat] [data-story-step],
- .diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],
+ .diagram-container svg[data-reach-active] [data-graph-role="automatic-crossover-underlay"],
.diagram-container svg[data-route-active] [data-node-id],
- .diagram-container svg[data-route-active] [data-edge-from] {
+ .diagram-container svg[data-route-active] [data-edge-from],
+ .diagram-container svg[data-route-active] [data-graph-role="automatic-crossover-underlay"] {
opacity: 1 !important;
filter: none !important;
animation: none !important;
@@ -3176,61 +3020,162 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ==========================================================
TOOLBAR (theme toggle + export menu)
========================================================== */
+ /* The toolbar tracks the centered reader column and the title row, so
+ an adaptive narrow reader does not leave its controls stranded at the
+ viewport edge. */
.toolbar {
- position: fixed;
- top: 1rem;
- right: 1rem;
+ position: absolute;
+ top: var(--archify-page-top);
+ right: max(1rem, calc((100vw - min(100vw - 4rem, var(--archify-reader-width, 1440px))) / 2));
display: flex;
align-items: center;
- gap: 0.5rem;
+ gap: 0.125rem;
padding: 0;
border: 0;
background: transparent;
box-shadow: none;
z-index: 100;
}
+ /* Ghost controls keep a 44px hit area while the visible pill stays compact;
+ Export is the one primary action. */
.toolbar button {
- background: var(--toolbar-bg);
- color: var(--toolbar-text);
- border: 1px solid var(--toolbar-border);
- padding: 0.5rem 0.875rem;
- border-radius: 0.625rem;
+ position: relative;
+ isolation: isolate;
+ background: transparent;
+ color: var(--text-muted);
+ border: 0;
+ padding: 0.5rem 0.75rem;
+ border-radius: 0.5625rem;
font-family: inherit;
- font-size: 0.75rem;
+ font-size: 0.8125rem;
font-weight: 500;
cursor: pointer;
white-space: nowrap;
- backdrop-filter: blur(10px);
- box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
- transition: background 0.15s, border-color 0.15s, color 0.15s;
+ box-shadow: none;
+ transition: color 0.15s;
display: inline-flex;
align-items: center;
- gap: 0.375rem;
+ gap: 0.4rem;
min-height: 2.75rem;
}
- .toolbar button:hover {
- background: var(--toolbar-hover);
- border-color: color-mix(in srgb, var(--arrow) 62%, var(--toolbar-border));
+ .toolbar button::before {
+ position: absolute;
+ z-index: -1;
+ inset: 0.375rem 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ content: "";
+ transition: background 0.15s, box-shadow 0.15s;
}
+ .toolbar button:hover { color: var(--text); }
+ .toolbar button:hover::before { background: color-mix(in srgb, var(--text) 6%, transparent); }
.toolbar button[aria-expanded="true"],
- .toolbar button[aria-pressed="true"]:not(#btn-theme) {
- background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));
- border-color: color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));
+ .toolbar button[aria-pressed="true"]:not(#btn-theme) { color: var(--text); }
+ .toolbar button[aria-expanded="true"]::before,
+ .toolbar button[aria-pressed="true"]:not(#btn-theme)::before {
+ background: color-mix(in srgb, var(--text) 8%, transparent);
}
.toolbar #btn-export {
- padding-right: 0.82rem;
- padding-left: 0.82rem;
+ margin-left: 0.375rem;
+ padding-right: 0.95rem;
+ padding-left: 1rem;
+ color: var(--bg);
+ font-weight: 550;
}
- .toolbar #btn-export:hover,
- .toolbar #btn-export[aria-expanded="true"] {
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));
- border-color: color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));
+ .toolbar #btn-export::before {
+ background: var(--text);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -8px rgba(15, 23, 42, 0.4);
}
+ .toolbar #btn-export:hover,
+ .toolbar #btn-export[aria-expanded="true"] { color: var(--bg); }
+ .toolbar #btn-export:hover::before,
+ .toolbar #btn-export[aria-expanded="true"]::before { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.toolbar button:focus-visible {
outline: 2px solid var(--frontend-stroke);
- outline-offset: 2px;
+ outline-offset: -4px;
+ }
+ .toolbar { gap: 0.5rem; }
+ .toolbar #btn-export { margin-left: 0; }
+ .toolbar #btn-export::before { inset: 0.25rem 0; border-radius: 0.6875rem; }
+ /* Tools share one quiet capsule; the capsule is drawn inside the 44px row
+ so the controls keep their hit area without a tall visible box. */
+ .toolbar-group {
+ position: relative;
+ isolation: isolate;
+ display: flex;
+ align-items: center;
+ gap: 0.0625rem;
+ padding: 0 0.25rem;
+ }
+ .toolbar-group::before {
+ position: absolute;
+ z-index: -1;
+ inset: 0.25rem 0;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
+ border-radius: 0.6875rem;
+ background: color-mix(in srgb, var(--panel) 78%, transparent);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.22);
+ backdrop-filter: blur(12px);
+ content: "";
+ }
+ .toolbar-group button { padding-inline: 0.625rem; }
+ .toolbar-group button::before { inset: 0.5rem 0; border-radius: 0.5rem; }
+ /* Theme becomes a sliding switch; its label stays for assistive tech. */
+ .toolbar #theme-label,
+ .toolbar #present-label {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip: rect(0 0 0 0);
+ white-space: nowrap;
}
+ .toolbar #btn-theme {
+ width: 3.5rem;
+ padding: 0;
+ justify-content: center;
+ }
+ .toolbar #btn-theme::before {
+ inset: 0.75rem 0.4375rem;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 9%, transparent);
+ box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
+ }
+ .toolbar #btn-theme:hover::before { background: color-mix(in srgb, var(--text) 13%, transparent); }
+ .toolbar #btn-theme::after {
+ position: absolute;
+ z-index: 0;
+ top: 50%;
+ left: 0.5625rem;
+ width: 1.125rem;
+ height: 1.125rem;
+ border-radius: 50%;
+ background: var(--panel);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.12);
+ content: "";
+ transform: translateY(-50%);
+ transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ .toolbar #theme-icon {
+ position: absolute;
+ z-index: 1;
+ top: 50%;
+ left: calc(0.5625rem + 0.1875rem);
+ width: 0.75rem;
+ height: 0.75rem;
+ color: var(--cloud-stroke);
+ transform: translateY(-50%);
+ transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ [data-theme="dark"] .toolbar #btn-theme::before { background: rgba(148, 163, 184, 0.16); }
+ [data-theme="dark"] .toolbar #btn-theme::after { left: calc(100% - 0.5625rem - 1.125rem); background: #3b4a63; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
+ [data-theme="dark"] .toolbar #theme-icon { left: calc(100% - 0.5625rem - 1.125rem + 0.1875rem); color: #c7d2fe; }
+ .toolbar #btn-present { width: 2.5rem; padding: 0; justify-content: center; }
+ .toolbar #btn-present .toolbar-icon { width: 1rem; height: 1rem; }
+ html[data-motion="still"] .toolbar #btn-theme::after,
+ html[data-motion="still"] .toolbar #theme-icon { transition: none; }
+ html[data-present="true"]:not([data-embed="true"]) .toolbar { right: 1rem; }
+ html[data-preset="editorial"] .toolbar { border-radius: 0.45rem; }
.toolbar #btn-motion[hidden] { display: none !important; }
.toolbar #btn-motion { min-width: 4.4rem; }
.toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }
@@ -3304,19 +3249,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);
transform: rotate(45deg) scale(0.72);
}
+ /* Menus anchor to the tools capsule so they open flush under it. */
+ .toolbar-group .preset-wrap { position: static; }
.toolbar .preset-menu {
position: absolute;
- top: calc(100% + 0.375rem);
+ top: calc(100% + 0.125rem);
right: 0;
display: none;
- width: 18.5rem;
+ width: 17.5rem;
max-width: calc(100vw - 2rem);
- padding: 0.45rem;
- border: 1px solid var(--toolbar-border);
+ padding: 0.375rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
border-radius: 0.875rem;
background: var(--toolbar-menu-bg);
- box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
+ }
+ [data-theme="dark"] .toolbar .preset-menu,
+ [data-theme="dark"] .toolbar .export-menu {
+ border-color: rgba(148, 163, 184, 0.16);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.6);
}
+ /* Menu rows are not toolbar pills: drop the ghost-button pseudo surface. */
+ .toolbar .preset-menu button,
+ .toolbar .export-menu button { isolation: auto; min-height: 0; }
+ .toolbar .preset-menu button::before { display: none; }
.toolbar .preset-menu.open { display: block; }
.toolbar .preset-menu.open,
.toolbar .export-menu.open {
@@ -3329,50 +3285,74 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.preset-menu-heading {
display: flex;
- align-items: baseline;
+ align-items: center;
justify-content: space-between;
gap: 1rem;
- padding: 0.42rem 0.6rem 0.55rem;
+ padding: 0.45rem 0.55rem 0.4rem;
color: var(--text-faint);
- font-size: 0.56rem;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.01em;
}
- .preset-menu-heading span:last-child {
- font-size: 0.52rem;
- letter-spacing: 0.04em;
- text-transform: none;
+ .preset-menu-shortcut {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.35rem;
+ font-weight: 500;
+ }
+ .preset-menu-shortcut kbd {
+ min-width: 1.125rem;
+ padding: 0.05rem 0.3rem;
+ border: 1px solid var(--panel-border);
+ border-bottom-width: 2px;
+ border-radius: 0.3rem;
+ background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
+ color: var(--text-muted);
+ font-family: inherit;
+ font-size: 0.625rem;
+ font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
}
.toolbar .preset-option {
display: grid;
- grid-template-columns: 2rem minmax(0, 1fr) 1rem;
+ grid-template-columns: 2.375rem minmax(0, 1fr) 1rem;
align-items: center;
- gap: 0.68rem;
+ gap: 0.75rem;
width: 100%;
- min-height: 3.35rem;
- padding: 0.5rem 0.62rem;
+ min-height: 3.125rem;
+ margin-top: 0.125rem;
+ padding: 0.45rem 0.6rem 0.45rem 0.5rem;
border: 0;
- border-radius: 0.5rem;
+ border-radius: 0.625rem;
background: transparent;
+ color: var(--text);
box-shadow: none;
backdrop-filter: none;
text-align: left;
+ transition: background 0.14s ease;
}
.toolbar .preset-option:hover,
- .toolbar .preset-option:focus-visible { background: var(--toolbar-hover); }
- .toolbar .preset-option[aria-checked="true"] {
- background: color-mix(in srgb, var(--frontend-stroke) 9%, transparent);
- border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);
+ .toolbar .preset-option:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
+ .toolbar .preset-option[aria-checked="true"] { background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent); }
+ .toolbar .preset-option:focus-visible {
+ outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
+ outline-offset: -1.5px;
}
.preset-option-swatch {
position: relative;
- width: 2rem;
- height: 1.55rem;
+ width: 2.375rem;
+ height: 1.75rem;
overflow: hidden;
- border: 1px solid #64748b;
- border-radius: 0.24rem;
+ border: 0;
+ border-radius: 0.4375rem;
background: #0f172a;
- box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
+ box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);
+ transition: box-shadow 0.14s ease, transform 0.14s ease;
+ }
+ .toolbar .preset-option:hover .preset-option-swatch { transform: translateY(-1px); }
+ .toolbar .preset-option[aria-checked="true"] .preset-option-swatch {
+ box-shadow: 0 0 0 2px var(--toolbar-menu-bg), 0 0 0 3.5px var(--frontend-stroke);
}
.preset-option-swatch::before,
.preset-option-swatch::after { position: absolute; content: ""; }
@@ -3385,6 +3365,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
border-radius: 0.16rem;
background: rgba(34, 211, 238, 0.14);
}
+ /* Classic previews the canvas it will actually produce in this theme. */
+ [data-theme="light"] .preset-option-swatch.classic {
+ background:
+ radial-gradient(circle at 1px 1px, #d9dee5 0.6px, transparent 0.9px) 0 0 / 5px 5px,
+ #ffffff;
+ }
+ [data-theme="light"] .preset-option-swatch.classic::before {
+ border-color: #1b87a3;
+ background: rgba(14, 116, 144, 0.08);
+ box-shadow: 0 2px 4px rgba(17, 24, 39, 0.12);
+ }
.preset-option-swatch.signal-flow {
border-color: #29415f;
background: linear-gradient(135deg, #07101e 10%, #10243c 100%);
@@ -3447,15 +3438,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.preset-option-copy strong,
.preset-option-copy small { display: block; }
.preset-option-copy strong {
- color: var(--toolbar-text);
- font-size: 0.72rem;
- font-weight: 600;
+ color: var(--text);
+ font-size: 0.8125rem;
+ font-weight: 550;
+ letter-spacing: -0.005em;
}
+ .toolbar .preset-option[aria-checked="true"] .preset-option-copy strong { font-weight: 650; }
.preset-option-copy small {
- margin-top: 0.16rem;
+ margin-top: 0.125rem;
overflow: hidden;
color: var(--text-faint);
- font-size: 0.57rem;
+ font-size: 0.6875rem;
font-weight: 400;
white-space: nowrap;
text-overflow: ellipsis;
@@ -3485,9 +3478,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-preset="editorial"] .route-probe,
html[data-preset="editorial"] .focus-chip,
html[data-preset="editorial"] .diagram-guide,
- html[data-preset="editorial"] .node-finder,
- html[data-preset="editorial"] .guided-views,
- html[data-preset="editorial"] .share-chapter-cue {
+ html[data-preset="editorial"] .node-finder {
border-radius: 0.3rem;
}
.motion-control-dot {
@@ -3505,19 +3496,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.toolbar .export-menu {
position: absolute;
- top: calc(100% + 0.375rem);
+ top: calc(100% + 0.125rem);
right: 0;
background: var(--toolbar-menu-bg);
- border: 1px solid var(--toolbar-border);
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
width: 19rem;
max-width: calc(100vw - 2rem);
max-height: calc(100vh - 5.5rem);
overflow-y: auto;
border-radius: 0.875rem;
- padding: 0.55rem;
+ padding: 0.375rem;
display: none;
flex-direction: column;
- box-shadow: 0 18px 48px rgba(0,0,0,0.24);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
+ scrollbar-width: thin;
}
.toolbar .export-menu.open { display: flex; }
.export-menu-header {
@@ -3525,94 +3517,111 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
- padding: 0.5rem 0.55rem 0.72rem;
+ padding: 0.55rem 0.6rem 0.6rem;
}
.export-menu-header strong,
.export-menu-header span { display: block; }
.export-menu-header strong {
- color: var(--toolbar-text);
- font-size: 0.78rem;
- font-weight: 650;
- letter-spacing: -0.015em;
+ color: var(--text);
+ font-size: 0.875rem;
+ font-weight: 600;
+ letter-spacing: -0.005em;
}
.export-menu-header span {
- margin-top: 0.16rem;
+ margin-top: 0.15rem;
color: var(--text-faint);
- font-size: 0.56rem;
+ font-size: 0.75rem;
}
.export-menu-header kbd {
- padding: 0.16rem 0.36rem;
- border: 1px solid var(--toolbar-border);
+ min-width: 1.125rem;
+ padding: 0.05rem 0.3rem;
+ border: 1px solid var(--panel-border);
+ border-bottom-width: 2px;
border-radius: 0.3rem;
- color: var(--text-faint);
- background: color-mix(in srgb, var(--toolbar-border) 16%, transparent);
+ background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
+ color: var(--text-muted);
font-family: inherit;
- font-size: 0.54rem;
+ font-size: 0.625rem;
font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
}
.export-menu-section {
display: grid;
grid-template-columns: minmax(0, 1fr);
- gap: 0.18rem;
+ gap: 0.0625rem;
}
.export-menu-section + .export-menu-section {
- margin-top: 0.42rem;
- padding-top: 0.42rem;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 68%, transparent);
+ margin-top: 0.3rem;
+ padding-top: 0.3rem;
+ border-top: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
}
.export-menu-heading {
grid-column: 1 / -1;
display: block;
- padding: 0.24rem 0.55rem 0.2rem;
+ padding: 0.4rem 0.6rem 0.25rem;
color: var(--text-faint);
- font-size: 0.54rem;
+ font-size: 0.6875rem;
font-weight: 600;
- letter-spacing: 0.12em;
- text-transform: uppercase;
+ letter-spacing: 0.01em;
}
.toolbar .export-menu button {
display: grid;
- grid-template-columns: 1.15rem minmax(0, 1fr);
+ grid-template-columns: 1rem minmax(0, 1fr);
align-items: center;
- column-gap: 0.52rem;
+ column-gap: 0.7rem;
background: transparent;
- border: 1px solid transparent;
+ border: 0;
box-shadow: none;
backdrop-filter: none;
width: 100%;
- min-height: 3rem;
+ min-height: 2.5rem;
text-align: left;
- padding: 0.48rem 0.55rem;
- border-radius: 0.5rem;
+ padding: 0.4rem 0.6rem;
+ border-radius: 0.5625rem;
+ color: var(--text);
white-space: nowrap;
+ transition: background 0.14s ease;
+ }
+ .toolbar .export-menu button:hover,
+ .toolbar .export-menu button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
+ .toolbar .export-menu button:focus-visible {
+ outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
+ outline-offset: -1.5px;
}
+ /* Name and format hint share one line, so each row stays compact. */
.export-item-copy {
- display: block;
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 0.75rem;
min-width: 0;
}
- .export-item-copy strong,
- .export-item-copy small { display: block; }
.export-item-copy strong {
overflow: hidden;
color: inherit;
- font-size: 0.7rem;
- font-weight: 550;
+ font-size: 0.8125rem;
+ font-weight: 500;
text-overflow: ellipsis;
}
.export-item-copy small {
- margin-top: 0.12rem;
- overflow: hidden;
+ flex: none;
color: var(--text-faint);
- font-size: 0.55rem;
+ font-size: 0.6875rem;
font-weight: 450;
- text-overflow: ellipsis;
}
.toolbar .export-menu button::before {
+ position: static;
+ z-index: auto;
+ inset: auto;
+ border-radius: 0;
+ display: block;
width: 1rem;
height: 1rem;
background: currentColor;
+ color: var(--text-muted);
content: "";
- opacity: 0.72;
+ opacity: 0.8;
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
@@ -3620,7 +3629,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
mask-repeat: no-repeat;
mask-size: contain;
}
- .toolbar .export-menu button[data-format="share-card"]::before,
.toolbar .export-menu button[data-action="route-share-card"]::before,
.toolbar .export-menu button[data-action="reach-share-card"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");
@@ -3636,38 +3644,32 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
}
- .toolbar .export-menu button[data-format="svg"]::before,
+ .toolbar .export-menu button[data-format^="svg"]::before,
.toolbar .export-menu button[data-format="webm"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
}
- .toolbar .export-menu button[data-format="share-card"],
.toolbar .export-menu button[data-action="route-share-card"],
.toolbar .export-menu button[data-action="reach-share-card"] {
- min-height: 3.35rem;
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent);
- border-color: color-mix(in srgb, var(--frontend-stroke) 24%, var(--toolbar-border));
+ color: var(--text);
+ background: color-mix(in srgb, var(--frontend-stroke) 7%, transparent);
}
+ .toolbar .export-menu button[data-action="route-share-card"]::before,
+ .toolbar .export-menu button[data-action="reach-share-card"]::before { color: var(--frontend-stroke); opacity: 1; }
.toolbar .export-menu button[hidden] { display: none; }
- .toolbar .export-menu button:hover {
- background: var(--toolbar-hover);
- }
- .toolbar .export-menu button:focus-visible {
- background: var(--toolbar-hover);
- outline-offset: -2px;
+ .toolbar .export-menu button[data-action="route-share-card"]:hover,
+ .toolbar .export-menu button[data-action="reach-share-card"]:hover {
+ background: color-mix(in srgb, var(--frontend-stroke) 12%, transparent);
}
.toolbar .export-menu button:disabled {
color: var(--text-faint);
- background: color-mix(in srgb, var(--toolbar-border) 18%, transparent);
+ background: transparent;
+ opacity: 0.55;
cursor: not-allowed;
}
- .toolbar .export-menu button:disabled:hover {
- border-color: transparent;
- }
.toolbar .export-menu .hint {
color: var(--text-faint);
- font-size: 0.55rem;
+ font-size: 0.6875rem;
}
/* Toast — brief feedback for actions like "copied" */
@@ -3707,6 +3709,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.toolbar {
position: relative;
+ top: auto;
+ right: auto;
justify-content: flex-end;
width: max-content;
max-width: 100%;
@@ -3809,6 +3813,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
width: calc(100% - 1rem);
max-width: none;
}
+ .relationship-lens-head { padding-top: 0.7rem; }
+ .relationship-lens-drag-handle { display: none; }
.relationship-lens-list { max-height: min(12rem, 38vh); }
.relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }
.focus-chip:not([data-relations-expanded="true"]) .relationship-lens-head { border-bottom-color: transparent; }
@@ -3891,95 +3897,24 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.route-journey-controls button { min-height: 2.75rem; }
.route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }
.route-probe-node { max-width: 7.5rem; }
- .guided-views {
- grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
- gap: 0.2rem;
- padding: 0.25rem;
- }
- .guided-view-actions {
- grid-column: 1 / -1;
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- }
- .guided-views > #guided-view-prev,
- .guided-views > #guided-view-next {
- align-self: center;
- height: 2.75rem;
+
+
+
+
+
+
+
+
+
+
+
+ html[data-embed="true"][data-share-playback="true"] .diagram-container {
+ padding-top: 4.25rem;
}
- .guided-view-play,
- .guided-view-all,
- .guided-view-beat-link { min-height: 2.75rem; }
- .guided-view-copy small { white-space: normal; }
- .guided-story-caption { padding: 0.32rem 0.45rem; }
- .guided-story-caption-index { min-width: 2.9rem; padding-right: 0.42rem; }
- .guided-story-caption strong,
- .guided-story-caption small { white-space: normal; }
- .guided-story-caption-next { display: none; }
- .guided-view-trail { min-height: 2rem; }
- .guided-view-trail .guided-view-stop {
- min-height: 2rem;
- padding: 0.22rem 0.42rem 0.22rem 0.28rem;
- }
- .guided-view-handoff { max-width: min(9rem, 32vw); }
- .guided-view-index { padding-top: 0.35rem; }
- .guided-view-chapters {
- gap: 0.35rem;
- scroll-padding-inline: 0.2rem;
- }
- .guided-view-chapters li {
- flex: 0 0 min(14rem, 78vw);
- min-width: 0;
- }
- .guided-view-chapter { min-height: 2.75rem; }
- .guided-views[data-active-view="all"] {
- grid-template-columns: minmax(0, 1fr) auto;
- gap: 0.2rem;
- padding: 0.25rem;
- }
- .guided-views[data-active-view="all"] .guided-view-copy {
- grid-column: 1;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-actions {
- grid-column: 2;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-play {
- min-width: 6rem !important;
- min-height: 2.75rem;
- }
- .guided-views[data-active-view="all"] .guided-view-index {
- grid-column: 1 / -1;
- grid-row: 2;
- padding: 0.3rem 0.08rem 0;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- border-left: 0;
- }
- html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),
- html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {
- top: 0.5rem;
- grid-template-columns: auto minmax(0, 1fr);
- gap: 0.28rem 0.55rem;
- width: calc(100% - 1rem);
- min-height: 0;
- padding: 0.45rem 0.55rem 0.55rem;
- }
- html[data-embed="true"][data-share-playback="true"] .diagram-container {
- padding-top: 4.25rem;
- }
- html[data-embed="true"][data-share-moment="true"] .diagram-container {
- padding-top: 4.25rem;
- }
- .share-chapter-index {
- min-width: 4.4rem;
- padding-right: 0.5rem;
- }
- .share-chapter-copy small { font-size: 0.46rem; }
- .share-chapter-route {
- grid-column: 1 / -1;
- font-size: 0.5rem;
- text-align: left;
+ html[data-embed="true"][data-share-moment="true"] .diagram-container {
+ padding-top: 4.25rem;
}
+
.cards {
grid-template-columns: 1fr;
margin-top: 1rem;
@@ -4022,11 +3957,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
text-overflow: ellipsis;
white-space: nowrap;
}
- html[data-present="true"]:not([data-embed="true"]) .guided-views {
- padding: 0.2rem;
- }
- html[data-present="true"]:not([data-embed="true"]) .guided-view-copy small { display: none; }
- html[data-present="true"]:not([data-embed="true"]) .guided-story-caption small { display: block; }
+
html[data-present="true"]:not([data-embed="true"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }
html[data-present="true"]:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {
width: 720px;
@@ -4038,13 +3969,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
@media (max-width: 420px) {
.export-menu-section { grid-template-columns: 1fr; }
.export-menu-heading,
- .toolbar .export-menu button[data-format="share-card"],
.toolbar .export-menu button[data-action="route-share-card"],
.toolbar .export-menu button[data-action="reach-share-card"] { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
- .guided-story-caption { animation: none !important; }
.toolbar .preset-menu.open,
.toolbar .export-menu.open { animation: none; }
.toolbar-chevron { transition: none; }
@@ -4055,7 +3984,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }
.toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }
#theme-label, #preset-label, #present-label { display: none; }
- .guided-view-handoff { max-width: 6.5rem; }
}
/* ==========================================================
@@ -4063,6 +3991,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
========================================================== */
.c-grid { stroke: var(--grid); fill: none; }
.c-mask { fill: var(--mask); stroke: none; }
+ .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }
+ .c-lane-wash { fill: var(--lane-fill); stroke: none; }
.c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }
.c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }
@@ -4084,6 +4014,41 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.t-messagebus { fill: var(--messagebus-stroke); }
.t-external { fill: var(--external-stroke); }
+ /* Relationship labels share the exact color token used by their path. */
+ .t-edge-default { fill: var(--arrow); }
+ .t-edge-emphasis { fill: var(--arrow-emphasis); }
+ .t-edge-security { fill: var(--security-stroke); }
+ .t-edge-dashed { fill: var(--database-stroke); }
+
+ /* Classic canvas: a quiet dot field replaces drafting grid lines, and nodes
+ read as lifted cards with hairline strokes. Paint only; authored geometry,
+ hit areas and exports keep their canonical shapes. */
+ html[data-preset="classic"] .diagram-container {
+ background:
+ radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 1.4px) 0 0 / 20px 20px,
+ var(--panel);
+ }
+ html[data-preset="classic"] .diagram-container > svg .c-grid { stroke: transparent; }
+ html[data-preset="classic"][data-theme="light"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
+ filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.05)) drop-shadow(0 6px 12px rgba(17, 24, 39, 0.06));
+ }
+ html[data-preset="classic"][data-theme="dark"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
+ filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
+ }
+ html[data-preset="classic"] .diagram-container > svg [data-edge-from] {
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ }
+ html[data-preset="classic"] .diagram-container > svg .c-lane-wash { fill: color-mix(in srgb, var(--text) 2.6%, transparent); }
+ html[data-preset="classic"] .diagram-container > svg .c-lane-rule { stroke: var(--panel-border); opacity: 1; }
+ html[data-preset="classic"][data-theme="dark"] .diagram-container > svg .c-lane-rule { stroke: rgba(148, 163, 184, 0.16); }
+ html[data-preset="classic"] .diagram-container > svg [data-node-id] {
+ transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ html[data-preset="classic"]:not([data-motion="still"]) .diagram-container > svg [data-node-id]:hover {
+ transform: translateY(-1.5px);
+ }
+
/* Semantic Sigils are small authored role stamps, not icons from a brand
pack and not viewer controls. Prefix selectors with svg so the canonical
export's SVG-only stylesheet collector keeps them automatically. */
@@ -4161,8 +4126,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],
svg[data-route-active] [data-route-match][data-detail],
svg[data-route-active] [data-route-match] [data-detail],
- svg[data-story-active] [data-story-step][data-detail],
- svg[data-story-active] [data-story-step] [data-detail],
svg[data-relationship-preview-active] [data-relationship-preview][data-detail],
svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],
svg [data-node-id]:hover [data-detail],
@@ -4176,7 +4139,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],
svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],
svg[data-route-active] [data-route-match] [data-detail-anchor],
- svg[data-story-active] [data-story-step] [data-detail-anchor],
svg [data-node-id]:hover [data-detail-anchor],
svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }
@@ -4195,9 +4157,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* Stable semantic exploration hooks emitted by every renderer. */
svg [data-node-id] {
cursor: pointer;
- transition: opacity 0.18s ease, filter 0.18s ease;
+ transition: opacity 0.18s ease, fill-opacity 0.18s ease, stroke-opacity 0.18s ease, filter 0.18s ease;
}
- svg [data-edge-from] { transition: opacity 0.18s ease, filter 0.18s ease; }
+ svg [data-edge-from],
+ svg [data-graph-role="automatic-crossover-underlay"] { transition: opacity 0.18s ease, filter 0.18s ease; }
svg [data-node-id]:hover,
svg [data-node-id]:focus-visible {
filter: drop-shadow(0 0 7px var(--frontend-stroke));
@@ -4346,9 +4309,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
opacity: 0.78;
}
html[data-embed="true"] .semantic-lens-overlay { display: none; }
+ /* Automatic crossover masks are visual companions of their one semantic
+ edge. Keep the mask free of data-edge-* identity so graph traversal and
+ export still observe exactly one edge, then mirror reader emphasis from
+ the paired foreground path in this presentation-only wrapper. */
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-match]) > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-peer]) > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-peer]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
svg[data-focus-active] [data-node-id],
svg[data-focus-active] [data-edge-from] { opacity: 0.13; }
+ svg[data-focus-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.13; }
+ svg[data-focus-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-focus-active] [data-focus-match] { opacity: 1; }
+ svg[data-focus-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-focus-active] [data-focus-selected] {
filter: drop-shadow(0 0 10px var(--frontend-stroke));
}
@@ -4359,7 +4335,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
changes only viewer emphasis, not canonical geometry or export bytes. */
svg[data-reach-active] [data-node-id],
svg[data-reach-active] [data-edge-from] { opacity: 0.09; }
+ svg[data-reach-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.09; }
svg[data-reach-active] [data-reach-match] { opacity: 1; }
+ svg[data-reach-active] [data-graph-role="automatic-crossover"]:has(> [data-reach-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-reach-active="upstream"] [data-reach-origin] {
filter: drop-shadow(0 0 11px var(--database-stroke));
}
@@ -4413,14 +4391,14 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg[data-relationship-direct-active] [data-node-id],
svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }
+ svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.16; }
svg[data-relationship-direct-active] [data-relationship-preview],
svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }
+ svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,
- svg[data-story-active] .relationship-hit-rail,
svg[data-route-picking] .relationship-hit-rail,
svg[data-route-active] .relationship-hit-rail,
- svg[data-lens-active] .relationship-hit-rail,
- svg[data-chapter-preview] .relationship-hit-rail { pointer-events: none; }
+ svg[data-lens-active] .relationship-hit-rail { pointer-events: none; }
html[data-embed="true"] .relationship-hit-overlay { display: none; }
@media (hover: none), (pointer: coarse) {
.relationship-hit-rail { stroke-width: 24; }
@@ -4430,8 +4408,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
neighborhood focus. It changes emphasis only; exported geometry and the
relationship's original solid/dashed visual language stay untouched. */
svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }
+ svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.18; }
+ svg[data-relationship-preview-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-relationship-preview-active] [data-relationship-preview],
svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }
+ svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-relationship-preview-active] [data-relationship-preview] {
filter: drop-shadow(0 0 5px var(--arrow-emphasis));
}
@@ -4485,9 +4466,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.relationship-flow-token {
animation: archify-relationship-token-life 1.2s linear 1 both;
}
- .story-flow-token {
- animation: archify-relationship-token-life 0.78s linear 1 both;
- }
+
.semantic-flow-token-halo {
fill: var(--mask);
stroke: currentColor;
@@ -4525,9 +4504,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* Intent Trace is a temporary, pre-click exploration layer. Related
topology stays readable while a short viewer-only signal runs over
cloned edge geometry; the authored edge remains untouched underneath. */
- svg[data-intent-trace-active] [data-node-id],
+ /* Keep the node's opaque backing mask intact while its visible ink dims.
+ Fading the whole group also fades that mask and briefly exposes arrows
+ routed underneath the node when the pointer leaves. */
+ svg[data-intent-trace-active] [data-node-id] { fill-opacity: 0.2; stroke-opacity: 0.2; }
+ svg [data-node-id] > .c-mask { fill-opacity: 1; }
+ svg[data-intent-trace-active] [data-node-id][data-intent-trace-match] { fill-opacity: 1; stroke-opacity: 1; }
svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }
+ svg[data-intent-trace-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.2; }
+ svg[data-intent-trace-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }
+ svg[data-intent-trace-active] [data-graph-role="automatic-crossover"]:has(> [data-intent-trace-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-intent-trace-active] [data-intent-trace-selected] {
filter: drop-shadow(0 0 10px var(--frontend-stroke));
}
@@ -4590,7 +4577,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg[data-route-active] [data-node-id],
svg[data-route-active] [data-edge-from] { opacity: 0.11; }
+ svg[data-route-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
svg[data-route-active] [data-route-match] { opacity: 1; }
+ svg[data-route-active] [data-graph-role="automatic-crossover"]:has(> [data-route-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-route-active] [data-route-start] {
filter: drop-shadow(0 0 11px var(--frontend-stroke));
}
@@ -4603,6 +4592,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-route-journey] [data-route-match][data-route-journey-state="past"] { opacity: 0.62; }
svg[data-route-journey] [data-route-match][data-route-journey-state="future"] { opacity: 0.34; }
svg[data-route-journey] [data-route-match][data-route-journey-state="current"] { opacity: 1; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="past"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="future"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.34; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="current"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-route-journey] [data-node-id][data-route-journey-current] {
filter: drop-shadow(0 0 10px var(--backend-stroke));
}
@@ -4694,93 +4686,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: drop-shadow(0 0 3px var(--frontend-stroke));
}
- /* Story Trail is a viewer-only overlay derived from the ordered focus IDs
- of the active guided view. The authored edge stays underneath with its
- original color, dash pattern, marker, and geometry intact. */
- .story-trail-overlay { pointer-events: none; }
- .story-carrier-overlay { pointer-events: none; }
- .story-trail-flow {
- fill: none;
- stroke: var(--frontend-stroke);
- stroke-width: 2.8;
- stroke-linecap: round;
- vector-effect: non-scaling-stroke;
- opacity: 0.34;
- filter: drop-shadow(0 0 2px var(--frontend-stroke));
- }
- svg[data-story-beat] [data-story-step] {
- opacity: 0.22;
- filter: saturate(0.42);
- transition: opacity 180ms ease, filter 180ms ease;
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="past"] {
- opacity: 0.72;
- filter: saturate(0.82);
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="next"] {
- opacity: 0.5;
- filter: saturate(0.66);
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="active"] {
- opacity: 1;
- filter: drop-shadow(0 0 7px var(--frontend-stroke));
- animation: archify-story-beat-node 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- svg[data-story-beat] [data-edge-from][data-story-beat-step] {
- opacity: 0.16;
- transition: opacity 160ms ease;
- }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="past"] { opacity: 0.58; }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="next"] { opacity: 0.34; }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="active"] { opacity: 1; }
- svg[data-story-beat] .story-trail-flow { opacity: 0; transition: opacity 160ms ease; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="past"] { opacity: 0.34; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="next"] { opacity: 0.2; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="active"] { opacity: 0.92; }
- svg[data-story-beat] .story-trail-flow[data-story-pulse="true"] {
- stroke-dasharray: 2 13;
- stroke-dashoffset: 30;
- opacity: 0.92;
- animation: archify-story-flow 0.78s linear 1 both;
- }
- svg[data-preset="blueprint"] .story-trail-flow {
- stroke-linecap: square;
- filter: none;
- opacity: 0.5;
- }
- svg[data-preset="blueprint"][data-story-beat] [data-story-step][data-story-beat-state="active"] {
- filter: none;
- animation: none;
- }
- svg[data-preset="editorial"] .story-trail-flow { filter: none; }
- svg[data-preset="editorial"][data-story-beat] [data-story-step][data-story-beat-state="active"] {
- filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 16%, transparent));
- }
-
- /* Chapter Delta Preview is a static, pre-commit comparison between two
- chapter focus sets. Symbols in the rail carry the meaning without color;
- these SVG rules only make exact stable-ID membership easier to scan. */
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] {
- opacity: 0.1 !important;
- filter: none !important;
- transition: none !important;
- }
- svg[data-chapter-preview] .story-trail-overlay { opacity: 0.08 !important; }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="stay"] {
- opacity: 0.76 !important;
- filter: saturate(0.7) !important;
- }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="enter"] {
- opacity: 1 !important;
- filter: saturate(1.2) !important;
- }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="leave"] {
- opacity: 0.28 !important;
- filter: grayscale(0.72) !important;
- }
- svg[data-preset="blueprint"][data-chapter-preview] [data-node-id] { filter: none !important; }
-
/* Dashed boundary variants */
.c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }
.c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }
@@ -4794,6 +4699,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
animation: archify-edge-flow 2.4s linear 1;
animation-delay: calc(var(--step, 0) * 160ms);
}
+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: archify-edge-flow 2.4s linear 1;
+ animation-delay: calc(var(--step, 0) * 160ms);
+ }
html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="node"] {
transform-box: fill-box;
transform-origin: center;
@@ -4805,6 +4714,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: drop-shadow(0 0 3px var(--arrow-emphasis));
animation-duration: 1.75s;
}
+ svg[data-preset="signal-flow"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 1.75s; }
svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {
animation-duration: 3.1s;
}
@@ -4813,6 +4723,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
animation-duration: 2.15s;
}
+ svg[data-preset="blueprint"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 2.15s; }
svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {
animation-name: archify-blueprint-node-pulse;
animation-duration: 3.8s;
@@ -4821,18 +4732,23 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
animation-duration: 2.2s;
}
+ svg[data-preset="editorial"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 2.2s; }
svg[data-preset="editorial"][data-animation="trace"] [data-animate="node"] {
animation-name: archify-editorial-node-pulse;
animation-duration: 3.5s;
}
- /* Embedded proofs are static until a named Story Trail chapter is played.
- This keeps proof grids calm and ensures ?play=1 stops all viewer motion
- after one 3.2 second chapter instead of leaving ambient trace loops on. */
+ /* Embedded proofs stay static so proof grids are calm instead of leaving
+ ambient trace loops on. */
html[data-embed="true"] svg[data-animation="trace"] [data-animate],
html[data-share-playback="true"] svg[data-animation="trace"] [data-animate] {
animation: none !important;
stroke-dashoffset: 0;
}
+ html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: none !important;
+ stroke-dashoffset: 0;
+ }
@keyframes archify-edge-flow {
0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }
88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }
@@ -4863,13 +4779,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }
55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }
}
- @keyframes archify-guided-progress {
- from { transform: scaleX(var(--guided-progress-start, 0)); }
- to { transform: scaleX(1); }
- }
- @keyframes archify-story-flow {
- to { stroke-dashoffset: 0; }
- }
+
@keyframes archify-intent-trace-flow {
0% { opacity: 0.28; stroke-dashoffset: 0; }
12%, 78% { opacity: 0.94; }
@@ -4900,11 +4810,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
13%, 82% { opacity: 1; }
100% { opacity: 0; }
}
- @keyframes archify-story-beat-node {
- from { opacity: 0.48; filter: saturate(0.6); }
- 58% { opacity: 1; filter: drop-shadow(0 0 10px var(--frontend-stroke)); }
- to { opacity: 1; filter: drop-shadow(0 0 7px var(--frontend-stroke)); }
- }
+
@keyframes archify-share-cue-enter {
from { opacity: 0; transform: translate(-50%, -0.45rem); }
to { opacity: 1; transform: translate(-50%, 0); }
@@ -4922,30 +4828,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
animation: none !important;
stroke-dashoffset: 0;
}
- .guided-view-progress span {
+ svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
animation: none !important;
- transform: scaleX(1) !important;
+ stroke-dashoffset: 0;
}
- .story-trail-flow,
.intent-trace-flow,
.route-probe-flow,
.semantic-lens,
.diagram-guide,
- [data-story-step],
- .overview-map-live,
- .guided-view-stop,
- .share-chapter-cue,
- .chapter-handoff-anchor,
- .share-chapter-state::before,
- .share-chapter-progress span { animation: none !important; }
- .guided-view-chapter,
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] { transition: none !important; }
- svg[data-story-playing="true"] .story-trail-flow {
- stroke-dasharray: none;
- stroke-dashoffset: 0;
- opacity: 0.55;
- }
+ .overview-map-live { animation: none !important; }
+
.intent-trace-flow {
animation: none !important;
stroke-dasharray: none;
@@ -4958,8 +4850,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
stroke-dashoffset: 0;
opacity: 0.78;
}
- .route-journey-overlay,
- .story-carrier-overlay { display: none !important; }
+ .route-journey-overlay { display: none !important; }
.semantic-lens-flow {
animation: none !important;
stroke-dasharray: none;
@@ -4968,7 +4859,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
}
.relationship-pulse-overlay { display: none !important; }
- .guided-view-chapter { transition: none !important; }
.source-evidence-beacon,
svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }
}
@@ -4979,6 +4869,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Motion appears only for trace-enabled artifacts and has no shortcut;
Keyboard: T toggles theme, S cycles style, F toggles the stage, E opens export. -->
<div class="toolbar" role="toolbar" aria-label="Diagram actions">
+ <div class="toolbar-group">
<button id="btn-theme" type="button"
title="Toggle theme (T)"
aria-label="Toggle color theme"
@@ -4999,7 +4890,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>
</button>
<div class="preset-menu" id="preset-menu" role="menu" aria-label="Visual style">
- <div class="preset-menu-heading" role="presentation"><span>Visual identity</span><span>S cycles</span></div>
+ <div class="preset-menu-heading" role="presentation"><span>Visual identity</span><span class="preset-menu-shortcut"><kbd>S</kbd>to cycle</span></div>
<button class="preset-option" data-preset-value="classic" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
<span class="preset-option-swatch classic" aria-hidden="true"></span>
<span class="preset-option-copy"><strong>Classic</strong><small>Stable technical default</small></span>
@@ -5036,6 +4927,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span id="present-icon" class="toolbar-icon" aria-hidden="true"></span>
<span id="present-label">Present</span>
</button>
+ </div>
<div class="export-wrap">
<button id="btn-export" type="button"
title="Export diagram (E)"
@@ -5052,10 +4944,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="export-menu-section" role="group" aria-label="Share">
<span class="export-menu-heading" aria-hidden="true">Share</span>
- <button data-format="share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
<button data-action="route-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>Route Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
<button data-action="reach-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>Reach Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
- <button data-action="copy-share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Copy Share Card</strong><small class="hint">PNG to clipboard</small></span></button>
<button data-action="copy" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Copy diagram</strong><small class="hint">PNG to clipboard</small></span></button>
</div>
<div class="export-menu-section" role="group" aria-label="Raster images">
@@ -5066,7 +4956,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="export-menu-section" role="group" aria-label="Vector and motion">
<span class="export-menu-heading" aria-hidden="true">Vector &amp; motion</span>
- <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG</strong><small class="hint">Editable vector</small></span></button>
+ <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Auto</strong><small class="hint">Matches host theme</small></span></button>
+ <button data-format="svg-light" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Light</strong><small class="hint">Always light</small></span></button>
+ <button data-format="svg-dark" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Dark</strong><small class="hint">Always dark</small></span></button>
<button data-format="webm" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebM</strong><small class="hint">6s motion</small></span></button>
</div>
</div>
@@ -5086,52 +4978,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<p class="subtitle">Agent skill → JSON IR → typed renderers → standalone HTML</p>
</div>
- <script id="archify-guided-views-data" type="application/json">[]</script>
-
- <script id="archify-i18n-data" type="application/json">{"locale":"en","messages":{"viewer.kind.frontend":"Frontend","viewer.kind.backend":"Backend","viewer.kind.database":"Database","viewer.kind.cloud":"Cloud","viewer.kind.security":"Security","viewer.kind.messagebus":"Message bus","viewer.kind.external":"External","viewer.kind.neutral":"Neutral","viewer.kind.node":"Node","viewer.kind.start":"Start","viewer.kind.active":"Active","viewer.kind.waiting":"Waiting","viewer.kind.decision":"Decision","viewer.kind.success":"Success","viewer.kind.failure":"Failure","viewer.toolbar.actions":"Diagram actions","viewer.theme.toggle.title":"Toggle theme (T)","viewer.theme.toggle":"Toggle color theme","viewer.theme.dark":"Dark","viewer.theme.light":"Light","viewer.preset.choose.title":"Choose visual style (S cycles)","viewer.preset.choose":"Choose visual style","viewer.preset.style":"Style","viewer.preset.menu":"Visual style","viewer.preset.identity":"Visual identity","viewer.preset.cycles":"S cycles","viewer.preset.classic":"Classic","viewer.preset.classic.short":"Classic","viewer.preset.classic.hint":"Stable technical default","viewer.preset.flow":"Signal Flow","viewer.preset.flow.short":"Flow","viewer.preset.flow.hint":"Motion-forward presentation","viewer.preset.blueprint":"Blueprint","viewer.preset.blueprint.hint":"Engineering review","viewer.preset.editorial":"Editorial","viewer.preset.editorial.hint":"Publication and launch notes","viewer.preset.badge.signalFlow":"SIGNAL FLOW","viewer.preset.badge.blueprint":"BLUEPRINT / REV 01","viewer.preset.badge.editorial":"EDITORIAL / FIELD NOTE","viewer.preset.badge.editorialPlate":"ARCHIFY / PLATE 04","viewer.preset.current":"Visual style: {style}. Choose visual style","viewer.motion.live":"Live","viewer.motion.still":"Still","viewer.motion.pause":"Pause motion","viewer.motion.resume":"Resume motion","viewer.motion.reduced":"Motion paused by reduced-motion preference","viewer.motion.hidden":"Motion paused while this page is hidden","viewer.motion.yielding":"Pause motion; currently yielding to {owner}","viewer.motion.yielding.title":"Live preview enabled · yielding to {owner}","viewer.owner.story":"the guided story","viewer.owner.chapter":"the active chapter","viewer.owner.chapterPreview":"the chapter delta preview","viewer.owner.handoff":"the chapter handoff","viewer.owner.route":"Route Probe","viewer.owner.lens":"Semantic Lens","viewer.owner.relationship":"Relationship Preview","viewer.owner.intent":"Intent Trace","viewer.owner.focus":"semantic focus","viewer.owner.legend":"legend preview","viewer.owner.reader":"reader interaction","viewer.present.enter":"Enter presentation stage","viewer.present.enter.title":"Presentation stage (F)","viewer.present.exit":"Exit presentation stage","viewer.present.exit.title":"Exit presentation stage (F or Escape)","viewer.present.present":"Present","viewer.present.exit.label":"Exit","viewer.export.button":"Export","viewer.export.button.title":"Export diagram (E)","viewer.export.diagram":"Export diagram","viewer.export.menu":"Export","viewer.export.subtitle":"Portable, clean outputs","viewer.export.share":"Share","viewer.export.shareCard":"Share Card","viewer.export.routeShareCard":"Route Share Card","viewer.export.reachShareCard":"Reach Share Card","viewer.export.copyShareCard":"Copy Share Card","viewer.export.copyDiagram":"Copy diagram","viewer.export.clipboardPng":"PNG to clipboard","viewer.export.raster":"Raster images","viewer.export.image":"Image","viewer.export.lossless":"Lossless image","viewer.export.compact":"Compact image","viewer.export.modern":"Modern image","viewer.export.vectorMotion":"Vector and motion","viewer.export.vectorMotion.heading":"Vector \u0026 motion","viewer.export.editable":"Editable vector","viewer.export.motion6s":"6s motion","viewer.export.unsupported":"Not supported by this browser","viewer.export.clipboardUnsupported":"Clipboard image write not supported by this browser","viewer.export.clipboardUnsupported.period":"Clipboard image write not supported by this browser.","viewer.export.clipboardUnsupported.short":"Clipboard image write not supported in this browser.","viewer.export.motionUnavailable":"Motion capture unavailable in this browser","viewer.export.webmUnavailable":"WebM unavailable in this browser","viewer.export.failed":"Export failed: {message}","viewer.export.unknownVariant":"Unknown Share Card variant: {variant}","viewer.export.routeRequired":"Trace a route before exporting a Route Share Card","viewer.export.reachRequired":"Trace authored reach before exporting a Reach Share Card","viewer.export.unknown":"unknown","viewer.export.routeFailed":"Route Share Card export failed: {message}","viewer.export.reachFailed":"Reach Share Card export failed: {message}","viewer.export.copyFailed":"Copy failed: {message}","viewer.export.copiedPng":"Copied PNG to clipboard","viewer.export.copiedShare":"Copied Share Card","viewer.export.downloadedShare":"Downloaded Share Card","viewer.export.downloadedRoute":"Downloaded Route Share Card","viewer.export.downloadedReach":"Downloaded Reach Share Card","viewer.export.downloadedWebm":"Downloaded WebM","viewer.export.recording":"Recording 6 seconds of motion…","viewer.export.card.routeSummary.one":"Route: {source} → {target} · {count} directed hop","viewer.export.card.routeSummary.other":"Route: {source} → {target} · {count} directed hops","viewer.export.card.reachSummary":"Authored {direction} from {origin} · {nodes} · {links} · max {hops}","viewer.export.card.node.one":"{count} node","viewer.export.card.node.other":"{count} nodes","viewer.export.card.link.one":"{count} link","viewer.export.card.link.other":"{count} links","viewer.export.card.hop.one":"{count} hop","viewer.export.card.hop.other":"{count} hops","viewer.export.card.routeBadge":"ARCHIFY · ROUTE · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction} REACH","viewer.export.card.defaultBadge":"ARCHIFY · {preset} · {theme}","viewer.export.direction.upstream":"Upstream","viewer.export.direction.downstream":"Downstream","viewer.export.error.canvasUnavailable":"Canvas unavailable for {label}","viewer.export.error.contextUnavailable":"2D canvas context unavailable for {label}","viewer.export.error.toBlobUnavailable":"canvas.toBlob unavailable for {label}","viewer.export.error.toBlobNull":"canvas.toBlob returned no data for {label}","viewer.export.error.variantsCombined":"Share Card variants cannot be combined","viewer.export.error.viewerState":"Share Card export could not remove temporary viewer state","viewer.export.error.routeState":"Route Card export could not preserve the resolved route safely","viewer.export.error.reachState":"Reach Card export could not preserve authored reach safely","viewer.export.error.webmRequirements":"WebM motion export requires a trace animation and browser MediaRecorder support","viewer.export.error.mediaRecorder":"MediaRecorder failed","viewer.export.error.emptyWebm":"MediaRecorder produced an empty WebM","viewer.export.error.webmBackground":"SVG background could not be loaded for WebM export","viewer.guided.region":"Guided diagram views","viewer.guided.previous":"Previous guided view","viewer.guided.previous.title":"Previous guided view ([)","viewer.guided.next":"Next guided view","viewer.guided.next.title":"Next guided view (])","viewer.guided.views":"Guided views","viewer.guided.explore":"Explore this system","viewer.guided.intro":"Step through curated paths without changing the source diagram.","viewer.guided.trail":"Story trail","viewer.guided.beat":"Beat","viewer.guided.nextBeat":"Next","viewer.guided.play":"Play guided story","viewer.guided.play.title":"Play guided story (P)","viewer.guided.pause":"Pause guided story","viewer.guided.pause.title":"Pause guided story (P)","viewer.guided.replay":"Replay guided story","viewer.guided.replay.title":"Replay guided story (P)","viewer.guided.playStory":"Play story","viewer.guided.pauseStory":"Pause","viewer.guided.replayStory":"Replay story","viewer.guided.motionUnavailable":"Story playback unavailable while motion is Still","viewer.guided.enableMotion":"Switch motion to Live to play the guided story","viewer.guided.selectBeatLink":"Select a Story Beat to copy its exact link","viewer.guided.copyMoment":"Copy moment","viewer.guided.momentCopied":"Moment link copied","viewer.guided.momentCopyFailed":"Could not copy story moment link","viewer.guided.copied":"Copied","viewer.guided.copyFailed":"Copy failed","viewer.guided.showAll":"Show all","viewer.guided.showAll.aria":"Show entire diagram","viewer.guided.chapters":"Story chapters","viewer.guided.storyTrail":"Story trail for {label}: {count} beats","viewer.guided.chapter.open":"Open chapter {index} of {total}: {label}, {count} stops","viewer.guided.chapter.current":"Current chapter {index} of {total}: {label}, {count} stops","viewer.guided.chapter.selectedNodes":"{count} selected nodes","viewer.guided.chapter.stops":"{count} stops","viewer.guided.chapter.stop.one":"{count} stop","viewer.guided.chapter.stop.other":"{count} stops","viewer.guided.chapter.current.title":"{label} — current chapter, {count} stops","viewer.guided.chapter.delta.expanded":"{stay} stay, {enter} enter, {leave} leave","viewer.guided.chapter.delta.aria":"Open chapter {index} of {total}: {label}. Chapter focus delta: {delta}","viewer.guided.chapter.delta.title":"{label} — {delta} chapter focus","viewer.guided.handoff":"{from} → {to} · via {label}","viewer.guided.share.chapter":"Chapter {index} / {total}","viewer.guided.share.initial":"Chapter 01 / 01","viewer.guided.share.default":"Guided chapter","viewer.guided.state.ready":"Ready","viewer.guided.state.playing":"Playing","viewer.guided.state.settled":"Settled","viewer.guided.state.paused":"Paused","viewer.guided.state.pinned":"Pinned","viewer.guided.state.still":"Still","viewer.guided.share.step":"Step {index} / {total} · {label}","viewer.guided.share.staticMoment":"{step} · Static moment","viewer.guided.share.complete":"{count} steps complete · {note}","viewer.guided.share.settled":"Path settled for reading.","viewer.guided.share.staticPath":"{count} steps · Static path","viewer.guided.share.ready":"{count} steps · Ready","viewer.guided.share.aria":"{state} chapter {index} of {total}: {label}. {beat}. {route}","viewer.guided.beat.start":"Beat {index} / {total} · {label} · starting point","viewer.guided.beat.forward":"Beat {index} / {total} · {from} → {to}","viewer.guided.beat.reverse":"Beat {index} / {total} · {from} → {to} · reverse authored link","viewer.guided.beat.multiple":"Beat {index} / {total} · {from} ⇄ {to} · {count} authored links","viewer.guided.beat.group":"Beat {index} / {total} · {from} · {to} · grouped · no direct link","viewer.guided.beat.aria.prefix":"Story beat {index} of {total}: {label}. ","viewer.guided.beat.aria.start":"Starting point.","viewer.guided.beat.aria.forward":"From {from} through one authored forward relationship.","viewer.guided.beat.aria.reverse":"From {from}; the authored relationship points from {to} to {from}.","viewer.guided.beat.aria.multiple":"From {from} through {count} authored relationships; shown without arbitrary motion.","viewer.guided.beat.aria.group":"Grouped from {from} with no direct authored relationship.","viewer.guided.caption.start":"Starting point","viewer.guided.caption.grouped":"Grouped transition · no direct authored link","viewer.guided.caption.more":" +{count} more","viewer.guided.caption.reverse":"Reverse authored relationship","viewer.guided.caption.relationships":"{count} authored relationships","viewer.guided.caption.relationship":"Authored relationship","viewer.guided.caption.direction":"authored direction: {from} → {to}","viewer.guided.caption.starting":"Authored starting point","viewer.guided.beatLink":"Copy link to current story moment: Beat {index} of {total}: {label}","viewer.guided.noStory":"This diagram has no authored guided story.","viewer.guide.eyebrow":"Diagram guide","viewer.guide.close":"Close diagram guide","viewer.guide.inspecting":"Inspecting compiled semantics","viewer.guide.actions":"Diagram exploration actions","viewer.guide.find":"Find any node","viewer.guide.find.hint":"Search labels, responsibilities, kinds, and stable IDs.","viewer.guide.route":"Trace a route","viewer.guide.route.aria":"Trace a directed route","viewer.guide.route.hint":"Ask how two semantic nodes connect in authored direction.","viewer.guide.map":"See the whole system","viewer.guide.map.hint":"Open Semantic Radar with a live viewport and stable nodes.","viewer.guide.lens":"Compare semantic kinds","viewer.guide.lens.hint":"Count roles, reveal their traffic, and compare direct authored links.","viewer.guide.story":"Play the guided story","viewer.guide.story.hint":"Walk the authored chapters and real relationships.","viewer.guide.present":"Enter Presentation Stage","viewer.guide.present.hint":"Give the live diagram the viewport without changing export.","viewer.guide.shortcuts":"Additional keyboard shortcuts","viewer.guide.shortcut.export":"Export","viewer.guide.shortcut.theme":"Theme","viewer.guide.shortcut.style":"Style","viewer.guide.shortcut.reset":"Reset","viewer.guide.shortcut.zoomIn":"Zoom in","viewer.guide.shortcut.zoomOut":"Zoom out","viewer.guide.shortcut.close":"Close","viewer.guide.facts":"{nodes} · {relationships} · {views}","viewer.guide.fact.node.one":"{count} semantic node","viewer.guide.fact.node.other":"{count} semantic nodes","viewer.guide.fact.relationship.one":"{count} relationship","viewer.guide.fact.relationship.other":"{count} relationships","viewer.guide.fact.view.one":"{count} guided view","viewer.guide.fact.view.other":"{count} guided views","viewer.guide.story.available.one":"Walk {count} authored chapter and its real relationships.","viewer.guide.story.available.other":"Walk {count} authored chapters and their real relationships.","viewer.guide.story.unavailable":"No authored guided story in this diagram.","viewer.guide.open":"Open diagram guide","viewer.guide.noStory":"This diagram has no authored guided story.","viewer.finder.title":"Find a node","viewer.finder.close":"Close node finder","viewer.finder.placeholder":"Search labels or IDs","viewer.finder.search":"Search diagram nodes","viewer.finder.results":"Diagram nodes","viewer.finder.empty":"No matching nodes","viewer.finder.result.focus":"Focus {label}","viewer.finder.result.routeStart":"Choose {label} as route start","viewer.finder.result.routeTarget":"Choose {label} as route destination, {links}","viewer.finder.status.empty":"No matching nodes","viewer.finder.status.count.one":"{count} matching node","viewer.finder.status.count.other":"{count} matching nodes","viewer.finder.noun.nodes":"nodes","viewer.finder.link.one":"{count} link","viewer.finder.link.other":"{count} links","viewer.finder.result.focus.one":"Focus {label}, {count} related connection","viewer.finder.result.focus.other":"Focus {label}, {count} related connections","viewer.finder.status.filtered":"{visible} of {available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"Semantic passport","viewer.passport.metadata":"Node metadata","viewer.passport.evidence":"Verified source evidence","viewer.passport.verified":"Verified source","viewer.passport.reach":"Authored reach","viewer.passport.reach.trace":"Trace authored reachability","viewer.passport.upstream":"Upstream","viewer.passport.downstream":"Downstream","viewer.passport.upstream.trace":"Trace upstream authored reachability","viewer.passport.downstream.trace":"Trace downstream authored reachability","viewer.passport.close":"Close semantic passport","viewer.passport.copy":"Copy link","viewer.passport.copy.focus":"Copy link to focused node","viewer.passport.relations":"Relations","viewer.passport.relations.show":"Show connected relationships","viewer.passport.relations.hide":"Hide connected relationships","viewer.passport.relations.list":"Connected relationships","viewer.passport.copyRelation":"Copy relation","viewer.passport.copyNode":"Copy node","viewer.passport.copyPinned":"Copy link to pinned relationship","viewer.passport.copySource":"Copy link to source node","viewer.passport.copy.focused.success":"Focused node link copied","viewer.passport.copy.pinned.success":"Pinned relationship link copied","viewer.passport.copy.focused.failed":"Could not copy focused node link","viewer.passport.copy.pinned.failed":"Could not copy pinned relationship link","viewer.passport.relationship.none":"No connected relationships","viewer.passport.relationship.count.one":"{count} relation","viewer.passport.relationship.count.other":"{count} relations","viewer.passport.relationship.show.one":"Show {count} connected relationship","viewer.passport.relationship.show.other":"Show {count} connected relationships","viewer.passport.relationship.summary":"{out} outgoing · {in} incoming{loops}","viewer.passport.relationship.loops":" · {count} loop","viewer.passport.relationship.explorer":"Direct relationship explorer","viewer.passport.relationship.help":"Use arrow keys to explore relationships. Press Enter or Space to pin details; Escape clears.","viewer.passport.relationship.loopsBack":"loops back","viewer.passport.relationship.connectsTo":"connects to","viewer.passport.relationship.connectsFrom":"connects from","viewer.passport.relationship.pinned":"Pinned relationship · {from} → {to} · {label}","viewer.passport.relationship.inspect":"Inspect relationship {index} of {total}: {from} to {to}, {label}. Press Enter for details.","viewer.passport.relationship.group.out":"Outgoing","viewer.passport.relationship.group.in":"Incoming","viewer.passport.relationship.group.loop":"Self loops","viewer.passport.relationship.row":"{group}: {relationship}, {neighbor}","viewer.passport.relationship.direction.out":"OUT →","viewer.passport.relationship.direction.in":"← IN","viewer.passport.relationship.direction.loop":"LOOP","viewer.passport.sourceCount.one":"{count} verified source reference","viewer.passport.sourceCount.other":"{count} verified source references","viewer.passport.sourceMarker":"SRC","viewer.passport.beacon.one":"{count} verified source; focus this node to inspect","viewer.passport.beacon.other":"{count} verified sources; focus this node to inspect","viewer.passport.repository.open":"Open verified repository revision {revision}","viewer.passport.source.open":"Open verified source {path} at revision {revision}","viewer.passport.source.openLink":"Open ↗","viewer.passport.reach.upstream.one":"Trace {count} upstream authored node","viewer.passport.reach.upstream.other":"Trace {count} upstream authored nodes","viewer.passport.reach.downstream.one":"Trace {count} downstream authored node","viewer.passport.reach.downstream.other":"Trace {count} downstream authored nodes","viewer.passport.reach.noUpstream":"No upstream authored nodes","viewer.passport.reach.noDownstream":"No downstream authored nodes","viewer.passport.reach.status":"{direction} · {nodes} nodes · {links} links · max {hops} hops","viewer.route.eyebrow":"Route probe","viewer.route.start":"Choose a start node","viewer.route.start.find":"Find start","viewer.route.start.find.aria":"Find a route start","viewer.route.copy":"Copy link","viewer.route.copy.aria":"Copy link to traced route","viewer.route.clear":"Clear","viewer.route.clear.aria":"Clear route probe","viewer.route.traced":"Traced route","viewer.route.pickTwo":"Pick two semantic nodes on the diagram","viewer.route.pickOne":"Pick a semantic node on the diagram","viewer.route.controls":"Route journey controls","viewer.route.previous":"Previous route position","viewer.route.play":"Play route journey","viewer.route.pause":"Pause route journey","viewer.route.replay":"Replay route journey","viewer.route.next":"Next route position","viewer.route.journey":"Journey","viewer.route.pause.label":"Pause","viewer.route.replay.label":"Replay","viewer.route.overview":"Overview","viewer.route.overview.aria":"Show complete route overview","viewer.route.instructions":"Choose the source, then the destination. Direction matters.","viewer.route.destination":"Choose a destination from {label}","viewer.route.destination.find":"Find target","viewer.route.destination.find.aria":"Find a reachable route destination","viewer.route.differentDestination":"Choose a different destination","viewer.route.distinct":"A route needs two distinct semantic nodes.","viewer.route.unreachable":"No directed route to {label}","viewer.route.unreachable.detail":"{target} is not reachable from {source}. Pick a highlighted destination.","viewer.route.start.instructions":"Select the source. The next step will reveal only directed destinations.","viewer.route.copy.success":"Traced route link copied","viewer.route.copy.failed":"Could not copy traced route link","viewer.route.position":"Route position {index} of {total}: {label}","viewer.route.step":"Step {index} of {total} · {phase} · {label}","viewer.route.motionRequired":"Automatic journey requires Live motion","viewer.route.trigger.clear":"Clear traced route","viewer.route.overview.status":"{nodes} · {hops} · shortest authored route","viewer.route.overview.node.one":"{count} node","viewer.route.overview.node.other":"{count} nodes","viewer.route.overview.hop.one":"{count} directed hop","viewer.route.overview.hop.other":"{count} directed hops","viewer.route.phase.playing":"Playing","viewer.route.phase.complete":"Complete","viewer.route.phase.inspecting":"Inspecting","viewer.route.destination.count.one":"{count} directed destination available. Pick a highlighted node.","viewer.route.destination.count.other":"{count} directed destinations available. Pick a highlighted node.","viewer.route.noOutgoing":"No outgoing route starts here. Clear and choose another source.","viewer.route.result.title":"{source} to {target}","viewer.route.finder.source.title":"Choose route start","viewer.route.finder.source.placeholder":"Search route sources","viewer.route.finder.source.empty":"No matching route sources","viewer.route.finder.source.results":"Nodes that can start a route","viewer.route.finder.source.noun":"route sources","viewer.route.finder.source.badge":"start","viewer.route.finder.target.title":"Destination from {label}","viewer.route.finder.target.placeholder":"Search reachable destinations","viewer.route.finder.target.empty":"No matching reachable destinations","viewer.route.finder.target.results":"Reachable route destinations","viewer.route.finder.target.noun":"reachable destinations","viewer.route.hop.one":"{count} hop","viewer.route.hop.other":"{count} hops","viewer.lens.eyebrow":"Semantic lens","viewer.lens.title":"Compare system roles","viewer.lens.close":"Close semantic lens","viewer.lens.instruction":"Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.","viewer.lens.kinds":"Semantic kinds","viewer.lens.choose":"Choose a kind to inspect its nodes and touching relationships.","viewer.lens.copy":"Copy link to semantic lens","viewer.lens.clear":"Clear semantic lens","viewer.lens.open":"Open semantic lens","viewer.lens.openActive":"Open active semantic lens","viewer.lens.legend":"Semantic legend","viewer.lens.legend.inspect.one":"Inspect {label}, {count} node","viewer.lens.legend.inspect.other":"Inspect {label}, {count} nodes","viewer.lens.kind.count.one":"{label}, {count} node","viewer.lens.kind.count.other":"{label}, {count} nodes","viewer.lens.compare.one":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationship","viewer.lens.compare.other":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationships","viewer.lens.single":"{nodes} · {relationships} · connected peers remain visible","viewer.lens.node.one":"{count} {label} node","viewer.lens.node.other":"{count} {label} nodes","viewer.lens.relationship.one":"{count} touching relationship","viewer.lens.relationship.other":"{count} touching relationships","viewer.radar.title":"Semantic radar","viewer.radar.building":"Building overview","viewer.radar.openFull":"Open full semantic radar","viewer.radar.open":"Open radar","viewer.radar.close":"Close semantic radar","viewer.radar.surface":"Diagram overview. Click a node to focus it, or use arrow keys to pan.","viewer.radar.click":"Click node","viewer.radar.drag":"Drag to pan","viewer.radar.space":"Semantic radar needs more MAP space.","viewer.radar.nodes":"Semantic diagram radar nodes","viewer.radar.focus":"Focus {label} from Semantic Radar","viewer.radar.status":"{count} nodes · {viewport}","viewer.radar.fullMap":"{count} nodes · full map","viewer.radar.compacted":"Radar compacted to avoid covering the Semantic Passport or MAP controls.","viewer.radar.cancelWaiting":"Cancel semantic radar waiting for more MAP space","viewer.radar.needsSpace":"Semantic radar needs more visible MAP space","viewer.radar.viewport.full":"full map","viewer.radar.viewport.width":"{percent}% width","viewer.radar.viewport.scale":"{percent}% viewport","viewer.nav.controls":"Diagram view controls","viewer.nav.route":"Trace a directed route","viewer.nav.route.title":"Trace route (R)","viewer.nav.route.short":"PATH","viewer.nav.radar":"Open semantic radar","viewer.nav.radar.title":"Semantic radar (M)","viewer.nav.radar.short":"MAP","viewer.nav.lens":"Open semantic lens","viewer.nav.lens.title":"Semantic lens (L)","viewer.nav.lens.short":"LENS","viewer.nav.find":"Find a node","viewer.nav.find.title":"Find a node (/)","viewer.nav.guide":"Open diagram guide","viewer.nav.guide.title":"Diagram guide (?)","viewer.nav.zoomOut":"Zoom out","viewer.nav.zoomOut.title":"Zoom out (-)","viewer.nav.reset":"Reset diagram view","viewer.nav.reset.title":"Reset view (0)","viewer.nav.read":"READ","viewer.nav.zoomIn":"Zoom in","viewer.nav.zoomIn.title":"Zoom in (+)","viewer.nav.camera":"{hint}. Reset diagram view","viewer.nav.camera.title":"{semantic}{hint} · reset view (0)","viewer.nav.camera.semantic":"Semantic camera active · ","viewer.nav.level.map":"MAP","viewer.nav.level.read":"READ","viewer.nav.level.full":"FULL","viewer.nav.level.auto":"AUTO","viewer.nav.detail.map":"Zoom in to reveal relationship labels and node context","viewer.nav.detail.read":"Zoom in again to reveal tags and annotations","viewer.nav.detail.full":"Full diagram detail","viewer.intent.summary":"{label}. {out} outgoing, {in} incoming{loops}. {total} connections. Press Enter for details.","viewer.intent.loops":", {count} self loop","viewer.common.copied":"Copied","viewer.common.copyFailed":"Copy failed","viewer.common.copyLink":"Copy link","viewer.common.clear":"Clear","viewer.common.close":"Close"}}</script>
- <div class="guided-views no-print" id="guided-views" hidden aria-label="Guided diagram views">
- <button id="guided-view-prev" type="button" aria-label="Previous guided view" title="Previous guided view ([)">&#8592;</button>
- <div class="guided-view-copy">
- <div class="guided-view-meta">
- <span>Guided views</span>
- <span id="guided-view-count"></span>
- <span class="guided-view-progress" aria-hidden="true"><span id="guided-view-progress-bar"></span></span>
- <span class="guided-view-handoff" id="guided-view-handoff" hidden aria-hidden="true"></span>
- </div>
- <strong id="guided-view-label">Explore this system</strong>
- <small id="guided-view-note" aria-live="polite" aria-atomic="true">Step through curated paths without changing the source diagram.</small>
- <div class="guided-view-trail" id="guided-view-trail" hidden role="group" aria-label="Story trail"></div>
- <div class="guided-story-caption" id="guided-story-caption" hidden aria-live="polite" aria-atomic="true">
- <span class="guided-story-caption-index" id="guided-story-caption-index">Beat</span>
- <strong id="guided-story-caption-route"></strong>
- <small id="guided-story-caption-detail"></small>
- <span class="guided-story-caption-next" id="guided-story-caption-next" hidden aria-hidden="true">
- <small>Next</small>
- <strong id="guided-story-caption-next-label"></strong>
- </span>
- </div>
- </div>
- <button id="guided-view-next" type="button" aria-label="Next guided view" title="Next guided view (])">&#8594;</button>
- <div class="guided-view-actions">
- <button class="guided-view-play" id="guided-view-play" type="button" aria-label="Play guided story" aria-pressed="false" title="Play guided story (P)">
- <span id="guided-view-play-icon" aria-hidden="true">&#9654;</span>
- <span id="guided-view-play-label">Play story</span>
- </button>
- <button class="guided-view-beat-link" id="guided-view-beat-link" type="button" aria-label="Select a Story Beat to copy its exact link" title="Select a Story Beat to copy its exact link" disabled>
- <span aria-hidden="true">&#35;</span>
- <span id="guided-view-beat-link-label">Copy moment</span>
- </button>
- <button class="guided-view-all" id="guided-view-all" type="button" aria-label="Show entire diagram">Show all</button>
- </div>
- <nav class="guided-view-index" id="guided-view-index" aria-label="Story chapters">
- <ol class="guided-view-chapters" id="guided-view-chapters"></ol>
- </nav>
- </div>
+ <script id="archify-i18n-data" type="application/json">{"locale":"en","messages":{"viewer.kind.frontend":"Frontend","viewer.kind.backend":"Backend","viewer.kind.database":"Database","viewer.kind.cloud":"Cloud","viewer.kind.security":"Security","viewer.kind.messagebus":"Message bus","viewer.kind.external":"External","viewer.kind.neutral":"Neutral","viewer.kind.node":"Node","viewer.kind.start":"Start","viewer.kind.active":"Active","viewer.kind.waiting":"Waiting","viewer.kind.decision":"Decision","viewer.kind.success":"Success","viewer.kind.failure":"Failure","viewer.toolbar.actions":"Diagram actions","viewer.theme.toggle.title":"Toggle theme (T)","viewer.theme.toggle":"Toggle color theme","viewer.theme.dark":"Dark","viewer.theme.light":"Light","viewer.preset.choose.title":"Choose visual style (S cycles)","viewer.preset.choose":"Choose visual style","viewer.preset.style":"Style","viewer.preset.menu":"Visual style","viewer.preset.identity":"Visual identity","viewer.preset.cycles":"to cycle","viewer.preset.classic":"Classic","viewer.preset.classic.short":"Classic","viewer.preset.classic.hint":"Stable technical default","viewer.preset.flow":"Signal Flow","viewer.preset.flow.short":"Flow","viewer.preset.flow.hint":"Motion-forward presentation","viewer.preset.blueprint":"Blueprint","viewer.preset.blueprint.hint":"Engineering review","viewer.preset.editorial":"Editorial","viewer.preset.editorial.hint":"Publication and launch notes","viewer.preset.badge.signalFlow":"SIGNAL FLOW","viewer.preset.badge.blueprint":"BLUEPRINT / REV 01","viewer.preset.badge.editorial":"EDITORIAL / FIELD NOTE","viewer.preset.badge.editorialPlate":"ARCHIFY / PLATE 04","viewer.preset.current":"Visual style: {style}. Choose visual style","viewer.motion.live":"Live","viewer.motion.still":"Still","viewer.motion.pause":"Pause motion","viewer.motion.resume":"Resume motion","viewer.motion.reduced":"Motion paused by reduced-motion preference","viewer.motion.hidden":"Motion paused while this page is hidden","viewer.motion.yielding":"Pause motion; currently yielding to {owner}","viewer.motion.yielding.title":"Live preview enabled · yielding to {owner}","viewer.owner.route":"Route Probe","viewer.owner.lens":"Semantic Lens","viewer.owner.relationship":"Relationship Preview","viewer.owner.intent":"Intent Trace","viewer.owner.focus":"semantic focus","viewer.owner.legend":"legend preview","viewer.owner.reader":"reader interaction","viewer.present.enter":"Enter presentation stage","viewer.present.enter.title":"Presentation stage (F)","viewer.present.exit":"Exit presentation stage","viewer.present.exit.title":"Exit presentation stage (F or Escape)","viewer.present.present":"Present","viewer.present.exit.label":"Exit","viewer.export.button":"Export","viewer.export.button.title":"Export diagram (E)","viewer.export.diagram":"Export diagram","viewer.export.menu":"Export","viewer.export.subtitle":"Portable, clean outputs","viewer.export.share":"Share","viewer.export.shareCard":"Share Card","viewer.export.routeShareCard":"Route Share Card","viewer.export.reachShareCard":"Reach Share Card","viewer.export.copyDiagram":"Copy diagram","viewer.export.clipboardPng":"PNG to clipboard","viewer.export.raster":"Raster images","viewer.export.image":"Image","viewer.export.lossless":"Lossless image","viewer.export.compact":"Compact image","viewer.export.modern":"Modern image","viewer.export.vectorMotion":"Vector and motion","viewer.export.vectorMotion.heading":"Vector \u0026 motion","viewer.export.editable":"Editable vector","viewer.export.svg.auto":"SVG · Auto","viewer.export.svg.auto.hint":"Matches host theme","viewer.export.svg.light":"SVG · Light","viewer.export.svg.light.hint":"Always light","viewer.export.svg.dark":"SVG · Dark","viewer.export.svg.dark.hint":"Always dark","viewer.export.motion6s":"6s motion","viewer.export.unsupported":"Not supported by this browser","viewer.export.clipboardUnsupported":"Clipboard image write not supported by this browser","viewer.export.clipboardUnsupported.short":"Clipboard image write not supported in this browser.","viewer.export.motionUnavailable":"Motion capture unavailable in this browser","viewer.export.webmUnavailable":"WebM unavailable in this browser","viewer.export.failed":"Export failed: {message}","viewer.export.unknownVariant":"Unknown Share Card variant: {variant}","viewer.export.routeRequired":"Trace a route before exporting a Route Share Card","viewer.export.reachRequired":"Trace authored reach before exporting a Reach Share Card","viewer.export.unknown":"unknown","viewer.export.routeFailed":"Route Share Card export failed: {message}","viewer.export.reachFailed":"Reach Share Card export failed: {message}","viewer.export.copyFailed":"Copy failed: {message}","viewer.export.copiedPng":"Copied PNG to clipboard","viewer.export.downloadedRoute":"Downloaded Route Share Card","viewer.export.downloadedReach":"Downloaded Reach Share Card","viewer.export.downloadedWebm":"Downloaded WebM","viewer.export.recording":"Recording 6 seconds of motion…","viewer.export.card.routeSummary.one":"Path: {source} → {target} · {count} step","viewer.export.card.routeSummary.other":"Path: {source} → {target} · {count} steps","viewer.export.card.reachSummary":"Authored {direction} from {origin} · {nodes} · {links} · max {hops}","viewer.export.card.node.one":"{count} node","viewer.export.card.node.other":"{count} nodes","viewer.export.card.link.one":"{count} link","viewer.export.card.link.other":"{count} links","viewer.export.card.hop.one":"{count} hop","viewer.export.card.hop.other":"{count} hops","viewer.export.card.routeBadge":"ARCHIFY · ROUTE · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction} REACH","viewer.export.direction.upstream":"Upstream","viewer.export.direction.downstream":"Downstream","viewer.export.error.canvasUnavailable":"Canvas unavailable for {label}","viewer.export.error.contextUnavailable":"2D canvas context unavailable for {label}","viewer.export.error.toBlobUnavailable":"canvas.toBlob unavailable for {label}","viewer.export.error.toBlobNull":"canvas.toBlob returned no data for {label}","viewer.export.error.variantsCombined":"Share Card variants cannot be combined","viewer.export.error.viewerState":"Share Card export could not remove temporary viewer state","viewer.export.error.routeState":"Route Card export could not preserve the resolved route safely","viewer.export.error.reachState":"Reach Card export could not preserve authored reach safely","viewer.export.error.webmRequirements":"WebM motion export requires a trace animation and browser MediaRecorder support","viewer.export.error.mediaRecorder":"MediaRecorder failed","viewer.export.error.emptyWebm":"MediaRecorder produced an empty WebM","viewer.export.error.webmBackground":"SVG background could not be loaded for WebM export","viewer.guide.title":"Explore this system","viewer.focus.selectedNodes":"{count} selected nodes","viewer.guide.eyebrow":"Diagram guide","viewer.guide.close":"Close diagram guide","viewer.guide.inspecting":"Inspecting compiled semantics","viewer.guide.actions":"Diagram exploration actions","viewer.guide.find":"Find any node","viewer.guide.find.hint":"Search labels, responsibilities, kinds, and stable IDs.","viewer.guide.route":"Trace a route","viewer.guide.route.aria":"Trace a directed route","viewer.guide.route.hint":"Ask how two semantic nodes connect in authored direction.","viewer.guide.map":"See the whole system","viewer.guide.map.hint":"Open Semantic Radar with a live viewport and stable nodes.","viewer.guide.lens":"Compare semantic kinds","viewer.guide.lens.hint":"Count roles, reveal their traffic, and compare direct authored links.","viewer.guide.present":"Enter Presentation Stage","viewer.guide.present.hint":"Give the live diagram the viewport without changing export.","viewer.guide.shortcuts":"Additional keyboard shortcuts","viewer.guide.shortcut.export":"Export","viewer.guide.shortcut.theme":"Theme","viewer.guide.shortcut.style":"Style","viewer.guide.shortcut.reset":"Reset","viewer.guide.shortcut.zoomIn":"Zoom in","viewer.guide.shortcut.zoomOut":"Zoom out","viewer.guide.shortcut.close":"Close","viewer.guide.facts":"{nodes} · {relationships}","viewer.guide.fact.node.one":"{count} semantic node","viewer.guide.fact.node.other":"{count} semantic nodes","viewer.guide.fact.relationship.one":"{count} relationship","viewer.guide.fact.relationship.other":"{count} relationships","viewer.guide.open":"Open diagram guide","viewer.finder.title":"Find a node","viewer.finder.close":"Close node finder","viewer.finder.placeholder":"Search labels or IDs","viewer.finder.search":"Search diagram nodes","viewer.finder.results":"Diagram nodes","viewer.finder.empty":"No matching nodes","viewer.finder.result.focus":"Focus {label}","viewer.finder.result.routeStart":"Choose {label} as route start","viewer.finder.result.routeTarget":"Choose {label} as route destination, {links}","viewer.finder.status.empty":"No matching nodes","viewer.finder.status.count.one":"{count} matching node","viewer.finder.status.count.other":"{count} matching nodes","viewer.finder.noun.nodes":"nodes","viewer.finder.link.one":"{count} link","viewer.finder.link.other":"{count} links","viewer.finder.result.focus.one":"Focus {label}, {count} related connection","viewer.finder.result.focus.other":"Focus {label}, {count} related connections","viewer.finder.status.filtered":"{visible} of {available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"Semantic passport","viewer.passport.metadata":"Node metadata","viewer.passport.evidence":"Verified source evidence","viewer.passport.verified":"Verified source","viewer.passport.verificationScope":"Verified against local Git at the pinned revision. Remote access has not been checked.","viewer.passport.reach":"Authored reach","viewer.passport.reach.trace":"Trace authored reachability","viewer.passport.upstream":"Upstream","viewer.passport.downstream":"Downstream","viewer.passport.upstream.trace":"Trace upstream authored reachability","viewer.passport.downstream.trace":"Trace downstream authored reachability","viewer.passport.close":"Close semantic passport","viewer.passport.move":"Move semantic passport. Drag, use arrow keys, or press Home to reset.","viewer.passport.copy":"Copy link","viewer.passport.copy.focus":"Copy link to focused node","viewer.passport.relations":"Relations","viewer.passport.relations.show":"Show connected relationships","viewer.passport.relations.hide":"Hide connected relationships","viewer.passport.relations.list":"Connected relationships","viewer.passport.copyRelation":"Copy relation","viewer.passport.copyNode":"Copy node","viewer.passport.copyPinned":"Copy link to pinned relationship","viewer.passport.copySource":"Copy link to source node","viewer.passport.copy.focused.success":"Focused node link copied","viewer.passport.copy.pinned.success":"Pinned relationship link copied","viewer.passport.copy.focused.failed":"Could not copy focused node link","viewer.passport.copy.pinned.failed":"Could not copy pinned relationship link","viewer.passport.relationship.none":"No connected relationships","viewer.passport.relationship.count.one":"{count} relation","viewer.passport.relationship.count.other":"{count} relations","viewer.passport.relationship.show.one":"Show {count} connected relationship","viewer.passport.relationship.show.other":"Show {count} connected relationships","viewer.passport.relationship.summary":"{out} outgoing · {in} incoming{loops}","viewer.passport.relationship.loops":" · {count} loop","viewer.passport.relationship.explorer":"Direct relationship explorer","viewer.passport.relationship.help":"Use arrow keys to explore relationships. Press Enter or Space to pin details; Escape clears.","viewer.passport.relationship.loopsBack":"loops back","viewer.passport.relationship.connectsTo":"connects to","viewer.passport.relationship.connectsFrom":"connects from","viewer.passport.relationship.pinned":"Pinned relationship · {from} → {to} · {label}","viewer.passport.relationship.inspect":"Inspect relationship {index} of {total}: {from} to {to}, {label}. Press Enter for details.","viewer.passport.relationship.group.out":"Outgoing","viewer.passport.relationship.group.in":"Incoming","viewer.passport.relationship.group.loop":"Self loops","viewer.passport.relationship.row":"{group}: {relationship}, {neighbor}","viewer.passport.relationship.direction.out":"OUT →","viewer.passport.relationship.direction.in":"← IN","viewer.passport.relationship.direction.loop":"LOOP","viewer.passport.sourceCount.one":"{count} verified source reference","viewer.passport.sourceCount.other":"{count} verified source references","viewer.passport.sourceMarker":"SRC","viewer.passport.beacon.one":"{count} verified source; focus this node to inspect","viewer.passport.beacon.other":"{count} verified sources; focus this node to inspect","viewer.passport.repository.open":"Open verified repository revision {revision}","viewer.passport.source.open":"Open verified source {path} at revision {revision}","viewer.passport.source.openLink":"Open ↗","viewer.passport.reach.upstream.one":"Trace {count} upstream authored node","viewer.passport.reach.upstream.other":"Trace {count} upstream authored nodes","viewer.passport.reach.downstream.one":"Trace {count} downstream authored node","viewer.passport.reach.downstream.other":"Trace {count} downstream authored nodes","viewer.passport.reach.noUpstream":"No upstream authored nodes","viewer.passport.reach.noDownstream":"No downstream authored nodes","viewer.passport.reach.status":"{direction} · {nodes} nodes · {links} links · max {hops} hops","viewer.route.eyebrow":"Path","viewer.route.start":"Click where the path starts","viewer.route.start.find":"Find start","viewer.route.start.find.aria":"Find a route start","viewer.route.copy":"Copy link","viewer.route.copy.aria":"Copy link to traced route","viewer.route.clear":"Clear","viewer.route.clear.aria":"Clear route probe","viewer.route.traced":"Path","viewer.route.pickTwo":"Click two nodes on the diagram","viewer.route.pickOne":"Click a node on the diagram","viewer.route.controls":"Route journey controls","viewer.route.previous":"Previous route position","viewer.route.play":"Play route journey","viewer.route.pause":"Pause route journey","viewer.route.replay":"Replay route journey","viewer.route.next":"Next route position","viewer.route.journey":"Journey","viewer.route.pause.label":"Pause","viewer.route.replay.label":"Replay","viewer.route.overview":"Overview","viewer.route.overview.aria":"Show complete route overview","viewer.route.instructions":"Click a start, then an end. Paths follow the arrows.","viewer.route.destination":"Where does the path from {label} end?","viewer.route.destination.find":"Find target","viewer.route.destination.find.aria":"Find a reachable route destination","viewer.route.differentDestination":"Choose a different destination","viewer.route.distinct":"Pick two different nodes.","viewer.route.unreachable":"Cannot reach {label} from here","viewer.route.unreachable.detail":"{target} cannot be reached from {source} along the arrows. Pick a highlighted node.","viewer.route.start.instructions":"Next, pick the end. Only nodes you can reach will light up.","viewer.route.copy.success":"Traced route link copied","viewer.route.copy.failed":"Could not copy traced route link","viewer.route.position":"Route position {index} of {total}: {label}","viewer.route.step":"Step {index} of {total} · {phase} · {label}","viewer.route.motionRequired":"Automatic journey requires Live motion","viewer.route.trigger.clear":"Clear traced route","viewer.route.overview.status":"{nodes} · {hops} · shortest path","viewer.route.overview.node.one":"{count} node","viewer.route.overview.node.other":"{count} nodes","viewer.route.overview.hop.one":"{count} step","viewer.route.overview.hop.other":"{count} steps","viewer.route.phase.playing":"Playing","viewer.route.phase.complete":"Complete","viewer.route.phase.inspecting":"Inspecting","viewer.route.destination.count.one":"{count} reachable node is highlighted. Click it.","viewer.route.destination.count.other":"{count} reachable nodes are highlighted. Click one.","viewer.route.noOutgoing":"No arrows lead out of this node. Clear it and pick another start.","viewer.route.result.title":"{source} to {target}","viewer.route.finder.source.title":"Choose route start","viewer.route.finder.source.placeholder":"Search route sources","viewer.route.finder.source.empty":"No matching route sources","viewer.route.finder.source.results":"Nodes that can start a route","viewer.route.finder.source.noun":"route sources","viewer.route.finder.source.badge":"start","viewer.route.finder.target.title":"Destination from {label}","viewer.route.finder.target.placeholder":"Search reachable destinations","viewer.route.finder.target.empty":"No matching reachable destinations","viewer.route.finder.target.results":"Reachable route destinations","viewer.route.finder.target.noun":"reachable destinations","viewer.route.hop.one":"{count} hop","viewer.route.hop.other":"{count} hops","viewer.lens.eyebrow":"Semantic lens","viewer.lens.title":"Compare system roles","viewer.lens.close":"Close semantic lens","viewer.lens.instruction":"Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.","viewer.lens.kinds":"Semantic kinds","viewer.lens.choose":"Choose a kind to inspect its nodes and touching relationships.","viewer.lens.copy":"Copy link to semantic lens","viewer.lens.clear":"Clear semantic lens","viewer.lens.open":"Open semantic lens","viewer.lens.openActive":"Open active semantic lens","viewer.lens.legend":"Semantic legend","viewer.lens.legend.inspect.one":"Inspect {label}, {count} node","viewer.lens.legend.inspect.other":"Inspect {label}, {count} nodes","viewer.lens.kind.count.one":"{label}, {count} node","viewer.lens.kind.count.other":"{label}, {count} nodes","viewer.lens.compare.one":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationship","viewer.lens.compare.other":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationships","viewer.lens.single":"{nodes} · {relationships} · connected peers remain visible","viewer.lens.node.one":"{count} {label} node","viewer.lens.node.other":"{count} {label} nodes","viewer.lens.relationship.one":"{count} touching relationship","viewer.lens.relationship.other":"{count} touching relationships","viewer.radar.title":"Semantic radar","viewer.radar.building":"Building overview","viewer.radar.openFull":"Open full semantic radar","viewer.radar.open":"Open radar","viewer.radar.close":"Close semantic radar","viewer.radar.surface":"Diagram overview. Click a node to focus it, or use arrow keys to pan.","viewer.radar.click":"Click node","viewer.radar.drag":"Drag to pan","viewer.radar.space":"Semantic radar needs more MAP space.","viewer.radar.nodes":"Semantic diagram radar nodes","viewer.radar.focus":"Focus {label} from Semantic Radar","viewer.radar.status":"{count} nodes · {viewport}","viewer.radar.fullMap":"{count} nodes · full map","viewer.radar.compacted":"Radar compacted to avoid covering the Semantic Passport or MAP controls.","viewer.radar.cancelWaiting":"Cancel semantic radar waiting for more MAP space","viewer.radar.needsSpace":"Semantic radar needs more visible MAP space","viewer.radar.viewport.full":"full map","viewer.radar.viewport.width":"{percent}% width","viewer.radar.viewport.scale":"{percent}% viewport","viewer.nav.controls":"Diagram view controls","viewer.nav.route":"Trace a directed route","viewer.nav.route.title":"Trace route (R)","viewer.nav.route.short":"PATH","viewer.nav.radar":"Open semantic radar","viewer.nav.radar.title":"Semantic radar (M)","viewer.nav.radar.short":"MAP","viewer.nav.lens":"Open semantic lens","viewer.nav.lens.title":"Semantic lens (L)","viewer.nav.lens.short":"LENS","viewer.nav.find":"Find a node","viewer.nav.find.title":"Find a node (/)","viewer.outline.title":"Node index","viewer.rail.show":"Notes \u0026 index","viewer.rail.controls":"Side panel","viewer.rail.collapse":"Collapse side panel","viewer.rail.bottom":"Move panel below the diagram","viewer.rail.right":"Move panel beside the diagram","viewer.nav.guide":"Open diagram guide","viewer.nav.guide.title":"Diagram guide (?)","viewer.nav.zoomOut":"Zoom out","viewer.nav.zoomOut.title":"Zoom out (-)","viewer.nav.reset":"Reset diagram view","viewer.nav.reset.title":"Reset view (0)","viewer.nav.read":"READ","viewer.nav.zoomIn":"Zoom in","viewer.nav.zoomIn.title":"Zoom in (+)","viewer.nav.camera":"{hint}. Reset diagram view","viewer.nav.camera.title":"{semantic}{hint} · reset view (0)","viewer.nav.camera.semantic":"Semantic camera active · ","viewer.nav.level.map":"MAP","viewer.nav.level.read":"READ","viewer.nav.level.full":"FULL","viewer.nav.level.auto":"AUTO","viewer.nav.detail.map":"Zoom in to reveal relationship labels and node context","viewer.nav.detail.read":"Zoom in again to reveal tags and annotations","viewer.nav.detail.full":"Full diagram detail","viewer.intent.summary":"{label}. {out} outgoing, {in} incoming{loops}. {total} connections. Press Enter for details.","viewer.intent.loops":", {count} self loop","viewer.common.copied":"Copied","viewer.common.copyFailed":"Copy failed","viewer.common.copyLink":"Copy link","viewer.common.clear":"Clear","viewer.common.close":"Close"}}</script>
<!-- Main Diagram -->
<div class="diagram-container" data-detail-level="read"
data-preset-badge-editorial-plate="ARCHIFY / PLATE 04">
- <svg viewBox="0 0 1340 568" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="standard" data-quality-gates="advisory">
+ <svg viewBox="0 0 1340 568" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="standard" data-quality-gates="advisory" data-reader-fit="intrinsic-height" data-reader-min-text="7.5" data-reader-primary-text="14">
<title id="archify-diagram-title">Archify</title>
<desc id="archify-diagram-description">Agent skill → JSON IR → typed renderers → standalone HTML</desc>
<!-- Definitions -->
@@ -5160,16 +5012,46 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<rect data-graph-role="structural-frame" data-composition-frame-kind="region" data-composition-frame-id="0" data-composition-frame-label="archify/ skill package" x="370" y="110" width="770" height="270" rx="12" class="c-region" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
- <path data-edge-from="user" data-edge-to="agents" data-edge-key="0" data-composition-points="160,330;200,330" d="M 160 330 L 200 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="agents" data-edge-to="skill" data-edge-key="1" data-composition-points="275,300;275,200" d="M 275 300 L 275 200" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>
- <path data-edge-from="agents" data-edge-to="ir" data-edge-label="write IR" data-edge-key="2" data-composition-points="350,330;400,330" d="M 350 330 L 400 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="ir" data-edge-to="schemas" data-edge-key="3" data-composition-points="470,300;470,200" d="M 470 300 L 470 200" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
- <path data-edge-from="ir" data-edge-to="renderers" data-edge-key="4" data-composition-points="540,330;590,330" d="M 540 330 L 590 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="renderers" data-edge-to="template" data-edge-key="5" data-composition-points="730,330;780,330" d="M 730 330 L 780 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="template" data-edge-to="checker" data-edge-key="6" data-composition-points="920,330;970,330" d="M 920 330 L 970 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="checker" data-edge-to="html" data-edge-label="deliver" data-edge-key="7" data-composition-points="1110,330;1160,330" d="M 1110 330 L 1160 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="renderers" data-edge-to="ci" data-edge-key="8" data-composition-points="660,360;660,440" d="M 660 360 L 660 440" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
- <path data-edge-from="html" data-edge-to="zip" data-edge-key="9" data-composition-points="1230,300;1230,200" d="M 1230 300 L 1230 200" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ <g data-graph-role="automatic-crossover" style="--step:0">
+ <path data-graph-role="automatic-crossover-underlay" d="M 160 330 L 200 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="user" data-edge-to="agents" data-edge-key="0" data-composition-points="160,330;200,330" data-composition-crossover="halo" data-composition-independent="true" d="M 160 330 L 200 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:1">
+ <path data-graph-role="automatic-crossover-underlay" d="M 275 300 L 275 200" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agents" data-edge-to="skill" data-edge-key="1" data-composition-points="275,300;275,200" data-composition-crossover="halo" data-composition-independent="true" d="M 275 300 L 275 200" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:2">
+ <path data-graph-role="automatic-crossover-underlay" d="M 350 330 L 400 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agents" data-edge-to="ir" data-edge-label="write IR" data-edge-key="2" data-composition-points="350,330;400,330" data-composition-crossover="halo" data-composition-independent="true" d="M 350 330 L 400 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:3">
+ <path data-graph-role="automatic-crossover-underlay" d="M 470 300 L 470 200" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="ir" data-edge-to="schemas" data-edge-key="3" data-composition-points="470,300;470,200" data-composition-crossover="halo" data-composition-independent="true" d="M 470 300 L 470 200" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:4">
+ <path data-graph-role="automatic-crossover-underlay" d="M 540 330 L 590 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="ir" data-edge-to="renderers" data-edge-key="4" data-composition-points="540,330;590,330" data-composition-crossover="halo" data-composition-independent="true" d="M 540 330 L 590 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:5">
+ <path data-graph-role="automatic-crossover-underlay" d="M 730 330 L 780 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="renderers" data-edge-to="template" data-edge-key="5" data-composition-points="730,330;780,330" data-composition-crossover="halo" data-composition-independent="true" d="M 730 330 L 780 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:6">
+ <path data-graph-role="automatic-crossover-underlay" d="M 920 330 L 970 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="template" data-edge-to="checker" data-edge-key="6" data-composition-points="920,330;970,330" data-composition-crossover="halo" data-composition-independent="true" d="M 920 330 L 970 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:7">
+ <path data-graph-role="automatic-crossover-underlay" d="M 1110 330 L 1160 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="checker" data-edge-to="html" data-edge-label="deliver" data-edge-key="7" data-composition-points="1110,330;1160,330" data-composition-crossover="halo" data-composition-independent="true" d="M 1110 330 L 1160 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:8">
+ <path data-graph-role="automatic-crossover-underlay" d="M 660 360 L 660 440" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="renderers" data-edge-to="ci" data-edge-key="8" data-composition-points="660,360;660,440" data-composition-crossover="halo" data-composition-independent="true" d="M 660 360 L 660 440" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:9">
+ <path data-graph-role="automatic-crossover-underlay" d="M 1230 300 L 1230 200" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="html" data-edge-to="zip" data-edge-key="9" data-composition-points="1230,300;1230,200" data-composition-crossover="halo" data-composition-independent="true" d="M 1230 300 L 1230 200" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ </g>
<!-- Components -->
<g id="node-user" data-node-id="user" data-node-label="You" tabindex="0" role="button" aria-label="Focus You, NL or Mermaid, Architecture component" aria-pressed="false" data-node-kind="external" data-node-sublabel="NL or Mermaid" data-node-context="Architecture component">
@@ -5316,7 +5198,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<g data-detail="context" data-edge-from="agents" data-edge-to="ir" data-edge-label="write IR" data-edge-key="2">
<rect x="350.8" y="310" width="48.4" height="14" rx="3" class="c-mask"/>
- <text x="375" y="320" class="t-backend" font-size="8" text-anchor="middle">write IR</text>
+ <text x="375" y="320" class="t-edge-emphasis" font-size="8" text-anchor="middle">write IR</text>
</g>
@@ -5324,7 +5206,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<g data-detail="context" data-edge-from="checker" data-edge-to="html" data-edge-label="deliver" data-edge-key="7">
<rect x="1113.2" y="310" width="43.6" height="14" rx="3" class="c-mask"/>
- <text x="1135" y="320" class="t-backend" font-size="8" text-anchor="middle">deliver</text>
+ <text x="1135" y="320" class="t-edge-emphasis" font-size="8" text-anchor="middle">deliver</text>
</g>
@@ -5365,18 +5247,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</g>
</svg>
<p class="intent-trace-status no-print" id="intent-trace-status" role="status" aria-live="polite" aria-atomic="true"></p>
- <div class="share-chapter-cue no-print" id="share-chapter-cue" hidden role="status" aria-live="polite">
- <div class="share-chapter-index">
- <span class="share-chapter-state" id="share-chapter-state">Ready</span>
- <span class="share-chapter-count" id="share-chapter-count">Chapter 01 / 01</span>
- </div>
- <div class="share-chapter-copy">
- <strong id="share-chapter-label">Guided chapter</strong>
- <small id="share-chapter-note"></small>
- </div>
- <span class="share-chapter-route" id="share-chapter-route"></span>
- <span class="share-chapter-progress" aria-hidden="true"><span id="share-chapter-progress-bar"></span></span>
- </div>
<div class="diagram-guide no-print" id="diagram-guide" hidden role="dialog" aria-modal="false" aria-labelledby="diagram-guide-title">
<div class="diagram-guide-head">
<span>
@@ -5407,13 +5277,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span class="diagram-guide-action-copy"><strong>Compare semantic kinds</strong><small>Count roles, reveal their traffic, and compare direct authored links.</small></span>
<kbd aria-hidden="true">L</kbd>
</button>
- <button class="diagram-guide-action" type="button" data-guide-action="story" aria-label="Play the guided story">
- <span class="diagram-guide-index" aria-hidden="true">05</span>
- <span class="diagram-guide-action-copy"><strong>Play the guided story</strong><small id="diagram-guide-story-copy">Walk the authored chapters and real relationships.</small></span>
- <kbd aria-hidden="true">P</kbd>
- </button>
<button class="diagram-guide-action" type="button" data-guide-action="present" aria-label="Enter presentation stage">
- <span class="diagram-guide-index" aria-hidden="true">06</span>
+ <span class="diagram-guide-index" aria-hidden="true">05</span>
<span class="diagram-guide-action-copy"><strong>Enter Presentation Stage</strong><small>Give the live diagram the viewport without changing export.</small></span>
<kbd aria-hidden="true">F</kbd>
</button>
@@ -5439,6 +5304,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="focus-chip relationship-lens no-print" id="focus-chip" hidden role="region" aria-labelledby="relationship-lens-title">
<div class="relationship-lens-head">
+ <button class="relationship-lens-drag-handle" id="btn-focus-move" type="button" data-focus-drag-handle aria-label="Move semantic passport. Drag, use arrow keys, or press Home to reset." title="Move semantic passport. Drag, use arrow keys, or press Home to reset."></button>
<div class="relationship-lens-copy">
<span class="relationship-lens-eyebrow">Semantic passport</span>
<strong class="relationship-lens-title" id="relationship-lens-title"><span id="focus-label"></span></strong>
@@ -5482,8 +5348,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<div class="route-probe no-print" id="route-probe" hidden role="region" aria-labelledby="route-probe-title" data-state="idle">
<div class="route-probe-head">
<span class="route-probe-copy">
- <span class="route-probe-eyebrow">Route probe</span>
- <strong class="route-probe-title" id="route-probe-title">Choose a start node</strong>
+ <span class="route-probe-eyebrow">Path</span>
+ <strong class="route-probe-title" id="route-probe-title">Click where the path starts</strong>
</span>
<span class="route-probe-actions">
<button class="route-probe-find" id="route-probe-find" type="button" aria-label="Find a route start" data-node-finder-trigger>Find start</button>
@@ -5491,8 +5357,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<button id="route-probe-clear" type="button" aria-label="Clear route probe">Clear</button>
</span>
</div>
- <div class="route-probe-path" id="route-probe-path" aria-label="Traced route">
- <span class="route-probe-placeholder">Pick two semantic nodes on the diagram</span>
+ <div class="route-probe-path" id="route-probe-path" aria-label="Path">
+ <span class="route-probe-placeholder">Click two nodes on the diagram</span>
</div>
<div class="route-journey-controls" id="route-journey-controls" hidden role="group" aria-label="Route journey controls" data-playing="false">
<button id="route-journey-prev" type="button" aria-label="Previous route position" title="Previous route position">&#8592;</button>
@@ -5503,7 +5369,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<button id="route-journey-next" type="button" aria-label="Next route position" title="Next route position">&#8594;</button>
<button class="route-journey-overview" id="route-journey-overview" type="button" aria-label="Show complete route overview" title="Show complete route overview">Overview</button>
</div>
- <small class="route-probe-status" id="route-probe-status" aria-live="polite">Choose the source, then the destination. Direction matters.</small>
+ <small class="route-probe-status" id="route-probe-status" aria-live="polite">Click a start, then an end. Paths follow the arrows.</small>
</div>
<div class="semantic-lens no-print" id="semantic-lens" hidden role="dialog" aria-modal="false" aria-labelledby="semantic-lens-title">
<div class="semantic-lens-head">
@@ -5535,18 +5401,24 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<div class="overview-map-hint" aria-hidden="true"><span>Click node</span><span>Drag to pan</span></div>
</div>
<p class="overview-map-feedback no-print" id="overview-map-feedback" role="status" aria-live="polite" hidden>Semantic radar needs more MAP space.</p>
+ <button class="rail-reveal no-print" id="rail-reveal" type="button" hidden aria-controls="reader-rail" aria-expanded="false"><span class="rail-reveal-icon" aria-hidden="true"></span><span>Notes &amp; index</span></button>
<div class="diagram-nav no-print" role="toolbar" aria-label="Diagram view controls">
<button id="btn-route-probe" type="button" aria-label="Trace a directed route" aria-pressed="false" aria-controls="route-probe" title="Trace route (R)">PATH</button>
<button id="btn-overview-map" type="button" aria-label="Open semantic radar" aria-expanded="false" aria-controls="overview-map" title="Semantic radar (M)">MAP</button>
<button id="btn-semantic-lens" type="button" aria-label="Open semantic lens" aria-haspopup="dialog" aria-expanded="false" aria-pressed="false" aria-controls="semantic-lens" title="Semantic lens (L)">LENS</button>
<button id="btn-node-finder" type="button" aria-label="Find a node" aria-haspopup="dialog" aria-expanded="false" aria-controls="node-finder" title="Find a node (/)" data-node-finder-trigger><span class="diagram-nav-icon find" aria-hidden="true"></span></button>
- <button id="btn-diagram-guide" type="button" aria-label="Open diagram guide" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="Diagram guide (?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
+ <button id="btn-diagram-guide" type="button" hidden aria-label="Open diagram guide" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="Diagram guide (?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
<button data-view="out" type="button" aria-label="Zoom out" title="Zoom out (-)"><span class="diagram-nav-icon minus" aria-hidden="true"></span></button>
<button data-view="reset" type="button" aria-label="Reset diagram view" title="Reset view (0)"><span class="diagram-nav-detail" data-view-detail hidden>READ</span><span class="diagram-nav-percent" data-view-percent>100%</span></button>
<button data-view="in" type="button" aria-label="Zoom in" title="Zoom in (+)"><span class="diagram-nav-icon plus" aria-hidden="true"></span></button>
</div>
</div>
+ <aside class="reader-rail" id="reader-rail">
+ <div class="rail-controls no-print" role="toolbar" aria-label="Side panel">
+ <button class="rail-control" id="rail-placement" type="button" hidden aria-label="Move panel below the diagram" title="Move panel below the diagram" data-placement="right"><span class="rail-control-icon placement" aria-hidden="true"></span></button>
+ <button class="rail-control" id="rail-collapse" type="button" hidden aria-controls="reader-rail" aria-expanded="true" aria-label="Collapse side panel" title="Collapse side panel"><span class="rail-control-icon collapse" aria-hidden="true"></span></button>
+ </div>
<!-- Info Cards -->
<div class="cards">
<div class="card">
@@ -5555,9 +5427,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Agent loop</h3>
</div>
<ul>
- <li>&bull; Claude / Codex / opencode load the skill</li>
- <li>&bull; SKILL.md teaches layout judgment, not auto-layout</li>
- <li>&bull; Mermaid is an input dialect via prompt, not a parser</li>
+ <li>Claude / Codex / opencode load the skill</li>
+ <li>SKILL.md teaches layout judgment, not auto-layout</li>
+ <li>Mermaid is an input dialect via prompt, not a parser</li>
</ul>
</div>
@@ -5567,9 +5439,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Render path</h3>
</div>
<ul>
- <li>&bull; JSON IR pins schema_version: 1</li>
- <li>&bull; Five typed renderers: architecture / workflow / sequence / dataflow / lifecycle</li>
- <li>&bull; template.html owns theme toggle and 4× export</li>
+ <li>JSON IR pins schema_version: 1</li>
+ <li>Five typed renderers: architecture / workflow / sequence / dataflow / lifecycle</li>
+ <li>template.html owns theme toggle and 4× export</li>
</ul>
</div>
@@ -5579,12 +5451,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Quality gates</h3>
</div>
<ul>
- <li>&bull; ajv schema validation sits on the IR (fail-closed)</li>
- <li>&bull; Renderer layout checks, then Output Check on the HTML</li>
- <li>&bull; CI golden tests and zip freshness stay off the main path</li>
+ <li>ajv schema validation sits on the IR (fail-closed)</li>
+ <li>Renderer layout checks, then Output Check on the HTML</li>
+ <li>CI golden tests and zip freshness stay off the main path</li>
</ul>
</div>
</div>
+ <nav class="node-outline no-print" id="node-outline" hidden aria-labelledby="node-outline-title">
+ <div class="node-outline-head">
+ <strong id="node-outline-title">Node index</strong>
+ <span class="node-outline-count" id="node-outline-count"></span>
+ </div>
+ <ol class="node-outline-list" id="node-outline-list"></ol>
+ </nav>
+ </aside>
</div>
@@ -5842,8 +5722,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var MOTION_FPS = 30;
var SHARE_CARD_WIDTH = 1200;
var SHARE_CARD_HEIGHT = 630;
- var SHARE_CARD_PADDING = 36;
- var SHARE_CARD_HEADER = 112;
+ var SHARE_CARD_PADDING = 40;
+ var SHARE_CARD_HEADER = 124;
function exportError(key, values) {
var error = new Error(viewerText(key, values));
@@ -5871,6 +5751,156 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return getComputedStyle(document.body).backgroundColor || '#ffffff';
}
+ function cleanExportClone(clone) {
+ // View transforms and neighborhood focus are HTML exploration state,
+ // never part of a downloaded full-diagram artifact.
+ clone.style.removeProperty('transform');
+ clone.style.removeProperty('clip-path');
+ clone.removeAttribute('data-view-scale');
+ clone.removeAttribute('data-focus-active');
+ clone.removeAttribute('data-reach-active');
+ clone.removeAttribute('data-lens-active');
+ clone.removeAttribute('data-lens-flow-count');
+ clone.removeAttribute('data-lens-flow-density');
+ clone.removeAttribute('data-legend-preview-active');
+ clone.removeAttribute('data-relationship-preview-active');
+ clone.removeAttribute('data-relationship-direct-active');
+ clone.removeAttribute('data-relationship-pin-active');
+ clone.removeAttribute('data-intent-trace-active');
+ clone.removeAttribute('data-route-picking');
+ clone.removeAttribute('data-route-active');
+ clone.removeAttribute('data-route-journey');
+ clone.removeAttribute('data-share-route');
+ clone.removeAttribute('data-share-reach');
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
+ el.removeAttribute('data-legend-kind');
+ el.removeAttribute('data-legend-label');
+ el.removeAttribute('data-legend-count');
+ el.removeAttribute('data-legend-zero');
+ el.removeAttribute('data-legend-selected');
+ el.removeAttribute('role');
+ el.removeAttribute('tabindex');
+ el.removeAttribute('aria-label');
+ el.removeAttribute('aria-pressed');
+ el.removeAttribute('aria-haspopup');
+ el.removeAttribute('aria-controls');
+ el.removeAttribute('aria-expanded');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
+ el.removeAttribute('data-legend-bridge');
+ el.removeAttribute('role');
+ el.removeAttribute('aria-label');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
+ var originalLabel = el.getAttribute('data-source-evidence-original-label');
+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');
+ else el.setAttribute('aria-label', originalLabel);
+ el.removeAttribute('data-source-evidence-count');
+ el.removeAttribute('data-source-evidence-original-label');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
+ el.removeAttribute('data-focus-match');
+ el.removeAttribute('data-focus-selected');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
+ el.removeAttribute('data-reach-match');
+ el.removeAttribute('data-reach-origin');
+ el.removeAttribute('data-reach-depth');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
+ el.removeAttribute('data-lens-match');
+ el.removeAttribute('data-lens-selected');
+ el.removeAttribute('data-lens-peer');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
+ el.removeAttribute('data-legend-preview-match');
+ el.removeAttribute('data-legend-preview-selected');
+ el.removeAttribute('data-legend-preview-peer');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
+ el.removeAttribute('data-relationship-preview');
+ el.removeAttribute('data-relationship-preview-node');
+ el.removeAttribute('data-relationship-preview-source');
+ el.removeAttribute('data-relationship-preview-target');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
+ el.removeAttribute('data-intent-trace-match');
+ el.removeAttribute('data-intent-trace-selected');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
+ el.removeAttribute('data-route-match');
+ el.removeAttribute('data-route-start');
+ el.removeAttribute('data-route-end');
+ el.removeAttribute('data-route-step');
+ el.removeAttribute('data-route-candidate');
+ el.removeAttribute('data-route-journey-state');
+ el.removeAttribute('data-route-journey-current');
+ el.style.removeProperty('--route-step');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
+ el.removeAttribute('data-share-route-match');
+ el.removeAttribute('data-share-route-step');
+ el.removeAttribute('data-share-route-start');
+ el.removeAttribute('data-share-route-end');
+ el.removeAttribute('data-share-route-middle');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
+ el.removeAttribute('data-share-reach-match');
+ el.removeAttribute('data-share-reach-origin');
+ el.removeAttribute('data-share-reach-depth');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
+ el.removeAttribute('data-detail');
+ el.removeAttribute('data-detail-anchor');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
+ el.setAttribute('aria-pressed', 'false');
+ });
+ return !clone.hasAttribute('data-view-scale') &&
+ !clone.hasAttribute('data-focus-active') &&
+ !clone.hasAttribute('data-reach-active') &&
+ !clone.hasAttribute('data-lens-active') &&
+ !clone.hasAttribute('data-lens-flow-count') &&
+ !clone.hasAttribute('data-lens-flow-density') &&
+ !clone.hasAttribute('data-legend-preview-active') &&
+ !clone.hasAttribute('data-relationship-preview-active') &&
+ !clone.hasAttribute('data-relationship-direct-active') &&
+ !clone.hasAttribute('data-intent-trace-active') &&
+ !clone.hasAttribute('data-route-picking') &&
+ !clone.hasAttribute('data-route-active') &&
+ !clone.hasAttribute('data-route-journey') &&
+ !clone.hasAttribute('data-share-route') &&
+ !clone.hasAttribute('data-share-reach') &&
+ !clone.style.getPropertyValue('transform') &&
+ !clone.style.getPropertyValue('clip-path') &&
+ clone.querySelectorAll('[data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;
+ }
+
+
/**
* Serialize the main SVG into a standalone document.
*
@@ -5880,10 +5910,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
* (PNG/JPEG/WebP/clipboard) because canvas rasterization needs
* deterministic colors; a raster cannot react to
* prefers-color-scheme after encoding.
- * - autoTheme=true — emits BOTH dark and light variable sets plus a
+ * - theme=auto — emits BOTH dark and light variable sets plus a
* `@media (prefers-color-scheme)` rule so the resulting SVG
* self-themes when embedded in GitHub READMEs or other hosts that
- * expose a color scheme. Used for "Download SVG".
+ * expose a color scheme. Used for the default "Download SVG".
+ * - theme=light|dark — locks the standalone SVG to the requested
+ * theme, independently of its source Viewer and host OS themes.
*/
function applyRouteSnapshot(clone, snapshot) {
if (!snapshot || !Array.isArray(snapshot.nodeIds) || !Array.isArray(snapshot.edges) ||
@@ -6048,194 +6080,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function serializeSvg(scale, opts) {
- // scale: integer multiplier for intrinsic SVG pixel dimensions used by
+ // scale: multiplier (integer unless the figure is oversized) for intrinsic SVG pixel dimensions used by
// the raster path. Defaults to 1 (natural size) for SVG download.
scale = scale || 1;
opts = opts || {};
- var autoTheme = opts.autoTheme === true;
+ var requestedTheme = opts.theme || (opts.autoTheme === true ? 'auto' : null);
+ if (requestedTheme && requestedTheme !== 'auto' && requestedTheme !== 'light' && requestedTheme !== 'dark') {
+ throw new Error('Unsupported SVG theme: ' + requestedTheme);
+ }
+ var autoTheme = requestedTheme === 'auto';
var svg = document.querySelector('.diagram-container svg');
var clone = svg.cloneNode(true);
- // View transforms and neighborhood focus are HTML exploration state,
- // never part of a downloaded full-diagram artifact.
- clone.style.removeProperty('transform');
- clone.style.removeProperty('clip-path');
- clone.removeAttribute('data-view-scale');
- clone.removeAttribute('data-focus-active');
- clone.removeAttribute('data-reach-active');
- clone.removeAttribute('data-lens-active');
- clone.removeAttribute('data-lens-flow-count');
- clone.removeAttribute('data-lens-flow-density');
- clone.removeAttribute('data-legend-preview-active');
- clone.removeAttribute('data-relationship-preview-active');
- clone.removeAttribute('data-relationship-direct-active');
- clone.removeAttribute('data-relationship-pin-active');
- clone.removeAttribute('data-intent-trace-active');
- clone.removeAttribute('data-route-picking');
- clone.removeAttribute('data-route-active');
- clone.removeAttribute('data-route-journey');
- clone.removeAttribute('data-share-route');
- clone.removeAttribute('data-share-reach');
- clone.removeAttribute('data-story-active');
- clone.removeAttribute('data-story-playing');
- clone.removeAttribute('data-story-beat');
- clone.removeAttribute('data-story-next');
- clone.removeAttribute('data-story-follow');
- clone.removeAttribute('data-chapter-handoff');
- clone.removeAttribute('data-chapter-anchor');
- clone.removeAttribute('data-chapter-preview');
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {
- el.removeAttribute('data-chapter-role');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {
- el.removeAttribute('data-chapter-preview-role');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
- el.removeAttribute('data-legend-kind');
- el.removeAttribute('data-legend-label');
- el.removeAttribute('data-legend-count');
- el.removeAttribute('data-legend-zero');
- el.removeAttribute('data-legend-selected');
- el.removeAttribute('role');
- el.removeAttribute('tabindex');
- el.removeAttribute('aria-label');
- el.removeAttribute('aria-pressed');
- el.removeAttribute('aria-haspopup');
- el.removeAttribute('aria-controls');
- el.removeAttribute('aria-expanded');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
- el.removeAttribute('data-legend-bridge');
- el.removeAttribute('role');
- el.removeAttribute('aria-label');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
- var originalLabel = el.getAttribute('data-source-evidence-original-label');
- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');
- else el.setAttribute('aria-label', originalLabel);
- el.removeAttribute('data-source-evidence-count');
- el.removeAttribute('data-source-evidence-original-label');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {
- el.removeAttribute('data-story-step');
- el.removeAttribute('data-story-beat-state');
- el.removeAttribute('data-story-beat-step');
- el.style.removeProperty('--story-step');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
- el.removeAttribute('data-focus-match');
- el.removeAttribute('data-focus-selected');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
- el.removeAttribute('data-reach-match');
- el.removeAttribute('data-reach-origin');
- el.removeAttribute('data-reach-depth');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
- el.removeAttribute('data-lens-match');
- el.removeAttribute('data-lens-selected');
- el.removeAttribute('data-lens-peer');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
- el.removeAttribute('data-legend-preview-match');
- el.removeAttribute('data-legend-preview-selected');
- el.removeAttribute('data-legend-preview-peer');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
- el.removeAttribute('data-relationship-preview');
- el.removeAttribute('data-relationship-preview-node');
- el.removeAttribute('data-relationship-preview-source');
- el.removeAttribute('data-relationship-preview-target');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
- el.removeAttribute('data-intent-trace-match');
- el.removeAttribute('data-intent-trace-selected');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
- el.removeAttribute('data-route-match');
- el.removeAttribute('data-route-start');
- el.removeAttribute('data-route-end');
- el.removeAttribute('data-route-step');
- el.removeAttribute('data-route-candidate');
- el.removeAttribute('data-route-journey-state');
- el.removeAttribute('data-route-journey-current');
- el.style.removeProperty('--route-step');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
- el.removeAttribute('data-share-route-match');
- el.removeAttribute('data-share-route-step');
- el.removeAttribute('data-share-route-start');
- el.removeAttribute('data-share-route-end');
- el.removeAttribute('data-share-route-middle');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
- el.removeAttribute('data-share-reach-match');
- el.removeAttribute('data-share-reach-origin');
- el.removeAttribute('data-share-reach-depth');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
- el.removeAttribute('data-detail');
- el.removeAttribute('data-detail-anchor');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
- el.setAttribute('aria-pressed', 'false');
- });
- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&
- !clone.hasAttribute('data-focus-active') &&
- !clone.hasAttribute('data-reach-active') &&
- !clone.hasAttribute('data-lens-active') &&
- !clone.hasAttribute('data-lens-flow-count') &&
- !clone.hasAttribute('data-lens-flow-density') &&
- !clone.hasAttribute('data-legend-preview-active') &&
- !clone.hasAttribute('data-relationship-preview-active') &&
- !clone.hasAttribute('data-relationship-direct-active') &&
- !clone.hasAttribute('data-intent-trace-active') &&
- !clone.hasAttribute('data-route-picking') &&
- !clone.hasAttribute('data-route-active') &&
- !clone.hasAttribute('data-route-journey') &&
- !clone.hasAttribute('data-share-route') &&
- !clone.hasAttribute('data-share-reach') &&
- !clone.hasAttribute('data-story-active') &&
- !clone.hasAttribute('data-story-playing') &&
- !clone.hasAttribute('data-story-beat') &&
- !clone.hasAttribute('data-story-next') &&
- !clone.hasAttribute('data-story-follow') &&
- !clone.hasAttribute('data-chapter-handoff') &&
- !clone.hasAttribute('data-chapter-anchor') &&
- !clone.hasAttribute('data-chapter-preview') &&
- !clone.style.getPropertyValue('transform') &&
- !clone.style.getPropertyValue('clip-path') &&
- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;
+ var canonicalStateClean = cleanExportClone(clone);
var vb = svg.viewBox.baseVal;
var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&
@@ -6252,6 +6109,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// canvas upscaling.
clone.setAttribute('width', vb.width * scale);
clone.setAttribute('height', vb.height * scale);
+ // Keep copied Viewer layout rules from overriding the export's size.
+ clone.style.width = vb.width * scale + 'px';
+ clone.style.height = vb.height * scale + 'px';
+ clone.style.minWidth = '0';
clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
// Only the SVG-relevant rules: semantic classes, markers, and the
@@ -6272,6 +6133,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var sel = rule.selectorText || '';
if (/(^|,)\s*(svg|:root|\[data-theme|\[data-preset|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {
out.push(rule.cssText);
+ } else if (opts.figure && sel.indexOf('.diagram-container > svg') !== -1) {
+ // Figures look like the Viewer canvas: keep its preset/theme paint
+ // (quiet grid, lifted nodes) by rescoping matching rules to svg.
+ var scoped = sel.split(',').map(function (part) {
+ var at = part.indexOf('.diagram-container > svg');
+ if (at === -1) return null;
+ var prefix = part.slice(0, at).trim();
+ try { if (prefix && !document.documentElement.matches(prefix)) return null; } catch (_) { return null; }
+ return 'svg' + part.slice(at + '.diagram-container > svg'.length);
+ }).filter(Boolean);
+ if (scoped.length) out.push(scoped.join(', ') + ' { ' + rule.style.cssText + ' }');
}
});
});
@@ -6300,9 +6172,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6314,25 +6189,29 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');
var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- bgRect.setAttribute('width', '100%');
- bgRect.setAttribute('height', '100%');
+ // Cover the real viewBox: auto-cropped canvases start below y=0, and a
+ // 100% rect anchored at the origin left an unpainted band at the bottom.
+ bgRect.setAttribute('x', vb.x);
+ bgRect.setAttribute('y', vb.y);
+ bgRect.setAttribute('width', vb.width);
+ bgRect.setAttribute('height', vb.height);
if (autoTheme) {
// Dual-theme SVG. Dark is the default (so hosts without
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6341,11 +6220,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// swaps with the media query.
bgRect.setAttribute('class', 'c-bg-rect');
} else {
- // Raster path: lock to the viewer's current theme.
- var theme = document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ // Raster exports keep the viewer's current theme. Explicit SVG
+ // exports instead select their own stable light/dark source.
+ var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6359,30 +6239,37 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
hostStyle + "\n" +
":root, svg { " + vars + " }\n";
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
- style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from] { opacity: 0.18; }\n" +
- "svg[data-share-route] [data-share-route-match] { opacity: 1; }\n" +
+ style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from], svg[data-share-route] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.18; }\n" +
+ "svg[data-share-route] [data-share-route-match], svg[data-share-route] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-route-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
"svg[data-share-route] [data-share-route-start] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3; stroke-dasharray: 5 3; }\n" +
"svg[data-share-route] [data-share-route-middle] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 2.2; }\n" +
"svg[data-share-route] [data-share-route-end] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3.4; stroke-dasharray: 1 0; }\n";
}
if (opts.reachSnapshot) {
- style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from] { opacity: 0.14; }\n" +
- "svg[data-share-reach] [data-share-reach-match] { opacity: 1; }\n" +
+ style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from], svg[data-share-reach] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.14; }\n" +
+ "svg[data-share-reach] [data-share-reach-match], svg[data-share-reach] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-reach-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
"svg[data-share-reach] [data-edge-from][data-share-reach-match] { stroke-width: 1.55; }\n" +
"svg[data-share-reach=\"upstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--database-stroke); stroke-width: 3.4; stroke-dasharray: 5 3; }\n" +
"svg[data-share-reach=\"downstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--backend-stroke); stroke-width: 3.4; stroke-dasharray: 1 0; }\n" +
"svg[data-preset=\"blueprint\"][data-share-reach] [data-share-reach-origin], svg[data-preset=\"blueprint\"][data-share-reach] [data-edge-from][data-share-reach-match] { filter: none; }\n";
}
+ // Figures draw the diagram on a painted canvas card, like the Viewer.
+ if (opts.figure) bgRect.setAttribute('fill', 'none');
+
clone.insertBefore(style, clone.firstChild);
clone.insertBefore(bgRect, style.nextSibling);
+ // The XML declaration pins UTF-8: without it, consumers that guess an
+ // encoding instead of defaulting to UTF-8 mangle non-ASCII text.
return {
- svgString: new XMLSerializer().serializeToString(clone),
+ svgString: '<?xml version="1.0" encoding="UTF-8"?>\n' +
+ new XMLSerializer().serializeToString(clone),
width: vb.width * scale,
height: vb.height * scale,
canonicalStateClean: canonicalStateClean,
@@ -6406,14 +6293,114 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /
// desktop Safari are far higher but start failing on memory-constrained
// devices. We pick the largest integer scale in {4,3,2,1} whose target
- // pixel count fits under this cap.
+ // pixel count fits under this cap; a figure too large even at 1x is
+ // downscaled to fit rather than allocating an oversized canvas.
var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;
function pickSafeScale(vbW, vbH) {
for (var s = RASTER_SCALE; s >= 1; s--) {
if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;
}
- return 1;
+ return Math.sqrt(MAX_CANVAS_PIXELS / (vbW * vbH)) * 0.999;
+ }
+
+ // Raster exports reproduce the Viewer page without its controls: the
+ // title row with its accent dot, then the diagram on the same rounded
+ // canvas card (fill, hairline, shadow, dot field). CSS pixels.
+ var FIGURE_MARGIN = 28;
+ var FIGURE_CARD_PADDING = 24;
+ var FIGURE_TITLE_SIZE = 24;
+ var FIGURE_SUBTITLE_SIZE = 14;
+
+ function figureLayout(vb) {
+ var titleNode = document.querySelector('.header h1');
+ var subtitleNode = document.querySelector('.header .subtitle');
+ var container = document.querySelector('.diagram-container');
+ var root = getComputedStyle(document.documentElement);
+ var card = container ? getComputedStyle(container) : null;
+ var title = titleNode ? titleNode.textContent.trim() : '';
+ var subtitle = subtitleNode ? subtitleNode.textContent.trim() : '';
+ var header = title ? 32 + (subtitle ? 24 : 0) + 18 : 0;
+ var cardWidth = vb.width + FIGURE_CARD_PADDING * 2;
+ var cardHeight = vb.height + FIGURE_CARD_PADDING * 2;
+ var cardFill = card && card.backgroundColor && !/rgba\(0, 0, 0, 0\)|transparent/.test(card.backgroundColor)
+ ? card.backgroundColor : (root.getPropertyValue('--panel').trim() || 'transparent');
+ return {
+ title: title,
+ subtitle: subtitle,
+ family: titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif',
+ text: root.getPropertyValue('--text').trim() || '#111827',
+ muted: root.getPropertyValue('--text-muted').trim() || '#64748b',
+ accent: root.getPropertyValue('--frontend-stroke').trim() || '#0891b2',
+ bg: root.getPropertyValue('--bg').trim() || currentBg(),
+ cardFill: cardFill,
+ cardBorder: root.getPropertyValue('--panel-border').trim() || 'transparent',
+ dot: card && /radial-gradient/.test(card.backgroundImage) ? (root.getPropertyValue('--canvas-dot').trim() || '') : '',
+ light: (document.documentElement.getAttribute('data-theme') || 'dark') === 'light',
+ header: header,
+ cardWidth: cardWidth,
+ cardHeight: cardHeight,
+ width: cardWidth + FIGURE_MARGIN * 2,
+ height: cardHeight + FIGURE_MARGIN * 2 + header
+ };
+ }
+
+ function paintFigure(ctx, layout) {
+ var m = FIGURE_MARGIN;
+ ctx.fillStyle = layout.bg;
+ ctx.fillRect(0, 0, layout.width, layout.height);
+ if (layout.title) {
+ var titleMid = m + 16;
+ ctx.fillStyle = layout.accent;
+ ctx.globalAlpha = 0.16;
+ ctx.beginPath(); ctx.arc(m + 5, titleMid, 9, 0, Math.PI * 2); ctx.fill();
+ ctx.globalAlpha = 1;
+ ctx.beginPath(); ctx.arc(m + 5, titleMid, 5, 0, Math.PI * 2); ctx.fill();
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = layout.text;
+ ctx.fillText(fitCanvasText(ctx, layout.title, layout.width - m * 2 - 22, FIGURE_TITLE_SIZE, 14, '650', layout.family), m + 22, titleMid + 1);
+ if (layout.subtitle) {
+ ctx.fillStyle = layout.muted;
+ ctx.fillText(fitCanvasText(ctx, layout.subtitle, layout.width - m * 2, FIGURE_SUBTITLE_SIZE, 11, '400', layout.family), m, titleMid + 30);
+ }
+ ctx.textBaseline = 'alphabetic';
+ }
+ var x = m, y = m + layout.header, w = layout.cardWidth, h = layout.cardHeight, r = 16;
+ function cardPath() {
+ ctx.beginPath();
+ if (typeof ctx.roundRect === 'function') ctx.roundRect(x, y, w, h, r);
+ else ctx.rect(x, y, w, h);
+ }
+ ctx.save();
+ if (layout.light) {
+ ctx.shadowColor = 'rgba(15, 23, 42, 0.08)';
+ ctx.shadowBlur = 28;
+ ctx.shadowOffsetY = 10;
+ }
+ cardPath();
+ ctx.fillStyle = layout.bg;
+ ctx.fill();
+ ctx.restore();
+ cardPath();
+ ctx.fillStyle = layout.cardFill;
+ ctx.fill();
+ if (layout.dot) {
+ ctx.save();
+ cardPath();
+ ctx.clip();
+ ctx.fillStyle = layout.dot;
+ for (var dy = y + 1; dy < y + h; dy += 20) {
+ for (var dx = x + 1; dx < x + w; dx += 20) {
+ ctx.beginPath(); ctx.arc(dx, dy, 1, 0, Math.PI * 2); ctx.fill();
+ }
+ }
+ ctx.restore();
+ }
+ cardPath();
+ ctx.strokeStyle = layout.cardBorder;
+ ctx.lineWidth = 1;
+ ctx.stroke();
+ return { x: x + FIGURE_CARD_PADDING, y: y + FIGURE_CARD_PADDING };
}
function rasterize(format) {
@@ -6423,8 +6410,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// size — no upsampling blur.
var svg = document.querySelector('.diagram-container svg');
var vb = svg.viewBox.baseVal;
- var scale = pickSafeScale(vb.width, vb.height);
- var data = serializeSvg(scale);
+ var layout = figureLayout(vb);
+ var scale = pickSafeScale(layout.width, layout.height);
+ var data = serializeSvg(scale, { figure: true });
var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });
var svgUrl = URL.createObjectURL(svgBlob);
@@ -6433,15 +6421,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
img.onload = function () {
try {
var canvas = document.createElement('canvas');
- canvas.width = data.width;
- canvas.height = data.height;
+ canvas.width = Math.round(layout.width * scale);
+ canvas.height = Math.round(layout.height * scale);
var ctx = canvas2dOrThrow(canvas, format);
- if (format === 'jpeg') {
- ctx.fillStyle = currentBg();
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- }
- // Draw at natural size — SVG was already rasterized at target res.
- ctx.drawImage(img, 0, 0);
+ // Paint in CSS pixels; the SVG image is already rendered at scale,
+ // so drawing it at CSS size under this transform stays 1:1.
+ ctx.setTransform(scale, 0, 0, scale, 0, 0);
+ var origin = paintFigure(ctx, layout);
+ ctx.drawImage(img, origin.x, origin.y, vb.width, vb.height);
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
URL.revokeObjectURL(svgUrl);
var mime = format === 'jpeg' ? 'image/jpeg' :
format === 'webp' ? 'image/webp' : 'image/png';
@@ -6463,10 +6451,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
});
}
- function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight) {
+ function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight, fontFamily) {
var value = String(text || '').trim();
var size = startSize;
- var family = "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
+ var family = fontFamily || "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
while (size > minSize) {
ctx.font = (weight || '600') + ' ' + size + 'px ' + family;
if (ctx.measureText(value).width <= maxWidth) return value;
@@ -6492,14 +6480,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function renderShareCard(options) {
- options = options || {};
var routeSnapshot = options.routeSnapshot || null;
var reachSnapshot = options.reachSnapshot || null;
if (routeSnapshot && reachSnapshot) return Promise.reject(exportError('viewer.export.error.variantsCombined'));
var svg = document.querySelector('.diagram-container svg');
var vb = svg.viewBox.baseVal;
var sourceScale = Math.min(2, pickSafeScale(vb.width, vb.height));
- var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot });
+ var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot, figure: true });
if (!data.canonicalStateClean) return Promise.reject(exportError('viewer.export.error.viewerState'));
if (routeSnapshot && !data.routeStateClean) return Promise.reject(exportError('viewer.export.error.routeState'));
if (reachSnapshot && !data.reachStateClean) return Promise.reject(exportError('viewer.export.error.reachState'));
@@ -6524,7 +6511,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
: '--frontend-stroke';
var accent = computed.getPropertyValue(accentProperty).trim() || '#22d3ee';
var titleNode = document.querySelector('.header h1');
- var subtitleNode = document.querySelector('.header .subtitle');
var title = titleNode ? titleNode.textContent : document.title;
var directionLabel = reachSnapshot
? viewerText('viewer.export.direction.' + reachSnapshot.direction)
@@ -6534,62 +6520,65 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
source: routeSnapshot.source.label,
target: routeSnapshot.target.label
})
- : reachSnapshot
- ? viewerText('viewer.export.card.reachSummary', {
- direction: directionLabel,
- origin: reachSnapshot.origin.label,
- nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
- links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
- hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
- })
- : subtitleNode ? subtitleNode.textContent : '';
- var preset = document.documentElement.getAttribute('data-preset') || 'classic';
- var theme = document.documentElement.getAttribute('data-theme') || 'dark';
- var presetKey = preset === 'signal-flow'
- ? 'viewer.preset.flow.short'
- : 'viewer.preset.' + preset;
- var presetLabel = viewerText(presetKey).toUpperCase();
- var themeLabel = viewerText('viewer.theme.' + theme).toUpperCase();
+ : viewerText('viewer.export.card.reachSummary', {
+ direction: directionLabel,
+ origin: reachSnapshot.origin.label,
+ nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
+ links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
+ hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
+ });
var cardLabel = routeSnapshot
? viewerText('viewer.export.card.routeBadge', {
hops: viewerCount('viewer.export.card.hop', routeSnapshot.hops).toUpperCase()
})
- : reachSnapshot
- ? viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() })
- : viewerText('viewer.export.card.defaultBadge', { preset: presetLabel, theme: themeLabel });
+ : viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() });
+
+ var family = titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif';
+ var panelFill = bg;
ctx.fillStyle = bg;
ctx.fillRect(0, 0, SHARE_CARD_WIDTH, SHARE_CARD_HEIGHT);
+ // Header: a short accent rule and badge over the title and summary.
ctx.fillStyle = accent;
- ctx.fillRect(SHARE_CARD_PADDING, 27, 42, 3);
-
+ ctx.fillRect(SHARE_CARD_PADDING, 34, 28, 3);
ctx.textBaseline = 'alphabetic';
+ ctx.font = '600 12px ' + family;
+ ctx.textAlign = 'right';
+ ctx.fillStyle = muted;
+ ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 40);
+ ctx.textAlign = 'left';
+
ctx.fillStyle = text;
- var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 330, 29, 18, '700');
- ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 62);
+ var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 260, 30, 18, '650', family);
+ ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 74);
ctx.fillStyle = muted;
- var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 280, 13, 11, '500');
- ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 87);
-
- ctx.font = "600 12px 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
- ctx.textAlign = 'right';
- ctx.fillStyle = accent;
- ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 50);
- ctx.textAlign = 'left';
+ var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2, 15, 12, '400', family);
+ ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 99);
+
+ // The diagram sits on one soft rounded panel with an even inset.
+ var panelX = SHARE_CARD_PADDING;
+ var panelY = SHARE_CARD_HEADER;
+ var panelWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
+ var panelHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
+ var inset = 18;
+ ctx.beginPath();
+ if (typeof ctx.roundRect === 'function') ctx.roundRect(panelX, panelY, panelWidth, panelHeight, 14);
+ else ctx.rect(panelX, panelY, panelWidth, panelHeight);
+ ctx.fillStyle = panelFill;
+ ctx.fill();
+ ctx.strokeStyle = border;
+ ctx.lineWidth = 1;
+ ctx.stroke();
- var availableWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
- var availableHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
+ var availableWidth = panelWidth - inset * 2;
+ var availableHeight = panelHeight - inset * 2;
var fit = Math.min(availableWidth / data.width, availableHeight / data.height);
var drawWidth = data.width * fit;
var drawHeight = data.height * fit;
- var drawX = SHARE_CARD_PADDING + (availableWidth - drawWidth) / 2;
- var drawY = SHARE_CARD_HEADER + (availableHeight - drawHeight) / 2;
-
- ctx.strokeStyle = border;
- ctx.lineWidth = 1;
- ctx.strokeRect(drawX - 0.5, drawY - 0.5, drawWidth + 1, drawHeight + 1);
+ var drawX = panelX + inset + (availableWidth - drawWidth) / 2;
+ var drawY = panelY + inset + (availableHeight - drawHeight) / 2;
ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);
URL.revokeObjectURL(svgUrl);
@@ -6612,7 +6601,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function rasterizeShareCard(options) {
options = options || {};
- if (!options.variant) return renderShareCard();
if (options.variant !== 'route' && options.variant !== 'reach') {
return Promise.reject(exportError('viewer.export.unknownVariant', { variant: options.variant }));
}
@@ -6925,8 +6913,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// canvas.toBlob('image/webp') silently returns a PNG on browsers without
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
- if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
@@ -6942,7 +6929,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
it.disabled = true;
it.title = viewerText('viewer.export.unsupported');
}
- if ((it.dataset.action === 'copy' || it.dataset.action === 'copy-share-card') && !canCopyImage()) {
+ if (it.dataset.action === 'copy' && !canCopyImage()) {
it.disabled = true;
it.title = viewerText('viewer.export.clipboardUnsupported');
}
@@ -7032,21 +7019,21 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
});
function runExport(format) {
+ if (['svg', 'svg-light', 'svg-dark', 'png', 'jpeg', 'webp', 'webm'].indexOf(format) === -1) {
+ return Promise.reject(exportError('viewer.export.unsupported'));
+ }
var base = diagramFilename();
+ var svgTheme = format === 'svg' ? 'auto' :
+ format === 'svg-light' ? 'light' :
+ format === 'svg-dark' ? 'dark' : null;
close(true);
clearExportReceipt();
if (format === 'webm') toast(viewerText('viewer.export.recording'));
- return (format === 'share-card'
- ? rasterizeShareCard().then(function (blob) {
- recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });
- download(blob, base + '-share-card.png');
- toast(viewerText('viewer.export.downloadedShare'));
- })
- : format === 'svg'
- ? Promise.resolve(serializeSvg(1, { autoTheme: true })).then(function (d) {
+ return (svgTheme
+ ? Promise.resolve(serializeSvg(1, { theme: svgTheme })).then(function (d) {
var blob = new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' });
recordExportReceipt('svg', blob, d.canonicalStateClean);
- download(blob, base + '.svg');
+ download(blob, base + (svgTheme === 'auto' ? '' : '-' + svgTheme) + '.svg');
})
: format === 'webm'
? recordWebm().then(function (blob) {
@@ -7182,29 +7169,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
}
- function runCopyShareCard() {
- close(true);
- clearExportReceipt();
- if (!canCopyImage()) {
- alert(viewerText('viewer.export.clipboardUnsupported.period'));
- return;
- }
- var blobPromise = rasterizeShareCard();
- return writePngToClipboard(blobPromise).then(function () {
- return blobPromise.then(function (blob) {
- recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });
- toast(viewerText('viewer.export.copiedShare'));
- });
- }).catch(function (err) {
- console.error(err);
- var technicalMessage = err && err.message ? err.message : 'share-card';
- var message = exportMessage(err);
- document.documentElement.setAttribute('data-last-export-error-format', 'share-card');
- document.documentElement.setAttribute('data-last-export-error', technicalMessage);
- alert(viewerText('viewer.export.copyFailed', { message: message }));
- });
- }
-
function runCopy() {
close(true);
clearExportReceipt();
@@ -7230,9 +7194,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var reachShareCardBtn = e.target.closest('button[data-action="reach-share-card"]');
if (reachShareCardBtn && !reachShareCardBtn.disabled && !reachShareCardBtn.hidden) { runReachShareCard(); return; }
- var copyShareCardBtn = e.target.closest('button[data-action="copy-share-card"]');
- if (copyShareCardBtn && !copyShareCardBtn.disabled) { runCopyShareCard(); return; }
-
var copyBtn = e.target.closest('button[data-action="copy"]');
if (copyBtn && !copyBtn.disabled) { runCopy(); return; }
@@ -7250,8 +7211,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
downloadRouteShareCard: runRouteShareCard,
downloadReachShareCard: runReachShareCard,
syncRouteShare: syncRouteShareItem,
- syncReachShare: syncReachShareItem,
- copyShareCard: runCopyShareCard
+ syncReachShare: syncReachShareItem
};
// Auto-open on page load for demo/screenshot purposes: ?openExport=1
@@ -7272,6 +7232,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
} catch (_) {}
})();
+
/* ============================================================
Motion Governor — one reader switch and one motion budget. Ambient
trace yields to the strongest semantic owner; Still also parks bounded
@@ -7345,10 +7306,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return readerPaused || reducedMotion() || hasSuspension();
}
function ownerLabel(value) {
- if (value === 'story') return viewerText('viewer.owner.story');
- if (value === 'chapter') return viewerText('viewer.owner.chapter');
- if (value === 'chapter-preview') return viewerText('viewer.owner.chapterPreview');
- if (value === 'handoff') return viewerText('viewer.owner.handoff');
if (value === 'route') return viewerText('viewer.owner.route');
if (value === 'lens') return viewerText('viewer.owner.lens');
if (value === 'relationship') return viewerText('viewer.owner.relationship');
@@ -7370,12 +7327,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
btn.setAttribute('aria-pressed', paused ? 'false' : 'true');
btn.disabled = systemPaused;
label.textContent = viewerText(paused ? 'viewer.motion.still' : 'viewer.motion.live');
- if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
- if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.settleHandoff) {
- Archify.guidedViews.settleHandoff(systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still'));
- }
if (paused && lastEffectivePaused !== true && Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still') });
}
@@ -7414,8 +7365,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function deriveOwner() {
if (!svg) return '';
- if (svg.hasAttribute('data-story-playing') || svg.hasAttribute('data-story-follow')) return 'story';
- if (svg.hasAttribute('data-story-active')) return 'chapter';
if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return 'route';
if (svg.hasAttribute('data-lens-active')) return 'lens';
if (svg.hasAttribute('data-relationship-preview-active')) return 'relationship';
@@ -7509,7 +7458,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
ownerObserver.observe(svg, {
attributes: true,
attributeFilter: [
- 'data-story-playing', 'data-story-follow', 'data-story-active', 'data-route-picking', 'data-route-active',
+ 'data-route-picking', 'data-route-active',
'data-lens-active', 'data-relationship-preview-active', 'data-intent-trace-active',
'data-focus-active', 'data-legend-preview-active'
]
@@ -7638,6 +7587,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var copyBtn = document.getElementById('btn-focus-copy');
var relationsBtn = document.getElementById('btn-focus-relations');
var clearBtn = document.getElementById('btn-focus-clear');
+ var moveBtn = document.getElementById('btn-focus-move');
var activeIds = [];
var hoveredRelationship = null;
var focusedRelationship = null;
@@ -7647,6 +7597,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var relationshipHitOverlay = null;
var relationshipHitTargets = [];
var directPreviewTimer = null;
+ var lensDrag = null;
+ var lensDragClickPointer = null;
+ var manualLensPosition = null;
var reachabilityMode = null;
var activeReachability = null;
var svgNamespace = 'http://www.w3.org/2000/svg';
@@ -7785,9 +7738,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var result = reachabilityFor(activeIds[0], direction);
if (!result || result.nodeIds.length <= 1) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });
- }
clearRelationshipPreview({ clearPin: true });
clearReachability({ updateUrl: false });
reachabilityMode = direction;
@@ -7841,7 +7791,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {
Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });
}
- requestLensPlacement();
+ placeRelationshipLens();
return true;
}
function reachabilitySnapshot() {
@@ -7944,6 +7894,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function renderSourceEvidence(id) {
evidenceLinks.textContent = '';
repositoryLink.removeAttribute('href');
+ repositoryLink.removeAttribute('aria-label');
repositoryLink.textContent = '';
var sources = Archify.sourceEvidence.node(id);
var repository = Archify.sourceEvidence.repository();
@@ -7951,24 +7902,28 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
evidence.hidden = true;
return;
}
- var slug = repository.url.replace(/^https:\/\/github\.com\//, '').replace(/\/$/, '');
- repositoryLink.href = repository.url + '/tree/' + repository.revision;
- repositoryLink.textContent = slug + ' @ ' + repository.shortRevision;
- repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
+ repositoryLink.textContent = repository.label + ' @ ' + repository.shortRevision;
+ if (repository.href) {
+ repositoryLink.href = repository.href;
+ repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
+ }
+ evidence.title = viewerText('viewer.passport.verificationScope');
sources.forEach(function (source) {
- var link = document.createElement('a');
+ var link = document.createElement(source.href ? 'a' : 'div');
link.className = 'semantic-passport-source';
- link.href = source.href;
- link.target = '_blank';
- link.rel = 'noopener noreferrer';
- link.referrerPolicy = 'no-referrer';
- link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
+ if (source.href) {
+ link.href = source.href;
+ link.target = '_blank';
+ link.rel = 'noopener noreferrer';
+ link.referrerPolicy = 'no-referrer';
+ link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
+ }
var name = document.createElement('strong');
name.textContent = source.label || source.path.split('/').pop() || source.path;
var location = document.createElement('code');
location.textContent = source.line
- ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + ' ↗'
- : viewerText('viewer.passport.source.openLink');
+ ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + (source.href ? ' ↗' : '')
+ : source.href ? viewerText('viewer.passport.source.openLink') : '';
var sourcePath = document.createElement('small');
sourcePath.textContent = source.path;
link.appendChild(name);
@@ -8027,8 +7982,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function relationshipHitRecords() {
var recordsByKey = {};
- var recordsById = {};
- var byId = {};
+ var recordsById = Object.create(null);
+ var byId = Object.create(null);
nodes().forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var records = [];
edges().forEach(function (edge) {
@@ -8316,7 +8271,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
target.removeAttribute('data-preview-active');
});
renderRelationshipCopyAction();
- requestLensPlacement();
+ placeRelationshipLens();
}
function previewRelationship(button, options) {
options = options || {};
@@ -8343,7 +8298,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!chip.hidden && options.direct !== true) chip.setAttribute('data-relationship-previewing', 'true');
activeRelationshipPreview = button;
renderRelationshipPulse(key);
- requestLensPlacement();
+ placeRelationshipLens();
}
function syncRelationshipPreview() {
var next = pinnedRelationship || focusedRelationship || hoveredRelationship;
@@ -8355,11 +8310,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.getAttribute('data-guide-open') === 'true' ||
container.classList.contains('is-panning') ||
(activeIds.length > 0 && !pinnedRelationshipKey) ||
- svg.hasAttribute('data-story-active') ||
svg.hasAttribute('data-route-picking') ||
svg.hasAttribute('data-route-active') ||
- svg.hasAttribute('data-lens-active') ||
- svg.hasAttribute('data-chapter-preview');
+ svg.hasAttribute('data-lens-active');
}
function scheduleDirectRelationshipPreview(target) {
if (directPreviewTimer) window.clearTimeout(directPreviewTimer);
@@ -8398,9 +8351,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var record = relationshipRecordForKey(key);
if (!record) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
set(record.from, { toggle: false, updateUrl: false });
var row = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-key]')).find(function (candidate) {
return candidate.getAttribute('data-relationship-key') === key;
@@ -8622,9 +8572,148 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationshipList.appendChild(section);
});
}
+ function lensPlacementBounds() {
+ var containerRect = container.getBoundingClientRect();
+ if (containerRect.width <= 0 || containerRect.height <= 0 || chip.offsetWidth <= 0 || chip.offsetHeight <= 0) return null;
+ var padding = window.innerWidth <= 720 ? 8 : 16;
+ var visibleLeft = Math.max(padding, -containerRect.left + padding);
+ var visibleRight = Math.min(
+ container.clientWidth - padding,
+ window.innerWidth - containerRect.left - padding
+ );
+ var visibleTop = Math.max(padding, -containerRect.top + padding);
+ var visibleBottom = Math.min(
+ container.clientHeight - padding,
+ window.innerHeight - containerRect.top - padding
+ );
+ var minLeft = visibleLeft;
+ var minTop = Math.min(visibleTop, Math.max(padding, visibleBottom - chip.offsetHeight));
+ return {
+ containerRect: containerRect,
+ minLeft: minLeft,
+ maxLeft: Math.max(minLeft, visibleRight - chip.offsetWidth),
+ minTop: minTop,
+ maxTop: Math.max(minTop, visibleBottom - chip.offsetHeight)
+ };
+ }
+ function manualLensPlacementAvailable() {
+ return window.innerWidth > 720 && (!finePointerQuery || finePointerQuery.matches);
+ }
+ function clampLensPosition(position, bounds) {
+ if (!position || !bounds) return null;
+ return {
+ left: Math.max(bounds.minLeft, Math.min(bounds.maxLeft, position.left)),
+ top: Math.max(bounds.minTop, Math.min(bounds.maxTop, position.top))
+ };
+ }
+ function currentLensPosition() {
+ var bounds = lensPlacementBounds();
+ if (!bounds) return null;
+ var rect = chip.getBoundingClientRect();
+ return clampLensPosition({
+ left: rect.left - bounds.containerRect.left,
+ top: rect.top - bounds.containerRect.top
+ }, bounds);
+ }
+ function applyManualLensPosition(position) {
+ if (!manualLensPlacementAvailable()) return false;
+ var bounds = lensPlacementBounds();
+ var clamped = clampLensPosition(position, bounds);
+ if (!clamped) return false;
+ manualLensPosition = clamped;
+ chip.setAttribute('data-manual-placement', 'true');
+ chip.style.left = Math.round(clamped.left) + 'px';
+ chip.style.top = Math.round(clamped.top) + 'px';
+ if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
+ return true;
+ }
+ function resetLensPlacement(options) {
+ options = options || {};
+ manualLensPosition = null;
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ chip.style.removeProperty('top');
+ if (options.reposition !== false && !chip.hidden) requestLensPlacement();
+ }
+ function beginLensDrag(event) {
+ if (!manualLensPlacementAvailable() || event.button !== 0 || lensDrag) return;
+ var start = currentLensPosition();
+ if (!start) return;
+ event.preventDefault();
+ event.stopPropagation();
+ lensDrag = {
+ pointerId: event.pointerId,
+ originX: event.clientX,
+ originY: event.clientY,
+ start: start,
+ previousManual: manualLensPosition ? { left: manualLensPosition.left, top: manualLensPosition.top } : null,
+ moved: false
+ };
+ chip.setAttribute('data-panel-dragging', 'true');
+ try { moveBtn.setPointerCapture(event.pointerId); } catch (_) {}
+ }
+ function moveLensDrag(event) {
+ if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
+ var dx = event.clientX - lensDrag.originX;
+ var dy = event.clientY - lensDrag.originY;
+ if (!lensDrag.moved && Math.hypot(dx, dy) <= 3) return;
+ lensDrag.moved = true;
+ event.preventDefault();
+ event.stopPropagation();
+ applyManualLensPosition({ left: lensDrag.start.left + dx, top: lensDrag.start.top + dy });
+ }
+ function finishLensDrag(event, cancel) {
+ if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
+ event.preventDefault();
+ event.stopPropagation();
+ var activeDrag = lensDrag;
+ lensDrag = null;
+ if (activeDrag.moved) lensDragClickPointer = activeDrag.pointerId;
+ chip.removeAttribute('data-panel-dragging');
+ try { moveBtn.releasePointerCapture(event.pointerId); } catch (_) {}
+ if (!cancel) return;
+ manualLensPosition = activeDrag.previousManual
+ ? { left: activeDrag.previousManual.left, top: activeDrag.previousManual.top }
+ : null;
+ if (manualLensPosition && manualLensPlacementAvailable()) {
+ applyManualLensPosition(manualLensPosition);
+ } else {
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ chip.style.removeProperty('top');
+ if (!chip.hidden) requestLensPlacement();
+ }
+ }
+ function moveLensWithKeyboard(event) {
+ if (event.key === 'Home') {
+ event.preventDefault();
+ resetLensPlacement();
+ return;
+ }
+ if (event.metaKey || event.ctrlKey || event.altKey || !manualLensPlacementAvailable()) return;
+ var directions = {
+ ArrowLeft: [-1, 0],
+ ArrowRight: [1, 0],
+ ArrowUp: [0, -1],
+ ArrowDown: [0, 1]
+ };
+ var direction = directions[event.key];
+ if (!direction) return;
+ event.preventDefault();
+ var current = manualLensPosition || currentLensPosition();
+ if (!current) return;
+ var distance = event.shiftKey ? 4 : 16;
+ applyManualLensPosition({
+ left: current.left + direction[0] * distance,
+ top: current.top + direction[1] * distance
+ });
+ }
var lensFrame = 0;
function placeRelationshipLens() {
- lensFrame = 0;
+ if (lensFrame) {
+ cancelAnimationFrame(lensFrame);
+ lensFrame = 0;
+ }
if (chip.hidden || activeIds.length !== 1) return;
var node = svg.querySelector('[data-node-id="' + activeIds[0] + '"]');
if (!node) return;
@@ -8636,8 +8725,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var visibleBottom = Math.min(containerRect.height - padding, window.innerHeight - containerRect.top - padding);
var maxTop = Math.max(padding, visibleBottom - chip.offsetHeight);
var minTop = Math.min(visibleTop, maxTop);
- var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
var mobile = window.innerWidth <= 720;
+ if (!manualLensPlacementAvailable()) {
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ } else if (manualLensPosition) {
+ applyManualLensPosition(manualLensPosition);
+ return;
+ }
+ var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
var previewingOnMobile = mobile && chip.getAttribute('data-relationship-previewing') === 'true';
var compactOnMobile = mobile && chip.getAttribute('data-relations-expanded') !== 'true';
var preferred;
@@ -8708,6 +8804,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function clear(options) {
options = options || {};
+ if (lensDrag) {
+ var dragPointerId = lensDrag.pointerId;
+ lensDrag = null;
+ chip.removeAttribute('data-panel-dragging');
+ try { moveBtn.releasePointerCapture(dragPointerId); } catch (_) {}
+ }
var restoreNode = options.restoreFocus === true && activeIds.length === 1
? svg.querySelector('[data-node-id="' + activeIds[0] + '"]')
: null;
@@ -8755,7 +8857,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationsBtn.setAttribute('aria-label', viewerText('viewer.passport.relations.show'));
relationsBtn.setAttribute('aria-expanded', 'false');
chip.removeAttribute('data-relations-expanded');
- chip.style.removeProperty('top');
+ if (options.preserveLensPlacement !== true) resetLensPlacement({ reposition: false });
if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {
Archify.view.reset({ automatic: true });
}
@@ -8778,7 +8880,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
}
var nodeList = nodes();
- var byId = {};
+ var byId = Object.create(null);
nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var normalized = [];
(ids || []).forEach(function (id) {
@@ -8790,10 +8892,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return true;
}
- clear({ updateUrl: false, preserveView: true });
+ var preserveLensPlacement = activeIds.length === 1 && normalized.length === 1 && !chip.hidden;
+ clear({ updateUrl: false, preserveView: true, preserveLensPlacement: preserveLensPlacement });
activeIds = normalized;
- var selected = {};
- var related = {};
+ var selected = Object.create(null);
+ var related = Object.create(null);
var seenEdges = {};
var matchedEdges = 0;
normalized.forEach(function (id) { selected[id] = true; related[id] = true; });
@@ -8820,12 +8923,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg.setAttribute('data-focus-active', normalized.join(' '));
var defaultLabel = normalized.length === 1
? nodeLabel(byId[normalized[0]], normalized[0])
- : viewerText('viewer.guided.chapter.selectedNodes', { count: normalized.length });
+ : viewerText('viewer.focus.selectedNodes', { count: normalized.length });
label.textContent = options.label || defaultLabel;
chip.hidden = options.hideChip === true || normalized.length !== 1 || selectionMode;
if (!chip.hidden) {
renderRelationshipLens(normalized[0], byId);
- requestLensPlacement();
+ placeRelationshipLens();
}
if (options.updateUrl !== false) {
var key = options.urlKey || 'focus';
@@ -8899,6 +9002,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });
}
});
+ moveBtn.addEventListener('pointerdown', beginLensDrag);
+ moveBtn.addEventListener('pointermove', moveLensDrag);
+ moveBtn.addEventListener('pointerup', function (event) { finishLensDrag(event, false); });
+ moveBtn.addEventListener('pointercancel', function (event) { finishLensDrag(event, true); });
+ moveBtn.addEventListener('lostpointercapture', function (event) { finishLensDrag(event, true); });
+ moveBtn.addEventListener('dblclick', function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+ resetLensPlacement();
+ });
+ moveBtn.addEventListener('keydown', moveLensWithKeyboard);
clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });
copyBtn.addEventListener('click', copyFocusLink);
upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });
@@ -8911,15 +9025,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationsBtn.setAttribute('aria-label', viewerText(expanded
? 'viewer.passport.relations.show'
: 'viewer.passport.relations.hide'));
- requestLensPlacement();
+ placeRelationshipLens();
});
relationshipList.addEventListener('click', function (event) {
var button = event.target.closest('[data-relationship-target]');
if (!button) return;
var id = button.getAttribute('data-relationship-target');
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
set(id, { toggle: false });
if (Archify.view && typeof Archify.view.reveal === 'function') {
Archify.view.reveal([id], { includeNeighbors: true, reason: 'relationship' });
@@ -8968,7 +9079,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
event.preventDefault();
buttons[index].focus();
});
+ document.addEventListener('pointerdown', function () {
+ lensDragClickPointer = null;
+ }, true);
document.addEventListener('click', function (event) {
+ // Losing capture (for example when a resize hides the handle) can
+ // retarget this drag's final click to the page. It is not dismissal.
+ // A new pointerdown releases the guard; keyboard clicks remain live.
+ if (lensDragClickPointer != null && event.detail > 0 &&
+ (event.pointerId == null || event.pointerId === lensDragClickPointer)) {
+ lensDragClickPointer = null;
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
var target = event.target;
if (chip.hidden || !target || typeof target.closest !== 'function' || chip.contains(target)) return;
if (container.getAttribute('data-just-panned') === 'true') return;
@@ -9010,7 +9134,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });
}
}
- else if (!params.get('view')) clear({ updateUrl: false });
+ else clear({ updateUrl: false });
} catch (_) {}
}
@@ -9027,7 +9151,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reachabilitySnapshot: reachabilitySnapshot,
inspectRelationship: inspectRelationship,
inspectRelationshipById: inspectRelationshipById,
- reposition: requestLensPlacement,
+ reposition: placeRelationshipLens,
relationship: function () {
var record = pinnedRelationshipRecord();
return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;
@@ -9045,6 +9169,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
})();
+
/* ============================================================
Intent Trace — temporary one-hop topology before durable focus.
Fine-pointer hover and keyboard focus share the same stable-ID preview;
@@ -9082,7 +9207,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.getAttribute('data-guide-open') === 'true' ||
container.classList.contains('is-panning') ||
svg.hasAttribute('data-lens-active') ||
- svg.hasAttribute('data-story-active') ||
svg.hasAttribute('data-relationship-preview-active') ||
!!(Archify.routeProbe && typeof Archify.routeProbe.active === 'function' && Archify.routeProbe.active()) ||
!!(Archify.focus && typeof Archify.focus.active === 'function' && Archify.focus.active());
@@ -9144,7 +9268,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
clear({ announce: false });
var nodeList = nodes();
var edgeList = edges();
- var byId = {};
+ var byId = Object.create(null);
nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var selected = byId[id];
if (!selected) return false;
@@ -9153,7 +9277,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
overlay.setAttribute('class', 'intent-trace-overlay');
overlay.setAttribute('data-intent-trace-overlay', '');
overlay.setAttribute('aria-hidden', 'true');
- var related = {};
+ var related = Object.create(null);
var seen = {};
var counts = { out: 0, in: 0, loop: 0 };
related[id] = true;
@@ -9168,1836 +9292,107 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!seen[key]) {
seen[key] = true;
counts[direction] += 1;
- }
- related[from] = true;
- related[to] = true;
- edge.setAttribute('data-intent-trace-match', '');
- var wrapper = document.createElementNS(namespace, 'g');
- if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
- edgeShapes(edge).forEach(function (shape) {
- wrapper.appendChild(traceGeometry(shape, direction));
- });
- if (wrapper.childNodes.length) overlay.appendChild(wrapper);
- });
-
- nodeList.forEach(function (node) {
- var nodeId = node.getAttribute('data-node-id');
- if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
- if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
- });
- if (overlay.childNodes.length) {
- var firstEdge = edgeList[0];
- var firstNode = svg.querySelector('[data-node-id]');
- if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
- else if (firstNode) svg.insertBefore(overlay, firstNode);
- else svg.appendChild(overlay);
- }
- activeId = id;
- svg.setAttribute('data-intent-trace-active', id);
- if (options.announce === true) {
- var total = counts.out + counts.in + counts.loop;
- status.textContent = viewerText('viewer.intent.summary', {
- label: nodeLabel(selected, id),
- out: counts.out,
- in: counts.in,
- loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
- total: total
- });
- }
- return true;
- }
- function schedule(node) {
- if (enterTimer) window.clearTimeout(enterTimer);
- enterTimer = window.setTimeout(function () {
- enterTimer = null;
- if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
- }, reducedMotion() ? 0 : 90);
- }
- function sync() {
- var candidate = focusedNode || hoveredNode;
- if (!candidate) {
- clear();
- return;
- }
- show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
- }
-
- svg.addEventListener('pointerover', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || !finePointer() || event.pointerType === 'touch') return;
- if (event.relatedTarget && node.contains(event.relatedTarget)) return;
- hoveredNode = node;
- schedule(node);
- });
- svg.addEventListener('pointerout', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
- if (hoveredNode === node) hoveredNode = null;
- sync();
- });
- svg.addEventListener('focusin', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node) return;
- focusedNode = node;
- show(node.getAttribute('data-node-id'), { announce: true });
- });
- svg.addEventListener('focusout', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
- if (focusedNode === node) focusedNode = null;
- sync();
- });
- container.addEventListener('pointerdown', function (event) {
- if (!event.target.closest('[data-node-id]')) clear({ announce: false });
- });
- window.addEventListener('blur', function () { clear({ announce: false }); });
-
- return {
- show: show,
- clear: clear,
- active: function () { return activeId; }
- };
- })();
-
- Archify.guidedViews = (function () {
- var data = document.getElementById('archify-guided-views-data');
- var panel = document.getElementById('guided-views');
- var prev = document.getElementById('guided-view-prev');
- var next = document.getElementById('guided-view-next');
- var all = document.getElementById('guided-view-all');
- var play = document.getElementById('guided-view-play');
- var playIcon = document.getElementById('guided-view-play-icon');
- var playLabel = document.getElementById('guided-view-play-label');
- var beatLink = document.getElementById('guided-view-beat-link');
- var beatLinkLabel = document.getElementById('guided-view-beat-link-label');
- var progressBar = document.getElementById('guided-view-progress-bar');
- var count = document.getElementById('guided-view-count');
- var handoffReceipt = document.getElementById('guided-view-handoff');
- var label = document.getElementById('guided-view-label');
- var note = document.getElementById('guided-view-note');
- var trail = document.getElementById('guided-view-trail');
- var storyCaption = document.getElementById('guided-story-caption');
- var storyCaptionIndex = document.getElementById('guided-story-caption-index');
- var storyCaptionRoute = document.getElementById('guided-story-caption-route');
- var storyCaptionDetail = document.getElementById('guided-story-caption-detail');
- var storyCaptionNext = document.getElementById('guided-story-caption-next');
- var storyCaptionNextLabel = document.getElementById('guided-story-caption-next-label');
- var chapterIndex = document.getElementById('guided-view-index');
- var chapterList = document.getElementById('guided-view-chapters');
- var shareCue = document.getElementById('share-chapter-cue');
- var shareCueState = document.getElementById('share-chapter-state');
- var shareCueCount = document.getElementById('share-chapter-count');
- var shareCueLabel = document.getElementById('share-chapter-label');
- var shareCueNote = document.getElementById('share-chapter-note');
- var shareCueRoute = document.getElementById('share-chapter-route');
- var shareCueProgress = document.getElementById('share-chapter-progress-bar');
- var svg = document.querySelector('.diagram-container svg');
- var views = [];
- var activeIndex = -1;
- var playing = false;
- var storyBeatTimer = null;
- var storyBeatIndex = -1;
- var storyBeatStartedAt = 0;
- var storyBeatElapsedMs = 0;
- var storyBeatDwellMs = 0;
- var storyPlaybackGeneration = 0;
- var storyFollowGeneration = 0;
- var storyPlaybackScope = 'story';
- var storyPlaybackComplete = false;
- var beatLinkFeedbackTimer = null;
- var momentRestoreGeneration = 0;
- var storySteps = [];
- var storyPulseOwnerToken = 0;
- var storyPulseGeneration = 0;
- var autoplayPending = false;
- var VIEW_INTERVAL_MS = 3200;
- var STORY_FOLLOW_MIN_DWELL_MS = 1100;
- var STORY_FOLLOW_DURATION_MS = 320;
- var chapterButtons = [];
- var handoffGeneration = 0;
- var currentHandoff = null;
- var previewGeneration = 0;
- var pointerPreviewIntent = null;
- var focusPreviewIntent = null;
- var activePreviewIndex = -1;
- var previewOwnerToken = 0;
-
- try { views = JSON.parse(data.textContent || '[]'); } catch (_) { views = []; }
- if (!views.length) return { count: 0, active: function () { return null; } };
- var canonicalNodeIds = {};
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- canonicalNodeIds[node.getAttribute('data-node-id')] = true;
- });
- views.forEach(function (view) {
- var seen = {};
- view.focus = (view.focus || []).filter(function (id) {
- if (!canonicalNodeIds[id] || seen[id]) return false;
- seen[id] = true;
- return true;
- });
- });
- // Establish the compact cold state before exposing the panel so the
- // full Director cannot flash during first paint. Hash restoration runs
- // in the same task and replaces this state before paint when valid.
- panel.setAttribute('data-active-view', 'all');
- panel.hidden = false;
- panel.setAttribute('data-view-interval-ms', String(VIEW_INTERVAL_MS));
- panel.setAttribute('data-story-follow-min-dwell-ms', String(STORY_FOLLOW_MIN_DWELL_MS));
- buildChapterIndex();
-
- function reducedMotion() {
- return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
- }
-
- function findNode(id) {
- return Array.prototype.find.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- return node.getAttribute('data-node-id') === id;
- }) || null;
- }
-
- function chapterDelta(previous, destination) {
- var previousFocus = previous ? previous.focus : [];
- var destinationFocus = destination ? destination.focus : [];
- var previousIds = {};
- var destinationIds = {};
- previousFocus.forEach(function (id) { previousIds[id] = true; });
- destinationFocus.forEach(function (id) { destinationIds[id] = true; });
- return {
- stay: previousFocus.filter(function (id) { return destinationIds[id]; }),
- enter: destinationFocus.filter(function (id) { return !previousIds[id]; }),
- leave: previousFocus.filter(function (id) { return !destinationIds[id]; })
- };
- }
-
- function chapterAnchor(previous, destination, outgoingBeatIndex, delta) {
- if (!previous || !destination) return '';
- var stayIds = {};
- delta.stay.forEach(function (id) { stayIds[id] = true; });
- var activeBeat = outgoingBeatIndex >= 0 ? previous.focus[outgoingBeatIndex] : '';
- if (activeBeat && stayIds[activeBeat]) return activeBeat;
- for (var index = previous.focus.length - 1; index >= 0; index -= 1) {
- if (stayIds[previous.focus[index]]) return previous.focus[index];
- }
- return '';
- }
-
- function handoffMotionAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (document.documentElement.getAttribute('data-embed') === 'true') return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- return !(Archify.motionGovernor && Archify.motionGovernor.capable && Archify.motionGovernor.isPaused());
- }
-
- function classifyHandoff(delta, anchor) {
- var roles = {};
- delta.stay.forEach(function (id) { roles[id] = 'stay'; });
- delta.enter.forEach(function (id) { roles[id] = 'enter'; });
- delta.leave.forEach(function (id) { roles[id] = 'leave'; });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- var id = node.getAttribute('data-node-id');
- var role = roles[id] || '';
- if (role) node.setAttribute('data-chapter-role', role);
- else node.removeAttribute('data-chapter-role');
- });
- svg.setAttribute('data-chapter-handoff', anchor ? 'anchor' : 'no-anchor');
- if (anchor) svg.setAttribute('data-chapter-anchor', anchor);
- else svg.removeAttribute('data-chapter-anchor');
- }
-
- function drawHandoffAnchor(id) {
- var node = findNode(id);
- if (!node) return null;
- var box;
- try { box = node.getBBox(); } catch (_) { return null; }
- var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- var ring = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- overlay.setAttribute('class', 'chapter-handoff-overlay');
- overlay.setAttribute('data-chapter-handoff-overlay', '');
- overlay.setAttribute('aria-hidden', 'true');
- ring.setAttribute('class', 'chapter-handoff-anchor');
- ring.setAttribute('x', String(box.x - 8));
- ring.setAttribute('y', String(box.y - 8));
- ring.setAttribute('width', String(box.width + 16));
- ring.setAttribute('height', String(box.height + 16));
- ring.setAttribute('rx', '10');
- overlay.appendChild(ring);
- svg.appendChild(overlay);
- return overlay;
- }
-
- function clearHandoffPresentation() {
- svg.removeAttribute('data-chapter-handoff');
- svg.removeAttribute('data-chapter-anchor');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-handoff-overlay]'), function (overlay) { overlay.remove(); });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-role]'), function (node) { node.removeAttribute('data-chapter-role'); });
- if (handoffReceipt) {
- handoffReceipt.hidden = true;
- handoffReceipt.textContent = '';
- }
- }
-
- function completeHandoff(handoff, outcome) {
- if (!handoff || currentHandoff !== handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- currentHandoff = null;
- clearHandoffPresentation();
- if (handoff.ownerToken && Archify.motionGovernor) Archify.motionGovernor.release(handoff.ownerToken);
- handoff.resolve({ id: handoff.id, state: outcome || 'complete', anchor: handoff.anchor || null });
- syncStoryControlsDisabled();
- syncChapterPreview();
- return true;
- }
-
- function settleHandoff(reason) {
- var handoff = currentHandoff;
- if (!handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'settled', true);
- else if (Archify.view && Archify.view.reveal) Archify.view.reveal(handoff.focus, { instant: true, reason: reason || 'settled' });
- completeHandoff(handoff, reason || 'settled');
- return true;
- }
-
- function cancelHandoff(reason) {
- var handoff = currentHandoff;
- if (!handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'manual', false);
- completeHandoff(handoff, reason || 'manual');
- return true;
- }
-
- function afterHandoff(callback) {
- if (!currentHandoff) { callback(); return; }
- currentHandoff.finished.then(callback);
- }
-
- function beginHandoff(previousIndex, nextIndex, previous, destination, outgoingBeatIndex, reason) {
- if (!Archify.view || !Archify.view.reveal) return null;
- if (!previous || previousIndex === nextIndex) {
- Archify.view.reveal(destination.focus, { reason: reason });
- return null;
- }
- var delta = chapterDelta(previous, destination);
- var anchor = chapterAnchor(previous, destination, outgoingBeatIndex, delta);
- if (!handoffMotionAllowed()) {
- Archify.view.reveal(destination.focus, { instant: true, reason: reason });
- return null;
- }
- var resolver;
- var handoff = {
- id: ++handoffGeneration,
- mode: anchor ? 'holding' : 'no-anchor',
- anchor: anchor,
- focus: destination.focus.slice(),
- holdTimer: null,
- camera: null,
- ownerToken: 0,
- finished: new Promise(function (resolve) { resolver = resolve; }),
- resolve: resolver
- };
- currentHandoff = handoff;
- classifyHandoff(delta, anchor);
- if (anchor) {
- drawHandoffAnchor(anchor);
- var node = findNode(anchor);
- var nodeLabel = node ? (node.getAttribute('data-node-label') || anchor) : anchor;
- handoffReceipt.textContent = viewerText('viewer.guided.handoff', {
- from: (previousIndex + 1 < 10 ? '0' : '') + (previousIndex + 1),
- to: (nextIndex + 1 < 10 ? '0' : '') + (nextIndex + 1),
- label: nodeLabel
- });
- handoffReceipt.hidden = false;
- }
- if (Archify.motionGovernor) {
- handoff.ownerToken = Archify.motionGovernor.claim('handoff', function () {
- if (currentHandoff === handoff) settleHandoff('preempted');
- });
- }
- var startCamera = function () {
- if (currentHandoff !== handoff) return;
- handoff.holdTimer = null;
- handoff.mode = 'settling';
- svg.setAttribute('data-chapter-handoff', anchor ? 'settling' : 'no-anchor');
- handoff.camera = Archify.view.reveal(destination.focus, { reason: reason, duration: 420 });
- if (handoff.camera && handoff.camera.finished) {
- handoff.camera.finished.then(function (outcome) {
- if (currentHandoff === handoff) completeHandoff(handoff, outcome && outcome.state || 'complete');
- });
- } else {
- completeHandoff(handoff, 'complete');
- }
- };
- if (anchor) handoff.holdTimer = setTimeout(startCamera, 110);
- else startCamera();
- return handoff;
- }
-
- function centerChapterButton(button) {
- if (!button || !chapterList) return false;
- var target = Math.max(0, button.offsetLeft - (chapterList.clientWidth - button.offsetWidth) / 2);
- if (typeof chapterList.scrollTo === 'function') chapterList.scrollTo({ left: target, behavior: 'auto' });
- else chapterList.scrollLeft = target;
- return true;
- }
-
- function focusChapterButton(index) {
- if (!chapterButtons.length) return false;
- index = Math.max(0, Math.min(chapterButtons.length - 1, index));
- chapterButtons.forEach(function (button, buttonIndex) {
- button.setAttribute('tabindex', buttonIndex === index ? '0' : '-1');
- });
- chapterButtons[index].focus();
- centerChapterButton(chapterButtons[index]);
- return true;
- }
-
- function buildChapterIndex() {
- chapterButtons = [];
- chapterList.textContent = '';
- views.forEach(function (view, index) {
- var item = document.createElement('li');
- var button = document.createElement('button');
- button.type = 'button';
- button.className = 'guided-view-chapter';
- button.setAttribute('data-guided-view-id', view.id);
- button.setAttribute('aria-pressed', 'false');
- button.setAttribute('tabindex', index === 0 ? '0' : '-1');
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.open', {
- index: index + 1,
- total: views.length,
- label: view.label,
- count: view.focus.length
- }));
- button.title = view.label + ' — ' + (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }));
- var position = document.createElement('span');
- position.className = 'guided-view-chapter-index';
- position.setAttribute('aria-hidden', 'true');
- position.textContent = (index + 1 < 10 ? '0' : '') + (index + 1);
- var title = document.createElement('span');
- title.className = 'guided-view-chapter-title';
- title.textContent = view.label;
- var stops = document.createElement('em');
- stops.className = 'guided-view-chapter-count';
- stops.textContent = viewerCount('viewer.guided.chapter.stop', view.focus.length);
- var delta = document.createElement('span');
- delta.className = 'guided-view-chapter-delta';
- delta.hidden = true;
- delta.setAttribute('aria-hidden', 'true');
- ['stay', 'enter', 'leave'].forEach(function (kind) {
- var value = document.createElement('span');
- value.setAttribute('data-delta-kind', kind);
- delta.appendChild(value);
- });
- button.appendChild(position);
- button.appendChild(title);
- button.appendChild(stops);
- button.appendChild(delta);
- item.appendChild(button);
- chapterList.appendChild(item);
- chapterButtons.push(button);
- });
- }
-
- function syncChapterIndex() {
- chapterButtons.forEach(function (button, index) {
- var current = index === activeIndex;
- var stops = button.querySelector('.guided-view-chapter-count');
- var deltaLabel = button.querySelector('.guided-view-chapter-delta');
- var position = activeIndex < 0 ? 'available' : (current ? 'current' : (index < activeIndex ? 'before' : 'after'));
- button.setAttribute('data-chapter-position', position);
- button.setAttribute('aria-pressed', current ? 'true' : 'false');
- button.setAttribute('tabindex', current || (activeIndex < 0 && index === 0) ? '0' : '-1');
- if (current) {
- stops.hidden = false;
- deltaLabel.hidden = true;
- button.removeAttribute('data-chapter-delta');
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.current', {
- index: index + 1,
- total: views.length,
- label: views[index].label,
- count: views[index].focus.length
- }));
- button.title = viewerText('viewer.guided.chapter.current.title', {
- label: views[index].label,
- count: views[index].focus.length
- });
- } else {
- var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- var compact = '=' + delta.stay.length + ' +' + delta.enter.length + ' \u2212' + delta.leave.length;
- var expanded = viewerText('viewer.guided.chapter.delta.expanded', {
- stay: delta.stay.length,
- enter: delta.enter.length,
- leave: delta.leave.length
- });
- stops.hidden = true;
- deltaLabel.hidden = false;
- deltaLabel.querySelector('[data-delta-kind="stay"]').textContent = '=' + delta.stay.length;
- deltaLabel.querySelector('[data-delta-kind="enter"]').textContent = '+' + delta.enter.length;
- deltaLabel.querySelector('[data-delta-kind="leave"]').textContent = '\u2212' + delta.leave.length;
- button.setAttribute('data-chapter-delta', compact);
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.delta.aria', {
- index: index + 1,
- total: views.length,
- label: views[index].label,
- delta: expanded
- }));
- button.title = viewerText('viewer.guided.chapter.delta.title', {
- label: views[index].label,
- delta: compact
- });
- }
- if (current) button.setAttribute('aria-current', 'step');
- else button.removeAttribute('aria-current');
- if (button.parentElement) button.parentElement.setAttribute('data-chapter-position', position);
- });
- if (activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);
- }
-
- function chapterPreviewBlocked() {
- if (document.hidden || playing || currentHandoff) return true;
- if (document.documentElement.getAttribute('data-embed') === 'true') return true;
- if (window.matchMedia && window.matchMedia('print').matches) return true;
- if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return true;
- if (svg.hasAttribute('data-lens-active') || svg.hasAttribute('data-legend-preview-active')) return true;
- if (svg.hasAttribute('data-relationship-preview-active') || svg.hasAttribute('data-intent-trace-active')) return true;
- return activeIndex < 0 && svg.hasAttribute('data-focus-active');
- }
-
- function clearChapterPreviewPresentation() {
- svg.removeAttribute('data-chapter-preview');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-preview-role]'), function (node) {
- node.removeAttribute('data-chapter-preview-role');
- });
- chapterButtons.forEach(function (button) { button.removeAttribute('data-preview-active'); });
- activePreviewIndex = -1;
- if (previewOwnerToken && Archify.motionGovernor) {
- var token = previewOwnerToken;
- previewOwnerToken = 0;
- Archify.motionGovernor.release(token);
- }
- }
-
- function clearChapterPreview(options) {
- options = options || {};
- previewGeneration += 1;
- if (options.clearIntents !== false) {
- pointerPreviewIntent = null;
- focusPreviewIntent = null;
- }
- clearChapterPreviewPresentation();
- return true;
- }
-
- function winningChapterPreviewIntent() {
- return [pointerPreviewIntent, focusPreviewIntent].filter(function (intent) {
- return intent && intent.index >= 0 && intent.index < views.length && intent.index !== activeIndex;
- }).sort(function (left, right) { return right.generation - left.generation; })[0] || null;
- }
-
- function showChapterPreview(index) {
- if (index < 0 || index >= views.length || index === activeIndex || chapterPreviewBlocked()) {
- clearChapterPreviewPresentation();
- return false;
- }
- if (activePreviewIndex === index && svg.getAttribute('data-chapter-preview') === views[index].id) return true;
- clearChapterPreviewPresentation();
- var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- var roles = {};
- delta.stay.forEach(function (id) { roles[id] = 'stay'; });
- delta.enter.forEach(function (id) { roles[id] = 'enter'; });
- delta.leave.forEach(function (id) { roles[id] = 'leave'; });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- var role = roles[node.getAttribute('data-node-id')];
- if (role) node.setAttribute('data-chapter-preview-role', role);
- });
- svg.setAttribute('data-chapter-preview', views[index].id);
- chapterButtons[index].setAttribute('data-preview-active', 'true');
- activePreviewIndex = index;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) {
- previewOwnerToken = Archify.motionGovernor.claim('chapter-preview', function () {
- previewOwnerToken = 0;
- clearChapterPreviewPresentation();
- });
- }
- return true;
- }
-
- function syncChapterPreview() {
- var intent = winningChapterPreviewIntent();
- if (!intent || chapterPreviewBlocked()) {
- clearChapterPreviewPresentation();
- return false;
- }
- return showChapterPreview(intent.index);
- }
-
- function setChapterPreviewIntent(source, index) {
- var intent = { index: index, generation: ++previewGeneration };
- if (source === 'pointer') pointerPreviewIntent = intent;
- else focusPreviewIntent = intent;
- if (playing) pausePlayback();
- return syncChapterPreview();
- }
-
- function clearChapterPreviewIntent(source, index) {
- var intent = source === 'pointer' ? pointerPreviewIntent : focusPreviewIntent;
- if (intent && (typeof index !== 'number' || intent.index === index)) {
- if (source === 'pointer') pointerPreviewIntent = null;
- else focusPreviewIntent = null;
- previewGeneration += 1;
- }
- return syncChapterPreview();
- }
-
- function hoverCapable() {
- return !!(window.matchMedia && window.matchMedia('(hover: hover)').matches);
- }
-
- function sharePlaybackRequested() {
- try { return new URLSearchParams(location.search).get('play') === '1'; }
- catch (_) { return false; }
- }
-
- autoplayPending = sharePlaybackRequested();
- if (autoplayPending) {
- document.documentElement.setAttribute('data-share-playback', 'true');
- setAutoplayState('pending');
- }
-
- function setAutoplayState(state) {
- if (state) panel.setAttribute('data-autoplay', state);
- else panel.removeAttribute('data-autoplay');
- renderShareCue();
- }
-
- function shareCueStatus(state) {
- return {
- pending: viewerText('viewer.guided.state.ready'),
- playing: viewerText('viewer.guided.state.playing'),
- complete: viewerText('viewer.guided.state.settled'),
- interrupted: viewerText('viewer.guided.state.paused'),
- pinned: viewerText('viewer.guided.state.pinned'),
- 'reduced-motion': viewerText('viewer.guided.state.still')
- }[state] || viewerText('viewer.guided.state.ready');
- }
-
- function shareCueBeatCopy(state, view, stops) {
- var total = stops.length;
- var activeStop = storyBeatIndex >= 0 ? stops[storyBeatIndex] : null;
- if ((state === 'playing' || state === 'interrupted') && activeStop) {
- return viewerText('viewer.guided.share.step', {
- index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),
- total: (total < 10 ? '0' : '') + total,
- label: activeStop.textContent
- });
- }
- if (state === 'pinned' && activeStop) {
- return storyBeatCopy(storySteps[storyBeatIndex], total);
- }
- if (state === 'reduced-motion' && activeStop && hashBeatMatchesCurrent()) {
- return viewerText('viewer.guided.share.staticMoment', {
- step: viewerText('viewer.guided.share.step', {
- index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),
- total: (total < 10 ? '0' : '') + total,
- label: activeStop.textContent
- })
- });
- }
- if (state === 'complete') return viewerText('viewer.guided.share.complete', {
- count: total,
- note: view.note || viewerText('viewer.guided.share.settled')
- });
- if (state === 'reduced-motion') return viewerText('viewer.guided.share.staticPath', { count: total });
- if (state === 'pending') return viewerText('viewer.guided.share.ready', { count: total });
- return view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length });
- }
-
- function renderShareCue() {
- if (!shareCue) return;
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var shareMode = document.documentElement.getAttribute('data-share-playback') === 'true';
- var embedMode = document.documentElement.getAttribute('data-embed') === 'true';
- var pinnedMode = !shareMode && embedMode && hashBeatMatchesCurrent();
- if (pinnedMode) document.documentElement.setAttribute('data-share-moment', 'true');
- else document.documentElement.removeAttribute('data-share-moment');
- shareCue.hidden = !(embedMode && view && (shareMode || pinnedMode));
- if (shareCue.hidden) return;
- var state = pinnedMode ? 'pinned' : (panel.getAttribute('data-autoplay') || 'pending');
- var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));
- var route = stops.map(function (stop, index) {
- if (index === 0) return stop.textContent;
- var kind = stop.getAttribute('data-story-link');
- var separator = kind === 'forward' ? '\u2192' : (kind === 'reverse' ? '\u2190' : (kind === 'multiple' ? '\u21c4' : '\u00b7'));
- return separator + ' ' + stop.textContent;
- }).join(' ');
- var beatCopy = shareCueBeatCopy(state, view, stops);
- shareCue.setAttribute('data-state', state);
- shareCue.setAttribute('aria-live', state === 'playing' ? 'off' : 'polite');
- shareCueState.textContent = shareCueStatus(state);
- shareCueCount.textContent = viewerText('viewer.guided.share.chapter', {
- index: (activeIndex + 1 < 10 ? '0' : '') + (activeIndex + 1),
- total: (views.length < 10 ? '0' : '') + views.length
- });
- shareCueLabel.textContent = view.label;
- shareCueNote.textContent = beatCopy;
- shareCueRoute.textContent = route;
- shareCue.setAttribute('aria-label', viewerText('viewer.guided.share.aria', {
- state: shareCueStatus(state),
- index: activeIndex + 1,
- total: views.length,
- label: view.label,
- beat: beatCopy,
- route: route
- }));
- }
-
- function setShareCueProgress(fraction) {
- if (!shareCueProgress) return;
- shareCueProgress.style.animation = 'none';
- shareCueProgress.style.setProperty('--guided-progress-start', String(Math.max(0, Math.min(1, fraction))));
- shareCueProgress.style.transform = 'scaleX(' + Math.max(0, Math.min(1, fraction)) + ')';
- }
-
- function startShareCueProgress(fraction, duration) {
- if (!shareCueProgress) return;
- setShareCueProgress(fraction || 0);
- void shareCueProgress.offsetWidth;
- shareCueProgress.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';
- }
-
- function storyNodeLabel(node, fallback) {
- if (!node) return fallback;
- return node.getAttribute('data-node-label') ||
- (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');
- }
-
- function storyEdgeKey(edge) {
- return edge.getAttribute('data-edge-key') || (
- edge.getAttribute('data-edge-from') + '\u0000' +
- edge.getAttribute('data-edge-to') + '\u0000' +
- (edge.getAttribute('data-edge-label') || '')
- );
- }
-
- function uniqueStoryEdges(edgeList) {
- var positions = {};
- var unique = [];
- edgeList.forEach(function (edge) {
- var key = storyEdgeKey(edge);
- if (!Object.prototype.hasOwnProperty.call(positions, key)) {
- positions[key] = unique.length;
- unique.push(edge);
- return;
- }
- var index = positions[key];
- if (!storyGeometry(unique[index]).length && storyGeometry(edge).length) unique[index] = edge;
- });
- return unique;
- }
-
- function storyStep(view, index, edgeList, byId) {
- var id = view.focus[index];
- var node = byId[id];
- var previousId = index > 0 ? view.focus[index - 1] : '';
- var forward = [];
- var reverse = [];
- if (previousId) {
- edgeList.forEach(function (edge) {
- var from = edge.getAttribute('data-edge-from');
- var to = edge.getAttribute('data-edge-to');
- if (from === previousId && to === id) forward.push(edge);
- else if (from === id && to === previousId) reverse.push(edge);
- });
- }
- forward = uniqueStoryEdges(forward);
- reverse = uniqueStoryEdges(reverse);
- var edges = forward.concat(reverse).sort(function (left, right) {
- return edgeList.indexOf(left) - edgeList.indexOf(right);
- });
- var relation = index === 0 ? 'start' : (!edges.length ? 'group' : (
- edges.length === 1 && forward.length === 1 ? 'forward' :
- (edges.length === 1 && reverse.length === 1 ? 'reverse' : 'multiple')
- ));
- return {
- index: index,
- nodeId: id,
- nodeLabel: storyNodeLabel(byId[id], id),
- previousId: previousId,
- previousLabel: previousId ? storyNodeLabel(byId[previousId], previousId) : '',
- relation: relation,
- edges: edges,
- edgeKeys: edges.map(storyEdgeKey),
- edgeLabels: edges.map(function (edge) { return edge.getAttribute('data-edge-label') || ''; }).filter(function (value, edgeIndex, values) {
- return value && values.indexOf(value) === edgeIndex;
- }),
- responsibility: node ? (node.getAttribute('data-node-sublabel') || '') : '',
- context: node ? (node.getAttribute('data-node-context') || '') : ''
- };
- }
-
- function storyBeatCopy(step, total) {
- if (!step) return '';
- var position = (step.index + 1 < 10 ? '0' : '') + (step.index + 1);
- var countValue = (total < 10 ? '0' : '') + total;
- if (step.relation === 'start') return viewerText('viewer.guided.beat.start', { index: position, total: countValue, label: step.nodeLabel });
- if (step.relation === 'forward') return viewerText('viewer.guided.beat.forward', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });
- if (step.relation === 'reverse') return viewerText('viewer.guided.beat.reverse', { index: position, total: countValue, from: step.nodeLabel, to: step.previousLabel });
- if (step.relation === 'multiple') return viewerText('viewer.guided.beat.multiple', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel, count: step.edges.length });
- return viewerText('viewer.guided.beat.group', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });
- }
-
- function storyBeatAria(step, total) {
- var prefix = viewerText('viewer.guided.beat.aria.prefix', { index: step.index + 1, total: total, label: step.nodeLabel });
- if (step.relation === 'start') return prefix + viewerText('viewer.guided.beat.aria.start');
- if (step.relation === 'forward') return prefix + viewerText('viewer.guided.beat.aria.forward', { from: step.previousLabel });
- if (step.relation === 'reverse') return prefix + viewerText('viewer.guided.beat.aria.reverse', { from: step.previousLabel, to: step.nodeLabel });
- if (step.relation === 'multiple') return prefix + viewerText('viewer.guided.beat.aria.multiple', { from: step.previousLabel, count: step.edges.length });
- return prefix + viewerText('viewer.guided.beat.aria.group', { from: step.previousLabel });
- }
-
- function storyCaptionRouteCopy(step) {
- if (step.relation === 'start') return step.nodeLabel + ' · ' + viewerText('viewer.guided.caption.start');
- if (step.relation === 'reverse') return step.previousLabel + ' ← ' + step.nodeLabel;
- if (step.relation === 'multiple') return step.previousLabel + ' ⇄ ' + step.nodeLabel;
- if (step.relation === 'group') return step.previousLabel + ' · ' + step.nodeLabel;
- return step.previousLabel + ' → ' + step.nodeLabel;
- }
-
- function storyCaptionDetailCopy(step) {
- var facts = [];
- if (step.relation === 'group') facts.push(viewerText('viewer.guided.caption.grouped'));
- else if (step.edgeLabels.length) facts.push(step.edgeLabels.slice(0, 3).join(' + ') + (step.edgeLabels.length > 3 ? viewerText('viewer.guided.caption.more', { count: step.edgeLabels.length - 3 }) : ''));
- else if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.reverse'));
- else if (step.relation === 'multiple') facts.push(viewerText('viewer.guided.caption.relationships', { count: step.edges.length }));
- else if (step.relation !== 'start') facts.push(viewerText('viewer.guided.caption.relationship'));
- if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.direction', { from: step.nodeLabel, to: step.previousLabel }));
- if (step.responsibility) facts.push(step.responsibility);
- if (step.context) facts.push(step.context);
- if (!facts.length) facts.push(viewerText('viewer.guided.caption.starting'));
- return facts.join(' · ');
- }
-
- function renderStoryCaption(step, total, nextStep) {
- if (!storyCaption) return;
- if (!step) {
- storyCaption.hidden = true;
- storyCaption.removeAttribute('data-story-caption');
- storyCaptionNext.hidden = true;
- storyCaptionNextLabel.textContent = '';
- return;
- }
- storyCaption.hidden = false;
- storyCaption.setAttribute('data-story-caption', step.relation);
- storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');
- storyCaptionIndex.textContent = (step.index + 1 < 10 ? '0' : '') + (step.index + 1) + ' / ' + (total < 10 ? '0' : '') + total;
- storyCaptionRoute.textContent = storyCaptionRouteCopy(step);
- storyCaptionDetail.textContent = storyCaptionDetailCopy(step);
- storyCaptionNext.hidden = !nextStep;
- storyCaptionNextLabel.textContent = nextStep
- ? ((nextStep.index + 1 < 10 ? '0' : '') + (nextStep.index + 1) + ' · ' + nextStep.nodeLabel)
- : '';
- storyCaption.style.animation = 'none';
- void storyCaption.offsetWidth;
- storyCaption.style.removeProperty('animation');
- }
-
- function storyMomentLink() {
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- if (!view || !step) return '';
- var url = new URL(location.href);
- url.searchParams.delete('play');
- url.hash = 'view=' + encodeURIComponent(view.id) + '&beat=' + encodeURIComponent(step.nodeId);
- return url.href;
- }
-
- function fallbackCopyStoryMoment(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
- function resetBeatLinkFeedback() {
- if (beatLinkFeedbackTimer) clearTimeout(beatLinkFeedbackTimer);
- beatLinkFeedbackTimer = null;
- beatLink.removeAttribute('data-copy-state');
- beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');
- }
-
- function syncBeatLink() {
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- var available = !!(activeIndex >= 0 && step && !currentHandoff);
- beatLink.disabled = !available;
- if (!beatLink.hasAttribute('data-copy-state')) beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');
- var description = available
- ? viewerText('viewer.guided.beatLink', { index: step.index + 1, total: storySteps.length, label: step.nodeLabel })
- : viewerText('viewer.guided.selectBeatLink');
- beatLink.setAttribute('aria-label', description);
- beatLink.title = description;
- }
-
- function setBeatLinkFeedback(copied) {
- resetBeatLinkFeedback();
- beatLink.setAttribute('data-copy-state', copied ? 'copied' : 'failed');
- beatLinkLabel.textContent = viewerText(copied ? 'viewer.guided.copied' : 'viewer.guided.copyFailed');
- beatLink.setAttribute('aria-label', viewerText(copied ? 'viewer.guided.momentCopied' : 'viewer.guided.momentCopyFailed'));
- beatLinkFeedbackTimer = setTimeout(function () {
- resetBeatLinkFeedback();
- syncBeatLink();
- }, 1600);
- }
-
- function copyStoryMomentLink() {
- if (playing) pausePlayback();
- var value = storyMomentLink();
- if (!value) return Promise.resolve(false);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopyStoryMoment(value); })
- : Promise.resolve(fallbackCopyStoryMoment(value));
- return copy.then(function (copied) {
- setBeatLinkFeedback(copied);
- return copied;
- });
- }
-
- function hashBeatMatchesCurrent() {
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- if (!view || !step) return false;
- try {
- var params = new URLSearchParams(location.hash.replace(/^#/, ''));
- return params.get('view') === view.id && params.get('beat') === step.nodeId;
- } catch (_) { return false; }
- }
-
- function storyMotionAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (document.documentElement.getAttribute('data-motion') !== 'live') return false;
- if (document.documentElement.getAttribute('data-embed') === 'true' &&
- document.documentElement.getAttribute('data-share-playback') !== 'true') return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- return !(Archify.motionGovernor && Archify.motionGovernor.isPaused());
- }
-
- function storyAutomaticPlaybackAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) return !Archify.motionGovernor.isPaused();
- return true;
- }
-
- function clearStoryPulse(options) {
- options = options || {};
- storyPulseGeneration += 1;
- Array.prototype.forEach.call(svg.querySelectorAll('.story-trail-flow[data-story-pulse]'), function (flow) {
- flow.removeAttribute('data-story-pulse');
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-carrier-overlay]'), function (overlay) {
- overlay.remove();
- });
- if (storyPulseOwnerToken && options.release !== false && Archify.motionGovernor) {
- var token = storyPulseOwnerToken;
- storyPulseOwnerToken = 0;
- Archify.motionGovernor.release(token);
- } else if (options.release === false) storyPulseOwnerToken = 0;
- }
-
- function pulseStoryStep(step) {
- clearStoryPulse();
- if (!step || (step.relation !== 'forward' && step.relation !== 'reverse') || step.edges.length !== 1 || !storyMotionAllowed()) return false;
- var flows = Array.prototype.slice.call(svg.querySelectorAll('.story-trail-flow[data-story-beat-step="' + step.index + '"]'));
- if (!flows.length) return false;
- var pulseGeneration = storyPulseGeneration;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) {
- storyPulseOwnerToken = Archify.motionGovernor.claim('story', function () {
- clearStoryPulse({ release: false });
- });
- }
- flows.forEach(function (flow) { flow.setAttribute('data-story-pulse', 'true'); });
- if (Archify.flowTokens && typeof Archify.flowTokens.create === 'function') {
- var edge = step.edges[0];
- var shapes = storyGeometry(edge);
- var carrier = shapes.length ? Archify.flowTokens.create(edge, shapes[0], {
- className: 'story-flow-token',
- duration: '0.78s'
- }) : null;
- if (carrier) {
- var carrierOverlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- var carrierWrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- carrierOverlay.setAttribute('class', 'story-carrier-overlay');
- carrierOverlay.setAttribute('data-story-carrier-overlay', '');
- carrierOverlay.setAttribute('aria-hidden', 'true');
- if (edge.hasAttribute('transform')) carrierWrapper.setAttribute('transform', edge.getAttribute('transform'));
- carrier.setAttribute('data-story-carrier-token', '');
- carrier.setAttribute('data-story-beat-step', String(step.index));
- carrierWrapper.appendChild(carrier);
- carrierOverlay.appendChild(carrierWrapper);
- var firstNode = svg.querySelector('[data-node-id]');
- while (firstNode && firstNode.parentNode !== svg) firstNode = firstNode.parentNode;
- if (firstNode) svg.insertBefore(carrierOverlay, firstNode);
- else svg.appendChild(carrierOverlay);
- }
- }
- void flows[0].getBoundingClientRect();
- flows[0].addEventListener('animationend', function () {
- if (pulseGeneration === storyPulseGeneration) clearStoryPulse();
- }, { once: true });
- return true;
- }
-
- function stopStoryBeatTimer(options) {
- options = options || {};
- storyPlaybackGeneration += 1;
- if (storyBeatTimer && options.preserveElapsed === true && storyBeatStartedAt) {
- storyBeatElapsedMs = Math.min(storyBeatDwellMs, storyBeatElapsedMs + Math.max(0, Date.now() - storyBeatStartedAt));
- }
- if (storyBeatTimer) clearTimeout(storyBeatTimer);
- storyBeatTimer = null;
- storyBeatStartedAt = 0;
- }
-
- function centerStoryStop(stop) {
- if (!stop || !trail) return false;
- var bounds = stop.getBoundingClientRect();
- var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;
- var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);
- trail.scrollLeft = target;
- return true;
- }
-
- function storyBeatDwell(total) {
- return Math.max(STORY_FOLLOW_MIN_DWELL_MS, VIEW_INTERVAL_MS / Math.max(1, total));
- }
-
- function clearStoryFollow() {
- storyFollowGeneration += 1;
- svg.removeAttribute('data-story-follow');
- panel.removeAttribute('data-story-follow');
- panel.removeAttribute('data-story-follow-node');
- }
-
- function storyFrameIds(step) {
- if (!step) return [];
- var ids = [];
- if (step.index > 0 && storySteps[step.index - 1]) ids.push(storySteps[step.index - 1].nodeId);
- ids.push(step.nodeId);
- if (step.index + 1 < storySteps.length) ids.push(storySteps[step.index + 1].nodeId);
- return ids;
- }
-
- function followStoryStep(step, options) {
- options = options || {};
- if (!step || document.hidden) return false;
- if (!Archify.view || typeof Archify.view.reveal !== 'function') {
- var deferredIndex = step.index;
- var deferredGeneration = ++storyFollowGeneration;
- requestAnimationFrame(function () {
- if (deferredGeneration !== storyFollowGeneration || storyBeatIndex !== deferredIndex) return;
- if (Archify.view && typeof Archify.view.reveal === 'function') followStoryStep(step, options);
- });
- return true;
- }
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- var embed = document.documentElement.getAttribute('data-embed') === 'true';
- var explicitEmbedPlayback = document.documentElement.getAttribute('data-share-playback') === 'true';
- if (embed && !explicitEmbedPlayback && options.linked !== true) return false;
- var ids = storyFrameIds(step);
- var generation = ++storyFollowGeneration;
- svg.setAttribute('data-story-follow', step.nodeId);
- panel.setAttribute('data-story-follow', 'moving');
- panel.setAttribute('data-story-follow-node', step.nodeId);
- var receipt = Archify.view.reveal(ids, {
- reason: options.manual === true ? 'story-beat' : 'story-follow',
- padding: 64,
- maxScale: 1.65,
- duration: STORY_FOLLOW_DURATION_MS,
- instant: options.instant === true || reducedMotion() || document.documentElement.getAttribute('data-motion') !== 'live'
- });
- if (receipt && receipt.finished && typeof receipt.finished.then === 'function') {
- receipt.finished.then(function (result) {
- if (generation !== storyFollowGeneration || storyBeatIndex !== step.index) return;
- svg.removeAttribute('data-story-follow');
- panel.setAttribute('data-story-follow', result && result.state === 'complete' ? 'settled' : 'interrupted');
- });
- } else if (generation === storyFollowGeneration) {
- panel.setAttribute('data-story-follow', 'settled');
- }
- return receipt;
- }
-
- function setStoryBeat(index, options) {
- options = options || {};
- var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));
- if (!stops.length) return false;
- resetBeatLinkFeedback();
- storyBeatIndex = Math.max(0, Math.min(stops.length - 1, index));
- var nextStep = storyBeatIndex + 1 < storySteps.length ? storySteps[storyBeatIndex + 1] : null;
- svg.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);
- panel.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);
- if (nextStep) {
- svg.setAttribute('data-story-next', nextStep.nodeId);
- panel.setAttribute('data-story-next', nextStep.nodeId);
- } else {
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-next');
- }
- function storyBeatState(step) {
- if (step < storyBeatIndex) return 'past';
- if (step === storyBeatIndex) return 'active';
- if (step === storyBeatIndex + 1) return 'next';
- return 'pending';
- }
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step]'), function (node) {
- var step = Number(node.getAttribute('data-story-step'));
- node.setAttribute('data-story-beat-state', storyBeatState(step));
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-step]'), function (edge) {
- var step = Number(edge.getAttribute('data-story-beat-step'));
- edge.setAttribute('data-story-beat-state', storyBeatState(step));
- });
- stops.forEach(function (stop, step) {
- stop.setAttribute('data-story-beat-state', storyBeatState(step));
- if (step === storyBeatIndex) stop.setAttribute('aria-current', 'step');
- else stop.removeAttribute('aria-current');
- });
- note.setAttribute('aria-live', 'off');
- note.textContent = storyBeatCopy(storySteps[storyBeatIndex], stops.length);
- renderStoryCaption(storySteps[storyBeatIndex], stops.length, nextStep);
- if (options.center === true) centerStoryStop(stops[storyBeatIndex]);
- if (options.pulse === true) pulseStoryStep(storySteps[storyBeatIndex]);
- else clearStoryPulse();
- if (options.follow === true) followStoryStep(storySteps[storyBeatIndex], {
- manual: options.manual === true,
- linked: options.linked === true,
- instant: options.followInstant === true
- });
- renderShareCue();
- syncBeatLink();
- return true;
- }
-
- function settleStoryBeats() {
- stopStoryBeatTimer();
- clearStoryPulse();
- clearStoryFollow();
- resetBeatLinkFeedback();
- storyBeatIndex = -1;
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = 0;
- svg.removeAttribute('data-story-beat');
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-beat');
- panel.removeAttribute('data-story-next');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-state]'), function (el) {
- el.removeAttribute('data-story-beat-state');
- });
- Array.prototype.forEach.call(trail.querySelectorAll('[data-story-beat-state]'), function (stop) {
- stop.removeAttribute('data-story-beat-state');
- stop.removeAttribute('aria-current');
- });
- note.setAttribute('aria-live', 'polite');
- if (activeIndex >= 0) note.textContent = views[activeIndex].note || viewerText('viewer.guided.chapter.selectedNodes', { count: views[activeIndex].focus.length });
- renderStoryCaption(null, 0);
- renderShareCue();
- syncBeatLink();
- }
-
- function clearStoryTrail() {
- stopStoryBeatTimer();
- clearStoryPulse();
- clearStoryFollow();
- resetBeatLinkFeedback();
- storyBeatIndex = -1;
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = 0;
- storySteps = [];
- svg.removeAttribute('data-story-active');
- svg.removeAttribute('data-story-playing');
- svg.removeAttribute('data-story-beat');
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-beat');
- panel.removeAttribute('data-story-next');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-overlay]'), function (overlay) {
- overlay.remove();
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step], [data-story-beat-state]'), function (node) {
- node.removeAttribute('data-story-step');
- node.removeAttribute('data-story-beat-state');
- node.style.removeProperty('--story-step');
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-story-beat-step]'), function (edge) {
- edge.removeAttribute('data-story-beat-step');
- edge.removeAttribute('data-story-beat-state');
- });
- trail.textContent = '';
- trail.hidden = true;
- trail.removeAttribute('aria-label');
- renderStoryCaption(null, 0);
- syncBeatLink();
- }
-
- function storyGeometry(edge) {
- if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];
- return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));
- }
-
- function renderStoryTrail(view) {
- if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
- clearStoryTrail();
- if (!view) return;
-
- var nodeList = Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));
- var edgeList = Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));
- var byId = {};
- nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
- storySteps = view.focus.map(function (_, index) { return storyStep(view, index, edgeList, byId); });
- var labels = [];
- storySteps.forEach(function (step, index) {
- var id = step.nodeId;
- var node = byId[id];
- if (!node) return;
- node.setAttribute('data-story-step', String(index));
- node.style.setProperty('--story-step', String(index));
- var nodeLabel = step.nodeLabel;
- labels.push(nodeLabel);
- var stop = document.createElement('button');
- stop.type = 'button';
- stop.className = 'guided-view-stop';
- stop.setAttribute('data-story-node', id);
- stop.setAttribute('data-story-index', String(index));
- stop.setAttribute('data-story-relation', step.relation);
- stop.setAttribute('data-story-number', (index + 1 < 10 ? '0' : '') + (index + 1));
- if (index > 0) stop.setAttribute('data-story-link', step.relation);
- stop.style.setProperty('--story-step', String(index));
- stop.setAttribute('aria-label', storyBeatAria(step, storySteps.length));
- stop.title = storyBeatCopy(step, storySteps.length);
- stop.textContent = nodeLabel;
- trail.appendChild(stop);
- });
- trail.hidden = labels.length === 0;
- trail.setAttribute('aria-label', viewerText('viewer.guided.storyTrail', { label: view.label, count: labels.length }));
- trail.scrollLeft = 0;
- svg.setAttribute('data-story-active', view.id);
-
- var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- overlay.setAttribute('class', 'story-trail-overlay');
- overlay.setAttribute('data-story-overlay', '');
- overlay.setAttribute('aria-hidden', 'true');
- var copied = 0;
- storySteps.forEach(function (step) {
- step.edges.forEach(function (edge) {
- var edgeBeat = step.index;
- edge.setAttribute('data-story-beat-step', String(edgeBeat));
- var wrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
- storyGeometry(edge).forEach(function (shape) {
- var clone = shape.cloneNode(false);
- clone.removeAttribute('id');
- clone.removeAttribute('marker-start');
- clone.removeAttribute('marker-mid');
- clone.removeAttribute('marker-end');
- clone.removeAttribute('aria-label');
- clone.removeAttribute('role');
- clone.removeAttribute('data-animate');
- clone.removeAttribute('data-edge-from');
- clone.removeAttribute('data-edge-to');
- clone.removeAttribute('data-edge-key');
- clone.removeAttribute('data-edge-id');
- clone.removeAttribute('data-edge-label');
- clone.setAttribute('class', 'story-trail-flow');
- clone.setAttribute('data-story-beat-step', String(edgeBeat));
- clone.style.setProperty('--story-step', String(edgeBeat));
- wrapper.appendChild(clone);
- copied += 1;
- });
- if (wrapper.childNodes.length) overlay.appendChild(wrapper);
+ }
+ related[from] = true;
+ related[to] = true;
+ edge.setAttribute('data-intent-trace-match', '');
+ var wrapper = document.createElementNS(namespace, 'g');
+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
+ edgeShapes(edge).forEach(function (shape) {
+ wrapper.appendChild(traceGeometry(shape, direction));
});
+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);
+ });
+
+ nodeList.forEach(function (node) {
+ var nodeId = node.getAttribute('data-node-id');
+ if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
+ if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
});
- if (copied) {
+ if (overlay.childNodes.length) {
var firstEdge = edgeList[0];
+ var firstNode = svg.querySelector('[data-node-id]');
if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
- else svg.insertBefore(overlay, svg.firstChild);
- }
- }
-
- function syncStoryPlayback() {
- var shouldPlay = playing && activeIndex >= 0;
- if (shouldPlay && svg.getAttribute('data-story-playing') !== 'true') svg.setAttribute('data-story-playing', 'true');
- else if (!shouldPlay && svg.hasAttribute('data-story-playing')) svg.removeAttribute('data-story-playing');
- }
-
- function resetProgress(fraction) {
- fraction = Math.max(0, Math.min(1, Number(fraction) || 0));
- progressBar.style.animation = 'none';
- progressBar.style.setProperty('--guided-progress-start', String(fraction));
- progressBar.style.transform = 'scaleX(' + fraction + ')';
- }
-
- function startProgress(fraction, duration) {
- resetProgress(fraction);
- void progressBar.offsetWidth;
- progressBar.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';
- }
-
- function currentStoryProgress() {
- var total = storySteps.length;
- if (!total || storyBeatIndex < 0) return 0;
- var elapsed = storyBeatElapsedMs;
- if (playing && storyBeatTimer && storyBeatStartedAt) elapsed += Math.max(0, Date.now() - storyBeatStartedAt);
- var dwell = storyBeatDwellMs || storyBeatDwell(total);
- return Math.max(0, Math.min(1, (storyBeatIndex + Math.min(1, elapsed / dwell)) / total));
- }
-
- function renderPlayback() {
- var automaticPlaybackAllowed = storyAutomaticPlaybackAllowed();
- panel.setAttribute('data-playing', playing ? 'true' : 'false');
- syncStoryPlayback();
- play.disabled = !playing && !automaticPlaybackAllowed;
- play.setAttribute('aria-pressed', playing ? 'true' : 'false');
- play.setAttribute('aria-label', viewerText(playing
- ? 'viewer.guided.pause'
- : !automaticPlaybackAllowed
- ? 'viewer.guided.motionUnavailable'
- : storyPlaybackComplete
- ? 'viewer.guided.replay'
- : 'viewer.guided.play'));
- play.title = viewerText(playing
- ? 'viewer.guided.pause.title'
- : !automaticPlaybackAllowed
- ? 'viewer.guided.enableMotion'
- : storyPlaybackComplete
- ? 'viewer.guided.replay.title'
- : 'viewer.guided.play.title');
- playIcon.textContent = playing ? '\u2016' : '\u25b6';
- playLabel.textContent = viewerText(playing
- ? 'viewer.guided.pauseStory'
- : storyPlaybackComplete
- ? 'viewer.guided.replayStory'
- : 'viewer.guided.playStory');
- if (storyCaption && !storyCaption.hidden) storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');
- }
-
- function render() {
- var view = views[activeIndex];
- count.textContent = activeIndex < 0 ? '0 / ' + views.length : (activeIndex + 1) + ' / ' + views.length;
- label.textContent = view ? view.label : viewerText('viewer.guided.explore');
- note.setAttribute('aria-live', storyBeatIndex >= 0 ? 'off' : 'polite');
- note.textContent = storyBeatIndex >= 0
- ? storyBeatCopy(storySteps[storyBeatIndex], storySteps.length)
- : (view
- ? (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }))
- : viewerText('viewer.guided.intro'));
- prev.disabled = activeIndex < 0;
- next.disabled = activeIndex >= views.length - 1;
- all.disabled = activeIndex < 0;
- panel.setAttribute('data-active-view', view ? view.id : 'all');
- syncChapterIndex();
- renderShareCue();
- renderPlayback();
- syncBeatLink();
- }
-
- function pausePlayback(options) {
- options = options || {};
- var progress = options.complete === true ? 1 : currentStoryProgress();
- if (panel.getAttribute('data-autoplay') === 'playing') {
- setShareCueProgress(progress);
- setAutoplayState(options.complete === true ? 'complete' : 'interrupted');
- }
- stopStoryBeatTimer({ preserveElapsed: options.complete !== true });
- clearStoryPulse();
- clearStoryFollow();
- playing = false;
- storyPlaybackComplete = options.complete === true;
- resetProgress(progress);
- renderPlayback();
- renderShareCue();
- }
-
- function finishStoryChapter() {
- if (!playing) return false;
- if (storyPlaybackScope === 'chapter') {
- pausePlayback({ complete: true });
- return true;
+ else if (firstNode) svg.insertBefore(overlay, firstNode);
+ else svg.appendChild(overlay);
}
- if (activeIndex < views.length - 1) {
- var destinationIndex = activeIndex + 1;
- activate(destinationIndex, { playback: true });
- afterHandoff(function () {
- if (!playing || activeIndex !== destinationIndex) return;
- storyBeatElapsedMs = 0;
- setStoryBeat(0, { pulse: true, follow: true });
- scheduleStoryPlayback();
+ activeId = id;
+ svg.setAttribute('data-intent-trace-active', id);
+ if (options.announce === true) {
+ var total = counts.out + counts.in + counts.loop;
+ status.textContent = viewerText('viewer.intent.summary', {
+ label: nodeLabel(selected, id),
+ out: counts.out,
+ in: counts.in,
+ loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
+ total: total
});
- return true;
- }
- pausePlayback({ complete: true });
- return true;
- }
-
- function scheduleStoryPlayback() {
- var total = storySteps.length;
- if (!playing || !total || reducedMotion()) {
- if (playing) pausePlayback();
- return false;
- }
- storyBeatDwellMs = storyBeatDwell(total);
- if (storyBeatIndex < 0) {
- storyBeatElapsedMs = 0;
- setStoryBeat(0, { pulse: true, follow: true });
- }
- storyBeatElapsedMs = Math.max(0, Math.min(storyBeatDwellMs, storyBeatElapsedMs));
- var remainingDwell = Math.max(1, storyBeatDwellMs - storyBeatElapsedMs);
- var progress = (storyBeatIndex + storyBeatElapsedMs / storyBeatDwellMs) / total;
- var remainingChapter = remainingDwell + Math.max(0, total - storyBeatIndex - 1) * storyBeatDwellMs;
- startProgress(progress, remainingChapter);
- if (panel.getAttribute('data-autoplay') === 'playing') startShareCueProgress(progress, remainingChapter);
- var generation = ++storyPlaybackGeneration;
- storyBeatStartedAt = Date.now();
- storyBeatTimer = setTimeout(function () {
- if (!playing || generation !== storyPlaybackGeneration) return;
- storyBeatTimer = null;
- storyBeatStartedAt = 0;
- storyBeatElapsedMs = 0;
- if (storyBeatIndex < total - 1) {
- setStoryBeat(storyBeatIndex + 1, { pulse: true, follow: true });
- scheduleStoryPlayback();
- } else finishStoryChapter();
- }, remainingDwell);
- return true;
- }
-
- function startPlayback() {
- if (!storyAutomaticPlaybackAllowed()) {
- renderPlayback();
- return false;
- }
- autoplayPending = false;
- setAutoplayState(null);
- setShareCueProgress(0);
- document.documentElement.removeAttribute('data-share-playback');
- storyPlaybackScope = 'story';
- if (storyPlaybackComplete) showAll({ updateUrl: false });
- storyPlaybackComplete = false;
- if (activeIndex < 0) activate(0, { playback: true });
- playing = true;
- renderPlayback();
- afterHandoff(function () {
- if (!playing) return;
- if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);
- scheduleStoryPlayback();
- });
- return true;
- }
-
- function startCurrentViewPlayback() {
- if (document.hidden) return false;
- autoplayPending = false;
- document.documentElement.setAttribute('data-share-playback', 'true');
- storyPlaybackScope = 'chapter';
- storyPlaybackComplete = false;
- if (activeIndex < 0) activate(0, { playback: true, updateUrl: false });
- if (!storyAutomaticPlaybackAllowed()) {
- var preserveMoment = hashBeatMatchesCurrent();
- setShareCueProgress(preserveMoment && storySteps.length ? (storyBeatIndex + 1) / storySteps.length : 1);
- setAutoplayState('reduced-motion');
- playing = false;
- if (preserveMoment) {
- clearStoryPulse();
- renderShareCue();
- } else settleStoryBeats();
- renderPlayback();
- return false;
}
- playing = true;
- setAutoplayState('playing');
- renderPlayback();
- afterHandoff(function () {
- if (!playing) return;
- if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);
- scheduleStoryPlayback();
- });
- return true;
- }
-
- function maybeStartSharePlayback() {
- if (!autoplayPending || document.hidden) return false;
- return startCurrentViewPlayback();
- }
-
- function togglePlayback() {
- return playing ? (pausePlayback(), false) : startPlayback();
- }
-
- function syncStoryControlsDisabled() {
- Array.prototype.forEach.call(trail.querySelectorAll('[data-story-node]'), function (stop) {
- stop.disabled = !!currentHandoff;
- });
- syncBeatLink();
- }
-
- function selectStoryBeat(index) {
- if (currentHandoff || activeIndex < 0 || index < 0 || index >= storySteps.length) return false;
- momentRestoreGeneration += 1;
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else {
- stopStoryBeatTimer();
- clearStoryPulse();
- }
- storyPlaybackComplete = false;
- storyPlaybackScope = 'story';
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = storyBeatDwell(storySteps.length);
- var view = views[activeIndex];
- Archify.focus.setMany(view.focus, {
- toggle: false,
- updateUrl: false,
- mode: 'selection',
- label: view.label,
- hideChip: true
- });
- setStoryBeat(index, { manual: true, center: true, pulse: true, follow: true });
- resetProgress(index / storySteps.length);
- renderPlayback();
- return true;
- }
-
- function selectStoryBeatById(id, options) {
- options = options || {};
- var index = storySteps.findIndex(function (step) { return step.nodeId === id; });
- if (index < 0) return false;
- if (playing) pausePlayback();
- else {
- stopStoryBeatTimer();
- clearStoryPulse();
- }
- storyPlaybackComplete = false;
- storyPlaybackScope = 'story';
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = storyBeatDwell(storySteps.length);
- setStoryBeat(index, {
- manual: false,
- center: true,
- pulse: false,
- follow: options.follow === true,
- linked: options.linked === true,
- followInstant: options.followInstant === true
- });
- resetProgress(index / storySteps.length);
- renderPlayback();
return true;
}
-
- function updateUrl(view) {
- try {
- history.replaceState(null, '', location.pathname + location.search + (view ? '#view=' + encodeURIComponent(view.id) : ''));
- } catch (_) {}
+ function schedule(node) {
+ if (enterTimer) window.clearTimeout(enterTimer);
+ enterTimer = window.setTimeout(function () {
+ enterTimer = null;
+ if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
+ }, reducedMotion() ? 0 : 90);
}
-
- function showAll(options) {
- options = options || {};
- if (options.restore !== true) momentRestoreGeneration += 1;
- clearChapterPreview({ clearIntents: true });
- if (playing && options.playback !== true) pausePlayback();
- if (options.playback !== true) storyPlaybackComplete = false;
- cancelHandoff('overview');
- activeIndex = -1;
- renderStoryTrail(null);
- if (options.clearFocus !== false) Archify.focus.clear({ updateUrl: false });
- if (options.resetView !== false && Archify.view && typeof Archify.view.reset === 'function') {
- Archify.view.reset({ automatic: true });
+ function sync() {
+ var candidate = focusedNode || hoveredNode;
+ if (!candidate) {
+ clear();
+ return;
}
- render();
- if (options.updateUrl !== false) updateUrl(null);
- }
-
- function activate(index, options) {
- options = options || {};
- if (options.restore !== true) momentRestoreGeneration += 1;
- if (playing && options.playback !== true) pausePlayback();
- if (options.playback !== true) storyPlaybackComplete = false;
- if (index < 0) { showAll(options); return true; }
- if (index >= views.length) return false;
- clearChapterPreview({ clearIntents: true });
- var previousIndex = activeIndex;
- var previous = previousIndex >= 0 ? views[previousIndex] : null;
- var outgoingBeatIndex = storyBeatIndex;
- cancelHandoff('replaced');
- activeIndex = index;
- var view = views[index];
- Archify.focus.setMany(view.focus, {
- toggle: false,
- updateUrl: false,
- mode: 'selection',
- label: view.label,
- hideChip: true
- });
- renderStoryTrail(view);
- beginHandoff(previousIndex, index, previous, view, outgoingBeatIndex, options.playback === true ? 'playback' : 'guided');
- syncStoryControlsDisabled();
- render();
- if (options.updateUrl !== false) updateUrl(view);
- return true;
- }
-
- function activateById(id, options) {
- var index = views.findIndex(function (view) { return view.id === id; });
- return index >= 0 && activate(index, options);
+ show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
}
- prev.addEventListener('click', function () { activate(activeIndex - 1); });
- next.addEventListener('click', function () { activate(activeIndex + 1); });
- all.addEventListener('click', function () { showAll(); });
- play.addEventListener('click', togglePlayback);
- beatLink.addEventListener('click', copyStoryMomentLink);
- trail.addEventListener('focusin', function (event) {
- if (!event.target.closest('[data-story-node]')) return;
- if (playing) pausePlayback();
- });
- trail.addEventListener('click', function (event) {
- var stop = event.target.closest('[data-story-node]');
- if (!stop || stop.disabled) return;
- selectStoryBeat(Number(stop.getAttribute('data-story-index')));
- });
- trail.addEventListener('keydown', function (event) {
- if (event.key !== 'Enter' && event.key !== ' ') return;
- var stop = event.target.closest('[data-story-node]');
- if (!stop || stop.disabled) return;
- event.preventDefault();
- selectStoryBeat(Number(stop.getAttribute('data-story-index')));
- });
- chapterList.addEventListener('click', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button) return;
- activateById(button.getAttribute('data-guided-view-id'));
- });
- chapterList.addEventListener('pointerover', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || !hoverCapable() || event.pointerType === 'touch') return;
- if (event.relatedTarget && button.contains(event.relatedTarget)) return;
- setChapterPreviewIntent('pointer', chapterButtons.indexOf(button));
- });
- chapterList.addEventListener('pointerout', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
- clearChapterPreviewIntent('pointer', chapterButtons.indexOf(button));
- });
- chapterIndex.addEventListener('focusin', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button) return;
- setChapterPreviewIntent('focus', chapterButtons.indexOf(button));
+ svg.addEventListener('pointerover', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || !finePointer() || event.pointerType === 'touch') return;
+ if (event.relatedTarget && node.contains(event.relatedTarget)) return;
+ hoveredNode = node;
+ schedule(node);
});
- chapterIndex.addEventListener('focusout', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
- clearChapterPreviewIntent('focus', chapterButtons.indexOf(button));
+ svg.addEventListener('pointerout', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
+ if (hoveredNode === node) hoveredNode = null;
+ sync();
});
- chapterList.addEventListener('keydown', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- var index = chapterButtons.indexOf(button);
- if (index < 0) return;
- var target = null;
- if (event.key === 'ArrowRight') target = Math.min(chapterButtons.length - 1, index + 1);
- else if (event.key === 'ArrowLeft') target = Math.max(0, index - 1);
- else if (event.key === 'Home') target = 0;
- else if (event.key === 'End') target = chapterButtons.length - 1;
- if (target === null) return;
- event.preventDefault();
- focusChapterButton(target);
+ svg.addEventListener('focusin', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node) return;
+ focusedNode = node;
+ show(node.getAttribute('data-node-id'), { announce: true });
});
-
- // A direct node exploration supersedes the curated view. Capture phase
- // releases the view before the focus explorer writes its own deep link.
- function releaseForNode(event) {
- if (activeIndex >= 0 && event.target.closest('[data-node-id]')) {
- pausePlayback();
- showAll({ clearFocus: false, updateUrl: false });
- }
- }
- svg.addEventListener('click', releaseForNode, true);
- svg.addEventListener('keydown', function (event) {
- if (event.key === 'Enter' || event.key === ' ') releaseForNode(event);
- }, true);
-
- document.addEventListener('keydown', function (event) {
- if (event.metaKey || event.ctrlKey || event.altKey) return;
- if (document.documentElement.getAttribute('data-guide-open') === 'true') return;
- var target = event.target;
- if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return;
- if (event.key === ']') {
- event.preventDefault();
- if (activeIndex < views.length - 1) activate(activeIndex + 1);
- } else if (event.key === '[') {
- event.preventDefault();
- if (activeIndex >= 0) activate(activeIndex - 1);
- } else if (event.key.toLowerCase() === 'p') {
- event.preventDefault();
- togglePlayback();
- } else if (event.key === 'Escape' && activePreviewIndex >= 0) {
- event.preventDefault();
- event.stopImmediatePropagation();
- clearChapterPreview({ clearIntents: true });
- } else if (event.key === 'Escape' && activeIndex >= 0) {
- event.preventDefault();
- showAll();
- }
- }, true);
-
- function syncViewFromHash() {
- try {
- var params = new URLSearchParams(location.hash.replace(/^#/, ''));
- var initial = params.get('view');
- var requestedBeat = params.get('beat');
- var restoreGeneration = ++momentRestoreGeneration;
- if (initial) {
- var activated = activateById(initial, { updateUrl: false, restore: true });
- if (!activated) {
- showAll({ updateUrl: false, restore: true });
- return;
- }
- if (requestedBeat) afterHandoff(function () {
- if (restoreGeneration !== momentRestoreGeneration) return;
- var latest = new URLSearchParams(location.hash.replace(/^#/, ''));
- if (latest.get('view') !== initial || latest.get('beat') !== requestedBeat) return;
- if (activeIndex < 0 || views[activeIndex].id !== initial) return;
- selectStoryBeatById(requestedBeat, { linked: true, follow: true, followInstant: true });
- });
- } else if (params.get('focus') || params.get('relation')) {
- activeIndex = -1;
- render();
- } else {
- showAll({ updateUrl: false, restore: true });
- }
- } catch (_) { showAll({ updateUrl: false, restore: true }); }
- }
-
- window.addEventListener('hashchange', syncViewFromHash);
- document.addEventListener('visibilitychange', function () {
- if (document.hidden) {
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('hidden');
- }
- else if (!document.hidden) maybeStartSharePlayback();
+ svg.addEventListener('focusout', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
+ if (focusedNode === node) focusedNode = null;
+ sync();
});
- if (window.matchMedia) {
- var guidedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
- var onGuidedMotionChange = function () {
- if (guidedMotionQuery.matches) {
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('reduced-motion');
- }
- };
- if (typeof guidedMotionQuery.addEventListener === 'function') guidedMotionQuery.addEventListener('change', onGuidedMotionChange);
- else if (typeof guidedMotionQuery.addListener === 'function') guidedMotionQuery.addListener(onGuidedMotionChange);
- }
- if (document.documentElement.getAttribute('data-embed') !== 'true' && typeof MutationObserver !== 'undefined' && typeof Node !== 'undefined' && svg instanceof Node && document.documentElement instanceof Node) {
- var chapterPreviewOwnerObserver = new MutationObserver(syncChapterPreview);
- chapterPreviewOwnerObserver.observe(svg, {
- attributes: true,
- attributeFilter: [
- 'data-route-picking', 'data-route-active', 'data-lens-active',
- 'data-legend-preview-active', 'data-relationship-preview-active',
- 'data-intent-trace-active', 'data-focus-active'
- ]
- });
- var storyMotionObserver = new MutationObserver(function () {
- if (document.documentElement.getAttribute('data-motion') !== 'live') clearStoryPulse();
- renderPlayback();
- });
- storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });
- }
- if (typeof ResizeObserver === 'function') {
- var chapterViewportWidth = chapterList.clientWidth;
- var trailViewportWidth = trail.clientWidth;
- var storyScrollObserver = new ResizeObserver(function () {
- var chapterWidth = chapterList.clientWidth;
- var trailWidth = trail.clientWidth;
- if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);
- if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {
- centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);
- }
- chapterViewportWidth = chapterWidth;
- trailViewportWidth = trailWidth;
- });
- storyScrollObserver.observe(chapterList);
- storyScrollObserver.observe(trail);
- }
- window.addEventListener('beforeprint', function () {
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('print');
+ container.addEventListener('pointerdown', function (event) {
+ if (!event.target.closest('[data-node-id]')) clear({ announce: false });
});
- syncViewFromHash();
- if (autoplayPending) {
- requestAnimationFrame(function () {
- requestAnimationFrame(maybeStartSharePlayback);
- });
- }
+ window.addEventListener('blur', function () { clear({ announce: false }); });
return {
- count: views.length,
- activate: activateById,
- showAll: showAll,
- play: startPlayback,
- playCurrent: startCurrentViewPlayback,
- pause: pausePlayback,
- beatLink: storyMomentLink,
- copyBeatLink: copyStoryMomentLink,
- cancelHandoff: cancelHandoff,
- settleHandoff: settleHandoff,
- clearPreview: function () { return clearChapterPreview({ clearIntents: true }); },
- isPlaying: function () { return playing; },
- handoff: function () {
- return currentHandoff ? { id: currentHandoff.id, mode: currentHandoff.mode, anchor: currentHandoff.anchor || null } : null;
- },
- active: function () { return activeIndex < 0 ? null : views[activeIndex].id; },
- preview: function () { return activePreviewIndex < 0 ? null : views[activePreviewIndex].id; },
- delta: function (id) {
- var index = views.findIndex(function (view) { return view.id === id; });
- if (index < 0) return null;
- var value = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- return { stay: value.stay.slice(), enter: value.enter.slice(), leave: value.leave.slice() };
- },
- beat: function () {
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- return step ? {
- index: step.index,
- position: step.index + 1,
- total: storySteps.length,
- nodeId: step.nodeId,
- relation: step.relation,
- edgeKeys: step.edgeKeys.slice()
- } : null;
- },
- focus: function () { return activeIndex < 0 ? [] : views[activeIndex].focus.slice(); }
+ show: show,
+ clear: clear,
+ active: function () { return activeId; }
};
})();
/* ============================================================
Adaptive Reader Shell — one diagram across laptop and monitor.
The canonical SVG and viewBox never change. On ordinary desktop pages,
- wide diagrams receive only enough outer width to use the available
+ wide diagrams and measured intrinsic tall workflows receive enough outer width to use the available
height without pushing summary cards below the viewport. Mobile,
- embed, presentation, print, and non-wide diagrams retain their own
+ embed, presentation, print, and unmarked non-wide diagrams retain their own
established layout contracts.
============================================================ */
+ // Fixed script-private participants; the CLI sees only the joint wait below.
+ const archifyLayoutOwners = { reader: null, viewerChrome: null };
Archify.waitForStableLayout = function (options) {
options = options || {};
var maximumFrames = Math.max(1, Number(options.maximumFrames) || 240);
@@ -11045,18 +9440,54 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var diagram = document.querySelector('.diagram-container');
var svg = diagram && diagram.querySelector(':scope > svg');
var header = shell && shell.querySelector('.header');
- var guided = shell && shell.querySelector('.guided-views');
var cards = shell && shell.querySelector('.cards');
var viewBox = svg && svg.viewBox && svg.viewBox.baseVal;
var ratio = viewBox && viewBox.height > 0 ? viewBox.width / viewBox.height : 0;
+ var measuredHeightFit = svg && svg.getAttribute('data-reader-fit') === 'intrinsic-height';
var frame = 0;
var settleFrame = 0;
var lastWidth = 0;
+ // Widest reader the overflow settle has accepted for this viewport (0 =
+ // uncapped). Card copy rewraps as the reader narrows, so recomputing
+ // from fixed heights alone would widen again and oscillate; only a
+ // resize lifts the cap.
+ var settledCap = 0;
var WIDE_RATIO = 1.55;
var MIN_DESKTOP_WIDTH = 1024;
var MIN_READER_WIDTH = 960;
var MAX_READER_WIDTH = 1920;
+ var MIN_PROJECTED_NODE_TEXT_PX = 6;
+ var declaredMinimumText = svg ? parseFloat(svg.getAttribute('data-reader-min-text') || '') : null;
+ var requestedMinimumText = Number.isFinite(declaredMinimumText)
+ ? Math.max(MIN_PROJECTED_NODE_TEXT_PX, declaredMinimumText)
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var declaredPrimaryText = svg ? parseFloat(svg.getAttribute('data-reader-primary-text') || '') : null;
var SAFE_BOTTOM_GAP = 12;
+ // Wide viewports move summary cards beside the diagram, so the height
+ // budget belongs to the diagram and spare width holds the notes.
+ var RAIL_MIN_VIEWPORT = 1280;
+ var RAIL_WIDTH = 288;
+ var RAIL_GAP = 20;
+ // A default rail must leave primary node labels comfortably readable;
+ // otherwise it starts collapsed and the reader can still open it.
+ var RAIL_COMFORT_PRIMARY_PX = 12;
+ var railPanel = shell && shell.querySelector('.reader-rail');
+ var railReveal = document.getElementById('rail-reveal');
+ var railCollapse = document.getElementById('rail-collapse');
+ var railPlacement = document.getElementById('rail-placement');
+ var RAIL_COLLAPSED_KEY = 'archify-rail-collapsed';
+ var RAIL_PLACEMENT_KEY = 'archify-rail-placement';
+ // Memory is the page's source of truth; storage only carries the choice
+ // to later artifacts, so a blocked or full localStorage cannot freeze it.
+ var preferences = Object.create(null);
+ function readPreference(key) {
+ if (key in preferences) return preferences[key];
+ try { return localStorage.getItem(key); } catch (_) { return null; }
+ }
+ function writePreference(key, value) {
+ preferences[key] = value;
+ try { localStorage.setItem(key, value); } catch (_) {}
+ }
if (diagram && ratio >= WIDE_RATIO) {
diagram.setAttribute('data-wide-diagram', 'true');
@@ -11075,9 +9506,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ function minimumReadableScale() {
+ var sourceMinimum = null;
+ var selectors = [
+ 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
+ ];
+ if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
+ selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
+ }
+ Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
+ if (Number.isFinite(sourceFontPx)) {
+ sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ }
+ });
+ return sourceMinimum != null
+ ? Math.min(1, requestedMinimumText / sourceMinimum)
+ : 1;
+ }
+ var sourcePrimary = null;
+ if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
+ var size = parseFloat(text.getAttribute('font-size') || '');
+ if (Number.isFinite(size) && size > 0) sourcePrimary = sourcePrimary == null ? size : Math.max(sourcePrimary, size);
+ });
+ // SVG width at which the largest node label renders at targetPx. Every
+ // renderer writes label font sizes, so the rail comfort check works for
+ // all diagram types; only the renderer-declared floor needs metadata.
+ function labelWidth(targetPx) {
+ return sourcePrimary == null || !viewBox ? 0 : viewBox.width * targetPx / sourcePrimary;
+ }
+ function primaryReadingWidth() {
+ if (!measuredHeightFit || !Number.isFinite(declaredPrimaryText) || declaredPrimaryText <= 0) return 0;
+ // Primary labels should remain comfortable to read when cards or
+ // auxiliary rows make a one-screen fit too small. Ordinary page
+ // scroll preserves that reading size; viewport width still caps it.
+ // A long title may already use a smaller fitted font. Preserve that
+ // hierarchy rather than enlarging every other node to compensate.
+ return labelWidth(declaredPrimaryText);
+ }
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && (ratio >= WIDE_RATIO || measuredHeightFit) &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11088,7 +9558,52 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.style.removeProperty('--archify-reader-width');
html.removeAttribute('data-reader-layout');
html.removeAttribute('data-reader-overflow');
+ setRail(false);
lastWidth = 0;
+ settledCap = 0;
+ }
+ // Rail modes: "true" docks beside the diagram, "collapsed" leaves only the
+ // reveal control, "overlay" opens a drawer when docking would break the
+ // readable floor, and "bottom" stacks notes and index below the diagram.
+ function setRail(mode) {
+ if (mode) {
+ html.setAttribute('data-reader-rail', mode);
+ html.style.setProperty('--archify-rail-width', RAIL_WIDTH + 'px');
+ html.style.setProperty('--archify-rail-gap', RAIL_GAP + 'px');
+ } else {
+ html.removeAttribute('data-reader-rail');
+ html.style.removeProperty('--archify-rail-width');
+ html.style.removeProperty('--archify-rail-gap');
+ }
+ if (railReveal) railReveal.hidden = mode !== 'collapsed';
+ if (railCollapse) {
+ railCollapse.hidden = mode !== 'true' && mode !== 'overlay';
+ railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
+ }
+ if (railPlacement) {
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
+ railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
+ railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
+ railPlacement.title = railPlacement.getAttribute('aria-label');
+ }
+ }
+ var outline = document.getElementById('node-outline');
+ function hasCards() {
+ return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
+ }
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
}
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
@@ -11102,8 +9617,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)
};
}
- function applyWidth(width) {
- var rounded = Math.round(width);
+ function applyWidth(width, minWidth) {
+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));
if (Math.abs(rounded - lastWidth) < 1) return false;
lastWidth = rounded;
html.style.setProperty('--archify-reader-width', rounded + 'px');
@@ -11115,12 +9630,14 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
- if (overflow > 1 && lastWidth > minWidth) {
- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));
+ ) - window.innerHeight - belowFold();
+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
+ settledCap = lastWidth;
html.setAttribute('data-reader-overflow', 'reduced');
} else if (overflow > 1) {
html.setAttribute('data-reader-overflow', 'authored');
@@ -11137,18 +9654,58 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var readableWidth = viewBox && viewBox.width > 0
+ ? viewBox.width * minimumReadableScale() + chrome.diagramX
+ : MIN_READER_WIDTH;
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
+ var readableMinimumWidth = measuredHeightFit && ratio < WIDE_RATIO
+ ? readableWidth
+ : measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? Math.max(MIN_READER_WIDTH, readableWidth)
+ : MIN_READER_WIDTH;
+ var minWidth;
+ if (measuredHeightFit && ratio < WIDE_RATIO) {
+ minWidth = Math.min(readableMinimumWidth, viewportCap);
+ } else if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
+ minWidth = Math.min(readableMinimumWidth, maxWidth);
+ } else {
+ minWidth = Math.min(readableMinimumWidth, viewportCap);
+ }
+ var primaryWidth = primaryReadingWidth();
+ var railExtra = RAIL_WIDTH + RAIL_GAP;
+ var mode = null;
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
+ var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
+ var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
+ var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
+ var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ else mode = fitsReadable ? 'true' : 'overlay';
+ }
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
+ var docked = mode === 'true';
+ setRail(mode);
+ chrome = chromeMetrics();
+ if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
- outerHeight(header) + outerHeight(guided) + outerHeight(cards);
+ outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
- var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;
- var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));
- applyWidth(width);
+ var desiredWidth = availableSvgHeight * ratio + chrome.diagramX + (docked ? railExtra : 0);
+ var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth, settledCap || desiredWidth));
+ applyWidth(width, minWidth);
settleOverflow(minWidth);
return {
ratio: ratio,
- width: Math.round(width),
+ width: lastWidth,
availableSvgHeight: Math.round(availableSvgHeight),
fixedHeight: Math.round(fixedHeight)
};
@@ -11174,28 +9731,58 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Math.round(diagramRect.height * 100) / 100
].join('|');
}
+ function layoutPending() { return Boolean(frame || settleFrame); }
function whenStable() {
return Archify.waitForStableLayout({
schedule: schedule,
- pending: function () { return Boolean(frame || settleFrame); },
+ pending: layoutPending,
snapshot: stableSnapshot,
timeoutMessage: 'Adaptive reader layout did not reach stable dimensions.'
});
}
+ archifyLayoutOwners.reader = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
- window.addEventListener('resize', schedule, { passive: true });
+ window.addEventListener('resize', function () {
+ settledCap = 0;
+ schedule();
+ }, { passive: true });
window.addEventListener('load', schedule, { once: true });
if (document.fonts && document.fonts.ready) document.fonts.ready.then(schedule).catch(function () {});
if (typeof ResizeObserver === 'function') {
var resizeObserver = new ResizeObserver(schedule);
- [header, guided, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
+ [header, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
}
if (typeof MutationObserver === 'function') {
var contentObserver = new MutationObserver(schedule);
- if (guided) contentObserver.observe(guided, { attributes: true, childList: true, subtree: true });
if (cards) contentObserver.observe(cards, { attributes: true, childList: true, subtree: true });
contentObserver.observe(html, { attributes: true, attributeFilter: ['data-embed', 'data-present'] });
}
+ // Reader choices persist across artifacts; a resize-style remeasure
+ // applies them without reloading.
+ function chooseRail(key, value) {
+ writePreference(key, value);
+ settledCap = 0;
+ schedule();
+ }
+ function collapseRail() {
+ chooseRail(RAIL_COLLAPSED_KEY, '1');
+ if (railReveal) requestAnimationFrame(function () { try { railReveal.focus({ preventScroll: true }); } catch (_) {} });
+ }
+ if (railReveal) railReveal.addEventListener('click', function () { chooseRail(RAIL_COLLAPSED_KEY, '0'); });
+ if (railCollapse) railCollapse.addEventListener('click', collapseRail);
+ if (railPlacement) railPlacement.addEventListener('click', function () {
+ var toBottom = html.getAttribute('data-reader-rail') !== 'bottom';
+ if (!toBottom) writePreference(RAIL_COLLAPSED_KEY, '0');
+ chooseRail(RAIL_PLACEMENT_KEY, toBottom ? 'bottom' : 'right');
+ });
+ document.addEventListener('keydown', function (event) {
+ if (event.key === 'Escape' && html.getAttribute('data-reader-rail') === 'overlay') collapseRail();
+ });
+ document.addEventListener('pointerdown', function (event) {
+ if (html.getAttribute('data-reader-rail') !== 'overlay' || !railPanel) return;
+ if (!railPanel.contains(event.target) && !(railReveal && railReveal.contains(event.target))) chooseRail(RAIL_COLLAPSED_KEY, '1');
+ });
+ if (typeof ResizeObserver === 'function' && railPanel) new ResizeObserver(schedule).observe(railPanel);
schedule();
return {
@@ -11350,8 +9937,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -11365,7 +9980,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -11385,7 +10000,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -11407,7 +10022,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -11462,7 +10077,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -11476,16 +10091,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
lastReceipt ? lastReceipt.stageGap : ''
].join('|');
}
+ function layoutPending() { return Boolean(frame || settleFrame || probingBaseline); }
function whenStable() {
return Archify.waitForStableLayout({
schedule: schedule,
- pending: function () { return Boolean(frame || settleFrame || probingBaseline); },
+ pending: layoutPending,
snapshot: stableSnapshot,
timeoutMessage: 'Viewer chrome layout did not reach stable dimensions.'
});
}
+ archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -11496,7 +10114,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
if (typeof MutationObserver === 'function') {
var contentObserver = new MutationObserver(function (records) {
- var viewerModeChanged = records.some(function (record) { return record.target === html; });
+ // A theme switch changes paint, not the stage geometry. Reprobing
+ // drops the bottom rail for several frames and makes the diagram jump.
+ var viewerModeChanged = records.some(function (record) {
+ return record.target === html && record.attributeName !== 'data-theme';
+ });
if (viewerModeChanged) reprobe();
else schedule();
});
@@ -11514,11 +10136,55 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
})();
+ Archify.layoutStability = {
+ whenStable: function () {
+ var reader = archifyLayoutOwners.reader;
+ var chrome = archifyLayoutOwners.viewerChrome;
+ if (!reader || !chrome) {
+ return Promise.reject(new Error('Joint layout owners are unavailable.'));
+ }
+ var observedFontsReady = document.fonts && document.fonts.ready;
+ var fontCyclePending = false;
+ var fontGeneration = 0;
+ function scheduleOwners() { reader.schedule(); chrome.schedule(); }
+ function fontsPending() {
+ var fonts = document.fonts;
+ var ready = fonts && fonts.ready;
+ if (ready && (ready !== observedFontsReady || (fonts.status === 'loading' && !fontCyclePending))) {
+ observedFontsReady = ready;
+ fontCyclePending = true;
+ var generation = ++fontGeneration;
+ ready.catch(function () {}).then(function () {
+ if (generation !== fontGeneration) return;
+ fontCyclePending = false;
+ scheduleOwners();
+ });
+ }
+ return fontCyclePending || Boolean(fonts && fonts.status === 'loading');
+ }
+ return Archify.waitForStableLayout({
+ maximumFrames: 960,
+ schedule: scheduleOwners,
+ pending: function () {
+ // Recapture readiness for font cycles that begin during sampling.
+ return fontsPending() || reader.pending() || chrome.pending();
+ },
+ snapshot: function () {
+ return JSON.stringify([
+ ['reader', reader.snapshot()],
+ ['viewerChrome', chrome.snapshot()]
+ ]);
+ },
+ timeoutMessage: 'Joint reader and viewer chrome layout did not reach stable dimensions.'
+ });
+ }
+ };
Archify.view = (function () {
var container = document.querySelector('.diagram-container');
var svg = container.querySelector('svg');
@@ -11740,18 +10406,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
container.removeAttribute('data-camera-transaction');
}
function interruptCamera(reason) {
- if (Archify.guidedViews && Archify.guidedViews.cancelHandoff) {
- Archify.guidedViews.cancelHandoff(reason || 'manual');
- }
var rendered = sampleRenderedState();
stopCameraMotion(reason || 'manual', false);
state = rendered;
state.mode = 'manual';
apply();
renderControls();
- if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: reason || 'manual' });
}
@@ -11811,8 +10471,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return true;
}
function semanticIds(ids, includeNeighbors) {
- var seeds = {};
- var wanted = {};
+ var seeds = Object.create(null);
+ var wanted = Object.create(null);
(ids || []).forEach(function (id) { seeds[id] = true; wanted[id] = true; });
if (includeNeighbors) {
Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
@@ -11846,8 +10506,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
var maxY = Math.max.apply(Math, boxes.map(function (box) { return box.y + box.height; }));
var bounds = {
- x: contentOffsetX + minX * contentScale,
- y: contentOffsetY + minY * contentScale,
+ x: contentOffsetX + (minX - viewBox.x) * contentScale,
+ y: contentOffsetY + (minY - viewBox.y) * contentScale,
width: Math.max(1, (maxX - minX) * contentScale),
height: Math.max(1, (maxY - minY) * contentScale)
};
@@ -11951,7 +10611,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!boxes.length || !viewBox || viewBox.width <= 0) return false;
var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));
var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
- var center = ((minX + maxX) / 2 / viewBox.width) * (svg.clientWidth || 1);
+ var center = (((minX + maxX) / 2 - viewBox.x) / viewBox.width) * (svg.clientWidth || 1);
var target = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, center - container.clientWidth / 2));
var transaction = cameraReceipt({ scrollLeft: target }, options);
cameraTransaction = transaction;
@@ -11969,9 +10629,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return transaction;
}
function syncSemantic() {
- var guided = Archify.guidedViews && typeof Archify.guidedViews.focus === 'function'
- ? Archify.guidedViews.focus() : [];
- if (guided && guided.length) return reveal(guided, { reason: 'guided-sync' });
var active = Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null;
if (typeof active === 'string') return reveal([active], { includeNeighbors: true, reason: 'focus-sync' });
if (Array.isArray(active) && active.length) return reveal(active, { reason: 'selection-sync' });
@@ -12428,8 +11085,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
: viewerText('viewer.radar.viewport.scale', { percent: Math.round(visible.scale * 100) }));
status.textContent = viewerText('viewer.radar.status', { count: nodes.length, viewport: viewportCopy });
nodes.forEach(function (item) {
- var active = item.node.hasAttribute('data-focus-selected') ||
- item.node.getAttribute('data-story-beat-state') === 'active';
+ var active = item.node.hasAttribute('data-focus-selected');
if (active) item.rect.setAttribute('data-radar-active', 'true');
else item.rect.removeAttribute('data-radar-active');
});
@@ -12453,6 +11109,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (next) {
clearSpaceRetry();
spaceRetryCount = 0;
+ trigger.setAttribute('data-radar-requested', 'true');
build();
attemptRequestedOpen(options);
} else {
@@ -12465,11 +11122,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
resetDockingStyles();
restorePassport();
feedback.hidden = true;
+ // Focus before collapsing: the dock hides this trigger at 100% unless it holds focus.
+ if (options.restoreFocus === true) trigger.focus();
trigger.setAttribute('aria-expanded', 'false');
+ trigger.removeAttribute('data-radar-requested');
trigger.removeAttribute('data-radar-space-limited');
trigger.setAttribute('aria-label', viewerText('viewer.nav.radar'));
trigger.title = viewerText('viewer.nav.radar.title');
- if (options.restoreFocus === true) trigger.focus();
}
return next;
}
@@ -12490,9 +11149,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function focusNode(id) {
var main = diagram.querySelector('[data-node-id="' + id + '"]');
if (!main) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.focus && typeof Archify.focus.set === 'function') {
Archify.focus.set(id, { toggle: false });
}
@@ -12677,8 +11333,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Presentation Stage — a shareable, viewport-filling live view.
It changes only HTML layout and URL state; SVG semantics and export
- serialization remain untouched. Escape first clears an active guided
- view/focus, then exits the stage.
+ serialization remain untouched. Escape first clears an active
+ focus, then exits the stage.
============================================================ */
Archify.presentation = (function () {
var html = document.documentElement;
@@ -12751,7 +11407,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Node Finder — stable-ID search over the existing semantic SVG.
Search never changes the IR or SVG geometry: selecting a result resets
- the viewport, releases a guided view, and delegates to semantic focus.
+ the viewport and delegates to semantic focus.
============================================================ */
Archify.finder = (function () {
var html = document.documentElement;
@@ -12873,9 +11529,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }
return true;
}
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.view && typeof Archify.view.reset === 'function') Archify.view.reset({ automatic: true });
Archify.focus.set(id, { toggle: false });
if (Archify.view && typeof Archify.view.reveal === 'function') {
@@ -13014,6 +11667,145 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
})();
+ /* ============================================================
+ Node Outline — a rail index of the semantic nodes, grouped by their
+ authored context. Hover previews neighbors through Intent Trace;
+ selection delegates to the Finder's focus-and-reveal path. It reads
+ the canonical SVG and never changes geometry or export state.
+ ============================================================ */
+ Archify.outline = (function () {
+ var panel = document.getElementById('node-outline');
+ var list = document.getElementById('node-outline-list');
+ var count = document.getElementById('node-outline-count');
+ var svg = document.querySelector('.diagram-container > svg');
+ if (!panel || !list || !svg) return { count: 0 };
+ var TONES = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];
+ var nodes = Array.from(svg.querySelectorAll('[data-node-id]')).filter(function (node) {
+ return !node.closest('[data-legend-hit], .legend') && node.getAttribute('data-node-label');
+ });
+ var buttons = Object.create(null);
+
+ function tone(node) {
+ var shape = node.querySelector('[class*="c-"]:not(.c-mask)');
+ var match = shape && /(?:^|\s)c-([a-z]+)/.exec(shape.getAttribute('class') || '');
+ return match && TONES.indexOf(match[1]) !== -1 ? match[1] : 'external';
+ }
+ function preview(id) {
+ if (Archify.intentTrace && typeof Archify.intentTrace.show === 'function') Archify.intentTrace.show(id);
+ }
+ function clearPreview() {
+ if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
+ }
+ function select(id) {
+ clearPreview();
+ var finder = Archify.finder;
+ if (finder && typeof finder.select === 'function') {
+ if (finder.select(id)) return;
+ var routeMode = Archify.routeProbe && typeof Archify.routeProbe.active === 'function' ? Archify.routeProbe.active() : 'idle';
+ // Only an active endpoint picker owns a refused selection.
+ if (routeMode === 'source' || routeMode === 'target') return;
+ }
+ if (Archify.focus && typeof Archify.focus.set === 'function') Archify.focus.set(id, { toggle: false });
+ }
+
+ var groups = [];
+ var byContext = Object.create(null);
+ nodes.forEach(function (node) {
+ // Group by the outermost context (lane or stage); deeper segments
+ // such as workflow groups and columns would split the index into
+ // one-node sections.
+ var context = (node.getAttribute('data-node-context') || '').split(' \u203a ')[0];
+ if (!byContext[context]) {
+ byContext[context] = { label: context, nodes: [] };
+ groups.push(byContext[context]);
+ }
+ byContext[context].nodes.push(node);
+ });
+
+ groups.forEach(function (group) {
+ var section = document.createElement('li');
+ section.className = 'node-outline-group';
+ if (groups.length > 1 && group.label) {
+ var heading = document.createElement('span');
+ heading.className = 'node-outline-heading';
+ var headingLabel = document.createElement('span');
+ headingLabel.textContent = group.label;
+ var headingCount = document.createElement('small');
+ headingCount.textContent = String(group.nodes.length);
+ heading.appendChild(headingLabel);
+ heading.appendChild(headingCount);
+ section.appendChild(heading);
+ }
+ var items = document.createElement('ul');
+ group.nodes.forEach(function (node) {
+ var id = node.getAttribute('data-node-id');
+ var item = document.createElement('li');
+ var button = document.createElement('button');
+ button.type = 'button';
+ button.className = 'node-outline-item';
+ button.setAttribute('data-outline-node', id);
+ button.style.setProperty('--outline-tone', 'var(--' + tone(node) + '-stroke)');
+ var dot = document.createElement('span');
+ dot.className = 'node-outline-dot';
+ dot.setAttribute('aria-hidden', 'true');
+ var label = document.createElement('strong');
+ label.textContent = node.getAttribute('data-node-label');
+ button.appendChild(dot);
+ button.appendChild(label);
+ var sublabel = node.getAttribute('data-node-sublabel');
+ if (sublabel) {
+ var detail = document.createElement('small');
+ detail.textContent = sublabel;
+ button.appendChild(detail);
+ }
+ button.addEventListener('pointerenter', function () { preview(id); });
+ button.addEventListener('focus', function () { preview(id); });
+ button.addEventListener('pointerleave', clearPreview);
+ button.addEventListener('blur', clearPreview);
+ button.addEventListener('click', function () { select(id); });
+ buttons[id] = button;
+ item.appendChild(button);
+ items.appendChild(item);
+ });
+ section.appendChild(items);
+ list.appendChild(section);
+ });
+
+ var previewing = null;
+ function syncCurrent() {
+ nodes.forEach(function (node) {
+ var button = buttons[node.getAttribute('data-node-id')];
+ if (!button) return;
+ if (node.getAttribute('aria-pressed') === 'true') button.setAttribute('aria-current', 'true');
+ else button.removeAttribute('aria-current');
+ });
+ // Mirror a diagram-side hover so the index answers "where is this?".
+ var active = buttons[svg.getAttribute('data-intent-trace-active') || ''] || null;
+ if (active === previewing) return;
+ if (previewing) previewing.removeAttribute('data-previewing');
+ previewing = active;
+ if (!active) return;
+ active.setAttribute('data-previewing', '');
+ if (!active.matches(':hover') && panel.offsetParent) {
+ var box = list.getBoundingClientRect();
+ var item = active.getBoundingClientRect();
+ if (item.top < box.top || item.bottom > box.bottom - 24) {
+ list.scrollTop += item.top - box.top - box.height / 2 + item.height / 2;
+ }
+ }
+ }
+ if (typeof MutationObserver === 'function') {
+ new MutationObserver(syncCurrent).observe(svg, { attributes: true, subtree: true, attributeFilter: ['aria-pressed', 'data-intent-trace-active'] });
+ }
+ if (count) count.textContent = String(nodes.length);
+ panel.hidden = nodes.length < 2;
+ syncCurrent();
+ if (Archify.readerLayout && typeof Archify.readerLayout.schedule === 'function') Archify.readerLayout.schedule();
+
+ return { count: nodes.length, select: select };
+ })();
+
+
/* ============================================================
Route Probe — shortest directed path over compiled semantics.
The graph is read from renderer-owned stable IDs and relationship
@@ -13280,7 +12072,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function outgoingByNode() {
var byId = nodesById();
- var outgoing = {};
+ var outgoing = Object.create(null);
edges().forEach(function (edge) {
var from = edge.getAttribute('data-edge-from');
var to = edge.getAttribute('data-edge-to');
@@ -13292,7 +12084,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function reachableFrom(source) {
var outgoing = outgoingByNode();
- var reached = {};
+ var reached = Object.create(null);
var queue = [source];
reached[source] = true;
for (var cursor = 0; cursor < queue.length; cursor += 1) {
@@ -13307,7 +12099,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function hopDistancesFrom(source) {
var outgoing = outgoingByNode();
- var distances = {};
+ var distances = Object.create(null);
var queue = [source];
distances[source] = 0;
for (var cursor = 0; cursor < queue.length; cursor += 1) {
@@ -13323,7 +12115,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function shortestDirectedPath(source, target) {
if (source === target) return null;
var outgoing = outgoingByNode();
- var previous = {};
+ var previous = Object.create(null);
var queue = [source];
previous[source] = null;
for (var cursor = 0; cursor < queue.length && !Object.prototype.hasOwnProperty.call(previous, target); cursor += 1) {
@@ -13810,9 +12602,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Array.isArray(focused)) focused = null;
clear({ updateUrl: false, preserveView: true, restoreFocus: false });
if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.focus && typeof Archify.focus.clear === 'function') {
Archify.focus.clear({ updateUrl: false, preserveView: true });
}
@@ -13853,7 +12642,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var sourceIds = nodes().map(function (node) { return node.getAttribute('data-node-id'); }).filter(function (id) {
return outgoing[id] && outgoing[id].length;
});
- var sourceBadges = {};
+ var sourceBadges = Object.create(null);
sourceIds.forEach(function (id) { sourceBadges[id] = viewerText('viewer.route.finder.source.badge'); });
return {
kind: 'route-source',
@@ -13869,7 +12658,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (mode === 'target' && startId && byId[startId]) {
var distances = hopDistancesFrom(startId);
var targetIds = Object.keys(distances).filter(function (id) { return id !== startId && byId[id]; });
- var targetBadges = {};
+ var targetBadges = Object.create(null);
targetIds.forEach(function (id) {
targetBadges[id] = viewerCount('viewer.route.hop', distances[id]);
});
@@ -14078,7 +12867,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var MAX_LENS_FLOW_EDGES = 24;
function nodesById() {
- var byId = {};
+ var byId = Object.create(null);
Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id][data-node-kind]'), function (node) {
var id = node.getAttribute('data-node-id');
if (id && !byId[id]) byId[id] = node;
@@ -14234,7 +13023,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return selectedKinds.length > 0 || !panel.hidden || html.getAttribute('data-present') === 'true' ||
svg.hasAttribute('data-focus-active') || svg.hasAttribute('data-intent-trace-active') ||
svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active') ||
- svg.hasAttribute('data-story-active') || svg.hasAttribute('data-relationship-preview-active');
+ svg.hasAttribute('data-relationship-preview-active');
}
function previewLegendKind(entry) {
clearLegendPreview();
@@ -14245,7 +13034,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return (byId[id].getAttribute('data-node-kind') || 'neutral') === kind;
});
if (!matches.length) return false;
- var chosen = {};
+ var chosen = Object.create(null);
matches.forEach(function (id) {
chosen[id] = true;
byId[id].setAttribute('data-legend-preview-match', '');
@@ -14421,7 +13210,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
options = options || {};
cleanSvgState();
var byId = nodesById();
- var nodeKind = {};
+ var nodeKind = Object.create(null);
Object.keys(byId).forEach(function (id) { nodeKind[id] = byId[id].getAttribute('data-node-kind') || 'neutral'; });
if (!selectedKinds.length) {
status.textContent = viewerText('viewer.lens.choose');
@@ -14506,9 +13295,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {
Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
}
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {
Archify.intentTrace.clear({ announce: false });
}
@@ -14728,7 +13514,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Diagram Guide — a factual command deck over existing interactions.
Counts come from compiled semantics; actions delegate to Finder, Route
- Probe, Semantic Radar, Semantic Lens, Story Trail, Presentation, theme, export, and
+ Probe, Semantic Radar, Semantic Lens, Presentation, theme, export, and
camera without adding a second command implementation or SVG state.
============================================================ */
Archify.guide = (function () {
@@ -14741,13 +13527,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var stats = document.getElementById('diagram-guide-stats');
var actions = document.getElementById('diagram-guide-actions');
var feedback = document.getElementById('diagram-guide-feedback');
- var storyBtn = actions.querySelector('[data-guide-action="story"]');
- var storyCopy = document.getElementById('diagram-guide-story-copy');
var routePanel = document.getElementById('route-probe');
+ var returnFocus = null;
- function viewCount() {
- return Archify.guidedViews && Number(Archify.guidedViews.count) || 0;
- }
function relationshipCount() {
var seen = {};
Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
@@ -14763,17 +13545,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function renderFacts() {
var nodes = svg.querySelectorAll('[data-node-id]').length;
var relationships = relationshipCount();
- var views = viewCount();
stats.textContent = viewerText('viewer.guide.facts', {
nodes: viewerCount('viewer.guide.fact.node', nodes),
- relationships: viewerCount('viewer.guide.fact.relationship', relationships),
- views: viewerCount('viewer.guide.fact.view', views)
+ relationships: viewerCount('viewer.guide.fact.relationship', relationships)
});
- storyBtn.disabled = views === 0;
- storyBtn.setAttribute('aria-disabled', views === 0 ? 'true' : 'false');
- storyCopy.textContent = views
- ? viewerCount('viewer.guide.story.available', views)
- : viewerText('viewer.guide.story.unavailable');
}
function actionButtons() {
return Array.prototype.slice.call(actions.querySelectorAll('.diagram-guide-action:not(:disabled)'));
@@ -14786,7 +13561,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
trigger.setAttribute('aria-expanded', 'false');
trigger.setAttribute('aria-label', viewerText('viewer.guide.open'));
feedback.textContent = '';
- if (options.restoreFocus !== false) trigger.focus();
+ if (options.restoreFocus !== false) {
+ var target = trigger.hidden ? returnFocus : trigger;
+ if (target && typeof target.focus === 'function') target.focus();
+ }
return false;
}
function open() {
@@ -14796,12 +13574,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });
if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });
if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });
- if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: 'guide' });
}
+ returnFocus = document.activeElement;
renderFacts();
panel.hidden = false;
html.setAttribute('data-guide-open', 'true');
@@ -14818,16 +13594,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function toggle() { return panel.hidden ? open() : close(); }
function execute(action) {
feedback.textContent = '';
- if (action === 'story' && !viewCount()) {
- feedback.textContent = viewerText('viewer.guide.noStory');
- return false;
- }
close({ restoreFocus: false });
if (action === 'find') return Archify.finder.open();
if (action === 'route') return Archify.routeProbe.begin({ focusNode: true });
if (action === 'map') return Archify.radar.open();
if (action === 'lens') return Archify.semanticLens.open();
- if (action === 'story') return Archify.guidedViews.play();
if (action === 'present') return Archify.presentation.enter();
if (action === 'export') return Archify.exportMenu.open();
if (action === 'theme') return Archify.theme.toggle();
@@ -14843,7 +13614,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
r: 'route',
m: 'map',
l: 'lens',
- p: 'story',
f: 'present',
e: 'export',
t: 'theme',
@@ -14905,8 +13675,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
facts: function () {
return {
nodes: svg.querySelectorAll('[data-node-id]').length,
- relationships: relationshipCount(),
- views: viewCount()
+ relationships: relationshipCount()
};
}
};
diff --git a/examples/maka-architecture.html b/examples/maka-architecture.html
index ffdabe3d..e5245efe 100644
--- a/examples/maka-architecture.html
+++ b/examples/maka-architecture.html
@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="archify 2.17.0-dev.1">
+ <meta name="archify-reader-contract" content="declared-wide-v1">
<title>Maka Diagram</title>
<script>
// Resolve the theme before first paint so light-preference users don't
@@ -173,6 +174,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
[data-theme="dark"] {
--bg: #020617;
--grid: #1e293b;
+ --canvas-dot: rgba(148, 163, 184, 0.16);
--text: #ffffff;
--text-muted: #94a3b8;
--text-dim: #475569;
@@ -214,15 +216,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
[data-theme="light"] {
- --bg: #f8fafc;
- --grid: #e2e8f0;
- --text: #0f172a;
- --text-muted: #64748b;
- --text-dim: #94a3b8;
- --text-faint: #64748b;
+ --bg: #f4f5f7;
+ --grid: #e9edf2;
+ --canvas-dot: #d9dee5;
+ --text: #111827;
+ --text-muted: #5b6474;
+ --text-dim: #9aa3b2;
+ --text-faint: #6b7280;
--panel: #ffffff;
- --panel-border: #e2e8f0;
+ --panel-border: #e5e7eb;
--lane-fill: rgba(248, 250, 252, 0.65);
--lane-stroke: #cbd5e1;
@@ -231,20 +234,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
--mask: #ffffff;
- --frontend-fill: rgba(34, 211, 238, 0.15);
- --frontend-stroke: #0891b2;
- --backend-fill: rgba(52, 211, 153, 0.18);
- --backend-stroke: #059669;
- --database-fill: rgba(167, 139, 250, 0.2);
- --database-stroke: #7c3aed;
- --cloud-fill: rgba(251, 191, 36, 0.18);
- --cloud-stroke: #d97706;
- --security-fill: rgba(251, 113, 133, 0.15);
- --security-stroke: #e11d48;
- --messagebus-fill: rgba(251, 146, 60, 0.15);
- --messagebus-stroke:#ea580c;
- --external-fill: rgba(148, 163, 184, 0.18);
- --external-stroke: #64748b;
+ --frontend-fill: rgba(34, 211, 238, 0.15);
+ --frontend-stroke: #0891b2;
+ --backend-fill: rgba(52, 211, 153, 0.18);
+ --backend-stroke: #059669;
+ --database-fill: rgba(167, 139, 250, 0.2);
+ --database-stroke: #7c3aed;
+ --cloud-fill: rgba(251, 191, 36, 0.18);
+ --cloud-stroke: #d97706;
+ --security-fill: rgba(251, 113, 133, 0.15);
+ --security-stroke: #e11d48;
+ --messagebus-fill: rgba(251, 146, 60, 0.15);
+ --messagebus-stroke: #ea580c;
+ --external-fill: rgba(148, 163, 184, 0.18);
+ --external-stroke: #64748b;
--toolbar-bg: rgba(255, 255, 255, 0.92);
--toolbar-border: #cbd5e1;
@@ -477,12 +480,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
- font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
+ --archify-page-top: 2rem;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans', Roboto, 'Helvetica Neue', Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
background: var(--bg);
min-height: 100vh;
- padding: 2rem;
+ padding: var(--archify-page-top) 2rem 2rem;
color: var(--text);
- transition: background 0.2s ease, color 0.2s ease;
+ /* Theme surfaces change together; animating the page background leaves it
+ visibly out of sync with the SVG and panel for the first 200ms. */
}
html[data-preset="signal-flow"] body {
@@ -530,7 +536,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-embed="true"] .semantic-lens,
html[data-embed="true"] .diagram-guide,
html[data-embed="true"] .node-finder,
- html[data-embed="true"] .guided-views { display: none !important; }
+ html[data-embed="true"] .node-outline { display: none !important; }
html[data-embed="true"] .container { max-width: none; }
html[data-embed="true"] .diagram-container {
padding: 0.5rem;
@@ -540,142 +546,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-embed="true"] .diagram-container svg { min-width: 0; }
- /* Share Chapter Cue lives in the HTML viewer layer, not inside the SVG.
- It gives one-shot embeds a title, authored note, truthful stop order,
- and lifecycle state while canonical diagram geometry stays untouched. */
- .share-chapter-cue { display: none; }
- html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),
- html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {
- position: absolute;
- z-index: 18;
- top: 0.85rem;
- left: 50%;
- display: grid;
- grid-template-columns: auto minmax(9rem, 13.5rem) minmax(0, 1fr);
- align-items: center;
- gap: 0.45rem 0.85rem;
- width: min(52rem, calc(100% - 1.5rem));
- min-height: 3.35rem;
- padding: 0.55rem 0.75rem 0.65rem;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));
- border-radius: 0.75rem;
- background:
- linear-gradient(115deg, color-mix(in srgb, var(--frontend-fill) 52%, transparent), transparent 45%),
- color-mix(in srgb, var(--toolbar-menu-bg) 92%, transparent);
- color: var(--toolbar-text);
- box-shadow: 0 14px 42px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.045);
- backdrop-filter: blur(16px);
- pointer-events: none;
- animation: archify-share-cue-enter 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- html[data-preset="blueprint"] .share-chapter-cue {
- border-radius: 0.2rem;
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 46%, transparent), transparent 36%),
- var(--toolbar-menu-bg);
- box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
- backdrop-filter: none;
- }
- html[data-preset="editorial"] .share-chapter-cue {
- border-color: var(--panel-border);
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--security-fill) 58%, transparent), transparent 42%),
- var(--toolbar-menu-bg);
- box-shadow: 0 10px 30px color-mix(in srgb, #000 18%, transparent);
- backdrop-filter: none;
- }
- html[data-preset="editorial"] .share-chapter-state { color: var(--arrow-emphasis); }
- html[data-preset="editorial"] .share-chapter-state::before {
- border-radius: 0;
- box-shadow: none;
- transform: rotate(45deg) scale(0.8);
- }
- .share-chapter-index {
- display: grid;
- gap: 0.12rem;
- min-width: 5rem;
- padding-right: 0.75rem;
- border-right: 1px solid var(--toolbar-border);
- }
- .share-chapter-state {
- display: inline-flex;
- align-items: center;
- gap: 0.36rem;
- color: var(--frontend-stroke);
- font-size: 0.5rem;
- font-weight: 800;
- letter-spacing: 0.14em;
- text-transform: uppercase;
- }
- .share-chapter-state::before {
- width: 0.38rem;
- height: 0.38rem;
- border-radius: 50%;
- background: currentColor;
- box-shadow: 0 0 10px currentColor;
- content: '';
- }
- .share-chapter-cue[data-state="playing"] .share-chapter-state::before {
- animation: archify-share-cue-pulse 1.15s ease-in-out infinite;
- }
- .share-chapter-count {
- color: var(--text-faint);
- font-size: 0.5rem;
- font-weight: 700;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- }
- .share-chapter-copy { min-width: 0; }
- .share-chapter-copy strong,
- .share-chapter-copy small,
- .share-chapter-route {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .share-chapter-copy strong {
- color: var(--toolbar-text);
- font-size: 0.6875rem;
- line-height: 1.35;
- }
- .share-chapter-copy small {
- margin-top: 0.08rem;
- color: var(--text-muted);
- font-size: 0.5rem;
- line-height: 1.35;
- }
- .share-chapter-route {
- color: color-mix(in srgb, var(--frontend-stroke) 76%, var(--text-muted));
- font-size: 0.5625rem;
- font-weight: 650;
- letter-spacing: 0.015em;
- text-align: right;
- }
- .share-chapter-progress {
- position: absolute;
- right: 0;
- bottom: 0;
- left: 0;
- height: 2px;
- overflow: hidden;
- background: color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- .share-chapter-progress span {
- display: block;
- width: 100%;
- height: 100%;
- background: linear-gradient(90deg, var(--frontend-stroke), var(--database-stroke));
- box-shadow: 0 0 12px var(--frontend-stroke);
- transform: scaleX(0);
- transform-origin: left center;
- }
-
/* Presentation Stage is a viewer-only layer: it gives the live diagram
the viewport while keeping guided views, theme, focus, and exports real.
Embed mode wins when both query parameters are present. */
html[data-present="true"]:not([data-embed="true"]) body {
+ --archify-page-top: 1rem;
height: 100dvh;
min-height: 0;
padding: 1rem;
@@ -701,10 +576,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
text-overflow: ellipsis;
white-space: nowrap;
}
- html[data-present="true"]:not([data-embed="true"]) .guided-views {
- flex: none;
- margin-bottom: 0;
- }
+
html[data-present="true"]:not([data-embed="true"]) .diagram-container {
display: flex;
flex: 1 1 auto;
@@ -727,7 +599,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--frontend-stroke);
}
- /* The reader owns only the outer scale. Wide diagrams keep one authored
+ /* The reader owns only the outer scale. Wide diagrams and measured tall workflows keep one authored
SVG/viewBox while the runtime chooses a desktop width from the actual
vertical budget. This avoids device-specific files and breakpoint
jumps between a laptop and a tall monitor. */
@@ -752,15 +624,18 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.header-row {
display: flex;
align-items: center;
- gap: 1rem;
- margin-bottom: 0.5rem;
+ gap: 0.75rem;
+ min-height: 2.75rem;
+ margin-bottom: 0.25rem;
}
.pulse-dot {
- width: 12px;
- height: 12px;
+ flex: none;
+ width: 10px;
+ height: 10px;
background: var(--frontend-stroke);
border-radius: 50%;
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--frontend-stroke) 16%, transparent);
animation: none;
}
@@ -773,19 +648,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
h1 {
font-size: 1.5rem;
- font-weight: 700;
- letter-spacing: -0.025em;
+ font-weight: 650;
+ line-height: 1.25;
+ letter-spacing: -0.015em;
}
.subtitle {
color: var(--text-muted);
font-size: 0.875rem;
- margin-left: 1.75rem;
+ line-height: 1.55;
+ margin-left: 1.375rem;
}
html[data-preset="signal-flow"] .header-row::after {
content: attr(data-preset-badge-signal-flow);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
color: var(--frontend-stroke);
border: 1px solid var(--frontend-stroke);
border-radius: 999px;
@@ -809,7 +687,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-preset="blueprint"] .header-row::after {
content: attr(data-preset-badge-blueprint);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
padding: 0.28rem 0.55rem;
border-top: 1px solid var(--frontend-stroke);
border-bottom: 1px solid var(--frontend-stroke);
@@ -838,7 +717,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-preset="editorial"] .header-row::after {
content: attr(data-preset-badge-editorial);
- margin-left: auto;
+ flex: none;
+ margin-left: 0.25rem;
padding: 0.32rem 0 0.24rem;
border-bottom: 2px solid var(--arrow-emphasis);
color: var(--arrow-emphasis);
@@ -855,6 +735,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
background: var(--panel);
border-radius: 1rem;
border: 1px solid var(--panel-border);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -20px rgba(15, 23, 42, 0.18);
padding: 1.5rem;
padding-bottom: calc(1.5rem + var(--archify-nav-reserve));
overflow: hidden;
@@ -942,6 +823,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-animate] {
animation: none !important;
}
+ html:not([data-motion-capable="true"]) svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: none !important;
+ }
html[data-motion="still"] .pulse-dot,
html[data-motion="still"] .diagram-container::before,
html[data-motion="still"] svg[data-animation="trace"] [data-animate],
@@ -954,7 +838,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-share-playback="true"] .diagram-container::before,
html[data-document-hidden="true"] .pulse-dot,
html[data-document-hidden="true"] .diagram-container::before,
- html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate] {
+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-animate],
+ html[data-motion="still"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-motion-owner] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-document-hidden="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
animation: none !important;
}
html[data-motion="still"] .diagram-container::before,
@@ -963,43 +852,21 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-share-playback="true"] .diagram-container::before {
opacity: 0;
}
- html[data-motion="still"] .guided-view-progress span,
- html[data-motion="still"] .guided-story-caption,
- html[data-motion="still"] .story-trail-flow,
html[data-motion="still"] .intent-trace-flow,
html[data-motion="still"] .route-probe-flow,
html[data-motion="still"] .route-journey-flow,
html[data-motion="still"] .semantic-lens-flow,
html[data-motion="still"] .diagram-guide,
- html[data-motion="still"] [data-story-step],
html[data-motion="still"] .overview-map-live,
- html[data-motion="still"] .guided-view-stop,
- html[data-motion="still"] .share-chapter-cue,
- html[data-motion="still"] .share-chapter-state::before,
- html[data-motion="still"] .share-chapter-progress span,
- html[data-document-hidden="true"] .guided-view-progress span,
- html[data-document-hidden="true"] .story-trail-flow,
html[data-document-hidden="true"] .intent-trace-flow,
html[data-document-hidden="true"] .route-probe-flow,
html[data-document-hidden="true"] .route-journey-flow,
html[data-document-hidden="true"] .semantic-lens-flow,
html[data-document-hidden="true"] .diagram-guide,
- html[data-document-hidden="true"] [data-story-step],
- html[data-document-hidden="true"] .overview-map-live,
- html[data-document-hidden="true"] .guided-view-stop,
- html[data-document-hidden="true"] .share-chapter-cue,
- html[data-document-hidden="true"] .share-chapter-state::before,
- html[data-document-hidden="true"] .share-chapter-progress span {
+ html[data-document-hidden="true"] .overview-map-live {
animation: none !important;
}
- html[data-motion="still"] .guided-view-progress span {
- transform: scaleX(1) !important;
- }
- html[data-motion="still"] svg[data-story-playing="true"] .story-trail-flow {
- stroke-dasharray: none;
- stroke-dashoffset: 0;
- opacity: 0.55;
- }
+
html[data-motion="still"] .intent-trace-flow,
html[data-motion="still"] .route-probe-flow {
stroke-dasharray: none;
@@ -1008,12 +875,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
html[data-motion="still"] .route-journey-overlay,
html[data-document-hidden="true"] .route-journey-overlay { display: none !important; }
- html[data-motion="still"] .relationship-pulse-overlay,
- html[data-motion="still"] .story-carrier-overlay,
- html[data-document-hidden="true"] .story-carrier-overlay { display: none !important; }
- html[data-motion="still"] .chapter-handoff-overlay { display: none !important; }
- html[data-motion="still"] .chapter-handoff-anchor { animation: none !important; }
- html[data-motion="still"] .guided-view-chapter,
+ html[data-motion="still"] .relationship-pulse-overlay { display: none !important; }
+
html[data-motion="still"] svg [data-node-id],
html[data-motion="still"] svg [data-edge-from],
html[data-motion="still"] svg [data-detail],
@@ -1024,6 +887,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg {
+ font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
width: 100%;
min-width: min(900px, 100%);
display: block;
@@ -1044,23 +908,23 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
right: 1rem;
bottom: 1rem;
z-index: 12;
+ translate: 0 calc(-1 * var(--archify-dock-lift, 0px));
display: inline-flex;
align-items: center;
max-width: calc(100% - 2rem);
- padding: 0.15rem;
- gap: 0;
+ padding: 0.25rem;
+ gap: 0.0625rem;
overflow-x: auto;
- border: 1px solid color-mix(in srgb, var(--toolbar-border) 48%, transparent);
- border-radius: 0.58rem;
- background: color-mix(in srgb, var(--toolbar-bg) 82%, transparent);
- box-shadow: 0 5px 14px rgba(0, 0, 0, 0.07);
- backdrop-filter: blur(10px);
+ border: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
+ border-radius: 0.75rem;
+ background: color-mix(in srgb, var(--panel) 84%, transparent);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -14px rgba(15, 23, 42, 0.28);
+ backdrop-filter: blur(14px) saturate(1.2);
scrollbar-width: none;
}
.diagram-nav::-webkit-scrollbar { display: none; }
.diagram-nav button,
- .focus-chip button,
- .guided-views button {
+ .focus-chip button {
border: 0;
background: transparent;
color: var(--toolbar-text);
@@ -1070,56 +934,62 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.diagram-nav button {
min-width: 2rem;
height: 2rem;
- padding: 0 0.35rem;
- border-radius: 0.35rem;
- color: color-mix(in srgb, var(--toolbar-text) 68%, transparent);
- font-size: 0.56rem;
- font-weight: 600;
- letter-spacing: 0.02em;
+ padding: 0 0.4rem;
+ border-radius: 0.5rem;
+ color: var(--text-muted);
+ font-size: 0.75rem;
+ font-weight: 500;
+ letter-spacing: 0;
transition: background 0.15s, color 0.15s;
}
.diagram-nav button:hover,
+ .diagram-nav button:focus-visible {
+ color: var(--text);
+ background: color-mix(in srgb, var(--text) 6%, transparent);
+ }
+ .diagram-nav button:hover,
.diagram-nav button:focus-visible,
.focus-chip button:hover,
- .focus-chip button:focus-visible,
- .guided-views button:hover,
- .guided-views button:focus-visible { background: var(--toolbar-hover); }
+ .focus-chip button:focus-visible { background: var(--toolbar-hover); }
.diagram-nav button:focus-visible,
- .focus-chip button:focus-visible,
- .guided-views button:focus-visible {
+ .focus-chip button:focus-visible {
outline: 2px solid var(--frontend-stroke);
outline-offset: 1px;
}
.diagram-nav button:disabled { opacity: 0.38; cursor: default; }
+ /* The Guide stays on the ? shortcut; Map only earns dock space once the
+ reader has zoomed past the full diagram (or opened it from the keyboard). */
+ .diagram-nav button[hidden] { display: none; }
+ .diagram-container:not(.is-pannable) #btn-overview-map:not([data-radar-requested]):not(:focus) { display: none; }
.diagram-nav button:disabled:hover { background: transparent; }
.diagram-nav #btn-route-probe,
.diagram-nav #btn-overview-map,
.diagram-nav #btn-semantic-lens {
min-width: auto;
- padding-inline: 0.5rem;
- color: color-mix(in srgb, var(--toolbar-text) 86%, transparent);
- font-weight: 650;
+ padding-inline: 0.6rem;
+ color: var(--text-muted);
+ font-weight: 500;
}
.diagram-nav #btn-node-finder,
.diagram-nav [data-view="out"] {
position: relative;
- margin-left: 0.25rem;
+ margin-left: 0.375rem;
}
.diagram-nav #btn-node-finder::before,
.diagram-nav [data-view="out"]::before {
position: absolute;
- top: 0.4rem;
- bottom: 0.4rem;
- left: -0.13rem;
+ top: 0.55rem;
+ bottom: 0.55rem;
+ left: -0.19rem;
width: 1px;
- background: color-mix(in srgb, var(--toolbar-border) 62%, transparent);
+ background: color-mix(in srgb, var(--panel-border) 90%, transparent);
content: "";
pointer-events: none;
}
.diagram-nav-icon {
display: block;
- width: 0.72rem;
- height: 0.72rem;
+ width: 0.875rem;
+ height: 0.875rem;
margin: auto;
background: currentColor;
-webkit-mask-position: center;
@@ -1164,11 +1034,56 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
letter-spacing: 0.07em;
}
.diagram-nav-percent {
- color: color-mix(in srgb, var(--toolbar-text) 84%, transparent);
- font-size: 0.55rem;
- font-weight: 650;
+ color: var(--text-muted);
+ font-size: 0.75rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
line-height: 1;
}
+ /* Mode buttons carry a small glyph so the dock reads as one icon language. */
+ .diagram-nav #btn-route-probe,
+ .diagram-nav #btn-overview-map,
+ .diagram-nav #btn-semantic-lens {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+ padding-inline: 0.55rem 0.65rem;
+ }
+ .diagram-nav #btn-route-probe::before,
+ .diagram-nav #btn-overview-map::before,
+ .diagram-nav #btn-semantic-lens::before {
+ flex: none;
+ width: 0.875rem;
+ height: 0.875rem;
+ background: currentColor;
+ content: "";
+ opacity: 0.85;
+ -webkit-mask: var(--nav-glyph) center / contain no-repeat;
+ mask: var(--nav-glyph) center / contain no-repeat;
+ }
+ .diagram-nav #btn-route-probe { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='4.8' cy='14.8' r='2.2'/%3E%3Ccircle cx='15.2' cy='5.2' r='2.2'/%3E%3Cpath d='M6.9 13.9c3.8-1.4 2.6-6.3 6.2-7.8'/%3E%3C/g%3E%3C/svg%3E"); }
+ .diagram-nav #btn-overview-map { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M2.8 5.4 7.4 3.5l5.2 2 4.6-1.9v11l-4.6 1.9-5.2-2-4.6 1.9z'/%3E%3Cpath d='M7.4 3.5v11M12.6 5.5v11'/%3E%3C/g%3E%3C/svg%3E"); }
+ .diagram-nav #btn-semantic-lens { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.7'%3E%3Ccircle cx='10' cy='10' r='6.8'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/g%3E%3C/svg%3E"); }
+ /* Zoom out / level / zoom in join into one stepper well. */
+ .diagram-nav [data-view="out"],
+ .diagram-nav [data-view="reset"],
+ .diagram-nav [data-view="in"] {
+ border-radius: 0;
+ background: color-mix(in srgb, var(--text) 4.5%, transparent);
+ }
+ .diagram-nav [data-view="out"] { margin-left: 0.375rem; border-radius: 0.5rem 0 0 0.5rem; }
+ .diagram-nav [data-view="out"]::before { display: none; }
+ .diagram-nav [data-view="reset"],
+ .diagram-nav [data-view="in"] { margin-left: -0.0625rem; }
+ .diagram-nav [data-view="in"] { border-radius: 0 0.5rem 0.5rem 0; }
+ .diagram-nav [data-view="out"]:hover,
+ .diagram-nav [data-view="reset"]:hover,
+ .diagram-nav [data-view="in"]:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
+ .diagram-nav [data-view="out"]:disabled,
+ .diagram-nav [data-view="in"]:disabled { opacity: 1; color: color-mix(in srgb, var(--text-muted) 40%, transparent); }
+ .diagram-nav [data-view="out"]:disabled:hover,
+ .diagram-nav [data-view="in"]:disabled:hover { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
+ .diagram-nav [data-view="reset"] { min-width: 3.25rem; }
.diagram-container[data-camera-indicator="true"] .diagram-nav-detail,
.diagram-container[data-camera-indicator="true"] .diagram-nav-percent { color: var(--frontend-stroke); }
.diagram-nav #btn-diagram-guide[aria-expanded="true"] {
@@ -1392,7 +1307,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.diagram-nav #btn-overview-map[aria-expanded="true"] {
color: var(--frontend-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--frontend-stroke) 11%, transparent);
}
.overview-map-feedback {
position: absolute;
@@ -1414,12 +1329,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.focus-chip[data-radar-yielded="true"] { display: none !important; }
.diagram-nav #btn-route-probe[aria-pressed="true"] {
color: var(--backend-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--backend-stroke) 11%, transparent);
}
.diagram-nav #btn-semantic-lens[aria-expanded="true"],
.diagram-nav #btn-semantic-lens[aria-pressed="true"] {
color: var(--database-stroke);
- background: var(--toolbar-hover);
+ background: color-mix(in srgb, var(--database-stroke) 11%, transparent);
}
/* Semantic Lens turns the compiled node-kind palette into an analytical
@@ -1616,9 +1531,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--toolbar-text);
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(16px);
- font-size: 0.625rem;
+ font-size: 0.75rem;
}
.route-probe[hidden] { display: none; }
+ /* Picking needs one line of guidance, not a wide empty card; the panel
+ widens only when there is a traced route to show. */
+ .route-probe:not([data-state="result"]) { width: min(22rem, calc(100% - 2rem)); min-width: 0; }
+ .route-probe-path:has(> .route-probe-placeholder:only-child) { display: none; }
.route-probe[data-route-dock="top"] {
top: 1rem;
bottom: auto;
@@ -1629,25 +1548,25 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
gap: 0.65rem;
- padding: 0.52rem 0.58rem 0.44rem;
+ padding: 0.625rem 0.75rem 0.5rem;
border-bottom: 1px solid color-mix(in srgb, var(--toolbar-border) 80%, transparent);
}
.route-probe-copy { min-width: 0; }
.route-probe-eyebrow {
display: block;
color: var(--backend-stroke);
- font-size: 0.48rem;
- font-weight: 800;
- letter-spacing: 0.15em;
- text-transform: uppercase;
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.02em;
}
.route-probe-title {
display: block;
margin-top: 0.14rem;
overflow: hidden;
color: var(--toolbar-text);
- font-size: 0.72rem;
- line-height: 1.25;
+ font-size: 0.875rem;
+ font-weight: 600;
+ line-height: 1.3;
white-space: nowrap;
text-overflow: ellipsis;
}
@@ -1728,16 +1647,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.route-probe-placeholder {
color: var(--text-faint);
- font-size: 0.56rem;
- letter-spacing: 0.03em;
+ font-size: 0.75rem;
}
.route-probe-status {
display: block;
min-height: 1.45rem;
- padding: 0.08rem 0.58rem 0.44rem;
- color: var(--text-faint);
- font-size: 0.52rem;
- line-height: 1.35;
+ padding: 0.5rem 0.75rem 0.625rem;
+ color: var(--text-muted, var(--text-faint));
+ font-size: 0.75rem;
+ line-height: 1.45;
}
.route-journey-controls {
display: grid;
@@ -1795,14 +1713,40 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
font-size: 0.625rem;
}
.relationship-lens-head {
+ position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
gap: 0.75rem;
- padding: 0.7rem 0.75rem 0.65rem;
+ padding: 0.9rem 0.75rem 0.65rem;
border-bottom: 1px solid var(--toolbar-border);
background: linear-gradient(120deg, color-mix(in srgb, var(--frontend-fill) 34%, transparent), transparent 72%);
}
+ .relationship-lens-drag-handle {
+ position: absolute;
+ top: 0.12rem;
+ left: 50%;
+ width: 2.5rem;
+ height: 0.78rem;
+ padding: 0 !important;
+ transform: translateX(-50%);
+ color: var(--text-faint) !important;
+ cursor: grab;
+ touch-action: none;
+ user-select: none;
+ }
+ .relationship-lens-drag-handle::before {
+ content: "";
+ display: block;
+ width: 1.25rem;
+ margin: auto;
+ border-top: 2px dotted currentColor;
+ opacity: 0.72;
+ }
+ .focus-chip[data-panel-dragging="true"] .relationship-lens-drag-handle { cursor: grabbing; }
+ @media (hover: none), (pointer: coarse) {
+ .relationship-lens-drag-handle { display: none; }
+ }
.relationship-lens-copy { min-width: 0; }
.relationship-lens-actions {
display: flex;
@@ -1950,8 +1894,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
color: var(--text-muted);
text-decoration: none;
}
- .semantic-passport-source:hover,
- .semantic-passport-source:focus-visible {
+ a.semantic-passport-source:hover,
+ a.semantic-passport-source:focus-visible {
border-color: color-mix(in srgb, var(--backend-stroke) 42%, transparent);
background: color-mix(in srgb, var(--backend-fill) 32%, transparent);
color: var(--text);
@@ -2228,7 +2172,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.diagram-guide-action[data-guide-action="route"] { --guide-accent: var(--backend-stroke); }
.diagram-guide-action[data-guide-action="map"] { --guide-accent: var(--database-stroke); }
.diagram-guide-action[data-guide-action="lens"] { --guide-accent: var(--messagebus-stroke); }
- .diagram-guide-action[data-guide-action="story"] { --guide-accent: var(--security-stroke); }
+
.diagram-guide-action[data-guide-action="present"] {
--guide-accent: var(--cloud-stroke);
}
@@ -2502,564 +2446,443 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
font-size: 0.5625rem;
}
- .guided-views {
+ .cards {
display: grid;
- grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem auto;
- align-items: stretch;
- gap: 0.35rem;
- min-width: 0;
- margin: 0 0 0.75rem;
- padding: 0.35rem;
- border: 1px solid var(--toolbar-border);
- border-radius: 0.85rem;
- background: var(--toolbar-bg);
- background: linear-gradient(120deg, var(--toolbar-bg), color-mix(in srgb, var(--toolbar-bg) 82%, var(--frontend-fill)));
- box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
- backdrop-filter: blur(12px);
+ grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
+ gap: 1rem;
+ margin-top: 2rem;
}
- .guided-views[hidden] { display: none; }
- html[data-preset="blueprint"] .guided-views {
- border-color: var(--panel-border);
- border-radius: 0.35rem;
- background:
- linear-gradient(90deg, color-mix(in srgb, var(--frontend-fill) 36%, transparent), transparent 24%),
- var(--toolbar-bg);
- box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
- }
- html[data-preset="blueprint"] .guided-views button { border-radius: 0.2rem; }
- html[data-preset="blueprint"] .guided-view-progress { border-radius: 0; }
- html[data-preset="blueprint"] .guided-view-progress span { border-radius: 0; }
- .guided-views button {
- min-width: 0;
- padding: 0.45rem 0.6rem;
- border-radius: 0.55rem;
- font-size: 0.75rem;
- }
- .guided-views > #guided-view-prev,
- .guided-views > #guided-view-next { min-width: 2.75rem; min-height: 2.75rem; }
- .guided-views button:disabled { opacity: 0.3; cursor: default; }
- .guided-view-copy {
- min-width: 0;
- padding: 0.2rem 0.5rem;
- border-left: 1px solid var(--toolbar-border);
- overflow: hidden;
+ .card {
+ background: var(--panel);
+ border-radius: 0.75rem;
+ border: 1px solid var(--panel-border);
+ padding: 1.125rem 1.25rem;
}
- .guided-view-meta {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- min-height: 1rem;
- margin-bottom: 0.12rem;
- color: var(--frontend-stroke);
- font-size: 0.5625rem;
- font-weight: 700;
- letter-spacing: 0.12em;
- text-transform: uppercase;
+
+ html[data-preset="signal-flow"] .card {
+ background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
- .guided-view-handoff {
- box-sizing: border-box;
- height: 1rem;
- min-width: 0;
- max-width: 15rem;
- overflow: hidden;
- padding: 0 0.38rem;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 46%, transparent);
- border-radius: 999px;
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-fill) 44%, transparent);
- font-size: 0.5rem;
- line-height: calc(1rem - 2px);
- letter-spacing: 0.06em;
- text-overflow: ellipsis;
- white-space: nowrap;
+ html[data-preset="signal-flow"][data-theme="light"] .card {
+ background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
}
- .guided-view-handoff[hidden] { display: none; }
- html[data-preset="blueprint"] .guided-view-handoff { border-radius: 0.15rem; }
- .chapter-handoff-overlay { pointer-events: none; }
- .chapter-handoff-anchor {
- fill: color-mix(in srgb, var(--frontend-fill) 10%, transparent);
- stroke: var(--frontend-stroke);
- stroke-width: 2;
- stroke-dasharray: 4 4;
- vector-effect: non-scaling-stroke;
- opacity: 0.96;
- animation: archify-chapter-anchor 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
+
+ /* Preserve the one-screen guarantee on ordinary laptop displays. The
+ high-screen expansion above must not trade a fuller canvas for page
+ scrolling at 900–1080px heights. */
+ @media (min-width: 768px) and (max-height: 1100px) {
+ .header { margin-bottom: 1rem; }
+ .diagram-container {
+ padding: 0.875rem;
+ padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
+ }
+ .cards { margin-top: 1rem; }
+ .card { padding: 1rem; }
}
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="stay"] { opacity: 1; }
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="enter"] { opacity: 0.78; }
- svg[data-chapter-handoff] [data-node-id][data-chapter-role="leave"] { opacity: 0.26; }
- @keyframes archify-chapter-anchor {
- 0% { opacity: 0.35; stroke-dashoffset: 8; }
- 45% { opacity: 1; }
- 100% { opacity: 0.72; stroke-dashoffset: 0; }
+ @media (min-width: 768px) and (max-height: 920px) {
+ body { padding-block: 1.25rem; }
+ body { --archify-page-top: 1.25rem; }
+ .header { margin-bottom: 0.875rem; }
+ .cards { margin-top: 0.75rem; }
+ html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
+ /* Align the fixed toolbar with the compact title row. Reserve its hit area
+ above the guide without taking extra height from a fitted diagram. */
+ html[data-nav-stage-rail="true"] .toolbar { top: 0.25rem; }
+ html[data-nav-stage-rail="true"] .header { min-height: 2.625rem; margin-bottom: 0.5rem; }
+ html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
+ html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
}
- .guided-view-progress {
- width: 3.5rem;
- height: 2px;
- overflow: hidden;
- border-radius: 999px;
- background: var(--toolbar-border);
+
+ html[data-preset="blueprint"] .card {
+ position: relative;
+ border-color: var(--panel-border);
+ border-radius: 0.3rem;
+ background: var(--panel);
+ box-shadow: none;
}
- .guided-view-progress span {
- display: block;
- width: 100%;
- height: 100%;
- border-radius: inherit;
- background: var(--frontend-stroke);
- transform: scaleX(0);
- transform-origin: left center;
- }
- .guided-view-copy strong,
- .guided-view-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
- .guided-view-copy strong { color: var(--toolbar-text); font-size: 0.75rem; line-height: 1.35; }
- .guided-view-copy small { margin-top: 0; color: var(--text-muted); font-size: 0.625rem; line-height: 1.35; }
- .guided-story-caption {
- display: grid;
- grid-template-columns: auto minmax(0, 1fr) auto;
- gap: 0.12rem 0.55rem;
- align-items: center;
- min-width: 0;
- margin-top: 0.18rem;
- padding: 0.3rem 0.5rem;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 32%, var(--toolbar-border));
- border-radius: 0.58rem;
- background: color-mix(in srgb, var(--frontend-fill) 26%, transparent);
- animation: archify-story-caption-in 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- .guided-story-caption[hidden] { display: none; }
- .guided-story-caption-index {
- grid-row: 1 / span 2;
- align-self: stretch;
- display: inline-grid;
- min-width: 3.3rem;
- place-items: center;
- padding-right: 0.52rem;
- border-right: 1px solid color-mix(in srgb, var(--frontend-stroke) 28%, var(--toolbar-border));
- color: var(--frontend-stroke);
- font-size: 0.5625rem;
- font-weight: 800;
- letter-spacing: 0.08em;
- text-transform: uppercase;
+ html[data-preset="blueprint"] .card::before {
+ content: "";
+ position: absolute;
+ top: -1px;
+ left: 1rem;
+ width: 2.5rem;
+ border-top: 2px solid var(--frontend-stroke);
}
- .guided-story-caption strong,
- .guided-story-caption small {
- display: block;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+
+ html[data-preset="editorial"] .card {
+ position: relative;
+ border-radius: 0.28rem;
+ background: var(--panel);
+ box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
}
- .guided-story-caption strong { color: var(--toolbar-text); font-size: 0.6875rem; line-height: 1.3; }
- .guided-story-caption small { color: var(--text-muted); font-size: 0.5625rem; line-height: 1.35; }
- .guided-story-caption-next {
- grid-column: 3;
- grid-row: 1 / span 2;
- display: grid;
- min-width: 6.4rem;
- max-width: 9.5rem;
- align-self: stretch;
- align-content: center;
- padding-left: 0.58rem;
- border-left: 1px solid color-mix(in srgb, var(--frontend-stroke) 22%, var(--toolbar-border));
+ html[data-preset="editorial"] .card::before {
+ position: absolute;
+ top: -1px;
+ left: 1.25rem;
+ width: 3.25rem;
+ border-top: 3px solid var(--arrow-emphasis);
+ content: "";
}
- .guided-story-caption-next[hidden] { display: none; }
- .guided-story-caption-next small {
- color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--text-muted));
- font-weight: 800;
- letter-spacing: 0.09em;
- text-transform: uppercase;
+ html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
+
+ /* Summary rail: the reader measures the viewport and enables it only when the
+ diagram keeps its readable width beside the notes. */
+ .reader-rail { display: contents; }
+ html[data-reader-rail="true"] .container {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) var(--archify-rail-width);
+ grid-auto-flow: row dense;
+ column-gap: var(--archify-rail-gap);
+ align-items: start;
}
- .guided-story-caption-next strong { color: var(--text-muted); font-weight: 700; }
- html[data-preset="blueprint"] .guided-story-caption { border-radius: 0.2rem; }
- .guided-views[data-story-beat] .guided-view-copy > #guided-view-label,
- .guided-views[data-story-beat] .guided-view-copy > #guided-view-note { display: none; }
- @keyframes archify-story-caption-in {
- from { opacity: 0; transform: translateY(3px); }
- to { opacity: 1; transform: translateY(0); }
+ html[data-reader-rail="true"] .container > .header { grid-column: 1 / -1; }
+ html[data-reader-rail="true"] .container > .diagram-container { grid-column: 1; }
+ /* The rail is at least the diagram's height and may run on to the viewport
+ floor (--archify-rail-max, set by the reader); past that, notes scroll and
+ the index keeps a usable share instead of collapsing to its header. */
+ html[data-reader-rail="true"] .reader-rail {
+ display: flex;
+ flex-direction: column;
+ grid-column: 2;
+ align-self: stretch;
+ min-height: 0;
+ max-height: var(--archify-rail-max, none);
}
- .guided-view-trail {
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards {
display: flex;
- align-items: center;
- gap: 0.28rem;
- min-width: 0;
- min-height: 1.7rem;
+ flex: 0 1 auto;
+ flex-direction: column;
+ gap: 0;
+ min-height: 0;
margin-top: 0;
- padding: 0;
- overflow-x: auto;
- color: var(--text-faint);
- overscroll-behavior-x: contain;
- touch-action: pan-x;
+ padding: 0.125rem 0 0;
+ overflow-y: auto;
scrollbar-width: none;
- white-space: nowrap;
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
}
- .guided-view-trail[hidden] { display: none; }
- .guided-view-trail::-webkit-scrollbar { display: none; }
- .guided-view-trail .guided-view-stop {
- appearance: none;
- box-sizing: border-box;
- display: inline-flex;
- flex: 0 0 auto;
- align-items: center;
- gap: 0.28rem;
- min-height: 1.5rem;
- padding: 0.1rem 0.3rem 0.1rem 0.18rem;
- border: 1px solid transparent;
- border-radius: 999px;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards::-webkit-scrollbar { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card { flex: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card {
+ padding: 0 0.25rem 1.125rem;
+ border: 0;
+ border-radius: 0;
background: transparent;
- color: var(--text-muted);
- cursor: pointer;
- font-family: inherit;
- font-size: 0.5625rem;
- font-weight: 650;
- letter-spacing: 0.02em;
- line-height: 1;
- transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
+ box-shadow: none;
}
- .guided-view-stop:hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);
- background: color-mix(in srgb, var(--frontend-fill) 34%, transparent);
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card + .card {
+ padding-top: 1.125rem;
+ border-top: 1px solid var(--panel-border);
}
- .guided-view-stop:focus-visible {
- outline: 2px solid var(--frontend-stroke);
- outline-offset: 1px;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card::before { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .card-header { gap: 0.55rem; margin-bottom: 0.45rem; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card h3 { font-size: 0.875rem; letter-spacing: -0.005em; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards .card ul { font-size: 0.8125rem; line-height: 1.6; }
+
+ .node-outline { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .node-outline:not([hidden]) {
+ display: flex;
+ flex: 1 0 min(13rem, 55%);
+ flex-direction: column;
+ min-height: 0;
+ margin-top: 0.25rem;
+ overflow: hidden;
+ border-top: 1px solid var(--panel-border);
}
- .guided-view-stop:disabled { cursor: wait; }
- .guided-view-stop::before {
- display: inline-grid;
- width: 1rem;
- height: 1rem;
- place-items: center;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));
- border-radius: 50%;
- background: color-mix(in srgb, var(--frontend-fill) 58%, var(--toolbar-bg));
- color: var(--frontend-stroke);
- content: attr(data-story-number);
- font-size: 0.5rem;
- line-height: 1;
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"]) .cards:empty + .node-outline:not([hidden]) { margin-top: 0; border-top: 0; }
+ /* Collapsed: only the reveal control remains, so the diagram takes the width. */
+ html[data-reader-rail="collapsed"] .reader-rail { display: none; }
+ /* Overlay: a drawer for diagrams whose readable floor leaves no room to dock. */
+ html[data-reader-rail="overlay"] .reader-rail {
+ position: fixed;
+ z-index: 150;
+ top: 1rem;
+ right: 1rem;
+ bottom: 1rem;
+ display: flex;
+ flex-direction: column;
+ width: var(--archify-rail-width);
+ padding: 0.75rem 1rem 0.5rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
+ border-radius: 1rem;
+ background: var(--toolbar-menu-bg);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 28px 64px -18px rgba(15, 23, 42, 0.38);
+ animation: rail-drawer-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
- .guided-view-stop + .guided-view-stop::after {
- order: -1;
- color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--text-faint));
- content: '\00b7';
- font-size: 0.65rem;
+ @keyframes rail-drawer-in {
+ from { opacity: 0; transform: translateX(0.75rem); }
+ to { opacity: 1; transform: translateX(0); }
}
- .guided-view-stop[data-story-link="forward"]::after { content: '\2192'; }
- .guided-view-stop[data-story-link="reverse"]::after { content: '\2190'; }
- .guided-view-stop[data-story-link="multiple"]::after { content: '\21c4'; }
- .guided-view-stop[data-story-beat-state="pending"] { opacity: 0.38; }
- .guided-view-stop[data-story-beat-state="next"] {
- border-style: dashed;
- border-color: color-mix(in srgb, var(--frontend-stroke) 42%, var(--toolbar-border));
- color: color-mix(in srgb, var(--toolbar-text) 68%, var(--text-muted));
- opacity: 0.58;
+ /* Bottom (default): the notes keep their full-width card row and the index
+ follows as one panel whose groups flow into columns, so nothing scrolls
+ inside it. The placement toggle sits in the index header. */
+ html[data-reader-rail="bottom"] .reader-rail {
+ display: grid;
+ grid-template-areas: "cards" "index";
+ grid-template-columns: minmax(0, 1fr);
+ row-gap: 1rem;
+ margin-top: 1rem;
}
- .guided-view-stop[data-story-beat-state="past"] { color: var(--text-muted); opacity: 0.76; }
- .guided-view-stop[data-story-beat-state="active"] {
- border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border));
- background: color-mix(in srgb, var(--frontend-fill) 42%, transparent);
- color: var(--toolbar-text);
- font-weight: 800;
- opacity: 1;
+ html[data-reader-rail="bottom"] .cards { grid-area: cards; margin-top: 0; }
+ html[data-reader-rail="bottom"] .cards:empty { display: none; }
+ html[data-reader-rail="bottom"] .node-outline:not([hidden]) {
+ display: block;
+ grid-area: index;
+ padding: 0 1.25rem 0.75rem;
+ border: 1px solid var(--panel-border);
+ border-radius: 0.75rem;
+ background: var(--panel);
}
- .guided-view-stop[data-story-beat-state="active"]::before {
- border-color: var(--frontend-stroke);
- box-shadow: 0 0 10px color-mix(in srgb, var(--frontend-stroke) 54%, transparent);
- }
- html[data-preset="blueprint"] .guided-view-stop,
- html[data-preset="blueprint"] .guided-view-stop::before { border-radius: 0.1rem; }
- html[data-preset="blueprint"] .guided-view-stop[data-story-beat-state="active"]::before { box-shadow: none; }
- .guided-view-actions { display: flex; align-items: stretch; gap: 0.2rem; }
- .guided-view-actions button { white-space: nowrap; }
- .guided-view-play {
+ html[data-reader-rail="bottom"] .reader-rail > .rail-controls {
+ z-index: 1;
+ grid-area: index;
+ align-self: start;
+ justify-self: end;
+ margin: 0.625rem 0.625rem 0 0;
+ }
+ html[data-reader-rail="bottom"] .node-outline-head { padding: 1rem 2.5rem 0.375rem 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-list {
+ columns: 15rem;
+ column-gap: 1.75rem;
+ padding: 0;
+ overflow: visible;
+ -webkit-mask-image: none;
+ mask-image: none;
+ }
+ /* Named groups stay whole; a single unnamed group may split across columns,
+ where a continuous spine would read as a broken line. */
+ html[data-reader-rail="bottom"] .node-outline-group + .node-outline-group { margin-top: 0; }
+ html[data-reader-rail="bottom"] .node-outline-group:has(> .node-outline-heading) { break-inside: avoid; padding-bottom: 0.25rem; }
+ html[data-reader-rail="bottom"] .node-outline-group:not(:has(> .node-outline-heading)) > ul::before { display: none; }
+ html[data-reader-rail="bottom"] .node-outline-group li { break-inside: avoid; }
+ .rail-controls { display: none; }
+ html:is([data-reader-rail="true"], [data-reader-rail="overlay"], [data-reader-rail="bottom"]) .rail-controls {
+ display: flex;
+ flex: none;
+ justify-content: flex-end;
+ gap: 0.125rem;
+ margin: -0.25rem -0.25rem 0.25rem 0;
+ }
+ .rail-control {
+ display: inline-grid;
+ place-items: center;
+ width: 1.875rem;
+ height: 1.875rem;
+ border: 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: background 0.14s ease, color 0.14s ease;
+ }
+ .rail-control[hidden] { display: none; }
+ .rail-control:hover,
+ .rail-control:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
+ .rail-control:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: -1.5px; }
+ .rail-control-icon,
+ .rail-reveal-icon {
+ width: 1rem;
+ height: 1rem;
+ background: currentColor;
+ -webkit-mask: var(--rail-glyph) center / contain no-repeat;
+ mask: var(--rail-glyph) center / contain no-repeat;
+ }
+ /* Panel glyphs: a frame with the panel drawn on the side it moves to. */
+ .rail-control-icon.placement,
+ #rail-placement[data-placement="right"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M2.8 12h14.4'/%3E%3C/g%3E%3C/svg%3E"); }
+ #rail-placement[data-placement="bottom"] .rail-control-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4'/%3E%3C/g%3E%3C/svg%3E"); }
+ .rail-control-icon.collapse { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m8 5.5 4.5 4.5L8 14.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
+ .rail-reveal-icon { --rail-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='2.8' y='3.8' width='14.4' height='12.4' rx='2'/%3E%3Cpath d='M12.6 3.8v12.4M14.4 7.2h1M14.4 9.6h1M14.4 12h1'/%3E%3C/g%3E%3C/svg%3E"); }
+ .rail-reveal[hidden] { display: none; }
+ /* The collapsed rail leaves one quiet pill in the canvas corner. */
+ .rail-reveal {
+ position: absolute;
+ z-index: 13;
+ top: 0.75rem;
+ right: 0.75rem;
display: inline-flex;
align-items: center;
- justify-content: center;
- gap: 0.38rem;
- min-width: 6.25rem !important;
- color: var(--frontend-stroke) !important;
- font-size: 0.625rem !important;
+ gap: 0.45rem;
+ min-height: 2rem;
+ padding: 0 0.75rem 0 0.625rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--panel) 86%, transparent);
+ color: var(--text-muted);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 20px -12px rgba(15, 23, 42, 0.28);
+ backdrop-filter: blur(12px);
+ font: inherit;
+ font-size: 0.75rem;
+ font-weight: 500;
+ cursor: pointer;
+ transition: color 0.14s ease, background 0.14s ease;
}
- .guided-view-play[aria-pressed="true"] { background: var(--toolbar-hover); }
- .guided-view-all { min-width: 3.25rem !important; color: var(--text-muted) !important; font-size: 0.625rem !important; }
- .guided-view-beat-link {
- display: inline-flex;
+ .rail-reveal:hover,
+ .rail-reveal:focus-visible { color: var(--text); background: var(--panel); }
+ .rail-reveal:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 60%, transparent); outline-offset: 2px; }
+ html[data-motion="still"] .reader-rail { animation: none !important; }
+ .node-outline-head {
+ display: flex;
align-items: center;
- justify-content: center;
- gap: 0.3rem;
- min-width: 5.4rem !important;
- min-height: 1.5rem;
- color: var(--text-muted) !important;
- font-size: 0.5625rem !important;
- letter-spacing: 0.025em;
- transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
+ gap: 0.5rem;
+ padding: 1.125rem 0.25rem 0.375rem;
}
- .guided-view-beat-link:not(:disabled):hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 52%, var(--toolbar-border));
- color: var(--frontend-stroke) !important;
+ .node-outline-head strong {
+ color: var(--text);
+ font-size: 0.875rem;
+ font-weight: 600;
+ letter-spacing: -0.005em;
}
- .guided-view-beat-link[data-copy-state="copied"] {
- border-color: color-mix(in srgb, var(--backend-stroke) 58%, var(--toolbar-border));
- background: color-mix(in srgb, var(--backend-fill) 46%, transparent);
- color: var(--backend-stroke) !important;
+ .node-outline-count {
+ min-width: 1.35rem;
+ padding: 0.1rem 0.4rem;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 6%, transparent);
+ color: var(--text-muted);
+ font-size: 0.6875rem;
+ font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
+ font-variant-numeric: tabular-nums;
}
- .guided-view-index {
- grid-column: 1 / -1;
- min-width: 0;
- padding: 0.28rem 0.12rem 0.08rem;
- overflow: hidden;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- @media (min-width: 721px) {
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-index,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-beat-link,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-all,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-trail,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-label,
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-view-copy > #guided-view-note { display: none; }
- html[data-present="true"]:not([data-embed="true"]) .guided-views[data-playing="true"] .guided-story-caption { margin-top: 0.08rem; }
- }
- .guided-view-chapters {
- display: flex;
- gap: 0.28rem;
- min-width: 0;
- margin: 0;
- padding: 0.08rem 0.05rem 0.2rem;
- overflow-x: auto;
+ .node-outline-list {
+ flex: 1 1 auto;
+ min-height: 0;
+ margin: 0 -0.375rem;
+ padding: 0 0 1.25rem;
+ overflow-y: auto;
list-style: none;
- scroll-padding-inline: 0.05rem;
- scroll-snap-type: x proximity;
scrollbar-width: none;
+ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
+ mask-image: linear-gradient(to bottom, #000 calc(100% - 2rem), transparent);
+ }
+ .node-outline-list::-webkit-scrollbar { display: none; }
+ .node-outline-group + .node-outline-group { margin-top: 0.25rem; }
+ .node-outline-group > ul {
+ position: relative;
+ list-style: none;
}
- .guided-view-chapters::-webkit-scrollbar { display: none; }
- .guided-view-chapters li {
+ /* A quiet spine ties each group's swatches together like a lane. */
+ .node-outline-group > ul::before {
+ position: absolute;
+ top: 0.95rem;
+ bottom: 0.95rem;
+ left: calc(0.625rem + 0.3125rem - 0.5px);
+ width: 1px;
+ background: var(--panel-border);
+ content: "";
+ }
+ .node-outline-heading {
display: flex;
- flex: 1 1 0;
- min-width: 9.5rem;
- scroll-snap-align: center;
+ align-items: baseline;
+ justify-content: space-between;
+ padding: 0.7rem 0.625rem 0.25rem;
+ color: var(--text-faint);
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.02em;
}
- .guided-view-chapter {
+ .node-outline-heading small {
+ color: var(--text-dim);
+ font-size: 0.6875rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
+ }
+ /* The rail frees the vertical budget, so compact viewports keep the normal
+ title spacing instead of the stacked layout's tight stage rail. */
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) body { --archify-page-top: 1.5rem; padding-block: 1.5rem; }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .toolbar { top: calc(var(--archify-page-top) - 0.1875rem); }
+ html[data-reader-rail]:not([data-reader-rail="bottom"]) .header { min-height: 0; margin-bottom: 1.125rem; }
+ .node-outline-item {
position: relative;
- display: grid !important;
- grid-template-columns: 1.55rem minmax(0, 1fr) auto;
+ display: grid;
+ grid-template-columns: 0.625rem minmax(0, auto) minmax(0, 1fr) 0.75rem;
align-items: center;
+ column-gap: 0.625rem;
width: 100%;
- min-height: 2.75rem;
- padding: 0.36rem 0.48rem !important;
- overflow: hidden;
- border: 1px solid color-mix(in srgb, var(--toolbar-border) 86%, transparent) !important;
- border-radius: 0.48rem !important;
- background: color-mix(in srgb, var(--toolbar-bg) 88%, transparent) !important;
- color: var(--text-muted) !important;
+ min-height: 1.95rem;
+ padding: 0.28rem 0.5rem 0.28rem 0.625rem;
+ border: 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ color: var(--text);
+ font: inherit;
text-align: left;
- transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
- }
- .guided-view-chapter:hover {
- border-color: color-mix(in srgb, var(--frontend-stroke) 58%, var(--toolbar-border)) !important;
- background: color-mix(in srgb, var(--frontend-fill) 42%, var(--toolbar-bg)) !important;
- }
- .guided-view-chapter:focus-visible {
- outline: 2px solid var(--frontend-stroke);
- outline-offset: 1px;
- }
- .guided-view-chapter-index {
- display: inline-grid;
- width: 1.32rem;
- height: 1.32rem;
- place-items: center;
- border: 1px solid color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));
- border-radius: 50%;
- color: var(--frontend-stroke);
- font-size: 0.5rem;
- font-weight: 800;
- letter-spacing: 0.03em;
+ cursor: pointer;
+ transition: background 0.16s ease;
}
- .guided-view-chapter-title {
- min-width: 0;
+ /* Trailing chevron hints that a click focuses the node. */
+ .node-outline-item::after {
+ grid-column: 4;
+ width: 0.75rem;
+ height: 0.75rem;
+ background: currentColor;
+ color: var(--text-muted);
+ content: "";
+ opacity: 0;
+ transform: translateX(-3px);
+ transition: opacity 0.16s ease, transform 0.16s ease;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 3 3 3-3 3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
+ }
+ .node-outline-item:hover,
+ .node-outline-item:focus-visible,
+ .node-outline-item[data-previewing] { background: color-mix(in srgb, var(--text) 4.5%, transparent); }
+ .node-outline-item:hover::after,
+ .node-outline-item:focus-visible::after { opacity: 0.7; transform: translateX(0); }
+ .node-outline-item:focus-visible { outline: 1.5px solid color-mix(in srgb, var(--outline-tone) 60%, transparent); outline-offset: -1.5px; }
+ .node-outline-item[aria-current="true"] { background: color-mix(in srgb, var(--outline-tone) 10%, transparent); }
+ .node-outline-item[aria-current="true"]::after { opacity: 0; }
+ /* Swatches echo the diagram's node cards: tinted fill, hairline stroke. */
+ .node-outline-dot {
+ width: 0.625rem;
+ height: 0.5rem;
+ border: 1.25px solid var(--outline-tone);
+ border-radius: 0.15rem;
+ background: color-mix(in srgb, var(--outline-tone) 16%, var(--bg));
+ transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
+ }
+ .node-outline-item:hover .node-outline-dot,
+ .node-outline-item:focus-visible .node-outline-dot,
+ .node-outline-item[data-previewing] .node-outline-dot,
+ .node-outline-item[aria-current="true"] .node-outline-dot {
+ background: var(--outline-tone);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--outline-tone) 18%, transparent);
+ transform: scale(1.08);
+ }
+ .node-outline-item strong {
overflow: hidden;
- color: var(--toolbar-text);
- font-size: 0.625rem;
- font-weight: 700;
- line-height: 1.3;
+ font-size: 0.8125rem;
+ font-weight: 500;
text-overflow: ellipsis;
white-space: nowrap;
}
- .guided-view-chapter-count {
- grid-column: 3;
- grid-row: 1;
- margin-left: 0.38rem;
- color: var(--text-faint);
- font-size: 0.5rem;
- font-style: normal;
- font-weight: 650;
- white-space: nowrap;
- }
- .guided-view-chapter-delta {
- display: inline-flex;
- grid-column: 3;
- grid-row: 1;
- align-items: center;
- gap: 0.22rem;
- margin-left: 0.38rem;
+ .node-outline-item[aria-current="true"] strong { font-weight: 600; }
+ .node-outline-item small {
+ overflow: hidden;
color: var(--text-faint);
- font-size: 0.5rem;
- font-weight: 750;
- letter-spacing: 0.01em;
+ font-size: 0.6875rem;
+ text-align: right;
+ text-overflow: ellipsis;
white-space: nowrap;
+ transition: color 0.16s ease;
}
- .guided-view-chapter-delta[hidden] { display: none; }
- .guided-view-chapter-delta [data-delta-kind="stay"] { color: var(--text-muted); }
- .guided-view-chapter-delta [data-delta-kind="enter"] { color: var(--frontend-stroke); }
- .guided-view-chapter-delta [data-delta-kind="leave"] { color: var(--security-stroke); }
- .guided-view-chapter[data-preview-active="true"] {
- border-color: color-mix(in srgb, var(--frontend-stroke) 72%, var(--toolbar-border)) !important;
- background: color-mix(in srgb, var(--frontend-fill) 54%, var(--toolbar-bg)) !important;
- }
- .guided-view-chapter[data-chapter-position="current"] {
- border: 2px solid var(--frontend-stroke) !important;
- padding: calc(0.36rem - 1px) calc(0.48rem - 1px) !important;
- box-shadow: inset 3px 0 0 var(--frontend-stroke);
- color: var(--toolbar-text) !important;
- }
- .guided-view-chapter[data-chapter-position="current"] .guided-view-chapter-index {
- background: var(--frontend-stroke);
- color: var(--bg);
- }
- .guided-view-chapter[data-chapter-position="before"] {
- border-style: solid !important;
- opacity: 0.72;
- }
- .guided-view-chapter[data-chapter-position="after"] { border-style: dashed !important; }
- html[data-preset="signal-flow"] .guided-view-chapter[data-chapter-position="current"] {
- box-shadow: inset 3px 0 0 var(--frontend-stroke), 0 0 18px color-mix(in srgb, var(--frontend-stroke) 18%, transparent);
- }
- html[data-preset="blueprint"] .guided-view-chapter,
- html[data-preset="blueprint"] .guided-view-chapter-index { border-radius: 0.12rem !important; }
+ .node-outline-item:hover small,
+ .node-outline-item[data-previewing] small,
+ .node-outline-item[aria-current="true"] small { color: var(--text-muted); }
- /* Story Shelf — keep every authored chapter and the Play action visible,
- but do not spend a second row on unavailable director controls before
- the reader enters a chapter. Existing data-active-view state expands
- the full guided surface without a new toggle or stored preference. */
- .guided-views[data-active-view="all"] {
- grid-template-columns: minmax(11rem, .72fr) auto minmax(0, 2fr);
+ .card-header {
+ display: flex;
align-items: center;
- padding: 0.28rem 0.35rem;
- }
- .guided-views[data-active-view="all"] > #guided-view-prev,
- .guided-views[data-active-view="all"] > #guided-view-next,
- .guided-views[data-active-view="all"] .guided-view-beat-link,
- .guided-views[data-active-view="all"] .guided-view-all { display: none; }
- .guided-views[data-active-view="all"] .guided-view-copy {
- grid-column: 1;
- grid-row: 1;
- padding: 0.1rem 0.55rem;
- }
- .guided-views[data-active-view="all"] .guided-view-copy > #guided-view-note { display: none; }
- .guided-views[data-active-view="all"] .guided-view-actions {
- display: block;
- grid-column: 2;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-play { min-height: 2.75rem; }
- .guided-views[data-active-view="all"] .guided-view-index {
- grid-column: 3;
- grid-row: 1;
- padding: 0 0.08rem 0 0.42rem;
- border-top: 0;
- border-left: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- }
- .guided-views[data-active-view="all"] .guided-view-chapters {
- gap: 0.3rem;
- padding: 0;
- }
-
- .cards {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
- gap: 1rem;
- margin-top: 2rem;
- }
-
- .card {
- background: var(--panel);
- border-radius: 0.75rem;
- border: 1px solid var(--panel-border);
- padding: 1.25rem;
- }
-
- html[data-preset="signal-flow"] .card {
- background: linear-gradient(145deg, rgba(10, 24, 43, 0.86), rgba(5, 12, 24, 0.92));
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
- }
- html[data-preset="signal-flow"][data-theme="light"] .card {
- background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 250, 0.9));
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 32px rgba(45, 78, 99, 0.08);
- }
-
- /* Preserve the one-screen guarantee on ordinary laptop displays. The
- high-screen expansion above must not trade a fuller canvas for page
- scrolling at 900–1080px heights. */
- @media (min-width: 768px) and (max-height: 1100px) {
- .header { margin-bottom: 1rem; }
- .diagram-container {
- padding: 0.875rem;
- padding-bottom: calc(0.875rem + var(--archify-nav-reserve));
- }
- .cards { margin-top: 1rem; }
- .card { padding: 1rem; }
- }
- @media (min-width: 768px) and (max-height: 920px) {
- body { padding-block: 1.25rem; }
- .header { margin-bottom: 0.875rem; }
- .cards { margin-top: 0.75rem; }
- html[data-nav-stage-rail="true"] body { padding-block: 0.375rem; }
- html[data-nav-stage-rail="true"] .header { margin-bottom: 0.5rem; }
- html[data-nav-stage-rail="true"] .guided-views { margin-bottom: 0.375rem; }
- html[data-nav-stage-rail="true"] .diagram-container[data-nav-stage-rail="true"] { padding-top: 0.5rem; }
- html[data-nav-stage-rail="true"] .cards { margin-top: 0.375rem; }
- }
-
- html[data-preset="blueprint"] .card {
- position: relative;
- border-color: var(--panel-border);
- border-radius: 0.3rem;
- background: var(--panel);
- box-shadow: none;
- }
- html[data-preset="blueprint"] .card::before {
- content: "";
- position: absolute;
- top: -1px;
- left: 1rem;
- width: 2.5rem;
- border-top: 2px solid var(--frontend-stroke);
- }
-
- html[data-preset="editorial"] .card {
- position: relative;
- border-radius: 0.28rem;
- background: var(--panel);
- box-shadow: 0 10px 28px color-mix(in srgb, #000 10%, transparent);
- }
- html[data-preset="editorial"] .card::before {
- position: absolute;
- top: -1px;
- left: 1.25rem;
- width: 3.25rem;
- border-top: 3px solid var(--arrow-emphasis);
- content: "";
- }
- html[data-preset="editorial"] .card-dot { border-radius: 0; transform: rotate(45deg) scale(0.78); }
-
- .card-header {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- margin-bottom: 0.75rem;
+ gap: 0.5rem;
+ margin-bottom: 0.625rem;
}
.card-dot {
+ flex: none;
width: 8px;
height: 8px;
border-radius: 50%;
@@ -3073,15 +2896,40 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.card-dot.orange { background: var(--messagebus-stroke); }
.card-dot.slate { background: var(--external-stroke); }
- .card h3 { font-size: 0.875rem; font-weight: 600; color: var(--text); }
+ .card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.card ul {
list-style: none;
color: var(--text-muted);
- font-size: 0.75rem;
+ font-size: 0.8125rem;
+ line-height: 1.6;
}
- .card li { margin-bottom: 0.375rem; }
+ .card li {
+ position: relative;
+ margin-bottom: 0.3rem;
+ padding-left: 0.9rem;
+ }
+ .card li:last-child { margin-bottom: 0; }
+ /* Hanging markers take the card's tone so wrapped lines align under text. */
+ .card li::before {
+ position: absolute;
+ top: calc(0.8em - 2px);
+ left: 0.2rem;
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ background: color-mix(in srgb, var(--card-tone, var(--text-muted)) 70%, transparent);
+ content: "";
+ }
+ .card:has(.card-dot.cyan) { --card-tone: var(--frontend-stroke); }
+ .card:has(.card-dot.emerald) { --card-tone: var(--backend-stroke); }
+ .card:has(.card-dot.violet) { --card-tone: var(--database-stroke); }
+ .card:has(.card-dot.amber) { --card-tone: var(--cloud-stroke); }
+ .card:has(.card-dot.rose) { --card-tone: var(--security-stroke); }
+ .card:has(.card-dot.orange) { --card-tone: var(--messagebus-stroke); }
+ .card:has(.card-dot.slate) { --card-tone: var(--external-stroke); }
+ .card-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-tone, transparent) 16%, transparent); }
/* ==========================================================
Print stylesheet — hide interactive controls, force light,
@@ -3126,11 +2974,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
body { background: #ffffff !important; padding: 0; }
.container { max-width: none; }
- .toolbar, .diagram-nav, .focus-chip, .guided-views, .archify-toast, .no-print { display: none !important; }
- .chapter-handoff-overlay { display: none !important; }
- svg [data-node-id][data-chapter-role] { opacity: 1 !important; }
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] { opacity: 1 !important; filter: none !important; }
+ .toolbar, .diagram-nav, .focus-chip, .archify-toast, .no-print { display: none !important; }
+
.diagram-container, .card { box-shadow: none; border-color: #e2e8f0; }
.diagram-container { --archify-nav-reserve: 0px !important; }
html[data-preset="signal-flow"] .diagram-container,
@@ -3156,16 +3001,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.relationship-hit-overlay { display: none !important; }
.relationship-pulse-overlay { display: none !important; }
.route-probe-overlay, .route-journey-overlay { display: none !important; }
- .story-trail-overlay,
- .story-carrier-overlay { display: none !important; }
.diagram-container svg[data-focus-active] [data-node-id],
.diagram-container svg[data-focus-active] [data-edge-from],
+ .diagram-container svg[data-focus-active] [data-graph-role="automatic-crossover-underlay"],
.diagram-container svg[data-reach-active] [data-node-id],
.diagram-container svg[data-reach-active] [data-edge-from],
- .diagram-container svg[data-story-beat] [data-story-step],
- .diagram-container svg[data-story-beat] [data-edge-from][data-story-beat-step],
+ .diagram-container svg[data-reach-active] [data-graph-role="automatic-crossover-underlay"],
.diagram-container svg[data-route-active] [data-node-id],
- .diagram-container svg[data-route-active] [data-edge-from] {
+ .diagram-container svg[data-route-active] [data-edge-from],
+ .diagram-container svg[data-route-active] [data-graph-role="automatic-crossover-underlay"] {
opacity: 1 !important;
filter: none !important;
animation: none !important;
@@ -3176,61 +3020,162 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ==========================================================
TOOLBAR (theme toggle + export menu)
========================================================== */
+ /* The toolbar tracks the centered reader column and the title row, so
+ an adaptive narrow reader does not leave its controls stranded at the
+ viewport edge. */
.toolbar {
- position: fixed;
- top: 1rem;
- right: 1rem;
+ position: absolute;
+ top: var(--archify-page-top);
+ right: max(1rem, calc((100vw - min(100vw - 4rem, var(--archify-reader-width, 1440px))) / 2));
display: flex;
align-items: center;
- gap: 0.5rem;
+ gap: 0.125rem;
padding: 0;
border: 0;
background: transparent;
box-shadow: none;
z-index: 100;
}
+ /* Ghost controls keep a 44px hit area while the visible pill stays compact;
+ Export is the one primary action. */
.toolbar button {
- background: var(--toolbar-bg);
- color: var(--toolbar-text);
- border: 1px solid var(--toolbar-border);
- padding: 0.5rem 0.875rem;
- border-radius: 0.625rem;
+ position: relative;
+ isolation: isolate;
+ background: transparent;
+ color: var(--text-muted);
+ border: 0;
+ padding: 0.5rem 0.75rem;
+ border-radius: 0.5625rem;
font-family: inherit;
- font-size: 0.75rem;
+ font-size: 0.8125rem;
font-weight: 500;
cursor: pointer;
white-space: nowrap;
- backdrop-filter: blur(10px);
- box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
- transition: background 0.15s, border-color 0.15s, color 0.15s;
+ box-shadow: none;
+ transition: color 0.15s;
display: inline-flex;
align-items: center;
- gap: 0.375rem;
+ gap: 0.4rem;
min-height: 2.75rem;
}
- .toolbar button:hover {
- background: var(--toolbar-hover);
- border-color: color-mix(in srgb, var(--arrow) 62%, var(--toolbar-border));
+ .toolbar button::before {
+ position: absolute;
+ z-index: -1;
+ inset: 0.375rem 0;
+ border-radius: 0.5rem;
+ background: transparent;
+ content: "";
+ transition: background 0.15s, box-shadow 0.15s;
}
+ .toolbar button:hover { color: var(--text); }
+ .toolbar button:hover::before { background: color-mix(in srgb, var(--text) 6%, transparent); }
.toolbar button[aria-expanded="true"],
- .toolbar button[aria-pressed="true"]:not(#btn-theme) {
- background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));
- border-color: color-mix(in srgb, var(--frontend-stroke) 48%, var(--toolbar-border));
+ .toolbar button[aria-pressed="true"]:not(#btn-theme) { color: var(--text); }
+ .toolbar button[aria-expanded="true"]::before,
+ .toolbar button[aria-pressed="true"]:not(#btn-theme)::before {
+ background: color-mix(in srgb, var(--text) 8%, transparent);
}
.toolbar #btn-export {
- padding-right: 0.82rem;
- padding-left: 0.82rem;
+ margin-left: 0.375rem;
+ padding-right: 0.95rem;
+ padding-left: 1rem;
+ color: var(--bg);
+ font-weight: 550;
}
- .toolbar #btn-export:hover,
- .toolbar #btn-export[aria-expanded="true"] {
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-stroke) 10%, var(--toolbar-hover));
- border-color: color-mix(in srgb, var(--frontend-stroke) 54%, var(--toolbar-border));
+ .toolbar #btn-export::before {
+ background: var(--text);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), 0 6px 16px -8px rgba(15, 23, 42, 0.4);
}
+ .toolbar #btn-export:hover,
+ .toolbar #btn-export[aria-expanded="true"] { color: var(--bg); }
+ .toolbar #btn-export:hover::before,
+ .toolbar #btn-export[aria-expanded="true"]::before { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.toolbar button:focus-visible {
outline: 2px solid var(--frontend-stroke);
- outline-offset: 2px;
+ outline-offset: -4px;
+ }
+ .toolbar { gap: 0.5rem; }
+ .toolbar #btn-export { margin-left: 0; }
+ .toolbar #btn-export::before { inset: 0.25rem 0; border-radius: 0.6875rem; }
+ /* Tools share one quiet capsule; the capsule is drawn inside the 44px row
+ so the controls keep their hit area without a tall visible box. */
+ .toolbar-group {
+ position: relative;
+ isolation: isolate;
+ display: flex;
+ align-items: center;
+ gap: 0.0625rem;
+ padding: 0 0.25rem;
+ }
+ .toolbar-group::before {
+ position: absolute;
+ z-index: -1;
+ inset: 0.25rem 0;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 85%, transparent);
+ border-radius: 0.6875rem;
+ background: color-mix(in srgb, var(--panel) 78%, transparent);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -14px rgba(15, 23, 42, 0.22);
+ backdrop-filter: blur(12px);
+ content: "";
+ }
+ .toolbar-group button { padding-inline: 0.625rem; }
+ .toolbar-group button::before { inset: 0.5rem 0; border-radius: 0.5rem; }
+ /* Theme becomes a sliding switch; its label stays for assistive tech. */
+ .toolbar #theme-label,
+ .toolbar #present-label {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip: rect(0 0 0 0);
+ white-space: nowrap;
}
+ .toolbar #btn-theme {
+ width: 3.5rem;
+ padding: 0;
+ justify-content: center;
+ }
+ .toolbar #btn-theme::before {
+ inset: 0.75rem 0.4375rem;
+ border-radius: 999px;
+ background: color-mix(in srgb, var(--text) 9%, transparent);
+ box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
+ }
+ .toolbar #btn-theme:hover::before { background: color-mix(in srgb, var(--text) 13%, transparent); }
+ .toolbar #btn-theme::after {
+ position: absolute;
+ z-index: 0;
+ top: 50%;
+ left: 0.5625rem;
+ width: 1.125rem;
+ height: 1.125rem;
+ border-radius: 50%;
+ background: var(--panel);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.12);
+ content: "";
+ transform: translateY(-50%);
+ transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ .toolbar #theme-icon {
+ position: absolute;
+ z-index: 1;
+ top: 50%;
+ left: calc(0.5625rem + 0.1875rem);
+ width: 0.75rem;
+ height: 0.75rem;
+ color: var(--cloud-stroke);
+ transform: translateY(-50%);
+ transition: left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ [data-theme="dark"] .toolbar #btn-theme::before { background: rgba(148, 163, 184, 0.16); }
+ [data-theme="dark"] .toolbar #btn-theme::after { left: calc(100% - 0.5625rem - 1.125rem); background: #3b4a63; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
+ [data-theme="dark"] .toolbar #theme-icon { left: calc(100% - 0.5625rem - 1.125rem + 0.1875rem); color: #c7d2fe; }
+ .toolbar #btn-present { width: 2.5rem; padding: 0; justify-content: center; }
+ .toolbar #btn-present .toolbar-icon { width: 1rem; height: 1rem; }
+ html[data-motion="still"] .toolbar #btn-theme::after,
+ html[data-motion="still"] .toolbar #theme-icon { transition: none; }
+ html[data-present="true"]:not([data-embed="true"]) .toolbar { right: 1rem; }
+ html[data-preset="editorial"] .toolbar { border-radius: 0.45rem; }
.toolbar #btn-motion[hidden] { display: none !important; }
.toolbar #btn-motion { min-width: 4.4rem; }
.toolbar #btn-motion:disabled { cursor: default; opacity: 0.58; }
@@ -3304,19 +3249,30 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
box-shadow: 0 0 0 2px color-mix(in srgb, var(--arrow-emphasis) 14%, transparent);
transform: rotate(45deg) scale(0.72);
}
+ /* Menus anchor to the tools capsule so they open flush under it. */
+ .toolbar-group .preset-wrap { position: static; }
.toolbar .preset-menu {
position: absolute;
- top: calc(100% + 0.375rem);
+ top: calc(100% + 0.125rem);
right: 0;
display: none;
- width: 18.5rem;
+ width: 17.5rem;
max-width: calc(100vw - 2rem);
- padding: 0.45rem;
- border: 1px solid var(--toolbar-border);
+ padding: 0.375rem;
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
border-radius: 0.875rem;
background: var(--toolbar-menu-bg);
- box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
+ }
+ [data-theme="dark"] .toolbar .preset-menu,
+ [data-theme="dark"] .toolbar .export-menu {
+ border-color: rgba(148, 163, 184, 0.16);
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.6);
}
+ /* Menu rows are not toolbar pills: drop the ghost-button pseudo surface. */
+ .toolbar .preset-menu button,
+ .toolbar .export-menu button { isolation: auto; min-height: 0; }
+ .toolbar .preset-menu button::before { display: none; }
.toolbar .preset-menu.open { display: block; }
.toolbar .preset-menu.open,
.toolbar .export-menu.open {
@@ -3329,50 +3285,74 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.preset-menu-heading {
display: flex;
- align-items: baseline;
+ align-items: center;
justify-content: space-between;
gap: 1rem;
- padding: 0.42rem 0.6rem 0.55rem;
+ padding: 0.45rem 0.55rem 0.4rem;
color: var(--text-faint);
- font-size: 0.56rem;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ font-size: 0.6875rem;
+ font-weight: 600;
+ letter-spacing: 0.01em;
}
- .preset-menu-heading span:last-child {
- font-size: 0.52rem;
- letter-spacing: 0.04em;
- text-transform: none;
+ .preset-menu-shortcut {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.35rem;
+ font-weight: 500;
+ }
+ .preset-menu-shortcut kbd {
+ min-width: 1.125rem;
+ padding: 0.05rem 0.3rem;
+ border: 1px solid var(--panel-border);
+ border-bottom-width: 2px;
+ border-radius: 0.3rem;
+ background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
+ color: var(--text-muted);
+ font-family: inherit;
+ font-size: 0.625rem;
+ font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
}
.toolbar .preset-option {
display: grid;
- grid-template-columns: 2rem minmax(0, 1fr) 1rem;
+ grid-template-columns: 2.375rem minmax(0, 1fr) 1rem;
align-items: center;
- gap: 0.68rem;
+ gap: 0.75rem;
width: 100%;
- min-height: 3.35rem;
- padding: 0.5rem 0.62rem;
+ min-height: 3.125rem;
+ margin-top: 0.125rem;
+ padding: 0.45rem 0.6rem 0.45rem 0.5rem;
border: 0;
- border-radius: 0.5rem;
+ border-radius: 0.625rem;
background: transparent;
+ color: var(--text);
box-shadow: none;
backdrop-filter: none;
text-align: left;
+ transition: background 0.14s ease;
}
.toolbar .preset-option:hover,
- .toolbar .preset-option:focus-visible { background: var(--toolbar-hover); }
- .toolbar .preset-option[aria-checked="true"] {
- background: color-mix(in srgb, var(--frontend-stroke) 9%, transparent);
- border-color: color-mix(in srgb, var(--frontend-stroke) 36%, transparent);
+ .toolbar .preset-option:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
+ .toolbar .preset-option[aria-checked="true"] { background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent); }
+ .toolbar .preset-option:focus-visible {
+ outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
+ outline-offset: -1.5px;
}
.preset-option-swatch {
position: relative;
- width: 2rem;
- height: 1.55rem;
+ width: 2.375rem;
+ height: 1.75rem;
overflow: hidden;
- border: 1px solid #64748b;
- border-radius: 0.24rem;
+ border: 0;
+ border-radius: 0.4375rem;
background: #0f172a;
- box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
+ box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28), 0 1px 2px rgba(15, 23, 42, 0.12);
+ transition: box-shadow 0.14s ease, transform 0.14s ease;
+ }
+ .toolbar .preset-option:hover .preset-option-swatch { transform: translateY(-1px); }
+ .toolbar .preset-option[aria-checked="true"] .preset-option-swatch {
+ box-shadow: 0 0 0 2px var(--toolbar-menu-bg), 0 0 0 3.5px var(--frontend-stroke);
}
.preset-option-swatch::before,
.preset-option-swatch::after { position: absolute; content: ""; }
@@ -3385,6 +3365,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
border-radius: 0.16rem;
background: rgba(34, 211, 238, 0.14);
}
+ /* Classic previews the canvas it will actually produce in this theme. */
+ [data-theme="light"] .preset-option-swatch.classic {
+ background:
+ radial-gradient(circle at 1px 1px, #d9dee5 0.6px, transparent 0.9px) 0 0 / 5px 5px,
+ #ffffff;
+ }
+ [data-theme="light"] .preset-option-swatch.classic::before {
+ border-color: #1b87a3;
+ background: rgba(14, 116, 144, 0.08);
+ box-shadow: 0 2px 4px rgba(17, 24, 39, 0.12);
+ }
.preset-option-swatch.signal-flow {
border-color: #29415f;
background: linear-gradient(135deg, #07101e 10%, #10243c 100%);
@@ -3447,15 +3438,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.preset-option-copy strong,
.preset-option-copy small { display: block; }
.preset-option-copy strong {
- color: var(--toolbar-text);
- font-size: 0.72rem;
- font-weight: 600;
+ color: var(--text);
+ font-size: 0.8125rem;
+ font-weight: 550;
+ letter-spacing: -0.005em;
}
+ .toolbar .preset-option[aria-checked="true"] .preset-option-copy strong { font-weight: 650; }
.preset-option-copy small {
- margin-top: 0.16rem;
+ margin-top: 0.125rem;
overflow: hidden;
color: var(--text-faint);
- font-size: 0.57rem;
+ font-size: 0.6875rem;
font-weight: 400;
white-space: nowrap;
text-overflow: ellipsis;
@@ -3485,9 +3478,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html[data-preset="editorial"] .route-probe,
html[data-preset="editorial"] .focus-chip,
html[data-preset="editorial"] .diagram-guide,
- html[data-preset="editorial"] .node-finder,
- html[data-preset="editorial"] .guided-views,
- html[data-preset="editorial"] .share-chapter-cue {
+ html[data-preset="editorial"] .node-finder {
border-radius: 0.3rem;
}
.motion-control-dot {
@@ -3505,19 +3496,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.toolbar .export-menu {
position: absolute;
- top: calc(100% + 0.375rem);
+ top: calc(100% + 0.125rem);
right: 0;
background: var(--toolbar-menu-bg);
- border: 1px solid var(--toolbar-border);
+ border: 1px solid color-mix(in srgb, var(--panel-border) 90%, transparent);
width: 19rem;
max-width: calc(100vw - 2rem);
max-height: calc(100vh - 5.5rem);
overflow-y: auto;
border-radius: 0.875rem;
- padding: 0.55rem;
+ padding: 0.375rem;
display: none;
flex-direction: column;
- box-shadow: 0 18px 48px rgba(0,0,0,0.24);
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 18px 44px -14px rgba(15, 23, 42, 0.3);
+ scrollbar-width: thin;
}
.toolbar .export-menu.open { display: flex; }
.export-menu-header {
@@ -3525,94 +3517,111 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
- padding: 0.5rem 0.55rem 0.72rem;
+ padding: 0.55rem 0.6rem 0.6rem;
}
.export-menu-header strong,
.export-menu-header span { display: block; }
.export-menu-header strong {
- color: var(--toolbar-text);
- font-size: 0.78rem;
- font-weight: 650;
- letter-spacing: -0.015em;
+ color: var(--text);
+ font-size: 0.875rem;
+ font-weight: 600;
+ letter-spacing: -0.005em;
}
.export-menu-header span {
- margin-top: 0.16rem;
+ margin-top: 0.15rem;
color: var(--text-faint);
- font-size: 0.56rem;
+ font-size: 0.75rem;
}
.export-menu-header kbd {
- padding: 0.16rem 0.36rem;
- border: 1px solid var(--toolbar-border);
+ min-width: 1.125rem;
+ padding: 0.05rem 0.3rem;
+ border: 1px solid var(--panel-border);
+ border-bottom-width: 2px;
border-radius: 0.3rem;
- color: var(--text-faint);
- background: color-mix(in srgb, var(--toolbar-border) 16%, transparent);
+ background: color-mix(in srgb, var(--text) 3%, var(--toolbar-menu-bg));
+ color: var(--text-muted);
font-family: inherit;
- font-size: 0.54rem;
+ font-size: 0.625rem;
font-weight: 600;
+ line-height: 1.3;
+ text-align: center;
}
.export-menu-section {
display: grid;
grid-template-columns: minmax(0, 1fr);
- gap: 0.18rem;
+ gap: 0.0625rem;
}
.export-menu-section + .export-menu-section {
- margin-top: 0.42rem;
- padding-top: 0.42rem;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 68%, transparent);
+ margin-top: 0.3rem;
+ padding-top: 0.3rem;
+ border-top: 1px solid color-mix(in srgb, var(--panel-border) 80%, transparent);
}
.export-menu-heading {
grid-column: 1 / -1;
display: block;
- padding: 0.24rem 0.55rem 0.2rem;
+ padding: 0.4rem 0.6rem 0.25rem;
color: var(--text-faint);
- font-size: 0.54rem;
+ font-size: 0.6875rem;
font-weight: 600;
- letter-spacing: 0.12em;
- text-transform: uppercase;
+ letter-spacing: 0.01em;
}
.toolbar .export-menu button {
display: grid;
- grid-template-columns: 1.15rem minmax(0, 1fr);
+ grid-template-columns: 1rem minmax(0, 1fr);
align-items: center;
- column-gap: 0.52rem;
+ column-gap: 0.7rem;
background: transparent;
- border: 1px solid transparent;
+ border: 0;
box-shadow: none;
backdrop-filter: none;
width: 100%;
- min-height: 3rem;
+ min-height: 2.5rem;
text-align: left;
- padding: 0.48rem 0.55rem;
- border-radius: 0.5rem;
+ padding: 0.4rem 0.6rem;
+ border-radius: 0.5625rem;
+ color: var(--text);
white-space: nowrap;
+ transition: background 0.14s ease;
+ }
+ .toolbar .export-menu button:hover,
+ .toolbar .export-menu button:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
+ .toolbar .export-menu button:focus-visible {
+ outline: 1.5px solid color-mix(in srgb, var(--frontend-stroke) 55%, transparent);
+ outline-offset: -1.5px;
}
+ /* Name and format hint share one line, so each row stays compact. */
.export-item-copy {
- display: block;
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 0.75rem;
min-width: 0;
}
- .export-item-copy strong,
- .export-item-copy small { display: block; }
.export-item-copy strong {
overflow: hidden;
color: inherit;
- font-size: 0.7rem;
- font-weight: 550;
+ font-size: 0.8125rem;
+ font-weight: 500;
text-overflow: ellipsis;
}
.export-item-copy small {
- margin-top: 0.12rem;
- overflow: hidden;
+ flex: none;
color: var(--text-faint);
- font-size: 0.55rem;
+ font-size: 0.6875rem;
font-weight: 450;
- text-overflow: ellipsis;
}
.toolbar .export-menu button::before {
+ position: static;
+ z-index: auto;
+ inset: auto;
+ border-radius: 0;
+ display: block;
width: 1rem;
height: 1rem;
background: currentColor;
+ color: var(--text-muted);
content: "";
- opacity: 0.72;
+ opacity: 0.8;
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: contain;
@@ -3620,7 +3629,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
mask-repeat: no-repeat;
mask-size: contain;
}
- .toolbar .export-menu button[data-format="share-card"]::before,
.toolbar .export-menu button[data-action="route-share-card"]::before,
.toolbar .export-menu button[data-action="reach-share-card"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 4.5h14v11H3zM6 12l2.5-2.5 2 2 1.5-1.5 2 2'/%3E%3Ccircle cx='13.8' cy='7.3' r='1.2' fill='black'/%3E%3C/svg%3E");
@@ -3636,38 +3644,32 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 2.5h7l3 3v12H5zM12 2.5v3h3' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='M7.5 14l2-2 1.5 1.5 1.5-1.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
}
- .toolbar .export-menu button[data-format="svg"]::before,
+ .toolbar .export-menu button[data-format^="svg"]::before,
.toolbar .export-menu button[data-format="webm"]::before {
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 2.5l7 4v7l-7 4-7-4v-7zM3 6.5l7 4 7-4M10 10.5v7' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E");
}
- .toolbar .export-menu button[data-format="share-card"],
.toolbar .export-menu button[data-action="route-share-card"],
.toolbar .export-menu button[data-action="reach-share-card"] {
- min-height: 3.35rem;
- color: var(--toolbar-text);
- background: color-mix(in srgb, var(--frontend-stroke) 8%, transparent);
- border-color: color-mix(in srgb, var(--frontend-stroke) 24%, var(--toolbar-border));
+ color: var(--text);
+ background: color-mix(in srgb, var(--frontend-stroke) 7%, transparent);
}
+ .toolbar .export-menu button[data-action="route-share-card"]::before,
+ .toolbar .export-menu button[data-action="reach-share-card"]::before { color: var(--frontend-stroke); opacity: 1; }
.toolbar .export-menu button[hidden] { display: none; }
- .toolbar .export-menu button:hover {
- background: var(--toolbar-hover);
- }
- .toolbar .export-menu button:focus-visible {
- background: var(--toolbar-hover);
- outline-offset: -2px;
+ .toolbar .export-menu button[data-action="route-share-card"]:hover,
+ .toolbar .export-menu button[data-action="reach-share-card"]:hover {
+ background: color-mix(in srgb, var(--frontend-stroke) 12%, transparent);
}
.toolbar .export-menu button:disabled {
color: var(--text-faint);
- background: color-mix(in srgb, var(--toolbar-border) 18%, transparent);
+ background: transparent;
+ opacity: 0.55;
cursor: not-allowed;
}
- .toolbar .export-menu button:disabled:hover {
- border-color: transparent;
- }
.toolbar .export-menu .hint {
color: var(--text-faint);
- font-size: 0.55rem;
+ font-size: 0.6875rem;
}
/* Toast — brief feedback for actions like "copied" */
@@ -3707,6 +3709,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
.toolbar {
position: relative;
+ top: auto;
+ right: auto;
justify-content: flex-end;
width: max-content;
max-width: 100%;
@@ -3809,6 +3813,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
width: calc(100% - 1rem);
max-width: none;
}
+ .relationship-lens-head { padding-top: 0.7rem; }
+ .relationship-lens-drag-handle { display: none; }
.relationship-lens-list { max-height: min(12rem, 38vh); }
.relationship-lens-actions #btn-focus-relations { display: block; color: var(--database-stroke); }
.focus-chip:not([data-relations-expanded="true"]) .relationship-lens-head { border-bottom-color: transparent; }
@@ -3891,95 +3897,24 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.route-journey-controls button { min-height: 2.75rem; }
.route-probe-status { padding: 0.05rem 0.48rem 0.38rem; }
.route-probe-node { max-width: 7.5rem; }
- .guided-views {
- grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
- gap: 0.2rem;
- padding: 0.25rem;
- }
- .guided-view-actions {
- grid-column: 1 / -1;
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- }
- .guided-views > #guided-view-prev,
- .guided-views > #guided-view-next {
- align-self: center;
- height: 2.75rem;
+
+
+
+
+
+
+
+
+
+
+
+ html[data-embed="true"][data-share-playback="true"] .diagram-container {
+ padding-top: 4.25rem;
}
- .guided-view-play,
- .guided-view-all,
- .guided-view-beat-link { min-height: 2.75rem; }
- .guided-view-copy small { white-space: normal; }
- .guided-story-caption { padding: 0.32rem 0.45rem; }
- .guided-story-caption-index { min-width: 2.9rem; padding-right: 0.42rem; }
- .guided-story-caption strong,
- .guided-story-caption small { white-space: normal; }
- .guided-story-caption-next { display: none; }
- .guided-view-trail { min-height: 2rem; }
- .guided-view-trail .guided-view-stop {
- min-height: 2rem;
- padding: 0.22rem 0.42rem 0.22rem 0.28rem;
- }
- .guided-view-handoff { max-width: min(9rem, 32vw); }
- .guided-view-index { padding-top: 0.35rem; }
- .guided-view-chapters {
- gap: 0.35rem;
- scroll-padding-inline: 0.2rem;
- }
- .guided-view-chapters li {
- flex: 0 0 min(14rem, 78vw);
- min-width: 0;
- }
- .guided-view-chapter { min-height: 2.75rem; }
- .guided-views[data-active-view="all"] {
- grid-template-columns: minmax(0, 1fr) auto;
- gap: 0.2rem;
- padding: 0.25rem;
- }
- .guided-views[data-active-view="all"] .guided-view-copy {
- grid-column: 1;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-actions {
- grid-column: 2;
- grid-row: 1;
- }
- .guided-views[data-active-view="all"] .guided-view-play {
- min-width: 6rem !important;
- min-height: 2.75rem;
- }
- .guided-views[data-active-view="all"] .guided-view-index {
- grid-column: 1 / -1;
- grid-row: 2;
- padding: 0.3rem 0.08rem 0;
- border-top: 1px solid color-mix(in srgb, var(--toolbar-border) 72%, transparent);
- border-left: 0;
- }
- html[data-embed="true"][data-share-playback="true"] .share-chapter-cue:not([hidden]),
- html[data-embed="true"][data-share-moment="true"] .share-chapter-cue:not([hidden]) {
- top: 0.5rem;
- grid-template-columns: auto minmax(0, 1fr);
- gap: 0.28rem 0.55rem;
- width: calc(100% - 1rem);
- min-height: 0;
- padding: 0.45rem 0.55rem 0.55rem;
- }
- html[data-embed="true"][data-share-playback="true"] .diagram-container {
- padding-top: 4.25rem;
- }
- html[data-embed="true"][data-share-moment="true"] .diagram-container {
- padding-top: 4.25rem;
- }
- .share-chapter-index {
- min-width: 4.4rem;
- padding-right: 0.5rem;
- }
- .share-chapter-copy small { font-size: 0.46rem; }
- .share-chapter-route {
- grid-column: 1 / -1;
- font-size: 0.5rem;
- text-align: left;
+ html[data-embed="true"][data-share-moment="true"] .diagram-container {
+ padding-top: 4.25rem;
}
+
.cards {
grid-template-columns: 1fr;
margin-top: 1rem;
@@ -4022,11 +3957,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
text-overflow: ellipsis;
white-space: nowrap;
}
- html[data-present="true"]:not([data-embed="true"]) .guided-views {
- padding: 0.2rem;
- }
- html[data-present="true"]:not([data-embed="true"]) .guided-view-copy small { display: none; }
- html[data-present="true"]:not([data-embed="true"]) .guided-story-caption small { display: block; }
+
html[data-present="true"]:not([data-embed="true"]) .diagram-container { padding: 0.5rem 0.5rem 3.75rem; }
html[data-present="true"]:not([data-embed="true"]) .diagram-container[data-wide-diagram="true"] > svg {
width: 720px;
@@ -4038,13 +3969,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
@media (max-width: 420px) {
.export-menu-section { grid-template-columns: 1fr; }
.export-menu-heading,
- .toolbar .export-menu button[data-format="share-card"],
.toolbar .export-menu button[data-action="route-share-card"],
.toolbar .export-menu button[data-action="reach-share-card"] { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
- .guided-story-caption { animation: none !important; }
.toolbar .preset-menu.open,
.toolbar .export-menu.open { animation: none; }
.toolbar-chevron { transition: none; }
@@ -4055,7 +3984,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.toolbar button { padding-right: 0.58rem; padding-left: 0.58rem; }
.toolbar #btn-motion { min-width: 4.4rem; padding-right: 0.58rem; padding-left: 0.58rem; }
#theme-label, #preset-label, #present-label { display: none; }
- .guided-view-handoff { max-width: 6.5rem; }
}
/* ==========================================================
@@ -4063,6 +3991,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
========================================================== */
.c-grid { stroke: var(--grid); fill: none; }
.c-mask { fill: var(--mask); stroke: none; }
+ .c-lane-rule { stroke: var(--lane-stroke); fill: none; opacity: 0.7; }
+ .c-lane-wash { fill: var(--lane-fill); stroke: none; }
.c-frontend { fill: var(--frontend-fill); stroke: var(--frontend-stroke); }
.c-backend { fill: var(--backend-fill); stroke: var(--backend-stroke); }
@@ -4084,6 +4014,41 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.t-messagebus { fill: var(--messagebus-stroke); }
.t-external { fill: var(--external-stroke); }
+ /* Relationship labels share the exact color token used by their path. */
+ .t-edge-default { fill: var(--arrow); }
+ .t-edge-emphasis { fill: var(--arrow-emphasis); }
+ .t-edge-security { fill: var(--security-stroke); }
+ .t-edge-dashed { fill: var(--database-stroke); }
+
+ /* Classic canvas: a quiet dot field replaces drafting grid lines, and nodes
+ read as lifted cards with hairline strokes. Paint only; authored geometry,
+ hit areas and exports keep their canonical shapes. */
+ html[data-preset="classic"] .diagram-container {
+ background:
+ radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 1.4px) 0 0 / 20px 20px,
+ var(--panel);
+ }
+ html[data-preset="classic"] .diagram-container > svg .c-grid { stroke: transparent; }
+ html[data-preset="classic"][data-theme="light"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
+ filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.05)) drop-shadow(0 6px 12px rgba(17, 24, 39, 0.06));
+ }
+ html[data-preset="classic"][data-theme="dark"] .diagram-container > svg [data-node-id] > rect:not(.c-mask) {
+ filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
+ }
+ html[data-preset="classic"] .diagram-container > svg [data-edge-from] {
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ }
+ html[data-preset="classic"] .diagram-container > svg .c-lane-wash { fill: color-mix(in srgb, var(--text) 2.6%, transparent); }
+ html[data-preset="classic"] .diagram-container > svg .c-lane-rule { stroke: var(--panel-border); opacity: 1; }
+ html[data-preset="classic"][data-theme="dark"] .diagram-container > svg .c-lane-rule { stroke: rgba(148, 163, 184, 0.16); }
+ html[data-preset="classic"] .diagram-container > svg [data-node-id] {
+ transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ html[data-preset="classic"]:not([data-motion="still"]) .diagram-container > svg [data-node-id]:hover {
+ transform: translateY(-1.5px);
+ }
+
/* Semantic Sigils are small authored role stamps, not icons from a brand
pack and not viewer controls. Prefix selectors with svg so the canonical
export's SVG-only stylesheet collector keeps them automatically. */
@@ -4161,8 +4126,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-intent-trace-active] [data-intent-trace-match] [data-detail],
svg[data-route-active] [data-route-match][data-detail],
svg[data-route-active] [data-route-match] [data-detail],
- svg[data-story-active] [data-story-step][data-detail],
- svg[data-story-active] [data-story-step] [data-detail],
svg[data-relationship-preview-active] [data-relationship-preview][data-detail],
svg[data-relationship-preview-active] [data-relationship-preview] [data-detail],
svg [data-node-id]:hover [data-detail],
@@ -4176,7 +4139,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-legend-preview-active] [data-legend-preview-match] [data-detail-anchor],
svg[data-intent-trace-active] [data-intent-trace-match] [data-detail-anchor],
svg[data-route-active] [data-route-match] [data-detail-anchor],
- svg[data-story-active] [data-story-step] [data-detail-anchor],
svg [data-node-id]:hover [data-detail-anchor],
svg [data-node-id]:focus-visible [data-detail-anchor] { transform: none; }
@@ -4195,9 +4157,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* Stable semantic exploration hooks emitted by every renderer. */
svg [data-node-id] {
cursor: pointer;
- transition: opacity 0.18s ease, filter 0.18s ease;
+ transition: opacity 0.18s ease, fill-opacity 0.18s ease, stroke-opacity 0.18s ease, filter 0.18s ease;
}
- svg [data-edge-from] { transition: opacity 0.18s ease, filter 0.18s ease; }
+ svg [data-edge-from],
+ svg [data-graph-role="automatic-crossover-underlay"] { transition: opacity 0.18s ease, filter 0.18s ease; }
svg [data-node-id]:hover,
svg [data-node-id]:focus-visible {
filter: drop-shadow(0 0 7px var(--frontend-stroke));
@@ -4346,9 +4309,22 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
opacity: 0.78;
}
html[data-embed="true"] .semantic-lens-overlay { display: none; }
+ /* Automatic crossover masks are visual companions of their one semantic
+ edge. Keep the mask free of data-edge-* identity so graph traversal and
+ export still observe exactly one edge, then mirror reader emphasis from
+ the paired foreground path in this presentation-only wrapper. */
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-match]) > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
+ svg[data-legend-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-legend-preview-peer]) > [data-graph-role="automatic-crossover-underlay"],
+ svg[data-lens-active] [data-graph-role="automatic-crossover"]:has(> [data-lens-peer]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
svg[data-focus-active] [data-node-id],
svg[data-focus-active] [data-edge-from] { opacity: 0.13; }
+ svg[data-focus-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.13; }
+ svg[data-focus-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-focus-active] [data-focus-match] { opacity: 1; }
+ svg[data-focus-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-focus-active] [data-focus-selected] {
filter: drop-shadow(0 0 10px var(--frontend-stroke));
}
@@ -4359,7 +4335,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
changes only viewer emphasis, not canonical geometry or export bytes. */
svg[data-reach-active] [data-node-id],
svg[data-reach-active] [data-edge-from] { opacity: 0.09; }
+ svg[data-reach-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.09; }
svg[data-reach-active] [data-reach-match] { opacity: 1; }
+ svg[data-reach-active] [data-graph-role="automatic-crossover"]:has(> [data-reach-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-reach-active="upstream"] [data-reach-origin] {
filter: drop-shadow(0 0 11px var(--database-stroke));
}
@@ -4413,14 +4391,14 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg[data-relationship-direct-active] [data-node-id],
svg[data-relationship-direct-active] [data-edge-from] { opacity: 0.16; }
+ svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.16; }
svg[data-relationship-direct-active] [data-relationship-preview],
svg[data-relationship-direct-active] [data-relationship-preview-node] { opacity: 1; }
+ svg[data-relationship-direct-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-focus-active]:not([data-relationship-pin-active]) .relationship-hit-rail,
- svg[data-story-active] .relationship-hit-rail,
svg[data-route-picking] .relationship-hit-rail,
svg[data-route-active] .relationship-hit-rail,
- svg[data-lens-active] .relationship-hit-rail,
- svg[data-chapter-preview] .relationship-hit-rail { pointer-events: none; }
+ svg[data-lens-active] .relationship-hit-rail { pointer-events: none; }
html[data-embed="true"] .relationship-hit-overlay { display: none; }
@media (hover: none), (pointer: coarse) {
.relationship-hit-rail { stroke-width: 24; }
@@ -4430,8 +4408,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
neighborhood focus. It changes emphasis only; exported geometry and the
relationship's original solid/dashed visual language stay untouched. */
svg[data-relationship-preview-active] [data-focus-match] { opacity: 0.18; }
+ svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-focus-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.18; }
+ svg[data-relationship-preview-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-relationship-preview-active] [data-relationship-preview],
svg[data-relationship-preview-active] [data-relationship-preview-node] { opacity: 1; }
+ svg[data-relationship-preview-active] [data-graph-role="automatic-crossover"]:has(> [data-relationship-preview]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-relationship-preview-active] [data-relationship-preview] {
filter: drop-shadow(0 0 5px var(--arrow-emphasis));
}
@@ -4485,9 +4466,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.relationship-flow-token {
animation: archify-relationship-token-life 1.2s linear 1 both;
}
- .story-flow-token {
- animation: archify-relationship-token-life 0.78s linear 1 both;
- }
+
.semantic-flow-token-halo {
fill: var(--mask);
stroke: currentColor;
@@ -4525,9 +4504,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* Intent Trace is a temporary, pre-click exploration layer. Related
topology stays readable while a short viewer-only signal runs over
cloned edge geometry; the authored edge remains untouched underneath. */
- svg[data-intent-trace-active] [data-node-id],
+ /* Keep the node's opaque backing mask intact while its visible ink dims.
+ Fading the whole group also fades that mask and briefly exposes arrows
+ routed underneath the node when the pointer leaves. */
+ svg[data-intent-trace-active] [data-node-id] { fill-opacity: 0.2; stroke-opacity: 0.2; }
+ svg [data-node-id] > .c-mask { fill-opacity: 1; }
+ svg[data-intent-trace-active] [data-node-id][data-intent-trace-match] { fill-opacity: 1; stroke-opacity: 1; }
svg[data-intent-trace-active] [data-edge-from] { opacity: 0.2; }
+ svg[data-intent-trace-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.2; }
+ svg[data-intent-trace-active] [data-lifecycle-rail] { opacity: 0; }
svg[data-intent-trace-active] [data-intent-trace-match] { opacity: 1; }
+ svg[data-intent-trace-active] [data-graph-role="automatic-crossover"]:has(> [data-intent-trace-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-intent-trace-active] [data-intent-trace-selected] {
filter: drop-shadow(0 0 10px var(--frontend-stroke));
}
@@ -4590,7 +4577,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
svg[data-route-active] [data-node-id],
svg[data-route-active] [data-edge-from] { opacity: 0.11; }
+ svg[data-route-active] [data-graph-role="automatic-crossover"] > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.11; }
svg[data-route-active] [data-route-match] { opacity: 1; }
+ svg[data-route-active] [data-graph-role="automatic-crossover"]:has(> [data-route-match]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-route-active] [data-route-start] {
filter: drop-shadow(0 0 11px var(--frontend-stroke));
}
@@ -4603,6 +4592,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg[data-route-journey] [data-route-match][data-route-journey-state="past"] { opacity: 0.62; }
svg[data-route-journey] [data-route-match][data-route-journey-state="future"] { opacity: 0.34; }
svg[data-route-journey] [data-route-match][data-route-journey-state="current"] { opacity: 1; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="past"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.62; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="future"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 0.34; }
+ svg[data-route-journey] [data-graph-role="automatic-crossover"]:has(> [data-route-match][data-route-journey-state="current"]) > [data-graph-role="automatic-crossover-underlay"] { opacity: 1; }
svg[data-route-journey] [data-node-id][data-route-journey-current] {
filter: drop-shadow(0 0 10px var(--backend-stroke));
}
@@ -4694,93 +4686,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: drop-shadow(0 0 3px var(--frontend-stroke));
}
- /* Story Trail is a viewer-only overlay derived from the ordered focus IDs
- of the active guided view. The authored edge stays underneath with its
- original color, dash pattern, marker, and geometry intact. */
- .story-trail-overlay { pointer-events: none; }
- .story-carrier-overlay { pointer-events: none; }
- .story-trail-flow {
- fill: none;
- stroke: var(--frontend-stroke);
- stroke-width: 2.8;
- stroke-linecap: round;
- vector-effect: non-scaling-stroke;
- opacity: 0.34;
- filter: drop-shadow(0 0 2px var(--frontend-stroke));
- }
- svg[data-story-beat] [data-story-step] {
- opacity: 0.22;
- filter: saturate(0.42);
- transition: opacity 180ms ease, filter 180ms ease;
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="past"] {
- opacity: 0.72;
- filter: saturate(0.82);
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="next"] {
- opacity: 0.5;
- filter: saturate(0.66);
- }
- svg[data-story-beat] [data-story-step][data-story-beat-state="active"] {
- opacity: 1;
- filter: drop-shadow(0 0 7px var(--frontend-stroke));
- animation: archify-story-beat-node 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
- }
- svg[data-story-beat] [data-edge-from][data-story-beat-step] {
- opacity: 0.16;
- transition: opacity 160ms ease;
- }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="past"] { opacity: 0.58; }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="next"] { opacity: 0.34; }
- svg[data-story-beat] [data-edge-from][data-story-beat-step][data-story-beat-state="active"] { opacity: 1; }
- svg[data-story-beat] .story-trail-flow { opacity: 0; transition: opacity 160ms ease; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="past"] { opacity: 0.34; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="next"] { opacity: 0.2; }
- svg[data-story-beat] .story-trail-flow[data-story-beat-state="active"] { opacity: 0.92; }
- svg[data-story-beat] .story-trail-flow[data-story-pulse="true"] {
- stroke-dasharray: 2 13;
- stroke-dashoffset: 30;
- opacity: 0.92;
- animation: archify-story-flow 0.78s linear 1 both;
- }
- svg[data-preset="blueprint"] .story-trail-flow {
- stroke-linecap: square;
- filter: none;
- opacity: 0.5;
- }
- svg[data-preset="blueprint"][data-story-beat] [data-story-step][data-story-beat-state="active"] {
- filter: none;
- animation: none;
- }
- svg[data-preset="editorial"] .story-trail-flow { filter: none; }
- svg[data-preset="editorial"][data-story-beat] [data-story-step][data-story-beat-state="active"] {
- filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--text) 16%, transparent));
- }
-
- /* Chapter Delta Preview is a static, pre-commit comparison between two
- chapter focus sets. Symbols in the rail carry the meaning without color;
- these SVG rules only make exact stable-ID membership easier to scan. */
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] {
- opacity: 0.1 !important;
- filter: none !important;
- transition: none !important;
- }
- svg[data-chapter-preview] .story-trail-overlay { opacity: 0.08 !important; }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="stay"] {
- opacity: 0.76 !important;
- filter: saturate(0.7) !important;
- }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="enter"] {
- opacity: 1 !important;
- filter: saturate(1.2) !important;
- }
- svg[data-chapter-preview] [data-node-id][data-chapter-preview-role="leave"] {
- opacity: 0.28 !important;
- filter: grayscale(0.72) !important;
- }
- svg[data-preset="blueprint"][data-chapter-preview] [data-node-id] { filter: none !important; }
-
/* Dashed boundary variants */
.c-security-group { fill: transparent; stroke: var(--security-stroke); stroke-dasharray: 4,4; }
.c-region { fill: rgba(251, 191, 36, 0.05); stroke: var(--cloud-stroke); stroke-dasharray: 8,4; }
@@ -4794,6 +4699,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
animation: archify-edge-flow 2.4s linear 1;
animation-delay: calc(var(--step, 0) * 160ms);
}
+ html[data-ambient-motion="running"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: archify-edge-flow 2.4s linear 1;
+ animation-delay: calc(var(--step, 0) * 160ms);
+ }
html[data-ambient-motion="running"] svg[data-animation="trace"] [data-animate="node"] {
transform-box: fill-box;
transform-origin: center;
@@ -4805,6 +4714,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: drop-shadow(0 0 3px var(--arrow-emphasis));
animation-duration: 1.75s;
}
+ svg[data-preset="signal-flow"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 1.75s; }
svg[data-preset="signal-flow"][data-animation="trace"] [data-animate="node"] {
animation-duration: 3.1s;
}
@@ -4813,6 +4723,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
animation-duration: 2.15s;
}
+ svg[data-preset="blueprint"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 2.15s; }
svg[data-preset="blueprint"][data-animation="trace"] [data-animate="node"] {
animation-name: archify-blueprint-node-pulse;
animation-duration: 3.8s;
@@ -4821,18 +4732,23 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
animation-duration: 2.2s;
}
+ svg[data-preset="editorial"][data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] { animation-duration: 2.2s; }
svg[data-preset="editorial"][data-animation="trace"] [data-animate="node"] {
animation-name: archify-editorial-node-pulse;
animation-duration: 3.5s;
}
- /* Embedded proofs are static until a named Story Trail chapter is played.
- This keeps proof grids calm and ensures ?play=1 stops all viewer motion
- after one 3.2 second chapter instead of leaving ambient trace loops on. */
+ /* Embedded proofs stay static so proof grids are calm instead of leaving
+ ambient trace loops on. */
html[data-embed="true"] svg[data-animation="trace"] [data-animate],
html[data-share-playback="true"] svg[data-animation="trace"] [data-animate] {
animation: none !important;
stroke-dashoffset: 0;
}
+ html[data-embed="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"],
+ html[data-share-playback="true"] svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
+ animation: none !important;
+ stroke-dashoffset: 0;
+ }
@keyframes archify-edge-flow {
0% { stroke-dasharray: 10 8; stroke-dashoffset: 54; opacity: 0.42; }
88% { stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 1; }
@@ -4863,13 +4779,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backend-stroke) 52%, transparent); }
55%, 100% { box-shadow: 0 0 0 0.32rem transparent; }
}
- @keyframes archify-guided-progress {
- from { transform: scaleX(var(--guided-progress-start, 0)); }
- to { transform: scaleX(1); }
- }
- @keyframes archify-story-flow {
- to { stroke-dashoffset: 0; }
- }
+
@keyframes archify-intent-trace-flow {
0% { opacity: 0.28; stroke-dashoffset: 0; }
12%, 78% { opacity: 0.94; }
@@ -4900,11 +4810,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
13%, 82% { opacity: 1; }
100% { opacity: 0; }
}
- @keyframes archify-story-beat-node {
- from { opacity: 0.48; filter: saturate(0.6); }
- 58% { opacity: 1; filter: drop-shadow(0 0 10px var(--frontend-stroke)); }
- to { opacity: 1; filter: drop-shadow(0 0 7px var(--frontend-stroke)); }
- }
+
@keyframes archify-share-cue-enter {
from { opacity: 0; transform: translate(-50%, -0.45rem); }
to { opacity: 1; transform: translate(-50%, 0); }
@@ -4922,30 +4828,16 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
animation: none !important;
stroke-dashoffset: 0;
}
- .guided-view-progress span {
+ svg[data-animation="trace"] [data-graph-role="automatic-crossover"]:has(> [data-animate="edge"]) > [data-graph-role="automatic-crossover-underlay"] {
animation: none !important;
- transform: scaleX(1) !important;
+ stroke-dashoffset: 0;
}
- .story-trail-flow,
.intent-trace-flow,
.route-probe-flow,
.semantic-lens,
.diagram-guide,
- [data-story-step],
- .overview-map-live,
- .guided-view-stop,
- .share-chapter-cue,
- .chapter-handoff-anchor,
- .share-chapter-state::before,
- .share-chapter-progress span { animation: none !important; }
- .guided-view-chapter,
- svg[data-chapter-preview] [data-node-id],
- svg[data-chapter-preview] [data-edge-from] { transition: none !important; }
- svg[data-story-playing="true"] .story-trail-flow {
- stroke-dasharray: none;
- stroke-dashoffset: 0;
- opacity: 0.55;
- }
+ .overview-map-live { animation: none !important; }
+
.intent-trace-flow {
animation: none !important;
stroke-dasharray: none;
@@ -4958,8 +4850,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
stroke-dashoffset: 0;
opacity: 0.78;
}
- .route-journey-overlay,
- .story-carrier-overlay { display: none !important; }
+ .route-journey-overlay { display: none !important; }
.semantic-lens-flow {
animation: none !important;
stroke-dasharray: none;
@@ -4968,7 +4859,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
filter: none;
}
.relationship-pulse-overlay { display: none !important; }
- .guided-view-chapter { transition: none !important; }
.source-evidence-beacon,
svg [data-node-id], svg [data-edge-from], svg [data-detail], svg [data-detail-anchor], svg [data-legend-hit], svg { transition: none !important; }
}
@@ -4979,6 +4869,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Motion appears only for trace-enabled artifacts and has no shortcut;
Keyboard: T toggles theme, S cycles style, F toggles the stage, E opens export. -->
<div class="toolbar" role="toolbar" aria-label="Diagram actions">
+ <div class="toolbar-group">
<button id="btn-theme" type="button"
title="Toggle theme (T)"
aria-label="Toggle color theme"
@@ -4999,7 +4890,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span class="toolbar-icon toolbar-chevron" aria-hidden="true"></span>
</button>
<div class="preset-menu" id="preset-menu" role="menu" aria-label="Visual style">
- <div class="preset-menu-heading" role="presentation"><span>Visual identity</span><span>S cycles</span></div>
+ <div class="preset-menu-heading" role="presentation"><span>Visual identity</span><span class="preset-menu-shortcut"><kbd>S</kbd>to cycle</span></div>
<button class="preset-option" data-preset-value="classic" type="button" role="menuitemradio" aria-checked="false" tabindex="-1">
<span class="preset-option-swatch classic" aria-hidden="true"></span>
<span class="preset-option-copy"><strong>Classic</strong><small>Stable technical default</small></span>
@@ -5036,6 +4927,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span id="present-icon" class="toolbar-icon" aria-hidden="true"></span>
<span id="present-label">Present</span>
</button>
+ </div>
<div class="export-wrap">
<button id="btn-export" type="button"
title="Export diagram (E)"
@@ -5052,10 +4944,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="export-menu-section" role="group" aria-label="Share">
<span class="export-menu-heading" aria-hidden="true">Share</span>
- <button data-format="share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
<button data-action="route-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>Route Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
<button data-action="reach-share-card" type="button" role="menuitem" tabindex="-1" hidden disabled><span class="export-item-copy"><strong>Reach Share Card</strong><small class="hint">1200&times;630 PNG</small></span></button>
- <button data-action="copy-share-card" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Copy Share Card</strong><small class="hint">PNG to clipboard</small></span></button>
<button data-action="copy" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>Copy diagram</strong><small class="hint">PNG to clipboard</small></span></button>
</div>
<div class="export-menu-section" role="group" aria-label="Raster images">
@@ -5066,7 +4956,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="export-menu-section" role="group" aria-label="Vector and motion">
<span class="export-menu-heading" aria-hidden="true">Vector &amp; motion</span>
- <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG</strong><small class="hint">Editable vector</small></span></button>
+ <button data-format="svg" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Auto</strong><small class="hint">Matches host theme</small></span></button>
+ <button data-format="svg-light" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Light</strong><small class="hint">Always light</small></span></button>
+ <button data-format="svg-dark" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>SVG · Dark</strong><small class="hint">Always dark</small></span></button>
<button data-format="webm" type="button" role="menuitem" tabindex="-1"><span class="export-item-copy"><strong>WebM</strong><small class="hint">6s motion</small></span></button>
</div>
</div>
@@ -5086,52 +4978,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<p class="subtitle">Local-first desktop AI workbench — sessions, tools, permissions, recovery</p>
</div>
- <script id="archify-guided-views-data" type="application/json">[]</script>
-
- <script id="archify-i18n-data" type="application/json">{"locale":"en","messages":{"viewer.kind.frontend":"Frontend","viewer.kind.backend":"Backend","viewer.kind.database":"Database","viewer.kind.cloud":"Cloud","viewer.kind.security":"Security","viewer.kind.messagebus":"Message bus","viewer.kind.external":"External","viewer.kind.neutral":"Neutral","viewer.kind.node":"Node","viewer.kind.start":"Start","viewer.kind.active":"Active","viewer.kind.waiting":"Waiting","viewer.kind.decision":"Decision","viewer.kind.success":"Success","viewer.kind.failure":"Failure","viewer.toolbar.actions":"Diagram actions","viewer.theme.toggle.title":"Toggle theme (T)","viewer.theme.toggle":"Toggle color theme","viewer.theme.dark":"Dark","viewer.theme.light":"Light","viewer.preset.choose.title":"Choose visual style (S cycles)","viewer.preset.choose":"Choose visual style","viewer.preset.style":"Style","viewer.preset.menu":"Visual style","viewer.preset.identity":"Visual identity","viewer.preset.cycles":"S cycles","viewer.preset.classic":"Classic","viewer.preset.classic.short":"Classic","viewer.preset.classic.hint":"Stable technical default","viewer.preset.flow":"Signal Flow","viewer.preset.flow.short":"Flow","viewer.preset.flow.hint":"Motion-forward presentation","viewer.preset.blueprint":"Blueprint","viewer.preset.blueprint.hint":"Engineering review","viewer.preset.editorial":"Editorial","viewer.preset.editorial.hint":"Publication and launch notes","viewer.preset.badge.signalFlow":"SIGNAL FLOW","viewer.preset.badge.blueprint":"BLUEPRINT / REV 01","viewer.preset.badge.editorial":"EDITORIAL / FIELD NOTE","viewer.preset.badge.editorialPlate":"ARCHIFY / PLATE 04","viewer.preset.current":"Visual style: {style}. Choose visual style","viewer.motion.live":"Live","viewer.motion.still":"Still","viewer.motion.pause":"Pause motion","viewer.motion.resume":"Resume motion","viewer.motion.reduced":"Motion paused by reduced-motion preference","viewer.motion.hidden":"Motion paused while this page is hidden","viewer.motion.yielding":"Pause motion; currently yielding to {owner}","viewer.motion.yielding.title":"Live preview enabled · yielding to {owner}","viewer.owner.story":"the guided story","viewer.owner.chapter":"the active chapter","viewer.owner.chapterPreview":"the chapter delta preview","viewer.owner.handoff":"the chapter handoff","viewer.owner.route":"Route Probe","viewer.owner.lens":"Semantic Lens","viewer.owner.relationship":"Relationship Preview","viewer.owner.intent":"Intent Trace","viewer.owner.focus":"semantic focus","viewer.owner.legend":"legend preview","viewer.owner.reader":"reader interaction","viewer.present.enter":"Enter presentation stage","viewer.present.enter.title":"Presentation stage (F)","viewer.present.exit":"Exit presentation stage","viewer.present.exit.title":"Exit presentation stage (F or Escape)","viewer.present.present":"Present","viewer.present.exit.label":"Exit","viewer.export.button":"Export","viewer.export.button.title":"Export diagram (E)","viewer.export.diagram":"Export diagram","viewer.export.menu":"Export","viewer.export.subtitle":"Portable, clean outputs","viewer.export.share":"Share","viewer.export.shareCard":"Share Card","viewer.export.routeShareCard":"Route Share Card","viewer.export.reachShareCard":"Reach Share Card","viewer.export.copyShareCard":"Copy Share Card","viewer.export.copyDiagram":"Copy diagram","viewer.export.clipboardPng":"PNG to clipboard","viewer.export.raster":"Raster images","viewer.export.image":"Image","viewer.export.lossless":"Lossless image","viewer.export.compact":"Compact image","viewer.export.modern":"Modern image","viewer.export.vectorMotion":"Vector and motion","viewer.export.vectorMotion.heading":"Vector \u0026 motion","viewer.export.editable":"Editable vector","viewer.export.motion6s":"6s motion","viewer.export.unsupported":"Not supported by this browser","viewer.export.clipboardUnsupported":"Clipboard image write not supported by this browser","viewer.export.clipboardUnsupported.period":"Clipboard image write not supported by this browser.","viewer.export.clipboardUnsupported.short":"Clipboard image write not supported in this browser.","viewer.export.motionUnavailable":"Motion capture unavailable in this browser","viewer.export.webmUnavailable":"WebM unavailable in this browser","viewer.export.failed":"Export failed: {message}","viewer.export.unknownVariant":"Unknown Share Card variant: {variant}","viewer.export.routeRequired":"Trace a route before exporting a Route Share Card","viewer.export.reachRequired":"Trace authored reach before exporting a Reach Share Card","viewer.export.unknown":"unknown","viewer.export.routeFailed":"Route Share Card export failed: {message}","viewer.export.reachFailed":"Reach Share Card export failed: {message}","viewer.export.copyFailed":"Copy failed: {message}","viewer.export.copiedPng":"Copied PNG to clipboard","viewer.export.copiedShare":"Copied Share Card","viewer.export.downloadedShare":"Downloaded Share Card","viewer.export.downloadedRoute":"Downloaded Route Share Card","viewer.export.downloadedReach":"Downloaded Reach Share Card","viewer.export.downloadedWebm":"Downloaded WebM","viewer.export.recording":"Recording 6 seconds of motion…","viewer.export.card.routeSummary.one":"Route: {source} → {target} · {count} directed hop","viewer.export.card.routeSummary.other":"Route: {source} → {target} · {count} directed hops","viewer.export.card.reachSummary":"Authored {direction} from {origin} · {nodes} · {links} · max {hops}","viewer.export.card.node.one":"{count} node","viewer.export.card.node.other":"{count} nodes","viewer.export.card.link.one":"{count} link","viewer.export.card.link.other":"{count} links","viewer.export.card.hop.one":"{count} hop","viewer.export.card.hop.other":"{count} hops","viewer.export.card.routeBadge":"ARCHIFY · ROUTE · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction} REACH","viewer.export.card.defaultBadge":"ARCHIFY · {preset} · {theme}","viewer.export.direction.upstream":"Upstream","viewer.export.direction.downstream":"Downstream","viewer.export.error.canvasUnavailable":"Canvas unavailable for {label}","viewer.export.error.contextUnavailable":"2D canvas context unavailable for {label}","viewer.export.error.toBlobUnavailable":"canvas.toBlob unavailable for {label}","viewer.export.error.toBlobNull":"canvas.toBlob returned no data for {label}","viewer.export.error.variantsCombined":"Share Card variants cannot be combined","viewer.export.error.viewerState":"Share Card export could not remove temporary viewer state","viewer.export.error.routeState":"Route Card export could not preserve the resolved route safely","viewer.export.error.reachState":"Reach Card export could not preserve authored reach safely","viewer.export.error.webmRequirements":"WebM motion export requires a trace animation and browser MediaRecorder support","viewer.export.error.mediaRecorder":"MediaRecorder failed","viewer.export.error.emptyWebm":"MediaRecorder produced an empty WebM","viewer.export.error.webmBackground":"SVG background could not be loaded for WebM export","viewer.guided.region":"Guided diagram views","viewer.guided.previous":"Previous guided view","viewer.guided.previous.title":"Previous guided view ([)","viewer.guided.next":"Next guided view","viewer.guided.next.title":"Next guided view (])","viewer.guided.views":"Guided views","viewer.guided.explore":"Explore this system","viewer.guided.intro":"Step through curated paths without changing the source diagram.","viewer.guided.trail":"Story trail","viewer.guided.beat":"Beat","viewer.guided.nextBeat":"Next","viewer.guided.play":"Play guided story","viewer.guided.play.title":"Play guided story (P)","viewer.guided.pause":"Pause guided story","viewer.guided.pause.title":"Pause guided story (P)","viewer.guided.replay":"Replay guided story","viewer.guided.replay.title":"Replay guided story (P)","viewer.guided.playStory":"Play story","viewer.guided.pauseStory":"Pause","viewer.guided.replayStory":"Replay story","viewer.guided.motionUnavailable":"Story playback unavailable while motion is Still","viewer.guided.enableMotion":"Switch motion to Live to play the guided story","viewer.guided.selectBeatLink":"Select a Story Beat to copy its exact link","viewer.guided.copyMoment":"Copy moment","viewer.guided.momentCopied":"Moment link copied","viewer.guided.momentCopyFailed":"Could not copy story moment link","viewer.guided.copied":"Copied","viewer.guided.copyFailed":"Copy failed","viewer.guided.showAll":"Show all","viewer.guided.showAll.aria":"Show entire diagram","viewer.guided.chapters":"Story chapters","viewer.guided.storyTrail":"Story trail for {label}: {count} beats","viewer.guided.chapter.open":"Open chapter {index} of {total}: {label}, {count} stops","viewer.guided.chapter.current":"Current chapter {index} of {total}: {label}, {count} stops","viewer.guided.chapter.selectedNodes":"{count} selected nodes","viewer.guided.chapter.stops":"{count} stops","viewer.guided.chapter.stop.one":"{count} stop","viewer.guided.chapter.stop.other":"{count} stops","viewer.guided.chapter.current.title":"{label} — current chapter, {count} stops","viewer.guided.chapter.delta.expanded":"{stay} stay, {enter} enter, {leave} leave","viewer.guided.chapter.delta.aria":"Open chapter {index} of {total}: {label}. Chapter focus delta: {delta}","viewer.guided.chapter.delta.title":"{label} — {delta} chapter focus","viewer.guided.handoff":"{from} → {to} · via {label}","viewer.guided.share.chapter":"Chapter {index} / {total}","viewer.guided.share.initial":"Chapter 01 / 01","viewer.guided.share.default":"Guided chapter","viewer.guided.state.ready":"Ready","viewer.guided.state.playing":"Playing","viewer.guided.state.settled":"Settled","viewer.guided.state.paused":"Paused","viewer.guided.state.pinned":"Pinned","viewer.guided.state.still":"Still","viewer.guided.share.step":"Step {index} / {total} · {label}","viewer.guided.share.staticMoment":"{step} · Static moment","viewer.guided.share.complete":"{count} steps complete · {note}","viewer.guided.share.settled":"Path settled for reading.","viewer.guided.share.staticPath":"{count} steps · Static path","viewer.guided.share.ready":"{count} steps · Ready","viewer.guided.share.aria":"{state} chapter {index} of {total}: {label}. {beat}. {route}","viewer.guided.beat.start":"Beat {index} / {total} · {label} · starting point","viewer.guided.beat.forward":"Beat {index} / {total} · {from} → {to}","viewer.guided.beat.reverse":"Beat {index} / {total} · {from} → {to} · reverse authored link","viewer.guided.beat.multiple":"Beat {index} / {total} · {from} ⇄ {to} · {count} authored links","viewer.guided.beat.group":"Beat {index} / {total} · {from} · {to} · grouped · no direct link","viewer.guided.beat.aria.prefix":"Story beat {index} of {total}: {label}. ","viewer.guided.beat.aria.start":"Starting point.","viewer.guided.beat.aria.forward":"From {from} through one authored forward relationship.","viewer.guided.beat.aria.reverse":"From {from}; the authored relationship points from {to} to {from}.","viewer.guided.beat.aria.multiple":"From {from} through {count} authored relationships; shown without arbitrary motion.","viewer.guided.beat.aria.group":"Grouped from {from} with no direct authored relationship.","viewer.guided.caption.start":"Starting point","viewer.guided.caption.grouped":"Grouped transition · no direct authored link","viewer.guided.caption.more":" +{count} more","viewer.guided.caption.reverse":"Reverse authored relationship","viewer.guided.caption.relationships":"{count} authored relationships","viewer.guided.caption.relationship":"Authored relationship","viewer.guided.caption.direction":"authored direction: {from} → {to}","viewer.guided.caption.starting":"Authored starting point","viewer.guided.beatLink":"Copy link to current story moment: Beat {index} of {total}: {label}","viewer.guided.noStory":"This diagram has no authored guided story.","viewer.guide.eyebrow":"Diagram guide","viewer.guide.close":"Close diagram guide","viewer.guide.inspecting":"Inspecting compiled semantics","viewer.guide.actions":"Diagram exploration actions","viewer.guide.find":"Find any node","viewer.guide.find.hint":"Search labels, responsibilities, kinds, and stable IDs.","viewer.guide.route":"Trace a route","viewer.guide.route.aria":"Trace a directed route","viewer.guide.route.hint":"Ask how two semantic nodes connect in authored direction.","viewer.guide.map":"See the whole system","viewer.guide.map.hint":"Open Semantic Radar with a live viewport and stable nodes.","viewer.guide.lens":"Compare semantic kinds","viewer.guide.lens.hint":"Count roles, reveal their traffic, and compare direct authored links.","viewer.guide.story":"Play the guided story","viewer.guide.story.hint":"Walk the authored chapters and real relationships.","viewer.guide.present":"Enter Presentation Stage","viewer.guide.present.hint":"Give the live diagram the viewport without changing export.","viewer.guide.shortcuts":"Additional keyboard shortcuts","viewer.guide.shortcut.export":"Export","viewer.guide.shortcut.theme":"Theme","viewer.guide.shortcut.style":"Style","viewer.guide.shortcut.reset":"Reset","viewer.guide.shortcut.zoomIn":"Zoom in","viewer.guide.shortcut.zoomOut":"Zoom out","viewer.guide.shortcut.close":"Close","viewer.guide.facts":"{nodes} · {relationships} · {views}","viewer.guide.fact.node.one":"{count} semantic node","viewer.guide.fact.node.other":"{count} semantic nodes","viewer.guide.fact.relationship.one":"{count} relationship","viewer.guide.fact.relationship.other":"{count} relationships","viewer.guide.fact.view.one":"{count} guided view","viewer.guide.fact.view.other":"{count} guided views","viewer.guide.story.available.one":"Walk {count} authored chapter and its real relationships.","viewer.guide.story.available.other":"Walk {count} authored chapters and their real relationships.","viewer.guide.story.unavailable":"No authored guided story in this diagram.","viewer.guide.open":"Open diagram guide","viewer.guide.noStory":"This diagram has no authored guided story.","viewer.finder.title":"Find a node","viewer.finder.close":"Close node finder","viewer.finder.placeholder":"Search labels or IDs","viewer.finder.search":"Search diagram nodes","viewer.finder.results":"Diagram nodes","viewer.finder.empty":"No matching nodes","viewer.finder.result.focus":"Focus {label}","viewer.finder.result.routeStart":"Choose {label} as route start","viewer.finder.result.routeTarget":"Choose {label} as route destination, {links}","viewer.finder.status.empty":"No matching nodes","viewer.finder.status.count.one":"{count} matching node","viewer.finder.status.count.other":"{count} matching nodes","viewer.finder.noun.nodes":"nodes","viewer.finder.link.one":"{count} link","viewer.finder.link.other":"{count} links","viewer.finder.result.focus.one":"Focus {label}, {count} related connection","viewer.finder.result.focus.other":"Focus {label}, {count} related connections","viewer.finder.status.filtered":"{visible} of {available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"Semantic passport","viewer.passport.metadata":"Node metadata","viewer.passport.evidence":"Verified source evidence","viewer.passport.verified":"Verified source","viewer.passport.reach":"Authored reach","viewer.passport.reach.trace":"Trace authored reachability","viewer.passport.upstream":"Upstream","viewer.passport.downstream":"Downstream","viewer.passport.upstream.trace":"Trace upstream authored reachability","viewer.passport.downstream.trace":"Trace downstream authored reachability","viewer.passport.close":"Close semantic passport","viewer.passport.copy":"Copy link","viewer.passport.copy.focus":"Copy link to focused node","viewer.passport.relations":"Relations","viewer.passport.relations.show":"Show connected relationships","viewer.passport.relations.hide":"Hide connected relationships","viewer.passport.relations.list":"Connected relationships","viewer.passport.copyRelation":"Copy relation","viewer.passport.copyNode":"Copy node","viewer.passport.copyPinned":"Copy link to pinned relationship","viewer.passport.copySource":"Copy link to source node","viewer.passport.copy.focused.success":"Focused node link copied","viewer.passport.copy.pinned.success":"Pinned relationship link copied","viewer.passport.copy.focused.failed":"Could not copy focused node link","viewer.passport.copy.pinned.failed":"Could not copy pinned relationship link","viewer.passport.relationship.none":"No connected relationships","viewer.passport.relationship.count.one":"{count} relation","viewer.passport.relationship.count.other":"{count} relations","viewer.passport.relationship.show.one":"Show {count} connected relationship","viewer.passport.relationship.show.other":"Show {count} connected relationships","viewer.passport.relationship.summary":"{out} outgoing · {in} incoming{loops}","viewer.passport.relationship.loops":" · {count} loop","viewer.passport.relationship.explorer":"Direct relationship explorer","viewer.passport.relationship.help":"Use arrow keys to explore relationships. Press Enter or Space to pin details; Escape clears.","viewer.passport.relationship.loopsBack":"loops back","viewer.passport.relationship.connectsTo":"connects to","viewer.passport.relationship.connectsFrom":"connects from","viewer.passport.relationship.pinned":"Pinned relationship · {from} → {to} · {label}","viewer.passport.relationship.inspect":"Inspect relationship {index} of {total}: {from} to {to}, {label}. Press Enter for details.","viewer.passport.relationship.group.out":"Outgoing","viewer.passport.relationship.group.in":"Incoming","viewer.passport.relationship.group.loop":"Self loops","viewer.passport.relationship.row":"{group}: {relationship}, {neighbor}","viewer.passport.relationship.direction.out":"OUT →","viewer.passport.relationship.direction.in":"← IN","viewer.passport.relationship.direction.loop":"LOOP","viewer.passport.sourceCount.one":"{count} verified source reference","viewer.passport.sourceCount.other":"{count} verified source references","viewer.passport.sourceMarker":"SRC","viewer.passport.beacon.one":"{count} verified source; focus this node to inspect","viewer.passport.beacon.other":"{count} verified sources; focus this node to inspect","viewer.passport.repository.open":"Open verified repository revision {revision}","viewer.passport.source.open":"Open verified source {path} at revision {revision}","viewer.passport.source.openLink":"Open ↗","viewer.passport.reach.upstream.one":"Trace {count} upstream authored node","viewer.passport.reach.upstream.other":"Trace {count} upstream authored nodes","viewer.passport.reach.downstream.one":"Trace {count} downstream authored node","viewer.passport.reach.downstream.other":"Trace {count} downstream authored nodes","viewer.passport.reach.noUpstream":"No upstream authored nodes","viewer.passport.reach.noDownstream":"No downstream authored nodes","viewer.passport.reach.status":"{direction} · {nodes} nodes · {links} links · max {hops} hops","viewer.route.eyebrow":"Route probe","viewer.route.start":"Choose a start node","viewer.route.start.find":"Find start","viewer.route.start.find.aria":"Find a route start","viewer.route.copy":"Copy link","viewer.route.copy.aria":"Copy link to traced route","viewer.route.clear":"Clear","viewer.route.clear.aria":"Clear route probe","viewer.route.traced":"Traced route","viewer.route.pickTwo":"Pick two semantic nodes on the diagram","viewer.route.pickOne":"Pick a semantic node on the diagram","viewer.route.controls":"Route journey controls","viewer.route.previous":"Previous route position","viewer.route.play":"Play route journey","viewer.route.pause":"Pause route journey","viewer.route.replay":"Replay route journey","viewer.route.next":"Next route position","viewer.route.journey":"Journey","viewer.route.pause.label":"Pause","viewer.route.replay.label":"Replay","viewer.route.overview":"Overview","viewer.route.overview.aria":"Show complete route overview","viewer.route.instructions":"Choose the source, then the destination. Direction matters.","viewer.route.destination":"Choose a destination from {label}","viewer.route.destination.find":"Find target","viewer.route.destination.find.aria":"Find a reachable route destination","viewer.route.differentDestination":"Choose a different destination","viewer.route.distinct":"A route needs two distinct semantic nodes.","viewer.route.unreachable":"No directed route to {label}","viewer.route.unreachable.detail":"{target} is not reachable from {source}. Pick a highlighted destination.","viewer.route.start.instructions":"Select the source. The next step will reveal only directed destinations.","viewer.route.copy.success":"Traced route link copied","viewer.route.copy.failed":"Could not copy traced route link","viewer.route.position":"Route position {index} of {total}: {label}","viewer.route.step":"Step {index} of {total} · {phase} · {label}","viewer.route.motionRequired":"Automatic journey requires Live motion","viewer.route.trigger.clear":"Clear traced route","viewer.route.overview.status":"{nodes} · {hops} · shortest authored route","viewer.route.overview.node.one":"{count} node","viewer.route.overview.node.other":"{count} nodes","viewer.route.overview.hop.one":"{count} directed hop","viewer.route.overview.hop.other":"{count} directed hops","viewer.route.phase.playing":"Playing","viewer.route.phase.complete":"Complete","viewer.route.phase.inspecting":"Inspecting","viewer.route.destination.count.one":"{count} directed destination available. Pick a highlighted node.","viewer.route.destination.count.other":"{count} directed destinations available. Pick a highlighted node.","viewer.route.noOutgoing":"No outgoing route starts here. Clear and choose another source.","viewer.route.result.title":"{source} to {target}","viewer.route.finder.source.title":"Choose route start","viewer.route.finder.source.placeholder":"Search route sources","viewer.route.finder.source.empty":"No matching route sources","viewer.route.finder.source.results":"Nodes that can start a route","viewer.route.finder.source.noun":"route sources","viewer.route.finder.source.badge":"start","viewer.route.finder.target.title":"Destination from {label}","viewer.route.finder.target.placeholder":"Search reachable destinations","viewer.route.finder.target.empty":"No matching reachable destinations","viewer.route.finder.target.results":"Reachable route destinations","viewer.route.finder.target.noun":"reachable destinations","viewer.route.hop.one":"{count} hop","viewer.route.hop.other":"{count} hops","viewer.lens.eyebrow":"Semantic lens","viewer.lens.title":"Compare system roles","viewer.lens.close":"Close semantic lens","viewer.lens.instruction":"Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.","viewer.lens.kinds":"Semantic kinds","viewer.lens.choose":"Choose a kind to inspect its nodes and touching relationships.","viewer.lens.copy":"Copy link to semantic lens","viewer.lens.clear":"Clear semantic lens","viewer.lens.open":"Open semantic lens","viewer.lens.openActive":"Open active semantic lens","viewer.lens.legend":"Semantic legend","viewer.lens.legend.inspect.one":"Inspect {label}, {count} node","viewer.lens.legend.inspect.other":"Inspect {label}, {count} nodes","viewer.lens.kind.count.one":"{label}, {count} node","viewer.lens.kind.count.other":"{label}, {count} nodes","viewer.lens.compare.one":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationship","viewer.lens.compare.other":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationships","viewer.lens.single":"{nodes} · {relationships} · connected peers remain visible","viewer.lens.node.one":"{count} {label} node","viewer.lens.node.other":"{count} {label} nodes","viewer.lens.relationship.one":"{count} touching relationship","viewer.lens.relationship.other":"{count} touching relationships","viewer.radar.title":"Semantic radar","viewer.radar.building":"Building overview","viewer.radar.openFull":"Open full semantic radar","viewer.radar.open":"Open radar","viewer.radar.close":"Close semantic radar","viewer.radar.surface":"Diagram overview. Click a node to focus it, or use arrow keys to pan.","viewer.radar.click":"Click node","viewer.radar.drag":"Drag to pan","viewer.radar.space":"Semantic radar needs more MAP space.","viewer.radar.nodes":"Semantic diagram radar nodes","viewer.radar.focus":"Focus {label} from Semantic Radar","viewer.radar.status":"{count} nodes · {viewport}","viewer.radar.fullMap":"{count} nodes · full map","viewer.radar.compacted":"Radar compacted to avoid covering the Semantic Passport or MAP controls.","viewer.radar.cancelWaiting":"Cancel semantic radar waiting for more MAP space","viewer.radar.needsSpace":"Semantic radar needs more visible MAP space","viewer.radar.viewport.full":"full map","viewer.radar.viewport.width":"{percent}% width","viewer.radar.viewport.scale":"{percent}% viewport","viewer.nav.controls":"Diagram view controls","viewer.nav.route":"Trace a directed route","viewer.nav.route.title":"Trace route (R)","viewer.nav.route.short":"PATH","viewer.nav.radar":"Open semantic radar","viewer.nav.radar.title":"Semantic radar (M)","viewer.nav.radar.short":"MAP","viewer.nav.lens":"Open semantic lens","viewer.nav.lens.title":"Semantic lens (L)","viewer.nav.lens.short":"LENS","viewer.nav.find":"Find a node","viewer.nav.find.title":"Find a node (/)","viewer.nav.guide":"Open diagram guide","viewer.nav.guide.title":"Diagram guide (?)","viewer.nav.zoomOut":"Zoom out","viewer.nav.zoomOut.title":"Zoom out (-)","viewer.nav.reset":"Reset diagram view","viewer.nav.reset.title":"Reset view (0)","viewer.nav.read":"READ","viewer.nav.zoomIn":"Zoom in","viewer.nav.zoomIn.title":"Zoom in (+)","viewer.nav.camera":"{hint}. Reset diagram view","viewer.nav.camera.title":"{semantic}{hint} · reset view (0)","viewer.nav.camera.semantic":"Semantic camera active · ","viewer.nav.level.map":"MAP","viewer.nav.level.read":"READ","viewer.nav.level.full":"FULL","viewer.nav.level.auto":"AUTO","viewer.nav.detail.map":"Zoom in to reveal relationship labels and node context","viewer.nav.detail.read":"Zoom in again to reveal tags and annotations","viewer.nav.detail.full":"Full diagram detail","viewer.intent.summary":"{label}. {out} outgoing, {in} incoming{loops}. {total} connections. Press Enter for details.","viewer.intent.loops":", {count} self loop","viewer.common.copied":"Copied","viewer.common.copyFailed":"Copy failed","viewer.common.copyLink":"Copy link","viewer.common.clear":"Clear","viewer.common.close":"Close"}}</script>
- <div class="guided-views no-print" id="guided-views" hidden aria-label="Guided diagram views">
- <button id="guided-view-prev" type="button" aria-label="Previous guided view" title="Previous guided view ([)">&#8592;</button>
- <div class="guided-view-copy">
- <div class="guided-view-meta">
- <span>Guided views</span>
- <span id="guided-view-count"></span>
- <span class="guided-view-progress" aria-hidden="true"><span id="guided-view-progress-bar"></span></span>
- <span class="guided-view-handoff" id="guided-view-handoff" hidden aria-hidden="true"></span>
- </div>
- <strong id="guided-view-label">Explore this system</strong>
- <small id="guided-view-note" aria-live="polite" aria-atomic="true">Step through curated paths without changing the source diagram.</small>
- <div class="guided-view-trail" id="guided-view-trail" hidden role="group" aria-label="Story trail"></div>
- <div class="guided-story-caption" id="guided-story-caption" hidden aria-live="polite" aria-atomic="true">
- <span class="guided-story-caption-index" id="guided-story-caption-index">Beat</span>
- <strong id="guided-story-caption-route"></strong>
- <small id="guided-story-caption-detail"></small>
- <span class="guided-story-caption-next" id="guided-story-caption-next" hidden aria-hidden="true">
- <small>Next</small>
- <strong id="guided-story-caption-next-label"></strong>
- </span>
- </div>
- </div>
- <button id="guided-view-next" type="button" aria-label="Next guided view" title="Next guided view (])">&#8594;</button>
- <div class="guided-view-actions">
- <button class="guided-view-play" id="guided-view-play" type="button" aria-label="Play guided story" aria-pressed="false" title="Play guided story (P)">
- <span id="guided-view-play-icon" aria-hidden="true">&#9654;</span>
- <span id="guided-view-play-label">Play story</span>
- </button>
- <button class="guided-view-beat-link" id="guided-view-beat-link" type="button" aria-label="Select a Story Beat to copy its exact link" title="Select a Story Beat to copy its exact link" disabled>
- <span aria-hidden="true">&#35;</span>
- <span id="guided-view-beat-link-label">Copy moment</span>
- </button>
- <button class="guided-view-all" id="guided-view-all" type="button" aria-label="Show entire diagram">Show all</button>
- </div>
- <nav class="guided-view-index" id="guided-view-index" aria-label="Story chapters">
- <ol class="guided-view-chapters" id="guided-view-chapters"></ol>
- </nav>
- </div>
+ <script id="archify-i18n-data" type="application/json">{"locale":"en","messages":{"viewer.kind.frontend":"Frontend","viewer.kind.backend":"Backend","viewer.kind.database":"Database","viewer.kind.cloud":"Cloud","viewer.kind.security":"Security","viewer.kind.messagebus":"Message bus","viewer.kind.external":"External","viewer.kind.neutral":"Neutral","viewer.kind.node":"Node","viewer.kind.start":"Start","viewer.kind.active":"Active","viewer.kind.waiting":"Waiting","viewer.kind.decision":"Decision","viewer.kind.success":"Success","viewer.kind.failure":"Failure","viewer.toolbar.actions":"Diagram actions","viewer.theme.toggle.title":"Toggle theme (T)","viewer.theme.toggle":"Toggle color theme","viewer.theme.dark":"Dark","viewer.theme.light":"Light","viewer.preset.choose.title":"Choose visual style (S cycles)","viewer.preset.choose":"Choose visual style","viewer.preset.style":"Style","viewer.preset.menu":"Visual style","viewer.preset.identity":"Visual identity","viewer.preset.cycles":"to cycle","viewer.preset.classic":"Classic","viewer.preset.classic.short":"Classic","viewer.preset.classic.hint":"Stable technical default","viewer.preset.flow":"Signal Flow","viewer.preset.flow.short":"Flow","viewer.preset.flow.hint":"Motion-forward presentation","viewer.preset.blueprint":"Blueprint","viewer.preset.blueprint.hint":"Engineering review","viewer.preset.editorial":"Editorial","viewer.preset.editorial.hint":"Publication and launch notes","viewer.preset.badge.signalFlow":"SIGNAL FLOW","viewer.preset.badge.blueprint":"BLUEPRINT / REV 01","viewer.preset.badge.editorial":"EDITORIAL / FIELD NOTE","viewer.preset.badge.editorialPlate":"ARCHIFY / PLATE 04","viewer.preset.current":"Visual style: {style}. Choose visual style","viewer.motion.live":"Live","viewer.motion.still":"Still","viewer.motion.pause":"Pause motion","viewer.motion.resume":"Resume motion","viewer.motion.reduced":"Motion paused by reduced-motion preference","viewer.motion.hidden":"Motion paused while this page is hidden","viewer.motion.yielding":"Pause motion; currently yielding to {owner}","viewer.motion.yielding.title":"Live preview enabled · yielding to {owner}","viewer.owner.route":"Route Probe","viewer.owner.lens":"Semantic Lens","viewer.owner.relationship":"Relationship Preview","viewer.owner.intent":"Intent Trace","viewer.owner.focus":"semantic focus","viewer.owner.legend":"legend preview","viewer.owner.reader":"reader interaction","viewer.present.enter":"Enter presentation stage","viewer.present.enter.title":"Presentation stage (F)","viewer.present.exit":"Exit presentation stage","viewer.present.exit.title":"Exit presentation stage (F or Escape)","viewer.present.present":"Present","viewer.present.exit.label":"Exit","viewer.export.button":"Export","viewer.export.button.title":"Export diagram (E)","viewer.export.diagram":"Export diagram","viewer.export.menu":"Export","viewer.export.subtitle":"Portable, clean outputs","viewer.export.share":"Share","viewer.export.shareCard":"Share Card","viewer.export.routeShareCard":"Route Share Card","viewer.export.reachShareCard":"Reach Share Card","viewer.export.copyDiagram":"Copy diagram","viewer.export.clipboardPng":"PNG to clipboard","viewer.export.raster":"Raster images","viewer.export.image":"Image","viewer.export.lossless":"Lossless image","viewer.export.compact":"Compact image","viewer.export.modern":"Modern image","viewer.export.vectorMotion":"Vector and motion","viewer.export.vectorMotion.heading":"Vector \u0026 motion","viewer.export.editable":"Editable vector","viewer.export.svg.auto":"SVG · Auto","viewer.export.svg.auto.hint":"Matches host theme","viewer.export.svg.light":"SVG · Light","viewer.export.svg.light.hint":"Always light","viewer.export.svg.dark":"SVG · Dark","viewer.export.svg.dark.hint":"Always dark","viewer.export.motion6s":"6s motion","viewer.export.unsupported":"Not supported by this browser","viewer.export.clipboardUnsupported":"Clipboard image write not supported by this browser","viewer.export.clipboardUnsupported.short":"Clipboard image write not supported in this browser.","viewer.export.motionUnavailable":"Motion capture unavailable in this browser","viewer.export.webmUnavailable":"WebM unavailable in this browser","viewer.export.failed":"Export failed: {message}","viewer.export.unknownVariant":"Unknown Share Card variant: {variant}","viewer.export.routeRequired":"Trace a route before exporting a Route Share Card","viewer.export.reachRequired":"Trace authored reach before exporting a Reach Share Card","viewer.export.unknown":"unknown","viewer.export.routeFailed":"Route Share Card export failed: {message}","viewer.export.reachFailed":"Reach Share Card export failed: {message}","viewer.export.copyFailed":"Copy failed: {message}","viewer.export.copiedPng":"Copied PNG to clipboard","viewer.export.downloadedRoute":"Downloaded Route Share Card","viewer.export.downloadedReach":"Downloaded Reach Share Card","viewer.export.downloadedWebm":"Downloaded WebM","viewer.export.recording":"Recording 6 seconds of motion…","viewer.export.card.routeSummary.one":"Path: {source} → {target} · {count} step","viewer.export.card.routeSummary.other":"Path: {source} → {target} · {count} steps","viewer.export.card.reachSummary":"Authored {direction} from {origin} · {nodes} · {links} · max {hops}","viewer.export.card.node.one":"{count} node","viewer.export.card.node.other":"{count} nodes","viewer.export.card.link.one":"{count} link","viewer.export.card.link.other":"{count} links","viewer.export.card.hop.one":"{count} hop","viewer.export.card.hop.other":"{count} hops","viewer.export.card.routeBadge":"ARCHIFY · ROUTE · {hops}","viewer.export.card.reachBadge":"ARCHIFY · {direction} REACH","viewer.export.direction.upstream":"Upstream","viewer.export.direction.downstream":"Downstream","viewer.export.error.canvasUnavailable":"Canvas unavailable for {label}","viewer.export.error.contextUnavailable":"2D canvas context unavailable for {label}","viewer.export.error.toBlobUnavailable":"canvas.toBlob unavailable for {label}","viewer.export.error.toBlobNull":"canvas.toBlob returned no data for {label}","viewer.export.error.variantsCombined":"Share Card variants cannot be combined","viewer.export.error.viewerState":"Share Card export could not remove temporary viewer state","viewer.export.error.routeState":"Route Card export could not preserve the resolved route safely","viewer.export.error.reachState":"Reach Card export could not preserve authored reach safely","viewer.export.error.webmRequirements":"WebM motion export requires a trace animation and browser MediaRecorder support","viewer.export.error.mediaRecorder":"MediaRecorder failed","viewer.export.error.emptyWebm":"MediaRecorder produced an empty WebM","viewer.export.error.webmBackground":"SVG background could not be loaded for WebM export","viewer.guide.title":"Explore this system","viewer.focus.selectedNodes":"{count} selected nodes","viewer.guide.eyebrow":"Diagram guide","viewer.guide.close":"Close diagram guide","viewer.guide.inspecting":"Inspecting compiled semantics","viewer.guide.actions":"Diagram exploration actions","viewer.guide.find":"Find any node","viewer.guide.find.hint":"Search labels, responsibilities, kinds, and stable IDs.","viewer.guide.route":"Trace a route","viewer.guide.route.aria":"Trace a directed route","viewer.guide.route.hint":"Ask how two semantic nodes connect in authored direction.","viewer.guide.map":"See the whole system","viewer.guide.map.hint":"Open Semantic Radar with a live viewport and stable nodes.","viewer.guide.lens":"Compare semantic kinds","viewer.guide.lens.hint":"Count roles, reveal their traffic, and compare direct authored links.","viewer.guide.present":"Enter Presentation Stage","viewer.guide.present.hint":"Give the live diagram the viewport without changing export.","viewer.guide.shortcuts":"Additional keyboard shortcuts","viewer.guide.shortcut.export":"Export","viewer.guide.shortcut.theme":"Theme","viewer.guide.shortcut.style":"Style","viewer.guide.shortcut.reset":"Reset","viewer.guide.shortcut.zoomIn":"Zoom in","viewer.guide.shortcut.zoomOut":"Zoom out","viewer.guide.shortcut.close":"Close","viewer.guide.facts":"{nodes} · {relationships}","viewer.guide.fact.node.one":"{count} semantic node","viewer.guide.fact.node.other":"{count} semantic nodes","viewer.guide.fact.relationship.one":"{count} relationship","viewer.guide.fact.relationship.other":"{count} relationships","viewer.guide.open":"Open diagram guide","viewer.finder.title":"Find a node","viewer.finder.close":"Close node finder","viewer.finder.placeholder":"Search labels or IDs","viewer.finder.search":"Search diagram nodes","viewer.finder.results":"Diagram nodes","viewer.finder.empty":"No matching nodes","viewer.finder.result.focus":"Focus {label}","viewer.finder.result.routeStart":"Choose {label} as route start","viewer.finder.result.routeTarget":"Choose {label} as route destination, {links}","viewer.finder.status.empty":"No matching nodes","viewer.finder.status.count.one":"{count} matching node","viewer.finder.status.count.other":"{count} matching nodes","viewer.finder.noun.nodes":"nodes","viewer.finder.link.one":"{count} link","viewer.finder.link.other":"{count} links","viewer.finder.result.focus.one":"Focus {label}, {count} related connection","viewer.finder.result.focus.other":"Focus {label}, {count} related connections","viewer.finder.status.filtered":"{visible} of {available} {noun}","viewer.finder.status.all":"{available} {noun}","viewer.passport.eyebrow":"Semantic passport","viewer.passport.metadata":"Node metadata","viewer.passport.evidence":"Verified source evidence","viewer.passport.verified":"Verified source","viewer.passport.verificationScope":"Verified against local Git at the pinned revision. Remote access has not been checked.","viewer.passport.reach":"Authored reach","viewer.passport.reach.trace":"Trace authored reachability","viewer.passport.upstream":"Upstream","viewer.passport.downstream":"Downstream","viewer.passport.upstream.trace":"Trace upstream authored reachability","viewer.passport.downstream.trace":"Trace downstream authored reachability","viewer.passport.close":"Close semantic passport","viewer.passport.move":"Move semantic passport. Drag, use arrow keys, or press Home to reset.","viewer.passport.copy":"Copy link","viewer.passport.copy.focus":"Copy link to focused node","viewer.passport.relations":"Relations","viewer.passport.relations.show":"Show connected relationships","viewer.passport.relations.hide":"Hide connected relationships","viewer.passport.relations.list":"Connected relationships","viewer.passport.copyRelation":"Copy relation","viewer.passport.copyNode":"Copy node","viewer.passport.copyPinned":"Copy link to pinned relationship","viewer.passport.copySource":"Copy link to source node","viewer.passport.copy.focused.success":"Focused node link copied","viewer.passport.copy.pinned.success":"Pinned relationship link copied","viewer.passport.copy.focused.failed":"Could not copy focused node link","viewer.passport.copy.pinned.failed":"Could not copy pinned relationship link","viewer.passport.relationship.none":"No connected relationships","viewer.passport.relationship.count.one":"{count} relation","viewer.passport.relationship.count.other":"{count} relations","viewer.passport.relationship.show.one":"Show {count} connected relationship","viewer.passport.relationship.show.other":"Show {count} connected relationships","viewer.passport.relationship.summary":"{out} outgoing · {in} incoming{loops}","viewer.passport.relationship.loops":" · {count} loop","viewer.passport.relationship.explorer":"Direct relationship explorer","viewer.passport.relationship.help":"Use arrow keys to explore relationships. Press Enter or Space to pin details; Escape clears.","viewer.passport.relationship.loopsBack":"loops back","viewer.passport.relationship.connectsTo":"connects to","viewer.passport.relationship.connectsFrom":"connects from","viewer.passport.relationship.pinned":"Pinned relationship · {from} → {to} · {label}","viewer.passport.relationship.inspect":"Inspect relationship {index} of {total}: {from} to {to}, {label}. Press Enter for details.","viewer.passport.relationship.group.out":"Outgoing","viewer.passport.relationship.group.in":"Incoming","viewer.passport.relationship.group.loop":"Self loops","viewer.passport.relationship.row":"{group}: {relationship}, {neighbor}","viewer.passport.relationship.direction.out":"OUT →","viewer.passport.relationship.direction.in":"← IN","viewer.passport.relationship.direction.loop":"LOOP","viewer.passport.sourceCount.one":"{count} verified source reference","viewer.passport.sourceCount.other":"{count} verified source references","viewer.passport.sourceMarker":"SRC","viewer.passport.beacon.one":"{count} verified source; focus this node to inspect","viewer.passport.beacon.other":"{count} verified sources; focus this node to inspect","viewer.passport.repository.open":"Open verified repository revision {revision}","viewer.passport.source.open":"Open verified source {path} at revision {revision}","viewer.passport.source.openLink":"Open ↗","viewer.passport.reach.upstream.one":"Trace {count} upstream authored node","viewer.passport.reach.upstream.other":"Trace {count} upstream authored nodes","viewer.passport.reach.downstream.one":"Trace {count} downstream authored node","viewer.passport.reach.downstream.other":"Trace {count} downstream authored nodes","viewer.passport.reach.noUpstream":"No upstream authored nodes","viewer.passport.reach.noDownstream":"No downstream authored nodes","viewer.passport.reach.status":"{direction} · {nodes} nodes · {links} links · max {hops} hops","viewer.route.eyebrow":"Path","viewer.route.start":"Click where the path starts","viewer.route.start.find":"Find start","viewer.route.start.find.aria":"Find a route start","viewer.route.copy":"Copy link","viewer.route.copy.aria":"Copy link to traced route","viewer.route.clear":"Clear","viewer.route.clear.aria":"Clear route probe","viewer.route.traced":"Path","viewer.route.pickTwo":"Click two nodes on the diagram","viewer.route.pickOne":"Click a node on the diagram","viewer.route.controls":"Route journey controls","viewer.route.previous":"Previous route position","viewer.route.play":"Play route journey","viewer.route.pause":"Pause route journey","viewer.route.replay":"Replay route journey","viewer.route.next":"Next route position","viewer.route.journey":"Journey","viewer.route.pause.label":"Pause","viewer.route.replay.label":"Replay","viewer.route.overview":"Overview","viewer.route.overview.aria":"Show complete route overview","viewer.route.instructions":"Click a start, then an end. Paths follow the arrows.","viewer.route.destination":"Where does the path from {label} end?","viewer.route.destination.find":"Find target","viewer.route.destination.find.aria":"Find a reachable route destination","viewer.route.differentDestination":"Choose a different destination","viewer.route.distinct":"Pick two different nodes.","viewer.route.unreachable":"Cannot reach {label} from here","viewer.route.unreachable.detail":"{target} cannot be reached from {source} along the arrows. Pick a highlighted node.","viewer.route.start.instructions":"Next, pick the end. Only nodes you can reach will light up.","viewer.route.copy.success":"Traced route link copied","viewer.route.copy.failed":"Could not copy traced route link","viewer.route.position":"Route position {index} of {total}: {label}","viewer.route.step":"Step {index} of {total} · {phase} · {label}","viewer.route.motionRequired":"Automatic journey requires Live motion","viewer.route.trigger.clear":"Clear traced route","viewer.route.overview.status":"{nodes} · {hops} · shortest path","viewer.route.overview.node.one":"{count} node","viewer.route.overview.node.other":"{count} nodes","viewer.route.overview.hop.one":"{count} step","viewer.route.overview.hop.other":"{count} steps","viewer.route.phase.playing":"Playing","viewer.route.phase.complete":"Complete","viewer.route.phase.inspecting":"Inspecting","viewer.route.destination.count.one":"{count} reachable node is highlighted. Click it.","viewer.route.destination.count.other":"{count} reachable nodes are highlighted. Click one.","viewer.route.noOutgoing":"No arrows lead out of this node. Clear it and pick another start.","viewer.route.result.title":"{source} to {target}","viewer.route.finder.source.title":"Choose route start","viewer.route.finder.source.placeholder":"Search route sources","viewer.route.finder.source.empty":"No matching route sources","viewer.route.finder.source.results":"Nodes that can start a route","viewer.route.finder.source.noun":"route sources","viewer.route.finder.source.badge":"start","viewer.route.finder.target.title":"Destination from {label}","viewer.route.finder.target.placeholder":"Search reachable destinations","viewer.route.finder.target.empty":"No matching reachable destinations","viewer.route.finder.target.results":"Reachable route destinations","viewer.route.finder.target.noun":"reachable destinations","viewer.route.hop.one":"{count} hop","viewer.route.hop.other":"{count} hops","viewer.lens.eyebrow":"Semantic lens","viewer.lens.title":"Compare system roles","viewer.lens.close":"Close semantic lens","viewer.lens.instruction":"Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.","viewer.lens.kinds":"Semantic kinds","viewer.lens.choose":"Choose a kind to inspect its nodes and touching relationships.","viewer.lens.copy":"Copy link to semantic lens","viewer.lens.clear":"Clear semantic lens","viewer.lens.open":"Open semantic lens","viewer.lens.openActive":"Open active semantic lens","viewer.lens.legend":"Semantic legend","viewer.lens.legend.inspect.one":"Inspect {label}, {count} node","viewer.lens.legend.inspect.other":"Inspect {label}, {count} nodes","viewer.lens.kind.count.one":"{label}, {count} node","viewer.lens.kind.count.other":"{label}, {count} nodes","viewer.lens.compare.one":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationship","viewer.lens.compare.other":"{first} → {second}: {forward} · {second} → {first}: {reverse} · {count} direct relationships","viewer.lens.single":"{nodes} · {relationships} · connected peers remain visible","viewer.lens.node.one":"{count} {label} node","viewer.lens.node.other":"{count} {label} nodes","viewer.lens.relationship.one":"{count} touching relationship","viewer.lens.relationship.other":"{count} touching relationships","viewer.radar.title":"Semantic radar","viewer.radar.building":"Building overview","viewer.radar.openFull":"Open full semantic radar","viewer.radar.open":"Open radar","viewer.radar.close":"Close semantic radar","viewer.radar.surface":"Diagram overview. Click a node to focus it, or use arrow keys to pan.","viewer.radar.click":"Click node","viewer.radar.drag":"Drag to pan","viewer.radar.space":"Semantic radar needs more MAP space.","viewer.radar.nodes":"Semantic diagram radar nodes","viewer.radar.focus":"Focus {label} from Semantic Radar","viewer.radar.status":"{count} nodes · {viewport}","viewer.radar.fullMap":"{count} nodes · full map","viewer.radar.compacted":"Radar compacted to avoid covering the Semantic Passport or MAP controls.","viewer.radar.cancelWaiting":"Cancel semantic radar waiting for more MAP space","viewer.radar.needsSpace":"Semantic radar needs more visible MAP space","viewer.radar.viewport.full":"full map","viewer.radar.viewport.width":"{percent}% width","viewer.radar.viewport.scale":"{percent}% viewport","viewer.nav.controls":"Diagram view controls","viewer.nav.route":"Trace a directed route","viewer.nav.route.title":"Trace route (R)","viewer.nav.route.short":"PATH","viewer.nav.radar":"Open semantic radar","viewer.nav.radar.title":"Semantic radar (M)","viewer.nav.radar.short":"MAP","viewer.nav.lens":"Open semantic lens","viewer.nav.lens.title":"Semantic lens (L)","viewer.nav.lens.short":"LENS","viewer.nav.find":"Find a node","viewer.nav.find.title":"Find a node (/)","viewer.outline.title":"Node index","viewer.rail.show":"Notes \u0026 index","viewer.rail.controls":"Side panel","viewer.rail.collapse":"Collapse side panel","viewer.rail.bottom":"Move panel below the diagram","viewer.rail.right":"Move panel beside the diagram","viewer.nav.guide":"Open diagram guide","viewer.nav.guide.title":"Diagram guide (?)","viewer.nav.zoomOut":"Zoom out","viewer.nav.zoomOut.title":"Zoom out (-)","viewer.nav.reset":"Reset diagram view","viewer.nav.reset.title":"Reset view (0)","viewer.nav.read":"READ","viewer.nav.zoomIn":"Zoom in","viewer.nav.zoomIn.title":"Zoom in (+)","viewer.nav.camera":"{hint}. Reset diagram view","viewer.nav.camera.title":"{semantic}{hint} · reset view (0)","viewer.nav.camera.semantic":"Semantic camera active · ","viewer.nav.level.map":"MAP","viewer.nav.level.read":"READ","viewer.nav.level.full":"FULL","viewer.nav.level.auto":"AUTO","viewer.nav.detail.map":"Zoom in to reveal relationship labels and node context","viewer.nav.detail.read":"Zoom in again to reveal tags and annotations","viewer.nav.detail.full":"Full diagram detail","viewer.intent.summary":"{label}. {out} outgoing, {in} incoming{loops}. {total} connections. Press Enter for details.","viewer.intent.loops":", {count} self loop","viewer.common.copied":"Copied","viewer.common.copyFailed":"Copy failed","viewer.common.copyLink":"Copy link","viewer.common.clear":"Clear","viewer.common.close":"Close"}}</script>
<!-- Main Diagram -->
<div class="diagram-container" data-detail-level="read"
data-preset-badge-editorial-plate="ARCHIFY / PLATE 04">
- <svg viewBox="0 0 1180 588" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="standard" data-quality-gates="advisory">
+ <svg viewBox="0 0 1200 608" role="img" lang="en" aria-labelledby="archify-diagram-title archify-diagram-description" data-preset="classic" data-quality-profile="standard" data-quality-gates="advisory" data-reader-fit="intrinsic-height" data-reader-min-text="7.5" data-reader-primary-text="14">
<title id="archify-diagram-title">Maka</title>
<desc id="archify-diagram-description">Local-first desktop AI workbench — sessions, tools, permissions, recovery</desc>
<!-- Definitions -->
@@ -5162,17 +5014,50 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<rect data-graph-role="structural-frame" data-composition-frame-kind="security-group" data-composition-frame-id="1" data-composition-frame-label="trust boundary" x="550" y="110" width="400" height="410" rx="8" class="c-security-group" stroke-width="1"/>
<!-- Connection paths (before components for correct z-order) -->
- <path data-edge-from="user" data-edge-to="ui" data-edge-key="0" data-composition-points="160,330;200,330" d="M 160 330 L 200 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="ui" data-edge-to="main" data-edge-label="IPC" data-edge-key="1" data-composition-points="340,330;390,330" d="M 340 330 L 390 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="main" data-edge-to="session" data-edge-key="2" data-composition-points="530,330;580,330" d="M 530 330 L 580 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="session" data-edge-to="agentrun" data-edge-label="turn" data-edge-key="3" data-composition-points="730,330;780,330" d="M 730 330 L 780 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="agentrun" data-edge-to="model" data-edge-key="4" data-composition-points="920,330;970,330" d="M 920 330 L 970 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="model" data-edge-to="providers" data-edge-label="stream" data-edge-key="5" data-composition-points="1040,300;1040,200" d="M 1040 300 L 1040 200" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
- <path data-edge-from="bots" data-edge-to="session" data-edge-key="6" data-composition-points="655,200;655,300" d="M 655 200 L 655 300" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
- <path data-edge-from="agentrun" data-edge-to="permission" data-edge-key="7" data-composition-points="850,300;850,200" d="M 850 300 L 850 200" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
- <path data-edge-from="session" data-edge-to="storage" data-edge-key="8" data-composition-points="655,360;655,440" d="M 655 360 L 655 440" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
- <path data-edge-from="agentrun" data-edge-to="toolrt" data-edge-key="9" data-composition-points="850,360;850,440" d="M 850 360 L 850 440" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>
- <path data-edge-from="toolrt" data-edge-to="tools" data-edge-key="10" data-composition-points="920,470;970,470" d="M 920 470 L 970 470" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ <g data-graph-role="automatic-crossover" style="--step:0">
+ <path data-graph-role="automatic-crossover-underlay" d="M 160 330 L 200 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="user" data-edge-to="ui" data-edge-key="0" data-composition-points="160,330;200,330" data-composition-crossover="halo" data-composition-independent="true" d="M 160 330 L 200 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:1">
+ <path data-graph-role="automatic-crossover-underlay" d="M 340 330 L 390 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="ui" data-edge-to="main" data-edge-label="IPC" data-edge-key="1" data-composition-points="340,330;390,330" data-composition-crossover="halo" data-composition-independent="true" d="M 340 330 L 390 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:2">
+ <path data-graph-role="automatic-crossover-underlay" d="M 530 330 L 580 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="main" data-edge-to="session" data-edge-key="2" data-composition-points="530,330;580,330" data-composition-crossover="halo" data-composition-independent="true" d="M 530 330 L 580 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:3">
+ <path data-graph-role="automatic-crossover-underlay" d="M 730 330 L 780 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="session" data-edge-to="agentrun" data-edge-label="turn" data-edge-key="3" data-composition-points="730,330;780,330" data-composition-crossover="halo" data-composition-independent="true" d="M 730 330 L 780 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:4">
+ <path data-graph-role="automatic-crossover-underlay" d="M 920 330 L 970 330" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agentrun" data-edge-to="model" data-edge-key="4" data-composition-points="920,330;970,330" data-composition-crossover="halo" data-composition-independent="true" d="M 920 330 L 970 330" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:5">
+ <path data-graph-role="automatic-crossover-underlay" d="M 1040 300 L 1040 200" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="model" data-edge-to="providers" data-edge-label="stream" data-edge-key="5" data-composition-points="1040,300;1040,200" data-composition-crossover="halo" data-composition-independent="true" d="M 1040 300 L 1040 200" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:6">
+ <path data-graph-role="automatic-crossover-underlay" d="M 655 200 L 655 300" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="bots" data-edge-to="session" data-edge-key="6" data-composition-points="655,200;655,300" data-composition-crossover="halo" data-composition-independent="true" d="M 655 200 L 655 300" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:7">
+ <path data-graph-role="automatic-crossover-underlay" d="M 850 300 L 850 200" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agentrun" data-edge-to="permission" data-edge-key="7" data-composition-points="850,300;850,200" data-composition-crossover="halo" data-composition-independent="true" d="M 850 300 L 850 200" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:8">
+ <path data-graph-role="automatic-crossover-underlay" d="M 655 360 L 655 440" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="session" data-edge-to="storage" data-edge-key="8" data-composition-points="655,360;655,440" data-composition-crossover="halo" data-composition-independent="true" d="M 655 360 L 655 440" class="a-dashed" stroke-width="1.5" marker-end="url(#arrowhead-dashed)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:9">
+ <path data-graph-role="automatic-crossover-underlay" d="M 850 360 L 850 440" fill="none" stroke="var(--mask)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="agentrun" data-edge-to="toolrt" data-edge-key="9" data-composition-points="850,360;850,440" data-composition-crossover="halo" data-composition-independent="true" d="M 850 360 L 850 440" class="a-default" stroke-width="1.5" marker-end="url(#arrowhead)"/>
+ </g>
+ <g data-graph-role="automatic-crossover" style="--step:10">
+ <path data-graph-role="automatic-crossover-underlay" d="M 920 470 L 970 470" fill="none" stroke="var(--mask)" stroke-width="5.8" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"/>
+ <path data-edge-from="toolrt" data-edge-to="tools" data-edge-key="10" data-composition-points="920,470;970,470" data-composition-crossover="halo" data-composition-independent="true" d="M 920 470 L 970 470" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>
+ </g>
<path data-edge-from="toolrt" data-edge-to="permission" data-edge-key="11" data-composition-points="850,500;850,540;1160,540;1160,100;850,100;850,140" d="M 850 500 L 850 532 Q 850 540 858 540 L 1152 540 Q 1160 540 1160 532 L 1160 108 Q 1160 100 1152 100 L 858 100 Q 850 100 850 108 L 850 140" class="a-security" stroke-width="1.5" marker-end="url(#arrowhead-security)"/>
<!-- Components -->
@@ -5327,17 +5212,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<g data-detail="context" data-edge-from="ui" data-edge-to="main" data-edge-label="IPC" data-edge-key="1">
<rect x="350" y="310" width="30" height="14" rx="3" class="c-mask"/>
- <text x="365" y="320" class="t-backend" font-size="8" text-anchor="middle">IPC</text>
+ <text x="365" y="320" class="t-edge-emphasis" font-size="8" text-anchor="middle">IPC</text>
</g>
<g data-detail="context" data-edge-from="session" data-edge-to="agentrun" data-edge-label="turn" data-edge-key="3">
<rect x="740" y="310" width="30" height="14" rx="3" class="c-mask"/>
- <text x="755" y="320" class="t-backend" font-size="8" text-anchor="middle">turn</text>
+ <text x="755" y="320" class="t-edge-emphasis" font-size="8" text-anchor="middle">turn</text>
</g>
<g data-detail="context" data-edge-from="model" data-edge-to="providers" data-edge-label="stream" data-edge-key="5">
<rect x="1020.6" y="280" width="38.8" height="14" rx="3" class="c-mask"/>
- <text x="1040" y="290" class="t-backend" font-size="8" text-anchor="middle">stream</text>
+ <text x="1040" y="290" class="t-edge-emphasis" font-size="8" text-anchor="middle">stream</text>
</g>
@@ -5359,50 +5244,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<!-- Legend -->
<g data-legend="" data-legend-bridge="">
- <text x="40" y="552" class="t-primary" font-size="12" font-weight="650">Legend</text>
- <g data-legend-semantic-kind="frontend" data-legend-kind="frontend" data-legend-label="Frontend" data-legend-x="40" data-legend-baseline="572" data-legend-width="83">
- <rect x="40" y="563" width="16" height="10" rx="2.5" class="c-frontend" stroke-width="1"/>
- <text x="62" y="572" class="t-muted" font-size="10" font-weight="500">Frontend</text>
+ <text x="40" y="572" class="t-primary" font-size="12" font-weight="650">Legend</text>
+ <g data-legend-semantic-kind="frontend" data-legend-kind="frontend" data-legend-label="Frontend" data-legend-x="40" data-legend-baseline="592" data-legend-width="83">
+ <rect x="40" y="583" width="16" height="10" rx="2.5" class="c-frontend" stroke-width="1"/>
+ <text x="62" y="592" class="t-muted" font-size="10" font-weight="500">Frontend</text>
</g>
- <g data-legend-semantic-kind="backend" data-legend-kind="backend" data-legend-label="Backend" data-legend-x="145" data-legend-baseline="572" data-legend-width="78">
- <rect x="145" y="563" width="16" height="10" rx="2.5" class="c-backend" stroke-width="1"/>
- <text x="167" y="572" class="t-muted" font-size="10" font-weight="500">Backend</text>
+ <g data-legend-semantic-kind="backend" data-legend-kind="backend" data-legend-label="Backend" data-legend-x="145" data-legend-baseline="592" data-legend-width="78">
+ <rect x="145" y="583" width="16" height="10" rx="2.5" class="c-backend" stroke-width="1"/>
+ <text x="167" y="592" class="t-muted" font-size="10" font-weight="500">Backend</text>
</g>
- <g data-legend-semantic-kind="database" data-legend-kind="database" data-legend-label="Database" data-legend-x="245" data-legend-baseline="572" data-legend-width="83">
- <rect x="245" y="563" width="16" height="10" rx="2.5" class="c-database" stroke-width="1"/>
- <text x="267" y="572" class="t-muted" font-size="10" font-weight="500">Database</text>
+ <g data-legend-semantic-kind="database" data-legend-kind="database" data-legend-label="Database" data-legend-x="245" data-legend-baseline="592" data-legend-width="83">
+ <rect x="245" y="583" width="16" height="10" rx="2.5" class="c-database" stroke-width="1"/>
+ <text x="267" y="592" class="t-muted" font-size="10" font-weight="500">Database</text>
</g>
- <g data-legend-semantic-kind="cloud" data-legend-kind="cloud" data-legend-label="Cloud" data-legend-x="350" data-legend-baseline="572" data-legend-width="68">
- <rect x="350" y="563" width="16" height="10" rx="2.5" class="c-cloud" stroke-width="1"/>
- <text x="372" y="572" class="t-muted" font-size="10" font-weight="500">Cloud</text>
+ <g data-legend-semantic-kind="cloud" data-legend-kind="cloud" data-legend-label="Cloud" data-legend-x="350" data-legend-baseline="592" data-legend-width="68">
+ <rect x="350" y="583" width="16" height="10" rx="2.5" class="c-cloud" stroke-width="1"/>
+ <text x="372" y="592" class="t-muted" font-size="10" font-weight="500">Cloud</text>
</g>
- <g data-legend-semantic-kind="security" data-legend-kind="security" data-legend-label="Security" data-legend-x="440" data-legend-baseline="572" data-legend-width="83">
- <rect x="440" y="563" width="16" height="10" rx="2.5" class="c-security" stroke-width="1"/>
- <text x="462" y="572" class="t-muted" font-size="10" font-weight="500">Security</text>
+ <g data-legend-semantic-kind="security" data-legend-kind="security" data-legend-label="Security" data-legend-x="440" data-legend-baseline="592" data-legend-width="83">
+ <rect x="440" y="583" width="16" height="10" rx="2.5" class="c-security" stroke-width="1"/>
+ <text x="462" y="592" class="t-muted" font-size="10" font-weight="500">Security</text>
</g>
- <g data-legend-semantic-kind="messagebus" data-legend-kind="messagebus" data-legend-label="Message bus" data-legend-x="545" data-legend-baseline="572" data-legend-width="98">
- <rect x="545" y="563" width="16" height="10" rx="2.5" class="c-messagebus" stroke-width="1"/>
- <text x="567" y="572" class="t-muted" font-size="10" font-weight="500">Message bus</text>
+ <g data-legend-semantic-kind="messagebus" data-legend-kind="messagebus" data-legend-label="Message bus" data-legend-x="545" data-legend-baseline="592" data-legend-width="98">
+ <rect x="545" y="583" width="16" height="10" rx="2.5" class="c-messagebus" stroke-width="1"/>
+ <text x="567" y="592" class="t-muted" font-size="10" font-weight="500">Message bus</text>
</g>
- <g data-legend-semantic-kind="external" data-legend-kind="external" data-legend-label="External" data-legend-x="665" data-legend-baseline="572" data-legend-width="83">
- <rect x="665" y="563" width="16" height="10" rx="2.5" class="c-external" stroke-width="1"/>
- <text x="687" y="572" class="t-muted" font-size="10" font-weight="500">External</text>
+ <g data-legend-semantic-kind="external" data-legend-kind="external" data-legend-label="External" data-legend-x="665" data-legend-baseline="592" data-legend-width="83">
+ <rect x="665" y="583" width="16" height="10" rx="2.5" class="c-external" stroke-width="1"/>
+ <text x="687" y="592" class="t-muted" font-size="10" font-weight="500">External</text>
</g>
</g>
</svg>
<p class="intent-trace-status no-print" id="intent-trace-status" role="status" aria-live="polite" aria-atomic="true"></p>
- <div class="share-chapter-cue no-print" id="share-chapter-cue" hidden role="status" aria-live="polite">
- <div class="share-chapter-index">
- <span class="share-chapter-state" id="share-chapter-state">Ready</span>
- <span class="share-chapter-count" id="share-chapter-count">Chapter 01 / 01</span>
- </div>
- <div class="share-chapter-copy">
- <strong id="share-chapter-label">Guided chapter</strong>
- <small id="share-chapter-note"></small>
- </div>
- <span class="share-chapter-route" id="share-chapter-route"></span>
- <span class="share-chapter-progress" aria-hidden="true"><span id="share-chapter-progress-bar"></span></span>
- </div>
<div class="diagram-guide no-print" id="diagram-guide" hidden role="dialog" aria-modal="false" aria-labelledby="diagram-guide-title">
<div class="diagram-guide-head">
<span>
@@ -5433,13 +5306,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<span class="diagram-guide-action-copy"><strong>Compare semantic kinds</strong><small>Count roles, reveal their traffic, and compare direct authored links.</small></span>
<kbd aria-hidden="true">L</kbd>
</button>
- <button class="diagram-guide-action" type="button" data-guide-action="story" aria-label="Play the guided story">
- <span class="diagram-guide-index" aria-hidden="true">05</span>
- <span class="diagram-guide-action-copy"><strong>Play the guided story</strong><small id="diagram-guide-story-copy">Walk the authored chapters and real relationships.</small></span>
- <kbd aria-hidden="true">P</kbd>
- </button>
<button class="diagram-guide-action" type="button" data-guide-action="present" aria-label="Enter presentation stage">
- <span class="diagram-guide-index" aria-hidden="true">06</span>
+ <span class="diagram-guide-index" aria-hidden="true">05</span>
<span class="diagram-guide-action-copy"><strong>Enter Presentation Stage</strong><small>Give the live diagram the viewport without changing export.</small></span>
<kbd aria-hidden="true">F</kbd>
</button>
@@ -5465,6 +5333,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
</div>
<div class="focus-chip relationship-lens no-print" id="focus-chip" hidden role="region" aria-labelledby="relationship-lens-title">
<div class="relationship-lens-head">
+ <button class="relationship-lens-drag-handle" id="btn-focus-move" type="button" data-focus-drag-handle aria-label="Move semantic passport. Drag, use arrow keys, or press Home to reset." title="Move semantic passport. Drag, use arrow keys, or press Home to reset."></button>
<div class="relationship-lens-copy">
<span class="relationship-lens-eyebrow">Semantic passport</span>
<strong class="relationship-lens-title" id="relationship-lens-title"><span id="focus-label"></span></strong>
@@ -5508,8 +5377,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<div class="route-probe no-print" id="route-probe" hidden role="region" aria-labelledby="route-probe-title" data-state="idle">
<div class="route-probe-head">
<span class="route-probe-copy">
- <span class="route-probe-eyebrow">Route probe</span>
- <strong class="route-probe-title" id="route-probe-title">Choose a start node</strong>
+ <span class="route-probe-eyebrow">Path</span>
+ <strong class="route-probe-title" id="route-probe-title">Click where the path starts</strong>
</span>
<span class="route-probe-actions">
<button class="route-probe-find" id="route-probe-find" type="button" aria-label="Find a route start" data-node-finder-trigger>Find start</button>
@@ -5517,8 +5386,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<button id="route-probe-clear" type="button" aria-label="Clear route probe">Clear</button>
</span>
</div>
- <div class="route-probe-path" id="route-probe-path" aria-label="Traced route">
- <span class="route-probe-placeholder">Pick two semantic nodes on the diagram</span>
+ <div class="route-probe-path" id="route-probe-path" aria-label="Path">
+ <span class="route-probe-placeholder">Click two nodes on the diagram</span>
</div>
<div class="route-journey-controls" id="route-journey-controls" hidden role="group" aria-label="Route journey controls" data-playing="false">
<button id="route-journey-prev" type="button" aria-label="Previous route position" title="Previous route position">&#8592;</button>
@@ -5529,7 +5398,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<button id="route-journey-next" type="button" aria-label="Next route position" title="Next route position">&#8594;</button>
<button class="route-journey-overview" id="route-journey-overview" type="button" aria-label="Show complete route overview" title="Show complete route overview">Overview</button>
</div>
- <small class="route-probe-status" id="route-probe-status" aria-live="polite">Choose the source, then the destination. Direction matters.</small>
+ <small class="route-probe-status" id="route-probe-status" aria-live="polite">Click a start, then an end. Paths follow the arrows.</small>
</div>
<div class="semantic-lens no-print" id="semantic-lens" hidden role="dialog" aria-modal="false" aria-labelledby="semantic-lens-title">
<div class="semantic-lens-head">
@@ -5561,18 +5430,24 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<div class="overview-map-hint" aria-hidden="true"><span>Click node</span><span>Drag to pan</span></div>
</div>
<p class="overview-map-feedback no-print" id="overview-map-feedback" role="status" aria-live="polite" hidden>Semantic radar needs more MAP space.</p>
+ <button class="rail-reveal no-print" id="rail-reveal" type="button" hidden aria-controls="reader-rail" aria-expanded="false"><span class="rail-reveal-icon" aria-hidden="true"></span><span>Notes &amp; index</span></button>
<div class="diagram-nav no-print" role="toolbar" aria-label="Diagram view controls">
<button id="btn-route-probe" type="button" aria-label="Trace a directed route" aria-pressed="false" aria-controls="route-probe" title="Trace route (R)">PATH</button>
<button id="btn-overview-map" type="button" aria-label="Open semantic radar" aria-expanded="false" aria-controls="overview-map" title="Semantic radar (M)">MAP</button>
<button id="btn-semantic-lens" type="button" aria-label="Open semantic lens" aria-haspopup="dialog" aria-expanded="false" aria-pressed="false" aria-controls="semantic-lens" title="Semantic lens (L)">LENS</button>
<button id="btn-node-finder" type="button" aria-label="Find a node" aria-haspopup="dialog" aria-expanded="false" aria-controls="node-finder" title="Find a node (/)" data-node-finder-trigger><span class="diagram-nav-icon find" aria-hidden="true"></span></button>
- <button id="btn-diagram-guide" type="button" aria-label="Open diagram guide" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="Diagram guide (?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
+ <button id="btn-diagram-guide" type="button" hidden aria-label="Open diagram guide" aria-haspopup="dialog" aria-expanded="false" aria-controls="diagram-guide" title="Diagram guide (?)"><span class="diagram-nav-icon guide" aria-hidden="true"></span></button>
<button data-view="out" type="button" aria-label="Zoom out" title="Zoom out (-)"><span class="diagram-nav-icon minus" aria-hidden="true"></span></button>
<button data-view="reset" type="button" aria-label="Reset diagram view" title="Reset view (0)"><span class="diagram-nav-detail" data-view-detail hidden>READ</span><span class="diagram-nav-percent" data-view-percent>100%</span></button>
<button data-view="in" type="button" aria-label="Zoom in" title="Zoom in (+)"><span class="diagram-nav-icon plus" aria-hidden="true"></span></button>
</div>
</div>
+ <aside class="reader-rail" id="reader-rail">
+ <div class="rail-controls no-print" role="toolbar" aria-label="Side panel">
+ <button class="rail-control" id="rail-placement" type="button" hidden aria-label="Move panel below the diagram" title="Move panel below the diagram" data-placement="right"><span class="rail-control-icon placement" aria-hidden="true"></span></button>
+ <button class="rail-control" id="rail-collapse" type="button" hidden aria-controls="reader-rail" aria-expanded="true" aria-label="Collapse side panel" title="Collapse side panel"><span class="rail-control-icon collapse" aria-hidden="true"></span></button>
+ </div>
<!-- Info Cards -->
<div class="cards">
<div class="card">
@@ -5581,9 +5456,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Desktop surfaces</h3>
</div>
<ul>
- <li>&bull; apps/desktop: renderer, preload, main process</li>
- <li>&bull; Settings for models, bots, search, gateway, permissions</li>
- <li>&bull; Bots and open gateway share SessionManager as the public API</li>
+ <li>apps/desktop: renderer, preload, main process</li>
+ <li>Settings for models, bots, search, gateway, permissions</li>
+ <li>Bots and open gateway share SessionManager as the public API</li>
</ul>
</div>
@@ -5593,9 +5468,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Runtime kernel</h3>
</div>
<ul>
- <li>&bull; SessionManager → AgentRun → AiSdkBackend</li>
- <li>&bull; ModelAdapter normalizes provider streams and usage</li>
- <li>&bull; ToolRuntime owns tool validation, abort, and telemetry</li>
+ <li>SessionManager → AgentRun → AiSdkBackend</li>
+ <li>ModelAdapter normalizes provider streams and usage</li>
+ <li>ToolRuntime owns tool validation, abort, and telemetry</li>
</ul>
</div>
@@ -5605,12 +5480,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
<h3>Local &amp; privacy</h3>
</div>
<ul>
- <li>&bull; Sessions and credentials live under Electron userData</li>
- <li>&bull; Write/Bash and risky ops go through the permission engine</li>
- <li>&bull; Renderer never sees plaintext secrets — only masked status</li>
+ <li>Sessions and credentials live under Electron userData</li>
+ <li>Write/Bash and risky ops go through the permission engine</li>
+ <li>Renderer never sees plaintext secrets — only masked status</li>
</ul>
</div>
</div>
+ <nav class="node-outline no-print" id="node-outline" hidden aria-labelledby="node-outline-title">
+ <div class="node-outline-head">
+ <strong id="node-outline-title">Node index</strong>
+ <span class="node-outline-count" id="node-outline-count"></span>
+ </div>
+ <ol class="node-outline-list" id="node-outline-list"></ol>
+ </nav>
+ </aside>
</div>
@@ -5868,8 +5751,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var MOTION_FPS = 30;
var SHARE_CARD_WIDTH = 1200;
var SHARE_CARD_HEIGHT = 630;
- var SHARE_CARD_PADDING = 36;
- var SHARE_CARD_HEADER = 112;
+ var SHARE_CARD_PADDING = 40;
+ var SHARE_CARD_HEADER = 124;
function exportError(key, values) {
var error = new Error(viewerText(key, values));
@@ -5897,6 +5780,156 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return getComputedStyle(document.body).backgroundColor || '#ffffff';
}
+ function cleanExportClone(clone) {
+ // View transforms and neighborhood focus are HTML exploration state,
+ // never part of a downloaded full-diagram artifact.
+ clone.style.removeProperty('transform');
+ clone.style.removeProperty('clip-path');
+ clone.removeAttribute('data-view-scale');
+ clone.removeAttribute('data-focus-active');
+ clone.removeAttribute('data-reach-active');
+ clone.removeAttribute('data-lens-active');
+ clone.removeAttribute('data-lens-flow-count');
+ clone.removeAttribute('data-lens-flow-density');
+ clone.removeAttribute('data-legend-preview-active');
+ clone.removeAttribute('data-relationship-preview-active');
+ clone.removeAttribute('data-relationship-direct-active');
+ clone.removeAttribute('data-relationship-pin-active');
+ clone.removeAttribute('data-intent-trace-active');
+ clone.removeAttribute('data-route-picking');
+ clone.removeAttribute('data-route-active');
+ clone.removeAttribute('data-route-journey');
+ clone.removeAttribute('data-share-route');
+ clone.removeAttribute('data-share-reach');
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
+ el.removeAttribute('data-legend-kind');
+ el.removeAttribute('data-legend-label');
+ el.removeAttribute('data-legend-count');
+ el.removeAttribute('data-legend-zero');
+ el.removeAttribute('data-legend-selected');
+ el.removeAttribute('role');
+ el.removeAttribute('tabindex');
+ el.removeAttribute('aria-label');
+ el.removeAttribute('aria-pressed');
+ el.removeAttribute('aria-haspopup');
+ el.removeAttribute('aria-controls');
+ el.removeAttribute('aria-expanded');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
+ el.removeAttribute('data-legend-bridge');
+ el.removeAttribute('role');
+ el.removeAttribute('aria-label');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
+ el.remove();
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
+ var originalLabel = el.getAttribute('data-source-evidence-original-label');
+ if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');
+ else el.setAttribute('aria-label', originalLabel);
+ el.removeAttribute('data-source-evidence-count');
+ el.removeAttribute('data-source-evidence-original-label');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
+ el.removeAttribute('data-focus-match');
+ el.removeAttribute('data-focus-selected');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
+ el.removeAttribute('data-reach-match');
+ el.removeAttribute('data-reach-origin');
+ el.removeAttribute('data-reach-depth');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
+ el.removeAttribute('data-lens-match');
+ el.removeAttribute('data-lens-selected');
+ el.removeAttribute('data-lens-peer');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
+ el.removeAttribute('data-legend-preview-match');
+ el.removeAttribute('data-legend-preview-selected');
+ el.removeAttribute('data-legend-preview-peer');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
+ el.removeAttribute('data-relationship-preview');
+ el.removeAttribute('data-relationship-preview-node');
+ el.removeAttribute('data-relationship-preview-source');
+ el.removeAttribute('data-relationship-preview-target');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
+ el.removeAttribute('data-intent-trace-match');
+ el.removeAttribute('data-intent-trace-selected');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
+ el.removeAttribute('data-route-match');
+ el.removeAttribute('data-route-start');
+ el.removeAttribute('data-route-end');
+ el.removeAttribute('data-route-step');
+ el.removeAttribute('data-route-candidate');
+ el.removeAttribute('data-route-journey-state');
+ el.removeAttribute('data-route-journey-current');
+ el.style.removeProperty('--route-step');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
+ el.removeAttribute('data-share-route-match');
+ el.removeAttribute('data-share-route-step');
+ el.removeAttribute('data-share-route-start');
+ el.removeAttribute('data-share-route-end');
+ el.removeAttribute('data-share-route-middle');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
+ el.removeAttribute('data-share-reach-match');
+ el.removeAttribute('data-share-reach-origin');
+ el.removeAttribute('data-share-reach-depth');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
+ el.removeAttribute('data-detail');
+ el.removeAttribute('data-detail-anchor');
+ });
+ Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
+ el.setAttribute('aria-pressed', 'false');
+ });
+ return !clone.hasAttribute('data-view-scale') &&
+ !clone.hasAttribute('data-focus-active') &&
+ !clone.hasAttribute('data-reach-active') &&
+ !clone.hasAttribute('data-lens-active') &&
+ !clone.hasAttribute('data-lens-flow-count') &&
+ !clone.hasAttribute('data-lens-flow-density') &&
+ !clone.hasAttribute('data-legend-preview-active') &&
+ !clone.hasAttribute('data-relationship-preview-active') &&
+ !clone.hasAttribute('data-relationship-direct-active') &&
+ !clone.hasAttribute('data-intent-trace-active') &&
+ !clone.hasAttribute('data-route-picking') &&
+ !clone.hasAttribute('data-route-active') &&
+ !clone.hasAttribute('data-route-journey') &&
+ !clone.hasAttribute('data-share-route') &&
+ !clone.hasAttribute('data-share-reach') &&
+ !clone.style.getPropertyValue('transform') &&
+ !clone.style.getPropertyValue('clip-path') &&
+ clone.querySelectorAll('[data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;
+ }
+
+
/**
* Serialize the main SVG into a standalone document.
*
@@ -5906,10 +5939,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
* (PNG/JPEG/WebP/clipboard) because canvas rasterization needs
* deterministic colors; a raster cannot react to
* prefers-color-scheme after encoding.
- * - autoTheme=true — emits BOTH dark and light variable sets plus a
+ * - theme=auto — emits BOTH dark and light variable sets plus a
* `@media (prefers-color-scheme)` rule so the resulting SVG
* self-themes when embedded in GitHub READMEs or other hosts that
- * expose a color scheme. Used for "Download SVG".
+ * expose a color scheme. Used for the default "Download SVG".
+ * - theme=light|dark — locks the standalone SVG to the requested
+ * theme, independently of its source Viewer and host OS themes.
*/
function applyRouteSnapshot(clone, snapshot) {
if (!snapshot || !Array.isArray(snapshot.nodeIds) || !Array.isArray(snapshot.edges) ||
@@ -6074,194 +6109,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function serializeSvg(scale, opts) {
- // scale: integer multiplier for intrinsic SVG pixel dimensions used by
+ // scale: multiplier (integer unless the figure is oversized) for intrinsic SVG pixel dimensions used by
// the raster path. Defaults to 1 (natural size) for SVG download.
scale = scale || 1;
opts = opts || {};
- var autoTheme = opts.autoTheme === true;
+ var requestedTheme = opts.theme || (opts.autoTheme === true ? 'auto' : null);
+ if (requestedTheme && requestedTheme !== 'auto' && requestedTheme !== 'light' && requestedTheme !== 'dark') {
+ throw new Error('Unsupported SVG theme: ' + requestedTheme);
+ }
+ var autoTheme = requestedTheme === 'auto';
var svg = document.querySelector('.diagram-container svg');
var clone = svg.cloneNode(true);
- // View transforms and neighborhood focus are HTML exploration state,
- // never part of a downloaded full-diagram artifact.
- clone.style.removeProperty('transform');
- clone.style.removeProperty('clip-path');
- clone.removeAttribute('data-view-scale');
- clone.removeAttribute('data-focus-active');
- clone.removeAttribute('data-reach-active');
- clone.removeAttribute('data-lens-active');
- clone.removeAttribute('data-lens-flow-count');
- clone.removeAttribute('data-lens-flow-density');
- clone.removeAttribute('data-legend-preview-active');
- clone.removeAttribute('data-relationship-preview-active');
- clone.removeAttribute('data-relationship-direct-active');
- clone.removeAttribute('data-relationship-pin-active');
- clone.removeAttribute('data-intent-trace-active');
- clone.removeAttribute('data-route-picking');
- clone.removeAttribute('data-route-active');
- clone.removeAttribute('data-route-journey');
- clone.removeAttribute('data-share-route');
- clone.removeAttribute('data-share-reach');
- clone.removeAttribute('data-story-active');
- clone.removeAttribute('data-story-playing');
- clone.removeAttribute('data-story-beat');
- clone.removeAttribute('data-story-next');
- clone.removeAttribute('data-story-follow');
- clone.removeAttribute('data-chapter-handoff');
- clone.removeAttribute('data-chapter-anchor');
- clone.removeAttribute('data-chapter-preview');
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-handoff-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-role]'), function (el) {
- el.removeAttribute('data-chapter-role');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-chapter-preview-role]'), function (el) {
- el.removeAttribute('data-chapter-preview-role');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-probe-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-journey-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-semantic-lens-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge-runtime]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-kind]'), function (el) {
- el.removeAttribute('data-legend-kind');
- el.removeAttribute('data-legend-label');
- el.removeAttribute('data-legend-count');
- el.removeAttribute('data-legend-zero');
- el.removeAttribute('data-legend-selected');
- el.removeAttribute('role');
- el.removeAttribute('tabindex');
- el.removeAttribute('aria-label');
- el.removeAttribute('aria-pressed');
- el.removeAttribute('aria-haspopup');
- el.removeAttribute('aria-controls');
- el.removeAttribute('aria-expanded');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-bridge]'), function (el) {
- el.removeAttribute('data-legend-bridge');
- el.removeAttribute('role');
- el.removeAttribute('aria-label');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-pulse-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-hit-overlay]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-beacon]'), function (el) {
- el.remove();
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-source-evidence-count]'), function (el) {
- var originalLabel = el.getAttribute('data-source-evidence-original-label');
- if (originalLabel == null || originalLabel === '') el.removeAttribute('aria-label');
- else el.setAttribute('aria-label', originalLabel);
- el.removeAttribute('data-source-evidence-count');
- el.removeAttribute('data-source-evidence-original-label');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-story-step], [data-story-beat-state], [data-story-beat-step]'), function (el) {
- el.removeAttribute('data-story-step');
- el.removeAttribute('data-story-beat-state');
- el.removeAttribute('data-story-beat-step');
- el.style.removeProperty('--story-step');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-focus-match], [data-focus-selected]'), function (el) {
- el.removeAttribute('data-focus-match');
- el.removeAttribute('data-focus-selected');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-reach-match], [data-reach-origin], [data-reach-depth]'), function (el) {
- el.removeAttribute('data-reach-match');
- el.removeAttribute('data-reach-origin');
- el.removeAttribute('data-reach-depth');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-lens-match], [data-lens-selected], [data-lens-peer]'), function (el) {
- el.removeAttribute('data-lens-match');
- el.removeAttribute('data-lens-selected');
- el.removeAttribute('data-lens-peer');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer]'), function (el) {
- el.removeAttribute('data-legend-preview-match');
- el.removeAttribute('data-legend-preview-selected');
- el.removeAttribute('data-legend-preview-peer');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target]'), function (el) {
- el.removeAttribute('data-relationship-preview');
- el.removeAttribute('data-relationship-preview-node');
- el.removeAttribute('data-relationship-preview-source');
- el.removeAttribute('data-relationship-preview-target');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-intent-trace-match], [data-intent-trace-selected]'), function (el) {
- el.removeAttribute('data-intent-trace-match');
- el.removeAttribute('data-intent-trace-selected');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current]'), function (el) {
- el.removeAttribute('data-route-match');
- el.removeAttribute('data-route-start');
- el.removeAttribute('data-route-end');
- el.removeAttribute('data-route-step');
- el.removeAttribute('data-route-candidate');
- el.removeAttribute('data-route-journey-state');
- el.removeAttribute('data-route-journey-current');
- el.style.removeProperty('--route-step');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle]'), function (el) {
- el.removeAttribute('data-share-route-match');
- el.removeAttribute('data-share-route-step');
- el.removeAttribute('data-share-route-start');
- el.removeAttribute('data-share-route-end');
- el.removeAttribute('data-share-route-middle');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth]'), function (el) {
- el.removeAttribute('data-share-reach-match');
- el.removeAttribute('data-share-reach-origin');
- el.removeAttribute('data-share-reach-depth');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-detail], [data-detail-anchor]'), function (el) {
- el.removeAttribute('data-detail');
- el.removeAttribute('data-detail-anchor');
- });
- Array.prototype.forEach.call(clone.querySelectorAll('[data-node-id][aria-pressed]'), function (el) {
- el.setAttribute('aria-pressed', 'false');
- });
- var canonicalStateClean = !clone.hasAttribute('data-view-scale') &&
- !clone.hasAttribute('data-focus-active') &&
- !clone.hasAttribute('data-reach-active') &&
- !clone.hasAttribute('data-lens-active') &&
- !clone.hasAttribute('data-lens-flow-count') &&
- !clone.hasAttribute('data-lens-flow-density') &&
- !clone.hasAttribute('data-legend-preview-active') &&
- !clone.hasAttribute('data-relationship-preview-active') &&
- !clone.hasAttribute('data-relationship-direct-active') &&
- !clone.hasAttribute('data-intent-trace-active') &&
- !clone.hasAttribute('data-route-picking') &&
- !clone.hasAttribute('data-route-active') &&
- !clone.hasAttribute('data-route-journey') &&
- !clone.hasAttribute('data-share-route') &&
- !clone.hasAttribute('data-share-reach') &&
- !clone.hasAttribute('data-story-active') &&
- !clone.hasAttribute('data-story-playing') &&
- !clone.hasAttribute('data-story-beat') &&
- !clone.hasAttribute('data-story-next') &&
- !clone.hasAttribute('data-story-follow') &&
- !clone.hasAttribute('data-chapter-handoff') &&
- !clone.hasAttribute('data-chapter-anchor') &&
- !clone.hasAttribute('data-chapter-preview') &&
- !clone.style.getPropertyValue('transform') &&
- !clone.style.getPropertyValue('clip-path') &&
- clone.querySelectorAll('[data-story-overlay], [data-story-carrier-overlay], [data-story-carrier-token], [data-story-step], [data-story-beat-state], [data-story-beat-step], [data-chapter-handoff-overlay], [data-chapter-role], [data-chapter-preview-role], [data-focus-match], [data-focus-selected], [data-reach-match], [data-reach-origin], [data-reach-depth], [data-semantic-lens-overlay], [data-lens-match], [data-lens-selected], [data-lens-peer], [data-legend-bridge], [data-legend-kind], [data-legend-bridge-runtime], [data-legend-count], [data-legend-zero], [data-legend-selected], [data-legend-preview-match], [data-legend-preview-selected], [data-legend-preview-peer], [data-relationship-hit-overlay], [data-relationship-pulse-overlay], [data-relationship-preview], [data-relationship-preview-node], [data-relationship-preview-source], [data-relationship-preview-target], [data-intent-trace-overlay], [data-intent-trace-match], [data-intent-trace-selected], [data-route-probe-overlay], [data-route-journey-overlay], [data-route-match], [data-route-start], [data-route-end], [data-route-step], [data-route-candidate], [data-route-journey-state], [data-route-journey-current], [data-share-route-match], [data-share-route-step], [data-share-route-start], [data-share-route-end], [data-share-route-middle], [data-share-reach-match], [data-share-reach-origin], [data-share-reach-depth], [data-source-evidence-beacon], [data-source-evidence-count], [data-source-evidence-original-label], [data-detail], [data-detail-anchor]').length === 0;
+ var canonicalStateClean = cleanExportClone(clone);
var vb = svg.viewBox.baseVal;
var finiteSvgDimensions = Number.isFinite(vb.x) && Number.isFinite(vb.y) &&
@@ -6278,6 +6138,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// canvas upscaling.
clone.setAttribute('width', vb.width * scale);
clone.setAttribute('height', vb.height * scale);
+ // Keep copied Viewer layout rules from overriding the export's size.
+ clone.style.width = vb.width * scale + 'px';
+ clone.style.height = vb.height * scale + 'px';
+ clone.style.minWidth = '0';
clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
// Only the SVG-relevant rules: semantic classes, markers, and the
@@ -6298,6 +6162,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var sel = rule.selectorText || '';
if (/(^|,)\s*(svg|:root|\[data-theme|\[data-preset|\.c-|\.t-|\.a-|\.m-)/.test(sel)) {
out.push(rule.cssText);
+ } else if (opts.figure && sel.indexOf('.diagram-container > svg') !== -1) {
+ // Figures look like the Viewer canvas: keep its preset/theme paint
+ // (quiet grid, lifted nodes) by rescoping matching rules to svg.
+ var scoped = sel.split(',').map(function (part) {
+ var at = part.indexOf('.diagram-container > svg');
+ if (at === -1) return null;
+ var prefix = part.slice(0, at).trim();
+ try { if (prefix && !document.documentElement.matches(prefix)) return null; } catch (_) { return null; }
+ return 'svg' + part.slice(at + '.diagram-container > svg'.length);
+ }).filter(Boolean);
+ if (scoped.length) out.push(scoped.join(', ') + ' { ' + rule.style.cssText + ' }');
}
});
});
@@ -6326,9 +6201,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6340,25 +6218,29 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = document.createElementNS('http://www.w3.org/2000/svg', 'style');
var bgRect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- bgRect.setAttribute('width', '100%');
- bgRect.setAttribute('height', '100%');
+ // Cover the real viewBox: auto-cropped canvases start below y=0, and a
+ // 100% rect anchored at the origin left an unpainted band at the bottom.
+ bgRect.setAttribute('x', vb.x);
+ bgRect.setAttribute('y', vb.y);
+ bgRect.setAttribute('width', vb.width);
+ bgRect.setAttribute('height', vb.height);
if (autoTheme) {
// Dual-theme SVG. Dark is the default (so hosts without
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6367,11 +6249,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// swaps with the media query.
bgRect.setAttribute('class', 'c-bg-rect');
} else {
- // Raster path: lock to the viewer's current theme.
- var theme = document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + theme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ // Raster exports keep the viewer's current theme. Explicit SVG
+ // exports instead select their own stable light/dark source.
+ var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6385,30 +6268,37 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
hostStyle + "\n" +
":root, svg { " + vars + " }\n";
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
- style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from] { opacity: 0.18; }\n" +
- "svg[data-share-route] [data-share-route-match] { opacity: 1; }\n" +
+ style.textContent += "\nsvg[data-share-route] [data-node-id], svg[data-share-route] [data-edge-from], svg[data-share-route] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.18; }\n" +
+ "svg[data-share-route] [data-share-route-match], svg[data-share-route] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-route-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
"svg[data-share-route] [data-share-route-start] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3; stroke-dasharray: 5 3; }\n" +
"svg[data-share-route] [data-share-route-middle] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 2.2; }\n" +
"svg[data-share-route] [data-share-route-end] > :is(rect, circle, polygon):not(.c-mask) { stroke-width: 3.4; stroke-dasharray: 1 0; }\n";
}
if (opts.reachSnapshot) {
- style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from] { opacity: 0.14; }\n" +
- "svg[data-share-reach] [data-share-reach-match] { opacity: 1; }\n" +
+ style.textContent += "\nsvg[data-share-reach] [data-node-id], svg[data-share-reach] [data-edge-from], svg[data-share-reach] [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 0.14; }\n" +
+ "svg[data-share-reach] [data-share-reach-match], svg[data-share-reach] [data-graph-role=\"automatic-crossover\"]:has(> [data-share-reach-match]) > [data-graph-role=\"automatic-crossover-underlay\"] { opacity: 1; }\n" +
"svg[data-share-reach] [data-edge-from][data-share-reach-match] { stroke-width: 1.55; }\n" +
"svg[data-share-reach=\"upstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--database-stroke); stroke-width: 3.4; stroke-dasharray: 5 3; }\n" +
"svg[data-share-reach=\"downstream\"] [data-share-reach-origin] > :is(rect, circle, polygon):not(.c-mask) { stroke: var(--backend-stroke); stroke-width: 3.4; stroke-dasharray: 1 0; }\n" +
"svg[data-preset=\"blueprint\"][data-share-reach] [data-share-reach-origin], svg[data-preset=\"blueprint\"][data-share-reach] [data-edge-from][data-share-reach-match] { filter: none; }\n";
}
+ // Figures draw the diagram on a painted canvas card, like the Viewer.
+ if (opts.figure) bgRect.setAttribute('fill', 'none');
+
clone.insertBefore(style, clone.firstChild);
clone.insertBefore(bgRect, style.nextSibling);
+ // The XML declaration pins UTF-8: without it, consumers that guess an
+ // encoding instead of defaulting to UTF-8 mangle non-ASCII text.
return {
- svgString: new XMLSerializer().serializeToString(clone),
+ svgString: '<?xml version="1.0" encoding="UTF-8"?>\n' +
+ new XMLSerializer().serializeToString(clone),
width: vb.width * scale,
height: vb.height * scale,
canonicalStateClean: canonicalStateClean,
@@ -6432,14 +6322,114 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// silently produces a blank canvas above ~16 Mpx; Chrome / Firefox /
// desktop Safari are far higher but start failing on memory-constrained
// devices. We pick the largest integer scale in {4,3,2,1} whose target
- // pixel count fits under this cap.
+ // pixel count fits under this cap; a figure too large even at 1x is
+ // downscaled to fit rather than allocating an oversized canvas.
var MAX_CANVAS_PIXELS = 16 * 1024 * 1024;
function pickSafeScale(vbW, vbH) {
for (var s = RASTER_SCALE; s >= 1; s--) {
if (vbW * s * vbH * s <= MAX_CANVAS_PIXELS) return s;
}
- return 1;
+ return Math.sqrt(MAX_CANVAS_PIXELS / (vbW * vbH)) * 0.999;
+ }
+
+ // Raster exports reproduce the Viewer page without its controls: the
+ // title row with its accent dot, then the diagram on the same rounded
+ // canvas card (fill, hairline, shadow, dot field). CSS pixels.
+ var FIGURE_MARGIN = 28;
+ var FIGURE_CARD_PADDING = 24;
+ var FIGURE_TITLE_SIZE = 24;
+ var FIGURE_SUBTITLE_SIZE = 14;
+
+ function figureLayout(vb) {
+ var titleNode = document.querySelector('.header h1');
+ var subtitleNode = document.querySelector('.header .subtitle');
+ var container = document.querySelector('.diagram-container');
+ var root = getComputedStyle(document.documentElement);
+ var card = container ? getComputedStyle(container) : null;
+ var title = titleNode ? titleNode.textContent.trim() : '';
+ var subtitle = subtitleNode ? subtitleNode.textContent.trim() : '';
+ var header = title ? 32 + (subtitle ? 24 : 0) + 18 : 0;
+ var cardWidth = vb.width + FIGURE_CARD_PADDING * 2;
+ var cardHeight = vb.height + FIGURE_CARD_PADDING * 2;
+ var cardFill = card && card.backgroundColor && !/rgba\(0, 0, 0, 0\)|transparent/.test(card.backgroundColor)
+ ? card.backgroundColor : (root.getPropertyValue('--panel').trim() || 'transparent');
+ return {
+ title: title,
+ subtitle: subtitle,
+ family: titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif',
+ text: root.getPropertyValue('--text').trim() || '#111827',
+ muted: root.getPropertyValue('--text-muted').trim() || '#64748b',
+ accent: root.getPropertyValue('--frontend-stroke').trim() || '#0891b2',
+ bg: root.getPropertyValue('--bg').trim() || currentBg(),
+ cardFill: cardFill,
+ cardBorder: root.getPropertyValue('--panel-border').trim() || 'transparent',
+ dot: card && /radial-gradient/.test(card.backgroundImage) ? (root.getPropertyValue('--canvas-dot').trim() || '') : '',
+ light: (document.documentElement.getAttribute('data-theme') || 'dark') === 'light',
+ header: header,
+ cardWidth: cardWidth,
+ cardHeight: cardHeight,
+ width: cardWidth + FIGURE_MARGIN * 2,
+ height: cardHeight + FIGURE_MARGIN * 2 + header
+ };
+ }
+
+ function paintFigure(ctx, layout) {
+ var m = FIGURE_MARGIN;
+ ctx.fillStyle = layout.bg;
+ ctx.fillRect(0, 0, layout.width, layout.height);
+ if (layout.title) {
+ var titleMid = m + 16;
+ ctx.fillStyle = layout.accent;
+ ctx.globalAlpha = 0.16;
+ ctx.beginPath(); ctx.arc(m + 5, titleMid, 9, 0, Math.PI * 2); ctx.fill();
+ ctx.globalAlpha = 1;
+ ctx.beginPath(); ctx.arc(m + 5, titleMid, 5, 0, Math.PI * 2); ctx.fill();
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = layout.text;
+ ctx.fillText(fitCanvasText(ctx, layout.title, layout.width - m * 2 - 22, FIGURE_TITLE_SIZE, 14, '650', layout.family), m + 22, titleMid + 1);
+ if (layout.subtitle) {
+ ctx.fillStyle = layout.muted;
+ ctx.fillText(fitCanvasText(ctx, layout.subtitle, layout.width - m * 2, FIGURE_SUBTITLE_SIZE, 11, '400', layout.family), m, titleMid + 30);
+ }
+ ctx.textBaseline = 'alphabetic';
+ }
+ var x = m, y = m + layout.header, w = layout.cardWidth, h = layout.cardHeight, r = 16;
+ function cardPath() {
+ ctx.beginPath();
+ if (typeof ctx.roundRect === 'function') ctx.roundRect(x, y, w, h, r);
+ else ctx.rect(x, y, w, h);
+ }
+ ctx.save();
+ if (layout.light) {
+ ctx.shadowColor = 'rgba(15, 23, 42, 0.08)';
+ ctx.shadowBlur = 28;
+ ctx.shadowOffsetY = 10;
+ }
+ cardPath();
+ ctx.fillStyle = layout.bg;
+ ctx.fill();
+ ctx.restore();
+ cardPath();
+ ctx.fillStyle = layout.cardFill;
+ ctx.fill();
+ if (layout.dot) {
+ ctx.save();
+ cardPath();
+ ctx.clip();
+ ctx.fillStyle = layout.dot;
+ for (var dy = y + 1; dy < y + h; dy += 20) {
+ for (var dx = x + 1; dx < x + w; dx += 20) {
+ ctx.beginPath(); ctx.arc(dx, dy, 1, 0, Math.PI * 2); ctx.fill();
+ }
+ }
+ ctx.restore();
+ }
+ cardPath();
+ ctx.strokeStyle = layout.cardBorder;
+ ctx.lineWidth = 1;
+ ctx.stroke();
+ return { x: x + FIGURE_CARD_PADDING, y: y + FIGURE_CARD_PADDING };
}
function rasterize(format) {
@@ -6449,8 +6439,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// size — no upsampling blur.
var svg = document.querySelector('.diagram-container svg');
var vb = svg.viewBox.baseVal;
- var scale = pickSafeScale(vb.width, vb.height);
- var data = serializeSvg(scale);
+ var layout = figureLayout(vb);
+ var scale = pickSafeScale(layout.width, layout.height);
+ var data = serializeSvg(scale, { figure: true });
var svgBlob = new Blob([data.svgString], { type: 'image/svg+xml;charset=utf-8' });
var svgUrl = URL.createObjectURL(svgBlob);
@@ -6459,15 +6450,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
img.onload = function () {
try {
var canvas = document.createElement('canvas');
- canvas.width = data.width;
- canvas.height = data.height;
+ canvas.width = Math.round(layout.width * scale);
+ canvas.height = Math.round(layout.height * scale);
var ctx = canvas2dOrThrow(canvas, format);
- if (format === 'jpeg') {
- ctx.fillStyle = currentBg();
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- }
- // Draw at natural size — SVG was already rasterized at target res.
- ctx.drawImage(img, 0, 0);
+ // Paint in CSS pixels; the SVG image is already rendered at scale,
+ // so drawing it at CSS size under this transform stays 1:1.
+ ctx.setTransform(scale, 0, 0, scale, 0, 0);
+ var origin = paintFigure(ctx, layout);
+ ctx.drawImage(img, origin.x, origin.y, vb.width, vb.height);
+ ctx.setTransform(1, 0, 0, 1, 0, 0);
URL.revokeObjectURL(svgUrl);
var mime = format === 'jpeg' ? 'image/jpeg' :
format === 'webp' ? 'image/webp' : 'image/png';
@@ -6489,10 +6480,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
});
}
- function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight) {
+ function fitCanvasText(ctx, text, maxWidth, startSize, minSize, weight, fontFamily) {
var value = String(text || '').trim();
var size = startSize;
- var family = "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
+ var family = fontFamily || "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
while (size > minSize) {
ctx.font = (weight || '600') + ' ' + size + 'px ' + family;
if (ctx.measureText(value).width <= maxWidth) return value;
@@ -6518,14 +6509,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function renderShareCard(options) {
- options = options || {};
var routeSnapshot = options.routeSnapshot || null;
var reachSnapshot = options.reachSnapshot || null;
if (routeSnapshot && reachSnapshot) return Promise.reject(exportError('viewer.export.error.variantsCombined'));
var svg = document.querySelector('.diagram-container svg');
var vb = svg.viewBox.baseVal;
var sourceScale = Math.min(2, pickSafeScale(vb.width, vb.height));
- var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot });
+ var data = serializeSvg(sourceScale, { routeSnapshot: routeSnapshot, reachSnapshot: reachSnapshot, figure: true });
if (!data.canonicalStateClean) return Promise.reject(exportError('viewer.export.error.viewerState'));
if (routeSnapshot && !data.routeStateClean) return Promise.reject(exportError('viewer.export.error.routeState'));
if (reachSnapshot && !data.reachStateClean) return Promise.reject(exportError('viewer.export.error.reachState'));
@@ -6550,7 +6540,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
: '--frontend-stroke';
var accent = computed.getPropertyValue(accentProperty).trim() || '#22d3ee';
var titleNode = document.querySelector('.header h1');
- var subtitleNode = document.querySelector('.header .subtitle');
var title = titleNode ? titleNode.textContent : document.title;
var directionLabel = reachSnapshot
? viewerText('viewer.export.direction.' + reachSnapshot.direction)
@@ -6560,62 +6549,65 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
source: routeSnapshot.source.label,
target: routeSnapshot.target.label
})
- : reachSnapshot
- ? viewerText('viewer.export.card.reachSummary', {
- direction: directionLabel,
- origin: reachSnapshot.origin.label,
- nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
- links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
- hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
- })
- : subtitleNode ? subtitleNode.textContent : '';
- var preset = document.documentElement.getAttribute('data-preset') || 'classic';
- var theme = document.documentElement.getAttribute('data-theme') || 'dark';
- var presetKey = preset === 'signal-flow'
- ? 'viewer.preset.flow.short'
- : 'viewer.preset.' + preset;
- var presetLabel = viewerText(presetKey).toUpperCase();
- var themeLabel = viewerText('viewer.theme.' + theme).toUpperCase();
+ : viewerText('viewer.export.card.reachSummary', {
+ direction: directionLabel,
+ origin: reachSnapshot.origin.label,
+ nodes: viewerCount('viewer.export.card.node', reachSnapshot.nodeIds.length - 1),
+ links: viewerCount('viewer.export.card.link', reachSnapshot.edges.length),
+ hops: viewerCount('viewer.export.card.hop', reachSnapshot.maxDepth)
+ });
var cardLabel = routeSnapshot
? viewerText('viewer.export.card.routeBadge', {
hops: viewerCount('viewer.export.card.hop', routeSnapshot.hops).toUpperCase()
})
- : reachSnapshot
- ? viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() })
- : viewerText('viewer.export.card.defaultBadge', { preset: presetLabel, theme: themeLabel });
+ : viewerText('viewer.export.card.reachBadge', { direction: directionLabel.toUpperCase() });
+
+ var family = titleNode ? getComputedStyle(titleNode).fontFamily : 'sans-serif';
+ var panelFill = bg;
ctx.fillStyle = bg;
ctx.fillRect(0, 0, SHARE_CARD_WIDTH, SHARE_CARD_HEIGHT);
+ // Header: a short accent rule and badge over the title and summary.
ctx.fillStyle = accent;
- ctx.fillRect(SHARE_CARD_PADDING, 27, 42, 3);
-
+ ctx.fillRect(SHARE_CARD_PADDING, 34, 28, 3);
ctx.textBaseline = 'alphabetic';
+ ctx.font = '600 12px ' + family;
+ ctx.textAlign = 'right';
+ ctx.fillStyle = muted;
+ ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 40);
+ ctx.textAlign = 'left';
+
ctx.fillStyle = text;
- var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 330, 29, 18, '700');
- ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 62);
+ var fittedTitle = fitCanvasText(ctx, title, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 260, 30, 18, '650', family);
+ ctx.fillText(fittedTitle, SHARE_CARD_PADDING, 74);
ctx.fillStyle = muted;
- var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2 - 280, 13, 11, '500');
- ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 87);
-
- ctx.font = "600 12px 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
- ctx.textAlign = 'right';
- ctx.fillStyle = accent;
- ctx.fillText(cardLabel, SHARE_CARD_WIDTH - SHARE_CARD_PADDING, 50);
- ctx.textAlign = 'left';
+ var fittedSubtitle = fitCanvasText(ctx, subtitle, SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2, 15, 12, '400', family);
+ ctx.fillText(fittedSubtitle, SHARE_CARD_PADDING, 99);
+
+ // The diagram sits on one soft rounded panel with an even inset.
+ var panelX = SHARE_CARD_PADDING;
+ var panelY = SHARE_CARD_HEADER;
+ var panelWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
+ var panelHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
+ var inset = 18;
+ ctx.beginPath();
+ if (typeof ctx.roundRect === 'function') ctx.roundRect(panelX, panelY, panelWidth, panelHeight, 14);
+ else ctx.rect(panelX, panelY, panelWidth, panelHeight);
+ ctx.fillStyle = panelFill;
+ ctx.fill();
+ ctx.strokeStyle = border;
+ ctx.lineWidth = 1;
+ ctx.stroke();
- var availableWidth = SHARE_CARD_WIDTH - SHARE_CARD_PADDING * 2;
- var availableHeight = SHARE_CARD_HEIGHT - SHARE_CARD_HEADER - SHARE_CARD_PADDING;
+ var availableWidth = panelWidth - inset * 2;
+ var availableHeight = panelHeight - inset * 2;
var fit = Math.min(availableWidth / data.width, availableHeight / data.height);
var drawWidth = data.width * fit;
var drawHeight = data.height * fit;
- var drawX = SHARE_CARD_PADDING + (availableWidth - drawWidth) / 2;
- var drawY = SHARE_CARD_HEADER + (availableHeight - drawHeight) / 2;
-
- ctx.strokeStyle = border;
- ctx.lineWidth = 1;
- ctx.strokeRect(drawX - 0.5, drawY - 0.5, drawWidth + 1, drawHeight + 1);
+ var drawX = panelX + inset + (availableWidth - drawWidth) / 2;
+ var drawY = panelY + inset + (availableHeight - drawHeight) / 2;
ctx.drawImage(img, drawX, drawY, drawWidth, drawHeight);
URL.revokeObjectURL(svgUrl);
@@ -6638,7 +6630,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function rasterizeShareCard(options) {
options = options || {};
- if (!options.variant) return renderShareCard();
if (options.variant !== 'route' && options.variant !== 'reach') {
return Promise.reject(exportError('viewer.export.unknownVariant', { variant: options.variant }));
}
@@ -6951,8 +6942,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// canvas.toBlob('image/webp') silently returns a PNG on browsers without
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
- if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
@@ -6968,7 +6958,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
it.disabled = true;
it.title = viewerText('viewer.export.unsupported');
}
- if ((it.dataset.action === 'copy' || it.dataset.action === 'copy-share-card') && !canCopyImage()) {
+ if (it.dataset.action === 'copy' && !canCopyImage()) {
it.disabled = true;
it.title = viewerText('viewer.export.clipboardUnsupported');
}
@@ -7058,21 +7048,21 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
});
function runExport(format) {
+ if (['svg', 'svg-light', 'svg-dark', 'png', 'jpeg', 'webp', 'webm'].indexOf(format) === -1) {
+ return Promise.reject(exportError('viewer.export.unsupported'));
+ }
var base = diagramFilename();
+ var svgTheme = format === 'svg' ? 'auto' :
+ format === 'svg-light' ? 'light' :
+ format === 'svg-dark' ? 'dark' : null;
close(true);
clearExportReceipt();
if (format === 'webm') toast(viewerText('viewer.export.recording'));
- return (format === 'share-card'
- ? rasterizeShareCard().then(function (blob) {
- recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });
- download(blob, base + '-share-card.png');
- toast(viewerText('viewer.export.downloadedShare'));
- })
- : format === 'svg'
- ? Promise.resolve(serializeSvg(1, { autoTheme: true })).then(function (d) {
+ return (svgTheme
+ ? Promise.resolve(serializeSvg(1, { theme: svgTheme })).then(function (d) {
var blob = new Blob([d.svgString], { type: 'image/svg+xml;charset=utf-8' });
recordExportReceipt('svg', blob, d.canonicalStateClean);
- download(blob, base + '.svg');
+ download(blob, base + (svgTheme === 'auto' ? '' : '-' + svgTheme) + '.svg');
})
: format === 'webm'
? recordWebm().then(function (blob) {
@@ -7208,29 +7198,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
}
- function runCopyShareCard() {
- close(true);
- clearExportReceipt();
- if (!canCopyImage()) {
- alert(viewerText('viewer.export.clipboardUnsupported.period'));
- return;
- }
- var blobPromise = rasterizeShareCard();
- return writePngToClipboard(blobPromise).then(function () {
- return blobPromise.then(function (blob) {
- recordExportReceipt('share-card', blob, true, { width: SHARE_CARD_WIDTH, height: SHARE_CARD_HEIGHT });
- toast(viewerText('viewer.export.copiedShare'));
- });
- }).catch(function (err) {
- console.error(err);
- var technicalMessage = err && err.message ? err.message : 'share-card';
- var message = exportMessage(err);
- document.documentElement.setAttribute('data-last-export-error-format', 'share-card');
- document.documentElement.setAttribute('data-last-export-error', technicalMessage);
- alert(viewerText('viewer.export.copyFailed', { message: message }));
- });
- }
-
function runCopy() {
close(true);
clearExportReceipt();
@@ -7256,9 +7223,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var reachShareCardBtn = e.target.closest('button[data-action="reach-share-card"]');
if (reachShareCardBtn && !reachShareCardBtn.disabled && !reachShareCardBtn.hidden) { runReachShareCard(); return; }
- var copyShareCardBtn = e.target.closest('button[data-action="copy-share-card"]');
- if (copyShareCardBtn && !copyShareCardBtn.disabled) { runCopyShareCard(); return; }
-
var copyBtn = e.target.closest('button[data-action="copy"]');
if (copyBtn && !copyBtn.disabled) { runCopy(); return; }
@@ -7276,8 +7240,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
downloadRouteShareCard: runRouteShareCard,
downloadReachShareCard: runReachShareCard,
syncRouteShare: syncRouteShareItem,
- syncReachShare: syncReachShareItem,
- copyShareCard: runCopyShareCard
+ syncReachShare: syncReachShareItem
};
// Auto-open on page load for demo/screenshot purposes: ?openExport=1
@@ -7298,6 +7261,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
} catch (_) {}
})();
+
/* ============================================================
Motion Governor — one reader switch and one motion budget. Ambient
trace yields to the strongest semantic owner; Still also parks bounded
@@ -7371,10 +7335,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return readerPaused || reducedMotion() || hasSuspension();
}
function ownerLabel(value) {
- if (value === 'story') return viewerText('viewer.owner.story');
- if (value === 'chapter') return viewerText('viewer.owner.chapter');
- if (value === 'chapter-preview') return viewerText('viewer.owner.chapterPreview');
- if (value === 'handoff') return viewerText('viewer.owner.handoff');
if (value === 'route') return viewerText('viewer.owner.route');
if (value === 'lens') return viewerText('viewer.owner.lens');
if (value === 'relationship') return viewerText('viewer.owner.relationship');
@@ -7396,12 +7356,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
btn.setAttribute('aria-pressed', paused ? 'false' : 'true');
btn.disabled = systemPaused;
label.textContent = viewerText(paused ? 'viewer.motion.still' : 'viewer.motion.live');
- if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
- if (paused && lastEffectivePaused !== true && Archify.guidedViews && Archify.guidedViews.settleHandoff) {
- Archify.guidedViews.settleHandoff(systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still'));
- }
if (paused && lastEffectivePaused !== true && Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: systemPaused ? 'reduced-motion' : (hasSuspension() ? 'hidden' : 'still') });
}
@@ -7440,8 +7394,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function deriveOwner() {
if (!svg) return '';
- if (svg.hasAttribute('data-story-playing') || svg.hasAttribute('data-story-follow')) return 'story';
- if (svg.hasAttribute('data-story-active')) return 'chapter';
if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return 'route';
if (svg.hasAttribute('data-lens-active')) return 'lens';
if (svg.hasAttribute('data-relationship-preview-active')) return 'relationship';
@@ -7535,7 +7487,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
ownerObserver.observe(svg, {
attributes: true,
attributeFilter: [
- 'data-story-playing', 'data-story-follow', 'data-story-active', 'data-route-picking', 'data-route-active',
+ 'data-route-picking', 'data-route-active',
'data-lens-active', 'data-relationship-preview-active', 'data-intent-trace-active',
'data-focus-active', 'data-legend-preview-active'
]
@@ -7664,6 +7616,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var copyBtn = document.getElementById('btn-focus-copy');
var relationsBtn = document.getElementById('btn-focus-relations');
var clearBtn = document.getElementById('btn-focus-clear');
+ var moveBtn = document.getElementById('btn-focus-move');
var activeIds = [];
var hoveredRelationship = null;
var focusedRelationship = null;
@@ -7673,6 +7626,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var relationshipHitOverlay = null;
var relationshipHitTargets = [];
var directPreviewTimer = null;
+ var lensDrag = null;
+ var lensDragClickPointer = null;
+ var manualLensPosition = null;
var reachabilityMode = null;
var activeReachability = null;
var svgNamespace = 'http://www.w3.org/2000/svg';
@@ -7811,9 +7767,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var result = reachabilityFor(activeIds[0], direction);
if (!result || result.nodeIds.length <= 1) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false, resetView: false });
- }
clearRelationshipPreview({ clearPin: true });
clearReachability({ updateUrl: false });
reachabilityMode = direction;
@@ -7867,7 +7820,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.reveal !== false && Archify.view && typeof Archify.view.reveal === 'function') {
Archify.view.reveal(result.nodeIds, { includeNeighbors: false, reason: 'reachability' });
}
- requestLensPlacement();
+ placeRelationshipLens();
return true;
}
function reachabilitySnapshot() {
@@ -7970,6 +7923,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function renderSourceEvidence(id) {
evidenceLinks.textContent = '';
repositoryLink.removeAttribute('href');
+ repositoryLink.removeAttribute('aria-label');
repositoryLink.textContent = '';
var sources = Archify.sourceEvidence.node(id);
var repository = Archify.sourceEvidence.repository();
@@ -7977,24 +7931,28 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
evidence.hidden = true;
return;
}
- var slug = repository.url.replace(/^https:\/\/github\.com\//, '').replace(/\/$/, '');
- repositoryLink.href = repository.url + '/tree/' + repository.revision;
- repositoryLink.textContent = slug + ' @ ' + repository.shortRevision;
- repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
+ repositoryLink.textContent = repository.label + ' @ ' + repository.shortRevision;
+ if (repository.href) {
+ repositoryLink.href = repository.href;
+ repositoryLink.setAttribute('aria-label', viewerText('viewer.passport.repository.open', { revision: repository.revision }));
+ }
+ evidence.title = viewerText('viewer.passport.verificationScope');
sources.forEach(function (source) {
- var link = document.createElement('a');
+ var link = document.createElement(source.href ? 'a' : 'div');
link.className = 'semantic-passport-source';
- link.href = source.href;
- link.target = '_blank';
- link.rel = 'noopener noreferrer';
- link.referrerPolicy = 'no-referrer';
- link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
+ if (source.href) {
+ link.href = source.href;
+ link.target = '_blank';
+ link.rel = 'noopener noreferrer';
+ link.referrerPolicy = 'no-referrer';
+ link.setAttribute('aria-label', viewerText('viewer.passport.source.open', { path: source.path, revision: repository.shortRevision }));
+ }
var name = document.createElement('strong');
name.textContent = source.label || source.path.split('/').pop() || source.path;
var location = document.createElement('code');
location.textContent = source.line
- ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + ' ↗'
- : viewerText('viewer.passport.source.openLink');
+ ? 'L' + source.line + (source.endLine && source.endLine !== source.line ? '–' + source.endLine : '') + (source.href ? ' ↗' : '')
+ : source.href ? viewerText('viewer.passport.source.openLink') : '';
var sourcePath = document.createElement('small');
sourcePath.textContent = source.path;
link.appendChild(name);
@@ -8053,8 +8011,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function relationshipHitRecords() {
var recordsByKey = {};
- var recordsById = {};
- var byId = {};
+ var recordsById = Object.create(null);
+ var byId = Object.create(null);
nodes().forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var records = [];
edges().forEach(function (edge) {
@@ -8342,7 +8300,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
target.removeAttribute('data-preview-active');
});
renderRelationshipCopyAction();
- requestLensPlacement();
+ placeRelationshipLens();
}
function previewRelationship(button, options) {
options = options || {};
@@ -8369,7 +8327,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!chip.hidden && options.direct !== true) chip.setAttribute('data-relationship-previewing', 'true');
activeRelationshipPreview = button;
renderRelationshipPulse(key);
- requestLensPlacement();
+ placeRelationshipLens();
}
function syncRelationshipPreview() {
var next = pinnedRelationship || focusedRelationship || hoveredRelationship;
@@ -8381,11 +8339,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.getAttribute('data-guide-open') === 'true' ||
container.classList.contains('is-panning') ||
(activeIds.length > 0 && !pinnedRelationshipKey) ||
- svg.hasAttribute('data-story-active') ||
svg.hasAttribute('data-route-picking') ||
svg.hasAttribute('data-route-active') ||
- svg.hasAttribute('data-lens-active') ||
- svg.hasAttribute('data-chapter-preview');
+ svg.hasAttribute('data-lens-active');
}
function scheduleDirectRelationshipPreview(target) {
if (directPreviewTimer) window.clearTimeout(directPreviewTimer);
@@ -8424,9 +8380,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var record = relationshipRecordForKey(key);
if (!record) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
set(record.from, { toggle: false, updateUrl: false });
var row = Array.prototype.slice.call(relationshipList.querySelectorAll('[data-relationship-key]')).find(function (candidate) {
return candidate.getAttribute('data-relationship-key') === key;
@@ -8648,9 +8601,148 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationshipList.appendChild(section);
});
}
+ function lensPlacementBounds() {
+ var containerRect = container.getBoundingClientRect();
+ if (containerRect.width <= 0 || containerRect.height <= 0 || chip.offsetWidth <= 0 || chip.offsetHeight <= 0) return null;
+ var padding = window.innerWidth <= 720 ? 8 : 16;
+ var visibleLeft = Math.max(padding, -containerRect.left + padding);
+ var visibleRight = Math.min(
+ container.clientWidth - padding,
+ window.innerWidth - containerRect.left - padding
+ );
+ var visibleTop = Math.max(padding, -containerRect.top + padding);
+ var visibleBottom = Math.min(
+ container.clientHeight - padding,
+ window.innerHeight - containerRect.top - padding
+ );
+ var minLeft = visibleLeft;
+ var minTop = Math.min(visibleTop, Math.max(padding, visibleBottom - chip.offsetHeight));
+ return {
+ containerRect: containerRect,
+ minLeft: minLeft,
+ maxLeft: Math.max(minLeft, visibleRight - chip.offsetWidth),
+ minTop: minTop,
+ maxTop: Math.max(minTop, visibleBottom - chip.offsetHeight)
+ };
+ }
+ function manualLensPlacementAvailable() {
+ return window.innerWidth > 720 && (!finePointerQuery || finePointerQuery.matches);
+ }
+ function clampLensPosition(position, bounds) {
+ if (!position || !bounds) return null;
+ return {
+ left: Math.max(bounds.minLeft, Math.min(bounds.maxLeft, position.left)),
+ top: Math.max(bounds.minTop, Math.min(bounds.maxTop, position.top))
+ };
+ }
+ function currentLensPosition() {
+ var bounds = lensPlacementBounds();
+ if (!bounds) return null;
+ var rect = chip.getBoundingClientRect();
+ return clampLensPosition({
+ left: rect.left - bounds.containerRect.left,
+ top: rect.top - bounds.containerRect.top
+ }, bounds);
+ }
+ function applyManualLensPosition(position) {
+ if (!manualLensPlacementAvailable()) return false;
+ var bounds = lensPlacementBounds();
+ var clamped = clampLensPosition(position, bounds);
+ if (!clamped) return false;
+ manualLensPosition = clamped;
+ chip.setAttribute('data-manual-placement', 'true');
+ chip.style.left = Math.round(clamped.left) + 'px';
+ chip.style.top = Math.round(clamped.top) + 'px';
+ if (Archify.radar && typeof Archify.radar.sync === 'function') Archify.radar.sync();
+ return true;
+ }
+ function resetLensPlacement(options) {
+ options = options || {};
+ manualLensPosition = null;
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ chip.style.removeProperty('top');
+ if (options.reposition !== false && !chip.hidden) requestLensPlacement();
+ }
+ function beginLensDrag(event) {
+ if (!manualLensPlacementAvailable() || event.button !== 0 || lensDrag) return;
+ var start = currentLensPosition();
+ if (!start) return;
+ event.preventDefault();
+ event.stopPropagation();
+ lensDrag = {
+ pointerId: event.pointerId,
+ originX: event.clientX,
+ originY: event.clientY,
+ start: start,
+ previousManual: manualLensPosition ? { left: manualLensPosition.left, top: manualLensPosition.top } : null,
+ moved: false
+ };
+ chip.setAttribute('data-panel-dragging', 'true');
+ try { moveBtn.setPointerCapture(event.pointerId); } catch (_) {}
+ }
+ function moveLensDrag(event) {
+ if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
+ var dx = event.clientX - lensDrag.originX;
+ var dy = event.clientY - lensDrag.originY;
+ if (!lensDrag.moved && Math.hypot(dx, dy) <= 3) return;
+ lensDrag.moved = true;
+ event.preventDefault();
+ event.stopPropagation();
+ applyManualLensPosition({ left: lensDrag.start.left + dx, top: lensDrag.start.top + dy });
+ }
+ function finishLensDrag(event, cancel) {
+ if (!lensDrag || lensDrag.pointerId !== event.pointerId) return;
+ event.preventDefault();
+ event.stopPropagation();
+ var activeDrag = lensDrag;
+ lensDrag = null;
+ if (activeDrag.moved) lensDragClickPointer = activeDrag.pointerId;
+ chip.removeAttribute('data-panel-dragging');
+ try { moveBtn.releasePointerCapture(event.pointerId); } catch (_) {}
+ if (!cancel) return;
+ manualLensPosition = activeDrag.previousManual
+ ? { left: activeDrag.previousManual.left, top: activeDrag.previousManual.top }
+ : null;
+ if (manualLensPosition && manualLensPlacementAvailable()) {
+ applyManualLensPosition(manualLensPosition);
+ } else {
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ chip.style.removeProperty('top');
+ if (!chip.hidden) requestLensPlacement();
+ }
+ }
+ function moveLensWithKeyboard(event) {
+ if (event.key === 'Home') {
+ event.preventDefault();
+ resetLensPlacement();
+ return;
+ }
+ if (event.metaKey || event.ctrlKey || event.altKey || !manualLensPlacementAvailable()) return;
+ var directions = {
+ ArrowLeft: [-1, 0],
+ ArrowRight: [1, 0],
+ ArrowUp: [0, -1],
+ ArrowDown: [0, 1]
+ };
+ var direction = directions[event.key];
+ if (!direction) return;
+ event.preventDefault();
+ var current = manualLensPosition || currentLensPosition();
+ if (!current) return;
+ var distance = event.shiftKey ? 4 : 16;
+ applyManualLensPosition({
+ left: current.left + direction[0] * distance,
+ top: current.top + direction[1] * distance
+ });
+ }
var lensFrame = 0;
function placeRelationshipLens() {
- lensFrame = 0;
+ if (lensFrame) {
+ cancelAnimationFrame(lensFrame);
+ lensFrame = 0;
+ }
if (chip.hidden || activeIds.length !== 1) return;
var node = svg.querySelector('[data-node-id="' + activeIds[0] + '"]');
if (!node) return;
@@ -8662,8 +8754,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var visibleBottom = Math.min(containerRect.height - padding, window.innerHeight - containerRect.top - padding);
var maxTop = Math.max(padding, visibleBottom - chip.offsetHeight);
var minTop = Math.min(visibleTop, maxTop);
- var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
var mobile = window.innerWidth <= 720;
+ if (!manualLensPlacementAvailable()) {
+ chip.removeAttribute('data-manual-placement');
+ chip.style.removeProperty('left');
+ } else if (manualLensPosition) {
+ applyManualLensPosition(manualLensPosition);
+ return;
+ }
+ var nodeCenter = nodeRect.top - containerRect.top + nodeRect.height / 2;
var previewingOnMobile = mobile && chip.getAttribute('data-relationship-previewing') === 'true';
var compactOnMobile = mobile && chip.getAttribute('data-relations-expanded') !== 'true';
var preferred;
@@ -8734,6 +8833,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function clear(options) {
options = options || {};
+ if (lensDrag) {
+ var dragPointerId = lensDrag.pointerId;
+ lensDrag = null;
+ chip.removeAttribute('data-panel-dragging');
+ try { moveBtn.releasePointerCapture(dragPointerId); } catch (_) {}
+ }
var restoreNode = options.restoreFocus === true && activeIds.length === 1
? svg.querySelector('[data-node-id="' + activeIds[0] + '"]')
: null;
@@ -8781,7 +8886,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationsBtn.setAttribute('aria-label', viewerText('viewer.passport.relations.show'));
relationsBtn.setAttribute('aria-expanded', 'false');
chip.removeAttribute('data-relations-expanded');
- chip.style.removeProperty('top');
+ if (options.preserveLensPlacement !== true) resetLensPlacement({ reposition: false });
if (options.preserveView !== true && Archify.view && typeof Archify.view.reset === 'function') {
Archify.view.reset({ automatic: true });
}
@@ -8804,7 +8909,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
}
var nodeList = nodes();
- var byId = {};
+ var byId = Object.create(null);
nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var normalized = [];
(ids || []).forEach(function (id) {
@@ -8816,10 +8921,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return true;
}
- clear({ updateUrl: false, preserveView: true });
+ var preserveLensPlacement = activeIds.length === 1 && normalized.length === 1 && !chip.hidden;
+ clear({ updateUrl: false, preserveView: true, preserveLensPlacement: preserveLensPlacement });
activeIds = normalized;
- var selected = {};
- var related = {};
+ var selected = Object.create(null);
+ var related = Object.create(null);
var seenEdges = {};
var matchedEdges = 0;
normalized.forEach(function (id) { selected[id] = true; related[id] = true; });
@@ -8846,12 +8952,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
svg.setAttribute('data-focus-active', normalized.join(' '));
var defaultLabel = normalized.length === 1
? nodeLabel(byId[normalized[0]], normalized[0])
- : viewerText('viewer.guided.chapter.selectedNodes', { count: normalized.length });
+ : viewerText('viewer.focus.selectedNodes', { count: normalized.length });
label.textContent = options.label || defaultLabel;
chip.hidden = options.hideChip === true || normalized.length !== 1 || selectionMode;
if (!chip.hidden) {
renderRelationshipLens(normalized[0], byId);
- requestLensPlacement();
+ placeRelationshipLens();
}
if (options.updateUrl !== false) {
var key = options.urlKey || 'focus';
@@ -8925,8 +9031,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Archify.view.reveal([id], { includeNeighbors: true, reason: 'focus' });
}
});
- clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });
- copyBtn.addEventListener('click', copyFocusLink);
+ moveBtn.addEventListener('pointerdown', beginLensDrag);
+ moveBtn.addEventListener('pointermove', moveLensDrag);
+ moveBtn.addEventListener('pointerup', function (event) { finishLensDrag(event, false); });
+ moveBtn.addEventListener('pointercancel', function (event) { finishLensDrag(event, true); });
+ moveBtn.addEventListener('lostpointercapture', function (event) { finishLensDrag(event, true); });
+ moveBtn.addEventListener('dblclick', function (event) {
+ event.preventDefault();
+ event.stopPropagation();
+ resetLensPlacement();
+ });
+ moveBtn.addEventListener('keydown', moveLensWithKeyboard);
+ clearBtn.addEventListener('click', function () { clear({ restoreFocus: true }); });
+ copyBtn.addEventListener('click', copyFocusLink);
upstreamBtn.addEventListener('click', function () { applyReachability('upstream'); });
downstreamBtn.addEventListener('click', function () { applyReachability('downstream'); });
relationsBtn.addEventListener('click', function () {
@@ -8937,15 +9054,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
relationsBtn.setAttribute('aria-label', viewerText(expanded
? 'viewer.passport.relations.show'
: 'viewer.passport.relations.hide'));
- requestLensPlacement();
+ placeRelationshipLens();
});
relationshipList.addEventListener('click', function (event) {
var button = event.target.closest('[data-relationship-target]');
if (!button) return;
var id = button.getAttribute('data-relationship-target');
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
set(id, { toggle: false });
if (Archify.view && typeof Archify.view.reveal === 'function') {
Archify.view.reveal([id], { includeNeighbors: true, reason: 'relationship' });
@@ -8994,7 +9108,20 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
event.preventDefault();
buttons[index].focus();
});
+ document.addEventListener('pointerdown', function () {
+ lensDragClickPointer = null;
+ }, true);
document.addEventListener('click', function (event) {
+ // Losing capture (for example when a resize hides the handle) can
+ // retarget this drag's final click to the page. It is not dismissal.
+ // A new pointerdown releases the guard; keyboard clicks remain live.
+ if (lensDragClickPointer != null && event.detail > 0 &&
+ (event.pointerId == null || event.pointerId === lensDragClickPointer)) {
+ lensDragClickPointer = null;
+ event.preventDefault();
+ event.stopPropagation();
+ return;
+ }
var target = event.target;
if (chip.hidden || !target || typeof target.closest !== 'function' || chip.contains(target)) return;
if (container.getAttribute('data-just-panned') === 'true') return;
@@ -9036,7 +9163,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
applyReachability(reach, { updateUrl: false, toggle: false, reveal: false });
}
}
- else if (!params.get('view')) clear({ updateUrl: false });
+ else clear({ updateUrl: false });
} catch (_) {}
}
@@ -9053,7 +9180,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reachabilitySnapshot: reachabilitySnapshot,
inspectRelationship: inspectRelationship,
inspectRelationshipById: inspectRelationshipById,
- reposition: requestLensPlacement,
+ reposition: placeRelationshipLens,
relationship: function () {
var record = pinnedRelationshipRecord();
return record ? { id: record.id || null, key: record.key, from: record.from, to: record.to, label: record.label } : null;
@@ -9071,6 +9198,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
})();
+
/* ============================================================
Intent Trace — temporary one-hop topology before durable focus.
Fine-pointer hover and keyboard focus share the same stable-ID preview;
@@ -9108,7 +9236,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.getAttribute('data-guide-open') === 'true' ||
container.classList.contains('is-panning') ||
svg.hasAttribute('data-lens-active') ||
- svg.hasAttribute('data-story-active') ||
svg.hasAttribute('data-relationship-preview-active') ||
!!(Archify.routeProbe && typeof Archify.routeProbe.active === 'function' && Archify.routeProbe.active()) ||
!!(Archify.focus && typeof Archify.focus.active === 'function' && Archify.focus.active());
@@ -9170,7 +9297,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
clear({ announce: false });
var nodeList = nodes();
var edgeList = edges();
- var byId = {};
+ var byId = Object.create(null);
nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
var selected = byId[id];
if (!selected) return false;
@@ -9179,7 +9306,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
overlay.setAttribute('class', 'intent-trace-overlay');
overlay.setAttribute('data-intent-trace-overlay', '');
overlay.setAttribute('aria-hidden', 'true');
- var related = {};
+ var related = Object.create(null);
var seen = {};
var counts = { out: 0, in: 0, loop: 0 };
related[id] = true;
@@ -9194,1836 +9321,107 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!seen[key]) {
seen[key] = true;
counts[direction] += 1;
- }
- related[from] = true;
- related[to] = true;
- edge.setAttribute('data-intent-trace-match', '');
- var wrapper = document.createElementNS(namespace, 'g');
- if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
- edgeShapes(edge).forEach(function (shape) {
- wrapper.appendChild(traceGeometry(shape, direction));
- });
- if (wrapper.childNodes.length) overlay.appendChild(wrapper);
- });
-
- nodeList.forEach(function (node) {
- var nodeId = node.getAttribute('data-node-id');
- if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
- if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
- });
- if (overlay.childNodes.length) {
- var firstEdge = edgeList[0];
- var firstNode = svg.querySelector('[data-node-id]');
- if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
- else if (firstNode) svg.insertBefore(overlay, firstNode);
- else svg.appendChild(overlay);
- }
- activeId = id;
- svg.setAttribute('data-intent-trace-active', id);
- if (options.announce === true) {
- var total = counts.out + counts.in + counts.loop;
- status.textContent = viewerText('viewer.intent.summary', {
- label: nodeLabel(selected, id),
- out: counts.out,
- in: counts.in,
- loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
- total: total
- });
- }
- return true;
- }
- function schedule(node) {
- if (enterTimer) window.clearTimeout(enterTimer);
- enterTimer = window.setTimeout(function () {
- enterTimer = null;
- if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
- }, reducedMotion() ? 0 : 90);
- }
- function sync() {
- var candidate = focusedNode || hoveredNode;
- if (!candidate) {
- clear();
- return;
- }
- show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
- }
-
- svg.addEventListener('pointerover', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || !finePointer() || event.pointerType === 'touch') return;
- if (event.relatedTarget && node.contains(event.relatedTarget)) return;
- hoveredNode = node;
- schedule(node);
- });
- svg.addEventListener('pointerout', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
- if (hoveredNode === node) hoveredNode = null;
- sync();
- });
- svg.addEventListener('focusin', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node) return;
- focusedNode = node;
- show(node.getAttribute('data-node-id'), { announce: true });
- });
- svg.addEventListener('focusout', function (event) {
- var node = event.target.closest('[data-node-id]');
- if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
- if (focusedNode === node) focusedNode = null;
- sync();
- });
- container.addEventListener('pointerdown', function (event) {
- if (!event.target.closest('[data-node-id]')) clear({ announce: false });
- });
- window.addEventListener('blur', function () { clear({ announce: false }); });
-
- return {
- show: show,
- clear: clear,
- active: function () { return activeId; }
- };
- })();
-
- Archify.guidedViews = (function () {
- var data = document.getElementById('archify-guided-views-data');
- var panel = document.getElementById('guided-views');
- var prev = document.getElementById('guided-view-prev');
- var next = document.getElementById('guided-view-next');
- var all = document.getElementById('guided-view-all');
- var play = document.getElementById('guided-view-play');
- var playIcon = document.getElementById('guided-view-play-icon');
- var playLabel = document.getElementById('guided-view-play-label');
- var beatLink = document.getElementById('guided-view-beat-link');
- var beatLinkLabel = document.getElementById('guided-view-beat-link-label');
- var progressBar = document.getElementById('guided-view-progress-bar');
- var count = document.getElementById('guided-view-count');
- var handoffReceipt = document.getElementById('guided-view-handoff');
- var label = document.getElementById('guided-view-label');
- var note = document.getElementById('guided-view-note');
- var trail = document.getElementById('guided-view-trail');
- var storyCaption = document.getElementById('guided-story-caption');
- var storyCaptionIndex = document.getElementById('guided-story-caption-index');
- var storyCaptionRoute = document.getElementById('guided-story-caption-route');
- var storyCaptionDetail = document.getElementById('guided-story-caption-detail');
- var storyCaptionNext = document.getElementById('guided-story-caption-next');
- var storyCaptionNextLabel = document.getElementById('guided-story-caption-next-label');
- var chapterIndex = document.getElementById('guided-view-index');
- var chapterList = document.getElementById('guided-view-chapters');
- var shareCue = document.getElementById('share-chapter-cue');
- var shareCueState = document.getElementById('share-chapter-state');
- var shareCueCount = document.getElementById('share-chapter-count');
- var shareCueLabel = document.getElementById('share-chapter-label');
- var shareCueNote = document.getElementById('share-chapter-note');
- var shareCueRoute = document.getElementById('share-chapter-route');
- var shareCueProgress = document.getElementById('share-chapter-progress-bar');
- var svg = document.querySelector('.diagram-container svg');
- var views = [];
- var activeIndex = -1;
- var playing = false;
- var storyBeatTimer = null;
- var storyBeatIndex = -1;
- var storyBeatStartedAt = 0;
- var storyBeatElapsedMs = 0;
- var storyBeatDwellMs = 0;
- var storyPlaybackGeneration = 0;
- var storyFollowGeneration = 0;
- var storyPlaybackScope = 'story';
- var storyPlaybackComplete = false;
- var beatLinkFeedbackTimer = null;
- var momentRestoreGeneration = 0;
- var storySteps = [];
- var storyPulseOwnerToken = 0;
- var storyPulseGeneration = 0;
- var autoplayPending = false;
- var VIEW_INTERVAL_MS = 3200;
- var STORY_FOLLOW_MIN_DWELL_MS = 1100;
- var STORY_FOLLOW_DURATION_MS = 320;
- var chapterButtons = [];
- var handoffGeneration = 0;
- var currentHandoff = null;
- var previewGeneration = 0;
- var pointerPreviewIntent = null;
- var focusPreviewIntent = null;
- var activePreviewIndex = -1;
- var previewOwnerToken = 0;
-
- try { views = JSON.parse(data.textContent || '[]'); } catch (_) { views = []; }
- if (!views.length) return { count: 0, active: function () { return null; } };
- var canonicalNodeIds = {};
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- canonicalNodeIds[node.getAttribute('data-node-id')] = true;
- });
- views.forEach(function (view) {
- var seen = {};
- view.focus = (view.focus || []).filter(function (id) {
- if (!canonicalNodeIds[id] || seen[id]) return false;
- seen[id] = true;
- return true;
- });
- });
- // Establish the compact cold state before exposing the panel so the
- // full Director cannot flash during first paint. Hash restoration runs
- // in the same task and replaces this state before paint when valid.
- panel.setAttribute('data-active-view', 'all');
- panel.hidden = false;
- panel.setAttribute('data-view-interval-ms', String(VIEW_INTERVAL_MS));
- panel.setAttribute('data-story-follow-min-dwell-ms', String(STORY_FOLLOW_MIN_DWELL_MS));
- buildChapterIndex();
-
- function reducedMotion() {
- return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
- }
-
- function findNode(id) {
- return Array.prototype.find.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- return node.getAttribute('data-node-id') === id;
- }) || null;
- }
-
- function chapterDelta(previous, destination) {
- var previousFocus = previous ? previous.focus : [];
- var destinationFocus = destination ? destination.focus : [];
- var previousIds = {};
- var destinationIds = {};
- previousFocus.forEach(function (id) { previousIds[id] = true; });
- destinationFocus.forEach(function (id) { destinationIds[id] = true; });
- return {
- stay: previousFocus.filter(function (id) { return destinationIds[id]; }),
- enter: destinationFocus.filter(function (id) { return !previousIds[id]; }),
- leave: previousFocus.filter(function (id) { return !destinationIds[id]; })
- };
- }
-
- function chapterAnchor(previous, destination, outgoingBeatIndex, delta) {
- if (!previous || !destination) return '';
- var stayIds = {};
- delta.stay.forEach(function (id) { stayIds[id] = true; });
- var activeBeat = outgoingBeatIndex >= 0 ? previous.focus[outgoingBeatIndex] : '';
- if (activeBeat && stayIds[activeBeat]) return activeBeat;
- for (var index = previous.focus.length - 1; index >= 0; index -= 1) {
- if (stayIds[previous.focus[index]]) return previous.focus[index];
- }
- return '';
- }
-
- function handoffMotionAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (document.documentElement.getAttribute('data-embed') === 'true') return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- return !(Archify.motionGovernor && Archify.motionGovernor.capable && Archify.motionGovernor.isPaused());
- }
-
- function classifyHandoff(delta, anchor) {
- var roles = {};
- delta.stay.forEach(function (id) { roles[id] = 'stay'; });
- delta.enter.forEach(function (id) { roles[id] = 'enter'; });
- delta.leave.forEach(function (id) { roles[id] = 'leave'; });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- var id = node.getAttribute('data-node-id');
- var role = roles[id] || '';
- if (role) node.setAttribute('data-chapter-role', role);
- else node.removeAttribute('data-chapter-role');
- });
- svg.setAttribute('data-chapter-handoff', anchor ? 'anchor' : 'no-anchor');
- if (anchor) svg.setAttribute('data-chapter-anchor', anchor);
- else svg.removeAttribute('data-chapter-anchor');
- }
-
- function drawHandoffAnchor(id) {
- var node = findNode(id);
- if (!node) return null;
- var box;
- try { box = node.getBBox(); } catch (_) { return null; }
- var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- var ring = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- overlay.setAttribute('class', 'chapter-handoff-overlay');
- overlay.setAttribute('data-chapter-handoff-overlay', '');
- overlay.setAttribute('aria-hidden', 'true');
- ring.setAttribute('class', 'chapter-handoff-anchor');
- ring.setAttribute('x', String(box.x - 8));
- ring.setAttribute('y', String(box.y - 8));
- ring.setAttribute('width', String(box.width + 16));
- ring.setAttribute('height', String(box.height + 16));
- ring.setAttribute('rx', '10');
- overlay.appendChild(ring);
- svg.appendChild(overlay);
- return overlay;
- }
-
- function clearHandoffPresentation() {
- svg.removeAttribute('data-chapter-handoff');
- svg.removeAttribute('data-chapter-anchor');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-handoff-overlay]'), function (overlay) { overlay.remove(); });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-role]'), function (node) { node.removeAttribute('data-chapter-role'); });
- if (handoffReceipt) {
- handoffReceipt.hidden = true;
- handoffReceipt.textContent = '';
- }
- }
-
- function completeHandoff(handoff, outcome) {
- if (!handoff || currentHandoff !== handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- currentHandoff = null;
- clearHandoffPresentation();
- if (handoff.ownerToken && Archify.motionGovernor) Archify.motionGovernor.release(handoff.ownerToken);
- handoff.resolve({ id: handoff.id, state: outcome || 'complete', anchor: handoff.anchor || null });
- syncStoryControlsDisabled();
- syncChapterPreview();
- return true;
- }
-
- function settleHandoff(reason) {
- var handoff = currentHandoff;
- if (!handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'settled', true);
- else if (Archify.view && Archify.view.reveal) Archify.view.reveal(handoff.focus, { instant: true, reason: reason || 'settled' });
- completeHandoff(handoff, reason || 'settled');
- return true;
- }
-
- function cancelHandoff(reason) {
- var handoff = currentHandoff;
- if (!handoff) return false;
- if (handoff.holdTimer) clearTimeout(handoff.holdTimer);
- handoff.holdTimer = null;
- if (handoff.camera && handoff.camera.cancel) handoff.camera.cancel(reason || 'manual', false);
- completeHandoff(handoff, reason || 'manual');
- return true;
- }
-
- function afterHandoff(callback) {
- if (!currentHandoff) { callback(); return; }
- currentHandoff.finished.then(callback);
- }
-
- function beginHandoff(previousIndex, nextIndex, previous, destination, outgoingBeatIndex, reason) {
- if (!Archify.view || !Archify.view.reveal) return null;
- if (!previous || previousIndex === nextIndex) {
- Archify.view.reveal(destination.focus, { reason: reason });
- return null;
- }
- var delta = chapterDelta(previous, destination);
- var anchor = chapterAnchor(previous, destination, outgoingBeatIndex, delta);
- if (!handoffMotionAllowed()) {
- Archify.view.reveal(destination.focus, { instant: true, reason: reason });
- return null;
- }
- var resolver;
- var handoff = {
- id: ++handoffGeneration,
- mode: anchor ? 'holding' : 'no-anchor',
- anchor: anchor,
- focus: destination.focus.slice(),
- holdTimer: null,
- camera: null,
- ownerToken: 0,
- finished: new Promise(function (resolve) { resolver = resolve; }),
- resolve: resolver
- };
- currentHandoff = handoff;
- classifyHandoff(delta, anchor);
- if (anchor) {
- drawHandoffAnchor(anchor);
- var node = findNode(anchor);
- var nodeLabel = node ? (node.getAttribute('data-node-label') || anchor) : anchor;
- handoffReceipt.textContent = viewerText('viewer.guided.handoff', {
- from: (previousIndex + 1 < 10 ? '0' : '') + (previousIndex + 1),
- to: (nextIndex + 1 < 10 ? '0' : '') + (nextIndex + 1),
- label: nodeLabel
- });
- handoffReceipt.hidden = false;
- }
- if (Archify.motionGovernor) {
- handoff.ownerToken = Archify.motionGovernor.claim('handoff', function () {
- if (currentHandoff === handoff) settleHandoff('preempted');
- });
- }
- var startCamera = function () {
- if (currentHandoff !== handoff) return;
- handoff.holdTimer = null;
- handoff.mode = 'settling';
- svg.setAttribute('data-chapter-handoff', anchor ? 'settling' : 'no-anchor');
- handoff.camera = Archify.view.reveal(destination.focus, { reason: reason, duration: 420 });
- if (handoff.camera && handoff.camera.finished) {
- handoff.camera.finished.then(function (outcome) {
- if (currentHandoff === handoff) completeHandoff(handoff, outcome && outcome.state || 'complete');
- });
- } else {
- completeHandoff(handoff, 'complete');
- }
- };
- if (anchor) handoff.holdTimer = setTimeout(startCamera, 110);
- else startCamera();
- return handoff;
- }
-
- function centerChapterButton(button) {
- if (!button || !chapterList) return false;
- var target = Math.max(0, button.offsetLeft - (chapterList.clientWidth - button.offsetWidth) / 2);
- if (typeof chapterList.scrollTo === 'function') chapterList.scrollTo({ left: target, behavior: 'auto' });
- else chapterList.scrollLeft = target;
- return true;
- }
-
- function focusChapterButton(index) {
- if (!chapterButtons.length) return false;
- index = Math.max(0, Math.min(chapterButtons.length - 1, index));
- chapterButtons.forEach(function (button, buttonIndex) {
- button.setAttribute('tabindex', buttonIndex === index ? '0' : '-1');
- });
- chapterButtons[index].focus();
- centerChapterButton(chapterButtons[index]);
- return true;
- }
-
- function buildChapterIndex() {
- chapterButtons = [];
- chapterList.textContent = '';
- views.forEach(function (view, index) {
- var item = document.createElement('li');
- var button = document.createElement('button');
- button.type = 'button';
- button.className = 'guided-view-chapter';
- button.setAttribute('data-guided-view-id', view.id);
- button.setAttribute('aria-pressed', 'false');
- button.setAttribute('tabindex', index === 0 ? '0' : '-1');
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.open', {
- index: index + 1,
- total: views.length,
- label: view.label,
- count: view.focus.length
- }));
- button.title = view.label + ' — ' + (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }));
- var position = document.createElement('span');
- position.className = 'guided-view-chapter-index';
- position.setAttribute('aria-hidden', 'true');
- position.textContent = (index + 1 < 10 ? '0' : '') + (index + 1);
- var title = document.createElement('span');
- title.className = 'guided-view-chapter-title';
- title.textContent = view.label;
- var stops = document.createElement('em');
- stops.className = 'guided-view-chapter-count';
- stops.textContent = viewerCount('viewer.guided.chapter.stop', view.focus.length);
- var delta = document.createElement('span');
- delta.className = 'guided-view-chapter-delta';
- delta.hidden = true;
- delta.setAttribute('aria-hidden', 'true');
- ['stay', 'enter', 'leave'].forEach(function (kind) {
- var value = document.createElement('span');
- value.setAttribute('data-delta-kind', kind);
- delta.appendChild(value);
- });
- button.appendChild(position);
- button.appendChild(title);
- button.appendChild(stops);
- button.appendChild(delta);
- item.appendChild(button);
- chapterList.appendChild(item);
- chapterButtons.push(button);
- });
- }
-
- function syncChapterIndex() {
- chapterButtons.forEach(function (button, index) {
- var current = index === activeIndex;
- var stops = button.querySelector('.guided-view-chapter-count');
- var deltaLabel = button.querySelector('.guided-view-chapter-delta');
- var position = activeIndex < 0 ? 'available' : (current ? 'current' : (index < activeIndex ? 'before' : 'after'));
- button.setAttribute('data-chapter-position', position);
- button.setAttribute('aria-pressed', current ? 'true' : 'false');
- button.setAttribute('tabindex', current || (activeIndex < 0 && index === 0) ? '0' : '-1');
- if (current) {
- stops.hidden = false;
- deltaLabel.hidden = true;
- button.removeAttribute('data-chapter-delta');
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.current', {
- index: index + 1,
- total: views.length,
- label: views[index].label,
- count: views[index].focus.length
- }));
- button.title = viewerText('viewer.guided.chapter.current.title', {
- label: views[index].label,
- count: views[index].focus.length
- });
- } else {
- var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- var compact = '=' + delta.stay.length + ' +' + delta.enter.length + ' \u2212' + delta.leave.length;
- var expanded = viewerText('viewer.guided.chapter.delta.expanded', {
- stay: delta.stay.length,
- enter: delta.enter.length,
- leave: delta.leave.length
- });
- stops.hidden = true;
- deltaLabel.hidden = false;
- deltaLabel.querySelector('[data-delta-kind="stay"]').textContent = '=' + delta.stay.length;
- deltaLabel.querySelector('[data-delta-kind="enter"]').textContent = '+' + delta.enter.length;
- deltaLabel.querySelector('[data-delta-kind="leave"]').textContent = '\u2212' + delta.leave.length;
- button.setAttribute('data-chapter-delta', compact);
- button.setAttribute('aria-label', viewerText('viewer.guided.chapter.delta.aria', {
- index: index + 1,
- total: views.length,
- label: views[index].label,
- delta: expanded
- }));
- button.title = viewerText('viewer.guided.chapter.delta.title', {
- label: views[index].label,
- delta: compact
- });
- }
- if (current) button.setAttribute('aria-current', 'step');
- else button.removeAttribute('aria-current');
- if (button.parentElement) button.parentElement.setAttribute('data-chapter-position', position);
- });
- if (activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);
- }
-
- function chapterPreviewBlocked() {
- if (document.hidden || playing || currentHandoff) return true;
- if (document.documentElement.getAttribute('data-embed') === 'true') return true;
- if (window.matchMedia && window.matchMedia('print').matches) return true;
- if (svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active')) return true;
- if (svg.hasAttribute('data-lens-active') || svg.hasAttribute('data-legend-preview-active')) return true;
- if (svg.hasAttribute('data-relationship-preview-active') || svg.hasAttribute('data-intent-trace-active')) return true;
- return activeIndex < 0 && svg.hasAttribute('data-focus-active');
- }
-
- function clearChapterPreviewPresentation() {
- svg.removeAttribute('data-chapter-preview');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-chapter-preview-role]'), function (node) {
- node.removeAttribute('data-chapter-preview-role');
- });
- chapterButtons.forEach(function (button) { button.removeAttribute('data-preview-active'); });
- activePreviewIndex = -1;
- if (previewOwnerToken && Archify.motionGovernor) {
- var token = previewOwnerToken;
- previewOwnerToken = 0;
- Archify.motionGovernor.release(token);
- }
- }
-
- function clearChapterPreview(options) {
- options = options || {};
- previewGeneration += 1;
- if (options.clearIntents !== false) {
- pointerPreviewIntent = null;
- focusPreviewIntent = null;
- }
- clearChapterPreviewPresentation();
- return true;
- }
-
- function winningChapterPreviewIntent() {
- return [pointerPreviewIntent, focusPreviewIntent].filter(function (intent) {
- return intent && intent.index >= 0 && intent.index < views.length && intent.index !== activeIndex;
- }).sort(function (left, right) { return right.generation - left.generation; })[0] || null;
- }
-
- function showChapterPreview(index) {
- if (index < 0 || index >= views.length || index === activeIndex || chapterPreviewBlocked()) {
- clearChapterPreviewPresentation();
- return false;
- }
- if (activePreviewIndex === index && svg.getAttribute('data-chapter-preview') === views[index].id) return true;
- clearChapterPreviewPresentation();
- var delta = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- var roles = {};
- delta.stay.forEach(function (id) { roles[id] = 'stay'; });
- delta.enter.forEach(function (id) { roles[id] = 'enter'; });
- delta.leave.forEach(function (id) { roles[id] = 'leave'; });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id]'), function (node) {
- var role = roles[node.getAttribute('data-node-id')];
- if (role) node.setAttribute('data-chapter-preview-role', role);
- });
- svg.setAttribute('data-chapter-preview', views[index].id);
- chapterButtons[index].setAttribute('data-preview-active', 'true');
- activePreviewIndex = index;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) {
- previewOwnerToken = Archify.motionGovernor.claim('chapter-preview', function () {
- previewOwnerToken = 0;
- clearChapterPreviewPresentation();
- });
- }
- return true;
- }
-
- function syncChapterPreview() {
- var intent = winningChapterPreviewIntent();
- if (!intent || chapterPreviewBlocked()) {
- clearChapterPreviewPresentation();
- return false;
- }
- return showChapterPreview(intent.index);
- }
-
- function setChapterPreviewIntent(source, index) {
- var intent = { index: index, generation: ++previewGeneration };
- if (source === 'pointer') pointerPreviewIntent = intent;
- else focusPreviewIntent = intent;
- if (playing) pausePlayback();
- return syncChapterPreview();
- }
-
- function clearChapterPreviewIntent(source, index) {
- var intent = source === 'pointer' ? pointerPreviewIntent : focusPreviewIntent;
- if (intent && (typeof index !== 'number' || intent.index === index)) {
- if (source === 'pointer') pointerPreviewIntent = null;
- else focusPreviewIntent = null;
- previewGeneration += 1;
- }
- return syncChapterPreview();
- }
-
- function hoverCapable() {
- return !!(window.matchMedia && window.matchMedia('(hover: hover)').matches);
- }
-
- function sharePlaybackRequested() {
- try { return new URLSearchParams(location.search).get('play') === '1'; }
- catch (_) { return false; }
- }
-
- autoplayPending = sharePlaybackRequested();
- if (autoplayPending) {
- document.documentElement.setAttribute('data-share-playback', 'true');
- setAutoplayState('pending');
- }
-
- function setAutoplayState(state) {
- if (state) panel.setAttribute('data-autoplay', state);
- else panel.removeAttribute('data-autoplay');
- renderShareCue();
- }
-
- function shareCueStatus(state) {
- return {
- pending: viewerText('viewer.guided.state.ready'),
- playing: viewerText('viewer.guided.state.playing'),
- complete: viewerText('viewer.guided.state.settled'),
- interrupted: viewerText('viewer.guided.state.paused'),
- pinned: viewerText('viewer.guided.state.pinned'),
- 'reduced-motion': viewerText('viewer.guided.state.still')
- }[state] || viewerText('viewer.guided.state.ready');
- }
-
- function shareCueBeatCopy(state, view, stops) {
- var total = stops.length;
- var activeStop = storyBeatIndex >= 0 ? stops[storyBeatIndex] : null;
- if ((state === 'playing' || state === 'interrupted') && activeStop) {
- return viewerText('viewer.guided.share.step', {
- index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),
- total: (total < 10 ? '0' : '') + total,
- label: activeStop.textContent
- });
- }
- if (state === 'pinned' && activeStop) {
- return storyBeatCopy(storySteps[storyBeatIndex], total);
- }
- if (state === 'reduced-motion' && activeStop && hashBeatMatchesCurrent()) {
- return viewerText('viewer.guided.share.staticMoment', {
- step: viewerText('viewer.guided.share.step', {
- index: (storyBeatIndex + 1 < 10 ? '0' : '') + (storyBeatIndex + 1),
- total: (total < 10 ? '0' : '') + total,
- label: activeStop.textContent
- })
- });
- }
- if (state === 'complete') return viewerText('viewer.guided.share.complete', {
- count: total,
- note: view.note || viewerText('viewer.guided.share.settled')
- });
- if (state === 'reduced-motion') return viewerText('viewer.guided.share.staticPath', { count: total });
- if (state === 'pending') return viewerText('viewer.guided.share.ready', { count: total });
- return view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length });
- }
-
- function renderShareCue() {
- if (!shareCue) return;
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var shareMode = document.documentElement.getAttribute('data-share-playback') === 'true';
- var embedMode = document.documentElement.getAttribute('data-embed') === 'true';
- var pinnedMode = !shareMode && embedMode && hashBeatMatchesCurrent();
- if (pinnedMode) document.documentElement.setAttribute('data-share-moment', 'true');
- else document.documentElement.removeAttribute('data-share-moment');
- shareCue.hidden = !(embedMode && view && (shareMode || pinnedMode));
- if (shareCue.hidden) return;
- var state = pinnedMode ? 'pinned' : (panel.getAttribute('data-autoplay') || 'pending');
- var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));
- var route = stops.map(function (stop, index) {
- if (index === 0) return stop.textContent;
- var kind = stop.getAttribute('data-story-link');
- var separator = kind === 'forward' ? '\u2192' : (kind === 'reverse' ? '\u2190' : (kind === 'multiple' ? '\u21c4' : '\u00b7'));
- return separator + ' ' + stop.textContent;
- }).join(' ');
- var beatCopy = shareCueBeatCopy(state, view, stops);
- shareCue.setAttribute('data-state', state);
- shareCue.setAttribute('aria-live', state === 'playing' ? 'off' : 'polite');
- shareCueState.textContent = shareCueStatus(state);
- shareCueCount.textContent = viewerText('viewer.guided.share.chapter', {
- index: (activeIndex + 1 < 10 ? '0' : '') + (activeIndex + 1),
- total: (views.length < 10 ? '0' : '') + views.length
- });
- shareCueLabel.textContent = view.label;
- shareCueNote.textContent = beatCopy;
- shareCueRoute.textContent = route;
- shareCue.setAttribute('aria-label', viewerText('viewer.guided.share.aria', {
- state: shareCueStatus(state),
- index: activeIndex + 1,
- total: views.length,
- label: view.label,
- beat: beatCopy,
- route: route
- }));
- }
-
- function setShareCueProgress(fraction) {
- if (!shareCueProgress) return;
- shareCueProgress.style.animation = 'none';
- shareCueProgress.style.setProperty('--guided-progress-start', String(Math.max(0, Math.min(1, fraction))));
- shareCueProgress.style.transform = 'scaleX(' + Math.max(0, Math.min(1, fraction)) + ')';
- }
-
- function startShareCueProgress(fraction, duration) {
- if (!shareCueProgress) return;
- setShareCueProgress(fraction || 0);
- void shareCueProgress.offsetWidth;
- shareCueProgress.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';
- }
-
- function storyNodeLabel(node, fallback) {
- if (!node) return fallback;
- return node.getAttribute('data-node-label') ||
- (node.getAttribute('aria-label') || fallback).replace(/^Focus\s+/, '');
- }
-
- function storyEdgeKey(edge) {
- return edge.getAttribute('data-edge-key') || (
- edge.getAttribute('data-edge-from') + '\u0000' +
- edge.getAttribute('data-edge-to') + '\u0000' +
- (edge.getAttribute('data-edge-label') || '')
- );
- }
-
- function uniqueStoryEdges(edgeList) {
- var positions = {};
- var unique = [];
- edgeList.forEach(function (edge) {
- var key = storyEdgeKey(edge);
- if (!Object.prototype.hasOwnProperty.call(positions, key)) {
- positions[key] = unique.length;
- unique.push(edge);
- return;
- }
- var index = positions[key];
- if (!storyGeometry(unique[index]).length && storyGeometry(edge).length) unique[index] = edge;
- });
- return unique;
- }
-
- function storyStep(view, index, edgeList, byId) {
- var id = view.focus[index];
- var node = byId[id];
- var previousId = index > 0 ? view.focus[index - 1] : '';
- var forward = [];
- var reverse = [];
- if (previousId) {
- edgeList.forEach(function (edge) {
- var from = edge.getAttribute('data-edge-from');
- var to = edge.getAttribute('data-edge-to');
- if (from === previousId && to === id) forward.push(edge);
- else if (from === id && to === previousId) reverse.push(edge);
- });
- }
- forward = uniqueStoryEdges(forward);
- reverse = uniqueStoryEdges(reverse);
- var edges = forward.concat(reverse).sort(function (left, right) {
- return edgeList.indexOf(left) - edgeList.indexOf(right);
- });
- var relation = index === 0 ? 'start' : (!edges.length ? 'group' : (
- edges.length === 1 && forward.length === 1 ? 'forward' :
- (edges.length === 1 && reverse.length === 1 ? 'reverse' : 'multiple')
- ));
- return {
- index: index,
- nodeId: id,
- nodeLabel: storyNodeLabel(byId[id], id),
- previousId: previousId,
- previousLabel: previousId ? storyNodeLabel(byId[previousId], previousId) : '',
- relation: relation,
- edges: edges,
- edgeKeys: edges.map(storyEdgeKey),
- edgeLabels: edges.map(function (edge) { return edge.getAttribute('data-edge-label') || ''; }).filter(function (value, edgeIndex, values) {
- return value && values.indexOf(value) === edgeIndex;
- }),
- responsibility: node ? (node.getAttribute('data-node-sublabel') || '') : '',
- context: node ? (node.getAttribute('data-node-context') || '') : ''
- };
- }
-
- function storyBeatCopy(step, total) {
- if (!step) return '';
- var position = (step.index + 1 < 10 ? '0' : '') + (step.index + 1);
- var countValue = (total < 10 ? '0' : '') + total;
- if (step.relation === 'start') return viewerText('viewer.guided.beat.start', { index: position, total: countValue, label: step.nodeLabel });
- if (step.relation === 'forward') return viewerText('viewer.guided.beat.forward', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });
- if (step.relation === 'reverse') return viewerText('viewer.guided.beat.reverse', { index: position, total: countValue, from: step.nodeLabel, to: step.previousLabel });
- if (step.relation === 'multiple') return viewerText('viewer.guided.beat.multiple', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel, count: step.edges.length });
- return viewerText('viewer.guided.beat.group', { index: position, total: countValue, from: step.previousLabel, to: step.nodeLabel });
- }
-
- function storyBeatAria(step, total) {
- var prefix = viewerText('viewer.guided.beat.aria.prefix', { index: step.index + 1, total: total, label: step.nodeLabel });
- if (step.relation === 'start') return prefix + viewerText('viewer.guided.beat.aria.start');
- if (step.relation === 'forward') return prefix + viewerText('viewer.guided.beat.aria.forward', { from: step.previousLabel });
- if (step.relation === 'reverse') return prefix + viewerText('viewer.guided.beat.aria.reverse', { from: step.previousLabel, to: step.nodeLabel });
- if (step.relation === 'multiple') return prefix + viewerText('viewer.guided.beat.aria.multiple', { from: step.previousLabel, count: step.edges.length });
- return prefix + viewerText('viewer.guided.beat.aria.group', { from: step.previousLabel });
- }
-
- function storyCaptionRouteCopy(step) {
- if (step.relation === 'start') return step.nodeLabel + ' · ' + viewerText('viewer.guided.caption.start');
- if (step.relation === 'reverse') return step.previousLabel + ' ← ' + step.nodeLabel;
- if (step.relation === 'multiple') return step.previousLabel + ' ⇄ ' + step.nodeLabel;
- if (step.relation === 'group') return step.previousLabel + ' · ' + step.nodeLabel;
- return step.previousLabel + ' → ' + step.nodeLabel;
- }
-
- function storyCaptionDetailCopy(step) {
- var facts = [];
- if (step.relation === 'group') facts.push(viewerText('viewer.guided.caption.grouped'));
- else if (step.edgeLabels.length) facts.push(step.edgeLabels.slice(0, 3).join(' + ') + (step.edgeLabels.length > 3 ? viewerText('viewer.guided.caption.more', { count: step.edgeLabels.length - 3 }) : ''));
- else if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.reverse'));
- else if (step.relation === 'multiple') facts.push(viewerText('viewer.guided.caption.relationships', { count: step.edges.length }));
- else if (step.relation !== 'start') facts.push(viewerText('viewer.guided.caption.relationship'));
- if (step.relation === 'reverse') facts.push(viewerText('viewer.guided.caption.direction', { from: step.nodeLabel, to: step.previousLabel }));
- if (step.responsibility) facts.push(step.responsibility);
- if (step.context) facts.push(step.context);
- if (!facts.length) facts.push(viewerText('viewer.guided.caption.starting'));
- return facts.join(' · ');
- }
-
- function renderStoryCaption(step, total, nextStep) {
- if (!storyCaption) return;
- if (!step) {
- storyCaption.hidden = true;
- storyCaption.removeAttribute('data-story-caption');
- storyCaptionNext.hidden = true;
- storyCaptionNextLabel.textContent = '';
- return;
- }
- storyCaption.hidden = false;
- storyCaption.setAttribute('data-story-caption', step.relation);
- storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');
- storyCaptionIndex.textContent = (step.index + 1 < 10 ? '0' : '') + (step.index + 1) + ' / ' + (total < 10 ? '0' : '') + total;
- storyCaptionRoute.textContent = storyCaptionRouteCopy(step);
- storyCaptionDetail.textContent = storyCaptionDetailCopy(step);
- storyCaptionNext.hidden = !nextStep;
- storyCaptionNextLabel.textContent = nextStep
- ? ((nextStep.index + 1 < 10 ? '0' : '') + (nextStep.index + 1) + ' · ' + nextStep.nodeLabel)
- : '';
- storyCaption.style.animation = 'none';
- void storyCaption.offsetWidth;
- storyCaption.style.removeProperty('animation');
- }
-
- function storyMomentLink() {
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- if (!view || !step) return '';
- var url = new URL(location.href);
- url.searchParams.delete('play');
- url.hash = 'view=' + encodeURIComponent(view.id) + '&beat=' + encodeURIComponent(step.nodeId);
- return url.href;
- }
-
- function fallbackCopyStoryMoment(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
- function resetBeatLinkFeedback() {
- if (beatLinkFeedbackTimer) clearTimeout(beatLinkFeedbackTimer);
- beatLinkFeedbackTimer = null;
- beatLink.removeAttribute('data-copy-state');
- beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');
- }
-
- function syncBeatLink() {
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- var available = !!(activeIndex >= 0 && step && !currentHandoff);
- beatLink.disabled = !available;
- if (!beatLink.hasAttribute('data-copy-state')) beatLinkLabel.textContent = viewerText('viewer.guided.copyMoment');
- var description = available
- ? viewerText('viewer.guided.beatLink', { index: step.index + 1, total: storySteps.length, label: step.nodeLabel })
- : viewerText('viewer.guided.selectBeatLink');
- beatLink.setAttribute('aria-label', description);
- beatLink.title = description;
- }
-
- function setBeatLinkFeedback(copied) {
- resetBeatLinkFeedback();
- beatLink.setAttribute('data-copy-state', copied ? 'copied' : 'failed');
- beatLinkLabel.textContent = viewerText(copied ? 'viewer.guided.copied' : 'viewer.guided.copyFailed');
- beatLink.setAttribute('aria-label', viewerText(copied ? 'viewer.guided.momentCopied' : 'viewer.guided.momentCopyFailed'));
- beatLinkFeedbackTimer = setTimeout(function () {
- resetBeatLinkFeedback();
- syncBeatLink();
- }, 1600);
- }
-
- function copyStoryMomentLink() {
- if (playing) pausePlayback();
- var value = storyMomentLink();
- if (!value) return Promise.resolve(false);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopyStoryMoment(value); })
- : Promise.resolve(fallbackCopyStoryMoment(value));
- return copy.then(function (copied) {
- setBeatLinkFeedback(copied);
- return copied;
- });
- }
-
- function hashBeatMatchesCurrent() {
- var view = activeIndex >= 0 ? views[activeIndex] : null;
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- if (!view || !step) return false;
- try {
- var params = new URLSearchParams(location.hash.replace(/^#/, ''));
- return params.get('view') === view.id && params.get('beat') === step.nodeId;
- } catch (_) { return false; }
- }
-
- function storyMotionAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (document.documentElement.getAttribute('data-motion') !== 'live') return false;
- if (document.documentElement.getAttribute('data-embed') === 'true' &&
- document.documentElement.getAttribute('data-share-playback') !== 'true') return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- return !(Archify.motionGovernor && Archify.motionGovernor.isPaused());
- }
-
- function storyAutomaticPlaybackAllowed() {
- if (document.hidden || reducedMotion()) return false;
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) return !Archify.motionGovernor.isPaused();
- return true;
- }
-
- function clearStoryPulse(options) {
- options = options || {};
- storyPulseGeneration += 1;
- Array.prototype.forEach.call(svg.querySelectorAll('.story-trail-flow[data-story-pulse]'), function (flow) {
- flow.removeAttribute('data-story-pulse');
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-carrier-overlay]'), function (overlay) {
- overlay.remove();
- });
- if (storyPulseOwnerToken && options.release !== false && Archify.motionGovernor) {
- var token = storyPulseOwnerToken;
- storyPulseOwnerToken = 0;
- Archify.motionGovernor.release(token);
- } else if (options.release === false) storyPulseOwnerToken = 0;
- }
-
- function pulseStoryStep(step) {
- clearStoryPulse();
- if (!step || (step.relation !== 'forward' && step.relation !== 'reverse') || step.edges.length !== 1 || !storyMotionAllowed()) return false;
- var flows = Array.prototype.slice.call(svg.querySelectorAll('.story-trail-flow[data-story-beat-step="' + step.index + '"]'));
- if (!flows.length) return false;
- var pulseGeneration = storyPulseGeneration;
- if (Archify.motionGovernor && Archify.motionGovernor.capable) {
- storyPulseOwnerToken = Archify.motionGovernor.claim('story', function () {
- clearStoryPulse({ release: false });
- });
- }
- flows.forEach(function (flow) { flow.setAttribute('data-story-pulse', 'true'); });
- if (Archify.flowTokens && typeof Archify.flowTokens.create === 'function') {
- var edge = step.edges[0];
- var shapes = storyGeometry(edge);
- var carrier = shapes.length ? Archify.flowTokens.create(edge, shapes[0], {
- className: 'story-flow-token',
- duration: '0.78s'
- }) : null;
- if (carrier) {
- var carrierOverlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- var carrierWrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- carrierOverlay.setAttribute('class', 'story-carrier-overlay');
- carrierOverlay.setAttribute('data-story-carrier-overlay', '');
- carrierOverlay.setAttribute('aria-hidden', 'true');
- if (edge.hasAttribute('transform')) carrierWrapper.setAttribute('transform', edge.getAttribute('transform'));
- carrier.setAttribute('data-story-carrier-token', '');
- carrier.setAttribute('data-story-beat-step', String(step.index));
- carrierWrapper.appendChild(carrier);
- carrierOverlay.appendChild(carrierWrapper);
- var firstNode = svg.querySelector('[data-node-id]');
- while (firstNode && firstNode.parentNode !== svg) firstNode = firstNode.parentNode;
- if (firstNode) svg.insertBefore(carrierOverlay, firstNode);
- else svg.appendChild(carrierOverlay);
- }
- }
- void flows[0].getBoundingClientRect();
- flows[0].addEventListener('animationend', function () {
- if (pulseGeneration === storyPulseGeneration) clearStoryPulse();
- }, { once: true });
- return true;
- }
-
- function stopStoryBeatTimer(options) {
- options = options || {};
- storyPlaybackGeneration += 1;
- if (storyBeatTimer && options.preserveElapsed === true && storyBeatStartedAt) {
- storyBeatElapsedMs = Math.min(storyBeatDwellMs, storyBeatElapsedMs + Math.max(0, Date.now() - storyBeatStartedAt));
- }
- if (storyBeatTimer) clearTimeout(storyBeatTimer);
- storyBeatTimer = null;
- storyBeatStartedAt = 0;
- }
-
- function centerStoryStop(stop) {
- if (!stop || !trail) return false;
- var bounds = stop.getBoundingClientRect();
- var viewportLeft = trail.getBoundingClientRect().left + trail.clientLeft;
- var target = Math.max(0, trail.scrollLeft + bounds.left - viewportLeft - (trail.clientWidth - bounds.width) / 2);
- trail.scrollLeft = target;
- return true;
- }
-
- function storyBeatDwell(total) {
- return Math.max(STORY_FOLLOW_MIN_DWELL_MS, VIEW_INTERVAL_MS / Math.max(1, total));
- }
-
- function clearStoryFollow() {
- storyFollowGeneration += 1;
- svg.removeAttribute('data-story-follow');
- panel.removeAttribute('data-story-follow');
- panel.removeAttribute('data-story-follow-node');
- }
-
- function storyFrameIds(step) {
- if (!step) return [];
- var ids = [];
- if (step.index > 0 && storySteps[step.index - 1]) ids.push(storySteps[step.index - 1].nodeId);
- ids.push(step.nodeId);
- if (step.index + 1 < storySteps.length) ids.push(storySteps[step.index + 1].nodeId);
- return ids;
- }
-
- function followStoryStep(step, options) {
- options = options || {};
- if (!step || document.hidden) return false;
- if (!Archify.view || typeof Archify.view.reveal !== 'function') {
- var deferredIndex = step.index;
- var deferredGeneration = ++storyFollowGeneration;
- requestAnimationFrame(function () {
- if (deferredGeneration !== storyFollowGeneration || storyBeatIndex !== deferredIndex) return;
- if (Archify.view && typeof Archify.view.reveal === 'function') followStoryStep(step, options);
- });
- return true;
- }
- if (window.matchMedia && window.matchMedia('print').matches) return false;
- var embed = document.documentElement.getAttribute('data-embed') === 'true';
- var explicitEmbedPlayback = document.documentElement.getAttribute('data-share-playback') === 'true';
- if (embed && !explicitEmbedPlayback && options.linked !== true) return false;
- var ids = storyFrameIds(step);
- var generation = ++storyFollowGeneration;
- svg.setAttribute('data-story-follow', step.nodeId);
- panel.setAttribute('data-story-follow', 'moving');
- panel.setAttribute('data-story-follow-node', step.nodeId);
- var receipt = Archify.view.reveal(ids, {
- reason: options.manual === true ? 'story-beat' : 'story-follow',
- padding: 64,
- maxScale: 1.65,
- duration: STORY_FOLLOW_DURATION_MS,
- instant: options.instant === true || reducedMotion() || document.documentElement.getAttribute('data-motion') !== 'live'
- });
- if (receipt && receipt.finished && typeof receipt.finished.then === 'function') {
- receipt.finished.then(function (result) {
- if (generation !== storyFollowGeneration || storyBeatIndex !== step.index) return;
- svg.removeAttribute('data-story-follow');
- panel.setAttribute('data-story-follow', result && result.state === 'complete' ? 'settled' : 'interrupted');
- });
- } else if (generation === storyFollowGeneration) {
- panel.setAttribute('data-story-follow', 'settled');
- }
- return receipt;
- }
-
- function setStoryBeat(index, options) {
- options = options || {};
- var stops = Array.prototype.slice.call(trail.querySelectorAll('[data-story-node]'));
- if (!stops.length) return false;
- resetBeatLinkFeedback();
- storyBeatIndex = Math.max(0, Math.min(stops.length - 1, index));
- var nextStep = storyBeatIndex + 1 < storySteps.length ? storySteps[storyBeatIndex + 1] : null;
- svg.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);
- panel.setAttribute('data-story-beat', (storyBeatIndex + 1) + '/' + stops.length);
- if (nextStep) {
- svg.setAttribute('data-story-next', nextStep.nodeId);
- panel.setAttribute('data-story-next', nextStep.nodeId);
- } else {
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-next');
- }
- function storyBeatState(step) {
- if (step < storyBeatIndex) return 'past';
- if (step === storyBeatIndex) return 'active';
- if (step === storyBeatIndex + 1) return 'next';
- return 'pending';
- }
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step]'), function (node) {
- var step = Number(node.getAttribute('data-story-step'));
- node.setAttribute('data-story-beat-state', storyBeatState(step));
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-step]'), function (edge) {
- var step = Number(edge.getAttribute('data-story-beat-step'));
- edge.setAttribute('data-story-beat-state', storyBeatState(step));
- });
- stops.forEach(function (stop, step) {
- stop.setAttribute('data-story-beat-state', storyBeatState(step));
- if (step === storyBeatIndex) stop.setAttribute('aria-current', 'step');
- else stop.removeAttribute('aria-current');
- });
- note.setAttribute('aria-live', 'off');
- note.textContent = storyBeatCopy(storySteps[storyBeatIndex], stops.length);
- renderStoryCaption(storySteps[storyBeatIndex], stops.length, nextStep);
- if (options.center === true) centerStoryStop(stops[storyBeatIndex]);
- if (options.pulse === true) pulseStoryStep(storySteps[storyBeatIndex]);
- else clearStoryPulse();
- if (options.follow === true) followStoryStep(storySteps[storyBeatIndex], {
- manual: options.manual === true,
- linked: options.linked === true,
- instant: options.followInstant === true
- });
- renderShareCue();
- syncBeatLink();
- return true;
- }
-
- function settleStoryBeats() {
- stopStoryBeatTimer();
- clearStoryPulse();
- clearStoryFollow();
- resetBeatLinkFeedback();
- storyBeatIndex = -1;
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = 0;
- svg.removeAttribute('data-story-beat');
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-beat');
- panel.removeAttribute('data-story-next');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-beat-state]'), function (el) {
- el.removeAttribute('data-story-beat-state');
- });
- Array.prototype.forEach.call(trail.querySelectorAll('[data-story-beat-state]'), function (stop) {
- stop.removeAttribute('data-story-beat-state');
- stop.removeAttribute('aria-current');
- });
- note.setAttribute('aria-live', 'polite');
- if (activeIndex >= 0) note.textContent = views[activeIndex].note || viewerText('viewer.guided.chapter.selectedNodes', { count: views[activeIndex].focus.length });
- renderStoryCaption(null, 0);
- renderShareCue();
- syncBeatLink();
- }
-
- function clearStoryTrail() {
- stopStoryBeatTimer();
- clearStoryPulse();
- clearStoryFollow();
- resetBeatLinkFeedback();
- storyBeatIndex = -1;
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = 0;
- storySteps = [];
- svg.removeAttribute('data-story-active');
- svg.removeAttribute('data-story-playing');
- svg.removeAttribute('data-story-beat');
- svg.removeAttribute('data-story-next');
- panel.removeAttribute('data-story-beat');
- panel.removeAttribute('data-story-next');
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-overlay]'), function (overlay) {
- overlay.remove();
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-story-step], [data-story-beat-state]'), function (node) {
- node.removeAttribute('data-story-step');
- node.removeAttribute('data-story-beat-state');
- node.style.removeProperty('--story-step');
- });
- Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-story-beat-step]'), function (edge) {
- edge.removeAttribute('data-story-beat-step');
- edge.removeAttribute('data-story-beat-state');
- });
- trail.textContent = '';
- trail.hidden = true;
- trail.removeAttribute('aria-label');
- renderStoryCaption(null, 0);
- syncBeatLink();
- }
-
- function storyGeometry(edge) {
- if (/^(path|line|polyline)$/i.test(edge.tagName)) return [edge];
- return Array.prototype.slice.call(edge.querySelectorAll('path, line, polyline'));
- }
-
- function renderStoryTrail(view) {
- if (Archify.semanticLens && typeof Archify.semanticLens.clearPreview === 'function') Archify.semanticLens.clearPreview();
- clearStoryTrail();
- if (!view) return;
-
- var nodeList = Array.prototype.slice.call(svg.querySelectorAll('[data-node-id]'));
- var edgeList = Array.prototype.slice.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'));
- var byId = {};
- nodeList.forEach(function (node) { byId[node.getAttribute('data-node-id')] = node; });
- storySteps = view.focus.map(function (_, index) { return storyStep(view, index, edgeList, byId); });
- var labels = [];
- storySteps.forEach(function (step, index) {
- var id = step.nodeId;
- var node = byId[id];
- if (!node) return;
- node.setAttribute('data-story-step', String(index));
- node.style.setProperty('--story-step', String(index));
- var nodeLabel = step.nodeLabel;
- labels.push(nodeLabel);
- var stop = document.createElement('button');
- stop.type = 'button';
- stop.className = 'guided-view-stop';
- stop.setAttribute('data-story-node', id);
- stop.setAttribute('data-story-index', String(index));
- stop.setAttribute('data-story-relation', step.relation);
- stop.setAttribute('data-story-number', (index + 1 < 10 ? '0' : '') + (index + 1));
- if (index > 0) stop.setAttribute('data-story-link', step.relation);
- stop.style.setProperty('--story-step', String(index));
- stop.setAttribute('aria-label', storyBeatAria(step, storySteps.length));
- stop.title = storyBeatCopy(step, storySteps.length);
- stop.textContent = nodeLabel;
- trail.appendChild(stop);
- });
- trail.hidden = labels.length === 0;
- trail.setAttribute('aria-label', viewerText('viewer.guided.storyTrail', { label: view.label, count: labels.length }));
- trail.scrollLeft = 0;
- svg.setAttribute('data-story-active', view.id);
-
- var overlay = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- overlay.setAttribute('class', 'story-trail-overlay');
- overlay.setAttribute('data-story-overlay', '');
- overlay.setAttribute('aria-hidden', 'true');
- var copied = 0;
- storySteps.forEach(function (step) {
- step.edges.forEach(function (edge) {
- var edgeBeat = step.index;
- edge.setAttribute('data-story-beat-step', String(edgeBeat));
- var wrapper = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
- storyGeometry(edge).forEach(function (shape) {
- var clone = shape.cloneNode(false);
- clone.removeAttribute('id');
- clone.removeAttribute('marker-start');
- clone.removeAttribute('marker-mid');
- clone.removeAttribute('marker-end');
- clone.removeAttribute('aria-label');
- clone.removeAttribute('role');
- clone.removeAttribute('data-animate');
- clone.removeAttribute('data-edge-from');
- clone.removeAttribute('data-edge-to');
- clone.removeAttribute('data-edge-key');
- clone.removeAttribute('data-edge-id');
- clone.removeAttribute('data-edge-label');
- clone.setAttribute('class', 'story-trail-flow');
- clone.setAttribute('data-story-beat-step', String(edgeBeat));
- clone.style.setProperty('--story-step', String(edgeBeat));
- wrapper.appendChild(clone);
- copied += 1;
- });
- if (wrapper.childNodes.length) overlay.appendChild(wrapper);
+ }
+ related[from] = true;
+ related[to] = true;
+ edge.setAttribute('data-intent-trace-match', '');
+ var wrapper = document.createElementNS(namespace, 'g');
+ if (edge.hasAttribute('transform')) wrapper.setAttribute('transform', edge.getAttribute('transform'));
+ edgeShapes(edge).forEach(function (shape) {
+ wrapper.appendChild(traceGeometry(shape, direction));
});
+ if (wrapper.childNodes.length) overlay.appendChild(wrapper);
+ });
+
+ nodeList.forEach(function (node) {
+ var nodeId = node.getAttribute('data-node-id');
+ if (related[nodeId]) node.setAttribute('data-intent-trace-match', '');
+ if (nodeId === id) node.setAttribute('data-intent-trace-selected', '');
});
- if (copied) {
+ if (overlay.childNodes.length) {
var firstEdge = edgeList[0];
+ var firstNode = svg.querySelector('[data-node-id]');
if (firstEdge && firstEdge.parentNode) firstEdge.parentNode.insertBefore(overlay, firstEdge);
- else svg.insertBefore(overlay, svg.firstChild);
- }
- }
-
- function syncStoryPlayback() {
- var shouldPlay = playing && activeIndex >= 0;
- if (shouldPlay && svg.getAttribute('data-story-playing') !== 'true') svg.setAttribute('data-story-playing', 'true');
- else if (!shouldPlay && svg.hasAttribute('data-story-playing')) svg.removeAttribute('data-story-playing');
- }
-
- function resetProgress(fraction) {
- fraction = Math.max(0, Math.min(1, Number(fraction) || 0));
- progressBar.style.animation = 'none';
- progressBar.style.setProperty('--guided-progress-start', String(fraction));
- progressBar.style.transform = 'scaleX(' + fraction + ')';
- }
-
- function startProgress(fraction, duration) {
- resetProgress(fraction);
- void progressBar.offsetWidth;
- progressBar.style.animation = 'archify-guided-progress ' + Math.max(1, duration || VIEW_INTERVAL_MS) + 'ms linear forwards';
- }
-
- function currentStoryProgress() {
- var total = storySteps.length;
- if (!total || storyBeatIndex < 0) return 0;
- var elapsed = storyBeatElapsedMs;
- if (playing && storyBeatTimer && storyBeatStartedAt) elapsed += Math.max(0, Date.now() - storyBeatStartedAt);
- var dwell = storyBeatDwellMs || storyBeatDwell(total);
- return Math.max(0, Math.min(1, (storyBeatIndex + Math.min(1, elapsed / dwell)) / total));
- }
-
- function renderPlayback() {
- var automaticPlaybackAllowed = storyAutomaticPlaybackAllowed();
- panel.setAttribute('data-playing', playing ? 'true' : 'false');
- syncStoryPlayback();
- play.disabled = !playing && !automaticPlaybackAllowed;
- play.setAttribute('aria-pressed', playing ? 'true' : 'false');
- play.setAttribute('aria-label', viewerText(playing
- ? 'viewer.guided.pause'
- : !automaticPlaybackAllowed
- ? 'viewer.guided.motionUnavailable'
- : storyPlaybackComplete
- ? 'viewer.guided.replay'
- : 'viewer.guided.play'));
- play.title = viewerText(playing
- ? 'viewer.guided.pause.title'
- : !automaticPlaybackAllowed
- ? 'viewer.guided.enableMotion'
- : storyPlaybackComplete
- ? 'viewer.guided.replay.title'
- : 'viewer.guided.play.title');
- playIcon.textContent = playing ? '\u2016' : '\u25b6';
- playLabel.textContent = viewerText(playing
- ? 'viewer.guided.pauseStory'
- : storyPlaybackComplete
- ? 'viewer.guided.replayStory'
- : 'viewer.guided.playStory');
- if (storyCaption && !storyCaption.hidden) storyCaption.setAttribute('aria-live', playing ? 'off' : 'polite');
- }
-
- function render() {
- var view = views[activeIndex];
- count.textContent = activeIndex < 0 ? '0 / ' + views.length : (activeIndex + 1) + ' / ' + views.length;
- label.textContent = view ? view.label : viewerText('viewer.guided.explore');
- note.setAttribute('aria-live', storyBeatIndex >= 0 ? 'off' : 'polite');
- note.textContent = storyBeatIndex >= 0
- ? storyBeatCopy(storySteps[storyBeatIndex], storySteps.length)
- : (view
- ? (view.note || viewerText('viewer.guided.chapter.selectedNodes', { count: view.focus.length }))
- : viewerText('viewer.guided.intro'));
- prev.disabled = activeIndex < 0;
- next.disabled = activeIndex >= views.length - 1;
- all.disabled = activeIndex < 0;
- panel.setAttribute('data-active-view', view ? view.id : 'all');
- syncChapterIndex();
- renderShareCue();
- renderPlayback();
- syncBeatLink();
- }
-
- function pausePlayback(options) {
- options = options || {};
- var progress = options.complete === true ? 1 : currentStoryProgress();
- if (panel.getAttribute('data-autoplay') === 'playing') {
- setShareCueProgress(progress);
- setAutoplayState(options.complete === true ? 'complete' : 'interrupted');
- }
- stopStoryBeatTimer({ preserveElapsed: options.complete !== true });
- clearStoryPulse();
- clearStoryFollow();
- playing = false;
- storyPlaybackComplete = options.complete === true;
- resetProgress(progress);
- renderPlayback();
- renderShareCue();
- }
-
- function finishStoryChapter() {
- if (!playing) return false;
- if (storyPlaybackScope === 'chapter') {
- pausePlayback({ complete: true });
- return true;
+ else if (firstNode) svg.insertBefore(overlay, firstNode);
+ else svg.appendChild(overlay);
}
- if (activeIndex < views.length - 1) {
- var destinationIndex = activeIndex + 1;
- activate(destinationIndex, { playback: true });
- afterHandoff(function () {
- if (!playing || activeIndex !== destinationIndex) return;
- storyBeatElapsedMs = 0;
- setStoryBeat(0, { pulse: true, follow: true });
- scheduleStoryPlayback();
+ activeId = id;
+ svg.setAttribute('data-intent-trace-active', id);
+ if (options.announce === true) {
+ var total = counts.out + counts.in + counts.loop;
+ status.textContent = viewerText('viewer.intent.summary', {
+ label: nodeLabel(selected, id),
+ out: counts.out,
+ in: counts.in,
+ loops: counts.loop ? viewerText('viewer.intent.loops', { count: counts.loop }) : '',
+ total: total
});
- return true;
- }
- pausePlayback({ complete: true });
- return true;
- }
-
- function scheduleStoryPlayback() {
- var total = storySteps.length;
- if (!playing || !total || reducedMotion()) {
- if (playing) pausePlayback();
- return false;
- }
- storyBeatDwellMs = storyBeatDwell(total);
- if (storyBeatIndex < 0) {
- storyBeatElapsedMs = 0;
- setStoryBeat(0, { pulse: true, follow: true });
- }
- storyBeatElapsedMs = Math.max(0, Math.min(storyBeatDwellMs, storyBeatElapsedMs));
- var remainingDwell = Math.max(1, storyBeatDwellMs - storyBeatElapsedMs);
- var progress = (storyBeatIndex + storyBeatElapsedMs / storyBeatDwellMs) / total;
- var remainingChapter = remainingDwell + Math.max(0, total - storyBeatIndex - 1) * storyBeatDwellMs;
- startProgress(progress, remainingChapter);
- if (panel.getAttribute('data-autoplay') === 'playing') startShareCueProgress(progress, remainingChapter);
- var generation = ++storyPlaybackGeneration;
- storyBeatStartedAt = Date.now();
- storyBeatTimer = setTimeout(function () {
- if (!playing || generation !== storyPlaybackGeneration) return;
- storyBeatTimer = null;
- storyBeatStartedAt = 0;
- storyBeatElapsedMs = 0;
- if (storyBeatIndex < total - 1) {
- setStoryBeat(storyBeatIndex + 1, { pulse: true, follow: true });
- scheduleStoryPlayback();
- } else finishStoryChapter();
- }, remainingDwell);
- return true;
- }
-
- function startPlayback() {
- if (!storyAutomaticPlaybackAllowed()) {
- renderPlayback();
- return false;
- }
- autoplayPending = false;
- setAutoplayState(null);
- setShareCueProgress(0);
- document.documentElement.removeAttribute('data-share-playback');
- storyPlaybackScope = 'story';
- if (storyPlaybackComplete) showAll({ updateUrl: false });
- storyPlaybackComplete = false;
- if (activeIndex < 0) activate(0, { playback: true });
- playing = true;
- renderPlayback();
- afterHandoff(function () {
- if (!playing) return;
- if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);
- scheduleStoryPlayback();
- });
- return true;
- }
-
- function startCurrentViewPlayback() {
- if (document.hidden) return false;
- autoplayPending = false;
- document.documentElement.setAttribute('data-share-playback', 'true');
- storyPlaybackScope = 'chapter';
- storyPlaybackComplete = false;
- if (activeIndex < 0) activate(0, { playback: true, updateUrl: false });
- if (!storyAutomaticPlaybackAllowed()) {
- var preserveMoment = hashBeatMatchesCurrent();
- setShareCueProgress(preserveMoment && storySteps.length ? (storyBeatIndex + 1) / storySteps.length : 1);
- setAutoplayState('reduced-motion');
- playing = false;
- if (preserveMoment) {
- clearStoryPulse();
- renderShareCue();
- } else settleStoryBeats();
- renderPlayback();
- return false;
}
- playing = true;
- setAutoplayState('playing');
- renderPlayback();
- afterHandoff(function () {
- if (!playing) return;
- if (storyBeatIndex >= 0) followStoryStep(storySteps[storyBeatIndex]);
- scheduleStoryPlayback();
- });
- return true;
- }
-
- function maybeStartSharePlayback() {
- if (!autoplayPending || document.hidden) return false;
- return startCurrentViewPlayback();
- }
-
- function togglePlayback() {
- return playing ? (pausePlayback(), false) : startPlayback();
- }
-
- function syncStoryControlsDisabled() {
- Array.prototype.forEach.call(trail.querySelectorAll('[data-story-node]'), function (stop) {
- stop.disabled = !!currentHandoff;
- });
- syncBeatLink();
- }
-
- function selectStoryBeat(index) {
- if (currentHandoff || activeIndex < 0 || index < 0 || index >= storySteps.length) return false;
- momentRestoreGeneration += 1;
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else {
- stopStoryBeatTimer();
- clearStoryPulse();
- }
- storyPlaybackComplete = false;
- storyPlaybackScope = 'story';
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = storyBeatDwell(storySteps.length);
- var view = views[activeIndex];
- Archify.focus.setMany(view.focus, {
- toggle: false,
- updateUrl: false,
- mode: 'selection',
- label: view.label,
- hideChip: true
- });
- setStoryBeat(index, { manual: true, center: true, pulse: true, follow: true });
- resetProgress(index / storySteps.length);
- renderPlayback();
- return true;
- }
-
- function selectStoryBeatById(id, options) {
- options = options || {};
- var index = storySteps.findIndex(function (step) { return step.nodeId === id; });
- if (index < 0) return false;
- if (playing) pausePlayback();
- else {
- stopStoryBeatTimer();
- clearStoryPulse();
- }
- storyPlaybackComplete = false;
- storyPlaybackScope = 'story';
- storyBeatElapsedMs = 0;
- storyBeatDwellMs = storyBeatDwell(storySteps.length);
- setStoryBeat(index, {
- manual: false,
- center: true,
- pulse: false,
- follow: options.follow === true,
- linked: options.linked === true,
- followInstant: options.followInstant === true
- });
- resetProgress(index / storySteps.length);
- renderPlayback();
return true;
}
-
- function updateUrl(view) {
- try {
- history.replaceState(null, '', location.pathname + location.search + (view ? '#view=' + encodeURIComponent(view.id) : ''));
- } catch (_) {}
+ function schedule(node) {
+ if (enterTimer) window.clearTimeout(enterTimer);
+ enterTimer = window.setTimeout(function () {
+ enterTimer = null;
+ if (hoveredNode === node) show(node.getAttribute('data-node-id'), { announce: false });
+ }, reducedMotion() ? 0 : 90);
}
-
- function showAll(options) {
- options = options || {};
- if (options.restore !== true) momentRestoreGeneration += 1;
- clearChapterPreview({ clearIntents: true });
- if (playing && options.playback !== true) pausePlayback();
- if (options.playback !== true) storyPlaybackComplete = false;
- cancelHandoff('overview');
- activeIndex = -1;
- renderStoryTrail(null);
- if (options.clearFocus !== false) Archify.focus.clear({ updateUrl: false });
- if (options.resetView !== false && Archify.view && typeof Archify.view.reset === 'function') {
- Archify.view.reset({ automatic: true });
+ function sync() {
+ var candidate = focusedNode || hoveredNode;
+ if (!candidate) {
+ clear();
+ return;
}
- render();
- if (options.updateUrl !== false) updateUrl(null);
- }
-
- function activate(index, options) {
- options = options || {};
- if (options.restore !== true) momentRestoreGeneration += 1;
- if (playing && options.playback !== true) pausePlayback();
- if (options.playback !== true) storyPlaybackComplete = false;
- if (index < 0) { showAll(options); return true; }
- if (index >= views.length) return false;
- clearChapterPreview({ clearIntents: true });
- var previousIndex = activeIndex;
- var previous = previousIndex >= 0 ? views[previousIndex] : null;
- var outgoingBeatIndex = storyBeatIndex;
- cancelHandoff('replaced');
- activeIndex = index;
- var view = views[index];
- Archify.focus.setMany(view.focus, {
- toggle: false,
- updateUrl: false,
- mode: 'selection',
- label: view.label,
- hideChip: true
- });
- renderStoryTrail(view);
- beginHandoff(previousIndex, index, previous, view, outgoingBeatIndex, options.playback === true ? 'playback' : 'guided');
- syncStoryControlsDisabled();
- render();
- if (options.updateUrl !== false) updateUrl(view);
- return true;
- }
-
- function activateById(id, options) {
- var index = views.findIndex(function (view) { return view.id === id; });
- return index >= 0 && activate(index, options);
+ show(candidate.getAttribute('data-node-id'), { announce: candidate === focusedNode });
}
- prev.addEventListener('click', function () { activate(activeIndex - 1); });
- next.addEventListener('click', function () { activate(activeIndex + 1); });
- all.addEventListener('click', function () { showAll(); });
- play.addEventListener('click', togglePlayback);
- beatLink.addEventListener('click', copyStoryMomentLink);
- trail.addEventListener('focusin', function (event) {
- if (!event.target.closest('[data-story-node]')) return;
- if (playing) pausePlayback();
- });
- trail.addEventListener('click', function (event) {
- var stop = event.target.closest('[data-story-node]');
- if (!stop || stop.disabled) return;
- selectStoryBeat(Number(stop.getAttribute('data-story-index')));
- });
- trail.addEventListener('keydown', function (event) {
- if (event.key !== 'Enter' && event.key !== ' ') return;
- var stop = event.target.closest('[data-story-node]');
- if (!stop || stop.disabled) return;
- event.preventDefault();
- selectStoryBeat(Number(stop.getAttribute('data-story-index')));
- });
- chapterList.addEventListener('click', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button) return;
- activateById(button.getAttribute('data-guided-view-id'));
- });
- chapterList.addEventListener('pointerover', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || !hoverCapable() || event.pointerType === 'touch') return;
- if (event.relatedTarget && button.contains(event.relatedTarget)) return;
- setChapterPreviewIntent('pointer', chapterButtons.indexOf(button));
- });
- chapterList.addEventListener('pointerout', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
- clearChapterPreviewIntent('pointer', chapterButtons.indexOf(button));
- });
- chapterIndex.addEventListener('focusin', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button) return;
- setChapterPreviewIntent('focus', chapterButtons.indexOf(button));
+ svg.addEventListener('pointerover', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || !finePointer() || event.pointerType === 'touch') return;
+ if (event.relatedTarget && node.contains(event.relatedTarget)) return;
+ hoveredNode = node;
+ schedule(node);
});
- chapterIndex.addEventListener('focusout', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- if (!button || (event.relatedTarget && button.contains(event.relatedTarget))) return;
- clearChapterPreviewIntent('focus', chapterButtons.indexOf(button));
+ svg.addEventListener('pointerout', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
+ if (hoveredNode === node) hoveredNode = null;
+ sync();
});
- chapterList.addEventListener('keydown', function (event) {
- var button = event.target.closest('[data-guided-view-id]');
- var index = chapterButtons.indexOf(button);
- if (index < 0) return;
- var target = null;
- if (event.key === 'ArrowRight') target = Math.min(chapterButtons.length - 1, index + 1);
- else if (event.key === 'ArrowLeft') target = Math.max(0, index - 1);
- else if (event.key === 'Home') target = 0;
- else if (event.key === 'End') target = chapterButtons.length - 1;
- if (target === null) return;
- event.preventDefault();
- focusChapterButton(target);
+ svg.addEventListener('focusin', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node) return;
+ focusedNode = node;
+ show(node.getAttribute('data-node-id'), { announce: true });
});
-
- // A direct node exploration supersedes the curated view. Capture phase
- // releases the view before the focus explorer writes its own deep link.
- function releaseForNode(event) {
- if (activeIndex >= 0 && event.target.closest('[data-node-id]')) {
- pausePlayback();
- showAll({ clearFocus: false, updateUrl: false });
- }
- }
- svg.addEventListener('click', releaseForNode, true);
- svg.addEventListener('keydown', function (event) {
- if (event.key === 'Enter' || event.key === ' ') releaseForNode(event);
- }, true);
-
- document.addEventListener('keydown', function (event) {
- if (event.metaKey || event.ctrlKey || event.altKey) return;
- if (document.documentElement.getAttribute('data-guide-open') === 'true') return;
- var target = event.target;
- if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) return;
- if (event.key === ']') {
- event.preventDefault();
- if (activeIndex < views.length - 1) activate(activeIndex + 1);
- } else if (event.key === '[') {
- event.preventDefault();
- if (activeIndex >= 0) activate(activeIndex - 1);
- } else if (event.key.toLowerCase() === 'p') {
- event.preventDefault();
- togglePlayback();
- } else if (event.key === 'Escape' && activePreviewIndex >= 0) {
- event.preventDefault();
- event.stopImmediatePropagation();
- clearChapterPreview({ clearIntents: true });
- } else if (event.key === 'Escape' && activeIndex >= 0) {
- event.preventDefault();
- showAll();
- }
- }, true);
-
- function syncViewFromHash() {
- try {
- var params = new URLSearchParams(location.hash.replace(/^#/, ''));
- var initial = params.get('view');
- var requestedBeat = params.get('beat');
- var restoreGeneration = ++momentRestoreGeneration;
- if (initial) {
- var activated = activateById(initial, { updateUrl: false, restore: true });
- if (!activated) {
- showAll({ updateUrl: false, restore: true });
- return;
- }
- if (requestedBeat) afterHandoff(function () {
- if (restoreGeneration !== momentRestoreGeneration) return;
- var latest = new URLSearchParams(location.hash.replace(/^#/, ''));
- if (latest.get('view') !== initial || latest.get('beat') !== requestedBeat) return;
- if (activeIndex < 0 || views[activeIndex].id !== initial) return;
- selectStoryBeatById(requestedBeat, { linked: true, follow: true, followInstant: true });
- });
- } else if (params.get('focus') || params.get('relation')) {
- activeIndex = -1;
- render();
- } else {
- showAll({ updateUrl: false, restore: true });
- }
- } catch (_) { showAll({ updateUrl: false, restore: true }); }
- }
-
- window.addEventListener('hashchange', syncViewFromHash);
- document.addEventListener('visibilitychange', function () {
- if (document.hidden) {
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('hidden');
- }
- else if (!document.hidden) maybeStartSharePlayback();
+ svg.addEventListener('focusout', function (event) {
+ var node = event.target.closest('[data-node-id]');
+ if (!node || (event.relatedTarget && node.contains(event.relatedTarget))) return;
+ if (focusedNode === node) focusedNode = null;
+ sync();
});
- if (window.matchMedia) {
- var guidedMotionQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
- var onGuidedMotionChange = function () {
- if (guidedMotionQuery.matches) {
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('reduced-motion');
- }
- };
- if (typeof guidedMotionQuery.addEventListener === 'function') guidedMotionQuery.addEventListener('change', onGuidedMotionChange);
- else if (typeof guidedMotionQuery.addListener === 'function') guidedMotionQuery.addListener(onGuidedMotionChange);
- }
- if (document.documentElement.getAttribute('data-embed') !== 'true' && typeof MutationObserver !== 'undefined' && typeof Node !== 'undefined' && svg instanceof Node && document.documentElement instanceof Node) {
- var chapterPreviewOwnerObserver = new MutationObserver(syncChapterPreview);
- chapterPreviewOwnerObserver.observe(svg, {
- attributes: true,
- attributeFilter: [
- 'data-route-picking', 'data-route-active', 'data-lens-active',
- 'data-legend-preview-active', 'data-relationship-preview-active',
- 'data-intent-trace-active', 'data-focus-active'
- ]
- });
- var storyMotionObserver = new MutationObserver(function () {
- if (document.documentElement.getAttribute('data-motion') !== 'live') clearStoryPulse();
- renderPlayback();
- });
- storyMotionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-motion'] });
- }
- if (typeof ResizeObserver === 'function') {
- var chapterViewportWidth = chapterList.clientWidth;
- var trailViewportWidth = trail.clientWidth;
- var storyScrollObserver = new ResizeObserver(function () {
- var chapterWidth = chapterList.clientWidth;
- var trailWidth = trail.clientWidth;
- if (chapterWidth !== chapterViewportWidth && activeIndex >= 0) centerChapterButton(chapterButtons[activeIndex]);
- if (trailWidth !== trailViewportWidth && storyBeatIndex >= 0) {
- centerStoryStop(trail.querySelectorAll('[data-story-node]')[storyBeatIndex]);
- }
- chapterViewportWidth = chapterWidth;
- trailViewportWidth = trailWidth;
- });
- storyScrollObserver.observe(chapterList);
- storyScrollObserver.observe(trail);
- }
- window.addEventListener('beforeprint', function () {
- clearChapterPreview({ clearIntents: true });
- if (playing) pausePlayback();
- else clearStoryPulse();
- settleHandoff('print');
+ container.addEventListener('pointerdown', function (event) {
+ if (!event.target.closest('[data-node-id]')) clear({ announce: false });
});
- syncViewFromHash();
- if (autoplayPending) {
- requestAnimationFrame(function () {
- requestAnimationFrame(maybeStartSharePlayback);
- });
- }
+ window.addEventListener('blur', function () { clear({ announce: false }); });
return {
- count: views.length,
- activate: activateById,
- showAll: showAll,
- play: startPlayback,
- playCurrent: startCurrentViewPlayback,
- pause: pausePlayback,
- beatLink: storyMomentLink,
- copyBeatLink: copyStoryMomentLink,
- cancelHandoff: cancelHandoff,
- settleHandoff: settleHandoff,
- clearPreview: function () { return clearChapterPreview({ clearIntents: true }); },
- isPlaying: function () { return playing; },
- handoff: function () {
- return currentHandoff ? { id: currentHandoff.id, mode: currentHandoff.mode, anchor: currentHandoff.anchor || null } : null;
- },
- active: function () { return activeIndex < 0 ? null : views[activeIndex].id; },
- preview: function () { return activePreviewIndex < 0 ? null : views[activePreviewIndex].id; },
- delta: function (id) {
- var index = views.findIndex(function (view) { return view.id === id; });
- if (index < 0) return null;
- var value = chapterDelta(activeIndex >= 0 ? views[activeIndex] : null, views[index]);
- return { stay: value.stay.slice(), enter: value.enter.slice(), leave: value.leave.slice() };
- },
- beat: function () {
- var step = storyBeatIndex >= 0 ? storySteps[storyBeatIndex] : null;
- return step ? {
- index: step.index,
- position: step.index + 1,
- total: storySteps.length,
- nodeId: step.nodeId,
- relation: step.relation,
- edgeKeys: step.edgeKeys.slice()
- } : null;
- },
- focus: function () { return activeIndex < 0 ? [] : views[activeIndex].focus.slice(); }
+ show: show,
+ clear: clear,
+ active: function () { return activeId; }
};
})();
/* ============================================================
Adaptive Reader Shell — one diagram across laptop and monitor.
The canonical SVG and viewBox never change. On ordinary desktop pages,
- wide diagrams receive only enough outer width to use the available
+ wide diagrams and measured intrinsic tall workflows receive enough outer width to use the available
height without pushing summary cards below the viewport. Mobile,
- embed, presentation, print, and non-wide diagrams retain their own
+ embed, presentation, print, and unmarked non-wide diagrams retain their own
established layout contracts.
============================================================ */
+ // Fixed script-private participants; the CLI sees only the joint wait below.
+ const archifyLayoutOwners = { reader: null, viewerChrome: null };
Archify.waitForStableLayout = function (options) {
options = options || {};
var maximumFrames = Math.max(1, Number(options.maximumFrames) || 240);
@@ -11071,18 +9469,54 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var diagram = document.querySelector('.diagram-container');
var svg = diagram && diagram.querySelector(':scope > svg');
var header = shell && shell.querySelector('.header');
- var guided = shell && shell.querySelector('.guided-views');
var cards = shell && shell.querySelector('.cards');
var viewBox = svg && svg.viewBox && svg.viewBox.baseVal;
var ratio = viewBox && viewBox.height > 0 ? viewBox.width / viewBox.height : 0;
+ var measuredHeightFit = svg && svg.getAttribute('data-reader-fit') === 'intrinsic-height';
var frame = 0;
var settleFrame = 0;
var lastWidth = 0;
+ // Widest reader the overflow settle has accepted for this viewport (0 =
+ // uncapped). Card copy rewraps as the reader narrows, so recomputing
+ // from fixed heights alone would widen again and oscillate; only a
+ // resize lifts the cap.
+ var settledCap = 0;
var WIDE_RATIO = 1.55;
var MIN_DESKTOP_WIDTH = 1024;
var MIN_READER_WIDTH = 960;
var MAX_READER_WIDTH = 1920;
+ var MIN_PROJECTED_NODE_TEXT_PX = 6;
+ var declaredMinimumText = svg ? parseFloat(svg.getAttribute('data-reader-min-text') || '') : null;
+ var requestedMinimumText = Number.isFinite(declaredMinimumText)
+ ? Math.max(MIN_PROJECTED_NODE_TEXT_PX, declaredMinimumText)
+ : MIN_PROJECTED_NODE_TEXT_PX;
+ var declaredPrimaryText = svg ? parseFloat(svg.getAttribute('data-reader-primary-text') || '') : null;
var SAFE_BOTTOM_GAP = 12;
+ // Wide viewports move summary cards beside the diagram, so the height
+ // budget belongs to the diagram and spare width holds the notes.
+ var RAIL_MIN_VIEWPORT = 1280;
+ var RAIL_WIDTH = 288;
+ var RAIL_GAP = 20;
+ // A default rail must leave primary node labels comfortably readable;
+ // otherwise it starts collapsed and the reader can still open it.
+ var RAIL_COMFORT_PRIMARY_PX = 12;
+ var railPanel = shell && shell.querySelector('.reader-rail');
+ var railReveal = document.getElementById('rail-reveal');
+ var railCollapse = document.getElementById('rail-collapse');
+ var railPlacement = document.getElementById('rail-placement');
+ var RAIL_COLLAPSED_KEY = 'archify-rail-collapsed';
+ var RAIL_PLACEMENT_KEY = 'archify-rail-placement';
+ // Memory is the page's source of truth; storage only carries the choice
+ // to later artifacts, so a blocked or full localStorage cannot freeze it.
+ var preferences = Object.create(null);
+ function readPreference(key) {
+ if (key in preferences) return preferences[key];
+ try { return localStorage.getItem(key); } catch (_) { return null; }
+ }
+ function writePreference(key, value) {
+ preferences[key] = value;
+ try { localStorage.setItem(key, value); } catch (_) {}
+ }
if (diagram && ratio >= WIDE_RATIO) {
diagram.setAttribute('data-wide-diagram', 'true');
@@ -11101,9 +9535,48 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var style = window.getComputedStyle(element);
return element.getBoundingClientRect().height + number(style.marginTop) + number(style.marginBottom);
}
+ function minimumReadableScale() {
+ var sourceMinimum = null;
+ var selectors = [
+ 'text[data-node-label], text[data-boundary-label], text[data-detail="context"]'
+ ];
+ if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
+ selectors.push('g[data-detail="context"][data-edge-from][data-edge-to] > text');
+ }
+ Array.from(svg.querySelectorAll(selectors.join(', '))).forEach(function (text) {
+ if (text.getAttribute('data-detail') === 'context' && !text.closest('[data-node-id]')) return;
+ var sourceFontPx = parseFloat(text.getAttribute('font-size') || '');
+ if (Number.isFinite(sourceFontPx)) {
+ sourceMinimum = sourceMinimum == null ? sourceFontPx : Math.min(sourceMinimum, sourceFontPx);
+ }
+ });
+ return sourceMinimum != null
+ ? Math.min(1, requestedMinimumText / sourceMinimum)
+ : 1;
+ }
+ var sourcePrimary = null;
+ if (svg) Array.from(svg.querySelectorAll('text[data-node-label]')).forEach(function (text) {
+ var size = parseFloat(text.getAttribute('font-size') || '');
+ if (Number.isFinite(size) && size > 0) sourcePrimary = sourcePrimary == null ? size : Math.max(sourcePrimary, size);
+ });
+ // SVG width at which the largest node label renders at targetPx. Every
+ // renderer writes label font sizes, so the rail comfort check works for
+ // all diagram types; only the renderer-declared floor needs metadata.
+ function labelWidth(targetPx) {
+ return sourcePrimary == null || !viewBox ? 0 : viewBox.width * targetPx / sourcePrimary;
+ }
+ function primaryReadingWidth() {
+ if (!measuredHeightFit || !Number.isFinite(declaredPrimaryText) || declaredPrimaryText <= 0) return 0;
+ // Primary labels should remain comfortable to read when cards or
+ // auxiliary rows make a one-screen fit too small. Ordinary page
+ // scroll preserves that reading size; viewport width still caps it.
+ // A long title may already use a smaller fitted font. Preserve that
+ // hierarchy rather than enlarging every other node to compensate.
+ return labelWidth(declaredPrimaryText);
+ }
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && (ratio >= WIDE_RATIO || measuredHeightFit) &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11114,7 +9587,52 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
html.style.removeProperty('--archify-reader-width');
html.removeAttribute('data-reader-layout');
html.removeAttribute('data-reader-overflow');
+ setRail(false);
lastWidth = 0;
+ settledCap = 0;
+ }
+ // Rail modes: "true" docks beside the diagram, "collapsed" leaves only the
+ // reveal control, "overlay" opens a drawer when docking would break the
+ // readable floor, and "bottom" stacks notes and index below the diagram.
+ function setRail(mode) {
+ if (mode) {
+ html.setAttribute('data-reader-rail', mode);
+ html.style.setProperty('--archify-rail-width', RAIL_WIDTH + 'px');
+ html.style.setProperty('--archify-rail-gap', RAIL_GAP + 'px');
+ } else {
+ html.removeAttribute('data-reader-rail');
+ html.style.removeProperty('--archify-rail-width');
+ html.style.removeProperty('--archify-rail-gap');
+ }
+ if (railReveal) railReveal.hidden = mode !== 'collapsed';
+ if (railCollapse) {
+ railCollapse.hidden = mode !== 'true' && mode !== 'overlay';
+ railCollapse.setAttribute('aria-expanded', String(mode === 'true' || mode === 'overlay'));
+ }
+ if (railPlacement) {
+ railPlacement.hidden = !mode || mode === 'collapsed' || (mode === 'bottom' && window.innerWidth < RAIL_MIN_VIEWPORT);
+ railPlacement.setAttribute('data-placement', mode === 'bottom' ? 'bottom' : 'right');
+ railPlacement.setAttribute('aria-label', viewerText(mode === 'bottom' ? 'viewer.rail.right' : 'viewer.rail.bottom'));
+ railPlacement.title = railPlacement.getAttribute('aria-label');
+ }
+ }
+ var outline = document.getElementById('node-outline');
+ function hasCards() {
+ return Boolean((cards && cards.children.length && !cards.hidden) || (outline && !outline.hidden));
+ }
+ // Bottom notes and index are reading material below the fold: the first
+ // screen belongs to the interactive diagram and its controls.
+ function belowFold() {
+ return html.getAttribute('data-reader-rail') === 'bottom' ? outerHeight(railPanel) : 0;
+ }
+ // A docked rail may run past a short diagram down to the viewport floor,
+ // so the index uses that space instead of scrolling inside the diagram's
+ // height; it never pushes the page into overflow.
+ function fitDockedRail() {
+ if (html.getAttribute('data-reader-rail') !== 'true' || !railPanel) return;
+ var top = railPanel.getBoundingClientRect().top + window.scrollY;
+ var floor = window.innerHeight - number(window.getComputedStyle(body).paddingBottom) - top;
+ html.style.setProperty('--archify-rail-max', Math.max(diagram.getBoundingClientRect().height, floor) + 'px');
}
function chromeMetrics() {
var bodyStyle = window.getComputedStyle(body);
@@ -11128,8 +9646,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
number(diagramStyle.borderTopWidth) + number(diagramStyle.borderBottomWidth)
};
}
- function applyWidth(width) {
- var rounded = Math.round(width);
+ function applyWidth(width, minWidth) {
+ var rounded = Math.max(Math.ceil(minWidth || 0), Math.round(width));
if (Math.abs(rounded - lastWidth) < 1) return false;
lastWidth = rounded;
html.style.setProperty('--archify-reader-width', rounded + 'px');
@@ -11141,12 +9659,14 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
settleFrame = requestAnimationFrame(function () {
settleFrame = 0;
if (!eligible() || !lastWidth) return;
+ fitDockedRail();
var overflow = Math.max(
document.documentElement.scrollHeight,
document.body.scrollHeight
- ) - window.innerHeight;
- if (overflow > 1 && lastWidth > minWidth) {
- applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4));
+ ) - window.innerHeight - belowFold();
+ if (overflow > 1 && lastWidth > Math.ceil(minWidth)) {
+ applyWidth(Math.max(minWidth, lastWidth - overflow * ratio - 4), minWidth);
+ settledCap = lastWidth;
html.setAttribute('data-reader-overflow', 'reduced');
} else if (overflow > 1) {
html.setAttribute('data-reader-overflow', 'authored');
@@ -11163,18 +9683,58 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var readableWidth = viewBox && viewBox.width > 0
+ ? viewBox.width * minimumReadableScale() + chrome.diagramX
+ : MIN_READER_WIDTH;
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
+ var readableMinimumWidth = measuredHeightFit && ratio < WIDE_RATIO
+ ? readableWidth
+ : measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)
+ ? Math.max(MIN_READER_WIDTH, readableWidth)
+ : MIN_READER_WIDTH;
+ var minWidth;
+ if (measuredHeightFit && ratio < WIDE_RATIO) {
+ minWidth = Math.min(readableMinimumWidth, viewportCap);
+ } else if (measuredHeightFit && ratio >= WIDE_RATIO && Number.isFinite(declaredMinimumText)) {
+ minWidth = Math.min(readableMinimumWidth, maxWidth);
+ } else {
+ minWidth = Math.min(readableMinimumWidth, viewportCap);
+ }
+ var primaryWidth = primaryReadingWidth();
+ var railExtra = RAIL_WIDTH + RAIL_GAP;
+ var mode = null;
+ // Notes default below the diagram; the right rail is the reader's
+ // opt-in and needs a wide viewport.
+ if (hasCards() && (readPreference(RAIL_PLACEMENT_KEY) !== 'right' || window.innerWidth < RAIL_MIN_VIEWPORT)) {
+ mode = 'bottom';
+ } else if (hasCards()) {
+ var fitsReadable = readableMinimumWidth + railExtra <= maxWidth;
+ var comfortWidth = labelWidth(RAIL_COMFORT_PRIMARY_PX);
+ var comfortable = fitsReadable && (!comfortWidth || comfortWidth + chrome.diagramX + railExtra <= maxWidth);
+ var collapsedPreference = readPreference(RAIL_COLLAPSED_KEY);
+ if (collapsedPreference === '1' || (collapsedPreference !== '0' && !comfortable)) mode = 'collapsed';
+ else mode = fitsReadable ? 'true' : 'overlay';
+ }
+ // With notes below the fold, the diagram may trade the renderer's
+ // comfortable primary size down to the rail's 12px floor so it and its
+ // controls fit the first screen; taller graphs still scroll.
+ if (mode === 'bottom' && primaryWidth > 0) primaryWidth = labelWidth(Math.min(RAIL_COMFORT_PRIMARY_PX, declaredPrimaryText));
+ if (primaryWidth > 0) minWidth = Math.max(minWidth, Math.min(maxWidth, primaryWidth + chrome.diagramX));
+ var docked = mode === 'true';
+ setRail(mode);
+ chrome = chromeMetrics();
+ if (docked) minWidth = Math.min(maxWidth, minWidth + railExtra);
+ var stackedBelow = mode === 'bottom' ? 0 : docked ? 0 : outerHeight(cards);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
- outerHeight(header) + outerHeight(guided) + outerHeight(cards);
+ outerHeight(header) + stackedBelow;
var availableSvgHeight = Math.max(1, window.innerHeight - fixedHeight);
- var desiredWidth = availableSvgHeight * ratio + chrome.diagramX;
- var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth));
- applyWidth(width);
+ var desiredWidth = availableSvgHeight * ratio + chrome.diagramX + (docked ? railExtra : 0);
+ var width = Math.max(minWidth, Math.min(maxWidth, desiredWidth, settledCap || desiredWidth));
+ applyWidth(width, minWidth);
settleOverflow(minWidth);
return {
ratio: ratio,
- width: Math.round(width),
+ width: lastWidth,
availableSvgHeight: Math.round(availableSvgHeight),
fixedHeight: Math.round(fixedHeight)
};
@@ -11200,28 +9760,58 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
Math.round(diagramRect.height * 100) / 100
].join('|');
}
+ function layoutPending() { return Boolean(frame || settleFrame); }
function whenStable() {
return Archify.waitForStableLayout({
schedule: schedule,
- pending: function () { return Boolean(frame || settleFrame); },
+ pending: layoutPending,
snapshot: stableSnapshot,
timeoutMessage: 'Adaptive reader layout did not reach stable dimensions.'
});
}
+ archifyLayoutOwners.reader = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
- window.addEventListener('resize', schedule, { passive: true });
+ window.addEventListener('resize', function () {
+ settledCap = 0;
+ schedule();
+ }, { passive: true });
window.addEventListener('load', schedule, { once: true });
if (document.fonts && document.fonts.ready) document.fonts.ready.then(schedule).catch(function () {});
if (typeof ResizeObserver === 'function') {
var resizeObserver = new ResizeObserver(schedule);
- [header, guided, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
+ [header, cards].forEach(function (element) { if (element) resizeObserver.observe(element); });
}
if (typeof MutationObserver === 'function') {
var contentObserver = new MutationObserver(schedule);
- if (guided) contentObserver.observe(guided, { attributes: true, childList: true, subtree: true });
if (cards) contentObserver.observe(cards, { attributes: true, childList: true, subtree: true });
contentObserver.observe(html, { attributes: true, attributeFilter: ['data-embed', 'data-present'] });
}
+ // Reader choices persist across artifacts; a resize-style remeasure
+ // applies them without reloading.
+ function chooseRail(key, value) {
+ writePreference(key, value);
+ settledCap = 0;
+ schedule();
+ }
+ function collapseRail() {
+ chooseRail(RAIL_COLLAPSED_KEY, '1');
+ if (railReveal) requestAnimationFrame(function () { try { railReveal.focus({ preventScroll: true }); } catch (_) {} });
+ }
+ if (railReveal) railReveal.addEventListener('click', function () { chooseRail(RAIL_COLLAPSED_KEY, '0'); });
+ if (railCollapse) railCollapse.addEventListener('click', collapseRail);
+ if (railPlacement) railPlacement.addEventListener('click', function () {
+ var toBottom = html.getAttribute('data-reader-rail') !== 'bottom';
+ if (!toBottom) writePreference(RAIL_COLLAPSED_KEY, '0');
+ chooseRail(RAIL_PLACEMENT_KEY, toBottom ? 'bottom' : 'right');
+ });
+ document.addEventListener('keydown', function (event) {
+ if (event.key === 'Escape' && html.getAttribute('data-reader-rail') === 'overlay') collapseRail();
+ });
+ document.addEventListener('pointerdown', function (event) {
+ if (html.getAttribute('data-reader-rail') !== 'overlay' || !railPanel) return;
+ if (!railPanel.contains(event.target) && !(railReveal && railReveal.contains(event.target))) chooseRail(RAIL_COLLAPSED_KEY, '1');
+ });
+ if (typeof ResizeObserver === 'function' && railPanel) new ResizeObserver(schedule).observe(railPanel);
schedule();
return {
@@ -11376,8 +9966,36 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
return lastReceipt;
}
+ /* When the stage runs below the viewport, the dock lifts to the viewport
+ floor so its controls stay reachable while reading. Stage-rail
+ decisions and receipts use its resting position, so the lift never
+ feeds back into layout. */
+ var lift = 0;
+ var liftFrame = 0;
+ function restingNavRect() {
+ var rect = nav.getBoundingClientRect();
+ if (!lift) return rect;
+ return { x: rect.x, y: rect.y + lift, left: rect.left, right: rect.right, top: rect.top + lift, bottom: rect.bottom + lift, width: rect.width, height: rect.height };
+ }
+ function updateLift() {
+ liftFrame = 0;
+ var next = 0;
+ if (eligible()) {
+ var rest = restingNavRect();
+ var box = container.getBoundingClientRect();
+ next = Math.round(Math.max(0, Math.min(rest.bottom - (window.innerHeight - 16), rest.top - box.top - 16)));
+ }
+ if (next === lift) return;
+ lift = next;
+ if (lift) container.style.setProperty('--archify-dock-lift', lift + 'px');
+ else container.style.removeProperty('--archify-dock-lift');
+ }
+ function scheduleLift() {
+ if (!liftFrame) liftFrame = requestAnimationFrame(updateLift);
+ }
function measure() {
frame = 0;
+ scheduleLift();
if (probingBaseline) return null;
if (!eligible()) return clear({ preserveBaseline: !cameraAtBaseline() });
@@ -11391,7 +10009,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (reserve === 0 && restorableReserve > 0) {
if (writeReserve(restorableReserve)) return null;
}
- var cameraNavRect = nav.getBoundingClientRect();
+ var cameraNavRect = restingNavRect();
var cameraLegendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var cameraStageRect = protectedStageRect();
var cameraIntersectionArea = usable(cameraLegendRect) && intersectionArea(cameraNavRect, cameraStageRect) > 0
@@ -11411,7 +10029,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return lastReceipt;
}
- var navRect = nav.getBoundingClientRect();
+ var navRect = restingNavRect();
var legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
var stageRect = protectedStageRect();
if (!usable(navRect) || !usable(stageRect)) return clear();
@@ -11433,7 +10051,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (writeReserve(reserve + remaining)) return null;
}
- navRect = nav.getBoundingClientRect();
+ navRect = restingNavRect();
legendRect = visible(legend) ? legend.getBoundingClientRect() : null;
stageRect = protectedStageRect();
stageGap = navRect.top - stageRect.bottom;
@@ -11488,7 +10106,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function stableSnapshot() {
var containerRect = container ? container.getBoundingClientRect() : { width: 0, height: 0 };
- var navRect = nav ? nav.getBoundingClientRect() : { top: 0, left: 0 };
+ var navRect = nav ? restingNavRect() : { top: 0, left: 0 };
var legendRect = legend ? legend.getBoundingClientRect() : { top: 0, left: 0 };
return [
reserve,
@@ -11502,16 +10120,19 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
lastReceipt ? lastReceipt.stageGap : ''
].join('|');
}
+ function layoutPending() { return Boolean(frame || settleFrame || probingBaseline); }
function whenStable() {
return Archify.waitForStableLayout({
schedule: schedule,
- pending: function () { return Boolean(frame || settleFrame || probingBaseline); },
+ pending: layoutPending,
snapshot: stableSnapshot,
timeoutMessage: 'Viewer chrome layout did not reach stable dimensions.'
});
}
+ archifyLayoutOwners.viewerChrome = { schedule: schedule, pending: layoutPending, snapshot: stableSnapshot };
window.addEventListener('resize', reprobe, { passive: true });
+ window.addEventListener('scroll', scheduleLift, { passive: true });
window.addEventListener('load', schedule, { once: true });
window.addEventListener('beforeprint', schedule);
window.addEventListener('afterprint', reprobe);
@@ -11522,7 +10143,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
if (typeof MutationObserver === 'function') {
var contentObserver = new MutationObserver(function (records) {
- var viewerModeChanged = records.some(function (record) { return record.target === html; });
+ // A theme switch changes paint, not the stage geometry. Reprobing
+ // drops the bottom rail for several frames and makes the diagram jump.
+ var viewerModeChanged = records.some(function (record) {
+ return record.target === html && record.attributeName !== 'data-theme';
+ });
if (viewerModeChanged) reprobe();
else schedule();
});
@@ -11540,11 +10165,55 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
reprobe: reprobe,
whenStable: whenStable,
stageRect: protectedStageRect,
+ dockRect: function () { return nav ? restingNavRect() : null; },
active: function () { return reserve > 0; },
receipt: function () { return lastReceipt || measure(); }
};
})();
+ Archify.layoutStability = {
+ whenStable: function () {
+ var reader = archifyLayoutOwners.reader;
+ var chrome = archifyLayoutOwners.viewerChrome;
+ if (!reader || !chrome) {
+ return Promise.reject(new Error('Joint layout owners are unavailable.'));
+ }
+ var observedFontsReady = document.fonts && document.fonts.ready;
+ var fontCyclePending = false;
+ var fontGeneration = 0;
+ function scheduleOwners() { reader.schedule(); chrome.schedule(); }
+ function fontsPending() {
+ var fonts = document.fonts;
+ var ready = fonts && fonts.ready;
+ if (ready && (ready !== observedFontsReady || (fonts.status === 'loading' && !fontCyclePending))) {
+ observedFontsReady = ready;
+ fontCyclePending = true;
+ var generation = ++fontGeneration;
+ ready.catch(function () {}).then(function () {
+ if (generation !== fontGeneration) return;
+ fontCyclePending = false;
+ scheduleOwners();
+ });
+ }
+ return fontCyclePending || Boolean(fonts && fonts.status === 'loading');
+ }
+ return Archify.waitForStableLayout({
+ maximumFrames: 960,
+ schedule: scheduleOwners,
+ pending: function () {
+ // Recapture readiness for font cycles that begin during sampling.
+ return fontsPending() || reader.pending() || chrome.pending();
+ },
+ snapshot: function () {
+ return JSON.stringify([
+ ['reader', reader.snapshot()],
+ ['viewerChrome', chrome.snapshot()]
+ ]);
+ },
+ timeoutMessage: 'Joint reader and viewer chrome layout did not reach stable dimensions.'
+ });
+ }
+ };
Archify.view = (function () {
var container = document.querySelector('.diagram-container');
var svg = container.querySelector('svg');
@@ -11766,18 +10435,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
container.removeAttribute('data-camera-transaction');
}
function interruptCamera(reason) {
- if (Archify.guidedViews && Archify.guidedViews.cancelHandoff) {
- Archify.guidedViews.cancelHandoff(reason || 'manual');
- }
var rendered = sampleRenderedState();
stopCameraMotion(reason || 'manual', false);
state = rendered;
state.mode = 'manual';
apply();
renderControls();
- if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: reason || 'manual' });
}
@@ -11837,8 +10500,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return true;
}
function semanticIds(ids, includeNeighbors) {
- var seeds = {};
- var wanted = {};
+ var seeds = Object.create(null);
+ var wanted = Object.create(null);
(ids || []).forEach(function (id) { seeds[id] = true; wanted[id] = true; });
if (includeNeighbors) {
Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
@@ -11872,8 +10535,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
var maxY = Math.max.apply(Math, boxes.map(function (box) { return box.y + box.height; }));
var bounds = {
- x: contentOffsetX + minX * contentScale,
- y: contentOffsetY + minY * contentScale,
+ x: contentOffsetX + (minX - viewBox.x) * contentScale,
+ y: contentOffsetY + (minY - viewBox.y) * contentScale,
width: Math.max(1, (maxX - minX) * contentScale),
height: Math.max(1, (maxY - minY) * contentScale)
};
@@ -11977,7 +10640,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!boxes.length || !viewBox || viewBox.width <= 0) return false;
var minX = Math.min.apply(Math, boxes.map(function (box) { return box.x; }));
var maxX = Math.max.apply(Math, boxes.map(function (box) { return box.x + box.width; }));
- var center = ((minX + maxX) / 2 / viewBox.width) * (svg.clientWidth || 1);
+ var center = (((minX + maxX) / 2 - viewBox.x) / viewBox.width) * (svg.clientWidth || 1);
var target = Math.max(0, Math.min(svg.clientWidth - container.clientWidth, center - container.clientWidth / 2));
var transaction = cameraReceipt({ scrollLeft: target }, options);
cameraTransaction = transaction;
@@ -11995,9 +10658,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return transaction;
}
function syncSemantic() {
- var guided = Archify.guidedViews && typeof Archify.guidedViews.focus === 'function'
- ? Archify.guidedViews.focus() : [];
- if (guided && guided.length) return reveal(guided, { reason: 'guided-sync' });
var active = Archify.focus && typeof Archify.focus.active === 'function' ? Archify.focus.active() : null;
if (typeof active === 'string') return reveal([active], { includeNeighbors: true, reason: 'focus-sync' });
if (Array.isArray(active) && active.length) return reveal(active, { reason: 'selection-sync' });
@@ -12454,8 +11114,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
: viewerText('viewer.radar.viewport.scale', { percent: Math.round(visible.scale * 100) }));
status.textContent = viewerText('viewer.radar.status', { count: nodes.length, viewport: viewportCopy });
nodes.forEach(function (item) {
- var active = item.node.hasAttribute('data-focus-selected') ||
- item.node.getAttribute('data-story-beat-state') === 'active';
+ var active = item.node.hasAttribute('data-focus-selected');
if (active) item.rect.setAttribute('data-radar-active', 'true');
else item.rect.removeAttribute('data-radar-active');
});
@@ -12479,6 +11138,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (next) {
clearSpaceRetry();
spaceRetryCount = 0;
+ trigger.setAttribute('data-radar-requested', 'true');
build();
attemptRequestedOpen(options);
} else {
@@ -12491,11 +11151,13 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
resetDockingStyles();
restorePassport();
feedback.hidden = true;
+ // Focus before collapsing: the dock hides this trigger at 100% unless it holds focus.
+ if (options.restoreFocus === true) trigger.focus();
trigger.setAttribute('aria-expanded', 'false');
+ trigger.removeAttribute('data-radar-requested');
trigger.removeAttribute('data-radar-space-limited');
trigger.setAttribute('aria-label', viewerText('viewer.nav.radar'));
trigger.title = viewerText('viewer.nav.radar.title');
- if (options.restoreFocus === true) trigger.focus();
}
return next;
}
@@ -12516,9 +11178,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function focusNode(id) {
var main = diagram.querySelector('[data-node-id="' + id + '"]');
if (!main) return false;
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.focus && typeof Archify.focus.set === 'function') {
Archify.focus.set(id, { toggle: false });
}
@@ -12703,8 +11362,8 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Presentation Stage — a shareable, viewport-filling live view.
It changes only HTML layout and URL state; SVG semantics and export
- serialization remain untouched. Escape first clears an active guided
- view/focus, then exits the stage.
+ serialization remain untouched. Escape first clears an active
+ focus, then exits the stage.
============================================================ */
Archify.presentation = (function () {
var html = document.documentElement;
@@ -12777,7 +11436,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Node Finder — stable-ID search over the existing semantic SVG.
Search never changes the IR or SVG geometry: selecting a result resets
- the viewport, releases a guided view, and delegates to semantic focus.
+ the viewport and delegates to semantic focus.
============================================================ */
Archify.finder = (function () {
var html = document.documentElement;
@@ -12899,9 +11558,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
try { item.node.focus({ preventScroll: true }); } catch (_) { try { item.node.focus(); } catch (_) {} }
return true;
}
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.view && typeof Archify.view.reset === 'function') Archify.view.reset({ automatic: true });
Archify.focus.set(id, { toggle: false });
if (Archify.view && typeof Archify.view.reveal === 'function') {
@@ -13040,6 +11696,145 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
};
})();
+ /* ============================================================
+ Node Outline — a rail index of the semantic nodes, grouped by their
+ authored context. Hover previews neighbors through Intent Trace;
+ selection delegates to the Finder's focus-and-reveal path. It reads
+ the canonical SVG and never changes geometry or export state.
+ ============================================================ */
+ Archify.outline = (function () {
+ var panel = document.getElementById('node-outline');
+ var list = document.getElementById('node-outline-list');
+ var count = document.getElementById('node-outline-count');
+ var svg = document.querySelector('.diagram-container > svg');
+ if (!panel || !list || !svg) return { count: 0 };
+ var TONES = ['frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external'];
+ var nodes = Array.from(svg.querySelectorAll('[data-node-id]')).filter(function (node) {
+ return !node.closest('[data-legend-hit], .legend') && node.getAttribute('data-node-label');
+ });
+ var buttons = Object.create(null);
+
+ function tone(node) {
+ var shape = node.querySelector('[class*="c-"]:not(.c-mask)');
+ var match = shape && /(?:^|\s)c-([a-z]+)/.exec(shape.getAttribute('class') || '');
+ return match && TONES.indexOf(match[1]) !== -1 ? match[1] : 'external';
+ }
+ function preview(id) {
+ if (Archify.intentTrace && typeof Archify.intentTrace.show === 'function') Archify.intentTrace.show(id);
+ }
+ function clearPreview() {
+ if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
+ }
+ function select(id) {
+ clearPreview();
+ var finder = Archify.finder;
+ if (finder && typeof finder.select === 'function') {
+ if (finder.select(id)) return;
+ var routeMode = Archify.routeProbe && typeof Archify.routeProbe.active === 'function' ? Archify.routeProbe.active() : 'idle';
+ // Only an active endpoint picker owns a refused selection.
+ if (routeMode === 'source' || routeMode === 'target') return;
+ }
+ if (Archify.focus && typeof Archify.focus.set === 'function') Archify.focus.set(id, { toggle: false });
+ }
+
+ var groups = [];
+ var byContext = Object.create(null);
+ nodes.forEach(function (node) {
+ // Group by the outermost context (lane or stage); deeper segments
+ // such as workflow groups and columns would split the index into
+ // one-node sections.
+ var context = (node.getAttribute('data-node-context') || '').split(' \u203a ')[0];
+ if (!byContext[context]) {
+ byContext[context] = { label: context, nodes: [] };
+ groups.push(byContext[context]);
+ }
+ byContext[context].nodes.push(node);
+ });
+
+ groups.forEach(function (group) {
+ var section = document.createElement('li');
+ section.className = 'node-outline-group';
+ if (groups.length > 1 && group.label) {
+ var heading = document.createElement('span');
+ heading.className = 'node-outline-heading';
+ var headingLabel = document.createElement('span');
+ headingLabel.textContent = group.label;
+ var headingCount = document.createElement('small');
+ headingCount.textContent = String(group.nodes.length);
+ heading.appendChild(headingLabel);
+ heading.appendChild(headingCount);
+ section.appendChild(heading);
+ }
+ var items = document.createElement('ul');
+ group.nodes.forEach(function (node) {
+ var id = node.getAttribute('data-node-id');
+ var item = document.createElement('li');
+ var button = document.createElement('button');
+ button.type = 'button';
+ button.className = 'node-outline-item';
+ button.setAttribute('data-outline-node', id);
+ button.style.setProperty('--outline-tone', 'var(--' + tone(node) + '-stroke)');
+ var dot = document.createElement('span');
+ dot.className = 'node-outline-dot';
+ dot.setAttribute('aria-hidden', 'true');
+ var label = document.createElement('strong');
+ label.textContent = node.getAttribute('data-node-label');
+ button.appendChild(dot);
+ button.appendChild(label);
+ var sublabel = node.getAttribute('data-node-sublabel');
+ if (sublabel) {
+ var detail = document.createElement('small');
+ detail.textContent = sublabel;
+ button.appendChild(detail);
+ }
+ button.addEventListener('pointerenter', function () { preview(id); });
+ button.addEventListener('focus', function () { preview(id); });
+ button.addEventListener('pointerleave', clearPreview);
+ button.addEventListener('blur', clearPreview);
+ button.addEventListener('click', function () { select(id); });
+ buttons[id] = button;
+ item.appendChild(button);
+ items.appendChild(item);
+ });
+ section.appendChild(items);
+ list.appendChild(section);
+ });
+
+ var previewing = null;
+ function syncCurrent() {
+ nodes.forEach(function (node) {
+ var button = buttons[node.getAttribute('data-node-id')];
+ if (!button) return;
+ if (node.getAttribute('aria-pressed') === 'true') button.setAttribute('aria-current', 'true');
+ else button.removeAttribute('aria-current');
+ });
+ // Mirror a diagram-side hover so the index answers "where is this?".
+ var active = buttons[svg.getAttribute('data-intent-trace-active') || ''] || null;
+ if (active === previewing) return;
+ if (previewing) previewing.removeAttribute('data-previewing');
+ previewing = active;
+ if (!active) return;
+ active.setAttribute('data-previewing', '');
+ if (!active.matches(':hover') && panel.offsetParent) {
+ var box = list.getBoundingClientRect();
+ var item = active.getBoundingClientRect();
+ if (item.top < box.top || item.bottom > box.bottom - 24) {
+ list.scrollTop += item.top - box.top - box.height / 2 + item.height / 2;
+ }
+ }
+ }
+ if (typeof MutationObserver === 'function') {
+ new MutationObserver(syncCurrent).observe(svg, { attributes: true, subtree: true, attributeFilter: ['aria-pressed', 'data-intent-trace-active'] });
+ }
+ if (count) count.textContent = String(nodes.length);
+ panel.hidden = nodes.length < 2;
+ syncCurrent();
+ if (Archify.readerLayout && typeof Archify.readerLayout.schedule === 'function') Archify.readerLayout.schedule();
+
+ return { count: nodes.length, select: select };
+ })();
+
+
/* ============================================================
Route Probe — shortest directed path over compiled semantics.
The graph is read from renderer-owned stable IDs and relationship
@@ -13306,7 +12101,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function outgoingByNode() {
var byId = nodesById();
- var outgoing = {};
+ var outgoing = Object.create(null);
edges().forEach(function (edge) {
var from = edge.getAttribute('data-edge-from');
var to = edge.getAttribute('data-edge-to');
@@ -13318,7 +12113,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function reachableFrom(source) {
var outgoing = outgoingByNode();
- var reached = {};
+ var reached = Object.create(null);
var queue = [source];
reached[source] = true;
for (var cursor = 0; cursor < queue.length; cursor += 1) {
@@ -13333,7 +12128,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
}
function hopDistancesFrom(source) {
var outgoing = outgoingByNode();
- var distances = {};
+ var distances = Object.create(null);
var queue = [source];
distances[source] = 0;
for (var cursor = 0; cursor < queue.length; cursor += 1) {
@@ -13349,7 +12144,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function shortestDirectedPath(source, target) {
if (source === target) return null;
var outgoing = outgoingByNode();
- var previous = {};
+ var previous = Object.create(null);
var queue = [source];
previous[source] = null;
for (var cursor = 0; cursor < queue.length && !Object.prototype.hasOwnProperty.call(previous, target); cursor += 1) {
@@ -13836,9 +12631,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Array.isArray(focused)) focused = null;
clear({ updateUrl: false, preserveView: true, restoreFocus: false });
if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') Archify.intentTrace.clear({ announce: false });
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.focus && typeof Archify.focus.clear === 'function') {
Archify.focus.clear({ updateUrl: false, preserveView: true });
}
@@ -13879,7 +12671,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var sourceIds = nodes().map(function (node) { return node.getAttribute('data-node-id'); }).filter(function (id) {
return outgoing[id] && outgoing[id].length;
});
- var sourceBadges = {};
+ var sourceBadges = Object.create(null);
sourceIds.forEach(function (id) { sourceBadges[id] = viewerText('viewer.route.finder.source.badge'); });
return {
kind: 'route-source',
@@ -13895,7 +12687,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (mode === 'target' && startId && byId[startId]) {
var distances = hopDistancesFrom(startId);
var targetIds = Object.keys(distances).filter(function (id) { return id !== startId && byId[id]; });
- var targetBadges = {};
+ var targetBadges = Object.create(null);
targetIds.forEach(function (id) {
targetBadges[id] = viewerCount('viewer.route.hop', distances[id]);
});
@@ -14104,7 +12896,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var MAX_LENS_FLOW_EDGES = 24;
function nodesById() {
- var byId = {};
+ var byId = Object.create(null);
Array.prototype.forEach.call(svg.querySelectorAll('[data-node-id][data-node-kind]'), function (node) {
var id = node.getAttribute('data-node-id');
if (id && !byId[id]) byId[id] = node;
@@ -14260,7 +13052,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return selectedKinds.length > 0 || !panel.hidden || html.getAttribute('data-present') === 'true' ||
svg.hasAttribute('data-focus-active') || svg.hasAttribute('data-intent-trace-active') ||
svg.hasAttribute('data-route-picking') || svg.hasAttribute('data-route-active') ||
- svg.hasAttribute('data-story-active') || svg.hasAttribute('data-relationship-preview-active');
+ svg.hasAttribute('data-relationship-preview-active');
}
function previewLegendKind(entry) {
clearLegendPreview();
@@ -14271,7 +13063,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return (byId[id].getAttribute('data-node-kind') || 'neutral') === kind;
});
if (!matches.length) return false;
- var chosen = {};
+ var chosen = Object.create(null);
matches.forEach(function (id) {
chosen[id] = true;
byId[id].setAttribute('data-legend-preview-match', '');
@@ -14447,7 +13239,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
options = options || {};
cleanSvgState();
var byId = nodesById();
- var nodeKind = {};
+ var nodeKind = Object.create(null);
Object.keys(byId).forEach(function (id) { nodeKind[id] = byId[id].getAttribute('data-node-kind') || 'neutral'; });
if (!selectedKinds.length) {
status.textContent = viewerText('viewer.lens.choose');
@@ -14532,9 +13324,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Archify.routeProbe && typeof Archify.routeProbe.clear === 'function') {
Archify.routeProbe.clear({ updateUrl: false, restoreFocus: false });
}
- if (Archify.guidedViews && typeof Archify.guidedViews.showAll === 'function') {
- Archify.guidedViews.showAll({ clearFocus: false, updateUrl: false });
- }
if (Archify.intentTrace && typeof Archify.intentTrace.clear === 'function') {
Archify.intentTrace.clear({ announce: false });
}
@@ -14754,7 +13543,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
/* ============================================================
Diagram Guide — a factual command deck over existing interactions.
Counts come from compiled semantics; actions delegate to Finder, Route
- Probe, Semantic Radar, Semantic Lens, Story Trail, Presentation, theme, export, and
+ Probe, Semantic Radar, Semantic Lens, Presentation, theme, export, and
camera without adding a second command implementation or SVG state.
============================================================ */
Archify.guide = (function () {
@@ -14767,13 +13556,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
var stats = document.getElementById('diagram-guide-stats');
var actions = document.getElementById('diagram-guide-actions');
var feedback = document.getElementById('diagram-guide-feedback');
- var storyBtn = actions.querySelector('[data-guide-action="story"]');
- var storyCopy = document.getElementById('diagram-guide-story-copy');
var routePanel = document.getElementById('route-probe');
+ var returnFocus = null;
- function viewCount() {
- return Archify.guidedViews && Number(Archify.guidedViews.count) || 0;
- }
function relationshipCount() {
var seen = {};
Array.prototype.forEach.call(svg.querySelectorAll('[data-edge-from][data-edge-to]'), function (edge) {
@@ -14789,17 +13574,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function renderFacts() {
var nodes = svg.querySelectorAll('[data-node-id]').length;
var relationships = relationshipCount();
- var views = viewCount();
stats.textContent = viewerText('viewer.guide.facts', {
nodes: viewerCount('viewer.guide.fact.node', nodes),
- relationships: viewerCount('viewer.guide.fact.relationship', relationships),
- views: viewerCount('viewer.guide.fact.view', views)
+ relationships: viewerCount('viewer.guide.fact.relationship', relationships)
});
- storyBtn.disabled = views === 0;
- storyBtn.setAttribute('aria-disabled', views === 0 ? 'true' : 'false');
- storyCopy.textContent = views
- ? viewerCount('viewer.guide.story.available', views)
- : viewerText('viewer.guide.story.unavailable');
}
function actionButtons() {
return Array.prototype.slice.call(actions.querySelectorAll('.diagram-guide-action:not(:disabled)'));
@@ -14812,7 +13590,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
trigger.setAttribute('aria-expanded', 'false');
trigger.setAttribute('aria-label', viewerText('viewer.guide.open'));
feedback.textContent = '';
- if (options.restoreFocus !== false) trigger.focus();
+ if (options.restoreFocus !== false) {
+ var target = trigger.hidden ? returnFocus : trigger;
+ if (target && typeof target.focus === 'function') target.focus();
+ }
return false;
}
function open() {
@@ -14822,12 +13603,10 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (Archify.finder && Archify.finder.isOpen()) Archify.finder.close({ restoreFocus: false });
if (Archify.radar && Archify.radar.isOpen()) Archify.radar.close({ restoreFocus: false });
if (Archify.semanticLens && Archify.semanticLens.isOpen()) Archify.semanticLens.close({ restoreFocus: false });
- if (Archify.guidedViews && Archify.guidedViews.isPlaying && Archify.guidedViews.isPlaying()) {
- Archify.guidedViews.pause();
- }
if (Archify.routeProbe && Archify.routeProbe.isJourneyPlaying && Archify.routeProbe.isJourneyPlaying()) {
Archify.routeProbe.pauseJourney({ preserveElapsed: true, reason: 'guide' });
}
+ returnFocus = document.activeElement;
renderFacts();
panel.hidden = false;
html.setAttribute('data-guide-open', 'true');
@@ -14844,16 +13623,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
function toggle() { return panel.hidden ? open() : close(); }
function execute(action) {
feedback.textContent = '';
- if (action === 'story' && !viewCount()) {
- feedback.textContent = viewerText('viewer.guide.noStory');
- return false;
- }
close({ restoreFocus: false });
if (action === 'find') return Archify.finder.open();
if (action === 'route') return Archify.routeProbe.begin({ focusNode: true });
if (action === 'map') return Archify.radar.open();
if (action === 'lens') return Archify.semanticLens.open();
- if (action === 'story') return Archify.guidedViews.play();
if (action === 'present') return Archify.presentation.enter();
if (action === 'export') return Archify.exportMenu.open();
if (action === 'theme') return Archify.theme.toggle();
@@ -14869,7 +13643,6 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
r: 'route',
m: 'map',
l: 'lens',
- p: 'story',
f: 'present',
e: 'export',
t: 'theme',
@@ -14931,8 +13704,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
facts: function () {
return {
nodes: svg.querySelectorAll('[data-node-id]').length,
- relationships: relationshipCount(),
- views: viewCount()
+ relationships: relationshipCount()
};
}
};