@blocknote/core 0.49.0 → 0.51.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 (147) hide show
  1. package/dist/blocknote.cjs +1 -1
  2. package/dist/blocknote.js +4 -4
  3. package/dist/{blocks-CSfJen16.js → blocks-D0lMxErU.js} +612 -568
  4. package/dist/blocks-D0lMxErU.js.map +1 -0
  5. package/dist/blocks-KyMOxPT3.cjs +11 -0
  6. package/dist/blocks-KyMOxPT3.cjs.map +1 -0
  7. package/dist/blocks.cjs +1 -1
  8. package/dist/blocks.js +2 -2
  9. package/dist/comments.cjs +1 -1
  10. package/dist/comments.cjs.map +1 -1
  11. package/dist/comments.js +17 -14
  12. package/dist/comments.js.map +1 -1
  13. package/dist/{en-QsSI16s5.js → en-B9hMApn4.js} +4 -2
  14. package/dist/en-B9hMApn4.js.map +1 -0
  15. package/dist/{en-C4ykW581.cjs → en-Cj5r8sW_.cjs} +2 -2
  16. package/dist/en-Cj5r8sW_.cjs.map +1 -0
  17. package/dist/{extensions-C3nguvVr.js → extensions-CQFfm5f5.js} +621 -353
  18. package/dist/extensions-CQFfm5f5.js.map +1 -0
  19. package/dist/extensions-Cuw3zOdC.cjs +52 -0
  20. package/dist/extensions-Cuw3zOdC.cjs.map +1 -0
  21. package/dist/extensions.cjs +1 -1
  22. package/dist/extensions.js +3 -3
  23. package/dist/locales.cjs +1 -1
  24. package/dist/locales.cjs.map +1 -1
  25. package/dist/locales.js +68 -24
  26. package/dist/locales.js.map +1 -1
  27. package/dist/{src-DQfz4zLM.js → src-DK_8q1j5.js} +1135 -625
  28. package/dist/src-DK_8q1j5.js.map +1 -0
  29. package/dist/src-_83jmA7A.cjs +21 -0
  30. package/dist/src-_83jmA7A.cjs.map +1 -0
  31. package/dist/style.css +1 -1
  32. package/dist/webpack-stats.json +1 -1
  33. package/dist/yjs.cjs +1 -1
  34. package/dist/yjs.js +8 -8
  35. package/package.json +1 -13
  36. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +7 -7
  37. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +5 -3
  38. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +5 -5
  39. package/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap +2550 -291
  40. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +83 -2
  41. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +103 -42
  42. package/src/api/blockManipulation/commands/nestBlock/__snapshots__/nestBlock.test.ts.snap +0 -143
  43. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +12 -12
  44. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +5 -3
  45. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +6 -6
  46. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +22 -22
  47. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +12 -8
  48. package/src/api/blockManipulation/setupTestEnv.ts +1 -1
  49. package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +2 -6
  50. package/src/api/clipboard/fromClipboard/pasteExtension.ts +7 -2
  51. package/src/api/clipboard/toClipboard/copyExtension.ts +21 -16
  52. package/src/api/exporters/markdown/htmlToMarkdown.ts +813 -0
  53. package/src/api/exporters/markdown/markdownExporter.ts +2 -21
  54. package/src/api/nodeConversions/blockToNode.ts +3 -2
  55. package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +122 -107
  56. package/src/api/parsers/html/util/nestedLists.test.ts +1 -12
  57. package/src/api/parsers/markdown/markdownToHtml.ts +1194 -0
  58. package/src/api/parsers/markdown/parseMarkdown.ts +2 -101
  59. package/src/blocks/Audio/block.ts +1 -4
  60. package/src/blocks/Code/block.test.ts +258 -0
  61. package/src/blocks/File/block.ts +1 -4
  62. package/src/blocks/File/helpers/render/createFileBlockWrapper.ts +7 -2
  63. package/src/blocks/Image/block.ts +9 -6
  64. package/src/blocks/ListItem/BulletListItem/block.ts +7 -4
  65. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +3 -4
  66. package/src/blocks/Table/TableExtension.ts +38 -9
  67. package/src/blocks/Video/block.ts +4 -5
  68. package/src/blocks/Video/parseVideoElement.ts +2 -1
  69. package/src/blocks/defaultBlocks.ts +34 -1
  70. package/src/comments/extension.ts +30 -11
  71. package/src/editor/Block.css +22 -18
  72. package/src/editor/BlockNoteEditor.test.ts +10 -4
  73. package/src/editor/BlockNoteEditor.ts +30 -13
  74. package/src/editor/managers/BlockManager.ts +10 -6
  75. package/src/editor/managers/ExtensionManager/extensions.ts +8 -9
  76. package/src/editor/managers/ExtensionManager/index.ts +80 -25
  77. package/src/editor/performance.test.ts +2 -2
  78. package/src/editor/transformPasted.test.ts +295 -0
  79. package/src/editor/transformPasted.ts +77 -0
  80. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +1 -12
  81. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +0 -11
  82. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
  83. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
  84. package/src/extensions/SideMenu/SideMenu.ts +2 -2
  85. package/src/extensions/SideMenu/dragging.ts +7 -10
  86. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +21 -0
  87. package/src/extensions/TableHandles/TableHandles.ts +2 -0
  88. package/src/extensions/TrailingNode/TrailingNode.ts +124 -65
  89. package/src/extensions/tiptap-extensions/Link/index.ts +1 -1
  90. package/src/extensions/tiptap-extensions/Link/link.ts +49 -18
  91. package/src/i18n/locales/ar.ts +3 -1
  92. package/src/i18n/locales/de.ts +3 -1
  93. package/src/i18n/locales/en.ts +3 -1
  94. package/src/i18n/locales/es.ts +3 -1
  95. package/src/i18n/locales/fa.ts +3 -1
  96. package/src/i18n/locales/fr.ts +4 -2
  97. package/src/i18n/locales/he.ts +3 -1
  98. package/src/i18n/locales/hr.ts +3 -1
  99. package/src/i18n/locales/is.ts +3 -1
  100. package/src/i18n/locales/it.ts +3 -1
  101. package/src/i18n/locales/ja.ts +3 -1
  102. package/src/i18n/locales/ko.ts +3 -1
  103. package/src/i18n/locales/nl.ts +3 -1
  104. package/src/i18n/locales/no.ts +3 -1
  105. package/src/i18n/locales/pl.ts +3 -1
  106. package/src/i18n/locales/pt.ts +3 -1
  107. package/src/i18n/locales/ru.ts +3 -1
  108. package/src/i18n/locales/sk.ts +3 -1
  109. package/src/i18n/locales/uk.ts +3 -1
  110. package/src/i18n/locales/uz.ts +3 -1
  111. package/src/i18n/locales/vi.ts +3 -1
  112. package/src/i18n/locales/zh-tw.ts +3 -1
  113. package/src/i18n/locales/zh.ts +3 -1
  114. package/types/src/api/blockManipulation/commands/moveBlocks/moveBlocks.d.ts +13 -2
  115. package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +1 -1
  116. package/types/src/api/exporters/markdown/htmlToMarkdown.d.ts +11 -0
  117. package/types/src/api/parsers/markdown/markdownToHtml.d.ts +5 -0
  118. package/types/src/blocks/Code/block.test.d.ts +1 -0
  119. package/types/src/blocks/Video/block.d.ts +2 -0
  120. package/types/src/blocks/Video/parseVideoElement.d.ts +1 -0
  121. package/types/src/comments/extension.d.ts +2 -1
  122. package/types/src/editor/BlockNoteEditor.d.ts +20 -6
  123. package/types/src/editor/managers/BlockManager.d.ts +8 -4
  124. package/types/src/editor/transformPasted.test.d.ts +1 -0
  125. package/types/src/extensions/TrailingNode/TrailingNode.d.ts +8 -3
  126. package/types/src/extensions/tiptap-extensions/Link/index.d.ts +1 -1
  127. package/types/src/extensions/tiptap-extensions/Link/link.d.ts +12 -0
  128. package/types/src/i18n/locales/en.d.ts +2 -0
  129. package/types/src/i18n/locales/fa.d.ts +2 -0
  130. package/types/src/i18n/locales/sk.d.ts +2 -0
  131. package/dist/blocks-CSfJen16.js.map +0 -1
  132. package/dist/blocks-_lpGWKOa.cjs +0 -11
  133. package/dist/blocks-_lpGWKOa.cjs.map +0 -1
  134. package/dist/en-C4ykW581.cjs.map +0 -1
  135. package/dist/en-QsSI16s5.js.map +0 -1
  136. package/dist/extensions-BfYaEv6F.cjs +0 -2
  137. package/dist/extensions-BfYaEv6F.cjs.map +0 -1
  138. package/dist/extensions-C3nguvVr.js.map +0 -1
  139. package/dist/src-ChTwrMcE.cjs +0 -5
  140. package/dist/src-ChTwrMcE.cjs.map +0 -1
  141. package/dist/src-DQfz4zLM.js.map +0 -1
  142. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +0 -42
  143. package/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts +0 -19
  144. package/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts +0 -39
  145. package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +0 -7
  146. package/types/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.d.ts +0 -2
  147. package/types/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.d.ts +0 -6
@@ -1,34 +1,34 @@
1
1
  import { n as e, t } from "./BlockNoteExtension-B6RhuQ3V.js";
2
2
  import { DOMParser as n, Fragment as r, Slice as i } from "prosemirror-model";
3
3
  import { Mapping as a, ReplaceStep as o } from "prosemirror-transform";
4
- import { Extension as s, Mark as c, Node as l, callOrReturn as u, combineTransactionSteps as d, findChildrenInRange as f, findParentNode as p, getChangedRanges as m, getExtensionField as h, mergeAttributes as g } from "@tiptap/core";
5
- import { Plugin as _, PluginKey as v, TextSelection as ee } from "prosemirror-state";
6
- import { uuidv4 as te } from "lib0/random";
7
- import { DOMParser as ne, DOMSerializer as re, Fragment as ie } from "@tiptap/pm/model";
8
- import { CellSelection as ae, TableMap as oe, TableView as se, columnResizing as ce, goToNextCell as le, tableEditing as ue } from "prosemirror-tables";
9
- import { createHighlightPlugin as de } from "prosemirror-highlight";
10
- import { createParser as fe } from "prosemirror-highlight/shiki";
11
- import { Plugin as pe, PluginKey as me } from "@tiptap/pm/state";
12
- import { Decoration as he, DecorationSet as ge } from "@tiptap/pm/view";
13
- import { Decoration as _e, DecorationSet as ve } from "prosemirror-view";
14
- import { absolutePositionToRelativePosition as ye, relativePositionToAbsolutePosition as be, ySyncPluginKey as xe } from "y-prosemirror";
15
- import Se from "@tiptap/extension-bold";
16
- import Ce from "@tiptap/extension-code";
17
- import we from "@tiptap/extension-italic";
18
- import Te from "@tiptap/extension-strike";
19
- import Ee from "@tiptap/extension-underline";
4
+ import { Extension as s, InputRule as c, Mark as l, Node as u, callOrReturn as d, combineTransactionSteps as f, findChildrenInRange as p, findParentNode as m, getChangedRanges as h, getExtensionField as g, markInputRule as _, mergeAttributes as v } from "@tiptap/core";
5
+ import { Plugin as ee, PluginKey as te, TextSelection as y } from "prosemirror-state";
6
+ import { uuidv4 as ne } from "lib0/random";
7
+ import { DOMParser as re, DOMSerializer as ie, Fragment as ae } from "@tiptap/pm/model";
8
+ import { CellSelection as oe, TableMap as se, TableView as ce, columnResizing as le, goToNextCell as ue, isInTable as de, moveCellForward as fe, nextCell as pe, selectionCell as me, tableEditing as he } from "prosemirror-tables";
9
+ import { createHighlightPlugin as ge } from "prosemirror-highlight";
10
+ import { createParser as _e } from "prosemirror-highlight/shiki";
11
+ import { Plugin as ve, PluginKey as ye } from "@tiptap/pm/state";
12
+ import { Decoration as be, DecorationSet as xe } from "@tiptap/pm/view";
13
+ import { Decoration as Se, DecorationSet as Ce } from "prosemirror-view";
14
+ import { absolutePositionToRelativePosition as we, relativePositionToAbsolutePosition as Te, ySyncPluginKey as Ee } from "y-prosemirror";
15
+ import De from "@tiptap/extension-bold";
16
+ import Oe from "@tiptap/extension-code";
17
+ import ke from "@tiptap/extension-italic";
18
+ import Ae from "@tiptap/extension-strike";
19
+ import je from "@tiptap/extension-underline";
20
20
  //#region src/extensions/tiptap-extensions/UniqueID/UniqueID.ts
21
- function De(e, t = JSON.stringify) {
21
+ function Me(e, t = JSON.stringify) {
22
22
  let n = {};
23
23
  return e.filter((e) => {
24
24
  let r = t(e);
25
25
  return Object.prototype.hasOwnProperty.call(n, r) ? !1 : n[r] = !0;
26
26
  });
27
27
  }
28
- function Oe(e) {
29
- return De(e.filter((t, n) => e.indexOf(t) !== n));
28
+ function Ne(e) {
29
+ return Me(e.filter((t, n) => e.indexOf(t) !== n));
30
30
  }
31
- var ke = s.create({
31
+ var Pe = s.create({
32
32
  name: "uniqueID",
33
33
  priority: 1e4,
34
34
  addOptions() {
@@ -42,7 +42,7 @@ var ke = s.create({
42
42
  let e = window.__TEST_OPTIONS;
43
43
  return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
44
44
  }
45
- return te();
45
+ return ne();
46
46
  },
47
47
  filterTransaction: null
48
48
  };
@@ -65,14 +65,14 @@ var ke = s.create({
65
65
  },
66
66
  addProseMirrorPlugins() {
67
67
  let { isWithinEditor: e } = this.options, t = null, n = !1;
68
- return [new _({
69
- key: new v("uniqueID"),
68
+ return [new ee({
69
+ key: new te("uniqueID"),
70
70
  appendTransaction: (e, t, n) => {
71
71
  let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = this.options.filterTransaction && e.some((e) => !this.options.filterTransaction?.(e));
72
72
  if (!r || i) return;
73
- let { tr: a } = n, { types: o, attributeName: s, generateID: c } = this.options, l = d(t.doc, e), { mapping: u } = l;
74
- if (m(l).forEach(({ newRange: e }) => {
75
- let r = f(n.doc, e, (e) => o.includes(e.type.name)), i = Oe(r.map(({ node: e }) => e.attrs[s]).filter((e) => e !== null));
73
+ let { tr: a } = n, { types: o, attributeName: s, generateID: c } = this.options, l = f(t.doc, e), { mapping: u } = l;
74
+ if (h(l).forEach(({ newRange: e }) => {
75
+ let r = p(n.doc, e, (e) => o.includes(e.type.name)), i = Ne(r.map(({ node: e }) => e.attrs[s]).filter((e) => e !== null));
76
76
  r.forEach(({ node: e, pos: r }) => {
77
77
  let o = a.doc.nodeAt(r)?.attrs[s];
78
78
  if (o === null) {
@@ -143,19 +143,19 @@ var ke = s.create({
143
143
  });
144
144
  //#endregion
145
145
  //#region src/schema/inlineContent/types.ts
146
- function Ae(e) {
146
+ function Fe(e) {
147
147
  return e.type === "link";
148
148
  }
149
- function je(e) {
149
+ function Ie(e) {
150
150
  return typeof e != "string" && e.type === "link";
151
151
  }
152
- function y(e) {
152
+ function b(e) {
153
153
  return typeof e != "string" && e.type === "text";
154
154
  }
155
155
  //#endregion
156
156
  //#region src/util/table.ts
157
- function Me(e) {
158
- return Ne(e) ? { ...e } : b(e) ? {
157
+ function x(e) {
158
+ return C(e) ? { ...e } : S(e) ? {
159
159
  type: "tableCell",
160
160
  content: [].concat(e.content),
161
161
  props: {
@@ -177,55 +177,55 @@ function Me(e) {
177
177
  }
178
178
  };
179
179
  }
180
- function b(e) {
180
+ function S(e) {
181
181
  return e != null && typeof e != "string" && !Array.isArray(e) && e.type === "tableCell";
182
182
  }
183
- function Ne(e) {
184
- return b(e) && e.props !== void 0 && e.content !== void 0;
183
+ function C(e) {
184
+ return S(e) && e.props !== void 0 && e.content !== void 0;
185
185
  }
186
- function x(e) {
187
- return Ne(e) ? e.props.colspan ?? 1 : 1;
186
+ function w(e) {
187
+ return C(e) ? e.props.colspan ?? 1 : 1;
188
188
  }
189
- function Pe(e) {
190
- return Ne(e) ? e.props.rowspan ?? 1 : 1;
189
+ function Le(e) {
190
+ return C(e) ? e.props.rowspan ?? 1 : 1;
191
191
  }
192
192
  //#endregion
193
193
  //#region src/util/typescript.ts
194
- var S = class extends Error {
194
+ var T = class extends Error {
195
195
  constructor(e) {
196
196
  super(`Unreachable case: ${e}`);
197
197
  }
198
198
  };
199
- function Fe(e, t = !0) {
199
+ function Re(e, t = !0) {
200
200
  let { "data-test": n, ...r } = e;
201
201
  if (Object.keys(r).length > 0 && t) throw Error("Object must be empty " + JSON.stringify(e));
202
202
  }
203
203
  //#endregion
204
204
  //#region src/util/browser.ts
205
- var Ie = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
206
- function C(e, t = "Ctrl") {
207
- return Ie() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
205
+ var ze = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
206
+ function E(e, t = "Ctrl") {
207
+ return ze() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
208
208
  }
209
- function w(...e) {
209
+ function D(...e) {
210
210
  return [...new Set(e.filter((e) => e).join(" ").split(" "))].join(" ");
211
211
  }
212
- var Le = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
212
+ var Be = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
213
213
  //#endregion
214
214
  //#region src/blocks/defaultBlockHelpers.ts
215
- function Re(e, t, n, r) {
215
+ function Ve(e, t, n, r) {
216
216
  let i = document.createElement("div");
217
- i.className = w("bn-block-content", n.class), i.setAttribute("data-content-type", e);
217
+ i.className = D("bn-block-content", n.class), i.setAttribute("data-content-type", e);
218
218
  for (let [e, t] of Object.entries(n)) e !== "class" && i.setAttribute(e, t);
219
219
  let a = document.createElement(t);
220
- a.className = w("bn-inline-content", r.class);
220
+ a.className = D("bn-inline-content", r.class);
221
221
  for (let [e, t] of Object.entries(r)) e !== "class" && a.setAttribute(e, t);
222
222
  return i.appendChild(a), {
223
223
  dom: i,
224
224
  contentDOM: a
225
225
  };
226
226
  }
227
- var ze = (e, t) => {
228
- let n = U(e, t.pmSchema);
227
+ var He = (e, t) => {
228
+ let n = W(e, t.pmSchema);
229
229
  n.type.name === "blockContainer" && (n = n.firstChild);
230
230
  let r = t.pmSchema.nodes[n.type.name].spec.toDOM;
231
231
  if (r === void 0) throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");
@@ -233,7 +233,7 @@ var ze = (e, t) => {
233
233
  if (typeof i != "object" || !("dom" in i)) throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");
234
234
  return i;
235
235
  };
236
- function Be(e, t = "<br>") {
236
+ function Ue(e, t = "<br>") {
237
237
  let n = e.querySelectorAll("p");
238
238
  if (n.length > 1) {
239
239
  let e = n[0];
@@ -245,14 +245,14 @@ function Be(e, t = "<br>") {
245
245
  }
246
246
  //#endregion
247
247
  //#region src/util/string.ts
248
- function T(e) {
248
+ function O(e) {
249
249
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
250
250
  }
251
- function Ve(e) {
251
+ function We(e) {
252
252
  let t = e.split("/");
253
253
  return !t.length || t[t.length - 1] === "" ? e : t[t.length - 1];
254
254
  }
255
- function He(e) {
255
+ function Ge(e) {
256
256
  let t = [
257
257
  "mp4",
258
258
  "webm",
@@ -273,14 +273,14 @@ function He(e) {
273
273
  }
274
274
  //#endregion
275
275
  //#region src/schema/blocks/internal.ts
276
- function Ue(e) {
276
+ function Ke(e) {
277
277
  let t = {};
278
278
  return Object.entries(e).forEach(([e, n]) => {
279
279
  t[e] = {
280
280
  default: n.default,
281
281
  keepOnSplit: !0,
282
282
  parseHTML: (t) => {
283
- let r = t.getAttribute(T(e));
283
+ let r = t.getAttribute(O(e));
284
284
  if (r === null) return null;
285
285
  if (n.default === void 0 && n.type === "boolean" || n.default !== void 0 && typeof n.default == "boolean") return r === "true" ? !0 : r === "false" ? !1 : null;
286
286
  if (n.default === void 0 && n.type === "number" || n.default !== void 0 && typeof n.default == "number") {
@@ -289,11 +289,11 @@ function Ue(e) {
289
289
  }
290
290
  return r;
291
291
  },
292
- renderHTML: (t) => t[e] === n.default ? {} : { [T(e)]: t[e] }
292
+ renderHTML: (t) => t[e] === n.default ? {} : { [O(e)]: t[e] }
293
293
  };
294
294
  }), t;
295
295
  }
296
- function We(e, t, n, r) {
296
+ function qe(e, t, n, r) {
297
297
  let i = e();
298
298
  if (i === void 0) throw Error("Cannot find node position");
299
299
  let a = n.state.doc.resolve(i).node().attrs.id;
@@ -302,17 +302,17 @@ function We(e, t, n, r) {
302
302
  if (o.type !== r) throw Error("Block type does not match");
303
303
  return o;
304
304
  }
305
- function E(e, t, n, r, i = !1, a) {
305
+ function k(e, t, n, r, i = !1, a) {
306
306
  let o = document.createElement("div");
307
307
  if (a !== void 0) for (let [e, t] of Object.entries(a)) e !== "class" && o.setAttribute(e, t);
308
- o.className = w("bn-block-content", a?.class || ""), o.setAttribute("data-content-type", t);
309
- for (let [e, t] of Object.entries(n)) t !== r[e].default && o.setAttribute(T(e), t);
310
- return i && o.setAttribute("data-file-block", ""), o.appendChild(e.dom), e.contentDOM && (e.contentDOM.className = w("bn-inline-content", e.contentDOM.className)), {
308
+ o.className = D("bn-block-content", a?.class || ""), o.setAttribute("data-content-type", t);
309
+ for (let [e, t] of Object.entries(n)) t !== r[e].default && o.setAttribute(O(e), t);
310
+ return i && o.setAttribute("data-file-block", ""), o.appendChild(e.dom), e.contentDOM && (e.contentDOM.className = D("bn-inline-content", e.contentDOM.className)), {
311
311
  ...e,
312
312
  dom: o
313
313
  };
314
314
  }
315
- function Ge(e, t, n) {
315
+ function Je(e, t, n) {
316
316
  return {
317
317
  config: {
318
318
  type: e.type,
@@ -321,20 +321,20 @@ function Ge(e, t, n) {
321
321
  },
322
322
  implementation: {
323
323
  node: e.node,
324
- render: ze,
325
- toExternalHTML: ze
324
+ render: He,
325
+ toExternalHTML: He
326
326
  },
327
327
  extensions: n
328
328
  };
329
329
  }
330
330
  //#endregion
331
331
  //#region src/schema/blocks/createSpec.ts
332
- function Ke(e, t) {
332
+ function Ye(e, t) {
333
333
  e.stopEvent = (e) => (e.type === "mousedown" && setTimeout(() => {
334
334
  t.view.dom.blur();
335
335
  }, 10), !0);
336
336
  }
337
- function qe(e, t) {
337
+ function Xe(e, t) {
338
338
  let n = [{
339
339
  tag: "[data-content-type=" + e.type + "]",
340
340
  contentElement: ".bn-inline-content"
@@ -357,17 +357,17 @@ function qe(e, t) {
357
357
  }
358
358
  if (e.content === "inline") {
359
359
  let e = n.cloneNode(!0);
360
- return Be(e, t.meta?.code ? "\n" : "<br>"), ne.fromSchema(r).parse(e, {
360
+ return Ue(e, t.meta?.code ? "\n" : "<br>"), re.fromSchema(r).parse(e, {
361
361
  topNode: r.nodes.paragraph.create(),
362
362
  preserveWhitespace: !0
363
363
  }).content;
364
364
  }
365
- return ie.empty;
365
+ return ae.empty;
366
366
  } : void 0
367
367
  }), n;
368
368
  }
369
- function Je(e, t, n, r) {
370
- let i = t.node || l.create({
369
+ function Ze(e, t, n, r) {
370
+ let i = t.node || u.create({
371
371
  name: e.type,
372
372
  content: e.content === "inline" ? "inline*" : e.content === "none" ? "" : e.content,
373
373
  group: "blockContent",
@@ -377,26 +377,26 @@ function Je(e, t, n, r) {
377
377
  defining: t.meta?.defining ?? !0,
378
378
  priority: r,
379
379
  addAttributes() {
380
- return Ue(e.propSchema);
380
+ return Ke(e.propSchema);
381
381
  },
382
382
  parseHTML() {
383
- return qe(e, t);
383
+ return Xe(e, t);
384
384
  },
385
385
  renderHTML({ HTMLAttributes: n }) {
386
386
  let r = document.createElement("div");
387
- return E({
387
+ return k({
388
388
  dom: r,
389
389
  contentDOM: e.content === "inline" ? r : void 0
390
390
  }, e.type, {}, e.propSchema, t.meta?.fileBlockAccept !== void 0, n);
391
391
  },
392
392
  addNodeView() {
393
393
  return (n) => {
394
- let r = this.options.editor, i = We(n.getPos, r, this.editor, e.type), a = this.options.domAttributes?.blockContent || {}, o = t.render.call({
394
+ let r = this.options.editor, i = qe(n.getPos, r, this.editor, e.type), a = this.options.domAttributes?.blockContent || {}, o = t.render.call({
395
395
  blockContentDOMAttributes: a,
396
396
  props: n,
397
397
  renderType: "nodeView"
398
398
  }, i, r);
399
- return t.meta?.selectable === !1 && Ke(o, this.editor), o;
399
+ return t.meta?.selectable === !1 && Ye(o, this.editor), o;
400
400
  };
401
401
  }
402
402
  });
@@ -426,10 +426,10 @@ function Je(e, t, n, r) {
426
426
  extensions: n
427
427
  };
428
428
  }
429
- function D(e) {
429
+ function A(e) {
430
430
  return e;
431
431
  }
432
- function O(e, t, n) {
432
+ function j(e, t, n) {
433
433
  return (r = {}) => {
434
434
  let i = typeof e == "function" ? e(r) : e, a = typeof t == "function" ? t(r) : t, o = n ? typeof n == "function" ? n(r) : n : void 0;
435
435
  return {
@@ -438,10 +438,10 @@ function O(e, t, n) {
438
438
  ...a,
439
439
  toExternalHTML(e, t, n) {
440
440
  let r = a.toExternalHTML?.call({ blockContentDOMAttributes: this.blockContentDOMAttributes }, e, t, n);
441
- if (r !== void 0) return E(r, e.type, e.props, i.propSchema, a.meta?.fileBlockAccept !== void 0);
441
+ if (r !== void 0) return k(r, e.type, e.props, i.propSchema, a.meta?.fileBlockAccept !== void 0);
442
442
  },
443
443
  render(e, t) {
444
- return E(a.render.call({
444
+ return k(a.render.call({
445
445
  blockContentDOMAttributes: this.blockContentDOMAttributes,
446
446
  renderType: this.renderType,
447
447
  props: this.props
@@ -454,7 +454,7 @@ function O(e, t, n) {
454
454
  }
455
455
  //#endregion
456
456
  //#region src/api/getBlockInfoFromPos.ts
457
- function Ye(e, t) {
457
+ function Qe(e, t) {
458
458
  let n = e.resolve(t);
459
459
  if (n.nodeAfter && n.nodeAfter.type.isInGroup("bnBlock")) return {
460
460
  posBeforeNode: n.pos,
@@ -478,7 +478,7 @@ function Ye(e, t) {
478
478
  node: o.nodeAfter
479
479
  };
480
480
  }
481
- function Xe(e, t) {
481
+ function $e(e, t) {
482
482
  if (!e.type.isInGroup("bnBlock")) throw Error(`Attempted to get bnBlock node at position but found node of different type ${e.type.name}`);
483
483
  let n = e, r = t, i = {
484
484
  node: n,
@@ -521,45 +521,45 @@ function Xe(e, t) {
521
521
  };
522
522
  }
523
523
  }
524
- function k(e) {
525
- return Xe(e.node, e.posBeforeNode);
524
+ function M(e) {
525
+ return $e(e.node, e.posBeforeNode);
526
526
  }
527
- function Ze(e) {
527
+ function et(e) {
528
528
  if (!e.nodeAfter) throw Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);
529
- return Xe(e.nodeAfter, e.pos);
529
+ return $e(e.nodeAfter, e.pos);
530
530
  }
531
- function Qe(e) {
532
- return k(Ye(e.doc, e.selection.anchor));
531
+ function tt(e) {
532
+ return M(Qe(e.doc, e.selection.anchor));
533
533
  }
534
- function $e(e) {
535
- return k(Ye(e.doc, e.selection.anchor));
534
+ function nt(e) {
535
+ return M(Qe(e.doc, e.selection.anchor));
536
536
  }
537
537
  //#endregion
538
538
  //#region src/api/pmUtil.ts
539
- function A(e) {
539
+ function N(e) {
540
540
  return "doc" in e ? e.doc.type.schema : e.type.schema;
541
541
  }
542
- function et(e) {
542
+ function rt(e) {
543
543
  return e.cached.blockNoteEditor;
544
544
  }
545
- function j(e) {
546
- return et(e).schema;
545
+ function it(e) {
546
+ return rt(e).schema;
547
547
  }
548
- function M(e) {
549
- return j(e).blockSchema;
548
+ function at(e) {
549
+ return it(e).blockSchema;
550
550
  }
551
- function N(e) {
552
- return j(e).inlineContentSchema;
551
+ function ot(e) {
552
+ return it(e).inlineContentSchema;
553
553
  }
554
554
  function P(e) {
555
- return j(e).styleSchema;
555
+ return it(e).styleSchema;
556
556
  }
557
557
  function F(e) {
558
- return et(e).blockCache;
558
+ return rt(e).blockCache;
559
559
  }
560
560
  //#endregion
561
561
  //#region src/api/nodeConversions/nodeToBlock.ts
562
- function tt(e, t, n) {
562
+ function st(e, t, n) {
563
563
  let r = {
564
564
  type: "tableContent",
565
565
  columnWidths: [],
@@ -574,10 +574,10 @@ function tt(e, t, n) {
574
574
  t ??= Array(e.attrs.colspan ?? 1).fill(void 0), r.columnWidths.push(...t);
575
575
  }), s.cells = e.content.content.map((e, r) => (i[o] || (i[o] = []), i[o][r] = e.type.name === "tableHeader", {
576
576
  type: "tableCell",
577
- content: e.content.content.map((e) => nt(e, t, n)).reduce((e, t) => {
577
+ content: e.content.content.map((e) => I(e, t, n)).reduce((e, t) => {
578
578
  if (!e.length) return t;
579
579
  let n = e[e.length - 1], r = t[0];
580
- return r && y(n) && y(r) && JSON.stringify(n.styles) === JSON.stringify(r.styles) ? (n.text += "\n" + r.text, e.push(...t.slice(1)), e) : (e.push(...t), e);
580
+ return r && b(n) && b(r) && JSON.stringify(n.styles) === JSON.stringify(r.styles) ? (n.text += "\n" + r.text, e.push(...t.slice(1)), e) : (e.push(...t), e);
581
581
  }, []),
582
582
  props: {
583
583
  colspan: e.attrs.colspan,
@@ -592,12 +592,12 @@ function tt(e, t, n) {
592
592
  for (let e = 0; e < i[0]?.length; e++) i?.every((t) => t[e]) && (r.headerCols = (r.headerCols ?? 0) + 1);
593
593
  return r;
594
594
  }
595
- function nt(e, t, n) {
595
+ function I(e, t, n) {
596
596
  let r = [], i;
597
597
  return e.content.forEach((e) => {
598
598
  if (e.type.name === "hardBreak") {
599
- if (i) if (y(i)) i.text += "\n";
600
- else if (Ae(i)) i.content[i.content.length - 1].text += "\n";
599
+ if (i) if (b(i)) i.text += "\n";
600
+ else if (Fe(i)) i.content[i.content.length - 1].text += "\n";
601
601
  else throw Error("unexpected");
602
602
  else i = {
603
603
  type: "text",
@@ -611,7 +611,7 @@ function nt(e, t, n) {
611
611
  console.warn("unrecognized inline content type", e.type.name);
612
612
  return;
613
613
  }
614
- i &&= (r.push(i), void 0), r.push(rt(e, t, n));
614
+ i &&= (r.push(i), void 0), r.push(ct(e, t, n));
615
615
  return;
616
616
  }
617
617
  let a = {}, o;
@@ -624,9 +624,9 @@ function nt(e, t, n) {
624
624
  }
625
625
  if (e.propSchema === "boolean") a[e.type] = !0;
626
626
  else if (e.propSchema === "string") a[e.type] = t.attrs.stringValue;
627
- else throw new S(e.propSchema);
627
+ else throw new T(e.propSchema);
628
628
  }
629
- i ? y(i) ? o ? (r.push(i), i = {
629
+ i ? b(i) ? o ? (r.push(i), i = {
630
630
  type: "link",
631
631
  href: o.attrs.href,
632
632
  content: [{
@@ -638,7 +638,7 @@ function nt(e, t, n) {
638
638
  type: "text",
639
639
  text: e.textContent,
640
640
  styles: a
641
- }) : Ae(i) && (o ? i.href === o.attrs.href ? JSON.stringify(i.content[i.content.length - 1].styles) === JSON.stringify(a) ? i.content[i.content.length - 1].text += e.textContent : i.content.push({
641
+ }) : Fe(i) && (o ? i.href === o.attrs.href ? JSON.stringify(i.content[i.content.length - 1].styles) === JSON.stringify(a) ? i.content[i.content.length - 1].text += e.textContent : i.content.push({
642
642
  type: "text",
643
643
  text: e.textContent,
644
644
  styles: a
@@ -669,7 +669,7 @@ function nt(e, t, n) {
669
669
  };
670
670
  }), i && r.push(i), r;
671
671
  }
672
- function rt(e, t, n) {
672
+ function ct(e, t, n) {
673
673
  if (e.type.name === "text" || e.type.name === "link") throw Error("unexpected");
674
674
  let r = {}, i = t[e.type.name];
675
675
  for (let [t, n] of Object.entries(e.attrs)) {
@@ -677,18 +677,18 @@ function rt(e, t, n) {
677
677
  t in i.propSchema && (r[t] = n);
678
678
  }
679
679
  let a;
680
- return a = i.content === "styled" ? nt(e, t, n) : void 0, {
680
+ return a = i.content === "styled" ? I(e, t, n) : void 0, {
681
681
  type: e.type.name,
682
682
  props: r,
683
683
  content: a
684
684
  };
685
685
  }
686
- function I(e, t, n = M(t), r = N(t), i = P(t), a = F(t)) {
686
+ function L(e, t, n = at(t), r = ot(t), i = P(t), a = F(t)) {
687
687
  if (!e.type.isInGroup("bnBlock")) throw Error("Node should be a bnBlock, but is instead: " + e.type.name);
688
688
  let o = a?.get(e);
689
689
  if (o) return o;
690
- let s = Xe(e, 0), c = s.bnBlock.node.attrs.id;
691
- c === null && (c = ke.options.generateID());
690
+ let s = $e(e, 0), c = s.bnBlock.node.attrs.id;
691
+ c === null && (c = Pe.options.generateID());
692
692
  let l = n[s.blockNoteType];
693
693
  if (!l) throw Error("Block is of an unrecognized type: " + s.blockNoteType);
694
694
  let u = {};
@@ -701,17 +701,17 @@ function I(e, t, n = M(t), r = N(t), i = P(t), a = F(t)) {
701
701
  }
702
702
  let d = n[s.blockNoteType], f = [];
703
703
  s.childContainer?.node.forEach((e) => {
704
- f.push(I(e, t, n, r, i, a));
704
+ f.push(L(e, t, n, r, i, a));
705
705
  });
706
706
  let p;
707
707
  if (d.content === "inline") {
708
708
  if (!s.isBlockContainer) throw Error("impossible");
709
- p = nt(s.blockContent.node, r, i);
709
+ p = I(s.blockContent.node, r, i);
710
710
  } else if (d.content === "table") {
711
711
  if (!s.isBlockContainer) throw Error("impossible");
712
- p = tt(s.blockContent.node, r, i);
712
+ p = st(s.blockContent.node, r, i);
713
713
  } else if (d.content === "none") p = void 0;
714
- else throw new S(d.content);
714
+ else throw new T(d.content);
715
715
  let m = {
716
716
  id: c,
717
717
  type: d.type,
@@ -721,11 +721,11 @@ function I(e, t, n = M(t), r = N(t), i = P(t), a = F(t)) {
721
721
  };
722
722
  return a?.set(e, m), m;
723
723
  }
724
- function it(e, t = A(e), n = M(t), r = N(t), i = P(t), a = F(t)) {
724
+ function lt(e, t = N(e), n = at(t), r = ot(t), i = P(t), a = F(t)) {
725
725
  let o = [];
726
- return e.firstChild && e.firstChild.descendants((e) => (o.push(I(e, t, n, r, i, a)), !1)), o;
726
+ return e.firstChild && e.firstChild.descendants((e) => (o.push(L(e, t, n, r, i, a)), !1)), o;
727
727
  }
728
- function at(e, t, n = M(t), r = N(t), i = P(t), a = F(t)) {
728
+ function ut(e, t, n = at(t), r = ot(t), i = P(t), a = F(t)) {
729
729
  function o(e, s, c) {
730
730
  if (e.type.name !== "blockGroup") throw Error("unexpected");
731
731
  let l = [], u, d;
@@ -740,7 +740,7 @@ function at(e, t, n = M(t), r = N(t), i = P(t), a = F(t)) {
740
740
  u = e.blockCutAtStart, g && (d = e.blockCutAtEnd), l.push(...e.blocks);
741
741
  return;
742
742
  }
743
- let _ = I(f, t, n, r, i, a), v = f.childCount > 1 ? f.child(1) : void 0, ee = [];
743
+ let _ = L(f, t, n, r, i, a), v = f.childCount > 1 ? f.child(1) : void 0, ee = [];
744
744
  if (v) {
745
745
  let e = o(v, 0, g ? Math.max(0, c - 1) : 0);
746
746
  ee = e.blocks, g && (d = e.blockCutAtEnd);
@@ -765,23 +765,23 @@ function at(e, t, n = M(t), r = N(t), i = P(t), a = F(t)) {
765
765
  }
766
766
  //#endregion
767
767
  //#region src/schema/inlineContent/internal.ts
768
- function ot(e, t, n, r) {
769
- return e.dom.setAttribute("data-inline-content-type", t), Object.entries(n).filter(([e, t]) => t !== r[e].default).map(([e, t]) => [T(e), t]).forEach(([t, n]) => e.dom.setAttribute(t, n)), e.contentDOM && e.contentDOM.setAttribute("data-editable", ""), e;
768
+ function dt(e, t, n, r) {
769
+ return e.dom.setAttribute("data-inline-content-type", t), Object.entries(n).filter(([e, t]) => t !== r[e].default).map(([e, t]) => [O(e), t]).forEach(([t, n]) => e.dom.setAttribute(t, n)), e.contentDOM && e.contentDOM.setAttribute("data-editable", ""), e;
770
770
  }
771
- function st(e) {
771
+ function ft(e) {
772
772
  return { Backspace: ({ editor: t }) => {
773
773
  let n = t.state.selection.$from;
774
774
  return t.state.selection.empty && n.node().type.name === e.type && n.parentOffset === 0;
775
775
  } };
776
776
  }
777
- function ct(e, t) {
777
+ function pt(e, t) {
778
778
  return {
779
779
  config: e,
780
780
  implementation: t
781
781
  };
782
782
  }
783
- function lt(e, t, n) {
784
- return ct({
783
+ function mt(e, t, n) {
784
+ return pt({
785
785
  type: e.name,
786
786
  propSchema: t,
787
787
  content: e.config.content === "inline*" ? "styled" : "none"
@@ -790,12 +790,12 @@ function lt(e, t, n) {
790
790
  node: e
791
791
  });
792
792
  }
793
- function ut(e) {
793
+ function ht(e) {
794
794
  return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t.config]));
795
795
  }
796
796
  //#endregion
797
797
  //#region src/schema/styles/internal.ts
798
- function dt(e) {
798
+ function gt(e) {
799
799
  return e === "boolean" ? {} : { stringValue: {
800
800
  default: void 0,
801
801
  keepOnSplit: !0,
@@ -803,17 +803,17 @@ function dt(e) {
803
803
  renderHTML: (e) => e.stringValue === void 0 ? {} : { "data-value": e.stringValue }
804
804
  } };
805
805
  }
806
- function L(e, t, n, r) {
806
+ function R(e, t, n, r) {
807
807
  return e.dom.setAttribute("data-style-type", t), r === "string" && e.dom.setAttribute("data-value", n), e.contentDOM && e.contentDOM.setAttribute("data-editable", ""), e;
808
808
  }
809
- function ft(e, t) {
809
+ function _t(e, t) {
810
810
  return {
811
811
  config: e,
812
812
  implementation: t
813
813
  };
814
814
  }
815
- function R(e, t) {
816
- return ft({
815
+ function z(e, t) {
816
+ return _t({
817
817
  type: e.name,
818
818
  propSchema: t
819
819
  }, {
@@ -821,25 +821,25 @@ function R(e, t) {
821
821
  render(t, n) {
822
822
  let r = n.pmSchema.marks[e.name].spec.toDOM;
823
823
  if (r === void 0) throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");
824
- let i = n.pmSchema.mark(e.name, { stringValue: t }), a = re.renderSpec(document, r(i, !0));
824
+ let i = n.pmSchema.mark(e.name, { stringValue: t }), a = ie.renderSpec(document, r(i, !0));
825
825
  if (typeof a != "object" || !("dom" in a)) throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");
826
826
  return a;
827
827
  },
828
828
  toExternalHTML(t, n) {
829
829
  let r = n.pmSchema.marks[e.name].spec.toDOM;
830
830
  if (r === void 0) throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");
831
- let i = n.pmSchema.mark(e.name, { stringValue: t }), a = re.renderSpec(document, r(i, !0));
831
+ let i = n.pmSchema.mark(e.name, { stringValue: t }), a = ie.renderSpec(document, r(i, !0));
832
832
  if (typeof a != "object" || !("dom" in a)) throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");
833
833
  return a;
834
834
  }
835
835
  });
836
836
  }
837
- function pt(e) {
837
+ function vt(e) {
838
838
  return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t.config]));
839
839
  }
840
840
  //#endregion
841
841
  //#region src/schema/styles/createSpec.ts
842
- function mt(e, t) {
842
+ function yt(e, t) {
843
843
  let n = [{
844
844
  tag: `[data-style-type="${e.type}"]`,
845
845
  contentElement: (e) => {
@@ -857,33 +857,33 @@ function mt(e, t) {
857
857
  }
858
858
  }), n;
859
859
  }
860
- function ht(e, t) {
861
- let n = c.create({
860
+ function bt(e, t) {
861
+ let n = l.create({
862
862
  name: e.type,
863
863
  addAttributes() {
864
- return dt(e.propSchema);
864
+ return gt(e.propSchema);
865
865
  },
866
866
  parseHTML() {
867
- return mt(e, t.parse);
867
+ return yt(e, t.parse);
868
868
  },
869
869
  renderHTML({ mark: n }) {
870
- return L((t.toExternalHTML || t.render)(n.attrs.stringValue), e.type, n.attrs.stringValue, e.propSchema);
870
+ return R((t.toExternalHTML || t.render)(n.attrs.stringValue), e.type, n.attrs.stringValue, e.propSchema);
871
871
  },
872
872
  addMarkView() {
873
- return ({ mark: n }) => L(t.render(n.attrs.stringValue), e.type, n.attrs.stringValue, e.propSchema);
873
+ return ({ mark: n }) => R(t.render(n.attrs.stringValue), e.type, n.attrs.stringValue, e.propSchema);
874
874
  }
875
875
  });
876
- return ft(e, {
876
+ return _t(e, {
877
877
  ...t,
878
878
  mark: n,
879
- render: (n) => L(t.render(n), e.type, n, e.propSchema),
880
- toExternalHTML: (n) => L((t.toExternalHTML || t.render)(n), e.type, n, e.propSchema)
879
+ render: (n) => R(t.render(n), e.type, n, e.propSchema),
880
+ toExternalHTML: (n) => R((t.toExternalHTML || t.render)(n), e.type, n, e.propSchema)
881
881
  });
882
882
  }
883
883
  //#endregion
884
884
  //#region src/util/topo-sort.ts
885
- function gt(e) {
886
- let t = vt(e), { roots: n, nonRoots: r } = yt(t), i = [];
885
+ function xt(e) {
886
+ let t = Ct(e), { roots: n, nonRoots: r } = wt(t), i = [];
887
887
  for (; n.size;) {
888
888
  i.push(n);
889
889
  let r = /* @__PURE__ */ new Set();
@@ -898,13 +898,13 @@ function gt(e) {
898
898
  }
899
899
  n = r;
900
900
  }
901
- if (r = yt(t).nonRoots, r.size) throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(", ")}`);
901
+ if (r = wt(t).nonRoots, r.size) throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(", ")}`);
902
902
  return i;
903
903
  }
904
- function _t(e) {
905
- return gt(bt(e));
904
+ function St(e) {
905
+ return xt(Tt(e));
906
906
  }
907
- function vt(e) {
907
+ function Ct(e) {
908
908
  let t = /* @__PURE__ */ new Map();
909
909
  for (let [n, r] of e.entries()) {
910
910
  t.has(n) || t.set(n, 0);
@@ -915,7 +915,7 @@ function vt(e) {
915
915
  }
916
916
  return t;
917
917
  }
918
- function yt(e) {
918
+ function wt(e) {
919
919
  let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
920
920
  for (let [r, i] of e.entries()) i === 0 ? t.add(r) : n.add(r);
921
921
  return {
@@ -923,7 +923,7 @@ function yt(e) {
923
923
  nonRoots: n
924
924
  };
925
925
  }
926
- function bt(e) {
926
+ function Tt(e) {
927
927
  let t = /* @__PURE__ */ new Map();
928
928
  for (let [n, r] of e.entries()) {
929
929
  t.has(n) || t.set(n, /* @__PURE__ */ new Set());
@@ -931,26 +931,26 @@ function bt(e) {
931
931
  }
932
932
  return t;
933
933
  }
934
- function xt() {
934
+ function Et() {
935
935
  return /* @__PURE__ */ new Map();
936
936
  }
937
- function St(e, t, n) {
937
+ function Dt(e, t, n) {
938
938
  return e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n), e;
939
939
  }
940
- function Ct(e) {
941
- let t = xt();
940
+ function Ot(e) {
941
+ let t = Et();
942
942
  for (let n of e) Array.isArray(n.runsBefore) && n.runsBefore.length > 0 ? n.runsBefore.forEach((e) => {
943
- St(t, n.key, e);
944
- }) : St(t, "default", n.key);
945
- let n = _t(t), r = n.findIndex((e) => e.has("default"));
943
+ Dt(t, n.key, e);
944
+ }) : Dt(t, "default", n.key);
945
+ let n = St(t), r = n.findIndex((e) => e.has("default"));
946
946
  return (e) => 91 + (n.findIndex((t) => t.has(e)) + r) * 10;
947
947
  }
948
948
  //#endregion
949
949
  //#region src/schema/schema.ts
950
- function wt(e) {
950
+ function kt(e) {
951
951
  return e && Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
952
952
  }
953
- var Tt = class {
953
+ var At = class {
954
954
  BlockNoteEditor = "only for types";
955
955
  Block = "only for types";
956
956
  PartialBlock = "only for types";
@@ -966,14 +966,14 @@ var Tt = class {
966
966
  this.blockSpecs = t, this.styleSpecs = r, this.styleSchema = o, this.inlineContentSpecs = n, this.blockSchema = i, this.inlineContentSchema = a;
967
967
  }
968
968
  init() {
969
- let e = Ct(Object.entries({
969
+ let e = Ot(Object.entries({
970
970
  ...this.opts.blockSpecs,
971
971
  ...this.opts.inlineContentSpecs,
972
972
  ...this.opts.styleSpecs
973
973
  }).map(([e, t]) => ({
974
974
  key: e,
975
975
  runsBefore: t.implementation?.runsBefore ?? []
976
- }))), t = Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t, n]) => [t, Je(n.config, n.implementation, n.extensions, e(t))])), n = Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t, n]) => typeof n.config == "object" ? [t, {
976
+ }))), t = Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t, n]) => [t, Ze(n.config, n.implementation, n.extensions, e(t))])), n = Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t, n]) => typeof n.config == "object" ? [t, {
977
977
  ...n,
978
978
  implementation: {
979
979
  ...n.implementation,
@@ -989,10 +989,10 @@ var Tt = class {
989
989
  return {
990
990
  blockSpecs: t,
991
991
  blockSchema: Object.fromEntries(Object.entries(t).map(([e, t]) => [e, t.config])),
992
- inlineContentSpecs: wt(n),
993
- styleSpecs: wt(r),
994
- inlineContentSchema: ut(n),
995
- styleSchema: pt(r)
992
+ inlineContentSpecs: kt(n),
993
+ styleSpecs: kt(r),
994
+ inlineContentSchema: ht(n),
995
+ styleSchema: vt(r)
996
996
  };
997
997
  }
998
998
  extend(e) {
@@ -1003,8 +1003,8 @@ var Tt = class {
1003
1003
  };
1004
1004
  //#endregion
1005
1005
  //#region src/api/blockManipulation/tables/tables.ts
1006
- function z(e) {
1007
- let { height: t, width: n } = Et(e), r = Array(t).fill(!1).map(() => Array(n).fill(null)), i = (e, i) => {
1006
+ function B(e) {
1007
+ let { height: t, width: n } = jt(e), r = Array(t).fill(!1).map(() => Array(n).fill(null)), i = (e, i) => {
1008
1008
  for (let a = e; a < t; a++) for (let e = i; e < n; e++) if (!r[a][e]) return {
1009
1009
  row: a,
1010
1010
  col: e
@@ -1012,7 +1012,7 @@ function z(e) {
1012
1012
  throw Error("Unable to create occupancy grid for table, no more available cells");
1013
1013
  };
1014
1014
  for (let t = 0; t < e.content.rows.length; t++) for (let n = 0; n < e.content.rows[t].cells.length; n++) {
1015
- let a = Me(e.content.rows[t].cells[n]), o = Pe(a), s = x(a), { row: c, col: l } = i(t, n);
1015
+ let a = x(e.content.rows[t].cells[n]), o = Le(a), s = w(a), { row: c, col: l } = i(t, n);
1016
1016
  for (let e = c; e < c + o; e++) for (let i = l; i < l + s; i++) {
1017
1017
  if (r[e][i]) throw Error(`Unable to create occupancy grid for table, cell at ${e},${i} is already occupied`);
1018
1018
  r[e][i] = {
@@ -1026,11 +1026,11 @@ function z(e) {
1026
1026
  }
1027
1027
  return r;
1028
1028
  }
1029
- function B(e) {
1029
+ function V(e) {
1030
1030
  let t = /* @__PURE__ */ new Set();
1031
1031
  return e.map((e) => ({ cells: e.map((e) => t.has(e.row + ":" + e.col) ? !1 : (t.add(e.row + ":" + e.col), e.cell)).filter((e) => e !== !1) }));
1032
1032
  }
1033
- function V(e, t, n = z(t)) {
1033
+ function H(e, t, n = B(t)) {
1034
1034
  for (let t = 0; t < n.length; t++) for (let r = 0; r < n[t].length; r++) {
1035
1035
  let i = n[t][r];
1036
1036
  if (i && i.row === e.row && i.col === e.col) return {
@@ -1041,19 +1041,19 @@ function V(e, t, n = z(t)) {
1041
1041
  }
1042
1042
  throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`);
1043
1043
  }
1044
- function Et(e) {
1044
+ function jt(e) {
1045
1045
  let t = e.content.rows.length, n = 0;
1046
1046
  return e.content.rows.forEach((e) => {
1047
1047
  let t = 0;
1048
1048
  e.cells.forEach((e) => {
1049
- t += x(e);
1049
+ t += w(e);
1050
1050
  }), n = Math.max(n, t);
1051
1051
  }), {
1052
1052
  height: t,
1053
1053
  width: n
1054
1054
  };
1055
1055
  }
1056
- function Dt(e, t, n = z(t)) {
1056
+ function Mt(e, t, n = B(t)) {
1057
1057
  let r = n[e.row]?.[e.col];
1058
1058
  if (r) return {
1059
1059
  row: r.row,
@@ -1061,8 +1061,8 @@ function Dt(e, t, n = z(t)) {
1061
1061
  cell: r.cell
1062
1062
  };
1063
1063
  }
1064
- function Ot(e, t) {
1065
- let n = z(e);
1064
+ function Nt(e, t) {
1065
+ let n = B(e);
1066
1066
  if (t < 0 || t >= n.length) return [];
1067
1067
  let r = 0;
1068
1068
  for (let e = 0; e < t; e++) {
@@ -1070,14 +1070,14 @@ function Ot(e, t) {
1070
1070
  if (!e) return [];
1071
1071
  r += e.rowspan;
1072
1072
  }
1073
- let i = Array(n[0].length).fill(!1).map((t, i) => Dt({
1073
+ let i = Array(n[0].length).fill(!1).map((t, i) => Mt({
1074
1074
  row: r,
1075
1075
  col: i
1076
1076
  }, e, n)).filter((e) => e !== void 0);
1077
1077
  return i.filter((e, t) => i.findIndex((t) => t.row === e.row && t.col === e.col) === t);
1078
1078
  }
1079
- function kt(e, t) {
1080
- let n = z(e);
1079
+ function Pt(e, t) {
1080
+ let n = B(e);
1081
1081
  if (t < 0 || t >= n[0].length) return [];
1082
1082
  let r = 0;
1083
1083
  for (let e = 0; e < t; e++) {
@@ -1085,62 +1085,62 @@ function kt(e, t) {
1085
1085
  if (!e) return [];
1086
1086
  r += e.colspan;
1087
1087
  }
1088
- let i = Array(n.length).fill(!1).map((t, i) => Dt({
1088
+ let i = Array(n.length).fill(!1).map((t, i) => Mt({
1089
1089
  row: i,
1090
1090
  col: r
1091
1091
  }, e, n)).filter((e) => e !== void 0);
1092
1092
  return i.filter((e, t) => i.findIndex((t) => t.row === e.row && t.col === e.col) === t);
1093
1093
  }
1094
- function At(e, t, n, r = z(e)) {
1095
- let { col: i } = V({
1094
+ function Ft(e, t, n, r = B(e)) {
1095
+ let { col: i } = H({
1096
1096
  row: 0,
1097
1097
  col: t
1098
- }, e, r), { col: a } = V({
1098
+ }, e, r), { col: a } = H({
1099
1099
  row: 0,
1100
1100
  col: n
1101
1101
  }, e, r);
1102
1102
  return r.forEach((e) => {
1103
1103
  let [t] = e.splice(i, 1);
1104
1104
  e.splice(a, 0, t);
1105
- }), B(r);
1105
+ }), V(r);
1106
1106
  }
1107
- function jt(e, t, n, r = z(e)) {
1108
- let { row: i } = V({
1107
+ function It(e, t, n, r = B(e)) {
1108
+ let { row: i } = H({
1109
1109
  row: t,
1110
1110
  col: 0
1111
- }, e, r), { row: a } = V({
1111
+ }, e, r), { row: a } = H({
1112
1112
  row: n,
1113
1113
  col: 0
1114
1114
  }, e, r), [o] = r.splice(i, 1);
1115
- return r.splice(a, 0, o), B(r);
1115
+ return r.splice(a, 0, o), V(r);
1116
1116
  }
1117
- function Mt(e) {
1118
- return e ? b(e) ? Mt(e.content) : typeof e == "string" ? e.length === 0 : Array.isArray(e) ? e.every((e) => typeof e == "string" ? e.length === 0 : y(e) ? e.text.length === 0 : je(e) ? typeof e.content == "string" ? e.content.length === 0 : e.content.every((e) => e.text.length === 0) : !1) : !1 : !0;
1117
+ function Lt(e) {
1118
+ return e ? S(e) ? Lt(e.content) : typeof e == "string" ? e.length === 0 : Array.isArray(e) ? e.every((e) => typeof e == "string" ? e.length === 0 : b(e) ? e.text.length === 0 : Ie(e) ? typeof e.content == "string" ? e.content.length === 0 : e.content.every((e) => e.text.length === 0) : !1) : !1 : !0;
1119
1119
  }
1120
- function Nt(e, t, n = z(e)) {
1120
+ function Rt(e, t, n = B(e)) {
1121
1121
  if (t === "columns") {
1122
1122
  let e = 0;
1123
- for (let t = n[0].length - 1; t >= 0 && n.every((e) => Mt(e[t].cell) && e[t].colspan === 1); t--) e++;
1123
+ for (let t = n[0].length - 1; t >= 0 && n.every((e) => Lt(e[t].cell) && e[t].colspan === 1); t--) e++;
1124
1124
  for (let t = n.length - 1; t >= 0; t--) {
1125
1125
  let r = Math.max(n[t].length - e, 1);
1126
1126
  n[t] = n[t].slice(0, r);
1127
1127
  }
1128
- return B(n);
1128
+ return V(n);
1129
1129
  }
1130
1130
  let r = 0;
1131
- for (let e = n.length - 1; e >= 0 && n[e].every((e) => Mt(e.cell) && e.rowspan === 1); e--) r++;
1131
+ for (let e = n.length - 1; e >= 0 && n[e].every((e) => Lt(e.cell) && e.rowspan === 1); e--) r++;
1132
1132
  let i = Math.min(r, n.length - 1);
1133
- return n.splice(n.length - i, i), B(n);
1133
+ return n.splice(n.length - i, i), V(n);
1134
1134
  }
1135
- function Pt(e, t, n, r = z(e)) {
1136
- let { width: i, height: a } = Et(e);
1135
+ function zt(e, t, n, r = B(e)) {
1136
+ let { width: i, height: a } = jt(e);
1137
1137
  if (t === "columns") r.forEach((e, t) => {
1138
1138
  if (n >= 0) for (let r = 0; r < n; r++) e.push({
1139
1139
  row: t,
1140
1140
  col: Math.max(...e.map((e) => e.col)) + 1,
1141
1141
  rowspan: 1,
1142
1142
  colspan: 1,
1143
- cell: Me("")
1143
+ cell: x("")
1144
1144
  });
1145
1145
  else e.splice(i + n, -1 * n);
1146
1146
  });
@@ -1150,77 +1150,77 @@ function Pt(e, t, n, r = z(e)) {
1150
1150
  col: n,
1151
1151
  rowspan: 1,
1152
1152
  colspan: 1,
1153
- cell: Me("")
1153
+ cell: x("")
1154
1154
  }));
1155
1155
  r.push(t);
1156
1156
  }
1157
1157
  else n < 0 && r.splice(a + n, -1 * n);
1158
- return B(r);
1158
+ return V(r);
1159
1159
  }
1160
- function Ft(e, t, n) {
1161
- let r = Ot(e, n);
1162
- if (!r.some((e) => Pe(e.cell) > 1)) return !0;
1160
+ function Bt(e, t, n) {
1161
+ let r = Nt(e, n);
1162
+ if (!r.some((e) => Le(e.cell) > 1)) return !0;
1163
1163
  let i = n, a = n;
1164
1164
  return r.forEach((e) => {
1165
- let t = Pe(e.cell);
1165
+ let t = Le(e.cell);
1166
1166
  i = Math.max(i, e.row + t - 1), a = Math.min(a, e.row);
1167
1167
  }), t < n ? n === i : n === a;
1168
1168
  }
1169
- function It(e, t, n) {
1170
- let r = kt(e, n);
1171
- if (!r.some((e) => x(e.cell) > 1)) return !0;
1169
+ function Vt(e, t, n) {
1170
+ let r = Pt(e, n);
1171
+ if (!r.some((e) => w(e.cell) > 1)) return !0;
1172
1172
  let i = n, a = n;
1173
1173
  return r.forEach((e) => {
1174
- let t = x(e.cell);
1174
+ let t = w(e.cell);
1175
1175
  i = Math.max(i, e.col + t - 1), a = Math.min(a, e.col);
1176
1176
  }), t < n ? n === i : n === a;
1177
1177
  }
1178
- function Lt(e, t, n) {
1179
- let r = V(e, n), i = V(t, n);
1178
+ function Ht(e, t, n) {
1179
+ let r = H(e, n), i = H(t, n);
1180
1180
  return r.col === i.col;
1181
1181
  }
1182
1182
  //#endregion
1183
1183
  //#region src/api/nodeConversions/blockToNode.ts
1184
- function Rt(e, t, n, r) {
1184
+ function Ut(e, t, n, r) {
1185
1185
  let i = [];
1186
1186
  for (let [r, a] of Object.entries(e.styles || {})) {
1187
1187
  let e = n[r];
1188
1188
  if (!e) throw Error(`style ${r} not found in styleSchema`);
1189
1189
  if (e.propSchema === "boolean") a && i.push(t.mark(r));
1190
1190
  else if (e.propSchema === "string") a && i.push(t.mark(r, { stringValue: a }));
1191
- else throw new S(e.propSchema);
1191
+ else throw new T(e.propSchema);
1192
1192
  }
1193
1193
  return !r || !t.nodes[r].spec.code ? e.text.split(/(\n)/g).filter((e) => e.length > 0).map((e) => e === "\n" ? t.nodes.hardBreak.createChecked() : t.text(e, i)) : e.text.length > 0 ? [t.text(e.text, i)] : [];
1194
1194
  }
1195
- function zt(e, t, n) {
1195
+ function Wt(e, t, n) {
1196
1196
  let r = t.marks.link.create({ href: e.href });
1197
- return Bt(e.content, t, n).map((e) => {
1197
+ return Gt(e.content, t, n).map((e) => {
1198
1198
  if (e.type.name === "text") return e.mark([...e.marks, r]);
1199
1199
  if (e.type.name === "hardBreak") return e;
1200
1200
  throw Error("unexpected node type");
1201
1201
  });
1202
1202
  }
1203
- function Bt(e, t, n, r) {
1203
+ function Gt(e, t, n, r) {
1204
1204
  let i = [];
1205
- if (typeof e == "string") return i.push(...Rt({
1205
+ if (typeof e == "string") return i.push(...Ut({
1206
1206
  type: "text",
1207
1207
  text: e,
1208
1208
  styles: {}
1209
1209
  }, t, n, r)), i;
1210
- for (let a of e) i.push(...Rt(a, t, n, r));
1210
+ for (let a of e) i.push(...Ut(a, t, n, r));
1211
1211
  return i;
1212
1212
  }
1213
- function H(e, t, n, r = P(t)) {
1213
+ function U(e, t, n, r = P(t)) {
1214
1214
  let i = [];
1215
- for (let a of e) typeof a == "string" ? i.push(...Bt(a, t, r, n)) : je(a) ? i.push(...zt(a, t, r)) : y(a) ? i.push(...Bt([a], t, r, n)) : i.push(Ht(a, t, r));
1215
+ for (let a of e) typeof a == "string" ? i.push(...Gt(a, t, r, n)) : Ie(a) ? i.push(...Wt(a, t, r)) : b(a) ? i.push(...Gt([a], t, r, n)) : i.push(qt(a, t, r));
1216
1216
  return i;
1217
1217
  }
1218
- function Vt(e, t, n = P(t)) {
1218
+ function Kt(e, t, n = P(t)) {
1219
1219
  let r = [], i = Array(e.headerRows ?? 0).fill(!0), a = Array(e.headerCols ?? 0).fill(!0), o = e.columnWidths ?? [];
1220
1220
  for (let s = 0; s < e.rows.length; s++) {
1221
1221
  let c = e.rows[s], l = [], u = i[s];
1222
1222
  for (let r = 0; r < c.cells.length; r++) {
1223
- let i = c.cells[r], d = a[r], f = null, p = V({
1223
+ let i = c.cells[r], d = a[r], f = null, p = H({
1224
1224
  row: s,
1225
1225
  col: r
1226
1226
  }, {
@@ -1228,13 +1228,13 @@ function Vt(e, t, n = P(t)) {
1228
1228
  content: e
1229
1229
  }), m = o[p.col] ? [o[p.col]] : null;
1230
1230
  if (i) if (typeof i == "string") f = t.text(i);
1231
- else if (b(i)) {
1232
- i.content && (f = H(i.content, t, "tableParagraph", n));
1233
- let e = x(i);
1231
+ else if (S(i)) {
1232
+ i.content && (f = U(i.content, t, "tableParagraph", n));
1233
+ let e = w(i);
1234
1234
  e > 1 && (m = Array(e).fill(!1).map((e, t) => o[p.col + t] ?? void 0));
1235
- } else f = H(i, t, "tableParagraph", n);
1235
+ } else f = U(i, t, "tableParagraph", n);
1236
1236
  let h = t.nodes[d || u ? "tableHeader" : "tableCell"].createChecked({
1237
- ...b(i) ? i.props : {},
1237
+ ...S(i) ? i.props : {},
1238
1238
  colwidth: m
1239
1239
  }, t.nodes.tableParagraph.createChecked(void 0, f));
1240
1240
  l.push(h);
@@ -1244,34 +1244,34 @@ function Vt(e, t, n = P(t)) {
1244
1244
  }
1245
1245
  return r;
1246
1246
  }
1247
- function Ht(e, t, n) {
1247
+ function qt(e, t, n) {
1248
1248
  let r, i = e.type;
1249
1249
  if (i === void 0 && (i = "paragraph"), !t.nodes[i]) throw Error(`node type ${i} not found in schema`);
1250
1250
  if (!e.content) r = t.nodes[i].createChecked(e.props);
1251
1251
  else if (typeof e.content == "string") {
1252
- let a = H([e.content], t, i, n);
1252
+ let a = U([e.content], t, i, n);
1253
1253
  r = t.nodes[i].createChecked(e.props, a);
1254
1254
  } else if (Array.isArray(e.content)) {
1255
- let a = H(e.content, t, i, n);
1255
+ let a = U(e.content, t, i, n);
1256
1256
  r = t.nodes[i].createChecked(e.props, a);
1257
1257
  } else if (e.content.type === "tableContent") {
1258
- let a = Vt(e.content, t, n);
1258
+ let a = Kt(e.content, t, n);
1259
1259
  r = t.nodes[i].createChecked(e.props, a);
1260
- } else throw new S(e.content.type);
1260
+ } else throw new T(e.content.type);
1261
1261
  return r;
1262
1262
  }
1263
- function U(e, t, n = P(t)) {
1263
+ function W(e, t, n = P(t)) {
1264
1264
  let r = e.id;
1265
- r === void 0 && (r = ke.options.generateID());
1265
+ r === void 0 && (r = Pe.options.generateID());
1266
1266
  let i = [];
1267
- if (e.children) for (let r of e.children) i.push(U(r, t, n));
1267
+ if (e.children) for (let r of e.children) i.push(W(r, t, n));
1268
1268
  if (!e.type || t.nodes[e.type].isInGroup("blockContent")) {
1269
- let a = Ht(e, t, n), o = i.length > 0 ? t.nodes.blockGroup.createChecked({}, i) : void 0;
1269
+ let a = qt(e, t, n), o = i.length > 0 ? t.nodes.blockGroup.createChecked({}, i) : void 0;
1270
1270
  return t.nodes.blockContainer.createChecked({
1271
1271
  id: r,
1272
1272
  ...e.props
1273
1273
  }, o ? [a, o] : a);
1274
- } else if (t.nodes[e.type].isInGroup("bnBlock")) return t.nodes[e.type].createChecked({
1274
+ } else if (t.nodes[e.type].isInGroup("bnBlock")) return t.nodes[e.type].create({
1275
1275
  id: r,
1276
1276
  ...e.props
1277
1277
  }, i);
@@ -1279,48 +1279,48 @@ function U(e, t, n = P(t)) {
1279
1279
  }
1280
1280
  //#endregion
1281
1281
  //#region src/api/nodeUtil.ts
1282
- function Ut(e, t) {
1282
+ function Jt(e, t) {
1283
1283
  let n, r;
1284
- if (t.firstChild.descendants((t, i) => n ? !1 : !Wt(t) || t.attrs.id !== e ? !0 : (n = t, r = i + 1, !1)), !(n === void 0 || r === void 0)) return {
1284
+ if (t.firstChild.descendants((t, i) => n ? !1 : !Yt(t) || t.attrs.id !== e ? !0 : (n = t, r = i + 1, !1)), !(n === void 0 || r === void 0)) return {
1285
1285
  node: n,
1286
1286
  posBeforeNode: r
1287
1287
  };
1288
1288
  }
1289
- function Wt(e) {
1289
+ function Yt(e) {
1290
1290
  return e.type.isInGroup("bnBlock");
1291
1291
  }
1292
1292
  //#endregion
1293
1293
  //#region src/api/blockManipulation/commands/updateBlock/updateBlock.ts
1294
- var Gt = (e, t) => ({ tr: n, dispatch: r }) => (r && W(n, e, t), !0);
1295
- function W(e, t, n, r, i) {
1296
- let a = Ze(e.doc.resolve(t)), o = null;
1297
- a.blockNoteType === "table" && (o = Yt(e));
1298
- let s = A(e);
1294
+ var Xt = (e, t) => ({ tr: n, dispatch: r }) => (r && Zt(n, e, t), !0);
1295
+ function Zt(e, t, n, r, i) {
1296
+ let a = et(e.doc.resolve(t)), o = null;
1297
+ a.blockNoteType === "table" && (o = tn(e));
1298
+ let s = N(e);
1299
1299
  if (r !== void 0 && i !== void 0 && r > i) throw Error("Invalid replaceFromPos or replaceToPos");
1300
1300
  let c = s.nodes[a.blockNoteType], l = s.nodes[n.type || a.blockNoteType], u = l.isInGroup("bnBlock") ? l : s.nodes.blockContainer;
1301
1301
  if (a.isBlockContainer && l.isInGroup("blockContent")) {
1302
1302
  let t = r !== void 0 && r > a.blockContent.beforePos && r < a.blockContent.afterPos ? r - a.blockContent.beforePos - 1 : void 0, o = i !== void 0 && i > a.blockContent.beforePos && i < a.blockContent.afterPos ? i - a.blockContent.beforePos - 1 : void 0;
1303
- qt(n, e, a), Kt(n, e, c, l, a, t, o);
1304
- } else if (!a.isBlockContainer && l.isInGroup("bnBlock")) qt(n, e, a);
1303
+ $t(n, e, a), Qt(n, e, c, l, a, t, o);
1304
+ } else if (!a.isBlockContainer && l.isInGroup("bnBlock")) $t(n, e, a);
1305
1305
  else {
1306
- let t = I(a.bnBlock.node, s);
1307
- e.replaceWith(a.bnBlock.beforePos, a.bnBlock.afterPos, U({
1308
- children: t.children,
1306
+ let t = W({
1307
+ children: L(a.bnBlock.node, s).children,
1309
1308
  ...n
1310
- }, s));
1309
+ }, s);
1310
+ t.check(), e.replaceWith(a.bnBlock.beforePos, a.bnBlock.afterPos, t);
1311
1311
  return;
1312
1312
  }
1313
1313
  e.setNodeMarkup(a.bnBlock.beforePos, u, {
1314
1314
  ...a.bnBlock.node.attrs,
1315
1315
  ...n.props
1316
- }), o && Xt(e, a, o);
1317
- }
1318
- function Kt(e, t, n, a, o, s, c) {
1319
- let l = A(t), u = "keep";
1320
- if (e.content) if (typeof e.content == "string") u = H([e.content], l, a.name);
1321
- else if (Array.isArray(e.content)) u = H(e.content, l, a.name);
1322
- else if (e.content.type === "tableContent") u = Vt(e.content, l);
1323
- else throw new S(e.content.type);
1316
+ }), o && nn(e, a, o);
1317
+ }
1318
+ function Qt(e, t, n, a, o, s, c) {
1319
+ let l = N(t), u = "keep";
1320
+ if (e.content) if (typeof e.content == "string") u = U([e.content], l, a.name);
1321
+ else if (Array.isArray(e.content)) u = U(e.content, l, a.name);
1322
+ else if (e.content.type === "tableContent") u = Kt(e.content, l);
1323
+ else throw new T(e.content.type);
1324
1324
  else n.spec.content === "" || a.spec.content !== n.spec.content && (u = []);
1325
1325
  if (u === "keep") t.setNodeMarkup(o.blockContent.beforePos, a, {
1326
1326
  ...o.blockContent.node.attrs,
@@ -1338,10 +1338,13 @@ function Kt(e, t, n, a, o, s, c) {
1338
1338
  ...e.props
1339
1339
  }, u));
1340
1340
  }
1341
- function qt(e, t, n) {
1342
- let a = A(t);
1341
+ function $t(e, t, n) {
1342
+ let a = N(t);
1343
1343
  if (e.children !== void 0 && e.children.length > 0) {
1344
- let s = e.children.map((e) => U(e, a));
1344
+ let s = e.children.map((e) => {
1345
+ let t = W(e, a);
1346
+ return t.check(), t;
1347
+ });
1345
1348
  if (n.childContainer) t.step(new o(n.childContainer.beforePos + 1, n.childContainer.afterPos - 1, new i(r.from(s), 0, 0)));
1346
1349
  else {
1347
1350
  if (!n.isBlockContainer) throw Error("impossible");
@@ -1349,14 +1352,14 @@ function qt(e, t, n) {
1349
1352
  }
1350
1353
  }
1351
1354
  }
1352
- function Jt(e, t, n, r, i) {
1353
- let a = typeof t == "string" ? t : t.id, o = Ut(a, e.doc);
1355
+ function en(e, t, n, r, i) {
1356
+ let a = typeof t == "string" ? t : t.id, o = Jt(a, e.doc);
1354
1357
  if (!o) throw Error(`Block with ID ${a} not found`);
1355
- return W(e, o.posBeforeNode, n, r, i), I(e.doc.resolve(o.posBeforeNode + 1).node(), A(e));
1358
+ return Zt(e, o.posBeforeNode, n, r, i), L(e.doc.resolve(o.posBeforeNode + 1).node(), N(e));
1356
1359
  }
1357
- function Yt(e) {
1360
+ function tn(e) {
1358
1361
  let t = "selection" in e ? e.selection : null;
1359
- if (!(t instanceof ee)) return null;
1362
+ if (!(t instanceof y)) return null;
1360
1363
  let n = e.doc.resolve(t.head), r = -1, i = -1;
1361
1364
  for (let e = n.depth; e >= 0; e--) {
1362
1365
  let t = n.node(e).type.name;
@@ -1368,7 +1371,7 @@ function Yt(e) {
1368
1371
  if (r < 0 || i < 0) return null;
1369
1372
  let a = n.before(r), o = n.before(i), s = e.doc.nodeAt(o);
1370
1373
  if (!s || s.type.name !== "table") return null;
1371
- let c = oe.get(s), l = a - (o + 1), u = c.map.indexOf(l);
1374
+ let c = se.get(s), l = a - (o + 1), u = c.map.indexOf(l);
1372
1375
  if (u < 0) return null;
1373
1376
  let d = Math.floor(u / c.width), f = u % c.width, p = a + 1 + 1;
1374
1377
  return {
@@ -1377,7 +1380,7 @@ function Yt(e) {
1377
1380
  offset: Math.max(0, t.head - p)
1378
1381
  };
1379
1382
  }
1380
- function Xt(e, t, n) {
1383
+ function nn(e, t, n) {
1381
1384
  if (t.blockNoteType !== "table") return !1;
1382
1385
  let r = -1;
1383
1386
  if (t.isBlockContainer) r = e.mapping.map(t.blockContent.beforePos);
@@ -1387,10 +1390,10 @@ function Xt(e, t, n) {
1387
1390
  }
1388
1391
  let i = r >= 0 ? e.doc.nodeAt(r) : null;
1389
1392
  if (!i || i.type.name !== "table") return !1;
1390
- let a = oe.get(i), o = Math.max(0, Math.min(n.row, a.height - 1)), s = Math.max(0, Math.min(n.col, a.width - 1)), c = o * a.width + s, l = a.map[c];
1393
+ let a = se.get(i), o = Math.max(0, Math.min(n.row, a.height - 1)), s = Math.max(0, Math.min(n.col, a.width - 1)), c = o * a.width + s, l = a.map[c];
1391
1394
  if (l == null) return !1;
1392
1395
  let u = r + 1 + l + 1, d = e.doc.nodeAt(u), f = u + 1, p = d ? d.content.size : 0, m = f + Math.max(0, Math.min(n.offset, p));
1393
- return "selection" in e && e.setSelection(ee.create(e.doc, m)), !0;
1396
+ return "selection" in e && e.setSelection(y.create(e.doc, m)), !0;
1394
1397
  }
1395
1398
  //#endregion
1396
1399
  //#region src/editor/defaultColors.ts
@@ -1431,7 +1434,7 @@ var G = {
1431
1434
  text: "#ad1a72",
1432
1435
  background: "#f4dfeb"
1433
1436
  }
1434
- }, Zt = {
1437
+ }, rn = {
1435
1438
  gray: {
1436
1439
  text: "#bebdb8",
1437
1440
  background: "#9b9a97"
@@ -1485,19 +1488,19 @@ var G = {
1485
1488
  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 = K.textAlignment.values.includes(e.style.textAlign) ? e.style.textAlign : void 0, t;
1486
1489
  }, J = (e, t) => {
1487
1490
  e.backgroundColor && e.backgroundColor !== K.backgroundColor.default && (t.style.backgroundColor = e.backgroundColor in G ? G[e.backgroundColor].background : e.backgroundColor), e.textColor && e.textColor !== K.textColor.default && (t.style.color = e.textColor in G ? G[e.textColor].text : e.textColor), e.textAlignment && e.textAlignment !== K.textAlignment.default && (t.style.textAlign = e.textAlignment);
1488
- }, Qt = (e = "backgroundColor") => ({
1491
+ }, an = (e = "backgroundColor") => ({
1489
1492
  default: K.backgroundColor.default,
1490
1493
  parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : e.style.backgroundColor ? e.style.backgroundColor : K.backgroundColor.default,
1491
1494
  renderHTML: (t) => t[e] === K.backgroundColor.default ? {} : { "data-background-color": t[e] }
1492
- }), $t = (e = "textColor") => ({
1495
+ }), on = (e = "textColor") => ({
1493
1496
  default: K.textColor.default,
1494
1497
  parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : e.style.color ? e.style.color : K.textColor.default,
1495
1498
  renderHTML: (t) => t[e] === K.textColor.default ? {} : { "data-text-color": t[e] }
1496
- }), en = (e = "textAlignment") => ({
1499
+ }), sn = (e = "textAlignment") => ({
1497
1500
  default: K.textAlignment.default,
1498
1501
  parseHTML: (e) => e.hasAttribute("data-text-alignment") ? e.getAttribute("data-text-alignment") : e.style.textAlign ? e.style.textAlign : K.textAlignment.default,
1499
1502
  renderHTML: (t) => t[e] === K.textAlignment.default ? {} : { "data-text-alignment": t[e] }
1500
- }), tn = (e, t) => {
1503
+ }), cn = (e, t) => {
1501
1504
  let n = e.querySelector(t);
1502
1505
  if (n) return {
1503
1506
  targetElement: n,
@@ -1522,7 +1525,7 @@ var G = {
1522
1525
  n.setState(e);
1523
1526
  }
1524
1527
  };
1525
- }), nn = (e, t, n) => {
1528
+ }), ln = (e, t, n) => {
1526
1529
  let r = document.createElement("div");
1527
1530
  r.className = "bn-add-file-button";
1528
1531
  let i = document.createElement("div");
@@ -1540,51 +1543,51 @@ var G = {
1540
1543
  r.removeEventListener("mousedown", o, !0), r.removeEventListener("click", s, !0);
1541
1544
  }
1542
1545
  };
1543
- }, rn = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\"></path></svg>", an = (e) => {
1546
+ }, un = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\"></path></svg>", dn = (e) => {
1544
1547
  let t = document.createElement("div");
1545
1548
  t.className = "bn-file-name-with-icon";
1546
1549
  let n = document.createElement("div");
1547
- n.className = "bn-file-icon", n.innerHTML = rn, t.appendChild(n);
1550
+ n.className = "bn-file-icon", n.innerHTML = un, t.appendChild(n);
1548
1551
  let r = document.createElement("p");
1549
1552
  return r.className = "bn-file-name", r.textContent = e.props.name, t.appendChild(r), { dom: t };
1550
- }, on = (e, t, n, r) => {
1551
- let i = document.createElement("div");
1552
- if (i.className = "bn-file-block-content-wrapper", e.props.url === "") {
1553
- let n = nn(e, t, r);
1554
- i.appendChild(n.dom);
1555
- let a = t.onUploadStart((t) => {
1553
+ }, fn = (e, t, n, r) => {
1554
+ let i = e.props.url !== "" && !!e.props.caption, a = document.createElement(i ? "figure" : "div");
1555
+ if (a.className = "bn-file-block-content-wrapper", e.props.url === "") {
1556
+ let n = ln(e, t, r);
1557
+ a.appendChild(n.dom);
1558
+ let i = t.onUploadStart((t) => {
1556
1559
  if (t === e.id) {
1557
- i.removeChild(n.dom);
1560
+ a.removeChild(n.dom);
1558
1561
  let e = document.createElement("div");
1559
- e.className = "bn-file-loading-preview", e.textContent = "Loading...", i.appendChild(e);
1562
+ e.className = "bn-file-loading-preview", e.textContent = "Loading...", a.appendChild(e);
1560
1563
  }
1561
1564
  });
1562
1565
  return {
1563
- dom: i,
1566
+ dom: a,
1564
1567
  destroy: () => {
1565
- a(), n.destroy();
1568
+ i(), n.destroy();
1566
1569
  }
1567
1570
  };
1568
1571
  }
1569
- let a = { dom: i };
1572
+ let o = { dom: a };
1570
1573
  if (e.props.showPreview === !1 || !n) {
1571
- let t = an(e);
1572
- i.appendChild(t.dom), a.destroy = () => {
1574
+ let t = dn(e);
1575
+ a.appendChild(t.dom), o.destroy = () => {
1573
1576
  t.destroy?.();
1574
1577
  };
1575
- } else i.appendChild(n.dom);
1578
+ } else a.appendChild(n.dom);
1576
1579
  if (e.props.caption) {
1577
- let t = document.createElement("p");
1578
- t.className = "bn-file-caption", t.textContent = e.props.caption, i.appendChild(t);
1580
+ let t = document.createElement("figcaption");
1581
+ t.className = "bn-file-caption", t.textContent = e.props.caption, a.appendChild(t);
1579
1582
  }
1580
- return a;
1581
- }, sn = (e, t) => {
1583
+ return o;
1584
+ }, pn = (e, t) => {
1582
1585
  let n = document.createElement("figure"), r = document.createElement("figcaption");
1583
1586
  return r.textContent = t, n.appendChild(e), n.appendChild(r), { dom: n };
1584
- }, X = (e, t) => {
1587
+ }, mn = (e, t) => {
1585
1588
  let n = document.createElement("div"), r = document.createElement("p");
1586
1589
  return r.textContent = t, n.appendChild(e), n.appendChild(r), { dom: n };
1587
- }, cn = (e) => ({ url: e.src || void 0 }), ln = "<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>", un = D((e) => ({
1590
+ }, hn = (e) => ({ url: e.src || void 0 }), gn = "<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>", _n = A((e) => ({
1588
1591
  type: "audio",
1589
1592
  propSchema: {
1590
1593
  backgroundColor: K.backgroundColor,
@@ -1594,56 +1597,53 @@ var G = {
1594
1597
  showPreview: { default: !0 }
1595
1598
  },
1596
1599
  content: "none"
1597
- })), dn = (e = {}) => (e) => {
1600
+ })), vn = (e = {}) => (e) => {
1598
1601
  if (e.tagName === "AUDIO") {
1599
1602
  if (e.closest("figure")) return;
1600
1603
  let { backgroundColor: t } = q(e);
1601
1604
  return {
1602
- ...cn(e),
1605
+ ...hn(e),
1603
1606
  backgroundColor: t
1604
1607
  };
1605
1608
  }
1606
1609
  if (e.tagName === "FIGURE") {
1607
- let t = tn(e, "audio");
1610
+ let t = cn(e, "audio");
1608
1611
  if (!t) return;
1609
1612
  let { targetElement: n, caption: r } = t, { backgroundColor: i } = q(e);
1610
1613
  return {
1611
- ...cn(n),
1614
+ ...hn(n),
1612
1615
  backgroundColor: i,
1613
1616
  caption: r
1614
1617
  };
1615
1618
  }
1616
- }, fn = (e = {}) => (t, n) => {
1619
+ }, yn = (e = {}) => (t, n) => {
1617
1620
  let r = document.createElement("div");
1618
1621
  r.innerHTML = e.icon ?? "<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>";
1619
1622
  let i = document.createElement("audio");
1620
1623
  return i.className = "bn-audio", n.resolveFileUrl ? n.resolveFileUrl(t.props.url).then((e) => {
1621
1624
  i.src = e;
1622
- }) : i.src = t.props.url, i.controls = !0, i.contentEditable = "false", i.draggable = !1, on(t, n, { dom: i }, r.firstElementChild);
1623
- }, pn = (e = {}) => (e, t) => {
1624
- if (!e.props.url) {
1625
- let e = document.createElement("p");
1626
- return e.textContent = "Add audio", { dom: e };
1627
- }
1625
+ }) : i.src = t.props.url, i.controls = !0, i.contentEditable = "false", i.draggable = !1, fn(t, n, { dom: i }, r.firstElementChild);
1626
+ }, bn = (e = {}) => (e, t) => {
1627
+ if (!e.props.url) return { dom: document.createElement("audio") };
1628
1628
  let n;
1629
- return e.props.showPreview ? (n = document.createElement("audio"), n.src = e.props.url) : (n = document.createElement("a"), n.href = e.props.url, n.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? sn(n, e.props.caption) : X(n, e.props.caption) : { dom: n };
1630
- }, mn = O(un, (e) => ({
1629
+ return e.props.showPreview ? (n = document.createElement("audio"), n.src = e.props.url) : (n = document.createElement("a"), n.href = e.props.url, n.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? pn(n, e.props.caption) : mn(n, e.props.caption) : { dom: n };
1630
+ }, xn = j(_n, (e) => ({
1631
1631
  meta: { fileBlockAccept: ["audio/*"] },
1632
- parse: dn(e),
1633
- render: fn(e),
1634
- toExternalHTML: pn(e),
1632
+ parse: vn(e),
1633
+ render: yn(e),
1634
+ toExternalHTML: bn(e),
1635
1635
  runsBefore: ["file"]
1636
- })), hn = Symbol.for("blocknote.shikiParser"), gn = Symbol.for("blocknote.shikiHighlighterPromise");
1637
- function _n(e) {
1636
+ })), Sn = Symbol.for("blocknote.shikiParser"), Cn = Symbol.for("blocknote.shikiHighlighterPromise");
1637
+ function wn(e) {
1638
1638
  let t = globalThis, n, r, i = !1;
1639
- return de({
1639
+ return ge({
1640
1640
  parser: (a) => {
1641
1641
  if (!e.createHighlighter) return process.env.NODE_ENV === "development" && !i && (console.log("For syntax highlighting of code blocks, you must provide a `createCodeBlockSpec({ createHighlighter: () => ... })` function"), i = !0), [];
1642
- if (!n) return t[gn] = t[gn] || e.createHighlighter(), t[gn].then((e) => {
1642
+ if (!n) return t[Cn] = t[Cn] || e.createHighlighter(), t[Cn].then((e) => {
1643
1643
  n = e;
1644
1644
  });
1645
- let o = bn(e, a.language);
1646
- return !o || o === "text" || o === "none" || o === "plaintext" || o === "txt" ? [] : n.getLoadedLanguages().includes(o) ? (r || (r = t[hn] || fe(n), t[hn] = r), r(a)) : n.loadLanguage(o);
1645
+ let o = Dn(e, a.language);
1646
+ return !o || o === "text" || o === "none" || o === "plaintext" || o === "txt" ? [] : n.getLoadedLanguages().includes(o) ? (r || (r = t[Sn] || _e(n), t[Sn] = r), r(a)) : n.loadLanguage(o);
1647
1647
  },
1648
1648
  languageExtractor: (e) => e.attrs.language,
1649
1649
  nodeTypes: ["codeBlock"]
@@ -1651,11 +1651,11 @@ function _n(e) {
1651
1651
  }
1652
1652
  //#endregion
1653
1653
  //#region src/blocks/Code/block.ts
1654
- var vn = D(({ defaultLanguage: e = "text" }) => ({
1654
+ var Tn = A(({ defaultLanguage: e = "text" }) => ({
1655
1655
  type: "codeBlock",
1656
1656
  propSchema: { language: { default: e } },
1657
1657
  content: "inline"
1658
- })), yn = O(vn, (e) => ({
1658
+ })), En = j(Tn, (e) => ({
1659
1659
  meta: {
1660
1660
  code: !0,
1661
1661
  defining: !0,
@@ -1667,7 +1667,7 @@ var vn = D(({ defaultLanguage: e = "text" }) => ({
1667
1667
  return { language: t.getAttribute("data-language") || t.className.split(" ").find((e) => e.includes("language-"))?.replace("language-", "") };
1668
1668
  },
1669
1669
  parseContent: ({ el: e, schema: t }) => {
1670
- let n = ne.fromSchema(t), r = e.firstElementChild;
1670
+ let n = re.fromSchema(t), r = e.firstElementChild;
1671
1671
  return n.parse(r, {
1672
1672
  preserveWhitespace: "full",
1673
1673
  topNode: t.nodes.codeBlock.create()
@@ -1709,7 +1709,7 @@ var vn = D(({ defaultLanguage: e = "text" }) => ({
1709
1709
  }
1710
1710
  }), (e) => [t({
1711
1711
  key: "code-block-highlighter",
1712
- prosemirrorPlugins: [_n(e)]
1712
+ prosemirrorPlugins: [wn(e)]
1713
1713
  }), t({
1714
1714
  key: "code-block-keyboard-shortcuts",
1715
1715
  keyboardShortcuts: {
@@ -1747,22 +1747,22 @@ var vn = D(({ defaultLanguage: e = "text" }) => ({
1747
1747
  let n = t[1].trim();
1748
1748
  return {
1749
1749
  type: "codeBlock",
1750
- props: { language: { language: bn(e, n) ?? n }.language },
1750
+ props: { language: { language: Dn(e, n) ?? n }.language },
1751
1751
  content: []
1752
1752
  };
1753
1753
  }
1754
1754
  }]
1755
1755
  })]);
1756
- function bn(e, t) {
1756
+ function Dn(e, t) {
1757
1757
  return Object.entries(e.supportedLanguages ?? {}).find(([e, { aliases: n }]) => n?.includes(t) || e === t)?.[0];
1758
1758
  }
1759
1759
  //#endregion
1760
1760
  //#region src/blocks/Divider/block.ts
1761
- var xn = D(() => ({
1761
+ var On = A(() => ({
1762
1762
  type: "divider",
1763
1763
  propSchema: {},
1764
1764
  content: "none"
1765
- })), Sn = O(xn, {
1765
+ })), kn = j(On, {
1766
1766
  meta: { isolating: !1 },
1767
1767
  parse(e) {
1768
1768
  if (e.tagName === "HR") return {};
@@ -1782,7 +1782,7 @@ var xn = D(() => ({
1782
1782
  };
1783
1783
  }
1784
1784
  }]
1785
- })]), Cn = (e) => ({ url: e.src || void 0 }), wn = D(() => ({
1785
+ })]), An = (e) => ({ url: e.src || void 0 }), jn = A(() => ({
1786
1786
  type: "file",
1787
1787
  propSchema: {
1788
1788
  backgroundColor: K.backgroundColor,
@@ -1791,47 +1791,44 @@ var xn = D(() => ({
1791
1791
  caption: { default: "" }
1792
1792
  },
1793
1793
  content: "none"
1794
- })), Tn = () => (e) => {
1794
+ })), Mn = () => (e) => {
1795
1795
  if (e.tagName === "EMBED") {
1796
1796
  if (e.closest("figure")) return;
1797
1797
  let { backgroundColor: t } = q(e);
1798
1798
  return {
1799
- ...Cn(e),
1799
+ ...An(e),
1800
1800
  backgroundColor: t
1801
1801
  };
1802
1802
  }
1803
1803
  if (e.tagName === "FIGURE") {
1804
- let t = tn(e, "embed");
1804
+ let t = cn(e, "embed");
1805
1805
  if (!t) return;
1806
1806
  let { targetElement: n, caption: r } = t, { backgroundColor: i } = q(e);
1807
1807
  return {
1808
- ...Cn(n),
1808
+ ...An(n),
1809
1809
  backgroundColor: i,
1810
1810
  caption: r
1811
1811
  };
1812
1812
  }
1813
- }, En = O(wn, {
1813
+ }, Nn = j(jn, {
1814
1814
  meta: { fileBlockAccept: ["*/*"] },
1815
- parse: Tn(),
1815
+ parse: Mn(),
1816
1816
  render(e, t) {
1817
- return on(e, t);
1817
+ return fn(e, t);
1818
1818
  },
1819
1819
  toExternalHTML(e) {
1820
- if (!e.props.url) {
1821
- let e = document.createElement("p");
1822
- return e.textContent = "Add file", { dom: e };
1823
- }
1820
+ if (!e.props.url) return { dom: document.createElement("embed") };
1824
1821
  let t = document.createElement("a");
1825
- return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? X(t, e.props.caption) : { dom: t };
1822
+ return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? mn(t, e.props.caption) : { dom: t };
1826
1823
  }
1827
1824
  });
1828
1825
  //#endregion
1829
1826
  //#region src/blocks/getDetailsContent.ts
1830
- function Dn(e, t, i) {
1827
+ function Pn(e, t, i) {
1831
1828
  let a = n.fromSchema(t), o = e.querySelector(":scope > summary"), s;
1832
1829
  if (o) {
1833
1830
  let e = o.cloneNode(!0);
1834
- Be(e), s = a.parse(e, {
1831
+ Ue(e), s = a.parse(e, {
1835
1832
  topNode: t.nodes.paragraph.create(),
1836
1833
  preserveWhitespace: !0
1837
1834
  }).content;
@@ -1847,10 +1844,10 @@ function Dn(e, t, i) {
1847
1844
  }
1848
1845
  //#endregion
1849
1846
  //#region src/blocks/ToggleWrapper/createToggleWrapper.ts
1850
- var On = {
1847
+ var Fn = {
1851
1848
  set: (e, t) => window.localStorage.setItem(`toggle-${e.id}`, t ? "true" : "false"),
1852
1849
  get: (e) => window.localStorage.getItem(`toggle-${e.id}`) === "true"
1853
- }, kn = (e, t, n, r = On) => {
1850
+ }, In = (e, t, n, r = Fn) => {
1854
1851
  if ("isToggleable" in e.props && !e.props.isToggleable) return { dom: n };
1855
1852
  let i = document.createElement("div"), a = document.createElement("div");
1856
1853
  a.className = "bn-toggle-wrapper";
@@ -1884,20 +1881,20 @@ var On = {
1884
1881
  o.removeEventListener("mousedown", s), o.removeEventListener("click", c), l.removeEventListener("mousedown", u), l.removeEventListener("click", d), p?.();
1885
1882
  }
1886
1883
  };
1887
- }, An = [
1884
+ }, Ln = [
1888
1885
  1,
1889
1886
  2,
1890
1887
  3,
1891
1888
  4,
1892
1889
  5,
1893
1890
  6
1894
- ], jn = (e) => ({ editor: t }) => {
1891
+ ], Rn = (e) => ({ editor: t }) => {
1895
1892
  let n = t.getTextCursorPosition();
1896
1893
  return t.schema.blockSchema[n.block.type].content === "inline" ? (t.updateBlock(n.block, {
1897
1894
  type: "heading",
1898
1895
  props: { level: e }
1899
1896
  }), !0) : !1;
1900
- }, Mn = D(({ defaultLevel: e = 1, levels: t = An, allowToggleHeadings: n = !0 } = {}) => ({
1897
+ }, zn = A(({ defaultLevel: e = 1, levels: t = Ln, allowToggleHeadings: n = !0 } = {}) => ({
1901
1898
  type: "heading",
1902
1899
  propSchema: {
1903
1900
  ...K,
@@ -1911,7 +1908,7 @@ var On = {
1911
1908
  } } : {}
1912
1909
  },
1913
1910
  content: "inline"
1914
- })), Nn = O(Mn, ({ allowToggleHeadings: e = !0 } = {}) => ({
1911
+ })), Bn = j(zn, ({ allowToggleHeadings: e = !0 } = {}) => ({
1915
1912
  meta: { isolating: !1 },
1916
1913
  parse(t) {
1917
1914
  if (e && t.tagName === "DETAILS") {
@@ -1952,13 +1949,13 @@ var On = {
1952
1949
  };
1953
1950
  },
1954
1951
  ...e ? { parseContent: ({ el: e, schema: t }) => {
1955
- if (e.tagName === "DETAILS") return Dn(e, t, "heading");
1952
+ if (e.tagName === "DETAILS") return Pn(e, t, "heading");
1956
1953
  } } : {},
1957
1954
  runsBefore: ["toggleListItem"],
1958
1955
  render(t, n) {
1959
1956
  let r = document.createElement(`h${t.props.level}`);
1960
1957
  return e ? {
1961
- ...kn(t, n, r),
1958
+ ...In(t, n, r),
1962
1959
  contentDOM: r
1963
1960
  } : {
1964
1961
  dom: r,
@@ -1982,9 +1979,9 @@ var On = {
1982
1979
  contentDOM: n
1983
1980
  };
1984
1981
  }
1985
- }), ({ levels: e = An } = {}) => [t({
1982
+ }), ({ levels: e = Ln } = {}) => [t({
1986
1983
  key: "heading-shortcuts",
1987
- keyboardShortcuts: Object.fromEntries(e.map((e) => [`Mod-Alt-${e}`, jn(e)]) ?? []),
1984
+ keyboardShortcuts: Object.fromEntries(e.map((e) => [`Mod-Alt-${e}`, Rn(e)]) ?? []),
1988
1985
  inputRules: e.map((e) => ({
1989
1986
  find: RegExp(`^(#{${e}})\\s$`),
1990
1987
  replace({ match: e }) {
@@ -1994,8 +1991,8 @@ var On = {
1994
1991
  };
1995
1992
  }
1996
1993
  }))
1997
- })]), Pn = (e, t, n, r, i) => {
1998
- let { dom: a, destroy: o } = on(e, t, n, i), s = a;
1994
+ })]), Vn = (e, t, n, r, i) => {
1995
+ let { dom: a, destroy: o } = fn(e, t, n, i), s = a;
1999
1996
  s.style.position = "relative", e.props.url && e.props.showPreview && (e.props.previewWidth ? s.style.width = `${e.props.previewWidth}px` : s.style.width = "fit-content");
2000
1997
  let c = document.createElement("div");
2001
1998
  c.className = "bn-resize-handle", c.style.left = "4px", c.style.display = "none", r.appendChild(c);
@@ -2039,11 +2036,11 @@ var On = {
2039
2036
  o?.(), window.removeEventListener("mousemove", p), window.removeEventListener("touchmove", p), window.removeEventListener("mouseup", m), window.removeEventListener("touchend", m), s.removeEventListener("mouseenter", h), s.removeEventListener("mouseleave", g), c.removeEventListener("mousedown", _), c.removeEventListener("touchstart", _), l.removeEventListener("mousedown", v), l.removeEventListener("touchstart", v);
2040
2037
  }
2041
2038
  };
2042
- }, Fn = (e) => ({
2039
+ }, Hn = (e) => ({
2043
2040
  url: e.src || void 0,
2044
2041
  previewWidth: e.width || void 0,
2045
2042
  name: e.alt || void 0
2046
- }), In = "<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>", Ln = D((e = {}) => ({
2043
+ }), Un = "<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>", Wn = A((e = {}) => ({
2047
2044
  type: "image",
2048
2045
  propSchema: {
2049
2046
  textAlignment: K.textAlignment,
@@ -2058,26 +2055,26 @@ var On = {
2058
2055
  }
2059
2056
  },
2060
2057
  content: "none"
2061
- })), Rn = (e = {}) => (e) => {
2058
+ })), Gn = (e = {}) => (e) => {
2062
2059
  if (e.tagName === "IMG") {
2063
2060
  if (e.closest("figure")) return;
2064
2061
  let { backgroundColor: t } = q(e);
2065
2062
  return {
2066
- ...Fn(e),
2063
+ ...Hn(e),
2067
2064
  backgroundColor: t
2068
2065
  };
2069
2066
  }
2070
2067
  if (e.tagName === "FIGURE") {
2071
- let t = tn(e, "img");
2068
+ let t = cn(e, "img");
2072
2069
  if (!t) return;
2073
2070
  let { targetElement: n, caption: r } = t, { backgroundColor: i } = q(e);
2074
2071
  return {
2075
- ...Fn(n),
2072
+ ...Hn(n),
2076
2073
  backgroundColor: i,
2077
2074
  caption: r
2078
2075
  };
2079
2076
  }
2080
- }, zn = (e = {}) => (t, n) => {
2077
+ }, Kn = (e = {}) => (t, n) => {
2081
2078
  let r = document.createElement("div");
2082
2079
  r.innerHTML = e.icon ?? "<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>";
2083
2080
  let i = document.createElement("div");
@@ -2085,24 +2082,21 @@ var On = {
2085
2082
  let a = document.createElement("img");
2086
2083
  return a.className = "bn-visual-media", n.resolveFileUrl ? n.resolveFileUrl(t.props.url).then((e) => {
2087
2084
  a.src = e;
2088
- }) : a.src = t.props.url, a.alt = t.props.name || t.props.caption || "BlockNote image", a.contentEditable = "false", a.draggable = !1, i.appendChild(a), Pn(t, n, { dom: i }, i, r.firstElementChild);
2089
- }, Bn = (e = {}) => (e, t) => {
2090
- if (!e.props.url) {
2091
- let e = document.createElement("p");
2092
- return e.textContent = "Add image", { dom: e };
2093
- }
2085
+ }) : a.src = t.props.url, a.alt = t.props.name || "", a.contentEditable = "false", a.draggable = !1, t.props.previewWidth && (a.width = t.props.previewWidth), i.appendChild(a), Vn(t, n, { dom: i }, i, r.firstElementChild);
2086
+ }, qn = (e = {}) => (e, t) => {
2087
+ if (!e.props.url) return { dom: document.createElement("img") };
2094
2088
  let n;
2095
- return e.props.showPreview ? (n = document.createElement("img"), n.src = e.props.url, n.alt = e.props.name || e.props.caption || "BlockNote image", e.props.previewWidth && (n.width = e.props.previewWidth)) : (n = document.createElement("a"), n.href = e.props.url, n.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? sn(n, e.props.caption) : X(n, e.props.caption) : { dom: n };
2096
- }, Vn = O(Ln, (e) => ({
2089
+ return e.props.showPreview ? (n = document.createElement("img"), n.src = e.props.url, n.alt = e.props.name || "", e.props.previewWidth && (n.width = e.props.previewWidth)) : (n = document.createElement("a"), n.href = e.props.url, n.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? pn(n, e.props.caption) : mn(n, e.props.caption) : { dom: n };
2090
+ }, Jn = j(Wn, (e) => ({
2097
2091
  meta: { fileBlockAccept: ["image/*"] },
2098
- parse: Rn(e),
2099
- render: zn(e),
2100
- toExternalHTML: Bn(e),
2092
+ parse: Gn(e),
2093
+ render: Kn(e),
2094
+ toExternalHTML: qn(e),
2101
2095
  runsBefore: ["file"]
2102
- })), Hn = (e, t, n) => ({ state: r, dispatch: i }) => i ? Un(r.tr, e, t, n) : !0, Un = (e, t, n, r) => {
2103
- let i = k(Ye(e.doc, t));
2096
+ })), Yn = (e, t, n) => ({ state: r, dispatch: i }) => i ? Xn(r.tr, e, t, n) : !0, Xn = (e, t, n, r) => {
2097
+ let i = M(Qe(e.doc, t));
2104
2098
  if (!i.isBlockContainer) return !1;
2105
- let a = A(e), o = [{
2099
+ let a = N(e), o = [{
2106
2100
  type: i.bnBlock.node.type,
2107
2101
  attrs: r ? {
2108
2102
  ...i.bnBlock.node.attrs,
@@ -2113,23 +2107,23 @@ var On = {
2113
2107
  attrs: r ? { ...i.blockContent.node.attrs } : {}
2114
2108
  }];
2115
2109
  return e.split(t, 2, o), !0;
2116
- }, Wn = (e, t) => {
2110
+ }, Zn = (e, t) => {
2117
2111
  let { blockInfo: n, selectionEmpty: r } = e.transact((e) => ({
2118
- blockInfo: $e(e),
2112
+ blockInfo: nt(e),
2119
2113
  selectionEmpty: e.selection.anchor === e.selection.head
2120
2114
  }));
2121
2115
  if (!n.isBlockContainer) return !1;
2122
2116
  let { bnBlock: i, blockContent: a } = n;
2123
2117
  return a.node.type.name !== t || !r ? !1 : a.node.childCount === 0 ? (e.transact((e) => {
2124
- W(e, i.beforePos, {
2118
+ Zt(e, i.beforePos, {
2125
2119
  type: "paragraph",
2126
2120
  props: {}
2127
2121
  });
2128
- }), !0) : a.node.childCount > 0 ? e.transact((e) => (e.deleteSelection(), Un(e, e.selection.from, !0))) : !1;
2122
+ }), !0) : a.node.childCount > 0 ? e.transact((e) => (e.deleteSelection(), Xn(e, e.selection.from, !0))) : !1;
2129
2123
  };
2130
2124
  //#endregion
2131
2125
  //#region src/blocks/ListItem/getListItemContent.ts
2132
- function Gn(e, t, i) {
2126
+ function Qn(e, t, i) {
2133
2127
  let a = n.fromSchema(t), o = e, s = document.createElement("div");
2134
2128
  s.setAttribute("data-node-type", "blockGroup");
2135
2129
  for (let e of Array.from(o.childNodes)) s.appendChild(e.cloneNode(!0));
@@ -2146,18 +2140,18 @@ function Gn(e, t, i) {
2146
2140
  }
2147
2141
  //#endregion
2148
2142
  //#region src/blocks/ListItem/BulletListItem/block.ts
2149
- var Kn = D(() => ({
2143
+ var $n = A(() => ({
2150
2144
  type: "bulletListItem",
2151
2145
  propSchema: { ...K },
2152
2146
  content: "inline"
2153
- })), qn = O(Kn, {
2147
+ })), er = j($n, {
2154
2148
  meta: { isolating: !1 },
2155
2149
  parse(e) {
2156
2150
  if (e.tagName !== "LI") return;
2157
2151
  let t = e.parentElement;
2158
- if (t !== null && (t.tagName === "UL" || t.tagName === "DIV" && t.parentElement?.tagName === "UL")) return q(e);
2152
+ if (t === null || t.tagName === "UL" || t.tagName === "DIV" && t.parentElement?.tagName === "UL" || !e.closest("ul, ol")) return q(e);
2159
2153
  },
2160
- parseContent: ({ el: e, schema: t }) => Gn(e, t, "bulletListItem"),
2154
+ parseContent: ({ el: e, schema: t }) => Qn(e, t, "bulletListItem"),
2161
2155
  render() {
2162
2156
  let e = document.createElement("p");
2163
2157
  return {
@@ -2175,7 +2169,7 @@ var Kn = D(() => ({
2175
2169
  }, [t({
2176
2170
  key: "bullet-list-item-shortcuts",
2177
2171
  keyboardShortcuts: {
2178
- Enter: ({ editor: e }) => Wn(e, "bulletListItem"),
2172
+ Enter: ({ editor: e }) => Zn(e, "bulletListItem"),
2179
2173
  "Mod-Shift-8": ({ editor: e }) => {
2180
2174
  let t = e.getTextCursorPosition();
2181
2175
  return e.schema.blockSchema[t.block.type].content === "inline" ? (e.updateBlock(t.block, {
@@ -2187,13 +2181,13 @@ var Kn = D(() => ({
2187
2181
  inputRules: [{
2188
2182
  find: /^\s?[-+*]\s$/,
2189
2183
  replace({ editor: e }) {
2190
- if (Qe(e.prosemirrorState).blockNoteType !== "heading") return {
2184
+ if (tt(e.prosemirrorState).blockNoteType !== "heading") return {
2191
2185
  type: "bulletListItem",
2192
2186
  props: {}
2193
2187
  };
2194
2188
  }
2195
2189
  }]
2196
- })]), Jn = D(() => ({
2190
+ })]), tr = A(() => ({
2197
2191
  type: "checkListItem",
2198
2192
  propSchema: {
2199
2193
  ...K,
@@ -2203,7 +2197,7 @@ var Kn = D(() => ({
2203
2197
  }
2204
2198
  },
2205
2199
  content: "inline"
2206
- })), Yn = O(Jn, {
2200
+ })), nr = j(tr, {
2207
2201
  meta: { isolating: !1 },
2208
2202
  parse(e) {
2209
2203
  if (e.tagName === "input") return e.closest("[data-content-type]") || e.closest("li") ? void 0 : e.type === "checkbox" ? { checked: e.checked } : void 0;
@@ -2217,7 +2211,7 @@ var Kn = D(() => ({
2217
2211
  };
2218
2212
  }
2219
2213
  },
2220
- parseContent: ({ el: e, schema: t }) => Gn(e, t, "checkListItem"),
2214
+ parseContent: ({ el: e, schema: t }) => Qn(e, t, "checkListItem"),
2221
2215
  render(e, t) {
2222
2216
  let n = document.createDocumentFragment(), r = document.createElement("input");
2223
2217
  r.type = "checkbox", r.checked = e.props.checked, e.props.checked && r.setAttribute("checked", ""), r.disabled = !t.isEditable, r.addEventListener("change", () => {
@@ -2242,7 +2236,7 @@ var Kn = D(() => ({
2242
2236
  }, [t({
2243
2237
  key: "check-list-item-shortcuts",
2244
2238
  keyboardShortcuts: {
2245
- Enter: ({ editor: e }) => Wn(e, "checkListItem"),
2239
+ Enter: ({ editor: e }) => Zn(e, "checkListItem"),
2246
2240
  "Mod-Shift-9": ({ editor: e }) => {
2247
2241
  let t = e.getTextCursorPosition();
2248
2242
  return e.schema.blockSchema[t.block.type].content === "inline" ? (e.updateBlock(t.block, {
@@ -2271,8 +2265,8 @@ var Kn = D(() => ({
2271
2265
  })]);
2272
2266
  //#endregion
2273
2267
  //#region src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts
2274
- function Xn(e, t, n, r) {
2275
- let i = !!e.firstChild.attrs.start, a = k({
2268
+ function rr(e, t, n, r) {
2269
+ let i = !!e.firstChild.attrs.start, a = M({
2276
2270
  posBeforeNode: t,
2277
2271
  node: e
2278
2272
  });
@@ -2291,7 +2285,7 @@ function Xn(e, t, n, r) {
2291
2285
  pos: t
2292
2286
  }], l = o, u = a.bnBlock.beforePos;
2293
2287
  for (; l && r.get(l) === void 0;) {
2294
- let e = k({
2288
+ let e = M({
2295
2289
  posBeforeNode: u - l.nodeSize,
2296
2290
  node: l
2297
2291
  });
@@ -2303,7 +2297,7 @@ function Xn(e, t, n, r) {
2303
2297
  let t = n.doc.resolve(e.bnBlock.beforePos).nodeBefore;
2304
2298
  u = e.bnBlock.beforePos, l = t;
2305
2299
  }
2306
- let d, f, p = c[c.length - 1], m = k({
2300
+ let d, f, p = c[c.length - 1], m = M({
2307
2301
  posBeforeNode: p.pos,
2308
2302
  node: p.node
2309
2303
  });
@@ -2320,15 +2314,16 @@ function Xn(e, t, n, r) {
2320
2314
  hasStart: i
2321
2315
  };
2322
2316
  }
2323
- function Zn(e, t) {
2324
- let n = /* @__PURE__ */ new Map(), r = t.decorations.map(e.mapping, e.doc), i = e.changedRange();
2325
- if (!i) return { decorations: r };
2326
- let a = [], o = /* @__PURE__ */ new Set();
2317
+ function ir(e, t) {
2318
+ let n = /* @__PURE__ */ new Map(), r = t.decorations.map(e.mapping, e.doc), i = e.changedRange() ?? {
2319
+ from: 0,
2320
+ to: e.doc.nodeSize - 2
2321
+ }, a = [], o = /* @__PURE__ */ new Set();
2327
2322
  e.doc.nodesBetween(i.from, e.doc.nodeSize - 2, (t, s, c) => {
2328
2323
  if (c && o.has(c)) return !1;
2329
2324
  if (t.type.name === "blockContainer" && t.firstChild.type.name === "numberedListItem") {
2330
- let { index: l, isFirst: u, hasStart: d } = Xn(t, s, e, n), f = e.doc.nodeAt(s + 1);
2331
- if (r.find(s + 1, s + 1 + f.nodeSize, (e) => e.index === l && e.isFirst === u && e.hasStart === d).length === 0) a.push(he.node(s + 1, s + 1 + f.nodeSize, { "data-index": l.toString() }, {
2325
+ let { index: l, isFirst: u, hasStart: d } = rr(t, s, e, n), f = e.doc.nodeAt(s + 1);
2326
+ if (r.find(s + 1, s + 1 + f.nodeSize, (e) => e.index === l && e.isFirst === u && e.hasStart === d).length === 0) a.push(be.node(s + 1, s + 1 + f.nodeSize, { "data-index": l.toString() }, {
2332
2327
  index: l,
2333
2328
  isFirst: u,
2334
2329
  hasStart: d
@@ -2339,20 +2334,20 @@ function Zn(e, t) {
2339
2334
  let s = a.flatMap((e) => r.find(e.from, e.to));
2340
2335
  return { decorations: r.remove(s).add(e.doc, a) };
2341
2336
  }
2342
- var Qn = () => new pe({
2343
- key: new me("numbered-list-indexing-decorations"),
2337
+ var ar = () => new ve({
2338
+ key: new ye("numbered-list-indexing-decorations"),
2344
2339
  state: {
2345
2340
  init(e, t) {
2346
- return Zn(t.tr, { decorations: ge.empty });
2341
+ return ir(t.tr, { decorations: xe.empty });
2347
2342
  },
2348
2343
  apply(e, t) {
2349
- return !e.docChanged && t.decorations ? t : Zn(e, t);
2344
+ return !e.docChanged && t.decorations ? t : ir(e, t);
2350
2345
  }
2351
2346
  },
2352
2347
  props: { decorations(e) {
2353
- return this.getState(e)?.decorations ?? ge.empty;
2348
+ return this.getState(e)?.decorations ?? xe.empty;
2354
2349
  } }
2355
- }), $n = D(() => ({
2350
+ }), or = A(() => ({
2356
2351
  type: "numberedListItem",
2357
2352
  propSchema: {
2358
2353
  ...K,
@@ -2362,7 +2357,7 @@ var Qn = () => new pe({
2362
2357
  }
2363
2358
  },
2364
2359
  content: "inline"
2365
- })), er = O($n, {
2360
+ })), sr = j(or, {
2366
2361
  meta: { isolating: !1 },
2367
2362
  parse(e) {
2368
2363
  if (e.tagName !== "LI") return;
@@ -2375,7 +2370,7 @@ var Qn = () => new pe({
2375
2370
  };
2376
2371
  }
2377
2372
  },
2378
- parseContent: ({ el: e, schema: t }) => Gn(e, t, "numberedListItem"),
2373
+ parseContent: ({ el: e, schema: t }) => Qn(e, t, "numberedListItem"),
2379
2374
  render() {
2380
2375
  let e = document.createElement("p");
2381
2376
  return {
@@ -2395,7 +2390,7 @@ var Qn = () => new pe({
2395
2390
  inputRules: [{
2396
2391
  find: /^\s?(\d+)\.\s$/,
2397
2392
  replace({ match: e, editor: t }) {
2398
- if (Qe(t.prosemirrorState).blockNoteType === "heading") return;
2393
+ if (tt(t.prosemirrorState).blockNoteType === "heading") return;
2399
2394
  let n = parseInt(e[1]);
2400
2395
  return {
2401
2396
  type: "numberedListItem",
@@ -2404,7 +2399,7 @@ var Qn = () => new pe({
2404
2399
  }
2405
2400
  }],
2406
2401
  keyboardShortcuts: {
2407
- Enter: ({ editor: e }) => Wn(e, "numberedListItem"),
2402
+ Enter: ({ editor: e }) => Zn(e, "numberedListItem"),
2408
2403
  "Mod-Shift-7": ({ editor: e }) => {
2409
2404
  let t = e.getTextCursorPosition();
2410
2405
  return e.schema.blockSchema[t.block.type].content === "inline" ? (e.updateBlock(t.block, {
@@ -2413,12 +2408,12 @@ var Qn = () => new pe({
2413
2408
  }), !0) : !1;
2414
2409
  }
2415
2410
  },
2416
- prosemirrorPlugins: [Qn()]
2417
- })]), tr = D(() => ({
2411
+ prosemirrorPlugins: [ar()]
2412
+ })]), cr = A(() => ({
2418
2413
  type: "toggleListItem",
2419
2414
  propSchema: { ...K },
2420
2415
  content: "inline"
2421
- })), nr = O(tr, {
2416
+ })), lr = j(cr, {
2422
2417
  meta: { isolating: !1 },
2423
2418
  parse(e) {
2424
2419
  if (e.tagName === "DETAILS") return q(e);
@@ -2430,13 +2425,13 @@ var Qn = () => new pe({
2430
2425
  parseContent: ({ el: e, schema: t }) => {
2431
2426
  let n = e.tagName === "DETAILS" ? e : e.querySelector(":scope > details");
2432
2427
  if (!n) throw Error("No details found in toggleListItem parseContent");
2433
- return Dn(n, t, "toggleListItem");
2428
+ return Pn(n, t, "toggleListItem");
2434
2429
  },
2435
2430
  runsBefore: ["bulletListItem"],
2436
2431
  render(e, t) {
2437
2432
  let n = document.createElement("p");
2438
2433
  return {
2439
- ...kn(e, t, n),
2434
+ ...In(e, t, n),
2440
2435
  contentDOM: n
2441
2436
  };
2442
2437
  },
@@ -2453,7 +2448,7 @@ var Qn = () => new pe({
2453
2448
  }, [t({
2454
2449
  key: "toggle-list-item-shortcuts",
2455
2450
  keyboardShortcuts: {
2456
- Enter: ({ editor: e }) => Wn(e, "toggleListItem"),
2451
+ Enter: ({ editor: e }) => Zn(e, "toggleListItem"),
2457
2452
  "Mod-Shift-6": ({ editor: e }) => {
2458
2453
  let t = e.getTextCursorPosition();
2459
2454
  return e.schema.blockSchema[t.block.type].content === "inline" ? (e.updateBlock(t.block, {
@@ -2462,11 +2457,11 @@ var Qn = () => new pe({
2462
2457
  }), !0) : !1;
2463
2458
  }
2464
2459
  }
2465
- })]), rr = D(() => ({
2460
+ })]), ur = A(() => ({
2466
2461
  type: "pageBreak",
2467
2462
  propSchema: {},
2468
2463
  content: "none"
2469
- })), ir = O(rr, {
2464
+ })), dr = j(ur, {
2470
2465
  parse(e) {
2471
2466
  if (e.tagName === "DIV" && e.hasAttribute("data-page-break")) return {};
2472
2467
  },
@@ -2478,11 +2473,11 @@ var Qn = () => new pe({
2478
2473
  let e = document.createElement("div");
2479
2474
  return e.setAttribute("data-page-break", ""), { dom: e };
2480
2475
  }
2481
- }), ar = (e) => e.extend({ blockSpecs: { pageBreak: ir() } }), or = D(() => ({
2476
+ }), fr = (e) => e.extend({ blockSpecs: { pageBreak: dr() } }), pr = A(() => ({
2482
2477
  type: "paragraph",
2483
2478
  propSchema: K,
2484
2479
  content: "inline"
2485
- })), sr = O(or, {
2480
+ })), mr = j(pr, {
2486
2481
  meta: { isolating: !1 },
2487
2482
  parse: (e) => {
2488
2483
  if (e.tagName === "P" && e.textContent?.trim()) return q(e);
@@ -2511,14 +2506,14 @@ var Qn = () => new pe({
2511
2506
  props: {}
2512
2507
  }), !0) : !1;
2513
2508
  } }
2514
- })]), cr = D(() => ({
2509
+ })]), hr = A(() => ({
2515
2510
  type: "quote",
2516
2511
  propSchema: {
2517
2512
  backgroundColor: K.backgroundColor,
2518
2513
  textColor: K.textColor
2519
2514
  },
2520
2515
  content: "inline"
2521
- })), lr = O(cr, {
2516
+ })), gr = j(hr, {
2522
2517
  meta: { isolating: !1 },
2523
2518
  parse(e) {
2524
2519
  if (e.tagName === "BLOCKQUOTE") {
@@ -2569,32 +2564,36 @@ var Qn = () => new pe({
2569
2564
  };
2570
2565
  }
2571
2566
  }]
2572
- })]), ur = 120, dr = 31, fr = s.create({
2567
+ })]), _r = 120, vr = 31, yr = s.create({
2573
2568
  name: "BlockNoteTableExtension",
2574
- addProseMirrorPlugins: () => [ce({
2569
+ addProseMirrorPlugins: () => [le({
2575
2570
  cellMinWidth: 35,
2576
2571
  defaultCellMinWidth: 120,
2577
2572
  View: null
2578
- }), ue()],
2573
+ }), he()],
2579
2574
  addKeyboardShortcuts() {
2580
2575
  return {
2581
- Enter: () => this.editor.state.selection.empty && this.editor.state.selection.$head.parent.type.name === "tableParagraph" ? (this.editor.commands.insertContent({ type: "hardBreak" }), !0) : !1,
2576
+ Enter: () => this.editor.state.selection.$head.parent.type.name === "tableParagraph" ? this.editor.commands.command(({ state: e, dispatch: t }) => {
2577
+ if (!de(e)) return !1;
2578
+ let n = pe(me(e), "vert", 1);
2579
+ return n ? (t && t(e.tr.setSelection(y.between(n, fe(n))).scrollIntoView()), !0) : !1;
2580
+ }) : !1,
2582
2581
  Backspace: () => {
2583
2582
  let e = this.editor.state.selection, t = e.empty, n = e.$head.parentOffset === 0, r = e.$head.node().type.name === "tableParagraph";
2584
2583
  return t && n && r;
2585
2584
  },
2586
- Tab: () => this.editor.commands.command(({ state: e, dispatch: t, view: n }) => le(1)(e, t, n)),
2587
- "Shift-Tab": () => this.editor.commands.command(({ state: e, dispatch: t, view: n }) => le(-1)(e, t, n))
2585
+ Tab: () => this.editor.commands.command(({ state: e, dispatch: t, view: n }) => ue(1)(e, t, n)),
2586
+ "Shift-Tab": () => this.editor.commands.command(({ state: e, dispatch: t, view: n }) => ue(-1)(e, t, n))
2588
2587
  };
2589
2588
  },
2590
2589
  extendNodeSchema(e) {
2591
- return { tableRole: u(h(e, "tableRole", {
2590
+ return { tableRole: d(g(e, "tableRole", {
2592
2591
  name: e.name,
2593
2592
  options: e.options,
2594
2593
  storage: e.storage
2595
2594
  })) };
2596
2595
  }
2597
- }), pr = { textColor: K.textColor }, mr = l.create({
2596
+ }), br = { textColor: K.textColor }, xr = u.create({
2598
2597
  name: "tableHeader",
2599
2598
  addOptions() {
2600
2599
  return { HTMLAttributes: {} };
@@ -2618,17 +2617,17 @@ var Qn = () => new pe({
2618
2617
  parseHTML() {
2619
2618
  return [{
2620
2619
  tag: "th",
2621
- getContent: (e, t) => yr(e, t)
2620
+ getContent: (e, t) => Er(e, t)
2622
2621
  }];
2623
2622
  },
2624
2623
  renderHTML({ HTMLAttributes: e }) {
2625
2624
  return [
2626
2625
  "th",
2627
- g(this.options.HTMLAttributes, e),
2626
+ v(this.options.HTMLAttributes, e),
2628
2627
  0
2629
2628
  ];
2630
2629
  }
2631
- }), hr = l.create({
2630
+ }), Sr = u.create({
2632
2631
  name: "tableCell",
2633
2632
  addOptions() {
2634
2633
  return { HTMLAttributes: {} };
@@ -2652,17 +2651,17 @@ var Qn = () => new pe({
2652
2651
  parseHTML() {
2653
2652
  return [{
2654
2653
  tag: "td",
2655
- getContent: (e, t) => yr(e, t)
2654
+ getContent: (e, t) => Er(e, t)
2656
2655
  }];
2657
2656
  },
2658
2657
  renderHTML({ HTMLAttributes: e }) {
2659
2658
  return [
2660
2659
  "td",
2661
- g(this.options.HTMLAttributes, e),
2660
+ v(this.options.HTMLAttributes, e),
2662
2661
  0
2663
2662
  ];
2664
2663
  }
2665
- }), gr = l.create({
2664
+ }), Cr = u.create({
2666
2665
  name: "table",
2667
2666
  content: "tableRow+",
2668
2667
  group: "blockContent",
@@ -2673,7 +2672,7 @@ var Qn = () => new pe({
2673
2672
  return [{ tag: "table" }];
2674
2673
  },
2675
2674
  renderHTML({ node: e, HTMLAttributes: t }) {
2676
- let n = Re(this.name, "table", {
2675
+ let n = Ve(this.name, "table", {
2677
2676
  ...this.options.domAttributes?.blockContent || {},
2678
2677
  ...t
2679
2678
  }, this.options.domAttributes?.inlineContent || {}), r = document.createElement("colgroup");
@@ -2686,11 +2685,11 @@ var Qn = () => new pe({
2686
2685
  },
2687
2686
  addNodeView() {
2688
2687
  return ({ node: e, HTMLAttributes: t }) => {
2689
- class n extends se {
2688
+ class n extends ce {
2690
2689
  constructor(e, t, n) {
2691
2690
  super(e, t), this.node = e, this.cellMinWidth = t, this.blockContentHTMLAttributes = n;
2692
2691
  let r = document.createElement("div");
2693
- r.className = w("bn-block-content", n.class), r.setAttribute("data-content-type", "table");
2692
+ r.className = D("bn-block-content", n.class), r.setAttribute("data-content-type", "table");
2694
2693
  for (let [e, t] of Object.entries(n)) e !== "class" && r.setAttribute(e, t);
2695
2694
  let i = this.dom, a = document.createElement("div");
2696
2695
  a.className = "tableWrapper-inner", a.appendChild(i.firstChild), i.appendChild(a), r.appendChild(i);
@@ -2702,8 +2701,8 @@ var Qn = () => new pe({
2702
2701
  }
2703
2702
  update(e) {
2704
2703
  if (!super.update(e)) return !1;
2705
- for (let [t, n] of Object.entries(pr)) {
2706
- let r = T(t), i = e.attrs[t];
2704
+ for (let [t, n] of Object.entries(br)) {
2705
+ let r = O(t), i = e.attrs[t];
2707
2706
  i === n.default ? this.dom.removeAttribute(r) : this.dom.setAttribute(r, String(i));
2708
2707
  }
2709
2708
  return !0;
@@ -2715,7 +2714,7 @@ var Qn = () => new pe({
2715
2714
  });
2716
2715
  };
2717
2716
  }
2718
- }), _r = l.create({
2717
+ }), wr = u.create({
2719
2718
  name: "tableParagraph",
2720
2719
  group: "tableContent",
2721
2720
  content: "inline*",
@@ -2737,7 +2736,7 @@ var Qn = () => new pe({
2737
2736
  0
2738
2737
  ];
2739
2738
  }
2740
- }), vr = l.create({
2739
+ }), Tr = u.create({
2741
2740
  name: "tableRow",
2742
2741
  addOptions() {
2743
2742
  return { HTMLAttributes: {} };
@@ -2751,34 +2750,34 @@ var Qn = () => new pe({
2751
2750
  renderHTML({ HTMLAttributes: e }) {
2752
2751
  return [
2753
2752
  "tr",
2754
- g(this.options.HTMLAttributes, e),
2753
+ v(this.options.HTMLAttributes, e),
2755
2754
  0
2756
2755
  ];
2757
2756
  }
2758
2757
  });
2759
- function yr(e, t) {
2758
+ function Er(e, t) {
2760
2759
  let i = n.fromSchema(t).parse(e, { topNode: t.nodes.blockGroup.create() }), a = [];
2761
2760
  return i.content.descendants((e) => {
2762
2761
  if (e.isInline) return a.push(e), !1;
2763
2762
  }), r.fromArray(a);
2764
2763
  }
2765
- var br = () => Ge({
2766
- node: gr,
2764
+ var Dr = () => Je({
2765
+ node: Cr,
2767
2766
  type: "table",
2768
2767
  content: "table"
2769
- }, pr, [t({
2768
+ }, br, [t({
2770
2769
  key: "table-extensions",
2771
2770
  tiptapExtensions: [
2772
- fr,
2773
- _r,
2774
- mr,
2775
- hr,
2776
- vr
2771
+ yr,
2772
+ wr,
2773
+ xr,
2774
+ Sr,
2775
+ Tr
2777
2776
  ]
2778
2777
  }), t({
2779
2778
  key: "table-keyboard-delete",
2780
2779
  keyboardShortcuts: { Backspace: ({ editor: e }) => {
2781
- if (!(e.prosemirrorState.selection instanceof ae)) return !1;
2780
+ if (!(e.prosemirrorState.selection instanceof oe)) return !1;
2782
2781
  let t = e.getTextCursorPosition().block, n = t.content, r = 0;
2783
2782
  for (let e of n.rows) for (let t of e.cells) {
2784
2783
  if ("type" in t && t.content.length > 0 || !("type" in t) && t.length > 0) return !1;
@@ -2791,10 +2790,11 @@ var br = () => Ge({
2791
2790
  (e.getPrevBlock(t) || e.getNextBlock(t)) && e.setTextCursorPosition(t), e.removeBlocks([t]);
2792
2791
  }), !0);
2793
2792
  } }
2794
- })]), xr = (e) => ({
2793
+ })]), Or = (e) => ({
2795
2794
  url: e.src || void 0,
2796
- previewWidth: e.width || void 0
2797
- }), Sr = "<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>", Cr = D((e) => ({
2795
+ previewWidth: e.width || void 0,
2796
+ name: e.getAttribute("data-name") || void 0
2797
+ }), kr = "<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>", Ar = A((e) => ({
2798
2798
  type: "video",
2799
2799
  propSchema: {
2800
2800
  textAlignment: K.textAlignment,
@@ -2809,28 +2809,28 @@ var br = () => Ge({
2809
2809
  }
2810
2810
  },
2811
2811
  content: "none"
2812
- })), wr = (e) => (e) => {
2812
+ })), jr = (e) => (e) => {
2813
2813
  if (e.tagName === "VIDEO") {
2814
2814
  if (e.closest("figure")) return;
2815
2815
  let { backgroundColor: t } = q(e);
2816
2816
  return {
2817
- ...xr(e),
2817
+ ...Or(e),
2818
2818
  backgroundColor: t
2819
2819
  };
2820
2820
  }
2821
2821
  if (e.tagName === "FIGURE") {
2822
- let t = tn(e, "video");
2822
+ let t = cn(e, "video");
2823
2823
  if (!t) return;
2824
2824
  let { targetElement: n, caption: r } = t, { backgroundColor: i } = q(e);
2825
2825
  return {
2826
- ...xr(n),
2826
+ ...Or(n),
2827
2827
  backgroundColor: i,
2828
2828
  caption: r
2829
2829
  };
2830
2830
  }
2831
- }, Tr = O(Cr, (e) => ({
2831
+ }, Mr = j(Ar, (e) => ({
2832
2832
  meta: { fileBlockAccept: ["video/*"] },
2833
- parse: wr(e),
2833
+ parse: jr(e),
2834
2834
  render(t, n) {
2835
2835
  let r = document.createElement("div");
2836
2836
  r.innerHTML = e.icon ?? "<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>";
@@ -2839,18 +2839,15 @@ var br = () => Ge({
2839
2839
  let a = document.createElement("video");
2840
2840
  return a.className = "bn-visual-media", n.resolveFileUrl ? n.resolveFileUrl(t.props.url).then((e) => {
2841
2841
  a.src = e;
2842
- }) : a.src = t.props.url, a.controls = !0, a.contentEditable = "false", a.draggable = !1, a.width = t.props.previewWidth, i.appendChild(a), Pn(t, n, { dom: i }, i, r.firstElementChild);
2842
+ }) : a.src = t.props.url, a.controls = !0, a.contentEditable = "false", a.draggable = !1, t.props.previewWidth && (a.width = t.props.previewWidth), i.appendChild(a), Vn(t, n, { dom: i }, i, r.firstElementChild);
2843
2843
  },
2844
2844
  toExternalHTML(e) {
2845
- if (!e.props.url) {
2846
- let e = document.createElement("p");
2847
- return e.textContent = "Add video", { dom: e };
2848
- }
2845
+ if (!e.props.url) return { dom: document.createElement("video") };
2849
2846
  let t;
2850
- return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, e.props.previewWidth && (t.width = e.props.previewWidth)) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? sn(t, e.props.caption) : X(t, e.props.caption) : { dom: t };
2847
+ return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, e.props.previewWidth && (t.width = e.props.previewWidth)) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? pn(t, e.props.caption) : mn(t, e.props.caption) : { dom: t };
2851
2848
  },
2852
2849
  runsBefore: ["file"]
2853
- })), Er = async (e) => {
2850
+ })), Nr = async (e) => {
2854
2851
  let t = new FormData();
2855
2852
  return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
2856
2853
  method: "POST",
@@ -2859,7 +2856,7 @@ var br = () => Ge({
2859
2856
  };
2860
2857
  //#endregion
2861
2858
  //#region src/blocks/defaultBlockTypeGuards.ts
2862
- function Z(e, t, n) {
2859
+ function X(e, t, n) {
2863
2860
  if (!(t in e.schema.blockSpecs)) return !1;
2864
2861
  if (!n) return !0;
2865
2862
  for (let [r, i] of Object.entries(n)) {
@@ -2875,40 +2872,76 @@ function Z(e, t, n) {
2875
2872
  }
2876
2873
  return !0;
2877
2874
  }
2878
- function Dr(e, t, n, r) {
2879
- return Z(t, n, r) && e.type === n;
2875
+ function Pr(e, t, n, r) {
2876
+ return X(t, n, r) && e.type === n;
2880
2877
  }
2881
- function Or(e) {
2882
- return e instanceof ae;
2878
+ function Fr(e) {
2879
+ return e instanceof oe;
2883
2880
  }
2884
2881
  //#endregion
2885
- //#region src/api/positionMapping.ts
2886
- var kr = /* @__PURE__ */ new Map();
2887
- function Ar(e) {
2888
- if (kr.has(e)) return kr.get(e);
2882
+ //#region src/extensions/FormattingToolbar/FormattingToolbar.ts
2883
+ var Z = t(({ editor: t }) => {
2884
+ let n = e(!1), r = () => t.transact((e) => {
2885
+ if (e.selection.empty || e.selection instanceof y && e.doc.textBetween(e.selection.from, e.selection.to).length === 0) return !1;
2886
+ let t = !1;
2887
+ return e.selection.content().content.descendants((e) => (e.type.spec.code && (t = !0), !t)), !t;
2888
+ });
2889
+ return {
2890
+ key: "formattingToolbar",
2891
+ store: n,
2892
+ mount({ dom: e, signal: i }) {
2893
+ let a = !1, o = !1, s = t.onChange(() => {
2894
+ a || o || n.setState(r());
2895
+ }), c = t.onSelectionChange(() => {
2896
+ a || o || n.setState(r());
2897
+ });
2898
+ e.addEventListener("pointerdown", () => {
2899
+ a = !0, n.setState(!1);
2900
+ }, { signal: i }), t.prosemirrorView.root.addEventListener("pointerup", () => {
2901
+ a = !1, t.isFocused() && n.setState(r());
2902
+ }, {
2903
+ signal: i,
2904
+ capture: !0
2905
+ }), e.addEventListener("pointercancel", () => {
2906
+ a = !0;
2907
+ }, {
2908
+ signal: i,
2909
+ capture: !0
2910
+ }), t.prosemirrorView.root.addEventListener("dragstart", () => {
2911
+ o = !0, n.setState(!1);
2912
+ }, { signal: i }), t.prosemirrorView.root.addEventListener("dragend", () => {
2913
+ o = !1;
2914
+ }, { signal: i }), i.addEventListener("abort", () => {
2915
+ s(), c();
2916
+ });
2917
+ }
2918
+ };
2919
+ }), Ir = /* @__PURE__ */ new Map();
2920
+ function Lr(e) {
2921
+ if (Ir.has(e)) return Ir.get(e);
2889
2922
  let t = new a();
2890
2923
  return e._tiptapEditor.on("transaction", ({ transaction: e }) => {
2891
2924
  t.appendMapping(e.mapping);
2892
2925
  }), e._tiptapEditor.on("destroy", () => {
2893
- kr.delete(e);
2894
- }), kr.set(e, t), t;
2926
+ Ir.delete(e);
2927
+ }), Ir.set(e, t), t;
2895
2928
  }
2896
- function jr(e, t, n = "left") {
2897
- let r = xe.getState(e.prosemirrorState);
2929
+ function Rr(e, t, n = "left") {
2930
+ let r = Ee.getState(e.prosemirrorState);
2898
2931
  if (!r) {
2899
- let r = Ar(e), i = r.maps.length;
2932
+ let r = Lr(e), i = r.maps.length;
2900
2933
  return () => r.slice(i).map(t, n === "left" ? -1 : 1);
2901
2934
  }
2902
- let i = ye(t + (n === "right" ? 1 : -1), r.binding.type, r.binding.mapping);
2935
+ let i = we(t + (n === "right" ? 1 : -1), r.binding.type, r.binding.mapping);
2903
2936
  return () => {
2904
- let t = xe.getState(e.prosemirrorState), r = be(t.doc, t.binding.type, i, t.binding.mapping);
2937
+ let t = Ee.getState(e.prosemirrorState), r = Te(t.doc, t.binding.type, i, t.binding.mapping);
2905
2938
  if (r === null) throw Error("Position not found, cannot track positions");
2906
2939
  return r + (n === "right" ? -1 : 1);
2907
2940
  };
2908
2941
  }
2909
2942
  //#endregion
2910
2943
  //#region src/extensions/SuggestionMenu/SuggestionMenu.ts
2911
- var Mr = p((e) => e.type.name === "blockContainer"), Nr = class {
2944
+ var zr = m((e) => e.type.name === "blockContainer"), Br = class {
2912
2945
  state;
2913
2946
  emitUpdate;
2914
2947
  rootEl;
@@ -2955,7 +2988,7 @@ var Mr = p((e) => e.type.name === "blockContainer"), Nr = class {
2955
2988
  to: this.editor.transact((e) => e.selection.from)
2956
2989
  }).run();
2957
2990
  };
2958
- }, Q = new v("SuggestionMenuPlugin"), Pr = t(({ editor: t }) => {
2991
+ }, Q = new te("SuggestionMenuPlugin"), Vr = t(({ editor: t }) => {
2959
2992
  let n = /* @__PURE__ */ new Map(), r, i = e(void 0);
2960
2993
  return {
2961
2994
  key: "suggestionMenu",
@@ -2982,9 +3015,9 @@ var Mr = p((e) => e.type.name === "blockContainer"), Nr = class {
2982
3015
  });
2983
3016
  }));
2984
3017
  },
2985
- prosemirrorPlugins: [new _({
3018
+ prosemirrorPlugins: [new ee({
2986
3019
  key: Q,
2987
- view: (e) => (r = new Nr(t, (e, t) => {
3020
+ view: (e) => (r = new Br(t, (e, t) => {
2988
3021
  i.setState({
2989
3022
  ...t,
2990
3023
  triggerCharacter: e
@@ -2997,7 +3030,7 @@ var Mr = p((e) => e.type.name === "blockContainer"), Nr = class {
2997
3030
  let o = e.getMeta(Q);
2998
3031
  if (typeof o == "object" && o) {
2999
3032
  n && r?.closeMenu();
3000
- let e = jr(t, a.selection.from - o.triggerCharacter.length);
3033
+ let e = Rr(t, a.selection.from - o.triggerCharacter.length);
3001
3034
  return {
3002
3035
  triggerCharacter: o.triggerCharacter,
3003
3036
  deleteTriggerCharacter: o.deleteTriggerCharacter !== !1,
@@ -3031,14 +3064,14 @@ var Mr = p((e) => e.type.name === "blockContainer"), Nr = class {
3031
3064
  let t = this.getState(e);
3032
3065
  if (t === void 0) return null;
3033
3066
  if (!t.deleteTriggerCharacter) {
3034
- let n = Mr(e.selection);
3035
- if (n) return ve.create(e.doc, [_e.node(n.pos, n.pos + n.node.nodeSize, {
3067
+ let n = zr(e.selection);
3068
+ if (n) return Ce.create(e.doc, [Se.node(n.pos, n.pos + n.node.nodeSize, {
3036
3069
  nodeName: "span",
3037
3070
  class: "bn-suggestion-decorator",
3038
3071
  "data-decoration-id": t.decorationId
3039
3072
  })]);
3040
3073
  }
3041
- return ve.create(e.doc, [_e.inline(t.queryStartPos() - t.triggerCharacter.length, t.queryStartPos(), {
3074
+ return Ce.create(e.doc, [Se.inline(t.queryStartPos() - t.triggerCharacter.length, t.queryStartPos(), {
3042
3075
  nodeName: "span",
3043
3076
  class: "bn-suggestion-decorator",
3044
3077
  "data-decoration-id": t.decorationId
@@ -3050,7 +3083,7 @@ var Mr = p((e) => e.type.name === "blockContainer"), Nr = class {
3050
3083
  });
3051
3084
  //#endregion
3052
3085
  //#region src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts
3053
- function Fr(e) {
3086
+ function Hr(e) {
3054
3087
  let t = e.getTextCursorPosition().block, n = e.schema.blockSchema[t.type].content;
3055
3088
  for (; n === "none";) {
3056
3089
  if (t = e.getTextCursorPosition().nextBlock, t === void 0) return;
@@ -3061,11 +3094,11 @@ function $(e, t) {
3061
3094
  let n = e.getTextCursorPosition().block;
3062
3095
  if (n.content === void 0) throw Error("Slash Menu open in a block that doesn't contain content.");
3063
3096
  let r;
3064
- return Array.isArray(n.content) && (n.content.length === 1 && y(n.content[0]) && n.content[0].type === "text" && n.content[0].text === "/" || n.content.length === 0) ? (r = e.updateBlock(n, t), e.setTextCursorPosition(r)) : (r = e.insertBlocks([t], n, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), Fr(e), r;
3097
+ return Array.isArray(n.content) && (n.content.length === 1 && b(n.content[0]) && n.content[0].type === "text" && n.content[0].text === "/" || n.content.length === 0) ? (r = e.updateBlock(n, t), e.setTextCursorPosition(r)) : (r = e.insertBlocks([t], n, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), Hr(e), r;
3065
3098
  }
3066
- function Ir(e) {
3099
+ function Ur(e) {
3067
3100
  let t = [];
3068
- return Z(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((e) => e <= 3).forEach((n) => {
3101
+ return X(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((e) => e <= 3).forEach((n) => {
3069
3102
  t.push({
3070
3103
  onItemClick: () => {
3071
3104
  $(e, {
@@ -3073,65 +3106,65 @@ function Ir(e) {
3073
3106
  props: { level: n }
3074
3107
  });
3075
3108
  },
3076
- badge: C(`Mod-Alt-${n}`),
3109
+ badge: E(`Mod-Alt-${n}`),
3077
3110
  key: n === 1 ? "heading" : `heading_${n}`,
3078
3111
  ...e.dictionary.slash_menu[n === 1 ? "heading" : `heading_${n}`]
3079
3112
  });
3080
- }), Z(e, "quote") && t.push({
3113
+ }), X(e, "quote") && t.push({
3081
3114
  onItemClick: () => {
3082
3115
  $(e, { type: "quote" });
3083
3116
  },
3084
3117
  key: "quote",
3085
3118
  ...e.dictionary.slash_menu.quote
3086
- }), Z(e, "toggleListItem") && t.push({
3119
+ }), X(e, "toggleListItem") && t.push({
3087
3120
  onItemClick: () => {
3088
3121
  $(e, { type: "toggleListItem" });
3089
3122
  },
3090
- badge: C("Mod-Shift-6"),
3123
+ badge: E("Mod-Shift-6"),
3091
3124
  key: "toggle_list",
3092
3125
  ...e.dictionary.slash_menu.toggle_list
3093
- }), Z(e, "numberedListItem") && t.push({
3126
+ }), X(e, "numberedListItem") && t.push({
3094
3127
  onItemClick: () => {
3095
3128
  $(e, { type: "numberedListItem" });
3096
3129
  },
3097
- badge: C("Mod-Shift-7"),
3130
+ badge: E("Mod-Shift-7"),
3098
3131
  key: "numbered_list",
3099
3132
  ...e.dictionary.slash_menu.numbered_list
3100
- }), Z(e, "bulletListItem") && t.push({
3133
+ }), X(e, "bulletListItem") && t.push({
3101
3134
  onItemClick: () => {
3102
3135
  $(e, { type: "bulletListItem" });
3103
3136
  },
3104
- badge: C("Mod-Shift-8"),
3137
+ badge: E("Mod-Shift-8"),
3105
3138
  key: "bullet_list",
3106
3139
  ...e.dictionary.slash_menu.bullet_list
3107
- }), Z(e, "checkListItem") && t.push({
3140
+ }), X(e, "checkListItem") && t.push({
3108
3141
  onItemClick: () => {
3109
3142
  $(e, { type: "checkListItem" });
3110
3143
  },
3111
- badge: C("Mod-Shift-9"),
3144
+ badge: E("Mod-Shift-9"),
3112
3145
  key: "check_list",
3113
3146
  ...e.dictionary.slash_menu.check_list
3114
- }), Z(e, "paragraph") && t.push({
3147
+ }), X(e, "paragraph") && t.push({
3115
3148
  onItemClick: () => {
3116
3149
  $(e, { type: "paragraph" });
3117
3150
  },
3118
- badge: C("Mod-Alt-0"),
3151
+ badge: E("Mod-Alt-0"),
3119
3152
  key: "paragraph",
3120
3153
  ...e.dictionary.slash_menu.paragraph
3121
- }), Z(e, "codeBlock") && t.push({
3154
+ }), X(e, "codeBlock") && t.push({
3122
3155
  onItemClick: () => {
3123
3156
  $(e, { type: "codeBlock" });
3124
3157
  },
3125
- badge: C("Mod-Alt-c"),
3158
+ badge: E("Mod-Alt-c"),
3126
3159
  key: "code_block",
3127
3160
  ...e.dictionary.slash_menu.code_block
3128
- }), Z(e, "divider") && t.push({
3161
+ }), X(e, "divider") && t.push({
3129
3162
  onItemClick: () => {
3130
3163
  $(e, { type: "divider" });
3131
3164
  },
3132
3165
  key: "divider",
3133
3166
  ...e.dictionary.slash_menu.divider
3134
- }), Z(e, "table") && t.push({
3167
+ }), X(e, "table") && t.push({
3135
3168
  onItemClick: () => {
3136
3169
  $(e, {
3137
3170
  type: "table",
@@ -3152,35 +3185,35 @@ function Ir(e) {
3152
3185
  badge: void 0,
3153
3186
  key: "table",
3154
3187
  ...e.dictionary.slash_menu.table
3155
- }), Z(e, "image", { url: "string" }) && t.push({
3188
+ }), X(e, "image", { url: "string" }) && t.push({
3156
3189
  onItemClick: () => {
3157
3190
  let t = $(e, { type: "image" });
3158
- e.getExtension(Y)?.showMenu(t.id);
3191
+ e.getExtension(Y)?.showMenu(t.id), e.getExtension(Z)?.store.setState(!1);
3159
3192
  },
3160
3193
  key: "image",
3161
3194
  ...e.dictionary.slash_menu.image
3162
- }), Z(e, "video", { url: "string" }) && t.push({
3195
+ }), X(e, "video", { url: "string" }) && t.push({
3163
3196
  onItemClick: () => {
3164
3197
  let t = $(e, { type: "video" });
3165
- e.getExtension(Y)?.showMenu(t.id);
3198
+ e.getExtension(Y)?.showMenu(t.id), e.getExtension(Z)?.store.setState(!1);
3166
3199
  },
3167
3200
  key: "video",
3168
3201
  ...e.dictionary.slash_menu.video
3169
- }), Z(e, "audio", { url: "string" }) && t.push({
3202
+ }), X(e, "audio", { url: "string" }) && t.push({
3170
3203
  onItemClick: () => {
3171
3204
  let t = $(e, { type: "audio" });
3172
- e.getExtension(Y)?.showMenu(t.id);
3205
+ e.getExtension(Y)?.showMenu(t.id), e.getExtension(Z)?.store.setState(!1);
3173
3206
  },
3174
3207
  key: "audio",
3175
3208
  ...e.dictionary.slash_menu.audio
3176
- }), Z(e, "file", { url: "string" }) && t.push({
3209
+ }), X(e, "file", { url: "string" }) && t.push({
3177
3210
  onItemClick: () => {
3178
3211
  let t = $(e, { type: "file" });
3179
- e.getExtension(Y)?.showMenu(t.id);
3212
+ e.getExtension(Y)?.showMenu(t.id), e.getExtension(Z)?.store.setState(!1);
3180
3213
  },
3181
3214
  key: "file",
3182
3215
  ...e.dictionary.slash_menu.file
3183
- }), Z(e, "heading", {
3216
+ }), X(e, "heading", {
3184
3217
  level: "number",
3185
3218
  isToggleable: "boolean"
3186
3219
  }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((e) => e <= 3).forEach((n) => {
@@ -3197,7 +3230,7 @@ function Ir(e) {
3197
3230
  key: n === 1 ? "toggle_heading" : `toggle_heading_${n}`,
3198
3231
  ...e.dictionary.slash_menu[n === 1 ? "toggle_heading" : `toggle_heading_${n}`]
3199
3232
  });
3200
- }), Z(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((e) => e > 3).forEach((n) => {
3233
+ }), X(e, "heading", { level: "number" }) && (e.schema.blockSchema.heading.propSchema.level.values || []).filter((e) => e > 3).forEach((n) => {
3201
3234
  t.push({
3202
3235
  onItemClick: () => {
3203
3236
  $(e, {
@@ -3205,13 +3238,13 @@ function Ir(e) {
3205
3238
  props: { level: n }
3206
3239
  });
3207
3240
  },
3208
- badge: C(`Mod-Alt-${n}`),
3241
+ badge: E(`Mod-Alt-${n}`),
3209
3242
  key: `heading_${n}`,
3210
3243
  ...e.dictionary.slash_menu[`heading_${n}`]
3211
3244
  });
3212
3245
  }), t.push({
3213
3246
  onItemClick: () => {
3214
- e.getExtension(Pr)?.openSuggestionMenu(":", {
3247
+ e.getExtension(Vr)?.openSuggestionMenu(":", {
3215
3248
  deleteTriggerCharacter: !0,
3216
3249
  ignoreQueryLength: !0
3217
3250
  });
@@ -3220,17 +3253,17 @@ function Ir(e) {
3220
3253
  ...e.dictionary.slash_menu.emoji
3221
3254
  }), t;
3222
3255
  }
3223
- function Lr(e, t) {
3256
+ function Wr(e, t) {
3224
3257
  return e.filter(({ title: e, aliases: n }) => e.toLowerCase().includes(t.toLowerCase()) || n && n.filter((e) => e.toLowerCase().includes(t.toLowerCase())).length !== 0);
3225
3258
  }
3226
3259
  //#endregion
3227
3260
  //#region src/blocks/PageBreak/getPageBreakSlashMenuItems.ts
3228
- function Rr(e) {
3261
+ function Gr(e) {
3229
3262
  return "pageBreak" in e.schema.blockSchema;
3230
3263
  }
3231
- function zr(e) {
3264
+ function Kr(e) {
3232
3265
  let t = [];
3233
- return Rr(e) && t.push({
3266
+ return Gr(e) && t.push({
3234
3267
  ...e.dictionary.slash_menu.page_break,
3235
3268
  onItemClick: () => {
3236
3269
  $(e, { type: "pageBreak" });
@@ -3240,22 +3273,22 @@ function zr(e) {
3240
3273
  }
3241
3274
  //#endregion
3242
3275
  //#region src/blocks/defaultBlocks.ts
3243
- var Br = {
3244
- audio: mn(),
3245
- bulletListItem: qn(),
3246
- checkListItem: Yn(),
3247
- codeBlock: yn(),
3248
- divider: Sn(),
3249
- file: En(),
3250
- heading: Nn(),
3251
- image: Vn(),
3252
- numberedListItem: er(),
3253
- paragraph: sr(),
3254
- quote: lr(),
3255
- table: br(),
3256
- toggleListItem: nr(),
3257
- video: Tr()
3258
- }, Vr = ht({
3276
+ var qr = {
3277
+ audio: xn(),
3278
+ bulletListItem: er(),
3279
+ checkListItem: nr(),
3280
+ codeBlock: En(),
3281
+ divider: kn(),
3282
+ file: Nn(),
3283
+ heading: Bn(),
3284
+ image: Jn(),
3285
+ numberedListItem: sr(),
3286
+ paragraph: mr(),
3287
+ quote: gr(),
3288
+ table: Dr(),
3289
+ toggleListItem: lr(),
3290
+ video: Mr()
3291
+ }, Jr = bt({
3259
3292
  type: "textColor",
3260
3293
  propSchema: "string"
3261
3294
  }, {
@@ -3276,7 +3309,7 @@ var Br = {
3276
3309
  parse: (e) => {
3277
3310
  if (e.tagName === "SPAN" && e.style.color) return e.style.color;
3278
3311
  }
3279
- }), Hr = ht({
3312
+ }), Yr = bt({
3280
3313
  type: "backgroundColor",
3281
3314
  propSchema: "string"
3282
3315
  }, {
@@ -3297,15 +3330,26 @@ var Br = {
3297
3330
  parse: (e) => {
3298
3331
  if (e.tagName === "SPAN" && e.style.backgroundColor) return e.style.backgroundColor;
3299
3332
  }
3300
- }), Ur = {
3301
- bold: R(Se, "boolean"),
3302
- italic: R(we, "boolean"),
3303
- underline: R(Ee, "boolean"),
3304
- strike: R(Te, "boolean"),
3305
- code: R(Ce, "boolean"),
3306
- textColor: Vr,
3307
- backgroundColor: Hr
3308
- }, Wr = pt(Ur), Gr = {
3333
+ }), Xr = {
3334
+ bold: z(De, "boolean"),
3335
+ italic: z(ke, "boolean"),
3336
+ underline: z(je, "boolean"),
3337
+ strike: z(Ae, "boolean"),
3338
+ code: z(Oe.extend({ addInputRules() {
3339
+ return [_({
3340
+ find: /(^|[^`])`([^`]+)`(?!`)$/,
3341
+ type: this.type
3342
+ }), new c({
3343
+ find: /(^|[^`])`([^`]+)`(?!`) $/,
3344
+ handler: ({ state: e, range: t, match: n }) => {
3345
+ let { tr: r, schema: i } = e, a = n[1], o = n[2];
3346
+ r.replaceWith(t.from + a.length, t.to, [i.text(o, [this.type.create()]), i.text(" ")]);
3347
+ }
3348
+ })];
3349
+ } }), "boolean"),
3350
+ textColor: Jr,
3351
+ backgroundColor: Yr
3352
+ }, Zr = vt(Xr), Qr = {
3309
3353
  text: {
3310
3354
  config: "text",
3311
3355
  implementation: {}
@@ -3314,16 +3358,16 @@ var Br = {
3314
3358
  config: "link",
3315
3359
  implementation: {}
3316
3360
  }
3317
- }, Kr = ut(Gr), qr = class e extends Tt {
3361
+ }, $r = ht(Qr), ei = class e extends At {
3318
3362
  static create(t) {
3319
3363
  return new e({
3320
- blockSpecs: t?.blockSpecs ?? Br,
3321
- inlineContentSpecs: t?.inlineContentSpecs ?? Gr,
3322
- styleSpecs: t?.styleSpecs ?? Ur
3364
+ blockSpecs: t?.blockSpecs ?? qr,
3365
+ inlineContentSpecs: t?.inlineContentSpecs ?? Qr,
3366
+ styleSpecs: t?.styleSpecs ?? Xr
3323
3367
  });
3324
3368
  }
3325
3369
  };
3326
3370
  //#endregion
3327
- export { En as $, ct as $t, rr as A, He as An, Vt as At, qn as B, x as Bn, jt as Bt, pr as C, qe as Cn, Jt as Ct, lr as D, E as Dn, Wt as Dt, cr as E, Ue as En, Ut as Et, $n as F, Ie as Fn, Nt as Ft, Rn as G, Ae as Gn, L as Gt, In as H, b as Hn, Ct as Ht, er as I, Le as In, kt as It, Mn as J, ke as Jn, pt as Jt, zn as K, je as Kn, ft as Kt, Yn as L, w as Ln, Ot as Lt, ar as M, ze as Mn, Lt as Mt, tr as N, Be as Nn, It as Nt, or as O, T as On, U as Ot, nr as P, C as Pn, Ft as Pt, wn as Q, lt as Qt, Jn as R, S as Rn, Et as Rt, br as S, O as Sn, Yt as St, ur as T, We as Tn, W as Tt, Ln as U, Ne as Un, ht as Ut, Hn as V, Pe as Vn, Tt as Vt, Vn as W, Me as Wn, mt as Wt, kn as X, ot as Xt, Nn as Y, dt as Yt, On as Z, st as Zt, Er as _, Xe as _n, en as _t, Wr as a, rt as an, bn as at, Tr as b, Ke as bn, Zt as bt, zr as c, j as cn, fn as ct, $ as d, A as dn, mn as dt, ut as en, Tn as et, Pr as f, P as fn, cn as ft, Or as g, $e as gn, Qt as gt, Z as h, Qe as hn, K as ht, Gr as i, I as in, yn as it, ir as j, Re as jn, Pt as jt, sr as k, Ve as kn, H as kt, Lr as l, M as ln, pn as lt, Dr as m, Ze as mn, J as mt, Br as n, tt as nn, Sn as nt, Ur as o, at as on, ln as ot, jr as p, k as pn, Y as pt, Bn as q, y as qn, R as qt, Kr as r, it as rn, vn as rt, Rr as s, F as sn, dn as st, qr as t, nt as tn, xn as tt, Ir as u, N as un, un as ut, Sr as v, Ye as vn, $t as vt, dr as w, Ge as wn, Gt as wt, wr as x, D as xn, G as xt, Cr as y, Je as yn, q as yt, Kn as z, Fe as zn, At as zt };
3371
+ export { jn as $, mt as $t, mr as A, We as An, U as At, $n as B, Re as Bn, Ft as Bt, Dr as C, j as Cn, tn as Ct, hr as D, Ke as Dn, Jt as Dt, _r as E, qe as En, Zt as Et, lr as F, E as Fn, Bt as Ft, Jn as G, x as Gn, yt as Gt, Yn as H, Le as Hn, At as Ht, or as I, ze as In, Rt as It, qn as J, b as Jn, z as Jt, Gn as K, Fe as Kn, R as Kt, sr as L, Be as Ln, Pt as Lt, dr as M, Ve as Mn, zt as Mt, fr as N, He as Nn, Ht as Nt, gr as O, k as On, Yt as Ot, cr as P, Ue as Pn, Vt as Pt, Fn as Q, ft as Qt, nr as R, D as Rn, Nt as Rt, jr as S, A as Sn, G as St, vr as T, Je as Tn, Xt as Tt, Un as U, S as Un, Ot as Ut, er as V, w as Vn, It as Vt, Wn as W, C as Wn, bt as Wt, Bn as X, gt as Xt, zn as Y, Pe as Yn, vt as Yt, In as Z, dt as Zt, Fr as _, nt as _n, an as _t, Zr as a, L as an, En as at, Ar as b, Ze as bn, q as bt, Kr as c, F as cn, vn as ct, $ as d, ot as dn, _n as dt, pt as en, Nn as et, Vr as f, N as fn, xn as ft, X as g, tt as gn, K as gt, Pr as h, et as hn, J as ht, Qr as i, lt as in, Tn as it, ur as j, Ge as jn, Kt as jt, pr as k, O as kn, W as kt, Wr as l, it as ln, yn as lt, Z as m, M as mn, Y as mt, qr as n, I as nn, On as nt, Xr as o, ct as on, Dn as ot, Rr as p, P as pn, hn as pt, Kn as q, Ie as qn, _t as qt, $r as r, st as rn, kn as rt, Gr as s, ut as sn, gn as st, ei as t, ht as tn, Mn as tt, Ur as u, at as un, bn as ut, Nr as v, $e as vn, sn as vt, br as w, Xe as wn, en as wt, Mr as x, Ye as xn, rn as xt, kr as y, Qe as yn, on as yt, tr as z, T as zn, jt as zt };
3328
3372
 
3329
- //# sourceMappingURL=blocks-CSfJen16.js.map
3373
+ //# sourceMappingURL=blocks-D0lMxErU.js.map