@loadmap/react 0.9.0 → 0.11.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.
|
@@ -5,25 +5,90 @@ import { memo, useCallback, useEffect, useId, useImperativeHandle, useLayoutEffe
|
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { morph, shapesOf } from "@loadmap/layout/internal";
|
|
7
7
|
import { createSim } from "@loadmap/sim";
|
|
8
|
+
// src/ranks.ts
|
|
9
|
+
/** Badges after the limit: the two next in line. */
|
|
10
|
+
const BADGES = 2;
|
|
11
|
+
const ORDINAL = [
|
|
12
|
+
"",
|
|
13
|
+
"limit",
|
|
14
|
+
"2nd",
|
|
15
|
+
"3rd"
|
|
16
|
+
];
|
|
17
|
+
/** Where a component reaches the target, on the pessimistic edge the ranking uses. */
|
|
18
|
+
const edge = (c) => c.targetRange?.low ?? c.target;
|
|
19
|
+
/**
|
|
20
|
+
* The limit and the next two in line, by component: the multiple at which each reaches the target, the number the
|
|
21
|
+
* headline gives. The next ones only when they reach it within the load's range, so a box far away wears nothing.
|
|
22
|
+
*/
|
|
23
|
+
function rankLabels(ev, model) {
|
|
24
|
+
const out = /* @__PURE__ */ new Map();
|
|
25
|
+
const first = ev.firstLimit;
|
|
26
|
+
if (!first) return out;
|
|
27
|
+
const at = (c) => multiple(edge(c), model.searchMax);
|
|
28
|
+
out.set(first.id, {
|
|
29
|
+
rank: 1,
|
|
30
|
+
text: `LIMIT · ${at(first)}`,
|
|
31
|
+
word: "limit"
|
|
32
|
+
});
|
|
33
|
+
ev.ranked.filter((c) => c !== first && c.util != null).slice(0, BADGES).forEach((c, i) => {
|
|
34
|
+
const x = edge(c);
|
|
35
|
+
if (x == null || !Number.isFinite(x) || x > model.load.max) return;
|
|
36
|
+
const rank = i + 2;
|
|
37
|
+
out.set(c.id, {
|
|
38
|
+
rank,
|
|
39
|
+
text: `${ORDINAL[rank]} · ${at(c)}`,
|
|
40
|
+
word: ORDINAL[rank]
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
const capital = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
46
|
+
/** The limit moves from one component to another between these values. */
|
|
47
|
+
const handsOver = (a, b) => !!a.firstLimit && !!b.firstLimit && a.firstLimit.id !== b.firstLimit.id;
|
|
48
|
+
/**
|
|
49
|
+
* What the story says when a step hands the limit to another component: "API gateway fixed: the worker pool is next,
|
|
50
|
+
* at 10×" when the old limit got further away, else "The push broker overtakes the position consumer: the limit is
|
|
51
|
+
* 18× now". Null when the limit stays.
|
|
52
|
+
*/
|
|
53
|
+
function handoverText(a, b, model) {
|
|
54
|
+
const was = a.firstLimit;
|
|
55
|
+
const now = b.firstLimit;
|
|
56
|
+
if (!was || !now || !handsOver(a, b)) return null;
|
|
57
|
+
const at = multiple(edge(now), model.searchMax);
|
|
58
|
+
const before = edge(was);
|
|
59
|
+
const after = b.components[was.id] ? edge(b.components[was.id]) : null;
|
|
60
|
+
return before != null && (after == null || after > before) ? `${was.name} fixed: ${now.short} ${now.plural ? "are" : "is"} next, at ${at}` : `${capital(now.short)} ${now.plural ? "overtake" : "overtakes"} ${was.short}: the limit is ${at} now`;
|
|
61
|
+
}
|
|
8
62
|
// src/camera.ts
|
|
9
63
|
/**
|
|
10
64
|
* The shots of a story played, in seconds: the whole diagram first, then for each step a flight in to what it changes,
|
|
11
|
-
* a moment close, the change held close, a flight out, and the whole diagram for the step's own seconds.
|
|
12
|
-
* flight
|
|
65
|
+
* a moment close, the change held close, a flight out, and the whole diagram for the step's own seconds. A step that
|
|
66
|
+
* hands the limit to another component adds `hand`: a flight to the new limit (`HAND_FLY`), whose ring then comes in.
|
|
67
|
+
* `back` is the flight out when the reader pauses.
|
|
13
68
|
*/
|
|
14
69
|
const SHOTS = {
|
|
15
70
|
establish: 1.2,
|
|
16
71
|
in: 1,
|
|
17
72
|
close: .5,
|
|
73
|
+
hand: 1.8,
|
|
18
74
|
out: 1,
|
|
19
75
|
back: .4
|
|
20
76
|
};
|
|
21
77
|
/** The change is held close until the structure has moved and settled. */
|
|
22
78
|
const changeSeconds = (transition) => Math.max(1.6, transition + .7);
|
|
23
|
-
/** A step played, from the flight in to the end of its hold on the whole diagram. */
|
|
24
|
-
const stepSeconds = (st, transition) => SHOTS.in + SHOTS.close + changeSeconds(transition) + SHOTS.out + st.seconds;
|
|
25
|
-
/** The whole story played, from the first shot of the whole diagram. */
|
|
26
|
-
|
|
79
|
+
/** A step played, from the flight in to the end of its hold on the whole diagram; `hands` when it moves the limit. */
|
|
80
|
+
const stepSeconds = (st, transition, hands = false) => SHOTS.in + SHOTS.close + changeSeconds(transition) + (hands ? SHOTS.hand : 0) + SHOTS.out + st.seconds;
|
|
81
|
+
/** The whole story played from `start`, the values shown when it starts, from the first shot of the whole diagram. */
|
|
82
|
+
function storySeconds(model, start, transition) {
|
|
83
|
+
let ev = start;
|
|
84
|
+
let t = SHOTS.establish;
|
|
85
|
+
for (const st of model.story) {
|
|
86
|
+
const after = model.evaluate(st.values);
|
|
87
|
+
t += stepSeconds(st, transition, handsOver(ev, after));
|
|
88
|
+
ev = after;
|
|
89
|
+
}
|
|
90
|
+
return t;
|
|
91
|
+
}
|
|
27
92
|
const whole = (s) => ({
|
|
28
93
|
x: 0,
|
|
29
94
|
y: 0,
|
|
@@ -229,7 +294,7 @@ function Compare({ lm, title = "Scenarios compared" }) {
|
|
|
229
294
|
}),
|
|
230
295
|
/* @__PURE__ */ jsx("th", {
|
|
231
296
|
scope: "col",
|
|
232
|
-
children: "
|
|
297
|
+
children: "Limited by"
|
|
233
298
|
}),
|
|
234
299
|
/* @__PURE__ */ jsx("th", {
|
|
235
300
|
scope: "col",
|
|
@@ -765,6 +830,7 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
765
830
|
]);
|
|
766
831
|
const frameId = useSyncExternalStore(engine.subscribe, () => engine.frameId);
|
|
767
832
|
const frame = engine.frame;
|
|
833
|
+
const hand = useSyncExternalStore(engine.subscribe, () => engine.handover);
|
|
768
834
|
useEffect(() => {
|
|
769
835
|
engine.bind(svgRef.current, canvasRef.current);
|
|
770
836
|
}, [
|
|
@@ -772,7 +838,10 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
772
838
|
frame,
|
|
773
839
|
reducedMotion
|
|
774
840
|
]);
|
|
775
|
-
useLayoutEffect(() =>
|
|
841
|
+
useLayoutEffect(() => {
|
|
842
|
+
engine.applyCamera();
|
|
843
|
+
engine.drawHalos();
|
|
844
|
+
});
|
|
776
845
|
useEffect(() => {
|
|
777
846
|
if (lm.root) engine.readColors(lm.root);
|
|
778
847
|
}, [
|
|
@@ -881,7 +950,7 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
881
950
|
const modesRef = useRef(null);
|
|
882
951
|
useEffect(() => {
|
|
883
952
|
const root = lm.root;
|
|
884
|
-
if (!full || !root) return;
|
|
953
|
+
if (!full || !root || lm.fill) return;
|
|
885
954
|
const f = (e) => {
|
|
886
955
|
if (e.key !== "f" && e.key !== "F" || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
887
956
|
if (typing(e.composedPath()[0] ?? null) || root.querySelector(":scope > [data-drawer]")) return;
|
|
@@ -897,7 +966,8 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
897
966
|
full,
|
|
898
967
|
fullScreenMode,
|
|
899
968
|
setFullScreenMode,
|
|
900
|
-
lm.root
|
|
969
|
+
lm.root,
|
|
970
|
+
lm.fill
|
|
901
971
|
]);
|
|
902
972
|
return /* @__PURE__ */ jsxs("div", {
|
|
903
973
|
className: "lm-wrap",
|
|
@@ -908,7 +978,7 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
908
978
|
ref: barRef,
|
|
909
979
|
children: [legend ? /* @__PURE__ */ jsx(Legend, { lm }) : /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsxs("span", {
|
|
910
980
|
className: "lm-tools",
|
|
911
|
-
children: [full && /* @__PURE__ */ jsx("fieldset", {
|
|
981
|
+
children: [full && !lm.fill && /* @__PURE__ */ jsx("fieldset", {
|
|
912
982
|
className: "lm-modes",
|
|
913
983
|
"aria-label": "Full screen shows (F)",
|
|
914
984
|
ref: modesRef,
|
|
@@ -920,7 +990,7 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
920
990
|
onClick: () => setFullScreenMode(m),
|
|
921
991
|
children: m === "panels" ? "Panels" : "Focus"
|
|
922
992
|
}, m))
|
|
923
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
993
|
+
}), !lm.fill && /* @__PURE__ */ jsx("button", {
|
|
924
994
|
type: "button",
|
|
925
995
|
className: "lm-btn",
|
|
926
996
|
onClick: lm.toggleFullScreen,
|
|
@@ -938,6 +1008,7 @@ function Diagram({ lm, legend = true, onNodeClick, selected = null }) {
|
|
|
938
1008
|
frame && /* @__PURE__ */ jsx(Structure, {
|
|
939
1009
|
lm,
|
|
940
1010
|
scene: frame,
|
|
1011
|
+
hand,
|
|
941
1012
|
svgRef,
|
|
942
1013
|
rates: reducedMotion,
|
|
943
1014
|
setTip,
|
|
@@ -999,7 +1070,7 @@ function Legend({ lm }) {
|
|
|
999
1070
|
}
|
|
1000
1071
|
const componentOf = (lm, n) => boxComponent(lm.ev, n);
|
|
1001
1072
|
/** The SVG. It does not read the detail's state, so a hover re-renders the detail, not every box and edge. */
|
|
1002
|
-
const Structure = memo(function Structure({ lm, scene, svgRef, rates, setTip, onClick, selected }) {
|
|
1073
|
+
const Structure = memo(function Structure({ lm, scene, hand, svgRef, rates, setTip, onClick, selected }) {
|
|
1003
1074
|
const marker = useId().replace(/:/g, "");
|
|
1004
1075
|
const { labels, ev } = lm;
|
|
1005
1076
|
const stateOf = (n) => {
|
|
@@ -1061,7 +1132,14 @@ const Structure = memo(function Structure({ lm, scene, svgRef, rates, setTip, on
|
|
|
1061
1132
|
};
|
|
1062
1133
|
};
|
|
1063
1134
|
const summary = scene.nodes.map((n) => labels.nodes[n.id]?.title).join(", ");
|
|
1135
|
+
const ranks = rankLabels(ev, lm.model);
|
|
1136
|
+
const staying = lm.scene && new Set(lm.scene.nodes.map((n) => n.id));
|
|
1137
|
+
const boxes = (c) => scene.nodes.filter((n) => componentOf(lm, n) === c && (!staying || staying.has(n.id)));
|
|
1064
1138
|
const first = ev.firstLimit;
|
|
1139
|
+
const was = hand && hand.from !== first?.id && ev.components[hand.from] ? ev.components[hand.from] : null;
|
|
1140
|
+
const wasBoxes = was ? boxes(was.id) : [];
|
|
1141
|
+
const wasRank = was && ranks.get(was.id);
|
|
1142
|
+
const note = was && (wasRank ? wasRank.text : `now ${multiple(edge(was), lm.model.searchMax)}`);
|
|
1065
1143
|
return /* @__PURE__ */ jsxs("svg", {
|
|
1066
1144
|
ref: svgRef,
|
|
1067
1145
|
viewBox: `0 0 ${scene.width} ${scene.height}`,
|
|
@@ -1100,7 +1178,29 @@ const Structure = memo(function Structure({ lm, scene, svgRef, rates, setTip, on
|
|
|
1100
1178
|
selected: selected === n.id,
|
|
1101
1179
|
handlers: handlers(n)
|
|
1102
1180
|
}, n.id)),
|
|
1103
|
-
|
|
1181
|
+
was && wasBoxes.map((n) => /* @__PURE__ */ jsx(Halo, {
|
|
1182
|
+
n,
|
|
1183
|
+
kind: "was",
|
|
1184
|
+
component: was.id
|
|
1185
|
+
}, `was-${n.id}`)),
|
|
1186
|
+
first && boxes(first.id).map((n, i) => /* @__PURE__ */ jsx(Halo, {
|
|
1187
|
+
n,
|
|
1188
|
+
kind: "limit",
|
|
1189
|
+
component: first.id,
|
|
1190
|
+
tag: i ? void 0 : ranks.get(first.id)?.text
|
|
1191
|
+
}, n.id)),
|
|
1192
|
+
[...ranks].map(([c, r]) => {
|
|
1193
|
+
const n = r.rank > 1 && c !== was?.id ? boxes(c)[0] : void 0;
|
|
1194
|
+
return n && /* @__PURE__ */ jsx(Badge, {
|
|
1195
|
+
n,
|
|
1196
|
+
text: r.text
|
|
1197
|
+
}, c);
|
|
1198
|
+
}),
|
|
1199
|
+
note && wasBoxes[0] && /* @__PURE__ */ jsx(Badge, {
|
|
1200
|
+
n: wasBoxes[0],
|
|
1201
|
+
text: note,
|
|
1202
|
+
was: !wasRank
|
|
1203
|
+
})
|
|
1104
1204
|
]
|
|
1105
1205
|
});
|
|
1106
1206
|
});
|
|
@@ -1309,13 +1409,15 @@ function Node({ n, state, title, sub, lm, focused, selected, handlers }) {
|
|
|
1309
1409
|
]
|
|
1310
1410
|
});
|
|
1311
1411
|
}
|
|
1312
|
-
/**
|
|
1313
|
-
const
|
|
1412
|
+
/** A tag's width in scene units for its text: wide enough for any digit, so the same text keeps its size. */
|
|
1413
|
+
const tagWidth = (text, perChar) => Math.ceil(12 + text.length * perChar);
|
|
1314
1414
|
/**
|
|
1315
|
-
* A ring around the
|
|
1316
|
-
* and its glow on its own clock
|
|
1415
|
+
* A ring around the limit's box with a soft glow and, on one box of it, a "LIMIT · 18×" tag on its top edge. The
|
|
1416
|
+
* engine scales the ring and its glow on its own clock (`data-ring`) and fades the whole in and out; it is a layer of
|
|
1417
|
+
* its own, so it moves nothing else, and it fades with its box. The tag stays still: text drawn scaled by a fraction
|
|
1418
|
+
* is not rasterised the same twice, and a recording must be. `was`: the old limit's ring while it fades, without a tag.
|
|
1317
1419
|
*/
|
|
1318
|
-
function Halo({ n }) {
|
|
1420
|
+
function Halo({ n, kind, component, tag }) {
|
|
1319
1421
|
const d = 7;
|
|
1320
1422
|
const box = {
|
|
1321
1423
|
x: n.x - d,
|
|
@@ -1324,48 +1426,86 @@ function Halo({ n }) {
|
|
|
1324
1426
|
height: n.h + 14,
|
|
1325
1427
|
rx: 10
|
|
1326
1428
|
};
|
|
1327
|
-
const
|
|
1429
|
+
const w = tag ? tagWidth(tag, 5.6) : 0;
|
|
1430
|
+
const tx = n.x + n.w + d - w - 8;
|
|
1328
1431
|
return /* @__PURE__ */ jsxs("g", {
|
|
1329
1432
|
className: "lm-halo",
|
|
1330
|
-
"data-halo":
|
|
1331
|
-
"data-
|
|
1332
|
-
"data-
|
|
1333
|
-
opacity: n.fade,
|
|
1433
|
+
"data-halo": kind,
|
|
1434
|
+
"data-component": component,
|
|
1435
|
+
"data-fade": n.fade ?? 1,
|
|
1334
1436
|
pointerEvents: "none",
|
|
1335
|
-
children: [
|
|
1336
|
-
|
|
1437
|
+
children: [/* @__PURE__ */ jsxs("g", {
|
|
1438
|
+
"data-ring": "",
|
|
1439
|
+
"data-cx": n.x + n.w / 2,
|
|
1440
|
+
"data-cy": n.y + n.h / 2,
|
|
1441
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
1337
1442
|
...box,
|
|
1338
1443
|
"data-glow": "",
|
|
1339
1444
|
fill: "none",
|
|
1340
1445
|
stroke: "var(--lm-drop)",
|
|
1341
1446
|
strokeWidth: "10",
|
|
1342
1447
|
strokeOpacity: ".22"
|
|
1343
|
-
}),
|
|
1344
|
-
/* @__PURE__ */ jsx("rect", {
|
|
1448
|
+
}), /* @__PURE__ */ jsx("rect", {
|
|
1345
1449
|
...box,
|
|
1346
1450
|
fill: "none",
|
|
1347
1451
|
stroke: "var(--lm-drop)",
|
|
1348
1452
|
strokeWidth: "2.5"
|
|
1349
|
-
})
|
|
1350
|
-
|
|
1453
|
+
})]
|
|
1454
|
+
}), tag && /* @__PURE__ */ jsxs("g", {
|
|
1455
|
+
"data-tag": tag,
|
|
1456
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
1351
1457
|
x: tx,
|
|
1352
1458
|
y: box.y - 7.5,
|
|
1353
|
-
width:
|
|
1459
|
+
width: w,
|
|
1354
1460
|
height: "15",
|
|
1355
1461
|
rx: "3",
|
|
1356
1462
|
fill: "var(--lm-drop)"
|
|
1357
|
-
}),
|
|
1358
|
-
|
|
1359
|
-
x: tx + TAG_W / 2,
|
|
1463
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
1464
|
+
x: tx + w / 2,
|
|
1360
1465
|
y: box.y + 3.5,
|
|
1361
1466
|
textAnchor: "middle",
|
|
1362
1467
|
fontSize: "9.5",
|
|
1363
1468
|
fontWeight: "600",
|
|
1364
1469
|
letterSpacing: ".06em",
|
|
1365
1470
|
fill: "var(--lm-surface)",
|
|
1366
|
-
children:
|
|
1367
|
-
})
|
|
1368
|
-
]
|
|
1471
|
+
children: tag
|
|
1472
|
+
})]
|
|
1473
|
+
})]
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* A quiet badge on a box's top edge: where the next in line reach the target ("2nd · 20×"), or, while the limit
|
|
1478
|
+
* passes on, where the old limit is now. No ring, no breathing. `was`: a note the engine fades in and out.
|
|
1479
|
+
*/
|
|
1480
|
+
function Badge({ n, text, was }) {
|
|
1481
|
+
const w = tagWidth(text, 4.9);
|
|
1482
|
+
const tx = n.x + n.w - w - 6;
|
|
1483
|
+
return /* @__PURE__ */ jsx("g", {
|
|
1484
|
+
className: "lm-badge",
|
|
1485
|
+
"data-badge": text,
|
|
1486
|
+
"data-was": was || void 0,
|
|
1487
|
+
opacity: n.fade,
|
|
1488
|
+
pointerEvents: "none",
|
|
1489
|
+
children: /* @__PURE__ */ jsxs("g", {
|
|
1490
|
+
"data-show": "",
|
|
1491
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
1492
|
+
x: tx,
|
|
1493
|
+
y: n.y - 7,
|
|
1494
|
+
width: w,
|
|
1495
|
+
height: "14",
|
|
1496
|
+
rx: "7",
|
|
1497
|
+
fill: "var(--lm-surface)",
|
|
1498
|
+
stroke: "var(--lm-muted)"
|
|
1499
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
1500
|
+
x: tx + w / 2,
|
|
1501
|
+
y: n.y + 3,
|
|
1502
|
+
textAnchor: "middle",
|
|
1503
|
+
fontSize: "8.5",
|
|
1504
|
+
fontWeight: "600",
|
|
1505
|
+
fill: "var(--lm-muted)",
|
|
1506
|
+
children: text
|
|
1507
|
+
})]
|
|
1508
|
+
})
|
|
1369
1509
|
});
|
|
1370
1510
|
}
|
|
1371
1511
|
/**
|
|
@@ -1440,16 +1580,17 @@ function Detail({ lm, scene, id, board, detailId }) {
|
|
|
1440
1580
|
const at = (r, x) => r ? reach(r, model.searchMax, model.dateAt) : multiple(x, model.searchMax);
|
|
1441
1581
|
const num = (x) => Math.abs(x) >= 1e3 ? compact(x) : fmt(x);
|
|
1442
1582
|
const cap = c.capacity;
|
|
1583
|
+
const rank = rankLabels(ev, model).get(c.id);
|
|
1443
1584
|
return /* @__PURE__ */ jsxs("div", {
|
|
1444
1585
|
id: detailId,
|
|
1445
1586
|
className: "lm-tip lm-detail",
|
|
1446
1587
|
role: "tooltip",
|
|
1447
1588
|
ref: tip,
|
|
1448
1589
|
children: [
|
|
1449
|
-
/* @__PURE__ */ jsxs("b", { children: [c.name,
|
|
1590
|
+
/* @__PURE__ */ jsxs("b", { children: [c.name, rank && /* @__PURE__ */ jsx("span", {
|
|
1450
1591
|
className: "lm-tag",
|
|
1451
|
-
"data-kind": "first",
|
|
1452
|
-
children:
|
|
1592
|
+
"data-kind": rank.rank === 1 ? "first" : "rank",
|
|
1593
|
+
children: rank.word
|
|
1453
1594
|
})] }),
|
|
1454
1595
|
c.util == null || !cap ? /* @__PURE__ */ jsx("span", { children: "switched off" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1455
1596
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -1684,7 +1825,7 @@ function Limits({ lm, title = "Where it runs out, in order" }) {
|
|
|
1684
1825
|
c === ev.firstLimit && /* @__PURE__ */ jsx("span", {
|
|
1685
1826
|
className: "lm-tag",
|
|
1686
1827
|
"data-kind": "first",
|
|
1687
|
-
children: "
|
|
1828
|
+
children: "limit"
|
|
1688
1829
|
}),
|
|
1689
1830
|
c.capacity?.provenance === "estimated" ? /* @__PURE__ */ jsxs("span", {
|
|
1690
1831
|
className: "lm-tag",
|
|
@@ -2045,7 +2186,7 @@ function VerdictLine({ lm, verdict = true, extra = 0, open, assumptions }) {
|
|
|
2045
2186
|
})
|
|
2046
2187
|
] }),
|
|
2047
2188
|
" ",
|
|
2048
|
-
"·
|
|
2189
|
+
"· limited by ",
|
|
2049
2190
|
/* @__PURE__ */ jsx("b", { children: first.name }),
|
|
2050
2191
|
sure && /* @__PURE__ */ jsx("span", {
|
|
2051
2192
|
className: "lm-tag",
|
|
@@ -2369,7 +2510,7 @@ function Story({ lm }) {
|
|
|
2369
2510
|
"aria-hidden": "true",
|
|
2370
2511
|
children: story.map((st, k) => /* @__PURE__ */ jsx("i", {
|
|
2371
2512
|
"data-state": k < i ? "done" : k === i ? "now" : void 0,
|
|
2372
|
-
style: k === i ? { "--lm-step": `${stepSeconds(st, lm.engine.transition)}s` } : void 0
|
|
2513
|
+
style: k === i ? { "--lm-step": `${lm.cue?.seconds ?? stepSeconds(st, lm.engine.transition)}s` } : void 0
|
|
2373
2514
|
}, k === i ? `${k}-${playing}` : k))
|
|
2374
2515
|
}),
|
|
2375
2516
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -2471,6 +2612,7 @@ const LOADMAP_CSS = `
|
|
|
2471
2612
|
.lm-side, .lm-card > .lm-panel { display: contents; }
|
|
2472
2613
|
.lm-panel { display: grid; gap: 14px; min-width: 0; }
|
|
2473
2614
|
.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; }
|
|
2615
|
+
.lm[data-full="fill"] { height: 100%; padding: 10px; }
|
|
2474
2616
|
.lm[data-full="overlay"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }
|
|
2475
2617
|
.lm[data-full] > * { flex: none; }
|
|
2476
2618
|
/* a page of its own keeps the rest outside full screen, as <Loadmap> does */
|
|
@@ -2612,7 +2754,7 @@ const LOADMAP_CSS = `
|
|
|
2612
2754
|
.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; }
|
|
2613
2755
|
.lm-tag[data-kind="first"] { color: var(--lm-surface); background: var(--lm-drop); }
|
|
2614
2756
|
.lm-tag[data-kind="estimated"] { color: var(--lm-warn); border: 1px solid currentColor; }
|
|
2615
|
-
.lm-tag[data-kind="range"] { color: var(--lm-muted); border: 1px solid currentColor; }
|
|
2757
|
+
.lm-tag[data-kind="range"], .lm-tag[data-kind="rank"] { color: var(--lm-muted); border: 1px solid currentColor; }
|
|
2616
2758
|
.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }
|
|
2617
2759
|
.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }
|
|
2618
2760
|
.lm-fill[data-state="warn"] { background: var(--lm-warn); } .lm-fill[data-state="over"] { background: var(--lm-drop); }
|
|
@@ -2719,12 +2861,19 @@ const TOKENS = [
|
|
|
2719
2861
|
];
|
|
2720
2862
|
/** The stroke of a hollow dot, in scene units. */
|
|
2721
2863
|
const RING = 1.4;
|
|
2864
|
+
/** Seconds a handover the reader made stays, its note on the old limit with it. */
|
|
2865
|
+
const HAND_KEEP = 2.5;
|
|
2722
2866
|
/** Seconds the breathing of the first limit takes, in and out. */
|
|
2723
2867
|
const BREATH = 2.4;
|
|
2724
2868
|
/** Sets an attribute only when it changes: most frames change nothing. */
|
|
2725
2869
|
function set(el, name, value) {
|
|
2726
2870
|
if (el.getAttribute(name) !== value) el.setAttribute(name, value);
|
|
2727
2871
|
}
|
|
2872
|
+
/** Sets a group's opacity, and none when it shows whole: the SVG of a ring that shows whole stays as it was. */
|
|
2873
|
+
function fade(el, show) {
|
|
2874
|
+
if (show >= 1) el.removeAttribute("opacity");
|
|
2875
|
+
else set(el, "opacity", show.toFixed(3));
|
|
2876
|
+
}
|
|
2728
2877
|
/**
|
|
2729
2878
|
* Everything that moves, without React: the sim, the dots on the canvas, the worker fills in the SVG, and the move from
|
|
2730
2879
|
* one structure to the next. React renders the structure once per scene, and once per frame while it moves; the engine
|
|
@@ -2778,6 +2927,7 @@ var Engine = class {
|
|
|
2778
2927
|
/** Seconds the engine has run since the last reset: the first limit breathes on it. */
|
|
2779
2928
|
#clock = 0;
|
|
2780
2929
|
#story = null;
|
|
2930
|
+
#hand = null;
|
|
2781
2931
|
constructor(model, view, ev, o = {}) {
|
|
2782
2932
|
this.model = model;
|
|
2783
2933
|
this.view = view;
|
|
@@ -2788,8 +2938,43 @@ var Engine = class {
|
|
|
2788
2938
|
setEvaluation(ev) {
|
|
2789
2939
|
if (ev === this.ev) return;
|
|
2790
2940
|
const same = JSON.stringify(ev.values) === JSON.stringify(this.ev.values);
|
|
2941
|
+
const was = this.ev.firstLimit?.id;
|
|
2942
|
+
const now = ev.firstLimit?.id;
|
|
2791
2943
|
this.ev = ev;
|
|
2792
2944
|
if (!same) this.sim.update(ev);
|
|
2945
|
+
if (was === now) return;
|
|
2946
|
+
const story = this.#story?.shot === "change";
|
|
2947
|
+
const still = this.paused && !this.#driven;
|
|
2948
|
+
this.#setHand(was && now && this.frame && !still ? {
|
|
2949
|
+
from: was,
|
|
2950
|
+
to: now,
|
|
2951
|
+
t: 0,
|
|
2952
|
+
fade: this.#hand?.to === was ? this.#shows(this.#hand, false) : 1,
|
|
2953
|
+
...story ? {
|
|
2954
|
+
out: .5,
|
|
2955
|
+
in: .6,
|
|
2956
|
+
inAt: Infinity
|
|
2957
|
+
} : {
|
|
2958
|
+
out: .3,
|
|
2959
|
+
in: .3,
|
|
2960
|
+
inAt: this.reducedMotion ? 0 : .3
|
|
2961
|
+
},
|
|
2962
|
+
story
|
|
2963
|
+
} : null);
|
|
2964
|
+
}
|
|
2965
|
+
/** How much of a handover's old ring (`was`) or new one shows now. */
|
|
2966
|
+
#shows(h, was) {
|
|
2967
|
+
const part = (t, d) => this.reducedMotion ? t >= 0 ? 1 : 0 : ease(Math.max(0, Math.min(1, t / d)));
|
|
2968
|
+
return was ? h.fade * (1 - part(h.t, h.out)) : part(h.t - h.inAt, h.in);
|
|
2969
|
+
}
|
|
2970
|
+
/** The limit passing to another component now, if it is: the diagram draws the old ring while it fades. */
|
|
2971
|
+
get handover() {
|
|
2972
|
+
return this.#hand;
|
|
2973
|
+
}
|
|
2974
|
+
#setHand(h) {
|
|
2975
|
+
if (h === this.#hand) return;
|
|
2976
|
+
this.#hand = h;
|
|
2977
|
+
for (const f of this.#listeners) f();
|
|
2793
2978
|
}
|
|
2794
2979
|
/**
|
|
2795
2980
|
* Takes a new scene. A new structure moves in from what is drawn now, unless `cut`, the diagram turned (a new
|
|
@@ -2828,6 +3013,7 @@ var Engine = class {
|
|
|
2828
3013
|
});
|
|
2829
3014
|
this.#paths.clear();
|
|
2830
3015
|
this.#clock = 0;
|
|
3016
|
+
this.#setHand(null);
|
|
2831
3017
|
if (this.#move && this.scene) {
|
|
2832
3018
|
this.#move = null;
|
|
2833
3019
|
this.#show(this.scene);
|
|
@@ -2882,6 +3068,11 @@ var Engine = class {
|
|
|
2882
3068
|
this.#driven = this.paused;
|
|
2883
3069
|
this.sim.step(dtReal, o);
|
|
2884
3070
|
if (dtReal > 0) this.#clock += dtReal;
|
|
3071
|
+
const h = this.#hand;
|
|
3072
|
+
if (h && dtReal > 0 && this.#caughtUp()) {
|
|
3073
|
+
h.t += dtReal;
|
|
3074
|
+
if (!h.story && h.t >= HAND_KEEP) this.#setHand(null);
|
|
3075
|
+
}
|
|
2885
3076
|
const m = this.#move;
|
|
2886
3077
|
if (m && dtReal > 0) {
|
|
2887
3078
|
m.t += dtReal / m.seconds;
|
|
@@ -2911,7 +3102,8 @@ var Engine = class {
|
|
|
2911
3102
|
targets: [],
|
|
2912
3103
|
components: [],
|
|
2913
3104
|
before: this.ev,
|
|
2914
|
-
waiting: false
|
|
3105
|
+
waiting: false,
|
|
3106
|
+
hand: null
|
|
2915
3107
|
};
|
|
2916
3108
|
this.#setCamera(null);
|
|
2917
3109
|
this.host?.playing(true);
|
|
@@ -2923,6 +3115,7 @@ var Engine = class {
|
|
|
2923
3115
|
if (!s) return;
|
|
2924
3116
|
this.cue = null;
|
|
2925
3117
|
this.host?.cue(null);
|
|
3118
|
+
if (this.#hand?.story) this.#setHand(null);
|
|
2926
3119
|
if (s.shot !== "back") this.host?.playing(false);
|
|
2927
3120
|
if (o.cut || !this.camera || this.reducedMotion) {
|
|
2928
3121
|
this.#story = null;
|
|
@@ -2940,6 +3133,7 @@ var Engine = class {
|
|
|
2940
3133
|
}
|
|
2941
3134
|
#length(s) {
|
|
2942
3135
|
if (s.shot === "change") return changeSeconds(this.transition);
|
|
3136
|
+
if (s.shot === "hand") return SHOTS.hand;
|
|
2943
3137
|
if (s.shot === "wide") return this.model.story[s.i]?.seconds ?? 0;
|
|
2944
3138
|
return SHOTS[s.shot];
|
|
2945
3139
|
}
|
|
@@ -2973,9 +3167,21 @@ var Engine = class {
|
|
|
2973
3167
|
if (s.shot === "in") cam = cut ? s.close : between(all, s.close, p);
|
|
2974
3168
|
else if (s.shot === "close") cam = s.close;
|
|
2975
3169
|
else if (s.shot === "change") cam = s.zoom ? framing(frame, s.targets, { hold: true }) : all;
|
|
2976
|
-
else if (s.shot === "
|
|
3170
|
+
else if (s.shot === "hand") {
|
|
3171
|
+
const to = framing(frame, this.#boxesOf(s.hand?.to));
|
|
3172
|
+
cam = cut ? to : between(s.from, to, s.t / 1);
|
|
3173
|
+
} else if (s.shot === "out" || s.shot === "back") cam = cut ? all : between(s.from, all, p);
|
|
2977
3174
|
else cam = all;
|
|
2978
3175
|
this.#setCamera(cam);
|
|
3176
|
+
const h = this.#hand;
|
|
3177
|
+
if (s.hand && h?.story && (cut || h.t >= h.out) && this.cue && this.cue.detail !== s.hand.text) this.#cue({
|
|
3178
|
+
...this.cue,
|
|
3179
|
+
detail: s.hand.text
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
/** The boxes a component is drawn as, in the frame. */
|
|
3183
|
+
#boxesOf(c) {
|
|
3184
|
+
return (this.frame?.nodes ?? []).filter((n) => c && boxComponent(this.ev, n) === c).map((n) => n.id);
|
|
2979
3185
|
}
|
|
2980
3186
|
/** The shot after `s.shot`. */
|
|
2981
3187
|
#next(s) {
|
|
@@ -2987,6 +3193,7 @@ var Engine = class {
|
|
|
2987
3193
|
return;
|
|
2988
3194
|
}
|
|
2989
3195
|
if (s.shot === "establish" || s.shot === "wide") {
|
|
3196
|
+
if (this.#hand?.story) this.#setHand(null);
|
|
2990
3197
|
if (s.i + 1 >= story.length) {
|
|
2991
3198
|
this.#story = null;
|
|
2992
3199
|
this.#setCamera(null);
|
|
@@ -3007,6 +3214,11 @@ var Engine = class {
|
|
|
3007
3214
|
const components = [...new Set(nodes.map((n) => boxComponent(after, n)).filter((c) => c != null))];
|
|
3008
3215
|
const close = framing(frame, ids);
|
|
3009
3216
|
const zoom = close.w < frame.width - 1e-6;
|
|
3217
|
+
const text = handoverText(this.ev, after, this.model);
|
|
3218
|
+
const hand = text ? {
|
|
3219
|
+
text,
|
|
3220
|
+
to: after.firstLimit.id
|
|
3221
|
+
} : null;
|
|
3010
3222
|
Object.assign(s, {
|
|
3011
3223
|
i,
|
|
3012
3224
|
shot: "in",
|
|
@@ -3015,14 +3227,16 @@ var Engine = class {
|
|
|
3015
3227
|
zoom,
|
|
3016
3228
|
targets: ids,
|
|
3017
3229
|
components,
|
|
3018
|
-
before: this.ev
|
|
3230
|
+
before: this.ev,
|
|
3231
|
+
hand
|
|
3019
3232
|
});
|
|
3020
3233
|
this.#cue({
|
|
3021
3234
|
step: i,
|
|
3022
3235
|
title: stepTitle(this.model, this.ev.values, st, i),
|
|
3023
3236
|
detail: stepDetail(this.ev, null, components),
|
|
3024
3237
|
after: false,
|
|
3025
|
-
top: close.y + close.h / 2 > frame.height * .55
|
|
3238
|
+
top: close.y + close.h / 2 > frame.height * .55,
|
|
3239
|
+
seconds: stepSeconds(st, this.transition, !!hand)
|
|
3026
3240
|
});
|
|
3027
3241
|
return;
|
|
3028
3242
|
}
|
|
@@ -3036,9 +3250,18 @@ var Engine = class {
|
|
|
3036
3250
|
detail: stepDetail(s.before, this.ev, s.components),
|
|
3037
3251
|
after: true
|
|
3038
3252
|
});
|
|
3039
|
-
} else if (s.shot === "change") {
|
|
3253
|
+
} else if (s.shot === "change" && s.hand) {
|
|
3254
|
+
s.shot = "hand";
|
|
3255
|
+
s.from = this.camera ?? whole(frame);
|
|
3256
|
+
const cam = s.from;
|
|
3257
|
+
const ids = this.#boxesOf(s.hand.to);
|
|
3258
|
+
const inView = frame.nodes.filter((n) => ids.includes(n.id)).every((n) => n.x >= cam.x && n.y >= cam.y && n.x + n.w <= cam.x + cam.w && n.y + n.h <= cam.y + cam.h);
|
|
3259
|
+
if (this.#hand?.story) this.#hand.inAt = this.#hand.t + (this.reducedMotion || inView ? 0 : 1);
|
|
3260
|
+
} else if (s.shot === "change" || s.shot === "hand") {
|
|
3040
3261
|
s.shot = "out";
|
|
3041
3262
|
s.from = this.camera ?? whole(frame);
|
|
3263
|
+
const h = this.#hand;
|
|
3264
|
+
if (h?.story && !Number.isFinite(h.inAt)) h.inAt = h.t;
|
|
3042
3265
|
} else if (s.shot === "out") s.shot = "wide";
|
|
3043
3266
|
}
|
|
3044
3267
|
#cue(c) {
|
|
@@ -3071,16 +3294,7 @@ var Engine = class {
|
|
|
3071
3294
|
this.paintParticles(ctx, c.width / this.frame.width);
|
|
3072
3295
|
}
|
|
3073
3296
|
drawFills() {
|
|
3074
|
-
|
|
3075
|
-
const breathe = !this.reducedMotion && (this.playing || first?.state === "warn" || first?.state === "over");
|
|
3076
|
-
const b = breathe ? .5 - .5 * Math.cos(2 * Math.PI * this.#clock / BREATH) : .5;
|
|
3077
|
-
for (const el of this.svg?.querySelectorAll("g[data-halo]") ?? []) {
|
|
3078
|
-
const [cx, cy] = [Number(el.dataset.cx), Number(el.dataset.cy)];
|
|
3079
|
-
const k = 1 + .035 * b;
|
|
3080
|
-
set(el, "transform", breathe ? `translate(${cx} ${cy}) scale(${k.toFixed(4)}) translate(${-cx} ${-cy})` : "");
|
|
3081
|
-
const glow = el.querySelector("[data-glow]");
|
|
3082
|
-
if (glow) set(glow, "stroke-opacity", (.1 + .25 * b).toFixed(3));
|
|
3083
|
-
}
|
|
3297
|
+
this.drawHalos();
|
|
3084
3298
|
for (const sl of this.#slots) {
|
|
3085
3299
|
const b = this.sim.slotBusy(sl.stage, sl.index);
|
|
3086
3300
|
const h = b < .02 ? 0 : (sl.s - 2) * b;
|
|
@@ -3088,6 +3302,34 @@ var Engine = class {
|
|
|
3088
3302
|
sl.el.setAttribute("height", h.toFixed(2));
|
|
3089
3303
|
}
|
|
3090
3304
|
}
|
|
3305
|
+
/**
|
|
3306
|
+
* The rings: the limit breathes, on the engine's clock, while the story plays and once it is past the target, a scale
|
|
3307
|
+
* and a glow on its own layer, which moves nothing else; a handover fades the old ring and brings the new one in.
|
|
3308
|
+
* Decided here, not by a render, so a recording never waits on one. The page calls it after each render too, so a
|
|
3309
|
+
* new ring never shows a frame before the engine has placed it.
|
|
3310
|
+
*/
|
|
3311
|
+
drawHalos() {
|
|
3312
|
+
const first = this.ev.firstLimit;
|
|
3313
|
+
const breathe = !this.reducedMotion && (this.playing || first?.state === "warn" || first?.state === "over");
|
|
3314
|
+
const b = breathe ? .5 - .5 * Math.cos(2 * Math.PI * this.#clock / BREATH) : .5;
|
|
3315
|
+
const h = this.#hand;
|
|
3316
|
+
for (const el of this.svg?.querySelectorAll("g[data-halo]") ?? []) {
|
|
3317
|
+
const was = el.dataset.halo === "was";
|
|
3318
|
+
const coming = !was && h?.to === el.dataset.component;
|
|
3319
|
+
const show = was ? h ? this.#shows(h, true) : 0 : coming ? this.#shows(h, false) : 1;
|
|
3320
|
+
fade(el, Number(el.dataset.fade ?? 1) * show);
|
|
3321
|
+
const ring = el.querySelector("[data-ring]");
|
|
3322
|
+
if (!ring) continue;
|
|
3323
|
+
const [cx, cy] = [Number(ring.dataset.cx), Number(ring.dataset.cy)];
|
|
3324
|
+
const k = was ? 1 : (1 + .08 * (1 - show)) * (breathe ? 1 + .035 * b : 1);
|
|
3325
|
+
set(ring, "transform", k === 1 ? "" : `translate(${cx} ${cy}) scale(${k.toFixed(4)}) translate(${-cx} ${-cy})`);
|
|
3326
|
+
const glow = ring.querySelector("[data-glow]");
|
|
3327
|
+
if (glow) set(glow, "stroke-opacity", (.1 + .25 * b).toFixed(3));
|
|
3328
|
+
}
|
|
3329
|
+
if (!h) return;
|
|
3330
|
+
const part = (t, d) => this.reducedMotion ? t >= 0 ? 1 : 0 : ease(Math.max(0, Math.min(1, t / d)));
|
|
3331
|
+
for (const el of this.svg?.querySelectorAll("g[data-badge][data-was] [data-show]") ?? []) fade(el, part(h.t, h.out) * (h.story ? 1 : 1 - part(h.t - 2.1, .4)));
|
|
3332
|
+
}
|
|
3091
3333
|
/** Every dot as it is drawn now, in scene units: for the canvas, and for an SVG export. */
|
|
3092
3334
|
dots() {
|
|
3093
3335
|
const scene = this.frame;
|
|
@@ -3370,7 +3612,8 @@ function useLoadmap(model, view, o = {}) {
|
|
|
3370
3612
|
]);
|
|
3371
3613
|
const [screen, setScreen] = useState(false);
|
|
3372
3614
|
const [overlay, setOverlay] = useState(false);
|
|
3373
|
-
const
|
|
3615
|
+
const fill = !!o.fill;
|
|
3616
|
+
const fullScreen = fill || screen || overlay;
|
|
3374
3617
|
useEffect(() => {
|
|
3375
3618
|
const f = () => setScreen(!!root && document.fullscreenElement === root);
|
|
3376
3619
|
document.addEventListener("fullscreenchange", f);
|
|
@@ -3387,7 +3630,7 @@ function useLoadmap(model, view, o = {}) {
|
|
|
3387
3630
|
mode
|
|
3388
3631
|
}), [start]);
|
|
3389
3632
|
useEffect(() => {
|
|
3390
|
-
if (!root || !fullScreen) return;
|
|
3633
|
+
if (!root || !fullScreen || fill) return;
|
|
3391
3634
|
root.setAttribute("data-full", overlay ? "overlay" : "screen");
|
|
3392
3635
|
const top = overlay && typeof root.showPopover === "function";
|
|
3393
3636
|
if (top) {
|
|
@@ -3404,16 +3647,18 @@ function useLoadmap(model, view, o = {}) {
|
|
|
3404
3647
|
}, [
|
|
3405
3648
|
root,
|
|
3406
3649
|
fullScreen,
|
|
3407
|
-
overlay
|
|
3650
|
+
overlay,
|
|
3651
|
+
fill
|
|
3408
3652
|
]);
|
|
3409
3653
|
useEffect(() => {
|
|
3410
|
-
if (!root || !fullScreen) return;
|
|
3654
|
+
if (!root || !fullScreen || fill) return;
|
|
3411
3655
|
root.setAttribute("data-mode", fullScreenMode);
|
|
3412
3656
|
return () => root.removeAttribute("data-mode");
|
|
3413
3657
|
}, [
|
|
3414
3658
|
root,
|
|
3415
3659
|
fullScreen,
|
|
3416
|
-
fullScreenMode
|
|
3660
|
+
fullScreenMode,
|
|
3661
|
+
fill
|
|
3417
3662
|
]);
|
|
3418
3663
|
useEffect(() => {
|
|
3419
3664
|
if (!overlay) return;
|
|
@@ -3422,12 +3667,16 @@ function useLoadmap(model, view, o = {}) {
|
|
|
3422
3667
|
return () => document.removeEventListener("keydown", f);
|
|
3423
3668
|
}, [overlay]);
|
|
3424
3669
|
const toggleFullScreen = useCallback(() => {
|
|
3425
|
-
if (!root) return;
|
|
3670
|
+
if (!root || fill) return;
|
|
3426
3671
|
if (overlay) setOverlay(false);
|
|
3427
3672
|
else if (document.fullscreenElement) document.exitFullscreen().catch(() => {});
|
|
3428
3673
|
else if (root.requestFullscreen) root.requestFullscreen().catch(() => setOverlay(true));
|
|
3429
3674
|
else setOverlay(true);
|
|
3430
|
-
}, [
|
|
3675
|
+
}, [
|
|
3676
|
+
root,
|
|
3677
|
+
overlay,
|
|
3678
|
+
fill
|
|
3679
|
+
]);
|
|
3431
3680
|
return {
|
|
3432
3681
|
model,
|
|
3433
3682
|
view,
|
|
@@ -3443,6 +3692,7 @@ function useLoadmap(model, view, o = {}) {
|
|
|
3443
3692
|
setStoryPlaying,
|
|
3444
3693
|
cue: storyPlaying ? cue : null,
|
|
3445
3694
|
fullScreen,
|
|
3695
|
+
fill,
|
|
3446
3696
|
toggleFullScreen,
|
|
3447
3697
|
fullScreenMode,
|
|
3448
3698
|
setFullScreenMode,
|
|
@@ -3535,6 +3785,8 @@ function LoadmapRoot({ lm, theme = "auto", children }) {
|
|
|
3535
3785
|
return /* @__PURE__ */ jsx("div", {
|
|
3536
3786
|
className: "lm",
|
|
3537
3787
|
"data-theme": shown === "auto" ? void 0 : shown,
|
|
3788
|
+
"data-full": lm.fill ? "fill" : void 0,
|
|
3789
|
+
"data-mode": lm.fill ? lm.fullScreenMode : void 0,
|
|
3538
3790
|
ref: lm.rootRef,
|
|
3539
3791
|
children
|
|
3540
3792
|
});
|
|
@@ -3697,8 +3949,9 @@ function handleOf(lm) {
|
|
|
3697
3949
|
setStoryStep: (i) => lm.setStep(i),
|
|
3698
3950
|
storyStep: () => engine.storyStep,
|
|
3699
3951
|
playStory: () => {
|
|
3952
|
+
const start = engine.ev;
|
|
3700
3953
|
if (!engine.playStory(0)) throw new Error("loadmap: the story cannot play: nothing is drawn yet, or there is none");
|
|
3701
|
-
return storySeconds(engine.model
|
|
3954
|
+
return storySeconds(engine.model, start, engine.transition);
|
|
3702
3955
|
},
|
|
3703
3956
|
reset: (seed) => engine.reset(seed),
|
|
3704
3957
|
step: (dt) => {
|
|
@@ -37,6 +37,27 @@ interface Cue {
|
|
|
37
37
|
after: boolean;
|
|
38
38
|
/** The boxes framed are low on the board: the title sits at its top. */
|
|
39
39
|
top: boolean;
|
|
40
|
+
/** The step's length as it plays, in seconds. */
|
|
41
|
+
seconds: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The limit passing from one component to another, on the engine's clock: the old ring fades (its tag already the
|
|
45
|
+
* old box's badge), then the new ring comes in. The rings never show together, and only one wears the tag.
|
|
46
|
+
*/
|
|
47
|
+
interface Handover {
|
|
48
|
+
from: string;
|
|
49
|
+
to: string;
|
|
50
|
+
/** Seconds since the page drew the new limit. */
|
|
51
|
+
t: number;
|
|
52
|
+
/** How much of the old ring showed when it began to fade. */
|
|
53
|
+
fade: number;
|
|
54
|
+
/** Seconds the old ring takes to fade, and the new one to come in. */
|
|
55
|
+
out: number;
|
|
56
|
+
in: number;
|
|
57
|
+
/** When the new ring starts to come in, on `t`: a story sets it once the camera reaches the new limit. */
|
|
58
|
+
inAt: number;
|
|
59
|
+
/** Started by a story step: it lasts until the next step. */
|
|
60
|
+
story: boolean;
|
|
40
61
|
}
|
|
41
62
|
/** How the story player reaches the page: it starts and stops, shows a step's values and says what it is at. */
|
|
42
63
|
interface StoryHost {
|
|
@@ -46,7 +67,7 @@ interface StoryHost {
|
|
|
46
67
|
/** Each box's shape and the edges drawn at these values (`shapesOf`, with the page's direction and fonts). */
|
|
47
68
|
shapes(ev: Evaluation): Shapes;
|
|
48
69
|
}
|
|
49
|
-
type Shot = 'establish' | 'in' | 'close' | 'change' | 'out' | 'wide' | 'back';
|
|
70
|
+
type Shot = 'establish' | 'in' | 'close' | 'change' | 'hand' | 'out' | 'wide' | 'back';
|
|
50
71
|
/**
|
|
51
72
|
* Everything that moves, without React: the sim, the dots on the canvas, the worker fills in the SVG, and the move from
|
|
52
73
|
* one structure to the next. React renders the structure once per scene, and once per frame while it moves; the engine
|
|
@@ -88,6 +109,8 @@ declare class Engine {
|
|
|
88
109
|
canvas: HTMLCanvasElement | null;
|
|
89
110
|
constructor(model: Model, view: View, ev: Evaluation, o?: SimOptions);
|
|
90
111
|
setEvaluation(ev: Evaluation): void;
|
|
112
|
+
/** The limit passing to another component now, if it is: the diagram draws the old ring while it fades. */
|
|
113
|
+
get handover(): Handover | null;
|
|
91
114
|
/**
|
|
92
115
|
* Takes a new scene. A new structure moves in from what is drawn now, unless `cut`, the diagram turned (a new
|
|
93
116
|
* direction is a new screen size, not a new design), or it is paused with nothing stepping it; the first scene just
|
|
@@ -135,6 +158,13 @@ declare class Engine {
|
|
|
135
158
|
particles?: boolean;
|
|
136
159
|
}): void;
|
|
137
160
|
drawFills(): void;
|
|
161
|
+
/**
|
|
162
|
+
* The rings: the limit breathes, on the engine's clock, while the story plays and once it is past the target, a scale
|
|
163
|
+
* and a glow on its own layer, which moves nothing else; a handover fades the old ring and brings the new one in.
|
|
164
|
+
* Decided here, not by a render, so a recording never waits on one. The page calls it after each render too, so a
|
|
165
|
+
* new ring never shows a frame before the engine has placed it.
|
|
166
|
+
*/
|
|
167
|
+
drawHalos(): void;
|
|
138
168
|
/** Every dot as it is drawn now, in scene units: for the canvas, and for an SVG export. */
|
|
139
169
|
dots(): Dot[];
|
|
140
170
|
/**
|
|
@@ -154,6 +184,12 @@ interface LoadmapOptions<P> extends SimOptions {
|
|
|
154
184
|
direction?: Direction;
|
|
155
185
|
/** What full screen opens with: the panels around the diagram, or mainly the diagram and the story. Default panels. */
|
|
156
186
|
fullScreenMode?: FullScreenMode;
|
|
187
|
+
/**
|
|
188
|
+
* The root fills its container, laid out as full screen is (in `fullScreenMode`), and stays so: no full screen
|
|
189
|
+
* button. For a page of its own made to be framed, such as an embed: the container takes the frame's height, and the
|
|
190
|
+
* layout follows the frame's size as full screen follows the screen's.
|
|
191
|
+
*/
|
|
192
|
+
fill?: boolean;
|
|
157
193
|
/**
|
|
158
194
|
* Seconds the diagram takes to move to a new structure (a scenario, a story step or a control that adds pods): what
|
|
159
195
|
* stays moves, what is new fades in. 0 cuts. Default 0.8; with reduced motion it always cuts. The load never moves it.
|
|
@@ -191,8 +227,10 @@ interface LoadmapController<P = any> {
|
|
|
191
227
|
setStoryPlaying: (on: boolean) => void;
|
|
192
228
|
/** What the diagram says about the step the story plays; null when it does not play. */
|
|
193
229
|
cue: Cue | null;
|
|
194
|
-
/** The root is full screen: the browser's,
|
|
230
|
+
/** The root is full screen: the browser's, an overlay where the browser has none or refuses, or `fill`. */
|
|
195
231
|
fullScreen: boolean;
|
|
232
|
+
/** The root fills its container as full screen does, for good. */
|
|
233
|
+
fill: boolean;
|
|
196
234
|
toggleFullScreen: () => void;
|
|
197
235
|
/** What full screen shows. The reader switches it; the page picks where it starts. */
|
|
198
236
|
fullScreenMode: FullScreenMode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { 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 { 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-ChdKkdGE.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";
|
|
@@ -85,7 +85,7 @@ export declare function Story({ lm }: {
|
|
|
85
85
|
* that has its own, set on the root (`.card > .lm`) so they resolve there and reach no nested board; full screen
|
|
86
86
|
* keeps both.
|
|
87
87
|
*/
|
|
88
|
-
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=\"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-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[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.lm-line .lm-range { flex: 0 1 380px; display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 10px; font-size: .84rem; }\n.lm-line output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-line input[type=range] { width: 100%; accent-color: var(--lm-accent); }\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), .lm-mini .lm-controls > h3 + .lm-range { 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-scenarios, .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 .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}\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\"] { 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.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";
|
|
88
|
+
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-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[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.lm-line .lm-range { flex: 0 1 380px; display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 10px; font-size: .84rem; }\n.lm-line output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-line input[type=range] { width: 100%; accent-color: var(--lm-accent); }\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), .lm-mini .lm-controls > h3 + .lm-range { 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-scenarios, .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 .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}\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.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";
|
|
89
89
|
/** Adds the stylesheet once per document. */
|
|
90
90
|
export declare function injectStyles(doc?: Document): void;
|
|
91
91
|
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 View, type ViewDef, cluster, compact, defineView, edge, fitLinear, fmt, handleOf, multiple, node, pct, pool, secs, useLoadmap, usePageTheme };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as Compare, a as usePageTheme, b as scenarioColor, c as injectStyles, d as Controls, f as Limits, g as Diagram, h as workerElk, i as handleOf, l as Story, m as Verdict, n as Loadmap, o as useLoadmap, p as Meters, r as LoadmapRoot, s as LOADMAP_CSS, t as LOADMAP_PANELS, u as Assumptions, v as HeadroomChart, x as useComparison, y as Scenarios } from "./Loadmap-
|
|
1
|
+
import { _ as Compare, a as usePageTheme, b as scenarioColor, c as injectStyles, d as Controls, f as Limits, g as Diagram, h as workerElk, i as handleOf, l as Story, m as Verdict, n as Loadmap, o as useLoadmap, p as Meters, r as LoadmapRoot, s as LOADMAP_CSS, t as LOADMAP_PANELS, u as Assumptions, v as HeadroomChart, x as useComparison, y as Scenarios } from "./Loadmap-CAZYmI8l.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, edge, node, pool } from "@loadmap/layout";
|
package/dist/source.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as LoadmapProps } from "./Loadmap-
|
|
1
|
+
import { a as LoadmapProps } from "./Loadmap-ChdKkdGE.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-CAZYmI8l.js";
|
|
2
2
|
import { useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { compile, formatDiagnostic } from "@loadmap/dsl";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loadmap/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.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.11.0",
|
|
39
|
+
"@loadmap/dsl": "0.11.0",
|
|
40
|
+
"@loadmap/sim": "0.11.0",
|
|
41
|
+
"@loadmap/layout": "0.11.0",
|
|
42
42
|
"elkjs": "^0.12.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|