@blocknote/core 0.44.2 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/BlockNoteExtension-BWw0r8Gy.cjs.map +1 -1
  2. package/dist/BlockNoteExtension-C2X7LW-V.js.map +1 -1
  3. package/dist/{BlockNoteSchema-BsTi0fNS.js → BlockNoteSchema-BOW16JHv.js} +2 -2
  4. package/dist/{BlockNoteSchema-BsTi0fNS.js.map → BlockNoteSchema-BOW16JHv.js.map} +1 -1
  5. package/dist/{BlockNoteSchema-CBNkNhkw.cjs → BlockNoteSchema-CzZbr4Ed.cjs} +2 -2
  6. package/dist/{BlockNoteSchema-CBNkNhkw.cjs.map → BlockNoteSchema-CzZbr4Ed.cjs.map} +1 -1
  7. package/dist/{TrailingNode-CG2a-HDA.js → TrailingNode-8cXFaQUm.js} +484 -487
  8. package/dist/TrailingNode-8cXFaQUm.js.map +1 -0
  9. package/dist/TrailingNode-DPu6X9ym.cjs +2 -0
  10. package/dist/TrailingNode-DPu6X9ym.cjs.map +1 -0
  11. package/dist/{blockToNode-DBNbhwwC.js → blockToNode-BNoNIXU7.js} +2 -2
  12. package/dist/{blockToNode-DBNbhwwC.js.map → blockToNode-BNoNIXU7.js.map} +1 -1
  13. package/dist/{blockToNode-w7H99R6p.cjs → blockToNode-CumVjgem.cjs} +2 -2
  14. package/dist/{blockToNode-w7H99R6p.cjs.map → blockToNode-CumVjgem.cjs.map} +1 -1
  15. package/dist/blocknote.cjs +4 -4
  16. package/dist/blocknote.cjs.map +1 -1
  17. package/dist/blocknote.js +1118 -1077
  18. package/dist/blocknote.js.map +1 -1
  19. package/dist/blocks.cjs +1 -1
  20. package/dist/blocks.js +2 -2
  21. package/dist/defaultBlocks-D1cc0lV9.cjs +6 -0
  22. package/dist/defaultBlocks-D1cc0lV9.cjs.map +1 -0
  23. package/dist/{defaultBlocks-B63ufZ5N.js → defaultBlocks-DvCGYzqu.js} +168 -206
  24. package/dist/defaultBlocks-DvCGYzqu.js.map +1 -0
  25. package/dist/extensions.cjs +1 -1
  26. package/dist/extensions.js +3 -3
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/dist/webpack-stats.json +1 -1
  29. package/dist/yjs.cjs +1 -1
  30. package/dist/yjs.js +1 -1
  31. package/package.json +15 -15
  32. package/src/api/blockManipulation/selections/selection.ts +9 -4
  33. package/src/api/blockManipulation/tables/tables.test.ts +140 -0
  34. package/src/api/blockManipulation/tables/tables.ts +1 -1
  35. package/src/api/parsers/markdown/parseMarkdown.ts +11 -0
  36. package/src/blocks/ListItem/CheckListItem/block.ts +2 -2
  37. package/src/blocks/ListItem/NumberedListItem/block.ts +5 -1
  38. package/src/editor/BlockNoteEditor.test.ts +0 -1
  39. package/src/editor/BlockNoteEditor.ts +9 -39
  40. package/src/editor/BlockNoteExtension.ts +5 -0
  41. package/src/editor/managers/EventManager.ts +1 -1
  42. package/src/editor/managers/ExtensionManager/extensions.ts +2 -12
  43. package/src/editor/managers/ExtensionManager/index.ts +7 -2
  44. package/src/editor/managers/SelectionManager.ts +10 -10
  45. package/src/extensions/BlockChange/BlockChange.ts +2 -2
  46. package/src/extensions/Collaboration/Collaboration.ts +55 -0
  47. package/src/extensions/Collaboration/ForkYDoc.ts +4 -9
  48. package/src/extensions/Collaboration/YCursorPlugin.ts +56 -60
  49. package/src/extensions/Collaboration/YSync.ts +2 -2
  50. package/src/extensions/Collaboration/YUndo.ts +2 -2
  51. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +40 -68
  52. package/src/extensions/TableHandles/TableHandles.ts +9 -5
  53. package/src/index.ts +2 -1
  54. package/src/schema/blocks/createSpec.ts +3 -0
  55. package/src/util/expandToWords.ts +38 -0
  56. package/types/src/api/blockManipulation/selections/selection.d.ts +1 -1
  57. package/types/src/editor/BlockNoteEditor.d.ts +5 -34
  58. package/types/src/editor/BlockNoteExtension.d.ts +4 -0
  59. package/types/src/editor/managers/SelectionManager.d.ts +4 -4
  60. package/types/src/extensions/Collaboration/Collaboration.d.ts +76 -0
  61. package/types/src/extensions/Collaboration/ForkYDoc.d.ts +2 -11
  62. package/types/src/extensions/Collaboration/YCursorPlugin.d.ts +3 -11
  63. package/types/src/extensions/Collaboration/YSync.d.ts +2 -4
  64. package/types/src/extensions/Collaboration/YUndo.d.ts +1 -1
  65. package/types/src/index.d.ts +2 -1
  66. package/types/src/util/expandToWords.d.ts +13 -0
  67. package/dist/TrailingNode-CG2a-HDA.js.map +0 -1
  68. package/dist/TrailingNode-Du4SNHun.cjs +0 -2
  69. package/dist/TrailingNode-Du4SNHun.cjs.map +0 -1
  70. package/dist/defaultBlocks-B63ufZ5N.js.map +0 -1
  71. package/dist/defaultBlocks-BX6UxQa8.cjs +0 -6
  72. package/dist/defaultBlocks-BX6UxQa8.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  var Oe = Object.defineProperty;
2
2
  var _e = (e, t, n) => t in e ? Oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var L = (e, t, n) => _e(e, typeof t != "symbol" ? t + "" : t, n);
3
+ var M = (e, t, n) => _e(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { TableMap as be, goToNextCell as ne, columnResizing as Ve, tableEditing as Re, CellSelection as Ce, TableView as We } from "prosemirror-tables";
5
5
  import { Node as N, Mark as Fe, Extension as $e, callOrReturn as Ue, getExtensionField as qe, mergeAttributes as z, findParentNode as je } from "@tiptap/core";
6
6
  import { TextSelection as ke, Plugin as Ge, PluginKey as Ze } from "prosemirror-state";
@@ -8,7 +8,7 @@ import { DecorationSet as oe, Decoration as re } from "prosemirror-view";
8
8
  import { ReplaceStep as ze, Mapping as Xe } from "prosemirror-transform";
9
9
  import { ySyncPluginKey as ae, absolutePositionToRelativePosition as Ke, relativePositionToAbsolutePosition as Qe } from "y-prosemirror";
10
10
  import { c as k, a as ye } from "./BlockNoteExtension-C2X7LW-V.js";
11
- import { b as X, v as Je, g as O, a as ve, i as se, t as Ye, U as et, q as tt, A as G, r as nt, w as Ee, J as ot } from "./blockToNode-DBNbhwwC.js";
11
+ import { b as X, v as Je, g as O, a as ve, i as se, t as Ye, U as et, q as tt, A as G, r as nt, w as Ee, J as ot } from "./blockToNode-BNoNIXU7.js";
12
12
  import rt from "@tiptap/extension-bold";
13
13
  import at from "@tiptap/extension-code";
14
14
  import st from "@tiptap/extension-italic";
@@ -19,10 +19,10 @@ import { createHighlightPlugin as dt } from "prosemirror-highlight";
19
19
  import { createParser as ut } from "prosemirror-highlight/shiki";
20
20
  import { Slice as we, Fragment as F, DOMParser as Se } from "prosemirror-model";
21
21
  import { Plugin as pt, PluginKey as ft } from "@tiptap/pm/state";
22
- import { DecorationSet as ce, Decoration as gt } from "@tiptap/pm/view";
23
- const ht = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
24
- function M(e, t = "Ctrl") {
25
- return ht() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
22
+ import { DecorationSet as ce, Decoration as ht } from "@tiptap/pm/view";
23
+ const mt = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
24
+ function L(e, t = "Ctrl") {
25
+ return mt() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
26
26
  }
27
27
  function D(...e) {
28
28
  return [
@@ -33,7 +33,7 @@ function D(...e) {
33
33
  ].join(" ");
34
34
  }
35
35
  const uo = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
36
- function mt(e, t, n, o) {
36
+ function gt(e, t, n, o) {
37
37
  const r = document.createElement("div");
38
38
  r.className = D(
39
39
  "bn-block-content",
@@ -204,6 +204,8 @@ function Et(e, t) {
204
204
  const r = (a = t.parse) == null ? void 0 : a.call(t, o);
205
205
  return r === void 0 ? !1 : r;
206
206
  },
207
+ // Because we do the parsing ourselves, we want to preserve whitespace for content we've parsed
208
+ preserveWhitespace: !0,
207
209
  getContent: e.content === "inline" || e.content === "none" ? (o, r) => {
208
210
  var a;
209
211
  if (t.parseContent)
@@ -218,14 +220,15 @@ function Et(e, t) {
218
220
  (a = t.meta) != null && a.code ? `
219
221
  ` : "<br>"
220
222
  ), xe.fromSchema(r).parse(i, {
221
- topNode: r.nodes.paragraph.create()
223
+ topNode: r.nodes.paragraph.create(),
224
+ preserveWhitespace: !0
222
225
  }).content;
223
226
  }
224
227
  return lt.empty;
225
228
  } : void 0
226
229
  }), n;
227
230
  }
228
- function go(e, t, n, o) {
231
+ function ho(e, t, n, o) {
229
232
  var a, s, i, c;
230
233
  const r = t.node || N.create({
231
234
  name: e.type,
@@ -265,12 +268,12 @@ function go(e, t, n, o) {
265
268
  u,
266
269
  this.editor,
267
270
  e.type
268
- ), p = ((f = this.options.domAttributes) == null ? void 0 : f.blockContent) || {}, h = t.render.call(
271
+ ), p = ((f = this.options.domAttributes) == null ? void 0 : f.blockContent) || {}, m = t.render.call(
269
272
  { blockContentDOMAttributes: p, props: l, renderType: "nodeView" },
270
273
  d,
271
274
  u
272
275
  );
273
- return ((E = t.meta) == null ? void 0 : E.selectable) === !1 && vt(h, this.editor), h;
276
+ return ((E = t.meta) == null ? void 0 : E.selectable) === !1 && vt(m, this.editor), m;
274
277
  };
275
278
  }
276
279
  });
@@ -299,9 +302,9 @@ function go(e, t, n, o) {
299
302
  // TODO: this should not have wrapInBlockStructure and generally be a lot simpler
300
303
  // post-processing in externalHTMLExporter should not be necessary
301
304
  toExternalHTML: (l, u) => {
302
- var p, h;
305
+ var p, m;
303
306
  const d = ((p = r.options.domAttributes) == null ? void 0 : p.blockContent) || {};
304
- return ((h = t.toExternalHTML) == null ? void 0 : h.call(
307
+ return ((m = t.toExternalHTML) == null ? void 0 : m.call(
305
308
  { blockContentDOMAttributes: d },
306
309
  l,
307
310
  u
@@ -315,7 +318,7 @@ function go(e, t, n, o) {
315
318
  extensions: n
316
319
  };
317
320
  }
318
- function ho(e) {
321
+ function mo(e) {
319
322
  return e;
320
323
  }
321
324
  function v(e, t, n) {
@@ -368,7 +371,7 @@ function v(e, t, n) {
368
371
  };
369
372
  };
370
373
  }
371
- function mo(e, t, n, o) {
374
+ function go(e, t, n, o) {
372
375
  return e.dom.setAttribute("data-inline-content-type", t), Object.entries(n).filter(([r, a]) => {
373
376
  const s = o[r];
374
377
  return a !== s.default;
@@ -641,14 +644,14 @@ function At(e, t, n, o, r, a, s) {
641
644
  ...r.blockContent.node.attrs,
642
645
  ...e.props
643
646
  });
644
- const l = r.blockContent.beforePos + 1 + (a ?? 0), u = r.blockContent.beforePos + 1 + (s ?? r.blockContent.node.content.size), d = t.doc.resolve(r.blockContent.beforePos).depth, p = t.doc.resolve(l).depth, h = t.doc.resolve(u).depth;
647
+ const l = r.blockContent.beforePos + 1 + (a ?? 0), u = r.blockContent.beforePos + 1 + (s ?? r.blockContent.node.content.size), d = t.doc.resolve(r.blockContent.beforePos).depth, p = t.doc.resolve(l).depth, m = t.doc.resolve(u).depth;
645
648
  t.replace(
646
649
  l,
647
650
  u,
648
651
  new we(
649
652
  F.from(c),
650
653
  p - d - 1,
651
- h - d - 1
654
+ m - d - 1
652
655
  )
653
656
  );
654
657
  } else
@@ -733,7 +736,7 @@ function Nt(e, t, n) {
733
736
  o = e.mapping.map(t.blockContent.beforePos);
734
737
  else {
735
738
  const x = e.mapping.map(t.bnBlock.beforePos), P = x + (((w = e.doc.nodeAt(x)) == null ? void 0 : w.nodeSize) || 0);
736
- e.doc.nodesBetween(x, P, (m, S) => m.type.name === "table" ? (o = S, !1) : !0);
739
+ e.doc.nodesBetween(x, P, (g, S) => g.type.name === "table" ? (o = S, !1) : !0);
737
740
  }
738
741
  const r = o >= 0 ? e.doc.nodeAt(o) : null;
739
742
  if (!r || r.type.name !== "table")
@@ -741,7 +744,7 @@ function Nt(e, t, n) {
741
744
  const a = be.get(r), s = Math.max(0, Math.min(n.row, a.height - 1)), i = Math.max(0, Math.min(n.col, a.width - 1)), c = s * a.width + i, l = a.map[c];
742
745
  if (l == null)
743
746
  return !1;
744
- const d = o + 1 + l + 1, p = e.doc.nodeAt(d), h = d + 1, f = p ? p.content.size : 0, E = h + Math.max(0, Math.min(n.offset, f));
747
+ const d = o + 1 + l + 1, p = e.doc.nodeAt(d), m = d + 1, f = p ? p.content.size : 0, E = m + Math.max(0, Math.min(n.offset, f));
745
748
  return "selection" in e && e.setSelection(ke.create(e.doc, E)), !0;
746
749
  }
747
750
  const T = {
@@ -818,7 +821,7 @@ const T = {
818
821
  text: "#da208f",
819
822
  background: "#ad1a72"
820
823
  }
821
- }, g = {
824
+ }, h = {
822
825
  backgroundColor: {
823
826
  default: "default"
824
827
  },
@@ -831,27 +834,27 @@ const T = {
831
834
  }
832
835
  }, y = (e) => {
833
836
  const t = {};
834
- return e.hasAttribute("data-background-color") ? t.backgroundColor = e.getAttribute("data-background-color") : e.style.backgroundColor && (t.backgroundColor = e.style.backgroundColor), e.hasAttribute("data-text-color") ? t.textColor = e.getAttribute("data-text-color") : e.style.color && (t.textColor = e.style.color), t.textAlignment = g.textAlignment.values.includes(
837
+ return e.hasAttribute("data-background-color") ? t.backgroundColor = e.getAttribute("data-background-color") : e.style.backgroundColor && (t.backgroundColor = e.style.backgroundColor), e.hasAttribute("data-text-color") ? t.textColor = e.getAttribute("data-text-color") : e.style.color && (t.textColor = e.style.color), t.textAlignment = h.textAlignment.values.includes(
835
838
  e.style.textAlign
836
839
  ) ? e.style.textAlign : void 0, t;
837
840
  }, A = (e, t) => {
838
- e.backgroundColor && e.backgroundColor !== g.backgroundColor.default && (t.style.backgroundColor = e.backgroundColor in T ? T[e.backgroundColor].background : e.backgroundColor), e.textColor && e.textColor !== g.textColor.default && (t.style.color = e.textColor in T ? T[e.textColor].text : e.textColor), e.textAlignment && e.textAlignment !== g.textAlignment.default && (t.style.textAlign = e.textAlignment);
841
+ e.backgroundColor && e.backgroundColor !== h.backgroundColor.default && (t.style.backgroundColor = e.backgroundColor in T ? T[e.backgroundColor].background : e.backgroundColor), e.textColor && e.textColor !== h.textColor.default && (t.style.color = e.textColor in T ? T[e.textColor].text : e.textColor), e.textAlignment && e.textAlignment !== h.textAlignment.default && (t.style.textAlign = e.textAlignment);
839
842
  }, Eo = (e = "backgroundColor") => ({
840
- default: g.backgroundColor.default,
841
- parseHTML: (t) => t.hasAttribute("data-background-color") ? t.getAttribute("data-background-color") : t.style.backgroundColor ? t.style.backgroundColor : g.backgroundColor.default,
842
- renderHTML: (t) => t[e] === g.backgroundColor.default ? {} : {
843
+ default: h.backgroundColor.default,
844
+ parseHTML: (t) => t.hasAttribute("data-background-color") ? t.getAttribute("data-background-color") : t.style.backgroundColor ? t.style.backgroundColor : h.backgroundColor.default,
845
+ renderHTML: (t) => t[e] === h.backgroundColor.default ? {} : {
843
846
  "data-background-color": t[e]
844
847
  }
845
848
  }), xo = (e = "textColor") => ({
846
- default: g.textColor.default,
847
- parseHTML: (t) => t.hasAttribute("data-text-color") ? t.getAttribute("data-text-color") : t.style.color ? t.style.color : g.textColor.default,
848
- renderHTML: (t) => t[e] === g.textColor.default ? {} : {
849
+ default: h.textColor.default,
850
+ parseHTML: (t) => t.hasAttribute("data-text-color") ? t.getAttribute("data-text-color") : t.style.color ? t.style.color : h.textColor.default,
851
+ renderHTML: (t) => t[e] === h.textColor.default ? {} : {
849
852
  "data-text-color": t[e]
850
853
  }
851
854
  }), wo = (e = "textAlignment") => ({
852
- default: g.textAlignment.default,
853
- parseHTML: (t) => t.hasAttribute("data-text-alignment") ? t.getAttribute("data-text-alignment") : t.style.textAlign ? t.style.textAlign : g.textAlignment.default,
854
- renderHTML: (t) => t[e] === g.textAlignment.default ? {} : {
855
+ default: h.textAlignment.default,
856
+ parseHTML: (t) => t.hasAttribute("data-text-alignment") ? t.getAttribute("data-text-alignment") : t.style.textAlign ? t.style.textAlign : h.textAlignment.default,
857
+ renderHTML: (t) => t[e] === h.textAlignment.default ? {} : {
855
858
  "data-text-alignment": t[e]
856
859
  }
857
860
  }), $ = (e, t) => {
@@ -973,7 +976,7 @@ const T = {
973
976
  }, ue = (e) => ({ url: e.src || void 0 }), Ot = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>', _t = (e) => ({
974
977
  type: "audio",
975
978
  propSchema: {
976
- backgroundColor: g.backgroundColor,
979
+ backgroundColor: h.backgroundColor,
977
980
  // File name.
978
981
  name: {
979
982
  default: ""
@@ -1251,7 +1254,7 @@ const jt = () => ({
1251
1254
  ), fe = (e) => ({ url: e.src || void 0 }), Zt = () => ({
1252
1255
  type: "file",
1253
1256
  propSchema: {
1254
- backgroundColor: g.backgroundColor,
1257
+ backgroundColor: h.backgroundColor,
1255
1258
  // File name.
1256
1259
  name: {
1257
1260
  default: ""
@@ -1348,7 +1351,7 @@ const jt = () => ({
1348
1351
  };
1349
1352
  l.addEventListener("click", d), r.appendChild(a);
1350
1353
  let p = e.children.length;
1351
- const h = t.onChange(() => {
1354
+ const m = t.onChange(() => {
1352
1355
  var E;
1353
1356
  const f = ((E = t.getBlock(e)) == null ? void 0 : E.children.length) ?? 0;
1354
1357
  f > p ? (a.getAttribute("data-show-children") === "false" && (a.setAttribute("data-show-children", "true"), o.set(t.getBlock(e), !0)), r.contains(l) && r.removeChild(l)) : f === 0 && f < p && (a.getAttribute("data-show-children") === "true" && (a.setAttribute("data-show-children", "false"), o.set(t.getBlock(e), !1)), r.contains(l) && r.removeChild(l)), p = f;
@@ -1367,7 +1370,7 @@ const jt = () => ({
1367
1370
  ), l.removeEventListener(
1368
1371
  "click",
1369
1372
  d
1370
- ), h == null || h();
1373
+ ), m == null || m();
1371
1374
  }
1372
1375
  };
1373
1376
  }, Ae = [1, 2, 3, 4, 5, 6], Qt = (e) => ({ editor: t }) => {
@@ -1383,7 +1386,7 @@ const jt = () => ({
1383
1386
  } = {}) => ({
1384
1387
  type: "heading",
1385
1388
  propSchema: {
1386
- ...g,
1389
+ ...h,
1387
1390
  level: { default: e, values: t },
1388
1391
  ...n ? { isToggleable: { default: !1, optional: !0 } } : {}
1389
1392
  },
@@ -1475,46 +1478,46 @@ const jt = () => ({
1475
1478
  const u = document.createElement("div");
1476
1479
  u.style.position = "absolute", u.style.height = "100%", u.style.width = "100%";
1477
1480
  let d, p = e.props.previewWidth;
1478
- const h = (m) => {
1481
+ const m = (g) => {
1479
1482
  var ee, te;
1480
1483
  if (!d) {
1481
1484
  !t.isEditable && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l));
1482
1485
  return;
1483
1486
  }
1484
1487
  let S;
1485
- const _ = "touches" in m ? m.touches[0].clientX : m.clientX;
1488
+ const _ = "touches" in g ? g.touches[0].clientX : g.clientX;
1486
1489
  e.props.textAlignment === "center" ? d.handleUsed === "left" ? S = d.initialWidth + (d.initialClientX - _) * 2 : S = d.initialWidth + (_ - d.initialClientX) * 2 : d.handleUsed === "left" ? S = d.initialWidth + d.initialClientX - _ : S = d.initialWidth + _ - d.initialClientX, p = Math.min(
1487
1490
  Math.max(S, 64),
1488
1491
  ((te = (ee = t.domElement) == null ? void 0 : ee.firstElementChild) == null ? void 0 : te.clientWidth) || Number.MAX_VALUE
1489
1492
  ), i.style.width = `${p}px`;
1490
- }, f = (m) => {
1491
- (!m.target || !i.contains(m.target) || !t.isEditable) && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l)), d && (d = void 0, i.contains(u) && i.removeChild(u), t.updateBlock(e, {
1493
+ }, f = (g) => {
1494
+ (!g.target || !i.contains(g.target) || !t.isEditable) && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l)), d && (d = void 0, i.contains(u) && i.removeChild(u), t.updateBlock(e, {
1492
1495
  props: {
1493
1496
  previewWidth: p
1494
1497
  }
1495
1498
  }));
1496
1499
  }, E = () => {
1497
1500
  t.isEditable && (o.appendChild(c), o.appendChild(l));
1498
- }, w = (m) => {
1499
- m.relatedTarget === c || m.relatedTarget === l || d || t.isEditable && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l));
1500
- }, x = (m) => {
1501
- m.preventDefault(), i.contains(u) || i.appendChild(u);
1502
- const S = "touches" in m ? m.touches[0].clientX : m.clientX;
1501
+ }, w = (g) => {
1502
+ g.relatedTarget === c || g.relatedTarget === l || d || t.isEditable && o.contains(c) && o.contains(l) && (o.removeChild(c), o.removeChild(l));
1503
+ }, x = (g) => {
1504
+ g.preventDefault(), i.contains(u) || i.appendChild(u);
1505
+ const S = "touches" in g ? g.touches[0].clientX : g.clientX;
1503
1506
  d = {
1504
1507
  handleUsed: "left",
1505
1508
  initialWidth: i.clientWidth,
1506
1509
  initialClientX: S
1507
1510
  };
1508
- }, P = (m) => {
1509
- m.preventDefault(), i.contains(u) || i.appendChild(u);
1510
- const S = "touches" in m ? m.touches[0].clientX : m.clientX;
1511
+ }, P = (g) => {
1512
+ g.preventDefault(), i.contains(u) || i.appendChild(u);
1513
+ const S = "touches" in g ? g.touches[0].clientX : g.clientX;
1511
1514
  d = {
1512
1515
  handleUsed: "right",
1513
1516
  initialWidth: i.clientWidth,
1514
1517
  initialClientX: S
1515
1518
  };
1516
1519
  };
1517
- return window.addEventListener("mousemove", h), window.addEventListener("touchmove", h), window.addEventListener("mouseup", f), window.addEventListener("touchend", f), i.addEventListener("mouseenter", E), i.addEventListener("mouseleave", w), c.addEventListener(
1520
+ return window.addEventListener("mousemove", m), window.addEventListener("touchmove", m), window.addEventListener("mouseup", f), window.addEventListener("touchend", f), i.addEventListener("mouseenter", E), i.addEventListener("mouseleave", w), c.addEventListener(
1518
1521
  "mousedown",
1519
1522
  x
1520
1523
  ), c.addEventListener(
@@ -1529,7 +1532,7 @@ const jt = () => ({
1529
1532
  ), {
1530
1533
  dom: i,
1531
1534
  destroy: () => {
1532
- s == null || s(), window.removeEventListener("mousemove", h), window.removeEventListener("touchmove", h), window.removeEventListener("mouseup", f), window.removeEventListener("touchend", f), i.removeEventListener("mouseenter", E), i.removeEventListener("mouseleave", w), c.removeEventListener(
1535
+ s == null || s(), window.removeEventListener("mousemove", m), window.removeEventListener("touchmove", m), window.removeEventListener("mouseup", f), window.removeEventListener("touchend", f), i.removeEventListener("mouseenter", E), i.removeEventListener("mouseleave", w), c.removeEventListener(
1533
1536
  "mousedown",
1534
1537
  x
1535
1538
  ), c.removeEventListener(
@@ -1544,14 +1547,14 @@ const jt = () => ({
1544
1547
  );
1545
1548
  }
1546
1549
  };
1547
- }, ge = (e) => {
1550
+ }, he = (e) => {
1548
1551
  const t = e.src || void 0, n = e.width || void 0, o = e.alt || void 0;
1549
1552
  return { url: t, previewWidth: n, name: o };
1550
1553
  }, en = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>', tn = (e = {}) => ({
1551
1554
  type: "image",
1552
1555
  propSchema: {
1553
- textAlignment: g.textAlignment,
1554
- backgroundColor: g.backgroundColor,
1556
+ textAlignment: h.textAlignment,
1557
+ backgroundColor: h.backgroundColor,
1555
1558
  // File name.
1556
1559
  name: {
1557
1560
  default: ""
@@ -1580,7 +1583,7 @@ const jt = () => ({
1580
1583
  return;
1581
1584
  const { backgroundColor: n } = y(t);
1582
1585
  return {
1583
- ...ge(t),
1586
+ ...he(t),
1584
1587
  backgroundColor: n
1585
1588
  };
1586
1589
  }
@@ -1590,7 +1593,7 @@ const jt = () => ({
1590
1593
  return;
1591
1594
  const { targetElement: o, caption: r } = n, { backgroundColor: a } = y(t);
1592
1595
  return {
1593
- ...ge(o),
1596
+ ...he(o),
1594
1597
  backgroundColor: a,
1595
1598
  caption: r
1596
1599
  };
@@ -1667,7 +1670,7 @@ const jt = () => ({
1667
1670
  }), !0) : a.node.childCount > 0 ? e.transact((s) => (s.deleteSelection(), Ne(s, s.selection.from, !0))) : !1;
1668
1671
  };
1669
1672
  function Y(e, t, n) {
1670
- var d, p, h;
1673
+ var d, p, m;
1671
1674
  const o = Se.fromSchema(t), r = e, a = document.createElement("div");
1672
1675
  a.setAttribute("data-node-type", "blockGroup");
1673
1676
  for (const f of Array.from(r.childNodes))
@@ -1680,7 +1683,7 @@ function Y(e, t, n) {
1680
1683
  s.firstChild.firstChild.nodeSize + 2
1681
1684
  )
1682
1685
  ));
1683
- const i = (h = s.firstChild) == null ? void 0 : h.firstChild;
1686
+ const i = (m = s.firstChild) == null ? void 0 : m.firstChild;
1684
1687
  if (!(i != null && i.isTextblock))
1685
1688
  return F.from(s);
1686
1689
  const c = t.nodes[n].create(
@@ -1699,7 +1702,7 @@ function Y(e, t, n) {
1699
1702
  const sn = () => ({
1700
1703
  type: "bulletListItem",
1701
1704
  propSchema: {
1702
- ...g
1705
+ ...h
1703
1706
  },
1704
1707
  content: "inline"
1705
1708
  }), cn = v(
@@ -1766,7 +1769,7 @@ const sn = () => ({
1766
1769
  ), ln = () => ({
1767
1770
  type: "checkListItem",
1768
1771
  propSchema: {
1769
- ...g,
1772
+ ...h,
1770
1773
  checked: { default: !1, type: "boolean" }
1771
1774
  },
1772
1775
  content: "inline"
@@ -1828,7 +1831,7 @@ const sn = () => ({
1828
1831
  },
1829
1832
  inputRules: [
1830
1833
  {
1831
- find: new RegExp("\\[\\s*\\]\\s$"),
1834
+ find: new RegExp("^\\[\\s*\\]\\s$"),
1832
1835
  replace() {
1833
1836
  return {
1834
1837
  type: "checkListItem",
@@ -1840,7 +1843,7 @@ const sn = () => ({
1840
1843
  }
1841
1844
  },
1842
1845
  {
1843
- find: new RegExp("\\[[Xx]\\]\\s$"),
1846
+ find: new RegExp("^\\[[Xx]\\]\\s$"),
1844
1847
  replace() {
1845
1848
  return {
1846
1849
  type: "checkListItem",
@@ -1873,7 +1876,7 @@ function He(e, t, n, o) {
1873
1876
  o
1874
1877
  ).index + 1, a = !1), o.set(e, r), { index: r, isFirst: a, hasStart: s };
1875
1878
  }
1876
- function he(e, t) {
1879
+ function me(e, t) {
1877
1880
  const n = /* @__PURE__ */ new Map(), o = t.decorations.map(
1878
1881
  e.mapping,
1879
1882
  e.doc
@@ -1894,7 +1897,7 @@ function he(e, t) {
1894
1897
  const p = e.doc.nodeAt(i + 1);
1895
1898
  r.push(
1896
1899
  // move in by 1 to account for the block container
1897
- gt.node(i + 1, i + 1 + p.nodeSize, {
1900
+ ht.node(i + 1, i + 1 + p.nodeSize, {
1898
1901
  "data-index": c.toString()
1899
1902
  })
1900
1903
  );
@@ -1912,12 +1915,12 @@ const un = () => new pt({
1912
1915
  key: new ft("numbered-list-indexing-decorations"),
1913
1916
  state: {
1914
1917
  init(e, t) {
1915
- return he(t.tr, {
1918
+ return me(t.tr, {
1916
1919
  decorations: ce.empty
1917
1920
  });
1918
1921
  },
1919
1922
  apply(e, t) {
1920
- return !e.docChanged && !e.selectionSet && t.decorations ? t : he(e, t);
1923
+ return !e.docChanged && !e.selectionSet && t.decorations ? t : me(e, t);
1921
1924
  }
1922
1925
  },
1923
1926
  props: {
@@ -1929,7 +1932,7 @@ const un = () => new pt({
1929
1932
  }), pn = () => ({
1930
1933
  type: "numberedListItem",
1931
1934
  propSchema: {
1932
- ...g,
1935
+ ...h,
1933
1936
  start: { default: void 0, type: "number" }
1934
1937
  },
1935
1938
  content: "inline"
@@ -1945,10 +1948,10 @@ const un = () => new pt({
1945
1948
  return;
1946
1949
  const t = e.parentElement;
1947
1950
  if (t !== null && (t.tagName === "OL" || t.tagName === "DIV" && ((n = t.parentElement) == null ? void 0 : n.tagName) === "OL")) {
1948
- const o = parseInt(t.getAttribute("start") || "1");
1949
- return {
1950
- ...y(e),
1951
- start: e.previousElementSibling || o === 1 ? void 0 : o
1951
+ const o = parseInt(t.getAttribute("start") || "1"), r = y(e);
1952
+ return e.previousElementSibling || o === 1 ? r : {
1953
+ ...r,
1954
+ start: o
1952
1955
  };
1953
1956
  }
1954
1957
  },
@@ -2004,14 +2007,14 @@ const un = () => new pt({
2004
2007
  prosemirrorPlugins: [un()]
2005
2008
  })
2006
2009
  ]
2007
- ), gn = () => ({
2010
+ ), hn = () => ({
2008
2011
  type: "toggleListItem",
2009
2012
  propSchema: {
2010
- ...g
2013
+ ...h
2011
2014
  },
2012
2015
  content: "inline"
2013
- }), hn = v(
2014
- gn,
2016
+ }), mn = v(
2017
+ hn,
2015
2018
  {
2016
2019
  meta: {
2017
2020
  isolating: !1
@@ -2047,12 +2050,12 @@ const un = () => new pt({
2047
2050
  }
2048
2051
  })
2049
2052
  ]
2050
- ), mn = () => ({
2053
+ ), gn = () => ({
2051
2054
  type: "paragraph",
2052
- propSchema: g,
2055
+ propSchema: h,
2053
2056
  content: "inline"
2054
2057
  }), bn = v(
2055
- mn,
2058
+ gn,
2056
2059
  {
2057
2060
  meta: {
2058
2061
  isolating: !1
@@ -2095,8 +2098,8 @@ const un = () => new pt({
2095
2098
  ), Cn = () => ({
2096
2099
  type: "quote",
2097
2100
  propSchema: {
2098
- backgroundColor: g.backgroundColor,
2099
- textColor: g.textColor
2101
+ backgroundColor: h.backgroundColor,
2102
+ textColor: h.textColor
2100
2103
  },
2101
2104
  content: "inline"
2102
2105
  }), kn = v(
@@ -2196,7 +2199,7 @@ const un = () => new pt({
2196
2199
  };
2197
2200
  }
2198
2201
  }), En = {
2199
- textColor: g.textColor
2202
+ textColor: h.textColor
2200
2203
  }, xn = N.create({
2201
2204
  name: "tableHeader",
2202
2205
  addOptions() {
@@ -2308,7 +2311,7 @@ const un = () => new pt({
2308
2311
  },
2309
2312
  renderHTML({ node: e, HTMLAttributes: t }) {
2310
2313
  var r, a, s;
2311
- const n = mt(
2314
+ const n = gt(
2312
2315
  this.name,
2313
2316
  "table",
2314
2317
  {
@@ -2345,10 +2348,10 @@ const un = () => new pt({
2345
2348
  "bn-block-content",
2346
2349
  i.class
2347
2350
  ), c.setAttribute("data-content-type", "table");
2348
- for (const [p, h] of Object.entries(
2351
+ for (const [p, m] of Object.entries(
2349
2352
  i
2350
2353
  ))
2351
- p !== "class" && c.setAttribute(p, h);
2354
+ p !== "class" && c.setAttribute(p, m);
2352
2355
  const l = this.dom, u = document.createElement("div");
2353
2356
  u.className = "tableWrapper-inner", u.appendChild(l.firstChild), l.appendChild(u), c.appendChild(l);
2354
2357
  const d = document.createElement("div");
@@ -2457,14 +2460,14 @@ const Tn = () => yt(
2457
2460
  }
2458
2461
  })
2459
2462
  ]
2460
- ), me = (e) => {
2463
+ ), ge = (e) => {
2461
2464
  const t = e.src || void 0, n = e.width || void 0;
2462
2465
  return { url: t, previewWidth: n };
2463
2466
  }, Bn = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>', An = (e) => ({
2464
2467
  type: "video",
2465
2468
  propSchema: {
2466
- textAlignment: g.textAlignment,
2467
- backgroundColor: g.backgroundColor,
2469
+ textAlignment: h.textAlignment,
2470
+ backgroundColor: h.backgroundColor,
2468
2471
  name: { default: "" },
2469
2472
  url: { default: "" },
2470
2473
  caption: { default: "" },
@@ -2478,7 +2481,7 @@ const Tn = () => yt(
2478
2481
  return;
2479
2482
  const { backgroundColor: n } = y(t);
2480
2483
  return {
2481
- ...me(t),
2484
+ ...ge(t),
2482
2485
  backgroundColor: n
2483
2486
  };
2484
2487
  }
@@ -2488,7 +2491,7 @@ const Tn = () => yt(
2488
2491
  return;
2489
2492
  const { targetElement: o, caption: r } = n, { backgroundColor: a } = y(t);
2490
2493
  return {
2491
- ...me(o),
2494
+ ...ge(o),
2492
2495
  backgroundColor: a,
2493
2496
  caption: r
2494
2497
  };
@@ -2531,7 +2534,7 @@ const Tn = () => yt(
2531
2534
  runsBefore: ["file"]
2532
2535
  })
2533
2536
  );
2534
- function C(e, t, n) {
2537
+ function b(e, t, n) {
2535
2538
  if (!(t in e.schema.blockSpecs))
2536
2539
  return !1;
2537
2540
  if (!n)
@@ -2555,7 +2558,7 @@ function C(e, t, n) {
2555
2558
  return !0;
2556
2559
  }
2557
2560
  function Lo(e, t, n, o) {
2558
- return C(t, n, o) && e.type === n;
2561
+ return b(t, n, o) && e.type === n;
2559
2562
  }
2560
2563
  function To(e) {
2561
2564
  return e instanceof Ce;
@@ -2600,11 +2603,11 @@ function In(e, t, n = "left") {
2600
2603
  const Dn = je((e) => e.type.name === "blockContainer");
2601
2604
  class On {
2602
2605
  constructor(t, n, o) {
2603
- L(this, "state");
2604
- L(this, "emitUpdate");
2605
- L(this, "rootEl");
2606
- L(this, "pluginState");
2607
- L(this, "handleScroll", () => {
2606
+ M(this, "state");
2607
+ M(this, "emitUpdate");
2608
+ M(this, "rootEl");
2609
+ M(this, "pluginState");
2610
+ M(this, "handleScroll", () => {
2608
2611
  var t, n;
2609
2612
  if ((t = this.state) != null && t.show) {
2610
2613
  const o = (n = this.rootEl) == null ? void 0 : n.querySelector(
@@ -2615,10 +2618,10 @@ class On {
2615
2618
  this.state.referencePos = o.getBoundingClientRect().toJSON(), this.emitUpdate(this.pluginState.triggerCharacter);
2616
2619
  }
2617
2620
  });
2618
- L(this, "closeMenu", () => {
2621
+ M(this, "closeMenu", () => {
2619
2622
  this.editor.transact((t) => t.setMeta(B, null));
2620
2623
  });
2621
- L(this, "clearQuery", () => {
2624
+ M(this, "clearQuery", () => {
2622
2625
  this.pluginState !== void 0 && this.editor._tiptapEditor.chain().focus().deleteRange({
2623
2626
  from: this.pluginState.queryStartPos() - (this.pluginState.deleteTriggerCharacter ? this.pluginState.triggerCharacter.length : 0),
2624
2627
  to: this.editor.transact((t) => t.selection.from)
@@ -2811,7 +2814,7 @@ function Vn(e) {
2811
2814
  n = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
2812
2815
  }
2813
2816
  }
2814
- function b(e, t) {
2817
+ function C(e, t) {
2815
2818
  const n = e.getTextCursorPosition().block;
2816
2819
  if (n.content === void 0)
2817
2820
  throw new Error("Slash Menu open in a block that doesn't contain content.");
@@ -2820,111 +2823,89 @@ function b(e, t) {
2820
2823
  }
2821
2824
  function Bo(e) {
2822
2825
  const t = [];
2823
- return C(e, "heading", { level: "number" }) && t.push(
2824
- {
2825
- onItemClick: () => {
2826
- b(e, {
2827
- type: "heading",
2828
- props: { level: 1 }
2829
- });
2830
- },
2831
- badge: M("Mod-Alt-1"),
2832
- key: "heading",
2833
- ...e.dictionary.slash_menu.heading
2834
- },
2835
- {
2836
- onItemClick: () => {
2837
- b(e, {
2838
- type: "heading",
2839
- props: { level: 2 }
2840
- });
2841
- },
2842
- badge: M("Mod-Alt-2"),
2843
- key: "heading_2",
2844
- ...e.dictionary.slash_menu.heading_2
2845
- },
2846
- {
2826
+ return b(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((n) => n <= 3).forEach((n) => {
2827
+ t.push({
2847
2828
  onItemClick: () => {
2848
- b(e, {
2829
+ C(e, {
2849
2830
  type: "heading",
2850
- props: { level: 3 }
2831
+ props: { level: n }
2851
2832
  });
2852
2833
  },
2853
- badge: M("Mod-Alt-3"),
2854
- key: "heading_3",
2855
- ...e.dictionary.slash_menu.heading_3
2856
- }
2857
- ), C(e, "quote") && t.push({
2834
+ badge: L(`Mod-Alt-${n}`),
2835
+ key: n === 1 ? "heading" : `heading_${n}`,
2836
+ ...e.dictionary.slash_menu[n === 1 ? "heading" : `heading_${n}`]
2837
+ });
2838
+ }), b(e, "quote") && t.push({
2858
2839
  onItemClick: () => {
2859
- b(e, {
2840
+ C(e, {
2860
2841
  type: "quote"
2861
2842
  });
2862
2843
  },
2863
2844
  key: "quote",
2864
2845
  ...e.dictionary.slash_menu.quote
2865
- }), C(e, "toggleListItem") && t.push({
2846
+ }), b(e, "toggleListItem") && t.push({
2866
2847
  onItemClick: () => {
2867
- b(e, {
2848
+ C(e, {
2868
2849
  type: "toggleListItem"
2869
2850
  });
2870
2851
  },
2871
- badge: M("Mod-Shift-6"),
2852
+ badge: L("Mod-Shift-6"),
2872
2853
  key: "toggle_list",
2873
2854
  ...e.dictionary.slash_menu.toggle_list
2874
- }), C(e, "numberedListItem") && t.push({
2855
+ }), b(e, "numberedListItem") && t.push({
2875
2856
  onItemClick: () => {
2876
- b(e, {
2857
+ C(e, {
2877
2858
  type: "numberedListItem"
2878
2859
  });
2879
2860
  },
2880
- badge: M("Mod-Shift-7"),
2861
+ badge: L("Mod-Shift-7"),
2881
2862
  key: "numbered_list",
2882
2863
  ...e.dictionary.slash_menu.numbered_list
2883
- }), C(e, "bulletListItem") && t.push({
2864
+ }), b(e, "bulletListItem") && t.push({
2884
2865
  onItemClick: () => {
2885
- b(e, {
2866
+ C(e, {
2886
2867
  type: "bulletListItem"
2887
2868
  });
2888
2869
  },
2889
- badge: M("Mod-Shift-8"),
2870
+ badge: L("Mod-Shift-8"),
2890
2871
  key: "bullet_list",
2891
2872
  ...e.dictionary.slash_menu.bullet_list
2892
- }), C(e, "checkListItem") && t.push({
2873
+ }), b(e, "checkListItem") && t.push({
2893
2874
  onItemClick: () => {
2894
- b(e, {
2875
+ C(e, {
2895
2876
  type: "checkListItem"
2896
2877
  });
2897
2878
  },
2898
- badge: M("Mod-Shift-9"),
2879
+ badge: L("Mod-Shift-9"),
2899
2880
  key: "check_list",
2900
2881
  ...e.dictionary.slash_menu.check_list
2901
- }), C(e, "paragraph") && t.push({
2882
+ }), b(e, "paragraph") && t.push({
2902
2883
  onItemClick: () => {
2903
- b(e, {
2884
+ C(e, {
2904
2885
  type: "paragraph"
2905
2886
  });
2906
2887
  },
2907
- badge: M("Mod-Alt-0"),
2888
+ badge: L("Mod-Alt-0"),
2908
2889
  key: "paragraph",
2909
2890
  ...e.dictionary.slash_menu.paragraph
2910
- }), C(e, "codeBlock") && t.push({
2891
+ }), b(e, "codeBlock") && t.push({
2911
2892
  onItemClick: () => {
2912
- b(e, {
2893
+ C(e, {
2913
2894
  type: "codeBlock"
2914
2895
  });
2915
2896
  },
2916
- badge: M("Mod-Alt-c"),
2897
+ badge: L("Mod-Alt-c"),
2917
2898
  key: "code_block",
2918
2899
  ...e.dictionary.slash_menu.code_block
2919
- }), C(e, "divider") && t.push({
2900
+ }), b(e, "divider") && t.push({
2920
2901
  onItemClick: () => {
2921
- b(e, { type: "divider" });
2902
+ C(e, { type: "divider" });
2922
2903
  },
2923
2904
  key: "divider",
2924
2905
  ...e.dictionary.slash_menu.divider
2925
- }), C(e, "table") && t.push({
2906
+ }), b(e, "table") && t.push({
2926
2907
  onItemClick: () => {
2927
- b(e, {
2908
+ C(e, {
2928
2909
  type: "table",
2929
2910
  content: {
2930
2911
  type: "tableContent",
@@ -2942,88 +2923,69 @@ function Bo(e) {
2942
2923
  badge: void 0,
2943
2924
  key: "table",
2944
2925
  ...e.dictionary.slash_menu.table
2945
- }), C(e, "image", { url: "string" }) && t.push({
2926
+ }), b(e, "image", { url: "string" }) && t.push({
2946
2927
  onItemClick: () => {
2947
2928
  var o;
2948
- const n = b(e, {
2929
+ const n = C(e, {
2949
2930
  type: "image"
2950
2931
  });
2951
2932
  (o = e.getExtension(I)) == null || o.showMenu(n.id);
2952
2933
  },
2953
2934
  key: "image",
2954
2935
  ...e.dictionary.slash_menu.image
2955
- }), C(e, "video", { url: "string" }) && t.push({
2936
+ }), b(e, "video", { url: "string" }) && t.push({
2956
2937
  onItemClick: () => {
2957
2938
  var o;
2958
- const n = b(e, {
2939
+ const n = C(e, {
2959
2940
  type: "video"
2960
2941
  });
2961
2942
  (o = e.getExtension(I)) == null || o.showMenu(n.id);
2962
2943
  },
2963
2944
  key: "video",
2964
2945
  ...e.dictionary.slash_menu.video
2965
- }), C(e, "audio", { url: "string" }) && t.push({
2946
+ }), b(e, "audio", { url: "string" }) && t.push({
2966
2947
  onItemClick: () => {
2967
2948
  var o;
2968
- const n = b(e, {
2949
+ const n = C(e, {
2969
2950
  type: "audio"
2970
2951
  });
2971
2952
  (o = e.getExtension(I)) == null || o.showMenu(n.id);
2972
2953
  },
2973
2954
  key: "audio",
2974
2955
  ...e.dictionary.slash_menu.audio
2975
- }), C(e, "file", { url: "string" }) && t.push({
2956
+ }), b(e, "file", { url: "string" }) && t.push({
2976
2957
  onItemClick: () => {
2977
2958
  var o;
2978
- const n = b(e, {
2959
+ const n = C(e, {
2979
2960
  type: "file"
2980
2961
  });
2981
2962
  (o = e.getExtension(I)) == null || o.showMenu(n.id);
2982
2963
  },
2983
2964
  key: "file",
2984
2965
  ...e.dictionary.slash_menu.file
2985
- }), C(e, "heading", {
2966
+ }), b(e, "heading", {
2986
2967
  level: "number",
2987
2968
  isToggleable: "boolean"
2988
- }) && t.push(
2989
- {
2990
- onItemClick: () => {
2991
- b(e, {
2992
- type: "heading",
2993
- props: { level: 1, isToggleable: !0 }
2994
- });
2995
- },
2996
- key: "toggle_heading",
2997
- ...e.dictionary.slash_menu.toggle_heading
2998
- },
2999
- {
3000
- onItemClick: () => {
3001
- b(e, {
3002
- type: "heading",
3003
- props: { level: 2, isToggleable: !0 }
3004
- });
3005
- },
3006
- key: "toggle_heading_2",
3007
- ...e.dictionary.slash_menu.toggle_heading_2
3008
- },
3009
- {
2969
+ }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((n) => n <= 3).forEach((n) => {
2970
+ t.push({
3010
2971
  onItemClick: () => {
3011
- b(e, {
2972
+ C(e, {
3012
2973
  type: "heading",
3013
- props: { level: 3, isToggleable: !0 }
2974
+ props: { level: n, isToggleable: !0 }
3014
2975
  });
3015
2976
  },
3016
- key: "toggle_heading_3",
3017
- ...e.dictionary.slash_menu.toggle_heading_3
3018
- }
3019
- ), C(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((n) => n > 3).forEach((n) => {
2977
+ key: n === 1 ? "toggle_heading" : `toggle_heading_${n}`,
2978
+ ...e.dictionary.slash_menu[n === 1 ? "toggle_heading" : `toggle_heading_${n}`]
2979
+ });
2980
+ }), b(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((n) => n > 3).forEach((n) => {
3020
2981
  t.push({
3021
2982
  onItemClick: () => {
3022
- b(e, {
2983
+ C(e, {
3023
2984
  type: "heading",
3024
2985
  props: { level: n }
3025
2986
  });
3026
2987
  },
2988
+ badge: L(`Mod-Alt-${n}`),
3027
2989
  key: `heading_${n}`,
3028
2990
  ...e.dictionary.slash_menu[`heading_${n}`]
3029
2991
  });
@@ -3059,7 +3021,7 @@ const Po = {
3059
3021
  paragraph: bn(),
3060
3022
  quote: kn(),
3061
3023
  table: Tn(),
3062
- toggleListItem: hn(),
3024
+ toggleListItem: mn(),
3063
3025
  video: Nn()
3064
3026
  }, Rn = Le(
3065
3027
  {
@@ -3076,7 +3038,7 @@ const Po = {
3076
3038
  },
3077
3039
  toExternalHTML: (e) => {
3078
3040
  const t = document.createElement("span");
3079
- return e !== g.textColor.default && (t.style.color = e in T ? T[e].text : e), {
3041
+ return e !== h.textColor.default && (t.style.color = e in T ? T[e].text : e), {
3080
3042
  dom: t,
3081
3043
  contentDOM: t
3082
3044
  };
@@ -3101,7 +3063,7 @@ const Po = {
3101
3063
  },
3102
3064
  toExternalHTML: (e) => {
3103
3065
  const t = document.createElement("span");
3104
- return e !== g.backgroundColor.default && (t.style.backgroundColor = e in T ? T[e].background : e), {
3066
+ return e !== h.backgroundColor.default && (t.style.backgroundColor = e in T ? T[e].background : e), {
3105
3067
  dom: t,
3106
3068
  contentDOM: t
3107
3069
  };
@@ -3126,15 +3088,15 @@ const Po = {
3126
3088
  $n
3127
3089
  );
3128
3090
  export {
3129
- C as $,
3091
+ b as $,
3130
3092
  dn as A,
3131
3093
  pn as B,
3132
3094
  fn as C,
3133
- gn as D,
3095
+ hn as D,
3134
3096
  Mo as E,
3135
3097
  Ot as F,
3136
- hn as G,
3137
- mn as H,
3098
+ mn as G,
3099
+ gn as H,
3138
3100
  bn as I,
3139
3101
  Cn as J,
3140
3102
  kn as K,
@@ -3146,7 +3108,7 @@ export {
3146
3108
  Nn as Q,
3147
3109
  Kt as R,
3148
3110
  Be as S,
3149
- mt as T,
3111
+ gt as T,
3150
3112
  le as U,
3151
3113
  bt as V,
3152
3114
  Po as W,
@@ -3157,7 +3119,7 @@ export {
3157
3119
  Ie as a,
3158
3120
  Lo as a0,
3159
3121
  To as a1,
3160
- g as a2,
3122
+ h as a2,
3161
3123
  y as a3,
3162
3124
  A as a4,
3163
3125
  Eo as a5,
@@ -3174,23 +3136,23 @@ export {
3174
3136
  V as aG,
3175
3137
  Me as aH,
3176
3138
  H as aI,
3177
- ht as aJ,
3178
- M as aK,
3139
+ mt as aJ,
3140
+ L as aK,
3179
3141
  uo as aL,
3180
3142
  W as aM,
3181
3143
  po as aN,
3182
3144
  In as aO,
3183
- b as aa,
3145
+ C as aa,
3184
3146
  Bo as ab,
3185
3147
  Ao as ac,
3186
- go as ad,
3148
+ ho as ad,
3187
3149
  Mt as ae,
3188
3150
  wt as af,
3189
- ho as ag,
3151
+ mo as ag,
3190
3152
  v as ah,
3191
3153
  Bt as ai,
3192
3154
  Tt as aj,
3193
- mo as ak,
3155
+ go as ak,
3194
3156
  bo as al,
3195
3157
  Ct as am,
3196
3158
  Co as an,
@@ -3232,4 +3194,4 @@ export {
3232
3194
  cn as y,
3233
3195
  ln as z
3234
3196
  };
3235
- //# sourceMappingURL=defaultBlocks-B63ufZ5N.js.map
3197
+ //# sourceMappingURL=defaultBlocks-DvCGYzqu.js.map