@milkdown/preset-commonmark 7.2.4 → 7.3.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/lib/composed/plugins.d.ts.map +1 -1
- package/lib/index.es.js +561 -539
- package/lib/index.es.js.map +1 -1
- package/lib/node/hardbreak.d.ts.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 +10 -11
- package/src/composed/plugins.ts +1 -1
- package/src/node/hardbreak.ts +5 -2
- 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 q } 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
|
|
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 $, 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 $(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,110 +417,110 @@ 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
|
});
|
|
518
|
-
const
|
|
518
|
+
const W = C("blockquote", (t) => ({
|
|
519
519
|
content: "block+",
|
|
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) => {
|
|
@@ -534,50 +534,50 @@ const q = C("blockquote", (t) => ({
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
}));
|
|
537
|
-
n(
|
|
537
|
+
n(W.node, {
|
|
538
538
|
displayName: "NodeSchema<blockquote>",
|
|
539
539
|
group: "Blockquote"
|
|
540
540
|
});
|
|
541
|
-
n(
|
|
541
|
+
n(W.ctx, {
|
|
542
542
|
displayName: "NodeSchemaCtx<blockquote>",
|
|
543
543
|
group: "Blockquote"
|
|
544
544
|
});
|
|
545
|
-
const
|
|
546
|
-
n(
|
|
545
|
+
const ht = w((t) => le(/^\s*>\s$/, W.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(W.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
|
});
|
|
580
|
-
const
|
|
580
|
+
const F = C("code_block", (t) => ({
|
|
581
581
|
content: "text*",
|
|
582
582
|
group: "block",
|
|
583
583
|
marks: "",
|
|
@@ -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
|
{
|
|
@@ -627,57 +627,57 @@ const W = C("code_block", (t) => ({
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
}));
|
|
630
|
-
n(
|
|
630
|
+
n(F.node, {
|
|
631
631
|
displayName: "NodeSchema<codeBlock>",
|
|
632
632
|
group: "CodeBlock"
|
|
633
633
|
});
|
|
634
|
-
n(
|
|
634
|
+
n(F.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]$/, F.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(F.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,50 @@ 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
|
+
if (!(a instanceof $))
|
|
818
|
+
return !1;
|
|
817
819
|
if (a.empty) {
|
|
818
|
-
const
|
|
819
|
-
if (
|
|
820
|
+
const i = a.$from.node();
|
|
821
|
+
if (i.childCount > 0 && ((s = i.lastChild) == null ? void 0 : s.type.name) === "hardbreak")
|
|
820
822
|
return r == null || r(
|
|
821
|
-
o.replaceRangeWith(a.to - 1, a.to, e.schema.node("paragraph")).setSelection(
|
|
823
|
+
o.replaceRangeWith(a.to - 1, a.to, e.schema.node("paragraph")).setSelection(ct.near(o.doc.resolve(a.to))).scrollIntoView()
|
|
822
824
|
), !0;
|
|
823
825
|
}
|
|
824
826
|
return r == null || r(o.setMeta("hardbreak", !0).replaceSelectionWith(S.type(t).create()).scrollIntoView()), !0;
|
|
825
827
|
});
|
|
826
|
-
n(
|
|
828
|
+
n(Te, {
|
|
827
829
|
displayName: "Command<insertHardbreakCommand>",
|
|
828
830
|
group: "Hardbreak"
|
|
829
831
|
});
|
|
830
|
-
const
|
|
832
|
+
const Re = N("hardbreakKeymap", {
|
|
831
833
|
InsertHardbreak: {
|
|
832
834
|
shortcuts: "Shift-Enter",
|
|
833
835
|
command: (t) => {
|
|
834
|
-
const e = t.get(
|
|
835
|
-
return () => e.call(
|
|
836
|
+
const e = t.get(h);
|
|
837
|
+
return () => e.call(Te.key);
|
|
836
838
|
}
|
|
837
839
|
}
|
|
838
840
|
});
|
|
839
|
-
n(
|
|
841
|
+
n(Re.ctx, {
|
|
840
842
|
displayName: "KeymapCtx<hardbreak>",
|
|
841
843
|
group: "Hardbreak"
|
|
842
844
|
});
|
|
843
|
-
n(
|
|
845
|
+
n(Re.shortcuts, {
|
|
844
846
|
displayName: "Keymap<hardbreak>",
|
|
845
847
|
group: "Hardbreak"
|
|
846
848
|
});
|
|
847
|
-
const
|
|
848
|
-
n(
|
|
849
|
+
const Ke = I("hr");
|
|
850
|
+
n(Ke, {
|
|
849
851
|
displayName: "Attr<hr>",
|
|
850
852
|
group: "Hr"
|
|
851
853
|
});
|
|
852
|
-
const
|
|
854
|
+
const G = C("hr", (t) => ({
|
|
853
855
|
group: "block",
|
|
854
856
|
parseDOM: [{ tag: "hr" }],
|
|
855
|
-
toDOM: (e) => ["hr", t.get(
|
|
857
|
+
toDOM: (e) => ["hr", t.get(Ke.key)(e)],
|
|
856
858
|
parseMarkdown: {
|
|
857
859
|
match: ({ type: e }) => e === "thematicBreak",
|
|
858
860
|
runner: (e, r, a) => {
|
|
@@ -866,44 +868,44 @@ const F = C("hr", (t) => ({
|
|
|
866
868
|
}
|
|
867
869
|
}
|
|
868
870
|
}));
|
|
869
|
-
n(
|
|
871
|
+
n(G.node, {
|
|
870
872
|
displayName: "NodeSchema<hr>",
|
|
871
873
|
group: "Hr"
|
|
872
874
|
});
|
|
873
|
-
n(
|
|
875
|
+
n(G.ctx, {
|
|
874
876
|
displayName: "NodeSchemaCtx<hr>",
|
|
875
877
|
group: "Hr"
|
|
876
878
|
});
|
|
877
|
-
const
|
|
879
|
+
const It = w((t) => new it(
|
|
878
880
|
/^(?:---|___\s|\*\*\*\s)$/,
|
|
879
881
|
(e, r, a, o) => {
|
|
880
882
|
const { tr: s } = e;
|
|
881
|
-
return r[0] && s.replaceWith(a - 1, o,
|
|
883
|
+
return r[0] && s.replaceWith(a - 1, o, G.type(t).create()), s;
|
|
882
884
|
}
|
|
883
885
|
));
|
|
884
|
-
n(
|
|
886
|
+
n(It, {
|
|
885
887
|
displayName: "InputRule<insertHrInputRule>",
|
|
886
888
|
group: "Hr"
|
|
887
889
|
});
|
|
888
|
-
const
|
|
890
|
+
const Ct = y("InsertHr", (t) => () => (e, r) => {
|
|
889
891
|
if (!r)
|
|
890
892
|
return !0;
|
|
891
|
-
const a = v.node.type(t).create(), { tr: o, selection: s } = e, { from:
|
|
892
|
-
if (!
|
|
893
|
+
const a = v.node.type(t).create(), { tr: o, selection: s } = e, { from: i } = s, l = G.type(t).create();
|
|
894
|
+
if (!l)
|
|
893
895
|
return !0;
|
|
894
|
-
const c = o.replaceSelectionWith(
|
|
896
|
+
const c = o.replaceSelectionWith(l).insert(i, a), d = ct.findFrom(c.doc.resolve(i), 1, !0);
|
|
895
897
|
return d && r(c.setSelection(d).scrollIntoView()), !0;
|
|
896
898
|
});
|
|
897
|
-
n(
|
|
899
|
+
n(Ct, {
|
|
898
900
|
displayName: "Command<insertHrCommand>",
|
|
899
901
|
group: "Hr"
|
|
900
902
|
});
|
|
901
|
-
const
|
|
902
|
-
n(
|
|
903
|
+
const De = I("bulletList");
|
|
904
|
+
n(De, {
|
|
903
905
|
displayName: "Attr<bulletList>",
|
|
904
906
|
group: "BulletList"
|
|
905
907
|
});
|
|
906
|
-
const
|
|
908
|
+
const D = C("bullet_list", (t) => ({
|
|
907
909
|
content: "listItem+",
|
|
908
910
|
group: "block",
|
|
909
911
|
attrs: {
|
|
@@ -926,7 +928,7 @@ const R = C("bullet_list", (t) => ({
|
|
|
926
928
|
toDOM: (e) => [
|
|
927
929
|
"ul",
|
|
928
930
|
{
|
|
929
|
-
...t.get(
|
|
931
|
+
...t.get(De.key)(e),
|
|
930
932
|
"data-spread": e.attrs.spread
|
|
931
933
|
},
|
|
932
934
|
0
|
|
@@ -945,43 +947,43 @@ const R = C("bullet_list", (t) => ({
|
|
|
945
947
|
}
|
|
946
948
|
}
|
|
947
949
|
}));
|
|
948
|
-
n(
|
|
950
|
+
n(D.node, {
|
|
949
951
|
displayName: "NodeSchema<bulletList>",
|
|
950
952
|
group: "BulletList"
|
|
951
953
|
});
|
|
952
|
-
n(
|
|
954
|
+
n(D.ctx, {
|
|
953
955
|
displayName: "NodeSchemaCtx<bulletList>",
|
|
954
956
|
group: "BulletList"
|
|
955
957
|
});
|
|
956
|
-
const
|
|
957
|
-
n(
|
|
958
|
+
const Mt = w((t) => le(/^\s*([-+*])\s$/, D.type(t)));
|
|
959
|
+
n(Mt, {
|
|
958
960
|
displayName: "InputRule<wrapInBulletListInputRule>",
|
|
959
961
|
group: "BulletList"
|
|
960
962
|
});
|
|
961
|
-
const
|
|
962
|
-
n(
|
|
963
|
+
const Pe = y("WrapInBulletList", (t) => () => se(D.type(t)));
|
|
964
|
+
n(Pe, {
|
|
963
965
|
displayName: "Command<wrapInBulletListCommand>",
|
|
964
966
|
group: "BulletList"
|
|
965
967
|
});
|
|
966
|
-
const
|
|
968
|
+
const _e = N("bulletListKeymap", {
|
|
967
969
|
WrapInBulletList: {
|
|
968
970
|
shortcuts: "Mod-Alt-8",
|
|
969
971
|
command: (t) => {
|
|
970
|
-
const e = t.get(
|
|
971
|
-
return () => e.call(
|
|
972
|
+
const e = t.get(h);
|
|
973
|
+
return () => e.call(Pe.key);
|
|
972
974
|
}
|
|
973
975
|
}
|
|
974
976
|
});
|
|
975
|
-
n(
|
|
977
|
+
n(_e.ctx, {
|
|
976
978
|
displayName: "KeymapCtx<bulletListKeymap>",
|
|
977
979
|
group: "BulletList"
|
|
978
980
|
});
|
|
979
|
-
n(
|
|
981
|
+
n(_e.shortcuts, {
|
|
980
982
|
displayName: "Keymap<bulletListKeymap>",
|
|
981
983
|
group: "BulletList"
|
|
982
984
|
});
|
|
983
|
-
const
|
|
984
|
-
n(
|
|
985
|
+
const Ee = I("orderedList");
|
|
986
|
+
n(Ee, {
|
|
985
987
|
displayName: "Attr<orderedList>",
|
|
986
988
|
group: "OrderedList"
|
|
987
989
|
});
|
|
@@ -1012,7 +1014,7 @@ const P = C("ordered_list", (t) => ({
|
|
|
1012
1014
|
toDOM: (e) => [
|
|
1013
1015
|
"ol",
|
|
1014
1016
|
{
|
|
1015
|
-
...t.get(
|
|
1017
|
+
...t.get(Ee.key)(e),
|
|
1016
1018
|
...e.attrs.order === 1 ? {} : e.attrs.order,
|
|
1017
1019
|
"data-spread": e.attrs.spread
|
|
1018
1020
|
},
|
|
@@ -1040,40 +1042,40 @@ n(P.ctx, {
|
|
|
1040
1042
|
displayName: "NodeSchemaCtx<orderedList>",
|
|
1041
1043
|
group: "OrderedList"
|
|
1042
1044
|
});
|
|
1043
|
-
const
|
|
1045
|
+
const bt = w((t) => le(
|
|
1044
1046
|
/^\s*(\d+)\.\s$/,
|
|
1045
1047
|
P.type(t),
|
|
1046
1048
|
(e) => ({ order: Number(e[1]) }),
|
|
1047
1049
|
(e, r) => r.childCount + r.attrs.order === Number(e[1])
|
|
1048
1050
|
));
|
|
1049
|
-
n(
|
|
1051
|
+
n(bt, {
|
|
1050
1052
|
displayName: "InputRule<wrapInOrderedListInputRule>",
|
|
1051
1053
|
group: "OrderedList"
|
|
1052
1054
|
});
|
|
1053
|
-
const
|
|
1054
|
-
n(
|
|
1055
|
+
const $e = y("WrapInOrderedList", (t) => () => se(P.type(t)));
|
|
1056
|
+
n($e, {
|
|
1055
1057
|
displayName: "Command<wrapInOrderedListCommand>",
|
|
1056
1058
|
group: "OrderedList"
|
|
1057
1059
|
});
|
|
1058
|
-
const
|
|
1060
|
+
const qe = N("orderedListKeymap", {
|
|
1059
1061
|
WrapInOrderedList: {
|
|
1060
1062
|
shortcuts: "Mod-Alt-7",
|
|
1061
1063
|
command: (t) => {
|
|
1062
|
-
const e = t.get(
|
|
1063
|
-
return () => e.call(
|
|
1064
|
+
const e = t.get(h);
|
|
1065
|
+
return () => e.call($e.key);
|
|
1064
1066
|
}
|
|
1065
1067
|
}
|
|
1066
1068
|
});
|
|
1067
|
-
n(
|
|
1069
|
+
n(qe.ctx, {
|
|
1068
1070
|
displayName: "KeymapCtx<orderedList>",
|
|
1069
1071
|
group: "OrderedList"
|
|
1070
1072
|
});
|
|
1071
|
-
n(
|
|
1073
|
+
n(qe.shortcuts, {
|
|
1072
1074
|
displayName: "Keymap<orderedList>",
|
|
1073
1075
|
group: "OrderedList"
|
|
1074
1076
|
});
|
|
1075
|
-
const
|
|
1076
|
-
n(
|
|
1077
|
+
const We = I("listItem");
|
|
1078
|
+
n(We, {
|
|
1077
1079
|
displayName: "Attr<listItem>",
|
|
1078
1080
|
group: "ListItem"
|
|
1079
1081
|
});
|
|
@@ -1109,7 +1111,7 @@ const M = C("list_item", (t) => ({
|
|
|
1109
1111
|
toDOM: (e) => [
|
|
1110
1112
|
"li",
|
|
1111
1113
|
{
|
|
1112
|
-
...t.get(
|
|
1114
|
+
...t.get(We.key)(e),
|
|
1113
1115
|
"data-label": e.attrs.label,
|
|
1114
1116
|
"data-list-type": e.attrs.listType,
|
|
1115
1117
|
"data-spread": e.attrs.spread
|
|
@@ -1119,8 +1121,8 @@ const M = C("list_item", (t) => ({
|
|
|
1119
1121
|
parseMarkdown: {
|
|
1120
1122
|
match: ({ type: e }) => e === "listItem",
|
|
1121
1123
|
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:
|
|
1124
|
+
const o = r.label != null ? `${r.label}.` : "•", s = r.label != null ? "ordered" : "bullet", i = r.spread != null ? `${r.spread}` : "true";
|
|
1125
|
+
e.openNode(a, { label: o, listType: s, spread: i }), e.next(r.children), e.closeNode();
|
|
1124
1126
|
}
|
|
1125
1127
|
},
|
|
1126
1128
|
toMarkdown: {
|
|
@@ -1138,74 +1140,74 @@ n(M.ctx, {
|
|
|
1138
1140
|
displayName: "NodeSchemaCtx<listItem>",
|
|
1139
1141
|
group: "ListItem"
|
|
1140
1142
|
});
|
|
1141
|
-
const
|
|
1142
|
-
n(
|
|
1143
|
+
const Fe = y("SinkListItem", (t) => () => Et(M.type(t)));
|
|
1144
|
+
n(Fe, {
|
|
1143
1145
|
displayName: "Command<sinkListItemCommand>",
|
|
1144
1146
|
group: "ListItem"
|
|
1145
1147
|
});
|
|
1146
|
-
const
|
|
1147
|
-
n(
|
|
1148
|
+
const Ge = y("SplitListItem", (t) => () => dt(M.type(t)));
|
|
1149
|
+
n(Ge, {
|
|
1148
1150
|
displayName: "Command<liftListItemCommand>",
|
|
1149
1151
|
group: "ListItem"
|
|
1150
1152
|
});
|
|
1151
|
-
const
|
|
1152
|
-
n(
|
|
1153
|
+
const Ve = y("SplitListItem", (t) => () => $t(M.type(t)));
|
|
1154
|
+
n(Ve, {
|
|
1153
1155
|
displayName: "Command<splitListItemCommand>",
|
|
1154
1156
|
group: "ListItem"
|
|
1155
1157
|
});
|
|
1156
|
-
const
|
|
1158
|
+
const Ut = (t) => (e, r, a) => {
|
|
1157
1159
|
const { selection: o } = e;
|
|
1158
|
-
if (!(o instanceof
|
|
1160
|
+
if (!(o instanceof $))
|
|
1159
1161
|
return !1;
|
|
1160
|
-
const { empty: s, $from:
|
|
1161
|
-
if (!s ||
|
|
1162
|
+
const { empty: s, $from: i } = o;
|
|
1163
|
+
if (!s || i.parentOffset !== 0)
|
|
1162
1164
|
return !1;
|
|
1163
|
-
const
|
|
1164
|
-
return
|
|
1165
|
-
},
|
|
1166
|
-
n(
|
|
1165
|
+
const l = i.node(-1);
|
|
1166
|
+
return l.type !== M.type(t) || l.firstChild !== i.node() || i.node(-2).childCount > 1 ? !1 : dt(M.type(t))(e, r, a);
|
|
1167
|
+
}, je = y("LiftFirstListItem", (t) => () => Ut(t));
|
|
1168
|
+
n(je, {
|
|
1167
1169
|
displayName: "Command<liftFirstListItemCommand>",
|
|
1168
1170
|
group: "ListItem"
|
|
1169
1171
|
});
|
|
1170
|
-
const
|
|
1172
|
+
const ze = N("listItemKeymap", {
|
|
1171
1173
|
NextListItem: {
|
|
1172
1174
|
shortcuts: "Enter",
|
|
1173
1175
|
command: (t) => {
|
|
1174
|
-
const e = t.get(
|
|
1175
|
-
return () => e.call(
|
|
1176
|
+
const e = t.get(h);
|
|
1177
|
+
return () => e.call(Ve.key);
|
|
1176
1178
|
}
|
|
1177
1179
|
},
|
|
1178
1180
|
SinkListItem: {
|
|
1179
1181
|
shortcuts: ["Tab", "Mod-]"],
|
|
1180
1182
|
command: (t) => {
|
|
1181
|
-
const e = t.get(
|
|
1182
|
-
return () => e.call(
|
|
1183
|
+
const e = t.get(h);
|
|
1184
|
+
return () => e.call(Fe.key);
|
|
1183
1185
|
}
|
|
1184
1186
|
},
|
|
1185
1187
|
LiftListItem: {
|
|
1186
1188
|
shortcuts: ["Shift-Tab", "Mod-["],
|
|
1187
1189
|
command: (t) => {
|
|
1188
|
-
const e = t.get(
|
|
1189
|
-
return () => e.call(
|
|
1190
|
+
const e = t.get(h);
|
|
1191
|
+
return () => e.call(Ge.key);
|
|
1190
1192
|
}
|
|
1191
1193
|
},
|
|
1192
1194
|
LiftFirstListItem: {
|
|
1193
1195
|
shortcuts: ["Backspace", "Delete"],
|
|
1194
1196
|
command: (t) => {
|
|
1195
|
-
const e = t.get(
|
|
1196
|
-
return () => e.call(
|
|
1197
|
+
const e = t.get(h);
|
|
1198
|
+
return () => e.call(je.key);
|
|
1197
1199
|
}
|
|
1198
1200
|
}
|
|
1199
1201
|
});
|
|
1200
|
-
n(
|
|
1202
|
+
n(ze.ctx, {
|
|
1201
1203
|
displayName: "KeymapCtx<listItem>",
|
|
1202
1204
|
group: "ListItem"
|
|
1203
1205
|
});
|
|
1204
|
-
n(
|
|
1206
|
+
n(ze.shortcuts, {
|
|
1205
1207
|
displayName: "Keymap<listItem>",
|
|
1206
1208
|
group: "ListItem"
|
|
1207
1209
|
});
|
|
1208
|
-
const
|
|
1210
|
+
const Lt = ot("text", () => ({
|
|
1209
1211
|
group: "inline",
|
|
1210
1212
|
parseMarkdown: {
|
|
1211
1213
|
match: ({ type: t }) => t === "text",
|
|
@@ -1220,16 +1222,16 @@ const gt = Ye("text", () => ({
|
|
|
1220
1222
|
}
|
|
1221
1223
|
}
|
|
1222
1224
|
}));
|
|
1223
|
-
n(
|
|
1225
|
+
n(Lt, {
|
|
1224
1226
|
displayName: "NodeSchema<text>",
|
|
1225
1227
|
group: "Text"
|
|
1226
1228
|
});
|
|
1227
|
-
const
|
|
1228
|
-
n(
|
|
1229
|
+
const Ue = I("html");
|
|
1230
|
+
n(Ue, {
|
|
1229
1231
|
displayName: "Attr<html>",
|
|
1230
1232
|
group: "Html"
|
|
1231
1233
|
});
|
|
1232
|
-
const
|
|
1234
|
+
const Ye = C("html", (t) => ({
|
|
1233
1235
|
atom: !0,
|
|
1234
1236
|
group: "inline",
|
|
1235
1237
|
inline: !0,
|
|
@@ -1240,7 +1242,7 @@ const Ge = C("html", (t) => ({
|
|
|
1240
1242
|
},
|
|
1241
1243
|
toDOM: (e) => {
|
|
1242
1244
|
const r = document.createElement("span"), a = {
|
|
1243
|
-
...t.get(
|
|
1245
|
+
...t.get(Ue.key)(e),
|
|
1244
1246
|
"data-value": e.attrs.value,
|
|
1245
1247
|
"data-type": "html"
|
|
1246
1248
|
};
|
|
@@ -1265,117 +1267,117 @@ const Ge = C("html", (t) => ({
|
|
|
1265
1267
|
}
|
|
1266
1268
|
}
|
|
1267
1269
|
}));
|
|
1268
|
-
n(
|
|
1270
|
+
n(Ye.node, {
|
|
1269
1271
|
displayName: "NodeSchema<html>",
|
|
1270
1272
|
group: "Html"
|
|
1271
1273
|
});
|
|
1272
|
-
n(
|
|
1274
|
+
n(Ye.ctx, {
|
|
1273
1275
|
displayName: "NodeSchemaCtx<html>",
|
|
1274
1276
|
group: "Html"
|
|
1275
1277
|
});
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
|
|
1278
|
+
const Yt = [
|
|
1279
|
+
gt,
|
|
1280
|
+
Ne,
|
|
1279
1281
|
v,
|
|
1280
1282
|
Y,
|
|
1281
|
-
|
|
1283
|
+
Me,
|
|
1282
1284
|
H,
|
|
1283
|
-
|
|
1285
|
+
Oe,
|
|
1284
1286
|
S,
|
|
1285
|
-
|
|
1286
|
-
q,
|
|
1287
|
-
be,
|
|
1287
|
+
xe,
|
|
1288
1288
|
W,
|
|
1289
|
-
|
|
1289
|
+
Ae,
|
|
1290
1290
|
F,
|
|
1291
|
-
Se,
|
|
1292
|
-
D,
|
|
1293
|
-
Be,
|
|
1294
|
-
R,
|
|
1295
1291
|
Ke,
|
|
1292
|
+
G,
|
|
1293
|
+
Be,
|
|
1294
|
+
K,
|
|
1295
|
+
De,
|
|
1296
|
+
D,
|
|
1297
|
+
Ee,
|
|
1296
1298
|
P,
|
|
1297
|
-
|
|
1299
|
+
We,
|
|
1298
1300
|
M,
|
|
1299
|
-
|
|
1301
|
+
ce,
|
|
1300
1302
|
z,
|
|
1301
|
-
|
|
1303
|
+
ue,
|
|
1302
1304
|
U,
|
|
1303
|
-
|
|
1305
|
+
ye,
|
|
1304
1306
|
x,
|
|
1305
|
-
|
|
1307
|
+
fe,
|
|
1306
1308
|
B,
|
|
1309
|
+
Ue,
|
|
1310
|
+
Ye,
|
|
1311
|
+
Lt
|
|
1312
|
+
].flat(), Zt = [
|
|
1313
|
+
ht,
|
|
1314
|
+
Mt,
|
|
1315
|
+
bt,
|
|
1316
|
+
kt,
|
|
1317
|
+
It,
|
|
1318
|
+
yt
|
|
1319
|
+
].flat(), Jt = [
|
|
1320
|
+
Ie,
|
|
1321
|
+
Se,
|
|
1322
|
+
b,
|
|
1323
|
+
be,
|
|
1324
|
+
ve,
|
|
1325
|
+
Te,
|
|
1326
|
+
Ct,
|
|
1327
|
+
ft,
|
|
1328
|
+
Nt,
|
|
1329
|
+
$e,
|
|
1330
|
+
Pe,
|
|
1307
1331
|
Fe,
|
|
1332
|
+
Ve,
|
|
1308
1333
|
Ge,
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
st,
|
|
1312
|
-
ut,
|
|
1313
|
-
pt,
|
|
1314
|
-
lt,
|
|
1315
|
-
dt,
|
|
1316
|
-
ot
|
|
1317
|
-
].flat(), jt = [
|
|
1334
|
+
je,
|
|
1335
|
+
de,
|
|
1318
1336
|
he,
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1337
|
+
pe,
|
|
1338
|
+
ut,
|
|
1339
|
+
pt
|
|
1340
|
+
], Qt = [
|
|
1341
|
+
we,
|
|
1342
|
+
He,
|
|
1343
|
+
Re,
|
|
1322
1344
|
Le,
|
|
1323
|
-
|
|
1324
|
-
mt,
|
|
1325
|
-
it,
|
|
1326
|
-
ct,
|
|
1327
|
-
De,
|
|
1328
|
-
Oe,
|
|
1329
|
-
Ee,
|
|
1330
|
-
$e,
|
|
1331
|
-
_e,
|
|
1345
|
+
ze,
|
|
1332
1346
|
qe,
|
|
1333
|
-
|
|
1347
|
+
_e,
|
|
1348
|
+
Ce,
|
|
1334
1349
|
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) => {
|
|
1350
|
+
ke,
|
|
1351
|
+
ge
|
|
1352
|
+
].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
1353
|
let e = t, r = e.match(Q);
|
|
1352
1354
|
for (; r && r.groups; ) {
|
|
1353
1355
|
const { span: a } = r.groups;
|
|
1354
1356
|
e = e.replace(Q, a), r = e.match(Q);
|
|
1355
1357
|
}
|
|
1356
1358
|
return e;
|
|
1357
|
-
},
|
|
1359
|
+
}, rr = (t) => t.replaceAll(/\\\\\*/g, ee).replaceAll(/\\\\_/g, re).replaceAll(ee, te).replaceAll(re, ae), ar = (t, e, r) => {
|
|
1358
1360
|
const a = t.split(""), o = a[e];
|
|
1359
1361
|
return a[e] && a[r] && (a[e] = a[r], a[r] = o), a.join("").toString();
|
|
1360
|
-
},
|
|
1362
|
+
}, nr = (t) => (e) => e.replace(er(t), ""), or = (t) => (e) => {
|
|
1361
1363
|
const r = e.indexOf(t.hole), a = e.charAt(r - 1), o = e.charAt(r + 1), s = /[^\w]|_/;
|
|
1362
1364
|
return o ? a && s.test(a) && s.test(o) ? t.punctuation : t.char : t.punctuation;
|
|
1363
|
-
},
|
|
1365
|
+
}, sr = (t, e, r) => {
|
|
1364
1366
|
let a = e, o = !1;
|
|
1365
1367
|
return t.descendants((s) => {
|
|
1366
|
-
var
|
|
1368
|
+
var i;
|
|
1367
1369
|
if (o)
|
|
1368
1370
|
return !1;
|
|
1369
1371
|
if (!s.textContent.includes(r))
|
|
1370
1372
|
return a += s.nodeSize, !1;
|
|
1371
1373
|
if (s.isText) {
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
return o = !0, a +=
|
|
1374
|
+
const l = (i = s.text) == null ? void 0 : i.indexOf(r);
|
|
1375
|
+
if (l != null && l >= 0)
|
|
1376
|
+
return o = !0, a += l, !1;
|
|
1375
1377
|
}
|
|
1376
1378
|
return a += 1, !0;
|
|
1377
1379
|
}), a;
|
|
1378
|
-
},
|
|
1380
|
+
}, lr = {
|
|
1379
1381
|
placeholderConfig: {
|
|
1380
1382
|
hole: "∅",
|
|
1381
1383
|
punctuation: "⁂",
|
|
@@ -1387,96 +1389,96 @@ const Gt = [
|
|
|
1387
1389
|
const r = ["*", "_"];
|
|
1388
1390
|
let a = e.indexOf(t);
|
|
1389
1391
|
for (; r.includes(e[a - 1] || "") && r.includes(e[a + 1] || ""); )
|
|
1390
|
-
e =
|
|
1392
|
+
e = ar(e, a, a + 1), a = a + 1;
|
|
1391
1393
|
return e;
|
|
1392
1394
|
}
|
|
1393
|
-
},
|
|
1394
|
-
n(
|
|
1395
|
+
}, _ = ne(lr, "inlineSyncConfig");
|
|
1396
|
+
n(_, {
|
|
1395
1397
|
displayName: "Ctx<inlineSyncConfig>",
|
|
1396
1398
|
group: "Prose"
|
|
1397
1399
|
});
|
|
1398
|
-
const
|
|
1399
|
-
const o = t.get(
|
|
1400
|
+
const ir = (t) => t.selection.$from.node(), cr = (t, e, r, a) => {
|
|
1401
|
+
const o = t.get(Rt), s = e.schema.topNodeType.create(void 0, [r, ...a]);
|
|
1400
1402
|
return o(s);
|
|
1401
|
-
},
|
|
1402
|
-
const r = t.get(
|
|
1403
|
+
}, dr = (t, e) => {
|
|
1404
|
+
const r = t.get(_.key), a = r.placeholderConfig.hole, [o = "", ...s] = e.split(`
|
|
1403
1405
|
|
|
1404
|
-
`),
|
|
1405
|
-
let c =
|
|
1406
|
-
const d =
|
|
1406
|
+
`), i = (m) => r.movePlaceholder(a, m);
|
|
1407
|
+
let c = Tt(nr(a), i, tr, rr)(o);
|
|
1408
|
+
const d = or(r.placeholderConfig)(c);
|
|
1407
1409
|
return c = c.replace(a, d), c = [c, ...s].join(`
|
|
1408
1410
|
|
|
1409
1411
|
`), [c, d];
|
|
1410
|
-
},
|
|
1411
|
-
const a = t.get(
|
|
1412
|
+
}, mr = (t, e) => {
|
|
1413
|
+
const a = t.get(Kt)(e);
|
|
1412
1414
|
return a ? a.firstChild : null;
|
|
1413
|
-
},
|
|
1414
|
-
const { globalNodes: r } = t.get(
|
|
1415
|
+
}, ur = (t, e) => {
|
|
1416
|
+
const { globalNodes: r } = t.get(_.key), a = [];
|
|
1415
1417
|
return e.doc.descendants((o) => {
|
|
1416
1418
|
if (r.includes(o.type.name) || r.includes(o.type))
|
|
1417
1419
|
return a.push(o), !1;
|
|
1418
1420
|
}), a;
|
|
1419
|
-
},
|
|
1421
|
+
}, pr = (t) => t.split(`
|
|
1420
1422
|
|
|
1421
|
-
`)[0] || "",
|
|
1423
|
+
`)[0] || "", gr = (t) => t.childCount === 1 && t.child(0).type.name === "html", xt = (t, e) => {
|
|
1422
1424
|
try {
|
|
1423
|
-
const r =
|
|
1424
|
-
return !
|
|
1425
|
-
var
|
|
1426
|
-
const m = c.marks.find((
|
|
1427
|
-
m && ((
|
|
1425
|
+
const r = ur(t, e), a = ir(e), o = cr(t, e, a, r), [s, i] = dr(t, o), l = mr(t, s);
|
|
1426
|
+
return !l || a.type !== l.type || gr(l) ? null : (l.attrs = { ...a.attrs }, l.descendants((c) => {
|
|
1427
|
+
var g, u, k;
|
|
1428
|
+
const m = c.marks.find((p) => p.type.name === "link");
|
|
1429
|
+
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
1430
|
}), {
|
|
1429
|
-
text:
|
|
1431
|
+
text: pr(s),
|
|
1430
1432
|
prevNode: a,
|
|
1431
|
-
nextNode:
|
|
1432
|
-
placeholder:
|
|
1433
|
+
nextNode: l,
|
|
1434
|
+
placeholder: i
|
|
1433
1435
|
});
|
|
1434
1436
|
} catch {
|
|
1435
1437
|
return null;
|
|
1436
1438
|
}
|
|
1437
|
-
},
|
|
1439
|
+
}, yr = (t, e, r, a, o) => {
|
|
1438
1440
|
var L;
|
|
1439
|
-
const { placeholderConfig: s } = t.get(
|
|
1440
|
-
let
|
|
1441
|
-
const c = r.apply(
|
|
1441
|
+
const { placeholderConfig: s } = t.get(_.key), i = s.hole;
|
|
1442
|
+
let l = r.tr.setMeta(e, !0).insertText(i, r.selection.from);
|
|
1443
|
+
const c = r.apply(l), d = xt(t, c);
|
|
1442
1444
|
if (!d)
|
|
1443
1445
|
return;
|
|
1444
|
-
const m = d.text.slice(0, d.text.indexOf(d.placeholder)), { $from:
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
}), a(
|
|
1448
|
-
},
|
|
1446
|
+
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);
|
|
1447
|
+
l = l.replaceWith(u, k, d.nextNode).setNodeMarkup(u, void 0, o).delete(p + 1, p + 2), l = l.setSelection($.near(l.doc.resolve(p + 1))), (Xt.test(m) || ["*", "_", "~"].includes(m.at(-1) || "")) && l.selection instanceof $ && (((L = l.selection.$cursor) == null ? void 0 : L.marks()) ?? []).forEach((J) => {
|
|
1448
|
+
l = l.removeStoredMark(J.type);
|
|
1449
|
+
}), a(l);
|
|
1450
|
+
}, St = O((t) => {
|
|
1449
1451
|
let e = null;
|
|
1450
1452
|
const r = new T("MILKDOWN_INLINE_SYNC");
|
|
1451
|
-
return new
|
|
1453
|
+
return new R({
|
|
1452
1454
|
key: r,
|
|
1453
1455
|
state: {
|
|
1454
1456
|
init: () => null,
|
|
1455
|
-
apply: (a, o, s,
|
|
1456
|
-
var
|
|
1457
|
-
const
|
|
1458
|
-
if (!((
|
|
1457
|
+
apply: (a, o, s, i) => {
|
|
1458
|
+
var p;
|
|
1459
|
+
const l = t.get(X);
|
|
1460
|
+
if (!((p = l.hasFocus) != null && p.call(l)) || !l.editable || !a.docChanged || a.getMeta(r))
|
|
1459
1461
|
return null;
|
|
1460
|
-
const d =
|
|
1462
|
+
const d = xt(t, i);
|
|
1461
1463
|
if (!d)
|
|
1462
1464
|
return null;
|
|
1463
1465
|
e && (cancelAnimationFrame(e), e = null);
|
|
1464
|
-
const { prevNode: m, nextNode:
|
|
1465
|
-
return k({ prevNode: m, nextNode:
|
|
1466
|
+
const { prevNode: m, nextNode: g, text: u } = d, { shouldSyncNode: k } = t.get(_.key);
|
|
1467
|
+
return k({ prevNode: m, nextNode: g, ctx: t, tr: a, text: u }) && (e = requestAnimationFrame(() => {
|
|
1466
1468
|
e = null;
|
|
1467
1469
|
const { dispatch: f, state: L } = t.get(X);
|
|
1468
|
-
|
|
1470
|
+
yr(t, r, L, f, m.attrs);
|
|
1469
1471
|
})), null;
|
|
1470
1472
|
}
|
|
1471
1473
|
}
|
|
1472
1474
|
});
|
|
1473
1475
|
});
|
|
1474
|
-
n(
|
|
1476
|
+
n(St, {
|
|
1475
1477
|
displayName: "Prose<inlineSyncPlugin>",
|
|
1476
1478
|
group: "Prose"
|
|
1477
1479
|
});
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1480
|
+
const Ze = q("remarkAddOrderInList", () => () => (t) => {
|
|
1481
|
+
ie(t, "list", (e) => {
|
|
1480
1482
|
if (e.ordered) {
|
|
1481
1483
|
const r = e.start ?? 1;
|
|
1482
1484
|
e.children.forEach((a, o) => {
|
|
@@ -1485,78 +1487,98 @@ const kt = $(() => () => (t) => {
|
|
|
1485
1487
|
}
|
|
1486
1488
|
});
|
|
1487
1489
|
});
|
|
1488
|
-
n(
|
|
1490
|
+
n(Ze.plugin, {
|
|
1489
1491
|
displayName: "Remark<remarkAddOrderInListPlugin>",
|
|
1490
1492
|
group: "Remark"
|
|
1491
1493
|
});
|
|
1492
|
-
|
|
1494
|
+
n(Ze.options, {
|
|
1495
|
+
displayName: "RemarkConfig<remarkAddOrderInListPlugin>",
|
|
1496
|
+
group: "Remark"
|
|
1497
|
+
});
|
|
1498
|
+
const Je = q("remarkLineBreak", () => () => (t) => {
|
|
1493
1499
|
const e = /[\t ]*(?:\r?\n|\r)/g;
|
|
1494
|
-
|
|
1500
|
+
ie(t, "text", (r, a, o) => {
|
|
1495
1501
|
if (!r.value || typeof r.value != "string")
|
|
1496
1502
|
return;
|
|
1497
1503
|
const s = [];
|
|
1498
|
-
let
|
|
1504
|
+
let i = 0;
|
|
1499
1505
|
e.lastIndex = 0;
|
|
1500
|
-
let
|
|
1501
|
-
for (;
|
|
1502
|
-
const d =
|
|
1503
|
-
|
|
1506
|
+
let l = e.exec(r.value);
|
|
1507
|
+
for (; l; ) {
|
|
1508
|
+
const d = l.index;
|
|
1509
|
+
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
1510
|
}
|
|
1505
1511
|
if (s.length > 0 && o && typeof a == "number")
|
|
1506
|
-
return
|
|
1512
|
+
return i < r.value.length && s.push({ type: "text", value: r.value.slice(i) }), o.children.splice(a, 1, ...s), a + s.length;
|
|
1507
1513
|
});
|
|
1508
1514
|
});
|
|
1509
|
-
n(
|
|
1515
|
+
n(Je.plugin, {
|
|
1510
1516
|
displayName: "Remark<remarkLineBreak>",
|
|
1511
1517
|
group: "Remark"
|
|
1512
1518
|
});
|
|
1513
|
-
|
|
1514
|
-
|
|
1519
|
+
n(Je.options, {
|
|
1520
|
+
displayName: "RemarkConfig<remarkLineBreak>",
|
|
1521
|
+
group: "Remark"
|
|
1522
|
+
});
|
|
1523
|
+
const Qe = q("remarkInlineLink", () => Ft);
|
|
1524
|
+
n(Qe.plugin, {
|
|
1515
1525
|
displayName: "Remark<remarkInlineLinkPlugin>",
|
|
1516
1526
|
group: "Remark"
|
|
1517
1527
|
});
|
|
1518
|
-
|
|
1519
|
-
|
|
1528
|
+
n(Qe.options, {
|
|
1529
|
+
displayName: "RemarkConfig<remarkInlineLinkPlugin>",
|
|
1530
|
+
group: "Remark"
|
|
1531
|
+
});
|
|
1532
|
+
const hr = (t) => !!t.children, kr = (t) => t.type === "html";
|
|
1533
|
+
function fr(t, e) {
|
|
1520
1534
|
return r(t, 0, null)[0];
|
|
1521
1535
|
function r(a, o, s) {
|
|
1522
|
-
if (
|
|
1523
|
-
const
|
|
1524
|
-
for (let
|
|
1525
|
-
const d = a.children[
|
|
1536
|
+
if (hr(a)) {
|
|
1537
|
+
const i = [];
|
|
1538
|
+
for (let l = 0, c = a.children.length; l < c; l++) {
|
|
1539
|
+
const d = a.children[l];
|
|
1526
1540
|
if (d) {
|
|
1527
|
-
const m = r(d,
|
|
1541
|
+
const m = r(d, l, a);
|
|
1528
1542
|
if (m)
|
|
1529
|
-
for (let
|
|
1530
|
-
const k = m[
|
|
1531
|
-
k &&
|
|
1543
|
+
for (let g = 0, u = m.length; g < u; g++) {
|
|
1544
|
+
const k = m[g];
|
|
1545
|
+
k && i.push(k);
|
|
1532
1546
|
}
|
|
1533
1547
|
}
|
|
1534
1548
|
}
|
|
1535
|
-
a.children =
|
|
1549
|
+
a.children = i;
|
|
1536
1550
|
}
|
|
1537
1551
|
return e(a, o, s);
|
|
1538
1552
|
}
|
|
1539
1553
|
}
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1554
|
+
const Xe = q("remarkHTMLTransformer", () => () => (t) => {
|
|
1555
|
+
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
1556
|
});
|
|
1543
|
-
n(
|
|
1557
|
+
n(Xe.plugin, {
|
|
1544
1558
|
displayName: "Remark<remarkHtmlTransformer>",
|
|
1545
1559
|
group: "Remark"
|
|
1546
1560
|
});
|
|
1547
|
-
|
|
1561
|
+
n(Xe.options, {
|
|
1562
|
+
displayName: "RemarkConfig<remarkHtmlTransformer>",
|
|
1563
|
+
group: "Remark"
|
|
1564
|
+
});
|
|
1565
|
+
const et = q("remarkMarker", () => () => (t, e) => {
|
|
1548
1566
|
const r = (a) => e.value.charAt(a.position.start.offset);
|
|
1549
|
-
|
|
1567
|
+
ie(t, (a) => ["strong", "emphasis"].includes(a.type), (a) => {
|
|
1550
1568
|
a.marker = r(a);
|
|
1551
1569
|
});
|
|
1552
1570
|
});
|
|
1553
|
-
n(
|
|
1571
|
+
n(et.plugin, {
|
|
1554
1572
|
displayName: "Remark<remarkMarker>",
|
|
1555
1573
|
group: "Remark"
|
|
1556
1574
|
});
|
|
1557
|
-
|
|
1575
|
+
n(et.options, {
|
|
1576
|
+
displayName: "RemarkConfig<remarkMarker>",
|
|
1577
|
+
group: "Remark"
|
|
1578
|
+
});
|
|
1579
|
+
const wt = O(() => {
|
|
1558
1580
|
let t = !1;
|
|
1559
|
-
const e = new T("MILKDOWN_INLINE_NODES_CURSOR"), r = new
|
|
1581
|
+
const e = new T("MILKDOWN_INLINE_NODES_CURSOR"), r = new R({
|
|
1560
1582
|
key: e,
|
|
1561
1583
|
state: {
|
|
1562
1584
|
init() {
|
|
@@ -1565,47 +1587,47 @@ const Mt = O(() => {
|
|
|
1565
1587
|
apply(a) {
|
|
1566
1588
|
if (!a.selection.empty)
|
|
1567
1589
|
return !1;
|
|
1568
|
-
const o = a.selection.$from, s = o.nodeBefore,
|
|
1569
|
-
return !!(s &&
|
|
1590
|
+
const o = a.selection.$from, s = o.nodeBefore, i = o.nodeAfter;
|
|
1591
|
+
return !!(s && i && s.isInline && !s.isText && i.isInline && !i.isText);
|
|
1570
1592
|
}
|
|
1571
1593
|
},
|
|
1572
1594
|
props: {
|
|
1573
1595
|
handleDOMEvents: {
|
|
1574
1596
|
compositionend: (a, o) => t ? (t = !1, requestAnimationFrame(() => {
|
|
1575
1597
|
if (r.getState(a.state)) {
|
|
1576
|
-
const
|
|
1577
|
-
o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "",
|
|
1598
|
+
const i = a.state.selection.from;
|
|
1599
|
+
o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "", i));
|
|
1578
1600
|
}
|
|
1579
1601
|
}), !0) : !1,
|
|
1580
1602
|
compositionstart: (a) => (r.getState(a.state) && (t = !0), !1),
|
|
1581
1603
|
beforeinput: (a, o) => {
|
|
1582
1604
|
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 || "",
|
|
1605
|
+
const i = a.state.selection.from;
|
|
1606
|
+
return o.preventDefault(), a.dispatch(a.state.tr.insertText(o.data || "", i)), !0;
|
|
1585
1607
|
}
|
|
1586
1608
|
return !1;
|
|
1587
1609
|
}
|
|
1588
1610
|
},
|
|
1589
1611
|
decorations(a) {
|
|
1590
1612
|
if (r.getState(a)) {
|
|
1591
|
-
const
|
|
1613
|
+
const i = a.selection.$from.pos, l = document.createElement("span"), c = at.widget(i, l, {
|
|
1592
1614
|
side: -1
|
|
1593
|
-
}), d = document.createElement("span"), m =
|
|
1615
|
+
}), d = document.createElement("span"), m = at.widget(i, d);
|
|
1594
1616
|
return setTimeout(() => {
|
|
1595
|
-
|
|
1596
|
-
}),
|
|
1617
|
+
l.contentEditable = "true", d.contentEditable = "true";
|
|
1618
|
+
}), nt.create(a.doc, [c, m]);
|
|
1597
1619
|
}
|
|
1598
|
-
return
|
|
1620
|
+
return nt.empty;
|
|
1599
1621
|
}
|
|
1600
1622
|
}
|
|
1601
1623
|
});
|
|
1602
1624
|
return r;
|
|
1603
1625
|
});
|
|
1604
|
-
n(
|
|
1626
|
+
n(wt, {
|
|
1605
1627
|
displayName: "Prose<inlineNodesCursorPlugin>",
|
|
1606
1628
|
group: "Prose"
|
|
1607
1629
|
});
|
|
1608
|
-
const
|
|
1630
|
+
const At = O((t) => new R({
|
|
1609
1631
|
key: new T("MILKDOWN_HARDBREAK_MARKS"),
|
|
1610
1632
|
appendTransaction: (e, r, a) => {
|
|
1611
1633
|
if (!e.length)
|
|
@@ -1615,69 +1637,69 @@ const bt = O((t) => new K({
|
|
|
1615
1637
|
return;
|
|
1616
1638
|
const [s] = o.steps;
|
|
1617
1639
|
if (o.getMeta("hardbreak")) {
|
|
1618
|
-
if (!(s instanceof
|
|
1640
|
+
if (!(s instanceof qt))
|
|
1619
1641
|
return;
|
|
1620
1642
|
const { from: c } = s;
|
|
1621
1643
|
return a.tr.setNodeMarkup(c, S.type(t), void 0, []);
|
|
1622
1644
|
}
|
|
1623
|
-
if (s instanceof
|
|
1645
|
+
if (s instanceof Wt) {
|
|
1624
1646
|
let c = a.tr;
|
|
1625
1647
|
const { from: d, to: m } = s;
|
|
1626
|
-
return a.doc.nodesBetween(d, m, (
|
|
1627
|
-
|
|
1648
|
+
return a.doc.nodesBetween(d, m, (g, u) => {
|
|
1649
|
+
g.type === S.type(t) && (c = c.setNodeMarkup(u, S.type(t), void 0, []));
|
|
1628
1650
|
}), c;
|
|
1629
1651
|
}
|
|
1630
1652
|
}
|
|
1631
1653
|
}));
|
|
1632
|
-
n(
|
|
1654
|
+
n(At, {
|
|
1633
1655
|
displayName: "Prose<hardbreakClearMarkPlugin>",
|
|
1634
1656
|
group: "Prose"
|
|
1635
1657
|
});
|
|
1636
|
-
const
|
|
1637
|
-
n(
|
|
1658
|
+
const tt = ne(["table", "code_block"], "hardbreakFilterNodes");
|
|
1659
|
+
n(tt, {
|
|
1638
1660
|
displayName: "Ctx<hardbreakFilterNodes>",
|
|
1639
1661
|
group: "Prose"
|
|
1640
1662
|
});
|
|
1641
|
-
const
|
|
1642
|
-
const e = t.get(
|
|
1643
|
-
return new
|
|
1663
|
+
const vt = O((t) => {
|
|
1664
|
+
const e = t.get(tt.key);
|
|
1665
|
+
return new R({
|
|
1644
1666
|
key: new T("MILKDOWN_HARDBREAK_FILTER"),
|
|
1645
1667
|
filterTransaction: (r, a) => {
|
|
1646
1668
|
const o = r.getMeta("hardbreak"), [s] = r.steps;
|
|
1647
1669
|
if (o && s) {
|
|
1648
|
-
const { from:
|
|
1649
|
-
let c =
|
|
1670
|
+
const { from: i } = s, l = a.doc.resolve(i);
|
|
1671
|
+
let c = l.depth, d = !0;
|
|
1650
1672
|
for (; c > 0; )
|
|
1651
|
-
e.includes(
|
|
1673
|
+
e.includes(l.node(c).type.name) && (d = !1), c--;
|
|
1652
1674
|
return d;
|
|
1653
1675
|
}
|
|
1654
1676
|
return !0;
|
|
1655
1677
|
}
|
|
1656
1678
|
});
|
|
1657
1679
|
});
|
|
1658
|
-
n(
|
|
1680
|
+
n(vt, {
|
|
1659
1681
|
displayName: "Prose<hardbreakFilterPlugin>",
|
|
1660
1682
|
group: "Prose"
|
|
1661
1683
|
});
|
|
1662
|
-
const
|
|
1684
|
+
const Ht = O((t) => {
|
|
1663
1685
|
const e = new T("MILKDOWN_HEADING_ID"), r = (a) => {
|
|
1664
1686
|
if (a.composing || !a.editable)
|
|
1665
1687
|
return;
|
|
1666
1688
|
const o = t.get(Y.key), s = a.state.tr.setMeta("addToHistory", !1);
|
|
1667
|
-
let
|
|
1668
|
-
a.state.doc.descendants((
|
|
1669
|
-
if (
|
|
1670
|
-
if (
|
|
1689
|
+
let i = !1;
|
|
1690
|
+
a.state.doc.descendants((l, c) => {
|
|
1691
|
+
if (l.type === H.type(t)) {
|
|
1692
|
+
if (l.textContent.trim().length === 0)
|
|
1671
1693
|
return;
|
|
1672
|
-
const d =
|
|
1673
|
-
d.id !== m && (
|
|
1694
|
+
const d = l.attrs, m = o(l);
|
|
1695
|
+
d.id !== m && (i = !0, s.setMeta(e, !0).setNodeMarkup(c, void 0, {
|
|
1674
1696
|
...d,
|
|
1675
1697
|
id: m
|
|
1676
1698
|
}));
|
|
1677
1699
|
}
|
|
1678
|
-
}),
|
|
1700
|
+
}), i && a.dispatch(s);
|
|
1679
1701
|
};
|
|
1680
|
-
return new
|
|
1702
|
+
return new R({
|
|
1681
1703
|
key: e,
|
|
1682
1704
|
view: (a) => (r(a), {
|
|
1683
1705
|
update: (o) => {
|
|
@@ -1686,38 +1708,38 @@ const xt = O((t) => {
|
|
|
1686
1708
|
})
|
|
1687
1709
|
});
|
|
1688
1710
|
});
|
|
1689
|
-
n(
|
|
1711
|
+
n(Ht, {
|
|
1690
1712
|
displayName: "Prose<syncHeadingIdPlugin>",
|
|
1691
1713
|
group: "Prose"
|
|
1692
1714
|
});
|
|
1693
|
-
const
|
|
1715
|
+
const Bt = O((t) => {
|
|
1694
1716
|
const e = (r) => {
|
|
1695
1717
|
if (r.composing || !r.editable)
|
|
1696
1718
|
return;
|
|
1697
|
-
const a = P.type(t), o =
|
|
1719
|
+
const a = P.type(t), o = D.type(t), s = M.type(t), i = r.state, l = (m, g) => {
|
|
1698
1720
|
let u = !1;
|
|
1699
|
-
const k = `${
|
|
1721
|
+
const k = `${g + 1}.`;
|
|
1700
1722
|
return m.label !== k && (m.label = k, u = !0), u;
|
|
1701
1723
|
};
|
|
1702
|
-
let c =
|
|
1703
|
-
|
|
1724
|
+
let c = i.tr, d = !1;
|
|
1725
|
+
i.doc.descendants((m, g, u, k) => {
|
|
1704
1726
|
if (m.type === o) {
|
|
1705
|
-
const
|
|
1706
|
-
(
|
|
1727
|
+
const p = m.maybeChild(0);
|
|
1728
|
+
(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
1729
|
if (f.type === s) {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1730
|
+
const rt = { ...f.attrs };
|
|
1731
|
+
l(rt, J) && (c = c.setNodeMarkup(L, void 0, rt));
|
|
1710
1732
|
}
|
|
1711
1733
|
return !1;
|
|
1712
1734
|
}));
|
|
1713
1735
|
} else if (m.type === s && (u == null ? void 0 : u.type) === a) {
|
|
1714
|
-
const
|
|
1736
|
+
const p = { ...m.attrs };
|
|
1715
1737
|
let f = !1;
|
|
1716
|
-
|
|
1738
|
+
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
1739
|
}
|
|
1718
1740
|
}), d && r.dispatch(c.setMeta("addToHistory", !1));
|
|
1719
1741
|
};
|
|
1720
|
-
return new
|
|
1742
|
+
return new R({
|
|
1721
1743
|
key: new T("MILKDOWN_KEEP_LIST_ORDER"),
|
|
1722
1744
|
view: (r) => (e(r), {
|
|
1723
1745
|
update: (a) => {
|
|
@@ -1726,117 +1748,117 @@ const St = O((t) => {
|
|
|
1726
1748
|
})
|
|
1727
1749
|
});
|
|
1728
1750
|
});
|
|
1729
|
-
n(
|
|
1751
|
+
n(Bt, {
|
|
1730
1752
|
displayName: "Prose<syncListOrderPlugin>",
|
|
1731
1753
|
group: "Prose"
|
|
1732
1754
|
});
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
],
|
|
1755
|
+
const Nr = [
|
|
1756
|
+
_,
|
|
1757
|
+
St,
|
|
1758
|
+
At,
|
|
1759
|
+
tt,
|
|
1760
|
+
vt,
|
|
1761
|
+
wt,
|
|
1762
|
+
Ze,
|
|
1763
|
+
Qe,
|
|
1764
|
+
Je,
|
|
1765
|
+
Xe,
|
|
1766
|
+
et,
|
|
1767
|
+
Ht,
|
|
1768
|
+
Bt
|
|
1769
|
+
].flat(), Kr = [Yt, Zt, Jt, Qt, Nr].flat();
|
|
1748
1770
|
export {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1771
|
+
xe as blockquoteAttr,
|
|
1772
|
+
we as blockquoteKeymap,
|
|
1773
|
+
W as blockquoteSchema,
|
|
1774
|
+
De as bulletListAttr,
|
|
1775
|
+
_e as bulletListKeymap,
|
|
1776
|
+
D as bulletListSchema,
|
|
1777
|
+
Ae as codeBlockAttr,
|
|
1778
|
+
He as codeBlockKeymap,
|
|
1779
|
+
F as codeBlockSchema,
|
|
1780
|
+
Jt as commands,
|
|
1781
|
+
Kr as commonmark,
|
|
1782
|
+
ve as createCodeBlockCommand,
|
|
1783
|
+
kt as createCodeBlockInputRule,
|
|
1784
|
+
lr as defaultConfig,
|
|
1785
|
+
gt as docSchema,
|
|
1786
|
+
be as downgradeHeadingCommand,
|
|
1787
|
+
ce as emphasisAttr,
|
|
1788
|
+
me as emphasisKeymap,
|
|
1767
1789
|
z as emphasisSchema,
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1790
|
+
Oe as hardbreakAttr,
|
|
1791
|
+
At as hardbreakClearMarkPlugin,
|
|
1792
|
+
tt as hardbreakFilterNodes,
|
|
1793
|
+
vt as hardbreakFilterPlugin,
|
|
1794
|
+
Re as hardbreakKeymap,
|
|
1773
1795
|
S as hardbreakSchema,
|
|
1774
|
-
|
|
1796
|
+
Me as headingAttr,
|
|
1775
1797
|
Y as headingIdGenerator,
|
|
1776
|
-
|
|
1798
|
+
Le as headingKeymap,
|
|
1777
1799
|
H as headingSchema,
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1800
|
+
Ke as hrAttr,
|
|
1801
|
+
G as hrSchema,
|
|
1802
|
+
Ue as htmlAttr,
|
|
1803
|
+
Ye as htmlSchema,
|
|
1804
|
+
Be as imageAttr,
|
|
1805
|
+
K as imageSchema,
|
|
1806
|
+
ye as inlineCodeAttr,
|
|
1807
|
+
ke as inlineCodeKeymap,
|
|
1786
1808
|
x as inlineCodeSchema,
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1809
|
+
wt as inlineNodesCursorPlugin,
|
|
1810
|
+
_ as inlineSyncConfig,
|
|
1811
|
+
St as inlineSyncPlugin,
|
|
1812
|
+
Zt as inputrules,
|
|
1813
|
+
Te as insertHardbreakCommand,
|
|
1814
|
+
Ct as insertHrCommand,
|
|
1815
|
+
It as insertHrInputRule,
|
|
1816
|
+
ft as insertImageCommand,
|
|
1817
|
+
zt as insertImageInputRule,
|
|
1818
|
+
Qt as keymap,
|
|
1819
|
+
je as liftFirstListItemCommand,
|
|
1820
|
+
Ge as liftListItemCommand,
|
|
1821
|
+
fe as linkAttr,
|
|
1800
1822
|
B as linkSchema,
|
|
1801
|
-
|
|
1802
|
-
|
|
1823
|
+
We as listItemAttr,
|
|
1824
|
+
ze as listItemKeymap,
|
|
1803
1825
|
M as listItemSchema,
|
|
1804
|
-
|
|
1805
|
-
|
|
1826
|
+
Ee as orderedListAttr,
|
|
1827
|
+
qe as orderedListKeymap,
|
|
1806
1828
|
P as orderedListSchema,
|
|
1807
|
-
|
|
1808
|
-
|
|
1829
|
+
Ne as paragraphAttr,
|
|
1830
|
+
Ce as paragraphKeymap,
|
|
1809
1831
|
v as paragraphSchema,
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1832
|
+
Nr as plugins,
|
|
1833
|
+
Ze as remarkAddOrderInListPlugin,
|
|
1834
|
+
Xe as remarkHtmlTransformer,
|
|
1835
|
+
Qe as remarkInlineLinkPlugin,
|
|
1836
|
+
Je as remarkLineBreak,
|
|
1837
|
+
et as remarkMarker,
|
|
1838
|
+
Yt as schema,
|
|
1839
|
+
Fe as sinkListItemCommand,
|
|
1840
|
+
Ve as splitListItemCommand,
|
|
1841
|
+
ue as strongAttr,
|
|
1842
|
+
ge as strongKeymap,
|
|
1821
1843
|
U as strongSchema,
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1844
|
+
Ht as syncHeadingIdPlugin,
|
|
1845
|
+
Bt as syncListOrderPlugin,
|
|
1846
|
+
Lt as textSchema,
|
|
1847
|
+
de as toggleEmphasisCommand,
|
|
1848
|
+
he as toggleInlineCodeCommand,
|
|
1849
|
+
ut as toggleLinkCommand,
|
|
1850
|
+
pe as toggleStrongCommand,
|
|
1851
|
+
Ie as turnIntoTextCommand,
|
|
1852
|
+
jt as updateCodeBlockLanguageCommand,
|
|
1853
|
+
Nt as updateImageCommand,
|
|
1854
|
+
pt as updateLinkCommand,
|
|
1855
|
+
Se as wrapInBlockquoteCommand,
|
|
1856
|
+
ht as wrapInBlockquoteInputRule,
|
|
1857
|
+
Pe as wrapInBulletListCommand,
|
|
1858
|
+
Mt as wrapInBulletListInputRule,
|
|
1837
1859
|
b as wrapInHeadingCommand,
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1860
|
+
yt as wrapInHeadingInputRule,
|
|
1861
|
+
$e as wrapInOrderedListCommand,
|
|
1862
|
+
bt as wrapInOrderedListInputRule
|
|
1841
1863
|
};
|
|
1842
1864
|
//# sourceMappingURL=index.es.js.map
|