@parallelworks/tandem-web 0.186.0 → 0.187.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,72 +3,72 @@ import { docGraphQuery as n, knowledgeGraphQuery as r, teamsQuery as i, workspac
3
3
  import { docRef as o } from "../lib/docs.js";
4
4
  import { useTermRefs as s } from "../lib/knowledge.js";
5
5
  import { FileTextIcon as c, LibraryIcon as l, ListViewIcon as u } from "./icons.js";
6
- import { IconButton as d, SegmentedControl as f, Tooltip as p } from "@parallelworks/ui";
7
- import { useMemo as m, useState as h } from "react";
8
- import { useTranslations as g } from "use-intl";
9
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
10
- import { useQuery as b } from "@tanstack/react-query";
11
- import { ExpandIcon as x, ZoomInIcon as S, ZoomOutIcon as C } from "@parallelworks/ui/icons";
12
- import w from "@dagrejs/dagre";
13
- import { Handle as T, MarkerType as E, Position as D, ReactFlow as O, ReactFlowProvider as k, useReactFlow as A } from "@xyflow/react";
6
+ import { IconButton as d, Modal as f, SegmentedControl as p, Tooltip as m } from "@parallelworks/ui";
7
+ import { useEffect as h, useMemo as g, useState as _ } from "react";
8
+ import { useTranslations as v } from "use-intl";
9
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
10
+ import { useQuery as S } from "@tanstack/react-query";
11
+ import { DesktopIcon as C, ExpandIcon as w, OpenInNewGraphIcon as T, ShrinkIcon as E, ZoomInIcon as D, ZoomOutIcon as O } from "@parallelworks/ui/icons";
12
+ import k from "@dagrejs/dagre";
13
+ import { Handle as A, MarkerType as j, Position as M, ReactFlow as N, ReactFlowProvider as P, useNodesInitialized as F, useReactFlow as I, useStore as L } from "@xyflow/react";
14
14
  import "@xyflow/react/dist/style.css";
15
15
  // src/components/Graph.tsx
16
- var j = 196, M = 48, N = 22, P = (e) => e.kind === "doc" ? "bg-primary" : e.kind === "issue" ? e.status === "completed" || e.status === "canceled" ? "bg-muted-foreground/50" : "bg-primary" : e.status === "superseded" ? "bg-muted-foreground/50" : "bg-success", F = {
16
+ var R = 196, z = 48, B = 22, V = (e) => e.kind === "doc" ? "bg-primary" : e.kind === "issue" ? e.status === "completed" || e.status === "canceled" ? "bg-muted-foreground/50" : "bg-primary" : e.status === "superseded" ? "bg-muted-foreground/50" : "bg-success", H = {
17
17
  doc: c,
18
18
  issue: u,
19
19
  entry: l
20
- }, I = "!size-1 !min-h-0 !min-w-0 !border-0 !bg-transparent";
21
- function L({ data: e }) {
22
- let { node: t, root: n, kind: r, vertical: i } = e, a = F[t.kind];
23
- return /* @__PURE__ */ v(p, {
20
+ }, U = "!size-1 !min-h-0 !min-w-0 !border-0 !bg-transparent";
21
+ function W({ data: e }) {
22
+ let { node: t, root: n, kind: r, vertical: i } = e, a = H[t.kind];
23
+ return /* @__PURE__ */ b(m, {
24
24
  content: `${r}: ${t.title}`,
25
- children: /* @__PURE__ */ y("div", {
25
+ children: /* @__PURE__ */ x("div", {
26
26
  style: {
27
- width: j,
28
- height: M
27
+ width: R,
28
+ height: z
29
29
  },
30
30
  className: `flex items-center gap-2 rounded-md border bg-card px-2.5 ${n ? "border-primary ring-2 ring-primary/30" : "border-border hover:border-primary"} ${n ? "" : "cursor-pointer"}`,
31
31
  children: [
32
- /* @__PURE__ */ v(T, {
32
+ /* @__PURE__ */ b(A, {
33
33
  type: "target",
34
- position: i ? D.Top : D.Left,
35
- className: I
34
+ position: i ? M.Top : M.Left,
35
+ className: U
36
36
  }),
37
- /* @__PURE__ */ v(a, { className: "size-4 shrink-0 text-muted-foreground" }),
38
- /* @__PURE__ */ y("div", {
37
+ /* @__PURE__ */ b(a, { className: "size-4 shrink-0 text-muted-foreground" }),
38
+ /* @__PURE__ */ x("div", {
39
39
  className: "min-w-0 flex-1",
40
- children: [/* @__PURE__ */ v("p", {
40
+ children: [/* @__PURE__ */ b("p", {
41
41
  className: "truncate text-xs font-medium text-foreground",
42
42
  children: t.title
43
- }), /* @__PURE__ */ y("p", {
43
+ }), /* @__PURE__ */ x("p", {
44
44
  className: "flex items-center gap-1 truncate text-[10px] text-muted-foreground",
45
- children: [/* @__PURE__ */ v("span", { className: `size-1.5 shrink-0 rounded-full ${P(t)}` }), r]
45
+ children: [/* @__PURE__ */ b("span", { className: `size-1.5 shrink-0 rounded-full ${V(t)}` }), r]
46
46
  })]
47
47
  }),
48
- /* @__PURE__ */ v(T, {
48
+ /* @__PURE__ */ b(A, {
49
49
  type: "source",
50
- position: i ? D.Bottom : D.Right,
51
- className: I
50
+ position: i ? M.Bottom : M.Right,
51
+ className: U
52
52
  })
53
53
  ]
54
54
  })
55
55
  });
56
56
  }
57
- function R({ data: e }) {
58
- return /* @__PURE__ */ v("div", {
57
+ function G({ data: e }) {
58
+ return /* @__PURE__ */ b("div", {
59
59
  className: "h-full w-full rounded-xl border border-dashed border-border bg-muted/30 text-left",
60
- children: /* @__PURE__ */ v("p", {
60
+ children: /* @__PURE__ */ b("p", {
61
61
  className: "truncate px-2.5 pt-1.5 text-[11px] font-medium text-muted-foreground",
62
62
  children: e.label
63
63
  })
64
64
  });
65
65
  }
66
- var z = {
67
- box: L,
68
- area: R
66
+ var K = {
67
+ box: W,
68
+ area: G
69
69
  };
70
- function B(e, t, n) {
71
- let r = new w.graphlib.Graph({
70
+ function q(e, t, n) {
71
+ let r = new k.graphlib.Graph({
72
72
  compound: !0,
73
73
  multigraph: !0
74
74
  });
@@ -82,8 +82,8 @@ function B(e, t, n) {
82
82
  let i = /* @__PURE__ */ new Map();
83
83
  for (let t of e) {
84
84
  if (r.setNode(t.id, {
85
- width: j,
86
- height: M
85
+ width: R,
86
+ height: z
87
87
  }), !n.grouped) continue;
88
88
  let e = n.groupOf(t);
89
89
  i.has(e.id) || (i.set(e.id, e.label), r.setNode(e.id, {})), r.setParent(t.id, e.id);
@@ -91,10 +91,10 @@ function B(e, t, n) {
91
91
  let a = new Set(e.map((e) => e.id)), o = t.filter((e) => a.has(e.from) && a.has(e.to) && e.from !== e.to), s = new Map(e.map((e) => [e.id, e.depth ?? 0]));
92
92
  o.forEach((e, t) => {
93
93
  n.rooted && (s.get(e.from) ?? 0) > (s.get(e.to) ?? 0) ? r.setEdge(e.to, e.from, {}, String(t)) : r.setEdge(e.from, e.to, {}, String(t));
94
- }), w.layout(r);
94
+ }), k.layout(r);
95
95
  let c = [], l = /* @__PURE__ */ new Map();
96
96
  for (let [e, t] of i) {
97
- let n = r.node(e), i = n.x - n.width / 2, a = n.y - n.height / 2 - N;
97
+ let n = r.node(e), i = n.x - n.width / 2, a = n.y - n.height / 2 - B;
98
98
  l.set(e, {
99
99
  x: i,
100
100
  y: a
@@ -108,7 +108,7 @@ function B(e, t, n) {
108
108
  data: { label: t },
109
109
  style: {
110
110
  width: n.width,
111
- height: n.height + N
111
+ height: n.height + B
112
112
  },
113
113
  selectable: !1,
114
114
  draggable: !1
@@ -127,8 +127,8 @@ function B(e, t, n) {
127
127
  extent: "parent"
128
128
  },
129
129
  position: {
130
- x: i.x - j / 2 - o.x,
131
- y: i.y - M / 2 - o.y
130
+ x: i.x - R / 2 - o.x,
131
+ y: i.y - z / 2 - o.y
132
132
  },
133
133
  data: {
134
134
  node: e,
@@ -139,7 +139,7 @@ function B(e, t, n) {
139
139
  });
140
140
  });
141
141
  let u = {
142
- type: E.ArrowClosed,
142
+ type: j.ArrowClosed,
143
143
  width: 14,
144
144
  height: 14
145
145
  }, d = o.map((e, t) => {
@@ -172,7 +172,7 @@ function B(e, t, n) {
172
172
  width: f.width ?? 0
173
173
  };
174
174
  }
175
- function V(e) {
175
+ function J(e) {
176
176
  let n = t(), r = s(e);
177
177
  return (t) => {
178
178
  t.kind === "doc" ? n({
@@ -199,82 +199,91 @@ function V(e) {
199
199
  });
200
200
  };
201
201
  }
202
- function H() {
203
- let e = g("graph"), t = g("knowledge.kind");
202
+ function Y() {
203
+ let e = v("graph"), t = v("knowledge.kind");
204
204
  return (n) => n.kind === "doc" ? e("doc") : n.kind === "issue" ? n.ref ?? e("issue") : t(n.entryKind ?? "term");
205
205
  }
206
- function U() {
207
- let e = g("graph"), { zoomIn: t, zoomOut: n, fitView: r } = A();
208
- return /* @__PURE__ */ y("div", {
206
+ function X({ action: e }) {
207
+ let t = v("graph"), { zoomIn: n, zoomOut: r, fitView: i } = I();
208
+ return /* @__PURE__ */ x("div", {
209
209
  className: "absolute right-2 bottom-2 z-10 flex gap-1 rounded-md border border-border bg-card p-0.5",
210
210
  children: [
211
- /* @__PURE__ */ v(d, {
211
+ /* @__PURE__ */ b(d, {
212
212
  size: "sm",
213
213
  variant: "ghost",
214
- label: e("zoomIn"),
215
- icon: /* @__PURE__ */ v(S, {}),
216
- onClick: () => t()
214
+ label: t("zoomIn"),
215
+ icon: /* @__PURE__ */ b(D, {}),
216
+ onClick: () => n()
217
217
  }),
218
- /* @__PURE__ */ v(d, {
218
+ /* @__PURE__ */ b(d, {
219
219
  size: "sm",
220
220
  variant: "ghost",
221
- label: e("zoomOut"),
222
- icon: /* @__PURE__ */ v(C, {}),
223
- onClick: () => n()
221
+ label: t("zoomOut"),
222
+ icon: /* @__PURE__ */ b(O, {}),
223
+ onClick: () => r()
224
+ }),
225
+ /* @__PURE__ */ b(d, {
226
+ size: "sm",
227
+ variant: "ghost",
228
+ label: t("fit"),
229
+ icon: /* @__PURE__ */ b(w, {}),
230
+ onClick: () => i({ padding: .08 })
224
231
  }),
225
- /* @__PURE__ */ v(d, {
232
+ e && /* @__PURE__ */ b(d, {
226
233
  size: "sm",
227
234
  variant: "ghost",
228
- label: e("fit"),
229
- icon: /* @__PURE__ */ v(x, {}),
230
- onClick: () => r({ padding: .08 })
235
+ label: e.label,
236
+ icon: e.icon,
237
+ onClick: e.onClick
231
238
  })
232
239
  ]
233
240
  });
234
241
  }
235
- function W({ workspace: e, nodes: t, edges: n, width: r, rooted: i = !1, height: a }) {
236
- return /* @__PURE__ */ v(k, { children: /* @__PURE__ */ v(G, {
242
+ function Z({ workspace: e, nodes: t, edges: n, width: r, rooted: i = !1, height: a, fit: o = !1, action: s }) {
243
+ return /* @__PURE__ */ b(P, { children: /* @__PURE__ */ b(Q, {
237
244
  workspace: e,
238
245
  nodes: t,
239
246
  edges: n,
240
247
  width: r,
241
248
  rooted: i,
242
- height: a
249
+ height: a,
250
+ fit: o,
251
+ action: s
243
252
  }) });
244
253
  }
245
- function G({ workspace: e, nodes: t, edges: n, width: r, rooted: o, height: s }) {
246
- let c = g("graph"), l = V(e), u = H(), { data: d } = b(i(e)), { data: f } = b(a(e)), [p, _] = h(null), x = n.length > 12, S = s !== void 0 && r < 600, C = s !== void 0 || r >= 600, { flowNodes: w, flowEdges: T, height: E, width: D } = m(() => {
247
- let e = new Map((d ?? []).map((e) => [e.id, e.name]));
248
- return B(t, n, {
254
+ function Q({ workspace: e, nodes: t, edges: n, width: r, rooted: o, height: s, fit: c, action: l }) {
255
+ let u = v("graph"), d = J(e), f = Y(), { data: p } = S(i(e)), { data: m } = S(a(e)), [y, C] = _(null), w = n.length > 12, T = s !== void 0 && r < 600, E = s !== void 0 || r >= 600, { flowNodes: D, flowEdges: O, height: k, width: A } = g(() => {
256
+ let e = new Map((p ?? []).map((e) => [e.id, e.name]));
257
+ return q(t, n, {
249
258
  rooted: o,
250
- vertical: S,
251
- grouped: C,
259
+ vertical: T,
260
+ grouped: E,
252
261
  groupOf: (t) => t.kind === "entry" ? {
253
262
  id: "group:knowledge",
254
- label: c("entries")
263
+ label: u("entries")
255
264
  } : t.teamId ? {
256
265
  id: `group:${t.teamId}`,
257
- label: e.get(t.teamId) ?? c("workspace")
266
+ label: e.get(t.teamId) ?? u("workspace")
258
267
  } : {
259
268
  id: "group:workspace",
260
- label: f?.name ?? c("workspace")
269
+ label: m?.name ?? u("workspace")
261
270
  },
262
- kindLabel: u,
263
- linkLabel: (e) => c(`link.${e.link}`),
264
- quietLabels: x
271
+ kindLabel: f,
272
+ linkLabel: (e) => u(`link.${e.link}`),
273
+ quietLabels: w
265
274
  });
266
275
  }, [
267
276
  t,
268
277
  n,
269
278
  o,
270
- S,
271
- C,
272
- d,
273
- f,
274
- c,
279
+ T,
280
+ E,
281
+ p,
282
+ m,
275
283
  u,
276
- x
277
- ]), k = m(() => x && p ? T.map((e) => e.id === p ? {
284
+ f,
285
+ w
286
+ ]), j = g(() => w && y ? O.map((e) => e.id === y ? {
278
287
  ...e,
279
288
  label: e.data.label,
280
289
  style: {
@@ -283,25 +292,35 @@ function G({ workspace: e, nodes: t, edges: n, width: r, rooted: o, height: s })
283
292
  strokeWidth: 2
284
293
  },
285
294
  zIndex: 10
286
- } : e) : T, [
287
- T,
288
- p,
289
- x
290
- ]), A = s ? .85 : .6, j = s ? typeof window > "u" ? 720 : window.innerHeight - 176 : 520, M = Math.min(1, Math.max(A, Math.min((r - 32) / D, (j - 32) / E))), N = Math.min(Math.max(E * M + 72, 200), j), P = {
291
- x: Math.max(16, (r - D * M) / 2),
295
+ } : e) : O, [
296
+ O,
297
+ y,
298
+ w
299
+ ]), M = s ? .85 : .6, P = s ? typeof window > "u" ? 720 : window.innerHeight - 176 : 520, R = Math.min(1, Math.max(M, Math.min((r - 32) / A, (P - 32) / k))), z = Math.min(Math.max(k * R + 72, 200), P), B = {
300
+ x: Math.max(16, (r - A * R) / 2),
292
301
  y: 16,
293
- zoom: M
294
- };
295
- return /* @__PURE__ */ y("div", {
302
+ zoom: R
303
+ }, { fitView: V } = I(), H = L((e) => e.width), U = L((e) => e.height), W = F();
304
+ return h(() => {
305
+ c && W && H && U && V({ padding: .08 });
306
+ }, [
307
+ c,
308
+ W,
309
+ H,
310
+ U,
311
+ V
312
+ ]), /* @__PURE__ */ x("div", {
296
313
  className: "graph-boxes relative mt-3 overflow-hidden rounded-xl border border-border bg-background",
297
- style: { height: s ?? N },
298
- children: [/* @__PURE__ */ v(U, {}), /* @__PURE__ */ v(O, {
299
- nodes: w,
300
- edges: k,
301
- onEdgeMouseEnter: (e, t) => _(t.id),
302
- onEdgeMouseLeave: () => _(null),
303
- nodeTypes: z,
304
- defaultViewport: P,
314
+ style: { height: s ?? z },
315
+ children: [/* @__PURE__ */ b(X, { action: l }), /* @__PURE__ */ b(N, {
316
+ nodes: D,
317
+ edges: j,
318
+ onEdgeMouseEnter: (e, t) => C(t.id),
319
+ onEdgeMouseLeave: () => C(null),
320
+ nodeTypes: K,
321
+ defaultViewport: B,
322
+ fitView: c,
323
+ fitViewOptions: { padding: .08 },
305
324
  minZoom: .2,
306
325
  maxZoom: 1.75,
307
326
  nodesConnectable: !1,
@@ -315,26 +334,26 @@ function G({ workspace: e, nodes: t, edges: n, width: r, rooted: o, height: s })
315
334
  proOptions: { hideAttribution: !0 },
316
335
  onNodeClick: (e, t) => {
317
336
  let n = t.data;
318
- t.type === "box" && n.node && !n.root && l(n.node);
337
+ t.type === "box" && n.node && !n.root && d(n.node);
319
338
  },
320
339
  "aria-hidden": "true"
321
340
  })]
322
341
  });
323
342
  }
324
- function K({ workspace: t, nodes: n, label: r }) {
325
- let i = s(t), a = g("graph"), c = H(), l = "flex items-baseline gap-2 rounded-md px-2 py-1 text-sm hover:bg-muted";
326
- return /* @__PURE__ */ v("ul", {
343
+ function $({ workspace: t, nodes: n, label: r }) {
344
+ let i = s(t), a = v("graph"), c = Y(), l = "flex items-baseline gap-2 rounded-md px-2 py-1 text-sm hover:bg-muted";
345
+ return /* @__PURE__ */ b("ul", {
327
346
  className: "mt-3 space-y-px",
328
347
  "aria-label": r,
329
348
  children: n.map((n) => {
330
- let r = c(n), s = /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
349
+ let r = c(n), s = /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
331
350
  className: "min-w-0 flex-1 truncate",
332
351
  children: n.title
333
- }), /* @__PURE__ */ v("span", {
352
+ }), /* @__PURE__ */ b("span", {
334
353
  className: "shrink-0 text-xs text-muted-foreground",
335
354
  children: n.depth === 2 ? a("twoAway", { kind: r }) : r
336
355
  })] });
337
- return /* @__PURE__ */ v("li", { children: n.kind === "doc" ? /* @__PURE__ */ v(e, {
356
+ return /* @__PURE__ */ b("li", { children: n.kind === "doc" ? /* @__PURE__ */ b(e, {
338
357
  to: "/$workspace/docs/$doc",
339
358
  params: {
340
359
  workspace: t,
@@ -345,7 +364,7 @@ function K({ workspace: t, nodes: n, label: r }) {
345
364
  },
346
365
  className: l,
347
366
  children: s
348
- }) : n.kind === "issue" ? /* @__PURE__ */ v(e, {
367
+ }) : n.kind === "issue" ? /* @__PURE__ */ b(e, {
349
368
  to: "/$workspace/issues/$identifier",
350
369
  params: {
351
370
  workspace: t,
@@ -353,7 +372,7 @@ function K({ workspace: t, nodes: n, label: r }) {
353
372
  },
354
373
  className: l,
355
374
  children: s
356
- }) : /* @__PURE__ */ v(e, {
375
+ }) : /* @__PURE__ */ b(e, {
357
376
  to: "/$workspace/knowledge/$term",
358
377
  params: {
359
378
  workspace: t,
@@ -365,14 +384,13 @@ function K({ workspace: t, nodes: n, label: r }) {
365
384
  })
366
385
  });
367
386
  }
368
- function q({ workspace: e, of: t, width: i }) {
369
- let a = g("graph"), [o, s] = h(1), { data: c } = b("doc" in t ? n(e, t.doc, o) : r(e, t.entry, o)), l = c?.nodes ?? [];
370
- return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("div", {
387
+ function ee({ workspace: e, of: t, width: i }) {
388
+ let a = v("graph"), [o, s] = _(1), [c, l] = _(!1), { data: u } = S("doc" in t ? n(e, t.doc, o) : r(e, t.entry, o)), d = u?.nodes ?? [], f = /* @__PURE__ */ x("div", {
371
389
  className: "flex items-center justify-between px-2",
372
- children: [/* @__PURE__ */ v("p", {
390
+ children: [/* @__PURE__ */ b("p", {
373
391
  className: "text-xs font-medium text-muted-foreground",
374
392
  children: a("title")
375
- }), /* @__PURE__ */ v(f, {
393
+ }), /* @__PURE__ */ b(p, {
376
394
  size: "sm",
377
395
  label: a("depth"),
378
396
  options: [1, 2].map((e) => ({
@@ -382,26 +400,78 @@ function q({ workspace: e, of: t, width: i }) {
382
400
  value: String(o),
383
401
  onValueChange: (e) => s(Number(e))
384
402
  })]
385
- }), c && l.length <= 1 ? /* @__PURE__ */ v("p", {
386
- className: "px-2 pt-6 text-sm text-muted-foreground",
387
- children: a("doc" in t ? "emptyDoc" : "emptyEntry")
388
- }) : c && /* @__PURE__ */ y(_, { children: [
389
- /* @__PURE__ */ v(W, {
390
- workspace: e,
391
- nodes: l,
392
- edges: c.edges,
393
- width: i,
394
- rooted: !0
395
- }),
396
- /* @__PURE__ */ v(K, {
403
+ });
404
+ return /* @__PURE__ */ x(y, { children: [
405
+ f,
406
+ u && d.length <= 1 ? /* @__PURE__ */ b("p", {
407
+ className: "px-2 pt-6 text-sm text-muted-foreground",
408
+ children: a("doc" in t ? "emptyDoc" : "emptyEntry")
409
+ }) : u && /* @__PURE__ */ x(y, { children: [
410
+ /* @__PURE__ */ b(Z, {
411
+ workspace: e,
412
+ nodes: d,
413
+ edges: u.edges,
414
+ width: i,
415
+ rooted: !0,
416
+ action: {
417
+ label: a("openLarger"),
418
+ icon: /* @__PURE__ */ b(T, {}),
419
+ onClick: () => l(!0)
420
+ }
421
+ }),
422
+ /* @__PURE__ */ b($, {
423
+ workspace: e,
424
+ nodes: d.slice(1),
425
+ label: a("connected")
426
+ }),
427
+ u.truncated && /* @__PURE__ */ b("p", {
428
+ className: "px-2 pt-2 text-xs text-muted-foreground",
429
+ children: a("truncated")
430
+ })
431
+ ] }),
432
+ c && /* @__PURE__ */ b(te, {
397
433
  workspace: e,
398
- nodes: l.slice(1),
399
- label: a("connected")
400
- }),
401
- c.truncated && /* @__PURE__ */ v("p", {
402
- className: "px-2 pt-2 text-xs text-muted-foreground",
403
- children: a("truncated")
434
+ header: f,
435
+ nodes: d,
436
+ edges: u?.edges ?? [],
437
+ onClose: () => l(!1)
404
438
  })
405
- ] })] });
439
+ ] });
440
+ }
441
+ function te({ workspace: e, header: t, nodes: n, edges: r, onClose: i }) {
442
+ let a = v("graph"), [o, s] = _(!1);
443
+ return h(() => {
444
+ let e = () => {
445
+ document.fullscreenElement || s(!1);
446
+ };
447
+ return document.addEventListener("fullscreenchange", e), () => {
448
+ document.removeEventListener("fullscreenchange", e), document.fullscreenElement && document.exitFullscreen();
449
+ };
450
+ }, []), /* @__PURE__ */ x(f, {
451
+ open: !0,
452
+ onClose: i,
453
+ align: "center",
454
+ "aria-label": a("title"),
455
+ className: `flex flex-col p-3 ${o ? "fixed inset-0 h-dvh w-dvw rounded-none" : "h-[90vh] max-h-full w-[90vw]"}`,
456
+ children: [t, /* @__PURE__ */ b("div", {
457
+ className: "min-h-0 flex-1",
458
+ children: /* @__PURE__ */ b(Z, {
459
+ workspace: e,
460
+ nodes: n,
461
+ edges: r,
462
+ width: Math.round(window.innerWidth * .9),
463
+ rooted: !0,
464
+ height: "calc(100% - 0.75rem)",
465
+ fit: !0,
466
+ action: {
467
+ label: a(o ? "exitFullScreen" : "fullScreen"),
468
+ icon: b(o ? E : C, {}),
469
+ onClick: () => {
470
+ s(!o), o ? document.fullscreenElement && document.exitFullscreen() : document.fullscreenEnabled && document.documentElement.requestFullscreen().catch(() => {});
471
+ }
472
+ }
473
+ })
474
+ })]
475
+ });
406
476
  }
407
- export { q as Connections, W as GraphDrawing, K as GraphList };
477
+ export { ee as Connections, Z as GraphDrawing, $ as GraphList };