@parallelworks/tandem-web 0.185.0 → 0.186.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.
@@ -7,23 +7,24 @@ import { openShare as _ } from "../lib/share.js";
7
7
  import { teamPath as v } from "../lib/teamPaths.js";
8
8
  import { DocIcon as y } from "./DocIcon.js";
9
9
  import { EntityIcon as b } from "./EntityIcon.js";
10
- import { AddIcon as ee, ChevronRightIcon as x, FileTextIcon as te, SearchIcon as S } from "./icons.js";
11
- import { useMarkdownTransfer as ne } from "./MarkdownTransfer.js";
12
- import { Combobox as C, IconButton as w, RelativeTime as re, SearchInput as ie, Tooltip as T, buttonClasses as ae, menuDivider as E, useOpenMenu as D } from "@parallelworks/ui";
13
- import { useEffect as O, useRef as oe, useState as k, useSyncExternalStore as se } from "react";
10
+ import { FavoriteStar as ee } from "./FavoriteStar.js";
11
+ import { AddIcon as te, ChevronRightIcon as x, FileTextIcon as S, SearchIcon as ne } from "./icons.js";
12
+ import { useMarkdownTransfer as C } from "./MarkdownTransfer.js";
13
+ import { Combobox as re, IconButton as w, RelativeTime as T, SearchInput as ie, Tooltip as E, buttonClasses as ae, menuDivider as oe, useOpenMenu as D } from "@parallelworks/ui";
14
+ import { useEffect as O, useRef as se, useState as k, useSyncExternalStore as ce } from "react";
14
15
  import { useTranslations as A } from "use-intl";
15
- import { Fragment as ce, jsx as j, jsxs as M } from "react/jsx-runtime";
16
- import { keepPreviousData as N, useQuery as P, useSuspenseQuery as le } from "@tanstack/react-query";
16
+ import { Fragment as le, jsx as j, jsxs as M } from "react/jsx-runtime";
17
+ import { keepPreviousData as N, useQuery as P, useSuspenseQuery as ue } from "@tanstack/react-query";
17
18
  import { MoreButton as F } from "@parallelworks/ui/list";
18
19
  // src/components/DocsTree.tsx
19
- var I = "application/x-tandem-doc", L = (...e) => e.filter(Boolean).join(" "), R = "flex items-start gap-0.5 rounded-md text-sm text-muted-foreground hover:bg-muted hover:text-foreground", z = "bg-muted font-medium !text-foreground", ue = [
20
+ var de = "application/x-tandem-doc", I = (...e) => e.filter(Boolean).join(" "), fe = "flex items-start gap-0.5 rounded-md text-sm text-muted-foreground hover:bg-muted hover:text-foreground", L = "bg-muted font-medium !text-foreground", pe = [
20
21
  "pl-3.5",
21
22
  "pl-6",
22
23
  "pl-8.5",
23
24
  "pl-11",
24
25
  "pl-13.5",
25
26
  "pl-16"
26
- ], B = "focus-visible:opacity-100 aria-pressed:opacity-100 pointer-fine:opacity-0 pointer-fine:group-hover:opacity-100", V = "mt-1 flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-border hover:text-foreground", H = 50, U = 2e3, W = (() => {
27
+ ], R = "focus-visible:opacity-100 aria-pressed:opacity-100 pointer-fine:opacity-0 pointer-fine:group-hover:opacity-100", z = "mt-1 flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-border hover:text-foreground", B = 50, V = 2e3, H = (() => {
27
28
  let e = {
28
29
  doc: void 0,
29
30
  over: void 0
@@ -44,75 +45,75 @@ var I = "application/x-tandem-doc", L = (...e) => e.filter(Boolean).join(" "), R
44
45
  }
45
46
  };
46
47
  })();
47
- function G(e) {
48
+ function U(e) {
48
49
  let t = e.currentTarget.getBoundingClientRect(), n = (e.clientY - t.top) / t.height;
49
50
  return n < .25 ? "before" : n > .75 ? "after" : "inside";
50
51
  }
51
- var K = {
52
+ var W = {
52
53
  before: "relative before:absolute before:inset-x-1 before:-top-px before:h-0.5 before:rounded before:bg-primary",
53
54
  after: "relative after:absolute after:inset-x-1 after:-bottom-px after:h-0.5 after:rounded after:bg-primary",
54
55
  inside: "ring-2 ring-primary ring-inset"
55
56
  };
56
- function de({ workspace: t, current: c, page: m = !1, onIndex: _ = !1, menu: v }) {
57
- let y = A("docs"), { data: re } = le(r(t)), { data: T } = le(i(t)), { data: E = [] } = P(n(t, { top: !0 })), { data: N } = P({
57
+ function G({ workspace: t, current: c, page: m = !1, onIndex: _ = !1, menu: v }) {
58
+ let y = A("docs"), { data: T } = ue(r(t)), { data: E } = ue(i(t)), { data: oe = [] } = P(n(t, { top: !0 })), { data: N } = P({
58
59
  ...e(t, c ?? ""),
59
60
  enabled: !!c
60
- }), F = N?.key ?? c, I = D(), R = s(t), ue = g(), V = o(t), H = ne(t), [U, G] = k(!1), [K, de] = k(""), [q, pe] = k(""), [J, ge] = k(!1), [Y, X] = k(() => d(t)), { doc: Z, over: _e } = se(W.subscribe, W.get), ve = oe(null);
61
+ }), F = N?.key ?? c, de = D(), fe = s(t), pe = g(), z = o(t), B = C(t), [V, U] = k(!1), [W, G] = k(""), [K, he] = k(""), [q, ve] = k(!1), [J, Y] = k(() => d(t)), { doc: X, over: Z } = ce(H.subscribe, H.get), ye = se(null);
61
62
  O(() => {
62
- let e = setTimeout(() => pe(K.trim()), 200);
63
+ let e = setTimeout(() => he(W.trim()), 200);
63
64
  return () => clearTimeout(e);
64
- }, [K]), O(() => {
65
- U && ve.current?.focus();
66
- }, [U]), O(() => u(t, Y), [t, Y]);
67
- let Q = re.filter((e) => !e.archivedAt), ye = N ? f(N) : "", be = (N ? (N.ancestors ?? []).map((e) => e.id) : []).join(" ");
65
+ }, [W]), O(() => {
66
+ V && ye.current?.focus();
67
+ }, [V]), O(() => u(t, J), [t, J]);
68
+ let Q = T.filter((e) => !e.archivedAt), be = N ? f(N) : "", xe = (N ? (N.ancestors ?? []).map((e) => e.id) : []).join(" ");
68
69
  O(() => {
69
- ye && X((e) => l(e, ye, be ? be.split(" ") : []));
70
- }, [ye, be]);
71
- let $ = !m && Y.collapsed && !U, xe = {
72
- over: _e,
73
- start: (e) => W.set({ doc: e }),
74
- end: () => W.set({
70
+ be && Y((e) => l(e, be, xe ? xe.split(" ") : []));
71
+ }, [be, xe]);
72
+ let $ = !m && J.collapsed && !V, Se = {
73
+ over: Z,
74
+ start: (e) => H.set({ doc: e }),
75
+ end: () => H.set({
75
76
  doc: void 0,
76
77
  over: void 0
77
78
  }),
78
- accepts: (e, t) => !!Z && e.id !== Z.id && !t.includes(Z.id),
79
+ accepts: (e, t) => !!X && e.id !== X.id && !t.includes(X.id),
79
80
  hover: (e, t) => {
80
- (_e?.id !== e || _e.spot !== t) && W.set({ over: {
81
+ (Z?.id !== e || Z.spot !== t) && H.set({ over: {
81
82
  id: e,
82
83
  spot: t
83
84
  } });
84
85
  },
85
86
  drop: (e, t, n) => {
86
- if (Z) {
87
- if (t === "inside") V.move.mutate({
88
- doc: Z,
87
+ if (X) {
88
+ if (t === "inside") z.move.mutate({
89
+ doc: X,
89
90
  parent: e
90
- }), X((t) => t.open.includes(e.id) ? t : p(t, e.id));
91
+ }), Y((t) => t.open.includes(e.id) ? t : p(t, e.id));
91
92
  else {
92
93
  let r = Q.find((t) => t.id === e.teamId);
93
- V.move.mutate({
94
- doc: Z,
94
+ z.move.mutate({
95
+ doc: X,
95
96
  ...n ? { parent: n } : { space: r?.key ?? "workspace" },
96
97
  ...t === "before" ? { before: e } : { after: e }
97
98
  });
98
99
  }
99
- xe.end();
100
+ Se.end();
100
101
  }
101
102
  },
102
103
  dropInSpace: (e, t) => {
103
- Z && V.move.mutate({
104
- doc: Z,
104
+ X && z.move.mutate({
105
+ doc: X,
105
106
  space: t?.key ?? e
106
- }), xe.end();
107
+ }), Se.end();
107
108
  }
108
- }, Se = {
109
- drag: xe,
110
- transfer: H,
109
+ }, Ce = {
110
+ drag: Se,
111
+ transfer: B,
111
112
  workspace: t,
112
- open: new Set(Y.open),
113
+ open: new Set(J.open),
113
114
  current: F,
114
- toggle: (e) => X((t) => p(t, e)),
115
- menu: (e) => R(e, { onRename: () => ue({
115
+ toggle: (e) => Y((t) => p(t, e)),
116
+ menu: (e) => fe(e, { onRename: () => pe({
116
117
  to: "/$workspace/docs/$doc",
117
118
  params: {
118
119
  workspace: t,
@@ -120,123 +121,132 @@ function de({ workspace: t, current: c, page: m = !1, onIndex: _ = !1, menu: v }
120
121
  },
121
122
  search: { rename: !0 }
122
123
  }) })
123
- }, Ce = /* @__PURE__ */ M(ce, { children: [/* @__PURE__ */ j(w, {
124
+ }, we = /* @__PURE__ */ M(le, { children: [/* @__PURE__ */ j(w, {
124
125
  variant: "ghost",
125
126
  size: "xs",
126
- icon: /* @__PURE__ */ j(S, {}),
127
+ icon: /* @__PURE__ */ j(ne, {}),
127
128
  label: y("search"),
128
- pressed: U,
129
+ pressed: V,
129
130
  onClick: () => {
130
- G((e) => !e), de("");
131
+ U((e) => !e), G("");
131
132
  },
132
- className: m ? "" : B
133
+ className: m ? "" : R
133
134
  }), Q.length === 0 ? /* @__PURE__ */ j(w, {
134
135
  variant: "ghost",
135
136
  size: "xs",
136
- icon: /* @__PURE__ */ j(ee, {}),
137
+ icon: /* @__PURE__ */ j(te, {}),
137
138
  label: y("new"),
138
- onClick: () => V.create.mutate({}),
139
- disabled: V.create.isPending,
140
- className: m ? "" : B
141
- }) : /* @__PURE__ */ j(C, {
139
+ onClick: () => z.create.mutate({}),
140
+ disabled: z.create.isPending,
141
+ className: m ? "" : R
142
+ }) : /* @__PURE__ */ j(re, {
142
143
  items: [{
143
144
  value: "",
144
- label: T.name
145
+ label: E.name
145
146
  }, ...Q.map((e) => ({
146
147
  value: e.key,
147
148
  label: e.name,
148
149
  hint: e.key
149
150
  }))],
150
151
  value: null,
151
- onValueChange: (e) => e !== null && V.create.mutate({ team: e || void 0 }),
152
+ onValueChange: (e) => e !== null && z.create.mutate({ team: e || void 0 }),
152
153
  placeholder: y("chooseTeam"),
153
154
  "aria-label": y("new"),
154
155
  align: "end",
155
156
  triggerTooltip: y("new"),
156
157
  trigger: /* @__PURE__ */ j("button", {
157
158
  type: "button",
158
- disabled: V.create.isPending,
159
+ disabled: z.create.isPending,
159
160
  "aria-label": y("new"),
160
- className: L(ae({
161
+ className: I(ae({
161
162
  variant: "ghost",
162
163
  size: "xs",
163
164
  iconOnly: !0
164
- }), !m && B),
165
- children: /* @__PURE__ */ j(ee, {})
165
+ }), !m && R),
166
+ children: /* @__PURE__ */ j(te, {})
166
167
  })
167
168
  })] });
168
169
  return /* @__PURE__ */ M("section", {
169
170
  "aria-label": y("title"),
170
- className: L(m && "flex min-h-0 flex-1 flex-col"),
171
+ className: I(m && "flex min-h-0 flex-1 flex-col"),
171
172
  children: [
172
173
  m ? /* @__PURE__ */ M("div", {
173
174
  className: "flex h-9 shrink-0 items-center gap-1 px-2",
174
- children: [/* @__PURE__ */ j("h1", {
175
- className: "flex-1 text-sm font-semibold",
176
- children: y("title")
177
- }), Ce]
175
+ children: [
176
+ /* @__PURE__ */ j("h1", {
177
+ className: "text-sm font-semibold",
178
+ children: y("title")
179
+ }),
180
+ /* @__PURE__ */ j(ee, {
181
+ workspace: t,
182
+ kind: "page",
183
+ target: "docs"
184
+ }),
185
+ /* @__PURE__ */ j("span", { className: "flex-1" }),
186
+ we
187
+ ]
178
188
  }) : /* @__PURE__ */ M("div", {
179
- className: L("group flex h-8 items-center gap-0.5 rounded-md pr-1 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", _ && z),
189
+ className: I("group flex h-8 items-center gap-0.5 rounded-md pr-1 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", _ && L),
180
190
  children: [
181
191
  /* @__PURE__ */ M(h, {
182
192
  to: "/$workspace/docs",
183
193
  params: { workspace: t },
184
- onContextMenu: v ? (e) => I(e, v) : void 0,
194
+ onContextMenu: v ? (e) => de(e, v) : void 0,
185
195
  activeOptions: { exact: !0 },
186
196
  className: "flex h-full min-w-0 flex-1 items-center gap-2.5 pl-2",
187
- children: [/* @__PURE__ */ j(te, { className: "size-4" }), /* @__PURE__ */ j("span", {
197
+ children: [/* @__PURE__ */ j(S, { className: "size-4" }), /* @__PURE__ */ j("span", {
188
198
  className: "truncate",
189
199
  children: y("title")
190
200
  })]
191
201
  }),
192
- Ce,
202
+ we,
193
203
  /* @__PURE__ */ j(w, {
194
204
  variant: "ghost",
195
205
  size: "xs",
196
- icon: /* @__PURE__ */ j(x, { className: L(!$ && "rotate-90") }),
206
+ icon: /* @__PURE__ */ j(x, { className: I(!$ && "rotate-90") }),
197
207
  label: y($ ? "expand" : "collapse"),
198
208
  "aria-expanded": !$,
199
- onClick: () => X((e) => ({
209
+ onClick: () => Y((e) => ({
200
210
  ...e,
201
211
  collapsed: !e.collapsed
202
212
  }))
203
213
  })
204
214
  ]
205
215
  }),
206
- U && /* @__PURE__ */ j("div", {
216
+ V && /* @__PURE__ */ j("div", {
207
217
  className: "px-1 py-1",
208
218
  children: /* @__PURE__ */ j(ie, {
209
- ref: ve,
210
- value: K,
211
- onValueChange: de,
212
- onKeyDown: (e) => e.key === "Escape" && !K && G(!1),
219
+ ref: ye,
220
+ value: W,
221
+ onValueChange: G,
222
+ onKeyDown: (e) => e.key === "Escape" && !W && U(!1),
213
223
  placeholder: y("search"),
214
224
  label: y("search"),
215
225
  size: "sm"
216
226
  })
217
227
  }),
218
228
  !$ && /* @__PURE__ */ j("div", {
219
- className: L("pt-1", m && "min-h-0 flex-1 overflow-y-auto pb-3"),
220
- children: q ? /* @__PURE__ */ j(me, {
229
+ className: I("pt-1", m && "min-h-0 flex-1 overflow-y-auto pb-3"),
230
+ children: K ? /* @__PURE__ */ j(ge, {
221
231
  workspace: t,
222
- query: q,
232
+ query: K,
223
233
  current: F
224
- }, q) : /* @__PURE__ */ M(ce, { children: [
225
- /* @__PURE__ */ j(fe, {
226
- ctx: Se,
234
+ }, K) : /* @__PURE__ */ M(le, { children: [
235
+ /* @__PURE__ */ j(me, {
236
+ ctx: Ce,
227
237
  id: "workspace",
228
- name: T.name,
238
+ name: E.name,
229
239
  icon: /* @__PURE__ */ j(b, {
230
- icon: T.icon,
231
- color: T.color,
232
- name: T.name
240
+ icon: E.icon,
241
+ color: E.color,
242
+ name: E.name
233
243
  }),
234
- docs: E.filter((e) => !e.teamId),
235
- closed: Y.closedSpaces.includes("workspace"),
236
- onToggle: () => X((e) => p(e, "workspace", !0))
244
+ docs: oe.filter((e) => !e.teamId),
245
+ closed: J.closedSpaces.includes("workspace"),
246
+ onToggle: () => Y((e) => p(e, "workspace", !0))
237
247
  }),
238
- Q.map((e) => /* @__PURE__ */ j(fe, {
239
- ctx: Se,
248
+ Q.map((e) => /* @__PURE__ */ j(me, {
249
+ ctx: Ce,
240
250
  id: e.id,
241
251
  team: e,
242
252
  name: e.name,
@@ -245,32 +255,32 @@ function de({ workspace: t, current: c, page: m = !1, onIndex: _ = !1, menu: v }
245
255
  color: e.color,
246
256
  name: e.name
247
257
  }),
248
- docs: E.filter((t) => t.teamId === e.id),
249
- closed: Y.closedSpaces.includes(e.id),
250
- onToggle: () => X((t) => p(t, e.id, !0))
258
+ docs: oe.filter((t) => t.teamId === e.id),
259
+ closed: J.closedSpaces.includes(e.id),
260
+ onToggle: () => Y((t) => p(t, e.id, !0))
251
261
  }, e.id)),
252
262
  /* @__PURE__ */ M("button", {
253
263
  type: "button",
254
- onClick: () => ge((e) => !e),
255
- "aria-expanded": J,
264
+ onClick: () => ve((e) => !e),
265
+ "aria-expanded": q,
256
266
  className: "mt-1 flex h-7 w-full items-center gap-0.5 rounded-md pl-1 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground",
257
267
  children: [/* @__PURE__ */ j("span", {
258
268
  className: "flex size-5 items-center justify-center",
259
- children: /* @__PURE__ */ j(x, { className: L("size-3", J && "rotate-90") })
269
+ children: /* @__PURE__ */ j(x, { className: I("size-3", q && "rotate-90") })
260
270
  }), y("archived")]
261
271
  }),
262
- J && /* @__PURE__ */ j(he, {
272
+ q && /* @__PURE__ */ j(_e, {
263
273
  workspace: t,
264
274
  current: F
265
275
  })
266
276
  ] })
267
277
  }),
268
- H.dialog
278
+ B.dialog
269
279
  ]
270
280
  });
271
281
  }
272
- function fe({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onToggle: l }) {
273
- let u = A("docs"), d = A("common"), f = D(), p = o(e.workspace), h = m(), y = g(), b = e.workspace, { data: te = [] } = P(t(b)), S = `docs-space-${n}`, ne = A("docViews"), C = () => [
282
+ function me({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onToggle: l }) {
283
+ let u = A("docs"), d = A("common"), f = D(), p = o(e.workspace), h = m(), y = g(), b = e.workspace, { data: ee = [] } = P(t(b)), S = `docs-space-${n}`, ne = A("docViews"), C = () => [
274
284
  {
275
285
  label: u("newInSpace"),
276
286
  onClick: () => p.create.mutate({ team: r?.key })
@@ -287,7 +297,7 @@ function fe({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onTo
287
297
  },
288
298
  {
289
299
  label: u("newFromTemplate"),
290
- items: te.map((e) => ({
300
+ items: ee.map((e) => ({
291
301
  label: e.title,
292
302
  onClick: () => p.create.mutate({
293
303
  team: r?.key,
@@ -325,14 +335,14 @@ function fe({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onTo
325
335
  }
326
336
  })
327
337
  },
328
- E,
338
+ oe,
329
339
  ...h(v(b, r.key, "issues"))
330
340
  ] : []
331
341
  ], re = (t) => {
332
- t.dataTransfer.types.includes(I) && (t.preventDefault(), e.drag.hover(`space-${n}`, "inside"));
333
- }, ie = (t) => {
342
+ t.dataTransfer.types.includes(de) && (t.preventDefault(), e.drag.hover(`space-${n}`, "inside"));
343
+ }, T = (t) => {
334
344
  t.preventDefault(), e.drag.dropInSpace("workspace", r);
335
- }, ae = s.length > 0 ? /* @__PURE__ */ j(q, {
345
+ }, ie = s.length > 0 ? /* @__PURE__ */ j(K, {
336
346
  ctx: e,
337
347
  id: S,
338
348
  docs: s,
@@ -344,26 +354,26 @@ function fe({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onTo
344
354
  id: S,
345
355
  className: "py-1 pl-9 text-xs text-muted-foreground",
346
356
  children: u("emptyTeam")
347
- }), O = /* @__PURE__ */ j(w, {
357
+ }), ae = /* @__PURE__ */ j(w, {
348
358
  variant: "ghost",
349
359
  size: "xs",
350
- icon: /* @__PURE__ */ j(ee, {}),
360
+ icon: /* @__PURE__ */ j(te, {}),
351
361
  label: u("newInTeamNamed", { team: r?.name ?? i }),
352
362
  onClick: () => p.create.mutate({ team: r?.key }),
353
- className: B
354
- }), oe = /* @__PURE__ */ j(F, {
363
+ className: R
364
+ }), O = /* @__PURE__ */ j(F, {
355
365
  items: C,
356
366
  label: d("moreActionsFor", { name: r?.name ?? i })
357
367
  });
358
368
  return /* @__PURE__ */ M("div", {
359
369
  className: "mb-1",
360
370
  children: [/* @__PURE__ */ M("div", {
361
- className: L("group flex h-7 items-center gap-0.5 rounded-md pr-1 pl-1 hover:bg-muted", e.drag.over?.id === `space-${n}` && K.inside),
371
+ className: I("group flex h-7 items-center gap-0.5 rounded-md pr-1 pl-1 hover:bg-muted", e.drag.over?.id === `space-${n}` && W.inside),
362
372
  onContextMenu: (e) => f(e, C()),
363
373
  onDragOver: re,
364
- onDrop: ie,
374
+ onDrop: T,
365
375
  children: [
366
- /* @__PURE__ */ j(T, {
376
+ /* @__PURE__ */ j(E, {
367
377
  content: u(c ? "expand" : "collapse"),
368
378
  children: /* @__PURE__ */ M("button", {
369
379
  type: "button",
@@ -374,7 +384,7 @@ function fe({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onTo
374
384
  children: [
375
385
  /* @__PURE__ */ j("span", {
376
386
  className: "flex size-5 shrink-0 items-center justify-center",
377
- children: /* @__PURE__ */ j(x, { className: L("size-3", !c && "rotate-90") })
387
+ children: /* @__PURE__ */ j(x, { className: I("size-3", !c && "rotate-90") })
378
388
  }),
379
389
  a,
380
390
  /* @__PURE__ */ j("span", {
@@ -384,18 +394,18 @@ function fe({ ctx: e, id: n, team: r, name: i, icon: a, docs: s, closed: c, onTo
384
394
  ]
385
395
  })
386
396
  }),
387
- oe,
388
- O
397
+ O,
398
+ ae
389
399
  ]
390
- }), !c && ae]
400
+ }), !c && ie]
391
401
  });
392
402
  }
393
- function q({ ctx: e, id: t, docs: n, depth: r, trail: i, parent: a, above: o, label: s }) {
403
+ function K({ ctx: e, id: t, docs: n, depth: r, trail: i, parent: a, above: o, label: s }) {
394
404
  return /* @__PURE__ */ j("ul", {
395
405
  id: t,
396
406
  "aria-label": s,
397
407
  className: "space-y-px",
398
- children: n.map((t) => /* @__PURE__ */ j(pe, {
408
+ children: n.map((t) => /* @__PURE__ */ j(he, {
399
409
  ctx: e,
400
410
  doc: t,
401
411
  depth: r,
@@ -405,11 +415,11 @@ function q({ ctx: e, id: t, docs: n, depth: r, trail: i, parent: a, above: o, la
405
415
  }, t.id))
406
416
  });
407
417
  }
408
- function pe({ ctx: e, doc: t, depth: r, trail: i, parent: o, above: s }) {
418
+ function he({ ctx: e, doc: t, depth: r, trail: i, parent: o, above: s }) {
409
419
  let l = A("docs"), u = A("common"), d = D(), f = t.children > 0 && e.open.has(t.id), { data: p = [] } = P({
410
420
  ...n(e.workspace, { parent: t.key }),
411
421
  enabled: f
412
- }), m = e.current === t.key, g = oe(null);
422
+ }), m = e.current === t.key, g = se(null);
413
423
  O(() => {
414
424
  m && g.current?.scrollIntoView({ block: "nearest" });
415
425
  }, [m]);
@@ -418,20 +428,20 @@ function pe({ ctx: e, doc: t, depth: r, trail: i, parent: o, above: s }) {
418
428
  title: t.title
419
429
  }), v = `docs-tree-${t.id}`;
420
430
  return /* @__PURE__ */ M("li", { children: [/* @__PURE__ */ M("div", {
421
- className: L(R, "group", ue[c(r)], m && z, e.drag.over?.id === t.id && K[e.drag.over.spot]),
431
+ className: I(fe, "group", pe[c(r)], m && L, e.drag.over?.id === t.id && W[e.drag.over.spot]),
422
432
  draggable: !0,
423
433
  onDragStart: (n) => {
424
- n.dataTransfer.effectAllowed = "move", n.dataTransfer.setData(I, t.key), e.drag.start(t);
434
+ n.dataTransfer.effectAllowed = "move", n.dataTransfer.setData(de, t.key), e.drag.start(t);
425
435
  },
426
436
  onDragEnd: e.drag.end,
427
437
  onDragOver: (n) => {
428
- e.drag.accepts(t, s) && (n.preventDefault(), n.dataTransfer.dropEffect = "move", e.drag.hover(t.id, G(n)));
438
+ e.drag.accepts(t, s) && (n.preventDefault(), n.dataTransfer.dropEffect = "move", e.drag.hover(t.id, U(n)));
429
439
  },
430
440
  onDrop: (n) => {
431
- n.preventDefault(), e.drag.drop(t, G(n), o);
441
+ n.preventDefault(), e.drag.drop(t, U(n), o);
432
442
  },
433
443
  children: [
434
- t.children > 0 ? /* @__PURE__ */ j(T, {
444
+ t.children > 0 ? /* @__PURE__ */ j(E, {
435
445
  content: l(f ? "collapse" : "expand"),
436
446
  children: /* @__PURE__ */ j("button", {
437
447
  type: "button",
@@ -439,11 +449,11 @@ function pe({ ctx: e, doc: t, depth: r, trail: i, parent: o, above: s }) {
439
449
  "aria-expanded": f,
440
450
  "aria-controls": f ? v : void 0,
441
451
  "aria-label": l("inside", { title: t.title }),
442
- className: V,
443
- children: /* @__PURE__ */ j(x, { className: L("size-3", f && "rotate-90") })
452
+ className: z,
453
+ children: /* @__PURE__ */ j(x, { className: I("size-3", f && "rotate-90") })
444
454
  })
445
455
  }) : /* @__PURE__ */ j("span", { className: "size-5 shrink-0" }),
446
- /* @__PURE__ */ j(T, {
456
+ /* @__PURE__ */ j(E, {
447
457
  content: _,
448
458
  children: /* @__PURE__ */ M(h, {
449
459
  to: "/$workspace/docs/$doc",
@@ -475,7 +485,7 @@ function pe({ ctx: e, doc: t, depth: r, trail: i, parent: o, above: s }) {
475
485
  className: "mt-0.5 mr-0.5"
476
486
  })
477
487
  ]
478
- }), f && p.length > 0 && /* @__PURE__ */ j(q, {
488
+ }), f && p.length > 0 && /* @__PURE__ */ j(K, {
479
489
  ctx: e,
480
490
  id: v,
481
491
  docs: p,
@@ -486,8 +496,8 @@ function pe({ ctx: e, doc: t, depth: r, trail: i, parent: o, above: s }) {
486
496
  label: l("inside", { title: t.title })
487
497
  })] });
488
498
  }
489
- function me({ workspace: e, query: t, current: i }) {
490
- let o = A("docs"), c = D(), l = s(e), { data: u = [] } = P(r(e)), [d, f] = k(H), { data: p, isPending: m } = P({
499
+ function ge({ workspace: e, query: t, current: i }) {
500
+ let o = A("docs"), c = D(), l = s(e), { data: u = [] } = P(r(e)), [d, f] = k(B), { data: p, isPending: m } = P({
491
501
  ...n(e, {
492
502
  q: t,
493
503
  limit: d
@@ -508,7 +518,7 @@ function me({ workspace: e, query: t, current: i }) {
508
518
  },
509
519
  onContextMenu: (e) => c(e, l(t)),
510
520
  "aria-current": i === t.key ? "page" : void 0,
511
- className: L("block rounded-md px-2 py-1.5 text-sm hover:bg-muted", i === t.key && "bg-muted"),
521
+ className: I("block rounded-md px-2 py-1.5 text-sm hover:bg-muted", i === t.key && "bg-muted"),
512
522
  children: [/* @__PURE__ */ M("span", {
513
523
  className: "flex items-center gap-2 font-medium",
514
524
  children: [
@@ -526,10 +536,10 @@ function me({ workspace: e, query: t, current: i }) {
526
536
  children: u.find((e) => e.id === t.teamId)?.key ?? o("workspaceShort")
527
537
  })
528
538
  ]
529
- }), t.snippet && /* @__PURE__ */ j(J, { text: t.snippet })]
530
- }) }, t.id)), p.length === d && d < U && /* @__PURE__ */ j("li", { children: /* @__PURE__ */ j("button", {
539
+ }), t.snippet && /* @__PURE__ */ j(q, { text: t.snippet })]
540
+ }) }, t.id)), p.length === d && d < V && /* @__PURE__ */ j("li", { children: /* @__PURE__ */ j("button", {
531
541
  type: "button",
532
- onClick: () => f((e) => Math.min(e + H, U)),
542
+ onClick: () => f((e) => Math.min(e + B, V)),
533
543
  className: "w-full rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-muted hover:text-foreground",
534
544
  children: o("moreResults")
535
545
  }) })]
@@ -538,7 +548,7 @@ function me({ workspace: e, query: t, current: i }) {
538
548
  children: o("noResults")
539
549
  });
540
550
  }
541
- function J({ text: e }) {
551
+ function q({ text: e }) {
542
552
  let t = e.split("**");
543
553
  return /* @__PURE__ */ j("span", {
544
554
  className: "mt-0.5 line-clamp-2 text-xs text-muted-foreground",
@@ -548,7 +558,7 @@ function J({ text: e }) {
548
558
  }, t) : /* @__PURE__ */ j("span", { children: e }, t))
549
559
  });
550
560
  }
551
- function he({ workspace: e, current: t }) {
561
+ function _e({ workspace: e, current: t }) {
552
562
  let r = A("docs"), i = D(), o = s(e), { data: c, isPending: l } = P(n(e, { archived: !0 }));
553
563
  return l ? null : c?.length ? /* @__PURE__ */ j("ul", {
554
564
  className: "space-y-px",
@@ -561,7 +571,7 @@ function he({ workspace: e, current: t }) {
561
571
  },
562
572
  onContextMenu: (e) => i(e, o(n)),
563
573
  "aria-current": t === n.key ? "page" : void 0,
564
- className: L(R, "items-center gap-1.5 py-1 pr-1 pl-2", t === n.key && z),
574
+ className: I(fe, "items-center gap-1.5 py-1 pr-1 pl-2", t === n.key && L),
565
575
  children: [
566
576
  /* @__PURE__ */ j(y, {
567
577
  icon: n.icon,
@@ -572,7 +582,7 @@ function he({ workspace: e, current: t }) {
572
582
  className: "min-w-0 flex-1 truncate",
573
583
  children: n.title
574
584
  }),
575
- n.archivedAt && /* @__PURE__ */ j(re, {
585
+ n.archivedAt && /* @__PURE__ */ j(T, {
576
586
  value: n.archivedAt,
577
587
  format: "compact",
578
588
  exact: "medium",
@@ -585,4 +595,4 @@ function he({ workspace: e, current: t }) {
585
595
  children: r("noArchived")
586
596
  });
587
597
  }
588
- export { de as DocsTree };
598
+ export { G as DocsTree };
@@ -15,4 +15,16 @@ function o({ workspace: o, kind: s, target: c, label: l }) {
15
15
  onClick: () => d(s, c, l)
16
16
  });
17
17
  }
18
- export { o as FavoriteStar };
18
+ function s({ workspace: e, page: t, team: n }) {
19
+ return n ? /* @__PURE__ */ r(o, {
20
+ workspace: e,
21
+ kind: "view",
22
+ target: n.href,
23
+ label: n.label
24
+ }) : /* @__PURE__ */ r(o, {
25
+ workspace: e,
26
+ kind: "page",
27
+ target: t
28
+ });
29
+ }
30
+ export { o as FavoriteStar, s as ListFavoriteStar };