@templatical/editor 0.27.4 → 0.27.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiFeatureMenu-DVQrznsN.js → AiFeatureMenu-YE9qqElA.js} +1 -1
- package/dist/{BlockPreviewCanvas-D9eC04OA.js → BlockPreviewCanvas-CF7r-mw4.js} +1 -1
- package/dist/{CloudHeaderExtras-DX0j3CJ3.js → CloudHeaderExtras-msYo6uhq.js} +4 -4
- package/dist/{CollaboratorBar-BZ-JCjdM.js → CollaboratorBar-D1Tx8cds.js} +1 -1
- package/dist/{ColorPicker-j0TQu5lE.js → ColorPicker-BNfy9BdG.js} +1 -1
- package/dist/{CountdownToolbar-UPdwNvVI.js → CountdownToolbar-D-o_hwsO.js} +3 -3
- package/dist/{MergeTagSuggestion-DGha0WRp.js → MergeTagSuggestion-DflUPfkT.js} +2 -2
- package/dist/{NumberWithSuffix-D9mPtMJB.js → NumberWithSuffix-DZAktKby.js} +1 -1
- package/dist/{ParagraphEditor-C9-jQ5zP.js → ParagraphEditor-CoN76ofC.js} +16 -16
- package/dist/{RestoreVersionDialog-Ds6gEF5u.js → RestoreVersionDialog-DUXGp-Nw.js} +2 -2
- package/dist/{RichTextEditorContent-CO1se6ln.js → RichTextEditorContent-DxicfnPf.js} +1 -1
- package/dist/{SaveBlockDialog-DJIcncsU.js → SaveBlockDialog-D0B9SKf9.js} +13 -13
- package/dist/{SavedBlocksBrowserModal-BUhhkGEb.js → SavedBlocksBrowserModal-vdci8i18.js} +5 -5
- package/dist/{SavedBlocksPanels-DBfPz4iB.js → SavedBlocksPanels-CTmlYwIT.js} +1 -1
- package/dist/{SavedBlocksPickBar-D9NsfzCB.js → SavedBlocksPickBar-DMtV1UKQ.js} +1 -1
- package/dist/{TestEmailModal-DARwBqpV.js → TestEmailModal-4pHgNCmg.js} +4 -4
- package/dist/{TestEmailPanel-BkgAew1S.js → TestEmailPanel-kp84Z0hs.js} +1 -1
- package/dist/{TitleEditor-BWLwZh84.js → TitleEditor-BdRlIm67.js} +6 -6
- package/dist/{TplModal-CJLs8as_.js → TplModal-CUV1Sd-2.js} +1 -1
- package/dist/{VersionHistoryPanels-s45U7XY-.js → VersionHistoryPanels-dyV9JP5G.js} +1 -1
- package/dist/{VersionPreviewBanner-BIy95B34.js → VersionPreviewBanner-Bb1cnMZ3.js} +1 -1
- package/dist/{blockTypeIcons-BjUkQsAe.js → blockTypeIcons-B13kXe55.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-BhtNkpIq.js → AiFeatureMenu-CS62uVuh.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-BhtNkpIq.js.map → AiFeatureMenu-CS62uVuh.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-Bt7fFzIQ.js → BlockPreviewCanvas-DcCqg909.js} +2 -2
- package/dist/cdn/chunks/{BlockPreviewCanvas-Bt7fFzIQ.js.map → BlockPreviewCanvas-DcCqg909.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-CScGpeLl.js → CloudHeaderExtras-d_8bZemh.js} +5 -5
- package/dist/cdn/chunks/CloudHeaderExtras-d_8bZemh.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BH1lM_Ta.js → CollaboratorBar-CpHDWa9D.js} +2 -2
- package/dist/cdn/chunks/{CollaboratorBar-BH1lM_Ta.js.map → CollaboratorBar-CpHDWa9D.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-d4kY7WWd.js → ColorPicker-QPBbkWAs.js} +2 -2
- package/dist/cdn/chunks/{ColorPicker-d4kY7WWd.js.map → ColorPicker-QPBbkWAs.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BRDbI1mM.js → CountdownToolbar-CMJVzd97.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-BRDbI1mM.js.map → CountdownToolbar-CMJVzd97.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-DhllqTA3.js → MergeTagSuggestion-Df7jcLpS.js} +2 -2
- package/dist/cdn/chunks/{MergeTagSuggestion-DhllqTA3.js.map → MergeTagSuggestion-Df7jcLpS.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-mm6AfIv4.js → NumberWithSuffix-DNBrbl4H.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-mm6AfIv4.js.map → NumberWithSuffix-DNBrbl4H.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BgeeE0Gj.js → ParagraphEditor-CbP_rcqb.js} +17 -17
- package/dist/cdn/chunks/{ParagraphEditor-BgeeE0Gj.js.map → ParagraphEditor-CbP_rcqb.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-tfoAQAeP.js → RestoreVersionDialog-DYI-M27i.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-tfoAQAeP.js.map → RestoreVersionDialog-DYI-M27i.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DvLBtUcW.js → RichTextEditorContent-C-kbbKaq.js} +2 -2
- package/dist/cdn/chunks/{RichTextEditorContent-DvLBtUcW.js.map → RichTextEditorContent-C-kbbKaq.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-D67K2lHn.js → SaveBlockDialog-BBwDyRpC.js} +14 -14
- package/dist/cdn/chunks/{SaveBlockDialog-D67K2lHn.js.map → SaveBlockDialog-BBwDyRpC.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BxVR-yDt.js → SavedBlocksBrowserModal-B_zqSoWl.js} +5 -5
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BxVR-yDt.js.map → SavedBlocksBrowserModal-B_zqSoWl.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-VkKCO0uY.js → SavedBlocksPanels-B_XNxwzs.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-VkKCO0uY.js.map → SavedBlocksPanels-B_XNxwzs.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BJHQDgUT.js → SavedBlocksPickBar-C3BP5941.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-BJHQDgUT.js.map → SavedBlocksPickBar-C3BP5941.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-CEBFCevy.js → TestEmailModal-CnoOTm5c.js} +5 -5
- package/dist/cdn/chunks/{TestEmailModal-CEBFCevy.js.map → TestEmailModal-CnoOTm5c.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-C35nqIIl.js → TestEmailPanel-BcvY4bL7.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-C35nqIIl.js.map → TestEmailPanel-BcvY4bL7.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-c2aQCyds.js → TitleEditor-5Ytpa9n2.js} +7 -7
- package/dist/cdn/chunks/{TitleEditor-c2aQCyds.js.map → TitleEditor-5Ytpa9n2.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-DSTVZKuI.js → TplModal-pGADKFOL.js} +2 -2
- package/dist/cdn/chunks/{TplModal-DSTVZKuI.js.map → TplModal-pGADKFOL.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CvWySHUE.js → VersionHistoryPanels-CSryv5rE.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-CvWySHUE.js.map → VersionHistoryPanels-CSryv5rE.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-CBVDWnhq.js → VersionPreviewBanner-C4mr6y2u.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-CBVDWnhq.js.map → VersionPreviewBanner-C4mr6y2u.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-Byo2sA1r.js → extensions-P0lpi6k8.js} +3 -3
- package/dist/cdn/chunks/{extensions-Byo2sA1r.js.map → extensions-P0lpi6k8.js.map} +1 -1
- package/dist/cdn/chunks/{src-BAWlZu4B.js → src-DNhD7a2v.js} +2 -2
- package/dist/cdn/chunks/{src-BAWlZu4B.js.map → src-DNhD7a2v.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-9oK5kn21.js → styleConstants-C_YAPdQS.js} +8 -8
- package/dist/cdn/chunks/{styleConstants-9oK5kn21.js.map → styleConstants-C_YAPdQS.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-DmpGap5g.js → tiptap-DWeSx_P8.js} +1012 -987
- package/dist/cdn/chunks/tiptap-DWeSx_P8.js.map +1 -0
- package/dist/cdn/chunks/{useEditorCore-D84laTMj.js → useEditorCore-DTpSiO4S.js} +3 -3
- package/dist/cdn/chunks/{useEditorCore-D84laTMj.js.map → useEditorCore-DTpSiO4S.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +776 -780
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{dist-Ck9roB6K.js → dist-BLVvhIFj.js} +2 -2
- package/dist/{dist-DMJRSouD.js → dist-C145btxT.js} +255 -250
- package/dist/{dist-C27SeFL5.js → dist-CLc1cpN2.js} +2 -2
- package/dist/{dist-M7m1lYRe.js → dist-CQQNoHxz.js} +2 -2
- package/dist/{dist-g6cbzhZW.js → dist-CclsUQ7r.js} +2 -2
- package/dist/{dist-CYx-E82k.js → dist-CgXIMxZc.js} +2 -2
- package/dist/dist-D-ulkdvF.js +5 -0
- package/dist/{dist-BImfm-46.js → dist-D4Jb08yv.js} +2 -2
- package/dist/{dist-ChYLhoJ4.js → dist-DUn6jY0n.js} +35 -18
- package/dist/{dist-DfpeSdmE.js → dist-Dx-KOuOj.js} +2 -2
- package/dist/{dist-C08jiemd.js → dist-Dz7KUOSg.js} +2 -2
- package/dist/dist-Kf9u4ULN.js +5 -0
- package/dist/{extensions-BV9qfsYr.js → extensions-DWp4eXoE.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/{styleConstants-9oK5kn21.js → styleConstants-C_YAPdQS.js} +7 -7
- package/dist/templatical-editor.js +939 -943
- package/dist/{useEditorCore-D7Gz7_CW.js → useEditorCore--_kmTxxX.js} +2 -2
- package/package.json +20 -20
- package/dist/cdn/chunks/CloudHeaderExtras-CScGpeLl.js.map +0 -1
- package/dist/cdn/chunks/tiptap-DmpGap5g.js.map +0 -1
- package/dist/dist-6YJAWMuf.js +0 -5
- package/dist/dist-8vlm9kfO.js +0 -5
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { Bn as e, Bt as t, Cn as n, Dn as r, Gn as i, Hn as a, Ht as o, Jn as s, Kn as c, Ln as l, Mt as u, T as d, Un as f, Vn as p, Vt as m, Wn as h, Xn as g, Yn as _, Zn as v, f as y, fn as b, ft as ee, gn as x, it as te, jt as ne, m as S, mt as re, nt as ie, pn as C, pt as ae, qn as w, s as T, ut as oe, w as se, yn as ce, zn as E } from "./dist-
|
|
2
|
-
import { Link as le } from "./dist-
|
|
3
|
-
import { Underline as ue } from "./dist-
|
|
4
|
-
//#region ../../node_modules/.pnpm/@tiptap+core@3.30.
|
|
5
|
-
|
|
1
|
+
import { Bn as e, Bt as t, Cn as n, Dn as r, Gn as i, Hn as a, Ht as o, Jn as s, Kn as c, Ln as l, Mt as u, T as d, Un as f, Vn as p, Vt as m, Wn as h, Xn as g, Yn as _, Zn as v, f as y, fn as b, ft as ee, gn as x, it as te, jt as ne, m as S, mt as re, nt as ie, pn as C, pt as ae, qn as w, s as T, ut as oe, w as se, yn as ce, zn as E } from "./dist-DUn6jY0n.js";
|
|
2
|
+
import { Link as le } from "./dist-CQQNoHxz.js";
|
|
3
|
+
import { Underline as ue } from "./dist-Dx-KOuOj.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tiptap+core@3.30.2_@tiptap+pm@3.30.2/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
5
|
+
function de(e, t, n) {
|
|
6
6
|
if (e === "slot") return 0;
|
|
7
7
|
if (e instanceof Function) return e(t);
|
|
8
|
-
let { children:
|
|
8
|
+
let { children: r, ...i } = t ?? {};
|
|
9
9
|
if (e === "svg") throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
|
|
10
|
-
return [
|
|
10
|
+
return n && Array.isArray(r) ? [
|
|
11
11
|
e,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
i,
|
|
13
|
+
...r
|
|
14
|
+
] : [
|
|
15
|
+
e,
|
|
16
|
+
i,
|
|
17
|
+
r
|
|
14
18
|
];
|
|
15
|
-
}
|
|
19
|
+
}
|
|
20
|
+
var D = (e, t) => de(e, t, !1), fe = (e, t) => {
|
|
16
21
|
let { state: n } = e, { selection: r } = n;
|
|
17
22
|
if (!r.empty) return !1;
|
|
18
23
|
let { $from: i } = r;
|
|
@@ -30,7 +35,7 @@ var D = (e, t) => {
|
|
|
30
35
|
let n = i.parent.content, r = new v(n, 0, 0);
|
|
31
36
|
return e.replace(l, i.after(), r), e.setSelection(w.create(e.doc, l + n.size)), e.scrollIntoView(), t(e), !0;
|
|
32
37
|
});
|
|
33
|
-
},
|
|
38
|
+
}, pe = /^\s*>\s$/, me = S.create({
|
|
34
39
|
name: "blockquote",
|
|
35
40
|
addOptions() {
|
|
36
41
|
return { HTMLAttributes: {} };
|
|
@@ -69,16 +74,16 @@ var D = (e, t) => {
|
|
|
69
74
|
addKeyboardShortcuts() {
|
|
70
75
|
return {
|
|
71
76
|
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
|
|
72
|
-
Backspace: () =>
|
|
77
|
+
Backspace: () => fe(this.editor, this.type)
|
|
73
78
|
};
|
|
74
79
|
},
|
|
75
80
|
addInputRules() {
|
|
76
81
|
return [E({
|
|
77
|
-
find:
|
|
82
|
+
find: pe,
|
|
78
83
|
type: this.type
|
|
79
84
|
})];
|
|
80
85
|
}
|
|
81
|
-
}),
|
|
86
|
+
}), he = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, ge = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, _e = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, ve = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, ye = y.create({
|
|
82
87
|
name: "bold",
|
|
83
88
|
addOptions() {
|
|
84
89
|
return { HTMLAttributes: {} };
|
|
@@ -128,30 +133,30 @@ var D = (e, t) => {
|
|
|
128
133
|
},
|
|
129
134
|
addInputRules() {
|
|
130
135
|
return [b({
|
|
131
|
-
find:
|
|
136
|
+
find: he,
|
|
132
137
|
type: this.type
|
|
133
138
|
}), b({
|
|
134
|
-
find:
|
|
139
|
+
find: _e,
|
|
135
140
|
type: this.type
|
|
136
141
|
})];
|
|
137
142
|
},
|
|
138
143
|
addPasteRules() {
|
|
139
144
|
return [C({
|
|
140
|
-
find:
|
|
145
|
+
find: ge,
|
|
141
146
|
type: this.type
|
|
142
147
|
}), C({
|
|
143
|
-
find:
|
|
148
|
+
find: ve,
|
|
144
149
|
type: this.type
|
|
145
150
|
})];
|
|
146
151
|
}
|
|
147
|
-
}),
|
|
152
|
+
}), be = (e) => {
|
|
148
153
|
let t = /`([^`]+)`(?!`)$/.exec(e);
|
|
149
154
|
return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
|
|
150
155
|
index: t.index,
|
|
151
156
|
text: t[0],
|
|
152
157
|
replaceWith: t[1]
|
|
153
158
|
};
|
|
154
|
-
},
|
|
159
|
+
}, xe = (e) => {
|
|
155
160
|
let t = /`([^`]+)`(?!`)/g, n = [], r;
|
|
156
161
|
for (; (r = t.exec(e)) !== null;) r.index > 0 && e[r.index - 1] === "`" || n.push({
|
|
157
162
|
index: r.index,
|
|
@@ -159,7 +164,7 @@ var D = (e, t) => {
|
|
|
159
164
|
replaceWith: r[1]
|
|
160
165
|
});
|
|
161
166
|
return n;
|
|
162
|
-
},
|
|
167
|
+
}, Se = y.create({
|
|
163
168
|
name: "code",
|
|
164
169
|
addOptions() {
|
|
165
170
|
return { HTMLAttributes: {} };
|
|
@@ -195,17 +200,17 @@ var D = (e, t) => {
|
|
|
195
200
|
},
|
|
196
201
|
addInputRules() {
|
|
197
202
|
return [b({
|
|
198
|
-
find:
|
|
203
|
+
find: be,
|
|
199
204
|
type: this.type
|
|
200
205
|
})];
|
|
201
206
|
},
|
|
202
207
|
addPasteRules() {
|
|
203
208
|
return [C({
|
|
204
|
-
find:
|
|
209
|
+
find: xe,
|
|
205
210
|
type: this.type
|
|
206
211
|
})];
|
|
207
212
|
}
|
|
208
|
-
}), O = 4,
|
|
213
|
+
}), O = 4, Ce = /^```([a-z]+)?[\s\n]$/, we = /^~~~([a-z]+)?[\s\n]$/, Te = S.create({
|
|
209
214
|
name: "codeBlock",
|
|
210
215
|
addOptions() {
|
|
211
216
|
return {
|
|
@@ -336,11 +341,11 @@ var D = (e, t) => {
|
|
|
336
341
|
},
|
|
337
342
|
addInputRules() {
|
|
338
343
|
return [l({
|
|
339
|
-
find:
|
|
344
|
+
find: Ce,
|
|
340
345
|
type: this.type,
|
|
341
346
|
getAttributes: (e) => ({ language: e[1] })
|
|
342
347
|
}), l({
|
|
343
|
-
find:
|
|
348
|
+
find: we,
|
|
344
349
|
type: this.type,
|
|
345
350
|
getAttributes: (e) => ({ language: e[1] })
|
|
346
351
|
})];
|
|
@@ -357,12 +362,12 @@ var D = (e, t) => {
|
|
|
357
362
|
} }
|
|
358
363
|
})];
|
|
359
364
|
}
|
|
360
|
-
}),
|
|
365
|
+
}), Ee = S.create({
|
|
361
366
|
name: "doc",
|
|
362
367
|
topNode: !0,
|
|
363
368
|
content: "block+",
|
|
364
369
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n\n") : ""
|
|
365
|
-
}),
|
|
370
|
+
}), De = S.create({
|
|
366
371
|
name: "hardBreak",
|
|
367
372
|
markdownTokenName: "br",
|
|
368
373
|
addOptions() {
|
|
@@ -406,7 +411,7 @@ var D = (e, t) => {
|
|
|
406
411
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
407
412
|
};
|
|
408
413
|
}
|
|
409
|
-
}),
|
|
414
|
+
}), Oe = S.create({
|
|
410
415
|
name: "heading",
|
|
411
416
|
addOptions() {
|
|
412
417
|
return {
|
|
@@ -467,7 +472,7 @@ var D = (e, t) => {
|
|
|
467
472
|
getAttributes: { level: e }
|
|
468
473
|
}));
|
|
469
474
|
}
|
|
470
|
-
}),
|
|
475
|
+
}), ke = S.create({
|
|
471
476
|
name: "horizontalRule",
|
|
472
477
|
addOptions() {
|
|
473
478
|
return {
|
|
@@ -509,7 +514,7 @@ var D = (e, t) => {
|
|
|
509
514
|
type: this.type
|
|
510
515
|
})];
|
|
511
516
|
}
|
|
512
|
-
}),
|
|
517
|
+
}), Ae = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, je = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Me = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Ne = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Pe = y.create({
|
|
513
518
|
name: "italic",
|
|
514
519
|
addOptions() {
|
|
515
520
|
return { HTMLAttributes: {} };
|
|
@@ -557,28 +562,28 @@ var D = (e, t) => {
|
|
|
557
562
|
},
|
|
558
563
|
addInputRules() {
|
|
559
564
|
return [b({
|
|
560
|
-
find:
|
|
565
|
+
find: Ae,
|
|
561
566
|
type: this.type
|
|
562
567
|
}), b({
|
|
563
|
-
find:
|
|
568
|
+
find: Me,
|
|
564
569
|
type: this.type
|
|
565
570
|
})];
|
|
566
571
|
},
|
|
567
572
|
addPasteRules() {
|
|
568
573
|
return [C({
|
|
569
|
-
find:
|
|
574
|
+
find: je,
|
|
570
575
|
type: this.type
|
|
571
576
|
}), C({
|
|
572
|
-
find:
|
|
577
|
+
find: Ne,
|
|
573
578
|
type: this.type
|
|
574
579
|
})];
|
|
575
580
|
}
|
|
576
|
-
}),
|
|
577
|
-
for (var n in t)
|
|
581
|
+
}), Fe = Object.defineProperty, Ie = (e, t) => {
|
|
582
|
+
for (var n in t) Fe(e, n, {
|
|
578
583
|
get: t[n],
|
|
579
584
|
enumerable: !0
|
|
580
585
|
});
|
|
581
|
-
},
|
|
586
|
+
}, Le = "listItem", Re = "textStyle", ze = /^\s*([-+*])\s$/, Be = S.create({
|
|
582
587
|
name: "bulletList",
|
|
583
588
|
addOptions() {
|
|
584
589
|
return {
|
|
@@ -610,26 +615,26 @@ var D = (e, t) => {
|
|
|
610
615
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
|
|
611
616
|
markdownOptions: { indentsContent: !0 },
|
|
612
617
|
addCommands() {
|
|
613
|
-
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
618
|
+
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Le, this.editor.getAttributes(Re)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
614
619
|
},
|
|
615
620
|
addKeyboardShortcuts() {
|
|
616
621
|
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
617
622
|
},
|
|
618
623
|
addInputRules() {
|
|
619
624
|
let e = E({
|
|
620
|
-
find:
|
|
625
|
+
find: ze,
|
|
621
626
|
type: this.type
|
|
622
627
|
});
|
|
623
628
|
return (this.options.keepMarks || this.options.keepAttributes) && (e = E({
|
|
624
|
-
find:
|
|
629
|
+
find: ze,
|
|
625
630
|
type: this.type,
|
|
626
631
|
keepMarks: this.options.keepMarks,
|
|
627
632
|
keepAttributes: this.options.keepAttributes,
|
|
628
|
-
getAttributes: () => this.editor.getAttributes(
|
|
633
|
+
getAttributes: () => this.editor.getAttributes(Re),
|
|
629
634
|
editor: this.editor
|
|
630
635
|
})), [e];
|
|
631
636
|
}
|
|
632
|
-
}),
|
|
637
|
+
}), Ve = (e, t, n) => {
|
|
633
638
|
let { selection: r } = e;
|
|
634
639
|
if (!r.empty) return null;
|
|
635
640
|
let { $from: i } = r;
|
|
@@ -660,24 +665,24 @@ var D = (e, t) => {
|
|
|
660
665
|
insertPos: i.after(a),
|
|
661
666
|
items: f
|
|
662
667
|
};
|
|
663
|
-
},
|
|
664
|
-
let i =
|
|
668
|
+
}, He = (e, t, n, r) => {
|
|
669
|
+
let i = Ve(e, n, r);
|
|
665
670
|
if (!i) return !1;
|
|
666
671
|
let { selection: a } = e, { nestedList: o, nestedListPos: s, insertPos: c, items: l } = i, u = e.tr;
|
|
667
672
|
u.delete(s, s + o.nodeSize);
|
|
668
673
|
let d = u.mapping.map(c);
|
|
669
674
|
return u.insert(d, g.from(l)), u.setSelection(a.map(u.doc, u.mapping)), t && t(u), !0;
|
|
670
|
-
},
|
|
675
|
+
}, Ue = (e, t, n) => He(e.state, e.view.dispatch, t, n), We = (e, t) => T.create({
|
|
671
676
|
name: `${e}BranchingDeleteKeymap`,
|
|
672
677
|
priority: 101,
|
|
673
678
|
addKeyboardShortcuts() {
|
|
674
|
-
let n = () =>
|
|
679
|
+
let n = () => Ue(this.editor, e, t);
|
|
675
680
|
return {
|
|
676
681
|
Delete: n,
|
|
677
682
|
"Mod-Delete": n
|
|
678
683
|
};
|
|
679
684
|
}
|
|
680
|
-
}),
|
|
685
|
+
}), Ge = [
|
|
681
686
|
[1e3, "m"],
|
|
682
687
|
[900, "cm"],
|
|
683
688
|
[500, "d"],
|
|
@@ -691,20 +696,20 @@ var D = (e, t) => {
|
|
|
691
696
|
[5, "v"],
|
|
692
697
|
[4, "iv"],
|
|
693
698
|
[1, "i"]
|
|
694
|
-
], k = "abcdefghijklmnopqrstuvwxyz",
|
|
699
|
+
], k = "abcdefghijklmnopqrstuvwxyz", Ke = String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;
|
|
695
700
|
function A(e) {
|
|
696
701
|
let t = e, n = "";
|
|
697
|
-
for (let [e, r] of
|
|
702
|
+
for (let [e, r] of Ge) for (; t >= e;) n += r, t -= e;
|
|
698
703
|
return n;
|
|
699
704
|
}
|
|
700
|
-
function
|
|
705
|
+
function qe(e) {
|
|
701
706
|
return A(e).toUpperCase();
|
|
702
707
|
}
|
|
703
|
-
function
|
|
708
|
+
function Je(e) {
|
|
704
709
|
let t = e.toLowerCase(), n = 0, r = 0;
|
|
705
710
|
for (; n < t.length;) {
|
|
706
711
|
let e = !1;
|
|
707
|
-
for (let [i, a] of
|
|
712
|
+
for (let [i, a] of Ge) if (t.startsWith(a, n)) {
|
|
708
713
|
r += i, n += a.length, e = !0;
|
|
709
714
|
break;
|
|
710
715
|
}
|
|
@@ -712,12 +717,12 @@ function qe(e) {
|
|
|
712
717
|
}
|
|
713
718
|
return r;
|
|
714
719
|
}
|
|
715
|
-
function
|
|
720
|
+
function Ye(e) {
|
|
716
721
|
if (!/^[ivxlcdmIVXLCDM]+$/.test(e)) return !1;
|
|
717
|
-
let t =
|
|
718
|
-
return t <= 0 ? !1 : (e === e.toLowerCase() ? A(t) :
|
|
722
|
+
let t = Je(e);
|
|
723
|
+
return t <= 0 ? !1 : (e === e.toLowerCase() ? A(t) : qe(t)) === e;
|
|
719
724
|
}
|
|
720
|
-
function
|
|
725
|
+
function Xe(e) {
|
|
721
726
|
let t = e.toLowerCase();
|
|
722
727
|
if (t.length === 1) return t.charCodeAt(0) - 97 + 1;
|
|
723
728
|
if (t.length === 2) {
|
|
@@ -733,75 +738,75 @@ function j(e) {
|
|
|
733
738
|
}
|
|
734
739
|
function M(e) {
|
|
735
740
|
if (!(!e || /^\d+$/.test(e))) {
|
|
736
|
-
if (
|
|
741
|
+
if (Ye(e)) return e === e.toLowerCase() ? "i" : "I";
|
|
737
742
|
if (/^[a-z]{1,2}$/.test(e)) return "a";
|
|
738
743
|
if (/^[A-Z]{1,2}$/.test(e)) return "A";
|
|
739
744
|
}
|
|
740
745
|
}
|
|
741
|
-
function
|
|
746
|
+
function Ze(e) {
|
|
742
747
|
if (/^\d+$/.test(e)) return parseInt(e, 10);
|
|
743
748
|
let t = M(e);
|
|
744
|
-
if (t === "i" || t === "I") return
|
|
749
|
+
if (t === "i" || t === "I") return Je(e);
|
|
745
750
|
if (t === "a" || t === "A") {
|
|
746
|
-
let t =
|
|
751
|
+
let t = Xe(e);
|
|
747
752
|
return t > 0 ? t : 1;
|
|
748
753
|
}
|
|
749
754
|
let n = parseInt(e, 10);
|
|
750
755
|
return Number.isNaN(n) ? 1 : n;
|
|
751
756
|
}
|
|
752
|
-
function
|
|
757
|
+
function Qe(e, t) {
|
|
753
758
|
if (e === "numeric") return String(t);
|
|
754
759
|
switch (e) {
|
|
755
760
|
case "a": return j(t);
|
|
756
761
|
case "A": return j(t).toUpperCase();
|
|
757
762
|
case "i": return A(t);
|
|
758
|
-
case "I": return
|
|
763
|
+
case "I": return qe(t);
|
|
759
764
|
default: return String(t);
|
|
760
765
|
}
|
|
761
766
|
}
|
|
762
|
-
function
|
|
767
|
+
function $e(e) {
|
|
763
768
|
if (e.length === 0) return !1;
|
|
764
|
-
let t = M(e[0]) ?? "numeric", n =
|
|
769
|
+
let t = M(e[0]) ?? "numeric", n = Ze(e[0]);
|
|
765
770
|
if (n < 1) return !1;
|
|
766
771
|
for (let r = 0; r < e.length; r++) {
|
|
767
|
-
let i =
|
|
772
|
+
let i = Qe(t, n + r);
|
|
768
773
|
if (e[r] !== i) return !1;
|
|
769
774
|
}
|
|
770
775
|
return !0;
|
|
771
776
|
}
|
|
772
|
-
function
|
|
777
|
+
function et(e) {
|
|
773
778
|
return {
|
|
774
779
|
type: M(e),
|
|
775
|
-
start:
|
|
780
|
+
start: Ze(e)
|
|
776
781
|
};
|
|
777
782
|
}
|
|
778
|
-
function
|
|
779
|
-
let { type: t, start: n } =
|
|
783
|
+
function tt(e) {
|
|
784
|
+
let { type: t, start: n } = et(e), r = {};
|
|
780
785
|
return t && (r.type = t), n !== 1 && (r.start = n), r;
|
|
781
786
|
}
|
|
782
|
-
function
|
|
787
|
+
function nt(e, t, n = ". ") {
|
|
783
788
|
let r = t + 1;
|
|
784
789
|
if (!e || e === "1") return `${r}${n}`;
|
|
785
790
|
switch (e) {
|
|
786
791
|
case "a": return `${j(r)}${n}`;
|
|
787
792
|
case "A": return `${j(r).toUpperCase()}${n}`;
|
|
788
793
|
case "i": return `${A(r)}${n}`;
|
|
789
|
-
case "I": return `${
|
|
794
|
+
case "I": return `${qe(r)}${n}`;
|
|
790
795
|
default: return `${r}${n}`;
|
|
791
796
|
}
|
|
792
797
|
}
|
|
793
|
-
function
|
|
798
|
+
function rt(e) {
|
|
794
799
|
let t = e.tokens?.[0];
|
|
795
800
|
return !!(e.text && e.tokens?.length === 1 && t?.type === "list" && t.ordered && t.raw === e.text);
|
|
796
801
|
}
|
|
797
|
-
function
|
|
802
|
+
function it(e, t) {
|
|
798
803
|
return t.tokenizeInline ? t.parseInline(t.tokenizeInline(e)) : t.parseInline([{
|
|
799
804
|
type: "text",
|
|
800
805
|
raw: e,
|
|
801
806
|
text: e
|
|
802
807
|
}]);
|
|
803
808
|
}
|
|
804
|
-
var
|
|
809
|
+
var at = S.create({
|
|
805
810
|
name: "listItem",
|
|
806
811
|
addOptions() {
|
|
807
812
|
return {
|
|
@@ -827,11 +832,11 @@ var it = S.create({
|
|
|
827
832
|
if (e.type !== "list_item") return [];
|
|
828
833
|
let n = t.parseBlockChildren ?? t.parseChildren, r = [];
|
|
829
834
|
if (e.tokens && e.tokens.length > 0) {
|
|
830
|
-
if (
|
|
835
|
+
if (rt(e)) return {
|
|
831
836
|
type: "listItem",
|
|
832
837
|
content: [{
|
|
833
838
|
type: "paragraph",
|
|
834
|
-
content:
|
|
839
|
+
content: it(e.text || "", t)
|
|
835
840
|
}]
|
|
836
841
|
};
|
|
837
842
|
if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
|
|
@@ -860,12 +865,12 @@ var it = S.create({
|
|
|
860
865
|
if (e.parentType === "bulletList") return "- ";
|
|
861
866
|
if (e.parentType === "orderedList") {
|
|
862
867
|
let t = e.meta?.parentAttrs?.start || 1;
|
|
863
|
-
return
|
|
868
|
+
return nt(e.meta?.parentAttrs?.type, t - 1 + (e.index || 0), ". ");
|
|
864
869
|
}
|
|
865
870
|
return "- ";
|
|
866
871
|
}, n),
|
|
867
872
|
addExtensions() {
|
|
868
|
-
return [
|
|
873
|
+
return [We(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
|
|
869
874
|
},
|
|
870
875
|
addKeyboardShortcuts() {
|
|
871
876
|
return {
|
|
@@ -875,18 +880,18 @@ var it = S.create({
|
|
|
875
880
|
};
|
|
876
881
|
}
|
|
877
882
|
});
|
|
878
|
-
|
|
883
|
+
Ie({}, {
|
|
879
884
|
findListItemPos: () => N,
|
|
880
885
|
getNextListDepth: () => P,
|
|
881
886
|
handleBackspace: () => F,
|
|
882
887
|
handleDelete: () => I,
|
|
883
|
-
handleTab: () =>
|
|
884
|
-
hasListBefore: () =>
|
|
885
|
-
hasListItemAfter: () =>
|
|
886
|
-
hasListItemBefore: () =>
|
|
887
|
-
listItemHasSubList: () =>
|
|
888
|
-
nextListIsDeeper: () =>
|
|
889
|
-
nextListIsHigher: () =>
|
|
888
|
+
handleTab: () => lt,
|
|
889
|
+
hasListBefore: () => ot,
|
|
890
|
+
hasListItemAfter: () => ut,
|
|
891
|
+
hasListItemBefore: () => dt,
|
|
892
|
+
listItemHasSubList: () => ft,
|
|
893
|
+
nextListIsDeeper: () => st,
|
|
894
|
+
nextListIsHigher: () => ct
|
|
890
895
|
});
|
|
891
896
|
var N = (e, t) => {
|
|
892
897
|
let { $from: n } = t.selection, r = ee(e, t.schema), i = null, a = n.depth, o = n.pos, s = null;
|
|
@@ -900,13 +905,13 @@ var N = (e, t) => {
|
|
|
900
905
|
if (!n) return !1;
|
|
901
906
|
let [, r] = oe(t, e, n.$pos.pos + 4);
|
|
902
907
|
return r;
|
|
903
|
-
},
|
|
908
|
+
}, ot = (e, t, n) => {
|
|
904
909
|
let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
|
|
905
910
|
return !(!a || !n.includes(a.type.name));
|
|
906
911
|
}, F = (e, n, r) => {
|
|
907
912
|
if (e.commands.undoInputRule()) return !0;
|
|
908
913
|
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
909
|
-
if (!t(e.state, n) &&
|
|
914
|
+
if (!t(e.state, n) && ot(e.state, n, r)) {
|
|
910
915
|
let { $anchor: t } = e.state.selection, r = e.state.doc.resolve(t.before() - 1), i = [];
|
|
911
916
|
r.node().descendants((e, t) => {
|
|
912
917
|
e.type.name === n && i.push({
|
|
@@ -925,17 +930,17 @@ var N = (e, t) => {
|
|
|
925
930
|
if (!t(e.state, n) || !u(e.state)) return !1;
|
|
926
931
|
let { $from: i } = e.state.selection, a = i.depth - 1;
|
|
927
932
|
return i.node(a).type !== e.schema.nodes[n] || i.index(a) !== 0 ? !1 : e.chain().liftListItem(n).run();
|
|
928
|
-
},
|
|
933
|
+
}, st = (e, t) => {
|
|
929
934
|
let n = P(e, t), r = N(e, t);
|
|
930
935
|
return !r || !n ? !1 : n > r.depth;
|
|
931
|
-
},
|
|
936
|
+
}, ct = (e, t) => {
|
|
932
937
|
let n = P(e, t), r = N(e, t);
|
|
933
938
|
return !r || !n ? !1 : n < r.depth;
|
|
934
939
|
}, I = (e, n) => {
|
|
935
940
|
if (!t(e.state, n) || !ne(e.state, n)) return !1;
|
|
936
941
|
let { selection: r } = e.state, { $from: i, $to: a } = r;
|
|
937
|
-
return !r.empty && i.sameParent(a) ? !1 :
|
|
938
|
-
},
|
|
942
|
+
return !r.empty && i.sameParent(a) ? !1 : st(n, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(n).joinBackward().run() : ct(n, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
943
|
+
}, lt = (e, n, r) => {
|
|
939
944
|
let { state: i } = e, { selection: a } = i;
|
|
940
945
|
if (!a.empty) return !1;
|
|
941
946
|
let { $from: o } = a;
|
|
@@ -948,19 +953,19 @@ var N = (e, t) => {
|
|
|
948
953
|
if (!c.canReplace(c.childCount, c.childCount, g.from(l))) return !1;
|
|
949
954
|
let u = o.before(), d = o.after(), f = u - 2;
|
|
950
955
|
return e.commands.command(({ tr: e, dispatch: t }) => (t && (e.delete(u, d).insert(f, g.from(l)), e.setSelection(w.create(e.doc, f + 1)), e.scrollIntoView()), !0));
|
|
951
|
-
},
|
|
956
|
+
}, ut = (e, t) => {
|
|
952
957
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - n.parentOffset - 2);
|
|
953
958
|
return r.index() !== r.parent.childCount - 1 && r.nodeAfter?.type.name === e;
|
|
954
|
-
},
|
|
959
|
+
}, dt = (e, t) => {
|
|
955
960
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - 2);
|
|
956
961
|
return r.index() !== 0 && r.nodeBefore?.type.name === e;
|
|
957
|
-
},
|
|
962
|
+
}, ft = (e, t, n) => {
|
|
958
963
|
if (!n) return !1;
|
|
959
964
|
let r = ee(e, t.schema), i = !1;
|
|
960
965
|
return n.descendants((e) => {
|
|
961
966
|
e.type === r && (i = !0);
|
|
962
967
|
}), i;
|
|
963
|
-
},
|
|
968
|
+
}, pt = T.create({
|
|
964
969
|
name: "listKeymap",
|
|
965
970
|
addOptions() {
|
|
966
971
|
return { listTypes: [{
|
|
@@ -998,29 +1003,29 @@ var N = (e, t) => {
|
|
|
998
1003
|
}), t;
|
|
999
1004
|
},
|
|
1000
1005
|
Tab: ({ editor: e }) => {
|
|
1001
|
-
for (let { itemName: t, wrapperNames: n } of this.options.listTypes) if (e.state.schema.nodes[t] !== void 0 &&
|
|
1006
|
+
for (let { itemName: t, wrapperNames: n } of this.options.listTypes) if (e.state.schema.nodes[t] !== void 0 && lt(e, t, n)) return !0;
|
|
1002
1007
|
return !1;
|
|
1003
1008
|
}
|
|
1004
1009
|
};
|
|
1005
1010
|
}
|
|
1006
|
-
}), L = RegExp(`^(\\s*)(${
|
|
1011
|
+
}), L = RegExp(`^(\\s*)(${Ke})([.)])\\s+(.*)$`), mt = /^\s/, R = {
|
|
1007
1012
|
heading: /^#{1,6}(?:\s|$)/,
|
|
1008
1013
|
bulletItem: /^[-+*]\s+/,
|
|
1009
1014
|
codeFence: /^(?:```|~~~)/,
|
|
1010
1015
|
blockMath: /^\$\$/,
|
|
1011
1016
|
thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
|
|
1012
1017
|
};
|
|
1013
|
-
function
|
|
1018
|
+
function ht(e) {
|
|
1014
1019
|
return L.test(e.trimStart());
|
|
1015
1020
|
}
|
|
1016
|
-
function
|
|
1021
|
+
function gt(e) {
|
|
1017
1022
|
let t = e.trimStart();
|
|
1018
|
-
return R.bulletItem.test(t) ||
|
|
1023
|
+
return R.bulletItem.test(t) || ht(t) || R.heading.test(t) || R.thematicBreak.test(t) && !t.startsWith("-") || /^>\s?/.test(t) || R.codeFence.test(t) || R.blockMath.test(t);
|
|
1019
1024
|
}
|
|
1020
|
-
function
|
|
1025
|
+
function _t(e) {
|
|
1021
1026
|
return Object.values(R).some((t) => t.test(e));
|
|
1022
1027
|
}
|
|
1023
|
-
function
|
|
1028
|
+
function vt(e) {
|
|
1024
1029
|
let t = [], n = [], r = !1;
|
|
1025
1030
|
return e.forEach((e) => {
|
|
1026
1031
|
if (r) {
|
|
@@ -1031,7 +1036,7 @@ function _t(e) {
|
|
|
1031
1036
|
r = !0, n.push(e);
|
|
1032
1037
|
return;
|
|
1033
1038
|
}
|
|
1034
|
-
if (t.length > 0 &&
|
|
1039
|
+
if (t.length > 0 && gt(e)) {
|
|
1035
1040
|
r = !0, n.push(e);
|
|
1036
1041
|
return;
|
|
1037
1042
|
}
|
|
@@ -1041,21 +1046,21 @@ function _t(e) {
|
|
|
1041
1046
|
blockLines: n
|
|
1042
1047
|
};
|
|
1043
1048
|
}
|
|
1044
|
-
function
|
|
1049
|
+
function yt(e) {
|
|
1045
1050
|
let t = [], n = 0, r = 0;
|
|
1046
1051
|
for (; n < e.length;) {
|
|
1047
1052
|
let i = e[n], a = i.match(L);
|
|
1048
1053
|
if (!a) break;
|
|
1049
|
-
let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? M(s) : void 0, p = isNaN(d) ?
|
|
1054
|
+
let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? M(s) : void 0, p = isNaN(d) ? Ze(s) : d, m = [l], h = n + 1, g = [i], _ = !1;
|
|
1050
1055
|
for (; h < e.length;) {
|
|
1051
1056
|
let t = e[h];
|
|
1052
1057
|
if (t.match(L)) break;
|
|
1053
1058
|
if (t.trim() === "") g.push(t), m.push(""), _ = !0, h += 1;
|
|
1054
|
-
else if (t.match(
|
|
1059
|
+
else if (t.match(mt)) {
|
|
1055
1060
|
let e = t.length - t.trimStart().length, n = u + s.length + 1;
|
|
1056
1061
|
g.push(t), m.push(t.slice(Math.min(e, n))), h += 1;
|
|
1057
1062
|
} else {
|
|
1058
|
-
if (_ ||
|
|
1063
|
+
if (_ || _t(t)) break;
|
|
1059
1064
|
g.push(t), m.push(t), h += 1;
|
|
1060
1065
|
}
|
|
1061
1066
|
}
|
|
@@ -1070,22 +1075,22 @@ function vt(e) {
|
|
|
1070
1075
|
}
|
|
1071
1076
|
return [t, r];
|
|
1072
1077
|
}
|
|
1073
|
-
var
|
|
1074
|
-
function
|
|
1078
|
+
var bt = RegExp(`^(${Ke})([.)])\\s+(.+)$`);
|
|
1079
|
+
function xt(e) {
|
|
1075
1080
|
let t = e.split("\n").filter((e) => e.trim().length > 0);
|
|
1076
1081
|
if (t.length === 0) return null;
|
|
1077
1082
|
let n = [];
|
|
1078
1083
|
for (let e of t) {
|
|
1079
|
-
let t = e.trim().match(
|
|
1084
|
+
let t = e.trim().match(bt);
|
|
1080
1085
|
if (!t) return null;
|
|
1081
1086
|
n.push({
|
|
1082
1087
|
marker: t[1],
|
|
1083
1088
|
content: t[3]
|
|
1084
1089
|
});
|
|
1085
1090
|
}
|
|
1086
|
-
return
|
|
1091
|
+
return $e(n.map((e) => e.marker)) ? {
|
|
1087
1092
|
type: "orderedList",
|
|
1088
|
-
attrs:
|
|
1093
|
+
attrs: tt(n[0].marker),
|
|
1089
1094
|
content: n.map((e) => ({
|
|
1090
1095
|
type: "listItem",
|
|
1091
1096
|
content: [{
|
|
@@ -1098,12 +1103,12 @@ function bt(e) {
|
|
|
1098
1103
|
}))
|
|
1099
1104
|
} : null;
|
|
1100
1105
|
}
|
|
1101
|
-
function
|
|
1106
|
+
function St(e, t, n) {
|
|
1102
1107
|
let r = [], i = 0;
|
|
1103
1108
|
for (; i < e.length;) {
|
|
1104
1109
|
let a = e[i];
|
|
1105
1110
|
if (a.indent === t) {
|
|
1106
|
-
let { paragraphLines: o, blockLines: s } =
|
|
1111
|
+
let { paragraphLines: o, blockLines: s } = vt(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
1107
1112
|
c && l.push({
|
|
1108
1113
|
type: "paragraph",
|
|
1109
1114
|
raw: c,
|
|
@@ -1117,7 +1122,7 @@ function xt(e, t, n) {
|
|
|
1117
1122
|
let d = i + 1, f = [];
|
|
1118
1123
|
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
1119
1124
|
if (f.length > 0) {
|
|
1120
|
-
let e =
|
|
1125
|
+
let e = St(f, Math.min(...f.map((e) => e.indent)), n);
|
|
1121
1126
|
l.push({
|
|
1122
1127
|
type: "list",
|
|
1123
1128
|
ordered: !0,
|
|
@@ -1136,7 +1141,7 @@ function xt(e, t, n) {
|
|
|
1136
1141
|
}
|
|
1137
1142
|
return r;
|
|
1138
1143
|
}
|
|
1139
|
-
function
|
|
1144
|
+
function Ct(e, t) {
|
|
1140
1145
|
return e.map((e) => {
|
|
1141
1146
|
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
1142
1147
|
let n = [];
|
|
@@ -1158,8 +1163,8 @@ function St(e, t) {
|
|
|
1158
1163
|
};
|
|
1159
1164
|
});
|
|
1160
1165
|
}
|
|
1161
|
-
var
|
|
1162
|
-
function
|
|
1166
|
+
var wt = "listItem", Tt = "textStyle", Et = /^(\d+)\.\s$/;
|
|
1167
|
+
function Dt(e) {
|
|
1163
1168
|
let t = e.match(/list-style-type\s*:\s*([^;]+)/i);
|
|
1164
1169
|
if (!t) return null;
|
|
1165
1170
|
switch (t[1].trim().toLowerCase()) {
|
|
@@ -1172,7 +1177,7 @@ function Et(e) {
|
|
|
1172
1177
|
default: return null;
|
|
1173
1178
|
}
|
|
1174
1179
|
}
|
|
1175
|
-
var
|
|
1180
|
+
var Ot = S.create({
|
|
1176
1181
|
name: "orderedList",
|
|
1177
1182
|
addOptions() {
|
|
1178
1183
|
return {
|
|
@@ -1199,14 +1204,14 @@ var Dt = S.create({
|
|
|
1199
1204
|
if (t) return t;
|
|
1200
1205
|
let n = e.getAttribute("style");
|
|
1201
1206
|
if (n) {
|
|
1202
|
-
let e =
|
|
1207
|
+
let e = Dt(n);
|
|
1203
1208
|
if (e) return e;
|
|
1204
1209
|
}
|
|
1205
1210
|
let r = e.querySelector("li");
|
|
1206
1211
|
if (r) {
|
|
1207
1212
|
let e = r.getAttribute("style");
|
|
1208
1213
|
if (e) {
|
|
1209
|
-
let t =
|
|
1214
|
+
let t = Dt(e);
|
|
1210
1215
|
if (t) return t;
|
|
1211
1216
|
}
|
|
1212
1217
|
}
|
|
@@ -1229,7 +1234,7 @@ var Dt = S.create({
|
|
|
1229
1234
|
markdownTokenName: "list",
|
|
1230
1235
|
parseMarkdown: (e, t) => {
|
|
1231
1236
|
if (e.type !== "list" || !e.ordered) return [];
|
|
1232
|
-
let n = e.start || 1, r = e.typeMarker, i = e.items ?
|
|
1237
|
+
let n = e.start || 1, r = e.typeMarker, i = e.items ? Ct(e.items, t) : [], a = {};
|
|
1233
1238
|
return n !== 1 && (a.start = n), r && (a.type = r), Object.keys(a).length > 0 ? {
|
|
1234
1239
|
type: "orderedList",
|
|
1235
1240
|
attrs: a,
|
|
@@ -1245,9 +1250,9 @@ var Dt = S.create({
|
|
|
1245
1250
|
level: "block",
|
|
1246
1251
|
start: () => -1,
|
|
1247
1252
|
tokenize: (e, t, n) => {
|
|
1248
|
-
let r = e.split("\n"), [i, a] =
|
|
1253
|
+
let r = e.split("\n"), [i, a] = yt(r);
|
|
1249
1254
|
if (i.length === 0) return;
|
|
1250
|
-
let o =
|
|
1255
|
+
let o = St(i, i[0].indent, n);
|
|
1251
1256
|
if (o.length !== 0) return {
|
|
1252
1257
|
type: "list",
|
|
1253
1258
|
ordered: !0,
|
|
@@ -1260,7 +1265,7 @@ var Dt = S.create({
|
|
|
1260
1265
|
},
|
|
1261
1266
|
markdownOptions: { indentsContent: !0 },
|
|
1262
1267
|
addCommands() {
|
|
1263
|
-
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
1268
|
+
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(wt, this.editor.getAttributes(Tt)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
1264
1269
|
},
|
|
1265
1270
|
addKeyboardShortcuts() {
|
|
1266
1271
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
@@ -1270,7 +1275,7 @@ var Dt = S.create({
|
|
|
1270
1275
|
if ((t.clipboardData?.getData("text/html"))?.trim()) return !1;
|
|
1271
1276
|
let n = t.clipboardData?.getData("text/plain");
|
|
1272
1277
|
if (!n) return !1;
|
|
1273
|
-
let r =
|
|
1278
|
+
let r = xt(n);
|
|
1274
1279
|
if (!r) return !1;
|
|
1275
1280
|
try {
|
|
1276
1281
|
let t = e.state.schema.nodeFromJSON(r), n = e.state.tr.replaceSelectionWith(t);
|
|
@@ -1282,25 +1287,25 @@ var Dt = S.create({
|
|
|
1282
1287
|
},
|
|
1283
1288
|
addInputRules() {
|
|
1284
1289
|
let e = (e, t) => (!t.attrs.type || t.attrs.type === "1") && t.childCount + t.attrs.start === +e[1], t = E({
|
|
1285
|
-
find:
|
|
1290
|
+
find: Et,
|
|
1286
1291
|
type: this.type,
|
|
1287
1292
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
1288
1293
|
joinPredicate: e
|
|
1289
1294
|
});
|
|
1290
1295
|
return (this.options.keepMarks || this.options.keepAttributes) && (t = E({
|
|
1291
|
-
find:
|
|
1296
|
+
find: Et,
|
|
1292
1297
|
type: this.type,
|
|
1293
1298
|
keepMarks: this.options.keepMarks,
|
|
1294
1299
|
keepAttributes: this.options.keepAttributes,
|
|
1295
1300
|
getAttributes: (e) => ({
|
|
1296
1301
|
start: +e[1],
|
|
1297
|
-
...this.editor.getAttributes(
|
|
1302
|
+
...this.editor.getAttributes(Tt)
|
|
1298
1303
|
}),
|
|
1299
1304
|
joinPredicate: e,
|
|
1300
1305
|
editor: this.editor
|
|
1301
1306
|
})), [t];
|
|
1302
1307
|
}
|
|
1303
|
-
}),
|
|
1308
|
+
}), kt = /^\s*(\[([( |x])?\])\s$/, At = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0", jt = (e, t, n) => (n?.checkboxLabel)?.call(n, e, t) || `Task item checkbox for ${e.textContent || "empty task item"}`, Mt = S.create({
|
|
1304
1309
|
name: "taskItem",
|
|
1305
1310
|
addOptions() {
|
|
1306
1311
|
return {
|
|
@@ -1360,7 +1365,7 @@ var Dt = S.create({
|
|
|
1360
1365
|
return r(e, t, n);
|
|
1361
1366
|
},
|
|
1362
1367
|
addExtensions() {
|
|
1363
|
-
return this.options.nested ? [
|
|
1368
|
+
return this.options.nested ? [We(this.name, [this.options.taskListTypeName])] : [];
|
|
1364
1369
|
},
|
|
1365
1370
|
addKeyboardShortcuts() {
|
|
1366
1371
|
let e = {
|
|
@@ -1375,9 +1380,9 @@ var Dt = S.create({
|
|
|
1375
1380
|
addNodeView() {
|
|
1376
1381
|
return ({ node: e, HTMLAttributes: t, getPos: n, editor: r }) => {
|
|
1377
1382
|
let i = document.createElement("li"), a = document.createElement("label"), o = document.createElement("span"), s = document.createElement("input"), c = document.createElement("div");
|
|
1378
|
-
o.style.cssText =
|
|
1383
|
+
o.style.cssText = At;
|
|
1379
1384
|
let l = (e) => {
|
|
1380
|
-
let t =
|
|
1385
|
+
let t = jt(e, e.attrs.checked, this.options.a11y);
|
|
1381
1386
|
s.setAttribute("aria-label", t), o.textContent = t;
|
|
1382
1387
|
};
|
|
1383
1388
|
l(e), a.contentEditable = "false", s.type = "checkbox", s.addEventListener("mousedown", (e) => e.preventDefault()), s.addEventListener("change", (t) => {
|
|
@@ -1419,12 +1424,12 @@ var Dt = S.create({
|
|
|
1419
1424
|
},
|
|
1420
1425
|
addInputRules() {
|
|
1421
1426
|
return [E({
|
|
1422
|
-
find:
|
|
1427
|
+
find: kt,
|
|
1423
1428
|
type: this.type,
|
|
1424
1429
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
1425
1430
|
})];
|
|
1426
1431
|
}
|
|
1427
|
-
}),
|
|
1432
|
+
}), Nt = S.create({
|
|
1428
1433
|
name: "taskList",
|
|
1429
1434
|
addOptions() {
|
|
1430
1435
|
return {
|
|
@@ -1526,12 +1531,12 @@ T.create({
|
|
|
1526
1531
|
name: "listKit",
|
|
1527
1532
|
addExtensions() {
|
|
1528
1533
|
let e = [];
|
|
1529
|
-
return this.options.bulletList !== !1 && e.push(
|
|
1534
|
+
return this.options.bulletList !== !1 && e.push(Be.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(at.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(pt.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Ot.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push(Mt.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(Nt.configure(this.options.taskList)), e;
|
|
1530
1535
|
}
|
|
1531
1536
|
});
|
|
1532
1537
|
//#endregion
|
|
1533
|
-
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.30.
|
|
1534
|
-
var z = " ", B = "\xA0",
|
|
1538
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2_/node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
1539
|
+
var z = " ", B = "\xA0", Pt = S.create({
|
|
1535
1540
|
name: "paragraph",
|
|
1536
1541
|
priority: 1e3,
|
|
1537
1542
|
addOptions() {
|
|
@@ -1570,7 +1575,7 @@ var z = " ", B = "\xA0", Nt = S.create({
|
|
|
1570
1575
|
addKeyboardShortcuts() {
|
|
1571
1576
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
1572
1577
|
}
|
|
1573
|
-
}),
|
|
1578
|
+
}), Ft = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, It = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Lt = y.create({
|
|
1574
1579
|
name: "strike",
|
|
1575
1580
|
addOptions() {
|
|
1576
1581
|
return { HTMLAttributes: {} };
|
|
@@ -1609,17 +1614,17 @@ var z = " ", B = "\xA0", Nt = S.create({
|
|
|
1609
1614
|
},
|
|
1610
1615
|
addInputRules() {
|
|
1611
1616
|
return [b({
|
|
1612
|
-
find:
|
|
1617
|
+
find: Ft,
|
|
1613
1618
|
type: this.type
|
|
1614
1619
|
})];
|
|
1615
1620
|
},
|
|
1616
1621
|
addPasteRules() {
|
|
1617
1622
|
return [C({
|
|
1618
|
-
find:
|
|
1623
|
+
find: It,
|
|
1619
1624
|
type: this.type
|
|
1620
1625
|
})];
|
|
1621
1626
|
}
|
|
1622
|
-
}),
|
|
1627
|
+
}), Rt = S.create({
|
|
1623
1628
|
name: "text",
|
|
1624
1629
|
group: "inline",
|
|
1625
1630
|
parseMarkdown: (e) => ({
|
|
@@ -1630,12 +1635,12 @@ var z = " ", B = "\xA0", Nt = S.create({
|
|
|
1630
1635
|
});
|
|
1631
1636
|
//#endregion
|
|
1632
1637
|
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.3/node_modules/prosemirror-dropcursor/dist/index.js
|
|
1633
|
-
function
|
|
1638
|
+
function zt(e = {}) {
|
|
1634
1639
|
return new h({ view(t) {
|
|
1635
|
-
return new
|
|
1640
|
+
return new Bt(t, e);
|
|
1636
1641
|
} });
|
|
1637
1642
|
}
|
|
1638
|
-
var
|
|
1643
|
+
var Bt = class {
|
|
1639
1644
|
constructor(e, t) {
|
|
1640
1645
|
this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.lastDragEvent = null, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
|
|
1641
1646
|
"dragover",
|
|
@@ -1760,11 +1765,11 @@ var zt = class {
|
|
|
1760
1765
|
return new e(t.resolve(n.pos));
|
|
1761
1766
|
}
|
|
1762
1767
|
getBookmark() {
|
|
1763
|
-
return new
|
|
1768
|
+
return new Vt(this.anchor);
|
|
1764
1769
|
}
|
|
1765
1770
|
static valid(e) {
|
|
1766
1771
|
let t = e.parent;
|
|
1767
|
-
if (t.inlineContent || !
|
|
1772
|
+
if (t.inlineContent || !Ut(e) || !Wt(e)) return !1;
|
|
1768
1773
|
let n = t.type.spec.allowGapCursor;
|
|
1769
1774
|
if (n != null) return n;
|
|
1770
1775
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
@@ -1803,7 +1808,7 @@ var zt = class {
|
|
|
1803
1808
|
}
|
|
1804
1809
|
};
|
|
1805
1810
|
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom, c.jsonID("gapcursor", V);
|
|
1806
|
-
var
|
|
1811
|
+
var Vt = class e {
|
|
1807
1812
|
constructor(e) {
|
|
1808
1813
|
this.pos = e;
|
|
1809
1814
|
}
|
|
@@ -1815,10 +1820,10 @@ var Bt = class e {
|
|
|
1815
1820
|
return V.valid(t) ? new V(t) : c.near(t);
|
|
1816
1821
|
}
|
|
1817
1822
|
};
|
|
1818
|
-
function
|
|
1823
|
+
function Ht(e) {
|
|
1819
1824
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
1820
1825
|
}
|
|
1821
|
-
function
|
|
1826
|
+
function Ut(e) {
|
|
1822
1827
|
for (let t = e.depth; t >= 0; t--) {
|
|
1823
1828
|
let n = e.index(t), r = e.node(t);
|
|
1824
1829
|
if (n == 0) {
|
|
@@ -1826,13 +1831,13 @@ function Ht(e) {
|
|
|
1826
1831
|
continue;
|
|
1827
1832
|
}
|
|
1828
1833
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
1829
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1834
|
+
if (e.childCount == 0 && !e.inlineContent || Ht(e.type)) return !0;
|
|
1830
1835
|
if (e.inlineContent) return !1;
|
|
1831
1836
|
}
|
|
1832
1837
|
}
|
|
1833
1838
|
return !0;
|
|
1834
1839
|
}
|
|
1835
|
-
function
|
|
1840
|
+
function Wt(e) {
|
|
1836
1841
|
for (let t = e.depth; t >= 0; t--) {
|
|
1837
1842
|
let n = e.indexAfter(t), r = e.node(t);
|
|
1838
1843
|
if (n == r.childCount) {
|
|
@@ -1840,24 +1845,24 @@ function Ut(e) {
|
|
|
1840
1845
|
continue;
|
|
1841
1846
|
}
|
|
1842
1847
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
1843
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
1848
|
+
if (e.childCount == 0 && !e.inlineContent || Ht(e.type)) return !0;
|
|
1844
1849
|
if (e.inlineContent) return !1;
|
|
1845
1850
|
}
|
|
1846
1851
|
}
|
|
1847
1852
|
return !0;
|
|
1848
1853
|
}
|
|
1849
|
-
function
|
|
1854
|
+
function Gt() {
|
|
1850
1855
|
return new h({ props: {
|
|
1851
|
-
decorations:
|
|
1856
|
+
decorations: Yt,
|
|
1852
1857
|
createSelectionBetween(e, t, n) {
|
|
1853
1858
|
return t.pos == n.pos && V.valid(n) ? new V(n) : null;
|
|
1854
1859
|
},
|
|
1855
|
-
handleClick:
|
|
1856
|
-
handleKeyDown:
|
|
1857
|
-
handleDOMEvents: { beforeinput:
|
|
1860
|
+
handleClick: qt,
|
|
1861
|
+
handleKeyDown: Kt,
|
|
1862
|
+
handleDOMEvents: { beforeinput: Jt }
|
|
1858
1863
|
} });
|
|
1859
1864
|
}
|
|
1860
|
-
var
|
|
1865
|
+
var Kt = e({
|
|
1861
1866
|
ArrowLeft: H("horiz", -1),
|
|
1862
1867
|
ArrowRight: H("horiz", 1),
|
|
1863
1868
|
ArrowUp: H("vert", -1),
|
|
@@ -1875,7 +1880,7 @@ function H(e, t) {
|
|
|
1875
1880
|
return c ? (r && r(e.tr.setSelection(new V(c))), !0) : !1;
|
|
1876
1881
|
};
|
|
1877
1882
|
}
|
|
1878
|
-
function
|
|
1883
|
+
function qt(e, t, n) {
|
|
1879
1884
|
if (!e || !e.editable) return !1;
|
|
1880
1885
|
let r = e.state.doc.resolve(t);
|
|
1881
1886
|
if (!V.valid(r)) return !1;
|
|
@@ -1885,7 +1890,7 @@ function Kt(e, t, n) {
|
|
|
1885
1890
|
});
|
|
1886
1891
|
return i && i.inside > -1 && f.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new V(r))), !0);
|
|
1887
1892
|
}
|
|
1888
|
-
function
|
|
1893
|
+
function Jt(e, t) {
|
|
1889
1894
|
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof V)) return !1;
|
|
1890
1895
|
let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
|
|
1891
1896
|
if (!r) return !1;
|
|
@@ -1894,7 +1899,7 @@ function qt(e, t) {
|
|
|
1894
1899
|
let a = e.state.tr.replace(n.pos, n.pos, new v(i, 0, 0));
|
|
1895
1900
|
return a.setSelection(w.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
1896
1901
|
}
|
|
1897
|
-
function
|
|
1902
|
+
function Yt(e) {
|
|
1898
1903
|
if (!(e.selection instanceof V)) return null;
|
|
1899
1904
|
let t = document.createElement("div");
|
|
1900
1905
|
return t.className = "ProseMirror-gapcursor", a.create(e.doc, [p.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
@@ -1907,7 +1912,7 @@ W.prototype.append = function(e) {
|
|
|
1907
1912
|
}, W.prototype.prepend = function(e) {
|
|
1908
1913
|
return e.length ? W.from(e).append(this) : this;
|
|
1909
1914
|
}, W.prototype.appendInner = function(e) {
|
|
1910
|
-
return new
|
|
1915
|
+
return new Zt(this, e);
|
|
1911
1916
|
}, W.prototype.slice = function(e, t) {
|
|
1912
1917
|
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));
|
|
1913
1918
|
}, W.prototype.get = function(e) {
|
|
@@ -1921,9 +1926,9 @@ W.prototype.append = function(e) {
|
|
|
1921
1926
|
return r.push(e(t, n));
|
|
1922
1927
|
}, t, n), r;
|
|
1923
1928
|
}, W.from = function(e) {
|
|
1924
|
-
return e instanceof W ? e : e && e.length ? new
|
|
1929
|
+
return e instanceof W ? e : e && e.length ? new Xt(e) : W.empty;
|
|
1925
1930
|
};
|
|
1926
|
-
var
|
|
1931
|
+
var Xt = /* @__PURE__ */ function(e) {
|
|
1927
1932
|
function t(t) {
|
|
1928
1933
|
e.call(this), this.values = t;
|
|
1929
1934
|
}
|
|
@@ -1952,8 +1957,8 @@ var Yt = /* @__PURE__ */ function(e) {
|
|
|
1952
1957
|
return 0;
|
|
1953
1958
|
}, Object.defineProperties(t.prototype, n), t;
|
|
1954
1959
|
}(W);
|
|
1955
|
-
W.empty = new
|
|
1956
|
-
var
|
|
1960
|
+
W.empty = new Xt([]);
|
|
1961
|
+
var Zt = /* @__PURE__ */ function(e) {
|
|
1957
1962
|
function t(t, n) {
|
|
1958
1963
|
e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
|
|
1959
1964
|
}
|
|
@@ -1980,7 +1985,7 @@ var Xt = /* @__PURE__ */ function(e) {
|
|
|
1980
1985
|
}, t.prototype.appendInner = function(e) {
|
|
1981
1986
|
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);
|
|
1982
1987
|
}, t;
|
|
1983
|
-
}(W),
|
|
1988
|
+
}(W), Qt = 500, G = class e {
|
|
1984
1989
|
constructor(e, t) {
|
|
1985
1990
|
this.items = e, this.eventCount = t;
|
|
1986
1991
|
}
|
|
@@ -2018,7 +2023,7 @@ var Xt = /* @__PURE__ */ function(e) {
|
|
|
2018
2023
|
(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);
|
|
2019
2024
|
}
|
|
2020
2025
|
let l = o - r.depth;
|
|
2021
|
-
return l >
|
|
2026
|
+
return l > en && (s = $t(s, l), o -= l), new e(s.append(a), o);
|
|
2022
2027
|
}
|
|
2023
2028
|
remapping(e, t) {
|
|
2024
2029
|
let n = new s();
|
|
@@ -2050,7 +2055,7 @@ var Xt = /* @__PURE__ */ function(e) {
|
|
|
2050
2055
|
let l = [];
|
|
2051
2056
|
for (let e = n; e < o; e++) l.push(new K(a.maps[e]));
|
|
2052
2057
|
let u = this.items.slice(0, i).append(l).append(r), d = new e(u, s);
|
|
2053
|
-
return d.emptyItemCount() >
|
|
2058
|
+
return d.emptyItemCount() > Qt && (d = d.compress(this.items.length - r.length)), d;
|
|
2054
2059
|
}
|
|
2055
2060
|
emptyItemCount() {
|
|
2056
2061
|
let e = 0;
|
|
@@ -2075,7 +2080,7 @@ var Xt = /* @__PURE__ */ function(e) {
|
|
|
2075
2080
|
}
|
|
2076
2081
|
};
|
|
2077
2082
|
G.empty = new G(W.empty, 0);
|
|
2078
|
-
function
|
|
2083
|
+
function $t(e, t) {
|
|
2079
2084
|
let n;
|
|
2080
2085
|
return e.forEach((e, r) => {
|
|
2081
2086
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
@@ -2095,21 +2100,21 @@ var K = class e {
|
|
|
2095
2100
|
constructor(e, t, n, r, i) {
|
|
2096
2101
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
2097
2102
|
}
|
|
2098
|
-
},
|
|
2099
|
-
function
|
|
2103
|
+
}, en = 20;
|
|
2104
|
+
function tn(e, t, n, r) {
|
|
2100
2105
|
let i = n.getMeta(Z), a;
|
|
2101
2106
|
if (i) return i.historyState;
|
|
2102
|
-
n.getMeta(
|
|
2107
|
+
n.getMeta(sn) && (e = new q(e.done, e.undone, null, 0, -1));
|
|
2103
2108
|
let o = n.getMeta("appendedTransaction");
|
|
2104
2109
|
if (n.steps.length == 0) return e;
|
|
2105
|
-
if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new q(e.done.addTransform(n, void 0, r, X(t)), e.undone,
|
|
2110
|
+
if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new q(e.done.addTransform(n, void 0, r, X(t)), e.undone, rn(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);
|
|
2106
2111
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
2107
|
-
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !
|
|
2112
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !nn(n, e.prevRanges)), s = o ? J(e.prevRanges, n.mapping) : rn(n.mapping.maps);
|
|
2108
2113
|
return new q(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, X(t)), G.empty, s, n.time, i ?? e.prevComposition);
|
|
2109
2114
|
}
|
|
2110
2115
|
return (a = n.getMeta("rebased")) ? new q(e.done.rebased(n, a), e.undone.rebased(n, a), J(e.prevRanges, n.mapping), e.prevTime, e.prevComposition) : new q(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), J(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
2111
2116
|
}
|
|
2112
|
-
function
|
|
2117
|
+
function nn(e, t) {
|
|
2113
2118
|
if (!t) return !1;
|
|
2114
2119
|
if (!e.docChanged) return !0;
|
|
2115
2120
|
let n = !1;
|
|
@@ -2117,7 +2122,7 @@ function tn(e, t) {
|
|
|
2117
2122
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
2118
2123
|
}), n;
|
|
2119
2124
|
}
|
|
2120
|
-
function
|
|
2125
|
+
function rn(e) {
|
|
2121
2126
|
let t = [];
|
|
2122
2127
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
2123
2128
|
return t;
|
|
@@ -2131,7 +2136,7 @@ function J(e, t) {
|
|
|
2131
2136
|
}
|
|
2132
2137
|
return n;
|
|
2133
2138
|
}
|
|
2134
|
-
function
|
|
2139
|
+
function an(e, t, n) {
|
|
2135
2140
|
let r = X(t), i = Z.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
2136
2141
|
if (!a) return null;
|
|
2137
2142
|
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);
|
|
@@ -2140,11 +2145,11 @@ function rn(e, t, n) {
|
|
|
2140
2145
|
historyState: c
|
|
2141
2146
|
});
|
|
2142
2147
|
}
|
|
2143
|
-
var Y = !1,
|
|
2148
|
+
var Y = !1, on = null;
|
|
2144
2149
|
function X(e) {
|
|
2145
2150
|
let t = e.plugins;
|
|
2146
|
-
if (
|
|
2147
|
-
Y = !1,
|
|
2151
|
+
if (on != t) {
|
|
2152
|
+
Y = !1, on = t;
|
|
2148
2153
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
2149
2154
|
Y = !0;
|
|
2150
2155
|
break;
|
|
@@ -2152,8 +2157,8 @@ function X(e) {
|
|
|
2152
2157
|
}
|
|
2153
2158
|
return Y;
|
|
2154
2159
|
}
|
|
2155
|
-
var Z = new i("history"),
|
|
2156
|
-
function
|
|
2160
|
+
var Z = new i("history"), sn = new i("closeHistory");
|
|
2161
|
+
function cn(e = {}) {
|
|
2157
2162
|
return e = {
|
|
2158
2163
|
depth: e.depth || 100,
|
|
2159
2164
|
newGroupDelay: e.newGroupDelay || 500
|
|
@@ -2164,28 +2169,28 @@ function sn(e = {}) {
|
|
|
2164
2169
|
return new q(G.empty, G.empty, null, 0, -1);
|
|
2165
2170
|
},
|
|
2166
2171
|
apply(t, n, r) {
|
|
2167
|
-
return
|
|
2172
|
+
return tn(n, r, t, e);
|
|
2168
2173
|
}
|
|
2169
2174
|
},
|
|
2170
2175
|
config: e,
|
|
2171
2176
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
2172
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
2177
|
+
let n = t.inputType, r = n == "historyUndo" ? un : n == "historyRedo" ? dn : null;
|
|
2173
2178
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
2174
2179
|
} } }
|
|
2175
2180
|
});
|
|
2176
2181
|
}
|
|
2177
|
-
function
|
|
2182
|
+
function ln(e, t) {
|
|
2178
2183
|
return (n, r) => {
|
|
2179
2184
|
let i = Z.getState(n);
|
|
2180
2185
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
2181
2186
|
if (r) {
|
|
2182
|
-
let a =
|
|
2187
|
+
let a = an(i, n, e);
|
|
2183
2188
|
a && r(t ? a.scrollIntoView() : a);
|
|
2184
2189
|
}
|
|
2185
2190
|
return !0;
|
|
2186
2191
|
};
|
|
2187
2192
|
}
|
|
2188
|
-
var
|
|
2193
|
+
var un = ln(!1, !0), dn = ln(!0, !0);
|
|
2189
2194
|
T.create({
|
|
2190
2195
|
name: "characterCount",
|
|
2191
2196
|
addOptions() {
|
|
@@ -2248,7 +2253,7 @@ T.create({
|
|
|
2248
2253
|
})];
|
|
2249
2254
|
}
|
|
2250
2255
|
});
|
|
2251
|
-
var
|
|
2256
|
+
var fn = T.create({
|
|
2252
2257
|
name: "dropCursor",
|
|
2253
2258
|
addOptions() {
|
|
2254
2259
|
return {
|
|
@@ -2258,7 +2263,7 @@ var dn = T.create({
|
|
|
2258
2263
|
};
|
|
2259
2264
|
},
|
|
2260
2265
|
addProseMirrorPlugins() {
|
|
2261
|
-
return [
|
|
2266
|
+
return [zt(this.options)];
|
|
2262
2267
|
}
|
|
2263
2268
|
});
|
|
2264
2269
|
T.create({
|
|
@@ -2292,10 +2297,10 @@ T.create({
|
|
|
2292
2297
|
})];
|
|
2293
2298
|
}
|
|
2294
2299
|
});
|
|
2295
|
-
var
|
|
2300
|
+
var pn = T.create({
|
|
2296
2301
|
name: "gapCursor",
|
|
2297
2302
|
addProseMirrorPlugins() {
|
|
2298
|
-
return [
|
|
2303
|
+
return [Gt()];
|
|
2299
2304
|
},
|
|
2300
2305
|
extendNodeSchema(e) {
|
|
2301
2306
|
let t = {
|
|
@@ -2305,8 +2310,8 @@ var fn = T.create({
|
|
|
2305
2310
|
};
|
|
2306
2311
|
return { allowGapCursor: se(te(e, "allowGapCursor", t)) ?? null };
|
|
2307
2312
|
}
|
|
2308
|
-
}),
|
|
2309
|
-
function
|
|
2313
|
+
}), mn = "placeholder", hn = new i("tiptap__placeholder");
|
|
2314
|
+
function gn(e) {
|
|
2310
2315
|
let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
|
|
2311
2316
|
return o && u.push(l), p.node(i, i + a.nodeSize, {
|
|
2312
2317
|
class: u.join(" "),
|
|
@@ -2318,14 +2323,14 @@ function hn(e) {
|
|
|
2318
2323
|
}) : n
|
|
2319
2324
|
});
|
|
2320
2325
|
}
|
|
2321
|
-
function
|
|
2326
|
+
function _n(e, t) {
|
|
2322
2327
|
return typeof e == "function" ? e(t) : e;
|
|
2323
2328
|
}
|
|
2324
|
-
function
|
|
2329
|
+
function vn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i, from: a, to: o }) {
|
|
2325
2330
|
let { anchor: s } = i, c = [], l = e.isEmpty;
|
|
2326
2331
|
return r.nodesBetween(a, o, (r, i) => {
|
|
2327
2332
|
let a = s >= i && s <= i + r.nodeSize, o = !r.isLeaf && m(r);
|
|
2328
|
-
return r.type.isTextblock && (a || !t.showOnlyCurrent) && o && c.push(
|
|
2333
|
+
return r.type.isTextblock && (a || !t.showOnlyCurrent) && o && c.push(gn({
|
|
2329
2334
|
editor: e,
|
|
2330
2335
|
isEmptyDoc: l,
|
|
2331
2336
|
dataAttribute: n,
|
|
@@ -2333,7 +2338,7 @@ function _n({ editor: e, options: t, dataAttribute: n, doc: r, selection: i, fro
|
|
|
2333
2338
|
placeholder: t.placeholder,
|
|
2334
2339
|
classes: {
|
|
2335
2340
|
emptyEditor: t.emptyEditorClass,
|
|
2336
|
-
emptyNode:
|
|
2341
|
+
emptyNode: _n(t.emptyNodeClass, {
|
|
2337
2342
|
editor: e,
|
|
2338
2343
|
node: r,
|
|
2339
2344
|
pos: i,
|
|
@@ -2345,14 +2350,14 @@ function _n({ editor: e, options: t, dataAttribute: n, doc: r, selection: i, fro
|
|
|
2345
2350
|
})), t.includeChildren;
|
|
2346
2351
|
}), c;
|
|
2347
2352
|
}
|
|
2348
|
-
function
|
|
2353
|
+
function yn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
2349
2354
|
if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
|
|
2350
2355
|
let { anchor: o } = i, s = [], c = e.isEmpty;
|
|
2351
2356
|
if (t.showOnlyCurrent && !t.includeChildren) {
|
|
2352
2357
|
let i = r.resolve(o), a = i.depth > 0 ? i.node(1) : i.nodeAfter, l = i.depth > 0 ? i.before(1) : o;
|
|
2353
2358
|
if (a && a.type.isTextblock && m(a)) {
|
|
2354
2359
|
let r = o >= l && o <= l + a.nodeSize;
|
|
2355
|
-
s.push(
|
|
2360
|
+
s.push(gn({
|
|
2356
2361
|
editor: e,
|
|
2357
2362
|
isEmptyDoc: c,
|
|
2358
2363
|
dataAttribute: n,
|
|
@@ -2360,7 +2365,7 @@ function vn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
2360
2365
|
placeholder: t.placeholder,
|
|
2361
2366
|
classes: {
|
|
2362
2367
|
emptyEditor: t.emptyEditorClass,
|
|
2363
|
-
emptyNode:
|
|
2368
|
+
emptyNode: _n(t.emptyNodeClass, {
|
|
2364
2369
|
editor: e,
|
|
2365
2370
|
node: a,
|
|
2366
2371
|
pos: l,
|
|
@@ -2371,7 +2376,7 @@ function vn({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
2371
2376
|
pos: l
|
|
2372
2377
|
}));
|
|
2373
2378
|
}
|
|
2374
|
-
} else s.push(...
|
|
2379
|
+
} else s.push(...vn({
|
|
2375
2380
|
editor: e,
|
|
2376
2381
|
options: t,
|
|
2377
2382
|
dataAttribute: n,
|
|
@@ -2408,7 +2413,7 @@ function $(e, t) {
|
|
|
2408
2413
|
to: Math.min(e.content.size, t.to - 1)
|
|
2409
2414
|
};
|
|
2410
2415
|
}
|
|
2411
|
-
function
|
|
2416
|
+
function bn(e, t, n) {
|
|
2412
2417
|
let r = [];
|
|
2413
2418
|
return e.forEach((e, i) => {
|
|
2414
2419
|
let a = i, o = a + e.nodeSize, s = a + 1, c = o + 1;
|
|
@@ -2418,7 +2423,7 @@ function yn(e, t, n) {
|
|
|
2418
2423
|
});
|
|
2419
2424
|
}), r;
|
|
2420
2425
|
}
|
|
2421
|
-
function
|
|
2426
|
+
function xn(e) {
|
|
2422
2427
|
if (e.length === 0) return [];
|
|
2423
2428
|
let t = [...e].sort((e, t) => e.from - t.from), n = [{ ...t[0] }];
|
|
2424
2429
|
for (let e = 1; e < t.length; e += 1) {
|
|
@@ -2427,31 +2432,31 @@ function bn(e) {
|
|
|
2427
2432
|
}
|
|
2428
2433
|
return n;
|
|
2429
2434
|
}
|
|
2430
|
-
function
|
|
2431
|
-
let n =
|
|
2435
|
+
function Sn(e, t) {
|
|
2436
|
+
let n = bn(e, t.from, t.to);
|
|
2432
2437
|
return n.push($(e, Q(e, t.from))), t.to > t.from ? n.push($(e, Q(e, Math.min(t.to, e.content.size + 1) - 1))) : t.from < e.content.size + 1 && n.push($(e, Q(e, Math.min(t.from + 1, e.content.size)))), n;
|
|
2433
2438
|
}
|
|
2434
|
-
function
|
|
2439
|
+
function Cn(e, t, n) {
|
|
2435
2440
|
let r = [];
|
|
2436
2441
|
if (e.docChanged) {
|
|
2437
2442
|
let t = ie(e);
|
|
2438
|
-
for (let e of t) r.push(...
|
|
2443
|
+
for (let e of t) r.push(...Sn(n.doc, e.newRange));
|
|
2439
2444
|
}
|
|
2440
|
-
return e.selectionSet && (r.push($(n.doc, Q(n.doc, e.mapping.map(t.selection.anchor)))), r.push($(n.doc, Q(n.doc, n.selection.anchor)))),
|
|
2445
|
+
return e.selectionSet && (r.push($(n.doc, Q(n.doc, e.mapping.map(t.selection.anchor)))), r.push($(n.doc, Q(n.doc, n.selection.anchor)))), xn(r);
|
|
2441
2446
|
}
|
|
2442
|
-
function
|
|
2447
|
+
function wn(e, t, n) {
|
|
2443
2448
|
let r = Math.max(0, Math.min(e, n.content.size));
|
|
2444
2449
|
return {
|
|
2445
2450
|
from: r,
|
|
2446
2451
|
to: Math.max(r, Math.min(t, n.content.size))
|
|
2447
2452
|
};
|
|
2448
2453
|
}
|
|
2449
|
-
function
|
|
2454
|
+
function Tn({ decorations: e, ranges: t, editor: n, options: r, dataAttribute: i, doc: a, selection: o }) {
|
|
2450
2455
|
let s = e;
|
|
2451
2456
|
for (let e of t) {
|
|
2452
|
-
let { from: t, to: c } =
|
|
2457
|
+
let { from: t, to: c } = wn(e.from, e.to, a), l = s.find(t, c).filter((e) => e.from >= t && e.to <= c);
|
|
2453
2458
|
l.length && (s = s.remove(l));
|
|
2454
|
-
let u =
|
|
2459
|
+
let u = vn({
|
|
2455
2460
|
editor: n,
|
|
2456
2461
|
options: r,
|
|
2457
2462
|
dataAttribute: i,
|
|
@@ -2464,10 +2469,10 @@ function wn({ decorations: e, ranges: t, editor: n, options: r, dataAttribute: i
|
|
|
2464
2469
|
}
|
|
2465
2470
|
return s;
|
|
2466
2471
|
}
|
|
2467
|
-
function
|
|
2472
|
+
function En({ editor: e, options: t, dataAttribute: n }) {
|
|
2468
2473
|
return {
|
|
2469
2474
|
init(r, i) {
|
|
2470
|
-
return
|
|
2475
|
+
return yn({
|
|
2471
2476
|
editor: e,
|
|
2472
2477
|
options: t,
|
|
2473
2478
|
dataAttribute: n,
|
|
@@ -2476,9 +2481,9 @@ function Tn({ editor: e, options: t, dataAttribute: n }) {
|
|
|
2476
2481
|
}) ?? a.empty;
|
|
2477
2482
|
},
|
|
2478
2483
|
apply(r, i, a, o) {
|
|
2479
|
-
return !r.docChanged && !r.selectionSet ? i :
|
|
2484
|
+
return !r.docChanged && !r.selectionSet ? i : Tn({
|
|
2480
2485
|
decorations: i.map(r.mapping, r.doc),
|
|
2481
|
-
ranges:
|
|
2486
|
+
ranges: Cn(r, a, o),
|
|
2482
2487
|
editor: e,
|
|
2483
2488
|
options: t,
|
|
2484
2489
|
dataAttribute: n,
|
|
@@ -2488,25 +2493,25 @@ function Tn({ editor: e, options: t, dataAttribute: n }) {
|
|
|
2488
2493
|
}
|
|
2489
2494
|
};
|
|
2490
2495
|
}
|
|
2491
|
-
function
|
|
2496
|
+
function Dn(e) {
|
|
2492
2497
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
2493
2498
|
}
|
|
2494
|
-
function
|
|
2495
|
-
let n = t.dataAttribute ? `data-${
|
|
2499
|
+
function On({ editor: e, options: t }) {
|
|
2500
|
+
let n = t.dataAttribute ? `data-${Dn(t.dataAttribute)}` : `data-${mn}`, r = t.showOnlyCurrent && !t.includeChildren;
|
|
2496
2501
|
return new h({
|
|
2497
|
-
key:
|
|
2498
|
-
...r ? {} : { state:
|
|
2502
|
+
key: hn,
|
|
2503
|
+
...r ? {} : { state: En({
|
|
2499
2504
|
editor: e,
|
|
2500
2505
|
options: t,
|
|
2501
2506
|
dataAttribute: n
|
|
2502
2507
|
}) },
|
|
2503
|
-
props: { decorations: r ? ({ doc: r, selection: i }) =>
|
|
2508
|
+
props: { decorations: r ? ({ doc: r, selection: i }) => yn({
|
|
2504
2509
|
editor: e,
|
|
2505
2510
|
options: t,
|
|
2506
2511
|
dataAttribute: n,
|
|
2507
2512
|
doc: r,
|
|
2508
2513
|
selection: i
|
|
2509
|
-
}) : (n) => t.showOnlyWhenEditable && !e.isEditable ? a.empty :
|
|
2514
|
+
}) : (n) => t.showOnlyWhenEditable && !e.isEditable ? a.empty : hn.getState(n) ?? a.empty }
|
|
2510
2515
|
});
|
|
2511
2516
|
}
|
|
2512
2517
|
T.create({
|
|
@@ -2515,7 +2520,7 @@ T.create({
|
|
|
2515
2520
|
return {
|
|
2516
2521
|
emptyEditorClass: "is-editor-empty",
|
|
2517
2522
|
emptyNodeClass: "is-empty",
|
|
2518
|
-
dataAttribute:
|
|
2523
|
+
dataAttribute: mn,
|
|
2519
2524
|
placeholder: "Write something …",
|
|
2520
2525
|
showOnlyWhenEditable: !0,
|
|
2521
2526
|
showOnlyCurrent: !0,
|
|
@@ -2523,23 +2528,23 @@ T.create({
|
|
|
2523
2528
|
};
|
|
2524
2529
|
},
|
|
2525
2530
|
addProseMirrorPlugins() {
|
|
2526
|
-
return [
|
|
2531
|
+
return [On({
|
|
2527
2532
|
editor: this.editor,
|
|
2528
2533
|
options: this.options
|
|
2529
2534
|
})];
|
|
2530
2535
|
}
|
|
2531
2536
|
});
|
|
2532
|
-
function
|
|
2537
|
+
function kn(e, t) {
|
|
2533
2538
|
return !e.selection.empty && !o(e.selection) && t.isEditable;
|
|
2534
2539
|
}
|
|
2535
|
-
function
|
|
2536
|
-
return
|
|
2540
|
+
function An(e, t) {
|
|
2541
|
+
return kn(e, t) && !t.isFocused && !t.view.dragging;
|
|
2537
2542
|
}
|
|
2538
|
-
function
|
|
2543
|
+
function jn() {
|
|
2539
2544
|
var e;
|
|
2540
2545
|
(e = window.getSelection()) == null || e.removeAllRanges();
|
|
2541
2546
|
}
|
|
2542
|
-
function
|
|
2547
|
+
function Mn(e) {
|
|
2543
2548
|
e.focus();
|
|
2544
2549
|
}
|
|
2545
2550
|
T.create({
|
|
@@ -2553,15 +2558,15 @@ T.create({
|
|
|
2553
2558
|
key: new i("selection"),
|
|
2554
2559
|
props: {
|
|
2555
2560
|
decorations(n) {
|
|
2556
|
-
return
|
|
2561
|
+
return An(n, e) ? a.create(n.doc, [p.inline(n.selection.from, n.selection.to, { class: t.className })]) : null;
|
|
2557
2562
|
},
|
|
2558
2563
|
handleDOMEvents: {
|
|
2559
2564
|
blur(t) {
|
|
2560
|
-
return
|
|
2565
|
+
return kn(t.state, e) && jn(), !1;
|
|
2561
2566
|
},
|
|
2562
2567
|
focus(t) {
|
|
2563
|
-
return
|
|
2564
|
-
!e.isDestroyed && t.hasFocus() &&
|
|
2568
|
+
return kn(t.state, e) && requestAnimationFrame(() => {
|
|
2569
|
+
!e.isDestroyed && t.hasFocus() && Mn(t);
|
|
2565
2570
|
}), !1;
|
|
2566
2571
|
}
|
|
2567
2572
|
}
|
|
@@ -2569,10 +2574,10 @@ T.create({
|
|
|
2569
2574
|
})];
|
|
2570
2575
|
}
|
|
2571
2576
|
});
|
|
2572
|
-
function
|
|
2577
|
+
function Nn({ types: e, node: t }) {
|
|
2573
2578
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
2574
2579
|
}
|
|
2575
|
-
var
|
|
2580
|
+
var Pn = T.create({
|
|
2576
2581
|
name: "trailingNode",
|
|
2577
2582
|
addOptions() {
|
|
2578
2583
|
return {
|
|
@@ -2591,7 +2596,7 @@ var Nn = T.create({
|
|
|
2591
2596
|
state: {
|
|
2592
2597
|
init: (e, t) => {
|
|
2593
2598
|
let r = t.tr.doc.lastChild;
|
|
2594
|
-
return !
|
|
2599
|
+
return !Nn({
|
|
2595
2600
|
node: r,
|
|
2596
2601
|
types: n
|
|
2597
2602
|
});
|
|
@@ -2599,7 +2604,7 @@ var Nn = T.create({
|
|
|
2599
2604
|
apply: (e, t) => {
|
|
2600
2605
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
2601
2606
|
let r = e.doc.lastChild;
|
|
2602
|
-
return !
|
|
2607
|
+
return !Nn({
|
|
2603
2608
|
node: r,
|
|
2604
2609
|
types: n
|
|
2605
2610
|
});
|
|
@@ -2607,7 +2612,7 @@ var Nn = T.create({
|
|
|
2607
2612
|
}
|
|
2608
2613
|
})];
|
|
2609
2614
|
}
|
|
2610
|
-
}),
|
|
2615
|
+
}), Fn = T.create({
|
|
2611
2616
|
name: "undoRedo",
|
|
2612
2617
|
addOptions() {
|
|
2613
2618
|
return {
|
|
@@ -2617,12 +2622,12 @@ var Nn = T.create({
|
|
|
2617
2622
|
},
|
|
2618
2623
|
addCommands() {
|
|
2619
2624
|
return {
|
|
2620
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
2621
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
2625
|
+
undo: () => ({ state: e, dispatch: t }) => un(e, t),
|
|
2626
|
+
redo: () => ({ state: e, dispatch: t }) => dn(e, t)
|
|
2622
2627
|
};
|
|
2623
2628
|
},
|
|
2624
2629
|
addProseMirrorPlugins() {
|
|
2625
|
-
return [
|
|
2630
|
+
return [cn(this.options)];
|
|
2626
2631
|
},
|
|
2627
2632
|
addKeyboardShortcuts() {
|
|
2628
2633
|
return {
|
|
@@ -2633,12 +2638,12 @@ var Nn = T.create({
|
|
|
2633
2638
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
2634
2639
|
};
|
|
2635
2640
|
}
|
|
2636
|
-
}),
|
|
2641
|
+
}), In = T.create({
|
|
2637
2642
|
name: "starterKit",
|
|
2638
2643
|
addExtensions() {
|
|
2639
2644
|
let e = [];
|
|
2640
|
-
return this.options.bold !== !1 && e.push(
|
|
2645
|
+
return this.options.bold !== !1 && e.push(ye.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(me.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Be.configure(this.options.bulletList)), this.options.code !== !1 && e.push(Se.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(Te.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(Ee.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(fn.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(pn.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(De.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(Oe.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(Fn.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(ke.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(Pe.configure(this.options.italic)), this.options.listItem !== !1 && e.push(at.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(pt.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(le.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(Ot.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(Pt.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(Lt.configure(this.options.strike)), this.options.text !== !1 && e.push(Rt.configure(this.options.text)), this.options.underline !== !1 && e.push(ue.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(Pn.configure(this.options?.trailingNode)), e;
|
|
2641
2646
|
}
|
|
2642
|
-
}),
|
|
2647
|
+
}), Ln = In;
|
|
2643
2648
|
//#endregion
|
|
2644
|
-
export {
|
|
2649
|
+
export { In as StarterKit, Ln as default };
|