@milkdown/preset-commonmark 7.2.1 → 7.2.3

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/index.es.js CHANGED
@@ -1,18 +1,18 @@
1
- import { $markAttr as W, $markSchema as F, $command as g, $useKeymap as f, $node as Ve, $nodeAttr as N, $nodeSchema as I, $ctx as J, $inputRule as x, pipe as bt, $prose as H, $remark as G } from "@milkdown/utils";
2
- import { commandsCtx as h, editorViewCtx as Y, serializerCtx as xt, parserCtx as Lt } from "@milkdown/core";
3
- import { toggleMark as Q, setBlockType as R, wrapIn as X } from "@milkdown/prose/commands";
4
- import { Fragment as St } from "@milkdown/prose/model";
5
- import { expectDomTypeError as L } from "@milkdown/exception";
6
- import { textblockTypeInputRule as je, wrappingInputRule as Z, InputRule as ze } from "@milkdown/prose/inputrules";
7
- import wt from "@sindresorhus/slugify";
8
- import { TextSelection as Ue, Selection as Ye, PluginKey as B, Plugin as T } from "@milkdown/prose/state";
9
- import { findSelectedNodeOfType as At } from "@milkdown/prose";
10
- import { sinkListItem as vt, liftListItem as Ht, splitListItem as Bt } from "@milkdown/prose/schema-list";
11
- import { ReplaceStep as Tt, AddMarkStep as Ot } from "@milkdown/prose/transform";
12
- import { Decoration as Fe, DecorationSet as Ge } from "@milkdown/prose/view";
13
- import { visit as Je } from "unist-util-visit";
14
- import Kt from "remark-inline-links";
15
- const Qe = (t, e) => {
1
+ import { $markAttr as j, $markSchema as z, $command as g, $useKeymap as f, $node as Ye, $nodeAttr as N, $nodeSchema as I, $ctx as ee, $inputRule as L, pipe as wt, $prose as H, $remark as $ } from "@milkdown/utils";
2
+ import { remarkStringifyOptionsCtx as U, commandsCtx as h, editorViewCtx as Z, serializerCtx as At, parserCtx as vt } from "@milkdown/core";
3
+ import { toggleMark as Ht, setBlockType as _, wrapIn as te } from "@milkdown/prose/commands";
4
+ import { Fragment as Bt } from "@milkdown/prose/model";
5
+ import { expectDomTypeError as S } from "@milkdown/exception";
6
+ import { textblockTypeInputRule as Je, wrappingInputRule as re, InputRule as Qe } from "@milkdown/prose/inputrules";
7
+ import Tt from "@sindresorhus/slugify";
8
+ import { TextSelection as V, Selection as Xe, PluginKey as B, Plugin as T } from "@milkdown/prose/state";
9
+ import { toggleMarkdownMark as Ze, findSelectedNodeOfType as Ot } from "@milkdown/prose";
10
+ import { sinkListItem as Kt, liftListItem as et, splitListItem as Dt } from "@milkdown/prose/schema-list";
11
+ import { ReplaceStep as Rt, AddMarkStep as Pt } from "@milkdown/prose/transform";
12
+ import { Decoration as ze, DecorationSet as Ue } from "@milkdown/prose/view";
13
+ import { visit as ae } from "unist-util-visit";
14
+ import Et from "remark-inline-links";
15
+ const tt = (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);
@@ -21,135 +21,153 @@ const Qe = (t, e) => {
21
21
  const a = [];
22
22
  e.content.forEach((s, i, l) => {
23
23
  l !== e.childCount - 1 && a.push(s);
24
- }), t.next(St.fromArray(a));
24
+ }), t.next(Bt.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), ee = W("emphasis");
31
- n(ee, {
30
+ }), t), ne = j("emphasis");
31
+ n(ne, {
32
32
  displayName: "Attr<emphasis>",
33
33
  group: "Emphasis"
34
34
  });
35
- const V = F("emphasis", (t) => ({
36
- inclusive: !1,
35
+ const Y = z("emphasis", (t) => ({
36
+ attrs: {
37
+ marker: {
38
+ default: t.get(U).emphasis || "*"
39
+ }
40
+ },
37
41
  parseDOM: [
38
42
  { tag: "i" },
39
43
  { tag: "em" },
40
44
  { style: "font-style", getAttrs: (e) => e === "italic" }
41
45
  ],
42
- toDOM: (e) => ["em", t.get(ee.key)(e)],
46
+ toDOM: (e) => ["em", t.get(ne.key)(e)],
43
47
  parseMarkdown: {
44
48
  match: (e) => e.type === "emphasis",
45
49
  runner: (e, r, a) => {
46
- e.openMark(a), e.next(r.children), e.closeMark(a);
50
+ e.openMark(a, { marker: r.marker }), e.next(r.children), e.closeMark(a);
47
51
  }
48
52
  },
49
53
  toMarkdown: {
50
54
  match: (e) => e.type.name === "emphasis",
51
55
  runner: (e, r) => {
52
- e.withMark(r, "emphasis");
56
+ e.withMark(r, "emphasis", void 0, {
57
+ marker: r.attrs.marker
58
+ });
53
59
  }
54
60
  }
55
61
  }));
56
- n(V.mark, {
62
+ n(Y.mark, {
57
63
  displayName: "MarkSchema<emphasis>",
58
64
  group: "Emphasis"
59
65
  });
60
- n(V.ctx, {
66
+ n(Y.ctx, {
61
67
  displayName: "MarkSchemaCtx<emphasis>",
62
68
  group: "Emphasis"
63
69
  });
64
- const te = g("ToggleEmphasis", () => () => Q(V.type()));
65
- n(te, {
70
+ const oe = g("ToggleEmphasis", (t) => () => {
71
+ const e = Y.type(), r = t.get(U).emphasis || "*";
72
+ return Ze(e, r);
73
+ });
74
+ n(oe, {
66
75
  displayName: "Command<toggleEmphasisCommand>",
67
76
  group: "Emphasis"
68
77
  });
69
- const re = f("emphasisKeymap", {
78
+ const se = f("emphasisKeymap", {
70
79
  ToggleEmphasis: {
71
80
  shortcuts: "Mod-i",
72
81
  command: (t) => {
73
82
  const e = t.get(h);
74
- return () => e.call(te.key);
83
+ return () => e.call(oe.key);
75
84
  }
76
85
  }
77
86
  });
78
- n(re.ctx, {
87
+ n(se.ctx, {
79
88
  displayName: "KeymapCtx<emphasis>",
80
89
  group: "Emphasis"
81
90
  });
82
- n(re.shortcuts, {
91
+ n(se.shortcuts, {
83
92
  displayName: "Keymap<emphasis>",
84
93
  group: "Emphasis"
85
94
  });
86
- const ae = W("strong");
87
- n(ae, {
95
+ const le = j("strong");
96
+ n(le, {
88
97
  displayName: "Attr<strong>",
89
98
  group: "Strong"
90
99
  });
91
- const j = F("strong", (t) => ({
92
- inclusive: !1,
100
+ const J = z("strong", (t) => ({
101
+ attrs: {
102
+ marker: {
103
+ default: t.get(U).strong || "*"
104
+ }
105
+ },
93
106
  parseDOM: [
94
107
  { tag: "b" },
95
108
  { tag: "strong" },
96
109
  { style: "font-style", getAttrs: (e) => e === "bold" }
97
110
  ],
98
- toDOM: (e) => ["strong", t.get(ae.key)(e)],
111
+ toDOM: (e) => ["strong", t.get(le.key)(e)],
99
112
  parseMarkdown: {
100
113
  match: (e) => e.type === "strong",
101
114
  runner: (e, r, a) => {
102
- e.openMark(a), e.next(r.children), e.closeMark(a);
115
+ e.openMark(a, { marker: r.marker }), e.next(r.children), e.closeMark(a);
103
116
  }
104
117
  },
105
118
  toMarkdown: {
106
119
  match: (e) => e.type.name === "strong",
107
120
  runner: (e, r) => {
108
- e.withMark(r, "strong");
121
+ e.withMark(r, "strong", void 0, {
122
+ marker: r.attrs.marker
123
+ });
109
124
  }
110
125
  }
111
126
  }));
112
- n(j.mark, {
127
+ n(J.mark, {
113
128
  displayName: "MarkSchema<strong>",
114
129
  group: "Strong"
115
130
  });
116
- n(j.ctx, {
131
+ n(J.ctx, {
117
132
  displayName: "MarkSchemaCtx<strong>",
118
133
  group: "Strong"
119
134
  });
120
- const ne = g("ToggleStrong", () => () => Q(j.type()));
121
- n(ne, {
135
+ const ie = g("ToggleStrong", (t) => () => {
136
+ const e = J.type(), r = t.get(U).strong || "*", a = r + r;
137
+ return Ze(e, a);
138
+ });
139
+ n(ie, {
122
140
  displayName: "Command<toggleStrongCommand>",
123
141
  group: "Strong"
124
142
  });
125
- const oe = f("strongKeymap", {
143
+ const ce = f("strongKeymap", {
126
144
  ToggleBold: {
127
145
  shortcuts: ["Mod-b"],
128
146
  command: (t) => {
129
147
  const e = t.get(h);
130
- return () => e.call(ne.key);
148
+ return () => e.call(ie.key);
131
149
  }
132
150
  }
133
151
  });
134
- n(oe.ctx, {
152
+ n(ce.ctx, {
135
153
  displayName: "KeymapCtx<strong>",
136
154
  group: "Strong"
137
155
  });
138
- n(oe.shortcuts, {
156
+ n(ce.shortcuts, {
139
157
  displayName: "Keymap<strong>",
140
158
  group: "Strong"
141
159
  });
142
- const se = W("inlineCode");
143
- n(se, {
160
+ const de = j("inlineCode");
161
+ n(de, {
144
162
  displayName: "Attr<inlineCode>",
145
163
  group: "InlineCode"
146
164
  });
147
- const M = F("inlineCode", (t) => ({
165
+ const b = z("inlineCode", (t) => ({
148
166
  priority: 100,
149
167
  code: !0,
150
168
  inclusive: !1,
151
169
  parseDOM: [{ tag: "code" }],
152
- toDOM: (e) => ["code", t.get(se.key)(e)],
170
+ toDOM: (e) => ["code", t.get(de.key)(e)],
153
171
  parseMarkdown: {
154
172
  match: (e) => e.type === "inlineCode",
155
173
  runner: (e, r, a) => {
@@ -163,50 +181,50 @@ const M = F("inlineCode", (t) => ({
163
181
  }
164
182
  }
165
183
  }));
166
- n(M.mark, {
184
+ n(b.mark, {
167
185
  displayName: "MarkSchema<inlineCode>",
168
186
  group: "InlineCode"
169
187
  });
170
- n(M.ctx, {
188
+ n(b.ctx, {
171
189
  displayName: "MarkSchemaCtx<inlineCode>",
172
190
  group: "InlineCode"
173
191
  });
174
- const le = g("ToggleInlineCode", () => () => (t, e) => {
192
+ const me = g("ToggleInlineCode", () => () => (t, e) => {
175
193
  const { selection: r, tr: a } = t;
176
194
  if (r.empty)
177
195
  return !1;
178
196
  const { from: o, to: s } = r;
179
- return t.doc.rangeHasMark(o, s, M.type()) ? (e == null || e(a.removeMark(o, s, M.type())), !0) : (Object.keys(t.schema.marks).filter((c) => c !== M.type.name).map((c) => t.schema.marks[c]).forEach((c) => {
197
+ return t.doc.rangeHasMark(o, s, b.type()) ? (e == null || e(a.removeMark(o, s, b.type())), !0) : (Object.keys(t.schema.marks).filter((c) => c !== b.type.name).map((c) => t.schema.marks[c]).forEach((c) => {
180
198
  a.removeMark(o, s, c);
181
- }), e == null || e(a.addMark(o, s, M.type().create())), !0);
199
+ }), e == null || e(a.addMark(o, s, b.type().create())), !0);
182
200
  });
183
- n(le, {
201
+ n(me, {
184
202
  displayName: "Command<toggleInlineCodeCommand>",
185
203
  group: "InlineCode"
186
204
  });
187
- const ie = f("inlineCodeKeymap", {
205
+ const ue = f("inlineCodeKeymap", {
188
206
  ToggleInlineCode: {
189
207
  shortcuts: "Mod-e",
190
208
  command: (t) => {
191
209
  const e = t.get(h);
192
- return () => e.call(le.key);
210
+ return () => e.call(me.key);
193
211
  }
194
212
  }
195
213
  });
196
- n(ie.ctx, {
214
+ n(ue.ctx, {
197
215
  displayName: "KeymapCtx<inlineCode>",
198
216
  group: "InlineCode"
199
217
  });
200
- n(ie.shortcuts, {
218
+ n(ue.shortcuts, {
201
219
  displayName: "Keymap<inlineCode>",
202
220
  group: "InlineCode"
203
221
  });
204
- const ce = W("link");
205
- n(ce, {
222
+ const pe = j("link");
223
+ n(pe, {
206
224
  displayName: "Attr<link>",
207
225
  group: "Link"
208
226
  });
209
- const v = F("link", (t) => ({
227
+ const v = z("link", (t) => ({
210
228
  attrs: {
211
229
  href: {},
212
230
  title: { default: null }
@@ -216,12 +234,12 @@ const v = F("link", (t) => ({
216
234
  tag: "a[href]",
217
235
  getAttrs: (e) => {
218
236
  if (!(e instanceof HTMLElement))
219
- throw L(e);
237
+ throw S(e);
220
238
  return { href: e.getAttribute("href"), title: e.getAttribute("title") };
221
239
  }
222
240
  }
223
241
  ],
224
- toDOM: (e) => ["a", { ...t.get(ce.key)(e), ...e.attrs }],
242
+ toDOM: (e) => ["a", { ...t.get(pe.key)(e), ...e.attrs }],
225
243
  parseMarkdown: {
226
244
  match: (e) => e.type === "link",
227
245
  runner: (e, r, a) => {
@@ -243,12 +261,12 @@ n(v.mark, {
243
261
  displayName: "MarkSchema<link>",
244
262
  group: "Link"
245
263
  });
246
- const Xe = g("ToggleLink", () => (t = {}) => Q(v.type(), t));
247
- n(Xe, {
264
+ const rt = g("ToggleLink", () => (t = {}) => Ht(v.type(), t));
265
+ n(rt, {
248
266
  displayName: "Command<toggleLinkCommand>",
249
267
  group: "Link"
250
268
  });
251
- const Ze = g("UpdateLink", () => (t = {}) => (e, r) => {
269
+ const at = g("UpdateLink", () => (t = {}) => (e, r) => {
252
270
  if (!r)
253
271
  return !1;
254
272
  let a, o = -1;
@@ -263,14 +281,14 @@ const Ze = g("UpdateLink", () => (t = {}) => (e, r) => {
263
281
  return !1;
264
282
  const d = o, m = o + a.nodeSize, { tr: u } = e, y = v.type().create({ ...c.attrs, ...t });
265
283
  return y ? (r(
266
- u.removeMark(d, m, c).addMark(d, m, y).setSelection(new Ue(u.selection.$anchor)).scrollIntoView()
284
+ u.removeMark(d, m, c).addMark(d, m, y).setSelection(new V(u.selection.$anchor)).scrollIntoView()
267
285
  ), !0) : !1;
268
286
  });
269
- n(Ze, {
287
+ n(at, {
270
288
  displayName: "Command<updateLinkCommand>",
271
289
  group: "Link"
272
290
  });
273
- const et = Ve("doc", () => ({
291
+ const nt = Ye("doc", () => ({
274
292
  content: "block+",
275
293
  parseMarkdown: {
276
294
  match: ({ type: t }) => t === "root",
@@ -285,20 +303,20 @@ const et = Ve("doc", () => ({
285
303
  }
286
304
  }
287
305
  }));
288
- n(et, {
306
+ n(nt, {
289
307
  displayName: "NodeSchema<doc>",
290
308
  group: "Doc"
291
309
  });
292
- const de = N("paragraph");
293
- n(de, {
310
+ const ge = N("paragraph");
311
+ n(ge, {
294
312
  displayName: "Attr<paragraph>",
295
313
  group: "Paragraph"
296
314
  });
297
- const S = I("paragraph", (t) => ({
315
+ const w = I("paragraph", (t) => ({
298
316
  content: "inline*",
299
317
  group: "block",
300
318
  parseDOM: [{ tag: "p" }],
301
- toDOM: (e) => ["p", t.get(de.key)(e), 0],
319
+ toDOM: (e) => ["p", t.get(ge.key)(e), 0],
302
320
  parseMarkdown: {
303
321
  match: (e) => e.type === "paragraph",
304
322
  runner: (e, r, a) => {
@@ -308,52 +326,52 @@ const S = I("paragraph", (t) => ({
308
326
  toMarkdown: {
309
327
  match: (e) => e.type.name === "paragraph",
310
328
  runner: (e, r) => {
311
- e.openNode("paragraph"), Qe(e, r), e.closeNode();
329
+ e.openNode("paragraph"), tt(e, r), e.closeNode();
312
330
  }
313
331
  }
314
332
  }));
315
- n(S.node, {
333
+ n(w.node, {
316
334
  displayName: "NodeSchema<paragraph>",
317
335
  group: "Paragraph"
318
336
  });
319
- n(S.ctx, {
337
+ n(w.ctx, {
320
338
  displayName: "NodeSchemaCtx<paragraph>",
321
339
  group: "Paragraph"
322
340
  });
323
- const me = g("TurnIntoText", () => () => R(S.type()));
324
- n(me, {
341
+ const he = g("TurnIntoText", () => () => _(w.type()));
342
+ n(he, {
325
343
  displayName: "Command<turnIntoTextCommand>",
326
344
  group: "Paragraph"
327
345
  });
328
- const ue = f("paragraphKeymap", {
346
+ const ye = f("paragraphKeymap", {
329
347
  TurnIntoText: {
330
348
  shortcuts: "Mod-Alt-0",
331
349
  command: (t) => {
332
350
  const e = t.get(h);
333
- return () => e.call(me.key);
351
+ return () => e.call(he.key);
334
352
  }
335
353
  }
336
354
  });
337
- n(ue.ctx, {
355
+ n(ye.ctx, {
338
356
  displayName: "KeymapCtx<paragraph>",
339
357
  group: "Paragraph"
340
358
  });
341
- n(ue.shortcuts, {
359
+ n(ye.shortcuts, {
342
360
  displayName: "Keymap<paragraph>",
343
361
  group: "Paragraph"
344
362
  });
345
- const Dt = Array(6).fill(0).map((t, e) => e + 1), Pt = (t) => wt(t.textContent), z = J(Pt, "headingIdGenerator");
346
- n(z, {
363
+ const _t = Array(6).fill(0).map((t, e) => e + 1), $t = (t) => Tt(t.textContent), Q = ee($t, "headingIdGenerator");
364
+ n(Q, {
347
365
  displayName: "Ctx<HeadingIdGenerator>",
348
366
  group: "Heading"
349
367
  });
350
- const pe = N("heading");
351
- n(pe, {
368
+ const ke = N("heading");
369
+ n(ke, {
352
370
  displayName: "Attr<heading>",
353
371
  group: "Heading"
354
372
  });
355
- const w = I("heading", (t) => {
356
- const e = t.get(z.key);
373
+ const A = I("heading", (t) => {
374
+ const e = t.get(Q.key);
357
375
  return {
358
376
  content: "inline*",
359
377
  group: "block",
@@ -366,18 +384,18 @@ const w = I("heading", (t) => {
366
384
  default: 1
367
385
  }
368
386
  },
369
- parseDOM: Dt.map((r) => ({
387
+ parseDOM: _t.map((r) => ({
370
388
  tag: `h${r}`,
371
389
  getAttrs: (a) => {
372
390
  if (!(a instanceof HTMLElement))
373
- throw L(a);
391
+ throw S(a);
374
392
  return { level: r, id: a.id };
375
393
  }
376
394
  })),
377
395
  toDOM: (r) => [
378
396
  `h${r.attrs.level}`,
379
397
  {
380
- ...t.get(pe.key)(r),
398
+ ...t.get(ke.key)(r),
381
399
  id: r.attrs.id || e(r)
382
400
  },
383
401
  0
@@ -392,40 +410,40 @@ const w = I("heading", (t) => {
392
410
  toMarkdown: {
393
411
  match: (r) => r.type.name === "heading",
394
412
  runner: (r, a) => {
395
- r.openNode("heading", void 0, { depth: a.attrs.level }), Qe(r, a), r.closeNode();
413
+ r.openNode("heading", void 0, { depth: a.attrs.level }), tt(r, a), r.closeNode();
396
414
  }
397
415
  }
398
416
  };
399
417
  });
400
- n(w.node, {
418
+ n(A.node, {
401
419
  displayName: "NodeSchema<heading>",
402
420
  group: "Heading"
403
421
  });
404
- n(w.ctx, {
422
+ n(A.ctx, {
405
423
  displayName: "NodeSchemaCtx<heading>",
406
424
  group: "Heading"
407
425
  });
408
- const tt = x((t) => je(/^(?<hashes>#+)\s$/, w.type(), (e) => {
426
+ const ot = L((t) => Je(/^(?<hashes>#+)\s$/, A.type(), (e) => {
409
427
  var i, l;
410
- const r = ((l = (i = e.groups) == null ? void 0 : i.hashes) == null ? void 0 : l.length) || 0, a = t.get(Y), { $from: o } = a.state.selection, s = o.node();
428
+ const r = ((l = (i = e.groups) == null ? void 0 : i.hashes) == null ? void 0 : l.length) || 0, a = t.get(Z), { $from: o } = a.state.selection, s = o.node();
411
429
  if (s.type.name === "heading") {
412
430
  let c = Number(s.attrs.level) + Number(r);
413
431
  return c > 6 && (c = 6), { level: c };
414
432
  }
415
433
  return { level: r };
416
434
  }));
417
- n(tt, {
435
+ n(ot, {
418
436
  displayName: "InputRule<wrapInHeadingInputRule>",
419
437
  group: "Heading"
420
438
  });
421
- const C = g("WrapInHeading", () => (t) => (t ?? (t = 1), t < 1 ? R(S.type()) : R(w.type(), { level: t })));
422
- n(C, {
439
+ const M = g("WrapInHeading", () => (t) => (t ?? (t = 1), t < 1 ? _(w.type()) : _(A.type(), { level: t })));
440
+ n(M, {
423
441
  displayName: "Command<wrapInHeadingCommand>",
424
442
  group: "Heading"
425
443
  });
426
- const ge = g("DowngradeHeading", () => () => (t, e, r) => {
444
+ const fe = g("DowngradeHeading", () => () => (t, e, r) => {
427
445
  const { $from: a } = t.selection, o = a.node();
428
- if (o.type !== w.type() || !t.selection.empty || a.parentOffset !== 0)
446
+ if (o.type !== A.type() || !t.selection.empty || a.parentOffset !== 0)
429
447
  return !1;
430
448
  const s = o.attrs.level - 1;
431
449
  return s ? (e == null || e(
@@ -433,82 +451,82 @@ const ge = g("DowngradeHeading", () => () => (t, e, r) => {
433
451
  ...o.attrs,
434
452
  level: s
435
453
  })
436
- ), !0) : R(S.type())(t, e, r);
454
+ ), !0) : _(w.type())(t, e, r);
437
455
  });
438
- n(ge, {
456
+ n(fe, {
439
457
  displayName: "Command<downgradeHeadingCommand>",
440
458
  group: "Heading"
441
459
  });
442
- const he = f("headingKeymap", {
460
+ const Ne = f("headingKeymap", {
443
461
  TurnIntoH1: {
444
462
  shortcuts: "Mod-Alt-1",
445
463
  command: (t) => {
446
464
  const e = t.get(h);
447
- return () => e.call(C.key, 1);
465
+ return () => e.call(M.key, 1);
448
466
  }
449
467
  },
450
468
  TurnIntoH2: {
451
469
  shortcuts: "Mod-Alt-2",
452
470
  command: (t) => {
453
471
  const e = t.get(h);
454
- return () => e.call(C.key, 2);
472
+ return () => e.call(M.key, 2);
455
473
  }
456
474
  },
457
475
  TurnIntoH3: {
458
476
  shortcuts: "Mod-Alt-3",
459
477
  command: (t) => {
460
478
  const e = t.get(h);
461
- return () => e.call(C.key, 3);
479
+ return () => e.call(M.key, 3);
462
480
  }
463
481
  },
464
482
  TurnIntoH4: {
465
483
  shortcuts: "Mod-Alt-4",
466
484
  command: (t) => {
467
485
  const e = t.get(h);
468
- return () => e.call(C.key, 3);
486
+ return () => e.call(M.key, 3);
469
487
  }
470
488
  },
471
489
  TurnIntoH5: {
472
490
  shortcuts: "Mod-Alt-5",
473
491
  command: (t) => {
474
492
  const e = t.get(h);
475
- return () => e.call(C.key, 3);
493
+ return () => e.call(M.key, 3);
476
494
  }
477
495
  },
478
496
  TurnIntoH6: {
479
497
  shortcuts: "Mod-Alt-6",
480
498
  command: (t) => {
481
499
  const e = t.get(h);
482
- return () => e.call(C.key, 3);
500
+ return () => e.call(M.key, 3);
483
501
  }
484
502
  },
485
503
  DowngradeHeading: {
486
504
  shortcuts: ["Delete", "Backspace"],
487
505
  command: (t) => {
488
506
  const e = t.get(h);
489
- return () => e.call(ge.key);
507
+ return () => e.call(fe.key);
490
508
  }
491
509
  }
492
510
  });
493
- n(he.ctx, {
511
+ n(Ne.ctx, {
494
512
  displayName: "KeymapCtx<heading>",
495
513
  group: "Heading"
496
514
  });
497
- n(he.shortcuts, {
515
+ n(Ne.shortcuts, {
498
516
  displayName: "Keymap<heading>",
499
517
  group: "Heading"
500
518
  });
501
- const ye = N("blockquote");
502
- n(ye, {
519
+ const Ie = N("blockquote");
520
+ n(Ie, {
503
521
  displayName: "Attr<blockquote>",
504
522
  group: "Blockquote"
505
523
  });
506
- const E = I("blockquote", (t) => ({
524
+ const q = I("blockquote", (t) => ({
507
525
  content: "block+",
508
526
  group: "block",
509
527
  defining: !0,
510
528
  parseDOM: [{ tag: "blockquote" }],
511
- toDOM: (e) => ["blockquote", t.get(ye.key)(e), 0],
529
+ toDOM: (e) => ["blockquote", t.get(Ie.key)(e), 0],
512
530
  parseMarkdown: {
513
531
  match: ({ type: e }) => e === "blockquote",
514
532
  runner: (e, r, a) => {
@@ -522,50 +540,50 @@ const E = I("blockquote", (t) => ({
522
540
  }
523
541
  }
524
542
  }));
525
- n(E.node, {
543
+ n(q.node, {
526
544
  displayName: "NodeSchema<blockquote>",
527
545
  group: "Blockquote"
528
546
  });
529
- n(E.ctx, {
547
+ n(q.ctx, {
530
548
  displayName: "NodeSchemaCtx<blockquote>",
531
549
  group: "Blockquote"
532
550
  });
533
- const rt = x(() => Z(/^\s*>\s$/, E.type()));
534
- n(rt, {
551
+ const st = L(() => re(/^\s*>\s$/, q.type()));
552
+ n(st, {
535
553
  displayName: "InputRule<wrapInBlockquoteInputRule>",
536
554
  group: "Blockquote"
537
555
  });
538
- const ke = g("WrapInBlockquote", () => () => X(E.type()));
539
- n(ke, {
556
+ const Ce = g("WrapInBlockquote", () => () => te(q.type()));
557
+ n(Ce, {
540
558
  displayName: "Command<wrapInBlockquoteCommand>",
541
559
  group: "Blockquote"
542
560
  });
543
- const fe = f("blockquoteKeymap", {
561
+ const Me = f("blockquoteKeymap", {
544
562
  WrapInBlockquote: {
545
563
  shortcuts: "Mod-Shift-b",
546
564
  command: (t) => {
547
565
  const e = t.get(h);
548
- return () => e.call(ke.key);
566
+ return () => e.call(Ce.key);
549
567
  }
550
568
  }
551
569
  });
552
- n(fe.ctx, {
570
+ n(Me.ctx, {
553
571
  displayName: "KeymapCtx<blockquote>",
554
572
  group: "Blockquote"
555
573
  });
556
- n(fe.shortcuts, {
574
+ n(Me.shortcuts, {
557
575
  displayName: "Keymap<blockquote>",
558
576
  group: "Blockquote"
559
577
  });
560
- const Ne = N("codeBlock", () => ({
578
+ const be = N("codeBlock", () => ({
561
579
  pre: {},
562
580
  code: {}
563
581
  }));
564
- n(Ne, {
582
+ n(be, {
565
583
  displayName: "Attr<codeBlock>",
566
584
  group: "CodeBlock"
567
585
  });
568
- const _ = I("code_block", (t) => ({
586
+ const W = I("code_block", (t) => ({
569
587
  content: "text*",
570
588
  group: "block",
571
589
  marks: "",
@@ -582,13 +600,13 @@ const _ = I("code_block", (t) => ({
582
600
  preserveWhitespace: "full",
583
601
  getAttrs: (e) => {
584
602
  if (!(e instanceof HTMLElement))
585
- throw L(e);
603
+ throw S(e);
586
604
  return { language: e.dataset.language };
587
605
  }
588
606
  }
589
607
  ],
590
608
  toDOM: (e) => {
591
- const r = t.get(Ne.key)(e);
609
+ const r = t.get(be.key)(e);
592
610
  return [
593
611
  "pre",
594
612
  {
@@ -615,53 +633,53 @@ const _ = I("code_block", (t) => ({
615
633
  }
616
634
  }
617
635
  }));
618
- n(_.node, {
636
+ n(W.node, {
619
637
  displayName: "NodeSchema<codeBlock>",
620
638
  group: "CodeBlock"
621
639
  });
622
- n(_.ctx, {
640
+ n(W.ctx, {
623
641
  displayName: "NodeSchemaCtx<codeBlock>",
624
642
  group: "CodeBlock"
625
643
  });
626
- const at = x(() => je(/^```(?<language>[a-z]*)?[\s\n]$/, _.type(), (t) => {
644
+ const lt = L(() => Je(/^```(?<language>[a-z]*)?[\s\n]$/, W.type(), (t) => {
627
645
  var e;
628
646
  return {
629
647
  language: ((e = t.groups) == null ? void 0 : e.language) ?? ""
630
648
  };
631
649
  }));
632
- n(at, {
650
+ n(lt, {
633
651
  displayName: "InputRule<createCodeBlockInputRule>",
634
652
  group: "CodeBlock"
635
653
  });
636
- const Ie = g("CreateCodeBlock", () => (t = "") => R(_.type(), { language: t }));
637
- n(Ie, {
654
+ const xe = g("CreateCodeBlock", () => (t = "") => _(W.type(), { language: t }));
655
+ n(xe, {
638
656
  displayName: "Command<createCodeBlockCommand>",
639
657
  group: "CodeBlock"
640
658
  });
641
- const Rt = g("UpdateCodeBlockLanguage", () => ({ pos: t, language: e } = { pos: -1, language: "" }) => (r, a) => t >= 0 ? (a == null || a(r.tr.setNodeAttribute(t, "language", e)), !0) : !1);
642
- n(Rt, {
659
+ const qt = g("UpdateCodeBlockLanguage", () => ({ pos: t, language: e } = { pos: -1, language: "" }) => (r, a) => t >= 0 ? (a == null || a(r.tr.setNodeAttribute(t, "language", e)), !0) : !1);
660
+ n(qt, {
643
661
  displayName: "Command<updateCodeBlockLanguageCommand>",
644
662
  group: "CodeBlock"
645
663
  });
646
- const Ce = f("codeBlockKeymap", {
664
+ const Le = f("codeBlockKeymap", {
647
665
  CreateCodeBlock: {
648
666
  shortcuts: "Mod-Alt-c",
649
667
  command: (t) => {
650
668
  const e = t.get(h);
651
- return () => e.call(Ie.key);
669
+ return () => e.call(xe.key);
652
670
  }
653
671
  }
654
672
  });
655
- n(Ce.ctx, {
673
+ n(Le.ctx, {
656
674
  displayName: "KeymapCtx<codeBlock>",
657
675
  group: "CodeBlock"
658
676
  });
659
- n(Ce.shortcuts, {
677
+ n(Le.shortcuts, {
660
678
  displayName: "Keymap<codeBlock>",
661
679
  group: "CodeBlock"
662
680
  });
663
- const Me = N("image");
664
- n(Me, {
681
+ const Se = N("image");
682
+ n(Se, {
665
683
  displayName: "Attr<image>",
666
684
  group: "Image"
667
685
  });
@@ -684,7 +702,7 @@ const O = I("image", (t) => ({
684
702
  tag: "img[src]",
685
703
  getAttrs: (e) => {
686
704
  if (!(e instanceof HTMLElement))
687
- throw L(e);
705
+ throw S(e);
688
706
  return {
689
707
  src: e.getAttribute("src") || "",
690
708
  alt: e.getAttribute("alt") || "",
@@ -693,7 +711,7 @@ const O = I("image", (t) => ({
693
711
  }
694
712
  }
695
713
  ],
696
- toDOM: (e) => ["img", { ...t.get(Me.key)(e), ...e.attrs }],
714
+ toDOM: (e) => ["img", { ...t.get(Se.key)(e), ...e.attrs }],
697
715
  parseMarkdown: {
698
716
  match: ({ type: e }) => e === "image",
699
717
  runner: (e, r, a) => {
@@ -724,46 +742,46 @@ n(O.ctx, {
724
742
  displayName: "NodeSchemaCtx<image>",
725
743
  group: "Image"
726
744
  });
727
- const nt = g("InsertImage", () => (t = {}) => (e, r) => {
745
+ const it = g("InsertImage", () => (t = {}) => (e, r) => {
728
746
  if (!r)
729
747
  return !0;
730
748
  const { src: a = "", alt: o = "", title: s = "" } = t, i = O.type().create({ src: a, alt: o, title: s });
731
749
  return i && r(e.tr.replaceSelectionWith(i).scrollIntoView()), !0;
732
750
  });
733
- n(nt, {
751
+ n(it, {
734
752
  displayName: "Command<insertImageCommand>",
735
753
  group: "Image"
736
754
  });
737
- const ot = g("UpdateImage", () => (t = {}) => (e, r) => {
738
- const a = At(e.selection, O.type());
755
+ const ct = g("UpdateImage", () => (t = {}) => (e, r) => {
756
+ const a = Ot(e.selection, O.type());
739
757
  if (!a)
740
758
  return !1;
741
759
  const { node: o, pos: s } = a, i = { ...o.attrs }, { src: l, alt: c, title: d } = t;
742
760
  return l !== void 0 && (i.src = l), c !== void 0 && (i.alt = c), d !== void 0 && (i.title = d), r == null || r(e.tr.setNodeMarkup(s, void 0, i).scrollIntoView()), !0;
743
761
  });
744
- n(ot, {
762
+ n(ct, {
745
763
  displayName: "Command<updateImageCommand>",
746
764
  group: "Image"
747
765
  });
748
- const Et = x(() => new ze(
766
+ const Wt = L(() => new Qe(
749
767
  /!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,
750
768
  (t, e, r, a) => {
751
769
  const [o, s, i = "", l] = e;
752
770
  return o ? t.tr.replaceWith(r, a, O.type().create({ src: i, alt: s, title: l })) : null;
753
771
  }
754
772
  ));
755
- n(Et, {
773
+ n(Wt, {
756
774
  displayName: "InputRule<insertImageInputRule>",
757
775
  group: "Image"
758
776
  });
759
- const be = N("hardbreak", (t) => ({
777
+ const we = N("hardbreak", (t) => ({
760
778
  "data-is-inline": t.attrs.isInline
761
779
  }));
762
- n(be, {
780
+ n(we, {
763
781
  displayName: "Attr<hardbreak>",
764
782
  group: "Hardbreak"
765
783
  });
766
- const b = I("hardbreak", (t) => ({
784
+ const x = I("hardbreak", (t) => ({
767
785
  inline: !0,
768
786
  group: "inline",
769
787
  attrs: {
@@ -773,7 +791,7 @@ const b = I("hardbreak", (t) => ({
773
791
  },
774
792
  selectable: !1,
775
793
  parseDOM: [{ tag: "br" }],
776
- toDOM: (e) => ["br", t.get(be.key)(e)],
794
+ toDOM: (e) => ["br", t.get(we.key)(e)],
777
795
  parseMarkdown: {
778
796
  match: ({ type: e }) => e === "break",
779
797
  runner: (e, r, a) => {
@@ -791,56 +809,56 @@ const b = I("hardbreak", (t) => ({
791
809
  }
792
810
  }
793
811
  }));
794
- n(b.node, {
812
+ n(x.node, {
795
813
  displayName: "NodeSchema<hardbreak>",
796
814
  group: "Hardbreak"
797
815
  });
798
- n(b.ctx, {
816
+ n(x.ctx, {
799
817
  displayName: "NodeSchemaCtx<hardbreak>",
800
818
  group: "Hardbreak"
801
819
  });
802
- const xe = g("InsertHardbreak", () => () => (t, e) => {
820
+ const Ae = g("InsertHardbreak", () => () => (t, e) => {
803
821
  var o;
804
822
  const { selection: r, tr: a } = t;
805
823
  if (r.empty) {
806
824
  const s = r.$from.node();
807
825
  if (s.childCount > 0 && ((o = s.lastChild) == null ? void 0 : o.type.name) === "hardbreak")
808
826
  return e == null || e(
809
- a.replaceRangeWith(r.to - 1, r.to, t.schema.node("paragraph")).setSelection(Ye.near(a.doc.resolve(r.to))).scrollIntoView()
827
+ a.replaceRangeWith(r.to - 1, r.to, t.schema.node("paragraph")).setSelection(Xe.near(a.doc.resolve(r.to))).scrollIntoView()
810
828
  ), !0;
811
829
  }
812
- return e == null || e(a.setMeta("hardbreak", !0).replaceSelectionWith(b.type().create()).scrollIntoView()), !0;
830
+ return e == null || e(a.setMeta("hardbreak", !0).replaceSelectionWith(x.type().create()).scrollIntoView()), !0;
813
831
  });
814
- n(xe, {
832
+ n(Ae, {
815
833
  displayName: "Command<insertHardbreakCommand>",
816
834
  group: "Hardbreak"
817
835
  });
818
- const Le = f("hardbreakKeymap", {
836
+ const ve = f("hardbreakKeymap", {
819
837
  InsertHardbreak: {
820
838
  shortcuts: "Shift-Enter",
821
839
  command: (t) => {
822
840
  const e = t.get(h);
823
- return () => e.call(xe.key);
841
+ return () => e.call(Ae.key);
824
842
  }
825
843
  }
826
844
  });
827
- n(Le.ctx, {
845
+ n(ve.ctx, {
828
846
  displayName: "KeymapCtx<hardbreak>",
829
847
  group: "Hardbreak"
830
848
  });
831
- n(Le.shortcuts, {
849
+ n(ve.shortcuts, {
832
850
  displayName: "Keymap<hardbreak>",
833
851
  group: "Hardbreak"
834
852
  });
835
- const Se = N("hr");
836
- n(Se, {
853
+ const He = N("hr");
854
+ n(He, {
837
855
  displayName: "Attr<hr>",
838
856
  group: "Hr"
839
857
  });
840
- const $ = I("hr", (t) => ({
858
+ const F = I("hr", (t) => ({
841
859
  group: "block",
842
860
  parseDOM: [{ tag: "hr" }],
843
- toDOM: (e) => ["hr", t.get(Se.key)(e)],
861
+ toDOM: (e) => ["hr", t.get(He.key)(e)],
844
862
  parseMarkdown: {
845
863
  match: ({ type: e }) => e === "thematicBreak",
846
864
  runner: (e, r, a) => {
@@ -854,40 +872,40 @@ const $ = I("hr", (t) => ({
854
872
  }
855
873
  }
856
874
  }));
857
- n($.node, {
875
+ n(F.node, {
858
876
  displayName: "NodeSchema<hr>",
859
877
  group: "Hr"
860
878
  });
861
- n($.ctx, {
879
+ n(F.ctx, {
862
880
  displayName: "NodeSchemaCtx<hr>",
863
881
  group: "Hr"
864
882
  });
865
- const st = x(() => new ze(
883
+ const dt = L(() => new Qe(
866
884
  /^(?:---|___\s|\*\*\*\s)$/,
867
885
  (t, e, r, a) => {
868
886
  const { tr: o } = t;
869
- return e[0] && o.replaceWith(r - 1, a, $.type().create()), o;
887
+ return e[0] && o.replaceWith(r - 1, a, F.type().create()), o;
870
888
  }
871
889
  ));
872
- n(st, {
890
+ n(dt, {
873
891
  displayName: "InputRule<insertHrInputRule>",
874
892
  group: "Hr"
875
893
  });
876
- const lt = g("InsertHr", () => () => (t, e) => {
894
+ const mt = g("InsertHr", () => () => (t, e) => {
877
895
  if (!e)
878
896
  return !0;
879
- const r = S.node.type().create(), { tr: a, selection: o } = t, { from: s } = o, i = $.type().create();
897
+ const r = w.node.type().create(), { tr: a, selection: o } = t, { from: s } = o, i = F.type().create();
880
898
  if (!i)
881
899
  return !0;
882
- const l = a.replaceSelectionWith(i).insert(s, r), c = Ye.findFrom(l.doc.resolve(s), 1, !0);
900
+ const l = a.replaceSelectionWith(i).insert(s, r), c = Xe.findFrom(l.doc.resolve(s), 1, !0);
883
901
  return c && e(l.setSelection(c).scrollIntoView()), !0;
884
902
  });
885
- n(lt, {
903
+ n(mt, {
886
904
  displayName: "Command<insertHrCommand>",
887
905
  group: "Hr"
888
906
  });
889
- const we = N("bulletList");
890
- n(we, {
907
+ const Be = N("bulletList");
908
+ n(Be, {
891
909
  displayName: "Attr<bulletList>",
892
910
  group: "BulletList"
893
911
  });
@@ -904,7 +922,7 @@ const K = I("bullet_list", (t) => ({
904
922
  tag: "ul",
905
923
  getAttrs: (e) => {
906
924
  if (!(e instanceof HTMLElement))
907
- throw L(e);
925
+ throw S(e);
908
926
  return {
909
927
  spread: e.dataset.spread
910
928
  };
@@ -914,7 +932,7 @@ const K = I("bullet_list", (t) => ({
914
932
  toDOM: (e) => [
915
933
  "ul",
916
934
  {
917
- ...t.get(we.key)(e),
935
+ ...t.get(Be.key)(e),
918
936
  "data-spread": e.attrs.spread
919
937
  },
920
938
  0
@@ -941,35 +959,35 @@ n(K.ctx, {
941
959
  displayName: "NodeSchemaCtx<bulletList>",
942
960
  group: "BulletList"
943
961
  });
944
- const it = x(() => Z(/^\s*([-+*])\s$/, K.type()));
945
- n(it, {
962
+ const ut = L(() => re(/^\s*([-+*])\s$/, K.type()));
963
+ n(ut, {
946
964
  displayName: "InputRule<wrapInBulletListInputRule>",
947
965
  group: "BulletList"
948
966
  });
949
- const Ae = g("WrapInBulletList", () => () => X(K.type()));
950
- n(Ae, {
967
+ const Te = g("WrapInBulletList", () => () => te(K.type()));
968
+ n(Te, {
951
969
  displayName: "Command<wrapInBulletListCommand>",
952
970
  group: "BulletList"
953
971
  });
954
- const ve = f("bulletListKeymap", {
972
+ const Oe = f("bulletListKeymap", {
955
973
  WrapInBulletList: {
956
974
  shortcuts: "Mod-Alt-8",
957
975
  command: (t) => {
958
976
  const e = t.get(h);
959
- return () => e.call(Ae.key);
977
+ return () => e.call(Te.key);
960
978
  }
961
979
  }
962
980
  });
963
- n(ve.ctx, {
981
+ n(Oe.ctx, {
964
982
  displayName: "KeymapCtx<bulletListKeymap>",
965
983
  group: "BulletList"
966
984
  });
967
- n(ve.shortcuts, {
985
+ n(Oe.shortcuts, {
968
986
  displayName: "Keymap<bulletListKeymap>",
969
987
  group: "BulletList"
970
988
  });
971
- const He = N("orderedList");
972
- n(He, {
989
+ const Ke = N("orderedList");
990
+ n(Ke, {
973
991
  displayName: "Attr<orderedList>",
974
992
  group: "OrderedList"
975
993
  });
@@ -989,7 +1007,7 @@ const D = I("ordered_list", (t) => ({
989
1007
  tag: "ol",
990
1008
  getAttrs: (e) => {
991
1009
  if (!(e instanceof HTMLElement))
992
- throw L(e);
1010
+ throw S(e);
993
1011
  return {
994
1012
  spread: e.dataset.spread,
995
1013
  order: e.hasAttribute("start") ? Number(e.getAttribute("start")) : 1
@@ -1000,7 +1018,7 @@ const D = I("ordered_list", (t) => ({
1000
1018
  toDOM: (e) => [
1001
1019
  "ol",
1002
1020
  {
1003
- ...t.get(He.key)(e),
1021
+ ...t.get(Ke.key)(e),
1004
1022
  ...e.attrs.order === 1 ? {} : e.attrs.order,
1005
1023
  "data-spread": e.attrs.spread
1006
1024
  },
@@ -1028,44 +1046,44 @@ n(D.ctx, {
1028
1046
  displayName: "NodeSchemaCtx<orderedList>",
1029
1047
  group: "OrderedList"
1030
1048
  });
1031
- const ct = x(() => Z(
1049
+ const pt = L(() => re(
1032
1050
  /^\s*(\d+)\.\s$/,
1033
1051
  D.type(),
1034
1052
  (t) => ({ order: Number(t[1]) }),
1035
1053
  (t, e) => e.childCount + e.attrs.order === Number(t[1])
1036
1054
  ));
1037
- n(ct, {
1055
+ n(pt, {
1038
1056
  displayName: "InputRule<wrapInOrderedListInputRule>",
1039
1057
  group: "OrderedList"
1040
1058
  });
1041
- const Be = g("WrapInOrderedList", () => () => X(D.type()));
1042
- n(Be, {
1059
+ const De = g("WrapInOrderedList", () => () => te(D.type()));
1060
+ n(De, {
1043
1061
  displayName: "Command<wrapInOrderedListCommand>",
1044
1062
  group: "OrderedList"
1045
1063
  });
1046
- const Te = f("orderedListKeymap", {
1064
+ const Re = f("orderedListKeymap", {
1047
1065
  WrapInOrderedList: {
1048
1066
  shortcuts: "Mod-Alt-7",
1049
1067
  command: (t) => {
1050
1068
  const e = t.get(h);
1051
- return () => e.call(Be.key);
1069
+ return () => e.call(De.key);
1052
1070
  }
1053
1071
  }
1054
1072
  });
1055
- n(Te.ctx, {
1073
+ n(Re.ctx, {
1056
1074
  displayName: "KeymapCtx<orderedList>",
1057
1075
  group: "OrderedList"
1058
1076
  });
1059
- n(Te.shortcuts, {
1077
+ n(Re.shortcuts, {
1060
1078
  displayName: "Keymap<orderedList>",
1061
1079
  group: "OrderedList"
1062
1080
  });
1063
- const Oe = N("listItem");
1064
- n(Oe, {
1081
+ const Pe = N("listItem");
1082
+ n(Pe, {
1065
1083
  displayName: "Attr<listItem>",
1066
1084
  group: "ListItem"
1067
1085
  });
1068
- const A = I("list_item", (t) => ({
1086
+ const C = I("list_item", (t) => ({
1069
1087
  group: "listItem",
1070
1088
  content: "paragraph block*",
1071
1089
  attrs: {
@@ -1085,7 +1103,7 @@ const A = I("list_item", (t) => ({
1085
1103
  tag: "li",
1086
1104
  getAttrs: (e) => {
1087
1105
  if (!(e instanceof HTMLElement))
1088
- throw L(e);
1106
+ throw S(e);
1089
1107
  return {
1090
1108
  label: e.dataset.label,
1091
1109
  listType: e.dataset["list-type"],
@@ -1097,7 +1115,7 @@ const A = I("list_item", (t) => ({
1097
1115
  toDOM: (e) => [
1098
1116
  "li",
1099
1117
  {
1100
- ...t.get(Oe.key)(e),
1118
+ ...t.get(Pe.key)(e),
1101
1119
  "data-label": e.attrs.label,
1102
1120
  "data-list-type": e.attrs.listType,
1103
1121
  "data-spread": e.attrs.spread
@@ -1118,61 +1136,82 @@ const A = I("list_item", (t) => ({
1118
1136
  }
1119
1137
  }
1120
1138
  }));
1121
- n(A.node, {
1139
+ n(C.node, {
1122
1140
  displayName: "NodeSchema<listItem>",
1123
1141
  group: "ListItem"
1124
1142
  });
1125
- n(A.ctx, {
1143
+ n(C.ctx, {
1126
1144
  displayName: "NodeSchemaCtx<listItem>",
1127
1145
  group: "ListItem"
1128
1146
  });
1129
- const Ke = g("SinkListItem", () => () => vt(A.type()));
1130
- n(Ke, {
1147
+ const Ee = g("SinkListItem", () => () => Kt(C.type()));
1148
+ n(Ee, {
1131
1149
  displayName: "Command<sinkListItemCommand>",
1132
1150
  group: "ListItem"
1133
1151
  });
1134
- const De = g("SplitListItem", () => () => Ht(A.type()));
1135
- n(De, {
1152
+ const _e = g("SplitListItem", () => () => et(C.type()));
1153
+ n(_e, {
1136
1154
  displayName: "Command<liftListItemCommand>",
1137
1155
  group: "ListItem"
1138
1156
  });
1139
- const Pe = g("SplitListItem", () => () => Bt(A.type()));
1140
- n(Pe, {
1157
+ const $e = g("SplitListItem", () => () => Dt(C.type()));
1158
+ n($e, {
1141
1159
  displayName: "Command<splitListItemCommand>",
1142
1160
  group: "ListItem"
1143
1161
  });
1144
- const Re = f("listItemKeymap", {
1162
+ const Ft = (t, e, r) => {
1163
+ const { selection: a } = t;
1164
+ if (!(a instanceof V))
1165
+ return !1;
1166
+ const { empty: o, $from: s } = a;
1167
+ if (!o || s.parentOffset !== 0)
1168
+ return !1;
1169
+ const i = s.node(-1);
1170
+ return i.type !== C.type() || i.firstChild !== s.node() || s.node(-2).childCount > 1 ? !1 : et(C.type())(t, e, r);
1171
+ }, qe = g("LiftFirstListItem", () => () => Ft);
1172
+ n(qe, {
1173
+ displayName: "Command<liftFirstListItemCommand>",
1174
+ group: "ListItem"
1175
+ });
1176
+ const We = f("listItemKeymap", {
1145
1177
  NextListItem: {
1146
1178
  shortcuts: "Enter",
1147
1179
  command: (t) => {
1148
1180
  const e = t.get(h);
1149
- return () => e.call(Pe.key);
1181
+ return () => e.call($e.key);
1150
1182
  }
1151
1183
  },
1152
1184
  SinkListItem: {
1153
1185
  shortcuts: ["Tab", "Mod-]"],
1154
1186
  command: (t) => {
1155
1187
  const e = t.get(h);
1156
- return () => e.call(Ke.key);
1188
+ return () => e.call(Ee.key);
1157
1189
  }
1158
1190
  },
1159
1191
  LiftListItem: {
1160
1192
  shortcuts: ["Shift-Tab", "Mod-["],
1161
1193
  command: (t) => {
1162
1194
  const e = t.get(h);
1163
- return () => e.call(De.key);
1195
+ return () => e.call(_e.key);
1196
+ }
1197
+ },
1198
+ LiftFirstListItem: {
1199
+ shortcuts: ["Backspace", "Delete"],
1200
+ command: (t) => {
1201
+ const e = t.get(h);
1202
+ return () => e.call(qe.key);
1164
1203
  }
1165
1204
  }
1166
1205
  });
1167
- n(Re.ctx, {
1206
+ n(We.ctx, {
1168
1207
  displayName: "KeymapCtx<listItem>",
1169
1208
  group: "ListItem"
1170
1209
  });
1171
- n(Re.shortcuts, {
1210
+ n(We.shortcuts, {
1172
1211
  displayName: "Keymap<listItem>",
1173
1212
  group: "ListItem"
1174
1213
  });
1175
- const dt = Ve("text", () => ({
1214
+ const gt = Ye("text", () => ({
1176
1215
  group: "inline",
1177
1216
  parseMarkdown: {
1178
1217
  match: ({ type: t }) => t === "text",
@@ -1187,16 +1226,16 @@ const dt = Ve("text", () => ({
1187
1226
  }
1188
1227
  }
1189
1228
  }));
1190
- n(dt, {
1229
+ n(gt, {
1191
1230
  displayName: "NodeSchema<text>",
1192
1231
  group: "Text"
1193
1232
  });
1194
- const Ee = N("html");
1195
- n(Ee, {
1233
+ const Fe = N("html");
1234
+ n(Fe, {
1196
1235
  displayName: "Attr<html>",
1197
1236
  group: "Html"
1198
1237
  });
1199
- const _e = I("html", (t) => ({
1238
+ const Ge = I("html", (t) => ({
1200
1239
  atom: !0,
1201
1240
  group: "inline",
1202
1241
  inline: !0,
@@ -1207,7 +1246,7 @@ const _e = I("html", (t) => ({
1207
1246
  },
1208
1247
  toDOM: (e) => {
1209
1248
  const r = document.createElement("span"), a = {
1210
- ...t.get(Ee.key)(e),
1249
+ ...t.get(Fe.key)(e),
1211
1250
  "data-value": e.attrs.value,
1212
1251
  "data-type": "html"
1213
1252
  };
@@ -1232,101 +1271,102 @@ const _e = I("html", (t) => ({
1232
1271
  }
1233
1272
  }
1234
1273
  }));
1235
- n(_e.node, {
1274
+ n(Ge.node, {
1236
1275
  displayName: "NodeSchema<html>",
1237
1276
  group: "Html"
1238
1277
  });
1239
- n(_e.ctx, {
1278
+ n(Ge.ctx, {
1240
1279
  displayName: "NodeSchemaCtx<html>",
1241
1280
  group: "Html"
1242
1281
  });
1243
- const _t = [
1244
- et,
1245
- de,
1246
- S,
1247
- z,
1248
- pe,
1282
+ const Gt = [
1283
+ nt,
1284
+ ge,
1249
1285
  w,
1286
+ Q,
1287
+ ke,
1288
+ A,
1289
+ we,
1290
+ x,
1291
+ Ie,
1292
+ q,
1250
1293
  be,
1251
- b,
1252
- ye,
1253
- E,
1254
- Ne,
1255
- _,
1294
+ W,
1295
+ He,
1296
+ F,
1256
1297
  Se,
1257
- $,
1258
- Me,
1259
1298
  O,
1260
- we,
1299
+ Be,
1261
1300
  K,
1262
- He,
1301
+ Ke,
1263
1302
  D,
1264
- Oe,
1265
- A,
1266
- ee,
1267
- V,
1268
- ae,
1269
- j,
1270
- se,
1271
- M,
1272
- ce,
1303
+ Pe,
1304
+ C,
1305
+ ne,
1306
+ Y,
1307
+ le,
1308
+ J,
1309
+ de,
1310
+ b,
1311
+ pe,
1273
1312
  v,
1274
- Ee,
1275
- _e,
1276
- dt
1277
- ].flat(), $t = [
1278
- rt,
1279
- it,
1280
- ct,
1281
- at,
1313
+ Fe,
1314
+ Ge,
1315
+ gt
1316
+ ].flat(), Vt = [
1282
1317
  st,
1283
- tt
1284
- ].flat(), qt = [
1285
- me,
1286
- ke,
1287
- C,
1288
- ge,
1289
- Ie,
1290
- xe,
1318
+ ut,
1319
+ pt,
1291
1320
  lt,
1292
- nt,
1293
- ot,
1294
- Be,
1321
+ dt,
1322
+ ot
1323
+ ].flat(), jt = [
1324
+ he,
1325
+ Ce,
1326
+ M,
1327
+ fe,
1328
+ xe,
1295
1329
  Ae,
1296
- Ke,
1297
- Pe,
1330
+ mt,
1331
+ it,
1332
+ ct,
1298
1333
  De,
1299
- te,
1300
- le,
1301
- ne,
1302
- Xe,
1303
- Ze
1304
- ], Wt = [
1305
- fe,
1306
- Ce,
1307
- Le,
1308
- he,
1309
- Re,
1310
1334
  Te,
1335
+ Ee,
1336
+ $e,
1337
+ _e,
1338
+ qe,
1339
+ oe,
1340
+ me,
1341
+ ie,
1342
+ rt,
1343
+ at
1344
+ ], zt = [
1345
+ Me,
1346
+ Le,
1311
1347
  ve,
1348
+ Ne,
1349
+ We,
1350
+ Re,
1351
+ Oe,
1352
+ ye,
1353
+ se,
1312
1354
  ue,
1313
- re,
1314
- ie,
1315
- oe
1316
- ].flat(), U = /\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/, Ft = (t) => new RegExp(`\\\\(?=[^\\w\\s${t}\\\\]|_)`, "g"), Gt = (t) => {
1317
- let e = t, r = e.match(U);
1355
+ ce
1356
+ ].flat(), Ut = /\[([^\]]+)]\([^\s\]]+\)/, X = /\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/, Yt = (t) => new RegExp(`\\\\(?=[^\\w\\s${t}\\\\]|_)`, "g"), Jt = (t) => {
1357
+ let e = t, r = e.match(X);
1318
1358
  for (; r && r.groups; ) {
1319
1359
  const { span: a } = r.groups;
1320
- e = e.replace(U, a), r = e.match(U);
1360
+ e = e.replace(X, a), r = e.match(X);
1321
1361
  }
1322
1362
  return e;
1323
- }, Vt = (t, e, r) => {
1363
+ }, Qt = (t, e, r) => {
1324
1364
  const a = t.split(""), o = a[e];
1325
1365
  return a[e] && a[r] && (a[e] = a[r], a[r] = o), a.join("").toString();
1326
- }, jt = (t) => (e) => e.replace(Ft(t), ""), zt = (t) => (e) => {
1366
+ }, Xt = (t) => (e) => e.replace(Yt(t), ""), Zt = (t) => (e) => {
1327
1367
  const r = e.indexOf(t.hole), a = e.charAt(r - 1), o = e.charAt(r + 1), s = /[^\w]|_/;
1328
1368
  return o ? a && s.test(a) && s.test(o) ? t.punctuation : t.char : t.punctuation;
1329
- }, Ut = (t, e, r) => {
1369
+ }, er = (t, e, r) => {
1330
1370
  let a = e, o = !1;
1331
1371
  return t.descendants((s) => {
1332
1372
  var i;
@@ -1341,7 +1381,7 @@ const _t = [
1341
1381
  }
1342
1382
  return a += 1, !0;
1343
1383
  }), a;
1344
- }, Yt = {
1384
+ }, tr = {
1345
1385
  placeholderConfig: {
1346
1386
  hole: "∅",
1347
1387
  punctuation: "⁂",
@@ -1353,46 +1393,46 @@ const _t = [
1353
1393
  const r = ["*", "_"];
1354
1394
  let a = e.indexOf(t);
1355
1395
  for (; r.includes(e[a - 1] || "") && r.includes(e[a + 1] || ""); )
1356
- e = Vt(e, a, a + 1), a = a + 1;
1396
+ e = Qt(e, a, a + 1), a = a + 1;
1357
1397
  return e;
1358
1398
  }
1359
- }, P = J(Yt, "inlineSyncConfig");
1360
- n(P, {
1399
+ }, R = ee(tr, "inlineSyncConfig");
1400
+ n(R, {
1361
1401
  displayName: "Ctx<inlineSyncConfig>",
1362
1402
  group: "Prose"
1363
1403
  });
1364
- const Jt = (t) => t.selection.$from.node(), Qt = (t, e, r, a) => {
1365
- const o = t.get(xt), s = e.schema.topNodeType.create(void 0, [r, ...a]);
1404
+ const rr = (t) => t.selection.$from.node(), ar = (t, e, r, a) => {
1405
+ const o = t.get(At), s = e.schema.topNodeType.create(void 0, [r, ...a]);
1366
1406
  return o(s);
1367
- }, Xt = (t, e) => {
1368
- const r = t.get(P.key), a = r.placeholderConfig.hole, [o = "", ...s] = e.split(`
1407
+ }, nr = (t, e) => {
1408
+ const r = t.get(R.key), a = r.placeholderConfig.hole, [o = "", ...s] = e.split(`
1369
1409
 
1370
1410
  `), i = (m) => r.movePlaceholder(a, m);
1371
- let c = bt(jt(a), i, Gt)(o);
1372
- const d = zt(r.placeholderConfig)(c);
1411
+ let c = wt(Xt(a), i, Jt)(o);
1412
+ const d = Zt(r.placeholderConfig)(c);
1373
1413
  return c = c.replace(a, d), c = [c, ...s].join(`
1374
1414
 
1375
1415
  `), [c, d];
1376
- }, Zt = (t, e) => {
1377
- const a = t.get(Lt)(e);
1416
+ }, or = (t, e) => {
1417
+ const a = t.get(vt)(e);
1378
1418
  return a ? a.firstChild : null;
1379
- }, er = (t, e) => {
1380
- const { globalNodes: r } = t.get(P.key), a = [];
1419
+ }, sr = (t, e) => {
1420
+ const { globalNodes: r } = t.get(R.key), a = [];
1381
1421
  return e.doc.descendants((o) => {
1382
1422
  if (r.includes(o.type.name) || r.includes(o.type))
1383
1423
  return a.push(o), !1;
1384
1424
  }), a;
1385
- }, tr = (t) => t.split(`
1425
+ }, lr = (t) => t.split(`
1386
1426
 
1387
- `)[0] || "", rr = (t) => t.childCount === 1 && t.child(0).type.name === "html", mt = (t, e) => {
1427
+ `)[0] || "", ir = (t) => t.childCount === 1 && t.child(0).type.name === "html", ht = (t, e) => {
1388
1428
  try {
1389
- const r = er(t, e), a = Jt(e), o = Qt(t, e, a, r), [s, i] = Xt(t, o), l = Zt(t, s);
1390
- return !l || a.type !== l.type || rr(l) ? null : (l.attrs = { ...a.attrs }, l.descendants((c) => {
1429
+ const r = sr(t, e), a = rr(e), o = ar(t, e, a, r), [s, i] = nr(t, o), l = or(t, s);
1430
+ return !l || a.type !== l.type || ir(l) ? null : (l.attrs = { ...a.attrs }, l.descendants((c) => {
1391
1431
  var u;
1392
1432
  const m = c.marks.find((y) => y.type.name === "link");
1393
1433
  m && ((u = c.text) != null && u.includes(i)) && m.attrs.href.includes(i) && (m.attrs.href = m.attrs.href.replace(i, ""));
1394
1434
  }), {
1395
- text: tr(s),
1435
+ text: lr(s),
1396
1436
  prevNode: a,
1397
1437
  nextNode: l,
1398
1438
  placeholder: i
@@ -1400,15 +1440,18 @@ const Jt = (t) => t.selection.$from.node(), Qt = (t, e, r, a) => {
1400
1440
  } catch {
1401
1441
  return null;
1402
1442
  }
1403
- }, ar = (t, e, r, a, o) => {
1404
- const { placeholderConfig: s } = t.get(P.key), i = s.hole;
1443
+ }, cr = (t, e, r, a, o) => {
1444
+ var E;
1445
+ const { placeholderConfig: s } = t.get(R.key), i = s.hole;
1405
1446
  let l = r.tr.setMeta(e, !0).insertText(i, r.selection.from);
1406
- const c = r.apply(l), d = mt(t, c);
1447
+ const c = r.apply(l), d = ht(t, c);
1407
1448
  if (!d)
1408
1449
  return;
1409
- const { $from: m } = c.selection, u = m.before(), y = m.after(), p = Ut(d.nextNode, u, d.placeholder);
1410
- l = l.replaceWith(u, y, d.nextNode).setNodeMarkup(u, void 0, o).delete(p + 1, p + 2), l = l.setSelection(Ue.near(l.doc.resolve(p + 1))), a(l);
1411
- }, ut = H((t) => {
1450
+ const m = d.text.slice(0, d.text.indexOf(d.placeholder)), { $from: u } = c.selection, y = u.before(), p = u.after(), k = er(d.nextNode, y, d.placeholder);
1451
+ l = l.replaceWith(y, p, d.nextNode).setNodeMarkup(y, void 0, o).delete(k + 1, k + 2), l = l.setSelection(V.near(l.doc.resolve(k + 1))), (Ut.test(m) || ["*", "_", "~"].includes(m.at(-1) || "")) && l.selection instanceof V && (((E = l.selection.$cursor) == null ? void 0 : E.marks()) ?? []).forEach((G) => {
1452
+ l = l.removeStoredMark(G.type);
1453
+ }), a(l);
1454
+ }, yt = H((t) => {
1412
1455
  let e = null;
1413
1456
  const r = new B("MILKDOWN_INLINE_SYNC");
1414
1457
  return new T({
@@ -1417,29 +1460,29 @@ const Jt = (t) => t.selection.$from.node(), Qt = (t, e, r, a) => {
1417
1460
  init: () => null,
1418
1461
  apply: (a, o, s, i) => {
1419
1462
  var k;
1420
- const l = t.get(Y);
1463
+ const l = t.get(Z);
1421
1464
  if (!((k = l.hasFocus) != null && k.call(l)) || !l.editable || !a.docChanged || a.getMeta(r))
1422
1465
  return null;
1423
- const d = mt(t, i);
1466
+ const d = ht(t, i);
1424
1467
  if (!d)
1425
1468
  return null;
1426
1469
  e && (cancelAnimationFrame(e), e = null);
1427
- const { prevNode: m, nextNode: u, text: y } = d, { shouldSyncNode: p } = t.get(P.key);
1470
+ const { prevNode: m, nextNode: u, text: y } = d, { shouldSyncNode: p } = t.get(R.key);
1428
1471
  return p({ prevNode: m, nextNode: u, ctx: t, tr: a, text: y }) && (e = requestAnimationFrame(() => {
1429
1472
  e = null;
1430
- const { dispatch: q, state: qe } = t.get(Y);
1431
- ar(t, r, qe, q, m.attrs);
1432
- }), a.setMeta("addToHistory", !1)), null;
1473
+ const { dispatch: P, state: E } = t.get(Z);
1474
+ cr(t, r, E, P, m.attrs);
1475
+ })), null;
1433
1476
  }
1434
1477
  }
1435
1478
  });
1436
1479
  });
1437
- n(ut, {
1480
+ n(yt, {
1438
1481
  displayName: "Prose<inlineSyncPlugin>",
1439
1482
  group: "Prose"
1440
1483
  });
1441
- const pt = G(() => () => (t) => {
1442
- Je(t, "list", (e) => {
1484
+ const kt = $(() => () => (t) => {
1485
+ ae(t, "list", (e) => {
1443
1486
  if (e.ordered) {
1444
1487
  const r = e.start ?? 1;
1445
1488
  e.children.forEach((a, o) => {
@@ -1448,13 +1491,13 @@ const pt = G(() => () => (t) => {
1448
1491
  }
1449
1492
  });
1450
1493
  });
1451
- n(pt, {
1494
+ n(kt, {
1452
1495
  displayName: "Remark<remarkAddOrderInListPlugin>",
1453
1496
  group: "Remark"
1454
1497
  });
1455
- const gt = G(() => () => (t) => {
1498
+ const ft = $(() => () => (t) => {
1456
1499
  const e = /[\t ]*(?:\r?\n|\r)/g;
1457
- Je(t, "text", (r, a, o) => {
1500
+ ae(t, "text", (r, a, o) => {
1458
1501
  if (!r.value || typeof r.value != "string")
1459
1502
  return;
1460
1503
  const s = [];
@@ -1469,20 +1512,20 @@ const gt = G(() => () => (t) => {
1469
1512
  return i < r.value.length && s.push({ type: "text", value: r.value.slice(i) }), o.children.splice(a, 1, ...s), a + s.length;
1470
1513
  });
1471
1514
  });
1472
- n(gt, {
1515
+ n(ft, {
1473
1516
  displayName: "Remark<remarkLineBreak>",
1474
1517
  group: "Remark"
1475
1518
  });
1476
- const ht = G(() => Kt);
1477
- n(ht, {
1519
+ const Nt = $(() => Et);
1520
+ n(Nt, {
1478
1521
  displayName: "Remark<remarkInlineLinkPlugin>",
1479
1522
  group: "Remark"
1480
1523
  });
1481
- const nr = (t) => !!t.children, or = (t) => t.type === "html";
1482
- function sr(t, e) {
1524
+ const dr = (t) => !!t.children, mr = (t) => t.type === "html";
1525
+ function ur(t, e) {
1483
1526
  return r(t, 0, null)[0];
1484
1527
  function r(a, o, s) {
1485
- if (nr(a)) {
1528
+ if (dr(a)) {
1486
1529
  const i = [];
1487
1530
  for (let l = 0, c = a.children.length; l < c; l++) {
1488
1531
  const d = a.children[l];
@@ -1500,14 +1543,24 @@ function sr(t, e) {
1500
1543
  return e(a, o, s);
1501
1544
  }
1502
1545
  }
1503
- const yt = G(() => () => (t) => {
1504
- sr(t, (e, r, a) => or(e) ? ((a == null ? void 0 : a.type) === "root" && (e.children = [{ ...e }], delete e.value, e.type = "paragraph"), [e]) : [e]);
1546
+ const It = $(() => () => (t) => {
1547
+ ur(t, (e, r, a) => mr(e) ? ((a == null ? void 0 : a.type) === "root" && (e.children = [{ ...e }], delete e.value, e.type = "paragraph"), [e]) : [e]);
1505
1548
  });
1506
- n(yt, {
1549
+ n(It, {
1507
1550
  displayName: "Remark<remarkHtmlTransformer>",
1508
1551
  group: "Remark"
1509
1552
  });
1510
- const kt = H(() => {
1553
+ const Ct = $(() => () => (t, e) => {
1554
+ const r = (a) => e.value.charAt(a.position.start.offset);
1555
+ ae(t, (a) => ["strong", "emphasis"].includes(a.type), (a) => {
1556
+ a.marker = r(a);
1557
+ });
1558
+ });
1559
+ n(Ct, {
1560
+ displayName: "Remark<remarkMarker>",
1561
+ group: "Remark"
1562
+ });
1563
+ const Mt = H(() => {
1511
1564
  let t = !1;
1512
1565
  const e = new B("MILKDOWN_INLINE_NODES_CURSOR"), r = new T({
1513
1566
  key: e,
@@ -1541,24 +1594,24 @@ const kt = H(() => {
1541
1594
  },
1542
1595
  decorations(a) {
1543
1596
  if (r.getState(a)) {
1544
- const i = a.selection.$from.pos, l = document.createElement("span"), c = Fe.widget(i, l, {
1597
+ const i = a.selection.$from.pos, l = document.createElement("span"), c = ze.widget(i, l, {
1545
1598
  side: -1
1546
- }), d = document.createElement("span"), m = Fe.widget(i, d);
1599
+ }), d = document.createElement("span"), m = ze.widget(i, d);
1547
1600
  return setTimeout(() => {
1548
1601
  l.contentEditable = "true", d.contentEditable = "true";
1549
- }), Ge.create(a.doc, [c, m]);
1602
+ }), Ue.create(a.doc, [c, m]);
1550
1603
  }
1551
- return Ge.empty;
1604
+ return Ue.empty;
1552
1605
  }
1553
1606
  }
1554
1607
  });
1555
1608
  return r;
1556
1609
  });
1557
- n(kt, {
1610
+ n(Mt, {
1558
1611
  displayName: "Prose<inlineNodesCursorPlugin>",
1559
1612
  group: "Prose"
1560
1613
  });
1561
- const ft = H(() => new T({
1614
+ const bt = H(() => new T({
1562
1615
  key: new B("MILKDOWN_HARDBREAK_MARKS"),
1563
1616
  appendTransaction: (t, e, r) => {
1564
1617
  if (!t.length)
@@ -1568,31 +1621,31 @@ const ft = H(() => new T({
1568
1621
  return;
1569
1622
  const [o] = a.steps;
1570
1623
  if (a.getMeta("hardbreak")) {
1571
- if (!(o instanceof Tt))
1624
+ if (!(o instanceof Rt))
1572
1625
  return;
1573
1626
  const { from: l } = o;
1574
- return r.tr.setNodeMarkup(l, b.type(), void 0, []);
1627
+ return r.tr.setNodeMarkup(l, x.type(), void 0, []);
1575
1628
  }
1576
- if (o instanceof Ot) {
1629
+ if (o instanceof Pt) {
1577
1630
  let l = r.tr;
1578
1631
  const { from: c, to: d } = o;
1579
1632
  return r.doc.nodesBetween(c, d, (m, u) => {
1580
- m.type === b.type() && (l = l.setNodeMarkup(u, b.type(), void 0, []));
1633
+ m.type === x.type() && (l = l.setNodeMarkup(u, x.type(), void 0, []));
1581
1634
  }), l;
1582
1635
  }
1583
1636
  }
1584
1637
  }));
1585
- n(ft, {
1638
+ n(bt, {
1586
1639
  displayName: "Prose<hardbreakClearMarkPlugin>",
1587
1640
  group: "Prose"
1588
1641
  });
1589
- const $e = J(["table", "code_block"], "hardbreakFilterNodes");
1590
- n($e, {
1642
+ const Ve = ee(["table", "code_block"], "hardbreakFilterNodes");
1643
+ n(Ve, {
1591
1644
  displayName: "Ctx<hardbreakFilterNodes>",
1592
1645
  group: "Prose"
1593
1646
  });
1594
- const Nt = H((t) => {
1595
- const e = t.get($e.key);
1647
+ const xt = H((t) => {
1648
+ const e = t.get(Ve.key);
1596
1649
  return new T({
1597
1650
  key: new B("MILKDOWN_HARDBREAK_FILTER"),
1598
1651
  filterTransaction: (r, a) => {
@@ -1608,18 +1661,18 @@ const Nt = H((t) => {
1608
1661
  }
1609
1662
  });
1610
1663
  });
1611
- n(Nt, {
1664
+ n(xt, {
1612
1665
  displayName: "Prose<hardbreakFilterPlugin>",
1613
1666
  group: "Prose"
1614
1667
  });
1615
- const It = H((t) => {
1668
+ const Lt = H((t) => {
1616
1669
  const e = new B("MILKDOWN_HEADING_ID"), r = (a) => {
1617
1670
  if (a.composing || !a.editable)
1618
1671
  return;
1619
- const o = t.get(z.key), s = a.state.tr.setMeta("addToHistory", !1);
1672
+ const o = t.get(Q.key), s = a.state.tr.setMeta("addToHistory", !1);
1620
1673
  let i = !1;
1621
1674
  a.state.doc.descendants((l, c) => {
1622
- if (l.type === w.type()) {
1675
+ if (l.type === A.type()) {
1623
1676
  if (l.textContent.trim().length === 0)
1624
1677
  return;
1625
1678
  const d = l.attrs, m = o(l);
@@ -1639,15 +1692,15 @@ const It = H((t) => {
1639
1692
  })
1640
1693
  });
1641
1694
  });
1642
- n(It, {
1695
+ n(Lt, {
1643
1696
  displayName: "Prose<syncHeadingIdPlugin>",
1644
1697
  group: "Prose"
1645
1698
  });
1646
- const Ct = H(() => {
1699
+ const St = H(() => {
1647
1700
  const t = (e) => {
1648
1701
  if (e.composing || !e.editable)
1649
1702
  return;
1650
- const r = D.type(), a = K.type(), o = A.type(), s = e.state, i = (d, m) => {
1703
+ const r = D.type(), a = K.type(), o = C.type(), s = e.state, i = (d, m) => {
1651
1704
  let u = !1;
1652
1705
  const y = `${m + 1}.`;
1653
1706
  return d.label !== y && (d.label = y, u = !0), u;
@@ -1656,10 +1709,10 @@ const Ct = H(() => {
1656
1709
  s.doc.descendants((d, m, u, y) => {
1657
1710
  if (d.type === a) {
1658
1711
  const p = d.maybeChild(0);
1659
- (p == null ? void 0 : p.type) === o && p.attrs.listType === "ordered" && (c = !0, l.setNodeMarkup(m, r, { spread: "true" }), d.descendants((k, q, qe, Mt) => {
1712
+ (p == null ? void 0 : p.type) === o && p.attrs.listType === "ordered" && (c = !0, l.setNodeMarkup(m, r, { spread: "true" }), d.descendants((k, P, E, je) => {
1660
1713
  if (k.type === o) {
1661
- const We = { ...k.attrs };
1662
- i(We, Mt) && (l = l.setNodeMarkup(q, void 0, We));
1714
+ const G = { ...k.attrs };
1715
+ i(G, je) && (l = l.setNodeMarkup(P, void 0, G));
1663
1716
  }
1664
1717
  return !1;
1665
1718
  }));
@@ -1679,114 +1732,117 @@ const Ct = H(() => {
1679
1732
  })
1680
1733
  });
1681
1734
  });
1682
- n(Ct, {
1735
+ n(St, {
1683
1736
  displayName: "Prose<syncListOrderPlugin>",
1684
1737
  group: "Prose"
1685
1738
  });
1686
- const lr = [
1687
- P,
1688
- ut,
1689
- ft,
1690
- $e,
1691
- Nt,
1692
- kt,
1693
- pt,
1694
- ht,
1695
- gt,
1739
+ const pr = [
1740
+ R,
1696
1741
  yt,
1742
+ bt,
1743
+ Ve,
1744
+ xt,
1745
+ Mt,
1746
+ kt,
1747
+ Nt,
1748
+ ft,
1697
1749
  It,
1698
- Ct
1699
- ], br = [_t, $t, qt, Wt, lr].flat();
1750
+ Ct,
1751
+ Lt,
1752
+ St
1753
+ ], vr = [Gt, Vt, jt, zt, pr].flat();
1700
1754
  export {
1701
- ye as blockquoteAttr,
1702
- fe as blockquoteKeymap,
1703
- E as blockquoteSchema,
1704
- we as bulletListAttr,
1705
- ve as bulletListKeymap,
1755
+ Ie as blockquoteAttr,
1756
+ Me as blockquoteKeymap,
1757
+ q as blockquoteSchema,
1758
+ Be as bulletListAttr,
1759
+ Oe as bulletListKeymap,
1706
1760
  K as bulletListSchema,
1707
- Ne as codeBlockAttr,
1708
- Ce as codeBlockKeymap,
1709
- _ as codeBlockSchema,
1710
- qt as commands,
1711
- br as commonmark,
1712
- Ie as createCodeBlockCommand,
1713
- at as createCodeBlockInputRule,
1714
- Yt as defaultConfig,
1715
- et as docSchema,
1716
- ge as downgradeHeadingCommand,
1717
- ee as emphasisAttr,
1718
- re as emphasisKeymap,
1719
- V as emphasisSchema,
1720
- be as hardbreakAttr,
1721
- ft as hardbreakClearMarkPlugin,
1722
- $e as hardbreakFilterNodes,
1723
- Nt as hardbreakFilterPlugin,
1724
- Le as hardbreakKeymap,
1725
- b as hardbreakSchema,
1726
- pe as headingAttr,
1727
- z as headingIdGenerator,
1728
- he as headingKeymap,
1729
- w as headingSchema,
1730
- Se as hrAttr,
1731
- $ as hrSchema,
1732
- Ee as htmlAttr,
1733
- _e as htmlSchema,
1734
- Me as imageAttr,
1761
+ be as codeBlockAttr,
1762
+ Le as codeBlockKeymap,
1763
+ W as codeBlockSchema,
1764
+ jt as commands,
1765
+ vr as commonmark,
1766
+ xe as createCodeBlockCommand,
1767
+ lt as createCodeBlockInputRule,
1768
+ tr as defaultConfig,
1769
+ nt as docSchema,
1770
+ fe as downgradeHeadingCommand,
1771
+ ne as emphasisAttr,
1772
+ se as emphasisKeymap,
1773
+ Y as emphasisSchema,
1774
+ we as hardbreakAttr,
1775
+ bt as hardbreakClearMarkPlugin,
1776
+ Ve as hardbreakFilterNodes,
1777
+ xt as hardbreakFilterPlugin,
1778
+ ve as hardbreakKeymap,
1779
+ x as hardbreakSchema,
1780
+ ke as headingAttr,
1781
+ Q as headingIdGenerator,
1782
+ Ne as headingKeymap,
1783
+ A as headingSchema,
1784
+ He as hrAttr,
1785
+ F as hrSchema,
1786
+ Fe as htmlAttr,
1787
+ Ge as htmlSchema,
1788
+ Se as imageAttr,
1735
1789
  O as imageSchema,
1736
- se as inlineCodeAttr,
1737
- ie as inlineCodeKeymap,
1738
- M as inlineCodeSchema,
1739
- kt as inlineNodesCursorPlugin,
1740
- P as inlineSyncConfig,
1741
- ut as inlineSyncPlugin,
1742
- $t as inputrules,
1743
- xe as insertHardbreakCommand,
1744
- lt as insertHrCommand,
1745
- st as insertHrInputRule,
1746
- nt as insertImageCommand,
1747
- Et as insertImageInputRule,
1748
- Wt as keymap,
1749
- De as liftListItemCommand,
1750
- ce as linkAttr,
1790
+ de as inlineCodeAttr,
1791
+ ue as inlineCodeKeymap,
1792
+ b as inlineCodeSchema,
1793
+ Mt as inlineNodesCursorPlugin,
1794
+ R as inlineSyncConfig,
1795
+ yt as inlineSyncPlugin,
1796
+ Vt as inputrules,
1797
+ Ae as insertHardbreakCommand,
1798
+ mt as insertHrCommand,
1799
+ dt as insertHrInputRule,
1800
+ it as insertImageCommand,
1801
+ Wt as insertImageInputRule,
1802
+ zt as keymap,
1803
+ qe as liftFirstListItemCommand,
1804
+ _e as liftListItemCommand,
1805
+ pe as linkAttr,
1751
1806
  v as linkSchema,
1752
- Oe as listItemAttr,
1753
- Re as listItemKeymap,
1754
- A as listItemSchema,
1755
- He as orderedListAttr,
1756
- Te as orderedListKeymap,
1807
+ Pe as listItemAttr,
1808
+ We as listItemKeymap,
1809
+ C as listItemSchema,
1810
+ Ke as orderedListAttr,
1811
+ Re as orderedListKeymap,
1757
1812
  D as orderedListSchema,
1758
- de as paragraphAttr,
1759
- ue as paragraphKeymap,
1760
- S as paragraphSchema,
1761
- lr as plugins,
1762
- pt as remarkAddOrderInListPlugin,
1763
- yt as remarkHtmlTransformer,
1764
- ht as remarkInlineLinkPlugin,
1765
- gt as remarkLineBreak,
1766
- _t as schema,
1767
- Ke as sinkListItemCommand,
1768
- Pe as splitListItemCommand,
1769
- ae as strongAttr,
1770
- oe as strongKeymap,
1771
- j as strongSchema,
1772
- It as syncHeadingIdPlugin,
1773
- Ct as syncListOrderPlugin,
1774
- dt as textSchema,
1775
- te as toggleEmphasisCommand,
1776
- le as toggleInlineCodeCommand,
1777
- Xe as toggleLinkCommand,
1778
- ne as toggleStrongCommand,
1779
- me as turnIntoTextCommand,
1780
- Rt as updateCodeBlockLanguageCommand,
1781
- ot as updateImageCommand,
1782
- Ze as updateLinkCommand,
1783
- ke as wrapInBlockquoteCommand,
1784
- rt as wrapInBlockquoteInputRule,
1785
- Ae as wrapInBulletListCommand,
1786
- it as wrapInBulletListInputRule,
1787
- C as wrapInHeadingCommand,
1788
- tt as wrapInHeadingInputRule,
1789
- Be as wrapInOrderedListCommand,
1790
- ct as wrapInOrderedListInputRule
1813
+ ge as paragraphAttr,
1814
+ ye as paragraphKeymap,
1815
+ w as paragraphSchema,
1816
+ pr as plugins,
1817
+ kt as remarkAddOrderInListPlugin,
1818
+ It as remarkHtmlTransformer,
1819
+ Nt as remarkInlineLinkPlugin,
1820
+ ft as remarkLineBreak,
1821
+ Ct as remarkMarker,
1822
+ Gt as schema,
1823
+ Ee as sinkListItemCommand,
1824
+ $e as splitListItemCommand,
1825
+ le as strongAttr,
1826
+ ce as strongKeymap,
1827
+ J as strongSchema,
1828
+ Lt as syncHeadingIdPlugin,
1829
+ St as syncListOrderPlugin,
1830
+ gt as textSchema,
1831
+ oe as toggleEmphasisCommand,
1832
+ me as toggleInlineCodeCommand,
1833
+ rt as toggleLinkCommand,
1834
+ ie as toggleStrongCommand,
1835
+ he as turnIntoTextCommand,
1836
+ qt as updateCodeBlockLanguageCommand,
1837
+ ct as updateImageCommand,
1838
+ at as updateLinkCommand,
1839
+ Ce as wrapInBlockquoteCommand,
1840
+ st as wrapInBlockquoteInputRule,
1841
+ Te as wrapInBulletListCommand,
1842
+ ut as wrapInBulletListInputRule,
1843
+ M as wrapInHeadingCommand,
1844
+ ot as wrapInHeadingInputRule,
1845
+ De as wrapInOrderedListCommand,
1846
+ pt as wrapInOrderedListInputRule
1791
1847
  };
1792
1848
  //# sourceMappingURL=index.es.js.map