@milkdown/preset-commonmark 6.5.2 → 6.5.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.
Files changed (88) hide show
  1. package/lib/index.d.ts +1 -1
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.es.js +228 -219
  4. package/lib/index.es.js.map +1 -1
  5. package/lib/mark/code-inline.d.ts +1 -1
  6. package/lib/mark/code-inline.d.ts.map +1 -1
  7. package/lib/mark/em.d.ts +1 -1
  8. package/lib/mark/em.d.ts.map +1 -1
  9. package/lib/mark/index.d.ts.map +1 -1
  10. package/lib/mark/link.d.ts +4 -3
  11. package/lib/mark/link.d.ts.map +1 -1
  12. package/lib/mark/strong.d.ts +1 -1
  13. package/lib/mark/strong.d.ts.map +1 -1
  14. package/lib/node/blockquote.d.ts +1 -1
  15. package/lib/node/blockquote.d.ts.map +1 -1
  16. package/lib/node/bullet-list.d.ts +1 -1
  17. package/lib/node/bullet-list.d.ts.map +1 -1
  18. package/lib/node/code-fence.d.ts.map +1 -1
  19. package/lib/node/doc.d.ts +1 -1
  20. package/lib/node/doc.d.ts.map +1 -1
  21. package/lib/node/hardbreak.d.ts.map +1 -1
  22. package/lib/node/heading.d.ts +2 -2
  23. package/lib/node/heading.d.ts.map +1 -1
  24. package/lib/node/hr.d.ts +1 -1
  25. package/lib/node/hr.d.ts.map +1 -1
  26. package/lib/node/image.d.ts +2 -2
  27. package/lib/node/image.d.ts.map +1 -1
  28. package/lib/node/index.d.ts +1 -1
  29. package/lib/node/index.d.ts.map +1 -1
  30. package/lib/node/list-item.d.ts +2 -2
  31. package/lib/node/list-item.d.ts.map +1 -1
  32. package/lib/node/ordered-list.d.ts +1 -1
  33. package/lib/node/ordered-list.d.ts.map +1 -1
  34. package/lib/node/paragraph.d.ts +1 -1
  35. package/lib/node/paragraph.d.ts.map +1 -1
  36. package/lib/node/text.d.ts +1 -1
  37. package/lib/node/text.d.ts.map +1 -1
  38. package/lib/plugin/add-order-in-list.d.ts +1 -1
  39. package/lib/plugin/add-order-in-list.d.ts.map +1 -1
  40. package/lib/plugin/filter-html.d.ts +1 -1
  41. package/lib/plugin/filter-html.d.ts.map +1 -1
  42. package/lib/plugin/index.d.ts +1 -1
  43. package/lib/plugin/index.d.ts.map +1 -1
  44. package/lib/plugin/inline-nodes-cursor.d.ts.map +1 -1
  45. package/lib/plugin/inline-sync/config.d.ts +8 -8
  46. package/lib/plugin/inline-sync/config.d.ts.map +1 -1
  47. package/lib/plugin/inline-sync/context.d.ts +5 -5
  48. package/lib/plugin/inline-sync/context.d.ts.map +1 -1
  49. package/lib/plugin/inline-sync/index.d.ts +1 -1
  50. package/lib/plugin/inline-sync/index.d.ts.map +1 -1
  51. package/lib/plugin/inline-sync/regexp.d.ts.map +1 -1
  52. package/lib/plugin/inline-sync/replacer.d.ts +3 -3
  53. package/lib/plugin/inline-sync/replacer.d.ts.map +1 -1
  54. package/lib/plugin/inline-sync/utils.d.ts +2 -2
  55. package/lib/plugin/inline-sync/utils.d.ts.map +1 -1
  56. package/lib/supported-keys.d.ts +1 -1
  57. package/lib/supported-keys.d.ts.map +1 -1
  58. package/package.json +17 -17
  59. package/src/index.ts +52 -52
  60. package/src/mark/code-inline.ts +56 -55
  61. package/src/mark/em.ts +36 -36
  62. package/src/mark/index.ts +9 -9
  63. package/src/mark/link.ts +250 -223
  64. package/src/mark/strong.ts +37 -37
  65. package/src/node/blockquote.ts +35 -35
  66. package/src/node/bullet-list.ts +65 -65
  67. package/src/node/code-fence.ts +236 -229
  68. package/src/node/doc.ts +21 -21
  69. package/src/node/hardbreak.ts +108 -107
  70. package/src/node/heading.ts +275 -272
  71. package/src/node/hr.ts +55 -55
  72. package/src/node/image.ts +216 -210
  73. package/src/node/index.ts +38 -38
  74. package/src/node/list-item.ts +139 -140
  75. package/src/node/ordered-list.ts +71 -71
  76. package/src/node/paragraph.ts +55 -53
  77. package/src/node/text.ts +18 -18
  78. package/src/plugin/add-order-in-list.ts +15 -15
  79. package/src/plugin/filter-html.ts +31 -33
  80. package/src/plugin/index.ts +13 -13
  81. package/src/plugin/inline-nodes-cursor.ts +78 -79
  82. package/src/plugin/inline-sync/config.ts +46 -45
  83. package/src/plugin/inline-sync/context.ts +88 -83
  84. package/src/plugin/inline-sync/index.ts +46 -42
  85. package/src/plugin/inline-sync/regexp.ts +2 -2
  86. package/src/plugin/inline-sync/replacer.ts +33 -31
  87. package/src/plugin/inline-sync/utils.ts +53 -55
  88. package/src/supported-keys.ts +22 -21
package/lib/index.es.js CHANGED
@@ -1,17 +1,17 @@
1
- import { createMark as W, createShortcut as h, createNode as w, pipe as Se, createPlugin as Ae, AtomList as we } from "@milkdown/utils";
2
- import { createCmdKey as y, createCmd as M, commandsCtx as Le, editorViewCtx as S, schemaCtx as B, getPalette as Ee, createSlice as ve, serializerCtx as _e, parserCtx as $e } from "@milkdown/core";
3
- import { toggleMark as me, wrapIn as pe, setBlockType as E } from "@milkdown/prose/commands";
4
- import { expectDomTypeError as L, missingRootElement as Pe } from "@milkdown/exception";
5
- import { calculateTextPosition as Be, cloneTr as Re, findSelectedNodeOfType as K, getNodeFromSchema as We } from "@milkdown/prose";
6
- import { PluginKey as H, TextSelection as J, Plugin as T, NodeSelection as qe, Selection as Ce } from "@milkdown/prose/state";
7
- import { wrappingInputRule as q, textblockTypeInputRule as Q, InputRule as xe } from "@milkdown/prose/inputrules";
8
- import { Fragment as R } from "@milkdown/prose/model";
1
+ import { createMark as q, createShortcut as M, createNode as C, pipe as Se, createPlugin as ve, AtomList as we } from "@milkdown/utils";
2
+ import { createCmdKey as I, createCmd as N, commandsCtx as Le, editorViewCtx as v, schemaCtx as R, getPalette as Ae, createSlice as Ee, serializerCtx as _e, parserCtx as $e } from "@milkdown/core";
3
+ import { toggleMark as pe, wrapIn as ge, setBlockType as A } from "@milkdown/prose/commands";
4
+ import { expectDomTypeError as x, missingRootElement as Pe } from "@milkdown/exception";
5
+ import { calculateTextPosition as Be, cloneTr as Re, findSelectedNodeOfType as F, getNodeFromSchema as We } from "@milkdown/prose";
6
+ import { PluginKey as H, TextSelection as Q, Plugin as T, NodeSelection as qe, Selection as Ce } from "@milkdown/prose/state";
7
+ import { wrappingInputRule as K, textblockTypeInputRule as X, InputRule as xe } from "@milkdown/prose/inputrules";
8
+ import { Fragment as W } from "@milkdown/prose/model";
9
9
  import { ReplaceStep as Ke, AddMarkStep as Fe } from "@milkdown/prose/transform";
10
- import { DecorationSet as O, Decoration as X } from "@milkdown/prose/view";
10
+ import { DecorationSet as S, Decoration as Z } from "@milkdown/prose/view";
11
11
  import { splitListItem as je, sinkListItem as ze, liftListItem as Ue } from "@milkdown/prose/schema-list";
12
12
  import Ve from "remark-inline-links";
13
13
  import { visit as Ge } from "unist-util-visit";
14
- const k = {
14
+ const y = {
15
15
  HardBreak: "HardBreak",
16
16
  Blockquote: "Blockquote",
17
17
  BulletList: "BulletList",
@@ -31,7 +31,7 @@ const k = {
31
31
  NextListItem: "NextListItem",
32
32
  SinkListItem: "SinkListItem",
33
33
  LiftListItem: "LiftListItem"
34
- }, ke = "code_inline", Z = y("ToggleInlineCode"), Ye = W((a) => ({
34
+ }, ke = "code_inline", ee = I("ToggleInlineCode"), Ye = q((a) => ({
35
35
  id: ke,
36
36
  schema: () => ({
37
37
  priority: 100,
@@ -53,7 +53,7 @@ const k = {
53
53
  }
54
54
  }),
55
55
  commands: (e) => [
56
- M(Z, () => (t, r) => {
56
+ N(ee, () => (t, r) => {
57
57
  const { selection: n, tr: o } = t;
58
58
  if (n.empty)
59
59
  return !1;
@@ -64,10 +64,10 @@ const k = {
64
64
  })
65
65
  ],
66
66
  shortcuts: {
67
- [k.CodeInline]: h(Z, "Mod-e")
67
+ [y.CodeInline]: M(ee, "Mod-e")
68
68
  }
69
- })), F = "em", ee = y("ToggleItalic"), Je = W((a) => ({
70
- id: F,
69
+ })), j = "em", te = I("ToggleItalic"), Je = q((a) => ({
70
+ id: j,
71
71
  schema: () => ({
72
72
  inclusive: !1,
73
73
  parseDOM: [
@@ -75,7 +75,7 @@ const k = {
75
75
  { tag: "em" },
76
76
  { style: "font-style", getAttrs: (e) => e === "italic" }
77
77
  ],
78
- toDOM: (e) => ["em", { class: a.getClassName(e.attrs, F) }],
78
+ toDOM: (e) => ["em", { class: a.getClassName(e.attrs, j) }],
79
79
  parseMarkdown: {
80
80
  match: (e) => e.type === "emphasis",
81
81
  runner: (e, t, r) => {
@@ -83,18 +83,18 @@ const k = {
83
83
  }
84
84
  },
85
85
  toMarkdown: {
86
- match: (e) => e.type.name === F,
86
+ match: (e) => e.type.name === j,
87
87
  runner: (e, t) => {
88
88
  e.withMark(t, "emphasis");
89
89
  }
90
90
  }
91
91
  }),
92
- commands: (e) => [M(ee, () => me(e))],
92
+ commands: (e) => [N(te, () => pe(e))],
93
93
  shortcuts: {
94
- [k.Em]: h(ee, "Mod-i")
94
+ [y.Em]: M(te, "Mod-i")
95
95
  }
96
- })), Qe = new H("MILKDOWN_LINK_INPUT"), Te = y("ToggleLink"), te = y("ModifyLink"), _ = "link", Xe = W((a, e) => ({
97
- id: _,
96
+ })), Qe = new H("MILKDOWN_LINK_INPUT"), Te = I("ToggleLink"), re = I("ModifyLink"), $ = "link", Xe = q((a, e) => ({
97
+ id: $,
98
98
  schema: () => ({
99
99
  attrs: {
100
100
  href: {},
@@ -105,12 +105,12 @@ const k = {
105
105
  tag: "a[href]",
106
106
  getAttrs: (t) => {
107
107
  if (!(t instanceof HTMLElement))
108
- throw L(t);
108
+ throw x(t);
109
109
  return { href: t.getAttribute("href"), title: t.getAttribute("title") };
110
110
  }
111
111
  }
112
112
  ],
113
- toDOM: (t) => ["a", { ...t.attrs, class: a.getClassName(t.attrs, _) }],
113
+ toDOM: (t) => ["a", { ...t.attrs, class: a.getClassName(t.attrs, $) }],
114
114
  parseMarkdown: {
115
115
  match: (t) => t.type === "link",
116
116
  runner: (t, r, n) => {
@@ -119,7 +119,7 @@ const k = {
119
119
  }
120
120
  },
121
121
  toMarkdown: {
122
- match: (t) => t.type.name === _,
122
+ match: (t) => t.type.name === $,
123
123
  runner: (t, r) => {
124
124
  t.withMark(r, "link", void 0, {
125
125
  title: r.attrs.title,
@@ -129,26 +129,26 @@ const k = {
129
129
  }
130
130
  }),
131
131
  commands: (t) => [
132
- M(Te, (r = "") => me(t, { href: r })),
133
- M(te, (r = "") => (n, o) => {
134
- var I;
132
+ N(Te, (r = "") => pe(t, { href: r })),
133
+ N(re, (r = "") => (n, o) => {
134
+ var k;
135
135
  if (!o)
136
136
  return !1;
137
137
  const { marks: l } = n.schema;
138
138
  let s, c = -1;
139
139
  const { selection: i } = n, { from: u, to: f } = i;
140
- if (n.doc.nodesBetween(u, u === f ? f + 1 : f, (b, C) => {
141
- var x;
142
- if ((x = l.link) != null && x.isInSet(b.marks))
143
- return s = b, c = C, !1;
140
+ if (n.doc.nodesBetween(u, u === f ? f + 1 : f, (b, w) => {
141
+ var L;
142
+ if ((L = l.link) != null && L.isInSet(b.marks))
143
+ return s = b, c = w, !1;
144
144
  }), !s)
145
145
  return !1;
146
146
  const d = s.marks.find(({ type: b }) => b === t);
147
147
  if (!d)
148
148
  return !1;
149
- const m = c, p = c + s.nodeSize, { tr: g } = n, N = (I = l.link) == null ? void 0 : I.create({ ...d.attrs, href: r });
150
- return N ? (o(
151
- g.removeMark(m, p, d).addMark(m, p, N).setSelection(new J(g.selection.$anchor)).scrollIntoView()
149
+ const m = c, p = c + s.nodeSize, { tr: g } = n, h = (k = l.link) == null ? void 0 : k.create({ ...d.attrs, href: r });
150
+ return h ? (o(
151
+ g.removeMark(m, p, d).addMark(m, p, h).setSelection(new Q(g.selection.$anchor)).scrollIntoView()
152
152
  ), !0) : !1;
153
153
  })
154
154
  ],
@@ -163,45 +163,54 @@ const k = {
163
163
  placeholder: (f = (u = e == null ? void 0 : e.input) == null ? void 0 : u.placeholder) != null ? f : "Input Web Link",
164
164
  buttonText: (d = e == null ? void 0 : e.input) == null ? void 0 : d.buttonText,
165
165
  onUpdate: (m) => {
166
- r.get(Le).call(te, m);
166
+ r.get(Le).call(re, m);
167
167
  },
168
168
  calculatePosition: (m, p) => {
169
- Be(m, p, (g, N, I, b) => {
170
- const C = m.dom.parentElement;
171
- if (!C)
169
+ Be(m, p, (g, h, k, b) => {
170
+ const w = m.dom.parentElement;
171
+ if (!w)
172
172
  throw Pe();
173
- const x = N.left - g.left;
174
- let A = g.left - b.left - (I.width - x) / 2, ge = g.bottom - b.top + 14 + C.scrollTop;
175
- n && (ge = g.top - b.top - I.height - 14 + C.scrollTop), A < 0 && (A = 0);
176
- const he = C.clientWidth - (I.width + 4);
177
- return A > he && (A = he), [ge, A];
173
+ const L = h.left - g.left;
174
+ let D = g.left - b.left - (k.width - L) / 2, _ = g.bottom - b.top + 14 + w.scrollTop;
175
+ n && (_ = g.top - b.top - k.height - 14 + w.scrollTop), D < 0 && (D = 0);
176
+ const he = w.clientWidth - (k.width + 4);
177
+ return D > he && (D = he), [_, D];
178
178
  });
179
179
  }
180
180
  });
181
181
  if (!l)
182
182
  return {};
183
183
  const s = (m) => {
184
- const { selection: p, doc: g } = m.state, { from: N, to: I } = p;
184
+ var b;
185
+ const { selection: p, doc: g } = m.state, { from: h, to: k } = p;
185
186
  if (!m.hasFocus())
186
187
  return !1;
187
- if (p.empty && p instanceof J && I < g.content.size && N < g.content.size && g.rangeHasMark(N, N === I ? I + 1 : I, t))
188
- return n = !1, !0;
188
+ if (p instanceof Q && k < g.content.size && h < g.content.size && g.rangeHasMark(h, h === k ? k + 1 : k, t)) {
189
+ let w = p.empty;
190
+ if (((b = e == null ? void 0 : e.input) == null ? void 0 : b.displayWhenSelected) && !w && g.nodesBetween(h, h === k ? k + 1 : k, (L, D) => {
191
+ if (L.marks.some(
192
+ (_) => _.type === t && h >= D && k <= D + L.nodeSize
193
+ ))
194
+ return w = !0, !1;
195
+ }), w)
196
+ return n = !1, !0;
197
+ }
189
198
  if (p instanceof qe) {
190
- const { node: b } = p;
191
- if (b.type.name === "image" && b.marks.findIndex((C) => C.type.name === _) > -1)
199
+ const { node: w } = p;
200
+ if (w.type.name === "image" && w.marks.findIndex((L) => L.type.name === $) > -1)
192
201
  return n = !0, !0;
193
202
  }
194
203
  return !1;
195
204
  }, c = (m) => {
196
205
  const { selection: p } = m.state;
197
206
  let g;
198
- const { from: N, to: I } = p;
199
- if (m.state.doc.nodesBetween(N, N === I ? I + 1 : I, (x) => {
200
- if (t.isInSet(x.marks))
201
- return g = x, !1;
207
+ const { from: h, to: k } = p;
208
+ if (m.state.doc.nodesBetween(h, h === k ? k + 1 : k, (L) => {
209
+ if (t.isInSet(L.marks))
210
+ return g = L, !1;
202
211
  }), !g)
203
212
  return;
204
- const b = g.marks.find((x) => x.type === t);
213
+ const b = g.marks.find((L) => L.type === t);
205
214
  return b ? b.attrs.href : void 0;
206
215
  }, i = (m) => {
207
216
  if (!m.editable)
@@ -222,8 +231,8 @@ const k = {
222
231
  })
223
232
  ];
224
233
  }
225
- })), j = "strong", re = y("ToggleBold"), Ze = W((a) => ({
226
- id: j,
234
+ })), z = "strong", ne = I("ToggleBold"), Ze = q((a) => ({
235
+ id: z,
227
236
  schema: () => ({
228
237
  inclusive: !1,
229
238
  parseDOM: [
@@ -231,7 +240,7 @@ const k = {
231
240
  { tag: "strong" },
232
241
  { style: "font-style", getAttrs: (e) => e === "bold" }
233
242
  ],
234
- toDOM: (e) => ["strong", { class: a.getClassName(e.attrs, j) }],
243
+ toDOM: (e) => ["strong", { class: a.getClassName(e.attrs, z) }],
235
244
  parseMarkdown: {
236
245
  match: (e) => e.type === "strong",
237
246
  runner: (e, t, r) => {
@@ -239,43 +248,43 @@ const k = {
239
248
  }
240
249
  },
241
250
  toMarkdown: {
242
- match: (e) => e.type.name === j,
251
+ match: (e) => e.type.name === z,
243
252
  runner: (e, t) => {
244
253
  e.withMark(t, "strong");
245
254
  }
246
255
  }
247
256
  }),
248
- commands: (e) => [M(re, () => me(e))],
257
+ commands: (e) => [N(ne, () => pe(e))],
249
258
  shortcuts: {
250
- [k.Bold]: h(re, "Mod-b")
259
+ [y.Bold]: M(ne, "Mod-b")
251
260
  }
252
- })), et = [Ye(), Je(), Ze(), Xe()], $ = "blockquote", ne = y("WrapInBlockquote"), tt = w((a) => ({
253
- id: $,
261
+ })), et = [Ye(), Je(), Ze(), Xe()], P = "blockquote", se = I("WrapInBlockquote"), tt = C((a) => ({
262
+ id: P,
254
263
  schema: () => ({
255
264
  content: "block+",
256
265
  group: "block",
257
266
  defining: !0,
258
267
  parseDOM: [{ tag: "blockquote" }],
259
- toDOM: (e) => ["blockquote", { class: a.getClassName(e.attrs, $) }, 0],
268
+ toDOM: (e) => ["blockquote", { class: a.getClassName(e.attrs, P) }, 0],
260
269
  parseMarkdown: {
261
- match: ({ type: e }) => e === $,
270
+ match: ({ type: e }) => e === P,
262
271
  runner: (e, t, r) => {
263
272
  e.openNode(r).next(t.children).closeNode();
264
273
  }
265
274
  },
266
275
  toMarkdown: {
267
- match: (e) => e.type.name === $,
276
+ match: (e) => e.type.name === P,
268
277
  runner: (e, t) => {
269
278
  e.openNode("blockquote").next(t.content).closeNode();
270
279
  }
271
280
  }
272
281
  }),
273
- inputRules: (e) => [q(/^\s*>\s$/, e)],
274
- commands: (e) => [M(ne, () => pe(e))],
282
+ inputRules: (e) => [K(/^\s*>\s$/, e)],
283
+ commands: (e) => [N(se, () => ge(e))],
275
284
  shortcuts: {
276
- [k.Blockquote]: h(ne, "Mod-Shift-b")
285
+ [y.Blockquote]: M(se, "Mod-Shift-b")
277
286
  }
278
- })), se = y("WrapInBulletList"), rt = w((a) => {
287
+ })), oe = I("WrapInBulletList"), rt = C((a) => {
279
288
  const e = "bullet_list";
280
289
  return {
281
290
  id: e,
@@ -292,7 +301,7 @@ const k = {
292
301
  tag: "ul",
293
302
  getAttrs: (t) => {
294
303
  if (!(t instanceof HTMLElement))
295
- throw L(t);
304
+ throw x(t);
296
305
  return {
297
306
  spread: t.dataset.spread
298
307
  };
@@ -321,10 +330,10 @@ const k = {
321
330
  }
322
331
  }
323
332
  }),
324
- inputRules: (t) => [q(/^\s*([-+*])\s$/, t)],
325
- commands: (t) => [M(se, () => pe(t))],
333
+ inputRules: (t) => [K(/^\s*([-+*])\s$/, t)],
334
+ commands: (t) => [N(oe, () => ge(t))],
326
335
  shortcuts: {
327
- [k.BulletList]: h(se, "Mod-Alt-8")
336
+ [y.BulletList]: M(oe, "Mod-Alt-8")
328
337
  }
329
338
  };
330
339
  }), nt = [
@@ -344,10 +353,10 @@ const k = {
344
353
  "go",
345
354
  "rust",
346
355
  "markdown"
347
- ], st = /^```(?<language>[a-z]*)?[\s\n]$/, ot = /^~~~(?<language>[a-z]*)?[\s\n]$/, oe = y("TurnIntoCodeFence"), z = "fence", at = w((a, e) => {
356
+ ], st = /^```(?<language>[a-z]*)?[\s\n]$/, ot = /^~~~(?<language>[a-z]*)?[\s\n]$/, ae = I("TurnIntoCodeFence"), U = "fence", at = C((a, e) => {
348
357
  const t = (e == null ? void 0 : e.languageList) || nt;
349
358
  return {
350
- id: z,
359
+ id: U,
351
360
  schema: (r) => ({
352
361
  content: "text*",
353
362
  group: "block",
@@ -369,18 +378,18 @@ const k = {
369
378
  getAttrs: (n) => {
370
379
  var o;
371
380
  if (!(n instanceof HTMLElement))
372
- throw L(n);
381
+ throw x(n);
373
382
  return { language: (o = n.querySelector("pre")) == null ? void 0 : o.dataset.language };
374
383
  },
375
384
  getContent: (n, o) => {
376
385
  var c, i;
377
386
  if (!(n instanceof HTMLElement))
378
- throw L(n);
387
+ throw x(n);
379
388
  const l = (i = (c = n.querySelector("pre")) == null ? void 0 : c.textContent) != null ? i : "";
380
389
  if (!l)
381
- return R.empty;
390
+ return W.empty;
382
391
  const s = o.text(l);
383
- return R.from(s);
392
+ return W.from(s);
384
393
  }
385
394
  },
386
395
  {
@@ -388,7 +397,7 @@ const k = {
388
397
  preserveWhitespace: "full",
389
398
  getAttrs: (n) => {
390
399
  if (!(n instanceof HTMLElement))
391
- throw L(n);
400
+ throw x(n);
392
401
  return { language: n.dataset.language };
393
402
  }
394
403
  }
@@ -402,7 +411,7 @@ const k = {
402
411
  const s = l.target;
403
412
  if (!(s instanceof HTMLSelectElement))
404
413
  return;
405
- const c = r.get(S);
414
+ const c = r.get(v);
406
415
  if (!c.editable) {
407
416
  s.value = n.attrs.language;
408
417
  return;
@@ -441,7 +450,7 @@ const k = {
441
450
  }
442
451
  },
443
452
  toMarkdown: {
444
- match: (n) => n.type.name === z,
453
+ match: (n) => n.type.name === U,
445
454
  runner: (n, o) => {
446
455
  var l;
447
456
  n.addNode("code", void 0, ((l = o.content.firstChild) == null ? void 0 : l.text) || "", {
@@ -451,27 +460,27 @@ const k = {
451
460
  }
452
461
  }),
453
462
  inputRules: (r) => [
454
- Q(st, r, (n) => {
463
+ X(st, r, (n) => {
455
464
  const [o, l] = n;
456
465
  if (!!o)
457
466
  return { language: l };
458
467
  }),
459
- Q(ot, r, (n) => {
468
+ X(ot, r, (n) => {
460
469
  const [o, l] = n;
461
470
  if (!!o)
462
471
  return { language: l };
463
472
  })
464
473
  ],
465
- commands: (r) => [M(oe, () => E(r))],
474
+ commands: (r) => [N(ae, () => A(r))],
466
475
  shortcuts: {
467
- [k.CodeFence]: h(oe, "Mod-Alt-c")
476
+ [y.CodeFence]: M(ae, "Mod-Alt-c")
468
477
  },
469
478
  view: () => (r, n, o) => {
470
479
  let l = r;
471
480
  const s = (g) => {
472
- const { tr: N } = n.state;
481
+ const { tr: h } = n.state;
473
482
  n.dispatch(
474
- N.setNodeMarkup(o(), void 0, {
483
+ h.setNodeMarkup(o(), void 0, {
475
484
  fold: !0,
476
485
  language: g
477
486
  })
@@ -493,6 +502,7 @@ const k = {
493
502
  })
494
503
  );
495
504
  }, u = a.themeManager.get("code-fence", {
505
+ view: n,
496
506
  onBlur: c,
497
507
  onFocus: i,
498
508
  onSelectLanguage: s,
@@ -505,12 +515,12 @@ const k = {
505
515
  return m(l), {
506
516
  dom: f,
507
517
  contentDOM: d,
508
- update: (g) => g.type.name !== z ? !1 : (l = g, m(l), !0),
518
+ update: (g) => g.type.name !== U ? !1 : (l = g, m(l), !0),
509
519
  destroy: p
510
520
  };
511
521
  }
512
522
  };
513
- }), lt = w(() => ({
523
+ }), lt = C(() => ({
514
524
  id: "doc",
515
525
  schema: () => ({
516
526
  content: "block+",
@@ -527,7 +537,7 @@ const k = {
527
537
  }
528
538
  }
529
539
  })
530
- })), ae = y("InsertHardbreak"), ct = new H("MILKDOWN_HARDBREAK_FILTER"), it = w((a, e) => {
540
+ })), le = I("InsertHardbreak"), ct = new H("MILKDOWN_HARDBREAK_FILTER"), it = C((a, e) => {
531
541
  var r;
532
542
  const t = (r = e == null ? void 0 : e.notIn) != null ? r : ["table", "fence"];
533
543
  return {
@@ -552,7 +562,7 @@ const k = {
552
562
  }
553
563
  }),
554
564
  commands: (n) => [
555
- M(ae, () => (o, l) => {
565
+ N(le, () => (o, l) => {
556
566
  var i;
557
567
  const { selection: s, tr: c } = o;
558
568
  if (s.empty) {
@@ -566,7 +576,7 @@ const k = {
566
576
  })
567
577
  ],
568
578
  shortcuts: {
569
- [k.HardBreak]: h(ae, "Shift-Enter")
579
+ [y.HardBreak]: M(le, "Shift-Enter")
570
580
  },
571
581
  prosePlugins: (n) => [
572
582
  new T({
@@ -601,15 +611,15 @@ const k = {
601
611
  if (i instanceof Fe) {
602
612
  let d = s.tr;
603
613
  const { from: m, to: p } = i;
604
- return s.doc.nodesBetween(m, p, (g, N) => {
605
- g.type === n && (d = d.setNodeMarkup(N, n, void 0, []));
614
+ return s.doc.nodesBetween(m, p, (g, h) => {
615
+ g.type === n && (d = d.setNodeMarkup(h, n, void 0, []));
606
616
  }), d;
607
617
  }
608
618
  }
609
619
  })
610
620
  ]
611
621
  };
612
- }), Me = Array(6).fill(0).map((a, e) => e + 1), D = y("TurnIntoHeading"), ye = y("DowngradeHeading"), U = new H("MILKDOWN_HEADING_ID"), ut = new H("MILKDOWN_HEADING_HASH"), dt = (a) => a.textContent.replace(/[\p{P}\p{S}]/gu, "").replace(/\s/g, "-").toLowerCase().trim(), ft = (a, e, t) => {
622
+ }), Me = Array(6).fill(0).map((a, e) => e + 1), O = I("TurnIntoHeading"), ye = I("DowngradeHeading"), V = new H("MILKDOWN_HEADING_ID"), ut = new H("MILKDOWN_HEADING_HASH"), dt = (a) => a.textContent.replace(/[\p{P}\p{S}]/gu, "").replace(/\s/g, "-").toLowerCase().trim(), ft = (a, e, t) => {
613
623
  let r = !1;
614
624
  const n = (o, l) => {
615
625
  const s = o.tr.setMeta("addToHistory", !1);
@@ -619,7 +629,7 @@ const k = {
619
629
  if (i.textContent.trim().length === 0)
620
630
  return;
621
631
  const f = i.attrs, d = t(i);
622
- f.id !== d && (c = !0, s.setMeta(U, !0).setNodeMarkup(u, void 0, {
632
+ f.id !== d && (c = !0, s.setMeta(V, !0).setNodeMarkup(u, void 0, {
623
633
  ...f,
624
634
  id: d
625
635
  }));
@@ -627,13 +637,13 @@ const k = {
627
637
  }), c && l(s);
628
638
  };
629
639
  return new T({
630
- key: U,
640
+ key: V,
631
641
  props: {
632
642
  handleDOMEvents: {
633
643
  compositionstart: () => (r = !0, !1),
634
644
  compositionend: () => {
635
645
  r = !1;
636
- const o = a.get(S);
646
+ const o = a.get(v);
637
647
  return setTimeout(() => {
638
648
  n(o.state, (l) => o.dispatch(l));
639
649
  }, 0), !1;
@@ -642,7 +652,7 @@ const k = {
642
652
  },
643
653
  appendTransaction: (o, l, s) => {
644
654
  let c = null;
645
- return o.every((i) => !i.getMeta(U)) && o.some((i) => i.docChanged) && n(s, (i) => {
655
+ return o.every((i) => !i.getMeta(V)) && o.some((i) => i.docChanged) && n(s, (i) => {
646
656
  c = i;
647
657
  }), c;
648
658
  },
@@ -660,19 +670,19 @@ const k = {
660
670
  }, mt = (a, e, t) => new T({
661
671
  key: ut,
662
672
  state: {
663
- init: () => O.empty,
673
+ init: () => S.empty,
664
674
  apply: (r) => {
665
675
  var f;
666
- const n = a.get(S);
676
+ const n = a.get(v);
667
677
  if (!((f = n.hasFocus) != null && f.call(n)) || !n.editable)
668
- return O.empty;
678
+ return S.empty;
669
679
  const { $from: o } = r.selection, l = o.node();
670
680
  if (l.type !== e)
671
- return O.empty;
681
+ return S.empty;
672
682
  const s = l.attrs.level, c = (d) => Array(d).fill(0).map((m) => "#").join(""), i = document.createElement("span");
673
683
  i.textContent = c(s), i.contentEditable = "false", t.themeManager.onFlush(() => {
674
684
  const d = t.getStyle(({ css: m }) => {
675
- const p = Ee(t.themeManager);
685
+ const p = Ae(t.themeManager);
676
686
  return m`
677
687
  margin-right: 4px;
678
688
  color: ${p("primary")};
@@ -680,8 +690,8 @@ const k = {
680
690
  });
681
691
  d && (i.className = d);
682
692
  });
683
- const u = X.widget(o.before() + 1, i, { side: -1 });
684
- return O.create(r.doc, [u]);
693
+ const u = Z.widget(o.before() + 1, i, { side: -1 });
694
+ return S.create(r.doc, [u]);
685
695
  }
686
696
  },
687
697
  props: {
@@ -695,7 +705,7 @@ const k = {
695
705
  return this.getState(r);
696
706
  }
697
707
  }
698
- }), pt = w(
708
+ }), pt = C(
699
709
  (a, e) => {
700
710
  var o, l;
701
711
  const t = "heading", r = (o = e == null ? void 0 : e.getId) != null ? o : dt, n = (l = e == null ? void 0 : e.displayHashtag) != null ? l : !0;
@@ -717,7 +727,7 @@ const k = {
717
727
  tag: `h${s}`,
718
728
  getAttrs: (c) => {
719
729
  if (!(c instanceof HTMLElement))
720
- throw L(c);
730
+ throw x(c);
721
731
  return { level: s, id: c.id };
722
732
  }
723
733
  })),
@@ -744,7 +754,7 @@ const k = {
744
754
  const f = [];
745
755
  c.content.forEach((d, m, p) => {
746
756
  p !== c.childCount - 1 && f.push(d);
747
- }), s.next(R.fromArray(f));
757
+ }), s.next(W.fromArray(f));
748
758
  } else
749
759
  s.next(c.content);
750
760
  s.closeNode();
@@ -752,8 +762,8 @@ const k = {
752
762
  }
753
763
  }),
754
764
  inputRules: (s, c) => Me.map(
755
- (i) => Q(new RegExp(`^(#{1,${i}})\\s$`), s, () => {
756
- const u = c.get(S), { $from: f } = u.state.selection, d = f.node();
765
+ (i) => X(new RegExp(`^(#{1,${i}})\\s$`), s, () => {
766
+ const u = c.get(v), { $from: f } = u.state.selection, d = f.node();
757
767
  if (d.type.name === "heading") {
758
768
  let m = Number(d.attrs.level) + Number(i);
759
769
  return m > 6 && (m = 6), {
@@ -766,8 +776,8 @@ const k = {
766
776
  })
767
777
  ),
768
778
  commands: (s, c) => [
769
- M(D, (i = 1) => i < 1 ? E(i === 0 && c.get(B).nodes.paragraph || s) : E(i === 0 && c.get(B).nodes.paragraph || s, { level: i })),
770
- M(ye, () => (i, u, f) => {
779
+ N(O, (i = 1) => i < 1 ? A(i === 0 && c.get(R).nodes.paragraph || s) : A(i === 0 && c.get(R).nodes.paragraph || s, { level: i })),
780
+ N(ye, () => (i, u, f) => {
771
781
  const { $from: d } = i.selection, m = d.node();
772
782
  if (m.type !== s || !i.selection.empty || d.parentOffset !== 0)
773
783
  return !1;
@@ -777,17 +787,17 @@ const k = {
777
787
  ...m.attrs,
778
788
  level: p
779
789
  })
780
- ), !0) : E(c.get(B).nodes.paragraph || s)(i, u, f);
790
+ ), !0) : A(c.get(R).nodes.paragraph || s)(i, u, f);
781
791
  })
782
792
  ],
783
793
  shortcuts: {
784
- [k.H1]: h(D, "Mod-Alt-1", 1),
785
- [k.H2]: h(D, "Mod-Alt-2", 2),
786
- [k.H3]: h(D, "Mod-Alt-3", 3),
787
- [k.H4]: h(D, "Mod-Alt-4", 4),
788
- [k.H5]: h(D, "Mod-Alt-5", 5),
789
- [k.H6]: h(D, "Mod-Alt-6", 6),
790
- [k.DowngradeHeading]: h(ye, ["Backspace", "Delete"])
794
+ [y.H1]: M(O, "Mod-Alt-1", 1),
795
+ [y.H2]: M(O, "Mod-Alt-2", 2),
796
+ [y.H3]: M(O, "Mod-Alt-3", 3),
797
+ [y.H4]: M(O, "Mod-Alt-4", 4),
798
+ [y.H5]: M(O, "Mod-Alt-5", 5),
799
+ [y.H6]: M(O, "Mod-Alt-6", 6),
800
+ [y.DowngradeHeading]: M(ye, ["Backspace", "Delete"])
791
801
  },
792
802
  prosePlugins: (s, c) => {
793
803
  const i = [ft(c, s, r)];
@@ -795,12 +805,12 @@ const k = {
795
805
  }
796
806
  };
797
807
  }
798
- ), V = "hr", He = y("InsertHr"), gt = w((a) => ({
799
- id: V,
808
+ ), G = "hr", He = I("InsertHr"), gt = C((a) => ({
809
+ id: G,
800
810
  schema: () => ({
801
811
  group: "block",
802
812
  parseDOM: [{ tag: "hr" }],
803
- toDOM: (e) => ["hr", { class: a.getClassName(e.attrs, V) }],
813
+ toDOM: (e) => ["hr", { class: a.getClassName(e.attrs, G) }],
804
814
  parseMarkdown: {
805
815
  match: ({ type: e }) => e === "thematicBreak",
806
816
  runner: (e, t, r) => {
@@ -808,7 +818,7 @@ const k = {
808
818
  }
809
819
  },
810
820
  toMarkdown: {
811
- match: (e) => e.type.name === V,
821
+ match: (e) => e.type.name === G,
812
822
  runner: (e) => {
813
823
  e.addNode("thematicBreak");
814
824
  }
@@ -821,17 +831,17 @@ const k = {
821
831
  })
822
832
  ],
823
833
  commands: (e, t) => [
824
- M(He, () => (r, n) => {
834
+ N(He, () => (r, n) => {
825
835
  if (!n)
826
836
  return !0;
827
- const o = t.get(B).node("paragraph"), { tr: l, selection: s } = r, { from: c } = s, i = e.create();
837
+ const o = t.get(R).node("paragraph"), { tr: l, selection: s } = r, { from: c } = s, i = e.create();
828
838
  if (!i)
829
839
  return !0;
830
840
  const u = l.replaceSelectionWith(i).insert(c, o), f = Ce.findFrom(u.doc.resolve(c), 1, !0);
831
841
  return f && n(u.setSelection(f).scrollIntoView()), !0;
832
842
  })
833
843
  ]
834
- })), le = y("ModifyImage"), De = y("InsertImage"), P = "image", ht = new H("MILKDOWN_IMAGE_INPUT"), kt = w((a, e) => ({
844
+ })), ce = I("ModifyImage"), De = I("InsertImage"), B = "image", ht = new H("MILKDOWN_IMAGE_INPUT"), kt = C((a, e) => ({
835
845
  id: "image",
836
846
  schema: () => ({
837
847
  inline: !0,
@@ -852,7 +862,7 @@ const k = {
852
862
  tag: "img[src]",
853
863
  getAttrs: (t) => {
854
864
  if (!(t instanceof HTMLElement))
855
- throw L(t);
865
+ throw x(t);
856
866
  return {
857
867
  src: t.getAttribute("src") || "",
858
868
  alt: t.getAttribute("alt") || "",
@@ -865,11 +875,11 @@ const k = {
865
875
  "img",
866
876
  {
867
877
  ...t.attrs,
868
- class: a.getClassName(t.attrs, P)
878
+ class: a.getClassName(t.attrs, B)
869
879
  }
870
880
  ],
871
881
  parseMarkdown: {
872
- match: ({ type: t }) => t === P,
882
+ match: ({ type: t }) => t === B,
873
883
  runner: (t, r, n) => {
874
884
  const o = r.url, l = r.alt, s = r.title;
875
885
  t.addNode(n, {
@@ -880,7 +890,7 @@ const k = {
880
890
  }
881
891
  },
882
892
  toMarkdown: {
883
- match: (t) => t.type.name === P,
893
+ match: (t) => t.type.name === B,
884
894
  runner: (t, r) => {
885
895
  t.addNode("image", void 0, void 0, {
886
896
  title: r.attrs.title,
@@ -891,7 +901,7 @@ const k = {
891
901
  }
892
902
  }),
893
903
  commands: (t) => [
894
- M(De, (r = "") => (n, o) => {
904
+ N(De, (r = "") => (n, o) => {
895
905
  if (!o)
896
906
  return !0;
897
907
  const { tr: l } = n, s = t.create({ src: r });
@@ -900,8 +910,8 @@ const k = {
900
910
  const c = l.replaceSelectionWith(s);
901
911
  return o(c.scrollIntoView()), !0;
902
912
  }),
903
- M(le, (r = "") => (n, o) => {
904
- const l = K(n.selection, t);
913
+ N(ce, (r = "") => (n, o) => {
914
+ const l = F(n.selection, t);
905
915
  if (!l)
906
916
  return !1;
907
917
  const { tr: s } = n;
@@ -931,7 +941,7 @@ const k = {
931
941
  const { dom: s, onUpdate: c } = l;
932
942
  return c(r), {
933
943
  dom: s,
934
- update: (f) => f.type.name !== P ? !1 : (r = f, c(r), !0),
944
+ update: (f) => f.type.name !== B ? !1 : (r = f, c(r), !0),
935
945
  selectNode: () => {
936
946
  s.classList.add("ProseMirror-selectednode");
937
947
  },
@@ -949,15 +959,15 @@ const k = {
949
959
  placeholder: (u = (i = e == null ? void 0 : e.input) == null ? void 0 : i.placeholder) != null ? u : "Input Image Link",
950
960
  buttonText: (f = e == null ? void 0 : e.input) == null ? void 0 : f.buttonText,
951
961
  onUpdate: (d) => {
952
- r.get(Le).call(le, d);
962
+ r.get(Le).call(ce, d);
953
963
  }
954
964
  });
955
965
  if (!o)
956
966
  return {};
957
967
  const l = (d) => Boolean(
958
- d.hasFocus() && t && K(d.state.selection, t)
968
+ d.hasFocus() && t && F(d.state.selection, t)
959
969
  ), s = (d) => {
960
- const m = K(d.state.selection, t);
970
+ const m = F(d.state.selection, t);
961
971
  return m ? m.node.attrs.src : void 0;
962
972
  }, c = (d) => {
963
973
  if (!d.editable)
@@ -975,7 +985,7 @@ const k = {
975
985
  }
976
986
  })
977
987
  ]
978
- })), Ne = "list_item", ce = y("SplitListItem"), ie = y("SinkListItem"), ue = y("LiftListItem"), Mt = new H("MILKDOWN_KEEP_LIST_ORDER"), yt = (a) => {
988
+ })), Ne = "list_item", ie = I("SplitListItem"), ue = I("SinkListItem"), de = I("LiftListItem"), Mt = new H("MILKDOWN_KEEP_LIST_ORDER"), yt = (a) => {
979
989
  const e = (t, r) => {
980
990
  const n = We("ordered_list", t.schema);
981
991
  let o = t.tr;
@@ -998,7 +1008,7 @@ const k = {
998
1008
  }), o;
999
1009
  }
1000
1010
  });
1001
- }, Nt = w((a) => ({
1011
+ }, Nt = C((a) => ({
1002
1012
  id: Ne,
1003
1013
  schema: () => ({
1004
1014
  group: "listItem",
@@ -1020,7 +1030,7 @@ const k = {
1020
1030
  tag: "li.list-item",
1021
1031
  getAttrs: (e) => {
1022
1032
  if (!(e instanceof HTMLElement))
1023
- throw L(e);
1033
+ throw x(e);
1024
1034
  return {
1025
1035
  label: e.dataset.label,
1026
1036
  listType: e.dataset["list-type"],
@@ -1029,7 +1039,7 @@ const k = {
1029
1039
  },
1030
1040
  contentElement: (e) => {
1031
1041
  if (!(e instanceof HTMLElement))
1032
- throw L(e);
1042
+ throw x(e);
1033
1043
  const t = e.querySelector(".list-item_body");
1034
1044
  return t || e;
1035
1045
  }
@@ -1061,19 +1071,19 @@ const k = {
1061
1071
  }
1062
1072
  }
1063
1073
  }),
1064
- inputRules: (e) => [q(/^\s*([-+*])\s$/, e)],
1074
+ inputRules: (e) => [K(/^\s*([-+*])\s$/, e)],
1065
1075
  commands: (e) => [
1066
- M(ce, () => je(e)),
1067
- M(ie, () => ze(e)),
1068
- M(ue, () => Ue(e))
1076
+ N(ie, () => je(e)),
1077
+ N(ue, () => ze(e)),
1078
+ N(de, () => Ue(e))
1069
1079
  ],
1070
1080
  shortcuts: {
1071
- [k.NextListItem]: h(ce, "Enter"),
1072
- [k.SinkListItem]: h(ie, "Mod-]"),
1073
- [k.LiftListItem]: h(ue, "Mod-[")
1081
+ [y.NextListItem]: M(ie, "Enter"),
1082
+ [y.SinkListItem]: M(ue, "Mod-]"),
1083
+ [y.LiftListItem]: M(de, "Mod-[")
1074
1084
  },
1075
1085
  prosePlugins: (e) => [yt(e)]
1076
- })), de = y("WrapInOrderedList"), Ie = "ordered_list", It = w((a) => ({
1086
+ })), fe = I("WrapInOrderedList"), Ie = "ordered_list", It = C((a) => ({
1077
1087
  id: Ie,
1078
1088
  schema: () => ({
1079
1089
  content: "listItem+",
@@ -1091,7 +1101,7 @@ const k = {
1091
1101
  tag: "ol",
1092
1102
  getAttrs: (e) => {
1093
1103
  if (!(e instanceof HTMLElement))
1094
- throw L(e);
1104
+ throw x(e);
1095
1105
  return {
1096
1106
  spread: e.dataset.spread,
1097
1107
  order: e.hasAttribute("start") ? Number(e.getAttribute("start")) : 1
@@ -1123,18 +1133,18 @@ const k = {
1123
1133
  }
1124
1134
  }),
1125
1135
  inputRules: (e) => [
1126
- q(
1136
+ K(
1127
1137
  /^(\d+)\.\s$/,
1128
1138
  e,
1129
1139
  (t) => ({ order: Number(t[1]) }),
1130
1140
  (t, r) => r.childCount + r.attrs.order === Number(t[1])
1131
1141
  )
1132
1142
  ],
1133
- commands: (e) => [M(de, () => pe(e))],
1143
+ commands: (e) => [N(fe, () => ge(e))],
1134
1144
  shortcuts: {
1135
- [k.OrderedList]: h(de, "Mod-Alt-7")
1145
+ [y.OrderedList]: M(fe, "Mod-Alt-7")
1136
1146
  }
1137
- })), fe = y("TurnIntoText"), be = "paragraph", bt = w((a) => ({
1147
+ })), me = I("TurnIntoText"), be = "paragraph", bt = C((a) => ({
1138
1148
  id: be,
1139
1149
  schema: () => ({
1140
1150
  content: "inline*",
@@ -1155,18 +1165,18 @@ const k = {
1155
1165
  const o = [];
1156
1166
  t.content.forEach((l, s, c) => {
1157
1167
  c !== t.childCount - 1 && o.push(l);
1158
- }), e.next(R.fromArray(o));
1168
+ }), e.next(W.fromArray(o));
1159
1169
  } else
1160
1170
  e.next(t.content);
1161
1171
  e.closeNode();
1162
1172
  }
1163
1173
  }
1164
1174
  }),
1165
- commands: (e) => [M(fe, () => E(e))],
1175
+ commands: (e) => [N(me, () => A(e))],
1166
1176
  shortcuts: {
1167
- [k.Text]: h(fe, "Mod-Alt-0")
1177
+ [y.Text]: M(me, "Mod-Alt-0")
1168
1178
  }
1169
- })), wt = w(() => ({
1179
+ })), wt = C(() => ({
1170
1180
  id: "text",
1171
1181
  schema: () => ({
1172
1182
  group: "inline",
@@ -1205,7 +1215,6 @@ const k = {
1205
1215
  t.children.forEach((o, l) => {
1206
1216
  o.label = l + n;
1207
1217
  });
1208
- return;
1209
1218
  }
1210
1219
  });
1211
1220
  }
@@ -1271,29 +1280,29 @@ const Dt = () => {
1271
1280
  },
1272
1281
  decorations(t) {
1273
1282
  if (e.getState(t)) {
1274
- const o = t.selection.$from.pos, l = document.createElement("span"), s = X.widget(o, l, {
1283
+ const o = t.selection.$from.pos, l = document.createElement("span"), s = Z.widget(o, l, {
1275
1284
  side: -1
1276
- }), c = document.createElement("span"), i = X.widget(o, c);
1285
+ }), c = document.createElement("span"), i = Z.widget(o, c);
1277
1286
  return setTimeout(() => {
1278
1287
  l.contentEditable = "true", c.contentEditable = "true";
1279
- }), O.create(t.doc, [s, i]);
1288
+ }), S.create(t.doc, [s, i]);
1280
1289
  }
1281
- return O.empty;
1290
+ return S.empty;
1282
1291
  }
1283
1292
  }
1284
1293
  });
1285
1294
  return e;
1286
- }, G = /\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/, At = (a) => new RegExp(`\\\\(?=[^\\w\\s${a}\\\\]|_)`, "g"), Et = (a) => {
1287
- let e = a, t = e.match(G);
1295
+ }, Y = /\[(?<span>((www|https:\/\/|http:\/\/)[^\s\]]+))]\((?<url>[^\s\]]+)\)/, vt = (a) => new RegExp(`\\\\(?=[^\\w\\s${a}\\\\]|_)`, "g"), At = (a) => {
1296
+ let e = a, t = e.match(Y);
1288
1297
  for (; t && t.groups; ) {
1289
1298
  const { span: r } = t.groups;
1290
- e = e.replace(G, r), t = e.match(G);
1299
+ e = e.replace(Y, r), t = e.match(Y);
1291
1300
  }
1292
1301
  return e;
1293
- }, vt = (a, e, t) => {
1302
+ }, Et = (a, e, t) => {
1294
1303
  const r = a.split(""), n = r[e];
1295
1304
  return r[e] && r[t] && (r[e] = r[t], r[t] = n), r.join("").toString();
1296
- }, _t = (a) => (e) => e.replace(At(a), ""), $t = (a) => (e) => {
1305
+ }, _t = (a) => (e) => e.replace(vt(a), ""), $t = (a) => (e) => {
1297
1306
  const t = e.indexOf(a.hole), r = e.charAt(t - 1), n = e.charAt(t + 1), o = /[^\w]|_/;
1298
1307
  return n ? r && o.test(r) && o.test(n) ? a.punctuation : a.char : a.punctuation;
1299
1308
  }, Pt = (a, e, t) => {
@@ -1321,20 +1330,20 @@ const Dt = () => {
1321
1330
  const t = ["*", "_"];
1322
1331
  let r = e.indexOf(a);
1323
1332
  for (; t.includes(e[r - 1] || "") && t.includes(e[r + 1] || ""); )
1324
- e = vt(e, r, r + 1), r = r + 1;
1333
+ e = Et(e, r, r + 1), r = r + 1;
1325
1334
  return e;
1326
1335
  }
1327
- }, v = ve(Bt, "inlineSyncConfig"), Rt = (a) => {
1336
+ }, E = Ee(Bt, "inlineSyncConfig"), Rt = (a) => {
1328
1337
  const { selection: e } = a, { $from: t } = e;
1329
1338
  return t.node();
1330
1339
  }, Wt = (a, e, t, r) => {
1331
1340
  const n = a.get(_e), o = e.schema.topNodeType.create(void 0, [t, ...r]);
1332
1341
  return n(o);
1333
1342
  }, qt = (a, e) => {
1334
- const t = a.get(v), r = t.placeholderConfig.hole, [n = "", ...o] = e.split(`
1343
+ const t = a.get(E), r = t.placeholderConfig.hole, [n = "", ...o] = e.split(`
1335
1344
 
1336
1345
  `), l = (u) => t.movePlaceholder(r, u);
1337
- let c = Se(_t(r), l, Et)(n);
1346
+ let c = Se(_t(r), l, At)(n);
1338
1347
  const i = $t(t.placeholderConfig)(c);
1339
1348
  return c = c.replace(r, i), c = [c, ...o].join(`
1340
1349
 
@@ -1343,7 +1352,7 @@ const Dt = () => {
1343
1352
  const r = a.get($e)(e);
1344
1353
  return r ? r.firstChild : null;
1345
1354
  }, Ft = (a, e) => {
1346
- const { globalNodes: t } = a.get(v), r = [];
1355
+ const { globalNodes: t } = a.get(E), r = [];
1347
1356
  return e.doc.descendants((n) => {
1348
1357
  if (t.includes(n.type.name) || t.includes(n.type))
1349
1358
  return r.push(n), !1;
@@ -1367,85 +1376,85 @@ const Dt = () => {
1367
1376
  return null;
1368
1377
  }
1369
1378
  }, zt = (a, e, t, r, n) => {
1370
- const { placeholderConfig: o } = a.get(v), l = o.hole;
1379
+ const { placeholderConfig: o } = a.get(E), l = o.hole;
1371
1380
  let s = t.tr.setMeta(e, !0).insertText(l, t.selection.from);
1372
1381
  const c = t.apply(s), i = Oe(a, c);
1373
1382
  if (!i)
1374
1383
  return;
1375
1384
  const { $from: u } = c.selection, f = u.before(), d = u.after(), m = Pt(i.nextNode, f, i.placeholder);
1376
- s = s.replaceWith(f, d, i.nextNode).setNodeMarkup(f, void 0, n).delete(m + 1, m + 2), s = s.setSelection(J.near(s.doc.resolve(m + 1))), r(s);
1377
- }, Y = new H("MILKDOWN_INLINE_SYNC"), Ut = (a) => {
1385
+ s = s.replaceWith(f, d, i.nextNode).setNodeMarkup(f, void 0, n).delete(m + 1, m + 2), s = s.setSelection(Q.near(s.doc.resolve(m + 1))), r(s);
1386
+ }, J = new H("MILKDOWN_INLINE_SYNC"), Ut = (a) => {
1378
1387
  let e = null;
1379
1388
  return new T({
1380
- key: Y,
1389
+ key: J,
1381
1390
  state: {
1382
1391
  init: () => null,
1383
1392
  apply: (r, n, o, l) => {
1384
1393
  var p;
1385
- const s = a.get(S);
1386
- if (!((p = s.hasFocus) != null && p.call(s)) || !s.editable || !r.docChanged || r.getMeta(Y))
1394
+ const s = a.get(v);
1395
+ if (!((p = s.hasFocus) != null && p.call(s)) || !s.editable || !r.docChanged || r.getMeta(J))
1387
1396
  return null;
1388
1397
  const i = Oe(a, l);
1389
1398
  if (!i)
1390
1399
  return null;
1391
1400
  e && (cancelAnimationFrame(e), e = null);
1392
- const { prevNode: u, nextNode: f, text: d } = i, { shouldSyncNode: m } = a.get(v);
1401
+ const { prevNode: u, nextNode: f, text: d } = i, { shouldSyncNode: m } = a.get(E);
1393
1402
  return m({ prevNode: u, nextNode: f, ctx: a, tr: r, text: d }) && (e = requestAnimationFrame(() => {
1394
1403
  e = null;
1395
- const { dispatch: g, state: N } = a.get(S);
1396
- zt(a, Y, N, g, u.attrs);
1404
+ const { dispatch: g, state: h } = a.get(v);
1405
+ zt(a, J, h, g, u.attrs);
1397
1406
  })), null;
1398
1407
  }
1399
1408
  }
1400
1409
  });
1401
1410
  }, Vt = [
1402
- Ae(() => ({
1403
- injectSlices: [v],
1411
+ ve(() => ({
1412
+ injectSlices: [E],
1404
1413
  prosePlugins: (a, e) => [St(), Ut(e)],
1405
1414
  remarkPlugins: () => [Ve, Dt, Ct]
1406
1415
  }))()
1407
1416
  ], Gt = we.create([...Lt, ...et]), cr = we.create([...Vt, ...Gt]), ir = {
1408
- ToggleInlineCode: Z,
1409
- ToggleItalic: ee,
1417
+ ToggleInlineCode: ee,
1418
+ ToggleItalic: te,
1410
1419
  ToggleLink: Te,
1411
- ToggleBold: re,
1412
- ModifyLink: te,
1413
- ModifyImage: le,
1414
- WrapInBlockquote: ne,
1415
- WrapInBulletList: se,
1416
- WrapInOrderedList: de,
1417
- TurnIntoCodeFence: oe,
1418
- TurnIntoHeading: D,
1419
- TurnIntoText: fe,
1420
- InsertHardbreak: ae,
1420
+ ToggleBold: ne,
1421
+ ModifyLink: re,
1422
+ ModifyImage: ce,
1423
+ WrapInBlockquote: se,
1424
+ WrapInBulletList: oe,
1425
+ WrapInOrderedList: fe,
1426
+ TurnIntoCodeFence: ae,
1427
+ TurnIntoHeading: O,
1428
+ TurnIntoText: me,
1429
+ InsertHardbreak: le,
1421
1430
  InsertHr: He,
1422
1431
  InsertImage: De,
1423
- SplitListItem: ce,
1424
- SinkListItem: ie,
1425
- LiftListItem: ue
1432
+ SplitListItem: ie,
1433
+ SinkListItem: ue,
1434
+ LiftListItem: de
1426
1435
  };
1427
1436
  export {
1428
1437
  ye as DowngradeHeading,
1429
1438
  ct as HardbreakFilterPluginKey,
1430
- ae as InsertHardbreak,
1439
+ le as InsertHardbreak,
1431
1440
  He as InsertHr,
1432
1441
  De as InsertImage,
1433
- ue as LiftListItem,
1434
- le as ModifyImage,
1435
- te as ModifyLink,
1436
- ie as SinkListItem,
1437
- ce as SplitListItem,
1438
- k as SupportedKeys,
1439
- re as ToggleBold,
1440
- Z as ToggleInlineCode,
1441
- ee as ToggleItalic,
1442
+ de as LiftListItem,
1443
+ ce as ModifyImage,
1444
+ re as ModifyLink,
1445
+ ue as SinkListItem,
1446
+ ie as SplitListItem,
1447
+ y as SupportedKeys,
1448
+ ne as ToggleBold,
1449
+ ee as ToggleInlineCode,
1450
+ te as ToggleItalic,
1442
1451
  Te as ToggleLink,
1443
- oe as TurnIntoCodeFence,
1444
- D as TurnIntoHeading,
1445
- fe as TurnIntoText,
1446
- ne as WrapInBlockquote,
1447
- se as WrapInBulletList,
1448
- de as WrapInOrderedList,
1452
+ ae as TurnIntoCodeFence,
1453
+ O as TurnIntoHeading,
1454
+ me as TurnIntoText,
1455
+ se as WrapInBlockquote,
1456
+ oe as WrapInBulletList,
1457
+ fe as WrapInOrderedList,
1449
1458
  st as backtickInputRegex,
1450
1459
  tt as blockquote,
1451
1460
  rt as bulletList,
@@ -1460,10 +1469,10 @@ export {
1460
1469
  it as hardbreak,
1461
1470
  pt as heading,
1462
1471
  ut as headingHashPluginKey,
1463
- U as headingIdPluginKey,
1472
+ V as headingIdPluginKey,
1464
1473
  gt as hr,
1465
1474
  kt as image,
1466
- v as inlineSyncConfigCtx,
1475
+ E as inlineSyncConfigCtx,
1467
1476
  Xe as link,
1468
1477
  Nt as listItem,
1469
1478
  et as marks,