@parallelworks/tandem-web 0.186.1 → 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.
@@ -2683,6 +2683,9 @@ var e = {
2683
2683
  zoomIn: "Zoom in",
2684
2684
  zoomOut: "Zoom out",
2685
2685
  fit: "Fit to view",
2686
+ openLarger: "Open larger",
2687
+ fullScreen: "Full screen",
2688
+ exitFullScreen: "Exit full screen",
2686
2689
  link: {
2687
2690
  links: "links to",
2688
2691
  references: "refers to",
@@ -2683,6 +2683,9 @@ var e = {
2683
2683
  zoomIn: "Acercar",
2684
2684
  zoomOut: "Alejar",
2685
2685
  fit: "Ajustar a la vista",
2686
+ openLarger: "Abrir más grande",
2687
+ fullScreen: "Pantalla completa",
2688
+ exitFullScreen: "Salir de pantalla completa",
2686
2689
  link: {
2687
2690
  links: "enlaza con",
2688
2691
  references: "hace referencia a",
@@ -2683,6 +2683,9 @@ var e = {
2683
2683
  zoomIn: "拡大",
2684
2684
  zoomOut: "縮小",
2685
2685
  fit: "画面に合わせる",
2686
+ openLarger: "大きく開く",
2687
+ fullScreen: "全画面表示",
2688
+ exitFullScreen: "全画面表示を終了",
2686
2689
  link: {
2687
2690
  links: "リンク先",
2688
2691
  references: "参照先",
@@ -2683,6 +2683,9 @@ var e = {
2683
2683
  zoomIn: "확대",
2684
2684
  zoomOut: "축소",
2685
2685
  fit: "화면에 맞추기",
2686
+ openLarger: "크게 열기",
2687
+ fullScreen: "전체 화면",
2688
+ exitFullScreen: "전체 화면 종료",
2686
2689
  link: {
2687
2690
  links: "링크함",
2688
2691
  references: "참조함",
@@ -2683,6 +2683,9 @@ var e = {
2683
2683
  zoomIn: "放大",
2684
2684
  zoomOut: "缩小",
2685
2685
  fit: "适应视图",
2686
+ openLarger: "放大打开",
2687
+ fullScreen: "全屏",
2688
+ exitFullScreen: "退出全屏",
2686
2689
  link: {
2687
2690
  links: "链接到",
2688
2691
  references: "引用",
@@ -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 };
@@ -14,11 +14,25 @@ function i(e, t) {
14
14
  localStorage.setItem(n(e), t);
15
15
  } catch {}
16
16
  }
17
- var a = (n) => ({
17
+ var a = "tandem-projects-expanded";
18
+ function o() {
19
+ try {
20
+ let e = JSON.parse(localStorage.getItem(a) ?? "[]");
21
+ return new Set(Array.isArray(e) ? e.filter((e) => typeof e == "string") : []);
22
+ } catch {
23
+ return /* @__PURE__ */ new Set();
24
+ }
25
+ }
26
+ function s(e) {
27
+ try {
28
+ localStorage.setItem(a, JSON.stringify([...e]));
29
+ } catch {}
30
+ }
31
+ var c = (n) => ({
18
32
  ...typeof n.team == "string" && n.team && { team: n.team },
19
33
  ...(n.status === "all" || t.includes(n.status)) && { status: n.status },
20
34
  ...e.includes(n.health) && { health: n.health },
21
35
  ...(n.view === "list" || n.view === "timeline" || n.view === "templates") && { view: n.view },
22
36
  ...typeof n.parent == "string" && n.parent && { parent: n.parent }
23
37
  });
24
- export { a as projectSearch, i as storeLayout, r as storedLayout };
38
+ export { c as projectSearch, s as storeExpanded, i as storeLayout, o as storedExpanded, r as storedLayout };
package/lib/projects.js CHANGED
@@ -8,20 +8,7 @@ function t(e, t) {
8
8
  };
9
9
  return r(t), n;
10
10
  }
11
- function n(e) {
12
- let t = new Set(e.map((e) => e.id)), n = [], r = (t, i) => {
13
- let a = e.filter((e) => e.parentId === t.id);
14
- n.push({
15
- project: t,
16
- depth: i,
17
- children: a.length
18
- });
19
- for (let e of a) r(e, i + 1);
20
- };
21
- for (let n of e) n.parentId && t.has(n.parentId) || r(n, 0);
22
- return n;
23
- }
24
- function r(e, t) {
11
+ function n(e, t) {
25
12
  let n = 1, r = e.find((e) => e.id === t);
26
13
  for (; r?.parentId && n <= 5;) {
27
14
  let t = r.parentId;
@@ -29,4 +16,4 @@ function r(e, t) {
29
16
  }
30
17
  return n;
31
18
  }
32
- export { r as projectLevel, e as projectRef, n as projectTree, t as projectsUnder };
19
+ export { n as projectLevel, e as projectRef, t as projectsUnder };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.186.1",
3
+ "version": "0.187.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/pages/projects.js CHANGED
@@ -9,33 +9,33 @@ import { useFavorites as g } from "../lib/favorites.js";
9
9
  import { copyItem as _, useLinkItems as v } from "../lib/menus.js";
10
10
  import { usePageTitle as y } from "../lib/pageTitle.js";
11
11
  import { usePeople as b } from "../lib/people.js";
12
- import { storeLayout as x, storedLayout as S } from "../lib/projectList.js";
13
- import { healthStates as C, projectStatuses as ee, shownStatus as te } from "../lib/projectStates.js";
14
- import { projectLevel as ne, projectRef as w, projectTree as T, projectsUnder as E } from "../lib/projects.js";
15
- import { useCan as re } from "../lib/roles.js";
16
- import { Link as D, useNavigate as ie } from "../lib/router.js";
17
- import { teamPath as ae } from "../lib/teamPaths.js";
12
+ import { storeExpanded as x, storeLayout as S, storedExpanded as C, storedLayout as ee } from "../lib/projectList.js";
13
+ import { healthStates as w, projectStatuses as te, shownStatus as ne } from "../lib/projectStates.js";
14
+ import { projectLevel as re, projectRef as T, projectsUnder as E } from "../lib/projects.js";
15
+ import { useCan as ie } from "../lib/roles.js";
16
+ import { Link as D, useNavigate as ae } from "../lib/router.js";
17
+ import { teamPath as oe } from "../lib/teamPaths.js";
18
18
  import { useTime as O } from "../lib/time.js";
19
- import { Avatar as k, Button as A, Combobox as oe, EmptyState as se, PageHeaderAddButton as ce, Switch as le, Tabs as j, ToggleGroup as ue, Tooltip as M, menuDivider as N, useOpenMenu as de } from "@parallelworks/ui";
20
- import { useParams as fe, useSearch as pe } from "@tanstack/react-router";
21
- import { useEffect as P, useId as me, useRef as F, useState as I } from "react";
19
+ import { Avatar as k, Button as A, Combobox as se, EmptyState as ce, PageHeaderAddButton as j, Switch as le, Tabs as M, ToggleGroup as ue, Tooltip as N, menuDivider as de, useOpenMenu as fe } from "@parallelworks/ui";
20
+ import { useParams as pe, useSearch as me } from "@tanstack/react-router";
21
+ import { useEffect as P, useId as he, useRef as F, useState as I } from "react";
22
22
  import { useFormatter as L, useTranslations as R } from "use-intl";
23
23
  import { jsx as z, jsxs as B } from "react/jsx-runtime";
24
24
  import { useSuspenseQuery as V } from "@tanstack/react-query";
25
25
  import { MoreButton as H } from "@parallelworks/ui/list";
26
26
  // src/pages/projects.tsx
27
27
  function U() {
28
- let { workspace: r, key: a } = fe({ strict: !1 }), s = pe({ strict: !1 }), u = a ? {
28
+ let { workspace: r, key: a } = pe({ strict: !1 }), s = me({ strict: !1 }), u = a ? {
29
29
  ...s,
30
30
  team: a
31
- } : s, f = R("planning"), p = R("common"), { data: m } = V(e(r)), { data: b } = V(t(r)), C = b.find((e) => e.key === u.team);
32
- y(C ? f("teamProjects", { team: C.name }) : f("projects"));
33
- let T = a ? "list" : "timeline", D = u.view ?? S(!!a) ?? T, O = m.filter((e) => (!C || e.teamIds.includes(C.id)) && !!e.template == (D === "templates")), k = re(r, "manage_projects"), [j, M] = I(null), P = me(), F = ie(), L = de(), H = v(), U = u.parent ? m.find((e) => e.id === u.parent) : void 0, W = U && new Set(E(m, U.id).map((e) => e.id)), G = te(u.status, D === "templates"), K = O.filter((e) => (!G || e.status === G) && (!u.health || h(e) === u.health) && (!W || W.has(e.id))), q = O.length > 0 && (!!G || !!u.health), J = (e) => {
31
+ } : s, f = R("planning"), p = R("common"), { data: m } = V(e(r)), { data: b } = V(t(r)), x = b.find((e) => e.key === u.team);
32
+ y(x ? f("teamProjects", { team: x.name }) : f("projects"));
33
+ let C = a ? "list" : "timeline", w = u.view ?? ee(!!a) ?? C, D = m.filter((e) => (!x || e.teamIds.includes(x.id)) && !!e.template == (w === "templates")), O = ie(r, "manage_projects"), [k, M] = I(null), N = he(), P = ae(), F = fe(), L = v(), H = u.parent ? m.find((e) => e.id === u.parent) : void 0, U = H && new Set(E(m, H.id).map((e) => e.id)), W = ne(u.status, w === "templates"), G = D.filter((e) => (!W || e.status === W) && (!u.health || h(e) === u.health) && (!U || U.has(e.id))), K = D.length > 0 && (!!W || !!u.health), q = (e) => {
34
34
  let { team: t, ...n } = Object.fromEntries(Object.entries({
35
35
  ...u,
36
36
  ...e
37
37
  }).filter(([, e]) => e !== void 0));
38
- return F(a ? {
38
+ return P(a ? {
39
39
  to: "/$workspace/teams/$key/projects",
40
40
  params: {
41
41
  workspace: r,
@@ -49,44 +49,44 @@ function U() {
49
49
  search: n,
50
50
  replace: !0
51
51
  });
52
- }, Y = g(r), X = R("favorites"), Z = (e) => [
52
+ }, J = g(r), Y = R("favorites"), X = (e) => [
53
53
  {
54
54
  label: p("open"),
55
- onClick: () => F({
55
+ onClick: () => P({
56
56
  to: "/$workspace/projects/$projectId",
57
57
  params: {
58
58
  workspace: r,
59
- projectId: w(e)
59
+ projectId: T(e)
60
60
  }
61
61
  })
62
62
  },
63
63
  {
64
64
  label: f("viewIssues"),
65
- onClick: () => F({
65
+ onClick: () => P({
66
66
  to: "/$workspace/projects/$projectId",
67
67
  params: {
68
68
  workspace: r,
69
- projectId: w(e)
69
+ projectId: T(e)
70
70
  },
71
71
  search: { tab: "issues" }
72
72
  })
73
73
  },
74
74
  {
75
- label: Y.find("project", e.id) ? X("remove") : X("add"),
76
- onClick: () => Y.toggle("project", e.id)
75
+ label: J.find("project", e.id) ? Y("remove") : Y("add"),
76
+ onClick: () => J.toggle("project", e.id)
77
77
  },
78
- ...k && !e.template && ne(m, e.id) < 5 ? [{
78
+ ...O && !e.template && re(m, e.id) < 5 ? [{
79
79
  label: f("newSubProject"),
80
80
  onClick: () => M(e.id)
81
81
  }] : [],
82
- N,
83
- ...H(`/${r}/projects/${w(e)}`),
82
+ de,
83
+ ...L(`/${r}/projects/${T(e)}`),
84
84
  _(p("copyName"), e.name)
85
- ], Q = (e) => ({
85
+ ], Z = (e) => ({
86
86
  workspace: r,
87
87
  project: e,
88
- onContextMenu: (t) => L(t, Z(e)),
89
- menu: () => Z(e)
88
+ onContextMenu: (t) => F(t, X(e)),
89
+ menu: () => X(e)
90
90
  });
91
91
  return /* @__PURE__ */ B("div", {
92
92
  className: "flex h-full min-h-0 flex-col",
@@ -96,20 +96,20 @@ function U() {
96
96
  children: [
97
97
  /* @__PURE__ */ z("h1", {
98
98
  className: "min-w-0 truncate text-sm font-semibold",
99
- children: C ? f("teamProjects", { team: C.name }) : f("projects")
99
+ children: x ? f("teamProjects", { team: x.name }) : f("projects")
100
100
  }),
101
101
  /* @__PURE__ */ z(i, {
102
102
  workspace: r,
103
103
  page: "projects",
104
- team: C && {
105
- href: ae(r, C.key, "projects"),
106
- label: f("teamProjects", { team: C.name })
104
+ team: x && {
105
+ href: oe(r, x.key, "projects"),
106
+ label: f("teamProjects", { team: x.name })
107
107
  }
108
108
  }),
109
109
  /* @__PURE__ */ z("span", {
110
110
  className: "ml-auto flex items-center gap-1",
111
111
  children: /* @__PURE__ */ z(n, {
112
- ...D !== "templates" && {
112
+ ...w !== "templates" && {
113
113
  layouts: [{
114
114
  value: "list",
115
115
  label: f("views.list"),
@@ -119,28 +119,28 @@ function U() {
119
119
  label: f("views.timeline"),
120
120
  icon: /* @__PURE__ */ z(l, {})
121
121
  }],
122
- layout: D,
122
+ layout: w,
123
123
  onLayoutChange: (e) => {
124
- x(!!a, e), J({ view: e });
124
+ S(!!a, e), q({ view: e });
125
125
  }
126
126
  },
127
- changed: D !== T,
127
+ changed: w !== C,
128
128
  children: /* @__PURE__ */ B("div", {
129
129
  className: "flex items-center justify-between gap-3",
130
130
  children: [/* @__PURE__ */ z("span", {
131
- id: P,
131
+ id: N,
132
132
  className: "text-sm",
133
133
  children: f("showTemplates")
134
134
  }), /* @__PURE__ */ z(le, {
135
135
  size: "sm",
136
- checked: D === "templates",
137
- onCheckedChange: (e) => J({ view: e ? "templates" : void 0 }),
138
- "aria-labelledby": P
136
+ checked: w === "templates",
137
+ onCheckedChange: (e) => q({ view: e ? "templates" : void 0 }),
138
+ "aria-labelledby": N
139
139
  })]
140
140
  })
141
141
  })
142
142
  }),
143
- k && /* @__PURE__ */ z(ce, {
143
+ O && /* @__PURE__ */ z(j, {
144
144
  label: f("newProject"),
145
145
  onClick: () => M("")
146
146
  })
@@ -152,23 +152,23 @@ function U() {
152
152
  /* @__PURE__ */ z(ue, {
153
153
  label: f("filterStatus"),
154
154
  multiple: !1,
155
- all: { count: O.length },
156
- options: ee.map((e) => ({
155
+ all: { count: D.length },
156
+ options: te.map((e) => ({
157
157
  value: e,
158
158
  label: f(`status.${e}`),
159
- count: O.filter((t) => t.status === e).length
159
+ count: D.filter((t) => t.status === e).length
160
160
  })),
161
- value: G ? [G] : [],
162
- onValueChange: ([e]) => J({ status: e ?? "all" })
161
+ value: W ? [W] : [],
162
+ onValueChange: ([e]) => q({ status: e ?? "all" })
163
163
  }),
164
164
  u.health && /* @__PURE__ */ z(A, {
165
165
  variant: "outline",
166
166
  size: "sm",
167
167
  "aria-pressed": !0,
168
- onClick: () => J({ health: void 0 }),
168
+ onClick: () => q({ health: void 0 }),
169
169
  children: f("healthFilter", { health: f(`health.${u.health}`) })
170
170
  }),
171
- O.some((e) => e.parentId) && /* @__PURE__ */ z(oe, {
171
+ D.some((e) => e.parentId) && /* @__PURE__ */ z(se, {
172
172
  items: [{
173
173
  value: "",
174
174
  label: f("anyParent")
@@ -177,14 +177,14 @@ function U() {
177
177
  label: e.name
178
178
  }))],
179
179
  value: u.parent ?? "",
180
- onValueChange: (e) => J({ parent: e || void 0 }),
180
+ onValueChange: (e) => q({ parent: e || void 0 }),
181
181
  placeholder: f("parentProject"),
182
182
  "aria-label": f("parentProject"),
183
183
  trigger: /* @__PURE__ */ z(A, {
184
184
  variant: "outline",
185
185
  size: "sm",
186
- className: U ? "border-(--theme-link) text-(--theme-app)" : void 0,
187
- children: U ? f("underProject", { name: U.name }) : f("parentProject")
186
+ className: H ? "border-(--theme-link) text-(--theme-app)" : void 0,
187
+ children: H ? f("underProject", { name: H.name }) : f("parentProject")
188
188
  })
189
189
  })
190
190
  ]
@@ -193,79 +193,90 @@ function U() {
193
193
  className: "flex min-h-0 flex-1",
194
194
  children: [/* @__PURE__ */ z("div", {
195
195
  className: "min-h-0 min-w-0 flex-1 overflow-auto",
196
- children: K.length === 0 ? /* @__PURE__ */ z("div", {
196
+ children: G.length === 0 ? /* @__PURE__ */ z("div", {
197
197
  className: "p-6",
198
- children: /* @__PURE__ */ z(se, {
198
+ children: /* @__PURE__ */ z(ce, {
199
199
  icon: /* @__PURE__ */ z(c, {}),
200
- title: f(q ? "noProjectsWithStatus" : D === "templates" ? "noTemplates" : "noProjects"),
201
- ...!q && { description: f(D === "templates" ? "noTemplatesDescription" : "noProjectsDescription") },
202
- ...k && !q && D !== "templates" && { action: /* @__PURE__ */ z(A, {
200
+ title: f(K ? "noProjectsWithStatus" : w === "templates" ? "noTemplates" : "noProjects"),
201
+ ...!K && { description: f(w === "templates" ? "noTemplatesDescription" : "noProjectsDescription") },
202
+ ...O && !K && w !== "templates" && { action: /* @__PURE__ */ z(A, {
203
203
  type: "button",
204
204
  variant: "primary",
205
205
  onClick: () => M(""),
206
206
  children: f("newProject")
207
207
  }) }
208
208
  })
209
- }) : D === "timeline" ? /* @__PURE__ */ z(ve, {
209
+ }) : w === "timeline" ? /* @__PURE__ */ z(ye, {
210
210
  workspace: r,
211
- projects: K,
212
- rowProps: Q
213
- }) : /* @__PURE__ */ z(he, {
214
- projects: K,
215
- rowProps: Q
211
+ projects: G,
212
+ rowProps: Z
213
+ }) : /* @__PURE__ */ z(ge, {
214
+ projects: G,
215
+ pool: m.filter((e) => !!e.template == (w === "templates")),
216
+ rowProps: Z
216
217
  })
217
- }), /* @__PURE__ */ z(be, {
218
+ }), /* @__PURE__ */ z(xe, {
218
219
  workspace: r,
219
- projects: O,
220
+ projects: D,
220
221
  health: u.health,
221
- onHealth: (e) => J({ health: e === u.health ? void 0 : e })
222
+ onHealth: (e) => q({ health: e === u.health ? void 0 : e })
222
223
  })]
223
224
  }),
224
- j !== null && /* @__PURE__ */ z(d, {
225
+ k !== null && /* @__PURE__ */ z(d, {
225
226
  workspace: r,
226
- teamId: C?.id,
227
- parentId: j || void 0,
227
+ teamId: x?.id,
228
+ parentId: k || void 0,
228
229
  onClose: () => M(null)
229
230
  })
230
231
  ]
231
232
  });
232
233
  }
233
234
  var W = "@4xl:grid @4xl:grid-cols-[minmax(0,1fr)_10rem_2rem_2rem_6rem_8rem_2rem]";
234
- function he({ projects: e, rowProps: t }) {
235
- let n = R("planning"), [r, i] = I(/* @__PURE__ */ new Set()), a = new Set([...r].flatMap((t) => E(e, t).map((e) => e.id))), o = (e) => i((t) => {
235
+ function ge({ projects: e, pool: t, rowProps: n }) {
236
+ let r = R("planning"), [i, a] = I(C), o = (e) => a((t) => {
236
237
  let n = new Set(t);
237
- return n.delete(e) || n.add(e), n;
238
- });
238
+ return n.delete(e) || n.add(e), x(n), n;
239
+ }), s = new Set(e.map((e) => e.id)), c = [], l = (e, n) => {
240
+ let r = t.filter((t) => t.parentId === e.id);
241
+ if (c.push({
242
+ project: e,
243
+ depth: n,
244
+ children: r.length,
245
+ muted: !s.has(e.id)
246
+ }), i.has(e.id) && n < 5) for (let e of r) l(e, n + 1);
247
+ };
248
+ for (let t of e) t.parentId && s.has(t.parentId) || l(t, 0);
239
249
  return /* @__PURE__ */ B("div", {
240
250
  className: "@container",
241
251
  children: [/* @__PURE__ */ B("div", {
242
252
  className: `hidden h-8 items-center gap-3 border-b border-border px-4 text-xs text-muted-foreground md:px-5 ${W}`,
243
253
  children: [
244
- /* @__PURE__ */ z("span", { children: n("name") }),
245
- /* @__PURE__ */ z("span", { children: n("healthLabel") }),
246
- /* @__PURE__ */ z(M, {
247
- content: n("priority"),
254
+ /* @__PURE__ */ z("span", { children: r("name") }),
255
+ /* @__PURE__ */ z("span", { children: r("healthLabel") }),
256
+ /* @__PURE__ */ z(N, {
257
+ content: r("priority"),
248
258
  children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z("span", {
249
259
  className: "sr-only",
250
- children: n("priority")
260
+ children: r("priority")
251
261
  }) })
252
262
  }),
253
- /* @__PURE__ */ z(M, {
254
- content: n("lead"),
263
+ /* @__PURE__ */ z(N, {
264
+ content: r("lead"),
255
265
  children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z("span", {
256
266
  className: "sr-only",
257
- children: n("lead")
267
+ children: r("lead")
258
268
  }) })
259
269
  }),
260
- /* @__PURE__ */ z("span", { children: n("targetDate") }),
261
- /* @__PURE__ */ z("span", { children: n("progressTitle") }),
270
+ /* @__PURE__ */ z("span", { children: r("targetDate") }),
271
+ /* @__PURE__ */ z("span", { children: r("progressTitle") }),
262
272
  /* @__PURE__ */ z("span", {})
263
273
  ]
264
- }), /* @__PURE__ */ z("ul", { children: T(e).filter((e) => !a.has(e.project.id)).map((e) => /* @__PURE__ */ z(K, {
265
- ...t(e.project),
274
+ }), /* @__PURE__ */ z("ul", { children: c.map((e) => /* @__PURE__ */ z(K, {
275
+ ...n(e.project),
266
276
  depth: e.depth,
267
277
  childCount: e.children,
268
- folded: r.has(e.project.id),
278
+ folded: !i.has(e.project.id),
279
+ muted: e.muted,
269
280
  onFold: () => o(e.project.id)
270
281
  }, e.project.id)) })]
271
282
  });
@@ -277,8 +288,8 @@ function G({ project: e }) {
277
288
  name: e.name
278
289
  }) : /* @__PURE__ */ z(c, { className: "size-4 text-muted-foreground" });
279
290
  }
280
- function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0, childCount: o = 0, folded: c = !1, onFold: l }) {
281
- let d = R("planning"), g = R("common"), _ = O(), v = u(), { person: y } = b(e), x = t.lead ? y(t.lead) : void 0, S = h(t);
291
+ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0, childCount: o = 0, folded: c = !1, muted: l = !1, onFold: d }) {
292
+ let g = R("planning"), _ = R("common"), v = O(), y = u(), { person: x } = b(e), S = t.lead ? x(t.lead) : void 0, C = h(t);
282
293
  return /* @__PURE__ */ B("li", {
283
294
  className: "group flex items-center border-b border-border pr-2 hover:bg-muted/60",
284
295
  children: [
@@ -287,9 +298,9 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
287
298
  style: { width: `${i * 1.25 + 2}rem` },
288
299
  children: o > 0 && /* @__PURE__ */ z("button", {
289
300
  type: "button",
290
- onClick: l,
301
+ onClick: d,
291
302
  "aria-expanded": !c,
292
- "aria-label": d(c ? "showSubProjects" : "hideSubProjects", { name: t.name }),
303
+ "aria-label": g(c ? "showSubProjects" : "hideSubProjects", { name: t.name }),
293
304
  className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
294
305
  children: /* @__PURE__ */ z(a, { className: `size-3.5 transition-transform ${c ? "-rotate-90" : ""}` })
295
306
  })
@@ -298,10 +309,10 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
298
309
  to: "/$workspace/projects/$projectId",
299
310
  params: {
300
311
  workspace: e,
301
- projectId: w(t)
312
+ projectId: T(t)
302
313
  },
303
314
  onContextMenu: n,
304
- className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W}`,
315
+ className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W} ${l ? "opacity-60" : ""}`,
305
316
  children: [
306
317
  /* @__PURE__ */ B("span", {
307
318
  className: "flex min-w-0 basis-full items-center gap-2.5 @4xl:basis-auto",
@@ -318,41 +329,41 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
318
329
  }),
319
330
  /* @__PURE__ */ B("span", {
320
331
  className: "flex items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground",
321
- children: [/* @__PURE__ */ z(f, { state: S }), d(`health.${S}`)]
332
+ children: [/* @__PURE__ */ z(f, { state: C }), g(`health.${C}`)]
322
333
  }),
323
- /* @__PURE__ */ z(M, {
324
- content: v[t.priority],
334
+ /* @__PURE__ */ z(N, {
335
+ content: y[t.priority],
325
336
  children: /* @__PURE__ */ z("span", {
326
337
  role: "img",
327
- "aria-label": v[t.priority],
338
+ "aria-label": y[t.priority],
328
339
  className: "flex",
329
340
  children: /* @__PURE__ */ z(s, { priority: t.priority })
330
341
  })
331
342
  }),
332
343
  /* @__PURE__ */ z("span", {
333
344
  className: "flex",
334
- children: x && /* @__PURE__ */ z(M, {
335
- content: d("leadIs", { name: x.name }),
345
+ children: S && /* @__PURE__ */ z(N, {
346
+ content: g("leadIs", { name: S.name }),
336
347
  children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(k, {
337
- name: x.name,
338
- src: x.avatarUrl,
348
+ name: S.name,
349
+ src: S.avatarUrl,
339
350
  size: "sm"
340
351
  }) })
341
352
  })
342
353
  }),
343
354
  /* @__PURE__ */ z("span", {
344
355
  className: "text-xs text-muted-foreground tabular-nums",
345
- children: t.targetDate ? _.day(t.targetDate) : ""
356
+ children: t.targetDate ? v.day(t.targetDate) : ""
346
357
  }),
347
358
  /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(p, {
348
359
  progress: o > 0 ? t.treeProgress : t.progress,
349
360
  compact: !0
350
361
  }) }),
351
- /* @__PURE__ */ z(M, {
352
- content: d(`status.${t.status}`),
362
+ /* @__PURE__ */ z(N, {
363
+ content: g(`status.${t.status}`),
353
364
  children: /* @__PURE__ */ z("span", {
354
365
  role: "img",
355
- "aria-label": d(`status.${t.status}`),
366
+ "aria-label": g(`status.${t.status}`),
356
367
  className: "flex",
357
368
  children: /* @__PURE__ */ z(m, { status: t.status })
358
369
  })
@@ -361,7 +372,7 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
361
372
  }),
362
373
  /* @__PURE__ */ z(H, {
363
374
  items: r,
364
- label: g("moreActionsFor", { name: t.name })
375
+ label: _("moreActionsFor", { name: t.name })
365
376
  })
366
377
  ]
367
378
  });
@@ -369,15 +380,15 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
369
380
  var q = 864e5, J = 5, Y = 64, X = 256, Z = 56, Q = (e) => Date.parse(`${e}T00:00:00Z`), $ = (e) => {
370
381
  let t = new Date(e);
371
382
  return Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), 1);
372
- }, ge = () => {
383
+ }, _e = () => {
373
384
  let e = /* @__PURE__ */ new Date();
374
385
  return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
375
- }, _e = (e) => e - (new Date(e).getUTCDay() + 6) % 7 * q;
376
- function ve({ workspace: e, projects: t, rowProps: n }) {
386
+ }, ve = (e) => e - (new Date(e).getUTCDay() + 6) % 7 * q;
387
+ function ye({ workspace: e, projects: t, rowProps: n }) {
377
388
  let r = R("planning"), i = L(), a = F(null), [o, s] = I({
378
389
  left: 0,
379
390
  width: 0
380
- }), c = ge(), l = t.map((e) => {
391
+ }), c = _e(), l = t.map((e) => {
381
392
  let t = e.targetDate ? Q(e.targetDate) : void 0;
382
393
  return {
383
394
  p: e,
@@ -387,7 +398,7 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
387
398
  }), u = l.flatMap((e) => [e.start, e.end].filter((e) => e !== void 0)), d = $(Math.min(c - 90 * q, ...u)), f = $(Math.max(c + 300 * q, ...u) + 40 * q), p = (e) => (e - d) / q * J, m = p(f), h = [];
388
399
  for (let e = d; e < f; e = $(e + 32 * q)) h.push(e);
389
400
  let g = [];
390
- for (let e = _e(d) + 7 * q; e < f; e += 7 * q) g.push(e);
401
+ for (let e = ve(d) + 7 * q; e < f; e += 7 * q) g.push(e);
391
402
  let _ = (e, t) => i.dateTime(new Date(e), {
392
403
  ...t,
393
404
  timeZone: "UTC"
@@ -497,16 +508,16 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
497
508
  return /* @__PURE__ */ B("li", {
498
509
  className: "group flex hover:bg-muted/40",
499
510
  style: { height: Y },
500
- children: [/* @__PURE__ */ z(ye, { ...n(t) }), /* @__PURE__ */ B("div", {
511
+ children: [/* @__PURE__ */ z(be, { ...n(t) }), /* @__PURE__ */ B("div", {
501
512
  className: "relative",
502
513
  style: { width: m },
503
- children: [a && !u && !d && /* @__PURE__ */ z(M, {
514
+ children: [a && !u && !d && /* @__PURE__ */ z(N, {
504
515
  content: `${t.name}, ${v(r, i)}`,
505
516
  children: /* @__PURE__ */ B(D, {
506
517
  to: "/$workspace/projects/$projectId",
507
518
  params: {
508
519
  workspace: e,
509
- projectId: w(t)
520
+ projectId: T(t)
510
521
  },
511
522
  className: "absolute top-2 bottom-2 flex flex-col justify-end gap-1",
512
523
  style: {
@@ -535,7 +546,7 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
535
546
  to: "/$workspace/projects/$projectId",
536
547
  params: {
537
548
  workspace: e,
538
- projectId: w(t)
549
+ projectId: T(t)
539
550
  },
540
551
  className: "absolute top-1/2 flex -translate-y-1/2 items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground hover:text-foreground",
541
552
  style: u ? { left: o.left + 12 } : {
@@ -562,13 +573,13 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
562
573
  })
563
574
  });
564
575
  }
565
- function ye({ workspace: e, project: t, onContextMenu: n }) {
576
+ function be({ workspace: e, project: t, onContextMenu: n }) {
566
577
  let r = R("planning"), { person: i } = b(e), a = t.lead ? i(t.lead) : void 0, o = h(t);
567
578
  return /* @__PURE__ */ B(D, {
568
579
  to: "/$workspace/projects/$projectId",
569
580
  params: {
570
581
  workspace: e,
571
- projectId: w(t)
582
+ projectId: T(t)
572
583
  },
573
584
  onContextMenu: n,
574
585
  className: "sticky left-0 z-[2] flex shrink-0 items-center gap-2 border-r border-border bg-background px-4 group-hover:bg-muted",
@@ -579,7 +590,7 @@ function ye({ workspace: e, project: t, onContextMenu: n }) {
579
590
  className: "min-w-0 flex-1 truncate text-sm",
580
591
  children: t.name
581
592
  }),
582
- /* @__PURE__ */ z(M, {
593
+ /* @__PURE__ */ z(N, {
583
594
  content: r(`status.${t.status}`),
584
595
  children: /* @__PURE__ */ z("span", {
585
596
  role: "img",
@@ -588,7 +599,7 @@ function ye({ workspace: e, project: t, onContextMenu: n }) {
588
599
  children: /* @__PURE__ */ z(m, { status: t.status })
589
600
  })
590
601
  }),
591
- /* @__PURE__ */ z(M, {
602
+ /* @__PURE__ */ z(N, {
592
603
  content: r(`health.${o}`),
593
604
  children: /* @__PURE__ */ z("span", {
594
605
  role: "img",
@@ -605,12 +616,12 @@ function ye({ workspace: e, project: t, onContextMenu: n }) {
605
616
  ]
606
617
  });
607
618
  }
608
- function be({ workspace: e, projects: n, health: i, onHealth: a }) {
619
+ function xe({ workspace: e, projects: n, health: i, onHealth: a }) {
609
620
  let o = R("planning"), { data: s } = V(t(e)), { person: c } = b(e), [l, u] = I("health"), d = (e) => n.filter(e).length, p = "flex h-9 w-full items-center gap-2.5 rounded-md px-2 text-sm", m = [...new Set(n.map((e) => e.lead ?? ""))];
610
621
  return /* @__PURE__ */ B("aside", {
611
622
  "aria-label": o("breakdown"),
612
623
  className: "hidden w-72 shrink-0 overflow-y-auto border-l border-border p-3 xl:block",
613
- children: [/* @__PURE__ */ z(j, {
624
+ children: [/* @__PURE__ */ z(M, {
614
625
  variant: "segmented",
615
626
  size: "sm",
616
627
  label: o("breakdown"),
@@ -627,7 +638,7 @@ function be({ workspace: e, projects: n, health: i, onHealth: a }) {
627
638
  }), /* @__PURE__ */ B("ul", {
628
639
  className: "mt-2",
629
640
  children: [
630
- l === "health" && C.map((e) => ({
641
+ l === "health" && w.map((e) => ({
631
642
  h: e,
632
643
  n: d((t) => h(t) === e)
633
644
  })).filter(({ n: e }) => e > 0).map(({ h: e, n: t }) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {