@parallelworks/tandem-web 0.171.2 → 0.171.3
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 +5 -2
- package/_virtual/_virtual_i18n/es/common.js +5 -2
- package/_virtual/_virtual_i18n/ja/common.js +5 -2
- package/_virtual/_virtual_i18n/ko/common.js +5 -2
- package/_virtual/_virtual_i18n/zh/common.js +5 -2
- package/components/ActivityTimeline.js +56 -56
- package/components/ActorLink.js +34 -0
- package/components/Attachments.js +67 -63
- package/components/CodeHostSettings.js +94 -60
- package/components/DashboardPanel.js +189 -152
- package/components/IssueEvent.js +91 -86
- package/components/IssueSentry.js +34 -32
- package/components/Widgets.js +96 -94
- package/lib/triageSeen.js +2 -2
- package/package.json +1 -1
- package/pages/triage.js +153 -163
- package/routes/_workspace/issues/_identifier2.js +273 -276
- package/routes/_workspace/knowledge/_term2.js +94 -92
- package/routes/_workspace/knowledge/index2.js +101 -99
|
@@ -8,47 +8,47 @@ import { usePageTitle as u } from "../../../lib/pageTitle.js";
|
|
|
8
8
|
import { Link as d, useNavigate as f } from "../../../lib/router.js";
|
|
9
9
|
import { useTime as p } from "../../../lib/time.js";
|
|
10
10
|
import { Route as m } from "./index.js";
|
|
11
|
-
import { Button as h, EmptyState as g, SearchInput as _, SegmentedControl as v,
|
|
12
|
-
import { Suspense as
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { useQuery as
|
|
11
|
+
import { Button as h, EmptyState as g, SearchInput as _, SegmentedControl as v, Tooltip as y, buttonClasses as b, useOpenMenu as x } from "@parallelworks/ui";
|
|
12
|
+
import { Suspense as S, useCallback as C, useEffect as w, useMemo as T, useState as E } from "react";
|
|
13
|
+
import { useLocale as D, useTranslations as O } from "use-intl";
|
|
14
|
+
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
15
|
+
import { useQuery as M, useSuspenseQuery as N } from "@tanstack/react-query";
|
|
16
16
|
// src/routes/$workspace/knowledge/index.tsx?tsr-split=component
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
let { workspace: r } = m.useParams(), { archived: s, kind: p = "all" } = m.useSearch(),
|
|
20
|
-
u(
|
|
21
|
-
let I = f(), [
|
|
22
|
-
|
|
23
|
-
let e = setTimeout(() =>
|
|
17
|
+
var P = 5, F = 8;
|
|
18
|
+
function I() {
|
|
19
|
+
let { workspace: r } = m.useParams(), { archived: s, kind: p = "all" } = m.useSearch(), y = O("knowledge"), x = D();
|
|
20
|
+
u(y("title"));
|
|
21
|
+
let I = f(), [R, z] = E(""), [B, V] = E(""), [H, U] = E(null);
|
|
22
|
+
w(() => {
|
|
23
|
+
let e = setTimeout(() => V(R.trim()), 200);
|
|
24
24
|
return () => clearTimeout(e);
|
|
25
|
-
}, [
|
|
26
|
-
let { data:
|
|
27
|
-
...
|
|
25
|
+
}, [R]);
|
|
26
|
+
let { data: W } = N(t(r)), { data: G = [] } = M(e(r)), K = {
|
|
27
|
+
...B && { q: B },
|
|
28
28
|
...s && { archived: !0 }
|
|
29
|
-
}, { data:
|
|
30
|
-
...t(r,
|
|
31
|
-
enabled: !!
|
|
32
|
-
}),
|
|
29
|
+
}, { data: q } = M({
|
|
30
|
+
...t(r, K),
|
|
31
|
+
enabled: !!B || !!s
|
|
32
|
+
}), J = !!B || !!s, Y = J ? q ?? [] : W, X = p === "all" ? Y : Y.filter((e) => e.kind === p), Z = C((e) => U(e), []), Q = T(() => {
|
|
33
33
|
let e = /* @__PURE__ */ new Map();
|
|
34
|
-
for (let t of
|
|
34
|
+
for (let t of Y) e.set(t.kind, (e.get(t.kind) ?? 0) + 1);
|
|
35
35
|
return e;
|
|
36
|
-
}, [
|
|
37
|
-
let e = new Intl.Collator(
|
|
38
|
-
for (let e of
|
|
39
|
-
let n =
|
|
36
|
+
}, [Y]), ee = T(() => [...X].sort((e, t) => t.updatedAt.localeCompare(e.updatedAt)).slice(0, P), [X]), te = T(() => {
|
|
37
|
+
let e = new Intl.Collator(x, { sensitivity: "base" }), t = /* @__PURE__ */ new Map();
|
|
38
|
+
for (let e of X) {
|
|
39
|
+
let n = G.some((t) => t.id === e.areaId) ? e.areaId : "";
|
|
40
40
|
t.set(n, [...t.get(n) ?? [], e]);
|
|
41
41
|
}
|
|
42
42
|
return [...t].map(([t, n]) => ({
|
|
43
43
|
id: t,
|
|
44
|
-
title:
|
|
44
|
+
title: G.find((e) => e.id === t)?.title ?? y("general"),
|
|
45
45
|
entries: n.sort((t, n) => e.compare(t.name, n.name))
|
|
46
46
|
})).sort((t, n) => t.id ? n.id ? e.compare(t.title, n.title) : -1 : 1);
|
|
47
47
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
X,
|
|
49
|
+
G,
|
|
50
|
+
x,
|
|
51
|
+
y
|
|
52
52
|
]), ne = (e) => I({
|
|
53
53
|
to: "/$workspace/knowledge",
|
|
54
54
|
params: { workspace: r },
|
|
@@ -57,73 +57,73 @@ function P() {
|
|
|
57
57
|
...e !== "all" && { kind: e }
|
|
58
58
|
},
|
|
59
59
|
replace: !0
|
|
60
|
-
}), $ = c.filter((e) =>
|
|
61
|
-
return /* @__PURE__ */
|
|
60
|
+
}), $ = c.filter((e) => Q.has(e) || e === p);
|
|
61
|
+
return /* @__PURE__ */ j("div", {
|
|
62
62
|
className: "flex h-full flex-col",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ j("header", {
|
|
65
65
|
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ A("h1", {
|
|
68
68
|
className: "min-w-0 truncate text-sm font-semibold",
|
|
69
|
-
children:
|
|
69
|
+
children: y("title")
|
|
70
70
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ A(n, {
|
|
72
72
|
workspace: r,
|
|
73
73
|
kind: "page",
|
|
74
74
|
target: "knowledge"
|
|
75
75
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ A("span", {
|
|
77
77
|
className: "whitespace-nowrap text-xs text-muted-foreground tabular-nums",
|
|
78
|
-
children:
|
|
78
|
+
children: y("count", { count: W.length })
|
|
79
79
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ A(d, {
|
|
81
81
|
to: "/$workspace/graph",
|
|
82
82
|
params: { workspace: r },
|
|
83
|
-
className: `${
|
|
84
|
-
children:
|
|
83
|
+
className: `${b({ size: "sm" })} ml-auto`,
|
|
84
|
+
children: y("graph")
|
|
85
85
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ j(h, {
|
|
87
87
|
type: "button",
|
|
88
88
|
variant: "primary",
|
|
89
89
|
size: "sm",
|
|
90
|
-
onClick: () =>
|
|
91
|
-
children: [/* @__PURE__ */
|
|
90
|
+
onClick: () => Z({ kind: "create" }),
|
|
91
|
+
children: [/* @__PURE__ */ A(i, { className: "size-3.5" }), /* @__PURE__ */ A("span", {
|
|
92
92
|
className: "max-md:sr-only",
|
|
93
|
-
children:
|
|
93
|
+
children: y("new")
|
|
94
94
|
})]
|
|
95
95
|
})
|
|
96
96
|
]
|
|
97
97
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ A("div", {
|
|
99
99
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ j("div", {
|
|
101
101
|
className: "mx-auto w-full max-w-3xl px-4 pt-8 pb-16 md:px-8",
|
|
102
102
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
value:
|
|
105
|
-
onValueChange:
|
|
106
|
-
label:
|
|
103
|
+
/* @__PURE__ */ A(_, {
|
|
104
|
+
value: R,
|
|
105
|
+
onValueChange: z,
|
|
106
|
+
label: y("search"),
|
|
107
107
|
size: "lg",
|
|
108
108
|
className: "w-full"
|
|
109
109
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ j("div", {
|
|
111
111
|
className: "mt-4 flex flex-wrap items-center gap-2",
|
|
112
|
-
children: [$.length > 1 && /* @__PURE__ */
|
|
113
|
-
label:
|
|
112
|
+
children: [$.length > 1 && /* @__PURE__ */ A(v, {
|
|
113
|
+
label: y("kindLabel"),
|
|
114
114
|
size: "sm",
|
|
115
115
|
value: p,
|
|
116
116
|
onValueChange: ne,
|
|
117
117
|
options: [{
|
|
118
118
|
value: "all",
|
|
119
|
-
label:
|
|
120
|
-
count:
|
|
119
|
+
label: y("allKinds"),
|
|
120
|
+
count: Y.length
|
|
121
121
|
}, ...$.map((e) => ({
|
|
122
122
|
value: e,
|
|
123
|
-
label:
|
|
124
|
-
count:
|
|
123
|
+
label: y(`kinds.${e}`),
|
|
124
|
+
count: Q.get(e) ?? 0
|
|
125
125
|
}))]
|
|
126
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ A(d, {
|
|
127
127
|
to: "/$workspace/knowledge",
|
|
128
128
|
params: { workspace: r },
|
|
129
129
|
search: {
|
|
@@ -131,48 +131,48 @@ function P() {
|
|
|
131
131
|
...p !== "all" && { kind: p }
|
|
132
132
|
},
|
|
133
133
|
"aria-current": s || void 0,
|
|
134
|
-
className: `${
|
|
134
|
+
className: `${b({
|
|
135
135
|
size: "sm",
|
|
136
136
|
variant: s ? "secondary" : "ghost"
|
|
137
137
|
})} ml-auto`,
|
|
138
|
-
children:
|
|
138
|
+
children: y("archived")
|
|
139
139
|
})]
|
|
140
140
|
}),
|
|
141
|
-
|
|
142
|
-
icon: /* @__PURE__ */
|
|
143
|
-
title:
|
|
144
|
-
description:
|
|
145
|
-
action: !
|
|
141
|
+
X.length === 0 ? /* @__PURE__ */ A(g, {
|
|
142
|
+
icon: /* @__PURE__ */ A(a, {}),
|
|
143
|
+
title: y(J || p !== "all" ? "noMatches" : "emptyTitle"),
|
|
144
|
+
description: J || p !== "all" ? void 0 : y("empty"),
|
|
145
|
+
action: !J && p === "all" ? /* @__PURE__ */ A(h, {
|
|
146
146
|
type: "button",
|
|
147
147
|
variant: "primary",
|
|
148
|
-
onClick: () =>
|
|
149
|
-
children:
|
|
148
|
+
onClick: () => Z({ kind: "create" }),
|
|
149
|
+
children: y("new")
|
|
150
150
|
}) : void 0,
|
|
151
151
|
className: "mt-16"
|
|
152
|
-
}) :
|
|
152
|
+
}) : J ? /* @__PURE__ */ A(L, {
|
|
153
153
|
workspace: r,
|
|
154
|
-
title:
|
|
155
|
-
entries:
|
|
156
|
-
onOpen:
|
|
157
|
-
}) : /* @__PURE__ */ k
|
|
154
|
+
title: y("results"),
|
|
155
|
+
entries: X,
|
|
156
|
+
onOpen: Z
|
|
157
|
+
}) : /* @__PURE__ */ j(k, { children: [X.length >= F && /* @__PURE__ */ A(L, {
|
|
158
158
|
workspace: r,
|
|
159
|
-
title:
|
|
160
|
-
entries:
|
|
161
|
-
onOpen:
|
|
159
|
+
title: y("recent"),
|
|
160
|
+
entries: ee,
|
|
161
|
+
onOpen: Z,
|
|
162
162
|
showTime: !0
|
|
163
|
-
}), te.map((e) => /* @__PURE__ */
|
|
163
|
+
}), te.map((e) => /* @__PURE__ */ A(L, {
|
|
164
164
|
workspace: r,
|
|
165
165
|
title: e.title,
|
|
166
166
|
entries: e.entries,
|
|
167
|
-
onOpen:
|
|
167
|
+
onOpen: Z
|
|
168
168
|
}, e.id || "general"))] })
|
|
169
169
|
]
|
|
170
170
|
})
|
|
171
171
|
}),
|
|
172
|
-
|
|
172
|
+
H && /* @__PURE__ */ A(S, { children: /* @__PURE__ */ A(o, {
|
|
173
173
|
workspace: r,
|
|
174
|
-
mode:
|
|
175
|
-
onClose: () =>
|
|
174
|
+
mode: H,
|
|
175
|
+
onClose: () => U(null),
|
|
176
176
|
onSaved: (e) => I({
|
|
177
177
|
to: "/$workspace/knowledge/$term",
|
|
178
178
|
params: {
|
|
@@ -184,20 +184,20 @@ function P() {
|
|
|
184
184
|
]
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
let o =
|
|
189
|
-
return /* @__PURE__ */
|
|
187
|
+
function L({ workspace: e, title: t, entries: n, onOpen: i, showTime: a = !1 }) {
|
|
188
|
+
let o = O("knowledge"), c = x(), u = s(e, i), f = p();
|
|
189
|
+
return /* @__PURE__ */ j("section", {
|
|
190
190
|
"aria-label": t,
|
|
191
191
|
className: "mt-10",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ j("h2", {
|
|
193
193
|
className: "flex items-baseline gap-2 text-base font-semibold",
|
|
194
|
-
children: [t, /* @__PURE__ */
|
|
194
|
+
children: [t, /* @__PURE__ */ A("span", {
|
|
195
195
|
className: "text-xs font-normal text-muted-foreground tabular-nums",
|
|
196
196
|
children: n.length
|
|
197
197
|
})]
|
|
198
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), /* @__PURE__ */ A("ul", {
|
|
199
199
|
className: "mt-3 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card",
|
|
200
|
-
children: n.map((t) => /* @__PURE__ */
|
|
200
|
+
children: n.map((t) => /* @__PURE__ */ A("li", { children: /* @__PURE__ */ j(d, {
|
|
201
201
|
to: "/$workspace/knowledge/$term",
|
|
202
202
|
params: {
|
|
203
203
|
workspace: e,
|
|
@@ -205,25 +205,27 @@ function F({ workspace: e, title: t, entries: n, onOpen: i, showTime: a = !1 })
|
|
|
205
205
|
},
|
|
206
206
|
onContextMenu: (e) => c(e, u(t)),
|
|
207
207
|
className: "group flex flex-col gap-1 px-4 py-3 sm:flex-row sm:items-start sm:gap-3 transition-colors duration-150 hover:bg-muted focus-visible:outline-offset-[-2px]",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ j("span", {
|
|
209
209
|
className: "min-w-0 flex-1",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ A("span", {
|
|
211
211
|
className: `block truncate text-sm font-medium ${t.status === "superseded" ? "text-muted-foreground line-through" : ""}`,
|
|
212
212
|
children: t.name
|
|
213
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ A("span", {
|
|
214
214
|
className: "mt-0.5 line-clamp-2 text-xs leading-5 text-muted-foreground",
|
|
215
215
|
children: t.definition
|
|
216
216
|
})]
|
|
217
|
-
}), (t.kind !== "term" || t.status === "added" || a) && /* @__PURE__ */
|
|
217
|
+
}), (t.kind !== "term" || t.status === "added" || a) && /* @__PURE__ */ j("span", {
|
|
218
218
|
className: "flex items-center gap-2 text-xs text-muted-foreground sm:shrink-0 sm:pt-0.5",
|
|
219
219
|
children: [
|
|
220
|
-
t.kind !== "term" && /* @__PURE__ */
|
|
221
|
-
t.status === "added" && /* @__PURE__ */
|
|
222
|
-
a && /* @__PURE__ */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
220
|
+
t.kind !== "term" && /* @__PURE__ */ A("span", { children: o(`kind.${t.kind}`) }),
|
|
221
|
+
t.status === "added" && /* @__PURE__ */ A(r, { status: t.status }),
|
|
222
|
+
a && /* @__PURE__ */ A(y, {
|
|
223
|
+
content: f.full(t.updatedAt),
|
|
224
|
+
children: /* @__PURE__ */ A("time", {
|
|
225
|
+
dateTime: t.updatedAt,
|
|
226
|
+
className: "tabular-nums",
|
|
227
|
+
children: f.relative(t.updatedAt)
|
|
228
|
+
})
|
|
227
229
|
})
|
|
228
230
|
]
|
|
229
231
|
})]
|
|
@@ -231,4 +233,4 @@ function F({ workspace: e, title: t, entries: n, onOpen: i, showTime: a = !1 })
|
|
|
231
233
|
})]
|
|
232
234
|
});
|
|
233
235
|
}
|
|
234
|
-
export {
|
|
236
|
+
export { I as component };
|