@parallelworks/tandem-web 0.179.2 → 0.181.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.
@@ -1,44 +1,46 @@
1
- import { docBacklinksQuery as e, docDecisionsQuery as t, docIssuesQuery as n, docQuery as r, lostSectionsQuery as i, meQuery as a, teamsQuery as o, workspaceQuery as s } from "../../../api/queries.js";
2
- import { AnsweredDecision as c, DecisionCard as l } from "../../../components/AgentWork.js";
3
- import { AreaSelect as u } from "../../../components/AreaSelect.js";
4
- import { CollabEditor as d } from "../../../components/CollabEditor.js";
5
- import { DocComments as ee, useOpenThreads as te } from "../../../components/DocComments.js";
6
- import { DocHistory as ne, DocVersion as re } from "../../../components/DocHistory.js";
1
+ import { docBacklinksQuery as e, docDecisionsQuery as t, docIssuesQuery as n, docQuery as r, docsQuery as i, lostSectionsQuery as a, meQuery as o, teamsQuery as s, workspaceQuery as c } from "../../../api/queries.js";
2
+ import { AnsweredDecision as l, DecisionCard as u } from "../../../components/AgentWork.js";
3
+ import { AreaSelect as d } from "../../../components/AreaSelect.js";
4
+ import { CollabEditor as ee } from "../../../components/CollabEditor.js";
5
+ import { DocComments as te, useOpenThreads as ne } from "../../../components/DocComments.js";
6
+ import { DocHistory as re, DocVersion as ie } from "../../../components/DocHistory.js";
7
7
  import { DocIcon as f } from "../../../components/DocIcon.js";
8
- import { DocCover as ie, DocLookControls as ae } from "../../../components/DocLook.js";
9
- import { DocOutline as oe } from "../../../components/DocOutline.js";
10
- import { DocProperties as se } from "../../../components/DocProperties.js";
8
+ import { DocCover as ae, DocLookControls as oe } from "../../../components/DocLook.js";
9
+ import { DocOutline as se } from "../../../components/DocOutline.js";
10
+ import { DocProperties as ce } from "../../../components/DocProperties.js";
11
+ import { DocRuns as le, DocStart as ue } from "../../../components/DocStart.js";
11
12
  import { Editor as p } from "../../../components/Editor.js";
12
- import { FavoriteStar as ce } from "../../../components/FavoriteStar.js";
13
- import { Connections as le } from "../../../components/Graph.js";
14
- import { CommentIcon as ue, StatusIcon as m } from "../../../components/icons.js";
15
- import { PersonHoverCard as h } from "../../../components/PersonHoverCard.js";
16
- import { FieldNote as de, Viewers as fe } from "../../../components/Presence.js";
17
- import { UnlinkedMentions as pe, useUnlinkedMentions as me } from "../../../components/UnlinkedMentions.js";
18
- import { caretColor as g, useCollabSession as _ } from "../../../lib/collab.js";
19
- import { docKey as he, docPath as ge, docRef as v, docURL as _e, useDocActions as ve, useDocMenu as y } from "../../../lib/docs.js";
20
- import { headingAnchor as ye } from "../../../lib/glossary.js";
21
- import { issueURL as be, useIssueMenu as b } from "../../../lib/issueMenu.js";
22
- import { termRef as x } from "../../../lib/knowledgeKinds.js";
23
- import { useOthersOn as xe, useReportLocation as Se } from "../../../lib/live.js";
24
- import { copyItem as Ce } from "../../../lib/menus.js";
25
- import { useNewIssue as we } from "../../../lib/newIssue.js";
26
- import { usePageTitle as Te } from "../../../lib/pageTitle.js";
27
- import { usePeople as S } from "../../../lib/people.js";
28
- import { rememberPage as Ee } from "../../../lib/recent.js";
29
- import { Link as C, useNavigate as De } from "../../../lib/router.js";
30
- import { useTime as w } from "../../../lib/time.js";
31
- import { Route as Oe } from "./_doc.js";
32
- import { Avatar as T, Breadcrumbs as ke, Button as E, ErrorText as D, TitleInput as O, Tooltip as k, useOpenMenu as A } from "@parallelworks/ui";
33
- import { useCallback as Ae, useEffect as j, useMemo as M, useRef as N, useState as P } from "react";
34
- import { useErrorMessage as je } from "@parallelworks/problem/react";
13
+ import { FavoriteStar as de } from "../../../components/FavoriteStar.js";
14
+ import { Connections as fe } from "../../../components/Graph.js";
15
+ import { CommentIcon as m, StatusIcon as h } from "../../../components/icons.js";
16
+ import { PersonHoverCard as g } from "../../../components/PersonHoverCard.js";
17
+ import { FieldNote as pe, Viewers as me } from "../../../components/Presence.js";
18
+ import { SubpageViews as he } from "../../../components/SubpageViews.js";
19
+ import { UnlinkedMentions as ge, useUnlinkedMentions as _e } from "../../../components/UnlinkedMentions.js";
20
+ import { caretColor as _, useCollabSession as v } from "../../../lib/collab.js";
21
+ import { docKey as ve, docPath as ye, docRef as y, docURL as be, useDocActions as xe, useDocMenu as b } from "../../../lib/docs.js";
22
+ import { headingAnchor as Se } from "../../../lib/glossary.js";
23
+ import { issueURL as Ce, useIssueMenu as x } from "../../../lib/issueMenu.js";
24
+ import { termRef as S } from "../../../lib/knowledgeKinds.js";
25
+ import { useOthersOn as we, useReportLocation as Te } from "../../../lib/live.js";
26
+ import { copyItem as Ee } from "../../../lib/menus.js";
27
+ import { useNewIssue as De } from "../../../lib/newIssue.js";
28
+ import { usePageTitle as Oe } from "../../../lib/pageTitle.js";
29
+ import { usePeople as C } from "../../../lib/people.js";
30
+ import { rememberPage as ke } from "../../../lib/recent.js";
31
+ import { Link as w, useNavigate as Ae } from "../../../lib/router.js";
32
+ import { useTime as T } from "../../../lib/time.js";
33
+ import { Route as je } from "./_doc.js";
34
+ import { Avatar as Me, Breadcrumbs as E, Button as D, ErrorText as Ne, TitleInput as O, Tooltip as k, useOpenMenu as A } from "@parallelworks/ui";
35
+ import { useCallback as Pe, useEffect as j, useMemo as M, useRef as N, useState as P } from "react";
36
+ import { useErrorMessage as Fe } from "@parallelworks/problem/react";
35
37
  import { useTranslations as F } from "use-intl";
36
38
  import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
37
39
  import { useQuery as z, useSuspenseQuery as B } from "@tanstack/react-query";
38
- import { MoreButton as Me } from "@parallelworks/ui/list";
40
+ import { MoreButton as Ie } from "@parallelworks/ui/list";
39
41
  // src/routes/$workspace/docs/$doc.tsx?tsr-split=component
40
- var Ne = 120;
41
- function Pe(e) {
42
+ var Le = 120;
43
+ function Re(e) {
42
44
  let { $from: t, empty: n } = e.state.selection;
43
45
  if (n) for (let e = t.depth; e > 0; e--) {
44
46
  let n = t.node(e);
@@ -51,53 +53,53 @@ function Pe(e) {
51
53
  }
52
54
  }
53
55
  function V() {
54
- let e = F("docs"), t = F("common"), n = je(), { workspace: i, doc: c } = Oe.useParams(), { rename: l } = Oe.useSearch(), { data: d } = B(r(i, he(c))), f = d.key, { data: ue } = B(o(i)), { data: m } = B(a), h = ue.find((e) => e.id === d.teamId), { data: g } = B(s(i)), [_, b] = P();
55
- Se({
56
- doc: d.key,
56
+ let e = F("docs"), t = F("common"), n = Fe(), { workspace: i, doc: a } = je.useParams(), { rename: l } = je.useSearch(), { data: u } = B(r(i, ve(a))), ee = u.key, { data: f } = B(s(i)), { data: m } = B(o), h = f.find((e) => e.id === u.teamId), { data: g } = B(c(i)), [_, v] = P();
57
+ Te({
58
+ doc: u.key,
57
59
  ..._ && { field: _ }
58
- }), Te(d.title || e("untitled"), h?.name);
59
- let x = xe({ doc: d.key }, m?.user.username);
60
+ }), Oe(u.title || e("untitled"), h?.name);
61
+ let x = we({ doc: u.key }, m?.user.username);
60
62
  j(() => {
61
- Ee(i, {
63
+ ke(i, {
62
64
  kind: "doc",
63
- href: ge(i, d),
64
- label: d.title
65
+ href: ye(i, u),
66
+ label: u.title
65
67
  });
66
- }, [i, d]);
67
- let S = De(), C = A(), w = y(i), T = ve(i), ke = we(), O = N(null), [k, M] = P(null), I = N(null), z = me(i, d, k), [V, We] = P(""), [Ge, Ke] = P(""), H = N(null), [U, W] = P(!1), [qe, G] = P(), K = te(i, f), [Je, q] = P(!1), [Ye, J] = P(!1), [Xe, Y] = P(!1), [X, Z] = P();
68
+ }, [i, u]);
69
+ let S = Ae(), C = A(), w = b(i), T = xe(i), Me = De(), E = N(null), [O, k] = P(null), M = N(null), z = _e(i, u, O), [V, Ye] = P(""), [Xe, Ze] = P(""), H = N(null), [U, W] = P(!1), [Qe, G] = P(), K = ne(i, ee), [$e, q] = P(!1), [et, J] = P(!1), [tt, Y] = P(!1), [X, Z] = P();
68
70
  j(() => {
69
- (c !== v(d) || l) && S({
71
+ (a !== y(u) || l) && S({
70
72
  to: "/$workspace/docs/$doc",
71
73
  params: {
72
74
  workspace: i,
73
- doc: v(d)
75
+ doc: y(u)
74
76
  },
75
77
  search: {},
76
78
  replace: !0
77
79
  });
78
80
  }, [
79
- c,
80
- d,
81
+ a,
82
+ u,
81
83
  i,
82
84
  l,
83
85
  S
84
86
  ]);
85
- let Ze = Ae((e) => {
86
- if (O.current = e, M(e), !e) return;
87
+ let nt = Pe((e) => {
88
+ if (E.current = e, k(e), !e) return;
87
89
  let t = decodeURIComponent(location.hash.slice(1));
88
90
  if (t) {
89
- for (let n of e.view.dom.querySelectorAll("h1, h2, h3, h4, h5, h6")) if (ye(n.textContent ?? "") === t) {
91
+ for (let n of e.view.dom.querySelectorAll("h1, h2, h3, h4, h5, h6")) if (Se(n.textContent ?? "") === t) {
90
92
  n.scrollIntoView({ block: "start" });
91
93
  break;
92
94
  }
93
95
  }
94
96
  e.on("selectionUpdate", () => {
95
97
  let { from: t, to: n } = e.state.selection;
96
- We(t === n ? "" : e.state.doc.textBetween(t, n, "\n\n").trim()), Ke(Pe(e)?.text ?? "");
98
+ Ye(t === n ? "" : e.state.doc.textBetween(t, n, "\n\n").trim()), Ze(Re(e)?.text ?? "");
97
99
  });
98
100
  }, []);
99
101
  j(() => {
100
- let e = O.current;
102
+ let e = E.current;
101
103
  if (!U || !V || !e) return;
102
104
  let { from: t, to: n } = e.state.selection, r = e.state.doc;
103
105
  G({
@@ -106,8 +108,8 @@ function V() {
106
108
  quoteSuffix: r.textBetween(n, Math.min(r.content.size, n + 64), "\n")
107
109
  });
108
110
  }, [U, V]);
109
- let Qe = (e) => {
110
- let t = O.current;
111
+ let rt = (e) => {
112
+ let t = E.current;
111
113
  if (!t || !e.quote) return;
112
114
  let n = t.state.doc, r = n.textBetween(0, n.content.size, "\n"), i = -1, a = -1;
113
115
  for (let t = r.indexOf(e.quote); t >= 0; t = r.indexOf(e.quote, t + 1)) {
@@ -136,20 +138,20 @@ function V() {
136
138
  to: d
137
139
  }).scrollIntoView().run();
138
140
  }, Q = () => {
139
- let t = V ? void 0 : O.current && Pe(O.current), n = V || t?.text;
141
+ let t = V ? void 0 : E.current && Re(E.current), n = V || t?.text;
140
142
  if (!n || !h) return;
141
143
  let r = n.split("\n").map((e) => e ? `> ${e}` : ">").join("\n");
142
- ke({
144
+ Me({
143
145
  team: h.key,
144
- title: (n.split("\n")[0] ?? "").slice(0, Ne),
146
+ title: (n.split("\n")[0] ?? "").slice(0, Le),
145
147
  body: e("fromDoc", {
146
148
  quote: r,
147
- title: d.title,
148
- url: _e(i, d)
149
+ title: u.title,
150
+ url: be(i, u)
149
151
  }),
150
- origin: { doc: d.key },
152
+ origin: { doc: u.key },
151
153
  onCreated: (e) => {
152
- let n = O.current;
154
+ let n = E.current;
153
155
  n && n.chain().insertContentAt(t ? t.end : n.state.selection.to, [{
154
156
  type: "text",
155
157
  text: " "
@@ -158,33 +160,33 @@ function V() {
158
160
  text: e.identifier,
159
161
  marks: [{
160
162
  type: "link",
161
- attrs: { href: be(i, e.identifier) }
163
+ attrs: { href: Ce(i, e.identifier) }
162
164
  }]
163
165
  }]).run();
164
166
  }
165
167
  });
166
- }, $e = d.ancestors ?? [], $ = !!d.archivedAt;
168
+ }, it = u.ancestors ?? [], $ = !!u.archivedAt;
167
169
  return /* @__PURE__ */ R("div", {
168
170
  className: "flex h-full flex-col",
169
171
  children: [/* @__PURE__ */ R("header", {
170
172
  className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-4 text-sm md:px-5",
171
- onContextMenu: (e) => C(e, w(d, { onRename: () => H.current?.focus() })),
173
+ onContextMenu: (e) => C(e, w(u, { onRename: () => H.current?.focus() })),
172
174
  children: [
173
- /* @__PURE__ */ L(He, {
175
+ /* @__PURE__ */ L(qe, {
174
176
  workspace: i,
175
- doc: d,
176
- path: $e,
177
+ doc: u,
178
+ path: it,
177
179
  space: h?.name ?? g.name
178
180
  }),
179
- /* @__PURE__ */ L(ce, {
181
+ /* @__PURE__ */ L(de, {
180
182
  workspace: i,
181
183
  kind: "doc",
182
- target: d.id
184
+ target: u.id
183
185
  }),
184
186
  /* @__PURE__ */ R("span", {
185
187
  className: "ml-auto flex shrink-0 items-center gap-3",
186
188
  children: [
187
- (V || Ge) && h && !$ && /* @__PURE__ */ L(E, {
189
+ (V || Xe) && h && !$ && /* @__PURE__ */ L(D, {
188
190
  type: "button",
189
191
  size: "sm",
190
192
  onMouseDown: (e) => e.preventDefault(),
@@ -195,11 +197,11 @@ function V() {
195
197
  className: "text-xs text-muted-foreground",
196
198
  children: t("saving")
197
199
  }),
198
- /* @__PURE__ */ L(fe, {
200
+ /* @__PURE__ */ L(me, {
199
201
  workspace: i,
200
202
  others: x
201
203
  }),
202
- /* @__PURE__ */ R(E, {
204
+ /* @__PURE__ */ R(D, {
203
205
  type: "button",
204
206
  size: "sm",
205
207
  "aria-pressed": U,
@@ -208,42 +210,42 @@ function V() {
208
210
  },
209
211
  ...K > 0 && { "aria-label": e("commentsCount", { count: K }) },
210
212
  className: "relative aria-pressed:bg-muted max-md:hidden",
211
- children: [e("comments"), /* @__PURE__ */ L(Ue, { count: K })]
213
+ children: [e("comments"), /* @__PURE__ */ L(Je, { count: K })]
212
214
  }),
213
- /* @__PURE__ */ L(E, {
215
+ /* @__PURE__ */ L(D, {
214
216
  type: "button",
215
217
  size: "sm",
216
- "aria-pressed": Je,
218
+ "aria-pressed": $e,
217
219
  onClick: () => {
218
220
  q((e) => !e), Z(void 0), W(!1), J(!1), Y(!1);
219
221
  },
220
222
  className: "aria-pressed:bg-muted max-md:hidden",
221
223
  children: e("history")
222
224
  }),
223
- !$ && /* @__PURE__ */ R(E, {
225
+ !$ && /* @__PURE__ */ R(D, {
224
226
  type: "button",
225
227
  size: "sm",
226
- "aria-pressed": Ye,
228
+ "aria-pressed": et,
227
229
  onClick: () => {
228
230
  J((e) => !e), W(!1), q(!1), Z(void 0), Y(!1);
229
231
  },
230
232
  ...z.length > 0 && { "aria-label": e("unlinkedCount", { count: z.length }) },
231
233
  className: "relative aria-pressed:bg-muted max-md:hidden",
232
- children: [e("links"), /* @__PURE__ */ L(Ue, { count: z.length })]
234
+ children: [e("links"), /* @__PURE__ */ L(Je, { count: z.length })]
233
235
  }),
234
- !$ && /* @__PURE__ */ L(E, {
236
+ !$ && /* @__PURE__ */ L(D, {
235
237
  type: "button",
236
238
  size: "sm",
237
- "aria-pressed": Xe,
239
+ "aria-pressed": tt,
238
240
  onClick: () => {
239
241
  Y((e) => !e), W(!1), q(!1), Z(void 0), J(!1);
240
242
  },
241
243
  className: "aria-pressed:bg-muted max-md:hidden",
242
244
  children: e("graph")
243
245
  }),
244
- /* @__PURE__ */ L(Me, {
245
- items: () => w(d, { onRename: () => H.current?.focus() }),
246
- label: t("moreActionsFor", { name: d.title }),
246
+ /* @__PURE__ */ L(Ie, {
247
+ items: () => w(u, { onRename: () => H.current?.focus() }),
248
+ label: t("moreActionsFor", { name: u.title }),
247
249
  visible: !0
248
250
  })
249
251
  ]
@@ -253,153 +255,175 @@ function V() {
253
255
  className: "flex min-h-0 flex-1",
254
256
  children: [
255
257
  /* @__PURE__ */ R("div", {
256
- ref: I,
258
+ ref: M,
257
259
  className: "min-h-0 flex-1 overflow-y-auto",
258
- children: [!X && /* @__PURE__ */ L(ie, {
260
+ children: [!X && /* @__PURE__ */ L(ae, {
259
261
  workspace: i,
260
- doc: d,
262
+ doc: u,
261
263
  editable: !$
262
264
  }), /* @__PURE__ */ R("div", {
263
265
  className: "flex w-full gap-10 px-4 pt-6 md:px-8 md:pt-8",
264
266
  children: [/* @__PURE__ */ R("article", {
265
- className: `group/doc min-w-0 flex-1 pb-24 ${d.fullWidth ? "" : "mx-auto max-w-reading"}`,
267
+ className: `group/doc min-w-0 flex-1 pb-24 ${u.fullWidth ? "" : "mx-auto max-w-reading"}`,
266
268
  children: [
267
269
  $ && /* @__PURE__ */ R("div", {
268
270
  className: "mb-6 flex items-center gap-3 rounded-md border border-border bg-muted px-3 py-2 text-sm",
269
271
  children: [/* @__PURE__ */ L("span", {
270
272
  className: "flex-1",
271
273
  children: e("archivedNotice")
272
- }), /* @__PURE__ */ L(E, {
274
+ }), /* @__PURE__ */ L(D, {
273
275
  type: "button",
274
276
  variant: "primary",
275
277
  size: "sm",
276
- onClick: () => T.restore.mutate(d),
278
+ onClick: () => T.restore.mutate(u),
277
279
  children: e("restore")
278
280
  })]
279
281
  }),
280
- /* @__PURE__ */ L(ae, {
282
+ /* @__PURE__ */ L(oe, {
281
283
  workspace: i,
282
- doc: d,
284
+ doc: u,
283
285
  editable: !$ && !X
284
286
  }),
285
- /* @__PURE__ */ L(Fe, {
286
- doc: d,
287
+ /* @__PURE__ */ L(ze, {
288
+ doc: u,
287
289
  input: H,
288
290
  autoFocus: !!l,
289
291
  readOnly: $,
290
- onFocus: () => b("title"),
291
- onBlur: () => b(void 0),
292
+ onFocus: () => v("title"),
293
+ onBlur: () => v(void 0),
292
294
  onSave: (e) => T.rename.mutate({
293
- doc: d,
295
+ doc: u,
294
296
  title: e
295
297
  })
296
- }, d.id),
297
- /* @__PURE__ */ L(de, {
298
+ }, u.id),
299
+ /* @__PURE__ */ L(pe, {
298
300
  workspace: i,
299
301
  others: x,
300
302
  field: "title"
301
303
  }),
302
- T.rename.isError && /* @__PURE__ */ L(D, {
304
+ T.rename.isError && /* @__PURE__ */ L(Ne, {
303
305
  className: "mt-1",
304
306
  children: n(T.rename.error)
305
307
  }),
306
308
  /* @__PURE__ */ R("div", {
307
309
  className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1",
308
- children: [/* @__PURE__ */ L(Ie, {
310
+ children: [/* @__PURE__ */ L(Be, {
309
311
  workspace: i,
310
- doc: d
311
- }), /* @__PURE__ */ L(u, {
312
+ doc: u
313
+ }), /* @__PURE__ */ L(d, {
312
314
  workspace: i,
313
- teamId: d.teamId,
314
- value: d.areaId,
315
+ teamId: u.teamId,
316
+ value: u.areaId,
315
317
  onChange: (e) => T.fileUnder.mutate({
316
- doc: d,
318
+ doc: u,
317
319
  area: e
318
320
  }),
319
321
  disabled: $,
320
322
  className: "flex h-6 items-center gap-1.5 rounded-md px-1.5 text-xs hover:bg-muted"
321
323
  })]
322
324
  }),
323
- !X && /* @__PURE__ */ L(se, {
325
+ !X && /* @__PURE__ */ L(ce, {
324
326
  workspace: i,
325
- doc: d,
327
+ doc: u,
326
328
  space: h?.key ?? "workspace",
327
329
  editable: !$
328
330
  }),
331
+ !X && /* @__PURE__ */ L(he, {
332
+ workspace: i,
333
+ doc: u,
334
+ space: h?.key ?? "workspace"
335
+ }),
329
336
  /* @__PURE__ */ L("div", {
330
337
  onContextMenu: (t) => !$ && (V ? C(t, [{
331
338
  label: e("createIssue"),
332
339
  onClick: Q
333
- }, Ce(e("copySelection"), V)]) : Ge && h && C(t, [{
340
+ }, Ee(e("copySelection"), V)]) : Xe && h && C(t, [{
334
341
  label: e("createIssueFromActionItem"),
335
342
  onClick: Q
336
343
  }])),
337
- children: X ? /* @__PURE__ */ L(re, {
344
+ children: X ? /* @__PURE__ */ L(ie, {
338
345
  workspace: i,
339
- doc: d,
346
+ doc: u,
340
347
  versionId: X,
341
348
  onDone: () => Z(void 0)
342
349
  }) : $ ? /* @__PURE__ */ L("div", {
343
350
  className: "mt-4",
344
351
  children: /* @__PURE__ */ L(p, {
345
- value: d.body ?? "",
352
+ value: u.body ?? "",
346
353
  editable: !1,
347
354
  className: "min-h-32"
348
355
  })
349
- }) : /* @__PURE__ */ L(Le, {
356
+ }) : /* @__PURE__ */ L(Ve, {
350
357
  workspace: i,
351
- doc: d,
352
- onEditor: Ze,
353
- onFocus: () => b("body"),
354
- onBlur: () => b(void 0)
358
+ doc: u,
359
+ onEditor: nt,
360
+ onFocus: () => v("body"),
361
+ onBlur: () => v(void 0)
355
362
  })
356
363
  }),
357
- /* @__PURE__ */ L(ze, {
364
+ !$ && !X && /* @__PURE__ */ R(I, { children: [
365
+ /* @__PURE__ */ L(Ge, {
366
+ workspace: i,
367
+ doc: u
368
+ }),
369
+ /* @__PURE__ */ L(le, {
370
+ workspace: i,
371
+ doc: u
372
+ }),
373
+ /* @__PURE__ */ L(ue, {
374
+ workspace: i,
375
+ doc: u,
376
+ team: h,
377
+ editor: O
378
+ })
379
+ ] }),
380
+ /* @__PURE__ */ L(Ue, {
358
381
  workspace: i,
359
- docKey: d.key
382
+ docKey: u.key
360
383
  }),
361
- /* @__PURE__ */ L(Be, {
384
+ /* @__PURE__ */ L(We, {
362
385
  workspace: i,
363
- docKey: d.key
386
+ docKey: u.key
364
387
  }),
365
- /* @__PURE__ */ L(Re, {
388
+ /* @__PURE__ */ L(He, {
366
389
  workspace: i,
367
- docKey: d.key
390
+ docKey: u.key
368
391
  }),
369
- /* @__PURE__ */ L(Ve, {
392
+ /* @__PURE__ */ L(Ke, {
370
393
  workspace: i,
371
- docKey: d.key
394
+ docKey: u.key
372
395
  })
373
396
  ]
374
- }), !$ && !X && /* @__PURE__ */ L(oe, {
375
- editor: k,
376
- scroller: I
397
+ }), !$ && !X && /* @__PURE__ */ L(se, {
398
+ body: u.body ?? "",
399
+ editor: O,
400
+ scroller: M
377
401
  })]
378
402
  })]
379
403
  }),
380
- U && /* @__PURE__ */ L(ee, {
404
+ U && /* @__PURE__ */ L(te, {
381
405
  workspace: i,
382
- doc: d,
383
- draft: qe,
406
+ doc: u,
407
+ draft: Qe,
384
408
  onDraftDone: () => G(void 0),
385
- onShowQuote: Qe
409
+ onShowQuote: rt
386
410
  }),
387
- Je && /* @__PURE__ */ L(ne, {
411
+ $e && /* @__PURE__ */ L(re, {
388
412
  workspace: i,
389
- doc: d,
413
+ doc: u,
390
414
  selected: X,
391
415
  onSelect: Z
392
416
  }),
393
- Ye && !$ && /* @__PURE__ */ L(pe, {
394
- editor: k,
417
+ et && !$ && /* @__PURE__ */ L(ge, {
418
+ editor: O,
395
419
  suggestions: z
396
420
  }),
397
- Xe && !$ && /* @__PURE__ */ L("aside", {
421
+ tt && !$ && /* @__PURE__ */ L("aside", {
398
422
  "aria-label": e("graph"),
399
423
  className: "w-96 shrink-0 overflow-y-auto border-l border-border px-3 py-4 max-md:hidden",
400
- children: /* @__PURE__ */ L(le, {
424
+ children: /* @__PURE__ */ L(fe, {
401
425
  workspace: i,
402
- of: { doc: d.key },
426
+ of: { doc: u.key },
403
427
  width: 352
404
428
  })
405
429
  })
@@ -407,7 +431,7 @@ function V() {
407
431
  })]
408
432
  });
409
433
  }
410
- function Fe({ doc: e, input: t, autoFocus: n, readOnly: r, onSave: i, onFocus: a, onBlur: o }) {
434
+ function ze({ doc: e, input: t, autoFocus: n, readOnly: r, onSave: i, onFocus: a, onBlur: o }) {
411
435
  let s = F("docs");
412
436
  return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("h1", {
413
437
  className: "sr-only",
@@ -423,15 +447,15 @@ function Fe({ doc: e, input: t, autoFocus: n, readOnly: r, onSave: i, onFocus: a
423
447
  "aria-label": s("docTitle")
424
448
  })] });
425
449
  }
426
- function Ie({ workspace: e, doc: t }) {
427
- let n = F("docs"), r = w(), { actorName: i, person: a, avatarOf: o } = S(e), s = i(t.editor);
450
+ function Be({ workspace: e, doc: t }) {
451
+ let n = F("docs"), r = T(), { actorName: i, person: a, avatarOf: o } = C(e), s = i(t.editor);
428
452
  return /* @__PURE__ */ R("p", {
429
453
  className: "flex items-center gap-1.5 text-xs text-muted-foreground",
430
- children: [/* @__PURE__ */ L(h, {
454
+ children: [/* @__PURE__ */ L(g, {
431
455
  workspace: e,
432
456
  kind: t.editor.kind,
433
457
  handle: t.editor.handle,
434
- children: /* @__PURE__ */ L(T, {
458
+ children: /* @__PURE__ */ L(Me, {
435
459
  kind: t.editor.kind === "agent" ? "agent" : "person",
436
460
  name: s,
437
461
  src: o(t.editor.kind, t.editor.handle),
@@ -451,15 +475,15 @@ function Ie({ workspace: e, doc: t }) {
451
475
  })]
452
476
  });
453
477
  }
454
- function Le({ workspace: e, doc: t, onEditor: n, onFocus: r, onBlur: i }) {
455
- let o = F("docs"), { data: s } = B(a), c = N(null), l = M(() => ({
456
- name: s?.user.name ?? o("someone"),
457
- color: g(s?.user.username ?? "")
478
+ function Ve({ workspace: e, doc: t, onEditor: n, onFocus: r, onBlur: i }) {
479
+ let a = F("docs"), { data: s } = B(o), c = N(null), l = M(() => ({
480
+ name: s?.user.name ?? a("someone"),
481
+ color: _(s?.user.username ?? "")
458
482
  }), [
459
483
  s?.user.name,
460
484
  s?.user.username,
461
- o
462
- ]), { session: u, error: ee } = _({
485
+ a
486
+ ]), { session: u, error: d } = v({
463
487
  workspace: e,
464
488
  target: { doc: t.key },
465
489
  user: l,
@@ -467,28 +491,28 @@ function Le({ workspace: e, doc: t, onEditor: n, onFocus: r, onBlur: i }) {
467
491
  });
468
492
  return /* @__PURE__ */ R("div", {
469
493
  className: "mt-6 min-h-48",
470
- children: [u ? /* @__PURE__ */ L(d, {
494
+ children: [u ? /* @__PURE__ */ L(ee, {
471
495
  session: u,
472
496
  user: l,
473
497
  getMarkdown: c,
474
498
  onEditor: n,
475
499
  onFocus: r,
476
500
  onBlur: i,
477
- placeholder: o("bodyPlaceholder"),
478
- label: o("body"),
501
+ placeholder: a("bodyPlaceholder"),
502
+ label: a("body"),
479
503
  className: "min-h-48"
480
504
  }, `${u.generation}:${u.doc.guid}`) : /* @__PURE__ */ L(p, {
481
505
  value: t.body ?? "",
482
506
  editable: !1,
483
507
  className: "min-h-48"
484
- }), /* @__PURE__ */ L(D, {
508
+ }), /* @__PURE__ */ L(Ne, {
485
509
  className: "mt-1",
486
- children: ee
510
+ children: d
487
511
  })]
488
512
  });
489
513
  }
490
- function Re({ workspace: e, docKey: t }) {
491
- let r = F("docs"), { data: i } = B(n(e, t)), a = A(), o = b(e);
514
+ function He({ workspace: e, docKey: t }) {
515
+ let r = F("docs"), { data: i } = B(n(e, t)), a = A(), o = x(e);
492
516
  return i.length === 0 ? null : /* @__PURE__ */ R("section", {
493
517
  className: "mt-10",
494
518
  "aria-label": r("linkedIssues"),
@@ -497,7 +521,7 @@ function Re({ workspace: e, docKey: t }) {
497
521
  children: r("linkedIssues")
498
522
  }), /* @__PURE__ */ L("ul", {
499
523
  className: "mt-2 space-y-0.5",
500
- children: i.map((t) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(C, {
524
+ children: i.map((t) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(w, {
501
525
  to: "/$workspace/issues/$identifier",
502
526
  params: {
503
527
  workspace: e,
@@ -506,7 +530,7 @@ function Re({ workspace: e, docKey: t }) {
506
530
  onContextMenu: (e) => a(e, o([t])),
507
531
  className: "flex h-8 items-center gap-2 rounded-md px-2 text-sm hover:bg-muted",
508
532
  children: [
509
- /* @__PURE__ */ L(m, {
533
+ /* @__PURE__ */ L(h, {
510
534
  category: t.status.category,
511
535
  review: t.status.review,
512
536
  step: t.status.step
@@ -524,8 +548,8 @@ function Re({ workspace: e, docKey: t }) {
524
548
  })]
525
549
  });
526
550
  }
527
- function ze({ workspace: e, docKey: t }) {
528
- let n = F("docs"), { data: r = [] } = z(i(e, t));
551
+ function Ue({ workspace: e, docKey: t }) {
552
+ let n = F("docs"), { data: r = [] } = z(a(e, t));
529
553
  return r.length === 0 ? null : /* @__PURE__ */ R("section", {
530
554
  className: "mt-10 rounded-lg border border-warning/60 px-4 py-3",
531
555
  "aria-label": n("lostSections"),
@@ -540,11 +564,11 @@ function ze({ workspace: e, docKey: t }) {
540
564
  }),
541
565
  /* @__PURE__ */ L("ul", {
542
566
  className: "mt-2 space-y-1 text-sm",
543
- children: r.map((t) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ L(C, {
567
+ children: r.map((t) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ L(w, {
544
568
  to: "/$workspace/knowledge/$term",
545
569
  params: {
546
570
  workspace: e,
547
- term: x(t)
571
+ term: S(t)
548
572
  },
549
573
  className: "hover:underline",
550
574
  children: n("lostSection", {
@@ -556,7 +580,7 @@ function ze({ workspace: e, docKey: t }) {
556
580
  ]
557
581
  });
558
582
  }
559
- function Be({ workspace: e, docKey: n }) {
583
+ function We({ workspace: e, docKey: n }) {
560
584
  let r = F("docs"), { data: i } = B(t(e, n)), a = i.filter((e) => !e.canceled);
561
585
  return a.length === 0 ? null : /* @__PURE__ */ R("section", {
562
586
  className: "mt-10 space-y-3",
@@ -564,19 +588,52 @@ function Be({ workspace: e, docKey: n }) {
564
588
  children: [/* @__PURE__ */ L("h2", {
565
589
  className: "text-sm font-semibold",
566
590
  children: r("questions")
567
- }), a.map((t) => t.answer ? /* @__PURE__ */ L(c, {
591
+ }), a.map((t) => t.answer ? /* @__PURE__ */ L(l, {
568
592
  workspace: e,
569
593
  decision: t,
570
594
  showIssue: !0
571
- }, t.id) : /* @__PURE__ */ L(l, {
595
+ }, t.id) : /* @__PURE__ */ L(u, {
572
596
  workspace: e,
573
597
  decision: t,
574
598
  showIssue: !0
575
599
  }, t.id))]
576
600
  });
577
601
  }
578
- function Ve({ workspace: t, docKey: n }) {
579
- let r = F("docs"), { data: i } = B(e(t, n)), a = A(), o = y(t), s = b(t), c = "flex h-8 items-center gap-2 rounded-md px-2 text-sm hover:bg-muted";
602
+ function Ge({ workspace: e, doc: t }) {
603
+ let n = F("docs"), r = A(), a = b(e), { data: o = [] } = z(i(e, { parent: t.key })), s = t.body ?? "";
604
+ if (s.includes(":::subpages")) return null;
605
+ let c = (e) => [
606
+ y(e),
607
+ e.slug,
608
+ e.key
609
+ ].some((e) => e && s.includes(`/docs/${e}`)), l = o.filter((e) => !e.template && !c(e));
610
+ return l.length === 0 ? null : /* @__PURE__ */ L("section", {
611
+ className: "mt-6",
612
+ "aria-label": n("childPages"),
613
+ children: /* @__PURE__ */ L("ul", {
614
+ className: "space-y-0.5",
615
+ children: l.map((t) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(w, {
616
+ to: "/$workspace/docs/$doc",
617
+ params: {
618
+ workspace: e,
619
+ doc: y(t)
620
+ },
621
+ onContextMenu: (e) => r(e, a(t)),
622
+ className: "flex h-8 items-center gap-2 rounded-md px-2 text-sm font-medium hover:bg-muted",
623
+ children: [/* @__PURE__ */ L(f, {
624
+ icon: t.icon,
625
+ className: "size-3.5",
626
+ emojiClassName: "text-xs"
627
+ }), /* @__PURE__ */ L("span", {
628
+ className: "truncate underline decoration-border underline-offset-4",
629
+ children: t.title
630
+ })]
631
+ }) }, t.id))
632
+ })
633
+ });
634
+ }
635
+ function Ke({ workspace: t, docKey: n }) {
636
+ let r = F("docs"), { data: i } = B(e(t, n)), a = A(), o = b(t), s = x(t), c = "flex h-8 items-center gap-2 rounded-md px-2 text-sm hover:bg-muted";
580
637
  return i.docs.length + i.issues.length + i.comments.length === 0 ? null : /* @__PURE__ */ R("section", {
581
638
  className: "mt-10",
582
639
  "aria-label": r("linkedFrom"),
@@ -586,11 +643,11 @@ function Ve({ workspace: t, docKey: n }) {
586
643
  }), /* @__PURE__ */ R("ul", {
587
644
  className: "mt-2 space-y-0.5",
588
645
  children: [
589
- i.docs.map((e) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(C, {
646
+ i.docs.map((e) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(w, {
590
647
  to: "/$workspace/docs/$doc",
591
648
  params: {
592
649
  workspace: t,
593
- doc: v(e)
650
+ doc: y(e)
594
651
  },
595
652
  onContextMenu: (t) => a(t, o(e)),
596
653
  className: c,
@@ -603,7 +660,7 @@ function Ve({ workspace: t, docKey: n }) {
603
660
  children: e.title
604
661
  })]
605
662
  }) }, e.id)),
606
- i.issues.map((e) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(C, {
663
+ i.issues.map((e) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(w, {
607
664
  to: "/$workspace/issues/$identifier",
608
665
  params: {
609
666
  workspace: t,
@@ -612,7 +669,7 @@ function Ve({ workspace: t, docKey: n }) {
612
669
  onContextMenu: (t) => a(t, s([e])),
613
670
  className: c,
614
671
  children: [
615
- /* @__PURE__ */ L(m, {
672
+ /* @__PURE__ */ L(h, {
616
673
  category: e.status.category,
617
674
  review: e.status.review,
618
675
  step: e.status.step
@@ -627,7 +684,7 @@ function Ve({ workspace: t, docKey: n }) {
627
684
  })
628
685
  ]
629
686
  }) }, e.id)),
630
- i.comments.map((e) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(C, {
687
+ i.comments.map((e) => /* @__PURE__ */ L("li", { children: /* @__PURE__ */ R(w, {
631
688
  to: "/$workspace/issues/$identifier",
632
689
  params: {
633
690
  workspace: t,
@@ -636,7 +693,7 @@ function Ve({ workspace: t, docKey: n }) {
636
693
  hash: `comment-${e.comment.id}`,
637
694
  className: c,
638
695
  children: [
639
- /* @__PURE__ */ L(ue, { className: "size-3.5 text-muted-foreground" }),
696
+ /* @__PURE__ */ L(m, { className: "size-3.5 text-muted-foreground" }),
640
697
  /* @__PURE__ */ L("span", {
641
698
  className: "shrink-0 text-muted-foreground",
642
699
  children: r("commentOn", { identifier: e.identifier })
@@ -651,9 +708,9 @@ function Ve({ workspace: t, docKey: n }) {
651
708
  })]
652
709
  });
653
710
  }
654
- function He({ workspace: e, doc: t, path: n, space: r }) {
711
+ function qe({ workspace: e, doc: t, path: n, space: r }) {
655
712
  let i = F("docs");
656
- return /* @__PURE__ */ L(ke, {
713
+ return /* @__PURE__ */ L(E, {
657
714
  label: i("breadcrumbs"),
658
715
  className: "min-w-0",
659
716
  crumbs: [
@@ -664,7 +721,7 @@ function He({ workspace: e, doc: t, path: n, space: r }) {
664
721
  { label: r },
665
722
  ...n.map((t) => ({
666
723
  label: t.title,
667
- href: `/${e}/docs/${v(t)}`,
724
+ href: `/${e}/docs/${y(t)}`,
668
725
  icon: t.icon && /* @__PURE__ */ L(f, {
669
726
  icon: t.icon,
670
727
  className: "size-3.5",
@@ -682,7 +739,7 @@ function He({ workspace: e, doc: t, path: n, space: r }) {
682
739
  ]
683
740
  });
684
741
  }
685
- function Ue({ count: e }) {
742
+ function Je({ count: e }) {
686
743
  return e <= 0 ? null : /* @__PURE__ */ L("span", {
687
744
  "aria-hidden": !0,
688
745
  className: "pointer-events-none absolute -top-1.5 -right-1.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold text-primary-foreground tabular-nums",