@clevertask/scribe 0.1.18 → 0.1.20
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/README.md +29 -1
- package/dist/{BarMenu-C9tCdvyV.js → BarMenu-sZGqMjQr.js} +1 -1
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/CalloutBubbleMenu.js +64 -64
- package/dist/components/Menu/LinkBubbleMenu.js +16 -16
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +2 -2
- package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
- package/dist/components/Scribe/extension/callout.js +2 -5
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-link.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/commands.js +38 -38
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts +1 -2
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/index.js +20 -113
- package/dist/components/Scribe/extension/external-link-preview/node-view.js +6 -6
- package/dist/components/Scribe/extension/external-link-preview/paste.js +5 -5
- package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +8 -0
- package/dist/components/Scribe/extension/external-link-preview/schema.d.ts.map +1 -0
- package/dist/components/Scribe/extension/external-link-preview/schema.js +100 -0
- package/dist/components/Scribe/extension/index.d.ts +2 -2
- package/dist/components/Scribe/extension/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/resizable-table.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/index.js +32 -2
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/extension/tableOfContents.js +1 -1
- package/dist/components/Scribe/index.js +4 -4
- package/dist/{slashCommand-D35jcSNp.js → dist-Bm6rBIf2.js} +101 -110
- package/dist/{dist-DRPH9MfF.js → dist-BrbZZTdj.js} +21 -9
- package/dist/{dist-CkWsQ5Lj.js → dist-jjH04EIX.js} +585 -798
- package/dist/extension-BNjzWzJi.js +57 -0
- package/dist/{extension-link-yMrg9JOz.js → extension-link-7ta0X4tP.js} +2 -2
- package/dist/{html-to-markdown-CnlA8pb8.js → html-to-markdown-pY8ngCXa.js} +14 -14
- package/dist/main.js +6 -6
- package/dist/{markdown-to-html-BLzYd3Fu.js → markdown-to-html-BSuSwB4B.js} +42 -14
- package/dist/{menus-Dy2dj4QT.js → menus-i0cEakC3.js} +137 -135
- package/dist/{resizable-table-D0mls3aB.js → resizable-table-DFTyMlVu.js} +27 -30
- package/dist/{extension-DOo9QT6U.js → schema-extensions-B-U6SbYg.js} +51922 -51962
- package/dist/schema-extensions.d.ts +20 -0
- package/dist/schema-extensions.d.ts.map +1 -0
- package/dist/schema-extensions.js +2 -0
- package/dist/schema.d.ts +17 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +5 -0
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/markdown-to-html.js +1 -1
- package/package.json +57 -51
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as e
|
|
2
|
-
import { a as
|
|
3
|
-
import { Plugin as
|
|
4
|
-
import { Decoration as
|
|
5
|
-
//#region node_modules/.pnpm/@tiptap+suggestion@3.30.
|
|
6
|
-
function
|
|
1
|
+
import { f as e } from "./dist-jjH04EIX.js";
|
|
2
|
+
import { a as t, c as n, i as r, r as i } from "./floating-ui.dom-CmJ6iBdh.js";
|
|
3
|
+
import { Plugin as a, PluginKey as o } from "@tiptap/pm/state";
|
|
4
|
+
import { Decoration as s, DecorationSet as c } from "@tiptap/pm/view";
|
|
5
|
+
//#region node_modules/.pnpm/@tiptap+suggestion@3.30.5_@floating-ui+dom@1.8.0_@tiptap+core@3.30.5_@tiptap+pm@3.30.5__@tiptap+pm@3.30.5/node_modules/@tiptap/suggestion/dist/index.js
|
|
6
|
+
function l(t) {
|
|
7
7
|
let { char: n, allowSpaces: r, allowToIncludeChar: i, allowedPrefixes: a, startOfLine: o, $position: s } = t, c = r && !i, l = e(n), u = RegExp(`\\s${l}$`), d = o ? "^" : "", f = i ? "" : l, p = RegExp(c ? `${d}${l}.*?(?=\\s${f}|$)` : `${d}(?:^)?${l}[^\\s${f}]*`, "gm"), m = s.nodeBefore?.isText && s.nodeBefore.text;
|
|
8
8
|
if (!m) return null;
|
|
9
9
|
let h = s.pos - m.length, g = Array.from(m.matchAll(p)).pop();
|
|
@@ -20,7 +20,7 @@ function u(t) {
|
|
|
20
20
|
text: g[0]
|
|
21
21
|
} : null;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function u(e) {
|
|
24
24
|
return e.docChanged ? e.steps.some((e) => {
|
|
25
25
|
let t = e.slice;
|
|
26
26
|
if (!t?.content) return !1;
|
|
@@ -28,7 +28,7 @@ function d(e) {
|
|
|
28
28
|
return /\s/.test(n);
|
|
29
29
|
}) : !1;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function d(e) {
|
|
32
32
|
return () => {
|
|
33
33
|
let t = e.state.selection.$anchor.pos, { top: n, right: r, bottom: i, left: a } = e.view.coordsAtPos(t);
|
|
34
34
|
try {
|
|
@@ -38,13 +38,13 @@ function f(e) {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function f(e, t, n, r) {
|
|
42
42
|
return n ? () => {
|
|
43
43
|
let n = r.getState(e.state)?.decorationId;
|
|
44
44
|
return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect() || null;
|
|
45
|
-
} :
|
|
45
|
+
} : d(e);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function p({ match: e, dismissedRange: t, state: n, transaction: r, editor: i, shouldResetDismissed: a, effectiveAllowSpaces: o }) {
|
|
48
48
|
return a?.({
|
|
49
49
|
editor: i,
|
|
50
50
|
state: n,
|
|
@@ -52,32 +52,37 @@ function m({ match: e, dismissedRange: t, state: n, transaction: r, editor: i, s
|
|
|
52
52
|
match: e,
|
|
53
53
|
transaction: r,
|
|
54
54
|
allowSpaces: o
|
|
55
|
-
}) ? !1 : o ? e.range.from === t.from : e.range.from === t.from && !
|
|
55
|
+
}) ? !1 : o ? e.range.from === t.from : e.range.from === t.from && !u(r);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function m({ view: e, pluginKeyRef: t }) {
|
|
58
58
|
let n = e.state.tr.setMeta(t, { exit: !0 });
|
|
59
59
|
e.dispatch(n);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function h({ pluginKey: e, decorationTag: t, decorationClass: n, decorationContent: r, decorationEmptyClass: i, renderer: a, dispatchExit: o }) {
|
|
62
62
|
return {
|
|
63
63
|
handleKeyDown(t, n) {
|
|
64
64
|
var r;
|
|
65
65
|
let i = e.getState(t.state);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
if (!i.active) return !1;
|
|
67
|
+
if (n.key === "Escape" || n.key === "Esc") {
|
|
68
|
+
var s;
|
|
69
|
+
return a == null || (s = a.onKeyDown) == null || s.call(a, {
|
|
70
|
+
view: t,
|
|
71
|
+
event: n,
|
|
72
|
+
range: i.range
|
|
73
|
+
}), o(t), !0;
|
|
74
|
+
}
|
|
75
|
+
return (a == null || (r = a.onKeyDown) == null ? void 0 : r.call(a, {
|
|
71
76
|
view: t,
|
|
72
77
|
event: n,
|
|
73
78
|
range: i.range
|
|
74
|
-
}) || !1
|
|
79
|
+
})) || !1;
|
|
75
80
|
},
|
|
76
81
|
decorations(a) {
|
|
77
|
-
let { active: o, range:
|
|
82
|
+
let { active: o, range: l, decorationId: u, query: d } = e.getState(a);
|
|
78
83
|
if (!o) return null;
|
|
79
84
|
let f = !d?.length, p = [n];
|
|
80
|
-
return f && p.push(i),
|
|
85
|
+
return f && p.push(i), c.create(a.doc, [s.inline(l.from, l.to, {
|
|
81
86
|
nodeName: t,
|
|
82
87
|
class: p.join(" "),
|
|
83
88
|
"data-decoration-id": u || void 0,
|
|
@@ -86,7 +91,7 @@ function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationConte
|
|
|
86
91
|
}
|
|
87
92
|
};
|
|
88
93
|
}
|
|
89
|
-
function
|
|
94
|
+
function g({ editor: e, char: t, effectiveAllowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, findSuggestionMatch: o, allow: s, shouldShow: c, shouldKeepDismissed: l, pluginKey: u }) {
|
|
90
95
|
return {
|
|
91
96
|
init() {
|
|
92
97
|
return {
|
|
@@ -145,7 +150,7 @@ function _({ editor: e, char: t, effectiveAllowSpaces: n, allowToIncludeChar: r,
|
|
|
145
150
|
}
|
|
146
151
|
};
|
|
147
152
|
}
|
|
148
|
-
function
|
|
153
|
+
function _({ editor: e, items: t }) {
|
|
149
154
|
let n = null, r = null, i = null, a = () => {
|
|
150
155
|
r !== null && (clearTimeout(r), r = null), i?.(), i = null;
|
|
151
156
|
}, o = (e) => new Promise((t) => {
|
|
@@ -179,18 +184,19 @@ function v({ editor: e, items: t }) {
|
|
|
179
184
|
}
|
|
180
185
|
};
|
|
181
186
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
187
|
+
function v({ placement: e, offset: r, flip: i, floatingUi: a }) {
|
|
188
|
+
var o;
|
|
189
|
+
let s = [n({
|
|
190
|
+
mainAxis: r.mainAxis ?? 4,
|
|
191
|
+
crossAxis: r.crossAxis ?? 0
|
|
186
192
|
})];
|
|
187
|
-
return i &&
|
|
193
|
+
return i && s.push(t()), a != null && (o = a.middleware) != null && o.length && s.push(...a.middleware), {
|
|
188
194
|
placement: e,
|
|
189
195
|
strategy: a?.strategy ?? "absolute",
|
|
190
|
-
middleware:
|
|
196
|
+
middleware: s
|
|
191
197
|
};
|
|
192
198
|
}
|
|
193
|
-
function
|
|
199
|
+
function y(e) {
|
|
194
200
|
if (e instanceof HTMLElement) return e;
|
|
195
201
|
if (typeof e == "string") try {
|
|
196
202
|
let t = document.querySelector(e);
|
|
@@ -200,15 +206,15 @@ function b(e) {
|
|
|
200
206
|
}
|
|
201
207
|
return document.body;
|
|
202
208
|
}
|
|
203
|
-
function
|
|
209
|
+
function b({ getReferenceRect: e, contextElement: t, config: n, container: a, dismissOnOutsideClick: o, dismiss: s }) {
|
|
204
210
|
return (c, l = {}) => {
|
|
205
211
|
let u = {
|
|
206
212
|
getBoundingClientRect: () => e() ?? new DOMRect(),
|
|
207
213
|
contextElement: t
|
|
208
214
|
}, d = !1, f = !c.isConnected;
|
|
209
|
-
f &&
|
|
210
|
-
let p =
|
|
211
|
-
|
|
215
|
+
f && y(a).appendChild(c), l.onPosition || (c.style.visibility = "hidden", c.style.width = "max-content");
|
|
216
|
+
let p = i(u, c, () => {
|
|
217
|
+
r(u, c, {
|
|
212
218
|
placement: n.placement,
|
|
213
219
|
strategy: n.strategy,
|
|
214
220
|
middleware: n.middleware
|
|
@@ -237,53 +243,55 @@ function x({ getReferenceRect: e, contextElement: t, config: n, container: r, di
|
|
|
237
243
|
};
|
|
238
244
|
};
|
|
239
245
|
}
|
|
240
|
-
function
|
|
241
|
-
let g,
|
|
246
|
+
function x({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i, debounce: a, initialItems: o, placement: s, offset: c, container: l, flip: u, floatingUi: d, dismissOnOutsideClick: f, command: p, clientRectFor: m, dispatchExit: h }) {
|
|
247
|
+
let g, y = _({
|
|
242
248
|
editor: e,
|
|
243
249
|
items: n
|
|
244
|
-
}),
|
|
250
|
+
}), x = v({
|
|
245
251
|
placement: s,
|
|
246
252
|
offset: c,
|
|
247
253
|
flip: u,
|
|
248
254
|
floatingUi: d
|
|
249
255
|
});
|
|
250
256
|
function S(e, t) {
|
|
251
|
-
var n, i, a;
|
|
252
257
|
switch (e) {
|
|
253
258
|
case "started":
|
|
254
|
-
|
|
259
|
+
var n;
|
|
260
|
+
r == null || (n = r.onStart) == null || n.call(r, t);
|
|
255
261
|
break;
|
|
256
262
|
case "updated":
|
|
257
|
-
|
|
263
|
+
var i;
|
|
264
|
+
r == null || (i = r.onUpdate) == null || i.call(r, t);
|
|
258
265
|
break;
|
|
259
|
-
case "stopped":
|
|
266
|
+
case "stopped":
|
|
267
|
+
var a;
|
|
268
|
+
r == null || (a = r.onExit) == null || a.call(r, t);
|
|
260
269
|
}
|
|
261
270
|
}
|
|
262
271
|
return {
|
|
263
272
|
update: async (n, d) => {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (
|
|
269
|
-
else if (
|
|
270
|
-
else if (w.active && k) T = "updated";
|
|
273
|
+
let _ = t.getState(d), v = t.getState(n.state);
|
|
274
|
+
if (!_ || !v) return;
|
|
275
|
+
let C = null, w = _.query !== v.query, T = _.text !== v.text, E = _.range.from !== v.range.from || _.range.to !== v.range.to, D = w || T || E;
|
|
276
|
+
if (!_.active && v.active) C = "started";
|
|
277
|
+
else if (_.active && !v.active) C = "stopped";
|
|
278
|
+
else if (v.active && D) C = "updated";
|
|
271
279
|
else return;
|
|
272
|
-
let
|
|
280
|
+
let O = C === "stopped" ? _ : v, k = n.dom.querySelector(`[data-decoration-id="${O.decorationId}"]`), A = m(n, k), j = i === 0 || (O.query ? O.query.length >= i : !1), M = (C === "started" || C === "updated") && j;
|
|
273
281
|
if (g = {
|
|
274
282
|
editor: e,
|
|
275
|
-
range:
|
|
276
|
-
query:
|
|
277
|
-
text:
|
|
283
|
+
range: O.range,
|
|
284
|
+
query: O.query || "",
|
|
285
|
+
text: O.text || "",
|
|
278
286
|
items: o ?? [],
|
|
279
287
|
command: (t) => p({
|
|
280
288
|
editor: e,
|
|
281
|
-
range:
|
|
289
|
+
range: O.range,
|
|
282
290
|
props: t
|
|
283
291
|
}),
|
|
284
|
-
decorationNode:
|
|
285
|
-
clientRect:
|
|
286
|
-
loading:
|
|
292
|
+
decorationNode: k,
|
|
293
|
+
clientRect: A,
|
|
294
|
+
loading: M,
|
|
287
295
|
placement: s,
|
|
288
296
|
offset: {
|
|
289
297
|
mainAxis: c.mainAxis ?? 4,
|
|
@@ -291,17 +299,25 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
291
299
|
},
|
|
292
300
|
container: l,
|
|
293
301
|
flip: u,
|
|
294
|
-
floatingUi:
|
|
295
|
-
mount:
|
|
296
|
-
getReferenceRect:
|
|
302
|
+
floatingUi: x,
|
|
303
|
+
mount: b({
|
|
304
|
+
getReferenceRect: A,
|
|
297
305
|
contextElement: n.dom,
|
|
298
|
-
config:
|
|
306
|
+
config: x,
|
|
299
307
|
container: l,
|
|
300
308
|
dismissOnOutsideClick: f,
|
|
301
309
|
dismiss: () => h(e.view)
|
|
302
310
|
})
|
|
303
|
-
},
|
|
304
|
-
|
|
311
|
+
}, C === "started") {
|
|
312
|
+
var N;
|
|
313
|
+
r == null || (N = r.onBeforeStart) == null || N.call(r, g);
|
|
314
|
+
}
|
|
315
|
+
if (C === "updated") {
|
|
316
|
+
var P;
|
|
317
|
+
r == null || (P = r.onBeforeUpdate) == null || P.call(r, g);
|
|
318
|
+
}
|
|
319
|
+
if (C === "started" && S(C, g), C === "started" || C === "updated") {
|
|
320
|
+
if (!M) y.abort(), g = {
|
|
305
321
|
...g,
|
|
306
322
|
items: o ?? [],
|
|
307
323
|
loading: !1
|
|
@@ -311,11 +327,11 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
311
327
|
...g,
|
|
312
328
|
items: o ?? [],
|
|
313
329
|
loading: !0
|
|
314
|
-
},
|
|
315
|
-
let e = await
|
|
330
|
+
}, C = "updated", S(C, g);
|
|
331
|
+
let e = await y.fetch(O.query || "", a);
|
|
316
332
|
if (e.status === "aborted") return;
|
|
317
333
|
if (!t.getState(n.state)?.active) {
|
|
318
|
-
|
|
334
|
+
y.abort();
|
|
319
335
|
return;
|
|
320
336
|
}
|
|
321
337
|
g = e.status === "resolved" ? {
|
|
@@ -328,42 +344,42 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
328
344
|
};
|
|
329
345
|
}
|
|
330
346
|
}
|
|
331
|
-
if (
|
|
332
|
-
|
|
347
|
+
if (C === "stopped") {
|
|
348
|
+
y.abort(), S(C, g), g = void 0;
|
|
333
349
|
return;
|
|
334
350
|
}
|
|
335
|
-
|
|
351
|
+
C === "updated" && S(C, g);
|
|
336
352
|
},
|
|
337
353
|
destroy: () => {
|
|
338
354
|
var e;
|
|
339
|
-
|
|
355
|
+
y.abort(), g && (r == null || (e = r.onExit) == null || e.call(r, g));
|
|
340
356
|
}
|
|
341
357
|
};
|
|
342
358
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
let I = j?.(), L = r && !i, R = (n, r) =>
|
|
359
|
+
var S = new o("suggestion");
|
|
360
|
+
function C({ pluginKey: e = S, editor: t, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: o = [" "], startOfLine: s = !1, decorationTag: c = "span", decorationClass: u = "suggestion", decorationContent: d = "", decorationEmptyClass: _ = "is-empty", command: v = () => null, items: y = () => [], minQueryLength: b = 0, debounce: C = 0, initialItems: w, placement: T = "bottom-start", offset: E = {}, container: D, flip: O = !0, floatingUi: k, dismissOnOutsideClick: A = !0, render: j = () => ({}), allow: M = () => !0, findSuggestionMatch: N = l, shouldShow: P, shouldResetDismissed: F }) {
|
|
361
|
+
let I = j?.(), L = r && !i, R = (n, r) => f(t, n, r, e);
|
|
346
362
|
function z(e) {
|
|
347
|
-
return
|
|
363
|
+
return p({
|
|
348
364
|
...e,
|
|
349
365
|
editor: t,
|
|
350
366
|
shouldResetDismissed: F,
|
|
351
367
|
effectiveAllowSpaces: L
|
|
352
368
|
});
|
|
353
369
|
}
|
|
354
|
-
let B = (t) =>
|
|
370
|
+
let B = (t) => m({
|
|
355
371
|
view: t,
|
|
356
372
|
pluginKeyRef: e
|
|
357
373
|
});
|
|
358
|
-
return new
|
|
374
|
+
return new a({
|
|
359
375
|
key: e,
|
|
360
|
-
view: () =>
|
|
376
|
+
view: () => x({
|
|
361
377
|
editor: t,
|
|
362
378
|
pluginKey: e,
|
|
363
379
|
items: y,
|
|
364
380
|
renderer: I,
|
|
365
381
|
minQueryLength: b,
|
|
366
|
-
debounce:
|
|
382
|
+
debounce: C,
|
|
367
383
|
initialItems: w,
|
|
368
384
|
placement: T,
|
|
369
385
|
offset: E,
|
|
@@ -375,12 +391,12 @@ function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, al
|
|
|
375
391
|
clientRectFor: R,
|
|
376
392
|
dispatchExit: B
|
|
377
393
|
}),
|
|
378
|
-
state:
|
|
394
|
+
state: g({
|
|
379
395
|
editor: t,
|
|
380
396
|
char: n,
|
|
381
397
|
effectiveAllowSpaces: L,
|
|
382
398
|
allowToIncludeChar: i,
|
|
383
|
-
allowedPrefixes:
|
|
399
|
+
allowedPrefixes: o,
|
|
384
400
|
startOfLine: s,
|
|
385
401
|
findSuggestionMatch: N,
|
|
386
402
|
allow: M,
|
|
@@ -388,42 +404,17 @@ function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, al
|
|
|
388
404
|
shouldKeepDismissed: z,
|
|
389
405
|
pluginKey: e
|
|
390
406
|
}),
|
|
391
|
-
props:
|
|
407
|
+
props: h({
|
|
392
408
|
pluginKey: e,
|
|
393
409
|
decorationTag: c,
|
|
394
|
-
decorationClass:
|
|
410
|
+
decorationClass: u,
|
|
395
411
|
decorationContent: d,
|
|
396
|
-
decorationEmptyClass:
|
|
412
|
+
decorationEmptyClass: _,
|
|
397
413
|
renderer: I,
|
|
398
414
|
dispatchExit: B
|
|
399
415
|
})
|
|
400
416
|
});
|
|
401
417
|
}
|
|
402
|
-
var
|
|
403
|
-
name: "slashCommand",
|
|
404
|
-
addOptions() {
|
|
405
|
-
return {
|
|
406
|
-
...this.parent?.(),
|
|
407
|
-
slashSuggestion: {
|
|
408
|
-
char: "/",
|
|
409
|
-
startOfLine: !0,
|
|
410
|
-
command: ({ editor: e, range: t, props: n }) => {
|
|
411
|
-
n.command({
|
|
412
|
-
editor: e,
|
|
413
|
-
range: t,
|
|
414
|
-
props: n
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
},
|
|
420
|
-
addProseMirrorPlugins() {
|
|
421
|
-
return [T({
|
|
422
|
-
pluginKey: E,
|
|
423
|
-
...this.options.slashSuggestion,
|
|
424
|
-
editor: this.editor
|
|
425
|
-
})];
|
|
426
|
-
}
|
|
427
|
-
});
|
|
418
|
+
var w = C;
|
|
428
419
|
//#endregion
|
|
429
|
-
export {
|
|
420
|
+
export { w as n, C as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CtkjhSXr.js";
|
|
2
|
-
import { C as t, N as n, o as r, t as i } from "./dist-
|
|
2
|
+
import { C as t, N as n, o as r, t as i } from "./dist-jjH04EIX.js";
|
|
3
3
|
import * as a from "react";
|
|
4
4
|
import o, { createContext as s, createElement as c, createRef as l, forwardRef as u, memo as d, useContext as f, useDebugValue as p, useEffect as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v, version as y } from "react";
|
|
5
5
|
import b, { flushSync as ee } from "react-dom";
|
|
@@ -764,7 +764,7 @@ var X = class {
|
|
|
764
764
|
let t = this.component, n = this.props, r = this.editor, i = rt(), a = nt(t), o = { ...n };
|
|
765
765
|
o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
|
|
766
766
|
this.ref = e;
|
|
767
|
-
}), this.reactElement = /* @__PURE__ */ S(t, { ...o }), (e = r
|
|
767
|
+
}), this.reactElement = /* @__PURE__ */ S(t, { ...o }), r == null || (e = r.contentComponent) == null || e.setRenderer(this.id, this);
|
|
768
768
|
}
|
|
769
769
|
updateProps(e = {}) {
|
|
770
770
|
if (this.destroyed) return;
|
|
@@ -783,7 +783,9 @@ var X = class {
|
|
|
783
783
|
}
|
|
784
784
|
destroy() {
|
|
785
785
|
var e;
|
|
786
|
-
this.destroyed = !0
|
|
786
|
+
this.destroyed = !0;
|
|
787
|
+
let t = this.editor;
|
|
788
|
+
t == null || (e = t.contentComponent) == null || e.removeRenderer(this.id);
|
|
787
789
|
try {
|
|
788
790
|
this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
|
|
789
791
|
} catch {}
|
|
@@ -796,12 +798,13 @@ var X = class {
|
|
|
796
798
|
};
|
|
797
799
|
o.createContext({ markViewContentRef: () => {} });
|
|
798
800
|
function it(e) {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
801
|
+
var t;
|
|
802
|
+
let n = e.getRootNode(), r = typeof n.getSelection == "function" ? n.getSelection() : (t = e.ownerDocument) == null || (t = t.defaultView) == null ? void 0 : t.getSelection();
|
|
803
|
+
if (!r || r.rangeCount === 0) return null;
|
|
804
|
+
let { anchorNode: i, anchorOffset: a, focusNode: o, focusOffset: s } = r;
|
|
805
|
+
return !i || !o || !e.contains(i) || !e.contains(o) ? null : () => {
|
|
803
806
|
try {
|
|
804
|
-
|
|
807
|
+
r.setBaseAndExtent(i, a, o, s);
|
|
805
808
|
} catch {}
|
|
806
809
|
};
|
|
807
810
|
}
|
|
@@ -953,7 +956,16 @@ var at = class extends r {
|
|
|
953
956
|
}
|
|
954
957
|
};
|
|
955
958
|
function ot(e, t) {
|
|
956
|
-
return (n) => n.editor.contentComponent ? new at(e, n, t) : {
|
|
959
|
+
return (n) => n.editor.contentComponent ? new at(e, n, t) : {
|
|
960
|
+
dom: document.createElement("span"),
|
|
961
|
+
contentDOM: null,
|
|
962
|
+
update: () => !1,
|
|
963
|
+
destroy: () => {},
|
|
964
|
+
selectNode: () => {},
|
|
965
|
+
deselectNode: () => {},
|
|
966
|
+
stopEvent: () => !1,
|
|
967
|
+
ignoreMutation: () => !0
|
|
968
|
+
};
|
|
957
969
|
}
|
|
958
970
|
var Z = s({ get editor() {
|
|
959
971
|
throw Error("useTiptap must be used within a <Tiptap> provider");
|