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