@burdenoff/microfe-support 2026.1115.1 → 2026.1118.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/support/components/careers/RichTextEditor.js +31 -31
- package/dist/support/components/careers/RichTextEditor.js.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -6
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -3491
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -44
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +0 -12
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -75
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -73
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -157
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -11
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -50
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -49
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -389
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -967
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -46
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -6
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -55
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -14
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -72
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -457
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -332
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -28
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -298
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -527
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -68
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -334
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -112
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -168
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -219
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -51
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -1775
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -77
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -526
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1204
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -3355
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -84
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -55
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -53
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -53
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -45
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -11
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -11
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -89
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
|
@@ -1,967 +0,0 @@
|
|
|
1
|
-
import { Extension as e, Node as t, getNodeAtPosition as n, getNodeType as r, getPreviousBlockSibling as i, getRenderedAttributes as a, isAtEndOfNode as o, isAtStartOfNode as s, isNodeActive as c, mergeAttributes as l, parseIndentedBlocks as u, renderNestedMarkdownContent as d, wrappingInputRule as f } from "../../core/dist/index.js";
|
|
2
|
-
import { Fragment as p } from "../../../prosemirror-model/dist/index.js";
|
|
3
|
-
import { joinTextblockBackward as m, joinTextblockForward as h } from "../../../prosemirror-commands/dist/index.js";
|
|
4
|
-
import { Plugin as g, TextSelection as _ } from "../../../prosemirror-state/dist/index.js";
|
|
5
|
-
// node_modules/@tiptap/extension-list/dist/index.js
|
|
6
|
-
var ee = "listItem", v = "textStyle", y = /^\s*([-+*])\s$/, b = t.create({
|
|
7
|
-
name: "bulletList",
|
|
8
|
-
addOptions() {
|
|
9
|
-
return {
|
|
10
|
-
itemTypeName: "listItem",
|
|
11
|
-
HTMLAttributes: {},
|
|
12
|
-
keepMarks: !1,
|
|
13
|
-
keepAttributes: !1
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
group: "block list",
|
|
17
|
-
content() {
|
|
18
|
-
return `${this.options.itemTypeName}+`;
|
|
19
|
-
},
|
|
20
|
-
parseHTML() {
|
|
21
|
-
return [{ tag: "ul" }];
|
|
22
|
-
},
|
|
23
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
24
|
-
return [
|
|
25
|
-
"ul",
|
|
26
|
-
l(this.options.HTMLAttributes, e),
|
|
27
|
-
0
|
|
28
|
-
];
|
|
29
|
-
},
|
|
30
|
-
markdownTokenName: "list",
|
|
31
|
-
parseMarkdown: (e, t) => e.type !== "list" || e.ordered ? [] : {
|
|
32
|
-
type: "bulletList",
|
|
33
|
-
content: e.items ? t.parseChildren(e.items) : []
|
|
34
|
-
},
|
|
35
|
-
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
|
|
36
|
-
markdownOptions: { indentsContent: !0 },
|
|
37
|
-
addCommands() {
|
|
38
|
-
return { toggleBulletList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ee, this.editor.getAttributes(v)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
39
|
-
},
|
|
40
|
-
addKeyboardShortcuts() {
|
|
41
|
-
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
42
|
-
},
|
|
43
|
-
addInputRules() {
|
|
44
|
-
let e = f({
|
|
45
|
-
find: y,
|
|
46
|
-
type: this.type
|
|
47
|
-
});
|
|
48
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (e = f({
|
|
49
|
-
find: y,
|
|
50
|
-
type: this.type,
|
|
51
|
-
keepMarks: this.options.keepMarks,
|
|
52
|
-
keepAttributes: this.options.keepAttributes,
|
|
53
|
-
getAttributes: () => this.editor.getAttributes(v),
|
|
54
|
-
editor: this.editor
|
|
55
|
-
})), [e];
|
|
56
|
-
}
|
|
57
|
-
}), te = (e, t, n) => {
|
|
58
|
-
let { selection: r } = e;
|
|
59
|
-
if (!r.empty) return null;
|
|
60
|
-
let { $from: i } = r;
|
|
61
|
-
if (!i.parent.isTextblock || i.parentOffset !== i.parent.content.size) return null;
|
|
62
|
-
let a = -1;
|
|
63
|
-
for (let e = i.depth; e > 0; --e) if (i.node(e).type.name === t) {
|
|
64
|
-
a = e;
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
if (a < 0) return null;
|
|
68
|
-
let o = i.node(a), s = i.index(a);
|
|
69
|
-
if (s + 1 >= o.childCount) return null;
|
|
70
|
-
let c = o.child(s + 1);
|
|
71
|
-
if (!n.includes(c.type.name)) return null;
|
|
72
|
-
let l = e.schema.nodes[t], u = !1;
|
|
73
|
-
if (c.forEach((e) => {
|
|
74
|
-
e.type === l && e.childCount > 1 && (u = !0);
|
|
75
|
-
}), !u) return null;
|
|
76
|
-
let d = e.doc.resolve(i.after()).nodeAfter;
|
|
77
|
-
if (!d || !n.includes(d.type.name)) return null;
|
|
78
|
-
let f = [];
|
|
79
|
-
return d.forEach((e) => {
|
|
80
|
-
f.push(e);
|
|
81
|
-
}), f.length === 0 ? null : {
|
|
82
|
-
listItemDepth: a,
|
|
83
|
-
nestedList: d,
|
|
84
|
-
nestedListPos: i.after(),
|
|
85
|
-
insertPos: i.after(a),
|
|
86
|
-
items: f
|
|
87
|
-
};
|
|
88
|
-
}, ne = (e, t, n, r) => {
|
|
89
|
-
let i = te(e, n, r);
|
|
90
|
-
if (!i) return !1;
|
|
91
|
-
let { selection: a } = e, { nestedList: o, nestedListPos: s, insertPos: c, items: l } = i, u = e.tr;
|
|
92
|
-
u.delete(s, s + o.nodeSize);
|
|
93
|
-
let d = u.mapping.map(c);
|
|
94
|
-
return u.insert(d, p.from(l)), u.setSelection(a.map(u.doc, u.mapping)), t && t(u), !0;
|
|
95
|
-
}, re = (e, t, n) => ne(e.state, e.view.dispatch, t, n), x = (t, n) => e.create({
|
|
96
|
-
name: `${t}BranchingDeleteKeymap`,
|
|
97
|
-
priority: 101,
|
|
98
|
-
addKeyboardShortcuts() {
|
|
99
|
-
let e = () => re(this.editor, t, n);
|
|
100
|
-
return {
|
|
101
|
-
Delete: e,
|
|
102
|
-
"Mod-Delete": e
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}), S = [
|
|
106
|
-
[1e3, "m"],
|
|
107
|
-
[900, "cm"],
|
|
108
|
-
[500, "d"],
|
|
109
|
-
[400, "cd"],
|
|
110
|
-
[100, "c"],
|
|
111
|
-
[90, "xc"],
|
|
112
|
-
[50, "l"],
|
|
113
|
-
[40, "xl"],
|
|
114
|
-
[10, "x"],
|
|
115
|
-
[9, "ix"],
|
|
116
|
-
[5, "v"],
|
|
117
|
-
[4, "iv"],
|
|
118
|
-
[1, "i"]
|
|
119
|
-
], C = "abcdefghijklmnopqrstuvwxyz", w = String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;
|
|
120
|
-
function T(e) {
|
|
121
|
-
let t = e, n = "";
|
|
122
|
-
for (let [e, r] of S) for (; t >= e;) n += r, t -= e;
|
|
123
|
-
return n;
|
|
124
|
-
}
|
|
125
|
-
function E(e) {
|
|
126
|
-
return T(e).toUpperCase();
|
|
127
|
-
}
|
|
128
|
-
function D(e) {
|
|
129
|
-
let t = e.toLowerCase(), n = 0, r = 0;
|
|
130
|
-
for (; n < t.length;) {
|
|
131
|
-
let e = !1;
|
|
132
|
-
for (let [i, a] of S) if (t.startsWith(a, n)) {
|
|
133
|
-
r += i, n += a.length, e = !0;
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
if (!e) return 0;
|
|
137
|
-
}
|
|
138
|
-
return r;
|
|
139
|
-
}
|
|
140
|
-
function ie(e) {
|
|
141
|
-
if (!/^[ivxlcdmIVXLCDM]+$/.test(e)) return !1;
|
|
142
|
-
let t = D(e);
|
|
143
|
-
return t <= 0 ? !1 : (e === e.toLowerCase() ? T(t) : E(t)) === e;
|
|
144
|
-
}
|
|
145
|
-
function ae(e) {
|
|
146
|
-
let t = e.toLowerCase();
|
|
147
|
-
if (t.length === 1) return t.charCodeAt(0) - 97 + 1;
|
|
148
|
-
if (t.length === 2) {
|
|
149
|
-
let e = t.charCodeAt(0) - 97, n = t.charCodeAt(1) - 97;
|
|
150
|
-
return (e + 1) * 26 + n + 1;
|
|
151
|
-
}
|
|
152
|
-
return 0;
|
|
153
|
-
}
|
|
154
|
-
function O(e) {
|
|
155
|
-
if (e <= 26) return C[e - 1];
|
|
156
|
-
let t = Math.floor((e - 1) / 26) - 1, n = (e - 1) % 26;
|
|
157
|
-
return t < 0 ? C[n] : C[t] + C[n];
|
|
158
|
-
}
|
|
159
|
-
function k(e) {
|
|
160
|
-
if (e && !/^\d+$/.test(e)) {
|
|
161
|
-
if (ie(e)) return e === e.toLowerCase() ? "i" : "I";
|
|
162
|
-
if (/^[a-z]{1,2}$/.test(e)) return "a";
|
|
163
|
-
if (/^[A-Z]{1,2}$/.test(e)) return "A";
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function A(e) {
|
|
167
|
-
if (/^\d+$/.test(e)) return parseInt(e, 10);
|
|
168
|
-
let t = k(e);
|
|
169
|
-
if (t === "i" || t === "I") return D(e);
|
|
170
|
-
if (t === "a" || t === "A") {
|
|
171
|
-
let t = ae(e);
|
|
172
|
-
return t > 0 ? t : 1;
|
|
173
|
-
}
|
|
174
|
-
let n = parseInt(e, 10);
|
|
175
|
-
return Number.isNaN(n) ? 1 : n;
|
|
176
|
-
}
|
|
177
|
-
function oe(e, t) {
|
|
178
|
-
if (e === "numeric") return String(t);
|
|
179
|
-
switch (e) {
|
|
180
|
-
case "a": return O(t);
|
|
181
|
-
case "A": return O(t).toUpperCase();
|
|
182
|
-
case "i": return T(t);
|
|
183
|
-
case "I": return E(t);
|
|
184
|
-
default: return String(t);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
function j(e) {
|
|
188
|
-
if (e.length === 0) return !1;
|
|
189
|
-
let t = k(e[0]) ?? "numeric", n = A(e[0]);
|
|
190
|
-
if (n < 1) return !1;
|
|
191
|
-
for (let r = 0; r < e.length; r++) {
|
|
192
|
-
let i = oe(t, n + r);
|
|
193
|
-
if (e[r] !== i) return !1;
|
|
194
|
-
}
|
|
195
|
-
return !0;
|
|
196
|
-
}
|
|
197
|
-
function M(e) {
|
|
198
|
-
return {
|
|
199
|
-
type: k(e),
|
|
200
|
-
start: A(e)
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
function N(e) {
|
|
204
|
-
let { type: t, start: n } = M(e), r = {};
|
|
205
|
-
return t && (r.type = t), n !== 1 && (r.start = n), r;
|
|
206
|
-
}
|
|
207
|
-
function P(e, t, n = ". ") {
|
|
208
|
-
let r = t + 1;
|
|
209
|
-
if (!e || e === "1") return `${r}${n}`;
|
|
210
|
-
switch (e) {
|
|
211
|
-
case "a": return `${O(r)}${n}`;
|
|
212
|
-
case "A": return `${O(r).toUpperCase()}${n}`;
|
|
213
|
-
case "i": return `${T(r)}${n}`;
|
|
214
|
-
case "I": return `${E(r)}${n}`;
|
|
215
|
-
default: return `${r}${n}`;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
function se(e) {
|
|
219
|
-
return !e[0] || e[0].type === "paragraph" ? e : [{
|
|
220
|
-
type: "paragraph",
|
|
221
|
-
content: []
|
|
222
|
-
}, ...e];
|
|
223
|
-
}
|
|
224
|
-
function ce(e) {
|
|
225
|
-
let t = e.content?.[0];
|
|
226
|
-
return t?.type === "paragraph" && !t.content?.length;
|
|
227
|
-
}
|
|
228
|
-
var le = " ", F = 1, ue = (e) => (e?.level ?? F) > F;
|
|
229
|
-
function de(e) {
|
|
230
|
-
let t = e.tokens?.[0];
|
|
231
|
-
return !!(e.text && e.tokens?.length === 1 && t?.type === "list" && t.ordered && t.raw === e.text);
|
|
232
|
-
}
|
|
233
|
-
function fe(e, t) {
|
|
234
|
-
return t.tokenizeInline ? t.parseInline(t.tokenizeInline(e)) : t.parseInline([{
|
|
235
|
-
type: "text",
|
|
236
|
-
raw: e,
|
|
237
|
-
text: e
|
|
238
|
-
}]);
|
|
239
|
-
}
|
|
240
|
-
var I = t.create({
|
|
241
|
-
name: "listItem",
|
|
242
|
-
addOptions() {
|
|
243
|
-
return {
|
|
244
|
-
HTMLAttributes: {},
|
|
245
|
-
bulletListTypeName: "bulletList",
|
|
246
|
-
orderedListTypeName: "orderedList"
|
|
247
|
-
};
|
|
248
|
-
},
|
|
249
|
-
content: "paragraph block*",
|
|
250
|
-
defining: !0,
|
|
251
|
-
parseHTML() {
|
|
252
|
-
return [{ tag: "li" }];
|
|
253
|
-
},
|
|
254
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
255
|
-
return [
|
|
256
|
-
"li",
|
|
257
|
-
l(this.options.HTMLAttributes, e),
|
|
258
|
-
0
|
|
259
|
-
];
|
|
260
|
-
},
|
|
261
|
-
markdownTokenName: "list_item",
|
|
262
|
-
parseMarkdown: (e, t) => {
|
|
263
|
-
if (e.type !== "list_item") return [];
|
|
264
|
-
let n = t.parseBlockChildren ?? t.parseChildren, r = [];
|
|
265
|
-
if (e.tokens && e.tokens.length > 0) {
|
|
266
|
-
if (de(e)) return {
|
|
267
|
-
type: "listItem",
|
|
268
|
-
content: [{
|
|
269
|
-
type: "paragraph",
|
|
270
|
-
content: fe(e.text || "", t)
|
|
271
|
-
}]
|
|
272
|
-
};
|
|
273
|
-
let [i, ...a] = e.tokens;
|
|
274
|
-
if (i.type === "heading") return {
|
|
275
|
-
type: "listItem",
|
|
276
|
-
content: [{
|
|
277
|
-
type: "paragraph",
|
|
278
|
-
content: t.parseInline(i.tokens ?? [])
|
|
279
|
-
}, ...a.length > 0 ? n(a) : []]
|
|
280
|
-
};
|
|
281
|
-
if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
|
|
282
|
-
else if (i.type === "text" && i.tokens && i.tokens.length > 0) {
|
|
283
|
-
if (r = [{
|
|
284
|
-
type: "paragraph",
|
|
285
|
-
content: t.parseInline(i.tokens)
|
|
286
|
-
}], e.tokens.length > 1) {
|
|
287
|
-
let t = n(e.tokens.slice(1));
|
|
288
|
-
r.push(...t);
|
|
289
|
-
}
|
|
290
|
-
} else r = n(e.tokens);
|
|
291
|
-
}
|
|
292
|
-
return r.length === 0 && (r = [{
|
|
293
|
-
type: "paragraph",
|
|
294
|
-
content: []
|
|
295
|
-
}]), {
|
|
296
|
-
type: "listItem",
|
|
297
|
-
content: se(r)
|
|
298
|
-
};
|
|
299
|
-
},
|
|
300
|
-
renderMarkdown: (e, t, n) => {
|
|
301
|
-
let r = (e) => {
|
|
302
|
-
if (e.parentType === "bulletList") return "- ";
|
|
303
|
-
if (e.parentType === "orderedList") {
|
|
304
|
-
var t, n;
|
|
305
|
-
let r = ((t = e.meta) == null || (t = t.parentAttrs) == null ? void 0 : t.start) || 1;
|
|
306
|
-
return P((n = e.meta) == null || (n = n.parentAttrs) == null ? void 0 : n.type, r - 1 + (e.index || 0), ". ");
|
|
307
|
-
}
|
|
308
|
-
return "- ";
|
|
309
|
-
}, i = d(e, t, r, n, { alignNestedToPrefix: n?.parentType === "orderedList" });
|
|
310
|
-
if (!ce(e) || !ue(n)) return i;
|
|
311
|
-
let a = r(n);
|
|
312
|
-
return `${a}${le}${i.slice(a.length)}`;
|
|
313
|
-
},
|
|
314
|
-
addExtensions() {
|
|
315
|
-
return [x(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
|
|
316
|
-
},
|
|
317
|
-
addKeyboardShortcuts() {
|
|
318
|
-
return {
|
|
319
|
-
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
320
|
-
Tab: () => this.editor.commands.sinkListItem(this.name),
|
|
321
|
-
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
}), L = (e, t) => {
|
|
325
|
-
let { $from: n } = t.selection, i = r(e, t.schema), a = null, o = n.depth, s = n.pos, c = null;
|
|
326
|
-
for (; o > 0 && c === null;) a = n.node(o), a.type === i ? c = o : (--o, --s);
|
|
327
|
-
return c === null ? null : {
|
|
328
|
-
$pos: t.doc.resolve(s),
|
|
329
|
-
depth: c
|
|
330
|
-
};
|
|
331
|
-
}, R = (e, t) => {
|
|
332
|
-
let r = L(e, t);
|
|
333
|
-
if (!r) return !1;
|
|
334
|
-
let [, i] = n(t, e, r.$pos.pos + 4);
|
|
335
|
-
return i;
|
|
336
|
-
}, pe = (e, t, n) => {
|
|
337
|
-
let { $anchor: r } = e.selection, i = Math.max(0, r.pos - 2), a = e.doc.resolve(i).node();
|
|
338
|
-
return !(!a || !n.includes(a.type.name));
|
|
339
|
-
}, z = (e, t, n) => {
|
|
340
|
-
if (e.commands.undoInputRule()) return !0;
|
|
341
|
-
if (e.state.selection.from !== e.state.selection.to) return !1;
|
|
342
|
-
if (!c(e.state, t) && pe(e.state, t, n)) {
|
|
343
|
-
let { $anchor: n } = e.state.selection, r = e.state.doc.resolve(n.before() - 1), i = [];
|
|
344
|
-
r.node().descendants((e, n) => {
|
|
345
|
-
e.type.name === t && i.push({
|
|
346
|
-
node: e,
|
|
347
|
-
pos: n
|
|
348
|
-
});
|
|
349
|
-
});
|
|
350
|
-
let a = i.at(-1);
|
|
351
|
-
if (!a) return !1;
|
|
352
|
-
let o = e.state.doc.resolve(r.start() + a.pos + 1);
|
|
353
|
-
return e.chain().command(({ tr: e }) => {
|
|
354
|
-
let t = o.end();
|
|
355
|
-
return e.delete(n.before(), n.after()).insert(t, n.parent), e.setSelection(_.create(e.doc, t + 1)), !0;
|
|
356
|
-
}).command(({ state: e, dispatch: t }) => (m(e, t), !0)).run();
|
|
357
|
-
}
|
|
358
|
-
if (!c(e.state, t) || !s(e.state)) return !1;
|
|
359
|
-
let { $from: r } = e.state.selection, i = r.depth - 1;
|
|
360
|
-
return r.node(i).type !== e.schema.nodes[t] || r.index(i) !== 0 ? !1 : e.chain().liftListItem(t).run();
|
|
361
|
-
}, me = (e, t) => {
|
|
362
|
-
let n = R(e, t), r = L(e, t);
|
|
363
|
-
return !r || !n ? !1 : n > r.depth;
|
|
364
|
-
}, he = (e, t) => {
|
|
365
|
-
let n = R(e, t), r = L(e, t);
|
|
366
|
-
return !r || !n ? !1 : n < r.depth;
|
|
367
|
-
}, B = (e, t) => !c(e.state, t) || !o(e.state, t) || !e.state.selection.empty ? !1 : me(t, e.state) ? e.chain().focus(e.state.selection.from + 4).lift(t).joinBackward().run() : he(t, e.state) ? e.commands.command(({ state: e, dispatch: t }) => h(e, t)) : e.commands.joinItemForward(), ge = (e, t, n) => {
|
|
368
|
-
let { state: r } = e, { selection: a } = r;
|
|
369
|
-
if (!a.empty) return !1;
|
|
370
|
-
let { $from: o } = a;
|
|
371
|
-
if (o.parentOffset !== 0 || !o.parent.isTextblock || c(r, t)) return !1;
|
|
372
|
-
let s = i(o);
|
|
373
|
-
if (!s || !n.includes(s.type.name)) return !1;
|
|
374
|
-
let l = s.lastChild;
|
|
375
|
-
if (!l || l.type.name !== t) return !1;
|
|
376
|
-
let u = o.parent;
|
|
377
|
-
if (!l.canReplace(l.childCount, l.childCount, p.from(u))) return !1;
|
|
378
|
-
let d = o.before(), f = o.after(), m = d - 2;
|
|
379
|
-
return e.commands.command(({ tr: e, dispatch: t }) => (t && (e.delete(d, f).insert(m, p.from(u)), e.setSelection(_.create(e.doc, m + 1)), e.scrollIntoView()), !0));
|
|
380
|
-
}, V = e.create({
|
|
381
|
-
name: "listKeymap",
|
|
382
|
-
addOptions() {
|
|
383
|
-
return { listTypes: [{
|
|
384
|
-
itemName: "listItem",
|
|
385
|
-
wrapperNames: ["bulletList", "orderedList"]
|
|
386
|
-
}, {
|
|
387
|
-
itemName: "taskItem",
|
|
388
|
-
wrapperNames: ["taskList"]
|
|
389
|
-
}] };
|
|
390
|
-
},
|
|
391
|
-
addKeyboardShortcuts() {
|
|
392
|
-
return {
|
|
393
|
-
Delete: ({ editor: e }) => {
|
|
394
|
-
let t = !1;
|
|
395
|
-
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
396
|
-
e.state.schema.nodes[n] !== void 0 && B(e, n) && (t = !0);
|
|
397
|
-
}), t;
|
|
398
|
-
},
|
|
399
|
-
"Mod-Delete": ({ editor: e }) => {
|
|
400
|
-
let t = !1;
|
|
401
|
-
return this.options.listTypes.forEach(({ itemName: n }) => {
|
|
402
|
-
e.state.schema.nodes[n] !== void 0 && B(e, n) && (t = !0);
|
|
403
|
-
}), t;
|
|
404
|
-
},
|
|
405
|
-
Backspace: ({ editor: e }) => {
|
|
406
|
-
let t = !1;
|
|
407
|
-
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
408
|
-
e.state.schema.nodes[n] !== void 0 && z(e, n, r) && (t = !0);
|
|
409
|
-
}), t;
|
|
410
|
-
},
|
|
411
|
-
"Mod-Backspace": ({ editor: e }) => {
|
|
412
|
-
let t = !1;
|
|
413
|
-
return this.options.listTypes.forEach(({ itemName: n, wrapperNames: r }) => {
|
|
414
|
-
e.state.schema.nodes[n] !== void 0 && z(e, n, r) && (t = !0);
|
|
415
|
-
}), t;
|
|
416
|
-
},
|
|
417
|
-
Tab: ({ editor: e }) => {
|
|
418
|
-
for (let { itemName: t, wrapperNames: n } of this.options.listTypes) if (e.state.schema.nodes[t] !== void 0 && ge(e, t, n)) return !0;
|
|
419
|
-
return !1;
|
|
420
|
-
}
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
}), H = RegExp(`^(\\s*)(${w})([.)])\\s+(.*)$`), _e = /^\s/, U = {
|
|
424
|
-
heading: /^#{1,6}(?:\s|$)/,
|
|
425
|
-
bulletItem: /^[-+*]\s+/,
|
|
426
|
-
codeFence: /^(?:```|~~~)/,
|
|
427
|
-
blockMath: /^\$\$/,
|
|
428
|
-
thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
|
|
429
|
-
};
|
|
430
|
-
function ve(e) {
|
|
431
|
-
return H.test(e.trimStart());
|
|
432
|
-
}
|
|
433
|
-
function ye(e) {
|
|
434
|
-
let t = e.trimStart();
|
|
435
|
-
return U.bulletItem.test(t) || ve(t) || U.heading.test(t) || U.thematicBreak.test(t) && !t.startsWith("-") || /^>\s?/.test(t) || U.codeFence.test(t) || U.blockMath.test(t);
|
|
436
|
-
}
|
|
437
|
-
function be(e) {
|
|
438
|
-
return Object.values(U).some((t) => t.test(e));
|
|
439
|
-
}
|
|
440
|
-
function xe(e) {
|
|
441
|
-
let t = [], n = [], r = !1;
|
|
442
|
-
return e.forEach((e) => {
|
|
443
|
-
r ? n.push(e) : e.trim() === "" || t.length > 0 && ye(e) ? (r = !0, n.push(e)) : t.push(e);
|
|
444
|
-
}), {
|
|
445
|
-
paragraphLines: t,
|
|
446
|
-
blockLines: n
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
function W(e) {
|
|
450
|
-
let t = [], n = 0, r = 0;
|
|
451
|
-
for (; n < e.length;) {
|
|
452
|
-
let i = e[n], a = i.match(H);
|
|
453
|
-
if (!a) break;
|
|
454
|
-
let [, o, s, c, l] = a, u = o.length, d = parseInt(s, 10), f = isNaN(d) ? k(s) : void 0, p = isNaN(d) ? A(s) : d, m = [l], h = n + 1, g = [i], _ = !1;
|
|
455
|
-
for (; h < e.length;) {
|
|
456
|
-
let t = e[h];
|
|
457
|
-
if (t.match(H)) break;
|
|
458
|
-
if (t.trim() === "") g.push(t), m.push(""), _ = !0, h += 1;
|
|
459
|
-
else if (t.match(_e)) {
|
|
460
|
-
let e = t.length - t.trimStart().length, n = u + s.length + 1;
|
|
461
|
-
g.push(t), m.push(t.slice(Math.min(e, n))), h += 1;
|
|
462
|
-
} else {
|
|
463
|
-
if (_ || be(t)) break;
|
|
464
|
-
g.push(t), m.push(t), h += 1;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
t.push({
|
|
468
|
-
indent: u,
|
|
469
|
-
number: p,
|
|
470
|
-
type: f,
|
|
471
|
-
content: m.join("\n").trim(),
|
|
472
|
-
contentLines: m,
|
|
473
|
-
raw: g.join("\n")
|
|
474
|
-
}), r = h, n = h;
|
|
475
|
-
}
|
|
476
|
-
return [t, r];
|
|
477
|
-
}
|
|
478
|
-
var Se = RegExp(`^(${w})([.)])\\s+(.+)$`);
|
|
479
|
-
function G(e) {
|
|
480
|
-
let t = e.split("\n").filter((e) => e.trim().length > 0);
|
|
481
|
-
if (t.length === 0) return null;
|
|
482
|
-
let n = [];
|
|
483
|
-
for (let e of t) {
|
|
484
|
-
let t = e.trim().match(Se);
|
|
485
|
-
if (!t) return null;
|
|
486
|
-
n.push({
|
|
487
|
-
marker: t[1],
|
|
488
|
-
content: t[3]
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
return j(n.map((e) => e.marker)) ? {
|
|
492
|
-
type: "orderedList",
|
|
493
|
-
attrs: N(n[0].marker),
|
|
494
|
-
content: n.map((e) => ({
|
|
495
|
-
type: "listItem",
|
|
496
|
-
content: [{
|
|
497
|
-
type: "paragraph",
|
|
498
|
-
content: [{
|
|
499
|
-
type: "text",
|
|
500
|
-
text: e.content
|
|
501
|
-
}]
|
|
502
|
-
}]
|
|
503
|
-
}))
|
|
504
|
-
} : null;
|
|
505
|
-
}
|
|
506
|
-
function K(e, t, n) {
|
|
507
|
-
let r = [], i = 0;
|
|
508
|
-
for (; i < e.length;) {
|
|
509
|
-
let a = e[i];
|
|
510
|
-
if (a.indent === t) {
|
|
511
|
-
let { paragraphLines: o, blockLines: s } = xe(a.contentLines), c = o.join("\n").trim(), l = [];
|
|
512
|
-
c && l.push({
|
|
513
|
-
type: "paragraph",
|
|
514
|
-
raw: c,
|
|
515
|
-
tokens: n.inlineTokens(c)
|
|
516
|
-
});
|
|
517
|
-
let u = s.join("\n").trim();
|
|
518
|
-
if (u) {
|
|
519
|
-
let e = n.blockTokens(u);
|
|
520
|
-
l.push(...e);
|
|
521
|
-
}
|
|
522
|
-
let d = i + 1, f = [];
|
|
523
|
-
for (; d < e.length && e[d].indent > t;) f.push(e[d]), d += 1;
|
|
524
|
-
if (f.length > 0) {
|
|
525
|
-
let e = K(f, Math.min(...f.map((e) => e.indent)), n);
|
|
526
|
-
l.push({
|
|
527
|
-
type: "list",
|
|
528
|
-
ordered: !0,
|
|
529
|
-
start: f[0].number,
|
|
530
|
-
typeMarker: f[0].type,
|
|
531
|
-
items: e,
|
|
532
|
-
raw: f.map((e) => e.raw).join("\n")
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
r.push({
|
|
536
|
-
type: "list_item",
|
|
537
|
-
raw: a.raw,
|
|
538
|
-
tokens: l
|
|
539
|
-
}), i = d;
|
|
540
|
-
} else i += 1;
|
|
541
|
-
}
|
|
542
|
-
return r;
|
|
543
|
-
}
|
|
544
|
-
function Ce(e, t) {
|
|
545
|
-
return e.map((e) => {
|
|
546
|
-
if (e.type !== "list_item") return t.parseChildren([e])[0];
|
|
547
|
-
let n = [];
|
|
548
|
-
return e.tokens && e.tokens.length > 0 && e.tokens.forEach((e) => {
|
|
549
|
-
if (e.type === "paragraph" || e.type === "list" || e.type === "blockquote" || e.type === "code") n.push(...t.parseChildren([e]));
|
|
550
|
-
else if (e.type === "text" && e.tokens) {
|
|
551
|
-
let r = t.parseChildren([e]);
|
|
552
|
-
n.push({
|
|
553
|
-
type: "paragraph",
|
|
554
|
-
content: r
|
|
555
|
-
});
|
|
556
|
-
} else {
|
|
557
|
-
let r = t.parseChildren([e]);
|
|
558
|
-
r.length > 0 && n.push(...r);
|
|
559
|
-
}
|
|
560
|
-
}), {
|
|
561
|
-
type: "listItem",
|
|
562
|
-
content: n
|
|
563
|
-
};
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
var we = 64;
|
|
567
|
-
function q(e, t) {
|
|
568
|
-
let n = [], r = 0;
|
|
569
|
-
for (; n.length < t;) {
|
|
570
|
-
let t = e.indexOf("\n", r);
|
|
571
|
-
if (t === -1) return n.push(e.slice(r)), n;
|
|
572
|
-
n.push(e.slice(r, t)), r = t + 1;
|
|
573
|
-
}
|
|
574
|
-
return n;
|
|
575
|
-
}
|
|
576
|
-
function Te(e) {
|
|
577
|
-
let t = e.indexOf("\n"), n = t === -1 ? e : e.slice(0, t);
|
|
578
|
-
if (!H.test(n)) return [
|
|
579
|
-
[],
|
|
580
|
-
0,
|
|
581
|
-
[]
|
|
582
|
-
];
|
|
583
|
-
let r = we, i = q(e, r), a = W(i);
|
|
584
|
-
for (; a[1] === i.length && i.length === r;) r *= 2, i = q(e, r), a = W(i);
|
|
585
|
-
return [
|
|
586
|
-
a[0],
|
|
587
|
-
a[1],
|
|
588
|
-
i
|
|
589
|
-
];
|
|
590
|
-
}
|
|
591
|
-
var Ee = "listItem", J = "textStyle", Y = /^(\d+)\.\s$/;
|
|
592
|
-
function X(e) {
|
|
593
|
-
let t = e.match(/list-style-type\s*:\s*([^;]+)/i);
|
|
594
|
-
if (!t) return null;
|
|
595
|
-
switch (t[1].trim().toLowerCase()) {
|
|
596
|
-
case "upper-roman": return "I";
|
|
597
|
-
case "lower-roman": return "i";
|
|
598
|
-
case "upper-alpha":
|
|
599
|
-
case "upper-latin": return "A";
|
|
600
|
-
case "lower-alpha":
|
|
601
|
-
case "lower-latin": return "a";
|
|
602
|
-
default: return null;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
var Z = t.create({
|
|
606
|
-
name: "orderedList",
|
|
607
|
-
addOptions() {
|
|
608
|
-
return {
|
|
609
|
-
itemTypeName: "listItem",
|
|
610
|
-
HTMLAttributes: {},
|
|
611
|
-
keepMarks: !1,
|
|
612
|
-
keepAttributes: !1
|
|
613
|
-
};
|
|
614
|
-
},
|
|
615
|
-
group: "block list",
|
|
616
|
-
content() {
|
|
617
|
-
return `${this.options.itemTypeName}+`;
|
|
618
|
-
},
|
|
619
|
-
addAttributes() {
|
|
620
|
-
return {
|
|
621
|
-
start: {
|
|
622
|
-
default: 1,
|
|
623
|
-
parseHTML: (e) => e.hasAttribute("start") ? parseInt(e.getAttribute("start") || "", 10) : 1
|
|
624
|
-
},
|
|
625
|
-
type: {
|
|
626
|
-
default: null,
|
|
627
|
-
parseHTML: (e) => {
|
|
628
|
-
let t = e.getAttribute("type");
|
|
629
|
-
if (t) return t;
|
|
630
|
-
let n = e.getAttribute("style");
|
|
631
|
-
if (n) {
|
|
632
|
-
let e = X(n);
|
|
633
|
-
if (e) return e;
|
|
634
|
-
}
|
|
635
|
-
let r = e.querySelector("li");
|
|
636
|
-
if (r) {
|
|
637
|
-
let e = r.getAttribute("style");
|
|
638
|
-
if (e) {
|
|
639
|
-
let t = X(e);
|
|
640
|
-
if (t) return t;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
return null;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
},
|
|
648
|
-
parseHTML() {
|
|
649
|
-
return [{ tag: "ol" }];
|
|
650
|
-
},
|
|
651
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
652
|
-
let { start: t, type: n, ...r } = e, i = l(this.options.HTMLAttributes, r);
|
|
653
|
-
return t !== 1 && (i.start = t), n && n !== "1" && (i.type = n), [
|
|
654
|
-
"ol",
|
|
655
|
-
i,
|
|
656
|
-
0
|
|
657
|
-
];
|
|
658
|
-
},
|
|
659
|
-
markdownTokenName: "list",
|
|
660
|
-
parseMarkdown: (e, t) => {
|
|
661
|
-
if (e.type !== "list" || !e.ordered) return [];
|
|
662
|
-
let n = e.start || 1, r = e.typeMarker, i = e.items ? Ce(e.items, t) : [], a = {};
|
|
663
|
-
return n !== 1 && (a.start = n), r && (a.type = r), Object.keys(a).length > 0 ? {
|
|
664
|
-
type: "orderedList",
|
|
665
|
-
attrs: a,
|
|
666
|
-
content: i
|
|
667
|
-
} : {
|
|
668
|
-
type: "orderedList",
|
|
669
|
-
content: i
|
|
670
|
-
};
|
|
671
|
-
},
|
|
672
|
-
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
|
|
673
|
-
markdownTokenizer: {
|
|
674
|
-
name: "orderedList",
|
|
675
|
-
level: "block",
|
|
676
|
-
start: () => -1,
|
|
677
|
-
tokenize: (e, t, n) => {
|
|
678
|
-
let [r, i, a] = Te(e);
|
|
679
|
-
if (r.length === 0) return;
|
|
680
|
-
let o = K(r, r[0].indent, n);
|
|
681
|
-
if (o.length !== 0) return {
|
|
682
|
-
type: "list",
|
|
683
|
-
ordered: !0,
|
|
684
|
-
start: r[0]?.number || 1,
|
|
685
|
-
typeMarker: r[0]?.type,
|
|
686
|
-
items: o,
|
|
687
|
-
raw: a.slice(0, i).join("\n")
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
},
|
|
691
|
-
markdownOptions: { indentsContent: !0 },
|
|
692
|
-
addCommands() {
|
|
693
|
-
return { toggleOrderedList: () => ({ commands: e, chain: t }) => this.options.keepAttributes ? t().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(Ee, this.editor.getAttributes(J)).run() : e.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks) };
|
|
694
|
-
},
|
|
695
|
-
addKeyboardShortcuts() {
|
|
696
|
-
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
697
|
-
},
|
|
698
|
-
addProseMirrorPlugins() {
|
|
699
|
-
return [new g({ props: { handlePaste: (e, t) => {
|
|
700
|
-
if ((t.clipboardData?.getData("text/html"))?.trim()) return !1;
|
|
701
|
-
let n = t.clipboardData?.getData("text/plain");
|
|
702
|
-
if (!n) return !1;
|
|
703
|
-
let r = G(n);
|
|
704
|
-
if (!r) return !1;
|
|
705
|
-
try {
|
|
706
|
-
let t = e.state.schema.nodeFromJSON(r), n = e.state.tr.replaceSelectionWith(t);
|
|
707
|
-
return e.dispatch(n), !0;
|
|
708
|
-
} catch {
|
|
709
|
-
return !1;
|
|
710
|
-
}
|
|
711
|
-
} } })];
|
|
712
|
-
},
|
|
713
|
-
addInputRules() {
|
|
714
|
-
let e = (e, t) => (!t.attrs.type || t.attrs.type === "1") && t.childCount + t.attrs.start === +e[1], t = f({
|
|
715
|
-
find: Y,
|
|
716
|
-
type: this.type,
|
|
717
|
-
getAttributes: (e) => ({ start: +e[1] }),
|
|
718
|
-
joinPredicate: e
|
|
719
|
-
});
|
|
720
|
-
return (this.options.keepMarks || this.options.keepAttributes) && (t = f({
|
|
721
|
-
find: Y,
|
|
722
|
-
type: this.type,
|
|
723
|
-
keepMarks: this.options.keepMarks,
|
|
724
|
-
keepAttributes: this.options.keepAttributes,
|
|
725
|
-
getAttributes: (e) => ({
|
|
726
|
-
start: +e[1],
|
|
727
|
-
...this.editor.getAttributes(J)
|
|
728
|
-
}),
|
|
729
|
-
joinPredicate: e,
|
|
730
|
-
editor: this.editor
|
|
731
|
-
})), [t];
|
|
732
|
-
}
|
|
733
|
-
}), Q = /^\s*(\[([( |x])?\])\s$/, De = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0", Oe = (e, t, n) => {
|
|
734
|
-
var r;
|
|
735
|
-
return (n == null || (r = n.checkboxLabel) == null ? void 0 : r.call(n, e, t)) || `Task item checkbox for ${e.textContent || "empty task item"}`;
|
|
736
|
-
}, $ = t.create({
|
|
737
|
-
name: "taskItem",
|
|
738
|
-
addOptions() {
|
|
739
|
-
return {
|
|
740
|
-
nested: !1,
|
|
741
|
-
HTMLAttributes: {},
|
|
742
|
-
taskListTypeName: "taskList",
|
|
743
|
-
a11y: void 0
|
|
744
|
-
};
|
|
745
|
-
},
|
|
746
|
-
content() {
|
|
747
|
-
return this.options.nested ? "paragraph block*" : "paragraph+";
|
|
748
|
-
},
|
|
749
|
-
defining: !0,
|
|
750
|
-
addAttributes() {
|
|
751
|
-
return { checked: {
|
|
752
|
-
default: !1,
|
|
753
|
-
keepOnSplit: !1,
|
|
754
|
-
parseHTML: (e) => {
|
|
755
|
-
let t = e.getAttribute("data-checked");
|
|
756
|
-
return t === "" || t === "true";
|
|
757
|
-
},
|
|
758
|
-
renderHTML: (e) => ({ "data-checked": e.checked })
|
|
759
|
-
} };
|
|
760
|
-
},
|
|
761
|
-
parseHTML() {
|
|
762
|
-
return [{
|
|
763
|
-
tag: `li[data-type="${this.name}"]`,
|
|
764
|
-
priority: 51,
|
|
765
|
-
contentElement: (e) => e.querySelector("div") ?? e
|
|
766
|
-
}];
|
|
767
|
-
},
|
|
768
|
-
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
769
|
-
return [
|
|
770
|
-
"li",
|
|
771
|
-
l(this.options.HTMLAttributes, t, { "data-type": this.name }),
|
|
772
|
-
[
|
|
773
|
-
"label",
|
|
774
|
-
["input", {
|
|
775
|
-
type: "checkbox",
|
|
776
|
-
checked: e.attrs.checked ? "checked" : null
|
|
777
|
-
}],
|
|
778
|
-
["span"]
|
|
779
|
-
],
|
|
780
|
-
["div", 0]
|
|
781
|
-
];
|
|
782
|
-
},
|
|
783
|
-
parseMarkdown: (e, t) => {
|
|
784
|
-
let n = [];
|
|
785
|
-
if (e.tokens && e.tokens.length > 0 ? n.push(t.createNode("paragraph", {}, t.parseInline(e.tokens))) : e.text ? n.push(t.createNode("paragraph", {}, [t.createNode("text", { text: e.text })])) : n.push(t.createNode("paragraph", {}, [])), e.nestedTokens && e.nestedTokens.length > 0) {
|
|
786
|
-
let r = t.parseChildren(e.nestedTokens);
|
|
787
|
-
n.push(...r);
|
|
788
|
-
}
|
|
789
|
-
return t.createNode("taskItem", { checked: e.checked || !1 }, n);
|
|
790
|
-
},
|
|
791
|
-
renderMarkdown: (e, t) => {
|
|
792
|
-
let n = `- [${e.attrs?.checked ? "x" : " "}] `;
|
|
793
|
-
return d(e, t, n, void 0, { indentMainContent: !0 });
|
|
794
|
-
},
|
|
795
|
-
addExtensions() {
|
|
796
|
-
return this.options.nested ? [x(this.name, [this.options.taskListTypeName])] : [];
|
|
797
|
-
},
|
|
798
|
-
addKeyboardShortcuts() {
|
|
799
|
-
let e = {
|
|
800
|
-
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
801
|
-
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
802
|
-
};
|
|
803
|
-
return this.options.nested ? {
|
|
804
|
-
...e,
|
|
805
|
-
Tab: () => this.editor.commands.sinkListItem(this.name)
|
|
806
|
-
} : e;
|
|
807
|
-
},
|
|
808
|
-
addNodeView() {
|
|
809
|
-
return ({ node: e, HTMLAttributes: t, getPos: n, editor: r }) => {
|
|
810
|
-
let i = document.createElement("li"), o = document.createElement("label"), s = document.createElement("span"), c = document.createElement("input"), l = document.createElement("div");
|
|
811
|
-
s.style.cssText = De;
|
|
812
|
-
let u = (e) => {
|
|
813
|
-
let t = Oe(e, e.attrs.checked, this.options.a11y);
|
|
814
|
-
c.setAttribute("aria-label", t), s.textContent = t;
|
|
815
|
-
};
|
|
816
|
-
u(e), o.contentEditable = "false", c.type = "checkbox", c.addEventListener("mousedown", (e) => e.preventDefault()), c.addEventListener("change", (t) => {
|
|
817
|
-
if (!r.isEditable && !this.options.onReadOnlyChecked) {
|
|
818
|
-
c.checked = !c.checked;
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
let { checked: i } = t.target;
|
|
822
|
-
r.isEditable && typeof n == "function" && r.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: e }) => {
|
|
823
|
-
let t = n();
|
|
824
|
-
if (typeof t != "number") return !1;
|
|
825
|
-
let r = e.doc.nodeAt(t);
|
|
826
|
-
return e.setNodeMarkup(t, void 0, {
|
|
827
|
-
...r?.attrs,
|
|
828
|
-
checked: i
|
|
829
|
-
}), !0;
|
|
830
|
-
}).run(), !r.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(e, i) || (c.checked = !c.checked));
|
|
831
|
-
}), Object.entries(this.options.HTMLAttributes).forEach(([e, t]) => {
|
|
832
|
-
i.setAttribute(e, t);
|
|
833
|
-
}), i.dataset.checked = e.attrs.checked, c.checked = e.attrs.checked, o.append(c, s), i.append(o, l), Object.entries(t).forEach(([e, t]) => {
|
|
834
|
-
i.setAttribute(e, t);
|
|
835
|
-
});
|
|
836
|
-
let d = new Set(Object.keys(t));
|
|
837
|
-
return {
|
|
838
|
-
dom: i,
|
|
839
|
-
contentDOM: l,
|
|
840
|
-
update: (e) => {
|
|
841
|
-
if (e.type !== this.type) return !1;
|
|
842
|
-
i.dataset.checked = e.attrs.checked, c.checked = e.attrs.checked, u(e);
|
|
843
|
-
let t = r.extensionManager.attributes, n = a(e, t), o = new Set(Object.keys(n)), s = this.options.HTMLAttributes;
|
|
844
|
-
return d.forEach((e) => {
|
|
845
|
-
o.has(e) || (e in s ? i.setAttribute(e, s[e]) : i.removeAttribute(e));
|
|
846
|
-
}), Object.entries(n).forEach(([e, t]) => {
|
|
847
|
-
t == null ? e in s ? i.setAttribute(e, s[e]) : i.removeAttribute(e) : i.setAttribute(e, t);
|
|
848
|
-
}), d = o, !0;
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
};
|
|
852
|
-
},
|
|
853
|
-
addInputRules() {
|
|
854
|
-
return [f({
|
|
855
|
-
find: Q,
|
|
856
|
-
type: this.type,
|
|
857
|
-
getAttributes: (e) => ({ checked: e[e.length - 1] === "x" })
|
|
858
|
-
})];
|
|
859
|
-
}
|
|
860
|
-
}), ke = t.create({
|
|
861
|
-
name: "taskList",
|
|
862
|
-
addOptions() {
|
|
863
|
-
return {
|
|
864
|
-
itemTypeName: "taskItem",
|
|
865
|
-
HTMLAttributes: {}
|
|
866
|
-
};
|
|
867
|
-
},
|
|
868
|
-
group: "block list",
|
|
869
|
-
content() {
|
|
870
|
-
return `${this.options.itemTypeName}+`;
|
|
871
|
-
},
|
|
872
|
-
parseHTML() {
|
|
873
|
-
return [{
|
|
874
|
-
tag: `ul[data-type="${this.name}"]`,
|
|
875
|
-
priority: 51
|
|
876
|
-
}];
|
|
877
|
-
},
|
|
878
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
879
|
-
return [
|
|
880
|
-
"ul",
|
|
881
|
-
l(this.options.HTMLAttributes, e, { "data-type": this.name }),
|
|
882
|
-
0
|
|
883
|
-
];
|
|
884
|
-
},
|
|
885
|
-
parseMarkdown: (e, t) => t.createNode("taskList", {}, t.parseChildren(e.items || [])),
|
|
886
|
-
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n") : "",
|
|
887
|
-
markdownTokenizer: {
|
|
888
|
-
name: "taskList",
|
|
889
|
-
level: "block",
|
|
890
|
-
start(e) {
|
|
891
|
-
let t = e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;
|
|
892
|
-
return t === void 0 ? -1 : t;
|
|
893
|
-
},
|
|
894
|
-
tokenize(e, t, n) {
|
|
895
|
-
let r = (e) => {
|
|
896
|
-
let t = u(e, {
|
|
897
|
-
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
898
|
-
extractItemData: (e) => ({
|
|
899
|
-
indentLevel: e[1].length,
|
|
900
|
-
mainContent: e[4],
|
|
901
|
-
checked: e[3].toLowerCase() === "x"
|
|
902
|
-
}),
|
|
903
|
-
createToken: (e, t) => ({
|
|
904
|
-
type: "taskItem",
|
|
905
|
-
raw: "",
|
|
906
|
-
mainContent: e.mainContent,
|
|
907
|
-
indentLevel: e.indentLevel,
|
|
908
|
-
checked: e.checked,
|
|
909
|
-
text: e.mainContent,
|
|
910
|
-
tokens: n.inlineTokens(e.mainContent),
|
|
911
|
-
nestedTokens: t
|
|
912
|
-
}),
|
|
913
|
-
customNestedParser: r
|
|
914
|
-
}, n);
|
|
915
|
-
if (t) {
|
|
916
|
-
let r = {
|
|
917
|
-
type: "taskList",
|
|
918
|
-
raw: t.raw,
|
|
919
|
-
items: t.items
|
|
920
|
-
}, i = e.slice(t.raw.length);
|
|
921
|
-
return i.trim() ? [r, ...n.blockTokens(i)] : [r];
|
|
922
|
-
}
|
|
923
|
-
return n.blockTokens(e);
|
|
924
|
-
}, i = u(e, {
|
|
925
|
-
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
926
|
-
extractItemData: (e) => ({
|
|
927
|
-
indentLevel: e[1].length,
|
|
928
|
-
mainContent: e[4],
|
|
929
|
-
checked: e[3].toLowerCase() === "x"
|
|
930
|
-
}),
|
|
931
|
-
createToken: (e, t) => ({
|
|
932
|
-
type: "taskItem",
|
|
933
|
-
raw: "",
|
|
934
|
-
mainContent: e.mainContent,
|
|
935
|
-
indentLevel: e.indentLevel,
|
|
936
|
-
checked: e.checked,
|
|
937
|
-
text: e.mainContent,
|
|
938
|
-
tokens: n.inlineTokens(e.mainContent),
|
|
939
|
-
nestedTokens: t
|
|
940
|
-
}),
|
|
941
|
-
customNestedParser: r
|
|
942
|
-
}, n);
|
|
943
|
-
if (i) return {
|
|
944
|
-
type: "taskList",
|
|
945
|
-
raw: i.raw,
|
|
946
|
-
items: i.items
|
|
947
|
-
};
|
|
948
|
-
}
|
|
949
|
-
},
|
|
950
|
-
markdownOptions: { indentsContent: !0 },
|
|
951
|
-
addCommands() {
|
|
952
|
-
return { toggleTaskList: () => ({ commands: e }) => e.toggleList(this.name, this.options.itemTypeName) };
|
|
953
|
-
},
|
|
954
|
-
addKeyboardShortcuts() {
|
|
955
|
-
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
e.create({
|
|
959
|
-
name: "listKit",
|
|
960
|
-
addExtensions() {
|
|
961
|
-
let e = [];
|
|
962
|
-
return this.options.bulletList !== !1 && e.push(b.configure(this.options.bulletList)), this.options.listItem !== !1 && e.push(I.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(V.configure(this.options.listKeymap)), this.options.orderedList !== !1 && e.push(Z.configure(this.options.orderedList)), this.options.taskItem !== !1 && e.push($.configure(this.options.taskItem)), this.options.taskList !== !1 && e.push(ke.configure(this.options.taskList)), e;
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
export { b as BulletList, I as ListItem, V as ListKeymap, w as ORDERED_LIST_MARKER_PATTERN, Z as OrderedList, $ as TaskItem, ke as TaskList, j as areOrderedListMarkersSequential, N as buildOrderedListAttrsFromMarker, y as bulletListInputRegex, k as detectMarkerType, P as getListMarker, Q as inputRegex, A as markerToStart, Y as orderedListInputRegex, M as parseListMarker, G as parsePlainTextOrderedListPaste, T as toRoman, E as toRomanUpper };
|
|
966
|
-
|
|
967
|
-
//# sourceMappingURL=index.js.map
|