@dashspec/renderer 0.1.40 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/dist/FlowMapView-BSTKU7D4.js +458 -0
- package/dist/FlowMapView-BSTKU7D4.js.map +1 -0
- package/dist/chunk-5LRFKK4I.js +118 -0
- package/dist/chunk-5LRFKK4I.js.map +1 -0
- package/dist/{chunk-NLKXHTLO.js → chunk-D4GFCPCL.js} +6 -33
- package/dist/chunk-D4GFCPCL.js.map +1 -0
- package/dist/chunk-E4CT25TF.js +440 -0
- package/dist/chunk-E4CT25TF.js.map +1 -0
- package/dist/chunk-HUBYJ34E.js +38 -0
- package/dist/chunk-HUBYJ34E.js.map +1 -0
- package/dist/{chunk-M4WXE3FW.js → chunk-JCPQBIAL.js} +5 -3
- package/dist/{chunk-M4WXE3FW.js.map → chunk-JCPQBIAL.js.map} +1 -1
- package/dist/{chunk-UK4FBI4D.js → chunk-O4BYNRCA.js} +204 -526
- package/dist/chunk-O4BYNRCA.js.map +1 -0
- package/dist/{core-CrM2CTkH.d.ts → core-B0gU-OwN.d.ts} +34 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +18 -16
- package/dist/index.d.ts +61 -5
- package/dist/index.js +587 -505
- package/dist/index.js.map +1 -1
- package/dist/sandbox-RCDZ7SDZ.js +11 -0
- package/dist/sandbox.js +3 -2
- package/dist/schema.json +12 -0
- package/docs/README.md +1 -1
- package/docs/api.md +1 -1
- package/docs/data.md +8 -0
- package/docs/design-systems.md +21 -0
- package/docs/getting-started.md +1 -1
- package/docs/json-format.md +2 -0
- package/docs/theming.md +31 -0
- package/docs/widgets.md +2 -1
- package/package.json +1 -1
- package/dist/chunk-NLKXHTLO.js.map +0 -1
- package/dist/chunk-UK4FBI4D.js.map +0 -1
- package/dist/sandbox-WEMG76LE.js +0 -10
- /package/dist/{sandbox-WEMG76LE.js.map → sandbox-RCDZ7SDZ.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,42 @@ under the new version.
|
|
|
14
14
|
|
|
15
15
|
## [Unreleased]
|
|
16
16
|
|
|
17
|
+
## [0.1.42] - 2026-11-19
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `FlowMap` widget: a process flow drawn from data. Feed rows merge into one step, then the main path snakes in rows
|
|
22
|
+
joined by U-bends; markers per step kind (shapes or the host's images), value chips, site hand-offs (dashed, tagged),
|
|
23
|
+
untracked steps, needs-attention, a selected step with the others dimmed, a legend, a `hover` card slot, `details`
|
|
24
|
+
(values kept apart from the route, joined per step), and
|
|
25
|
+
`click` / `hover` events. Its code loads only when a dashboard uses it.
|
|
26
|
+
- Derived datasources take `path`: a part of the upstream result (templates allowed, e.g.
|
|
27
|
+
`"stages.${modal.args.key}.items"`), picked before `transform`.
|
|
28
|
+
- `ui.Drawer`: draw `presentation: "drawer"` modals with your own drawer component; the dashboard keeps the state and
|
|
29
|
+
passes `open`, `title`, `onClose`, `onReopen` (last arguments) and the content. Modals take `defaultArgs` and
|
|
30
|
+
`availableWhen` (while false the modal can't be open and a host drawer isn't drawn, e.g. a rail on one view only).
|
|
31
|
+
- `scale.parts.popover`: padding, radius, border, blur and gap of hover cards drawn above the page.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- `Container` with `direction: "column"`: children no longer get the row's equal-width basis (160 px) as their
|
|
36
|
+
height; in a column they keep their own height.
|
|
37
|
+
- `FlowMap` (in a fit layout) grows to its whole drawing instead of the minimum-width height.
|
|
38
|
+
- Modals and drawers use the dashboard's `grid.exactHeights` too.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Size budget for `index.js` raised from 132 to 136 kB gzip (the FlowMap's styles and schema; its code is a separate
|
|
43
|
+
chunk).
|
|
44
|
+
|
|
45
|
+
## [0.1.41] - 2026-11-19
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- `token`: typed references to the active theme's values (`token.color("text.secondary")`, `token.space("md")`,
|
|
50
|
+
`token.radius("card")`, `token.font("heading")`). They are CSS variables, so they follow light and dark mode.
|
|
51
|
+
- `createTheme((base) => …, start?)`: build a theme from the base theme's actual values.
|
|
52
|
+
|
|
17
53
|
## [0.1.40] - 2026-11-19
|
|
18
54
|
|
|
19
55
|
### Added
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ You describe a dashboard once as a JSON document (layout, filters, data sources,
|
|
|
10
10
|
what happens on click), and `<DashboardRenderer>` draws it. A new dashboard, or a new
|
|
11
11
|
version of one, is a new document — not new frontend code and not a redeploy.
|
|
12
12
|
|
|
13
|
-
- **
|
|
13
|
+
- **32 built-in widgets**: KPIs, charts, tables, tiles, status, layout containers and
|
|
14
14
|
small building blocks, nestable at any depth.
|
|
15
15
|
- **Data built in**: REST, GraphQL, SSE and WebSocket sources, auth and token refresh,
|
|
16
16
|
caching, polling, transforms.
|
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asRows,
|
|
3
|
+
evalOver,
|
|
4
|
+
field,
|
|
5
|
+
safeImageSrc
|
|
6
|
+
} from "./chunk-5LRFKK4I.js";
|
|
7
|
+
import {
|
|
8
|
+
interpolate,
|
|
9
|
+
scope
|
|
10
|
+
} from "./chunk-E4CT25TF.js";
|
|
11
|
+
import "./chunk-HUBYJ34E.js";
|
|
12
|
+
|
|
13
|
+
// src/widgets/builtins/FlowMapView.tsx
|
|
14
|
+
import {
|
|
15
|
+
useCallback,
|
|
16
|
+
useEffect,
|
|
17
|
+
useLayoutEffect,
|
|
18
|
+
useMemo,
|
|
19
|
+
useRef,
|
|
20
|
+
useState
|
|
21
|
+
} from "react";
|
|
22
|
+
import { createPortal } from "react-dom";
|
|
23
|
+
|
|
24
|
+
// src/widgets/shared/flowLayout.ts
|
|
25
|
+
var DEFAULTS = {
|
|
26
|
+
perRow: 6,
|
|
27
|
+
colGap: 160,
|
|
28
|
+
left: 110,
|
|
29
|
+
top: 70,
|
|
30
|
+
feedGap: 110,
|
|
31
|
+
firstRowGap: 220,
|
|
32
|
+
rowGap: 200,
|
|
33
|
+
stub: 40,
|
|
34
|
+
bendRight: 147,
|
|
35
|
+
bendLeft: 133,
|
|
36
|
+
width: 1030,
|
|
37
|
+
bottom: 100,
|
|
38
|
+
mainStartsAt: 1
|
|
39
|
+
};
|
|
40
|
+
function layoutFlow(input, options = {}) {
|
|
41
|
+
const o = {
|
|
42
|
+
...DEFAULTS,
|
|
43
|
+
...Object.fromEntries(Object.entries(options).filter(([, v]) => v !== void 0))
|
|
44
|
+
};
|
|
45
|
+
const perRow = Math.max(1, Math.floor(o.perRow));
|
|
46
|
+
const colX = (col2) => o.left + col2 * o.colGap;
|
|
47
|
+
const empty = { steps: [], tracks: [], chevrons: [], siteStarts: [], width: o.width, height: o.top + o.bottom };
|
|
48
|
+
if (input.length === 0) return empty;
|
|
49
|
+
const order = [];
|
|
50
|
+
const byGroup = /* @__PURE__ */ new Map();
|
|
51
|
+
for (const s of input) {
|
|
52
|
+
const g = s.group ?? "";
|
|
53
|
+
if (!byGroup.has(g)) {
|
|
54
|
+
byGroup.set(g, []);
|
|
55
|
+
order.push(g);
|
|
56
|
+
}
|
|
57
|
+
byGroup.get(g)?.push(s);
|
|
58
|
+
}
|
|
59
|
+
const mainKey = o.mainGroup !== void 0 && byGroup.has(o.mainGroup) ? o.mainGroup : order[order.length - 1];
|
|
60
|
+
const mainAll = byGroup.get(mainKey) ?? [];
|
|
61
|
+
const split = order.length > 1 ? Math.min(Math.max(0, o.mainStartsAt), mainAll.length - 1) : 0;
|
|
62
|
+
const feeds = [
|
|
63
|
+
...order.filter((g) => g !== mainKey).map((g) => byGroup.get(g) ?? []),
|
|
64
|
+
mainAll.slice(0, split)
|
|
65
|
+
].filter((f) => f.length > 0);
|
|
66
|
+
const mainSteps = mainAll.slice(split);
|
|
67
|
+
const mergeRow = Math.min(Math.max(0, o.mergeRow ?? Math.floor(feeds.length / 2)), Math.max(0, feeds.length - 1));
|
|
68
|
+
const feedCols = feeds.length ? Math.max(...feeds.map((f) => f.length)) : 0;
|
|
69
|
+
const mainTop = o.top + mergeRow * o.feedGap;
|
|
70
|
+
const rowY = (row2) => mainTop + (row2 === 0 ? 0 : o.firstRowGap + (row2 - 1) * o.rowGap);
|
|
71
|
+
const lastCol = Math.max(perRow - 1, feedCols);
|
|
72
|
+
const main = [];
|
|
73
|
+
let row = 0;
|
|
74
|
+
let col = feedCols;
|
|
75
|
+
let dir = 1;
|
|
76
|
+
for (const s of mainSteps) {
|
|
77
|
+
main.push({ ...s, x: colX(col), y: rowY(row), feed: false });
|
|
78
|
+
const next = col + dir;
|
|
79
|
+
if (next < 0 || next > lastCol) {
|
|
80
|
+
row += 1;
|
|
81
|
+
dir = dir === 1 ? -1 : 1;
|
|
82
|
+
} else col = next;
|
|
83
|
+
}
|
|
84
|
+
const merge = main[0];
|
|
85
|
+
const steps = [];
|
|
86
|
+
const tracks = [];
|
|
87
|
+
const chevrons = [];
|
|
88
|
+
const siteStarts = [];
|
|
89
|
+
feeds.forEach((feed, f) => {
|
|
90
|
+
const y = o.top + f * o.feedGap;
|
|
91
|
+
const placed = feed.map((s, i) => ({ ...s, x: colX(i), y, feed: true }));
|
|
92
|
+
steps.push(...placed);
|
|
93
|
+
const start = colX(0) - o.stub;
|
|
94
|
+
const end = merge ?? placed[placed.length - 1];
|
|
95
|
+
if (!end) return;
|
|
96
|
+
const bendFrom = colX(Math.max(0, feedCols - 1));
|
|
97
|
+
const mid = (bendFrom + end.x) / 2;
|
|
98
|
+
tracks.push({
|
|
99
|
+
d: y === end.y ? `M ${start} ${y} H ${end.x}` : `M ${start} ${y} H ${bendFrom} C ${mid} ${y} ${mid} ${end.y} ${end.x} ${end.y}`,
|
|
100
|
+
dashed: false
|
|
101
|
+
});
|
|
102
|
+
chevrons.push({ x: colX(0) + o.colGap / 2, y, dir: 1 });
|
|
103
|
+
});
|
|
104
|
+
steps.push(...main);
|
|
105
|
+
if (feeds.length === 0 && merge) tracks.push({ d: `M ${merge.x - o.stub} ${merge.y} H ${merge.x}`, dashed: false });
|
|
106
|
+
main.slice(1).forEach((to, i) => {
|
|
107
|
+
const from = main[i];
|
|
108
|
+
const dashed = Boolean(to.site) && to.site !== from.site;
|
|
109
|
+
if (from.y === to.y) {
|
|
110
|
+
tracks.push({ d: `M ${from.x} ${from.y} H ${to.x}`, dashed });
|
|
111
|
+
chevrons.push({ x: (from.x + to.x) / 2, y: from.y, dir: to.x > from.x ? 1 : -1 });
|
|
112
|
+
} else {
|
|
113
|
+
const out = from.x >= colX(lastCol) ? from.x + o.bendRight : from.x - o.bendLeft;
|
|
114
|
+
tracks.push({ d: `M ${from.x} ${from.y} C ${out} ${from.y} ${out} ${to.y} ${to.x} ${to.y}`, dashed });
|
|
115
|
+
}
|
|
116
|
+
if (dashed) siteStarts.push({ id: to.id, site: to.site, x: to.x, y: to.y });
|
|
117
|
+
});
|
|
118
|
+
const lastY = main.length ? main[main.length - 1].y : Math.max(...steps.map((s) => s.y));
|
|
119
|
+
return { steps, tracks, chevrons, siteStarts, width: o.width, height: lastY + o.bottom };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// src/widgets/builtins/FlowMapView.tsx
|
|
123
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
124
|
+
var LABEL_W = 136;
|
|
125
|
+
var LABEL_CHAR_W = 6.4;
|
|
126
|
+
var LABEL_GAP = 20;
|
|
127
|
+
var LABEL_LINE = 17;
|
|
128
|
+
var LABEL_LINE_SELECTED = 19;
|
|
129
|
+
var CHIP_TOP = 18;
|
|
130
|
+
var CHIP_H = 25;
|
|
131
|
+
var CHIP_PAD = 10;
|
|
132
|
+
var CHIP_GAP = 4;
|
|
133
|
+
var TAG_TOP = 60;
|
|
134
|
+
var TAG_H = 17;
|
|
135
|
+
var CLOSE_DELAY = 150;
|
|
136
|
+
function flowColor(c, fallback) {
|
|
137
|
+
if (!c) return fallback;
|
|
138
|
+
if (/^[a-z]+(\.[a-zA-Z]+)+$/.test(c))
|
|
139
|
+
return `var(--ds-color-${c.split(".").map((p) => p.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)).join("-")})`;
|
|
140
|
+
return /^[#a-zA-Z0-9(),.%\s-]+$/.test(c) ? c : fallback;
|
|
141
|
+
}
|
|
142
|
+
function wrapFlowLabel(label, oneLine) {
|
|
143
|
+
if (oneLine) return [label];
|
|
144
|
+
const lines = [];
|
|
145
|
+
for (const word of label.split(" ")) {
|
|
146
|
+
const last = lines[lines.length - 1];
|
|
147
|
+
if (last !== void 0 && (last.length + 1 + word.length) * LABEL_CHAR_W <= LABEL_W)
|
|
148
|
+
lines[lines.length - 1] = `${last} ${word}`;
|
|
149
|
+
else lines.push(word);
|
|
150
|
+
}
|
|
151
|
+
return lines;
|
|
152
|
+
}
|
|
153
|
+
function read(spec, row, helpers) {
|
|
154
|
+
if (!spec) return void 0;
|
|
155
|
+
if (!spec.includes("${")) return field(row, spec);
|
|
156
|
+
try {
|
|
157
|
+
return interpolate(spec, scope({ row }, helpers));
|
|
158
|
+
} catch {
|
|
159
|
+
return void 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function MarkerShape({ m, x, y, dim }) {
|
|
163
|
+
const src = m.image ? safeImageSrc(dim && m.image.dimmedSrc ? m.image.dimmedSrc : m.image.src) : void 0;
|
|
164
|
+
if (src) {
|
|
165
|
+
const s2 = m.image?.size ?? 26;
|
|
166
|
+
return /* @__PURE__ */ jsx("image", { href: src, x: x - s2 / 2, y: y - s2 / 2, width: s2, height: s2, pointerEvents: "none" });
|
|
167
|
+
}
|
|
168
|
+
const s = m.size ?? (m.shape === "diamond" ? 24 : 20);
|
|
169
|
+
const fill = flowColor(
|
|
170
|
+
m.color,
|
|
171
|
+
m.shape === "diamond" ? "var(--ds-color-status-good-solid)" : "var(--ds-color-action-primary)"
|
|
172
|
+
);
|
|
173
|
+
const common = { className: "ds-flow-shape", fill, style: { "--ds-flow-fill": fill } };
|
|
174
|
+
if (m.shape === "diamond") {
|
|
175
|
+
const r = s / 2;
|
|
176
|
+
return /* @__PURE__ */ jsx("path", { ...common, d: `M ${x} ${y - r} L ${x + r} ${y} L ${x} ${y + r} L ${x - r} ${y} Z` });
|
|
177
|
+
}
|
|
178
|
+
if (m.shape === "square") return /* @__PURE__ */ jsx("rect", { ...common, x: x - s / 2, y: y - s / 2, width: s, height: s, rx: 3 });
|
|
179
|
+
if (m.shape === "triangle") {
|
|
180
|
+
const r = s / 2;
|
|
181
|
+
return /* @__PURE__ */ jsx("path", { ...common, d: `M ${x} ${y - r} L ${x + r} ${y + r} L ${x - r} ${y + r} Z` });
|
|
182
|
+
}
|
|
183
|
+
return /* @__PURE__ */ jsx("circle", { ...common, cx: x, cy: y, r: s / 2 });
|
|
184
|
+
}
|
|
185
|
+
function Pic({ img, x, y, dim, className }) {
|
|
186
|
+
const src = safeImageSrc(dim && img.dimmedSrc ? img.dimmedSrc : img.src);
|
|
187
|
+
if (!src) return null;
|
|
188
|
+
const s = img.size ?? 32;
|
|
189
|
+
return /* @__PURE__ */ jsx("image", { href: src, x: x - s / 2, y: y - s / 2, width: s, height: s, className, pointerEvents: "none" });
|
|
190
|
+
}
|
|
191
|
+
function Chip({ x, y, value, unit, tone }) {
|
|
192
|
+
const ref = useRef(null);
|
|
193
|
+
const [w, setW] = useState(value.length * 8 + (unit ? CHIP_GAP + unit.length * 6.4 : 0));
|
|
194
|
+
useLayoutEffect(() => {
|
|
195
|
+
const t = ref.current;
|
|
196
|
+
if (t && typeof t.getComputedTextLength === "function") {
|
|
197
|
+
const len = t.getComputedTextLength();
|
|
198
|
+
if (len > 0) setW(len);
|
|
199
|
+
}
|
|
200
|
+
}, [value, unit]);
|
|
201
|
+
const width = w + CHIP_PAD * 2;
|
|
202
|
+
return /* @__PURE__ */ jsxs("g", { className: "ds-flow-chip", "data-tone": tone, children: [
|
|
203
|
+
/* @__PURE__ */ jsx("rect", { x: x - width / 2, y: y + CHIP_TOP, width, height: CHIP_H, rx: 4 }),
|
|
204
|
+
/* @__PURE__ */ jsxs("text", { ref, x, y: y + CHIP_TOP + CHIP_H / 2, textAnchor: "middle", dominantBaseline: "central", children: [
|
|
205
|
+
/* @__PURE__ */ jsx("tspan", { className: "ds-flow-chip-value", children: value }),
|
|
206
|
+
unit ? /* @__PURE__ */ jsx("tspan", { className: "ds-flow-chip-unit", dx: CHIP_GAP, children: unit }) : null
|
|
207
|
+
] })
|
|
208
|
+
] });
|
|
209
|
+
}
|
|
210
|
+
function HoverCard({
|
|
211
|
+
rect,
|
|
212
|
+
children,
|
|
213
|
+
onEnter,
|
|
214
|
+
onLeave
|
|
215
|
+
}) {
|
|
216
|
+
const ref = useRef(null);
|
|
217
|
+
const [host, setHost] = useState(null);
|
|
218
|
+
const [pos, setPos] = useState({ left: -9999, top: -9999 });
|
|
219
|
+
useLayoutEffect(() => {
|
|
220
|
+
const el = ref.current;
|
|
221
|
+
if (!el) return;
|
|
222
|
+
const { width, height } = el.getBoundingClientRect();
|
|
223
|
+
const cx = rect.left + rect.width / 2;
|
|
224
|
+
const left = Math.max(8, Math.min(cx - width / 2, window.innerWidth - width - 8));
|
|
225
|
+
const above = rect.top - height - 12;
|
|
226
|
+
setPos({ left, top: above >= 8 ? above : rect.bottom + 12 });
|
|
227
|
+
}, [rect]);
|
|
228
|
+
const body = /* @__PURE__ */ jsx(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
ref: (el) => {
|
|
232
|
+
ref.current = el;
|
|
233
|
+
if (el && !host) setHost(el.closest(".ds-root"));
|
|
234
|
+
},
|
|
235
|
+
className: "ds-flow-hover",
|
|
236
|
+
role: "tooltip",
|
|
237
|
+
style: { left: pos.left, top: pos.top },
|
|
238
|
+
onMouseEnter: onEnter,
|
|
239
|
+
onMouseLeave: onLeave,
|
|
240
|
+
children
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
return host ? createPortal(body, host) : body;
|
|
244
|
+
}
|
|
245
|
+
function FlowMapView({ spec, data, emit, helpers, renderSlot }) {
|
|
246
|
+
const details = spec.details && typeof spec.details === "object" ? spec.details : void 0;
|
|
247
|
+
const rows = useMemo(
|
|
248
|
+
() => asRows(data).map((r) => {
|
|
249
|
+
if (!details || !r || typeof r !== "object") return r;
|
|
250
|
+
const id = String(field(r, spec.id) ?? "");
|
|
251
|
+
return { ...r, detail: Object.hasOwn(details, id) ? details[id] : null };
|
|
252
|
+
}),
|
|
253
|
+
[data, details, spec.id]
|
|
254
|
+
);
|
|
255
|
+
const markers = spec.markers ?? {};
|
|
256
|
+
const steps = useMemo(
|
|
257
|
+
() => rows.map((row) => {
|
|
258
|
+
const id = String(field(row, spec.id) ?? "");
|
|
259
|
+
const kind = String(read(spec.kind, row, helpers) ?? "default");
|
|
260
|
+
const tracked = spec.trackedWhen ? Boolean(evalOver(spec.trackedWhen, { row }, helpers)) : true;
|
|
261
|
+
const value = read(spec.value, row, helpers);
|
|
262
|
+
return {
|
|
263
|
+
id,
|
|
264
|
+
row,
|
|
265
|
+
kind,
|
|
266
|
+
label: String(read(spec.label, row, helpers) ?? id),
|
|
267
|
+
group: spec.group ? String(field(row, spec.group) ?? "") : void 0,
|
|
268
|
+
site: spec.site ? field(row, spec.site) ?? void 0 : void 0,
|
|
269
|
+
tracked,
|
|
270
|
+
attention: tracked && spec.attentionWhen ? Boolean(evalOver(spec.attentionWhen, { row }, helpers)) : false,
|
|
271
|
+
value: value === null || value === void 0 || value === "" ? spec.emptyValue : String(value),
|
|
272
|
+
unit: value === null || value === void 0 || value === "" ? "" : String(read(spec.unit, row, helpers) ?? "")
|
|
273
|
+
};
|
|
274
|
+
}),
|
|
275
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: rows/spec/helpers identify the input
|
|
276
|
+
[rows, spec, helpers]
|
|
277
|
+
);
|
|
278
|
+
const byId = useMemo(() => new Map(steps.map((s) => [s.id, s])), [steps]);
|
|
279
|
+
const layout = useMemo(
|
|
280
|
+
() => layoutFlow(
|
|
281
|
+
steps.map((s) => ({ id: s.id, group: s.group, site: s.site })),
|
|
282
|
+
spec.layout ?? {}
|
|
283
|
+
),
|
|
284
|
+
[steps, spec.layout]
|
|
285
|
+
);
|
|
286
|
+
const selected = spec.selected || void 0;
|
|
287
|
+
const inspecting = Boolean(selected && byId.has(selected));
|
|
288
|
+
const [hover, setHover] = useState(null);
|
|
289
|
+
const timer = useRef(void 0);
|
|
290
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
291
|
+
const keep = useCallback(() => clearTimeout(timer.current), []);
|
|
292
|
+
const closeSoon = useCallback(() => {
|
|
293
|
+
clearTimeout(timer.current);
|
|
294
|
+
timer.current = setTimeout(() => setHover(null), CLOSE_DELAY);
|
|
295
|
+
}, []);
|
|
296
|
+
useEffect(() => {
|
|
297
|
+
if (inspecting) setHover(null);
|
|
298
|
+
}, [inspecting]);
|
|
299
|
+
const [head, setHead] = useState(null);
|
|
300
|
+
const findHead = useCallback((el) => {
|
|
301
|
+
setHead(el?.closest(".ds-panel")?.querySelector(":scope > .ds-panel-head .ds-panel-tools") ?? null);
|
|
302
|
+
}, []);
|
|
303
|
+
const anyUntracked = steps.some((s) => !s.tracked);
|
|
304
|
+
const legendItems = [
|
|
305
|
+
...Object.entries(markers).filter(([, m]) => m.legend).map(([kind, m]) => ({ kind, label: m.legend, m }))
|
|
306
|
+
];
|
|
307
|
+
const legend = spec.legend && (legendItems.length || spec.attention?.legend) ? /* @__PURE__ */ jsxs("ul", { className: "ds-flow-legend", children: [
|
|
308
|
+
legendItems.map((l) => /* @__PURE__ */ jsxs("li", { children: [
|
|
309
|
+
/* @__PURE__ */ jsx("svg", { width: "22", height: "22", viewBox: "-11 -11 22 22", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
310
|
+
MarkerShape,
|
|
311
|
+
{
|
|
312
|
+
m: { ...l.m, size: l.m.image ? 22 : l.m.shape === "diamond" ? 16 : 18 },
|
|
313
|
+
x: 0,
|
|
314
|
+
y: 0,
|
|
315
|
+
dim: false
|
|
316
|
+
}
|
|
317
|
+
) }),
|
|
318
|
+
l.label
|
|
319
|
+
] }, l.kind)),
|
|
320
|
+
anyUntracked && spec.untrackedLegend ? /* @__PURE__ */ jsxs("li", { "data-kind": "untracked", children: [
|
|
321
|
+
/* @__PURE__ */ jsx("svg", { width: "22", height: "22", viewBox: "-11 -11 22 22", "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { className: "ds-flow-untracked", r: 8 }) }),
|
|
322
|
+
spec.untrackedLegend
|
|
323
|
+
] }) : null,
|
|
324
|
+
spec.attention?.legend ? /* @__PURE__ */ jsxs("li", { "data-kind": "attention", children: [
|
|
325
|
+
/* @__PURE__ */ jsxs("svg", { width: "22", height: "22", viewBox: "-11 -11 22 22", "aria-hidden": "true", children: [
|
|
326
|
+
/* @__PURE__ */ jsx(
|
|
327
|
+
"circle",
|
|
328
|
+
{
|
|
329
|
+
r: 9,
|
|
330
|
+
fill: "var(--ds-color-surface-card)",
|
|
331
|
+
stroke: flowColor(spec.attention.color, "var(--ds-color-status-bad-fg)"),
|
|
332
|
+
strokeWidth: 2
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
/* @__PURE__ */ jsx("circle", { r: 5.5, fill: "var(--ds-color-action-primary)" })
|
|
336
|
+
] }),
|
|
337
|
+
spec.attention.legend
|
|
338
|
+
] }) : null
|
|
339
|
+
] }) : null;
|
|
340
|
+
const markerFor = (kind) => markers[kind] ?? markers.default ?? { shape: "circle" };
|
|
341
|
+
const attnColor = flowColor(spec.attention?.color, "var(--ds-color-status-bad-fg)");
|
|
342
|
+
const selColor = flowColor(spec.selection?.color, "var(--ds-color-action-primary)");
|
|
343
|
+
const hovered = hover ? byId.get(hover.id) : void 0;
|
|
344
|
+
const tagFor = (id, site) => {
|
|
345
|
+
const s = byId.get(id);
|
|
346
|
+
return String(spec.siteLabel ? read(spec.siteLabel, s?.row, helpers) ?? site : site);
|
|
347
|
+
};
|
|
348
|
+
return /* @__PURE__ */ jsxs("div", { className: "ds-flow", ref: findHead, children: [
|
|
349
|
+
head && legend ? createPortal(legend, head) : legend,
|
|
350
|
+
/* @__PURE__ */ jsx("div", { className: "ds-flow-scroll", children: /* @__PURE__ */ jsxs(
|
|
351
|
+
"svg",
|
|
352
|
+
{
|
|
353
|
+
className: "ds-flow-svg",
|
|
354
|
+
viewBox: `0 0 ${layout.width} ${layout.height}`,
|
|
355
|
+
style: { maxWidth: layout.width, minWidth: spec.minWidth },
|
|
356
|
+
"data-inspecting": inspecting || void 0,
|
|
357
|
+
role: "group",
|
|
358
|
+
"aria-label": spec.title ?? "Flow",
|
|
359
|
+
children: [
|
|
360
|
+
layout.tracks.map((t) => /* @__PURE__ */ jsx("path", { className: "ds-flow-track", "data-dashed": t.dashed || void 0, d: t.d }, t.d)),
|
|
361
|
+
layout.chevrons.map((c) => /* @__PURE__ */ jsx(
|
|
362
|
+
"path",
|
|
363
|
+
{
|
|
364
|
+
className: "ds-flow-chevron",
|
|
365
|
+
d: `M ${c.x - 2.5 * c.dir} ${c.y - 4} L ${c.x + 2.5 * c.dir} ${c.y} L ${c.x - 2.5 * c.dir} ${c.y + 4}`
|
|
366
|
+
},
|
|
367
|
+
`${c.x}-${c.y}`
|
|
368
|
+
)),
|
|
369
|
+
layout.siteStarts.map((t) => {
|
|
370
|
+
const s = byId.get(t.id);
|
|
371
|
+
const label = tagFor(t.id, t.site);
|
|
372
|
+
const w = label.length * 6 + 16;
|
|
373
|
+
const lines = wrapFlowLabel(s?.label ?? "", t.id === selected).length;
|
|
374
|
+
const top = t.y - TAG_TOP - (lines - 1) * LABEL_LINE;
|
|
375
|
+
return /* @__PURE__ */ jsxs("g", { className: "ds-flow-tag", "data-dim": inspecting || void 0, children: [
|
|
376
|
+
/* @__PURE__ */ jsx("rect", { x: t.x - w / 2, y: top, width: w, height: TAG_H, rx: TAG_H / 2 }),
|
|
377
|
+
/* @__PURE__ */ jsx("text", { x: t.x, y: top + TAG_H / 2, textAnchor: "middle", dominantBaseline: "central", children: label })
|
|
378
|
+
] }, t.id);
|
|
379
|
+
}),
|
|
380
|
+
layout.steps.map((p) => {
|
|
381
|
+
const s = byId.get(p.id);
|
|
382
|
+
if (!s) return null;
|
|
383
|
+
const isSel = selected === s.id;
|
|
384
|
+
const dim = inspecting && spec.dimOthers && !isSel;
|
|
385
|
+
const m = markerFor(s.kind);
|
|
386
|
+
const lines = wrapFlowLabel(s.label, p.feed || isSel);
|
|
387
|
+
const lineH = isSel ? LABEL_LINE_SELECTED : LABEL_LINE;
|
|
388
|
+
const firstY = p.y - LABEL_GAP - (lines.length - 1) * lineH;
|
|
389
|
+
const ring = spec.attention?.ring?.[s.kind] ?? spec.attention?.ring?.default;
|
|
390
|
+
const open = () => {
|
|
391
|
+
if (!s.tracked) return;
|
|
392
|
+
keep();
|
|
393
|
+
setHover(null);
|
|
394
|
+
emit("click", "step", { datum: s.row, value: s.id });
|
|
395
|
+
};
|
|
396
|
+
const chipTone = isSel ? "selected" : dim ? "dim" : m.chipTone ?? "neutral";
|
|
397
|
+
return /* @__PURE__ */ jsxs(
|
|
398
|
+
"g",
|
|
399
|
+
{
|
|
400
|
+
className: "ds-flow-step",
|
|
401
|
+
role: "button",
|
|
402
|
+
tabIndex: s.tracked ? 0 : -1,
|
|
403
|
+
"aria-label": `${s.label}${s.tracked ? `, ${s.value}${s.unit ? ` ${s.unit}` : ""}` : ""}`,
|
|
404
|
+
"aria-disabled": !s.tracked || void 0,
|
|
405
|
+
"aria-pressed": isSel,
|
|
406
|
+
"data-kind": s.kind,
|
|
407
|
+
"data-dim": dim || void 0,
|
|
408
|
+
"data-selected": isSel || void 0,
|
|
409
|
+
"data-untracked": !s.tracked || void 0,
|
|
410
|
+
"data-attention": s.attention || void 0,
|
|
411
|
+
onMouseEnter: (e) => {
|
|
412
|
+
if (!s.tracked || inspecting) return;
|
|
413
|
+
keep();
|
|
414
|
+
const hit = e.currentTarget.querySelector(".ds-flow-hit");
|
|
415
|
+
setHover({ id: s.id, rect: (hit ?? e.currentTarget).getBoundingClientRect() });
|
|
416
|
+
emit("hover", "step", { datum: s.row, value: s.id });
|
|
417
|
+
},
|
|
418
|
+
onMouseLeave: () => {
|
|
419
|
+
closeSoon();
|
|
420
|
+
emit("hoverEnd", "step", { datum: s.row, value: s.id });
|
|
421
|
+
},
|
|
422
|
+
onFocus: (e) => {
|
|
423
|
+
if (s.tracked && !inspecting) setHover({ id: s.id, rect: e.currentTarget.getBoundingClientRect() });
|
|
424
|
+
},
|
|
425
|
+
onBlur: closeSoon,
|
|
426
|
+
onClick: open,
|
|
427
|
+
onKeyDown: (e) => {
|
|
428
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
429
|
+
e.preventDefault();
|
|
430
|
+
open();
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ jsx("text", { className: "ds-flow-label", textAnchor: "middle", "data-selected": isSel || void 0, children: lines.map((line, i) => /* @__PURE__ */ jsx("tspan", { x: p.x, y: firstY + i * lineH, children: line }, `${i}-${line}`)) }),
|
|
435
|
+
s.attention ? spec.attention?.halo ? /* @__PURE__ */ jsx(Pic, { img: spec.attention.halo, x: p.x, y: p.y, dim, className: "ds-flow-halo" }) : /* @__PURE__ */ jsx("circle", { className: "ds-flow-halo", cx: p.x, cy: p.y, r: 22, fill: attnColor, opacity: 0.14 }) : null,
|
|
436
|
+
isSel && !s.attention ? spec.selection?.halo ? /* @__PURE__ */ jsx(Pic, { img: spec.selection.halo, x: p.x, y: p.y }) : /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: 22, fill: selColor, opacity: 0.14 }) : null,
|
|
437
|
+
s.tracked ? /* @__PURE__ */ jsx(MarkerShape, { m, x: p.x, y: p.y, dim }) : /* @__PURE__ */ jsx("circle", { className: "ds-flow-untracked", cx: p.x, cy: p.y, r: 9 }),
|
|
438
|
+
s.attention ? ring ? /* @__PURE__ */ jsx(Pic, { img: ring, x: p.x, y: p.y, dim }) : /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: 15, fill: "none", stroke: attnColor, strokeWidth: 2.5 }) : null,
|
|
439
|
+
isSel && !s.attention || hover?.id === s.id && !inspecting ? spec.selection?.ring ? /* @__PURE__ */ jsx(Pic, { img: spec.selection.ring, x: p.x, y: p.y }) : /* @__PURE__ */ jsx("circle", { cx: p.x, cy: p.y, r: 16, fill: "none", stroke: selColor, strokeWidth: 2.5 }) : null,
|
|
440
|
+
/* @__PURE__ */ jsx("circle", { className: "ds-flow-hit", cx: p.x, cy: p.y, r: 22 }),
|
|
441
|
+
s.tracked ? /* @__PURE__ */ jsx(Chip, { x: p.x, y: p.y, value: s.value, unit: s.unit, tone: chipTone }) : null
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
s.id
|
|
445
|
+
);
|
|
446
|
+
})
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
) }),
|
|
450
|
+
hover && hovered ? /* @__PURE__ */ jsx(HoverCard, { rect: hover.rect, onEnter: keep, onLeave: closeSoon, children: renderSlot("hover", { item: hovered.row }) }) : null
|
|
451
|
+
] });
|
|
452
|
+
}
|
|
453
|
+
export {
|
|
454
|
+
FlowMapView,
|
|
455
|
+
flowColor,
|
|
456
|
+
wrapFlowLabel
|
|
457
|
+
};
|
|
458
|
+
//# sourceMappingURL=FlowMapView-BSTKU7D4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/widgets/builtins/FlowMapView.tsx","../src/widgets/shared/flowLayout.ts"],"sourcesContent":["import {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { scope } from \"../../core/expr/evaluate\";\nimport { interpolate } from \"../../core/expr/template\";\nimport { evalOver } from \"../shared/chips\";\nimport { type PlacedStep, layoutFlow } from \"../shared/flowLayout\";\nimport { asRows, field } from \"../shared/format\";\nimport { safeImageSrc } from \"../shared/safeSrc\";\nimport type { WidgetProps } from \"../types\";\nimport type { FlowMapProps } from \"./FlowMap\";\n\ntype Obj = Record<string, unknown>;\ntype Img = { src: string; dimmedSrc?: string | undefined; size?: number | undefined };\ntype MarkerSpec = {\n shape?: \"circle\" | \"diamond\" | \"square\" | \"triangle\" | undefined;\n color?: string | undefined;\n size?: number | undefined;\n image?: Img | undefined;\n legend?: string | undefined;\n chipTone?: string | undefined;\n};\n\n/** Labels: centred, at most this wide before wrapping, their last line this far above the marker. */\nconst LABEL_W = 136;\nconst LABEL_CHAR_W = 6.4;\nconst LABEL_GAP = 20;\nconst LABEL_LINE = 17;\nconst LABEL_LINE_SELECTED = 19;\n/** The value chip: its top below the marker centre, height, padding. */\nconst CHIP_TOP = 18;\nconst CHIP_H = 25;\nconst CHIP_PAD = 10;\nconst CHIP_GAP = 4;\n/** The site tag: its top above the step, height. */\nconst TAG_TOP = 60;\nconst TAG_H = 17;\n/** The pointer may move from a step to its hover card in this time. */\nconst CLOSE_DELAY = 150;\n\n/** A theme colour path (\"status.good.solid\") becomes its CSS variable; anything else is a CSS colour. */\nexport function flowColor(c: string | undefined, fallback: string): string {\n if (!c) return fallback;\n if (/^[a-z]+(\\.[a-zA-Z]+)+$/.test(c))\n return `var(--ds-color-${c\n .split(\".\")\n .map((p) => p.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`))\n .join(\"-\")})`;\n return /^[#a-zA-Z0-9(),.%\\s-]+$/.test(c) ? c : fallback;\n}\n\n/** Greedy wrap to the label box (\"Mould Cooling &\" / \"Knockout\"). */\nexport function wrapFlowLabel(label: string, oneLine: boolean): string[] {\n if (oneLine) return [label];\n const lines: string[] = [];\n for (const word of label.split(\" \")) {\n const last = lines[lines.length - 1];\n if (last !== undefined && (last.length + 1 + word.length) * LABEL_CHAR_W <= LABEL_W)\n lines[lines.length - 1] = `${last} ${word}`;\n else lines.push(word);\n }\n return lines;\n}\n\n/** A field name, or a `${row…}` template over the row. */\nfunction read(spec: string | undefined, row: unknown, helpers: unknown): unknown {\n if (!spec) return undefined;\n if (!spec.includes(\"${\")) return field(row, spec);\n try {\n return interpolate(spec, scope({ row }, helpers as Obj));\n } catch {\n return undefined;\n }\n}\n\nfunction MarkerShape({ m, x, y, dim }: { m: MarkerSpec; x: number; y: number; dim: boolean }) {\n const src = m.image ? safeImageSrc(dim && m.image.dimmedSrc ? m.image.dimmedSrc : m.image.src) : undefined;\n if (src) {\n const s = m.image?.size ?? 26;\n return <image href={src} x={x - s / 2} y={y - s / 2} width={s} height={s} pointerEvents=\"none\" />;\n }\n const s = m.size ?? (m.shape === \"diamond\" ? 24 : 20);\n const fill = flowColor(\n m.color,\n m.shape === \"diamond\" ? \"var(--ds-color-status-good-solid)\" : \"var(--ds-color-action-primary)\",\n );\n const common = { className: \"ds-flow-shape\", fill, style: { \"--ds-flow-fill\": fill } as CSSProperties };\n if (m.shape === \"diamond\") {\n const r = s / 2;\n return <path {...common} d={`M ${x} ${y - r} L ${x + r} ${y} L ${x} ${y + r} L ${x - r} ${y} Z`} />;\n }\n if (m.shape === \"square\") return <rect {...common} x={x - s / 2} y={y - s / 2} width={s} height={s} rx={3} />;\n if (m.shape === \"triangle\") {\n const r = s / 2;\n return <path {...common} d={`M ${x} ${y - r} L ${x + r} ${y + r} L ${x - r} ${y + r} Z`} />;\n }\n return <circle {...common} cx={x} cy={y} r={s / 2} />;\n}\n\nfunction Pic({ img, x, y, dim, className }: { img: Img; x: number; y: number; dim?: boolean; className?: string }) {\n const src = safeImageSrc(dim && img.dimmedSrc ? img.dimmedSrc : img.src);\n if (!src) return null;\n const s = img.size ?? 32;\n return (\n <image href={src} x={x - s / 2} y={y - s / 2} width={s} height={s} className={className} pointerEvents=\"none\" />\n );\n}\n\n/** The value chip, sized to its measured text. */\nfunction Chip({ x, y, value, unit, tone }: { x: number; y: number; value: string; unit: string; tone: string }) {\n const ref = useRef<SVGTextElement | null>(null);\n const [w, setW] = useState(value.length * 8 + (unit ? CHIP_GAP + unit.length * 6.4 : 0));\n // biome-ignore lint/correctness/useExhaustiveDependencies: measure again when the text changes\n useLayoutEffect(() => {\n const t = ref.current;\n if (t && typeof t.getComputedTextLength === \"function\") {\n const len = t.getComputedTextLength();\n if (len > 0) setW(len);\n }\n }, [value, unit]);\n const width = w + CHIP_PAD * 2;\n return (\n <g className=\"ds-flow-chip\" data-tone={tone}>\n <rect x={x - width / 2} y={y + CHIP_TOP} width={width} height={CHIP_H} rx={4} />\n <text ref={ref} x={x} y={y + CHIP_TOP + CHIP_H / 2} textAnchor=\"middle\" dominantBaseline=\"central\">\n <tspan className=\"ds-flow-chip-value\">{value}</tspan>\n {unit ? (\n <tspan className=\"ds-flow-chip-unit\" dx={CHIP_GAP}>\n {unit}\n </tspan>\n ) : null}\n </text>\n </g>\n );\n}\n\n/** The hover card: above the step (below when there is no room), inside the dashboard. */\nfunction HoverCard({\n rect,\n children,\n onEnter,\n onLeave,\n}: {\n rect: DOMRect;\n children: ReactNode;\n onEnter: () => void;\n onLeave: () => void;\n}) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [host, setHost] = useState<Element | null>(null);\n const [pos, setPos] = useState({ left: -9999, top: -9999 });\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n const { width, height } = el.getBoundingClientRect();\n const cx = rect.left + rect.width / 2;\n const left = Math.max(8, Math.min(cx - width / 2, window.innerWidth - width - 8));\n const above = rect.top - height - 12;\n setPos({ left, top: above >= 8 ? above : rect.bottom + 12 });\n }, [rect]);\n const body = (\n <div\n ref={(el) => {\n ref.current = el;\n if (el && !host) setHost(el.closest(\".ds-root\"));\n }}\n className=\"ds-flow-hover\"\n role=\"tooltip\"\n style={{ left: pos.left, top: pos.top }}\n onMouseEnter={onEnter}\n onMouseLeave={onLeave}\n >\n {children}\n </div>\n );\n return host ? createPortal(body, host) : body;\n}\n\n/** The FlowMap's component, loaded on first use (see FlowMap.tsx). */\nexport function FlowMapView({ spec, data, emit, helpers, renderSlot }: WidgetProps<FlowMapProps>) {\n // `details`: values kept apart from the route, joined onto each step as `row.detail`.\n const details = spec.details && typeof spec.details === \"object\" ? (spec.details as Obj) : undefined;\n const rows = useMemo(\n () =>\n asRows(data).map((r) => {\n if (!details || !r || typeof r !== \"object\") return r;\n const id = String(field(r, spec.id) ?? \"\");\n return { ...(r as Obj), detail: Object.hasOwn(details, id) ? details[id] : null };\n }),\n [data, details, spec.id],\n );\n const markers = (spec.markers ?? {}) as Record<string, MarkerSpec>;\n const steps = useMemo(\n () =>\n rows.map((row) => {\n const id = String(field(row, spec.id) ?? \"\");\n const kind = String(read(spec.kind, row, helpers) ?? \"default\");\n const tracked = spec.trackedWhen ? Boolean(evalOver(spec.trackedWhen, { row }, helpers)) : true;\n const value = read(spec.value, row, helpers);\n return {\n id,\n row,\n kind,\n label: String(read(spec.label, row, helpers) ?? id),\n group: spec.group ? String(field(row, spec.group) ?? \"\") : undefined,\n site: spec.site ? ((field(row, spec.site) as string | null | undefined) ?? undefined) : undefined,\n tracked,\n attention: tracked && spec.attentionWhen ? Boolean(evalOver(spec.attentionWhen, { row }, helpers)) : false,\n value: value === null || value === undefined || value === \"\" ? spec.emptyValue : String(value),\n unit:\n value === null || value === undefined || value === \"\" ? \"\" : String(read(spec.unit, row, helpers) ?? \"\"),\n };\n }),\n // biome-ignore lint/correctness/useExhaustiveDependencies: rows/spec/helpers identify the input\n [rows, spec, helpers],\n );\n const byId = useMemo(() => new Map(steps.map((s) => [s.id, s])), [steps]);\n const layout = useMemo(\n () =>\n layoutFlow(\n steps.map((s) => ({ id: s.id, group: s.group, site: s.site })),\n spec.layout ?? {},\n ),\n [steps, spec.layout],\n );\n\n const selected = spec.selected || undefined;\n const inspecting = Boolean(selected && byId.has(selected));\n const [hover, setHover] = useState<{ id: string; rect: DOMRect } | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n useEffect(() => () => clearTimeout(timer.current), []);\n const keep = useCallback(() => clearTimeout(timer.current), []);\n const closeSoon = useCallback(() => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => setHover(null), CLOSE_DELAY);\n }, []);\n // A step opened while its card was showing: the card goes.\n useEffect(() => {\n if (inspecting) setHover(null);\n }, [inspecting]);\n\n // The legend, drawn in the panel header next to the title.\n const [head, setHead] = useState<Element | null>(null);\n const findHead = useCallback((el: HTMLDivElement | null) => {\n setHead(el?.closest(\".ds-panel\")?.querySelector(\":scope > .ds-panel-head .ds-panel-tools\") ?? null);\n }, []);\n const anyUntracked = steps.some((s) => !s.tracked);\n const legendItems = [\n ...Object.entries(markers)\n .filter(([, m]) => m.legend)\n .map(([kind, m]) => ({ kind, label: m.legend as string, m })),\n ];\n const legend =\n spec.legend && (legendItems.length || spec.attention?.legend) ? (\n <ul className=\"ds-flow-legend\">\n {legendItems.map((l) => (\n <li key={l.kind}>\n <svg width=\"22\" height=\"22\" viewBox=\"-11 -11 22 22\" aria-hidden=\"true\">\n <MarkerShape\n m={{ ...l.m, size: l.m.image ? 22 : l.m.shape === \"diamond\" ? 16 : 18 }}\n x={0}\n y={0}\n dim={false}\n />\n </svg>\n {l.label}\n </li>\n ))}\n {anyUntracked && spec.untrackedLegend ? (\n <li data-kind=\"untracked\">\n <svg width=\"22\" height=\"22\" viewBox=\"-11 -11 22 22\" aria-hidden=\"true\">\n <circle className=\"ds-flow-untracked\" r={8} />\n </svg>\n {spec.untrackedLegend}\n </li>\n ) : null}\n {spec.attention?.legend ? (\n <li data-kind=\"attention\">\n <svg width=\"22\" height=\"22\" viewBox=\"-11 -11 22 22\" aria-hidden=\"true\">\n <circle\n r={9}\n fill=\"var(--ds-color-surface-card)\"\n stroke={flowColor(spec.attention.color, \"var(--ds-color-status-bad-fg)\")}\n strokeWidth={2}\n />\n <circle r={5.5} fill=\"var(--ds-color-action-primary)\" />\n </svg>\n {spec.attention.legend}\n </li>\n ) : null}\n </ul>\n ) : null;\n\n const markerFor = (kind: string): MarkerSpec => markers[kind] ?? markers.default ?? { shape: \"circle\" };\n const attnColor = flowColor(spec.attention?.color, \"var(--ds-color-status-bad-fg)\");\n const selColor = flowColor(spec.selection?.color, \"var(--ds-color-action-primary)\");\n const hovered = hover ? byId.get(hover.id) : undefined;\n\n const tagFor = (id: string, site: string) => {\n const s = byId.get(id);\n return String(spec.siteLabel ? (read(spec.siteLabel, s?.row, helpers) ?? site) : site);\n };\n\n return (\n <div className=\"ds-flow\" ref={findHead}>\n {head && legend ? createPortal(legend, head) : legend}\n <div className=\"ds-flow-scroll\">\n <svg\n className=\"ds-flow-svg\"\n viewBox={`0 0 ${layout.width} ${layout.height}`}\n style={{ maxWidth: layout.width, minWidth: spec.minWidth }}\n data-inspecting={inspecting || undefined}\n // biome-ignore lint/a11y/useSemanticElements: an SVG drawing, which a fieldset can't hold\n role=\"group\"\n aria-label={spec.title ?? \"Flow\"}\n >\n {layout.tracks.map((t) => (\n <path key={t.d} className=\"ds-flow-track\" data-dashed={t.dashed || undefined} d={t.d} />\n ))}\n {layout.chevrons.map((c) => (\n <path\n key={`${c.x}-${c.y}`}\n className=\"ds-flow-chevron\"\n d={`M ${c.x - 2.5 * c.dir} ${c.y - 4} L ${c.x + 2.5 * c.dir} ${c.y} L ${c.x - 2.5 * c.dir} ${c.y + 4}`}\n />\n ))}\n {layout.siteStarts.map((t) => {\n const s = byId.get(t.id);\n const label = tagFor(t.id, t.site);\n const w = label.length * 6 + 16;\n const lines = wrapFlowLabel(s?.label ?? \"\", t.id === selected).length;\n const top = t.y - TAG_TOP - (lines - 1) * LABEL_LINE;\n return (\n <g key={t.id} className=\"ds-flow-tag\" data-dim={inspecting || undefined}>\n <rect x={t.x - w / 2} y={top} width={w} height={TAG_H} rx={TAG_H / 2} />\n <text x={t.x} y={top + TAG_H / 2} textAnchor=\"middle\" dominantBaseline=\"central\">\n {label}\n </text>\n </g>\n );\n })}\n {layout.steps.map((p: PlacedStep) => {\n const s = byId.get(p.id);\n if (!s) return null;\n const isSel = selected === s.id;\n const dim = inspecting && spec.dimOthers && !isSel;\n const m = markerFor(s.kind);\n const lines = wrapFlowLabel(s.label, p.feed || isSel);\n const lineH = isSel ? LABEL_LINE_SELECTED : LABEL_LINE;\n const firstY = p.y - LABEL_GAP - (lines.length - 1) * lineH;\n const ring = spec.attention?.ring?.[s.kind] ?? spec.attention?.ring?.default;\n const open = () => {\n if (!s.tracked) return;\n keep();\n setHover(null);\n emit(\"click\", \"step\", { datum: s.row, value: s.id });\n };\n const chipTone = isSel ? \"selected\" : dim ? \"dim\" : (m.chipTone ?? \"neutral\");\n return (\n <g\n key={s.id}\n className=\"ds-flow-step\"\n // biome-ignore lint/a11y/useSemanticElements: an SVG group; a button element can't sit inside SVG\n role=\"button\"\n tabIndex={s.tracked ? 0 : -1}\n aria-label={`${s.label}${s.tracked ? `, ${s.value}${s.unit ? ` ${s.unit}` : \"\"}` : \"\"}`}\n aria-disabled={!s.tracked || undefined}\n aria-pressed={isSel}\n data-kind={s.kind}\n data-dim={dim || undefined}\n data-selected={isSel || undefined}\n data-untracked={!s.tracked || undefined}\n data-attention={s.attention || undefined}\n onMouseEnter={(e) => {\n if (!s.tracked || inspecting) return;\n keep();\n const hit = e.currentTarget.querySelector(\".ds-flow-hit\") as SVGElement | null;\n setHover({ id: s.id, rect: (hit ?? e.currentTarget).getBoundingClientRect() });\n emit(\"hover\", \"step\", { datum: s.row, value: s.id });\n }}\n onMouseLeave={() => {\n closeSoon();\n emit(\"hoverEnd\", \"step\", { datum: s.row, value: s.id });\n }}\n onFocus={(e) => {\n if (s.tracked && !inspecting) setHover({ id: s.id, rect: e.currentTarget.getBoundingClientRect() });\n }}\n onBlur={closeSoon}\n onClick={open}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n open();\n }\n }}\n >\n <text className=\"ds-flow-label\" textAnchor=\"middle\" data-selected={isSel || undefined}>\n {lines.map((line, i) => (\n <tspan key={`${i}-${line}`} x={p.x} y={firstY + i * lineH}>\n {line}\n </tspan>\n ))}\n </text>\n {s.attention ? (\n spec.attention?.halo ? (\n <Pic img={spec.attention.halo} x={p.x} y={p.y} dim={dim} className=\"ds-flow-halo\" />\n ) : (\n <circle className=\"ds-flow-halo\" cx={p.x} cy={p.y} r={22} fill={attnColor} opacity={0.14} />\n )\n ) : null}\n {isSel && !s.attention ? (\n spec.selection?.halo ? (\n <Pic img={spec.selection.halo} x={p.x} y={p.y} />\n ) : (\n <circle cx={p.x} cy={p.y} r={22} fill={selColor} opacity={0.14} />\n )\n ) : null}\n {s.tracked ? (\n <MarkerShape m={m} x={p.x} y={p.y} dim={dim} />\n ) : (\n <circle className=\"ds-flow-untracked\" cx={p.x} cy={p.y} r={9} />\n )}\n {s.attention ? (\n ring ? (\n <Pic img={ring} x={p.x} y={p.y} dim={dim} />\n ) : (\n <circle cx={p.x} cy={p.y} r={15} fill=\"none\" stroke={attnColor} strokeWidth={2.5} />\n )\n ) : null}\n {(isSel && !s.attention) || (hover?.id === s.id && !inspecting) ? (\n spec.selection?.ring ? (\n <Pic img={spec.selection.ring} x={p.x} y={p.y} />\n ) : (\n <circle cx={p.x} cy={p.y} r={16} fill=\"none\" stroke={selColor} strokeWidth={2.5} />\n )\n ) : null}\n <circle className=\"ds-flow-hit\" cx={p.x} cy={p.y} r={22} />\n {s.tracked ? <Chip x={p.x} y={p.y} value={s.value} unit={s.unit} tone={chipTone} /> : null}\n </g>\n );\n })}\n </svg>\n </div>\n {hover && hovered ? (\n <HoverCard rect={hover.rect} onEnter={keep} onLeave={closeSoon}>\n {renderSlot(\"hover\", { item: hovered.row as Obj })}\n </HoverCard>\n ) : null}\n </div>\n );\n}\n","/**\n * The FlowMap layout: a process flow as feed rows that merge into one step, then a main path that snakes in rows,\n * joined by U-bends. Pure (no React, no DOM), so it is tested on its own and the same input always draws the same map.\n */\n\nexport interface FlowLayoutStep {\n id: string;\n /** The row (feed) the step belongs to; steps without one are all on the main path. */\n group?: string | undefined;\n /** The site the step is at; a track into a step at a new site is dashed and tagged. */\n site?: string | undefined;\n}\n\nexport interface FlowLayoutOptions {\n /** Steps per main-path row before it turns (default 6). */\n perRow?: number | undefined;\n /** Distance between steps along a row, px (default 160). */\n colGap?: number | undefined;\n /** First column's centre, px from the left (default 110). */\n left?: number | undefined;\n /** First feed row's centre, px from the top (default 70). */\n top?: number | undefined;\n /** Between feed rows, px (default 110). */\n feedGap?: number | undefined;\n /** From the merge row to the second main row, px (default 220). */\n firstRowGap?: number | undefined;\n /** Between later main rows, px (default 200). */\n rowGap?: number | undefined;\n /** How far a track starts before a row's first step, px (default 40). */\n stub?: number | undefined;\n /** How far a U-bend reaches past the last column on the right / left, px (defaults 147 / 133). */\n bendRight?: number | undefined;\n bendLeft?: number | undefined;\n /** Canvas width, px (default 1030); room below the last row, px (default 100). */\n width?: number | undefined;\n bottom?: number | undefined;\n /** The group that continues as the main path (default: the last group). */\n mainGroup?: string | undefined;\n /** How many of the main group's steps stay on its own feed row before the merge (default 1). */\n mainStartsAt?: number | undefined;\n /** Which feed row the main path starts on (default: the middle one). */\n mergeRow?: number | undefined;\n}\n\nexport interface PlacedStep extends FlowLayoutStep {\n x: number;\n y: number;\n /** On a feed row (its label stays on one line). */\n feed: boolean;\n}\n\nexport interface FlowTrack {\n d: string;\n dashed: boolean;\n}\n\nexport interface FlowLayoutResult {\n steps: PlacedStep[];\n tracks: FlowTrack[];\n /** Direction marks along the track. */\n chevrons: { x: number; y: number; dir: 1 | -1 }[];\n /** The first step at a new site: where its tag goes. */\n siteStarts: { id: string; site: string; x: number; y: number }[];\n width: number;\n height: number;\n}\n\nconst DEFAULTS = {\n perRow: 6,\n colGap: 160,\n left: 110,\n top: 70,\n feedGap: 110,\n firstRowGap: 220,\n rowGap: 200,\n stub: 40,\n bendRight: 147,\n bendLeft: 133,\n width: 1030,\n bottom: 100,\n mainStartsAt: 1,\n};\n\n/** Lays out the steps (in route order). An empty list gives an empty map. */\nexport function layoutFlow(input: readonly FlowLayoutStep[], options: FlowLayoutOptions = {}): FlowLayoutResult {\n const o = {\n ...DEFAULTS,\n ...(Object.fromEntries(Object.entries(options).filter(([, v]) => v !== undefined)) as FlowLayoutOptions),\n } as typeof DEFAULTS & FlowLayoutOptions;\n const perRow = Math.max(1, Math.floor(o.perRow));\n const colX = (col: number) => o.left + col * o.colGap;\n const empty = { steps: [], tracks: [], chevrons: [], siteStarts: [], width: o.width, height: o.top + o.bottom };\n if (input.length === 0) return empty;\n\n // Rows by group, in first-seen order; the main group continues as the main path.\n const order: string[] = [];\n const byGroup = new Map<string, FlowLayoutStep[]>();\n for (const s of input) {\n const g = s.group ?? \"\";\n if (!byGroup.has(g)) {\n byGroup.set(g, []);\n order.push(g);\n }\n byGroup.get(g)?.push(s);\n }\n const mainKey =\n o.mainGroup !== undefined && byGroup.has(o.mainGroup) ? o.mainGroup : (order[order.length - 1] as string);\n const mainAll = byGroup.get(mainKey) ?? [];\n const split = order.length > 1 ? Math.min(Math.max(0, o.mainStartsAt), mainAll.length - 1) : 0;\n const feeds = [\n ...order.filter((g) => g !== mainKey).map((g) => byGroup.get(g) ?? []),\n mainAll.slice(0, split),\n ].filter((f) => f.length > 0);\n const mainSteps = mainAll.slice(split);\n const mergeRow = Math.min(Math.max(0, o.mergeRow ?? Math.floor(feeds.length / 2)), Math.max(0, feeds.length - 1));\n const feedCols = feeds.length ? Math.max(...feeds.map((f) => f.length)) : 0;\n const mainTop = o.top + mergeRow * o.feedGap;\n const rowY = (row: number) => mainTop + (row === 0 ? 0 : o.firstRowGap + (row - 1) * o.rowGap);\n const lastCol = Math.max(perRow - 1, feedCols);\n\n // The main path: from the column after the feeds, snaking at either edge.\n const main: PlacedStep[] = [];\n let row = 0;\n let col = feedCols;\n let dir: 1 | -1 = 1;\n for (const s of mainSteps) {\n main.push({ ...s, x: colX(col), y: rowY(row), feed: false });\n const next = col + dir;\n if (next < 0 || next > lastCol) {\n row += 1;\n dir = dir === 1 ? -1 : 1;\n } else col = next;\n }\n const merge = main[0];\n\n const steps: PlacedStep[] = [];\n const tracks: FlowTrack[] = [];\n const chevrons: FlowLayoutResult[\"chevrons\"] = [];\n const siteStarts: FlowLayoutResult[\"siteStarts\"] = [];\n\n // Feeds: a stub, the steps, then a curve (or a straight run) into the merge step, landing flat.\n feeds.forEach((feed, f) => {\n const y = o.top + f * o.feedGap;\n const placed = feed.map((s, i) => ({ ...s, x: colX(i), y, feed: true }));\n steps.push(...placed);\n const start = colX(0) - o.stub;\n const end = merge ?? placed[placed.length - 1];\n if (!end) return;\n const bendFrom = colX(Math.max(0, feedCols - 1));\n const mid = (bendFrom + end.x) / 2;\n tracks.push({\n d:\n y === end.y\n ? `M ${start} ${y} H ${end.x}`\n : `M ${start} ${y} H ${bendFrom} C ${mid} ${y} ${mid} ${end.y} ${end.x} ${end.y}`,\n dashed: false,\n });\n chevrons.push({ x: colX(0) + o.colGap / 2, y, dir: 1 });\n });\n steps.push(...main);\n // No feeds: the main path still starts with a stub.\n if (feeds.length === 0 && merge) tracks.push({ d: `M ${merge.x - o.stub} ${merge.y} H ${merge.x}`, dashed: false });\n\n // The main track: straight along a row with a chevron between steps, U-bends between rows.\n main.slice(1).forEach((to, i) => {\n const from = main[i] as PlacedStep;\n const dashed = Boolean(to.site) && to.site !== from.site;\n if (from.y === to.y) {\n tracks.push({ d: `M ${from.x} ${from.y} H ${to.x}`, dashed });\n chevrons.push({ x: (from.x + to.x) / 2, y: from.y, dir: to.x > from.x ? 1 : -1 });\n } else {\n const out = from.x >= colX(lastCol) ? from.x + o.bendRight : from.x - o.bendLeft;\n tracks.push({ d: `M ${from.x} ${from.y} C ${out} ${from.y} ${out} ${to.y} ${to.x} ${to.y}`, dashed });\n }\n if (dashed) siteStarts.push({ id: to.id, site: to.site as string, x: to.x, y: to.y });\n });\n\n const lastY = main.length ? (main[main.length - 1] as PlacedStep).y : Math.max(...steps.map((s) => s.y));\n return { steps, tracks, chevrons, siteStarts, width: o.width, height: lastY + o.bottom };\n}\n"],"mappings":";;;;;;;;;;;;;AA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