@milkdown/preset-commonmark 7.4.0 → 7.5.8

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.
Files changed (69) hide show
  1. package/lib/__internal__/serialize-text.d.ts.map +1 -1
  2. package/lib/__internal__/with-meta.d.ts.map +1 -1
  3. package/lib/composed/commands.d.ts.map +1 -1
  4. package/lib/composed/inputrules.d.ts.map +1 -1
  5. package/lib/composed/keymap.d.ts.map +1 -1
  6. package/lib/composed/schema.d.ts.map +1 -1
  7. package/lib/index.d.ts.map +1 -1
  8. package/lib/index.es.js +544 -400
  9. package/lib/index.es.js.map +1 -1
  10. package/lib/mark/emphasis.d.ts.map +1 -1
  11. package/lib/mark/inline-code.d.ts.map +1 -1
  12. package/lib/mark/link.d.ts.map +1 -1
  13. package/lib/mark/strong.d.ts.map +1 -1
  14. package/lib/node/blockquote.d.ts.map +1 -1
  15. package/lib/node/bullet-list.d.ts.map +1 -1
  16. package/lib/node/code-block.d.ts.map +1 -1
  17. package/lib/node/hardbreak.d.ts.map +1 -1
  18. package/lib/node/heading.d.ts.map +1 -1
  19. package/lib/node/hr.d.ts.map +1 -1
  20. package/lib/node/html.d.ts.map +1 -1
  21. package/lib/node/image.d.ts.map +1 -1
  22. package/lib/node/list-item.d.ts.map +1 -1
  23. package/lib/node/ordered-list.d.ts.map +1 -1
  24. package/lib/node/paragraph.d.ts.map +1 -1
  25. package/lib/plugin/hardbreak-clear-mark-plugin.d.ts.map +1 -1
  26. package/lib/plugin/hardbreak-filter-plugin.d.ts.map +1 -1
  27. package/lib/plugin/inline-nodes-cursor-plugin.d.ts.map +1 -1
  28. package/lib/plugin/remark-add-order-in-list-plugin.d.ts.map +1 -1
  29. package/lib/plugin/remark-html-transformer.d.ts.map +1 -1
  30. package/lib/plugin/remark-inline-link-plugin.d.ts.map +1 -1
  31. package/lib/plugin/remark-line-break.d.ts.map +1 -1
  32. package/lib/plugin/remark-marker-plugin.d.ts.map +1 -1
  33. package/lib/plugin/sync-heading-id-plugin.d.ts.map +1 -1
  34. package/lib/plugin/sync-list-order-plugin.d.ts.map +1 -1
  35. package/package.json +10 -16
  36. package/src/__internal__/serialize-text.ts +3 -4
  37. package/src/__internal__/with-meta.ts +4 -1
  38. package/src/composed/commands.ts +7 -1
  39. package/src/composed/inputrules.ts +14 -2
  40. package/src/composed/keymap.ts +10 -1
  41. package/src/composed/schema.ts +10 -1
  42. package/src/index.ts +16 -2
  43. package/src/mark/emphasis.ts +19 -9
  44. package/src/mark/inline-code.ts +40 -30
  45. package/src/mark/link.ts +55 -45
  46. package/src/mark/strong.ts +13 -7
  47. package/src/node/blockquote.ts +34 -20
  48. package/src/node/bullet-list.ts +20 -7
  49. package/src/node/code-block.ts +43 -18
  50. package/src/node/doc.ts +1 -1
  51. package/src/node/hardbreak.ts +50 -28
  52. package/src/node/heading.ts +44 -27
  53. package/src/node/hr.ts +27 -28
  54. package/src/node/html.ts +10 -8
  55. package/src/node/image.ts +57 -43
  56. package/src/node/list-item.ts +35 -18
  57. package/src/node/ordered-list.ts +31 -15
  58. package/src/node/paragraph.ts +10 -10
  59. package/src/node/text.ts +1 -1
  60. package/src/plugin/hardbreak-clear-mark-plugin.ts +16 -9
  61. package/src/plugin/hardbreak-filter-plugin.ts +5 -3
  62. package/src/plugin/inline-nodes-cursor-plugin.ts +13 -6
  63. package/src/plugin/remark-add-order-in-list-plugin.ts +13 -10
  64. package/src/plugin/remark-html-transformer.ts +24 -17
  65. package/src/plugin/remark-inline-link-plugin.ts +4 -1
  66. package/src/plugin/remark-line-break.ts +39 -26
  67. package/src/plugin/remark-marker-plugin.ts +14 -7
  68. package/src/plugin/sync-heading-id-plugin.ts +13 -8
  69. package/src/plugin/sync-list-order-plugin.ts +12 -11
package/lib/index.es.js CHANGED
@@ -1,16 +1,16 @@
1
- import { $markAttr as V, $markSchema as U, $command as c, $inputRule as h, $useKeymap as f, $node as Qe, $nodeAttr as N, $nodeSchema as I, $ctx as Xe, $remark as D, $prose as _ } from "@milkdown/utils";
2
- import { remarkStringifyOptionsCtx as Ye, commandsCtx as u, editorViewCtx as At } from "@milkdown/core";
3
- import { toggleMark as z, setBlockType as K, wrapIn as J } from "@milkdown/prose/commands";
1
+ import { $markAttr as U, $markSchema as G, $command as u, $inputRule as h, $useKeymap as f, $node as Qe, $nodeAttr as N, $nodeSchema as I, $ctx as Xe, $remark as D, $prose as _ } from "@milkdown/utils";
2
+ import { remarkStringifyOptionsCtx as Ye, commandsCtx as g, editorViewCtx as At } from "@milkdown/core";
3
+ import { toggleMark as J, setBlockType as K, wrapIn as Q } from "@milkdown/prose/commands";
4
4
  import { Fragment as wt } from "@milkdown/prose/model";
5
5
  import { expectDomTypeError as A } from "@milkdown/exception";
6
- import { textblockTypeInputRule as Ze, wrappingInputRule as Q, InputRule as et } from "@milkdown/prose/inputrules";
6
+ import { textblockTypeInputRule as Ze, wrappingInputRule as X, InputRule as et } from "@milkdown/prose/inputrules";
7
7
  import Ht from "@sindresorhus/slugify";
8
- import { TextSelection as X, Selection as tt, PluginKey as E, Plugin as P } from "@milkdown/prose/state";
9
- import { markRule as G, findSelectedNodeOfType as Bt } from "@milkdown/prose";
8
+ import { TextSelection as Y, Selection as tt, PluginKey as E, Plugin as P } from "@milkdown/prose/state";
9
+ import { markRule as j, findSelectedNodeOfType as Bt } from "@milkdown/prose";
10
10
  import { sinkListItem as Rt, liftListItem as rt, splitListItem as vt } from "@milkdown/prose/schema-list";
11
11
  import { ReplaceStep as Ot, AddMarkStep as Tt } from "@milkdown/prose/transform";
12
12
  import { Decoration as ze, DecorationSet as Je } from "@milkdown/prose/view";
13
- import { visit as Y } from "unist-util-visit";
13
+ import { visit as Z } from "unist-util-visit";
14
14
  import Kt from "remark-inline-links";
15
15
  function at(t, e) {
16
16
  var o;
@@ -31,12 +31,12 @@ function n(t, e) {
31
31
  }
32
32
  }), t;
33
33
  }
34
- const Z = V("emphasis");
35
- n(Z, {
34
+ const ee = U("emphasis");
35
+ n(ee, {
36
36
  displayName: "Attr<emphasis>",
37
37
  group: "Emphasis"
38
38
  });
39
- const R = U("emphasis", (t) => ({
39
+ const R = G("emphasis", (t) => ({
40
40
  attrs: {
41
41
  marker: {
42
42
  default: t.get(Ye).emphasis || "*"
@@ -47,7 +47,7 @@ const R = U("emphasis", (t) => ({
47
47
  { tag: "em" },
48
48
  { style: "font-style", getAttrs: (e) => e === "italic" }
49
49
  ],
50
- toDOM: (e) => ["em", t.get(Z.key)(e)],
50
+ toDOM: (e) => ["em", t.get(ee.key)(e)],
51
51
  parseMarkdown: {
52
52
  match: (e) => e.type === "emphasis",
53
53
  runner: (e, r, a) => {
@@ -71,12 +71,12 @@ n(R.ctx, {
71
71
  displayName: "MarkSchemaCtx<emphasis>",
72
72
  group: "Emphasis"
73
73
  });
74
- const ee = c("ToggleEmphasis", (t) => () => z(R.type(t)));
75
- n(ee, {
74
+ const te = u("ToggleEmphasis", (t) => () => J(R.type(t)));
75
+ n(te, {
76
76
  displayName: "Command<toggleEmphasisCommand>",
77
77
  group: "Emphasis"
78
78
  });
79
- const nt = h((t) => G(/(?:^|[^*])\*([^*]+)\*$/, R.type(t), {
79
+ const nt = h((t) => j(/(?:^|[^*])\*([^*]+)\*$/, R.type(t), {
80
80
  getAttr: () => ({
81
81
  marker: "*"
82
82
  }),
@@ -86,7 +86,7 @@ n(nt, {
86
86
  displayName: "InputRule<emphasis>|Star",
87
87
  group: "Emphasis"
88
88
  });
89
- const ot = h((t) => G(/(?:^|[^_])_([^_]+)_$/, R.type(t), {
89
+ const ot = h((t) => j(/(?:^|[^_])_([^_]+)_$/, R.type(t), {
90
90
  getAttr: () => ({
91
91
  marker: "_"
92
92
  }),
@@ -96,29 +96,29 @@ n(ot, {
96
96
  displayName: "InputRule<emphasis>|Underscore",
97
97
  group: "Emphasis"
98
98
  });
99
- const te = f("emphasisKeymap", {
99
+ const re = f("emphasisKeymap", {
100
100
  ToggleEmphasis: {
101
101
  shortcuts: "Mod-i",
102
102
  command: (t) => {
103
- const e = t.get(u);
104
- return () => e.call(ee.key);
103
+ const e = t.get(g);
104
+ return () => e.call(te.key);
105
105
  }
106
106
  }
107
107
  });
108
- n(te.ctx, {
108
+ n(re.ctx, {
109
109
  displayName: "KeymapCtx<emphasis>",
110
110
  group: "Emphasis"
111
111
  });
112
- n(te.shortcuts, {
112
+ n(re.shortcuts, {
113
113
  displayName: "Keymap<emphasis>",
114
114
  group: "Emphasis"
115
115
  });
116
- const re = V("strong");
117
- n(re, {
116
+ const ae = U("strong");
117
+ n(ae, {
118
118
  displayName: "Attr<strong>",
119
119
  group: "Strong"
120
120
  });
121
- const $ = U("strong", (t) => ({
121
+ const $ = G("strong", (t) => ({
122
122
  attrs: {
123
123
  marker: {
124
124
  default: t.get(Ye).strong || "*"
@@ -129,7 +129,7 @@ const $ = U("strong", (t) => ({
129
129
  { tag: "strong" },
130
130
  { style: "font-style", getAttrs: (e) => e === "bold" }
131
131
  ],
132
- toDOM: (e) => ["strong", t.get(re.key)(e)],
132
+ toDOM: (e) => ["strong", t.get(ae.key)(e)],
133
133
  parseMarkdown: {
134
134
  match: (e) => e.type === "strong",
135
135
  runner: (e, r, a) => {
@@ -153,12 +153,12 @@ n($.ctx, {
153
153
  displayName: "MarkSchemaCtx<strong>",
154
154
  group: "Strong"
155
155
  });
156
- const ae = c("ToggleStrong", (t) => () => z($.type(t)));
157
- n(ae, {
156
+ const ne = u("ToggleStrong", (t) => () => J($.type(t)));
157
+ n(ne, {
158
158
  displayName: "Command<toggleStrongCommand>",
159
159
  group: "Strong"
160
160
  });
161
- const st = h((t) => G(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/, $.type(t), {
161
+ const st = h((t) => j(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/, $.type(t), {
162
162
  getAttr: (e) => ({
163
163
  marker: e[0].startsWith("*") ? "*" : "_"
164
164
  })
@@ -167,34 +167,34 @@ n(st, {
167
167
  displayName: "InputRule<strong>",
168
168
  group: "Strong"
169
169
  });
170
- const ne = f("strongKeymap", {
170
+ const oe = f("strongKeymap", {
171
171
  ToggleBold: {
172
172
  shortcuts: ["Mod-b"],
173
173
  command: (t) => {
174
- const e = t.get(u);
175
- return () => e.call(ae.key);
174
+ const e = t.get(g);
175
+ return () => e.call(ne.key);
176
176
  }
177
177
  }
178
178
  });
179
- n(ne.ctx, {
179
+ n(oe.ctx, {
180
180
  displayName: "KeymapCtx<strong>",
181
181
  group: "Strong"
182
182
  });
183
- n(ne.shortcuts, {
183
+ n(oe.shortcuts, {
184
184
  displayName: "Keymap<strong>",
185
185
  group: "Strong"
186
186
  });
187
- const oe = V("inlineCode");
188
- n(oe, {
187
+ const se = U("inlineCode");
188
+ n(se, {
189
189
  displayName: "Attr<inlineCode>",
190
190
  group: "InlineCode"
191
191
  });
192
- const x = U("inlineCode", (t) => ({
192
+ const x = G("inlineCode", (t) => ({
193
193
  priority: 100,
194
194
  code: !0,
195
195
  inclusive: !1,
196
196
  parseDOM: [{ tag: "code" }],
197
- toDOM: (e) => ["code", t.get(oe.key)(e)],
197
+ toDOM: (e) => ["code", t.get(se.key)(e)],
198
198
  parseMarkdown: {
199
199
  match: (e) => e.type === "inlineCode",
200
200
  runner: (e, r, a) => {
@@ -216,47 +216,51 @@ n(x.ctx, {
216
216
  displayName: "MarkSchemaCtx<inlineCode>",
217
217
  group: "InlineCode"
218
218
  });
219
- const se = c("ToggleInlineCode", (t) => () => (e, r) => {
220
- const { selection: a, tr: o } = e;
221
- if (a.empty)
222
- return !1;
223
- const { from: s, to: l } = a;
224
- return e.doc.rangeHasMark(s, l, x.type(t)) ? (r == null || r(o.removeMark(s, l, x.type(t))), !0) : (Object.keys(e.schema.marks).filter((m) => m !== x.type.name).map((m) => e.schema.marks[m]).forEach((m) => {
225
- o.removeMark(s, l, m);
226
- }), r == null || r(o.addMark(s, l, x.type(t).create())), !0);
227
- });
228
- n(se, {
219
+ const le = u(
220
+ "ToggleInlineCode",
221
+ (t) => () => (e, r) => {
222
+ const { selection: a, tr: o } = e;
223
+ if (a.empty) return !1;
224
+ const { from: s, to: l } = a;
225
+ return e.doc.rangeHasMark(s, l, x.type(t)) ? (r == null || r(o.removeMark(s, l, x.type(t))), !0) : (Object.keys(e.schema.marks).filter(
226
+ (m) => m !== x.type.name
227
+ ).map((m) => e.schema.marks[m]).forEach((m) => {
228
+ o.removeMark(s, l, m);
229
+ }), r == null || r(o.addMark(s, l, x.type(t).create())), !0);
230
+ }
231
+ );
232
+ n(le, {
229
233
  displayName: "Command<toggleInlineCodeCommand>",
230
234
  group: "InlineCode"
231
235
  });
232
- const lt = h((t) => G(/(?:\`)([^\`]+)(?:\`)$/, x.type(t)));
236
+ const lt = h((t) => j(/(?:`)([^`]+)(?:`)$/, x.type(t)));
233
237
  n(lt, {
234
238
  displayName: "InputRule<inlineCodeInputRule>",
235
239
  group: "InlineCode"
236
240
  });
237
- const le = f("inlineCodeKeymap", {
241
+ const ie = f("inlineCodeKeymap", {
238
242
  ToggleInlineCode: {
239
243
  shortcuts: "Mod-e",
240
244
  command: (t) => {
241
- const e = t.get(u);
242
- return () => e.call(se.key);
245
+ const e = t.get(g);
246
+ return () => e.call(le.key);
243
247
  }
244
248
  }
245
249
  });
246
- n(le.ctx, {
250
+ n(ie.ctx, {
247
251
  displayName: "KeymapCtx<inlineCode>",
248
252
  group: "InlineCode"
249
253
  });
250
- n(le.shortcuts, {
254
+ n(ie.shortcuts, {
251
255
  displayName: "Keymap<inlineCode>",
252
256
  group: "InlineCode"
253
257
  });
254
- const ie = V("link");
255
- n(ie, {
258
+ const de = U("link");
259
+ n(de, {
256
260
  displayName: "Attr<link>",
257
261
  group: "Link"
258
262
  });
259
- const B = U("link", (t) => ({
263
+ const B = G("link", (t) => ({
260
264
  attrs: {
261
265
  href: {},
262
266
  title: { default: null }
@@ -265,13 +269,15 @@ const B = U("link", (t) => ({
265
269
  {
266
270
  tag: "a[href]",
267
271
  getAttrs: (e) => {
268
- if (!(e instanceof HTMLElement))
269
- throw A(e);
270
- return { href: e.getAttribute("href"), title: e.getAttribute("title") };
272
+ if (!(e instanceof HTMLElement)) throw A(e);
273
+ return {
274
+ href: e.getAttribute("href"),
275
+ title: e.getAttribute("title")
276
+ };
271
277
  }
272
278
  }
273
279
  ],
274
- toDOM: (e) => ["a", { ...t.get(ie.key)(e), ...e.attrs }],
280
+ toDOM: (e) => ["a", { ...t.get(de.key)(e), ...e.attrs }],
275
281
  parseMarkdown: {
276
282
  match: (e) => e.type === "link",
277
283
  runner: (e, r, a) => {
@@ -293,29 +299,32 @@ n(B.mark, {
293
299
  displayName: "MarkSchema<link>",
294
300
  group: "Link"
295
301
  });
296
- const it = c("ToggleLink", (t) => (e = {}) => z(B.type(t), e));
302
+ const it = u(
303
+ "ToggleLink",
304
+ (t) => (e = {}) => J(B.type(t), e)
305
+ );
297
306
  n(it, {
298
307
  displayName: "Command<toggleLinkCommand>",
299
308
  group: "Link"
300
309
  });
301
- const dt = c("UpdateLink", (t) => (e = {}) => (r, a) => {
302
- if (!a)
303
- return !1;
304
- let o, s = -1;
305
- const { selection: l } = r, { from: i, to: d } = l;
306
- if (r.doc.nodesBetween(i, i === d ? d + 1 : d, (k, b) => {
307
- if (B.type(t).isInSet(k.marks))
308
- return o = k, s = b, !1;
309
- }), !o)
310
- return !1;
311
- const m = o.marks.find(({ type: k }) => k === B.type(t));
312
- if (!m)
313
- return !1;
314
- const p = s, y = s + o.nodeSize, { tr: g } = r, C = B.type(t).create({ ...m.attrs, ...e });
315
- return C ? (a(
316
- g.removeMark(p, y, m).addMark(p, y, C).setSelection(new X(g.selection.$anchor)).scrollIntoView()
317
- ), !0) : !1;
318
- });
310
+ const dt = u(
311
+ "UpdateLink",
312
+ (t) => (e = {}) => (r, a) => {
313
+ if (!a) return !1;
314
+ let o, s = -1;
315
+ const { selection: l } = r, { from: i, to: d } = l;
316
+ if (r.doc.nodesBetween(i, i === d ? d + 1 : d, (y, b) => {
317
+ if (B.type(t).isInSet(y.marks))
318
+ return o = y, s = b, !1;
319
+ }), !o) return !1;
320
+ const m = o.marks.find(({ type: y }) => y === B.type(t));
321
+ if (!m) return !1;
322
+ const p = s, c = s + o.nodeSize, { tr: k } = r, C = B.type(t).create({ ...m.attrs, ...e });
323
+ return C ? (a(
324
+ k.removeMark(p, c, m).addMark(p, c, C).setSelection(new Y(k.selection.$anchor)).scrollIntoView()
325
+ ), !0) : !1;
326
+ }
327
+ );
319
328
  n(dt, {
320
329
  displayName: "Command<updateLinkCommand>",
321
330
  group: "Link"
@@ -339,8 +348,8 @@ n(mt, {
339
348
  displayName: "NodeSchema<doc>",
340
349
  group: "Doc"
341
350
  });
342
- const de = N("paragraph");
343
- n(de, {
351
+ const me = N("paragraph");
352
+ n(me, {
344
353
  displayName: "Attr<paragraph>",
345
354
  group: "Paragraph"
346
355
  });
@@ -348,7 +357,7 @@ const w = I("paragraph", (t) => ({
348
357
  content: "inline*",
349
358
  group: "block",
350
359
  parseDOM: [{ tag: "p" }],
351
- toDOM: (e) => ["p", t.get(de.key)(e), 0],
360
+ toDOM: (e) => ["p", t.get(me.key)(e), 0],
352
361
  parseMarkdown: {
353
362
  match: (e) => e.type === "paragraph",
354
363
  runner: (e, r, a) => {
@@ -370,25 +379,28 @@ n(w.ctx, {
370
379
  displayName: "NodeSchemaCtx<paragraph>",
371
380
  group: "Paragraph"
372
381
  });
373
- const me = c("TurnIntoText", (t) => () => K(w.type(t)));
374
- n(me, {
382
+ const pe = u(
383
+ "TurnIntoText",
384
+ (t) => () => K(w.type(t))
385
+ );
386
+ n(pe, {
375
387
  displayName: "Command<turnIntoTextCommand>",
376
388
  group: "Paragraph"
377
389
  });
378
- const pe = f("paragraphKeymap", {
390
+ const ce = f("paragraphKeymap", {
379
391
  TurnIntoText: {
380
392
  shortcuts: "Mod-Alt-0",
381
393
  command: (t) => {
382
- const e = t.get(u);
383
- return () => e.call(me.key);
394
+ const e = t.get(g);
395
+ return () => e.call(pe.key);
384
396
  }
385
397
  }
386
398
  });
387
- n(pe.ctx, {
399
+ n(ce.ctx, {
388
400
  displayName: "KeymapCtx<paragraph>",
389
401
  group: "Paragraph"
390
402
  });
391
- n(pe.shortcuts, {
403
+ n(ce.shortcuts, {
392
404
  displayName: "Keymap<paragraph>",
393
405
  group: "Paragraph"
394
406
  });
@@ -396,18 +408,21 @@ const Dt = Array(6).fill(0).map((t, e) => e + 1);
396
408
  function _t(t) {
397
409
  return Ht(t.textContent);
398
410
  }
399
- const j = Xe(_t, "headingIdGenerator");
400
- n(j, {
411
+ const z = Xe(
412
+ _t,
413
+ "headingIdGenerator"
414
+ );
415
+ n(z, {
401
416
  displayName: "Ctx<HeadingIdGenerator>",
402
417
  group: "Heading"
403
418
  });
404
- const ce = N("heading");
405
- n(ce, {
419
+ const ue = N("heading");
420
+ n(ue, {
406
421
  displayName: "Attr<heading>",
407
422
  group: "Heading"
408
423
  });
409
424
  const H = I("heading", (t) => {
410
- const e = t.get(j.key);
425
+ const e = t.get(z.key);
411
426
  return {
412
427
  content: "inline*",
413
428
  group: "block",
@@ -423,15 +438,14 @@ const H = I("heading", (t) => {
423
438
  parseDOM: Dt.map((r) => ({
424
439
  tag: `h${r}`,
425
440
  getAttrs: (a) => {
426
- if (!(a instanceof HTMLElement))
427
- throw A(a);
441
+ if (!(a instanceof HTMLElement)) throw A(a);
428
442
  return { level: r, id: a.id };
429
443
  }
430
444
  })),
431
445
  toDOM: (r) => [
432
446
  `h${r.attrs.level}`,
433
447
  {
434
- ...t.get(ce.key)(r),
448
+ ...t.get(ue.key)(r),
435
449
  id: r.attrs.id || e(r)
436
450
  },
437
451
  0
@@ -459,123 +473,133 @@ n(H.ctx, {
459
473
  displayName: "NodeSchemaCtx<heading>",
460
474
  group: "Heading"
461
475
  });
462
- const pt = h((t) => Ze(/^(?<hashes>#+)\s$/, H.type(t), (e) => {
463
- var l, i;
464
- const r = ((i = (l = e.groups) == null ? void 0 : l.hashes) == null ? void 0 : i.length) || 0, a = t.get(At), { $from: o } = a.state.selection, s = o.node();
465
- if (s.type.name === "heading") {
466
- let d = Number(s.attrs.level) + Number(r);
467
- return d > 6 && (d = 6), { level: d };
476
+ const pt = h((t) => Ze(
477
+ /^(?<hashes>#+)\s$/,
478
+ H.type(t),
479
+ (e) => {
480
+ var l, i;
481
+ const r = ((i = (l = e.groups) == null ? void 0 : l.hashes) == null ? void 0 : i.length) || 0, a = t.get(At), { $from: o } = a.state.selection, s = o.node();
482
+ if (s.type.name === "heading") {
483
+ let d = Number(s.attrs.level) + Number(r);
484
+ return d > 6 && (d = 6), { level: d };
485
+ }
486
+ return { level: r };
468
487
  }
469
- return { level: r };
470
- }));
488
+ ));
471
489
  n(pt, {
472
490
  displayName: "InputRule<wrapInHeadingInputRule>",
473
491
  group: "Heading"
474
492
  });
475
- const L = c("WrapInHeading", (t) => (e) => (e ?? (e = 1), e < 1 ? K(w.type(t)) : K(H.type(t), { level: e })));
493
+ const L = u("WrapInHeading", (t) => (e) => (e ?? (e = 1), e < 1 ? K(w.type(t)) : K(H.type(t), { level: e })));
476
494
  n(L, {
477
495
  displayName: "Command<wrapInHeadingCommand>",
478
496
  group: "Heading"
479
497
  });
480
- const ue = c("DowngradeHeading", (t) => () => (e, r, a) => {
481
- const { $from: o } = e.selection, s = o.node();
482
- if (s.type !== H.type(t) || !e.selection.empty || o.parentOffset !== 0)
483
- return !1;
484
- const l = s.attrs.level - 1;
485
- return l ? (r == null || r(
486
- e.tr.setNodeMarkup(e.selection.$from.before(), void 0, {
487
- ...s.attrs,
488
- level: l
489
- })
490
- ), !0) : K(w.type(t))(e, r, a);
491
- });
492
- n(ue, {
498
+ const ge = u(
499
+ "DowngradeHeading",
500
+ (t) => () => (e, r, a) => {
501
+ const { $from: o } = e.selection, s = o.node();
502
+ if (s.type !== H.type(t) || !e.selection.empty || o.parentOffset !== 0)
503
+ return !1;
504
+ const l = s.attrs.level - 1;
505
+ return l ? (r == null || r(
506
+ e.tr.setNodeMarkup(e.selection.$from.before(), void 0, {
507
+ ...s.attrs,
508
+ level: l
509
+ })
510
+ ), !0) : K(w.type(t))(e, r, a);
511
+ }
512
+ );
513
+ n(ge, {
493
514
  displayName: "Command<downgradeHeadingCommand>",
494
515
  group: "Heading"
495
516
  });
496
- const ge = f("headingKeymap", {
517
+ const ke = f("headingKeymap", {
497
518
  TurnIntoH1: {
498
519
  shortcuts: "Mod-Alt-1",
499
520
  command: (t) => {
500
- const e = t.get(u);
521
+ const e = t.get(g);
501
522
  return () => e.call(L.key, 1);
502
523
  }
503
524
  },
504
525
  TurnIntoH2: {
505
526
  shortcuts: "Mod-Alt-2",
506
527
  command: (t) => {
507
- const e = t.get(u);
528
+ const e = t.get(g);
508
529
  return () => e.call(L.key, 2);
509
530
  }
510
531
  },
511
532
  TurnIntoH3: {
512
533
  shortcuts: "Mod-Alt-3",
513
534
  command: (t) => {
514
- const e = t.get(u);
535
+ const e = t.get(g);
515
536
  return () => e.call(L.key, 3);
516
537
  }
517
538
  },
518
539
  TurnIntoH4: {
519
540
  shortcuts: "Mod-Alt-4",
520
541
  command: (t) => {
521
- const e = t.get(u);
542
+ const e = t.get(g);
522
543
  return () => e.call(L.key, 4);
523
544
  }
524
545
  },
525
546
  TurnIntoH5: {
526
547
  shortcuts: "Mod-Alt-5",
527
548
  command: (t) => {
528
- const e = t.get(u);
549
+ const e = t.get(g);
529
550
  return () => e.call(L.key, 5);
530
551
  }
531
552
  },
532
553
  TurnIntoH6: {
533
554
  shortcuts: "Mod-Alt-6",
534
555
  command: (t) => {
535
- const e = t.get(u);
556
+ const e = t.get(g);
536
557
  return () => e.call(L.key, 6);
537
558
  }
538
559
  },
539
560
  DowngradeHeading: {
540
561
  shortcuts: ["Delete", "Backspace"],
541
562
  command: (t) => {
542
- const e = t.get(u);
543
- return () => e.call(ue.key);
563
+ const e = t.get(g);
564
+ return () => e.call(ge.key);
544
565
  }
545
566
  }
546
567
  });
547
- n(ge.ctx, {
568
+ n(ke.ctx, {
548
569
  displayName: "KeymapCtx<heading>",
549
570
  group: "Heading"
550
571
  });
551
- n(ge.shortcuts, {
572
+ n(ke.shortcuts, {
552
573
  displayName: "Keymap<heading>",
553
574
  group: "Heading"
554
575
  });
555
- const ke = N("blockquote");
556
- n(ke, {
576
+ const ye = N("blockquote");
577
+ n(ye, {
557
578
  displayName: "Attr<blockquote>",
558
579
  group: "Blockquote"
559
580
  });
560
- const q = I("blockquote", (t) => ({
561
- content: "block+",
562
- group: "block",
563
- defining: !0,
564
- parseDOM: [{ tag: "blockquote" }],
565
- toDOM: (e) => ["blockquote", t.get(ke.key)(e), 0],
566
- parseMarkdown: {
567
- match: ({ type: e }) => e === "blockquote",
568
- runner: (e, r, a) => {
569
- e.openNode(a).next(r.children).closeNode();
570
- }
571
- },
572
- toMarkdown: {
573
- match: (e) => e.type.name === "blockquote",
574
- runner: (e, r) => {
575
- e.openNode("blockquote").next(r.content).closeNode();
581
+ const q = I(
582
+ "blockquote",
583
+ (t) => ({
584
+ content: "block+",
585
+ group: "block",
586
+ defining: !0,
587
+ parseDOM: [{ tag: "blockquote" }],
588
+ toDOM: (e) => ["blockquote", t.get(ye.key)(e), 0],
589
+ parseMarkdown: {
590
+ match: ({ type: e }) => e === "blockquote",
591
+ runner: (e, r, a) => {
592
+ e.openNode(a).next(r.children).closeNode();
593
+ }
594
+ },
595
+ toMarkdown: {
596
+ match: (e) => e.type.name === "blockquote",
597
+ runner: (e, r) => {
598
+ e.openNode("blockquote").next(r.content).closeNode();
599
+ }
576
600
  }
577
- }
578
- }));
601
+ })
602
+ );
579
603
  n(q.node, {
580
604
  displayName: "NodeSchema<blockquote>",
581
605
  group: "Blockquote"
@@ -584,38 +608,43 @@ n(q.ctx, {
584
608
  displayName: "NodeSchemaCtx<blockquote>",
585
609
  group: "Blockquote"
586
610
  });
587
- const ct = h((t) => Q(/^\s*>\s$/, q.type(t)));
611
+ const ct = h(
612
+ (t) => X(/^\s*>\s$/, q.type(t))
613
+ );
588
614
  n(ct, {
589
615
  displayName: "InputRule<wrapInBlockquoteInputRule>",
590
616
  group: "Blockquote"
591
617
  });
592
- const ye = c("WrapInBlockquote", (t) => () => J(q.type(t)));
593
- n(ye, {
618
+ const he = u(
619
+ "WrapInBlockquote",
620
+ (t) => () => Q(q.type(t))
621
+ );
622
+ n(he, {
594
623
  displayName: "Command<wrapInBlockquoteCommand>",
595
624
  group: "Blockquote"
596
625
  });
597
- const he = f("blockquoteKeymap", {
626
+ const fe = f("blockquoteKeymap", {
598
627
  WrapInBlockquote: {
599
628
  shortcuts: "Mod-Shift-b",
600
629
  command: (t) => {
601
- const e = t.get(u);
602
- return () => e.call(ye.key);
630
+ const e = t.get(g);
631
+ return () => e.call(he.key);
603
632
  }
604
633
  }
605
634
  });
606
- n(he.ctx, {
635
+ n(fe.ctx, {
607
636
  displayName: "KeymapCtx<blockquote>",
608
637
  group: "Blockquote"
609
638
  });
610
- n(he.shortcuts, {
639
+ n(fe.shortcuts, {
611
640
  displayName: "Keymap<blockquote>",
612
641
  group: "Blockquote"
613
642
  });
614
- const fe = N("codeBlock", () => ({
643
+ const Ne = N("codeBlock", () => ({
615
644
  pre: {},
616
645
  code: {}
617
646
  }));
618
- n(fe, {
647
+ n(Ne, {
619
648
  displayName: "Attr<codeBlock>",
620
649
  group: "CodeBlock"
621
650
  });
@@ -635,14 +664,13 @@ const W = I("code_block", (t) => ({
635
664
  tag: "pre",
636
665
  preserveWhitespace: "full",
637
666
  getAttrs: (e) => {
638
- if (!(e instanceof HTMLElement))
639
- throw A(e);
667
+ if (!(e instanceof HTMLElement)) throw A(e);
640
668
  return { language: e.dataset.language };
641
669
  }
642
670
  }
643
671
  ],
644
672
  toDOM: (e) => {
645
- const r = t.get(fe.key)(e);
673
+ const r = t.get(Ne.key)(e);
646
674
  return [
647
675
  "pre",
648
676
  {
@@ -677,45 +705,60 @@ n(W.ctx, {
677
705
  displayName: "NodeSchemaCtx<codeBlock>",
678
706
  group: "CodeBlock"
679
707
  });
680
- const ut = h((t) => Ze(/^```(?<language>[a-z]*)?[\s\n]$/, W.type(t), (e) => {
681
- var r;
682
- return {
683
- language: ((r = e.groups) == null ? void 0 : r.language) ?? ""
684
- };
685
- }));
708
+ const ut = h(
709
+ (t) => Ze(
710
+ /^```(?<language>[a-z]*)?[\s\n]$/,
711
+ W.type(t),
712
+ (e) => {
713
+ var r;
714
+ return {
715
+ language: ((r = e.groups) == null ? void 0 : r.language) ?? ""
716
+ };
717
+ }
718
+ )
719
+ );
686
720
  n(ut, {
687
721
  displayName: "InputRule<createCodeBlockInputRule>",
688
722
  group: "CodeBlock"
689
723
  });
690
- const Ne = c("CreateCodeBlock", (t) => (e = "") => K(W.type(t), { language: e }));
691
- n(Ne, {
724
+ const Ie = u(
725
+ "CreateCodeBlock",
726
+ (t) => (e = "") => K(W.type(t), { language: e })
727
+ );
728
+ n(Ie, {
692
729
  displayName: "Command<createCodeBlockCommand>",
693
730
  group: "CodeBlock"
694
731
  });
695
- const Et = c("UpdateCodeBlockLanguage", () => ({ pos: t, language: e } = { pos: -1, language: "" }) => (r, a) => t >= 0 ? (a == null || a(r.tr.setNodeAttribute(t, "language", e)), !0) : !1);
732
+ const Et = u(
733
+ "UpdateCodeBlockLanguage",
734
+ () => ({ pos: t, language: e } = {
735
+ pos: -1,
736
+ language: ""
737
+ }) => (r, a) => t >= 0 ? (a == null || a(r.tr.setNodeAttribute(t, "language", e)), !0) : !1
738
+ );
696
739
  n(Et, {
697
740
  displayName: "Command<updateCodeBlockLanguageCommand>",
698
741
  group: "CodeBlock"
699
742
  });
700
- const Ie = f("codeBlockKeymap", {
743
+ const Ce = f("codeBlockKeymap", {
701
744
  CreateCodeBlock: {
702
745
  shortcuts: "Mod-Alt-c",
703
746
  command: (t) => {
704
- const e = t.get(u);
705
- return () => e.call(Ne.key);
747
+ const e = t.get(g);
748
+ return () => e.call(Ie.key);
706
749
  }
707
750
  }
708
751
  });
709
- n(Ie.ctx, {
752
+ n(Ce.ctx, {
710
753
  displayName: "KeymapCtx<codeBlock>",
711
754
  group: "CodeBlock"
712
755
  });
713
- n(Ie.shortcuts, {
756
+ n(Ce.shortcuts, {
714
757
  displayName: "Keymap<codeBlock>",
715
758
  group: "CodeBlock"
716
759
  });
717
- const Ce = N("image");
718
- n(Ce, {
760
+ const Me = N("image");
761
+ n(Me, {
719
762
  displayName: "Attr<image>",
720
763
  group: "Image"
721
764
  });
@@ -737,8 +780,7 @@ const v = I("image", (t) => ({
737
780
  {
738
781
  tag: "img[src]",
739
782
  getAttrs: (e) => {
740
- if (!(e instanceof HTMLElement))
741
- throw A(e);
783
+ if (!(e instanceof HTMLElement)) throw A(e);
742
784
  return {
743
785
  src: e.getAttribute("src") || "",
744
786
  alt: e.getAttribute("alt") || "",
@@ -747,7 +789,7 @@ const v = I("image", (t) => ({
747
789
  }
748
790
  }
749
791
  ],
750
- toDOM: (e) => ["img", { ...t.get(Ce.key)(e), ...e.attrs }],
792
+ toDOM: (e) => ["img", { ...t.get(Me.key)(e), ...e.attrs }],
751
793
  parseMarkdown: {
752
794
  match: ({ type: e }) => e === "image",
753
795
  runner: (e, r, a) => {
@@ -778,42 +820,58 @@ n(v.ctx, {
778
820
  displayName: "NodeSchemaCtx<image>",
779
821
  group: "Image"
780
822
  });
781
- const gt = c("InsertImage", (t) => (e = {}) => (r, a) => {
782
- if (!a)
783
- return !0;
784
- const { src: o = "", alt: s = "", title: l = "" } = e, i = v.type(t).create({ src: o, alt: s, title: l });
785
- return i && a(r.tr.replaceSelectionWith(i).scrollIntoView()), !0;
786
- });
823
+ const gt = u(
824
+ "InsertImage",
825
+ (t) => (e = {}) => (r, a) => {
826
+ if (!a) return !0;
827
+ const { src: o = "", alt: s = "", title: l = "" } = e, i = v.type(t).create({ src: o, alt: s, title: l });
828
+ return i && a(r.tr.replaceSelectionWith(i).scrollIntoView()), !0;
829
+ }
830
+ );
787
831
  n(gt, {
788
832
  displayName: "Command<insertImageCommand>",
789
833
  group: "Image"
790
834
  });
791
- const kt = c("UpdateImage", (t) => (e = {}) => (r, a) => {
792
- const o = Bt(r.selection, v.type(t));
793
- if (!o)
794
- return !1;
795
- const { node: s, pos: l } = o, i = { ...s.attrs }, { src: d, alt: m, title: p } = e;
796
- return d !== void 0 && (i.src = d), m !== void 0 && (i.alt = m), p !== void 0 && (i.title = p), a == null || a(r.tr.setNodeMarkup(l, void 0, i).scrollIntoView()), !0;
797
- });
835
+ const kt = u(
836
+ "UpdateImage",
837
+ (t) => (e = {}) => (r, a) => {
838
+ const o = Bt(
839
+ r.selection,
840
+ v.type(t)
841
+ );
842
+ if (!o) return !1;
843
+ const { node: s, pos: l } = o, i = { ...s.attrs }, { src: d, alt: m, title: p } = e;
844
+ return d !== void 0 && (i.src = d), m !== void 0 && (i.alt = m), p !== void 0 && (i.title = p), a == null || a(
845
+ r.tr.setNodeMarkup(l, void 0, i).scrollIntoView()
846
+ ), !0;
847
+ }
848
+ );
798
849
  n(kt, {
799
850
  displayName: "Command<updateImageCommand>",
800
851
  group: "Image"
801
852
  });
802
- const Pt = h((t) => new et(
803
- /!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,
804
- (e, r, a, o) => {
805
- const [s, l, i = "", d] = r;
806
- return s ? e.tr.replaceWith(a, o, v.type(t).create({ src: i, alt: l, title: d })) : null;
807
- }
808
- ));
853
+ const Pt = h(
854
+ (t) => new et(
855
+ /!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,
856
+ (e, r, a, o) => {
857
+ const [s, l, i = "", d] = r;
858
+ return s ? e.tr.replaceWith(
859
+ a,
860
+ o,
861
+ v.type(t).create({ src: i, alt: l, title: d })
862
+ ) : null;
863
+ }
864
+ )
865
+ );
809
866
  n(Pt, {
810
867
  displayName: "InputRule<insertImageInputRule>",
811
868
  group: "Image"
812
869
  });
813
- const Me = N("hardbreak", (t) => ({
870
+ const V = N("hardbreak", (t) => ({
871
+ "data-type": "hardbreak",
814
872
  "data-is-inline": t.attrs.isInline
815
873
  }));
816
- n(Me, {
874
+ n(V, {
817
875
  displayName: "Attr<hardbreak>",
818
876
  group: "Hardbreak"
819
877
  });
@@ -826,13 +884,21 @@ const S = I("hardbreak", (t) => ({
826
884
  }
827
885
  },
828
886
  selectable: !1,
829
- parseDOM: [{ tag: "br" }],
830
- toDOM: (e) => ["br", t.get(Me.key)(e)],
887
+ parseDOM: [
888
+ { tag: "br" },
889
+ {
890
+ tag: 'span[data-type="hardbreak"]',
891
+ getAttrs: () => ({ isInline: !0 })
892
+ }
893
+ ],
894
+ toDOM: (e) => e.attrs.isInline ? ["span", t.get(V.key)(e), " "] : ["br", t.get(V.key)(e)],
831
895
  parseMarkdown: {
832
896
  match: ({ type: e }) => e === "break",
833
897
  runner: (e, r, a) => {
834
898
  var o;
835
- e.addNode(a, { isInline: !!((o = r.data) != null && o.isInline) });
899
+ e.addNode(a, {
900
+ isInline: !!((o = r.data) != null && o.isInline)
901
+ });
836
902
  }
837
903
  },
838
904
  leafText: () => `
@@ -853,20 +919,28 @@ n(S.ctx, {
853
919
  displayName: "NodeSchemaCtx<hardbreak>",
854
920
  group: "Hardbreak"
855
921
  });
856
- const be = c("InsertHardbreak", (t) => () => (e, r) => {
857
- var s;
858
- const { selection: a, tr: o } = e;
859
- if (!(a instanceof X))
860
- return !1;
861
- if (a.empty) {
862
- const l = a.$from.node();
863
- if (l.childCount > 0 && ((s = l.lastChild) == null ? void 0 : s.type.name) === "hardbreak")
864
- return r == null || r(
865
- o.replaceRangeWith(a.to - 1, a.to, e.schema.node("paragraph")).setSelection(tt.near(o.doc.resolve(a.to))).scrollIntoView()
866
- ), !0;
922
+ const be = u(
923
+ "InsertHardbreak",
924
+ (t) => () => (e, r) => {
925
+ var s;
926
+ const { selection: a, tr: o } = e;
927
+ if (!(a instanceof Y)) return !1;
928
+ if (a.empty) {
929
+ const l = a.$from.node();
930
+ if (l.childCount > 0 && ((s = l.lastChild) == null ? void 0 : s.type.name) === "hardbreak")
931
+ return r == null || r(
932
+ o.replaceRangeWith(
933
+ a.to - 1,
934
+ a.to,
935
+ e.schema.node("paragraph")
936
+ ).setSelection(tt.near(o.doc.resolve(a.to))).scrollIntoView()
937
+ ), !0;
938
+ }
939
+ return r == null || r(
940
+ o.setMeta("hardbreak", !0).replaceSelectionWith(S.type(t).create()).scrollIntoView()
941
+ ), !0;
867
942
  }
868
- return r == null || r(o.setMeta("hardbreak", !0).replaceSelectionWith(S.type(t).create()).scrollIntoView()), !0;
869
- });
943
+ );
870
944
  n(be, {
871
945
  displayName: "Command<insertHardbreakCommand>",
872
946
  group: "Hardbreak"
@@ -875,7 +949,7 @@ const Le = f("hardbreakKeymap", {
875
949
  InsertHardbreak: {
876
950
  shortcuts: "Shift-Enter",
877
951
  command: (t) => {
878
- const e = t.get(u);
952
+ const e = t.get(g);
879
953
  return () => e.call(be.key);
880
954
  }
881
955
  }
@@ -918,26 +992,26 @@ n(F.ctx, {
918
992
  displayName: "NodeSchemaCtx<hr>",
919
993
  group: "Hr"
920
994
  });
921
- const yt = h((t) => new et(
922
- /^(?:---|___\s|\*\*\*\s)$/,
923
- (e, r, a, o) => {
995
+ const yt = h(
996
+ (t) => new et(/^(?:---|___\s|\*\*\*\s)$/, (e, r, a, o) => {
924
997
  const { tr: s } = e;
925
998
  return r[0] && s.replaceWith(a - 1, o, F.type(t).create()), s;
926
- }
927
- ));
999
+ })
1000
+ );
928
1001
  n(yt, {
929
1002
  displayName: "InputRule<insertHrInputRule>",
930
1003
  group: "Hr"
931
1004
  });
932
- const ht = c("InsertHr", (t) => () => (e, r) => {
933
- if (!r)
934
- return !0;
935
- const a = w.node.type(t).create(), { tr: o, selection: s } = e, { from: l } = s, i = F.type(t).create();
936
- if (!i)
937
- return !0;
938
- const d = o.replaceSelectionWith(i).insert(l, a), m = tt.findFrom(d.doc.resolve(l), 1, !0);
939
- return m && r(d.setSelection(m).scrollIntoView()), !0;
940
- });
1005
+ const ht = u(
1006
+ "InsertHr",
1007
+ (t) => () => (e, r) => {
1008
+ if (!r) return !0;
1009
+ const a = w.node.type(t).create(), { tr: o, selection: s } = e, { from: l } = s, i = F.type(t).create();
1010
+ if (!i) return !0;
1011
+ const d = o.replaceSelectionWith(i).insert(l, a), m = tt.findFrom(d.doc.resolve(l), 1, !0);
1012
+ return m && r(d.setSelection(m).scrollIntoView()), !0;
1013
+ }
1014
+ );
941
1015
  n(ht, {
942
1016
  displayName: "Command<insertHrCommand>",
943
1017
  group: "Hr"
@@ -959,8 +1033,7 @@ const O = I("bullet_list", (t) => ({
959
1033
  {
960
1034
  tag: "ul",
961
1035
  getAttrs: (e) => {
962
- if (!(e instanceof HTMLElement))
963
- throw A(e);
1036
+ if (!(e instanceof HTMLElement)) throw A(e);
964
1037
  return {
965
1038
  spread: e.dataset.spread
966
1039
  };
@@ -985,7 +1058,10 @@ const O = I("bullet_list", (t) => ({
985
1058
  toMarkdown: {
986
1059
  match: (e) => e.type.name === "bullet_list",
987
1060
  runner: (e, r) => {
988
- e.openNode("list", void 0, { ordered: !1, spread: r.attrs.spread === "true" }).next(r.content).closeNode();
1061
+ e.openNode("list", void 0, {
1062
+ ordered: !1,
1063
+ spread: r.attrs.spread === "true"
1064
+ }).next(r.content).closeNode();
989
1065
  }
990
1066
  }
991
1067
  }));
@@ -997,12 +1073,17 @@ n(O.ctx, {
997
1073
  displayName: "NodeSchemaCtx<bulletList>",
998
1074
  group: "BulletList"
999
1075
  });
1000
- const ft = h((t) => Q(/^\s*([-+*])\s$/, O.type(t)));
1076
+ const ft = h(
1077
+ (t) => X(/^\s*([-+*])\s$/, O.type(t))
1078
+ );
1001
1079
  n(ft, {
1002
1080
  displayName: "InputRule<wrapInBulletListInputRule>",
1003
1081
  group: "BulletList"
1004
1082
  });
1005
- const Ae = c("WrapInBulletList", (t) => () => J(O.type(t)));
1083
+ const Ae = u(
1084
+ "WrapInBulletList",
1085
+ (t) => () => Q(O.type(t))
1086
+ );
1006
1087
  n(Ae, {
1007
1088
  displayName: "Command<wrapInBulletListCommand>",
1008
1089
  group: "BulletList"
@@ -1011,7 +1092,7 @@ const we = f("bulletListKeymap", {
1011
1092
  WrapInBulletList: {
1012
1093
  shortcuts: "Mod-Alt-8",
1013
1094
  command: (t) => {
1014
- const e = t.get(u);
1095
+ const e = t.get(g);
1015
1096
  return () => e.call(Ae.key);
1016
1097
  }
1017
1098
  }
@@ -1044,8 +1125,7 @@ const T = I("ordered_list", (t) => ({
1044
1125
  {
1045
1126
  tag: "ol",
1046
1127
  getAttrs: (e) => {
1047
- if (!(e instanceof HTMLElement))
1048
- throw A(e);
1128
+ if (!(e instanceof HTMLElement)) throw A(e);
1049
1129
  return {
1050
1130
  spread: e.dataset.spread,
1051
1131
  order: e.hasAttribute("start") ? Number(e.getAttribute("start")) : 1
@@ -1072,7 +1152,11 @@ const T = I("ordered_list", (t) => ({
1072
1152
  toMarkdown: {
1073
1153
  match: (e) => e.type.name === "ordered_list",
1074
1154
  runner: (e, r) => {
1075
- e.openNode("list", void 0, { ordered: !0, start: 1, spread: r.attrs.spread === "true" }), e.next(r.content), e.closeNode();
1155
+ e.openNode("list", void 0, {
1156
+ ordered: !0,
1157
+ start: 1,
1158
+ spread: r.attrs.spread === "true"
1159
+ }), e.next(r.content), e.closeNode();
1076
1160
  }
1077
1161
  }
1078
1162
  }));
@@ -1084,17 +1168,22 @@ n(T.ctx, {
1084
1168
  displayName: "NodeSchemaCtx<orderedList>",
1085
1169
  group: "OrderedList"
1086
1170
  });
1087
- const Nt = h((t) => Q(
1088
- /^\s*(\d+)\.\s$/,
1089
- T.type(t),
1090
- (e) => ({ order: Number(e[1]) }),
1091
- (e, r) => r.childCount + r.attrs.order === Number(e[1])
1092
- ));
1171
+ const Nt = h(
1172
+ (t) => X(
1173
+ /^\s*(\d+)\.\s$/,
1174
+ T.type(t),
1175
+ (e) => ({ order: Number(e[1]) }),
1176
+ (e, r) => r.childCount + r.attrs.order === Number(e[1])
1177
+ )
1178
+ );
1093
1179
  n(Nt, {
1094
1180
  displayName: "InputRule<wrapInOrderedListInputRule>",
1095
1181
  group: "OrderedList"
1096
1182
  });
1097
- const Be = c("WrapInOrderedList", (t) => () => J(T.type(t)));
1183
+ const Be = u(
1184
+ "WrapInOrderedList",
1185
+ (t) => () => Q(T.type(t))
1186
+ );
1098
1187
  n(Be, {
1099
1188
  displayName: "Command<wrapInOrderedListCommand>",
1100
1189
  group: "OrderedList"
@@ -1103,7 +1192,7 @@ const Re = f("orderedListKeymap", {
1103
1192
  WrapInOrderedList: {
1104
1193
  shortcuts: "Mod-Alt-7",
1105
1194
  command: (t) => {
1106
- const e = t.get(u);
1195
+ const e = t.get(g);
1107
1196
  return () => e.call(Be.key);
1108
1197
  }
1109
1198
  }
@@ -1140,8 +1229,7 @@ const M = I("list_item", (t) => ({
1140
1229
  {
1141
1230
  tag: "li",
1142
1231
  getAttrs: (e) => {
1143
- if (!(e instanceof HTMLElement))
1144
- throw A(e);
1232
+ if (!(e instanceof HTMLElement)) throw A(e);
1145
1233
  return {
1146
1234
  label: e.dataset.label,
1147
1235
  listType: e.dataset.listType,
@@ -1170,7 +1258,9 @@ const M = I("list_item", (t) => ({
1170
1258
  toMarkdown: {
1171
1259
  match: (e) => e.type.name === "list_item",
1172
1260
  runner: (e, r) => {
1173
- e.openNode("listItem", void 0, { spread: r.attrs.spread === "true" }), e.next(r.content), e.closeNode();
1261
+ e.openNode("listItem", void 0, {
1262
+ spread: r.attrs.spread === "true"
1263
+ }), e.next(r.content), e.closeNode();
1174
1264
  }
1175
1265
  }
1176
1266
  }));
@@ -1182,17 +1272,26 @@ n(M.ctx, {
1182
1272
  displayName: "NodeSchemaCtx<listItem>",
1183
1273
  group: "ListItem"
1184
1274
  });
1185
- const Oe = c("SinkListItem", (t) => () => Rt(M.type(t)));
1275
+ const Oe = u(
1276
+ "SinkListItem",
1277
+ (t) => () => Rt(M.type(t))
1278
+ );
1186
1279
  n(Oe, {
1187
1280
  displayName: "Command<sinkListItemCommand>",
1188
1281
  group: "ListItem"
1189
1282
  });
1190
- const Te = c("LiftListItem", (t) => () => rt(M.type(t)));
1283
+ const Te = u(
1284
+ "LiftListItem",
1285
+ (t) => () => rt(M.type(t))
1286
+ );
1191
1287
  n(Te, {
1192
1288
  displayName: "Command<liftListItemCommand>",
1193
1289
  group: "ListItem"
1194
1290
  });
1195
- const Ke = c("SplitListItem", (t) => () => vt(M.type(t)));
1291
+ const Ke = u(
1292
+ "SplitListItem",
1293
+ (t) => () => vt(M.type(t))
1294
+ );
1196
1295
  n(Ke, {
1197
1296
  displayName: "Command<splitListItemCommand>",
1198
1297
  group: "ListItem"
@@ -1200,16 +1299,17 @@ n(Ke, {
1200
1299
  function $t(t) {
1201
1300
  return (e, r, a) => {
1202
1301
  const { selection: o } = e;
1203
- if (!(o instanceof X))
1204
- return !1;
1302
+ if (!(o instanceof Y)) return !1;
1205
1303
  const { empty: s, $from: l } = o;
1206
- if (!s || l.parentOffset !== 0)
1207
- return !1;
1304
+ if (!s || l.parentOffset !== 0) return !1;
1208
1305
  const i = l.node(-1);
1209
1306
  return i.type !== M.type(t) || i.firstChild !== l.node() || l.node(-2).childCount > 1 ? !1 : rt(M.type(t))(e, r, a);
1210
1307
  };
1211
1308
  }
1212
- const De = c("LiftFirstListItem", (t) => () => $t(t));
1309
+ const De = u(
1310
+ "LiftFirstListItem",
1311
+ (t) => () => $t(t)
1312
+ );
1213
1313
  n(De, {
1214
1314
  displayName: "Command<liftFirstListItemCommand>",
1215
1315
  group: "ListItem"
@@ -1218,28 +1318,28 @@ const _e = f("listItemKeymap", {
1218
1318
  NextListItem: {
1219
1319
  shortcuts: "Enter",
1220
1320
  command: (t) => {
1221
- const e = t.get(u);
1321
+ const e = t.get(g);
1222
1322
  return () => e.call(Ke.key);
1223
1323
  }
1224
1324
  },
1225
1325
  SinkListItem: {
1226
1326
  shortcuts: ["Tab", "Mod-]"],
1227
1327
  command: (t) => {
1228
- const e = t.get(u);
1328
+ const e = t.get(g);
1229
1329
  return () => e.call(Oe.key);
1230
1330
  }
1231
1331
  },
1232
1332
  LiftListItem: {
1233
1333
  shortcuts: ["Shift-Tab", "Mod-["],
1234
1334
  command: (t) => {
1235
- const e = t.get(u);
1335
+ const e = t.get(g);
1236
1336
  return () => e.call(Te.key);
1237
1337
  }
1238
1338
  },
1239
1339
  LiftFirstListItem: {
1240
1340
  shortcuts: ["Backspace", "Delete"],
1241
1341
  command: (t) => {
1242
- const e = t.get(u);
1342
+ const e = t.get(g);
1243
1343
  return () => e.call(De.key);
1244
1344
  }
1245
1345
  }
@@ -1293,12 +1393,14 @@ const Pe = I("html", (t) => ({
1293
1393
  };
1294
1394
  return r.textContent = e.attrs.value, ["span", a, e.attrs.value];
1295
1395
  },
1296
- parseDOM: [{
1297
- tag: 'span[data-type="html"]',
1298
- getAttrs: (e) => ({
1299
- value: e.dataset.value ?? ""
1300
- })
1301
- }],
1396
+ parseDOM: [
1397
+ {
1398
+ tag: 'span[data-type="html"]',
1399
+ getAttrs: (e) => ({
1400
+ value: e.dataset.value ?? ""
1401
+ })
1402
+ }
1403
+ ],
1302
1404
  parseMarkdown: {
1303
1405
  match: ({ type: e }) => e === "html",
1304
1406
  runner: (e, r, a) => {
@@ -1322,20 +1424,20 @@ n(Pe.ctx, {
1322
1424
  });
1323
1425
  const qt = [
1324
1426
  mt,
1325
- de,
1427
+ me,
1326
1428
  w,
1327
- j,
1328
- ce,
1429
+ z,
1430
+ ue,
1329
1431
  H,
1330
- Me,
1432
+ V,
1331
1433
  S,
1332
- ke,
1434
+ ye,
1333
1435
  q,
1334
- fe,
1436
+ Ne,
1335
1437
  W,
1336
1438
  xe,
1337
1439
  F,
1338
- Ce,
1440
+ Me,
1339
1441
  v,
1340
1442
  Se,
1341
1443
  O,
@@ -1343,13 +1445,13 @@ const qt = [
1343
1445
  T,
1344
1446
  ve,
1345
1447
  M,
1346
- Z,
1448
+ ee,
1347
1449
  R,
1348
- re,
1450
+ ae,
1349
1451
  $,
1350
- oe,
1452
+ se,
1351
1453
  x,
1352
- ie,
1454
+ de,
1353
1455
  B,
1354
1456
  Ee,
1355
1457
  Pe,
@@ -1367,11 +1469,11 @@ const qt = [
1367
1469
  lt,
1368
1470
  st
1369
1471
  ], Vt = [
1370
- me,
1371
- ye,
1472
+ pe,
1473
+ he,
1372
1474
  L,
1373
- ue,
1374
- Ne,
1475
+ ge,
1476
+ Ie,
1375
1477
  be,
1376
1478
  ht,
1377
1479
  gt,
@@ -1382,33 +1484,36 @@ const qt = [
1382
1484
  Ke,
1383
1485
  Te,
1384
1486
  De,
1385
- ee,
1386
- se,
1387
- ae,
1487
+ te,
1488
+ le,
1489
+ ne,
1388
1490
  it,
1389
1491
  dt
1390
1492
  ], Ut = [
1391
- he,
1392
- Ie,
1493
+ fe,
1494
+ Ce,
1393
1495
  Le,
1394
- ge,
1496
+ ke,
1395
1497
  _e,
1396
1498
  Re,
1397
1499
  we,
1398
- pe,
1399
- te,
1400
- le,
1401
- ne
1402
- ].flat(), $e = D("remarkAddOrderInList", () => () => (t) => {
1403
- Y(t, "list", (e) => {
1404
- if (e.ordered) {
1405
- const r = e.start ?? 1;
1406
- e.children.forEach((a, o) => {
1407
- a.label = o + r;
1408
- });
1409
- }
1410
- });
1411
- });
1500
+ ce,
1501
+ re,
1502
+ ie,
1503
+ oe
1504
+ ].flat(), $e = D(
1505
+ "remarkAddOrderInList",
1506
+ () => () => (t) => {
1507
+ Z(t, "list", (e) => {
1508
+ if (e.ordered) {
1509
+ const r = e.start ?? 1;
1510
+ e.children.forEach((a, o) => {
1511
+ a.label = o + r;
1512
+ });
1513
+ }
1514
+ });
1515
+ }
1516
+ );
1412
1517
  n($e.plugin, {
1413
1518
  displayName: "Remark<remarkAddOrderInListPlugin>",
1414
1519
  group: "Remark"
@@ -1417,23 +1522,32 @@ n($e.options, {
1417
1522
  displayName: "RemarkConfig<remarkAddOrderInListPlugin>",
1418
1523
  group: "Remark"
1419
1524
  });
1420
- const qe = D("remarkLineBreak", () => () => (t) => {
1421
- const e = /[\t ]*(?:\r?\n|\r)/g;
1422
- Y(t, "text", (r, a, o) => {
1423
- if (!r.value || typeof r.value != "string")
1424
- return;
1425
- const s = [];
1426
- let l = 0;
1427
- e.lastIndex = 0;
1428
- let i = e.exec(r.value);
1429
- for (; i; ) {
1430
- const m = i.index;
1431
- l !== m && s.push({ type: "text", value: r.value.slice(l, m) }), s.push({ type: "break", data: { isInline: !0 } }), l = m + i[0].length, i = e.exec(r.value);
1432
- }
1433
- if (s.length > 0 && o && typeof a == "number")
1434
- return l < r.value.length && s.push({ type: "text", value: r.value.slice(l) }), o.children.splice(a, 1, ...s), a + s.length;
1435
- });
1436
- });
1525
+ const qe = D(
1526
+ "remarkLineBreak",
1527
+ () => () => (t) => {
1528
+ const e = /[\t ]*(?:\r?\n|\r)/g;
1529
+ Z(
1530
+ t,
1531
+ "text",
1532
+ (r, a, o) => {
1533
+ if (!r.value || typeof r.value != "string") return;
1534
+ const s = [];
1535
+ let l = 0;
1536
+ e.lastIndex = 0;
1537
+ let i = e.exec(r.value);
1538
+ for (; i; ) {
1539
+ const m = i.index;
1540
+ l !== m && s.push({
1541
+ type: "text",
1542
+ value: r.value.slice(l, m)
1543
+ }), s.push({ type: "break", data: { isInline: !0 } }), l = m + i[0].length, i = e.exec(r.value);
1544
+ }
1545
+ if (s.length > 0 && o && typeof a == "number")
1546
+ return l < r.value.length && s.push({ type: "text", value: r.value.slice(l) }), o.children.splice(a, 1, ...s), a + s.length;
1547
+ }
1548
+ );
1549
+ }
1550
+ );
1437
1551
  n(qe.plugin, {
1438
1552
  displayName: "Remark<remarkLineBreak>",
1439
1553
  group: "Remark"
@@ -1442,7 +1556,10 @@ n(qe.options, {
1442
1556
  displayName: "RemarkConfig<remarkLineBreak>",
1443
1557
  group: "Remark"
1444
1558
  });
1445
- const We = D("remarkInlineLink", () => Kt);
1559
+ const We = D(
1560
+ "remarkInlineLink",
1561
+ () => Kt
1562
+ );
1446
1563
  n(We.plugin, {
1447
1564
  displayName: "Remark<remarkInlineLinkPlugin>",
1448
1565
  group: "Remark"
@@ -1462,8 +1579,8 @@ function zt(t, e) {
1462
1579
  if (m) {
1463
1580
  const p = r(m, i, a);
1464
1581
  if (p)
1465
- for (let y = 0, g = p.length; y < g; y++) {
1466
- const C = p[y];
1582
+ for (let c = 0, k = p.length; c < k; c++) {
1583
+ const C = p[c];
1467
1584
  C && l.push(C);
1468
1585
  }
1469
1586
  }
@@ -1473,9 +1590,12 @@ function zt(t, e) {
1473
1590
  return e(a, o, s);
1474
1591
  }
1475
1592
  }
1476
- const Fe = D("remarkHTMLTransformer", () => () => (t) => {
1477
- zt(t, (e, r, a) => jt(e) ? ((a == null ? void 0 : a.type) === "root" && (e.children = [{ ...e }], delete e.value, e.type = "paragraph"), [e]) : [e]);
1478
- });
1593
+ const Fe = D(
1594
+ "remarkHTMLTransformer",
1595
+ () => () => (t) => {
1596
+ zt(t, (e, r, a) => jt(e) ? ((a == null ? void 0 : a.type) === "root" && (e.children = [{ ...e }], delete e.value, e.type = "paragraph"), [e]) : [e]);
1597
+ }
1598
+ );
1479
1599
  n(Fe.plugin, {
1480
1600
  displayName: "Remark<remarkHtmlTransformer>",
1481
1601
  group: "Remark"
@@ -1484,12 +1604,19 @@ n(Fe.options, {
1484
1604
  displayName: "RemarkConfig<remarkHtmlTransformer>",
1485
1605
  group: "Remark"
1486
1606
  });
1487
- const Ve = D("remarkMarker", () => () => (t, e) => {
1488
- const r = (a) => e.value.charAt(a.position.start.offset);
1489
- Y(t, (a) => ["strong", "emphasis"].includes(a.type), (a) => {
1490
- a.marker = r(a);
1491
- });
1492
- });
1607
+ const Ve = D(
1608
+ "remarkMarker",
1609
+ () => () => (t, e) => {
1610
+ const r = (a) => e.value.charAt(a.position.start.offset);
1611
+ Z(
1612
+ t,
1613
+ (a) => ["strong", "emphasis"].includes(a.type),
1614
+ (a) => {
1615
+ a.marker = r(a);
1616
+ }
1617
+ );
1618
+ }
1619
+ );
1493
1620
  n(Ve.plugin, {
1494
1621
  displayName: "Remark<remarkMarker>",
1495
1622
  group: "Remark"
@@ -1500,15 +1627,16 @@ n(Ve.options, {
1500
1627
  });
1501
1628
  const Ct = _(() => {
1502
1629
  let t = !1;
1503
- const e = new E("MILKDOWN_INLINE_NODES_CURSOR"), r = new P({
1630
+ const e = new E(
1631
+ "MILKDOWN_INLINE_NODES_CURSOR"
1632
+ ), r = new P({
1504
1633
  key: e,
1505
1634
  state: {
1506
1635
  init() {
1507
1636
  return !1;
1508
1637
  },
1509
1638
  apply(a) {
1510
- if (!a.selection.empty)
1511
- return !1;
1639
+ if (!a.selection.empty) return !1;
1512
1640
  const o = a.selection.$from, s = o.nodeBefore, l = o.nodeAfter;
1513
1641
  return !!(s && l && s.isInline && !s.isText && l.isInline && !l.isText);
1514
1642
  }
@@ -1552,23 +1680,30 @@ n(Ct, {
1552
1680
  const Mt = _((t) => new P({
1553
1681
  key: new E("MILKDOWN_HARDBREAK_MARKS"),
1554
1682
  appendTransaction: (e, r, a) => {
1555
- if (!e.length)
1556
- return;
1683
+ if (!e.length) return;
1557
1684
  const [o] = e;
1558
- if (!o)
1559
- return;
1685
+ if (!o) return;
1560
1686
  const [s] = o.steps;
1561
1687
  if (o.getMeta("hardbreak")) {
1562
- if (!(s instanceof Ot))
1563
- return;
1688
+ if (!(s instanceof Ot)) return;
1564
1689
  const { from: d } = s;
1565
- return a.tr.setNodeMarkup(d, S.type(t), void 0, []);
1690
+ return a.tr.setNodeMarkup(
1691
+ d,
1692
+ S.type(t),
1693
+ void 0,
1694
+ []
1695
+ );
1566
1696
  }
1567
1697
  if (s instanceof Tt) {
1568
1698
  let d = a.tr;
1569
1699
  const { from: m, to: p } = s;
1570
- return a.doc.nodesBetween(m, p, (y, g) => {
1571
- y.type === S.type(t) && (d = d.setNodeMarkup(g, S.type(t), void 0, []));
1700
+ return a.doc.nodesBetween(m, p, (c, k) => {
1701
+ c.type === S.type(t) && (d = d.setNodeMarkup(
1702
+ k,
1703
+ S.type(t),
1704
+ void 0,
1705
+ []
1706
+ ));
1572
1707
  }), d;
1573
1708
  }
1574
1709
  }
@@ -1577,7 +1712,10 @@ n(Mt, {
1577
1712
  displayName: "Prose<hardbreakClearMarkPlugin>",
1578
1713
  group: "Prose"
1579
1714
  });
1580
- const Ue = Xe(["table", "code_block"], "hardbreakFilterNodes");
1715
+ const Ue = Xe(
1716
+ ["table", "code_block"],
1717
+ "hardbreakFilterNodes"
1718
+ );
1581
1719
  n(Ue, {
1582
1720
  displayName: "Ctx<hardbreakFilterNodes>",
1583
1721
  group: "Prose"
@@ -1605,18 +1743,18 @@ n(bt, {
1605
1743
  });
1606
1744
  const Lt = _((t) => {
1607
1745
  const e = new E("MILKDOWN_HEADING_ID"), r = (a) => {
1608
- if (a.composing)
1609
- return;
1610
- const o = t.get(j.key), s = a.state.tr.setMeta("addToHistory", !1);
1746
+ if (a.composing) return;
1747
+ const o = t.get(z.key), s = a.state.tr.setMeta("addToHistory", !1);
1611
1748
  let l = !1;
1612
- a.state.doc.descendants((i, d) => {
1613
- if (i.type === H.type(t)) {
1614
- if (i.textContent.trim().length === 0)
1615
- return;
1616
- const m = i.attrs, p = o(i);
1617
- m.id !== p && (l = !0, s.setMeta(e, !0).setNodeMarkup(d, void 0, {
1618
- ...m,
1619
- id: p
1749
+ const i = {};
1750
+ a.state.doc.descendants((d, m) => {
1751
+ if (d.type === H.type(t)) {
1752
+ if (d.textContent.trim().length === 0) return;
1753
+ const p = d.attrs;
1754
+ let c = o(d);
1755
+ i[c] ? (i[c] += 1, c += `-#${i[c]}`) : i[c] = 1, p.id !== c && (l = !0, s.setMeta(e, !0).setNodeMarkup(m, void 0, {
1756
+ ...p,
1757
+ id: c
1620
1758
  }));
1621
1759
  }
1622
1760
  }), l && a.dispatch(s);
@@ -1624,8 +1762,8 @@ const Lt = _((t) => {
1624
1762
  return new P({
1625
1763
  key: e,
1626
1764
  view: (a) => (r(a), {
1627
- update: (o) => {
1628
- r(o);
1765
+ update: (o, s) => {
1766
+ o.state.doc.eq(s.doc) || r(o);
1629
1767
  }
1630
1768
  })
1631
1769
  });
@@ -1636,28 +1774,27 @@ n(Lt, {
1636
1774
  });
1637
1775
  const xt = _((t) => {
1638
1776
  const e = (r) => {
1639
- if (r.composing || !r.editable)
1640
- return;
1641
- const a = T.type(t), o = O.type(t), s = M.type(t), l = r.state, i = (p, y) => {
1642
- let g = !1;
1643
- const C = `${y + 1}.`;
1644
- return p.label !== C && (p.label = C, g = !0), g;
1777
+ if (r.composing || !r.editable) return;
1778
+ const a = T.type(t), o = O.type(t), s = M.type(t), l = r.state, i = (p, c) => {
1779
+ let k = !1;
1780
+ const C = `${c + 1}.`;
1781
+ return p.label !== C && (p.label = C, k = !0), k;
1645
1782
  };
1646
1783
  let d = l.tr, m = !1;
1647
- l.doc.descendants((p, y, g, C) => {
1784
+ l.doc.descendants((p, c, k, C) => {
1648
1785
  if (p.type === o) {
1649
- const k = p.maybeChild(0);
1650
- (k == null ? void 0 : k.type) === s && k.attrs.listType === "ordered" && (m = !0, d.setNodeMarkup(y, a, { spread: "true" }), p.descendants((b, Ge, Qt, St) => {
1786
+ const y = p.maybeChild(0);
1787
+ (y == null ? void 0 : y.type) === s && y.attrs.listType === "ordered" && (m = !0, d.setNodeMarkup(c, a, { spread: "true" }), p.descendants((b, Ge, Qt, St) => {
1651
1788
  if (b.type === s) {
1652
1789
  const je = { ...b.attrs };
1653
1790
  i(je, St) && (d = d.setNodeMarkup(Ge, void 0, je));
1654
1791
  }
1655
1792
  return !1;
1656
1793
  }));
1657
- } else if (p.type === s && (g == null ? void 0 : g.type) === a) {
1658
- const k = { ...p.attrs };
1794
+ } else if (p.type === s && (k == null ? void 0 : k.type) === a) {
1795
+ const y = { ...p.attrs };
1659
1796
  let b = !1;
1660
- k.listType !== "ordered" && (k.listType = "ordered", b = !0), (g == null ? void 0 : g.maybeChild(0)) && (b = i(k, C)), b && (d = d.setNodeMarkup(y, void 0, k), m = !0);
1797
+ y.listType !== "ordered" && (y.listType = "ordered", b = !0), (k == null ? void 0 : k.maybeChild(0)) && (b = i(y, C)), b && (d = d.setNodeMarkup(c, void 0, y), m = !0);
1661
1798
  }
1662
1799
  }), m && r.dispatch(d.setMeta("addToHistory", !1));
1663
1800
  };
@@ -1686,47 +1823,54 @@ const Jt = [
1686
1823
  Ve,
1687
1824
  Lt,
1688
1825
  xt
1689
- ].flat(), cr = [qt, Wt, Ft, Vt, Ut, Jt].flat();
1826
+ ].flat(), cr = [
1827
+ qt,
1828
+ Wt,
1829
+ Ft,
1830
+ Vt,
1831
+ Ut,
1832
+ Jt
1833
+ ].flat();
1690
1834
  export {
1691
- ke as blockquoteAttr,
1692
- he as blockquoteKeymap,
1835
+ ye as blockquoteAttr,
1836
+ fe as blockquoteKeymap,
1693
1837
  q as blockquoteSchema,
1694
1838
  Se as bulletListAttr,
1695
1839
  we as bulletListKeymap,
1696
1840
  O as bulletListSchema,
1697
- fe as codeBlockAttr,
1698
- Ie as codeBlockKeymap,
1841
+ Ne as codeBlockAttr,
1842
+ Ce as codeBlockKeymap,
1699
1843
  W as codeBlockSchema,
1700
1844
  Vt as commands,
1701
1845
  cr as commonmark,
1702
- Ne as createCodeBlockCommand,
1846
+ Ie as createCodeBlockCommand,
1703
1847
  ut as createCodeBlockInputRule,
1704
1848
  mt as docSchema,
1705
- ue as downgradeHeadingCommand,
1706
- Z as emphasisAttr,
1707
- te as emphasisKeymap,
1849
+ ge as downgradeHeadingCommand,
1850
+ ee as emphasisAttr,
1851
+ re as emphasisKeymap,
1708
1852
  R as emphasisSchema,
1709
1853
  nt as emphasisStarInputRule,
1710
1854
  ot as emphasisUnderscoreInputRule,
1711
- Me as hardbreakAttr,
1855
+ V as hardbreakAttr,
1712
1856
  Mt as hardbreakClearMarkPlugin,
1713
1857
  Ue as hardbreakFilterNodes,
1714
1858
  bt as hardbreakFilterPlugin,
1715
1859
  Le as hardbreakKeymap,
1716
1860
  S as hardbreakSchema,
1717
- ce as headingAttr,
1718
- j as headingIdGenerator,
1719
- ge as headingKeymap,
1861
+ ue as headingAttr,
1862
+ z as headingIdGenerator,
1863
+ ke as headingKeymap,
1720
1864
  H as headingSchema,
1721
1865
  xe as hrAttr,
1722
1866
  F as hrSchema,
1723
1867
  Ee as htmlAttr,
1724
1868
  Pe as htmlSchema,
1725
- Ce as imageAttr,
1869
+ Me as imageAttr,
1726
1870
  v as imageSchema,
1727
- oe as inlineCodeAttr,
1871
+ se as inlineCodeAttr,
1728
1872
  lt as inlineCodeInputRule,
1729
- le as inlineCodeKeymap,
1873
+ ie as inlineCodeKeymap,
1730
1874
  x as inlineCodeSchema,
1731
1875
  Ct as inlineNodesCursorPlugin,
1732
1876
  Wt as inputRules,
@@ -1738,7 +1882,7 @@ export {
1738
1882
  Ut as keymap,
1739
1883
  De as liftFirstListItemCommand,
1740
1884
  Te as liftListItemCommand,
1741
- ie as linkAttr,
1885
+ de as linkAttr,
1742
1886
  B as linkSchema,
1743
1887
  ve as listItemAttr,
1744
1888
  _e as listItemKeymap,
@@ -1747,8 +1891,8 @@ export {
1747
1891
  He as orderedListAttr,
1748
1892
  Re as orderedListKeymap,
1749
1893
  T as orderedListSchema,
1750
- de as paragraphAttr,
1751
- pe as paragraphKeymap,
1894
+ me as paragraphAttr,
1895
+ ce as paragraphKeymap,
1752
1896
  w as paragraphSchema,
1753
1897
  Jt as plugins,
1754
1898
  $e as remarkAddOrderInListPlugin,
@@ -1759,22 +1903,22 @@ export {
1759
1903
  qt as schema,
1760
1904
  Oe as sinkListItemCommand,
1761
1905
  Ke as splitListItemCommand,
1762
- re as strongAttr,
1906
+ ae as strongAttr,
1763
1907
  st as strongInputRule,
1764
- ne as strongKeymap,
1908
+ oe as strongKeymap,
1765
1909
  $ as strongSchema,
1766
1910
  Lt as syncHeadingIdPlugin,
1767
1911
  xt as syncListOrderPlugin,
1768
1912
  It as textSchema,
1769
- ee as toggleEmphasisCommand,
1770
- se as toggleInlineCodeCommand,
1913
+ te as toggleEmphasisCommand,
1914
+ le as toggleInlineCodeCommand,
1771
1915
  it as toggleLinkCommand,
1772
- ae as toggleStrongCommand,
1773
- me as turnIntoTextCommand,
1916
+ ne as toggleStrongCommand,
1917
+ pe as turnIntoTextCommand,
1774
1918
  Et as updateCodeBlockLanguageCommand,
1775
1919
  kt as updateImageCommand,
1776
1920
  dt as updateLinkCommand,
1777
- ye as wrapInBlockquoteCommand,
1921
+ he as wrapInBlockquoteCommand,
1778
1922
  ct as wrapInBlockquoteInputRule,
1779
1923
  Ae as wrapInBulletListCommand,
1780
1924
  ft as wrapInBulletListInputRule,