@milkdown/preset-commonmark 7.3.6 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/lib/__internal__/index.d.ts.map +1 -1
  2. package/lib/__internal__/serialize-text.d.ts.map +1 -1
  3. package/lib/__internal__/with-meta.d.ts.map +1 -1
  4. package/lib/composed/commands.d.ts.map +1 -1
  5. package/lib/composed/index.d.ts.map +1 -1
  6. package/lib/composed/inputrules.d.ts.map +1 -1
  7. package/lib/composed/keymap.d.ts.map +1 -1
  8. package/lib/composed/plugins.d.ts.map +1 -1
  9. package/lib/composed/schema.d.ts.map +1 -1
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.es.js +177 -176
  12. package/lib/index.es.js.map +1 -1
  13. package/lib/mark/emphasis.d.ts.map +1 -1
  14. package/lib/mark/index.d.ts.map +1 -1
  15. package/lib/mark/inline-code.d.ts.map +1 -1
  16. package/lib/mark/link.d.ts.map +1 -1
  17. package/lib/mark/strong.d.ts.map +1 -1
  18. package/lib/node/blockquote.d.ts.map +1 -1
  19. package/lib/node/bullet-list.d.ts.map +1 -1
  20. package/lib/node/code-block.d.ts.map +1 -1
  21. package/lib/node/doc.d.ts.map +1 -1
  22. package/lib/node/hardbreak.d.ts.map +1 -1
  23. package/lib/node/heading.d.ts.map +1 -1
  24. package/lib/node/hr.d.ts.map +1 -1
  25. package/lib/node/html.d.ts.map +1 -1
  26. package/lib/node/image.d.ts.map +1 -1
  27. package/lib/node/index.d.ts.map +1 -1
  28. package/lib/node/list-item.d.ts.map +1 -1
  29. package/lib/node/ordered-list.d.ts.map +1 -1
  30. package/lib/node/paragraph.d.ts.map +1 -1
  31. package/lib/node/text.d.ts.map +1 -1
  32. package/lib/plugin/hardbreak-clear-mark-plugin.d.ts.map +1 -1
  33. package/lib/plugin/hardbreak-filter-plugin.d.ts.map +1 -1
  34. package/lib/plugin/index.d.ts.map +1 -1
  35. package/lib/plugin/inline-nodes-cursor-plugin.d.ts.map +1 -1
  36. package/lib/plugin/remark-add-order-in-list-plugin.d.ts.map +1 -1
  37. package/lib/plugin/remark-html-transformer.d.ts.map +1 -1
  38. package/lib/plugin/remark-inline-link-plugin.d.ts.map +1 -1
  39. package/lib/plugin/remark-line-break.d.ts.map +1 -1
  40. package/lib/plugin/remark-marker-plugin.d.ts.map +1 -1
  41. package/lib/plugin/sync-heading-id-plugin.d.ts.map +1 -1
  42. package/lib/plugin/sync-list-order-plugin.d.ts.map +1 -1
  43. package/package.json +10 -16
  44. package/src/__internal__/index.ts +0 -1
  45. package/src/__internal__/serialize-text.ts +0 -1
  46. package/src/__internal__/with-meta.ts +0 -1
  47. package/src/composed/commands.ts +0 -1
  48. package/src/composed/index.ts +0 -1
  49. package/src/composed/inputrules.ts +0 -1
  50. package/src/composed/keymap.ts +0 -1
  51. package/src/composed/plugins.ts +0 -2
  52. package/src/composed/schema.ts +0 -2
  53. package/src/index.ts +0 -2
  54. package/src/mark/emphasis.ts +0 -1
  55. package/src/mark/index.ts +0 -1
  56. package/src/mark/inline-code.ts +0 -1
  57. package/src/mark/link.ts +0 -1
  58. package/src/mark/strong.ts +0 -1
  59. package/src/node/blockquote.ts +0 -1
  60. package/src/node/bullet-list.ts +0 -1
  61. package/src/node/code-block.ts +0 -1
  62. package/src/node/doc.ts +0 -1
  63. package/src/node/hardbreak.ts +3 -3
  64. package/src/node/heading.ts +0 -1
  65. package/src/node/hr.ts +0 -1
  66. package/src/node/html.ts +1 -2
  67. package/src/node/image.ts +0 -1
  68. package/src/node/index.ts +0 -2
  69. package/src/node/list-item.ts +2 -3
  70. package/src/node/ordered-list.ts +0 -1
  71. package/src/node/paragraph.ts +0 -1
  72. package/src/node/text.ts +0 -1
  73. package/src/plugin/hardbreak-clear-mark-plugin.ts +0 -1
  74. package/src/plugin/hardbreak-filter-plugin.ts +0 -1
  75. package/src/plugin/index.ts +0 -2
  76. package/src/plugin/inline-nodes-cursor-plugin.ts +0 -1
  77. package/src/plugin/remark-add-order-in-list-plugin.ts +0 -1
  78. package/src/plugin/remark-html-transformer.ts +0 -1
  79. package/src/plugin/remark-inline-link-plugin.ts +0 -1
  80. package/src/plugin/remark-line-break.ts +0 -1
  81. package/src/plugin/remark-marker-plugin.ts +0 -1
  82. package/src/plugin/sync-heading-id-plugin.ts +3 -2
  83. package/src/plugin/sync-list-order-plugin.ts +0 -1
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";
1
+ import { $markAttr as U, $markSchema as G, $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
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";
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 = c("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
103
  const e = t.get(u);
104
- return () => e.call(ee.key);
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 = c("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
174
  const e = t.get(u);
175
- return () => e.call(ae.key);
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,7 +216,7 @@ n(x.ctx, {
216
216
  displayName: "MarkSchemaCtx<inlineCode>",
217
217
  group: "InlineCode"
218
218
  });
219
- const se = c("ToggleInlineCode", (t) => () => (e, r) => {
219
+ const le = c("ToggleInlineCode", (t) => () => (e, r) => {
220
220
  const { selection: a, tr: o } = e;
221
221
  if (a.empty)
222
222
  return !1;
@@ -225,38 +225,38 @@ const se = c("ToggleInlineCode", (t) => () => (e, r) => {
225
225
  o.removeMark(s, l, m);
226
226
  }), r == null || r(o.addMark(s, l, x.type(t).create())), !0);
227
227
  });
228
- n(se, {
228
+ n(le, {
229
229
  displayName: "Command<toggleInlineCodeCommand>",
230
230
  group: "InlineCode"
231
231
  });
232
- const lt = h((t) => G(/(?:\`)([^\`]+)(?:\`)$/, x.type(t)));
232
+ const lt = h((t) => j(/(?:\`)([^\`]+)(?:\`)$/, x.type(t)));
233
233
  n(lt, {
234
234
  displayName: "InputRule<inlineCodeInputRule>",
235
235
  group: "InlineCode"
236
236
  });
237
- const le = f("inlineCodeKeymap", {
237
+ const ie = f("inlineCodeKeymap", {
238
238
  ToggleInlineCode: {
239
239
  shortcuts: "Mod-e",
240
240
  command: (t) => {
241
241
  const e = t.get(u);
242
- return () => e.call(se.key);
242
+ return () => e.call(le.key);
243
243
  }
244
244
  }
245
245
  });
246
- n(le.ctx, {
246
+ n(ie.ctx, {
247
247
  displayName: "KeymapCtx<inlineCode>",
248
248
  group: "InlineCode"
249
249
  });
250
- n(le.shortcuts, {
250
+ n(ie.shortcuts, {
251
251
  displayName: "Keymap<inlineCode>",
252
252
  group: "InlineCode"
253
253
  });
254
- const ie = V("link");
255
- n(ie, {
254
+ const de = U("link");
255
+ n(de, {
256
256
  displayName: "Attr<link>",
257
257
  group: "Link"
258
258
  });
259
- const B = U("link", (t) => ({
259
+ const B = G("link", (t) => ({
260
260
  attrs: {
261
261
  href: {},
262
262
  title: { default: null }
@@ -271,7 +271,7 @@ const B = U("link", (t) => ({
271
271
  }
272
272
  }
273
273
  ],
274
- toDOM: (e) => ["a", { ...t.get(ie.key)(e), ...e.attrs }],
274
+ toDOM: (e) => ["a", { ...t.get(de.key)(e), ...e.attrs }],
275
275
  parseMarkdown: {
276
276
  match: (e) => e.type === "link",
277
277
  runner: (e, r, a) => {
@@ -293,7 +293,7 @@ n(B.mark, {
293
293
  displayName: "MarkSchema<link>",
294
294
  group: "Link"
295
295
  });
296
- const it = c("ToggleLink", (t) => (e = {}) => z(B.type(t), e));
296
+ const it = c("ToggleLink", (t) => (e = {}) => J(B.type(t), e));
297
297
  n(it, {
298
298
  displayName: "Command<toggleLinkCommand>",
299
299
  group: "Link"
@@ -303,17 +303,17 @@ const dt = c("UpdateLink", (t) => (e = {}) => (r, a) => {
303
303
  return !1;
304
304
  let o, s = -1;
305
305
  const { selection: l } = r, { from: i, to: d } = l;
306
- if (r.doc.nodesBetween(i, i === d ? d + 1 : d, (y, b) => {
307
- if (B.type(t).isInSet(y.marks))
308
- return o = y, s = b, !1;
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
309
  }), !o)
310
310
  return !1;
311
- const m = o.marks.find(({ type: y }) => y === B.type(t));
311
+ const m = o.marks.find(({ type: k }) => k === B.type(t));
312
312
  if (!m)
313
313
  return !1;
314
- const p = s, k = s + o.nodeSize, { tr: g } = r, C = B.type(t).create({ ...m.attrs, ...e });
314
+ const p = s, y = s + o.nodeSize, { tr: g } = r, C = B.type(t).create({ ...m.attrs, ...e });
315
315
  return C ? (a(
316
- g.removeMark(p, k, m).addMark(p, k, C).setSelection(new X(g.selection.$anchor)).scrollIntoView()
316
+ g.removeMark(p, y, m).addMark(p, y, C).setSelection(new Y(g.selection.$anchor)).scrollIntoView()
317
317
  ), !0) : !1;
318
318
  });
319
319
  n(dt, {
@@ -339,8 +339,8 @@ n(mt, {
339
339
  displayName: "NodeSchema<doc>",
340
340
  group: "Doc"
341
341
  });
342
- const de = N("paragraph");
343
- n(de, {
342
+ const me = N("paragraph");
343
+ n(me, {
344
344
  displayName: "Attr<paragraph>",
345
345
  group: "Paragraph"
346
346
  });
@@ -348,7 +348,7 @@ const w = I("paragraph", (t) => ({
348
348
  content: "inline*",
349
349
  group: "block",
350
350
  parseDOM: [{ tag: "p" }],
351
- toDOM: (e) => ["p", t.get(de.key)(e), 0],
351
+ toDOM: (e) => ["p", t.get(me.key)(e), 0],
352
352
  parseMarkdown: {
353
353
  match: (e) => e.type === "paragraph",
354
354
  runner: (e, r, a) => {
@@ -370,25 +370,25 @@ n(w.ctx, {
370
370
  displayName: "NodeSchemaCtx<paragraph>",
371
371
  group: "Paragraph"
372
372
  });
373
- const me = c("TurnIntoText", (t) => () => K(w.type(t)));
374
- n(me, {
373
+ const pe = c("TurnIntoText", (t) => () => K(w.type(t)));
374
+ n(pe, {
375
375
  displayName: "Command<turnIntoTextCommand>",
376
376
  group: "Paragraph"
377
377
  });
378
- const pe = f("paragraphKeymap", {
378
+ const ce = f("paragraphKeymap", {
379
379
  TurnIntoText: {
380
380
  shortcuts: "Mod-Alt-0",
381
381
  command: (t) => {
382
382
  const e = t.get(u);
383
- return () => e.call(me.key);
383
+ return () => e.call(pe.key);
384
384
  }
385
385
  }
386
386
  });
387
- n(pe.ctx, {
387
+ n(ce.ctx, {
388
388
  displayName: "KeymapCtx<paragraph>",
389
389
  group: "Paragraph"
390
390
  });
391
- n(pe.shortcuts, {
391
+ n(ce.shortcuts, {
392
392
  displayName: "Keymap<paragraph>",
393
393
  group: "Paragraph"
394
394
  });
@@ -396,18 +396,18 @@ const Dt = Array(6).fill(0).map((t, e) => e + 1);
396
396
  function _t(t) {
397
397
  return Ht(t.textContent);
398
398
  }
399
- const j = Xe(_t, "headingIdGenerator");
400
- n(j, {
399
+ const z = Xe(_t, "headingIdGenerator");
400
+ n(z, {
401
401
  displayName: "Ctx<HeadingIdGenerator>",
402
402
  group: "Heading"
403
403
  });
404
- const ce = N("heading");
405
- n(ce, {
404
+ const ue = N("heading");
405
+ n(ue, {
406
406
  displayName: "Attr<heading>",
407
407
  group: "Heading"
408
408
  });
409
409
  const H = I("heading", (t) => {
410
- const e = t.get(j.key);
410
+ const e = t.get(z.key);
411
411
  return {
412
412
  content: "inline*",
413
413
  group: "block",
@@ -431,7 +431,7 @@ const H = I("heading", (t) => {
431
431
  toDOM: (r) => [
432
432
  `h${r.attrs.level}`,
433
433
  {
434
- ...t.get(ce.key)(r),
434
+ ...t.get(ue.key)(r),
435
435
  id: r.attrs.id || e(r)
436
436
  },
437
437
  0
@@ -477,7 +477,7 @@ n(L, {
477
477
  displayName: "Command<wrapInHeadingCommand>",
478
478
  group: "Heading"
479
479
  });
480
- const ue = c("DowngradeHeading", (t) => () => (e, r, a) => {
480
+ const ge = c("DowngradeHeading", (t) => () => (e, r, a) => {
481
481
  const { $from: o } = e.selection, s = o.node();
482
482
  if (s.type !== H.type(t) || !e.selection.empty || o.parentOffset !== 0)
483
483
  return !1;
@@ -489,11 +489,11 @@ const ue = c("DowngradeHeading", (t) => () => (e, r, a) => {
489
489
  })
490
490
  ), !0) : K(w.type(t))(e, r, a);
491
491
  });
492
- n(ue, {
492
+ n(ge, {
493
493
  displayName: "Command<downgradeHeadingCommand>",
494
494
  group: "Heading"
495
495
  });
496
- const ge = f("headingKeymap", {
496
+ const ke = f("headingKeymap", {
497
497
  TurnIntoH1: {
498
498
  shortcuts: "Mod-Alt-1",
499
499
  command: (t) => {
@@ -540,15 +540,15 @@ const ge = f("headingKeymap", {
540
540
  shortcuts: ["Delete", "Backspace"],
541
541
  command: (t) => {
542
542
  const e = t.get(u);
543
- return () => e.call(ue.key);
543
+ return () => e.call(ge.key);
544
544
  }
545
545
  }
546
546
  });
547
- n(ge.ctx, {
547
+ n(ke.ctx, {
548
548
  displayName: "KeymapCtx<heading>",
549
549
  group: "Heading"
550
550
  });
551
- n(ge.shortcuts, {
551
+ n(ke.shortcuts, {
552
552
  displayName: "Keymap<heading>",
553
553
  group: "Heading"
554
554
  });
@@ -584,38 +584,38 @@ n(q.ctx, {
584
584
  displayName: "NodeSchemaCtx<blockquote>",
585
585
  group: "Blockquote"
586
586
  });
587
- const ct = h((t) => Q(/^\s*>\s$/, q.type(t)));
587
+ const ct = h((t) => X(/^\s*>\s$/, q.type(t)));
588
588
  n(ct, {
589
589
  displayName: "InputRule<wrapInBlockquoteInputRule>",
590
590
  group: "Blockquote"
591
591
  });
592
- const ke = c("WrapInBlockquote", (t) => () => J(q.type(t)));
593
- n(ke, {
592
+ const he = c("WrapInBlockquote", (t) => () => Q(q.type(t)));
593
+ n(he, {
594
594
  displayName: "Command<wrapInBlockquoteCommand>",
595
595
  group: "Blockquote"
596
596
  });
597
- const he = f("blockquoteKeymap", {
597
+ const fe = f("blockquoteKeymap", {
598
598
  WrapInBlockquote: {
599
599
  shortcuts: "Mod-Shift-b",
600
600
  command: (t) => {
601
601
  const e = t.get(u);
602
- return () => e.call(ke.key);
602
+ return () => e.call(he.key);
603
603
  }
604
604
  }
605
605
  });
606
- n(he.ctx, {
606
+ n(fe.ctx, {
607
607
  displayName: "KeymapCtx<blockquote>",
608
608
  group: "Blockquote"
609
609
  });
610
- n(he.shortcuts, {
610
+ n(fe.shortcuts, {
611
611
  displayName: "Keymap<blockquote>",
612
612
  group: "Blockquote"
613
613
  });
614
- const fe = N("codeBlock", () => ({
614
+ const Ne = N("codeBlock", () => ({
615
615
  pre: {},
616
616
  code: {}
617
617
  }));
618
- n(fe, {
618
+ n(Ne, {
619
619
  displayName: "Attr<codeBlock>",
620
620
  group: "CodeBlock"
621
621
  });
@@ -642,7 +642,7 @@ const W = I("code_block", (t) => ({
642
642
  }
643
643
  ],
644
644
  toDOM: (e) => {
645
- const r = t.get(fe.key)(e);
645
+ const r = t.get(Ne.key)(e);
646
646
  return [
647
647
  "pre",
648
648
  {
@@ -687,8 +687,8 @@ n(ut, {
687
687
  displayName: "InputRule<createCodeBlockInputRule>",
688
688
  group: "CodeBlock"
689
689
  });
690
- const Ne = c("CreateCodeBlock", (t) => (e = "") => K(W.type(t), { language: e }));
691
- n(Ne, {
690
+ const Ie = c("CreateCodeBlock", (t) => (e = "") => K(W.type(t), { language: e }));
691
+ n(Ie, {
692
692
  displayName: "Command<createCodeBlockCommand>",
693
693
  group: "CodeBlock"
694
694
  });
@@ -697,25 +697,25 @@ n(Et, {
697
697
  displayName: "Command<updateCodeBlockLanguageCommand>",
698
698
  group: "CodeBlock"
699
699
  });
700
- const Ie = f("codeBlockKeymap", {
700
+ const Ce = f("codeBlockKeymap", {
701
701
  CreateCodeBlock: {
702
702
  shortcuts: "Mod-Alt-c",
703
703
  command: (t) => {
704
704
  const e = t.get(u);
705
- return () => e.call(Ne.key);
705
+ return () => e.call(Ie.key);
706
706
  }
707
707
  }
708
708
  });
709
- n(Ie.ctx, {
709
+ n(Ce.ctx, {
710
710
  displayName: "KeymapCtx<codeBlock>",
711
711
  group: "CodeBlock"
712
712
  });
713
- n(Ie.shortcuts, {
713
+ n(Ce.shortcuts, {
714
714
  displayName: "Keymap<codeBlock>",
715
715
  group: "CodeBlock"
716
716
  });
717
- const Ce = N("image");
718
- n(Ce, {
717
+ const Me = N("image");
718
+ n(Me, {
719
719
  displayName: "Attr<image>",
720
720
  group: "Image"
721
721
  });
@@ -747,7 +747,7 @@ const v = I("image", (t) => ({
747
747
  }
748
748
  }
749
749
  ],
750
- toDOM: (e) => ["img", { ...t.get(Ce.key)(e), ...e.attrs }],
750
+ toDOM: (e) => ["img", { ...t.get(Me.key)(e), ...e.attrs }],
751
751
  parseMarkdown: {
752
752
  match: ({ type: e }) => e === "image",
753
753
  runner: (e, r, a) => {
@@ -788,14 +788,14 @@ n(gt, {
788
788
  displayName: "Command<insertImageCommand>",
789
789
  group: "Image"
790
790
  });
791
- const yt = c("UpdateImage", (t) => (e = {}) => (r, a) => {
791
+ const kt = c("UpdateImage", (t) => (e = {}) => (r, a) => {
792
792
  const o = Bt(r.selection, v.type(t));
793
793
  if (!o)
794
794
  return !1;
795
795
  const { node: s, pos: l } = o, i = { ...s.attrs }, { src: d, alt: m, title: p } = e;
796
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
797
  });
798
- n(yt, {
798
+ n(kt, {
799
799
  displayName: "Command<updateImageCommand>",
800
800
  group: "Image"
801
801
  });
@@ -810,10 +810,11 @@ n(Pt, {
810
810
  displayName: "InputRule<insertImageInputRule>",
811
811
  group: "Image"
812
812
  });
813
- const Me = N("hardbreak", (t) => ({
813
+ const V = N("hardbreak", (t) => ({
814
+ "data-type": "hardbreak",
814
815
  "data-is-inline": t.attrs.isInline
815
816
  }));
816
- n(Me, {
817
+ n(V, {
817
818
  displayName: "Attr<hardbreak>",
818
819
  group: "Hardbreak"
819
820
  });
@@ -826,8 +827,8 @@ const S = I("hardbreak", (t) => ({
826
827
  }
827
828
  },
828
829
  selectable: !1,
829
- parseDOM: [{ tag: "br" }],
830
- toDOM: (e) => ["br", t.get(Me.key)(e)],
830
+ parseDOM: [{ tag: "br" }, { tag: 'span[data-type="hardbreak"]', getAttrs: () => ({ isInline: !0 }) }],
831
+ toDOM: (e) => e.attrs.isInline ? ["span", t.get(V.key)(e), " "] : ["br", t.get(V.key)(e)],
831
832
  parseMarkdown: {
832
833
  match: ({ type: e }) => e === "break",
833
834
  runner: (e, r, a) => {
@@ -856,7 +857,7 @@ n(S.ctx, {
856
857
  const be = c("InsertHardbreak", (t) => () => (e, r) => {
857
858
  var s;
858
859
  const { selection: a, tr: o } = e;
859
- if (!(a instanceof X))
860
+ if (!(a instanceof Y))
860
861
  return !1;
861
862
  if (a.empty) {
862
863
  const l = a.$from.node();
@@ -918,14 +919,14 @@ n(F.ctx, {
918
919
  displayName: "NodeSchemaCtx<hr>",
919
920
  group: "Hr"
920
921
  });
921
- const kt = h((t) => new et(
922
+ const yt = h((t) => new et(
922
923
  /^(?:---|___\s|\*\*\*\s)$/,
923
924
  (e, r, a, o) => {
924
925
  const { tr: s } = e;
925
926
  return r[0] && s.replaceWith(a - 1, o, F.type(t).create()), s;
926
927
  }
927
928
  ));
928
- n(kt, {
929
+ n(yt, {
929
930
  displayName: "InputRule<insertHrInputRule>",
930
931
  group: "Hr"
931
932
  });
@@ -997,12 +998,12 @@ n(O.ctx, {
997
998
  displayName: "NodeSchemaCtx<bulletList>",
998
999
  group: "BulletList"
999
1000
  });
1000
- const ft = h((t) => Q(/^\s*([-+*])\s$/, O.type(t)));
1001
+ const ft = h((t) => X(/^\s*([-+*])\s$/, O.type(t)));
1001
1002
  n(ft, {
1002
1003
  displayName: "InputRule<wrapInBulletListInputRule>",
1003
1004
  group: "BulletList"
1004
1005
  });
1005
- const Ae = c("WrapInBulletList", (t) => () => J(O.type(t)));
1006
+ const Ae = c("WrapInBulletList", (t) => () => Q(O.type(t)));
1006
1007
  n(Ae, {
1007
1008
  displayName: "Command<wrapInBulletListCommand>",
1008
1009
  group: "BulletList"
@@ -1084,7 +1085,7 @@ n(T.ctx, {
1084
1085
  displayName: "NodeSchemaCtx<orderedList>",
1085
1086
  group: "OrderedList"
1086
1087
  });
1087
- const Nt = h((t) => Q(
1088
+ const Nt = h((t) => X(
1088
1089
  /^\s*(\d+)\.\s$/,
1089
1090
  T.type(t),
1090
1091
  (e) => ({ order: Number(e[1]) }),
@@ -1094,7 +1095,7 @@ n(Nt, {
1094
1095
  displayName: "InputRule<wrapInOrderedListInputRule>",
1095
1096
  group: "OrderedList"
1096
1097
  });
1097
- const Be = c("WrapInOrderedList", (t) => () => J(T.type(t)));
1098
+ const Be = c("WrapInOrderedList", (t) => () => Q(T.type(t)));
1098
1099
  n(Be, {
1099
1100
  displayName: "Command<wrapInOrderedListCommand>",
1100
1101
  group: "OrderedList"
@@ -1123,7 +1124,7 @@ n(ve, {
1123
1124
  });
1124
1125
  const M = I("list_item", (t) => ({
1125
1126
  group: "listItem",
1126
- content: "block+",
1127
+ content: "(paragraph|blockquote) block*",
1127
1128
  attrs: {
1128
1129
  label: {
1129
1130
  default: "•"
@@ -1144,7 +1145,7 @@ const M = I("list_item", (t) => ({
1144
1145
  throw A(e);
1145
1146
  return {
1146
1147
  label: e.dataset.label,
1147
- listType: e.dataset["list-type"],
1148
+ listType: e.dataset.listType,
1148
1149
  spread: e.dataset.spread
1149
1150
  };
1150
1151
  }
@@ -1200,7 +1201,7 @@ n(Ke, {
1200
1201
  function $t(t) {
1201
1202
  return (e, r, a) => {
1202
1203
  const { selection: o } = e;
1203
- if (!(o instanceof X))
1204
+ if (!(o instanceof Y))
1204
1205
  return !1;
1205
1206
  const { empty: s, $from: l } = o;
1206
1207
  if (!s || l.parentOffset !== 0)
@@ -1322,20 +1323,20 @@ n(Pe.ctx, {
1322
1323
  });
1323
1324
  const qt = [
1324
1325
  mt,
1325
- de,
1326
+ me,
1326
1327
  w,
1327
- j,
1328
- ce,
1328
+ z,
1329
+ ue,
1329
1330
  H,
1330
- Me,
1331
+ V,
1331
1332
  S,
1332
1333
  ye,
1333
1334
  q,
1334
- fe,
1335
+ Ne,
1335
1336
  W,
1336
1337
  xe,
1337
1338
  F,
1338
- Ce,
1339
+ Me,
1339
1340
  v,
1340
1341
  Se,
1341
1342
  O,
@@ -1343,13 +1344,13 @@ const qt = [
1343
1344
  T,
1344
1345
  ve,
1345
1346
  M,
1346
- Z,
1347
+ ee,
1347
1348
  R,
1348
- re,
1349
+ ae,
1349
1350
  $,
1350
- oe,
1351
+ se,
1351
1352
  x,
1352
- ie,
1353
+ de,
1353
1354
  B,
1354
1355
  Ee,
1355
1356
  Pe,
@@ -1359,7 +1360,7 @@ const qt = [
1359
1360
  ft,
1360
1361
  Nt,
1361
1362
  ut,
1362
- kt,
1363
+ yt,
1363
1364
  pt
1364
1365
  ].flat(), Ft = [
1365
1366
  nt,
@@ -1367,40 +1368,40 @@ const qt = [
1367
1368
  lt,
1368
1369
  st
1369
1370
  ], Vt = [
1370
- me,
1371
- ke,
1371
+ pe,
1372
+ he,
1372
1373
  L,
1373
- ue,
1374
- Ne,
1374
+ ge,
1375
+ Ie,
1375
1376
  be,
1376
1377
  ht,
1377
1378
  gt,
1378
- yt,
1379
+ kt,
1379
1380
  Be,
1380
1381
  Ae,
1381
1382
  Oe,
1382
1383
  Ke,
1383
1384
  Te,
1384
1385
  De,
1385
- ee,
1386
- se,
1387
- ae,
1386
+ te,
1387
+ le,
1388
+ ne,
1388
1389
  it,
1389
1390
  dt
1390
1391
  ], Ut = [
1391
- he,
1392
- Ie,
1392
+ fe,
1393
+ Ce,
1393
1394
  Le,
1394
- ge,
1395
+ ke,
1395
1396
  _e,
1396
1397
  Re,
1397
1398
  we,
1398
- pe,
1399
- te,
1400
- le,
1401
- ne
1399
+ ce,
1400
+ re,
1401
+ ie,
1402
+ oe
1402
1403
  ].flat(), $e = D("remarkAddOrderInList", () => () => (t) => {
1403
- Y(t, "list", (e) => {
1404
+ Z(t, "list", (e) => {
1404
1405
  if (e.ordered) {
1405
1406
  const r = e.start ?? 1;
1406
1407
  e.children.forEach((a, o) => {
@@ -1419,7 +1420,7 @@ n($e.options, {
1419
1420
  });
1420
1421
  const qe = D("remarkLineBreak", () => () => (t) => {
1421
1422
  const e = /[\t ]*(?:\r?\n|\r)/g;
1422
- Y(t, "text", (r, a, o) => {
1423
+ Z(t, "text", (r, a, o) => {
1423
1424
  if (!r.value || typeof r.value != "string")
1424
1425
  return;
1425
1426
  const s = [];
@@ -1462,8 +1463,8 @@ function zt(t, e) {
1462
1463
  if (m) {
1463
1464
  const p = r(m, i, a);
1464
1465
  if (p)
1465
- for (let k = 0, g = p.length; k < g; k++) {
1466
- const C = p[k];
1466
+ for (let y = 0, g = p.length; y < g; y++) {
1467
+ const C = p[y];
1467
1468
  C && l.push(C);
1468
1469
  }
1469
1470
  }
@@ -1486,7 +1487,7 @@ n(Fe.options, {
1486
1487
  });
1487
1488
  const Ve = D("remarkMarker", () => () => (t, e) => {
1488
1489
  const r = (a) => e.value.charAt(a.position.start.offset);
1489
- Y(t, (a) => ["strong", "emphasis"].includes(a.type), (a) => {
1490
+ Z(t, (a) => ["strong", "emphasis"].includes(a.type), (a) => {
1490
1491
  a.marker = r(a);
1491
1492
  });
1492
1493
  });
@@ -1567,8 +1568,8 @@ const Mt = _((t) => new P({
1567
1568
  if (s instanceof Tt) {
1568
1569
  let d = a.tr;
1569
1570
  const { from: m, to: p } = s;
1570
- return a.doc.nodesBetween(m, p, (k, g) => {
1571
- k.type === S.type(t) && (d = d.setNodeMarkup(g, S.type(t), void 0, []));
1571
+ return a.doc.nodesBetween(m, p, (y, g) => {
1572
+ y.type === S.type(t) && (d = d.setNodeMarkup(g, S.type(t), void 0, []));
1572
1573
  }), d;
1573
1574
  }
1574
1575
  }
@@ -1607,7 +1608,7 @@ const Lt = _((t) => {
1607
1608
  const e = new E("MILKDOWN_HEADING_ID"), r = (a) => {
1608
1609
  if (a.composing)
1609
1610
  return;
1610
- const o = t.get(j.key), s = a.state.tr.setMeta("addToHistory", !1);
1611
+ const o = t.get(z.key), s = a.state.tr.setMeta("addToHistory", !1);
1611
1612
  let l = !1;
1612
1613
  a.state.doc.descendants((i, d) => {
1613
1614
  if (i.type === H.type(t)) {
@@ -1624,8 +1625,8 @@ const Lt = _((t) => {
1624
1625
  return new P({
1625
1626
  key: e,
1626
1627
  view: (a) => (r(a), {
1627
- update: (o) => {
1628
- r(o);
1628
+ update: (o, s) => {
1629
+ o.state.doc.eq(s.doc) || r(o);
1629
1630
  }
1630
1631
  })
1631
1632
  });
@@ -1638,16 +1639,16 @@ const xt = _((t) => {
1638
1639
  const e = (r) => {
1639
1640
  if (r.composing || !r.editable)
1640
1641
  return;
1641
- const a = T.type(t), o = O.type(t), s = M.type(t), l = r.state, i = (p, k) => {
1642
+ const a = T.type(t), o = O.type(t), s = M.type(t), l = r.state, i = (p, y) => {
1642
1643
  let g = !1;
1643
- const C = `${k + 1}.`;
1644
+ const C = `${y + 1}.`;
1644
1645
  return p.label !== C && (p.label = C, g = !0), g;
1645
1646
  };
1646
1647
  let d = l.tr, m = !1;
1647
- l.doc.descendants((p, k, g, C) => {
1648
+ l.doc.descendants((p, y, g, C) => {
1648
1649
  if (p.type === o) {
1649
- const y = p.maybeChild(0);
1650
- (y == null ? void 0 : y.type) === s && y.attrs.listType === "ordered" && (m = !0, d.setNodeMarkup(k, a, { spread: "true" }), p.descendants((b, Ge, Qt, St) => {
1650
+ const k = p.maybeChild(0);
1651
+ (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) => {
1651
1652
  if (b.type === s) {
1652
1653
  const je = { ...b.attrs };
1653
1654
  i(je, St) && (d = d.setNodeMarkup(Ge, void 0, je));
@@ -1655,9 +1656,9 @@ const xt = _((t) => {
1655
1656
  return !1;
1656
1657
  }));
1657
1658
  } else if (p.type === s && (g == null ? void 0 : g.type) === a) {
1658
- const y = { ...p.attrs };
1659
+ const k = { ...p.attrs };
1659
1660
  let b = !1;
1660
- y.listType !== "ordered" && (y.listType = "ordered", b = !0), (g == null ? void 0 : g.maybeChild(0)) && (b = i(y, C)), b && (d = d.setNodeMarkup(k, void 0, y), m = !0);
1661
+ 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);
1661
1662
  }
1662
1663
  }), m && r.dispatch(d.setMeta("addToHistory", !1));
1663
1664
  };
@@ -1689,56 +1690,56 @@ const Jt = [
1689
1690
  ].flat(), cr = [qt, Wt, Ft, Vt, Ut, Jt].flat();
1690
1691
  export {
1691
1692
  ye as blockquoteAttr,
1692
- he as blockquoteKeymap,
1693
+ fe as blockquoteKeymap,
1693
1694
  q as blockquoteSchema,
1694
1695
  Se as bulletListAttr,
1695
1696
  we as bulletListKeymap,
1696
1697
  O as bulletListSchema,
1697
- fe as codeBlockAttr,
1698
- Ie as codeBlockKeymap,
1698
+ Ne as codeBlockAttr,
1699
+ Ce as codeBlockKeymap,
1699
1700
  W as codeBlockSchema,
1700
1701
  Vt as commands,
1701
1702
  cr as commonmark,
1702
- Ne as createCodeBlockCommand,
1703
+ Ie as createCodeBlockCommand,
1703
1704
  ut as createCodeBlockInputRule,
1704
1705
  mt as docSchema,
1705
- ue as downgradeHeadingCommand,
1706
- Z as emphasisAttr,
1707
- te as emphasisKeymap,
1706
+ ge as downgradeHeadingCommand,
1707
+ ee as emphasisAttr,
1708
+ re as emphasisKeymap,
1708
1709
  R as emphasisSchema,
1709
1710
  nt as emphasisStarInputRule,
1710
1711
  ot as emphasisUnderscoreInputRule,
1711
- Me as hardbreakAttr,
1712
+ V as hardbreakAttr,
1712
1713
  Mt as hardbreakClearMarkPlugin,
1713
1714
  Ue as hardbreakFilterNodes,
1714
1715
  bt as hardbreakFilterPlugin,
1715
1716
  Le as hardbreakKeymap,
1716
1717
  S as hardbreakSchema,
1717
- ce as headingAttr,
1718
- j as headingIdGenerator,
1719
- ge as headingKeymap,
1718
+ ue as headingAttr,
1719
+ z as headingIdGenerator,
1720
+ ke as headingKeymap,
1720
1721
  H as headingSchema,
1721
1722
  xe as hrAttr,
1722
1723
  F as hrSchema,
1723
1724
  Ee as htmlAttr,
1724
1725
  Pe as htmlSchema,
1725
- Ce as imageAttr,
1726
+ Me as imageAttr,
1726
1727
  v as imageSchema,
1727
- oe as inlineCodeAttr,
1728
+ se as inlineCodeAttr,
1728
1729
  lt as inlineCodeInputRule,
1729
- le as inlineCodeKeymap,
1730
+ ie as inlineCodeKeymap,
1730
1731
  x as inlineCodeSchema,
1731
1732
  Ct as inlineNodesCursorPlugin,
1732
1733
  Wt as inputRules,
1733
1734
  be as insertHardbreakCommand,
1734
1735
  ht as insertHrCommand,
1735
- kt as insertHrInputRule,
1736
+ yt as insertHrInputRule,
1736
1737
  gt as insertImageCommand,
1737
1738
  Pt as insertImageInputRule,
1738
1739
  Ut as keymap,
1739
1740
  De as liftFirstListItemCommand,
1740
1741
  Te as liftListItemCommand,
1741
- ie as linkAttr,
1742
+ de as linkAttr,
1742
1743
  B as linkSchema,
1743
1744
  ve as listItemAttr,
1744
1745
  _e as listItemKeymap,
@@ -1747,8 +1748,8 @@ export {
1747
1748
  He as orderedListAttr,
1748
1749
  Re as orderedListKeymap,
1749
1750
  T as orderedListSchema,
1750
- de as paragraphAttr,
1751
- pe as paragraphKeymap,
1751
+ me as paragraphAttr,
1752
+ ce as paragraphKeymap,
1752
1753
  w as paragraphSchema,
1753
1754
  Jt as plugins,
1754
1755
  $e as remarkAddOrderInListPlugin,
@@ -1759,22 +1760,22 @@ export {
1759
1760
  qt as schema,
1760
1761
  Oe as sinkListItemCommand,
1761
1762
  Ke as splitListItemCommand,
1762
- re as strongAttr,
1763
+ ae as strongAttr,
1763
1764
  st as strongInputRule,
1764
- ne as strongKeymap,
1765
+ oe as strongKeymap,
1765
1766
  $ as strongSchema,
1766
1767
  Lt as syncHeadingIdPlugin,
1767
1768
  xt as syncListOrderPlugin,
1768
1769
  It as textSchema,
1769
- ee as toggleEmphasisCommand,
1770
- se as toggleInlineCodeCommand,
1770
+ te as toggleEmphasisCommand,
1771
+ le as toggleInlineCodeCommand,
1771
1772
  it as toggleLinkCommand,
1772
- ae as toggleStrongCommand,
1773
- me as turnIntoTextCommand,
1773
+ ne as toggleStrongCommand,
1774
+ pe as turnIntoTextCommand,
1774
1775
  Et as updateCodeBlockLanguageCommand,
1775
- yt as updateImageCommand,
1776
+ kt as updateImageCommand,
1776
1777
  dt as updateLinkCommand,
1777
- ke as wrapInBlockquoteCommand,
1778
+ he as wrapInBlockquoteCommand,
1778
1779
  ct as wrapInBlockquoteInputRule,
1779
1780
  Ae as wrapInBulletListCommand,
1780
1781
  ft as wrapInBulletListInputRule,