@templatical/editor 0.16.5 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-CYAbVB2G.js → AiChatSidebar-LxCHMdcj.js} +1 -1
- package/dist/{AiFeatureMenu-B1oEJebq.js → AiFeatureMenu-Cr8pLXMj.js} +3 -3
- package/dist/{BlockIssueBadge-BLytBabN.js → BlockIssueBadge-BQ1yB1me.js} +2 -2
- package/dist/{CloudEditor-D6KNL6VU.js → CloudEditor-qzoNS8K4.js} +11 -10
- package/dist/{CollaboratorBar-C_EhXQ5R.js → CollaboratorBar-BkfR0CyD.js} +2 -2
- package/dist/{ColorPicker-CppJgX_T.js → ColorPicker-DfzDyNKe.js} +4 -4
- package/dist/{CommentsSidebar-C_XLBbo3.js → CommentsSidebar-Cl93TN96.js} +3 -3
- package/dist/{CountdownBlock-173fiO5Z.js → CountdownBlock-DbXfzwae.js} +1 -1
- package/dist/{CountdownToolbar-D5GaA_lt.js → CountdownToolbar-BqaMWRyB.js} +3 -3
- package/dist/{DesignReferenceSidebar-Bh9uAZ4B.js → DesignReferenceSidebar-jVrdS8wW.js} +2 -2
- package/dist/{IssuesPanel-DltSuU6H.js → IssuesPanel-Bq3yXg6M.js} +2 -2
- package/dist/{MergeTagSuggestion-jIpT_jmz.js → MergeTagSuggestion-DCuaSOPQ.js} +148 -162
- package/dist/{ModuleBrowserModal-CXy8Bbv9.js → ModuleBrowserModal-XEHfEO0O.js} +7 -7
- package/dist/{ModulePreviewCanvas-CJC9kyZN.js → ModulePreviewCanvas-BM8XUgbc.js} +2 -2
- package/dist/{NumberWithSuffix-DNi-v4l1.js → NumberWithSuffix-9FG7mNnn.js} +1 -1
- package/dist/{ParagraphEditor-nk5Vvr7M.js → ParagraphEditor-Cs47wU1V.js} +19 -19
- package/dist/{RichTextEditorContent-DBaCrvH0.js → RichTextEditorContent-DCzmVeyb.js} +5 -5
- package/dist/{SaveModuleDialog-CYu5PhBz.js → SaveModuleDialog-BgOS9vCQ.js} +6 -6
- package/dist/{SnapshotHistory-B38ImqMO.js → SnapshotHistory-CLfYzwv9.js} +4 -4
- package/dist/{TemplateScoringPanel-ZhObHWeb.js → TemplateScoringPanel-CMrfa9Rd.js} +3 -3
- package/dist/{TestEmailModal-DbstIzEf.js → TestEmailModal-DTLfATNt.js} +3 -3
- package/dist/{TitleEditor-CmfkOHJT.js → TitleEditor-Bq9S0C8Z.js} +10 -10
- package/dist/{TplModal-BXnx3sLr.js → TplModal-BW0FAtYe.js} +3 -3
- package/dist/{blockTypeIcons-BVIEw0XJ.js → blockTypeIcons-CvSfLeyV.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-DI1ViqMa.js → ca-CSl--oWR.js} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-CuIg4yrB.js → AiFeatureMenu-B0zH66nO.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-CuIg4yrB.js.map → AiFeatureMenu-B0zH66nO.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BHEl_Hs7.js → BlockIssueBadge-yD4pKsU9.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-BHEl_Hs7.js.map → BlockIssueBadge-yD4pKsU9.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-1Ms0w691.js → CloudEditor-Da-aSmw5.js} +10 -9
- package/dist/cdn/chunks/CloudEditor-Da-aSmw5.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-C0a5P64z.js → CollaboratorBar-DixaFis-.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C0a5P64z.js.map → CollaboratorBar-DixaFis-.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-bsMmT-_B.js → ColorPicker-O6xXCPEg.js} +2 -2
- package/dist/cdn/chunks/{ColorPicker-bsMmT-_B.js.map → ColorPicker-O6xXCPEg.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-8053oz4k.js → CountdownBlock-jgBPbI1p.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-8053oz4k.js.map → CountdownBlock-jgBPbI1p.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DQ_zrorh.js → CountdownToolbar-DrmZwvIH.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-DQ_zrorh.js.map → CountdownToolbar-DrmZwvIH.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CwQ376nf.js → IssuesPanel-CpyhXg9M.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-CwQ376nf.js.map → IssuesPanel-CpyhXg9M.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-rpZ6Ol-i.js → MergeTagSuggestion-BmMmdcRg.js} +2 -2
- package/dist/cdn/chunks/{MergeTagSuggestion-rpZ6Ol-i.js.map → MergeTagSuggestion-BmMmdcRg.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DUegB2Jk.js → ModuleBrowserModal-DPQLFTti.js} +5 -5
- package/dist/cdn/chunks/{ModuleBrowserModal-DUegB2Jk.js.map → ModuleBrowserModal-DPQLFTti.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-f4h8r9Lh.js → ModulePreviewCanvas-Csc6M0RA.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-f4h8r9Lh.js.map → ModulePreviewCanvas-Csc6M0RA.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-Bu_nHJuD.js → NumberWithSuffix-YmcsBmCd.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-Bu_nHJuD.js.map → NumberWithSuffix-YmcsBmCd.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-IpZsg8qo.js → ParagraphEditor-DR5AcHB0.js} +17 -17
- package/dist/cdn/chunks/{ParagraphEditor-IpZsg8qo.js.map → ParagraphEditor-DR5AcHB0.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DDnqZ9cB.js → RichTextEditorContent-52c2EuCT.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-DDnqZ9cB.js.map → RichTextEditorContent-52c2EuCT.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-CVA5HPCi.js → SaveModuleDialog-dpRlVrrQ.js} +2 -2
- package/dist/cdn/chunks/{SaveModuleDialog-CVA5HPCi.js.map → SaveModuleDialog-dpRlVrrQ.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DU8wm0Rh.js → TitleEditor-DtQTPAg3.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-DU8wm0Rh.js.map → TitleEditor-DtQTPAg3.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-Dm5Oosjp.js → blockTypeIcons-B0ktHdUG.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-Dm5Oosjp.js.map → blockTypeIcons-B0ktHdUG.js.map} +1 -1
- package/dist/cdn/chunks/{ca-DI1ViqMa.js → ca-CSl--oWR.js} +2 -2
- package/dist/cdn/chunks/ca-CSl--oWR.js.map +1 -0
- package/dist/{de-q9lTCMre.js → cdn/chunks/de-ZaffrKDP.js} +3 -1
- package/dist/cdn/chunks/de-ZaffrKDP.js.map +1 -0
- package/dist/cdn/chunks/{en-CR4LItrX.js → en-CHuXeJDt.js} +2 -2
- package/dist/cdn/chunks/en-CHuXeJDt.js.map +1 -0
- package/dist/cdn/chunks/{es-CEt-lrGd.js → es-CaC8VQjO.js} +2 -2
- package/dist/cdn/chunks/es-CaC8VQjO.js.map +1 -0
- package/dist/cdn/chunks/{extensions-BGUoo2a5.js → extensions-CiewgCtw.js} +4 -4
- package/dist/cdn/chunks/{extensions-BGUoo2a5.js.map → extensions-CiewgCtw.js.map} +1 -1
- package/dist/cdn/chunks/{features-BSpDuFFR.js → features-DLu_D-6j.js} +702 -671
- package/dist/cdn/chunks/features-DLu_D-6j.js.map +1 -0
- package/dist/cdn/chunks/{icons-k3XVoRvc.js → icons-B03IY-pm.js} +2 -2
- package/dist/cdn/chunks/{icons-k3XVoRvc.js.map → icons-B03IY-pm.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-iDq3otm6.js → media-library-CYF18RNk.js} +3 -3
- package/dist/cdn/chunks/{media-library-iDq3otm6.js.map → media-library-CYF18RNk.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-DvBHY0AA.js → pt-BR-C74zfEWH.js} +2 -2
- package/dist/cdn/chunks/pt-BR-C74zfEWH.js.map +1 -0
- package/dist/cdn/chunks/{quality-Bb7vN32U.js → quality-LmsngN2B.js} +2 -2
- package/dist/cdn/chunks/{quality-Bb7vN32U.js.map → quality-LmsngN2B.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-cOvtk8HM.js → renderer-DAeNIQqa.js} +4 -4
- package/dist/cdn/chunks/renderer-DAeNIQqa.js.map +1 -0
- package/dist/cdn/chunks/{src-Ddp969zE.js → src-CModhUDN.js} +4 -4
- package/dist/cdn/chunks/{src-Ddp969zE.js.map → src-CModhUDN.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CW_gRVVR.js → styles-hd_LBGaF.js} +10 -10
- package/dist/cdn/chunks/{styles-CW_gRVVR.js.map → styles-hd_LBGaF.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-zpXk5mN4.js → tiptap-C2indasq.js} +806 -811
- package/dist/cdn/chunks/tiptap-C2indasq.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +13 -12
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cdn/chunks/de-q9lTCMre.js → de-ZaffrKDP.js} +1 -3
- package/dist/{dist-BReUTadj.js → dist-8TKf-Jpg.js} +2 -2
- package/dist/{dist-BE9m_i60.js → dist-BDVm2MrW.js} +1 -1
- package/dist/{dist-D1WmF8BF.js → dist-BKKo5wPC.js} +1 -1
- package/dist/{dist-DhY2di4U.js → dist-COSN3oDJ.js} +1 -1
- package/dist/{dist-CHLoeloJ.js → dist-CcX5sLpz.js} +1 -1
- package/dist/{dist-D9g4CSnm.js → dist-CgTKuIUN.js} +300 -298
- package/dist/{dist-i_Z7t67A.js → dist-Cx7IUM7J.js} +22 -15
- package/dist/{dist-Bm07Z3Es.js → dist-D6M5FAY7.js} +1 -1
- package/dist/{dist-DGEaAAIb.js → dist-DXAZUjj3.js} +1 -1
- package/dist/{dist-BXR1aBJV.js → dist-DbekZDmJ.js} +1 -1
- package/dist/{dist-DcKlLQ8d.js → dist-Dk5AdwoQ.js} +1 -1
- package/dist/{dist-BPPeDw62.js → dist-YSCPD13F.js} +1 -1
- package/dist/{en-CR4LItrX.js → en-CHuXeJDt.js} +1 -1
- package/dist/{es-CEt-lrGd.js → es-CaC8VQjO.js} +1 -1
- package/dist/{extensions-Cjd-VAII.js → extensions-DhgbhfBX.js} +5 -5
- package/dist/index.d.ts +44 -0
- package/dist/keys-WVNarXg8.js +10 -0
- package/dist/{pt-BR-DvBHY0AA.js → pt-BR-C74zfEWH.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-DJfTblY7.js → styles-BWC0jc5-.js} +26 -26
- package/dist/templatical-editor.js +11 -10
- package/dist/{useCloudI18n-WbfVWq5k.js → useCloudI18n-CIKI0hCd.js} +1 -1
- package/dist/{useEditorCore-DnOG2a_b.js → useEditorCore-FLMIhtv1.js} +703 -672
- package/dist/{useI18n-eR1yVW0v.js → useI18n-0EU_JVe7.js} +1 -1
- package/dist/{useMergeTag-C3GfSktg.js → useMergeTag-C7v6MVah.js} +2 -2
- package/dist/{usePopoverPosition-B3Byo68F.js → usePopoverPosition-BDqqnMeo.js} +1 -1
- package/package.json +8 -8
- package/dist/cdn/chunks/CloudEditor-1Ms0w691.js.map +0 -1
- package/dist/cdn/chunks/ca-DI1ViqMa.js.map +0 -1
- package/dist/cdn/chunks/de-q9lTCMre.js.map +0 -1
- package/dist/cdn/chunks/en-CR4LItrX.js.map +0 -1
- package/dist/cdn/chunks/es-CEt-lrGd.js.map +0 -1
- package/dist/cdn/chunks/features-BSpDuFFR.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-DvBHY0AA.js.map +0 -1
- package/dist/cdn/chunks/renderer-cOvtk8HM.js.map +0 -1
- package/dist/cdn/chunks/tiptap-zpXk5mN4.js.map +0 -1
- package/dist/keys-BbDgCU6K.js +0 -10
|
@@ -64,7 +64,7 @@ e.prototype = {
|
|
|
64
64
|
return new e(n);
|
|
65
65
|
};
|
|
66
66
|
//#endregion
|
|
67
|
-
//#region ../../node_modules/.pnpm/prosemirror-model@1.25.
|
|
67
|
+
//#region ../../node_modules/.pnpm/prosemirror-model@1.25.11/node_modules/prosemirror-model/dist/index.js
|
|
68
68
|
function t(e, n, a) {
|
|
69
69
|
for (let o = 0;; o++) {
|
|
70
70
|
if (o == e.childCount || o == n.childCount) return e.childCount == n.childCount ? null : a;
|
|
@@ -1398,6 +1398,7 @@ var Ie = class e {
|
|
|
1398
1398
|
article: !0,
|
|
1399
1399
|
aside: !0,
|
|
1400
1400
|
blockquote: !0,
|
|
1401
|
+
body: !0,
|
|
1401
1402
|
canvas: !0,
|
|
1402
1403
|
dd: !0,
|
|
1403
1404
|
div: !0,
|
|
@@ -3894,103 +3895,103 @@ function wr(e) {
|
|
|
3894
3895
|
};
|
|
3895
3896
|
}
|
|
3896
3897
|
//#endregion
|
|
3897
|
-
//#region ../../node_modules/.pnpm/prosemirror-view@1.42.
|
|
3898
|
+
//#region ../../node_modules/.pnpm/prosemirror-view@1.42.1/node_modules/prosemirror-view/dist/index.js
|
|
3898
3899
|
var M = function(e) {
|
|
3899
3900
|
for (var t = 0;; t++) if (e = e.previousSibling, !e) return t;
|
|
3900
3901
|
}, Tr = function(e) {
|
|
3901
3902
|
let t = e.assignedSlot || e.parentNode;
|
|
3902
3903
|
return t && t.nodeType == 11 ? t.host : t;
|
|
3903
|
-
}, Er = null,
|
|
3904
|
+
}, Er = null, N = function(e, t, n) {
|
|
3904
3905
|
let r = Er ||= document.createRange();
|
|
3905
3906
|
return r.setEnd(e, n ?? e.nodeValue.length), r.setStart(e, t || 0), r;
|
|
3906
|
-
},
|
|
3907
|
+
}, Dr = function() {
|
|
3907
3908
|
Er = null;
|
|
3908
|
-
},
|
|
3909
|
-
return n && (
|
|
3910
|
-
},
|
|
3911
|
-
function
|
|
3909
|
+
}, Or = function(e, t, n, r) {
|
|
3910
|
+
return n && (Ar(e, t, n, r, -1) || Ar(e, t, n, r, 1));
|
|
3911
|
+
}, kr = /^(img|br|input|textarea|hr)$/i;
|
|
3912
|
+
function Ar(e, t, n, r, i) {
|
|
3912
3913
|
for (;;) {
|
|
3913
3914
|
if (e == n && t == r) return !0;
|
|
3914
|
-
if (t == (i < 0 ? 0 :
|
|
3915
|
+
if (t == (i < 0 ? 0 : P(e))) {
|
|
3915
3916
|
let n = e.parentNode;
|
|
3916
|
-
if (!n || n.nodeType != 1 ||
|
|
3917
|
+
if (!n || n.nodeType != 1 || Pr(e) || kr.test(e.nodeName) || e.contentEditable == "false") return !1;
|
|
3917
3918
|
t = M(e) + (i < 0 ? 0 : 1), e = n;
|
|
3918
3919
|
} else if (e.nodeType == 1) {
|
|
3919
3920
|
let n = e.childNodes[t + (i < 0 ? -1 : 0)];
|
|
3920
3921
|
if (n.nodeType == 1 && n.contentEditable == "false") if (n.pmViewDesc?.ignoreForSelection) t += i;
|
|
3921
3922
|
else return !1;
|
|
3922
|
-
else e = n, t = i < 0 ?
|
|
3923
|
+
else e = n, t = i < 0 ? P(e) : 0;
|
|
3923
3924
|
} else return !1;
|
|
3924
3925
|
}
|
|
3925
3926
|
}
|
|
3926
|
-
function
|
|
3927
|
+
function P(e) {
|
|
3927
3928
|
return e.nodeType == 3 ? e.nodeValue.length : e.childNodes.length;
|
|
3928
3929
|
}
|
|
3929
|
-
function
|
|
3930
|
+
function jr(e, t) {
|
|
3930
3931
|
for (;;) {
|
|
3931
3932
|
if (e.nodeType == 3 && t) return e;
|
|
3932
3933
|
if (e.nodeType == 1 && t > 0) {
|
|
3933
3934
|
if (e.contentEditable == "false") return null;
|
|
3934
|
-
e = e.childNodes[t - 1], t =
|
|
3935
|
-
} else if (e.parentNode && !
|
|
3935
|
+
e = e.childNodes[t - 1], t = P(e);
|
|
3936
|
+
} else if (e.parentNode && !Pr(e)) t = M(e), e = e.parentNode;
|
|
3936
3937
|
else return null;
|
|
3937
3938
|
}
|
|
3938
3939
|
}
|
|
3939
|
-
function
|
|
3940
|
+
function Mr(e, t) {
|
|
3940
3941
|
for (;;) {
|
|
3941
3942
|
if (e.nodeType == 3 && t < e.nodeValue.length) return e;
|
|
3942
3943
|
if (e.nodeType == 1 && t < e.childNodes.length) {
|
|
3943
3944
|
if (e.contentEditable == "false") return null;
|
|
3944
3945
|
e = e.childNodes[t], t = 0;
|
|
3945
|
-
} else if (e.parentNode && !
|
|
3946
|
+
} else if (e.parentNode && !Pr(e)) t = M(e) + 1, e = e.parentNode;
|
|
3946
3947
|
else return null;
|
|
3947
3948
|
}
|
|
3948
3949
|
}
|
|
3949
|
-
function
|
|
3950
|
-
for (let r = t == 0, i = t ==
|
|
3950
|
+
function Nr(e, t, n) {
|
|
3951
|
+
for (let r = t == 0, i = t == P(e); r || i;) {
|
|
3951
3952
|
if (e == n) return !0;
|
|
3952
3953
|
let t = M(e);
|
|
3953
3954
|
if (e = e.parentNode, !e) return !1;
|
|
3954
|
-
r &&= t == 0, i &&= t ==
|
|
3955
|
+
r &&= t == 0, i &&= t == P(e);
|
|
3955
3956
|
}
|
|
3956
3957
|
}
|
|
3957
|
-
function
|
|
3958
|
+
function Pr(e) {
|
|
3958
3959
|
let t;
|
|
3959
3960
|
for (let n = e; n && !(t = n.pmViewDesc); n = n.parentNode);
|
|
3960
3961
|
return t && t.node && t.node.isBlock && (t.dom == e || t.contentDOM == e);
|
|
3961
3962
|
}
|
|
3962
|
-
var
|
|
3963
|
-
return e.focusNode &&
|
|
3963
|
+
var Fr = function(e) {
|
|
3964
|
+
return e.focusNode && Or(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset);
|
|
3964
3965
|
};
|
|
3965
|
-
function
|
|
3966
|
+
function Ir(e, t) {
|
|
3966
3967
|
let n = document.createEvent("Event");
|
|
3967
3968
|
return n.initEvent("keydown", !0, !0), n.keyCode = e, n.key = n.code = t, n;
|
|
3968
3969
|
}
|
|
3969
|
-
function
|
|
3970
|
+
function Lr(e) {
|
|
3970
3971
|
let t = e.activeElement;
|
|
3971
3972
|
for (; t && t.shadowRoot;) t = t.shadowRoot.activeElement;
|
|
3972
3973
|
return t;
|
|
3973
3974
|
}
|
|
3974
|
-
function
|
|
3975
|
+
function Rr(e, t, n) {
|
|
3975
3976
|
if (e.caretPositionFromPoint) try {
|
|
3976
3977
|
let r = e.caretPositionFromPoint(t, n);
|
|
3977
3978
|
if (r) return {
|
|
3978
3979
|
node: r.offsetNode,
|
|
3979
|
-
offset: Math.min(
|
|
3980
|
+
offset: Math.min(P(r.offsetNode), r.offset)
|
|
3980
3981
|
};
|
|
3981
3982
|
} catch {}
|
|
3982
3983
|
if (e.caretRangeFromPoint) {
|
|
3983
3984
|
let r = e.caretRangeFromPoint(t, n);
|
|
3984
3985
|
if (r) return {
|
|
3985
3986
|
node: r.startContainer,
|
|
3986
|
-
offset: Math.min(
|
|
3987
|
+
offset: Math.min(P(r.startContainer), r.startOffset)
|
|
3987
3988
|
};
|
|
3988
3989
|
}
|
|
3989
3990
|
}
|
|
3990
|
-
var
|
|
3991
|
-
|
|
3992
|
-
var
|
|
3993
|
-
function
|
|
3991
|
+
var F = typeof navigator < "u" ? navigator : null, zr = typeof document < "u" ? document : null, Br = F && F.userAgent || "", Vr = /Edge\/(\d+)/.exec(Br), Hr = /MSIE \d/.exec(Br), Ur = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Br), I = !!(Hr || Ur || Vr), Wr = Hr ? document.documentMode : Ur ? +Ur[1] : Vr ? +Vr[1] : 0, L = !I && /gecko\/(\d+)/i.test(Br);
|
|
3992
|
+
L && +(/Firefox\/(\d+)/.exec(Br) || [0, 0])[1];
|
|
3993
|
+
var Gr = !I && /Chrome\/(\d+)/.exec(Br), R = !!Gr, Kr = Gr ? +Gr[1] : 0, z = !I && !!F && /Apple Computer/.test(F.vendor), qr = z && (/Mobile\/\w+/.test(Br) || !!F && F.maxTouchPoints > 2), B = qr || (F ? /Mac/.test(F.platform) : !1), Jr = F ? /Win/.test(F.platform) : !1, Yr = /Android \d/.test(Br), Xr = !!zr && "webkitFontSmoothing" in zr.documentElement.style, Zr = Xr ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
3994
|
+
function Qr(e) {
|
|
3994
3995
|
let t = e.defaultView && e.defaultView.visualViewport;
|
|
3995
3996
|
return t ? {
|
|
3996
3997
|
left: 0,
|
|
@@ -4004,10 +4005,10 @@ function $r(e) {
|
|
|
4004
4005
|
bottom: e.documentElement.clientHeight
|
|
4005
4006
|
};
|
|
4006
4007
|
}
|
|
4007
|
-
function
|
|
4008
|
+
function $r(e, t) {
|
|
4008
4009
|
return typeof e == "number" ? e : e[t];
|
|
4009
4010
|
}
|
|
4010
|
-
function
|
|
4011
|
+
function ei(e) {
|
|
4011
4012
|
let t = e.getBoundingClientRect(), n = t.width / e.offsetWidth || 1, r = t.height / e.offsetHeight || 1;
|
|
4012
4013
|
return {
|
|
4013
4014
|
left: t.left,
|
|
@@ -4016,15 +4017,16 @@ function ti(e) {
|
|
|
4016
4017
|
bottom: t.top + e.clientHeight * r
|
|
4017
4018
|
};
|
|
4018
4019
|
}
|
|
4019
|
-
function
|
|
4020
|
+
function ti(e, t, n) {
|
|
4021
|
+
if (!gi(t) && t.left == 0) return;
|
|
4020
4022
|
let r = e.someProp("scrollThreshold") || 0, i = e.someProp("scrollMargin") || 5, a = e.dom.ownerDocument;
|
|
4021
4023
|
for (let o = n || e.dom; o;) {
|
|
4022
4024
|
if (o.nodeType != 1) {
|
|
4023
4025
|
o = Tr(o);
|
|
4024
4026
|
continue;
|
|
4025
4027
|
}
|
|
4026
|
-
let e = o, n = e == a.body, s = n ?
|
|
4027
|
-
if (t.top < s.top +
|
|
4028
|
+
let e = o, n = e == a.body, s = n ? Qr(a) : ei(e), c = 0, l = 0;
|
|
4029
|
+
if (t.top < s.top + $r(r, "top") ? l = -(s.top - t.top + $r(i, "top")) : t.bottom > s.bottom - $r(r, "bottom") && (l = t.bottom - t.top > s.bottom - s.top ? t.top + $r(i, "top") - s.top : t.bottom - s.bottom + $r(i, "bottom")), t.left < s.left + $r(r, "left") ? c = -(s.left - t.left + $r(i, "left")) : t.right > s.right - $r(r, "right") && (c = t.right - s.right + $r(i, "right")), c || l) if (n) a.defaultView.scrollBy(c, l);
|
|
4028
4030
|
else {
|
|
4029
4031
|
let n = e.scrollLeft, r = e.scrollTop;
|
|
4030
4032
|
l && (e.scrollTop += l), c && (e.scrollLeft += c);
|
|
@@ -4041,7 +4043,7 @@ function ni(e, t, n) {
|
|
|
4041
4043
|
o = u == "absolute" ? o.offsetParent : Tr(o);
|
|
4042
4044
|
}
|
|
4043
4045
|
}
|
|
4044
|
-
function
|
|
4046
|
+
function ni(e) {
|
|
4045
4047
|
let t = e.dom.getBoundingClientRect(), n = Math.max(0, t.top), r, i;
|
|
4046
4048
|
for (let a = (t.left + t.right) / 2, o = n + 1; o < Math.min(innerHeight, t.bottom); o += 5) {
|
|
4047
4049
|
let t = e.root.elementFromPoint(a, o);
|
|
@@ -4055,10 +4057,10 @@ function ri(e) {
|
|
|
4055
4057
|
return {
|
|
4056
4058
|
refDOM: r,
|
|
4057
4059
|
refTop: i,
|
|
4058
|
-
stack:
|
|
4060
|
+
stack: ri(e.dom)
|
|
4059
4061
|
};
|
|
4060
4062
|
}
|
|
4061
|
-
function
|
|
4063
|
+
function ri(e) {
|
|
4062
4064
|
let t = [], n = e.ownerDocument;
|
|
4063
4065
|
for (let r = e; r && (t.push({
|
|
4064
4066
|
dom: r,
|
|
@@ -4067,31 +4069,31 @@ function ii(e) {
|
|
|
4067
4069
|
}), e != n); r = Tr(r));
|
|
4068
4070
|
return t;
|
|
4069
4071
|
}
|
|
4070
|
-
function
|
|
4072
|
+
function ii({ refDOM: e, refTop: t, stack: n }) {
|
|
4071
4073
|
let r = e ? e.getBoundingClientRect().top : 0;
|
|
4072
|
-
|
|
4074
|
+
ai(n, r == 0 ? 0 : r - t);
|
|
4073
4075
|
}
|
|
4074
|
-
function
|
|
4076
|
+
function ai(e, t) {
|
|
4075
4077
|
for (let n = 0; n < e.length; n++) {
|
|
4076
4078
|
let { dom: r, top: i, left: a } = e[n];
|
|
4077
4079
|
r.scrollTop != i + t && (r.scrollTop = i + t), r.scrollLeft != a && (r.scrollLeft = a);
|
|
4078
4080
|
}
|
|
4079
4081
|
}
|
|
4080
|
-
var
|
|
4081
|
-
function
|
|
4082
|
+
var oi = null;
|
|
4083
|
+
function si(e) {
|
|
4082
4084
|
if (e.setActive) return e.setActive();
|
|
4083
|
-
if (
|
|
4084
|
-
let t =
|
|
4085
|
-
e.focus(
|
|
4086
|
-
return
|
|
4087
|
-
} } : void 0),
|
|
4085
|
+
if (oi) return e.focus(oi);
|
|
4086
|
+
let t = ri(e);
|
|
4087
|
+
e.focus(oi == null ? { get preventScroll() {
|
|
4088
|
+
return oi = { preventScroll: !0 }, !0;
|
|
4089
|
+
} } : void 0), oi || (oi = !1, ai(t, 0));
|
|
4088
4090
|
}
|
|
4089
|
-
function
|
|
4091
|
+
function ci(e, t) {
|
|
4090
4092
|
let n, r = 2e8, i, a = 0, o = t.top, s = t.top, c, l;
|
|
4091
4093
|
for (let u = e.firstChild, d = 0; u; u = u.nextSibling, d++) {
|
|
4092
4094
|
let e;
|
|
4093
4095
|
if (u.nodeType == 1) e = u.getClientRects();
|
|
4094
|
-
else if (u.nodeType == 3) e =
|
|
4096
|
+
else if (u.nodeType == 3) e = N(u).getClientRects();
|
|
4095
4097
|
else continue;
|
|
4096
4098
|
for (let f = 0; f < e.length; f++) {
|
|
4097
4099
|
let p = e[f];
|
|
@@ -4112,17 +4114,17 @@ function li(e, t) {
|
|
|
4112
4114
|
!n && (t.left >= p.right && t.top >= p.top || t.left >= p.left && t.top >= p.bottom) && (a = d + 1);
|
|
4113
4115
|
}
|
|
4114
4116
|
}
|
|
4115
|
-
return !n && c && (n = c, i = l, r = 0), n && n.nodeType == 3 ?
|
|
4117
|
+
return !n && c && (n = c, i = l, r = 0), n && n.nodeType == 3 ? li(n, i) : !n || r && n.nodeType == 1 ? {
|
|
4116
4118
|
node: e,
|
|
4117
4119
|
offset: a
|
|
4118
|
-
} :
|
|
4120
|
+
} : ci(n, i);
|
|
4119
4121
|
}
|
|
4120
|
-
function
|
|
4122
|
+
function li(e, t) {
|
|
4121
4123
|
let n = e.nodeValue.length, r = document.createRange(), i;
|
|
4122
4124
|
for (let a = 0; a < n; a++) {
|
|
4123
4125
|
r.setEnd(e, a + 1), r.setStart(e, a);
|
|
4124
|
-
let n =
|
|
4125
|
-
if (n.top != n.bottom &&
|
|
4126
|
+
let n = _i(r, 1);
|
|
4127
|
+
if (n.top != n.bottom && ui(t, n)) {
|
|
4126
4128
|
i = {
|
|
4127
4129
|
node: e,
|
|
4128
4130
|
offset: a + +(t.left >= (n.left + n.right) / 2)
|
|
@@ -4135,22 +4137,22 @@ function ui(e, t) {
|
|
|
4135
4137
|
offset: 0
|
|
4136
4138
|
};
|
|
4137
4139
|
}
|
|
4138
|
-
function
|
|
4140
|
+
function ui(e, t) {
|
|
4139
4141
|
return e.left >= t.left - 1 && e.left <= t.right + 1 && e.top >= t.top - 1 && e.top <= t.bottom + 1;
|
|
4140
4142
|
}
|
|
4141
|
-
function
|
|
4143
|
+
function di(e, t) {
|
|
4142
4144
|
let n = e.parentNode;
|
|
4143
4145
|
return n && /^li$/i.test(n.nodeName) && t.left < e.getBoundingClientRect().left ? n : e;
|
|
4144
4146
|
}
|
|
4145
|
-
function
|
|
4146
|
-
let { node: r, offset: i } =
|
|
4147
|
+
function fi(e, t, n) {
|
|
4148
|
+
let { node: r, offset: i } = ci(t, n), a = -1;
|
|
4147
4149
|
if (r.nodeType == 1 && !r.firstChild) {
|
|
4148
4150
|
let e = r.getBoundingClientRect();
|
|
4149
4151
|
a = e.left != e.right && n.left > (e.left + e.right) / 2 ? 1 : -1;
|
|
4150
4152
|
}
|
|
4151
4153
|
return e.docView.posFromDOM(r, i, a);
|
|
4152
4154
|
}
|
|
4153
|
-
function
|
|
4155
|
+
function pi(e, t, n, r) {
|
|
4154
4156
|
let i = -1;
|
|
4155
4157
|
for (let n = t, a = !1; n != e.dom;) {
|
|
4156
4158
|
let t = e.docView.nearestDesc(n, !0), o;
|
|
@@ -4160,7 +4162,7 @@ function mi(e, t, n, r) {
|
|
|
4160
4162
|
}
|
|
4161
4163
|
return i > -1 ? i : e.docView.posFromDOM(t, n, -1);
|
|
4162
4164
|
}
|
|
4163
|
-
function
|
|
4165
|
+
function mi(e, t, n) {
|
|
4164
4166
|
let r = e.childNodes.length;
|
|
4165
4167
|
if (r && n.top < n.bottom) for (let i = Math.max(0, Math.min(r - 1, Math.floor(r * (t.top - n.top) / (n.bottom - n.top)) - 2)), a = i;;) {
|
|
4166
4168
|
let n = e.childNodes[a];
|
|
@@ -4168,89 +4170,89 @@ function hi(e, t, n) {
|
|
|
4168
4170
|
let e = n.getClientRects();
|
|
4169
4171
|
for (let r = 0; r < e.length; r++) {
|
|
4170
4172
|
let i = e[r];
|
|
4171
|
-
if (
|
|
4173
|
+
if (ui(t, i)) return mi(n, t, i);
|
|
4172
4174
|
}
|
|
4173
4175
|
}
|
|
4174
4176
|
if ((a = (a + 1) % r) == i) break;
|
|
4175
4177
|
}
|
|
4176
4178
|
return e;
|
|
4177
4179
|
}
|
|
4178
|
-
function
|
|
4179
|
-
let n = e.dom.ownerDocument, r, i = 0, a =
|
|
4180
|
+
function hi(e, t) {
|
|
4181
|
+
let n = e.dom.ownerDocument, r, i = 0, a = Rr(n, t.left, t.top);
|
|
4180
4182
|
a && ({node: r, offset: i} = a);
|
|
4181
4183
|
let o = (e.root.elementFromPoint ? e.root : n).elementFromPoint(t.left, t.top), s;
|
|
4182
4184
|
if (!o || !e.dom.contains(o.nodeType == 1 ? o : o.parentNode)) {
|
|
4183
4185
|
let n = e.dom.getBoundingClientRect();
|
|
4184
|
-
if (!
|
|
4186
|
+
if (!ui(t, n) || (o = mi(e.dom, t, n), !o)) return null;
|
|
4185
4187
|
}
|
|
4186
|
-
if (
|
|
4187
|
-
if (o =
|
|
4188
|
-
if (
|
|
4188
|
+
if (z) for (let e = o; r && e; e = Tr(e)) e.draggable && (r = void 0);
|
|
4189
|
+
if (o = di(o, t), r) {
|
|
4190
|
+
if (L && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
|
|
4189
4191
|
let e = r.childNodes[i], n;
|
|
4190
4192
|
e.nodeName == "IMG" && (n = e.getBoundingClientRect()).right <= t.left && n.bottom > t.top && i++;
|
|
4191
4193
|
}
|
|
4192
4194
|
let n;
|
|
4193
|
-
|
|
4195
|
+
Xr && i && r.nodeType == 1 && (n = r.childNodes[i - 1]).nodeType == 1 && n.contentEditable == "false" && n.getBoundingClientRect().top >= t.top && i--, r == e.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && t.top > r.lastChild.getBoundingClientRect().bottom ? s = e.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (s = pi(e, r, i, t));
|
|
4194
4196
|
}
|
|
4195
|
-
s ??=
|
|
4197
|
+
s ??= fi(e, o, t);
|
|
4196
4198
|
let c = e.docView.nearestDesc(o, !0);
|
|
4197
4199
|
return {
|
|
4198
4200
|
pos: s,
|
|
4199
4201
|
inside: c ? c.posAtStart - c.border : -1
|
|
4200
4202
|
};
|
|
4201
4203
|
}
|
|
4202
|
-
function
|
|
4204
|
+
function gi(e) {
|
|
4203
4205
|
return e.top < e.bottom || e.left < e.right;
|
|
4204
4206
|
}
|
|
4205
|
-
function
|
|
4207
|
+
function _i(e, t) {
|
|
4206
4208
|
let n = e.getClientRects();
|
|
4207
4209
|
if (n.length) {
|
|
4208
4210
|
let e = n[t < 0 ? 0 : n.length - 1];
|
|
4209
|
-
if (
|
|
4211
|
+
if (gi(e)) return e;
|
|
4210
4212
|
}
|
|
4211
|
-
return Array.prototype.find.call(n,
|
|
4213
|
+
return Array.prototype.find.call(n, gi) || e.getBoundingClientRect();
|
|
4212
4214
|
}
|
|
4213
|
-
var
|
|
4214
|
-
function
|
|
4215
|
-
let { node: r, offset: i, atom: a } = e.docView.domFromPos(t, n < 0 ? -1 : 1), o =
|
|
4216
|
-
if (r.nodeType == 3) if (o && (
|
|
4217
|
-
let e =
|
|
4218
|
-
if (
|
|
4219
|
-
let t =
|
|
4215
|
+
var vi = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
4216
|
+
function yi(e, t, n) {
|
|
4217
|
+
let { node: r, offset: i, atom: a } = e.docView.domFromPos(t, n < 0 ? -1 : 1), o = Xr || L;
|
|
4218
|
+
if (r.nodeType == 3) if (o && (vi.test(r.nodeValue) || (n < 0 ? !i : i == r.nodeValue.length))) {
|
|
4219
|
+
let e = _i(N(r, i, i), n);
|
|
4220
|
+
if (L && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
|
|
4221
|
+
let t = _i(N(r, i - 1, i - 1), -1);
|
|
4220
4222
|
if (t.top == e.top) {
|
|
4221
|
-
let n =
|
|
4222
|
-
if (n.top != e.top) return
|
|
4223
|
+
let n = _i(N(r, i, i + 1), -1);
|
|
4224
|
+
if (n.top != e.top) return bi(n, n.left < t.left);
|
|
4223
4225
|
}
|
|
4224
4226
|
}
|
|
4225
4227
|
return e;
|
|
4226
4228
|
} else {
|
|
4227
4229
|
let e = i, t = i, a = n < 0 ? 1 : -1;
|
|
4228
|
-
return n < 0 && !i ? (t++, a = -1) : n >= 0 && i == r.nodeValue.length ? (e--, a = 1) : n < 0 ? e-- : t++,
|
|
4230
|
+
return n < 0 && !i ? (t++, a = -1) : n >= 0 && i == r.nodeValue.length ? (e--, a = 1) : n < 0 ? e-- : t++, bi(_i(N(r, e, t), a), a < 0);
|
|
4229
4231
|
}
|
|
4230
4232
|
if (!e.state.doc.resolve(t - (a || 0)).parent.inlineContent) {
|
|
4231
|
-
if (a == null && i && (n < 0 || i ==
|
|
4233
|
+
if (a == null && i && (n < 0 || i == P(r))) {
|
|
4232
4234
|
let e = r.childNodes[i - 1];
|
|
4233
|
-
if (e.nodeType == 1) return
|
|
4235
|
+
if (e.nodeType == 1) return xi(e.getBoundingClientRect(), !1);
|
|
4234
4236
|
}
|
|
4235
|
-
if (a == null && i <
|
|
4237
|
+
if (a == null && i < P(r)) {
|
|
4236
4238
|
let e = r.childNodes[i];
|
|
4237
|
-
if (e.nodeType == 1) return
|
|
4239
|
+
if (e.nodeType == 1) return xi(e.getBoundingClientRect(), !0);
|
|
4238
4240
|
}
|
|
4239
|
-
return
|
|
4241
|
+
return xi(r.getBoundingClientRect(), n >= 0);
|
|
4240
4242
|
}
|
|
4241
|
-
if (a == null && i && (n < 0 || i ==
|
|
4242
|
-
let e = r.childNodes[i - 1], t = e.nodeType == 3 ?
|
|
4243
|
-
if (t) return
|
|
4243
|
+
if (a == null && i && (n < 0 || i == P(r))) {
|
|
4244
|
+
let e = r.childNodes[i - 1], t = e.nodeType == 3 ? N(e, P(e) - +!o) : e.nodeType == 1 && (e.nodeName != "BR" || !e.nextSibling) ? e : null;
|
|
4245
|
+
if (t) return bi(_i(t, 1), !1);
|
|
4244
4246
|
}
|
|
4245
|
-
if (a == null && i <
|
|
4247
|
+
if (a == null && i < P(r)) {
|
|
4246
4248
|
let e = r.childNodes[i];
|
|
4247
4249
|
for (; e.pmViewDesc && e.pmViewDesc.ignoreForCoords;) e = e.nextSibling;
|
|
4248
|
-
let t = e ? e.nodeType == 3 ?
|
|
4249
|
-
if (t) return
|
|
4250
|
+
let t = e ? e.nodeType == 3 ? N(e, 0, +!o) : e.nodeType == 1 ? e : null : null;
|
|
4251
|
+
if (t) return bi(_i(t, -1), !0);
|
|
4250
4252
|
}
|
|
4251
|
-
return
|
|
4253
|
+
return bi(_i(r.nodeType == 3 ? N(r) : r, -n), n >= 0);
|
|
4252
4254
|
}
|
|
4253
|
-
function
|
|
4255
|
+
function bi(e, t) {
|
|
4254
4256
|
if (e.width == 0) return e;
|
|
4255
4257
|
let n = t ? e.left : e.right;
|
|
4256
4258
|
return {
|
|
@@ -4260,7 +4262,7 @@ function xi(e, t) {
|
|
|
4260
4262
|
right: n
|
|
4261
4263
|
};
|
|
4262
4264
|
}
|
|
4263
|
-
function
|
|
4265
|
+
function xi(e, t) {
|
|
4264
4266
|
if (e.height == 0) return e;
|
|
4265
4267
|
let n = t ? e.top : e.bottom;
|
|
4266
4268
|
return {
|
|
@@ -4270,7 +4272,7 @@ function Si(e, t) {
|
|
|
4270
4272
|
right: e.right
|
|
4271
4273
|
};
|
|
4272
4274
|
}
|
|
4273
|
-
function
|
|
4275
|
+
function Si(e, t, n) {
|
|
4274
4276
|
let r = e.state, i = e.root.activeElement;
|
|
4275
4277
|
r != t && e.updateState(t), i != e.dom && e.focus();
|
|
4276
4278
|
try {
|
|
@@ -4279,9 +4281,9 @@ function Ci(e, t, n) {
|
|
|
4279
4281
|
r != t && e.updateState(r), i != e.dom && i && i.focus();
|
|
4280
4282
|
}
|
|
4281
4283
|
}
|
|
4282
|
-
function
|
|
4284
|
+
function Ci(e, t, n) {
|
|
4283
4285
|
let r = t.selection, i = n == "up" ? r.$from : r.$to;
|
|
4284
|
-
return
|
|
4286
|
+
return Si(e, t, () => {
|
|
4285
4287
|
let { node: t } = e.docView.domFromPos(i.pos, n == "up" ? -1 : 1);
|
|
4286
4288
|
for (;;) {
|
|
4287
4289
|
let n = e.docView.nearestDesc(t, !0);
|
|
@@ -4292,11 +4294,11 @@ function wi(e, t, n) {
|
|
|
4292
4294
|
}
|
|
4293
4295
|
t = n.dom.parentNode;
|
|
4294
4296
|
}
|
|
4295
|
-
let r =
|
|
4297
|
+
let r = yi(e, i.pos, 1);
|
|
4296
4298
|
for (let e = t.firstChild; e; e = e.nextSibling) {
|
|
4297
4299
|
let t;
|
|
4298
4300
|
if (e.nodeType == 1) t = e.getClientRects();
|
|
4299
|
-
else if (e.nodeType == 3) t =
|
|
4301
|
+
else if (e.nodeType == 3) t = N(e, 0, e.nodeValue.length).getClientRects();
|
|
4300
4302
|
else continue;
|
|
4301
4303
|
for (let e = 0; e < t.length; e++) {
|
|
4302
4304
|
let i = t[e];
|
|
@@ -4306,12 +4308,12 @@ function wi(e, t, n) {
|
|
|
4306
4308
|
return !0;
|
|
4307
4309
|
});
|
|
4308
4310
|
}
|
|
4309
|
-
var
|
|
4310
|
-
function
|
|
4311
|
+
var wi = /[\u0590-\u08ac]/;
|
|
4312
|
+
function Ti(e, t, n) {
|
|
4311
4313
|
let { $head: r } = t.selection;
|
|
4312
4314
|
if (!r.parent.isTextblock) return !1;
|
|
4313
4315
|
let i = r.parentOffset, a = !i, o = i == r.parent.content.size, s = e.domSelection();
|
|
4314
|
-
return s ? !
|
|
4316
|
+
return s ? !wi.test(r.parent.textContent) || !s.modify ? n == "left" || n == "backward" ? a : o : Si(e, t, () => {
|
|
4315
4317
|
let { focusNode: t, focusOffset: i, anchorNode: a, anchorOffset: o } = e.domSelectionRange(), c = s.caretBidiLevel;
|
|
4316
4318
|
s.modify("move", n, "character");
|
|
4317
4319
|
let l = r.depth ? e.docView.domAfterPos(r.before()) : e.dom, { focusNode: u, focusOffset: d } = e.domSelectionRange(), f = u && !l.contains(u.nodeType == 1 ? u : u.parentNode) || t == u && i == d;
|
|
@@ -4321,13 +4323,13 @@ function Ei(e, t, n) {
|
|
|
4321
4323
|
return c != null && (s.caretBidiLevel = c), f;
|
|
4322
4324
|
}) : r.pos == r.start() || r.pos == r.end();
|
|
4323
4325
|
}
|
|
4324
|
-
var
|
|
4325
|
-
function
|
|
4326
|
-
return
|
|
4326
|
+
var Ei = null, Di = null, Oi = !1;
|
|
4327
|
+
function ki(e, t, n) {
|
|
4328
|
+
return Ei == t && Di == n ? Oi : (Ei = t, Di = n, Oi = n == "up" || n == "down" ? Ci(e, t, n) : Ti(e, t, n));
|
|
4327
4329
|
}
|
|
4328
|
-
var
|
|
4330
|
+
var V = 0, Ai = 1, ji = 2, H = 3, Mi = class {
|
|
4329
4331
|
constructor(e, t, n, r) {
|
|
4330
|
-
this.parent = e, this.children = t, this.dom = n, this.contentDOM = r, this.dirty =
|
|
4332
|
+
this.parent = e, this.children = t, this.dom = n, this.contentDOM = r, this.dirty = V, n.pmViewDesc = this;
|
|
4331
4333
|
}
|
|
4332
4334
|
matchesWidget(e) {
|
|
4333
4335
|
return !1;
|
|
@@ -4463,14 +4465,14 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4463
4465
|
let n = 0, r = 0;
|
|
4464
4466
|
for (let t = 0; n < this.children.length; n++) {
|
|
4465
4467
|
let i = this.children[n], a = t + i.size;
|
|
4466
|
-
if (a > e || i instanceof
|
|
4468
|
+
if (a > e || i instanceof zi) {
|
|
4467
4469
|
r = e - t;
|
|
4468
4470
|
break;
|
|
4469
4471
|
}
|
|
4470
4472
|
t = a;
|
|
4471
4473
|
}
|
|
4472
4474
|
if (r) return this.children[n].domFromPos(r - this.children[n].border, t);
|
|
4473
|
-
for (let e; n && !(e = this.children[n - 1]).size && e instanceof
|
|
4475
|
+
for (let e; n && !(e = this.children[n - 1]).size && e instanceof Ni && e.side >= 0; n--);
|
|
4474
4476
|
if (t <= 0) {
|
|
4475
4477
|
let e, r = !0;
|
|
4476
4478
|
for (; e = n ? this.children[n - 1] : null, !(!e || e.dom.parentNode == this.contentDOM); n--, r = !1);
|
|
@@ -4553,7 +4555,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4553
4555
|
s = l;
|
|
4554
4556
|
}
|
|
4555
4557
|
let o = this.domFromPos(e, e ? -1 : 1), s = t == e ? o : this.domFromPos(t, t ? -1 : 1), c = n.root.getSelection(), l = n.domSelectionRange(), u = !1;
|
|
4556
|
-
if ((
|
|
4558
|
+
if ((L || z) && e == t) {
|
|
4557
4559
|
let { node: e, offset: t } = o;
|
|
4558
4560
|
if (e.nodeType == 3) {
|
|
4559
4561
|
if (u = !!(t && e.nodeValue[t - 1] == "\n"), u && t == e.nodeValue.length) for (let t = e, n; t; t = t.parentNode) {
|
|
@@ -4572,13 +4574,13 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4572
4574
|
u = n && (n.nodeName == "BR" || n.contentEditable == "false");
|
|
4573
4575
|
}
|
|
4574
4576
|
}
|
|
4575
|
-
if (
|
|
4577
|
+
if (L && l.focusNode && l.focusNode != s.node && l.focusNode.nodeType == 1) {
|
|
4576
4578
|
let e = l.focusNode.childNodes[l.focusOffset];
|
|
4577
4579
|
e && e.contentEditable == "false" && (r = !0);
|
|
4578
4580
|
}
|
|
4579
|
-
if (!(r || u &&
|
|
4581
|
+
if (!(r || u && z) && Or(o.node, o.offset, l.anchorNode, l.anchorOffset) && Or(s.node, s.offset, l.focusNode, l.focusOffset)) return;
|
|
4580
4582
|
let d = !1;
|
|
4581
|
-
if ((c.extend || e == t) && !(u &&
|
|
4583
|
+
if ((c.extend || e == t) && !(u && L)) {
|
|
4582
4584
|
c.collapse(o.node, o.offset);
|
|
4583
4585
|
try {
|
|
4584
4586
|
e != t && c.extend(s.node, s.offset), d = !0;
|
|
@@ -4605,18 +4607,18 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4605
4607
|
if (n == a ? e <= a && t >= n : e < a && t > n) {
|
|
4606
4608
|
let r = n + i.border, o = a - i.border;
|
|
4607
4609
|
if (e >= r && t <= o) {
|
|
4608
|
-
this.dirty = e == n || t == a ?
|
|
4610
|
+
this.dirty = e == n || t == a ? ji : Ai, e == r && t == o && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = H : i.markDirty(e - r, t - r);
|
|
4609
4611
|
return;
|
|
4610
|
-
} else i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ?
|
|
4612
|
+
} else i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? ji : H;
|
|
4611
4613
|
}
|
|
4612
4614
|
n = a;
|
|
4613
4615
|
}
|
|
4614
|
-
this.dirty =
|
|
4616
|
+
this.dirty = ji;
|
|
4615
4617
|
}
|
|
4616
4618
|
markParentsDirty() {
|
|
4617
4619
|
let e = 1;
|
|
4618
4620
|
for (let t = this.parent; t; t = t.parent, e++) {
|
|
4619
|
-
let n = e == 1 ?
|
|
4621
|
+
let n = e == 1 ? ji : Ai;
|
|
4620
4622
|
t.dirty < n && (t.dirty = n);
|
|
4621
4623
|
}
|
|
4622
4624
|
}
|
|
@@ -4632,7 +4634,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4632
4634
|
isText(e) {
|
|
4633
4635
|
return !1;
|
|
4634
4636
|
}
|
|
4635
|
-
},
|
|
4637
|
+
}, Ni = class extends Mi {
|
|
4636
4638
|
constructor(e, t, n, r) {
|
|
4637
4639
|
let i, a = t.type.toDOM;
|
|
4638
4640
|
if (typeof a == "function" && (a = a(n, () => {
|
|
@@ -4648,7 +4650,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4648
4650
|
super(e, [], a, null), this.widget = t, this.widget = t, i = this;
|
|
4649
4651
|
}
|
|
4650
4652
|
matchesWidget(e) {
|
|
4651
|
-
return this.dirty ==
|
|
4653
|
+
return this.dirty == V && e.type.eq(this.widget.type);
|
|
4652
4654
|
}
|
|
4653
4655
|
parseRule() {
|
|
4654
4656
|
return { ignore: !0 };
|
|
@@ -4672,7 +4674,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4672
4674
|
get side() {
|
|
4673
4675
|
return this.widget.type.side;
|
|
4674
4676
|
}
|
|
4675
|
-
},
|
|
4677
|
+
}, Pi = class extends Mi {
|
|
4676
4678
|
constructor(e, t, n, r) {
|
|
4677
4679
|
super(e, [], t, null), this.textDOM = n, this.text = r;
|
|
4678
4680
|
}
|
|
@@ -4691,7 +4693,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4691
4693
|
ignoreMutation(e) {
|
|
4692
4694
|
return e.type === "characterData" && e.target.nodeValue == e.oldValue;
|
|
4693
4695
|
}
|
|
4694
|
-
},
|
|
4696
|
+
}, Fi = class e extends Mi {
|
|
4695
4697
|
constructor(e, t, n, r, i) {
|
|
4696
4698
|
super(e, [], n, r), this.mark = t, this.spec = i;
|
|
4697
4699
|
}
|
|
@@ -4700,25 +4702,25 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4700
4702
|
return (!o || !o.dom) && (o = Xe.renderSpec(document, n.type.spec.toDOM(n, r), null, n.attrs)), new e(t, n, o.dom, o.contentDOM || o.dom, o);
|
|
4701
4703
|
}
|
|
4702
4704
|
parseRule() {
|
|
4703
|
-
return this.dirty &
|
|
4705
|
+
return this.dirty & H || this.mark.type.spec.reparseInView ? null : {
|
|
4704
4706
|
mark: this.mark.type.name,
|
|
4705
4707
|
attrs: this.mark.attrs,
|
|
4706
4708
|
contentElement: this.contentDOM
|
|
4707
4709
|
};
|
|
4708
4710
|
}
|
|
4709
4711
|
matchesMark(e) {
|
|
4710
|
-
return this.dirty !=
|
|
4712
|
+
return this.dirty != H && this.mark.eq(e);
|
|
4711
4713
|
}
|
|
4712
4714
|
markDirty(e, t) {
|
|
4713
|
-
if (super.markDirty(e, t), this.dirty !=
|
|
4715
|
+
if (super.markDirty(e, t), this.dirty != V) {
|
|
4714
4716
|
let e = this.parent;
|
|
4715
4717
|
for (; !e.node;) e = e.parent;
|
|
4716
|
-
e.dirty < this.dirty && (e.dirty = this.dirty), this.dirty =
|
|
4718
|
+
e.dirty < this.dirty && (e.dirty = this.dirty), this.dirty = V;
|
|
4717
4719
|
}
|
|
4718
4720
|
}
|
|
4719
4721
|
slice(t, n, r) {
|
|
4720
4722
|
let i = e.create(this.parent, this.mark, !0, r), a = this.children, o = this.size;
|
|
4721
|
-
n < o && (a =
|
|
4723
|
+
n < o && (a = na(a, n, o, r)), t > 0 && (a = na(a, 0, t, r));
|
|
4722
4724
|
for (let e = 0; e < a.length; e++) a[e].parent = i;
|
|
4723
4725
|
return i.children = a, i;
|
|
4724
4726
|
}
|
|
@@ -4728,7 +4730,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4728
4730
|
destroy() {
|
|
4729
4731
|
this.spec.destroy && this.spec.destroy(), super.destroy();
|
|
4730
4732
|
}
|
|
4731
|
-
},
|
|
4733
|
+
}, Ii = class e extends Mi {
|
|
4732
4734
|
constructor(e, t, n, r, i, a, o) {
|
|
4733
4735
|
super(e, [], i, a), this.node = t, this.outerDeco = n, this.innerDeco = r, this.nodeDOM = o;
|
|
4734
4736
|
}
|
|
@@ -4746,7 +4748,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4746
4748
|
}
|
|
4747
4749
|
!d && !n.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), n.type.spec.draggable && (u.draggable = !0));
|
|
4748
4750
|
let f = u;
|
|
4749
|
-
return u =
|
|
4751
|
+
return u = qi(u, r, n), l ? c = new Bi(t, n, r, i, u, d || null, f, l) : n.isText ? new Ri(t, n, r, i, u, f) : new e(t, n, r, i, u, d || null, f);
|
|
4750
4752
|
}
|
|
4751
4753
|
parseRule() {
|
|
4752
4754
|
if (this.node.type.spec.reparseInView) return null;
|
|
@@ -4769,7 +4771,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4769
4771
|
return e;
|
|
4770
4772
|
}
|
|
4771
4773
|
matchesNode(e, t, n) {
|
|
4772
|
-
return this.dirty ==
|
|
4774
|
+
return this.dirty == V && e.eq(this.node) && Ji(t, this.outerDeco) && n.eq(this.innerDeco);
|
|
4773
4775
|
}
|
|
4774
4776
|
get size() {
|
|
4775
4777
|
return this.node.nodeSize;
|
|
@@ -4778,14 +4780,14 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4778
4780
|
return +!this.node.isLeaf;
|
|
4779
4781
|
}
|
|
4780
4782
|
updateChildren(e, t) {
|
|
4781
|
-
let n = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, a = i && i.pos > -1 ? i : null, o = i && i.pos < 0, s = new
|
|
4782
|
-
|
|
4783
|
+
let n = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, a = i && i.pos > -1 ? i : null, o = i && i.pos < 0, s = new Xi(this, a && a.node, e);
|
|
4784
|
+
$i(this.node, this.innerDeco, (t, i, a) => {
|
|
4783
4785
|
t.spec.marks ? s.syncToMarks(t.spec.marks, n, e, i) : t.type.side >= 0 && !a && s.syncToMarks(i == this.node.childCount ? l.none : this.node.child(i).marks, n, e, i), s.placeWidget(t, e, r);
|
|
4784
4786
|
}, (t, a, c, l) => {
|
|
4785
4787
|
s.syncToMarks(t.marks, n, e, l);
|
|
4786
4788
|
let u;
|
|
4787
4789
|
s.findNodeMatch(t, a, c, l) || o && e.state.selection.from > r && e.state.selection.to < r + t.nodeSize && (u = s.findIndexWithChild(i.node)) > -1 && s.updateNodeAt(t, a, c, u, e) || s.updateNextNode(t, a, c, e, l, r) || s.addNode(t, a, c, e, r), r += t.nodeSize;
|
|
4788
|
-
}), s.syncToMarks([], n, e, 0), this.node.isTextblock && s.addTextblockHacks(), s.destroyRest(), (s.changed || this.dirty ==
|
|
4790
|
+
}), s.syncToMarks([], n, e, 0), this.node.isTextblock && s.addTextblockHacks(), s.destroyRest(), (s.changed || this.dirty == ji) && (a && this.protectLocalComposition(e, a), Vi(this.contentDOM, this.children, e), qr && ea(this.dom));
|
|
4789
4791
|
}
|
|
4790
4792
|
localCompositionInfo(e, t) {
|
|
4791
4793
|
let { from: n, to: r } = e.state.selection;
|
|
@@ -4793,7 +4795,7 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4793
4795
|
let i = e.input.compositionNode;
|
|
4794
4796
|
if (!i || !this.dom.contains(i.parentNode)) return null;
|
|
4795
4797
|
if (this.node.inlineContent) {
|
|
4796
|
-
let e = i.nodeValue, a =
|
|
4798
|
+
let e = i.nodeValue, a = ta(this.node.content, e, n - t, r - t);
|
|
4797
4799
|
return a < 0 ? null : {
|
|
4798
4800
|
node: i,
|
|
4799
4801
|
pos: a,
|
|
@@ -4813,19 +4815,19 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4813
4815
|
for (; i.nextSibling;) i.parentNode.removeChild(i.nextSibling);
|
|
4814
4816
|
i.pmViewDesc &&= void 0;
|
|
4815
4817
|
}
|
|
4816
|
-
let a = new
|
|
4817
|
-
e.input.compositionNodes.push(a), this.children =
|
|
4818
|
+
let a = new Pi(this, i, t, r);
|
|
4819
|
+
e.input.compositionNodes.push(a), this.children = na(this.children, n, n + r.length, e, a);
|
|
4818
4820
|
}
|
|
4819
4821
|
update(e, t, n, r) {
|
|
4820
|
-
return this.dirty ==
|
|
4822
|
+
return this.dirty == H || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, n, r), !0);
|
|
4821
4823
|
}
|
|
4822
4824
|
updateInner(e, t, n, r) {
|
|
4823
|
-
this.updateOuterDeco(t), this.node = e, this.innerDeco = n, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty =
|
|
4825
|
+
this.updateOuterDeco(t), this.node = e, this.innerDeco = n, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = V;
|
|
4824
4826
|
}
|
|
4825
4827
|
updateOuterDeco(e) {
|
|
4826
|
-
if (
|
|
4828
|
+
if (Ji(e, this.outerDeco)) return;
|
|
4827
4829
|
let t = this.nodeDOM.nodeType != 1, n = this.dom;
|
|
4828
|
-
this.dom =
|
|
4830
|
+
this.dom = Gi(this.dom, this.nodeDOM, Wi(this.outerDeco, this.node, t), Wi(e, this.node, t)), this.dom != n && (n.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
4829
4831
|
}
|
|
4830
4832
|
selectNode() {
|
|
4831
4833
|
this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.add("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && (this.nodeDOM.draggable = !0));
|
|
@@ -4837,12 +4839,12 @@ var B = 0, ji = 1, Mi = 2, V = 3, Ni = class {
|
|
|
4837
4839
|
return this.node.isAtom;
|
|
4838
4840
|
}
|
|
4839
4841
|
};
|
|
4840
|
-
function
|
|
4841
|
-
|
|
4842
|
-
let a = new
|
|
4842
|
+
function Li(e, t, n, r, i) {
|
|
4843
|
+
qi(r, t, e);
|
|
4844
|
+
let a = new Ii(void 0, e, t, n, r, r, r);
|
|
4843
4845
|
return a.contentDOM && a.updateChildren(i, 0), a;
|
|
4844
4846
|
}
|
|
4845
|
-
var
|
|
4847
|
+
var Ri = class e extends Ii {
|
|
4846
4848
|
constructor(e, t, n, r, i, a) {
|
|
4847
4849
|
super(e, t, n, r, i, null, a);
|
|
4848
4850
|
}
|
|
@@ -4852,7 +4854,7 @@ var zi = class e extends Li {
|
|
|
4852
4854
|
return { skip: e || !0 };
|
|
4853
4855
|
}
|
|
4854
4856
|
update(e, t, n, r) {
|
|
4855
|
-
return this.dirty ==
|
|
4857
|
+
return this.dirty == H || this.dirty != V && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != V || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = V, !0);
|
|
4856
4858
|
}
|
|
4857
4859
|
inParent() {
|
|
4858
4860
|
let e = this.parent.contentDOM;
|
|
@@ -4876,7 +4878,7 @@ var zi = class e extends Li {
|
|
|
4876
4878
|
return new e(this.parent, i, this.outerDeco, this.innerDeco, a, a);
|
|
4877
4879
|
}
|
|
4878
4880
|
markDirty(e, t) {
|
|
4879
|
-
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty =
|
|
4881
|
+
super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = H);
|
|
4880
4882
|
}
|
|
4881
4883
|
get domAtom() {
|
|
4882
4884
|
return !1;
|
|
@@ -4884,12 +4886,12 @@ var zi = class e extends Li {
|
|
|
4884
4886
|
isText(e) {
|
|
4885
4887
|
return this.node.text == e;
|
|
4886
4888
|
}
|
|
4887
|
-
},
|
|
4889
|
+
}, zi = class extends Mi {
|
|
4888
4890
|
parseRule() {
|
|
4889
4891
|
return { ignore: !0 };
|
|
4890
4892
|
}
|
|
4891
4893
|
matchesHack(e) {
|
|
4892
|
-
return this.dirty ==
|
|
4894
|
+
return this.dirty == V && this.dom.nodeName == e;
|
|
4893
4895
|
}
|
|
4894
4896
|
get domAtom() {
|
|
4895
4897
|
return !0;
|
|
@@ -4897,12 +4899,12 @@ var zi = class e extends Li {
|
|
|
4897
4899
|
get ignoreForCoords() {
|
|
4898
4900
|
return this.dom.nodeName == "IMG";
|
|
4899
4901
|
}
|
|
4900
|
-
},
|
|
4902
|
+
}, Bi = class extends Ii {
|
|
4901
4903
|
constructor(e, t, n, r, i, a, o, s) {
|
|
4902
4904
|
super(e, t, n, r, i, a, o), this.spec = s;
|
|
4903
4905
|
}
|
|
4904
4906
|
update(e, t, n, r) {
|
|
4905
|
-
if (this.dirty ==
|
|
4907
|
+
if (this.dirty == H) return !1;
|
|
4906
4908
|
if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
|
|
4907
4909
|
let i = this.spec.update(e, t, n);
|
|
4908
4910
|
return i && this.updateInner(e, t, n, r), i;
|
|
@@ -4928,56 +4930,56 @@ var zi = class e extends Li {
|
|
|
4928
4930
|
return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
|
|
4929
4931
|
}
|
|
4930
4932
|
};
|
|
4931
|
-
function
|
|
4933
|
+
function Vi(e, t, n) {
|
|
4932
4934
|
let r = e.firstChild, i = !1;
|
|
4933
4935
|
for (let a = 0; a < t.length; a++) {
|
|
4934
4936
|
let o = t[a], s = o.dom;
|
|
4935
4937
|
if (s.parentNode == e) {
|
|
4936
|
-
for (; s != r;) r =
|
|
4938
|
+
for (; s != r;) r = Yi(r), i = !0;
|
|
4937
4939
|
r = r.nextSibling;
|
|
4938
4940
|
} else i = !0, e.insertBefore(s, r);
|
|
4939
|
-
if (o instanceof
|
|
4941
|
+
if (o instanceof Fi) {
|
|
4940
4942
|
let t = r ? r.previousSibling : e.lastChild;
|
|
4941
|
-
|
|
4943
|
+
Vi(o.contentDOM, o.children, n), r = t ? t.nextSibling : e.firstChild;
|
|
4942
4944
|
}
|
|
4943
4945
|
}
|
|
4944
|
-
for (; r;) r =
|
|
4946
|
+
for (; r;) r = Yi(r), i = !0;
|
|
4945
4947
|
i && n.trackWrites == e && (n.trackWrites = null);
|
|
4946
4948
|
}
|
|
4947
|
-
var
|
|
4949
|
+
var Hi = function(e) {
|
|
4948
4950
|
e && (this.nodeName = e);
|
|
4949
4951
|
};
|
|
4950
|
-
|
|
4951
|
-
var
|
|
4952
|
-
function
|
|
4953
|
-
if (e.length == 0) return
|
|
4954
|
-
let r = n ?
|
|
4952
|
+
Hi.prototype = Object.create(null);
|
|
4953
|
+
var Ui = [new Hi()];
|
|
4954
|
+
function Wi(e, t, n) {
|
|
4955
|
+
if (e.length == 0) return Ui;
|
|
4956
|
+
let r = n ? Ui[0] : new Hi(), i = [r];
|
|
4955
4957
|
for (let a = 0; a < e.length; a++) {
|
|
4956
4958
|
let o = e[a].type.attrs;
|
|
4957
4959
|
if (o) {
|
|
4958
|
-
o.nodeName && i.push(r = new
|
|
4960
|
+
o.nodeName && i.push(r = new Hi(o.nodeName));
|
|
4959
4961
|
for (let e in o) {
|
|
4960
4962
|
let a = o[e];
|
|
4961
|
-
a != null && (n && i.length == 1 && i.push(r = new
|
|
4963
|
+
a != null && (n && i.length == 1 && i.push(r = new Hi(t.isInline ? "span" : "div")), e == "class" ? r.class = (r.class ? r.class + " " : "") + a : e == "style" ? r.style = (r.style ? r.style + ";" : "") + a : e != "nodeName" && (r[e] = a));
|
|
4962
4964
|
}
|
|
4963
4965
|
}
|
|
4964
4966
|
}
|
|
4965
4967
|
return i;
|
|
4966
4968
|
}
|
|
4967
|
-
function
|
|
4968
|
-
if (n ==
|
|
4969
|
+
function Gi(e, t, n, r) {
|
|
4970
|
+
if (n == Ui && r == Ui) return t;
|
|
4969
4971
|
let i = t;
|
|
4970
4972
|
for (let t = 0; t < r.length; t++) {
|
|
4971
4973
|
let a = r[t], o = n[t];
|
|
4972
4974
|
if (t) {
|
|
4973
4975
|
let t;
|
|
4974
|
-
o && o.nodeName == a.nodeName && i != e && (t = i.parentNode) && t.nodeName.toLowerCase() == a.nodeName ? i = t : (t = document.createElement(a.nodeName), t.pmIsDeco = !0, t.appendChild(i), o =
|
|
4976
|
+
o && o.nodeName == a.nodeName && i != e && (t = i.parentNode) && t.nodeName.toLowerCase() == a.nodeName ? i = t : (t = document.createElement(a.nodeName), t.pmIsDeco = !0, t.appendChild(i), o = Ui[0], i = t);
|
|
4975
4977
|
}
|
|
4976
|
-
|
|
4978
|
+
Ki(i, o || Ui[0], a);
|
|
4977
4979
|
}
|
|
4978
4980
|
return i;
|
|
4979
4981
|
}
|
|
4980
|
-
function
|
|
4982
|
+
function Ki(e, t, n) {
|
|
4981
4983
|
for (let r in t) r != "class" && r != "style" && r != "nodeName" && !(r in n) && e.removeAttribute(r);
|
|
4982
4984
|
for (let r in n) r != "class" && r != "style" && r != "nodeName" && n[r] != t[r] && e.setAttribute(r, n[r]);
|
|
4983
4985
|
if (t.class != n.class) {
|
|
@@ -4994,21 +4996,21 @@ function qi(e, t, n) {
|
|
|
4994
4996
|
n.style && (e.style.cssText += n.style);
|
|
4995
4997
|
}
|
|
4996
4998
|
}
|
|
4997
|
-
function
|
|
4998
|
-
return
|
|
4999
|
+
function qi(e, t, n) {
|
|
5000
|
+
return Gi(e, e, Ui, Wi(t, n, e.nodeType != 1));
|
|
4999
5001
|
}
|
|
5000
|
-
function
|
|
5002
|
+
function Ji(e, t) {
|
|
5001
5003
|
if (e.length != t.length) return !1;
|
|
5002
5004
|
for (let n = 0; n < e.length; n++) if (!e[n].type.eq(t[n].type)) return !1;
|
|
5003
5005
|
return !0;
|
|
5004
5006
|
}
|
|
5005
|
-
function
|
|
5007
|
+
function Yi(e) {
|
|
5006
5008
|
let t = e.nextSibling;
|
|
5007
5009
|
return e.parentNode.removeChild(e), t;
|
|
5008
5010
|
}
|
|
5009
|
-
var
|
|
5011
|
+
var Xi = class {
|
|
5010
5012
|
constructor(e, t, n) {
|
|
5011
|
-
this.lock = t, this.view = n, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
5013
|
+
this.lock = t, this.view = n, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Zi(e.node.content, e);
|
|
5012
5014
|
}
|
|
5013
5015
|
destroyBetween(e, t) {
|
|
5014
5016
|
if (e != t) {
|
|
@@ -5022,7 +5024,7 @@ var Zi = class {
|
|
|
5022
5024
|
syncToMarks(e, t, n, r) {
|
|
5023
5025
|
let i = 0, a = this.stack.length >> 1, o = Math.min(a, e.length);
|
|
5024
5026
|
for (; i < o && (i == a - 1 ? this.top : this.stack[i + 1 << 1]).matchesMark(e[i]) && e[i].type.spec.spanning !== !1;) i++;
|
|
5025
|
-
for (; i < a;) this.destroyRest(), this.top.dirty =
|
|
5027
|
+
for (; i < a;) this.destroyRest(), this.top.dirty = V, this.index = this.stack.pop(), this.top = this.stack.pop(), a--;
|
|
5026
5028
|
for (; a < e.length;) {
|
|
5027
5029
|
this.stack.push(this.top, this.index + 1);
|
|
5028
5030
|
let i = -1, o = this.top.children.length;
|
|
@@ -5036,11 +5038,11 @@ var Zi = class {
|
|
|
5036
5038
|
}
|
|
5037
5039
|
if (i < 0 && this.index < this.top.children.length) {
|
|
5038
5040
|
let t = this.top.children[this.index];
|
|
5039
|
-
t instanceof
|
|
5041
|
+
t instanceof Fi && t.dirty != H && t.mark.type == e[a].type && t.spec.update && !this.isLocked(t.dom) && t.spec.update(e[a]) && (t.mark = e[a], i = this.index, this.changed = !0);
|
|
5040
5042
|
}
|
|
5041
5043
|
if (i > -1) i > this.index && (this.changed = !0, this.destroyBetween(this.index, i)), this.top = this.top.children[this.index];
|
|
5042
5044
|
else {
|
|
5043
|
-
let r =
|
|
5045
|
+
let r = Fi.create(this.top, e[a], t, n);
|
|
5044
5046
|
this.top.children.splice(this.index, 0, r), this.top = r, this.changed = !0;
|
|
5045
5047
|
}
|
|
5046
5048
|
this.index = 0, a++;
|
|
@@ -5060,7 +5062,7 @@ var Zi = class {
|
|
|
5060
5062
|
}
|
|
5061
5063
|
updateNodeAt(e, t, n, r, i) {
|
|
5062
5064
|
let a = this.top.children[r];
|
|
5063
|
-
return a.dirty ==
|
|
5065
|
+
return a.dirty == H && a.dom == a.contentDOM && (a.dirty = ji), a.update(e, t, n, i) ? (this.destroyBetween(this.index, r), this.index++, !0) : !1;
|
|
5064
5066
|
}
|
|
5065
5067
|
findIndexWithChild(e) {
|
|
5066
5068
|
for (;;) {
|
|
@@ -5079,20 +5081,20 @@ var Zi = class {
|
|
|
5079
5081
|
updateNextNode(e, t, n, r, i, a) {
|
|
5080
5082
|
for (let o = this.index; o < this.top.children.length; o++) {
|
|
5081
5083
|
let s = this.top.children[o];
|
|
5082
|
-
if (s instanceof
|
|
5084
|
+
if (s instanceof Ii) {
|
|
5083
5085
|
let c = this.preMatch.matched.get(s);
|
|
5084
5086
|
if (c != null && c != i) return !1;
|
|
5085
|
-
let l = s.dom, u, d = this.isLocked(l) && !(e.isText && s.node && s.node.isText && s.nodeDOM.nodeValue == e.text && s.dirty !=
|
|
5087
|
+
let l = s.dom, u, d = this.isLocked(l) && !(e.isText && s.node && s.node.isText && s.nodeDOM.nodeValue == e.text && s.dirty != H && Ji(t, s.outerDeco));
|
|
5086
5088
|
if (!d && s.update(e, t, n, r)) return this.destroyBetween(this.index, o), s.dom != l && (this.changed = !0), this.index++, !0;
|
|
5087
|
-
if (!d && (u = this.recreateWrapper(s, e, t, n, r, a))) return this.destroyBetween(this.index, o), this.top.children[this.index] = u, u.contentDOM && (u.dirty =
|
|
5089
|
+
if (!d && (u = this.recreateWrapper(s, e, t, n, r, a))) return this.destroyBetween(this.index, o), this.top.children[this.index] = u, u.contentDOM && (u.dirty = ji, u.updateChildren(r, a + 1), u.dirty = V), this.changed = !0, this.index++, !0;
|
|
5088
5090
|
break;
|
|
5089
5091
|
}
|
|
5090
5092
|
}
|
|
5091
5093
|
return !1;
|
|
5092
5094
|
}
|
|
5093
5095
|
recreateWrapper(e, t, n, r, i, a) {
|
|
5094
|
-
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !
|
|
5095
|
-
let o =
|
|
5096
|
+
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !Ji(n, e.outerDeco) || !r.eq(e.innerDeco)) return null;
|
|
5097
|
+
let o = Ii.create(this.top, t, n, r, i, a);
|
|
5096
5098
|
if (o.contentDOM) {
|
|
5097
5099
|
o.children = e.children, e.children = [];
|
|
5098
5100
|
for (let e of o.children) e.parent = o;
|
|
@@ -5100,28 +5102,28 @@ var Zi = class {
|
|
|
5100
5102
|
return e.destroy(), o;
|
|
5101
5103
|
}
|
|
5102
5104
|
addNode(e, t, n, r, i) {
|
|
5103
|
-
let a =
|
|
5105
|
+
let a = Ii.create(this.top, e, t, n, r, i);
|
|
5104
5106
|
a.contentDOM && a.updateChildren(r, i + 1), this.top.children.splice(this.index++, 0, a), this.changed = !0;
|
|
5105
5107
|
}
|
|
5106
5108
|
placeWidget(e, t, n) {
|
|
5107
5109
|
let r = this.index < this.top.children.length ? this.top.children[this.index] : null;
|
|
5108
5110
|
if (r && r.matchesWidget(e) && (e == r.widget || !r.widget.type.toDOM.parentNode)) this.index++;
|
|
5109
5111
|
else {
|
|
5110
|
-
let r = new
|
|
5112
|
+
let r = new Ni(this.top, e, t, n);
|
|
5111
5113
|
this.top.children.splice(this.index++, 0, r), this.changed = !0;
|
|
5112
5114
|
}
|
|
5113
5115
|
}
|
|
5114
5116
|
addTextblockHacks() {
|
|
5115
5117
|
let e = this.top.children[this.index - 1], t = this.top;
|
|
5116
|
-
for (; e instanceof
|
|
5117
|
-
(!e || !(e instanceof
|
|
5118
|
+
for (; e instanceof Fi;) t = e, e = t.children[t.children.length - 1];
|
|
5119
|
+
(!e || !(e instanceof Ri) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((z || R) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
5118
5120
|
}
|
|
5119
5121
|
addHackNode(e, t) {
|
|
5120
5122
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e)) this.index++;
|
|
5121
5123
|
else {
|
|
5122
5124
|
let n = document.createElement(e);
|
|
5123
5125
|
e == "IMG" && (n.className = "ProseMirror-separator", n.alt = ""), e == "BR" && (n.className = "ProseMirror-trailingBreak");
|
|
5124
|
-
let r = new
|
|
5126
|
+
let r = new zi(this.top, [], n, null);
|
|
5125
5127
|
t == this.top ? t.children.splice(this.index++, 0, r) : t.children.push(r), this.changed = !0;
|
|
5126
5128
|
}
|
|
5127
5129
|
}
|
|
@@ -5129,13 +5131,13 @@ var Zi = class {
|
|
|
5129
5131
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
5130
5132
|
}
|
|
5131
5133
|
};
|
|
5132
|
-
function
|
|
5134
|
+
function Zi(e, t) {
|
|
5133
5135
|
let n = t, r = n.children.length, i = e.childCount, a = /* @__PURE__ */ new Map(), o = [];
|
|
5134
5136
|
outer: for (; i > 0;) {
|
|
5135
5137
|
let s;
|
|
5136
5138
|
for (;;) if (r) {
|
|
5137
5139
|
let e = n.children[r - 1];
|
|
5138
|
-
if (e instanceof
|
|
5140
|
+
if (e instanceof Fi) n = e, r = e.children.length;
|
|
5139
5141
|
else {
|
|
5140
5142
|
s = e, r--;
|
|
5141
5143
|
break;
|
|
@@ -5154,10 +5156,10 @@ function Qi(e, t) {
|
|
|
5154
5156
|
matches: o.reverse()
|
|
5155
5157
|
};
|
|
5156
5158
|
}
|
|
5157
|
-
function
|
|
5159
|
+
function Qi(e, t) {
|
|
5158
5160
|
return e.type.side - t.type.side;
|
|
5159
5161
|
}
|
|
5160
|
-
function
|
|
5162
|
+
function $i(e, t, n, r) {
|
|
5161
5163
|
let i = t.locals(e), a = 0;
|
|
5162
5164
|
if (i.length == 0) {
|
|
5163
5165
|
for (let n = 0; n < e.childCount; n++) {
|
|
@@ -5174,7 +5176,7 @@ function ea(e, t, n, r) {
|
|
|
5174
5176
|
e.widget && (u ? (d ||= [u]).push(e) : u = e);
|
|
5175
5177
|
}
|
|
5176
5178
|
if (u) if (d) {
|
|
5177
|
-
d.sort(
|
|
5179
|
+
d.sort(Qi);
|
|
5178
5180
|
for (let e = 0; e < d.length; e++) n(d[e], l, !!c);
|
|
5179
5181
|
} else n(u, l, !!c);
|
|
5180
5182
|
let f, p;
|
|
@@ -5194,13 +5196,13 @@ function ea(e, t, n, r) {
|
|
|
5194
5196
|
r(f, h, t.forChild(a, f), p), a = m;
|
|
5195
5197
|
}
|
|
5196
5198
|
}
|
|
5197
|
-
function
|
|
5199
|
+
function ea(e) {
|
|
5198
5200
|
if (e.nodeName == "UL" || e.nodeName == "OL") {
|
|
5199
5201
|
let t = e.style.cssText;
|
|
5200
5202
|
e.style.cssText = t + "; list-style: square !important", window.getComputedStyle(e).listStyle, e.style.cssText = t;
|
|
5201
5203
|
}
|
|
5202
5204
|
}
|
|
5203
|
-
function
|
|
5205
|
+
function ta(e, t, n, r) {
|
|
5204
5206
|
for (let i = 0, a = 0; i < e.childCount && a <= r;) {
|
|
5205
5207
|
let o = e.child(i++), s = a;
|
|
5206
5208
|
if (a += o.nodeSize, !o.isText) continue;
|
|
@@ -5219,7 +5221,7 @@ function na(e, t, n, r) {
|
|
|
5219
5221
|
}
|
|
5220
5222
|
return -1;
|
|
5221
5223
|
}
|
|
5222
|
-
function
|
|
5224
|
+
function na(e, t, n, r, i) {
|
|
5223
5225
|
let a = [];
|
|
5224
5226
|
for (let o = 0, s = 0; o < e.length; o++) {
|
|
5225
5227
|
let c = e[o], l = s, u = s += c.size;
|
|
@@ -5227,16 +5229,16 @@ function ra(e, t, n, r, i) {
|
|
|
5227
5229
|
}
|
|
5228
5230
|
return a;
|
|
5229
5231
|
}
|
|
5230
|
-
function
|
|
5232
|
+
function ra(e, t = null) {
|
|
5231
5233
|
let n = e.domSelectionRange(), r = e.state.doc;
|
|
5232
5234
|
if (!n.focusNode) return null;
|
|
5233
5235
|
let i = e.docView.nearestDesc(n.focusNode), a = i && i.size == 0, o = e.docView.posFromDOM(n.focusNode, n.focusOffset, 1);
|
|
5234
5236
|
if (o < 0) return null;
|
|
5235
5237
|
let s = r.resolve(o), c, l;
|
|
5236
|
-
if (
|
|
5238
|
+
if (Fr(n)) {
|
|
5237
5239
|
for (c = o; i && !i.node;) i = i.parent;
|
|
5238
5240
|
let e = i.node;
|
|
5239
|
-
if (i && e.isAtom && k.isSelectable(e) && i.parent && !(e.isInline &&
|
|
5241
|
+
if (i && e.isAtom && k.isSelectable(e) && i.parent && !(e.isInline && Nr(n.focusNode, n.focusOffset, i.dom))) {
|
|
5240
5242
|
let e = i.posBefore;
|
|
5241
5243
|
l = new k(o == e ? s : r.resolve(e));
|
|
5242
5244
|
}
|
|
@@ -5259,16 +5261,16 @@ function ia(e, t = null) {
|
|
|
5259
5261
|
}
|
|
5260
5262
|
return l;
|
|
5261
5263
|
}
|
|
5262
|
-
function
|
|
5264
|
+
function ia(e) {
|
|
5263
5265
|
return e.editable ? e.hasFocus() : ga(e) && document.activeElement && document.activeElement.contains(e.dom);
|
|
5264
5266
|
}
|
|
5265
|
-
function
|
|
5267
|
+
function aa(e, t = !1) {
|
|
5266
5268
|
let n = e.state.selection;
|
|
5267
|
-
if (fa(e, n), !
|
|
5269
|
+
if (fa(e, n), !ia(e)) return;
|
|
5268
5270
|
let r = e.input.mouseDown;
|
|
5269
|
-
if (!t &&
|
|
5271
|
+
if (!t && R && r) {
|
|
5270
5272
|
let t = e.domSelectionRange(), n = e.domObserver.currentSelection;
|
|
5271
|
-
if (t.anchorNode && n.anchorNode &&
|
|
5273
|
+
if (t.anchorNode && n.anchorNode && Or(t.anchorNode, t.anchorOffset, n.anchorNode, n.anchorOffset) && r.delaySelUpdate()) {
|
|
5272
5274
|
e.domObserver.setCurSelection();
|
|
5273
5275
|
return;
|
|
5274
5276
|
}
|
|
@@ -5280,17 +5282,17 @@ function H(e, t = !1) {
|
|
|
5280
5282
|
}
|
|
5281
5283
|
e.domObserver.setCurSelection(), e.domObserver.connectSelection();
|
|
5282
5284
|
}
|
|
5283
|
-
var oa =
|
|
5285
|
+
var oa = z || R && Kr < 63;
|
|
5284
5286
|
function sa(e, t) {
|
|
5285
5287
|
let { node: n, offset: r } = e.docView.domFromPos(t, 0), i = r < n.childNodes.length ? n.childNodes[r] : null, a = r ? n.childNodes[r - 1] : null;
|
|
5286
|
-
if (
|
|
5288
|
+
if (z && i && i.contentEditable == "false") return ca(i);
|
|
5287
5289
|
if ((!i || i.contentEditable == "false") && (!a || a.contentEditable == "false")) {
|
|
5288
5290
|
if (i) return ca(i);
|
|
5289
5291
|
if (a) return ca(a);
|
|
5290
5292
|
}
|
|
5291
5293
|
}
|
|
5292
5294
|
function ca(e) {
|
|
5293
|
-
return e.contentEditable = "true",
|
|
5295
|
+
return e.contentEditable = "true", z && e.draggable && (e.draggable = !1, e.wasDraggable = !0), e;
|
|
5294
5296
|
}
|
|
5295
5297
|
function la(e) {
|
|
5296
5298
|
e.contentEditable = "false", e.wasDraggable &&= (e.draggable = !0, null);
|
|
@@ -5301,7 +5303,7 @@ function ua(e) {
|
|
|
5301
5303
|
let n = e.domSelectionRange(), r = n.anchorNode, i = n.anchorOffset;
|
|
5302
5304
|
t.addEventListener("selectionchange", e.input.hideSelectionGuard = () => {
|
|
5303
5305
|
(n.anchorNode != r || n.anchorOffset != i) && (t.removeEventListener("selectionchange", e.input.hideSelectionGuard), setTimeout(() => {
|
|
5304
|
-
(!
|
|
5306
|
+
(!ia(e) || e.state.selection.visible) && e.dom.classList.remove("ProseMirror-hideselection");
|
|
5305
5307
|
}, 20));
|
|
5306
5308
|
});
|
|
5307
5309
|
}
|
|
@@ -5309,7 +5311,7 @@ function da(e) {
|
|
|
5309
5311
|
let t = e.domSelection();
|
|
5310
5312
|
if (!t) return;
|
|
5311
5313
|
let n = e.cursorWrapper.dom, r = n.nodeName == "IMG";
|
|
5312
|
-
r ? t.collapse(n.parentNode, M(n) + 1) : t.collapse(n, 0), !r && !e.state.selection.visible &&
|
|
5314
|
+
r ? t.collapse(n.parentNode, M(n) + 1) : t.collapse(n, 0), !r && !e.state.selection.visible && I && Wr <= 11 && (n.disabled = !0, n.disabled = !1);
|
|
5313
5315
|
}
|
|
5314
5316
|
function fa(e, t) {
|
|
5315
5317
|
if (t instanceof k) {
|
|
@@ -5337,7 +5339,7 @@ function ga(e) {
|
|
|
5337
5339
|
}
|
|
5338
5340
|
function _a(e) {
|
|
5339
5341
|
let t = e.docView.domFromPos(e.state.selection.anchor, 0), n = e.domSelectionRange();
|
|
5340
|
-
return
|
|
5342
|
+
return Or(t.node, t.offset, n.anchorNode, n.anchorOffset);
|
|
5341
5343
|
}
|
|
5342
5344
|
function va(e, t) {
|
|
5343
5345
|
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;
|
|
@@ -5358,11 +5360,11 @@ function ba(e, t, n) {
|
|
|
5358
5360
|
else if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
|
|
5359
5361
|
let n = va(e.state, t);
|
|
5360
5362
|
return n && n instanceof k ? ya(e, n) : !1;
|
|
5361
|
-
} else if (!(
|
|
5363
|
+
} else if (!(B && n.indexOf("m") > -1)) {
|
|
5362
5364
|
let n = r.$head, i = n.textOffset ? null : t < 0 ? n.nodeBefore : n.nodeAfter, a;
|
|
5363
5365
|
if (!i || i.isText) return !1;
|
|
5364
5366
|
let o = t < 0 ? n.pos - i.nodeSize : n.pos;
|
|
5365
|
-
return i.isAtom || (a = e.docView.descAt(o)) && !a.contentDOM ? k.isSelectable(i) ? ya(e, new k(t < 0 ? e.state.doc.resolve(n.pos - i.nodeSize) : n)) :
|
|
5367
|
+
return i.isAtom || (a = e.docView.descAt(o)) && !a.contentDOM ? k.isSelectable(i) ? ya(e, new k(t < 0 ? e.state.doc.resolve(n.pos - i.nodeSize) : n)) : Xr ? ya(e, new O(e.state.doc.resolve(t < 0 ? o : o + i.nodeSize))) : !1 : !1;
|
|
5366
5368
|
}
|
|
5367
5369
|
} else if (r instanceof k && r.node.isInline) return ya(e, new O(t > 0 ? r.$to : r.$from));
|
|
5368
5370
|
else {
|
|
@@ -5384,7 +5386,7 @@ function wa(e) {
|
|
|
5384
5386
|
let t = e.domSelectionRange(), n = t.focusNode, r = t.focusOffset;
|
|
5385
5387
|
if (!n) return;
|
|
5386
5388
|
let i, a, o = !1;
|
|
5387
|
-
for (
|
|
5389
|
+
for (L && n.nodeType == 1 && r < xa(n) && Sa(n.childNodes[r], -1) && (o = !0);;) if (r > 0) {
|
|
5388
5390
|
if (n.nodeType != 1) break;
|
|
5389
5391
|
{
|
|
5390
5392
|
let e = n.childNodes[r - 1];
|
|
@@ -5430,7 +5432,7 @@ function Ea(e) {
|
|
|
5430
5432
|
return t && t.node && t.node.isBlock;
|
|
5431
5433
|
}
|
|
5432
5434
|
function Da(e, t) {
|
|
5433
|
-
for (; e && t == e.childNodes.length && !
|
|
5435
|
+
for (; e && t == e.childNodes.length && !Pr(e);) t = M(e) + 1, e = e.parentNode;
|
|
5434
5436
|
for (; e && t < e.childNodes.length;) {
|
|
5435
5437
|
let n = e.childNodes[t];
|
|
5436
5438
|
if (n.nodeType == 3) return n;
|
|
@@ -5439,7 +5441,7 @@ function Da(e, t) {
|
|
|
5439
5441
|
}
|
|
5440
5442
|
}
|
|
5441
5443
|
function Oa(e, t) {
|
|
5442
|
-
for (; e && !t && !
|
|
5444
|
+
for (; e && !t && !Pr(e);) t = M(e), e = e.parentNode;
|
|
5443
5445
|
for (; e && t;) {
|
|
5444
5446
|
let n = e.childNodes[t - 1];
|
|
5445
5447
|
if (n.nodeType == 3) return n;
|
|
@@ -5454,19 +5456,19 @@ function ka(e, t, n) {
|
|
|
5454
5456
|
}
|
|
5455
5457
|
let r = e.domSelection();
|
|
5456
5458
|
if (!r) return;
|
|
5457
|
-
if (
|
|
5459
|
+
if (Fr(r)) {
|
|
5458
5460
|
let e = document.createRange();
|
|
5459
5461
|
e.setEnd(t, n), e.setStart(t, n), r.removeAllRanges(), r.addRange(e);
|
|
5460
5462
|
} else r.extend && r.extend(t, n);
|
|
5461
5463
|
e.domObserver.setCurSelection();
|
|
5462
5464
|
let { state: i } = e;
|
|
5463
5465
|
setTimeout(() => {
|
|
5464
|
-
e.state == i &&
|
|
5466
|
+
e.state == i && aa(e);
|
|
5465
5467
|
}, 50);
|
|
5466
5468
|
}
|
|
5467
5469
|
function Aa(e, t) {
|
|
5468
5470
|
let n = e.state.doc.resolve(t);
|
|
5469
|
-
if (!(
|
|
5471
|
+
if (!(R || Jr) && n.parent.inlineContent) {
|
|
5470
5472
|
let r = e.coordsAtPos(t);
|
|
5471
5473
|
if (t > n.start()) {
|
|
5472
5474
|
let n = e.coordsAtPos(t - 1), i = (n.top + n.bottom) / 2;
|
|
@@ -5481,7 +5483,7 @@ function Aa(e, t) {
|
|
|
5481
5483
|
}
|
|
5482
5484
|
function ja(e, t, n) {
|
|
5483
5485
|
let r = e.state.selection;
|
|
5484
|
-
if (r instanceof O && !r.empty || n.indexOf("s") > -1 ||
|
|
5486
|
+
if (r instanceof O && !r.empty || n.indexOf("s") > -1 || B && n.indexOf("m") > -1) return !1;
|
|
5485
5487
|
let { $from: i, $to: a } = r;
|
|
5486
5488
|
if (!i.parent.inlineContent || e.endOfTextblock(t < 0 ? "up" : "down")) {
|
|
5487
5489
|
let n = va(e.state, t);
|
|
@@ -5510,7 +5512,7 @@ function Na(e, t, n) {
|
|
|
5510
5512
|
e.domObserver.stop(), t.contentEditable = n, e.domObserver.start();
|
|
5511
5513
|
}
|
|
5512
5514
|
function Pa(e) {
|
|
5513
|
-
if (!
|
|
5515
|
+
if (!z || e.state.selection.$head.parentOffset > 0) return !1;
|
|
5514
5516
|
let { focusNode: t, focusOffset: n } = e.domSelectionRange();
|
|
5515
5517
|
if (t && t.nodeType == 1 && n == 0 && t.firstChild && t.firstChild.contentEditable == "false") {
|
|
5516
5518
|
let n = t.firstChild;
|
|
@@ -5524,18 +5526,18 @@ function Fa(e) {
|
|
|
5524
5526
|
}
|
|
5525
5527
|
function Ia(e, t) {
|
|
5526
5528
|
let n = t.keyCode, r = Fa(t);
|
|
5527
|
-
if (n == 8 ||
|
|
5528
|
-
if (n == 46 && !t.shiftKey ||
|
|
5529
|
+
if (n == 8 || B && n == 72 && r == "c") return Ma(e, -1) || Ca(e, -1);
|
|
5530
|
+
if (n == 46 && !t.shiftKey || B && n == 68 && r == "c") return Ma(e, 1) || Ca(e, 1);
|
|
5529
5531
|
if (n == 13 || n == 27) return !0;
|
|
5530
|
-
if (n == 37 ||
|
|
5532
|
+
if (n == 37 || B && n == 66 && r == "c") {
|
|
5531
5533
|
let t = n == 37 ? Aa(e, e.state.selection.from) == "ltr" ? -1 : 1 : -1;
|
|
5532
5534
|
return ba(e, t, r) || Ca(e, t);
|
|
5533
|
-
} else if (n == 39 ||
|
|
5535
|
+
} else if (n == 39 || B && n == 70 && r == "c") {
|
|
5534
5536
|
let t = n == 39 ? Aa(e, e.state.selection.from) == "ltr" ? 1 : -1 : 1;
|
|
5535
5537
|
return ba(e, t, r) || Ca(e, t);
|
|
5536
|
-
} else if (n == 38 ||
|
|
5537
|
-
else if (n == 40 ||
|
|
5538
|
-
else if (r == (
|
|
5538
|
+
} else if (n == 38 || B && n == 80 && r == "c") return ja(e, -1, r) || Ca(e, -1);
|
|
5539
|
+
else if (n == 40 || B && n == 78 && r == "c") return Pa(e) || ja(e, 1, r) || Ca(e, 1);
|
|
5540
|
+
else if (r == (B ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90)) return !0;
|
|
5539
5541
|
return !1;
|
|
5540
5542
|
}
|
|
5541
5543
|
function La(e, t) {
|
|
@@ -5586,7 +5588,7 @@ function Ra(e, t, n, r, i) {
|
|
|
5586
5588
|
}
|
|
5587
5589
|
} else e.someProp("transformPastedHTML", (t) => {
|
|
5588
5590
|
n = t(n, e);
|
|
5589
|
-
}), s = Xa(n),
|
|
5591
|
+
}), s = Xa(n), Xr && Za(s);
|
|
5590
5592
|
let u = s && s.querySelector("[data-pm-slice]"), f = u && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice") || "");
|
|
5591
5593
|
if (f && f[3]) for (let e = +f[3]; e > 0; e--) {
|
|
5592
5594
|
let e = s.firstChild;
|
|
@@ -5698,7 +5700,7 @@ function Xa(e) {
|
|
|
5698
5700
|
return r;
|
|
5699
5701
|
}
|
|
5700
5702
|
function Za(e) {
|
|
5701
|
-
let t = e.querySelectorAll(
|
|
5703
|
+
let t = e.querySelectorAll(R ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
5702
5704
|
for (let n = 0; n < t.length; n++) {
|
|
5703
5705
|
let r = t[n];
|
|
5704
5706
|
r.childNodes.length == 1 && r.textContent == "\xA0" && r.parentNode && r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "), r);
|
|
@@ -5741,7 +5743,7 @@ function to(e) {
|
|
|
5741
5743
|
oo(e, t) && !ao(e, t) && (e.editable || !(t.type in W)) && n(e, t);
|
|
5742
5744
|
}, $a[t] ? { passive: !0 } : void 0);
|
|
5743
5745
|
}
|
|
5744
|
-
|
|
5746
|
+
z && e.dom.addEventListener("input", () => null), io(e);
|
|
5745
5747
|
}
|
|
5746
5748
|
function no(e, t) {
|
|
5747
5749
|
e.input.lastSelectionOrigin = t, e.input.lastSelectionTime = Date.now();
|
|
@@ -5773,17 +5775,17 @@ function so(e, t) {
|
|
|
5773
5775
|
}
|
|
5774
5776
|
W.keydown = (e, t) => {
|
|
5775
5777
|
let n = t;
|
|
5776
|
-
if (e.input.shiftKey = n.keyCode == 16 || n.shiftKey, !To(e) && (e.input.lastKeyCode = n.keyCode, e.input.lastKeyCodeTime = Date.now(), !(
|
|
5778
|
+
if (e.input.shiftKey = n.keyCode == 16 || n.shiftKey, !To(e) && (e.input.lastKeyCode = n.keyCode, e.input.lastKeyCodeTime = Date.now(), !(Yr && R && n.keyCode == 13))) if (n.keyCode != 229 && e.domObserver.forceFlush(), qr && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
|
|
5777
5779
|
let t = Date.now();
|
|
5778
5780
|
e.input.lastIOSEnter = t, e.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
5779
|
-
e.input.lastIOSEnter == t && (e.someProp("handleKeyDown", (t) => t(e,
|
|
5781
|
+
e.input.lastIOSEnter == t && (e.someProp("handleKeyDown", (t) => t(e, Ir(13, "Enter"))), e.input.lastIOSEnter = 0);
|
|
5780
5782
|
}, 200);
|
|
5781
5783
|
} else e.someProp("handleKeyDown", (t) => t(e, n)) || Ia(e, n) ? n.preventDefault() : no(e, "key");
|
|
5782
5784
|
}, W.keyup = (e, t) => {
|
|
5783
5785
|
t.keyCode == 16 && (e.input.shiftKey = !1);
|
|
5784
5786
|
}, W.keypress = (e, t) => {
|
|
5785
5787
|
let n = t;
|
|
5786
|
-
if (To(e) || !n.charCode || n.ctrlKey && !n.altKey ||
|
|
5788
|
+
if (To(e) || !n.charCode || n.ctrlKey && !n.altKey || B && n.metaKey) return;
|
|
5787
5789
|
if (e.someProp("handleKeyPress", (t) => t(e, n))) {
|
|
5788
5790
|
n.preventDefault();
|
|
5789
5791
|
return;
|
|
@@ -5862,7 +5864,7 @@ function yo(e, t, n) {
|
|
|
5862
5864
|
function bo(e) {
|
|
5863
5865
|
return jo(e);
|
|
5864
5866
|
}
|
|
5865
|
-
var xo =
|
|
5867
|
+
var xo = B ? "metaKey" : "ctrlKey";
|
|
5866
5868
|
U.mousedown = (e, t) => {
|
|
5867
5869
|
let n = t;
|
|
5868
5870
|
e.input.shiftKey = n.shiftKey;
|
|
@@ -5909,20 +5911,20 @@ var So = class {
|
|
|
5909
5911
|
node: i,
|
|
5910
5912
|
pos: a,
|
|
5911
5913
|
addAttr: !!(this.target && !this.target.draggable),
|
|
5912
|
-
setUneditable: !!(this.target &&
|
|
5914
|
+
setUneditable: !!(this.target && L && !this.target.hasAttribute("contentEditable"))
|
|
5913
5915
|
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
5914
5916
|
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
5915
5917
|
}, 20), this.view.domObserver.start()), no(e, "pointer");
|
|
5916
5918
|
}
|
|
5917
5919
|
done() {
|
|
5918
5920
|
super.done(), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => {
|
|
5919
|
-
this.view.isDestroyed ||
|
|
5921
|
+
this.view.isDestroyed || aa(this.view);
|
|
5920
5922
|
});
|
|
5921
5923
|
}
|
|
5922
5924
|
up(e) {
|
|
5923
5925
|
if (this.done(), !this.view.dom.contains(e.target)) return;
|
|
5924
5926
|
let t = this.pos;
|
|
5925
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(co(e))), this.updateAllowDefault(e), this.allowDefault || !t ? no(this.view, "pointer") : ho(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed ||
|
|
5927
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(co(e))), this.updateAllowDefault(e), this.allowDefault || !t ? no(this.view, "pointer") : ho(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) ? (fo(this.view, D.near(this.view.state.doc.resolve(t.pos)), "pointer"), e.preventDefault()) : no(this.view, "pointer");
|
|
5926
5928
|
}
|
|
5927
5929
|
move(e) {
|
|
5928
5930
|
this.updateAllowDefault(e), no(this.view, "pointer"), super.move(e);
|
|
@@ -5955,15 +5957,15 @@ U.touchstart = (e) => {
|
|
|
5955
5957
|
e.input.lastTouch = Date.now(), no(e, "pointer");
|
|
5956
5958
|
}, U.contextmenu = (e) => bo(e);
|
|
5957
5959
|
function To(e, t) {
|
|
5958
|
-
return e.composing ? !0 :
|
|
5960
|
+
return e.composing ? !0 : z && Math.abs(Date.now() - e.input.compositionEndedAt) < 500 ? (e.input.compositionEndedAt = -2e8, !0) : !1;
|
|
5959
5961
|
}
|
|
5960
|
-
var Eo =
|
|
5962
|
+
var Eo = Yr ? 5e3 : -1;
|
|
5961
5963
|
W.compositionstart = W.compositionupdate = (e) => {
|
|
5962
5964
|
if (!e.composing) {
|
|
5963
5965
|
e.domObserver.flush();
|
|
5964
5966
|
let { state: t } = e, n = t.selection.$to;
|
|
5965
|
-
if (t.selection instanceof O && (t.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((e) => e.type.spec.inclusive === !1) ||
|
|
5966
|
-
else if (jo(e, !t.selection.empty),
|
|
5967
|
+
if (t.selection instanceof O && (t.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((e) => e.type.spec.inclusive === !1) || R && Jr && Do(e))) e.markCursor = e.state.storedMarks || n.marks(), jo(e, !0), e.markCursor = null;
|
|
5968
|
+
else if (jo(e, !t.selection.empty), L && t.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
|
|
5967
5969
|
let t = e.domSelectionRange();
|
|
5968
5970
|
for (let n = t.focusNode, r = t.focusOffset; n && n.nodeType == 1 && r != 0;) {
|
|
5969
5971
|
let t = r < 0 ? n.lastChild : n.childNodes[r - 1];
|
|
@@ -5997,7 +5999,7 @@ function ko(e) {
|
|
|
5997
5999
|
function Ao(e) {
|
|
5998
6000
|
let t = e.domSelectionRange();
|
|
5999
6001
|
if (!t.focusNode) return null;
|
|
6000
|
-
let n =
|
|
6002
|
+
let n = jr(t.focusNode, t.focusOffset), r = Mr(t.focusNode, t.focusOffset);
|
|
6001
6003
|
if (n && r && n != r) {
|
|
6002
6004
|
let t = r.pmViewDesc, i = e.domObserver.lastChangedTextNode;
|
|
6003
6005
|
if (n == i || r == i) return i;
|
|
@@ -6010,9 +6012,9 @@ function Ao(e) {
|
|
|
6010
6012
|
return n || r;
|
|
6011
6013
|
}
|
|
6012
6014
|
function jo(e, t = !1) {
|
|
6013
|
-
if (!(
|
|
6015
|
+
if (!(Yr && e.domObserver.flushingSoon >= 0)) {
|
|
6014
6016
|
if (e.domObserver.forceFlush(), ko(e), t || e.docView && e.docView.dirty) {
|
|
6015
|
-
let n =
|
|
6017
|
+
let n = ra(e), r = e.state.selection;
|
|
6016
6018
|
return n && !n.eq(r) ? e.dispatch(e.state.tr.setSelection(n)) : (e.markCursor || t) && !r.$from.node(r.$from.sharedDepth(r.to)).inlineContent ? e.dispatch(e.state.tr.deleteSelection()) : e.updateState(e.state), !0;
|
|
6017
6019
|
}
|
|
6018
6020
|
return !1;
|
|
@@ -6027,7 +6029,7 @@ function Mo(e, t) {
|
|
|
6027
6029
|
n.parentNode && n.parentNode.removeChild(n), e.focus();
|
|
6028
6030
|
}, 50);
|
|
6029
6031
|
}
|
|
6030
|
-
var No =
|
|
6032
|
+
var No = I && Wr < 15 || qr && Zr < 604;
|
|
6031
6033
|
U.copy = W.cut = (e, t) => {
|
|
6032
6034
|
let n = t, r = e.state.selection, i = n.type == "cut";
|
|
6033
6035
|
if (r.empty) return;
|
|
@@ -6061,7 +6063,7 @@ function Lo(e) {
|
|
|
6061
6063
|
}
|
|
6062
6064
|
W.paste = (e, t) => {
|
|
6063
6065
|
let n = t;
|
|
6064
|
-
if (e.composing && !
|
|
6066
|
+
if (e.composing && !Yr) return;
|
|
6065
6067
|
let r = No ? null : n.clipboardData, i = e.input.shiftKey && e.input.lastKeyCode != 45;
|
|
6066
6068
|
r && Io(e, Lo(r), r.getData("text/html"), i, n) ? n.preventDefault() : Fo(e, n);
|
|
6067
6069
|
};
|
|
@@ -6069,7 +6071,7 @@ var Ro = class {
|
|
|
6069
6071
|
constructor(e, t, n) {
|
|
6070
6072
|
this.slice = e, this.move = t, this.node = n;
|
|
6071
6073
|
}
|
|
6072
|
-
}, zo =
|
|
6074
|
+
}, zo = B ? "altKey" : "ctrlKey";
|
|
6073
6075
|
function Bo(e, t) {
|
|
6074
6076
|
let n;
|
|
6075
6077
|
return e.someProp("dragCopies", (e) => {
|
|
@@ -6088,7 +6090,7 @@ U.dragstart = (e, t) => {
|
|
|
6088
6090
|
}
|
|
6089
6091
|
}
|
|
6090
6092
|
let { dom: s, text: c, slice: l } = La(e, (o || e.state.selection).content());
|
|
6091
|
-
(!n.dataTransfer.files.length || !
|
|
6093
|
+
(!n.dataTransfer.files.length || !R || Kr > 120) && n.dataTransfer.clearData(), n.dataTransfer.setData(No ? "Text" : "text/html", s.innerHTML), n.dataTransfer.effectAllowed = "copyMove", No || n.dataTransfer.setData("text/plain", c), e.dragging = new Ro(l, Bo(e, n), o);
|
|
6092
6094
|
}, U.dragend = (e) => {
|
|
6093
6095
|
let t = e.dragging;
|
|
6094
6096
|
window.setTimeout(() => {
|
|
@@ -6135,17 +6137,17 @@ function Vo(e, t, n) {
|
|
|
6135
6137
|
}
|
|
6136
6138
|
U.focus = (e) => {
|
|
6137
6139
|
e.input.lastFocus = Date.now(), e.focused || (e.domObserver.stop(), e.dom.classList.add("ProseMirror-focused"), e.domObserver.start(), e.focused = !0, setTimeout(() => {
|
|
6138
|
-
e.docView && e.hasFocus() && !e.domObserver.currentSelection.eq(e.domSelectionRange()) &&
|
|
6140
|
+
e.docView && e.hasFocus() && !e.domObserver.currentSelection.eq(e.domSelectionRange()) && aa(e);
|
|
6139
6141
|
}, 20));
|
|
6140
6142
|
}, U.blur = (e, t) => {
|
|
6141
6143
|
let n = t;
|
|
6142
6144
|
e.focused &&= (e.domObserver.stop(), e.dom.classList.remove("ProseMirror-focused"), e.domObserver.start(), n.relatedTarget && e.dom.contains(n.relatedTarget) && e.domObserver.currentSelection.clear(), !1);
|
|
6143
6145
|
}, U.beforeinput = (e, t) => {
|
|
6144
|
-
if (
|
|
6146
|
+
if (R && Yr && t.inputType == "deleteContentBackward") {
|
|
6145
6147
|
e.domObserver.flushSoon();
|
|
6146
6148
|
let { domChangeCount: t } = e.input;
|
|
6147
6149
|
setTimeout(() => {
|
|
6148
|
-
if (e.input.domChangeCount != t || (e.dom.blur(), e.focus(), e.someProp("handleKeyDown", (t) => t(e,
|
|
6150
|
+
if (e.input.domChangeCount != t || (e.dom.blur(), e.focus(), e.someProp("handleKeyDown", (t) => t(e, Ir(8, "Backspace"))))) return;
|
|
6149
6151
|
let { $cursor: n } = e.state.selection;
|
|
6150
6152
|
n && n.pos > 0 && e.dispatch(e.state.tr.delete(n.pos - 1, n.pos).scrollIntoView());
|
|
6151
6153
|
}, 50);
|
|
@@ -6524,7 +6526,7 @@ var ss = {
|
|
|
6524
6526
|
attributes: !0,
|
|
6525
6527
|
attributeOldValue: !0,
|
|
6526
6528
|
subtree: !0
|
|
6527
|
-
}, cs =
|
|
6529
|
+
}, cs = I && Wr <= 11, ls = class {
|
|
6528
6530
|
constructor() {
|
|
6529
6531
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
6530
6532
|
}
|
|
@@ -6541,7 +6543,7 @@ var ss = {
|
|
|
6541
6543
|
constructor(e, t) {
|
|
6542
6544
|
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new ls(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((t) => {
|
|
6543
6545
|
for (let e = 0; e < t.length; e++) this.queue.push(t[e]);
|
|
6544
|
-
|
|
6546
|
+
I && Wr <= 11 && t.some((e) => e.type == "childList" && e.removedNodes.length || e.type == "characterData" && e.oldValue.length > e.target.nodeValue.length) ? this.flushSoon() : z && e.composing && t.some((e) => e.type == "childList" && e.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
|
|
6545
6547
|
}), cs && (this.onCharData = (e) => {
|
|
6546
6548
|
this.queue.push({
|
|
6547
6549
|
target: e.target,
|
|
@@ -6583,10 +6585,10 @@ var ss = {
|
|
|
6583
6585
|
}
|
|
6584
6586
|
onSelectionChange() {
|
|
6585
6587
|
if (ha(this.view)) {
|
|
6586
|
-
if (this.suppressingSelectionUpdates) return
|
|
6587
|
-
if (
|
|
6588
|
+
if (this.suppressingSelectionUpdates) return aa(this.view);
|
|
6589
|
+
if (I && Wr <= 11 && !this.view.state.selection.empty) {
|
|
6588
6590
|
let e = this.view.domSelectionRange();
|
|
6589
|
-
if (e.focusNode &&
|
|
6591
|
+
if (e.focusNode && Or(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset)) return this.flushSoon();
|
|
6590
6592
|
}
|
|
6591
6593
|
this.flush();
|
|
6592
6594
|
}
|
|
@@ -6622,7 +6624,7 @@ var ss = {
|
|
|
6622
6624
|
let n = this.registerMutation(t[e], s);
|
|
6623
6625
|
n && (i = i < 0 ? n.from : Math.min(n.from, i), a = a < 0 ? n.to : Math.max(n.to, a), n.typeOver && (o = !0));
|
|
6624
6626
|
}
|
|
6625
|
-
if (s.some((e) => e.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46 ||
|
|
6627
|
+
if (s.some((e) => e.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46 || R && (e.composing || e.input.compositionEndedAt > Date.now() - 50) && t.some((e) => e.type == "childList" && e.removedNodes.length))) {
|
|
6626
6628
|
for (let e of s) if (e.nodeName == "BR" && e.parentNode) {
|
|
6627
6629
|
let t = e.nextSibling;
|
|
6628
6630
|
for (; t && t.nodeType == 1;) {
|
|
@@ -6633,7 +6635,7 @@ var ss = {
|
|
|
6633
6635
|
t = t.firstChild;
|
|
6634
6636
|
}
|
|
6635
6637
|
}
|
|
6636
|
-
} else if (
|
|
6638
|
+
} else if (L && s.length) {
|
|
6637
6639
|
let t = s.filter((e) => e.nodeName == "BR");
|
|
6638
6640
|
if (t.length == 2) {
|
|
6639
6641
|
let [e, n] = t;
|
|
@@ -6647,7 +6649,7 @@ var ss = {
|
|
|
6647
6649
|
}
|
|
6648
6650
|
}
|
|
6649
6651
|
let c = null;
|
|
6650
|
-
i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 &&
|
|
6652
|
+
i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Fr(n) && (c = ra(e)) && c.eq(D.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, aa(e), this.currentSelection.set(n), e.scrollToSelection()) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, a), ps(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, _s(e, s)), this.handleDOMChange(i, a, o, s), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(n) || aa(e), this.currentSelection.set(n));
|
|
6651
6653
|
}
|
|
6652
6654
|
registerMutation(e, t) {
|
|
6653
6655
|
if (t.indexOf(e.target) > -1) return null;
|
|
@@ -6663,7 +6665,7 @@ var ss = {
|
|
|
6663
6665
|
to: n.posAfter
|
|
6664
6666
|
};
|
|
6665
6667
|
let r = e.previousSibling, i = e.nextSibling;
|
|
6666
|
-
if (
|
|
6668
|
+
if (I && Wr <= 11 && e.addedNodes.length) for (let t = 0; t < e.addedNodes.length; t++) {
|
|
6667
6669
|
let { previousSibling: n, nextSibling: a } = e.addedNodes[t];
|
|
6668
6670
|
(!n || Array.prototype.indexOf.call(e.addedNodes, n) < 0) && (r = n), (!a || Array.prototype.indexOf.call(e.addedNodes, a) < 0) && (i = a);
|
|
6669
6671
|
}
|
|
@@ -6689,13 +6691,13 @@ function ps(e) {
|
|
|
6689
6691
|
"nowrap",
|
|
6690
6692
|
"pre-line"
|
|
6691
6693
|
].indexOf(getComputedStyle(e.dom).whiteSpace) !== -1)) {
|
|
6692
|
-
if (e.requiresGeckoHackNode =
|
|
6694
|
+
if (e.requiresGeckoHackNode = L, fs) return;
|
|
6693
6695
|
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), fs = !0;
|
|
6694
6696
|
}
|
|
6695
6697
|
}
|
|
6696
6698
|
function ms(e, t) {
|
|
6697
6699
|
let n = t.startContainer, r = t.startOffset, i = t.endContainer, a = t.endOffset, o = e.domAtPos(e.state.selection.anchor);
|
|
6698
|
-
return
|
|
6700
|
+
return Or(o.node, o.offset, i, a) && ([n, r, i, a] = [
|
|
6699
6701
|
i,
|
|
6700
6702
|
a,
|
|
6701
6703
|
n,
|
|
@@ -6746,10 +6748,10 @@ function vs(e, t, n) {
|
|
|
6746
6748
|
if (u && e.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (l = [{
|
|
6747
6749
|
node: u,
|
|
6748
6750
|
offset: c.anchorOffset
|
|
6749
|
-
}],
|
|
6751
|
+
}], Fr(c) || l.push({
|
|
6750
6752
|
node: c.focusNode,
|
|
6751
6753
|
offset: c.focusOffset
|
|
6752
|
-
})),
|
|
6754
|
+
})), R && e.input.lastKeyCode === 8) for (let e = a; e > i; e--) {
|
|
6753
6755
|
let t = r.childNodes[e - 1], n = t.pmViewDesc;
|
|
6754
6756
|
if (t.nodeName == "BR" && !n) {
|
|
6755
6757
|
a = e;
|
|
@@ -6786,10 +6788,10 @@ function ys(e) {
|
|
|
6786
6788
|
let t = e.pmViewDesc;
|
|
6787
6789
|
if (t) return t.parseRule();
|
|
6788
6790
|
if (e.nodeName == "BR" && e.parentNode) {
|
|
6789
|
-
if (
|
|
6791
|
+
if (z && /^(ul|ol)$/i.test(e.parentNode.nodeName)) {
|
|
6790
6792
|
let e = document.createElement("div");
|
|
6791
6793
|
return e.appendChild(document.createElement("li")), { skip: e };
|
|
6792
|
-
} else if (e.parentNode.lastChild == e ||
|
|
6794
|
+
} else if (e.parentNode.lastChild == e || z && /^(tr|table)$/i.test(e.parentNode.nodeName)) return { ignore: !0 };
|
|
6793
6795
|
} else if (e.nodeName == "IMG" && e.getAttribute("mark-placeholder")) return { ignore: !0 };
|
|
6794
6796
|
return null;
|
|
6795
6797
|
}
|
|
@@ -6797,9 +6799,9 @@ var bs = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|
|
|
|
6797
6799
|
function xs(e, t, n, r, i) {
|
|
6798
6800
|
let a = e.input.compositionPendingChanges || (e.composing ? e.input.compositionID : 0);
|
|
6799
6801
|
if (e.input.compositionPendingChanges = 0, t < 0) {
|
|
6800
|
-
let t = e.input.lastSelectionTime > Date.now() - 50 ? e.input.lastSelectionOrigin : null, n =
|
|
6802
|
+
let t = e.input.lastSelectionTime > Date.now() - 50 ? e.input.lastSelectionOrigin : null, n = ra(e, t);
|
|
6801
6803
|
if (n && !e.state.selection.eq(n)) {
|
|
6802
|
-
if (
|
|
6804
|
+
if (R && Yr && e.input.lastKeyCode === 13 && Date.now() - 100 < e.input.lastKeyCodeTime && e.someProp("handleKeyDown", (t) => t(e, Ir(13, "Enter")))) return;
|
|
6803
6805
|
let r = e.state.tr.setSelection(n);
|
|
6804
6806
|
t == "pointer" ? r.setMeta("pointer", !0) : t == "key" && r.scrollIntoView(), a && r.setMeta("composition", a), e.dispatch(r);
|
|
6805
6807
|
}
|
|
@@ -6810,7 +6812,7 @@ function xs(e, t, n, r, i) {
|
|
|
6810
6812
|
let c = e.state.selection, l = vs(e, t, n), u = e.state.doc, d = u.slice(l.from, l.to), f, p;
|
|
6811
6813
|
e.input.lastKeyCode === 8 && Date.now() - 100 < e.input.lastKeyCodeTime ? (f = e.state.selection.to, p = "end") : (f = e.state.selection.from, p = "start"), e.input.lastKeyCode = null;
|
|
6812
6814
|
let m = Es(d.content, l.doc.content, l.from, f, p);
|
|
6813
|
-
if (m && e.input.domChangeCount++, (
|
|
6815
|
+
if (m && e.input.domChangeCount++, (qr && e.input.lastIOSEnter > Date.now() - 225 || Yr) && i.some((e) => e.nodeType == 1 && !bs.test(e.nodeName)) && (!m || m.endA >= m.endB) && e.someProp("handleKeyDown", (t) => t(e, Ir(13, "Enter")))) {
|
|
6814
6816
|
e.input.lastIOSEnter = 0;
|
|
6815
6817
|
return;
|
|
6816
6818
|
}
|
|
@@ -6829,31 +6831,31 @@ function xs(e, t, n, r, i) {
|
|
|
6829
6831
|
}
|
|
6830
6832
|
return;
|
|
6831
6833
|
}
|
|
6832
|
-
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof O && (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)),
|
|
6834
|
+
e.state.selection.from < e.state.selection.to && m.start == m.endB && e.state.selection instanceof O && (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 && Wr <= 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--);
|
|
6833
6835
|
let h = l.doc.resolveNoCache(m.start - l.from), g = l.doc.resolveNoCache(m.endB - l.from), ee = u.resolve(m.start), _ = h.sameParent(g) && h.parent.inlineContent && ee.end() >= m.endA;
|
|
6834
|
-
if ((
|
|
6836
|
+
if ((qr && e.input.lastIOSEnter > Date.now() - 225 && (!_ || i.some((e) => e.nodeName == "DIV" || e.nodeName == "P")) || !_ && 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, Ir(13, "Enter")))) {
|
|
6835
6837
|
e.input.lastIOSEnter = 0;
|
|
6836
6838
|
return;
|
|
6837
6839
|
}
|
|
6838
|
-
if (e.state.selection.anchor > m.start && ws(u, m.start, m.endA, h, g) && e.someProp("handleKeyDown", (t) => t(e,
|
|
6839
|
-
|
|
6840
|
+
if (e.state.selection.anchor > m.start && ws(u, m.start, m.endA, h, g) && e.someProp("handleKeyDown", (t) => t(e, Ir(8, "Backspace")))) {
|
|
6841
|
+
Yr && R && e.domObserver.suppressSelectionUpdates();
|
|
6840
6842
|
return;
|
|
6841
6843
|
}
|
|
6842
|
-
|
|
6844
|
+
R && m.endB == m.start && (e.input.lastChromeDelete = Date.now()), Yr && !_ && h.start() != g.start() && g.parentOffset == 0 && h.depth == g.depth && l.sel && l.sel.anchor == l.sel.head && l.sel.head == m.endA && (m.endB -= 2, g = l.doc.resolveNoCache(m.endB - l.from), setTimeout(() => {
|
|
6843
6845
|
e.someProp("handleKeyDown", function(t) {
|
|
6844
|
-
return t(e,
|
|
6846
|
+
return t(e, Ir(13, "Enter"));
|
|
6845
6847
|
});
|
|
6846
6848
|
}, 20));
|
|
6847
6849
|
let v = m.start, y = m.endA, b = (t) => {
|
|
6848
6850
|
let n = t || e.state.tr.replace(v, y, l.doc.slice(m.start - l.from, m.endB - l.from));
|
|
6849
6851
|
if (l.sel) {
|
|
6850
6852
|
let t = Ss(e, n.doc, l.sel);
|
|
6851
|
-
t && !(
|
|
6853
|
+
t && !(R && e.composing && t.empty && (m.start != m.endB || e.input.lastChromeDelete < Date.now() - 100) && (t.head == v || t.head == n.mapping.map(y) - 1) || I && t.empty && t.head == v) && n.setSelection(t);
|
|
6852
6854
|
}
|
|
6853
6855
|
return a && n.setMeta("composition", a), n.scrollIntoView();
|
|
6854
6856
|
}, x;
|
|
6855
6857
|
if (_) if (h.pos == g.pos) {
|
|
6856
|
-
|
|
6858
|
+
I && Wr <= 11 && h.parentOffset == 0 && (e.domObserver.suppressSelectionUpdates(), setTimeout(() => aa(e), 20));
|
|
6857
6859
|
let t = b(e.state.tr.delete(v, y)), n = u.resolve(m.start).marksAcross(u.resolve(m.endA));
|
|
6858
6860
|
n && t.ensureMarks(n), e.dispatch(t);
|
|
6859
6861
|
} else if (m.endA == m.endB && (x = Cs(h.parent.content.cut(h.parentOffset, g.parentOffset), ee.parent.content.cut(ee.parentOffset, m.endA - ee.start())))) {
|
|
@@ -6925,7 +6927,7 @@ function Es(e, t, n, r, i) {
|
|
|
6925
6927
|
}
|
|
6926
6928
|
var Ds = class {
|
|
6927
6929
|
constructor(e, t) {
|
|
6928
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new eo(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Ps), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = As(this), ks(this), this.nodeViews = Ms(this), this.docView =
|
|
6930
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new eo(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Ps), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = As(this), ks(this), this.nodeViews = Ms(this), this.docView = Li(this.state.doc, Os(this), as(this), this.dom, this), this.domObserver = new us(this, (e, t, n, r) => xs(this, e, t, n, r)), this.domObserver.start(), to(this), this.updatePluginViews();
|
|
6929
6931
|
}
|
|
6930
6932
|
get composing() {
|
|
6931
6933
|
return this.input.composing;
|
|
@@ -6965,25 +6967,25 @@ var Ds = class {
|
|
|
6965
6967
|
(a || t.handleDOMEvents != this._props.handleDOMEvents) && io(this), this.editable = As(this), ks(this);
|
|
6966
6968
|
let o = as(this), s = Os(this), c = n.plugins != e.plugins && !n.doc.eq(e.doc) ? "reset" : e.scrollToSelection > n.scrollToSelection ? "to selection" : "preserve", l = r || !this.docView.matchesNode(e.doc, s, o);
|
|
6967
6969
|
(l || !e.selection.eq(n.selection)) && (i = !0);
|
|
6968
|
-
let u = c == "preserve" && i && this.dom.style.overflowAnchor == null &&
|
|
6970
|
+
let u = c == "preserve" && i && this.dom.style.overflowAnchor == null && ni(this);
|
|
6969
6971
|
if (i) {
|
|
6970
6972
|
this.domObserver.stop();
|
|
6971
|
-
let t = l && (
|
|
6973
|
+
let t = l && (I || R) && !this.composing && !n.selection.empty && !e.selection.empty && js(n.selection, e.selection);
|
|
6972
6974
|
if (l) {
|
|
6973
|
-
let n =
|
|
6974
|
-
this.composing && (this.input.compositionNode = Ao(this)), (r || !this.docView.update(e.doc, s, o, this)) && (this.docView.updateOuterDeco(s), this.docView.destroy(), this.docView =
|
|
6975
|
+
let n = R ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
6976
|
+
this.composing && (this.input.compositionNode = Ao(this)), (r || !this.docView.update(e.doc, s, o, this)) && (this.docView.updateOuterDeco(s), this.docView.destroy(), this.docView = Li(e.doc, s, o, this.dom, this)), n && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (t = !0);
|
|
6975
6977
|
}
|
|
6976
6978
|
let i = this.input.mouseDown;
|
|
6977
|
-
t || !(i && this.domObserver.currentSelection.eq(this.domSelectionRange()) && _a(this) && i.delaySelUpdate()) ?
|
|
6979
|
+
t || !(i && this.domObserver.currentSelection.eq(this.domSelectionRange()) && _a(this) && i.delaySelUpdate()) ? aa(this, t) : (fa(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
6978
6980
|
}
|
|
6979
|
-
this.updatePluginViews(n), this.dragging?.node && !n.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, n), c == "reset" ? this.dom.scrollTop = 0 : c == "to selection" ? this.scrollToSelection() : u &&
|
|
6981
|
+
this.updatePluginViews(n), this.dragging?.node && !n.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, n), c == "reset" ? this.dom.scrollTop = 0 : c == "to selection" ? this.scrollToSelection() : u && ii(u);
|
|
6980
6982
|
}
|
|
6981
6983
|
scrollToSelection() {
|
|
6982
6984
|
let e = this.domSelectionRange().focusNode;
|
|
6983
6985
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode)) && !this.someProp("handleScrollToSelection", (e) => e(this))) if (this.state.selection instanceof k) {
|
|
6984
6986
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
6985
|
-
t.nodeType == 1 &&
|
|
6986
|
-
} else
|
|
6987
|
+
t.nodeType == 1 && ti(this, t.getBoundingClientRect(), e);
|
|
6988
|
+
} else ti(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
6987
6989
|
}
|
|
6988
6990
|
destroyPluginViews() {
|
|
6989
6991
|
let e;
|
|
@@ -7028,7 +7030,7 @@ var Ds = class {
|
|
|
7028
7030
|
}
|
|
7029
7031
|
}
|
|
7030
7032
|
hasFocus() {
|
|
7031
|
-
if (
|
|
7033
|
+
if (I) {
|
|
7032
7034
|
let e = this.root.activeElement;
|
|
7033
7035
|
if (e == this.dom) return !0;
|
|
7034
7036
|
if (!e || !this.dom.contains(e)) return !1;
|
|
@@ -7041,7 +7043,7 @@ var Ds = class {
|
|
|
7041
7043
|
return this.root.activeElement == this.dom;
|
|
7042
7044
|
}
|
|
7043
7045
|
focus() {
|
|
7044
|
-
this.domObserver.stop(), this.editable &&
|
|
7046
|
+
this.domObserver.stop(), this.editable && si(this.dom), aa(this), this.domObserver.start();
|
|
7045
7047
|
}
|
|
7046
7048
|
get root() {
|
|
7047
7049
|
let e = this._root;
|
|
@@ -7054,10 +7056,10 @@ var Ds = class {
|
|
|
7054
7056
|
this._root = null;
|
|
7055
7057
|
}
|
|
7056
7058
|
posAtCoords(e) {
|
|
7057
|
-
return
|
|
7059
|
+
return hi(this, e);
|
|
7058
7060
|
}
|
|
7059
7061
|
coordsAtPos(e, t = 1) {
|
|
7060
|
-
return
|
|
7062
|
+
return yi(this, e, t);
|
|
7061
7063
|
}
|
|
7062
7064
|
domAtPos(e, t = 0) {
|
|
7063
7065
|
return this.docView.domFromPos(e, t);
|
|
@@ -7072,7 +7074,7 @@ var Ds = class {
|
|
|
7072
7074
|
return r;
|
|
7073
7075
|
}
|
|
7074
7076
|
endOfTextblock(e, t) {
|
|
7075
|
-
return
|
|
7077
|
+
return ki(this, t || this.state, e);
|
|
7076
7078
|
}
|
|
7077
7079
|
pasteHTML(e, t) {
|
|
7078
7080
|
return Io(this, "", e, !1, t || new ClipboardEvent("paste"));
|
|
@@ -7084,7 +7086,7 @@ var Ds = class {
|
|
|
7084
7086
|
return La(this, e);
|
|
7085
7087
|
}
|
|
7086
7088
|
destroy() {
|
|
7087
|
-
this.docView && (ro(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], as(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null,
|
|
7089
|
+
this.docView && (ro(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], as(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Dr());
|
|
7088
7090
|
}
|
|
7089
7091
|
get isDestroyed() {
|
|
7090
7092
|
return this.docView == null;
|
|
@@ -7094,7 +7096,7 @@ var Ds = class {
|
|
|
7094
7096
|
}
|
|
7095
7097
|
domSelectionRange() {
|
|
7096
7098
|
let e = this.domSelection();
|
|
7097
|
-
return e ?
|
|
7099
|
+
return e ? z && this.root.nodeType === 11 && Lr(this.dom.ownerDocument) == this.dom && hs(this, e) || e : {
|
|
7098
7100
|
focusNode: null,
|
|
7099
7101
|
focusOffset: 0,
|
|
7100
7102
|
anchorNode: null,
|