@loadmap/react 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Loadmap-BMCWIC-r.d.ts → Loadmap-CBHK-gaN.d.ts} +32 -2
- package/dist/{Loadmap-BjtmzxzK.js → Loadmap-Rla4011L.js} +89 -27
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{later-B9SnId7C.js → later-Dg1NA8wt.js} +1 -1
- package/dist/source.d.ts +1 -1
- package/dist/source.js +1 -1
- package/dist/{zoom-C_qebdpE.js → zoom-BgEnKkef.js} +128 -51
- package/package.json +5 -5
|
@@ -59,6 +59,12 @@ declare class Viewer {
|
|
|
59
59
|
get readerView(): Viewpoint | null;
|
|
60
60
|
/** What the board shows now, the story's camera included. */
|
|
61
61
|
shownView(): Viewpoint | null;
|
|
62
|
+
/**
|
|
63
|
+
* The engine moves from frame `from` to a new structure (a phase, the text edited): the reader's view holds on to
|
|
64
|
+
* the box nearest its middle, keeping it where it is on the board at the same zoom each frame of the move, so what
|
|
65
|
+
* the reader looked at stays under their eyes while the rest moves around it.
|
|
66
|
+
*/
|
|
67
|
+
hold(from: Scene | null, to: Scene): void;
|
|
62
68
|
/** The zoom's range, in board pixels a scene unit. */
|
|
63
69
|
zoomRange(): {
|
|
64
70
|
min: number;
|
|
@@ -69,6 +75,18 @@ declare class Viewer {
|
|
|
69
75
|
* as the board changes. A story playing stops where it is: the reader took the view.
|
|
70
76
|
*/
|
|
71
77
|
setView(v: Viewpoint | null): void;
|
|
78
|
+
/**
|
|
79
|
+
* Moves the view to `to` (null: fitted). With `fly` it flies there, on the wall clock (a reader's view is never in a
|
|
80
|
+
* recording); without, and with reduced motion, it is there at once.
|
|
81
|
+
*/
|
|
82
|
+
go(to: Viewpoint | null, fly: boolean): void;
|
|
83
|
+
/** Ends a flight where it is. */
|
|
84
|
+
land(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Brings these boxes into view, flying there: at the same zoom, further out only as far as it takes to show them
|
|
87
|
+
* all. Nothing when they show already: a view the reader never moved shows the whole diagram.
|
|
88
|
+
*/
|
|
89
|
+
show(ids: readonly string[]): void;
|
|
72
90
|
/** The part of the scene the board shows now: its viewBox. */
|
|
73
91
|
box(): Rect | null;
|
|
74
92
|
/** Where the board draws the scene now, in its pixels: its scale and offset. */
|
|
@@ -139,8 +157,8 @@ type Shot = 'establish' | 'in' | 'close' | 'change' | 'hand' | 'out' | 'wide' |
|
|
|
139
157
|
*/
|
|
140
158
|
declare class Engine {
|
|
141
159
|
#private;
|
|
142
|
-
|
|
143
|
-
|
|
160
|
+
model: Model;
|
|
161
|
+
view: View;
|
|
144
162
|
sim: Sim;
|
|
145
163
|
ev: Evaluation;
|
|
146
164
|
scene: Scene | null;
|
|
@@ -176,6 +194,12 @@ declare class Engine {
|
|
|
176
194
|
svg: SVGSVGElement | null;
|
|
177
195
|
canvas: HTMLCanvasElement | null;
|
|
178
196
|
constructor(model: Model, view: View, ev: Evaluation, o?: SimOptions);
|
|
197
|
+
/**
|
|
198
|
+
* A new version of the model and view (the text edited): a story stops, and what is drawn stays, its dots running,
|
|
199
|
+
* until the new scene moves in from it; the sim starts over on the new model then, so no dot looks for a box the
|
|
200
|
+
* old scene does not have.
|
|
201
|
+
*/
|
|
202
|
+
setModel(model: Model, view: View, ev: Evaluation, o: SimOptions): void;
|
|
179
203
|
setEvaluation(ev: Evaluation): void;
|
|
180
204
|
/** The limit passing to another component now, if it is: the diagram draws the old ring while it fades. */
|
|
181
205
|
get handover(): Handover | null;
|
|
@@ -371,6 +395,12 @@ interface LoadmapHandle {
|
|
|
371
395
|
* length in seconds. Picking a step or a value stops it.
|
|
372
396
|
*/
|
|
373
397
|
playStory(): number;
|
|
398
|
+
/**
|
|
399
|
+
* On a board the reader pans and zooms, brings these boxes (node ids) into view, flying there: at the same zoom,
|
|
400
|
+
* further out only as far as it takes to show them all. Nothing when they show already, while the diagram is fitted
|
|
401
|
+
* or the story plays.
|
|
402
|
+
*/
|
|
403
|
+
show(ids: readonly string[]): void;
|
|
374
404
|
/** The drawn board, for capturing frames: while the structure moves, `scene` is the frame drawn. */
|
|
375
405
|
board(): {
|
|
376
406
|
svg: SVGSVGElement;
|
|
@@ -212,7 +212,7 @@ function stepDetail(a, b, components) {
|
|
|
212
212
|
}).filter(Boolean).join(" · ");
|
|
213
213
|
}
|
|
214
214
|
// src/Diagram.tsx
|
|
215
|
-
const Detail = lazy(() => import("./later-
|
|
215
|
+
const Detail = lazy(() => import("./later-Dg1NA8wt.js").then((m) => ({ default: m.Detail })));
|
|
216
216
|
const STATE_STROKE = {
|
|
217
217
|
off: "var(--lm-line)",
|
|
218
218
|
ok: "var(--lm-ok)",
|
|
@@ -320,7 +320,7 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null, canvas = fal
|
|
|
320
320
|
const board = boardRef.current;
|
|
321
321
|
if (!zoom || !board) return;
|
|
322
322
|
let gone = false;
|
|
323
|
-
import("./zoom-
|
|
323
|
+
import("./zoom-BgEnKkef.js").then(({ mountZoom }) => {
|
|
324
324
|
if (!gone) zoomed.current = mountZoom(board, engine, () => shape.current);
|
|
325
325
|
}).catch(() => {});
|
|
326
326
|
return () => {
|
|
@@ -659,7 +659,7 @@ const Structure = memo(function Structure({ lm, scene, hand, svgRef, rates, setT
|
|
|
659
659
|
}) }),
|
|
660
660
|
scene.tiers.map((t, i) => /* @__PURE__ */ jsx(Tier, {
|
|
661
661
|
t,
|
|
662
|
-
|
|
662
|
+
i
|
|
663
663
|
}, t.id)),
|
|
664
664
|
rates && /* @__PURE__ */ jsx(RateStrokes, {
|
|
665
665
|
lm,
|
|
@@ -706,29 +706,67 @@ const Structure = memo(function Structure({ lm, scene, hand, svgRef, rates, setT
|
|
|
706
706
|
]
|
|
707
707
|
});
|
|
708
708
|
});
|
|
709
|
-
/**
|
|
710
|
-
|
|
711
|
-
|
|
709
|
+
/**
|
|
710
|
+
* A tier's lane behind the boxes: every other band shaded, a divider before all but the first, and its header with the
|
|
711
|
+
* name. Paint goes in attributes, never classes: export resolves the tokens in them and drops the classes.
|
|
712
|
+
*/
|
|
713
|
+
function Tier({ t, i }) {
|
|
714
|
+
const h = t.head;
|
|
715
|
+
const [x2, y2] = t.vertical ? [t.x + t.w, t.y] : [t.x, t.y + t.h];
|
|
716
|
+
const under = t.vertical ? {
|
|
717
|
+
x1: h.x + h.w,
|
|
718
|
+
y1: h.y,
|
|
719
|
+
x2: h.x + h.w,
|
|
720
|
+
y2: h.y + h.h
|
|
721
|
+
} : {
|
|
722
|
+
x1: h.x,
|
|
723
|
+
y1: h.y + h.h,
|
|
724
|
+
x2: h.x + h.w,
|
|
725
|
+
y2: h.y + h.h
|
|
726
|
+
};
|
|
712
727
|
return /* @__PURE__ */ jsxs("g", {
|
|
713
728
|
className: "lm-tier",
|
|
714
729
|
"data-tier-id": t.id,
|
|
715
730
|
pointerEvents: "none",
|
|
716
|
-
children: [
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
731
|
+
children: [
|
|
732
|
+
i % 2 === 1 && /* @__PURE__ */ jsx("rect", {
|
|
733
|
+
x: t.x,
|
|
734
|
+
y: t.y,
|
|
735
|
+
width: t.w,
|
|
736
|
+
height: t.h,
|
|
737
|
+
fill: "var(--lm-tier)"
|
|
738
|
+
}),
|
|
739
|
+
/* @__PURE__ */ jsx("rect", {
|
|
740
|
+
x: h.x,
|
|
741
|
+
y: h.y,
|
|
742
|
+
width: h.w,
|
|
743
|
+
height: h.h,
|
|
744
|
+
fill: "var(--lm-tier-head)"
|
|
745
|
+
}),
|
|
746
|
+
/* @__PURE__ */ jsx("line", {
|
|
747
|
+
...under,
|
|
748
|
+
stroke: "var(--lm-tier-line)"
|
|
749
|
+
}),
|
|
750
|
+
i > 0 && /* @__PURE__ */ jsx("line", {
|
|
751
|
+
x1: t.x,
|
|
752
|
+
y1: t.y,
|
|
753
|
+
x2,
|
|
754
|
+
y2,
|
|
755
|
+
stroke: "var(--lm-tier-line)"
|
|
756
|
+
}),
|
|
757
|
+
t.lines.map(({ text, x, y, size, weight, fade }, k) => /* @__PURE__ */ jsx("text", {
|
|
758
|
+
opacity: fade,
|
|
759
|
+
x,
|
|
760
|
+
y,
|
|
761
|
+
fontSize: size,
|
|
762
|
+
fontWeight: weight,
|
|
763
|
+
letterSpacing: t.spacing,
|
|
764
|
+
fill: "var(--lm-tier-fg)",
|
|
765
|
+
textAnchor: t.vertical ? "end" : void 0,
|
|
766
|
+
transform: t.vertical ? `rotate(-90 ${x} ${y})` : void 0,
|
|
767
|
+
children: text
|
|
768
|
+
}, k))
|
|
769
|
+
]
|
|
732
770
|
});
|
|
733
771
|
}
|
|
734
772
|
const pathOf = (pts) => pts.map(([x, y], i) => `${i ? "L" : "M"}${x} ${y}`).join(" ");
|
|
@@ -2327,11 +2365,13 @@ const LIGHT = `
|
|
|
2327
2365
|
--lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;
|
|
2328
2366
|
--lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;
|
|
2329
2367
|
--lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;
|
|
2368
|
+
--lm-tier: #f3f6f9; --lm-tier-head: #e4eaf0; --lm-tier-fg: #34424f; --lm-tier-line: #c6d0da;
|
|
2330
2369
|
--lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;`;
|
|
2331
2370
|
const DARK = `
|
|
2332
2371
|
--lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;
|
|
2333
2372
|
--lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;
|
|
2334
2373
|
--lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;
|
|
2374
|
+
--lm-tier: #1a2530; --lm-tier-head: #22303d; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;
|
|
2335
2375
|
--lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark;`;
|
|
2336
2376
|
/**
|
|
2337
2377
|
* Theme tokens and the layout of every piece. Scoped to `.lm`; override any `--lm-*` token to restyle. Two are for the
|
|
@@ -2741,12 +2781,25 @@ var Engine = class {
|
|
|
2741
2781
|
#clock = 0;
|
|
2742
2782
|
#story = null;
|
|
2743
2783
|
#hand = null;
|
|
2784
|
+
/** The sim is the old model's until the new model's scene comes. */
|
|
2785
|
+
#stale = false;
|
|
2744
2786
|
constructor(model, view, ev, o = {}) {
|
|
2787
|
+
this.setModel(model, view, ev, o);
|
|
2788
|
+
}
|
|
2789
|
+
/**
|
|
2790
|
+
* A new version of the model and view (the text edited): a story stops, and what is drawn stays, its dots running,
|
|
2791
|
+
* until the new scene moves in from it; the sim starts over on the new model then, so no dot looks for a box the
|
|
2792
|
+
* old scene does not have.
|
|
2793
|
+
*/
|
|
2794
|
+
setModel(model, view, ev, o) {
|
|
2795
|
+
this.stopStory({ cut: true });
|
|
2745
2796
|
this.model = model;
|
|
2746
2797
|
this.view = view;
|
|
2747
2798
|
this.ev = ev;
|
|
2748
2799
|
this.#o = o;
|
|
2749
|
-
this
|
|
2800
|
+
this.#setHand(null);
|
|
2801
|
+
if (this.frame) this.#stale = true;
|
|
2802
|
+
else this.sim = createSim(model, ev, o);
|
|
2750
2803
|
}
|
|
2751
2804
|
setEvaluation(ev) {
|
|
2752
2805
|
if (ev === this.ev) return;
|
|
@@ -2754,7 +2807,7 @@ var Engine = class {
|
|
|
2754
2807
|
const was = this.ev.firstLimit?.id;
|
|
2755
2808
|
const now = ev.firstLimit?.id;
|
|
2756
2809
|
this.ev = ev;
|
|
2757
|
-
if (!same) this.sim.update(ev);
|
|
2810
|
+
if (!same && !this.#stale) this.sim.update(ev);
|
|
2758
2811
|
if (was === now) return;
|
|
2759
2812
|
const story = this.#story?.shot === "change";
|
|
2760
2813
|
const still = this.paused && !this.#driven;
|
|
@@ -2800,6 +2853,11 @@ var Engine = class {
|
|
|
2800
2853
|
const seconds = this.transition;
|
|
2801
2854
|
this.scene = scene;
|
|
2802
2855
|
this.#paths.clear();
|
|
2856
|
+
if (this.#stale) {
|
|
2857
|
+
this.#stale = false;
|
|
2858
|
+
this.sim = createSim(this.model, this.ev, this.#o);
|
|
2859
|
+
}
|
|
2860
|
+
this.viewer?.hold(from, scene);
|
|
2803
2861
|
const move = from && !o.cut && seconds > 0 && Number.isFinite(seconds) && (!this.paused || this.#driven) && from.direction === scene.direction && from.key !== scene.key;
|
|
2804
2862
|
this.#move = move ? {
|
|
2805
2863
|
at: morph(from, scene),
|
|
@@ -3272,8 +3330,11 @@ function useLoadmap(model, view, o = {}) {
|
|
|
3272
3330
|
const fresh = !evaluated.current || evaluated.current.values === values;
|
|
3273
3331
|
const ev = useMemo(() => evaluated.current?.values === values ? evaluated.current.ev : model.evaluate(values), [model, values]);
|
|
3274
3332
|
const engineRef = useRef(null);
|
|
3275
|
-
|
|
3333
|
+
engineRef.current ??= new Engine(model, view, ev, o);
|
|
3276
3334
|
const engine = engineRef.current;
|
|
3335
|
+
useLayoutEffect(() => {
|
|
3336
|
+
if (engine.model !== model || engine.view !== view) engine.setModel(model, view, evaluated.current?.ev ?? ev, o);
|
|
3337
|
+
});
|
|
3277
3338
|
engine.transition = o.transition ?? .8;
|
|
3278
3339
|
const [root, setRoot] = useState(null);
|
|
3279
3340
|
const wide = o.direction ?? directionOf(view);
|
|
@@ -3564,8 +3625,8 @@ function canvasMeasure(fontFamily) {
|
|
|
3564
3625
|
};
|
|
3565
3626
|
}
|
|
3566
3627
|
// src/Loadmap.tsx
|
|
3567
|
-
const Dock = lazy(() => import("./later-
|
|
3568
|
-
const VerdictLine = lazy(() => import("./later-
|
|
3628
|
+
const Dock = lazy(() => import("./later-Dg1NA8wt.js").then((m) => ({ default: m.Dock })));
|
|
3629
|
+
const VerdictLine = lazy(() => import("./later-Dg1NA8wt.js").then((m) => ({ default: m.VerdictLine })));
|
|
3569
3630
|
/** What the page's own switch says, on `<html>`: `data-theme`, or a `dark` or `light` class; null when it says nothing. */
|
|
3570
3631
|
function pageTheme() {
|
|
3571
3632
|
if (typeof document === "undefined") return null;
|
|
@@ -3797,6 +3858,7 @@ function handleOf(lm) {
|
|
|
3797
3858
|
engine.paused = false;
|
|
3798
3859
|
},
|
|
3799
3860
|
values: () => engine.ev.values,
|
|
3861
|
+
show: (ids) => engine.viewer?.show(ids),
|
|
3800
3862
|
setValues: (v) => lm.setValues(v),
|
|
3801
3863
|
setStoryStep: (i) => lm.setStep(i),
|
|
3802
3864
|
storyStep: () => engine.storyStep,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as Insets, a as LoadmapProps, c as handleOf, d as LoadmapController, f as LoadmapOptions, g as Engine, h as Dot, i as LoadmapPanel, l as usePageTheme, m as Cue, n as Loadmap, o as LoadmapRoot, p as useLoadmap, r as LoadmapHandle, s as Theme, t as LOADMAP_PANELS, u as FullScreenMode } from "./Loadmap-
|
|
1
|
+
import { _ as Insets, a as LoadmapProps, c as handleOf, d as LoadmapController, f as LoadmapOptions, g as Engine, h as Dot, i as LoadmapPanel, l as usePageTheme, m as Cue, n as Loadmap, o as LoadmapRoot, p as useLoadmap, r as LoadmapHandle, s as Theme, t as LOADMAP_PANELS, u as FullScreenMode } from "./Loadmap-CBHK-gaN.js";
|
|
2
2
|
import { Comparison, Model } from "@loadmap/core";
|
|
3
3
|
import { fitLinear } from "@loadmap/core/calibrate";
|
|
4
4
|
import { compact, fmt, multiple, pct, secs } from "@loadmap/core/format";
|
|
@@ -111,7 +111,7 @@ export declare function Story({ lm }: {
|
|
|
111
111
|
* that has its own, set on the root (`.card > .lm`) so they resolve there and reach no nested board; full screen
|
|
112
112
|
* keeps both.
|
|
113
113
|
*/
|
|
114
|
-
export declare const LOADMAP_CSS = "\n.lm { \n --lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;\n --lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;\n --lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;\n --lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;\n --lm-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --lm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font: 14px/1.45 var(--lm-font); color: var(--lm-fg); background: var(--lm-root-bg, var(--lm-bg));\n display: grid; gap: 14px; padding: var(--lm-pad, 16px); min-width: 0; box-sizing: border-box; }\n@media (prefers-color-scheme: dark) { .lm:not([data-theme=\"light\"]) { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; } }\n.lm[data-theme=\"dark\"] { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; }\n.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }\n.lm h2 { font-size: 1.3rem; font-weight: 600; margin: 0; text-wrap: balance; }\n.lm h3 { font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin: 0; }\n.lm button:focus-visible, .lm input:focus-visible, .lm select:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-problems { margin: 0; padding: 10px 12px; font: .8rem/1.5 var(--lm-mono); white-space: pre-wrap; overflow-x: auto; color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-drop); border-radius: 6px; }\n.lm-note { margin: 0; font-size: .8rem; color: var(--lm-muted); }\n.lm-card { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }\n\n.lm-wrap { display: grid; gap: 8px; min-width: 0; position: relative; }\n.lm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }\n.lm-btn { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }\n.lm-board { position: relative; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; overflow: hidden; margin: 0 auto; width: 100%; }\n.lm-board svg { display: block; width: 100%; height: auto; font-family: var(--lm-font); }\n.lm-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }\n/* the story's title over the board while it plays: a lower third, at the top when what is framed is low; a strip\n across the top of a narrow board */\n.lm-title { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: grid; gap: 1px; max-width: min(34rem, calc(100% - 24px)); padding: 7px 12px 8px; border-left: 4px solid var(--lm-accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--lm-surface) 92%, transparent); box-shadow: 0 4px 16px rgb(0 0 0 / .12); pointer-events: none; overflow-wrap: anywhere; }\n.lm-title[data-top] { top: 12px; bottom: auto; }\n.lm-title b { font-size: .95rem; font-weight: 600; }\n.lm-title span { font: 500 .8rem var(--lm-mono); color: var(--lm-muted); }\n@container (max-width: 520px) {\n .lm-title, .lm-title[data-top] { top: 0; right: 0; bottom: auto; left: 0; max-width: none; padding: 4px 8px; border-radius: 0; box-shadow: none; }\n .lm-title b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .lm-title span { display: none; }\n}\n.lm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--lm-muted); }\n.lm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }\n\n/* full screen (the browser's, or a fixed overlay): a column that never scrolls. The diagram as wide as the screen on\n top; under it the verdict in a line and the panels, compact, in a dock the screen sizes. The load changes what is\n in them, never their size, so it never moves the board. Focus: the diagram, the story, the verdict and the load */\n.lm-side, .lm-card > .lm-panel { display: contents; }\n.lm-panel { display: grid; gap: 14px; min-width: 0; }\n.lm[data-full] { height: 100vh; height: 100dvh; padding: 16px; background: var(--lm-bg); overflow: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; position: relative; }\n.lm[data-full=\"fill\"] { height: 100%; padding: 10px; }\n.lm[data-full=\"overlay\"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }\n.lm[data-full] > * { flex: none; }\n/* a page of its own keeps the rest outside full screen, as <Loadmap> does */\n.lm[data-full] > :not(.lm-head, h2, .lm-scenarios, .lm-loadbar, .lm-story, .lm-wrap, .lm-line, .lm-dock, .lm-side) { display: none; }\n.lm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }\n.lm-head h2 { font-size: 1.1rem; }\n.lm-head .lm-loadbar { flex: 1 1 520px; }\n.lm[data-full] .lm-wrap { gap: 6px; }\n/* the board as large as fits (--lm-fit, from Diagram), left under the bar, so the legend starts where the board does */\n.lm[data-full] .lm-board { width: var(--lm-fit, 100%); margin: 0; align-self: start; justify-self: start; }\n.lm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.lm-modes { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--lm-line); border-radius: 6px; overflow: hidden; }\n.lm-modes button { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 0; padding: 6px 12px; cursor: pointer; }\n.lm-modes button[aria-pressed=\"true\"] { background: var(--lm-fg); color: var(--lm-surface); }\n.lm[data-full] .lm-story { padding: 6px 12px; }\n.lm[data-full] [data-out] { display: none; }\n\n.lm-line { display: flex; align-items: center; gap: 6px 14px; min-width: 0; padding: 6px 12px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-line[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-line[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-headline { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-num { font: 600 .95em var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-link { font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: none; border: 0; padding: 2px 4px; cursor: pointer; white-space: nowrap; }\n\n.lm-dock { display: flex; gap: 10px; min-width: 0; }\n.lm[data-full] > .lm-dock { flex: 1 1 0; min-height: clamp(200px, 26dvh, 340px); }\n.lm-tabs { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }\n.lm-mini { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; display: grid; container-type: inline-size; }\n.lm-mini[data-mini=\"controls\"] { flex-grow: 1.25; }\n.lm-mini[data-mini=\"limits\"] { flex-grow: 1.45; }\n.lm-mini[data-mini=\"live\"] { flex-grow: .8; }\n.lm-mini[data-mini=\"headroom\"] { flex-grow: .9; }\n.lm-mini[data-mini=\"compare\"] { flex-grow: 1.3; }\n.lm-mini > .lm-card { min-height: 0; overflow: hidden; padding: 10px 12px; gap: 6px; align-content: start; }\n.lm-mini [data-clip] { visibility: hidden; }\n.lm-more { position: absolute; top: 6px; right: 6px; font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: var(--lm-surface); border: 0; border-radius: 4px; padding: 2px 6px; cursor: pointer; }\n.lm-more[data-more]:not([data-more=\"\"])::before { content: attr(data-more) \" \"; }\n.lm-mini .lm-meters { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; }\n.lm-mini .lm-meter { display: flex; align-items: baseline; gap: 8px; padding: 3px 8px; }\n.lm-mini .lm-meter b { flex: none; font-size: .9rem; }\n.lm-mini .lm-meter span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n/* one grid for every row, so the bars line up whatever the names */\n.lm-mini-limits { display: grid; grid-template-columns: minmax(0, max-content) minmax(48px, 1fr) auto auto; gap: 6px 10px; }\n.lm-mini-lim { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; font-size: .8rem; }\n.lm-mini-lim .lm-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-mini-lim .lm-tag { margin-left: 5px; }\n.lm-mini-lim .lm-track { height: 9px; }\n.lm-mini-lim .lm-val { white-space: nowrap; }\n.lm-mini-lim .lm-sub { font: 400 .74rem var(--lm-mono); color: var(--lm-muted); }\n.lm-mini .lm-controls { gap: 6px; column-gap: 16px; }\n.lm-mini .lm-controls small, .lm-mini .lm-controls > h3:not(:first-child) { display: none; }\n.lm-mini .lm-controls label.lm-range { grid-template-columns: minmax(0, 1fr) minmax(90px, 1.2fr); align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select select { width: auto; padding: 1px 6px; font-size: .78rem; }\n.lm-mini .lm-switch { font-size: .8rem; }\n.lm-mini .lm-switch input { margin-top: 2px; }\n.lm-mini .lm-presets { gap: 4px; }\n.lm-mini .lm-presets button { padding: 2px 8px; font-size: .72rem; }\n@container (min-width: 420px) {\n .lm-mini .lm-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .lm-mini .lm-controls > :is(h3, .lm-presets) { grid-column: 1 / -1; }\n}\n.lm-mini .lm-compare > :not(h3:first-child, .lm-table-wrap:nth-child(3)) { display: none; }\n.lm-mini .lm-table { font-size: .76rem; }\n.lm-mini .lm-table th, .lm-mini .lm-table td { padding: 3px 8px 3px 0; }\n.lm-mini .lm-table small { display: none; }\n.lm-mini .lm-table thead th { white-space: nowrap; font-size: .6rem; }\n.lm-mini > .lm-card:has(> .lm-spark) { grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; }\n.lm-spark { position: relative; min-height: 0; }\n.lm-spark svg { position: absolute; inset: 0; display: block; overflow: hidden; }\n.lm-spark-th { stroke: var(--lm-muted); stroke-dasharray: 4 3; }\n.lm-spark-load { stroke: var(--lm-fg); opacity: .45; }\n.lm-spark-text { margin: 0; font-size: .76rem; color: var(--lm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n\n/* the drawer: the page's own panel, alone, over the right of the board */\n.lm[data-full] > .lm-drawer:not([data-drawer]) { display: none; }\n.lm[data-full] > .lm-drawer[data-drawer] { display: grid; gap: 14px; align-content: start; position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 4; width: min(640px, calc(100% - 32px)); overflow: auto; overscroll-behavior: contain; padding: 14px; background: var(--lm-bg); border: 1px solid var(--lm-line); border-radius: 10px; box-shadow: -8px 0 30px rgb(0 0 0 / .2); container-type: inline-size; }\n.lm-side[data-drawer] :is(.lm-panel, .lm-strip, .lm-charts, .lm-card):not([data-drawn]):not(.lm-panel *) { display: none; }\n.lm-side[data-drawer] .lm-strip { grid-template-columns: minmax(0, 1fr); }\n.lm-drawer-bar { display: flex; justify-content: flex-end; }\n\n/* a page of its own: its .lm-side is a box under the board that scrolls on its own, the board as large as leaves it a\n third of the screen */\n.lm[data-full] > .lm-side:not(.lm-drawer) { display: grid; gap: 14px; align-content: start; flex: 1 1 0; min-height: 33dvh; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n\n/* focus: the board and what runs on it in the middle of the screen */\n.lm[data-mode=\"focus\"] > .lm-side:not(.lm-drawer) { display: none; }\n.lm[data-mode=\"focus\"] > .lm-wrap { margin-top: auto; }\n.lm[data-mode=\"focus\"] > :is(.lm-story, .lm-line) { order: 1; }\n.lm[data-mode=\"focus\"]::after { content: \"\"; order: 2; margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { border-left-width: 4px; padding: 10px 14px; }\n.lm[data-mode=\"focus\"] > .lm-story p { font-size: 1.1rem; }\n\n@media (max-width: 760px) {\n .lm[data-full] { padding: 10px; gap: 8px; }\n /* the page has the title, and the legend: here they would leave the diagram no room */\n .lm[data-full] > h2, .lm[data-full] :is(.lm-head h2, .lm-legend, .lm-story legend) { display: none; }\n /* the one exception: here the diagram runs top to bottom, and shrunk to the screen it is too small to read, so it\n pans in a box of its own with the bar on top. The page never scrolls */\n .lm[data-full] .lm-board { width: 100%; }\n .lm[data-full] > .lm-wrap { height: 40dvh; overflow: auto; row-gap: 0; overscroll-behavior: contain; }\n .lm[data-mode=\"focus\"] > .lm-wrap { height: auto; flex: 1 1 0; min-height: 0; margin-top: 0; }\n .lm[data-full] .lm-bar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: var(--lm-bg); }\n .lm[data-full] .lm-line { flex-wrap: wrap; }\n .lm[data-full] > .lm-story { padding: 6px 10px; gap: 6px 10px; }\n .lm[data-full] > .lm-story p { font-size: .84rem; }\n .lm[data-full] .lm-story button { padding: 4px 10px; }\n .lm[data-full] .lm-headline { flex-basis: 100%; }\n .lm-dock { flex-direction: column; min-height: 0; gap: 6px; }\n /* the load bar takes some of the dock's room: the load is no longer in a card */\n .lm[data-full] > .lm-dock { min-height: clamp(170px, 22dvh, 340px); }\n .lm-tabs { display: flex; flex: none; gap: 2px; border-bottom: 1px solid var(--lm-line); overflow: hidden; }\n .lm-tabs button { font: 500 .78rem var(--lm-font); color: var(--lm-muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 8px; cursor: pointer; white-space: nowrap; }\n .lm-tabs button[aria-pressed=\"true\"] { color: var(--lm-fg); border-color: var(--lm-fg); }\n .lm-mini:not([data-active]) { display: none; }\n .lm[data-full] > .lm-side[data-drawer] { inset: 8px; width: auto; }\n /* the load in thumb reach: the bar under the board and the story, over the verdict */\n .lm[data-full] .lm-head { display: contents; }\n .lm[data-full] .lm-loadbar { order: 2; flex: none; }\n /* two lines, so the board keeps its room: the scenarios and the load's value, then the track; the label names the\n slider unseen */\n .lm[data-full] .lm-load small { display: none; }\n .lm[data-full] .lm-load { display: contents; }\n .lm[data-full] :is(.lm-loadbar legend, .lm-load > label) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n .lm[data-full] .lm-load > output { margin-left: auto; }\n .lm[data-full] .lm-load-track { flex: 1 1 100%; }\n .lm[data-full] > :is(.lm-line, .lm-dock) { order: 3; }\n}\n\n.lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-measure { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }\n\n.lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }\n@container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }\n.lm { container-type: inline-size; }\n\n.lm-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }\n.lm-meter { padding: 8px 10px; border-radius: 6px; background: var(--lm-bg); min-width: 0; }\n.lm-meter b { display: block; font: 500 1.15rem var(--lm-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-meter span { font-size: .74rem; color: var(--lm-muted); }\n.lm-meter[data-state=\"warn\"] b { color: var(--lm-warn); } .lm-meter[data-state=\"over\"] b { color: var(--lm-drop); }\n\n.lm-limits { display: grid; gap: 10px; }\n.lm-lim, .lm-scale { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 10rem; gap: 4px 14px; align-items: center; }\n@container (max-width: 640px) { .lm-lim, .lm-scale { grid-template-columns: minmax(0, 1fr); } .lm-scale > :first-child, .lm-scale > :last-child { display: none; } }\n.lm-lim b { display: block; font-weight: 600; font-size: .88rem; }\n.lm-lim .lm-sub { display: block; font-size: .74rem; color: var(--lm-muted); }\n.lm-tag { font: 600 .64rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }\n.lm-tag[data-kind=\"first\"] { color: var(--lm-surface); background: var(--lm-drop); }\n.lm-tag[data-kind=\"estimated\"] { color: var(--lm-warn); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"range\"], .lm-tag[data-kind=\"rank\"] { color: var(--lm-muted); border: 1px solid currentColor; }\n.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }\n.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }\n.lm-fill[data-state=\"warn\"] { background: var(--lm-warn); } .lm-fill[data-state=\"over\"] { background: var(--lm-drop); }\n.lm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lm-fg); opacity: .55; }\n.lm-val { font: 500 .8rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-val small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-scale { font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-scale div { position: relative; height: 12px; }\n.lm-scale div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }\n\n.lm-controls label.lm-range { display: grid; gap: 4px; font-size: .84rem; }\n.lm-controls label.lm-range > span { display: flex; justify-content: space-between; gap: 8px; }\n.lm-controls output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-controls input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.lm-presets button { font: 500 .76rem var(--lm-font); background: var(--lm-accent-soft); color: var(--lm-fg); border: 1px solid transparent; border-radius: 5px; padding: 5px 10px; cursor: pointer; }\n.lm-presets button[aria-pressed=\"true\"] { border-color: var(--lm-accent); }\n.lm-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: .84rem; cursor: pointer; }\n.lm-switch input { margin: 3px 0 0; accent-color: var(--lm-accent); }\n.lm-switch small, .lm-select small { grid-column: 2; color: var(--lm-muted); font-size: .74rem; line-height: 1.3; }\n.lm-select { display: grid; gap: 4px; font-size: .84rem; }\n.lm-select select { width: 100%; min-width: 0; font: 400 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 5px; padding: 5px 8px; }\n.lm-off { opacity: .45; cursor: default; }\n\n.lm-facts { margin: 0; padding-left: 1.1em; font-size: .88rem; columns: 2; column-gap: 28px; }\n@container (max-width: 860px) { .lm-facts { columns: 1; } }\n.lm-facts li { margin-bottom: 8px; break-inside: avoid; }\n.lm-prov { font: 600 .66rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; }\n.lm-prov[data-kind=\"measured\"] { color: var(--lm-ok); } .lm-prov[data-kind=\"estimated\"] { color: var(--lm-warn); }\n.lm-prov[data-kind=\"configured\"] { color: var(--lm-accent); }\n\n/* scenario identity colours (s1–s4) are checked for colour-blind separation on both surfaces; text never wears them */\n.lm-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }\n.lm-scenarios legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin-right: 6px; padding: 0; }\n.lm-scenarios button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-scenarios button[aria-pressed=\"true\"] { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-scenarios i, .lm-table i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }\n.lm-story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; padding: 8px 12px; border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-accent); border-radius: 6px; background: var(--lm-surface); }\n.lm-story legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); padding: 0; }\n.lm-story p { flex: 1 1 240px; display: grid; margin: 0; font: 400 .9rem/1.4 var(--lm-font); color: var(--lm-fg); }\n.lm-story p > span { grid-area: 1 / 1; }\n.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.lm-story p > span:not([data-shown]), .lm-story em:not([data-shown]) { visibility: hidden; }\n.lm-story-progress { display: flex; align-items: center; gap: 4px; }\n.lm-story-progress i { position: relative; width: 28px; height: 4px; border-radius: 2px; background: var(--lm-line); overflow: hidden; }\n.lm-story-progress i[data-state=\"done\"], .lm-story:not([data-playing]) .lm-story-progress i[data-state=\"now\"] { background: var(--lm-accent); }\n.lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { content: \"\"; position: absolute; inset: 0; background: var(--lm-accent); transform-origin: left; animation: lm-step var(--lm-step) linear both; }\n@keyframes lm-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n.lm-story b { font-weight: 600; color: var(--lm-muted); margin-right: 4px; white-space: nowrap; }\n.lm-story-nav { display: flex; gap: 6px; }\n.lm-story em { color: var(--lm-muted); }\n.lm-story button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-story button[aria-disabled=\"true\"] { opacity: .45; cursor: default; }\n.lm-own { font-size: .78rem; color: var(--lm-muted); }\n\n/* the scenarios and the load over the board, in view while the page scrolls; on a phone under the board */\n.lm-loadbar { position: sticky; top: var(--lm-sticky-top, 0px); z-index: 3; container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 6px 12px 2px; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; box-shadow: 0 4px 14px -10px rgb(0 0 0 / .4); }\n.lm-loadbar .lm-scenarios { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding: 2px; }\n.lm-loadbar .lm-scenarios button { flex: none; white-space: nowrap; }\n.lm-loadbar .lm-load { flex: 1 1 300px; }\n@container (min-width: 720px) {\n .lm-loadbar .lm-load { grid-template: \"label track value\" / minmax(0, max-content) minmax(160px, 1fr) auto; align-items: start; }\n .lm-loadbar .lm-load > label { max-width: 14em; padding-top: 6px; }\n}\n@container (max-width: 520px) {\n .lm:not([data-full]) > .lm-loadbar { order: 1; top: auto; bottom: 0; }\n .lm:not([data-full]) > .lm-side { order: 2; }\n}\n/* the load: its label and value, the track under them, the marks under it */\n.lm-load { display: grid; grid-template: \"label value\" \"track track\" / minmax(0, 1fr) auto; align-items: center; gap: 0 12px; font-size: .84rem; min-width: 0; }\n.lm-load > label { grid-area: label; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-load > output { grid-area: value; text-align: right; font: 600 .95rem/1.2 var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-load small { display: block; font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-load-track { grid-area: track; position: relative; min-width: 0; padding-bottom: 22px; }\n.lm-load input { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--lm-accent); cursor: pointer; }\n.lm-zones, .lm-marks { position: absolute; left: 8px; right: 8px; top: 30px; }\n.lm-zones { height: 4px; border-radius: 2px; }\n.lm-marks button { position: absolute; top: 0; transform: translateX(-50%); min-width: 20px; height: 24px; padding: 7px 2px 0; border: 0; background: none; font: 500 .68rem var(--lm-mono); color: var(--lm-accent); white-space: nowrap; cursor: pointer; }\n.lm-marks button::before { content: \"\"; position: absolute; left: 50%; top: 0; width: 2px; height: 6px; margin-left: -1px; background: currentColor; }\n.lm-marks button:not([data-label]) span { display: none; }\n.lm-marks [data-kind=\"target\"] { color: var(--lm-warn); }\n.lm-marks [data-kind=\"full\"] { color: var(--lm-drop); }\n.lm-marks [aria-pressed=\"true\"] { font-weight: 700; text-decoration: underline; }\n.lm-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; margin-right: 6px; }\n\n.lm-compare-text { margin: 0; }\n.lm-table-wrap { overflow-x: auto; }\n.lm-table { border-collapse: collapse; width: 100%; font-size: .84rem; }\n.lm-table th, .lm-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--lm-line); vertical-align: top; }\n.lm-table thead th { font: 600 .7rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; color: var(--lm-muted); }\n.lm-table tbody th { font-weight: 600; white-space: nowrap; }\n.lm-table td { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-table td.lm-text { font-family: var(--lm-font); }\n.lm-table td small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-table tr[aria-current] th { text-decoration: underline; text-underline-offset: 3px; }\n\n.lm-chart { position: relative; min-width: 0; }\n.lm-chart svg { display: block; overflow: visible; }\n.lm-chart:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-axis, .lm-axis text { font: 400 11px var(--lm-mono); fill: var(--lm-muted); }\n.lm-mark { font: 600 11px var(--lm-mono); fill: var(--lm-fg); }\n.lm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; width: max-content; max-width: min(17rem, calc(100% - 8px)); overflow-wrap: anywhere; padding: 8px 10px; font-size: .78rem; background: var(--lm-surface); color: var(--lm-fg); border: 1px solid var(--lm-line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .14); pointer-events: none; }\n.lm-tip strong { font: 600 .82rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-tip .lm-sub { color: var(--lm-muted); }\n.lm-nowrap { white-space: nowrap; }\n.lm-node { cursor: pointer; outline: none; }\n.lm-node:focus-visible > :first-child { stroke-width: 3; }\n\n@media (prefers-reduced-motion: reduce) {\n .lm-fill { transition: none; }\n .lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { animation: none; transform: none; }\n}\n";
|
|
114
|
+
export declare const LOADMAP_CSS = "\n.lm { \n --lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;\n --lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;\n --lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;\n --lm-tier: #f3f6f9; --lm-tier-head: #e4eaf0; --lm-tier-fg: #34424f; --lm-tier-line: #c6d0da;\n --lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;\n --lm-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --lm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font: 14px/1.45 var(--lm-font); color: var(--lm-fg); background: var(--lm-root-bg, var(--lm-bg));\n display: grid; gap: 14px; padding: var(--lm-pad, 16px); min-width: 0; box-sizing: border-box; }\n@media (prefers-color-scheme: dark) { .lm:not([data-theme=\"light\"]) { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-tier: #1a2530; --lm-tier-head: #22303d; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; } }\n.lm[data-theme=\"dark\"] { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-tier: #1a2530; --lm-tier-head: #22303d; --lm-tier-fg: #c3cfda; --lm-tier-line: #33424f;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; }\n.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }\n.lm h2 { font-size: 1.3rem; font-weight: 600; margin: 0; text-wrap: balance; }\n.lm h3 { font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin: 0; }\n.lm button:focus-visible, .lm input:focus-visible, .lm select:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-problems { margin: 0; padding: 10px 12px; font: .8rem/1.5 var(--lm-mono); white-space: pre-wrap; overflow-x: auto; color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-drop); border-radius: 6px; }\n.lm-note { margin: 0; font-size: .8rem; color: var(--lm-muted); }\n.lm-card { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }\n\n.lm-wrap { display: grid; gap: 8px; min-width: 0; position: relative; }\n.lm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }\n.lm-btn { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }\n.lm-board { position: relative; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; overflow: hidden; margin: 0 auto; width: 100%; }\n.lm-board svg { display: block; width: 100%; height: auto; font-family: var(--lm-font); }\n.lm-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }\n/* the story's title over the board while it plays: a lower third, at the top when what is framed is low; a strip\n across the top of a narrow board */\n.lm-title { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: grid; gap: 1px; max-width: min(34rem, calc(100% - 24px)); padding: 7px 12px 8px; border-left: 4px solid var(--lm-accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--lm-surface) 92%, transparent); box-shadow: 0 4px 16px rgb(0 0 0 / .12); pointer-events: none; overflow-wrap: anywhere; }\n.lm-title[data-top] { top: 12px; bottom: auto; }\n.lm-title b { font-size: .95rem; font-weight: 600; }\n.lm-title span { font: 500 .8rem var(--lm-mono); color: var(--lm-muted); }\n@container (max-width: 520px) {\n .lm-title, .lm-title[data-top] { top: 0; right: 0; bottom: auto; left: 0; max-width: none; padding: 4px 8px; border-radius: 0; box-shadow: none; }\n .lm-title b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .lm-title span { display: none; }\n}\n.lm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--lm-muted); }\n.lm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }\n\n/* full screen (the browser's, or a fixed overlay): a column that never scrolls. The diagram as wide as the screen on\n top; under it the verdict in a line and the panels, compact, in a dock the screen sizes. The load changes what is\n in them, never their size, so it never moves the board. Focus: the diagram, the story, the verdict and the load */\n.lm-side, .lm-card > .lm-panel { display: contents; }\n.lm-panel { display: grid; gap: 14px; min-width: 0; }\n.lm[data-full] { height: 100vh; height: 100dvh; padding: 16px; background: var(--lm-bg); overflow: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; position: relative; }\n.lm[data-full=\"fill\"] { height: 100%; padding: 10px; }\n.lm[data-full=\"overlay\"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }\n.lm[data-full] > * { flex: none; }\n/* a page of its own keeps the rest outside full screen, as <Loadmap> does */\n.lm[data-full] > :not(.lm-head, h2, .lm-scenarios, .lm-loadbar, .lm-story, .lm-wrap, .lm-line, .lm-dock, .lm-side) { display: none; }\n.lm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }\n.lm-head h2 { font-size: 1.1rem; }\n.lm-head .lm-loadbar { flex: 1 1 520px; }\n.lm[data-full] .lm-wrap { gap: 6px; }\n/* the board as large as fits (--lm-fit, from Diagram), left under the bar, so the legend starts where the board does */\n.lm[data-full] .lm-board { width: var(--lm-fit, 100%); margin: 0; align-self: start; justify-self: start; }\n.lm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.lm-modes { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--lm-line); border-radius: 6px; overflow: hidden; }\n.lm-modes button { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 0; padding: 6px 12px; cursor: pointer; }\n.lm-modes button[aria-pressed=\"true\"] { background: var(--lm-fg); color: var(--lm-surface); }\n.lm[data-full] .lm-story { padding: 6px 12px; }\n.lm[data-full] [data-out] { display: none; }\n\n.lm-line { display: flex; align-items: center; gap: 6px 14px; min-width: 0; padding: 6px 12px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-line[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-line[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-headline { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-num { font: 600 .95em var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-link { font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: none; border: 0; padding: 2px 4px; cursor: pointer; white-space: nowrap; }\n\n.lm-dock { display: flex; gap: 10px; min-width: 0; }\n.lm[data-full] > .lm-dock { flex: 1 1 0; min-height: clamp(200px, 26dvh, 340px); }\n.lm-tabs { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }\n.lm-mini { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; display: grid; container-type: inline-size; }\n.lm-mini[data-mini=\"controls\"] { flex-grow: 1.25; }\n.lm-mini[data-mini=\"limits\"] { flex-grow: 1.45; }\n.lm-mini[data-mini=\"live\"] { flex-grow: .8; }\n.lm-mini[data-mini=\"headroom\"] { flex-grow: .9; }\n.lm-mini[data-mini=\"compare\"] { flex-grow: 1.3; }\n.lm-mini > .lm-card { min-height: 0; overflow: hidden; padding: 10px 12px; gap: 6px; align-content: start; }\n.lm-mini [data-clip] { visibility: hidden; }\n.lm-more { position: absolute; top: 6px; right: 6px; font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: var(--lm-surface); border: 0; border-radius: 4px; padding: 2px 6px; cursor: pointer; }\n.lm-more[data-more]:not([data-more=\"\"])::before { content: attr(data-more) \" \"; }\n.lm-mini .lm-meters { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; }\n.lm-mini .lm-meter { display: flex; align-items: baseline; gap: 8px; padding: 3px 8px; }\n.lm-mini .lm-meter b { flex: none; font-size: .9rem; }\n.lm-mini .lm-meter span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n/* one grid for every row, so the bars line up whatever the names */\n.lm-mini-limits { display: grid; grid-template-columns: minmax(0, max-content) minmax(48px, 1fr) auto auto; gap: 6px 10px; }\n.lm-mini-lim { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; font-size: .8rem; }\n.lm-mini-lim .lm-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-mini-lim .lm-tag { margin-left: 5px; }\n.lm-mini-lim .lm-track { height: 9px; }\n.lm-mini-lim .lm-val { white-space: nowrap; }\n.lm-mini-lim .lm-sub { font: 400 .74rem var(--lm-mono); color: var(--lm-muted); }\n.lm-mini .lm-controls { gap: 6px; column-gap: 16px; }\n.lm-mini .lm-controls small, .lm-mini .lm-controls > h3:not(:first-child) { display: none; }\n.lm-mini .lm-controls label.lm-range { grid-template-columns: minmax(0, 1fr) minmax(90px, 1.2fr); align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select select { width: auto; padding: 1px 6px; font-size: .78rem; }\n.lm-mini .lm-switch { font-size: .8rem; }\n.lm-mini .lm-switch input { margin-top: 2px; }\n.lm-mini .lm-presets { gap: 4px; }\n.lm-mini .lm-presets button { padding: 2px 8px; font-size: .72rem; }\n@container (min-width: 420px) {\n .lm-mini .lm-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .lm-mini .lm-controls > :is(h3, .lm-presets) { grid-column: 1 / -1; }\n}\n.lm-mini .lm-compare > :not(h3:first-child, .lm-table-wrap:nth-child(3)) { display: none; }\n.lm-mini .lm-table { font-size: .76rem; }\n.lm-mini .lm-table th, .lm-mini .lm-table td { padding: 3px 8px 3px 0; }\n.lm-mini .lm-table small { display: none; }\n.lm-mini .lm-table thead th { white-space: nowrap; font-size: .6rem; }\n.lm-mini > .lm-card:has(> .lm-spark) { grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; }\n.lm-spark { position: relative; min-height: 0; }\n.lm-spark svg { position: absolute; inset: 0; display: block; overflow: hidden; }\n.lm-spark-th { stroke: var(--lm-muted); stroke-dasharray: 4 3; }\n.lm-spark-load { stroke: var(--lm-fg); opacity: .45; }\n.lm-spark-text { margin: 0; font-size: .76rem; color: var(--lm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n\n/* the drawer: the page's own panel, alone, over the right of the board */\n.lm[data-full] > .lm-drawer:not([data-drawer]) { display: none; }\n.lm[data-full] > .lm-drawer[data-drawer] { display: grid; gap: 14px; align-content: start; position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 4; width: min(640px, calc(100% - 32px)); overflow: auto; overscroll-behavior: contain; padding: 14px; background: var(--lm-bg); border: 1px solid var(--lm-line); border-radius: 10px; box-shadow: -8px 0 30px rgb(0 0 0 / .2); container-type: inline-size; }\n.lm-side[data-drawer] :is(.lm-panel, .lm-strip, .lm-charts, .lm-card):not([data-drawn]):not(.lm-panel *) { display: none; }\n.lm-side[data-drawer] .lm-strip { grid-template-columns: minmax(0, 1fr); }\n.lm-drawer-bar { display: flex; justify-content: flex-end; }\n\n/* a page of its own: its .lm-side is a box under the board that scrolls on its own, the board as large as leaves it a\n third of the screen */\n.lm[data-full] > .lm-side:not(.lm-drawer) { display: grid; gap: 14px; align-content: start; flex: 1 1 0; min-height: 33dvh; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n\n/* focus: the board and what runs on it in the middle of the screen */\n.lm[data-mode=\"focus\"] > .lm-side:not(.lm-drawer) { display: none; }\n.lm[data-mode=\"focus\"] > .lm-wrap { margin-top: auto; }\n.lm[data-mode=\"focus\"] > :is(.lm-story, .lm-line) { order: 1; }\n.lm[data-mode=\"focus\"]::after { content: \"\"; order: 2; margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { border-left-width: 4px; padding: 10px 14px; }\n.lm[data-mode=\"focus\"] > .lm-story p { font-size: 1.1rem; }\n\n@media (max-width: 760px) {\n .lm[data-full] { padding: 10px; gap: 8px; }\n /* the page has the title, and the legend: here they would leave the diagram no room */\n .lm[data-full] > h2, .lm[data-full] :is(.lm-head h2, .lm-legend, .lm-story legend) { display: none; }\n /* the one exception: here the diagram runs top to bottom, and shrunk to the screen it is too small to read, so it\n pans in a box of its own with the bar on top. The page never scrolls */\n .lm[data-full] .lm-board { width: 100%; }\n .lm[data-full] > .lm-wrap { height: 40dvh; overflow: auto; row-gap: 0; overscroll-behavior: contain; }\n .lm[data-mode=\"focus\"] > .lm-wrap { height: auto; flex: 1 1 0; min-height: 0; margin-top: 0; }\n .lm[data-full] .lm-bar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: var(--lm-bg); }\n .lm[data-full] .lm-line { flex-wrap: wrap; }\n .lm[data-full] > .lm-story { padding: 6px 10px; gap: 6px 10px; }\n .lm[data-full] > .lm-story p { font-size: .84rem; }\n .lm[data-full] .lm-story button { padding: 4px 10px; }\n .lm[data-full] .lm-headline { flex-basis: 100%; }\n .lm-dock { flex-direction: column; min-height: 0; gap: 6px; }\n /* the load bar takes some of the dock's room: the load is no longer in a card */\n .lm[data-full] > .lm-dock { min-height: clamp(170px, 22dvh, 340px); }\n .lm-tabs { display: flex; flex: none; gap: 2px; border-bottom: 1px solid var(--lm-line); overflow: hidden; }\n .lm-tabs button { font: 500 .78rem var(--lm-font); color: var(--lm-muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 8px; cursor: pointer; white-space: nowrap; }\n .lm-tabs button[aria-pressed=\"true\"] { color: var(--lm-fg); border-color: var(--lm-fg); }\n .lm-mini:not([data-active]) { display: none; }\n .lm[data-full] > .lm-side[data-drawer] { inset: 8px; width: auto; }\n /* the load in thumb reach: the bar under the board and the story, over the verdict */\n .lm[data-full] .lm-head { display: contents; }\n .lm[data-full] .lm-loadbar { order: 2; flex: none; }\n /* two lines, so the board keeps its room: the scenarios and the load's value, then the track; the label names the\n slider unseen */\n .lm[data-full] .lm-load small { display: none; }\n .lm[data-full] .lm-load { display: contents; }\n .lm[data-full] :is(.lm-loadbar legend, .lm-load > label) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n .lm[data-full] .lm-load > output { margin-left: auto; }\n .lm[data-full] .lm-load-track { flex: 1 1 100%; }\n .lm[data-full] > :is(.lm-line, .lm-dock) { order: 3; }\n}\n\n.lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-measure { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }\n\n.lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }\n@container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }\n.lm { container-type: inline-size; }\n\n.lm-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }\n.lm-meter { padding: 8px 10px; border-radius: 6px; background: var(--lm-bg); min-width: 0; }\n.lm-meter b { display: block; font: 500 1.15rem var(--lm-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-meter span { font-size: .74rem; color: var(--lm-muted); }\n.lm-meter[data-state=\"warn\"] b { color: var(--lm-warn); } .lm-meter[data-state=\"over\"] b { color: var(--lm-drop); }\n\n.lm-limits { display: grid; gap: 10px; }\n.lm-lim, .lm-scale { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 10rem; gap: 4px 14px; align-items: center; }\n@container (max-width: 640px) { .lm-lim, .lm-scale { grid-template-columns: minmax(0, 1fr); } .lm-scale > :first-child, .lm-scale > :last-child { display: none; } }\n.lm-lim b { display: block; font-weight: 600; font-size: .88rem; }\n.lm-lim .lm-sub { display: block; font-size: .74rem; color: var(--lm-muted); }\n.lm-tag { font: 600 .64rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }\n.lm-tag[data-kind=\"first\"] { color: var(--lm-surface); background: var(--lm-drop); }\n.lm-tag[data-kind=\"estimated\"] { color: var(--lm-warn); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"range\"], .lm-tag[data-kind=\"rank\"] { color: var(--lm-muted); border: 1px solid currentColor; }\n.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }\n.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }\n.lm-fill[data-state=\"warn\"] { background: var(--lm-warn); } .lm-fill[data-state=\"over\"] { background: var(--lm-drop); }\n.lm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lm-fg); opacity: .55; }\n.lm-val { font: 500 .8rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-val small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-scale { font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-scale div { position: relative; height: 12px; }\n.lm-scale div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }\n\n.lm-controls label.lm-range { display: grid; gap: 4px; font-size: .84rem; }\n.lm-controls label.lm-range > span { display: flex; justify-content: space-between; gap: 8px; }\n.lm-controls output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-controls input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.lm-presets button { font: 500 .76rem var(--lm-font); background: var(--lm-accent-soft); color: var(--lm-fg); border: 1px solid transparent; border-radius: 5px; padding: 5px 10px; cursor: pointer; }\n.lm-presets button[aria-pressed=\"true\"] { border-color: var(--lm-accent); }\n.lm-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: .84rem; cursor: pointer; }\n.lm-switch input { margin: 3px 0 0; accent-color: var(--lm-accent); }\n.lm-switch small, .lm-select small { grid-column: 2; color: var(--lm-muted); font-size: .74rem; line-height: 1.3; }\n.lm-select { display: grid; gap: 4px; font-size: .84rem; }\n.lm-select select { width: 100%; min-width: 0; font: 400 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 5px; padding: 5px 8px; }\n.lm-off { opacity: .45; cursor: default; }\n\n.lm-facts { margin: 0; padding-left: 1.1em; font-size: .88rem; columns: 2; column-gap: 28px; }\n@container (max-width: 860px) { .lm-facts { columns: 1; } }\n.lm-facts li { margin-bottom: 8px; break-inside: avoid; }\n.lm-prov { font: 600 .66rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; }\n.lm-prov[data-kind=\"measured\"] { color: var(--lm-ok); } .lm-prov[data-kind=\"estimated\"] { color: var(--lm-warn); }\n.lm-prov[data-kind=\"configured\"] { color: var(--lm-accent); }\n\n/* scenario identity colours (s1–s4) are checked for colour-blind separation on both surfaces; text never wears them */\n.lm-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }\n.lm-scenarios legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin-right: 6px; padding: 0; }\n.lm-scenarios button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-scenarios button[aria-pressed=\"true\"] { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-scenarios i, .lm-table i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }\n.lm-story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; padding: 8px 12px; border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-accent); border-radius: 6px; background: var(--lm-surface); }\n.lm-story legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); padding: 0; }\n.lm-story p { flex: 1 1 240px; display: grid; margin: 0; font: 400 .9rem/1.4 var(--lm-font); color: var(--lm-fg); }\n.lm-story p > span { grid-area: 1 / 1; }\n.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.lm-story p > span:not([data-shown]), .lm-story em:not([data-shown]) { visibility: hidden; }\n.lm-story-progress { display: flex; align-items: center; gap: 4px; }\n.lm-story-progress i { position: relative; width: 28px; height: 4px; border-radius: 2px; background: var(--lm-line); overflow: hidden; }\n.lm-story-progress i[data-state=\"done\"], .lm-story:not([data-playing]) .lm-story-progress i[data-state=\"now\"] { background: var(--lm-accent); }\n.lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { content: \"\"; position: absolute; inset: 0; background: var(--lm-accent); transform-origin: left; animation: lm-step var(--lm-step) linear both; }\n@keyframes lm-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n.lm-story b { font-weight: 600; color: var(--lm-muted); margin-right: 4px; white-space: nowrap; }\n.lm-story-nav { display: flex; gap: 6px; }\n.lm-story em { color: var(--lm-muted); }\n.lm-story button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-story button[aria-disabled=\"true\"] { opacity: .45; cursor: default; }\n.lm-own { font-size: .78rem; color: var(--lm-muted); }\n\n/* the scenarios and the load over the board, in view while the page scrolls; on a phone under the board */\n.lm-loadbar { position: sticky; top: var(--lm-sticky-top, 0px); z-index: 3; container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 6px 12px 2px; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; box-shadow: 0 4px 14px -10px rgb(0 0 0 / .4); }\n.lm-loadbar .lm-scenarios { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding: 2px; }\n.lm-loadbar .lm-scenarios button { flex: none; white-space: nowrap; }\n.lm-loadbar .lm-load { flex: 1 1 300px; }\n@container (min-width: 720px) {\n .lm-loadbar .lm-load { grid-template: \"label track value\" / minmax(0, max-content) minmax(160px, 1fr) auto; align-items: start; }\n .lm-loadbar .lm-load > label { max-width: 14em; padding-top: 6px; }\n}\n@container (max-width: 520px) {\n .lm:not([data-full]) > .lm-loadbar { order: 1; top: auto; bottom: 0; }\n .lm:not([data-full]) > .lm-side { order: 2; }\n}\n/* the load: its label and value, the track under them, the marks under it */\n.lm-load { display: grid; grid-template: \"label value\" \"track track\" / minmax(0, 1fr) auto; align-items: center; gap: 0 12px; font-size: .84rem; min-width: 0; }\n.lm-load > label { grid-area: label; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-load > output { grid-area: value; text-align: right; font: 600 .95rem/1.2 var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-load small { display: block; font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-load-track { grid-area: track; position: relative; min-width: 0; padding-bottom: 22px; }\n.lm-load input { display: block; width: 100%; height: 32px; margin: 0; accent-color: var(--lm-accent); cursor: pointer; }\n.lm-zones, .lm-marks { position: absolute; left: 8px; right: 8px; top: 30px; }\n.lm-zones { height: 4px; border-radius: 2px; }\n.lm-marks button { position: absolute; top: 0; transform: translateX(-50%); min-width: 20px; height: 24px; padding: 7px 2px 0; border: 0; background: none; font: 500 .68rem var(--lm-mono); color: var(--lm-accent); white-space: nowrap; cursor: pointer; }\n.lm-marks button::before { content: \"\"; position: absolute; left: 50%; top: 0; width: 2px; height: 6px; margin-left: -1px; background: currentColor; }\n.lm-marks button:not([data-label]) span { display: none; }\n.lm-marks [data-kind=\"target\"] { color: var(--lm-warn); }\n.lm-marks [data-kind=\"full\"] { color: var(--lm-drop); }\n.lm-marks [aria-pressed=\"true\"] { font-weight: 700; text-decoration: underline; }\n.lm-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; margin-right: 6px; }\n\n.lm-compare-text { margin: 0; }\n.lm-table-wrap { overflow-x: auto; }\n.lm-table { border-collapse: collapse; width: 100%; font-size: .84rem; }\n.lm-table th, .lm-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--lm-line); vertical-align: top; }\n.lm-table thead th { font: 600 .7rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; color: var(--lm-muted); }\n.lm-table tbody th { font-weight: 600; white-space: nowrap; }\n.lm-table td { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-table td.lm-text { font-family: var(--lm-font); }\n.lm-table td small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-table tr[aria-current] th { text-decoration: underline; text-underline-offset: 3px; }\n\n.lm-chart { position: relative; min-width: 0; }\n.lm-chart svg { display: block; overflow: visible; }\n.lm-chart:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-axis, .lm-axis text { font: 400 11px var(--lm-mono); fill: var(--lm-muted); }\n.lm-mark { font: 600 11px var(--lm-mono); fill: var(--lm-fg); }\n.lm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; width: max-content; max-width: min(17rem, calc(100% - 8px)); overflow-wrap: anywhere; padding: 8px 10px; font-size: .78rem; background: var(--lm-surface); color: var(--lm-fg); border: 1px solid var(--lm-line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .14); pointer-events: none; }\n.lm-tip strong { font: 600 .82rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-tip .lm-sub { color: var(--lm-muted); }\n.lm-nowrap { white-space: nowrap; }\n.lm-node { cursor: pointer; outline: none; }\n.lm-node:focus-visible > :first-child { stroke-width: 3; }\n\n@media (prefers-reduced-motion: reduce) {\n .lm-fill { transition: none; }\n .lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { animation: none; transform: none; }\n}\n";
|
|
115
115
|
/** Adds the stylesheet once per document. */
|
|
116
116
|
export declare function injectStyles(doc?: Document): void;
|
|
117
117
|
export { type AnyNodeDef, type ClusterDef, type Cue, type DiagramProps, type Dot, type EdgeDef, type ElkEngine, type Engine, type FlowColor, type FlowView, type FullScreenMode, LOADMAP_PANELS, type Label, Loadmap, type LoadmapController, type LoadmapHandle, type LoadmapOptions, type LoadmapPanel, type LoadmapProps, LoadmapRoot, type NodeDef, type PoolDef, type Theme, type TierDef, type View, type ViewDef, cluster, compact, defineView, directionOf, edge, fitLinear, fmt, handleOf, multiple, node, pct, pool, secs, useLoadmap, usePageTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Diagram, E as workerElk, S as useComparison, a as usePageTheme, b as Scenarios, c as injectStyles, d as Controls, f as Limits, g as Verdict, h as Meters, i as handleOf, l as Story, m as LoadRange, n as Loadmap, o as useLoadmap, p as LoadBar, r as LoadmapRoot, s as LOADMAP_CSS, t as LOADMAP_PANELS, u as Assumptions, v as Compare, x as scenarioColor, y as HeadroomChart } from "./Loadmap-
|
|
1
|
+
import { D as Diagram, E as workerElk, S as useComparison, a as usePageTheme, b as Scenarios, c as injectStyles, d as Controls, f as Limits, g as Verdict, h as Meters, i as handleOf, l as Story, m as LoadRange, n as Loadmap, o as useLoadmap, p as LoadBar, r as LoadmapRoot, s as LOADMAP_CSS, t as LOADMAP_PANELS, u as Assumptions, v as Compare, x as scenarioColor, y as HeadroomChart } from "./Loadmap-Rla4011L.js";
|
|
2
2
|
import { fitLinear } from "@loadmap/core/calibrate";
|
|
3
3
|
import { compact, fmt, multiple, pct, secs } from "@loadmap/core/format";
|
|
4
4
|
import { cluster, defineView, directionOf, edge, node, pool } from "@loadmap/layout";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as useHeadroom, O as boxComponent, S as useComparison, T as whenRange, _ as plusMinus, d as Controls, h as Meters, k as rankLabels, v as Compare, w as useSize, x as scenarioColor } from "./Loadmap-
|
|
1
|
+
import { C as useHeadroom, O as boxComponent, S as useComparison, T as whenRange, _ as plusMinus, d as Controls, h as Meters, k as rankLabels, v as Compare, w as useSize, x as scenarioColor } from "./Loadmap-Rla4011L.js";
|
|
2
2
|
import { reach } from "@loadmap/core";
|
|
3
3
|
import { compact, fmt, multiple, multiples, pct } from "@loadmap/core/format";
|
|
4
4
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
package/dist/source.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as LoadmapProps } from "./Loadmap-
|
|
1
|
+
import { a as LoadmapProps } from "./Loadmap-CBHK-gaN.js";
|
|
2
2
|
import { CompileOptions } from "@loadmap/dsl";
|
|
3
3
|
export interface LoadmapSourceProps extends Omit<LoadmapProps<any>, 'model' | 'view'> {
|
|
4
4
|
/** The `.loadmap` text. Compiled again when its tokens change: spaces, line breaks and comments change nothing. */
|
package/dist/source.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as usePageTheme, c as injectStyles, n as Loadmap } from "./Loadmap-
|
|
1
|
+
import { a as usePageTheme, c as injectStyles, n as Loadmap } from "./Loadmap-Rla4011L.js";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { compile, formatDiagnostic, sharedValues } from "@loadmap/dsl";
|
|
@@ -121,12 +121,50 @@ function cameraOf(v, scene, fit, vp) {
|
|
|
121
121
|
h
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
/**
|
|
125
|
-
function
|
|
124
|
+
/** Whether `r` (a part of the scene) shows whole in the free part. */
|
|
125
|
+
function seen(v, vp, r) {
|
|
126
126
|
const f = free(vp);
|
|
127
127
|
const left = vp.w / 2 + (r.x - v.x) * v.k;
|
|
128
128
|
const top = vp.h / 2 + (r.y - v.y) * v.k;
|
|
129
|
-
return left >= f.x && top >= f.y && left + r.w * v.k <= f.x + f.w && top + r.h * v.k <= f.y + f.h
|
|
129
|
+
return left >= f.x && top >= f.y && left + r.w * v.k <= f.x + f.w && top + r.h * v.k <= f.y + f.h;
|
|
130
|
+
}
|
|
131
|
+
/** The view that brings `r` (a box) into the middle of the free part at the same scale; null when it shows whole. */
|
|
132
|
+
function bring(v, vp, r) {
|
|
133
|
+
const f = free(vp);
|
|
134
|
+
return seen(v, vp, r) ? null : at(r.x + r.w / 2, r.y + r.h / 2, f.x + f.w / 2, f.y + f.h / 2, v.k, vp);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The box `v` holds on to as the diagram moves from `from` to `to`: of the boxes in both, the one nearest the middle of
|
|
138
|
+
* the free part, and the view's centre from that box's centre. Null when no box stays.
|
|
139
|
+
*/
|
|
140
|
+
function anchorOf(v, vp, from, to) {
|
|
141
|
+
const f = free(vp);
|
|
142
|
+
const c = toScene(v, vp, f.x + f.w / 2, f.y + f.h / 2);
|
|
143
|
+
const stays = new Set(to.nodes.map((n) => n.id));
|
|
144
|
+
let best = null;
|
|
145
|
+
let near = {
|
|
146
|
+
out: Number.POSITIVE_INFINITY,
|
|
147
|
+
mid: Number.POSITIVE_INFINITY
|
|
148
|
+
};
|
|
149
|
+
for (const n of from.nodes) {
|
|
150
|
+
if (!stays.has(n.id) || n.fade != null) continue;
|
|
151
|
+
const cx = n.x + n.w / 2;
|
|
152
|
+
const cy = n.y + n.h / 2;
|
|
153
|
+
const out = Math.hypot(Math.max(0, Math.abs(c.x - cx) - n.w / 2), Math.max(0, Math.abs(c.y - cy) - n.h / 2));
|
|
154
|
+
const mid = Math.hypot(c.x - cx, c.y - cy);
|
|
155
|
+
if (out < near.out || out === near.out && mid < near.mid) {
|
|
156
|
+
near = {
|
|
157
|
+
out,
|
|
158
|
+
mid
|
|
159
|
+
};
|
|
160
|
+
best = {
|
|
161
|
+
id: n.id,
|
|
162
|
+
dx: v.x - cx,
|
|
163
|
+
dy: v.y - cy
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return best;
|
|
130
168
|
}
|
|
131
169
|
/** Where a part of the scene (a viewBox) draws on a board of w × h pixels: scaled to fit and centred, as SVG does. */
|
|
132
170
|
function placement(box, w, h) {
|
|
@@ -153,6 +191,10 @@ const whole = (s) => ({
|
|
|
153
191
|
w: s.width,
|
|
154
192
|
h: s.height
|
|
155
193
|
});
|
|
194
|
+
/** Seconds a jump from a button, a key or `show` takes; reduced motion cuts. */
|
|
195
|
+
const FLIGHT = .2;
|
|
196
|
+
/** Room `show` leaves around the boxes, in scene units: a limit's tag sits above its box. */
|
|
197
|
+
const ROOM = 30;
|
|
156
198
|
/**
|
|
157
199
|
* The reader's view of a board that pans and zooms: the board in pixels with what floats over it, and where the reader
|
|
158
200
|
* has moved. It comes with the code that pans and zooms, so a page that never zooms does not load it; the engine asks
|
|
@@ -163,6 +205,10 @@ var Viewer = class {
|
|
|
163
205
|
viewport;
|
|
164
206
|
/** The reader's view; null keeps the diagram fitted as the board changes. */
|
|
165
207
|
#view = null;
|
|
208
|
+
/** The box the view keeps still while the diagram moves to a new structure, and the view's centre from it. */
|
|
209
|
+
#anchor = null;
|
|
210
|
+
/** The frame a flight asked for next: a new move of the reader's takes over from it. */
|
|
211
|
+
#flight = 0;
|
|
166
212
|
constructor(engine, viewport) {
|
|
167
213
|
this.engine = engine;
|
|
168
214
|
this.viewport = viewport;
|
|
@@ -188,7 +234,28 @@ var Viewer = class {
|
|
|
188
234
|
const fit = this.fit();
|
|
189
235
|
const c = this.engine.camera;
|
|
190
236
|
if (!fit) return null;
|
|
191
|
-
return c ? shot(c, this.engine.frame, fit, this.viewport) : this.#
|
|
237
|
+
return c ? shot(c, this.engine.frame, fit, this.viewport) : this.#on(this.engine.frame, fit) ?? fit;
|
|
238
|
+
}
|
|
239
|
+
/** The reader's view on frame `f`: where the box it holds is in it, when it holds one. */
|
|
240
|
+
#on(f, fit) {
|
|
241
|
+
const a = this.#anchor;
|
|
242
|
+
const v = this.#view;
|
|
243
|
+
const n = a && v && f.nodes.find((x) => x.id === a.id);
|
|
244
|
+
return n ? clamp({
|
|
245
|
+
x: n.x + n.w / 2 + a.dx,
|
|
246
|
+
y: n.y + n.h / 2 + a.dy,
|
|
247
|
+
k: v.k
|
|
248
|
+
}, this.viewport, whole(f), range(fit)) : v;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The engine moves from frame `from` to a new structure (a phase, the text edited): the reader's view holds on to
|
|
252
|
+
* the box nearest its middle, keeping it where it is on the board at the same zoom each frame of the move, so what
|
|
253
|
+
* the reader looked at stays under their eyes while the rest moves around it.
|
|
254
|
+
*/
|
|
255
|
+
hold(from, to) {
|
|
256
|
+
const fit = this.fit();
|
|
257
|
+
if (from && fit) this.#view = this.#on(from, fit);
|
|
258
|
+
this.#anchor = this.#view && from && anchorOf(this.#view, this.viewport, from, to);
|
|
192
259
|
}
|
|
193
260
|
/** The zoom's range, in board pixels a scene unit. */
|
|
194
261
|
zoomRange() {
|
|
@@ -203,9 +270,56 @@ var Viewer = class {
|
|
|
203
270
|
const fit = this.fit();
|
|
204
271
|
if (!fit) return;
|
|
205
272
|
if (this.engine.story) this.engine.stopStory({ cut: true });
|
|
206
|
-
|
|
273
|
+
const { frame: f, scene } = this.engine;
|
|
274
|
+
this.#view = v && clamp(v, this.viewport, whole(f), range(fit));
|
|
275
|
+
this.#anchor = this.#view && scene && f !== scene ? anchorOf(this.#view, this.viewport, f, scene) : null;
|
|
207
276
|
this.#show();
|
|
208
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Moves the view to `to` (null: fitted). With `fly` it flies there, on the wall clock (a reader's view is never in a
|
|
280
|
+
* recording); without, and with reduced motion, it is there at once.
|
|
281
|
+
*/
|
|
282
|
+
go(to, fly) {
|
|
283
|
+
this.land();
|
|
284
|
+
const { engine } = this;
|
|
285
|
+
const from = this.shownView();
|
|
286
|
+
const target = to ?? this.fit();
|
|
287
|
+
if (!fly || engine.reducedMotion || !from || !target) {
|
|
288
|
+
this.setView(to);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (engine.playing) this.setView(from);
|
|
292
|
+
const t0 = performance.now();
|
|
293
|
+
const frame = (now) => {
|
|
294
|
+
const t = (now - t0) / 1e3 / FLIGHT;
|
|
295
|
+
if (engine.playing) return;
|
|
296
|
+
this.setView(t >= 1 ? to : towards(from, target, t));
|
|
297
|
+
if (t < 1) this.#flight = requestAnimationFrame(frame);
|
|
298
|
+
};
|
|
299
|
+
this.#flight = requestAnimationFrame(frame);
|
|
300
|
+
}
|
|
301
|
+
/** Ends a flight where it is. */
|
|
302
|
+
land() {
|
|
303
|
+
cancelAnimationFrame(this.#flight);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Brings these boxes into view, flying there: at the same zoom, further out only as far as it takes to show them
|
|
307
|
+
* all. Nothing when they show already: a view the reader never moved shows the whole diagram.
|
|
308
|
+
*/
|
|
309
|
+
show(ids) {
|
|
310
|
+
const v = this.#view && !this.engine.camera && this.shownView();
|
|
311
|
+
const ns = this.engine.frame?.nodes.filter((n) => ids.includes(n.id));
|
|
312
|
+
if (!v || !ns?.length) return;
|
|
313
|
+
const x = Math.min(...ns.map((n) => n.x)) - ROOM;
|
|
314
|
+
const y = Math.min(...ns.map((n) => n.y)) - ROOM;
|
|
315
|
+
const r = {
|
|
316
|
+
x,
|
|
317
|
+
y,
|
|
318
|
+
w: Math.max(...ns.map((n) => n.x + n.w)) + ROOM - x,
|
|
319
|
+
h: Math.max(...ns.map((n) => n.y + n.h)) + ROOM - y
|
|
320
|
+
};
|
|
321
|
+
if (!seen(v, this.viewport, r)) this.go(frame(r, this.viewport, v.k), true);
|
|
322
|
+
}
|
|
209
323
|
/** The part of the scene the board shows now: its viewBox. */
|
|
210
324
|
box() {
|
|
211
325
|
const v = this.shownView();
|
|
@@ -218,9 +332,10 @@ var Viewer = class {
|
|
|
218
332
|
}
|
|
219
333
|
/** Play starts: the camera the first shot flies from, where the reader had moved; the view is the story's now. */
|
|
220
334
|
lead() {
|
|
221
|
-
const v = this.#view;
|
|
335
|
+
const v = this.#view && this.shownView();
|
|
222
336
|
const fit = this.fit();
|
|
223
337
|
this.#view = null;
|
|
338
|
+
this.#anchor = null;
|
|
224
339
|
return v && fit && !this.engine.reducedMotion ? cameraOf(v, this.engine.frame, fit, this.viewport) : void 0;
|
|
225
340
|
}
|
|
226
341
|
/** Paints the dots on the board's canvas where the SVG draws their places: in the board's pixels, then the canvas's. */
|
|
@@ -280,44 +395,6 @@ const ARROW = {
|
|
|
280
395
|
step: 40,
|
|
281
396
|
shift: 200
|
|
282
397
|
};
|
|
283
|
-
/** Seconds a jump from a button or a key takes; reduced motion cuts. */
|
|
284
|
-
const FLIGHT = .2;
|
|
285
|
-
const flights = /* @__PURE__ */ new WeakMap();
|
|
286
|
-
function land(viewer) {
|
|
287
|
-
const raf = flights.get(viewer);
|
|
288
|
-
if (raf != null) cancelAnimationFrame(raf);
|
|
289
|
-
flights.delete(viewer);
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Moves the reader's view to `to` (null: fitted). From a button or a key it flies there, on the wall clock (a reader's
|
|
293
|
-
* view is never in a recording); from a drag or the wheel, and with reduced motion, it is there at once.
|
|
294
|
-
*/
|
|
295
|
-
function goTo(viewer, to, fly) {
|
|
296
|
-
land(viewer);
|
|
297
|
-
const from = viewer.shownView();
|
|
298
|
-
const target = to ?? viewer.fit();
|
|
299
|
-
if (!fly || viewer.engine.reducedMotion || !from || !target) {
|
|
300
|
-
viewer.setView(to);
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
if (viewer.engine.playing) viewer.setView(from);
|
|
304
|
-
const t0 = performance.now();
|
|
305
|
-
const frame = (now) => {
|
|
306
|
-
if (viewer.engine.playing) {
|
|
307
|
-
flights.delete(viewer);
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
const t = (now - t0) / 1e3 / FLIGHT;
|
|
311
|
-
if (t >= 1) {
|
|
312
|
-
flights.delete(viewer);
|
|
313
|
-
viewer.setView(to);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
viewer.setView(towards(from, target, t));
|
|
317
|
-
flights.set(viewer, requestAnimationFrame(frame));
|
|
318
|
-
};
|
|
319
|
-
flights.set(viewer, requestAnimationFrame(frame));
|
|
320
|
-
}
|
|
321
398
|
/** Zooms by `factor` about the middle of the free part of the board. */
|
|
322
399
|
function zoomBy(viewer, factor) {
|
|
323
400
|
const v = viewer.shownView();
|
|
@@ -326,7 +403,7 @@ function zoomBy(viewer, factor) {
|
|
|
326
403
|
if (!v || !vp || !r) return;
|
|
327
404
|
const f = free(vp);
|
|
328
405
|
const k = Math.min(r.max, Math.max(r.min, v.k * factor));
|
|
329
|
-
|
|
406
|
+
viewer.go(zoomAt(v, vp, f.x + f.w / 2, f.y + f.h / 2, k / v.k), true);
|
|
330
407
|
}
|
|
331
408
|
/** The scene at one board pixel a scene unit, about the middle of the free part. */
|
|
332
409
|
function actualSize(viewer) {
|
|
@@ -360,7 +437,7 @@ function attachZoom(board, viewer, o) {
|
|
|
360
437
|
} catch {}
|
|
361
438
|
};
|
|
362
439
|
const move = (to) => {
|
|
363
|
-
land(
|
|
440
|
+
viewer.land();
|
|
364
441
|
viewer.setView(to);
|
|
365
442
|
};
|
|
366
443
|
const touch = () => {
|
|
@@ -454,8 +531,8 @@ function attachZoom(board, viewer, o) {
|
|
|
454
531
|
}[e.key];
|
|
455
532
|
if (e.key === "+" || e.key === "=") zoomBy(viewer, ZOOM_STEP);
|
|
456
533
|
else if (e.key === "-" || e.key === "_") zoomBy(viewer, 1 / ZOOM_STEP);
|
|
457
|
-
else if (e.key === "0")
|
|
458
|
-
else if (pan)
|
|
534
|
+
else if (e.key === "0") viewer.go(null, true);
|
|
535
|
+
else if (pan) viewer.go(panBy(v, pan[0], pan[1]), false);
|
|
459
536
|
else return;
|
|
460
537
|
e.preventDefault();
|
|
461
538
|
};
|
|
@@ -467,7 +544,7 @@ function attachZoom(board, viewer, o) {
|
|
|
467
544
|
const v = viewer.shownView();
|
|
468
545
|
if (!n || !v || !viewer.viewport || viewer.engine.playing) return;
|
|
469
546
|
const to = bring(v, viewer.viewport, n);
|
|
470
|
-
if (to)
|
|
547
|
+
if (to) viewer.go(to, true);
|
|
471
548
|
};
|
|
472
549
|
touch();
|
|
473
550
|
const off = viewer.engine.subscribe(touch);
|
|
@@ -480,7 +557,7 @@ function attachZoom(board, viewer, o) {
|
|
|
480
557
|
board.addEventListener("keydown", key);
|
|
481
558
|
board.addEventListener("focusin", focus);
|
|
482
559
|
return () => {
|
|
483
|
-
land(
|
|
560
|
+
viewer.land();
|
|
484
561
|
off();
|
|
485
562
|
for (const a of [
|
|
486
563
|
"tabindex",
|
|
@@ -600,7 +677,7 @@ function ZoomControls({ engine }) {
|
|
|
600
677
|
type: "button",
|
|
601
678
|
className: "lm-btn",
|
|
602
679
|
"aria-keyshortcuts": "0",
|
|
603
|
-
onClick: () =>
|
|
680
|
+
onClick: () => viewer.go(null, true),
|
|
604
681
|
children: "Fit"
|
|
605
682
|
})
|
|
606
683
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loadmap/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Interactive capacity models for React: an architecture diagram with moving dots, the limits ranked, the verdict, scenarios and headroom.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loadmap",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@loadmap/core": "0.
|
|
39
|
-
"@loadmap/dsl": "0.
|
|
40
|
-
"@loadmap/sim": "0.
|
|
41
|
-
"@loadmap/layout": "0.
|
|
38
|
+
"@loadmap/core": "0.26.0",
|
|
39
|
+
"@loadmap/dsl": "0.26.0",
|
|
40
|
+
"@loadmap/sim": "0.26.0",
|
|
41
|
+
"@loadmap/layout": "0.26.0",
|
|
42
42
|
"elkjs": "^0.12.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|