@parallelworks/tandem-web 0.138.2 → 0.139.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.
Files changed (71) hide show
  1. package/components/AgentWork.js +35 -35
  2. package/components/AppRoot.js +4 -4
  3. package/components/AreaWork.js +1 -1
  4. package/components/BlockHandle.js +3 -3
  5. package/components/CommandPalette.js +27 -27
  6. package/components/DateChip.js +27 -27
  7. package/components/DocLinkPicker.js +17 -17
  8. package/components/Graph.js +6 -6
  9. package/components/HoverCards.js +30 -29
  10. package/components/IssueListBlock.js +83 -83
  11. package/components/LinkCard.js +20 -20
  12. package/components/MentionPicker.js +12 -12
  13. package/components/NewIssueDialog.js +116 -116
  14. package/components/NewProjectDialog.js +5 -4
  15. package/components/Planning.js +31 -43
  16. package/components/RouterLink.js +4 -4
  17. package/components/ShareDialog.js +12 -12
  18. package/components/SharedUI.js +19 -19
  19. package/components/SlashMenu.js +11 -11
  20. package/components/SubPages.js +10 -10
  21. package/components/UnlinkedMentions.js +10 -10
  22. package/components/WorkCounts.js +8 -8
  23. package/components/settings.js +26 -26
  24. package/hostedApp.js +36 -36
  25. package/hosting.d.ts +24 -11
  26. package/index.js +58 -27
  27. package/lib/base.js +1 -14
  28. package/lib/docs.js +6 -6
  29. package/lib/issueMenu.js +33 -33
  30. package/lib/knowledge.js +90 -101
  31. package/lib/knowledgeKinds.js +14 -0
  32. package/lib/projectList.js +1 -1
  33. package/lib/projectStates.js +15 -0
  34. package/lib/router.js +20 -34
  35. package/package.json +2 -2
  36. package/pages/areas.js +147 -147
  37. package/pages/decisions.js +40 -40
  38. package/pages/issues.js +4 -4
  39. package/pages/projects.js +232 -231
  40. package/pages/triage.js +86 -86
  41. package/pages.js +21 -0
  42. package/routes/__root.js +6 -6
  43. package/routes/_workspace/docs/_doc2.js +12 -12
  44. package/routes/_workspace/docs2.js +8 -8
  45. package/routes/_workspace/graph2.js +9 -9
  46. package/routes/_workspace/issues/_identifier2.js +327 -327
  47. package/routes/_workspace/issues/index.js +6 -6
  48. package/routes/_workspace/knowledge/_term2.js +125 -124
  49. package/routes/_workspace/knowledge/index.js +8 -8
  50. package/routes/_workspace/knowledge/index2.js +22 -21
  51. package/routes/_workspace/measures2.js +4 -4
  52. package/routes/_workspace/people/_username.js +4 -4
  53. package/routes/_workspace/projects/_projectId3.js +264 -263
  54. package/routes/_workspace/projects/index.js +7 -7
  55. package/routes/_workspace/settings/account2.js +3 -3
  56. package/routes/_workspace/settings/audit-log2.js +4 -4
  57. package/routes/_workspace/settings/audit-log3.js +51 -51
  58. package/routes/_workspace/settings/labels2.js +14 -14
  59. package/routes/_workspace/settings/members2.js +9 -9
  60. package/routes/_workspace/settings/runners2.js +11 -11
  61. package/routes/_workspace/settings/teams2.js +15 -15
  62. package/routes/_workspace/settings/tokens2.js +5 -5
  63. package/routes/_workspace/settings/webhooks2.js +7 -7
  64. package/routes/_workspace/settings2.js +3 -3
  65. package/routes/_workspace/teams/_key/cycles/_number2.js +8 -8
  66. package/routes/_workspace/teams/_key/cycles/index2.js +20 -20
  67. package/routes/_workspace/teams/_key/issues.js +4 -4
  68. package/routes/_workspace/teams/_key/projects.js +4 -4
  69. package/routes/_workspace/teams/_key/settings2.js +8 -8
  70. package/routes/_workspace2.js +319 -319
  71. package/routes/docs/route2.js +15 -15
package/pages/areas.js CHANGED
@@ -11,20 +11,20 @@ import { FoldedAnswer as b, KnowledgeRow as x } from "../components/AreaWork.js"
11
11
  import { WorkCounts as S } from "../components/WorkCounts.js";
12
12
  import { useAreaActions as C } from "../lib/areas.js";
13
13
  import { AreaTile as w, AreaTiles as T, PlaceTile as E } from "../components/AreaTiles.js";
14
- import { Avatar as D, Breadcrumbs as O, Button as k, Combobox as A, EmptyState as j, ErrorText as M, IconButton as N, Input as P, Modal as F, ModalTitle as I, SegmentedControl as L, Select as R, Tooltip as z, buttonClasses as ee, menuDivider as B, useOpenMenu as V } from "@parallelworks/ui";
15
- import { Fragment as H, useMemo as U, useState as W } from "react";
16
- import { useErrorMessage as G } from "@parallelworks/problem/react";
17
- import { useTranslations as K } from "use-intl";
18
- import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
19
- import { useParams as X, useSearch as te } from "@tanstack/react-router";
14
+ import { Avatar as D, Breadcrumbs as O, Button as k, Combobox as A, EmptyState as j, ErrorText as M, IconButton as N, Input as P, Modal as F, ModalTitle as I, SegmentedControl as ee, Select as L, Tooltip as R, buttonClasses as te, menuDivider as z, useOpenMenu as B } from "@parallelworks/ui";
15
+ import { useParams as V, useSearch as H } from "@tanstack/react-router";
16
+ import { Fragment as U, useMemo as W, useState as G } from "react";
17
+ import { useErrorMessage as K } from "@parallelworks/problem/react";
18
+ import { useTranslations as q } from "use-intl";
19
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
20
20
  import { useQuery as Z, useSuspenseQuery as Q } from "@tanstack/react-query";
21
21
  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 e = K("areas"), { workspace: r, key: i } = X({ strict: !1 }), { team: u = i } = te({ strict: !1 }), { data: d } = Q(t(r)), { data: m } = Q(a(r)), h = m.find((e) => e.key === u);
25
+ let e = q("areas"), { workspace: r, key: i } = V({ strict: !1 }), { team: u = i } = H({ strict: !1 }), { data: d } = Q(t(r)), { data: m } = Q(a(r)), h = m.find((e) => e.key === u);
26
26
  g(e("title"), h?.name);
27
- let v = h ? d.filter((e) => e.teamId === h.id) : d, { data: y } = Q(s(r)), { data: C } = Q(n(r)), [w, T] = W(null), { data: E } = Z(o(r, h?.key)), D = (E?.proposed.length ?? 0) + (E?.notInDocs.length ?? 0), O = v.filter((e) => e.status === "proposed"), A = [...!h && d.some((e) => !e.teamId) ? [{
27
+ let v = h ? d.filter((e) => e.teamId === h.id) : d, { data: y } = Q(s(r)), { data: C } = Q(n(r)), [w, T] = G(null), { data: E } = Z(o(r, h?.key)), D = (E?.proposed.length ?? 0) + (E?.notInDocs.length ?? 0), O = v.filter((e) => e.status === "proposed"), A = [...!h && d.some((e) => !e.teamId) ? [{
28
28
  id: "",
29
29
  key: "workspace",
30
30
  name: y.name,
@@ -46,85 +46,85 @@ function ie() {
46
46
  }), (e) => T({
47
47
  kind: "create",
48
48
  parent: e
49
- })), [I, R] = W(se), z = E && /* @__PURE__ */ Y(q, { children: [E.proposed.map((e) => /* @__PURE__ */ J(x, {
49
+ })), [I, L] = G(se), R = E && /* @__PURE__ */ X(J, { children: [E.proposed.map((e) => /* @__PURE__ */ Y(x, {
50
50
  workspace: r,
51
51
  entry: e,
52
52
  isNew: !1
53
- }, e.id)), E.notInDocs.map((e) => /* @__PURE__ */ J(b, {
53
+ }, e.id)), E.notInDocs.map((e) => /* @__PURE__ */ Y(b, {
54
54
  workspace: r,
55
55
  decision: e,
56
56
  isNew: !1,
57
57
  notInDocs: !0
58
58
  }, e.id))] });
59
- return /* @__PURE__ */ Y("div", {
59
+ return /* @__PURE__ */ X("div", {
60
60
  className: "flex h-full flex-col",
61
61
  children: [
62
- /* @__PURE__ */ Y("header", {
62
+ /* @__PURE__ */ X("header", {
63
63
  className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
64
64
  children: [
65
- /* @__PURE__ */ J("h1", {
65
+ /* @__PURE__ */ Y("h1", {
66
66
  className: "text-sm font-semibold",
67
67
  children: h ? e("teamTitle", { team: h.name }) : e("title")
68
68
  }),
69
- /* @__PURE__ */ J("span", {
69
+ /* @__PURE__ */ Y("span", {
70
70
  className: "text-xs text-muted-foreground tabular-nums",
71
71
  children: e("count", { count: v.length })
72
72
  }),
73
- /* @__PURE__ */ J(S, {
73
+ /* @__PURE__ */ Y(S, {
74
74
  counts: h ? C.teams[h.id] : C.workspace,
75
75
  teamId: h?.id,
76
76
  className: "max-sm:hidden"
77
77
  }),
78
- /* @__PURE__ */ J("div", {
78
+ /* @__PURE__ */ Y("div", {
79
79
  className: "ml-auto",
80
- children: /* @__PURE__ */ J(L, {
80
+ children: /* @__PURE__ */ Y(ee, {
81
81
  label: e("view"),
82
82
  size: "sm",
83
83
  value: I,
84
84
  onValueChange: (e) => {
85
- R(e), ce(e);
85
+ L(e), ce(e);
86
86
  },
87
87
  options: [{
88
88
  value: "icons",
89
89
  label: e("icons"),
90
- icon: /* @__PURE__ */ J(f, {})
90
+ icon: /* @__PURE__ */ Y(f, {})
91
91
  }, {
92
92
  value: "list",
93
93
  label: e("list"),
94
- icon: /* @__PURE__ */ J(p, {})
94
+ icon: /* @__PURE__ */ Y(p, {})
95
95
  }]
96
96
  })
97
97
  }),
98
- /* @__PURE__ */ J(k, {
98
+ /* @__PURE__ */ Y(k, {
99
99
  variant: "primary",
100
100
  size: "sm",
101
- icon: /* @__PURE__ */ J(c, { className: "size-3.5" }),
101
+ icon: /* @__PURE__ */ Y(c, { className: "size-3.5" }),
102
102
  onClick: P,
103
103
  children: e("new")
104
104
  })
105
105
  ]
106
106
  }),
107
- /* @__PURE__ */ Y("div", {
107
+ /* @__PURE__ */ X("div", {
108
108
  className: "min-h-0 flex-1 overflow-y-auto",
109
109
  children: [
110
- v.length === 0 ? /* @__PURE__ */ J("div", {
110
+ v.length === 0 ? /* @__PURE__ */ Y("div", {
111
111
  className: "p-6",
112
- children: /* @__PURE__ */ J(j, {
113
- icon: /* @__PURE__ */ J(l, {}),
112
+ children: /* @__PURE__ */ Y(j, {
113
+ icon: /* @__PURE__ */ Y(l, {}),
114
114
  title: e("none"),
115
115
  description: e("description"),
116
- action: /* @__PURE__ */ J(k, {
116
+ action: /* @__PURE__ */ Y(k, {
117
117
  variant: "primary",
118
118
  size: "sm",
119
119
  onClick: P,
120
120
  children: e("new")
121
121
  })
122
122
  })
123
- }) : /* @__PURE__ */ Y(q, { children: [O.length > 0 && /* @__PURE__ */ J($, {
123
+ }) : /* @__PURE__ */ X(J, { children: [O.length > 0 && /* @__PURE__ */ Y($, {
124
124
  title: e("toReview"),
125
125
  count: O.length,
126
- icon: /* @__PURE__ */ J(l, { className: "size-4 text-warning" }),
127
- children: O.map((e) => /* @__PURE__ */ J(pe, {
126
+ icon: /* @__PURE__ */ Y(l, { className: "size-4 text-warning" }),
127
+ children: O.map((e) => /* @__PURE__ */ Y(pe, {
128
128
  workspace: r,
129
129
  area: e,
130
130
  counts: C.areas[e.id],
@@ -133,40 +133,40 @@ function ie() {
133
133
  review: M(e)?.name,
134
134
  areaMenu: F
135
135
  }, e.id))
136
- }), I === "icons" ? /* @__PURE__ */ J(ue, {
136
+ }), I === "icons" ? /* @__PURE__ */ Y(ue, {
137
137
  workspace: r,
138
138
  spaces: A,
139
139
  areas: v,
140
140
  unfiledCount: D,
141
- unfiledRows: z,
141
+ unfiledRows: R,
142
142
  areaMenu: F,
143
143
  onCreate: T
144
144
  }, h?.id ?? "") : A.map((t) => {
145
145
  let n = v.filter((e) => (e.teamId ?? "") === t.id);
146
- return /* @__PURE__ */ J($, {
146
+ return /* @__PURE__ */ Y($, {
147
147
  title: t.name,
148
148
  count: n.length,
149
- icon: /* @__PURE__ */ J(_, {
149
+ icon: /* @__PURE__ */ Y(_, {
150
150
  icon: t.icon,
151
151
  color: t.color,
152
152
  name: t.name
153
153
  }),
154
- extra: t.team && /* @__PURE__ */ J(S, {
154
+ extra: t.team && /* @__PURE__ */ Y(S, {
155
155
  counts: C.teams[t.team.id],
156
156
  teamId: t.team.id,
157
157
  className: "max-sm:hidden"
158
158
  }),
159
- action: t.team && /* @__PURE__ */ J(N, {
159
+ action: t.team && /* @__PURE__ */ Y(N, {
160
160
  variant: "ghost",
161
161
  size: "xs",
162
- icon: /* @__PURE__ */ J(c, { className: "size-3.5" }),
162
+ icon: /* @__PURE__ */ Y(c, { className: "size-3.5" }),
163
163
  label: e("newIn", { space: t.name }),
164
164
  onClick: () => T({
165
165
  kind: "create",
166
166
  space: t.key
167
167
  })
168
168
  }),
169
- children: /* @__PURE__ */ J(ae, {
169
+ children: /* @__PURE__ */ Y(ae, {
170
170
  workspace: r,
171
171
  areas: n,
172
172
  counts: C.areas,
@@ -176,16 +176,16 @@ function ie() {
176
176
  })
177
177
  }, t.key);
178
178
  })] }),
179
- I === "list" && D > 0 && /* @__PURE__ */ J($, {
179
+ I === "list" && D > 0 && /* @__PURE__ */ Y($, {
180
180
  title: e("unfiled"),
181
181
  count: D,
182
- icon: /* @__PURE__ */ J(l, { className: "size-4 text-muted-foreground" }),
183
- children: z
182
+ icon: /* @__PURE__ */ Y(l, { className: "size-4 text-muted-foreground" }),
183
+ children: R
184
184
  }),
185
- /* @__PURE__ */ J(me, { workspace: r })
185
+ /* @__PURE__ */ Y(me, { workspace: r })
186
186
  ]
187
187
  }),
188
- w && /* @__PURE__ */ J(ge, {
188
+ w && /* @__PURE__ */ Y(ge, {
189
189
  workspace: r,
190
190
  editing: w,
191
191
  spaces: A.filter((e) => e.team),
@@ -196,38 +196,38 @@ function ie() {
196
196
  });
197
197
  }
198
198
  function $({ title: e, count: t, icon: n, extra: r, action: i, bare: a = !1, children: o }) {
199
- return /* @__PURE__ */ Y("section", {
199
+ return /* @__PURE__ */ X("section", {
200
200
  "aria-label": e,
201
- children: [/* @__PURE__ */ Y("h2", {
201
+ children: [/* @__PURE__ */ X("h2", {
202
202
  className: "sticky top-0 z-10 flex h-9 items-center gap-2 border-b border-border bg-background px-4 text-xs font-medium md:px-5",
203
203
  children: [
204
204
  n,
205
- /* @__PURE__ */ J("span", {
205
+ /* @__PURE__ */ Y("span", {
206
206
  className: "truncate",
207
207
  children: e
208
208
  }),
209
- /* @__PURE__ */ J("span", {
209
+ /* @__PURE__ */ Y("span", {
210
210
  className: "text-muted-foreground tabular-nums",
211
211
  children: t
212
212
  }),
213
213
  r,
214
- i && /* @__PURE__ */ J("span", {
214
+ i && /* @__PURE__ */ Y("span", {
215
215
  className: "ml-auto flex",
216
216
  children: i
217
217
  })
218
218
  ]
219
- }), t > 0 && (a ? o : /* @__PURE__ */ J("ul", { children: o }))]
219
+ }), t > 0 && (a ? o : /* @__PURE__ */ Y("ul", { children: o }))]
220
220
  });
221
221
  }
222
222
  function ae({ workspace: e, areas: t, counts: n, parent: r, depth: i, areaMenu: a }) {
223
- return t.filter((e) => e.parentId === r).map((r) => /* @__PURE__ */ Y(H, { children: [/* @__PURE__ */ J(pe, {
223
+ return t.filter((e) => e.parentId === r).map((r) => /* @__PURE__ */ X(U, { children: [/* @__PURE__ */ Y(pe, {
224
224
  workspace: e,
225
225
  area: r,
226
226
  counts: n[r.id],
227
227
  siblings: t,
228
228
  depth: i,
229
229
  areaMenu: a
230
- }), /* @__PURE__ */ J(ae, {
230
+ }), /* @__PURE__ */ Y(ae, {
231
231
  workspace: e,
232
232
  areas: t,
233
233
  counts: n,
@@ -251,14 +251,14 @@ function ce(e) {
251
251
  }
252
252
  var le = /* @__PURE__ */ new Map();
253
253
  function ue({ workspace: t, spaces: n, areas: r, unfiledCount: a, unfiledRows: o, areaMenu: s, onCreate: u }) {
254
- let d = K("areas"), { data: f = [] } = Z(i(t)), p = `${t}/${n.map((e) => e.id).join(",")}`, [m, h] = W(() => le.get(p) ?? null), g = (e) => {
254
+ let d = q("areas"), { data: f = [] } = Z(i(t)), p = `${t}/${n.map((e) => e.id).join(",")}`, [m, h] = G(() => le.get(p) ?? null), g = (e) => {
255
255
  le.set(p, e), h(e);
256
- }, v = U(() => {
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 = (e, n) => e.map((e) => /* @__PURE__ */ J(w, {
261
+ }, [f, r]), y = (e) => r.filter((t) => t.parentId === e), b = (e, n) => e.map((e) => /* @__PURE__ */ Y(w, {
262
262
  workspace: t,
263
263
  area: e,
264
264
  inside: y(e.id).length,
@@ -268,24 +268,24 @@ function ue({ workspace: t, spaces: n, areas: r, unfiledCount: a, unfiledRows: o
268
268
  kind: "area",
269
269
  trail: [...m?.kind === "area" ? m.trail : [], e]
270
270
  })
271
- }, e.id)), x = a > 0 && /* @__PURE__ */ J(E, {
271
+ }, e.id)), x = a > 0 && /* @__PURE__ */ Y(E, {
272
272
  name: d("unfiled"),
273
- icon: /* @__PURE__ */ J(l, { className: "size-7 opacity-60" }),
273
+ icon: /* @__PURE__ */ Y(l, { className: "size-7 opacity-60" }),
274
274
  hint: a,
275
275
  onOpen: () => g({ kind: "unfiled" })
276
276
  });
277
277
  if (!m) return n.map((e, t) => {
278
278
  let i = r.filter((t) => (t.teamId ?? "") === e.id);
279
- return /* @__PURE__ */ J($, {
279
+ return /* @__PURE__ */ Y($, {
280
280
  title: e.name,
281
281
  count: i.length + (t === n.length - 1 && x ? 1 : 0),
282
- icon: /* @__PURE__ */ J(_, {
282
+ icon: /* @__PURE__ */ Y(_, {
283
283
  icon: e.icon,
284
284
  color: e.color,
285
285
  name: e.name
286
286
  }),
287
287
  bare: !0,
288
- children: /* @__PURE__ */ Y(T, {
288
+ children: /* @__PURE__ */ X(T, {
289
289
  label: e.name,
290
290
  children: [b(i.filter((e) => !e.parentId), i), t === n.length - 1 && x]
291
291
  })
@@ -293,13 +293,13 @@ 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__ */ J(l, { className: "size-4" })
296
+ icon: /* @__PURE__ */ Y(l, { 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
- return /* @__PURE__ */ Y("section", {
298
+ return /* @__PURE__ */ X("section", {
299
299
  "aria-label": k.at(-1)?.label,
300
- children: [/* @__PURE__ */ Y("div", {
300
+ children: [/* @__PURE__ */ X("div", {
301
301
  className: "sticky top-0 z-10 flex h-10 items-center gap-2 border-b border-border bg-background px-4 md:px-5",
302
- children: [/* @__PURE__ */ J(O, {
302
+ children: [/* @__PURE__ */ Y(O, {
303
303
  crumbs: k,
304
304
  current: "location",
305
305
  onSelect: (e, t) => g(t === 0 || m.kind !== "area" ? null : {
@@ -307,41 +307,41 @@ 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__ */ Y(q, { children: [/* @__PURE__ */ J(e, {
310
+ }), C && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(e, {
311
311
  to: "/$workspace/areas/$area",
312
312
  params: {
313
313
  workspace: t,
314
314
  area: C.key
315
315
  },
316
- className: ee({
316
+ className: te({
317
317
  variant: "ghost",
318
318
  size: "xs"
319
319
  }),
320
320
  children: d("openArea")
321
- }), /* @__PURE__ */ J(N, {
321
+ }), /* @__PURE__ */ Y(N, {
322
322
  variant: "ghost",
323
323
  size: "xs",
324
- icon: /* @__PURE__ */ J(c, { className: "size-3.5" }),
324
+ icon: /* @__PURE__ */ Y(c, { className: "size-3.5" }),
325
325
  label: d("addInside"),
326
326
  onClick: () => u({
327
327
  kind: "create",
328
328
  parent: C
329
329
  })
330
330
  })] })]
331
- }), m.kind === "unfiled" ? /* @__PURE__ */ J("ul", { children: o }) : D.length === 0 ? /* @__PURE__ */ J("div", {
331
+ }), m.kind === "unfiled" ? /* @__PURE__ */ Y("ul", { children: o }) : D.length === 0 ? /* @__PURE__ */ Y("div", {
332
332
  className: "p-6",
333
- children: /* @__PURE__ */ J(j, {
334
- icon: /* @__PURE__ */ J(l, {}),
333
+ children: /* @__PURE__ */ Y(j, {
334
+ icon: /* @__PURE__ */ Y(l, {}),
335
335
  title: d("emptyArea")
336
336
  })
337
- }) : /* @__PURE__ */ J(T, {
337
+ }) : /* @__PURE__ */ Y(T, {
338
338
  label: k.at(-1)?.label ?? "",
339
339
  children: b(D, D)
340
340
  })]
341
341
  });
342
342
  }
343
343
  function de(e, t, n) {
344
- let r = K("areas"), i = C(e);
344
+ let r = q("areas"), i = C(e);
345
345
  return (e, a) => {
346
346
  let o = a.filter((t) => t.id !== e.id);
347
347
  return [
@@ -367,7 +367,7 @@ function de(e, t, n) {
367
367
  })
368
368
  }))
369
369
  }] : [],
370
- B,
370
+ z,
371
371
  {
372
372
  label: r("archive"),
373
373
  destructive: !0,
@@ -378,11 +378,11 @@ function de(e, t, n) {
378
378
  }
379
379
  var fe = 20;
380
380
  function pe({ workspace: t, area: n, counts: r, siblings: i, depth: a, review: o, areaMenu: s }) {
381
- let c = K("areas"), u = K("common"), f = V(), p = C(t), m = G(), { nameOf: g, avatarOf: _ } = h(t), b = n.status === "proposed", x = () => s(n, i), w = p.accept.error ?? p.merge.error ?? p.archive.error, T = n.creator;
382
- return /* @__PURE__ */ Y("li", {
381
+ let c = q("areas"), u = q("common"), f = B(), p = C(t), m = K(), { nameOf: g, avatarOf: _ } = h(t), b = n.status === "proposed", x = () => s(n, i), w = p.accept.error ?? p.merge.error ?? p.archive.error, T = n.creator;
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__ */ Y(e, {
385
+ /* @__PURE__ */ X(e, {
386
386
  to: "/$workspace/areas/$area",
387
387
  params: {
388
388
  workspace: t,
@@ -392,45 +392,45 @@ function pe({ workspace: t, area: n, counts: r, siblings: i, depth: a, review: o
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__ */ J(v, { icon: n.icon }) : /* @__PURE__ */ J(l, { className: "size-4 shrink-0 text-muted-foreground" }),
396
- /* @__PURE__ */ J("span", {
395
+ n.icon ? /* @__PURE__ */ Y(v, { icon: n.icon }) : /* @__PURE__ */ Y(l, { className: "size-4 shrink-0 text-muted-foreground" }),
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__ */ J(d, {
400
+ n.homeDocId && /* @__PURE__ */ Y(d, {
401
401
  className: "size-3.5 shrink-0 text-muted-foreground",
402
402
  "aria-label": c("hasHomeDoc")
403
403
  }),
404
- n.aliases.length > 0 && /* @__PURE__ */ J("span", {
404
+ n.aliases.length > 0 && /* @__PURE__ */ Y("span", {
405
405
  className: "min-w-0 truncate text-xs text-muted-foreground max-sm:hidden",
406
406
  children: c("alsoCalled", { names: n.aliases.join(", ") })
407
407
  }),
408
- o && /* @__PURE__ */ J("span", {
408
+ o && /* @__PURE__ */ Y("span", {
409
409
  className: "min-w-0 truncate text-xs text-muted-foreground max-sm:hidden",
410
410
  children: c("inSpace", { space: o })
411
411
  })
412
412
  ]
413
413
  }),
414
- w && /* @__PURE__ */ J(M, {
414
+ w && /* @__PURE__ */ Y(M, {
415
415
  inline: !0,
416
416
  className: "shrink-0 text-xs",
417
417
  children: m(w)
418
418
  }),
419
- /* @__PURE__ */ J(S, {
419
+ /* @__PURE__ */ Y(S, {
420
420
  counts: r,
421
421
  teamId: n.teamId,
422
422
  className: "max-sm:hidden"
423
423
  }),
424
- b && !o && /* @__PURE__ */ J("span", {
424
+ b && !o && /* @__PURE__ */ Y("span", {
425
425
  className: "shrink-0 rounded border border-warning/60 px-1.5 py-0.5 text-[11px] leading-none text-warning",
426
426
  children: c("proposed")
427
427
  }),
428
- o && T && /* @__PURE__ */ J(z, {
428
+ o && T && /* @__PURE__ */ Y(R, {
429
429
  content: c("proposedBy", { name: g(T.kind, T.handle) }),
430
430
  describesAnchor: !0,
431
- children: /* @__PURE__ */ Y("span", {
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
- children: [/* @__PURE__ */ J(D, {
433
+ children: [/* @__PURE__ */ Y(D, {
434
434
  ...y(T.kind),
435
435
  name: g(T.kind, T.handle),
436
436
  src: _(T.kind, T.handle),
@@ -439,18 +439,18 @@ function pe({ workspace: t, area: n, counts: r, siblings: i, depth: a, review: o
439
439
  }), g(T.kind, T.handle)]
440
440
  })
441
441
  }),
442
- /* @__PURE__ */ J("span", {
442
+ /* @__PURE__ */ Y("span", {
443
443
  className: "w-28 shrink-0 truncate text-right font-mono text-xs text-muted-foreground max-md:hidden",
444
444
  children: n.key
445
445
  }),
446
- o && /* @__PURE__ */ J(k, {
446
+ o && /* @__PURE__ */ Y(k, {
447
447
  variant: "outline",
448
448
  size: "xs",
449
449
  loading: p.accept.isPending,
450
450
  onClick: () => p.accept.mutate(n.key),
451
451
  children: c("accept")
452
452
  }),
453
- /* @__PURE__ */ J(ne, {
453
+ /* @__PURE__ */ Y(ne, {
454
454
  items: x,
455
455
  label: u("moreActionsFor", { name: n.title })
456
456
  })
@@ -458,51 +458,51 @@ function pe({ workspace: t, area: n, counts: r, siblings: i, depth: a, review: o
458
458
  });
459
459
  }
460
460
  function me({ workspace: e }) {
461
- let n = K("areas"), r = C(e), [i, a] = W(!1), { data: o = [], isPending: s } = Z({
461
+ let n = q("areas"), r = C(e), [i, a] = G(!1), { data: o = [], isPending: s } = Z({
462
462
  ...t(e, !0),
463
463
  enabled: i
464
464
  });
465
- return /* @__PURE__ */ Y("section", {
465
+ return /* @__PURE__ */ X("section", {
466
466
  "aria-label": n("archived"),
467
- children: [/* @__PURE__ */ J("h2", {
467
+ children: [/* @__PURE__ */ Y("h2", {
468
468
  className: "border-b border-border",
469
- children: /* @__PURE__ */ Y("button", {
469
+ children: /* @__PURE__ */ X("button", {
470
470
  type: "button",
471
471
  onClick: () => a((e) => !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__ */ J(u, { className: re("size-3.5 transition-transform", i && "rotate-90") }),
475
+ /* @__PURE__ */ Y(u, { className: re("size-3.5 transition-transform", i && "rotate-90") }),
476
476
  n("archived"),
477
- i && !s && /* @__PURE__ */ J("span", {
477
+ i && !s && /* @__PURE__ */ Y("span", {
478
478
  className: "tabular-nums",
479
479
  children: o.length
480
480
  })
481
481
  ]
482
482
  })
483
- }), i && !s && (o.length === 0 ? /* @__PURE__ */ J("p", {
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
485
  children: n("noArchived")
486
- }) : /* @__PURE__ */ J("ul", { children: o.map((e) => /* @__PURE__ */ Y("li", {
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__ */ J(l, { className: "size-4 shrink-0" }),
490
- /* @__PURE__ */ J("span", {
489
+ /* @__PURE__ */ Y(l, { className: "size-4 shrink-0" }),
490
+ /* @__PURE__ */ Y("span", {
491
491
  className: "min-w-0 truncate text-sm",
492
492
  children: e.title
493
493
  }),
494
- /* @__PURE__ */ J("span", {
494
+ /* @__PURE__ */ Y("span", {
495
495
  className: "ml-auto w-28 shrink-0 truncate text-right font-mono text-xs max-md:hidden",
496
496
  children: e.key
497
497
  }),
498
- /* @__PURE__ */ J(k, {
498
+ /* @__PURE__ */ Y(k, {
499
499
  variant: "outline",
500
500
  size: "xs",
501
501
  loading: r.restore.isPending && r.restore.variables === e.key,
502
502
  onClick: () => r.restore.mutate(e.key),
503
503
  children: n("restore")
504
504
  }),
505
- /* @__PURE__ */ J("span", {
505
+ /* @__PURE__ */ Y("span", {
506
506
  "aria-hidden": !0,
507
507
  className: "size-7 shrink-0"
508
508
  })
@@ -512,26 +512,26 @@ function me({ workspace: e }) {
512
512
  }
513
513
  var he = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
514
514
  function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
515
- let s = K("areas"), c = K("common"), l = G(), u = C(t), f = n.kind === "edit" ? n.area : void 0, p = n.kind === "create" ? n.parent : void 0, [h, g] = W(f?.title ?? ""), [_, v] = W(f?.key ?? ""), [y, b] = W(!!f), [x, S] = W((f?.aliases ?? []).join(", ")), w = n.kind === "create" && n.space || i.find((e) => e.id === (f?.teamId ?? p?.teamId ?? ""))?.key || i[0]?.key || "", [T, E] = W(w), D = i.find((e) => e.key === T)?.id ?? "", [O, j] = W(p?.key ?? a.find((e) => e.id === f?.parentId)?.key ?? ""), [N, L] = W(""), [z, ee] = W(!1), { data: B = [] } = Z({
515
+ let s = q("areas"), c = q("common"), l = K(), u = C(t), f = n.kind === "edit" ? n.area : void 0, p = n.kind === "create" ? n.parent : void 0, [h, g] = G(f?.title ?? ""), [_, v] = G(f?.key ?? ""), [y, b] = G(!!f), [x, S] = G((f?.aliases ?? []).join(", ")), w = n.kind === "create" && n.space || i.find((e) => e.id === (f?.teamId ?? p?.teamId ?? ""))?.key || i[0]?.key || "", [T, E] = G(w), D = i.find((e) => e.key === T)?.id ?? "", [O, j] = G(p?.key ?? a.find((e) => e.id === f?.parentId)?.key ?? ""), [N, ee] = G(""), [R, te] = G(!1), { data: z = [] } = Z({
516
516
  ...r(t),
517
- enabled: z || !!f?.homeDocId
518
- }), V = N ? B.find((e) => e.key === N) : B.find((e) => e.id === f?.homeDocId), H = !f || f.status === "proposed", q = u.create.isPending || u.update.isPending, X = u.create.error ?? u.update.error, te = U(() => a.filter((e) => (e.teamId ?? "") === D && e.id !== f?.id), [
517
+ enabled: R || !!f?.homeDocId
518
+ }), B = N ? z.find((e) => e.key === N) : z.find((e) => e.id === f?.homeDocId), V = !f || f.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 !== f?.id), [
519
519
  a,
520
520
  D,
521
521
  f?.id
522
522
  ]), Q = x.split(",").map((e) => e.trim()).filter(Boolean);
523
- return /* @__PURE__ */ J(F, {
523
+ return /* @__PURE__ */ Y(F, {
524
524
  open: !0,
525
525
  onClose: o,
526
526
  className: "max-h-[85vh] w-full max-w-md overflow-y-auto p-5",
527
- children: /* @__PURE__ */ Y("form", {
527
+ children: /* @__PURE__ */ X("form", {
528
528
  onSubmit: (e) => {
529
529
  e.preventDefault(), f ? u.update.mutate({
530
530
  area: f.key,
531
531
  body: {
532
532
  title: h,
533
533
  aliases: Q,
534
- ...H && _ !== f.key && { key: _ },
534
+ ...V && _ !== f.key && { key: _ },
535
535
  ...O !== (a.find((e) => e.id === f.parentId)?.key ?? "") && { parent: O },
536
536
  ...N && { homeDoc: N }
537
537
  }
@@ -545,13 +545,13 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
545
545
  }, { onSuccess: o });
546
546
  },
547
547
  children: [
548
- /* @__PURE__ */ J(I, {
548
+ /* @__PURE__ */ Y(I, {
549
549
  className: "text-sm font-semibold",
550
550
  children: s(f ? "editTitle" : "newTitle")
551
551
  }),
552
- /* @__PURE__ */ Y("label", {
552
+ /* @__PURE__ */ X("label", {
553
553
  className: "mt-4 block text-xs font-medium text-muted-foreground",
554
- children: [s("fieldTitle"), /* @__PURE__ */ J(P, {
554
+ children: [s("fieldTitle"), /* @__PURE__ */ Y(P, {
555
555
  value: h,
556
556
  onChange: (e) => {
557
557
  g(e.target.value), y || v(he(e.target.value));
@@ -562,43 +562,43 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
562
562
  className: "mt-1"
563
563
  })]
564
564
  }),
565
- /* @__PURE__ */ Y("label", {
565
+ /* @__PURE__ */ X("label", {
566
566
  className: "mt-3 block text-xs font-medium text-muted-foreground",
567
567
  children: [
568
568
  s("fieldKey"),
569
- /* @__PURE__ */ J(P, {
569
+ /* @__PURE__ */ Y(P, {
570
570
  value: _,
571
571
  onChange: (e) => {
572
572
  b(!0), v(e.target.value.toLowerCase());
573
573
  },
574
- disabled: !H,
574
+ disabled: !V,
575
575
  required: !0,
576
576
  pattern: "[a-z0-9][a-z0-9-]{0,62}",
577
577
  mono: !0,
578
578
  className: "mt-1"
579
579
  }),
580
- /* @__PURE__ */ J("span", {
580
+ /* @__PURE__ */ Y("span", {
581
581
  className: "mt-1 block font-normal",
582
- children: s(H ? "keyHint" : "keyFixed")
582
+ children: s(V ? "keyHint" : "keyFixed")
583
583
  })
584
584
  ]
585
585
  }),
586
- /* @__PURE__ */ Y("label", {
586
+ /* @__PURE__ */ X("label", {
587
587
  className: "mt-3 block text-xs font-medium text-muted-foreground",
588
- children: [s("fieldAliases"), /* @__PURE__ */ J(P, {
588
+ children: [s("fieldAliases"), /* @__PURE__ */ Y(P, {
589
589
  value: x,
590
590
  onChange: (e) => S(e.target.value),
591
591
  placeholder: s("aliasesPlaceholder"),
592
592
  className: "mt-1"
593
593
  })]
594
594
  }),
595
- /* @__PURE__ */ Y("div", {
595
+ /* @__PURE__ */ X("div", {
596
596
  className: "mt-3 flex flex-wrap gap-3",
597
- children: [!f && !p && /* @__PURE__ */ Y("div", {
597
+ children: [!f && !p && /* @__PURE__ */ X("div", {
598
598
  className: "text-xs font-medium text-muted-foreground",
599
- children: [s("fieldSpace"), /* @__PURE__ */ J("div", {
599
+ children: [s("fieldSpace"), /* @__PURE__ */ Y("div", {
600
600
  className: "mt-1",
601
- children: /* @__PURE__ */ J(R, {
601
+ children: /* @__PURE__ */ Y(L, {
602
602
  value: T,
603
603
  items: i.map((e) => ({
604
604
  value: e.key,
@@ -611,16 +611,16 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
611
611
  width: "content"
612
612
  })
613
613
  })]
614
- }), /* @__PURE__ */ Y("div", {
614
+ }), /* @__PURE__ */ X("div", {
615
615
  className: "text-xs font-medium text-muted-foreground",
616
- children: [s("fieldParent"), /* @__PURE__ */ J("div", {
616
+ children: [s("fieldParent"), /* @__PURE__ */ Y("div", {
617
617
  className: "mt-1",
618
- children: /* @__PURE__ */ J(R, {
618
+ children: /* @__PURE__ */ Y(L, {
619
619
  value: O,
620
620
  items: [{
621
621
  value: "",
622
622
  label: s("top")
623
- }, ...te.map((e) => ({
623
+ }, ...J.map((e) => ({
624
624
  value: e.key,
625
625
  label: e.title
626
626
  }))],
@@ -631,57 +631,57 @@ function ge({ workspace: t, editing: n, spaces: i, areas: a, onClose: o }) {
631
631
  })]
632
632
  })]
633
633
  }),
634
- /* @__PURE__ */ Y("div", {
634
+ /* @__PURE__ */ X("div", {
635
635
  className: "mt-3 text-xs font-medium text-muted-foreground",
636
- children: [s("fieldHomeDoc"), /* @__PURE__ */ Y("div", {
636
+ children: [s("fieldHomeDoc"), /* @__PURE__ */ X("div", {
637
637
  className: "mt-1",
638
- children: [/* @__PURE__ */ J(A, {
639
- open: z,
640
- onOpenChange: ee,
641
- items: B.map((e) => ({
638
+ children: [/* @__PURE__ */ Y(A, {
639
+ open: R,
640
+ onOpenChange: te,
641
+ items: z.map((e) => ({
642
642
  value: e.key,
643
643
  label: e.title,
644
- icon: /* @__PURE__ */ J(d, { className: "size-3.5" })
644
+ icon: /* @__PURE__ */ Y(d, { className: "size-3.5" })
645
645
  })),
646
- value: V?.key ?? null,
647
- onValueChange: (e) => e !== null && L(e),
646
+ value: B?.key ?? null,
647
+ onValueChange: (e) => e !== null && ee(e),
648
648
  placeholder: s("chooseDoc"),
649
649
  "aria-label": s("fieldHomeDoc"),
650
- trigger: /* @__PURE__ */ Y(k, {
650
+ trigger: /* @__PURE__ */ X(k, {
651
651
  type: "button",
652
652
  className: "max-w-full font-normal",
653
- children: [/* @__PURE__ */ J(d, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ J("span", {
653
+ children: [/* @__PURE__ */ Y(d, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
654
654
  className: "truncate",
655
- children: V?.title ?? s("noDoc")
655
+ children: B?.title ?? s("noDoc")
656
656
  })]
657
657
  })
658
- }), V && /* @__PURE__ */ J(e, {
658
+ }), B && /* @__PURE__ */ Y(e, {
659
659
  to: "/$workspace/docs/$doc",
660
660
  params: {
661
661
  workspace: t,
662
- doc: m(V)
662
+ doc: m(B)
663
663
  },
664
664
  className: "ml-2 text-xs font-normal text-primary hover:underline",
665
665
  children: s("openDoc")
666
666
  })]
667
667
  })]
668
668
  }),
669
- X && /* @__PURE__ */ J(M, {
669
+ U && /* @__PURE__ */ Y(M, {
670
670
  size: "md",
671
671
  className: "mt-3",
672
- children: l(X)
672
+ children: l(U)
673
673
  }),
674
- /* @__PURE__ */ Y("div", {
674
+ /* @__PURE__ */ X("div", {
675
675
  className: "mt-5 flex justify-end gap-2",
676
- children: [/* @__PURE__ */ J(k, {
676
+ children: [/* @__PURE__ */ Y(k, {
677
677
  type: "button",
678
678
  onClick: o,
679
679
  children: c("cancel")
680
- }), /* @__PURE__ */ J(k, {
680
+ }), /* @__PURE__ */ Y(k, {
681
681
  type: "submit",
682
682
  variant: "primary",
683
683
  disabled: !h.trim() || !_,
684
- loading: q,
684
+ loading: H,
685
685
  children: f ? c("save") : s("create")
686
686
  })]
687
687
  })