@parallelworks/tandem-web 0.164.0 → 0.165.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 +42 -12
- package/_virtual/_virtual_i18n/es/common.js +42 -12
- package/_virtual/_virtual_i18n/ja/common.js +42 -12
- package/_virtual/_virtual_i18n/ko/common.js +42 -12
- package/_virtual/_virtual_i18n/zh/common.js +42 -12
- package/api/mutations.js +6 -5
- package/components/AgentWork.js +358 -396
- package/components/AreaWork.js +37 -36
- package/components/Graph.js +1 -1
- package/components/HoverCards.js +3 -3
- package/components/ShortcutSheet.js +142 -0
- package/components/WorkCounts.js +1 -1
- package/lib/eachLimited.js +15 -0
- package/lib/issueMenu.js +148 -122
- package/lib/knowledge.js +97 -119
- package/lib/shortcutName.js +7 -0
- package/lib/shortcuts.js +14 -20
- package/package.json +1 -1
- package/pages/areas.js +115 -119
- package/pages/issues.js +309 -257
- package/pages/triage.js +2 -0
- package/routes/_workspace/graph.js +1 -1
- package/routes/_workspace/knowledge/_term2.js +9 -9
- package/routes/_workspace/knowledge/index2.js +15 -15
- package/routes/_workspace2.js +408 -401
- package/lib/decisionEntry.js +0 -23
package/pages/areas.js
CHANGED
|
@@ -10,22 +10,22 @@ import { actorAvatar as y } from "../lib/avatar.js";
|
|
|
10
10
|
import { AreaLink as b } from "../components/AreaLink.js";
|
|
11
11
|
import { useAreaActions as x } from "../lib/areas.js";
|
|
12
12
|
import { AreaTile as S, AreaTiles as C, PlaceTile as w } from "../components/AreaTiles.js";
|
|
13
|
-
import { AreaGroup as T, FoldedAnswer as E
|
|
14
|
-
import { WorkCounts as
|
|
15
|
-
import { Avatar as
|
|
16
|
-
import { useParams as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { useErrorMessage as
|
|
13
|
+
import { AreaGroup as T, FoldedAnswer as E } from "../components/AreaWork.js";
|
|
14
|
+
import { WorkCounts as D } from "../components/WorkCounts.js";
|
|
15
|
+
import { Avatar as O, Breadcrumbs as k, Button as A, Combobox as ee, EmptyState as j, ErrorText as M, IconButton as N, Input as P, Modal as F, ModalTitle as te, SegmentedControl as I, Select as L, Tooltip as R, buttonClasses as z, menuDivider as B, useOpenMenu as V } from "@parallelworks/ui";
|
|
16
|
+
import { useParams as H, useSearch as U } from "@tanstack/react-router";
|
|
17
|
+
import { Fragment as W, useMemo as G, useState as K } from "react";
|
|
18
|
+
import { useErrorMessage as q } from "@parallelworks/problem/react";
|
|
19
19
|
import { useTranslations as J } from "use-intl";
|
|
20
20
|
import { Fragment as Y, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
21
21
|
import { useQuery as Q, useSuspenseQuery as $ } from "@tanstack/react-query";
|
|
22
|
-
import { MoreButton as
|
|
22
|
+
import { MoreButton as ne } from "@parallelworks/ui/list";
|
|
23
23
|
// src/pages/areas.tsx
|
|
24
|
-
var
|
|
25
|
-
function
|
|
26
|
-
let t = J("areas"), { workspace: i, key: a } =
|
|
24
|
+
var re = (...e) => e.filter(Boolean).join(" ");
|
|
25
|
+
function ie() {
|
|
26
|
+
let t = J("areas"), { workspace: i, key: a } = H({ strict: !1 }), { team: l = a } = U({ strict: !1 }), { data: f } = $(n(i)), { data: p } = $(o(i)), g = p.find((e) => e.key === l);
|
|
27
27
|
e(t("title"), g?.name);
|
|
28
|
-
let v = g ? f.filter((e) => e.teamId === g.id) : f, { data: y } = $(c(i)), { data: b } = $(r(i)), [x, S] =
|
|
28
|
+
let v = g ? f.filter((e) => e.teamId === g.id) : f, { data: y } = $(c(i)), { data: b } = $(r(i)), [x, S] = K(null), { data: C } = Q(s(i, g?.key)), w = C?.notInDocs.length ?? 0, O = v.filter((e) => e.status === "proposed"), k = [...!g && f.some((e) => !e.teamId) ? [{
|
|
29
29
|
id: "",
|
|
30
30
|
key: "workspace",
|
|
31
31
|
name: y.name,
|
|
@@ -38,25 +38,21 @@ function ae() {
|
|
|
38
38
|
icon: e.icon,
|
|
39
39
|
color: e.color,
|
|
40
40
|
team: e
|
|
41
|
-
}))], ee = (e) =>
|
|
41
|
+
}))], ee = (e) => k.find((t) => t.id === (e.teamId ?? "")), M = () => S({
|
|
42
42
|
kind: "create",
|
|
43
43
|
...g && { space: g.key }
|
|
44
|
-
}),
|
|
44
|
+
}), P = de(i, (e) => S({
|
|
45
45
|
kind: "edit",
|
|
46
46
|
area: e
|
|
47
47
|
}), (e) => S({
|
|
48
48
|
kind: "create",
|
|
49
49
|
parent: e
|
|
50
|
-
})), [
|
|
51
|
-
workspace: i,
|
|
52
|
-
entry: e,
|
|
53
|
-
isNew: !1
|
|
54
|
-
}, e.id)), C.notInDocs.map((e) => /* @__PURE__ */ X(E, {
|
|
50
|
+
})), [F, te] = K(se), L = C && /* @__PURE__ */ X(Y, { children: C.notInDocs.map((e) => /* @__PURE__ */ X(E, {
|
|
55
51
|
workspace: i,
|
|
56
52
|
decision: e,
|
|
57
53
|
isNew: !1,
|
|
58
54
|
notInDocs: !0
|
|
59
|
-
}, e.id))
|
|
55
|
+
}, e.id)) });
|
|
60
56
|
return /* @__PURE__ */ Z("div", {
|
|
61
57
|
className: "flex h-full flex-col",
|
|
62
58
|
children: [
|
|
@@ -71,19 +67,19 @@ function ae() {
|
|
|
71
67
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
72
68
|
children: t("count", { count: v.length })
|
|
73
69
|
}),
|
|
74
|
-
/* @__PURE__ */ X(
|
|
70
|
+
/* @__PURE__ */ X(D, {
|
|
75
71
|
counts: g ? b.teams[g.id] : b.workspace,
|
|
76
72
|
teamId: g?.id,
|
|
77
73
|
className: "max-sm:hidden"
|
|
78
74
|
}),
|
|
79
75
|
/* @__PURE__ */ X("div", {
|
|
80
76
|
className: "ml-auto",
|
|
81
|
-
children: /* @__PURE__ */ X(
|
|
77
|
+
children: /* @__PURE__ */ X(I, {
|
|
82
78
|
label: t("view"),
|
|
83
79
|
size: "sm",
|
|
84
|
-
value:
|
|
80
|
+
value: F,
|
|
85
81
|
onValueChange: (e) => {
|
|
86
|
-
|
|
82
|
+
te(e), ce(e);
|
|
87
83
|
},
|
|
88
84
|
options: [{
|
|
89
85
|
value: "icons",
|
|
@@ -96,11 +92,11 @@ function ae() {
|
|
|
96
92
|
}]
|
|
97
93
|
})
|
|
98
94
|
}),
|
|
99
|
-
/* @__PURE__ */ X(
|
|
95
|
+
/* @__PURE__ */ X(A, {
|
|
100
96
|
variant: "primary",
|
|
101
97
|
size: "sm",
|
|
102
98
|
icon: /* @__PURE__ */ X(u, { className: "size-3.5" }),
|
|
103
|
-
onClick:
|
|
99
|
+
onClick: M,
|
|
104
100
|
children: t("new")
|
|
105
101
|
})
|
|
106
102
|
]
|
|
@@ -110,39 +106,39 @@ function ae() {
|
|
|
110
106
|
children: [
|
|
111
107
|
v.length === 0 ? /* @__PURE__ */ X("div", {
|
|
112
108
|
className: "p-6",
|
|
113
|
-
children: /* @__PURE__ */ X(
|
|
109
|
+
children: /* @__PURE__ */ X(j, {
|
|
114
110
|
icon: /* @__PURE__ */ X(d, {}),
|
|
115
111
|
title: t("none"),
|
|
116
112
|
description: t("description"),
|
|
117
|
-
action: /* @__PURE__ */ X(
|
|
113
|
+
action: /* @__PURE__ */ X(A, {
|
|
118
114
|
variant: "primary",
|
|
119
115
|
size: "sm",
|
|
120
|
-
onClick:
|
|
116
|
+
onClick: M,
|
|
121
117
|
children: t("new")
|
|
122
118
|
})
|
|
123
119
|
})
|
|
124
|
-
}) : /* @__PURE__ */ Z(Y, { children: [
|
|
120
|
+
}) : /* @__PURE__ */ Z(Y, { children: [O.length > 0 && /* @__PURE__ */ X(T, {
|
|
125
121
|
title: t("toReview"),
|
|
126
|
-
count:
|
|
122
|
+
count: O.length,
|
|
127
123
|
icon: /* @__PURE__ */ X(d, { className: "size-4 text-warning" }),
|
|
128
|
-
children:
|
|
124
|
+
children: O.map((e) => /* @__PURE__ */ X(pe, {
|
|
129
125
|
workspace: i,
|
|
130
126
|
area: e,
|
|
131
127
|
counts: b.areas[e.id],
|
|
132
128
|
siblings: v.filter((t) => (t.teamId ?? "") === (e.teamId ?? "")),
|
|
133
129
|
depth: 0,
|
|
134
130
|
review: ee(e)?.name,
|
|
135
|
-
areaMenu:
|
|
131
|
+
areaMenu: P
|
|
136
132
|
}, e.id))
|
|
137
|
-
}),
|
|
133
|
+
}), F === "icons" ? /* @__PURE__ */ X(ue, {
|
|
138
134
|
workspace: i,
|
|
139
|
-
spaces:
|
|
135
|
+
spaces: k,
|
|
140
136
|
areas: v,
|
|
141
137
|
unfiledCount: w,
|
|
142
|
-
unfiledRows:
|
|
143
|
-
areaMenu:
|
|
138
|
+
unfiledRows: L,
|
|
139
|
+
areaMenu: P,
|
|
144
140
|
onCreate: S
|
|
145
|
-
}, g?.id ?? "") :
|
|
141
|
+
}, g?.id ?? "") : k.map((e) => {
|
|
146
142
|
let n = v.filter((t) => (t.teamId ?? "") === e.id);
|
|
147
143
|
return /* @__PURE__ */ X(T, {
|
|
148
144
|
title: e.name,
|
|
@@ -152,12 +148,12 @@ function ae() {
|
|
|
152
148
|
color: e.color,
|
|
153
149
|
name: e.name
|
|
154
150
|
}),
|
|
155
|
-
extra: e.team && /* @__PURE__ */ X(
|
|
151
|
+
extra: e.team && /* @__PURE__ */ X(D, {
|
|
156
152
|
counts: b.teams[e.team.id],
|
|
157
153
|
teamId: e.team.id,
|
|
158
154
|
className: "max-sm:hidden"
|
|
159
155
|
}),
|
|
160
|
-
action: e.team && /* @__PURE__ */ X(
|
|
156
|
+
action: e.team && /* @__PURE__ */ X(N, {
|
|
161
157
|
variant: "ghost",
|
|
162
158
|
size: "xs",
|
|
163
159
|
icon: /* @__PURE__ */ X(u, { className: "size-3.5" }),
|
|
@@ -167,44 +163,44 @@ function ae() {
|
|
|
167
163
|
space: e.key
|
|
168
164
|
})
|
|
169
165
|
}),
|
|
170
|
-
children: /* @__PURE__ */ X(
|
|
166
|
+
children: /* @__PURE__ */ X(ae, {
|
|
171
167
|
workspace: i,
|
|
172
168
|
areas: n,
|
|
173
169
|
counts: b.areas,
|
|
174
170
|
parent: void 0,
|
|
175
171
|
depth: 0,
|
|
176
|
-
areaMenu:
|
|
172
|
+
areaMenu: P
|
|
177
173
|
})
|
|
178
174
|
}, e.key);
|
|
179
175
|
})] }),
|
|
180
|
-
|
|
176
|
+
F === "list" && w > 0 && /* @__PURE__ */ X(T, {
|
|
181
177
|
title: t("unfiled"),
|
|
182
178
|
count: w,
|
|
183
179
|
icon: /* @__PURE__ */ X(d, { className: "size-4 text-muted-foreground" }),
|
|
184
|
-
children:
|
|
180
|
+
children: L
|
|
185
181
|
}),
|
|
186
|
-
/* @__PURE__ */ X(
|
|
182
|
+
/* @__PURE__ */ X(me, { workspace: i })
|
|
187
183
|
]
|
|
188
184
|
}),
|
|
189
|
-
x && /* @__PURE__ */ X(
|
|
185
|
+
x && /* @__PURE__ */ X(ge, {
|
|
190
186
|
workspace: i,
|
|
191
187
|
editing: x,
|
|
192
|
-
spaces:
|
|
188
|
+
spaces: k.filter((e) => e.team),
|
|
193
189
|
areas: f,
|
|
194
190
|
onClose: () => S(null)
|
|
195
191
|
})
|
|
196
192
|
]
|
|
197
193
|
});
|
|
198
194
|
}
|
|
199
|
-
function
|
|
200
|
-
return t.filter((e) => e.parentId === r).map((r) => /* @__PURE__ */ Z(
|
|
195
|
+
function ae({ workspace: e, areas: t, counts: n, parent: r, depth: i, areaMenu: a }) {
|
|
196
|
+
return t.filter((e) => e.parentId === r).map((r) => /* @__PURE__ */ Z(W, { children: [/* @__PURE__ */ X(pe, {
|
|
201
197
|
workspace: e,
|
|
202
198
|
area: r,
|
|
203
199
|
counts: n[r.id],
|
|
204
200
|
siblings: t,
|
|
205
201
|
depth: i,
|
|
206
202
|
areaMenu: a
|
|
207
|
-
}), /* @__PURE__ */ X(
|
|
203
|
+
}), /* @__PURE__ */ X(ae, {
|
|
208
204
|
workspace: e,
|
|
209
205
|
areas: t,
|
|
210
206
|
counts: n,
|
|
@@ -213,24 +209,24 @@ function oe({ workspace: e, areas: t, counts: n, parent: r, depth: i, areaMenu:
|
|
|
213
209
|
areaMenu: a
|
|
214
210
|
})] }, r.id));
|
|
215
211
|
}
|
|
216
|
-
var
|
|
217
|
-
function
|
|
212
|
+
var oe = "tandem.areas.view";
|
|
213
|
+
function se() {
|
|
218
214
|
try {
|
|
219
|
-
return globalThis.localStorage?.getItem(
|
|
215
|
+
return globalThis.localStorage?.getItem(oe) === "list" ? "list" : "icons";
|
|
220
216
|
} catch {
|
|
221
217
|
return "icons";
|
|
222
218
|
}
|
|
223
219
|
}
|
|
224
|
-
function
|
|
220
|
+
function ce(e) {
|
|
225
221
|
try {
|
|
226
|
-
globalThis.localStorage?.setItem(
|
|
222
|
+
globalThis.localStorage?.setItem(oe, e);
|
|
227
223
|
} catch {}
|
|
228
224
|
}
|
|
229
|
-
var
|
|
230
|
-
function
|
|
231
|
-
let c = J("areas"), { data: l = [] } = Q(a(e)), f = `${e}/${t.map((e) => e.id).join(",")}`, [p, m] =
|
|
232
|
-
|
|
233
|
-
}, g =
|
|
225
|
+
var le = /* @__PURE__ */ new Map();
|
|
226
|
+
function ue({ workspace: e, spaces: t, areas: n, unfiledCount: r, unfiledRows: i, areaMenu: o, onCreate: s }) {
|
|
227
|
+
let c = J("areas"), { data: l = [] } = Q(a(e)), f = `${e}/${t.map((e) => e.id).join(",")}`, [p, m] = K(() => le.get(f) ?? null), h = (e) => {
|
|
228
|
+
le.set(f, e), m(e);
|
|
229
|
+
}, g = G(() => {
|
|
234
230
|
let e = /* @__PURE__ */ new Map();
|
|
235
231
|
for (let t of l) t.area && e.set(t.area.id, (e.get(t.area.id) ?? 0) + 1);
|
|
236
232
|
let t = (r) => (e.get(r) ?? 0) + n.filter((e) => e.parentId === r).reduce((e, n) => e + t(n.id), 0);
|
|
@@ -268,16 +264,16 @@ function de({ workspace: e, spaces: t, areas: n, unfiledCount: r, unfiledRows: i
|
|
|
268
264
|
})
|
|
269
265
|
}, e.key);
|
|
270
266
|
});
|
|
271
|
-
let E = p.kind === "area" ? p.trail.at(-1) : void 0, D = E && n.find((e) => e.id === E.id), O = D ? v(D.id) : [],
|
|
267
|
+
let E = p.kind === "area" ? p.trail.at(-1) : void 0, D = E && n.find((e) => e.id === E.id), O = D ? v(D.id) : [], A = [{
|
|
272
268
|
label: c("title"),
|
|
273
269
|
icon: /* @__PURE__ */ X(d, { className: "size-4" })
|
|
274
270
|
}, ...p.kind === "area" ? p.trail.map((e) => ({ label: n.find((t) => t.id === e.id)?.title ?? e.title })) : [{ label: c("unfiled") }]];
|
|
275
271
|
return /* @__PURE__ */ Z("section", {
|
|
276
|
-
"aria-label":
|
|
272
|
+
"aria-label": A.at(-1)?.label,
|
|
277
273
|
children: [/* @__PURE__ */ Z("div", {
|
|
278
274
|
className: "sticky top-0 z-10 flex h-10 items-center gap-2 border-b border-border bg-background px-4 md:px-5",
|
|
279
|
-
children: [/* @__PURE__ */ X(
|
|
280
|
-
crumbs:
|
|
275
|
+
children: [/* @__PURE__ */ X(k, {
|
|
276
|
+
crumbs: A,
|
|
281
277
|
current: "location",
|
|
282
278
|
onSelect: (e, t) => h(t === 0 || p.kind !== "area" ? null : {
|
|
283
279
|
...p,
|
|
@@ -287,12 +283,12 @@ function de({ workspace: e, spaces: t, areas: n, unfiledCount: r, unfiledRows: i
|
|
|
287
283
|
}), D && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(b, {
|
|
288
284
|
workspace: e,
|
|
289
285
|
area: D,
|
|
290
|
-
className:
|
|
286
|
+
className: z({
|
|
291
287
|
variant: "ghost",
|
|
292
288
|
size: "xs"
|
|
293
289
|
}),
|
|
294
290
|
children: c("openArea")
|
|
295
|
-
}), /* @__PURE__ */ X(
|
|
291
|
+
}), /* @__PURE__ */ X(N, {
|
|
296
292
|
variant: "ghost",
|
|
297
293
|
size: "xs",
|
|
298
294
|
icon: /* @__PURE__ */ X(u, { className: "size-3.5" }),
|
|
@@ -304,17 +300,17 @@ function de({ workspace: e, spaces: t, areas: n, unfiledCount: r, unfiledRows: i
|
|
|
304
300
|
})] })]
|
|
305
301
|
}), p.kind === "unfiled" ? /* @__PURE__ */ X("ul", { children: i }) : O.length === 0 ? /* @__PURE__ */ X("div", {
|
|
306
302
|
className: "p-6",
|
|
307
|
-
children: /* @__PURE__ */ X(
|
|
303
|
+
children: /* @__PURE__ */ X(j, {
|
|
308
304
|
icon: /* @__PURE__ */ X(d, {}),
|
|
309
305
|
title: c("emptyArea")
|
|
310
306
|
})
|
|
311
307
|
}) : /* @__PURE__ */ X(C, {
|
|
312
|
-
label:
|
|
308
|
+
label: A.at(-1)?.label ?? "",
|
|
313
309
|
children: y(O, O)
|
|
314
310
|
})]
|
|
315
311
|
});
|
|
316
312
|
}
|
|
317
|
-
function
|
|
313
|
+
function de(e, t, n) {
|
|
318
314
|
let r = J("areas"), i = x(e);
|
|
319
315
|
return (e, a) => {
|
|
320
316
|
let o = a.filter((t) => t.id !== e.id);
|
|
@@ -341,7 +337,7 @@ function fe(e, t, n) {
|
|
|
341
337
|
})
|
|
342
338
|
}))
|
|
343
339
|
}] : [],
|
|
344
|
-
|
|
340
|
+
B,
|
|
345
341
|
{
|
|
346
342
|
label: r("archive"),
|
|
347
343
|
destructive: !0,
|
|
@@ -350,9 +346,9 @@ function fe(e, t, n) {
|
|
|
350
346
|
];
|
|
351
347
|
};
|
|
352
348
|
}
|
|
353
|
-
var
|
|
354
|
-
function
|
|
355
|
-
let s = J("areas"), c = J("common"), l =
|
|
349
|
+
var fe = 20;
|
|
350
|
+
function pe({ workspace: e, area: t, counts: n, siblings: r, depth: i, review: a, areaMenu: o }) {
|
|
351
|
+
let s = J("areas"), c = J("common"), l = V(), u = x(e), f = q(), { nameOf: m, avatarOf: h } = g(e), _ = t.status === "proposed", S = () => o(t, r), C = u.accept.error ?? u.merge.error ?? u.archive.error, w = t.creator;
|
|
356
352
|
return /* @__PURE__ */ Z("li", {
|
|
357
353
|
className: "group flex min-h-10 items-center gap-2 border-b border-border/60 pr-2 hover:bg-muted/60",
|
|
358
354
|
children: [
|
|
@@ -360,7 +356,7 @@ function me({ workspace: e, area: t, counts: n, siblings: r, depth: i, review: a
|
|
|
360
356
|
workspace: e,
|
|
361
357
|
area: t,
|
|
362
358
|
onContextMenu: (e) => l(e, S()),
|
|
363
|
-
style: { paddingLeft: `calc(var(--row-start) + ${i *
|
|
359
|
+
style: { paddingLeft: `calc(var(--row-start) + ${i * fe}px)` },
|
|
364
360
|
className: "flex min-w-0 flex-1 items-center gap-2 self-stretch py-2 [--row-start:1rem] md:[--row-start:1.25rem]",
|
|
365
361
|
children: [
|
|
366
362
|
t.icon ? /* @__PURE__ */ X(v, { icon: t.icon }) : /* @__PURE__ */ X(d, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
@@ -382,12 +378,12 @@ function me({ workspace: e, area: t, counts: n, siblings: r, depth: i, review: a
|
|
|
382
378
|
})
|
|
383
379
|
]
|
|
384
380
|
}),
|
|
385
|
-
C && /* @__PURE__ */ X(
|
|
381
|
+
C && /* @__PURE__ */ X(M, {
|
|
386
382
|
inline: !0,
|
|
387
383
|
className: "shrink-0 text-xs",
|
|
388
384
|
children: f(C)
|
|
389
385
|
}),
|
|
390
|
-
/* @__PURE__ */ X(
|
|
386
|
+
/* @__PURE__ */ X(D, {
|
|
391
387
|
counts: n,
|
|
392
388
|
teamId: t.teamId,
|
|
393
389
|
className: "max-sm:hidden"
|
|
@@ -396,12 +392,12 @@ function me({ workspace: e, area: t, counts: n, siblings: r, depth: i, review: a
|
|
|
396
392
|
className: "shrink-0 rounded border border-warning/60 px-1.5 py-0.5 text-[11px] leading-none text-warning",
|
|
397
393
|
children: s("proposed")
|
|
398
394
|
}),
|
|
399
|
-
a && w && /* @__PURE__ */ X(
|
|
395
|
+
a && w && /* @__PURE__ */ X(R, {
|
|
400
396
|
content: s("proposedBy", { name: m(w.kind, w.handle) }),
|
|
401
397
|
describesAnchor: !0,
|
|
402
398
|
children: /* @__PURE__ */ Z("span", {
|
|
403
399
|
className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground max-sm:hidden",
|
|
404
|
-
children: [/* @__PURE__ */ X(
|
|
400
|
+
children: [/* @__PURE__ */ X(O, {
|
|
405
401
|
...y(w.kind),
|
|
406
402
|
name: m(w.kind, w.handle),
|
|
407
403
|
src: h(w.kind, w.handle),
|
|
@@ -414,22 +410,22 @@ function me({ workspace: e, area: t, counts: n, siblings: r, depth: i, review: a
|
|
|
414
410
|
className: "w-28 shrink-0 truncate text-right font-mono text-xs text-muted-foreground max-md:hidden",
|
|
415
411
|
children: t.key
|
|
416
412
|
}),
|
|
417
|
-
a && /* @__PURE__ */ X(
|
|
413
|
+
a && /* @__PURE__ */ X(A, {
|
|
418
414
|
variant: "outline",
|
|
419
415
|
size: "xs",
|
|
420
416
|
loading: u.accept.isPending,
|
|
421
417
|
onClick: () => u.accept.mutate(t.key),
|
|
422
418
|
children: s("accept")
|
|
423
419
|
}),
|
|
424
|
-
/* @__PURE__ */ X(
|
|
420
|
+
/* @__PURE__ */ X(ne, {
|
|
425
421
|
items: S,
|
|
426
422
|
label: c("moreActionsFor", { name: t.title })
|
|
427
423
|
})
|
|
428
424
|
]
|
|
429
425
|
});
|
|
430
426
|
}
|
|
431
|
-
function
|
|
432
|
-
let t = J("areas"), r = x(e), [i, a] =
|
|
427
|
+
function me({ workspace: e }) {
|
|
428
|
+
let t = J("areas"), r = x(e), [i, a] = K(!1), { data: o = [], isPending: s } = Q({
|
|
433
429
|
...n(e, !0),
|
|
434
430
|
enabled: i
|
|
435
431
|
});
|
|
@@ -443,7 +439,7 @@ function he({ workspace: e }) {
|
|
|
443
439
|
"aria-expanded": i,
|
|
444
440
|
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",
|
|
445
441
|
children: [
|
|
446
|
-
/* @__PURE__ */ X(f, { className:
|
|
442
|
+
/* @__PURE__ */ X(f, { className: re("size-3.5 transition-transform", i && "rotate-90") }),
|
|
447
443
|
t("archived"),
|
|
448
444
|
i && !s && /* @__PURE__ */ X("span", {
|
|
449
445
|
className: "tabular-nums",
|
|
@@ -466,7 +462,7 @@ function he({ workspace: e }) {
|
|
|
466
462
|
className: "ml-auto w-28 shrink-0 truncate text-right font-mono text-xs max-md:hidden",
|
|
467
463
|
children: e.key
|
|
468
464
|
}),
|
|
469
|
-
/* @__PURE__ */ X(
|
|
465
|
+
/* @__PURE__ */ X(A, {
|
|
470
466
|
variant: "outline",
|
|
471
467
|
size: "xs",
|
|
472
468
|
loading: r.restore.isPending && r.restore.variables === e.key,
|
|
@@ -481,17 +477,17 @@ function he({ workspace: e }) {
|
|
|
481
477
|
}, e.id)) }))]
|
|
482
478
|
});
|
|
483
479
|
}
|
|
484
|
-
var
|
|
485
|
-
function
|
|
486
|
-
let s = J("areas"), c = J("common"), u =
|
|
480
|
+
var he = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
|
|
481
|
+
function ge({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
482
|
+
let s = J("areas"), c = J("common"), u = q(), d = x(e), f = n.kind === "edit" ? n.area : void 0, m = n.kind === "create" ? n.parent : void 0, [h, g] = K(f?.title ?? ""), [_, v] = K(f?.key ?? ""), [y, b] = K(!!f), [S, C] = K((f?.aliases ?? []).join(", ")), w = n.kind === "create" && n.space || r.find((e) => e.id === (f?.teamId ?? m?.teamId ?? ""))?.key || r[0]?.key || "", [T, E] = K(w), D = r.find((e) => e.key === T)?.id ?? "", [O, k] = K(m?.key ?? a.find((e) => e.id === f?.parentId)?.key ?? ""), [j, N] = K(""), [I, R] = K(!1), { data: z = [] } = Q({
|
|
487
483
|
...i(e),
|
|
488
|
-
enabled:
|
|
489
|
-
}),
|
|
484
|
+
enabled: I || !!f?.homeDocId
|
|
485
|
+
}), B = j ? z.find((e) => e.key === j) : z.find((e) => e.id === f?.homeDocId), V = !f || f.status === "proposed", H = d.create.isPending || d.update.isPending, U = d.create.error ?? d.update.error, W = G(() => a.filter((e) => (e.teamId ?? "") === D && e.id !== f?.id), [
|
|
490
486
|
a,
|
|
491
487
|
D,
|
|
492
488
|
f?.id
|
|
493
|
-
]),
|
|
494
|
-
return /* @__PURE__ */ X(
|
|
489
|
+
]), Y = S.split(",").map((e) => e.trim()).filter(Boolean);
|
|
490
|
+
return /* @__PURE__ */ X(F, {
|
|
495
491
|
open: !0,
|
|
496
492
|
onClose: o,
|
|
497
493
|
className: "max-h-[85vh] w-full max-w-md overflow-y-auto p-5",
|
|
@@ -501,31 +497,31 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
501
497
|
area: f.key,
|
|
502
498
|
body: {
|
|
503
499
|
title: h,
|
|
504
|
-
aliases:
|
|
505
|
-
...
|
|
500
|
+
aliases: Y,
|
|
501
|
+
...V && _ !== f.key && { key: _ },
|
|
506
502
|
...O !== (a.find((e) => e.id === f.parentId)?.key ?? "") && { parent: O },
|
|
507
|
-
...
|
|
503
|
+
...j && { homeDoc: j }
|
|
508
504
|
}
|
|
509
505
|
}, { onSuccess: o }) : d.create.mutate({
|
|
510
506
|
key: _,
|
|
511
507
|
title: h,
|
|
512
|
-
aliases:
|
|
508
|
+
aliases: Y,
|
|
513
509
|
space: T,
|
|
514
510
|
...O && { parent: O },
|
|
515
|
-
...
|
|
511
|
+
...j && { homeDoc: j }
|
|
516
512
|
}, { onSuccess: o });
|
|
517
513
|
},
|
|
518
514
|
children: [
|
|
519
|
-
/* @__PURE__ */ X(
|
|
515
|
+
/* @__PURE__ */ X(te, {
|
|
520
516
|
className: "text-sm font-semibold",
|
|
521
517
|
children: s(f ? "editTitle" : "newTitle")
|
|
522
518
|
}),
|
|
523
519
|
/* @__PURE__ */ Z("label", {
|
|
524
520
|
className: "mt-4 block text-xs font-medium text-muted-foreground",
|
|
525
|
-
children: [s("fieldTitle"), /* @__PURE__ */ X(
|
|
521
|
+
children: [s("fieldTitle"), /* @__PURE__ */ X(P, {
|
|
526
522
|
value: h,
|
|
527
523
|
onChange: (e) => {
|
|
528
|
-
g(e.target.value), y || v(
|
|
524
|
+
g(e.target.value), y || v(he(e.target.value));
|
|
529
525
|
},
|
|
530
526
|
required: !0,
|
|
531
527
|
maxLength: 100,
|
|
@@ -537,12 +533,12 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
537
533
|
className: "mt-3 block text-xs font-medium text-muted-foreground",
|
|
538
534
|
children: [
|
|
539
535
|
s("fieldKey"),
|
|
540
|
-
/* @__PURE__ */ X(
|
|
536
|
+
/* @__PURE__ */ X(P, {
|
|
541
537
|
value: _,
|
|
542
538
|
onChange: (e) => {
|
|
543
539
|
b(!0), v(e.target.value.toLowerCase());
|
|
544
540
|
},
|
|
545
|
-
disabled: !
|
|
541
|
+
disabled: !V,
|
|
546
542
|
required: !0,
|
|
547
543
|
pattern: "[a-z0-9][a-z0-9-]{0,62}",
|
|
548
544
|
mono: !0,
|
|
@@ -550,13 +546,13 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
550
546
|
}),
|
|
551
547
|
/* @__PURE__ */ X("span", {
|
|
552
548
|
className: "mt-1 block font-normal",
|
|
553
|
-
children: s(
|
|
549
|
+
children: s(V ? "keyHint" : "keyFixed")
|
|
554
550
|
})
|
|
555
551
|
]
|
|
556
552
|
}),
|
|
557
553
|
/* @__PURE__ */ Z("label", {
|
|
558
554
|
className: "mt-3 block text-xs font-medium text-muted-foreground",
|
|
559
|
-
children: [s("fieldAliases"), /* @__PURE__ */ X(
|
|
555
|
+
children: [s("fieldAliases"), /* @__PURE__ */ X(P, {
|
|
560
556
|
value: S,
|
|
561
557
|
onChange: (e) => C(e.target.value),
|
|
562
558
|
placeholder: s("aliasesPlaceholder"),
|
|
@@ -569,7 +565,7 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
569
565
|
className: "text-xs font-medium text-muted-foreground",
|
|
570
566
|
children: [s("fieldSpace"), /* @__PURE__ */ X("div", {
|
|
571
567
|
className: "mt-1",
|
|
572
|
-
children: /* @__PURE__ */ X(
|
|
568
|
+
children: /* @__PURE__ */ X(L, {
|
|
573
569
|
value: T,
|
|
574
570
|
items: r.map((e) => ({
|
|
575
571
|
value: e.key,
|
|
@@ -586,12 +582,12 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
586
582
|
className: "text-xs font-medium text-muted-foreground",
|
|
587
583
|
children: [s("fieldParent"), /* @__PURE__ */ X("div", {
|
|
588
584
|
className: "mt-1",
|
|
589
|
-
children: /* @__PURE__ */ X(
|
|
585
|
+
children: /* @__PURE__ */ X(L, {
|
|
590
586
|
value: O,
|
|
591
587
|
items: [{
|
|
592
588
|
value: "",
|
|
593
589
|
label: s("top")
|
|
594
|
-
}, ...
|
|
590
|
+
}, ...W.map((e) => ({
|
|
595
591
|
value: e.key,
|
|
596
592
|
label: e.title
|
|
597
593
|
}))],
|
|
@@ -607,52 +603,52 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
607
603
|
children: [s("fieldHomeDoc"), /* @__PURE__ */ Z("div", {
|
|
608
604
|
className: "mt-1",
|
|
609
605
|
children: [/* @__PURE__ */ X(ee, {
|
|
610
|
-
open:
|
|
606
|
+
open: I,
|
|
611
607
|
onOpenChange: R,
|
|
612
|
-
items:
|
|
608
|
+
items: z.map((e) => ({
|
|
613
609
|
value: e.key,
|
|
614
610
|
label: e.title,
|
|
615
611
|
icon: /* @__PURE__ */ X(p, { className: "size-3.5" })
|
|
616
612
|
})),
|
|
617
|
-
value:
|
|
618
|
-
onValueChange: (e) => e !== null &&
|
|
613
|
+
value: B?.key ?? null,
|
|
614
|
+
onValueChange: (e) => e !== null && N(e),
|
|
619
615
|
placeholder: s("chooseDoc"),
|
|
620
616
|
"aria-label": s("fieldHomeDoc"),
|
|
621
|
-
trigger: /* @__PURE__ */ Z(
|
|
617
|
+
trigger: /* @__PURE__ */ Z(A, {
|
|
622
618
|
type: "button",
|
|
623
619
|
className: "max-w-full font-normal",
|
|
624
620
|
children: [/* @__PURE__ */ X(p, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ X("span", {
|
|
625
621
|
className: "truncate",
|
|
626
|
-
children:
|
|
622
|
+
children: B?.title ?? s("noDoc")
|
|
627
623
|
})]
|
|
628
624
|
})
|
|
629
|
-
}),
|
|
625
|
+
}), B && /* @__PURE__ */ X(t, {
|
|
630
626
|
to: "/$workspace/docs/$doc",
|
|
631
627
|
params: {
|
|
632
628
|
workspace: e,
|
|
633
|
-
doc: l(
|
|
629
|
+
doc: l(B)
|
|
634
630
|
},
|
|
635
631
|
className: "ml-2 text-xs font-normal text-primary hover:underline",
|
|
636
632
|
children: s("openDoc")
|
|
637
633
|
})]
|
|
638
634
|
})]
|
|
639
635
|
}),
|
|
640
|
-
|
|
636
|
+
U && /* @__PURE__ */ X(M, {
|
|
641
637
|
size: "md",
|
|
642
638
|
className: "mt-3",
|
|
643
|
-
children: u(
|
|
639
|
+
children: u(U)
|
|
644
640
|
}),
|
|
645
641
|
/* @__PURE__ */ Z("div", {
|
|
646
642
|
className: "mt-5 flex justify-end gap-2",
|
|
647
|
-
children: [/* @__PURE__ */ X(
|
|
643
|
+
children: [/* @__PURE__ */ X(A, {
|
|
648
644
|
type: "button",
|
|
649
645
|
onClick: o,
|
|
650
646
|
children: c("cancel")
|
|
651
|
-
}), /* @__PURE__ */ X(
|
|
647
|
+
}), /* @__PURE__ */ X(A, {
|
|
652
648
|
type: "submit",
|
|
653
649
|
variant: "primary",
|
|
654
650
|
disabled: !h.trim() || !_,
|
|
655
|
-
loading:
|
|
651
|
+
loading: H,
|
|
656
652
|
children: f ? c("save") : s("create")
|
|
657
653
|
})]
|
|
658
654
|
})
|
|
@@ -660,4 +656,4 @@ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
|
|
|
660
656
|
})
|
|
661
657
|
});
|
|
662
658
|
}
|
|
663
|
-
export {
|
|
659
|
+
export { ie as AreasPage };
|