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