@clevertask/scribe 0.1.6 → 0.1.8
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 +6 -4
- package/dist/{BarMenu-CXaFlpRJ.js → BarMenu-BG_w4DVo.js} +53 -25
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.d.ts.map +1 -1
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.js +13 -13
- package/dist/components/Menu/LinkEditor.js +4 -4
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.js +11 -5
- package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.js +6 -2
- package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
- package/dist/components/Scribe/extension/extension-link.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +14 -6
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +948 -943
- package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
- package/dist/components/Scribe/extension/tableOfContents.js +2 -2
- package/dist/components/Scribe/index.d.ts +6 -0
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +213 -76
- package/dist/{dist-BQjH-i-q.js → dist-BMKyBtRa.js} +112 -105
- package/dist/{dist-Cp938P7P.js → dist-BgEySLwo.js} +283 -146
- package/dist/{dist-CnXCIcnl.js → dist-FrapLVQu.js} +16 -9
- package/dist/{extension-CZOsheCI.js → extension-BVGWENts.js} +1306 -1300
- package/dist/{extension-link-DZID_SYl.js → extension-link-CMRfHUc5.js} +5 -5
- package/dist/{floating-ui.dom-rih69525.js → floating-ui.dom-CmJ6iBdh.js} +4 -5
- package/dist/{html-to-markdown-CrNOkSye.js → html-to-markdown-Cta7-ssO.js} +3 -2
- package/dist/main.js +2 -2
- package/dist/{markdown-to-html-DEczPfuq.js → markdown-to-html-DwSNqq2i.js} +8 -6
- package/dist/{menus-CakIdDdY.js → menus-D9OsP28c.js} +8 -8
- package/dist/{purify.es-DF9CW1cl.js → purify.es-CFiLaBu1.js} +1 -1
- package/dist/{slashCommand-B7CRIaKG.js → slashCommand-B6Iz1i0d.js} +5 -8
- package/dist/{tables-CjOC70rm.js → tables-CXpUVKdw.js} +9 -7
- package/dist/{tippy.esm-D9LL2xiE.js → tippy.esm-DOXqN1Qm.js} +2 -7
- 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 +49 -34
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, m as h, n as g, o as _, p as ee, r as v, t as y, u as b, v as x, w as te, x as S, y as C } from "./dist-
|
|
1
|
+
import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, m as h, n as g, o as _, p as ee, r as v, t as y, u as b, v as x, w as te, x as S, y as C } from "./dist-FrapLVQu.js";
|
|
2
2
|
//#region node_modules/.pnpm/prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js
|
|
3
|
-
var ne = (e, t) => e.selection.empty
|
|
3
|
+
var ne = (e, t) => !e.selection.empty && (t && t(e.tr.deleteSelection().scrollIntoView()), !0);
|
|
4
4
|
function re(e, t) {
|
|
5
5
|
let { $cursor: n } = e.selection;
|
|
6
6
|
return !n || (t ? !t.endOfTextblock("backward", e) : n.parentOffset > 0) ? null : n;
|
|
@@ -11,7 +11,7 @@ var ie = (e, t, n) => {
|
|
|
11
11
|
let a = ue(i);
|
|
12
12
|
if (!a) {
|
|
13
13
|
let n = i.blockRange(), r = n && C(n);
|
|
14
|
-
return r
|
|
14
|
+
return r != null && (t && t(e.tr.lift(n, r).scrollIntoView()), !0);
|
|
15
15
|
}
|
|
16
16
|
let o = a.nodeBefore;
|
|
17
17
|
if (Oe(e, a, t, -1)) return !0;
|
|
@@ -145,7 +145,7 @@ var he = (e, t) => {
|
|
|
145
145
|
return t && t(e.tr.join(r).scrollIntoView()), !0;
|
|
146
146
|
}, _e = (e, t) => {
|
|
147
147
|
let { $from: n, $to: r } = e.selection, i = n.blockRange(r), a = i && C(i);
|
|
148
|
-
return a
|
|
148
|
+
return a != null && (t && t(e.tr.lift(i, a).scrollIntoView()), !0);
|
|
149
149
|
}, ve = (e, t) => {
|
|
150
150
|
let { $head: n, $anchor: r } = e.selection;
|
|
151
151
|
return !n.parent.type.spec.code || !n.sameParent(r) ? !1 : (t && t(e.tr.insertText("\n").scrollIntoView()), !0);
|
|
@@ -185,7 +185,7 @@ var be = (e, t) => {
|
|
|
185
185
|
if (p(e.doc, r)) return t && t(e.tr.split(r).scrollIntoView()), !0;
|
|
186
186
|
}
|
|
187
187
|
let r = n.blockRange(), i = r && C(r);
|
|
188
|
-
return i
|
|
188
|
+
return i != null && (t && t(e.tr.lift(r, i).scrollIntoView()), !0);
|
|
189
189
|
};
|
|
190
190
|
function Ce(e) {
|
|
191
191
|
return (t, n) => {
|
|
@@ -215,7 +215,7 @@ function Ce(e) {
|
|
|
215
215
|
}
|
|
216
216
|
var we = Ce(), Te = (e, t) => {
|
|
217
217
|
let { $from: n, to: r } = e.selection, i, a = n.sharedDepth(r);
|
|
218
|
-
return a
|
|
218
|
+
return a != 0 && (i = n.before(a), t && t(e.tr.setSelection(v.create(e.doc, i))), !0);
|
|
219
219
|
}, Ee = (e, t) => (t && t(e.tr.setSelection(new y(e.doc))), !0);
|
|
220
220
|
function De(e, t, n) {
|
|
221
221
|
let r = t.nodeBefore, i = t.nodeAfter, a = t.index();
|
|
@@ -979,7 +979,8 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
|
|
|
979
979
|
node: this.contentDOM,
|
|
980
980
|
offset: e ? w(e.dom) + 1 : 0
|
|
981
981
|
};
|
|
982
|
-
}
|
|
982
|
+
}
|
|
983
|
+
{
|
|
983
984
|
let e, r = !0;
|
|
984
985
|
for (; e = n < this.children.length ? this.children[n] : null, !(!e || e.dom.parentNode == this.contentDOM); n++, r = !1);
|
|
985
986
|
return e && r && !e.border && !e.domAtom ? e.domFromPos(0, t) : {
|
|
@@ -1108,7 +1109,8 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
|
|
|
1108
1109
|
if (e >= r && t <= o) {
|
|
1109
1110
|
this.dirty = e == n || t == a ? qt : Kt, e == r && t == o && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = z : i.markDirty(e - r, t - r);
|
|
1110
1111
|
return;
|
|
1111
|
-
}
|
|
1112
|
+
}
|
|
1113
|
+
i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? qt : z;
|
|
1112
1114
|
}
|
|
1113
1115
|
n = a;
|
|
1114
1116
|
}
|
|
@@ -1303,7 +1305,8 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
|
|
|
1303
1305
|
pos: a,
|
|
1304
1306
|
text: e
|
|
1305
1307
|
};
|
|
1306
|
-
}
|
|
1308
|
+
}
|
|
1309
|
+
return {
|
|
1307
1310
|
node: i,
|
|
1308
1311
|
pos: -1,
|
|
1309
1312
|
text: ""
|
|
@@ -1315,7 +1318,7 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
|
|
|
1315
1318
|
for (; i.parentNode != this.contentDOM; i = i.parentNode) {
|
|
1316
1319
|
for (; i.previousSibling;) i.parentNode.removeChild(i.previousSibling);
|
|
1317
1320
|
for (; i.nextSibling;) i.parentNode.removeChild(i.nextSibling);
|
|
1318
|
-
i.pmViewDesc
|
|
1321
|
+
i.pmViewDesc && (i.pmViewDesc = void 0);
|
|
1319
1322
|
}
|
|
1320
1323
|
let a = new Xt(this, i, t, r);
|
|
1321
1324
|
e.input.compositionNodes.push(a), this.children = yn(this.children, n, n + r.length, e, a);
|
|
@@ -1410,8 +1413,8 @@ var en = class e extends Qt {
|
|
|
1410
1413
|
if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
|
|
1411
1414
|
let i = this.spec.update(e, t, n);
|
|
1412
1415
|
return i && this.updateInner(e, t, n, r), i;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1416
|
+
}
|
|
1417
|
+
return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, t, n, r);
|
|
1415
1418
|
}
|
|
1416
1419
|
selectNode() {
|
|
1417
1420
|
this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
|
|
@@ -1858,11 +1861,13 @@ function Fn(e, t, n) {
|
|
|
1858
1861
|
if (!i || i.isText || !i.isLeaf) return !1;
|
|
1859
1862
|
let a = e.state.doc.resolve(n.pos + i.nodeSize * (t < 0 ? -1 : 1));
|
|
1860
1863
|
return V(e, new l(r.$anchor, a));
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1864
|
+
}
|
|
1865
|
+
if (!r.empty) return !1;
|
|
1866
|
+
if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
|
|
1863
1867
|
let n = Pn(e.state, t);
|
|
1864
1868
|
return n && n instanceof v ? V(e, n) : !1;
|
|
1865
|
-
}
|
|
1869
|
+
}
|
|
1870
|
+
if (!(P && n.indexOf("m") > -1)) {
|
|
1866
1871
|
let n = r.$head, i = n.textOffset ? null : t < 0 ? n.nodeBefore : n.nodeAfter, a;
|
|
1867
1872
|
if (!i || i.isText) return !1;
|
|
1868
1873
|
let o = t < 0 ? n.pos - i.nodeSize : n.pos;
|
|
@@ -2034,13 +2039,12 @@ function Zn(e, t) {
|
|
|
2034
2039
|
if (n == 37 || P && n == 66 && r == "c") {
|
|
2035
2040
|
let t = n == 37 ? Gn(e, e.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
2036
2041
|
return Fn(e, t, r) || Rn(e, t);
|
|
2037
|
-
}
|
|
2042
|
+
}
|
|
2043
|
+
if (n == 39 || P && n == 70 && r == "c") {
|
|
2038
2044
|
let t = n == 39 ? Gn(e, e.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
2039
2045
|
return Fn(e, t, r) || Rn(e, t);
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
else if (r == (P ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90)) return !0;
|
|
2043
|
-
return !1;
|
|
2046
|
+
}
|
|
2047
|
+
return n == 38 || P && n == 80 && r == "c" ? Kn(e, -1, r) || Rn(e, -1) : n == 40 || P && n == 78 && r == "c" ? Yn(e) || Kn(e, 1, r) || Rn(e, 1) : !(r != (P ? "m" : "c") || n != 66 && n != 73 && n != 89 && n != 90);
|
|
2044
2048
|
}
|
|
2045
2049
|
function Qn(e, t) {
|
|
2046
2050
|
e.someProp("transformCopied", (n) => {
|
|
@@ -2336,7 +2340,7 @@ function Dr(e, t) {
|
|
|
2336
2340
|
break;
|
|
2337
2341
|
}
|
|
2338
2342
|
}
|
|
2339
|
-
return i
|
|
2343
|
+
return i != null && (Tr(e, v.create(e.state.doc, i), "pointer"), !0);
|
|
2340
2344
|
}
|
|
2341
2345
|
function Or(e, t, n, r, i) {
|
|
2342
2346
|
return wr(e, "handleClickOn", t, n, r) || e.someProp("handleClick", (n) => n(e, t, r)) || (i ? Dr(e, n) : Er(e, n));
|
|
@@ -2476,7 +2480,8 @@ U.compositionstart = U.compositionupdate = (e) => {
|
|
|
2476
2480
|
let n = e.domSelection();
|
|
2477
2481
|
n && n.collapse(t, t.nodeValue.length);
|
|
2478
2482
|
break;
|
|
2479
|
-
}
|
|
2483
|
+
}
|
|
2484
|
+
n = t, r = -1;
|
|
2480
2485
|
}
|
|
2481
2486
|
}
|
|
2482
2487
|
e.input.composing = !0;
|
|
@@ -3002,10 +3007,9 @@ function gi(e) {
|
|
|
3002
3007
|
if (a.from == r.from) {
|
|
3003
3008
|
a.to != r.to && (t == e && (t = e.slice()), t[i] = a.copy(a.from, r.to), _i(t, i + 1, a.copy(r.to, a.to)));
|
|
3004
3009
|
continue;
|
|
3005
|
-
} else {
|
|
3006
|
-
a.from < r.to && (t == e && (t = e.slice()), t[n] = r.copy(r.from, a.from), _i(t, i, r.copy(a.from, r.to)));
|
|
3007
|
-
break;
|
|
3008
3010
|
}
|
|
3011
|
+
a.from < r.to && (t == e && (t = e.slice()), t[n] = r.copy(r.from, a.from), _i(t, i, r.copy(a.from, r.to)));
|
|
3012
|
+
break;
|
|
3009
3013
|
}
|
|
3010
3014
|
}
|
|
3011
3015
|
return t;
|
|
@@ -3176,15 +3180,15 @@ var yi = {
|
|
|
3176
3180
|
from: o,
|
|
3177
3181
|
to: n.localPosFromDOM(e.target, s, 1)
|
|
3178
3182
|
};
|
|
3179
|
-
}
|
|
3183
|
+
}
|
|
3184
|
+
return e.type == "attributes" ? {
|
|
3180
3185
|
from: n.posAtStart - n.border,
|
|
3181
3186
|
to: n.posAtEnd + n.border
|
|
3182
|
-
}
|
|
3183
|
-
else return this.lastChangedTextNode = e.target, {
|
|
3187
|
+
} : (this.lastChangedTextNode = e.target, {
|
|
3184
3188
|
from: n.posAtStart,
|
|
3185
3189
|
to: n.posAtEnd,
|
|
3186
3190
|
typeOver: e.target.nodeValue == e.oldValue
|
|
3187
|
-
};
|
|
3191
|
+
});
|
|
3188
3192
|
}
|
|
3189
3193
|
}, Ci = /* @__PURE__ */ new WeakMap(), wi = !1;
|
|
3190
3194
|
function Ti(e) {
|
|
@@ -3293,7 +3297,8 @@ var ji = (e) => (t) => {
|
|
|
3293
3297
|
if (N && /^(ul|ol)$/i.test(t.parentNode.nodeName)) {
|
|
3294
3298
|
let e = document.createElement("div");
|
|
3295
3299
|
return e.appendChild(document.createElement("li")), { skip: e };
|
|
3296
|
-
}
|
|
3300
|
+
}
|
|
3301
|
+
if (t.parentNode.lastChild == t || N && /^(tr|table)$/i.test(t.parentNode.nodeName)) return { ignore: !0 };
|
|
3297
3302
|
} else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder")) return { ignore: !0 };
|
|
3298
3303
|
return null;
|
|
3299
3304
|
}, Mi = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
@@ -3790,7 +3795,7 @@ function aa(e) {
|
|
|
3790
3795
|
};
|
|
3791
3796
|
}
|
|
3792
3797
|
//#endregion
|
|
3793
|
-
//#region node_modules/.pnpm/@tiptap+core@3.29.
|
|
3798
|
+
//#region node_modules/.pnpm/@tiptap+core@3.29.2_@tiptap+pm@3.29.2/node_modules/@tiptap/core/dist/index.js
|
|
3794
3799
|
var oa = Object.defineProperty, sa = (e, t) => {
|
|
3795
3800
|
for (var n in t) oa(e, n, {
|
|
3796
3801
|
get: t[n],
|
|
@@ -4282,14 +4287,14 @@ var Ja = (e = {}) => ({ tr: t, dispatch: n, editor: r }) => {
|
|
|
4282
4287
|
}, Ya = () => ({ state: e, dispatch: t }) => he(e, t), Xa = () => ({ state: e, dispatch: t }) => ge(e, t), Za = () => ({ state: e, dispatch: t }) => ie(e, t), Qa = () => ({ state: e, dispatch: t }) => fe(e, t), $a = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
4283
4288
|
try {
|
|
4284
4289
|
let r = x(e.doc, e.selection.$from.pos, -1);
|
|
4285
|
-
return r
|
|
4290
|
+
return r != null && (n.join(r, 2), t && t(n), !0);
|
|
4286
4291
|
} catch {
|
|
4287
4292
|
return !1;
|
|
4288
4293
|
}
|
|
4289
4294
|
}, eo = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
4290
4295
|
try {
|
|
4291
4296
|
let r = x(e.doc, e.selection.$from.pos, 1);
|
|
4292
|
-
return r
|
|
4297
|
+
return r != null && (n.join(r, 2), t && t(n), !0);
|
|
4293
4298
|
} catch {
|
|
4294
4299
|
return !1;
|
|
4295
4300
|
}
|
|
@@ -4616,74 +4621,74 @@ function Ho(e) {
|
|
|
4616
4621
|
return !e?.attribute?.isRequired && "default" in (e?.attribute || {}) && (t.default = e.attribute.default), e?.attribute?.validate !== void 0 && (t.validate = e.attribute.validate), [e.name, t];
|
|
4617
4622
|
}
|
|
4618
4623
|
function Uo(e, n) {
|
|
4619
|
-
let r = Po(e), { nodeExtensions: i, markExtensions: a } = No(e)
|
|
4624
|
+
let r = Po(e), { nodeExtensions: i, markExtensions: a } = No(e), o = i.find((e) => Z(e, "topNode"))?.name, s = Object.fromEntries(i.map((t) => {
|
|
4625
|
+
let i = r.filter((e) => e.type === t.name), a = {
|
|
4626
|
+
name: t.name,
|
|
4627
|
+
options: t.options,
|
|
4628
|
+
storage: t.storage,
|
|
4629
|
+
editor: n
|
|
4630
|
+
}, o = Vo({
|
|
4631
|
+
...e.reduce((e, n) => {
|
|
4632
|
+
let r = Z(n, "extendNodeSchema", a);
|
|
4633
|
+
return {
|
|
4634
|
+
...e,
|
|
4635
|
+
...r ? r(t) : {}
|
|
4636
|
+
};
|
|
4637
|
+
}, {}),
|
|
4638
|
+
content: Q(Z(t, "content", a)),
|
|
4639
|
+
marks: Q(Z(t, "marks", a)),
|
|
4640
|
+
group: Q(Z(t, "group", a)),
|
|
4641
|
+
inline: Q(Z(t, "inline", a)),
|
|
4642
|
+
atom: Q(Z(t, "atom", a)),
|
|
4643
|
+
selectable: Q(Z(t, "selectable", a)),
|
|
4644
|
+
draggable: Q(Z(t, "draggable", a)),
|
|
4645
|
+
code: Q(Z(t, "code", a)),
|
|
4646
|
+
whitespace: Q(Z(t, "whitespace", a)),
|
|
4647
|
+
linebreakReplacement: Q(Z(t, "linebreakReplacement", a)),
|
|
4648
|
+
defining: Q(Z(t, "defining", a)),
|
|
4649
|
+
isolating: Q(Z(t, "isolating", a)),
|
|
4650
|
+
attrs: Object.fromEntries(i.map(Ho))
|
|
4651
|
+
}), s = Q(Z(t, "parseHTML", a));
|
|
4652
|
+
s && (o.parseDOM = s.map((e) => Bo(e, i)));
|
|
4653
|
+
let c = Z(t, "renderHTML", a);
|
|
4654
|
+
c && (o.toDOM = (e) => c({
|
|
4655
|
+
node: e,
|
|
4656
|
+
HTMLAttributes: Ro(e, i)
|
|
4657
|
+
}));
|
|
4658
|
+
let l = Z(t, "renderText", a);
|
|
4659
|
+
return l && (o.toText = l), [t.name, o];
|
|
4660
|
+
})), c = Object.fromEntries(a.map((t) => {
|
|
4661
|
+
let i = r.filter((e) => e.type === t.name), a = {
|
|
4662
|
+
name: t.name,
|
|
4663
|
+
options: t.options,
|
|
4664
|
+
storage: t.storage,
|
|
4665
|
+
editor: n
|
|
4666
|
+
}, o = Vo({
|
|
4667
|
+
...e.reduce((e, n) => {
|
|
4668
|
+
let r = Z(n, "extendMarkSchema", a);
|
|
4669
|
+
return {
|
|
4670
|
+
...e,
|
|
4671
|
+
...r ? r(t) : {}
|
|
4672
|
+
};
|
|
4673
|
+
}, {}),
|
|
4674
|
+
inclusive: Q(Z(t, "inclusive", a)),
|
|
4675
|
+
excludes: Q(Z(t, "excludes", a)),
|
|
4676
|
+
group: Q(Z(t, "group", a)),
|
|
4677
|
+
spanning: Q(Z(t, "spanning", a)),
|
|
4678
|
+
code: Q(Z(t, "code", a)),
|
|
4679
|
+
attrs: Object.fromEntries(i.map(Ho))
|
|
4680
|
+
}), s = Q(Z(t, "parseHTML", a));
|
|
4681
|
+
s && (o.parseDOM = s.map((e) => Bo(e, i)));
|
|
4682
|
+
let c = Z(t, "renderHTML", a);
|
|
4683
|
+
return c && (o.toDOM = (e) => c({
|
|
4684
|
+
mark: e,
|
|
4685
|
+
HTMLAttributes: Ro(e, i)
|
|
4686
|
+
})), [t.name, o];
|
|
4687
|
+
}));
|
|
4620
4688
|
return new t({
|
|
4621
|
-
topNode:
|
|
4622
|
-
nodes:
|
|
4623
|
-
|
|
4624
|
-
name: t.name,
|
|
4625
|
-
options: t.options,
|
|
4626
|
-
storage: t.storage,
|
|
4627
|
-
editor: n
|
|
4628
|
-
}, o = Vo({
|
|
4629
|
-
...e.reduce((e, n) => {
|
|
4630
|
-
let r = Z(n, "extendNodeSchema", a);
|
|
4631
|
-
return {
|
|
4632
|
-
...e,
|
|
4633
|
-
...r ? r(t) : {}
|
|
4634
|
-
};
|
|
4635
|
-
}, {}),
|
|
4636
|
-
content: Q(Z(t, "content", a)),
|
|
4637
|
-
marks: Q(Z(t, "marks", a)),
|
|
4638
|
-
group: Q(Z(t, "group", a)),
|
|
4639
|
-
inline: Q(Z(t, "inline", a)),
|
|
4640
|
-
atom: Q(Z(t, "atom", a)),
|
|
4641
|
-
selectable: Q(Z(t, "selectable", a)),
|
|
4642
|
-
draggable: Q(Z(t, "draggable", a)),
|
|
4643
|
-
code: Q(Z(t, "code", a)),
|
|
4644
|
-
whitespace: Q(Z(t, "whitespace", a)),
|
|
4645
|
-
linebreakReplacement: Q(Z(t, "linebreakReplacement", a)),
|
|
4646
|
-
defining: Q(Z(t, "defining", a)),
|
|
4647
|
-
isolating: Q(Z(t, "isolating", a)),
|
|
4648
|
-
attrs: Object.fromEntries(i.map(Ho))
|
|
4649
|
-
}), s = Q(Z(t, "parseHTML", a));
|
|
4650
|
-
s && (o.parseDOM = s.map((e) => Bo(e, i)));
|
|
4651
|
-
let c = Z(t, "renderHTML", a);
|
|
4652
|
-
c && (o.toDOM = (e) => c({
|
|
4653
|
-
node: e,
|
|
4654
|
-
HTMLAttributes: Ro(e, i)
|
|
4655
|
-
}));
|
|
4656
|
-
let l = Z(t, "renderText", a);
|
|
4657
|
-
return l && (o.toText = l), [t.name, o];
|
|
4658
|
-
})),
|
|
4659
|
-
marks: Object.fromEntries(a.map((t) => {
|
|
4660
|
-
let i = r.filter((e) => e.type === t.name), a = {
|
|
4661
|
-
name: t.name,
|
|
4662
|
-
options: t.options,
|
|
4663
|
-
storage: t.storage,
|
|
4664
|
-
editor: n
|
|
4665
|
-
}, o = Vo({
|
|
4666
|
-
...e.reduce((e, n) => {
|
|
4667
|
-
let r = Z(n, "extendMarkSchema", a);
|
|
4668
|
-
return {
|
|
4669
|
-
...e,
|
|
4670
|
-
...r ? r(t) : {}
|
|
4671
|
-
};
|
|
4672
|
-
}, {}),
|
|
4673
|
-
inclusive: Q(Z(t, "inclusive", a)),
|
|
4674
|
-
excludes: Q(Z(t, "excludes", a)),
|
|
4675
|
-
group: Q(Z(t, "group", a)),
|
|
4676
|
-
spanning: Q(Z(t, "spanning", a)),
|
|
4677
|
-
code: Q(Z(t, "code", a)),
|
|
4678
|
-
attrs: Object.fromEntries(i.map(Ho))
|
|
4679
|
-
}), s = Q(Z(t, "parseHTML", a));
|
|
4680
|
-
s && (o.parseDOM = s.map((e) => Bo(e, i)));
|
|
4681
|
-
let c = Z(t, "renderHTML", a);
|
|
4682
|
-
return c && (o.toDOM = (e) => c({
|
|
4683
|
-
mark: e,
|
|
4684
|
-
HTMLAttributes: Ro(e, i)
|
|
4685
|
-
})), [t.name, o];
|
|
4686
|
-
}))
|
|
4689
|
+
topNode: o,
|
|
4690
|
+
nodes: s,
|
|
4691
|
+
marks: c
|
|
4687
4692
|
});
|
|
4688
4693
|
}
|
|
4689
4694
|
function Wo(e) {
|
|
@@ -5320,7 +5325,7 @@ function nc(e) {
|
|
|
5320
5325
|
if (!e || Object.keys(e).length === 0) return "";
|
|
5321
5326
|
let t = [];
|
|
5322
5327
|
return e.class && String(e.class).split(/\s+/).filter(Boolean).forEach((e) => t.push(`.${e}`)), e.id && t.push(`#${e.id}`), Object.entries(e).forEach(([e, n]) => {
|
|
5323
|
-
e
|
|
5328
|
+
e !== "class" && e !== "id" && (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
|
|
5324
5329
|
}), t.join(" ");
|
|
5325
5330
|
}
|
|
5326
5331
|
function rc(e) {
|
|
@@ -5518,7 +5523,8 @@ function cc(e, t, n) {
|
|
|
5518
5523
|
o += 1, a = `${a}${e}
|
|
5519
5524
|
`;
|
|
5520
5525
|
continue;
|
|
5521
|
-
}
|
|
5526
|
+
}
|
|
5527
|
+
return;
|
|
5522
5528
|
}
|
|
5523
5529
|
let l = t.extractItemData(c), { indentLevel: u, mainContent: d } = l;
|
|
5524
5530
|
a = `${a}${e}
|
|
@@ -5533,7 +5539,8 @@ function cc(e, t, n) {
|
|
|
5533
5539
|
f.push(e), a = `${a}${e}
|
|
5534
5540
|
`, o += 1;
|
|
5535
5541
|
continue;
|
|
5536
|
-
}
|
|
5542
|
+
}
|
|
5543
|
+
break;
|
|
5537
5544
|
}
|
|
5538
5545
|
if ((e.match(/^(\s*)/)?.[1]?.length || 0) > u) f.push(e), a = `${a}${e}
|
|
5539
5546
|
`, o += 1;
|
|
@@ -6278,7 +6285,7 @@ var $ = class e extends gc {
|
|
|
6278
6285
|
let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
|
|
6279
6286
|
if (!r || i) return;
|
|
6280
6287
|
let { empty: a, from: o, to: s } = t.selection, c = _.atStart(t.doc).from, l = _.atEnd(t.doc).to;
|
|
6281
|
-
if (a ||
|
|
6288
|
+
if (a || o !== c || s !== l || !ps(n.doc)) return;
|
|
6282
6289
|
let u = n.tr, d = ca({
|
|
6283
6290
|
state: n,
|
|
6284
6291
|
transaction: u
|
|
@@ -6906,7 +6913,7 @@ var Wc = (e) => "touches" in e, Gc = class {
|
|
|
6906
6913
|
e !== this.lastEditableState && (this.lastEditableState = e, e ? e && this.handleMap.size === 0 && this.attachHandles() : this.removeHandles());
|
|
6907
6914
|
}
|
|
6908
6915
|
update(e, t, n) {
|
|
6909
|
-
return e.type === this.node.type
|
|
6916
|
+
return e.type === this.node.type && (this.node = e, !this.onUpdate || this.onUpdate(e, t, n));
|
|
6910
6917
|
}
|
|
6911
6918
|
destroy() {
|
|
6912
6919
|
this.isResizing && (this.container.dataset.resizeState = "false", this.classNames.resizing && this.container.classList.remove(this.classNames.resizing), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("keyup", this.handleKeyUp), this.isResizing = !1, this.activeHandle = null), this.editor.off("update", this.handleEditorUpdate.bind(this)), this.container.remove();
|