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