@parallelworks/tandem-web 0.179.0 → 0.179.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/components/HoverCards.js +23 -13
- package/components/editorPlugins.js +107 -101
- package/package.json +1 -1
- package/styles.css +8 -0
package/components/HoverCards.js
CHANGED
|
@@ -119,25 +119,35 @@ function R({ workspace: n }) {
|
|
|
119
119
|
}, i = (e) => {
|
|
120
120
|
e.target.matches?.(".kb-term[tabindex], .prose-issue a[href*=\"/docs/\"]") && r(e);
|
|
121
121
|
}, a = (e) => {
|
|
122
|
-
let t = e.target.closest?.(".issue-mention"), n = t?.dataset.issue;
|
|
123
|
-
if (t && n &&
|
|
124
|
-
e.
|
|
125
|
-
|
|
122
|
+
let t = e.target.closest?.(".issue-mention"), n = t?.dataset.issue, i = t?.closest("a[href]");
|
|
123
|
+
if (t && n && (!i || i === t)) {
|
|
124
|
+
if ((e.metaKey || e.ctrlKey || e.shiftKey) && i) {
|
|
125
|
+
e.preventDefault(), window.open(i.href, "_blank", "noopener");
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!t.closest("[contenteditable=\"true\"]")) {
|
|
129
|
+
e.preventDefault(), P.current(n);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
126
132
|
}
|
|
127
|
-
let
|
|
128
|
-
if (
|
|
129
|
-
e.preventDefault(), R.current(
|
|
133
|
+
let a = e.target.closest?.(".team-mention"), o = a?.dataset.team;
|
|
134
|
+
if (a && o && (!a.closest("[contenteditable=\"true\"]") || e.metaKey || e.ctrlKey)) {
|
|
135
|
+
e.preventDefault(), R.current(o);
|
|
130
136
|
return;
|
|
131
137
|
}
|
|
132
|
-
let
|
|
133
|
-
if (!
|
|
134
|
-
let
|
|
135
|
-
|
|
138
|
+
let s = e.target.closest?.(".kb-term");
|
|
139
|
+
if (!s) return;
|
|
140
|
+
let c = s.dataset.term;
|
|
141
|
+
c && (!s.closest("[contenteditable=\"true\"]") || e.metaKey || e.ctrlKey) ? (e.preventDefault(), l(null), x.current(c)) : r(e);
|
|
136
142
|
}, o = (e) => {
|
|
143
|
+
if (e.button !== 1) return;
|
|
144
|
+
let t = e.target.closest?.("a.issue-mention[href]");
|
|
145
|
+
t?.closest("[contenteditable=\"true\"]") && (e.preventDefault(), window.open(t.href, "_blank", "noopener"));
|
|
146
|
+
}, s = (e) => {
|
|
137
147
|
e.key === "Escape" && d.current?.isConnected && (e.stopPropagation(), e.preventDefault(), l((e) => (e?.el.tabIndex === 0 && e.el.focus(), null)));
|
|
138
148
|
};
|
|
139
|
-
return document.addEventListener("pointerover", t), document.addEventListener("pointerout", n), document.addEventListener("focusin", i), document.addEventListener("click", a), document.addEventListener(b, r), document.addEventListener("keydown",
|
|
140
|
-
clearTimeout(p.current), document.removeEventListener("pointerover", t), document.removeEventListener("pointerout", n), document.removeEventListener("focusin", i), document.removeEventListener("click", a), document.removeEventListener(b, r), document.removeEventListener("keydown",
|
|
149
|
+
return document.addEventListener("pointerover", t), document.addEventListener("pointerout", n), document.addEventListener("focusin", i), document.addEventListener("click", a), document.addEventListener("auxclick", o), document.addEventListener(b, r), document.addEventListener("keydown", s, !0), () => {
|
|
150
|
+
clearTimeout(p.current), document.removeEventListener("pointerover", t), document.removeEventListener("pointerout", n), document.removeEventListener("focusin", i), document.removeEventListener("click", a), document.removeEventListener("auxclick", o), document.removeEventListener(b, r), document.removeEventListener("keydown", s, !0);
|
|
141
151
|
};
|
|
142
152
|
}, []), T(() => {
|
|
143
153
|
if (!c) return;
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { attachmentIdOf as e, attachmentPrefix as t, attachmentSizes as n, attachmentURL as r, githubMedia as i, githubUpload as a, mediaURL as o, playableLink as s, videoName as c } from "../lib/attachments.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { basePath as l } from "../lib/base.js";
|
|
3
|
+
import { issuePath as u } from "../lib/branch.js";
|
|
4
|
+
import { docLooks as d } from "../lib/docLooks.js";
|
|
5
|
+
import { githubLinkPage as f } from "../lib/githubLink.js";
|
|
6
|
+
import { glossary as p, mentions as m } from "../lib/glossary.js";
|
|
7
|
+
import { issueKeyOfHref as ee, issueKeyPattern as te, issueRefs as h } from "../lib/issueRefs.js";
|
|
6
8
|
import { linkedIssues as g } from "../lib/linkedIssues.js";
|
|
7
|
-
import { mentionable as _, mentionsIn as
|
|
9
|
+
import { mentionable as _, mentionsIn as ne } from "../lib/mentions.js";
|
|
8
10
|
import { statusGroup as v } from "../lib/statusGroup.js";
|
|
9
11
|
import { teamNames as y } from "../lib/teamNames.js";
|
|
10
|
-
import { docIcons as
|
|
11
|
-
import { iconImageURL as
|
|
12
|
-
import { createElement as
|
|
13
|
-
import { Extension as
|
|
14
|
-
import { Plugin as
|
|
15
|
-
import { Decoration as
|
|
12
|
+
import { docIcons as re } from "./DocIcon.js";
|
|
13
|
+
import { iconImageURL as b } from "./EntityIcon.js";
|
|
14
|
+
import { createElement as x } from "react";
|
|
15
|
+
import { Extension as S } from "@tiptap/react";
|
|
16
|
+
import { Plugin as C, PluginKey as w, TextSelection as ie } from "@tiptap/pm/state";
|
|
17
|
+
import { Decoration as T, DecorationSet as E } from "@tiptap/pm/view";
|
|
16
18
|
import ae from "@tiptap/extension-image";
|
|
17
|
-
import { createRoot as
|
|
19
|
+
import { createRoot as D } from "react-dom/client";
|
|
18
20
|
// src/components/editorPlugins.ts
|
|
19
|
-
var
|
|
21
|
+
var O = new w("knowledgeTerms"), oe = /* @__PURE__ */ new Set([
|
|
20
22
|
"ArrowLeft",
|
|
21
23
|
"ArrowRight",
|
|
22
24
|
"ArrowUp",
|
|
23
25
|
"ArrowDown",
|
|
24
26
|
"Home",
|
|
25
27
|
"End"
|
|
26
|
-
]),
|
|
27
|
-
function
|
|
28
|
+
]), k = "tandem:term-caret";
|
|
29
|
+
function A(e, t) {
|
|
28
30
|
e.descendants((e, n) => {
|
|
29
31
|
if (!e.isTextblock) return !0;
|
|
30
32
|
if (e.type.spec.code) return !1;
|
|
@@ -37,12 +39,12 @@ function O(e, t) {
|
|
|
37
39
|
}), t(r, n + 1), !1;
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
|
-
function
|
|
41
|
-
let n =
|
|
42
|
-
if (n.length === 0) return
|
|
42
|
+
function j(e, t) {
|
|
43
|
+
let n = p.forms();
|
|
44
|
+
if (n.length === 0) return E.empty;
|
|
43
45
|
let r = [];
|
|
44
|
-
return
|
|
45
|
-
for (let a of
|
|
46
|
+
return A(e, (e, i) => {
|
|
47
|
+
for (let a of m(e, n)) r.push(T.inline(i + a.from, i + a.to, {
|
|
46
48
|
class: "kb-term",
|
|
47
49
|
"data-term": a.id,
|
|
48
50
|
...t && {
|
|
@@ -50,19 +52,19 @@ function k(e, t) {
|
|
|
50
52
|
role: "button"
|
|
51
53
|
}
|
|
52
54
|
}));
|
|
53
|
-
}),
|
|
55
|
+
}), E.create(e, r);
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function M(e) {
|
|
56
58
|
let t = /* @__PURE__ */ new Set();
|
|
57
59
|
return e.descendants((e) => {
|
|
58
60
|
for (let n of e.marks) n.type.name === "link" && t.add(String(n.attrs.href ?? ""));
|
|
59
61
|
return !0;
|
|
60
62
|
}), t;
|
|
61
63
|
}
|
|
62
|
-
function
|
|
64
|
+
function N(e, t, n) {
|
|
63
65
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
64
|
-
return
|
|
65
|
-
for (let o of
|
|
66
|
+
return A(e, (e, a) => {
|
|
67
|
+
for (let o of m(e, t)) i.has(o.id) || (i.add(o.id), n(o.id) || r.push({
|
|
66
68
|
from: a + o.from,
|
|
67
69
|
to: a + o.to,
|
|
68
70
|
id: o.id,
|
|
@@ -70,49 +72,49 @@ function j(e, t, n) {
|
|
|
70
72
|
}));
|
|
71
73
|
}), r;
|
|
72
74
|
}
|
|
73
|
-
var
|
|
75
|
+
var se = S.create({
|
|
74
76
|
name: "knowledgeTerms",
|
|
75
77
|
addProseMirrorPlugins() {
|
|
76
78
|
let e = this.editor, t = "";
|
|
77
|
-
return [new
|
|
78
|
-
key:
|
|
79
|
+
return [new C({
|
|
80
|
+
key: O,
|
|
79
81
|
state: {
|
|
80
|
-
init: (t, n) =>
|
|
81
|
-
apply: (t, n) => t.docChanged || t.getMeta(
|
|
82
|
+
init: (t, n) => j(n.doc, !e.isEditable),
|
|
83
|
+
apply: (t, n) => t.docChanged || t.getMeta(O) ? j(t.doc, !e.isEditable) : n.map(t.mapping, t.doc)
|
|
82
84
|
},
|
|
83
85
|
props: {
|
|
84
|
-
decorations: (e) =>
|
|
86
|
+
decorations: (e) => O.getState(e),
|
|
85
87
|
handleKeyDown: (e, n) => (t = n.key, !1)
|
|
86
88
|
},
|
|
87
89
|
view: (e) => ({
|
|
88
90
|
update: (e, n) => {
|
|
89
91
|
let { selection: r } = e.state;
|
|
90
|
-
if (!
|
|
92
|
+
if (!oe.has(t) || !r.empty || n.selection.eq(r)) return;
|
|
91
93
|
t = "";
|
|
92
94
|
let i = e.domAtPos(r.from);
|
|
93
|
-
(i.node.nodeType === 1 ? i.node : i.node.parentElement)?.closest(".kb-term")?.dispatchEvent(new CustomEvent(
|
|
95
|
+
(i.node.nodeType === 1 ? i.node : i.node.parentElement)?.closest(".kb-term")?.dispatchEvent(new CustomEvent(k, { bubbles: !0 }));
|
|
94
96
|
},
|
|
95
|
-
destroy:
|
|
96
|
-
e.isDestroyed || e.dispatch(e.state.tr.setMeta(
|
|
97
|
+
destroy: p.subscribe(() => {
|
|
98
|
+
e.isDestroyed || e.dispatch(e.state.tr.setMeta(O, !0));
|
|
97
99
|
})
|
|
98
100
|
})
|
|
99
101
|
})];
|
|
100
102
|
}
|
|
101
103
|
});
|
|
102
|
-
function
|
|
104
|
+
function ce(e) {
|
|
103
105
|
return e.docLinks;
|
|
104
106
|
}
|
|
105
|
-
var
|
|
107
|
+
var le = S.create({
|
|
106
108
|
name: "docLinks",
|
|
107
109
|
addStorage: () => ({ handlers: /* @__PURE__ */ new Set() }),
|
|
108
110
|
addProseMirrorPlugins() {
|
|
109
111
|
let e = this.storage;
|
|
110
|
-
return [new
|
|
112
|
+
return [new C({ props: { handleKeyDown: (t, n) => {
|
|
111
113
|
for (let t of e.handlers) if (t(n)) return !0;
|
|
112
114
|
return !1;
|
|
113
115
|
} } })];
|
|
114
116
|
}
|
|
115
|
-
}), P = "tandem:open-image",
|
|
117
|
+
}), P = "tandem:open-image", ue = ae.extend({
|
|
116
118
|
parseHTML() {
|
|
117
119
|
return [{
|
|
118
120
|
tag: "img[src]",
|
|
@@ -159,7 +161,7 @@ function F(e, t) {
|
|
|
159
161
|
var I = { linkHint: "" };
|
|
160
162
|
function L(e, t, n) {
|
|
161
163
|
let r = document.createElement("span");
|
|
162
|
-
r.className = "recording-unplayable", r.contentEditable = "false", n && r.append(R(t)), e.replaceWith(r), a(t) &&
|
|
164
|
+
r.className = "recording-unplayable", r.contentEditable = "false", n && r.append(R(t)), e.replaceWith(r), a(t) && f().then((e) => {
|
|
163
165
|
if (!e || !I.linkHint) return;
|
|
164
166
|
let t = document.createElement("a");
|
|
165
167
|
t.className = "recording-hint", t.href = e, t.textContent = I.linkHint, r.append(t);
|
|
@@ -169,12 +171,12 @@ function R(e) {
|
|
|
169
171
|
let t = document.createElement("a");
|
|
170
172
|
return t.href = r(e), t.textContent = e, t.rel = "noopener noreferrer", t.target = "_blank", t;
|
|
171
173
|
}
|
|
172
|
-
var z = new
|
|
174
|
+
var z = new w("attachmentFiles");
|
|
173
175
|
function B(e, t) {
|
|
174
176
|
e.descendants((e, n) => {
|
|
175
177
|
if (e.type.name !== "paragraph") return !0;
|
|
176
178
|
let r = e.childCount === 1 ? e.firstChild : null, i = r?.marks.find((e) => e.type.name === "link")?.attrs.href;
|
|
177
|
-
return r?.isText && i && s(i) && r.text?.trim() === i && t.push(
|
|
179
|
+
return r?.isText && i && s(i) && r.text?.trim() === i && t.push(T.widget(n + e.nodeSize - 1, () => {
|
|
178
180
|
let e = document.createElement("span");
|
|
179
181
|
return e.className = "recording-box", e.contentEditable = "false", e.append(F(i, (e) => L(e, i, !1))), e;
|
|
180
182
|
}, {
|
|
@@ -190,11 +192,11 @@ function V(t) {
|
|
|
190
192
|
return B(t, i), t.descendants((t, a) => {
|
|
191
193
|
if (!t.isText) return !0;
|
|
192
194
|
let o = t.marks.find((e) => e.type.name === "link"), s = e(o?.attrs.href), l = s && n.get(s);
|
|
193
|
-
l && i.push(
|
|
195
|
+
l && i.push(T.inline(a, a + t.nodeSize, { "data-size": l }));
|
|
194
196
|
let u = !n.get(s ?? "") && c.test(t.text ?? "");
|
|
195
197
|
if (s && (n.isVideo(s) || u) && o) {
|
|
196
198
|
let e = r(String(o.attrs.href));
|
|
197
|
-
i.push(
|
|
199
|
+
i.push(T.widget(a + t.nodeSize, () => {
|
|
198
200
|
let t = document.createElement("video");
|
|
199
201
|
return t.className = "attachment-video", t.src = e, t.controls = !0, t.preload = "metadata", t.contentEditable = "false", u && t.addEventListener("error", () => t.remove(), { once: !0 }), t;
|
|
200
202
|
}, {
|
|
@@ -205,13 +207,13 @@ function V(t) {
|
|
|
205
207
|
}));
|
|
206
208
|
}
|
|
207
209
|
return !1;
|
|
208
|
-
}),
|
|
210
|
+
}), E.create(t, i);
|
|
209
211
|
}
|
|
210
|
-
var H =
|
|
212
|
+
var H = S.create({
|
|
211
213
|
name: "attachmentFiles",
|
|
212
214
|
priority: 1e3,
|
|
213
215
|
addProseMirrorPlugins() {
|
|
214
|
-
return [new
|
|
216
|
+
return [new C({
|
|
215
217
|
key: z,
|
|
216
218
|
state: {
|
|
217
219
|
init: (e, t) => V(t.doc),
|
|
@@ -239,13 +241,13 @@ var H = b.create({
|
|
|
239
241
|
}) })
|
|
240
242
|
})];
|
|
241
243
|
}
|
|
242
|
-
}), U = new
|
|
244
|
+
}), U = new w("linkedIssues");
|
|
243
245
|
function W(e) {
|
|
244
246
|
let t = [], n, r = () => {
|
|
245
247
|
let e = n && g.get(n.href);
|
|
246
248
|
if (n && e) {
|
|
247
249
|
let { identifier: r, title: i, status: a } = e;
|
|
248
|
-
t.push(
|
|
250
|
+
t.push(T.widget(n.end, () => {
|
|
249
251
|
let e = document.createElement("button");
|
|
250
252
|
return e.type = "button", e.className = "linked-issue", e.dataset.linkedIssue = r, e.dataset.category = v(a), e.contentEditable = "false", e.title = `${r} ${i}`, e.textContent = `${r} · ${a.name}`, e;
|
|
251
253
|
}, {
|
|
@@ -262,12 +264,12 @@ function W(e) {
|
|
|
262
264
|
href: i,
|
|
263
265
|
end: t + e.nodeSize
|
|
264
266
|
}), !1;
|
|
265
|
-
}), r(),
|
|
267
|
+
}), r(), E.create(e, t);
|
|
266
268
|
}
|
|
267
|
-
var
|
|
269
|
+
var de = S.create({
|
|
268
270
|
name: "linkedIssues",
|
|
269
271
|
addProseMirrorPlugins() {
|
|
270
|
-
return [new
|
|
272
|
+
return [new C({
|
|
271
273
|
key: U,
|
|
272
274
|
state: {
|
|
273
275
|
init: (e, t) => W(t.doc),
|
|
@@ -285,44 +287,48 @@ var le = b.create({
|
|
|
285
287
|
}) })
|
|
286
288
|
})];
|
|
287
289
|
}
|
|
288
|
-
}), G = new
|
|
289
|
-
function
|
|
290
|
+
}), G = new w("issueMentions");
|
|
291
|
+
function fe(e) {
|
|
290
292
|
let t = document.createElement("span");
|
|
291
293
|
return t.className = "issue-mention-status", t.dataset.category = e, t.contentEditable = "false", t;
|
|
292
294
|
}
|
|
293
295
|
function K(e) {
|
|
294
296
|
let t = h.workspace();
|
|
295
|
-
if (!t) return
|
|
296
|
-
let n = [], r = [], i = (e,
|
|
297
|
-
let
|
|
298
|
-
if (!
|
|
299
|
-
r.push(
|
|
297
|
+
if (!t) return E.empty;
|
|
298
|
+
let n = [], r = [], i = (e, i, a, o) => {
|
|
299
|
+
let s = h.get(a);
|
|
300
|
+
if (!s) {
|
|
301
|
+
r.push(a);
|
|
300
302
|
return;
|
|
301
303
|
}
|
|
302
|
-
let
|
|
303
|
-
n.push(
|
|
304
|
+
let c = v(s.status);
|
|
305
|
+
n.push(T.widget(e, () => fe(c), {
|
|
304
306
|
side: -1,
|
|
305
|
-
key: `dot-${
|
|
306
|
-
}),
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
key: `dot-${a}-${c}`
|
|
308
|
+
}), T.inline(e, i, {
|
|
309
|
+
...o ? {
|
|
310
|
+
nodeName: "a",
|
|
311
|
+
href: `${l}${u(t, s.identifier)}`
|
|
312
|
+
} : {},
|
|
313
|
+
class: o ? "issue-mention issue-mention-key" : "issue-mention",
|
|
314
|
+
"data-issue": s.identifier,
|
|
315
|
+
title: `${s.identifier} ${s.title} · ${s.status.name}`
|
|
316
|
+
})), o && n.push(T.widget(i, () => {
|
|
311
317
|
let e = document.createElement("span");
|
|
312
|
-
return e.className = "issue-mention-title", e.contentEditable = "false", e.textContent =
|
|
318
|
+
return e.className = "issue-mention-title", e.contentEditable = "false", e.textContent = s.title, e;
|
|
313
319
|
}, {
|
|
314
320
|
side: 1,
|
|
315
|
-
key: `title-${
|
|
321
|
+
key: `title-${a}-${s.title}`
|
|
316
322
|
}));
|
|
317
323
|
};
|
|
318
|
-
|
|
319
|
-
for (let n of e.matchAll(
|
|
324
|
+
A(e, (e, t) => {
|
|
325
|
+
for (let n of e.matchAll(te)) {
|
|
320
326
|
let e = n[1] ?? "";
|
|
321
327
|
i(t + (n.index ?? 0), t + (n.index ?? 0) + e.length, e, !0);
|
|
322
328
|
}
|
|
323
329
|
});
|
|
324
330
|
let a, o = () => {
|
|
325
|
-
let e = a &&
|
|
331
|
+
let e = a && ee(a.href, t);
|
|
326
332
|
a && e && i(a.from, a.to, e, !1), a = void 0;
|
|
327
333
|
};
|
|
328
334
|
return e.descendants((e, t) => {
|
|
@@ -336,12 +342,12 @@ function K(e) {
|
|
|
336
342
|
from: t,
|
|
337
343
|
to: t + e.nodeSize
|
|
338
344
|
}), !1;
|
|
339
|
-
}), o(), r.length > 0 && h.want(r),
|
|
345
|
+
}), o(), r.length > 0 && h.want(r), E.create(e, n);
|
|
340
346
|
}
|
|
341
|
-
var
|
|
347
|
+
var pe = S.create({
|
|
342
348
|
name: "issueMentions",
|
|
343
349
|
addProseMirrorPlugins() {
|
|
344
|
-
return [new
|
|
350
|
+
return [new C({
|
|
345
351
|
key: G,
|
|
346
352
|
state: {
|
|
347
353
|
init: (e, t) => K(t.doc),
|
|
@@ -353,22 +359,22 @@ var de = b.create({
|
|
|
353
359
|
}) })
|
|
354
360
|
})];
|
|
355
361
|
}
|
|
356
|
-
}), q = new
|
|
362
|
+
}), q = new w("teamNames");
|
|
357
363
|
function J(e) {
|
|
358
364
|
let t = y.forms();
|
|
359
|
-
if (t.length === 0) return
|
|
365
|
+
if (t.length === 0) return E.empty;
|
|
360
366
|
let n = [];
|
|
361
|
-
return
|
|
362
|
-
for (let i of
|
|
367
|
+
return A(e, (e, r) => {
|
|
368
|
+
for (let i of m(e, t, !0)) n.push(T.inline(r + i.from, r + i.to, {
|
|
363
369
|
class: "team-mention",
|
|
364
370
|
"data-team": i.id
|
|
365
371
|
}));
|
|
366
|
-
}),
|
|
372
|
+
}), E.create(e, n);
|
|
367
373
|
}
|
|
368
|
-
var
|
|
374
|
+
var me = S.create({
|
|
369
375
|
name: "teamNames",
|
|
370
376
|
addProseMirrorPlugins() {
|
|
371
|
-
return [new
|
|
377
|
+
return [new C({
|
|
372
378
|
key: q,
|
|
373
379
|
state: {
|
|
374
380
|
init: (e, t) => J(t.doc),
|
|
@@ -380,20 +386,20 @@ var fe = b.create({
|
|
|
380
386
|
}) })
|
|
381
387
|
})];
|
|
382
388
|
}
|
|
383
|
-
}), Y = new
|
|
389
|
+
}), Y = new w("peopleMentions");
|
|
384
390
|
function X(e) {
|
|
385
391
|
let t = [];
|
|
386
|
-
return
|
|
387
|
-
for (let r of
|
|
392
|
+
return A(e, (e, n) => {
|
|
393
|
+
for (let r of ne(e)) _.has(r.username) && t.push(T.inline(n + r.from, n + r.to, {
|
|
388
394
|
class: "person-mention",
|
|
389
395
|
"data-username": r.username
|
|
390
396
|
}));
|
|
391
|
-
}),
|
|
397
|
+
}), E.create(e, t);
|
|
392
398
|
}
|
|
393
|
-
var
|
|
399
|
+
var he = S.create({
|
|
394
400
|
name: "peopleMentions",
|
|
395
401
|
addProseMirrorPlugins() {
|
|
396
|
-
return [new
|
|
402
|
+
return [new C({
|
|
397
403
|
key: Y,
|
|
398
404
|
state: {
|
|
399
405
|
init: (e, t) => X(t.doc),
|
|
@@ -405,17 +411,17 @@ var pe = b.create({
|
|
|
405
411
|
}) })
|
|
406
412
|
})];
|
|
407
413
|
}
|
|
408
|
-
}), Z = new
|
|
409
|
-
function
|
|
414
|
+
}), Z = new w("docLinkIcons"), Q = /* @__PURE__ */ new WeakMap();
|
|
415
|
+
function ge(e) {
|
|
410
416
|
let t = document.createElement("span");
|
|
411
417
|
t.className = "doc-link-icon", t.contentEditable = "false";
|
|
412
|
-
let n =
|
|
418
|
+
let n = b(e), r = e.startsWith("icon:") ? re[e.slice(5)] : void 0;
|
|
413
419
|
if (n) {
|
|
414
420
|
let e = document.createElement("img");
|
|
415
421
|
e.src = n, e.alt = "", t.appendChild(e);
|
|
416
422
|
} else if (r) {
|
|
417
|
-
let e =
|
|
418
|
-
queueMicrotask(() => e.render(
|
|
423
|
+
let e = D(t);
|
|
424
|
+
queueMicrotask(() => e.render(x(r, { className: "size-[0.95em]" }))), Q.set(t, e);
|
|
419
425
|
} else t.textContent = e;
|
|
420
426
|
return t;
|
|
421
427
|
}
|
|
@@ -425,8 +431,8 @@ function $(e) {
|
|
|
425
431
|
if (!e.isText) return !0;
|
|
426
432
|
let a = e.marks.find((e) => e.type.name === "link"), o = String(a?.attrs.href ?? ""), s = !!a && o === r && i === n;
|
|
427
433
|
if (r = a ? o : "", n = i + e.nodeSize, !a || s || !o.includes("/docs/")) return !1;
|
|
428
|
-
let c =
|
|
429
|
-
return c && t.push(
|
|
434
|
+
let c = d.iconAt(o);
|
|
435
|
+
return c && t.push(T.widget(i, () => ge(c), {
|
|
430
436
|
side: 1,
|
|
431
437
|
marks: [a],
|
|
432
438
|
key: `doc-icon:${c}`,
|
|
@@ -436,24 +442,24 @@ function $(e) {
|
|
|
436
442
|
t && queueMicrotask(() => t.unmount());
|
|
437
443
|
}
|
|
438
444
|
})), !1;
|
|
439
|
-
}),
|
|
445
|
+
}), E.create(e, t);
|
|
440
446
|
}
|
|
441
|
-
var
|
|
447
|
+
var _e = S.create({
|
|
442
448
|
name: "docLinkIcons",
|
|
443
449
|
addProseMirrorPlugins() {
|
|
444
|
-
return [new
|
|
450
|
+
return [new C({
|
|
445
451
|
key: Z,
|
|
446
452
|
state: {
|
|
447
453
|
init: (e, t) => $(t.doc),
|
|
448
454
|
apply: (e, t) => e.docChanged || e.getMeta(Z) ? $(e.doc) : t
|
|
449
455
|
},
|
|
450
456
|
props: { decorations: (e) => Z.getState(e) },
|
|
451
|
-
view: (e) => ({ destroy:
|
|
457
|
+
view: (e) => ({ destroy: d.subscribe(() => {
|
|
452
458
|
e.isDestroyed || e.dispatch(e.state.tr.setMeta(Z, !0));
|
|
453
459
|
}) })
|
|
454
460
|
})];
|
|
455
461
|
}
|
|
456
|
-
}),
|
|
462
|
+
}), ve = S.create({
|
|
457
463
|
name: "moveBlock",
|
|
458
464
|
addKeyboardShortcuts() {
|
|
459
465
|
let e = (e) => () => {
|
|
@@ -470,4 +476,4 @@ var he = b.create({
|
|
|
470
476
|
};
|
|
471
477
|
}
|
|
472
478
|
});
|
|
473
|
-
export { H as AttachmentFiles,
|
|
479
|
+
export { H as AttachmentFiles, ue as AttachmentImage, _e as DocLinkIcons, le as DocLinks, pe as IssueMentions, se as KnowledgeTerms, de as LinkedIssues, ve as MoveBlock, he as PeopleMentions, me as TeamNames, M as linksIn, P as openImageEvent, ce as pickerKeys, R as plainLink, F as recordingPlayer, I as recordingText, k as termCaretEvent, N as unlinkedMentions, L as unplayable };
|
package/package.json
CHANGED
package/styles.css
CHANGED
|
@@ -777,9 +777,17 @@ body[data-tandem] > :not(:has(.tandem)) {
|
|
|
777
777
|
.issue-mention-key {
|
|
778
778
|
white-space: nowrap;
|
|
779
779
|
}
|
|
780
|
+
/* A bare key is a link (IssueMentions): it keeps the text's color, not a link's. */
|
|
781
|
+
a.issue-mention {
|
|
782
|
+
color: inherit;
|
|
783
|
+
text-decoration: none;
|
|
784
|
+
}
|
|
780
785
|
[contenteditable="false"] .issue-mention {
|
|
781
786
|
cursor: pointer;
|
|
782
787
|
}
|
|
788
|
+
[contenteditable="false"] a.issue-mention:hover {
|
|
789
|
+
color: var(--color-primary);
|
|
790
|
+
}
|
|
783
791
|
.issue-mention-title {
|
|
784
792
|
margin-inline-start: 0.25rem;
|
|
785
793
|
color: var(--color-muted-foreground);
|