@templatical/editor 0.0.6 → 0.1.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/LICENSE +56 -0
- package/README.md +69 -0
- package/dist/{AiChatSidebar-CNhSl_ty.js → AiChatSidebar-DgAjDWO1.js} +68 -68
- package/dist/{AiFeatureMenu-BFVsjUJY.js → AiFeatureMenu-j6oaiRVi.js} +25 -25
- package/dist/{CloudEditor-Bz5Xkxej.js → CloudEditor-yCOkIkZ-.js} +428 -437
- package/dist/{CollaboratorBar-D2Gu5Xj2.js → CollaboratorBar-CWVdp2Y6.js} +23 -23
- package/dist/CommentsSidebar-CSPHhbQH.js +439 -0
- package/dist/CountdownBlock-DK6P_RaQ.js +92 -0
- package/dist/CountdownToolbar-Dv-Sz4ui.js +210 -0
- package/dist/{DesignReferenceSidebar-u2tKSQK0.js → DesignReferenceSidebar-D7zfvux6.js} +58 -58
- package/dist/LoadingTrack-Cdz2SSq9.js +10 -0
- package/dist/ModuleBrowserModal-BLYuCZht.js +205 -0
- package/dist/ModulePreviewCanvas-CHYqP6K3.js +106 -0
- package/dist/NumberWithSuffix-D-5-AZc3.js +424 -0
- package/dist/{ParagraphEditor-CYrzYJO5.js → ParagraphEditor-DivLBNWv.js} +237 -236
- package/dist/{RichTextEditorContent-BeqlWlWB.js → RichTextEditorContent-G1lXgVJR.js} +42 -42
- package/dist/{SaveModuleDialog-Kde6X13X.js → SaveModuleDialog-DGVfiOmE.js} +29 -29
- package/dist/{SnapshotHistory-B3EfIcLW.js → SnapshotHistory-DM__MqSu.js} +38 -38
- package/dist/{TemplateScoringPanel-D2vCRGgx.js → TemplateScoringPanel-CW13Tlol.js} +80 -80
- package/dist/{TestEmailModal-Egk0DFDf.js → TestEmailModal-B8bYqWCY.js} +28 -28
- package/dist/TitleEditor-4Jrp3C4m.js +167 -0
- package/dist/{TplModal-BCruYWks.js → TplModal-BkoIz0oz.js} +14 -14
- package/dist/{_plugin-vue_export-helper-5TQrnOhO.js → _plugin-vue_export-helper-OO6pH1Dh.js} +11 -11
- package/dist/{blockTypeIcons-rW4BUUNC.js → blockTypeIcons-4AS3CvXn.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-Dcbshcfu.js → AiFeatureMenu-BcHyzTQy.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-Dcbshcfu.js.map → AiFeatureMenu-BcHyzTQy.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bca3RyBW.js → CloudEditor-TaEZq-YW.js} +179 -188
- package/dist/cdn/chunks/CloudEditor-TaEZq-YW.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-sToKJfHi.js → CollaboratorBar-DbC5-3If.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-sToKJfHi.js.map → CollaboratorBar-DbC5-3If.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-CfPmCQ7j.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-CfPmCQ7j.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-CB0EVxwN.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-CB0EVxwN.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-BNhwXbWw.js → ModuleBrowserModal-Df2fp9dj.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-BNhwXbWw.js.map → ModuleBrowserModal-Df2fp9dj.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DylUylPU.js → ModulePreviewCanvas-Dw1OCpvV.js} +19 -19
- package/dist/cdn/chunks/{ModulePreviewCanvas-DylUylPU.js.map → ModulePreviewCanvas-Dw1OCpvV.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-BU6ycXyG.js +425 -0
- package/dist/cdn/chunks/NumberWithSuffix-BU6ycXyG.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-BBw90y_p.js → ParagraphEditor-BMRNg_BX.js} +37 -37
- package/dist/cdn/chunks/{ParagraphEditor-BBw90y_p.js.map → ParagraphEditor-BMRNg_BX.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DvyIO3nR.js → RichTextEditorContent-BKYY1YMZ.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-DvyIO3nR.js.map → RichTextEditorContent-BKYY1YMZ.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DvbSHvhF.js → SaveModuleDialog-D977Tg7t.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-DvbSHvhF.js.map → SaveModuleDialog-D977Tg7t.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-tS3mgoVr.js → TitleEditor-q9IzNy38.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-tS3mgoVr.js.map → TitleEditor-q9IzNy38.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-DbnbyEQE.js → blockTypeIcons-L0fRc3qs.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-DbnbyEQE.js.map → blockTypeIcons-L0fRc3qs.js.map} +1 -1
- package/dist/cdn/chunks/{de-CgUR_S5I.js → de-3exf7MYE.js} +1 -1
- package/dist/cdn/chunks/{de-CgUR_S5I.js.map → de-3exf7MYE.js.map} +1 -1
- package/dist/cdn/chunks/{de-D8oDPhBD.js → de-C8LxVUsb.js} +1 -1
- package/dist/cdn/chunks/{de-D8oDPhBD.js.map → de-C8LxVUsb.js.map} +1 -1
- package/dist/cdn/chunks/{dist-BUmN5e4r.js → dist-D5g00M8N.js} +6 -2
- package/dist/cdn/chunks/dist-D5g00M8N.js.map +1 -0
- package/dist/cdn/chunks/{draggable-m78lz0gI.js → draggable-Bcb86AsV.js} +5 -5
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-CNNgvDqx.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-CNNgvDqx.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-HseRPPeK.js → en-BoEycuqw.js} +1 -1
- package/dist/cdn/chunks/{en-HseRPPeK.js.map → en-BoEycuqw.js.map} +1 -1
- package/dist/cdn/chunks/{en-BBmfBDqY.js → en-KNPUKxYp.js} +1 -1
- package/dist/cdn/chunks/{en-BBmfBDqY.js.map → en-KNPUKxYp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-ClpY3m0W.js → extensions-BZ1POyiv.js} +11 -11
- package/dist/cdn/chunks/{extensions-ClpY3m0W.js.map → extensions-BZ1POyiv.js.map} +1 -1
- package/dist/cdn/chunks/{features-B5dGxWLi.js → features-Ccqmm6-M.js} +549 -627
- package/dist/cdn/chunks/features-Ccqmm6-M.js.map +1 -0
- package/dist/cdn/chunks/{icons-hflTyPmb.js → icons-x53__2GC.js} +8 -8
- package/dist/cdn/chunks/icons-x53__2GC.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-BxyRVCKv.js → liquid.browser-CEMn-ZqL.js} +2 -2
- package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
- package/dist/cdn/chunks/{media-library-Dgy-V-JA.js → media-library-DUoQk-w7.js} +97 -97
- package/dist/cdn/chunks/media-library-DUoQk-w7.js.map +1 -0
- package/dist/cdn/chunks/{pusher-D-m2WSdL.js → pusher-DwSQn6BA.js} +2 -2
- package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
- package/dist/cdn/chunks/{src-TDwMmqm0.js → src-DskCIAr8.js} +8 -8
- package/dist/cdn/chunks/{src-TDwMmqm0.js.map → src-DskCIAr8.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js → styleConstants-DP1VOca8.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js.map → styleConstants-DP1VOca8.js.map} +1 -1
- package/dist/cdn/chunks/{styles-hCOCOR6K.js → styles-BIlpNe52.js} +622 -1238
- package/dist/cdn/chunks/styles-BIlpNe52.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C28NLMX8.js → tiptap-hPC_BgDO.js} +850 -826
- package/dist/cdn/chunks/tiptap-hPC_BgDO.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +92 -97
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B5S-C0bz.js → check-Bff5NzCh.js} +1 -1
- package/dist/{chevron-down-CjsV1T0W.js → chevron-down-Bbv4SJwx.js} +1 -1
- package/dist/{circle-alert-CVTmJHKW.js → circle-alert-Dpr8MgkR.js} +1 -1
- package/dist/{clock-CAjdSHBy.js → clock-raVPKfl4.js} +1 -1
- package/dist/{dist-DJrDTuRr.js → dist-BHgEdO-M.js} +1001 -983
- package/dist/dist-BibwE8Y0.js +5 -0
- package/dist/{dist-DPM-DFvh.js → dist-BnlZ_HwX.js} +340 -340
- package/dist/{dist-BTtKPcd2.js → dist-C9yhcxsf.js} +2 -2
- package/dist/{dist-COguaIvm.js → dist-CGffNO8z.js} +2 -2
- package/dist/dist-CfGpCUSx.js +5 -0
- package/dist/{dist-COOFiBFV.js → dist-Chd-H2S3.js} +5 -5
- package/dist/{dist-DfqLGwSF.js → dist-Cq0OFLMj.js} +2 -2
- package/dist/{dist-B4LTlrAn.js → dist-D42og5Sc.js} +191 -185
- package/dist/{dist-CBr-qhie.js → dist-Owxo48fF.js} +2 -2
- package/dist/{dist-Crqkuf-w.js → dist-UZ8UzVZ-.js} +15 -15
- package/dist/dist-n0PkFNGl.js +314 -0
- package/dist/{dist-DHYuVJ_7.js → dist-skgH9dyo.js} +2 -2
- package/dist/{extensions-C6xp_B7K.js → extensions-DQKaICBH.js} +81 -81
- package/dist/{image-up-vZa1Txr-.js → image-up-B1AEiHCh.js} +1 -1
- package/dist/index.d.ts +17 -6
- package/dist/{keys-C0MQRs8d.js → keys-CIw9mUI2.js} +1 -1
- package/dist/{liquid.browser-C02owkex.js → liquid.browser-Bm53dnK1.js} +1 -1
- package/dist/{loader-circle-DilFjHSk.js → loader-circle-BYeKJ3to.js} +1 -1
- package/dist/{message-circle-Dpcnc2oa.js → message-circle-PhNlI7e7.js} +1 -1
- package/dist/{refresh-cw-4r7rkHHX.js → refresh-cw-DhDYRBDd.js} +1 -1
- package/dist/{rolldown-runtime-gEudmnaM.js → rolldown-runtime-BZGGJVDF.js} +2 -5
- package/dist/{scan-line-684IxPQ0.js → scan-line-Bw8bauvt.js} +1 -1
- package/dist/{send-ChDw64yL.js → send-CJPSzbLO.js} +1 -1
- package/dist/{shield-check-9dhLdyST.js → shield-check-DdEvVYMH.js} +1 -1
- package/dist/{sparkles-Co9fkDcv.js → sparkles-DT_27AYs.js} +1 -1
- package/dist/style.css +2 -0
- package/dist/{styleConstants-RV3eYwkD.js → styleConstants-Dqz9z3aa.js} +6 -45
- package/dist/styles-tcwlvlEB.js +2942 -0
- package/dist/templatical-editor.js +114 -119
- package/dist/text-align-start-4Hx15GUf.js +43 -0
- package/dist/{trash-2-CZkMtjeC.js → trash-2-BY-xp5hg.js} +1 -1
- package/dist/{triangle-alert-Dvt51agD.js → triangle-alert-DG72vdb2.js} +1 -1
- package/dist/useEditorCore-DMH2QpUL.js +8946 -0
- package/dist/{useI18n-D6m7ZUgY.js → useI18n-B8CN2iWs.js} +4 -4
- package/dist/{useMergeTag-CSXcnFBc.js → useMergeTag-Dz_Dx2Jz.js} +3 -3
- package/dist/vue.runtime.esm-bundler-DryoQb-v.js +5775 -0
- package/dist/{x-CU2XZOkQ.js → x-D-7GkO6Z.js} +1 -1
- package/package.json +31 -15
- package/dist/CommentsSidebar-CTeEAZTj.js +0 -439
- package/dist/LoadingTrack--aUassFH.js +0 -10
- package/dist/ModuleBrowserModal-DNxODPlX.js +0 -205
- package/dist/ModulePreviewCanvas-DnGe1Y-2.js +0 -106
- package/dist/TitleEditor-DwUpo4gF.js +0 -167
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +0 -1
- package/dist/cdn/chunks/dist-BUmN5e4r.js.map +0 -1
- package/dist/cdn/chunks/draggable-m78lz0gI.js.map +0 -1
- package/dist/cdn/chunks/features-B5dGxWLi.js.map +0 -1
- package/dist/cdn/chunks/icons-hflTyPmb.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +0 -1
- package/dist/cdn/chunks/media-library-Dgy-V-JA.js.map +0 -1
- package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +0 -1
- package/dist/cdn/chunks/styles-hCOCOR6K.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +0 -1
- package/dist/dist-Ac4o1O4a.js +0 -314
- package/dist/dist-DEJZ9iAU.js +0 -5
- package/dist/dist-DmVOCJjI.js +0 -5
- package/dist/styles-nvxFh6L6.js +0 -3557
- package/dist/templatical-editor.css +0 -2
- package/dist/templatical-editor.umd.cjs +0 -178
- package/dist/useEditorCore-ColJh1ST.js +0 -5695
- /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
- /package/dist/{de-Dh8ON-dm.js → de-CN0xu_Tp.js} +0 -0
- /package/dist/{emojiData-Qc8mH_zW.js → emojiData-CwKEDxVf.js} +0 -0
- /package/dist/{en-C7IShRSD.js → en-DXvHkaUF.js} +0 -0
- /package/dist/{formatRelativeTime-D8f6NR7i.js → formatRelativeTime-BSpx5DHC.js} +0 -0
- /package/dist/{readableTextColor-B809bF5J.js → readableTextColor-CYCxm1jQ.js} +0 -0
- /package/dist/{timeouts-CmBrLeZA.js → timeouts-BSGxjuUF.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Cn as e, Ct as t,
|
|
2
|
-
import { Link as se } from "./dist-
|
|
3
|
-
import { Underline as ce } from "./dist-
|
|
4
|
-
//#region ../../node_modules/.
|
|
1
|
+
import { Cn as e, Ct as t, Dn as n, En as r, Gt as i, Ht as a, Jt as o, Mt as s, Nt as c, Qt as l, Sn as u, St as d, Tn as f, Ut as p, Z as m, _ as ee, _n as h, at as g, bn as _, c as v, gn as te, hn as y, i as b, jt as x, nn as ne, ot as re, pn as S, rt as ie, u as C, v as ae, vn as w, wn as oe, xn as T, yn as E } from "./dist-BHgEdO-M.js";
|
|
2
|
+
import { Link as se } from "./dist-UZ8UzVZ-.js";
|
|
3
|
+
import { Underline as ce } from "./dist-Owxo48fF.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tiptap+core@3.22.5_@tiptap+pm@3.22.5/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
5
5
|
var D = (e, t) => {
|
|
6
6
|
if (e === "slot") return 0;
|
|
7
7
|
if (e instanceof Function) return e(t);
|
|
@@ -25,7 +25,7 @@ var D = (e, t) => {
|
|
|
25
25
|
},
|
|
26
26
|
renderHTML({ HTMLAttributes: e }) {
|
|
27
27
|
return /* @__PURE__ */ D("blockquote", {
|
|
28
|
-
...
|
|
28
|
+
...i(this.options.HTMLAttributes, e),
|
|
29
29
|
children: /* @__PURE__ */ D("slot", {})
|
|
30
30
|
});
|
|
31
31
|
},
|
|
@@ -52,12 +52,12 @@ var D = (e, t) => {
|
|
|
52
52
|
return { "Mod-Shift-b": () => this.editor.commands.toggleBlockquote() };
|
|
53
53
|
},
|
|
54
54
|
addInputRules() {
|
|
55
|
-
return [
|
|
55
|
+
return [y({
|
|
56
56
|
find: le,
|
|
57
57
|
type: this.type
|
|
58
58
|
})];
|
|
59
59
|
}
|
|
60
|
-
}), de = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, fe = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, pe = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, me = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, he =
|
|
60
|
+
}), de = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, fe = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, pe = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, me = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, he = v.create({
|
|
61
61
|
name: "bold",
|
|
62
62
|
addOptions() {
|
|
63
63
|
return { HTMLAttributes: {} };
|
|
@@ -81,7 +81,7 @@ var D = (e, t) => {
|
|
|
81
81
|
},
|
|
82
82
|
renderHTML({ HTMLAttributes: e }) {
|
|
83
83
|
return /* @__PURE__ */ D("strong", {
|
|
84
|
-
...
|
|
84
|
+
...i(this.options.HTMLAttributes, e),
|
|
85
85
|
children: /* @__PURE__ */ D("slot", {})
|
|
86
86
|
});
|
|
87
87
|
},
|
|
@@ -106,24 +106,24 @@ var D = (e, t) => {
|
|
|
106
106
|
};
|
|
107
107
|
},
|
|
108
108
|
addInputRules() {
|
|
109
|
-
return [
|
|
109
|
+
return [a({
|
|
110
110
|
find: de,
|
|
111
111
|
type: this.type
|
|
112
|
-
}),
|
|
112
|
+
}), a({
|
|
113
113
|
find: pe,
|
|
114
114
|
type: this.type
|
|
115
115
|
})];
|
|
116
116
|
},
|
|
117
117
|
addPasteRules() {
|
|
118
|
-
return [
|
|
118
|
+
return [p({
|
|
119
119
|
find: fe,
|
|
120
120
|
type: this.type
|
|
121
|
-
}),
|
|
121
|
+
}), p({
|
|
122
122
|
find: me,
|
|
123
123
|
type: this.type
|
|
124
124
|
})];
|
|
125
125
|
}
|
|
126
|
-
}), ge = /(^|[^`])`([^`]+)`(?!`)$/, _e = /(^|[^`])`([^`]+)`(?!`)/g, ve =
|
|
126
|
+
}), ge = /(^|[^`])`([^`]+)`(?!`)$/, _e = /(^|[^`])`([^`]+)`(?!`)/g, ve = v.create({
|
|
127
127
|
name: "code",
|
|
128
128
|
addOptions() {
|
|
129
129
|
return { HTMLAttributes: {} };
|
|
@@ -137,7 +137,7 @@ var D = (e, t) => {
|
|
|
137
137
|
renderHTML({ HTMLAttributes: e }) {
|
|
138
138
|
return [
|
|
139
139
|
"code",
|
|
140
|
-
|
|
140
|
+
i(this.options.HTMLAttributes, e),
|
|
141
141
|
0
|
|
142
142
|
];
|
|
143
143
|
},
|
|
@@ -158,13 +158,13 @@ var D = (e, t) => {
|
|
|
158
158
|
return { "Mod-e": () => this.editor.commands.toggleCode() };
|
|
159
159
|
},
|
|
160
160
|
addInputRules() {
|
|
161
|
-
return [
|
|
161
|
+
return [a({
|
|
162
162
|
find: ge,
|
|
163
163
|
type: this.type
|
|
164
164
|
})];
|
|
165
165
|
},
|
|
166
166
|
addPasteRules() {
|
|
167
|
-
return [
|
|
167
|
+
return [p({
|
|
168
168
|
find: _e,
|
|
169
169
|
type: this.type
|
|
170
170
|
})];
|
|
@@ -206,7 +206,7 @@ var D = (e, t) => {
|
|
|
206
206
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
207
207
|
return [
|
|
208
208
|
"pre",
|
|
209
|
-
|
|
209
|
+
i(this.options.HTMLAttributes, t),
|
|
210
210
|
[
|
|
211
211
|
"code",
|
|
212
212
|
{ class: e.attrs.language ? this.options.languageClassPrefix + e.attrs.language : null },
|
|
@@ -249,11 +249,11 @@ var D = (e, t) => {
|
|
|
249
249
|
return e.replaceWith(t, i, n.schema.text(a)), !0;
|
|
250
250
|
});
|
|
251
251
|
},
|
|
252
|
-
"Shift-Tab": ({ editor:
|
|
252
|
+
"Shift-Tab": ({ editor: t }) => {
|
|
253
253
|
if (!this.options.enableTabIndentation) return !1;
|
|
254
|
-
let
|
|
255
|
-
return
|
|
256
|
-
let { pos:
|
|
254
|
+
let n = this.options.tabSize ?? O, { state: r } = t, { selection: i } = r, { $from: a, empty: o } = i;
|
|
255
|
+
return a.parent.type === this.type ? o ? t.commands.command(({ tr: t }) => {
|
|
256
|
+
let { pos: i } = a, o = a.start(), s = a.end(), c = r.doc.textBetween(o, s, "\n", "\n").split("\n"), l = 0, u = 0, d = i - o;
|
|
257
257
|
for (let e = 0; e < c.length; e += 1) {
|
|
258
258
|
if (u + c[e].length >= d) {
|
|
259
259
|
l = e;
|
|
@@ -261,17 +261,17 @@ var D = (e, t) => {
|
|
|
261
261
|
}
|
|
262
262
|
u += c[e].length + 1;
|
|
263
263
|
}
|
|
264
|
-
let f = c[l].match(/^ */)?.[0] || "", p = Math.min(f.length,
|
|
264
|
+
let f = c[l].match(/^ */)?.[0] || "", p = Math.min(f.length, n);
|
|
265
265
|
if (p === 0) return !0;
|
|
266
|
-
let m =
|
|
266
|
+
let m = o;
|
|
267
267
|
for (let e = 0; e < l; e += 1) m += c[e].length + 1;
|
|
268
|
-
return
|
|
269
|
-
}) :
|
|
270
|
-
let { from:
|
|
271
|
-
let
|
|
268
|
+
return t.delete(m, m + p), i - m <= p && t.setSelection(e.create(t.doc, m)), !0;
|
|
269
|
+
}) : t.commands.command(({ tr: e }) => {
|
|
270
|
+
let { from: t, to: a } = i, o = r.doc.textBetween(t, a, "\n", "\n").split("\n").map((e) => {
|
|
271
|
+
let t = e.match(/^ */)?.[0] || "", r = Math.min(t.length, n);
|
|
272
272
|
return e.slice(r);
|
|
273
273
|
}).join("\n");
|
|
274
|
-
return e.replaceWith(
|
|
274
|
+
return e.replaceWith(t, a, r.schema.text(o)), !0;
|
|
275
275
|
}) : !1;
|
|
276
276
|
},
|
|
277
277
|
Enter: ({ editor: e }) => {
|
|
@@ -286,30 +286,30 @@ var D = (e, t) => {
|
|
|
286
286
|
let { state: t } = e, { selection: n, doc: r } = t, { $from: i, empty: a } = n;
|
|
287
287
|
if (!a || i.parent.type !== this.type || i.parentOffset !== i.parent.nodeSize - 2) return !1;
|
|
288
288
|
let o = i.after();
|
|
289
|
-
return o === void 0 ? !1 : r.nodeAt(o) ? e.commands.command(({ tr: e }) => (e.setSelection(
|
|
289
|
+
return o === void 0 ? !1 : r.nodeAt(o) ? e.commands.command(({ tr: e }) => (e.setSelection(u.near(r.resolve(o))), !0)) : e.commands.exitCode();
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
292
|
},
|
|
293
293
|
addInputRules() {
|
|
294
|
-
return [
|
|
294
|
+
return [S({
|
|
295
295
|
find: ye,
|
|
296
296
|
type: this.type,
|
|
297
297
|
getAttributes: (e) => ({ language: e[1] })
|
|
298
|
-
}),
|
|
298
|
+
}), S({
|
|
299
299
|
find: be,
|
|
300
300
|
type: this.type,
|
|
301
301
|
getAttributes: (e) => ({ language: e[1] })
|
|
302
302
|
})];
|
|
303
303
|
},
|
|
304
304
|
addProseMirrorPlugins() {
|
|
305
|
-
return [new
|
|
306
|
-
key: new
|
|
307
|
-
props: { handlePaste: (
|
|
308
|
-
if (!
|
|
309
|
-
let
|
|
310
|
-
if (!
|
|
311
|
-
let { tr:
|
|
312
|
-
return
|
|
305
|
+
return [new _({
|
|
306
|
+
key: new T("codeBlockVSCodeHandler"),
|
|
307
|
+
props: { handlePaste: (t, n) => {
|
|
308
|
+
if (!n.clipboardData || this.editor.isActive(this.type.name)) return !1;
|
|
309
|
+
let r = n.clipboardData.getData("text/plain"), i = n.clipboardData.getData("vscode-editor-data"), a = (i ? JSON.parse(i) : void 0)?.mode;
|
|
310
|
+
if (!r || !a) return !1;
|
|
311
|
+
let { tr: o, schema: s } = t.state, c = s.text(r.replace(/\r\n?/g, "\n"));
|
|
312
|
+
return o.replaceSelectionWith(this.type.create({ language: a }, c)), o.selection.$from.parent.type !== this.type && o.setSelection(e.near(o.doc.resolve(Math.max(0, o.selection.from - 2)))), o.setMeta("paste", !0), t.dispatch(o), !0;
|
|
313
313
|
} }
|
|
314
314
|
})];
|
|
315
315
|
}
|
|
@@ -335,7 +335,7 @@ var D = (e, t) => {
|
|
|
335
335
|
return [{ tag: "br" }];
|
|
336
336
|
},
|
|
337
337
|
renderHTML({ HTMLAttributes: e }) {
|
|
338
|
-
return ["br",
|
|
338
|
+
return ["br", i(this.options.HTMLAttributes, e)];
|
|
339
339
|
},
|
|
340
340
|
renderText() {
|
|
341
341
|
return "\n";
|
|
@@ -395,7 +395,7 @@ var D = (e, t) => {
|
|
|
395
395
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
396
396
|
return [
|
|
397
397
|
`h${this.options.levels.includes(e.attrs.level) ? e.attrs.level : this.options.levels[0]}`,
|
|
398
|
-
|
|
398
|
+
i(this.options.HTMLAttributes, t),
|
|
399
399
|
0
|
|
400
400
|
];
|
|
401
401
|
},
|
|
@@ -417,7 +417,7 @@ var D = (e, t) => {
|
|
|
417
417
|
}), {});
|
|
418
418
|
},
|
|
419
419
|
addInputRules() {
|
|
420
|
-
return this.options.levels.map((e) =>
|
|
420
|
+
return this.options.levels.map((e) => S({
|
|
421
421
|
find: RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),
|
|
422
422
|
type: this.type,
|
|
423
423
|
getAttributes: { level: e }
|
|
@@ -436,36 +436,36 @@ var D = (e, t) => {
|
|
|
436
436
|
return [{ tag: "hr" }];
|
|
437
437
|
},
|
|
438
438
|
renderHTML({ HTMLAttributes: e }) {
|
|
439
|
-
return ["hr",
|
|
439
|
+
return ["hr", i(this.options.HTMLAttributes, e)];
|
|
440
440
|
},
|
|
441
441
|
markdownTokenName: "hr",
|
|
442
442
|
parseMarkdown: (e, t) => t.createNode("horizontalRule"),
|
|
443
443
|
renderMarkdown: () => "---",
|
|
444
444
|
addCommands() {
|
|
445
|
-
return { setHorizontalRule: () => ({ chain:
|
|
446
|
-
if (!ae(
|
|
447
|
-
let { selection:
|
|
448
|
-
return
|
|
449
|
-
if (
|
|
450
|
-
let { $to:
|
|
451
|
-
if (
|
|
445
|
+
return { setHorizontalRule: () => ({ chain: t, state: n }) => {
|
|
446
|
+
if (!ae(n, n.schema.nodes[this.name])) return !1;
|
|
447
|
+
let { selection: r } = n, { $to: i } = r, a = t();
|
|
448
|
+
return c(r) ? a.insertContentAt(i.pos, { type: this.name }) : a.insertContent({ type: this.name }), a.command(({ state: t, tr: n, dispatch: r }) => {
|
|
449
|
+
if (r) {
|
|
450
|
+
let { $to: r } = n.selection, i = r.end();
|
|
451
|
+
if (r.nodeAfter) r.nodeAfter.isTextblock ? n.setSelection(e.create(n.doc, r.pos + 1)) : r.nodeAfter.isBlock ? n.setSelection(E.create(n.doc, r.pos)) : n.setSelection(e.create(n.doc, r.pos));
|
|
452
452
|
else {
|
|
453
|
-
let
|
|
454
|
-
|
|
453
|
+
let a = (t.schema.nodes[this.options.nextNodeType] || r.parent.type.contentMatch.defaultType)?.create();
|
|
454
|
+
a && (n.insert(i, a), n.setSelection(e.create(n.doc, i + 1)));
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
n.scrollIntoView();
|
|
457
457
|
}
|
|
458
458
|
return !0;
|
|
459
459
|
}).run();
|
|
460
460
|
} };
|
|
461
461
|
},
|
|
462
462
|
addInputRules() {
|
|
463
|
-
return [
|
|
463
|
+
return [o({
|
|
464
464
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
465
465
|
type: this.type
|
|
466
466
|
})];
|
|
467
467
|
}
|
|
468
|
-
}), Ee = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, De = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Oe = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, ke = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ae =
|
|
468
|
+
}), Ee = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, De = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Oe = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, ke = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ae = v.create({
|
|
469
469
|
name: "italic",
|
|
470
470
|
addOptions() {
|
|
471
471
|
return { HTMLAttributes: {} };
|
|
@@ -487,7 +487,7 @@ var D = (e, t) => {
|
|
|
487
487
|
renderHTML({ HTMLAttributes: e }) {
|
|
488
488
|
return [
|
|
489
489
|
"em",
|
|
490
|
-
|
|
490
|
+
i(this.options.HTMLAttributes, e),
|
|
491
491
|
0
|
|
492
492
|
];
|
|
493
493
|
},
|
|
@@ -512,19 +512,19 @@ var D = (e, t) => {
|
|
|
512
512
|
};
|
|
513
513
|
},
|
|
514
514
|
addInputRules() {
|
|
515
|
-
return [
|
|
515
|
+
return [a({
|
|
516
516
|
find: Ee,
|
|
517
517
|
type: this.type
|
|
518
|
-
}),
|
|
518
|
+
}), a({
|
|
519
519
|
find: Oe,
|
|
520
520
|
type: this.type
|
|
521
521
|
})];
|
|
522
522
|
},
|
|
523
523
|
addPasteRules() {
|
|
524
|
-
return [
|
|
524
|
+
return [p({
|
|
525
525
|
find: De,
|
|
526
526
|
type: this.type
|
|
527
|
-
}),
|
|
527
|
+
}), p({
|
|
528
528
|
find: ke,
|
|
529
529
|
type: this.type
|
|
530
530
|
})];
|
|
@@ -554,7 +554,7 @@ var D = (e, t) => {
|
|
|
554
554
|
renderHTML({ HTMLAttributes: e }) {
|
|
555
555
|
return [
|
|
556
556
|
"ul",
|
|
557
|
-
|
|
557
|
+
i(this.options.HTMLAttributes, e),
|
|
558
558
|
0
|
|
559
559
|
];
|
|
560
560
|
},
|
|
@@ -572,11 +572,11 @@ var D = (e, t) => {
|
|
|
572
572
|
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
573
573
|
},
|
|
574
574
|
addInputRules() {
|
|
575
|
-
let e =
|
|
575
|
+
let e = y({
|
|
576
576
|
find: A,
|
|
577
577
|
type: this.type
|
|
578
578
|
});
|
|
579
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
579
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = y({
|
|
580
580
|
find: A,
|
|
581
581
|
type: this.type,
|
|
582
582
|
keepMarks: this.options.keepMarks,
|
|
@@ -602,7 +602,7 @@ var D = (e, t) => {
|
|
|
602
602
|
renderHTML({ HTMLAttributes: e }) {
|
|
603
603
|
return [
|
|
604
604
|
"li",
|
|
605
|
-
|
|
605
|
+
i(this.options.HTMLAttributes, e),
|
|
606
606
|
0
|
|
607
607
|
];
|
|
608
608
|
},
|
|
@@ -631,7 +631,7 @@ var D = (e, t) => {
|
|
|
631
631
|
content: r
|
|
632
632
|
};
|
|
633
633
|
},
|
|
634
|
-
renderMarkdown: (e, t, n) =>
|
|
634
|
+
renderMarkdown: (e, t, n) => ne(e, t, (e) => e.parentType === "bulletList" ? "- " : e.parentType === "orderedList" ? `${(e.meta?.parentAttrs?.start || 1) + e.index}. ` : "- ", n),
|
|
635
635
|
addKeyboardShortcuts() {
|
|
636
636
|
return {
|
|
637
637
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -643,17 +643,17 @@ var D = (e, t) => {
|
|
|
643
643
|
Me({}, {
|
|
644
644
|
findListItemPos: () => N,
|
|
645
645
|
getNextListDepth: () => P,
|
|
646
|
-
handleBackspace: () =>
|
|
647
|
-
handleDelete: () =>
|
|
646
|
+
handleBackspace: () => L,
|
|
647
|
+
handleDelete: () => R,
|
|
648
648
|
hasListBefore: () => F,
|
|
649
|
-
hasListItemAfter: () =>
|
|
649
|
+
hasListItemAfter: () => Le,
|
|
650
650
|
hasListItemBefore: () => I,
|
|
651
|
-
listItemHasSubList: () =>
|
|
652
|
-
nextListIsDeeper: () =>
|
|
653
|
-
nextListIsHigher: () =>
|
|
651
|
+
listItemHasSubList: () => Pe,
|
|
652
|
+
nextListIsDeeper: () => Fe,
|
|
653
|
+
nextListIsHigher: () => Ie
|
|
654
654
|
});
|
|
655
655
|
var N = (e, t) => {
|
|
656
|
-
let { $from: n } = t.selection, r =
|
|
656
|
+
let { $from: n } = t.selection, r = g(e, t.schema), i = null, a = n.depth, o = n.pos, s = null;
|
|
657
657
|
for (; a > 0 && s === null;) i = n.node(a), i.type === r ? s = a : (--a, --o);
|
|
658
658
|
return s === null ? null : {
|
|
659
659
|
$pos: t.doc.resolve(o),
|
|
@@ -670,16 +670,16 @@ var N = (e, t) => {
|
|
|
670
670
|
}, I = (e, t) => {
|
|
671
671
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - 2);
|
|
672
672
|
return !(r.index() === 0 || r.nodeBefore?.type.name !== e);
|
|
673
|
-
},
|
|
673
|
+
}, Pe = (e, t, n) => {
|
|
674
674
|
if (!n) return !1;
|
|
675
|
-
let r =
|
|
675
|
+
let r = g(e, t.schema), i = !1;
|
|
676
676
|
return n.descendants((e) => {
|
|
677
677
|
e.type === r && (i = !0);
|
|
678
678
|
}), i;
|
|
679
|
-
},
|
|
679
|
+
}, L = (e, n, r) => {
|
|
680
680
|
if (e.commands.undoInputRule()) return !0;
|
|
681
681
|
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
682
|
-
if (!
|
|
682
|
+
if (!x(e.state, n) && F(e.state, n, r)) {
|
|
683
683
|
let { $anchor: t } = e.state.selection, r = e.state.doc.resolve(t.before() - 1), i = [];
|
|
684
684
|
r.node().descendants((e, t) => {
|
|
685
685
|
e.type.name === n && i.push({
|
|
@@ -695,25 +695,25 @@ var N = (e, t) => {
|
|
|
695
695
|
to: t.end() + 1
|
|
696
696
|
}, o.end()).joinForward().run();
|
|
697
697
|
}
|
|
698
|
-
if (!
|
|
698
|
+
if (!x(e.state, n) || !t(e.state)) return !1;
|
|
699
699
|
let i = N(n, e.state);
|
|
700
700
|
if (!i) return !1;
|
|
701
|
-
let a = e.state.doc.resolve(i.$pos.pos - 2).node(i.depth), o =
|
|
701
|
+
let a = e.state.doc.resolve(i.$pos.pos - 2).node(i.depth), o = Pe(n, e.state, a);
|
|
702
702
|
return I(n, e.state) && !o ? e.commands.joinItemBackward() : e.chain().liftListItem(n).run();
|
|
703
|
-
},
|
|
703
|
+
}, Fe = (e, t) => {
|
|
704
704
|
let n = P(e, t), r = N(e, t);
|
|
705
705
|
return !r || !n ? !1 : n > r.depth;
|
|
706
|
-
},
|
|
706
|
+
}, Ie = (e, t) => {
|
|
707
707
|
let n = P(e, t), r = N(e, t);
|
|
708
708
|
return !r || !n ? !1 : n < r.depth;
|
|
709
|
-
},
|
|
710
|
-
if (!
|
|
709
|
+
}, R = (e, t) => {
|
|
710
|
+
if (!x(e.state, t) || !d(e.state, t)) return !1;
|
|
711
711
|
let { selection: n } = e.state, { $from: r, $to: i } = n;
|
|
712
|
-
return !n.empty && r.sameParent(i) ? !1 :
|
|
713
|
-
},
|
|
712
|
+
return !n.empty && r.sameParent(i) ? !1 : Fe(t, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(t).joinBackward().run() : Ie(t, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
713
|
+
}, Le = (e, t) => {
|
|
714
714
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - n.parentOffset - 2);
|
|
715
715
|
return !(r.index() === r.parent.childCount - 1 || r.nodeAfter?.type.name !== e);
|
|
716
|
-
},
|
|
716
|
+
}, Re = b.create({
|
|
717
717
|
name: "listKeymap",
|
|
718
718
|
addOptions() {
|
|
719
719
|
return { listTypes: [{
|
|
@@ -729,35 +729,35 @@ var N = (e, t) => {
|
|
|
729
729
|
Delete: ({ editor: e }) => {
|
|
730
730
|
let t = !1;
|
|
731
731
|
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
732
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
732
|
+
e.state.schema.nodes[n] !== void 0 && R(e, n) && (t = !0);
|
|
733
733
|
}), t;
|
|
734
734
|
},
|
|
735
735
|
"Mod-Delete": ({ editor: e }) => {
|
|
736
736
|
let t = !1;
|
|
737
737
|
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
738
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
738
|
+
e.state.schema.nodes[n] !== void 0 && R(e, n) && (t = !0);
|
|
739
739
|
}), t;
|
|
740
740
|
},
|
|
741
741
|
Backspace: ({ editor: e }) => {
|
|
742
742
|
let t = !1;
|
|
743
743
|
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
744
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
744
|
+
e.state.schema.nodes[n] !== void 0 && L(e, n, r) && (t = !0);
|
|
745
745
|
}), t;
|
|
746
746
|
},
|
|
747
747
|
"Mod-Backspace": ({ editor: e }) => {
|
|
748
748
|
let t = !1;
|
|
749
749
|
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
750
|
-
e.state.schema.nodes[n] !== void 0 &&
|
|
750
|
+
e.state.schema.nodes[n] !== void 0 && L(e, n, r) && (t = !0);
|
|
751
751
|
}), t;
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
}),
|
|
756
|
-
function
|
|
755
|
+
}), ze = /^(\s*)(\d+)\.\s+(.*)$/, Be = /^\s/;
|
|
756
|
+
function Ve(e) {
|
|
757
757
|
let t = e.trimStart();
|
|
758
758
|
return /^[-+*]\s+/.test(t) || /^\d+\.\s+/.test(t) || /^>\s?/.test(t) || /^```/.test(t) || /^~~~/.test(t);
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function He(e) {
|
|
761
761
|
let t = [], n = [], r = !1;
|
|
762
762
|
return e.forEach((e) => {
|
|
763
763
|
if (r) {
|
|
@@ -768,7 +768,7 @@ function Ve(e) {
|
|
|
768
768
|
r = !0, n.push(e);
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
|
-
if (t.length > 0 &&
|
|
771
|
+
if (t.length > 0 && Ve(e)) {
|
|
772
772
|
r = !0, n.push(e);
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
@@ -778,17 +778,17 @@ function Ve(e) {
|
|
|
778
778
|
blockLines: n
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function Ue(e) {
|
|
782
782
|
let t = [], n = 0, r = 0;
|
|
783
783
|
for (; n < e.length;) {
|
|
784
|
-
let i = e[n], a = i.match(
|
|
784
|
+
let i = e[n], a = i.match(ze);
|
|
785
785
|
if (!a) break;
|
|
786
786
|
let [, o, s, c] = a, l = o.length, u = [c], d = n + 1, f = [i], p = !1;
|
|
787
787
|
for (; d < e.length;) {
|
|
788
788
|
let t = e[d];
|
|
789
|
-
if (t.match(
|
|
789
|
+
if (t.match(ze)) break;
|
|
790
790
|
if (t.trim() === "") f.push(t), u.push(""), p = !0, d += 1;
|
|
791
|
-
else if (t.match(
|
|
791
|
+
else if (t.match(Be)) f.push(t), u.push(t.slice(l + 2)), d += 1;
|
|
792
792
|
else {
|
|
793
793
|
if (p) break;
|
|
794
794
|
f.push(t), u.push(t), d += 1;
|
|
@@ -804,12 +804,12 @@ function He(e) {
|
|
|
804
804
|
}
|
|
805
805
|
return [t, r];
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function We(e, t, n) {
|
|
808
808
|
let r = [], i = 0;
|
|
809
809
|
for (; i < e.length;) {
|
|
810
810
|
let a = e[i];
|
|
811
811
|
if (a.indent === t) {
|
|
812
|
-
let { paragraphLines: o, blockLines: s } =
|
|
812
|
+
let { paragraphLines: o, blockLines: s } = He(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
813
813
|
c && l.push({
|
|
814
814
|
type: "paragraph",
|
|
815
815
|
raw: c,
|
|
@@ -823,7 +823,7 @@ function Ue(e, t, n) {
|
|
|
823
823
|
let d = i + 1, f = [];
|
|
824
824
|
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
825
825
|
if (f.length > 0) {
|
|
826
|
-
let e =
|
|
826
|
+
let e = We(f, Math.min(...f.map((e) => e.indent)), n);
|
|
827
827
|
l.push({
|
|
828
828
|
type: "list",
|
|
829
829
|
ordered: !0,
|
|
@@ -841,7 +841,7 @@ function Ue(e, t, n) {
|
|
|
841
841
|
}
|
|
842
842
|
return r;
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Ge(e, t) {
|
|
845
845
|
return e.map((e) => {
|
|
846
846
|
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
847
847
|
let n = [];
|
|
@@ -863,7 +863,7 @@ function We(e, t) {
|
|
|
863
863
|
};
|
|
864
864
|
});
|
|
865
865
|
}
|
|
866
|
-
var
|
|
866
|
+
var Ke = "listItem", qe = "textStyle", Je = /^(\d+)\.\s$/, Ye = C.create({
|
|
867
867
|
name: "orderedList",
|
|
868
868
|
addOptions() {
|
|
869
869
|
return {
|
|
@@ -896,18 +896,18 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
896
896
|
let { start: t, ...n } = e;
|
|
897
897
|
return t === 1 ? [
|
|
898
898
|
"ol",
|
|
899
|
-
|
|
899
|
+
i(this.options.HTMLAttributes, n),
|
|
900
900
|
0
|
|
901
901
|
] : [
|
|
902
902
|
"ol",
|
|
903
|
-
|
|
903
|
+
i(this.options.HTMLAttributes, e),
|
|
904
904
|
0
|
|
905
905
|
];
|
|
906
906
|
},
|
|
907
907
|
markdownTokenName: "list",
|
|
908
908
|
parseMarkdown: (e, t) => {
|
|
909
909
|
if (e.type !== "list" || !e.ordered) return [];
|
|
910
|
-
let n = e.start || 1, r = e.items ?
|
|
910
|
+
let n = e.start || 1, r = e.items ? Ge(e.items, t) : [];
|
|
911
911
|
return n === 1 ? {
|
|
912
912
|
type: "orderedList",
|
|
913
913
|
content: r
|
|
@@ -926,9 +926,9 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
926
926
|
return t === void 0 ? -1 : t;
|
|
927
927
|
},
|
|
928
928
|
tokenize: (e, t, n) => {
|
|
929
|
-
let r = e.split("\n"), [i, a] =
|
|
929
|
+
let r = e.split("\n"), [i, a] = Ue(r);
|
|
930
930
|
if (i.length === 0) return;
|
|
931
|
-
let o =
|
|
931
|
+
let o = We(i, 0, n);
|
|
932
932
|
if (o.length !== 0) return {
|
|
933
933
|
type: "list",
|
|
934
934
|
ordered: !0,
|
|
@@ -940,32 +940,32 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
940
940
|
},
|
|
941
941
|
markdownOptions: { indentsContent: !0 },
|
|
942
942
|
addCommands() {
|
|
943
|
-
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
943
|
+
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ke, this.editor.getAttributes(qe)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
944
944
|
},
|
|
945
945
|
addKeyboardShortcuts() {
|
|
946
946
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
947
947
|
},
|
|
948
948
|
addInputRules() {
|
|
949
|
-
let e =
|
|
950
|
-
find:
|
|
949
|
+
let e = y({
|
|
950
|
+
find: Je,
|
|
951
951
|
type: this.type,
|
|
952
952
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
953
953
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
954
954
|
});
|
|
955
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
956
|
-
find:
|
|
955
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = y({
|
|
956
|
+
find: Je,
|
|
957
957
|
type: this.type,
|
|
958
958
|
keepMarks: this.options.keepMarks,
|
|
959
959
|
keepAttributes: this.options.keepAttributes,
|
|
960
960
|
getAttributes: (e) => ({
|
|
961
961
|
start: +e[1],
|
|
962
|
-
...this.editor.getAttributes(
|
|
962
|
+
...this.editor.getAttributes(qe)
|
|
963
963
|
}),
|
|
964
964
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
|
|
965
965
|
editor: this.editor
|
|
966
966
|
})), [e];
|
|
967
967
|
}
|
|
968
|
-
}),
|
|
968
|
+
}), Xe = /^\s*(\[([( |x])?\])\s$/, Ze = C.create({
|
|
969
969
|
name: "taskItem",
|
|
970
970
|
addOptions() {
|
|
971
971
|
return {
|
|
@@ -999,7 +999,7 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
999
999
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
1000
1000
|
return [
|
|
1001
1001
|
"li",
|
|
1002
|
-
|
|
1002
|
+
i(this.options.HTMLAttributes, t, { "data-type": this.name }),
|
|
1003
1003
|
[
|
|
1004
1004
|
"label",
|
|
1005
1005
|
["input", {
|
|
@@ -1019,7 +1019,7 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1019
1019
|
}
|
|
1020
1020
|
return t.createNode("taskItem", { checked: e.checked || !1 }, n);
|
|
1021
1021
|
},
|
|
1022
|
-
renderMarkdown: (e, t) =>
|
|
1022
|
+
renderMarkdown: (e, t) => ne(e, t, `- [${e.attrs?.checked ? "x" : " "}] `),
|
|
1023
1023
|
addKeyboardShortcuts() {
|
|
1024
1024
|
let e = {
|
|
1025
1025
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -1063,7 +1063,7 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1063
1063
|
update: (e) => {
|
|
1064
1064
|
if (e.type !== this.type) return !1;
|
|
1065
1065
|
i.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, l(e);
|
|
1066
|
-
let t = r.extensionManager.attributes, n =
|
|
1066
|
+
let t = r.extensionManager.attributes, n = re(e, t), a = new Set(Object.keys(n)), o = this.options.HTMLAttributes;
|
|
1067
1067
|
return u.forEach((e) => {
|
|
1068
1068
|
a.has(e) || (e in o ? i.setAttribute(e, o[e]) : i.removeAttribute(e));
|
|
1069
1069
|
}), Object.entries(n).forEach(([e, t]) => {
|
|
@@ -1074,13 +1074,13 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1074
1074
|
};
|
|
1075
1075
|
},
|
|
1076
1076
|
addInputRules() {
|
|
1077
|
-
return [
|
|
1078
|
-
find:
|
|
1077
|
+
return [y({
|
|
1078
|
+
find: Xe,
|
|
1079
1079
|
type: this.type,
|
|
1080
1080
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
1081
1081
|
})];
|
|
1082
1082
|
}
|
|
1083
|
-
}),
|
|
1083
|
+
}), Qe = C.create({
|
|
1084
1084
|
name: "taskList",
|
|
1085
1085
|
addOptions() {
|
|
1086
1086
|
return {
|
|
@@ -1101,7 +1101,7 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1101
1101
|
renderHTML({ HTMLAttributes: e }) {
|
|
1102
1102
|
return [
|
|
1103
1103
|
"ul",
|
|
1104
|
-
|
|
1104
|
+
i(this.options.HTMLAttributes, e, { "data-type": this.name }),
|
|
1105
1105
|
0
|
|
1106
1106
|
];
|
|
1107
1107
|
},
|
|
@@ -1116,7 +1116,7 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1116
1116
|
},
|
|
1117
1117
|
tokenize(e, t, n) {
|
|
1118
1118
|
let r = (e) => {
|
|
1119
|
-
let t =
|
|
1119
|
+
let t = l(e, {
|
|
1120
1120
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1121
1121
|
extractItemData: (e) => ({
|
|
1122
1122
|
indentLevel: e[1].length,
|
|
@@ -1140,7 +1140,7 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1140
1140
|
raw: t.raw,
|
|
1141
1141
|
items: t.items
|
|
1142
1142
|
}] : n.blockTokens(e);
|
|
1143
|
-
}, i =
|
|
1143
|
+
}, i = l(e, {
|
|
1144
1144
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1145
1145
|
extractItemData: (e) => ({
|
|
1146
1146
|
indentLevel: e[1].length,
|
|
@@ -1174,16 +1174,16 @@ var Ge = "listItem", Ke = "textStyle", qe = /^(\d+)\.\s$/, Je = C.create({
|
|
|
1174
1174
|
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
|
|
1175
1175
|
}
|
|
1176
1176
|
});
|
|
1177
|
-
|
|
1177
|
+
b.create({
|
|
1178
1178
|
name: "listKit",
|
|
1179
1179
|
addExtensions() {
|
|
1180
1180
|
let e = [];
|
|
1181
|
-
return this.options.bulletList !== !1 && e.push(j.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(M.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(
|
|
1181
|
+
return this.options.bulletList !== !1 && e.push(j.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(M.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Re.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Ye.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push(Ze.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(Qe.configure(this.options.taskList)), e;
|
|
1182
1182
|
}
|
|
1183
1183
|
});
|
|
1184
1184
|
//#endregion
|
|
1185
|
-
//#region ../../node_modules/.
|
|
1186
|
-
var
|
|
1185
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5_/node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
1186
|
+
var z = " ", B = "\xA0", $e = C.create({
|
|
1187
1187
|
name: "paragraph",
|
|
1188
1188
|
priority: 1e3,
|
|
1189
1189
|
addOptions() {
|
|
@@ -1197,7 +1197,7 @@ var B = " ", V = "\xA0", Qe = C.create({
|
|
|
1197
1197
|
renderHTML({ HTMLAttributes: e }) {
|
|
1198
1198
|
return [
|
|
1199
1199
|
"p",
|
|
1200
|
-
|
|
1200
|
+
i(this.options.HTMLAttributes, e),
|
|
1201
1201
|
0
|
|
1202
1202
|
];
|
|
1203
1203
|
},
|
|
@@ -1205,14 +1205,14 @@ var B = " ", V = "\xA0", Qe = C.create({
|
|
|
1205
1205
|
let n = e.tokens || [];
|
|
1206
1206
|
if (n.length === 1 && n[0].type === "image") return t.parseChildren([n[0]]);
|
|
1207
1207
|
let r = t.parseInline(n);
|
|
1208
|
-
return n.length === 1 && n[0].type === "text" && (n[0].raw ===
|
|
1208
|
+
return n.length === 1 && n[0].type === "text" && (n[0].raw === z || n[0].text === z || n[0].raw === B || n[0].text === B) && r.length === 1 && r[0].type === "text" && (r[0].text === z || r[0].text === B) ? t.createNode("paragraph", void 0, []) : t.createNode("paragraph", void 0, r);
|
|
1209
1209
|
},
|
|
1210
1210
|
renderMarkdown: (e, t, n) => {
|
|
1211
1211
|
if (!e) return "";
|
|
1212
1212
|
let r = Array.isArray(e.content) ? e.content : [];
|
|
1213
1213
|
if (r.length === 0) {
|
|
1214
1214
|
let e = Array.isArray(n?.previousNode?.content) ? n.previousNode.content : [];
|
|
1215
|
-
return n?.previousNode?.type === "paragraph" && e.length === 0 ?
|
|
1215
|
+
return n?.previousNode?.type === "paragraph" && e.length === 0 ? z : "";
|
|
1216
1216
|
}
|
|
1217
1217
|
return t.renderChildren(r);
|
|
1218
1218
|
},
|
|
@@ -1222,7 +1222,7 @@ var B = " ", V = "\xA0", Qe = C.create({
|
|
|
1222
1222
|
addKeyboardShortcuts() {
|
|
1223
1223
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
1224
1224
|
}
|
|
1225
|
-
}),
|
|
1225
|
+
}), et = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, tt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, nt = v.create({
|
|
1226
1226
|
name: "strike",
|
|
1227
1227
|
addOptions() {
|
|
1228
1228
|
return { HTMLAttributes: {} };
|
|
@@ -1242,7 +1242,7 @@ var B = " ", V = "\xA0", Qe = C.create({
|
|
|
1242
1242
|
renderHTML({ HTMLAttributes: e }) {
|
|
1243
1243
|
return [
|
|
1244
1244
|
"s",
|
|
1245
|
-
|
|
1245
|
+
i(this.options.HTMLAttributes, e),
|
|
1246
1246
|
0
|
|
1247
1247
|
];
|
|
1248
1248
|
},
|
|
@@ -1260,18 +1260,18 @@ var B = " ", V = "\xA0", Qe = C.create({
|
|
|
1260
1260
|
return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
|
|
1261
1261
|
},
|
|
1262
1262
|
addInputRules() {
|
|
1263
|
-
return [
|
|
1264
|
-
find:
|
|
1263
|
+
return [a({
|
|
1264
|
+
find: et,
|
|
1265
1265
|
type: this.type
|
|
1266
1266
|
})];
|
|
1267
1267
|
},
|
|
1268
1268
|
addPasteRules() {
|
|
1269
|
-
return [
|
|
1270
|
-
find:
|
|
1269
|
+
return [p({
|
|
1270
|
+
find: tt,
|
|
1271
1271
|
type: this.type
|
|
1272
1272
|
})];
|
|
1273
1273
|
}
|
|
1274
|
-
}),
|
|
1274
|
+
}), rt = C.create({
|
|
1275
1275
|
name: "text",
|
|
1276
1276
|
group: "inline",
|
|
1277
1277
|
parseMarkdown: (e) => ({
|
|
@@ -1281,13 +1281,13 @@ var B = " ", V = "\xA0", Qe = C.create({
|
|
|
1281
1281
|
renderMarkdown: (e) => e.text || ""
|
|
1282
1282
|
});
|
|
1283
1283
|
//#endregion
|
|
1284
|
-
//#region ../../node_modules/.
|
|
1285
|
-
function
|
|
1286
|
-
return new
|
|
1287
|
-
return new
|
|
1284
|
+
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
|
|
1285
|
+
function it(e = {}) {
|
|
1286
|
+
return new _({ view(t) {
|
|
1287
|
+
return new at(t, e);
|
|
1288
1288
|
} });
|
|
1289
1289
|
}
|
|
1290
|
-
var
|
|
1290
|
+
var at = class {
|
|
1291
1291
|
constructor(e, t) {
|
|
1292
1292
|
this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
|
|
1293
1293
|
"dragover",
|
|
@@ -1363,7 +1363,7 @@ var it = class {
|
|
|
1363
1363
|
if (t && !i) {
|
|
1364
1364
|
let e = t.pos;
|
|
1365
1365
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
1366
|
-
let t =
|
|
1366
|
+
let t = f(this.editorView.state.doc, e, this.editorView.dragging.slice);
|
|
1367
1367
|
t != null && (e = t);
|
|
1368
1368
|
}
|
|
1369
1369
|
this.setCursor(e), this.scheduleRemoval(5e3);
|
|
@@ -1378,13 +1378,13 @@ var it = class {
|
|
|
1378
1378
|
dragleave(e) {
|
|
1379
1379
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
1380
1380
|
}
|
|
1381
|
-
},
|
|
1381
|
+
}, V = class e extends u {
|
|
1382
1382
|
constructor(e) {
|
|
1383
1383
|
super(e, e);
|
|
1384
1384
|
}
|
|
1385
1385
|
map(t, n) {
|
|
1386
1386
|
let r = t.resolve(n.map(this.head));
|
|
1387
|
-
return e.valid(r) ? new e(r) :
|
|
1387
|
+
return e.valid(r) ? new e(r) : u.near(r);
|
|
1388
1388
|
}
|
|
1389
1389
|
content() {
|
|
1390
1390
|
return n.empty;
|
|
@@ -1403,11 +1403,11 @@ var it = class {
|
|
|
1403
1403
|
return new e(t.resolve(n.pos));
|
|
1404
1404
|
}
|
|
1405
1405
|
getBookmark() {
|
|
1406
|
-
return new
|
|
1406
|
+
return new ot(this.anchor);
|
|
1407
1407
|
}
|
|
1408
1408
|
static valid(e) {
|
|
1409
1409
|
let t = e.parent;
|
|
1410
|
-
if (t.inlineContent || !
|
|
1410
|
+
if (t.inlineContent || !ct(e) || !lt(e)) return !1;
|
|
1411
1411
|
let n = t.type.spec.allowGapCursor;
|
|
1412
1412
|
if (n != null) return n;
|
|
1413
1413
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
@@ -1430,7 +1430,7 @@ var it = class {
|
|
|
1430
1430
|
for (;;) {
|
|
1431
1431
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
1432
1432
|
if (!o) {
|
|
1433
|
-
if (a.isAtom && !a.isText && !
|
|
1433
|
+
if (a.isAtom && !a.isText && !E.isSelectable(a)) {
|
|
1434
1434
|
t = t.doc.resolve(i + a.nodeSize * n), r = !1;
|
|
1435
1435
|
continue search;
|
|
1436
1436
|
}
|
|
@@ -1444,8 +1444,8 @@ var it = class {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
1446
|
};
|
|
1447
|
-
|
|
1448
|
-
var
|
|
1447
|
+
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom, u.jsonID("gapcursor", V);
|
|
1448
|
+
var ot = class e {
|
|
1449
1449
|
constructor(e) {
|
|
1450
1450
|
this.pos = e;
|
|
1451
1451
|
}
|
|
@@ -1454,13 +1454,13 @@ var at = class e {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
resolve(e) {
|
|
1456
1456
|
let t = e.resolve(this.pos);
|
|
1457
|
-
return
|
|
1457
|
+
return V.valid(t) ? new V(t) : u.near(t);
|
|
1458
1458
|
}
|
|
1459
1459
|
};
|
|
1460
|
-
function
|
|
1460
|
+
function st(e) {
|
|
1461
1461
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
1462
1462
|
}
|
|
1463
|
-
function
|
|
1463
|
+
function ct(e) {
|
|
1464
1464
|
for (let t = e.depth; t >= 0; t--) {
|
|
1465
1465
|
let n = e.index(t), r = e.node(t);
|
|
1466
1466
|
if (n == 0) {
|
|
@@ -1468,13 +1468,13 @@ function st(e) {
|
|
|
1468
1468
|
continue;
|
|
1469
1469
|
}
|
|
1470
1470
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
1471
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1471
|
+
if (e.childCount == 0 && !e.inlineContent || st(e.type)) return !0;
|
|
1472
1472
|
if (e.inlineContent) return !1;
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
1475
|
return !0;
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function lt(e) {
|
|
1478
1478
|
for (let t = e.depth; t >= 0; t--) {
|
|
1479
1479
|
let n = e.indexAfter(t), r = e.node(t);
|
|
1480
1480
|
if (n == r.childCount) {
|
|
@@ -1482,90 +1482,90 @@ function ct(e) {
|
|
|
1482
1482
|
continue;
|
|
1483
1483
|
}
|
|
1484
1484
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
1485
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1485
|
+
if (e.childCount == 0 && !e.inlineContent || st(e.type)) return !0;
|
|
1486
1486
|
if (e.inlineContent) return !1;
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
1489
|
return !0;
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return new
|
|
1493
|
-
decorations:
|
|
1491
|
+
function ut() {
|
|
1492
|
+
return new _({ props: {
|
|
1493
|
+
decorations: mt,
|
|
1494
1494
|
createSelectionBetween(e, t, n) {
|
|
1495
|
-
return t.pos == n.pos &&
|
|
1495
|
+
return t.pos == n.pos && V.valid(n) ? new V(n) : null;
|
|
1496
1496
|
},
|
|
1497
|
-
handleClick:
|
|
1498
|
-
handleKeyDown:
|
|
1499
|
-
handleDOMEvents: { beforeinput:
|
|
1497
|
+
handleClick: ft,
|
|
1498
|
+
handleKeyDown: dt,
|
|
1499
|
+
handleDOMEvents: { beforeinput: pt }
|
|
1500
1500
|
} });
|
|
1501
1501
|
}
|
|
1502
|
-
var
|
|
1503
|
-
ArrowLeft:
|
|
1504
|
-
ArrowRight:
|
|
1505
|
-
ArrowUp:
|
|
1506
|
-
ArrowDown:
|
|
1502
|
+
var dt = te({
|
|
1503
|
+
ArrowLeft: H("horiz", -1),
|
|
1504
|
+
ArrowRight: H("horiz", 1),
|
|
1505
|
+
ArrowUp: H("vert", -1),
|
|
1506
|
+
ArrowDown: H("vert", 1)
|
|
1507
1507
|
});
|
|
1508
|
-
function
|
|
1509
|
-
let
|
|
1510
|
-
return function(
|
|
1511
|
-
let
|
|
1512
|
-
if (
|
|
1513
|
-
if (!
|
|
1514
|
-
c = !1, s =
|
|
1508
|
+
function H(t, n) {
|
|
1509
|
+
let r = t == "vert" ? n > 0 ? "down" : "up" : n > 0 ? "right" : "left";
|
|
1510
|
+
return function(t, i, a) {
|
|
1511
|
+
let o = t.selection, s = n > 0 ? o.$to : o.$from, c = o.empty;
|
|
1512
|
+
if (o instanceof e) {
|
|
1513
|
+
if (!a.endOfTextblock(r) || s.depth == 0) return !1;
|
|
1514
|
+
c = !1, s = t.doc.resolve(n > 0 ? s.after() : s.before());
|
|
1515
1515
|
}
|
|
1516
|
-
let l =
|
|
1517
|
-
return l ? (
|
|
1516
|
+
let l = V.findGapCursorFrom(s, n, c);
|
|
1517
|
+
return l ? (i && i(t.tr.setSelection(new V(l))), !0) : !1;
|
|
1518
1518
|
};
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function ft(e, t, n) {
|
|
1521
1521
|
if (!e || !e.editable) return !1;
|
|
1522
1522
|
let r = e.state.doc.resolve(t);
|
|
1523
|
-
if (!
|
|
1523
|
+
if (!V.valid(r)) return !1;
|
|
1524
1524
|
let i = e.posAtCoords({
|
|
1525
1525
|
left: n.clientX,
|
|
1526
1526
|
top: n.clientY
|
|
1527
1527
|
});
|
|
1528
|
-
return i && i.inside > -1 &&
|
|
1528
|
+
return i && i.inside > -1 && E.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new V(r))), !0);
|
|
1529
1529
|
}
|
|
1530
|
-
function
|
|
1531
|
-
if (
|
|
1532
|
-
let { $from:
|
|
1533
|
-
if (!
|
|
1534
|
-
let
|
|
1535
|
-
for (let e =
|
|
1536
|
-
let
|
|
1537
|
-
return
|
|
1530
|
+
function pt(t, i) {
|
|
1531
|
+
if (i.inputType != "insertCompositionText" || !(t.state.selection instanceof V)) return !1;
|
|
1532
|
+
let { $from: a } = t.state.selection, o = a.parent.contentMatchAt(a.index()).findWrapping(t.state.schema.nodes.text);
|
|
1533
|
+
if (!o) return !1;
|
|
1534
|
+
let s = r.empty;
|
|
1535
|
+
for (let e = o.length - 1; e >= 0; e--) s = r.from(o[e].createAndFill(null, s));
|
|
1536
|
+
let c = t.state.tr.replace(a.pos, a.pos, new n(s, 0, 0));
|
|
1537
|
+
return c.setSelection(e.near(c.doc.resolve(a.pos + 1))), t.dispatch(c), !1;
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1540
|
-
if (!(e.selection instanceof
|
|
1539
|
+
function mt(e) {
|
|
1540
|
+
if (!(e.selection instanceof V)) return null;
|
|
1541
1541
|
let t = document.createElement("div");
|
|
1542
|
-
return t.className = "ProseMirror-gapcursor",
|
|
1542
|
+
return t.className = "ProseMirror-gapcursor", w.create(e.doc, [h.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
1543
1543
|
}
|
|
1544
1544
|
//#endregion
|
|
1545
|
-
//#region ../../node_modules/.
|
|
1546
|
-
var
|
|
1547
|
-
|
|
1548
|
-
return e.length ? (e =
|
|
1549
|
-
},
|
|
1550
|
-
return e.length ?
|
|
1551
|
-
},
|
|
1552
|
-
return new
|
|
1553
|
-
},
|
|
1554
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ?
|
|
1555
|
-
},
|
|
1545
|
+
//#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
|
|
1546
|
+
var U = 200, W = function() {};
|
|
1547
|
+
W.prototype.append = function(e) {
|
|
1548
|
+
return e.length ? (e = W.from(e), !this.length && e || e.length < U && this.leafAppend(e) || this.length < U && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
1549
|
+
}, W.prototype.prepend = function(e) {
|
|
1550
|
+
return e.length ? W.from(e).append(this) : this;
|
|
1551
|
+
}, W.prototype.appendInner = function(e) {
|
|
1552
|
+
return new gt(this, e);
|
|
1553
|
+
}, W.prototype.slice = function(e, t) {
|
|
1554
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? W.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
|
|
1555
|
+
}, W.prototype.get = function(e) {
|
|
1556
1556
|
if (!(e < 0 || e >= this.length)) return this.getInner(e);
|
|
1557
|
-
},
|
|
1557
|
+
}, W.prototype.forEach = function(e, t, n) {
|
|
1558
1558
|
t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
|
|
1559
|
-
},
|
|
1559
|
+
}, W.prototype.map = function(e, t, n) {
|
|
1560
1560
|
t === void 0 && (t = 0), n === void 0 && (n = this.length);
|
|
1561
1561
|
var r = [];
|
|
1562
1562
|
return this.forEach(function(t, n) {
|
|
1563
1563
|
return r.push(e(t, n));
|
|
1564
1564
|
}, t, n), r;
|
|
1565
|
-
},
|
|
1566
|
-
return e instanceof
|
|
1565
|
+
}, W.from = function(e) {
|
|
1566
|
+
return e instanceof W ? e : e && e.length ? new ht(e) : W.empty;
|
|
1567
1567
|
};
|
|
1568
|
-
var
|
|
1568
|
+
var ht = /* @__PURE__ */ function(e) {
|
|
1569
1569
|
function t(t) {
|
|
1570
1570
|
e.call(this), this.values = t;
|
|
1571
1571
|
}
|
|
@@ -1585,17 +1585,17 @@ var mt = /* @__PURE__ */ function(e) {
|
|
|
1585
1585
|
}, t.prototype.forEachInvertedInner = function(e, t, n, r) {
|
|
1586
1586
|
for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
|
|
1587
1587
|
}, t.prototype.leafAppend = function(e) {
|
|
1588
|
-
if (this.length + e.length <=
|
|
1588
|
+
if (this.length + e.length <= U) return new t(this.values.concat(e.flatten()));
|
|
1589
1589
|
}, t.prototype.leafPrepend = function(e) {
|
|
1590
|
-
if (this.length + e.length <=
|
|
1590
|
+
if (this.length + e.length <= U) return new t(e.flatten().concat(this.values));
|
|
1591
1591
|
}, n.length.get = function() {
|
|
1592
1592
|
return this.values.length;
|
|
1593
1593
|
}, n.depth.get = function() {
|
|
1594
1594
|
return 0;
|
|
1595
1595
|
}, Object.defineProperties(t.prototype, n), t;
|
|
1596
|
-
}(
|
|
1597
|
-
|
|
1598
|
-
var
|
|
1596
|
+
}(W);
|
|
1597
|
+
W.empty = new ht([]);
|
|
1598
|
+
var gt = /* @__PURE__ */ function(e) {
|
|
1599
1599
|
function t(t, n) {
|
|
1600
1600
|
e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
|
|
1601
1601
|
}
|
|
@@ -1622,11 +1622,11 @@ var ht = /* @__PURE__ */ function(e) {
|
|
|
1622
1622
|
}, t.prototype.appendInner = function(e) {
|
|
1623
1623
|
return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
|
|
1624
1624
|
}, t;
|
|
1625
|
-
}(
|
|
1625
|
+
}(W), _t = 500, G = class e {
|
|
1626
1626
|
constructor(e, t) {
|
|
1627
1627
|
this.items = e, this.eventCount = t;
|
|
1628
1628
|
}
|
|
1629
|
-
popEvent(
|
|
1629
|
+
popEvent(t, n) {
|
|
1630
1630
|
if (this.eventCount == 0) return null;
|
|
1631
1631
|
let r = this.items.length;
|
|
1632
1632
|
for (;; r--) if (this.items.get(r - 1).selection) {
|
|
@@ -1635,64 +1635,64 @@ var ht = /* @__PURE__ */ function(e) {
|
|
|
1635
1635
|
}
|
|
1636
1636
|
let i, a;
|
|
1637
1637
|
n && (i = this.remapping(r, this.items.length), a = i.maps.length);
|
|
1638
|
-
let o =
|
|
1639
|
-
return this.items.forEach((
|
|
1640
|
-
if (!
|
|
1641
|
-
i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(
|
|
1638
|
+
let o = t.tr, s, c, l = [], u = [];
|
|
1639
|
+
return this.items.forEach((t, n) => {
|
|
1640
|
+
if (!t.step) {
|
|
1641
|
+
i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
|
|
1642
1642
|
return;
|
|
1643
1643
|
}
|
|
1644
1644
|
if (i) {
|
|
1645
|
-
u.push(new
|
|
1646
|
-
let
|
|
1647
|
-
|
|
1648
|
-
} else o.maybeStep(
|
|
1649
|
-
if (
|
|
1645
|
+
u.push(new K(t.map));
|
|
1646
|
+
let e = t.step.map(i.slice(a)), n;
|
|
1647
|
+
e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new K(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
|
|
1648
|
+
} else o.maybeStep(t.step);
|
|
1649
|
+
if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
|
|
1650
1650
|
}, this.items.length, 0), {
|
|
1651
1651
|
remaining: c,
|
|
1652
1652
|
transform: o,
|
|
1653
1653
|
selection: s
|
|
1654
1654
|
};
|
|
1655
1655
|
}
|
|
1656
|
-
addTransform(
|
|
1656
|
+
addTransform(t, n, r, i) {
|
|
1657
1657
|
let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
|
|
1658
|
-
for (let
|
|
1659
|
-
let r =
|
|
1660
|
-
(u = c && c.merge(l)) && (l = u,
|
|
1658
|
+
for (let e = 0; e < t.steps.length; e++) {
|
|
1659
|
+
let r = t.steps[e].invert(t.docs[e]), l = new K(t.mapping.maps[e], r, n), u;
|
|
1660
|
+
(u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
|
|
1661
1661
|
}
|
|
1662
1662
|
let l = o - r.depth;
|
|
1663
|
-
return l >
|
|
1663
|
+
return l > yt && (s = vt(s, l), o -= l), new e(s.append(a), o);
|
|
1664
1664
|
}
|
|
1665
|
-
remapping(
|
|
1666
|
-
let
|
|
1667
|
-
return this.items.forEach((
|
|
1668
|
-
let i =
|
|
1669
|
-
|
|
1670
|
-
},
|
|
1665
|
+
remapping(e, t) {
|
|
1666
|
+
let n = new oe();
|
|
1667
|
+
return this.items.forEach((t, r) => {
|
|
1668
|
+
let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
|
|
1669
|
+
n.appendMap(t.map, i);
|
|
1670
|
+
}, e, t), n;
|
|
1671
1671
|
}
|
|
1672
|
-
addMaps(
|
|
1673
|
-
return this.eventCount == 0 ? this : new
|
|
1672
|
+
addMaps(t) {
|
|
1673
|
+
return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new K(e))), this.eventCount);
|
|
1674
1674
|
}
|
|
1675
|
-
rebased(
|
|
1675
|
+
rebased(t, n) {
|
|
1676
1676
|
if (!this.eventCount) return this;
|
|
1677
|
-
let r = [], i = Math.max(0, this.items.length - n), a =
|
|
1677
|
+
let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
|
|
1678
1678
|
this.items.forEach((e) => {
|
|
1679
1679
|
e.selection && s--;
|
|
1680
1680
|
}, i);
|
|
1681
1681
|
let c = n;
|
|
1682
|
-
this.items.forEach((
|
|
1682
|
+
this.items.forEach((e) => {
|
|
1683
1683
|
let n = a.getMirror(--c);
|
|
1684
1684
|
if (n == null) return;
|
|
1685
1685
|
o = Math.min(o, n);
|
|
1686
1686
|
let i = a.maps[n];
|
|
1687
|
-
if (
|
|
1688
|
-
let o =
|
|
1689
|
-
l && s++, r.push(new
|
|
1690
|
-
} else r.push(new
|
|
1687
|
+
if (e.step) {
|
|
1688
|
+
let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
|
|
1689
|
+
l && s++, r.push(new K(i, o, l));
|
|
1690
|
+
} else r.push(new K(i));
|
|
1691
1691
|
}, i);
|
|
1692
1692
|
let l = [];
|
|
1693
|
-
for (let e = n; e < o; e++) l.push(new
|
|
1694
|
-
let u = new
|
|
1695
|
-
return u.emptyItemCount() >
|
|
1693
|
+
for (let e = n; e < o; e++) l.push(new K(a.maps[e]));
|
|
1694
|
+
let u = new e(this.items.slice(0, i).append(l).append(r), s);
|
|
1695
|
+
return u.emptyItemCount() > _t && (u = u.compress(this.items.length - r.length)), u;
|
|
1696
1696
|
}
|
|
1697
1697
|
emptyItemCount() {
|
|
1698
1698
|
let e = 0;
|
|
@@ -1700,30 +1700,30 @@ var ht = /* @__PURE__ */ function(e) {
|
|
|
1700
1700
|
t.step || e++;
|
|
1701
1701
|
}), e;
|
|
1702
1702
|
}
|
|
1703
|
-
compress(
|
|
1704
|
-
let n = this.remapping(0,
|
|
1705
|
-
return this.items.forEach((
|
|
1706
|
-
if (o >=
|
|
1707
|
-
else if (
|
|
1708
|
-
let
|
|
1709
|
-
if (r--, o && n.appendMap(o, r),
|
|
1710
|
-
let s =
|
|
1703
|
+
compress(t = this.items.length) {
|
|
1704
|
+
let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
|
|
1705
|
+
return this.items.forEach((e, o) => {
|
|
1706
|
+
if (o >= t) i.push(e), e.selection && a++;
|
|
1707
|
+
else if (e.step) {
|
|
1708
|
+
let t = e.step.map(n.slice(r)), o = t && t.getMap();
|
|
1709
|
+
if (r--, o && n.appendMap(o, r), t) {
|
|
1710
|
+
let s = e.selection && e.selection.map(n.slice(r));
|
|
1711
1711
|
s && a++;
|
|
1712
|
-
let c = new
|
|
1712
|
+
let c = new K(o.invert(), t, s), l, u = i.length - 1;
|
|
1713
1713
|
(l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
|
|
1714
1714
|
}
|
|
1715
|
-
} else
|
|
1716
|
-
}, this.items.length, 0), new
|
|
1715
|
+
} else e.map && r--;
|
|
1716
|
+
}, this.items.length, 0), new e(W.from(i.reverse()), a);
|
|
1717
1717
|
}
|
|
1718
1718
|
};
|
|
1719
|
-
|
|
1720
|
-
function
|
|
1719
|
+
G.empty = new G(W.empty, 0);
|
|
1720
|
+
function vt(e, t) {
|
|
1721
1721
|
let n;
|
|
1722
1722
|
return e.forEach((e, r) => {
|
|
1723
1723
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
1724
1724
|
}), e.slice(n);
|
|
1725
1725
|
}
|
|
1726
|
-
var
|
|
1726
|
+
var K = class e {
|
|
1727
1727
|
constructor(e, t, n, r) {
|
|
1728
1728
|
this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
|
|
1729
1729
|
}
|
|
@@ -1733,25 +1733,25 @@ var q = class e {
|
|
|
1733
1733
|
if (n) return new e(n.getMap().invert(), n, this.selection);
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
|
-
},
|
|
1736
|
+
}, q = class {
|
|
1737
1737
|
constructor(e, t, n, r, i) {
|
|
1738
1738
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
1739
1739
|
}
|
|
1740
|
-
},
|
|
1741
|
-
function
|
|
1742
|
-
let i = n.getMeta(
|
|
1740
|
+
}, yt = 20;
|
|
1741
|
+
function bt(e, t, n, r) {
|
|
1742
|
+
let i = n.getMeta(Z), a;
|
|
1743
1743
|
if (i) return i.historyState;
|
|
1744
|
-
n.getMeta(
|
|
1744
|
+
n.getMeta(Tt) && (e = new q(e.done, e.undone, null, 0, -1));
|
|
1745
1745
|
let o = n.getMeta("appendedTransaction");
|
|
1746
1746
|
if (n.steps.length == 0) return e;
|
|
1747
|
-
if (o && o.getMeta(
|
|
1747
|
+
if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new q(e.done.addTransform(n, void 0, r, X(t)), e.undone, St(n.mapping.maps), e.prevTime, e.prevComposition) : new q(e.done, e.undone.addTransform(n, void 0, r, X(t)), null, e.prevTime, e.prevComposition);
|
|
1748
1748
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
1749
|
-
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !
|
|
1750
|
-
return new
|
|
1751
|
-
} else if (a = n.getMeta("rebased")) return new
|
|
1752
|
-
else return new
|
|
1749
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !xt(n, e.prevRanges)), s = o ? J(e.prevRanges, n.mapping) : St(n.mapping.maps);
|
|
1750
|
+
return new q(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, X(t)), G.empty, s, n.time, i ?? e.prevComposition);
|
|
1751
|
+
} else if (a = n.getMeta("rebased")) return new q(e.done.rebased(n, a), e.undone.rebased(n, a), J(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
1752
|
+
else return new q(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), J(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1754
|
+
function xt(e, t) {
|
|
1755
1755
|
if (!t) return !1;
|
|
1756
1756
|
if (!e.docChanged) return !0;
|
|
1757
1757
|
let n = !1;
|
|
@@ -1759,12 +1759,12 @@ function bt(e, t) {
|
|
|
1759
1759
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
1760
1760
|
}), n;
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1762
|
+
function St(e) {
|
|
1763
1763
|
let t = [];
|
|
1764
1764
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
1765
1765
|
return t;
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1767
|
+
function J(e, t) {
|
|
1768
1768
|
if (!e) return null;
|
|
1769
1769
|
let n = [];
|
|
1770
1770
|
for (let r = 0; r < e.length; r += 2) {
|
|
@@ -1773,62 +1773,62 @@ function Y(e, t) {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
return n;
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1777
|
-
let r =
|
|
1776
|
+
function Ct(e, t, n) {
|
|
1777
|
+
let r = X(t), i = Z.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
1778
1778
|
if (!a) return null;
|
|
1779
|
-
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new
|
|
1780
|
-
return a.transform.setSelection(o).setMeta(
|
|
1779
|
+
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new q(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
|
|
1780
|
+
return a.transform.setSelection(o).setMeta(Z, {
|
|
1781
1781
|
redo: n,
|
|
1782
1782
|
historyState: c
|
|
1783
1783
|
});
|
|
1784
1784
|
}
|
|
1785
|
-
var
|
|
1786
|
-
function
|
|
1785
|
+
var Y = !1, wt = null;
|
|
1786
|
+
function X(e) {
|
|
1787
1787
|
let t = e.plugins;
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1788
|
+
if (wt != t) {
|
|
1789
|
+
Y = !1, wt = t;
|
|
1790
1790
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
1791
|
-
|
|
1791
|
+
Y = !0;
|
|
1792
1792
|
break;
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
|
-
return
|
|
1795
|
+
return Y;
|
|
1796
1796
|
}
|
|
1797
|
-
var
|
|
1798
|
-
function
|
|
1797
|
+
var Z = new T("history"), Tt = new T("closeHistory");
|
|
1798
|
+
function Et(e = {}) {
|
|
1799
1799
|
return e = {
|
|
1800
1800
|
depth: e.depth || 100,
|
|
1801
1801
|
newGroupDelay: e.newGroupDelay || 500
|
|
1802
|
-
}, new
|
|
1803
|
-
key:
|
|
1802
|
+
}, new _({
|
|
1803
|
+
key: Z,
|
|
1804
1804
|
state: {
|
|
1805
1805
|
init() {
|
|
1806
|
-
return new
|
|
1806
|
+
return new q(G.empty, G.empty, null, 0, -1);
|
|
1807
1807
|
},
|
|
1808
1808
|
apply(t, n, r) {
|
|
1809
|
-
return
|
|
1809
|
+
return bt(n, r, t, e);
|
|
1810
1810
|
}
|
|
1811
1811
|
},
|
|
1812
1812
|
config: e,
|
|
1813
1813
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
1814
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
1814
|
+
let n = t.inputType, r = n == "historyUndo" ? Q : n == "historyRedo" ? Ot : null;
|
|
1815
1815
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
1816
1816
|
} } }
|
|
1817
1817
|
});
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function Dt(e, t) {
|
|
1820
1820
|
return (n, r) => {
|
|
1821
|
-
let i =
|
|
1821
|
+
let i = Z.getState(n);
|
|
1822
1822
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
1823
1823
|
if (r) {
|
|
1824
|
-
let a =
|
|
1824
|
+
let a = Ct(i, n, e);
|
|
1825
1825
|
a && r(t ? a.scrollIntoView() : a);
|
|
1826
1826
|
}
|
|
1827
1827
|
return !0;
|
|
1828
1828
|
};
|
|
1829
1829
|
}
|
|
1830
|
-
var
|
|
1831
|
-
|
|
1830
|
+
var Q = Dt(!1, !0), Ot = Dt(!0, !0);
|
|
1831
|
+
b.create({
|
|
1832
1832
|
name: "characterCount",
|
|
1833
1833
|
addOptions() {
|
|
1834
1834
|
return {
|
|
@@ -1859,8 +1859,8 @@ y.create({
|
|
|
1859
1859
|
},
|
|
1860
1860
|
addProseMirrorPlugins() {
|
|
1861
1861
|
let e = !1;
|
|
1862
|
-
return [new
|
|
1863
|
-
key: new
|
|
1862
|
+
return [new _({
|
|
1863
|
+
key: new T("characterCount"),
|
|
1864
1864
|
appendTransaction: (t, n, r) => {
|
|
1865
1865
|
if (e) return;
|
|
1866
1866
|
let i = this.options.limit;
|
|
@@ -1889,7 +1889,7 @@ y.create({
|
|
|
1889
1889
|
})];
|
|
1890
1890
|
}
|
|
1891
1891
|
});
|
|
1892
|
-
var
|
|
1892
|
+
var kt = b.create({
|
|
1893
1893
|
name: "dropCursor",
|
|
1894
1894
|
addOptions() {
|
|
1895
1895
|
return {
|
|
@@ -1899,10 +1899,10 @@ var Ot = y.create({
|
|
|
1899
1899
|
};
|
|
1900
1900
|
},
|
|
1901
1901
|
addProseMirrorPlugins() {
|
|
1902
|
-
return [
|
|
1902
|
+
return [it(this.options)];
|
|
1903
1903
|
}
|
|
1904
1904
|
});
|
|
1905
|
-
|
|
1905
|
+
b.create({
|
|
1906
1906
|
name: "focus",
|
|
1907
1907
|
addOptions() {
|
|
1908
1908
|
return {
|
|
@@ -1911,11 +1911,11 @@ y.create({
|
|
|
1911
1911
|
};
|
|
1912
1912
|
},
|
|
1913
1913
|
addProseMirrorPlugins() {
|
|
1914
|
-
return [new
|
|
1915
|
-
key: new
|
|
1914
|
+
return [new _({
|
|
1915
|
+
key: new T("focus"),
|
|
1916
1916
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
1917
1917
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
1918
|
-
if (!n || !r) return
|
|
1918
|
+
if (!n || !r) return w.create(e, []);
|
|
1919
1919
|
let o = 0;
|
|
1920
1920
|
this.options.mode === "deepest" && e.descendants((e, t) => {
|
|
1921
1921
|
if (!e.isText) {
|
|
@@ -1927,35 +1927,35 @@ y.create({
|
|
|
1927
1927
|
return e.descendants((e, t) => {
|
|
1928
1928
|
if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
|
|
1929
1929
|
if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
|
|
1930
|
-
a.push(
|
|
1931
|
-
}),
|
|
1930
|
+
a.push(h.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
1931
|
+
}), w.create(e, a);
|
|
1932
1932
|
} }
|
|
1933
1933
|
})];
|
|
1934
1934
|
}
|
|
1935
1935
|
});
|
|
1936
|
-
var
|
|
1936
|
+
var At = b.create({
|
|
1937
1937
|
name: "gapCursor",
|
|
1938
1938
|
addProseMirrorPlugins() {
|
|
1939
|
-
return [
|
|
1939
|
+
return [ut()];
|
|
1940
1940
|
},
|
|
1941
1941
|
extendNodeSchema(e) {
|
|
1942
|
-
return { allowGapCursor:
|
|
1942
|
+
return { allowGapCursor: ee(m(e, "allowGapCursor", {
|
|
1943
1943
|
name: e.name,
|
|
1944
1944
|
options: e.options,
|
|
1945
1945
|
storage: e.storage
|
|
1946
1946
|
})) ?? null };
|
|
1947
1947
|
}
|
|
1948
|
-
}),
|
|
1949
|
-
function
|
|
1948
|
+
}), jt = "placeholder";
|
|
1949
|
+
function Mt(e) {
|
|
1950
1950
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
1951
1951
|
}
|
|
1952
|
-
|
|
1952
|
+
b.create({
|
|
1953
1953
|
name: "placeholder",
|
|
1954
1954
|
addOptions() {
|
|
1955
1955
|
return {
|
|
1956
1956
|
emptyEditorClass: "is-editor-empty",
|
|
1957
1957
|
emptyNodeClass: "is-empty",
|
|
1958
|
-
dataAttribute:
|
|
1958
|
+
dataAttribute: jt,
|
|
1959
1959
|
placeholder: "Write something …",
|
|
1960
1960
|
showOnlyWhenEditable: !0,
|
|
1961
1961
|
showOnlyCurrent: !0,
|
|
@@ -1963,20 +1963,20 @@ y.create({
|
|
|
1963
1963
|
};
|
|
1964
1964
|
},
|
|
1965
1965
|
addProseMirrorPlugins() {
|
|
1966
|
-
let e = this.options.dataAttribute ? `data-${
|
|
1967
|
-
return [new
|
|
1968
|
-
key: new
|
|
1966
|
+
let e = this.options.dataAttribute ? `data-${Mt(this.options.dataAttribute)}` : `data-${jt}`;
|
|
1967
|
+
return [new _({
|
|
1968
|
+
key: new T("placeholder"),
|
|
1969
1969
|
props: { decorations: ({ doc: t, selection: n }) => {
|
|
1970
|
-
let r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor:
|
|
1970
|
+
let r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = n, a = [];
|
|
1971
1971
|
if (!r) return null;
|
|
1972
|
-
let
|
|
1972
|
+
let o = this.editor.isEmpty;
|
|
1973
1973
|
return t.descendants((t, n) => {
|
|
1974
|
-
let r =
|
|
1974
|
+
let r = i >= n && i <= n + t.nodeSize, c = !t.isLeaf && s(t);
|
|
1975
1975
|
if (!t.type.isTextblock) return this.options.includeChildren;
|
|
1976
1976
|
if ((r || !this.options.showOnlyCurrent) && c) {
|
|
1977
1977
|
let i = [this.options.emptyNodeClass];
|
|
1978
|
-
|
|
1979
|
-
let
|
|
1978
|
+
o && i.push(this.options.emptyEditorClass);
|
|
1979
|
+
let s = h.node(n, n + t.nodeSize, {
|
|
1980
1980
|
class: i.join(" "),
|
|
1981
1981
|
[e]: typeof this.options.placeholder == "function" ? this.options.placeholder({
|
|
1982
1982
|
editor: this.editor,
|
|
@@ -1985,32 +1985,32 @@ y.create({
|
|
|
1985
1985
|
hasAnchor: r
|
|
1986
1986
|
}) : this.options.placeholder
|
|
1987
1987
|
});
|
|
1988
|
-
|
|
1988
|
+
a.push(s);
|
|
1989
1989
|
}
|
|
1990
1990
|
return this.options.includeChildren;
|
|
1991
|
-
}),
|
|
1991
|
+
}), w.create(t, a);
|
|
1992
1992
|
} }
|
|
1993
1993
|
})];
|
|
1994
1994
|
}
|
|
1995
|
-
}),
|
|
1995
|
+
}), b.create({
|
|
1996
1996
|
name: "selection",
|
|
1997
1997
|
addOptions() {
|
|
1998
1998
|
return { className: "selection" };
|
|
1999
1999
|
},
|
|
2000
2000
|
addProseMirrorPlugins() {
|
|
2001
2001
|
let { editor: e, options: t } = this;
|
|
2002
|
-
return [new
|
|
2003
|
-
key: new
|
|
2002
|
+
return [new _({
|
|
2003
|
+
key: new T("selection"),
|
|
2004
2004
|
props: { decorations(n) {
|
|
2005
|
-
return n.selection.empty || e.isFocused || !e.isEditable ||
|
|
2005
|
+
return n.selection.empty || e.isFocused || !e.isEditable || c(n.selection) || e.view.dragging ? null : w.create(n.doc, [h.inline(n.selection.from, n.selection.to, { class: t.className })]);
|
|
2006
2006
|
} }
|
|
2007
2007
|
})];
|
|
2008
2008
|
}
|
|
2009
2009
|
});
|
|
2010
|
-
function
|
|
2010
|
+
function Nt({ types: e, node: t }) {
|
|
2011
2011
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
2012
2012
|
}
|
|
2013
|
-
var
|
|
2013
|
+
var Pt = b.create({
|
|
2014
2014
|
name: "trailingNode",
|
|
2015
2015
|
addOptions() {
|
|
2016
2016
|
return {
|
|
@@ -2019,8 +2019,8 @@ var Nt = y.create({
|
|
|
2019
2019
|
};
|
|
2020
2020
|
},
|
|
2021
2021
|
addProseMirrorPlugins() {
|
|
2022
|
-
let e = new
|
|
2023
|
-
return [new
|
|
2022
|
+
let e = new T(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
|
|
2023
|
+
return [new _({
|
|
2024
2024
|
key: e,
|
|
2025
2025
|
appendTransaction: (n, r, i) => {
|
|
2026
2026
|
let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
|
|
@@ -2029,7 +2029,7 @@ var Nt = y.create({
|
|
|
2029
2029
|
state: {
|
|
2030
2030
|
init: (e, t) => {
|
|
2031
2031
|
let r = t.tr.doc.lastChild;
|
|
2032
|
-
return !
|
|
2032
|
+
return !Nt({
|
|
2033
2033
|
node: r,
|
|
2034
2034
|
types: n
|
|
2035
2035
|
});
|
|
@@ -2037,7 +2037,7 @@ var Nt = y.create({
|
|
|
2037
2037
|
apply: (e, t) => {
|
|
2038
2038
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
2039
2039
|
let r = e.doc.lastChild;
|
|
2040
|
-
return !
|
|
2040
|
+
return !Nt({
|
|
2041
2041
|
node: r,
|
|
2042
2042
|
types: n
|
|
2043
2043
|
});
|
|
@@ -2045,7 +2045,7 @@ var Nt = y.create({
|
|
|
2045
2045
|
}
|
|
2046
2046
|
})];
|
|
2047
2047
|
}
|
|
2048
|
-
}),
|
|
2048
|
+
}), Ft = b.create({
|
|
2049
2049
|
name: "undoRedo",
|
|
2050
2050
|
addOptions() {
|
|
2051
2051
|
return {
|
|
@@ -2055,12 +2055,12 @@ var Nt = y.create({
|
|
|
2055
2055
|
},
|
|
2056
2056
|
addCommands() {
|
|
2057
2057
|
return {
|
|
2058
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
2059
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
2058
|
+
undo: () => ({ state: e, dispatch: t }) => Q(e, t),
|
|
2059
|
+
redo: () => ({ state: e, dispatch: t }) => Ot(e, t)
|
|
2060
2060
|
};
|
|
2061
2061
|
},
|
|
2062
2062
|
addProseMirrorPlugins() {
|
|
2063
|
-
return [
|
|
2063
|
+
return [Et(this.options)];
|
|
2064
2064
|
},
|
|
2065
2065
|
addKeyboardShortcuts() {
|
|
2066
2066
|
return {
|
|
@@ -2071,12 +2071,12 @@ var Nt = y.create({
|
|
|
2071
2071
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
2072
2072
|
};
|
|
2073
2073
|
}
|
|
2074
|
-
}),
|
|
2074
|
+
}), $ = b.create({
|
|
2075
2075
|
name: "starterKit",
|
|
2076
2076
|
addExtensions() {
|
|
2077
2077
|
let e = [];
|
|
2078
|
-
return this.options.bold !== !1 && e.push(he.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(ue.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(j.configure(this.options.bulletList)), this.options.code !== !1 && e.push(ve.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(xe.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Se.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(
|
|
2078
|
+
return this.options.bold !== !1 && e.push(he.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(ue.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(j.configure(this.options.bulletList)), this.options.code !== !1 && e.push(ve.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(xe.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Se.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(kt.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(At.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(Ce.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(we.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(Ft.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(Te.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Ae.configure(this.options.italic)), this.options.listItem !== !1 && e.push(M.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(Re.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(se.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(Ye.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push($e.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(nt.configure(this.options.strike)), this.options.text !== !1 && e.push(rt.configure(this.options.text)), this.options.underline !== !1 && e.push(ce.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(Pt.configure(this.options?.trailingNode)), e;
|
|
2079
2079
|
}
|
|
2080
|
-
}), It =
|
|
2080
|
+
}), It = $;
|
|
2081
2081
|
//#endregion
|
|
2082
|
-
export {
|
|
2082
|
+
export { $ as StarterKit, It as default };
|