@clevertask/scribe 0.1.17 → 0.1.19
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-x4sf3ECS.js → BarMenu-C9tCdvyV.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.d.ts.map +1 -1
- package/dist/components/Menu/LinkBubbleMenu.js +16 -16
- package/dist/components/Menu/LinkEditor.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +4 -4
- package/dist/{dist-tNcpTcFT.js → dist-CkWsQ5Lj.js} +197 -185
- package/dist/{slashCommand-CtvgnL0Z.js → dist-CzXFZHMF.js} +56 -81
- package/dist/{dist-DDjaA1Pn.js → dist-DRPH9MfF.js} +1 -1
- package/dist/extension-CKcvyrIW.js +57 -0
- package/dist/{extension-link-RYtPpHwt.js → extension-link-yMrg9JOz.js} +2 -2
- package/dist/{html-to-markdown-nbQ6qHyO.js → html-to-markdown-pY8ngCXa.js} +14 -14
- package/dist/main.js +6 -6
- package/dist/{markdown-to-html-B-KKCZRs.js → markdown-to-html-COv0iaxr.js} +14 -15
- package/dist/{menus-U2HdvQnu.js → menus-D1cst_3I.js} +107 -107
- package/dist/purify.es-DGv0-Lid.js +805 -0
- package/dist/{resizable-table-m0AzovsZ.js → resizable-table-D0mls3aB.js} +2 -2
- package/dist/{extension-CwuvxVkr.js → schema-extensions-ChhE6XCo.js} +51921 -51948
- 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 +58 -52
- package/dist/purify.es-BES4pJF7.js +0 -774
|
@@ -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-CkWsQ5Lj.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.2_@floating-ui+dom@1.8.0_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/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,13 +52,13 @@ 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;
|
|
@@ -74,10 +74,10 @@ function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationConte
|
|
|
74
74
|
}) || !1 : !1;
|
|
75
75
|
},
|
|
76
76
|
decorations(a) {
|
|
77
|
-
let { active: o, range:
|
|
77
|
+
let { active: o, range: l, decorationId: u, query: d } = e.getState(a);
|
|
78
78
|
if (!o) return null;
|
|
79
79
|
let f = !d?.length, p = [n];
|
|
80
|
-
return f && p.push(i),
|
|
80
|
+
return f && p.push(i), c.create(a.doc, [s.inline(l.from, l.to, {
|
|
81
81
|
nodeName: t,
|
|
82
82
|
class: p.join(" "),
|
|
83
83
|
"data-decoration-id": u || void 0,
|
|
@@ -86,7 +86,7 @@ function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationConte
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
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
90
|
return {
|
|
91
91
|
init() {
|
|
92
92
|
return {
|
|
@@ -145,7 +145,7 @@ function _({ editor: e, char: t, effectiveAllowSpaces: n, allowToIncludeChar: r,
|
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function _({ editor: e, items: t }) {
|
|
149
149
|
let n = null, r = null, i = null, a = () => {
|
|
150
150
|
r !== null && (clearTimeout(r), r = null), i?.(), i = null;
|
|
151
151
|
}, o = (e) => new Promise((t) => {
|
|
@@ -179,18 +179,18 @@ function v({ editor: e, items: t }) {
|
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
let o = [
|
|
184
|
-
mainAxis:
|
|
185
|
-
crossAxis:
|
|
182
|
+
function v({ placement: e, offset: r, flip: i, floatingUi: a }) {
|
|
183
|
+
let o = [n({
|
|
184
|
+
mainAxis: r.mainAxis ?? 4,
|
|
185
|
+
crossAxis: r.crossAxis ?? 0
|
|
186
186
|
})];
|
|
187
|
-
return i && o.push(
|
|
187
|
+
return i && o.push(t()), a?.middleware?.length && o.push(...a.middleware), {
|
|
188
188
|
placement: e,
|
|
189
189
|
strategy: a?.strategy ?? "absolute",
|
|
190
190
|
middleware: o
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function y(e) {
|
|
194
194
|
if (e instanceof HTMLElement) return e;
|
|
195
195
|
if (typeof e == "string") try {
|
|
196
196
|
let t = document.querySelector(e);
|
|
@@ -200,15 +200,15 @@ function b(e) {
|
|
|
200
200
|
}
|
|
201
201
|
return document.body;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function b({ getReferenceRect: e, contextElement: t, config: n, container: a, dismissOnOutsideClick: o, dismiss: s }) {
|
|
204
204
|
return (c, l = {}) => {
|
|
205
205
|
let u = {
|
|
206
206
|
getBoundingClientRect: () => e() ?? new DOMRect(),
|
|
207
207
|
contextElement: t
|
|
208
208
|
}, d = !1, f = !c.isConnected;
|
|
209
|
-
f &&
|
|
210
|
-
let p =
|
|
211
|
-
|
|
209
|
+
f && y(a).appendChild(c), l.onPosition || (c.style.visibility = "hidden", c.style.width = "max-content");
|
|
210
|
+
let p = i(u, c, () => {
|
|
211
|
+
r(u, c, {
|
|
212
212
|
placement: n.placement,
|
|
213
213
|
strategy: n.strategy,
|
|
214
214
|
middleware: n.middleware
|
|
@@ -237,11 +237,11 @@ function x({ getReferenceRect: e, contextElement: t, config: n, container: r, di
|
|
|
237
237
|
};
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
let g,
|
|
240
|
+
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 }) {
|
|
241
|
+
let g, y = _({
|
|
242
242
|
editor: e,
|
|
243
243
|
items: n
|
|
244
|
-
}),
|
|
244
|
+
}), x = v({
|
|
245
245
|
placement: s,
|
|
246
246
|
offset: c,
|
|
247
247
|
flip: u,
|
|
@@ -261,7 +261,7 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
261
261
|
}
|
|
262
262
|
return {
|
|
263
263
|
update: async (n, d) => {
|
|
264
|
-
var
|
|
264
|
+
var _, v;
|
|
265
265
|
let C = t.getState(d), w = t.getState(n.state);
|
|
266
266
|
if (!C || !w) return;
|
|
267
267
|
let T = null, E = C.query !== w.query, D = C.text !== w.text, O = C.range.from !== w.range.from || C.range.to !== w.range.to, k = E || D || O;
|
|
@@ -291,17 +291,17 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
291
291
|
},
|
|
292
292
|
container: l,
|
|
293
293
|
flip: u,
|
|
294
|
-
floatingUi:
|
|
295
|
-
mount:
|
|
294
|
+
floatingUi: x,
|
|
295
|
+
mount: b({
|
|
296
296
|
getReferenceRect: M,
|
|
297
297
|
contextElement: n.dom,
|
|
298
|
-
config:
|
|
298
|
+
config: x,
|
|
299
299
|
container: l,
|
|
300
300
|
dismissOnOutsideClick: f,
|
|
301
301
|
dismiss: () => h(e.view)
|
|
302
302
|
})
|
|
303
|
-
}, T === "started" && ((
|
|
304
|
-
if (!P)
|
|
303
|
+
}, T === "started" && ((_ = r?.onBeforeStart) == null || _.call(r, g)), T === "updated" && ((v = r?.onBeforeUpdate) == null || v.call(r, g)), T === "started" && S(T, g), T === "started" || T === "updated") {
|
|
304
|
+
if (!P) y.abort(), g = {
|
|
305
305
|
...g,
|
|
306
306
|
items: o ?? [],
|
|
307
307
|
loading: !1
|
|
@@ -312,10 +312,10 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
312
312
|
items: o ?? [],
|
|
313
313
|
loading: !0
|
|
314
314
|
}, T = "updated", S(T, g);
|
|
315
|
-
let e = await
|
|
315
|
+
let e = await y.fetch(A.query || "", a);
|
|
316
316
|
if (e.status === "aborted") return;
|
|
317
317
|
if (!t.getState(n.state)?.active) {
|
|
318
|
-
|
|
318
|
+
y.abort();
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
321
|
g = e.status === "resolved" ? {
|
|
@@ -329,41 +329,41 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
if (T === "stopped") {
|
|
332
|
-
|
|
332
|
+
y.abort(), S(T, g), g = void 0;
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
335
|
T === "updated" && S(T, g);
|
|
336
336
|
},
|
|
337
337
|
destroy: () => {
|
|
338
338
|
var e;
|
|
339
|
-
|
|
339
|
+
y.abort(), g && ((e = r?.onExit) == null || e.call(r, g));
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
let I = j?.(), L = r && !i, R = (n, r) =>
|
|
343
|
+
var S = new o("suggestion");
|
|
344
|
+
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 }) {
|
|
345
|
+
let I = j?.(), L = r && !i, R = (n, r) => f(t, n, r, e);
|
|
346
346
|
function z(e) {
|
|
347
|
-
return
|
|
347
|
+
return p({
|
|
348
348
|
...e,
|
|
349
349
|
editor: t,
|
|
350
350
|
shouldResetDismissed: F,
|
|
351
351
|
effectiveAllowSpaces: L
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
let B = (t) =>
|
|
354
|
+
let B = (t) => m({
|
|
355
355
|
view: t,
|
|
356
356
|
pluginKeyRef: e
|
|
357
357
|
});
|
|
358
|
-
return new
|
|
358
|
+
return new a({
|
|
359
359
|
key: e,
|
|
360
|
-
view: () =>
|
|
360
|
+
view: () => x({
|
|
361
361
|
editor: t,
|
|
362
362
|
pluginKey: e,
|
|
363
363
|
items: y,
|
|
364
364
|
renderer: I,
|
|
365
365
|
minQueryLength: b,
|
|
366
|
-
debounce:
|
|
366
|
+
debounce: C,
|
|
367
367
|
initialItems: w,
|
|
368
368
|
placement: T,
|
|
369
369
|
offset: E,
|
|
@@ -375,12 +375,12 @@ function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, al
|
|
|
375
375
|
clientRectFor: R,
|
|
376
376
|
dispatchExit: B
|
|
377
377
|
}),
|
|
378
|
-
state:
|
|
378
|
+
state: g({
|
|
379
379
|
editor: t,
|
|
380
380
|
char: n,
|
|
381
381
|
effectiveAllowSpaces: L,
|
|
382
382
|
allowToIncludeChar: i,
|
|
383
|
-
allowedPrefixes:
|
|
383
|
+
allowedPrefixes: o,
|
|
384
384
|
startOfLine: s,
|
|
385
385
|
findSuggestionMatch: N,
|
|
386
386
|
allow: M,
|
|
@@ -388,42 +388,17 @@ function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, al
|
|
|
388
388
|
shouldKeepDismissed: z,
|
|
389
389
|
pluginKey: e
|
|
390
390
|
}),
|
|
391
|
-
props:
|
|
391
|
+
props: h({
|
|
392
392
|
pluginKey: e,
|
|
393
393
|
decorationTag: c,
|
|
394
|
-
decorationClass:
|
|
394
|
+
decorationClass: u,
|
|
395
395
|
decorationContent: d,
|
|
396
|
-
decorationEmptyClass:
|
|
396
|
+
decorationEmptyClass: _,
|
|
397
397
|
renderer: I,
|
|
398
398
|
dispatchExit: B
|
|
399
399
|
})
|
|
400
400
|
});
|
|
401
401
|
}
|
|
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
|
-
});
|
|
402
|
+
var w = C;
|
|
428
403
|
//#endregion
|
|
429
|
-
export {
|
|
404
|
+
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-CkWsQ5Lj.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";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./schema-extensions-ChhE6XCo.js";
|
|
2
|
+
import r from "./components/Scribe/extension/extension-markdown-paste.js";
|
|
3
|
+
import { SlashCommand as i } from "./components/Scribe/extension/slashCommand/index.js";
|
|
4
|
+
import a from "./components/Scribe/extension/extension-selectedText.js";
|
|
5
|
+
import o from "./components/Scribe/extension/slashCommand/renderItems.js";
|
|
6
|
+
import { getSlashCommandContext as s, getSuggestionItems as c } from "./components/Scribe/extension/slashCommand/items.js";
|
|
7
|
+
import l from "./components/Scribe/extension/emoji/suggest.js";
|
|
8
|
+
import { ScribeTableOfContents as u } from "./components/Scribe/extension/tableOfContents.js";
|
|
9
|
+
import { ExternalLinkPreview as d } from "./components/Scribe/extension/external-link-preview/index.js";
|
|
10
|
+
//#region node_modules/.pnpm/@tiptap+extension-focus@3.30.2_@tiptap+extensions@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2_/node_modules/@tiptap/extension-focus/dist/index.js
|
|
11
|
+
var f = e, p = t, m = (e) => {
|
|
12
|
+
let { items: t, render: m, ...h } = e.slashCommand ?? {}, g = n({ enableUndoRedo: e.enableUndoRedo });
|
|
13
|
+
return [
|
|
14
|
+
g.starterKit,
|
|
15
|
+
d.configure(e.externalLinkPreview),
|
|
16
|
+
g.callout,
|
|
17
|
+
g.taskList,
|
|
18
|
+
g.taskItem,
|
|
19
|
+
g.tableKit,
|
|
20
|
+
g.table,
|
|
21
|
+
p.configure({
|
|
22
|
+
showOnlyWhenEditable: !0,
|
|
23
|
+
includeChildren: !0,
|
|
24
|
+
showOnlyCurrent: !1,
|
|
25
|
+
emptyEditorClass: "is-editor-empty",
|
|
26
|
+
emptyNodeClass: "is-node-empty",
|
|
27
|
+
placeholder: ({ editor: t, node: n }) => t.isDestroyed ? "" : n.type.name === "heading" ? `Heading ${n.attrs.level}` : e.placeholderText || "Type \"/\" for commands..."
|
|
28
|
+
}),
|
|
29
|
+
f.configure({
|
|
30
|
+
mode: "deepest",
|
|
31
|
+
className: "has-focus"
|
|
32
|
+
}),
|
|
33
|
+
r,
|
|
34
|
+
i.configure({ slashSuggestion: {
|
|
35
|
+
...h,
|
|
36
|
+
items: (e) => {
|
|
37
|
+
let n = c(e);
|
|
38
|
+
return t ? t({
|
|
39
|
+
...e,
|
|
40
|
+
context: s(e.editor),
|
|
41
|
+
defaultItems: n
|
|
42
|
+
}) : n;
|
|
43
|
+
},
|
|
44
|
+
render: m ?? o
|
|
45
|
+
} }),
|
|
46
|
+
g.highlight,
|
|
47
|
+
a,
|
|
48
|
+
g.link,
|
|
49
|
+
g.image,
|
|
50
|
+
g.emoji.configure({ suggestion: l() }),
|
|
51
|
+
g.mathematics,
|
|
52
|
+
g.typography,
|
|
53
|
+
...e.enableTableOfContents ? [u.configure({ onUpdate: e.onTableOfContentsChange })] : []
|
|
54
|
+
];
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { m as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as e, I as t, L as n, d as r, g as i, h as a, i as o, p as s, r as c, s as l, y as u } from "./dist-
|
|
1
|
+
import { F as e, I as t, L as n, d as r, g as i, h as a, i as o, p as s, r as c, s as l, y as u } from "./dist-CkWsQ5Lj.js";
|
|
2
2
|
import { Plugin as d, PluginKey as f } from "@tiptap/pm/state";
|
|
3
3
|
//#region node_modules/.pnpm/linkifyjs@4.3.3/node_modules/linkifyjs/dist/linkify.mjs
|
|
4
4
|
var p = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", m = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", h = "numeric", g = "ascii", _ = "alpha", v = "asciinumeric", y = "alphanumeric", b = "domain", x = "emoji", ee = "scheme", S = "slashscheme", C = "whitespace";
|
|
@@ -511,7 +511,7 @@ function yt(e, t = null, n = null) {
|
|
|
511
511
|
return a;
|
|
512
512
|
}
|
|
513
513
|
//#endregion
|
|
514
|
-
//#region node_modules/.pnpm/@tiptap+extension-link@3.30.
|
|
514
|
+
//#region node_modules/.pnpm/@tiptap+extension-link@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-link/dist/index.js
|
|
515
515
|
var bt = "[\0- \xA0 -\u2029 ]", xt = new RegExp(bt), St = RegExp(`${bt}$`), Ct = new RegExp(bt, "g");
|
|
516
516
|
function wt(e) {
|
|
517
517
|
return e.length === 1 ? e[0].isLink : e.length === 3 && e[1].isLink ? ["()", "[]"].includes(e[0].value + e[2].value) : !1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { normalizeExternalLinkPreviewElement as e, normalizeExternalLinkPreviewsInTree as t } from "./components/Scribe/extension/external-link-preview/serialization.js";
|
|
2
|
+
import { t as n } from "./purify.es-DGv0-Lid.js";
|
|
3
3
|
//#region node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.js
|
|
4
4
|
function r(e) {
|
|
5
5
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -525,10 +525,10 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
|
|
|
525
525
|
let i = e.turndown(r.innerHTML).split(G).join("<br>").split("|").join("\\|").trim();
|
|
526
526
|
return /[\r\n]/.test(i) ? null : i;
|
|
527
527
|
}, Q = (e) => {
|
|
528
|
-
let
|
|
529
|
-
return
|
|
528
|
+
let n = e.cloneNode(!0);
|
|
529
|
+
return n.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
|
|
530
530
|
e.textContent === "•" && (e.textContent = "");
|
|
531
|
-
}), $(
|
|
531
|
+
}), $(n), t(n), n.outerHTML;
|
|
532
532
|
}, fe = (e) => {
|
|
533
533
|
let t = e?.trim().toLowerCase();
|
|
534
534
|
return t && K.has(t) ? t : "info";
|
|
@@ -551,13 +551,13 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
|
|
|
551
551
|
}), pe(e);
|
|
552
552
|
});
|
|
553
553
|
}, he = (e) => {
|
|
554
|
-
let t = e.cloneNode(!0);
|
|
555
|
-
return t.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
|
|
556
|
-
e.textContent === "•" && (e.textContent = "");
|
|
557
|
-
}), $(t), n(t), t.outerHTML;
|
|
558
|
-
}, ge = (e) => {
|
|
559
554
|
let n = e.cloneNode(!0);
|
|
560
|
-
return
|
|
555
|
+
return n.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
|
|
556
|
+
e.textContent === "•" && (e.textContent = "");
|
|
557
|
+
}), $(n), t(n), n.outerHTML;
|
|
558
|
+
}, ge = (t) => {
|
|
559
|
+
let n = t.cloneNode(!0);
|
|
560
|
+
return e(n) ? n.outerHTML : n.textContent ?? "";
|
|
561
561
|
}, _e = (e) => {
|
|
562
562
|
e.addRule("scribeExternalLinkPreview", {
|
|
563
563
|
filter: (e) => e.nodeName === "SPAN" && e.getAttribute("data-type") === "external-link-preview",
|
|
@@ -580,7 +580,7 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
|
|
|
580
580
|
return c.splice(1, 0, l), `\n\n${c.join("\n")}\n\n`;
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
|
-
}, be = (
|
|
583
|
+
}, be = (e) => {
|
|
584
584
|
let r = new z({
|
|
585
585
|
headingStyle: "atx",
|
|
586
586
|
hr: "---",
|
|
@@ -601,8 +601,8 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
|
|
|
601
601
|
return "~~" + e + "~~";
|
|
602
602
|
}
|
|
603
603
|
}), ve(r), ye(r), _e(r);
|
|
604
|
-
let i =
|
|
605
|
-
return a.innerHTML = i,
|
|
604
|
+
let i = n.sanitize(((e) => e.replace(/<span([^>]+data-type="latex"[^>]*)><\/span>/g, "<span$1>•</span>"))(e), { ADD_ATTR: ["colwidth"] }), a = document.createElement("div");
|
|
605
|
+
return a.innerHTML = i, t(a), r.turndown(a.innerHTML);
|
|
606
606
|
};
|
|
607
607
|
//#endregion
|
|
608
608
|
export { be as t };
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as s } from "./html-to-markdown-
|
|
5
|
-
import { t as c } from "./markdown-to-html-
|
|
1
|
+
import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, Callout as n, DEFAULT_CALLOUT_VARIANT as r, isCalloutVariant as i } from "./components/Scribe/extension/callout.js";
|
|
2
|
+
import { EXTERNAL_LINK_PREVIEW_DISPLAYS as a } from "./components/Scribe/extension/external-link-preview/types.js";
|
|
3
|
+
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as o } from "./components/Scribe/extension/external-link-preview/attributes.js";
|
|
4
|
+
import { t as s } from "./html-to-markdown-pY8ngCXa.js";
|
|
5
|
+
import { t as c } from "./markdown-to-html-COv0iaxr.js";
|
|
6
6
|
import { isInViewport as l } from "./utils/is-in-viewport.js";
|
|
7
7
|
import { convertLegacyMathDelimiters as u } from "./utils/convert-legacy-math-delimiters.js";
|
|
8
8
|
import { SuggestionItemType as d } from "./components/Scribe/extension/slashCommand/items.js";
|
|
9
9
|
import { ExternalLinkPreview as f } from "./components/Scribe/extension/external-link-preview/index.js";
|
|
10
10
|
import { createScribeEditor as p } from "./utils/index.js";
|
|
11
11
|
import { Scribe as m } from "./components/Scribe/index.js";
|
|
12
|
-
export {
|
|
12
|
+
export { e as CALLOUT_VARIANTS, t as CALLOUT_VARIANT_LABELS, n as Callout, r as DEFAULT_CALLOUT_VARIANT, a as EXTERNAL_LINK_PREVIEW_DISPLAYS, o as EXTERNAL_LINK_PREVIEW_NODE_NAME, f as ExternalLinkPreview, m as Scribe, d as SuggestionItemType, u as convertLegacyMathDelimiters, p as createScribeEditor, s as html2md, i as isCalloutVariant, l as isInViewport, c as md2html };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region node_modules/.pnpm/marked@18.0.
|
|
1
|
+
import { normalizeExternalLinkPreviewsInTree as e } from "./components/Scribe/extension/external-link-preview/serialization.js";
|
|
2
|
+
import { t } from "./purify.es-DGv0-Lid.js";
|
|
3
|
+
//#region node_modules/.pnpm/marked@18.0.10/node_modules/marked/lib/marked.esm.js
|
|
4
4
|
function n() {
|
|
5
5
|
return {
|
|
6
6
|
async: !1,
|
|
@@ -100,7 +100,7 @@ var c = ((e = "") => {
|
|
|
100
100
|
headingBeginRegex: o((e) => RegExp(`^ {0,${e}}#`)),
|
|
101
101
|
htmlBeginRegex: o((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
|
|
102
102
|
blockquoteBeginRegex: o((e) => RegExp(`^ {0,${e}}>`))
|
|
103
|
-
}, u = /^(?:[ \t]*(?:\n|$))+/, d = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, f = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, p = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, m = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, h = / {0,3}(?:[*+-]|\d{1,9}[.)])/, g = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, _ = s(g).replace(/bull/g, h).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ee = s(g).replace(/bull/g, h).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), v = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, te = /^[^\n]+/, y = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ne = s(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", y).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), re = s(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, h).getRegex(), b = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", x = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ie = s("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", x).replace("tag", b).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = (e) => s(v).replace("hr", p).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]
|
|
103
|
+
}, u = /^(?:[ \t]*(?:\n|$))+/, d = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, f = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, p = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, m = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, h = / {0,3}(?:[*+-]|\d{1,9}[.)])/, g = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, _ = s(g).replace(/bull/g, h).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ee = s(g).replace(/bull/g, h).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), v = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, te = /^[^\n]+/, y = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ne = s(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", y).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), re = s(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, h).getRegex(), b = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", x = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ie = s("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", x).replace("tag", b).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = (e) => s(v).replace("hr", p).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", b).getRegex(), oe = ae(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), se = ae(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), S = {
|
|
104
104
|
blockquote: s(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", se).getRegex(),
|
|
105
105
|
code: d,
|
|
106
106
|
def: ne,
|
|
@@ -114,11 +114,11 @@ var c = ((e = "") => {
|
|
|
114
114
|
paragraph: oe,
|
|
115
115
|
table: a,
|
|
116
116
|
text: te
|
|
117
|
-
}, C = s("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", p).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]
|
|
117
|
+
}, C = s("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", p).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", b).getRegex(), ce = {
|
|
118
118
|
...S,
|
|
119
119
|
lheading: ee,
|
|
120
120
|
table: C,
|
|
121
|
-
paragraph: s(v).replace("hr", p).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", C).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]
|
|
121
|
+
paragraph: s(v).replace("hr", p).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", C).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", b).getRegex()
|
|
122
122
|
}, le = {
|
|
123
123
|
...S,
|
|
124
124
|
html: s("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", x).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
@@ -414,8 +414,11 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
414
414
|
if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
|
|
415
415
|
else return;
|
|
416
416
|
i.raw = i.raw.trimEnd();
|
|
417
|
+
for (let e of i.items) if (this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []), !i.loose) {
|
|
418
|
+
let t = e.tokens.filter((e) => e.type === "space");
|
|
419
|
+
i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
|
|
420
|
+
}
|
|
417
421
|
for (let e of i.items) {
|
|
418
|
-
this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []);
|
|
419
422
|
let t = e.tokens[0];
|
|
420
423
|
if (e.task && (t?.type === "text" || t?.type === "paragraph")) {
|
|
421
424
|
e.text = e.text.replace(this.rules.other.listReplaceTask, ""), t.raw = t.raw.replace(this.rules.other.listReplaceTask, ""), t.text = t.text.replace(this.rules.other.listReplaceTask, "");
|
|
@@ -438,10 +441,6 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
438
441
|
}) : e.tokens.unshift(t);
|
|
439
442
|
}
|
|
440
443
|
} else e.task &&= !1;
|
|
441
|
-
if (!i.loose) {
|
|
442
|
-
let t = e.tokens.filter((e) => e.type === "space");
|
|
443
|
-
i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
|
|
444
|
-
}
|
|
445
444
|
}
|
|
446
445
|
if (i.loose) for (let e of i.items) {
|
|
447
446
|
e.loose = !0;
|
|
@@ -872,7 +871,7 @@ ${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
872
871
|
let e = Object.keys(this.tokens.links);
|
|
873
872
|
e.length > 0 && (n = n.replace(this.tokenizer.rules.inline.reflinkSearch, (t) => e.includes(t.slice(t.lastIndexOf("[") + 1, -1)) ? "[" + "a".repeat(t.length - 2) + "]" : t));
|
|
874
873
|
}
|
|
875
|
-
n = n.replace(this.tokenizer.rules.inline.anyPunctuation, "
|
|
874
|
+
n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (e) => "+".repeat(e.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (e, t, n) => {
|
|
876
875
|
let r = n ? n.length : 0;
|
|
877
876
|
return e.slice(0, r) + "[" + "a".repeat(e.length - r - 2) + "]";
|
|
878
877
|
}), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
@@ -1499,9 +1498,9 @@ var Ve = /* @__PURE__ */ new Set([
|
|
|
1499
1498
|
});
|
|
1500
1499
|
});
|
|
1501
1500
|
}), t.innerHTML;
|
|
1502
|
-
}, Ke = (
|
|
1501
|
+
}, Ke = (t) => {
|
|
1503
1502
|
let n = document.createElement("div");
|
|
1504
|
-
return n.innerHTML =
|
|
1505
|
-
}, qe = (
|
|
1503
|
+
return n.innerHTML = t, e(n), n.innerHTML;
|
|
1504
|
+
}, qe = (e) => Ke(Ge(t.sanitize($.parse(e, { async: !1 }), { ADD_ATTR: ["colwidth"] })));
|
|
1506
1505
|
//#endregion
|
|
1507
1506
|
export { $ as n, qe as t };
|