@parallelworks/tandem-web 0.184.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.
- package/_virtual/_virtual_i18n/en/common.js +10 -1
- package/_virtual/_virtual_i18n/es/common.js +10 -1
- package/_virtual/_virtual_i18n/ja/common.js +10 -1
- package/_virtual/_virtual_i18n/ko/common.js +10 -1
- package/_virtual/_virtual_i18n/zh/common.js +10 -1
- package/components/DocsTree.js +149 -139
- package/components/FavoriteStar.js +13 -1
- package/components/FavoritesNav.js +168 -112
- package/components/NewProjectDialog.js +170 -163
- package/components/ParentProjectSelect.js +35 -0
- package/lib/projects.js +9 -1
- package/package.json +1 -1
- package/pages/areas.js +183 -173
- package/pages/decisions.js +61 -57
- package/pages/projects.js +43 -34
- package/pages/triage.js +197 -184
- package/routes/_workspace/agents/index2.js +95 -87
- package/routes/_workspace/dashboards/index2.js +61 -53
- package/routes/_workspace/docs/space2._space.js +105 -94
- package/routes/_workspace/graph3.js +69 -60
- package/routes/_workspace/measures3.js +82 -74
- package/routes/_workspace/notifications2.js +236 -230
- package/routes/_workspace/projects/_projectId3.js +286 -287
- package/routes/_workspace/teams/_key/cycles/index2.js +98 -88
- package/routes/_workspace2.js +3 -2
package/components/DocsTree.js
CHANGED
|
@@ -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 {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
16
|
-
import { keepPreviousData as N, useQuery as P, useSuspenseQuery as
|
|
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
|
|
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
|
-
],
|
|
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
|
|
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
|
|
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
|
|
57
|
-
let y = A("docs"), { data:
|
|
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,
|
|
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(() =>
|
|
63
|
+
let e = setTimeout(() => he(W.trim()), 200);
|
|
63
64
|
return () => clearTimeout(e);
|
|
64
|
-
}, [
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
let Q =
|
|
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
|
-
|
|
70
|
-
}, [
|
|
71
|
-
let $ = !m &&
|
|
72
|
-
over:
|
|
73
|
-
start: (e) =>
|
|
74
|
-
end: () =>
|
|
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) => !!
|
|
79
|
+
accepts: (e, t) => !!X && e.id !== X.id && !t.includes(X.id),
|
|
79
80
|
hover: (e, t) => {
|
|
80
|
-
(
|
|
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 (
|
|
87
|
-
if (t === "inside")
|
|
88
|
-
doc:
|
|
87
|
+
if (X) {
|
|
88
|
+
if (t === "inside") z.move.mutate({
|
|
89
|
+
doc: X,
|
|
89
90
|
parent: e
|
|
90
|
-
}),
|
|
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
|
-
|
|
94
|
-
doc:
|
|
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
|
-
|
|
100
|
+
Se.end();
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
103
|
dropInSpace: (e, t) => {
|
|
103
|
-
|
|
104
|
-
doc:
|
|
104
|
+
X && z.move.mutate({
|
|
105
|
+
doc: X,
|
|
105
106
|
space: t?.key ?? e
|
|
106
|
-
}),
|
|
107
|
+
}), Se.end();
|
|
107
108
|
}
|
|
108
|
-
},
|
|
109
|
-
drag:
|
|
110
|
-
transfer:
|
|
109
|
+
}, Ce = {
|
|
110
|
+
drag: Se,
|
|
111
|
+
transfer: B,
|
|
111
112
|
workspace: t,
|
|
112
|
-
open: new Set(
|
|
113
|
+
open: new Set(J.open),
|
|
113
114
|
current: F,
|
|
114
|
-
toggle: (e) =>
|
|
115
|
-
menu: (e) =>
|
|
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
|
-
},
|
|
124
|
+
}, we = /* @__PURE__ */ M(le, { children: [/* @__PURE__ */ j(w, {
|
|
124
125
|
variant: "ghost",
|
|
125
126
|
size: "xs",
|
|
126
|
-
icon: /* @__PURE__ */ j(
|
|
127
|
+
icon: /* @__PURE__ */ j(ne, {}),
|
|
127
128
|
label: y("search"),
|
|
128
|
-
pressed:
|
|
129
|
+
pressed: V,
|
|
129
130
|
onClick: () => {
|
|
130
|
-
|
|
131
|
+
U((e) => !e), G("");
|
|
131
132
|
},
|
|
132
|
-
className: m ? "" :
|
|
133
|
+
className: m ? "" : R
|
|
133
134
|
}), Q.length === 0 ? /* @__PURE__ */ j(w, {
|
|
134
135
|
variant: "ghost",
|
|
135
136
|
size: "xs",
|
|
136
|
-
icon: /* @__PURE__ */ j(
|
|
137
|
+
icon: /* @__PURE__ */ j(te, {}),
|
|
137
138
|
label: y("new"),
|
|
138
|
-
onClick: () =>
|
|
139
|
-
disabled:
|
|
140
|
-
className: m ? "" :
|
|
141
|
-
}) : /* @__PURE__ */ j(
|
|
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:
|
|
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 &&
|
|
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:
|
|
159
|
+
disabled: z.create.isPending,
|
|
159
160
|
"aria-label": y("new"),
|
|
160
|
-
className:
|
|
161
|
+
className: I(ae({
|
|
161
162
|
variant: "ghost",
|
|
162
163
|
size: "xs",
|
|
163
164
|
iconOnly: !0
|
|
164
|
-
}), !m &&
|
|
165
|
-
children: /* @__PURE__ */ j(
|
|
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:
|
|
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: [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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:
|
|
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) =>
|
|
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(
|
|
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
|
-
|
|
202
|
+
we,
|
|
193
203
|
/* @__PURE__ */ j(w, {
|
|
194
204
|
variant: "ghost",
|
|
195
205
|
size: "xs",
|
|
196
|
-
icon: /* @__PURE__ */ j(x, { className:
|
|
206
|
+
icon: /* @__PURE__ */ j(x, { className: I(!$ && "rotate-90") }),
|
|
197
207
|
label: y($ ? "expand" : "collapse"),
|
|
198
208
|
"aria-expanded": !$,
|
|
199
|
-
onClick: () =>
|
|
209
|
+
onClick: () => Y((e) => ({
|
|
200
210
|
...e,
|
|
201
211
|
collapsed: !e.collapsed
|
|
202
212
|
}))
|
|
203
213
|
})
|
|
204
214
|
]
|
|
205
215
|
}),
|
|
206
|
-
|
|
216
|
+
V && /* @__PURE__ */ j("div", {
|
|
207
217
|
className: "px-1 py-1",
|
|
208
218
|
children: /* @__PURE__ */ j(ie, {
|
|
209
|
-
ref:
|
|
210
|
-
value:
|
|
211
|
-
onValueChange:
|
|
212
|
-
onKeyDown: (e) => e.key === "Escape" && !
|
|
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:
|
|
220
|
-
children:
|
|
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:
|
|
232
|
+
query: K,
|
|
223
233
|
current: F
|
|
224
|
-
},
|
|
225
|
-
/* @__PURE__ */ j(
|
|
226
|
-
ctx:
|
|
234
|
+
}, K) : /* @__PURE__ */ M(le, { children: [
|
|
235
|
+
/* @__PURE__ */ j(me, {
|
|
236
|
+
ctx: Ce,
|
|
227
237
|
id: "workspace",
|
|
228
|
-
name:
|
|
238
|
+
name: E.name,
|
|
229
239
|
icon: /* @__PURE__ */ j(b, {
|
|
230
|
-
icon:
|
|
231
|
-
color:
|
|
232
|
-
name:
|
|
240
|
+
icon: E.icon,
|
|
241
|
+
color: E.color,
|
|
242
|
+
name: E.name
|
|
233
243
|
}),
|
|
234
|
-
docs:
|
|
235
|
-
closed:
|
|
236
|
-
onToggle: () =>
|
|
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(
|
|
239
|
-
ctx:
|
|
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:
|
|
249
|
-
closed:
|
|
250
|
-
onToggle: () =>
|
|
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: () =>
|
|
255
|
-
"aria-expanded":
|
|
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:
|
|
269
|
+
children: /* @__PURE__ */ j(x, { className: I("size-3", q && "rotate-90") })
|
|
260
270
|
}), y("archived")]
|
|
261
271
|
}),
|
|
262
|
-
|
|
272
|
+
q && /* @__PURE__ */ j(_e, {
|
|
263
273
|
workspace: t,
|
|
264
274
|
current: F
|
|
265
275
|
})
|
|
266
276
|
] })
|
|
267
277
|
}),
|
|
268
|
-
|
|
278
|
+
B.dialog
|
|
269
279
|
]
|
|
270
280
|
});
|
|
271
281
|
}
|
|
272
|
-
function
|
|
273
|
-
let u = A("docs"), d = A("common"), f = D(), p = o(e.workspace), h = m(), y = g(), b = e.workspace, { data:
|
|
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:
|
|
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
|
-
|
|
338
|
+
oe,
|
|
329
339
|
...h(v(b, r.key, "issues"))
|
|
330
340
|
] : []
|
|
331
341
|
], re = (t) => {
|
|
332
|
-
t.dataTransfer.types.includes(
|
|
333
|
-
},
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
357
|
+
}), ae = /* @__PURE__ */ j(w, {
|
|
348
358
|
variant: "ghost",
|
|
349
359
|
size: "xs",
|
|
350
|
-
icon: /* @__PURE__ */ j(
|
|
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:
|
|
354
|
-
}),
|
|
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:
|
|
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:
|
|
374
|
+
onDrop: T,
|
|
365
375
|
children: [
|
|
366
|
-
/* @__PURE__ */ j(
|
|
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:
|
|
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
|
-
|
|
388
|
-
|
|
397
|
+
O,
|
|
398
|
+
ae
|
|
389
399
|
]
|
|
390
|
-
}), !c &&
|
|
400
|
+
}), !c && ie]
|
|
391
401
|
});
|
|
392
402
|
}
|
|
393
|
-
function
|
|
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(
|
|
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
|
|
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 =
|
|
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:
|
|
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(
|
|
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,
|
|
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,
|
|
441
|
+
n.preventDefault(), e.drag.drop(t, U(n), o);
|
|
432
442
|
},
|
|
433
443
|
children: [
|
|
434
|
-
t.children > 0 ? /* @__PURE__ */ j(
|
|
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:
|
|
443
|
-
children: /* @__PURE__ */ j(x, { className:
|
|
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(
|
|
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(
|
|
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
|
|
490
|
-
let o = A("docs"), c = D(), l = s(e), { data: u = [] } = P(r(e)), [d, f] = k(
|
|
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:
|
|
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(
|
|
530
|
-
}) }, t.id)), p.length === d && d <
|
|
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 +
|
|
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
|
|
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
|
|
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:
|
|
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(
|
|
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 {
|
|
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
|
-
|
|
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 };
|