@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.
- package/_virtual/_virtual_i18n/en/common.js +3 -0
- package/_virtual/_virtual_i18n/es/common.js +3 -0
- package/_virtual/_virtual_i18n/ja/common.js +3 -0
- package/_virtual/_virtual_i18n/ko/common.js +3 -0
- package/_virtual/_virtual_i18n/zh/common.js +3 -0
- package/components/Graph.js +204 -134
- package/lib/projectList.js +16 -2
- package/lib/projects.js +2 -15
- package/package.json +1 -1
- package/pages/projects.js +130 -119
|
@@ -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",
|
package/components/Graph.js
CHANGED
|
@@ -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,
|
|
7
|
-
import { useMemo as
|
|
8
|
-
import { useTranslations as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { useQuery as
|
|
11
|
-
import { ExpandIcon as
|
|
12
|
-
import
|
|
13
|
-
import { Handle as
|
|
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
|
|
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
|
-
},
|
|
21
|
-
function
|
|
22
|
-
let { node: t, root: n, kind: r, vertical: i } = e, a =
|
|
23
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
25
|
+
children: /* @__PURE__ */ x("div", {
|
|
26
26
|
style: {
|
|
27
|
-
width:
|
|
28
|
-
height:
|
|
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__ */
|
|
32
|
+
/* @__PURE__ */ b(A, {
|
|
33
33
|
type: "target",
|
|
34
|
-
position: i ?
|
|
35
|
-
className:
|
|
34
|
+
position: i ? M.Top : M.Left,
|
|
35
|
+
className: U
|
|
36
36
|
}),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
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__ */
|
|
40
|
+
children: [/* @__PURE__ */ b("p", {
|
|
41
41
|
className: "truncate text-xs font-medium text-foreground",
|
|
42
42
|
children: t.title
|
|
43
|
-
}), /* @__PURE__ */
|
|
43
|
+
}), /* @__PURE__ */ x("p", {
|
|
44
44
|
className: "flex items-center gap-1 truncate text-[10px] text-muted-foreground",
|
|
45
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ b("span", { className: `size-1.5 shrink-0 rounded-full ${V(t)}` }), r]
|
|
46
46
|
})]
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ b(A, {
|
|
49
49
|
type: "source",
|
|
50
|
-
position: i ?
|
|
51
|
-
className:
|
|
50
|
+
position: i ? M.Bottom : M.Right,
|
|
51
|
+
className: U
|
|
52
52
|
})
|
|
53
53
|
]
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
67
|
-
box:
|
|
68
|
-
area:
|
|
66
|
+
var K = {
|
|
67
|
+
box: W,
|
|
68
|
+
area: G
|
|
69
69
|
};
|
|
70
|
-
function
|
|
71
|
-
let r = new
|
|
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:
|
|
86
|
-
height:
|
|
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
|
-
}),
|
|
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 -
|
|
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 +
|
|
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 -
|
|
131
|
-
y: i.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:
|
|
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
|
|
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
|
|
203
|
-
let e =
|
|
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
|
|
207
|
-
let
|
|
208
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
211
|
+
/* @__PURE__ */ b(d, {
|
|
212
212
|
size: "sm",
|
|
213
213
|
variant: "ghost",
|
|
214
|
-
label:
|
|
215
|
-
icon: /* @__PURE__ */
|
|
216
|
-
onClick: () =>
|
|
214
|
+
label: t("zoomIn"),
|
|
215
|
+
icon: /* @__PURE__ */ b(D, {}),
|
|
216
|
+
onClick: () => n()
|
|
217
217
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ b(d, {
|
|
219
219
|
size: "sm",
|
|
220
220
|
variant: "ghost",
|
|
221
|
-
label:
|
|
222
|
-
icon: /* @__PURE__ */
|
|
223
|
-
onClick: () =>
|
|
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__ */
|
|
232
|
+
e && /* @__PURE__ */ b(d, {
|
|
226
233
|
size: "sm",
|
|
227
234
|
variant: "ghost",
|
|
228
|
-
label: e
|
|
229
|
-
icon:
|
|
230
|
-
onClick:
|
|
235
|
+
label: e.label,
|
|
236
|
+
icon: e.icon,
|
|
237
|
+
onClick: e.onClick
|
|
231
238
|
})
|
|
232
239
|
]
|
|
233
240
|
});
|
|
234
241
|
}
|
|
235
|
-
function
|
|
236
|
-
return /* @__PURE__ */
|
|
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
|
|
246
|
-
let
|
|
247
|
-
let e = new Map((
|
|
248
|
-
return
|
|
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:
|
|
251
|
-
grouped:
|
|
259
|
+
vertical: T,
|
|
260
|
+
grouped: E,
|
|
252
261
|
groupOf: (t) => t.kind === "entry" ? {
|
|
253
262
|
id: "group:knowledge",
|
|
254
|
-
label:
|
|
263
|
+
label: u("entries")
|
|
255
264
|
} : t.teamId ? {
|
|
256
265
|
id: `group:${t.teamId}`,
|
|
257
|
-
label: e.get(t.teamId) ??
|
|
266
|
+
label: e.get(t.teamId) ?? u("workspace")
|
|
258
267
|
} : {
|
|
259
268
|
id: "group:workspace",
|
|
260
|
-
label:
|
|
269
|
+
label: m?.name ?? u("workspace")
|
|
261
270
|
},
|
|
262
|
-
kindLabel:
|
|
263
|
-
linkLabel: (e) =>
|
|
264
|
-
quietLabels:
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
c,
|
|
279
|
+
T,
|
|
280
|
+
E,
|
|
281
|
+
p,
|
|
282
|
+
m,
|
|
275
283
|
u,
|
|
276
|
-
|
|
277
|
-
|
|
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) :
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
]),
|
|
291
|
-
x: Math.max(16, (r -
|
|
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:
|
|
294
|
-
};
|
|
295
|
-
return
|
|
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 ??
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
-
nodes:
|
|
300
|
-
edges:
|
|
301
|
-
onEdgeMouseEnter: (e, t) =>
|
|
302
|
-
onEdgeMouseLeave: () =>
|
|
303
|
-
nodeTypes:
|
|
304
|
-
defaultViewport:
|
|
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 &&
|
|
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
|
|
325
|
-
let i = s(t), a =
|
|
326
|
-
return /* @__PURE__ */
|
|
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
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
369
|
-
let a =
|
|
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__ */
|
|
390
|
+
children: [/* @__PURE__ */ b("p", {
|
|
373
391
|
className: "text-xs font-medium text-muted-foreground",
|
|
374
392
|
children: a("title")
|
|
375
|
-
}), /* @__PURE__ */
|
|
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
|
-
})
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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 {
|
|
477
|
+
export { ee as Connections, Z as GraphDrawing, $ as GraphList };
|
package/lib/projectList.js
CHANGED
|
@@ -14,11 +14,25 @@ function i(e, t) {
|
|
|
14
14
|
localStorage.setItem(n(e), t);
|
|
15
15
|
} catch {}
|
|
16
16
|
}
|
|
17
|
-
var a =
|
|
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 {
|
|
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 {
|
|
19
|
+
export { n as projectLevel, e as projectRef, t as projectsUnder };
|
package/package.json
CHANGED
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 {
|
|
13
|
-
import { healthStates as
|
|
14
|
-
import { projectLevel as
|
|
15
|
-
import { useCan as
|
|
16
|
-
import { Link as D, useNavigate as
|
|
17
|
-
import { teamPath as
|
|
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
|
|
20
|
-
import { useParams as
|
|
21
|
-
import { useEffect as P, useId as
|
|
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 } =
|
|
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)),
|
|
32
|
-
y(
|
|
33
|
-
let
|
|
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
|
|
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
|
-
},
|
|
52
|
+
}, J = g(r), Y = R("favorites"), X = (e) => [
|
|
53
53
|
{
|
|
54
54
|
label: p("open"),
|
|
55
|
-
onClick: () =>
|
|
55
|
+
onClick: () => P({
|
|
56
56
|
to: "/$workspace/projects/$projectId",
|
|
57
57
|
params: {
|
|
58
58
|
workspace: r,
|
|
59
|
-
projectId:
|
|
59
|
+
projectId: T(e)
|
|
60
60
|
}
|
|
61
61
|
})
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
label: f("viewIssues"),
|
|
65
|
-
onClick: () =>
|
|
65
|
+
onClick: () => P({
|
|
66
66
|
to: "/$workspace/projects/$projectId",
|
|
67
67
|
params: {
|
|
68
68
|
workspace: r,
|
|
69
|
-
projectId:
|
|
69
|
+
projectId: T(e)
|
|
70
70
|
},
|
|
71
71
|
search: { tab: "issues" }
|
|
72
72
|
})
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
label:
|
|
76
|
-
onClick: () =>
|
|
75
|
+
label: J.find("project", e.id) ? Y("remove") : Y("add"),
|
|
76
|
+
onClick: () => J.toggle("project", e.id)
|
|
77
77
|
},
|
|
78
|
-
...
|
|
78
|
+
...O && !e.template && re(m, e.id) < 5 ? [{
|
|
79
79
|
label: f("newSubProject"),
|
|
80
80
|
onClick: () => M(e.id)
|
|
81
81
|
}] : [],
|
|
82
|
-
|
|
83
|
-
...
|
|
82
|
+
de,
|
|
83
|
+
...L(`/${r}/projects/${T(e)}`),
|
|
84
84
|
_(p("copyName"), e.name)
|
|
85
|
-
],
|
|
85
|
+
], Z = (e) => ({
|
|
86
86
|
workspace: r,
|
|
87
87
|
project: e,
|
|
88
|
-
onContextMenu: (t) =>
|
|
89
|
-
menu: () =>
|
|
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:
|
|
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:
|
|
105
|
-
href:
|
|
106
|
-
label: f("teamProjects", { team:
|
|
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
|
-
...
|
|
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:
|
|
122
|
+
layout: w,
|
|
123
123
|
onLayoutChange: (e) => {
|
|
124
|
-
|
|
124
|
+
S(!!a, e), q({ view: e });
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
changed:
|
|
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:
|
|
131
|
+
id: N,
|
|
132
132
|
className: "text-sm",
|
|
133
133
|
children: f("showTemplates")
|
|
134
134
|
}), /* @__PURE__ */ z(le, {
|
|
135
135
|
size: "sm",
|
|
136
|
-
checked:
|
|
137
|
-
onCheckedChange: (e) =>
|
|
138
|
-
"aria-labelledby":
|
|
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
|
-
|
|
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:
|
|
156
|
-
options:
|
|
155
|
+
all: { count: D.length },
|
|
156
|
+
options: te.map((e) => ({
|
|
157
157
|
value: e,
|
|
158
158
|
label: f(`status.${e}`),
|
|
159
|
-
count:
|
|
159
|
+
count: D.filter((t) => t.status === e).length
|
|
160
160
|
})),
|
|
161
|
-
value:
|
|
162
|
-
onValueChange: ([e]) =>
|
|
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: () =>
|
|
168
|
+
onClick: () => q({ health: void 0 }),
|
|
169
169
|
children: f("healthFilter", { health: f(`health.${u.health}`) })
|
|
170
170
|
}),
|
|
171
|
-
|
|
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) =>
|
|
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:
|
|
187
|
-
children:
|
|
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:
|
|
196
|
+
children: G.length === 0 ? /* @__PURE__ */ z("div", {
|
|
197
197
|
className: "p-6",
|
|
198
|
-
children: /* @__PURE__ */ z(
|
|
198
|
+
children: /* @__PURE__ */ z(ce, {
|
|
199
199
|
icon: /* @__PURE__ */ z(c, {}),
|
|
200
|
-
title: f(
|
|
201
|
-
...!
|
|
202
|
-
...
|
|
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
|
-
}) :
|
|
209
|
+
}) : w === "timeline" ? /* @__PURE__ */ z(ye, {
|
|
210
210
|
workspace: r,
|
|
211
|
-
projects:
|
|
212
|
-
rowProps:
|
|
213
|
-
}) : /* @__PURE__ */ z(
|
|
214
|
-
projects:
|
|
215
|
-
|
|
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(
|
|
218
|
+
}), /* @__PURE__ */ z(xe, {
|
|
218
219
|
workspace: r,
|
|
219
|
-
projects:
|
|
220
|
+
projects: D,
|
|
220
221
|
health: u.health,
|
|
221
|
-
onHealth: (e) =>
|
|
222
|
+
onHealth: (e) => q({ health: e === u.health ? void 0 : e })
|
|
222
223
|
})]
|
|
223
224
|
}),
|
|
224
|
-
|
|
225
|
+
k !== null && /* @__PURE__ */ z(d, {
|
|
225
226
|
workspace: r,
|
|
226
|
-
teamId:
|
|
227
|
-
parentId:
|
|
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
|
|
235
|
-
let
|
|
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:
|
|
245
|
-
/* @__PURE__ */ z("span", { children:
|
|
246
|
-
/* @__PURE__ */ z(
|
|
247
|
-
content:
|
|
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:
|
|
260
|
+
children: r("priority")
|
|
251
261
|
}) })
|
|
252
262
|
}),
|
|
253
|
-
/* @__PURE__ */ z(
|
|
254
|
-
content:
|
|
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:
|
|
267
|
+
children: r("lead")
|
|
258
268
|
}) })
|
|
259
269
|
}),
|
|
260
|
-
/* @__PURE__ */ z("span", { children:
|
|
261
|
-
/* @__PURE__ */ z("span", { children:
|
|
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:
|
|
265
|
-
...
|
|
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:
|
|
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,
|
|
281
|
-
let
|
|
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:
|
|
301
|
+
onClick: d,
|
|
291
302
|
"aria-expanded": !c,
|
|
292
|
-
"aria-label":
|
|
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:
|
|
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:
|
|
332
|
+
children: [/* @__PURE__ */ z(f, { state: C }), g(`health.${C}`)]
|
|
322
333
|
}),
|
|
323
|
-
/* @__PURE__ */ z(
|
|
324
|
-
content:
|
|
334
|
+
/* @__PURE__ */ z(N, {
|
|
335
|
+
content: y[t.priority],
|
|
325
336
|
children: /* @__PURE__ */ z("span", {
|
|
326
337
|
role: "img",
|
|
327
|
-
"aria-label":
|
|
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:
|
|
335
|
-
content:
|
|
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:
|
|
338
|
-
src:
|
|
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 ?
|
|
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(
|
|
352
|
-
content:
|
|
362
|
+
/* @__PURE__ */ z(N, {
|
|
363
|
+
content: g(`status.${t.status}`),
|
|
353
364
|
children: /* @__PURE__ */ z("span", {
|
|
354
365
|
role: "img",
|
|
355
|
-
"aria-label":
|
|
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:
|
|
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
|
-
},
|
|
383
|
+
}, _e = () => {
|
|
373
384
|
let e = /* @__PURE__ */ new Date();
|
|
374
385
|
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
375
|
-
},
|
|
376
|
-
function
|
|
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 =
|
|
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 =
|
|
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(
|
|
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(
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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" &&
|
|
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", {
|