@milkdown/preset-commonmark 7.6.2 → 7.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1,17 +1,16 @@
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 v, $prose as _ } from "@milkdown/utils";
1
+ import { $markAttr as U, $markSchema as G, $inputRule as h, $command as u, $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 g, editorViewCtx as At } from "@milkdown/core";
3
- import { toggleMark as J, setBlockType as D, wrapIn as Q } 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
6
  import { textblockTypeInputRule as Ze, wrappingInputRule as X, InputRule as et } from "@milkdown/prose/inputrules";
7
- import Ht from "@sindresorhus/slugify";
8
7
  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
- import { sinkListItem as Rt, liftListItem as rt, splitListItem as Ot } from "@milkdown/prose/schema-list";
11
- import { ReplaceStep as Tt, AddMarkStep as Kt } from "@milkdown/prose/transform";
8
+ import { markRule as j, findSelectedNodeOfType as Ht } from "@milkdown/prose";
9
+ import { sinkListItem as Bt, splitListItem as Rt, liftListItem as rt } from "@milkdown/prose/schema-list";
10
+ import { ReplaceStep as vt, AddMarkStep as Ot } from "@milkdown/prose/transform";
12
11
  import { Decoration as ze, DecorationSet as Je } from "@milkdown/prose/view";
13
12
  import { visit as Z } from "unist-util-visit";
14
- import Dt from "remark-inline-links";
13
+ import Tt from "remark-inline-links";
15
14
  function at(t, e) {
16
15
  var o;
17
16
  if (!(e.childCount >= 1 && ((o = e.lastChild) == null ? void 0 : o.type.name) === "hardbreak")) {
@@ -71,7 +70,7 @@ n(R.ctx, {
71
70
  displayName: "MarkSchemaCtx<emphasis>",
72
71
  group: "Emphasis"
73
72
  });
74
- const te = c("ToggleEmphasis", (t) => () => J(R.type(t)));
73
+ const te = u("ToggleEmphasis", (t) => () => J(R.type(t)));
75
74
  n(te, {
76
75
  displayName: "Command<toggleEmphasisCommand>",
77
76
  group: "Emphasis"
@@ -153,7 +152,7 @@ n($.ctx, {
153
152
  displayName: "MarkSchemaCtx<strong>",
154
153
  group: "Strong"
155
154
  });
156
- const ne = c("ToggleStrong", (t) => () => J($.type(t)));
155
+ const ne = u("ToggleStrong", (t) => () => J($.type(t)));
157
156
  n(ne, {
158
157
  displayName: "Command<toggleStrongCommand>",
159
158
  group: "Strong"
@@ -216,7 +215,7 @@ n(x.ctx, {
216
215
  displayName: "MarkSchemaCtx<inlineCode>",
217
216
  group: "InlineCode"
218
217
  });
219
- const le = c(
218
+ const le = u(
220
219
  "ToggleInlineCode",
221
220
  (t) => () => (e, r) => {
222
221
  const { selection: a, tr: o } = e;
@@ -299,7 +298,7 @@ n(B.mark, {
299
298
  displayName: "MarkSchema<link>",
300
299
  group: "Link"
301
300
  });
302
- const it = c(
301
+ const it = u(
303
302
  "ToggleLink",
304
303
  (t) => (e = {}) => J(B.type(t), e)
305
304
  );
@@ -307,7 +306,7 @@ n(it, {
307
306
  displayName: "Command<toggleLinkCommand>",
308
307
  group: "Link"
309
308
  });
310
- const dt = c(
309
+ const dt = u(
311
310
  "UpdateLink",
312
311
  (t) => (e = {}) => (r, a) => {
313
312
  if (!a) return !1;
@@ -319,9 +318,9 @@ const dt = c(
319
318
  }), !o) return !1;
320
319
  const m = o.marks.find(({ type: y }) => y === B.type(t));
321
320
  if (!m) return !1;
322
- const u = s, p = s + o.nodeSize, { tr: k } = r, C = B.type(t).create({ ...m.attrs, ...e });
321
+ const p = s, c = s + o.nodeSize, { tr: k } = r, C = B.type(t).create({ ...m.attrs, ...e });
323
322
  return C ? (a(
324
- k.removeMark(u, p, m).addMark(u, p, C).setSelection(new Y(k.selection.$anchor)).scrollIntoView()
323
+ k.removeMark(p, c, m).addMark(p, c, C).setSelection(new Y(k.selection.$anchor)).scrollIntoView()
325
324
  ), !0) : !1;
326
325
  }
327
326
  );
@@ -379,45 +378,45 @@ n(w.ctx, {
379
378
  displayName: "NodeSchemaCtx<paragraph>",
380
379
  group: "Paragraph"
381
380
  });
382
- const ue = c(
381
+ const pe = u(
383
382
  "TurnIntoText",
384
- (t) => () => D(w.type(t))
383
+ (t) => () => K(w.type(t))
385
384
  );
386
- n(ue, {
385
+ n(pe, {
387
386
  displayName: "Command<turnIntoTextCommand>",
388
387
  group: "Paragraph"
389
388
  });
390
- const pe = f("paragraphKeymap", {
389
+ const ce = f("paragraphKeymap", {
391
390
  TurnIntoText: {
392
391
  shortcuts: "Mod-Alt-0",
393
392
  command: (t) => {
394
393
  const e = t.get(g);
395
- return () => e.call(ue.key);
394
+ return () => e.call(pe.key);
396
395
  }
397
396
  }
398
397
  });
399
- n(pe.ctx, {
398
+ n(ce.ctx, {
400
399
  displayName: "KeymapCtx<paragraph>",
401
400
  group: "Paragraph"
402
401
  });
403
- n(pe.shortcuts, {
402
+ n(ce.shortcuts, {
404
403
  displayName: "Keymap<paragraph>",
405
404
  group: "Paragraph"
406
405
  });
407
- const vt = Array(6).fill(0).map((t, e) => e + 1);
408
- function _t(t) {
409
- return Ht(t.textContent);
406
+ const Kt = Array(6).fill(0).map((t, e) => e + 1);
407
+ function Dt(t) {
408
+ return t.textContent.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-");
410
409
  }
411
410
  const z = Xe(
412
- _t,
411
+ Dt,
413
412
  "headingIdGenerator"
414
413
  );
415
414
  n(z, {
416
415
  displayName: "Ctx<HeadingIdGenerator>",
417
416
  group: "Heading"
418
417
  });
419
- const ce = N("heading");
420
- n(ce, {
418
+ const ue = N("heading");
419
+ n(ue, {
421
420
  displayName: "Attr<heading>",
422
421
  group: "Heading"
423
422
  });
@@ -435,7 +434,7 @@ const H = I("heading", (t) => {
435
434
  default: 1
436
435
  }
437
436
  },
438
- parseDOM: vt.map((r) => ({
437
+ parseDOM: Kt.map((r) => ({
439
438
  tag: `h${r}`,
440
439
  getAttrs: (a) => {
441
440
  if (!(a instanceof HTMLElement)) throw A(a);
@@ -445,7 +444,7 @@ const H = I("heading", (t) => {
445
444
  toDOM: (r) => [
446
445
  `h${r.attrs.level}`,
447
446
  {
448
- ...t.get(ce.key)(r),
447
+ ...t.get(ue.key)(r),
449
448
  id: r.attrs.id || e(r)
450
449
  },
451
450
  0
@@ -473,7 +472,7 @@ n(H.ctx, {
473
472
  displayName: "NodeSchemaCtx<heading>",
474
473
  group: "Heading"
475
474
  });
476
- const ut = h((t) => Ze(
475
+ const pt = h((t) => Ze(
477
476
  /^(?<hashes>#+)\s$/,
478
477
  H.type(t),
479
478
  (e) => {
@@ -486,16 +485,16 @@ const ut = h((t) => Ze(
486
485
  return { level: r };
487
486
  }
488
487
  ));
489
- n(ut, {
488
+ n(pt, {
490
489
  displayName: "InputRule<wrapInHeadingInputRule>",
491
490
  group: "Heading"
492
491
  });
493
- const L = c("WrapInHeading", (t) => (e) => (e ?? (e = 1), e < 1 ? D(w.type(t)) : D(H.type(t), { level: e })));
492
+ const L = u("WrapInHeading", (t) => (e) => (e ?? (e = 1), e < 1 ? K(w.type(t)) : K(H.type(t), { level: e })));
494
493
  n(L, {
495
494
  displayName: "Command<wrapInHeadingCommand>",
496
495
  group: "Heading"
497
496
  });
498
- const ge = c(
497
+ const ge = u(
499
498
  "DowngradeHeading",
500
499
  (t) => () => (e, r, a) => {
501
500
  const { $from: o } = e.selection, s = o.node();
@@ -507,7 +506,7 @@ const ge = c(
507
506
  ...s.attrs,
508
507
  level: l
509
508
  })
510
- ), !0) : D(w.type(t))(e, r, a);
509
+ ), !0) : K(w.type(t))(e, r, a);
511
510
  }
512
511
  );
513
512
  n(ge, {
@@ -608,14 +607,14 @@ n(q.ctx, {
608
607
  displayName: "NodeSchemaCtx<blockquote>",
609
608
  group: "Blockquote"
610
609
  });
611
- const pt = h(
610
+ const ct = h(
612
611
  (t) => X(/^\s*>\s$/, q.type(t))
613
612
  );
614
- n(pt, {
613
+ n(ct, {
615
614
  displayName: "InputRule<wrapInBlockquoteInputRule>",
616
615
  group: "Blockquote"
617
616
  });
618
- const he = c(
617
+ const he = u(
619
618
  "WrapInBlockquote",
620
619
  (t) => () => Q(q.type(t))
621
620
  );
@@ -705,7 +704,7 @@ n(W.ctx, {
705
704
  displayName: "NodeSchemaCtx<codeBlock>",
706
705
  group: "CodeBlock"
707
706
  });
708
- const ct = h(
707
+ const ut = h(
709
708
  (t) => Ze(
710
709
  /^```(?<language>[a-z]*)?[\s\n]$/,
711
710
  W.type(t),
@@ -717,26 +716,26 @@ const ct = h(
717
716
  }
718
717
  )
719
718
  );
720
- n(ct, {
719
+ n(ut, {
721
720
  displayName: "InputRule<createCodeBlockInputRule>",
722
721
  group: "CodeBlock"
723
722
  });
724
- const Ie = c(
723
+ const Ie = u(
725
724
  "CreateCodeBlock",
726
- (t) => (e = "") => D(W.type(t), { language: e })
725
+ (t) => (e = "") => K(W.type(t), { language: e })
727
726
  );
728
727
  n(Ie, {
729
728
  displayName: "Command<createCodeBlockCommand>",
730
729
  group: "CodeBlock"
731
730
  });
732
- const Et = c(
731
+ const _t = u(
733
732
  "UpdateCodeBlockLanguage",
734
733
  () => ({ pos: t, language: e } = {
735
734
  pos: -1,
736
735
  language: ""
737
736
  }) => (r, a) => t >= 0 ? (a == null || a(r.tr.setNodeAttribute(t, "language", e)), !0) : !1
738
737
  );
739
- n(Et, {
738
+ n(_t, {
740
739
  displayName: "Command<updateCodeBlockLanguageCommand>",
741
740
  group: "CodeBlock"
742
741
  });
@@ -762,7 +761,7 @@ n(Me, {
762
761
  displayName: "Attr<image>",
763
762
  group: "Image"
764
763
  });
765
- const O = I("image", (t) => ({
764
+ const v = I("image", (t) => ({
766
765
  inline: !0,
767
766
  group: "inline",
768
767
  selectable: !0,
@@ -812,19 +811,19 @@ const O = I("image", (t) => ({
812
811
  }
813
812
  }
814
813
  }));
815
- n(O.node, {
814
+ n(v.node, {
816
815
  displayName: "NodeSchema<image>",
817
816
  group: "Image"
818
817
  });
819
- n(O.ctx, {
818
+ n(v.ctx, {
820
819
  displayName: "NodeSchemaCtx<image>",
821
820
  group: "Image"
822
821
  });
823
- const gt = c(
822
+ const gt = u(
824
823
  "InsertImage",
825
824
  (t) => (e = {}) => (r, a) => {
826
825
  if (!a) return !0;
827
- const { src: o = "", alt: s = "", title: l = "" } = e, i = O.type(t).create({ src: o, alt: s, title: l });
826
+ const { src: o = "", alt: s = "", title: l = "" } = e, i = v.type(t).create({ src: o, alt: s, title: l });
828
827
  return i && a(r.tr.replaceSelectionWith(i).scrollIntoView()), !0;
829
828
  }
830
829
  );
@@ -832,16 +831,16 @@ n(gt, {
832
831
  displayName: "Command<insertImageCommand>",
833
832
  group: "Image"
834
833
  });
835
- const kt = c(
834
+ const kt = u(
836
835
  "UpdateImage",
837
836
  (t) => (e = {}) => (r, a) => {
838
- const o = Bt(
837
+ const o = Ht(
839
838
  r.selection,
840
- O.type(t)
839
+ v.type(t)
841
840
  );
842
841
  if (!o) return !1;
843
- const { node: s, pos: l } = o, i = { ...s.attrs }, { src: d, alt: m, title: u } = e;
844
- return d !== void 0 && (i.src = d), m !== void 0 && (i.alt = m), u !== void 0 && (i.title = u), a == null || a(
842
+ const { node: s, pos: l } = o, i = { ...s.attrs }, { src: d, alt: m, title: p } = e;
843
+ return d !== void 0 && (i.src = d), m !== void 0 && (i.alt = m), p !== void 0 && (i.title = p), a == null || a(
845
844
  r.tr.setNodeMarkup(l, void 0, i).scrollIntoView()
846
845
  ), !0;
847
846
  }
@@ -850,7 +849,7 @@ n(kt, {
850
849
  displayName: "Command<updateImageCommand>",
851
850
  group: "Image"
852
851
  });
853
- const Pt = h(
852
+ const Et = h(
854
853
  (t) => new et(
855
854
  /!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,
856
855
  (e, r, a, o) => {
@@ -858,12 +857,12 @@ const Pt = h(
858
857
  return s ? e.tr.replaceWith(
859
858
  a,
860
859
  o,
861
- O.type(t).create({ src: i, alt: l, title: d })
860
+ v.type(t).create({ src: i, alt: l, title: d })
862
861
  ) : null;
863
862
  }
864
863
  )
865
864
  );
866
- n(Pt, {
865
+ n(Et, {
867
866
  displayName: "InputRule<insertImageInputRule>",
868
867
  group: "Image"
869
868
  });
@@ -919,7 +918,7 @@ n(S.ctx, {
919
918
  displayName: "NodeSchemaCtx<hardbreak>",
920
919
  group: "Hardbreak"
921
920
  });
922
- const be = c(
921
+ const be = u(
923
922
  "InsertHardbreak",
924
923
  (t) => () => (e, r) => {
925
924
  var s;
@@ -1002,7 +1001,7 @@ n(yt, {
1002
1001
  displayName: "InputRule<insertHrInputRule>",
1003
1002
  group: "Hr"
1004
1003
  });
1005
- const ht = c(
1004
+ const ht = u(
1006
1005
  "InsertHr",
1007
1006
  (t) => () => (e, r) => {
1008
1007
  if (!r) return !0;
@@ -1021,7 +1020,7 @@ n(Se, {
1021
1020
  displayName: "Attr<bulletList>",
1022
1021
  group: "BulletList"
1023
1022
  });
1024
- const T = I("bullet_list", (t) => ({
1023
+ const O = I("bullet_list", (t) => ({
1025
1024
  content: "listItem+",
1026
1025
  group: "block",
1027
1026
  attrs: {
@@ -1065,24 +1064,24 @@ const T = I("bullet_list", (t) => ({
1065
1064
  }
1066
1065
  }
1067
1066
  }));
1068
- n(T.node, {
1067
+ n(O.node, {
1069
1068
  displayName: "NodeSchema<bulletList>",
1070
1069
  group: "BulletList"
1071
1070
  });
1072
- n(T.ctx, {
1071
+ n(O.ctx, {
1073
1072
  displayName: "NodeSchemaCtx<bulletList>",
1074
1073
  group: "BulletList"
1075
1074
  });
1076
1075
  const ft = h(
1077
- (t) => X(/^\s*([-+*])\s$/, T.type(t))
1076
+ (t) => X(/^\s*([-+*])\s$/, O.type(t))
1078
1077
  );
1079
1078
  n(ft, {
1080
1079
  displayName: "InputRule<wrapInBulletListInputRule>",
1081
1080
  group: "BulletList"
1082
1081
  });
1083
- const Ae = c(
1082
+ const Ae = u(
1084
1083
  "WrapInBulletList",
1085
- (t) => () => Q(T.type(t))
1084
+ (t) => () => Q(O.type(t))
1086
1085
  );
1087
1086
  n(Ae, {
1088
1087
  displayName: "Command<wrapInBulletListCommand>",
@@ -1110,7 +1109,7 @@ n(He, {
1110
1109
  displayName: "Attr<orderedList>",
1111
1110
  group: "OrderedList"
1112
1111
  });
1113
- const K = I("ordered_list", (t) => ({
1112
+ const T = I("ordered_list", (t) => ({
1114
1113
  content: "listItem+",
1115
1114
  group: "block",
1116
1115
  attrs: {
@@ -1160,18 +1159,18 @@ const K = I("ordered_list", (t) => ({
1160
1159
  }
1161
1160
  }
1162
1161
  }));
1163
- n(K.node, {
1162
+ n(T.node, {
1164
1163
  displayName: "NodeSchema<orderedList>",
1165
1164
  group: "OrderedList"
1166
1165
  });
1167
- n(K.ctx, {
1166
+ n(T.ctx, {
1168
1167
  displayName: "NodeSchemaCtx<orderedList>",
1169
1168
  group: "OrderedList"
1170
1169
  });
1171
1170
  const Nt = h(
1172
1171
  (t) => X(
1173
1172
  /^\s*(\d+)\.\s$/,
1174
- K.type(t),
1173
+ T.type(t),
1175
1174
  (e) => ({ order: Number(e[1]) }),
1176
1175
  (e, r) => r.childCount + r.attrs.order === Number(e[1])
1177
1176
  )
@@ -1180,9 +1179,9 @@ n(Nt, {
1180
1179
  displayName: "InputRule<wrapInOrderedListInputRule>",
1181
1180
  group: "OrderedList"
1182
1181
  });
1183
- const Be = c(
1182
+ const Be = u(
1184
1183
  "WrapInOrderedList",
1185
- (t) => () => Q(K.type(t))
1184
+ (t) => () => Q(T.type(t))
1186
1185
  );
1187
1186
  n(Be, {
1188
1187
  displayName: "Command<wrapInOrderedListCommand>",
@@ -1205,8 +1204,8 @@ n(Re.shortcuts, {
1205
1204
  displayName: "Keymap<orderedList>",
1206
1205
  group: "OrderedList"
1207
1206
  });
1208
- const Oe = N("listItem");
1209
- n(Oe, {
1207
+ const ve = N("listItem");
1208
+ n(ve, {
1210
1209
  displayName: "Attr<listItem>",
1211
1210
  group: "ListItem"
1212
1211
  });
@@ -1241,7 +1240,7 @@ const M = I("list_item", (t) => ({
1241
1240
  toDOM: (e) => [
1242
1241
  "li",
1243
1242
  {
1244
- ...t.get(Oe.key)(e),
1243
+ ...t.get(ve.key)(e),
1245
1244
  "data-label": e.attrs.label,
1246
1245
  "data-list-type": e.attrs.listType,
1247
1246
  "data-spread": e.attrs.spread
@@ -1272,31 +1271,31 @@ n(M.ctx, {
1272
1271
  displayName: "NodeSchemaCtx<listItem>",
1273
1272
  group: "ListItem"
1274
1273
  });
1275
- const Te = c(
1274
+ const Oe = u(
1276
1275
  "SinkListItem",
1277
- (t) => () => Rt(M.type(t))
1276
+ (t) => () => Bt(M.type(t))
1278
1277
  );
1279
- n(Te, {
1278
+ n(Oe, {
1280
1279
  displayName: "Command<sinkListItemCommand>",
1281
1280
  group: "ListItem"
1282
1281
  });
1283
- const Ke = c(
1282
+ const Te = u(
1284
1283
  "LiftListItem",
1285
1284
  (t) => () => rt(M.type(t))
1286
1285
  );
1287
- n(Ke, {
1286
+ n(Te, {
1288
1287
  displayName: "Command<liftListItemCommand>",
1289
1288
  group: "ListItem"
1290
1289
  });
1291
- const De = c(
1290
+ const Ke = u(
1292
1291
  "SplitListItem",
1293
- (t) => () => Ot(M.type(t))
1292
+ (t) => () => Rt(M.type(t))
1294
1293
  );
1295
- n(De, {
1294
+ n(Ke, {
1296
1295
  displayName: "Command<splitListItemCommand>",
1297
1296
  group: "ListItem"
1298
1297
  });
1299
- function $t(t) {
1298
+ function Pt(t) {
1300
1299
  return (e, r, a) => {
1301
1300
  const { selection: o } = e;
1302
1301
  if (!(o instanceof Y)) return !1;
@@ -1306,11 +1305,11 @@ function $t(t) {
1306
1305
  return i.type !== M.type(t) || i.firstChild !== l.node() || l.node(-2).childCount > 1 ? !1 : rt(M.type(t))(e, r, a);
1307
1306
  };
1308
1307
  }
1309
- const ve = c(
1308
+ const De = u(
1310
1309
  "LiftFirstListItem",
1311
- (t) => () => $t(t)
1310
+ (t) => () => Pt(t)
1312
1311
  );
1313
- n(ve, {
1312
+ n(De, {
1314
1313
  displayName: "Command<liftFirstListItemCommand>",
1315
1314
  group: "ListItem"
1316
1315
  });
@@ -1319,28 +1318,28 @@ const _e = f("listItemKeymap", {
1319
1318
  shortcuts: "Enter",
1320
1319
  command: (t) => {
1321
1320
  const e = t.get(g);
1322
- return () => e.call(De.key);
1321
+ return () => e.call(Ke.key);
1323
1322
  }
1324
1323
  },
1325
1324
  SinkListItem: {
1326
1325
  shortcuts: ["Tab", "Mod-]"],
1327
1326
  command: (t) => {
1328
1327
  const e = t.get(g);
1329
- return () => e.call(Te.key);
1328
+ return () => e.call(Oe.key);
1330
1329
  }
1331
1330
  },
1332
1331
  LiftListItem: {
1333
1332
  shortcuts: ["Shift-Tab", "Mod-["],
1334
1333
  command: (t) => {
1335
1334
  const e = t.get(g);
1336
- return () => e.call(Ke.key);
1335
+ return () => e.call(Te.key);
1337
1336
  }
1338
1337
  },
1339
1338
  LiftFirstListItem: {
1340
1339
  shortcuts: ["Backspace", "Delete"],
1341
1340
  command: (t) => {
1342
1341
  const e = t.get(g);
1343
- return () => e.call(ve.key);
1342
+ return () => e.call(De.key);
1344
1343
  }
1345
1344
  }
1346
1345
  });
@@ -1422,12 +1421,12 @@ n(Pe.ctx, {
1422
1421
  displayName: "NodeSchemaCtx<html>",
1423
1422
  group: "Html"
1424
1423
  });
1425
- const qt = [
1424
+ const $t = [
1426
1425
  mt,
1427
1426
  me,
1428
1427
  w,
1429
1428
  z,
1430
- ce,
1429
+ ue,
1431
1430
  H,
1432
1431
  V,
1433
1432
  S,
@@ -1438,12 +1437,12 @@ const qt = [
1438
1437
  xe,
1439
1438
  F,
1440
1439
  Me,
1441
- O,
1440
+ v,
1442
1441
  Se,
1443
- T,
1442
+ O,
1444
1443
  He,
1445
- K,
1446
- Oe,
1444
+ T,
1445
+ ve,
1447
1446
  M,
1448
1447
  ee,
1449
1448
  R,
@@ -1456,20 +1455,20 @@ const qt = [
1456
1455
  Ee,
1457
1456
  Pe,
1458
1457
  It
1459
- ].flat(), Wt = [
1460
- pt,
1458
+ ].flat(), qt = [
1459
+ ct,
1461
1460
  ft,
1462
1461
  Nt,
1463
- ct,
1462
+ ut,
1464
1463
  yt,
1465
- ut
1466
- ].flat(), Ft = [
1464
+ pt
1465
+ ].flat(), Wt = [
1467
1466
  nt,
1468
1467
  ot,
1469
1468
  lt,
1470
1469
  st
1471
- ], Vt = [
1472
- ue,
1470
+ ], Ft = [
1471
+ pe,
1473
1472
  he,
1474
1473
  L,
1475
1474
  ge,
@@ -1480,16 +1479,16 @@ const qt = [
1480
1479
  kt,
1481
1480
  Be,
1482
1481
  Ae,
1482
+ Oe,
1483
+ Ke,
1483
1484
  Te,
1484
1485
  De,
1485
- Ke,
1486
- ve,
1487
1486
  te,
1488
1487
  le,
1489
1488
  ne,
1490
1489
  it,
1491
1490
  dt
1492
- ], Ut = [
1491
+ ], Vt = [
1493
1492
  fe,
1494
1493
  Ce,
1495
1494
  Le,
@@ -1497,11 +1496,11 @@ const qt = [
1497
1496
  _e,
1498
1497
  Re,
1499
1498
  we,
1500
- pe,
1499
+ ce,
1501
1500
  re,
1502
1501
  ie,
1503
1502
  oe
1504
- ].flat(), $e = v(
1503
+ ].flat(), $e = D(
1505
1504
  "remarkAddOrderInList",
1506
1505
  () => () => (t) => {
1507
1506
  Z(t, "list", (e) => {
@@ -1522,7 +1521,7 @@ n($e.options, {
1522
1521
  displayName: "RemarkConfig<remarkAddOrderInListPlugin>",
1523
1522
  group: "Remark"
1524
1523
  });
1525
- const qe = v(
1524
+ const qe = D(
1526
1525
  "remarkLineBreak",
1527
1526
  () => () => (t) => {
1528
1527
  const e = /[\t ]*(?:\r?\n|\r)/g;
@@ -1556,9 +1555,9 @@ n(qe.options, {
1556
1555
  displayName: "RemarkConfig<remarkLineBreak>",
1557
1556
  group: "Remark"
1558
1557
  });
1559
- const We = v(
1558
+ const We = D(
1560
1559
  "remarkInlineLink",
1561
- () => Dt
1560
+ () => Tt
1562
1561
  );
1563
1562
  n(We.plugin, {
1564
1563
  displayName: "Remark<remarkInlineLinkPlugin>",
@@ -1568,19 +1567,19 @@ n(We.options, {
1568
1567
  displayName: "RemarkConfig<remarkInlineLinkPlugin>",
1569
1568
  group: "Remark"
1570
1569
  });
1571
- const Gt = (t) => !!t.children, jt = (t) => t.type === "html";
1572
- function zt(t, e) {
1570
+ const Ut = (t) => !!t.children, Gt = (t) => t.type === "html";
1571
+ function jt(t, e) {
1573
1572
  return r(t, 0, null)[0];
1574
1573
  function r(a, o, s) {
1575
- if (Gt(a)) {
1574
+ if (Ut(a)) {
1576
1575
  const l = [];
1577
1576
  for (let i = 0, d = a.children.length; i < d; i++) {
1578
1577
  const m = a.children[i];
1579
1578
  if (m) {
1580
- const u = r(m, i, a);
1581
- if (u)
1582
- for (let p = 0, k = u.length; p < k; p++) {
1583
- const C = u[p];
1579
+ const p = r(m, i, a);
1580
+ if (p)
1581
+ for (let c = 0, k = p.length; c < k; c++) {
1582
+ const C = p[c];
1584
1583
  C && l.push(C);
1585
1584
  }
1586
1585
  }
@@ -1590,10 +1589,10 @@ function zt(t, e) {
1590
1589
  return e(a, o, s);
1591
1590
  }
1592
1591
  }
1593
- const Fe = v(
1592
+ const Fe = D(
1594
1593
  "remarkHTMLTransformer",
1595
1594
  () => () => (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]);
1595
+ jt(t, (e, r, a) => Gt(e) ? ((a == null ? void 0 : a.type) === "root" && (e.children = [{ ...e }], delete e.value, e.type = "paragraph"), [e]) : [e]);
1597
1596
  }
1598
1597
  );
1599
1598
  n(Fe.plugin, {
@@ -1604,7 +1603,7 @@ n(Fe.options, {
1604
1603
  displayName: "RemarkConfig<remarkHtmlTransformer>",
1605
1604
  group: "Remark"
1606
1605
  });
1607
- const Ve = v(
1606
+ const Ve = D(
1608
1607
  "remarkMarker",
1609
1608
  () => () => (t, e) => {
1610
1609
  const r = (a) => e.value.charAt(a.position.start.offset);
@@ -1662,10 +1661,10 @@ const Ct = _(() => {
1662
1661
  if (r.getState(a)) {
1663
1662
  const l = a.selection.$from.pos, i = document.createElement("span"), d = ze.widget(l, i, {
1664
1663
  side: -1
1665
- }), m = document.createElement("span"), u = ze.widget(l, m);
1664
+ }), m = document.createElement("span"), p = ze.widget(l, m);
1666
1665
  return setTimeout(() => {
1667
1666
  i.contentEditable = "true", m.contentEditable = "true";
1668
- }), Je.create(a.doc, [d, u]);
1667
+ }), Je.create(a.doc, [d, p]);
1669
1668
  }
1670
1669
  return Je.empty;
1671
1670
  }
@@ -1685,7 +1684,7 @@ const Mt = _((t) => new P({
1685
1684
  if (!o) return;
1686
1685
  const [s] = o.steps;
1687
1686
  if (o.getMeta("hardbreak")) {
1688
- if (!(s instanceof Tt)) return;
1687
+ if (!(s instanceof vt)) return;
1689
1688
  const { from: d } = s;
1690
1689
  return a.tr.setNodeMarkup(
1691
1690
  d,
@@ -1694,11 +1693,11 @@ const Mt = _((t) => new P({
1694
1693
  []
1695
1694
  );
1696
1695
  }
1697
- if (s instanceof Kt) {
1696
+ if (s instanceof Ot) {
1698
1697
  let d = a.tr;
1699
- const { from: m, to: u } = s;
1700
- return a.doc.nodesBetween(m, u, (p, k) => {
1701
- p.type === S.type(t) && (d = d.setNodeMarkup(
1698
+ const { from: m, to: p } = s;
1699
+ return a.doc.nodesBetween(m, p, (c, k) => {
1700
+ c.type === S.type(t) && (d = d.setNodeMarkup(
1702
1701
  k,
1703
1702
  S.type(t),
1704
1703
  void 0,
@@ -1750,11 +1749,11 @@ const Lt = _((t) => {
1750
1749
  a.state.doc.descendants((d, m) => {
1751
1750
  if (d.type === H.type(t)) {
1752
1751
  if (d.textContent.trim().length === 0) return;
1753
- const u = d.attrs;
1754
- let p = o(d);
1755
- i[p] ? (i[p] += 1, p += `-#${i[p]}`) : i[p] = 1, u.id !== p && (l = !0, s.setMeta(e, !0).setNodeMarkup(m, void 0, {
1756
- ...u,
1757
- id: p
1752
+ const p = d.attrs;
1753
+ let c = o(d);
1754
+ i[c] ? (i[c] += 1, c += `-#${i[c]}`) : i[c] = 1, p.id !== c && (l = !0, s.setMeta(e, !0).setNodeMarkup(m, void 0, {
1755
+ ...p,
1756
+ id: c
1758
1757
  }));
1759
1758
  }
1760
1759
  }), l && a.dispatch(s);
@@ -1775,26 +1774,26 @@ n(Lt, {
1775
1774
  const xt = _((t) => {
1776
1775
  const e = (r) => {
1777
1776
  if (r.composing || !r.editable) return;
1778
- const a = K.type(t), o = T.type(t), s = M.type(t), l = r.state, i = (u, p) => {
1777
+ const a = T.type(t), o = O.type(t), s = M.type(t), l = r.state, i = (p, c) => {
1779
1778
  let k = !1;
1780
- const C = `${p + 1}.`;
1781
- return u.label !== C && (u.label = C, k = !0), k;
1779
+ const C = `${c + 1}.`;
1780
+ return p.label !== C && (p.label = C, k = !0), k;
1782
1781
  };
1783
1782
  let d = l.tr, m = !1;
1784
- l.doc.descendants((u, p, k, C) => {
1785
- if (u.type === o) {
1786
- const y = u.maybeChild(0);
1787
- (y == null ? void 0 : y.type) === s && y.attrs.listType === "ordered" && (m = !0, d.setNodeMarkup(p, a, { spread: "true" }), u.descendants((b, Ge, Qt, St) => {
1783
+ l.doc.descendants((p, c, k, C) => {
1784
+ if (p.type === o) {
1785
+ const y = p.maybeChild(0);
1786
+ (y == null ? void 0 : y.type) === s && y.attrs.listType === "ordered" && (m = !0, d.setNodeMarkup(c, a, { spread: "true" }), p.descendants((b, Ge, Jt, St) => {
1788
1787
  if (b.type === s) {
1789
1788
  const je = { ...b.attrs };
1790
1789
  i(je, St) && (d = d.setNodeMarkup(Ge, void 0, je));
1791
1790
  }
1792
1791
  return !1;
1793
1792
  }));
1794
- } else if (u.type === s && (k == null ? void 0 : k.type) === a) {
1795
- const y = { ...u.attrs };
1793
+ } else if (p.type === s && (k == null ? void 0 : k.type) === a) {
1794
+ const y = { ...p.attrs };
1796
1795
  let b = !1;
1797
- y.listType !== "ordered" && (y.listType = "ordered", b = !0), (k == null ? void 0 : k.maybeChild(0)) && (b = i(y, C)), b && (d = d.setNodeMarkup(p, void 0, y), m = !0);
1796
+ 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);
1798
1797
  }
1799
1798
  }), m && r.dispatch(d.setMeta("addToHistory", !1));
1800
1799
  };
@@ -1811,7 +1810,7 @@ n(xt, {
1811
1810
  displayName: "Prose<syncListOrderPlugin>",
1812
1811
  group: "Prose"
1813
1812
  });
1814
- const Jt = [
1813
+ const zt = [
1815
1814
  Mt,
1816
1815
  Ue,
1817
1816
  bt,
@@ -1823,13 +1822,13 @@ const Jt = [
1823
1822
  Ve,
1824
1823
  Lt,
1825
1824
  xt
1826
- ].flat(), pr = [
1825
+ ].flat(), mr = [
1826
+ $t,
1827
1827
  qt,
1828
1828
  Wt,
1829
1829
  Ft,
1830
1830
  Vt,
1831
- Ut,
1832
- Jt
1831
+ zt
1833
1832
  ].flat();
1834
1833
  export {
1835
1834
  ye as blockquoteAttr,
@@ -1837,14 +1836,14 @@ export {
1837
1836
  q as blockquoteSchema,
1838
1837
  Se as bulletListAttr,
1839
1838
  we as bulletListKeymap,
1840
- T as bulletListSchema,
1839
+ O as bulletListSchema,
1841
1840
  Ne as codeBlockAttr,
1842
1841
  Ce as codeBlockKeymap,
1843
1842
  W as codeBlockSchema,
1844
- Vt as commands,
1845
- pr as commonmark,
1843
+ Ft as commands,
1844
+ mr as commonmark,
1846
1845
  Ie as createCodeBlockCommand,
1847
- ct as createCodeBlockInputRule,
1846
+ ut as createCodeBlockInputRule,
1848
1847
  mt as docSchema,
1849
1848
  ge as downgradeHeadingCommand,
1850
1849
  ee as emphasisAttr,
@@ -1858,7 +1857,7 @@ export {
1858
1857
  bt as hardbreakFilterPlugin,
1859
1858
  Le as hardbreakKeymap,
1860
1859
  S as hardbreakSchema,
1861
- ce as headingAttr,
1860
+ ue as headingAttr,
1862
1861
  z as headingIdGenerator,
1863
1862
  ke as headingKeymap,
1864
1863
  H as headingSchema,
@@ -1867,42 +1866,42 @@ export {
1867
1866
  Ee as htmlAttr,
1868
1867
  Pe as htmlSchema,
1869
1868
  Me as imageAttr,
1870
- O as imageSchema,
1869
+ v as imageSchema,
1871
1870
  se as inlineCodeAttr,
1872
1871
  lt as inlineCodeInputRule,
1873
1872
  ie as inlineCodeKeymap,
1874
1873
  x as inlineCodeSchema,
1875
1874
  Ct as inlineNodesCursorPlugin,
1876
- Wt as inputRules,
1875
+ qt as inputRules,
1877
1876
  be as insertHardbreakCommand,
1878
1877
  ht as insertHrCommand,
1879
1878
  yt as insertHrInputRule,
1880
1879
  gt as insertImageCommand,
1881
- Pt as insertImageInputRule,
1882
- Ut as keymap,
1883
- ve as liftFirstListItemCommand,
1884
- Ke as liftListItemCommand,
1880
+ Et as insertImageInputRule,
1881
+ Vt as keymap,
1882
+ De as liftFirstListItemCommand,
1883
+ Te as liftListItemCommand,
1885
1884
  de as linkAttr,
1886
1885
  B as linkSchema,
1887
- Oe as listItemAttr,
1886
+ ve as listItemAttr,
1888
1887
  _e as listItemKeymap,
1889
1888
  M as listItemSchema,
1890
- Ft as markInputRules,
1889
+ Wt as markInputRules,
1891
1890
  He as orderedListAttr,
1892
1891
  Re as orderedListKeymap,
1893
- K as orderedListSchema,
1892
+ T as orderedListSchema,
1894
1893
  me as paragraphAttr,
1895
- pe as paragraphKeymap,
1894
+ ce as paragraphKeymap,
1896
1895
  w as paragraphSchema,
1897
- Jt as plugins,
1896
+ zt as plugins,
1898
1897
  $e as remarkAddOrderInListPlugin,
1899
1898
  Fe as remarkHtmlTransformer,
1900
1899
  We as remarkInlineLinkPlugin,
1901
1900
  qe as remarkLineBreak,
1902
1901
  Ve as remarkMarker,
1903
- qt as schema,
1904
- Te as sinkListItemCommand,
1905
- De as splitListItemCommand,
1902
+ $t as schema,
1903
+ Oe as sinkListItemCommand,
1904
+ Ke as splitListItemCommand,
1906
1905
  ae as strongAttr,
1907
1906
  st as strongInputRule,
1908
1907
  oe as strongKeymap,
@@ -1914,16 +1913,16 @@ export {
1914
1913
  le as toggleInlineCodeCommand,
1915
1914
  it as toggleLinkCommand,
1916
1915
  ne as toggleStrongCommand,
1917
- ue as turnIntoTextCommand,
1918
- Et as updateCodeBlockLanguageCommand,
1916
+ pe as turnIntoTextCommand,
1917
+ _t as updateCodeBlockLanguageCommand,
1919
1918
  kt as updateImageCommand,
1920
1919
  dt as updateLinkCommand,
1921
1920
  he as wrapInBlockquoteCommand,
1922
- pt as wrapInBlockquoteInputRule,
1921
+ ct as wrapInBlockquoteInputRule,
1923
1922
  Ae as wrapInBulletListCommand,
1924
1923
  ft as wrapInBulletListInputRule,
1925
1924
  L as wrapInHeadingCommand,
1926
- ut as wrapInHeadingInputRule,
1925
+ pt as wrapInHeadingInputRule,
1927
1926
  Be as wrapInOrderedListCommand,
1928
1927
  Nt as wrapInOrderedListInputRule
1929
1928
  };