@parallelworks/tandem-web 0.183.0 → 0.185.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 +18 -0
- package/_virtual/_virtual_i18n/es/common.js +18 -0
- package/_virtual/_virtual_i18n/ja/common.js +18 -0
- package/_virtual/_virtual_i18n/ko/common.js +18 -0
- package/_virtual/_virtual_i18n/zh/common.js +18 -0
- package/components/DocProperties.js +137 -114
- package/components/DocStart.js +116 -92
- package/components/DocTable.js +102 -100
- package/components/FavoritesNav.js +125 -106
- package/components/NewProjectDialog.js +170 -163
- package/components/ParentProjectSelect.js +35 -0
- package/components/ProjectAccess.js +23 -20
- package/components/SubpageViews.js +477 -161
- package/components/icons.js +8 -8
- package/lib/cancelledLoads.js +7 -0
- package/lib/docProperties.js +6 -6
- package/lib/projects.js +9 -1
- package/lib/queryClient.js +7 -6
- package/lib/subpageViews.js +1 -0
- package/package.json +1 -1
- package/pages/projects.js +62 -57
- package/routes/_workspace/docs/space2._space.js +128 -128
- package/routes/_workspace/knowledge/_term2.js +83 -77
- package/routes/_workspace/projects/_projectId3.js +286 -287
- package/styles.css +1 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { areasQuery as e, knowledgeEntryQuery as t, knowledgeEventsQuery as n, knowledgeMentionsQuery as r, knowledgeQuery as i } from "../../../api/queries.js";
|
|
2
2
|
import { Timeline as a, TimelineItem as o, activityIcon as s } from "../../../components/ActivityTimeline.js";
|
|
3
3
|
import { AttachButton as c, UploadStatus as l, useFileUpload as u } from "../../../components/Attachments.js";
|
|
4
|
-
import { Editor as
|
|
5
|
-
import { FileTextIcon as
|
|
6
|
-
import { uploadKnowledgeAttachment as
|
|
7
|
-
import { docRef as
|
|
8
|
-
import { headingAnchor as
|
|
9
|
-
import { EntryDialog as
|
|
10
|
-
import { termRef as
|
|
11
|
-
import { usePageTitle as
|
|
12
|
-
import { usePeople as
|
|
13
|
-
import { useCan as
|
|
14
|
-
import { Link as
|
|
15
|
-
import { useTime as
|
|
16
|
-
import { Route as
|
|
17
|
-
import { Button as
|
|
4
|
+
import { Editor as ee } from "../../../components/Editor.js";
|
|
5
|
+
import { FileTextIcon as d, LibraryIcon as f, StatusIcon as p } from "../../../components/icons.js";
|
|
6
|
+
import { uploadKnowledgeAttachment as m } from "../../../lib/attachments.js";
|
|
7
|
+
import { docRef as h } from "../../../lib/docs.js";
|
|
8
|
+
import { headingAnchor as g } from "../../../lib/glossary.js";
|
|
9
|
+
import { EntryDialog as _, useKnowledgeActions as te, useKnowledgeMenu as ne } from "../../../lib/knowledge.js";
|
|
10
|
+
import { termRef as v } from "../../../lib/knowledgeKinds.js";
|
|
11
|
+
import { usePageTitle as y } from "../../../lib/pageTitle.js";
|
|
12
|
+
import { usePeople as b } from "../../../lib/people.js";
|
|
13
|
+
import { useCan as x } from "../../../lib/roles.js";
|
|
14
|
+
import { Link as S, useNavigate as C } from "../../../lib/router.js";
|
|
15
|
+
import { useTime as w } from "../../../lib/time.js";
|
|
16
|
+
import { Route as T } from "./_term.js";
|
|
17
|
+
import { Button as E, ErrorText as D, Loader as O, PageHeader as re, Section as k, TitleInput as A, Tooltip as j, useOpenMenu as M } from "@parallelworks/ui";
|
|
18
18
|
import { Suspense as N, useCallback as P, useMemo as F, useRef as I, useState as L } from "react";
|
|
19
19
|
import { useErrorMessage as R } from "@parallelworks/problem/react";
|
|
20
20
|
import { useTranslations as z } from "use-intl";
|
|
@@ -23,40 +23,40 @@ import { useQuery as U, useSuspenseQuery as W } from "@tanstack/react-query";
|
|
|
23
23
|
import { MoreButton as G } from "@parallelworks/ui/list";
|
|
24
24
|
// src/routes/$workspace/knowledge/$term.tsx?tsr-split=component
|
|
25
25
|
function K() {
|
|
26
|
-
let { workspace: e, term: n } =
|
|
27
|
-
|
|
28
|
-
let Q = F(() =>
|
|
29
|
-
id:
|
|
26
|
+
let { workspace: e, term: n } = T.useParams(), r = z("knowledge"), a = z("common"), o = C(), s = M(), d = R(), { data: p } = W(t(e, n)), { data: h } = W(i(e)), g = te(e), b = x(e, "edit_docs"), w = b && !p.archivedAt, [k, j] = L(null), U = P((e) => j(e), []), K = ne(e, U), X = I(null), Z = u((t) => m(e, p.id, t));
|
|
27
|
+
y(p.name);
|
|
28
|
+
let Q = F(() => h.filter((e) => e.supersededBy === p.id), [h, p.id]), $ = (e) => g.update.mutate({
|
|
29
|
+
id: p.id,
|
|
30
30
|
...e,
|
|
31
|
-
ifVersion:
|
|
32
|
-
}),
|
|
31
|
+
ifVersion: p.version
|
|
32
|
+
}), ie = p.status === "superseded";
|
|
33
33
|
return /* @__PURE__ */ H("div", {
|
|
34
34
|
className: "flex h-full min-h-0 flex-col",
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */ V(
|
|
36
|
+
/* @__PURE__ */ V(re, {
|
|
37
37
|
heading: !1,
|
|
38
38
|
breadcrumbs: [{
|
|
39
39
|
label: r("title"),
|
|
40
40
|
href: `/${e}/knowledge`
|
|
41
41
|
}, {
|
|
42
|
-
label:
|
|
43
|
-
icon: /* @__PURE__ */ V(
|
|
42
|
+
label: p.name,
|
|
43
|
+
icon: /* @__PURE__ */ V(f, { className: "size-4 text-muted-foreground" })
|
|
44
44
|
}],
|
|
45
45
|
titleActions: /* @__PURE__ */ V(G, {
|
|
46
|
-
items: () => K(
|
|
47
|
-
label: a("moreActionsFor", { name:
|
|
46
|
+
items: () => K(p),
|
|
47
|
+
label: a("moreActionsFor", { name: p.name }),
|
|
48
48
|
visible: !0
|
|
49
49
|
}),
|
|
50
|
-
actions: /* @__PURE__ */ H(B, { children: [
|
|
50
|
+
actions: /* @__PURE__ */ H(B, { children: [g.update.isPending && /* @__PURE__ */ V("span", {
|
|
51
51
|
className: "text-xs text-muted-foreground",
|
|
52
52
|
role: "status",
|
|
53
53
|
children: a("saving")
|
|
54
|
-
}),
|
|
54
|
+
}), w && /* @__PURE__ */ V(E, {
|
|
55
55
|
type: "button",
|
|
56
56
|
size: "sm",
|
|
57
57
|
onClick: () => U({
|
|
58
58
|
kind: "edit",
|
|
59
|
-
entry:
|
|
59
|
+
entry: p
|
|
60
60
|
}),
|
|
61
61
|
children: r("editDetails")
|
|
62
62
|
})] })
|
|
@@ -66,66 +66,66 @@ function K() {
|
|
|
66
66
|
children: /* @__PURE__ */ H("article", {
|
|
67
67
|
className: "mx-auto w-full max-w-3xl px-4 pt-6 pb-20 md:px-8 md:pt-10",
|
|
68
68
|
onContextMenu: (e) => {
|
|
69
|
-
e.target instanceof Element && e.target.closest("textarea, .ProseMirror") || s(e, K(
|
|
69
|
+
e.target instanceof Element && e.target.closest("textarea, .ProseMirror") || s(e, K(p));
|
|
70
70
|
},
|
|
71
71
|
children: [
|
|
72
|
-
|
|
72
|
+
p.archivedAt && /* @__PURE__ */ H("div", {
|
|
73
73
|
className: "mb-6 flex items-center gap-3 rounded-xl border border-border bg-muted px-3 py-2 text-sm",
|
|
74
74
|
children: [/* @__PURE__ */ V("span", {
|
|
75
75
|
className: "min-w-0 flex-1",
|
|
76
76
|
children: r("archivedNotice")
|
|
77
|
-
}),
|
|
77
|
+
}), b && /* @__PURE__ */ V(E, {
|
|
78
78
|
type: "button",
|
|
79
79
|
size: "sm",
|
|
80
|
-
onClick: () =>
|
|
80
|
+
onClick: () => g.restore.mutate(p.id),
|
|
81
81
|
children: r("restore")
|
|
82
82
|
})]
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ V(q, {
|
|
85
85
|
workspace: e,
|
|
86
|
-
entry:
|
|
86
|
+
entry: p
|
|
87
87
|
}),
|
|
88
88
|
/* @__PURE__ */ V("h1", {
|
|
89
89
|
className: "sr-only",
|
|
90
|
-
children:
|
|
90
|
+
children: p.name
|
|
91
91
|
}),
|
|
92
92
|
/* @__PURE__ */ V(A, {
|
|
93
|
-
value:
|
|
93
|
+
value: p.name,
|
|
94
94
|
onCommit: (e) => $({ name: e }),
|
|
95
|
-
readOnly: !
|
|
95
|
+
readOnly: !w,
|
|
96
96
|
"aria-label": r("name"),
|
|
97
97
|
maxLength: 100,
|
|
98
|
-
className:
|
|
98
|
+
className: ie ? "mt-2 text-muted-foreground line-through" : "mt-2"
|
|
99
99
|
}),
|
|
100
|
-
|
|
100
|
+
p.aliases.length > 0 && /* @__PURE__ */ V("p", {
|
|
101
101
|
className: "mt-1 text-sm text-muted-foreground",
|
|
102
|
-
children: r("alsoCalled", { names:
|
|
102
|
+
children: r("alsoCalled", { names: p.aliases.join(", ") })
|
|
103
103
|
}),
|
|
104
104
|
/* @__PURE__ */ V(A, {
|
|
105
|
-
value:
|
|
105
|
+
value: p.definition,
|
|
106
106
|
onCommit: (e) => $({ definition: e }),
|
|
107
|
-
readOnly: !
|
|
107
|
+
readOnly: !w,
|
|
108
108
|
"aria-label": r("definition"),
|
|
109
109
|
placeholder: r("definitionPlaceholder"),
|
|
110
110
|
maxLength: 1e3,
|
|
111
111
|
size: "lg",
|
|
112
112
|
className: "mt-3 text-base leading-relaxed font-normal tracking-normal text-muted-foreground"
|
|
113
113
|
}),
|
|
114
|
-
(
|
|
114
|
+
(p.supersededBy || Q.length > 0) && /* @__PURE__ */ H("div", {
|
|
115
115
|
className: "mt-3 space-y-1 text-sm",
|
|
116
|
-
children: [
|
|
116
|
+
children: [p.supersededBy && /* @__PURE__ */ V(S, {
|
|
117
117
|
to: "/$workspace/knowledge/$term",
|
|
118
118
|
params: {
|
|
119
119
|
workspace: e,
|
|
120
|
-
term:
|
|
120
|
+
term: v(h.find((e) => e.id === p.supersededBy) ?? { id: p.supersededBy })
|
|
121
121
|
},
|
|
122
122
|
className: "block text-primary hover:underline",
|
|
123
|
-
children: r("supersededBy", { name:
|
|
124
|
-
}), Q.map((t) => /* @__PURE__ */ V(
|
|
123
|
+
children: r("supersededBy", { name: p.supersededByName ?? "" })
|
|
124
|
+
}), Q.map((t) => /* @__PURE__ */ V(S, {
|
|
125
125
|
to: "/$workspace/knowledge/$term",
|
|
126
126
|
params: {
|
|
127
127
|
workspace: e,
|
|
128
|
-
term:
|
|
128
|
+
term: v(t)
|
|
129
129
|
},
|
|
130
130
|
className: "block text-muted-foreground hover:text-foreground",
|
|
131
131
|
children: r("replaces", { name: t.name })
|
|
@@ -135,12 +135,12 @@ function K() {
|
|
|
135
135
|
"aria-label": r("page"),
|
|
136
136
|
className: "mt-8 border-t border-border pt-6",
|
|
137
137
|
children: [
|
|
138
|
-
|
|
139
|
-
value:
|
|
140
|
-
editable:
|
|
138
|
+
w || p.body ? /* @__PURE__ */ V(ee, {
|
|
139
|
+
value: p.body ?? "",
|
|
140
|
+
editable: w,
|
|
141
141
|
placeholder: r("pagePlaceholder"),
|
|
142
142
|
label: r("page"),
|
|
143
|
-
onBlur: (e) => e !== (
|
|
143
|
+
onBlur: (e) => e !== (p.body ?? "") && $({ body: e }),
|
|
144
144
|
onFiles: (e, t) => Z.upload(X.current, e, t),
|
|
145
145
|
onEditor: (e) => {
|
|
146
146
|
X.current = e;
|
|
@@ -150,7 +150,7 @@ function K() {
|
|
|
150
150
|
className: "text-sm text-muted-foreground",
|
|
151
151
|
children: r("noPage")
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
w && /* @__PURE__ */ H("div", {
|
|
154
154
|
className: "mt-3 flex items-center gap-2",
|
|
155
155
|
children: [
|
|
156
156
|
/* @__PURE__ */ V(c, { onFiles: (e) => Z.upload(X.current, e) }),
|
|
@@ -167,24 +167,30 @@ function K() {
|
|
|
167
167
|
})
|
|
168
168
|
]
|
|
169
169
|
}),
|
|
170
|
-
|
|
170
|
+
g.update.isError && /* @__PURE__ */ V(D, {
|
|
171
171
|
className: "mt-2",
|
|
172
|
-
children:
|
|
172
|
+
children: d(g.update.error)
|
|
173
173
|
})
|
|
174
174
|
]
|
|
175
175
|
}),
|
|
176
|
-
/* @__PURE__ */ V(N, {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
176
|
+
/* @__PURE__ */ V(N, {
|
|
177
|
+
fallback: /* @__PURE__ */ V(O, { fill: "section" }),
|
|
178
|
+
children: /* @__PURE__ */ V(J, {
|
|
179
|
+
workspace: e,
|
|
180
|
+
entryId: p.id
|
|
181
|
+
})
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ V(N, {
|
|
184
|
+
fallback: /* @__PURE__ */ V(O, { fill: "section" }),
|
|
185
|
+
children: /* @__PURE__ */ V(Y, {
|
|
186
|
+
workspace: e,
|
|
187
|
+
entryId: p.id
|
|
188
|
+
})
|
|
189
|
+
})
|
|
184
190
|
]
|
|
185
191
|
})
|
|
186
192
|
}),
|
|
187
|
-
k && /* @__PURE__ */ V(N, { children: /* @__PURE__ */ V(
|
|
193
|
+
k && /* @__PURE__ */ V(N, { children: /* @__PURE__ */ V(_, {
|
|
188
194
|
workspace: e,
|
|
189
195
|
mode: k,
|
|
190
196
|
onClose: () => j(null),
|
|
@@ -192,16 +198,16 @@ function K() {
|
|
|
192
198
|
to: "/$workspace/knowledge/$term",
|
|
193
199
|
params: {
|
|
194
200
|
workspace: e,
|
|
195
|
-
term:
|
|
201
|
+
term: v(t)
|
|
196
202
|
},
|
|
197
|
-
replace: t.id ===
|
|
203
|
+
replace: t.id === p.id
|
|
198
204
|
})
|
|
199
205
|
}) })
|
|
200
206
|
]
|
|
201
207
|
});
|
|
202
208
|
}
|
|
203
209
|
function q({ workspace: t, entry: n }) {
|
|
204
|
-
let r = z("knowledge"), { actorName: i } =
|
|
210
|
+
let r = z("knowledge"), { actorName: i } = b(t), a = w(), { data: o = [] } = U(e(t)), s = o.find((e) => e.id === n.areaId), c = n.source.doc, l = [
|
|
205
211
|
...n.kind === "term" ? [] : [r(`kind.${n.kind}`)],
|
|
206
212
|
...s ? [s.title] : [],
|
|
207
213
|
r("writtenBy", { name: i(n.creator) }),
|
|
@@ -227,15 +233,15 @@ function q({ workspace: t, entry: n }) {
|
|
|
227
233
|
}), (c || n.source.identifier) && /* @__PURE__ */ H("p", {
|
|
228
234
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
229
235
|
children: [
|
|
230
|
-
c && /* @__PURE__ */ H(
|
|
236
|
+
c && /* @__PURE__ */ H(S, {
|
|
231
237
|
to: "/$workspace/docs/$doc",
|
|
232
238
|
params: {
|
|
233
239
|
workspace: t,
|
|
234
|
-
doc:
|
|
240
|
+
doc: h(c)
|
|
235
241
|
},
|
|
236
|
-
...n.source.section && { hash:
|
|
242
|
+
...n.source.section && { hash: g(n.source.section) },
|
|
237
243
|
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
238
|
-
children: [/* @__PURE__ */ V(
|
|
244
|
+
children: [/* @__PURE__ */ V(d, { className: "size-3" }), n.source.section ? r("sourceSection", {
|
|
239
245
|
doc: c.title,
|
|
240
246
|
section: n.source.section
|
|
241
247
|
}) : c.title]
|
|
@@ -244,7 +250,7 @@ function q({ workspace: t, entry: n }) {
|
|
|
244
250
|
className: "text-warning",
|
|
245
251
|
children: r("sourceMissing", { section: n.source.section ?? "" })
|
|
246
252
|
}),
|
|
247
|
-
n.source.identifier && /* @__PURE__ */ H(
|
|
253
|
+
n.source.identifier && /* @__PURE__ */ H(S, {
|
|
248
254
|
to: "/$workspace/issues/$identifier",
|
|
249
255
|
params: {
|
|
250
256
|
workspace: t,
|
|
@@ -279,7 +285,7 @@ function J({ workspace: e, entryId: t }) {
|
|
|
279
285
|
children: n("mentionedNone")
|
|
280
286
|
}) : /* @__PURE__ */ H("ul", {
|
|
281
287
|
className: "divide-y divide-border overflow-hidden rounded-xl border border-border bg-card",
|
|
282
|
-
children: [i.issues.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(
|
|
288
|
+
children: [i.issues.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(S, {
|
|
283
289
|
to: "/$workspace/issues/$identifier",
|
|
284
290
|
params: {
|
|
285
291
|
workspace: e,
|
|
@@ -287,7 +293,7 @@ function J({ workspace: e, entryId: t }) {
|
|
|
287
293
|
},
|
|
288
294
|
className: o,
|
|
289
295
|
children: [
|
|
290
|
-
/* @__PURE__ */ V(
|
|
296
|
+
/* @__PURE__ */ V(p, {
|
|
291
297
|
category: t.statusCategory,
|
|
292
298
|
className: "size-3.5 shrink-0"
|
|
293
299
|
}),
|
|
@@ -300,15 +306,15 @@ function J({ workspace: e, entryId: t }) {
|
|
|
300
306
|
children: t.title
|
|
301
307
|
})
|
|
302
308
|
]
|
|
303
|
-
}) }, t.identifier)), i.docs.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(
|
|
309
|
+
}) }, t.identifier)), i.docs.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(S, {
|
|
304
310
|
to: "/$workspace/docs/$doc",
|
|
305
311
|
params: {
|
|
306
312
|
workspace: e,
|
|
307
|
-
doc:
|
|
313
|
+
doc: h(t)
|
|
308
314
|
},
|
|
309
315
|
className: o,
|
|
310
316
|
children: [
|
|
311
|
-
/* @__PURE__ */ V(
|
|
317
|
+
/* @__PURE__ */ V(d, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
312
318
|
/* @__PURE__ */ V("span", {
|
|
313
319
|
className: "w-16 shrink-0 text-xs text-muted-foreground",
|
|
314
320
|
children: n("doc")
|
|
@@ -323,7 +329,7 @@ function J({ workspace: e, entryId: t }) {
|
|
|
323
329
|
});
|
|
324
330
|
}
|
|
325
331
|
function Y({ workspace: e, entryId: t }) {
|
|
326
|
-
let r = z("knowledge.history"), { data: i = [] } = U(n(e, t)), { actorName: c } =
|
|
332
|
+
let r = z("knowledge.history"), { data: i = [] } = U(n(e, t)), { actorName: c } = b(e);
|
|
327
333
|
return i.length === 0 ? null : /* @__PURE__ */ V(k, {
|
|
328
334
|
title: r("title"),
|
|
329
335
|
variant: "bare",
|