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