@parallelworks/tandem-web 0.188.1 → 0.189.1
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 +3 -0
- package/_virtual/_virtual_i18n/es/common.js +3 -0
- package/_virtual/_virtual_i18n/ja/common.js +3 -0
- package/_virtual/_virtual_i18n/ko/common.js +3 -0
- package/_virtual/_virtual_i18n/zh/common.js +3 -0
- package/components/HoverCards.js +118 -115
- package/components/SubpageViews.js +335 -270
- package/package.json +1 -1
- package/pages/issues.js +306 -306
- package/routes/_workspace2.js +5 -4
|
@@ -4108,6 +4108,9 @@ var e = {
|
|
|
4108
4108
|
removeView: "Remove view",
|
|
4109
4109
|
makeSeriesDoc: "Make the {series} notes for this day",
|
|
4110
4110
|
newOn: "New sub-page on {date}",
|
|
4111
|
+
emptyPage: "Empty page",
|
|
4112
|
+
fromTemplateDefault: "{template} (default)",
|
|
4113
|
+
moreOnDay: "{count} more",
|
|
4111
4114
|
previousMonth: "Previous month",
|
|
4112
4115
|
today: "Today",
|
|
4113
4116
|
nextMonth: "Next month",
|
|
@@ -4108,6 +4108,9 @@ var e = {
|
|
|
4108
4108
|
removeView: "Quitar vista",
|
|
4109
4109
|
makeSeriesDoc: "Crear las notas de {series} de este día",
|
|
4110
4110
|
newOn: "Nueva subpágina el {date}",
|
|
4111
|
+
emptyPage: "Página vacía",
|
|
4112
|
+
fromTemplateDefault: "{template} (predeterminada)",
|
|
4113
|
+
moreOnDay: "{count} más",
|
|
4111
4114
|
previousMonth: "Mes anterior",
|
|
4112
4115
|
today: "Hoy",
|
|
4113
4116
|
nextMonth: "Mes siguiente",
|
|
@@ -4108,6 +4108,9 @@ var e = {
|
|
|
4108
4108
|
removeView: "ビューを削除",
|
|
4109
4109
|
makeSeriesDoc: "この日の {series} のノートを作成",
|
|
4110
4110
|
newOn: "{date} の新しいサブページ",
|
|
4111
|
+
emptyPage: "空のページ",
|
|
4112
|
+
fromTemplateDefault: "{template}(既定)",
|
|
4113
|
+
moreOnDay: "他 {count} 件",
|
|
4111
4114
|
previousMonth: "前の月",
|
|
4112
4115
|
today: "今日",
|
|
4113
4116
|
nextMonth: "次の月",
|
|
@@ -4108,6 +4108,9 @@ var e = {
|
|
|
4108
4108
|
removeView: "보기 삭제",
|
|
4109
4109
|
makeSeriesDoc: "이 날의 {series} 노트 만들기",
|
|
4110
4110
|
newOn: "{date}에 새 하위 페이지",
|
|
4111
|
+
emptyPage: "빈 페이지",
|
|
4112
|
+
fromTemplateDefault: "{template} (기본)",
|
|
4113
|
+
moreOnDay: "{count}개 더",
|
|
4111
4114
|
previousMonth: "이전 달",
|
|
4112
4115
|
today: "오늘",
|
|
4113
4116
|
nextMonth: "다음 달",
|
|
@@ -4108,6 +4108,9 @@ var e = {
|
|
|
4108
4108
|
removeView: "删除视图",
|
|
4109
4109
|
makeSeriesDoc: "创建这一天的 {series} 记录",
|
|
4110
4110
|
newOn: "在 {date} 新建子页面",
|
|
4111
|
+
emptyPage: "空白页面",
|
|
4112
|
+
fromTemplateDefault: "{template}(默认)",
|
|
4113
|
+
moreOnDay: "还有 {count} 篇",
|
|
4111
4114
|
previousMonth: "上个月",
|
|
4112
4115
|
today: "今天",
|
|
4113
4116
|
nextMonth: "下个月",
|
package/components/HoverCards.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { docQuery as n, docsQuery as r, knowledgeQuery as i, membersQuery as a, teamsQuery as o } from "../api/queries.js";
|
|
3
|
-
import { appPath as s } from "../lib/base.js";
|
|
4
|
-
import { docLooks as
|
|
5
|
-
import { docKey as
|
|
6
|
-
import { glossary as
|
|
7
|
-
import { issueRefs as
|
|
8
|
-
import { useTermRefs as
|
|
9
|
-
import { termRef as
|
|
10
|
-
import { mentionable as
|
|
11
|
-
import { Link as
|
|
12
|
-
import { teamNames as
|
|
13
|
-
import { DocIcon as
|
|
14
|
-
import { termCaretEvent as
|
|
15
|
-
import { FileTextIcon as
|
|
16
|
-
import { PersonCard as
|
|
17
|
-
import { HoverCard as
|
|
18
|
-
import { useEffect as
|
|
19
|
-
import { useTranslations as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { useQuery as
|
|
3
|
+
import { appPath as s, basePath as c } from "../lib/base.js";
|
|
4
|
+
import { docLooks as l } from "../lib/docLooks.js";
|
|
5
|
+
import { docKey as u, docRef as d } from "../lib/docs.js";
|
|
6
|
+
import { glossary as f, headingAnchor as p } from "../lib/glossary.js";
|
|
7
|
+
import { issueRefs as m } from "../lib/issueRefs.js";
|
|
8
|
+
import { useTermRefs as h } from "../lib/knowledge.js";
|
|
9
|
+
import { termRef as g } from "../lib/knowledgeKinds.js";
|
|
10
|
+
import { mentionable as _ } from "../lib/mentions.js";
|
|
11
|
+
import { Link as v, useNavigate as y } from "../lib/router.js";
|
|
12
|
+
import { teamNames as b } from "../lib/teamNames.js";
|
|
13
|
+
import { DocIcon as x } from "./DocIcon.js";
|
|
14
|
+
import { termCaretEvent as S } from "./editorPlugins.js";
|
|
15
|
+
import { FileTextIcon as C } from "./icons.js";
|
|
16
|
+
import { PersonCard as w } from "./PersonHoverCard.js";
|
|
17
|
+
import { HoverCard as T, Loader as E } from "@parallelworks/ui";
|
|
18
|
+
import { useEffect as D, useRef as O, useState as k } from "react";
|
|
19
|
+
import { useTranslations as A } from "use-intl";
|
|
20
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
21
|
+
import { useQuery as P, useQueryClient as F } from "@tanstack/react-query";
|
|
22
22
|
// src/components/HoverCards.tsx
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
let t = e?.closest(
|
|
23
|
+
var I = ".kb-term, .person-mention, .prose-issue a[href*=\"/docs/\"]", L = 300, R = 200;
|
|
24
|
+
function z(e) {
|
|
25
|
+
let t = e?.closest(I);
|
|
26
26
|
if (!t) return null;
|
|
27
27
|
if (t.classList.contains("kb-term")) {
|
|
28
28
|
let e = t.dataset.term;
|
|
@@ -44,45 +44,46 @@ function R(e) {
|
|
|
44
44
|
return r?.[1] ? {
|
|
45
45
|
kind: "doc",
|
|
46
46
|
el: t,
|
|
47
|
-
key:
|
|
47
|
+
key: u(r[1])
|
|
48
48
|
} : null;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function B(e) {
|
|
51
51
|
if (!e.closest(".ProseMirror")) return null;
|
|
52
52
|
let t = new URL(e.getAttribute("href") ?? "", location.href);
|
|
53
53
|
if (t.origin !== location.origin) return null;
|
|
54
54
|
let n = s(t.pathname);
|
|
55
55
|
return /^\/[^/]+\/docs\/(?!space\/)[^/]+\/?$/.test(n) ? n + t.hash : null;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
var V = (e) => location.origin + c + e;
|
|
58
|
+
function H({ workspace: n }) {
|
|
59
|
+
let [s, c] = k(null), u = O(null), d = O(void 0), { data: p } = P(i(n)), h = y(), v = O((e) => {});
|
|
60
|
+
v.current = (e) => {
|
|
61
|
+
let t = p?.find((t) => t.id === e);
|
|
62
|
+
h({
|
|
62
63
|
to: "/$workspace/knowledge/$term",
|
|
63
64
|
params: {
|
|
64
65
|
workspace: n,
|
|
65
|
-
term: t ?
|
|
66
|
+
term: t ? g(t) : e
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
let { data:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
let { data:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
let { data:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
let A =
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
}, D(() => {
|
|
70
|
+
f.set(p ?? []);
|
|
71
|
+
}, [p]), D(() => () => f.set([]), []);
|
|
72
|
+
let { data: x } = P(r(n));
|
|
73
|
+
D(() => {
|
|
74
|
+
l.set(x ?? []);
|
|
75
|
+
}, [x]), D(() => () => l.set([]), []);
|
|
76
|
+
let { data: C } = P(a(n));
|
|
77
|
+
D(() => {
|
|
78
|
+
_.set((C ?? []).map((e) => e.user.username));
|
|
79
|
+
}, [C]), D(() => () => _.set([]), []);
|
|
80
|
+
let { data: E } = P(o(n));
|
|
81
|
+
D(() => {
|
|
82
|
+
b.set(E ?? []);
|
|
83
|
+
}, [E]), D(() => () => b.set([]), []);
|
|
84
|
+
let A = F();
|
|
85
|
+
D(() => {
|
|
86
|
+
m.set(n, async (r) => {
|
|
86
87
|
let { issues: i } = t(await e.POST("/api/v1/workspaces/{workspace}/issue-refs", {
|
|
87
88
|
params: { path: { workspace: n } },
|
|
88
89
|
body: { identifiers: r }
|
|
@@ -90,42 +91,42 @@ function B({ workspace: n }) {
|
|
|
90
91
|
return new Map(i.map((e) => [e.identifier, e.issue]));
|
|
91
92
|
});
|
|
92
93
|
let r, i = A.getQueryCache().subscribe((e) => {
|
|
93
|
-
e.type === "updated" && e.query.queryKey[2] === "issues" && (clearTimeout(r), r = setTimeout(() =>
|
|
94
|
+
e.type === "updated" && e.query.queryKey[2] === "issues" && (clearTimeout(r), r = setTimeout(() => m.refresh(), 1e3));
|
|
94
95
|
});
|
|
95
96
|
return () => {
|
|
96
|
-
clearTimeout(r), i(),
|
|
97
|
+
clearTimeout(r), i(), m.set("", void 0);
|
|
97
98
|
};
|
|
98
99
|
}, [n, A]);
|
|
99
|
-
let
|
|
100
|
-
|
|
100
|
+
let j = O((e) => {});
|
|
101
|
+
j.current = (e) => h({
|
|
101
102
|
to: "/$workspace/issues/$identifier",
|
|
102
103
|
params: {
|
|
103
104
|
workspace: n,
|
|
104
105
|
identifier: e
|
|
105
106
|
}
|
|
106
107
|
});
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
let
|
|
110
|
-
|
|
108
|
+
let N = O((e) => {});
|
|
109
|
+
N.current = (e) => h({ href: e });
|
|
110
|
+
let I = O((e) => {});
|
|
111
|
+
I.current = (e) => h({
|
|
111
112
|
to: "/$workspace/teams/$key/issues",
|
|
112
113
|
params: {
|
|
113
114
|
workspace: n,
|
|
114
115
|
key: e
|
|
115
116
|
}
|
|
116
|
-
}),
|
|
117
|
+
}), D(() => {
|
|
117
118
|
let e = (e, t) => {
|
|
118
|
-
clearTimeout(
|
|
119
|
+
clearTimeout(d.current), d.current = setTimeout(e, t);
|
|
119
120
|
}, t = (t) => {
|
|
120
121
|
if (t.pointerType === "touch") return;
|
|
121
|
-
let n =
|
|
122
|
-
n && e(() =>
|
|
122
|
+
let n = z(t.target);
|
|
123
|
+
n && e(() => c(n), L);
|
|
123
124
|
}, n = (t) => {
|
|
124
125
|
let n = t.relatedTarget;
|
|
125
|
-
n && u.current?.contains(n) ||
|
|
126
|
+
n && u.current?.contains(n) || z(t.target) && e(() => c(null), R);
|
|
126
127
|
}, r = (e) => {
|
|
127
|
-
let t =
|
|
128
|
-
t && (clearTimeout(
|
|
128
|
+
let t = z(e.target);
|
|
129
|
+
t && (clearTimeout(d.current), c(t));
|
|
129
130
|
}, i = (e) => {
|
|
130
131
|
e.target.matches?.(".kb-term[tabindex], .prose-issue a[href*=\"/docs/\"]") && r(e);
|
|
131
132
|
}, a = (e) => {
|
|
@@ -136,101 +137,103 @@ function B({ workspace: n }) {
|
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
139
|
if (!t.closest("[contenteditable=\"true\"]")) {
|
|
139
|
-
e.preventDefault(),
|
|
140
|
+
e.preventDefault(), j.current(n);
|
|
140
141
|
return;
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
let a = e.target.closest?.("a[href]"), o = a && e.button === 0 ?
|
|
144
|
+
let a = e.target.closest?.("a[href]"), o = a && e.button === 0 ? B(a) : null;
|
|
144
145
|
if (a && o) {
|
|
145
|
-
e.preventDefault(),
|
|
146
|
+
e.preventDefault(), c(null), e.metaKey || e.ctrlKey || e.shiftKey ? window.open(V(o), "_blank", "noopener") : N.current(o);
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
148
|
-
let s = e.target.closest?.(".team-mention"),
|
|
149
|
-
if (s &&
|
|
150
|
-
e.preventDefault(),
|
|
149
|
+
let s = e.target.closest?.(".team-mention"), l = s?.dataset.team;
|
|
150
|
+
if (s && l && (!s.closest("[contenteditable=\"true\"]") || e.metaKey || e.ctrlKey)) {
|
|
151
|
+
e.preventDefault(), I.current(l);
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
153
154
|
let u = e.target.closest?.(".kb-term");
|
|
154
155
|
if (!u) return;
|
|
155
156
|
let d = u.dataset.term;
|
|
156
|
-
d && (!u.closest("[contenteditable=\"true\"]") || e.metaKey || e.ctrlKey) ? (e.preventDefault(),
|
|
157
|
+
d && (!u.closest("[contenteditable=\"true\"]") || e.metaKey || e.ctrlKey) ? (e.preventDefault(), c(null), v.current(d)) : r(e);
|
|
157
158
|
}, o = (e) => {
|
|
158
159
|
if (e.button !== 1) return;
|
|
159
160
|
let t = e.target.closest?.("a[href]");
|
|
160
|
-
t?.closest("[contenteditable=\"true\"]")
|
|
161
|
+
if (!t?.closest("[contenteditable=\"true\"]")) return;
|
|
162
|
+
let n = B(t);
|
|
163
|
+
(t.classList.contains("issue-mention") || n) && (e.preventDefault(), window.open(n ? V(n) : t.href, "_blank", "noopener"));
|
|
161
164
|
}, s = (e) => {
|
|
162
|
-
e.key === "Escape" && u.current?.isConnected && (e.stopPropagation(), e.preventDefault(),
|
|
165
|
+
e.key === "Escape" && u.current?.isConnected && (e.stopPropagation(), e.preventDefault(), c((e) => (e?.el.tabIndex === 0 && e.el.focus(), null)));
|
|
163
166
|
};
|
|
164
|
-
return document.addEventListener("pointerover", t), document.addEventListener("pointerout", n), document.addEventListener("focusin", i), document.addEventListener("click", a), document.addEventListener("auxclick", o), document.addEventListener(
|
|
165
|
-
clearTimeout(
|
|
167
|
+
return document.addEventListener("pointerover", t), document.addEventListener("pointerout", n), document.addEventListener("focusin", i), document.addEventListener("click", a), document.addEventListener("auxclick", o), document.addEventListener(S, r), document.addEventListener("keydown", s, !0), () => {
|
|
168
|
+
clearTimeout(d.current), document.removeEventListener("pointerover", t), document.removeEventListener("pointerout", n), document.removeEventListener("focusin", i), document.removeEventListener("click", a), document.removeEventListener("auxclick", o), document.removeEventListener(S, r), document.removeEventListener("keydown", s, !0);
|
|
166
169
|
};
|
|
167
|
-
}, []),
|
|
170
|
+
}, []), D(() => {
|
|
168
171
|
if (!s) return;
|
|
169
172
|
let e = (e) => {
|
|
170
173
|
let t = e.target;
|
|
171
|
-
!u.current?.contains(t) && !s.el.contains(t) &&
|
|
174
|
+
!u.current?.contains(t) && !s.el.contains(t) && c(null);
|
|
172
175
|
};
|
|
173
176
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
174
177
|
}, [s]);
|
|
175
178
|
let H = s?.el.isConnected ? s : null;
|
|
176
|
-
return /* @__PURE__ */
|
|
179
|
+
return /* @__PURE__ */ M(T, {
|
|
177
180
|
at: H?.el ?? null,
|
|
178
181
|
open: !!H,
|
|
179
182
|
onOpenChange: (e) => {
|
|
180
|
-
e ||
|
|
183
|
+
e || c(null);
|
|
181
184
|
},
|
|
182
|
-
onPointerEnter: () => clearTimeout(
|
|
185
|
+
onPointerEnter: () => clearTimeout(d.current),
|
|
183
186
|
onPointerLeave: () => {
|
|
184
|
-
clearTimeout(
|
|
187
|
+
clearTimeout(d.current), d.current = setTimeout(() => c(null), R);
|
|
185
188
|
},
|
|
186
|
-
card: H && /* @__PURE__ */
|
|
189
|
+
card: H && /* @__PURE__ */ M("div", {
|
|
187
190
|
ref: u,
|
|
188
191
|
role: "dialog",
|
|
189
192
|
"aria-label": H.kind === "doc" ? H.key : H.kind === "person" ? H.username : void 0,
|
|
190
193
|
className: H.kind === "person" ? "" : "w-80 max-w-[calc(100vw-16px)] p-3 text-sm",
|
|
191
|
-
children: H.kind === "term" ? /* @__PURE__ */
|
|
194
|
+
children: H.kind === "term" ? /* @__PURE__ */ M(U, {
|
|
192
195
|
workspace: n,
|
|
193
|
-
entry:
|
|
194
|
-
}) : H.kind === "person" ? /* @__PURE__ */
|
|
196
|
+
entry: p?.find((e) => e.id === H.id)
|
|
197
|
+
}) : H.kind === "person" ? /* @__PURE__ */ M(w, {
|
|
195
198
|
workspace: n,
|
|
196
199
|
handle: H.username
|
|
197
|
-
}) : /* @__PURE__ */
|
|
200
|
+
}) : /* @__PURE__ */ M(G, {
|
|
198
201
|
workspace: n,
|
|
199
202
|
docKey: H.key
|
|
200
203
|
})
|
|
201
204
|
})
|
|
202
205
|
});
|
|
203
206
|
}
|
|
204
|
-
function
|
|
205
|
-
let n =
|
|
206
|
-
if (!t) return /* @__PURE__ */
|
|
207
|
+
function U({ workspace: e, entry: t }) {
|
|
208
|
+
let n = A("knowledge"), r = h(e);
|
|
209
|
+
if (!t) return /* @__PURE__ */ M("p", {
|
|
207
210
|
className: "text-muted-foreground",
|
|
208
211
|
children: n("gone")
|
|
209
212
|
});
|
|
210
213
|
let i = t.source.doc;
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ N(j, { children: [
|
|
215
|
+
/* @__PURE__ */ N("p", {
|
|
213
216
|
className: "flex items-center gap-2",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ M(v, {
|
|
215
218
|
to: "/$workspace/knowledge/$term",
|
|
216
219
|
params: {
|
|
217
220
|
workspace: e,
|
|
218
|
-
term:
|
|
221
|
+
term: g(t)
|
|
219
222
|
},
|
|
220
223
|
className: "font-semibold hover:underline",
|
|
221
224
|
children: t.name
|
|
222
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ M("span", {
|
|
223
226
|
className: "text-xs text-muted-foreground",
|
|
224
227
|
children: n(`kind.${t.kind}`)
|
|
225
228
|
})]
|
|
226
229
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ M("p", {
|
|
228
231
|
className: "mt-1.5 text-foreground",
|
|
229
232
|
children: t.definition
|
|
230
233
|
}),
|
|
231
|
-
t.supersededBy && /* @__PURE__ */
|
|
234
|
+
t.supersededBy && /* @__PURE__ */ M("p", {
|
|
232
235
|
className: "mt-1.5 text-xs",
|
|
233
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ M(v, {
|
|
234
237
|
to: "/$workspace/knowledge/$term",
|
|
235
238
|
params: {
|
|
236
239
|
workspace: e,
|
|
@@ -240,21 +243,21 @@ function V({ workspace: e, entry: t }) {
|
|
|
240
243
|
children: n("supersededBy", { name: t.supersededByName ?? "" })
|
|
241
244
|
})
|
|
242
245
|
}),
|
|
243
|
-
(i || t.source.identifier) && /* @__PURE__ */
|
|
246
|
+
(i || t.source.identifier) && /* @__PURE__ */ N("p", {
|
|
244
247
|
className: "mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",
|
|
245
|
-
children: [i && /* @__PURE__ */
|
|
248
|
+
children: [i && /* @__PURE__ */ N(v, {
|
|
246
249
|
to: "/$workspace/docs/$doc",
|
|
247
250
|
params: {
|
|
248
251
|
workspace: e,
|
|
249
|
-
doc:
|
|
252
|
+
doc: d(i)
|
|
250
253
|
},
|
|
251
|
-
...t.source.section && { hash:
|
|
254
|
+
...t.source.section && { hash: p(t.source.section) },
|
|
252
255
|
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ M(C, { className: "size-3" }), t.source.section ? n("sourceSection", {
|
|
254
257
|
doc: i.title,
|
|
255
258
|
section: t.source.section
|
|
256
259
|
}) : i.title]
|
|
257
|
-
}), t.source.identifier && /* @__PURE__ */
|
|
260
|
+
}), t.source.identifier && /* @__PURE__ */ M(v, {
|
|
258
261
|
to: "/$workspace/issues/$identifier",
|
|
259
262
|
params: {
|
|
260
263
|
workspace: e,
|
|
@@ -264,41 +267,41 @@ function V({ workspace: e, entry: t }) {
|
|
|
264
267
|
children: t.source.identifier
|
|
265
268
|
})]
|
|
266
269
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ M(v, {
|
|
268
271
|
to: "/$workspace/knowledge/$term",
|
|
269
272
|
params: {
|
|
270
273
|
workspace: e,
|
|
271
|
-
term:
|
|
274
|
+
term: g(t)
|
|
272
275
|
},
|
|
273
276
|
className: "mt-2 block text-xs text-primary hover:underline",
|
|
274
277
|
children: n("openEntry")
|
|
275
278
|
})
|
|
276
279
|
] });
|
|
277
280
|
}
|
|
278
|
-
function
|
|
281
|
+
function W(e) {
|
|
279
282
|
return e.split("\n").map((e) => e.replace(/^#{1,6}\s+|^[-*>]\s+|^\d+\.\s+|\[[ x]\]\s*/g, "").replace(/[*_`]/g, "")).filter((e) => e.trim()).slice(0, 4).join(" ").slice(0, 280);
|
|
280
283
|
}
|
|
281
|
-
function
|
|
282
|
-
let r =
|
|
284
|
+
function G({ workspace: e, docKey: t }) {
|
|
285
|
+
let r = A("docLinks"), { data: i, isError: a } = P({
|
|
283
286
|
...n(e, t),
|
|
284
287
|
retry: !1
|
|
285
288
|
});
|
|
286
|
-
return a ? /* @__PURE__ */
|
|
289
|
+
return a ? /* @__PURE__ */ M("p", {
|
|
287
290
|
className: "text-muted-foreground",
|
|
288
291
|
children: r("unavailable")
|
|
289
|
-
}) : i ? /* @__PURE__ */
|
|
292
|
+
}) : i ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("p", {
|
|
290
293
|
className: "flex items-center gap-2 font-semibold",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ M(x, {
|
|
292
295
|
icon: i.icon,
|
|
293
296
|
className: "size-3.5",
|
|
294
297
|
emojiClassName: "text-xs"
|
|
295
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ M("span", {
|
|
296
299
|
className: "truncate",
|
|
297
300
|
children: i.title
|
|
298
301
|
})]
|
|
299
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ M("p", {
|
|
300
303
|
className: "mt-1.5 line-clamp-4 text-muted-foreground",
|
|
301
|
-
children:
|
|
302
|
-
})] }) : /* @__PURE__ */
|
|
304
|
+
children: W(i.body ?? "") || r("empty")
|
|
305
|
+
})] }) : /* @__PURE__ */ M(E, { size: 16 });
|
|
303
306
|
}
|
|
304
|
-
export {
|
|
307
|
+
export { H as HoverCards };
|