@templatical/editor 0.8.4 → 0.8.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/{AiChatSidebar-CnRXeK77.js → AiChatSidebar-uhkhnXQd.js} +1 -1
- package/dist/{AiFeatureMenu-BYDDrpj6.js → AiFeatureMenu-DXNKvXP5.js} +1 -1
- package/dist/{CloudEditor-B9a_K6Cm.js → CloudEditor-BSkPQjwo.js} +6 -6
- package/dist/{CollaboratorBar-HN4whzM-.js → CollaboratorBar-CP76Sh6c.js} +1 -1
- package/dist/{DesignReferenceSidebar-0GwjUn2V.js → DesignReferenceSidebar-CfJqJ7l6.js} +1 -1
- package/dist/{ModuleBrowserModal-DPZBsvqk.js → ModuleBrowserModal-BFQTm6uY.js} +4 -4
- package/dist/{ModulePreviewCanvas-CK4j11-e.js → ModulePreviewCanvas-DeqMpo73.js} +1 -1
- package/dist/{ParagraphEditor-DBus_iHH.js → ParagraphEditor-DqomSbW3.js} +13 -13
- package/dist/{SaveModuleDialog-DORRSbBo.js → SaveModuleDialog-DKcpPeWd.js} +2 -2
- package/dist/{SnapshotHistory-DTMVEk03.js → SnapshotHistory-Z9RQj53S.js} +1 -1
- package/dist/{TestEmailModal-DJmYp0Qi.js → TestEmailModal-C8DhylO1.js} +2 -2
- package/dist/{TitleEditor-70d9AF1V.js → TitleEditor-CgLrn6R3.js} +5 -5
- package/dist/{TplModal-BEfwlvPC.js → TplModal-CbwRwmR3.js} +1 -1
- package/dist/{blockTypeIcons-2DRoPa3K.js → blockTypeIcons-CccKujXP.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js → AiFeatureMenu-ChNv7XXj.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-CcuKnisc.js.map → AiFeatureMenu-ChNv7XXj.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js → BlockIssueBadge-BovmWgok.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-Sr3is7Wr.js.map → BlockIssueBadge-BovmWgok.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js → CloudEditor-CHF_P5OL.js} +7 -7
- package/dist/cdn/chunks/{CloudEditor-Bi10d2Gq.js.map → CloudEditor-CHF_P5OL.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js → CollaboratorBar-Bjr5YSh0.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C0zeecvl.js.map → CollaboratorBar-Bjr5YSh0.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js → CountdownBlock-KyzvhjMF.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CpSUUDDs.js.map → CountdownBlock-KyzvhjMF.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js → CountdownToolbar-bJtMHGYz.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-BBzdR-00.js.map → CountdownToolbar-bJtMHGYz.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js → IssuesPanel-DFSYTQXy.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-Bthq6qoZ.js.map → IssuesPanel-DFSYTQXy.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js → ModuleBrowserModal-DS0BGRhZ.js} +5 -5
- package/dist/cdn/chunks/{ModuleBrowserModal-CFMd6M7E.js.map → ModuleBrowserModal-DS0BGRhZ.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js → ModulePreviewCanvas-Dwn2cA5a.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-BkcPcF5C.js.map → ModulePreviewCanvas-Dwn2cA5a.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js → NumberWithSuffix-BNBeHv0P.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-C2hH_ZIK.js.map → NumberWithSuffix-BNBeHv0P.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js → ParagraphEditor-C4TrTIOm.js} +16 -16
- package/dist/cdn/chunks/{ParagraphEditor-BIWXLPfu.js.map → ParagraphEditor-C4TrTIOm.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js → RichTextEditorContent-HNFFL4aK.js} +2 -2
- package/dist/cdn/chunks/{RichTextEditorContent-DU0gc4bi.js.map → RichTextEditorContent-HNFFL4aK.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js → SaveModuleDialog-CbHqqeID.js} +2 -2
- package/dist/cdn/chunks/{SaveModuleDialog-DR9EZlWe.js.map → SaveModuleDialog-CbHqqeID.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DZcx2N4R.js → TitleEditor-gr-eBUq_.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-DZcx2N4R.js.map → TitleEditor-gr-eBUq_.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js → blockTypeIcons-BUlgu9JL.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-eVGGIdne.js.map → blockTypeIcons-BUlgu9JL.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js → extensions-DK_lVs7A.js} +3 -3
- package/dist/cdn/chunks/{extensions-CvCoOuWB.js.map → extensions-DK_lVs7A.js.map} +1 -1
- package/dist/cdn/chunks/{features-CUYy5kZQ.js → features-LiilsBqW.js} +806 -773
- package/dist/cdn/chunks/features-LiilsBqW.js.map +1 -0
- package/dist/cdn/chunks/{icons-C4zY5-I3.js → icons-Bn2SIR30.js} +2 -2
- package/dist/cdn/chunks/{icons-C4zY5-I3.js.map → icons-Bn2SIR30.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BNt3msId.js → media-library-Bb2PavAd.js} +3 -3
- package/dist/cdn/chunks/{media-library-BNt3msId.js.map → media-library-Bb2PavAd.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BTPRPGB-.js → quality-Bpj6kNxR.js} +180 -154
- package/dist/cdn/chunks/{quality-BTPRPGB-.js.map → quality-Bpj6kNxR.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js → renderer-CYYyu-Di.js} +130 -96
- package/dist/cdn/chunks/{renderer-IOmuuZjJ.js.map → renderer-CYYyu-Di.js.map} +1 -1
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js → src-CQjZnxvw.js} +4 -4
- package/dist/cdn/chunks/{src-Dp0ZFQ4-.js.map → src-CQjZnxvw.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DtgjgsBH.js → styles-5g8XOS68.js} +8 -8
- package/dist/cdn/chunks/{styles-DtgjgsBH.js.map → styles-5g8XOS68.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-BErAJEvo.js → tiptap-BBbH3IT9.js} +849 -725
- package/dist/cdn/chunks/tiptap-BBbH3IT9.js.map +1 -0
- package/dist/cdn/editor.js +5 -5
- package/dist/{cloud-Dz8Ay2FM.js → cloud-VxYMtfXC.js} +1 -1
- package/dist/{dist-BygsE-n3.js → dist-BDgf2G-V.js} +453 -314
- package/dist/{dist-BtDBsF3N.js → dist-BxP6TB0l.js} +2 -2
- package/dist/{dist-DWhP3Dp2.js → dist-BzuC8o3y.js} +1209 -1217
- package/dist/{dist-v-O2Subd.js → dist-C0jo8wtG.js} +2 -2
- package/dist/{dist-BTgujVMy.js → dist-C8wMh_gi.js} +2 -2
- package/dist/{dist-Cipw2HFH.js → dist-CIV3Brg-.js} +37 -4
- package/dist/{dist-BS5Oi67L.js → dist-CUpJmrjt.js} +2 -2
- package/dist/dist-D5lmdi1F.js +5 -0
- package/dist/{dist-T-ORzNfM.js → dist-D8C6jIXM.js} +168 -175
- package/dist/dist-DILjuzSv.js +5 -0
- package/dist/{dist-CDtcJMB2.js → dist-DXaxGLsw.js} +33 -33
- package/dist/{dist-DnGTaPRX.js → dist-DYO-w_Jf.js} +2 -2
- package/dist/{dist-CDZCyoRy.js → dist-UK-lbEBc.js} +2 -2
- package/dist/{extensions-BmGiz8Oo.js → extensions-DeNHyWwh.js} +27 -27
- package/dist/{styles-DFeOGKa_.js → styles-Bgqv7rLA.js} +4 -4
- package/dist/templatical-editor.js +3 -3
- package/dist/{useEditorCore-BXz-UXPd.js → useEditorCore-CaOVDL_m.js} +4 -4
- package/dist/{useMergeTag-CS2bmWA0.js → useMergeTag-RWsgUcSh.js} +1 -1
- package/package.json +21 -21
- package/dist/cdn/chunks/features-CUYy5kZQ.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BErAJEvo.js.map +0 -1
- package/dist/dist-BySzGkeC.js +0 -5
- package/dist/dist-D7JUZ2Kd.js +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Link as
|
|
3
|
-
import { Underline as
|
|
4
|
-
//#region ../../node_modules/.pnpm/@tiptap+core@3.23.
|
|
5
|
-
var
|
|
1
|
+
import { Cn as e, Ct as t, En as n, Gt as r, Ht as i, Jt as a, Mt as o, Nt as s, Qt as c, Sn as l, St as u, Tn as d, Ut as f, X as p, _ as m, _n as h, at as ee, bn as g, c as _, fn as v, gn as y, hn as te, i as b, it as ne, jt as x, mn as S, nn as re, nt as ie, u as C, v as ae, vn as w, wn as oe, xn as T, yn as E } from "./dist-BzuC8o3y.js";
|
|
2
|
+
import { Link as se } from "./dist-DXaxGLsw.js";
|
|
3
|
+
import { Underline as ce } from "./dist-DYO-w_Jf.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tiptap+core@3.23.6_@tiptap+pm@3.23.6/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
5
|
+
var D = (e, t) => {
|
|
6
6
|
if (e === "slot") return 0;
|
|
7
7
|
if (e instanceof Function) return e(t);
|
|
8
8
|
let { children: n, ...r } = t ?? {};
|
|
@@ -12,7 +12,7 @@ var T = (e, t) => {
|
|
|
12
12
|
r,
|
|
13
13
|
n
|
|
14
14
|
];
|
|
15
|
-
},
|
|
15
|
+
}, le = /^\s*>\s$/, ue = C.create({
|
|
16
16
|
name: "blockquote",
|
|
17
17
|
addOptions() {
|
|
18
18
|
return { HTMLAttributes: {} };
|
|
@@ -24,9 +24,9 @@ var T = (e, t) => {
|
|
|
24
24
|
return [{ tag: "blockquote" }];
|
|
25
25
|
},
|
|
26
26
|
renderHTML({ HTMLAttributes: e }) {
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
...
|
|
29
|
-
children: /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ D("blockquote", {
|
|
28
|
+
...r(this.options.HTMLAttributes, e),
|
|
29
|
+
children: /* @__PURE__ */ D("slot", {})
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
32
|
parseMarkdown: (e, t) => {
|
|
@@ -52,12 +52,12 @@ var T = (e, t) => {
|
|
|
52
52
|
return { "Mod-Shift-b": () => this.editor.commands.toggleBlockquote() };
|
|
53
53
|
},
|
|
54
54
|
addInputRules() {
|
|
55
|
-
return [
|
|
56
|
-
find:
|
|
55
|
+
return [S({
|
|
56
|
+
find: le,
|
|
57
57
|
type: this.type
|
|
58
58
|
})];
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
60
|
+
}), de = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, fe = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, pe = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, me = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, he = _.create({
|
|
61
61
|
name: "bold",
|
|
62
62
|
addOptions() {
|
|
63
63
|
return { HTMLAttributes: {} };
|
|
@@ -80,9 +80,9 @@ var T = (e, t) => {
|
|
|
80
80
|
];
|
|
81
81
|
},
|
|
82
82
|
renderHTML({ HTMLAttributes: e }) {
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
...
|
|
85
|
-
children: /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ D("strong", {
|
|
84
|
+
...r(this.options.HTMLAttributes, e),
|
|
85
|
+
children: /* @__PURE__ */ D("slot", {})
|
|
86
86
|
});
|
|
87
87
|
},
|
|
88
88
|
markdownTokenName: "strong",
|
|
@@ -106,24 +106,24 @@ var T = (e, t) => {
|
|
|
106
106
|
};
|
|
107
107
|
},
|
|
108
108
|
addInputRules() {
|
|
109
|
-
return [
|
|
110
|
-
find:
|
|
109
|
+
return [i({
|
|
110
|
+
find: de,
|
|
111
111
|
type: this.type
|
|
112
|
-
}),
|
|
113
|
-
find:
|
|
112
|
+
}), i({
|
|
113
|
+
find: pe,
|
|
114
114
|
type: this.type
|
|
115
115
|
})];
|
|
116
116
|
},
|
|
117
117
|
addPasteRules() {
|
|
118
|
-
return [
|
|
119
|
-
find:
|
|
118
|
+
return [f({
|
|
119
|
+
find: fe,
|
|
120
120
|
type: this.type
|
|
121
|
-
}),
|
|
122
|
-
find:
|
|
121
|
+
}), f({
|
|
122
|
+
find: me,
|
|
123
123
|
type: this.type
|
|
124
124
|
})];
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
126
|
+
}), ge = /(^|[^`])`([^`]+)`(?!`)$/, _e = /(^|[^`])`([^`]+)`(?!`)/g, ve = _.create({
|
|
127
127
|
name: "code",
|
|
128
128
|
addOptions() {
|
|
129
129
|
return { HTMLAttributes: {} };
|
|
@@ -137,7 +137,7 @@ var T = (e, t) => {
|
|
|
137
137
|
renderHTML({ HTMLAttributes: e }) {
|
|
138
138
|
return [
|
|
139
139
|
"code",
|
|
140
|
-
|
|
140
|
+
r(this.options.HTMLAttributes, e),
|
|
141
141
|
0
|
|
142
142
|
];
|
|
143
143
|
},
|
|
@@ -158,18 +158,18 @@ var T = (e, t) => {
|
|
|
158
158
|
return { "Mod-e": () => this.editor.commands.toggleCode() };
|
|
159
159
|
},
|
|
160
160
|
addInputRules() {
|
|
161
|
-
return [
|
|
162
|
-
find:
|
|
161
|
+
return [i({
|
|
162
|
+
find: ge,
|
|
163
163
|
type: this.type
|
|
164
164
|
})];
|
|
165
165
|
},
|
|
166
166
|
addPasteRules() {
|
|
167
|
-
return [
|
|
168
|
-
find:
|
|
167
|
+
return [f({
|
|
168
|
+
find: _e,
|
|
169
169
|
type: this.type
|
|
170
170
|
})];
|
|
171
171
|
}
|
|
172
|
-
}),
|
|
172
|
+
}), O = 4, ye = /^```([a-z]+)?[\s\n]$/, be = /^~~~([a-z]+)?[\s\n]$/, xe = C.create({
|
|
173
173
|
name: "codeBlock",
|
|
174
174
|
addOptions() {
|
|
175
175
|
return {
|
|
@@ -178,7 +178,7 @@ var T = (e, t) => {
|
|
|
178
178
|
exitOnArrowDown: !0,
|
|
179
179
|
defaultLanguage: null,
|
|
180
180
|
enableTabIndentation: !1,
|
|
181
|
-
tabSize:
|
|
181
|
+
tabSize: O,
|
|
182
182
|
HTMLAttributes: {}
|
|
183
183
|
};
|
|
184
184
|
},
|
|
@@ -206,7 +206,7 @@ var T = (e, t) => {
|
|
|
206
206
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
207
207
|
return [
|
|
208
208
|
"pre",
|
|
209
|
-
|
|
209
|
+
r(this.options.HTMLAttributes, t),
|
|
210
210
|
[
|
|
211
211
|
"code",
|
|
212
212
|
{ class: e.attrs.language ? this.options.languageClassPrefix + e.attrs.language : null },
|
|
@@ -241,7 +241,7 @@ var T = (e, t) => {
|
|
|
241
241
|
},
|
|
242
242
|
Tab: ({ editor: e }) => {
|
|
243
243
|
if (!this.options.enableTabIndentation) return !1;
|
|
244
|
-
let t = this.options.tabSize ??
|
|
244
|
+
let t = this.options.tabSize ?? O, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
|
|
245
245
|
if (i.parent.type !== this.type) return !1;
|
|
246
246
|
let o = " ".repeat(t);
|
|
247
247
|
return a ? e.commands.insertContent(o) : e.commands.command(({ tr: e }) => {
|
|
@@ -251,21 +251,21 @@ var T = (e, t) => {
|
|
|
251
251
|
},
|
|
252
252
|
"Shift-Tab": ({ editor: e }) => {
|
|
253
253
|
if (!this.options.enableTabIndentation) return !1;
|
|
254
|
-
let t = this.options.tabSize ??
|
|
254
|
+
let t = this.options.tabSize ?? O, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
|
|
255
255
|
return i.parent.type === this.type ? a ? e.commands.command(({ tr: e }) => {
|
|
256
|
-
let { pos: r } = i, a = i.start(), o = i.end(), s = n.doc.textBetween(a, o, "\n", "\n").split("\n"), c = 0,
|
|
256
|
+
let { pos: r } = i, a = i.start(), o = i.end(), s = n.doc.textBetween(a, o, "\n", "\n").split("\n"), c = 0, u = 0, d = r - a;
|
|
257
257
|
for (let e = 0; e < s.length; e += 1) {
|
|
258
|
-
if (
|
|
258
|
+
if (u + s[e].length >= d) {
|
|
259
259
|
c = e;
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
u += s[e].length + 1;
|
|
263
263
|
}
|
|
264
|
-
let
|
|
265
|
-
if (
|
|
266
|
-
let
|
|
267
|
-
for (let e = 0; e < c; e += 1)
|
|
268
|
-
return e.delete(
|
|
264
|
+
let f = s[c].match(/^ */)?.[0] || "", p = Math.min(f.length, t);
|
|
265
|
+
if (p === 0) return !0;
|
|
266
|
+
let m = a;
|
|
267
|
+
for (let e = 0; e < c; e += 1) m += s[e].length + 1;
|
|
268
|
+
return e.delete(m, m + p), r - m <= p && e.setSelection(l.create(e.doc, m)), !0;
|
|
269
269
|
}) : e.commands.command(({ tr: e }) => {
|
|
270
270
|
let { from: i, to: a } = r, o = n.doc.textBetween(i, a, "\n", "\n").split("\n").map((e) => {
|
|
271
271
|
let n = e.match(/^ */)?.[0] || "", r = Math.min(n.length, t);
|
|
@@ -283,42 +283,42 @@ var T = (e, t) => {
|
|
|
283
283
|
},
|
|
284
284
|
ArrowDown: ({ editor: e }) => {
|
|
285
285
|
if (!this.options.exitOnArrowDown) return !1;
|
|
286
|
-
let { state:
|
|
287
|
-
if (!
|
|
288
|
-
let
|
|
289
|
-
return
|
|
286
|
+
let { state: t } = e, { selection: n, doc: r } = t, { $from: i, empty: a } = n;
|
|
287
|
+
if (!a || i.parent.type !== this.type || i.parentOffset !== i.parent.nodeSize - 2) return !1;
|
|
288
|
+
let o = i.after();
|
|
289
|
+
return o === void 0 ? !1 : r.nodeAt(o) ? e.commands.command(({ tr: e }) => (e.setSelection(T.near(r.resolve(o))), !0)) : e.commands.exitCode();
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
292
|
},
|
|
293
293
|
addInputRules() {
|
|
294
294
|
return [v({
|
|
295
|
-
find:
|
|
295
|
+
find: ye,
|
|
296
296
|
type: this.type,
|
|
297
297
|
getAttributes: (e) => ({ language: e[1] })
|
|
298
298
|
}), v({
|
|
299
|
-
find:
|
|
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
|
|
305
|
+
return [new E({
|
|
306
|
+
key: new g("codeBlockVSCodeHandler"),
|
|
307
307
|
props: { handlePaste: (e, t) => {
|
|
308
308
|
if (!t.clipboardData || this.editor.isActive(this.type.name)) return !1;
|
|
309
309
|
let n = t.clipboardData.getData("text/plain"), r = t.clipboardData.getData("vscode-editor-data"), i = (r ? JSON.parse(r) : void 0)?.mode;
|
|
310
310
|
if (!n || !i) return !1;
|
|
311
311
|
let { tr: a, schema: o } = e.state, s = o.text(n.replace(/\r\n?/g, "\n"));
|
|
312
|
-
return a.replaceSelectionWith(this.type.create({ language: i }, s)), a.selection.$from.parent.type !== this.type && a.setSelection(
|
|
312
|
+
return a.replaceSelectionWith(this.type.create({ language: i }, s)), a.selection.$from.parent.type !== this.type && a.setSelection(l.near(a.doc.resolve(Math.max(0, a.selection.from - 2)))), a.setMeta("paste", !0), e.dispatch(a), !0;
|
|
313
313
|
} }
|
|
314
314
|
})];
|
|
315
315
|
}
|
|
316
|
-
}),
|
|
316
|
+
}), Se = C.create({
|
|
317
317
|
name: "doc",
|
|
318
318
|
topNode: !0,
|
|
319
319
|
content: "block+",
|
|
320
320
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n\n") : ""
|
|
321
|
-
}),
|
|
321
|
+
}), Ce = C.create({
|
|
322
322
|
name: "hardBreak",
|
|
323
323
|
markdownTokenName: "br",
|
|
324
324
|
addOptions() {
|
|
@@ -335,7 +335,7 @@ var T = (e, t) => {
|
|
|
335
335
|
return [{ tag: "br" }];
|
|
336
336
|
},
|
|
337
337
|
renderHTML({ HTMLAttributes: e }) {
|
|
338
|
-
return ["br",
|
|
338
|
+
return ["br", r(this.options.HTMLAttributes, e)];
|
|
339
339
|
},
|
|
340
340
|
renderText() {
|
|
341
341
|
return "\n";
|
|
@@ -362,7 +362,7 @@ var T = (e, t) => {
|
|
|
362
362
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
}),
|
|
365
|
+
}), we = C.create({
|
|
366
366
|
name: "heading",
|
|
367
367
|
addOptions() {
|
|
368
368
|
return {
|
|
@@ -395,7 +395,7 @@ var T = (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
|
+
r(this.options.HTMLAttributes, t),
|
|
399
399
|
0
|
|
400
400
|
];
|
|
401
401
|
},
|
|
@@ -423,7 +423,7 @@ var T = (e, t) => {
|
|
|
423
423
|
getAttributes: { level: e }
|
|
424
424
|
}));
|
|
425
425
|
}
|
|
426
|
-
}),
|
|
426
|
+
}), Te = C.create({
|
|
427
427
|
name: "horizontalRule",
|
|
428
428
|
addOptions() {
|
|
429
429
|
return {
|
|
@@ -436,22 +436,22 @@ var T = (e, t) => {
|
|
|
436
436
|
return [{ tag: "hr" }];
|
|
437
437
|
},
|
|
438
438
|
renderHTML({ HTMLAttributes: e }) {
|
|
439
|
-
return ["hr",
|
|
439
|
+
return ["hr", r(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
445
|
return { setHorizontalRule: () => ({ chain: e, state: t }) => {
|
|
446
|
-
if (!
|
|
446
|
+
if (!ae(t, t.schema.nodes[this.name])) return !1;
|
|
447
447
|
let { selection: n } = t, { $to: r } = n, i = e();
|
|
448
|
-
return
|
|
448
|
+
return s(n) ? i.insertContentAt(r.pos, { type: this.name }) : i.insertContent({ type: this.name }), i.command(({ state: e, tr: t, dispatch: n }) => {
|
|
449
449
|
if (n) {
|
|
450
450
|
let { $to: n } = t.selection, r = n.end();
|
|
451
|
-
if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(
|
|
451
|
+
if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(l.create(t.doc, n.pos + 1)) : n.nodeAfter.isBlock ? t.setSelection(w.create(t.doc, n.pos)) : t.setSelection(l.create(t.doc, n.pos));
|
|
452
452
|
else {
|
|
453
453
|
let i = (e.schema.nodes[this.options.nextNodeType] || n.parent.type.contentMatch.defaultType)?.create();
|
|
454
|
-
i && (t.insert(r, i), t.setSelection(
|
|
454
|
+
i && (t.insert(r, i), t.setSelection(l.create(t.doc, r + 1)));
|
|
455
455
|
}
|
|
456
456
|
t.scrollIntoView();
|
|
457
457
|
}
|
|
@@ -460,12 +460,12 @@ var T = (e, t) => {
|
|
|
460
460
|
} };
|
|
461
461
|
},
|
|
462
462
|
addInputRules() {
|
|
463
|
-
return [
|
|
463
|
+
return [a({
|
|
464
464
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
465
465
|
type: this.type
|
|
466
466
|
})];
|
|
467
467
|
}
|
|
468
|
-
}),
|
|
468
|
+
}), Ee = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, De = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, Oe = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, ke = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ae = _.create({
|
|
469
469
|
name: "italic",
|
|
470
470
|
addOptions() {
|
|
471
471
|
return { HTMLAttributes: {} };
|
|
@@ -487,7 +487,7 @@ var T = (e, t) => {
|
|
|
487
487
|
renderHTML({ HTMLAttributes: e }) {
|
|
488
488
|
return [
|
|
489
489
|
"em",
|
|
490
|
-
|
|
490
|
+
r(this.options.HTMLAttributes, e),
|
|
491
491
|
0
|
|
492
492
|
];
|
|
493
493
|
},
|
|
@@ -512,29 +512,29 @@ var T = (e, t) => {
|
|
|
512
512
|
};
|
|
513
513
|
},
|
|
514
514
|
addInputRules() {
|
|
515
|
-
return [
|
|
516
|
-
find:
|
|
515
|
+
return [i({
|
|
516
|
+
find: Ee,
|
|
517
517
|
type: this.type
|
|
518
|
-
}),
|
|
519
|
-
find:
|
|
518
|
+
}), i({
|
|
519
|
+
find: Oe,
|
|
520
520
|
type: this.type
|
|
521
521
|
})];
|
|
522
522
|
},
|
|
523
523
|
addPasteRules() {
|
|
524
|
-
return [
|
|
525
|
-
find:
|
|
524
|
+
return [f({
|
|
525
|
+
find: De,
|
|
526
526
|
type: this.type
|
|
527
|
-
}),
|
|
528
|
-
find:
|
|
527
|
+
}), f({
|
|
528
|
+
find: ke,
|
|
529
529
|
type: this.type
|
|
530
530
|
})];
|
|
531
531
|
}
|
|
532
|
-
}),
|
|
533
|
-
for (var n in t)
|
|
532
|
+
}), je = Object.defineProperty, Me = (e, t) => {
|
|
533
|
+
for (var n in t) je(e, n, {
|
|
534
534
|
get: t[n],
|
|
535
535
|
enumerable: !0
|
|
536
536
|
});
|
|
537
|
-
},
|
|
537
|
+
}, Ne = "listItem", k = "textStyle", A = /^\s*([-+*])\s$/, j = C.create({
|
|
538
538
|
name: "bulletList",
|
|
539
539
|
addOptions() {
|
|
540
540
|
return {
|
|
@@ -554,7 +554,7 @@ var T = (e, t) => {
|
|
|
554
554
|
renderHTML({ HTMLAttributes: e }) {
|
|
555
555
|
return [
|
|
556
556
|
"ul",
|
|
557
|
-
|
|
557
|
+
r(this.options.HTMLAttributes, e),
|
|
558
558
|
0
|
|
559
559
|
];
|
|
560
560
|
},
|
|
@@ -566,38 +566,38 @@ var T = (e, t) => {
|
|
|
566
566
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
|
|
567
567
|
markdownOptions: { indentsContent: !0 },
|
|
568
568
|
addCommands() {
|
|
569
|
-
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
569
|
+
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ne, this.editor.getAttributes(k)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
570
570
|
},
|
|
571
571
|
addKeyboardShortcuts() {
|
|
572
572
|
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
573
573
|
},
|
|
574
574
|
addInputRules() {
|
|
575
|
-
let e =
|
|
576
|
-
find:
|
|
575
|
+
let e = S({
|
|
576
|
+
find: A,
|
|
577
577
|
type: this.type
|
|
578
578
|
});
|
|
579
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
580
|
-
find:
|
|
579
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = S({
|
|
580
|
+
find: A,
|
|
581
581
|
type: this.type,
|
|
582
582
|
keepMarks: this.options.keepMarks,
|
|
583
583
|
keepAttributes: this.options.keepAttributes,
|
|
584
|
-
getAttributes: () => this.editor.getAttributes(
|
|
584
|
+
getAttributes: () => this.editor.getAttributes(k),
|
|
585
585
|
editor: this.editor
|
|
586
586
|
})), [e];
|
|
587
587
|
}
|
|
588
588
|
});
|
|
589
|
-
function
|
|
589
|
+
function Pe(e) {
|
|
590
590
|
let t = e.tokens?.[0];
|
|
591
591
|
return !!(e.text && e.tokens?.length === 1 && t?.type === "list" && t.ordered && t.raw === e.text);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Fe(e, t) {
|
|
594
594
|
return t.tokenizeInline ? t.parseInline(t.tokenizeInline(e)) : t.parseInline([{
|
|
595
595
|
type: "text",
|
|
596
596
|
raw: e,
|
|
597
597
|
text: e
|
|
598
598
|
}]);
|
|
599
599
|
}
|
|
600
|
-
var
|
|
600
|
+
var M = C.create({
|
|
601
601
|
name: "listItem",
|
|
602
602
|
addOptions() {
|
|
603
603
|
return {
|
|
@@ -614,7 +614,7 @@ var A = b.create({
|
|
|
614
614
|
renderHTML({ HTMLAttributes: e }) {
|
|
615
615
|
return [
|
|
616
616
|
"li",
|
|
617
|
-
|
|
617
|
+
r(this.options.HTMLAttributes, e),
|
|
618
618
|
0
|
|
619
619
|
];
|
|
620
620
|
},
|
|
@@ -623,11 +623,11 @@ var A = b.create({
|
|
|
623
623
|
if (e.type !== "list_item") return [];
|
|
624
624
|
let n = t.parseBlockChildren ?? t.parseChildren, r = [];
|
|
625
625
|
if (e.tokens && e.tokens.length > 0) {
|
|
626
|
-
if (
|
|
626
|
+
if (Pe(e)) return {
|
|
627
627
|
type: "listItem",
|
|
628
628
|
content: [{
|
|
629
629
|
type: "paragraph",
|
|
630
|
-
content:
|
|
630
|
+
content: Fe(e.text || "", t)
|
|
631
631
|
}]
|
|
632
632
|
};
|
|
633
633
|
if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
|
|
@@ -652,7 +652,7 @@ var A = b.create({
|
|
|
652
652
|
content: r
|
|
653
653
|
};
|
|
654
654
|
},
|
|
655
|
-
renderMarkdown: (e, t, n) =>
|
|
655
|
+
renderMarkdown: (e, t, n) => re(e, t, (e) => e.parentType === "bulletList" ? "- " : e.parentType === "orderedList" ? `${(e.meta?.parentAttrs?.start || 1) + e.index}. ` : "- ", n),
|
|
656
656
|
addKeyboardShortcuts() {
|
|
657
657
|
return {
|
|
658
658
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -661,80 +661,80 @@ var A = b.create({
|
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
});
|
|
664
|
-
|
|
665
|
-
findListItemPos: () =>
|
|
666
|
-
getNextListDepth: () =>
|
|
664
|
+
Me({}, {
|
|
665
|
+
findListItemPos: () => N,
|
|
666
|
+
getNextListDepth: () => P,
|
|
667
667
|
handleBackspace: () => I,
|
|
668
668
|
handleDelete: () => R,
|
|
669
|
-
hasListBefore: () =>
|
|
669
|
+
hasListBefore: () => F,
|
|
670
670
|
hasListItemAfter: () => ze,
|
|
671
|
-
hasListItemBefore: () =>
|
|
672
|
-
listItemHasSubList: () =>
|
|
673
|
-
nextListIsDeeper: () =>
|
|
674
|
-
nextListIsHigher: () =>
|
|
671
|
+
hasListItemBefore: () => Ie,
|
|
672
|
+
listItemHasSubList: () => Le,
|
|
673
|
+
nextListIsDeeper: () => Re,
|
|
674
|
+
nextListIsHigher: () => L
|
|
675
675
|
});
|
|
676
|
-
var
|
|
677
|
-
let { $from: n } = t.selection, r =
|
|
676
|
+
var N = (e, t) => {
|
|
677
|
+
let { $from: n } = t.selection, r = ne(e, t.schema), i = null, a = n.depth, o = n.pos, s = null;
|
|
678
678
|
for (; a > 0 && s === null;) i = n.node(a), i.type === r ? s = a : (--a, --o);
|
|
679
679
|
return s === null ? null : {
|
|
680
680
|
$pos: t.doc.resolve(o),
|
|
681
681
|
depth: s
|
|
682
682
|
};
|
|
683
|
-
},
|
|
684
|
-
let n =
|
|
683
|
+
}, P = (e, t) => {
|
|
684
|
+
let n = N(e, t);
|
|
685
685
|
if (!n) return !1;
|
|
686
|
-
let [, r] =
|
|
686
|
+
let [, r] = ie(t, e, n.$pos.pos + 4);
|
|
687
687
|
return r;
|
|
688
|
-
},
|
|
688
|
+
}, F = (e, t, n) => {
|
|
689
689
|
let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
|
|
690
690
|
return !(!a || !n.includes(a.type.name));
|
|
691
|
-
},
|
|
691
|
+
}, Ie = (e, t) => {
|
|
692
692
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - 2);
|
|
693
693
|
return !(r.index() === 0 || r.nodeBefore?.type.name !== e);
|
|
694
|
-
},
|
|
694
|
+
}, Le = (e, t, n) => {
|
|
695
695
|
if (!n) return !1;
|
|
696
|
-
let r =
|
|
696
|
+
let r = ne(e, t.schema), i = !1;
|
|
697
697
|
return n.descendants((e) => {
|
|
698
698
|
e.type === r && (i = !0);
|
|
699
699
|
}), i;
|
|
700
|
-
}, I = (e,
|
|
700
|
+
}, I = (e, n, r) => {
|
|
701
701
|
if (e.commands.undoInputRule()) return !0;
|
|
702
702
|
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
703
|
-
if (!
|
|
704
|
-
let { $anchor:
|
|
705
|
-
r.node().descendants((e,
|
|
706
|
-
e.type.name ===
|
|
703
|
+
if (!x(e.state, n) && F(e.state, n, r)) {
|
|
704
|
+
let { $anchor: t } = e.state.selection, r = e.state.doc.resolve(t.before() - 1), i = [];
|
|
705
|
+
r.node().descendants((e, t) => {
|
|
706
|
+
e.type.name === n && i.push({
|
|
707
707
|
node: e,
|
|
708
|
-
pos:
|
|
708
|
+
pos: t
|
|
709
709
|
});
|
|
710
710
|
});
|
|
711
711
|
let a = i.at(-1);
|
|
712
712
|
if (!a) return !1;
|
|
713
713
|
let o = e.state.doc.resolve(r.start() + a.pos + 1);
|
|
714
714
|
return e.chain().cut({
|
|
715
|
-
from:
|
|
716
|
-
to:
|
|
715
|
+
from: t.start() - 1,
|
|
716
|
+
to: t.end() + 1
|
|
717
717
|
}, o.end()).joinForward().run();
|
|
718
718
|
}
|
|
719
|
-
if (!
|
|
720
|
-
let
|
|
721
|
-
if (!
|
|
722
|
-
let
|
|
723
|
-
return
|
|
724
|
-
}, L = (e, t) => {
|
|
725
|
-
let n = M(e, t), r = j(e, t);
|
|
726
|
-
return !r || !n ? !1 : n > r.depth;
|
|
719
|
+
if (!x(e.state, n) || !t(e.state)) return !1;
|
|
720
|
+
let i = N(n, e.state);
|
|
721
|
+
if (!i) return !1;
|
|
722
|
+
let a = e.state.doc.resolve(i.$pos.pos - 2).node(i.depth), o = Le(n, e.state, a);
|
|
723
|
+
return Ie(n, e.state) && !o ? e.commands.joinItemBackward() : e.chain().liftListItem(n).run();
|
|
727
724
|
}, Re = (e, t) => {
|
|
728
|
-
let n =
|
|
725
|
+
let n = P(e, t), r = N(e, t);
|
|
726
|
+
return !r || !n ? !1 : n > r.depth;
|
|
727
|
+
}, L = (e, t) => {
|
|
728
|
+
let n = P(e, t), r = N(e, t);
|
|
729
729
|
return !r || !n ? !1 : n < r.depth;
|
|
730
730
|
}, R = (e, t) => {
|
|
731
|
-
if (!
|
|
732
|
-
let { selection:
|
|
733
|
-
return !
|
|
731
|
+
if (!x(e.state, t) || !u(e.state, t)) return !1;
|
|
732
|
+
let { selection: n } = e.state, { $from: r, $to: i } = n;
|
|
733
|
+
return !n.empty && r.sameParent(i) ? !1 : Re(t, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(t).joinBackward().run() : L(t, e.state) ? e.chain().joinForward().joinBackward().run() : e.commands.joinItemForward();
|
|
734
734
|
}, ze = (e, t) => {
|
|
735
735
|
let { $anchor: n } = t.selection, r = t.doc.resolve(n.pos - n.parentOffset - 2);
|
|
736
736
|
return !(r.index() === r.parent.childCount - 1 || r.nodeAfter?.type.name !== e);
|
|
737
|
-
}, Be =
|
|
737
|
+
}, Be = b.create({
|
|
738
738
|
name: "listKeymap",
|
|
739
739
|
addOptions() {
|
|
740
740
|
return { listTypes: [{
|
|
@@ -884,7 +884,7 @@ function qe(e, t) {
|
|
|
884
884
|
};
|
|
885
885
|
});
|
|
886
886
|
}
|
|
887
|
-
var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze =
|
|
887
|
+
var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = C.create({
|
|
888
888
|
name: "orderedList",
|
|
889
889
|
addOptions() {
|
|
890
890
|
return {
|
|
@@ -917,11 +917,11 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
917
917
|
let { start: t, ...n } = e;
|
|
918
918
|
return t === 1 ? [
|
|
919
919
|
"ol",
|
|
920
|
-
|
|
920
|
+
r(this.options.HTMLAttributes, n),
|
|
921
921
|
0
|
|
922
922
|
] : [
|
|
923
923
|
"ol",
|
|
924
|
-
|
|
924
|
+
r(this.options.HTMLAttributes, e),
|
|
925
925
|
0
|
|
926
926
|
];
|
|
927
927
|
},
|
|
@@ -967,13 +967,13 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
967
967
|
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
968
968
|
},
|
|
969
969
|
addInputRules() {
|
|
970
|
-
let e =
|
|
970
|
+
let e = S({
|
|
971
971
|
find: Xe,
|
|
972
972
|
type: this.type,
|
|
973
973
|
getAttributes: (e) => ({ start: +e[1] }),
|
|
974
974
|
joinPredicate: (e, t) => t.childCount + t.attrs.start === +e[1]
|
|
975
975
|
});
|
|
976
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e =
|
|
976
|
+
return (this.options.keepMarks || this.options.keepAttributes) && (e = S({
|
|
977
977
|
find: Xe,
|
|
978
978
|
type: this.type,
|
|
979
979
|
keepMarks: this.options.keepMarks,
|
|
@@ -986,7 +986,7 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
986
986
|
editor: this.editor
|
|
987
987
|
})), [e];
|
|
988
988
|
}
|
|
989
|
-
}), Qe = /^\s*(\[([( |x])?\])\s$/, $e =
|
|
989
|
+
}), Qe = /^\s*(\[([( |x])?\])\s$/, $e = C.create({
|
|
990
990
|
name: "taskItem",
|
|
991
991
|
addOptions() {
|
|
992
992
|
return {
|
|
@@ -1020,7 +1020,7 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1020
1020
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
1021
1021
|
return [
|
|
1022
1022
|
"li",
|
|
1023
|
-
|
|
1023
|
+
r(this.options.HTMLAttributes, t, { "data-type": this.name }),
|
|
1024
1024
|
[
|
|
1025
1025
|
"label",
|
|
1026
1026
|
["input", {
|
|
@@ -1040,7 +1040,7 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1040
1040
|
}
|
|
1041
1041
|
return t.createNode("taskItem", { checked: e.checked || !1 }, n);
|
|
1042
1042
|
},
|
|
1043
|
-
renderMarkdown: (e, t) =>
|
|
1043
|
+
renderMarkdown: (e, t) => re(e, t, `- [${e.attrs?.checked ? "x" : " "}] `),
|
|
1044
1044
|
addKeyboardShortcuts() {
|
|
1045
1045
|
let e = {
|
|
1046
1046
|
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
@@ -1084,7 +1084,7 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1084
1084
|
update: (e) => {
|
|
1085
1085
|
if (e.type !== this.type) return !1;
|
|
1086
1086
|
i.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, l(e);
|
|
1087
|
-
let t = r.extensionManager.attributes, n =
|
|
1087
|
+
let t = r.extensionManager.attributes, n = ee(e, t), a = new Set(Object.keys(n)), o = this.options.HTMLAttributes;
|
|
1088
1088
|
return u.forEach((e) => {
|
|
1089
1089
|
a.has(e) || (e in o ? i.setAttribute(e, o[e]) : i.removeAttribute(e));
|
|
1090
1090
|
}), Object.entries(n).forEach(([e, t]) => {
|
|
@@ -1095,13 +1095,13 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1095
1095
|
};
|
|
1096
1096
|
},
|
|
1097
1097
|
addInputRules() {
|
|
1098
|
-
return [
|
|
1098
|
+
return [S({
|
|
1099
1099
|
find: Qe,
|
|
1100
1100
|
type: this.type,
|
|
1101
1101
|
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
1102
1102
|
})];
|
|
1103
1103
|
}
|
|
1104
|
-
}), et =
|
|
1104
|
+
}), et = C.create({
|
|
1105
1105
|
name: "taskList",
|
|
1106
1106
|
addOptions() {
|
|
1107
1107
|
return {
|
|
@@ -1122,7 +1122,7 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1122
1122
|
renderHTML({ HTMLAttributes: e }) {
|
|
1123
1123
|
return [
|
|
1124
1124
|
"ul",
|
|
1125
|
-
|
|
1125
|
+
r(this.options.HTMLAttributes, e, { "data-type": this.name }),
|
|
1126
1126
|
0
|
|
1127
1127
|
];
|
|
1128
1128
|
},
|
|
@@ -1135,9 +1135,9 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1135
1135
|
let t = e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;
|
|
1136
1136
|
return t === void 0 ? -1 : t;
|
|
1137
1137
|
},
|
|
1138
|
-
tokenize(t, n
|
|
1139
|
-
let
|
|
1140
|
-
let
|
|
1138
|
+
tokenize(e, t, n) {
|
|
1139
|
+
let r = (e) => {
|
|
1140
|
+
let t = c(e, {
|
|
1141
1141
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1142
1142
|
extractItemData: (e) => ({
|
|
1143
1143
|
indentLevel: e[1].length,
|
|
@@ -1151,17 +1151,17 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1151
1151
|
indentLevel: e.indentLevel,
|
|
1152
1152
|
checked: e.checked,
|
|
1153
1153
|
text: e.mainContent,
|
|
1154
|
-
tokens:
|
|
1154
|
+
tokens: n.inlineTokens(e.mainContent),
|
|
1155
1155
|
nestedTokens: t
|
|
1156
1156
|
}),
|
|
1157
|
-
customNestedParser:
|
|
1158
|
-
},
|
|
1159
|
-
return
|
|
1157
|
+
customNestedParser: r
|
|
1158
|
+
}, n);
|
|
1159
|
+
return t ? [{
|
|
1160
1160
|
type: "taskList",
|
|
1161
|
-
raw:
|
|
1162
|
-
items:
|
|
1163
|
-
}] :
|
|
1164
|
-
},
|
|
1161
|
+
raw: t.raw,
|
|
1162
|
+
items: t.items
|
|
1163
|
+
}] : n.blockTokens(e);
|
|
1164
|
+
}, i = c(e, {
|
|
1165
1165
|
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1166
1166
|
extractItemData: (e) => ({
|
|
1167
1167
|
indentLevel: e[1].length,
|
|
@@ -1175,15 +1175,15 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1175
1175
|
indentLevel: e.indentLevel,
|
|
1176
1176
|
checked: e.checked,
|
|
1177
1177
|
text: e.mainContent,
|
|
1178
|
-
tokens:
|
|
1178
|
+
tokens: n.inlineTokens(e.mainContent),
|
|
1179
1179
|
nestedTokens: t
|
|
1180
1180
|
}),
|
|
1181
|
-
customNestedParser:
|
|
1182
|
-
},
|
|
1183
|
-
if (
|
|
1181
|
+
customNestedParser: r
|
|
1182
|
+
}, n);
|
|
1183
|
+
if (i) return {
|
|
1184
1184
|
type: "taskList",
|
|
1185
|
-
raw:
|
|
1186
|
-
items:
|
|
1185
|
+
raw: i.raw,
|
|
1186
|
+
items: i.items
|
|
1187
1187
|
};
|
|
1188
1188
|
}
|
|
1189
1189
|
},
|
|
@@ -1195,16 +1195,16 @@ var Je = "listItem", Ye = "textStyle", Xe = /^(\d+)\.\s$/, Ze = b.create({
|
|
|
1195
1195
|
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
|
|
1196
1196
|
}
|
|
1197
1197
|
});
|
|
1198
|
-
|
|
1198
|
+
b.create({
|
|
1199
1199
|
name: "listKit",
|
|
1200
1200
|
addExtensions() {
|
|
1201
1201
|
let e = [];
|
|
1202
|
-
return this.options.bulletList !== !1 && e.push(
|
|
1202
|
+
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(Be.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Ze.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push($e.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(et.configure(this.options.taskList)), e;
|
|
1203
1203
|
}
|
|
1204
1204
|
});
|
|
1205
1205
|
//#endregion
|
|
1206
|
-
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.23.
|
|
1207
|
-
var z = " ", B = "\xA0", tt =
|
|
1206
|
+
//#region ../../node_modules/.pnpm/@tiptap+extension-paragraph@3.23.6_@tiptap+core@3.23.6_@tiptap+pm@3.23.6_/node_modules/@tiptap/extension-paragraph/dist/index.js
|
|
1207
|
+
var z = " ", B = "\xA0", tt = C.create({
|
|
1208
1208
|
name: "paragraph",
|
|
1209
1209
|
priority: 1e3,
|
|
1210
1210
|
addOptions() {
|
|
@@ -1218,7 +1218,7 @@ var z = " ", B = "\xA0", tt = b.create({
|
|
|
1218
1218
|
renderHTML({ HTMLAttributes: e }) {
|
|
1219
1219
|
return [
|
|
1220
1220
|
"p",
|
|
1221
|
-
|
|
1221
|
+
r(this.options.HTMLAttributes, e),
|
|
1222
1222
|
0
|
|
1223
1223
|
];
|
|
1224
1224
|
},
|
|
@@ -1243,7 +1243,7 @@ var z = " ", B = "\xA0", tt = b.create({
|
|
|
1243
1243
|
addKeyboardShortcuts() {
|
|
1244
1244
|
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
|
|
1245
1245
|
}
|
|
1246
|
-
}), nt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, rt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, it =
|
|
1246
|
+
}), nt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, rt = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, it = _.create({
|
|
1247
1247
|
name: "strike",
|
|
1248
1248
|
addOptions() {
|
|
1249
1249
|
return { HTMLAttributes: {} };
|
|
@@ -1263,7 +1263,7 @@ var z = " ", B = "\xA0", tt = b.create({
|
|
|
1263
1263
|
renderHTML({ HTMLAttributes: e }) {
|
|
1264
1264
|
return [
|
|
1265
1265
|
"s",
|
|
1266
|
-
|
|
1266
|
+
r(this.options.HTMLAttributes, e),
|
|
1267
1267
|
0
|
|
1268
1268
|
];
|
|
1269
1269
|
},
|
|
@@ -1281,18 +1281,18 @@ var z = " ", B = "\xA0", tt = b.create({
|
|
|
1281
1281
|
return { "Mod-Shift-s": () => this.editor.commands.toggleStrike() };
|
|
1282
1282
|
},
|
|
1283
1283
|
addInputRules() {
|
|
1284
|
-
return [
|
|
1284
|
+
return [i({
|
|
1285
1285
|
find: nt,
|
|
1286
1286
|
type: this.type
|
|
1287
1287
|
})];
|
|
1288
1288
|
},
|
|
1289
1289
|
addPasteRules() {
|
|
1290
|
-
return [
|
|
1290
|
+
return [f({
|
|
1291
1291
|
find: rt,
|
|
1292
1292
|
type: this.type
|
|
1293
1293
|
})];
|
|
1294
1294
|
}
|
|
1295
|
-
}), at =
|
|
1295
|
+
}), at = C.create({
|
|
1296
1296
|
name: "text",
|
|
1297
1297
|
group: "inline",
|
|
1298
1298
|
parseMarkdown: (e) => ({
|
|
@@ -1304,7 +1304,7 @@ var z = " ", B = "\xA0", tt = b.create({
|
|
|
1304
1304
|
//#endregion
|
|
1305
1305
|
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
|
|
1306
1306
|
function ot(e = {}) {
|
|
1307
|
-
return new
|
|
1307
|
+
return new E({ view(t) {
|
|
1308
1308
|
return new st(t, e);
|
|
1309
1309
|
} });
|
|
1310
1310
|
}
|
|
@@ -1380,11 +1380,11 @@ var st = class {
|
|
|
1380
1380
|
let t = this.editorView.posAtCoords({
|
|
1381
1381
|
left: e.clientX,
|
|
1382
1382
|
top: e.clientY
|
|
1383
|
-
}), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor,
|
|
1384
|
-
if (t && !
|
|
1383
|
+
}), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor, i = typeof r == "function" ? r(this.editorView, t, e) : r;
|
|
1384
|
+
if (t && !i) {
|
|
1385
1385
|
let e = t.pos;
|
|
1386
1386
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
1387
|
-
let t =
|
|
1387
|
+
let t = oe(this.editorView.state.doc, e, this.editorView.dragging.slice);
|
|
1388
1388
|
t != null && (e = t);
|
|
1389
1389
|
}
|
|
1390
1390
|
this.setCursor(e), this.scheduleRemoval(5e3);
|
|
@@ -1399,16 +1399,16 @@ var st = class {
|
|
|
1399
1399
|
dragleave(e) {
|
|
1400
1400
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
1401
1401
|
}
|
|
1402
|
-
}, V = class e extends
|
|
1402
|
+
}, V = class e extends T {
|
|
1403
1403
|
constructor(e) {
|
|
1404
1404
|
super(e, e);
|
|
1405
1405
|
}
|
|
1406
|
-
map(
|
|
1407
|
-
let
|
|
1408
|
-
return e.valid(
|
|
1406
|
+
map(t, n) {
|
|
1407
|
+
let r = t.resolve(n.map(this.head));
|
|
1408
|
+
return e.valid(r) ? new e(r) : T.near(r);
|
|
1409
1409
|
}
|
|
1410
1410
|
content() {
|
|
1411
|
-
return
|
|
1411
|
+
return n.empty;
|
|
1412
1412
|
}
|
|
1413
1413
|
eq(t) {
|
|
1414
1414
|
return t instanceof e && t.head == this.head;
|
|
@@ -1451,7 +1451,7 @@ var st = class {
|
|
|
1451
1451
|
for (;;) {
|
|
1452
1452
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
1453
1453
|
if (!o) {
|
|
1454
|
-
if (a.isAtom && !a.isText && !
|
|
1454
|
+
if (a.isAtom && !a.isText && !w.isSelectable(a)) {
|
|
1455
1455
|
t = t.doc.resolve(i + a.nodeSize * n), r = !1;
|
|
1456
1456
|
continue search;
|
|
1457
1457
|
}
|
|
@@ -1465,7 +1465,7 @@ var st = class {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
1467
|
};
|
|
1468
|
-
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom,
|
|
1468
|
+
V.prototype.visible = !1, V.findFrom = V.findGapCursorFrom, T.jsonID("gapcursor", V);
|
|
1469
1469
|
var ct = class e {
|
|
1470
1470
|
constructor(e) {
|
|
1471
1471
|
this.pos = e;
|
|
@@ -1474,8 +1474,8 @@ var ct = class e {
|
|
|
1474
1474
|
return new e(t.map(this.pos));
|
|
1475
1475
|
}
|
|
1476
1476
|
resolve(e) {
|
|
1477
|
-
let
|
|
1478
|
-
return V.valid(
|
|
1477
|
+
let t = e.resolve(this.pos);
|
|
1478
|
+
return V.valid(t) ? new V(t) : T.near(t);
|
|
1479
1479
|
}
|
|
1480
1480
|
};
|
|
1481
1481
|
function lt(e) {
|
|
@@ -1510,7 +1510,7 @@ function dt(e) {
|
|
|
1510
1510
|
return !0;
|
|
1511
1511
|
}
|
|
1512
1512
|
function ft() {
|
|
1513
|
-
return new
|
|
1513
|
+
return new E({ props: {
|
|
1514
1514
|
decorations: gt,
|
|
1515
1515
|
createSelectionBetween(e, t, n) {
|
|
1516
1516
|
return t.pos == n.pos && V.valid(n) ? new V(n) : null;
|
|
@@ -1520,7 +1520,7 @@ function ft() {
|
|
|
1520
1520
|
handleDOMEvents: { beforeinput: ht }
|
|
1521
1521
|
} });
|
|
1522
1522
|
}
|
|
1523
|
-
var pt =
|
|
1523
|
+
var pt = te({
|
|
1524
1524
|
ArrowLeft: H("horiz", -1),
|
|
1525
1525
|
ArrowRight: H("horiz", 1),
|
|
1526
1526
|
ArrowUp: H("vert", -1),
|
|
@@ -1530,7 +1530,7 @@ function H(e, t) {
|
|
|
1530
1530
|
let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
|
|
1531
1531
|
return function(e, r, i) {
|
|
1532
1532
|
let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
|
|
1533
|
-
if (a instanceof
|
|
1533
|
+
if (a instanceof l) {
|
|
1534
1534
|
if (!i.endOfTextblock(n) || o.depth == 0) return !1;
|
|
1535
1535
|
s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
|
|
1536
1536
|
}
|
|
@@ -1546,21 +1546,21 @@ function mt(e, t, n) {
|
|
|
1546
1546
|
left: n.clientX,
|
|
1547
1547
|
top: n.clientY
|
|
1548
1548
|
});
|
|
1549
|
-
return i && i.inside > -1 &&
|
|
1549
|
+
return i && i.inside > -1 && w.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new V(r))), !0);
|
|
1550
1550
|
}
|
|
1551
1551
|
function ht(e, t) {
|
|
1552
1552
|
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof V)) return !1;
|
|
1553
|
-
let { $from:
|
|
1553
|
+
let { $from: r } = e.state.selection, i = r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);
|
|
1554
1554
|
if (!i) return !1;
|
|
1555
|
-
let a =
|
|
1556
|
-
for (let e = i.length - 1; e >= 0; e--) a =
|
|
1557
|
-
let o = e.state.tr.replace(
|
|
1558
|
-
return o.setSelection(
|
|
1555
|
+
let a = d.empty;
|
|
1556
|
+
for (let e = i.length - 1; e >= 0; e--) a = d.from(i[e].createAndFill(null, a));
|
|
1557
|
+
let o = e.state.tr.replace(r.pos, r.pos, new n(a, 0, 0));
|
|
1558
|
+
return o.setSelection(l.near(o.doc.resolve(r.pos + 1))), e.dispatch(o), !1;
|
|
1559
1559
|
}
|
|
1560
1560
|
function gt(e) {
|
|
1561
1561
|
if (!(e.selection instanceof V)) return null;
|
|
1562
1562
|
let t = document.createElement("div");
|
|
1563
|
-
return t.className = "ProseMirror-gapcursor",
|
|
1563
|
+
return t.className = "ProseMirror-gapcursor", h.create(e.doc, [y.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
1564
1564
|
}
|
|
1565
1565
|
//#endregion
|
|
1566
1566
|
//#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
|
|
@@ -1643,11 +1643,11 @@ var vt = /* @__PURE__ */ function(e) {
|
|
|
1643
1643
|
}, t.prototype.appendInner = function(e) {
|
|
1644
1644
|
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);
|
|
1645
1645
|
}, t;
|
|
1646
|
-
}(W), yt = 500, G = class
|
|
1646
|
+
}(W), yt = 500, G = class t {
|
|
1647
1647
|
constructor(e, t) {
|
|
1648
1648
|
this.items = e, this.eventCount = t;
|
|
1649
1649
|
}
|
|
1650
|
-
popEvent(
|
|
1650
|
+
popEvent(e, n) {
|
|
1651
1651
|
if (this.eventCount == 0) return null;
|
|
1652
1652
|
let r = this.items.length;
|
|
1653
1653
|
for (;; r--) if (this.items.get(r - 1).selection) {
|
|
@@ -1656,63 +1656,63 @@ var vt = /* @__PURE__ */ function(e) {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
let i, a;
|
|
1658
1658
|
n && (i = this.remapping(r, this.items.length), a = i.maps.length);
|
|
1659
|
-
let o =
|
|
1660
|
-
return this.items.forEach((
|
|
1661
|
-
if (!
|
|
1662
|
-
i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(
|
|
1659
|
+
let o = e.tr, s, c, l = [], u = [];
|
|
1660
|
+
return this.items.forEach((e, n) => {
|
|
1661
|
+
if (!e.step) {
|
|
1662
|
+
i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(e);
|
|
1663
1663
|
return;
|
|
1664
1664
|
}
|
|
1665
1665
|
if (i) {
|
|
1666
|
-
u.push(new K(
|
|
1667
|
-
let
|
|
1668
|
-
|
|
1669
|
-
} else o.maybeStep(
|
|
1670
|
-
if (
|
|
1666
|
+
u.push(new K(e.map));
|
|
1667
|
+
let t = e.step.map(i.slice(a)), n;
|
|
1668
|
+
t && o.maybeStep(t).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);
|
|
1669
|
+
} else o.maybeStep(e.step);
|
|
1670
|
+
if (e.selection) return s = i ? e.selection.map(i.slice(a)) : e.selection, c = new t(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
|
|
1671
1671
|
}, this.items.length, 0), {
|
|
1672
1672
|
remaining: c,
|
|
1673
1673
|
transform: o,
|
|
1674
1674
|
selection: s
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
1677
|
-
addTransform(
|
|
1677
|
+
addTransform(e, n, r, i) {
|
|
1678
1678
|
let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
|
|
1679
|
-
for (let
|
|
1680
|
-
let r =
|
|
1681
|
-
(u = c && c.merge(l)) && (l = u,
|
|
1679
|
+
for (let t = 0; t < e.steps.length; t++) {
|
|
1680
|
+
let r = e.steps[t].invert(e.docs[t]), l = new K(e.mapping.maps[t], r, n), u;
|
|
1681
|
+
(u = c && c.merge(l)) && (l = u, t ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
|
|
1682
1682
|
}
|
|
1683
1683
|
let l = o - r.depth;
|
|
1684
|
-
return l > xt && (s = bt(s, l), o -= l), new
|
|
1684
|
+
return l > xt && (s = bt(s, l), o -= l), new t(s.append(a), o);
|
|
1685
1685
|
}
|
|
1686
|
-
remapping(
|
|
1687
|
-
let
|
|
1688
|
-
return this.items.forEach((
|
|
1689
|
-
let i =
|
|
1690
|
-
|
|
1691
|
-
},
|
|
1686
|
+
remapping(t, n) {
|
|
1687
|
+
let r = new e();
|
|
1688
|
+
return this.items.forEach((e, n) => {
|
|
1689
|
+
let i = e.mirrorOffset != null && n - e.mirrorOffset >= t ? r.maps.length - e.mirrorOffset : void 0;
|
|
1690
|
+
r.appendMap(e.map, i);
|
|
1691
|
+
}, t, n), r;
|
|
1692
1692
|
}
|
|
1693
|
-
addMaps(
|
|
1694
|
-
return this.eventCount == 0 ? this : new
|
|
1693
|
+
addMaps(e) {
|
|
1694
|
+
return this.eventCount == 0 ? this : new t(this.items.append(e.map((e) => new K(e))), this.eventCount);
|
|
1695
1695
|
}
|
|
1696
|
-
rebased(
|
|
1696
|
+
rebased(e, n) {
|
|
1697
1697
|
if (!this.eventCount) return this;
|
|
1698
|
-
let r = [], i = Math.max(0, this.items.length - n), a =
|
|
1698
|
+
let r = [], i = Math.max(0, this.items.length - n), a = e.mapping, o = e.steps.length, s = this.eventCount;
|
|
1699
1699
|
this.items.forEach((e) => {
|
|
1700
1700
|
e.selection && s--;
|
|
1701
1701
|
}, i);
|
|
1702
1702
|
let c = n;
|
|
1703
|
-
this.items.forEach((
|
|
1703
|
+
this.items.forEach((t) => {
|
|
1704
1704
|
let n = a.getMirror(--c);
|
|
1705
1705
|
if (n == null) return;
|
|
1706
1706
|
o = Math.min(o, n);
|
|
1707
1707
|
let i = a.maps[n];
|
|
1708
|
-
if (
|
|
1709
|
-
let o =
|
|
1708
|
+
if (t.step) {
|
|
1709
|
+
let o = e.steps[n].invert(e.docs[n]), l = t.selection && t.selection.map(a.slice(c + 1, n));
|
|
1710
1710
|
l && s++, r.push(new K(i, o, l));
|
|
1711
1711
|
} else r.push(new K(i));
|
|
1712
1712
|
}, i);
|
|
1713
1713
|
let l = [];
|
|
1714
1714
|
for (let e = n; e < o; e++) l.push(new K(a.maps[e]));
|
|
1715
|
-
let u = new
|
|
1715
|
+
let u = new t(this.items.slice(0, i).append(l).append(r), s);
|
|
1716
1716
|
return u.emptyItemCount() > yt && (u = u.compress(this.items.length - r.length)), u;
|
|
1717
1717
|
}
|
|
1718
1718
|
emptyItemCount() {
|
|
@@ -1721,20 +1721,20 @@ var vt = /* @__PURE__ */ function(e) {
|
|
|
1721
1721
|
t.step || e++;
|
|
1722
1722
|
}), e;
|
|
1723
1723
|
}
|
|
1724
|
-
compress(
|
|
1725
|
-
let n = this.remapping(0,
|
|
1726
|
-
return this.items.forEach((
|
|
1727
|
-
if (o >=
|
|
1728
|
-
else if (
|
|
1729
|
-
let
|
|
1730
|
-
if (r--, o && n.appendMap(o, r),
|
|
1731
|
-
let s =
|
|
1724
|
+
compress(e = this.items.length) {
|
|
1725
|
+
let n = this.remapping(0, e), r = n.maps.length, i = [], a = 0;
|
|
1726
|
+
return this.items.forEach((t, o) => {
|
|
1727
|
+
if (o >= e) i.push(t), t.selection && a++;
|
|
1728
|
+
else if (t.step) {
|
|
1729
|
+
let e = t.step.map(n.slice(r)), o = e && e.getMap();
|
|
1730
|
+
if (r--, o && n.appendMap(o, r), e) {
|
|
1731
|
+
let s = t.selection && t.selection.map(n.slice(r));
|
|
1732
1732
|
s && a++;
|
|
1733
|
-
let c = new K(o.invert(),
|
|
1733
|
+
let c = new K(o.invert(), e, s), l, u = i.length - 1;
|
|
1734
1734
|
(l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
|
|
1735
1735
|
}
|
|
1736
|
-
} else
|
|
1737
|
-
}, this.items.length, 0), new
|
|
1736
|
+
} else t.map && r--;
|
|
1737
|
+
}, this.items.length, 0), new t(W.from(i.reverse()), a);
|
|
1738
1738
|
}
|
|
1739
1739
|
};
|
|
1740
1740
|
G.empty = new G(W.empty, 0);
|
|
@@ -1760,17 +1760,17 @@ var K = class e {
|
|
|
1760
1760
|
}
|
|
1761
1761
|
}, xt = 20;
|
|
1762
1762
|
function St(e, t, n, r) {
|
|
1763
|
-
let i = n.getMeta(
|
|
1763
|
+
let i = n.getMeta(Z), a;
|
|
1764
1764
|
if (i) return i.historyState;
|
|
1765
|
-
n.getMeta(
|
|
1765
|
+
n.getMeta(Dt) && (e = new q(e.done, e.undone, null, 0, -1));
|
|
1766
1766
|
let o = n.getMeta("appendedTransaction");
|
|
1767
1767
|
if (n.steps.length == 0) return e;
|
|
1768
|
-
if (o && o.getMeta(
|
|
1768
|
+
if (o && o.getMeta(Z)) return o.getMeta(Z).redo ? new q(e.done.addTransform(n, void 0, r, X(t)), e.undone, wt(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);
|
|
1769
1769
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
1770
|
-
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Ct(n, e.prevRanges)), s = o ?
|
|
1771
|
-
return new q(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r,
|
|
1772
|
-
} else if (a = n.getMeta("rebased")) return new q(e.done.rebased(n, a), e.undone.rebased(n, a),
|
|
1773
|
-
else return new q(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps),
|
|
1770
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Ct(n, e.prevRanges)), s = o ? J(e.prevRanges, n.mapping) : wt(n.mapping.maps);
|
|
1771
|
+
return new q(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, X(t)), G.empty, s, n.time, i ?? e.prevComposition);
|
|
1772
|
+
} 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);
|
|
1773
|
+
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);
|
|
1774
1774
|
}
|
|
1775
1775
|
function Ct(e, t) {
|
|
1776
1776
|
if (!t) return !1;
|
|
@@ -1780,12 +1780,12 @@ function Ct(e, t) {
|
|
|
1780
1780
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
1781
1781
|
}), n;
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1783
|
+
function wt(e) {
|
|
1784
1784
|
let t = [];
|
|
1785
1785
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
1786
1786
|
return t;
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1788
|
+
function J(e, t) {
|
|
1789
1789
|
if (!e) return null;
|
|
1790
1790
|
let n = [];
|
|
1791
1791
|
for (let r = 0; r < e.length; r += 2) {
|
|
@@ -1794,34 +1794,34 @@ function Y(e, t) {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
return n;
|
|
1796
1796
|
}
|
|
1797
|
-
function
|
|
1798
|
-
let r =
|
|
1797
|
+
function Tt(e, t, n) {
|
|
1798
|
+
let r = X(t), i = Z.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
1799
1799
|
if (!a) return null;
|
|
1800
1800
|
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);
|
|
1801
|
-
return a.transform.setSelection(o).setMeta(
|
|
1801
|
+
return a.transform.setSelection(o).setMeta(Z, {
|
|
1802
1802
|
redo: n,
|
|
1803
1803
|
historyState: c
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
|
-
var
|
|
1807
|
-
function
|
|
1806
|
+
var Y = !1, Et = null;
|
|
1807
|
+
function X(e) {
|
|
1808
1808
|
let t = e.plugins;
|
|
1809
|
-
if (
|
|
1810
|
-
|
|
1809
|
+
if (Et != t) {
|
|
1810
|
+
Y = !1, Et = t;
|
|
1811
1811
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
1812
|
-
|
|
1812
|
+
Y = !0;
|
|
1813
1813
|
break;
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
|
-
return
|
|
1816
|
+
return Y;
|
|
1817
1817
|
}
|
|
1818
|
-
var
|
|
1819
|
-
function
|
|
1818
|
+
var Z = new g("history"), Dt = new g("closeHistory");
|
|
1819
|
+
function Ot(e = {}) {
|
|
1820
1820
|
return e = {
|
|
1821
1821
|
depth: e.depth || 100,
|
|
1822
1822
|
newGroupDelay: e.newGroupDelay || 500
|
|
1823
|
-
}, new
|
|
1824
|
-
key:
|
|
1823
|
+
}, new E({
|
|
1824
|
+
key: Z,
|
|
1825
1825
|
state: {
|
|
1826
1826
|
init() {
|
|
1827
1827
|
return new q(G.empty, G.empty, null, 0, -1);
|
|
@@ -1832,24 +1832,24 @@ function Dt(e = {}) {
|
|
|
1832
1832
|
},
|
|
1833
1833
|
config: e,
|
|
1834
1834
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
1835
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
1835
|
+
let n = t.inputType, r = n == "historyUndo" ? At : n == "historyRedo" ? jt : null;
|
|
1836
1836
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
1837
1837
|
} } }
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function kt(e, t) {
|
|
1841
1841
|
return (n, r) => {
|
|
1842
|
-
let i =
|
|
1842
|
+
let i = Z.getState(n);
|
|
1843
1843
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
1844
1844
|
if (r) {
|
|
1845
|
-
let a =
|
|
1845
|
+
let a = Tt(i, n, e);
|
|
1846
1846
|
a && r(t ? a.scrollIntoView() : a);
|
|
1847
1847
|
}
|
|
1848
1848
|
return !0;
|
|
1849
1849
|
};
|
|
1850
1850
|
}
|
|
1851
|
-
var
|
|
1852
|
-
|
|
1851
|
+
var At = kt(!1, !0), jt = kt(!0, !0);
|
|
1852
|
+
b.create({
|
|
1853
1853
|
name: "characterCount",
|
|
1854
1854
|
addOptions() {
|
|
1855
1855
|
return {
|
|
@@ -1881,8 +1881,8 @@ _.create({
|
|
|
1881
1881
|
},
|
|
1882
1882
|
addProseMirrorPlugins() {
|
|
1883
1883
|
let e = !1;
|
|
1884
|
-
return [new
|
|
1885
|
-
key: new
|
|
1884
|
+
return [new E({
|
|
1885
|
+
key: new g("characterCount"),
|
|
1886
1886
|
appendTransaction: (t, n, r) => {
|
|
1887
1887
|
if (e) return;
|
|
1888
1888
|
let i = this.options.limit, a = this.options.autoTrim;
|
|
@@ -1911,7 +1911,7 @@ _.create({
|
|
|
1911
1911
|
})];
|
|
1912
1912
|
}
|
|
1913
1913
|
});
|
|
1914
|
-
var
|
|
1914
|
+
var Mt = b.create({
|
|
1915
1915
|
name: "dropCursor",
|
|
1916
1916
|
addOptions() {
|
|
1917
1917
|
return {
|
|
@@ -1924,7 +1924,7 @@ var jt = _.create({
|
|
|
1924
1924
|
return [ot(this.options)];
|
|
1925
1925
|
}
|
|
1926
1926
|
});
|
|
1927
|
-
|
|
1927
|
+
b.create({
|
|
1928
1928
|
name: "focus",
|
|
1929
1929
|
addOptions() {
|
|
1930
1930
|
return {
|
|
@@ -1933,11 +1933,11 @@ _.create({
|
|
|
1933
1933
|
};
|
|
1934
1934
|
},
|
|
1935
1935
|
addProseMirrorPlugins() {
|
|
1936
|
-
return [new
|
|
1937
|
-
key: new
|
|
1936
|
+
return [new E({
|
|
1937
|
+
key: new g("focus"),
|
|
1938
1938
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
1939
1939
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
1940
|
-
if (!n || !r) return
|
|
1940
|
+
if (!n || !r) return h.create(e, []);
|
|
1941
1941
|
let o = 0;
|
|
1942
1942
|
this.options.mode === "deepest" && e.descendants((e, t) => {
|
|
1943
1943
|
if (!e.isText) {
|
|
@@ -1949,35 +1949,110 @@ _.create({
|
|
|
1949
1949
|
return e.descendants((e, t) => {
|
|
1950
1950
|
if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
|
|
1951
1951
|
if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
|
|
1952
|
-
a.push(
|
|
1953
|
-
}),
|
|
1952
|
+
a.push(y.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
1953
|
+
}), h.create(e, a);
|
|
1954
1954
|
} }
|
|
1955
1955
|
})];
|
|
1956
1956
|
}
|
|
1957
1957
|
});
|
|
1958
|
-
var
|
|
1958
|
+
var Nt = b.create({
|
|
1959
1959
|
name: "gapCursor",
|
|
1960
1960
|
addProseMirrorPlugins() {
|
|
1961
1961
|
return [ft()];
|
|
1962
1962
|
},
|
|
1963
1963
|
extendNodeSchema(e) {
|
|
1964
|
-
return { allowGapCursor:
|
|
1964
|
+
return { allowGapCursor: m(p(e, "allowGapCursor", {
|
|
1965
1965
|
name: e.name,
|
|
1966
1966
|
options: e.options,
|
|
1967
1967
|
storage: e.storage
|
|
1968
1968
|
})) ?? null };
|
|
1969
1969
|
}
|
|
1970
|
-
})
|
|
1970
|
+
});
|
|
1971
1971
|
function Pt(e) {
|
|
1972
|
+
let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
|
|
1973
|
+
return o && u.push(l), y.node(i, i + a.nodeSize, {
|
|
1974
|
+
class: u.join(" "),
|
|
1975
|
+
[r]: typeof n == "function" ? n({
|
|
1976
|
+
editor: t,
|
|
1977
|
+
node: a,
|
|
1978
|
+
pos: i,
|
|
1979
|
+
hasAnchor: s
|
|
1980
|
+
}) : n
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
function Ft(e) {
|
|
1984
|
+
let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
|
|
1985
|
+
return /auto|scroll|overlay/.test(n);
|
|
1986
|
+
}
|
|
1987
|
+
function It(e) {
|
|
1988
|
+
let t = e;
|
|
1989
|
+
for (; t;) {
|
|
1990
|
+
if (Ft(t)) return t;
|
|
1991
|
+
let e = t.parentElement;
|
|
1992
|
+
if (!e) {
|
|
1993
|
+
let e = t.getRootNode();
|
|
1994
|
+
if (e instanceof ShadowRoot) {
|
|
1995
|
+
t = e.host;
|
|
1996
|
+
continue;
|
|
1997
|
+
}
|
|
1998
|
+
return window;
|
|
1999
|
+
}
|
|
2000
|
+
t = e;
|
|
2001
|
+
}
|
|
2002
|
+
return window;
|
|
2003
|
+
}
|
|
2004
|
+
function Lt(e) {
|
|
2005
|
+
return e === window ? {
|
|
2006
|
+
top: 0,
|
|
2007
|
+
bottom: window.innerHeight
|
|
2008
|
+
} : e.getBoundingClientRect();
|
|
2009
|
+
}
|
|
2010
|
+
function Rt({ doc: e, view: t, scrollContainer: n }) {
|
|
2011
|
+
let r = t.dom.getBoundingClientRect(), i = n ? Lt(n) : {
|
|
2012
|
+
top: 0,
|
|
2013
|
+
bottom: window.innerHeight
|
|
2014
|
+
}, a = Math.max(r.top, i.top), o = Math.min(r.bottom, i.bottom);
|
|
2015
|
+
if (a >= o) return {
|
|
2016
|
+
top: 0,
|
|
2017
|
+
bottom: e.content.size
|
|
2018
|
+
};
|
|
2019
|
+
let s = getComputedStyle(t.dom).direction === "rtl" ? Math.max(r.right - 2, r.left + 2) : r.left + 2, c = t.posAtCoords({
|
|
2020
|
+
left: s,
|
|
2021
|
+
top: a + 2
|
|
2022
|
+
}), l = t.posAtCoords({
|
|
2023
|
+
left: s,
|
|
2024
|
+
top: o - 2
|
|
2025
|
+
});
|
|
2026
|
+
return {
|
|
2027
|
+
top: c ? c.pos : 0,
|
|
2028
|
+
bottom: l ? l.pos : e.content.size
|
|
2029
|
+
};
|
|
2030
|
+
}
|
|
2031
|
+
function zt(e, t) {
|
|
2032
|
+
let n = null;
|
|
2033
|
+
return {
|
|
2034
|
+
call: ((...r) => {
|
|
2035
|
+
n ||= (e(...r), setTimeout(() => {
|
|
2036
|
+
n = null;
|
|
2037
|
+
}, t));
|
|
2038
|
+
}),
|
|
2039
|
+
cancel: () => {
|
|
2040
|
+
n &&= (clearTimeout(n), null);
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
var Bt = "placeholder";
|
|
2045
|
+
function Vt(e) {
|
|
1972
2046
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
1973
2047
|
}
|
|
1974
|
-
|
|
2048
|
+
var Q = new g("tiptap__placeholder");
|
|
2049
|
+
b.create({
|
|
1975
2050
|
name: "placeholder",
|
|
1976
2051
|
addOptions() {
|
|
1977
2052
|
return {
|
|
1978
2053
|
emptyEditorClass: "is-editor-empty",
|
|
1979
2054
|
emptyNodeClass: "is-empty",
|
|
1980
|
-
dataAttribute:
|
|
2055
|
+
dataAttribute: Bt,
|
|
1981
2056
|
placeholder: "Write something …",
|
|
1982
2057
|
showOnlyWhenEditable: !0,
|
|
1983
2058
|
showOnlyCurrent: !0,
|
|
@@ -1985,54 +2060,118 @@ _.create({
|
|
|
1985
2060
|
};
|
|
1986
2061
|
},
|
|
1987
2062
|
addProseMirrorPlugins() {
|
|
1988
|
-
let e = this.options.dataAttribute ? `data-${
|
|
1989
|
-
return [new
|
|
1990
|
-
|
|
2063
|
+
let e = this.options.dataAttribute ? `data-${Vt(this.options.dataAttribute)}` : `data-${Bt}`;
|
|
2064
|
+
return [new E({
|
|
2065
|
+
state: {
|
|
2066
|
+
init() {
|
|
2067
|
+
return {
|
|
2068
|
+
topPos: null,
|
|
2069
|
+
bottomPos: null
|
|
2070
|
+
};
|
|
2071
|
+
},
|
|
2072
|
+
apply(e, t) {
|
|
2073
|
+
let n = e.getMeta(Q);
|
|
2074
|
+
return n?.positions ? {
|
|
2075
|
+
topPos: n.positions.top,
|
|
2076
|
+
bottomPos: n.positions.bottom
|
|
2077
|
+
} : e.docChanged ? {
|
|
2078
|
+
topPos: t.topPos === null ? null : e.mapping.map(t.topPos),
|
|
2079
|
+
bottomPos: t.bottomPos === null ? null : e.mapping.map(t.bottomPos)
|
|
2080
|
+
} : t;
|
|
2081
|
+
}
|
|
2082
|
+
},
|
|
2083
|
+
key: Q,
|
|
2084
|
+
view(e) {
|
|
2085
|
+
let t = It(e.dom), n = () => {
|
|
2086
|
+
let n = Rt({
|
|
2087
|
+
view: e,
|
|
2088
|
+
doc: e.state.doc,
|
|
2089
|
+
scrollContainer: t
|
|
2090
|
+
}), r = Q.getState(e.state);
|
|
2091
|
+
if (r.topPos === n.top && r.bottomPos === n.bottom) return;
|
|
2092
|
+
let i = e.state.tr.setMeta(Q, { positions: n }).setMeta("tiptap__viewportUpdate", !0);
|
|
2093
|
+
e.dispatch(i);
|
|
2094
|
+
}, { call: r, cancel: i } = zt(n, 250), a = t;
|
|
2095
|
+
return a.addEventListener("scroll", r, { passive: !0 }), n(), {
|
|
2096
|
+
update(t, r) {
|
|
2097
|
+
e.state.doc.content.size !== r.doc.content.size && n();
|
|
2098
|
+
},
|
|
2099
|
+
destroy: () => {
|
|
2100
|
+
i(), a.removeEventListener("scroll", r);
|
|
2101
|
+
}
|
|
2102
|
+
};
|
|
2103
|
+
},
|
|
1991
2104
|
props: { decorations: ({ doc: t, selection: n }) => {
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
o && i.push(this.options.emptyEditorClass);
|
|
2001
|
-
let s = x.node(n, n + t.nodeSize, {
|
|
2002
|
-
class: i.join(" "),
|
|
2003
|
-
[e]: typeof this.options.placeholder == "function" ? this.options.placeholder({
|
|
2004
|
-
editor: this.editor,
|
|
2105
|
+
if (!(this.editor.isEditable || !this.options.showOnlyWhenEditable)) return null;
|
|
2106
|
+
let { anchor: r } = n, i = [], a = this.editor.isEmpty;
|
|
2107
|
+
if (this.options.showOnlyCurrent && !this.options.includeChildren) {
|
|
2108
|
+
let n = t.resolve(r);
|
|
2109
|
+
if (n.depth > 0) {
|
|
2110
|
+
let t = n.node(1), s = n.before(1);
|
|
2111
|
+
if (t.type.isTextblock && o(t)) {
|
|
2112
|
+
let o = Pt({
|
|
2005
2113
|
node: t,
|
|
2006
|
-
|
|
2007
|
-
hasAnchor: r
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2114
|
+
dataAttribute: e,
|
|
2115
|
+
hasAnchor: r >= s && r <= s + t.nodeSize,
|
|
2116
|
+
placeholder: this.options.placeholder,
|
|
2117
|
+
classes: {
|
|
2118
|
+
emptyEditor: this.options.emptyEditorClass,
|
|
2119
|
+
emptyNode: this.options.emptyNodeClass
|
|
2120
|
+
},
|
|
2121
|
+
editor: this.editor,
|
|
2122
|
+
isEmptyDoc: a,
|
|
2123
|
+
pos: n.before(1)
|
|
2124
|
+
});
|
|
2125
|
+
i.push(o);
|
|
2126
|
+
}
|
|
2011
2127
|
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2128
|
+
} else {
|
|
2129
|
+
let n = Q.getState(this.editor.state), s = n.topPos ?? 0, c = n.bottomPos ?? t.content.size;
|
|
2130
|
+
t.nodesBetween(s, c, (t, n) => {
|
|
2131
|
+
let s = r >= n && r <= n + t.nodeSize, c = !t.isLeaf && o(t);
|
|
2132
|
+
if (!t.type.isTextblock) return this.options.includeChildren;
|
|
2133
|
+
if ((s || !this.options.showOnlyCurrent) && c) {
|
|
2134
|
+
let r = Pt({
|
|
2135
|
+
classes: {
|
|
2136
|
+
emptyEditor: this.options.emptyEditorClass,
|
|
2137
|
+
emptyNode: this.options.emptyNodeClass
|
|
2138
|
+
},
|
|
2139
|
+
editor: this.editor,
|
|
2140
|
+
isEmptyDoc: a,
|
|
2141
|
+
dataAttribute: e,
|
|
2142
|
+
hasAnchor: s,
|
|
2143
|
+
placeholder: this.options.placeholder,
|
|
2144
|
+
node: t,
|
|
2145
|
+
pos: n
|
|
2146
|
+
});
|
|
2147
|
+
i.push(r);
|
|
2148
|
+
}
|
|
2149
|
+
return this.options.includeChildren;
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
return h.create(t, i);
|
|
2014
2153
|
} }
|
|
2015
2154
|
})];
|
|
2016
2155
|
}
|
|
2017
|
-
}),
|
|
2156
|
+
}), b.create({
|
|
2018
2157
|
name: "selection",
|
|
2019
2158
|
addOptions() {
|
|
2020
2159
|
return { className: "selection" };
|
|
2021
2160
|
},
|
|
2022
2161
|
addProseMirrorPlugins() {
|
|
2023
2162
|
let { editor: e, options: t } = this;
|
|
2024
|
-
return [new
|
|
2025
|
-
key: new
|
|
2163
|
+
return [new E({
|
|
2164
|
+
key: new g("selection"),
|
|
2026
2165
|
props: { decorations(n) {
|
|
2027
|
-
return n.selection.empty || e.isFocused || !e.isEditable ||
|
|
2166
|
+
return n.selection.empty || e.isFocused || !e.isEditable || s(n.selection) || e.view.dragging ? null : h.create(n.doc, [y.inline(n.selection.from, n.selection.to, { class: t.className })]);
|
|
2028
2167
|
} }
|
|
2029
2168
|
})];
|
|
2030
2169
|
}
|
|
2031
2170
|
});
|
|
2032
|
-
function
|
|
2171
|
+
function Ht({ types: e, node: t }) {
|
|
2033
2172
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
2034
2173
|
}
|
|
2035
|
-
var
|
|
2174
|
+
var Ut = b.create({
|
|
2036
2175
|
name: "trailingNode",
|
|
2037
2176
|
addOptions() {
|
|
2038
2177
|
return {
|
|
@@ -2041,8 +2180,8 @@ var It = _.create({
|
|
|
2041
2180
|
};
|
|
2042
2181
|
},
|
|
2043
2182
|
addProseMirrorPlugins() {
|
|
2044
|
-
let e = new
|
|
2045
|
-
return [new
|
|
2183
|
+
let e = new g(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));
|
|
2184
|
+
return [new E({
|
|
2046
2185
|
key: e,
|
|
2047
2186
|
appendTransaction: (n, r, i) => {
|
|
2048
2187
|
let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
|
|
@@ -2051,7 +2190,7 @@ var It = _.create({
|
|
|
2051
2190
|
state: {
|
|
2052
2191
|
init: (e, t) => {
|
|
2053
2192
|
let r = t.tr.doc.lastChild;
|
|
2054
|
-
return !
|
|
2193
|
+
return !Ht({
|
|
2055
2194
|
node: r,
|
|
2056
2195
|
types: n
|
|
2057
2196
|
});
|
|
@@ -2059,7 +2198,7 @@ var It = _.create({
|
|
|
2059
2198
|
apply: (e, t) => {
|
|
2060
2199
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
2061
2200
|
let r = e.doc.lastChild;
|
|
2062
|
-
return !
|
|
2201
|
+
return !Ht({
|
|
2063
2202
|
node: r,
|
|
2064
2203
|
types: n
|
|
2065
2204
|
});
|
|
@@ -2067,7 +2206,7 @@ var It = _.create({
|
|
|
2067
2206
|
}
|
|
2068
2207
|
})];
|
|
2069
2208
|
}
|
|
2070
|
-
}),
|
|
2209
|
+
}), Wt = b.create({
|
|
2071
2210
|
name: "undoRedo",
|
|
2072
2211
|
addOptions() {
|
|
2073
2212
|
return {
|
|
@@ -2077,12 +2216,12 @@ var It = _.create({
|
|
|
2077
2216
|
},
|
|
2078
2217
|
addCommands() {
|
|
2079
2218
|
return {
|
|
2080
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
2081
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
2219
|
+
undo: () => ({ state: e, dispatch: t }) => At(e, t),
|
|
2220
|
+
redo: () => ({ state: e, dispatch: t }) => jt(e, t)
|
|
2082
2221
|
};
|
|
2083
2222
|
},
|
|
2084
2223
|
addProseMirrorPlugins() {
|
|
2085
|
-
return [
|
|
2224
|
+
return [Ot(this.options)];
|
|
2086
2225
|
},
|
|
2087
2226
|
addKeyboardShortcuts() {
|
|
2088
2227
|
return {
|
|
@@ -2093,12 +2232,12 @@ var It = _.create({
|
|
|
2093
2232
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
2094
2233
|
};
|
|
2095
2234
|
}
|
|
2096
|
-
}), $ =
|
|
2235
|
+
}), $ = b.create({
|
|
2097
2236
|
name: "starterKit",
|
|
2098
2237
|
addExtensions() {
|
|
2099
2238
|
let e = [];
|
|
2100
|
-
return this.options.bold !== !1 && e.push(
|
|
2239
|
+
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(Mt.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(Nt.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(Wt.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(Be.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(se.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(Ze.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(tt.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(it.configure(this.options.strike)), this.options.text !== !1 && e.push(at.configure(this.options.text)), this.options.underline !== !1 && e.push(ce.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(Ut.configure(this.options?.trailingNode)), e;
|
|
2101
2240
|
}
|
|
2102
|
-
}),
|
|
2241
|
+
}), Gt = $;
|
|
2103
2242
|
//#endregion
|
|
2104
|
-
export { $ as StarterKit,
|
|
2243
|
+
export { $ as StarterKit, Gt as default };
|