@gravitee/graphene-charts 2.36.2 → 2.36.3-feat-password-input.efed5fc

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 (66) hide show
  1. package/USAGE_GUIDE.md +0 -38
  2. package/dist/base/ChartLegend/ChartLegend.d.ts +1 -7
  3. package/dist/base/ChartLegend/ChartLegend.d.ts.map +1 -1
  4. package/dist/base/ChartTooltip/ChartTooltip.d.ts +1 -7
  5. package/dist/base/ChartTooltip/ChartTooltip.d.ts.map +1 -1
  6. package/dist/charts/DoughnutChart/DoughnutChart.d.ts.map +1 -1
  7. package/dist/dashboard-grid/DashboardGrid.d.ts.map +1 -1
  8. package/dist/dashboard-grid/DashboardWidget.d.ts.map +1 -1
  9. package/dist/dashboard-grid/index.js +47 -49
  10. package/dist/index.d.ts +1 -4
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1767 -4399
  13. package/dist/primitives/Axis.d.ts +2 -10
  14. package/dist/primitives/Axis.d.ts.map +1 -1
  15. package/dist/primitives/CartesianChart.d.ts.map +1 -1
  16. package/dist/primitives/CartesianContext.d.ts +0 -8
  17. package/dist/primitives/CartesianContext.d.ts.map +1 -1
  18. package/dist/primitives/ReferenceLine.d.ts +1 -3
  19. package/dist/primitives/ReferenceLine.d.ts.map +1 -1
  20. package/dist/series/AreaSeries.d.ts +1 -3
  21. package/dist/series/AreaSeries.d.ts.map +1 -1
  22. package/dist/series/BarSeries.d.ts +1 -3
  23. package/dist/series/BarSeries.d.ts.map +1 -1
  24. package/dist/series/LineSeries.d.ts +1 -3
  25. package/dist/series/LineSeries.d.ts.map +1 -1
  26. package/dist/types/index.d.ts +0 -2
  27. package/dist/types/index.d.ts.map +1 -1
  28. package/package.json +4 -15
  29. package/dist/charts/TraceWaterfall/TraceWaterfall.d.ts +0 -22
  30. package/dist/charts/TraceWaterfall/TraceWaterfall.d.ts.map +0 -1
  31. package/dist/charts/TraceWaterfall/fixtures.d.ts +0 -12
  32. package/dist/charts/TraceWaterfall/fixtures.d.ts.map +0 -1
  33. package/dist/charts/TraceWaterfall/formatDuration.d.ts +0 -24
  34. package/dist/charts/TraceWaterfall/formatDuration.d.ts.map +0 -1
  35. package/dist/charts/TraceWaterfall/index.d.ts +0 -5
  36. package/dist/charts/TraceWaterfall/index.d.ts.map +0 -1
  37. package/dist/charts/TraceWaterfall/types.d.ts +0 -20
  38. package/dist/charts/TraceWaterfall/types.d.ts.map +0 -1
  39. package/dist/lib/format.d.ts +0 -18
  40. package/dist/lib/format.d.ts.map +0 -1
  41. package/dist/lib/surface.d.ts +0 -8
  42. package/dist/lib/surface.d.ts.map +0 -1
  43. package/dist/lineage/AnimatedEdge.d.ts +0 -12
  44. package/dist/lineage/AnimatedEdge.d.ts.map +0 -1
  45. package/dist/lineage/BaseNode.d.ts +0 -6
  46. package/dist/lineage/BaseNode.d.ts.map +0 -1
  47. package/dist/lineage/LineageSkeleton.d.ts +0 -13
  48. package/dist/lineage/LineageSkeleton.d.ts.map +0 -1
  49. package/dist/lineage/LineageViewer.d.ts +0 -3
  50. package/dist/lineage/LineageViewer.d.ts.map +0 -1
  51. package/dist/lineage/StatusLegend.d.ts +0 -2
  52. package/dist/lineage/StatusLegend.d.ts.map +0 -1
  53. package/dist/lineage/highlight.d.ts +0 -21
  54. package/dist/lineage/highlight.d.ts.map +0 -1
  55. package/dist/lineage/index.d.ts +0 -10
  56. package/dist/lineage/index.d.ts.map +0 -1
  57. package/dist/lineage/index.js +0 -624
  58. package/dist/lineage/layout.d.ts +0 -7
  59. package/dist/lineage/layout.d.ts.map +0 -1
  60. package/dist/lineage/styles.css +0 -1139
  61. package/dist/lineage/types.d.ts +0 -114
  62. package/dist/lineage/types.d.ts.map +0 -1
  63. package/dist/primitives/TooltipPortal.d.ts +0 -17
  64. package/dist/primitives/TooltipPortal.d.ts.map +0 -1
  65. package/dist/primitives-Bp_ciIfm.js +0 -1036
  66. package/dist/surface-k4U7sG_T.js +0 -5
@@ -1,624 +0,0 @@
1
- import { t as e } from "../utils-ySutDPYb.js";
2
- import { l as t, n, o as r } from "../primitives-Bp_ciIfm.js";
3
- import { t as i } from "../surface-k4U7sG_T.js";
4
- import { Badge as a } from "@gravitee/graphene-core";
5
- import { Fragment as o, useCallback as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
6
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
7
- import { Background as g, BaseEdge as _, Controls as v, EdgeLabelRenderer as ee, Handle as y, MarkerType as b, MiniMap as te, Panel as x, Position as S, ReactFlow as C, ReactFlowProvider as w, getSmoothStepPath as ne, useEdgesState as re, useNodesInitialized as ie, useNodesState as ae, useReactFlow as oe } from "@xyflow/react";
8
- import T from "@dagrejs/dagre";
9
- //#region src/lineage/AnimatedEdge.tsx
10
- var se = {
11
- healthy: "var(--color-muted-foreground)",
12
- degraded: "var(--color-warning)",
13
- error: "var(--color-destructive)"
14
- };
15
- function E() {
16
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
17
- }
18
- function D({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, markerEnd: s, data: c }) {
19
- let l = c ?? {}, u = l.status ?? "healthy", d = l.animation ?? "none", f = se[u], g = l.strokeWidth ?? 1.5, v = l.dimmed ?? !1, y = l.highlighted ?? !1, [b] = ne({
20
- sourceX: t,
21
- sourceY: n,
22
- targetX: r,
23
- targetY: i,
24
- sourcePosition: a,
25
- targetPosition: o,
26
- borderRadius: 18
27
- }), te = (t + r) / 2, x = (n + i) / 2, S = E(), C = u === "healthy" ? .55 : .85, w = v ? .1 : y ? Math.min(C + .25, 1) : C, re = d === "flow" && !S, ie = d === "particles" && !S;
28
- return /* @__PURE__ */ h(p, { children: [
29
- /* @__PURE__ */ m(_, {
30
- id: e,
31
- path: b,
32
- markerEnd: s,
33
- style: {
34
- stroke: f,
35
- strokeWidth: y ? g + .5 : g,
36
- opacity: w,
37
- transition: "opacity 150ms ease",
38
- ...re && {
39
- strokeDasharray: "8 6",
40
- animation: "lineage-edge-flow 1.2s linear infinite"
41
- }
42
- }
43
- }),
44
- ie && /* @__PURE__ */ m("circle", {
45
- r: g + 1.5,
46
- fill: f,
47
- opacity: v ? .1 : .9,
48
- children: /* @__PURE__ */ m("animateMotion", {
49
- dur: "1.8s",
50
- repeatCount: "indefinite",
51
- path: b,
52
- rotate: "auto"
53
- })
54
- }),
55
- l.label && !v && /* @__PURE__ */ m(ee, { children: /* @__PURE__ */ m("div", {
56
- className: "pointer-events-none absolute flex items-center rounded-sm bg-background px-1.5 py-0.5 text-[10px] leading-none font-medium tabular-nums",
57
- style: {
58
- transform: `translate(-50%, -50%) translate(${te}px, ${x}px)`,
59
- color: f
60
- },
61
- children: l.label
62
- }) })
63
- ] });
64
- }
65
- //#endregion
66
- //#region src/lineage/BaseNode.tsx
67
- var O = {
68
- healthy: "bg-success",
69
- degraded: "bg-warning",
70
- error: "bg-destructive",
71
- inactive: "bg-muted-foreground/40"
72
- };
73
- function k({ data: t }) {
74
- let n = t.status ?? "healthy", r = n === "error", o = n === "degraded", s = t.dimmed ?? !1, c = t.highlighted ?? !1, l = t.selected ?? !1, u = t.focused ?? !1;
75
- return /* @__PURE__ */ h("div", {
76
- id: t.domId,
77
- className: e(i, "max-w-[280px] min-w-[200px]", "transition-[opacity,box-shadow,border-color] duration-150", r && "border-destructive/40 shadow-sm dark:border-destructive/30", o && "border-warning/40 shadow-sm dark:border-warning/30", c && "border-primary/40 shadow-md dark:border-primary/40", u && "ring-2 ring-ring", l && "border-primary shadow-lg ring-2 ring-primary/50", s && "opacity-35"),
78
- role: "group",
79
- "aria-current": l ? "true" : void 0,
80
- "aria-label": `${t.label}${r ? " — error" : o ? " — degraded" : ""}`,
81
- children: [
82
- /* @__PURE__ */ m(y, {
83
- type: "target",
84
- position: S.Left,
85
- className: "!invisible"
86
- }),
87
- /* @__PURE__ */ m(y, {
88
- type: "target",
89
- id: "top",
90
- position: S.Top,
91
- className: "!invisible"
92
- }),
93
- /* @__PURE__ */ h("div", {
94
- className: "flex items-stretch",
95
- children: [/* @__PURE__ */ m("div", { className: e("w-1 shrink-0", O[n]) }), /* @__PURE__ */ h("div", {
96
- className: "flex-1 px-3 py-2.5",
97
- children: [
98
- /* @__PURE__ */ h("div", {
99
- className: "flex items-center gap-2",
100
- children: [
101
- t.icon && /* @__PURE__ */ m("span", {
102
- className: "flex shrink-0 items-center text-muted-foreground [&>svg]:size-3.5",
103
- children: t.icon
104
- }),
105
- /* @__PURE__ */ m("span", {
106
- className: "flex-1 truncate text-sm font-semibold tracking-tight text-foreground",
107
- children: t.label
108
- }),
109
- t.badge && /* @__PURE__ */ m(a, {
110
- variant: t.badgeVariant ?? "secondary",
111
- className: "h-[18px] shrink-0 rounded-sm px-1.5 text-[10px] font-medium tracking-wide uppercase",
112
- children: t.badge
113
- })
114
- ]
115
- }),
116
- t.description && /* @__PURE__ */ m("p", {
117
- className: "mt-1 text-xs leading-normal text-muted-foreground",
118
- children: t.description
119
- }),
120
- t.metrics && t.metrics.length > 0 && /* @__PURE__ */ m("div", {
121
- className: "mt-2 flex items-center gap-3 border-t border-border/30 pt-2 dark:border-white/[0.04]",
122
- children: t.metrics.map((e) => /* @__PURE__ */ h("div", {
123
- className: "flex items-baseline gap-1",
124
- children: [/* @__PURE__ */ m("span", {
125
- className: "text-xs font-medium text-foreground",
126
- children: e.value
127
- }), /* @__PURE__ */ m("span", {
128
- className: "text-[10px] text-muted-foreground",
129
- children: e.label
130
- })]
131
- }, e.label))
132
- })
133
- ]
134
- })]
135
- }),
136
- /* @__PURE__ */ m(y, {
137
- type: "source",
138
- position: S.Right,
139
- className: "!invisible"
140
- }),
141
- /* @__PURE__ */ m(y, {
142
- type: "source",
143
- id: "bottom",
144
- position: S.Bottom,
145
- className: "!invisible"
146
- })
147
- ]
148
- });
149
- }
150
- //#endregion
151
- //#region src/lineage/LineageSkeleton.tsx
152
- function ce({ className: t, nodes: r = 4 }) {
153
- return /* @__PURE__ */ m("div", {
154
- role: "img",
155
- "aria-label": "Loading lineage graph",
156
- "aria-busy": "true",
157
- className: e("flex h-full w-full items-center justify-center gap-3 overflow-hidden bg-background p-8", t),
158
- children: Array.from({ length: r }).map((e, t) => /* @__PURE__ */ h(o, { children: [/* @__PURE__ */ m(n, { className: "h-[72px] w-full max-w-[200px] min-w-0 flex-1 rounded-lg" }), t < r - 1 && /* @__PURE__ */ m(n, { className: "h-px w-8 shrink-0 rounded-none" })] }, t))
159
- });
160
- }
161
- //#endregion
162
- //#region src/lineage/StatusLegend.tsx
163
- var le = [
164
- {
165
- label: "Healthy",
166
- dotClass: "bg-success"
167
- },
168
- {
169
- label: "Degraded",
170
- dotClass: "bg-warning"
171
- },
172
- {
173
- label: "Error",
174
- dotClass: "bg-destructive"
175
- }
176
- ];
177
- function ue() {
178
- return /* @__PURE__ */ m("div", {
179
- className: "flex items-center gap-3 rounded-lg border border-border/50 bg-background/90 px-2.5 py-1.5 shadow-xs backdrop-blur-sm",
180
- children: le.map((t) => /* @__PURE__ */ h("div", {
181
- className: "flex items-center gap-1.5",
182
- children: [/* @__PURE__ */ m("span", { className: e("size-2 rounded-full", t.dotClass) }), /* @__PURE__ */ m("span", {
183
- className: "text-[11px] font-medium text-muted-foreground",
184
- children: t.label
185
- })]
186
- }, t.label))
187
- });
188
- }
189
- //#endregion
190
- //#region src/lineage/highlight.ts
191
- function de(e, t, n) {
192
- let r = e.get(t);
193
- r ? r.push(n) : e.set(t, [n]);
194
- }
195
- function A(e, t) {
196
- let n = /* @__PURE__ */ new Set(), r = [e];
197
- for (; r.length > 0;) {
198
- let e = r.shift();
199
- for (let i of t.get(e) ?? []) n.has(i) || (n.add(i), r.push(i));
200
- }
201
- return n;
202
- }
203
- function fe(e, t, n) {
204
- if (n === "neighbors") {
205
- let n = new Set([t]), r = /* @__PURE__ */ new Set();
206
- for (let i of e) i.source === t && (n.add(i.target), r.add(i.id)), i.target === t && (n.add(i.source), r.add(i.id));
207
- return {
208
- nodes: n,
209
- edges: r
210
- };
211
- }
212
- let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
213
- for (let t of e) de(r, t.source, t.target), de(i, t.target, t.source);
214
- let a = new Set([t, ...A(t, r)]), o = new Set([t, ...A(t, i)]), s = new Set([...o, ...a]), c = /* @__PURE__ */ new Set();
215
- for (let t of e) {
216
- let e = o.has(t.source) && o.has(t.target), n = a.has(t.source) && a.has(t.target);
217
- (e || n) && c.add(t.id);
218
- }
219
- return {
220
- nodes: s,
221
- edges: c
222
- };
223
- }
224
- //#endregion
225
- //#region src/lineage/layout.ts
226
- var pe = 250, j = 80;
227
- function me(e, t, n) {
228
- let r = new T.graphlib.Graph({
229
- compound: !1,
230
- directed: !0
231
- });
232
- r.setDefaultEdgeLabel(() => ({})), r.setGraph({
233
- rankdir: n.direction,
234
- nodesep: n.nodeSep ?? 50,
235
- ranksep: n.rankSep ?? 100,
236
- edgesep: n.edgeSep ?? 10
237
- });
238
- for (let t of e) r.setNode(t.id, {
239
- width: t.measured?.width ?? pe,
240
- height: t.measured?.height ?? j
241
- });
242
- for (let e of t) r.setEdge(e.source, e.target);
243
- return T.layout(r), {
244
- nodes: e.map((e) => {
245
- let t = r.node(e.id), n = e.measured?.width ?? pe, i = e.measured?.height ?? j;
246
- return {
247
- ...e,
248
- position: {
249
- x: t ? t.x - n / 2 : e.position.x,
250
- y: t ? t.y - i / 2 : e.position.y
251
- }
252
- };
253
- }),
254
- edges: t
255
- };
256
- }
257
- //#endregion
258
- //#region src/lineage/LineageViewer.tsx
259
- var he = {
260
- healthy: "var(--color-muted-foreground)",
261
- degraded: "var(--color-warning)",
262
- error: "var(--color-destructive)",
263
- inactive: "var(--color-muted-foreground)"
264
- }, ge = {
265
- direction: "LR",
266
- nodeSep: 40,
267
- rankSep: 130
268
- }, _e = { base: k }, ve = { animated: D }, ye = {
269
- healthy: "var(--color-muted-foreground)",
270
- degraded: "var(--color-warning)",
271
- error: "var(--color-destructive)"
272
- }, M = 1.5, N = 4, P = "gv-lineage-edge-flow";
273
- function be() {
274
- if (typeof document > "u" || document.getElementById(P)) return;
275
- let e = document.createElement("style");
276
- e.id = P, e.textContent = "@keyframes lineage-edge-flow { to { stroke-dashoffset: -28; } }", document.head.appendChild(e);
277
- }
278
- function xe(e) {
279
- let t = e.map((e) => e.weight).filter((e) => typeof e == "number");
280
- if (t.length === 0) return () => M;
281
- let n = Math.min(...t), r = Math.max(...t);
282
- return n === r ? () => (M + N) / 2 : (e) => typeof e == "number" ? M + Math.max(0, Math.min(1, (e - n) / (r - n))) * (N - M) : M;
283
- }
284
- function Se({ containerRef: e }) {
285
- let [t, n] = f(!1), [r, i] = f(!1);
286
- c(() => {
287
- i(typeof document < "u" && !!document.fullscreenEnabled);
288
- }, []), c(() => {
289
- if (!r) return;
290
- function e() {
291
- n(!!document.fullscreenElement);
292
- }
293
- return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
294
- }, [r]);
295
- let a = s(() => {
296
- e.current && (document.fullscreenElement ? document.exitFullscreen().catch(() => {}) : e.current.requestFullscreen().catch(() => {}));
297
- }, [e]);
298
- return r ? /* @__PURE__ */ m("button", {
299
- onClick: a,
300
- className: "flex h-7 w-7 items-center justify-center rounded-md border border-border/50 bg-background text-muted-foreground shadow-sm transition-colors hover:bg-accent hover:text-foreground",
301
- "aria-label": t ? "Exit fullscreen" : "Enter fullscreen",
302
- type: "button",
303
- children: t ? /* @__PURE__ */ h("svg", {
304
- width: "14",
305
- height: "14",
306
- viewBox: "0 0 24 24",
307
- fill: "none",
308
- stroke: "currentColor",
309
- strokeWidth: "2",
310
- strokeLinecap: "round",
311
- strokeLinejoin: "round",
312
- children: [
313
- /* @__PURE__ */ m("polyline", { points: "4 14 10 14 10 20" }),
314
- /* @__PURE__ */ m("polyline", { points: "20 10 14 10 14 4" }),
315
- /* @__PURE__ */ m("line", {
316
- x1: "14",
317
- y1: "10",
318
- x2: "21",
319
- y2: "3"
320
- }),
321
- /* @__PURE__ */ m("line", {
322
- x1: "3",
323
- y1: "21",
324
- x2: "10",
325
- y2: "14"
326
- })
327
- ]
328
- }) : /* @__PURE__ */ h("svg", {
329
- width: "14",
330
- height: "14",
331
- viewBox: "0 0 24 24",
332
- fill: "none",
333
- stroke: "currentColor",
334
- strokeWidth: "2",
335
- strokeLinecap: "round",
336
- strokeLinejoin: "round",
337
- children: [
338
- /* @__PURE__ */ m("polyline", { points: "15 3 21 3 21 9" }),
339
- /* @__PURE__ */ m("polyline", { points: "9 21 3 21 3 15" }),
340
- /* @__PURE__ */ m("line", {
341
- x1: "21",
342
- y1: "3",
343
- x2: "14",
344
- y2: "10"
345
- }),
346
- /* @__PURE__ */ m("line", {
347
- x1: "3",
348
- y1: "21",
349
- x2: "10",
350
- y2: "14"
351
- })
352
- ]
353
- })
354
- }) : null;
355
- }
356
- function F({ nodes: n, edges: i, nodeTypes: a, edgeTypes: o, layout: p = ge, className: _, children: ee, fitView: y = !0, pannable: S = !1, zoomable: w = !1, showControls: ne = !1, fullscreenable: T = !1, state: se, ariaLabel: E = "Lineage graph", edgeAnimation: D = "none", highlightConnections: O = !0, highlightMode: k = "neighbors", showLegend: le = !1, showMinimap: de = !1, selectedNodeId: A, defaultSelectedNodeId: pe, onNodeSelect: j, onNodeHover: M, onNodeLeave: N }) {
357
- let { fitView: P, getNodes: F, setCenter: I } = oe(), L = d(null), Ce = ie(), we = l(), [R, Te] = f(!1), [Ee, De] = f(null), [z, B] = f(null), V = s((e) => `${we}-${e}`, [we]), H = u(() => n.map((e) => e.id), [n]), U = u(() => {
358
- let e = /* @__PURE__ */ new Map();
359
- for (let t of n) e.set(t.id, t);
360
- return e;
361
- }, [n]), W = A !== void 0, [Oe, ke] = f(pe ?? null), G = (W ? A : Oe) ?? null, K = s((e) => {
362
- W || ke(e), j?.(e ? U.get(e) ?? null : null);
363
- }, [
364
- W,
365
- j,
366
- U
367
- ]), q = Ee ?? z ?? G, J = p.direction === "TB" || p.direction === "BT", Ae = `${p.direction}:${p.nodeSep ?? ""}:${p.rankSep ?? ""}:${p.edgeSep ?? ""}`, je = u(() => ({
368
- ..._e,
369
- ...a
370
- }), [a]), Me = u(() => ({
371
- ...ve,
372
- ...o
373
- }), [o]), Y = u(() => n.map((e) => ({
374
- id: e.id,
375
- type: e.type ?? "base",
376
- data: e.data,
377
- position: {
378
- x: 0,
379
- y: 0
380
- }
381
- })), [n]), X = u(() => {
382
- let e = xe(i);
383
- return i.map((t) => {
384
- let n = t.status ?? "healthy";
385
- return {
386
- id: t.id,
387
- source: t.source,
388
- target: t.target,
389
- type: t.type ?? "animated",
390
- sourceHandle: J ? "bottom" : void 0,
391
- targetHandle: J ? "top" : void 0,
392
- data: {
393
- status: n,
394
- animation: D,
395
- strokeWidth: e(t.weight),
396
- label: t.label
397
- },
398
- markerEnd: {
399
- type: b.ArrowClosed,
400
- width: 12,
401
- height: 12,
402
- color: ye[n]
403
- }
404
- };
405
- });
406
- }, [
407
- i,
408
- J,
409
- D
410
- ]), [Ne, Z, Pe] = ae(Y), [Fe, Ie, Le] = re(X);
411
- c(() => {
412
- Z(Y), Ie(X), Te(!1);
413
- }, [
414
- Y,
415
- X,
416
- Ae,
417
- Z,
418
- Ie
419
- ]), c(() => {
420
- if (!Ce || R) return;
421
- let { nodes: e } = me(F(), X, p);
422
- Z(e), Te(!0);
423
- }, [
424
- Ce,
425
- R,
426
- F,
427
- X,
428
- p,
429
- Z
430
- ]), c(() => {
431
- if (!R || !y) return;
432
- let e = requestAnimationFrame(() => P({
433
- padding: .12,
434
- duration: 0
435
- }));
436
- return () => cancelAnimationFrame(e);
437
- }, [
438
- R,
439
- y,
440
- P
441
- ]), c(() => {
442
- D === "flow" && be();
443
- }, [D]), c(() => {
444
- if (!z || !R || !(S || w)) return;
445
- let e = F().find((e) => e.id === z);
446
- e && I(e.position.x + (e.measured?.width ?? 0) / 2, e.position.y + (e.measured?.height ?? 0) / 2, { duration: 200 });
447
- }, [
448
- z,
449
- R,
450
- S,
451
- w,
452
- F,
453
- I
454
- ]);
455
- let Q = u(() => !O || !q ? null : fe(i, q, k), [
456
- O,
457
- q,
458
- k,
459
- i
460
- ]), Re = u(() => Ne.map((e) => {
461
- let t = e.id === G, n = e.id === z, r = Q ? Q.nodes.has(e.id) : !0;
462
- return {
463
- ...e,
464
- data: {
465
- ...e.data,
466
- domId: V(e.id),
467
- dimmed: Q ? !r && !t && !n : !1,
468
- highlighted: e.id === q && !t,
469
- selected: t,
470
- focused: n && !t
471
- }
472
- };
473
- }), [
474
- Ne,
475
- Q,
476
- q,
477
- G,
478
- z,
479
- V
480
- ]), ze = u(() => Q ? Fe.map((e) => {
481
- let t = Q.edges.has(e.id);
482
- return {
483
- ...e,
484
- data: {
485
- ...e.data,
486
- dimmed: !t,
487
- highlighted: t
488
- }
489
- };
490
- }) : Fe, [Fe, Q]), Be = s((e, t) => {
491
- K(t.id), B(t.id);
492
- }, [K]), Ve = s(() => {
493
- K(null), B(null);
494
- }, [K]), He = s((e, t) => {
495
- O && De(t.id);
496
- let n = U.get(t.id);
497
- n && M?.(n);
498
- }, [
499
- O,
500
- U,
501
- M
502
- ]), Ue = s(() => {
503
- O && De(null), N?.();
504
- }, [O, N]), $ = s((e) => {
505
- H.length !== 0 && B((t) => {
506
- let n = t ?? G, r;
507
- if (e === "first") r = 0;
508
- else if (e === "last") r = H.length - 1;
509
- else {
510
- let t = n ? H.indexOf(n) : -1;
511
- r = t === -1 ? 0 : Math.max(0, Math.min(H.length - 1, t + e));
512
- }
513
- return H[r];
514
- });
515
- }, [H, G]), We = s((e) => {
516
- switch (e.key) {
517
- case "ArrowDown":
518
- case "ArrowRight":
519
- e.preventDefault(), $(1);
520
- break;
521
- case "ArrowUp":
522
- case "ArrowLeft":
523
- e.preventDefault(), $(-1);
524
- break;
525
- case "Home":
526
- e.preventDefault(), $("first");
527
- break;
528
- case "End":
529
- e.preventDefault(), $("last");
530
- break;
531
- case "Enter":
532
- case " ":
533
- z && (e.preventDefault(), K(z));
534
- break;
535
- case "Escape":
536
- K(null), B(null);
537
- break;
538
- }
539
- }, [
540
- $,
541
- z,
542
- K
543
- ]), Ge = t(se, n.length);
544
- return Ge === "ready" ? /* @__PURE__ */ m("div", {
545
- ref: L,
546
- className: e("relative h-full w-full bg-background outline-none focus-visible:ring-2 focus-visible:ring-ring", _),
547
- role: "application",
548
- "aria-roledescription": "Interactive lineage graph",
549
- "aria-label": E,
550
- tabIndex: 0,
551
- "aria-activedescendant": z ? V(z) : void 0,
552
- onKeyDown: We,
553
- children: /* @__PURE__ */ h(C, {
554
- nodes: Re,
555
- edges: ze,
556
- onNodesChange: Pe,
557
- onEdgesChange: Le,
558
- nodeTypes: je,
559
- edgeTypes: Me,
560
- onNodeClick: Be,
561
- onPaneClick: Ve,
562
- onNodeMouseEnter: He,
563
- onNodeMouseLeave: Ue,
564
- fitView: y,
565
- nodesDraggable: !1,
566
- nodesConnectable: !1,
567
- nodesFocusable: !1,
568
- edgesFocusable: !1,
569
- elementsSelectable: !0,
570
- panOnDrag: S,
571
- panOnScroll: !1,
572
- zoomOnScroll: w,
573
- zoomOnPinch: w,
574
- zoomOnDoubleClick: !1,
575
- selectNodesOnDrag: !1,
576
- preventScrolling: S || w,
577
- proOptions: { hideAttribution: !0 },
578
- minZoom: .3,
579
- maxZoom: 2,
580
- className: e("transition-opacity duration-200", R ? "opacity-100" : "opacity-0", "[&_.react-flow__handle]:!pointer-events-none", "[&_.react-flow__node]:!cursor-pointer", S ? "!cursor-grab active:!cursor-grabbing" : "!cursor-default"),
581
- children: [
582
- /* @__PURE__ */ m(g, {
583
- gap: 24,
584
- size: .5,
585
- className: "opacity-30"
586
- }),
587
- ne && /* @__PURE__ */ m(v, {
588
- showInteractive: !1,
589
- showZoom: w,
590
- showFitView: !0,
591
- className: "!rounded-lg !border-border/50 !shadow-sm [&_button]:!border-border/30 [&_button]:!bg-background [&_button]:!text-muted-foreground [&_button:hover]:!bg-accent [&_button:hover]:!text-foreground"
592
- }),
593
- T && /* @__PURE__ */ m(x, {
594
- position: "top-right",
595
- children: /* @__PURE__ */ m(Se, { containerRef: L })
596
- }),
597
- le && /* @__PURE__ */ m(x, {
598
- position: "bottom-left",
599
- children: /* @__PURE__ */ m(ue, {})
600
- }),
601
- de && /* @__PURE__ */ m(te, {
602
- pannable: S,
603
- zoomable: w,
604
- ariaLabel: "Lineage minimap",
605
- className: "!rounded-lg !border !border-border/50 !bg-background/80 [&_.react-flow__minimap-mask]:!fill-foreground/5",
606
- nodeColor: (e) => he[e.data?.status ?? "healthy"],
607
- nodeStrokeWidth: 0
608
- }),
609
- ee
610
- ]
611
- })
612
- }) : /* @__PURE__ */ m("div", {
613
- ref: L,
614
- className: e("relative h-full w-full bg-background", _),
615
- role: "img",
616
- "aria-label": E,
617
- children: Ge === "loading" ? /* @__PURE__ */ m(ce, { className: "h-full w-full" }) : /* @__PURE__ */ m(r, { ariaLabel: E })
618
- });
619
- }
620
- function I(e) {
621
- return /* @__PURE__ */ m(w, { children: /* @__PURE__ */ m(F, { ...e }) });
622
- }
623
- //#endregion
624
- export { D as AnimatedEdge, k as BaseNode, ce as LineageSkeleton, I as LineageViewer, ue as StatusLegend, me as applyDagreLayout, fe as computeHighlight };
@@ -1,7 +0,0 @@
1
- import { Edge, Node } from '@xyflow/react';
2
- import { LayoutStrategy } from './types';
3
- export declare function applyDagreLayout(nodes: Node[], edges: Edge[], strategy: LayoutStrategy): {
4
- nodes: Node[];
5
- edges: Edge[];
6
- };
7
- //# sourceMappingURL=layout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/lineage/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,IAAI,EAAE,EACb,KAAK,EAAE,IAAI,EAAE,EACb,QAAQ,EAAE,cAAc,GACvB;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAyClC"}