@templatical/editor 0.8.4 → 0.8.5
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/dist/{AiChatSidebar-CnRXeK77.js → AiChatSidebar-uhkhnXQd.js} +1 -1
- package/dist/{AiFeatureMenu-BYDDrpj6.js → AiFeatureMenu-DXNKvXP5.js} +1 -1
- package/dist/{CloudEditor-B9a_K6Cm.js → CloudEditor-BSkPQjwo.js} +6 -6
- package/dist/{CollaboratorBar-HN4whzM-.js → CollaboratorBar-CP76Sh6c.js} +1 -1
- package/dist/{DesignReferenceSidebar-0GwjUn2V.js → DesignReferenceSidebar-CfJqJ7l6.js} +1 -1
- package/dist/{ModuleBrowserModal-DPZBsvqk.js → ModuleBrowserModal-BFQTm6uY.js} +4 -4
- package/dist/{ModulePreviewCanvas-CK4j11-e.js → ModulePreviewCanvas-DeqMpo73.js} +1 -1
- package/dist/{ParagraphEditor-DBus_iHH.js → ParagraphEditor-DqomSbW3.js} +13 -13
- package/dist/{SaveModuleDialog-DORRSbBo.js → SaveModuleDialog-DKcpPeWd.js} +2 -2
- package/dist/{SnapshotHistory-DTMVEk03.js → SnapshotHistory-Z9RQj53S.js} +1 -1
- package/dist/{TestEmailModal-DJmYp0Qi.js → TestEmailModal-C8DhylO1.js} +2 -2
- package/dist/{TitleEditor-70d9AF1V.js → TitleEditor-CgLrn6R3.js} +5 -5
- package/dist/{TplModal-BEfwlvPC.js → TplModal-CbwRwmR3.js} +1 -1
- package/dist/{blockTypeIcons-2DRoPa3K.js → blockTypeIcons-CccKujXP.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js → AiFeatureMenu-ChNv7XXj.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js.map → AiFeatureMenu-ChNv7XXj.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js → BlockIssueBadge-BovmWgok.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js.map → BlockIssueBadge-BovmWgok.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js → CloudEditor-CHF_P5OL.js} +7 -7
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js.map → CloudEditor-CHF_P5OL.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js → CollaboratorBar-Bjr5YSh0.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js.map → CollaboratorBar-Bjr5YSh0.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js → CountdownBlock-KyzvhjMF.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js.map → CountdownBlock-KyzvhjMF.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js → CountdownToolbar-bJtMHGYz.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js.map → CountdownToolbar-bJtMHGYz.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js → IssuesPanel-DFSYTQXy.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js.map → IssuesPanel-DFSYTQXy.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js → ModuleBrowserModal-DS0BGRhZ.js} +5 -5
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js.map → ModuleBrowserModal-DS0BGRhZ.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js → ModulePreviewCanvas-Dwn2cA5a.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js.map → ModulePreviewCanvas-Dwn2cA5a.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js → NumberWithSuffix-BNBeHv0P.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js.map → NumberWithSuffix-BNBeHv0P.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js → ParagraphEditor-C4TrTIOm.js} +16 -16
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js.map → ParagraphEditor-C4TrTIOm.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js → RichTextEditorContent-HNFFL4aK.js} +2 -2
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js.map → RichTextEditorContent-HNFFL4aK.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js → SaveModuleDialog-CbHqqeID.js} +2 -2
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js.map → SaveModuleDialog-CbHqqeID.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DZcx2N4R.js → TitleEditor-gr-eBUq_.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-DZcx2N4R.js.map → TitleEditor-gr-eBUq_.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js → blockTypeIcons-BUlgu9JL.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js.map → blockTypeIcons-BUlgu9JL.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js → extensions-DK_lVs7A.js} +3 -3
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js.map → extensions-DK_lVs7A.js.map} +1 -1
- package/dist/cdn/chunks/{features-CUYy5kZQ.js → features-LiilsBqW.js} +806 -773
- package/dist/cdn/chunks/features-LiilsBqW.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4zY5-I3.js → icons-Bn2SIR30.js} +2 -2
- package/dist/cdn/chunks/{icons-C4zY5-I3.js.map → icons-Bn2SIR30.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BNt3msId.js → media-library-Bb2PavAd.js} +3 -3
- package/dist/cdn/chunks/{media-library-BNt3msId.js.map → media-library-Bb2PavAd.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BTPRPGB-.js → quality-Bpj6kNxR.js} +180 -154
- package/dist/cdn/chunks/{quality-BTPRPGB-.js.map → quality-Bpj6kNxR.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js → renderer-CYYyu-Di.js} +130 -96
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js.map → renderer-CYYyu-Di.js.map} +1 -1
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js → src-CQjZnxvw.js} +4 -4
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js.map → src-CQjZnxvw.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DtgjgsBH.js → styles-5g8XOS68.js} +8 -8
- package/dist/cdn/chunks/{styles-DtgjgsBH.js.map → styles-5g8XOS68.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-BErAJEvo.js → tiptap-BBbH3IT9.js} +849 -725
- package/dist/cdn/chunks/tiptap-BBbH3IT9.js.map +1 -0
- package/dist/cdn/editor.js +5 -5
- package/dist/{cloud-Dz8Ay2FM.js → cloud-VxYMtfXC.js} +1 -1
- package/dist/{dist-BygsE-n3.js → dist-BDgf2G-V.js} +453 -314
- package/dist/{dist-BtDBsF3N.js → dist-BxP6TB0l.js} +2 -2
- package/dist/{dist-DWhP3Dp2.js → dist-BzuC8o3y.js} +1209 -1217
- package/dist/{dist-v-O2Subd.js → dist-C0jo8wtG.js} +2 -2
- package/dist/{dist-BTgujVMy.js → dist-C8wMh_gi.js} +2 -2
- package/dist/{dist-Cipw2HFH.js → dist-CIV3Brg-.js} +37 -4
- package/dist/{dist-BS5Oi67L.js → dist-CUpJmrjt.js} +2 -2
- package/dist/dist-D5lmdi1F.js +5 -0
- package/dist/{dist-T-ORzNfM.js → dist-D8C6jIXM.js} +168 -175
- package/dist/dist-DILjuzSv.js +5 -0
- package/dist/{dist-CDtcJMB2.js → dist-DXaxGLsw.js} +33 -33
- package/dist/{dist-DnGTaPRX.js → dist-DYO-w_Jf.js} +2 -2
- package/dist/{dist-CDZCyoRy.js → dist-UK-lbEBc.js} +2 -2
- package/dist/{extensions-BmGiz8Oo.js → extensions-DeNHyWwh.js} +27 -27
- package/dist/{styles-DFeOGKa_.js → styles-Bgqv7rLA.js} +4 -4
- package/dist/templatical-editor.js +3 -3
- package/dist/{useEditorCore-BXz-UXPd.js → useEditorCore-CaOVDL_m.js} +4 -4
- package/dist/{useMergeTag-CS2bmWA0.js → useMergeTag-RWsgUcSh.js} +1 -1
- package/package.json +21 -21
- package/dist/cdn/chunks/features-CUYy5kZQ.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BErAJEvo.js.map +0 -1
- package/dist/dist-BySzGkeC.js +0 -5
- package/dist/dist-D7JUZ2Kd.js +0 -5
|
@@ -7233,7 +7233,7 @@ function mc(e) {
|
|
|
7233
7233
|
};
|
|
7234
7234
|
}
|
|
7235
7235
|
//#endregion
|
|
7236
|
-
//#region ../../node_modules/.pnpm/@tiptap+core@3.23.
|
|
7236
|
+
//#region ../../node_modules/.pnpm/@tiptap+core@3.23.6_@tiptap+pm@3.23.6/node_modules/@tiptap/core/dist/index.js
|
|
7237
7237
|
var hc = Object.defineProperty, gc = (e, t) => {
|
|
7238
7238
|
for (var n in t) hc(e, n, {
|
|
7239
7239
|
get: t[n],
|
|
@@ -7336,57 +7336,57 @@ gc(yc, {
|
|
|
7336
7336
|
deleteCurrentNode: () => Ec,
|
|
7337
7337
|
deleteNode: () => Dc,
|
|
7338
7338
|
deleteRange: () => Oc,
|
|
7339
|
-
deleteSelection: () =>
|
|
7340
|
-
enter: () =>
|
|
7341
|
-
exitCode: () =>
|
|
7342
|
-
extendMarkRange: () =>
|
|
7343
|
-
first: () =>
|
|
7344
|
-
focus: () =>
|
|
7345
|
-
forEach: () =>
|
|
7346
|
-
insertContent: () =>
|
|
7347
|
-
insertContentAt: () =>
|
|
7348
|
-
joinBackward: () =>
|
|
7349
|
-
joinDown: () =>
|
|
7350
|
-
joinForward: () =>
|
|
7351
|
-
joinItemBackward: () =>
|
|
7352
|
-
joinItemForward: () =>
|
|
7353
|
-
joinTextblockBackward: () =>
|
|
7354
|
-
joinTextblockForward: () =>
|
|
7355
|
-
joinUp: () =>
|
|
7356
|
-
keyboardShortcut: () =>
|
|
7357
|
-
lift: () =>
|
|
7358
|
-
liftEmptyBlock: () =>
|
|
7359
|
-
liftListItem: () =>
|
|
7360
|
-
newlineInCode: () =>
|
|
7361
|
-
resetAttributes: () =>
|
|
7362
|
-
scrollIntoView: () =>
|
|
7363
|
-
selectAll: () =>
|
|
7364
|
-
selectNodeBackward: () =>
|
|
7365
|
-
selectNodeForward: () =>
|
|
7366
|
-
selectParentNode: () =>
|
|
7367
|
-
selectTextblockEnd: () =>
|
|
7368
|
-
selectTextblockStart: () =>
|
|
7369
|
-
setContent: () =>
|
|
7370
|
-
setMark: () =>
|
|
7371
|
-
setMeta: () =>
|
|
7372
|
-
setNode: () =>
|
|
7373
|
-
setNodeSelection: () =>
|
|
7374
|
-
setTextDirection: () =>
|
|
7375
|
-
setTextSelection: () =>
|
|
7376
|
-
sinkListItem: () =>
|
|
7377
|
-
splitBlock: () =>
|
|
7378
|
-
splitListItem: () =>
|
|
7379
|
-
toggleList: () =>
|
|
7380
|
-
toggleMark: () =>
|
|
7381
|
-
toggleNode: () =>
|
|
7382
|
-
toggleWrap: () =>
|
|
7383
|
-
undoInputRule: () =>
|
|
7384
|
-
unsetAllMarks: () =>
|
|
7385
|
-
unsetMark: () =>
|
|
7386
|
-
unsetTextDirection: () =>
|
|
7387
|
-
updateAttributes: () =>
|
|
7388
|
-
wrapIn: () =>
|
|
7389
|
-
wrapInList: () =>
|
|
7339
|
+
deleteSelection: () => Mc,
|
|
7340
|
+
enter: () => Nc,
|
|
7341
|
+
exitCode: () => Pc,
|
|
7342
|
+
extendMarkRange: () => Vc,
|
|
7343
|
+
first: () => Hc,
|
|
7344
|
+
focus: () => Yc,
|
|
7345
|
+
forEach: () => Xc,
|
|
7346
|
+
insertContent: () => Zc,
|
|
7347
|
+
insertContentAt: () => rl,
|
|
7348
|
+
joinBackward: () => ol,
|
|
7349
|
+
joinDown: () => al,
|
|
7350
|
+
joinForward: () => sl,
|
|
7351
|
+
joinItemBackward: () => cl,
|
|
7352
|
+
joinItemForward: () => ll,
|
|
7353
|
+
joinTextblockBackward: () => ul,
|
|
7354
|
+
joinTextblockForward: () => dl,
|
|
7355
|
+
joinUp: () => il,
|
|
7356
|
+
keyboardShortcut: () => ml,
|
|
7357
|
+
lift: () => gl,
|
|
7358
|
+
liftEmptyBlock: () => _l,
|
|
7359
|
+
liftListItem: () => vl,
|
|
7360
|
+
newlineInCode: () => yl,
|
|
7361
|
+
resetAttributes: () => Sl,
|
|
7362
|
+
scrollIntoView: () => Cl,
|
|
7363
|
+
selectAll: () => wl,
|
|
7364
|
+
selectNodeBackward: () => Tl,
|
|
7365
|
+
selectNodeForward: () => El,
|
|
7366
|
+
selectParentNode: () => Dl,
|
|
7367
|
+
selectTextblockEnd: () => Ol,
|
|
7368
|
+
selectTextblockStart: () => kl,
|
|
7369
|
+
setContent: () => jl,
|
|
7370
|
+
setMark: () => Iu,
|
|
7371
|
+
setMeta: () => Lu,
|
|
7372
|
+
setNode: () => Ru,
|
|
7373
|
+
setNodeSelection: () => zu,
|
|
7374
|
+
setTextDirection: () => Bu,
|
|
7375
|
+
setTextSelection: () => Vu,
|
|
7376
|
+
sinkListItem: () => Hu,
|
|
7377
|
+
splitBlock: () => Wu,
|
|
7378
|
+
splitListItem: () => Gu,
|
|
7379
|
+
toggleList: () => Yu,
|
|
7380
|
+
toggleMark: () => Xu,
|
|
7381
|
+
toggleNode: () => Zu,
|
|
7382
|
+
toggleWrap: () => Qu,
|
|
7383
|
+
undoInputRule: () => $u,
|
|
7384
|
+
unsetAllMarks: () => ed,
|
|
7385
|
+
unsetMark: () => td,
|
|
7386
|
+
unsetTextDirection: () => nd,
|
|
7387
|
+
updateAttributes: () => rd,
|
|
7388
|
+
wrapIn: () => id,
|
|
7389
|
+
wrapInList: () => ad
|
|
7390
7390
|
});
|
|
7391
7391
|
var bc = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
7392
7392
|
var n;
|
|
@@ -7444,21 +7444,33 @@ var Dc = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
|
7444
7444
|
}, Oc = (e) => ({ tr: t, dispatch: n }) => {
|
|
7445
7445
|
let { from: r, to: i } = e;
|
|
7446
7446
|
return n && t.delete(r, i), !0;
|
|
7447
|
-
}, kc = (
|
|
7448
|
-
|
|
7447
|
+
}, kc = (e) => e.content ? /^text(\*|\+)/.test(e.content) : !1, Ac = (e, t, n) => {
|
|
7448
|
+
if (!e.parent.isInline || n === "left" && e.pos > e.start() || n === "right" && e.pos < e.end()) return e.pos;
|
|
7449
|
+
let r = t.nodes[e.parent.type.name].spec;
|
|
7450
|
+
return kc(r) ? n === "left" ? e.start() - 1 : e.end() + 1 : e.pos;
|
|
7451
|
+
}, jc = (e, t, n) => ({
|
|
7452
|
+
from: Ac(e, n, "left"),
|
|
7453
|
+
to: Ac(t, n, "right")
|
|
7454
|
+
}), Mc = () => ({ state: e, dispatch: t }) => {
|
|
7455
|
+
let { $from: n, $to: r } = e.selection;
|
|
7456
|
+
if (e.selection.empty) return !1;
|
|
7457
|
+
let { from: i, to: a } = jc(n, r, e.schema);
|
|
7458
|
+
return t && (e.tr.deleteRange(i, a).scrollIntoView(), t(e.tr)), !0;
|
|
7459
|
+
}, Nc = () => ({ commands: e }) => e.keyboardShortcut("Enter"), Pc = () => ({ state: e, dispatch: t }) => pr(e, t);
|
|
7460
|
+
function Fc(e) {
|
|
7449
7461
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
7450
7462
|
}
|
|
7451
|
-
function
|
|
7463
|
+
function Ic(e, t, n = { strict: !0 }) {
|
|
7452
7464
|
let r = Object.keys(t);
|
|
7453
|
-
return r.length ? r.every((r) => n.strict ? t[r] === e[r] :
|
|
7465
|
+
return r.length ? r.every((r) => n.strict ? t[r] === e[r] : Fc(t[r]) ? t[r].test(e[r]) : t[r] === e[r]) : !0;
|
|
7454
7466
|
}
|
|
7455
|
-
function
|
|
7456
|
-
return e.find((e) => e.type === t &&
|
|
7467
|
+
function Lc(e, t, n = {}) {
|
|
7468
|
+
return e.find((e) => e.type === t && Ic(Object.fromEntries(Object.keys(n).map((t) => [t, e.attrs[t]])), n));
|
|
7457
7469
|
}
|
|
7458
|
-
function
|
|
7459
|
-
return !!
|
|
7470
|
+
function Rc(e, t, n = {}) {
|
|
7471
|
+
return !!Lc(e, t, n);
|
|
7460
7472
|
}
|
|
7461
|
-
function
|
|
7473
|
+
function zc(e, t, n) {
|
|
7462
7474
|
if (!e || !t) return;
|
|
7463
7475
|
let r = e.parent.childAfter(e.parentOffset);
|
|
7464
7476
|
if ((!r.node || !r.node.marks.some((e) => e.type === t)) && (r = e.parent.childBefore(e.parentOffset)), !r.node || !r.node.marks.some((e) => e.type === t)) return;
|
|
@@ -7466,55 +7478,55 @@ function Ic(e, t, n) {
|
|
|
7466
7478
|
let e = r.node.marks.find((e) => e.type === t);
|
|
7467
7479
|
e && (n = e.attrs);
|
|
7468
7480
|
}
|
|
7469
|
-
if (!
|
|
7481
|
+
if (!Lc([...r.node.marks], t, n)) return;
|
|
7470
7482
|
let i = r.index, a = e.start() + r.offset, o = i + 1, s = a + r.node.nodeSize;
|
|
7471
|
-
for (; i > 0 &&
|
|
7472
|
-
for (; o < e.parent.childCount &&
|
|
7483
|
+
for (; i > 0 && Rc([...e.parent.child(i - 1).marks], t, n);) --i, a -= e.parent.child(i).nodeSize;
|
|
7484
|
+
for (; o < e.parent.childCount && Rc([...e.parent.child(o).marks], t, n);) s += e.parent.child(o).nodeSize, o += 1;
|
|
7473
7485
|
return {
|
|
7474
7486
|
from: a,
|
|
7475
7487
|
to: s
|
|
7476
7488
|
};
|
|
7477
7489
|
}
|
|
7478
|
-
function
|
|
7490
|
+
function Bc(e, t) {
|
|
7479
7491
|
if (typeof e == "string") {
|
|
7480
7492
|
if (!t.marks[e]) throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);
|
|
7481
7493
|
return t.marks[e];
|
|
7482
7494
|
}
|
|
7483
7495
|
return e;
|
|
7484
7496
|
}
|
|
7485
|
-
var
|
|
7486
|
-
let a =
|
|
7497
|
+
var Vc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
7498
|
+
let a = Bc(e, r.schema), { doc: o, selection: s } = n, { $from: c, from: l, to: u } = s;
|
|
7487
7499
|
if (i) {
|
|
7488
|
-
let e =
|
|
7500
|
+
let e = zc(c, a, t);
|
|
7489
7501
|
if (e && e.from <= l && e.to >= u) {
|
|
7490
7502
|
let t = k.create(o, e.from, e.to);
|
|
7491
7503
|
n.setSelection(t);
|
|
7492
7504
|
}
|
|
7493
7505
|
}
|
|
7494
7506
|
return !0;
|
|
7495
|
-
},
|
|
7507
|
+
}, Hc = (e) => (t) => {
|
|
7496
7508
|
let n = typeof e == "function" ? e(t) : e;
|
|
7497
7509
|
for (let e = 0; e < n.length; e += 1) if (n[e](t)) return !0;
|
|
7498
7510
|
return !1;
|
|
7499
7511
|
};
|
|
7500
|
-
function
|
|
7512
|
+
function Uc(e) {
|
|
7501
7513
|
return e instanceof k;
|
|
7502
7514
|
}
|
|
7503
|
-
function
|
|
7515
|
+
function Wc(e = 0, t = 0, n = 0) {
|
|
7504
7516
|
return Math.min(Math.max(e, t), n);
|
|
7505
7517
|
}
|
|
7506
|
-
function
|
|
7518
|
+
function Gc(e, t = null) {
|
|
7507
7519
|
if (!t) return null;
|
|
7508
7520
|
let n = O.atStart(e), r = O.atEnd(e);
|
|
7509
7521
|
if (t === "start" || t === !0) return n;
|
|
7510
7522
|
if (t === "end") return r;
|
|
7511
7523
|
let i = n.from, a = r.to;
|
|
7512
|
-
return t === "all" ? k.create(e,
|
|
7524
|
+
return t === "all" ? k.create(e, Wc(0, i, a), Wc(e.content.size, i, a)) : k.create(e, Wc(t, i, a), Wc(t, i, a));
|
|
7513
7525
|
}
|
|
7514
|
-
function
|
|
7526
|
+
function Kc() {
|
|
7515
7527
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
7516
7528
|
}
|
|
7517
|
-
function
|
|
7529
|
+
function qc() {
|
|
7518
7530
|
return [
|
|
7519
7531
|
"iPad Simulator",
|
|
7520
7532
|
"iPhone Simulator",
|
|
@@ -7524,16 +7536,16 @@ function Wc() {
|
|
|
7524
7536
|
"iPod"
|
|
7525
7537
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
7526
7538
|
}
|
|
7527
|
-
function
|
|
7539
|
+
function Jc() {
|
|
7528
7540
|
return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
|
|
7529
7541
|
}
|
|
7530
|
-
var
|
|
7542
|
+
var Yc = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
|
|
7531
7543
|
t = {
|
|
7532
7544
|
scrollIntoView: !0,
|
|
7533
7545
|
...t
|
|
7534
7546
|
};
|
|
7535
7547
|
let o = () => {
|
|
7536
|
-
(
|
|
7548
|
+
(qc() || Kc()) && r.dom.focus(), Jc() && !qc() && !Kc() && r.dom.focus({ preventScroll: !0 }), requestAnimationFrame(() => {
|
|
7537
7549
|
n.isDestroyed || (r.focus(), t?.scrollIntoView && n.commands.scrollIntoView());
|
|
7538
7550
|
});
|
|
7539
7551
|
};
|
|
@@ -7542,29 +7554,29 @@ var Kc = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
|
|
|
7542
7554
|
} catch {
|
|
7543
7555
|
return !1;
|
|
7544
7556
|
}
|
|
7545
|
-
if (a && e === null && !
|
|
7546
|
-
let s =
|
|
7557
|
+
if (a && e === null && !Uc(n.state.selection)) return o(), !0;
|
|
7558
|
+
let s = Gc(i.doc, e) || n.state.selection, c = n.state.selection.eq(s);
|
|
7547
7559
|
return a && (c || i.setSelection(s), c && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
7548
|
-
},
|
|
7560
|
+
}, Xc = (e, t) => (n) => e.every((e, r) => t(e, {
|
|
7549
7561
|
...n,
|
|
7550
7562
|
index: r
|
|
7551
|
-
})),
|
|
7563
|
+
})), Zc = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({
|
|
7552
7564
|
from: n.selection.from,
|
|
7553
7565
|
to: n.selection.to
|
|
7554
|
-
}, e, t),
|
|
7566
|
+
}, e, t), Qc = (e) => {
|
|
7555
7567
|
let t = e.childNodes;
|
|
7556
7568
|
for (let n = t.length - 1; n >= 0; --n) {
|
|
7557
7569
|
let r = t[n];
|
|
7558
|
-
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 &&
|
|
7570
|
+
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Qc(r);
|
|
7559
7571
|
}
|
|
7560
7572
|
return e;
|
|
7561
7573
|
};
|
|
7562
|
-
function
|
|
7574
|
+
function $c(e) {
|
|
7563
7575
|
if (typeof window > "u") throw Error("[tiptap error]: there is no window object available, so this function cannot be used");
|
|
7564
7576
|
let t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
|
|
7565
|
-
return
|
|
7577
|
+
return Qc(n);
|
|
7566
7578
|
}
|
|
7567
|
-
function
|
|
7579
|
+
function el(e, t, n) {
|
|
7568
7580
|
if (e instanceof be || e instanceof b) return e;
|
|
7569
7581
|
n = {
|
|
7570
7582
|
slice: !0,
|
|
@@ -7578,7 +7590,7 @@ function Zc(e, t, n) {
|
|
|
7578
7590
|
return n.errorOnInvalidContent && r.check(), r;
|
|
7579
7591
|
} catch (r) {
|
|
7580
7592
|
if (n.errorOnInvalidContent) throw Error("[tiptap error]: Invalid JSON content", { cause: r });
|
|
7581
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r),
|
|
7593
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r), el("", t, n);
|
|
7582
7594
|
}
|
|
7583
7595
|
if (i) {
|
|
7584
7596
|
if (n.errorOnInvalidContent) {
|
|
@@ -7594,14 +7606,14 @@ function Zc(e, t, n) {
|
|
|
7594
7606
|
}]
|
|
7595
7607
|
} })
|
|
7596
7608
|
});
|
|
7597
|
-
if (n.slice ? Ye.fromSchema(a).parseSlice(
|
|
7609
|
+
if (n.slice ? Ye.fromSchema(a).parseSlice($c(e), n.parseOptions) : Ye.fromSchema(a).parse($c(e), n.parseOptions), n.errorOnInvalidContent && r) throw Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ Error(`Invalid element found: ${i}`) });
|
|
7598
7610
|
}
|
|
7599
7611
|
let r = Ye.fromSchema(t);
|
|
7600
|
-
return n.slice ? r.parseSlice(
|
|
7612
|
+
return n.slice ? r.parseSlice($c(e), n.parseOptions).content : r.parse($c(e), n.parseOptions);
|
|
7601
7613
|
}
|
|
7602
|
-
return
|
|
7614
|
+
return el("", t, n);
|
|
7603
7615
|
}
|
|
7604
|
-
function
|
|
7616
|
+
function tl(e, t, n) {
|
|
7605
7617
|
let r = e.steps.length - 1;
|
|
7606
7618
|
if (r < t) return;
|
|
7607
7619
|
let i = e.steps[r];
|
|
@@ -7611,7 +7623,7 @@ function Qc(e, t, n) {
|
|
|
7611
7623
|
o === 0 && (o = r);
|
|
7612
7624
|
}), e.setSelection(O.near(e.doc.resolve(o), n));
|
|
7613
7625
|
}
|
|
7614
|
-
var
|
|
7626
|
+
var nl = (e) => !("type" in e), rl = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
7615
7627
|
if (i) {
|
|
7616
7628
|
n = {
|
|
7617
7629
|
parseOptions: a.options.parseOptions,
|
|
@@ -7633,7 +7645,7 @@ var $c = (e) => !("type" in e), el = (e, t, n) => ({ tr: r, dispatch: i, editor:
|
|
|
7633
7645
|
...n.parseOptions
|
|
7634
7646
|
};
|
|
7635
7647
|
if (!n.errorOnInvalidContent && !a.options.enableContentCheck && a.options.emitContentError) try {
|
|
7636
|
-
|
|
7648
|
+
el(t, a.schema, {
|
|
7637
7649
|
parseOptions: s,
|
|
7638
7650
|
errorOnInvalidContent: !0
|
|
7639
7651
|
});
|
|
@@ -7641,7 +7653,7 @@ var $c = (e) => !("type" in e), el = (e, t, n) => ({ tr: r, dispatch: i, editor:
|
|
|
7641
7653
|
o(e);
|
|
7642
7654
|
}
|
|
7643
7655
|
try {
|
|
7644
|
-
i =
|
|
7656
|
+
i = el(t, a.schema, {
|
|
7645
7657
|
parseOptions: s,
|
|
7646
7658
|
errorOnInvalidContent: n.errorOnInvalidContent ?? a.options.enableContentCheck
|
|
7647
7659
|
});
|
|
@@ -7655,7 +7667,7 @@ var $c = (e) => !("type" in e), el = (e, t, n) => ({ tr: r, dispatch: i, editor:
|
|
|
7655
7667
|
from: e.from,
|
|
7656
7668
|
to: e.to
|
|
7657
7669
|
}, u = !0, d = !0;
|
|
7658
|
-
if ((
|
|
7670
|
+
if ((nl(i) ? i : [i]).forEach((e) => {
|
|
7659
7671
|
e.check(), u = u ? e.isText && e.marks.length === 0 : !1, d = d ? e.isBlock : !1;
|
|
7660
7672
|
}), c === l && d) {
|
|
7661
7673
|
let { parent: e } = r.doc.resolve(c);
|
|
@@ -7676,7 +7688,7 @@ var $c = (e) => !("type" in e), el = (e, t, n) => ({ tr: r, dispatch: i, editor:
|
|
|
7676
7688
|
let e = r.doc.resolve(c), t = e.node();
|
|
7677
7689
|
e.parentOffset === 0 && (t.isText || t.isTextblock) && t.content.size > 0 && d && (c = Math.max(0, c - 1)), r.replaceWith(c, l, f);
|
|
7678
7690
|
}
|
|
7679
|
-
n.updateSelection &&
|
|
7691
|
+
n.updateSelection && tl(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", {
|
|
7680
7692
|
from: c,
|
|
7681
7693
|
text: f
|
|
7682
7694
|
}), n.applyPasteRules && r.setMeta("applyPasteRules", {
|
|
@@ -7685,25 +7697,25 @@ var $c = (e) => !("type" in e), el = (e, t, n) => ({ tr: r, dispatch: i, editor:
|
|
|
7685
7697
|
});
|
|
7686
7698
|
}
|
|
7687
7699
|
return !0;
|
|
7688
|
-
},
|
|
7700
|
+
}, il = () => ({ state: e, dispatch: t }) => cr(e, t), al = () => ({ state: e, dispatch: t }) => lr(e, t), ol = () => ({ state: e, dispatch: t }) => Zn(e, t), sl = () => ({ state: e, dispatch: t }) => ar(e, t), cl = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
7689
7701
|
try {
|
|
7690
7702
|
let r = rn(e.doc, e.selection.$from.pos, -1);
|
|
7691
7703
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
7692
7704
|
} catch {
|
|
7693
7705
|
return !1;
|
|
7694
7706
|
}
|
|
7695
|
-
},
|
|
7707
|
+
}, ll = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
7696
7708
|
try {
|
|
7697
7709
|
let r = rn(e.doc, e.selection.$from.pos, 1);
|
|
7698
7710
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
7699
7711
|
} catch {
|
|
7700
7712
|
return !1;
|
|
7701
7713
|
}
|
|
7702
|
-
},
|
|
7703
|
-
function
|
|
7714
|
+
}, ul = () => ({ state: e, dispatch: t }) => Qn(e, t), dl = () => ({ state: e, dispatch: t }) => $n(e, t);
|
|
7715
|
+
function fl() {
|
|
7704
7716
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
7705
7717
|
}
|
|
7706
|
-
function
|
|
7718
|
+
function pl(e) {
|
|
7707
7719
|
let t = e.split(/-(?!$)/), n = t[t.length - 1];
|
|
7708
7720
|
n === "Space" && (n = " ");
|
|
7709
7721
|
let r, i, a, o;
|
|
@@ -7713,13 +7725,13 @@ function ul(e) {
|
|
|
7713
7725
|
else if (/^a(lt)?$/i.test(n)) r = !0;
|
|
7714
7726
|
else if (/^(c|ctrl|control)$/i.test(n)) i = !0;
|
|
7715
7727
|
else if (/^s(hift)?$/i.test(n)) a = !0;
|
|
7716
|
-
else if (/^mod$/i.test(n))
|
|
7728
|
+
else if (/^mod$/i.test(n)) qc() || fl() ? o = !0 : i = !0;
|
|
7717
7729
|
else throw Error(`Unrecognized modifier name: ${n}`);
|
|
7718
7730
|
}
|
|
7719
7731
|
return r && (n = `Alt-${n}`), i && (n = `Ctrl-${n}`), o && (n = `Meta-${n}`), a && (n = `Shift-${n}`), n;
|
|
7720
7732
|
}
|
|
7721
|
-
var
|
|
7722
|
-
let a =
|
|
7733
|
+
var ml = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
|
|
7734
|
+
let a = pl(e).split(/-(?!$)/), o = a.find((e) => ![
|
|
7723
7735
|
"Alt",
|
|
7724
7736
|
"Ctrl",
|
|
7725
7737
|
"Meta",
|
|
@@ -7740,7 +7752,7 @@ var dl = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
|
|
|
7740
7752
|
t && i && r.maybeStep(t);
|
|
7741
7753
|
}), !0;
|
|
7742
7754
|
};
|
|
7743
|
-
function
|
|
7755
|
+
function hl(e, t, n = {}) {
|
|
7744
7756
|
let { from: r, to: i, empty: a } = e.selection, o = t ? H(t, e.schema) : null, s = [];
|
|
7745
7757
|
e.doc.nodesBetween(r, i, (e, t) => {
|
|
7746
7758
|
if (e.isText) return;
|
|
@@ -7751,47 +7763,47 @@ function fl(e, t, n = {}) {
|
|
|
7751
7763
|
to: a
|
|
7752
7764
|
});
|
|
7753
7765
|
});
|
|
7754
|
-
let c = i - r, l = s.filter((e) => o ? o.name === e.node.type.name : !0).filter((e) =>
|
|
7766
|
+
let c = i - r, l = s.filter((e) => o ? o.name === e.node.type.name : !0).filter((e) => Ic(e.node.attrs, n, { strict: !1 }));
|
|
7755
7767
|
return a ? !!l.length : l.reduce((e, t) => e + t.to - t.from, 0) >= c;
|
|
7756
7768
|
}
|
|
7757
|
-
var
|
|
7758
|
-
function
|
|
7769
|
+
var gl = (e, t = {}) => ({ state: n, dispatch: r }) => hl(n, H(e, n.schema), t) ? ur(n, r) : !1, _l = () => ({ state: e, dispatch: t }) => hr(e, t), vl = (e) => ({ state: t, dispatch: n }) => Fr(H(e, t.schema))(t, n), yl = () => ({ state: e, dispatch: t }) => dr(e, t);
|
|
7770
|
+
function bl(e, t) {
|
|
7759
7771
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
7760
7772
|
}
|
|
7761
|
-
function
|
|
7773
|
+
function xl(e, t) {
|
|
7762
7774
|
let n = typeof t == "string" ? [t] : t;
|
|
7763
7775
|
return Object.keys(e).reduce((t, r) => (n.includes(r) || (t[r] = e[r]), t), {});
|
|
7764
7776
|
}
|
|
7765
|
-
var
|
|
7766
|
-
let a = null, o = null, s =
|
|
7777
|
+
var Sl = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
7778
|
+
let a = null, o = null, s = bl(typeof e == "string" ? e : e.name, r.schema);
|
|
7767
7779
|
if (!s) return !1;
|
|
7768
|
-
s === "node" && (a = H(e, r.schema)), s === "mark" && (o =
|
|
7780
|
+
s === "node" && (a = H(e, r.schema)), s === "mark" && (o = Bc(e, r.schema));
|
|
7769
7781
|
let c = !1;
|
|
7770
7782
|
return n.selection.ranges.forEach((e) => {
|
|
7771
7783
|
r.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => {
|
|
7772
|
-
a && a === e.type && (c = !0, i && n.setNodeMarkup(r, void 0,
|
|
7773
|
-
o === a.type && (c = !0, i && n.addMark(r, r + e.nodeSize, o.create(
|
|
7784
|
+
a && a === e.type && (c = !0, i && n.setNodeMarkup(r, void 0, xl(e.attrs, t))), o && e.marks.length && e.marks.forEach((a) => {
|
|
7785
|
+
o === a.type && (c = !0, i && n.addMark(r, r + e.nodeSize, o.create(xl(a.attrs, t))));
|
|
7774
7786
|
});
|
|
7775
7787
|
});
|
|
7776
7788
|
}), c;
|
|
7777
|
-
},
|
|
7789
|
+
}, Cl = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), wl = () => ({ tr: e, dispatch: t }) => {
|
|
7778
7790
|
if (t) {
|
|
7779
7791
|
let t = new Nn(e.doc);
|
|
7780
7792
|
e.setSelection(t);
|
|
7781
7793
|
}
|
|
7782
7794
|
return !0;
|
|
7783
|
-
},
|
|
7784
|
-
function
|
|
7785
|
-
return
|
|
7795
|
+
}, Tl = () => ({ state: e, dispatch: t }) => nr(e, t), El = () => ({ state: e, dispatch: t }) => or(e, t), Dl = () => ({ state: e, dispatch: t }) => vr(e, t), Ol = () => ({ state: e, dispatch: t }) => wr(e, t), kl = () => ({ state: e, dispatch: t }) => Cr(e, t);
|
|
7796
|
+
function Al(e, t, n = {}, r = {}) {
|
|
7797
|
+
return el(e, t, {
|
|
7786
7798
|
slice: !1,
|
|
7787
7799
|
parseOptions: n,
|
|
7788
7800
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
7789
7801
|
});
|
|
7790
7802
|
}
|
|
7791
|
-
var
|
|
7803
|
+
var jl = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {} } = {}) => ({ editor: i, tr: a, dispatch: o, commands: s }) => {
|
|
7792
7804
|
let { doc: c } = a;
|
|
7793
7805
|
if (r.preserveWhitespace !== "full") {
|
|
7794
|
-
let s =
|
|
7806
|
+
let s = Al(e, i.schema, r, { errorOnInvalidContent: t ?? i.options.enableContentCheck });
|
|
7795
7807
|
return o && a.replaceWith(0, c.content.size, s).setMeta("preventUpdate", !n), !0;
|
|
7796
7808
|
}
|
|
7797
7809
|
return o && a.setMeta("preventUpdate", !n), s.insertContentAt({
|
|
@@ -7802,15 +7814,15 @@ var Ol = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {
|
|
|
7802
7814
|
errorOnInvalidContent: t ?? i.options.enableContentCheck
|
|
7803
7815
|
});
|
|
7804
7816
|
};
|
|
7805
|
-
function
|
|
7806
|
-
let n =
|
|
7817
|
+
function Ml(e, t) {
|
|
7818
|
+
let n = Bc(t, e.schema), { from: r, to: i, empty: a } = e.selection, o = [];
|
|
7807
7819
|
a ? (e.storedMarks && o.push(...e.storedMarks), o.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, i, (e) => {
|
|
7808
7820
|
o.push(...e.marks);
|
|
7809
7821
|
});
|
|
7810
7822
|
let s = o.find((e) => e.type.name === n.name);
|
|
7811
7823
|
return s ? { ...s.attrs } : {};
|
|
7812
7824
|
}
|
|
7813
|
-
function
|
|
7825
|
+
function Nl(e, t) {
|
|
7814
7826
|
let n = new En(e);
|
|
7815
7827
|
return t.forEach((e) => {
|
|
7816
7828
|
e.steps.forEach((e) => {
|
|
@@ -7818,14 +7830,14 @@ function Al(e, t) {
|
|
|
7818
7830
|
});
|
|
7819
7831
|
}), n;
|
|
7820
7832
|
}
|
|
7821
|
-
function
|
|
7833
|
+
function Pl(e) {
|
|
7822
7834
|
for (let t = 0; t < e.edgeCount; t += 1) {
|
|
7823
7835
|
let { type: n } = e.edge(t);
|
|
7824
7836
|
if (n.isTextblock && !n.hasRequiredAttrs()) return n;
|
|
7825
7837
|
}
|
|
7826
7838
|
return null;
|
|
7827
7839
|
}
|
|
7828
|
-
function
|
|
7840
|
+
function Fl(e, t) {
|
|
7829
7841
|
let n = [];
|
|
7830
7842
|
return e.descendants((e, r) => {
|
|
7831
7843
|
t(e) && n.push({
|
|
@@ -7834,7 +7846,7 @@ function Ml(e, t) {
|
|
|
7834
7846
|
});
|
|
7835
7847
|
}), n;
|
|
7836
7848
|
}
|
|
7837
|
-
function
|
|
7849
|
+
function Il(e, t, n) {
|
|
7838
7850
|
let r = [];
|
|
7839
7851
|
return e.nodesBetween(t.from, t.to, (e, t) => {
|
|
7840
7852
|
n(e) && r.push({
|
|
@@ -7843,7 +7855,7 @@ function Nl(e, t, n) {
|
|
|
7843
7855
|
});
|
|
7844
7856
|
}), r;
|
|
7845
7857
|
}
|
|
7846
|
-
function
|
|
7858
|
+
function Ll(e, t) {
|
|
7847
7859
|
for (let n = e.depth; n > 0; --n) {
|
|
7848
7860
|
let r = e.node(n);
|
|
7849
7861
|
if (t(r)) return {
|
|
@@ -7854,8 +7866,8 @@ function Pl(e, t) {
|
|
|
7854
7866
|
};
|
|
7855
7867
|
}
|
|
7856
7868
|
}
|
|
7857
|
-
function
|
|
7858
|
-
return (t) =>
|
|
7869
|
+
function Rl(e) {
|
|
7870
|
+
return (t) => Ll(t.$from, e);
|
|
7859
7871
|
}
|
|
7860
7872
|
function U(e, t, n) {
|
|
7861
7873
|
return e.config[t] === void 0 && e.parent ? U(e.parent, t, n) : typeof e.config[t] == "function" ? e.config[t].bind({
|
|
@@ -7863,38 +7875,38 @@ function U(e, t, n) {
|
|
|
7863
7875
|
parent: e.parent ? U(e.parent, t, n) : null
|
|
7864
7876
|
}) : e.config[t];
|
|
7865
7877
|
}
|
|
7866
|
-
function
|
|
7878
|
+
function zl(e) {
|
|
7867
7879
|
return e.map((e) => {
|
|
7868
7880
|
let t = U(e, "addExtensions", {
|
|
7869
7881
|
name: e.name,
|
|
7870
7882
|
options: e.options,
|
|
7871
7883
|
storage: e.storage
|
|
7872
7884
|
});
|
|
7873
|
-
return t ? [e, ...
|
|
7885
|
+
return t ? [e, ...zl(t())] : e;
|
|
7874
7886
|
}).flat(10);
|
|
7875
7887
|
}
|
|
7876
|
-
function
|
|
7888
|
+
function Bl(e, t) {
|
|
7877
7889
|
let n = lt.fromSchema(t).serializeFragment(e), r = document.implementation.createHTMLDocument().createElement("div");
|
|
7878
7890
|
return r.appendChild(n), r.innerHTML;
|
|
7879
7891
|
}
|
|
7880
|
-
function
|
|
7892
|
+
function Vl(e) {
|
|
7881
7893
|
return typeof e == "function";
|
|
7882
7894
|
}
|
|
7883
7895
|
function W(e, t = void 0, ...n) {
|
|
7884
|
-
return
|
|
7896
|
+
return Vl(e) ? t ? e.bind(t)(...n) : e(...n) : e;
|
|
7885
7897
|
}
|
|
7886
|
-
function
|
|
7898
|
+
function Hl(e = {}) {
|
|
7887
7899
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
7888
7900
|
}
|
|
7889
|
-
function
|
|
7901
|
+
function Ul(e) {
|
|
7890
7902
|
return {
|
|
7891
7903
|
baseExtensions: e.filter((e) => e.type === "extension"),
|
|
7892
7904
|
nodeExtensions: e.filter((e) => e.type === "node"),
|
|
7893
7905
|
markExtensions: e.filter((e) => e.type === "mark")
|
|
7894
7906
|
};
|
|
7895
7907
|
}
|
|
7896
|
-
function
|
|
7897
|
-
let t = [], { nodeExtensions: n, markExtensions: r } =
|
|
7908
|
+
function Wl(e) {
|
|
7909
|
+
let t = [], { nodeExtensions: n, markExtensions: r } = Ul(e), i = [...n, ...r], a = {
|
|
7898
7910
|
default: null,
|
|
7899
7911
|
validate: void 0,
|
|
7900
7912
|
rendered: !0,
|
|
@@ -7946,7 +7958,7 @@ function Vl(e) {
|
|
|
7946
7958
|
});
|
|
7947
7959
|
}), t;
|
|
7948
7960
|
}
|
|
7949
|
-
function
|
|
7961
|
+
function Gl(e) {
|
|
7950
7962
|
let t = [], n = "", r = !1, i = !1, a = 0, o = e.length;
|
|
7951
7963
|
for (let s = 0; s < o; s += 1) {
|
|
7952
7964
|
let o = e[s];
|
|
@@ -7976,8 +7988,8 @@ function Hl(e) {
|
|
|
7976
7988
|
}
|
|
7977
7989
|
return n && t.push(n), t;
|
|
7978
7990
|
}
|
|
7979
|
-
function
|
|
7980
|
-
let t = [], n =
|
|
7991
|
+
function Kl(e) {
|
|
7992
|
+
let t = [], n = Gl(e || ""), r = n.length;
|
|
7981
7993
|
for (let e = 0; e < r; e += 1) {
|
|
7982
7994
|
let r = n[e], i = r.indexOf(":");
|
|
7983
7995
|
if (i === -1) continue;
|
|
@@ -7998,26 +8010,26 @@ function G(...e) {
|
|
|
7998
8010
|
let r = t ? String(t).split(" ") : [], i = n[e] ? n[e].split(" ") : [], a = r.filter((e) => !i.includes(e));
|
|
7999
8011
|
n[e] = [...i, ...a].join(" ");
|
|
8000
8012
|
} else if (e === "style") {
|
|
8001
|
-
let r = new Map([...
|
|
8013
|
+
let r = new Map([...Kl(n[e]), ...Kl(t)]);
|
|
8002
8014
|
n[e] = Array.from(r.entries()).map(([e, t]) => `${e}: ${t}`).join("; ");
|
|
8003
8015
|
} else n[e] = t;
|
|
8004
8016
|
}), n;
|
|
8005
8017
|
}, {});
|
|
8006
8018
|
}
|
|
8007
|
-
function
|
|
8019
|
+
function ql(e, t) {
|
|
8008
8020
|
return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) => G(e, t), {});
|
|
8009
8021
|
}
|
|
8010
|
-
function
|
|
8022
|
+
function Jl(e) {
|
|
8011
8023
|
return typeof e == "string" ? e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e : e;
|
|
8012
8024
|
}
|
|
8013
|
-
function
|
|
8025
|
+
function Yl(e, t) {
|
|
8014
8026
|
return "style" in e ? e : {
|
|
8015
8027
|
...e,
|
|
8016
8028
|
getAttrs: (n) => {
|
|
8017
8029
|
let r = e.getAttrs ? e.getAttrs(n) : e.attrs;
|
|
8018
8030
|
if (r === !1) return !1;
|
|
8019
8031
|
let i = t.reduce((e, t) => {
|
|
8020
|
-
let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) :
|
|
8032
|
+
let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) : Jl(n.getAttribute(t.name));
|
|
8021
8033
|
return r == null ? e : {
|
|
8022
8034
|
...e,
|
|
8023
8035
|
[t.name]: r
|
|
@@ -8030,15 +8042,15 @@ function Kl(e, t) {
|
|
|
8030
8042
|
}
|
|
8031
8043
|
};
|
|
8032
8044
|
}
|
|
8033
|
-
function
|
|
8034
|
-
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" &&
|
|
8045
|
+
function Xl(e) {
|
|
8046
|
+
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" && Hl(t) ? !1 : t != null));
|
|
8035
8047
|
}
|
|
8036
|
-
function
|
|
8048
|
+
function Zl(e) {
|
|
8037
8049
|
let t = {};
|
|
8038
8050
|
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];
|
|
8039
8051
|
}
|
|
8040
|
-
function
|
|
8041
|
-
let n =
|
|
8052
|
+
function Ql(e, t) {
|
|
8053
|
+
let n = Wl(e), { nodeExtensions: r, markExtensions: i } = Ul(e);
|
|
8042
8054
|
return new Ge({
|
|
8043
8055
|
topNode: r.find((e) => U(e, "topNode"))?.name,
|
|
8044
8056
|
nodes: Object.fromEntries(r.map((r) => {
|
|
@@ -8047,7 +8059,7 @@ function Yl(e, t) {
|
|
|
8047
8059
|
options: r.options,
|
|
8048
8060
|
storage: r.storage,
|
|
8049
8061
|
editor: t
|
|
8050
|
-
}, o =
|
|
8062
|
+
}, o = Xl({
|
|
8051
8063
|
...e.reduce((e, t) => {
|
|
8052
8064
|
let n = U(t, "extendNodeSchema", a);
|
|
8053
8065
|
return {
|
|
@@ -8067,13 +8079,13 @@ function Yl(e, t) {
|
|
|
8067
8079
|
linebreakReplacement: W(U(r, "linebreakReplacement", a)),
|
|
8068
8080
|
defining: W(U(r, "defining", a)),
|
|
8069
8081
|
isolating: W(U(r, "isolating", a)),
|
|
8070
|
-
attrs: Object.fromEntries(i.map(
|
|
8082
|
+
attrs: Object.fromEntries(i.map(Zl))
|
|
8071
8083
|
}), s = W(U(r, "parseHTML", a));
|
|
8072
|
-
s && (o.parseDOM = s.map((e) =>
|
|
8084
|
+
s && (o.parseDOM = s.map((e) => Yl(e, i)));
|
|
8073
8085
|
let c = U(r, "renderHTML", a);
|
|
8074
8086
|
c && (o.toDOM = (e) => c({
|
|
8075
8087
|
node: e,
|
|
8076
|
-
HTMLAttributes:
|
|
8088
|
+
HTMLAttributes: ql(e, i)
|
|
8077
8089
|
}));
|
|
8078
8090
|
let l = U(r, "renderText", a);
|
|
8079
8091
|
return l && (o.toText = l), [r.name, o];
|
|
@@ -8084,7 +8096,7 @@ function Yl(e, t) {
|
|
|
8084
8096
|
options: r.options,
|
|
8085
8097
|
storage: r.storage,
|
|
8086
8098
|
editor: t
|
|
8087
|
-
}, o =
|
|
8099
|
+
}, o = Xl({
|
|
8088
8100
|
...e.reduce((e, t) => {
|
|
8089
8101
|
let n = U(t, "extendMarkSchema", a);
|
|
8090
8102
|
return {
|
|
@@ -8097,43 +8109,43 @@ function Yl(e, t) {
|
|
|
8097
8109
|
group: W(U(r, "group", a)),
|
|
8098
8110
|
spanning: W(U(r, "spanning", a)),
|
|
8099
8111
|
code: W(U(r, "code", a)),
|
|
8100
|
-
attrs: Object.fromEntries(i.map(
|
|
8112
|
+
attrs: Object.fromEntries(i.map(Zl))
|
|
8101
8113
|
}), s = W(U(r, "parseHTML", a));
|
|
8102
|
-
s && (o.parseDOM = s.map((e) =>
|
|
8114
|
+
s && (o.parseDOM = s.map((e) => Yl(e, i)));
|
|
8103
8115
|
let c = U(r, "renderHTML", a);
|
|
8104
8116
|
return c && (o.toDOM = (e) => c({
|
|
8105
8117
|
mark: e,
|
|
8106
|
-
HTMLAttributes:
|
|
8118
|
+
HTMLAttributes: ql(e, i)
|
|
8107
8119
|
})), [r.name, o];
|
|
8108
8120
|
}))
|
|
8109
8121
|
});
|
|
8110
8122
|
}
|
|
8111
|
-
function
|
|
8123
|
+
function $l(e) {
|
|
8112
8124
|
let t = e.filter((t, n) => e.indexOf(t) !== n);
|
|
8113
8125
|
return Array.from(new Set(t));
|
|
8114
8126
|
}
|
|
8115
|
-
function
|
|
8127
|
+
function eu(e) {
|
|
8116
8128
|
return e.sort((e, t) => {
|
|
8117
8129
|
let n = U(e, "priority") || 100, r = U(t, "priority") || 100;
|
|
8118
8130
|
return n > r ? -1 : +(n < r);
|
|
8119
8131
|
});
|
|
8120
8132
|
}
|
|
8121
|
-
function
|
|
8122
|
-
let t =
|
|
8133
|
+
function tu(e) {
|
|
8134
|
+
let t = eu(zl(e)), n = $l(t.map((e) => e.name));
|
|
8123
8135
|
return n.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e) => `'${e}'`).join(", ")}]. This can lead to issues.`), t;
|
|
8124
8136
|
}
|
|
8125
|
-
function
|
|
8126
|
-
return
|
|
8137
|
+
function nu(e, t) {
|
|
8138
|
+
return Ql(tu(e), t);
|
|
8127
8139
|
}
|
|
8128
|
-
function
|
|
8129
|
-
let n =
|
|
8130
|
-
return
|
|
8140
|
+
function ru(e, t) {
|
|
8141
|
+
let n = nu(t);
|
|
8142
|
+
return Bl(be.fromJSON(n, e).content, n);
|
|
8131
8143
|
}
|
|
8132
|
-
function
|
|
8133
|
-
let n =
|
|
8144
|
+
function iu(e, t) {
|
|
8145
|
+
let n = nu(t), r = $c(e);
|
|
8134
8146
|
return Ye.fromSchema(n).parse(r).toJSON();
|
|
8135
8147
|
}
|
|
8136
|
-
function
|
|
8148
|
+
function au(e, t, n) {
|
|
8137
8149
|
let { from: r, to: i } = t, { blockSeparator: a = "\n\n", textSerializers: o = {} } = n || {}, s = "";
|
|
8138
8150
|
return e.nodesBetween(r, i, (e, n, c, l) => {
|
|
8139
8151
|
e.isBlock && n > r && (s += a);
|
|
@@ -8148,26 +8160,26 @@ function nu(e, t, n) {
|
|
|
8148
8160
|
e.isText && (s += (e?.text)?.slice(Math.max(r, n) - n, i - n));
|
|
8149
8161
|
}), s;
|
|
8150
8162
|
}
|
|
8151
|
-
function
|
|
8152
|
-
return
|
|
8163
|
+
function ou(e, t) {
|
|
8164
|
+
return au(e, {
|
|
8153
8165
|
from: 0,
|
|
8154
8166
|
to: e.content.size
|
|
8155
8167
|
}, t);
|
|
8156
8168
|
}
|
|
8157
|
-
function
|
|
8169
|
+
function su(e) {
|
|
8158
8170
|
return Object.fromEntries(Object.entries(e.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
|
|
8159
8171
|
}
|
|
8160
|
-
function
|
|
8161
|
-
let { blockSeparator: r = "\n\n", textSerializers: i = {} } = n || {}, a =
|
|
8162
|
-
return
|
|
8172
|
+
function cu(e, t, n) {
|
|
8173
|
+
let { blockSeparator: r = "\n\n", textSerializers: i = {} } = n || {}, a = nu(t);
|
|
8174
|
+
return ou(be.fromJSON(a, e), {
|
|
8163
8175
|
blockSeparator: r,
|
|
8164
8176
|
textSerializers: {
|
|
8165
|
-
...
|
|
8177
|
+
...su(a),
|
|
8166
8178
|
...i
|
|
8167
8179
|
}
|
|
8168
8180
|
});
|
|
8169
8181
|
}
|
|
8170
|
-
function
|
|
8182
|
+
function lu(e, t) {
|
|
8171
8183
|
let n = H(t, e.schema), { from: r, to: i } = e.selection, a = [];
|
|
8172
8184
|
e.doc.nodesBetween(r, i, (e) => {
|
|
8173
8185
|
a.push(e);
|
|
@@ -8175,22 +8187,22 @@ function ou(e, t) {
|
|
|
8175
8187
|
let o = a.reverse().find((e) => e.type.name === n.name);
|
|
8176
8188
|
return o ? { ...o.attrs } : {};
|
|
8177
8189
|
}
|
|
8178
|
-
function
|
|
8179
|
-
let n =
|
|
8180
|
-
return n === "node" ?
|
|
8190
|
+
function uu(e, t) {
|
|
8191
|
+
let n = bl(typeof t == "string" ? t : t.name, e.schema);
|
|
8192
|
+
return n === "node" ? lu(e, t) : n === "mark" ? Ml(e, t) : {};
|
|
8181
8193
|
}
|
|
8182
|
-
function
|
|
8194
|
+
function du(e, t = JSON.stringify) {
|
|
8183
8195
|
let n = {};
|
|
8184
8196
|
return e.filter((e) => {
|
|
8185
8197
|
let r = t(e);
|
|
8186
8198
|
return Object.prototype.hasOwnProperty.call(n, r) ? !1 : n[r] = !0;
|
|
8187
8199
|
});
|
|
8188
8200
|
}
|
|
8189
|
-
function
|
|
8190
|
-
let t =
|
|
8201
|
+
function fu(e) {
|
|
8202
|
+
let t = du(e);
|
|
8191
8203
|
return t.length === 1 ? t : t.filter((e, n) => !t.filter((e, t) => t !== n).some((t) => e.oldRange.from >= t.oldRange.from && e.oldRange.to <= t.oldRange.to && e.newRange.from >= t.newRange.from && e.newRange.to <= t.newRange.to));
|
|
8192
8204
|
}
|
|
8193
|
-
function
|
|
8205
|
+
function pu(e) {
|
|
8194
8206
|
let { mapping: t, steps: n } = e, r = [];
|
|
8195
8207
|
return t.maps.forEach((e, i) => {
|
|
8196
8208
|
let a = [];
|
|
@@ -8221,9 +8233,9 @@ function uu(e) {
|
|
|
8221
8233
|
}
|
|
8222
8234
|
});
|
|
8223
8235
|
});
|
|
8224
|
-
}),
|
|
8236
|
+
}), fu(r);
|
|
8225
8237
|
}
|
|
8226
|
-
function
|
|
8238
|
+
function mu(e, t = 0) {
|
|
8227
8239
|
let n = e.type === e.type.schema.topNodeType ? 0 : 1, r = t, i = r + e.nodeSize, a = e.marks.map((e) => {
|
|
8228
8240
|
let t = { type: e.type.name };
|
|
8229
8241
|
return Object.keys(e.attrs).length && (t.attrs = { ...e.attrs }), t;
|
|
@@ -8234,13 +8246,13 @@ function du(e, t = 0) {
|
|
|
8234
8246
|
};
|
|
8235
8247
|
return Object.keys(o).length && (s.attrs = o), a.length && (s.marks = a), e.content.childCount && (s.content = [], e.forEach((e, r) => {
|
|
8236
8248
|
var i;
|
|
8237
|
-
(i = s.content) == null || i.push(
|
|
8249
|
+
(i = s.content) == null || i.push(mu(e, t + r + n));
|
|
8238
8250
|
})), e.text && (s.text = e.text), s;
|
|
8239
8251
|
}
|
|
8240
|
-
function
|
|
8252
|
+
function hu(e, t, n) {
|
|
8241
8253
|
let r = [];
|
|
8242
8254
|
return e === t ? n.resolve(e).marks().forEach((t) => {
|
|
8243
|
-
let i =
|
|
8255
|
+
let i = zc(n.resolve(e), t.type);
|
|
8244
8256
|
i && r.push({
|
|
8245
8257
|
mark: t,
|
|
8246
8258
|
...i
|
|
@@ -8253,7 +8265,7 @@ function fu(e, t, n) {
|
|
|
8253
8265
|
})));
|
|
8254
8266
|
}), r;
|
|
8255
8267
|
}
|
|
8256
|
-
var
|
|
8268
|
+
var gu = (e, t, n, r = 20) => {
|
|
8257
8269
|
let i = e.doc.resolve(n), a = r, o = null;
|
|
8258
8270
|
for (; a > 0 && o === null;) {
|
|
8259
8271
|
let e = i.node(a);
|
|
@@ -8261,16 +8273,16 @@ var pu = (e, t, n, r = 20) => {
|
|
|
8261
8273
|
}
|
|
8262
8274
|
return [o, a];
|
|
8263
8275
|
};
|
|
8264
|
-
function
|
|
8276
|
+
function _u(e, t) {
|
|
8265
8277
|
return t.nodes[e] || t.marks[e] || null;
|
|
8266
8278
|
}
|
|
8267
|
-
function
|
|
8279
|
+
function vu(e, t, n) {
|
|
8268
8280
|
return Object.fromEntries(Object.entries(n).filter(([n]) => {
|
|
8269
8281
|
let r = e.find((e) => e.type === t && e.name === n);
|
|
8270
8282
|
return r ? r.attribute.keepOnSplit : !1;
|
|
8271
8283
|
}));
|
|
8272
8284
|
}
|
|
8273
|
-
var
|
|
8285
|
+
var yu = (e, t = 500) => {
|
|
8274
8286
|
let n = "", r = e.parentOffset;
|
|
8275
8287
|
return e.parent.nodesBetween(Math.max(0, r - t), r, (e, t, i, a) => {
|
|
8276
8288
|
var o;
|
|
@@ -8283,9 +8295,9 @@ var gu = (e, t = 500) => {
|
|
|
8283
8295
|
n += e.isAtom && !e.isText ? s : s.slice(0, Math.max(0, r - t));
|
|
8284
8296
|
}), n;
|
|
8285
8297
|
};
|
|
8286
|
-
function
|
|
8287
|
-
let { empty: r, ranges: i } = e.selection, a = t ?
|
|
8288
|
-
if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => a ? a.name === e.type.name : !0).find((e) =>
|
|
8298
|
+
function bu(e, t, n = {}) {
|
|
8299
|
+
let { empty: r, ranges: i } = e.selection, a = t ? Bc(t, e.schema) : null;
|
|
8300
|
+
if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => a ? a.name === e.type.name : !0).find((e) => Ic(e.attrs, n, { strict: !1 }));
|
|
8289
8301
|
let o = 0, s = [];
|
|
8290
8302
|
if (i.forEach(({ $from: t, $to: n }) => {
|
|
8291
8303
|
let r = t.pos, i = n.pos;
|
|
@@ -8300,32 +8312,32 @@ function _u(e, t, n = {}) {
|
|
|
8300
8312
|
})));
|
|
8301
8313
|
});
|
|
8302
8314
|
}), o === 0) return !1;
|
|
8303
|
-
let c = s.filter((e) => a ? a.name === e.mark.type.name : !0).filter((e) =>
|
|
8315
|
+
let c = s.filter((e) => a ? a.name === e.mark.type.name : !0).filter((e) => Ic(e.mark.attrs, n, { strict: !1 })).reduce((e, t) => e + t.to - t.from, 0), l = s.filter((e) => a ? e.mark.type !== a && e.mark.type.excludes(a) : !0).reduce((e, t) => e + t.to - t.from, 0);
|
|
8304
8316
|
return (c > 0 ? c + l : c) >= o;
|
|
8305
8317
|
}
|
|
8306
|
-
function
|
|
8307
|
-
if (!t) return
|
|
8308
|
-
let r =
|
|
8309
|
-
return r === "node" ?
|
|
8318
|
+
function xu(e, t, n = {}) {
|
|
8319
|
+
if (!t) return hl(e, null, n) || bu(e, null, n);
|
|
8320
|
+
let r = bl(t, e.schema);
|
|
8321
|
+
return r === "node" ? hl(e, t, n) : r === "mark" ? bu(e, t, n) : !1;
|
|
8310
8322
|
}
|
|
8311
|
-
var
|
|
8323
|
+
var Su = (e, t) => {
|
|
8312
8324
|
let { $from: n, $to: r, $anchor: i } = e.selection;
|
|
8313
8325
|
if (t) {
|
|
8314
|
-
let n =
|
|
8326
|
+
let n = Rl((e) => e.type.name === t)(e.selection);
|
|
8315
8327
|
if (!n) return !1;
|
|
8316
8328
|
let r = e.doc.resolve(n.pos + 1);
|
|
8317
8329
|
return i.pos + 1 === r.end();
|
|
8318
8330
|
}
|
|
8319
8331
|
return !(r.parentOffset < r.parent.nodeSize - 2 || n.pos !== r.pos);
|
|
8320
|
-
},
|
|
8332
|
+
}, Cu = (e) => {
|
|
8321
8333
|
let { $from: t, $to: n } = e.selection;
|
|
8322
8334
|
return !(t.parentOffset > 0 || t.pos !== n.pos);
|
|
8323
8335
|
};
|
|
8324
|
-
function
|
|
8336
|
+
function wu(e, t) {
|
|
8325
8337
|
return Array.isArray(t) ? t.some((t) => (typeof t == "string" ? t : t.name) === e.name) : t;
|
|
8326
8338
|
}
|
|
8327
|
-
function
|
|
8328
|
-
let { nodeExtensions: n } =
|
|
8339
|
+
function Tu(e, t) {
|
|
8340
|
+
let { nodeExtensions: n } = Ul(t), r = n.find((t) => t.name === e);
|
|
8329
8341
|
if (!r) return !1;
|
|
8330
8342
|
let i = W(U(r, "group", {
|
|
8331
8343
|
name: r.name,
|
|
@@ -8334,7 +8346,7 @@ function Su(e, t) {
|
|
|
8334
8346
|
}));
|
|
8335
8347
|
return typeof i == "string" ? i.split(" ").includes("list") : !1;
|
|
8336
8348
|
}
|
|
8337
|
-
function
|
|
8349
|
+
function Eu(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
8338
8350
|
if (n) {
|
|
8339
8351
|
if (e.type.name === "hardBreak") return !0;
|
|
8340
8352
|
if (e.isText) return !/\S/.test(e.text ?? "");
|
|
@@ -8345,7 +8357,7 @@ function Cu(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
8345
8357
|
if (t) {
|
|
8346
8358
|
let r = !0;
|
|
8347
8359
|
return e.content.forEach((e) => {
|
|
8348
|
-
r !== !1 && (
|
|
8360
|
+
r !== !1 && (Eu(e, {
|
|
8349
8361
|
ignoreWhitespace: n,
|
|
8350
8362
|
checkChildren: t
|
|
8351
8363
|
}) || (r = !1));
|
|
@@ -8353,14 +8365,14 @@ function Cu(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
8353
8365
|
}
|
|
8354
8366
|
return !1;
|
|
8355
8367
|
}
|
|
8356
|
-
function
|
|
8368
|
+
function Du(e) {
|
|
8357
8369
|
return e instanceof A;
|
|
8358
8370
|
}
|
|
8359
|
-
function
|
|
8371
|
+
function Ou({ selection: e, pos: t, nodeSize: n, selectedOnTextSelection: r = !1 }) {
|
|
8360
8372
|
let { from: i, to: a } = e;
|
|
8361
|
-
return !!(i <= t && a >= t + n || r &&
|
|
8373
|
+
return !!(i <= t && a >= t + n || r && Uc(e) && i > t && a < t + n);
|
|
8362
8374
|
}
|
|
8363
|
-
var
|
|
8375
|
+
var ku = class e {
|
|
8364
8376
|
constructor(e) {
|
|
8365
8377
|
this.position = e;
|
|
8366
8378
|
}
|
|
@@ -8371,18 +8383,18 @@ var Eu = class e {
|
|
|
8371
8383
|
return { position: this.position };
|
|
8372
8384
|
}
|
|
8373
8385
|
};
|
|
8374
|
-
function
|
|
8386
|
+
function Au(e, t) {
|
|
8375
8387
|
let n = t.mapping.mapResult(e.position);
|
|
8376
8388
|
return {
|
|
8377
|
-
position: new
|
|
8389
|
+
position: new ku(n.pos),
|
|
8378
8390
|
mapResult: n
|
|
8379
8391
|
};
|
|
8380
8392
|
}
|
|
8381
|
-
function
|
|
8382
|
-
return new
|
|
8393
|
+
function ju(e) {
|
|
8394
|
+
return new ku(e);
|
|
8383
8395
|
}
|
|
8384
|
-
function
|
|
8385
|
-
let r = e.state.doc.content.size, i =
|
|
8396
|
+
function Mu(e, t, n) {
|
|
8397
|
+
let r = e.state.doc.content.size, i = Wc(t, 0, r), a = Wc(n, 0, r), o = e.coordsAtPos(i), s = e.coordsAtPos(a, -1), c = Math.min(o.top, s.top), l = Math.max(o.bottom, s.bottom), u = Math.min(o.left, s.left), d = Math.max(o.right, s.right), f = {
|
|
8386
8398
|
top: c,
|
|
8387
8399
|
bottom: l,
|
|
8388
8400
|
left: u,
|
|
@@ -8397,14 +8409,14 @@ function ku(e, t, n) {
|
|
|
8397
8409
|
toJSON: () => f
|
|
8398
8410
|
};
|
|
8399
8411
|
}
|
|
8400
|
-
function
|
|
8412
|
+
function Nu({ json: e, validMarks: t, validNodes: n, options: r, rewrittenContent: i = [] }) {
|
|
8401
8413
|
return e.marks && Array.isArray(e.marks) && (e.marks = e.marks.filter((e) => {
|
|
8402
8414
|
let n = typeof e == "string" ? e : e.type;
|
|
8403
8415
|
return t.has(n) ? !0 : (i.push({
|
|
8404
8416
|
original: JSON.parse(JSON.stringify(e)),
|
|
8405
8417
|
unsupported: n
|
|
8406
8418
|
}), !1);
|
|
8407
|
-
})), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) =>
|
|
8419
|
+
})), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) => Nu({
|
|
8408
8420
|
json: e,
|
|
8409
8421
|
validMarks: t,
|
|
8410
8422
|
validNodes: n,
|
|
@@ -8424,17 +8436,17 @@ function Au({ json: e, validMarks: t, validNodes: n, options: r, rewrittenConten
|
|
|
8424
8436
|
rewrittenContent: i
|
|
8425
8437
|
};
|
|
8426
8438
|
}
|
|
8427
|
-
function
|
|
8428
|
-
return
|
|
8439
|
+
function Pu(e, t, n) {
|
|
8440
|
+
return Nu({
|
|
8429
8441
|
json: e,
|
|
8430
8442
|
validNodes: new Set(Object.keys(t.nodes)),
|
|
8431
8443
|
validMarks: new Set(Object.keys(t.marks)),
|
|
8432
8444
|
options: n
|
|
8433
8445
|
});
|
|
8434
8446
|
}
|
|
8435
|
-
function
|
|
8447
|
+
function Fu(e, t, n) {
|
|
8436
8448
|
let { selection: r } = t, i = null;
|
|
8437
|
-
if (
|
|
8449
|
+
if (Uc(r) && (i = r.$cursor), i) {
|
|
8438
8450
|
let t = e.storedMarks ?? i.marks();
|
|
8439
8451
|
return i.parent.type.allowsMarkType(n) && (!!n.isInSet(t) || !t.some((e) => e.type.excludes(n)));
|
|
8440
8452
|
}
|
|
@@ -8451,10 +8463,10 @@ function Mu(e, t, n) {
|
|
|
8451
8463
|
}), i;
|
|
8452
8464
|
});
|
|
8453
8465
|
}
|
|
8454
|
-
var
|
|
8455
|
-
let { selection: a } = n, { empty: o, ranges: s } = a, c =
|
|
8466
|
+
var Iu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8467
|
+
let { selection: a } = n, { empty: o, ranges: s } = a, c = Bc(e, r.schema);
|
|
8456
8468
|
if (i) if (o) {
|
|
8457
|
-
let e =
|
|
8469
|
+
let e = Ml(r, c);
|
|
8458
8470
|
n.addStoredMark(c.create({
|
|
8459
8471
|
...e,
|
|
8460
8472
|
...t
|
|
@@ -8471,8 +8483,8 @@ var Nu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8471
8483
|
}) : n.addMark(o, s, c.create(t));
|
|
8472
8484
|
});
|
|
8473
8485
|
});
|
|
8474
|
-
return
|
|
8475
|
-
},
|
|
8486
|
+
return Fu(r, n, c);
|
|
8487
|
+
}, Lu = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), Ru = (e, t = {}) => ({ state: n, dispatch: r, chain: i }) => {
|
|
8476
8488
|
let a = H(e, n.schema), o;
|
|
8477
8489
|
return n.selection.$anchor.sameParent(n.selection.$head) && (o = n.selection.$anchor.parent.attrs), a.isTextblock ? i().command(({ commands: e }) => Er(a, {
|
|
8478
8490
|
...o,
|
|
@@ -8481,13 +8493,13 @@ var Nu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8481
8493
|
...o,
|
|
8482
8494
|
...t
|
|
8483
8495
|
})(e, r)).run() : (console.warn("[tiptap warn]: Currently \"setNode()\" only supports text block nodes."), !1);
|
|
8484
|
-
},
|
|
8496
|
+
}, zu = (e) => ({ tr: t, dispatch: n }) => {
|
|
8485
8497
|
if (n) {
|
|
8486
|
-
let { doc: n } = t, r =
|
|
8498
|
+
let { doc: n } = t, r = Wc(e, 0, n.content.size), i = A.create(n, r);
|
|
8487
8499
|
t.setSelection(i);
|
|
8488
8500
|
}
|
|
8489
8501
|
return !0;
|
|
8490
|
-
},
|
|
8502
|
+
}, Bu = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8491
8503
|
let { selection: a } = r, o, s;
|
|
8492
8504
|
return typeof t == "number" ? (o = t, s = t) : t && "from" in t && "to" in t ? (o = t.from, s = t.to) : (o = a.from, s = a.to), i && n.doc.nodesBetween(o, s, (t, r) => {
|
|
8493
8505
|
t.isText || n.setNodeMarkup(r, void 0, {
|
|
@@ -8495,28 +8507,28 @@ var Nu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8495
8507
|
dir: e
|
|
8496
8508
|
});
|
|
8497
8509
|
}), !0;
|
|
8498
|
-
},
|
|
8510
|
+
}, Vu = (e) => ({ tr: t, dispatch: n }) => {
|
|
8499
8511
|
if (n) {
|
|
8500
8512
|
let { doc: n } = t, { from: r, to: i } = typeof e == "number" ? {
|
|
8501
8513
|
from: e,
|
|
8502
8514
|
to: e
|
|
8503
|
-
} : e, a = k.atStart(n).from, o = k.atEnd(n).to, s =
|
|
8515
|
+
} : e, a = k.atStart(n).from, o = k.atEnd(n).to, s = Wc(r, a, o), c = Wc(i, a, o), l = k.create(n, s, c);
|
|
8504
8516
|
t.setSelection(l);
|
|
8505
8517
|
}
|
|
8506
8518
|
return !0;
|
|
8507
|
-
},
|
|
8508
|
-
function
|
|
8519
|
+
}, Hu = (e) => ({ state: t, dispatch: n }) => Rr(H(e, t.schema))(t, n);
|
|
8520
|
+
function Uu(e, t) {
|
|
8509
8521
|
let n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
8510
8522
|
if (n) {
|
|
8511
8523
|
let r = n.filter((e) => t?.includes(e.type.name));
|
|
8512
8524
|
e.tr.ensureMarks(r);
|
|
8513
8525
|
}
|
|
8514
8526
|
}
|
|
8515
|
-
var
|
|
8516
|
-
let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u =
|
|
8517
|
-
if (a instanceof A && a.node.isBlock) return !s.parentOffset || !Qt(o, s.pos) ? !1 : (r && (e &&
|
|
8527
|
+
var Wu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: i }) => {
|
|
8528
|
+
let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u = vu(l, s.node().type.name, s.node().attrs);
|
|
8529
|
+
if (a instanceof A && a.node.isBlock) return !s.parentOffset || !Qt(o, s.pos) ? !1 : (r && (e && Uu(n, i.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
|
|
8518
8530
|
if (!s.parent.isBlock) return !1;
|
|
8519
|
-
let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 :
|
|
8531
|
+
let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 : Pl(s.node(-1).contentMatchAt(s.indexAfter(-1))), p = d && f ? [{
|
|
8520
8532
|
type: f,
|
|
8521
8533
|
attrs: u
|
|
8522
8534
|
}] : void 0, m = Qt(t.doc, t.mapping.map(s.pos), 1, p);
|
|
@@ -8528,10 +8540,10 @@ var Vu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8528
8540
|
let e = t.mapping.map(s.before()), n = t.doc.resolve(e);
|
|
8529
8541
|
s.node(-1).canReplaceWith(n.index(), n.index() + 1, f) && t.setNodeMarkup(t.mapping.map(s.before()), f);
|
|
8530
8542
|
}
|
|
8531
|
-
e &&
|
|
8543
|
+
e && Uu(n, i.extensionManager.splittableMarks), t.scrollIntoView();
|
|
8532
8544
|
}
|
|
8533
8545
|
return m;
|
|
8534
|
-
},
|
|
8546
|
+
}, Gu = (e, t = {}) => ({ tr: n, state: r, dispatch: i, editor: a }) => {
|
|
8535
8547
|
let o = H(e, r.schema), { $from: s, $to: c } = r.selection, l = r.selection.node;
|
|
8536
8548
|
if (l && l.isBlock || s.depth < 2 || !s.sameParent(c)) return !1;
|
|
8537
8549
|
let u = s.node(-1);
|
|
@@ -8543,7 +8555,7 @@ var Vu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8543
8555
|
let e = b.empty, r = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
|
|
8544
8556
|
for (let t = s.depth - r; t >= s.depth - 3; --t) e = b.from(s.node(t).copy(e));
|
|
8545
8557
|
let i = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3, a = {
|
|
8546
|
-
...
|
|
8558
|
+
...vu(d, s.node().type.name, s.node().attrs),
|
|
8547
8559
|
...t
|
|
8548
8560
|
}, c = o.contentMatch.defaultType?.createAndFill(a) || void 0;
|
|
8549
8561
|
e = e.append(b.from(o.createAndFill(null, c) || void 0));
|
|
@@ -8558,10 +8570,10 @@ var Vu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8558
8570
|
return !0;
|
|
8559
8571
|
}
|
|
8560
8572
|
let f = c.pos === s.end() ? u.contentMatchAt(0).defaultType : null, p = {
|
|
8561
|
-
...
|
|
8573
|
+
...vu(d, u.type.name, u.attrs),
|
|
8562
8574
|
...t
|
|
8563
8575
|
}, m = {
|
|
8564
|
-
...
|
|
8576
|
+
...vu(d, s.node().type.name, s.node().attrs),
|
|
8565
8577
|
...t
|
|
8566
8578
|
};
|
|
8567
8579
|
n.delete(s.pos, c.pos);
|
|
@@ -8583,59 +8595,59 @@ var Vu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8583
8595
|
n.ensureMarks(l);
|
|
8584
8596
|
}
|
|
8585
8597
|
return !0;
|
|
8586
|
-
},
|
|
8587
|
-
let n =
|
|
8598
|
+
}, Ku = (e, t) => {
|
|
8599
|
+
let n = Rl((e) => e.type === t)(e.selection);
|
|
8588
8600
|
if (!n) return !0;
|
|
8589
8601
|
let r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
|
|
8590
8602
|
if (r === void 0) return !0;
|
|
8591
8603
|
let i = e.doc.nodeAt(r);
|
|
8592
8604
|
return n.node.type === i?.type && en(e.doc, n.pos) && e.join(n.pos), !0;
|
|
8593
|
-
},
|
|
8594
|
-
let n =
|
|
8605
|
+
}, qu = (e, t) => {
|
|
8606
|
+
let n = Rl((e) => e.type === t)(e.selection);
|
|
8595
8607
|
if (!n) return !0;
|
|
8596
8608
|
let r = e.doc.resolve(n.start).after(n.depth);
|
|
8597
8609
|
if (r === void 0) return !0;
|
|
8598
8610
|
let i = e.doc.nodeAt(r);
|
|
8599
8611
|
return n.node.type === i?.type && en(e.doc, r) && e.join(r), !0;
|
|
8600
8612
|
};
|
|
8601
|
-
function
|
|
8613
|
+
function Ju(e) {
|
|
8602
8614
|
let t = e.doc, n = t.firstChild;
|
|
8603
8615
|
if (!n) return null;
|
|
8604
8616
|
let r = t.resolve(1), i = t.resolve(n.nodeSize - 1);
|
|
8605
8617
|
return k.between(r, i);
|
|
8606
8618
|
}
|
|
8607
|
-
var
|
|
8619
|
+
var Yu = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
|
|
8608
8620
|
let { extensions: d, splittableMarks: f } = i.extensionManager, p = H(e, o.schema), m = H(t, o.schema), { selection: h, storedMarks: g } = o, { $from: _, $to: v } = h, y = _.blockRange(v), b = g || h.$to.parentOffset && h.$from.marks();
|
|
8609
8621
|
if (!y) return !1;
|
|
8610
|
-
let x =
|
|
8622
|
+
let x = Rl((e) => Tu(e.type.name, d))(h), S = h.from === 0 && h.to === o.doc.content.size, ee = o.doc.content.content, C = ee.length === 1 ? ee[0] : null, te = S && C && Tu(C.type.name, d) ? {
|
|
8611
8623
|
node: C,
|
|
8612
8624
|
pos: 0,
|
|
8613
8625
|
depth: 0
|
|
8614
8626
|
} : null, w = x ?? te, ne = !!x && y.depth >= 1 && y.depth - x.depth <= 1, re = !!te;
|
|
8615
8627
|
if ((ne || re) && w) {
|
|
8616
8628
|
if (w.node.type === p) return S && re ? c().command(({ tr: e, dispatch: t }) => {
|
|
8617
|
-
let n =
|
|
8629
|
+
let n = Ju(e);
|
|
8618
8630
|
return n ? (e.setSelection(n), t && t(e), !0) : !1;
|
|
8619
8631
|
}).liftListItem(m).run() : l.liftListItem(m);
|
|
8620
|
-
if (
|
|
8632
|
+
if (Tu(w.node.type.name, d) && p.validContent(w.node.content)) return c().command(() => (a.setNodeMarkup(w.pos, p), !0)).command(() => Ku(a, p)).command(() => qu(a, p)).run();
|
|
8621
8633
|
}
|
|
8622
|
-
return !n || !b || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() =>
|
|
8634
|
+
return !n || !b || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => Ku(a, p)).command(() => qu(a, p)).run() : c().command(() => {
|
|
8623
8635
|
let e = u().wrapInList(p, r), t = b.filter((e) => f.includes(e.type.name));
|
|
8624
8636
|
return a.ensureMarks(t), e ? !0 : l.clearNodes();
|
|
8625
|
-
}).wrapInList(p, r).command(() =>
|
|
8626
|
-
},
|
|
8627
|
-
let { extendEmptyMarkRange: a = !1 } = n, o =
|
|
8628
|
-
return
|
|
8629
|
-
},
|
|
8630
|
-
let a = H(e, r.schema), o = H(t, r.schema), s =
|
|
8637
|
+
}).wrapInList(p, r).command(() => Ku(a, p)).command(() => qu(a, p)).run();
|
|
8638
|
+
}, Xu = (e, t = {}, n = {}) => ({ state: r, commands: i }) => {
|
|
8639
|
+
let { extendEmptyMarkRange: a = !1 } = n, o = Bc(e, r.schema);
|
|
8640
|
+
return bu(r, o, t) ? i.unsetMark(o, { extendEmptyMarkRange: a }) : i.setMark(o, t);
|
|
8641
|
+
}, Zu = (e, t, n = {}) => ({ state: r, commands: i }) => {
|
|
8642
|
+
let a = H(e, r.schema), o = H(t, r.schema), s = hl(r, a, n), c;
|
|
8631
8643
|
return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), s ? i.setNode(o, c) : i.setNode(a, {
|
|
8632
8644
|
...c,
|
|
8633
8645
|
...n
|
|
8634
8646
|
});
|
|
8635
|
-
},
|
|
8647
|
+
}, Qu = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
8636
8648
|
let i = H(e, n.schema);
|
|
8637
|
-
return
|
|
8638
|
-
},
|
|
8649
|
+
return hl(n, i, t) ? r.lift(i) : r.wrapIn(i, t);
|
|
8650
|
+
}, $u = () => ({ state: e, dispatch: t }) => {
|
|
8639
8651
|
let n = e.plugins;
|
|
8640
8652
|
for (let r = 0; r < n.length; r += 1) {
|
|
8641
8653
|
let i = n[r], a;
|
|
@@ -8652,32 +8664,32 @@ var Ku = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
8652
8664
|
}
|
|
8653
8665
|
}
|
|
8654
8666
|
return !1;
|
|
8655
|
-
},
|
|
8667
|
+
}, ed = () => ({ tr: e, dispatch: t }) => {
|
|
8656
8668
|
let { selection: n } = e, { empty: r, ranges: i } = n;
|
|
8657
8669
|
return r || t && i.forEach((t) => {
|
|
8658
8670
|
e.removeMark(t.$from.pos, t.$to.pos);
|
|
8659
8671
|
}), !0;
|
|
8660
|
-
},
|
|
8661
|
-
let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s =
|
|
8672
|
+
}, td = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8673
|
+
let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s = Bc(e, r.schema), { $from: c, empty: l, ranges: u } = o;
|
|
8662
8674
|
if (!i) return !0;
|
|
8663
8675
|
if (l && a) {
|
|
8664
|
-
let { from: e, to: t } = o, r =
|
|
8676
|
+
let { from: e, to: t } = o, r = zc(c, s, c.marks().find((e) => e.type === s)?.attrs);
|
|
8665
8677
|
r && (e = r.from, t = r.to), n.removeMark(e, t, s);
|
|
8666
8678
|
} else u.forEach((e) => {
|
|
8667
8679
|
n.removeMark(e.$from.pos, e.$to.pos, s);
|
|
8668
8680
|
});
|
|
8669
8681
|
return n.removeStoredMark(s), !0;
|
|
8670
|
-
},
|
|
8682
|
+
}, nd = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
8671
8683
|
let { selection: i } = n, a, o;
|
|
8672
8684
|
return typeof e == "number" ? (a = e, o = e) : e && "from" in e && "to" in e ? (a = e.from, o = e.to) : (a = i.from, o = i.to), r && t.doc.nodesBetween(a, o, (e, n) => {
|
|
8673
8685
|
if (e.isText) return;
|
|
8674
8686
|
let r = { ...e.attrs };
|
|
8675
8687
|
delete r.dir, t.setNodeMarkup(n, void 0, r);
|
|
8676
8688
|
}), !0;
|
|
8677
|
-
},
|
|
8678
|
-
let a = null, o = null, s =
|
|
8689
|
+
}, rd = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8690
|
+
let a = null, o = null, s = bl(typeof e == "string" ? e : e.name, r.schema);
|
|
8679
8691
|
if (!s) return !1;
|
|
8680
|
-
s === "node" && (a = H(e, r.schema)), s === "mark" && (o =
|
|
8692
|
+
s === "node" && (a = H(e, r.schema)), s === "mark" && (o = Bc(e, r.schema));
|
|
8681
8693
|
let c = !1;
|
|
8682
8694
|
return n.selection.ranges.forEach((e) => {
|
|
8683
8695
|
let s = e.$from.pos, l = e.$to.pos, u, d, f, p;
|
|
@@ -8706,7 +8718,7 @@ var Ku = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
8706
8718
|
}));
|
|
8707
8719
|
}));
|
|
8708
8720
|
}), c;
|
|
8709
|
-
},
|
|
8721
|
+
}, id = (e, t = {}) => ({ state: n, dispatch: r }) => Tr(H(e, n.schema), t)(n, r), ad = (e, t = {}) => ({ state: n, dispatch: r }) => Mr(H(e, n.schema), t)(n, r), od = class {
|
|
8710
8722
|
constructor() {
|
|
8711
8723
|
this.callbacks = {};
|
|
8712
8724
|
}
|
|
@@ -8730,26 +8742,26 @@ var Ku = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
8730
8742
|
removeAllListeners() {
|
|
8731
8743
|
this.callbacks = {};
|
|
8732
8744
|
}
|
|
8733
|
-
},
|
|
8745
|
+
}, sd = class {
|
|
8734
8746
|
constructor(e) {
|
|
8735
8747
|
this.find = e.find, this.handler = e.handler, this.undoable = e.undoable ?? !0;
|
|
8736
8748
|
}
|
|
8737
|
-
},
|
|
8738
|
-
if (
|
|
8749
|
+
}, cd = (e, t) => {
|
|
8750
|
+
if (Fc(t)) return t.exec(e);
|
|
8739
8751
|
let n = t(e);
|
|
8740
8752
|
if (!n) return null;
|
|
8741
8753
|
let r = [n.text];
|
|
8742
8754
|
return r.index = n.index, r.input = e, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn("[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\"."), r.push(n.replaceWith)), r;
|
|
8743
8755
|
};
|
|
8744
|
-
function
|
|
8756
|
+
function ld(e) {
|
|
8745
8757
|
let { editor: t, from: n, to: r, text: i, rules: a, plugin: o } = e, { view: s } = t;
|
|
8746
8758
|
if (s.composing) return !1;
|
|
8747
8759
|
let c = s.state.doc.resolve(n);
|
|
8748
8760
|
if (c.parent.type.spec.code || (c.nodeBefore || c.nodeAfter)?.marks.find((e) => e.type.spec.code)) return !1;
|
|
8749
|
-
let l = !1, u =
|
|
8761
|
+
let l = !1, u = yu(c) + i;
|
|
8750
8762
|
return a.forEach((e) => {
|
|
8751
8763
|
if (l) return;
|
|
8752
|
-
let a =
|
|
8764
|
+
let a = cd(u, e.find);
|
|
8753
8765
|
if (!a) return;
|
|
8754
8766
|
let c = s.state.tr, d = _c({
|
|
8755
8767
|
state: s.state,
|
|
@@ -8776,7 +8788,7 @@ function od(e) {
|
|
|
8776
8788
|
}), s.dispatch(c), l = !0);
|
|
8777
8789
|
}), l;
|
|
8778
8790
|
}
|
|
8779
|
-
function
|
|
8791
|
+
function ud(e) {
|
|
8780
8792
|
let { editor: t, rules: n } = e, r = new j({
|
|
8781
8793
|
state: {
|
|
8782
8794
|
init() {
|
|
@@ -8788,9 +8800,9 @@ function sd(e) {
|
|
|
8788
8800
|
let s = e.getMeta("applyInputRules");
|
|
8789
8801
|
return s && setTimeout(() => {
|
|
8790
8802
|
let { text: e } = s;
|
|
8791
|
-
e = typeof e == "string" ? e :
|
|
8803
|
+
e = typeof e == "string" ? e : Bl(b.from(e), a.schema);
|
|
8792
8804
|
let { from: i } = s;
|
|
8793
|
-
|
|
8805
|
+
ld({
|
|
8794
8806
|
editor: t,
|
|
8795
8807
|
from: i,
|
|
8796
8808
|
to: i + e.length,
|
|
@@ -8803,7 +8815,7 @@ function sd(e) {
|
|
|
8803
8815
|
},
|
|
8804
8816
|
props: {
|
|
8805
8817
|
handleTextInput(e, i, a, o) {
|
|
8806
|
-
return
|
|
8818
|
+
return ld({
|
|
8807
8819
|
editor: t,
|
|
8808
8820
|
from: i,
|
|
8809
8821
|
to: a,
|
|
@@ -8814,7 +8826,7 @@ function sd(e) {
|
|
|
8814
8826
|
},
|
|
8815
8827
|
handleDOMEvents: { compositionend: (e) => (setTimeout(() => {
|
|
8816
8828
|
let { $cursor: i } = e.state.selection;
|
|
8817
|
-
i &&
|
|
8829
|
+
i && ld({
|
|
8818
8830
|
editor: t,
|
|
8819
8831
|
from: i.pos,
|
|
8820
8832
|
to: i.pos,
|
|
@@ -8826,7 +8838,7 @@ function sd(e) {
|
|
|
8826
8838
|
handleKeyDown(e, i) {
|
|
8827
8839
|
if (i.key !== "Enter") return !1;
|
|
8828
8840
|
let { $cursor: a } = e.state.selection;
|
|
8829
|
-
return a ?
|
|
8841
|
+
return a ? ld({
|
|
8830
8842
|
editor: t,
|
|
8831
8843
|
from: a.pos,
|
|
8832
8844
|
to: a.pos,
|
|
@@ -8840,19 +8852,19 @@ function sd(e) {
|
|
|
8840
8852
|
});
|
|
8841
8853
|
return r;
|
|
8842
8854
|
}
|
|
8843
|
-
function
|
|
8855
|
+
function dd(e) {
|
|
8844
8856
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
8845
8857
|
}
|
|
8846
|
-
function
|
|
8847
|
-
return
|
|
8858
|
+
function fd(e) {
|
|
8859
|
+
return dd(e) === "Object" ? e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype : !1;
|
|
8848
8860
|
}
|
|
8849
|
-
function
|
|
8861
|
+
function pd(e, t) {
|
|
8850
8862
|
let n = { ...e };
|
|
8851
|
-
return
|
|
8852
|
-
|
|
8863
|
+
return fd(e) && fd(t) && Object.keys(t).forEach((r) => {
|
|
8864
|
+
fd(t[r]) && fd(e[r]) ? n[r] = pd(e[r], t[r]) : n[r] = t[r];
|
|
8853
8865
|
}), n;
|
|
8854
8866
|
}
|
|
8855
|
-
var
|
|
8867
|
+
var md = class {
|
|
8856
8868
|
constructor(e = {}) {
|
|
8857
8869
|
this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = { name: this.name }, this.config = {
|
|
8858
8870
|
...this.config,
|
|
@@ -8871,7 +8883,7 @@ var dd = class {
|
|
|
8871
8883
|
configure(e = {}) {
|
|
8872
8884
|
let t = this.extend({
|
|
8873
8885
|
...this.config,
|
|
8874
|
-
addOptions: () =>
|
|
8886
|
+
addOptions: () => pd(this.options, e)
|
|
8875
8887
|
});
|
|
8876
8888
|
return t.name = this.name, t.parent = this.parent, this.child = null, t;
|
|
8877
8889
|
}
|
|
@@ -8882,7 +8894,7 @@ var dd = class {
|
|
|
8882
8894
|
});
|
|
8883
8895
|
return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
|
|
8884
8896
|
}
|
|
8885
|
-
},
|
|
8897
|
+
}, hd = class e extends md {
|
|
8886
8898
|
constructor() {
|
|
8887
8899
|
super(...arguments), this.type = "mark";
|
|
8888
8900
|
}
|
|
@@ -8907,22 +8919,22 @@ var dd = class {
|
|
|
8907
8919
|
return super.extend(t);
|
|
8908
8920
|
}
|
|
8909
8921
|
};
|
|
8910
|
-
function
|
|
8922
|
+
function gd(e) {
|
|
8911
8923
|
return typeof e == "number";
|
|
8912
8924
|
}
|
|
8913
|
-
var
|
|
8925
|
+
var _d = class {
|
|
8914
8926
|
constructor(e) {
|
|
8915
8927
|
this.find = e.find, this.handler = e.handler;
|
|
8916
8928
|
}
|
|
8917
|
-
},
|
|
8918
|
-
if (
|
|
8929
|
+
}, vd = (e, t, n) => {
|
|
8930
|
+
if (Fc(t)) return [...e.matchAll(t)];
|
|
8919
8931
|
let r = t(e, n);
|
|
8920
8932
|
return r ? r.map((t) => {
|
|
8921
8933
|
let n = [t.text];
|
|
8922
8934
|
return n.index = t.index, n.input = e, n.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn("[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\"."), n.push(t.replaceWith)), n;
|
|
8923
8935
|
}) : [];
|
|
8924
8936
|
};
|
|
8925
|
-
function
|
|
8937
|
+
function yd(e) {
|
|
8926
8938
|
let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new vc({
|
|
8927
8939
|
editor: t,
|
|
8928
8940
|
state: n
|
|
@@ -8930,7 +8942,7 @@ function gd(e) {
|
|
|
8930
8942
|
return n.doc.nodesBetween(r, i, (e, t) => {
|
|
8931
8943
|
if (e.type?.spec?.code || !(e.isText || e.isTextblock || e.isInline)) return;
|
|
8932
8944
|
let f = e.content?.size ?? e.nodeSize ?? 0, p = Math.max(r, t), m = Math.min(i, t + f);
|
|
8933
|
-
p >= m ||
|
|
8945
|
+
p >= m || vd(e.isText ? e.text || "" : e.textBetween(p - t, m - t, void 0, ""), a.find, o).forEach((e) => {
|
|
8934
8946
|
if (e.index === void 0) return;
|
|
8935
8947
|
let t = p + e.index + 1, r = t + e[0].length, i = {
|
|
8936
8948
|
from: n.tr.mapping.map(t),
|
|
@@ -8949,12 +8961,12 @@ function gd(e) {
|
|
|
8949
8961
|
});
|
|
8950
8962
|
}), d.every((e) => e !== null);
|
|
8951
8963
|
}
|
|
8952
|
-
var
|
|
8964
|
+
var bd = null, xd = (e) => {
|
|
8953
8965
|
var t;
|
|
8954
8966
|
let n = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
|
|
8955
8967
|
return (t = n.clipboardData) == null || t.setData("text/html", e), n;
|
|
8956
8968
|
};
|
|
8957
|
-
function
|
|
8969
|
+
function Sd(e) {
|
|
8958
8970
|
let { editor: t, rules: n } = e, r = null, i = !1, a = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, s;
|
|
8959
8971
|
try {
|
|
8960
8972
|
s = typeof DragEvent < "u" ? new DragEvent("drop") : null;
|
|
@@ -8963,7 +8975,7 @@ function yd(e) {
|
|
|
8963
8975
|
}
|
|
8964
8976
|
let c = ({ state: e, from: n, to: r, rule: i, pasteEvt: a }) => {
|
|
8965
8977
|
let c = e.tr;
|
|
8966
|
-
if (!(!
|
|
8978
|
+
if (!(!yd({
|
|
8967
8979
|
editor: t,
|
|
8968
8980
|
state: _c({
|
|
8969
8981
|
state: e,
|
|
@@ -8986,9 +8998,9 @@ function yd(e) {
|
|
|
8986
8998
|
return n.map((e) => new j({
|
|
8987
8999
|
view(e) {
|
|
8988
9000
|
let n = (n) => {
|
|
8989
|
-
r = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, r && (
|
|
9001
|
+
r = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, r && (bd = t);
|
|
8990
9002
|
}, i = () => {
|
|
8991
|
-
|
|
9003
|
+
bd &&= null;
|
|
8992
9004
|
};
|
|
8993
9005
|
return window.addEventListener("dragstart", n), window.addEventListener("dragend", i), { destroy() {
|
|
8994
9006
|
window.removeEventListener("dragstart", n), window.removeEventListener("dragend", i);
|
|
@@ -8997,7 +9009,7 @@ function yd(e) {
|
|
|
8997
9009
|
props: { handleDOMEvents: {
|
|
8998
9010
|
drop: (e, t) => {
|
|
8999
9011
|
if (a = r === e.dom.parentElement, s = t, !a) {
|
|
9000
|
-
let e =
|
|
9012
|
+
let e = bd;
|
|
9001
9013
|
e?.isEditable && setTimeout(() => {
|
|
9002
9014
|
let t = e.state.selection;
|
|
9003
9015
|
t && e.commands.deleteRange({
|
|
@@ -9018,8 +9030,8 @@ function yd(e) {
|
|
|
9018
9030
|
if (!l && !u && !f) return;
|
|
9019
9031
|
if (f) {
|
|
9020
9032
|
let { text: t } = d;
|
|
9021
|
-
t = typeof t == "string" ? t :
|
|
9022
|
-
let { from: n } = d, i = n + t.length, a =
|
|
9033
|
+
t = typeof t == "string" ? t : Bl(b.from(t), r.schema);
|
|
9034
|
+
let { from: n } = d, i = n + t.length, a = xd(t);
|
|
9023
9035
|
return c({
|
|
9024
9036
|
rule: e,
|
|
9025
9037
|
state: r,
|
|
@@ -9029,7 +9041,7 @@ function yd(e) {
|
|
|
9029
9041
|
});
|
|
9030
9042
|
}
|
|
9031
9043
|
let p = n.doc.content.findDiffStart(r.doc.content), m = n.doc.content.findDiffEnd(r.doc.content);
|
|
9032
|
-
if (!(!
|
|
9044
|
+
if (!(!gd(p) || !m || p === m.b)) return c({
|
|
9033
9045
|
rule: e,
|
|
9034
9046
|
state: r,
|
|
9035
9047
|
from: p,
|
|
@@ -9039,9 +9051,9 @@ function yd(e) {
|
|
|
9039
9051
|
}
|
|
9040
9052
|
}));
|
|
9041
9053
|
}
|
|
9042
|
-
var
|
|
9054
|
+
var Cd = class {
|
|
9043
9055
|
constructor(e, t) {
|
|
9044
|
-
this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions =
|
|
9056
|
+
this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions = tu(e), this.schema = Ql(this.extensions, t), this.setupExtensions();
|
|
9045
9057
|
}
|
|
9046
9058
|
get commands() {
|
|
9047
9059
|
return this.extensions.reduce((e, t) => {
|
|
@@ -9050,7 +9062,7 @@ var bd = class {
|
|
|
9050
9062
|
options: t.options,
|
|
9051
9063
|
storage: this.editor.extensionStorage[t.name],
|
|
9052
9064
|
editor: this.editor,
|
|
9053
|
-
type:
|
|
9065
|
+
type: _u(t.name, this.schema)
|
|
9054
9066
|
});
|
|
9055
9067
|
return n ? {
|
|
9056
9068
|
...e,
|
|
@@ -9060,15 +9072,15 @@ var bd = class {
|
|
|
9060
9072
|
}
|
|
9061
9073
|
get plugins() {
|
|
9062
9074
|
let { editor: e } = this;
|
|
9063
|
-
return
|
|
9075
|
+
return eu([...this.extensions].reverse()).flatMap((t) => {
|
|
9064
9076
|
let n = {
|
|
9065
9077
|
name: t.name,
|
|
9066
9078
|
options: t.options,
|
|
9067
9079
|
storage: this.editor.extensionStorage[t.name],
|
|
9068
9080
|
editor: e,
|
|
9069
|
-
type:
|
|
9081
|
+
type: _u(t.name, this.schema)
|
|
9070
9082
|
}, r = [], i = U(t, "addKeyboardShortcuts", n), a = {};
|
|
9071
|
-
if (t.type === "mark" && U(t, "exitable", n) && (a.ArrowRight = () =>
|
|
9083
|
+
if (t.type === "mark" && U(t, "exitable", n) && (a.ArrowRight = () => hd.handleExit({
|
|
9072
9084
|
editor: e,
|
|
9073
9085
|
mark: t
|
|
9074
9086
|
})), i) {
|
|
@@ -9081,10 +9093,10 @@ var bd = class {
|
|
|
9081
9093
|
let o = pc(a);
|
|
9082
9094
|
r.push(o);
|
|
9083
9095
|
let s = U(t, "addInputRules", n);
|
|
9084
|
-
if (
|
|
9096
|
+
if (wu(t, e.options.enableInputRules) && s) {
|
|
9085
9097
|
let t = s();
|
|
9086
9098
|
if (t && t.length) {
|
|
9087
|
-
let n =
|
|
9099
|
+
let n = ud({
|
|
9088
9100
|
editor: e,
|
|
9089
9101
|
rules: t
|
|
9090
9102
|
});
|
|
@@ -9092,10 +9104,10 @@ var bd = class {
|
|
|
9092
9104
|
}
|
|
9093
9105
|
}
|
|
9094
9106
|
let c = U(t, "addPasteRules", n);
|
|
9095
|
-
if (
|
|
9107
|
+
if (wu(t, e.options.enablePasteRules) && c) {
|
|
9096
9108
|
let t = c();
|
|
9097
9109
|
if (t && t.length) {
|
|
9098
|
-
let n =
|
|
9110
|
+
let n = Sd({
|
|
9099
9111
|
editor: e,
|
|
9100
9112
|
rules: t
|
|
9101
9113
|
});
|
|
@@ -9111,10 +9123,10 @@ var bd = class {
|
|
|
9111
9123
|
});
|
|
9112
9124
|
}
|
|
9113
9125
|
get attributes() {
|
|
9114
|
-
return
|
|
9126
|
+
return Wl(this.extensions);
|
|
9115
9127
|
}
|
|
9116
9128
|
get nodeViews() {
|
|
9117
|
-
let { editor: e } = this, { nodeExtensions: t } =
|
|
9129
|
+
let { editor: e } = this, { nodeExtensions: t } = Ul(this.extensions);
|
|
9118
9130
|
return Object.fromEntries(t.filter((e) => !!U(e, "addNodeView")).map((t) => {
|
|
9119
9131
|
let n = this.attributes.filter((e) => e.type === t.name), r = U(t, "addNodeView", {
|
|
9120
9132
|
name: t.name,
|
|
@@ -9133,19 +9145,19 @@ var bd = class {
|
|
|
9133
9145
|
innerDecorations: c,
|
|
9134
9146
|
editor: e,
|
|
9135
9147
|
extension: t,
|
|
9136
|
-
HTMLAttributes:
|
|
9148
|
+
HTMLAttributes: ql(r, n)
|
|
9137
9149
|
})] : [];
|
|
9138
9150
|
}));
|
|
9139
9151
|
}
|
|
9140
9152
|
dispatchTransaction(e) {
|
|
9141
9153
|
let { editor: t } = this;
|
|
9142
|
-
return
|
|
9154
|
+
return eu([...this.extensions].reverse()).reduceRight((e, n) => {
|
|
9143
9155
|
let r = {
|
|
9144
9156
|
name: n.name,
|
|
9145
9157
|
options: n.options,
|
|
9146
9158
|
storage: this.editor.extensionStorage[n.name],
|
|
9147
9159
|
editor: t,
|
|
9148
|
-
type:
|
|
9160
|
+
type: _u(n.name, this.schema)
|
|
9149
9161
|
}, i = U(n, "dispatchTransaction", r);
|
|
9150
9162
|
return i ? (t) => {
|
|
9151
9163
|
i.call(r, {
|
|
@@ -9157,13 +9169,13 @@ var bd = class {
|
|
|
9157
9169
|
}
|
|
9158
9170
|
transformPastedHTML(e) {
|
|
9159
9171
|
let { editor: t } = this;
|
|
9160
|
-
return
|
|
9172
|
+
return eu([...this.extensions]).reduce((e, n) => {
|
|
9161
9173
|
let r = {
|
|
9162
9174
|
name: n.name,
|
|
9163
9175
|
options: n.options,
|
|
9164
9176
|
storage: this.editor.extensionStorage[n.name],
|
|
9165
9177
|
editor: t,
|
|
9166
|
-
type:
|
|
9178
|
+
type: _u(n.name, this.schema)
|
|
9167
9179
|
}, i = U(n, "transformPastedHTML", r);
|
|
9168
9180
|
return i ? (t, n) => {
|
|
9169
9181
|
let a = e(t, n);
|
|
@@ -9172,17 +9184,17 @@ var bd = class {
|
|
|
9172
9184
|
}, e || ((e) => e));
|
|
9173
9185
|
}
|
|
9174
9186
|
get markViews() {
|
|
9175
|
-
let { editor: e } = this, { markExtensions: t } =
|
|
9187
|
+
let { editor: e } = this, { markExtensions: t } = Ul(this.extensions);
|
|
9176
9188
|
return Object.fromEntries(t.filter((e) => !!U(e, "addMarkView")).map((t) => {
|
|
9177
9189
|
let n = this.attributes.filter((e) => e.type === t.name), r = U(t, "addMarkView", {
|
|
9178
9190
|
name: t.name,
|
|
9179
9191
|
options: t.options,
|
|
9180
9192
|
storage: this.editor.extensionStorage[t.name],
|
|
9181
9193
|
editor: e,
|
|
9182
|
-
type:
|
|
9194
|
+
type: Bc(t.name, this.schema)
|
|
9183
9195
|
});
|
|
9184
9196
|
return r ? [t.name, (i, a, o) => {
|
|
9185
|
-
let s =
|
|
9197
|
+
let s = ql(i, n);
|
|
9186
9198
|
return r()({
|
|
9187
9199
|
mark: i,
|
|
9188
9200
|
view: a,
|
|
@@ -9214,7 +9226,7 @@ var bd = class {
|
|
|
9214
9226
|
options: e.options,
|
|
9215
9227
|
storage: this.editor.extensionStorage[e.name],
|
|
9216
9228
|
editor: this.editor,
|
|
9217
|
-
type:
|
|
9229
|
+
type: _u(e.name, this.schema)
|
|
9218
9230
|
};
|
|
9219
9231
|
e.type === "mark" && (W(U(e, "keepOnSplit", t)) ?? !0) && this.splittableMarks.push(e.name);
|
|
9220
9232
|
let n = U(e, "onBeforeCreate", t), r = U(e, "onCreate", t), i = U(e, "onUpdate", t), a = U(e, "onSelectionUpdate", t), o = U(e, "onTransaction", t), s = U(e, "onFocus", t), c = U(e, "onBlur", t), l = U(e, "onDestroy", t);
|
|
@@ -9222,22 +9234,22 @@ var bd = class {
|
|
|
9222
9234
|
});
|
|
9223
9235
|
}
|
|
9224
9236
|
};
|
|
9225
|
-
|
|
9226
|
-
var
|
|
9227
|
-
gc(
|
|
9228
|
-
ClipboardTextSerializer: () =>
|
|
9229
|
-
Commands: () =>
|
|
9230
|
-
Delete: () =>
|
|
9231
|
-
Drop: () =>
|
|
9232
|
-
Editable: () =>
|
|
9233
|
-
FocusEvents: () =>
|
|
9234
|
-
Keymap: () =>
|
|
9235
|
-
Paste: () =>
|
|
9236
|
-
Tabindex: () =>
|
|
9237
|
-
TextDirection: () =>
|
|
9238
|
-
focusEventsPluginKey: () =>
|
|
9237
|
+
Cd.resolve = tu, Cd.sort = eu, Cd.flatten = zl;
|
|
9238
|
+
var wd = {};
|
|
9239
|
+
gc(wd, {
|
|
9240
|
+
ClipboardTextSerializer: () => Td,
|
|
9241
|
+
Commands: () => Ed,
|
|
9242
|
+
Delete: () => Dd,
|
|
9243
|
+
Drop: () => Od,
|
|
9244
|
+
Editable: () => kd,
|
|
9245
|
+
FocusEvents: () => jd,
|
|
9246
|
+
Keymap: () => Md,
|
|
9247
|
+
Paste: () => Nd,
|
|
9248
|
+
Tabindex: () => Pd,
|
|
9249
|
+
TextDirection: () => Fd,
|
|
9250
|
+
focusEventsPluginKey: () => Ad
|
|
9239
9251
|
});
|
|
9240
|
-
var K = class e extends
|
|
9252
|
+
var K = class e extends md {
|
|
9241
9253
|
constructor() {
|
|
9242
9254
|
super(...arguments), this.type = "extension";
|
|
9243
9255
|
}
|
|
@@ -9251,7 +9263,7 @@ var K = class e extends dd {
|
|
|
9251
9263
|
let t = typeof e == "function" ? e() : e;
|
|
9252
9264
|
return super.extend(t);
|
|
9253
9265
|
}
|
|
9254
|
-
},
|
|
9266
|
+
}, Td = K.create({
|
|
9255
9267
|
name: "clipboardTextSerializer",
|
|
9256
9268
|
addOptions() {
|
|
9257
9269
|
return { blockSeparator: void 0 };
|
|
@@ -9260,8 +9272,8 @@ var K = class e extends dd {
|
|
|
9260
9272
|
return [new j({
|
|
9261
9273
|
key: new M("clipboardTextSerializer"),
|
|
9262
9274
|
props: { clipboardTextSerializer: () => {
|
|
9263
|
-
let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, { ranges: a } = i, o = Math.min(...a.map((e) => e.$from.pos)), s = Math.max(...a.map((e) => e.$to.pos)), c =
|
|
9264
|
-
return
|
|
9275
|
+
let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, { ranges: a } = i, o = Math.min(...a.map((e) => e.$from.pos)), s = Math.max(...a.map((e) => e.$to.pos)), c = su(n);
|
|
9276
|
+
return au(r, {
|
|
9265
9277
|
from: o,
|
|
9266
9278
|
to: s
|
|
9267
9279
|
}, {
|
|
@@ -9271,19 +9283,19 @@ var K = class e extends dd {
|
|
|
9271
9283
|
} }
|
|
9272
9284
|
})];
|
|
9273
9285
|
}
|
|
9274
|
-
}),
|
|
9286
|
+
}), Ed = K.create({
|
|
9275
9287
|
name: "commands",
|
|
9276
9288
|
addCommands() {
|
|
9277
9289
|
return { ...yc };
|
|
9278
9290
|
}
|
|
9279
|
-
}),
|
|
9291
|
+
}), Dd = K.create({
|
|
9280
9292
|
name: "delete",
|
|
9281
9293
|
onUpdate({ transaction: e, appendedTransactions: t }) {
|
|
9282
9294
|
let n = () => {
|
|
9283
9295
|
var n;
|
|
9284
9296
|
if (((n = this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n, e) ?? e.getMeta("y-sync$")) return;
|
|
9285
|
-
let r =
|
|
9286
|
-
|
|
9297
|
+
let r = Nl(e.before, [e, ...t]);
|
|
9298
|
+
pu(r).forEach((t) => {
|
|
9287
9299
|
r.mapping.mapResult(t.oldRange.from).deletedAfter && r.mapping.mapResult(t.oldRange.to).deletedBefore && r.before.nodesBetween(t.oldRange.from, t.oldRange.to, (n, i) => {
|
|
9288
9300
|
let a = i + n.nodeSize - 2, o = t.oldRange.from <= i && a <= t.oldRange.to;
|
|
9289
9301
|
this.editor.emit("delete", {
|
|
@@ -9329,7 +9341,7 @@ var K = class e extends dd {
|
|
|
9329
9341
|
};
|
|
9330
9342
|
this.editor.options.coreExtensionOptions?.delete?.async ?? !0 ? setTimeout(n, 0) : n();
|
|
9331
9343
|
}
|
|
9332
|
-
}),
|
|
9344
|
+
}), Od = K.create({
|
|
9333
9345
|
name: "drop",
|
|
9334
9346
|
addProseMirrorPlugins() {
|
|
9335
9347
|
return [new j({
|
|
@@ -9344,7 +9356,7 @@ var K = class e extends dd {
|
|
|
9344
9356
|
} }
|
|
9345
9357
|
})];
|
|
9346
9358
|
}
|
|
9347
|
-
}),
|
|
9359
|
+
}), kd = K.create({
|
|
9348
9360
|
name: "editable",
|
|
9349
9361
|
addProseMirrorPlugins() {
|
|
9350
9362
|
return [new j({
|
|
@@ -9352,12 +9364,12 @@ var K = class e extends dd {
|
|
|
9352
9364
|
props: { editable: () => this.editor.options.editable }
|
|
9353
9365
|
})];
|
|
9354
9366
|
}
|
|
9355
|
-
}),
|
|
9367
|
+
}), Ad = new M("focusEvents"), jd = K.create({
|
|
9356
9368
|
name: "focusEvents",
|
|
9357
9369
|
addProseMirrorPlugins() {
|
|
9358
9370
|
let { editor: e } = this;
|
|
9359
9371
|
return [new j({
|
|
9360
|
-
key:
|
|
9372
|
+
key: Ad,
|
|
9361
9373
|
props: { handleDOMEvents: {
|
|
9362
9374
|
focus: (t, n) => {
|
|
9363
9375
|
e.isFocused = !0;
|
|
@@ -9372,7 +9384,7 @@ var K = class e extends dd {
|
|
|
9372
9384
|
} }
|
|
9373
9385
|
})];
|
|
9374
9386
|
}
|
|
9375
|
-
}),
|
|
9387
|
+
}), Md = K.create({
|
|
9376
9388
|
name: "keymap",
|
|
9377
9389
|
addKeyboardShortcuts() {
|
|
9378
9390
|
let e = () => this.editor.commands.first(({ commands: e }) => [
|
|
@@ -9414,7 +9426,7 @@ var K = class e extends dd {
|
|
|
9414
9426
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
9415
9427
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
9416
9428
|
};
|
|
9417
|
-
return
|
|
9429
|
+
return qc() || fl() ? i : r;
|
|
9418
9430
|
},
|
|
9419
9431
|
addProseMirrorPlugins() {
|
|
9420
9432
|
return [new j({
|
|
@@ -9424,7 +9436,7 @@ var K = class e extends dd {
|
|
|
9424
9436
|
let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
|
|
9425
9437
|
if (!r || i) return;
|
|
9426
9438
|
let { empty: a, from: o, to: s } = t.selection, c = O.atStart(t.doc).from, l = O.atEnd(t.doc).to;
|
|
9427
|
-
if (a || !(o === c && s === l) || !
|
|
9439
|
+
if (a || !(o === c && s === l) || !Eu(n.doc)) return;
|
|
9428
9440
|
let u = n.tr, d = _c({
|
|
9429
9441
|
state: n,
|
|
9430
9442
|
transaction: u
|
|
@@ -9436,7 +9448,7 @@ var K = class e extends dd {
|
|
|
9436
9448
|
}
|
|
9437
9449
|
})];
|
|
9438
9450
|
}
|
|
9439
|
-
}),
|
|
9451
|
+
}), Nd = K.create({
|
|
9440
9452
|
name: "paste",
|
|
9441
9453
|
addProseMirrorPlugins() {
|
|
9442
9454
|
return [new j({
|
|
@@ -9450,7 +9462,7 @@ var K = class e extends dd {
|
|
|
9450
9462
|
} }
|
|
9451
9463
|
})];
|
|
9452
9464
|
}
|
|
9453
|
-
}),
|
|
9465
|
+
}), Pd = K.create({
|
|
9454
9466
|
name: "tabindex",
|
|
9455
9467
|
addOptions() {
|
|
9456
9468
|
return { value: void 0 };
|
|
@@ -9461,14 +9473,14 @@ var K = class e extends dd {
|
|
|
9461
9473
|
props: { attributes: () => !this.editor.isEditable && this.options.value === void 0 ? {} : { tabindex: this.options.value ?? "0" } }
|
|
9462
9474
|
})];
|
|
9463
9475
|
}
|
|
9464
|
-
}),
|
|
9476
|
+
}), Fd = K.create({
|
|
9465
9477
|
name: "textDirection",
|
|
9466
9478
|
addOptions() {
|
|
9467
9479
|
return { direction: void 0 };
|
|
9468
9480
|
},
|
|
9469
9481
|
addGlobalAttributes() {
|
|
9470
9482
|
if (!this.options.direction) return [];
|
|
9471
|
-
let { nodeExtensions: e } =
|
|
9483
|
+
let { nodeExtensions: e } = Ul(this.extensions);
|
|
9472
9484
|
return [{
|
|
9473
9485
|
types: e.filter((e) => e.name !== "text").map((e) => e.name),
|
|
9474
9486
|
attributes: { dir: {
|
|
@@ -9490,7 +9502,7 @@ var K = class e extends dd {
|
|
|
9490
9502
|
} }
|
|
9491
9503
|
})];
|
|
9492
9504
|
}
|
|
9493
|
-
}),
|
|
9505
|
+
}), Id = class e {
|
|
9494
9506
|
constructor(e, t, n = !1, r = null) {
|
|
9495
9507
|
this.currentNode = null, this.actualDepth = null, this.isBlock = n, this.resolvedPos = e, this.editor = t, this.currentNode = r;
|
|
9496
9508
|
}
|
|
@@ -9610,14 +9622,14 @@ var K = class e extends dd {
|
|
|
9610
9622
|
...e
|
|
9611
9623
|
}), this.editor.view.dispatch(t);
|
|
9612
9624
|
}
|
|
9613
|
-
},
|
|
9614
|
-
function
|
|
9625
|
+
}, Ld = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}";
|
|
9626
|
+
function Rd(e, t, n) {
|
|
9615
9627
|
let r = document.querySelector(`style[data-tiptap-style${n ? `-${n}` : ""}]`);
|
|
9616
9628
|
if (r !== null) return r;
|
|
9617
9629
|
let i = document.createElement("style");
|
|
9618
9630
|
return t && i.setAttribute("nonce", t), i.setAttribute(`data-tiptap-style${n ? `-${n}` : ""}`, ""), i.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(i), i;
|
|
9619
9631
|
}
|
|
9620
|
-
var
|
|
9632
|
+
var zd = class extends od {
|
|
9621
9633
|
constructor(e = {}) {
|
|
9622
9634
|
super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.destroyed = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
|
|
9623
9635
|
element: typeof document < "u" ? document.createElement("div") : null,
|
|
@@ -9654,10 +9666,10 @@ var Id = class extends rd {
|
|
|
9654
9666
|
onDelete: () => null,
|
|
9655
9667
|
enableExtensionDispatchTransaction: !0
|
|
9656
9668
|
}, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {
|
|
9657
|
-
getUpdatedPosition:
|
|
9658
|
-
createMappablePosition:
|
|
9669
|
+
getUpdatedPosition: Au,
|
|
9670
|
+
createMappablePosition: ju
|
|
9659
9671
|
}, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: t, moved: n }) => this.options.onDrop(e, t, n)), this.on("paste", ({ event: e, slice: t }) => this.options.onPaste(e, t)), this.on("delete", this.options.onDelete);
|
|
9660
|
-
let t = this.createDoc(), n =
|
|
9672
|
+
let t = this.createDoc(), n = Gc(t, this.options.autofocus);
|
|
9661
9673
|
this.editorState = Gn.create({
|
|
9662
9674
|
doc: t,
|
|
9663
9675
|
schema: this.schema,
|
|
@@ -9695,7 +9707,7 @@ var Id = class extends rd {
|
|
|
9695
9707
|
return this.commandManager.can();
|
|
9696
9708
|
}
|
|
9697
9709
|
injectCSS() {
|
|
9698
|
-
this.options.injectCSS && typeof document < "u" && (this.css =
|
|
9710
|
+
this.options.injectCSS && typeof document < "u" && (this.css = Rd(Ld, this.options.injectNonce));
|
|
9699
9711
|
}
|
|
9700
9712
|
setOptions(e = {}) {
|
|
9701
9713
|
this.options = {
|
|
@@ -9737,7 +9749,7 @@ var Id = class extends rd {
|
|
|
9737
9749
|
return this.editorView && (this.editorState = this.view.state), this.editorState;
|
|
9738
9750
|
}
|
|
9739
9751
|
registerPlugin(e, t) {
|
|
9740
|
-
let n =
|
|
9752
|
+
let n = Vl(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], r = this.state.reconfigure({ plugins: n });
|
|
9741
9753
|
return this.view.updateState(r), r;
|
|
9742
9754
|
}
|
|
9743
9755
|
unregisterPlugin(e) {
|
|
@@ -9752,22 +9764,22 @@ var Id = class extends rd {
|
|
|
9752
9764
|
}
|
|
9753
9765
|
createExtensionManager() {
|
|
9754
9766
|
let e = [...this.options.enableCoreExtensions ? [
|
|
9767
|
+
kd,
|
|
9768
|
+
Td.configure({ blockSeparator: this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator }),
|
|
9755
9769
|
Ed,
|
|
9756
|
-
|
|
9757
|
-
|
|
9770
|
+
jd,
|
|
9771
|
+
Md,
|
|
9772
|
+
Pd.configure({ value: this.options.coreExtensionOptions?.tabindex?.value }),
|
|
9758
9773
|
Od,
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
Ad,
|
|
9763
|
-
wd,
|
|
9764
|
-
Md.configure({ direction: this.options.textDirection })
|
|
9774
|
+
Nd,
|
|
9775
|
+
Dd,
|
|
9776
|
+
Fd.configure({ direction: this.options.textDirection })
|
|
9765
9777
|
].filter((e) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[e.name] !== !1 : !0) : [], ...this.options.extensions].filter((e) => [
|
|
9766
9778
|
"extension",
|
|
9767
9779
|
"node",
|
|
9768
9780
|
"mark"
|
|
9769
9781
|
].includes(e?.type));
|
|
9770
|
-
this.extensionManager = new
|
|
9782
|
+
this.extensionManager = new Cd(e, this);
|
|
9771
9783
|
}
|
|
9772
9784
|
createCommandManager() {
|
|
9773
9785
|
this.commandManager = new vc({ editor: this });
|
|
@@ -9778,7 +9790,7 @@ var Id = class extends rd {
|
|
|
9778
9790
|
createDoc() {
|
|
9779
9791
|
let e;
|
|
9780
9792
|
try {
|
|
9781
|
-
e =
|
|
9793
|
+
e = Al(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
|
|
9782
9794
|
} catch (t) {
|
|
9783
9795
|
if (!(t instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(t.message)) throw t;
|
|
9784
9796
|
this.emit("contentError", {
|
|
@@ -9787,7 +9799,7 @@ var Id = class extends rd {
|
|
|
9787
9799
|
disableCollaboration: () => {
|
|
9788
9800
|
"collaboration" in this.storage && typeof this.storage.collaboration == "object" && this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((e) => e.name !== "collaboration"), this.createExtensionManager();
|
|
9789
9801
|
}
|
|
9790
|
-
}), e =
|
|
9802
|
+
}), e = Al(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
9791
9803
|
}
|
|
9792
9804
|
return e;
|
|
9793
9805
|
}
|
|
@@ -9864,30 +9876,30 @@ var Id = class extends rd {
|
|
|
9864
9876
|
});
|
|
9865
9877
|
}
|
|
9866
9878
|
getAttributes(e) {
|
|
9867
|
-
return
|
|
9879
|
+
return uu(this.state, e);
|
|
9868
9880
|
}
|
|
9869
9881
|
isActive(e, t) {
|
|
9870
9882
|
let n = typeof e == "string" ? e : null, r = typeof e == "string" ? t : e;
|
|
9871
|
-
return
|
|
9883
|
+
return xu(this.state, n, r);
|
|
9872
9884
|
}
|
|
9873
9885
|
getJSON() {
|
|
9874
9886
|
return this.state.doc.toJSON();
|
|
9875
9887
|
}
|
|
9876
9888
|
getHTML() {
|
|
9877
|
-
return
|
|
9889
|
+
return Bl(this.state.doc.content, this.schema);
|
|
9878
9890
|
}
|
|
9879
9891
|
getText(e) {
|
|
9880
9892
|
let { blockSeparator: t = "\n\n", textSerializers: n = {} } = e || {};
|
|
9881
|
-
return
|
|
9893
|
+
return ou(this.state.doc, {
|
|
9882
9894
|
blockSeparator: t,
|
|
9883
9895
|
textSerializers: {
|
|
9884
|
-
...
|
|
9896
|
+
...su(this.schema),
|
|
9885
9897
|
...n
|
|
9886
9898
|
}
|
|
9887
9899
|
});
|
|
9888
9900
|
}
|
|
9889
9901
|
get isEmpty() {
|
|
9890
|
-
return
|
|
9902
|
+
return Eu(this.state.doc);
|
|
9891
9903
|
}
|
|
9892
9904
|
destroy() {
|
|
9893
9905
|
this.destroyed || (this.destroyed = !0, this.emit("destroy"), this.unmount(), this.removeAllListeners(), this.extensionManager.destroy(), this.extensionManager = null, this.schema = null, this.commandManager = null, this.extensionStorage = {});
|
|
@@ -9902,14 +9914,15 @@ var Id = class extends rd {
|
|
|
9902
9914
|
return this.$doc?.querySelectorAll(e, t) || null;
|
|
9903
9915
|
}
|
|
9904
9916
|
$pos(e) {
|
|
9905
|
-
|
|
9917
|
+
let t = this.state.doc.resolve(e), n = e > 0 && t.nodeAfter && !t.nodeAfter.isText ? t.nodeAfter : null;
|
|
9918
|
+
return new Id(t, this, !1, n);
|
|
9906
9919
|
}
|
|
9907
9920
|
get $doc() {
|
|
9908
9921
|
return this.$pos(0);
|
|
9909
9922
|
}
|
|
9910
9923
|
};
|
|
9911
|
-
function
|
|
9912
|
-
return new
|
|
9924
|
+
function Bd(e) {
|
|
9925
|
+
return new sd({
|
|
9913
9926
|
find: e.find,
|
|
9914
9927
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9915
9928
|
let i = W(e.getAttributes, void 0, r);
|
|
@@ -9917,7 +9930,7 @@ function Ld(e) {
|
|
|
9917
9930
|
let { tr: a } = t, o = r[r.length - 1], s = r[0];
|
|
9918
9931
|
if (o) {
|
|
9919
9932
|
let r = s.search(/\S/), c = n.from + s.indexOf(o), l = c + o.length;
|
|
9920
|
-
if (
|
|
9933
|
+
if (hu(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > c).length) return null;
|
|
9921
9934
|
l < n.to && a.delete(l, n.to), c > n.from && a.delete(n.from + r, c);
|
|
9922
9935
|
let u = n.from + r + o.length;
|
|
9923
9936
|
a.addMark(n.from + r, u, e.type.create(i || {})), a.removeStoredMark(e.type);
|
|
@@ -9926,8 +9939,8 @@ function Ld(e) {
|
|
|
9926
9939
|
undoable: e.undoable
|
|
9927
9940
|
});
|
|
9928
9941
|
}
|
|
9929
|
-
function
|
|
9930
|
-
return new
|
|
9942
|
+
function Vd(e) {
|
|
9943
|
+
return new sd({
|
|
9931
9944
|
find: e.find,
|
|
9932
9945
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9933
9946
|
let i = W(e.getAttributes, void 0, r) || {}, { tr: a } = t, o = n.from, s = n.to, c = e.type.create(i);
|
|
@@ -9945,8 +9958,8 @@ function Rd(e) {
|
|
|
9945
9958
|
undoable: e.undoable
|
|
9946
9959
|
});
|
|
9947
9960
|
}
|
|
9948
|
-
function
|
|
9949
|
-
return new
|
|
9961
|
+
function Hd(e) {
|
|
9962
|
+
return new sd({
|
|
9950
9963
|
find: e.find,
|
|
9951
9964
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9952
9965
|
let i = t.doc.resolve(n.from), a = W(e.getAttributes, void 0, r) || {};
|
|
@@ -9956,8 +9969,8 @@ function zd(e) {
|
|
|
9956
9969
|
undoable: e.undoable
|
|
9957
9970
|
});
|
|
9958
9971
|
}
|
|
9959
|
-
function
|
|
9960
|
-
return new
|
|
9972
|
+
function Ud(e) {
|
|
9973
|
+
return new sd({
|
|
9961
9974
|
find: e.find,
|
|
9962
9975
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9963
9976
|
let i = e.replace, a = n.from, o = n.to;
|
|
@@ -9972,8 +9985,8 @@ function Bd(e) {
|
|
|
9972
9985
|
undoable: e.undoable
|
|
9973
9986
|
});
|
|
9974
9987
|
}
|
|
9975
|
-
function
|
|
9976
|
-
return new
|
|
9988
|
+
function Wd(e) {
|
|
9989
|
+
return new sd({
|
|
9977
9990
|
find: e.find,
|
|
9978
9991
|
handler: ({ state: t, range: n, match: r, chain: i }) => {
|
|
9979
9992
|
let a = W(e.getAttributes, void 0, r) || {}, o = t.tr.delete(n.from, n.to), s = o.doc.resolve(n.from).blockRange(), c = s && Ht(s, e.type, a);
|
|
@@ -9995,10 +10008,10 @@ function Vd(e) {
|
|
|
9995
10008
|
undoable: e.undoable
|
|
9996
10009
|
});
|
|
9997
10010
|
}
|
|
9998
|
-
function
|
|
10011
|
+
function Gd(e) {
|
|
9999
10012
|
return e.children;
|
|
10000
10013
|
}
|
|
10001
|
-
var
|
|
10014
|
+
var Kd = (e, t) => {
|
|
10002
10015
|
if (e === "slot") return 0;
|
|
10003
10016
|
if (e instanceof Function) return e(t);
|
|
10004
10017
|
let { children: n, ...r } = t ?? {};
|
|
@@ -10008,7 +10021,7 @@ var Ud = (e, t) => {
|
|
|
10008
10021
|
r,
|
|
10009
10022
|
n
|
|
10010
10023
|
];
|
|
10011
|
-
},
|
|
10024
|
+
}, qd = (e) => "touches" in e, Jd = class {
|
|
10012
10025
|
constructor(e) {
|
|
10013
10026
|
this.directions = [
|
|
10014
10027
|
"bottom-left",
|
|
@@ -10097,7 +10110,7 @@ var Ud = (e, t) => {
|
|
|
10097
10110
|
e ? (this.element.style.width = `${e}px`, this.initialWidth = e) : this.initialWidth = this.element.offsetWidth, t ? (this.element.style.height = `${t}px`, this.initialHeight = t) : this.initialHeight = this.element.offsetHeight, this.initialWidth > 0 && this.initialHeight > 0 && (this.aspectRatio = this.initialWidth / this.initialHeight);
|
|
10098
10111
|
}
|
|
10099
10112
|
handleResizeStart(e, t) {
|
|
10100
|
-
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t,
|
|
10113
|
+
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, qd(e) ? (this.startX = e.touches[0].clientX, this.startY = e.touches[0].clientY) : (this.startX = e.clientX, this.startY = e.clientY), this.startWidth = this.element.offsetWidth, this.startHeight = this.element.offsetHeight, this.startWidth > 0 && this.startHeight > 0 && (this.aspectRatio = this.startWidth / this.startHeight), this.getPos(), this.container.dataset.resizeState = "true", this.classNames.resizing && this.container.classList.add(this.classNames.resizing), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchmove", this.handleTouchMove), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
|
|
10101
10114
|
}
|
|
10102
10115
|
handleResize(e, t) {
|
|
10103
10116
|
if (!this.activeHandle) return;
|
|
@@ -10137,8 +10150,8 @@ var Ud = (e, t) => {
|
|
|
10137
10150
|
height: e / this.aspectRatio
|
|
10138
10151
|
};
|
|
10139
10152
|
}
|
|
10140
|
-
},
|
|
10141
|
-
function
|
|
10153
|
+
}, Yd = Jd;
|
|
10154
|
+
function Xd(e, t) {
|
|
10142
10155
|
let { selection: n } = e, { $from: r } = n;
|
|
10143
10156
|
if (n instanceof A) {
|
|
10144
10157
|
let e = r.index();
|
|
@@ -10152,10 +10165,10 @@ function qd(e, t) {
|
|
|
10152
10165
|
}
|
|
10153
10166
|
return !1;
|
|
10154
10167
|
}
|
|
10155
|
-
function
|
|
10168
|
+
function Zd(e) {
|
|
10156
10169
|
return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
10157
10170
|
}
|
|
10158
|
-
function
|
|
10171
|
+
function Qd(e, t) {
|
|
10159
10172
|
let n = e.getAttribute("style");
|
|
10160
10173
|
if (!n) return null;
|
|
10161
10174
|
let r = n.split(";").map((e) => e.trim()).filter(Boolean), i = t.toLowerCase();
|
|
@@ -10165,29 +10178,29 @@ function Yd(e, t) {
|
|
|
10165
10178
|
}
|
|
10166
10179
|
return null;
|
|
10167
10180
|
}
|
|
10168
|
-
function
|
|
10181
|
+
function $d(e) {
|
|
10169
10182
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/&/g, "&");
|
|
10170
10183
|
}
|
|
10171
|
-
function
|
|
10184
|
+
function ef(e) {
|
|
10172
10185
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
10173
10186
|
}
|
|
10174
|
-
function
|
|
10187
|
+
function tf() {
|
|
10175
10188
|
return typeof navigator < "u" ? /Firefox/.test(navigator.userAgent) : !1;
|
|
10176
10189
|
}
|
|
10177
|
-
function
|
|
10190
|
+
function nf(e) {
|
|
10178
10191
|
return typeof e == "string";
|
|
10179
10192
|
}
|
|
10180
|
-
var
|
|
10181
|
-
gc(
|
|
10182
|
-
createAtomBlockMarkdownSpec: () =>
|
|
10183
|
-
createBlockMarkdownSpec: () =>
|
|
10184
|
-
createInlineMarkdownSpec: () =>
|
|
10185
|
-
parseAttributes: () =>
|
|
10186
|
-
parseIndentedBlocks: () =>
|
|
10187
|
-
renderNestedMarkdownContent: () =>
|
|
10188
|
-
serializeAttributes: () =>
|
|
10193
|
+
var rf = {};
|
|
10194
|
+
gc(rf, {
|
|
10195
|
+
createAtomBlockMarkdownSpec: () => sf,
|
|
10196
|
+
createBlockMarkdownSpec: () => cf,
|
|
10197
|
+
createInlineMarkdownSpec: () => df,
|
|
10198
|
+
parseAttributes: () => af,
|
|
10199
|
+
parseIndentedBlocks: () => ff,
|
|
10200
|
+
renderNestedMarkdownContent: () => pf,
|
|
10201
|
+
serializeAttributes: () => of
|
|
10189
10202
|
});
|
|
10190
|
-
function
|
|
10203
|
+
function af(e) {
|
|
10191
10204
|
if (!e?.trim()) return {};
|
|
10192
10205
|
let t = {}, n = [], r = e.replace(/["']([^"']*)["']/g, (e) => (n.push(e), `__QUOTED_${n.length - 1}__`)), i = r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
|
|
10193
10206
|
i && (t.class = i.map((e) => e.trim().slice(1)).join(" "));
|
|
@@ -10201,15 +10214,15 @@ function tf(e) {
|
|
|
10201
10214
|
e.match(/^[a-zA-Z][\w-]*$/) && (t[e] = !0);
|
|
10202
10215
|
}), t;
|
|
10203
10216
|
}
|
|
10204
|
-
function
|
|
10217
|
+
function of(e) {
|
|
10205
10218
|
if (!e || Object.keys(e).length === 0) return "";
|
|
10206
10219
|
let t = [];
|
|
10207
10220
|
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]) => {
|
|
10208
10221
|
e === "class" || e === "id" || (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
|
|
10209
10222
|
}), t.join(" ");
|
|
10210
10223
|
}
|
|
10211
|
-
function
|
|
10212
|
-
let { nodeName: t, name: n, parseAttributes: r =
|
|
10224
|
+
function sf(e) {
|
|
10225
|
+
let { nodeName: t, name: n, parseAttributes: r = af, serializeAttributes: i = of, defaultAttributes: a = {}, requiredAttributes: o = [], allowedAttributes: s } = e, c = n || t, l = (e) => {
|
|
10213
10226
|
if (!s) return e;
|
|
10214
10227
|
let t = {};
|
|
10215
10228
|
return s.forEach((n) => {
|
|
@@ -10245,8 +10258,8 @@ function rf(e) {
|
|
|
10245
10258
|
}
|
|
10246
10259
|
};
|
|
10247
10260
|
}
|
|
10248
|
-
function
|
|
10249
|
-
let { nodeName: t, name: n, getContent: r, parseAttributes: i =
|
|
10261
|
+
function cf(e) {
|
|
10262
|
+
let { nodeName: t, name: n, getContent: r, parseAttributes: i = af, serializeAttributes: a = of, defaultAttributes: o = {}, content: s = "block", allowedAttributes: c } = e, l = n || t, u = (e) => {
|
|
10250
10263
|
if (!c) return e;
|
|
10251
10264
|
let t = {};
|
|
10252
10265
|
return c.forEach((n) => {
|
|
@@ -10319,7 +10332,7 @@ ${t.renderChildren(e.content || [], "\n\n")}
|
|
|
10319
10332
|
}
|
|
10320
10333
|
};
|
|
10321
10334
|
}
|
|
10322
|
-
function
|
|
10335
|
+
function lf(e) {
|
|
10323
10336
|
if (!e.trim()) return {};
|
|
10324
10337
|
let t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g, r = n.exec(e);
|
|
10325
10338
|
for (; r !== null;) {
|
|
@@ -10328,11 +10341,11 @@ function of(e) {
|
|
|
10328
10341
|
}
|
|
10329
10342
|
return t;
|
|
10330
10343
|
}
|
|
10331
|
-
function
|
|
10344
|
+
function uf(e) {
|
|
10332
10345
|
return Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e}="${t}"`).join(" ");
|
|
10333
10346
|
}
|
|
10334
|
-
function
|
|
10335
|
-
let { nodeName: t, name: n, getContent: r, parseAttributes: i =
|
|
10347
|
+
function df(e) {
|
|
10348
|
+
let { nodeName: t, name: n, getContent: r, parseAttributes: i = lf, serializeAttributes: a = uf, defaultAttributes: o = {}, selfClosing: s = !1, allowedAttributes: c } = e, l = n || t, u = (e) => {
|
|
10336
10349
|
if (!c) return e;
|
|
10337
10350
|
let t = {};
|
|
10338
10351
|
return c.forEach((n) => {
|
|
@@ -10389,7 +10402,7 @@ function cf(e) {
|
|
|
10389
10402
|
}
|
|
10390
10403
|
};
|
|
10391
10404
|
}
|
|
10392
|
-
function
|
|
10405
|
+
function ff(e, t, n) {
|
|
10393
10406
|
let r = e.split("\n"), i = [], a = "", o = 0, s = t.baseIndentSize || 2;
|
|
10394
10407
|
for (; o < r.length;) {
|
|
10395
10408
|
let e = r[o], c = e.match(t.itemPattern);
|
|
@@ -10433,7 +10446,7 @@ function lf(e, t, n) {
|
|
|
10433
10446
|
raw: a
|
|
10434
10447
|
};
|
|
10435
10448
|
}
|
|
10436
|
-
function
|
|
10449
|
+
function pf(e, t, n, r) {
|
|
10437
10450
|
if (!e || !Array.isArray(e.content)) return "";
|
|
10438
10451
|
let i = typeof n == "function" ? n(r) : n, [a, ...o] = e.content, s = `${i}${t.renderChildren([a])}`;
|
|
10439
10452
|
return o && o.length > 0 && o.forEach((e, n) => {
|
|
@@ -10447,27 +10460,6 @@ ${n}`;
|
|
|
10447
10460
|
}
|
|
10448
10461
|
}), s;
|
|
10449
10462
|
}
|
|
10450
|
-
var df = /* @__PURE__ */ new WeakMap();
|
|
10451
|
-
function ff(e, t) {
|
|
10452
|
-
let n = df.get(e);
|
|
10453
|
-
if (!n) {
|
|
10454
|
-
let t = {
|
|
10455
|
-
callbacks: /* @__PURE__ */ new Set(),
|
|
10456
|
-
rafId: null,
|
|
10457
|
-
handler: () => {
|
|
10458
|
-
t.rafId !== null && cancelAnimationFrame(t.rafId), t.rafId = requestAnimationFrame(() => {
|
|
10459
|
-
t.rafId = null, t.callbacks.forEach((e) => e());
|
|
10460
|
-
});
|
|
10461
|
-
}
|
|
10462
|
-
};
|
|
10463
|
-
df.set(e, t), e.on("update", t.handler), n = t;
|
|
10464
|
-
}
|
|
10465
|
-
n.callbacks.add(t);
|
|
10466
|
-
}
|
|
10467
|
-
function pf(e, t) {
|
|
10468
|
-
let n = df.get(e);
|
|
10469
|
-
n && (n.callbacks.delete(t), n.callbacks.size === 0 && (n.rafId !== null && cancelAnimationFrame(n.rafId), e.off("update", n.handler), df.delete(e)));
|
|
10470
|
-
}
|
|
10471
10463
|
function mf(e, t, n = {}) {
|
|
10472
10464
|
let { state: r } = t, { doc: i, tr: a } = r, o = e;
|
|
10473
10465
|
i.descendants((t, r) => {
|
|
@@ -10502,9 +10494,9 @@ var hf = class {
|
|
|
10502
10494
|
mf(t || this.mark, this.editor, e);
|
|
10503
10495
|
}
|
|
10504
10496
|
ignoreMutation(e) {
|
|
10505
|
-
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (
|
|
10497
|
+
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (qc() || Kc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
|
|
10506
10498
|
}
|
|
10507
|
-
}, q = class e extends
|
|
10499
|
+
}, q = class e extends md {
|
|
10508
10500
|
constructor() {
|
|
10509
10501
|
super(...arguments), this.type = "node";
|
|
10510
10502
|
}
|
|
@@ -10589,7 +10581,7 @@ var hf = class {
|
|
|
10589
10581
|
return !(o || r || i || l || u || d || f && c);
|
|
10590
10582
|
}
|
|
10591
10583
|
ignoreMutation(e) {
|
|
10592
|
-
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (
|
|
10584
|
+
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (qc() || Kc()) && this.editor.isFocused && [...Array.from(e.addedNodes), ...Array.from(e.removedNodes)].every((e) => e.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
|
|
10593
10585
|
}
|
|
10594
10586
|
updateAttributes(e) {
|
|
10595
10587
|
this.editor.commands.command(({ tr: t }) => {
|
|
@@ -10611,7 +10603,7 @@ var hf = class {
|
|
|
10611
10603
|
}
|
|
10612
10604
|
};
|
|
10613
10605
|
function _f(e) {
|
|
10614
|
-
return new
|
|
10606
|
+
return new _d({
|
|
10615
10607
|
find: e.find,
|
|
10616
10608
|
handler: ({ state: t, range: n, match: r, pasteEvent: i }) => {
|
|
10617
10609
|
let a = W(e.getAttributes, void 0, r, i);
|
|
@@ -10619,14 +10611,14 @@ function _f(e) {
|
|
|
10619
10611
|
let { tr: o } = t, s = r[r.length - 1], c = r[0], l = n.to;
|
|
10620
10612
|
if (s) {
|
|
10621
10613
|
let i = c.search(/\S/), u = n.from + c.indexOf(s), d = u + s.length;
|
|
10622
|
-
if (
|
|
10614
|
+
if (hu(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > u).length) return null;
|
|
10623
10615
|
d < n.to && o.delete(d, n.to), u > n.from && o.delete(n.from + i, u), l = n.from + i + s.length, o.addMark(n.from + i, l, e.type.create(a || {})), r.index !== void 0 && r.input !== void 0 && r.index + r[0].length >= r.input.length || o.removeStoredMark(e.type);
|
|
10624
10616
|
}
|
|
10625
10617
|
}
|
|
10626
10618
|
});
|
|
10627
10619
|
}
|
|
10628
10620
|
function vf(e) {
|
|
10629
|
-
return new
|
|
10621
|
+
return new _d({
|
|
10630
10622
|
find: e.find,
|
|
10631
10623
|
handler({ match: t, chain: n, range: r, pasteEvent: i }) {
|
|
10632
10624
|
let a = W(e.getAttributes, void 0, t, i), o = W(e.getContent, void 0, a);
|
|
@@ -10640,7 +10632,7 @@ function vf(e) {
|
|
|
10640
10632
|
});
|
|
10641
10633
|
}
|
|
10642
10634
|
function yf(e) {
|
|
10643
|
-
return new
|
|
10635
|
+
return new _d({
|
|
10644
10636
|
find: e.find,
|
|
10645
10637
|
handler: ({ state: t, range: n, match: r }) => {
|
|
10646
10638
|
let i = e.replace, a = n.from, o = n.to;
|
|
@@ -10688,7 +10680,7 @@ var bf = class {
|
|
|
10688
10680
|
let t = e.getAttribute("style"), n = (e.parentElement?.closest("span"))?.getAttribute("style");
|
|
10689
10681
|
e.setAttribute("style", `${n};${t}`);
|
|
10690
10682
|
});
|
|
10691
|
-
}, Tf =
|
|
10683
|
+
}, Tf = hd.create({
|
|
10692
10684
|
name: "textStyle",
|
|
10693
10685
|
priority: 101,
|
|
10694
10686
|
addOptions() {
|
|
@@ -10733,7 +10725,7 @@ var bf = class {
|
|
|
10733
10725
|
types: this.options.types,
|
|
10734
10726
|
attributes: { backgroundColor: {
|
|
10735
10727
|
default: null,
|
|
10736
|
-
parseHTML: (e) => (
|
|
10728
|
+
parseHTML: (e) => (Qd(e, "background-color") ?? e.style.backgroundColor)?.replace(/['"]+/g, ""),
|
|
10737
10729
|
renderHTML: (e) => e.backgroundColor ? { style: `background-color: ${e.backgroundColor}` } : {}
|
|
10738
10730
|
} }
|
|
10739
10731
|
}];
|
|
@@ -10754,7 +10746,7 @@ var bf = class {
|
|
|
10754
10746
|
types: this.options.types,
|
|
10755
10747
|
attributes: { color: {
|
|
10756
10748
|
default: null,
|
|
10757
|
-
parseHTML: (e) => (
|
|
10749
|
+
parseHTML: (e) => (Qd(e, "color") ?? e.style.color)?.replace(/['"]+/g, ""),
|
|
10758
10750
|
renderHTML: (e) => e.color ? { style: `color: ${e.color}` } : {}
|
|
10759
10751
|
} }
|
|
10760
10752
|
}];
|
|
@@ -10775,7 +10767,7 @@ var bf = class {
|
|
|
10775
10767
|
types: this.options.types,
|
|
10776
10768
|
attributes: { fontFamily: {
|
|
10777
10769
|
default: null,
|
|
10778
|
-
parseHTML: (e) =>
|
|
10770
|
+
parseHTML: (e) => Qd(e, "font-family") ?? e.style.fontFamily,
|
|
10779
10771
|
renderHTML: (e) => e.fontFamily ? { style: `font-family: ${e.fontFamily}` } : {}
|
|
10780
10772
|
} }
|
|
10781
10773
|
}];
|
|
@@ -10796,7 +10788,7 @@ var bf = class {
|
|
|
10796
10788
|
types: this.options.types,
|
|
10797
10789
|
attributes: { fontSize: {
|
|
10798
10790
|
default: null,
|
|
10799
|
-
parseHTML: (e) =>
|
|
10791
|
+
parseHTML: (e) => Qd(e, "font-size") ?? e.style.fontSize,
|
|
10800
10792
|
renderHTML: (e) => e.fontSize ? { style: `font-size: ${e.fontSize}` } : {}
|
|
10801
10793
|
} }
|
|
10802
10794
|
}];
|
|
@@ -10817,7 +10809,7 @@ var bf = class {
|
|
|
10817
10809
|
types: this.options.types,
|
|
10818
10810
|
attributes: { lineHeight: {
|
|
10819
10811
|
default: null,
|
|
10820
|
-
parseHTML: (e) =>
|
|
10812
|
+
parseHTML: (e) => Qd(e, "line-height") ?? e.style.lineHeight,
|
|
10821
10813
|
renderHTML: (e) => e.lineHeight ? { style: `line-height: ${e.lineHeight}` } : {}
|
|
10822
10814
|
} }
|
|
10823
10815
|
}];
|
|
@@ -10845,7 +10837,7 @@ var bf = class {
|
|
|
10845
10837
|
default: () => Bf,
|
|
10846
10838
|
inputRegex: () => Lf,
|
|
10847
10839
|
pasteRegex: () => Rf
|
|
10848
|
-
}), Lf = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Rf = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, zf =
|
|
10840
|
+
}), Lf = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Rf = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, zf = hd.create({
|
|
10849
10841
|
name: "highlight",
|
|
10850
10842
|
addOptions() {
|
|
10851
10843
|
return {
|
|
@@ -10856,7 +10848,7 @@ var bf = class {
|
|
|
10856
10848
|
addAttributes() {
|
|
10857
10849
|
return this.options.multicolor ? { color: {
|
|
10858
10850
|
default: null,
|
|
10859
|
-
parseHTML: (e) => e.getAttribute("data-color") ||
|
|
10851
|
+
parseHTML: (e) => e.getAttribute("data-color") || Qd(e, "background-color") || e.style.backgroundColor,
|
|
10860
10852
|
renderHTML: (e) => e.color ? {
|
|
10861
10853
|
"data-color": e.color,
|
|
10862
10854
|
style: `background-color: ${e.color}; color: inherit`
|
|
@@ -10903,7 +10895,7 @@ var bf = class {
|
|
|
10903
10895
|
return { "Mod-Shift-h": () => this.editor.commands.toggleHighlight() };
|
|
10904
10896
|
},
|
|
10905
10897
|
addInputRules() {
|
|
10906
|
-
return [
|
|
10898
|
+
return [Bd({
|
|
10907
10899
|
find: Lf,
|
|
10908
10900
|
type: this.type
|
|
10909
10901
|
})];
|
|
@@ -11424,7 +11416,7 @@ function Vm(e, t = null, n = null) {
|
|
|
11424
11416
|
return a;
|
|
11425
11417
|
}
|
|
11426
11418
|
//#endregion
|
|
11427
|
-
//#region ../../node_modules/.pnpm/@tiptap+extension-link@3.23.
|
|
11419
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-link@3.23.6_@tiptap+core@3.23.6_@tiptap+pm@3.23.6__@tiptap+pm@3.23.6/node_modules/@tiptap/extension-link/dist/index.js
|
|
11428
11420
|
var Hm = /* @__PURE__ */ e({
|
|
11429
11421
|
Link: () => $m,
|
|
11430
11422
|
default: () => eh,
|
|
@@ -11441,8 +11433,8 @@ function Jm(e) {
|
|
|
11441
11433
|
let i = t.some((e) => e.docChanged) && !n.doc.eq(r.doc), a = t.some((e) => e.getMeta("preventAutolink"));
|
|
11442
11434
|
if (!i || a) return;
|
|
11443
11435
|
let { tr: o } = r;
|
|
11444
|
-
if (
|
|
11445
|
-
let n =
|
|
11436
|
+
if (pu(Nl(n.doc, [...t])).forEach(({ newRange: t }) => {
|
|
11437
|
+
let n = Il(r.doc, t, (e) => e.isTextblock), i, a;
|
|
11446
11438
|
if (n.length > 1) i = n[0], a = r.doc.textBetween(i.pos, i.pos + i.node.nodeSize, void 0, " ");
|
|
11447
11439
|
else if (n.length) {
|
|
11448
11440
|
let e = r.doc.textBetween(t.from, t.to, " ", " ");
|
|
@@ -11461,7 +11453,7 @@ function Jm(e) {
|
|
|
11461
11453
|
from: s + e.start + 1,
|
|
11462
11454
|
to: s + e.end + 1
|
|
11463
11455
|
})).filter((e) => r.schema.marks.code ? !r.doc.rangeHasMark(e.from, e.to, r.schema.marks.code) : !0).filter((t) => e.validate(t.value)).filter((t) => e.shouldAutoLink(t.value)).forEach((t) => {
|
|
11464
|
-
|
|
11456
|
+
hu(t.from, t.to, r.doc).some((t) => t.mark.type === e.type) || o.addMark(t.from, t.to, e.type.create({ href: t.href }));
|
|
11465
11457
|
});
|
|
11466
11458
|
}
|
|
11467
11459
|
}), o.steps.length) return o;
|
|
@@ -11484,7 +11476,7 @@ function Ym(e) {
|
|
|
11484
11476
|
if (!i) return !1;
|
|
11485
11477
|
let a = !1;
|
|
11486
11478
|
if (e.enableClickSelection && (a = e.editor.commands.extendMarkRange(e.type.name)), e.openOnClick) {
|
|
11487
|
-
let n =
|
|
11479
|
+
let n = uu(t.state, e.type.name), r = i.href ?? n.href;
|
|
11488
11480
|
r && (window.open(r, i.target ?? n.target), a = !0);
|
|
11489
11481
|
}
|
|
11490
11482
|
return a;
|
|
@@ -11525,7 +11517,7 @@ function Qm(e, t) {
|
|
|
11525
11517
|
t && n.push(t);
|
|
11526
11518
|
}), !e || e.replace(Km, "").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`, "i"));
|
|
11527
11519
|
}
|
|
11528
|
-
var $m =
|
|
11520
|
+
var $m = hd.create({
|
|
11529
11521
|
name: "link",
|
|
11530
11522
|
priority: 1e3,
|
|
11531
11523
|
keepOnSplit: !1,
|
|
@@ -11693,7 +11685,7 @@ var $m = fd.create({
|
|
|
11693
11685
|
}), eh = $m, th = /* @__PURE__ */ e({
|
|
11694
11686
|
Subscript: () => nh,
|
|
11695
11687
|
default: () => rh
|
|
11696
|
-
}), nh =
|
|
11688
|
+
}), nh = hd.create({
|
|
11697
11689
|
name: "subscript",
|
|
11698
11690
|
addOptions() {
|
|
11699
11691
|
return { HTMLAttributes: {} };
|
|
@@ -11726,7 +11718,7 @@ var $m = fd.create({
|
|
|
11726
11718
|
}), rh = nh, ih = /* @__PURE__ */ e({
|
|
11727
11719
|
Superscript: () => ah,
|
|
11728
11720
|
default: () => oh
|
|
11729
|
-
}), ah =
|
|
11721
|
+
}), ah = hd.create({
|
|
11730
11722
|
name: "superscript",
|
|
11731
11723
|
addOptions() {
|
|
11732
11724
|
return { HTMLAttributes: {} };
|
|
@@ -11804,7 +11796,7 @@ var $m = fd.create({
|
|
|
11804
11796
|
}), lh = ch, uh = /* @__PURE__ */ e({
|
|
11805
11797
|
Underline: () => dh,
|
|
11806
11798
|
default: () => fh
|
|
11807
|
-
}), dh =
|
|
11799
|
+
}), dh = hd.create({
|
|
11808
11800
|
name: "underline",
|
|
11809
11801
|
addOptions() {
|
|
11810
11802
|
return { HTMLAttributes: {} };
|
|
@@ -11907,12 +11899,12 @@ var $m = fd.create({
|
|
|
11907
11899
|
return { "Mod-Shift-b": () => this.editor.commands.toggleBlockquote() };
|
|
11908
11900
|
},
|
|
11909
11901
|
addInputRules() {
|
|
11910
|
-
return [
|
|
11902
|
+
return [Wd({
|
|
11911
11903
|
find: mh,
|
|
11912
11904
|
type: this.type
|
|
11913
11905
|
})];
|
|
11914
11906
|
}
|
|
11915
|
-
}), gh = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, _h = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, vh = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, yh = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, bh =
|
|
11907
|
+
}), gh = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, _h = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, vh = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, yh = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, bh = hd.create({
|
|
11916
11908
|
name: "bold",
|
|
11917
11909
|
addOptions() {
|
|
11918
11910
|
return { HTMLAttributes: {} };
|
|
@@ -11961,10 +11953,10 @@ var $m = fd.create({
|
|
|
11961
11953
|
};
|
|
11962
11954
|
},
|
|
11963
11955
|
addInputRules() {
|
|
11964
|
-
return [
|
|
11956
|
+
return [Bd({
|
|
11965
11957
|
find: gh,
|
|
11966
11958
|
type: this.type
|
|
11967
|
-
}),
|
|
11959
|
+
}), Bd({
|
|
11968
11960
|
find: vh,
|
|
11969
11961
|
type: this.type
|
|
11970
11962
|
})];
|
|
@@ -11978,7 +11970,7 @@ var $m = fd.create({
|
|
|
11978
11970
|
type: this.type
|
|
11979
11971
|
})];
|
|
11980
11972
|
}
|
|
11981
|
-
}), xh = /(^|[^`])`([^`]+)`(?!`)$/, Sh = /(^|[^`])`([^`]+)`(?!`)/g, Ch =
|
|
11973
|
+
}), xh = /(^|[^`])`([^`]+)`(?!`)$/, Sh = /(^|[^`])`([^`]+)`(?!`)/g, Ch = hd.create({
|
|
11982
11974
|
name: "code",
|
|
11983
11975
|
addOptions() {
|
|
11984
11976
|
return { HTMLAttributes: {} };
|
|
@@ -12013,7 +12005,7 @@ var $m = fd.create({
|
|
|
12013
12005
|
return { "Mod-e": () => this.editor.commands.toggleCode() };
|
|
12014
12006
|
},
|
|
12015
12007
|
addInputRules() {
|
|
12016
|
-
return [
|
|
12008
|
+
return [Bd({
|
|
12017
12009
|
find: xh,
|
|
12018
12010
|
type: this.type
|
|
12019
12011
|
})];
|
|
@@ -12146,11 +12138,11 @@ var $m = fd.create({
|
|
|
12146
12138
|
};
|
|
12147
12139
|
},
|
|
12148
12140
|
addInputRules() {
|
|
12149
|
-
return [
|
|
12141
|
+
return [Hd({
|
|
12150
12142
|
find: Th,
|
|
12151
12143
|
type: this.type,
|
|
12152
12144
|
getAttributes: (e) => ({ language: e[1] })
|
|
12153
|
-
}),
|
|
12145
|
+
}), Hd({
|
|
12154
12146
|
find: Eh,
|
|
12155
12147
|
type: this.type,
|
|
12156
12148
|
getAttributes: (e) => ({ language: e[1] })
|
|
@@ -12272,7 +12264,7 @@ var $m = fd.create({
|
|
|
12272
12264
|
}), {});
|
|
12273
12265
|
},
|
|
12274
12266
|
addInputRules() {
|
|
12275
|
-
return this.options.levels.map((e) =>
|
|
12267
|
+
return this.options.levels.map((e) => Hd({
|
|
12276
12268
|
find: RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),
|
|
12277
12269
|
type: this.type,
|
|
12278
12270
|
getAttributes: { level: e }
|
|
@@ -12298,9 +12290,9 @@ var $m = fd.create({
|
|
|
12298
12290
|
renderMarkdown: () => "---",
|
|
12299
12291
|
addCommands() {
|
|
12300
12292
|
return { setHorizontalRule: () => ({ chain: e, state: t }) => {
|
|
12301
|
-
if (!
|
|
12293
|
+
if (!Xd(t, t.schema.nodes[this.name])) return !1;
|
|
12302
12294
|
let { selection: n } = t, { $to: r } = n, i = e();
|
|
12303
|
-
return
|
|
12295
|
+
return Du(n) ? i.insertContentAt(r.pos, { type: this.name }) : i.insertContent({ type: this.name }), i.command(({ state: e, tr: t, dispatch: n }) => {
|
|
12304
12296
|
if (n) {
|
|
12305
12297
|
let { $to: n } = t.selection, r = n.end();
|
|
12306
12298
|
if (n.nodeAfter) t.setSelection(n.nodeAfter.isTextblock ? k.create(t.doc, n.pos + 1) : n.nodeAfter.isBlock ? A.create(t.doc, n.pos) : k.create(t.doc, n.pos));
|
|
@@ -12315,12 +12307,12 @@ var $m = fd.create({
|
|
|
12315
12307
|
} };
|
|
12316
12308
|
},
|
|
12317
12309
|
addInputRules() {
|
|
12318
|
-
return [
|
|
12310
|
+
return [Vd({
|
|
12319
12311
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
12320
12312
|
type: this.type
|
|
12321
12313
|
})];
|
|
12322
12314
|
}
|
|
12323
|
-
}), Mh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Nh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Ph = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Fh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ih =
|
|
12315
|
+
}), Mh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Nh = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Ph = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Fh = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ih = hd.create({
|
|
12324
12316
|
name: "italic",
|
|
12325
12317
|
addOptions() {
|
|
12326
12318
|
return { HTMLAttributes: {} };
|
|
@@ -12367,10 +12359,10 @@ var $m = fd.create({
|
|
|
12367
12359
|
};
|
|
12368
12360
|
},
|
|
12369
12361
|
addInputRules() {
|
|
12370
|
-
return [
|
|
12362
|
+
return [Bd({
|
|
12371
12363
|
find: Mh,
|
|
12372
12364
|
type: this.type
|
|
12373
|
-
}),
|
|
12365
|
+
}), Bd({
|
|
12374
12366
|
find: Ph,
|
|
12375
12367
|
type: this.type
|
|
12376
12368
|
})];
|
|
@@ -12427,11 +12419,11 @@ var $m = fd.create({
|
|
|
12427
12419
|
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
12428
12420
|
},
|
|
12429
12421
|
addInputRules() {
|
|
12430
|
-
let e =
|
|
12422
|
+
let e = Wd({
|
|
12431
12423
|
find: Vh,
|
|
12432
12424
|
type: this.type
|
|
12433
12425
|
});
|
|
12434
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
12426
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = Wd({
|
|
12435
12427
|
find: Vh,
|
|
12436
12428
|
type: this.type,
|
|
12437
12429
|
keepMarks: this.options.keepMarks,
|
|
@@ -12507,7 +12499,7 @@ var Gh = q.create({
|
|
|
12507
12499
|
content: r
|
|
12508
12500
|
};
|
|
12509
12501
|
},
|
|
12510
|
-
renderMarkdown: (e, t, n) =>
|
|
12502
|
+
renderMarkdown: (e, t, n) => pf(e, t, (e) => e.parentType === "bulletList" ? "- " : e.parentType === "orderedList" ? `${(e.meta?.parentAttrs?.start || 1) + e.index}. ` : "- ", n),
|
|
12511
12503
|
addKeyboardShortcuts() {
|
|
12512
12504
|
return {
|
|
12513
12505
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -12538,7 +12530,7 @@ var Kh = (e, t) => {
|
|
|
12538
12530
|
}, qh = (e, t) => {
|
|
12539
12531
|
let n = Kh(e, t);
|
|
12540
12532
|
if (!n) return !1;
|
|
12541
|
-
let [, r] =
|
|
12533
|
+
let [, r] = gu(t, e, n.$pos.pos + 4);
|
|
12542
12534
|
return r;
|
|
12543
12535
|
}, Jh = (e, t, n) => {
|
|
12544
12536
|
let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
|
|
@@ -12555,7 +12547,7 @@ var Kh = (e, t) => {
|
|
|
12555
12547
|
}, Zh = (e, t, n) => {
|
|
12556
12548
|
if (e.commands.undoInputRule()) return !0;
|
|
12557
12549
|
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
12558
|
-
if (!
|
|
12550
|
+
if (!hl(e.state, t) && Jh(e.state, t, n)) {
|
|
12559
12551
|
let { $anchor: n } = e.state.selection, r = e.state.doc.resolve(n.before() - 1), i = [];
|
|
12560
12552
|
r.node().descendants((e, n) => {
|
|
12561
12553
|
e.type.name === t && i.push({
|
|
@@ -12571,7 +12563,7 @@ var Kh = (e, t) => {
|
|
|
12571
12563
|
to: n.end() + 1
|
|
12572
12564
|
}, o.end()).joinForward().run();
|
|
12573
12565
|
}
|
|
12574
|
-
if (!
|
|
12566
|
+
if (!hl(e.state, t) || !Cu(e.state)) return !1;
|
|
12575
12567
|
let r = Kh(t, e.state);
|
|
12576
12568
|
if (!r) return !1;
|
|
12577
12569
|
let i = e.state.doc.resolve(r.$pos.pos - 2).node(r.depth), a = Xh(t, e.state, i);
|
|
@@ -12583,7 +12575,7 @@ var Kh = (e, t) => {
|
|
|
12583
12575
|
let n = qh(e, t), r = Kh(e, t);
|
|
12584
12576
|
return !r || !n ? !1 : n < r.depth;
|
|
12585
12577
|
}, eg = (e, t) => {
|
|
12586
|
-
if (!
|
|
12578
|
+
if (!hl(e.state, t) || !Su(e.state, t)) return !1;
|
|
12587
12579
|
let { selection: n } = e.state, { $from: r, $to: i } = n;
|
|
12588
12580
|
return !n.empty && r.sameParent(i) ? !1 : Qh(t, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(t).joinBackward().run() : $h(t, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
12589
12581
|
}, tg = (e, t) => {
|
|
@@ -12822,13 +12814,13 @@ var ug = "listItem", dg = "textStyle", fg = /^(\d+)\.\s$/, pg = q.create({
|
|
|
12822
12814
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
12823
12815
|
},
|
|
12824
12816
|
addInputRules() {
|
|
12825
|
-
let e =
|
|
12817
|
+
let e = Wd({
|
|
12826
12818
|
find: fg,
|
|
12827
12819
|
type: this.type,
|
|
12828
12820
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
12829
12821
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
12830
12822
|
});
|
|
12831
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
12823
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = Wd({
|
|
12832
12824
|
find: fg,
|
|
12833
12825
|
type: this.type,
|
|
12834
12826
|
keepMarks: this.options.keepMarks,
|
|
@@ -12895,7 +12887,7 @@ var ug = "listItem", dg = "textStyle", fg = /^(\d+)\.\s$/, pg = q.create({
|
|
|
12895
12887
|
}
|
|
12896
12888
|
return t.createNode("taskItem", { checked: e.checked || !1 }, n);
|
|
12897
12889
|
},
|
|
12898
|
-
renderMarkdown: (e, t) =>
|
|
12890
|
+
renderMarkdown: (e, t) => pf(e, t, `- [${e.attrs?.checked ? "x" : " "}] `),
|
|
12899
12891
|
addKeyboardShortcuts() {
|
|
12900
12892
|
let e = {
|
|
12901
12893
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -12939,7 +12931,7 @@ var ug = "listItem", dg = "textStyle", fg = /^(\d+)\.\s$/, pg = q.create({
|
|
|
12939
12931
|
update: (e) => {
|
|
12940
12932
|
if (e.type !== this.type) return !1;
|
|
12941
12933
|
i.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, l(e);
|
|
12942
|
-
let t = r.extensionManager.attributes, n =
|
|
12934
|
+
let t = r.extensionManager.attributes, n = ql(e, t), a = new Set(Object.keys(n)), o = this.options.HTMLAttributes;
|
|
12943
12935
|
return u.forEach((e) => {
|
|
12944
12936
|
a.has(e) || (e in o ? i.setAttribute(e, o[e]) : i.removeAttribute(e));
|
|
12945
12937
|
}), Object.entries(n).forEach(([e, t]) => {
|
|
@@ -12950,7 +12942,7 @@ var ug = "listItem", dg = "textStyle", fg = /^(\d+)\.\s$/, pg = q.create({
|
|
|
12950
12942
|
};
|
|
12951
12943
|
},
|
|
12952
12944
|
addInputRules() {
|
|
12953
|
-
return [
|
|
12945
|
+
return [Wd({
|
|
12954
12946
|
find: mg,
|
|
12955
12947
|
type: this.type,
|
|
12956
12948
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
@@ -12992,7 +12984,7 @@ var ug = "listItem", dg = "textStyle", fg = /^(\d+)\.\s$/, pg = q.create({
|
|
|
12992
12984
|
},
|
|
12993
12985
|
tokenize(e, t, n) {
|
|
12994
12986
|
let r = (e) => {
|
|
12995
|
-
let t =
|
|
12987
|
+
let t = ff(e, {
|
|
12996
12988
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
12997
12989
|
extractItemData: (e) => ({
|
|
12998
12990
|
indentLevel: e[1].length,
|
|
@@ -13016,7 +13008,7 @@ var ug = "listItem", dg = "textStyle", fg = /^(\d+)\.\s$/, pg = q.create({
|
|
|
13016
13008
|
raw: t.raw,
|
|
13017
13009
|
items: t.items
|
|
13018
13010
|
}] : n.blockTokens(e);
|
|
13019
|
-
}, i =
|
|
13011
|
+
}, i = ff(e, {
|
|
13020
13012
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
13021
13013
|
extractItemData: (e) => ({
|
|
13022
13014
|
indentLevel: e[1].length,
|
|
@@ -13058,7 +13050,7 @@ K.create({
|
|
|
13058
13050
|
}
|
|
13059
13051
|
});
|
|
13060
13052
|
//#endregion
|
|
13061
|
-
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.23.
|
|
13053
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.23.6_@tiptap+core@3.23.6_@tiptap+pm@3.23.6_/node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
13062
13054
|
var _g = " ", vg = "\xA0", yg = q.create({
|
|
13063
13055
|
name: "paragraph",
|
|
13064
13056
|
priority: 1e3,
|
|
@@ -13094,7 +13086,7 @@ var _g = " ", vg = "\xA0", yg = q.create({
|
|
|
13094
13086
|
addKeyboardShortcuts() {
|
|
13095
13087
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
13096
13088
|
}
|
|
13097
|
-
}), bg = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, xg = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Sg =
|
|
13089
|
+
}), bg = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, xg = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Sg = hd.create({
|
|
13098
13090
|
name: "strike",
|
|
13099
13091
|
addOptions() {
|
|
13100
13092
|
return { HTMLAttributes: {} };
|
|
@@ -13132,7 +13124,7 @@ var _g = " ", vg = "\xA0", yg = q.create({
|
|
|
13132
13124
|
return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
|
|
13133
13125
|
},
|
|
13134
13126
|
addInputRules() {
|
|
13135
|
-
return [
|
|
13127
|
+
return [Bd({
|
|
13136
13128
|
find: bg,
|
|
13137
13129
|
type: this.type
|
|
13138
13130
|
})];
|
|
@@ -13818,17 +13810,92 @@ var s_ = K.create({
|
|
|
13818
13810
|
storage: e.storage
|
|
13819
13811
|
})) ?? null };
|
|
13820
13812
|
}
|
|
13821
|
-
})
|
|
13813
|
+
});
|
|
13814
|
+
function c_(e) {
|
|
13815
|
+
let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
|
|
13816
|
+
return o && u.push(l), ps.node(i, i + a.nodeSize, {
|
|
13817
|
+
class: u.join(" "),
|
|
13818
|
+
[r]: typeof n == "function" ? n({
|
|
13819
|
+
editor: t,
|
|
13820
|
+
node: a,
|
|
13821
|
+
pos: i,
|
|
13822
|
+
hasAnchor: s
|
|
13823
|
+
}) : n
|
|
13824
|
+
});
|
|
13825
|
+
}
|
|
13822
13826
|
function l_(e) {
|
|
13827
|
+
let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
|
|
13828
|
+
return /auto|scroll|overlay/.test(n);
|
|
13829
|
+
}
|
|
13830
|
+
function u_(e) {
|
|
13831
|
+
let t = e;
|
|
13832
|
+
for (; t;) {
|
|
13833
|
+
if (l_(t)) return t;
|
|
13834
|
+
let e = t.parentElement;
|
|
13835
|
+
if (!e) {
|
|
13836
|
+
let e = t.getRootNode();
|
|
13837
|
+
if (e instanceof ShadowRoot) {
|
|
13838
|
+
t = e.host;
|
|
13839
|
+
continue;
|
|
13840
|
+
}
|
|
13841
|
+
return window;
|
|
13842
|
+
}
|
|
13843
|
+
t = e;
|
|
13844
|
+
}
|
|
13845
|
+
return window;
|
|
13846
|
+
}
|
|
13847
|
+
function d_(e) {
|
|
13848
|
+
return e === window ? {
|
|
13849
|
+
top: 0,
|
|
13850
|
+
bottom: window.innerHeight
|
|
13851
|
+
} : e.getBoundingClientRect();
|
|
13852
|
+
}
|
|
13853
|
+
function f_({ doc: e, view: t, scrollContainer: n }) {
|
|
13854
|
+
let r = t.dom.getBoundingClientRect(), i = n ? d_(n) : {
|
|
13855
|
+
top: 0,
|
|
13856
|
+
bottom: window.innerHeight
|
|
13857
|
+
}, a = Math.max(r.top, i.top), o = Math.min(r.bottom, i.bottom);
|
|
13858
|
+
if (a >= o) return {
|
|
13859
|
+
top: 0,
|
|
13860
|
+
bottom: e.content.size
|
|
13861
|
+
};
|
|
13862
|
+
let s = getComputedStyle(t.dom).direction === "rtl" ? Math.max(r.right - 2, r.left + 2) : r.left + 2, c = t.posAtCoords({
|
|
13863
|
+
left: s,
|
|
13864
|
+
top: a + 2
|
|
13865
|
+
}), l = t.posAtCoords({
|
|
13866
|
+
left: s,
|
|
13867
|
+
top: o - 2
|
|
13868
|
+
});
|
|
13869
|
+
return {
|
|
13870
|
+
top: c ? c.pos : 0,
|
|
13871
|
+
bottom: l ? l.pos : e.content.size
|
|
13872
|
+
};
|
|
13873
|
+
}
|
|
13874
|
+
function p_(e, t) {
|
|
13875
|
+
let n = null;
|
|
13876
|
+
return {
|
|
13877
|
+
call: ((...r) => {
|
|
13878
|
+
n ||= (e(...r), setTimeout(() => {
|
|
13879
|
+
n = null;
|
|
13880
|
+
}, t));
|
|
13881
|
+
}),
|
|
13882
|
+
cancel: () => {
|
|
13883
|
+
n &&= (clearTimeout(n), null);
|
|
13884
|
+
}
|
|
13885
|
+
};
|
|
13886
|
+
}
|
|
13887
|
+
var m_ = "placeholder";
|
|
13888
|
+
function h_(e) {
|
|
13823
13889
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
13824
13890
|
}
|
|
13891
|
+
var g_ = new M("tiptap__placeholder");
|
|
13825
13892
|
K.create({
|
|
13826
13893
|
name: "placeholder",
|
|
13827
13894
|
addOptions() {
|
|
13828
13895
|
return {
|
|
13829
13896
|
emptyEditorClass: "is-editor-empty",
|
|
13830
13897
|
emptyNodeClass: "is-empty",
|
|
13831
|
-
dataAttribute:
|
|
13898
|
+
dataAttribute: m_,
|
|
13832
13899
|
placeholder: "Write something …",
|
|
13833
13900
|
showOnlyWhenEditable: !0,
|
|
13834
13901
|
showOnlyCurrent: !0,
|
|
@@ -13836,32 +13903,96 @@ K.create({
|
|
|
13836
13903
|
};
|
|
13837
13904
|
},
|
|
13838
13905
|
addProseMirrorPlugins() {
|
|
13839
|
-
let e = this.options.dataAttribute ? `data-${
|
|
13906
|
+
let e = this.options.dataAttribute ? `data-${h_(this.options.dataAttribute)}` : `data-${m_}`;
|
|
13840
13907
|
return [new j({
|
|
13841
|
-
|
|
13908
|
+
state: {
|
|
13909
|
+
init() {
|
|
13910
|
+
return {
|
|
13911
|
+
topPos: null,
|
|
13912
|
+
bottomPos: null
|
|
13913
|
+
};
|
|
13914
|
+
},
|
|
13915
|
+
apply(e, t) {
|
|
13916
|
+
let n = e.getMeta(g_);
|
|
13917
|
+
return n?.positions ? {
|
|
13918
|
+
topPos: n.positions.top,
|
|
13919
|
+
bottomPos: n.positions.bottom
|
|
13920
|
+
} : e.docChanged ? {
|
|
13921
|
+
topPos: t.topPos === null ? null : e.mapping.map(t.topPos),
|
|
13922
|
+
bottomPos: t.bottomPos === null ? null : e.mapping.map(t.bottomPos)
|
|
13923
|
+
} : t;
|
|
13924
|
+
}
|
|
13925
|
+
},
|
|
13926
|
+
key: g_,
|
|
13927
|
+
view(e) {
|
|
13928
|
+
let t = u_(e.dom), n = () => {
|
|
13929
|
+
let n = f_({
|
|
13930
|
+
view: e,
|
|
13931
|
+
doc: e.state.doc,
|
|
13932
|
+
scrollContainer: t
|
|
13933
|
+
}), r = g_.getState(e.state);
|
|
13934
|
+
if (r.topPos === n.top && r.bottomPos === n.bottom) return;
|
|
13935
|
+
let i = e.state.tr.setMeta(g_, { positions: n }).setMeta("tiptap__viewportUpdate", !0);
|
|
13936
|
+
e.dispatch(i);
|
|
13937
|
+
}, { call: r, cancel: i } = p_(n, 250), a = t;
|
|
13938
|
+
return a.addEventListener("scroll", r, { passive: !0 }), n(), {
|
|
13939
|
+
update(t, r) {
|
|
13940
|
+
e.state.doc.content.size !== r.doc.content.size && n();
|
|
13941
|
+
},
|
|
13942
|
+
destroy: () => {
|
|
13943
|
+
i(), a.removeEventListener("scroll", r);
|
|
13944
|
+
}
|
|
13945
|
+
};
|
|
13946
|
+
},
|
|
13842
13947
|
props: { decorations: ({ doc: t, selection: n }) => {
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
o && i.push(this.options.emptyEditorClass);
|
|
13852
|
-
let s = ps.node(n, n + t.nodeSize, {
|
|
13853
|
-
class: i.join(" "),
|
|
13854
|
-
[e]: typeof this.options.placeholder == "function" ? this.options.placeholder({
|
|
13855
|
-
editor: this.editor,
|
|
13948
|
+
if (!(this.editor.isEditable || !this.options.showOnlyWhenEditable)) return null;
|
|
13949
|
+
let { anchor: r } = n, i = [], a = this.editor.isEmpty;
|
|
13950
|
+
if (this.options.showOnlyCurrent && !this.options.includeChildren) {
|
|
13951
|
+
let n = t.resolve(r);
|
|
13952
|
+
if (n.depth > 0) {
|
|
13953
|
+
let t = n.node(1), o = n.before(1);
|
|
13954
|
+
if (t.type.isTextblock && Eu(t)) {
|
|
13955
|
+
let s = c_({
|
|
13856
13956
|
node: t,
|
|
13857
|
-
|
|
13858
|
-
hasAnchor: r
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
|
|
13957
|
+
dataAttribute: e,
|
|
13958
|
+
hasAnchor: r >= o && r <= o + t.nodeSize,
|
|
13959
|
+
placeholder: this.options.placeholder,
|
|
13960
|
+
classes: {
|
|
13961
|
+
emptyEditor: this.options.emptyEditorClass,
|
|
13962
|
+
emptyNode: this.options.emptyNodeClass
|
|
13963
|
+
},
|
|
13964
|
+
editor: this.editor,
|
|
13965
|
+
isEmptyDoc: a,
|
|
13966
|
+
pos: n.before(1)
|
|
13967
|
+
});
|
|
13968
|
+
i.push(s);
|
|
13969
|
+
}
|
|
13862
13970
|
}
|
|
13863
|
-
|
|
13864
|
-
|
|
13971
|
+
} else {
|
|
13972
|
+
let n = g_.getState(this.editor.state);
|
|
13973
|
+
t.nodesBetween(n.topPos ?? 0, n.bottomPos ?? t.content.size, (t, n) => {
|
|
13974
|
+
let o = r >= n && r <= n + t.nodeSize, s = !t.isLeaf && Eu(t);
|
|
13975
|
+
if (!t.type.isTextblock) return this.options.includeChildren;
|
|
13976
|
+
if ((o || !this.options.showOnlyCurrent) && s) {
|
|
13977
|
+
let r = c_({
|
|
13978
|
+
classes: {
|
|
13979
|
+
emptyEditor: this.options.emptyEditorClass,
|
|
13980
|
+
emptyNode: this.options.emptyNodeClass
|
|
13981
|
+
},
|
|
13982
|
+
editor: this.editor,
|
|
13983
|
+
isEmptyDoc: a,
|
|
13984
|
+
dataAttribute: e,
|
|
13985
|
+
hasAnchor: o,
|
|
13986
|
+
placeholder: this.options.placeholder,
|
|
13987
|
+
node: t,
|
|
13988
|
+
pos: n
|
|
13989
|
+
});
|
|
13990
|
+
i.push(r);
|
|
13991
|
+
}
|
|
13992
|
+
return this.options.includeChildren;
|
|
13993
|
+
});
|
|
13994
|
+
}
|
|
13995
|
+
return z.create(t, i);
|
|
13865
13996
|
} }
|
|
13866
13997
|
})];
|
|
13867
13998
|
}
|
|
@@ -13875,15 +14006,15 @@ K.create({
|
|
|
13875
14006
|
return [new j({
|
|
13876
14007
|
key: new M("selection"),
|
|
13877
14008
|
props: { decorations(n) {
|
|
13878
|
-
return n.selection.empty || e.isFocused || !e.isEditable ||
|
|
14009
|
+
return n.selection.empty || e.isFocused || !e.isEditable || Du(n.selection) || e.view.dragging ? null : z.create(n.doc, [ps.inline(n.selection.from, n.selection.to, { class: t.className })]);
|
|
13879
14010
|
} }
|
|
13880
14011
|
})];
|
|
13881
14012
|
}
|
|
13882
14013
|
});
|
|
13883
|
-
function
|
|
14014
|
+
function __({ types: e, node: t }) {
|
|
13884
14015
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
13885
14016
|
}
|
|
13886
|
-
var
|
|
14017
|
+
var v_ = K.create({
|
|
13887
14018
|
name: "trailingNode",
|
|
13888
14019
|
addOptions() {
|
|
13889
14020
|
return {
|
|
@@ -13902,7 +14033,7 @@ var d_ = K.create({
|
|
|
13902
14033
|
state: {
|
|
13903
14034
|
init: (e, t) => {
|
|
13904
14035
|
let r = t.tr.doc.lastChild;
|
|
13905
|
-
return !
|
|
14036
|
+
return !__({
|
|
13906
14037
|
node: r,
|
|
13907
14038
|
types: n
|
|
13908
14039
|
});
|
|
@@ -13910,7 +14041,7 @@ var d_ = K.create({
|
|
|
13910
14041
|
apply: (e, t) => {
|
|
13911
14042
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
13912
14043
|
let r = e.doc.lastChild;
|
|
13913
|
-
return !
|
|
14044
|
+
return !__({
|
|
13914
14045
|
node: r,
|
|
13915
14046
|
types: n
|
|
13916
14047
|
});
|
|
@@ -13918,7 +14049,7 @@ var d_ = K.create({
|
|
|
13918
14049
|
}
|
|
13919
14050
|
})];
|
|
13920
14051
|
}
|
|
13921
|
-
}),
|
|
14052
|
+
}), y_ = K.create({
|
|
13922
14053
|
name: "undoRedo",
|
|
13923
14054
|
addOptions() {
|
|
13924
14055
|
return {
|
|
@@ -13944,154 +14075,152 @@ var d_ = K.create({
|
|
|
13944
14075
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
13945
14076
|
};
|
|
13946
14077
|
}
|
|
13947
|
-
}),
|
|
13948
|
-
StarterKit: () =>
|
|
13949
|
-
default: () =>
|
|
13950
|
-
}),
|
|
14078
|
+
}), b_ = /* @__PURE__ */ e({
|
|
14079
|
+
StarterKit: () => x_,
|
|
14080
|
+
default: () => S_
|
|
14081
|
+
}), x_ = K.create({
|
|
13951
14082
|
name: "starterKit",
|
|
13952
14083
|
addExtensions() {
|
|
13953
14084
|
let e = [];
|
|
13954
|
-
return this.options.bold !== !1 && e.push(bh.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(hh.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Hh.configure(this.options.bulletList)), this.options.code !== !1 && e.push(Ch.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(Dh.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Oh.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(o_.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(s_.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(kh.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(Ah.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(
|
|
14085
|
+
return this.options.bold !== !1 && e.push(bh.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(hh.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Hh.configure(this.options.bulletList)), this.options.code !== !1 && e.push(Ch.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(Dh.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Oh.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(o_.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(s_.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(kh.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(Ah.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(y_.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(jh.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Ih.configure(this.options.italic)), this.options.listItem !== !1 && e.push(Gh.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(ng.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push($m.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(pg.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(yg.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(Sg.configure(this.options.strike)), this.options.text !== !1 && e.push(Cg.configure(this.options.text)), this.options.underline !== !1 && e.push(dh.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(v_.configure(this.options?.trailingNode)), e;
|
|
13955
14086
|
}
|
|
13956
|
-
}),
|
|
14087
|
+
}), S_ = x_, C_ = /* @__PURE__ */ e({
|
|
13957
14088
|
CommandManager: () => vc,
|
|
13958
|
-
Editor: () =>
|
|
13959
|
-
EditorContent: () =>
|
|
13960
|
-
Extendable: () =>
|
|
14089
|
+
Editor: () => T_,
|
|
14090
|
+
EditorContent: () => E_,
|
|
14091
|
+
Extendable: () => md,
|
|
13961
14092
|
Extension: () => K,
|
|
13962
|
-
Fragment: () =>
|
|
13963
|
-
InputRule: () =>
|
|
13964
|
-
MappablePosition: () =>
|
|
13965
|
-
Mark: () =>
|
|
14093
|
+
Fragment: () => Gd,
|
|
14094
|
+
InputRule: () => sd,
|
|
14095
|
+
MappablePosition: () => ku,
|
|
14096
|
+
Mark: () => hd,
|
|
13966
14097
|
MarkView: () => hf,
|
|
13967
|
-
MarkViewContent: () =>
|
|
14098
|
+
MarkViewContent: () => M_,
|
|
13968
14099
|
Node: () => q,
|
|
13969
|
-
NodePos: () =>
|
|
14100
|
+
NodePos: () => Id,
|
|
13970
14101
|
NodeView: () => gf,
|
|
13971
|
-
NodeViewContent: () =>
|
|
13972
|
-
NodeViewWrapper: () =>
|
|
13973
|
-
PasteRule: () =>
|
|
13974
|
-
ResizableNodeView: () =>
|
|
13975
|
-
ResizableNodeview: () =>
|
|
14102
|
+
NodeViewContent: () => D_,
|
|
14103
|
+
NodeViewWrapper: () => O_,
|
|
14104
|
+
PasteRule: () => _d,
|
|
14105
|
+
ResizableNodeView: () => Jd,
|
|
14106
|
+
ResizableNodeview: () => Yd,
|
|
13976
14107
|
Tracker: () => bf,
|
|
13977
|
-
VueMarkView: () =>
|
|
13978
|
-
VueMarkViewRenderer: () =>
|
|
13979
|
-
VueNodeViewRenderer: () =>
|
|
13980
|
-
VueRenderer: () =>
|
|
14108
|
+
VueMarkView: () => N_,
|
|
14109
|
+
VueMarkViewRenderer: () => P_,
|
|
14110
|
+
VueNodeViewRenderer: () => L_,
|
|
14111
|
+
VueRenderer: () => A_,
|
|
13981
14112
|
callOrReturn: () => W,
|
|
13982
|
-
canInsertNode: () =>
|
|
13983
|
-
|
|
13984
|
-
combineTransactionSteps: () => Al,
|
|
14113
|
+
canInsertNode: () => Xd,
|
|
14114
|
+
combineTransactionSteps: () => Nl,
|
|
13985
14115
|
commands: () => yc,
|
|
13986
|
-
createAtomBlockMarkdownSpec: () =>
|
|
13987
|
-
createBlockMarkdownSpec: () =>
|
|
14116
|
+
createAtomBlockMarkdownSpec: () => sf,
|
|
14117
|
+
createBlockMarkdownSpec: () => cf,
|
|
13988
14118
|
createChainableState: () => _c,
|
|
13989
|
-
createDocument: () =>
|
|
13990
|
-
createElement: () =>
|
|
13991
|
-
createInlineMarkdownSpec: () =>
|
|
13992
|
-
createMappablePosition: () =>
|
|
13993
|
-
createNodeFromContent: () =>
|
|
13994
|
-
createStyleTag: () =>
|
|
13995
|
-
decodeHtmlEntities: () =>
|
|
13996
|
-
defaultBlockAt: () =>
|
|
13997
|
-
deleteProps: () =>
|
|
13998
|
-
elementFromString: () =>
|
|
13999
|
-
encodeHtmlEntities: () =>
|
|
14000
|
-
escapeForRegEx: () =>
|
|
14001
|
-
extensions: () =>
|
|
14002
|
-
findChildren: () =>
|
|
14003
|
-
findChildrenInRange: () =>
|
|
14004
|
-
findDuplicates: () =>
|
|
14005
|
-
findParentNode: () =>
|
|
14006
|
-
findParentNodeClosestToPos: () =>
|
|
14007
|
-
flattenExtensions: () =>
|
|
14008
|
-
fromString: () =>
|
|
14009
|
-
generateHTML: () =>
|
|
14010
|
-
generateJSON: () =>
|
|
14011
|
-
generateText: () =>
|
|
14012
|
-
getAttributes: () =>
|
|
14013
|
-
getAttributesFromExtensions: () =>
|
|
14014
|
-
getChangedRanges: () =>
|
|
14015
|
-
getDebugJSON: () =>
|
|
14119
|
+
createDocument: () => Al,
|
|
14120
|
+
createElement: () => Kd,
|
|
14121
|
+
createInlineMarkdownSpec: () => df,
|
|
14122
|
+
createMappablePosition: () => ju,
|
|
14123
|
+
createNodeFromContent: () => el,
|
|
14124
|
+
createStyleTag: () => Rd,
|
|
14125
|
+
decodeHtmlEntities: () => $d,
|
|
14126
|
+
defaultBlockAt: () => Pl,
|
|
14127
|
+
deleteProps: () => xl,
|
|
14128
|
+
elementFromString: () => $c,
|
|
14129
|
+
encodeHtmlEntities: () => ef,
|
|
14130
|
+
escapeForRegEx: () => Zd,
|
|
14131
|
+
extensions: () => wd,
|
|
14132
|
+
findChildren: () => Fl,
|
|
14133
|
+
findChildrenInRange: () => Il,
|
|
14134
|
+
findDuplicates: () => $l,
|
|
14135
|
+
findParentNode: () => Rl,
|
|
14136
|
+
findParentNodeClosestToPos: () => Ll,
|
|
14137
|
+
flattenExtensions: () => zl,
|
|
14138
|
+
fromString: () => Jl,
|
|
14139
|
+
generateHTML: () => ru,
|
|
14140
|
+
generateJSON: () => iu,
|
|
14141
|
+
generateText: () => cu,
|
|
14142
|
+
getAttributes: () => uu,
|
|
14143
|
+
getAttributesFromExtensions: () => Wl,
|
|
14144
|
+
getChangedRanges: () => pu,
|
|
14145
|
+
getDebugJSON: () => mu,
|
|
14016
14146
|
getExtensionField: () => U,
|
|
14017
|
-
getHTMLFromFragment: () =>
|
|
14018
|
-
getMarkAttributes: () =>
|
|
14019
|
-
getMarkRange: () =>
|
|
14020
|
-
getMarkType: () =>
|
|
14021
|
-
getMarksBetween: () =>
|
|
14022
|
-
getNodeAtPosition: () =>
|
|
14023
|
-
getNodeAttributes: () =>
|
|
14147
|
+
getHTMLFromFragment: () => Bl,
|
|
14148
|
+
getMarkAttributes: () => Ml,
|
|
14149
|
+
getMarkRange: () => zc,
|
|
14150
|
+
getMarkType: () => Bc,
|
|
14151
|
+
getMarksBetween: () => hu,
|
|
14152
|
+
getNodeAtPosition: () => gu,
|
|
14153
|
+
getNodeAttributes: () => lu,
|
|
14024
14154
|
getNodeType: () => H,
|
|
14025
|
-
getRenderedAttributes: () =>
|
|
14026
|
-
getSchema: () =>
|
|
14027
|
-
getSchemaByResolvedExtensions: () =>
|
|
14028
|
-
getSchemaTypeByName: () =>
|
|
14029
|
-
getSchemaTypeNameByName: () =>
|
|
14030
|
-
getSplittedAttributes: () =>
|
|
14031
|
-
getStyleProperty: () =>
|
|
14032
|
-
getText: () =>
|
|
14033
|
-
getTextBetween: () =>
|
|
14034
|
-
getTextContentFromNodes: () =>
|
|
14035
|
-
getTextSerializersFromSchema: () =>
|
|
14036
|
-
getUpdatedPosition: () =>
|
|
14037
|
-
h: () =>
|
|
14038
|
-
injectExtensionAttributesToParseRule: () =>
|
|
14039
|
-
inputRulesPlugin: () =>
|
|
14040
|
-
isActive: () =>
|
|
14041
|
-
isAndroid: () =>
|
|
14042
|
-
isAtEndOfNode: () =>
|
|
14043
|
-
isAtStartOfNode: () =>
|
|
14044
|
-
isEmptyObject: () =>
|
|
14045
|
-
isExtensionRulesEnabled: () =>
|
|
14046
|
-
isFirefox: () =>
|
|
14047
|
-
isFunction: () =>
|
|
14048
|
-
isList: () =>
|
|
14049
|
-
isMacOS: () =>
|
|
14050
|
-
isMarkActive: () =>
|
|
14051
|
-
isNodeActive: () =>
|
|
14052
|
-
isNodeEmpty: () =>
|
|
14053
|
-
isNodeSelection: () =>
|
|
14054
|
-
isNodeViewSelected: () =>
|
|
14055
|
-
isNumber: () =>
|
|
14056
|
-
isPlainObject: () =>
|
|
14057
|
-
isRegExp: () =>
|
|
14058
|
-
isSafari: () =>
|
|
14059
|
-
isString: () =>
|
|
14060
|
-
isTextSelection: () =>
|
|
14061
|
-
isiOS: () =>
|
|
14062
|
-
markInputRule: () =>
|
|
14155
|
+
getRenderedAttributes: () => ql,
|
|
14156
|
+
getSchema: () => nu,
|
|
14157
|
+
getSchemaByResolvedExtensions: () => Ql,
|
|
14158
|
+
getSchemaTypeByName: () => _u,
|
|
14159
|
+
getSchemaTypeNameByName: () => bl,
|
|
14160
|
+
getSplittedAttributes: () => vu,
|
|
14161
|
+
getStyleProperty: () => Qd,
|
|
14162
|
+
getText: () => ou,
|
|
14163
|
+
getTextBetween: () => au,
|
|
14164
|
+
getTextContentFromNodes: () => yu,
|
|
14165
|
+
getTextSerializersFromSchema: () => su,
|
|
14166
|
+
getUpdatedPosition: () => Au,
|
|
14167
|
+
h: () => Kd,
|
|
14168
|
+
injectExtensionAttributesToParseRule: () => Yl,
|
|
14169
|
+
inputRulesPlugin: () => ud,
|
|
14170
|
+
isActive: () => xu,
|
|
14171
|
+
isAndroid: () => Kc,
|
|
14172
|
+
isAtEndOfNode: () => Su,
|
|
14173
|
+
isAtStartOfNode: () => Cu,
|
|
14174
|
+
isEmptyObject: () => Hl,
|
|
14175
|
+
isExtensionRulesEnabled: () => wu,
|
|
14176
|
+
isFirefox: () => tf,
|
|
14177
|
+
isFunction: () => Vl,
|
|
14178
|
+
isList: () => Tu,
|
|
14179
|
+
isMacOS: () => fl,
|
|
14180
|
+
isMarkActive: () => bu,
|
|
14181
|
+
isNodeActive: () => hl,
|
|
14182
|
+
isNodeEmpty: () => Eu,
|
|
14183
|
+
isNodeSelection: () => Du,
|
|
14184
|
+
isNodeViewSelected: () => Ou,
|
|
14185
|
+
isNumber: () => gd,
|
|
14186
|
+
isPlainObject: () => fd,
|
|
14187
|
+
isRegExp: () => Fc,
|
|
14188
|
+
isSafari: () => Jc,
|
|
14189
|
+
isString: () => nf,
|
|
14190
|
+
isTextSelection: () => Uc,
|
|
14191
|
+
isiOS: () => qc,
|
|
14192
|
+
markInputRule: () => Bd,
|
|
14063
14193
|
markPasteRule: () => _f,
|
|
14064
|
-
markViewProps: () =>
|
|
14065
|
-
markdown: () =>
|
|
14194
|
+
markViewProps: () => j_,
|
|
14195
|
+
markdown: () => rf,
|
|
14066
14196
|
mergeAttributes: () => G,
|
|
14067
|
-
mergeDeep: () =>
|
|
14068
|
-
minMax: () =>
|
|
14069
|
-
nodeInputRule: () =>
|
|
14197
|
+
mergeDeep: () => pd,
|
|
14198
|
+
minMax: () => Wc,
|
|
14199
|
+
nodeInputRule: () => Vd,
|
|
14070
14200
|
nodePasteRule: () => vf,
|
|
14071
|
-
nodeViewProps: () =>
|
|
14072
|
-
objectIncludes: () =>
|
|
14073
|
-
parseAttributes: () =>
|
|
14074
|
-
parseIndentedBlocks: () =>
|
|
14075
|
-
pasteRulesPlugin: () =>
|
|
14076
|
-
posToDOMRect: () =>
|
|
14077
|
-
removeDuplicates: () =>
|
|
14078
|
-
renderNestedMarkdownContent: () =>
|
|
14079
|
-
resolveExtensions: () =>
|
|
14080
|
-
resolveFocusPosition: () =>
|
|
14081
|
-
rewriteUnknownContent: () =>
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
textInputRule: () => Bd,
|
|
14201
|
+
nodeViewProps: () => F_,
|
|
14202
|
+
objectIncludes: () => Ic,
|
|
14203
|
+
parseAttributes: () => af,
|
|
14204
|
+
parseIndentedBlocks: () => ff,
|
|
14205
|
+
pasteRulesPlugin: () => Sd,
|
|
14206
|
+
posToDOMRect: () => Mu,
|
|
14207
|
+
removeDuplicates: () => du,
|
|
14208
|
+
renderNestedMarkdownContent: () => pf,
|
|
14209
|
+
resolveExtensions: () => tu,
|
|
14210
|
+
resolveFocusPosition: () => Gc,
|
|
14211
|
+
rewriteUnknownContent: () => Pu,
|
|
14212
|
+
selectionToInsertionEnd: () => tl,
|
|
14213
|
+
serializeAttributes: () => of,
|
|
14214
|
+
sortExtensions: () => eu,
|
|
14215
|
+
splitExtensions: () => Ul,
|
|
14216
|
+
textInputRule: () => Ud,
|
|
14088
14217
|
textPasteRule: () => yf,
|
|
14089
|
-
textblockTypeInputRule: () =>
|
|
14218
|
+
textblockTypeInputRule: () => Hd,
|
|
14090
14219
|
updateMarkViewAttributes: () => mf,
|
|
14091
|
-
useEditor: () =>
|
|
14092
|
-
wrappingInputRule: () =>
|
|
14220
|
+
useEditor: () => k_,
|
|
14221
|
+
wrappingInputRule: () => Wd
|
|
14093
14222
|
});
|
|
14094
|
-
function
|
|
14223
|
+
function w_(e) {
|
|
14095
14224
|
return c((t, n) => ({
|
|
14096
14225
|
get() {
|
|
14097
14226
|
return t(), e;
|
|
@@ -14105,9 +14234,9 @@ function __(e) {
|
|
|
14105
14234
|
}
|
|
14106
14235
|
}));
|
|
14107
14236
|
}
|
|
14108
|
-
var
|
|
14237
|
+
var T_ = class extends zd {
|
|
14109
14238
|
constructor(e = {}) {
|
|
14110
|
-
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState =
|
|
14239
|
+
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = w_(this.view.state), this.reactiveExtensionStorage = w_(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
|
|
14111
14240
|
this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
14112
14241
|
}), h(this);
|
|
14113
14242
|
}
|
|
@@ -14125,7 +14254,7 @@ var v_ = class extends Id {
|
|
|
14125
14254
|
let t = super.unregisterPlugin(e);
|
|
14126
14255
|
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
14127
14256
|
}
|
|
14128
|
-
},
|
|
14257
|
+
}, E_ = g({
|
|
14129
14258
|
name: "EditorContent",
|
|
14130
14259
|
props: { editor: {
|
|
14131
14260
|
default: null,
|
|
@@ -14153,7 +14282,7 @@ var v_ = class extends Id {
|
|
|
14153
14282
|
this.rootEl = e;
|
|
14154
14283
|
} });
|
|
14155
14284
|
}
|
|
14156
|
-
}),
|
|
14285
|
+
}), D_ = g({
|
|
14157
14286
|
name: "NodeViewContent",
|
|
14158
14287
|
props: { as: {
|
|
14159
14288
|
type: String,
|
|
@@ -14165,7 +14294,7 @@ var v_ = class extends Id {
|
|
|
14165
14294
|
"data-node-view-content": ""
|
|
14166
14295
|
});
|
|
14167
14296
|
}
|
|
14168
|
-
}),
|
|
14297
|
+
}), O_ = g({
|
|
14169
14298
|
name: "NodeViewWrapper",
|
|
14170
14299
|
props: { as: {
|
|
14171
14300
|
type: String,
|
|
@@ -14181,15 +14310,15 @@ var v_ = class extends Id {
|
|
|
14181
14310
|
onDragstart: this.onDragStart
|
|
14182
14311
|
}, (e = this.$slots).default?.call(e));
|
|
14183
14312
|
}
|
|
14184
|
-
}),
|
|
14313
|
+
}), k_ = (e = {}) => {
|
|
14185
14314
|
let r = t();
|
|
14186
14315
|
return n(() => {
|
|
14187
|
-
r.value = new
|
|
14316
|
+
r.value = new T_(e);
|
|
14188
14317
|
}), m(() => {
|
|
14189
14318
|
var e;
|
|
14190
14319
|
(e = r.value) == null || e.destroy();
|
|
14191
14320
|
}), r;
|
|
14192
|
-
},
|
|
14321
|
+
}, A_ = class {
|
|
14193
14322
|
constructor(e, { props: t = {}, editor: n }) {
|
|
14194
14323
|
this.destroyed = !1, this.editor = n, this.component = h(e), this.el = document.createElement("div"), this.props = l(t), this.renderedComponent = this.renderComponent();
|
|
14195
14324
|
}
|
|
@@ -14218,7 +14347,7 @@ var v_ = class extends Id {
|
|
|
14218
14347
|
destroy() {
|
|
14219
14348
|
this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
|
|
14220
14349
|
}
|
|
14221
|
-
},
|
|
14350
|
+
}, j_ = {
|
|
14222
14351
|
editor: {
|
|
14223
14352
|
type: Object,
|
|
14224
14353
|
required: !0
|
|
@@ -14247,7 +14376,7 @@ var v_ = class extends Id {
|
|
|
14247
14376
|
type: Object,
|
|
14248
14377
|
required: !0
|
|
14249
14378
|
}
|
|
14250
|
-
},
|
|
14379
|
+
}, M_ = g({
|
|
14251
14380
|
name: "MarkViewContent",
|
|
14252
14381
|
props: { as: {
|
|
14253
14382
|
type: String,
|
|
@@ -14259,7 +14388,7 @@ var v_ = class extends Id {
|
|
|
14259
14388
|
"data-mark-view-content": ""
|
|
14260
14389
|
});
|
|
14261
14390
|
}
|
|
14262
|
-
}),
|
|
14391
|
+
}), N_ = class extends hf {
|
|
14263
14392
|
constructor(e, t, n) {
|
|
14264
14393
|
super(e, t, n);
|
|
14265
14394
|
let r = {
|
|
@@ -14275,7 +14404,7 @@ var v_ = class extends Id {
|
|
|
14275
14404
|
__name: e.__name,
|
|
14276
14405
|
__file: e.__file
|
|
14277
14406
|
});
|
|
14278
|
-
this.renderer = new
|
|
14407
|
+
this.renderer = new A_(i, {
|
|
14279
14408
|
editor: this.editor,
|
|
14280
14409
|
props: r
|
|
14281
14410
|
});
|
|
@@ -14294,10 +14423,10 @@ var v_ = class extends Id {
|
|
|
14294
14423
|
this.renderer.destroy();
|
|
14295
14424
|
}
|
|
14296
14425
|
};
|
|
14297
|
-
function
|
|
14298
|
-
return (n) => n.editor.contentComponent ? new
|
|
14426
|
+
function P_(e, t = {}) {
|
|
14427
|
+
return (n) => n.editor.contentComponent ? new N_(e, n, t) : {};
|
|
14299
14428
|
}
|
|
14300
|
-
var
|
|
14429
|
+
var F_ = {
|
|
14301
14430
|
editor: {
|
|
14302
14431
|
type: Object,
|
|
14303
14432
|
required: !0
|
|
@@ -14342,9 +14471,12 @@ var O_ = {
|
|
|
14342
14471
|
type: Object,
|
|
14343
14472
|
required: !0
|
|
14344
14473
|
}
|
|
14345
|
-
},
|
|
14346
|
-
constructor() {
|
|
14347
|
-
super(
|
|
14474
|
+
}, I_ = class extends gf {
|
|
14475
|
+
constructor(e, t, n) {
|
|
14476
|
+
super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
|
|
14477
|
+
let e = this.getPos();
|
|
14478
|
+
typeof e != "number" || e === this.currentPos || (this.currentPos = e, this.renderer.updateProps({ getPos: () => this.getPos() }));
|
|
14479
|
+
}, this.options.trackNodeViewPosition && this.editor.on("update", this.handlePositionUpdate);
|
|
14348
14480
|
}
|
|
14349
14481
|
get extensionWithSyncedStorage() {
|
|
14350
14482
|
if (!this.cachedExtensionWithSyncedStorage) {
|
|
@@ -14368,28 +14500,24 @@ var O_ = {
|
|
|
14368
14500
|
getPos: () => this.getPos(),
|
|
14369
14501
|
updateAttributes: (e = {}) => this.updateAttributes(e),
|
|
14370
14502
|
deleteNode: () => this.deleteNode()
|
|
14371
|
-
}, t = this.onDragStart.bind(this);
|
|
14503
|
+
}, t = e, n = this.onDragStart.bind(this);
|
|
14372
14504
|
this.decorationClasses = u(this.getDecorationClasses());
|
|
14373
|
-
let
|
|
14505
|
+
let r = g({
|
|
14374
14506
|
extends: { ...this.component },
|
|
14375
14507
|
props: Object.keys(e),
|
|
14376
14508
|
template: this.component.template,
|
|
14377
14509
|
setup: (e) => {
|
|
14378
|
-
var
|
|
14379
|
-
return a("onDragStart",
|
|
14510
|
+
var t;
|
|
14511
|
+
return a("onDragStart", n), a("decorationClasses", this.decorationClasses), (t = this.component).setup?.call(t, e, { expose: () => void 0 });
|
|
14380
14512
|
},
|
|
14381
14513
|
__scopeId: this.component.__scopeId,
|
|
14382
14514
|
__cssModules: this.component.__cssModules,
|
|
14383
14515
|
__name: this.component.__name,
|
|
14384
14516
|
__file: this.component.__file
|
|
14385
14517
|
});
|
|
14386
|
-
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.
|
|
14387
|
-
if (!this.renderer) return;
|
|
14388
|
-
let e = this.getPos();
|
|
14389
|
-
typeof e != "number" || e === this.currentPos || (this.currentPos = e, this.renderer.updateProps({ getPos: () => this.getPos() }));
|
|
14390
|
-
}, ff(this.editor, this.positionCheckCallback), this.renderer = new C_(n, {
|
|
14518
|
+
this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.renderer = new A_(r, {
|
|
14391
14519
|
editor: this.editor,
|
|
14392
|
-
props:
|
|
14520
|
+
props: t
|
|
14393
14521
|
});
|
|
14394
14522
|
}
|
|
14395
14523
|
get dom() {
|
|
@@ -14401,7 +14529,7 @@ var O_ = {
|
|
|
14401
14529
|
}
|
|
14402
14530
|
handleSelectionUpdate() {
|
|
14403
14531
|
let e = this.getPos();
|
|
14404
|
-
if (typeof e == "number") if (
|
|
14532
|
+
if (typeof e == "number") if (Ou({
|
|
14405
14533
|
selection: this.editor.state.selection,
|
|
14406
14534
|
pos: e,
|
|
14407
14535
|
nodeSize: this.node.nodeSize,
|
|
@@ -14420,7 +14548,7 @@ var O_ = {
|
|
|
14420
14548
|
};
|
|
14421
14549
|
if (typeof this.options.update == "function") {
|
|
14422
14550
|
let i = this.node, a = this.decorations, o = this.innerDecorations;
|
|
14423
|
-
return this.node = e, this.decorations = t, this.innerDecorations = n, this.
|
|
14551
|
+
return this.node = e, this.decorations = t, this.innerDecorations = n, this.options.update({
|
|
14424
14552
|
oldNode: i,
|
|
14425
14553
|
oldDecorations: a,
|
|
14426
14554
|
newNode: e,
|
|
@@ -14436,19 +14564,15 @@ var O_ = {
|
|
|
14436
14564
|
});
|
|
14437
14565
|
}
|
|
14438
14566
|
if (e.type !== this.node.type) return !1;
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
decorations: t,
|
|
14443
|
-
innerDecorations: n,
|
|
14444
|
-
extension: this.extensionWithSyncedStorage,
|
|
14445
|
-
getPos: () => this.getPos()
|
|
14446
|
-
}), !0) : (this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = i, r({
|
|
14567
|
+
if (e === this.node) return this.node = e, this.decorations = t, this.innerDecorations = n, this.decorationClasses.value = this.getDecorationClasses(), !0;
|
|
14568
|
+
this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = this.getPos();
|
|
14569
|
+
let i = {
|
|
14447
14570
|
node: e,
|
|
14448
14571
|
decorations: t,
|
|
14449
14572
|
innerDecorations: n,
|
|
14450
14573
|
extension: this.extensionWithSyncedStorage
|
|
14451
|
-
}
|
|
14574
|
+
};
|
|
14575
|
+
return this.options.trackNodeViewPosition && (i.getPos = () => this.getPos()), r(i), !0;
|
|
14452
14576
|
}
|
|
14453
14577
|
selectNode() {
|
|
14454
14578
|
this.renderer.updateProps({ selected: !0 }), this.renderer.element && this.renderer.element.classList.add("ProseMirror-selectednode");
|
|
@@ -14460,16 +14584,16 @@ var O_ = {
|
|
|
14460
14584
|
return this.decorations.flatMap((e) => e.type.attrs.class).join(" ");
|
|
14461
14585
|
}
|
|
14462
14586
|
destroy() {
|
|
14463
|
-
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.
|
|
14587
|
+
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate);
|
|
14464
14588
|
}
|
|
14465
14589
|
};
|
|
14466
|
-
function
|
|
14467
|
-
return (n) => n.editor.contentComponent ? new
|
|
14590
|
+
function L_(e, t) {
|
|
14591
|
+
return (n) => n.editor.contentComponent ? new I_(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
|
|
14468
14592
|
}
|
|
14469
14593
|
//#endregion
|
|
14470
|
-
//#region ../../node_modules/.pnpm/@tiptap+suggestion@3.23.
|
|
14471
|
-
function
|
|
14472
|
-
let { char: t, allowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, $position: o } = e, s = n && !r, c =
|
|
14594
|
+
//#region ../../node_modules/.pnpm/@tiptap+suggestion@3.23.6_@tiptap+core@3.23.6_@tiptap+pm@3.23.6__@tiptap+pm@3.23.6/node_modules/@tiptap/suggestion/dist/index.js
|
|
14595
|
+
function R_(e) {
|
|
14596
|
+
let { char: t, allowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, $position: o } = e, s = n && !r, c = Zd(t), l = RegExp(`\\s${c}$`), u = a ? "^" : "", d = r ? "" : c, f = RegExp(s ? `${u}${c}.*?(?=\\s${d}|$)` : `${u}(?:^)?${c}[^\\s${d}]*`, "gm"), p = o.nodeBefore?.isText && o.nodeBefore.text;
|
|
14473
14597
|
if (!p) return null;
|
|
14474
14598
|
let m = o.pos - p.length, h = Array.from(p.matchAll(f)).pop();
|
|
14475
14599
|
if (!h || h.input === void 0 || h.index === void 0) return null;
|
|
@@ -14485,7 +14609,7 @@ function j_(e) {
|
|
|
14485
14609
|
text: h[0]
|
|
14486
14610
|
} : null;
|
|
14487
14611
|
}
|
|
14488
|
-
function
|
|
14612
|
+
function z_(e) {
|
|
14489
14613
|
return e.docChanged ? e.steps.some((e) => {
|
|
14490
14614
|
let t = e.slice;
|
|
14491
14615
|
if (!t?.content) return !1;
|
|
@@ -14493,8 +14617,8 @@ function M_(e) {
|
|
|
14493
14617
|
return /\s/.test(n);
|
|
14494
14618
|
}) : !1;
|
|
14495
14619
|
}
|
|
14496
|
-
var
|
|
14497
|
-
function
|
|
14620
|
+
var B_ = new M("suggestion");
|
|
14621
|
+
function V_({ pluginKey: e = B_, editor: t, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: a = [" "], startOfLine: o = !1, decorationTag: s = "span", decorationClass: c = "suggestion", decorationContent: l = "", decorationEmptyClass: u = "is-empty", command: d = () => null, items: f = () => [], render: p = () => ({}), allow: m = () => !0, findSuggestionMatch: h = R_, shouldShow: g, shouldResetDismissed: _ }) {
|
|
14498
14622
|
let v, y = p?.(), b = r && !i, x = () => {
|
|
14499
14623
|
let { top: e, right: n, bottom: r, left: i } = t.view.coordsAtPos(t.state.selection.$anchor.pos);
|
|
14500
14624
|
try {
|
|
@@ -14512,7 +14636,7 @@ function P_({ pluginKey: e = N_, editor: t, char: n = "@", allowSpaces: r = !1,
|
|
|
14512
14636
|
match: e,
|
|
14513
14637
|
transaction: i,
|
|
14514
14638
|
allowSpaces: b
|
|
14515
|
-
}) ? !1 : b ? e.range.from === n.from : e.range.from === n.from && !
|
|
14639
|
+
}) ? !1 : b ? e.range.from === n.from : e.range.from === n.from && !z_(i);
|
|
14516
14640
|
function C(n, r) {
|
|
14517
14641
|
var i;
|
|
14518
14642
|
try {
|
|
@@ -14665,8 +14789,8 @@ function P_({ pluginKey: e = N_, editor: t, char: n = "@", allowSpaces: r = !1,
|
|
|
14665
14789
|
});
|
|
14666
14790
|
return te;
|
|
14667
14791
|
}
|
|
14668
|
-
var
|
|
14792
|
+
var H_ = V_;
|
|
14669
14793
|
//#endregion
|
|
14670
|
-
export { q as _,
|
|
14794
|
+
export { q as _, b_ as a, ih as c, If as d, Pf as f, sd as g, K as h, C_ as i, th as l, xf as m, O_ as n, uh as o, Mf as p, L_ as r, sh as s, H_ as t, Hm as u, _d as v, G as y };
|
|
14671
14795
|
|
|
14672
|
-
//# sourceMappingURL=tiptap-
|
|
14796
|
+
//# sourceMappingURL=tiptap-BBbH3IT9.js.map
|