@parallelworks/tandem-web 0.148.0 → 0.150.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 +1 -1
- package/_virtual/_virtual_i18n/es/common.js +1 -1
- package/_virtual/_virtual_i18n/ja/common.js +1 -1
- package/_virtual/_virtual_i18n/ko/common.js +1 -1
- package/_virtual/_virtual_i18n/zh/common.js +1 -1
- package/components/DocsTree.js +139 -130
- package/components/FavoritesNav.js +33 -44
- package/components/SettingsNav.js +24 -32
- package/components/SharedUI.js +1 -0
- package/index.js +3 -1
- package/lib/teamTree.js +2 -16
- package/package.json +2 -2
- package/routes/_workspace/teams/_key/settings2.js +18 -18
- package/routes/_workspace2.js +462 -636
|
@@ -587,7 +587,6 @@ var e = {
|
|
|
587
587
|
copyWorkspaceSlug: "Copy workspace slug",
|
|
588
588
|
signOut: "Sign out",
|
|
589
589
|
newIssue: "New issue",
|
|
590
|
-
workspaceNav: "Workspace",
|
|
591
590
|
myIssues: "My issues",
|
|
592
591
|
decisions: "Decisions",
|
|
593
592
|
triage: "Triage",
|
|
@@ -2885,6 +2884,7 @@ var e = {
|
|
|
2885
2884
|
removeSearchTerm: "Remove filter {term}",
|
|
2886
2885
|
searchActive: "{label}, on",
|
|
2887
2886
|
grouping: "Grouping",
|
|
2887
|
+
layout: "Layout",
|
|
2888
2888
|
groups: "Groups",
|
|
2889
2889
|
orderDefault: "Default",
|
|
2890
2890
|
orderFavorites: "Favorites",
|
|
@@ -587,7 +587,6 @@ var e = {
|
|
|
587
587
|
copyWorkspaceSlug: "Copiar slug del espacio de trabajo",
|
|
588
588
|
signOut: "Cerrar sesión",
|
|
589
589
|
newIssue: "Nueva incidencia",
|
|
590
|
-
workspaceNav: "Espacio de trabajo",
|
|
591
590
|
myIssues: "Mis incidencias",
|
|
592
591
|
decisions: "Decisiones",
|
|
593
592
|
triage: "Clasificación",
|
|
@@ -2885,6 +2884,7 @@ var e = {
|
|
|
2885
2884
|
removeSearchTerm: "Quitar filtro {term}",
|
|
2886
2885
|
searchActive: "{label}, activado",
|
|
2887
2886
|
grouping: "Agrupación",
|
|
2887
|
+
layout: "Diseño",
|
|
2888
2888
|
groups: "Grupos",
|
|
2889
2889
|
orderDefault: "Predeterminado",
|
|
2890
2890
|
orderFavorites: "Favoritos",
|
|
@@ -587,7 +587,6 @@ var e = {
|
|
|
587
587
|
copyWorkspaceSlug: "ワークスペースのスラッグをコピー",
|
|
588
588
|
signOut: "サインアウト",
|
|
589
589
|
newIssue: "新しい課題",
|
|
590
|
-
workspaceNav: "ワークスペース",
|
|
591
590
|
myIssues: "自分の課題",
|
|
592
591
|
decisions: "判断",
|
|
593
592
|
triage: "トリアージ",
|
|
@@ -2885,6 +2884,7 @@ var e = {
|
|
|
2885
2884
|
removeSearchTerm: "フィルター {term} を削除",
|
|
2886
2885
|
searchActive: "{label}、オン",
|
|
2887
2886
|
grouping: "グループ化",
|
|
2887
|
+
layout: "レイアウト",
|
|
2888
2888
|
groups: "グループ",
|
|
2889
2889
|
orderDefault: "デフォルト",
|
|
2890
2890
|
orderFavorites: "お気に入り",
|
|
@@ -587,7 +587,6 @@ var e = {
|
|
|
587
587
|
copyWorkspaceSlug: "워크스페이스 슬러그 복사",
|
|
588
588
|
signOut: "로그아웃",
|
|
589
589
|
newIssue: "새 이슈",
|
|
590
|
-
workspaceNav: "워크스페이스",
|
|
591
590
|
myIssues: "내 이슈",
|
|
592
591
|
decisions: "결정",
|
|
593
592
|
triage: "분류",
|
|
@@ -2885,6 +2884,7 @@ var e = {
|
|
|
2885
2884
|
removeSearchTerm: "{term} 필터 제거",
|
|
2886
2885
|
searchActive: "{label}, 켜짐",
|
|
2887
2886
|
grouping: "그룹화",
|
|
2887
|
+
layout: "레이아웃",
|
|
2888
2888
|
groups: "그룹",
|
|
2889
2889
|
orderDefault: "기본",
|
|
2890
2890
|
orderFavorites: "즐겨찾기",
|
|
@@ -587,7 +587,6 @@ var e = {
|
|
|
587
587
|
copyWorkspaceSlug: "复制工作区标识",
|
|
588
588
|
signOut: "退出登录",
|
|
589
589
|
newIssue: "新建议题",
|
|
590
|
-
workspaceNav: "工作区",
|
|
591
590
|
myIssues: "我的议题",
|
|
592
591
|
decisions: "决策",
|
|
593
592
|
triage: "分拣",
|
|
@@ -2885,6 +2884,7 @@ var e = {
|
|
|
2885
2884
|
removeSearchTerm: "移除筛选条件 {term}",
|
|
2886
2885
|
searchActive: "{label},已开启",
|
|
2887
2886
|
grouping: "分组",
|
|
2887
|
+
layout: "布局",
|
|
2888
2888
|
groups: "分组",
|
|
2889
2889
|
orderDefault: "默认",
|
|
2890
2890
|
orderFavorites: "收藏",
|
package/components/DocsTree.js
CHANGED
|
@@ -15,15 +15,16 @@ import { useTranslations as j } from "use-intl";
|
|
|
15
15
|
import { Fragment as se, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
16
16
|
import { keepPreviousData as P, useQuery as F, useSuspenseQuery as ce } from "@tanstack/react-query";
|
|
17
17
|
import { MoreButton as I } from "@parallelworks/ui/list";
|
|
18
|
+
import { AppFrameNavGroup as L } from "@parallelworks/ui/app-frame";
|
|
18
19
|
// src/components/DocsTree.tsx
|
|
19
|
-
var
|
|
20
|
+
var le = "application/x-tandem-doc", R = (...e) => e.filter(Boolean).join(" "), ue = "flex items-start gap-0.5 rounded-md text-sm text-muted-foreground hover:bg-muted hover:text-foreground", de = "bg-muted font-medium !text-foreground", fe = "bg-[var(--theme-sidebar-active-bg,var(--theme-accent-subtle))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-accent-subtle))] !text-[var(--theme-sidebar-active-text,var(--theme-accent))]", z = [
|
|
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
|
+
], 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
28
|
let e = {
|
|
28
29
|
doc: void 0,
|
|
29
30
|
over: void 0
|
|
@@ -44,76 +45,76 @@ var L = "application/x-tandem-doc", R = (...e) => e.filter(Boolean).join(" "), l
|
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
47
|
})();
|
|
47
|
-
function
|
|
48
|
+
function G(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 K = {
|
|
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
|
+
function q({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, team: y }) {
|
|
57
58
|
let T = j("docs"), { data: E } = ce(a(r)), { data: D } = ce(o(r)), { data: P = [] } = F(i(r, { top: !0 })), { data: I } = F({
|
|
58
59
|
...n(r, d ?? ""),
|
|
59
60
|
enabled: !!d
|
|
60
|
-
}), L = I?.key ?? d, le = O(),
|
|
61
|
+
}), L = I?.key ?? d, le = O(), ue = g(r), fe = t(), z = h(r), V = C(r), [H, U] = A(!1), [G, K] = A(""), [q, me] = A(""), [J, ge] = A(!1), ve = y ? `${r}/${y.id}` : r, [Y, X] = A(() => te(ve)), { doc: Z, over: ye } = oe(W.subscribe, W.get), be = ae(null);
|
|
61
62
|
k(() => {
|
|
62
|
-
let e = setTimeout(() =>
|
|
63
|
+
let e = setTimeout(() => me(G.trim()), 200);
|
|
63
64
|
return () => clearTimeout(e);
|
|
64
65
|
}, [G]), k(() => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
let
|
|
66
|
+
H && be.current?.focus();
|
|
67
|
+
}, [H]), k(() => ee(ve, Y), [ve, Y]);
|
|
68
|
+
let Q = E.filter((e) => !e.archivedAt), xe = I ? x(I) : "", Se = (I ? (I.ancestors ?? []).map((e) => e.id) : []).join(" ");
|
|
68
69
|
k(() => {
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
let
|
|
72
|
-
over:
|
|
73
|
-
start: (e) =>
|
|
74
|
-
end: () =>
|
|
70
|
+
xe && X((e) => b(e, xe, Se ? Se.split(" ") : []));
|
|
71
|
+
}, [xe, Se]);
|
|
72
|
+
let $ = !f && Y.collapsed && !H, Ce = {
|
|
73
|
+
over: ye,
|
|
74
|
+
start: (e) => W.set({ doc: e }),
|
|
75
|
+
end: () => W.set({
|
|
75
76
|
doc: void 0,
|
|
76
77
|
over: void 0
|
|
77
78
|
}),
|
|
78
|
-
accepts: (e, t) => !!
|
|
79
|
+
accepts: (e, t) => !!Z && e.id !== Z.id && !t.includes(Z.id),
|
|
79
80
|
hover: (e, t) => {
|
|
80
|
-
(
|
|
81
|
+
(ye?.id !== e || ye.spot !== t) && W.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 (Z) {
|
|
88
|
+
if (t === "inside") z.move.mutate({
|
|
89
|
+
doc: Z,
|
|
89
90
|
parent: e
|
|
90
|
-
}),
|
|
91
|
+
}), X((t) => t.open.includes(e.id) ? t : S(t, e.id));
|
|
91
92
|
else {
|
|
92
|
-
let r =
|
|
93
|
-
|
|
94
|
-
doc:
|
|
93
|
+
let r = Q.find((t) => t.id === e.teamId);
|
|
94
|
+
z.move.mutate({
|
|
95
|
+
doc: Z,
|
|
95
96
|
...n ? { parent: n } : { space: r?.key ?? "workspace" },
|
|
96
97
|
...t === "before" ? { before: e } : { after: e }
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
+
Ce.end();
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
103
|
dropInSpace: (e, t) => {
|
|
103
|
-
|
|
104
|
-
doc:
|
|
104
|
+
Z && z.move.mutate({
|
|
105
|
+
doc: Z,
|
|
105
106
|
space: t?.key ?? e
|
|
106
|
-
}),
|
|
107
|
+
}), Ce.end();
|
|
107
108
|
}
|
|
108
|
-
},
|
|
109
|
-
drag:
|
|
109
|
+
}, we = {
|
|
110
|
+
drag: Ce,
|
|
110
111
|
transfer: V,
|
|
111
112
|
workspace: r,
|
|
112
|
-
open: new Set(
|
|
113
|
+
open: new Set(Y.open),
|
|
113
114
|
current: L,
|
|
114
|
-
|
|
115
|
-
toggle: (e) =>
|
|
116
|
-
menu: (e) =>
|
|
115
|
+
sidebar: !!y,
|
|
116
|
+
toggle: (e) => X((t) => S(t, e)),
|
|
117
|
+
menu: (e) => ue(e, { onRename: () => fe({
|
|
117
118
|
to: "/$workspace/docs/$doc",
|
|
118
119
|
params: {
|
|
119
120
|
workspace: r,
|
|
@@ -126,58 +127,58 @@ function G({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, t
|
|
|
126
127
|
size: "xs",
|
|
127
128
|
icon: /* @__PURE__ */ M(u, {}),
|
|
128
129
|
label: T("search"),
|
|
129
|
-
pressed:
|
|
130
|
+
pressed: H,
|
|
130
131
|
onClick: () => {
|
|
131
|
-
|
|
132
|
+
U((e) => !e), K("");
|
|
132
133
|
},
|
|
133
|
-
className: f ? "" :
|
|
134
|
-
}),
|
|
134
|
+
className: f ? "" : B
|
|
135
|
+
}), Q.length === 0 ? /* @__PURE__ */ M(w, {
|
|
135
136
|
variant: "ghost",
|
|
136
137
|
size: "xs",
|
|
137
138
|
icon: /* @__PURE__ */ M(s, {}),
|
|
138
139
|
label: T("new"),
|
|
139
|
-
onClick: () =>
|
|
140
|
-
disabled:
|
|
141
|
-
className: f ? "" :
|
|
140
|
+
onClick: () => z.create.mutate({}),
|
|
141
|
+
disabled: z.create.isPending,
|
|
142
|
+
className: f ? "" : B
|
|
142
143
|
}) : /* @__PURE__ */ M(ne, {
|
|
143
144
|
items: [{
|
|
144
145
|
value: "",
|
|
145
146
|
label: D.name
|
|
146
|
-
}, ...
|
|
147
|
+
}, ...Q.map((e) => ({
|
|
147
148
|
value: e.key,
|
|
148
149
|
label: e.name,
|
|
149
150
|
hint: e.key
|
|
150
151
|
}))],
|
|
151
152
|
value: null,
|
|
152
|
-
onValueChange: (e) => e !== null &&
|
|
153
|
+
onValueChange: (e) => e !== null && z.create.mutate({ team: e || void 0 }),
|
|
153
154
|
placeholder: T("chooseTeam"),
|
|
154
155
|
"aria-label": T("new"),
|
|
155
156
|
align: "end",
|
|
156
157
|
triggerTooltip: T("new"),
|
|
157
158
|
trigger: /* @__PURE__ */ M("button", {
|
|
158
159
|
type: "button",
|
|
159
|
-
disabled:
|
|
160
|
+
disabled: z.create.isPending,
|
|
160
161
|
"aria-label": T("new"),
|
|
161
162
|
className: R(ie({
|
|
162
163
|
variant: "ghost",
|
|
163
164
|
size: "xs",
|
|
164
165
|
iconOnly: !0
|
|
165
|
-
}), !f &&
|
|
166
|
+
}), !f && B),
|
|
166
167
|
children: /* @__PURE__ */ M(s, {})
|
|
167
168
|
})
|
|
168
169
|
})] });
|
|
169
170
|
return y ? /* @__PURE__ */ N("section", {
|
|
170
171
|
"aria-label": T("teamDocs", { team: y.name }),
|
|
171
172
|
children: [/* @__PURE__ */ M(pe, {
|
|
172
|
-
ctx:
|
|
173
|
+
ctx: we,
|
|
173
174
|
id: y.id,
|
|
174
175
|
team: y,
|
|
175
176
|
name: T("title"),
|
|
176
177
|
row: !0,
|
|
177
178
|
icon: /* @__PURE__ */ M(l, { className: "size-4" }),
|
|
178
179
|
docs: P.filter((e) => e.teamId === y.id),
|
|
179
|
-
closed:
|
|
180
|
-
onToggle: () =>
|
|
180
|
+
closed: Y.closedSpaces.includes(y.id),
|
|
181
|
+
onToggle: () => X((e) => S(e, y.id, !0))
|
|
181
182
|
}), V.dialog]
|
|
182
183
|
}) : /* @__PURE__ */ N("section", {
|
|
183
184
|
"aria-label": T("title"),
|
|
@@ -190,7 +191,7 @@ function G({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, t
|
|
|
190
191
|
children: T("title")
|
|
191
192
|
}), Te]
|
|
192
193
|
}) : /* @__PURE__ */ N("div", {
|
|
193
|
-
className: R("group flex h-8 items-center gap-0.5 rounded-md pr-1 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", p &&
|
|
194
|
+
className: R("group flex h-8 items-center gap-0.5 rounded-md pr-1 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", p && de),
|
|
194
195
|
children: [
|
|
195
196
|
/* @__PURE__ */ N(e, {
|
|
196
197
|
to: "/$workspace/docs",
|
|
@@ -207,37 +208,37 @@ function G({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, t
|
|
|
207
208
|
/* @__PURE__ */ M(w, {
|
|
208
209
|
variant: "ghost",
|
|
209
210
|
size: "xs",
|
|
210
|
-
icon: /* @__PURE__ */ M(c, { className: R(
|
|
211
|
-
label: T(
|
|
212
|
-
"aria-expanded":
|
|
213
|
-
onClick: () =>
|
|
211
|
+
icon: /* @__PURE__ */ M(c, { className: R(!$ && "rotate-90") }),
|
|
212
|
+
label: T($ ? "expand" : "collapse"),
|
|
213
|
+
"aria-expanded": !$,
|
|
214
|
+
onClick: () => X((e) => ({
|
|
214
215
|
...e,
|
|
215
216
|
collapsed: !e.collapsed
|
|
216
217
|
}))
|
|
217
218
|
})
|
|
218
219
|
]
|
|
219
220
|
}),
|
|
220
|
-
|
|
221
|
+
H && /* @__PURE__ */ M("div", {
|
|
221
222
|
className: "px-1 py-1",
|
|
222
223
|
children: /* @__PURE__ */ M(re, {
|
|
223
|
-
ref:
|
|
224
|
+
ref: be,
|
|
224
225
|
value: G,
|
|
225
226
|
onValueChange: K,
|
|
226
|
-
onKeyDown: (e) => e.key === "Escape" && !G &&
|
|
227
|
+
onKeyDown: (e) => e.key === "Escape" && !G && U(!1),
|
|
227
228
|
placeholder: T("search"),
|
|
228
229
|
label: T("search"),
|
|
229
230
|
size: "sm"
|
|
230
231
|
})
|
|
231
232
|
}),
|
|
232
|
-
|
|
233
|
+
!$ && /* @__PURE__ */ M("div", {
|
|
233
234
|
className: R("pt-1", f && "min-h-0 flex-1 overflow-y-auto pb-3"),
|
|
234
|
-
children: q ? /* @__PURE__ */ M(
|
|
235
|
+
children: q ? /* @__PURE__ */ M(he, {
|
|
235
236
|
workspace: r,
|
|
236
237
|
query: q,
|
|
237
238
|
current: L
|
|
238
239
|
}, q) : /* @__PURE__ */ N(se, { children: [
|
|
239
240
|
/* @__PURE__ */ M(pe, {
|
|
240
|
-
ctx:
|
|
241
|
+
ctx: we,
|
|
241
242
|
id: "workspace",
|
|
242
243
|
name: D.name,
|
|
243
244
|
icon: /* @__PURE__ */ M(_, {
|
|
@@ -246,11 +247,11 @@ function G({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, t
|
|
|
246
247
|
name: D.name
|
|
247
248
|
}),
|
|
248
249
|
docs: P.filter((e) => !e.teamId),
|
|
249
|
-
closed:
|
|
250
|
-
onToggle: () =>
|
|
250
|
+
closed: Y.closedSpaces.includes("workspace"),
|
|
251
|
+
onToggle: () => X((e) => S(e, "workspace", !0))
|
|
251
252
|
}),
|
|
252
|
-
|
|
253
|
-
ctx:
|
|
253
|
+
Q.map((e) => /* @__PURE__ */ M(pe, {
|
|
254
|
+
ctx: we,
|
|
254
255
|
id: e.id,
|
|
255
256
|
team: e,
|
|
256
257
|
name: e.name,
|
|
@@ -260,20 +261,20 @@ function G({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, t
|
|
|
260
261
|
name: e.name
|
|
261
262
|
}),
|
|
262
263
|
docs: P.filter((t) => t.teamId === e.id),
|
|
263
|
-
closed:
|
|
264
|
-
onToggle: () =>
|
|
264
|
+
closed: Y.closedSpaces.includes(e.id),
|
|
265
|
+
onToggle: () => X((t) => S(t, e.id, !0))
|
|
265
266
|
}, e.id)),
|
|
266
267
|
/* @__PURE__ */ N("button", {
|
|
267
268
|
type: "button",
|
|
268
|
-
onClick: () =>
|
|
269
|
-
"aria-expanded":
|
|
269
|
+
onClick: () => ge((e) => !e),
|
|
270
|
+
"aria-expanded": J,
|
|
270
271
|
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",
|
|
271
272
|
children: [/* @__PURE__ */ M("span", {
|
|
272
273
|
className: "flex size-5 items-center justify-center",
|
|
273
|
-
children: /* @__PURE__ */ M(c, { className: R("size-3",
|
|
274
|
+
children: /* @__PURE__ */ M(c, { className: R("size-3", J && "rotate-90") })
|
|
274
275
|
}), T("archived")]
|
|
275
276
|
}),
|
|
276
|
-
|
|
277
|
+
J && /* @__PURE__ */ M(_e, {
|
|
277
278
|
workspace: r,
|
|
278
279
|
current: L
|
|
279
280
|
})
|
|
@@ -284,7 +285,7 @@ function G({ workspace: r, current: d, page: f = !1, onIndex: p = !1, menu: v, t
|
|
|
284
285
|
});
|
|
285
286
|
}
|
|
286
287
|
function pe({ ctx: e, id: n, team: i, name: a, icon: o, docs: l, closed: u, onToggle: m, row: g = !1 }) {
|
|
287
|
-
let _ = j("docs"), v = j("common"), y = O(), b = h(e.workspace), ee = f(), te = t(), x = e.workspace, { data: S = [] } = F(r(x)), C = `docs-space-${n}`, ne = j("docViews"),
|
|
288
|
+
let _ = j("docs"), v = j("common"), y = O(), b = h(e.workspace), ee = f(), te = t(), x = e.workspace, { data: S = [] } = F(r(x)), C = `docs-space-${n}`, ne = j("docViews"), T = () => [
|
|
288
289
|
{
|
|
289
290
|
label: _("newInSpace"),
|
|
290
291
|
onClick: () => b.create.mutate({ team: i?.key })
|
|
@@ -342,18 +343,51 @@ function pe({ ctx: e, id: n, team: i, name: a, icon: o, docs: l, closed: u, onTo
|
|
|
342
343
|
D,
|
|
343
344
|
...ee(d(x, i.key, "issues"))
|
|
344
345
|
] : []
|
|
345
|
-
]
|
|
346
|
-
|
|
346
|
+
], re = (t) => {
|
|
347
|
+
t.dataTransfer.types.includes(le) && (t.preventDefault(), e.drag.hover(`space-${n}`, "inside"));
|
|
348
|
+
}, ie = (t) => {
|
|
349
|
+
t.preventDefault(), e.drag.dropInSpace("workspace", i);
|
|
350
|
+
}, k = l.length > 0 ? /* @__PURE__ */ M(me, {
|
|
351
|
+
ctx: e,
|
|
352
|
+
id: C,
|
|
353
|
+
docs: l,
|
|
354
|
+
depth: 0,
|
|
355
|
+
trail: a,
|
|
356
|
+
above: [],
|
|
357
|
+
label: a
|
|
358
|
+
}) : /* @__PURE__ */ M("p", {
|
|
359
|
+
id: C,
|
|
360
|
+
className: R("py-1 text-xs text-muted-foreground", g ? "pl-2" : "pl-9"),
|
|
361
|
+
children: _("emptyTeam")
|
|
362
|
+
}), ae = /* @__PURE__ */ M(w, {
|
|
363
|
+
variant: "ghost",
|
|
364
|
+
size: "xs",
|
|
365
|
+
icon: /* @__PURE__ */ M(s, {}),
|
|
366
|
+
label: _("newInTeamNamed", { team: i?.name ?? a }),
|
|
367
|
+
onClick: () => b.create.mutate({ team: i?.key }),
|
|
368
|
+
className: g ? void 0 : B
|
|
369
|
+
}), A = /* @__PURE__ */ M(I, {
|
|
370
|
+
items: T,
|
|
371
|
+
label: v("moreActionsFor", { name: i?.name ?? a })
|
|
372
|
+
});
|
|
373
|
+
return g ? /* @__PURE__ */ M(L, {
|
|
374
|
+
label: a,
|
|
375
|
+
icon: o,
|
|
376
|
+
open: !u,
|
|
377
|
+
onOpenChange: (e) => e === u && m(),
|
|
378
|
+
onContextMenu: (e) => y(e, T()),
|
|
379
|
+
onDragOver: re,
|
|
380
|
+
onDrop: ie,
|
|
381
|
+
className: R(e.drag.over?.id === `space-${n}` && K.inside),
|
|
382
|
+
action: A,
|
|
383
|
+
children: k
|
|
384
|
+
}) : /* @__PURE__ */ N("div", {
|
|
347
385
|
className: "mb-1",
|
|
348
386
|
children: [/* @__PURE__ */ N("div", {
|
|
349
|
-
className: R("group flex items-center gap-0.5 rounded-md pr-1 hover:bg-muted",
|
|
350
|
-
onContextMenu: (e) => y(e,
|
|
351
|
-
onDragOver:
|
|
352
|
-
|
|
353
|
-
},
|
|
354
|
-
onDrop: (t) => {
|
|
355
|
-
t.preventDefault(), e.drag.dropInSpace("workspace", i);
|
|
356
|
-
},
|
|
387
|
+
className: R("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),
|
|
388
|
+
onContextMenu: (e) => y(e, T()),
|
|
389
|
+
onDragOver: re,
|
|
390
|
+
onDrop: ie,
|
|
357
391
|
children: [
|
|
358
392
|
/* @__PURE__ */ M(E, {
|
|
359
393
|
content: _(u ? "expand" : "collapse"),
|
|
@@ -362,9 +396,9 @@ function pe({ ctx: e, id: n, team: i, name: a, icon: o, docs: l, closed: u, onTo
|
|
|
362
396
|
onClick: m,
|
|
363
397
|
"aria-expanded": !u,
|
|
364
398
|
"aria-controls": u ? void 0 : C,
|
|
365
|
-
className:
|
|
399
|
+
className: "flex h-full min-w-0 flex-1 items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground",
|
|
366
400
|
children: [
|
|
367
|
-
|
|
401
|
+
/* @__PURE__ */ M("span", {
|
|
368
402
|
className: "flex size-5 shrink-0 items-center justify-center",
|
|
369
403
|
children: /* @__PURE__ */ M(c, { className: R("size-3", !u && "rotate-90") })
|
|
370
404
|
}),
|
|
@@ -372,47 +406,22 @@ function pe({ ctx: e, id: n, team: i, name: a, icon: o, docs: l, closed: u, onTo
|
|
|
372
406
|
/* @__PURE__ */ M("span", {
|
|
373
407
|
className: "truncate",
|
|
374
408
|
children: a
|
|
375
|
-
})
|
|
376
|
-
g && /* @__PURE__ */ M(c, { className: R("size-3 shrink-0 transition-transform", !u && "rotate-90") })
|
|
409
|
+
})
|
|
377
410
|
]
|
|
378
411
|
})
|
|
379
412
|
}),
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
label: v("moreActionsFor", { name: i?.name ?? a })
|
|
383
|
-
}),
|
|
384
|
-
/* @__PURE__ */ M(E, {
|
|
385
|
-
content: _("newInSpace"),
|
|
386
|
-
children: /* @__PURE__ */ M("button", {
|
|
387
|
-
type: "button",
|
|
388
|
-
onClick: () => b.create.mutate({ team: i?.key }),
|
|
389
|
-
"aria-label": _("newInTeamNamed", { team: i?.name ?? a }),
|
|
390
|
-
className: z,
|
|
391
|
-
children: /* @__PURE__ */ M(s, { className: "size-3" })
|
|
392
|
-
})
|
|
393
|
-
})
|
|
413
|
+
A,
|
|
414
|
+
ae
|
|
394
415
|
]
|
|
395
|
-
}), !u &&
|
|
396
|
-
ctx: e,
|
|
397
|
-
id: C,
|
|
398
|
-
docs: l,
|
|
399
|
-
depth: 0,
|
|
400
|
-
trail: a,
|
|
401
|
-
above: [],
|
|
402
|
-
label: a
|
|
403
|
-
}) : /* @__PURE__ */ M("p", {
|
|
404
|
-
id: C,
|
|
405
|
-
className: R("py-1 text-xs text-muted-foreground", g ? "pl-[3.625rem]" : "pl-9"),
|
|
406
|
-
children: _("emptyTeam")
|
|
407
|
-
}))]
|
|
416
|
+
}), !u && k]
|
|
408
417
|
});
|
|
409
418
|
}
|
|
410
|
-
function
|
|
419
|
+
function me({ ctx: e, id: t, docs: n, depth: r, trail: i, parent: a, above: o, label: s }) {
|
|
411
420
|
return /* @__PURE__ */ M("ul", {
|
|
412
421
|
id: t,
|
|
413
422
|
"aria-label": s,
|
|
414
423
|
className: "space-y-px",
|
|
415
|
-
children: n.map((t) => /* @__PURE__ */ M(
|
|
424
|
+
children: n.map((t) => /* @__PURE__ */ M(J, {
|
|
416
425
|
ctx: e,
|
|
417
426
|
doc: t,
|
|
418
427
|
depth: r,
|
|
@@ -422,7 +431,7 @@ function K({ ctx: e, id: t, docs: n, depth: r, trail: i, parent: a, above: o, la
|
|
|
422
431
|
}, t.id))
|
|
423
432
|
});
|
|
424
433
|
}
|
|
425
|
-
function
|
|
434
|
+
function J({ ctx: t, doc: n, depth: r, trail: a, parent: o, above: s }) {
|
|
426
435
|
let l = j("docs"), u = j("common"), d = O(), f = n.children > 0 && t.open.has(n.id), { data: p = [] } = F({
|
|
427
436
|
...i(t.workspace, { parent: n.key }),
|
|
428
437
|
enabled: f
|
|
@@ -435,17 +444,17 @@ function q({ ctx: t, doc: n, depth: r, trail: a, parent: o, above: s }) {
|
|
|
435
444
|
title: n.title
|
|
436
445
|
}), b = `docs-tree-${n.id}`;
|
|
437
446
|
return /* @__PURE__ */ N("li", { children: [/* @__PURE__ */ N("div", {
|
|
438
|
-
className: R(
|
|
447
|
+
className: R(ue, "group", z[y(r)], h && (t.sidebar ? fe : de), t.drag.over?.id === n.id && K[t.drag.over.spot]),
|
|
439
448
|
draggable: !0,
|
|
440
449
|
onDragStart: (e) => {
|
|
441
|
-
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData(
|
|
450
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData(le, n.key), t.drag.start(n);
|
|
442
451
|
},
|
|
443
452
|
onDragEnd: t.drag.end,
|
|
444
453
|
onDragOver: (e) => {
|
|
445
|
-
t.drag.accepts(n, s) && (e.preventDefault(), e.dataTransfer.dropEffect = "move", t.drag.hover(n.id,
|
|
454
|
+
t.drag.accepts(n, s) && (e.preventDefault(), e.dataTransfer.dropEffect = "move", t.drag.hover(n.id, G(e)));
|
|
446
455
|
},
|
|
447
456
|
onDrop: (e) => {
|
|
448
|
-
e.preventDefault(), t.drag.drop(n,
|
|
457
|
+
e.preventDefault(), t.drag.drop(n, G(e), o);
|
|
449
458
|
},
|
|
450
459
|
children: [
|
|
451
460
|
n.children > 0 ? /* @__PURE__ */ M(E, {
|
|
@@ -456,7 +465,7 @@ function q({ ctx: t, doc: n, depth: r, trail: a, parent: o, above: s }) {
|
|
|
456
465
|
"aria-expanded": f,
|
|
457
466
|
"aria-controls": f ? b : void 0,
|
|
458
467
|
"aria-label": l("inside", { title: n.title }),
|
|
459
|
-
className:
|
|
468
|
+
className: V,
|
|
460
469
|
children: /* @__PURE__ */ M(c, { className: R("size-3", f && "rotate-90") })
|
|
461
470
|
})
|
|
462
471
|
}) : /* @__PURE__ */ M("span", { className: "size-5 shrink-0" }),
|
|
@@ -492,7 +501,7 @@ function q({ ctx: t, doc: n, depth: r, trail: a, parent: o, above: s }) {
|
|
|
492
501
|
className: "mt-0.5 mr-0.5"
|
|
493
502
|
})
|
|
494
503
|
]
|
|
495
|
-
}), f && p.length > 0 && /* @__PURE__ */ M(
|
|
504
|
+
}), f && p.length > 0 && /* @__PURE__ */ M(me, {
|
|
496
505
|
ctx: t,
|
|
497
506
|
id: b,
|
|
498
507
|
docs: p,
|
|
@@ -503,8 +512,8 @@ function q({ ctx: t, doc: n, depth: r, trail: a, parent: o, above: s }) {
|
|
|
503
512
|
label: l("inside", { title: n.title })
|
|
504
513
|
})] });
|
|
505
514
|
}
|
|
506
|
-
function
|
|
507
|
-
let o = j("docs"), s = O(), c = g(t), { data: l = [] } = F(a(t)), [u, d] = A(
|
|
515
|
+
function he({ workspace: t, query: n, current: r }) {
|
|
516
|
+
let o = j("docs"), s = O(), c = g(t), { data: l = [] } = F(a(t)), [u, d] = A(H), { data: f, isPending: p } = F({
|
|
508
517
|
...i(t, {
|
|
509
518
|
q: n,
|
|
510
519
|
limit: u
|
|
@@ -543,10 +552,10 @@ function me({ workspace: t, query: n, current: r }) {
|
|
|
543
552
|
children: l.find((e) => e.id === n.teamId)?.key ?? o("workspaceShort")
|
|
544
553
|
})
|
|
545
554
|
]
|
|
546
|
-
}), n.snippet && /* @__PURE__ */ M(
|
|
547
|
-
}) }, n.id)), f.length === u && u <
|
|
555
|
+
}), n.snippet && /* @__PURE__ */ M(ge, { text: n.snippet })]
|
|
556
|
+
}) }, n.id)), f.length === u && u < U && /* @__PURE__ */ M("li", { children: /* @__PURE__ */ M("button", {
|
|
548
557
|
type: "button",
|
|
549
|
-
onClick: () => d((e) => Math.min(e +
|
|
558
|
+
onClick: () => d((e) => Math.min(e + H, U)),
|
|
550
559
|
className: "w-full rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
551
560
|
children: o("moreResults")
|
|
552
561
|
}) })]
|
|
@@ -555,7 +564,7 @@ function me({ workspace: t, query: n, current: r }) {
|
|
|
555
564
|
children: o("noResults")
|
|
556
565
|
});
|
|
557
566
|
}
|
|
558
|
-
function
|
|
567
|
+
function ge({ text: e }) {
|
|
559
568
|
let t = e.split("**");
|
|
560
569
|
return /* @__PURE__ */ M("span", {
|
|
561
570
|
className: "mt-0.5 line-clamp-2 text-xs text-muted-foreground",
|
|
@@ -565,7 +574,7 @@ function he({ text: e }) {
|
|
|
565
574
|
}, t) : /* @__PURE__ */ M("span", { children: e }, t))
|
|
566
575
|
});
|
|
567
576
|
}
|
|
568
|
-
function
|
|
577
|
+
function _e({ workspace: t, current: n }) {
|
|
569
578
|
let r = j("docs"), a = O(), o = g(t), { data: s, isPending: c } = F(i(t, { archived: !0 }));
|
|
570
579
|
return c ? null : s?.length ? /* @__PURE__ */ M("ul", {
|
|
571
580
|
className: "space-y-px",
|
|
@@ -578,7 +587,7 @@ function ge({ workspace: t, current: n }) {
|
|
|
578
587
|
},
|
|
579
588
|
onContextMenu: (e) => a(e, o(r)),
|
|
580
589
|
"aria-current": n === r.key ? "page" : void 0,
|
|
581
|
-
className: R(
|
|
590
|
+
className: R(ue, "items-center gap-1.5 py-1 pr-1 pl-2", n === r.key && de),
|
|
582
591
|
children: [
|
|
583
592
|
/* @__PURE__ */ M(v, {
|
|
584
593
|
icon: r.icon,
|
|
@@ -602,4 +611,4 @@ function ge({ workspace: t, current: n }) {
|
|
|
602
611
|
children: r("noArchived")
|
|
603
612
|
});
|
|
604
613
|
}
|
|
605
|
-
export {
|
|
614
|
+
export { q as DocsTree };
|