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