@pihanga2/shadcn 0.2.21 → 0.2.23

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.
Files changed (77) hide show
  1. package/README.md +25 -1
  2. package/cards/attachment/attachment.component.d.ts +4 -0
  3. package/cards/attachment/attachment.component.js +46 -0
  4. package/cards/attachment/attachment.component.js.map +1 -0
  5. package/cards/attachment/attachment.types.d.ts +95 -0
  6. package/cards/attachment/attachment.types.js +7 -0
  7. package/cards/attachment/attachment.types.js.map +1 -0
  8. package/cards/attachment/attachmentGroup.component.d.ts +4 -0
  9. package/cards/attachment/attachmentGroup.component.js +21 -0
  10. package/cards/attachment/attachmentGroup.component.js.map +1 -0
  11. package/cards/attachment/index.d.ts +1 -0
  12. package/cards/attachment/index.js +16 -0
  13. package/cards/attachment/index.js.map +1 -0
  14. package/cards/bubble/bubble.component.d.ts +4 -0
  15. package/cards/bubble/bubble.component.js +67 -0
  16. package/cards/bubble/bubble.component.js.map +1 -0
  17. package/cards/bubble/bubble.types.d.ts +106 -0
  18. package/cards/bubble/bubble.types.js +7 -0
  19. package/cards/bubble/bubble.types.js.map +1 -0
  20. package/cards/bubble/bubbleGroup.component.d.ts +4 -0
  21. package/cards/bubble/bubbleGroup.component.js +21 -0
  22. package/cards/bubble/bubbleGroup.component.js.map +1 -0
  23. package/cards/bubble/index.d.ts +1 -0
  24. package/cards/bubble/index.js +16 -0
  25. package/cards/bubble/index.js.map +1 -0
  26. package/cards/dataTable/dataTable.component.js +191 -124
  27. package/cards/dataTable/dataTable.component.js.map +1 -1
  28. package/cards/dataTable/dataTable.types.d.ts +50 -0
  29. package/cards/dataTable/dataTable.types.js +6 -3
  30. package/cards/dataTable/dataTable.types.js.map +1 -1
  31. package/cards/dataTable/index.js +6 -6
  32. package/cards/dropDownMenu/dropdown-menu.ui.js +41 -41
  33. package/cards/input/input.component.js +4 -4
  34. package/cards/jsonViewer/jsonViewer.component.js +1 -2
  35. package/cards/jsonViewer/jsonViewer.component.js.map +1 -1
  36. package/cards/message/index.d.ts +1 -0
  37. package/cards/message/index.js +15 -0
  38. package/cards/message/index.js.map +1 -0
  39. package/cards/message/message.component.d.ts +4 -0
  40. package/cards/message/message.component.js +47 -0
  41. package/cards/message/message.component.js.map +1 -0
  42. package/cards/message/message.types.d.ts +56 -0
  43. package/cards/message/message.types.js +7 -0
  44. package/cards/message/message.types.js.map +1 -0
  45. package/cards/message/messageGroup.component.d.ts +4 -0
  46. package/cards/message/messageGroup.component.js +21 -0
  47. package/cards/message/messageGroup.component.js.map +1 -0
  48. package/cards/swimlane/index.d.ts +2 -0
  49. package/cards/swimlane/index.js +14 -0
  50. package/cards/swimlane/index.js.map +1 -0
  51. package/cards/swimlane/swimlane.component.d.ts +4 -0
  52. package/cards/swimlane/swimlane.component.js +520 -0
  53. package/cards/swimlane/swimlane.component.js.map +1 -0
  54. package/cards/swimlane/swimlane.css +1 -0
  55. package/cards/swimlane/swimlane.demo.d.ts +12 -0
  56. package/cards/swimlane/swimlane.model.d.ts +41 -0
  57. package/cards/swimlane/swimlane.model.js +203 -0
  58. package/cards/swimlane/swimlane.model.js.map +1 -0
  59. package/cards/swimlane/swimlane.model.test.d.ts +1 -0
  60. package/cards/swimlane/swimlane.types.d.ts +271 -0
  61. package/cards/swimlane/swimlane.types.js +7 -0
  62. package/cards/swimlane/swimlane.types.js.map +1 -0
  63. package/cards.schema.json +6874 -0
  64. package/components/ui/attachment.js +102 -0
  65. package/components/ui/attachment.js.map +1 -0
  66. package/components/ui/badge.js +7 -7
  67. package/components/ui/bubble.js +73 -0
  68. package/components/ui/bubble.js.map +1 -0
  69. package/components/ui/button.js +11 -11
  70. package/components/ui/drawer.js +24 -24
  71. package/components/ui/empty.js +12 -12
  72. package/components/ui/field.js +16 -16
  73. package/components/ui/message.js +51 -0
  74. package/components/ui/message.js.map +1 -0
  75. package/components/ui/toggle-group.js +1 -1
  76. package/components/ui/toggle.js +1 -1
  77. package/package.json +23 -2
@@ -0,0 +1,520 @@
1
+ import "./swimlane.types.js";
2
+ import { describeSwimlaneTarget as e, formatTs as t, projectPending as n, relatedCallIds as r, rowTouches as i } from "./swimlane.model.js";
3
+ import './swimlane.css';/* empty css */
4
+ import { memo as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
5
+ import f from "clsx";
6
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
7
+ //#region src/cards/swimlane/swimlane.component.tsx
8
+ var g = (e, t) => e.gutter + t * e.laneW + e.laneW / 2;
9
+ function _(e, t, n, r, i, a, o, s = null) {
10
+ n.forEach((n, c) => {
11
+ let l = g(t, c);
12
+ [[
13
+ r,
14
+ 0,
15
+ t.mid
16
+ ], [
17
+ i,
18
+ t.mid,
19
+ t.rowH
20
+ ]].forEach(([t, o, c], u) => {
21
+ let d = t[n];
22
+ d && (e.visuals.push(/* @__PURE__ */ m("line", {
23
+ className: `swl-ll swl-ll-${d.state}`,
24
+ x1: l,
25
+ x2: l,
26
+ y1: o,
27
+ y2: c
28
+ }, `ll-${n}-${u}`)), d.acts.forEach((t, d) => {
29
+ let p = l - 5 + d * 5, g = u === 1 && !r[n]?.acts.includes(t), _ = u === 0 && !i[n]?.acts.includes(t), v = `M${p},${o} V${c} M${p + 10},${o} V${c}` + (g ? ` M${p},${o} H${p + 10}` : "") + (_ ? ` M${p},${c} H${p + 10}` : "");
30
+ e.visuals.push(/* @__PURE__ */ h("g", {
31
+ className: f("swl-act", a === t ? "swl-hl" : s === t && "swl-hl-proc"),
32
+ children: [/* @__PURE__ */ m("rect", {
33
+ x: p,
34
+ y: o,
35
+ width: 10,
36
+ height: c - o
37
+ }), /* @__PURE__ */ m("path", { d: v })]
38
+ }, `a-${t}-${u}`)), e.hits.push(/* @__PURE__ */ m("rect", {
39
+ className: "swl-hit",
40
+ x: p - 8,
41
+ y: o,
42
+ width: 26,
43
+ height: c - o,
44
+ "data-kind": "activity",
45
+ "data-id": t,
46
+ "data-lane": n
47
+ }, `ha-${t}-${u}`));
48
+ }));
49
+ }), !r[n] && i[n] && e.visuals.push(/* @__PURE__ */ m("rect", {
50
+ className: "swl-lane-head",
51
+ x: l - 16,
52
+ y: t.mid - 5,
53
+ width: 32,
54
+ height: 10,
55
+ rx: 2
56
+ }, `h-${n}`), /* @__PURE__ */ h("text", {
57
+ className: "swl-lbl-muted",
58
+ x: l + 20,
59
+ y: t.mid + 3,
60
+ children: [
61
+ "+ ",
62
+ o[n] ?? n,
63
+ " joined"
64
+ ]
65
+ }, `ht-${n}`));
66
+ });
67
+ }
68
+ function v(e, t, n, r) {
69
+ let i = n(r.from), a = n(r.to);
70
+ if (i < 0 || a < 0) return;
71
+ let o = g(t, i), s = g(t, a), c = f("swl-ar", r.cls, r.hl ? "swl-hl" : r.rel && "swl-hl-rel"), l = `url(#${t.mk}-${r.marker})`, u = {
72
+ "data-kind": r.kind,
73
+ "data-id": r.hitId,
74
+ "data-row": r.rowId
75
+ };
76
+ if (r.from === r.to) {
77
+ let n = `M${o + 6},${t.mid - 9} h26 v16 h-20`;
78
+ e.visuals.push(/* @__PURE__ */ m("path", {
79
+ className: c,
80
+ d: n,
81
+ markerEnd: l
82
+ }, "ar"), /* @__PURE__ */ m("text", {
83
+ className: "swl-lbl",
84
+ x: o + 38,
85
+ y: t.mid + 3,
86
+ children: r.label
87
+ }, "lb")), e.hits.push(/* @__PURE__ */ m("path", {
88
+ className: "swl-hit",
89
+ d: n,
90
+ strokeWidth: 14,
91
+ pointerEvents: "stroke",
92
+ ...u
93
+ }, "hit"));
94
+ return;
95
+ }
96
+ let d = Math.sign(s - o), p = o + d * 6, h = s - d * 6;
97
+ e.visuals.push(/* @__PURE__ */ m("line", {
98
+ className: c,
99
+ x1: p,
100
+ x2: h,
101
+ y1: t.mid,
102
+ y2: t.mid,
103
+ markerEnd: l
104
+ }, "ar"), /* @__PURE__ */ m("text", {
105
+ className: "swl-lbl",
106
+ x: Math.min(p, h) + 8,
107
+ y: t.mid - 5,
108
+ children: r.label
109
+ }, "lb")), e.hits.push(/* @__PURE__ */ m("line", {
110
+ className: "swl-hit",
111
+ x1: p,
112
+ x2: h,
113
+ y1: t.mid,
114
+ y2: t.mid,
115
+ strokeWidth: 16,
116
+ pointerEvents: "stroke",
117
+ ...u
118
+ }, "hit"));
119
+ }
120
+ var y = {
121
+ sync: ["swl-ar-sync", "sync"],
122
+ async: ["swl-ar-async", "async"],
123
+ event: ["swl-ar-event", "event"]
124
+ }, b = a(function({ row: e, g: n, laneOrder: r, laneLabels: i, width: a, hl: o, rel: s, proc: c }) {
125
+ let l = {
126
+ visuals: [],
127
+ hits: []
128
+ }, u = (e) => r.indexOf(e);
129
+ _(l, n, r, e.pre, e.post, o, i, c);
130
+ let d = e.event;
131
+ switch (d.type) {
132
+ case "call": {
133
+ let [t, r] = y[d.kind];
134
+ v(l, n, u, {
135
+ from: d.from,
136
+ to: d.to,
137
+ cls: t,
138
+ marker: r,
139
+ label: d.label,
140
+ hitId: d.id,
141
+ kind: "transition",
142
+ rowId: e.id,
143
+ hl: o === d.id,
144
+ rel: s
145
+ });
146
+ break;
147
+ }
148
+ case "reply":
149
+ e.route && v(l, n, u, {
150
+ from: e.route.to,
151
+ to: e.route.from,
152
+ cls: d.ok ? "swl-ar-reply" : "swl-ar-error",
153
+ marker: d.ok ? "reply" : "error",
154
+ label: d.label,
155
+ hitId: d.id,
156
+ kind: "transition",
157
+ rowId: e.id,
158
+ hl: o === d.id,
159
+ rel: s
160
+ });
161
+ break;
162
+ case "done":
163
+ e.route && l.visuals.push(/* @__PURE__ */ h("text", {
164
+ className: "swl-lbl-muted",
165
+ x: g(n, u(e.route.to)) + 14,
166
+ y: n.mid + 3,
167
+ children: ["✓ processed ", e.route.label]
168
+ }, "dn"));
169
+ break;
170
+ case "state": {
171
+ let t = g(n, u(d.lane));
172
+ l.visuals.push(/* @__PURE__ */ m("circle", {
173
+ cx: t,
174
+ cy: n.mid,
175
+ r: 5,
176
+ className: `swl-dot-${d.state}`
177
+ }, "st"), /* @__PURE__ */ h("text", {
178
+ className: "swl-lbl-muted",
179
+ x: t + 10,
180
+ y: n.mid + 3,
181
+ children: ["→ ", d.state]
182
+ }, "stl")), l.hits.push(/* @__PURE__ */ m("circle", {
183
+ className: "swl-hit",
184
+ cx: t,
185
+ cy: n.mid,
186
+ r: 12,
187
+ "data-kind": "state",
188
+ "data-id": `state-${e.id}`,
189
+ "data-lane": d.lane,
190
+ "data-row": e.id
191
+ }, "sth"));
192
+ break;
193
+ }
194
+ }
195
+ return /* @__PURE__ */ h("svg", {
196
+ className: f("swl-row", e.fulfilled && "swl-arrived"),
197
+ width: a,
198
+ height: n.rowH,
199
+ "data-row": e.id,
200
+ children: [
201
+ /* @__PURE__ */ m("text", {
202
+ className: "swl-ts",
203
+ x: 0,
204
+ y: n.mid + 3,
205
+ children: t(d.ts)
206
+ }),
207
+ e.fulfilled && /* @__PURE__ */ h("text", {
208
+ className: "swl-ok",
209
+ x: n.gutter - 16,
210
+ y: n.mid + 4,
211
+ children: [/* @__PURE__ */ m("title", { children: "replaced an outstanding message" }), "✓"]
212
+ }),
213
+ l.visuals,
214
+ l.hits
215
+ ]
216
+ });
217
+ }), x = a(function({ row: e, g: t, laneOrder: n, laneLabels: r, width: i, hl: a, rel: o, proc: s, now: c }) {
218
+ let l = {
219
+ visuals: [],
220
+ hits: []
221
+ }, u = e.pending, d = c - u.since, p = u.timeoutMs != null && d > u.timeoutMs;
222
+ return _(l, t, n, e.pre, e.post, a, r, s), v(l, t, (e) => n.indexOf(e), {
223
+ from: u.from,
224
+ to: u.to,
225
+ cls: f("swl-ar-ghost", p && "swl-overdue"),
226
+ marker: "ghost",
227
+ label: `⌛ ${u.label}`,
228
+ hitId: u.id,
229
+ kind: "pending",
230
+ hl: a === u.id,
231
+ rel: o
232
+ }), /* @__PURE__ */ h("svg", {
233
+ className: "swl-row swl-ghost",
234
+ width: i,
235
+ height: t.rowH,
236
+ children: [
237
+ /* @__PURE__ */ h("text", {
238
+ className: f("swl-ts", p && "swl-overdue"),
239
+ x: 0,
240
+ y: t.mid + 3,
241
+ children: [
242
+ "waiting ",
243
+ (d / 1e3).toFixed(1),
244
+ "s"
245
+ ]
246
+ }),
247
+ l.visuals,
248
+ l.hits
249
+ ]
250
+ });
251
+ }), S = a(function({ snap: e, count: t, g: n, laneOrder: r, laneLabels: i, width: a, proc: o }) {
252
+ let s = {
253
+ visuals: [],
254
+ hits: []
255
+ };
256
+ return _(s, n, r, e, e, null, i, o), /* @__PURE__ */ h("svg", {
257
+ className: "swl-row swl-now",
258
+ width: a,
259
+ height: n.rowH,
260
+ children: [
261
+ /* @__PURE__ */ m("text", {
262
+ className: "swl-now-lbl",
263
+ x: 0,
264
+ y: n.mid + 3,
265
+ children: "now"
266
+ }),
267
+ s.visuals,
268
+ /* @__PURE__ */ m("line", {
269
+ className: "swl-now-line",
270
+ x1: n.gutter - 6,
271
+ x2: a - 10,
272
+ y1: n.mid,
273
+ y2: n.mid
274
+ }),
275
+ /* @__PURE__ */ h("text", {
276
+ className: "swl-now-lbl",
277
+ x: a - 136,
278
+ y: n.mid - 4,
279
+ children: [
280
+ "▼ ",
281
+ t,
282
+ " outstanding"
283
+ ]
284
+ })
285
+ ]
286
+ });
287
+ });
288
+ function C(e) {
289
+ let { model: t, hid: r, related: a, procId: s, clock: c, ...u } = e, [f, g] = d(() => Date.now()), _ = c ?? f, v = t.pending.length > 0;
290
+ o(() => {
291
+ if (!v || c != null) return;
292
+ let e = setInterval(() => g(Date.now()), 250);
293
+ return () => clearInterval(e);
294
+ }, [v, c]);
295
+ let { current: y, pending: b } = t, C = l(() => n(y, b), [y, b]);
296
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(S, {
297
+ snap: t.current,
298
+ count: t.pending.length,
299
+ proc: s && i({
300
+ pre: t.current,
301
+ post: t.current
302
+ }, void 0, s) ? s : null,
303
+ ...u
304
+ }), C.map((e) => /* @__PURE__ */ m(x, {
305
+ row: e,
306
+ now: _,
307
+ hl: r && i(e, e.pending.id, r) ? r : null,
308
+ rel: a.has(e.pending.id),
309
+ proc: s && i(e, void 0, s) ? s : null,
310
+ ...u
311
+ }, e.id))] });
312
+ }
313
+ function w({ model: e, g: t, headH: n, width: r }) {
314
+ return /* @__PURE__ */ m("svg", {
315
+ width: r,
316
+ height: n,
317
+ children: e.laneOrder.map((r, i) => {
318
+ let a = g(t, i), o = e.current[r], s = n - 24;
319
+ return /* @__PURE__ */ h("g", { children: [
320
+ /* @__PURE__ */ m("text", {
321
+ className: "swl-lane-name",
322
+ x: a + 4,
323
+ y: s,
324
+ transform: `rotate(-90 ${a + 4} ${s})`,
325
+ children: e.laneLabels[r] ?? r
326
+ }),
327
+ /* @__PURE__ */ m("circle", {
328
+ cx: a,
329
+ cy: n - 12,
330
+ r: 5,
331
+ className: `swl-dot-${o?.state}`,
332
+ children: /* @__PURE__ */ m("title", { children: o?.state })
333
+ }),
334
+ o && o.acts.length > 0 && /* @__PURE__ */ m("text", {
335
+ className: "swl-lbl-muted",
336
+ x: a + 9,
337
+ y: n - 8,
338
+ children: o.acts.length
339
+ })
340
+ ] }, r);
341
+ })
342
+ });
343
+ }
344
+ function T({ mk: e }) {
345
+ let t = (t, n, r) => /* @__PURE__ */ m("marker", {
346
+ id: `${e}-${t}`,
347
+ viewBox: "0 0 10 10",
348
+ refX: 9,
349
+ refY: 5,
350
+ markerWidth: 9,
351
+ markerHeight: 9,
352
+ markerUnits: "userSpaceOnUse",
353
+ orient: "auto-start-reverse",
354
+ children: r ? /* @__PURE__ */ m("path", {
355
+ d: "M1,1 L9,5 L1,9",
356
+ className: n
357
+ }) : /* @__PURE__ */ m("path", {
358
+ d: "M0,0 L10,5 L0,10 z",
359
+ className: n
360
+ })
361
+ });
362
+ return /* @__PURE__ */ m("svg", {
363
+ width: 0,
364
+ height: 0,
365
+ style: { position: "absolute" },
366
+ "aria-hidden": "true",
367
+ children: /* @__PURE__ */ h("defs", { children: [
368
+ t("sync", "swl-mk-sync", !1),
369
+ t("async", "swl-mk-async", !0),
370
+ t("event", "swl-mk-event", !0),
371
+ t("reply", "swl-mk-reply", !0),
372
+ t("error", "swl-mk-error", !1),
373
+ t("ghost", "swl-mk-ghost", !0)
374
+ ] })
375
+ });
376
+ }
377
+ function E(e, t) {
378
+ return t.kind !== "transition" && t.kind !== "pending" ? null : e.spans[t.id]?.parent ?? null;
379
+ }
380
+ function D(e) {
381
+ for (let t = e?.parentElement; t; t = t.parentElement) {
382
+ let e = getComputedStyle(t).overflowY;
383
+ if (e === "auto" || e === "scroll") return t;
384
+ }
385
+ return null;
386
+ }
387
+ var O = (t) => {
388
+ let { cardName: n, model: a, showPending: p = !0, autoFollow: g = !0, showTooltip: _ = !0, highlightId: v, laneWidth: y = 104, rowHeight: x = 30, headerHeight: S = 130, gutterWidth: O = 92, stickyTop: k = 0, now: A, className: j, onHoverChanged: M, onItemClicked: ee } = t, N = "swl" + s().replace(/[^a-zA-Z0-9_-]/g, ""), P = l(() => ({
389
+ laneW: y,
390
+ rowH: x,
391
+ gutter: O,
392
+ mid: x / 2,
393
+ mk: N
394
+ }), [
395
+ y,
396
+ x,
397
+ O,
398
+ N
399
+ ]), F = O + a.laneOrder.length * y + 140, I = {
400
+ g: P,
401
+ laneOrder: a.laneOrder,
402
+ laneLabels: a.laneLabels,
403
+ width: F
404
+ }, L = u(null), R = u(null), z = u(a);
405
+ z.current = a;
406
+ let [B, V] = d(null), H = u(null), U = (e) => {
407
+ let t = e?.closest?.(".swl-hit");
408
+ if (!t) return null;
409
+ let n = t.dataset;
410
+ return {
411
+ kind: n.kind,
412
+ id: n.id,
413
+ lane: n.lane,
414
+ rowId: n.row == null ? void 0 : Number(n.row)
415
+ };
416
+ }, W = (e, t) => e === t || !!e && !!t && e.kind === t.kind && e.id === t.id, G = (e) => {
417
+ let t = z.current, n = e.kind === "state" ? void 0 : r(t, e.id), i = E(t, e) ?? void 0;
418
+ return e.kind === "pending" ? {
419
+ pending: t.pending.find((t) => t.id === e.id),
420
+ span: t.spans[e.id],
421
+ related: n,
422
+ process: i
423
+ } : {
424
+ span: t.spans[e.id],
425
+ related: n,
426
+ process: i
427
+ };
428
+ }, K = (e, t) => {
429
+ let n = R.current;
430
+ n && (n.style.left = `${e + 14}px`, n.style.top = `${t + 14}px`);
431
+ }, q = (t, n) => {
432
+ let r = H.current;
433
+ if (W(r, t)) return;
434
+ H.current = t, V(t);
435
+ let i = R.current;
436
+ i && (t && _ ? (i.textContent = e(z.current, t, A ?? Date.now()), i.style.display = "block", K(n.clientX, n.clientY)) : i.style.display = "none"), M({
437
+ target: t,
438
+ previous: r,
439
+ ...t ? G(t) : {},
440
+ clientX: n.clientX,
441
+ clientY: n.clientY
442
+ });
443
+ }, J = (e) => {
444
+ let t = U(e.target);
445
+ t && q(t, e);
446
+ }, te = (e) => {
447
+ let t = U(e.relatedTarget);
448
+ (!t || !W(t, H.current)) && q(t, e);
449
+ }, ne = (e) => {
450
+ H.current && _ && K(e.clientX, e.clientY);
451
+ }, re = (e) => {
452
+ let t = U(e.target);
453
+ t && ee({
454
+ target: t,
455
+ ...G(t)
456
+ });
457
+ }, Y = B && B.kind !== "state" ? B.id : v ?? null, { spans: X } = a, Z = l(() => new Set(Y ? r({ spans: X }, Y) : []), [Y, X]), Q = B ? E(a, B) : null, $ = u(!0);
458
+ return o(() => {
459
+ if (!g) return;
460
+ let e = D(L.current), t = e ?? window, n = () => {
461
+ $.current = e ? e.scrollTop + e.clientHeight >= e.scrollHeight - 40 : window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 40;
462
+ };
463
+ return t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
464
+ }, [g]), c(() => {
465
+ if (!g || !$.current) return;
466
+ let e = D(L.current);
467
+ e ? e.scrollTop = e.scrollHeight : window.scrollTo(0, document.documentElement.scrollHeight);
468
+ }, [
469
+ g,
470
+ a.rows.length,
471
+ a.pending.length
472
+ ]), /* @__PURE__ */ h("div", {
473
+ ref: L,
474
+ className: f("pihanga-swimlane", j),
475
+ "data-pihanga": n,
476
+ children: [
477
+ /* @__PURE__ */ m(T, { mk: N }),
478
+ /* @__PURE__ */ m("div", {
479
+ className: "swl-header",
480
+ style: { top: k },
481
+ children: /* @__PURE__ */ m(w, {
482
+ model: a,
483
+ g: P,
484
+ headH: S,
485
+ width: F
486
+ })
487
+ }),
488
+ /* @__PURE__ */ h("div", {
489
+ className: "swl-rows",
490
+ onPointerOver: J,
491
+ onPointerOut: te,
492
+ onPointerMove: ne,
493
+ onClick: re,
494
+ children: [a.rows.map((e) => /* @__PURE__ */ m(b, {
495
+ row: e,
496
+ hl: Y && i(e, "id" in e.event ? e.event.id : void 0, Y) ? Y : null,
497
+ rel: "id" in e.event && e.event.type !== "done" && Z.has(e.event.id),
498
+ proc: Q && i(e, void 0, Q) ? Q : null,
499
+ ...I
500
+ }, e.id)), p && /* @__PURE__ */ m(C, {
501
+ model: a,
502
+ hid: Y,
503
+ related: Z,
504
+ procId: Q,
505
+ clock: A,
506
+ ...I
507
+ })]
508
+ }),
509
+ /* @__PURE__ */ m("div", {
510
+ ref: R,
511
+ className: "swl-tooltip",
512
+ role: "tooltip"
513
+ })
514
+ ]
515
+ });
516
+ };
517
+ //#endregion
518
+ export { O as SwimlaneComponent };
519
+
520
+ //# sourceMappingURL=swimlane.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swimlane.component.js","names":[],"sources":["../../../src/cards/swimlane/swimlane.component.tsx"],"sourcesContent":["import React, {memo, useEffect, useId, useLayoutEffect, useMemo, useRef, useState} from \"react\";\nimport type {PiCardProps} from \"@pihanga2/core\";\nimport clsx from \"clsx\";\n\nimport {\n DEF_GUTTER_WIDTH,\n DEF_HEADER_HEIGHT,\n DEF_LANE_WIDTH,\n DEF_ROW_HEIGHT,\n type SwimlaneEvents,\n type SwimlaneGhostRow,\n type SwimlaneLanesSnapshot,\n type SwimlaneModel,\n type SwimlaneProps,\n type SwimlaneRow,\n type SwimlaneTarget,\n type SwimlaneTargetKind,\n} from \"./swimlane.types\";\nimport {describeSwimlaneTarget, formatTs, projectPending, relatedCallIds, rowTouches} from \"./swimlane.model\";\n\nimport \"./swimlane.css\";\n\n/**\n * Real-time swimlane (sequence) diagram.\n *\n * Every transition is its own small, fixed-height SVG in normal document flow,\n * so the page (or nearest scroll container) scrolls — the SVGs never do.\n * Each row draws its top half from the `pre` lane snapshot and its bottom half\n * from `post`, which lets lifelines start, activities open/close and run\n * states change in the middle of a row.\n *\n * Hover/click use one delegated listener on the rows container; hit zones are\n * wide transparent shapes carrying `data-*` attributes.\n */\n\ntype Geo = {laneW: number; rowH: number; gutter: number; mid: number; mk: string};\n\nconst laneX = (g: Geo, i: number) => g.gutter + i * g.laneW + g.laneW / 2;\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Drawing helpers\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype Parts = {visuals: React.ReactNode[]; hits: React.ReactNode[]};\n\nfunction drawLanes(\n p: Parts,\n g: Geo,\n laneOrder: string[],\n pre: SwimlaneLanesSnapshot,\n post: SwimlaneLanesSnapshot,\n hl: string | null,\n laneLabels: Record<string, string>,\n /** Activity of the process that sends/receives the hovered transition. */\n proc: string | null = null,\n) {\n laneOrder.forEach((l, i) => {\n const x = laneX(g, i);\n const halves: [SwimlaneLanesSnapshot, number, number][] = [\n [pre, 0, g.mid],\n [post, g.mid, g.rowH],\n ];\n halves.forEach(([snap, y1, y2], half) => {\n const s = snap[l];\n if (!s) return;\n p.visuals.push(\n <line key={`ll-${l}-${half}`} className={`swl-ll swl-ll-${s.state}`} x1={x} x2={x} y1={y1} y2={y2} />,\n );\n s.acts.forEach((a, k) => {\n const ax = x - 5 + k * 5;\n // fill + side borders only, so stacked half-row segments read as one\n // bar; caps only where the activity starts / ends inside this row\n const starts = half === 1 && !pre[l]?.acts.includes(a);\n const ends = half === 0 && !post[l]?.acts.includes(a);\n const d =\n `M${ax},${y1} V${y2} M${ax + 10},${y1} V${y2}` +\n (starts ? ` M${ax},${y1} H${ax + 10}` : \"\") +\n (ends ? ` M${ax},${y2} H${ax + 10}` : \"\");\n p.visuals.push(\n <g key={`a-${a}-${half}`} className={clsx(\"swl-act\", hl === a ? \"swl-hl\" : proc === a && \"swl-hl-proc\")}>\n <rect x={ax} y={y1} width={10} height={y2 - y1} />\n <path d={d} />\n </g>,\n );\n p.hits.push(\n <rect\n key={`ha-${a}-${half}`}\n className=\"swl-hit\"\n x={ax - 8}\n y={y1}\n width={26}\n height={y2 - y1}\n data-kind=\"activity\"\n data-id={a}\n data-lane={l}\n />,\n );\n });\n });\n if (!pre[l] && post[l]) {\n p.visuals.push(\n <rect key={`h-${l}`} className=\"swl-lane-head\" x={x - 16} y={g.mid - 5} width={32} height={10} rx={2} />,\n <text key={`ht-${l}`} className=\"swl-lbl-muted\" x={x + 20} y={g.mid + 3}>\n + {laneLabels[l] ?? l} joined\n </text>,\n );\n }\n });\n}\n\nfunction drawArrow(\n p: Parts,\n g: Geo,\n idx: (l: string) => number,\n a: {\n from: string;\n to: string;\n cls: string;\n marker: string;\n label: string;\n hitId: string;\n kind: SwimlaneTargetKind;\n rowId?: number;\n hl: boolean;\n /** Secondary highlight: a transition created/received by the hovered process. */\n rel?: boolean;\n },\n) {\n const i1 = idx(a.from);\n const i2 = idx(a.to);\n if (i1 < 0 || i2 < 0) return;\n const x1 = laneX(g, i1);\n const x2 = laneX(g, i2);\n const cls = clsx(\"swl-ar\", a.cls, a.hl ? \"swl-hl\" : a.rel && \"swl-hl-rel\");\n const markerEnd = `url(#${g.mk}-${a.marker})`;\n const hitData = {\"data-kind\": a.kind, \"data-id\": a.hitId, \"data-row\": a.rowId};\n if (a.from === a.to) {\n const d = `M${x1 + 6},${g.mid - 9} h26 v16 h-20`;\n p.visuals.push(\n <path key=\"ar\" className={cls} d={d} markerEnd={markerEnd} />,\n <text key=\"lb\" className=\"swl-lbl\" x={x1 + 38} y={g.mid + 3}>\n {a.label}\n </text>,\n );\n p.hits.push(<path key=\"hit\" className=\"swl-hit\" d={d} strokeWidth={14} pointerEvents=\"stroke\" {...hitData} />);\n return;\n }\n const dir = Math.sign(x2 - x1);\n const sx = x1 + dir * 6;\n const ex = x2 - dir * 6;\n p.visuals.push(\n <line key=\"ar\" className={cls} x1={sx} x2={ex} y1={g.mid} y2={g.mid} markerEnd={markerEnd} />,\n <text key=\"lb\" className=\"swl-lbl\" x={Math.min(sx, ex) + 8} y={g.mid - 5}>\n {a.label}\n </text>,\n );\n // broad hit zone: a 16px thick invisible band over the thin line\n p.hits.push(\n <line\n key=\"hit\"\n className=\"swl-hit\"\n x1={sx}\n x2={ex}\n y1={g.mid}\n y2={g.mid}\n strokeWidth={16}\n pointerEvents=\"stroke\"\n {...hitData}\n />,\n );\n}\n\nconst CALL_STYLE = {\n sync: [\"swl-ar-sync\", \"sync\"],\n async: [\"swl-ar-async\", \"async\"],\n event: [\"swl-ar-event\", \"event\"],\n} as const;\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Rows\n// ─────────────────────────────────────────────────────────────────────────────\n\ntype RowCommon = {\n g: Geo;\n laneOrder: string[];\n laneLabels: Record<string, string>;\n width: number;\n hl: string | null;\n /** True when this row's transition belongs to a child of the highlighted call. */\n rel?: boolean;\n /** Call id of the process (activity) that sends/receives the hovered transition. */\n proc?: string | null;\n};\n\nconst RealRow = memo(function RealRow({row, g, laneOrder, laneLabels, width, hl, rel, proc}: RowCommon & {row: SwimlaneRow}) {\n const p: Parts = {visuals: [], hits: []};\n const idx = (l: string) => laneOrder.indexOf(l);\n drawLanes(p, g, laneOrder, row.pre, row.post, hl, laneLabels, proc);\n const ev = row.event;\n switch (ev.type) {\n case \"call\": {\n const [cls, marker] = CALL_STYLE[ev.kind];\n drawArrow(p, g, idx, {\n from: ev.from, to: ev.to, cls, marker, label: ev.label,\n hitId: ev.id, kind: \"transition\", rowId: row.id, hl: hl === ev.id, rel,\n });\n break;\n }\n case \"reply\":\n if (row.route) {\n drawArrow(p, g, idx, {\n from: row.route.to, to: row.route.from,\n cls: ev.ok ? \"swl-ar-reply\" : \"swl-ar-error\", marker: ev.ok ? \"reply\" : \"error\",\n label: ev.label, hitId: ev.id, kind: \"transition\", rowId: row.id, hl: hl === ev.id, rel,\n });\n }\n break;\n case \"done\":\n if (row.route) {\n p.visuals.push(\n <text key=\"dn\" className=\"swl-lbl-muted\" x={laneX(g, idx(row.route.to)) + 14} y={g.mid + 3}>\n ✓ processed {row.route.label}\n </text>,\n );\n }\n break;\n case \"state\": {\n const x = laneX(g, idx(ev.lane));\n p.visuals.push(\n <circle key=\"st\" cx={x} cy={g.mid} r={5} className={`swl-dot-${ev.state}`} />,\n <text key=\"stl\" className=\"swl-lbl-muted\" x={x + 10} y={g.mid + 3}>\n → {ev.state}\n </text>,\n );\n p.hits.push(\n <circle\n key=\"sth\"\n className=\"swl-hit\"\n cx={x}\n cy={g.mid}\n r={12}\n data-kind=\"state\"\n data-id={`state-${row.id}`}\n data-lane={ev.lane}\n data-row={row.id}\n />,\n );\n break;\n }\n }\n return (\n <svg className={clsx(\"swl-row\", row.fulfilled && \"swl-arrived\")} width={width} height={g.rowH} data-row={row.id}>\n <text className=\"swl-ts\" x={0} y={g.mid + 3}>\n {formatTs(ev.ts)}\n </text>\n {row.fulfilled && (\n <text className=\"swl-ok\" x={g.gutter - 16} y={g.mid + 4}>\n <title>replaced an outstanding message</title>✓\n </text>\n )}\n {p.visuals}\n {p.hits}\n </svg>\n );\n});\n\nconst GhostRow = memo(function GhostRow({\n row, g, laneOrder, laneLabels, width, hl, rel, proc, now,\n}: RowCommon & {row: SwimlaneGhostRow; now: number}) {\n const p: Parts = {visuals: [], hits: []};\n const pd = row.pending;\n const waited = now - pd.since;\n const overdue = pd.timeoutMs != null && waited > pd.timeoutMs;\n drawLanes(p, g, laneOrder, row.pre, row.post, hl, laneLabels, proc);\n drawArrow(p, g, (l) => laneOrder.indexOf(l), {\n from: pd.from, to: pd.to, cls: clsx(\"swl-ar-ghost\", overdue && \"swl-overdue\"), marker: \"ghost\",\n label: `⌛ ${pd.label}`, hitId: pd.id, kind: \"pending\", hl: hl === pd.id, rel,\n });\n return (\n <svg className=\"swl-row swl-ghost\" width={width} height={g.rowH}>\n <text className={clsx(\"swl-ts\", overdue && \"swl-overdue\")} x={0} y={g.mid + 3}>\n waiting {(waited / 1000).toFixed(1)}s\n </text>\n {p.visuals}\n {p.hits}\n </svg>\n );\n});\n\nconst NowRow = memo(function NowRow({\n snap, count, g, laneOrder, laneLabels, width, proc,\n}: Omit<RowCommon, \"hl\" | \"rel\"> & {snap: SwimlaneLanesSnapshot; count: number}) {\n const p: Parts = {visuals: [], hits: []};\n drawLanes(p, g, laneOrder, snap, snap, null, laneLabels, proc);\n return (\n <svg className=\"swl-row swl-now\" width={width} height={g.rowH}>\n <text className=\"swl-now-lbl\" x={0} y={g.mid + 3}>now</text>\n {p.visuals}\n <line className=\"swl-now-line\" x1={g.gutter - 6} x2={width - 10} y1={g.mid} y2={g.mid} />\n <text className=\"swl-now-lbl\" x={width - 136} y={g.mid - 4}>▼ {count} outstanding</text>\n </svg>\n );\n});\n\nfunction PendingZone(\n props: Omit<RowCommon, \"hl\" | \"rel\" | \"proc\"> & {\n model: SwimlaneModel;\n hid: string | null;\n related: ReadonlySet<string>;\n procId: string | null;\n clock?: number;\n },\n) {\n const {model, hid, related, procId, clock, ...common} = props;\n const [tick, setNow] = useState(() => Date.now());\n const now = clock ?? tick;\n const any = model.pending.length > 0;\n useEffect(() => {\n // only the ghost rows tick (for the \"waiting\" timer); a `now` prop disables the ticker\n if (!any || clock != null) return;\n const iv = setInterval(() => setNow(Date.now()), 250);\n return () => clearInterval(iv);\n }, [any, clock]);\n const {current, pending} = model;\n const ghosts = useMemo(() => projectPending(current, pending), [current, pending]);\n return (\n <>\n <NowRow\n snap={model.current}\n count={model.pending.length}\n proc={procId && rowTouches({pre: model.current, post: model.current}, undefined, procId) ? procId : null}\n {...common}\n />\n {ghosts.map((gr) => (\n <GhostRow\n key={gr.id}\n row={gr}\n now={now}\n hl={hid && rowTouches(gr, gr.pending.id, hid) ? hid : null}\n rel={related.has(gr.pending.id)}\n proc={procId && rowTouches(gr, undefined, procId) ? procId : null}\n {...common}\n />\n ))}\n </>\n );\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Header\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction Header({model, g, headH, width}: {model: SwimlaneModel; g: Geo; headH: number; width: number}) {\n return (\n <svg width={width} height={headH}>\n {model.laneOrder.map((l, i) => {\n const x = laneX(g, i);\n const s = model.current[l];\n const y = headH - 24;\n return (\n <g key={l}>\n <text className=\"swl-lane-name\" x={x + 4} y={y} transform={`rotate(-90 ${x + 4} ${y})`}>\n {model.laneLabels[l] ?? l}\n </text>\n <circle cx={x} cy={headH - 12} r={5} className={`swl-dot-${s?.state}`}>\n <title>{s?.state}</title>\n </circle>\n {s && s.acts.length > 0 && (\n <text className=\"swl-lbl-muted\" x={x + 9} y={headH - 8}>\n {s.acts.length}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction Defs({mk}: {mk: string}) {\n const m = (id: string, cls: string, open: boolean) => (\n <marker\n id={`${mk}-${id}`}\n viewBox=\"0 0 10 10\"\n refX={9}\n refY={5}\n markerWidth={9}\n markerHeight={9}\n markerUnits=\"userSpaceOnUse\"\n orient=\"auto-start-reverse\"\n >\n {open ? <path d=\"M1,1 L9,5 L1,9\" className={cls} /> : <path d=\"M0,0 L10,5 L0,10 z\" className={cls} />}\n </marker>\n );\n return (\n <svg width={0} height={0} style={{position: \"absolute\"}} aria-hidden=\"true\">\n <defs>\n {m(\"sync\", \"swl-mk-sync\", false)}\n {m(\"async\", \"swl-mk-async\", true)}\n {m(\"event\", \"swl-mk-event\", true)}\n {m(\"reply\", \"swl-mk-reply\", true)}\n {m(\"error\", \"swl-mk-error\", false)}\n {m(\"ghost\", \"swl-mk-ghost\", true)}\n </defs>\n </svg>\n );\n}\n\n/**\n * For a hovered transition (call / reply arrow, or outstanding reply): the\n * call id of the caller-side activity that sent it / receives the reply.\n */\nfunction processOf(m: Pick<SwimlaneModel, \"spans\">, t: SwimlaneTarget): string | null {\n if (t.kind !== \"transition\" && t.kind !== \"pending\") return null;\n return m.spans[t.id]?.parent ?? null;\n}\n\nfunction scrollParent(el: HTMLElement | null): HTMLElement | null {\n for (let e = el?.parentElement; e; e = e.parentElement) {\n const oy = getComputedStyle(e).overflowY;\n if (oy === \"auto\" || oy === \"scroll\") return e;\n }\n return null; // → window\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Card\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const SwimlaneComponent = (props: PiCardProps<SwimlaneProps, SwimlaneEvents>): React.ReactNode => {\n const {\n cardName,\n model,\n showPending = true,\n autoFollow = true,\n showTooltip = true,\n highlightId,\n laneWidth = DEF_LANE_WIDTH,\n rowHeight = DEF_ROW_HEIGHT,\n headerHeight = DEF_HEADER_HEIGHT,\n gutterWidth = DEF_GUTTER_WIDTH,\n stickyTop = 0,\n now: clock,\n className,\n onHoverChanged,\n onItemClicked,\n } = props;\n\n const mk = \"swl\" + useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const g = useMemo<Geo>(\n () => ({laneW: laneWidth, rowH: rowHeight, gutter: gutterWidth, mid: rowHeight / 2, mk}),\n [laneWidth, rowHeight, gutterWidth, mk],\n );\n const width = gutterWidth + model.laneOrder.length * laneWidth + 140; // + room for labels\n const common = {g, laneOrder: model.laneOrder, laneLabels: model.laneLabels, width};\n\n const rootRef = useRef<HTMLDivElement>(null);\n const tipRef = useRef<HTMLDivElement>(null);\n const modelRef = useRef(model);\n modelRef.current = model;\n\n // ── hover / click (event delegation) ─────────────────────────────────────\n const [hovered, setHovered] = useState<SwimlaneTarget | null>(null);\n const hoveredRef = useRef<SwimlaneTarget | null>(null);\n\n const targetOf = (el: Element | null): SwimlaneTarget | null => {\n const hit = (el as HTMLElement | null)?.closest?.(\".swl-hit\") as SVGElement | null;\n if (!hit) return null;\n const d = hit.dataset;\n return {\n kind: d.kind as SwimlaneTargetKind,\n id: d.id!,\n lane: d.lane,\n rowId: d.row != null ? Number(d.row) : undefined,\n };\n };\n const same = (a: SwimlaneTarget | null, b: SwimlaneTarget | null) =>\n a === b || (!!a && !!b && a.kind === b.kind && a.id === b.id);\n\n const details = (t: SwimlaneTarget) => {\n const m = modelRef.current;\n const related = t.kind === \"state\" ? undefined : relatedCallIds(m, t.id);\n const process = processOf(m, t) ?? undefined;\n return t.kind === \"pending\"\n ? {pending: m.pending.find((p) => p.id === t.id), span: m.spans[t.id], related, process}\n : {span: m.spans[t.id], related, process};\n };\n\n const placeTip = (x: number, y: number) => {\n const tip = tipRef.current;\n if (tip) {\n tip.style.left = `${x + 14}px`;\n tip.style.top = `${y + 14}px`;\n }\n };\n\n const changeHover = (next: SwimlaneTarget | null, e: React.PointerEvent) => {\n const prev = hoveredRef.current;\n if (same(prev, next)) return; // e.g. same activity continuing in the next row\n hoveredRef.current = next;\n setHovered(next);\n const tip = tipRef.current;\n if (tip) {\n if (next && showTooltip) {\n tip.textContent = describeSwimlaneTarget(modelRef.current, next, clock ?? Date.now());\n tip.style.display = \"block\";\n placeTip(e.clientX, e.clientY);\n } else {\n tip.style.display = \"none\";\n }\n }\n onHoverChanged({\n target: next,\n previous: prev,\n ...(next ? details(next) : {}),\n clientX: e.clientX,\n clientY: e.clientY,\n });\n };\n\n const onOver = (e: React.PointerEvent) => {\n const t = targetOf(e.target as Element);\n if (t) changeHover(t, e);\n };\n const onOut = (e: React.PointerEvent) => {\n const t = targetOf(e.relatedTarget as Element | null);\n if (!t || !same(t, hoveredRef.current)) changeHover(t, e);\n };\n const onMove = (e: React.PointerEvent) => {\n if (hoveredRef.current && showTooltip) placeTip(e.clientX, e.clientY);\n };\n const onClick = (e: React.MouseEvent) => {\n const t = targetOf(e.target as Element);\n if (t) onItemClicked({target: t, ...details(t)});\n };\n\n // ── highlighting: only rows touching the chain get a new `hl` prop ───────\n const hid =\n hovered && hovered.kind !== \"state\" ? hovered.id : highlightId ?? null;\n // children of the highlighted call: transitions the process creates/receives\n const {spans} = model;\n const related = useMemo<ReadonlySet<string>>(\n () => new Set(hid ? relatedCallIds({spans}, hid) : []),\n [hid, spans],\n );\n // hovering a transition: also mark the process on the caller side that sent\n // the call / receives the reply (the parent activity) — only that activity\n const procId = hovered ? processOf(model, hovered) : null;\n\n // ── auto-follow (page or nearest scroll container) ───────────────────────\n const follow = useRef(true);\n useEffect(() => {\n if (!autoFollow) return;\n const sp = scrollParent(rootRef.current);\n const target: HTMLElement | Window = sp ?? window;\n const onScroll = () => {\n follow.current = sp\n ? sp.scrollTop + sp.clientHeight >= sp.scrollHeight - 40\n : window.innerHeight + window.scrollY >= document.documentElement.scrollHeight - 40;\n };\n target.addEventListener(\"scroll\", onScroll, {passive: true});\n return () => target.removeEventListener(\"scroll\", onScroll);\n }, [autoFollow]);\n useLayoutEffect(() => {\n if (!autoFollow || !follow.current) return;\n const sp = scrollParent(rootRef.current);\n if (sp) sp.scrollTop = sp.scrollHeight;\n else window.scrollTo(0, document.documentElement.scrollHeight);\n }, [autoFollow, model.rows.length, model.pending.length]);\n\n return (\n <div ref={rootRef} className={clsx(\"pihanga-swimlane\", className)} data-pihanga={cardName}>\n <Defs mk={mk} />\n <div className=\"swl-header\" style={{top: stickyTop}}>\n <Header model={model} g={g} headH={headerHeight} width={width} />\n </div>\n <div className=\"swl-rows\" onPointerOver={onOver} onPointerOut={onOut} onPointerMove={onMove} onClick={onClick}>\n {model.rows.map((r) => (\n <RealRow\n key={r.id}\n row={r}\n hl={hid && rowTouches(r, \"id\" in r.event ? r.event.id : undefined, hid) ? hid : null}\n rel={\"id\" in r.event && r.event.type !== \"done\" && related.has(r.event.id)}\n proc={procId && rowTouches(r, undefined, procId) ? procId : null}\n {...common}\n />\n ))}\n {showPending && <PendingZone model={model} hid={hid} related={related} procId={procId} clock={clock} {...common} />}\n </div>\n <div ref={tipRef} className=\"swl-tooltip\" role=\"tooltip\" />\n </div>\n );\n};\n"],"mappings":";;;;;;;AA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.16 60);--swl-degraded:oklch(65% .19 45);--swl-running:oklch(60% .15 150)}.dark{--swl-sync:oklch(72% .14 260);--swl-async:oklch(74% .14 295);--swl-event:oklch(78% .11 185);--swl-act-fill:oklch(35% .07 255);--swl-hl:oklch(80% .15 75);--swl-starting:oklch(75% .15 65);--swl-degraded:oklch(72% .17 45);--swl-running:oklch(75% .15 150)}.pihanga-swimlane{width:max-content;min-width:100%;color:var(--foreground);font-size:13px}.pihanga-swimlane .swl-header{z-index:2;background:var(--background);border-bottom:1px solid var(--border);position:sticky}.pihanga-swimlane svg{display:block;overflow:visible}.pihanga-swimlane svg text{fill:var(--foreground)}.pihanga-swimlane .swl-lane-name{font-size:12px;font-weight:600}.pihanga-swimlane .swl-ts{fill:var(--muted-foreground);font:10px ui-monospace,monospace}.pihanga-swimlane .swl-lbl{font-size:11px}.pihanga-swimlane .swl-lbl-muted{fill:var(--muted-foreground);font-size:10px}.pihanga-swimlane .swl-ll{stroke-width:1.5px}.pihanga-swimlane .swl-ll-created,.pihanga-swimlane .swl-ll-running{stroke:color-mix(in srgb, var(--muted-foreground) 70%, transparent)}.pihanga-swimlane .swl-ll-starting{stroke:var(--swl-starting);stroke-dasharray:4 3}.pihanga-swimlane .swl-ll-degraded{stroke:var(--swl-degraded);stroke-width:3px}.pihanga-swimlane .swl-ll-stopped{stroke:var(--border);stroke-dasharray:1 4}.pihanga-swimlane .swl-dot-created,.pihanga-swimlane .swl-dot-starting{fill:var(--swl-starting)}.pihanga-swimlane .swl-dot-running{fill:var(--swl-running)}.pihanga-swimlane .swl-dot-degraded{fill:var(--swl-degraded)}.pihanga-swimlane .swl-dot-stopped{fill:var(--border)}.pihanga-swimlane .swl-lane-head{fill:var(--background);stroke:var(--muted-foreground)}.pihanga-swimlane .swl-act rect{fill:var(--swl-act-fill);stroke:none}.pihanga-swimlane .swl-act path{fill:none;stroke:var(--swl-sync);stroke-width:1px}.pihanga-swimlane .swl-act.swl-hl rect{fill:var(--swl-hl)}.pihanga-swimlane .swl-act.swl-hl path{stroke:var(--swl-hl)}.pihanga-swimlane .swl-act.swl-hl-proc rect{fill:color-mix(in srgb, var(--swl-hl) 45%, var(--swl-act-fill))}.pihanga-swimlane .swl-act.swl-hl-proc path{stroke:var(--swl-hl);stroke-width:2px}.pihanga-swimlane .swl-ar{fill:none;stroke-width:1.5px}.pihanga-swimlane .swl-ar-sync{stroke:var(--swl-sync)}.pihanga-swimlane .swl-ar-async{stroke:var(--swl-async)}.pihanga-swimlane .swl-ar-event{stroke:var(--swl-event);stroke-dasharray:2 3}.pihanga-swimlane .swl-ar-reply{stroke:var(--muted-foreground);stroke-dasharray:5 3}.pihanga-swimlane .swl-ar-error{stroke:var(--destructive);stroke-dasharray:5 3}.pihanga-swimlane .swl-ar-ghost{stroke:var(--muted-foreground);stroke-dasharray:7 4}.pihanga-swimlane .swl-ar-ghost.swl-overdue{stroke:var(--destructive)}.pihanga-swimlane .swl-ar.swl-hl{stroke:var(--swl-hl);stroke-width:3px}.pihanga-swimlane .swl-ar.swl-hl-rel{stroke:var(--swl-hl);stroke-width:2px}.pihanga-swimlane .swl-mk-sync{fill:var(--swl-sync)}.pihanga-swimlane .swl-mk-async{fill:none;stroke:var(--swl-async);stroke-width:1.5px}.pihanga-swimlane .swl-mk-event{fill:none;stroke:var(--swl-event);stroke-width:1.5px}.pihanga-swimlane .swl-mk-reply,.pihanga-swimlane .swl-mk-ghost{fill:none;stroke:var(--muted-foreground);stroke-width:1.5px}.pihanga-swimlane .swl-mk-error{fill:var(--destructive)}.pihanga-swimlane .swl-ghost{opacity:.55}.pihanga-swimlane .swl-ts.swl-overdue{fill:var(--destructive);font-weight:600}.pihanga-swimlane .swl-now-line{stroke:var(--swl-hl);stroke-width:1.5px;stroke-dasharray:10 4}.pihanga-swimlane text.swl-now-lbl{fill:var(--swl-hl);font-size:11px;font-weight:600}.pihanga-swimlane text.swl-ok{fill:var(--swl-running);font-size:12px;font-weight:700}.pihanga-swimlane .swl-arrived{animation:1.6s ease-out swl-arrive}@keyframes swl-arrive{0%{background:color-mix(in srgb, var(--swl-hl) 45%, transparent)}to{background:0 0}}.pihanga-swimlane .swl-hit{fill:#0000;stroke:#0000;cursor:pointer}.pihanga-swimlane.swl-debug-hits .swl-hit{fill:color-mix(in srgb, var(--destructive) 10%, transparent);stroke:color-mix(in srgb, var(--destructive) 20%, transparent)}.pihanga-swimlane .swl-tooltip{z-index:50;pointer-events:none;border-radius:calc(var(--radius) - 2px);border:1px solid var(--border);background:var(--popover);max-width:340px;color:var(--popover-foreground);box-shadow:0 4px 12px color-mix(in srgb, var(--foreground) 15%, transparent);padding:6px 8px;font-size:12px;display:none;position:fixed}
@@ -0,0 +1,12 @@
1
+ import { SwimlaneEvent, SwimlaneModel } from './swimlane.types';
2
+ /**
3
+ * A checkout flow through a small microservice deployment, stopped while
4
+ * several replies and one announced callback are still outstanding.
5
+ */
6
+ export declare function demoEvents(t0: number, opts?: {
7
+ complete?: boolean;
8
+ }): SwimlaneEvent[];
9
+ export declare function buildDemoModel(opts?: {
10
+ complete?: boolean;
11
+ t0?: number;
12
+ }): SwimlaneModel;
@@ -0,0 +1,41 @@
1
+ import { PiRegister, ReduxState } from '@pihanga2/core';
2
+ import { SwimlaneEvent, SwimlaneGhostRow, SwimlaneLanesSnapshot, SwimlaneModel, SwimlanePending, SwimlaneTarget } from './swimlane.types';
3
+ export declare function createSwimlaneModel(opts?: {
4
+ maxRows?: number;
5
+ }): SwimlaneModel;
6
+ /**
7
+ * Apply a batch of stream events to the model (mutating it).
8
+ * Safe to call on an Immer draft or on a plain object.
9
+ */
10
+ export declare function ingestSwimlaneEvents(m: SwimlaneModel, events: SwimlaneEvent[], now?: number): void;
11
+ /** Remove all rows but keep lanes, open activities and outstanding messages. */
12
+ export declare function clearSwimlaneRows(m: SwimlaneModel): void;
13
+ /**
14
+ * Project outstanding messages below the "now" line (pure).
15
+ * Expected replies are replayed onto the current snapshot so that open
16
+ * activities visibly run down to the ghost reply that will close them.
17
+ * Newest first ≈ innermost call replies first.
18
+ */
19
+ export declare function projectPending(current: SwimlaneLanesSnapshot, pending: SwimlanePending[]): SwimlaneGhostRow[];
20
+ /**
21
+ * Direct children of call `id`: calls made while it was being handled.
22
+ * Their call/reply transitions (and outstanding replies) are the transitions
23
+ * the process "creates and receives".
24
+ */
25
+ export declare function relatedCallIds(m: Pick<SwimlaneModel, "spans">, id: string): string[];
26
+ /** Does a row (or ghost row) involve the call chain `id`? */
27
+ export declare function rowTouches(r: {
28
+ pre: SwimlaneLanesSnapshot;
29
+ post: SwimlaneLanesSnapshot;
30
+ }, eventId: string | undefined, id: string): boolean;
31
+ export declare function formatTs(t: number): string;
32
+ /** Human-readable description of a hover target (used by the tooltip). */
33
+ export declare function describeSwimlaneTarget(m: SwimlaneModel, t: SwimlaneTarget, now?: number): string;
34
+ /**
35
+ * Wire the data actions for one model:
36
+ *
37
+ * register((r) => registerSwimlaneModel<AppState>(r, "main", (s) => s.swimlane));
38
+ * // …later, from a stream adapter:
39
+ * dispatchSwimlaneEvents(dispatch, {modelId: "main", events});
40
+ */
41
+ export declare function registerSwimlaneModel<S extends ReduxState>(r: PiRegister, modelId: string, select: (state: S) => SwimlaneModel): void;