@templatical/editor 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +56 -0
- package/README.md +69 -0
- package/dist/{AiChatSidebar-DwME3f-a.js → AiChatSidebar-DSbBLDkW.js} +9 -9
- package/dist/{AiFeatureMenu-DJvWL1GZ.js → AiFeatureMenu-d04gmgud.js} +5 -5
- package/dist/{CloudEditor-Fe0ssRgi.js → CloudEditor-CjO4tzbV.js} +218 -227
- package/dist/{CollaboratorBar-DTT0EkZn.js → CollaboratorBar-DYBSTuMW.js} +3 -3
- package/dist/{CommentsSidebar-DrJhQRXK.js → CommentsSidebar-CQvUh5xt.js} +9 -9
- package/dist/CountdownBlock-D3olfssJ.js +92 -0
- package/dist/CountdownToolbar-ClpBwFoX.js +210 -0
- package/dist/{DesignReferenceSidebar-DdOht5zn.js → DesignReferenceSidebar-BOfeETis.js} +5 -5
- package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack-CdqDYVR-.js} +1 -1
- package/dist/{ModuleBrowserModal-CiV_jOEM.js → ModuleBrowserModal-DKSSQonv.js} +7 -7
- package/dist/{ModulePreviewCanvas-Bmy6Y1WE.js → ModulePreviewCanvas-CoLNuu1o.js} +32 -32
- package/dist/NumberWithSuffix-_0l3Q4jq.js +424 -0
- package/dist/{ParagraphEditor-CoQ3NlS7.js → ParagraphEditor-C9R2ou7x.js} +57 -56
- package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BcY3Rcp4.js} +2 -2
- package/dist/{SaveModuleDialog-CD2ZYq1o.js → SaveModuleDialog-DmFe4VUc.js} +3 -3
- package/dist/{SnapshotHistory-DltsKvhP.js → SnapshotHistory-CAhikAOr.js} +7 -7
- package/dist/{TemplateScoringPanel-DmnmUE3y.js → TemplateScoringPanel-b5DnyIll.js} +10 -10
- package/dist/{TestEmailModal-Dl633j9o.js → TestEmailModal-BmDIzGYz.js} +3 -3
- package/dist/{TitleEditor-C7fds2Nc.js → TitleEditor-DtRYx-LS.js} +11 -11
- package/dist/{TplModal-C5_CF-qn.js → TplModal-BLbMDMd6.js} +4 -4
- package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-BHUPLLh1.js} +2 -2
- package/dist/{blockTypeIcons-BrKZB10B.js → blockTypeIcons-CEU2dMe1.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js → AiFeatureMenu-DWMSYD2J.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js.map → AiFeatureMenu-DWMSYD2J.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-DeTolKnf.js → CloudEditor-HrfSfr3G.js} +179 -188
- package/dist/cdn/chunks/CloudEditor-HrfSfr3G.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js → CollaboratorBar-Cfok52TZ.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js.map → CollaboratorBar-Cfok52TZ.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js → ModuleBrowserModal-sASaPRot.js} +7 -7
- package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js.map → ModuleBrowserModal-sASaPRot.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js → ModulePreviewCanvas-D8zsajMf.js} +19 -19
- package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js.map → ModulePreviewCanvas-D8zsajMf.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js +425 -0
- package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-DU3oUKA7.js → ParagraphEditor-C1vQWGzW.js} +37 -37
- package/dist/cdn/chunks/ParagraphEditor-C1vQWGzW.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js → RichTextEditorContent-CT8dBB0R.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js.map → RichTextEditorContent-CT8dBB0R.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js → SaveModuleDialog-BkwKrB0N.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js.map → SaveModuleDialog-BkwKrB0N.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js → TitleEditor-BXqt42Px.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js.map → TitleEditor-BXqt42Px.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js → blockTypeIcons-BS6pWyGO.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js.map → blockTypeIcons-BS6pWyGO.js.map} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js → de-3exf7MYE.js} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-3exf7MYE.js.map} +1 -1
- package/dist/cdn/chunks/{de-BB3dgVOc.js → de-C8LxVUsb.js} +1 -1
- package/dist/cdn/chunks/de-C8LxVUsb.js.map +1 -0
- package/dist/cdn/chunks/{dist-KYv9v_1z2.js → dist-BpOx-ugr.js} +10 -3
- package/dist/cdn/chunks/dist-BpOx-ugr.js.map +1 -0
- package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-Bcb86AsV.js} +1591 -1563
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-DUHzsh4j.js} +1 -1
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-DUHzsh4j.js.map} +1 -1
- package/dist/cdn/chunks/{en-DeDcpnoS.js → en-BoEycuqw.js} +1 -1
- package/dist/cdn/chunks/en-BoEycuqw.js.map +1 -0
- package/dist/cdn/chunks/{en-CpotcOPr.js → en-KNPUKxYp.js} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-KNPUKxYp.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Bj7USRLr.js → extensions-DBxH6pz0.js} +21 -21
- package/dist/cdn/chunks/{extensions-Bj7USRLr.js.map → extensions-DBxH6pz0.js.map} +1 -1
- package/dist/cdn/chunks/{features-Ds0XUfte.js → features-C3n7AeUc.js} +1338 -1422
- package/dist/cdn/chunks/features-C3n7AeUc.js.map +1 -0
- package/dist/cdn/chunks/{icons-fWsuSvgd.js → icons-Hmpb0_8s.js} +2 -2
- package/dist/cdn/chunks/icons-Hmpb0_8s.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-CEMn-ZqL.js} +24 -17
- package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
- package/dist/cdn/chunks/{media-library-BGQm_OyC.js → media-library-C1wCpRY1.js} +114 -110
- package/dist/cdn/chunks/media-library-C1wCpRY1.js.map +1 -0
- package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-DwSQn6BA.js} +11 -8
- package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
- package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
- package/dist/cdn/chunks/{src-3i8rPuqd.js → src-BUszJqfd.js} +8 -8
- package/dist/cdn/chunks/{src-3i8rPuqd.js.map → src-BUszJqfd.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js → styleConstants-DP1VOca8.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js.map → styleConstants-DP1VOca8.js.map} +1 -1
- package/dist/cdn/chunks/{styles-Dgijy53u.js → styles-U2VFFgxC.js} +623 -1239
- package/dist/cdn/chunks/styles-U2VFFgxC.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BhxaWR8R.js → tiptap-w5IqC8oW.js} +1610 -1364
- package/dist/cdn/chunks/tiptap-w5IqC8oW.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +92 -97
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B7kDuZmP.js → check-BDE2uFIC.js} +1 -1
- package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-BL1DcOiT.js} +1 -1
- package/dist/{circle-alert-E2vYPs5r.js → circle-alert-1tetIFJU.js} +1 -1
- package/dist/{clock-lWIIQA3C.js → clock-CNc3isoG.js} +1 -1
- package/dist/{dist-DysAFIPy.js → dist-7SaUYnxo.js} +385 -357
- package/dist/{dist-DmOE-Ubp.js → dist-BKZ5gvJf.js} +5 -5
- package/dist/{dist-CG-vEqSU.js → dist-CLg2qE0p.js} +2 -2
- package/dist/dist-CdzaZZSx.js +5 -0
- package/dist/dist-Cl9giA3B.js +5 -0
- package/dist/{dist-C_ymrGFi.js → dist-CpHKN3mI.js} +541 -508
- package/dist/{dist-4LiM9FDd.js → dist-DMuaebdo.js} +2 -2
- package/dist/{dist-ChAGLpWo.js → dist-DW_4_uv3.js} +2 -2
- package/dist/{dist-C1BIRHCQ.js → dist-DYG6FL7b.js} +2 -2
- package/dist/{dist-DrvKRSU6.js → dist-DbFMBx8E.js} +2 -2
- package/dist/{dist-D_HQYSY-.js → dist-Dn9cOicG.js} +2 -2
- package/dist/{dist-Ci5lFuUy.js → dist-ENKQZrNg.js} +138 -132
- package/dist/{dist-Bu7veieH.js → dist-fEtcLxee.js} +15 -15
- package/dist/{extensions-DWx_jj8v.js → extensions-Y880c0sP.js} +3 -3
- package/dist/{image-up-X4xIq4ea.js → image-up-4ZmaHFga.js} +1 -1
- package/dist/index.d.ts +234 -0
- package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-DZ62L7up.js} +20 -15
- package/dist/{loader-circle-BTQQxC3l.js → loader-circle-C7YEH4do.js} +1 -1
- package/dist/{message-circle-Blgm6V_h.js → message-circle-B_lxRh4z.js} +1 -1
- package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-DmZNoimV.js} +1 -1
- package/dist/rolldown-runtime-gEudmnaM.js +23 -0
- package/dist/{scan-line-7lZPfOdm.js → scan-line-Cc9KlXo5.js} +1 -1
- package/dist/{send-C0ltAQrv.js → send-CMwNWTPX.js} +1 -1
- package/dist/{shield-check-f-qv4RKs.js → shield-check-DZFf4LTh.js} +1 -1
- package/dist/{sparkles-KhBCGlqB.js → sparkles-D80W88H8.js} +1 -1
- package/dist/{styleConstants-Cxw88naD.js → styleConstants-Codo7aUT.js} +6 -45
- package/dist/styles-unyYKihg.js +2942 -0
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +85 -90
- package/dist/text-align-start-Cje6pwo4.js +43 -0
- package/dist/{trash-2-OwjZ-guZ.js → trash-2-BWvxOB4Q.js} +1 -1
- package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-C6y94qVX.js} +1 -1
- package/dist/{useEditorCore-DUGD6pq_.js → useEditorCore-CQwWl2js.js} +1143 -1247
- package/dist/{x-CGlq2XQe.js → x-IyhJ6V90.js} +1 -1
- package/package.json +70 -52
- package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +0 -2
- package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +0 -2
- package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +0 -2
- package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +0 -2
- package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +0 -2
- package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +0 -2
- package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
- package/dist/cdn/chunks/dist-BF5c3Dr-.js +0 -2
- package/dist/cdn/chunks/dist-BGzvIxcJ.js +0 -2
- package/dist/cdn/chunks/dist-CFemF8rI.js +0 -2
- package/dist/cdn/chunks/dist-Co6uFhFK.js +0 -2
- package/dist/cdn/chunks/dist-DCikBY9K.js +0 -2
- package/dist/cdn/chunks/dist-DUILafAC.js +0 -2
- package/dist/cdn/chunks/dist-DghiKH0A.js +0 -2
- package/dist/cdn/chunks/dist-Dw8ckvfK.js +0 -2
- package/dist/cdn/chunks/dist-H07p0KAw.js +0 -2
- package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +0 -1
- package/dist/cdn/chunks/dist-MjnKIc0W.js +0 -2
- package/dist/cdn/chunks/dist-odp0vGRv.js +0 -2
- package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
- package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
- package/dist/cdn/chunks/features-Ds0XUfte.js.map +0 -1
- package/dist/cdn/chunks/icons-fWsuSvgd.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
- package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +0 -1
- package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
- package/dist/cdn/chunks/styles-Dgijy53u.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BhxaWR8R.js.map +0 -1
- package/dist/dist-DkypH7qG.js +0 -5
- package/dist/dist-Dxnd0GRf.js +0 -5
- package/dist/styles-fdXNRqI3.js +0 -3556
- package/dist/templatical-editor.umd.cjs +0 -179
- /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
- /package/dist/{de-D7TLGIPA.js → de-DCRASLfd.js} +0 -0
- /package/dist/{emojiData-BfWQS72m.js → emojiData-CyACq8qV.js} +0 -0
- /package/dist/{en-DvtiEMwP.js → en-BC0igPeg.js} +0 -0
- /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-mRxw8HK8.js} +0 -0
- /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
- /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
|
@@ -1,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-CpHKN3mI.js";
|
|
2
|
+
import { Link as se } from "./dist-fEtcLxee.js";
|
|
3
|
+
import { Underline as ce } from "./dist-DYG6FL7b.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,91 +729,119 @@ 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
|
+
let t = e.trimStart();
|
|
758
|
+
return /^[-+*]\s+/.test(t) || /^\d+\.\s+/.test(t) || /^>\s?/.test(t) || /^```/.test(t) || /^~~~/.test(t);
|
|
759
|
+
}
|
|
760
|
+
function He(e) {
|
|
761
|
+
let t = [], n = [], r = !1;
|
|
762
|
+
return e.forEach((e) => {
|
|
763
|
+
if (r) {
|
|
764
|
+
n.push(e);
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
if (e.trim() === "") {
|
|
768
|
+
r = !0, n.push(e);
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
if (t.length > 0 && Ve(e)) {
|
|
772
|
+
r = !0, n.push(e);
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
t.push(e);
|
|
776
|
+
}), {
|
|
777
|
+
paragraphLines: t,
|
|
778
|
+
blockLines: n
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
function Ue(e) {
|
|
757
782
|
let t = [], n = 0, r = 0;
|
|
758
783
|
for (; n < e.length;) {
|
|
759
|
-
let i = e[n], a = i.match(
|
|
784
|
+
let i = e[n], a = i.match(ze);
|
|
760
785
|
if (!a) break;
|
|
761
|
-
let [, o, s, c] = a, l = o.length, u = c, d = n + 1, f = [i];
|
|
786
|
+
let [, o, s, c] = a, l = o.length, u = [c], d = n + 1, f = [i], p = !1;
|
|
762
787
|
for (; d < e.length;) {
|
|
763
788
|
let t = e[d];
|
|
764
|
-
if (t.match(
|
|
765
|
-
if (t.trim() === "") f.push(t), u
|
|
766
|
-
else if (t.match(
|
|
767
|
-
|
|
768
|
-
|
|
789
|
+
if (t.match(ze)) break;
|
|
790
|
+
if (t.trim() === "") f.push(t), u.push(""), p = !0, d += 1;
|
|
791
|
+
else if (t.match(Be)) f.push(t), u.push(t.slice(l + 2)), d += 1;
|
|
792
|
+
else {
|
|
793
|
+
if (p) break;
|
|
794
|
+
f.push(t), u.push(t), d += 1;
|
|
795
|
+
}
|
|
769
796
|
}
|
|
770
797
|
t.push({
|
|
771
798
|
indent: l,
|
|
772
799
|
number: parseInt(s, 10),
|
|
773
|
-
content: u.trim(),
|
|
800
|
+
content: u.join("\n").trim(),
|
|
801
|
+
contentLines: u,
|
|
774
802
|
raw: f.join("\n")
|
|
775
803
|
}), r = d, n = d;
|
|
776
804
|
}
|
|
777
805
|
return [t, r];
|
|
778
806
|
}
|
|
779
|
-
function
|
|
807
|
+
function We(e, t, n) {
|
|
780
808
|
let r = [], i = 0;
|
|
781
809
|
for (; i < e.length;) {
|
|
782
810
|
let a = e[i];
|
|
783
811
|
if (a.indent === t) {
|
|
784
|
-
let o = a.
|
|
785
|
-
|
|
812
|
+
let { paragraphLines: o, blockLines: s } = He(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
813
|
+
c && l.push({
|
|
786
814
|
type: "paragraph",
|
|
787
|
-
raw:
|
|
788
|
-
tokens: n.inlineTokens(
|
|
815
|
+
raw: c,
|
|
816
|
+
tokens: n.inlineTokens(c)
|
|
789
817
|
});
|
|
790
|
-
let
|
|
791
|
-
if (
|
|
792
|
-
let e = n.blockTokens(
|
|
793
|
-
|
|
818
|
+
let u = s.join("\n").trim();
|
|
819
|
+
if (u) {
|
|
820
|
+
let e = n.blockTokens(u);
|
|
821
|
+
l.push(...e);
|
|
794
822
|
}
|
|
795
|
-
let
|
|
796
|
-
for (;
|
|
797
|
-
if (
|
|
798
|
-
let e =
|
|
799
|
-
|
|
823
|
+
let d = i + 1, f = [];
|
|
824
|
+
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
825
|
+
if (f.length > 0) {
|
|
826
|
+
let e = We(f, Math.min(...f.map((e) => e.indent)), n);
|
|
827
|
+
l.push({
|
|
800
828
|
type: "list",
|
|
801
829
|
ordered: !0,
|
|
802
|
-
start:
|
|
830
|
+
start: f[0].number,
|
|
803
831
|
items: e,
|
|
804
|
-
raw:
|
|
832
|
+
raw: f.map((e) => e.raw).join("\n")
|
|
805
833
|
});
|
|
806
834
|
}
|
|
807
835
|
r.push({
|
|
808
836
|
type: "list_item",
|
|
809
837
|
raw: a.raw,
|
|
810
|
-
tokens:
|
|
811
|
-
}), i =
|
|
838
|
+
tokens: l
|
|
839
|
+
}), i = d;
|
|
812
840
|
} else i += 1;
|
|
813
841
|
}
|
|
814
842
|
return r;
|
|
815
843
|
}
|
|
816
|
-
function
|
|
844
|
+
function Ge(e, t) {
|
|
817
845
|
return e.map((e) => {
|
|
818
846
|
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
819
847
|
let n = [];
|
|
@@ -835,7 +863,7 @@ function He(e, t) {
|
|
|
835
863
|
};
|
|
836
864
|
});
|
|
837
865
|
}
|
|
838
|
-
var
|
|
866
|
+
var Ke = "listItem", qe = "textStyle", Je = /^(\d+)\.\s$/, Ye = C.create({
|
|
839
867
|
name: "orderedList",
|
|
840
868
|
addOptions() {
|
|
841
869
|
return {
|
|
@@ -868,18 +896,18 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
868
896
|
let { start: t, ...n } = e;
|
|
869
897
|
return t === 1 ? [
|
|
870
898
|
"ol",
|
|
871
|
-
|
|
899
|
+
i(this.options.HTMLAttributes, n),
|
|
872
900
|
0
|
|
873
901
|
] : [
|
|
874
902
|
"ol",
|
|
875
|
-
|
|
903
|
+
i(this.options.HTMLAttributes, e),
|
|
876
904
|
0
|
|
877
905
|
];
|
|
878
906
|
},
|
|
879
907
|
markdownTokenName: "list",
|
|
880
908
|
parseMarkdown: (e, t) => {
|
|
881
909
|
if (e.type !== "list" || !e.ordered) return [];
|
|
882
|
-
let n = e.start || 1, r = e.items ?
|
|
910
|
+
let n = e.start || 1, r = e.items ? Ge(e.items, t) : [];
|
|
883
911
|
return n === 1 ? {
|
|
884
912
|
type: "orderedList",
|
|
885
913
|
content: r
|
|
@@ -898,9 +926,9 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
898
926
|
return t === void 0 ? -1 : t;
|
|
899
927
|
},
|
|
900
928
|
tokenize: (e, t, n) => {
|
|
901
|
-
let r = e.split("\n"), [i, a] =
|
|
929
|
+
let r = e.split("\n"), [i, a] = Ue(r);
|
|
902
930
|
if (i.length === 0) return;
|
|
903
|
-
let o =
|
|
931
|
+
let o = We(i, 0, n);
|
|
904
932
|
if (o.length !== 0) return {
|
|
905
933
|
type: "list",
|
|
906
934
|
ordered: !0,
|
|
@@ -912,32 +940,32 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
912
940
|
},
|
|
913
941
|
markdownOptions: { indentsContent: !0 },
|
|
914
942
|
addCommands() {
|
|
915
|
-
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) };
|
|
916
944
|
},
|
|
917
945
|
addKeyboardShortcuts() {
|
|
918
946
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
919
947
|
},
|
|
920
948
|
addInputRules() {
|
|
921
|
-
let e =
|
|
922
|
-
find:
|
|
949
|
+
let e = y({
|
|
950
|
+
find: Je,
|
|
923
951
|
type: this.type,
|
|
924
952
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
925
953
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
926
954
|
});
|
|
927
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
928
|
-
find:
|
|
955
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = y({
|
|
956
|
+
find: Je,
|
|
929
957
|
type: this.type,
|
|
930
958
|
keepMarks: this.options.keepMarks,
|
|
931
959
|
keepAttributes: this.options.keepAttributes,
|
|
932
960
|
getAttributes: (e) => ({
|
|
933
961
|
start: +e[1],
|
|
934
|
-
...this.editor.getAttributes(
|
|
962
|
+
...this.editor.getAttributes(qe)
|
|
935
963
|
}),
|
|
936
964
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1],
|
|
937
965
|
editor: this.editor
|
|
938
966
|
})), [e];
|
|
939
967
|
}
|
|
940
|
-
}),
|
|
968
|
+
}), Xe = /^\s*(\[([( |x])?\])\s$/, Ze = C.create({
|
|
941
969
|
name: "taskItem",
|
|
942
970
|
addOptions() {
|
|
943
971
|
return {
|
|
@@ -971,7 +999,7 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
971
999
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
972
1000
|
return [
|
|
973
1001
|
"li",
|
|
974
|
-
|
|
1002
|
+
i(this.options.HTMLAttributes, t, { "data-type": this.name }),
|
|
975
1003
|
[
|
|
976
1004
|
"label",
|
|
977
1005
|
["input", {
|
|
@@ -991,7 +1019,7 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
991
1019
|
}
|
|
992
1020
|
return t.createNode("taskItem", { checked: e.checked || !1 }, n);
|
|
993
1021
|
},
|
|
994
|
-
renderMarkdown: (e, t) =>
|
|
1022
|
+
renderMarkdown: (e, t) => ne(e, t, `- [${e.attrs?.checked ? "x" : " "}] `),
|
|
995
1023
|
addKeyboardShortcuts() {
|
|
996
1024
|
let e = {
|
|
997
1025
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -1035,7 +1063,7 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
1035
1063
|
update: (e) => {
|
|
1036
1064
|
if (e.type !== this.type) return !1;
|
|
1037
1065
|
i.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, l(e);
|
|
1038
|
-
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;
|
|
1039
1067
|
return u.forEach((e) => {
|
|
1040
1068
|
a.has(e) || (e in o ? i.setAttribute(e, o[e]) : i.removeAttribute(e));
|
|
1041
1069
|
}), Object.entries(n).forEach(([e, t]) => {
|
|
@@ -1046,13 +1074,13 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
1046
1074
|
};
|
|
1047
1075
|
},
|
|
1048
1076
|
addInputRules() {
|
|
1049
|
-
return [
|
|
1050
|
-
find:
|
|
1077
|
+
return [y({
|
|
1078
|
+
find: Xe,
|
|
1051
1079
|
type: this.type,
|
|
1052
1080
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
1053
1081
|
})];
|
|
1054
1082
|
}
|
|
1055
|
-
}),
|
|
1083
|
+
}), Qe = C.create({
|
|
1056
1084
|
name: "taskList",
|
|
1057
1085
|
addOptions() {
|
|
1058
1086
|
return {
|
|
@@ -1073,7 +1101,7 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
1073
1101
|
renderHTML({ HTMLAttributes: e }) {
|
|
1074
1102
|
return [
|
|
1075
1103
|
"ul",
|
|
1076
|
-
|
|
1104
|
+
i(this.options.HTMLAttributes, e, { "data-type": this.name }),
|
|
1077
1105
|
0
|
|
1078
1106
|
];
|
|
1079
1107
|
},
|
|
@@ -1088,7 +1116,7 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
1088
1116
|
},
|
|
1089
1117
|
tokenize(e, t, n) {
|
|
1090
1118
|
let r = (e) => {
|
|
1091
|
-
let t =
|
|
1119
|
+
let t = l(e, {
|
|
1092
1120
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1093
1121
|
extractItemData: (e) => ({
|
|
1094
1122
|
indentLevel: e[1].length,
|
|
@@ -1112,7 +1140,7 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
1112
1140
|
raw: t.raw,
|
|
1113
1141
|
items: t.items
|
|
1114
1142
|
}] : n.blockTokens(e);
|
|
1115
|
-
}, i =
|
|
1143
|
+
}, i = l(e, {
|
|
1116
1144
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1117
1145
|
extractItemData: (e) => ({
|
|
1118
1146
|
indentLevel: e[1].length,
|
|
@@ -1146,16 +1174,16 @@ var Ue = "listItem", We = "textStyle", Ge = /^(\d+)\.\s$/, Ke = C.create({
|
|
|
1146
1174
|
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
|
|
1147
1175
|
}
|
|
1148
1176
|
});
|
|
1149
|
-
|
|
1177
|
+
b.create({
|
|
1150
1178
|
name: "listKit",
|
|
1151
1179
|
addExtensions() {
|
|
1152
1180
|
let e = [];
|
|
1153
|
-
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;
|
|
1154
1182
|
}
|
|
1155
1183
|
});
|
|
1156
1184
|
//#endregion
|
|
1157
|
-
//#region ../../node_modules/.
|
|
1158
|
-
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({
|
|
1159
1187
|
name: "paragraph",
|
|
1160
1188
|
priority: 1e3,
|
|
1161
1189
|
addOptions() {
|
|
@@ -1169,7 +1197,7 @@ var B = " ", V = "\xA0", Xe = C.create({
|
|
|
1169
1197
|
renderHTML({ HTMLAttributes: e }) {
|
|
1170
1198
|
return [
|
|
1171
1199
|
"p",
|
|
1172
|
-
|
|
1200
|
+
i(this.options.HTMLAttributes, e),
|
|
1173
1201
|
0
|
|
1174
1202
|
];
|
|
1175
1203
|
},
|
|
@@ -1177,14 +1205,14 @@ var B = " ", V = "\xA0", Xe = C.create({
|
|
|
1177
1205
|
let n = e.tokens || [];
|
|
1178
1206
|
if (n.length === 1 && n[0].type === "image") return t.parseChildren([n[0]]);
|
|
1179
1207
|
let r = t.parseInline(n);
|
|
1180
|
-
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);
|
|
1181
1209
|
},
|
|
1182
1210
|
renderMarkdown: (e, t, n) => {
|
|
1183
1211
|
if (!e) return "";
|
|
1184
1212
|
let r = Array.isArray(e.content) ? e.content : [];
|
|
1185
1213
|
if (r.length === 0) {
|
|
1186
1214
|
let e = Array.isArray(n?.previousNode?.content) ? n.previousNode.content : [];
|
|
1187
|
-
return n?.previousNode?.type === "paragraph" && e.length === 0 ?
|
|
1215
|
+
return n?.previousNode?.type === "paragraph" && e.length === 0 ? z : "";
|
|
1188
1216
|
}
|
|
1189
1217
|
return t.renderChildren(r);
|
|
1190
1218
|
},
|
|
@@ -1194,7 +1222,7 @@ var B = " ", V = "\xA0", Xe = C.create({
|
|
|
1194
1222
|
addKeyboardShortcuts() {
|
|
1195
1223
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
1196
1224
|
}
|
|
1197
|
-
}),
|
|
1225
|
+
}), et = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, tt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, nt = v.create({
|
|
1198
1226
|
name: "strike",
|
|
1199
1227
|
addOptions() {
|
|
1200
1228
|
return { HTMLAttributes: {} };
|
|
@@ -1214,7 +1242,7 @@ var B = " ", V = "\xA0", Xe = C.create({
|
|
|
1214
1242
|
renderHTML({ HTMLAttributes: e }) {
|
|
1215
1243
|
return [
|
|
1216
1244
|
"s",
|
|
1217
|
-
|
|
1245
|
+
i(this.options.HTMLAttributes, e),
|
|
1218
1246
|
0
|
|
1219
1247
|
];
|
|
1220
1248
|
},
|
|
@@ -1232,18 +1260,18 @@ var B = " ", V = "\xA0", Xe = C.create({
|
|
|
1232
1260
|
return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
|
|
1233
1261
|
},
|
|
1234
1262
|
addInputRules() {
|
|
1235
|
-
return [
|
|
1236
|
-
find:
|
|
1263
|
+
return [a({
|
|
1264
|
+
find: et,
|
|
1237
1265
|
type: this.type
|
|
1238
1266
|
})];
|
|
1239
1267
|
},
|
|
1240
1268
|
addPasteRules() {
|
|
1241
|
-
return [
|
|
1242
|
-
find:
|
|
1269
|
+
return [p({
|
|
1270
|
+
find: tt,
|
|
1243
1271
|
type: this.type
|
|
1244
1272
|
})];
|
|
1245
1273
|
}
|
|
1246
|
-
}),
|
|
1274
|
+
}), rt = C.create({
|
|
1247
1275
|
name: "text",
|
|
1248
1276
|
group: "inline",
|
|
1249
1277
|
parseMarkdown: (e) => ({
|
|
@@ -1253,13 +1281,13 @@ var B = " ", V = "\xA0", Xe = C.create({
|
|
|
1253
1281
|
renderMarkdown: (e) => e.text || ""
|
|
1254
1282
|
});
|
|
1255
1283
|
//#endregion
|
|
1256
|
-
//#region ../../node_modules/.
|
|
1257
|
-
function
|
|
1258
|
-
return new
|
|
1259
|
-
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);
|
|
1260
1288
|
} });
|
|
1261
1289
|
}
|
|
1262
|
-
var
|
|
1290
|
+
var at = class {
|
|
1263
1291
|
constructor(e, t) {
|
|
1264
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 = [
|
|
1265
1293
|
"dragover",
|
|
@@ -1335,7 +1363,7 @@ var nt = class {
|
|
|
1335
1363
|
if (t && !i) {
|
|
1336
1364
|
let e = t.pos;
|
|
1337
1365
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
1338
|
-
let t =
|
|
1366
|
+
let t = f(this.editorView.state.doc, e, this.editorView.dragging.slice);
|
|
1339
1367
|
t != null && (e = t);
|
|
1340
1368
|
}
|
|
1341
1369
|
this.setCursor(e), this.scheduleRemoval(5e3);
|
|
@@ -1350,13 +1378,13 @@ var nt = class {
|
|
|
1350
1378
|
dragleave(e) {
|
|
1351
1379
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
1352
1380
|
}
|
|
1353
|
-
},
|
|
1381
|
+
}, V = class e extends u {
|
|
1354
1382
|
constructor(e) {
|
|
1355
1383
|
super(e, e);
|
|
1356
1384
|
}
|
|
1357
1385
|
map(t, n) {
|
|
1358
1386
|
let r = t.resolve(n.map(this.head));
|
|
1359
|
-
return e.valid(r) ? new e(r) :
|
|
1387
|
+
return e.valid(r) ? new e(r) : u.near(r);
|
|
1360
1388
|
}
|
|
1361
1389
|
content() {
|
|
1362
1390
|
return n.empty;
|
|
@@ -1375,11 +1403,11 @@ var nt = class {
|
|
|
1375
1403
|
return new e(t.resolve(n.pos));
|
|
1376
1404
|
}
|
|
1377
1405
|
getBookmark() {
|
|
1378
|
-
return new
|
|
1406
|
+
return new ot(this.anchor);
|
|
1379
1407
|
}
|
|
1380
1408
|
static valid(e) {
|
|
1381
1409
|
let t = e.parent;
|
|
1382
|
-
if (t.inlineContent || !
|
|
1410
|
+
if (t.inlineContent || !ct(e) || !lt(e)) return !1;
|
|
1383
1411
|
let n = t.type.spec.allowGapCursor;
|
|
1384
1412
|
if (n != null) return n;
|
|
1385
1413
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
@@ -1402,7 +1430,7 @@ var nt = class {
|
|
|
1402
1430
|
for (;;) {
|
|
1403
1431
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
1404
1432
|
if (!o) {
|
|
1405
|
-
if (a.isAtom && !a.isText && !
|
|
1433
|
+
if (a.isAtom && !a.isText && !E.isSelectable(a)) {
|
|
1406
1434
|
t = t.doc.resolve(i + a.nodeSize * n), r = !1;
|
|
1407
1435
|
continue search;
|
|
1408
1436
|
}
|
|
@@ -1416,8 +1444,8 @@ var nt = class {
|
|
|
1416
1444
|
}
|
|
1417
1445
|
}
|
|
1418
1446
|
};
|
|
1419
|
-
|
|
1420
|
-
var
|
|
1447
|
+
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom, u.jsonID("gapcursor", V);
|
|
1448
|
+
var ot = class e {
|
|
1421
1449
|
constructor(e) {
|
|
1422
1450
|
this.pos = e;
|
|
1423
1451
|
}
|
|
@@ -1426,13 +1454,13 @@ var rt = class e {
|
|
|
1426
1454
|
}
|
|
1427
1455
|
resolve(e) {
|
|
1428
1456
|
let t = e.resolve(this.pos);
|
|
1429
|
-
return
|
|
1457
|
+
return V.valid(t) ? new V(t) : u.near(t);
|
|
1430
1458
|
}
|
|
1431
1459
|
};
|
|
1432
|
-
function
|
|
1460
|
+
function st(e) {
|
|
1433
1461
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
1434
1462
|
}
|
|
1435
|
-
function
|
|
1463
|
+
function ct(e) {
|
|
1436
1464
|
for (let t = e.depth; t >= 0; t--) {
|
|
1437
1465
|
let n = e.index(t), r = e.node(t);
|
|
1438
1466
|
if (n == 0) {
|
|
@@ -1440,13 +1468,13 @@ function at(e) {
|
|
|
1440
1468
|
continue;
|
|
1441
1469
|
}
|
|
1442
1470
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
1443
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1471
|
+
if (e.childCount == 0 && !e.inlineContent || st(e.type)) return !0;
|
|
1444
1472
|
if (e.inlineContent) return !1;
|
|
1445
1473
|
}
|
|
1446
1474
|
}
|
|
1447
1475
|
return !0;
|
|
1448
1476
|
}
|
|
1449
|
-
function
|
|
1477
|
+
function lt(e) {
|
|
1450
1478
|
for (let t = e.depth; t >= 0; t--) {
|
|
1451
1479
|
let n = e.indexAfter(t), r = e.node(t);
|
|
1452
1480
|
if (n == r.childCount) {
|
|
@@ -1454,90 +1482,90 @@ function ot(e) {
|
|
|
1454
1482
|
continue;
|
|
1455
1483
|
}
|
|
1456
1484
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
1457
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1485
|
+
if (e.childCount == 0 && !e.inlineContent || st(e.type)) return !0;
|
|
1458
1486
|
if (e.inlineContent) return !1;
|
|
1459
1487
|
}
|
|
1460
1488
|
}
|
|
1461
1489
|
return !0;
|
|
1462
1490
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return new
|
|
1465
|
-
decorations:
|
|
1491
|
+
function ut() {
|
|
1492
|
+
return new _({ props: {
|
|
1493
|
+
decorations: mt,
|
|
1466
1494
|
createSelectionBetween(e, t, n) {
|
|
1467
|
-
return t.pos == n.pos &&
|
|
1495
|
+
return t.pos == n.pos && V.valid(n) ? new V(n) : null;
|
|
1468
1496
|
},
|
|
1469
|
-
handleClick:
|
|
1470
|
-
handleKeyDown:
|
|
1471
|
-
handleDOMEvents: { beforeinput:
|
|
1497
|
+
handleClick: ft,
|
|
1498
|
+
handleKeyDown: dt,
|
|
1499
|
+
handleDOMEvents: { beforeinput: pt }
|
|
1472
1500
|
} });
|
|
1473
1501
|
}
|
|
1474
|
-
var
|
|
1475
|
-
ArrowLeft:
|
|
1476
|
-
ArrowRight:
|
|
1477
|
-
ArrowUp:
|
|
1478
|
-
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)
|
|
1479
1507
|
});
|
|
1480
|
-
function
|
|
1481
|
-
let
|
|
1482
|
-
return function(
|
|
1483
|
-
let
|
|
1484
|
-
if (
|
|
1485
|
-
if (!
|
|
1486
|
-
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());
|
|
1487
1515
|
}
|
|
1488
|
-
let l =
|
|
1489
|
-
return l ? (
|
|
1516
|
+
let l = V.findGapCursorFrom(s, n, c);
|
|
1517
|
+
return l ? (i && i(t.tr.setSelection(new V(l))), !0) : !1;
|
|
1490
1518
|
};
|
|
1491
1519
|
}
|
|
1492
|
-
function
|
|
1520
|
+
function ft(e, t, n) {
|
|
1493
1521
|
if (!e || !e.editable) return !1;
|
|
1494
1522
|
let r = e.state.doc.resolve(t);
|
|
1495
|
-
if (!
|
|
1523
|
+
if (!V.valid(r)) return !1;
|
|
1496
1524
|
let i = e.posAtCoords({
|
|
1497
1525
|
left: n.clientX,
|
|
1498
1526
|
top: n.clientY
|
|
1499
1527
|
});
|
|
1500
|
-
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);
|
|
1501
1529
|
}
|
|
1502
|
-
function
|
|
1503
|
-
if (
|
|
1504
|
-
let { $from:
|
|
1505
|
-
if (!
|
|
1506
|
-
let
|
|
1507
|
-
for (let e =
|
|
1508
|
-
let
|
|
1509
|
-
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;
|
|
1510
1538
|
}
|
|
1511
|
-
function
|
|
1512
|
-
if (!(e.selection instanceof
|
|
1539
|
+
function mt(e) {
|
|
1540
|
+
if (!(e.selection instanceof V)) return null;
|
|
1513
1541
|
let t = document.createElement("div");
|
|
1514
|
-
return t.className = "ProseMirror-gapcursor",
|
|
1542
|
+
return t.className = "ProseMirror-gapcursor", w.create(e.doc, [h.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
1515
1543
|
}
|
|
1516
1544
|
//#endregion
|
|
1517
|
-
//#region ../../node_modules/.
|
|
1518
|
-
var
|
|
1519
|
-
|
|
1520
|
-
return e.length ? (e =
|
|
1521
|
-
},
|
|
1522
|
-
return e.length ?
|
|
1523
|
-
},
|
|
1524
|
-
return new
|
|
1525
|
-
},
|
|
1526
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ?
|
|
1527
|
-
},
|
|
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) {
|
|
1528
1556
|
if (!(e < 0 || e >= this.length)) return this.getInner(e);
|
|
1529
|
-
},
|
|
1557
|
+
}, W.prototype.forEach = function(e, t, n) {
|
|
1530
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);
|
|
1531
|
-
},
|
|
1559
|
+
}, W.prototype.map = function(e, t, n) {
|
|
1532
1560
|
t === void 0 && (t = 0), n === void 0 && (n = this.length);
|
|
1533
1561
|
var r = [];
|
|
1534
1562
|
return this.forEach(function(t, n) {
|
|
1535
1563
|
return r.push(e(t, n));
|
|
1536
1564
|
}, t, n), r;
|
|
1537
|
-
},
|
|
1538
|
-
return e instanceof
|
|
1565
|
+
}, W.from = function(e) {
|
|
1566
|
+
return e instanceof W ? e : e && e.length ? new ht(e) : W.empty;
|
|
1539
1567
|
};
|
|
1540
|
-
var
|
|
1568
|
+
var ht = /* @__PURE__ */ function(e) {
|
|
1541
1569
|
function t(t) {
|
|
1542
1570
|
e.call(this), this.values = t;
|
|
1543
1571
|
}
|
|
@@ -1557,17 +1585,17 @@ var ft = /* @__PURE__ */ function(e) {
|
|
|
1557
1585
|
}, t.prototype.forEachInvertedInner = function(e, t, n, r) {
|
|
1558
1586
|
for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
|
|
1559
1587
|
}, t.prototype.leafAppend = function(e) {
|
|
1560
|
-
if (this.length + e.length <=
|
|
1588
|
+
if (this.length + e.length <= U) return new t(this.values.concat(e.flatten()));
|
|
1561
1589
|
}, t.prototype.leafPrepend = function(e) {
|
|
1562
|
-
if (this.length + e.length <=
|
|
1590
|
+
if (this.length + e.length <= U) return new t(e.flatten().concat(this.values));
|
|
1563
1591
|
}, n.length.get = function() {
|
|
1564
1592
|
return this.values.length;
|
|
1565
1593
|
}, n.depth.get = function() {
|
|
1566
1594
|
return 0;
|
|
1567
1595
|
}, Object.defineProperties(t.prototype, n), t;
|
|
1568
|
-
}(
|
|
1569
|
-
|
|
1570
|
-
var
|
|
1596
|
+
}(W);
|
|
1597
|
+
W.empty = new ht([]);
|
|
1598
|
+
var gt = /* @__PURE__ */ function(e) {
|
|
1571
1599
|
function t(t, n) {
|
|
1572
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;
|
|
1573
1601
|
}
|
|
@@ -1594,11 +1622,11 @@ var pt = /* @__PURE__ */ function(e) {
|
|
|
1594
1622
|
}, t.prototype.appendInner = function(e) {
|
|
1595
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);
|
|
1596
1624
|
}, t;
|
|
1597
|
-
}(
|
|
1625
|
+
}(W), _t = 500, G = class e {
|
|
1598
1626
|
constructor(e, t) {
|
|
1599
1627
|
this.items = e, this.eventCount = t;
|
|
1600
1628
|
}
|
|
1601
|
-
popEvent(
|
|
1629
|
+
popEvent(t, n) {
|
|
1602
1630
|
if (this.eventCount == 0) return null;
|
|
1603
1631
|
let r = this.items.length;
|
|
1604
1632
|
for (;; r--) if (this.items.get(r - 1).selection) {
|
|
@@ -1607,64 +1635,64 @@ var pt = /* @__PURE__ */ function(e) {
|
|
|
1607
1635
|
}
|
|
1608
1636
|
let i, a;
|
|
1609
1637
|
n && (i = this.remapping(r, this.items.length), a = i.maps.length);
|
|
1610
|
-
let o =
|
|
1611
|
-
return this.items.forEach((
|
|
1612
|
-
if (!
|
|
1613
|
-
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);
|
|
1614
1642
|
return;
|
|
1615
1643
|
}
|
|
1616
1644
|
if (i) {
|
|
1617
|
-
u.push(new
|
|
1618
|
-
let
|
|
1619
|
-
|
|
1620
|
-
} else o.maybeStep(
|
|
1621
|
-
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;
|
|
1622
1650
|
}, this.items.length, 0), {
|
|
1623
1651
|
remaining: c,
|
|
1624
1652
|
transform: o,
|
|
1625
1653
|
selection: s
|
|
1626
1654
|
};
|
|
1627
1655
|
}
|
|
1628
|
-
addTransform(
|
|
1656
|
+
addTransform(t, n, r, i) {
|
|
1629
1657
|
let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
|
|
1630
|
-
for (let
|
|
1631
|
-
let r =
|
|
1632
|
-
(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);
|
|
1633
1661
|
}
|
|
1634
1662
|
let l = o - r.depth;
|
|
1635
|
-
return l >
|
|
1663
|
+
return l > yt && (s = vt(s, l), o -= l), new e(s.append(a), o);
|
|
1636
1664
|
}
|
|
1637
|
-
remapping(
|
|
1638
|
-
let
|
|
1639
|
-
return this.items.forEach((
|
|
1640
|
-
let i =
|
|
1641
|
-
|
|
1642
|
-
},
|
|
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;
|
|
1643
1671
|
}
|
|
1644
|
-
addMaps(
|
|
1645
|
-
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);
|
|
1646
1674
|
}
|
|
1647
|
-
rebased(
|
|
1675
|
+
rebased(t, n) {
|
|
1648
1676
|
if (!this.eventCount) return this;
|
|
1649
|
-
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;
|
|
1650
1678
|
this.items.forEach((e) => {
|
|
1651
1679
|
e.selection && s--;
|
|
1652
1680
|
}, i);
|
|
1653
1681
|
let c = n;
|
|
1654
|
-
this.items.forEach((
|
|
1682
|
+
this.items.forEach((e) => {
|
|
1655
1683
|
let n = a.getMirror(--c);
|
|
1656
1684
|
if (n == null) return;
|
|
1657
1685
|
o = Math.min(o, n);
|
|
1658
1686
|
let i = a.maps[n];
|
|
1659
|
-
if (
|
|
1660
|
-
let o =
|
|
1661
|
-
l && s++, r.push(new
|
|
1662
|
-
} 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));
|
|
1663
1691
|
}, i);
|
|
1664
1692
|
let l = [];
|
|
1665
|
-
for (let e = n; e < o; e++) l.push(new
|
|
1666
|
-
let u = new
|
|
1667
|
-
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;
|
|
1668
1696
|
}
|
|
1669
1697
|
emptyItemCount() {
|
|
1670
1698
|
let e = 0;
|
|
@@ -1672,30 +1700,30 @@ var pt = /* @__PURE__ */ function(e) {
|
|
|
1672
1700
|
t.step || e++;
|
|
1673
1701
|
}), e;
|
|
1674
1702
|
}
|
|
1675
|
-
compress(
|
|
1676
|
-
let n = this.remapping(0,
|
|
1677
|
-
return this.items.forEach((
|
|
1678
|
-
if (o >=
|
|
1679
|
-
else if (
|
|
1680
|
-
let
|
|
1681
|
-
if (r--, o && n.appendMap(o, r),
|
|
1682
|
-
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));
|
|
1683
1711
|
s && a++;
|
|
1684
|
-
let c = new
|
|
1712
|
+
let c = new K(o.invert(), t, s), l, u = i.length - 1;
|
|
1685
1713
|
(l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
|
|
1686
1714
|
}
|
|
1687
|
-
} else
|
|
1688
|
-
}, this.items.length, 0), new
|
|
1715
|
+
} else e.map && r--;
|
|
1716
|
+
}, this.items.length, 0), new e(W.from(i.reverse()), a);
|
|
1689
1717
|
}
|
|
1690
1718
|
};
|
|
1691
|
-
|
|
1692
|
-
function
|
|
1719
|
+
G.empty = new G(W.empty, 0);
|
|
1720
|
+
function vt(e, t) {
|
|
1693
1721
|
let n;
|
|
1694
1722
|
return e.forEach((e, r) => {
|
|
1695
1723
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
1696
1724
|
}), e.slice(n);
|
|
1697
1725
|
}
|
|
1698
|
-
var
|
|
1726
|
+
var K = class e {
|
|
1699
1727
|
constructor(e, t, n, r) {
|
|
1700
1728
|
this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
|
|
1701
1729
|
}
|
|
@@ -1705,25 +1733,25 @@ var q = class e {
|
|
|
1705
1733
|
if (n) return new e(n.getMap().invert(), n, this.selection);
|
|
1706
1734
|
}
|
|
1707
1735
|
}
|
|
1708
|
-
},
|
|
1736
|
+
}, q = class {
|
|
1709
1737
|
constructor(e, t, n, r, i) {
|
|
1710
1738
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
1711
1739
|
}
|
|
1712
|
-
},
|
|
1713
|
-
function
|
|
1714
|
-
let i = n.getMeta(
|
|
1740
|
+
}, yt = 20;
|
|
1741
|
+
function bt(e, t, n, r) {
|
|
1742
|
+
let i = n.getMeta(Z), a;
|
|
1715
1743
|
if (i) return i.historyState;
|
|
1716
|
-
n.getMeta(
|
|
1744
|
+
n.getMeta(Tt) && (e = new q(e.done, e.undone, null, 0, -1));
|
|
1717
1745
|
let o = n.getMeta("appendedTransaction");
|
|
1718
1746
|
if (n.steps.length == 0) return e;
|
|
1719
|
-
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);
|
|
1720
1748
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
1721
|
-
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !
|
|
1722
|
-
return new
|
|
1723
|
-
} else if (a = n.getMeta("rebased")) return new
|
|
1724
|
-
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);
|
|
1725
1753
|
}
|
|
1726
|
-
function
|
|
1754
|
+
function xt(e, t) {
|
|
1727
1755
|
if (!t) return !1;
|
|
1728
1756
|
if (!e.docChanged) return !0;
|
|
1729
1757
|
let n = !1;
|
|
@@ -1731,12 +1759,12 @@ function vt(e, t) {
|
|
|
1731
1759
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
1732
1760
|
}), n;
|
|
1733
1761
|
}
|
|
1734
|
-
function
|
|
1762
|
+
function St(e) {
|
|
1735
1763
|
let t = [];
|
|
1736
1764
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
1737
1765
|
return t;
|
|
1738
1766
|
}
|
|
1739
|
-
function
|
|
1767
|
+
function J(e, t) {
|
|
1740
1768
|
if (!e) return null;
|
|
1741
1769
|
let n = [];
|
|
1742
1770
|
for (let r = 0; r < e.length; r += 2) {
|
|
@@ -1745,62 +1773,62 @@ function Y(e, t) {
|
|
|
1745
1773
|
}
|
|
1746
1774
|
return n;
|
|
1747
1775
|
}
|
|
1748
|
-
function
|
|
1749
|
-
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);
|
|
1750
1778
|
if (!a) return null;
|
|
1751
|
-
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new
|
|
1752
|
-
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, {
|
|
1753
1781
|
redo: n,
|
|
1754
1782
|
historyState: c
|
|
1755
1783
|
});
|
|
1756
1784
|
}
|
|
1757
|
-
var
|
|
1758
|
-
function
|
|
1785
|
+
var Y = !1, wt = null;
|
|
1786
|
+
function X(e) {
|
|
1759
1787
|
let t = e.plugins;
|
|
1760
|
-
if (
|
|
1761
|
-
|
|
1788
|
+
if (wt != t) {
|
|
1789
|
+
Y = !1, wt = t;
|
|
1762
1790
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
1763
|
-
|
|
1791
|
+
Y = !0;
|
|
1764
1792
|
break;
|
|
1765
1793
|
}
|
|
1766
1794
|
}
|
|
1767
|
-
return
|
|
1795
|
+
return Y;
|
|
1768
1796
|
}
|
|
1769
|
-
var
|
|
1770
|
-
function
|
|
1797
|
+
var Z = new T("history"), Tt = new T("closeHistory");
|
|
1798
|
+
function Et(e = {}) {
|
|
1771
1799
|
return e = {
|
|
1772
1800
|
depth: e.depth || 100,
|
|
1773
1801
|
newGroupDelay: e.newGroupDelay || 500
|
|
1774
|
-
}, new
|
|
1775
|
-
key:
|
|
1802
|
+
}, new _({
|
|
1803
|
+
key: Z,
|
|
1776
1804
|
state: {
|
|
1777
1805
|
init() {
|
|
1778
|
-
return new
|
|
1806
|
+
return new q(G.empty, G.empty, null, 0, -1);
|
|
1779
1807
|
},
|
|
1780
1808
|
apply(t, n, r) {
|
|
1781
|
-
return
|
|
1809
|
+
return bt(n, r, t, e);
|
|
1782
1810
|
}
|
|
1783
1811
|
},
|
|
1784
1812
|
config: e,
|
|
1785
1813
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
1786
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
1814
|
+
let n = t.inputType, r = n == "historyUndo" ? Q : n == "historyRedo" ? Ot : null;
|
|
1787
1815
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
1788
1816
|
} } }
|
|
1789
1817
|
});
|
|
1790
1818
|
}
|
|
1791
|
-
function
|
|
1819
|
+
function Dt(e, t) {
|
|
1792
1820
|
return (n, r) => {
|
|
1793
|
-
let i =
|
|
1821
|
+
let i = Z.getState(n);
|
|
1794
1822
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
1795
1823
|
if (r) {
|
|
1796
|
-
let a =
|
|
1824
|
+
let a = Ct(i, n, e);
|
|
1797
1825
|
a && r(t ? a.scrollIntoView() : a);
|
|
1798
1826
|
}
|
|
1799
1827
|
return !0;
|
|
1800
1828
|
};
|
|
1801
1829
|
}
|
|
1802
|
-
var
|
|
1803
|
-
|
|
1830
|
+
var Q = Dt(!1, !0), Ot = Dt(!0, !0);
|
|
1831
|
+
b.create({
|
|
1804
1832
|
name: "characterCount",
|
|
1805
1833
|
addOptions() {
|
|
1806
1834
|
return {
|
|
@@ -1831,8 +1859,8 @@ y.create({
|
|
|
1831
1859
|
},
|
|
1832
1860
|
addProseMirrorPlugins() {
|
|
1833
1861
|
let e = !1;
|
|
1834
|
-
return [new
|
|
1835
|
-
key: new
|
|
1862
|
+
return [new _({
|
|
1863
|
+
key: new T("characterCount"),
|
|
1836
1864
|
appendTransaction: (t, n, r) => {
|
|
1837
1865
|
if (e) return;
|
|
1838
1866
|
let i = this.options.limit;
|
|
@@ -1861,7 +1889,7 @@ y.create({
|
|
|
1861
1889
|
})];
|
|
1862
1890
|
}
|
|
1863
1891
|
});
|
|
1864
|
-
var
|
|
1892
|
+
var kt = b.create({
|
|
1865
1893
|
name: "dropCursor",
|
|
1866
1894
|
addOptions() {
|
|
1867
1895
|
return {
|
|
@@ -1871,10 +1899,10 @@ var Et = y.create({
|
|
|
1871
1899
|
};
|
|
1872
1900
|
},
|
|
1873
1901
|
addProseMirrorPlugins() {
|
|
1874
|
-
return [
|
|
1902
|
+
return [it(this.options)];
|
|
1875
1903
|
}
|
|
1876
1904
|
});
|
|
1877
|
-
|
|
1905
|
+
b.create({
|
|
1878
1906
|
name: "focus",
|
|
1879
1907
|
addOptions() {
|
|
1880
1908
|
return {
|
|
@@ -1883,11 +1911,11 @@ y.create({
|
|
|
1883
1911
|
};
|
|
1884
1912
|
},
|
|
1885
1913
|
addProseMirrorPlugins() {
|
|
1886
|
-
return [new
|
|
1887
|
-
key: new
|
|
1914
|
+
return [new _({
|
|
1915
|
+
key: new T("focus"),
|
|
1888
1916
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
1889
1917
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
1890
|
-
if (!n || !r) return
|
|
1918
|
+
if (!n || !r) return w.create(e, []);
|
|
1891
1919
|
let o = 0;
|
|
1892
1920
|
this.options.mode === "deepest" && e.descendants((e, t) => {
|
|
1893
1921
|
if (!e.isText) {
|
|
@@ -1899,35 +1927,35 @@ y.create({
|
|
|
1899
1927
|
return e.descendants((e, t) => {
|
|
1900
1928
|
if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
|
|
1901
1929
|
if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
|
|
1902
|
-
a.push(
|
|
1903
|
-
}),
|
|
1930
|
+
a.push(h.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
1931
|
+
}), w.create(e, a);
|
|
1904
1932
|
} }
|
|
1905
1933
|
})];
|
|
1906
1934
|
}
|
|
1907
1935
|
});
|
|
1908
|
-
var
|
|
1936
|
+
var At = b.create({
|
|
1909
1937
|
name: "gapCursor",
|
|
1910
1938
|
addProseMirrorPlugins() {
|
|
1911
|
-
return [
|
|
1939
|
+
return [ut()];
|
|
1912
1940
|
},
|
|
1913
1941
|
extendNodeSchema(e) {
|
|
1914
|
-
return { allowGapCursor:
|
|
1942
|
+
return { allowGapCursor: ee(m(e, "allowGapCursor", {
|
|
1915
1943
|
name: e.name,
|
|
1916
1944
|
options: e.options,
|
|
1917
1945
|
storage: e.storage
|
|
1918
1946
|
})) ?? null };
|
|
1919
1947
|
}
|
|
1920
|
-
}),
|
|
1921
|
-
function
|
|
1948
|
+
}), jt = "placeholder";
|
|
1949
|
+
function Mt(e) {
|
|
1922
1950
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
1923
1951
|
}
|
|
1924
|
-
|
|
1952
|
+
b.create({
|
|
1925
1953
|
name: "placeholder",
|
|
1926
1954
|
addOptions() {
|
|
1927
1955
|
return {
|
|
1928
1956
|
emptyEditorClass: "is-editor-empty",
|
|
1929
1957
|
emptyNodeClass: "is-empty",
|
|
1930
|
-
dataAttribute:
|
|
1958
|
+
dataAttribute: jt,
|
|
1931
1959
|
placeholder: "Write something …",
|
|
1932
1960
|
showOnlyWhenEditable: !0,
|
|
1933
1961
|
showOnlyCurrent: !0,
|
|
@@ -1935,20 +1963,20 @@ y.create({
|
|
|
1935
1963
|
};
|
|
1936
1964
|
},
|
|
1937
1965
|
addProseMirrorPlugins() {
|
|
1938
|
-
let e = this.options.dataAttribute ? `data-${
|
|
1939
|
-
return [new
|
|
1940
|
-
key: new
|
|
1966
|
+
let e = this.options.dataAttribute ? `data-${Mt(this.options.dataAttribute)}` : `data-${jt}`;
|
|
1967
|
+
return [new _({
|
|
1968
|
+
key: new T("placeholder"),
|
|
1941
1969
|
props: { decorations: ({ doc: t, selection: n }) => {
|
|
1942
|
-
let r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor:
|
|
1970
|
+
let r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = n, a = [];
|
|
1943
1971
|
if (!r) return null;
|
|
1944
|
-
let
|
|
1972
|
+
let o = this.editor.isEmpty;
|
|
1945
1973
|
return t.descendants((t, n) => {
|
|
1946
|
-
let r =
|
|
1974
|
+
let r = i >= n && i <= n + t.nodeSize, c = !t.isLeaf && s(t);
|
|
1947
1975
|
if (!t.type.isTextblock) return this.options.includeChildren;
|
|
1948
1976
|
if ((r || !this.options.showOnlyCurrent) && c) {
|
|
1949
1977
|
let i = [this.options.emptyNodeClass];
|
|
1950
|
-
|
|
1951
|
-
let
|
|
1978
|
+
o && i.push(this.options.emptyEditorClass);
|
|
1979
|
+
let s = h.node(n, n + t.nodeSize, {
|
|
1952
1980
|
class: i.join(" "),
|
|
1953
1981
|
[e]: typeof this.options.placeholder == "function" ? this.options.placeholder({
|
|
1954
1982
|
editor: this.editor,
|
|
@@ -1957,32 +1985,32 @@ y.create({
|
|
|
1957
1985
|
hasAnchor: r
|
|
1958
1986
|
}) : this.options.placeholder
|
|
1959
1987
|
});
|
|
1960
|
-
|
|
1988
|
+
a.push(s);
|
|
1961
1989
|
}
|
|
1962
1990
|
return this.options.includeChildren;
|
|
1963
|
-
}),
|
|
1991
|
+
}), w.create(t, a);
|
|
1964
1992
|
} }
|
|
1965
1993
|
})];
|
|
1966
1994
|
}
|
|
1967
|
-
}),
|
|
1995
|
+
}), b.create({
|
|
1968
1996
|
name: "selection",
|
|
1969
1997
|
addOptions() {
|
|
1970
1998
|
return { className: "selection" };
|
|
1971
1999
|
},
|
|
1972
2000
|
addProseMirrorPlugins() {
|
|
1973
2001
|
let { editor: e, options: t } = this;
|
|
1974
|
-
return [new
|
|
1975
|
-
key: new
|
|
2002
|
+
return [new _({
|
|
2003
|
+
key: new T("selection"),
|
|
1976
2004
|
props: { decorations(n) {
|
|
1977
|
-
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 })]);
|
|
1978
2006
|
} }
|
|
1979
2007
|
})];
|
|
1980
2008
|
}
|
|
1981
2009
|
});
|
|
1982
|
-
function
|
|
2010
|
+
function Nt({ types: e, node: t }) {
|
|
1983
2011
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
1984
2012
|
}
|
|
1985
|
-
var
|
|
2013
|
+
var Pt = b.create({
|
|
1986
2014
|
name: "trailingNode",
|
|
1987
2015
|
addOptions() {
|
|
1988
2016
|
return {
|
|
@@ -1991,8 +2019,8 @@ var jt = y.create({
|
|
|
1991
2019
|
};
|
|
1992
2020
|
},
|
|
1993
2021
|
addProseMirrorPlugins() {
|
|
1994
|
-
let e = new
|
|
1995
|
-
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 _({
|
|
1996
2024
|
key: e,
|
|
1997
2025
|
appendTransaction: (n, r, i) => {
|
|
1998
2026
|
let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
|
|
@@ -2001,7 +2029,7 @@ var jt = y.create({
|
|
|
2001
2029
|
state: {
|
|
2002
2030
|
init: (e, t) => {
|
|
2003
2031
|
let r = t.tr.doc.lastChild;
|
|
2004
|
-
return !
|
|
2032
|
+
return !Nt({
|
|
2005
2033
|
node: r,
|
|
2006
2034
|
types: n
|
|
2007
2035
|
});
|
|
@@ -2009,7 +2037,7 @@ var jt = y.create({
|
|
|
2009
2037
|
apply: (e, t) => {
|
|
2010
2038
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
2011
2039
|
let r = e.doc.lastChild;
|
|
2012
|
-
return !
|
|
2040
|
+
return !Nt({
|
|
2013
2041
|
node: r,
|
|
2014
2042
|
types: n
|
|
2015
2043
|
});
|
|
@@ -2017,7 +2045,7 @@ var jt = y.create({
|
|
|
2017
2045
|
}
|
|
2018
2046
|
})];
|
|
2019
2047
|
}
|
|
2020
|
-
}),
|
|
2048
|
+
}), Ft = b.create({
|
|
2021
2049
|
name: "undoRedo",
|
|
2022
2050
|
addOptions() {
|
|
2023
2051
|
return {
|
|
@@ -2027,12 +2055,12 @@ var jt = y.create({
|
|
|
2027
2055
|
},
|
|
2028
2056
|
addCommands() {
|
|
2029
2057
|
return {
|
|
2030
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
2031
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
2058
|
+
undo: () => ({ state: e, dispatch: t }) => Q(e, t),
|
|
2059
|
+
redo: () => ({ state: e, dispatch: t }) => Ot(e, t)
|
|
2032
2060
|
};
|
|
2033
2061
|
},
|
|
2034
2062
|
addProseMirrorPlugins() {
|
|
2035
|
-
return [
|
|
2063
|
+
return [Et(this.options)];
|
|
2036
2064
|
},
|
|
2037
2065
|
addKeyboardShortcuts() {
|
|
2038
2066
|
return {
|
|
@@ -2043,12 +2071,12 @@ var jt = y.create({
|
|
|
2043
2071
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
2044
2072
|
};
|
|
2045
2073
|
}
|
|
2046
|
-
}),
|
|
2074
|
+
}), $ = b.create({
|
|
2047
2075
|
name: "starterKit",
|
|
2048
2076
|
addExtensions() {
|
|
2049
2077
|
let e = [];
|
|
2050
|
-
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;
|
|
2051
2079
|
}
|
|
2052
|
-
}),
|
|
2080
|
+
}), It = $;
|
|
2053
2081
|
//#endregion
|
|
2054
|
-
export {
|
|
2082
|
+
export { $ as StarterKit, It as default };
|