@templatical/editor 0.0.5 → 0.1.0
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/LICENSE +56 -0
- package/README.md +69 -0
- package/dist/{AiChatSidebar-DwME3f-a.js → AiChatSidebar-DSbBLDkW.js} +9 -9
- package/dist/{AiFeatureMenu-DJvWL1GZ.js → AiFeatureMenu-d04gmgud.js} +5 -5
- package/dist/{CloudEditor-Fe0ssRgi.js → CloudEditor-CjO4tzbV.js} +218 -227
- package/dist/{CollaboratorBar-DTT0EkZn.js → CollaboratorBar-DYBSTuMW.js} +3 -3
- package/dist/{CommentsSidebar-DrJhQRXK.js → CommentsSidebar-CQvUh5xt.js} +9 -9
- package/dist/CountdownBlock-D3olfssJ.js +92 -0
- package/dist/CountdownToolbar-ClpBwFoX.js +210 -0
- package/dist/{DesignReferenceSidebar-DdOht5zn.js → DesignReferenceSidebar-BOfeETis.js} +5 -5
- package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack-CdqDYVR-.js} +1 -1
- package/dist/{ModuleBrowserModal-CiV_jOEM.js → ModuleBrowserModal-DKSSQonv.js} +7 -7
- package/dist/{ModulePreviewCanvas-Bmy6Y1WE.js → ModulePreviewCanvas-CoLNuu1o.js} +32 -32
- package/dist/NumberWithSuffix-_0l3Q4jq.js +424 -0
- package/dist/{ParagraphEditor-CoQ3NlS7.js → ParagraphEditor-C9R2ou7x.js} +57 -56
- package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BcY3Rcp4.js} +2 -2
- package/dist/{SaveModuleDialog-CD2ZYq1o.js → SaveModuleDialog-DmFe4VUc.js} +3 -3
- package/dist/{SnapshotHistory-DltsKvhP.js → SnapshotHistory-CAhikAOr.js} +7 -7
- package/dist/{TemplateScoringPanel-DmnmUE3y.js → TemplateScoringPanel-b5DnyIll.js} +10 -10
- package/dist/{TestEmailModal-Dl633j9o.js → TestEmailModal-BmDIzGYz.js} +3 -3
- package/dist/{TitleEditor-C7fds2Nc.js → TitleEditor-DtRYx-LS.js} +11 -11
- package/dist/{TplModal-C5_CF-qn.js → TplModal-BLbMDMd6.js} +4 -4
- package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-BHUPLLh1.js} +2 -2
- package/dist/{blockTypeIcons-BrKZB10B.js → blockTypeIcons-CEU2dMe1.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js → AiFeatureMenu-DWMSYD2J.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js.map → AiFeatureMenu-DWMSYD2J.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-DeTolKnf.js → CloudEditor-HrfSfr3G.js} +179 -188
- package/dist/cdn/chunks/CloudEditor-HrfSfr3G.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js → CollaboratorBar-Cfok52TZ.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js.map → CollaboratorBar-Cfok52TZ.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js → ModuleBrowserModal-sASaPRot.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js.map → ModuleBrowserModal-sASaPRot.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js → ModulePreviewCanvas-D8zsajMf.js} +19 -19
- package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js.map → ModulePreviewCanvas-D8zsajMf.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js +425 -0
- package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-DU3oUKA7.js → ParagraphEditor-C1vQWGzW.js} +37 -37
- package/dist/cdn/chunks/ParagraphEditor-C1vQWGzW.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js → RichTextEditorContent-CT8dBB0R.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js.map → RichTextEditorContent-CT8dBB0R.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js → SaveModuleDialog-BkwKrB0N.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js.map → SaveModuleDialog-BkwKrB0N.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js → TitleEditor-BXqt42Px.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js.map → TitleEditor-BXqt42Px.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js → blockTypeIcons-BS6pWyGO.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js.map → blockTypeIcons-BS6pWyGO.js.map} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js → de-3exf7MYE.js} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-3exf7MYE.js.map} +1 -1
- package/dist/cdn/chunks/{de-BB3dgVOc.js → de-C8LxVUsb.js} +1 -1
- package/dist/cdn/chunks/de-C8LxVUsb.js.map +1 -0
- package/dist/cdn/chunks/{dist-KYv9v_1z2.js → dist-BpOx-ugr.js} +10 -3
- package/dist/cdn/chunks/dist-BpOx-ugr.js.map +1 -0
- package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-Bcb86AsV.js} +1591 -1563
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-DeDcpnoS.js → en-BoEycuqw.js} +1 -1
- package/dist/cdn/chunks/en-BoEycuqw.js.map +1 -0
- package/dist/cdn/chunks/{en-CpotcOPr.js → en-KNPUKxYp.js} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-KNPUKxYp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Bj7USRLr.js → extensions-DBxH6pz0.js} +21 -21
- package/dist/cdn/chunks/{extensions-Bj7USRLr.js.map → extensions-DBxH6pz0.js.map} +1 -1
- package/dist/cdn/chunks/{features-Ds0XUfte.js → features-C3n7AeUc.js} +1338 -1422
- package/dist/cdn/chunks/features-C3n7AeUc.js.map +1 -0
- package/dist/cdn/chunks/{icons-fWsuSvgd.js → icons-Hmpb0_8s.js} +2 -2
- package/dist/cdn/chunks/icons-Hmpb0_8s.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-CEMn-ZqL.js} +24 -17
- package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
- package/dist/cdn/chunks/{media-library-BGQm_OyC.js → media-library-C1wCpRY1.js} +114 -110
- package/dist/cdn/chunks/media-library-C1wCpRY1.js.map +1 -0
- package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-DwSQn6BA.js} +11 -8
- package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
- package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
- package/dist/cdn/chunks/{src-3i8rPuqd.js → src-BUszJqfd.js} +8 -8
- package/dist/cdn/chunks/{src-3i8rPuqd.js.map → src-BUszJqfd.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js → styleConstants-DP1VOca8.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js.map → styleConstants-DP1VOca8.js.map} +1 -1
- package/dist/cdn/chunks/{styles-Dgijy53u.js → styles-U2VFFgxC.js} +623 -1239
- package/dist/cdn/chunks/styles-U2VFFgxC.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BhxaWR8R.js → tiptap-w5IqC8oW.js} +1610 -1364
- package/dist/cdn/chunks/tiptap-w5IqC8oW.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +92 -97
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B7kDuZmP.js → check-BDE2uFIC.js} +1 -1
- package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-BL1DcOiT.js} +1 -1
- package/dist/{circle-alert-E2vYPs5r.js → circle-alert-1tetIFJU.js} +1 -1
- package/dist/{clock-lWIIQA3C.js → clock-CNc3isoG.js} +1 -1
- package/dist/{dist-DysAFIPy.js → dist-7SaUYnxo.js} +385 -357
- package/dist/{dist-DmOE-Ubp.js → dist-BKZ5gvJf.js} +5 -5
- package/dist/{dist-CG-vEqSU.js → dist-CLg2qE0p.js} +2 -2
- package/dist/dist-CdzaZZSx.js +5 -0
- package/dist/dist-Cl9giA3B.js +5 -0
- package/dist/{dist-C_ymrGFi.js → dist-CpHKN3mI.js} +541 -508
- package/dist/{dist-4LiM9FDd.js → dist-DMuaebdo.js} +2 -2
- package/dist/{dist-ChAGLpWo.js → dist-DW_4_uv3.js} +2 -2
- package/dist/{dist-C1BIRHCQ.js → dist-DYG6FL7b.js} +2 -2
- package/dist/{dist-DrvKRSU6.js → dist-DbFMBx8E.js} +2 -2
- package/dist/{dist-D_HQYSY-.js → dist-Dn9cOicG.js} +2 -2
- package/dist/{dist-Ci5lFuUy.js → dist-ENKQZrNg.js} +138 -132
- package/dist/{dist-Bu7veieH.js → dist-fEtcLxee.js} +15 -15
- package/dist/{extensions-DWx_jj8v.js → extensions-Y880c0sP.js} +3 -3
- package/dist/{image-up-X4xIq4ea.js → image-up-4ZmaHFga.js} +1 -1
- package/dist/index.d.ts +234 -0
- package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-DZ62L7up.js} +20 -15
- package/dist/{loader-circle-BTQQxC3l.js → loader-circle-C7YEH4do.js} +1 -1
- package/dist/{message-circle-Blgm6V_h.js → message-circle-B_lxRh4z.js} +1 -1
- package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-DmZNoimV.js} +1 -1
- package/dist/rolldown-runtime-gEudmnaM.js +23 -0
- package/dist/{scan-line-7lZPfOdm.js → scan-line-Cc9KlXo5.js} +1 -1
- package/dist/{send-C0ltAQrv.js → send-CMwNWTPX.js} +1 -1
- package/dist/{shield-check-f-qv4RKs.js → shield-check-DZFf4LTh.js} +1 -1
- package/dist/{sparkles-KhBCGlqB.js → sparkles-D80W88H8.js} +1 -1
- package/dist/{styleConstants-Cxw88naD.js → styleConstants-Codo7aUT.js} +6 -45
- package/dist/styles-unyYKihg.js +2942 -0
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +85 -90
- package/dist/text-align-start-Cje6pwo4.js +43 -0
- package/dist/{trash-2-OwjZ-guZ.js → trash-2-BWvxOB4Q.js} +1 -1
- package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-C6y94qVX.js} +1 -1
- package/dist/{useEditorCore-DUGD6pq_.js → useEditorCore-CQwWl2js.js} +1143 -1247
- package/dist/{x-CGlq2XQe.js → x-IyhJ6V90.js} +1 -1
- package/package.json +70 -52
- package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +0 -2
- package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +0 -2
- package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +0 -2
- package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +0 -2
- package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +0 -2
- package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +0 -2
- package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
- package/dist/cdn/chunks/dist-BF5c3Dr-.js +0 -2
- package/dist/cdn/chunks/dist-BGzvIxcJ.js +0 -2
- package/dist/cdn/chunks/dist-CFemF8rI.js +0 -2
- package/dist/cdn/chunks/dist-Co6uFhFK.js +0 -2
- package/dist/cdn/chunks/dist-DCikBY9K.js +0 -2
- package/dist/cdn/chunks/dist-DUILafAC.js +0 -2
- package/dist/cdn/chunks/dist-DghiKH0A.js +0 -2
- package/dist/cdn/chunks/dist-Dw8ckvfK.js +0 -2
- package/dist/cdn/chunks/dist-H07p0KAw.js +0 -2
- package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +0 -1
- package/dist/cdn/chunks/dist-MjnKIc0W.js +0 -2
- package/dist/cdn/chunks/dist-odp0vGRv.js +0 -2
- package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
- package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
- package/dist/cdn/chunks/features-Ds0XUfte.js.map +0 -1
- package/dist/cdn/chunks/icons-fWsuSvgd.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
- package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +0 -1
- package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
- package/dist/cdn/chunks/styles-Dgijy53u.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BhxaWR8R.js.map +0 -1
- package/dist/dist-DkypH7qG.js +0 -5
- package/dist/dist-Dxnd0GRf.js +0 -5
- package/dist/styles-fdXNRqI3.js +0 -3556
- package/dist/templatical-editor.umd.cjs +0 -179
- /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
- /package/dist/{de-D7TLGIPA.js → de-DCRASLfd.js} +0 -0
- /package/dist/{emojiData-BfWQS72m.js → emojiData-CyACq8qV.js} +0 -0
- /package/dist/{en-DvtiEMwP.js → en-BC0igPeg.js} +0 -0
- /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-mRxw8HK8.js} +0 -0
- /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
- /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.
|
|
1
|
+
//#region ../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.js
|
|
2
2
|
function e(e) {
|
|
3
3
|
this.content = e;
|
|
4
4
|
}
|
|
@@ -64,7 +64,7 @@ e.prototype = {
|
|
|
64
64
|
return new e(n);
|
|
65
65
|
};
|
|
66
66
|
//#endregion
|
|
67
|
-
//#region ../../node_modules/.
|
|
67
|
+
//#region ../../node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.js
|
|
68
68
|
function t(e, n, r) {
|
|
69
69
|
for (let i = 0;; i++) {
|
|
70
70
|
if (i == e.childCount || i == n.childCount) return e.childCount == n.childCount ? null : r;
|
|
@@ -391,7 +391,7 @@ function p(e, t, n, r) {
|
|
|
391
391
|
let r = e.parent, i = r.content;
|
|
392
392
|
return v(r, i.cut(0, e.parentOffset).append(n.content).append(i.cut(t.parentOffset)));
|
|
393
393
|
} else {
|
|
394
|
-
let { start: i, end: o } =
|
|
394
|
+
let { start: i, end: o } = ee(n, e);
|
|
395
395
|
return v(a, y(e, i, o, t, r));
|
|
396
396
|
}
|
|
397
397
|
}
|
|
@@ -423,7 +423,7 @@ function b(e, t, n) {
|
|
|
423
423
|
let i = [];
|
|
424
424
|
return _(null, e, n, i), e.depth > n && g(v(h(e, t, n + 1), b(e, t, n + 1)), i), _(t, null, n, i), new r(i);
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function ee(e, t) {
|
|
427
427
|
let n = t.depth - e.openStart, i = t.node(n).copy(e.content);
|
|
428
428
|
for (let e = n - 1; e >= 0; e--) i = t.node(e).copy(r.from(i));
|
|
429
429
|
return {
|
|
@@ -431,7 +431,7 @@ function x(e, t) {
|
|
|
431
431
|
end: i.resolveNoCache(i.content.size - e.openEnd - n)
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
var
|
|
434
|
+
var te = class e {
|
|
435
435
|
constructor(e, t, n) {
|
|
436
436
|
this.pos = e, this.path = t, this.parentOffset = n, this.depth = t.length / 3 - 1;
|
|
437
437
|
}
|
|
@@ -512,7 +512,7 @@ var ee = class e {
|
|
|
512
512
|
}
|
|
513
513
|
blockRange(e = this, t) {
|
|
514
514
|
if (e.pos < this.pos) return e.blockRange(this);
|
|
515
|
-
for (let n = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); n >= 0; n--) if (e.pos <= this.end(n) && (!t || t(this.node(n)))) return new
|
|
515
|
+
for (let n = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); n >= 0; n--) if (e.pos <= this.end(n) && (!t || t(this.node(n)))) return new x(this, e, n);
|
|
516
516
|
return null;
|
|
517
517
|
}
|
|
518
518
|
sameParent(e) {
|
|
@@ -540,20 +540,20 @@ var ee = class e {
|
|
|
540
540
|
return new e(n, r, a);
|
|
541
541
|
}
|
|
542
542
|
static resolveCached(t, n) {
|
|
543
|
-
let r =
|
|
543
|
+
let r = ie.get(t);
|
|
544
544
|
if (r) for (let e = 0; e < r.elts.length; e++) {
|
|
545
545
|
let t = r.elts[e];
|
|
546
546
|
if (t.pos == n) return t;
|
|
547
547
|
}
|
|
548
|
-
else
|
|
548
|
+
else ie.set(t, r = new ne());
|
|
549
549
|
let i = r.elts[r.i] = e.resolve(t, n);
|
|
550
|
-
return r.i = (r.i + 1) %
|
|
550
|
+
return r.i = (r.i + 1) % re, i;
|
|
551
551
|
}
|
|
552
|
-
},
|
|
552
|
+
}, ne = class {
|
|
553
553
|
constructor() {
|
|
554
554
|
this.elts = [], this.i = 0;
|
|
555
555
|
}
|
|
556
|
-
},
|
|
556
|
+
}, re = 12, ie = /* @__PURE__ */ new WeakMap(), x = class {
|
|
557
557
|
constructor(e, t, n) {
|
|
558
558
|
this.$from = e, this.$to = t, this.depth = n;
|
|
559
559
|
}
|
|
@@ -674,10 +674,10 @@ var ee = class e {
|
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
676
|
resolve(e) {
|
|
677
|
-
return
|
|
677
|
+
return te.resolveCached(this, e);
|
|
678
678
|
}
|
|
679
679
|
resolveNoCache(e) {
|
|
680
|
-
return
|
|
680
|
+
return te.resolve(this, e);
|
|
681
681
|
}
|
|
682
682
|
rangeHasMark(e, t, n) {
|
|
683
683
|
let r = !1;
|
|
@@ -1830,7 +1830,7 @@ function et(e, t, n, r) {
|
|
|
1830
1830
|
};
|
|
1831
1831
|
}
|
|
1832
1832
|
//#endregion
|
|
1833
|
-
//#region ../../node_modules/.
|
|
1833
|
+
//#region ../../node_modules/.pnpm/prosemirror-transform@1.12.0/node_modules/prosemirror-transform/dist/index.js
|
|
1834
1834
|
var tt = 65535, nt = 2 ** 16;
|
|
1835
1835
|
function rt(e, t) {
|
|
1836
1836
|
return e + t * nt;
|
|
@@ -2180,8 +2180,8 @@ var T = class e extends C {
|
|
|
2180
2180
|
return new e(this.from, this.from + this.slice.size, t.slice(this.from, this.to));
|
|
2181
2181
|
}
|
|
2182
2182
|
map(t) {
|
|
2183
|
-
let n = t.mapResult(this.
|
|
2184
|
-
return
|
|
2183
|
+
let n = t.mapResult(this.to, -1), r = this.from == this.to && e.MAP_BIAS < 0 ? n : t.mapResult(this.from, 1);
|
|
2184
|
+
return r.deletedAcross && n.deletedAcross ? null : new e(r.pos, Math.max(r.pos, n.pos), this.slice, this.structure);
|
|
2185
2185
|
}
|
|
2186
2186
|
merge(t) {
|
|
2187
2187
|
if (!(t instanceof e) || t.structure || this.structure) return null;
|
|
@@ -2206,7 +2206,7 @@ var T = class e extends C {
|
|
|
2206
2206
|
return new e(n.from, n.to, l.fromJSON(t, n.slice), !!n.structure);
|
|
2207
2207
|
}
|
|
2208
2208
|
};
|
|
2209
|
-
C.jsonID("replace", T);
|
|
2209
|
+
T.MAP_BIAS = 1, C.jsonID("replace", T);
|
|
2210
2210
|
var E = class e extends C {
|
|
2211
2211
|
constructor(e, t, n, r, i, a, o = !1) {
|
|
2212
2212
|
super(), this.from = e, this.to = t, this.gapFrom = n, this.gapTo = r, this.slice = i, this.insert = a, this.structure = o;
|
|
@@ -2433,7 +2433,7 @@ function Ft(e, t, n, i, a) {
|
|
|
2433
2433
|
if (!n.validContent(o.content)) throw RangeError("Invalid content for node type " + n.name);
|
|
2434
2434
|
e.step(new E(t, t + o.nodeSize, t + 1, t + o.nodeSize - 1, new l(r.from(s), 0, 0), 1, !0));
|
|
2435
2435
|
}
|
|
2436
|
-
function
|
|
2436
|
+
function D(e, t, n = 1, r) {
|
|
2437
2437
|
let i = e.resolve(t), a = i.depth - n, o = r && r[r.length - 1] || i.parent;
|
|
2438
2438
|
if (a < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !o.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount))) return !1;
|
|
2439
2439
|
for (let e = i.depth - 1, t = n - 2; e > a; e--, t--) {
|
|
@@ -2447,7 +2447,7 @@ function It(e, t, n = 1, r) {
|
|
|
2447
2447
|
let s = i.indexAfter(a), c = r && r[0];
|
|
2448
2448
|
return i.node(a).canReplaceWith(s, s, c ? c.type : i.node(a + 1).type);
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2450
|
+
function It(e, t, n = 1, i) {
|
|
2451
2451
|
let a = e.doc.resolve(t), o = r.empty, s = r.empty;
|
|
2452
2452
|
for (let e = a.depth, t = a.depth - n, c = n - 1; e > t; e--, c--) {
|
|
2453
2453
|
o = r.from(a.node(e).copy(o));
|
|
@@ -2456,11 +2456,11 @@ function Lt(e, t, n = 1, i) {
|
|
|
2456
2456
|
}
|
|
2457
2457
|
e.step(new T(t, t, new l(o.append(s), n, n), !0));
|
|
2458
2458
|
}
|
|
2459
|
-
function
|
|
2459
|
+
function Lt(e, t) {
|
|
2460
2460
|
let n = e.resolve(t), r = n.index();
|
|
2461
|
-
return
|
|
2461
|
+
return zt(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
|
|
2462
2462
|
}
|
|
2463
|
-
function
|
|
2463
|
+
function Rt(e, t) {
|
|
2464
2464
|
t.content.size || e.type.compatibleContent(t.type);
|
|
2465
2465
|
let n = e.contentMatchAt(e.childCount), { linebreakReplacement: r } = e.type.schema;
|
|
2466
2466
|
for (let i = 0; i < t.childCount; i++) {
|
|
@@ -2469,19 +2469,19 @@ function zt(e, t) {
|
|
|
2469
2469
|
}
|
|
2470
2470
|
return n.validEnd;
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2473
|
-
return !!(e && t && !e.isLeaf &&
|
|
2472
|
+
function zt(e, t) {
|
|
2473
|
+
return !!(e && t && !e.isLeaf && Rt(e, t));
|
|
2474
2474
|
}
|
|
2475
|
-
function
|
|
2475
|
+
function Bt(e, t, n = -1) {
|
|
2476
2476
|
let r = e.resolve(t);
|
|
2477
2477
|
for (let e = r.depth;; e--) {
|
|
2478
2478
|
let i, a, o = r.index(e);
|
|
2479
|
-
if (e == r.depth ? (i = r.nodeBefore, a = r.nodeAfter) : n > 0 ? (i = r.node(e + 1), o++, a = r.node(e).maybeChild(o)) : (i = r.node(e).maybeChild(o - 1), a = r.node(e + 1)), i && !i.isTextblock &&
|
|
2479
|
+
if (e == r.depth ? (i = r.nodeBefore, a = r.nodeAfter) : n > 0 ? (i = r.node(e + 1), o++, a = r.node(e).maybeChild(o)) : (i = r.node(e).maybeChild(o - 1), a = r.node(e + 1)), i && !i.isTextblock && zt(i, a) && r.node(e).canReplace(o, o + 1)) return t;
|
|
2480
2480
|
if (e == 0) break;
|
|
2481
2481
|
t = n < 0 ? r.before(e) : r.after(e);
|
|
2482
2482
|
}
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2484
|
+
function Vt(e, t, n) {
|
|
2485
2485
|
let r = null, { linebreakReplacement: i } = e.doc.type.schema, a = e.doc.resolve(t - n), o = a.node().type;
|
|
2486
2486
|
if (i && o.inlineContent) {
|
|
2487
2487
|
let e = o.whitespace == "pre", t = !!o.contentMatch.matchType(i);
|
|
@@ -2500,7 +2500,7 @@ function Ht(e, t, n) {
|
|
|
2500
2500
|
}
|
|
2501
2501
|
return e;
|
|
2502
2502
|
}
|
|
2503
|
-
function
|
|
2503
|
+
function Ht(e, t, n) {
|
|
2504
2504
|
let r = e.resolve(t);
|
|
2505
2505
|
if (r.parent.canReplaceWith(r.index(), r.index(), n)) return t;
|
|
2506
2506
|
if (r.parentOffset == 0) for (let e = r.depth - 1; e >= 0; e--) {
|
|
@@ -2515,7 +2515,7 @@ function Ut(e, t, n) {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
return null;
|
|
2517
2517
|
}
|
|
2518
|
-
function
|
|
2518
|
+
function Ut(e, t, n) {
|
|
2519
2519
|
let r = e.resolve(t);
|
|
2520
2520
|
if (!n.content.size) return t;
|
|
2521
2521
|
let i = n.content;
|
|
@@ -2531,15 +2531,15 @@ function Wt(e, t, n) {
|
|
|
2531
2531
|
}
|
|
2532
2532
|
return null;
|
|
2533
2533
|
}
|
|
2534
|
-
function
|
|
2534
|
+
function Wt(e, t, n = t, r = l.empty) {
|
|
2535
2535
|
if (t == n && !r.size) return null;
|
|
2536
2536
|
let i = e.resolve(t), a = e.resolve(n);
|
|
2537
|
-
return
|
|
2537
|
+
return Gt(i, a, r) ? new T(t, n, r) : new Kt(i, a, r).fit();
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function Gt(e, t, n) {
|
|
2540
2540
|
return !n.openStart && !n.openEnd && e.start() == t.start() && e.parent.canReplace(e.index(), t.index(), n.content);
|
|
2541
2541
|
}
|
|
2542
|
-
var
|
|
2542
|
+
var Kt = class {
|
|
2543
2543
|
constructor(e, t, n) {
|
|
2544
2544
|
this.$from = e, this.$to = t, this.unplaced = n, this.frontier = [], this.placed = r.empty;
|
|
2545
2545
|
for (let t = 0; t <= e.depth; t++) {
|
|
@@ -2578,7 +2578,7 @@ var qt = class {
|
|
|
2578
2578
|
}
|
|
2579
2579
|
for (let t = 1; t <= 2; t++) for (let n = t == 1 ? e : this.unplaced.openStart; n >= 0; n--) {
|
|
2580
2580
|
let e, i = null;
|
|
2581
|
-
n ? (i =
|
|
2581
|
+
n ? (i = Yt(this.unplaced.content, n - 1).firstChild, e = i.content) : e = this.unplaced.content;
|
|
2582
2582
|
let a = e.firstChild;
|
|
2583
2583
|
for (let e = this.depth; e >= 0; e--) {
|
|
2584
2584
|
let { type: o, match: s } = this.frontier[e], c, l = null;
|
|
@@ -2599,15 +2599,15 @@ var qt = class {
|
|
|
2599
2599
|
}
|
|
2600
2600
|
}
|
|
2601
2601
|
openMore() {
|
|
2602
|
-
let { content: e, openStart: t, openEnd: n } = this.unplaced, r =
|
|
2602
|
+
let { content: e, openStart: t, openEnd: n } = this.unplaced, r = Yt(e, t);
|
|
2603
2603
|
return !r.childCount || r.firstChild.isLeaf ? !1 : (this.unplaced = new l(e, t + 1, Math.max(n, r.size + t >= e.size - n ? t + 1 : 0)), !0);
|
|
2604
2604
|
}
|
|
2605
2605
|
dropNode() {
|
|
2606
|
-
let { content: e, openStart: t, openEnd: n } = this.unplaced, r =
|
|
2606
|
+
let { content: e, openStart: t, openEnd: n } = this.unplaced, r = Yt(e, t);
|
|
2607
2607
|
if (r.childCount <= 1 && t > 0) {
|
|
2608
2608
|
let i = e.size - t <= t + r.size;
|
|
2609
|
-
this.unplaced = new l(
|
|
2610
|
-
} else this.unplaced = new l(
|
|
2609
|
+
this.unplaced = new l(qt(e, t - 1, 1), t - 1, i ? t - 1 : n);
|
|
2610
|
+
} else this.unplaced = new l(qt(e, t, 1), t, n);
|
|
2611
2611
|
}
|
|
2612
2612
|
placeNodes({ sliceDepth: e, frontierDepth: t, parent: n, inject: i, wrap: a }) {
|
|
2613
2613
|
for (; this.depth > t;) this.closeFrontierNode();
|
|
@@ -2621,10 +2621,10 @@ var qt = class {
|
|
|
2621
2621
|
for (; u < s.childCount;) {
|
|
2622
2622
|
let e = s.child(u), t = f.matchType(e.type);
|
|
2623
2623
|
if (!t) break;
|
|
2624
|
-
u++, (u > 1 || c == 0 || e.content.size) && (f = t, d.push(
|
|
2624
|
+
u++, (u > 1 || c == 0 || e.content.size) && (f = t, d.push(Xt(e.mark(p.allowedMarks(e.marks)), u == 1 ? c : 0, u == s.childCount ? m : -1)));
|
|
2625
2625
|
}
|
|
2626
2626
|
let h = u == s.childCount;
|
|
2627
|
-
h || (m = -1), this.placed =
|
|
2627
|
+
h || (m = -1), this.placed = Jt(this.placed, t, r.from(d)), this.frontier[t].match = f, h && m < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
2628
2628
|
for (let e = 0, t = s; e < m; e++) {
|
|
2629
2629
|
let e = t.lastChild;
|
|
2630
2630
|
this.frontier.push({
|
|
@@ -2632,22 +2632,22 @@ var qt = class {
|
|
|
2632
2632
|
match: e.contentMatchAt(e.childCount)
|
|
2633
2633
|
}), t = e.content;
|
|
2634
2634
|
}
|
|
2635
|
-
this.unplaced = h ? e == 0 ? l.empty : new l(
|
|
2635
|
+
this.unplaced = h ? e == 0 ? l.empty : new l(qt(o.content, e - 1, 1), e - 1, m < 0 ? o.openEnd : e - 1) : new l(qt(o.content, e, u), o.openStart, o.openEnd);
|
|
2636
2636
|
}
|
|
2637
2637
|
mustMoveInline() {
|
|
2638
2638
|
if (!this.$to.parent.isTextblock) return -1;
|
|
2639
2639
|
let e = this.frontier[this.depth], t;
|
|
2640
|
-
if (!e.type.isTextblock || !
|
|
2640
|
+
if (!e.type.isTextblock || !Zt(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth) return -1;
|
|
2641
2641
|
let { depth: n } = this.$to, r = this.$to.after(n);
|
|
2642
2642
|
for (; n > 1 && r == this.$to.end(--n);) ++r;
|
|
2643
2643
|
return r;
|
|
2644
2644
|
}
|
|
2645
2645
|
findCloseLevel(e) {
|
|
2646
2646
|
scan: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
2647
|
-
let { match: n, type: r } = this.frontier[t], i = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), a =
|
|
2647
|
+
let { match: n, type: r } = this.frontier[t], i = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), a = Zt(e, t, r, n, i);
|
|
2648
2648
|
if (a) {
|
|
2649
2649
|
for (let n = t - 1; n >= 0; n--) {
|
|
2650
|
-
let { match: t, type: r } = this.frontier[n], i =
|
|
2650
|
+
let { match: t, type: r } = this.frontier[n], i = Zt(e, n, r, t, !0);
|
|
2651
2651
|
if (!i || i.childCount) continue scan;
|
|
2652
2652
|
}
|
|
2653
2653
|
return {
|
|
@@ -2662,7 +2662,7 @@ var qt = class {
|
|
|
2662
2662
|
let t = this.findCloseLevel(e);
|
|
2663
2663
|
if (!t) return null;
|
|
2664
2664
|
for (; this.depth > t.depth;) this.closeFrontierNode();
|
|
2665
|
-
t.fit.childCount && (this.placed =
|
|
2665
|
+
t.fit.childCount && (this.placed = Jt(this.placed, t.depth, t.fit)), e = t.move;
|
|
2666
2666
|
for (let n = t.depth + 1; n <= e.depth; n++) {
|
|
2667
2667
|
let t = e.node(n), r = t.type.contentMatch.fillBefore(t.content, !0, e.index(n));
|
|
2668
2668
|
this.openFrontierNode(t.type, t.attrs, r);
|
|
@@ -2671,49 +2671,49 @@ var qt = class {
|
|
|
2671
2671
|
}
|
|
2672
2672
|
openFrontierNode(e, t = null, n) {
|
|
2673
2673
|
let i = this.frontier[this.depth];
|
|
2674
|
-
i.match = i.match.matchType(e), this.placed =
|
|
2674
|
+
i.match = i.match.matchType(e), this.placed = Jt(this.placed, this.depth, r.from(e.create(t, n))), this.frontier.push({
|
|
2675
2675
|
type: e,
|
|
2676
2676
|
match: e.contentMatch
|
|
2677
2677
|
});
|
|
2678
2678
|
}
|
|
2679
2679
|
closeFrontierNode() {
|
|
2680
2680
|
let e = this.frontier.pop().match.fillBefore(r.empty, !0);
|
|
2681
|
-
e.childCount && (this.placed =
|
|
2681
|
+
e.childCount && (this.placed = Jt(this.placed, this.frontier.length, e));
|
|
2682
2682
|
}
|
|
2683
2683
|
};
|
|
2684
|
-
function
|
|
2685
|
-
return t == 0 ? e.cutByIndex(n, e.childCount) : e.replaceChild(0, e.firstChild.copy(
|
|
2684
|
+
function qt(e, t, n) {
|
|
2685
|
+
return t == 0 ? e.cutByIndex(n, e.childCount) : e.replaceChild(0, e.firstChild.copy(qt(e.firstChild.content, t - 1, n)));
|
|
2686
2686
|
}
|
|
2687
|
-
function
|
|
2688
|
-
return t == 0 ? e.append(n) : e.replaceChild(e.childCount - 1, e.lastChild.copy(
|
|
2687
|
+
function Jt(e, t, n) {
|
|
2688
|
+
return t == 0 ? e.append(n) : e.replaceChild(e.childCount - 1, e.lastChild.copy(Jt(e.lastChild.content, t - 1, n)));
|
|
2689
2689
|
}
|
|
2690
|
-
function
|
|
2690
|
+
function Yt(e, t) {
|
|
2691
2691
|
for (let n = 0; n < t; n++) e = e.firstChild.content;
|
|
2692
2692
|
return e;
|
|
2693
2693
|
}
|
|
2694
|
-
function
|
|
2694
|
+
function Xt(e, t, n) {
|
|
2695
2695
|
if (t <= 0) return e;
|
|
2696
2696
|
let i = e.content;
|
|
2697
|
-
return t > 1 && (i = i.replaceChild(0,
|
|
2697
|
+
return t > 1 && (i = i.replaceChild(0, Xt(i.firstChild, t - 1, i.childCount == 1 ? n - 1 : 0))), t > 0 && (i = e.type.contentMatch.fillBefore(i).append(i), n <= 0 && (i = i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.empty, !0)))), e.copy(i);
|
|
2698
2698
|
}
|
|
2699
|
-
function
|
|
2699
|
+
function Zt(e, t, n, r, i) {
|
|
2700
2700
|
let a = e.node(t), o = i ? e.indexAfter(t) : e.index(t);
|
|
2701
2701
|
if (o == a.childCount && !n.compatibleContent(a.type)) return null;
|
|
2702
2702
|
let s = r.fillBefore(a.content, !0, o);
|
|
2703
|
-
return s &&
|
|
2703
|
+
return s && !Qt(n, a.content, o) ? s : null;
|
|
2704
2704
|
}
|
|
2705
|
-
function
|
|
2705
|
+
function Qt(e, t, n) {
|
|
2706
2706
|
for (let r = n; r < t.childCount; r++) if (!e.allowsMarks(t.child(r).marks)) return !0;
|
|
2707
2707
|
return !1;
|
|
2708
2708
|
}
|
|
2709
|
-
function
|
|
2709
|
+
function $t(e) {
|
|
2710
2710
|
return e.spec.defining || e.spec.definingForContent;
|
|
2711
2711
|
}
|
|
2712
|
-
function
|
|
2712
|
+
function en(e, t, n, r) {
|
|
2713
2713
|
if (!r.size) return e.deleteRange(t, n);
|
|
2714
2714
|
let i = e.doc.resolve(t), a = e.doc.resolve(n);
|
|
2715
|
-
if (
|
|
2716
|
-
let o =
|
|
2715
|
+
if (Gt(i, a, r)) return e.step(new T(t, n, r));
|
|
2716
|
+
let o = an(i, a);
|
|
2717
2717
|
o[o.length - 1] == 0 && o.pop();
|
|
2718
2718
|
let s = -(i.depth + 1);
|
|
2719
2719
|
o.unshift(s);
|
|
@@ -2729,7 +2729,7 @@ function tn(e, t, n, r) {
|
|
|
2729
2729
|
e = n.content;
|
|
2730
2730
|
}
|
|
2731
2731
|
for (let e = d - 1; e >= 0; e--) {
|
|
2732
|
-
let t = u[e], n =
|
|
2732
|
+
let t = u[e], n = $t(t.type);
|
|
2733
2733
|
if (n && !t.sameMarkup(i.node(Math.abs(s) - 1))) d = e;
|
|
2734
2734
|
else if (n || !t.type.isTextblock) break;
|
|
2735
2735
|
}
|
|
@@ -2739,7 +2739,7 @@ function tn(e, t, n, r) {
|
|
|
2739
2739
|
let u = o[(t + c) % o.length], d = !0;
|
|
2740
2740
|
u < 0 && (d = !1, u = -u);
|
|
2741
2741
|
let p = i.node(u - 1), m = i.index(u - 1);
|
|
2742
|
-
if (p.canReplaceWith(m, m, f.type, f.marks)) return e.replace(i.before(u), d ? a.after(u) : n, new l(
|
|
2742
|
+
if (p.canReplaceWith(m, m, f.type, f.marks)) return e.replace(i.before(u), d ? a.after(u) : n, new l(tn(r.content, 0, r.openStart, s), s, r.openEnd));
|
|
2743
2743
|
}
|
|
2744
2744
|
}
|
|
2745
2745
|
let f = e.steps.length;
|
|
@@ -2748,10 +2748,10 @@ function tn(e, t, n, r) {
|
|
|
2748
2748
|
e < 0 || (t = i.before(e), n = a.after(e));
|
|
2749
2749
|
}
|
|
2750
2750
|
}
|
|
2751
|
-
function
|
|
2751
|
+
function tn(e, t, n, i, a) {
|
|
2752
2752
|
if (t < n) {
|
|
2753
2753
|
let r = e.firstChild;
|
|
2754
|
-
e = e.replaceChild(0, r.copy(
|
|
2754
|
+
e = e.replaceChild(0, r.copy(tn(r.content, t + 1, n, i, r)));
|
|
2755
2755
|
}
|
|
2756
2756
|
if (t > i) {
|
|
2757
2757
|
let t = a.contentMatchAt(0), n = t.fillBefore(e).append(e);
|
|
@@ -2759,15 +2759,26 @@ function nn(e, t, n, i, a) {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
return e;
|
|
2761
2761
|
}
|
|
2762
|
-
function
|
|
2762
|
+
function nn(e, t, n, i) {
|
|
2763
2763
|
if (!i.isInline && t == n && e.doc.resolve(t).parent.content.size) {
|
|
2764
|
-
let r =
|
|
2764
|
+
let r = Ht(e.doc, t, i.type);
|
|
2765
2765
|
r != null && (t = n = r);
|
|
2766
2766
|
}
|
|
2767
2767
|
e.replaceRange(t, n, new l(r.from(i), 0, 0));
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2770
|
-
let r = e.doc.resolve(t), i = e.doc.resolve(n)
|
|
2769
|
+
function rn(e, t, n) {
|
|
2770
|
+
let r = e.doc.resolve(t), i = e.doc.resolve(n);
|
|
2771
|
+
if (r.parent.isTextblock && i.parent.isTextblock && r.start() != i.start() && r.parentOffset == 0 && i.parentOffset == 0) {
|
|
2772
|
+
let a = r.sharedDepth(n), o = !1;
|
|
2773
|
+
for (let e = r.depth; e > a; e--) r.node(e).type.spec.isolating && (o = !0);
|
|
2774
|
+
for (let e = i.depth; e > a; e--) i.node(e).type.spec.isolating && (o = !0);
|
|
2775
|
+
if (!o) {
|
|
2776
|
+
for (let e = r.depth; e > 0 && t == r.start(e); e--) t = r.before(e);
|
|
2777
|
+
for (let e = i.depth; e > 0 && n == i.start(e); e--) n = i.before(e);
|
|
2778
|
+
r = e.doc.resolve(t), i = e.doc.resolve(n);
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
let a = an(r, i);
|
|
2771
2782
|
for (let t = 0; t < a.length; t++) {
|
|
2772
2783
|
let n = a[t], o = t == a.length - 1;
|
|
2773
2784
|
if (o && n == 0 || r.node(n).type.contentMatch.validEnd) return e.delete(r.start(n), i.end(n));
|
|
@@ -2776,7 +2787,7 @@ function an(e, t, n) {
|
|
|
2776
2787
|
for (let a = 1; a <= r.depth && a <= i.depth; a++) if (t - r.start(a) == r.depth - a && n > r.end(a) && i.end(a) - n != i.depth - a && r.start(a - 1) == i.start(a - 1) && r.node(a - 1).canReplace(r.index(a - 1), i.index(a - 1))) return e.delete(r.before(a), n);
|
|
2777
2788
|
e.delete(t, n);
|
|
2778
2789
|
}
|
|
2779
|
-
function
|
|
2790
|
+
function an(e, t) {
|
|
2780
2791
|
let n = [], r = Math.min(e.depth, t.depth);
|
|
2781
2792
|
for (let i = r; i >= 0; i--) {
|
|
2782
2793
|
let r = e.start(i);
|
|
@@ -2785,7 +2796,7 @@ function on(e, t) {
|
|
|
2785
2796
|
}
|
|
2786
2797
|
return n;
|
|
2787
2798
|
}
|
|
2788
|
-
var
|
|
2799
|
+
var on = class e extends C {
|
|
2789
2800
|
constructor(e, t, n) {
|
|
2790
2801
|
super(), this.pos = e, this.attr = t, this.value = n;
|
|
2791
2802
|
}
|
|
@@ -2821,8 +2832,8 @@ var sn = class e extends C {
|
|
|
2821
2832
|
return new e(n.pos, n.attr, n.value);
|
|
2822
2833
|
}
|
|
2823
2834
|
};
|
|
2824
|
-
C.jsonID("attr",
|
|
2825
|
-
var
|
|
2835
|
+
C.jsonID("attr", on);
|
|
2836
|
+
var sn = class e extends C {
|
|
2826
2837
|
constructor(e, t) {
|
|
2827
2838
|
super(), this.attr = e, this.value = t;
|
|
2828
2839
|
}
|
|
@@ -2854,13 +2865,13 @@ var cn = class e extends C {
|
|
|
2854
2865
|
return new e(n.attr, n.value);
|
|
2855
2866
|
}
|
|
2856
2867
|
};
|
|
2857
|
-
C.jsonID("docAttr",
|
|
2858
|
-
var
|
|
2859
|
-
|
|
2868
|
+
C.jsonID("docAttr", sn);
|
|
2869
|
+
var cn = class extends Error {};
|
|
2870
|
+
cn = function e(t) {
|
|
2860
2871
|
let n = Error.call(this, t);
|
|
2861
2872
|
return n.__proto__ = e.prototype, n;
|
|
2862
|
-
},
|
|
2863
|
-
var
|
|
2873
|
+
}, cn.prototype = Object.create(Error.prototype), cn.prototype.constructor = cn, cn.prototype.name = "TransformError";
|
|
2874
|
+
var ln = class {
|
|
2864
2875
|
constructor(e) {
|
|
2865
2876
|
this.doc = e, this.steps = [], this.docs = [], this.mapping = new ft();
|
|
2866
2877
|
}
|
|
@@ -2869,7 +2880,7 @@ var un = class {
|
|
|
2869
2880
|
}
|
|
2870
2881
|
step(e) {
|
|
2871
2882
|
let t = this.maybeStep(e);
|
|
2872
|
-
if (t.failed) throw new
|
|
2883
|
+
if (t.failed) throw new cn(t.failed);
|
|
2873
2884
|
return this;
|
|
2874
2885
|
}
|
|
2875
2886
|
maybeStep(e) {
|
|
@@ -2896,7 +2907,7 @@ var un = class {
|
|
|
2896
2907
|
this.docs.push(this.doc), this.steps.push(e), this.mapping.appendMap(e.getMap()), this.doc = t;
|
|
2897
2908
|
}
|
|
2898
2909
|
replace(e, t = e, n = l.empty) {
|
|
2899
|
-
let r =
|
|
2910
|
+
let r = Wt(this.doc, e, t, n);
|
|
2900
2911
|
return r && this.step(r), this;
|
|
2901
2912
|
}
|
|
2902
2913
|
replaceWith(e, t, n) {
|
|
@@ -2909,19 +2920,19 @@ var un = class {
|
|
|
2909
2920
|
return this.replaceWith(e, e, t);
|
|
2910
2921
|
}
|
|
2911
2922
|
replaceRange(e, t, n) {
|
|
2912
|
-
return
|
|
2923
|
+
return en(this, e, t, n), this;
|
|
2913
2924
|
}
|
|
2914
2925
|
replaceRangeWith(e, t, n) {
|
|
2915
|
-
return
|
|
2926
|
+
return nn(this, e, t, n), this;
|
|
2916
2927
|
}
|
|
2917
2928
|
deleteRange(e, t) {
|
|
2918
|
-
return
|
|
2929
|
+
return rn(this, e, t), this;
|
|
2919
2930
|
}
|
|
2920
2931
|
lift(e, t) {
|
|
2921
2932
|
return Tt(this, e, t), this;
|
|
2922
2933
|
}
|
|
2923
2934
|
join(e, t = 1) {
|
|
2924
|
-
return
|
|
2935
|
+
return Vt(this, e, t), this;
|
|
2925
2936
|
}
|
|
2926
2937
|
wrap(e, t) {
|
|
2927
2938
|
return At(this, e, t), this;
|
|
@@ -2933,10 +2944,10 @@ var un = class {
|
|
|
2933
2944
|
return Ft(this, e, t, n, r), this;
|
|
2934
2945
|
}
|
|
2935
2946
|
setNodeAttribute(e, t, n) {
|
|
2936
|
-
return this.step(new
|
|
2947
|
+
return this.step(new on(e, t, n)), this;
|
|
2937
2948
|
}
|
|
2938
2949
|
setDocAttribute(e, t) {
|
|
2939
|
-
return this.step(new
|
|
2950
|
+
return this.step(new sn(e, t)), this;
|
|
2940
2951
|
}
|
|
2941
2952
|
addNodeMark(e, t) {
|
|
2942
2953
|
return this.step(new _t(e, t)), this;
|
|
@@ -2953,7 +2964,7 @@ var un = class {
|
|
|
2953
2964
|
return this;
|
|
2954
2965
|
}
|
|
2955
2966
|
split(e, t = 1, n) {
|
|
2956
|
-
return
|
|
2967
|
+
return It(this, e, t, n), this;
|
|
2957
2968
|
}
|
|
2958
2969
|
addMark(e, t, n) {
|
|
2959
2970
|
return bt(this, e, t, n), this;
|
|
@@ -2964,9 +2975,9 @@ var un = class {
|
|
|
2964
2975
|
clearIncompatible(e, t, n) {
|
|
2965
2976
|
return St(this, e, t, n), this;
|
|
2966
2977
|
}
|
|
2967
|
-
},
|
|
2978
|
+
}, un = Object.create(null), O = class {
|
|
2968
2979
|
constructor(e, t, n) {
|
|
2969
|
-
this.$anchor = e, this.$head = t, this.ranges = n || [new
|
|
2980
|
+
this.$anchor = e, this.$head = t, this.ranges = n || [new dn(e.min(t), e.max(t))];
|
|
2970
2981
|
}
|
|
2971
2982
|
get anchor() {
|
|
2972
2983
|
return this.$anchor.pos;
|
|
@@ -3000,67 +3011,67 @@ var un = class {
|
|
|
3000
3011
|
let i = e.steps.length, a = this.ranges;
|
|
3001
3012
|
for (let o = 0; o < a.length; o++) {
|
|
3002
3013
|
let { $from: s, $to: c } = a[o], u = e.mapping.slice(i);
|
|
3003
|
-
e.replaceRange(u.map(s.pos), u.map(c.pos), o ? l.empty : t), o == 0 &&
|
|
3014
|
+
e.replaceRange(u.map(s.pos), u.map(c.pos), o ? l.empty : t), o == 0 && vn(e, i, (n ? n.isInline : r && r.isTextblock) ? -1 : 1);
|
|
3004
3015
|
}
|
|
3005
3016
|
}
|
|
3006
3017
|
replaceWith(e, t) {
|
|
3007
3018
|
let n = e.steps.length, r = this.ranges;
|
|
3008
3019
|
for (let i = 0; i < r.length; i++) {
|
|
3009
3020
|
let { $from: a, $to: o } = r[i], s = e.mapping.slice(n), c = s.map(a.pos), l = s.map(o.pos);
|
|
3010
|
-
i ? e.deleteRange(c, l) : (e.replaceRangeWith(c, l, t),
|
|
3021
|
+
i ? e.deleteRange(c, l) : (e.replaceRangeWith(c, l, t), vn(e, n, t.isInline ? -1 : 1));
|
|
3011
3022
|
}
|
|
3012
3023
|
}
|
|
3013
3024
|
static findFrom(e, t, n = !1) {
|
|
3014
|
-
let r = e.parent.inlineContent ? new
|
|
3025
|
+
let r = e.parent.inlineContent ? new k(e) : _n(e.node(0), e.parent, e.pos, e.index(), t, n);
|
|
3015
3026
|
if (r) return r;
|
|
3016
3027
|
for (let r = e.depth - 1; r >= 0; r--) {
|
|
3017
|
-
let i = t < 0 ?
|
|
3028
|
+
let i = t < 0 ? _n(e.node(0), e.node(r), e.before(r + 1), e.index(r), t, n) : _n(e.node(0), e.node(r), e.after(r + 1), e.index(r) + 1, t, n);
|
|
3018
3029
|
if (i) return i;
|
|
3019
3030
|
}
|
|
3020
3031
|
return null;
|
|
3021
3032
|
}
|
|
3022
3033
|
static near(e, t = 1) {
|
|
3023
|
-
return this.findFrom(e, t) || this.findFrom(e, -t) || new
|
|
3034
|
+
return this.findFrom(e, t) || this.findFrom(e, -t) || new j(e.node(0));
|
|
3024
3035
|
}
|
|
3025
3036
|
static atStart(e) {
|
|
3026
|
-
return
|
|
3037
|
+
return _n(e, e, 0, 0, 1) || new j(e);
|
|
3027
3038
|
}
|
|
3028
3039
|
static atEnd(e) {
|
|
3029
|
-
return
|
|
3040
|
+
return _n(e, e, e.content.size, e.childCount, -1) || new j(e);
|
|
3030
3041
|
}
|
|
3031
3042
|
static fromJSON(e, t) {
|
|
3032
3043
|
if (!t || !t.type) throw RangeError("Invalid input for Selection.fromJSON");
|
|
3033
|
-
let n =
|
|
3044
|
+
let n = un[t.type];
|
|
3034
3045
|
if (!n) throw RangeError(`No selection type ${t.type} defined`);
|
|
3035
3046
|
return n.fromJSON(e, t);
|
|
3036
3047
|
}
|
|
3037
3048
|
static jsonID(e, t) {
|
|
3038
|
-
if (e in
|
|
3039
|
-
return
|
|
3049
|
+
if (e in un) throw RangeError("Duplicate use of selection JSON ID " + e);
|
|
3050
|
+
return un[e] = t, t.prototype.jsonID = e, t;
|
|
3040
3051
|
}
|
|
3041
3052
|
getBookmark() {
|
|
3042
|
-
return
|
|
3053
|
+
return k.between(this.$anchor, this.$head).getBookmark();
|
|
3043
3054
|
}
|
|
3044
3055
|
};
|
|
3045
|
-
|
|
3046
|
-
var
|
|
3056
|
+
O.prototype.visible = !0;
|
|
3057
|
+
var dn = class {
|
|
3047
3058
|
constructor(e, t) {
|
|
3048
3059
|
this.$from = e, this.$to = t;
|
|
3049
3060
|
}
|
|
3050
|
-
},
|
|
3051
|
-
function
|
|
3052
|
-
!
|
|
3061
|
+
}, fn = !1;
|
|
3062
|
+
function pn(e) {
|
|
3063
|
+
!fn && !e.parent.inlineContent && (fn = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + e.parent.type.name + ")"));
|
|
3053
3064
|
}
|
|
3054
|
-
var
|
|
3065
|
+
var k = class e extends O {
|
|
3055
3066
|
constructor(e, t = e) {
|
|
3056
|
-
|
|
3067
|
+
pn(e), pn(t), super(e, t);
|
|
3057
3068
|
}
|
|
3058
3069
|
get $cursor() {
|
|
3059
3070
|
return this.$anchor.pos == this.$head.pos ? this.$head : null;
|
|
3060
3071
|
}
|
|
3061
3072
|
map(t, n) {
|
|
3062
3073
|
let r = t.resolve(n.map(this.head));
|
|
3063
|
-
if (!r.parent.inlineContent) return
|
|
3074
|
+
if (!r.parent.inlineContent) return O.near(r);
|
|
3064
3075
|
let i = t.resolve(n.map(this.anchor));
|
|
3065
3076
|
return new e(i.parent.inlineContent ? i : r, r);
|
|
3066
3077
|
}
|
|
@@ -3074,7 +3085,7 @@ var O = class e extends D {
|
|
|
3074
3085
|
return t instanceof e && t.anchor == this.anchor && t.head == this.head;
|
|
3075
3086
|
}
|
|
3076
3087
|
getBookmark() {
|
|
3077
|
-
return new
|
|
3088
|
+
return new mn(this.anchor, this.head);
|
|
3078
3089
|
}
|
|
3079
3090
|
toJSON() {
|
|
3080
3091
|
return {
|
|
@@ -3094,15 +3105,15 @@ var O = class e extends D {
|
|
|
3094
3105
|
static between(t, n, r) {
|
|
3095
3106
|
let i = t.pos - n.pos;
|
|
3096
3107
|
if ((!r || i) && (r = i >= 0 ? 1 : -1), !n.parent.inlineContent) {
|
|
3097
|
-
let e =
|
|
3108
|
+
let e = O.findFrom(n, r, !0) || O.findFrom(n, -r, !0);
|
|
3098
3109
|
if (e) n = e.$head;
|
|
3099
|
-
else return
|
|
3110
|
+
else return O.near(n, r);
|
|
3100
3111
|
}
|
|
3101
|
-
return t.parent.inlineContent || (i == 0 ? t = n : (t = (
|
|
3112
|
+
return t.parent.inlineContent || (i == 0 ? t = n : (t = (O.findFrom(t, -r, !0) || O.findFrom(t, r, !0)).$anchor, t.pos < n.pos != i < 0 && (t = n))), new e(t, n);
|
|
3102
3113
|
}
|
|
3103
3114
|
};
|
|
3104
|
-
|
|
3105
|
-
var
|
|
3115
|
+
O.jsonID("text", k);
|
|
3116
|
+
var mn = class e {
|
|
3106
3117
|
constructor(e, t) {
|
|
3107
3118
|
this.anchor = e, this.head = t;
|
|
3108
3119
|
}
|
|
@@ -3110,16 +3121,16 @@ var hn = class e {
|
|
|
3110
3121
|
return new e(t.map(this.anchor), t.map(this.head));
|
|
3111
3122
|
}
|
|
3112
3123
|
resolve(e) {
|
|
3113
|
-
return
|
|
3124
|
+
return k.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
3114
3125
|
}
|
|
3115
|
-
},
|
|
3126
|
+
}, A = class e extends O {
|
|
3116
3127
|
constructor(e) {
|
|
3117
3128
|
let t = e.nodeAfter, n = e.node(0).resolve(e.pos + t.nodeSize);
|
|
3118
3129
|
super(e, n), this.node = t;
|
|
3119
3130
|
}
|
|
3120
3131
|
map(t, n) {
|
|
3121
3132
|
let { deleted: r, pos: i } = n.mapResult(this.anchor), a = t.resolve(i);
|
|
3122
|
-
return r ?
|
|
3133
|
+
return r ? O.near(a) : new e(a);
|
|
3123
3134
|
}
|
|
3124
3135
|
content() {
|
|
3125
3136
|
return new l(r.from(this.node), 0, 0);
|
|
@@ -3134,7 +3145,7 @@ var hn = class e {
|
|
|
3134
3145
|
};
|
|
3135
3146
|
}
|
|
3136
3147
|
getBookmark() {
|
|
3137
|
-
return new
|
|
3148
|
+
return new hn(this.anchor);
|
|
3138
3149
|
}
|
|
3139
3150
|
static fromJSON(t, n) {
|
|
3140
3151
|
if (typeof n.anchor != "number") throw RangeError("Invalid input for NodeSelection.fromJSON");
|
|
@@ -3147,27 +3158,27 @@ var hn = class e {
|
|
|
3147
3158
|
return !e.isText && e.type.spec.selectable !== !1;
|
|
3148
3159
|
}
|
|
3149
3160
|
};
|
|
3150
|
-
|
|
3151
|
-
var
|
|
3161
|
+
A.prototype.visible = !1, O.jsonID("node", A);
|
|
3162
|
+
var hn = class e {
|
|
3152
3163
|
constructor(e) {
|
|
3153
3164
|
this.anchor = e;
|
|
3154
3165
|
}
|
|
3155
3166
|
map(t) {
|
|
3156
3167
|
let { deleted: n, pos: r } = t.mapResult(this.anchor);
|
|
3157
|
-
return n ? new
|
|
3168
|
+
return n ? new mn(r, r) : new e(r);
|
|
3158
3169
|
}
|
|
3159
3170
|
resolve(e) {
|
|
3160
3171
|
let t = e.resolve(this.anchor), n = t.nodeAfter;
|
|
3161
|
-
return n &&
|
|
3172
|
+
return n && A.isSelectable(n) ? new A(t) : O.near(t);
|
|
3162
3173
|
}
|
|
3163
|
-
},
|
|
3174
|
+
}, j = class e extends O {
|
|
3164
3175
|
constructor(e) {
|
|
3165
3176
|
super(e.resolve(0), e.resolve(e.content.size));
|
|
3166
3177
|
}
|
|
3167
3178
|
replace(e, t = l.empty) {
|
|
3168
3179
|
if (t == l.empty) {
|
|
3169
3180
|
e.delete(0, e.doc.content.size);
|
|
3170
|
-
let t =
|
|
3181
|
+
let t = O.atStart(e.doc);
|
|
3171
3182
|
t.eq(e.selection) || e.setSelection(t);
|
|
3172
3183
|
} else super.replace(e, t);
|
|
3173
3184
|
}
|
|
@@ -3184,31 +3195,31 @@ var gn = class e {
|
|
|
3184
3195
|
return t instanceof e;
|
|
3185
3196
|
}
|
|
3186
3197
|
getBookmark() {
|
|
3187
|
-
return
|
|
3198
|
+
return gn;
|
|
3188
3199
|
}
|
|
3189
3200
|
};
|
|
3190
|
-
|
|
3191
|
-
var
|
|
3201
|
+
O.jsonID("all", j);
|
|
3202
|
+
var gn = {
|
|
3192
3203
|
map() {
|
|
3193
3204
|
return this;
|
|
3194
3205
|
},
|
|
3195
3206
|
resolve(e) {
|
|
3196
|
-
return new
|
|
3207
|
+
return new j(e);
|
|
3197
3208
|
}
|
|
3198
3209
|
};
|
|
3199
|
-
function
|
|
3200
|
-
if (t.inlineContent) return
|
|
3210
|
+
function _n(e, t, n, r, i, a = !1) {
|
|
3211
|
+
if (t.inlineContent) return k.create(e, n);
|
|
3201
3212
|
for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < t.childCount : o >= 0; o += i) {
|
|
3202
3213
|
let r = t.child(o);
|
|
3203
3214
|
if (!r.isAtom) {
|
|
3204
|
-
let t =
|
|
3215
|
+
let t = _n(e, r, n + i, i < 0 ? r.childCount : 0, i, a);
|
|
3205
3216
|
if (t) return t;
|
|
3206
|
-
} else if (!a &&
|
|
3217
|
+
} else if (!a && A.isSelectable(r)) return A.create(e, n - (i < 0 ? r.nodeSize : 0));
|
|
3207
3218
|
n += r.nodeSize * i;
|
|
3208
3219
|
}
|
|
3209
3220
|
return null;
|
|
3210
3221
|
}
|
|
3211
|
-
function
|
|
3222
|
+
function vn(e, t, n) {
|
|
3212
3223
|
let r = e.steps.length - 1;
|
|
3213
3224
|
if (r < t) return;
|
|
3214
3225
|
let i = e.steps[r];
|
|
@@ -3216,9 +3227,9 @@ function yn(e, t, n) {
|
|
|
3216
3227
|
let a = e.mapping.maps[r], o;
|
|
3217
3228
|
a.forEach((e, t, n, r) => {
|
|
3218
3229
|
o ??= r;
|
|
3219
|
-
}), e.setSelection(
|
|
3230
|
+
}), e.setSelection(O.near(e.doc.resolve(o), n));
|
|
3220
3231
|
}
|
|
3221
|
-
var
|
|
3232
|
+
var yn = 1, bn = 2, xn = 4, Sn = class extends ln {
|
|
3222
3233
|
constructor(e) {
|
|
3223
3234
|
super(e.doc), this.curSelectionFor = 0, this.updated = 0, this.meta = Object.create(null), this.time = Date.now(), this.curSelection = e.selection, this.storedMarks = e.storedMarks;
|
|
3224
3235
|
}
|
|
@@ -3227,13 +3238,13 @@ var bn = 1, xn = 2, Sn = 4, Cn = class extends un {
|
|
|
3227
3238
|
}
|
|
3228
3239
|
setSelection(e) {
|
|
3229
3240
|
if (e.$from.doc != this.doc) throw RangeError("Selection passed to setSelection must point at the current document");
|
|
3230
|
-
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated |
|
|
3241
|
+
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | yn) & ~bn, this.storedMarks = null, this;
|
|
3231
3242
|
}
|
|
3232
3243
|
get selectionSet() {
|
|
3233
|
-
return (this.updated &
|
|
3244
|
+
return (this.updated & yn) > 0;
|
|
3234
3245
|
}
|
|
3235
3246
|
setStoredMarks(e) {
|
|
3236
|
-
return this.storedMarks = e, this.updated |=
|
|
3247
|
+
return this.storedMarks = e, this.updated |= bn, this;
|
|
3237
3248
|
}
|
|
3238
3249
|
ensureMarks(e) {
|
|
3239
3250
|
return s.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
|
|
@@ -3245,10 +3256,10 @@ var bn = 1, xn = 2, Sn = 4, Cn = class extends un {
|
|
|
3245
3256
|
return this.ensureMarks(e.removeFromSet(this.storedMarks || this.selection.$head.marks()));
|
|
3246
3257
|
}
|
|
3247
3258
|
get storedMarksSet() {
|
|
3248
|
-
return (this.updated &
|
|
3259
|
+
return (this.updated & bn) > 0;
|
|
3249
3260
|
}
|
|
3250
3261
|
addStep(e, t) {
|
|
3251
|
-
super.addStep(e, t), this.updated &= ~
|
|
3262
|
+
super.addStep(e, t), this.updated &= ~bn, this.storedMarks = null;
|
|
3252
3263
|
}
|
|
3253
3264
|
setTime(e) {
|
|
3254
3265
|
return this.time = e, this;
|
|
@@ -3273,7 +3284,7 @@ var bn = 1, xn = 2, Sn = 4, Cn = class extends un {
|
|
|
3273
3284
|
let e = this.doc.resolve(t);
|
|
3274
3285
|
i = n == t ? e.marks() : e.marksAcross(this.doc.resolve(n));
|
|
3275
3286
|
}
|
|
3276
|
-
return this.replaceRangeWith(t, n, r.text(e, i)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(
|
|
3287
|
+
return this.replaceRangeWith(t, n, r.text(e, i)), !this.selection.empty && this.selection.to == t + e.length && this.setSelection(O.near(this.selection.$to)), this;
|
|
3277
3288
|
}
|
|
3278
3289
|
}
|
|
3279
3290
|
setMeta(e, t) {
|
|
@@ -3287,21 +3298,21 @@ var bn = 1, xn = 2, Sn = 4, Cn = class extends un {
|
|
|
3287
3298
|
return !0;
|
|
3288
3299
|
}
|
|
3289
3300
|
scrollIntoView() {
|
|
3290
|
-
return this.updated |=
|
|
3301
|
+
return this.updated |= xn, this;
|
|
3291
3302
|
}
|
|
3292
3303
|
get scrolledIntoView() {
|
|
3293
|
-
return (this.updated &
|
|
3304
|
+
return (this.updated & xn) > 0;
|
|
3294
3305
|
}
|
|
3295
3306
|
};
|
|
3296
|
-
function
|
|
3307
|
+
function Cn(e, t) {
|
|
3297
3308
|
return !t || !e ? e : e.bind(t);
|
|
3298
3309
|
}
|
|
3299
|
-
var
|
|
3310
|
+
var wn = class {
|
|
3300
3311
|
constructor(e, t, n) {
|
|
3301
|
-
this.name = e, this.init =
|
|
3312
|
+
this.name = e, this.init = Cn(t.init, n), this.apply = Cn(t.apply, n);
|
|
3302
3313
|
}
|
|
3303
|
-
},
|
|
3304
|
-
new
|
|
3314
|
+
}, Tn = [
|
|
3315
|
+
new wn("doc", {
|
|
3305
3316
|
init(e) {
|
|
3306
3317
|
return e.doc || e.schema.topNodeType.createAndFill();
|
|
3307
3318
|
},
|
|
@@ -3309,15 +3320,15 @@ var Tn = class {
|
|
|
3309
3320
|
return e.doc;
|
|
3310
3321
|
}
|
|
3311
3322
|
}),
|
|
3312
|
-
new
|
|
3323
|
+
new wn("selection", {
|
|
3313
3324
|
init(e, t) {
|
|
3314
|
-
return e.selection ||
|
|
3325
|
+
return e.selection || O.atStart(t.doc);
|
|
3315
3326
|
},
|
|
3316
3327
|
apply(e) {
|
|
3317
3328
|
return e.selection;
|
|
3318
3329
|
}
|
|
3319
3330
|
}),
|
|
3320
|
-
new
|
|
3331
|
+
new wn("storedMarks", {
|
|
3321
3332
|
init(e) {
|
|
3322
3333
|
return e.storedMarks || null;
|
|
3323
3334
|
},
|
|
@@ -3325,7 +3336,7 @@ var Tn = class {
|
|
|
3325
3336
|
return r.selection.$cursor ? e.storedMarks : null;
|
|
3326
3337
|
}
|
|
3327
3338
|
}),
|
|
3328
|
-
new
|
|
3339
|
+
new wn("scrollToSelection", {
|
|
3329
3340
|
init() {
|
|
3330
3341
|
return 0;
|
|
3331
3342
|
},
|
|
@@ -3333,14 +3344,14 @@ var Tn = class {
|
|
|
3333
3344
|
return e.scrolledIntoView ? t + 1 : t;
|
|
3334
3345
|
}
|
|
3335
3346
|
})
|
|
3336
|
-
],
|
|
3347
|
+
], En = class {
|
|
3337
3348
|
constructor(e, t) {
|
|
3338
|
-
this.schema = e, this.plugins = [], this.pluginsByKey = Object.create(null), this.fields =
|
|
3349
|
+
this.schema = e, this.plugins = [], this.pluginsByKey = Object.create(null), this.fields = Tn.slice(), t && t.forEach((e) => {
|
|
3339
3350
|
if (this.pluginsByKey[e.key]) throw RangeError("Adding different instances of a keyed plugin (" + e.key + ")");
|
|
3340
|
-
this.plugins.push(e), this.pluginsByKey[e.key] = e, e.spec.state && this.fields.push(new
|
|
3351
|
+
this.plugins.push(e), this.pluginsByKey[e.key] = e, e.spec.state && this.fields.push(new wn(e.key, e.spec.state, e));
|
|
3341
3352
|
});
|
|
3342
3353
|
}
|
|
3343
|
-
},
|
|
3354
|
+
}, Dn = class e {
|
|
3344
3355
|
constructor(e) {
|
|
3345
3356
|
this.config = e;
|
|
3346
3357
|
}
|
|
@@ -3407,15 +3418,15 @@ var Tn = class {
|
|
|
3407
3418
|
return n;
|
|
3408
3419
|
}
|
|
3409
3420
|
get tr() {
|
|
3410
|
-
return new
|
|
3421
|
+
return new Sn(this);
|
|
3411
3422
|
}
|
|
3412
3423
|
static create(t) {
|
|
3413
|
-
let n = new
|
|
3424
|
+
let n = new En(t.doc ? t.doc.type.schema : t.schema, t.plugins), r = new e(n);
|
|
3414
3425
|
for (let e = 0; e < n.fields.length; e++) r[n.fields[e].name] = n.fields[e].init(t, r);
|
|
3415
3426
|
return r;
|
|
3416
3427
|
}
|
|
3417
3428
|
reconfigure(t) {
|
|
3418
|
-
let n = new
|
|
3429
|
+
let n = new En(this.schema, t.plugins), r = n.fields, i = new e(n);
|
|
3419
3430
|
for (let e = 0; e < r.length; e++) {
|
|
3420
3431
|
let n = r[e].name;
|
|
3421
3432
|
i[n] = this.hasOwnProperty(n) ? this[n] : r[e].init(t, i);
|
|
@@ -3437,10 +3448,10 @@ var Tn = class {
|
|
|
3437
3448
|
static fromJSON(t, n, r) {
|
|
3438
3449
|
if (!n) throw RangeError("Invalid input for EditorState.fromJSON");
|
|
3439
3450
|
if (!t.schema) throw RangeError("Required config field 'schema' missing");
|
|
3440
|
-
let i = new
|
|
3451
|
+
let i = new En(t.schema, t.plugins), a = new e(i);
|
|
3441
3452
|
return i.fields.forEach((e) => {
|
|
3442
3453
|
if (e.name == "doc") a.doc = S.fromJSON(t.schema, n.doc);
|
|
3443
|
-
else if (e.name == "selection") a.selection =
|
|
3454
|
+
else if (e.name == "selection") a.selection = O.fromJSON(a.doc, n.selection);
|
|
3444
3455
|
else if (e.name == "storedMarks") n.storedMarks && (a.storedMarks = n.storedMarks.map(t.schema.markFromJSON));
|
|
3445
3456
|
else {
|
|
3446
3457
|
if (r) for (let i in r) {
|
|
@@ -3455,27 +3466,27 @@ var Tn = class {
|
|
|
3455
3466
|
}), a;
|
|
3456
3467
|
}
|
|
3457
3468
|
};
|
|
3458
|
-
function
|
|
3469
|
+
function On(e, t, n) {
|
|
3459
3470
|
for (let r in e) {
|
|
3460
3471
|
let i = e[r];
|
|
3461
|
-
i instanceof Function ? i = i.bind(t) : r == "handleDOMEvents" && (i =
|
|
3472
|
+
i instanceof Function ? i = i.bind(t) : r == "handleDOMEvents" && (i = On(i, t, {})), n[r] = i;
|
|
3462
3473
|
}
|
|
3463
3474
|
return n;
|
|
3464
3475
|
}
|
|
3465
|
-
var
|
|
3476
|
+
var M = class {
|
|
3466
3477
|
constructor(e) {
|
|
3467
|
-
this.spec = e, this.props = {}, e.props &&
|
|
3478
|
+
this.spec = e, this.props = {}, e.props && On(e.props, this, this.props), this.key = e.key ? e.key.key : An("plugin");
|
|
3468
3479
|
}
|
|
3469
3480
|
getState(e) {
|
|
3470
3481
|
return e[this.key];
|
|
3471
3482
|
}
|
|
3472
|
-
},
|
|
3473
|
-
function
|
|
3474
|
-
return e in
|
|
3483
|
+
}, kn = Object.create(null);
|
|
3484
|
+
function An(e) {
|
|
3485
|
+
return e in kn ? e + "$" + ++kn[e] : (kn[e] = 0, e + "$");
|
|
3475
3486
|
}
|
|
3476
|
-
var
|
|
3487
|
+
var jn = class {
|
|
3477
3488
|
constructor(e = "key") {
|
|
3478
|
-
this.key =
|
|
3489
|
+
this.key = An(e);
|
|
3479
3490
|
}
|
|
3480
3491
|
get(e) {
|
|
3481
3492
|
return e.config.pluginsByKey[this.key];
|
|
@@ -3498,12 +3509,12 @@ var Pn = (e, t, n) => {
|
|
|
3498
3509
|
}
|
|
3499
3510
|
let a = i.nodeBefore;
|
|
3500
3511
|
if (ir(e, i, t, -1)) return !0;
|
|
3501
|
-
if (r.parent.content.size == 0 && (Rn(a, "end") ||
|
|
3502
|
-
let o =
|
|
3512
|
+
if (r.parent.content.size == 0 && (Rn(a, "end") || A.isSelectable(a))) for (let n = r.depth;; n--) {
|
|
3513
|
+
let o = Wt(e.doc, r.before(n), r.after(n), l.empty);
|
|
3503
3514
|
if (o && o.slice.size < o.to - o.from) {
|
|
3504
3515
|
if (t) {
|
|
3505
3516
|
let n = e.tr.step(o);
|
|
3506
|
-
n.setSelection(Rn(a, "end") ?
|
|
3517
|
+
n.setSelection(Rn(a, "end") ? O.findFrom(n.doc.resolve(n.mapping.map(i.pos, -1)), -1) : A.create(n.doc, i.pos - a.nodeSize)), t(n.scrollIntoView());
|
|
3507
3518
|
}
|
|
3508
3519
|
return !0;
|
|
3509
3520
|
}
|
|
@@ -3536,11 +3547,11 @@ function Ln(e, t, n) {
|
|
|
3536
3547
|
if (!e) return !1;
|
|
3537
3548
|
a = e;
|
|
3538
3549
|
}
|
|
3539
|
-
let s =
|
|
3550
|
+
let s = Wt(e.doc, i, o, l.empty);
|
|
3540
3551
|
if (!s || s.from != i || s instanceof T && s.slice.size >= o - i) return !1;
|
|
3541
3552
|
if (n) {
|
|
3542
3553
|
let t = e.tr.step(s);
|
|
3543
|
-
t.setSelection(
|
|
3554
|
+
t.setSelection(k.create(t.doc, i)), n(t.scrollIntoView());
|
|
3544
3555
|
}
|
|
3545
3556
|
return !0;
|
|
3546
3557
|
}
|
|
@@ -3559,7 +3570,7 @@ var zn = (e, t, n) => {
|
|
|
3559
3570
|
a = Bn(r);
|
|
3560
3571
|
}
|
|
3561
3572
|
let o = a && a.nodeBefore;
|
|
3562
|
-
return !o || !
|
|
3573
|
+
return !o || !A.isSelectable(o) ? !1 : (t && t(e.tr.setSelection(A.create(e.doc, a.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
3563
3574
|
};
|
|
3564
3575
|
function Bn(e) {
|
|
3565
3576
|
if (!e.parent.type.spec.isolating) for (let t = e.depth - 1; t >= 0; t--) {
|
|
@@ -3579,12 +3590,12 @@ var Hn = (e, t, n) => {
|
|
|
3579
3590
|
if (!i) return !1;
|
|
3580
3591
|
let a = i.nodeAfter;
|
|
3581
3592
|
if (ir(e, i, t, 1)) return !0;
|
|
3582
|
-
if (r.parent.content.size == 0 && (Rn(a, "start") ||
|
|
3583
|
-
let n =
|
|
3593
|
+
if (r.parent.content.size == 0 && (Rn(a, "start") || A.isSelectable(a))) {
|
|
3594
|
+
let n = Wt(e.doc, r.before(), r.after(), l.empty);
|
|
3584
3595
|
if (n && n.slice.size < n.to - n.from) {
|
|
3585
3596
|
if (t) {
|
|
3586
3597
|
let r = e.tr.step(n);
|
|
3587
|
-
r.setSelection(Rn(a, "start") ?
|
|
3598
|
+
r.setSelection(Rn(a, "start") ? O.findFrom(r.doc.resolve(r.mapping.map(i.pos)), 1) : A.create(r.doc, r.mapping.map(i.pos))), t(r.scrollIntoView());
|
|
3588
3599
|
}
|
|
3589
3600
|
return !0;
|
|
3590
3601
|
}
|
|
@@ -3598,7 +3609,7 @@ var Hn = (e, t, n) => {
|
|
|
3598
3609
|
a = Wn(r);
|
|
3599
3610
|
}
|
|
3600
3611
|
let o = a && a.nodeAfter;
|
|
3601
|
-
return !o || !
|
|
3612
|
+
return !o || !A.isSelectable(o) ? !1 : (t && t(e.tr.setSelection(A.create(e.doc, a.pos)).scrollIntoView()), !0);
|
|
3602
3613
|
};
|
|
3603
3614
|
function Wn(e) {
|
|
3604
3615
|
if (!e.parent.type.spec.isolating) for (let t = e.depth - 1; t >= 0; t--) {
|
|
@@ -3609,22 +3620,22 @@ function Wn(e) {
|
|
|
3609
3620
|
return null;
|
|
3610
3621
|
}
|
|
3611
3622
|
var Gn = (e, t) => {
|
|
3612
|
-
let n = e.selection, r = n instanceof
|
|
3623
|
+
let n = e.selection, r = n instanceof A, i;
|
|
3613
3624
|
if (r) {
|
|
3614
|
-
if (n.node.isTextblock || !
|
|
3625
|
+
if (n.node.isTextblock || !Lt(e.doc, n.from)) return !1;
|
|
3615
3626
|
i = n.from;
|
|
3616
|
-
} else if (i =
|
|
3627
|
+
} else if (i = Bt(e.doc, n.from, -1), i == null) return !1;
|
|
3617
3628
|
if (t) {
|
|
3618
3629
|
let n = e.tr.join(i);
|
|
3619
|
-
r && n.setSelection(
|
|
3630
|
+
r && n.setSelection(A.create(n.doc, i - e.doc.resolve(i).nodeBefore.nodeSize)), t(n.scrollIntoView());
|
|
3620
3631
|
}
|
|
3621
3632
|
return !0;
|
|
3622
3633
|
}, Kn = (e, t) => {
|
|
3623
3634
|
let n = e.selection, r;
|
|
3624
|
-
if (n instanceof
|
|
3625
|
-
if (n.node.isTextblock || !
|
|
3635
|
+
if (n instanceof A) {
|
|
3636
|
+
if (n.node.isTextblock || !Lt(e.doc, n.to)) return !1;
|
|
3626
3637
|
r = n.to;
|
|
3627
|
-
} else if (r =
|
|
3638
|
+
} else if (r = Bt(e.doc, n.to, 1), r == null) return !1;
|
|
3628
3639
|
return t && t(e.tr.join(r).scrollIntoView()), !0;
|
|
3629
3640
|
}, qn = (e, t) => {
|
|
3630
3641
|
let { $from: n, $to: r } = e.selection, i = n.blockRange(r), a = i && wt(i);
|
|
@@ -3647,17 +3658,17 @@ var Xn = (e, t) => {
|
|
|
3647
3658
|
if (!o || !i.canReplaceWith(a, a, o)) return !1;
|
|
3648
3659
|
if (t) {
|
|
3649
3660
|
let r = n.after(), i = e.tr.replaceWith(r, r, o.createAndFill());
|
|
3650
|
-
i.setSelection(
|
|
3661
|
+
i.setSelection(O.near(i.doc.resolve(r), 1)), t(i.scrollIntoView());
|
|
3651
3662
|
}
|
|
3652
3663
|
return !0;
|
|
3653
3664
|
}, Zn = (e, t) => {
|
|
3654
3665
|
let n = e.selection, { $from: r, $to: i } = n;
|
|
3655
|
-
if (n instanceof
|
|
3666
|
+
if (n instanceof j || r.parent.inlineContent || i.parent.inlineContent) return !1;
|
|
3656
3667
|
let a = Yn(i.parent.contentMatchAt(i.indexAfter()));
|
|
3657
3668
|
if (!a || !a.isTextblock) return !1;
|
|
3658
3669
|
if (t) {
|
|
3659
3670
|
let n = (!r.parentOffset && i.index() < i.parent.childCount ? r : i).pos, o = e.tr.insert(n, a.createAndFill());
|
|
3660
|
-
o.setSelection(
|
|
3671
|
+
o.setSelection(k.create(o.doc, n + 1)), t(o.scrollIntoView());
|
|
3661
3672
|
}
|
|
3662
3673
|
return !0;
|
|
3663
3674
|
}, Qn = (e, t) => {
|
|
@@ -3665,7 +3676,7 @@ var Xn = (e, t) => {
|
|
|
3665
3676
|
if (!n || n.parent.content.size) return !1;
|
|
3666
3677
|
if (n.depth > 1 && n.after() != n.end(-1)) {
|
|
3667
3678
|
let r = n.before();
|
|
3668
|
-
if (
|
|
3679
|
+
if (D(e.doc, r)) return t && t(e.tr.split(r).scrollIntoView()), !0;
|
|
3669
3680
|
}
|
|
3670
3681
|
let r = n.blockRange(), i = r && wt(r);
|
|
3671
3682
|
return i == null ? !1 : (t && t(e.tr.lift(r, i).scrollIntoView()), !0);
|
|
@@ -3673,7 +3684,7 @@ var Xn = (e, t) => {
|
|
|
3673
3684
|
function $n(e) {
|
|
3674
3685
|
return (t, n) => {
|
|
3675
3686
|
let { $from: r, $to: i } = t.selection;
|
|
3676
|
-
if (t.selection instanceof
|
|
3687
|
+
if (t.selection instanceof A && t.selection.node.isBlock) return !r.parentOffset || !D(t.doc, r.pos) ? !1 : (n && n(t.tr.split(r.pos).scrollIntoView()), !0);
|
|
3677
3688
|
if (!r.depth) return !1;
|
|
3678
3689
|
let a = [], o, s, c = !1, l = !1;
|
|
3679
3690
|
for (let t = r.depth;; t--) if (r.node(t).isBlock) {
|
|
@@ -3686,9 +3697,9 @@ function $n(e) {
|
|
|
3686
3697
|
a.unshift(null);
|
|
3687
3698
|
}
|
|
3688
3699
|
let u = t.tr;
|
|
3689
|
-
(t.selection instanceof
|
|
3690
|
-
let d = u.mapping.map(r.pos), f =
|
|
3691
|
-
if (f ||= (a[0] = s ? { type: s } : null,
|
|
3700
|
+
(t.selection instanceof k || t.selection instanceof j) && u.deleteSelection();
|
|
3701
|
+
let d = u.mapping.map(r.pos), f = D(u.doc, d, a.length, a);
|
|
3702
|
+
if (f ||= (a[0] = s ? { type: s } : null, D(u.doc, d, a.length, a)), !f) return !1;
|
|
3692
3703
|
if (u.split(d, a.length, a), !c && l && r.node(o).type != s) {
|
|
3693
3704
|
let e = u.mapping.map(r.before(o)), t = u.doc.resolve(e);
|
|
3694
3705
|
s && r.node(o - 1).canReplaceWith(t.index(), t.index() + 1, s) && u.setNodeMarkup(u.mapping.map(r.before(o)), s);
|
|
@@ -3698,11 +3709,11 @@ function $n(e) {
|
|
|
3698
3709
|
}
|
|
3699
3710
|
var er = $n(), tr = (e, t) => {
|
|
3700
3711
|
let { $from: n, to: r } = e.selection, i, a = n.sharedDepth(r);
|
|
3701
|
-
return a == 0 ? !1 : (i = n.before(a), t && t(e.tr.setSelection(
|
|
3702
|
-
}, nr = (e, t) => (t && t(e.tr.setSelection(new
|
|
3712
|
+
return a == 0 ? !1 : (i = n.before(a), t && t(e.tr.setSelection(A.create(e.doc, i))), !0);
|
|
3713
|
+
}, nr = (e, t) => (t && t(e.tr.setSelection(new j(e.doc))), !0);
|
|
3703
3714
|
function rr(e, t, n) {
|
|
3704
3715
|
let r = t.nodeBefore, i = t.nodeAfter, a = t.index();
|
|
3705
|
-
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && t.parent.canReplace(a - 1, a) ? (n && n(e.tr.delete(t.pos - r.nodeSize, t.pos).scrollIntoView()), !0) : !t.parent.canReplace(a, a + 1) || !(i.isTextblock ||
|
|
3716
|
+
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && t.parent.canReplace(a - 1, a) ? (n && n(e.tr.delete(t.pos - r.nodeSize, t.pos).scrollIntoView()), !0) : !t.parent.canReplace(a, a + 1) || !(i.isTextblock || Lt(e.doc, t.pos)) ? !1 : (n && n(e.tr.join(t.pos).scrollIntoView()), !0);
|
|
3706
3717
|
}
|
|
3707
3718
|
function ir(e, t, n, i) {
|
|
3708
3719
|
let a = t.nodeBefore, o = t.nodeAfter, s, c, u = a.type.spec.isolating || o.type.spec.isolating;
|
|
@@ -3714,11 +3725,11 @@ function ir(e, t, n, i) {
|
|
|
3714
3725
|
for (let e = s.length - 1; e >= 0; e--) c = r.from(s[e].create(null, c));
|
|
3715
3726
|
c = r.from(a.copy(c));
|
|
3716
3727
|
let u = e.tr.step(new E(t.pos - 1, i, t.pos, i, new l(c, 1, 0), s.length, !0)), d = u.doc.resolve(i + 2 * s.length);
|
|
3717
|
-
d.nodeAfter && d.nodeAfter.type == a.type &&
|
|
3728
|
+
d.nodeAfter && d.nodeAfter.type == a.type && Lt(u.doc, d.pos) && u.join(d.pos), n(u.scrollIntoView());
|
|
3718
3729
|
}
|
|
3719
3730
|
return !0;
|
|
3720
3731
|
}
|
|
3721
|
-
let f = o.type.spec.isolating || i > 0 && u ? null :
|
|
3732
|
+
let f = o.type.spec.isolating || i > 0 && u ? null : O.findFrom(t, 1), p = f && f.$from.blockRange(f.$to), m = p && wt(p);
|
|
3722
3733
|
if (m != null && m >= t.depth) return n && n(e.tr.lift(p, m).scrollIntoView()), !0;
|
|
3723
3734
|
if (d && Rn(o, "start", !0) && Rn(a, "end")) {
|
|
3724
3735
|
let i = a, s = [];
|
|
@@ -3743,7 +3754,7 @@ function ar(e) {
|
|
|
3743
3754
|
if (!a) return !1;
|
|
3744
3755
|
a--;
|
|
3745
3756
|
}
|
|
3746
|
-
return i.node(a).isTextblock ? (n && n(t.tr.setSelection(
|
|
3757
|
+
return i.node(a).isTextblock ? (n && n(t.tr.setSelection(k.create(t.doc, e < 0 ? i.start(a) : i.end(a)))), !0) : !1;
|
|
3747
3758
|
};
|
|
3748
3759
|
}
|
|
3749
3760
|
var or = ar(-1), sr = ar(1);
|
|
@@ -3807,7 +3818,7 @@ var dr = ur(Mn, Pn, zn), fr = ur(Mn, Hn, Un), pr = {
|
|
|
3807
3818
|
for (let e in pr) mr[e] = pr[e];
|
|
3808
3819
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform();
|
|
3809
3820
|
//#endregion
|
|
3810
|
-
//#region ../../node_modules/.
|
|
3821
|
+
//#region ../../node_modules/.pnpm/prosemirror-schema-list@1.5.1/node_modules/prosemirror-schema-list/dist/index.js
|
|
3811
3822
|
function hr(e, t = null) {
|
|
3812
3823
|
return function(n, r) {
|
|
3813
3824
|
let { $from: i, $to: a } = n.selection, o = i.blockRange(a);
|
|
@@ -3821,7 +3832,7 @@ function gr(e, t, n, r = null) {
|
|
|
3821
3832
|
if (t.depth >= 2 && t.$from.node(t.depth - 1).type.compatibleContent(n) && t.startIndex == 0) {
|
|
3822
3833
|
if (t.$from.index(t.depth - 1) == 0) return !1;
|
|
3823
3834
|
let e = o.resolve(t.start - 2);
|
|
3824
|
-
a = new
|
|
3835
|
+
a = new x(e, e, t.depth), t.endIndex < t.parent.childCount && (t = new x(t.$from, o.resolve(t.$to.end(t.depth)), t.depth)), i = !0;
|
|
3825
3836
|
}
|
|
3826
3837
|
let s = Et(a, n, r, t);
|
|
3827
3838
|
return s ? (e && _r(e, t, s, i, n), !0) : !1;
|
|
@@ -3833,7 +3844,7 @@ function _r(e, t, n, i, a) {
|
|
|
3833
3844
|
let s = 0;
|
|
3834
3845
|
for (let e = 0; e < n.length; e++) n[e].type == a && (s = e + 1);
|
|
3835
3846
|
let c = n.length - s, u = t.start + n.length - (i ? 2 : 0), d = t.parent;
|
|
3836
|
-
for (let n = t.startIndex, r = t.endIndex, i = !0; n < r; n++, i = !1) !i &&
|
|
3847
|
+
for (let n = t.startIndex, r = t.endIndex, i = !0; n < r; n++, i = !1) !i && D(e.doc, u, c) && (e.split(u, c), u += 2 * c), u += d.child(n).nodeSize;
|
|
3837
3848
|
return e;
|
|
3838
3849
|
}
|
|
3839
3850
|
function vr(e) {
|
|
@@ -3844,12 +3855,12 @@ function vr(e) {
|
|
|
3844
3855
|
}
|
|
3845
3856
|
function yr(e, t, n, i) {
|
|
3846
3857
|
let a = e.tr, o = i.end, s = i.$to.end(i.depth);
|
|
3847
|
-
o < s && (a.step(new E(o - 1, s, o, s, new l(r.from(n.create(null, i.parent.copy())), 1, 0), 1, !0)), i = new
|
|
3858
|
+
o < s && (a.step(new E(o - 1, s, o, s, new l(r.from(n.create(null, i.parent.copy())), 1, 0), 1, !0)), i = new x(a.doc.resolve(i.$from.pos), a.doc.resolve(s), i.depth));
|
|
3848
3859
|
let c = wt(i);
|
|
3849
3860
|
if (c == null) return !1;
|
|
3850
3861
|
a.lift(i, c);
|
|
3851
3862
|
let u = a.doc.resolve(a.mapping.map(o, -1) - 1);
|
|
3852
|
-
return
|
|
3863
|
+
return Lt(a.doc, u.pos) && u.nodeBefore.type == u.nodeAfter.type && a.join(u.pos), t(a.scrollIntoView()), !0;
|
|
3853
3864
|
}
|
|
3854
3865
|
function br(e, t, n) {
|
|
3855
3866
|
let i = e.tr, a = n.parent;
|
|
@@ -3877,7 +3888,7 @@ function xr(e) {
|
|
|
3877
3888
|
};
|
|
3878
3889
|
}
|
|
3879
3890
|
//#endregion
|
|
3880
|
-
//#region ../../node_modules/.
|
|
3891
|
+
//#region ../../node_modules/.pnpm/prosemirror-view@1.41.8/node_modules/prosemirror-view/dist/index.js
|
|
3881
3892
|
var N = function(e) {
|
|
3882
3893
|
for (var t = 0;; t++) if (e = e.previousSibling, !e) return t;
|
|
3883
3894
|
}, Sr = function(e) {
|
|
@@ -4772,7 +4783,7 @@ var V = 0, Oi = 1, ki = 2, H = 3, Ai = class {
|
|
|
4772
4783
|
}
|
|
4773
4784
|
localCompositionInfo(e, t) {
|
|
4774
4785
|
let { from: n, to: r } = e.state.selection;
|
|
4775
|
-
if (!(e.state.selection instanceof
|
|
4786
|
+
if (!(e.state.selection instanceof k) || n < t || r > t + this.node.content.size) return null;
|
|
4776
4787
|
let i = e.input.compositionNode;
|
|
4777
4788
|
if (!i || !this.dom.contains(i.parentNode)) return null;
|
|
4778
4789
|
if (this.node.inlineContent) {
|
|
@@ -5215,9 +5226,9 @@ function ta(e, t = null) {
|
|
|
5215
5226
|
if (Nr(n)) {
|
|
5216
5227
|
for (c = o; i && !i.node;) i = i.parent;
|
|
5217
5228
|
let e = i.node;
|
|
5218
|
-
if (i && e.isAtom &&
|
|
5229
|
+
if (i && e.isAtom && A.isSelectable(e) && i.parent && !(e.isInline && jr(n.focusNode, n.focusOffset, i.dom))) {
|
|
5219
5230
|
let e = i.posBefore;
|
|
5220
|
-
l = new
|
|
5231
|
+
l = new A(o == e ? s : r.resolve(e));
|
|
5221
5232
|
}
|
|
5222
5233
|
} else {
|
|
5223
5234
|
if (n instanceof e.dom.ownerDocument.defaultView.Selection && n.rangeCount > 1) {
|
|
@@ -5254,7 +5265,7 @@ function ra(e, t = !1) {
|
|
|
5254
5265
|
if (e.domObserver.disconnectSelection(), e.cursorWrapper) la(e);
|
|
5255
5266
|
else {
|
|
5256
5267
|
let { anchor: r, head: i } = n, a, o;
|
|
5257
|
-
ia && !(n instanceof
|
|
5268
|
+
ia && !(n instanceof k) && (n.$from.parent.inlineContent || (a = aa(e, n.from)), !n.empty && !n.$from.parent.inlineContent && (o = aa(e, n.to))), e.docView.setSelection(r, i, e, t), ia && (a && sa(a), o && sa(o)), n.visible ? e.dom.classList.remove("ProseMirror-hideselection") : (e.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ca(e));
|
|
5258
5269
|
}
|
|
5259
5270
|
e.domObserver.setCurSelection(), e.domObserver.connectSelection();
|
|
5260
5271
|
}
|
|
@@ -5291,7 +5302,7 @@ function la(e) {
|
|
|
5291
5302
|
r ? t.collapse(n.parentNode, N(n) + 1) : t.collapse(n, 0), !r && !e.state.selection.visible && I && Hr <= 11 && (n.disabled = !0, n.disabled = !1);
|
|
5292
5303
|
}
|
|
5293
5304
|
function ua(e, t) {
|
|
5294
|
-
if (t instanceof
|
|
5305
|
+
if (t instanceof A) {
|
|
5295
5306
|
let n = e.docView.descAt(t.from);
|
|
5296
5307
|
n != e.lastSelectedViewDesc && (da(e), n && n.selectNode(), e.lastSelectedViewDesc = n);
|
|
5297
5308
|
} else da(e);
|
|
@@ -5300,7 +5311,7 @@ function da(e) {
|
|
|
5300
5311
|
e.lastSelectedViewDesc &&= (e.lastSelectedViewDesc.parent && e.lastSelectedViewDesc.deselectNode(), void 0);
|
|
5301
5312
|
}
|
|
5302
5313
|
function fa(e, t, n, r) {
|
|
5303
|
-
return e.someProp("createSelectionBetween", (r) => r(e, t, n)) ||
|
|
5314
|
+
return e.someProp("createSelectionBetween", (r) => r(e, t, n)) || k.between(t, n, r);
|
|
5304
5315
|
}
|
|
5305
5316
|
function pa(e) {
|
|
5306
5317
|
return e.editable && !e.hasFocus() ? !1 : ma(e);
|
|
@@ -5320,30 +5331,30 @@ function ha(e) {
|
|
|
5320
5331
|
}
|
|
5321
5332
|
function ga(e, t) {
|
|
5322
5333
|
let { $anchor: n, $head: r } = e.selection, i = t > 0 ? n.max(r) : n.min(r), a = i.parent.inlineContent ? i.depth ? e.doc.resolve(t > 0 ? i.after() : i.before()) : null : i;
|
|
5323
|
-
return a &&
|
|
5334
|
+
return a && O.findFrom(a, t);
|
|
5324
5335
|
}
|
|
5325
5336
|
function _a(e, t) {
|
|
5326
5337
|
return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()), !0;
|
|
5327
5338
|
}
|
|
5328
5339
|
function va(e, t, n) {
|
|
5329
5340
|
let r = e.state.selection;
|
|
5330
|
-
if (r instanceof
|
|
5341
|
+
if (r instanceof k) {
|
|
5331
5342
|
if (n.indexOf("s") > -1) {
|
|
5332
5343
|
let { $head: n } = r, i = n.textOffset ? null : t < 0 ? n.nodeBefore : n.nodeAfter;
|
|
5333
5344
|
if (!i || i.isText || !i.isLeaf) return !1;
|
|
5334
5345
|
let a = e.state.doc.resolve(n.pos + i.nodeSize * (t < 0 ? -1 : 1));
|
|
5335
|
-
return _a(e, new
|
|
5346
|
+
return _a(e, new k(r.$anchor, a));
|
|
5336
5347
|
} else if (!r.empty) return !1;
|
|
5337
5348
|
else if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
|
|
5338
5349
|
let n = ga(e.state, t);
|
|
5339
|
-
return n && n instanceof
|
|
5350
|
+
return n && n instanceof A ? _a(e, n) : !1;
|
|
5340
5351
|
} else if (!(B && n.indexOf("m") > -1)) {
|
|
5341
5352
|
let n = r.$head, i = n.textOffset ? null : t < 0 ? n.nodeBefore : n.nodeAfter, a;
|
|
5342
5353
|
if (!i || i.isText) return !1;
|
|
5343
5354
|
let o = t < 0 ? n.pos - i.nodeSize : n.pos;
|
|
5344
|
-
return i.isAtom || (a = e.docView.descAt(o)) && !a.contentDOM ?
|
|
5355
|
+
return i.isAtom || (a = e.docView.descAt(o)) && !a.contentDOM ? A.isSelectable(i) ? _a(e, new A(t < 0 ? e.state.doc.resolve(n.pos - i.nodeSize) : n)) : Jr ? _a(e, new k(e.state.doc.resolve(t < 0 ? o : o + i.nodeSize))) : !1 : !1;
|
|
5345
5356
|
}
|
|
5346
|
-
} else if (r instanceof
|
|
5357
|
+
} else if (r instanceof A && r.node.isInline) return _a(e, new k(t > 0 ? r.$to : r.$from));
|
|
5347
5358
|
else {
|
|
5348
5359
|
let n = ga(e.state, t);
|
|
5349
5360
|
return n ? _a(e, n) : !1;
|
|
@@ -5460,20 +5471,20 @@ function Oa(e, t) {
|
|
|
5460
5471
|
}
|
|
5461
5472
|
function ka(e, t, n) {
|
|
5462
5473
|
let r = e.state.selection;
|
|
5463
|
-
if (r instanceof
|
|
5474
|
+
if (r instanceof k && !r.empty || n.indexOf("s") > -1 || B && n.indexOf("m") > -1) return !1;
|
|
5464
5475
|
let { $from: i, $to: a } = r;
|
|
5465
5476
|
if (!i.parent.inlineContent || e.endOfTextblock(t < 0 ? "up" : "down")) {
|
|
5466
5477
|
let n = ga(e.state, t);
|
|
5467
|
-
if (n && n instanceof
|
|
5478
|
+
if (n && n instanceof A) return _a(e, n);
|
|
5468
5479
|
}
|
|
5469
5480
|
if (!i.parent.inlineContent) {
|
|
5470
|
-
let n = t < 0 ? i : a, o = r instanceof
|
|
5481
|
+
let n = t < 0 ? i : a, o = r instanceof j ? O.near(n, t) : O.findFrom(n, t);
|
|
5471
5482
|
return o ? _a(e, o) : !1;
|
|
5472
5483
|
}
|
|
5473
5484
|
return !1;
|
|
5474
5485
|
}
|
|
5475
5486
|
function Aa(e, t) {
|
|
5476
|
-
if (!(e.state.selection instanceof
|
|
5487
|
+
if (!(e.state.selection instanceof k)) return !0;
|
|
5477
5488
|
let { $head: n, $anchor: r, empty: i } = e.state.selection;
|
|
5478
5489
|
if (!n.sameParent(r)) return !0;
|
|
5479
5490
|
if (!i) return !1;
|
|
@@ -5758,7 +5769,7 @@ W.keydown = (e, t) => {
|
|
|
5758
5769
|
return;
|
|
5759
5770
|
}
|
|
5760
5771
|
let r = e.state.selection;
|
|
5761
|
-
if (!(r instanceof
|
|
5772
|
+
if (!(r instanceof k) || !r.$from.sameParent(r.$to)) {
|
|
5762
5773
|
let t = String.fromCharCode(n.charCode), i = () => e.state.tr.insertText(t).scrollIntoView();
|
|
5763
5774
|
!/[\r\n]/.test(t) && !e.someProp("handleTextInput", (n) => n(e, r.$from.pos, r.$to.pos, t, i)) && e.dispatch(i()), n.preventDefault();
|
|
5764
5775
|
}
|
|
@@ -5787,21 +5798,21 @@ function uo(e, t, n) {
|
|
|
5787
5798
|
function fo(e, t) {
|
|
5788
5799
|
if (t == -1) return !1;
|
|
5789
5800
|
let n = e.state.doc.resolve(t), r = n.nodeAfter;
|
|
5790
|
-
return r && r.isAtom &&
|
|
5801
|
+
return r && r.isAtom && A.isSelectable(r) ? (uo(e, new A(n), "pointer"), !0) : !1;
|
|
5791
5802
|
}
|
|
5792
5803
|
function po(e, t) {
|
|
5793
5804
|
if (t == -1) return !1;
|
|
5794
5805
|
let n = e.state.selection, r, i;
|
|
5795
|
-
n instanceof
|
|
5806
|
+
n instanceof A && (r = n.node);
|
|
5796
5807
|
let a = e.state.doc.resolve(t);
|
|
5797
5808
|
for (let e = a.depth + 1; e > 0; e--) {
|
|
5798
5809
|
let t = e > a.depth ? a.nodeAfter : a.node(e);
|
|
5799
|
-
if (
|
|
5810
|
+
if (A.isSelectable(t)) {
|
|
5800
5811
|
i = r && n.$from.depth > 0 && e >= n.$from.depth && a.before(n.$from.depth + 1) == n.$from.pos ? a.before(n.$from.depth) : a.before(e);
|
|
5801
5812
|
break;
|
|
5802
5813
|
}
|
|
5803
5814
|
}
|
|
5804
|
-
return i == null ? !1 : (uo(e,
|
|
5815
|
+
return i == null ? !1 : (uo(e, A.create(e.state.doc, i), "pointer"), !0);
|
|
5805
5816
|
}
|
|
5806
5817
|
function mo(e, t, n, r, i) {
|
|
5807
5818
|
return lo(e, "handleClickOn", t, n, r) || e.someProp("handleClick", (n) => n(e, t, r)) || (i ? po(e, n) : fo(e, n));
|
|
@@ -5815,12 +5826,12 @@ function go(e, t, n, r) {
|
|
|
5815
5826
|
function _o(e, t, n) {
|
|
5816
5827
|
if (n.button != 0) return !1;
|
|
5817
5828
|
let r = e.state.doc;
|
|
5818
|
-
if (t == -1) return r.inlineContent ? (uo(e,
|
|
5829
|
+
if (t == -1) return r.inlineContent ? (uo(e, k.create(r, 0, r.content.size), "pointer"), !0) : !1;
|
|
5819
5830
|
let i = r.resolve(t);
|
|
5820
5831
|
for (let t = i.depth + 1; t > 0; t--) {
|
|
5821
5832
|
let n = t > i.depth ? i.nodeAfter : i.node(t), a = i.before(t);
|
|
5822
|
-
if (n.inlineContent) uo(e,
|
|
5823
|
-
else if (
|
|
5833
|
+
if (n.inlineContent) uo(e, k.create(r, a + 1, a + 1 + n.content.size), "pointer");
|
|
5834
|
+
else if (A.isSelectable(n)) uo(e, A.create(r, a), "pointer");
|
|
5824
5835
|
else continue;
|
|
5825
5836
|
return !0;
|
|
5826
5837
|
}
|
|
@@ -5855,7 +5866,7 @@ var bo = class {
|
|
|
5855
5866
|
let o = r ? null : n.target, s = o ? e.docView.nearestDesc(o, !0) : null;
|
|
5856
5867
|
this.target = s && s.nodeDOM.nodeType == 1 ? s.nodeDOM : null;
|
|
5857
5868
|
let { selection: c } = e.state;
|
|
5858
|
-
|
|
5869
|
+
n.button == 0 && (i.type.spec.draggable && i.type.spec.selectable !== !1 || c instanceof A && c.from <= a && c.to > a) && (this.mightDrag = {
|
|
5859
5870
|
node: i,
|
|
5860
5871
|
pos: a,
|
|
5861
5872
|
addAttr: !!(this.target && !this.target.draggable),
|
|
@@ -5870,7 +5881,7 @@ var bo = class {
|
|
|
5870
5881
|
up(e) {
|
|
5871
5882
|
if (this.done(), !this.view.dom.contains(e.target)) return;
|
|
5872
5883
|
let t = this.pos;
|
|
5873
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(so(e))), this.updateAllowDefault(e), this.allowDefault || !t ? to(this.view, "pointer") : mo(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || z && this.mightDrag && !this.mightDrag.node.isAtom || R && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (uo(this.view,
|
|
5884
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(so(e))), this.updateAllowDefault(e), this.allowDefault || !t ? to(this.view, "pointer") : mo(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || z && this.mightDrag && !this.mightDrag.node.isAtom || R && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (uo(this.view, O.near(this.view.state.doc.resolve(t.pos)), "pointer"), e.preventDefault()) : to(this.view, "pointer");
|
|
5874
5885
|
}
|
|
5875
5886
|
move(e) {
|
|
5876
5887
|
this.updateAllowDefault(e), to(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -5892,7 +5903,7 @@ W.compositionstart = W.compositionupdate = (e) => {
|
|
|
5892
5903
|
if (!e.composing) {
|
|
5893
5904
|
e.domObserver.flush();
|
|
5894
5905
|
let { state: t } = e, n = t.selection.$to;
|
|
5895
|
-
if (t.selection instanceof
|
|
5906
|
+
if (t.selection instanceof k && (t.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((e) => e.type.spec.inclusive === !1) || R && Kr && Co(e))) e.markCursor = e.state.storedMarks || n.marks(), Oo(e, !0), e.markCursor = null;
|
|
5896
5907
|
else if (Oo(e, !t.selection.empty), L && t.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
|
|
5897
5908
|
let t = e.domSelectionRange();
|
|
5898
5909
|
for (let n = t.focusNode, r = t.focusOffset; n && n.nodeType == 1 && r != 0;) {
|
|
@@ -6005,17 +6016,20 @@ var Fo = class {
|
|
|
6005
6016
|
}
|
|
6006
6017
|
}, Io = B ? "altKey" : "ctrlKey";
|
|
6007
6018
|
function Lo(e, t) {
|
|
6008
|
-
|
|
6019
|
+
let n;
|
|
6020
|
+
return e.someProp("dragCopies", (e) => {
|
|
6021
|
+
n ||= e(t);
|
|
6022
|
+
}), n == null ? !t[Io] : !n;
|
|
6009
6023
|
}
|
|
6010
6024
|
U.dragstart = (e, t) => {
|
|
6011
6025
|
let n = t, r = e.input.mouseDown;
|
|
6012
6026
|
if (r && r.done(), !n.dataTransfer) return;
|
|
6013
6027
|
let i = e.state.selection, a = i.empty ? null : e.posAtCoords(so(n)), o;
|
|
6014
|
-
if (!(a && a.pos >= i.from && a.pos <= (i instanceof
|
|
6015
|
-
if (r && r.mightDrag) o =
|
|
6028
|
+
if (!(a && a.pos >= i.from && a.pos <= (i instanceof A ? i.to - 1 : i.to))) {
|
|
6029
|
+
if (r && r.mightDrag) o = A.create(e.state.doc, r.mightDrag.pos);
|
|
6016
6030
|
else if (n.target && n.target.nodeType == 1) {
|
|
6017
6031
|
let t = e.docView.nearestDesc(n.target, !0);
|
|
6018
|
-
t && t.node.type.spec.draggable && t != e.docView && (o =
|
|
6032
|
+
t && t.node.type.spec.draggable && t != e.docView && (o = A.create(e.state.doc, t.posBefore));
|
|
6019
6033
|
}
|
|
6020
6034
|
}
|
|
6021
6035
|
let { dom: s, text: c, slice: l } = Fa(e, (o || e.state.selection).content());
|
|
@@ -6047,7 +6061,7 @@ function Ro(e, t, n) {
|
|
|
6047
6061
|
}
|
|
6048
6062
|
if (!a) return;
|
|
6049
6063
|
t.preventDefault();
|
|
6050
|
-
let s = a ?
|
|
6064
|
+
let s = a ? Ut(e.state.doc, i.pos, a) : i.pos;
|
|
6051
6065
|
s ??= i.pos;
|
|
6052
6066
|
let c = e.state.tr;
|
|
6053
6067
|
if (o) {
|
|
@@ -6057,7 +6071,7 @@ function Ro(e, t, n) {
|
|
|
6057
6071
|
let u = c.mapping.map(s), d = a.openStart == 0 && a.openEnd == 0 && a.content.childCount == 1, f = c.doc;
|
|
6058
6072
|
if (d ? c.replaceRangeWith(u, u, a.content.firstChild) : c.replaceRange(u, u, a), c.doc.eq(f)) return;
|
|
6059
6073
|
let p = c.doc.resolve(u);
|
|
6060
|
-
if (d &&
|
|
6074
|
+
if (d && A.isSelectable(a.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(a.content.firstChild)) c.setSelection(new A(p));
|
|
6061
6075
|
else {
|
|
6062
6076
|
let t = c.mapping.map(s);
|
|
6063
6077
|
c.mapping.maps[c.mapping.maps.length - 1].forEach((e, n, r, i) => t = i), c.setSelection(fa(e, p, c.doc.resolve(t)));
|
|
@@ -6578,7 +6592,7 @@ var rs = {
|
|
|
6578
6592
|
}
|
|
6579
6593
|
}
|
|
6580
6594
|
let c = null;
|
|
6581
|
-
i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Nr(n) && (c = ta(e)) && c.eq(
|
|
6595
|
+
i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Nr(n) && (c = ta(e)) && c.eq(O.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, ra(e), this.currentSelection.set(n), e.scrollToSelection()) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, a), us(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, ms(e, s)), this.handleDOMChange(i, a, o, s), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || ra(e), this.currentSelection.set(n));
|
|
6582
6596
|
}
|
|
6583
6597
|
registerMutation(e, t) {
|
|
6584
6598
|
if (t.indexOf(e.target) > -1) return null;
|
|
@@ -6745,7 +6759,7 @@ function vs(e, t, n, r, i) {
|
|
|
6745
6759
|
e.input.lastIOSEnter = 0;
|
|
6746
6760
|
return;
|
|
6747
6761
|
}
|
|
6748
|
-
if (!m) if (r && c instanceof
|
|
6762
|
+
if (!m) if (r && c instanceof k && !c.empty && c.$head.sameParent(c.$anchor) && !e.composing && !(l.sel && l.sel.anchor != l.sel.head)) m = {
|
|
6749
6763
|
start: c.from,
|
|
6750
6764
|
endA: c.to,
|
|
6751
6765
|
endB: c.to
|
|
@@ -6760,7 +6774,7 @@ function vs(e, t, n, r, i) {
|
|
|
6760
6774
|
}
|
|
6761
6775
|
return;
|
|
6762
6776
|
}
|
|
6763
|
-
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof
|
|
6777
|
+
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof k && (m.start > e.state.selection.from && m.start <= e.state.selection.from + 2 && e.state.selection.from >= l.from ? m.start = e.state.selection.from : m.endA < e.state.selection.to && m.endA >= e.state.selection.to - 2 && e.state.selection.to <= l.to && (m.endB += e.state.selection.to - m.endA, m.endA = e.state.selection.to)), I && Hr <= 11 && m.endB == m.start + 1 && m.endA == m.start && m.start > l.from && l.doc.textBetween(m.start - l.from - 1, m.start - l.from + 1) == " \xA0" && (m.start--, m.endA--, m.endB--);
|
|
6764
6778
|
let h = l.doc.resolveNoCache(m.start - l.from), g = l.doc.resolveNoCache(m.endB - l.from), _ = u.resolve(m.start), v = h.sameParent(g) && h.parent.inlineContent && _.end() >= m.endA;
|
|
6765
6779
|
if ((Gr && e.input.lastIOSEnter > Date.now() - 225 && (!v || i.some((e) => e.nodeName == "DIV" || e.nodeName == "P")) || !v && h.pos < l.doc.content.size && (!h.sameParent(g) || !h.parent.inlineContent) && h.pos < g.pos && !/\S/.test(l.doc.textBetween(h.pos, g.pos, "", ""))) && e.someProp("handleKeyDown", (t) => t(e, Pr(13, "Enter")))) {
|
|
6766
6780
|
e.input.lastIOSEnter = 0;
|
|
@@ -6775,26 +6789,26 @@ function vs(e, t, n, r, i) {
|
|
|
6775
6789
|
return t(e, Pr(13, "Enter"));
|
|
6776
6790
|
});
|
|
6777
6791
|
}, 20));
|
|
6778
|
-
let y = m.start, b = m.endA,
|
|
6792
|
+
let y = m.start, b = m.endA, ee = (t) => {
|
|
6779
6793
|
let n = t || e.state.tr.replace(y, b, l.doc.slice(m.start - l.from, m.endB - l.from));
|
|
6780
6794
|
if (l.sel) {
|
|
6781
6795
|
let t = ys(e, n.doc, l.sel);
|
|
6782
6796
|
t && !(R && e.composing && t.empty && (m.start != m.endB || e.input.lastChromeDelete < Date.now() - 100) && (t.head == y || t.head == n.mapping.map(b) - 1) || I && t.empty && t.head == y) && n.setSelection(t);
|
|
6783
6797
|
}
|
|
6784
6798
|
return a && n.setMeta("composition", a), n.scrollIntoView();
|
|
6785
|
-
},
|
|
6799
|
+
}, te;
|
|
6786
6800
|
if (v) if (h.pos == g.pos) {
|
|
6787
6801
|
I && Hr <= 11 && h.parentOffset == 0 && (e.domObserver.suppressSelectionUpdates(), setTimeout(() => ra(e), 20));
|
|
6788
|
-
let t =
|
|
6802
|
+
let t = ee(e.state.tr.delete(y, b)), n = u.resolve(m.start).marksAcross(u.resolve(m.endA));
|
|
6789
6803
|
n && t.ensureMarks(n), e.dispatch(t);
|
|
6790
|
-
} else if (m.endA == m.endB && (
|
|
6791
|
-
let t =
|
|
6792
|
-
|
|
6804
|
+
} else if (m.endA == m.endB && (te = bs(h.parent.content.cut(h.parentOffset, g.parentOffset), _.parent.content.cut(_.parentOffset, m.endA - _.start())))) {
|
|
6805
|
+
let t = ee(e.state.tr);
|
|
6806
|
+
te.type == "add" ? t.addMark(y, b, te.mark) : t.removeMark(y, b, te.mark), e.dispatch(t);
|
|
6793
6807
|
} else if (h.parent.child(h.index()).isText && h.index() == g.index() - +!g.textOffset) {
|
|
6794
|
-
let t = h.parent.textBetween(h.parentOffset, g.parentOffset), n = () =>
|
|
6808
|
+
let t = h.parent.textBetween(h.parentOffset, g.parentOffset), n = () => ee(e.state.tr.insertText(t, y, b));
|
|
6795
6809
|
e.someProp("handleTextInput", (r) => r(e, y, b, t, n)) || e.dispatch(n());
|
|
6796
|
-
} else e.dispatch(
|
|
6797
|
-
else e.dispatch(
|
|
6810
|
+
} else e.dispatch(ee());
|
|
6811
|
+
else e.dispatch(ee());
|
|
6798
6812
|
}
|
|
6799
6813
|
function ys(e, t, n) {
|
|
6800
6814
|
return Math.max(n.anchor, n.head) > t.content.size ? null : fa(e, t.resolve(n.anchor), t.resolve(n.head));
|
|
@@ -6915,7 +6929,7 @@ var Ts = class {
|
|
|
6915
6929
|
}
|
|
6916
6930
|
scrollToSelection() {
|
|
6917
6931
|
let e = this.domSelectionRange().focusNode;
|
|
6918
|
-
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode)) && !this.someProp("handleScrollToSelection", (e) => e(this))) if (this.state.selection instanceof
|
|
6932
|
+
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode)) && !this.someProp("handleScrollToSelection", (e) => e(this))) if (this.state.selection instanceof A) {
|
|
6919
6933
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
6920
6934
|
t.nodeType == 1 && $r(this, t.getBoundingClientRect(), e);
|
|
6921
6935
|
} else $r(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
@@ -6947,7 +6961,7 @@ var Ts = class {
|
|
|
6947
6961
|
let e = n.from + (this.state.doc.content.size - t.doc.content.size);
|
|
6948
6962
|
(e > 0 && e < this.state.doc.content.size && this.state.doc.nodeAt(e)) == n.node && (r = e);
|
|
6949
6963
|
}
|
|
6950
|
-
this.dragging = new Fo(e.slice, e.move, r < 0 ? void 0 :
|
|
6964
|
+
this.dragging = new Fo(e.slice, e.move, r < 0 ? void 0 : A.create(this.state.doc, r));
|
|
6951
6965
|
}
|
|
6952
6966
|
someProp(e, t) {
|
|
6953
6967
|
let n = this._props && this._props[e], r;
|
|
@@ -7175,7 +7189,7 @@ function Rs(e) {
|
|
|
7175
7189
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
7176
7190
|
}
|
|
7177
7191
|
//#endregion
|
|
7178
|
-
//#region ../../node_modules/.
|
|
7192
|
+
//#region ../../node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.js
|
|
7179
7193
|
var zs = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), Bs = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
7180
7194
|
function Vs(e) {
|
|
7181
7195
|
let t = e.split(/-(?!$)/), n = t[t.length - 1];
|
|
@@ -7201,7 +7215,7 @@ function Us(e, t, n = !0) {
|
|
|
7201
7215
|
return t.altKey && (e = "Alt-" + e), t.ctrlKey && (e = "Ctrl-" + e), t.metaKey && (e = "Meta-" + e), n && t.shiftKey && (e = "Shift-" + e), e;
|
|
7202
7216
|
}
|
|
7203
7217
|
function Ws(e) {
|
|
7204
|
-
return new
|
|
7218
|
+
return new M({ props: { handleKeyDown: Gs(e) } });
|
|
7205
7219
|
}
|
|
7206
7220
|
function Gs(e) {
|
|
7207
7221
|
let t = Hs(e);
|
|
@@ -7222,7 +7236,7 @@ function Gs(e) {
|
|
|
7222
7236
|
};
|
|
7223
7237
|
}
|
|
7224
7238
|
//#endregion
|
|
7225
|
-
//#region ../../node_modules/.
|
|
7239
|
+
//#region ../../node_modules/.pnpm/@tiptap+core@3.22.5_@tiptap+pm@3.22.5/node_modules/@tiptap/core/dist/index.js
|
|
7226
7240
|
var Ks = Object.defineProperty, qs = (e, t) => {
|
|
7227
7241
|
for (var n in t) Ks(e, n, {
|
|
7228
7242
|
get: t[n],
|
|
@@ -7356,26 +7370,26 @@ qs(Xs, {
|
|
|
7356
7370
|
selectTextblockEnd: () => el,
|
|
7357
7371
|
selectTextblockStart: () => tl,
|
|
7358
7372
|
setContent: () => rl,
|
|
7359
|
-
setMark: () =>
|
|
7360
|
-
setMeta: () =>
|
|
7361
|
-
setNode: () =>
|
|
7362
|
-
setNodeSelection: () =>
|
|
7363
|
-
setTextDirection: () =>
|
|
7364
|
-
setTextSelection: () =>
|
|
7365
|
-
sinkListItem: () =>
|
|
7366
|
-
splitBlock: () =>
|
|
7367
|
-
splitListItem: () =>
|
|
7368
|
-
toggleList: () =>
|
|
7369
|
-
toggleMark: () =>
|
|
7370
|
-
toggleNode: () =>
|
|
7371
|
-
toggleWrap: () =>
|
|
7372
|
-
undoInputRule: () =>
|
|
7373
|
-
unsetAllMarks: () =>
|
|
7374
|
-
unsetMark: () =>
|
|
7375
|
-
unsetTextDirection: () =>
|
|
7376
|
-
updateAttributes: () =>
|
|
7377
|
-
wrapIn: () =>
|
|
7378
|
-
wrapInList: () =>
|
|
7373
|
+
setMark: () => lu,
|
|
7374
|
+
setMeta: () => uu,
|
|
7375
|
+
setNode: () => du,
|
|
7376
|
+
setNodeSelection: () => fu,
|
|
7377
|
+
setTextDirection: () => pu,
|
|
7378
|
+
setTextSelection: () => mu,
|
|
7379
|
+
sinkListItem: () => hu,
|
|
7380
|
+
splitBlock: () => _u,
|
|
7381
|
+
splitListItem: () => vu,
|
|
7382
|
+
toggleList: () => Su,
|
|
7383
|
+
toggleMark: () => Cu,
|
|
7384
|
+
toggleNode: () => wu,
|
|
7385
|
+
toggleWrap: () => Tu,
|
|
7386
|
+
undoInputRule: () => Eu,
|
|
7387
|
+
unsetAllMarks: () => Du,
|
|
7388
|
+
unsetMark: () => Ou,
|
|
7389
|
+
unsetTextDirection: () => ku,
|
|
7390
|
+
updateAttributes: () => Au,
|
|
7391
|
+
wrapIn: () => ju,
|
|
7392
|
+
wrapInList: () => Mu
|
|
7379
7393
|
});
|
|
7380
7394
|
var Zs = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
7381
7395
|
var n;
|
|
@@ -7399,7 +7413,7 @@ var Zs = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
|
7399
7413
|
let { state: i } = n, a = i.doc.slice(e.from, e.to);
|
|
7400
7414
|
r.deleteRange(e.from, e.to);
|
|
7401
7415
|
let o = r.mapping.map(t);
|
|
7402
|
-
return r.insert(o, a.content), r.setSelection(new
|
|
7416
|
+
return r.insert(o, a.content), r.setSelection(new k(r.doc.resolve(Math.max(o - 1, 0)))), !0;
|
|
7403
7417
|
}, rc = () => ({ tr: e, dispatch: t }) => {
|
|
7404
7418
|
let { selection: n } = e, r = n.$anchor.node();
|
|
7405
7419
|
if (r.content.size > 0) return !1;
|
|
@@ -7476,7 +7490,7 @@ var mc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
7476
7490
|
if (i) {
|
|
7477
7491
|
let e = pc(c, a, t);
|
|
7478
7492
|
if (e && e.from <= l && e.to >= u) {
|
|
7479
|
-
let t =
|
|
7493
|
+
let t = k.create(o, e.from, e.to);
|
|
7480
7494
|
n.setSelection(t);
|
|
7481
7495
|
}
|
|
7482
7496
|
}
|
|
@@ -7487,18 +7501,18 @@ var mc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
7487
7501
|
return !1;
|
|
7488
7502
|
};
|
|
7489
7503
|
function gc(e) {
|
|
7490
|
-
return e instanceof
|
|
7504
|
+
return e instanceof k;
|
|
7491
7505
|
}
|
|
7492
7506
|
function X(e = 0, t = 0, n = 0) {
|
|
7493
7507
|
return Math.min(Math.max(e, t), n);
|
|
7494
7508
|
}
|
|
7495
7509
|
function _c(e, t = null) {
|
|
7496
7510
|
if (!t) return null;
|
|
7497
|
-
let n =
|
|
7511
|
+
let n = O.atStart(e), r = O.atEnd(e);
|
|
7498
7512
|
if (t === "start" || t === !0) return n;
|
|
7499
7513
|
if (t === "end") return r;
|
|
7500
7514
|
let i = n.from, a = r.to;
|
|
7501
|
-
return t === "all" ?
|
|
7515
|
+
return t === "all" ? k.create(e, X(0, i, a), X(e.content.size, i, a)) : k.create(e, X(t, i, a), X(t, i, a));
|
|
7502
7516
|
}
|
|
7503
7517
|
function vc() {
|
|
7504
7518
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
@@ -7598,7 +7612,7 @@ function Dc(e, t, n) {
|
|
|
7598
7612
|
let a = e.mapping.maps[r], o = 0;
|
|
7599
7613
|
a.forEach((e, t, n, r) => {
|
|
7600
7614
|
o === 0 && (o = r);
|
|
7601
|
-
}), e.setSelection(
|
|
7615
|
+
}), e.setSelection(O.near(e.doc.resolve(o), n));
|
|
7602
7616
|
}
|
|
7603
7617
|
var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor: o }) => {
|
|
7604
7618
|
if (a) {
|
|
@@ -7663,7 +7677,7 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
|
|
|
7663
7677
|
} else {
|
|
7664
7678
|
p = a;
|
|
7665
7679
|
let e = i.doc.resolve(l), t = e.node(), n = e.parentOffset === 0, r = t.isText || t.isTextblock, o = t.content.size > 0;
|
|
7666
|
-
n && r && o && (l = Math.max(0, l - 1)), i.replaceWith(l, u, p);
|
|
7680
|
+
n && r && o && f && (l = Math.max(0, l - 1)), i.replaceWith(l, u, p);
|
|
7667
7681
|
}
|
|
7668
7682
|
n.updateSelection && Dc(i, i.steps.length - 1, -1), n.applyInputRules && i.setMeta("applyInputRules", {
|
|
7669
7683
|
from: l,
|
|
@@ -7676,14 +7690,14 @@ var Oc = (e) => !("type" in e), kc = (e, t, n) => ({ tr: i, dispatch: a, editor:
|
|
|
7676
7690
|
return !0;
|
|
7677
7691
|
}, Ac = () => ({ state: e, dispatch: t }) => Gn(e, t), jc = () => ({ state: e, dispatch: t }) => Kn(e, t), Mc = () => ({ state: e, dispatch: t }) => Pn(e, t), Nc = () => ({ state: e, dispatch: t }) => Hn(e, t), Pc = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
7678
7692
|
try {
|
|
7679
|
-
let r =
|
|
7693
|
+
let r = Bt(e.doc, e.selection.$from.pos, -1);
|
|
7680
7694
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
7681
7695
|
} catch {
|
|
7682
7696
|
return !1;
|
|
7683
7697
|
}
|
|
7684
7698
|
}, Fc = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
7685
7699
|
try {
|
|
7686
|
-
let r =
|
|
7700
|
+
let r = Bt(e.doc, e.selection.$from.pos, 1);
|
|
7687
7701
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
7688
7702
|
} catch {
|
|
7689
7703
|
return !1;
|
|
@@ -7765,7 +7779,7 @@ var Jc = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
7765
7779
|
}), c;
|
|
7766
7780
|
}, Yc = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), Xc = () => ({ tr: e, dispatch: t }) => {
|
|
7767
7781
|
if (t) {
|
|
7768
|
-
let t = new
|
|
7782
|
+
let t = new j(e.doc);
|
|
7769
7783
|
e.setSelection(t);
|
|
7770
7784
|
}
|
|
7771
7785
|
return !0;
|
|
@@ -7800,7 +7814,7 @@ function il(e, t) {
|
|
|
7800
7814
|
return s ? { ...s.attrs } : {};
|
|
7801
7815
|
}
|
|
7802
7816
|
function al(e, t) {
|
|
7803
|
-
let n = new
|
|
7817
|
+
let n = new ln(e);
|
|
7804
7818
|
return t.forEach((e) => {
|
|
7805
7819
|
e.steps.forEach((e) => {
|
|
7806
7820
|
n.step(e);
|
|
@@ -8343,9 +8357,13 @@ function $l(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
8343
8357
|
return !1;
|
|
8344
8358
|
}
|
|
8345
8359
|
function eu(e) {
|
|
8346
|
-
return e instanceof
|
|
8360
|
+
return e instanceof A;
|
|
8361
|
+
}
|
|
8362
|
+
function tu({ selection: e, pos: t, nodeSize: n, selectedOnTextSelection: r = !1 }) {
|
|
8363
|
+
let { from: i, to: a } = e;
|
|
8364
|
+
return !!(i <= t && a >= t + n || r && gc(e) && i > t && a < t + n);
|
|
8347
8365
|
}
|
|
8348
|
-
var
|
|
8366
|
+
var nu = class e {
|
|
8349
8367
|
constructor(e) {
|
|
8350
8368
|
this.position = e;
|
|
8351
8369
|
}
|
|
@@ -8356,17 +8374,17 @@ var tu = class e {
|
|
|
8356
8374
|
return { position: this.position };
|
|
8357
8375
|
}
|
|
8358
8376
|
};
|
|
8359
|
-
function
|
|
8377
|
+
function ru(e, t) {
|
|
8360
8378
|
let n = t.mapping.mapResult(e.position);
|
|
8361
8379
|
return {
|
|
8362
|
-
position: new
|
|
8380
|
+
position: new nu(n.pos),
|
|
8363
8381
|
mapResult: n
|
|
8364
8382
|
};
|
|
8365
8383
|
}
|
|
8366
|
-
function
|
|
8367
|
-
return new
|
|
8384
|
+
function iu(e) {
|
|
8385
|
+
return new nu(e);
|
|
8368
8386
|
}
|
|
8369
|
-
function
|
|
8387
|
+
function au(e, t, n) {
|
|
8370
8388
|
let r = e.state.doc.content.size, i = X(t, 0, r), a = X(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 = {
|
|
8371
8389
|
top: c,
|
|
8372
8390
|
bottom: l,
|
|
@@ -8382,14 +8400,14 @@ function iu(e, t, n) {
|
|
|
8382
8400
|
toJSON: () => f
|
|
8383
8401
|
};
|
|
8384
8402
|
}
|
|
8385
|
-
function
|
|
8403
|
+
function ou({ json: e, validMarks: t, validNodes: n, options: r, rewrittenContent: i = [] }) {
|
|
8386
8404
|
return e.marks && Array.isArray(e.marks) && (e.marks = e.marks.filter((e) => {
|
|
8387
8405
|
let n = typeof e == "string" ? e : e.type;
|
|
8388
8406
|
return t.has(n) ? !0 : (i.push({
|
|
8389
8407
|
original: JSON.parse(JSON.stringify(e)),
|
|
8390
8408
|
unsupported: n
|
|
8391
8409
|
}), !1);
|
|
8392
|
-
})), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) =>
|
|
8410
|
+
})), e.content && Array.isArray(e.content) && (e.content = e.content.map((e) => ou({
|
|
8393
8411
|
json: e,
|
|
8394
8412
|
validMarks: t,
|
|
8395
8413
|
validNodes: n,
|
|
@@ -8409,15 +8427,15 @@ function au({ json: e, validMarks: t, validNodes: n, options: r, rewrittenConten
|
|
|
8409
8427
|
rewrittenContent: i
|
|
8410
8428
|
};
|
|
8411
8429
|
}
|
|
8412
|
-
function
|
|
8413
|
-
return
|
|
8430
|
+
function su(e, t, n) {
|
|
8431
|
+
return ou({
|
|
8414
8432
|
json: e,
|
|
8415
8433
|
validNodes: new Set(Object.keys(t.nodes)),
|
|
8416
8434
|
validMarks: new Set(Object.keys(t.marks)),
|
|
8417
8435
|
options: n
|
|
8418
8436
|
});
|
|
8419
8437
|
}
|
|
8420
|
-
function
|
|
8438
|
+
function cu(e, t, n) {
|
|
8421
8439
|
let { selection: r } = t, i = null;
|
|
8422
8440
|
if (gc(r) && (i = r.$cursor), i) {
|
|
8423
8441
|
let t = e.storedMarks ?? i.marks();
|
|
@@ -8436,7 +8454,7 @@ function su(e, t, n) {
|
|
|
8436
8454
|
}), i;
|
|
8437
8455
|
});
|
|
8438
8456
|
}
|
|
8439
|
-
var
|
|
8457
|
+
var lu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8440
8458
|
let { selection: a } = n, { empty: o, ranges: s } = a, c = Y(e, r.schema);
|
|
8441
8459
|
if (i) if (o) {
|
|
8442
8460
|
let e = il(r, c);
|
|
@@ -8456,8 +8474,8 @@ var cu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8456
8474
|
}) : n.addMark(o, s, c.create(t));
|
|
8457
8475
|
});
|
|
8458
8476
|
});
|
|
8459
|
-
return
|
|
8460
|
-
},
|
|
8477
|
+
return cu(r, n, c);
|
|
8478
|
+
}, uu = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), du = (e, t = {}) => ({ state: n, dispatch: r, chain: i }) => {
|
|
8461
8479
|
let a = J(e, n.schema), o;
|
|
8462
8480
|
return n.selection.$anchor.sameParent(n.selection.$head) && (o = n.selection.$anchor.parent.attrs), a.isTextblock ? i().command(({ commands: e }) => lr(a, {
|
|
8463
8481
|
...o,
|
|
@@ -8466,13 +8484,13 @@ var cu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8466
8484
|
...o,
|
|
8467
8485
|
...t
|
|
8468
8486
|
})(e, r)).run() : (console.warn("[tiptap warn]: Currently \"setNode()\" only supports text block nodes."), !1);
|
|
8469
|
-
},
|
|
8487
|
+
}, fu = (e) => ({ tr: t, dispatch: n }) => {
|
|
8470
8488
|
if (n) {
|
|
8471
|
-
let { doc: n } = t, r = X(e, 0, n.content.size), i =
|
|
8489
|
+
let { doc: n } = t, r = X(e, 0, n.content.size), i = A.create(n, r);
|
|
8472
8490
|
t.setSelection(i);
|
|
8473
8491
|
}
|
|
8474
8492
|
return !0;
|
|
8475
|
-
},
|
|
8493
|
+
}, pu = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8476
8494
|
let { selection: a } = r, o, s;
|
|
8477
8495
|
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) => {
|
|
8478
8496
|
t.isText || n.setNodeMarkup(r, void 0, {
|
|
@@ -8480,43 +8498,43 @@ var cu = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8480
8498
|
dir: e
|
|
8481
8499
|
});
|
|
8482
8500
|
}), !0;
|
|
8483
|
-
},
|
|
8501
|
+
}, mu = (e) => ({ tr: t, dispatch: n }) => {
|
|
8484
8502
|
if (n) {
|
|
8485
8503
|
let { doc: n } = t, { from: r, to: i } = typeof e == "number" ? {
|
|
8486
8504
|
from: e,
|
|
8487
8505
|
to: e
|
|
8488
|
-
} : e, a =
|
|
8506
|
+
} : e, a = k.atStart(n).from, o = k.atEnd(n).to, s = X(r, a, o), c = X(i, a, o), l = k.create(n, s, c);
|
|
8489
8507
|
t.setSelection(l);
|
|
8490
8508
|
}
|
|
8491
8509
|
return !0;
|
|
8492
|
-
},
|
|
8493
|
-
function
|
|
8510
|
+
}, hu = (e) => ({ state: t, dispatch: n }) => xr(J(e, t.schema))(t, n);
|
|
8511
|
+
function gu(e, t) {
|
|
8494
8512
|
let n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
8495
8513
|
if (n) {
|
|
8496
8514
|
let r = n.filter((e) => t?.includes(e.type.name));
|
|
8497
8515
|
e.tr.ensureMarks(r);
|
|
8498
8516
|
}
|
|
8499
8517
|
}
|
|
8500
|
-
var
|
|
8518
|
+
var _u = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: i }) => {
|
|
8501
8519
|
let { selection: a, doc: o } = t, { $from: s, $to: c } = a, l = i.extensionManager.attributes, u = Gl(l, s.node().type.name, s.node().attrs);
|
|
8502
|
-
if (a instanceof
|
|
8520
|
+
if (a instanceof A && a.node.isBlock) return !s.parentOffset || !D(o, s.pos) ? !1 : (r && (e && gu(n, i.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
|
|
8503
8521
|
if (!s.parent.isBlock) return !1;
|
|
8504
8522
|
let d = c.parentOffset === c.parent.content.size, f = s.depth === 0 ? void 0 : ol(s.node(-1).contentMatchAt(s.indexAfter(-1))), p = d && f ? [{
|
|
8505
8523
|
type: f,
|
|
8506
8524
|
attrs: u
|
|
8507
|
-
}] : void 0, m =
|
|
8508
|
-
if (!p && !m &&
|
|
8525
|
+
}] : void 0, m = D(t.doc, t.mapping.map(s.pos), 1, p);
|
|
8526
|
+
if (!p && !m && D(t.doc, t.mapping.map(s.pos), 1, f ? [{ type: f }] : void 0) && (m = !0, p = f ? [{
|
|
8509
8527
|
type: f,
|
|
8510
8528
|
attrs: u
|
|
8511
8529
|
}] : void 0), r) {
|
|
8512
|
-
if (m && (a instanceof
|
|
8530
|
+
if (m && (a instanceof k && t.deleteSelection(), t.split(t.mapping.map(s.pos), 1, p), f && !d && !s.parentOffset && s.parent.type !== f)) {
|
|
8513
8531
|
let e = t.mapping.map(s.before()), n = t.doc.resolve(e);
|
|
8514
8532
|
s.node(-1).canReplaceWith(n.index(), n.index() + 1, f) && t.setNodeMarkup(t.mapping.map(s.before()), f);
|
|
8515
8533
|
}
|
|
8516
|
-
e &&
|
|
8534
|
+
e && gu(n, i.extensionManager.splittableMarks), t.scrollIntoView();
|
|
8517
8535
|
}
|
|
8518
8536
|
return m;
|
|
8519
|
-
},
|
|
8537
|
+
}, vu = (e, t = {}) => ({ tr: n, state: i, dispatch: a, editor: o }) => {
|
|
8520
8538
|
let s = J(e, i.schema), { $from: c, $to: u } = i.selection, d = i.selection.node;
|
|
8521
8539
|
if (d && d.isBlock || c.depth < 2 || !c.sameParent(u)) return !1;
|
|
8522
8540
|
let f = c.node(-1);
|
|
@@ -8538,7 +8556,7 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8538
8556
|
n.doc.nodesBetween(d, n.doc.content.size, (e, t) => {
|
|
8539
8557
|
if (f > -1) return !1;
|
|
8540
8558
|
e.isTextblock && e.content.size === 0 && (f = t + 1);
|
|
8541
|
-
}), f > -1 && n.setSelection(
|
|
8559
|
+
}), f > -1 && n.setSelection(k.near(n.doc.resolve(f))), n.scrollIntoView();
|
|
8542
8560
|
}
|
|
8543
8561
|
return !0;
|
|
8544
8562
|
}
|
|
@@ -8560,7 +8578,7 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8560
8578
|
type: s,
|
|
8561
8579
|
attrs: h
|
|
8562
8580
|
}];
|
|
8563
|
-
if (!
|
|
8581
|
+
if (!D(n.doc, c.pos, 2)) return !1;
|
|
8564
8582
|
if (a) {
|
|
8565
8583
|
let { selection: e, storedMarks: t } = i, { splittableMarks: r } = o.extensionManager, s = t || e.$to.parentOffset && e.$from.marks();
|
|
8566
8584
|
if (n.split(c.pos, 2, _).scrollIntoView(), !s || !a) return !0;
|
|
@@ -8568,45 +8586,59 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8568
8586
|
n.ensureMarks(l);
|
|
8569
8587
|
}
|
|
8570
8588
|
return !0;
|
|
8571
|
-
},
|
|
8589
|
+
}, yu = (e, t) => {
|
|
8572
8590
|
let n = ul((e) => e.type === t)(e.selection);
|
|
8573
8591
|
if (!n) return !0;
|
|
8574
8592
|
let r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
|
|
8575
8593
|
if (r === void 0) return !0;
|
|
8576
8594
|
let i = e.doc.nodeAt(r);
|
|
8577
|
-
return n.node.type === i?.type &&
|
|
8578
|
-
},
|
|
8595
|
+
return n.node.type === i?.type && Lt(e.doc, n.pos) && e.join(n.pos), !0;
|
|
8596
|
+
}, bu = (e, t) => {
|
|
8579
8597
|
let n = ul((e) => e.type === t)(e.selection);
|
|
8580
8598
|
if (!n) return !0;
|
|
8581
8599
|
let r = e.doc.resolve(n.start).after(n.depth);
|
|
8582
8600
|
if (r === void 0) return !0;
|
|
8583
8601
|
let i = e.doc.nodeAt(r);
|
|
8584
|
-
return n.node.type === i?.type &&
|
|
8585
|
-
}
|
|
8602
|
+
return n.node.type === i?.type && Lt(e.doc, r) && e.join(r), !0;
|
|
8603
|
+
};
|
|
8604
|
+
function xu(e) {
|
|
8605
|
+
let t = e.doc, n = t.firstChild;
|
|
8606
|
+
if (!n) return null;
|
|
8607
|
+
let r = t.resolve(1), i = t.resolve(n.nodeSize - 1);
|
|
8608
|
+
return k.between(r, i);
|
|
8609
|
+
}
|
|
8610
|
+
var Su = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
|
|
8586
8611
|
let { extensions: d, splittableMarks: f } = i.extensionManager, p = J(e, o.schema), m = J(t, o.schema), { selection: h, storedMarks: g } = o, { $from: _, $to: v } = h, y = _.blockRange(v), b = g || h.$to.parentOffset && h.$from.marks();
|
|
8587
8612
|
if (!y) return !1;
|
|
8588
|
-
let
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
}
|
|
8593
|
-
|
|
8613
|
+
let ee = ul((e) => Ql(e.type.name, d))(h), te = h.from === 0 && h.to === o.doc.content.size, ne = o.doc.content.content, re = ne.length === 1 ? ne[0] : null, ie = te && re && Ql(re.type.name, d) ? {
|
|
8614
|
+
node: re,
|
|
8615
|
+
pos: 0,
|
|
8616
|
+
depth: 0
|
|
8617
|
+
} : null, x = ee ?? ie, ae = !!ee && y.depth >= 1 && y.depth - ee.depth <= 1, S = !!ie;
|
|
8618
|
+
if ((ae || S) && x) {
|
|
8619
|
+
if (x.node.type === p) return te && S ? c().command(({ tr: e, dispatch: t }) => {
|
|
8620
|
+
let n = xu(e);
|
|
8621
|
+
return n ? (e.setSelection(n), t && t(e), !0) : !1;
|
|
8622
|
+
}).liftListItem(m).run() : l.liftListItem(m);
|
|
8623
|
+
if (Ql(x.node.type.name, d) && p.validContent(x.node.content)) return c().command(() => (a.setNodeMarkup(x.pos, p), !0)).command(() => yu(a, p)).command(() => bu(a, p)).run();
|
|
8624
|
+
}
|
|
8625
|
+
return !n || !b || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => yu(a, p)).command(() => bu(a, p)).run() : c().command(() => {
|
|
8594
8626
|
let e = u().wrapInList(p, r), t = b.filter((e) => f.includes(e.type.name));
|
|
8595
8627
|
return a.ensureMarks(t), e ? !0 : l.clearNodes();
|
|
8596
|
-
}).wrapInList(p, r).command(() =>
|
|
8597
|
-
},
|
|
8628
|
+
}).wrapInList(p, r).command(() => yu(a, p)).command(() => bu(a, p)).run();
|
|
8629
|
+
}, Cu = (e, t = {}, n = {}) => ({ state: r, commands: i }) => {
|
|
8598
8630
|
let { extendEmptyMarkRange: a = !1 } = n, o = Y(e, r.schema);
|
|
8599
8631
|
return ql(r, o, t) ? i.unsetMark(o, { extendEmptyMarkRange: a }) : i.setMark(o, t);
|
|
8600
|
-
},
|
|
8632
|
+
}, wu = (e, t, n = {}) => ({ state: r, commands: i }) => {
|
|
8601
8633
|
let a = J(e, r.schema), o = J(t, r.schema), s = Vc(r, a, n), c;
|
|
8602
8634
|
return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), s ? i.setNode(o, c) : i.setNode(a, {
|
|
8603
8635
|
...c,
|
|
8604
8636
|
...n
|
|
8605
8637
|
});
|
|
8606
|
-
},
|
|
8638
|
+
}, Tu = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
8607
8639
|
let i = J(e, n.schema);
|
|
8608
8640
|
return Vc(n, i, t) ? r.lift(i) : r.wrapIn(i, t);
|
|
8609
|
-
},
|
|
8641
|
+
}, Eu = () => ({ state: e, dispatch: t }) => {
|
|
8610
8642
|
let n = e.plugins;
|
|
8611
8643
|
for (let r = 0; r < n.length; r += 1) {
|
|
8612
8644
|
let i = n[r], a;
|
|
@@ -8623,12 +8655,12 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8623
8655
|
}
|
|
8624
8656
|
}
|
|
8625
8657
|
return !1;
|
|
8626
|
-
},
|
|
8658
|
+
}, Du = () => ({ tr: e, dispatch: t }) => {
|
|
8627
8659
|
let { selection: n } = e, { empty: r, ranges: i } = n;
|
|
8628
8660
|
return r || t && i.forEach((t) => {
|
|
8629
8661
|
e.removeMark(t.$from.pos, t.$to.pos);
|
|
8630
8662
|
}), !0;
|
|
8631
|
-
},
|
|
8663
|
+
}, Ou = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8632
8664
|
let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s = Y(e, r.schema), { $from: c, empty: l, ranges: u } = o;
|
|
8633
8665
|
if (!i) return !0;
|
|
8634
8666
|
if (l && a) {
|
|
@@ -8638,14 +8670,14 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8638
8670
|
n.removeMark(e.$from.pos, e.$to.pos, s);
|
|
8639
8671
|
});
|
|
8640
8672
|
return n.removeStoredMark(s), !0;
|
|
8641
|
-
},
|
|
8673
|
+
}, ku = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
8642
8674
|
let { selection: i } = n, a, o;
|
|
8643
8675
|
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) => {
|
|
8644
8676
|
if (e.isText) return;
|
|
8645
8677
|
let r = { ...e.attrs };
|
|
8646
8678
|
delete r.dir, t.setNodeMarkup(n, void 0, r);
|
|
8647
8679
|
}), !0;
|
|
8648
|
-
},
|
|
8680
|
+
}, Au = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
8649
8681
|
let a = null, o = null, s = Kc(typeof e == "string" ? e : e.name, r.schema);
|
|
8650
8682
|
if (!s) return !1;
|
|
8651
8683
|
s === "node" && (a = J(e, r.schema)), s === "mark" && (o = Y(e, r.schema));
|
|
@@ -8677,7 +8709,7 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8677
8709
|
}));
|
|
8678
8710
|
}));
|
|
8679
8711
|
}), c;
|
|
8680
|
-
},
|
|
8712
|
+
}, ju = (e, t = {}) => ({ state: n, dispatch: r }) => cr(J(e, n.schema), t)(n, r), Mu = (e, t = {}) => ({ state: n, dispatch: r }) => hr(J(e, n.schema), t)(n, r), Nu = class {
|
|
8681
8713
|
constructor() {
|
|
8682
8714
|
this.callbacks = {};
|
|
8683
8715
|
}
|
|
@@ -8701,18 +8733,18 @@ var gu = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8701
8733
|
removeAllListeners() {
|
|
8702
8734
|
this.callbacks = {};
|
|
8703
8735
|
}
|
|
8704
|
-
},
|
|
8736
|
+
}, Pu = class {
|
|
8705
8737
|
constructor(e) {
|
|
8706
8738
|
this.find = e.find, this.handler = e.handler, this.undoable = e.undoable ?? !0;
|
|
8707
8739
|
}
|
|
8708
|
-
},
|
|
8740
|
+
}, Fu = (e, t) => {
|
|
8709
8741
|
if (lc(t)) return t.exec(e);
|
|
8710
8742
|
let n = t(e);
|
|
8711
8743
|
if (!n) return null;
|
|
8712
8744
|
let r = [n.text];
|
|
8713
8745
|
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;
|
|
8714
8746
|
};
|
|
8715
|
-
function
|
|
8747
|
+
function Iu(e) {
|
|
8716
8748
|
let { editor: t, from: n, to: r, text: i, rules: a, plugin: o } = e, { view: s } = t;
|
|
8717
8749
|
if (s.composing) return !1;
|
|
8718
8750
|
let c = s.state.doc.resolve(n);
|
|
@@ -8720,7 +8752,7 @@ function Pu(e) {
|
|
|
8720
8752
|
let l = !1, u = Kl(c) + i;
|
|
8721
8753
|
return a.forEach((e) => {
|
|
8722
8754
|
if (l) return;
|
|
8723
|
-
let a =
|
|
8755
|
+
let a = Fu(u, e.find);
|
|
8724
8756
|
if (!a) return;
|
|
8725
8757
|
let c = s.state.tr, d = Js({
|
|
8726
8758
|
state: s.state,
|
|
@@ -8747,8 +8779,8 @@ function Pu(e) {
|
|
|
8747
8779
|
}), s.dispatch(c), l = !0);
|
|
8748
8780
|
}), l;
|
|
8749
8781
|
}
|
|
8750
|
-
function
|
|
8751
|
-
let { editor: t, rules: n } = e, i = new
|
|
8782
|
+
function Lu(e) {
|
|
8783
|
+
let { editor: t, rules: n } = e, i = new M({
|
|
8752
8784
|
state: {
|
|
8753
8785
|
init() {
|
|
8754
8786
|
return null;
|
|
@@ -8761,7 +8793,7 @@ function Fu(e) {
|
|
|
8761
8793
|
let { text: e } = c;
|
|
8762
8794
|
e = typeof e == "string" ? e : fl(r.from(e), o.schema);
|
|
8763
8795
|
let { from: a } = c;
|
|
8764
|
-
|
|
8796
|
+
Iu({
|
|
8765
8797
|
editor: t,
|
|
8766
8798
|
from: a,
|
|
8767
8799
|
to: a + e.length,
|
|
@@ -8774,7 +8806,7 @@ function Fu(e) {
|
|
|
8774
8806
|
},
|
|
8775
8807
|
props: {
|
|
8776
8808
|
handleTextInput(e, r, a, o) {
|
|
8777
|
-
return
|
|
8809
|
+
return Iu({
|
|
8778
8810
|
editor: t,
|
|
8779
8811
|
from: r,
|
|
8780
8812
|
to: a,
|
|
@@ -8785,7 +8817,7 @@ function Fu(e) {
|
|
|
8785
8817
|
},
|
|
8786
8818
|
handleDOMEvents: { compositionend: (e) => (setTimeout(() => {
|
|
8787
8819
|
let { $cursor: r } = e.state.selection;
|
|
8788
|
-
r &&
|
|
8820
|
+
r && Iu({
|
|
8789
8821
|
editor: t,
|
|
8790
8822
|
from: r.pos,
|
|
8791
8823
|
to: r.pos,
|
|
@@ -8797,7 +8829,7 @@ function Fu(e) {
|
|
|
8797
8829
|
handleKeyDown(e, r) {
|
|
8798
8830
|
if (r.key !== "Enter") return !1;
|
|
8799
8831
|
let { $cursor: a } = e.state.selection;
|
|
8800
|
-
return a ?
|
|
8832
|
+
return a ? Iu({
|
|
8801
8833
|
editor: t,
|
|
8802
8834
|
from: a.pos,
|
|
8803
8835
|
to: a.pos,
|
|
@@ -8811,19 +8843,19 @@ function Fu(e) {
|
|
|
8811
8843
|
});
|
|
8812
8844
|
return i;
|
|
8813
8845
|
}
|
|
8814
|
-
function
|
|
8846
|
+
function Ru(e) {
|
|
8815
8847
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
8816
8848
|
}
|
|
8817
|
-
function
|
|
8818
|
-
return
|
|
8849
|
+
function zu(e) {
|
|
8850
|
+
return Ru(e) === "Object" ? e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype : !1;
|
|
8819
8851
|
}
|
|
8820
|
-
function
|
|
8852
|
+
function Bu(e, t) {
|
|
8821
8853
|
let n = { ...e };
|
|
8822
|
-
return
|
|
8823
|
-
|
|
8854
|
+
return zu(e) && zu(t) && Object.keys(t).forEach((r) => {
|
|
8855
|
+
zu(t[r]) && zu(e[r]) ? n[r] = Bu(e[r], t[r]) : n[r] = t[r];
|
|
8824
8856
|
}), n;
|
|
8825
8857
|
}
|
|
8826
|
-
var
|
|
8858
|
+
var Vu = class {
|
|
8827
8859
|
constructor(e = {}) {
|
|
8828
8860
|
this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = { name: this.name }, this.config = {
|
|
8829
8861
|
...this.config,
|
|
@@ -8842,7 +8874,7 @@ var zu = class {
|
|
|
8842
8874
|
configure(e = {}) {
|
|
8843
8875
|
let t = this.extend({
|
|
8844
8876
|
...this.config,
|
|
8845
|
-
addOptions: () =>
|
|
8877
|
+
addOptions: () => Bu(this.options, e)
|
|
8846
8878
|
});
|
|
8847
8879
|
return t.name = this.name, t.parent = this.parent, t;
|
|
8848
8880
|
}
|
|
@@ -8853,7 +8885,7 @@ var zu = class {
|
|
|
8853
8885
|
});
|
|
8854
8886
|
return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
|
|
8855
8887
|
}
|
|
8856
|
-
},
|
|
8888
|
+
}, Hu = class e extends Vu {
|
|
8857
8889
|
constructor() {
|
|
8858
8890
|
super(...arguments), this.type = "mark";
|
|
8859
8891
|
}
|
|
@@ -8878,14 +8910,14 @@ var zu = class {
|
|
|
8878
8910
|
return super.extend(t);
|
|
8879
8911
|
}
|
|
8880
8912
|
};
|
|
8881
|
-
function
|
|
8913
|
+
function Uu(e) {
|
|
8882
8914
|
return typeof e == "number";
|
|
8883
8915
|
}
|
|
8884
|
-
var
|
|
8916
|
+
var Wu = class {
|
|
8885
8917
|
constructor(e) {
|
|
8886
8918
|
this.find = e.find, this.handler = e.handler;
|
|
8887
8919
|
}
|
|
8888
|
-
},
|
|
8920
|
+
}, Gu = (e, t, n) => {
|
|
8889
8921
|
if (lc(t)) return [...e.matchAll(t)];
|
|
8890
8922
|
let r = t(e, n);
|
|
8891
8923
|
return r ? r.map((t) => {
|
|
@@ -8893,7 +8925,7 @@ var Hu = class {
|
|
|
8893
8925
|
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;
|
|
8894
8926
|
}) : [];
|
|
8895
8927
|
};
|
|
8896
|
-
function
|
|
8928
|
+
function Ku(e) {
|
|
8897
8929
|
let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new Ys({
|
|
8898
8930
|
editor: t,
|
|
8899
8931
|
state: n
|
|
@@ -8901,7 +8933,7 @@ function Wu(e) {
|
|
|
8901
8933
|
return n.doc.nodesBetween(r, i, (e, t) => {
|
|
8902
8934
|
if (e.type?.spec?.code || !(e.isText || e.isTextblock || e.isInline)) return;
|
|
8903
8935
|
let f = e.content?.size ?? e.nodeSize ?? 0, p = Math.max(r, t), m = Math.min(i, t + f);
|
|
8904
|
-
p >= m ||
|
|
8936
|
+
p >= m || Gu(e.isText ? e.text || "" : e.textBetween(p - t, m - t, void 0, ""), a.find, o).forEach((e) => {
|
|
8905
8937
|
if (e.index === void 0) return;
|
|
8906
8938
|
let t = p + e.index + 1, r = t + e[0].length, i = {
|
|
8907
8939
|
from: n.tr.mapping.map(t),
|
|
@@ -8920,12 +8952,12 @@ function Wu(e) {
|
|
|
8920
8952
|
});
|
|
8921
8953
|
}), d.every((e) => e !== null);
|
|
8922
8954
|
}
|
|
8923
|
-
var
|
|
8955
|
+
var qu = null, Ju = (e) => {
|
|
8924
8956
|
var t;
|
|
8925
8957
|
let n = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
|
|
8926
8958
|
return (t = n.clipboardData) == null || t.setData("text/html", e), n;
|
|
8927
8959
|
};
|
|
8928
|
-
function
|
|
8960
|
+
function Yu(e) {
|
|
8929
8961
|
let { editor: t, rules: n } = e, i = null, a = !1, o = !1, s = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
|
|
8930
8962
|
try {
|
|
8931
8963
|
c = typeof DragEvent < "u" ? new DragEvent("drop") : null;
|
|
@@ -8934,7 +8966,7 @@ function qu(e) {
|
|
|
8934
8966
|
}
|
|
8935
8967
|
let l = ({ state: e, from: n, to: r, rule: i, pasteEvt: a }) => {
|
|
8936
8968
|
let o = e.tr;
|
|
8937
|
-
if (!(!
|
|
8969
|
+
if (!(!Ku({
|
|
8938
8970
|
editor: t,
|
|
8939
8971
|
state: Js({
|
|
8940
8972
|
state: e,
|
|
@@ -8954,12 +8986,12 @@ function qu(e) {
|
|
|
8954
8986
|
return s = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, o;
|
|
8955
8987
|
}
|
|
8956
8988
|
};
|
|
8957
|
-
return n.map((e) => new
|
|
8989
|
+
return n.map((e) => new M({
|
|
8958
8990
|
view(e) {
|
|
8959
8991
|
let n = (n) => {
|
|
8960
|
-
i = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, i && (
|
|
8992
|
+
i = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, i && (qu = t);
|
|
8961
8993
|
}, r = () => {
|
|
8962
|
-
|
|
8994
|
+
qu &&= null;
|
|
8963
8995
|
};
|
|
8964
8996
|
return window.addEventListener("dragstart", n), window.addEventListener("dragend", r), { destroy() {
|
|
8965
8997
|
window.removeEventListener("dragstart", n), window.removeEventListener("dragend", r);
|
|
@@ -8968,7 +9000,7 @@ function qu(e) {
|
|
|
8968
9000
|
props: { handleDOMEvents: {
|
|
8969
9001
|
drop: (e, t) => {
|
|
8970
9002
|
if (o = i === e.dom.parentElement, c = t, !o) {
|
|
8971
|
-
let e =
|
|
9003
|
+
let e = qu;
|
|
8972
9004
|
e?.isEditable && setTimeout(() => {
|
|
8973
9005
|
let t = e.state.selection;
|
|
8974
9006
|
t && e.commands.deleteRange({
|
|
@@ -8990,7 +9022,7 @@ function qu(e) {
|
|
|
8990
9022
|
if (p) {
|
|
8991
9023
|
let { text: t } = f;
|
|
8992
9024
|
t = typeof t == "string" ? t : fl(r.from(t), i.schema);
|
|
8993
|
-
let { from: n } = f, a = n + t.length, o =
|
|
9025
|
+
let { from: n } = f, a = n + t.length, o = Ju(t);
|
|
8994
9026
|
return l({
|
|
8995
9027
|
rule: e,
|
|
8996
9028
|
state: i,
|
|
@@ -9000,7 +9032,7 @@ function qu(e) {
|
|
|
9000
9032
|
});
|
|
9001
9033
|
}
|
|
9002
9034
|
let m = n.doc.content.findDiffStart(i.doc.content), h = n.doc.content.findDiffEnd(i.doc.content);
|
|
9003
|
-
if (!(!
|
|
9035
|
+
if (!(!Uu(m) || !h || m === h.b)) return l({
|
|
9004
9036
|
rule: e,
|
|
9005
9037
|
state: i,
|
|
9006
9038
|
from: m,
|
|
@@ -9010,7 +9042,7 @@ function qu(e) {
|
|
|
9010
9042
|
}
|
|
9011
9043
|
}));
|
|
9012
9044
|
}
|
|
9013
|
-
var
|
|
9045
|
+
var Xu = class {
|
|
9014
9046
|
constructor(e, t) {
|
|
9015
9047
|
this.splittableMarks = [], this.editor = t, this.baseExtensions = e, this.extensions = Ol(e), this.schema = Tl(this.extensions, t), this.setupExtensions();
|
|
9016
9048
|
}
|
|
@@ -9039,7 +9071,7 @@ var Ju = class {
|
|
|
9039
9071
|
editor: e,
|
|
9040
9072
|
type: Wl(t.name, this.schema)
|
|
9041
9073
|
}, r = [], i = Z(t, "addKeyboardShortcuts", n), a = {};
|
|
9042
|
-
if (t.type === "mark" && Z(t, "exitable", n) && (a.ArrowRight = () =>
|
|
9074
|
+
if (t.type === "mark" && Z(t, "exitable", n) && (a.ArrowRight = () => Hu.handleExit({
|
|
9043
9075
|
editor: e,
|
|
9044
9076
|
mark: t
|
|
9045
9077
|
})), i) {
|
|
@@ -9055,7 +9087,7 @@ var Ju = class {
|
|
|
9055
9087
|
if (Zl(t, e.options.enableInputRules) && s) {
|
|
9056
9088
|
let t = s();
|
|
9057
9089
|
if (t && t.length) {
|
|
9058
|
-
let n =
|
|
9090
|
+
let n = Lu({
|
|
9059
9091
|
editor: e,
|
|
9060
9092
|
rules: t
|
|
9061
9093
|
}), i = Array.isArray(n) ? n : [n];
|
|
@@ -9066,7 +9098,7 @@ var Ju = class {
|
|
|
9066
9098
|
if (Zl(t, e.options.enablePasteRules) && c) {
|
|
9067
9099
|
let t = c();
|
|
9068
9100
|
if (t && t.length) {
|
|
9069
|
-
let n =
|
|
9101
|
+
let n = Yu({
|
|
9070
9102
|
editor: e,
|
|
9071
9103
|
rules: t
|
|
9072
9104
|
});
|
|
@@ -9162,7 +9194,7 @@ var Ju = class {
|
|
|
9162
9194
|
extension: t,
|
|
9163
9195
|
HTMLAttributes: s,
|
|
9164
9196
|
updateAttributes: (t) => {
|
|
9165
|
-
|
|
9197
|
+
Hd(i, e, t);
|
|
9166
9198
|
}
|
|
9167
9199
|
});
|
|
9168
9200
|
}] : [];
|
|
@@ -9184,22 +9216,22 @@ var Ju = class {
|
|
|
9184
9216
|
});
|
|
9185
9217
|
}
|
|
9186
9218
|
};
|
|
9187
|
-
|
|
9188
|
-
var
|
|
9189
|
-
qs(
|
|
9190
|
-
ClipboardTextSerializer: () =>
|
|
9191
|
-
Commands: () =>
|
|
9192
|
-
Delete: () =>
|
|
9193
|
-
Drop: () =>
|
|
9194
|
-
Editable: () =>
|
|
9195
|
-
FocusEvents: () =>
|
|
9196
|
-
Keymap: () =>
|
|
9197
|
-
Paste: () =>
|
|
9198
|
-
Tabindex: () =>
|
|
9199
|
-
TextDirection: () =>
|
|
9200
|
-
focusEventsPluginKey: () =>
|
|
9219
|
+
Xu.resolve = Ol, Xu.sort = Dl, Xu.flatten = dl;
|
|
9220
|
+
var Zu = {};
|
|
9221
|
+
qs(Zu, {
|
|
9222
|
+
ClipboardTextSerializer: () => Qu,
|
|
9223
|
+
Commands: () => $u,
|
|
9224
|
+
Delete: () => ed,
|
|
9225
|
+
Drop: () => td,
|
|
9226
|
+
Editable: () => nd,
|
|
9227
|
+
FocusEvents: () => id,
|
|
9228
|
+
Keymap: () => ad,
|
|
9229
|
+
Paste: () => od,
|
|
9230
|
+
Tabindex: () => sd,
|
|
9231
|
+
TextDirection: () => cd,
|
|
9232
|
+
focusEventsPluginKey: () => rd
|
|
9201
9233
|
});
|
|
9202
|
-
var $ = class e extends
|
|
9234
|
+
var $ = class e extends Vu {
|
|
9203
9235
|
constructor() {
|
|
9204
9236
|
super(...arguments), this.type = "extension";
|
|
9205
9237
|
}
|
|
@@ -9213,14 +9245,14 @@ var $ = class e extends zu {
|
|
|
9213
9245
|
let t = typeof e == "function" ? e() : e;
|
|
9214
9246
|
return super.extend(t);
|
|
9215
9247
|
}
|
|
9216
|
-
},
|
|
9248
|
+
}, Qu = $.create({
|
|
9217
9249
|
name: "clipboardTextSerializer",
|
|
9218
9250
|
addOptions() {
|
|
9219
9251
|
return { blockSeparator: void 0 };
|
|
9220
9252
|
},
|
|
9221
9253
|
addProseMirrorPlugins() {
|
|
9222
|
-
return [new
|
|
9223
|
-
key: new
|
|
9254
|
+
return [new M({
|
|
9255
|
+
key: new jn("clipboardTextSerializer"),
|
|
9224
9256
|
props: { clipboardTextSerializer: () => {
|
|
9225
9257
|
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 = Pl(n);
|
|
9226
9258
|
return Ml(r, {
|
|
@@ -9233,12 +9265,12 @@ var $ = class e extends zu {
|
|
|
9233
9265
|
} }
|
|
9234
9266
|
})];
|
|
9235
9267
|
}
|
|
9236
|
-
}),
|
|
9268
|
+
}), $u = $.create({
|
|
9237
9269
|
name: "commands",
|
|
9238
9270
|
addCommands() {
|
|
9239
9271
|
return { ...Xs };
|
|
9240
9272
|
}
|
|
9241
|
-
}),
|
|
9273
|
+
}), ed = $.create({
|
|
9242
9274
|
name: "delete",
|
|
9243
9275
|
onUpdate({ transaction: e, appendedTransactions: t }) {
|
|
9244
9276
|
let n = () => {
|
|
@@ -9291,11 +9323,11 @@ var $ = class e extends zu {
|
|
|
9291
9323
|
};
|
|
9292
9324
|
this.editor.options.coreExtensionOptions?.delete?.async ?? !0 ? setTimeout(n, 0) : n();
|
|
9293
9325
|
}
|
|
9294
|
-
}),
|
|
9326
|
+
}), td = $.create({
|
|
9295
9327
|
name: "drop",
|
|
9296
9328
|
addProseMirrorPlugins() {
|
|
9297
|
-
return [new
|
|
9298
|
-
key: new
|
|
9329
|
+
return [new M({
|
|
9330
|
+
key: new jn("tiptapDrop"),
|
|
9299
9331
|
props: { handleDrop: (e, t, n, r) => {
|
|
9300
9332
|
this.editor.emit("drop", {
|
|
9301
9333
|
editor: this.editor,
|
|
@@ -9306,20 +9338,20 @@ var $ = class e extends zu {
|
|
|
9306
9338
|
} }
|
|
9307
9339
|
})];
|
|
9308
9340
|
}
|
|
9309
|
-
}),
|
|
9341
|
+
}), nd = $.create({
|
|
9310
9342
|
name: "editable",
|
|
9311
9343
|
addProseMirrorPlugins() {
|
|
9312
|
-
return [new
|
|
9313
|
-
key: new
|
|
9344
|
+
return [new M({
|
|
9345
|
+
key: new jn("editable"),
|
|
9314
9346
|
props: { editable: () => this.editor.options.editable }
|
|
9315
9347
|
})];
|
|
9316
9348
|
}
|
|
9317
|
-
}),
|
|
9349
|
+
}), rd = new jn("focusEvents"), id = $.create({
|
|
9318
9350
|
name: "focusEvents",
|
|
9319
9351
|
addProseMirrorPlugins() {
|
|
9320
9352
|
let { editor: e } = this;
|
|
9321
|
-
return [new
|
|
9322
|
-
key:
|
|
9353
|
+
return [new M({
|
|
9354
|
+
key: rd,
|
|
9323
9355
|
props: { handleDOMEvents: {
|
|
9324
9356
|
focus: (t, n) => {
|
|
9325
9357
|
e.isFocused = !0;
|
|
@@ -9334,13 +9366,13 @@ var $ = class e extends zu {
|
|
|
9334
9366
|
} }
|
|
9335
9367
|
})];
|
|
9336
9368
|
}
|
|
9337
|
-
}),
|
|
9369
|
+
}), ad = $.create({
|
|
9338
9370
|
name: "keymap",
|
|
9339
9371
|
addKeyboardShortcuts() {
|
|
9340
9372
|
let e = () => this.editor.commands.first(({ commands: e }) => [
|
|
9341
9373
|
() => e.undoInputRule(),
|
|
9342
9374
|
() => e.command(({ tr: t }) => {
|
|
9343
|
-
let { selection: n, doc: r } = t, { empty: i, $anchor: a } = n, { pos: o, parent: s } = a, c = a.parent.isTextblock && o > 0 ? t.doc.resolve(o - 1) : a, l = c.parent.type.spec.isolating, u = a.pos - a.parentOffset, d = l && c.parent.childCount === 1 ? u === a.pos :
|
|
9375
|
+
let { selection: n, doc: r } = t, { empty: i, $anchor: a } = n, { pos: o, parent: s } = a, c = a.parent.isTextblock && o > 0 ? t.doc.resolve(o - 1) : a, l = c.parent.type.spec.isolating, u = a.pos - a.parentOffset, d = l && c.parent.childCount === 1 ? u === a.pos : O.atStart(r).from === o;
|
|
9344
9376
|
return !i || !s.type.isTextblock || s.textContent.length || !d || d && a.parent.type.name === "paragraph" ? !1 : e.clearNodes();
|
|
9345
9377
|
}),
|
|
9346
9378
|
() => e.deleteSelection(),
|
|
@@ -9379,13 +9411,13 @@ var $ = class e extends zu {
|
|
|
9379
9411
|
return yc() || Rc() ? i : r;
|
|
9380
9412
|
},
|
|
9381
9413
|
addProseMirrorPlugins() {
|
|
9382
|
-
return [new
|
|
9383
|
-
key: new
|
|
9414
|
+
return [new M({
|
|
9415
|
+
key: new jn("clearDocument"),
|
|
9384
9416
|
appendTransaction: (e, t, n) => {
|
|
9385
9417
|
if (e.some((e) => e.getMeta("composition"))) return;
|
|
9386
9418
|
let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
|
|
9387
9419
|
if (!r || i) return;
|
|
9388
|
-
let { empty: a, from: o, to: s } = t.selection, c =
|
|
9420
|
+
let { empty: a, from: o, to: s } = t.selection, c = O.atStart(t.doc).from, l = O.atEnd(t.doc).to;
|
|
9389
9421
|
if (a || !(o === c && s === l) || !$l(n.doc)) return;
|
|
9390
9422
|
let u = n.tr, d = Js({
|
|
9391
9423
|
state: n,
|
|
@@ -9398,11 +9430,11 @@ var $ = class e extends zu {
|
|
|
9398
9430
|
}
|
|
9399
9431
|
})];
|
|
9400
9432
|
}
|
|
9401
|
-
}),
|
|
9433
|
+
}), od = $.create({
|
|
9402
9434
|
name: "paste",
|
|
9403
9435
|
addProseMirrorPlugins() {
|
|
9404
|
-
return [new
|
|
9405
|
-
key: new
|
|
9436
|
+
return [new M({
|
|
9437
|
+
key: new jn("tiptapPaste"),
|
|
9406
9438
|
props: { handlePaste: (e, t, n) => {
|
|
9407
9439
|
this.editor.emit("paste", {
|
|
9408
9440
|
editor: this.editor,
|
|
@@ -9412,15 +9444,15 @@ var $ = class e extends zu {
|
|
|
9412
9444
|
} }
|
|
9413
9445
|
})];
|
|
9414
9446
|
}
|
|
9415
|
-
}),
|
|
9447
|
+
}), sd = $.create({
|
|
9416
9448
|
name: "tabindex",
|
|
9417
9449
|
addProseMirrorPlugins() {
|
|
9418
|
-
return [new
|
|
9419
|
-
key: new
|
|
9450
|
+
return [new M({
|
|
9451
|
+
key: new jn("tabindex"),
|
|
9420
9452
|
props: { attributes: () => this.editor.isEditable ? { tabindex: "0" } : {} }
|
|
9421
9453
|
})];
|
|
9422
9454
|
}
|
|
9423
|
-
}),
|
|
9455
|
+
}), cd = $.create({
|
|
9424
9456
|
name: "textDirection",
|
|
9425
9457
|
addOptions() {
|
|
9426
9458
|
return { direction: void 0 };
|
|
@@ -9441,15 +9473,15 @@ var $ = class e extends zu {
|
|
|
9441
9473
|
}];
|
|
9442
9474
|
},
|
|
9443
9475
|
addProseMirrorPlugins() {
|
|
9444
|
-
return [new
|
|
9445
|
-
key: new
|
|
9476
|
+
return [new M({
|
|
9477
|
+
key: new jn("textDirection"),
|
|
9446
9478
|
props: { attributes: () => {
|
|
9447
9479
|
let e = this.options.direction;
|
|
9448
9480
|
return e ? { dir: e } : {};
|
|
9449
9481
|
} }
|
|
9450
9482
|
})];
|
|
9451
9483
|
}
|
|
9452
|
-
}),
|
|
9484
|
+
}), ld = class e {
|
|
9453
9485
|
constructor(e, t, n = !1, r = null) {
|
|
9454
9486
|
this.currentNode = null, this.actualDepth = null, this.isBlock = n, this.resolvedPos = e, this.editor = t, this.currentNode = r;
|
|
9455
9487
|
}
|
|
@@ -9569,14 +9601,14 @@ var $ = class e extends zu {
|
|
|
9569
9601
|
...e
|
|
9570
9602
|
}), this.editor.view.dispatch(t);
|
|
9571
9603
|
}
|
|
9572
|
-
},
|
|
9573
|
-
function
|
|
9604
|
+
}, ud = ".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}";
|
|
9605
|
+
function dd(e, t, n) {
|
|
9574
9606
|
let r = document.querySelector(`style[data-tiptap-style${n ? `-${n}` : ""}]`);
|
|
9575
9607
|
if (r !== null) return r;
|
|
9576
9608
|
let i = document.createElement("style");
|
|
9577
9609
|
return t && i.setAttribute("nonce", t), i.setAttribute(`data-tiptap-style${n ? `-${n}` : ""}`, ""), i.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(i), i;
|
|
9578
9610
|
}
|
|
9579
|
-
var
|
|
9611
|
+
var fd = class extends Nu {
|
|
9580
9612
|
constructor(e = {}) {
|
|
9581
9613
|
super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.options = {
|
|
9582
9614
|
element: typeof document < "u" ? document.createElement("div") : null,
|
|
@@ -9613,11 +9645,11 @@ var ud = class extends ju {
|
|
|
9613
9645
|
onDelete: () => null,
|
|
9614
9646
|
enableExtensionDispatchTransaction: !0
|
|
9615
9647
|
}, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {
|
|
9616
|
-
getUpdatedPosition:
|
|
9617
|
-
createMappablePosition:
|
|
9648
|
+
getUpdatedPosition: ru,
|
|
9649
|
+
createMappablePosition: iu
|
|
9618
9650
|
}, 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);
|
|
9619
9651
|
let t = this.createDoc(), n = _c(t, this.options.autofocus);
|
|
9620
|
-
this.editorState =
|
|
9652
|
+
this.editorState = Dn.create({
|
|
9621
9653
|
doc: t,
|
|
9622
9654
|
schema: this.schema,
|
|
9623
9655
|
selection: n || void 0
|
|
@@ -9654,7 +9686,7 @@ var ud = class extends ju {
|
|
|
9654
9686
|
return this.commandManager.can();
|
|
9655
9687
|
}
|
|
9656
9688
|
injectCSS() {
|
|
9657
|
-
this.options.injectCSS && typeof document < "u" && (this.css =
|
|
9689
|
+
this.options.injectCSS && typeof document < "u" && (this.css = dd(ud, this.options.injectNonce));
|
|
9658
9690
|
}
|
|
9659
9691
|
setOptions(e = {}) {
|
|
9660
9692
|
this.options = {
|
|
@@ -9710,22 +9742,23 @@ var ud = class extends ju {
|
|
|
9710
9742
|
return this.view.updateState(r), r;
|
|
9711
9743
|
}
|
|
9712
9744
|
createExtensionManager() {
|
|
9713
|
-
|
|
9714
|
-
ed,
|
|
9715
|
-
Xu.configure({ blockSeparator: this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator }),
|
|
9716
|
-
Zu,
|
|
9745
|
+
let e = [...this.options.enableCoreExtensions ? [
|
|
9717
9746
|
nd,
|
|
9718
|
-
|
|
9719
|
-
ad,
|
|
9747
|
+
Qu.configure({ blockSeparator: this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator }),
|
|
9720
9748
|
$u,
|
|
9721
9749
|
id,
|
|
9722
|
-
|
|
9723
|
-
|
|
9750
|
+
ad,
|
|
9751
|
+
sd,
|
|
9752
|
+
td,
|
|
9753
|
+
od,
|
|
9754
|
+
ed,
|
|
9755
|
+
cd.configure({ direction: this.options.textDirection })
|
|
9724
9756
|
].filter((e) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[e.name] !== !1 : !0) : [], ...this.options.extensions].filter((e) => [
|
|
9725
9757
|
"extension",
|
|
9726
9758
|
"node",
|
|
9727
9759
|
"mark"
|
|
9728
|
-
].includes(e?.type))
|
|
9760
|
+
].includes(e?.type));
|
|
9761
|
+
this.extensionManager = new Xu(e, this);
|
|
9729
9762
|
}
|
|
9730
9763
|
createCommandManager() {
|
|
9731
9764
|
this.commandManager = new Ys({ editor: this });
|
|
@@ -9860,14 +9893,14 @@ var ud = class extends ju {
|
|
|
9860
9893
|
return this.$doc?.querySelectorAll(e, t) || null;
|
|
9861
9894
|
}
|
|
9862
9895
|
$pos(e) {
|
|
9863
|
-
return new
|
|
9896
|
+
return new ld(this.state.doc.resolve(e), this);
|
|
9864
9897
|
}
|
|
9865
9898
|
get $doc() {
|
|
9866
9899
|
return this.$pos(0);
|
|
9867
9900
|
}
|
|
9868
9901
|
};
|
|
9869
|
-
function
|
|
9870
|
-
return new
|
|
9902
|
+
function pd(e) {
|
|
9903
|
+
return new Pu({
|
|
9871
9904
|
find: e.find,
|
|
9872
9905
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9873
9906
|
let i = Q(e.getAttributes, void 0, r);
|
|
@@ -9884,8 +9917,8 @@ function dd(e) {
|
|
|
9884
9917
|
undoable: e.undoable
|
|
9885
9918
|
});
|
|
9886
9919
|
}
|
|
9887
|
-
function
|
|
9888
|
-
return new
|
|
9920
|
+
function md(e) {
|
|
9921
|
+
return new Pu({
|
|
9889
9922
|
find: e.find,
|
|
9890
9923
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9891
9924
|
let i = Q(e.getAttributes, void 0, r) || {}, { tr: a } = t, o = n.from, s = n.to, c = e.type.create(i);
|
|
@@ -9903,8 +9936,8 @@ function fd(e) {
|
|
|
9903
9936
|
undoable: e.undoable
|
|
9904
9937
|
});
|
|
9905
9938
|
}
|
|
9906
|
-
function
|
|
9907
|
-
return new
|
|
9939
|
+
function hd(e) {
|
|
9940
|
+
return new Pu({
|
|
9908
9941
|
find: e.find,
|
|
9909
9942
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9910
9943
|
let i = t.doc.resolve(n.from), a = Q(e.getAttributes, void 0, r) || {};
|
|
@@ -9914,8 +9947,8 @@ function pd(e) {
|
|
|
9914
9947
|
undoable: e.undoable
|
|
9915
9948
|
});
|
|
9916
9949
|
}
|
|
9917
|
-
function
|
|
9918
|
-
return new
|
|
9950
|
+
function gd(e) {
|
|
9951
|
+
return new Pu({
|
|
9919
9952
|
find: e.find,
|
|
9920
9953
|
handler: ({ state: t, range: n, match: r }) => {
|
|
9921
9954
|
let i = e.replace, a = n.from, o = n.to;
|
|
@@ -9930,8 +9963,8 @@ function md(e) {
|
|
|
9930
9963
|
undoable: e.undoable
|
|
9931
9964
|
});
|
|
9932
9965
|
}
|
|
9933
|
-
function
|
|
9934
|
-
return new
|
|
9966
|
+
function _d(e) {
|
|
9967
|
+
return new Pu({
|
|
9935
9968
|
find: e.find,
|
|
9936
9969
|
handler: ({ state: t, range: n, match: r, chain: i }) => {
|
|
9937
9970
|
let a = Q(e.getAttributes, void 0, r) || {}, o = t.tr.delete(n.from, n.to), s = o.doc.resolve(n.from).blockRange(), c = s && Et(s, e.type, a);
|
|
@@ -9948,15 +9981,15 @@ function hd(e) {
|
|
|
9948
9981
|
i().updateAttributes(t, a).run();
|
|
9949
9982
|
}
|
|
9950
9983
|
let l = o.doc.resolve(n.from - 1).nodeBefore;
|
|
9951
|
-
l && l.type === e.type &&
|
|
9984
|
+
l && l.type === e.type && Lt(o.doc, n.from - 1) && (!e.joinPredicate || e.joinPredicate(r, l)) && o.join(n.from - 1);
|
|
9952
9985
|
},
|
|
9953
9986
|
undoable: e.undoable
|
|
9954
9987
|
});
|
|
9955
9988
|
}
|
|
9956
|
-
function
|
|
9989
|
+
function vd(e) {
|
|
9957
9990
|
return e.children;
|
|
9958
9991
|
}
|
|
9959
|
-
var
|
|
9992
|
+
var yd = (e, t) => {
|
|
9960
9993
|
if (e === "slot") return 0;
|
|
9961
9994
|
if (e instanceof Function) return e(t);
|
|
9962
9995
|
let { children: n, ...r } = t ?? {};
|
|
@@ -9966,7 +9999,7 @@ var _d = (e, t) => {
|
|
|
9966
9999
|
r,
|
|
9967
10000
|
n
|
|
9968
10001
|
];
|
|
9969
|
-
},
|
|
10002
|
+
}, bd = (e) => "touches" in e, xd = class {
|
|
9970
10003
|
constructor(e) {
|
|
9971
10004
|
this.directions = [
|
|
9972
10005
|
"bottom-left",
|
|
@@ -10055,7 +10088,7 @@ var _d = (e, t) => {
|
|
|
10055
10088
|
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);
|
|
10056
10089
|
}
|
|
10057
10090
|
handleResizeStart(e, t) {
|
|
10058
|
-
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t,
|
|
10091
|
+
e.preventDefault(), e.stopPropagation(), this.isResizing = !0, this.activeHandle = t, bd(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);
|
|
10059
10092
|
}
|
|
10060
10093
|
handleResize(e, t) {
|
|
10061
10094
|
if (!this.activeHandle) return;
|
|
@@ -10095,10 +10128,10 @@ var _d = (e, t) => {
|
|
|
10095
10128
|
height: e / this.aspectRatio
|
|
10096
10129
|
};
|
|
10097
10130
|
}
|
|
10098
|
-
},
|
|
10099
|
-
function
|
|
10131
|
+
}, Sd = xd;
|
|
10132
|
+
function Cd(e, t) {
|
|
10100
10133
|
let { selection: n } = e, { $from: r } = n;
|
|
10101
|
-
if (n instanceof
|
|
10134
|
+
if (n instanceof A) {
|
|
10102
10135
|
let e = r.index();
|
|
10103
10136
|
return r.parent.canReplaceWith(e, e + 1, t);
|
|
10104
10137
|
}
|
|
@@ -10110,32 +10143,32 @@ function xd(e, t) {
|
|
|
10110
10143
|
}
|
|
10111
10144
|
return !1;
|
|
10112
10145
|
}
|
|
10113
|
-
function
|
|
10146
|
+
function wd(e) {
|
|
10114
10147
|
return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
10115
10148
|
}
|
|
10116
|
-
function
|
|
10149
|
+
function Td(e) {
|
|
10117
10150
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/&/g, "&");
|
|
10118
10151
|
}
|
|
10119
|
-
function
|
|
10152
|
+
function Ed(e) {
|
|
10120
10153
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
10121
10154
|
}
|
|
10122
|
-
function
|
|
10155
|
+
function Dd() {
|
|
10123
10156
|
return typeof navigator < "u" ? /Firefox/.test(navigator.userAgent) : !1;
|
|
10124
10157
|
}
|
|
10125
|
-
function
|
|
10158
|
+
function Od(e) {
|
|
10126
10159
|
return typeof e == "string";
|
|
10127
10160
|
}
|
|
10128
|
-
var
|
|
10129
|
-
qs(
|
|
10130
|
-
createAtomBlockMarkdownSpec: () =>
|
|
10131
|
-
createBlockMarkdownSpec: () =>
|
|
10132
|
-
createInlineMarkdownSpec: () =>
|
|
10133
|
-
parseAttributes: () =>
|
|
10134
|
-
parseIndentedBlocks: () =>
|
|
10135
|
-
renderNestedMarkdownContent: () =>
|
|
10136
|
-
serializeAttributes: () =>
|
|
10161
|
+
var kd = {};
|
|
10162
|
+
qs(kd, {
|
|
10163
|
+
createAtomBlockMarkdownSpec: () => Md,
|
|
10164
|
+
createBlockMarkdownSpec: () => Nd,
|
|
10165
|
+
createInlineMarkdownSpec: () => Id,
|
|
10166
|
+
parseAttributes: () => Ad,
|
|
10167
|
+
parseIndentedBlocks: () => Ld,
|
|
10168
|
+
renderNestedMarkdownContent: () => Rd,
|
|
10169
|
+
serializeAttributes: () => jd
|
|
10137
10170
|
});
|
|
10138
|
-
function
|
|
10171
|
+
function Ad(e) {
|
|
10139
10172
|
if (!e?.trim()) return {};
|
|
10140
10173
|
let t = {}, n = [], r = e.replace(/["']([^"']*)["']/g, (e) => (n.push(e), `__QUOTED_${n.length - 1}__`)), i = r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);
|
|
10141
10174
|
i && (t.class = i.map((e) => e.trim().slice(1)).join(" "));
|
|
@@ -10149,15 +10182,15 @@ function Od(e) {
|
|
|
10149
10182
|
e.match(/^[a-zA-Z][\w-]*$/) && (t[e] = !0);
|
|
10150
10183
|
}), t;
|
|
10151
10184
|
}
|
|
10152
|
-
function
|
|
10185
|
+
function jd(e) {
|
|
10153
10186
|
if (!e || Object.keys(e).length === 0) return "";
|
|
10154
10187
|
let t = [];
|
|
10155
10188
|
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]) => {
|
|
10156
10189
|
e === "class" || e === "id" || (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
|
|
10157
10190
|
}), t.join(" ");
|
|
10158
10191
|
}
|
|
10159
|
-
function
|
|
10160
|
-
let { nodeName: t, name: n, parseAttributes: r =
|
|
10192
|
+
function Md(e) {
|
|
10193
|
+
let { nodeName: t, name: n, parseAttributes: r = Ad, serializeAttributes: i = jd, defaultAttributes: a = {}, requiredAttributes: o = [], allowedAttributes: s } = e, c = n || t, l = (e) => {
|
|
10161
10194
|
if (!s) return e;
|
|
10162
10195
|
let t = {};
|
|
10163
10196
|
return s.forEach((n) => {
|
|
@@ -10196,8 +10229,8 @@ function Ad(e) {
|
|
|
10196
10229
|
}
|
|
10197
10230
|
};
|
|
10198
10231
|
}
|
|
10199
|
-
function
|
|
10200
|
-
let { nodeName: t, name: n, getContent: r, parseAttributes: i =
|
|
10232
|
+
function Nd(e) {
|
|
10233
|
+
let { nodeName: t, name: n, getContent: r, parseAttributes: i = Ad, serializeAttributes: a = jd, defaultAttributes: o = {}, content: s = "block", allowedAttributes: c } = e, l = n || t, u = (e) => {
|
|
10201
10234
|
if (!c) return e;
|
|
10202
10235
|
let t = {};
|
|
10203
10236
|
return c.forEach((n) => {
|
|
@@ -10271,7 +10304,7 @@ ${t.renderChildren(e.content || [], "\n\n")}
|
|
|
10271
10304
|
}
|
|
10272
10305
|
};
|
|
10273
10306
|
}
|
|
10274
|
-
function
|
|
10307
|
+
function Pd(e) {
|
|
10275
10308
|
if (!e.trim()) return {};
|
|
10276
10309
|
let t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g, r = n.exec(e);
|
|
10277
10310
|
for (; r !== null;) {
|
|
@@ -10280,11 +10313,11 @@ function Md(e) {
|
|
|
10280
10313
|
}
|
|
10281
10314
|
return t;
|
|
10282
10315
|
}
|
|
10283
|
-
function
|
|
10316
|
+
function Fd(e) {
|
|
10284
10317
|
return Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e}="${t}"`).join(" ");
|
|
10285
10318
|
}
|
|
10286
|
-
function
|
|
10287
|
-
let { nodeName: t, name: n, getContent: r, parseAttributes: i =
|
|
10319
|
+
function Id(e) {
|
|
10320
|
+
let { nodeName: t, name: n, getContent: r, parseAttributes: i = Pd, serializeAttributes: a = Fd, defaultAttributes: o = {}, selfClosing: s = !1, allowedAttributes: c } = e, l = n || t, u = (e) => {
|
|
10288
10321
|
if (!c) return e;
|
|
10289
10322
|
let t = {};
|
|
10290
10323
|
return c.forEach((n) => {
|
|
@@ -10341,7 +10374,7 @@ function Pd(e) {
|
|
|
10341
10374
|
}
|
|
10342
10375
|
};
|
|
10343
10376
|
}
|
|
10344
|
-
function
|
|
10377
|
+
function Ld(e, t, n) {
|
|
10345
10378
|
let r = e.split("\n"), i = [], a = "", o = 0, s = t.baseIndentSize || 2;
|
|
10346
10379
|
for (; o < r.length;) {
|
|
10347
10380
|
let e = r[o], c = e.match(t.itemPattern);
|
|
@@ -10385,7 +10418,7 @@ function Fd(e, t, n) {
|
|
|
10385
10418
|
raw: a
|
|
10386
10419
|
};
|
|
10387
10420
|
}
|
|
10388
|
-
function
|
|
10421
|
+
function Rd(e, t, n, r) {
|
|
10389
10422
|
if (!e || !Array.isArray(e.content)) return "";
|
|
10390
10423
|
let i = typeof n == "function" ? n(r) : n, [a, ...o] = e.content, s = `${i}${t.renderChildren([a])}`;
|
|
10391
10424
|
return o && o.length > 0 && o.forEach((e, n) => {
|
|
@@ -10399,9 +10432,9 @@ ${n}`;
|
|
|
10399
10432
|
}
|
|
10400
10433
|
}), s;
|
|
10401
10434
|
}
|
|
10402
|
-
var
|
|
10403
|
-
function
|
|
10404
|
-
let n =
|
|
10435
|
+
var zd = /* @__PURE__ */ new WeakMap();
|
|
10436
|
+
function Bd(e, t) {
|
|
10437
|
+
let n = zd.get(e);
|
|
10405
10438
|
if (!n) {
|
|
10406
10439
|
let t = {
|
|
10407
10440
|
callbacks: /* @__PURE__ */ new Set(),
|
|
@@ -10412,15 +10445,15 @@ function Rd(e, t) {
|
|
|
10412
10445
|
});
|
|
10413
10446
|
}
|
|
10414
10447
|
};
|
|
10415
|
-
|
|
10448
|
+
zd.set(e, t), e.on("update", t.handler), n = t;
|
|
10416
10449
|
}
|
|
10417
10450
|
n.callbacks.add(t);
|
|
10418
10451
|
}
|
|
10419
|
-
function
|
|
10420
|
-
let n =
|
|
10421
|
-
n && (n.callbacks.delete(t), n.callbacks.size === 0 && (n.rafId !== null && cancelAnimationFrame(n.rafId), e.off("update", n.handler),
|
|
10452
|
+
function Vd(e, t) {
|
|
10453
|
+
let n = zd.get(e);
|
|
10454
|
+
n && (n.callbacks.delete(t), n.callbacks.size === 0 && (n.rafId !== null && cancelAnimationFrame(n.rafId), e.off("update", n.handler), zd.delete(e)));
|
|
10422
10455
|
}
|
|
10423
|
-
function
|
|
10456
|
+
function Hd(e, t, n = {}) {
|
|
10424
10457
|
let { state: r } = t, { doc: i, tr: a } = r, o = e;
|
|
10425
10458
|
i.descendants((t, r) => {
|
|
10426
10459
|
let i = a.mapping.map(r), s = a.mapping.map(r) + t.nodeSize, c = null;
|
|
@@ -10440,7 +10473,7 @@ function Bd(e, t, n = {}) {
|
|
|
10440
10473
|
}
|
|
10441
10474
|
}), a.docChanged && t.view.dispatch(a);
|
|
10442
10475
|
}
|
|
10443
|
-
var
|
|
10476
|
+
var Ud = class {
|
|
10444
10477
|
constructor(e, t, n) {
|
|
10445
10478
|
this.component = e, this.editor = t.editor, this.options = { ...n }, this.mark = t.mark, this.HTMLAttributes = t.HTMLAttributes;
|
|
10446
10479
|
}
|
|
@@ -10451,12 +10484,12 @@ var Vd = class {
|
|
|
10451
10484
|
return null;
|
|
10452
10485
|
}
|
|
10453
10486
|
updateAttributes(e, t) {
|
|
10454
|
-
|
|
10487
|
+
Hd(t || this.mark, this.editor, e);
|
|
10455
10488
|
}
|
|
10456
10489
|
ignoreMutation(e) {
|
|
10457
10490
|
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" && (yc() || vc()) && 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);
|
|
10458
10491
|
}
|
|
10459
|
-
},
|
|
10492
|
+
}, Wd = class e extends Vu {
|
|
10460
10493
|
constructor() {
|
|
10461
10494
|
super(...arguments), this.type = "node";
|
|
10462
10495
|
}
|
|
@@ -10470,7 +10503,7 @@ var Vd = class {
|
|
|
10470
10503
|
let t = typeof e == "function" ? e() : e;
|
|
10471
10504
|
return super.extend(t);
|
|
10472
10505
|
}
|
|
10473
|
-
},
|
|
10506
|
+
}, Gd = class {
|
|
10474
10507
|
constructor(e, t, n) {
|
|
10475
10508
|
this.isDragging = !1, this.component = e, this.editor = t.editor, this.options = {
|
|
10476
10509
|
stopEvent: null,
|
|
@@ -10511,7 +10544,7 @@ var Vd = class {
|
|
|
10511
10544
|
}
|
|
10512
10545
|
let l = this.getPos();
|
|
10513
10546
|
if (typeof l != "number") return;
|
|
10514
|
-
let u =
|
|
10547
|
+
let u = A.create(n.state.doc, l), d = n.state.tr.setSelection(u);
|
|
10515
10548
|
n.dispatch(d);
|
|
10516
10549
|
}
|
|
10517
10550
|
stopEvent(e) {
|
|
@@ -10526,7 +10559,7 @@ var Vd = class {
|
|
|
10526
10559
|
"SELECT",
|
|
10527
10560
|
"TEXTAREA"
|
|
10528
10561
|
].includes(t.tagName) || t.isContentEditable) && !i && !n) return !0;
|
|
10529
|
-
let { isEditable: a } = this.editor, { isDragging: o } = this, s = !!this.node.type.spec.draggable, c =
|
|
10562
|
+
let { isEditable: a } = this.editor, { isDragging: o } = this, s = !!this.node.type.spec.draggable, c = A.isSelectable(this.node), l = e.type === "copy", u = e.type === "paste", d = e.type === "cut", f = e.type === "mousedown";
|
|
10530
10563
|
if (!s && c && n && e.target === this.dom && e.preventDefault(), s && n && !o && e.target === this.dom) return e.preventDefault(), !1;
|
|
10531
10564
|
if (s && a && !o && f) {
|
|
10532
10565
|
let e = t.closest("[data-drag-handle]");
|
|
@@ -10562,23 +10595,23 @@ var Vd = class {
|
|
|
10562
10595
|
});
|
|
10563
10596
|
}
|
|
10564
10597
|
};
|
|
10565
|
-
function
|
|
10566
|
-
return new
|
|
10598
|
+
function Kd(e) {
|
|
10599
|
+
return new Wu({
|
|
10567
10600
|
find: e.find,
|
|
10568
10601
|
handler: ({ state: t, range: n, match: r, pasteEvent: i }) => {
|
|
10569
10602
|
let a = Q(e.getAttributes, void 0, r, i);
|
|
10570
10603
|
if (a === !1 || a === null) return null;
|
|
10571
10604
|
let { tr: o } = t, s = r[r.length - 1], c = r[0], l = n.to;
|
|
10572
10605
|
if (s) {
|
|
10573
|
-
let
|
|
10574
|
-
if (Hl(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 >
|
|
10575
|
-
|
|
10606
|
+
let i = c.search(/\S/), u = n.from + c.indexOf(s), d = u + s.length;
|
|
10607
|
+
if (Hl(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;
|
|
10608
|
+
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);
|
|
10576
10609
|
}
|
|
10577
10610
|
}
|
|
10578
10611
|
});
|
|
10579
10612
|
}
|
|
10580
|
-
function
|
|
10581
|
-
return new
|
|
10613
|
+
function qd(e) {
|
|
10614
|
+
return new Wu({
|
|
10582
10615
|
find: e.find,
|
|
10583
10616
|
handler({ match: t, chain: n, range: r, pasteEvent: i }) {
|
|
10584
10617
|
let a = Q(e.getAttributes, void 0, t, i), o = Q(e.getContent, void 0, a);
|
|
@@ -10591,8 +10624,8 @@ function Gd(e) {
|
|
|
10591
10624
|
}
|
|
10592
10625
|
});
|
|
10593
10626
|
}
|
|
10594
|
-
function
|
|
10595
|
-
return new
|
|
10627
|
+
function Jd(e) {
|
|
10628
|
+
return new Wu({
|
|
10596
10629
|
find: e.find,
|
|
10597
10630
|
handler: ({ state: t, range: n, match: r }) => {
|
|
10598
10631
|
let i = e.replace, a = n.from, o = n.to;
|
|
@@ -10606,7 +10639,7 @@ function Kd(e) {
|
|
|
10606
10639
|
}
|
|
10607
10640
|
});
|
|
10608
10641
|
}
|
|
10609
|
-
var
|
|
10642
|
+
var Yd = class {
|
|
10610
10643
|
constructor(e) {
|
|
10611
10644
|
this.transaction = e, this.currentStep = this.transaction.steps.length;
|
|
10612
10645
|
}
|
|
@@ -10622,4 +10655,4 @@ var qd = class {
|
|
|
10622
10655
|
}
|
|
10623
10656
|
};
|
|
10624
10657
|
//#endregion
|
|
10625
|
-
export { il as $,
|
|
10658
|
+
export { il as $, Yu as $t, Td as A, ql as At, ul as B, gc as Bt, Nd as C, k as Cn, Xl as Ct, iu as D, l as Dn, pl as Dt, Id as E, r as En, Dd as Et, wd as F, Uu as Ft, jl as G, yl as Gt, dl as H, pd as Ht, Zu as I, zu as It, gl as J, md as Jt, Fl as K, Bu as Kt, sl as L, lc as Lt, qc as M, $l as Mt, Tc as N, eu as Nt, Ec as O, Ql as Ot, Ed as P, tu as Pt, fl as Q, Ld as Qt, cl as R, bc as Rt, Md as S, O as Sn, Yl as St, nl as T, Ut as Tn, Zl as Tt, xl as U, Kd as Ut, ll as V, yc as Vt, Al as W, kd as Wt, Vl as X, uc as Xt, Bl as Y, qd as Yt, Z, Ad as Zt, Q as _, Uo as _n, yd as _t, vd as a, su as an, J as at, al as b, M as bn, Jl as bt, Hu as c, jd as cn, Tl as ct, ld as d, gd as dn, Gl as dt, au as en, pc as et, Gd as f, Jd as fn, Nl as ft, Yd as g, Gs as gn, ru as gt, Sd as h, _d as hn, Pl as ht, $ as i, _c as in, Il as it, ol as j, Vc as jt, dd as k, Rc as kt, Ud as l, Dl as ln, Wl as lt, xd as m, Hd as mn, Kl as mt, fd as n, Rd as nn, Hl as nt, Pu as o, Bd as on, bl as ot, Wu as p, hd as pn, Ml as pt, Ll as q, X as qt, Vu as r, Ol as rn, Ul as rt, nu as s, Dc as sn, kl as st, Ys as t, Rl as tn, Y as tt, Wd as u, hl as un, Kc as ut, Cd as v, G as vn, Sl as vt, Js as w, ft as wn, ml as wt, Xs as x, jn as xn, vc as xt, Vd as y, A as yn, Lu as yt, El as z, Od as zt };
|