@milkdown/preset-commonmark 7.2.4 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/composed/plugins.d.ts.map +1 -1
- package/lib/index.es.js +544 -524
- package/lib/index.es.js.map +1 -1
- package/lib/plugin/inline-sync-plugin/context.d.ts.map +1 -1
- package/lib/plugin/inline-sync-plugin/regexp.d.ts +5 -0
- package/lib/plugin/inline-sync-plugin/regexp.d.ts.map +1 -1
- package/lib/plugin/inline-sync-plugin/utils.d.ts +1 -0
- package/lib/plugin/inline-sync-plugin/utils.d.ts.map +1 -1
- package/lib/plugin/remark-add-order-in-list-plugin.d.ts +1 -1
- package/lib/plugin/remark-add-order-in-list-plugin.d.ts.map +1 -1
- package/lib/plugin/remark-html-transformer.d.ts +1 -1
- package/lib/plugin/remark-html-transformer.d.ts.map +1 -1
- package/lib/plugin/remark-inline-link-plugin.d.ts +1 -1
- package/lib/plugin/remark-inline-link-plugin.d.ts.map +1 -1
- package/lib/plugin/remark-line-break.d.ts +1 -1
- package/lib/plugin/remark-line-break.d.ts.map +1 -1
- package/lib/plugin/remark-marker-plugin.d.ts +1 -1
- package/lib/plugin/remark-marker-plugin.d.ts.map +1 -1
- package/package.json +8 -9
- package/src/composed/plugins.ts +1 -1
- package/src/plugin/inline-sync-plugin/context.ts +8 -5
- package/src/plugin/inline-sync-plugin/regexp.ts +7 -0
- package/src/plugin/inline-sync-plugin/utils.ts +16 -1
- package/src/plugin/remark-add-order-in-list-plugin.ts +9 -5
- package/src/plugin/remark-html-transformer.ts +13 -8
- package/src/plugin/remark-inline-link-plugin.ts +7 -2
- package/src/plugin/remark-line-break.ts +9 -4
- package/src/plugin/remark-marker-plugin.ts +9 -4
package/lib/index.es.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { $markAttr as V, $markSchema as j, $command as
|
|
2
|
-
import { remarkStringifyOptionsCtx as
|
|
3
|
-
import { toggleMark as
|
|
4
|
-
import { Fragment as
|
|
1
|
+
import { $markAttr as V, $markSchema as j, $command as y, $useKeymap as N, $node as ot, $nodeAttr as I, $nodeSchema as C, $ctx as ne, $inputRule as w, pipe as Tt, $prose as O, $remark as $ } from "@milkdown/utils";
|
|
2
|
+
import { remarkStringifyOptionsCtx as st, commandsCtx as h, editorViewCtx as X, serializerCtx as Rt, parserCtx as Kt } from "@milkdown/core";
|
|
3
|
+
import { toggleMark as oe, setBlockType as E, wrapIn as se } from "@milkdown/prose/commands";
|
|
4
|
+
import { Fragment as Dt } from "@milkdown/prose/model";
|
|
5
5
|
import { expectDomTypeError as A } from "@milkdown/exception";
|
|
6
|
-
import { textblockTypeInputRule as
|
|
7
|
-
import
|
|
8
|
-
import { TextSelection as G, Selection as
|
|
9
|
-
import { findSelectedNodeOfType as
|
|
10
|
-
import { sinkListItem as
|
|
11
|
-
import { ReplaceStep as
|
|
12
|
-
import { Decoration as
|
|
13
|
-
import { visit as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
6
|
+
import { textblockTypeInputRule as lt, wrappingInputRule as le, InputRule as it } from "@milkdown/prose/inputrules";
|
|
7
|
+
import Pt from "@sindresorhus/slugify";
|
|
8
|
+
import { TextSelection as G, Selection as ct, PluginKey as T, Plugin as R } from "@milkdown/prose/state";
|
|
9
|
+
import { findSelectedNodeOfType as _t } from "@milkdown/prose";
|
|
10
|
+
import { sinkListItem as Et, liftListItem as dt, splitListItem as $t } from "@milkdown/prose/schema-list";
|
|
11
|
+
import { ReplaceStep as qt, AddMarkStep as Wt } from "@milkdown/prose/transform";
|
|
12
|
+
import { Decoration as at, DecorationSet as nt } from "@milkdown/prose/view";
|
|
13
|
+
import { visit as ie } from "unist-util-visit";
|
|
14
|
+
import Ft from "remark-inline-links";
|
|
15
|
+
const mt = (t, e) => {
|
|
16
16
|
var o;
|
|
17
17
|
if (!(e.childCount >= 1 && ((o = e.lastChild) == null ? void 0 : o.type.name) === "hardbreak")) {
|
|
18
18
|
t.next(e.content);
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
const a = [];
|
|
22
|
-
e.content.forEach((s,
|
|
23
|
-
|
|
24
|
-
}), t.next(
|
|
22
|
+
e.content.forEach((s, i, l) => {
|
|
23
|
+
l !== e.childCount - 1 && a.push(s);
|
|
24
|
+
}), t.next(Dt.fromArray(a));
|
|
25
25
|
}, n = (t, e) => (Object.assign(t, {
|
|
26
26
|
meta: {
|
|
27
27
|
package: "@milkdown/preset-commonmark",
|
|
28
28
|
...e
|
|
29
29
|
}
|
|
30
|
-
}), t),
|
|
31
|
-
n(
|
|
30
|
+
}), t), ce = V("emphasis");
|
|
31
|
+
n(ce, {
|
|
32
32
|
displayName: "Attr<emphasis>",
|
|
33
33
|
group: "Emphasis"
|
|
34
34
|
});
|
|
35
35
|
const z = j("emphasis", (t) => ({
|
|
36
36
|
attrs: {
|
|
37
37
|
marker: {
|
|
38
|
-
default: t.get(
|
|
38
|
+
default: t.get(st).emphasis || "*"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
parseDOM: [
|
|
@@ -43,7 +43,7 @@ const z = j("emphasis", (t) => ({
|
|
|
43
43
|
{ tag: "em" },
|
|
44
44
|
{ style: "font-style", getAttrs: (e) => e === "italic" }
|
|
45
45
|
],
|
|
46
|
-
toDOM: (e) => ["em", t.get(
|
|
46
|
+
toDOM: (e) => ["em", t.get(ce.key)(e)],
|
|
47
47
|
parseMarkdown: {
|
|
48
48
|
match: (e) => e.type === "emphasis",
|
|
49
49
|
runner: (e, r, a) => {
|
|
@@ -67,37 +67,37 @@ n(z.ctx, {
|
|
|
67
67
|
displayName: "MarkSchemaCtx<emphasis>",
|
|
68
68
|
group: "Emphasis"
|
|
69
69
|
});
|
|
70
|
-
const
|
|
71
|
-
n(
|
|
70
|
+
const de = y("ToggleEmphasis", (t) => () => oe(z.type(t)));
|
|
71
|
+
n(de, {
|
|
72
72
|
displayName: "Command<toggleEmphasisCommand>",
|
|
73
73
|
group: "Emphasis"
|
|
74
74
|
});
|
|
75
|
-
const
|
|
75
|
+
const me = N("emphasisKeymap", {
|
|
76
76
|
ToggleEmphasis: {
|
|
77
77
|
shortcuts: "Mod-i",
|
|
78
78
|
command: (t) => {
|
|
79
|
-
const e = t.get(
|
|
80
|
-
return () => e.call(
|
|
79
|
+
const e = t.get(h);
|
|
80
|
+
return () => e.call(de.key);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
n(
|
|
84
|
+
n(me.ctx, {
|
|
85
85
|
displayName: "KeymapCtx<emphasis>",
|
|
86
86
|
group: "Emphasis"
|
|
87
87
|
});
|
|
88
|
-
n(
|
|
88
|
+
n(me.shortcuts, {
|
|
89
89
|
displayName: "Keymap<emphasis>",
|
|
90
90
|
group: "Emphasis"
|
|
91
91
|
});
|
|
92
|
-
const
|
|
93
|
-
n(
|
|
92
|
+
const ue = V("strong");
|
|
93
|
+
n(ue, {
|
|
94
94
|
displayName: "Attr<strong>",
|
|
95
95
|
group: "Strong"
|
|
96
96
|
});
|
|
97
97
|
const U = j("strong", (t) => ({
|
|
98
98
|
attrs: {
|
|
99
99
|
marker: {
|
|
100
|
-
default: t.get(
|
|
100
|
+
default: t.get(st).strong || "*"
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
parseDOM: [
|
|
@@ -105,7 +105,7 @@ const U = j("strong", (t) => ({
|
|
|
105
105
|
{ tag: "strong" },
|
|
106
106
|
{ style: "font-style", getAttrs: (e) => e === "bold" }
|
|
107
107
|
],
|
|
108
|
-
toDOM: (e) => ["strong", t.get(
|
|
108
|
+
toDOM: (e) => ["strong", t.get(ue.key)(e)],
|
|
109
109
|
parseMarkdown: {
|
|
110
110
|
match: (e) => e.type === "strong",
|
|
111
111
|
runner: (e, r, a) => {
|
|
@@ -129,30 +129,30 @@ n(U.ctx, {
|
|
|
129
129
|
displayName: "MarkSchemaCtx<strong>",
|
|
130
130
|
group: "Strong"
|
|
131
131
|
});
|
|
132
|
-
const
|
|
133
|
-
n(
|
|
132
|
+
const pe = y("ToggleStrong", (t) => () => oe(U.type(t)));
|
|
133
|
+
n(pe, {
|
|
134
134
|
displayName: "Command<toggleStrongCommand>",
|
|
135
135
|
group: "Strong"
|
|
136
136
|
});
|
|
137
|
-
const
|
|
137
|
+
const ge = N("strongKeymap", {
|
|
138
138
|
ToggleBold: {
|
|
139
139
|
shortcuts: ["Mod-b"],
|
|
140
140
|
command: (t) => {
|
|
141
|
-
const e = t.get(
|
|
142
|
-
return () => e.call(
|
|
141
|
+
const e = t.get(h);
|
|
142
|
+
return () => e.call(pe.key);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
|
-
n(
|
|
146
|
+
n(ge.ctx, {
|
|
147
147
|
displayName: "KeymapCtx<strong>",
|
|
148
148
|
group: "Strong"
|
|
149
149
|
});
|
|
150
|
-
n(
|
|
150
|
+
n(ge.shortcuts, {
|
|
151
151
|
displayName: "Keymap<strong>",
|
|
152
152
|
group: "Strong"
|
|
153
153
|
});
|
|
154
|
-
const
|
|
155
|
-
n(
|
|
154
|
+
const ye = V("inlineCode");
|
|
155
|
+
n(ye, {
|
|
156
156
|
displayName: "Attr<inlineCode>",
|
|
157
157
|
group: "InlineCode"
|
|
158
158
|
});
|
|
@@ -161,7 +161,7 @@ const x = j("inlineCode", (t) => ({
|
|
|
161
161
|
code: !0,
|
|
162
162
|
inclusive: !1,
|
|
163
163
|
parseDOM: [{ tag: "code" }],
|
|
164
|
-
toDOM: (e) => ["code", t.get(
|
|
164
|
+
toDOM: (e) => ["code", t.get(ye.key)(e)],
|
|
165
165
|
parseMarkdown: {
|
|
166
166
|
match: (e) => e.type === "inlineCode",
|
|
167
167
|
runner: (e, r, a) => {
|
|
@@ -183,38 +183,38 @@ n(x.ctx, {
|
|
|
183
183
|
displayName: "MarkSchemaCtx<inlineCode>",
|
|
184
184
|
group: "InlineCode"
|
|
185
185
|
});
|
|
186
|
-
const
|
|
186
|
+
const he = y("ToggleInlineCode", (t) => () => (e, r) => {
|
|
187
187
|
const { selection: a, tr: o } = e;
|
|
188
188
|
if (a.empty)
|
|
189
189
|
return !1;
|
|
190
|
-
const { from: s, to:
|
|
191
|
-
return e.doc.rangeHasMark(s,
|
|
192
|
-
o.removeMark(s,
|
|
193
|
-
}), r == null || r(o.addMark(s,
|
|
190
|
+
const { from: s, to: i } = a;
|
|
191
|
+
return e.doc.rangeHasMark(s, i, x.type(t)) ? (r == null || r(o.removeMark(s, i, x.type(t))), !0) : (Object.keys(e.schema.marks).filter((d) => d !== x.type.name).map((d) => e.schema.marks[d]).forEach((d) => {
|
|
192
|
+
o.removeMark(s, i, d);
|
|
193
|
+
}), r == null || r(o.addMark(s, i, x.type(t).create())), !0);
|
|
194
194
|
});
|
|
195
|
-
n(
|
|
195
|
+
n(he, {
|
|
196
196
|
displayName: "Command<toggleInlineCodeCommand>",
|
|
197
197
|
group: "InlineCode"
|
|
198
198
|
});
|
|
199
|
-
const
|
|
199
|
+
const ke = N("inlineCodeKeymap", {
|
|
200
200
|
ToggleInlineCode: {
|
|
201
201
|
shortcuts: "Mod-e",
|
|
202
202
|
command: (t) => {
|
|
203
|
-
const e = t.get(
|
|
204
|
-
return () => e.call(
|
|
203
|
+
const e = t.get(h);
|
|
204
|
+
return () => e.call(he.key);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
|
-
n(
|
|
208
|
+
n(ke.ctx, {
|
|
209
209
|
displayName: "KeymapCtx<inlineCode>",
|
|
210
210
|
group: "InlineCode"
|
|
211
211
|
});
|
|
212
|
-
n(
|
|
212
|
+
n(ke.shortcuts, {
|
|
213
213
|
displayName: "Keymap<inlineCode>",
|
|
214
214
|
group: "InlineCode"
|
|
215
215
|
});
|
|
216
|
-
const
|
|
217
|
-
n(
|
|
216
|
+
const fe = V("link");
|
|
217
|
+
n(fe, {
|
|
218
218
|
displayName: "Attr<link>",
|
|
219
219
|
group: "Link"
|
|
220
220
|
});
|
|
@@ -233,7 +233,7 @@ const B = j("link", (t) => ({
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
],
|
|
236
|
-
toDOM: (e) => ["a", { ...t.get(
|
|
236
|
+
toDOM: (e) => ["a", { ...t.get(fe.key)(e), ...e.attrs }],
|
|
237
237
|
parseMarkdown: {
|
|
238
238
|
match: (e) => e.type === "link",
|
|
239
239
|
runner: (e, r, a) => {
|
|
@@ -255,34 +255,34 @@ n(B.mark, {
|
|
|
255
255
|
displayName: "MarkSchema<link>",
|
|
256
256
|
group: "Link"
|
|
257
257
|
});
|
|
258
|
-
const
|
|
259
|
-
n(
|
|
258
|
+
const ut = y("ToggleLink", (t) => (e = {}) => oe(B.type(t), e));
|
|
259
|
+
n(ut, {
|
|
260
260
|
displayName: "Command<toggleLinkCommand>",
|
|
261
261
|
group: "Link"
|
|
262
262
|
});
|
|
263
|
-
const
|
|
263
|
+
const pt = y("UpdateLink", (t) => (e = {}) => (r, a) => {
|
|
264
264
|
if (!a)
|
|
265
265
|
return !1;
|
|
266
266
|
let o, s = -1;
|
|
267
|
-
const { selection:
|
|
268
|
-
if (r.doc.nodesBetween(
|
|
269
|
-
if (B.type(t).isInSet(
|
|
270
|
-
return o =
|
|
267
|
+
const { selection: i } = r, { from: l, to: c } = i;
|
|
268
|
+
if (r.doc.nodesBetween(l, l === c ? c + 1 : c, (p, f) => {
|
|
269
|
+
if (B.type(t).isInSet(p.marks))
|
|
270
|
+
return o = p, s = f, !1;
|
|
271
271
|
}), !o)
|
|
272
272
|
return !1;
|
|
273
|
-
const d = o.marks.find(({ type:
|
|
273
|
+
const d = o.marks.find(({ type: p }) => p === B.type(t));
|
|
274
274
|
if (!d)
|
|
275
275
|
return !1;
|
|
276
|
-
const m = s,
|
|
276
|
+
const m = s, g = s + o.nodeSize, { tr: u } = r, k = B.type(t).create({ ...d.attrs, ...e });
|
|
277
277
|
return k ? (a(
|
|
278
|
-
u.removeMark(m,
|
|
278
|
+
u.removeMark(m, g, d).addMark(m, g, k).setSelection(new G(u.selection.$anchor)).scrollIntoView()
|
|
279
279
|
), !0) : !1;
|
|
280
280
|
});
|
|
281
|
-
n(
|
|
281
|
+
n(pt, {
|
|
282
282
|
displayName: "Command<updateLinkCommand>",
|
|
283
283
|
group: "Link"
|
|
284
284
|
});
|
|
285
|
-
const
|
|
285
|
+
const gt = ot("doc", () => ({
|
|
286
286
|
content: "block+",
|
|
287
287
|
parseMarkdown: {
|
|
288
288
|
match: ({ type: t }) => t === "root",
|
|
@@ -297,12 +297,12 @@ const nt = Ye("doc", () => ({
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
}));
|
|
300
|
-
n(
|
|
300
|
+
n(gt, {
|
|
301
301
|
displayName: "NodeSchema<doc>",
|
|
302
302
|
group: "Doc"
|
|
303
303
|
});
|
|
304
|
-
const
|
|
305
|
-
n(
|
|
304
|
+
const Ne = I("paragraph");
|
|
305
|
+
n(Ne, {
|
|
306
306
|
displayName: "Attr<paragraph>",
|
|
307
307
|
group: "Paragraph"
|
|
308
308
|
});
|
|
@@ -310,7 +310,7 @@ const v = C("paragraph", (t) => ({
|
|
|
310
310
|
content: "inline*",
|
|
311
311
|
group: "block",
|
|
312
312
|
parseDOM: [{ tag: "p" }],
|
|
313
|
-
toDOM: (e) => ["p", t.get(
|
|
313
|
+
toDOM: (e) => ["p", t.get(Ne.key)(e), 0],
|
|
314
314
|
parseMarkdown: {
|
|
315
315
|
match: (e) => e.type === "paragraph",
|
|
316
316
|
runner: (e, r, a) => {
|
|
@@ -320,7 +320,7 @@ const v = C("paragraph", (t) => ({
|
|
|
320
320
|
toMarkdown: {
|
|
321
321
|
match: (e) => e.type.name === "paragraph",
|
|
322
322
|
runner: (e, r) => {
|
|
323
|
-
e.openNode("paragraph"),
|
|
323
|
+
e.openNode("paragraph"), mt(e, r), e.closeNode();
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}));
|
|
@@ -332,35 +332,35 @@ n(v.ctx, {
|
|
|
332
332
|
displayName: "NodeSchemaCtx<paragraph>",
|
|
333
333
|
group: "Paragraph"
|
|
334
334
|
});
|
|
335
|
-
const
|
|
336
|
-
n(
|
|
335
|
+
const Ie = y("TurnIntoText", (t) => () => E(v.type(t)));
|
|
336
|
+
n(Ie, {
|
|
337
337
|
displayName: "Command<turnIntoTextCommand>",
|
|
338
338
|
group: "Paragraph"
|
|
339
339
|
});
|
|
340
|
-
const
|
|
340
|
+
const Ce = N("paragraphKeymap", {
|
|
341
341
|
TurnIntoText: {
|
|
342
342
|
shortcuts: "Mod-Alt-0",
|
|
343
343
|
command: (t) => {
|
|
344
|
-
const e = t.get(
|
|
345
|
-
return () => e.call(
|
|
344
|
+
const e = t.get(h);
|
|
345
|
+
return () => e.call(Ie.key);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
});
|
|
349
|
-
n(
|
|
349
|
+
n(Ce.ctx, {
|
|
350
350
|
displayName: "KeymapCtx<paragraph>",
|
|
351
351
|
group: "Paragraph"
|
|
352
352
|
});
|
|
353
|
-
n(
|
|
353
|
+
n(Ce.shortcuts, {
|
|
354
354
|
displayName: "Keymap<paragraph>",
|
|
355
355
|
group: "Paragraph"
|
|
356
356
|
});
|
|
357
|
-
const
|
|
357
|
+
const Gt = Array(6).fill(0).map((t, e) => e + 1), Vt = (t) => Pt(t.textContent), Y = ne(Vt, "headingIdGenerator");
|
|
358
358
|
n(Y, {
|
|
359
359
|
displayName: "Ctx<HeadingIdGenerator>",
|
|
360
360
|
group: "Heading"
|
|
361
361
|
});
|
|
362
|
-
const
|
|
363
|
-
n(
|
|
362
|
+
const Me = I("heading");
|
|
363
|
+
n(Me, {
|
|
364
364
|
displayName: "Attr<heading>",
|
|
365
365
|
group: "Heading"
|
|
366
366
|
});
|
|
@@ -378,7 +378,7 @@ const H = C("heading", (t) => {
|
|
|
378
378
|
default: 1
|
|
379
379
|
}
|
|
380
380
|
},
|
|
381
|
-
parseDOM:
|
|
381
|
+
parseDOM: Gt.map((r) => ({
|
|
382
382
|
tag: `h${r}`,
|
|
383
383
|
getAttrs: (a) => {
|
|
384
384
|
if (!(a instanceof HTMLElement))
|
|
@@ -389,7 +389,7 @@ const H = C("heading", (t) => {
|
|
|
389
389
|
toDOM: (r) => [
|
|
390
390
|
`h${r.attrs.level}`,
|
|
391
391
|
{
|
|
392
|
-
...t.get(
|
|
392
|
+
...t.get(Me.key)(r),
|
|
393
393
|
id: r.attrs.id || e(r)
|
|
394
394
|
},
|
|
395
395
|
0
|
|
@@ -404,7 +404,7 @@ const H = C("heading", (t) => {
|
|
|
404
404
|
toMarkdown: {
|
|
405
405
|
match: (r) => r.type.name === "heading",
|
|
406
406
|
runner: (r, a) => {
|
|
407
|
-
r.openNode("heading", void 0, { depth: a.attrs.level }),
|
|
407
|
+
r.openNode("heading", void 0, { depth: a.attrs.level }), mt(r, a), r.closeNode();
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
};
|
|
@@ -417,101 +417,101 @@ n(H.ctx, {
|
|
|
417
417
|
displayName: "NodeSchemaCtx<heading>",
|
|
418
418
|
group: "Heading"
|
|
419
419
|
});
|
|
420
|
-
const
|
|
421
|
-
var
|
|
422
|
-
const r = ((
|
|
420
|
+
const yt = w((t) => lt(/^(?<hashes>#+)\s$/, H.type(t), (e) => {
|
|
421
|
+
var i, l;
|
|
422
|
+
const r = ((l = (i = e.groups) == null ? void 0 : i.hashes) == null ? void 0 : l.length) || 0, a = t.get(X), { $from: o } = a.state.selection, s = o.node();
|
|
423
423
|
if (s.type.name === "heading") {
|
|
424
424
|
let c = Number(s.attrs.level) + Number(r);
|
|
425
425
|
return c > 6 && (c = 6), { level: c };
|
|
426
426
|
}
|
|
427
427
|
return { level: r };
|
|
428
428
|
}));
|
|
429
|
-
n(
|
|
429
|
+
n(yt, {
|
|
430
430
|
displayName: "InputRule<wrapInHeadingInputRule>",
|
|
431
431
|
group: "Heading"
|
|
432
432
|
});
|
|
433
|
-
const b =
|
|
433
|
+
const b = y("WrapInHeading", (t) => (e) => (e ?? (e = 1), e < 1 ? E(v.type(t)) : E(H.type(t), { level: e })));
|
|
434
434
|
n(b, {
|
|
435
435
|
displayName: "Command<wrapInHeadingCommand>",
|
|
436
436
|
group: "Heading"
|
|
437
437
|
});
|
|
438
|
-
const
|
|
438
|
+
const be = y("DowngradeHeading", (t) => () => (e, r, a) => {
|
|
439
439
|
const { $from: o } = e.selection, s = o.node();
|
|
440
440
|
if (s.type !== H.type(t) || !e.selection.empty || o.parentOffset !== 0)
|
|
441
441
|
return !1;
|
|
442
|
-
const
|
|
443
|
-
return
|
|
442
|
+
const i = s.attrs.level - 1;
|
|
443
|
+
return i ? (r == null || r(
|
|
444
444
|
e.tr.setNodeMarkup(e.selection.$from.before(), void 0, {
|
|
445
445
|
...s.attrs,
|
|
446
|
-
level:
|
|
446
|
+
level: i
|
|
447
447
|
})
|
|
448
|
-
), !0) :
|
|
448
|
+
), !0) : E(v.type(t))(e, r, a);
|
|
449
449
|
});
|
|
450
|
-
n(
|
|
450
|
+
n(be, {
|
|
451
451
|
displayName: "Command<downgradeHeadingCommand>",
|
|
452
452
|
group: "Heading"
|
|
453
453
|
});
|
|
454
|
-
const
|
|
454
|
+
const Le = N("headingKeymap", {
|
|
455
455
|
TurnIntoH1: {
|
|
456
456
|
shortcuts: "Mod-Alt-1",
|
|
457
457
|
command: (t) => {
|
|
458
|
-
const e = t.get(
|
|
458
|
+
const e = t.get(h);
|
|
459
459
|
return () => e.call(b.key, 1);
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
TurnIntoH2: {
|
|
463
463
|
shortcuts: "Mod-Alt-2",
|
|
464
464
|
command: (t) => {
|
|
465
|
-
const e = t.get(
|
|
465
|
+
const e = t.get(h);
|
|
466
466
|
return () => e.call(b.key, 2);
|
|
467
467
|
}
|
|
468
468
|
},
|
|
469
469
|
TurnIntoH3: {
|
|
470
470
|
shortcuts: "Mod-Alt-3",
|
|
471
471
|
command: (t) => {
|
|
472
|
-
const e = t.get(
|
|
472
|
+
const e = t.get(h);
|
|
473
473
|
return () => e.call(b.key, 3);
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
TurnIntoH4: {
|
|
477
477
|
shortcuts: "Mod-Alt-4",
|
|
478
478
|
command: (t) => {
|
|
479
|
-
const e = t.get(
|
|
479
|
+
const e = t.get(h);
|
|
480
480
|
return () => e.call(b.key, 4);
|
|
481
481
|
}
|
|
482
482
|
},
|
|
483
483
|
TurnIntoH5: {
|
|
484
484
|
shortcuts: "Mod-Alt-5",
|
|
485
485
|
command: (t) => {
|
|
486
|
-
const e = t.get(
|
|
486
|
+
const e = t.get(h);
|
|
487
487
|
return () => e.call(b.key, 5);
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
TurnIntoH6: {
|
|
491
491
|
shortcuts: "Mod-Alt-6",
|
|
492
492
|
command: (t) => {
|
|
493
|
-
const e = t.get(
|
|
493
|
+
const e = t.get(h);
|
|
494
494
|
return () => e.call(b.key, 6);
|
|
495
495
|
}
|
|
496
496
|
},
|
|
497
497
|
DowngradeHeading: {
|
|
498
498
|
shortcuts: ["Delete", "Backspace"],
|
|
499
499
|
command: (t) => {
|
|
500
|
-
const e = t.get(
|
|
501
|
-
return () => e.call(
|
|
500
|
+
const e = t.get(h);
|
|
501
|
+
return () => e.call(be.key);
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
|
-
n(
|
|
505
|
+
n(Le.ctx, {
|
|
506
506
|
displayName: "KeymapCtx<heading>",
|
|
507
507
|
group: "Heading"
|
|
508
508
|
});
|
|
509
|
-
n(
|
|
509
|
+
n(Le.shortcuts, {
|
|
510
510
|
displayName: "Keymap<heading>",
|
|
511
511
|
group: "Heading"
|
|
512
512
|
});
|
|
513
|
-
const
|
|
514
|
-
n(
|
|
513
|
+
const xe = I("blockquote");
|
|
514
|
+
n(xe, {
|
|
515
515
|
displayName: "Attr<blockquote>",
|
|
516
516
|
group: "Blockquote"
|
|
517
517
|
});
|
|
@@ -520,7 +520,7 @@ const q = C("blockquote", (t) => ({
|
|
|
520
520
|
group: "block",
|
|
521
521
|
defining: !0,
|
|
522
522
|
parseDOM: [{ tag: "blockquote" }],
|
|
523
|
-
toDOM: (e) => ["blockquote", t.get(
|
|
523
|
+
toDOM: (e) => ["blockquote", t.get(xe.key)(e), 0],
|
|
524
524
|
parseMarkdown: {
|
|
525
525
|
match: ({ type: e }) => e === "blockquote",
|
|
526
526
|
runner: (e, r, a) => {
|
|
@@ -542,38 +542,38 @@ n(q.ctx, {
|
|
|
542
542
|
displayName: "NodeSchemaCtx<blockquote>",
|
|
543
543
|
group: "Blockquote"
|
|
544
544
|
});
|
|
545
|
-
const
|
|
546
|
-
n(
|
|
545
|
+
const ht = w((t) => le(/^\s*>\s$/, q.type(t)));
|
|
546
|
+
n(ht, {
|
|
547
547
|
displayName: "InputRule<wrapInBlockquoteInputRule>",
|
|
548
548
|
group: "Blockquote"
|
|
549
549
|
});
|
|
550
|
-
const
|
|
551
|
-
n(
|
|
550
|
+
const Se = y("WrapInBlockquote", (t) => () => se(q.type(t)));
|
|
551
|
+
n(Se, {
|
|
552
552
|
displayName: "Command<wrapInBlockquoteCommand>",
|
|
553
553
|
group: "Blockquote"
|
|
554
554
|
});
|
|
555
|
-
const
|
|
555
|
+
const we = N("blockquoteKeymap", {
|
|
556
556
|
WrapInBlockquote: {
|
|
557
557
|
shortcuts: "Mod-Shift-b",
|
|
558
558
|
command: (t) => {
|
|
559
|
-
const e = t.get(
|
|
560
|
-
return () => e.call(
|
|
559
|
+
const e = t.get(h);
|
|
560
|
+
return () => e.call(Se.key);
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
});
|
|
564
|
-
n(
|
|
564
|
+
n(we.ctx, {
|
|
565
565
|
displayName: "KeymapCtx<blockquote>",
|
|
566
566
|
group: "Blockquote"
|
|
567
567
|
});
|
|
568
|
-
n(
|
|
568
|
+
n(we.shortcuts, {
|
|
569
569
|
displayName: "Keymap<blockquote>",
|
|
570
570
|
group: "Blockquote"
|
|
571
571
|
});
|
|
572
|
-
const
|
|
572
|
+
const Ae = I("codeBlock", () => ({
|
|
573
573
|
pre: {},
|
|
574
574
|
code: {}
|
|
575
575
|
}));
|
|
576
|
-
n(
|
|
576
|
+
n(Ae, {
|
|
577
577
|
displayName: "Attr<codeBlock>",
|
|
578
578
|
group: "CodeBlock"
|
|
579
579
|
});
|
|
@@ -600,7 +600,7 @@ const W = C("code_block", (t) => ({
|
|
|
600
600
|
}
|
|
601
601
|
],
|
|
602
602
|
toDOM: (e) => {
|
|
603
|
-
const r = t.get(
|
|
603
|
+
const r = t.get(Ae.key)(e);
|
|
604
604
|
return [
|
|
605
605
|
"pre",
|
|
606
606
|
{
|
|
@@ -635,49 +635,49 @@ n(W.ctx, {
|
|
|
635
635
|
displayName: "NodeSchemaCtx<codeBlock>",
|
|
636
636
|
group: "CodeBlock"
|
|
637
637
|
});
|
|
638
|
-
const
|
|
638
|
+
const kt = w((t) => lt(/^```(?<language>[a-z]*)?[\s\n]$/, W.type(t), (e) => {
|
|
639
639
|
var r;
|
|
640
640
|
return {
|
|
641
641
|
language: ((r = e.groups) == null ? void 0 : r.language) ?? ""
|
|
642
642
|
};
|
|
643
643
|
}));
|
|
644
|
-
n(
|
|
644
|
+
n(kt, {
|
|
645
645
|
displayName: "InputRule<createCodeBlockInputRule>",
|
|
646
646
|
group: "CodeBlock"
|
|
647
647
|
});
|
|
648
|
-
const
|
|
649
|
-
n(
|
|
648
|
+
const ve = y("CreateCodeBlock", (t) => (e = "") => E(W.type(t), { language: e }));
|
|
649
|
+
n(ve, {
|
|
650
650
|
displayName: "Command<createCodeBlockCommand>",
|
|
651
651
|
group: "CodeBlock"
|
|
652
652
|
});
|
|
653
|
-
const
|
|
654
|
-
n(
|
|
653
|
+
const jt = y("UpdateCodeBlockLanguage", () => ({ pos: t, language: e } = { pos: -1, language: "" }) => (r, a) => t >= 0 ? (a == null || a(r.tr.setNodeAttribute(t, "language", e)), !0) : !1);
|
|
654
|
+
n(jt, {
|
|
655
655
|
displayName: "Command<updateCodeBlockLanguageCommand>",
|
|
656
656
|
group: "CodeBlock"
|
|
657
657
|
});
|
|
658
|
-
const
|
|
658
|
+
const He = N("codeBlockKeymap", {
|
|
659
659
|
CreateCodeBlock: {
|
|
660
660
|
shortcuts: "Mod-Alt-c",
|
|
661
661
|
command: (t) => {
|
|
662
|
-
const e = t.get(
|
|
663
|
-
return () => e.call(
|
|
662
|
+
const e = t.get(h);
|
|
663
|
+
return () => e.call(ve.key);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
});
|
|
667
|
-
n(
|
|
667
|
+
n(He.ctx, {
|
|
668
668
|
displayName: "KeymapCtx<codeBlock>",
|
|
669
669
|
group: "CodeBlock"
|
|
670
670
|
});
|
|
671
|
-
n(
|
|
671
|
+
n(He.shortcuts, {
|
|
672
672
|
displayName: "Keymap<codeBlock>",
|
|
673
673
|
group: "CodeBlock"
|
|
674
674
|
});
|
|
675
|
-
const
|
|
676
|
-
n(
|
|
675
|
+
const Be = I("image");
|
|
676
|
+
n(Be, {
|
|
677
677
|
displayName: "Attr<image>",
|
|
678
678
|
group: "Image"
|
|
679
679
|
});
|
|
680
|
-
const
|
|
680
|
+
const K = C("image", (t) => ({
|
|
681
681
|
inline: !0,
|
|
682
682
|
group: "inline",
|
|
683
683
|
selectable: !0,
|
|
@@ -705,15 +705,15 @@ const D = C("image", (t) => ({
|
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
],
|
|
708
|
-
toDOM: (e) => ["img", { ...t.get(
|
|
708
|
+
toDOM: (e) => ["img", { ...t.get(Be.key)(e), ...e.attrs }],
|
|
709
709
|
parseMarkdown: {
|
|
710
710
|
match: ({ type: e }) => e === "image",
|
|
711
711
|
runner: (e, r, a) => {
|
|
712
|
-
const o = r.url, s = r.alt,
|
|
712
|
+
const o = r.url, s = r.alt, i = r.title;
|
|
713
713
|
e.addNode(a, {
|
|
714
714
|
src: o,
|
|
715
715
|
alt: s,
|
|
716
|
-
title:
|
|
716
|
+
title: i
|
|
717
717
|
});
|
|
718
718
|
}
|
|
719
719
|
},
|
|
@@ -728,50 +728,50 @@ const D = C("image", (t) => ({
|
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
}));
|
|
731
|
-
n(
|
|
731
|
+
n(K.node, {
|
|
732
732
|
displayName: "NodeSchema<image>",
|
|
733
733
|
group: "Image"
|
|
734
734
|
});
|
|
735
|
-
n(
|
|
735
|
+
n(K.ctx, {
|
|
736
736
|
displayName: "NodeSchemaCtx<image>",
|
|
737
737
|
group: "Image"
|
|
738
738
|
});
|
|
739
|
-
const
|
|
739
|
+
const ft = y("InsertImage", (t) => (e = {}) => (r, a) => {
|
|
740
740
|
if (!a)
|
|
741
741
|
return !0;
|
|
742
|
-
const { src: o = "", alt: s = "", title:
|
|
743
|
-
return
|
|
742
|
+
const { src: o = "", alt: s = "", title: i = "" } = e, l = K.type(t).create({ src: o, alt: s, title: i });
|
|
743
|
+
return l && a(r.tr.replaceSelectionWith(l).scrollIntoView()), !0;
|
|
744
744
|
});
|
|
745
|
-
n(
|
|
745
|
+
n(ft, {
|
|
746
746
|
displayName: "Command<insertImageCommand>",
|
|
747
747
|
group: "Image"
|
|
748
748
|
});
|
|
749
|
-
const
|
|
750
|
-
const o =
|
|
749
|
+
const Nt = y("UpdateImage", (t) => (e = {}) => (r, a) => {
|
|
750
|
+
const o = _t(r.selection, K.type(t));
|
|
751
751
|
if (!o)
|
|
752
752
|
return !1;
|
|
753
|
-
const { node: s, pos:
|
|
754
|
-
return c !== void 0 && (
|
|
753
|
+
const { node: s, pos: i } = o, l = { ...s.attrs }, { src: c, alt: d, title: m } = e;
|
|
754
|
+
return c !== void 0 && (l.src = c), d !== void 0 && (l.alt = d), m !== void 0 && (l.title = m), a == null || a(r.tr.setNodeMarkup(i, void 0, l).scrollIntoView()), !0;
|
|
755
755
|
});
|
|
756
|
-
n(
|
|
756
|
+
n(Nt, {
|
|
757
757
|
displayName: "Command<updateImageCommand>",
|
|
758
758
|
group: "Image"
|
|
759
759
|
});
|
|
760
|
-
const
|
|
760
|
+
const zt = w((t) => new it(
|
|
761
761
|
/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,
|
|
762
762
|
(e, r, a, o) => {
|
|
763
|
-
const [s,
|
|
764
|
-
return s ? e.tr.replaceWith(a, o,
|
|
763
|
+
const [s, i, l = "", c] = r;
|
|
764
|
+
return s ? e.tr.replaceWith(a, o, K.type(t).create({ src: l, alt: i, title: c })) : null;
|
|
765
765
|
}
|
|
766
766
|
));
|
|
767
|
-
n(
|
|
767
|
+
n(zt, {
|
|
768
768
|
displayName: "InputRule<insertImageInputRule>",
|
|
769
769
|
group: "Image"
|
|
770
770
|
});
|
|
771
|
-
const
|
|
771
|
+
const Oe = I("hardbreak", (t) => ({
|
|
772
772
|
"data-is-inline": t.attrs.isInline
|
|
773
773
|
}));
|
|
774
|
-
n(
|
|
774
|
+
n(Oe, {
|
|
775
775
|
displayName: "Attr<hardbreak>",
|
|
776
776
|
group: "Hardbreak"
|
|
777
777
|
});
|
|
@@ -785,7 +785,7 @@ const S = C("hardbreak", (t) => ({
|
|
|
785
785
|
},
|
|
786
786
|
selectable: !1,
|
|
787
787
|
parseDOM: [{ tag: "br" }],
|
|
788
|
-
toDOM: (e) => ["br", t.get(
|
|
788
|
+
toDOM: (e) => ["br", t.get(Oe.key)(e)],
|
|
789
789
|
parseMarkdown: {
|
|
790
790
|
match: ({ type: e }) => e === "break",
|
|
791
791
|
runner: (e, r, a) => {
|
|
@@ -811,48 +811,48 @@ n(S.ctx, {
|
|
|
811
811
|
displayName: "NodeSchemaCtx<hardbreak>",
|
|
812
812
|
group: "Hardbreak"
|
|
813
813
|
});
|
|
814
|
-
const
|
|
814
|
+
const Te = y("InsertHardbreak", (t) => () => (e, r) => {
|
|
815
815
|
var s;
|
|
816
816
|
const { selection: a, tr: o } = e;
|
|
817
817
|
if (a.empty) {
|
|
818
|
-
const
|
|
819
|
-
if (
|
|
818
|
+
const i = a.$from.node();
|
|
819
|
+
if (i.childCount > 0 && ((s = i.lastChild) == null ? void 0 : s.type.name) === "hardbreak")
|
|
820
820
|
return r == null || r(
|
|
821
|
-
o.replaceRangeWith(a.to - 1, a.to, e.schema.node("paragraph")).setSelection(
|
|
821
|
+
o.replaceRangeWith(a.to - 1, a.to, e.schema.node("paragraph")).setSelection(ct.near(o.doc.resolve(a.to))).scrollIntoView()
|
|
822
822
|
), !0;
|
|
823
823
|
}
|
|
824
824
|
return r == null || r(o.setMeta("hardbreak", !0).replaceSelectionWith(S.type(t).create()).scrollIntoView()), !0;
|
|
825
825
|
});
|
|
826
|
-
n(
|
|
826
|
+
n(Te, {
|
|
827
827
|
displayName: "Command<insertHardbreakCommand>",
|
|
828
828
|
group: "Hardbreak"
|
|
829
829
|
});
|
|
830
|
-
const
|
|
830
|
+
const Re = N("hardbreakKeymap", {
|
|
831
831
|
InsertHardbreak: {
|
|
832
832
|
shortcuts: "Shift-Enter",
|
|
833
833
|
command: (t) => {
|
|
834
|
-
const e = t.get(
|
|
835
|
-
return () => e.call(
|
|
834
|
+
const e = t.get(h);
|
|
835
|
+
return () => e.call(Te.key);
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
});
|
|
839
|
-
n(
|
|
839
|
+
n(Re.ctx, {
|
|
840
840
|
displayName: "KeymapCtx<hardbreak>",
|
|
841
841
|
group: "Hardbreak"
|
|
842
842
|
});
|
|
843
|
-
n(
|
|
843
|
+
n(Re.shortcuts, {
|
|
844
844
|
displayName: "Keymap<hardbreak>",
|
|
845
845
|
group: "Hardbreak"
|
|
846
846
|
});
|
|
847
|
-
const
|
|
848
|
-
n(
|
|
847
|
+
const Ke = I("hr");
|
|
848
|
+
n(Ke, {
|
|
849
849
|
displayName: "Attr<hr>",
|
|
850
850
|
group: "Hr"
|
|
851
851
|
});
|
|
852
852
|
const F = C("hr", (t) => ({
|
|
853
853
|
group: "block",
|
|
854
854
|
parseDOM: [{ tag: "hr" }],
|
|
855
|
-
toDOM: (e) => ["hr", t.get(
|
|
855
|
+
toDOM: (e) => ["hr", t.get(Ke.key)(e)],
|
|
856
856
|
parseMarkdown: {
|
|
857
857
|
match: ({ type: e }) => e === "thematicBreak",
|
|
858
858
|
runner: (e, r, a) => {
|
|
@@ -874,36 +874,36 @@ n(F.ctx, {
|
|
|
874
874
|
displayName: "NodeSchemaCtx<hr>",
|
|
875
875
|
group: "Hr"
|
|
876
876
|
});
|
|
877
|
-
const
|
|
877
|
+
const It = w((t) => new it(
|
|
878
878
|
/^(?:---|___\s|\*\*\*\s)$/,
|
|
879
879
|
(e, r, a, o) => {
|
|
880
880
|
const { tr: s } = e;
|
|
881
881
|
return r[0] && s.replaceWith(a - 1, o, F.type(t).create()), s;
|
|
882
882
|
}
|
|
883
883
|
));
|
|
884
|
-
n(
|
|
884
|
+
n(It, {
|
|
885
885
|
displayName: "InputRule<insertHrInputRule>",
|
|
886
886
|
group: "Hr"
|
|
887
887
|
});
|
|
888
|
-
const
|
|
888
|
+
const Ct = y("InsertHr", (t) => () => (e, r) => {
|
|
889
889
|
if (!r)
|
|
890
890
|
return !0;
|
|
891
|
-
const a = v.node.type(t).create(), { tr: o, selection: s } = e, { from:
|
|
892
|
-
if (!
|
|
891
|
+
const a = v.node.type(t).create(), { tr: o, selection: s } = e, { from: i } = s, l = F.type(t).create();
|
|
892
|
+
if (!l)
|
|
893
893
|
return !0;
|
|
894
|
-
const c = o.replaceSelectionWith(
|
|
894
|
+
const c = o.replaceSelectionWith(l).insert(i, a), d = ct.findFrom(c.doc.resolve(i), 1, !0);
|
|
895
895
|
return d && r(c.setSelection(d).scrollIntoView()), !0;
|
|
896
896
|
});
|
|
897
|
-
n(
|
|
897
|
+
n(Ct, {
|
|
898
898
|
displayName: "Command<insertHrCommand>",
|
|
899
899
|
group: "Hr"
|
|
900
900
|
});
|
|
901
|
-
const
|
|
902
|
-
n(
|
|
901
|
+
const De = I("bulletList");
|
|
902
|
+
n(De, {
|
|
903
903
|
displayName: "Attr<bulletList>",
|
|
904
904
|
group: "BulletList"
|
|
905
905
|
});
|
|
906
|
-
const
|
|
906
|
+
const D = C("bullet_list", (t) => ({
|
|
907
907
|
content: "listItem+",
|
|
908
908
|
group: "block",
|
|
909
909
|
attrs: {
|
|
@@ -926,7 +926,7 @@ const R = C("bullet_list", (t) => ({
|
|
|
926
926
|
toDOM: (e) => [
|
|
927
927
|
"ul",
|
|
928
928
|
{
|
|
929
|
-
...t.get(
|
|
929
|
+
...t.get(De.key)(e),
|
|
930
930
|
"data-spread": e.attrs.spread
|
|
931
931
|
},
|
|
932
932
|
0
|
|
@@ -945,43 +945,43 @@ const R = C("bullet_list", (t) => ({
|
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
}));
|
|
948
|
-
n(
|
|
948
|
+
n(D.node, {
|
|
949
949
|
displayName: "NodeSchema<bulletList>",
|
|
950
950
|
group: "BulletList"
|
|
951
951
|
});
|
|
952
|
-
n(
|
|
952
|
+
n(D.ctx, {
|
|
953
953
|
displayName: "NodeSchemaCtx<bulletList>",
|
|
954
954
|
group: "BulletList"
|
|
955
955
|
});
|
|
956
|
-
const
|
|
957
|
-
n(
|
|
956
|
+
const Mt = w((t) => le(/^\s*([-+*])\s$/, D.type(t)));
|
|
957
|
+
n(Mt, {
|
|
958
958
|
displayName: "InputRule<wrapInBulletListInputRule>",
|
|
959
959
|
group: "BulletList"
|
|
960
960
|
});
|
|
961
|
-
const
|
|
962
|
-
n(
|
|
961
|
+
const Pe = y("WrapInBulletList", (t) => () => se(D.type(t)));
|
|
962
|
+
n(Pe, {
|
|
963
963
|
displayName: "Command<wrapInBulletListCommand>",
|
|
964
964
|
group: "BulletList"
|
|
965
965
|
});
|
|
966
|
-
const
|
|
966
|
+
const _e = N("bulletListKeymap", {
|
|
967
967
|
WrapInBulletList: {
|
|
968
968
|
shortcuts: "Mod-Alt-8",
|
|
969
969
|
command: (t) => {
|
|
970
|
-
const e = t.get(
|
|
971
|
-
return () => e.call(
|
|
970
|
+
const e = t.get(h);
|
|
971
|
+
return () => e.call(Pe.key);
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
});
|
|
975
|
-
n(
|
|
975
|
+
n(_e.ctx, {
|
|
976
976
|
displayName: "KeymapCtx<bulletListKeymap>",
|
|
977
977
|
group: "BulletList"
|
|
978
978
|
});
|
|
979
|
-
n(
|
|
979
|
+
n(_e.shortcuts, {
|
|
980
980
|
displayName: "Keymap<bulletListKeymap>",
|
|
981
981
|
group: "BulletList"
|
|
982
982
|
});
|
|
983
|
-
const
|
|
984
|
-
n(
|
|
983
|
+
const Ee = I("orderedList");
|
|
984
|
+
n(Ee, {
|
|
985
985
|
displayName: "Attr<orderedList>",
|
|
986
986
|
group: "OrderedList"
|
|
987
987
|
});
|
|
@@ -1012,7 +1012,7 @@ const P = C("ordered_list", (t) => ({
|
|
|
1012
1012
|
toDOM: (e) => [
|
|
1013
1013
|
"ol",
|
|
1014
1014
|
{
|
|
1015
|
-
...t.get(
|
|
1015
|
+
...t.get(Ee.key)(e),
|
|
1016
1016
|
...e.attrs.order === 1 ? {} : e.attrs.order,
|
|
1017
1017
|
"data-spread": e.attrs.spread
|
|
1018
1018
|
},
|
|
@@ -1040,40 +1040,40 @@ n(P.ctx, {
|
|
|
1040
1040
|
displayName: "NodeSchemaCtx<orderedList>",
|
|
1041
1041
|
group: "OrderedList"
|
|
1042
1042
|
});
|
|
1043
|
-
const
|
|
1043
|
+
const bt = w((t) => le(
|
|
1044
1044
|
/^\s*(\d+)\.\s$/,
|
|
1045
1045
|
P.type(t),
|
|
1046
1046
|
(e) => ({ order: Number(e[1]) }),
|
|
1047
1047
|
(e, r) => r.childCount + r.attrs.order === Number(e[1])
|
|
1048
1048
|
));
|
|
1049
|
-
n(
|
|
1049
|
+
n(bt, {
|
|
1050
1050
|
displayName: "InputRule<wrapInOrderedListInputRule>",
|
|
1051
1051
|
group: "OrderedList"
|
|
1052
1052
|
});
|
|
1053
|
-
const
|
|
1054
|
-
n(
|
|
1053
|
+
const $e = y("WrapInOrderedList", (t) => () => se(P.type(t)));
|
|
1054
|
+
n($e, {
|
|
1055
1055
|
displayName: "Command<wrapInOrderedListCommand>",
|
|
1056
1056
|
group: "OrderedList"
|
|
1057
1057
|
});
|
|
1058
|
-
const
|
|
1058
|
+
const qe = N("orderedListKeymap", {
|
|
1059
1059
|
WrapInOrderedList: {
|
|
1060
1060
|
shortcuts: "Mod-Alt-7",
|
|
1061
1061
|
command: (t) => {
|
|
1062
|
-
const e = t.get(
|
|
1063
|
-
return () => e.call(
|
|
1062
|
+
const e = t.get(h);
|
|
1063
|
+
return () => e.call($e.key);
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
});
|
|
1067
|
-
n(
|
|
1067
|
+
n(qe.ctx, {
|
|
1068
1068
|
displayName: "KeymapCtx<orderedList>",
|
|
1069
1069
|
group: "OrderedList"
|
|
1070
1070
|
});
|
|
1071
|
-
n(
|
|
1071
|
+
n(qe.shortcuts, {
|
|
1072
1072
|
displayName: "Keymap<orderedList>",
|
|
1073
1073
|
group: "OrderedList"
|
|
1074
1074
|
});
|
|
1075
|
-
const
|
|
1076
|
-
n(
|
|
1075
|
+
const We = I("listItem");
|
|
1076
|
+
n(We, {
|
|
1077
1077
|
displayName: "Attr<listItem>",
|
|
1078
1078
|
group: "ListItem"
|
|
1079
1079
|
});
|
|
@@ -1109,7 +1109,7 @@ const M = C("list_item", (t) => ({
|
|
|
1109
1109
|
toDOM: (e) => [
|
|
1110
1110
|
"li",
|
|
1111
1111
|
{
|
|
1112
|
-
...t.get(
|
|
1112
|
+
...t.get(We.key)(e),
|
|
1113
1113
|
"data-label": e.attrs.label,
|
|
1114
1114
|
"data-list-type": e.attrs.listType,
|
|
1115
1115
|
"data-spread": e.attrs.spread
|
|
@@ -1119,8 +1119,8 @@ const M = C("list_item", (t) => ({
|
|
|
1119
1119
|
parseMarkdown: {
|
|
1120
1120
|
match: ({ type: e }) => e === "listItem",
|
|
1121
1121
|
runner: (e, r, a) => {
|
|
1122
|
-
const o = r.label != null ? `${r.label}.` : "•", s = r.label != null ? "ordered" : "bullet",
|
|
1123
|
-
e.openNode(a, { label: o, listType: s, spread:
|
|
1122
|
+
const o = r.label != null ? `${r.label}.` : "•", s = r.label != null ? "ordered" : "bullet", i = r.spread != null ? `${r.spread}` : "true";
|
|
1123
|
+
e.openNode(a, { label: o, listType: s, spread: i }), e.next(r.children), e.closeNode();
|
|
1124
1124
|
}
|
|
1125
1125
|
},
|
|
1126
1126
|
toMarkdown: {
|
|
@@ -1138,74 +1138,74 @@ n(M.ctx, {
|
|
|
1138
1138
|
displayName: "NodeSchemaCtx<listItem>",
|
|
1139
1139
|
group: "ListItem"
|
|
1140
1140
|
});
|
|
1141
|
-
const
|
|
1142
|
-
n(
|
|
1141
|
+
const Fe = y("SinkListItem", (t) => () => Et(M.type(t)));
|
|
1142
|
+
n(Fe, {
|
|
1143
1143
|
displayName: "Command<sinkListItemCommand>",
|
|
1144
1144
|
group: "ListItem"
|
|
1145
1145
|
});
|
|
1146
|
-
const
|
|
1147
|
-
n(
|
|
1146
|
+
const Ge = y("SplitListItem", (t) => () => dt(M.type(t)));
|
|
1147
|
+
n(Ge, {
|
|
1148
1148
|
displayName: "Command<liftListItemCommand>",
|
|
1149
1149
|
group: "ListItem"
|
|
1150
1150
|
});
|
|
1151
|
-
const
|
|
1152
|
-
n(
|
|
1151
|
+
const Ve = y("SplitListItem", (t) => () => $t(M.type(t)));
|
|
1152
|
+
n(Ve, {
|
|
1153
1153
|
displayName: "Command<splitListItemCommand>",
|
|
1154
1154
|
group: "ListItem"
|
|
1155
1155
|
});
|
|
1156
|
-
const
|
|
1156
|
+
const Ut = (t) => (e, r, a) => {
|
|
1157
1157
|
const { selection: o } = e;
|
|
1158
1158
|
if (!(o instanceof G))
|
|
1159
1159
|
return !1;
|
|
1160
|
-
const { empty: s, $from:
|
|
1161
|
-
if (!s ||
|
|
1160
|
+
const { empty: s, $from: i } = o;
|
|
1161
|
+
if (!s || i.parentOffset !== 0)
|
|
1162
1162
|
return !1;
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1165
|
-
},
|
|
1166
|
-
n(
|
|
1163
|
+
const l = i.node(-1);
|
|
1164
|
+
return l.type !== M.type(t) || l.firstChild !== i.node() || i.node(-2).childCount > 1 ? !1 : dt(M.type(t))(e, r, a);
|
|
1165
|
+
}, je = y("LiftFirstListItem", (t) => () => Ut(t));
|
|
1166
|
+
n(je, {
|
|
1167
1167
|
displayName: "Command<liftFirstListItemCommand>",
|
|
1168
1168
|
group: "ListItem"
|
|
1169
1169
|
});
|
|
1170
|
-
const
|
|
1170
|
+
const ze = N("listItemKeymap", {
|
|
1171
1171
|
NextListItem: {
|
|
1172
1172
|
shortcuts: "Enter",
|
|
1173
1173
|
command: (t) => {
|
|
1174
|
-
const e = t.get(
|
|
1175
|
-
return () => e.call(
|
|
1174
|
+
const e = t.get(h);
|
|
1175
|
+
return () => e.call(Ve.key);
|
|
1176
1176
|
}
|
|
1177
1177
|
},
|
|
1178
1178
|
SinkListItem: {
|
|
1179
1179
|
shortcuts: ["Tab", "Mod-]"],
|
|
1180
1180
|
command: (t) => {
|
|
1181
|
-
const e = t.get(
|
|
1182
|
-
return () => e.call(
|
|
1181
|
+
const e = t.get(h);
|
|
1182
|
+
return () => e.call(Fe.key);
|
|
1183
1183
|
}
|
|
1184
1184
|
},
|
|
1185
1185
|
LiftListItem: {
|
|
1186
1186
|
shortcuts: ["Shift-Tab", "Mod-["],
|
|
1187
1187
|
command: (t) => {
|
|
1188
|
-
const e = t.get(
|
|
1189
|
-
return () => e.call(
|
|
1188
|
+
const e = t.get(h);
|
|
1189
|
+
return () => e.call(Ge.key);
|
|
1190
1190
|
}
|
|
1191
1191
|
},
|
|
1192
1192
|
LiftFirstListItem: {
|
|
1193
1193
|
shortcuts: ["Backspace", "Delete"],
|
|
1194
1194
|
command: (t) => {
|
|
1195
|
-
const e = t.get(
|
|
1196
|
-
return () => e.call(
|
|
1195
|
+
const e = t.get(h);
|
|
1196
|
+
return () => e.call(je.key);
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
});
|
|
1200
|
-
n(
|
|
1200
|
+
n(ze.ctx, {
|
|
1201
1201
|
displayName: "KeymapCtx<listItem>",
|
|
1202
1202
|
group: "ListItem"
|
|
1203
1203
|
});
|
|
1204
|
-
n(
|
|
1204
|
+
n(ze.shortcuts, {
|
|
1205
1205
|
displayName: "Keymap<listItem>",
|
|
1206
1206
|
group: "ListItem"
|
|
1207
1207
|
});
|
|
1208
|
-
const
|
|
1208
|
+
const Lt = ot("text", () => ({
|
|
1209
1209
|
group: "inline",
|
|
1210
1210
|
parseMarkdown: {
|
|
1211
1211
|
match: ({ type: t }) => t === "text",
|
|
@@ -1220,16 +1220,16 @@ const gt = Ye("text", () => ({
|
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
1222
|
}));
|
|
1223
|
-
n(
|
|
1223
|
+
n(Lt, {
|
|
1224
1224
|
displayName: "NodeSchema<text>",
|
|
1225
1225
|
group: "Text"
|
|
1226
1226
|
});
|
|
1227
|
-
const
|
|
1228
|
-
n(
|
|
1227
|
+
const Ue = I("html");
|
|
1228
|
+
n(Ue, {
|
|
1229
1229
|
displayName: "Attr<html>",
|
|
1230
1230
|
group: "Html"
|
|
1231
1231
|
});
|
|
1232
|
-
const
|
|
1232
|
+
const Ye = C("html", (t) => ({
|
|
1233
1233
|
atom: !0,
|
|
1234
1234
|
group: "inline",
|
|
1235
1235
|
inline: !0,
|
|
@@ -1240,7 +1240,7 @@ const Ge = C("html", (t) => ({
|
|
|
1240
1240
|
},
|
|
1241
1241
|
toDOM: (e) => {
|
|
1242
1242
|
const r = document.createElement("span"), a = {
|
|
1243
|
-
...t.get(
|
|
1243
|
+
...t.get(Ue.key)(e),
|
|
1244
1244
|
"data-value": e.attrs.value,
|
|
1245
1245
|
"data-type": "html"
|
|
1246
1246
|
};
|
|
@@ -1265,117 +1265,117 @@ const Ge = C("html", (t) => ({
|
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
}));
|
|
1268
|
-
n(
|
|
1268
|
+
n(Ye.node, {
|
|
1269
1269
|
displayName: "NodeSchema<html>",
|
|
1270
1270
|
group: "Html"
|
|
1271
1271
|
});
|
|
1272
|
-
n(
|
|
1272
|
+
n(Ye.ctx, {
|
|
1273
1273
|
displayName: "NodeSchemaCtx<html>",
|
|
1274
1274
|
group: "Html"
|
|
1275
1275
|
});
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
|
|
1276
|
+
const Yt = [
|
|
1277
|
+
gt,
|
|
1278
|
+
Ne,
|
|
1279
1279
|
v,
|
|
1280
1280
|
Y,
|
|
1281
|
-
|
|
1281
|
+
Me,
|
|
1282
1282
|
H,
|
|
1283
|
-
|
|
1283
|
+
Oe,
|
|
1284
1284
|
S,
|
|
1285
|
-
|
|
1285
|
+
xe,
|
|
1286
1286
|
q,
|
|
1287
|
-
|
|
1287
|
+
Ae,
|
|
1288
1288
|
W,
|
|
1289
|
-
|
|
1289
|
+
Ke,
|
|
1290
1290
|
F,
|
|
1291
|
-
Se,
|
|
1292
|
-
D,
|
|
1293
1291
|
Be,
|
|
1294
|
-
|
|
1295
|
-
|
|
1292
|
+
K,
|
|
1293
|
+
De,
|
|
1294
|
+
D,
|
|
1295
|
+
Ee,
|
|
1296
1296
|
P,
|
|
1297
|
-
|
|
1297
|
+
We,
|
|
1298
1298
|
M,
|
|
1299
|
-
|
|
1299
|
+
ce,
|
|
1300
1300
|
z,
|
|
1301
|
-
|
|
1301
|
+
ue,
|
|
1302
1302
|
U,
|
|
1303
|
-
|
|
1303
|
+
ye,
|
|
1304
1304
|
x,
|
|
1305
|
-
|
|
1305
|
+
fe,
|
|
1306
1306
|
B,
|
|
1307
|
+
Ue,
|
|
1308
|
+
Ye,
|
|
1309
|
+
Lt
|
|
1310
|
+
].flat(), Zt = [
|
|
1311
|
+
ht,
|
|
1312
|
+
Mt,
|
|
1313
|
+
bt,
|
|
1314
|
+
kt,
|
|
1315
|
+
It,
|
|
1316
|
+
yt
|
|
1317
|
+
].flat(), Jt = [
|
|
1318
|
+
Ie,
|
|
1319
|
+
Se,
|
|
1320
|
+
b,
|
|
1321
|
+
be,
|
|
1322
|
+
ve,
|
|
1323
|
+
Te,
|
|
1324
|
+
Ct,
|
|
1325
|
+
ft,
|
|
1326
|
+
Nt,
|
|
1327
|
+
$e,
|
|
1328
|
+
Pe,
|
|
1307
1329
|
Fe,
|
|
1330
|
+
Ve,
|
|
1308
1331
|
Ge,
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
st,
|
|
1312
|
-
ut,
|
|
1313
|
-
pt,
|
|
1314
|
-
lt,
|
|
1315
|
-
dt,
|
|
1316
|
-
ot
|
|
1317
|
-
].flat(), jt = [
|
|
1332
|
+
je,
|
|
1333
|
+
de,
|
|
1318
1334
|
he,
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1335
|
+
pe,
|
|
1336
|
+
ut,
|
|
1337
|
+
pt
|
|
1338
|
+
], Qt = [
|
|
1339
|
+
we,
|
|
1340
|
+
He,
|
|
1341
|
+
Re,
|
|
1322
1342
|
Le,
|
|
1323
|
-
|
|
1324
|
-
mt,
|
|
1325
|
-
it,
|
|
1326
|
-
ct,
|
|
1327
|
-
De,
|
|
1328
|
-
Oe,
|
|
1329
|
-
Ee,
|
|
1330
|
-
$e,
|
|
1331
|
-
_e,
|
|
1343
|
+
ze,
|
|
1332
1344
|
qe,
|
|
1333
|
-
|
|
1345
|
+
_e,
|
|
1346
|
+
Ce,
|
|
1334
1347
|
me,
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
], zt = [
|
|
1339
|
-
Me,
|
|
1340
|
-
xe,
|
|
1341
|
-
ve,
|
|
1342
|
-
Ne,
|
|
1343
|
-
We,
|
|
1344
|
-
Re,
|
|
1345
|
-
Te,
|
|
1346
|
-
ye,
|
|
1347
|
-
se,
|
|
1348
|
-
ue,
|
|
1349
|
-
ce
|
|
1350
|
-
].flat(), Ut = /\[([^\]]+)]\([^\s\]]+\)/, Q = /\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/, Yt = (t) => new RegExp(`\\\\(?=[^\\w\\s${t}\\\\]|_)`, "g"), Jt = (t) => {
|
|
1348
|
+
ke,
|
|
1349
|
+
ge
|
|
1350
|
+
].flat(), Xt = /\[([^\]]+)]\([^\s\]]+\)/, Q = /\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/, er = (t) => new RegExp(`\\\\(?=[^\\w\\s${t}\\\\]|_)`, "g"), Z = "", ee = `${Z}*`, te = `${Z}*`, re = `${Z}_`, ae = `${Z}⎽`, tr = (t) => {
|
|
1351
1351
|
let e = t, r = e.match(Q);
|
|
1352
1352
|
for (; r && r.groups; ) {
|
|
1353
1353
|
const { span: a } = r.groups;
|
|
1354
1354
|
e = e.replace(Q, a), r = e.match(Q);
|
|
1355
1355
|
}
|
|
1356
1356
|
return e;
|
|
1357
|
-
},
|
|
1357
|
+
}, rr = (t) => t.replaceAll(/\\\\\*/g, ee).replaceAll(/\\\\_/g, re).replaceAll(ee, te).replaceAll(re, ae), ar = (t, e, r) => {
|
|
1358
1358
|
const a = t.split(""), o = a[e];
|
|
1359
1359
|
return a[e] && a[r] && (a[e] = a[r], a[r] = o), a.join("").toString();
|
|
1360
|
-
},
|
|
1360
|
+
}, nr = (t) => (e) => e.replace(er(t), ""), or = (t) => (e) => {
|
|
1361
1361
|
const r = e.indexOf(t.hole), a = e.charAt(r - 1), o = e.charAt(r + 1), s = /[^\w]|_/;
|
|
1362
1362
|
return o ? a && s.test(a) && s.test(o) ? t.punctuation : t.char : t.punctuation;
|
|
1363
|
-
},
|
|
1363
|
+
}, sr = (t, e, r) => {
|
|
1364
1364
|
let a = e, o = !1;
|
|
1365
1365
|
return t.descendants((s) => {
|
|
1366
|
-
var
|
|
1366
|
+
var i;
|
|
1367
1367
|
if (o)
|
|
1368
1368
|
return !1;
|
|
1369
1369
|
if (!s.textContent.includes(r))
|
|
1370
1370
|
return a += s.nodeSize, !1;
|
|
1371
1371
|
if (s.isText) {
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
return o = !0, a +=
|
|
1372
|
+
const l = (i = s.text) == null ? void 0 : i.indexOf(r);
|
|
1373
|
+
if (l != null && l >= 0)
|
|
1374
|
+
return o = !0, a += l, !1;
|
|
1375
1375
|
}
|
|
1376
1376
|
return a += 1, !0;
|
|
1377
1377
|
}), a;
|
|
1378
|
-
},
|
|
1378
|
+
}, lr = {
|
|
1379
1379
|
placeholderConfig: {
|
|
1380
1380
|
hole: "∅",
|
|
1381
1381
|
punctuation: "⁂",
|
|
@@ -1387,96 +1387,96 @@ const Gt = [
|
|
|
1387
1387
|
const r = ["*", "_"];
|
|
1388
1388
|
let a = e.indexOf(t);
|
|
1389
1389
|
for (; r.includes(e[a - 1] || "") && r.includes(e[a + 1] || ""); )
|
|
1390
|
-
e =
|
|
1390
|
+
e = ar(e, a, a + 1), a = a + 1;
|
|
1391
1391
|
return e;
|
|
1392
1392
|
}
|
|
1393
|
-
},
|
|
1394
|
-
n(
|
|
1393
|
+
}, _ = ne(lr, "inlineSyncConfig");
|
|
1394
|
+
n(_, {
|
|
1395
1395
|
displayName: "Ctx<inlineSyncConfig>",
|
|
1396
1396
|
group: "Prose"
|
|
1397
1397
|
});
|
|
1398
|
-
const
|
|
1399
|
-
const o = t.get(
|
|
1398
|
+
const ir = (t) => t.selection.$from.node(), cr = (t, e, r, a) => {
|
|
1399
|
+
const o = t.get(Rt), s = e.schema.topNodeType.create(void 0, [r, ...a]);
|
|
1400
1400
|
return o(s);
|
|
1401
|
-
},
|
|
1402
|
-
const r = t.get(
|
|
1401
|
+
}, dr = (t, e) => {
|
|
1402
|
+
const r = t.get(_.key), a = r.placeholderConfig.hole, [o = "", ...s] = e.split(`
|
|
1403
1403
|
|
|
1404
|
-
`),
|
|
1405
|
-
let c =
|
|
1406
|
-
const d =
|
|
1404
|
+
`), i = (m) => r.movePlaceholder(a, m);
|
|
1405
|
+
let c = Tt(nr(a), i, tr, rr)(o);
|
|
1406
|
+
const d = or(r.placeholderConfig)(c);
|
|
1407
1407
|
return c = c.replace(a, d), c = [c, ...s].join(`
|
|
1408
1408
|
|
|
1409
1409
|
`), [c, d];
|
|
1410
|
-
},
|
|
1411
|
-
const a = t.get(
|
|
1410
|
+
}, mr = (t, e) => {
|
|
1411
|
+
const a = t.get(Kt)(e);
|
|
1412
1412
|
return a ? a.firstChild : null;
|
|
1413
|
-
},
|
|
1414
|
-
const { globalNodes: r } = t.get(
|
|
1413
|
+
}, ur = (t, e) => {
|
|
1414
|
+
const { globalNodes: r } = t.get(_.key), a = [];
|
|
1415
1415
|
return e.doc.descendants((o) => {
|
|
1416
1416
|
if (r.includes(o.type.name) || r.includes(o.type))
|
|
1417
1417
|
return a.push(o), !1;
|
|
1418
1418
|
}), a;
|
|
1419
|
-
},
|
|
1419
|
+
}, pr = (t) => t.split(`
|
|
1420
1420
|
|
|
1421
|
-
`)[0] || "",
|
|
1421
|
+
`)[0] || "", gr = (t) => t.childCount === 1 && t.child(0).type.name === "html", xt = (t, e) => {
|
|
1422
1422
|
try {
|
|
1423
|
-
const r =
|
|
1424
|
-
return !
|
|
1425
|
-
var
|
|
1426
|
-
const m = c.marks.find((
|
|
1427
|
-
m && ((
|
|
1423
|
+
const r = ur(t, e), a = ir(e), o = cr(t, e, a, r), [s, i] = dr(t, o), l = mr(t, s);
|
|
1424
|
+
return !l || a.type !== l.type || gr(l) ? null : (l.attrs = { ...a.attrs }, l.descendants((c) => {
|
|
1425
|
+
var g, u, k;
|
|
1426
|
+
const m = c.marks.find((p) => p.type.name === "link");
|
|
1427
|
+
m && ((g = c.text) != null && g.includes(i)) && m.attrs.href.includes(i) && (m.attrs.href = m.attrs.href.replace(i, "")), ((u = c.text) != null && u.includes(te) || (k = c.text) != null && k.includes(ae)) && (c.text = c.text.replaceAll(te, ee).replaceAll(ae, re));
|
|
1428
1428
|
}), {
|
|
1429
|
-
text:
|
|
1429
|
+
text: pr(s),
|
|
1430
1430
|
prevNode: a,
|
|
1431
|
-
nextNode:
|
|
1432
|
-
placeholder:
|
|
1431
|
+
nextNode: l,
|
|
1432
|
+
placeholder: i
|
|
1433
1433
|
});
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
return null;
|
|
1436
1436
|
}
|
|
1437
|
-
},
|
|
1437
|
+
}, yr = (t, e, r, a, o) => {
|
|
1438
1438
|
var L;
|
|
1439
|
-
const { placeholderConfig: s } = t.get(
|
|
1440
|
-
let
|
|
1441
|
-
const c = r.apply(
|
|
1439
|
+
const { placeholderConfig: s } = t.get(_.key), i = s.hole;
|
|
1440
|
+
let l = r.tr.setMeta(e, !0).insertText(i, r.selection.from);
|
|
1441
|
+
const c = r.apply(l), d = xt(t, c);
|
|
1442
1442
|
if (!d)
|
|
1443
1443
|
return;
|
|
1444
|
-
const m = d.text.slice(0, d.text.indexOf(d.placeholder)), { $from:
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
}), a(
|
|
1448
|
-
},
|
|
1444
|
+
const m = d.text.slice(0, d.text.indexOf(d.placeholder)), { $from: g } = c.selection, u = g.before(), k = g.after(), p = sr(d.nextNode, u, d.placeholder);
|
|
1445
|
+
l = l.replaceWith(u, k, d.nextNode).setNodeMarkup(u, void 0, o).delete(p + 1, p + 2), l = l.setSelection(G.near(l.doc.resolve(p + 1))), (Xt.test(m) || ["*", "_", "~"].includes(m.at(-1) || "")) && l.selection instanceof G && (((L = l.selection.$cursor) == null ? void 0 : L.marks()) ?? []).forEach((J) => {
|
|
1446
|
+
l = l.removeStoredMark(J.type);
|
|
1447
|
+
}), a(l);
|
|
1448
|
+
}, St = O((t) => {
|
|
1449
1449
|
let e = null;
|
|
1450
1450
|
const r = new T("MILKDOWN_INLINE_SYNC");
|
|
1451
|
-
return new
|
|
1451
|
+
return new R({
|
|
1452
1452
|
key: r,
|
|
1453
1453
|
state: {
|
|
1454
1454
|
init: () => null,
|
|
1455
|
-
apply: (a, o, s,
|
|
1456
|
-
var
|
|
1457
|
-
const
|
|
1458
|
-
if (!((
|
|
1455
|
+
apply: (a, o, s, i) => {
|
|
1456
|
+
var p;
|
|
1457
|
+
const l = t.get(X);
|
|
1458
|
+
if (!((p = l.hasFocus) != null && p.call(l)) || !l.editable || !a.docChanged || a.getMeta(r))
|
|
1459
1459
|
return null;
|
|
1460
|
-
const d =
|
|
1460
|
+
const d = xt(t, i);
|
|
1461
1461
|
if (!d)
|
|
1462
1462
|
return null;
|
|
1463
1463
|
e && (cancelAnimationFrame(e), e = null);
|
|
1464
|
-
const { prevNode: m, nextNode:
|
|
1465
|
-
return k({ prevNode: m, nextNode:
|
|
1464
|
+
const { prevNode: m, nextNode: g, text: u } = d, { shouldSyncNode: k } = t.get(_.key);
|
|
1465
|
+
return k({ prevNode: m, nextNode: g, ctx: t, tr: a, text: u }) && (e = requestAnimationFrame(() => {
|
|
1466
1466
|
e = null;
|
|
1467
1467
|
const { dispatch: f, state: L } = t.get(X);
|
|
1468
|
-
|
|
1468
|
+
yr(t, r, L, f, m.attrs);
|
|
1469
1469
|
})), null;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
});
|
|
1473
1473
|
});
|
|
1474
|
-
n(
|
|
1474
|
+
n(St, {
|
|
1475
1475
|
displayName: "Prose<inlineSyncPlugin>",
|
|
1476
1476
|
group: "Prose"
|
|
1477
1477
|
});
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1478
|
+
const Ze = $("remarkAddOrderInList", () => () => (t) => {
|
|
1479
|
+
ie(t, "list", (e) => {
|
|
1480
1480
|
if (e.ordered) {
|
|
1481
1481
|
const r = e.start ?? 1;
|
|
1482
1482
|
e.children.forEach((a, o) => {
|
|
@@ -1485,78 +1485,98 @@ const kt = $(() => () => (t) => {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
});
|
|
1487
1487
|
});
|
|
1488
|
-
n(
|
|
1488
|
+
n(Ze.plugin, {
|
|
1489
1489
|
displayName: "Remark<remarkAddOrderInListPlugin>",
|
|
1490
1490
|
group: "Remark"
|
|
1491
1491
|
});
|
|
1492
|
-
|
|
1492
|
+
n(Ze.options, {
|
|
1493
|
+
displayName: "RemarkConfig<remarkAddOrderInListPlugin>",
|
|
1494
|
+
group: "Remark"
|
|
1495
|
+
});
|
|
1496
|
+
const Je = $("remarkLineBreak", () => () => (t) => {
|
|
1493
1497
|
const e = /[\t ]*(?:\r?\n|\r)/g;
|
|
1494
|
-
|
|
1498
|
+
ie(t, "text", (r, a, o) => {
|
|
1495
1499
|
if (!r.value || typeof r.value != "string")
|
|
1496
1500
|
return;
|
|
1497
1501
|
const s = [];
|
|
1498
|
-
let
|
|
1502
|
+
let i = 0;
|
|
1499
1503
|
e.lastIndex = 0;
|
|
1500
|
-
let
|
|
1501
|
-
for (;
|
|
1502
|
-
const d =
|
|
1503
|
-
|
|
1504
|
+
let l = e.exec(r.value);
|
|
1505
|
+
for (; l; ) {
|
|
1506
|
+
const d = l.index;
|
|
1507
|
+
i !== d && s.push({ type: "text", value: r.value.slice(i, d) }), s.push({ type: "break", data: { isInline: !0 } }), i = d + l[0].length, l = e.exec(r.value);
|
|
1504
1508
|
}
|
|
1505
1509
|
if (s.length > 0 && o && typeof a == "number")
|
|
1506
|
-
return
|
|
1510
|
+
return i < r.value.length && s.push({ type: "text", value: r.value.slice(i) }), o.children.splice(a, 1, ...s), a + s.length;
|
|
1507
1511
|
});
|
|
1508
1512
|
});
|
|
1509
|
-
n(
|
|
1513
|
+
n(Je.plugin, {
|
|
1510
1514
|
displayName: "Remark<remarkLineBreak>",
|
|
1511
1515
|
group: "Remark"
|
|
1512
1516
|
});
|
|
1513
|
-
|
|
1514
|
-
|
|
1517
|
+
n(Je.options, {
|
|
1518
|
+
displayName: "RemarkConfig<remarkLineBreak>",
|
|
1519
|
+
group: "Remark"
|
|
1520
|
+
});
|
|
1521
|
+
const Qe = $("remarkInlineLink", () => Ft);
|
|
1522
|
+
n(Qe.plugin, {
|
|
1515
1523
|
displayName: "Remark<remarkInlineLinkPlugin>",
|
|
1516
1524
|
group: "Remark"
|
|
1517
1525
|
});
|
|
1518
|
-
|
|
1519
|
-
|
|
1526
|
+
n(Qe.options, {
|
|
1527
|
+
displayName: "RemarkConfig<remarkInlineLinkPlugin>",
|
|
1528
|
+
group: "Remark"
|
|
1529
|
+
});
|
|
1530
|
+
const hr = (t) => !!t.children, kr = (t) => t.type === "html";
|
|
1531
|
+
function fr(t, e) {
|
|
1520
1532
|
return r(t, 0, null)[0];
|
|
1521
1533
|
function r(a, o, s) {
|
|
1522
|
-
if (
|
|
1523
|
-
const
|
|
1524
|
-
for (let
|
|
1525
|
-
const d = a.children[
|
|
1534
|
+
if (hr(a)) {
|
|
1535
|
+
const i = [];
|
|
1536
|
+
for (let l = 0, c = a.children.length; l < c; l++) {
|
|
1537
|
+
const d = a.children[l];
|
|
1526
1538
|
if (d) {
|
|
1527
|
-
const m = r(d,
|
|
1539
|
+
const m = r(d, l, a);
|
|
1528
1540
|
if (m)
|
|
1529
|
-
for (let
|
|
1530
|
-
const k = m[
|
|
1531
|
-
k &&
|
|
1541
|
+
for (let g = 0, u = m.length; g < u; g++) {
|
|
1542
|
+
const k = m[g];
|
|
1543
|
+
k && i.push(k);
|
|
1532
1544
|
}
|
|
1533
1545
|
}
|
|
1534
1546
|
}
|
|
1535
|
-
a.children =
|
|
1547
|
+
a.children = i;
|
|
1536
1548
|
}
|
|
1537
1549
|
return e(a, o, s);
|
|
1538
1550
|
}
|
|
1539
1551
|
}
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1552
|
+
const Xe = $("remarkHTMLTransformer", () => () => (t) => {
|
|
1553
|
+
fr(t, (e, r, a) => kr(e) ? ((a == null ? void 0 : a.type) === "root" && (e.children = [{ ...e }], delete e.value, e.type = "paragraph"), [e]) : [e]);
|
|
1542
1554
|
});
|
|
1543
|
-
n(
|
|
1555
|
+
n(Xe.plugin, {
|
|
1544
1556
|
displayName: "Remark<remarkHtmlTransformer>",
|
|
1545
1557
|
group: "Remark"
|
|
1546
1558
|
});
|
|
1547
|
-
|
|
1559
|
+
n(Xe.options, {
|
|
1560
|
+
displayName: "RemarkConfig<remarkHtmlTransformer>",
|
|
1561
|
+
group: "Remark"
|
|
1562
|
+
});
|
|
1563
|
+
const et = $("remarkMarker", () => () => (t, e) => {
|
|
1548
1564
|
const r = (a) => e.value.charAt(a.position.start.offset);
|
|
1549
|
-
|
|
1565
|
+
ie(t, (a) => ["strong", "emphasis"].includes(a.type), (a) => {
|
|
1550
1566
|
a.marker = r(a);
|
|
1551
1567
|
});
|
|
1552
1568
|
});
|
|
1553
|
-
n(
|
|
1569
|
+
n(et.plugin, {
|
|
1554
1570
|
displayName: "Remark<remarkMarker>",
|
|
1555
1571
|
group: "Remark"
|
|
1556
1572
|
});
|
|
1557
|
-
|
|
1573
|
+
n(et.options, {
|
|
1574
|
+
displayName: "RemarkConfig<remarkMarker>",
|
|
1575
|
+
group: "Remark"
|
|
1576
|
+
});
|
|
1577
|
+
const wt = O(() => {
|
|
1558
1578
|
let t = !1;
|
|
1559
|
-
const e = new T("MILKDOWN_INLINE_NODES_CURSOR"), r = new
|
|
1579
|
+
const e = new T("MILKDOWN_INLINE_NODES_CURSOR"), r = new R({
|
|
1560
1580
|
key: e,
|
|
1561
1581
|
state: {
|
|
1562
1582
|
init() {
|
|
@@ -1565,47 +1585,47 @@ const Mt = O(() => {
|
|
|
1565
1585
|
apply(a) {
|
|
1566
1586
|
if (!a.selection.empty)
|
|
1567
1587
|
return !1;
|
|
1568
|
-
const o = a.selection.$from, s = o.nodeBefore,
|
|
1569
|
-
return !!(s &&
|
|
1588
|
+
const o = a.selection.$from, s = o.nodeBefore, i = o.nodeAfter;
|
|
1589
|
+
return !!(s && i && s.isInline && !s.isText && i.isInline && !i.isText);
|
|
1570
1590
|
}
|
|
1571
1591
|
},
|
|
1572
1592
|
props: {
|
|
1573
1593
|
handleDOMEvents: {
|
|
1574
1594
|
compositionend: (a, o) => t ? (t = !1, requestAnimationFrame(() => {
|
|
1575
1595
|
if (r.getState(a.state)) {
|
|
1576
|
-
const
|
|
1577
|
-
o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "",
|
|
1596
|
+
const i = a.state.selection.from;
|
|
1597
|
+
o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "", i));
|
|
1578
1598
|
}
|
|
1579
1599
|
}), !0) : !1,
|
|
1580
1600
|
compositionstart: (a) => (r.getState(a.state) && (t = !0), !1),
|
|
1581
1601
|
beforeinput: (a, o) => {
|
|
1582
1602
|
if (r.getState(a.state) && o instanceof InputEvent && o.data && !t) {
|
|
1583
|
-
const
|
|
1584
|
-
return o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "",
|
|
1603
|
+
const i = a.state.selection.from;
|
|
1604
|
+
return o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "", i)), !0;
|
|
1585
1605
|
}
|
|
1586
1606
|
return !1;
|
|
1587
1607
|
}
|
|
1588
1608
|
},
|
|
1589
1609
|
decorations(a) {
|
|
1590
1610
|
if (r.getState(a)) {
|
|
1591
|
-
const
|
|
1611
|
+
const i = a.selection.$from.pos, l = document.createElement("span"), c = at.widget(i, l, {
|
|
1592
1612
|
side: -1
|
|
1593
|
-
}), d = document.createElement("span"), m =
|
|
1613
|
+
}), d = document.createElement("span"), m = at.widget(i, d);
|
|
1594
1614
|
return setTimeout(() => {
|
|
1595
|
-
|
|
1596
|
-
}),
|
|
1615
|
+
l.contentEditable = "true", d.contentEditable = "true";
|
|
1616
|
+
}), nt.create(a.doc, [c, m]);
|
|
1597
1617
|
}
|
|
1598
|
-
return
|
|
1618
|
+
return nt.empty;
|
|
1599
1619
|
}
|
|
1600
1620
|
}
|
|
1601
1621
|
});
|
|
1602
1622
|
return r;
|
|
1603
1623
|
});
|
|
1604
|
-
n(
|
|
1624
|
+
n(wt, {
|
|
1605
1625
|
displayName: "Prose<inlineNodesCursorPlugin>",
|
|
1606
1626
|
group: "Prose"
|
|
1607
1627
|
});
|
|
1608
|
-
const
|
|
1628
|
+
const At = O((t) => new R({
|
|
1609
1629
|
key: new T("MILKDOWN_HARDBREAK_MARKS"),
|
|
1610
1630
|
appendTransaction: (e, r, a) => {
|
|
1611
1631
|
if (!e.length)
|
|
@@ -1615,69 +1635,69 @@ const bt = O((t) => new K({
|
|
|
1615
1635
|
return;
|
|
1616
1636
|
const [s] = o.steps;
|
|
1617
1637
|
if (o.getMeta("hardbreak")) {
|
|
1618
|
-
if (!(s instanceof
|
|
1638
|
+
if (!(s instanceof qt))
|
|
1619
1639
|
return;
|
|
1620
1640
|
const { from: c } = s;
|
|
1621
1641
|
return a.tr.setNodeMarkup(c, S.type(t), void 0, []);
|
|
1622
1642
|
}
|
|
1623
|
-
if (s instanceof
|
|
1643
|
+
if (s instanceof Wt) {
|
|
1624
1644
|
let c = a.tr;
|
|
1625
1645
|
const { from: d, to: m } = s;
|
|
1626
|
-
return a.doc.nodesBetween(d, m, (
|
|
1627
|
-
|
|
1646
|
+
return a.doc.nodesBetween(d, m, (g, u) => {
|
|
1647
|
+
g.type === S.type(t) && (c = c.setNodeMarkup(u, S.type(t), void 0, []));
|
|
1628
1648
|
}), c;
|
|
1629
1649
|
}
|
|
1630
1650
|
}
|
|
1631
1651
|
}));
|
|
1632
|
-
n(
|
|
1652
|
+
n(At, {
|
|
1633
1653
|
displayName: "Prose<hardbreakClearMarkPlugin>",
|
|
1634
1654
|
group: "Prose"
|
|
1635
1655
|
});
|
|
1636
|
-
const
|
|
1637
|
-
n(
|
|
1656
|
+
const tt = ne(["table", "code_block"], "hardbreakFilterNodes");
|
|
1657
|
+
n(tt, {
|
|
1638
1658
|
displayName: "Ctx<hardbreakFilterNodes>",
|
|
1639
1659
|
group: "Prose"
|
|
1640
1660
|
});
|
|
1641
|
-
const
|
|
1642
|
-
const e = t.get(
|
|
1643
|
-
return new
|
|
1661
|
+
const vt = O((t) => {
|
|
1662
|
+
const e = t.get(tt.key);
|
|
1663
|
+
return new R({
|
|
1644
1664
|
key: new T("MILKDOWN_HARDBREAK_FILTER"),
|
|
1645
1665
|
filterTransaction: (r, a) => {
|
|
1646
1666
|
const o = r.getMeta("hardbreak"), [s] = r.steps;
|
|
1647
1667
|
if (o && s) {
|
|
1648
|
-
const { from:
|
|
1649
|
-
let c =
|
|
1668
|
+
const { from: i } = s, l = a.doc.resolve(i);
|
|
1669
|
+
let c = l.depth, d = !0;
|
|
1650
1670
|
for (; c > 0; )
|
|
1651
|
-
e.includes(
|
|
1671
|
+
e.includes(l.node(c).type.name) && (d = !1), c--;
|
|
1652
1672
|
return d;
|
|
1653
1673
|
}
|
|
1654
1674
|
return !0;
|
|
1655
1675
|
}
|
|
1656
1676
|
});
|
|
1657
1677
|
});
|
|
1658
|
-
n(
|
|
1678
|
+
n(vt, {
|
|
1659
1679
|
displayName: "Prose<hardbreakFilterPlugin>",
|
|
1660
1680
|
group: "Prose"
|
|
1661
1681
|
});
|
|
1662
|
-
const
|
|
1682
|
+
const Ht = O((t) => {
|
|
1663
1683
|
const e = new T("MILKDOWN_HEADING_ID"), r = (a) => {
|
|
1664
1684
|
if (a.composing || !a.editable)
|
|
1665
1685
|
return;
|
|
1666
1686
|
const o = t.get(Y.key), s = a.state.tr.setMeta("addToHistory", !1);
|
|
1667
|
-
let
|
|
1668
|
-
a.state.doc.descendants((
|
|
1669
|
-
if (
|
|
1670
|
-
if (
|
|
1687
|
+
let i = !1;
|
|
1688
|
+
a.state.doc.descendants((l, c) => {
|
|
1689
|
+
if (l.type === H.type(t)) {
|
|
1690
|
+
if (l.textContent.trim().length === 0)
|
|
1671
1691
|
return;
|
|
1672
|
-
const d =
|
|
1673
|
-
d.id !== m && (
|
|
1692
|
+
const d = l.attrs, m = o(l);
|
|
1693
|
+
d.id !== m && (i = !0, s.setMeta(e, !0).setNodeMarkup(c, void 0, {
|
|
1674
1694
|
...d,
|
|
1675
1695
|
id: m
|
|
1676
1696
|
}));
|
|
1677
1697
|
}
|
|
1678
|
-
}),
|
|
1698
|
+
}), i && a.dispatch(s);
|
|
1679
1699
|
};
|
|
1680
|
-
return new
|
|
1700
|
+
return new R({
|
|
1681
1701
|
key: e,
|
|
1682
1702
|
view: (a) => (r(a), {
|
|
1683
1703
|
update: (o) => {
|
|
@@ -1686,38 +1706,38 @@ const xt = O((t) => {
|
|
|
1686
1706
|
})
|
|
1687
1707
|
});
|
|
1688
1708
|
});
|
|
1689
|
-
n(
|
|
1709
|
+
n(Ht, {
|
|
1690
1710
|
displayName: "Prose<syncHeadingIdPlugin>",
|
|
1691
1711
|
group: "Prose"
|
|
1692
1712
|
});
|
|
1693
|
-
const
|
|
1713
|
+
const Bt = O((t) => {
|
|
1694
1714
|
const e = (r) => {
|
|
1695
1715
|
if (r.composing || !r.editable)
|
|
1696
1716
|
return;
|
|
1697
|
-
const a = P.type(t), o =
|
|
1717
|
+
const a = P.type(t), o = D.type(t), s = M.type(t), i = r.state, l = (m, g) => {
|
|
1698
1718
|
let u = !1;
|
|
1699
|
-
const k = `${
|
|
1719
|
+
const k = `${g + 1}.`;
|
|
1700
1720
|
return m.label !== k && (m.label = k, u = !0), u;
|
|
1701
1721
|
};
|
|
1702
|
-
let c =
|
|
1703
|
-
|
|
1722
|
+
let c = i.tr, d = !1;
|
|
1723
|
+
i.doc.descendants((m, g, u, k) => {
|
|
1704
1724
|
if (m.type === o) {
|
|
1705
|
-
const
|
|
1706
|
-
(
|
|
1725
|
+
const p = m.maybeChild(0);
|
|
1726
|
+
(p == null ? void 0 : p.type) === s && p.attrs.listType === "ordered" && (d = !0, c.setNodeMarkup(g, a, { spread: "true" }), m.descendants((f, L, Ot, J) => {
|
|
1707
1727
|
if (f.type === s) {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1728
|
+
const rt = { ...f.attrs };
|
|
1729
|
+
l(rt, J) && (c = c.setNodeMarkup(L, void 0, rt));
|
|
1710
1730
|
}
|
|
1711
1731
|
return !1;
|
|
1712
1732
|
}));
|
|
1713
1733
|
} else if (m.type === s && (u == null ? void 0 : u.type) === a) {
|
|
1714
|
-
const
|
|
1734
|
+
const p = { ...m.attrs };
|
|
1715
1735
|
let f = !1;
|
|
1716
|
-
|
|
1736
|
+
p.listType !== "ordered" && (p.listType = "ordered", f = !0), (u == null ? void 0 : u.maybeChild(0)) && (f = l(p, k)), f && (c = c.setNodeMarkup(g, void 0, p), d = !0);
|
|
1717
1737
|
}
|
|
1718
1738
|
}), d && r.dispatch(c.setMeta("addToHistory", !1));
|
|
1719
1739
|
};
|
|
1720
|
-
return new
|
|
1740
|
+
return new R({
|
|
1721
1741
|
key: new T("MILKDOWN_KEEP_LIST_ORDER"),
|
|
1722
1742
|
view: (r) => (e(r), {
|
|
1723
1743
|
update: (a) => {
|
|
@@ -1726,117 +1746,117 @@ const St = O((t) => {
|
|
|
1726
1746
|
})
|
|
1727
1747
|
});
|
|
1728
1748
|
});
|
|
1729
|
-
n(
|
|
1749
|
+
n(Bt, {
|
|
1730
1750
|
displayName: "Prose<syncListOrderPlugin>",
|
|
1731
1751
|
group: "Prose"
|
|
1732
1752
|
});
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
],
|
|
1753
|
+
const Nr = [
|
|
1754
|
+
_,
|
|
1755
|
+
St,
|
|
1756
|
+
At,
|
|
1757
|
+
tt,
|
|
1758
|
+
vt,
|
|
1759
|
+
wt,
|
|
1760
|
+
Ze,
|
|
1761
|
+
Qe,
|
|
1762
|
+
Je,
|
|
1763
|
+
Xe,
|
|
1764
|
+
et,
|
|
1765
|
+
Ht,
|
|
1766
|
+
Bt
|
|
1767
|
+
].flat(), Kr = [Yt, Zt, Jt, Qt, Nr].flat();
|
|
1748
1768
|
export {
|
|
1749
|
-
|
|
1750
|
-
|
|
1769
|
+
xe as blockquoteAttr,
|
|
1770
|
+
we as blockquoteKeymap,
|
|
1751
1771
|
q as blockquoteSchema,
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1772
|
+
De as bulletListAttr,
|
|
1773
|
+
_e as bulletListKeymap,
|
|
1774
|
+
D as bulletListSchema,
|
|
1775
|
+
Ae as codeBlockAttr,
|
|
1776
|
+
He as codeBlockKeymap,
|
|
1757
1777
|
W as codeBlockSchema,
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1778
|
+
Jt as commands,
|
|
1779
|
+
Kr as commonmark,
|
|
1780
|
+
ve as createCodeBlockCommand,
|
|
1781
|
+
kt as createCodeBlockInputRule,
|
|
1782
|
+
lr as defaultConfig,
|
|
1783
|
+
gt as docSchema,
|
|
1784
|
+
be as downgradeHeadingCommand,
|
|
1785
|
+
ce as emphasisAttr,
|
|
1786
|
+
me as emphasisKeymap,
|
|
1767
1787
|
z as emphasisSchema,
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1788
|
+
Oe as hardbreakAttr,
|
|
1789
|
+
At as hardbreakClearMarkPlugin,
|
|
1790
|
+
tt as hardbreakFilterNodes,
|
|
1791
|
+
vt as hardbreakFilterPlugin,
|
|
1792
|
+
Re as hardbreakKeymap,
|
|
1773
1793
|
S as hardbreakSchema,
|
|
1774
|
-
|
|
1794
|
+
Me as headingAttr,
|
|
1775
1795
|
Y as headingIdGenerator,
|
|
1776
|
-
|
|
1796
|
+
Le as headingKeymap,
|
|
1777
1797
|
H as headingSchema,
|
|
1778
|
-
|
|
1798
|
+
Ke as hrAttr,
|
|
1779
1799
|
F as hrSchema,
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1800
|
+
Ue as htmlAttr,
|
|
1801
|
+
Ye as htmlSchema,
|
|
1802
|
+
Be as imageAttr,
|
|
1803
|
+
K as imageSchema,
|
|
1804
|
+
ye as inlineCodeAttr,
|
|
1805
|
+
ke as inlineCodeKeymap,
|
|
1786
1806
|
x as inlineCodeSchema,
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1807
|
+
wt as inlineNodesCursorPlugin,
|
|
1808
|
+
_ as inlineSyncConfig,
|
|
1809
|
+
St as inlineSyncPlugin,
|
|
1810
|
+
Zt as inputrules,
|
|
1811
|
+
Te as insertHardbreakCommand,
|
|
1812
|
+
Ct as insertHrCommand,
|
|
1813
|
+
It as insertHrInputRule,
|
|
1814
|
+
ft as insertImageCommand,
|
|
1815
|
+
zt as insertImageInputRule,
|
|
1816
|
+
Qt as keymap,
|
|
1817
|
+
je as liftFirstListItemCommand,
|
|
1818
|
+
Ge as liftListItemCommand,
|
|
1819
|
+
fe as linkAttr,
|
|
1800
1820
|
B as linkSchema,
|
|
1801
|
-
|
|
1802
|
-
|
|
1821
|
+
We as listItemAttr,
|
|
1822
|
+
ze as listItemKeymap,
|
|
1803
1823
|
M as listItemSchema,
|
|
1804
|
-
|
|
1805
|
-
|
|
1824
|
+
Ee as orderedListAttr,
|
|
1825
|
+
qe as orderedListKeymap,
|
|
1806
1826
|
P as orderedListSchema,
|
|
1807
|
-
|
|
1808
|
-
|
|
1827
|
+
Ne as paragraphAttr,
|
|
1828
|
+
Ce as paragraphKeymap,
|
|
1809
1829
|
v as paragraphSchema,
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1830
|
+
Nr as plugins,
|
|
1831
|
+
Ze as remarkAddOrderInListPlugin,
|
|
1832
|
+
Xe as remarkHtmlTransformer,
|
|
1833
|
+
Qe as remarkInlineLinkPlugin,
|
|
1834
|
+
Je as remarkLineBreak,
|
|
1835
|
+
et as remarkMarker,
|
|
1836
|
+
Yt as schema,
|
|
1837
|
+
Fe as sinkListItemCommand,
|
|
1838
|
+
Ve as splitListItemCommand,
|
|
1839
|
+
ue as strongAttr,
|
|
1840
|
+
ge as strongKeymap,
|
|
1821
1841
|
U as strongSchema,
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1842
|
+
Ht as syncHeadingIdPlugin,
|
|
1843
|
+
Bt as syncListOrderPlugin,
|
|
1844
|
+
Lt as textSchema,
|
|
1845
|
+
de as toggleEmphasisCommand,
|
|
1846
|
+
he as toggleInlineCodeCommand,
|
|
1847
|
+
ut as toggleLinkCommand,
|
|
1848
|
+
pe as toggleStrongCommand,
|
|
1849
|
+
Ie as turnIntoTextCommand,
|
|
1850
|
+
jt as updateCodeBlockLanguageCommand,
|
|
1851
|
+
Nt as updateImageCommand,
|
|
1852
|
+
pt as updateLinkCommand,
|
|
1853
|
+
Se as wrapInBlockquoteCommand,
|
|
1854
|
+
ht as wrapInBlockquoteInputRule,
|
|
1855
|
+
Pe as wrapInBulletListCommand,
|
|
1856
|
+
Mt as wrapInBulletListInputRule,
|
|
1837
1857
|
b as wrapInHeadingCommand,
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1858
|
+
yt as wrapInHeadingInputRule,
|
|
1859
|
+
$e as wrapInOrderedListCommand,
|
|
1860
|
+
bt as wrapInOrderedListInputRule
|
|
1841
1861
|
};
|
|
1842
1862
|
//# sourceMappingURL=index.es.js.map
|