@parallelworks/tandem-web 0.139.0 → 0.139.1
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/components/AppRoot.js +9 -8
- package/components/settings.js +10 -10
- package/hostedApp.js +47 -45
- package/lib/pageTitle.js +22 -10
- package/package.json +1 -1
- package/pages/areas.js +112 -112
- package/pages/decisions.js +36 -36
- package/pages/issues.js +34 -34
- package/pages/projects.js +109 -109
- package/pages/triage.js +64 -64
- package/routes/_workspace/agents/_slug2.js +21 -21
- package/routes/_workspace/agents/index2.js +16 -16
- package/routes/_workspace/areas/_area2.js +105 -105
- package/routes/_workspace/docs/_doc2.js +185 -185
- package/routes/_workspace/graph3.js +8 -8
- package/routes/_workspace/issues/_identifier2.js +484 -484
- package/routes/_workspace/knowledge/_term2.js +166 -166
- package/routes/_workspace/knowledge/index2.js +33 -33
- package/routes/_workspace/measures3.js +18 -18
- package/routes/_workspace/notifications2.js +112 -112
- package/routes/_workspace/people/_username2.js +36 -36
- package/routes/_workspace/projects/_projectId3.js +215 -215
- package/routes/_workspace/teams/_key/cycles/_number2.js +16 -16
- package/routes/_workspace/teams/_key/cycles/index2.js +38 -38
- package/routes/_workspace/teams/_key/settings2.js +131 -131
- package/routes/docs/route2.js +5 -5
- package/routes/new2.js +8 -8
- package/routes/request2._token.js +4 -4
package/pages/areas.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { usePageTitle as e } from "../lib/pageTitle.js";
|
|
2
|
+
import { Link as t } from "../lib/router.js";
|
|
3
|
+
import { areasQuery as n, countsQuery as r, docsQuery as i, inboxQuery as a, teamsQuery as o, unfiledQuery as s, workspaceQuery as c } from "../api/queries.js";
|
|
4
|
+
import { AddIcon as l, AreaIcon as u, ChevronRightIcon as d, FileTextIcon as f, GridIcon as p, ListViewIcon as m } from "../components/icons.js";
|
|
5
|
+
import { docRef as h } from "../lib/docs.js";
|
|
6
|
+
import { usePeople as g } from "../lib/people.js";
|
|
7
7
|
import { EntityIcon as _ } from "../components/EntityIcon.js";
|
|
8
8
|
import { DocIcon as v } from "../components/DocIcon.js";
|
|
9
9
|
import { actorAvatar as y } from "../lib/avatar.js";
|
|
@@ -22,15 +22,15 @@ import { MoreButton as ne } from "@parallelworks/ui/list";
|
|
|
22
22
|
// src/pages/areas.tsx
|
|
23
23
|
var re = (...e) => e.filter(Boolean).join(" ");
|
|
24
24
|
function ie() {
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
let v =
|
|
25
|
+
let t = q("areas"), { workspace: i, key: a } = V({ strict: !1 }), { team: d = a } = H({ strict: !1 }), { data: f } = Q(n(i)), { data: h } = Q(o(i)), g = h.find((e) => e.key === d);
|
|
26
|
+
e(t("title"), g?.name);
|
|
27
|
+
let v = g ? f.filter((e) => e.teamId === g.id) : f, { data: y } = Q(c(i)), { data: C } = Q(r(i)), [w, T] = G(null), { data: E } = Z(s(i, g?.key)), D = (E?.proposed.length ?? 0) + (E?.notInDocs.length ?? 0), O = v.filter((e) => e.status === "proposed"), A = [...!g && f.some((e) => !e.teamId) ? [{
|
|
28
28
|
id: "",
|
|
29
29
|
key: "workspace",
|
|
30
30
|
name: y.name,
|
|
31
31
|
icon: y.icon,
|
|
32
32
|
color: y.color
|
|
33
|
-
}] : [], ...
|
|
33
|
+
}] : [], ...h.filter((e) => !e.archivedAt && (!g || e.id === g.id)).map((e) => ({
|
|
34
34
|
id: e.id,
|
|
35
35
|
key: e.key,
|
|
36
36
|
name: e.name,
|
|
@@ -39,19 +39,19 @@ function ie() {
|
|
|
39
39
|
team: e
|
|
40
40
|
}))], M = (e) => A.find((t) => t.id === (e.teamId ?? "")), P = () => T({
|
|
41
41
|
kind: "create",
|
|
42
|
-
...
|
|
43
|
-
}), F = de(
|
|
42
|
+
...g && { space: g.key }
|
|
43
|
+
}), F = de(i, (e) => T({
|
|
44
44
|
kind: "edit",
|
|
45
45
|
area: e
|
|
46
46
|
}), (e) => T({
|
|
47
47
|
kind: "create",
|
|
48
48
|
parent: e
|
|
49
49
|
})), [I, L] = G(se), R = E && /* @__PURE__ */ X(J, { children: [E.proposed.map((e) => /* @__PURE__ */ Y(x, {
|
|
50
|
-
workspace:
|
|
50
|
+
workspace: i,
|
|
51
51
|
entry: e,
|
|
52
52
|
isNew: !1
|
|
53
53
|
}, e.id)), E.notInDocs.map((e) => /* @__PURE__ */ Y(b, {
|
|
54
|
-
workspace:
|
|
54
|
+
workspace: i,
|
|
55
55
|
decision: e,
|
|
56
56
|
isNew: !1,
|
|
57
57
|
notInDocs: !0
|
|
@@ -64,21 +64,21 @@ function ie() {
|
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ Y("h1", {
|
|
66
66
|
className: "text-sm font-semibold",
|
|
67
|
-
children:
|
|
67
|
+
children: g ? t("teamTitle", { team: g.name }) : t("title")
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ Y("span", {
|
|
70
70
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
71
|
-
children:
|
|
71
|
+
children: t("count", { count: v.length })
|
|
72
72
|
}),
|
|
73
73
|
/* @__PURE__ */ Y(S, {
|
|
74
|
-
counts:
|
|
75
|
-
teamId:
|
|
74
|
+
counts: g ? C.teams[g.id] : C.workspace,
|
|
75
|
+
teamId: g?.id,
|
|
76
76
|
className: "max-sm:hidden"
|
|
77
77
|
}),
|
|
78
78
|
/* @__PURE__ */ Y("div", {
|
|
79
79
|
className: "ml-auto",
|
|
80
80
|
children: /* @__PURE__ */ Y(ee, {
|
|
81
|
-
label:
|
|
81
|
+
label: t("view"),
|
|
82
82
|
size: "sm",
|
|
83
83
|
value: I,
|
|
84
84
|
onValueChange: (e) => {
|
|
@@ -86,21 +86,21 @@ function ie() {
|
|
|
86
86
|
},
|
|
87
87
|
options: [{
|
|
88
88
|
value: "icons",
|
|
89
|
-
label:
|
|
90
|
-
icon: /* @__PURE__ */ Y(
|
|
89
|
+
label: t("icons"),
|
|
90
|
+
icon: /* @__PURE__ */ Y(p, {})
|
|
91
91
|
}, {
|
|
92
92
|
value: "list",
|
|
93
|
-
label:
|
|
94
|
-
icon: /* @__PURE__ */ Y(
|
|
93
|
+
label: t("list"),
|
|
94
|
+
icon: /* @__PURE__ */ Y(m, {})
|
|
95
95
|
}]
|
|
96
96
|
})
|
|
97
97
|
}),
|
|
98
98
|
/* @__PURE__ */ Y(k, {
|
|
99
99
|
variant: "primary",
|
|
100
100
|
size: "sm",
|
|
101
|
-
icon: /* @__PURE__ */ Y(
|
|
101
|
+
icon: /* @__PURE__ */ Y(l, { className: "size-3.5" }),
|
|
102
102
|
onClick: P,
|
|
103
|
-
children:
|
|
103
|
+
children: t("new")
|
|
104
104
|
})
|
|
105
105
|
]
|
|
106
106
|
}),
|
|
@@ -110,22 +110,22 @@ function ie() {
|
|
|
110
110
|
v.length === 0 ? /* @__PURE__ */ Y("div", {
|
|
111
111
|
className: "p-6",
|
|
112
112
|
children: /* @__PURE__ */ Y(j, {
|
|
113
|
-
icon: /* @__PURE__ */ Y(
|
|
114
|
-
title:
|
|
115
|
-
description:
|
|
113
|
+
icon: /* @__PURE__ */ Y(u, {}),
|
|
114
|
+
title: t("none"),
|
|
115
|
+
description: t("description"),
|
|
116
116
|
action: /* @__PURE__ */ Y(k, {
|
|
117
117
|
variant: "primary",
|
|
118
118
|
size: "sm",
|
|
119
119
|
onClick: P,
|
|
120
|
-
children:
|
|
120
|
+
children: t("new")
|
|
121
121
|
})
|
|
122
122
|
})
|
|
123
123
|
}) : /* @__PURE__ */ X(J, { children: [O.length > 0 && /* @__PURE__ */ Y($, {
|
|
124
|
-
title:
|
|
124
|
+
title: t("toReview"),
|
|
125
125
|
count: O.length,
|
|
126
|
-
icon: /* @__PURE__ */ Y(
|
|
126
|
+
icon: /* @__PURE__ */ Y(u, { className: "size-4 text-warning" }),
|
|
127
127
|
children: O.map((e) => /* @__PURE__ */ Y(pe, {
|
|
128
|
-
workspace:
|
|
128
|
+
workspace: i,
|
|
129
129
|
area: e,
|
|
130
130
|
counts: C.areas[e.id],
|
|
131
131
|
siblings: v.filter((t) => (t.teamId ?? "") === (e.teamId ?? "")),
|
|
@@ -134,62 +134,62 @@ function ie() {
|
|
|
134
134
|
areaMenu: F
|
|
135
135
|
}, e.id))
|
|
136
136
|
}), I === "icons" ? /* @__PURE__ */ Y(ue, {
|
|
137
|
-
workspace:
|
|
137
|
+
workspace: i,
|
|
138
138
|
spaces: A,
|
|
139
139
|
areas: v,
|
|
140
140
|
unfiledCount: D,
|
|
141
141
|
unfiledRows: R,
|
|
142
142
|
areaMenu: F,
|
|
143
143
|
onCreate: T
|
|
144
|
-
},
|
|
145
|
-
let n = v.filter((
|
|
144
|
+
}, g?.id ?? "") : A.map((e) => {
|
|
145
|
+
let n = v.filter((t) => (t.teamId ?? "") === e.id);
|
|
146
146
|
return /* @__PURE__ */ Y($, {
|
|
147
|
-
title:
|
|
147
|
+
title: e.name,
|
|
148
148
|
count: n.length,
|
|
149
149
|
icon: /* @__PURE__ */ Y(_, {
|
|
150
|
-
icon:
|
|
151
|
-
color:
|
|
152
|
-
name:
|
|
150
|
+
icon: e.icon,
|
|
151
|
+
color: e.color,
|
|
152
|
+
name: e.name
|
|
153
153
|
}),
|
|
154
|
-
extra:
|
|
155
|
-
counts: C.teams[
|
|
156
|
-
teamId:
|
|
154
|
+
extra: e.team && /* @__PURE__ */ Y(S, {
|
|
155
|
+
counts: C.teams[e.team.id],
|
|
156
|
+
teamId: e.team.id,
|
|
157
157
|
className: "max-sm:hidden"
|
|
158
158
|
}),
|
|
159
|
-
action:
|
|
159
|
+
action: e.team && /* @__PURE__ */ Y(N, {
|
|
160
160
|
variant: "ghost",
|
|
161
161
|
size: "xs",
|
|
162
|
-
icon: /* @__PURE__ */ Y(
|
|
163
|
-
label:
|
|
162
|
+
icon: /* @__PURE__ */ Y(l, { className: "size-3.5" }),
|
|
163
|
+
label: t("newIn", { space: e.name }),
|
|
164
164
|
onClick: () => T({
|
|
165
165
|
kind: "create",
|
|
166
|
-
space:
|
|
166
|
+
space: e.key
|
|
167
167
|
})
|
|
168
168
|
}),
|
|
169
169
|
children: /* @__PURE__ */ Y(ae, {
|
|
170
|
-
workspace:
|
|
170
|
+
workspace: i,
|
|
171
171
|
areas: n,
|
|
172
172
|
counts: C.areas,
|
|
173
173
|
parent: void 0,
|
|
174
174
|
depth: 0,
|
|
175
175
|
areaMenu: F
|
|
176
176
|
})
|
|
177
|
-
},
|
|
177
|
+
}, e.key);
|
|
178
178
|
})] }),
|
|
179
179
|
I === "list" && D > 0 && /* @__PURE__ */ Y($, {
|
|
180
|
-
title:
|
|
180
|
+
title: t("unfiled"),
|
|
181
181
|
count: D,
|
|
182
|
-
icon: /* @__PURE__ */ Y(
|
|
182
|
+
icon: /* @__PURE__ */ Y(u, { className: "size-4 text-muted-foreground" }),
|
|
183
183
|
children: R
|
|
184
184
|
}),
|
|
185
|
-
/* @__PURE__ */ Y(me, { workspace:
|
|
185
|
+
/* @__PURE__ */ Y(me, { workspace: i })
|
|
186
186
|
]
|
|
187
187
|
}),
|
|
188
188
|
w && /* @__PURE__ */ Y(ge, {
|
|
189
|
-
workspace:
|
|
189
|
+
workspace: i,
|
|
190
190
|
editing: w,
|
|
191
191
|
spaces: A.filter((e) => e.team),
|
|
192
|
-
areas:
|
|
192
|
+
areas: f,
|
|
193
193
|
onClose: () => T(null)
|
|
194
194
|
})
|
|
195
195
|
]
|
|
@@ -250,28 +250,28 @@ function ce(e) {
|
|
|
250
250
|
} catch {}
|
|
251
251
|
}
|
|
252
252
|
var le = /* @__PURE__ */ new Map();
|
|
253
|
-
function ue({ workspace:
|
|
254
|
-
let d = q("areas"), { data: f = [] } = Z(
|
|
253
|
+
function ue({ workspace: e, spaces: n, areas: r, unfiledCount: i, unfiledRows: o, areaMenu: s, onCreate: c }) {
|
|
254
|
+
let d = q("areas"), { data: f = [] } = Z(a(e)), p = `${e}/${n.map((e) => e.id).join(",")}`, [m, h] = G(() => le.get(p) ?? null), g = (e) => {
|
|
255
255
|
le.set(p, e), h(e);
|
|
256
256
|
}, v = W(() => {
|
|
257
257
|
let e = /* @__PURE__ */ new Map();
|
|
258
258
|
for (let t of f) t.area && e.set(t.area.id, (e.get(t.area.id) ?? 0) + 1);
|
|
259
259
|
let t = (n) => (e.get(n) ?? 0) + r.filter((e) => e.parentId === n).reduce((e, n) => e + t(n.id), 0);
|
|
260
260
|
return t;
|
|
261
|
-
}, [f, r]), y = (e) => r.filter((t) => t.parentId === e), b = (
|
|
262
|
-
workspace:
|
|
263
|
-
area:
|
|
264
|
-
inside: y(
|
|
265
|
-
decisions: v(
|
|
266
|
-
menu: () => s(
|
|
261
|
+
}, [f, r]), y = (e) => r.filter((t) => t.parentId === e), b = (t, n) => t.map((t) => /* @__PURE__ */ Y(w, {
|
|
262
|
+
workspace: e,
|
|
263
|
+
area: t,
|
|
264
|
+
inside: y(t.id).length,
|
|
265
|
+
decisions: v(t.id),
|
|
266
|
+
menu: () => s(t, n),
|
|
267
267
|
onOpen: (e) => g({
|
|
268
268
|
kind: "area",
|
|
269
269
|
trail: [...m?.kind === "area" ? m.trail : [], e]
|
|
270
270
|
})
|
|
271
|
-
},
|
|
271
|
+
}, t.id)), x = i > 0 && /* @__PURE__ */ Y(E, {
|
|
272
272
|
name: d("unfiled"),
|
|
273
|
-
icon: /* @__PURE__ */ Y(
|
|
274
|
-
hint:
|
|
273
|
+
icon: /* @__PURE__ */ Y(u, { className: "size-7 opacity-60" }),
|
|
274
|
+
hint: i,
|
|
275
275
|
onOpen: () => g({ kind: "unfiled" })
|
|
276
276
|
});
|
|
277
277
|
if (!m) return n.map((e, t) => {
|
|
@@ -293,7 +293,7 @@ function ue({ workspace: t, spaces: n, areas: r, unfiledCount: a, unfiledRows: o
|
|
|
293
293
|
});
|
|
294
294
|
let S = m.kind === "area" ? m.trail.at(-1) : void 0, C = S && r.find((e) => e.id === S.id), D = C ? y(C.id) : [], k = [{
|
|
295
295
|
label: d("title"),
|
|
296
|
-
icon: /* @__PURE__ */ Y(
|
|
296
|
+
icon: /* @__PURE__ */ Y(u, { className: "size-4" })
|
|
297
297
|
}, ...m.kind === "area" ? m.trail.map((e) => ({ label: r.find((t) => t.id === e.id)?.title ?? e.title })) : [{ label: d("unfiled") }]];
|
|
298
298
|
return /* @__PURE__ */ X("section", {
|
|
299
299
|
"aria-label": k.at(-1)?.label,
|
|
@@ -307,10 +307,10 @@ function ue({ workspace: t, spaces: n, areas: r, unfiledCount: a, unfiledRows: o
|
|
|
307
307
|
trail: m.trail.slice(0, t)
|
|
308
308
|
}),
|
|
309
309
|
className: "min-w-0 flex-1"
|
|
310
|
-
}), C && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(
|
|
310
|
+
}), C && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(t, {
|
|
311
311
|
to: "/$workspace/areas/$area",
|
|
312
312
|
params: {
|
|
313
|
-
workspace:
|
|
313
|
+
workspace: e,
|
|
314
314
|
area: C.key
|
|
315
315
|
},
|
|
316
316
|
className: te({
|
|
@@ -321,9 +321,9 @@ function ue({ workspace: t, spaces: n, areas: r, unfiledCount: a, unfiledRows: o
|
|
|
321
321
|
}), /* @__PURE__ */ Y(N, {
|
|
322
322
|
variant: "ghost",
|
|
323
323
|
size: "xs",
|
|
324
|
-
icon: /* @__PURE__ */ Y(
|
|
324
|
+
icon: /* @__PURE__ */ Y(l, { className: "size-3.5" }),
|
|
325
325
|
label: d("addInside"),
|
|
326
|
-
onClick: () =>
|
|
326
|
+
onClick: () => c({
|
|
327
327
|
kind: "create",
|
|
328
328
|
parent: C
|
|
329
329
|
})
|
|
@@ -331,7 +331,7 @@ function ue({ workspace: t, spaces: n, areas: r, unfiledCount: a, unfiledRows: o
|
|
|
331
331
|
}), m.kind === "unfiled" ? /* @__PURE__ */ Y("ul", { children: o }) : D.length === 0 ? /* @__PURE__ */ Y("div", {
|
|
332
332
|
className: "p-6",
|
|
333
333
|
children: /* @__PURE__ */ Y(j, {
|
|
334
|
-
icon: /* @__PURE__ */ Y(
|
|
334
|
+
icon: /* @__PURE__ */ Y(u, {}),
|
|
335
335
|
title: d("emptyArea")
|
|
336
336
|
})
|
|
337
337
|
}) : /* @__PURE__ */ Y(T, {
|
|
@@ -377,27 +377,27 @@ function de(e, t, n) {
|
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
379
|
var fe = 20;
|
|
380
|
-
function pe({ workspace:
|
|
381
|
-
let c = q("areas"),
|
|
380
|
+
function pe({ workspace: e, area: n, counts: r, siblings: i, depth: a, review: o, areaMenu: s }) {
|
|
381
|
+
let c = q("areas"), l = q("common"), d = B(), p = C(e), m = K(), { nameOf: h, avatarOf: _ } = g(e), b = n.status === "proposed", x = () => s(n, i), w = p.accept.error ?? p.merge.error ?? p.archive.error, T = n.creator;
|
|
382
382
|
return /* @__PURE__ */ X("li", {
|
|
383
383
|
className: "group flex min-h-10 items-center gap-2 border-b border-border/60 pr-2 hover:bg-muted/60",
|
|
384
384
|
children: [
|
|
385
|
-
/* @__PURE__ */ X(
|
|
385
|
+
/* @__PURE__ */ X(t, {
|
|
386
386
|
to: "/$workspace/areas/$area",
|
|
387
387
|
params: {
|
|
388
|
-
workspace:
|
|
388
|
+
workspace: e,
|
|
389
389
|
area: n.key
|
|
390
390
|
},
|
|
391
|
-
onContextMenu: (e) =>
|
|
391
|
+
onContextMenu: (e) => d(e, x()),
|
|
392
392
|
style: { paddingLeft: `calc(var(--row-start) + ${a * fe}px)` },
|
|
393
393
|
className: "flex min-w-0 flex-1 items-center gap-2 self-stretch py-2 [--row-start:1rem] md:[--row-start:1.25rem]",
|
|
394
394
|
children: [
|
|
395
|
-
n.icon ? /* @__PURE__ */ Y(v, { icon: n.icon }) : /* @__PURE__ */ Y(
|
|
395
|
+
n.icon ? /* @__PURE__ */ Y(v, { icon: n.icon }) : /* @__PURE__ */ Y(u, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
396
396
|
/* @__PURE__ */ Y("span", {
|
|
397
397
|
className: "min-w-0 truncate text-sm font-medium",
|
|
398
398
|
children: n.title
|
|
399
399
|
}),
|
|
400
|
-
n.homeDocId && /* @__PURE__ */ Y(
|
|
400
|
+
n.homeDocId && /* @__PURE__ */ Y(f, {
|
|
401
401
|
className: "size-3.5 shrink-0 text-muted-foreground",
|
|
402
402
|
"aria-label": c("hasHomeDoc")
|
|
403
403
|
}),
|
|
@@ -426,17 +426,17 @@ function pe({ workspace: t, area: n, counts: r, siblings: i, depth: a, review: o
|
|
|
426
426
|
children: c("proposed")
|
|
427
427
|
}),
|
|
428
428
|
o && T && /* @__PURE__ */ Y(R, {
|
|
429
|
-
content: c("proposedBy", { name:
|
|
429
|
+
content: c("proposedBy", { name: h(T.kind, T.handle) }),
|
|
430
430
|
describesAnchor: !0,
|
|
431
431
|
children: /* @__PURE__ */ X("span", {
|
|
432
432
|
className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground max-sm:hidden",
|
|
433
433
|
children: [/* @__PURE__ */ Y(D, {
|
|
434
434
|
...y(T.kind),
|
|
435
|
-
name:
|
|
435
|
+
name: h(T.kind, T.handle),
|
|
436
436
|
src: _(T.kind, T.handle),
|
|
437
437
|
size: "xs",
|
|
438
438
|
decorative: !0
|
|
439
|
-
}),
|
|
439
|
+
}), h(T.kind, T.handle)]
|
|
440
440
|
})
|
|
441
441
|
}),
|
|
442
442
|
/* @__PURE__ */ Y("span", {
|
|
@@ -452,18 +452,18 @@ function pe({ workspace: t, area: n, counts: r, siblings: i, depth: a, review: o
|
|
|
452
452
|
}),
|
|
453
453
|
/* @__PURE__ */ Y(ne, {
|
|
454
454
|
items: x,
|
|
455
|
-
label:
|
|
455
|
+
label: l("moreActionsFor", { name: n.title })
|
|
456
456
|
})
|
|
457
457
|
]
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
function me({ workspace: e }) {
|
|
461
|
-
let
|
|
462
|
-
...
|
|
461
|
+
let t = q("areas"), r = C(e), [i, a] = G(!1), { data: o = [], isPending: s } = Z({
|
|
462
|
+
...n(e, !0),
|
|
463
463
|
enabled: i
|
|
464
464
|
});
|
|
465
465
|
return /* @__PURE__ */ X("section", {
|
|
466
|
-
"aria-label":
|
|
466
|
+
"aria-label": t("archived"),
|
|
467
467
|
children: [/* @__PURE__ */ Y("h2", {
|
|
468
468
|
className: "border-b border-border",
|
|
469
469
|
children: /* @__PURE__ */ X("button", {
|
|
@@ -472,8 +472,8 @@ function me({ workspace: e }) {
|
|
|
472
472
|
"aria-expanded": i,
|
|
473
473
|
className: "flex h-9 w-full items-center gap-2 px-4 text-xs font-medium text-muted-foreground hover:bg-muted/60 hover:text-foreground md:px-5",
|
|
474
474
|
children: [
|
|
475
|
-
/* @__PURE__ */ Y(
|
|
476
|
-
|
|
475
|
+
/* @__PURE__ */ Y(d, { className: re("size-3.5 transition-transform", i && "rotate-90") }),
|
|
476
|
+
t("archived"),
|
|
477
477
|
i && !s && /* @__PURE__ */ Y("span", {
|
|
478
478
|
className: "tabular-nums",
|
|
479
479
|
children: o.length
|
|
@@ -482,11 +482,11 @@ function me({ workspace: e }) {
|
|
|
482
482
|
})
|
|
483
483
|
}), i && !s && (o.length === 0 ? /* @__PURE__ */ Y("p", {
|
|
484
484
|
className: "border-b border-border/60 px-4 py-2.5 pl-10 text-xs text-muted-foreground md:pl-11",
|
|
485
|
-
children:
|
|
485
|
+
children: t("noArchived")
|
|
486
486
|
}) : /* @__PURE__ */ Y("ul", { children: o.map((e) => /* @__PURE__ */ X("li", {
|
|
487
487
|
className: "flex min-h-10 items-center gap-2 border-b border-border/60 py-1.5 pr-2 pl-4 text-muted-foreground md:pl-5",
|
|
488
488
|
children: [
|
|
489
|
-
/* @__PURE__ */ Y(
|
|
489
|
+
/* @__PURE__ */ Y(u, { className: "size-4 shrink-0" }),
|
|
490
490
|
/* @__PURE__ */ Y("span", {
|
|
491
491
|
className: "min-w-0 truncate text-sm",
|
|
492
492
|
children: e.title
|
|
@@ -500,7 +500,7 @@ function me({ workspace: e }) {
|
|
|
500
500
|
size: "xs",
|
|
501
501
|
loading: r.restore.isPending && r.restore.variables === e.key,
|
|
502
502
|
onClick: () => r.restore.mutate(e.key),
|
|
503
|
-
children:
|
|
503
|
+
children: t("restore")
|
|
504
504
|
}),
|
|
505
505
|
/* @__PURE__ */ Y("span", {
|
|
506
506
|
"aria-hidden": !0,
|
|
@@ -511,14 +511,14 @@ function me({ workspace: e }) {
|
|
|
511
511
|
});
|
|
512
512
|
}
|
|
513
513
|
var he = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
|
|
514
|
-
function ge({ workspace:
|
|
515
|
-
let s = q("areas"), c = q("common"), l = K(), u = C(
|
|
516
|
-
...
|
|
517
|
-
enabled: R || !!
|
|
518
|
-
}), B = N ? z.find((e) => e.key === N) : z.find((e) => e.id ===
|
|
514
|
+
function ge({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
515
|
+
let s = q("areas"), c = q("common"), l = K(), u = C(e), d = n.kind === "edit" ? n.area : void 0, p = n.kind === "create" ? n.parent : void 0, [m, g] = G(d?.title ?? ""), [_, v] = G(d?.key ?? ""), [y, b] = G(!!d), [x, S] = G((d?.aliases ?? []).join(", ")), w = n.kind === "create" && n.space || r.find((e) => e.id === (d?.teamId ?? p?.teamId ?? ""))?.key || r[0]?.key || "", [T, E] = G(w), D = r.find((e) => e.key === T)?.id ?? "", [O, j] = G(p?.key ?? a.find((e) => e.id === d?.parentId)?.key ?? ""), [N, ee] = G(""), [R, te] = G(!1), { data: z = [] } = Z({
|
|
516
|
+
...i(e),
|
|
517
|
+
enabled: R || !!d?.homeDocId
|
|
518
|
+
}), B = N ? z.find((e) => e.key === N) : z.find((e) => e.id === d?.homeDocId), V = !d || d.status === "proposed", H = u.create.isPending || u.update.isPending, U = u.create.error ?? u.update.error, J = W(() => a.filter((e) => (e.teamId ?? "") === D && e.id !== d?.id), [
|
|
519
519
|
a,
|
|
520
520
|
D,
|
|
521
|
-
|
|
521
|
+
d?.id
|
|
522
522
|
]), Q = x.split(",").map((e) => e.trim()).filter(Boolean);
|
|
523
523
|
return /* @__PURE__ */ Y(F, {
|
|
524
524
|
open: !0,
|
|
@@ -526,18 +526,18 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
|
|
|
526
526
|
className: "max-h-[85vh] w-full max-w-md overflow-y-auto p-5",
|
|
527
527
|
children: /* @__PURE__ */ X("form", {
|
|
528
528
|
onSubmit: (e) => {
|
|
529
|
-
e.preventDefault(),
|
|
530
|
-
area:
|
|
529
|
+
e.preventDefault(), d ? u.update.mutate({
|
|
530
|
+
area: d.key,
|
|
531
531
|
body: {
|
|
532
|
-
title:
|
|
532
|
+
title: m,
|
|
533
533
|
aliases: Q,
|
|
534
|
-
...V && _ !==
|
|
535
|
-
...O !== (a.find((e) => e.id ===
|
|
534
|
+
...V && _ !== d.key && { key: _ },
|
|
535
|
+
...O !== (a.find((e) => e.id === d.parentId)?.key ?? "") && { parent: O },
|
|
536
536
|
...N && { homeDoc: N }
|
|
537
537
|
}
|
|
538
538
|
}, { onSuccess: o }) : u.create.mutate({
|
|
539
539
|
key: _,
|
|
540
|
-
title:
|
|
540
|
+
title: m,
|
|
541
541
|
aliases: Q,
|
|
542
542
|
space: T,
|
|
543
543
|
...O && { parent: O },
|
|
@@ -547,12 +547,12 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
|
|
|
547
547
|
children: [
|
|
548
548
|
/* @__PURE__ */ Y(I, {
|
|
549
549
|
className: "text-sm font-semibold",
|
|
550
|
-
children: s(
|
|
550
|
+
children: s(d ? "editTitle" : "newTitle")
|
|
551
551
|
}),
|
|
552
552
|
/* @__PURE__ */ X("label", {
|
|
553
553
|
className: "mt-4 block text-xs font-medium text-muted-foreground",
|
|
554
554
|
children: [s("fieldTitle"), /* @__PURE__ */ Y(P, {
|
|
555
|
-
value:
|
|
555
|
+
value: m,
|
|
556
556
|
onChange: (e) => {
|
|
557
557
|
g(e.target.value), y || v(he(e.target.value));
|
|
558
558
|
},
|
|
@@ -594,13 +594,13 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
|
|
|
594
594
|
}),
|
|
595
595
|
/* @__PURE__ */ X("div", {
|
|
596
596
|
className: "mt-3 flex flex-wrap gap-3",
|
|
597
|
-
children: [!
|
|
597
|
+
children: [!d && !p && /* @__PURE__ */ X("div", {
|
|
598
598
|
className: "text-xs font-medium text-muted-foreground",
|
|
599
599
|
children: [s("fieldSpace"), /* @__PURE__ */ Y("div", {
|
|
600
600
|
className: "mt-1",
|
|
601
601
|
children: /* @__PURE__ */ Y(L, {
|
|
602
602
|
value: T,
|
|
603
|
-
items:
|
|
603
|
+
items: r.map((e) => ({
|
|
604
604
|
value: e.key,
|
|
605
605
|
label: e.name
|
|
606
606
|
})),
|
|
@@ -641,7 +641,7 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
|
|
|
641
641
|
items: z.map((e) => ({
|
|
642
642
|
value: e.key,
|
|
643
643
|
label: e.title,
|
|
644
|
-
icon: /* @__PURE__ */ Y(
|
|
644
|
+
icon: /* @__PURE__ */ Y(f, { className: "size-3.5" })
|
|
645
645
|
})),
|
|
646
646
|
value: B?.key ?? null,
|
|
647
647
|
onValueChange: (e) => e !== null && ee(e),
|
|
@@ -650,16 +650,16 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
|
|
|
650
650
|
trigger: /* @__PURE__ */ X(k, {
|
|
651
651
|
type: "button",
|
|
652
652
|
className: "max-w-full font-normal",
|
|
653
|
-
children: [/* @__PURE__ */ Y(
|
|
653
|
+
children: [/* @__PURE__ */ Y(f, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
|
|
654
654
|
className: "truncate",
|
|
655
655
|
children: B?.title ?? s("noDoc")
|
|
656
656
|
})]
|
|
657
657
|
})
|
|
658
|
-
}), B && /* @__PURE__ */ Y(
|
|
658
|
+
}), B && /* @__PURE__ */ Y(t, {
|
|
659
659
|
to: "/$workspace/docs/$doc",
|
|
660
660
|
params: {
|
|
661
|
-
workspace:
|
|
662
|
-
doc:
|
|
661
|
+
workspace: e,
|
|
662
|
+
doc: h(B)
|
|
663
663
|
},
|
|
664
664
|
className: "ml-2 text-xs font-normal text-primary hover:underline",
|
|
665
665
|
children: s("openDoc")
|
|
@@ -680,9 +680,9 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
|
|
|
680
680
|
}), /* @__PURE__ */ Y(k, {
|
|
681
681
|
type: "submit",
|
|
682
682
|
variant: "primary",
|
|
683
|
-
disabled: !
|
|
683
|
+
disabled: !m.trim() || !_,
|
|
684
684
|
loading: H,
|
|
685
|
-
children:
|
|
685
|
+
children: d ? c("save") : s("create")
|
|
686
686
|
})]
|
|
687
687
|
})
|
|
688
688
|
]
|