@blocknote/core 0.15.7 → 0.15.10

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 (82) hide show
  1. package/dist/blocknote.js +1304 -1194
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +5 -5
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/webpack-stats.json +1 -1
  6. package/package.json +23 -23
  7. package/src/api/exporters/copyExtension.ts +48 -33
  8. package/src/api/exporters/html/__snapshots__/complex/misc/external.html +1 -1
  9. package/src/api/exporters/html/__snapshots__/customParagraph/styled/external.html +1 -1
  10. package/src/api/exporters/html/__snapshots__/file/basic/external.html +1 -1
  11. package/src/api/exporters/html/__snapshots__/file/nested/external.html +1 -1
  12. package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +1 -1
  13. package/src/api/exporters/html/__snapshots__/file/noName/external.html +1 -1
  14. package/src/api/exporters/html/__snapshots__/fontSize/basic/external.html +1 -1
  15. package/src/api/exporters/html/__snapshots__/hardbreak/basic/external.html +1 -1
  16. package/src/api/exporters/html/__snapshots__/hardbreak/between-links/external.html +1 -1
  17. package/src/api/exporters/html/__snapshots__/hardbreak/end/external.html +1 -1
  18. package/src/api/exporters/html/__snapshots__/hardbreak/link/external.html +1 -1
  19. package/src/api/exporters/html/__snapshots__/hardbreak/multiple/external.html +1 -1
  20. package/src/api/exporters/html/__snapshots__/hardbreak/only/external.html +1 -1
  21. package/src/api/exporters/html/__snapshots__/hardbreak/start/external.html +1 -1
  22. package/src/api/exporters/html/__snapshots__/hardbreak/styles/external.html +1 -1
  23. package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -1
  24. package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -1
  25. package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +1 -1
  26. package/src/api/exporters/html/__snapshots__/image/noName/external.html +1 -1
  27. package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +1 -1
  28. package/src/api/exporters/html/__snapshots__/link/adjacent/external.html +1 -1
  29. package/src/api/exporters/html/__snapshots__/link/basic/external.html +1 -1
  30. package/src/api/exporters/html/__snapshots__/link/styled/external.html +1 -1
  31. package/src/api/exporters/html/__snapshots__/mention/basic/external.html +1 -1
  32. package/src/api/exporters/html/__snapshots__/paragraph/basic/external.html +1 -1
  33. package/src/api/exporters/html/__snapshots__/paragraph/empty/external.html +1 -1
  34. package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/external.html +1 -1
  35. package/src/api/exporters/html/__snapshots__/paragraph/nested/external.html +1 -1
  36. package/src/api/exporters/html/__snapshots__/paragraph/styled/external.html +1 -1
  37. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/external.html +1 -1
  38. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/external.html +1 -1
  39. package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/external.html +1 -1
  40. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  41. package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
  42. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  43. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
  44. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
  45. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -1
  46. package/src/api/exporters/html/__snapshots__/small/basic/external.html +1 -1
  47. package/src/api/exporters/html/__snapshots__/tag/basic/external.html +1 -1
  48. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionLeavesBlockChildren.html +1 -1
  49. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionSpansBlocksChildren.html +1 -1
  50. package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionWithinBlockChildren.html +1 -1
  51. package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +51 -2
  52. package/src/api/parsers/handleFileInsertion.ts +30 -17
  53. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +23 -47
  54. package/src/blocks/FileBlockContent/FileBlockContent.ts +4 -22
  55. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +72 -1
  56. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +35 -61
  57. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +33 -58
  58. package/src/editor/BlockNoteEditor.test.ts +13 -0
  59. package/src/editor/BlockNoteEditor.ts +71 -6
  60. package/src/editor/BlockNoteExtensions.ts +4 -2
  61. package/src/editor/BlockNoteTipTapEditor.ts +4 -1
  62. package/src/extensions/FilePanel/FilePanelPlugin.ts +10 -6
  63. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +0 -1
  64. package/src/extensions/SideMenu/SideMenuPlugin.ts +22 -11
  65. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +6 -3
  66. package/src/extensions/TableHandles/TableHandlesPlugin.ts +5 -1
  67. package/src/extensions/UniqueID/UniqueID.ts +15 -4
  68. package/src/pm-nodes/BlockContainer.ts +1 -2
  69. package/src/schema/blocks/createSpec.ts +31 -2
  70. package/src/schema/blocks/types.ts +2 -0
  71. package/src/schema/inlineContent/createSpec.ts +58 -6
  72. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +2 -2
  73. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +2 -2
  74. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +11 -1
  75. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -2
  76. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -2
  77. package/types/src/editor/BlockNoteEditor.d.ts +23 -4
  78. package/types/src/editor/BlockNoteExtensions.d.ts +1 -0
  79. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +1 -1
  80. package/types/src/schema/blocks/createSpec.d.ts +3 -0
  81. package/types/src/schema/blocks/types.d.ts +2 -0
  82. package/types/src/schema/inlineContent/createSpec.d.ts +5 -4
package/dist/blocknote.js CHANGED
@@ -1,29 +1,29 @@
1
- var St = Object.defineProperty;
2
- var Mt = (e, t, i) => t in e ? St(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
- var c = (e, t, i) => Mt(e, typeof t != "symbol" ? t + "" : t, i);
4
- import { Slice as j, Fragment as I, DOMSerializer as Ee, DOMParser as Tt, Node as Bt } from "prosemirror-model";
5
- import { Extension as T, combineTransactionSteps as Lt, getChangedRanges as It, findChildrenInRange as At, Node as q, Mark as Ce, InputRule as te, callOrReturn as Nt, getExtensionField as Pt, mergeAttributes as Ht, selectionToInsertionEnd as Dt, isTextSelection as Ut, isNodeSelection as jt, posToDOMRect as ve, getMarkRange as Ue, findParentNode as zt, findChildren as je, extensions as Y, Editor as Rt, createDocument as Vt, getSchema as Ot } from "@tiptap/core";
6
- import { Plugin as w, PluginKey as M, Selection as ge, NodeSelection as se, TextSelection as Q, EditorState as Ft } from "prosemirror-state";
7
- import { v4 as Gt } from "uuid";
8
- import Kt from "@tiptap/extension-bold";
9
- import Wt from "@tiptap/extension-code";
10
- import $t from "@tiptap/extension-italic";
11
- import qt from "@tiptap/extension-strike";
12
- import Xt from "@tiptap/extension-underline";
13
- import { TableCell as Zt } from "@tiptap/extension-table-cell";
14
- import { TableHeader as Jt } from "@tiptap/extension-table-header";
15
- import { TableRow as Yt } from "@tiptap/extension-table-row";
16
- import { columnResizing as Qt, tableEditing as ei } from "prosemirror-tables";
17
- import { DecorationSet as K, Decoration as W, EditorView as ti } from "prosemirror-view";
18
- import ii from "@tiptap/extension-collaboration";
19
- import oi from "@tiptap/extension-collaboration-cursor";
20
- import { Dropcursor as ni } from "@tiptap/extension-dropcursor";
21
- import { Gapcursor as ri } from "@tiptap/extension-gapcursor";
22
- import { HardBreak as ai } from "@tiptap/extension-hard-break";
23
- import { History as si } from "@tiptap/extension-history";
24
- import { Link as li } from "@tiptap/extension-link";
25
- import { Text as di } from "@tiptap/extension-text";
26
- const ci = {
1
+ var Bt = Object.defineProperty;
2
+ var Lt = (e, t, i) => t in e ? Bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
+ var c = (e, t, i) => Lt(e, typeof t != "symbol" ? t + "" : t, i);
4
+ import { Slice as z, Fragment as N, DOMSerializer as Ee, DOMParser as It, Node as At } from "prosemirror-model";
5
+ import { Extension as I, combineTransactionSteps as Nt, getChangedRanges as Pt, findChildrenInRange as Ht, Node as q, Mark as Ce, InputRule as ee, callOrReturn as Ut, getExtensionField as Dt, mergeAttributes as jt, selectionToInsertionEnd as zt, isTextSelection as Vt, isNodeSelection as Rt, posToDOMRect as we, getMarkRange as De, findParentNode as Ot, extensions as J, Editor as Ft, createDocument as Gt, findChildren as je, getSchema as Wt } from "@tiptap/core";
6
+ import { Plugin as x, PluginKey as L, Selection as fe, NodeSelection as le, TextSelection as Y, EditorState as Kt } from "prosemirror-state";
7
+ import { v4 as $t } from "uuid";
8
+ import qt from "@tiptap/extension-bold";
9
+ import Xt from "@tiptap/extension-code";
10
+ import Zt from "@tiptap/extension-italic";
11
+ import Jt from "@tiptap/extension-strike";
12
+ import Yt from "@tiptap/extension-underline";
13
+ import { TableCell as Qt } from "@tiptap/extension-table-cell";
14
+ import { TableHeader as ei } from "@tiptap/extension-table-header";
15
+ import { TableRow as ti } from "@tiptap/extension-table-row";
16
+ import { columnResizing as ii, tableEditing as oi } from "prosemirror-tables";
17
+ import { DecorationSet as K, Decoration as $, EditorView as ni } from "prosemirror-view";
18
+ import ri from "@tiptap/extension-collaboration";
19
+ import ai from "@tiptap/extension-collaboration-cursor";
20
+ import { Dropcursor as si } from "@tiptap/extension-dropcursor";
21
+ import { Gapcursor as li } from "@tiptap/extension-gapcursor";
22
+ import { HardBreak as di } from "@tiptap/extension-hard-break";
23
+ import { History as ci } from "@tiptap/extension-history";
24
+ import { Link as ui } from "@tiptap/extension-link";
25
+ import { Text as pi } from "@tiptap/extension-text";
26
+ const hi = {
27
27
  slash_menu: {
28
28
  heading: {
29
29
  title: "عنوان 1",
@@ -313,7 +313,7 @@ const ci = {
313
313
  generic: {
314
314
  ctrl_shortcut: "Ctrl"
315
315
  }
316
- }, ui = {
316
+ }, mi = {
317
317
  slash_menu: {
318
318
  heading: {
319
319
  title: "Überschrift 1",
@@ -618,7 +618,7 @@ const ci = {
618
618
  generic: {
619
619
  ctrl_shortcut: "Strg"
620
620
  }
621
- }, Je = {
621
+ }, Qe = {
622
622
  slash_menu: {
623
623
  heading: {
624
624
  title: "Heading 1",
@@ -924,7 +924,7 @@ const ci = {
924
924
  generic: {
925
925
  ctrl_shortcut: "Ctrl"
926
926
  }
927
- }, pi = {
927
+ }, fi = {
928
928
  slash_menu: {
929
929
  heading: {
930
930
  title: "Encabezado 1",
@@ -1197,7 +1197,7 @@ const ci = {
1197
1197
  generic: {
1198
1198
  ctrl_shortcut: "Ctrl"
1199
1199
  }
1200
- }, hi = {
1200
+ }, gi = {
1201
1201
  slash_menu: {
1202
1202
  heading: {
1203
1203
  title: "Titre 1",
@@ -1502,7 +1502,7 @@ const ci = {
1502
1502
  generic: {
1503
1503
  ctrl_shortcut: "Ctrl"
1504
1504
  }
1505
- }, mi = {
1505
+ }, bi = {
1506
1506
  slash_menu: {
1507
1507
  heading: {
1508
1508
  title: "Fyrirsögn 1",
@@ -1799,7 +1799,7 @@ const ci = {
1799
1799
  generic: {
1800
1800
  ctrl_shortcut: "Ctrl"
1801
1801
  }
1802
- }, fi = {
1802
+ }, _i = {
1803
1803
  slash_menu: {
1804
1804
  heading: {
1805
1805
  title: "見出し1",
@@ -2124,7 +2124,7 @@ const ci = {
2124
2124
  generic: {
2125
2125
  ctrl_shortcut: "Ctrl"
2126
2126
  }
2127
- }, gi = {
2127
+ }, ki = {
2128
2128
  slash_menu: {
2129
2129
  heading: {
2130
2130
  title: "제목1",
@@ -2442,7 +2442,7 @@ const ci = {
2442
2442
  generic: {
2443
2443
  ctrl_shortcut: "Ctrl"
2444
2444
  }
2445
- }, bi = {
2445
+ }, yi = {
2446
2446
  slash_menu: {
2447
2447
  heading: {
2448
2448
  title: "Kop 1",
@@ -2747,7 +2747,7 @@ const ci = {
2747
2747
  generic: {
2748
2748
  ctrl_shortcut: "Ctrl"
2749
2749
  }
2750
- }, _i = {
2750
+ }, wi = {
2751
2751
  slash_menu: {
2752
2752
  heading: {
2753
2753
  title: "Nagłówek 1",
@@ -3036,7 +3036,7 @@ const ci = {
3036
3036
  generic: {
3037
3037
  ctrl_shortcut: "Ctrl"
3038
3038
  }
3039
- }, ki = {
3039
+ }, vi = {
3040
3040
  slash_menu: {
3041
3041
  heading: {
3042
3042
  title: "Título",
@@ -3333,7 +3333,7 @@ const ci = {
3333
3333
  generic: {
3334
3334
  ctrl_shortcut: "Ctrl"
3335
3335
  }
3336
- }, yi = {
3336
+ }, xi = {
3337
3337
  slash_menu: {
3338
3338
  heading: {
3339
3339
  title: "Заголовок 1 уровня",
@@ -3665,7 +3665,7 @@ const ci = {
3665
3665
  generic: {
3666
3666
  ctrl_shortcut: "Ctrl"
3667
3667
  }
3668
- }, wi = {
3668
+ }, Ei = {
3669
3669
  slash_menu: {
3670
3670
  heading: {
3671
3671
  title: "Tiêu đề H1",
@@ -3969,7 +3969,7 @@ const ci = {
3969
3969
  generic: {
3970
3970
  ctrl_shortcut: "Ctrl"
3971
3971
  }
3972
- }, vi = {
3972
+ }, Ci = {
3973
3973
  slash_menu: {
3974
3974
  heading: {
3975
3975
  title: "一级标题",
@@ -4307,27 +4307,27 @@ const ci = {
4307
4307
  generic: {
4308
4308
  ctrl_shortcut: "Ctrl"
4309
4309
  }
4310
- }, xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4310
+ }, Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4311
4311
  __proto__: null,
4312
- ar: ci,
4313
- de: ui,
4314
- en: Je,
4315
- es: pi,
4316
- fr: hi,
4317
- is: mi,
4318
- ja: fi,
4319
- ko: gi,
4320
- nl: bi,
4321
- pl: _i,
4322
- pt: ki,
4323
- ru: yi,
4324
- vi: wi,
4325
- zh: vi
4312
+ ar: hi,
4313
+ de: mi,
4314
+ en: Qe,
4315
+ es: fi,
4316
+ fr: gi,
4317
+ is: bi,
4318
+ ja: _i,
4319
+ ko: ki,
4320
+ nl: yi,
4321
+ pl: wi,
4322
+ pt: vi,
4323
+ ru: xi,
4324
+ vi: Ei,
4325
+ zh: Ci
4326
4326
  }, Symbol.toStringTag, { value: "Module" }));
4327
- let P;
4328
- async function oe() {
4329
- if (P)
4330
- return P;
4327
+ let H;
4328
+ async function ie() {
4329
+ if (H)
4330
+ return H;
4331
4331
  const e = await Promise.all([
4332
4332
  import("rehype-parse"),
4333
4333
  import("rehype-stringify"),
@@ -4340,7 +4340,7 @@ async function oe() {
4340
4340
  import("remark-rehype"),
4341
4341
  import("rehype-format")
4342
4342
  ]);
4343
- return P = {
4343
+ return H = {
4344
4344
  rehypeParse: e[0],
4345
4345
  rehypeStringify: e[1],
4346
4346
  unified: e[2],
@@ -4351,22 +4351,22 @@ async function oe() {
4351
4351
  remarkParse: e[7],
4352
4352
  remarkRehype: e[8],
4353
4353
  rehypeFormat: e[9]
4354
- }, P;
4354
+ }, H;
4355
4355
  }
4356
- function xi(e, t = JSON.stringify) {
4356
+ function Si(e, t = JSON.stringify) {
4357
4357
  const i = {};
4358
4358
  return e.filter((o) => {
4359
4359
  const n = t(o);
4360
4360
  return Object.prototype.hasOwnProperty.call(i, n) ? !1 : i[n] = !0;
4361
4361
  });
4362
4362
  }
4363
- function Ei(e) {
4363
+ function Mi(e) {
4364
4364
  const t = e.filter(
4365
4365
  (o, n) => e.indexOf(o) !== n
4366
4366
  );
4367
- return xi(t);
4367
+ return Si(t);
4368
4368
  }
4369
- const ne = T.create({
4369
+ const oe = I.create({
4370
4370
  name: "uniqueID",
4371
4371
  // we’ll set a very high priority to make sure this runs first
4372
4372
  // and is compatible with `appendTransaction` hooks of other extensions
@@ -4375,12 +4375,13 @@ const ne = T.create({
4375
4375
  return {
4376
4376
  attributeName: "id",
4377
4377
  types: [],
4378
+ setIdAttribute: !1,
4378
4379
  generateID: () => {
4379
4380
  if (typeof window < "u" && window.__TEST_OPTIONS) {
4380
4381
  const e = window.__TEST_OPTIONS;
4381
4382
  return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
4382
4383
  }
4383
- return Gt();
4384
+ return $t();
4384
4385
  },
4385
4386
  filterTransaction: null
4386
4387
  };
@@ -4393,9 +4394,15 @@ const ne = T.create({
4393
4394
  [this.options.attributeName]: {
4394
4395
  default: null,
4395
4396
  parseHTML: (e) => e.getAttribute(`data-${this.options.attributeName}`),
4396
- renderHTML: (e) => ({
4397
- [`data-${this.options.attributeName}`]: e[this.options.attributeName]
4398
- })
4397
+ renderHTML: (e) => {
4398
+ const t = {
4399
+ [`data-${this.options.attributeName}`]: e[this.options.attributeName]
4400
+ };
4401
+ return this.options.setIdAttribute ? {
4402
+ ...t,
4403
+ id: e[this.options.attributeName]
4404
+ } : t;
4405
+ }
4399
4406
  }
4400
4407
  }
4401
4408
  }
@@ -4434,51 +4441,51 @@ const ne = T.create({
4434
4441
  addProseMirrorPlugins() {
4435
4442
  let e = null, t = !1;
4436
4443
  return [
4437
- new w({
4438
- key: new M("uniqueID"),
4444
+ new x({
4445
+ key: new L("uniqueID"),
4439
4446
  appendTransaction: (i, o, n) => {
4440
- const r = i.some((g) => g.docChanged) && !o.doc.eq(n.doc), a = this.options.filterTransaction && i.some((g) => {
4441
- let f, b;
4442
- return !(!((b = (f = this.options).filterTransaction) === null || b === void 0) && b.call(f, g));
4447
+ const r = i.some((f) => f.docChanged) && !o.doc.eq(n.doc), a = this.options.filterTransaction && i.some((f) => {
4448
+ let g, k;
4449
+ return !(!((k = (g = this.options).filterTransaction) === null || k === void 0) && k.call(g, f));
4443
4450
  });
4444
4451
  if (!r || a)
4445
4452
  return;
4446
- const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p = Lt(
4453
+ const { tr: s } = n, { types: l, attributeName: d, generateID: u } = this.options, p = Nt(
4447
4454
  o.doc,
4448
4455
  i
4449
4456
  ), { mapping: h } = p;
4450
- if (It(p).forEach(({ newRange: g }) => {
4451
- const f = At(
4457
+ if (Pt(p).forEach(({ newRange: f }) => {
4458
+ const g = Ht(
4452
4459
  n.doc,
4453
- g,
4454
- (B) => l.includes(B.type.name)
4455
- ), b = f.map(({ node: B }) => B.attrs[d]).filter((B) => B !== null), y = Ei(b);
4456
- f.forEach(({ node: B, pos: N }) => {
4457
- let J;
4458
- const Pe = (J = s.doc.nodeAt(N)) === null || J === void 0 ? void 0 : J.attrs[d];
4460
+ f,
4461
+ (b) => l.includes(b.type.name)
4462
+ ), k = g.map(({ node: b }) => b.attrs[d]).filter((b) => b !== null), v = Mi(k);
4463
+ g.forEach(({ node: b, pos: y }) => {
4464
+ let S;
4465
+ const Pe = (S = s.doc.nodeAt(y)) === null || S === void 0 ? void 0 : S.attrs[d];
4459
4466
  if (Pe === null) {
4460
4467
  const He = o.doc.type.createAndFill().content;
4461
4468
  if (o.doc.content.findDiffStart(He) === null) {
4462
- const De = JSON.parse(
4469
+ const Ue = JSON.parse(
4463
4470
  JSON.stringify(n.doc.toJSON())
4464
4471
  );
4465
- if (De.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(De.content) === JSON.stringify(He.toJSON())) {
4466
- s.setNodeMarkup(N, void 0, {
4467
- ...B.attrs,
4472
+ if (Ue.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Ue.content) === JSON.stringify(He.toJSON())) {
4473
+ s.setNodeMarkup(y, void 0, {
4474
+ ...b.attrs,
4468
4475
  [d]: "initialBlockId"
4469
4476
  });
4470
4477
  return;
4471
4478
  }
4472
4479
  }
4473
- s.setNodeMarkup(N, void 0, {
4474
- ...B.attrs,
4480
+ s.setNodeMarkup(y, void 0, {
4481
+ ...b.attrs,
4475
4482
  [d]: u()
4476
4483
  });
4477
4484
  return;
4478
4485
  }
4479
- const { deleted: Ct } = h.invert().mapResult(N);
4480
- Ct && y.includes(Pe) && s.setNodeMarkup(N, void 0, {
4481
- ...B.attrs,
4486
+ const { deleted: Tt } = h.invert().mapResult(y);
4487
+ Tt && v.includes(Pe) && s.setNodeMarkup(y, void 0, {
4488
+ ...b.attrs,
4482
4489
  [d]: u()
4483
4490
  });
4484
4491
  });
@@ -4535,9 +4542,9 @@ const ne = T.create({
4535
4542
  l.marks
4536
4543
  );
4537
4544
  s.push(d);
4538
- }), I.from(s);
4545
+ }), N.from(s);
4539
4546
  };
4540
- return t = !1, new j(
4547
+ return t = !1, new z(
4541
4548
  r(i.content),
4542
4549
  i.openStart,
4543
4550
  i.openEnd
@@ -4548,7 +4555,7 @@ const ne = T.create({
4548
4555
  ];
4549
4556
  }
4550
4557
  });
4551
- function Ye(e) {
4558
+ function et(e) {
4552
4559
  const t = e.attrs.id, i = e.firstChild, o = i.type, n = e.childCount === 2 ? e.lastChild.childCount : 0;
4553
4560
  return {
4554
4561
  id: t,
@@ -4578,7 +4585,7 @@ function _(e, t) {
4578
4585
  break;
4579
4586
  s -= 1, a = n.node(s);
4580
4587
  }
4581
- const { id: l, contentNode: d, contentType: u, numChildBlocks: p } = Ye(a), h = n.start(s), m = n.end(s);
4588
+ const { id: l, contentNode: d, contentType: u, numChildBlocks: p } = et(a), h = n.start(s), m = n.end(s);
4582
4589
  return {
4583
4590
  id: l,
4584
4591
  node: a,
@@ -4593,23 +4600,23 @@ function _(e, t) {
4593
4600
  function ze(e) {
4594
4601
  return e.type === "link";
4595
4602
  }
4596
- function Qe(e) {
4603
+ function tt(e) {
4597
4604
  return typeof e != "string" && e.type === "link";
4598
4605
  }
4599
- function ie(e) {
4606
+ function te(e) {
4600
4607
  return typeof e != "string" && e.type === "text";
4601
4608
  }
4602
- class A extends Error {
4609
+ class P extends Error {
4603
4610
  constructor(t) {
4604
4611
  super(`Unreachable case: ${t}`);
4605
4612
  }
4606
4613
  }
4607
- function Er(e, t = !0) {
4614
+ function Tr(e, t = !0) {
4608
4615
  const { "data-test": i, ...o } = e;
4609
4616
  if (Object.keys(o).length > 0 && t)
4610
4617
  throw new Error("Object must be empty " + JSON.stringify(e));
4611
4618
  }
4612
- function Re(e, t, i) {
4619
+ function Ve(e, t, i) {
4613
4620
  const o = [];
4614
4621
  for (const [n, r] of Object.entries(e.styles)) {
4615
4622
  const a = i[n];
@@ -4620,16 +4627,16 @@ function Re(e, t, i) {
4620
4627
  else if (a.propSchema === "string")
4621
4628
  o.push(t.mark(n, { stringValue: r }));
4622
4629
  else
4623
- throw new A(a.propSchema);
4630
+ throw new P(a.propSchema);
4624
4631
  }
4625
4632
  return e.text.split(/(\n)/g).filter((n) => n.length > 0).map((n) => n === `
4626
4633
  ` ? t.nodes.hardBreak.create() : t.text(n, o));
4627
4634
  }
4628
- function Ci(e, t, i) {
4635
+ function Ti(e, t, i) {
4629
4636
  const o = t.marks.link.create({
4630
4637
  href: e.href
4631
4638
  });
4632
- return xe(e.content, t, i).map(
4639
+ return ve(e.content, t, i).map(
4633
4640
  (n) => {
4634
4641
  if (n.type.name === "text")
4635
4642
  return n.mark([...n.marks, o]);
@@ -4639,29 +4646,29 @@ function Ci(e, t, i) {
4639
4646
  }
4640
4647
  );
4641
4648
  }
4642
- function xe(e, t, i) {
4649
+ function ve(e, t, i) {
4643
4650
  const o = [];
4644
4651
  if (typeof e == "string")
4645
4652
  return o.push(
4646
- ...Re(
4653
+ ...Ve(
4647
4654
  { type: "text", text: e, styles: {} },
4648
4655
  t,
4649
4656
  i
4650
4657
  )
4651
4658
  ), o;
4652
4659
  for (const n of e)
4653
- o.push(...Re(n, t, i));
4660
+ o.push(...Ve(n, t, i));
4654
4661
  return o;
4655
4662
  }
4656
- function $(e, t, i) {
4663
+ function V(e, t, i) {
4657
4664
  const o = [];
4658
4665
  for (const n of e)
4659
- typeof n == "string" ? o.push(...xe(n, t, i)) : Qe(n) ? o.push(...Ci(n, t, i)) : ie(n) ? o.push(...xe([n], t, i)) : o.push(
4660
- tt(n, t, i)
4666
+ typeof n == "string" ? o.push(...ve(n, t, i)) : tt(n) ? o.push(...Ti(n, t, i)) : te(n) ? o.push(...ve([n], t, i)) : o.push(
4667
+ ot(n, t, i)
4661
4668
  );
4662
4669
  return o;
4663
4670
  }
4664
- function et(e, t, i) {
4671
+ function it(e, t, i) {
4665
4672
  const o = [];
4666
4673
  for (const n of e.rows) {
4667
4674
  const r = [];
@@ -4672,7 +4679,7 @@ function et(e, t, i) {
4672
4679
  else if (typeof s == "string")
4673
4680
  l = t.nodes.tableParagraph.create({}, t.text(s));
4674
4681
  else {
4675
- const u = $(s, t, i);
4682
+ const u = V(s, t, i);
4676
4683
  l = t.nodes.tableParagraph.create({}, u);
4677
4684
  }
4678
4685
  const d = t.nodes.tableCell.create({}, l);
@@ -4683,36 +4690,36 @@ function et(e, t, i) {
4683
4690
  }
4684
4691
  return o;
4685
4692
  }
4686
- function tt(e, t, i) {
4693
+ function ot(e, t, i) {
4687
4694
  let o, n = e.type;
4688
4695
  if (n === void 0 && (n = "paragraph"), !t.nodes[n])
4689
4696
  throw new Error(`node type ${n} not found in schema`);
4690
4697
  if (!e.content)
4691
4698
  o = t.nodes[n].create(e.props);
4692
4699
  else if (typeof e.content == "string") {
4693
- const r = $([e.content], t, i);
4700
+ const r = V([e.content], t, i);
4694
4701
  o = t.nodes[n].create(e.props, r);
4695
4702
  } else if (Array.isArray(e.content)) {
4696
- const r = $(e.content, t, i);
4703
+ const r = V(e.content, t, i);
4697
4704
  o = t.nodes[n].create(e.props, r);
4698
4705
  } else if (e.content.type === "tableContent") {
4699
- const r = et(e.content, t, i);
4706
+ const r = it(e.content, t, i);
4700
4707
  o = t.nodes[n].create(e.props, r);
4701
4708
  } else
4702
- throw new A(e.content.type);
4709
+ throw new P(e.content.type);
4703
4710
  return o;
4704
4711
  }
4705
- function H(e, t, i) {
4712
+ function U(e, t, i) {
4706
4713
  let o = e.id;
4707
- o === void 0 && (o = ne.options.generateID());
4708
- const n = tt(
4714
+ o === void 0 && (o = oe.options.generateID());
4715
+ const n = ot(
4709
4716
  e,
4710
4717
  t,
4711
4718
  i
4712
4719
  ), r = [];
4713
4720
  if (e.children)
4714
4721
  for (const s of e.children)
4715
- r.push(H(s, t, i));
4722
+ r.push(U(s, t, i));
4716
4723
  const a = t.nodes.blockGroup.create({}, r);
4717
4724
  return t.nodes.blockContainer.create(
4718
4725
  {
@@ -4722,7 +4729,7 @@ function H(e, t, i) {
4722
4729
  r.length > 0 ? [n, a] : n
4723
4730
  );
4724
4731
  }
4725
- function Si(e, t, i) {
4732
+ function Bi(e, t, i) {
4726
4733
  const o = {
4727
4734
  type: "tableContent",
4728
4735
  rows: []
@@ -4748,7 +4755,7 @@ function Se(e, t, i) {
4748
4755
  return e.content.forEach((r) => {
4749
4756
  if (r.type.name === "hardBreak") {
4750
4757
  if (n)
4751
- if (ie(n))
4758
+ if (te(n))
4752
4759
  n.text += `
4753
4760
  `;
4754
4761
  else if (ze(n))
@@ -4767,7 +4774,7 @@ function Se(e, t, i) {
4767
4774
  }
4768
4775
  if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
4769
4776
  n && (o.push(n), n = void 0), o.push(
4770
- it(r, t, i)
4777
+ xe(r, t, i)
4771
4778
  );
4772
4779
  return;
4773
4780
  }
@@ -4785,9 +4792,9 @@ function Se(e, t, i) {
4785
4792
  else if (d.propSchema === "string")
4786
4793
  a[d.type] = l.attrs.stringValue;
4787
4794
  else
4788
- throw new A(d.propSchema);
4795
+ throw new P(d.propSchema);
4789
4796
  }
4790
- n ? ie(n) ? s ? (o.push(n), n = {
4797
+ n ? te(n) ? s ? (o.push(n), n = {
4791
4798
  type: "link",
4792
4799
  href: s.attrs.href,
4793
4800
  content: [
@@ -4838,7 +4845,7 @@ function Se(e, t, i) {
4838
4845
  };
4839
4846
  }), n && o.push(n), o;
4840
4847
  }
4841
- function it(e, t, i) {
4848
+ function xe(e, t, i) {
4842
4849
  if (e.type.name === "text" || e.type.name === "link")
4843
4850
  throw new Error("unexpected");
4844
4851
  const o = {}, n = t[e.type.name];
@@ -4859,7 +4866,7 @@ function it(e, t, i) {
4859
4866
  content: r
4860
4867
  };
4861
4868
  }
4862
- function x(e, t, i, o, n) {
4869
+ function C(e, t, i, o, n) {
4863
4870
  if (e.type.name !== "blockContainer")
4864
4871
  throw Error(
4865
4872
  "Node must be of type blockContainer, but is of type" + e.type.name + "."
@@ -4867,26 +4874,26 @@ function x(e, t, i, o, n) {
4867
4874
  const r = n == null ? void 0 : n.get(e);
4868
4875
  if (r)
4869
4876
  return r;
4870
- const a = Ye(e);
4877
+ const a = et(e);
4871
4878
  let s = a.id;
4872
- s === null && (s = ne.options.generateID());
4879
+ s === null && (s = oe.options.generateID());
4873
4880
  const l = {};
4874
- for (const [m, g] of Object.entries({
4881
+ for (const [m, f] of Object.entries({
4875
4882
  ...e.attrs,
4876
4883
  ...a.contentNode.attrs
4877
4884
  })) {
4878
- const f = t[a.contentType.name];
4879
- if (!f)
4885
+ const g = t[a.contentType.name];
4886
+ if (!g)
4880
4887
  throw Error(
4881
4888
  "Block is of an unrecognized type: " + a.contentType.name
4882
4889
  );
4883
- const b = f.propSchema;
4884
- m in b && (l[m] = g);
4890
+ const k = g.propSchema;
4891
+ m in k && (l[m] = f);
4885
4892
  }
4886
4893
  const d = t[a.contentType.name], u = [];
4887
4894
  for (let m = 0; m < a.numChildBlocks; m++)
4888
4895
  u.push(
4889
- x(
4896
+ C(
4890
4897
  e.lastChild.child(m),
4891
4898
  t,
4892
4899
  i,
@@ -4902,7 +4909,7 @@ function x(e, t, i, o, n) {
4902
4909
  o
4903
4910
  );
4904
4911
  else if (d.content === "table")
4905
- p = Si(
4912
+ p = Bi(
4906
4913
  a.contentNode,
4907
4914
  i,
4908
4915
  o
@@ -4910,7 +4917,7 @@ function x(e, t, i, o, n) {
4910
4917
  else if (d.content === "none")
4911
4918
  p = void 0;
4912
4919
  else
4913
- throw new A(d.content);
4920
+ throw new P(d.content);
4914
4921
  const h = {
4915
4922
  id: s,
4916
4923
  type: d.type,
@@ -4920,14 +4927,14 @@ function x(e, t, i, o, n) {
4920
4927
  };
4921
4928
  return n == null || n.set(e, h), h;
4922
4929
  }
4923
- function Mi(e) {
4930
+ function Li(e) {
4924
4931
  return e.document || window.document;
4925
4932
  }
4926
- const ot = (e, t, i, o, n) => {
4933
+ const nt = (e, t, i, o, n) => {
4927
4934
  if (!i.nodes[e.type.name])
4928
4935
  throw new Error("Serializer is missing a node type: " + e.type.name);
4929
4936
  const { dom: r, contentDOM: a } = Ee.renderSpec(
4930
- Mi(t),
4937
+ Li(t),
4931
4938
  i.nodes[e.type.name](e)
4932
4939
  );
4933
4940
  if (a) {
@@ -4937,7 +4944,7 @@ const ot = (e, t, i, o, n) => {
4937
4944
  const s = e.childCount > 0 && e.firstChild.type.spec.group === "blockContent" ? e.firstChild : void 0, l = e.childCount > 0 && e.lastChild.type.spec.group === "blockGroup" ? e.lastChild : void 0;
4938
4945
  if (s !== void 0) {
4939
4946
  const d = o.blockImplementations[s.type.name].implementation, p = (n ? d.toExternalHTML : d.toInternalHTML)(
4940
- x(
4947
+ C(
4941
4948
  e,
4942
4949
  o.schema.blockSchema,
4943
4950
  o.schema.inlineContentSchema,
@@ -4958,7 +4965,7 @@ const ot = (e, t, i, o, n) => {
4958
4965
  a.appendChild(p.dom);
4959
4966
  }
4960
4967
  l !== void 0 && i.serializeFragment(
4961
- I.from(l),
4968
+ N.from(l),
4962
4969
  t,
4963
4970
  a
4964
4971
  );
@@ -4966,12 +4973,23 @@ const ot = (e, t, i, o, n) => {
4966
4973
  i.serializeFragment(e.content, t, a);
4967
4974
  }
4968
4975
  return r;
4969
- }, nt = (e, t, i) => {
4976
+ }, rt = (e, t, i) => {
4970
4977
  const o = t.serializeFragment(e, i), n = document.createElement("div");
4971
4978
  return n.appendChild(o), n.innerHTML;
4972
4979
  };
4973
- function Ti(e) {
4974
- const t = P;
4980
+ function Re(e, t) {
4981
+ var o;
4982
+ const i = (((o = e.properties) == null ? void 0 : o.className) || []).filter(
4983
+ (n) => !n.startsWith("bn-")
4984
+ ) || [];
4985
+ e.properties = {
4986
+ ...e.properties,
4987
+ ...t,
4988
+ className: i.length > 0 ? i : void 0
4989
+ };
4990
+ }
4991
+ function Ii(e) {
4992
+ const t = H;
4975
4993
  if (!t)
4976
4994
  throw new Error(
4977
4995
  "simplifyBlocks requires ESM dependencies to be initialized"
@@ -4987,45 +5005,60 @@ function Ti(e) {
4987
5005
  }
4988
5006
  let r = n.children.length, a;
4989
5007
  for (let l = 0; l < r; l++) {
4990
- const u = n.children[l].children[0], p = u.children.find((f) => {
4991
- const b = f.properties, y = b == null ? void 0 : b.className;
4992
- return y == null ? void 0 : y.includes("bn-block-content");
4993
- }), h = u.children.find((f) => {
4994
- const b = f.properties, y = b == null ? void 0 : b.className;
4995
- return y == null ? void 0 : y.includes("bn-block-group");
4996
- });
5008
+ const u = n.children[l].children[0], p = u.children.find((b) => {
5009
+ const y = b.properties, S = y == null ? void 0 : y.className;
5010
+ return S == null ? void 0 : S.includes("bn-block-content");
5011
+ }), h = u.children.find((b) => {
5012
+ const y = b.properties, S = y == null ? void 0 : y.className;
5013
+ return S == null ? void 0 : S.includes("bn-block-group");
5014
+ }), m = Object.fromEntries(
5015
+ Object.entries(u.properties || {}).filter(
5016
+ ([b]) => b.startsWith("data") && b !== "dataId" && b !== "dataNodeType"
5017
+ )
5018
+ ), f = Object.fromEntries(
5019
+ Object.entries((p == null ? void 0 : p.properties) || {}).filter(
5020
+ ([b]) => b.startsWith("data") && b !== "dataContentType" && b !== "dataFileBlock" && b !== "dataNodeViewWrapper" && b !== "dataEditable"
5021
+ )
5022
+ ), g = {
5023
+ ...m,
5024
+ ...f
5025
+ };
4997
5026
  if (!p) {
4998
5027
  n.children.splice(l, 1, ...h.children), o(n);
4999
5028
  return;
5000
5029
  }
5001
- const m = i.has(
5030
+ const k = i.has(
5002
5031
  p.properties.dataContentType
5003
- ), g = m ? e.orderedListItemBlockTypes.has(
5032
+ ), v = k ? e.orderedListItemBlockTypes.has(
5004
5033
  p.properties.dataContentType
5005
5034
  ) ? "ol" : "ul" : null;
5006
- if (h && o(h), a && a.tagName !== g) {
5035
+ if (h && o(h), a && a.tagName !== v) {
5007
5036
  n.children.splice(
5008
5037
  l - a.children.length,
5009
5038
  a.children.length,
5010
5039
  a
5011
5040
  );
5012
- const f = a.children.length - 1;
5013
- l -= f, r -= f, a = void 0;
5041
+ const b = a.children.length - 1;
5042
+ l -= b, r -= b, a = void 0;
5014
5043
  }
5015
- if (m) {
5044
+ if (k) {
5016
5045
  a || (a = t.hastUtilFromDom.fromDom(
5017
- document.createElement(g)
5046
+ document.createElement(v)
5018
5047
  ));
5019
- const f = t.hastUtilFromDom.fromDom(
5048
+ const b = t.hastUtilFromDom.fromDom(
5020
5049
  document.createElement("li")
5021
5050
  );
5022
- f.children.push(...p.children), h && f.children.push(...h.children), a.children.push(f);
5051
+ b.children.push(...p.children), h && b.children.push(...h.children), a.children.push(b);
5023
5052
  } else if (h) {
5024
- n.children.splice(l + 1, 0, ...h.children), n.children[l] = p.children[0];
5025
- const f = h.children.length;
5026
- l += f, r += f;
5027
- } else
5028
- n.children[l] = p.children[0];
5053
+ n.children.splice(l + 1, 0, ...h.children);
5054
+ const b = p.children[0];
5055
+ Re(b, g), n.children[l] = b;
5056
+ const y = h.children.length;
5057
+ l += y, r += y;
5058
+ } else {
5059
+ const b = p.children[0];
5060
+ Re(b, g), n.children[l] = b;
5061
+ }
5029
5062
  }
5030
5063
  a && n.children.splice(
5031
5064
  r - a.children.length,
@@ -5036,62 +5069,62 @@ function Ti(e) {
5036
5069
  return o;
5037
5070
  }
5038
5071
  const de = (e, t) => {
5039
- const i = P;
5072
+ const i = H;
5040
5073
  if (!i)
5041
5074
  throw new Error(
5042
5075
  "External HTML exporter requires ESM dependencies to be initialized"
5043
5076
  );
5044
5077
  const o = Ee.fromSchema(e);
5045
- return o.serializeNodeInner = (n, r) => ot(n, r, o, t, !0), o.exportProseMirrorFragment = (n, r) => i.unified.unified().use(i.rehypeParse.default, { fragment: !0 }).use(Ti, {
5078
+ return o.serializeNodeInner = (n, r) => nt(n, r, o, t, !0), o.exportProseMirrorFragment = (n, r) => i.unified.unified().use(i.rehypeParse.default, { fragment: !0 }).use(Ii, {
5046
5079
  orderedListItemBlockTypes: /* @__PURE__ */ new Set(["numberedListItem"]),
5047
5080
  unorderedListItemBlockTypes: /* @__PURE__ */ new Set([
5048
5081
  "bulletListItem",
5049
5082
  "checkListItem"
5050
5083
  ])
5051
- }).use(i.rehypeStringify.default).processSync(nt(n, o, r)).value, o.exportBlocks = (n, r) => {
5084
+ }).use(i.rehypeStringify.default).processSync(rt(n, o, r)).value, o.exportBlocks = (n, r) => {
5052
5085
  const a = n.map(
5053
- (l) => H(l, e, t.schema.styleSchema)
5086
+ (l) => U(l, e, t.schema.styleSchema)
5054
5087
  ), s = e.nodes.blockGroup.create(null, a);
5055
5088
  return o.exportProseMirrorFragment(
5056
- I.from(s),
5089
+ N.from(s),
5057
5090
  r
5058
5091
  );
5059
5092
  }, o;
5060
5093
  }, Me = (e, t) => {
5061
5094
  const i = Ee.fromSchema(e);
5062
- return i.serializeNodeInner = (o, n) => ot(o, n, i, t, !1), i.serializeProseMirrorFragment = (o, n) => nt(o, i, n), i.serializeBlocks = (o, n) => {
5095
+ return i.serializeNodeInner = (o, n) => nt(o, n, i, t, !1), i.serializeProseMirrorFragment = (o, n) => rt(o, i, n), i.serializeBlocks = (o, n) => {
5063
5096
  const r = o.map(
5064
- (s) => H(s, e, t.schema.styleSchema)
5097
+ (s) => U(s, e, t.schema.styleSchema)
5065
5098
  ), a = e.nodes.blockGroup.create(null, r);
5066
5099
  return i.serializeProseMirrorFragment(
5067
- I.from(a),
5100
+ N.from(a),
5068
5101
  n
5069
5102
  );
5070
5103
  }, i;
5071
- }, S = (e) => {
5104
+ }, B = (e) => {
5072
5105
  const { contentType: t } = _(
5073
5106
  e.state.doc,
5074
5107
  e.state.selection.from
5075
5108
  );
5076
5109
  return t.spec.content;
5077
- }, Bi = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
5110
+ }, Ai = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
5078
5111
  function D(e, t = "Ctrl") {
5079
- return Bi() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
5112
+ return Ai() ? e.replace("Mod", "⌘") : e.replace("Mod", t);
5080
5113
  }
5081
- function z(...e) {
5114
+ function R(...e) {
5082
5115
  return e.filter((t) => t).join(" ");
5083
5116
  }
5084
- const Cr = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5085
- function R(e, t, i, o) {
5117
+ const Br = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5118
+ function O(e, t, i, o) {
5086
5119
  const n = document.createElement("div");
5087
- n.className = z(
5120
+ n.className = R(
5088
5121
  "bn-block-content",
5089
5122
  i.class
5090
5123
  ), n.setAttribute("data-content-type", e);
5091
5124
  for (const [a, s] of Object.entries(i))
5092
5125
  a !== "class" && n.setAttribute(a, s);
5093
5126
  const r = document.createElement(t);
5094
- r.className = z(
5127
+ r.className = R(
5095
5128
  "bn-inline-content",
5096
5129
  o.class
5097
5130
  );
@@ -5104,8 +5137,8 @@ function R(e, t, i, o) {
5104
5137
  contentDOM: r
5105
5138
  };
5106
5139
  }
5107
- const Ve = (e, t) => {
5108
- const i = H(e, t.pmSchema, t.schema.styleSchema).firstChild, o = t.pmSchema.nodes[i.type.name].spec.toDOM;
5140
+ const Oe = (e, t) => {
5141
+ const i = U(e, t.pmSchema, t.schema.styleSchema).firstChild, o = t.pmSchema.nodes[i.type.name].spec.toDOM;
5109
5142
  if (o === void 0)
5110
5143
  throw new Error(
5111
5144
  "This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`."
@@ -5116,7 +5149,7 @@ const Ve = (e, t) => {
5116
5149
  "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."
5117
5150
  );
5118
5151
  return n;
5119
- }, k = {
5152
+ }, w = {
5120
5153
  backgroundColor: {
5121
5154
  default: "default"
5122
5155
  },
@@ -5127,18 +5160,18 @@ const Ve = (e, t) => {
5127
5160
  default: "left",
5128
5161
  values: ["left", "center", "right", "justify"]
5129
5162
  }
5130
- }, rt = ["backgroundColor", "textColor"];
5131
- function le(e) {
5163
+ }, at = ["backgroundColor", "textColor"];
5164
+ function se(e) {
5132
5165
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
5133
5166
  }
5134
- function Sr(e) {
5167
+ function Lr(e) {
5135
5168
  const t = e.split("/");
5136
5169
  return !t.length || // invalid?
5137
5170
  t[t.length - 1] === "" ? e : t[t.length - 1];
5138
5171
  }
5139
- function at(e) {
5172
+ function st(e) {
5140
5173
  const t = {};
5141
- return Object.entries(e).filter(([i, o]) => !rt.includes(i)).forEach(([i, o]) => {
5174
+ return Object.entries(e).filter(([i, o]) => !at.includes(i)).forEach(([i, o]) => {
5142
5175
  t[i] = {
5143
5176
  default: o.default,
5144
5177
  keepOnSplit: !0,
@@ -5146,7 +5179,7 @@ function at(e) {
5146
5179
  // value is the same as its default, we don't display an HTML
5147
5180
  // attribute for it.
5148
5181
  parseHTML: (n) => {
5149
- const r = n.getAttribute(le(i));
5182
+ const r = n.getAttribute(se(i));
5150
5183
  if (r === null)
5151
5184
  return null;
5152
5185
  if (typeof o.default == "boolean")
@@ -5158,12 +5191,12 @@ function at(e) {
5158
5191
  return r;
5159
5192
  },
5160
5193
  renderHTML: (n) => n[i] !== o.default ? {
5161
- [le(i)]: n[i]
5194
+ [se(i)]: n[i]
5162
5195
  } : {}
5163
5196
  };
5164
5197
  }), t;
5165
5198
  }
5166
- function Li(e, t, i, o) {
5199
+ function Ni(e, t, i, o) {
5167
5200
  if (typeof e == "boolean")
5168
5201
  throw new Error(
5169
5202
  "Cannot find node position as getPos is a boolean, not a function."
@@ -5176,18 +5209,18 @@ function Li(e, t, i, o) {
5176
5209
  throw new Error("Block type does not match");
5177
5210
  return s;
5178
5211
  }
5179
- function be(e, t, i, o, n = !1, r) {
5212
+ function ge(e, t, i, o, n = !1, r) {
5180
5213
  const a = document.createElement("div");
5181
5214
  if (r !== void 0)
5182
5215
  for (const [s, l] of Object.entries(r))
5183
5216
  s !== "class" && a.setAttribute(s, l);
5184
- a.className = z(
5217
+ a.className = R(
5185
5218
  "bn-block-content",
5186
5219
  (r == null ? void 0 : r.class) || ""
5187
5220
  ), a.setAttribute("data-content-type", t);
5188
5221
  for (const [s, l] of Object.entries(i))
5189
- !rt.includes(s) && l !== o[s].default && a.setAttribute(le(s), l);
5190
- return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = z(
5222
+ !at.includes(s) && l !== o[s].default && a.setAttribute(se(s), l);
5223
+ return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = R(
5191
5224
  "bn-inline-content",
5192
5225
  e.contentDOM.className
5193
5226
  ), e.contentDOM.setAttribute("data-editable", "")), {
@@ -5195,17 +5228,17 @@ function be(e, t, i, o, n = !1, r) {
5195
5228
  dom: a
5196
5229
  };
5197
5230
  }
5198
- function O(e) {
5231
+ function F(e) {
5199
5232
  return q.create(e);
5200
5233
  }
5201
- function st(e, t) {
5234
+ function lt(e, t) {
5202
5235
  return {
5203
5236
  config: e,
5204
5237
  implementation: t
5205
5238
  };
5206
5239
  }
5207
5240
  function X(e, t, i) {
5208
- return st(
5241
+ return lt(
5209
5242
  {
5210
5243
  type: e.name,
5211
5244
  content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
@@ -5214,18 +5247,23 @@ function X(e, t, i) {
5214
5247
  {
5215
5248
  node: e,
5216
5249
  requiredExtensions: i,
5217
- toInternalHTML: Ve,
5218
- toExternalHTML: Ve
5250
+ toInternalHTML: Oe,
5251
+ toExternalHTML: Oe
5219
5252
  // parse: () => undefined, // parse rules are in node already
5220
5253
  }
5221
5254
  );
5222
5255
  }
5223
- function lt(e) {
5256
+ function dt(e) {
5224
5257
  return Object.fromEntries(
5225
5258
  Object.entries(e).map(([t, i]) => [t, i.config])
5226
5259
  );
5227
5260
  }
5228
- function Ii(e, t) {
5261
+ function Pi(e, t) {
5262
+ e.stopEvent = (i) => i.type === "copy" || i.type === "cut" ? !0 : i.type === "mousedown" ? (setTimeout(() => {
5263
+ t.view.dom.blur();
5264
+ }, 10), !0) : !1;
5265
+ }
5266
+ function Hi(e, t) {
5229
5267
  const i = [
5230
5268
  {
5231
5269
  tag: "[data-content-type=" + e.type + "]",
@@ -5243,16 +5281,16 @@ function Ii(e, t) {
5243
5281
  }), i;
5244
5282
  }
5245
5283
  function ce(e, t) {
5246
- const i = O({
5284
+ const i = F({
5247
5285
  name: e.type,
5248
5286
  content: e.content === "inline" ? "inline*" : "",
5249
5287
  group: "blockContent",
5250
- selectable: !0,
5288
+ selectable: e.isSelectable ?? !0,
5251
5289
  addAttributes() {
5252
- return at(e.propSchema);
5290
+ return st(e.propSchema);
5253
5291
  },
5254
5292
  parseHTML() {
5255
- return Ii(e, t.parse);
5293
+ return Hi(e, t.parse);
5256
5294
  },
5257
5295
  renderHTML() {
5258
5296
  const o = document.createElement("div");
@@ -5262,20 +5300,20 @@ function ce(e, t) {
5262
5300
  },
5263
5301
  addNodeView() {
5264
5302
  return ({ getPos: o }) => {
5265
- var l;
5266
- const n = this.options.editor, r = Li(
5303
+ var d;
5304
+ const n = this.options.editor, r = Ni(
5267
5305
  o,
5268
5306
  n,
5269
5307
  this.editor,
5270
5308
  e.type
5271
- ), a = ((l = this.options.domAttributes) == null ? void 0 : l.blockContent) || {}, s = t.render(r, n);
5272
- return be(
5309
+ ), a = ((d = this.options.domAttributes) == null ? void 0 : d.blockContent) || {}, s = t.render(r, n), l = ge(
5273
5310
  s,
5274
5311
  r.type,
5275
5312
  r.props,
5276
5313
  e.propSchema,
5277
5314
  a
5278
5315
  );
5316
+ return e.isSelectable === !1 && Pi(l, this.editor), l;
5279
5317
  };
5280
5318
  }
5281
5319
  });
@@ -5283,12 +5321,12 @@ function ce(e, t) {
5283
5321
  throw new Error(
5284
5322
  "Node name does not match block type. This is a bug in BlockNote."
5285
5323
  );
5286
- return st(e, {
5324
+ return lt(e, {
5287
5325
  node: i,
5288
5326
  toInternalHTML: (o, n) => {
5289
5327
  var s;
5290
5328
  const r = ((s = i.options.domAttributes) == null ? void 0 : s.blockContent) || {}, a = t.render(o, n);
5291
- return be(
5329
+ return ge(
5292
5330
  a,
5293
5331
  o.type,
5294
5332
  o.props,
@@ -5305,7 +5343,7 @@ function ce(e, t) {
5305
5343
  o,
5306
5344
  n
5307
5345
  );
5308
- return a === void 0 && (a = t.render(o, n)), be(
5346
+ return a === void 0 && (a = t.render(o, n)), ge(
5309
5347
  a,
5310
5348
  o.type,
5311
5349
  o.props,
@@ -5315,10 +5353,10 @@ function ce(e, t) {
5315
5353
  }
5316
5354
  });
5317
5355
  }
5318
- function Ai(e, t, i, o) {
5319
- return e.dom.setAttribute("data-inline-content-type", t), Object.entries(i).filter(([n, r]) => r !== o[n].default).map(([n, r]) => [le(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5356
+ function Fe(e, t, i, o) {
5357
+ return e.dom.setAttribute("data-inline-content-type", t), Object.entries(i).filter(([n, r]) => r !== o[n].default).map(([n, r]) => [se(n), r]).forEach(([n, r]) => e.dom.setAttribute(n, r)), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5320
5358
  }
5321
- function Ni(e) {
5359
+ function Ui(e) {
5322
5360
  return {
5323
5361
  Backspace: ({ editor: t }) => {
5324
5362
  const i = t.state.selection.$from;
@@ -5326,14 +5364,14 @@ function Ni(e) {
5326
5364
  }
5327
5365
  };
5328
5366
  }
5329
- function Pi(e, t) {
5367
+ function Di(e, t) {
5330
5368
  return {
5331
5369
  config: e,
5332
5370
  implementation: t
5333
5371
  };
5334
5372
  }
5335
- function Hi(e, t) {
5336
- return Pi(
5373
+ function ji(e, t) {
5374
+ return Di(
5337
5375
  {
5338
5376
  type: e.name,
5339
5377
  propSchema: t,
@@ -5344,12 +5382,12 @@ function Hi(e, t) {
5344
5382
  }
5345
5383
  );
5346
5384
  }
5347
- function dt(e) {
5385
+ function ct(e) {
5348
5386
  return Object.fromEntries(
5349
5387
  Object.entries(e).map(([t, i]) => [t, i.config])
5350
5388
  );
5351
5389
  }
5352
- function Di(e) {
5390
+ function zi(e) {
5353
5391
  return [
5354
5392
  {
5355
5393
  tag: `[data-inline-content-type="${e.type}"]`,
@@ -5360,7 +5398,7 @@ function Di(e) {
5360
5398
  }
5361
5399
  ];
5362
5400
  }
5363
- function Mr(e, t) {
5401
+ function Ir(e, t) {
5364
5402
  const i = q.create({
5365
5403
  name: e.type,
5366
5404
  inline: !0,
@@ -5369,37 +5407,75 @@ function Mr(e, t) {
5369
5407
  atom: e.content === "none",
5370
5408
  content: e.content === "styled" ? "inline*" : "",
5371
5409
  addAttributes() {
5372
- return at(e.propSchema);
5410
+ return st(e.propSchema);
5373
5411
  },
5374
5412
  addKeyboardShortcuts() {
5375
- return Ni(e);
5413
+ return Ui(e);
5376
5414
  },
5377
5415
  parseHTML() {
5378
- return Di(e);
5416
+ return zi(e);
5379
5417
  },
5380
5418
  renderHTML({ node: o }) {
5381
5419
  const n = this.options.editor, r = t.render(
5382
- it(
5420
+ xe(
5383
5421
  o,
5384
5422
  n.schema.inlineContentSchema,
5385
5423
  n.schema.styleSchema
5386
- )
5424
+ ),
5387
5425
  // TODO: fix cast
5426
+ () => {
5427
+ },
5428
+ n
5388
5429
  );
5389
- return Ai(
5430
+ return Fe(
5390
5431
  r,
5391
5432
  e.type,
5392
5433
  o.attrs,
5393
5434
  e.propSchema
5394
5435
  );
5436
+ },
5437
+ addNodeView() {
5438
+ return ({ node: o, getPos: n }) => {
5439
+ const r = this.options.editor, a = t.render(
5440
+ xe(
5441
+ o,
5442
+ r.schema.inlineContentSchema,
5443
+ r.schema.styleSchema
5444
+ ),
5445
+ // TODO: fix cast
5446
+ (s) => {
5447
+ if (typeof n == "boolean")
5448
+ return;
5449
+ const l = V(
5450
+ [s],
5451
+ r._tiptapEditor.schema,
5452
+ r.schema.styleSchema
5453
+ );
5454
+ r._tiptapEditor.view.dispatch(
5455
+ r._tiptapEditor.view.state.tr.replaceWith(
5456
+ n(),
5457
+ n() + o.nodeSize,
5458
+ l
5459
+ )
5460
+ );
5461
+ },
5462
+ r
5463
+ );
5464
+ return Fe(
5465
+ a,
5466
+ e.type,
5467
+ o.attrs,
5468
+ e.propSchema
5469
+ );
5470
+ };
5395
5471
  }
5396
5472
  });
5397
- return Hi(
5473
+ return ji(
5398
5474
  i,
5399
5475
  e.propSchema
5400
5476
  );
5401
5477
  }
5402
- function Ui(e) {
5478
+ function Vi(e) {
5403
5479
  return e === "boolean" ? {} : {
5404
5480
  stringValue: {
5405
5481
  default: void 0,
@@ -5411,17 +5487,17 @@ function Ui(e) {
5411
5487
  }
5412
5488
  };
5413
5489
  }
5414
- function ji(e, t, i, o) {
5490
+ function Ri(e, t, i, o) {
5415
5491
  return e.dom.setAttribute("data-style-type", t), o === "string" && e.dom.setAttribute("data-value", i), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
5416
5492
  }
5417
- function ct(e, t) {
5493
+ function ut(e, t) {
5418
5494
  return {
5419
5495
  config: e,
5420
5496
  implementation: t
5421
5497
  };
5422
5498
  }
5423
- function U(e, t) {
5424
- return ct(
5499
+ function j(e, t) {
5500
+ return ut(
5425
5501
  {
5426
5502
  type: e.name,
5427
5503
  propSchema: t
@@ -5431,12 +5507,12 @@ function U(e, t) {
5431
5507
  }
5432
5508
  );
5433
5509
  }
5434
- function ut(e) {
5510
+ function pt(e) {
5435
5511
  return Object.fromEntries(
5436
5512
  Object.entries(e).map(([t, i]) => [t, i.config])
5437
5513
  );
5438
5514
  }
5439
- function zi(e) {
5515
+ function Oi(e) {
5440
5516
  return [
5441
5517
  {
5442
5518
  tag: `[data-style-type="${e.type}"]`,
@@ -5447,14 +5523,14 @@ function zi(e) {
5447
5523
  }
5448
5524
  ];
5449
5525
  }
5450
- function Tr(e, t) {
5526
+ function Ar(e, t) {
5451
5527
  const i = Ce.create({
5452
5528
  name: e.type,
5453
5529
  addAttributes() {
5454
- return Ui(e.propSchema);
5530
+ return Vi(e.propSchema);
5455
5531
  },
5456
5532
  parseHTML() {
5457
- return zi(e);
5533
+ return Oi(e);
5458
5534
  },
5459
5535
  renderHTML({ mark: o }) {
5460
5536
  let n;
@@ -5463,8 +5539,8 @@ function Tr(e, t) {
5463
5539
  else if (e.propSchema === "string")
5464
5540
  n = t.render(o.attrs.stringValue);
5465
5541
  else
5466
- throw new A(e.propSchema);
5467
- return ji(
5542
+ throw new P(e.propSchema);
5543
+ return Ri(
5468
5544
  n,
5469
5545
  e.type,
5470
5546
  o.attrs.stringValue,
@@ -5472,11 +5548,45 @@ function Tr(e, t) {
5472
5548
  );
5473
5549
  }
5474
5550
  });
5475
- return ct(e, {
5551
+ return ut(e, {
5476
5552
  mark: i
5477
5553
  });
5478
5554
  }
5479
- const ue = (e) => {
5555
+ const ue = (e, t, i, o, n) => {
5556
+ const r = document.createElement("div");
5557
+ if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
5558
+ const a = Fi(
5559
+ e,
5560
+ t,
5561
+ o,
5562
+ n
5563
+ );
5564
+ r.appendChild(a.dom);
5565
+ const s = document.createElement("div");
5566
+ s.className = "bn-file-loading-preview", s.textContent = "Loading...";
5567
+ const l = t.onUploadStart((u) => {
5568
+ u === e.id && (r.removeChild(a.dom), r.appendChild(s));
5569
+ }), d = t.onUploadEnd((u) => {
5570
+ u === e.id && (r.removeChild(s), r.appendChild(a.dom));
5571
+ });
5572
+ return {
5573
+ dom: r,
5574
+ destroy: () => {
5575
+ var u;
5576
+ (u = a.destroy) == null || u.call(a), l(), d();
5577
+ }
5578
+ };
5579
+ } else if (e.props.showPreview === !1) {
5580
+ const a = ht(e).dom;
5581
+ return {
5582
+ dom: ne(e, a).dom
5583
+ };
5584
+ } else
5585
+ return r.appendChild(i.dom), {
5586
+ dom: r,
5587
+ destroy: i.destroy
5588
+ };
5589
+ }, ht = (e) => {
5480
5590
  const t = document.createElement("div");
5481
5591
  t.className = "bn-file-default-preview";
5482
5592
  const i = document.createElement("div");
@@ -5485,14 +5595,14 @@ const ue = (e) => {
5485
5595
  return o.className = "bn-file-default-preview-name", o.textContent = e.props.name || "", t.appendChild(i), t.appendChild(o), {
5486
5596
  dom: t
5487
5597
  };
5488
- }, V = (e, t) => {
5598
+ }, ne = (e, t) => {
5489
5599
  const i = document.createElement("div");
5490
5600
  i.className = "bn-file-and-caption-wrapper";
5491
5601
  const o = document.createElement("p");
5492
5602
  return o.className = "bn-file-caption", o.textContent = e.props.caption, i.appendChild(t), i.appendChild(o), {
5493
5603
  dom: i
5494
5604
  };
5495
- }, pe = (e, t, i, o) => {
5605
+ }, Fi = (e, t, i, o) => {
5496
5606
  const n = document.createElement("div");
5497
5607
  n.className = "bn-add-file-button";
5498
5608
  const r = document.createElement("div");
@@ -5526,7 +5636,7 @@ const ue = (e) => {
5526
5636
  );
5527
5637
  }
5528
5638
  };
5529
- }, Oe = (e) => ({ url: e.src || void 0 }), he = (e, t) => {
5639
+ }, Ge = (e) => ({ url: e.src || void 0 }), pe = (e, t) => {
5530
5640
  const i = e.querySelector(
5531
5641
  t
5532
5642
  );
@@ -5534,7 +5644,7 @@ const ue = (e) => {
5534
5644
  return;
5535
5645
  const o = e.querySelector("figcaption"), n = (o == null ? void 0 : o.textContent) ?? void 0;
5536
5646
  return { targetElement: i, caption: n };
5537
- }, me = (e, t) => {
5647
+ }, he = (e, t) => {
5538
5648
  const i = document.createElement("div"), o = document.createElement("p");
5539
5649
  return o.textContent = t, i.appendChild(e), i.appendChild(o), {
5540
5650
  dom: i
@@ -5542,7 +5652,7 @@ const ue = (e) => {
5542
5652
  }, Te = (e, t) => {
5543
5653
  const i = document.createElement("figure"), o = document.createElement("figcaption");
5544
5654
  return o.textContent = t, i.appendChild(e), i.appendChild(o), { dom: i };
5545
- }, pt = (e, t, i, o, n) => {
5655
+ }, mt = (e, t, i, o, n) => {
5546
5656
  if (!e.props.previewWidth)
5547
5657
  throw new Error("Block must have a `previewWidth` prop.");
5548
5658
  const r = document.createElement("div");
@@ -5552,36 +5662,36 @@ const ue = (e) => {
5552
5662
  const s = document.createElement("div");
5553
5663
  s.className = "bn-visual-media-resize-handle", s.style.right = "4px";
5554
5664
  let l;
5555
- const d = (f) => {
5665
+ const d = (g) => {
5556
5666
  if (!l) {
5557
5667
  !t.isEditable && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s));
5558
5668
  return;
5559
5669
  }
5560
- let b;
5561
- e.props.textAlignment === "center" ? l.handleUsed === "left" ? b = l.initialWidth + (l.initialClientX - f.clientX) * 2 : b = l.initialWidth + (f.clientX - l.initialClientX) * 2 : l.handleUsed === "left" ? b = l.initialWidth + l.initialClientX - f.clientX : b = l.initialWidth + f.clientX - l.initialClientX;
5562
- const y = 64;
5563
- b < y ? n(y) : b > t.domElement.firstElementChild.clientWidth ? n(t.domElement.firstElementChild.clientWidth) : n(b);
5564
- }, u = (f) => {
5565
- (!f.target || !r.contains(f.target) || !t.isEditable) && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s)), l && (l = void 0, t.updateBlock(e, {
5670
+ let k;
5671
+ e.props.textAlignment === "center" ? l.handleUsed === "left" ? k = l.initialWidth + (l.initialClientX - g.clientX) * 2 : k = l.initialWidth + (g.clientX - l.initialClientX) * 2 : l.handleUsed === "left" ? k = l.initialWidth + l.initialClientX - g.clientX : k = l.initialWidth + g.clientX - l.initialClientX;
5672
+ const v = 64;
5673
+ k < v ? n(v) : k > t.domElement.firstElementChild.clientWidth ? n(t.domElement.firstElementChild.clientWidth) : n(k);
5674
+ }, u = (g) => {
5675
+ (!g.target || !r.contains(g.target) || !t.isEditable) && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s)), l && (l = void 0, t.updateBlock(e, {
5566
5676
  props: {
5567
5677
  previewWidth: o()
5568
5678
  }
5569
5679
  }));
5570
5680
  }, p = () => {
5571
5681
  t.isEditable && (r.appendChild(a), r.appendChild(s));
5572
- }, h = (f) => {
5573
- f.relatedTarget === a || f.relatedTarget === s || l || t.isEditable && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s));
5574
- }, m = (f) => {
5575
- f.preventDefault(), r.appendChild(a), r.appendChild(s), l = {
5682
+ }, h = (g) => {
5683
+ g.relatedTarget === a || g.relatedTarget === s || l || t.isEditable && r.contains(a) && r.contains(s) && (r.removeChild(a), r.removeChild(s));
5684
+ }, m = (g) => {
5685
+ g.preventDefault(), r.appendChild(a), r.appendChild(s), l = {
5576
5686
  handleUsed: "left",
5577
5687
  initialWidth: e.props.previewWidth,
5578
- initialClientX: f.clientX
5688
+ initialClientX: g.clientX
5579
5689
  };
5580
- }, g = (f) => {
5581
- f.preventDefault(), r.appendChild(a), r.appendChild(s), l = {
5690
+ }, f = (g) => {
5691
+ g.preventDefault(), r.appendChild(a), r.appendChild(s), l = {
5582
5692
  handleUsed: "right",
5583
5693
  initialWidth: e.props.previewWidth,
5584
- initialClientX: f.clientX
5694
+ initialClientX: g.clientX
5585
5695
  };
5586
5696
  };
5587
5697
  return r.appendChild(i), window.addEventListener("mousemove", d), window.addEventListener("mouseup", u), i.addEventListener("mouseenter", p), i.addEventListener("mouseleave", h), a.addEventListener(
@@ -5589,7 +5699,7 @@ const ue = (e) => {
5589
5699
  m
5590
5700
  ), s.addEventListener(
5591
5701
  "mousedown",
5592
- g
5702
+ f
5593
5703
  ), {
5594
5704
  dom: r,
5595
5705
  destroy: () => {
@@ -5598,12 +5708,12 @@ const ue = (e) => {
5598
5708
  m
5599
5709
  ), s.removeEventListener(
5600
5710
  "mousedown",
5601
- g
5711
+ f
5602
5712
  );
5603
5713
  }
5604
5714
  };
5605
- }, Fe = (e) => ({ url: e.src || void 0 }), Ri = {
5606
- backgroundColor: k.backgroundColor,
5715
+ }, We = (e) => ({ url: e.src || void 0 }), Gi = {
5716
+ backgroundColor: w.backgroundColor,
5607
5717
  // File name.
5608
5718
  name: {
5609
5719
  default: ""
@@ -5619,59 +5729,41 @@ const ue = (e) => {
5619
5729
  showPreview: {
5620
5730
  default: !0
5621
5731
  }
5622
- }, Vi = {
5732
+ }, Wi = {
5623
5733
  type: "audio",
5624
- propSchema: Ri,
5734
+ propSchema: Gi,
5625
5735
  content: "none",
5626
5736
  isFileBlock: !0,
5627
5737
  fileBlockAccept: ["audio/*"]
5628
- }, Oi = (e, t) => {
5738
+ }, Ki = (e, t) => {
5629
5739
  const i = document.createElement("div");
5630
- if (i.className = "bn-file-block-content-wrapper", e.props.url === "") {
5631
- const o = document.createElement("div");
5632
- o.innerHTML = '<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>';
5633
- const n = pe(
5634
- e,
5635
- t,
5636
- t.dictionary.file_blocks.audio.add_button_text,
5637
- o.firstElementChild
5638
- );
5639
- return i.appendChild(n.dom), {
5640
- dom: i,
5641
- destroy: () => {
5642
- var r;
5643
- (r = n == null ? void 0 : n.destroy) == null || r.call(n);
5644
- }
5645
- };
5646
- } else if (e.props.showPreview) {
5647
- const o = document.createElement("audio");
5648
- o.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
5649
- o.src = r;
5650
- }), o.controls = !0, o.contentEditable = "false", o.draggable = !1;
5651
- const n = V(e, o);
5652
- return i.appendChild(n.dom), {
5653
- dom: i
5654
- };
5655
- } else {
5656
- const o = ue(e).dom;
5657
- return {
5658
- dom: V(e, o).dom
5659
- };
5660
- }
5661
- }, Fi = (e) => {
5740
+ i.innerHTML = '<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>';
5741
+ const o = document.createElement("audio");
5742
+ o.className = "bn-audio", t.resolveFileUrl(e.props.url).then((r) => {
5743
+ o.src = r;
5744
+ }), o.controls = !0, o.contentEditable = "false", o.draggable = !1;
5745
+ const n = ne(e, o);
5746
+ return ue(
5747
+ e,
5748
+ t,
5749
+ n,
5750
+ t.dictionary.file_blocks.audio.add_button_text,
5751
+ i.firstElementChild
5752
+ );
5753
+ }, $i = (e) => {
5662
5754
  if (e.tagName === "AUDIO")
5663
- return Fe(e);
5755
+ return We(e);
5664
5756
  if (e.tagName === "FIGURE") {
5665
- const t = he(e, "audio");
5757
+ const t = pe(e, "audio");
5666
5758
  if (!t)
5667
5759
  return;
5668
5760
  const { targetElement: i, caption: o } = t;
5669
5761
  return {
5670
- ...Fe(i),
5762
+ ...We(i),
5671
5763
  caption: o
5672
5764
  };
5673
5765
  }
5674
- }, Gi = (e) => {
5766
+ }, qi = (e) => {
5675
5767
  if (!e.props.url) {
5676
5768
  const i = document.createElement("p");
5677
5769
  return i.textContent = "Add audio", {
@@ -5679,15 +5771,15 @@ const ue = (e) => {
5679
5771
  };
5680
5772
  }
5681
5773
  let t;
5682
- return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : me(t, e.props.caption) : {
5774
+ return e.props.showPreview ? (t = document.createElement("audio"), t.src = e.props.url) : (t = document.createElement("a"), t.href = e.props.url, t.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? Te(t, e.props.caption) : he(t, e.props.caption) : {
5683
5775
  dom: t
5684
5776
  };
5685
- }, Ki = ce(Vi, {
5686
- render: Oi,
5687
- parse: Fi,
5688
- toExternalHTML: Gi
5689
- }), Wi = {
5690
- backgroundColor: k.backgroundColor,
5777
+ }, Xi = ce(Wi, {
5778
+ render: Ki,
5779
+ parse: $i,
5780
+ toExternalHTML: qi
5781
+ }), Zi = {
5782
+ backgroundColor: w.backgroundColor,
5691
5783
  // File name.
5692
5784
  name: {
5693
5785
  default: ""
@@ -5700,39 +5792,28 @@ const ue = (e) => {
5700
5792
  caption: {
5701
5793
  default: ""
5702
5794
  }
5703
- }, $i = {
5795
+ }, Ji = {
5704
5796
  type: "file",
5705
- propSchema: Wi,
5797
+ propSchema: Zi,
5706
5798
  content: "none",
5707
5799
  isFileBlock: !0
5708
- }, qi = (e, t) => {
5709
- const i = document.createElement("div");
5710
- if (i.className = "bn-file-block-content-wrapper", e.props.url === "") {
5711
- const o = pe(e, t);
5712
- return i.appendChild(o.dom), {
5713
- dom: i,
5714
- destroy: o.destroy
5715
- };
5716
- } else {
5717
- const o = ue(e).dom, n = V(e, o);
5718
- return i.appendChild(n.dom), {
5719
- dom: i
5720
- };
5721
- }
5722
- }, Xi = (e) => {
5800
+ }, Yi = (e, t) => {
5801
+ const i = ht(e).dom, o = ne(e, i);
5802
+ return ue(e, t, o);
5803
+ }, Qi = (e) => {
5723
5804
  if (e.tagName === "EMBED")
5724
- return Oe(e);
5805
+ return Ge(e);
5725
5806
  if (e.tagName === "FIGURE") {
5726
- const t = he(e, "embed");
5807
+ const t = pe(e, "embed");
5727
5808
  if (!t)
5728
5809
  return;
5729
5810
  const { targetElement: i, caption: o } = t;
5730
5811
  return {
5731
- ...Oe(i),
5812
+ ...Ge(i),
5732
5813
  caption: o
5733
5814
  };
5734
5815
  }
5735
- }, Zi = (e) => {
5816
+ }, eo = (e) => {
5736
5817
  if (!e.props.url) {
5737
5818
  const i = document.createElement("p");
5738
5819
  return i.textContent = "Add file", {
@@ -5740,14 +5821,14 @@ const ue = (e) => {
5740
5821
  };
5741
5822
  }
5742
5823
  const t = document.createElement("a");
5743
- return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? me(t, e.props.caption) : {
5824
+ return t.href = e.props.url, t.textContent = e.props.name || e.props.url, e.props.caption ? he(t, e.props.caption) : {
5744
5825
  dom: t
5745
5826
  };
5746
- }, Ji = ce($i, {
5747
- render: qi,
5748
- parse: Xi,
5749
- toExternalHTML: Zi
5750
- }), Br = async (e) => {
5827
+ }, to = ce(Ji, {
5828
+ render: Yi,
5829
+ parse: Qi,
5830
+ toExternalHTML: eo
5831
+ }), Nr = async (e) => {
5751
5832
  const t = new FormData();
5752
5833
  return t.append("file", e), (await (await fetch("https://tmpfiles.org/api/v1/upload", {
5753
5834
  method: "POST",
@@ -5756,12 +5837,12 @@ const ue = (e) => {
5756
5837
  "tmpfiles.org/",
5757
5838
  "tmpfiles.org/dl/"
5758
5839
  );
5759
- }, Ge = (e) => {
5840
+ }, Ke = (e) => {
5760
5841
  const t = e.src || void 0, i = e.width || void 0;
5761
5842
  return { url: t, previewWidth: i };
5762
- }, Yi = {
5763
- textAlignment: k.textAlignment,
5764
- backgroundColor: k.backgroundColor,
5843
+ }, io = {
5844
+ textAlignment: w.textAlignment,
5845
+ backgroundColor: w.backgroundColor,
5765
5846
  // File name.
5766
5847
  name: {
5767
5848
  default: ""
@@ -5781,69 +5862,50 @@ const ue = (e) => {
5781
5862
  previewWidth: {
5782
5863
  default: 512
5783
5864
  }
5784
- }, Qi = {
5865
+ }, oo = {
5785
5866
  type: "image",
5786
- propSchema: Yi,
5867
+ propSchema: io,
5787
5868
  content: "none",
5788
5869
  isFileBlock: !0,
5789
5870
  fileBlockAccept: ["image/*"]
5790
- }, eo = (e, t) => {
5871
+ }, no = (e, t) => {
5791
5872
  const i = document.createElement("div");
5792
- if (i.className = "bn-file-block-content-wrapper", e.props.url === "") {
5793
- const o = document.createElement("div");
5794
- o.innerHTML = '<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>';
5795
- const n = pe(
5796
- e,
5797
- t,
5798
- t.dictionary.file_blocks.image.add_button_text,
5799
- o.firstElementChild
5800
- );
5801
- return i.appendChild(n.dom), {
5802
- dom: i,
5803
- destroy: () => {
5804
- var r;
5805
- (r = n == null ? void 0 : n.destroy) == null || r.call(n);
5806
- }
5807
- };
5808
- } else if (e.props.showPreview) {
5809
- const o = document.createElement("img");
5810
- o.className = "bn-visual-media", t.resolveFileUrl(e.props.url).then((a) => {
5811
- o.src = a;
5812
- }), o.alt = e.props.name || e.props.caption || "BlockNote image", o.contentEditable = "false", o.draggable = !1, o.width = Math.min(
5813
- e.props.previewWidth,
5814
- t.domElement.firstElementChild.clientWidth
5815
- );
5816
- const n = pt(
5817
- e,
5818
- t,
5819
- o,
5820
- () => o.width,
5821
- (a) => o.width = a
5822
- ), r = V(e, n.dom);
5823
- return i.appendChild(r.dom), {
5824
- dom: i,
5825
- destroy: n.destroy
5826
- };
5827
- } else {
5828
- const o = ue(e).dom;
5829
- return {
5830
- dom: V(e, o).dom
5831
- };
5832
- }
5833
- }, to = (e) => {
5873
+ i.innerHTML = '<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>';
5874
+ const o = document.createElement("img");
5875
+ o.className = "bn-visual-media", t.resolveFileUrl(e.props.url).then((a) => {
5876
+ o.src = a;
5877
+ }), o.alt = e.props.name || e.props.caption || "BlockNote image", o.contentEditable = "false", o.draggable = !1, o.width = Math.min(
5878
+ e.props.previewWidth,
5879
+ t.domElement.firstElementChild.clientWidth
5880
+ );
5881
+ const n = mt(
5882
+ e,
5883
+ t,
5884
+ o,
5885
+ () => o.width,
5886
+ (a) => o.width = a
5887
+ ), r = ne(e, n.dom);
5888
+ return ue(
5889
+ e,
5890
+ t,
5891
+ r,
5892
+ t.dictionary.file_blocks.image.add_button_text,
5893
+ i.firstElementChild
5894
+ );
5895
+ }, ro = (e) => {
5834
5896
  if (e.tagName === "IMG")
5835
- return Ge(e);
5897
+ return Ke(e);
5836
5898
  if (e.tagName === "FIGURE") {
5837
- const t = he(e, "img");
5899
+ const t = pe(e, "img");
5838
5900
  if (!t)
5839
5901
  return;
5840
5902
  const { targetElement: i, caption: o } = t;
5841
5903
  return {
5842
- ...Ge(i),
5904
+ ...Ke(i),
5843
5905
  caption: o
5844
5906
  };
5845
5907
  }
5846
- }, io = (e) => {
5908
+ }, ao = (e) => {
5847
5909
  if (!e.props.url) {
5848
5910
  const i = document.createElement("p");
5849
5911
  return i.textContent = "Add image", {
@@ -5851,19 +5913,19 @@ const ue = (e) => {
5851
5913
  };
5852
5914
  }
5853
5915
  let t;
5854
- return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", 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 ? Te(t, e.props.caption) : me(t, e.props.caption) : {
5916
+ return e.props.showPreview ? (t = document.createElement("img"), t.src = e.props.url, t.alt = e.props.name || e.props.caption || "BlockNote image", 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 ? Te(t, e.props.caption) : he(t, e.props.caption) : {
5855
5917
  dom: t
5856
5918
  };
5857
- }, oo = ce(Qi, {
5858
- render: eo,
5859
- parse: to,
5860
- toExternalHTML: io
5861
- }), Ke = (e) => {
5919
+ }, so = ce(oo, {
5920
+ render: no,
5921
+ parse: ro,
5922
+ toExternalHTML: ao
5923
+ }), $e = (e) => {
5862
5924
  const t = e.src || void 0, i = e.width || void 0;
5863
5925
  return { url: t, previewWidth: i };
5864
- }, no = {
5865
- textAlignment: k.textAlignment,
5866
- backgroundColor: k.backgroundColor,
5926
+ }, lo = {
5927
+ textAlignment: w.textAlignment,
5928
+ backgroundColor: w.backgroundColor,
5867
5929
  // File name.
5868
5930
  name: {
5869
5931
  default: ""
@@ -5883,67 +5945,48 @@ const ue = (e) => {
5883
5945
  previewWidth: {
5884
5946
  default: 512
5885
5947
  }
5886
- }, ro = {
5948
+ }, co = {
5887
5949
  type: "video",
5888
- propSchema: no,
5950
+ propSchema: lo,
5889
5951
  content: "none",
5890
5952
  isFileBlock: !0,
5891
5953
  fileBlockAccept: ["video/*"]
5892
- }, ao = (e, t) => {
5954
+ }, uo = (e, t) => {
5893
5955
  const i = document.createElement("div");
5894
- if (i.className = "bn-file-block-content-wrapper", e.props.url === "") {
5895
- const o = document.createElement("div");
5896
- o.innerHTML = '<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>';
5897
- const n = pe(
5898
- e,
5899
- t,
5900
- t.dictionary.file_blocks.video.add_button_text,
5901
- o.firstElementChild
5902
- );
5903
- return i.appendChild(n.dom), {
5904
- dom: i,
5905
- destroy: () => {
5906
- var r;
5907
- (r = n == null ? void 0 : n.destroy) == null || r.call(n);
5908
- }
5909
- };
5910
- } else if (e.props.showPreview) {
5911
- const o = document.createElement("video");
5912
- o.className = "bn-visual-media", o.src = e.props.url, o.controls = !0, o.contentEditable = "false", o.draggable = !1, o.width = Math.min(
5913
- e.props.previewWidth,
5914
- t.domElement.firstElementChild.clientWidth
5915
- );
5916
- const n = pt(
5917
- e,
5918
- t,
5919
- o,
5920
- () => o.width,
5921
- (a) => o.width = a
5922
- ), r = V(e, n.dom);
5923
- return i.appendChild(r.dom), {
5924
- dom: i,
5925
- destroy: n.destroy
5926
- };
5927
- } else {
5928
- const o = ue(e).dom;
5929
- return {
5930
- dom: V(e, o).dom
5931
- };
5932
- }
5933
- }, so = (e) => {
5956
+ i.innerHTML = '<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>';
5957
+ const o = document.createElement("video");
5958
+ o.className = "bn-visual-media", o.src = e.props.url, o.controls = !0, o.contentEditable = "false", o.draggable = !1, o.width = Math.min(
5959
+ e.props.previewWidth,
5960
+ t.domElement.firstElementChild.clientWidth
5961
+ );
5962
+ const n = mt(
5963
+ e,
5964
+ t,
5965
+ o,
5966
+ () => o.width,
5967
+ (a) => o.width = a
5968
+ ), r = ne(e, n.dom);
5969
+ return ue(
5970
+ e,
5971
+ t,
5972
+ r,
5973
+ t.dictionary.file_blocks.video.add_button_text,
5974
+ i.firstElementChild
5975
+ );
5976
+ }, po = (e) => {
5934
5977
  if (e.tagName === "VIDEO")
5935
- return Ke(e);
5978
+ return $e(e);
5936
5979
  if (e.tagName === "FIGURE") {
5937
- const t = he(e, "video");
5980
+ const t = pe(e, "video");
5938
5981
  if (!t)
5939
5982
  return;
5940
5983
  const { targetElement: i, caption: o } = t;
5941
5984
  return {
5942
- ...Ke(i),
5985
+ ...$e(i),
5943
5986
  caption: o
5944
5987
  };
5945
5988
  }
5946
- }, lo = (e) => {
5989
+ }, ho = (e) => {
5947
5990
  if (!e.props.url) {
5948
5991
  const i = document.createElement("p");
5949
5992
  return i.textContent = "Add video", {
@@ -5951,14 +5994,14 @@ const ue = (e) => {
5951
5994
  };
5952
5995
  }
5953
5996
  let t;
5954
- return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, 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 ? Te(t, e.props.caption) : me(t, e.props.caption) : {
5997
+ return e.props.showPreview ? (t = document.createElement("video"), t.src = e.props.url, 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 ? Te(t, e.props.caption) : he(t, e.props.caption) : {
5955
5998
  dom: t
5956
5999
  };
5957
- }, co = ce(ro, {
5958
- render: ao,
5959
- parse: so,
5960
- toExternalHTML: lo
5961
- }), uo = Ce.create({
6000
+ }, mo = ce(co, {
6001
+ render: uo,
6002
+ parse: po,
6003
+ toExternalHTML: ho
6004
+ }), fo = Ce.create({
5962
6005
  name: "backgroundColor",
5963
6006
  addAttributes() {
5964
6007
  return {
@@ -5984,10 +6027,10 @@ const ue = (e) => {
5984
6027
  renderHTML({ HTMLAttributes: e }) {
5985
6028
  return ["span", e, 0];
5986
6029
  }
5987
- }), po = U(
5988
- uo,
6030
+ }), go = j(
6031
+ fo,
5989
6032
  "string"
5990
- ), ho = Ce.create({
6033
+ ), bo = Ce.create({
5991
6034
  name: "textColor",
5992
6035
  addAttributes() {
5993
6036
  return {
@@ -6011,10 +6054,10 @@ const ue = (e) => {
6011
6054
  renderHTML({ HTMLAttributes: e }) {
6012
6055
  return ["span", e, 0];
6013
6056
  }
6014
- }), mo = U(ho, "string"), fo = {
6015
- ...k,
6057
+ }), _o = j(bo, "string"), ko = {
6058
+ ...w,
6016
6059
  level: { default: 1, values: [1, 2, 3] }
6017
- }, go = O({
6060
+ }, yo = F({
6018
6061
  name: "heading",
6019
6062
  content: "inline*",
6020
6063
  group: "blockContent",
@@ -6036,10 +6079,10 @@ const ue = (e) => {
6036
6079
  },
6037
6080
  addInputRules() {
6038
6081
  return [
6039
- ...[1, 2, 3].map((e) => new te({
6082
+ ...[1, 2, 3].map((e) => new ee({
6040
6083
  find: new RegExp(`^(#{${e}})\\s$`),
6041
6084
  handler: ({ state: t, chain: i, range: o }) => {
6042
- S(this.editor) === "inline*" && i().BNUpdateBlock(t.selection.from, {
6085
+ B(this.editor) === "inline*" && i().BNUpdateBlock(t.selection.from, {
6043
6086
  type: "heading",
6044
6087
  props: {
6045
6088
  level: e
@@ -6051,7 +6094,7 @@ const ue = (e) => {
6051
6094
  },
6052
6095
  addKeyboardShortcuts() {
6053
6096
  return {
6054
- "Mod-Alt-1": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6097
+ "Mod-Alt-1": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6055
6098
  this.editor.state.selection.anchor,
6056
6099
  {
6057
6100
  type: "heading",
@@ -6060,7 +6103,7 @@ const ue = (e) => {
6060
6103
  }
6061
6104
  }
6062
6105
  ),
6063
- "Mod-Alt-2": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6106
+ "Mod-Alt-2": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6064
6107
  this.editor.state.selection.anchor,
6065
6108
  {
6066
6109
  type: "heading",
@@ -6069,7 +6112,7 @@ const ue = (e) => {
6069
6112
  }
6070
6113
  }
6071
6114
  ),
6072
- "Mod-Alt-3": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6115
+ "Mod-Alt-3": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6073
6116
  this.editor.state.selection.anchor,
6074
6117
  {
6075
6118
  type: "heading",
@@ -6107,7 +6150,7 @@ const ue = (e) => {
6107
6150
  },
6108
6151
  renderHTML({ node: e, HTMLAttributes: t }) {
6109
6152
  var i, o;
6110
- return R(
6153
+ return O(
6111
6154
  this.name,
6112
6155
  `h${e.attrs.level}`,
6113
6156
  {
@@ -6117,9 +6160,9 @@ const ue = (e) => {
6117
6160
  ((o = this.options.domAttributes) == null ? void 0 : o.inlineContent) || {}
6118
6161
  );
6119
6162
  }
6120
- }), bo = X(
6121
- go,
6122
- fo
6163
+ }), wo = X(
6164
+ yo,
6165
+ ko
6123
6166
  ), Be = (e) => {
6124
6167
  const { contentNode: t, contentType: i } = _(
6125
6168
  e.state.doc,
@@ -6139,9 +6182,9 @@ const ue = (e) => {
6139
6182
  a.command(() => t.childCount > 0 ? (r().deleteSelection().BNSplitBlock(n.selection.from, !0).run(), !0) : !1)
6140
6183
  )
6141
6184
  ]);
6142
- }, _o = {
6143
- ...k
6144
- }, ko = O({
6185
+ }, vo = {
6186
+ ...w
6187
+ }, xo = F({
6145
6188
  name: "bulletListItem",
6146
6189
  content: "inline*",
6147
6190
  group: "blockContent",
@@ -6151,10 +6194,10 @@ const ue = (e) => {
6151
6194
  addInputRules() {
6152
6195
  return [
6153
6196
  // Creates an unordered list when starting with "-", "+", or "*".
6154
- new te({
6197
+ new ee({
6155
6198
  find: new RegExp("^[-+*]\\s$"),
6156
6199
  handler: ({ state: e, chain: t, range: i }) => {
6157
- S(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6200
+ B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6158
6201
  type: "bulletListItem",
6159
6202
  props: {}
6160
6203
  }).deleteRange({ from: i.from, to: i.to });
@@ -6165,7 +6208,7 @@ const ue = (e) => {
6165
6208
  addKeyboardShortcuts() {
6166
6209
  return {
6167
6210
  Enter: () => Be(this.editor),
6168
- "Mod-Shift-8": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6211
+ "Mod-Shift-8": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6169
6212
  this.editor.state.selection.anchor,
6170
6213
  {
6171
6214
  type: "bulletListItem",
@@ -6207,7 +6250,7 @@ const ue = (e) => {
6207
6250
  },
6208
6251
  renderHTML({ HTMLAttributes: e }) {
6209
6252
  var t, i;
6210
- return R(
6253
+ return O(
6211
6254
  this.name,
6212
6255
  // We use a <p> tag, because for <li> tags we'd need a <ul> element to put
6213
6256
  // them in to be semantically correct, which we can't have due to the
@@ -6220,11 +6263,11 @@ const ue = (e) => {
6220
6263
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6221
6264
  );
6222
6265
  }
6223
- }), yo = X(
6224
- ko,
6225
- _o
6226
- ), wo = new M("numbered-list-indexing"), vo = () => new w({
6227
- key: wo,
6266
+ }), Eo = X(
6267
+ xo,
6268
+ vo
6269
+ ), Co = new L("numbered-list-indexing"), So = () => new x({
6270
+ key: Co,
6228
6271
  appendTransaction: (e, t, i) => {
6229
6272
  const o = i.tr;
6230
6273
  o.setMeta("numberedListIndexing", !0);
@@ -6240,10 +6283,10 @@ const ue = (e) => {
6240
6283
  if (h === void 0)
6241
6284
  return;
6242
6285
  if (!(d.depth !== h.depth)) {
6243
- const g = h.contentNode;
6286
+ const f = h.contentNode;
6244
6287
  if (h.contentType.name === "numberedListItem") {
6245
- const y = g.attrs.index;
6246
- s = (parseInt(y) + 1).toString();
6288
+ const v = f.attrs.index;
6289
+ s = (parseInt(v) + 1).toString();
6247
6290
  }
6248
6291
  }
6249
6292
  }
@@ -6253,9 +6296,9 @@ const ue = (e) => {
6253
6296
  }
6254
6297
  }), n ? o : null;
6255
6298
  }
6256
- }), xo = {
6257
- ...k
6258
- }, Eo = O({
6299
+ }), Mo = {
6300
+ ...w
6301
+ }, To = F({
6259
6302
  name: "numberedListItem",
6260
6303
  content: "inline*",
6261
6304
  group: "blockContent",
@@ -6274,10 +6317,10 @@ const ue = (e) => {
6274
6317
  addInputRules() {
6275
6318
  return [
6276
6319
  // Creates an ordered list when starting with "1.".
6277
- new te({
6320
+ new ee({
6278
6321
  find: new RegExp("^1\\.\\s$"),
6279
6322
  handler: ({ state: e, chain: t, range: i }) => {
6280
- S(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6323
+ B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6281
6324
  type: "numberedListItem",
6282
6325
  props: {}
6283
6326
  }).deleteRange({ from: i.from, to: i.to });
@@ -6288,7 +6331,7 @@ const ue = (e) => {
6288
6331
  addKeyboardShortcuts() {
6289
6332
  return {
6290
6333
  Enter: () => Be(this.editor),
6291
- "Mod-Shift-7": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6334
+ "Mod-Shift-7": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6292
6335
  this.editor.state.selection.anchor,
6293
6336
  {
6294
6337
  type: "numberedListItem",
@@ -6298,7 +6341,7 @@ const ue = (e) => {
6298
6341
  };
6299
6342
  },
6300
6343
  addProseMirrorPlugins() {
6301
- return [vo()];
6344
+ return [So()];
6302
6345
  },
6303
6346
  parseHTML() {
6304
6347
  return [
@@ -6335,7 +6378,7 @@ const ue = (e) => {
6335
6378
  },
6336
6379
  renderHTML({ HTMLAttributes: e }) {
6337
6380
  var t, i;
6338
- return R(
6381
+ return O(
6339
6382
  this.name,
6340
6383
  // We use a <p> tag, because for <li> tags we'd need an <ol> element to
6341
6384
  // put them in to be semantically correct, which we can't have due to the
@@ -6348,15 +6391,15 @@ const ue = (e) => {
6348
6391
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6349
6392
  );
6350
6393
  }
6351
- }), Co = X(
6352
- Eo,
6353
- xo
6354
- ), So = {
6355
- ...k,
6394
+ }), Bo = X(
6395
+ To,
6396
+ Mo
6397
+ ), Lo = {
6398
+ ...w,
6356
6399
  checked: {
6357
6400
  default: !1
6358
6401
  }
6359
- }, Mo = O({
6402
+ }, Io = F({
6360
6403
  name: "checkListItem",
6361
6404
  content: "inline*",
6362
6405
  group: "blockContent",
@@ -6375,10 +6418,10 @@ const ue = (e) => {
6375
6418
  addInputRules() {
6376
6419
  return [
6377
6420
  // Creates a checklist when starting with "[]" or "[X]".
6378
- new te({
6421
+ new ee({
6379
6422
  find: new RegExp("\\[\\s*\\]\\s$"),
6380
6423
  handler: ({ state: e, chain: t, range: i }) => {
6381
- S(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6424
+ B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6382
6425
  type: "checkListItem",
6383
6426
  props: {
6384
6427
  checked: !1
@@ -6386,10 +6429,10 @@ const ue = (e) => {
6386
6429
  }).deleteRange({ from: i.from, to: i.to });
6387
6430
  }
6388
6431
  }),
6389
- new te({
6432
+ new ee({
6390
6433
  find: new RegExp("\\[[Xx]\\]\\s$"),
6391
6434
  handler: ({ state: e, chain: t, range: i }) => {
6392
- S(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6435
+ B(this.editor) === "inline*" && t().BNUpdateBlock(e.selection.from, {
6393
6436
  type: "checkListItem",
6394
6437
  props: {
6395
6438
  checked: !0
@@ -6402,7 +6445,7 @@ const ue = (e) => {
6402
6445
  addKeyboardShortcuts() {
6403
6446
  return {
6404
6447
  Enter: () => Be(this.editor),
6405
- "Mod-Shift-9": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6448
+ "Mod-Shift-9": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6406
6449
  this.editor.state.selection.anchor,
6407
6450
  {
6408
6451
  type: "checkListItem",
@@ -6453,7 +6496,7 @@ const ue = (e) => {
6453
6496
  var r, a;
6454
6497
  const i = document.createElement("input");
6455
6498
  i.type = "checkbox", i.checked = e.attrs.checked, e.attrs.checked && i.setAttribute("checked", "");
6456
- const { dom: o, contentDOM: n } = R(
6499
+ const { dom: o, contentDOM: n } = O(
6457
6500
  this.name,
6458
6501
  "p",
6459
6502
  {
@@ -6486,7 +6529,7 @@ const ue = (e) => {
6486
6529
  });
6487
6530
  };
6488
6531
  a.addEventListener("change", s);
6489
- const { dom: l, contentDOM: d } = R(
6532
+ const { dom: l, contentDOM: d } = O(
6490
6533
  this.name,
6491
6534
  "p",
6492
6535
  {
@@ -6508,18 +6551,18 @@ const ue = (e) => {
6508
6551
  };
6509
6552
  };
6510
6553
  }
6511
- }), To = X(
6512
- Mo,
6513
- So
6514
- ), Bo = {
6515
- ...k
6516
- }, Lo = O({
6554
+ }), Ao = X(
6555
+ Io,
6556
+ Lo
6557
+ ), No = {
6558
+ ...w
6559
+ }, Po = F({
6517
6560
  name: "paragraph",
6518
6561
  content: "inline*",
6519
6562
  group: "blockContent",
6520
6563
  addKeyboardShortcuts() {
6521
6564
  return {
6522
- "Mod-Alt-0": () => S(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6565
+ "Mod-Alt-0": () => B(this.editor) !== "inline*" ? !0 : this.editor.commands.BNUpdateBlock(
6523
6566
  this.editor.state.selection.anchor,
6524
6567
  {
6525
6568
  type: "paragraph",
@@ -6544,7 +6587,7 @@ const ue = (e) => {
6544
6587
  },
6545
6588
  renderHTML({ HTMLAttributes: e }) {
6546
6589
  var t, i;
6547
- return R(
6590
+ return O(
6548
6591
  this.name,
6549
6592
  "p",
6550
6593
  {
@@ -6554,16 +6597,16 @@ const ue = (e) => {
6554
6597
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6555
6598
  );
6556
6599
  }
6557
- }), Io = X(
6558
- Lo,
6559
- Bo
6560
- ), Ao = T.create({
6600
+ }), Ho = X(
6601
+ Po,
6602
+ No
6603
+ ), Uo = I.create({
6561
6604
  name: "BlockNoteTableExtension",
6562
6605
  addProseMirrorPlugins: () => [
6563
- Qt({
6606
+ ii({
6564
6607
  cellMinWidth: 100
6565
6608
  }),
6566
- ei()
6609
+ oi()
6567
6610
  ],
6568
6611
  addKeyboardShortcuts() {
6569
6612
  return {
@@ -6584,14 +6627,14 @@ const ue = (e) => {
6584
6627
  storage: e.storage
6585
6628
  };
6586
6629
  return {
6587
- tableRole: Nt(
6588
- Pt(e, "tableRole", t)
6630
+ tableRole: Ut(
6631
+ Dt(e, "tableRole", t)
6589
6632
  )
6590
6633
  };
6591
6634
  }
6592
- }), No = {
6593
- ...k
6594
- }, Po = O({
6635
+ }), Do = {
6636
+ ...w
6637
+ }, jo = F({
6595
6638
  name: "table",
6596
6639
  content: "tableRow+",
6597
6640
  group: "blockContent",
@@ -6602,7 +6645,7 @@ const ue = (e) => {
6602
6645
  },
6603
6646
  renderHTML({ HTMLAttributes: e }) {
6604
6647
  var t, i;
6605
- return R(
6648
+ return O(
6606
6649
  this.name,
6607
6650
  "table",
6608
6651
  {
@@ -6612,7 +6655,7 @@ const ue = (e) => {
6612
6655
  ((i = this.options.domAttributes) == null ? void 0 : i.inlineContent) || {}
6613
6656
  );
6614
6657
  }
6615
- }), Ho = q.create({
6658
+ }), zo = q.create({
6616
6659
  name: "tableParagraph",
6617
6660
  group: "tableContent",
6618
6661
  content: "inline*",
@@ -6633,72 +6676,72 @@ const ue = (e) => {
6633
6676
  renderHTML({ HTMLAttributes: e }) {
6634
6677
  return [
6635
6678
  "p",
6636
- Ht(this.options.HTMLAttributes, e),
6679
+ jt(this.options.HTMLAttributes, e),
6637
6680
  0
6638
6681
  ];
6639
6682
  }
6640
- }), Do = X(
6641
- Po,
6642
- No,
6683
+ }), Vo = X(
6684
+ jo,
6685
+ Do,
6643
6686
  [
6644
- Ao,
6645
- Ho,
6646
- Jt.extend({
6687
+ Uo,
6688
+ zo,
6689
+ ei.extend({
6647
6690
  content: "tableContent"
6648
6691
  }),
6649
- Zt.extend({
6692
+ Qt.extend({
6650
6693
  content: "tableContent"
6651
6694
  }),
6652
- Yt
6695
+ ti
6653
6696
  ]
6654
- ), ht = {
6655
- paragraph: Io,
6656
- heading: bo,
6657
- bulletListItem: yo,
6658
- numberedListItem: Co,
6659
- checkListItem: To,
6660
- table: Do,
6661
- file: Ji,
6662
- image: oo,
6663
- video: co,
6664
- audio: Ki
6665
- }, Uo = lt(ht), mt = {
6666
- bold: U(Kt, "boolean"),
6667
- italic: U($t, "boolean"),
6668
- underline: U(Xt, "boolean"),
6669
- strike: U(qt, "boolean"),
6670
- code: U(Wt, "boolean"),
6671
- textColor: mo,
6672
- backgroundColor: po
6673
- }, Lr = ut(mt), ft = {
6697
+ ), ft = {
6698
+ paragraph: Ho,
6699
+ heading: wo,
6700
+ bulletListItem: Eo,
6701
+ numberedListItem: Bo,
6702
+ checkListItem: Ao,
6703
+ table: Vo,
6704
+ file: to,
6705
+ image: so,
6706
+ video: mo,
6707
+ audio: Xi
6708
+ }, Ro = dt(ft), gt = {
6709
+ bold: j(qt, "boolean"),
6710
+ italic: j(Zt, "boolean"),
6711
+ underline: j(Yt, "boolean"),
6712
+ strike: j(Jt, "boolean"),
6713
+ code: j(Xt, "boolean"),
6714
+ textColor: _o,
6715
+ backgroundColor: go
6716
+ }, Pr = pt(gt), bt = {
6674
6717
  text: { config: "text", implementation: {} },
6675
6718
  link: { config: "link", implementation: {} }
6676
- }, jo = dt(
6677
- ft
6719
+ }, Oo = ct(
6720
+ bt
6678
6721
  );
6679
- function C(e, t) {
6680
- return e in t.schema.blockSchema && t.schema.blockSchema[e] === Uo[e];
6722
+ function T(e, t) {
6723
+ return e in t.schema.blockSchema && t.schema.blockSchema[e] === Ro[e];
6681
6724
  }
6682
- function zo(e, t) {
6683
- return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === jo[e];
6725
+ function Fo(e, t) {
6726
+ return e in t.schema.inlineContentSchema && t.schema.inlineContentSchema[e] === Oo[e];
6684
6727
  }
6685
- function Ro(e, t, i) {
6686
- return t.type === e && t.type in i.schema.blockSchema && C(t.type, i);
6728
+ function Go(e, t, i) {
6729
+ return t.type === e && t.type in i.schema.blockSchema && T(t.type, i);
6687
6730
  }
6688
- function Ir(e, t) {
6731
+ function Hr(e, t) {
6689
6732
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock || !1;
6690
6733
  }
6691
- function Ar(e, t) {
6734
+ function Ur(e, t) {
6692
6735
  return e.type in t.schema.blockSchema && t.schema.blockSchema[e.type].isFileBlock && "showPreview" in t.schema.blockSchema[e.type].propSchema || !1;
6693
6736
  }
6694
- function Nr(e, t) {
6737
+ function Dr(e, t) {
6695
6738
  return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
6696
6739
  }
6697
- function Vo(e, t, i) {
6698
- return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] === k[e];
6740
+ function Wo(e, t, i) {
6741
+ return t in i.schema.blockSchema && e in i.schema.blockSchema[t].propSchema && i.schema.blockSchema[t].propSchema[e] === w[e];
6699
6742
  }
6700
- function Pr(e, t, i) {
6701
- return Vo(e, t.type, i);
6743
+ function jr(e, t, i) {
6744
+ return Wo(e, t.type, i);
6702
6745
  }
6703
6746
  function Le(e, t) {
6704
6747
  let i, o;
@@ -6709,11 +6752,11 @@ function Le(e, t) {
6709
6752
  posBeforeNode: o
6710
6753
  };
6711
6754
  }
6712
- function Oo(e, t, i = "before", o) {
6755
+ function Ko(e, t, i = "before", o) {
6713
6756
  const n = typeof t == "string" ? t : t.id, r = [];
6714
6757
  for (const d of e)
6715
6758
  r.push(
6716
- H(d, o.pmSchema, o.schema.styleSchema)
6759
+ U(d, o.pmSchema, o.schema.styleSchema)
6717
6760
  );
6718
6761
  const { node: a, posBeforeNode: s } = Le(
6719
6762
  n,
@@ -6738,7 +6781,7 @@ function Oo(e, t, i = "before", o) {
6738
6781
  const l = [];
6739
6782
  for (const d of r)
6740
6783
  l.push(
6741
- x(
6784
+ C(
6742
6785
  d,
6743
6786
  o.schema.blockSchema,
6744
6787
  o.schema.inlineContentSchema,
@@ -6748,11 +6791,11 @@ function Oo(e, t, i = "before", o) {
6748
6791
  );
6749
6792
  return l;
6750
6793
  }
6751
- function Fo(e, t, i) {
6794
+ function $o(e, t, i) {
6752
6795
  const o = i._tiptapEditor, n = typeof e == "string" ? e : e.id, { posBeforeNode: r } = Le(n, o.state.doc);
6753
6796
  o.commands.BNUpdateBlock(r + 1, t);
6754
6797
  const a = o.state.doc.resolve(r + 1).node();
6755
- return x(
6798
+ return C(
6756
6799
  a,
6757
6800
  i.schema.blockSchema,
6758
6801
  i.schema.inlineContentSchema,
@@ -6760,7 +6803,7 @@ function Fo(e, t, i) {
6760
6803
  i.blockCache
6761
6804
  );
6762
6805
  }
6763
- function gt(e, t, i) {
6806
+ function _t(e, t, i) {
6764
6807
  const o = t._tiptapEditor, n = o.state.tr, r = new Set(
6765
6808
  e.map(
6766
6809
  (l) => typeof l == "string" ? l : l.id
@@ -6773,7 +6816,7 @@ function gt(e, t, i) {
6773
6816
  if (l.type.name !== "blockContainer" || !r.has(l.attrs.id))
6774
6817
  return !0;
6775
6818
  a.push(
6776
- x(
6819
+ C(
6777
6820
  l,
6778
6821
  t.schema.blockSchema,
6779
6822
  t.schema.inlineContentSchema,
@@ -6794,16 +6837,16 @@ function gt(e, t, i) {
6794
6837
  }
6795
6838
  return t.dispatch(n), a;
6796
6839
  }
6797
- function Go(e, t) {
6798
- return gt(e, t);
6840
+ function qo(e, t) {
6841
+ return _t(e, t);
6799
6842
  }
6800
- function Ko(e, t, i) {
6843
+ function Xo(e, t, i) {
6801
6844
  const o = [];
6802
6845
  for (const s of t)
6803
6846
  o.push(
6804
- H(s, i.pmSchema, i.schema.styleSchema)
6847
+ U(s, i.pmSchema, i.schema.styleSchema)
6805
6848
  );
6806
- const n = typeof e[0] == "string" ? e[0] : e[0].id, r = gt(
6849
+ const n = typeof e[0] == "string" ? e[0] : e[0].id, r = _t(
6807
6850
  e,
6808
6851
  i,
6809
6852
  (s, l, d, u) => {
@@ -6818,7 +6861,7 @@ function Ko(e, t, i) {
6818
6861
  ), a = [];
6819
6862
  for (const s of o)
6820
6863
  a.push(
6821
- x(
6864
+ C(
6822
6865
  s,
6823
6866
  i.schema.blockSchema,
6824
6867
  i.schema.inlineContentSchema,
@@ -6828,7 +6871,7 @@ function Ko(e, t, i) {
6828
6871
  );
6829
6872
  return { insertedBlocks: a, removedBlocks: r };
6830
6873
  }
6831
- function Wo(e, t, i, o = { updateSelection: !0 }) {
6874
+ function Zo(e, t, i, o = { updateSelection: !0 }) {
6832
6875
  const n = i._tiptapEditor.state.tr;
6833
6876
  let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
6834
6877
  if (t.forEach((u) => {
@@ -6837,9 +6880,9 @@ function Wo(e, t, i, o = { updateSelection: !0 }) {
6837
6880
  const { parent: u } = n.doc.resolve(r);
6838
6881
  u.isTextblock && !u.type.spec.code && !u.childCount && (r -= 1, a += 1);
6839
6882
  }
6840
- return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), o.updateSelection && Dt(n, n.steps.length - 1, -1), i.dispatch(n), !0;
6883
+ return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), o.updateSelection && zt(n, n.steps.length - 1, -1), i.dispatch(n), !0;
6841
6884
  }
6842
- function $o() {
6885
+ function Jo() {
6843
6886
  const e = (t) => {
6844
6887
  let i = t.children.length;
6845
6888
  for (let o = 0; o < i; o++) {
@@ -6855,8 +6898,8 @@ function $o() {
6855
6898
  };
6856
6899
  return e;
6857
6900
  }
6858
- function qo() {
6859
- const e = P;
6901
+ function Yo() {
6902
+ const e = H;
6860
6903
  if (!e)
6861
6904
  throw new Error(
6862
6905
  "simplifyBlocks requires ESM dependencies to be initialized"
@@ -6878,42 +6921,42 @@ function qo() {
6878
6921
  return t;
6879
6922
  }
6880
6923
  function Ie(e) {
6881
- const t = P;
6924
+ const t = H;
6882
6925
  if (!t)
6883
6926
  throw new Error(
6884
6927
  "cleanHTMLToMarkdown requires ESM dependencies to be initialized"
6885
6928
  );
6886
- return t.unified.unified().use(t.rehypeParse.default, { fragment: !0 }).use($o).use(qo).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default, {
6929
+ return t.unified.unified().use(t.rehypeParse.default, { fragment: !0 }).use(Jo).use(Yo).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default, {
6887
6930
  handlers: { text: (o) => o.value }
6888
6931
  }).processSync(e).value;
6889
6932
  }
6890
- async function Xo(e, t, i, o) {
6891
- await oe();
6933
+ async function Qo(e, t, i, o) {
6934
+ await ie();
6892
6935
  const r = de(t, i).exportBlocks(e, o);
6893
6936
  return Ie(r);
6894
6937
  }
6895
- function Zo(e) {
6938
+ function en(e) {
6896
6939
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
6897
6940
  }
6898
- function Jo(e) {
6941
+ function tn(e) {
6899
6942
  return e.nodeType === 3 && !/\S/.test(e.nodeValue || "");
6900
6943
  }
6901
- function Yo(e) {
6944
+ function on(e) {
6902
6945
  e.querySelectorAll("li > ul, li > ol").forEach((t) => {
6903
- const i = Zo(t), o = t.parentElement, n = Array.from(o.childNodes).slice(
6946
+ const i = en(t), o = t.parentElement, n = Array.from(o.childNodes).slice(
6904
6947
  i + 1
6905
6948
  );
6906
6949
  t.remove(), n.forEach((r) => {
6907
6950
  r.remove();
6908
6951
  }), o.insertAdjacentElement("afterend", t), n.reverse().forEach((r) => {
6909
- if (Jo(r))
6952
+ if (tn(r))
6910
6953
  return;
6911
6954
  const a = document.createElement("li");
6912
6955
  a.append(r), t.insertAdjacentElement("afterend", a);
6913
6956
  }), o.childNodes.length === 0 && o.remove();
6914
6957
  });
6915
6958
  }
6916
- function Qo(e) {
6959
+ function nn(e) {
6917
6960
  e.querySelectorAll("li + ul, li + ol").forEach((t) => {
6918
6961
  var r, a;
6919
6962
  const i = t.previousElementSibling, o = document.createElement("div");
@@ -6923,28 +6966,28 @@ function Qo(e) {
6923
6966
  n.append(o.nextElementSibling);
6924
6967
  });
6925
6968
  }
6926
- let We = null;
6927
- function en() {
6928
- return We || (We = document.implementation.createHTMLDocument("title"));
6969
+ let qe = null;
6970
+ function rn() {
6971
+ return qe || (qe = document.implementation.createHTMLDocument("title"));
6929
6972
  }
6930
- function bt(e) {
6973
+ function kt(e) {
6931
6974
  if (typeof e == "string") {
6932
- const t = en().createElement("div");
6975
+ const t = rn().createElement("div");
6933
6976
  t.innerHTML = e, e = t;
6934
6977
  }
6935
- return Yo(e), Qo(e), e;
6978
+ return on(e), nn(e), e;
6936
6979
  }
6937
- async function _t(e, t, i, o, n) {
6938
- const r = bt(e), s = Tt.fromSchema(n).parse(r, {
6980
+ async function yt(e, t, i, o, n) {
6981
+ const r = kt(e), s = It.fromSchema(n).parse(r, {
6939
6982
  topNode: n.nodes.blockGroup.create()
6940
6983
  }), l = [];
6941
6984
  for (let d = 0; d < s.childCount; d++)
6942
6985
  l.push(
6943
- x(s.child(d), t, i, o)
6986
+ C(s.child(d), t, i, o)
6944
6987
  );
6945
6988
  return l;
6946
6989
  }
6947
- function tn(e, t) {
6990
+ function an(e, t) {
6948
6991
  const i = t.value ? t.value + `
6949
6992
  ` : "", o = {};
6950
6993
  t.lang && (o["data-language"] = t.lang);
@@ -6961,14 +7004,14 @@ function tn(e, t) {
6961
7004
  children: [n]
6962
7005
  }, e.patch(t, n), n;
6963
7006
  }
6964
- async function on(e, t, i, o, n) {
6965
- const r = await oe(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
7007
+ async function sn(e, t, i, o, n) {
7008
+ const r = await ie(), a = r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default, {
6966
7009
  handlers: {
6967
7010
  ...r.remarkRehype.defaultHandlers,
6968
- code: tn
7011
+ code: an
6969
7012
  }
6970
7013
  }).use(r.rehypeStringify.default).processSync(e);
6971
- return _t(
7014
+ return yt(
6972
7015
  a.value,
6973
7016
  t,
6974
7017
  i,
@@ -6996,7 +7039,7 @@ class Z {
6996
7039
  this.callbacks = {};
6997
7040
  }
6998
7041
  }
6999
- class nn {
7042
+ class ln {
7000
7043
  constructor(t, i, o, n) {
7001
7044
  c(this, "state");
7002
7045
  c(this, "emitUpdate");
@@ -7015,6 +7058,8 @@ class nn {
7015
7058
  const i = this.pmView.root.querySelector(
7016
7059
  `[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`
7017
7060
  );
7061
+ if (!i)
7062
+ return;
7018
7063
  this.state.referencePos = i.getBoundingClientRect(), this.emitUpdate();
7019
7064
  }
7020
7065
  });
@@ -7035,6 +7080,8 @@ class nn {
7035
7080
  const a = this.pmView.root.querySelector(
7036
7081
  `[data-node-type="blockContainer"][data-id="${o.block.id}"]`
7037
7082
  );
7083
+ if (!a)
7084
+ return;
7038
7085
  this.state = {
7039
7086
  show: !0,
7040
7087
  referencePos: a.getBoundingClientRect(),
@@ -7048,25 +7095,31 @@ class nn {
7048
7095
  this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler), this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
7049
7096
  }
7050
7097
  }
7051
- const _e = new M("FilePanelPlugin");
7052
- class rn extends Z {
7098
+ const be = new L("FilePanelPlugin");
7099
+ class dn extends Z {
7053
7100
  constructor(i) {
7054
7101
  super();
7055
7102
  c(this, "view");
7056
7103
  c(this, "plugin");
7057
- c(this, "closeMenu", () => this.view.closeMenu());
7058
- this.plugin = new w({
7059
- key: _e,
7060
- view: (o) => (this.view = new nn(
7104
+ c(this, "closeMenu", () => {
7105
+ var i;
7106
+ return (i = this.view) == null ? void 0 : i.closeMenu();
7107
+ });
7108
+ this.plugin = new x({
7109
+ key: be,
7110
+ view: (o) => (this.view = new ln(
7061
7111
  i,
7062
- _e,
7112
+ be,
7063
7113
  o,
7064
7114
  (n) => {
7065
7115
  this.emit("update", n);
7066
7116
  }
7067
7117
  ), this.view),
7068
7118
  props: {
7069
- handleKeyDown: (o, n) => n.key === "Escape" && this.shown ? (this.view.closeMenu(), !0) : !1
7119
+ handleKeyDown: (o, n) => {
7120
+ var r;
7121
+ return n.key === "Escape" && this.shown ? ((r = this.view) == null || r.closeMenu(), !0) : !1;
7122
+ }
7070
7123
  },
7071
7124
  state: {
7072
7125
  init: () => ({
@@ -7075,7 +7128,7 @@ class rn extends Z {
7075
7128
  apply: (o) => {
7076
7129
  var r;
7077
7130
  return {
7078
- block: (r = o.getMeta(_e)) == null ? void 0 : r.block
7131
+ block: (r = o.getMeta(be)) == null ? void 0 : r.block
7079
7132
  };
7080
7133
  }
7081
7134
  }
@@ -7089,14 +7142,14 @@ class rn extends Z {
7089
7142
  return this.on("update", i);
7090
7143
  }
7091
7144
  }
7092
- class an {
7145
+ class cn {
7093
7146
  constructor(t, i, o) {
7094
7147
  c(this, "state");
7095
7148
  c(this, "emitUpdate");
7096
7149
  c(this, "preventHide", !1);
7097
7150
  c(this, "preventShow", !1);
7098
7151
  c(this, "shouldShow", ({ state: t, from: i, to: o, view: n }) => {
7099
- const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(i, o).length && Ut(t.selection);
7152
+ const { doc: r, selection: a } = t, { empty: s } = a, l = !r.textBetween(i, o).length && Vt(t.selection);
7100
7153
  return !(!n.hasFocus() || s || l);
7101
7154
  });
7102
7155
  c(this, "blurHandler", (t) => {
@@ -7144,7 +7197,7 @@ class an {
7144
7197
  const { state: o, composing: n } = t, { doc: r, selection: a } = o, s = i && i.doc.eq(r) && i.selection.eq(a);
7145
7198
  if (n || s)
7146
7199
  return;
7147
- const { ranges: l } = a, d = Math.min(...l.map((g) => g.$from.pos)), u = Math.max(...l.map((g) => g.$to.pos)), p = (h = this.shouldShow) == null ? void 0 : h.call(this, {
7200
+ const { ranges: l } = a, d = Math.min(...l.map((f) => f.$from.pos)), u = Math.max(...l.map((f) => f.$to.pos)), p = (h = this.shouldShow) == null ? void 0 : h.call(this, {
7148
7201
  view: t,
7149
7202
  state: o,
7150
7203
  from: d,
@@ -7167,26 +7220,26 @@ class an {
7167
7220
  }
7168
7221
  getSelectionBoundingBox() {
7169
7222
  const { state: t } = this.pmView, { selection: i } = t, { ranges: o } = i, n = Math.min(...o.map((a) => a.$from.pos)), r = Math.max(...o.map((a) => a.$to.pos));
7170
- if (jt(i)) {
7223
+ if (Rt(i)) {
7171
7224
  const a = this.pmView.nodeDOM(n);
7172
7225
  if (a)
7173
7226
  return a.getBoundingClientRect();
7174
7227
  }
7175
- return ve(this.pmView, n, r);
7228
+ return we(this.pmView, n, r);
7176
7229
  }
7177
7230
  }
7178
- const sn = new M(
7231
+ const un = new L(
7179
7232
  "FormattingToolbarPlugin"
7180
7233
  );
7181
- class ln extends Z {
7234
+ class pn extends Z {
7182
7235
  constructor(i) {
7183
7236
  super();
7184
7237
  c(this, "view");
7185
7238
  c(this, "plugin");
7186
7239
  c(this, "closeMenu", () => this.view.closeMenu());
7187
- this.plugin = new w({
7188
- key: sn,
7189
- view: (o) => (this.view = new an(i, o, (n) => {
7240
+ this.plugin = new x({
7241
+ key: un,
7242
+ view: (o) => (this.view = new cn(i, o, (n) => {
7190
7243
  this.emit("update", n);
7191
7244
  }), this.view),
7192
7245
  props: {
@@ -7202,7 +7255,7 @@ class ln extends Z {
7202
7255
  return this.on("update", i);
7203
7256
  }
7204
7257
  }
7205
- class dn {
7258
+ class hn {
7206
7259
  constructor(t, i, o) {
7207
7260
  c(this, "state");
7208
7261
  c(this, "emitUpdate");
@@ -7220,7 +7273,7 @@ class dn {
7220
7273
  const i = t.target, o = this.pmView.posAtDOM(i, 0) + 1, n = this.pmView.state.doc.resolve(o), r = n.marks();
7221
7274
  for (const a of r)
7222
7275
  if (a.type.name === this.pmView.state.schema.mark("link").type.name) {
7223
- this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = Ue(n, a.type, a.attrs) || void 0;
7276
+ this.mouseHoveredLinkMark = a, this.mouseHoveredLinkMarkRange = De(n, a.type, a.attrs) || void 0;
7224
7277
  break;
7225
7278
  }
7226
7279
  }
@@ -7236,7 +7289,7 @@ class dn {
7236
7289
  });
7237
7290
  c(this, "scrollHandler", () => {
7238
7291
  var t;
7239
- this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = ve(
7292
+ this.linkMark !== void 0 && (t = this.state) != null && t.show && (this.state.referencePos = we(
7240
7293
  this.pmView,
7241
7294
  this.linkMarkRange.from,
7242
7295
  this.linkMarkRange.to
@@ -7292,7 +7345,7 @@ class dn {
7292
7345
  const o = this.pmView.state.selection.$from.marks();
7293
7346
  for (const n of o)
7294
7347
  if (n.type.name === this.pmView.state.schema.mark("link").type.name) {
7295
- this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = Ue(
7348
+ this.keyboardHoveredLinkMark = n, this.keyboardHoveredLinkMarkRange = De(
7296
7349
  this.pmView.state.selection.$from,
7297
7350
  n.type,
7298
7351
  n.attrs
@@ -7303,7 +7356,7 @@ class dn {
7303
7356
  if (this.mouseHoveredLinkMark && (this.linkMark = this.mouseHoveredLinkMark, this.linkMarkRange = this.mouseHoveredLinkMarkRange), this.keyboardHoveredLinkMark && (this.linkMark = this.keyboardHoveredLinkMark, this.linkMarkRange = this.keyboardHoveredLinkMarkRange), this.linkMark && this.editor.isEditable) {
7304
7357
  this.state = {
7305
7358
  show: !0,
7306
- referencePos: ve(
7359
+ referencePos: we(
7307
7360
  this.pmView,
7308
7361
  this.linkMarkRange.from,
7309
7362
  this.linkMarkRange.to
@@ -7329,8 +7382,8 @@ class dn {
7329
7382
  );
7330
7383
  }
7331
7384
  }
7332
- const cn = new M("LinkToolbarPlugin");
7333
- class un extends Z {
7385
+ const mn = new L("LinkToolbarPlugin");
7386
+ class fn extends Z {
7334
7387
  constructor(i) {
7335
7388
  super();
7336
7389
  c(this, "view");
@@ -7368,9 +7421,9 @@ class un extends Z {
7368
7421
  this.view.stopMenuUpdateTimer();
7369
7422
  });
7370
7423
  c(this, "closeMenu", () => this.view.closeMenu());
7371
- this.plugin = new w({
7372
- key: cn,
7373
- view: (o) => (this.view = new dn(i, o, (n) => {
7424
+ this.plugin = new x({
7425
+ key: mn,
7426
+ view: (o) => (this.view = new hn(i, o, (n) => {
7374
7427
  this.emit("update", n);
7375
7428
  }), this.view),
7376
7429
  props: {
@@ -7386,7 +7439,7 @@ class un extends Z {
7386
7439
  return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
7387
7440
  }
7388
7441
  }
7389
- class F extends ge {
7442
+ class G extends fe {
7390
7443
  constructor(i, o) {
7391
7444
  super(i, o);
7392
7445
  c(this, "nodes");
@@ -7397,13 +7450,13 @@ class F extends ge {
7397
7450
  });
7398
7451
  }
7399
7452
  static create(i, o, n = o) {
7400
- return new F(i.resolve(o), i.resolve(n));
7453
+ return new G(i.resolve(o), i.resolve(n));
7401
7454
  }
7402
7455
  content() {
7403
- return new j(I.from(this.nodes), 0, 0);
7456
+ return new z(N.from(this.nodes), 0, 0);
7404
7457
  }
7405
7458
  eq(i) {
7406
- if (!(i instanceof F) || this.nodes.length !== i.nodes.length || this.from !== i.from || this.to !== i.to)
7459
+ if (!(i instanceof G) || this.nodes.length !== i.nodes.length || this.from !== i.from || this.to !== i.to)
7407
7460
  return !1;
7408
7461
  for (let o = 0; o < this.nodes.length; o++)
7409
7462
  if (!this.nodes[o].eq(i.nodes[o]))
@@ -7412,7 +7465,7 @@ class F extends ge {
7412
7465
  }
7413
7466
  map(i, o) {
7414
7467
  const n = o.mapResult(this.from), r = o.mapResult(this.to);
7415
- return r.deleted ? ge.near(i.resolve(n.pos)) : n.deleted ? ge.near(i.resolve(r.pos)) : new F(
7468
+ return r.deleted ? fe.near(i.resolve(n.pos)) : n.deleted ? fe.near(i.resolve(r.pos)) : new G(
7416
7469
  i.resolve(n.pos),
7417
7470
  i.resolve(r.pos)
7418
7471
  );
@@ -7421,23 +7474,23 @@ class F extends ge {
7421
7474
  return { type: "node", anchor: this.anchor, head: this.head };
7422
7475
  }
7423
7476
  }
7424
- let L;
7425
- function fe(e, t) {
7477
+ let A;
7478
+ function me(e, t) {
7426
7479
  var i, o;
7427
7480
  for (; e && e.parentElement && e.parentElement !== t.dom && ((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) !== "blockContainer"; )
7428
7481
  e = e.parentElement;
7429
7482
  if (((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) === "blockContainer")
7430
7483
  return { node: e, id: e.getAttribute("data-id") };
7431
7484
  }
7432
- function pn(e, t) {
7433
- const i = fe(e, t);
7485
+ function gn(e, t) {
7486
+ const i = me(e, t);
7434
7487
  if (i && i.node.nodeType === 1) {
7435
7488
  const o = t.docView, n = o.nearestDesc(i.node, !0);
7436
7489
  return !n || n === o ? null : n.posBefore;
7437
7490
  }
7438
7491
  return null;
7439
7492
  }
7440
- function hn(e, t) {
7493
+ function bn(e, t) {
7441
7494
  let i, o;
7442
7495
  const n = t.resolve(e.from).node().type.spec.group === "blockContent", r = t.resolve(e.to).node().type.spec.group === "blockContent", a = Math.min(e.$anchor.depth, e.$head.depth);
7443
7496
  if (n && r) {
@@ -7447,7 +7500,7 @@ function hn(e, t) {
7447
7500
  i = e.from, o = e.to;
7448
7501
  return { from: i, to: o };
7449
7502
  }
7450
- function $e(e, t, i = t) {
7503
+ function Xe(e, t, i = t) {
7451
7504
  t === i && (i += e.state.doc.resolve(t + 1).node().nodeSize);
7452
7505
  const o = e.domAtPos(t).node.cloneNode(!0), n = e.domAtPos(t).node, r = (u, p) => Array.prototype.indexOf.call(u.children, p), a = r(
7453
7506
  n,
@@ -7460,16 +7513,16 @@ function $e(e, t, i = t) {
7460
7513
  );
7461
7514
  for (let u = n.childElementCount - 1; u >= 0; u--)
7462
7515
  (u > s || u < a) && o.removeChild(o.children[u]);
7463
- kt(e.root), L = o;
7516
+ wt(e.root), A = o;
7464
7517
  const d = e.dom.className.split(" ").filter(
7465
7518
  (u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
7466
7519
  ).join(" ");
7467
- L.className = L.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(L) : e.root.body.appendChild(L);
7520
+ A.className = A.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(A) : e.root.body.appendChild(A);
7468
7521
  }
7469
- function kt(e) {
7470
- L !== void 0 && (e instanceof ShadowRoot ? e.removeChild(L) : e.body.removeChild(L), L = void 0);
7522
+ function wt(e) {
7523
+ A !== void 0 && (e instanceof ShadowRoot ? e.removeChild(A) : e.body.removeChild(A), A = void 0);
7471
7524
  }
7472
- function mn(e, t) {
7525
+ function _n(e, t) {
7473
7526
  if (!e.dataTransfer)
7474
7527
  return;
7475
7528
  const i = t.prosemirrorView, o = i.dom.getBoundingClientRect(), n = {
@@ -7480,30 +7533,30 @@ function mn(e, t) {
7480
7533
  let a;
7481
7534
  for (const l of r)
7482
7535
  if (i.dom.contains(l)) {
7483
- a = fe(l, i);
7536
+ a = me(l, i);
7484
7537
  break;
7485
7538
  }
7486
7539
  if (!a)
7487
7540
  return;
7488
- const s = pn(a.node, i);
7541
+ const s = gn(a.node, i);
7489
7542
  if (s != null) {
7490
- const l = i.state.selection, d = i.state.doc, { from: u, to: p } = hn(l, d), h = u <= s && s < p, m = l.$anchor.node() !== l.$head.node() || l instanceof F;
7543
+ const l = i.state.selection, d = i.state.doc, { from: u, to: p } = bn(l, d), h = u <= s && s < p, m = l.$anchor.node() !== l.$head.node() || l instanceof G;
7491
7544
  h && m ? (i.dispatch(
7492
- i.state.tr.setSelection(F.create(d, u, p))
7493
- ), $e(i, u, p)) : (i.dispatch(
7494
- i.state.tr.setSelection(se.create(i.state.doc, s))
7495
- ), $e(i, s));
7496
- const g = i.state.selection.content(), f = t.pmSchema, y = Me(f, t).serializeProseMirrorFragment(
7497
- g.content,
7545
+ i.state.tr.setSelection(G.create(d, u, p))
7546
+ ), Xe(i, u, p)) : (i.dispatch(
7547
+ i.state.tr.setSelection(le.create(i.state.doc, s))
7548
+ ), Xe(i, s));
7549
+ const f = i.state.selection.content(), g = t.pmSchema, v = Me(g, t).serializeProseMirrorFragment(
7550
+ f.content,
7498
7551
  {}
7499
- ), N = de(f, t).exportProseMirrorFragment(
7500
- g.content,
7552
+ ), y = de(g, t).exportProseMirrorFragment(
7553
+ f.content,
7501
7554
  {}
7502
- ), J = Ie(N);
7503
- e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", y), e.dataTransfer.setData("text/html", N), e.dataTransfer.setData("text/plain", J), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(L, 0, 0), i.dragging = { slice: g, move: !0 };
7555
+ ), S = Ie(y);
7556
+ e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", v), e.dataTransfer.setData("text/html", y), e.dataTransfer.setData("text/plain", S), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(A, 0, 0), i.dragging = { slice: f, move: !0 };
7504
7557
  }
7505
7558
  }
7506
- class fn {
7559
+ class kn {
7507
7560
  constructor(t, i, o) {
7508
7561
  c(this, "state");
7509
7562
  c(this, "emitUpdate");
@@ -7520,7 +7573,7 @@ class fn {
7520
7573
  c(this, "menuFrozen", !1);
7521
7574
  c(this, "updateState", () => {
7522
7575
  var a, s, l, d;
7523
- if (this.menuFrozen || !this.mousePos)
7576
+ if (this.menuFrozen || !this.mousePos || !this.pmView.dom.firstChild)
7524
7577
  return;
7525
7578
  const t = this.pmView.dom.firstChild.getBoundingClientRect();
7526
7579
  this.horizontalPosAnchor = t.x;
@@ -7535,7 +7588,7 @@ class fn {
7535
7588
  let n;
7536
7589
  for (const u of o)
7537
7590
  if (this.pmView.dom.contains(u)) {
7538
- n = fe(u, this.pmView);
7591
+ n = me(u, this.pmView);
7539
7592
  break;
7540
7593
  }
7541
7594
  if (!n || !this.editor.isEditable) {
@@ -7600,7 +7653,7 @@ class fn {
7600
7653
  left: t.clientX,
7601
7654
  top: t.clientY
7602
7655
  });
7603
- if (!i || i.inside === -1) {
7656
+ if (!i || i.inside === -1 && this.pmView.dom.firstChild) {
7604
7657
  const o = new Event("dragover", t), n = this.pmView.dom.firstChild.getBoundingClientRect();
7605
7658
  o.clientX = n.left + n.width / 2, o.clientY = t.clientY, o.dataTransfer = t.dataTransfer, o.preventDefault = () => t.preventDefault(), o.synthetic = !0, this.pmView.dom.dispatchEvent(o);
7606
7659
  }
@@ -7630,14 +7683,14 @@ class fn {
7630
7683
  this.updateState(), this.needUpdate && (this.emitUpdate(this.state), this.needUpdate = !1);
7631
7684
  });
7632
7685
  c(this, "onScroll", () => {
7633
- var t;
7634
- if ((t = this.state) != null && t.show) {
7635
- const o = this.hoveredBlock.firstChild.getBoundingClientRect();
7686
+ var t, i;
7687
+ if ((t = this.state) != null && t.show && ((i = this.hoveredBlock) != null && i.firstChild)) {
7688
+ const n = this.hoveredBlock.firstChild.getBoundingClientRect();
7636
7689
  this.state.referencePos = new DOMRect(
7637
- this.horizontalPosAnchoredAtRoot ? this.horizontalPosAnchor : o.x,
7638
- o.y,
7639
- o.width,
7640
- o.height
7690
+ this.horizontalPosAnchoredAtRoot ? this.horizontalPosAnchor : n.x,
7691
+ n.y,
7692
+ n.width,
7693
+ n.height
7641
7694
  ), this.emitUpdate(this.state);
7642
7695
  }
7643
7696
  });
@@ -7645,14 +7698,14 @@ class fn {
7645
7698
  if (!this.state)
7646
7699
  throw new Error("Attempting to update uninitialized side menu");
7647
7700
  o(this.state);
7648
- }, this.horizontalPosAnchoredAtRoot = !0, this.horizontalPosAnchor = this.pmView.dom.firstChild.getBoundingClientRect().x, this.pmView.root.addEventListener(
7701
+ }, this.horizontalPosAnchoredAtRoot = !0, this.pmView.dom.firstChild && (this.horizontalPosAnchor = this.pmView.dom.firstChild.getBoundingClientRect().x), this.pmView.root.addEventListener(
7649
7702
  "drop",
7650
7703
  this.onDrop,
7651
7704
  !0
7652
7705
  ), this.pmView.root.addEventListener(
7653
7706
  "dragover",
7654
7707
  this.onDragOver
7655
- ), oe(), this.pmView.dom.addEventListener("dragstart", this.onDragStart), this.pmView.root.addEventListener(
7708
+ ), ie(), this.pmView.dom.addEventListener("dragstart", this.onDragStart), this.pmView.root.addEventListener(
7656
7709
  "mousemove",
7657
7710
  this.onMouseMove,
7658
7711
  !0
@@ -7694,8 +7747,9 @@ class fn {
7694
7747
  );
7695
7748
  }
7696
7749
  addBlock() {
7697
- var l;
7698
- (l = this.state) != null && l.show && (this.state.show = !1, this.emitUpdate(this.state));
7750
+ var l, d;
7751
+ if ((l = this.state) != null && l.show && (this.state.show = !1, this.emitUpdate(this.state)), !((d = this.hoveredBlock) != null && d.firstChild))
7752
+ return;
7699
7753
  const i = this.hoveredBlock.firstChild.getBoundingClientRect(), o = this.pmView.posAtCoords({
7700
7754
  left: i.left + i.width / 2,
7701
7755
  top: i.top + i.height / 2
@@ -7710,15 +7764,15 @@ class fn {
7710
7764
  return;
7711
7765
  const { contentNode: r, startPos: a, endPos: s } = n;
7712
7766
  if (r.type.spec.content !== "inline*" || r.textContent.length !== 0) {
7713
- const d = s + 1, u = d + 2;
7714
- this.editor._tiptapEditor.chain().BNCreateBlock(d).setTextSelection(u).run();
7767
+ const u = s + 1, p = u + 2;
7768
+ this.editor._tiptapEditor.chain().BNCreateBlock(u).setTextSelection(p).run();
7715
7769
  } else
7716
7770
  this.editor._tiptapEditor.commands.setTextSelection(a + 1);
7717
7771
  this.editor.openSuggestionMenu("/");
7718
7772
  }
7719
7773
  }
7720
- const gn = new M("SideMenuPlugin");
7721
- class bn extends Z {
7774
+ const yn = new L("SideMenuPlugin");
7775
+ class wn extends Z {
7722
7776
  constructor(i) {
7723
7777
  super();
7724
7778
  c(this, "view");
@@ -7732,12 +7786,12 @@ class bn extends Z {
7732
7786
  * Handles drag & drop events for blocks.
7733
7787
  */
7734
7788
  c(this, "blockDragStart", (i) => {
7735
- this.view.isDragging = !0, mn(i, this.editor);
7789
+ this.view.isDragging = !0, _n(i, this.editor);
7736
7790
  });
7737
7791
  /**
7738
7792
  * Handles drag & drop events for blocks.
7739
7793
  */
7740
- c(this, "blockDragEnd", () => kt(this.editor.prosemirrorView.root));
7794
+ c(this, "blockDragEnd", () => wt(this.editor.prosemirrorView.root));
7741
7795
  /**
7742
7796
  * Freezes the side menu. When frozen, the side menu will stay
7743
7797
  * attached to the same block regardless of which block is hovered by the
@@ -7752,9 +7806,9 @@ class bn extends Z {
7752
7806
  c(this, "unfreezeMenu", () => {
7753
7807
  this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
7754
7808
  });
7755
- this.editor = i, this.plugin = new w({
7756
- key: gn,
7757
- view: (o) => (this.view = new fn(i, o, (n) => {
7809
+ this.editor = i, this.plugin = new x({
7810
+ key: yn,
7811
+ view: (o) => (this.view = new kn(i, o, (n) => {
7758
7812
  this.emit("update", n);
7759
7813
  }), this.view)
7760
7814
  });
@@ -7763,8 +7817,8 @@ class bn extends Z {
7763
7817
  return this.on("update", i);
7764
7818
  }
7765
7819
  }
7766
- const _n = zt((e) => e.type.name === "blockContainer");
7767
- class kn {
7820
+ const vn = Ot((e) => e.type.name === "blockContainer");
7821
+ class xn {
7768
7822
  constructor(t, i) {
7769
7823
  c(this, "state");
7770
7824
  c(this, "emitUpdate");
@@ -7776,13 +7830,15 @@ class kn {
7776
7830
  const o = (i = this.rootEl) == null ? void 0 : i.querySelector(
7777
7831
  `[data-decoration-id="${this.pluginState.decorationId}"]`
7778
7832
  );
7833
+ if (!o)
7834
+ return;
7779
7835
  this.state.referencePos = o.getBoundingClientRect(), this.emitUpdate(this.pluginState.triggerCharacter);
7780
7836
  }
7781
7837
  });
7782
7838
  c(this, "closeMenu", () => {
7783
7839
  this.editor.dispatch(
7784
7840
  this.editor._tiptapEditor.view.state.tr.setMeta(
7785
- G,
7841
+ W,
7786
7842
  null
7787
7843
  )
7788
7844
  );
@@ -7805,7 +7861,7 @@ class kn {
7805
7861
  }
7806
7862
  update(t, i) {
7807
7863
  var d;
7808
- const o = G.getState(i), n = G.getState(
7864
+ const o = W.getState(i), n = W.getState(
7809
7865
  t.state
7810
7866
  ), r = o === void 0 && n !== void 0, a = o !== void 0 && n === void 0;
7811
7867
  if (!r && !(o !== void 0 && n !== void 0) && !a)
@@ -7817,7 +7873,7 @@ class kn {
7817
7873
  const l = (d = this.rootEl) == null ? void 0 : d.querySelector(
7818
7874
  `[data-decoration-id="${this.pluginState.decorationId}"]`
7819
7875
  );
7820
- this.editor.isEditable && (this.state = {
7876
+ this.editor.isEditable && l && (this.state = {
7821
7877
  show: !0,
7822
7878
  referencePos: l.getBoundingClientRect(),
7823
7879
  query: this.pluginState.query
@@ -7828,8 +7884,8 @@ class kn {
7828
7884
  (t = this.rootEl) == null || t.removeEventListener("scroll", this.handleScroll, !0);
7829
7885
  }
7830
7886
  }
7831
- const G = new M("SuggestionMenuPlugin");
7832
- class yn extends Z {
7887
+ const W = new L("SuggestionMenuPlugin");
7888
+ class En extends Z {
7833
7889
  constructor(i) {
7834
7890
  super();
7835
7891
  c(this, "view");
@@ -7847,9 +7903,9 @@ class yn extends Z {
7847
7903
  c(this, "closeMenu", () => this.view.closeMenu());
7848
7904
  c(this, "clearQuery", () => this.view.clearQuery());
7849
7905
  const o = this.triggerCharacters;
7850
- this.plugin = new w({
7851
- key: G,
7852
- view: () => (this.view = new kn(
7906
+ this.plugin = new x({
7907
+ key: W,
7908
+ view: () => (this.view = new xn(
7853
7909
  i,
7854
7910
  (n, r) => {
7855
7911
  this.emit(`update ${n}`, r);
@@ -7863,7 +7919,7 @@ class yn extends Z {
7863
7919
  apply(n, r, a, s) {
7864
7920
  if (n.getMeta("orderedListIndexing") !== void 0)
7865
7921
  return r;
7866
- const l = n.getMeta(G);
7922
+ const l = n.getMeta(W);
7867
7923
  if (typeof l == "object" && l !== null && r === void 0)
7868
7924
  return {
7869
7925
  triggerCharacter: l.triggerCharacter,
@@ -7895,7 +7951,7 @@ class yn extends Z {
7895
7951
  handleTextInput(n, r, a, s) {
7896
7952
  const l = this.getState(n.state);
7897
7953
  return o.includes(s) && l === void 0 ? (n.dispatch(
7898
- n.state.tr.insertText(s).scrollIntoView().setMeta(G, {
7954
+ n.state.tr.insertText(s).scrollIntoView().setMeta(W, {
7899
7955
  triggerCharacter: s
7900
7956
  })
7901
7957
  ), !0) : !1;
@@ -7906,10 +7962,10 @@ class yn extends Z {
7906
7962
  if (r === void 0)
7907
7963
  return null;
7908
7964
  if (!r.deleteTriggerCharacter) {
7909
- const a = _n(n.selection);
7965
+ const a = vn(n.selection);
7910
7966
  if (a)
7911
7967
  return K.create(n.doc, [
7912
- W.node(
7968
+ $.node(
7913
7969
  a.pos,
7914
7970
  a.pos + a.node.nodeSize,
7915
7971
  {
@@ -7921,7 +7977,7 @@ class yn extends Z {
7921
7977
  ]);
7922
7978
  }
7923
7979
  return K.create(n.doc, [
7924
- W.inline(
7980
+ $.inline(
7925
7981
  r.queryStartPos - r.triggerCharacter.length,
7926
7982
  r.queryStartPos,
7927
7983
  {
@@ -7943,32 +7999,32 @@ class yn extends Z {
7943
7999
  return ((o = (i = this.view) == null ? void 0 : i.state) == null ? void 0 : o.show) || !1;
7944
8000
  }
7945
8001
  }
7946
- function Hr(e, t) {
8002
+ function zr(e, t) {
7947
8003
  e.suggestionMenus.addTriggerCharacter(t);
7948
8004
  }
7949
- let v;
7950
- function qe(e) {
7951
- v || (v = document.createElement("div"), v.innerHTML = "_", v.style.opacity = "0", v.style.height = "1px", v.style.width = "1px", e instanceof Document ? e.body.appendChild(v) : e.appendChild(v));
8005
+ let E;
8006
+ function Ze(e) {
8007
+ E || (E = document.createElement("div"), E.innerHTML = "_", E.style.opacity = "0", E.style.height = "1px", E.style.width = "1px", e instanceof Document ? e.body.appendChild(E) : e.appendChild(E));
7952
8008
  }
7953
- function wn(e) {
7954
- v && (e instanceof Document ? e.body.removeChild(v) : e.removeChild(v), v = void 0);
8009
+ function Cn(e) {
8010
+ E && (e instanceof Document ? e.body.removeChild(E) : e.removeChild(E), E = void 0);
7955
8011
  }
7956
8012
  function re(e) {
7957
8013
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
7958
8014
  }
7959
- function vn(e) {
8015
+ function Sn(e) {
7960
8016
  for (; e && e.nodeName !== "TD" && e.nodeName !== "TH"; )
7961
8017
  e = e.classList && e.classList.contains("ProseMirror") ? null : e.parentNode;
7962
8018
  return e;
7963
8019
  }
7964
- function xn(e, t) {
8020
+ function Mn(e, t) {
7965
8021
  e.forEach((i) => {
7966
8022
  const o = t.querySelectorAll(i);
7967
8023
  for (let n = 0; n < o.length; n++)
7968
8024
  o[n].style.visibility = "hidden";
7969
8025
  });
7970
8026
  }
7971
- class En {
8027
+ class Tn {
7972
8028
  constructor(t, i, o) {
7973
8029
  c(this, "state");
7974
8030
  c(this, "emitUpdate");
@@ -7977,31 +8033,34 @@ class En {
7977
8033
  c(this, "menuFrozen", !1);
7978
8034
  c(this, "prevWasEditable", null);
7979
8035
  c(this, "mouseMoveHandler", (t) => {
7980
- var d;
8036
+ var d, u, p;
7981
8037
  if (this.menuFrozen)
7982
8038
  return;
7983
- const i = vn(t.target);
8039
+ const i = Sn(t.target);
7984
8040
  if (!i || !this.editor.isEditable) {
7985
8041
  (d = this.state) != null && d.show && (this.state.show = !1, this.emitUpdate());
7986
8042
  return;
7987
8043
  }
7988
- const o = re(i), n = re(i.parentElement), r = i.getBoundingClientRect(), a = i.parentElement.parentElement.getBoundingClientRect(), s = fe(i, this.pmView);
8044
+ const o = re(i), n = re(i.parentElement), r = i.getBoundingClientRect(), a = (p = (u = i.parentElement) == null ? void 0 : u.parentElement) == null ? void 0 : p.getBoundingClientRect();
8045
+ if (!a)
8046
+ return;
8047
+ const s = me(i, this.pmView);
7989
8048
  if (!s)
7990
8049
  return;
7991
8050
  let l;
7992
- if (this.editor._tiptapEditor.state.doc.descendants((u, p) => {
8051
+ if (this.editor._tiptapEditor.state.doc.descendants((h, m) => {
7993
8052
  if (typeof l < "u")
7994
8053
  return !1;
7995
- if (u.type.name !== "blockContainer" || u.attrs.id !== s.id)
8054
+ if (h.type.name !== "blockContainer" || h.attrs.id !== s.id)
7996
8055
  return !0;
7997
- const h = x(
7998
- u,
8056
+ const f = C(
8057
+ h,
7999
8058
  this.editor.schema.blockSchema,
8000
8059
  this.editor.schema.inlineContentSchema,
8001
8060
  this.editor.schema.styleSchema,
8002
8061
  this.editor.blockCache
8003
8062
  );
8004
- return Ro("table", h, this.editor) && (this.tablePos = p + 1, l = h), !1;
8063
+ return Go("table", f, this.editor) && (this.tablePos = m + 1, l = f), !1;
8005
8064
  }), !!l && (this.tableId = s.id, !(this.state !== void 0 && this.state.show && this.tableId === s.id && this.state.rowIndex === n && this.state.colIndex === o)))
8006
8065
  return this.state = {
8007
8066
  show: !0,
@@ -8017,7 +8076,7 @@ class En {
8017
8076
  var h;
8018
8077
  if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
8019
8078
  return;
8020
- t.preventDefault(), t.dataTransfer.dropEffect = "move", xn(
8079
+ t.preventDefault(), t.dataTransfer.dropEffect = "move", Mn(
8021
8080
  [
8022
8081
  "column-resize-handle",
8023
8082
  "prosemirror-dropcursor-block",
@@ -8047,7 +8106,7 @@ class En {
8047
8106
  (this.state.rowIndex !== a || this.state.colIndex !== s) && (this.state.rowIndex = a, this.state.colIndex = s, this.state.referencePosCell = n.getBoundingClientRect(), r = !0);
8048
8107
  const p = this.state.draggingState.draggedCellOrientation === "row" ? i.top : i.left;
8049
8108
  this.state.draggingState.mousePos !== p && (this.state.draggingState.mousePos = p, r = !0), r && this.emitUpdate(), u && this.editor.dispatch(
8050
- this.pmView.state.tr.setMeta(ee, !0)
8109
+ this.pmView.state.tr.setMeta(Q, !0)
8051
8110
  );
8052
8111
  });
8053
8112
  c(this, "dropHandler", (t) => {
@@ -8104,8 +8163,8 @@ class En {
8104
8163
  ), this.pmView.root.removeEventListener("scroll", this.scrollHandler, !0);
8105
8164
  }
8106
8165
  }
8107
- const ee = new M("TableHandlesPlugin");
8108
- class Cn extends Z {
8166
+ const Q = new L("TableHandlesPlugin");
8167
+ class Bn extends Z {
8109
8168
  constructor(i) {
8110
8169
  super();
8111
8170
  c(this, "view");
@@ -8124,13 +8183,13 @@ class Cn extends Z {
8124
8183
  originalIndex: this.view.state.colIndex,
8125
8184
  mousePos: i.clientX
8126
8185
  }, this.view.emitUpdate(), this.editor.dispatch(
8127
- this.editor._tiptapEditor.state.tr.setMeta(ee, {
8186
+ this.editor._tiptapEditor.state.tr.setMeta(Q, {
8128
8187
  draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
8129
8188
  originalIndex: this.view.state.colIndex,
8130
8189
  newIndex: this.view.state.colIndex,
8131
8190
  tablePos: this.view.tablePos
8132
8191
  })
8133
- ), qe(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(v, 0, 0), i.dataTransfer.effectAllowed = "move";
8192
+ ), Ze(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "move";
8134
8193
  });
8135
8194
  /**
8136
8195
  * Callback that should be set on the `dragStart` event for whichever element
@@ -8146,13 +8205,13 @@ class Cn extends Z {
8146
8205
  originalIndex: this.view.state.rowIndex,
8147
8206
  mousePos: i.clientY
8148
8207
  }, this.view.emitUpdate(), this.editor.dispatch(
8149
- this.editor._tiptapEditor.state.tr.setMeta(ee, {
8208
+ this.editor._tiptapEditor.state.tr.setMeta(Q, {
8150
8209
  draggedCellOrientation: this.view.state.draggingState.draggedCellOrientation,
8151
8210
  originalIndex: this.view.state.rowIndex,
8152
8211
  newIndex: this.view.state.rowIndex,
8153
8212
  tablePos: this.view.tablePos
8154
8213
  })
8155
- ), qe(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(v, 0, 0), i.dataTransfer.effectAllowed = "copyMove";
8214
+ ), Ze(this.editor._tiptapEditor.view.root), i.dataTransfer.setDragImage(E, 0, 0), i.dataTransfer.effectAllowed = "copyMove";
8156
8215
  });
8157
8216
  /**
8158
8217
  * Callback that should be set on the `dragEnd` event for both the element
@@ -8164,8 +8223,8 @@ class Cn extends Z {
8164
8223
  "Attempted to drag table row, but no table block was hovered prior."
8165
8224
  );
8166
8225
  this.view.state.draggingState = void 0, this.view.emitUpdate(), this.editor.dispatch(
8167
- this.editor._tiptapEditor.state.tr.setMeta(ee, null)
8168
- ), wn(this.editor._tiptapEditor.view.root);
8226
+ this.editor._tiptapEditor.state.tr.setMeta(Q, null)
8227
+ ), Cn(this.editor._tiptapEditor.view.root);
8169
8228
  });
8170
8229
  /**
8171
8230
  * Freezes the drag handles. When frozen, they will stay attached to the same
@@ -8181,9 +8240,9 @@ class Cn extends Z {
8181
8240
  c(this, "unfreezeHandles", () => {
8182
8241
  this.view.menuFrozen = !1;
8183
8242
  });
8184
- this.editor = i, this.plugin = new w({
8185
- key: ee,
8186
- view: (o) => (this.view = new En(i, o, (n) => {
8243
+ this.editor = i, this.plugin = new x({
8244
+ key: Q,
8245
+ view: (o) => (this.view = new Tn(i, o, (n) => {
8187
8246
  this.emit("update", n);
8188
8247
  }), this.view),
8189
8248
  // We use decorations to render the drop cursor when dragging a table row
@@ -8206,9 +8265,9 @@ class Cn extends Z {
8206
8265
  ), h = p.node(), m = p.pos + (n > this.view.state.draggingState.originalIndex ? h.nodeSize - 2 : 0);
8207
8266
  r.push(
8208
8267
  // The widget is a small bar which spans the width of the cell.
8209
- W.widget(m, () => {
8210
- const g = document.createElement("div");
8211
- return g.className = "bn-table-drop-cursor", g.style.left = "0", g.style.right = "0", n > this.view.state.draggingState.originalIndex ? g.style.bottom = "-2px" : g.style.top = "-3px", g.style.height = "4px", g;
8268
+ $.widget(m, () => {
8269
+ const f = document.createElement("div");
8270
+ return f.className = "bn-table-drop-cursor", f.style.left = "0", f.style.right = "0", n > this.view.state.draggingState.originalIndex ? f.style.bottom = "-2px" : f.style.top = "-3px", f.style.height = "4px", f;
8212
8271
  })
8213
8272
  );
8214
8273
  }
@@ -8221,7 +8280,7 @@ class Cn extends Z {
8221
8280
  ), p = u.node(), h = u.pos + (n > this.view.state.draggingState.originalIndex ? p.nodeSize - 2 : 0);
8222
8281
  r.push(
8223
8282
  // The widget is a small bar which spans the height of the cell.
8224
- W.widget(h, () => {
8283
+ $.widget(h, () => {
8225
8284
  const m = document.createElement("div");
8226
8285
  return m.className = "bn-table-drop-cursor", m.style.top = "0", m.style.bottom = "0", n > this.view.state.draggingState.originalIndex ? m.style.right = "-2px" : m.style.left = "-3px", m.style.width = "4px", m;
8227
8286
  })
@@ -8236,15 +8295,15 @@ class Cn extends Z {
8236
8295
  return this.on("update", i);
8237
8296
  }
8238
8297
  }
8239
- async function Xe(e, t) {
8240
- const i = e.state.selection.content().content, n = (await Me(
8298
+ async function vt(e, t) {
8299
+ const i = e.state.selection.content().content, n = Me(
8241
8300
  e.state.schema,
8242
8301
  t
8243
- )).serializeProseMirrorFragment(
8302
+ ).serializeProseMirrorFragment(
8244
8303
  i,
8245
8304
  {}
8246
8305
  );
8247
- await oe();
8306
+ await ie();
8248
8307
  const a = de(
8249
8308
  e.state.schema,
8250
8309
  t
@@ -8254,24 +8313,27 @@ async function Xe(e, t) {
8254
8313
  ), s = await Ie(a);
8255
8314
  return { internalHTML: n, externalHTML: a, plainText: s };
8256
8315
  }
8257
- const Sn = (e) => T.create({
8316
+ const Je = (e, t, i) => {
8317
+ i.preventDefault(), i.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
8318
+ e._tiptapEditor.state.tr.setSelection(
8319
+ new le(t.state.doc.resolve(t.state.selection.from - 1))
8320
+ )
8321
+ ), (async () => {
8322
+ const { internalHTML: o, externalHTML: n, plainText: r } = await vt(t, e);
8323
+ i.clipboardData.setData("blocknote/html", o), i.clipboardData.setData("text/html", n), i.clipboardData.setData("text/plain", r);
8324
+ })();
8325
+ }, Ln = (e) => I.create({
8258
8326
  name: "copyToClipboard",
8259
8327
  addProseMirrorPlugins() {
8260
8328
  return [
8261
- new w({
8329
+ new x({
8262
8330
  props: {
8263
8331
  handleDOMEvents: {
8264
8332
  copy(t, i) {
8265
- return i.preventDefault(), i.clipboardData.clearData(), "node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent" && e.dispatch(
8266
- e._tiptapEditor.state.tr.setSelection(
8267
- new se(
8268
- t.state.doc.resolve(t.state.selection.from - 1)
8269
- )
8270
- )
8271
- ), (async () => {
8272
- const { internalHTML: o, externalHTML: n, plainText: r } = await Xe(t, e);
8273
- i.clipboardData.setData("blocknote/html", o), i.clipboardData.setData("text/html", n), i.clipboardData.setData("text/plain", r);
8274
- })(), !0;
8333
+ return Je(e, t, i), !0;
8334
+ },
8335
+ cut(t, i) {
8336
+ return Je(e, t, i), t.dispatch(t.state.tr.deleteSelection()), !0;
8275
8337
  },
8276
8338
  // This is for the use-case in which only a block without content
8277
8339
  // is selected, e.g. an image block, and dragged (not using the
@@ -8280,12 +8342,12 @@ const Sn = (e) => T.create({
8280
8342
  if ("node" in t.state.selection && t.state.selection.node.type.spec.group === "blockContent")
8281
8343
  return e.dispatch(
8282
8344
  e._tiptapEditor.state.tr.setSelection(
8283
- new se(
8345
+ new le(
8284
8346
  t.state.doc.resolve(t.state.selection.from - 1)
8285
8347
  )
8286
8348
  )
8287
8349
  ), i.preventDefault(), i.dataTransfer.clearData(), (async () => {
8288
- const { internalHTML: o, externalHTML: n, plainText: r } = await Xe(t, e);
8350
+ const { internalHTML: o, externalHTML: n, plainText: r } = await vt(t, e);
8289
8351
  i.dataTransfer.setData("blocknote/html", o), i.dataTransfer.setData("text/html", n), i.dataTransfer.setData("text/plain", r);
8290
8352
  })(), !0;
8291
8353
  }
@@ -8300,12 +8362,12 @@ const Sn = (e) => T.create({
8300
8362
  "text/html",
8301
8363
  "text/plain"
8302
8364
  ];
8303
- function Mn(e, t) {
8365
+ function In(e, t) {
8304
8366
  if (!e.startsWith(".") || !t.startsWith("."))
8305
8367
  throw new Error("The strings provided are not valid file extensions.");
8306
8368
  return e === t;
8307
8369
  }
8308
- function Tn(e, t) {
8370
+ function An(e, t) {
8309
8371
  const i = e.split("/"), o = t.split("/");
8310
8372
  if (i.length !== 2)
8311
8373
  throw new Error(`The string ${e} is not a valid MIME type.`);
@@ -8313,7 +8375,7 @@ function Tn(e, t) {
8313
8375
  throw new Error(`The string ${t} is not a valid MIME type.`);
8314
8376
  return i[1] === "*" || o[1] === "*" ? i[0] === o[0] : (i[0] === "*" || o[0] === "*" || i[0] === o[0]) && i[1] === o[1];
8315
8377
  }
8316
- async function yt(e, t) {
8378
+ async function xt(e, t) {
8317
8379
  if (!t.uploadFile)
8318
8380
  return;
8319
8381
  const i = "dataTransfer" in e ? e.dataTransfer : e.clipboardData;
@@ -8339,7 +8401,7 @@ async function yt(e, t) {
8339
8401
  for (const d of r)
8340
8402
  for (const u of d.fileBlockAccept || []) {
8341
8403
  const p = u.startsWith("."), h = n[a].getAsFile();
8342
- if (h && (!p && h.type && Tn(n[a].type, u) || p && Mn(
8404
+ if (h && (!p && h.type && An(n[a].type, u) || p && In(
8343
8405
  "." + h.name.split(".").pop(),
8344
8406
  u
8345
8407
  ))) {
@@ -8349,85 +8411,98 @@ async function yt(e, t) {
8349
8411
  }
8350
8412
  const l = n[a].getAsFile();
8351
8413
  if (l) {
8352
- const d = await t.uploadFile(l), u = typeof d == "string" ? {
8414
+ const d = {
8353
8415
  type: s,
8354
8416
  props: {
8355
- name: l.name,
8356
- url: d
8417
+ name: l.name
8357
8418
  }
8358
- } : { type: s, ...d };
8359
- if (e.type === "paste" && t.insertBlocks(
8360
- [u],
8361
- t.getTextCursorPosition().block,
8362
- "after"
8363
- ), e.type === "drop") {
8364
- const p = {
8419
+ };
8420
+ let u;
8421
+ if (e.type === "paste")
8422
+ u = t.insertBlocks(
8423
+ [d],
8424
+ t.getTextCursorPosition().block,
8425
+ "after"
8426
+ )[0].id;
8427
+ else if (e.type === "drop") {
8428
+ const m = {
8365
8429
  left: e.clientX,
8366
8430
  top: e.clientY
8367
- }, h = t._tiptapEditor.view.posAtCoords(p);
8368
- if (!h)
8431
+ }, f = t._tiptapEditor.view.posAtCoords(m);
8432
+ if (!f)
8369
8433
  return;
8370
- const m = _(
8434
+ const g = _(
8371
8435
  t._tiptapEditor.state.doc,
8372
- h.pos
8436
+ f.pos
8373
8437
  );
8374
- t.insertBlocks([u], m.id, "after");
8375
- }
8438
+ u = t.insertBlocks(
8439
+ [d],
8440
+ g.id,
8441
+ "after"
8442
+ )[0].id;
8443
+ } else
8444
+ return;
8445
+ const p = await t.uploadFile(l, u), h = typeof p == "string" ? {
8446
+ props: {
8447
+ url: p
8448
+ }
8449
+ } : { ...p };
8450
+ t.updateBlock(u, h);
8376
8451
  }
8377
8452
  }
8378
8453
  }
8379
- const Bn = (e) => T.create({
8380
- name: "pasteFromClipboard",
8454
+ const Nn = (e) => I.create({
8455
+ name: "dropFile",
8381
8456
  addProseMirrorPlugins() {
8382
8457
  return [
8383
- new w({
8458
+ new x({
8384
8459
  props: {
8385
8460
  handleDOMEvents: {
8386
- paste(t, i) {
8387
- if (i.preventDefault(), !e.isEditable)
8461
+ drop(t, i) {
8462
+ if (!e.isEditable)
8388
8463
  return;
8389
8464
  let o = null;
8390
- for (const r of Ae)
8391
- if (i.clipboardData.types.includes(r)) {
8392
- o = r;
8465
+ for (const n of Ae)
8466
+ if (i.dataTransfer.types.includes(n)) {
8467
+ o = n;
8393
8468
  break;
8394
8469
  }
8395
- if (o === null)
8396
- return !0;
8397
- if (o === "Files")
8398
- return yt(i, e), !0;
8399
- let n = i.clipboardData.getData(o);
8400
- return o === "text/html" && (n = bt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
8470
+ return o === null ? !0 : o === "Files" ? (xt(i, e), !0) : !1;
8401
8471
  }
8402
8472
  }
8403
8473
  }
8404
8474
  })
8405
8475
  ];
8406
8476
  }
8407
- }), Ln = (e) => T.create({
8408
- name: "dropFile",
8477
+ }), Pn = (e) => I.create({
8478
+ name: "pasteFromClipboard",
8409
8479
  addProseMirrorPlugins() {
8410
8480
  return [
8411
- new w({
8481
+ new x({
8412
8482
  props: {
8413
8483
  handleDOMEvents: {
8414
- drop(t, i) {
8415
- if (!e.isEditable)
8484
+ paste(t, i) {
8485
+ if (i.preventDefault(), !e.isEditable)
8416
8486
  return;
8417
8487
  let o = null;
8418
- for (const n of Ae)
8419
- if (i.dataTransfer.types.includes(n)) {
8420
- o = n;
8488
+ for (const r of Ae)
8489
+ if (i.clipboardData.types.includes(r)) {
8490
+ o = r;
8421
8491
  break;
8422
8492
  }
8423
- return o === null ? !0 : o === "Files" ? (yt(i, e), !0) : !1;
8493
+ if (o === null)
8494
+ return !0;
8495
+ if (o === "Files")
8496
+ return xt(i, e), !0;
8497
+ let n = i.clipboardData.getData(o);
8498
+ return o === "text/html" && (n = kt(n.trim()).innerHTML), e._tiptapEditor.view.pasteHTML(n), !0;
8424
8499
  }
8425
8500
  }
8426
8501
  }
8427
8502
  })
8428
8503
  ];
8429
8504
  }
8430
- }), In = T.create({
8505
+ }), Hn = I.create({
8431
8506
  name: "blockBackgroundColor",
8432
8507
  addGlobalAttributes() {
8433
8508
  return [
@@ -8435,9 +8510,9 @@ const Bn = (e) => T.create({
8435
8510
  types: ["blockContainer"],
8436
8511
  attributes: {
8437
8512
  backgroundColor: {
8438
- default: k.backgroundColor.default,
8439
- parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : k.backgroundColor.default,
8440
- renderHTML: (e) => e.backgroundColor === k.backgroundColor.default ? {} : {
8513
+ default: w.backgroundColor.default,
8514
+ parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : w.backgroundColor.default,
8515
+ renderHTML: (e) => e.backgroundColor === w.backgroundColor.default ? {} : {
8441
8516
  "data-background-color": e.backgroundColor
8442
8517
  }
8443
8518
  }
@@ -8445,7 +8520,7 @@ const Bn = (e) => T.create({
8445
8520
  }
8446
8521
  ];
8447
8522
  }
8448
- }), An = T.create({
8523
+ }), Un = I.create({
8449
8524
  name: "textAlignment",
8450
8525
  addGlobalAttributes() {
8451
8526
  return [
@@ -8471,7 +8546,7 @@ const Bn = (e) => T.create({
8471
8546
  }
8472
8547
  ];
8473
8548
  }
8474
- }), Nn = T.create({
8549
+ }), Dn = I.create({
8475
8550
  name: "blockTextColor",
8476
8551
  addGlobalAttributes() {
8477
8552
  return [
@@ -8479,9 +8554,9 @@ const Bn = (e) => T.create({
8479
8554
  types: ["blockContainer"],
8480
8555
  attributes: {
8481
8556
  textColor: {
8482
- default: k.textColor.default,
8483
- parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : k.textColor.default,
8484
- renderHTML: (e) => e.textColor === k.textColor.default ? {} : {
8557
+ default: w.textColor.default,
8558
+ parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : w.textColor.default,
8559
+ renderHTML: (e) => e.textColor === w.textColor.default ? {} : {
8485
8560
  "data-text-color": e.textColor
8486
8561
  }
8487
8562
  }
@@ -8489,12 +8564,12 @@ const Bn = (e) => T.create({
8489
8564
  }
8490
8565
  ];
8491
8566
  }
8492
- }), Pn = T.create({
8567
+ }), jn = I.create({
8493
8568
  name: "trailingNode",
8494
8569
  addProseMirrorPlugins() {
8495
- const e = new M(this.name);
8570
+ const e = new L(this.name);
8496
8571
  return [
8497
- new w({
8572
+ new x({
8498
8573
  key: e,
8499
8574
  appendTransaction: (t, i, o) => {
8500
8575
  const { doc: n, tr: r, schema: a } = o, s = e.getState(o), l = n.content.size - 2, d = a.nodes.blockContainer, u = a.nodes.paragraph;
@@ -8524,8 +8599,8 @@ const Bn = (e) => T.create({
8524
8599
  })
8525
8600
  ];
8526
8601
  }
8527
- }), Hn = new M("non-editable-block"), Dn = () => new w({
8528
- key: Hn,
8602
+ }), zn = new L("non-editable-block"), Vn = () => new x({
8603
+ key: zn,
8529
8604
  props: {
8530
8605
  handleKeyDown: (e, t) => {
8531
8606
  if ("node" in e.state.selection) {
@@ -8540,7 +8615,7 @@ const Bn = (e) => T.create({
8540
8615
  e.state.tr.selection.$to.after(),
8541
8616
  e.state.schema.nodes.paragraph.create()
8542
8617
  ).setSelection(
8543
- new Q(
8618
+ new Y(
8544
8619
  i.doc.resolve(e.state.tr.selection.$to.after() + 1)
8545
8620
  )
8546
8621
  )
@@ -8550,99 +8625,13 @@ const Bn = (e) => T.create({
8550
8625
  return !1;
8551
8626
  }
8552
8627
  }
8553
- }), Ze = new M("previous-blocks"), Un = {
8554
- // Numbered List Items
8555
- index: "index",
8556
- // Headings
8557
- level: "level",
8558
- // All Blocks
8559
- type: "type",
8560
- depth: "depth",
8561
- "depth-change": "depth-change"
8562
- }, jn = () => {
8563
- let e;
8564
- return new w({
8565
- key: Ze,
8566
- view(t) {
8567
- return {
8568
- update: async (i, o) => {
8569
- var n;
8570
- ((n = this.key) == null ? void 0 : n.getState(i.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
8571
- i.dispatch(
8572
- i.state.tr.setMeta(Ze, { clearUpdate: !0 })
8573
- );
8574
- }, 0));
8575
- },
8576
- destroy: () => {
8577
- e && clearTimeout(e);
8578
- }
8579
- };
8580
- },
8581
- state: {
8582
- init() {
8583
- return {
8584
- // Block attributes, by block ID, from just before the previous transaction.
8585
- prevTransactionOldBlockAttrs: {},
8586
- // Block attributes, by block ID, from just before the current transaction.
8587
- currentTransactionOldBlockAttrs: {},
8588
- // Set of IDs of blocks whose attributes changed from the current transaction.
8589
- updatedBlocks: /* @__PURE__ */ new Set()
8590
- };
8591
- },
8592
- apply(t, i, o, n) {
8593
- if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || o.doc.eq(n.doc))
8594
- return i;
8595
- const r = {}, a = je(o.doc, (d) => d.attrs.id), s = new Map(
8596
- a.map((d) => [d.node.attrs.id, d])
8597
- ), l = je(n.doc, (d) => d.attrs.id);
8598
- for (const d of l) {
8599
- const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
8600
- if (u && p && h) {
8601
- const m = {
8602
- index: h.attrs.index,
8603
- level: h.attrs.level,
8604
- type: h.type.name,
8605
- depth: n.doc.resolve(d.pos).depth
8606
- };
8607
- let g = {
8608
- index: p.attrs.index,
8609
- level: p.attrs.level,
8610
- type: p.type.name,
8611
- depth: o.doc.resolve(u.pos).depth
8612
- };
8613
- r[d.node.attrs.id] = g, t.getMeta("numberedListIndexing") && (d.node.attrs.id in i.prevTransactionOldBlockAttrs && (g = i.prevTransactionOldBlockAttrs[d.node.attrs.id]), m.type === "numberedListItem" && (g.index = m.index)), i.currentTransactionOldBlockAttrs[d.node.attrs.id] = g, JSON.stringify(g) !== JSON.stringify(m) && (g["depth-change"] = g.depth - m.depth, i.updatedBlocks.add(d.node.attrs.id));
8614
- }
8615
- }
8616
- return i.prevTransactionOldBlockAttrs = r, i;
8617
- }
8618
- },
8619
- props: {
8620
- decorations(t) {
8621
- const i = this.getState(t);
8622
- if (i.updatedBlocks.size === 0)
8623
- return;
8624
- const o = [];
8625
- return t.doc.descendants((n, r) => {
8626
- if (!n.attrs.id || !i.updatedBlocks.has(n.attrs.id))
8627
- return;
8628
- const a = i.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
8629
- for (const [d, u] of Object.entries(a))
8630
- s["data-prev-" + Un[d]] = u || "none";
8631
- const l = W.node(r, r + n.nodeSize, {
8632
- ...s
8633
- });
8634
- o.push(l);
8635
- }), K.create(t.doc, o);
8636
- }
8637
- }
8638
- });
8639
- }, zn = {
8628
+ }), Rn = {
8640
8629
  blockColor: "data-block-color",
8641
8630
  blockStyle: "data-block-style",
8642
8631
  id: "data-id",
8643
8632
  depth: "data-depth",
8644
8633
  depthChange: "data-depth-change"
8645
- }, Rn = q.create({
8634
+ }, On = q.create({
8646
8635
  name: "blockContainer",
8647
8636
  group: "blockContainer",
8648
8637
  // A block always contains content, and optionally a blockGroup which contains nested blocks
@@ -8658,7 +8647,7 @@ const Bn = (e) => T.create({
8658
8647
  if (typeof e == "string")
8659
8648
  return !1;
8660
8649
  const t = {};
8661
- for (const [i, o] of Object.entries(zn))
8650
+ for (const [i, o] of Object.entries(Rn))
8662
8651
  e.getAttribute(o) && (t[i] = e.getAttribute(o));
8663
8652
  return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
8664
8653
  }
@@ -8675,7 +8664,7 @@ const Bn = (e) => T.create({
8675
8664
  ...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
8676
8665
  ...e
8677
8666
  }, o = document.createElement("div");
8678
- o.className = z("bn-block", i.class), o.setAttribute("data-node-type", this.name);
8667
+ o.className = R("bn-block", i.class), o.setAttribute("data-node-type", this.name);
8679
8668
  for (const [r, a] of Object.entries(i))
8680
8669
  r !== "class" && o.setAttribute(r, a);
8681
8670
  return t.appendChild(o), {
@@ -8709,7 +8698,7 @@ const Bn = (e) => T.create({
8709
8698
  const h = [];
8710
8699
  for (const m of t.children)
8711
8700
  h.push(
8712
- H(
8701
+ U(
8713
8702
  m,
8714
8703
  i.schema,
8715
8704
  this.options.editor.schema.styleSchema
@@ -8718,7 +8707,7 @@ const Bn = (e) => T.create({
8718
8707
  s.childCount === 2 ? i.tr.replace(
8719
8708
  r + l.nodeSize + 1,
8720
8709
  a - 1,
8721
- new j(I.from(h), 0, 0)
8710
+ new z(N.from(h), 0, 0)
8722
8711
  ) : i.tr.insert(
8723
8712
  r + l.nodeSize,
8724
8713
  i.schema.nodes.blockGroup.create({}, h)
@@ -8728,25 +8717,25 @@ const Bn = (e) => T.create({
8728
8717
  let p = "keep";
8729
8718
  if (t.content)
8730
8719
  if (typeof t.content == "string")
8731
- p = $(
8720
+ p = V(
8732
8721
  [t.content],
8733
8722
  i.schema,
8734
8723
  this.options.editor.schema.styleSchema
8735
8724
  );
8736
8725
  else if (Array.isArray(t.content))
8737
- p = $(
8726
+ p = V(
8738
8727
  t.content,
8739
8728
  i.schema,
8740
8729
  this.options.editor.schema.styleSchema
8741
8730
  );
8742
8731
  else if (t.content.type === "tableContent")
8743
- p = et(
8732
+ p = it(
8744
8733
  t.content,
8745
8734
  i.schema,
8746
8735
  this.options.editor.schema.styleSchema
8747
8736
  );
8748
8737
  else
8749
- throw new A(t.content.type);
8738
+ throw new P(t.content.type);
8750
8739
  else {
8751
8740
  const h = i.schema.nodes[d].spec.content, m = i.schema.nodes[u].spec.content;
8752
8741
  h === "" || m !== h && (p = []);
@@ -8769,11 +8758,11 @@ const Bn = (e) => T.create({
8769
8758
  p
8770
8759
  )
8771
8760
  ).setSelection(
8772
- i.schema.nodes[u].spec.content === "" ? new se(i.tr.doc.resolve(r)) : i.schema.nodes[u].spec.content === "inline*" ? new Q(i.tr.doc.resolve(r)) : (
8761
+ i.schema.nodes[u].spec.content === "" ? new le(i.tr.doc.resolve(r)) : i.schema.nodes[u].spec.content === "inline*" ? new Y(i.tr.doc.resolve(r)) : (
8773
8762
  // Need to offset the position as we have to get through the
8774
8763
  // `tableRow` and `tableCell` nodes to get to the
8775
8764
  // `tableParagraph` node we want to set the selection in.
8776
- new Q(i.tr.doc.resolve(r + 4))
8765
+ new Y(i.tr.doc.resolve(r + 4))
8777
8766
  )
8778
8767
  ), i.tr.setNodeMarkup(r - 1, void 0, {
8779
8768
  ...s.attrs,
@@ -8810,8 +8799,8 @@ const Bn = (e) => T.create({
8810
8799
  if (a.childCount === 2) {
8811
8800
  const m = t.doc.resolve(
8812
8801
  l + s.nodeSize + 1
8813
- ), g = t.doc.resolve(d - 1), f = m.blockRange(g);
8814
- i && t.tr.lift(f, u - 1);
8802
+ ), f = t.doc.resolve(d - 1), g = m.blockRange(f);
8803
+ i && t.tr.lift(g, u - 1);
8815
8804
  }
8816
8805
  let p = e - 1, h = _(t.doc, p);
8817
8806
  for (; h.numChildBlocks > 0; )
@@ -8821,10 +8810,10 @@ const Bn = (e) => T.create({
8821
8810
  t.tr.deleteRange(l, l + s.nodeSize).replace(
8822
8811
  p - 1,
8823
8812
  l,
8824
- new j(s.content, 0, 0)
8813
+ new z(s.content, 0, 0)
8825
8814
  ).scrollIntoView()
8826
8815
  ), t.tr.setSelection(
8827
- new Q(t.doc.resolve(p - 1))
8816
+ new Y(t.doc.resolve(p - 1))
8828
8817
  )), !0;
8829
8818
  },
8830
8819
  // Splits a block at a given position. Content after the position is moved to a new block below, at the same
@@ -8837,27 +8826,27 @@ const Bn = (e) => T.create({
8837
8826
  const r = _(o.doc, e);
8838
8827
  if (r === void 0)
8839
8828
  return !1;
8840
- const { contentNode: a, contentType: s, startPos: l, endPos: d, depth: u } = r, p = o.doc.cut(l + 1, e), h = o.doc.cut(e, d - 1), m = o.schema.nodes.blockContainer.createAndFill(), g = d + 1, f = g + 2;
8841
- return n && (o.tr.insert(g, m), o.tr.replace(
8842
- f,
8843
- f + 1,
8844
- h.content.size > 0 ? new j(
8845
- I.from(h),
8829
+ const { contentNode: a, contentType: s, startPos: l, endPos: d, depth: u } = r, p = o.doc.cut(l + 1, e), h = o.doc.cut(e, d - 1), m = o.schema.nodes.blockContainer.createAndFill(), f = d + 1, g = f + 2;
8830
+ return n && (o.tr.insert(f, m), o.tr.replace(
8831
+ g,
8832
+ g + 1,
8833
+ h.content.size > 0 ? new z(
8834
+ N.from(h),
8846
8835
  u + 2,
8847
8836
  u + 2
8848
8837
  ) : void 0
8849
8838
  ), t && o.tr.setBlockType(
8850
- f,
8851
- f,
8839
+ g,
8840
+ g,
8852
8841
  o.schema.node(s).type,
8853
8842
  i ? a.attrs : void 0
8854
8843
  ), o.tr.setSelection(
8855
- new Q(o.doc.resolve(f))
8844
+ new Y(o.doc.resolve(g))
8856
8845
  ), o.tr.replace(
8857
8846
  l + 1,
8858
8847
  d - 1,
8859
- p.content.size > 0 ? new j(
8860
- I.from(p),
8848
+ p.content.size > 0 ? new z(
8849
+ N.from(p),
8861
8850
  u + 2,
8862
8851
  u + 2
8863
8852
  ) : void 0
@@ -8866,7 +8855,7 @@ const Bn = (e) => T.create({
8866
8855
  };
8867
8856
  },
8868
8857
  addProseMirrorPlugins() {
8869
- return [jn(), Dn()];
8858
+ return [Vn()];
8870
8859
  },
8871
8860
  addKeyboardShortcuts() {
8872
8861
  return {
@@ -8916,9 +8905,9 @@ const Bn = (e) => T.create({
8916
8905
  n.selection.from
8917
8906
  ), l = s === n.doc.nodeSize - 4, d = n.selection.from === s - 1, u = n.selection.empty, p = r.childCount === 2;
8918
8907
  if (!l && d && u && !p) {
8919
- let h = a, m = s + 2, g = n.doc.resolve(m).depth;
8920
- for (; g < h; )
8921
- h = g, m += 2, g = n.doc.resolve(m).depth;
8908
+ let h = a, m = s + 2, f = n.doc.resolve(m).depth;
8909
+ for (; f < h; )
8910
+ h = f, m += 2, f = n.doc.resolve(m).depth;
8922
8911
  return o.BNMergeBlocks(m - 1);
8923
8912
  }
8924
8913
  return !1;
@@ -8973,7 +8962,7 @@ const Bn = (e) => T.create({
8973
8962
  }
8974
8963
  };
8975
8964
  }
8976
- }), Vn = q.create({
8965
+ }), Fn = q.create({
8977
8966
  name: "blockGroup",
8978
8967
  group: "blockGroup",
8979
8968
  content: "blockContainer+",
@@ -8991,7 +8980,7 @@ const Bn = (e) => T.create({
8991
8980
  ...((o = this.options.domAttributes) == null ? void 0 : o.blockGroup) || {},
8992
8981
  ...e
8993
8982
  }, i = document.createElement("div");
8994
- i.className = z(
8983
+ i.className = R(
8995
8984
  "bn-block-group",
8996
8985
  t.class
8997
8986
  ), i.setAttribute("data-node-type", "blockGroup");
@@ -9002,30 +8991,31 @@ const Bn = (e) => T.create({
9002
8991
  contentDOM: i
9003
8992
  };
9004
8993
  }
9005
- }), On = q.create({
8994
+ }), Gn = q.create({
9006
8995
  name: "doc",
9007
8996
  topNode: !0,
9008
8997
  content: "blockGroup"
9009
- }), Fn = (e) => {
8998
+ }), Wn = (e) => {
9010
8999
  var o;
9011
9000
  const t = [
9012
- Y.ClipboardTextSerializer,
9013
- Y.Commands,
9014
- Y.Editable,
9015
- Y.FocusEvents,
9016
- Y.Tabindex,
9001
+ J.ClipboardTextSerializer,
9002
+ J.Commands,
9003
+ J.Editable,
9004
+ J.FocusEvents,
9005
+ J.Tabindex,
9017
9006
  // DevTools,
9018
- ri,
9007
+ li,
9019
9008
  // DropCursor,
9020
- ne.configure({
9021
- types: ["blockContainer"]
9009
+ oe.configure({
9010
+ types: ["blockContainer"],
9011
+ setIdAttribute: e.setIdAttribute
9022
9012
  }),
9023
- ai.extend({ priority: 10 }),
9013
+ di.extend({ priority: 10 }),
9024
9014
  // Comments,
9025
9015
  // basics:
9026
- di,
9016
+ pi,
9027
9017
  // marks:
9028
- li.extend({
9018
+ ui.extend({
9029
9019
  addKeyboardShortcuts() {
9030
9020
  return {
9031
9021
  "Mod-k": () => (this.editor.commands.toggleLink({ href: "" }), !0)
@@ -9033,11 +9023,11 @@ const Bn = (e) => T.create({
9033
9023
  }
9034
9024
  }),
9035
9025
  ...Object.values(e.styleSpecs).map((n) => n.implementation.mark),
9036
- Nn,
9037
- In,
9038
- An,
9026
+ Dn,
9027
+ Hn,
9028
+ Un,
9039
9029
  // make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
9040
- T.create({
9030
+ I.create({
9041
9031
  name: "OverrideEscape",
9042
9032
  addKeyboardShortcuts() {
9043
9033
  return {
@@ -9046,12 +9036,12 @@ const Bn = (e) => T.create({
9046
9036
  }
9047
9037
  }),
9048
9038
  // nodes
9049
- On,
9050
- Rn.configure({
9039
+ Gn,
9040
+ On.configure({
9051
9041
  editor: e.editor,
9052
9042
  domAttributes: e.domAttributes
9053
9043
  }),
9054
- Vn.configure({
9044
+ Fn.configure({
9055
9045
  domAttributes: e.domAttributes
9056
9046
  }),
9057
9047
  ...Object.values(e.inlineContentSpecs).filter((n) => n.config !== "link" && n.config !== "text").map((n) => n.implementation.node.configure({
@@ -9071,17 +9061,17 @@ const Bn = (e) => T.create({
9071
9061
  domAttributes: e.domAttributes
9072
9062
  })
9073
9063
  ]),
9074
- Sn(e.editor),
9075
- Bn(e.editor),
9076
9064
  Ln(e.editor),
9077
- ni.configure({ width: 5, color: "#ddeeff" }),
9065
+ Pn(e.editor),
9066
+ Nn(e.editor),
9067
+ si.configure({ width: 5, color: "#ddeeff" }),
9078
9068
  // This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
9079
9069
  // should be handled before Enter handlers in other components like splitListItem
9080
- ...e.trailingBlock === void 0 || e.trailingBlock ? [Pn] : []
9070
+ ...e.trailingBlock === void 0 || e.trailingBlock ? [jn] : []
9081
9071
  ];
9082
9072
  if (e.collaboration) {
9083
9073
  if (t.push(
9084
- ii.configure({
9074
+ ri.configure({
9085
9075
  fragment: e.collaboration.fragment
9086
9076
  })
9087
9077
  ), (o = e.collaboration.provider) != null && o.awareness) {
@@ -9094,7 +9084,7 @@ const Bn = (e) => T.create({
9094
9084
  return a.insertBefore(l, null), a.insertBefore(s, null), a.insertBefore(d, null), a;
9095
9085
  };
9096
9086
  t.push(
9097
- oi.configure({
9087
+ ai.configure({
9098
9088
  user: e.collaboration.user,
9099
9089
  render: e.collaboration.renderCursor || n,
9100
9090
  provider: e.collaboration.provider
@@ -9102,24 +9092,24 @@ const Bn = (e) => T.create({
9102
9092
  );
9103
9093
  }
9104
9094
  } else
9105
- t.push(si);
9095
+ t.push(ci);
9106
9096
  const i = e.disableExtensions || [];
9107
9097
  return t.filter((n) => !i.includes(n.name));
9108
9098
  };
9109
- function Gn(e, t) {
9099
+ function Kn(e, t) {
9110
9100
  const i = [];
9111
9101
  return e.forEach((o, n, r) => {
9112
9102
  r !== t && i.push(o);
9113
- }), I.from(i);
9103
+ }), N.from(i);
9114
9104
  }
9115
- function Kn(e, t) {
9116
- let i = I.from(e.content);
9105
+ function $n(e, t) {
9106
+ let i = N.from(e.content);
9117
9107
  for (let o = 0; o < i.childCount; o++)
9118
9108
  if (i.child(o).type.spec.group === "blockContent") {
9119
9109
  const n = [i.child(o)];
9120
9110
  if (o + 1 < i.childCount && i.child(o + 1).type.spec.group === "blockGroup") {
9121
9111
  const a = i.child(o + 1).child(0).child(0);
9122
- (a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(i.child(o + 1)), i = Gn(i, o + 1));
9112
+ (a.type.name === "bulletListItem" || a.type.name === "numberedListItem" || a.type.name === "checkListItem") && (n.push(i.child(o + 1)), i = Kn(i, o + 1));
9123
9113
  }
9124
9114
  const r = t.state.schema.nodes.blockContainer.create(
9125
9115
  void 0,
@@ -9127,9 +9117,9 @@ function Kn(e, t) {
9127
9117
  );
9128
9118
  i = i.replaceChild(o, r);
9129
9119
  }
9130
- return new j(i, e.openStart, e.openEnd);
9120
+ return new z(i, e.openStart, e.openEnd);
9131
9121
  }
9132
- function ke(e) {
9122
+ function _e(e) {
9133
9123
  return e && Object.fromEntries(
9134
9124
  Object.entries(e).filter(([, t]) => t !== void 0)
9135
9125
  );
@@ -9146,15 +9136,15 @@ class Ne {
9146
9136
  c(this, "BlockNoteEditor", "only for types");
9147
9137
  c(this, "Block", "only for types");
9148
9138
  c(this, "PartialBlock", "only for types");
9149
- this.blockSpecs = ke(t == null ? void 0 : t.blockSpecs) || ht, this.inlineContentSpecs = ke(t == null ? void 0 : t.inlineContentSpecs) || ft, this.styleSpecs = ke(t == null ? void 0 : t.styleSpecs) || mt, this.blockSchema = lt(this.blockSpecs), this.inlineContentSchema = dt(
9139
+ this.blockSpecs = _e(t == null ? void 0 : t.blockSpecs) || ft, this.inlineContentSpecs = _e(t == null ? void 0 : t.inlineContentSpecs) || bt, this.styleSpecs = _e(t == null ? void 0 : t.styleSpecs) || gt, this.blockSchema = dt(this.blockSpecs), this.inlineContentSchema = ct(
9150
9140
  this.inlineContentSpecs
9151
- ), this.styleSchema = ut(this.styleSpecs);
9141
+ ), this.styleSchema = pt(this.styleSpecs);
9152
9142
  }
9153
9143
  static create(t) {
9154
9144
  return new Ne(t);
9155
9145
  }
9156
9146
  }
9157
- class wt extends Rt {
9147
+ class Et extends Ft {
9158
9148
  constructor(i, o) {
9159
9149
  super({ ...i, content: void 0 });
9160
9150
  c(this, "_state");
@@ -9173,14 +9163,14 @@ class wt extends Rt {
9173
9163
  if (r)
9174
9164
  return r;
9175
9165
  const d = a.apply(n.nodes.doc, l), u = JSON.parse(JSON.stringify(d.toJSON()));
9176
- return u.content[0].content[0].attrs.id = "initialBlockId", r = Bt.fromJSON(n, u), r;
9166
+ return u.content[0].content[0].attrs.id = "initialBlockId", r = At.fromJSON(n, u), r;
9177
9167
  };
9178
9168
  let s;
9179
9169
  try {
9180
9170
  const l = i == null ? void 0 : i.content.map(
9181
- (d) => H(d, this.schema, o).toJSON()
9171
+ (d) => U(d, this.schema, o).toJSON()
9182
9172
  );
9183
- s = Vt(
9173
+ s = Gt(
9184
9174
  {
9185
9175
  type: "doc",
9186
9176
  content: [
@@ -9201,7 +9191,7 @@ class wt extends Rt {
9201
9191
  "Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(i.content)
9202
9192
  );
9203
9193
  }
9204
- this._state = Ft.create({
9194
+ this._state = Kt.create({
9205
9195
  doc: s,
9206
9196
  schema: this.schema
9207
9197
  // selection: selection || undefined,
@@ -9218,7 +9208,7 @@ class wt extends Rt {
9218
9208
  */
9219
9209
  createViewAlternative() {
9220
9210
  queueMicrotask(() => {
9221
- this.view = new ti(
9211
+ this.view = new ni(
9222
9212
  { mount: this.options.element },
9223
9213
  // use mount option so that we reuse the existing element instead of creating a new one
9224
9214
  {
@@ -9235,10 +9225,11 @@ class wt extends Rt {
9235
9225
  });
9236
9226
  }
9237
9227
  }
9238
- wt.prototype.createView = () => {
9228
+ Et.prototype.createView = function() {
9229
+ this.options.onPaste = this.options.onDrop = void 0;
9239
9230
  };
9240
- const Wn = new M("blocknote-placeholder"), $n = (e, t) => new w({
9241
- key: Wn,
9231
+ const qn = new L("blocknote-placeholder"), Xn = (e, t) => new x({
9232
+ key: qn,
9242
9233
  view: () => {
9243
9234
  const i = document.createElement("style"), o = e._tiptapEditor.options.injectNonce;
9244
9235
  o && i.setAttribute("nonce", o), e._tiptapEditor.view.root instanceof ShadowRoot ? e._tiptapEditor.view.root.append(i) : e._tiptapEditor.view.root.head.appendChild(i);
@@ -9276,18 +9267,104 @@ const Wn = new M("blocknote-placeholder"), $n = (e, t) => new w({
9276
9267
  const r = n.$anchor, a = r.parent;
9277
9268
  if (a.content.size > 0)
9278
9269
  return null;
9279
- const s = r.before(), l = W.node(s, s + a.nodeSize, {
9270
+ const s = r.before(), l = $.node(s, s + a.nodeSize, {
9280
9271
  "data-is-empty-and-focused": "true"
9281
9272
  });
9282
9273
  return K.create(o, [l]);
9283
9274
  }
9284
9275
  }
9285
- }), qn = {
9276
+ }), Ye = new L("previous-blocks"), Zn = {
9277
+ // Numbered List Items
9278
+ index: "index",
9279
+ // Headings
9280
+ level: "level",
9281
+ // All Blocks
9282
+ type: "type",
9283
+ depth: "depth",
9284
+ "depth-change": "depth-change"
9285
+ }, Jn = () => {
9286
+ let e;
9287
+ return new x({
9288
+ key: Ye,
9289
+ view(t) {
9290
+ return {
9291
+ update: async (i, o) => {
9292
+ var n;
9293
+ ((n = this.key) == null ? void 0 : n.getState(i.state).updatedBlocks.size) > 0 && (e = setTimeout(() => {
9294
+ i.dispatch(
9295
+ i.state.tr.setMeta(Ye, { clearUpdate: !0 })
9296
+ );
9297
+ }, 0));
9298
+ },
9299
+ destroy: () => {
9300
+ e && clearTimeout(e);
9301
+ }
9302
+ };
9303
+ },
9304
+ state: {
9305
+ init() {
9306
+ return {
9307
+ // Block attributes, by block ID, from just before the previous transaction.
9308
+ prevTransactionOldBlockAttrs: {},
9309
+ // Block attributes, by block ID, from just before the current transaction.
9310
+ currentTransactionOldBlockAttrs: {},
9311
+ // Set of IDs of blocks whose attributes changed from the current transaction.
9312
+ updatedBlocks: /* @__PURE__ */ new Set()
9313
+ };
9314
+ },
9315
+ apply(t, i, o, n) {
9316
+ if (i.currentTransactionOldBlockAttrs = {}, i.updatedBlocks.clear(), !t.docChanged || o.doc.eq(n.doc))
9317
+ return i;
9318
+ const r = {}, a = je(o.doc, (d) => d.attrs.id), s = new Map(
9319
+ a.map((d) => [d.node.attrs.id, d])
9320
+ ), l = je(n.doc, (d) => d.attrs.id);
9321
+ for (const d of l) {
9322
+ const u = s.get(d.node.attrs.id), p = u == null ? void 0 : u.node.firstChild, h = d.node.firstChild;
9323
+ if (u && p && h) {
9324
+ const m = {
9325
+ index: h.attrs.index,
9326
+ level: h.attrs.level,
9327
+ type: h.type.name,
9328
+ depth: n.doc.resolve(d.pos).depth
9329
+ };
9330
+ let f = {
9331
+ index: p.attrs.index,
9332
+ level: p.attrs.level,
9333
+ type: p.type.name,
9334
+ depth: o.doc.resolve(u.pos).depth
9335
+ };
9336
+ r[d.node.attrs.id] = f, t.getMeta("numberedListIndexing") && (d.node.attrs.id in i.prevTransactionOldBlockAttrs && (f = i.prevTransactionOldBlockAttrs[d.node.attrs.id]), m.type === "numberedListItem" && (f.index = m.index)), i.currentTransactionOldBlockAttrs[d.node.attrs.id] = f, JSON.stringify(f) !== JSON.stringify(m) && (f["depth-change"] = f.depth - m.depth, i.updatedBlocks.add(d.node.attrs.id));
9337
+ }
9338
+ }
9339
+ return i.prevTransactionOldBlockAttrs = r, i;
9340
+ }
9341
+ },
9342
+ props: {
9343
+ decorations(t) {
9344
+ const i = this.getState(t);
9345
+ if (i.updatedBlocks.size === 0)
9346
+ return;
9347
+ const o = [];
9348
+ return t.doc.descendants((n, r) => {
9349
+ if (!n.attrs.id || !i.updatedBlocks.has(n.attrs.id))
9350
+ return;
9351
+ const a = i.currentTransactionOldBlockAttrs[n.attrs.id], s = {};
9352
+ for (const [d, u] of Object.entries(a))
9353
+ s["data-prev-" + Zn[d]] = u || "none";
9354
+ const l = $.node(r, r + n.nodeSize, {
9355
+ ...s
9356
+ });
9357
+ o.push(l);
9358
+ }), K.create(t.doc, o);
9359
+ }
9360
+ }
9361
+ });
9362
+ }, Yn = {
9286
9363
  enableInputRules: !0,
9287
9364
  enablePasteRules: !0,
9288
9365
  enableCoreExtensions: !1
9289
9366
  };
9290
- class vt {
9367
+ class Ct {
9291
9368
  constructor(t) {
9292
9369
  c(this, "_pmSchema");
9293
9370
  /**
@@ -9338,6 +9415,8 @@ class vt {
9338
9415
  * @returns The URL of the uploaded file OR an object containing props that should be set on the file block (such as an id)
9339
9416
  */
9340
9417
  c(this, "uploadFile");
9418
+ c(this, "onUploadStartCallbacks", []);
9419
+ c(this, "onUploadEndCallbacks", []);
9341
9420
  c(this, "resolveFileUrl");
9342
9421
  /**
9343
9422
  * Mount the editor to a parent DOM element. Call mount(undefined) to clean up
@@ -9347,7 +9426,7 @@ class vt {
9347
9426
  c(this, "mount", (t) => {
9348
9427
  this._tiptapEditor.mount(t);
9349
9428
  });
9350
- var l, d, u, p, h, m, g;
9429
+ var l, d, u, p, h, m, f;
9351
9430
  this.options = t;
9352
9431
  const i = t;
9353
9432
  if (i.onEditorContentChange)
@@ -9366,7 +9445,7 @@ class vt {
9366
9445
  throw new Error(
9367
9446
  "editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
9368
9447
  );
9369
- this.dictionary = t.dictionary || Je;
9448
+ this.dictionary = t.dictionary || Qe;
9370
9449
  const o = {
9371
9450
  defaultStyles: !0,
9372
9451
  schema: t.schema || Ne.create(),
@@ -9377,8 +9456,8 @@ class vt {
9377
9456
  ...t.placeholders
9378
9457
  }
9379
9458
  };
9380
- this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new ln(this), this.linkToolbar = new un(this), this.sideMenu = new bn(this), this.suggestionMenus = new yn(this), this.filePanel = new rn(this), C("table", this) && (this.tableHandles = new Cn(this));
9381
- const n = Fn({
9459
+ this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, this.formattingToolbar = new pn(this), this.linkToolbar = new fn(this), this.sideMenu = new wn(this), this.suggestionMenus = new En(this), this.filePanel = new dn(this), T("table", this) && (this.tableHandles = new Bn(this));
9460
+ const n = Wn({
9382
9461
  editor: this,
9383
9462
  domAttributes: o.domAttributes || {},
9384
9463
  blockSpecs: this.schema.blockSpecs,
@@ -9386,8 +9465,9 @@ class vt {
9386
9465
  inlineContentSpecs: this.schema.inlineContentSpecs,
9387
9466
  collaboration: o.collaboration,
9388
9467
  trailingBlock: o.trailingBlock,
9389
- disableExtensions: o.disableExtensions
9390
- }), r = T.create({
9468
+ disableExtensions: o.disableExtensions,
9469
+ setIdAttribute: o.setIdAttribute
9470
+ }), r = I.create({
9391
9471
  name: "BlockNoteUIExtension",
9392
9472
  addProseMirrorPlugins: () => [
9393
9473
  this.formattingToolbar.plugin,
@@ -9396,10 +9476,26 @@ class vt {
9396
9476
  this.suggestionMenus.plugin,
9397
9477
  ...this.filePanel ? [this.filePanel.plugin] : [],
9398
9478
  ...this.tableHandles ? [this.tableHandles.plugin] : [],
9399
- $n(this, o.placeholders)
9479
+ Xn(this, o.placeholders),
9480
+ ...this.options.animations ?? !0 ? [Jn()] : []
9400
9481
  ]
9401
9482
  });
9402
- n.push(r), this.uploadFile = o.uploadFile, this.resolveFileUrl = o.resolveFileUrl || (async (f) => f), this.headless = o._headless, o.collaboration && o.initialContent && console.warn(
9483
+ if (n.push(r), o.uploadFile) {
9484
+ const g = o.uploadFile;
9485
+ this.uploadFile = async (k, v) => {
9486
+ this.onUploadStartCallbacks.forEach(
9487
+ (b) => b.apply(this, [v])
9488
+ );
9489
+ try {
9490
+ return await g(k, v);
9491
+ } finally {
9492
+ this.onUploadEndCallbacks.forEach(
9493
+ (b) => b.apply(this, [v])
9494
+ );
9495
+ }
9496
+ };
9497
+ }
9498
+ this.resolveFileUrl = o.resolveFileUrl || (async (g) => g), this.headless = o._headless, o.collaboration && o.initialContent && console.warn(
9403
9499
  "When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
9404
9500
  );
9405
9501
  const a = o.initialContent || (t.collaboration ? [
@@ -9410,7 +9506,7 @@ class vt {
9410
9506
  ] : [
9411
9507
  {
9412
9508
  type: "paragraph",
9413
- id: ne.options.generateID()
9509
+ id: oe.options.generateID()
9414
9510
  }
9415
9511
  ]);
9416
9512
  if (!Array.isArray(a) || a.length === 0)
@@ -9418,7 +9514,7 @@ class vt {
9418
9514
  "initialContent must be a non-empty array of blocks, received: " + a
9419
9515
  );
9420
9516
  const s = {
9421
- ...qn,
9517
+ ...Yn,
9422
9518
  ...o._tiptapOptions,
9423
9519
  content: a,
9424
9520
  extensions: [
@@ -9434,16 +9530,16 @@ class vt {
9434
9530
  tabIndex: "0",
9435
9531
  ...(p = (u = o._tiptapOptions) == null ? void 0 : u.editorProps) == null ? void 0 : p.attributes,
9436
9532
  ...(h = o.domAttributes) == null ? void 0 : h.editor,
9437
- class: z(
9533
+ class: R(
9438
9534
  "bn-editor",
9439
9535
  o.defaultStyles ? "bn-default-styles" : "",
9440
- ((g = (m = o.domAttributes) == null ? void 0 : m.editor) == null ? void 0 : g.class) || ""
9536
+ ((f = (m = o.domAttributes) == null ? void 0 : m.editor) == null ? void 0 : f.class) || ""
9441
9537
  )
9442
9538
  },
9443
- transformPasted: Kn
9539
+ transformPasted: $n
9444
9540
  }
9445
9541
  };
9446
- this.headless ? this._pmSchema = Ot(s.extensions) : (this._tiptapEditor = new wt(
9542
+ this.headless ? this._pmSchema = Wt(s.extensions) : (this._tiptapEditor = new Et(
9447
9543
  s,
9448
9544
  this.schema.styleSchema
9449
9545
  ), this._pmSchema = this._tiptapEditor.schema);
@@ -9452,7 +9548,7 @@ class vt {
9452
9548
  return this._pmSchema;
9453
9549
  }
9454
9550
  static create(t = {}) {
9455
- return new vt(t);
9551
+ return new Ct(t);
9456
9552
  }
9457
9553
  dispatch(t) {
9458
9554
  this._tiptapEditor.dispatch(t);
@@ -9469,6 +9565,18 @@ class vt {
9469
9565
  focus() {
9470
9566
  this._tiptapEditor.view.focus();
9471
9567
  }
9568
+ onUploadStart(t) {
9569
+ return this.onUploadStartCallbacks.push(t), () => {
9570
+ const i = this.onUploadStartCallbacks.indexOf(t);
9571
+ i > -1 && this.onUploadStartCallbacks.splice(i, 1);
9572
+ };
9573
+ }
9574
+ onUploadEnd(t) {
9575
+ return this.onUploadEndCallbacks.push(t), () => {
9576
+ const i = this.onUploadEndCallbacks.indexOf(t);
9577
+ i > -1 && this.onUploadEndCallbacks.splice(i, 1);
9578
+ };
9579
+ }
9472
9580
  /**
9473
9581
  * @deprecated, use `editor.document` instead
9474
9582
  */
@@ -9482,7 +9590,7 @@ class vt {
9482
9590
  get document() {
9483
9591
  const t = [];
9484
9592
  return this._tiptapEditor.state.doc.firstChild.descendants((i) => (t.push(
9485
- x(
9593
+ C(
9486
9594
  i,
9487
9595
  this.schema.blockSchema,
9488
9596
  this.schema.inlineContentSchema,
@@ -9499,7 +9607,7 @@ class vt {
9499
9607
  getBlock(t) {
9500
9608
  const i = typeof t == "string" ? t : t.id;
9501
9609
  let o;
9502
- return this._tiptapEditor.state.doc.firstChild.descendants((n) => typeof o < "u" ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== i ? !0 : (o = x(
9610
+ return this._tiptapEditor.state.doc.firstChild.descendants((n) => typeof o < "u" ? !1 : n.type.name !== "blockContainer" || n.attrs.id !== i ? !0 : (o = C(
9503
9611
  n,
9504
9612
  this.schema.blockSchema,
9505
9613
  this.schema.inlineContentSchema,
@@ -9517,7 +9625,7 @@ class vt {
9517
9625
  i && o.reverse();
9518
9626
  function n(r) {
9519
9627
  for (const a of r) {
9520
- if (!t(a))
9628
+ if (t(a) === !1)
9521
9629
  return !1;
9522
9630
  const s = i ? a.children.slice().reverse() : a.children;
9523
9631
  if (!n(s))
@@ -9554,21 +9662,21 @@ class vt {
9554
9662
  r > 0 && (s = this._tiptapEditor.state.doc.resolve(o - 2).node());
9555
9663
  let l;
9556
9664
  return r < a - 1 && (l = this._tiptapEditor.state.doc.resolve(n + 2).node()), {
9557
- block: x(
9665
+ block: C(
9558
9666
  t,
9559
9667
  this.schema.blockSchema,
9560
9668
  this.schema.inlineContentSchema,
9561
9669
  this.schema.styleSchema,
9562
9670
  this.blockCache
9563
9671
  ),
9564
- prevBlock: s === void 0 ? void 0 : x(
9672
+ prevBlock: s === void 0 ? void 0 : C(
9565
9673
  s,
9566
9674
  this.schema.blockSchema,
9567
9675
  this.schema.inlineContentSchema,
9568
9676
  this.schema.styleSchema,
9569
9677
  this.blockCache
9570
9678
  ),
9571
- nextBlock: l === void 0 ? void 0 : x(
9679
+ nextBlock: l === void 0 ? void 0 : C(
9572
9680
  l,
9573
9681
  this.schema.blockSchema,
9574
9682
  this.schema.inlineContentSchema,
@@ -9601,7 +9709,7 @@ class vt {
9601
9709
  r + a.nodeSize - 4
9602
9710
  );
9603
9711
  else
9604
- throw new A(s);
9712
+ throw new P(s);
9605
9713
  }
9606
9714
  /**
9607
9715
  * Gets a snapshot of the current selection.
@@ -9615,7 +9723,7 @@ class vt {
9615
9723
  return !0;
9616
9724
  const n = o + i.nodeSize - 1, r = o + 1;
9617
9725
  return n <= this._tiptapEditor.state.selection.from || r >= this._tiptapEditor.state.selection.to ? !0 : (t.push(
9618
- x(
9726
+ C(
9619
9727
  this._tiptapEditor.state.doc.resolve(o).node(),
9620
9728
  this.schema.blockSchema,
9621
9729
  this.schema.inlineContentSchema,
@@ -9658,7 +9766,7 @@ class vt {
9658
9766
  * `referenceBlock`. Inserts the blocks at the start of the existing block's children if "nested" is used.
9659
9767
  */
9660
9768
  insertBlocks(t, i, o = "before") {
9661
- return Oo(t, i, o, this);
9769
+ return Ko(t, i, o, this);
9662
9770
  }
9663
9771
  /**
9664
9772
  * Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
@@ -9668,14 +9776,14 @@ class vt {
9668
9776
  * @param update A partial block which defines how the existing block should be changed.
9669
9777
  */
9670
9778
  updateBlock(t, i) {
9671
- return Fo(t, i, this);
9779
+ return $o(t, i, this);
9672
9780
  }
9673
9781
  /**
9674
9782
  * Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
9675
9783
  * @param blocksToRemove An array of identifiers for existing blocks that should be removed.
9676
9784
  */
9677
9785
  removeBlocks(t) {
9678
- return Go(t, this);
9786
+ return qo(t, this);
9679
9787
  }
9680
9788
  /**
9681
9789
  * Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
@@ -9685,7 +9793,7 @@ class vt {
9685
9793
  * @param blocksToInsert An array of partial blocks to replace the old ones with.
9686
9794
  */
9687
9795
  replaceBlocks(t, i) {
9688
- return Ko(t, i, this);
9796
+ return Xo(t, i, this);
9689
9797
  }
9690
9798
  /**
9691
9799
  * Insert a piece of content at the current cursor position.
@@ -9693,12 +9801,12 @@ class vt {
9693
9801
  * @param content can be a string, or array of partial inline content elements
9694
9802
  */
9695
9803
  insertInlineContent(t) {
9696
- const i = $(
9804
+ const i = V(
9697
9805
  t,
9698
9806
  this.pmSchema,
9699
9807
  this.schema.styleSchema
9700
9808
  );
9701
- Wo(
9809
+ Zo(
9702
9810
  {
9703
9811
  from: this._tiptapEditor.state.selection.from,
9704
9812
  to: this._tiptapEditor.state.selection.to
@@ -9736,7 +9844,7 @@ class vt {
9736
9844
  else if (n.propSchema === "string")
9737
9845
  this._tiptapEditor.commands.setMark(i, { stringValue: o });
9738
9846
  else
9739
- throw new A(n.propSchema);
9847
+ throw new P(n.propSchema);
9740
9848
  }
9741
9849
  }
9742
9850
  /**
@@ -9761,7 +9869,7 @@ class vt {
9761
9869
  else if (n.propSchema === "string")
9762
9870
  this._tiptapEditor.commands.toggleMark(i, { stringValue: o });
9763
9871
  else
9764
- throw new A(n.propSchema);
9872
+ throw new P(n.propSchema);
9765
9873
  }
9766
9874
  }
9767
9875
  /**
@@ -9834,7 +9942,7 @@ class vt {
9834
9942
  * @returns The blocks, serialized as an HTML string.
9835
9943
  */
9836
9944
  async blocksToHTMLLossy(t = this.document) {
9837
- return await oe(), de(this.pmSchema, this).exportBlocks(t, {});
9945
+ return await ie(), de(this.pmSchema, this).exportBlocks(t, {});
9838
9946
  }
9839
9947
  /**
9840
9948
  * Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
@@ -9856,7 +9964,7 @@ class vt {
9856
9964
  * @returns The blocks parsed from the HTML string.
9857
9965
  */
9858
9966
  async tryParseHTMLToBlocks(t) {
9859
- return _t(
9967
+ return yt(
9860
9968
  t,
9861
9969
  this.schema.blockSchema,
9862
9970
  this.schema.inlineContentSchema,
@@ -9871,7 +9979,7 @@ class vt {
9871
9979
  * @returns The blocks, serialized as a Markdown string.
9872
9980
  */
9873
9981
  async blocksToMarkdownLossy(t = this.document) {
9874
- return Xo(t, this.pmSchema, this, {});
9982
+ return Qo(t, this.pmSchema, this, {});
9875
9983
  }
9876
9984
  /**
9877
9985
  * Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
@@ -9881,7 +9989,7 @@ class vt {
9881
9989
  * @returns The blocks parsed from the Markdown string.
9882
9990
  */
9883
9991
  async tryParseMarkdownToBlocks(t) {
9884
- return on(
9992
+ return sn(
9885
9993
  t,
9886
9994
  this.schema.blockSchema,
9887
9995
  this.schema.inlineContentSchema,
@@ -9942,43 +10050,43 @@ class vt {
9942
10050
  );
9943
10051
  }
9944
10052
  }
9945
- let ae, ye;
9946
- async function Dr(e, t) {
9947
- if (!zo("text", e))
10053
+ let ae, ke;
10054
+ async function Vr(e, t) {
10055
+ if (!Fo("text", e))
9948
10056
  return [];
9949
10057
  if (!ae) {
9950
- ae = import("@emoji-mart/data"), ye = await import("emoji-mart");
10058
+ ae = import("@emoji-mart/data"), ke = await import("emoji-mart");
9951
10059
  const n = (await ae).default;
9952
- await ye.init({ data: n });
10060
+ await ke.init({ data: n });
9953
10061
  }
9954
10062
  const i = (await ae).default;
9955
- return (t.trim() === "" ? Object.values(i.emojis) : await ye.SearchIndex.search(t)).map((n) => ({
10063
+ return (t.trim() === "" ? Object.values(i.emojis) : await ke.SearchIndex.search(t)).map((n) => ({
9956
10064
  id: n.skins[0].native,
9957
10065
  onItemClick: () => e.insertInlineContent(n.skins[0].native + " ")
9958
10066
  }));
9959
10067
  }
9960
- function Xn(e) {
10068
+ function Qn(e) {
9961
10069
  let t = e.getTextCursorPosition().block, i = e.schema.blockSchema[t.type].content;
9962
10070
  for (; i === "none"; )
9963
10071
  t = e.getTextCursorPosition().nextBlock, i = e.schema.blockSchema[t.type].content, e.setTextCursorPosition(t, "end");
9964
10072
  }
9965
- function E(e, t) {
10073
+ function M(e, t) {
9966
10074
  const i = e.getTextCursorPosition().block;
9967
10075
  if (i.content === void 0)
9968
10076
  throw new Error("Slash Menu open in a block that doesn't contain content.");
9969
- Array.isArray(i.content) && (i.content.length === 1 && ie(i.content[0]) && i.content[0].type === "text" && i.content[0].text === "/" || i.content.length === 0) ? e.updateBlock(i, t) : (e.insertBlocks([t], i, "after"), e.setTextCursorPosition(
10077
+ Array.isArray(i.content) && (i.content.length === 1 && te(i.content[0]) && i.content[0].type === "text" && i.content[0].text === "/" || i.content.length === 0) ? e.updateBlock(i, t) : (e.insertBlocks([t], i, "after"), e.setTextCursorPosition(
9970
10078
  e.getTextCursorPosition().nextBlock,
9971
10079
  "end"
9972
10080
  ));
9973
10081
  const o = e.getTextCursorPosition().block;
9974
- return Xn(e), o;
10082
+ return Qn(e), o;
9975
10083
  }
9976
- function Ur(e) {
10084
+ function Rr(e) {
9977
10085
  const t = [];
9978
- return C("heading", e) && t.push(
10086
+ return T("heading", e) && t.push(
9979
10087
  {
9980
10088
  onItemClick: () => {
9981
- E(e, {
10089
+ M(e, {
9982
10090
  type: "heading",
9983
10091
  props: { level: 1 }
9984
10092
  });
@@ -9989,7 +10097,7 @@ function Ur(e) {
9989
10097
  },
9990
10098
  {
9991
10099
  onItemClick: () => {
9992
- E(e, {
10100
+ M(e, {
9993
10101
  type: "heading",
9994
10102
  props: { level: 2 }
9995
10103
  });
@@ -10000,7 +10108,7 @@ function Ur(e) {
10000
10108
  },
10001
10109
  {
10002
10110
  onItemClick: () => {
10003
- E(e, {
10111
+ M(e, {
10004
10112
  type: "heading",
10005
10113
  props: { level: 3 }
10006
10114
  });
@@ -10009,45 +10117,45 @@ function Ur(e) {
10009
10117
  key: "heading_3",
10010
10118
  ...e.dictionary.slash_menu.heading_3
10011
10119
  }
10012
- ), C("numberedListItem", e) && t.push({
10120
+ ), T("numberedListItem", e) && t.push({
10013
10121
  onItemClick: () => {
10014
- E(e, {
10122
+ M(e, {
10015
10123
  type: "numberedListItem"
10016
10124
  });
10017
10125
  },
10018
10126
  badge: D("Mod-Shift-7"),
10019
10127
  key: "numbered_list",
10020
10128
  ...e.dictionary.slash_menu.numbered_list
10021
- }), C("bulletListItem", e) && t.push({
10129
+ }), T("bulletListItem", e) && t.push({
10022
10130
  onItemClick: () => {
10023
- E(e, {
10131
+ M(e, {
10024
10132
  type: "bulletListItem"
10025
10133
  });
10026
10134
  },
10027
10135
  badge: D("Mod-Shift-8"),
10028
10136
  key: "bullet_list",
10029
10137
  ...e.dictionary.slash_menu.bullet_list
10030
- }), C("checkListItem", e) && t.push({
10138
+ }), T("checkListItem", e) && t.push({
10031
10139
  onItemClick: () => {
10032
- E(e, {
10140
+ M(e, {
10033
10141
  type: "checkListItem"
10034
10142
  });
10035
10143
  },
10036
10144
  badge: D("Mod-Shift-9"),
10037
10145
  key: "check_list",
10038
10146
  ...e.dictionary.slash_menu.check_list
10039
- }), C("paragraph", e) && t.push({
10147
+ }), T("paragraph", e) && t.push({
10040
10148
  onItemClick: () => {
10041
- E(e, {
10149
+ M(e, {
10042
10150
  type: "paragraph"
10043
10151
  });
10044
10152
  },
10045
10153
  badge: D("Mod-Alt-0"),
10046
10154
  key: "paragraph",
10047
10155
  ...e.dictionary.slash_menu.paragraph
10048
- }), C("table", e) && t.push({
10156
+ }), T("table", e) && t.push({
10049
10157
  onItemClick: () => {
10050
- E(e, {
10158
+ M(e, {
10051
10159
  type: "table",
10052
10160
  content: {
10053
10161
  type: "tableContent",
@@ -10065,9 +10173,9 @@ function Ur(e) {
10065
10173
  badge: void 0,
10066
10174
  key: "table",
10067
10175
  ...e.dictionary.slash_menu.table
10068
- }), C("image", e) && t.push({
10176
+ }), T("image", e) && t.push({
10069
10177
  onItemClick: () => {
10070
- const i = E(e, {
10178
+ const i = M(e, {
10071
10179
  type: "image"
10072
10180
  });
10073
10181
  e.dispatch(
@@ -10078,9 +10186,9 @@ function Ur(e) {
10078
10186
  },
10079
10187
  key: "image",
10080
10188
  ...e.dictionary.slash_menu.image
10081
- }), C("video", e) && t.push({
10189
+ }), T("video", e) && t.push({
10082
10190
  onItemClick: () => {
10083
- const i = E(e, {
10191
+ const i = M(e, {
10084
10192
  type: "video"
10085
10193
  });
10086
10194
  e.dispatch(
@@ -10091,9 +10199,9 @@ function Ur(e) {
10091
10199
  },
10092
10200
  key: "video",
10093
10201
  ...e.dictionary.slash_menu.video
10094
- }), C("audio", e) && t.push({
10202
+ }), T("audio", e) && t.push({
10095
10203
  onItemClick: () => {
10096
- const i = E(e, {
10204
+ const i = M(e, {
10097
10205
  type: "audio"
10098
10206
  });
10099
10207
  e.dispatch(
@@ -10104,9 +10212,9 @@ function Ur(e) {
10104
10212
  },
10105
10213
  key: "audio",
10106
10214
  ...e.dictionary.slash_menu.audio
10107
- }), C("file", e) && t.push({
10215
+ }), T("file", e) && t.push({
10108
10216
  onItemClick: () => {
10109
- const i = E(e, {
10217
+ const i = M(e, {
10110
10218
  type: "file"
10111
10219
  });
10112
10220
  e.dispatch(
@@ -10128,14 +10236,14 @@ function Ur(e) {
10128
10236
  ...e.dictionary.slash_menu.emoji
10129
10237
  }), t;
10130
10238
  }
10131
- function jr(e, t) {
10239
+ function Or(e, t) {
10132
10240
  return e.filter(
10133
10241
  ({ title: i, aliases: o }) => i.toLowerCase().includes(t.toLowerCase()) || o && o.filter(
10134
10242
  (n) => n.toLowerCase().includes(t.toLowerCase())
10135
10243
  ).length !== 0
10136
10244
  );
10137
10245
  }
10138
- function we(e = "") {
10246
+ function ye(e = "") {
10139
10247
  return typeof e == "string" ? [
10140
10248
  {
10141
10249
  type: "text",
@@ -10144,22 +10252,22 @@ function we(e = "") {
10144
10252
  }
10145
10253
  ] : e;
10146
10254
  }
10147
- function xt(e) {
10148
- return typeof e == "string" ? we(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? we(t) : Qe(t) ? {
10255
+ function St(e) {
10256
+ return typeof e == "string" ? ye(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? ye(t) : tt(t) ? {
10149
10257
  ...t,
10150
- content: we(t.content)
10151
- } : ie(t) ? t : {
10258
+ content: ye(t.content)
10259
+ } : te(t) ? t : {
10152
10260
  props: {},
10153
10261
  ...t,
10154
- content: xt(t.content)
10262
+ content: St(t.content)
10155
10263
  }) : e;
10156
10264
  }
10157
- function zr(e, t) {
10265
+ function Fr(e, t) {
10158
10266
  return t.map(
10159
- (i) => Et(e, i)
10267
+ (i) => Mt(e, i)
10160
10268
  );
10161
10269
  }
10162
- function Et(e, t) {
10270
+ function Mt(e, t) {
10163
10271
  const i = {
10164
10272
  id: "",
10165
10273
  type: t.type,
@@ -10174,147 +10282,149 @@ function Et(e, t) {
10174
10282
  }
10175
10283
  ), {
10176
10284
  ...i,
10177
- content: xt(i.content),
10178
- children: i.children.map((o) => Et(e, o))
10285
+ content: St(i.content),
10286
+ children: i.children.map((o) => Mt(e, o))
10179
10287
  };
10180
10288
  }
10181
- function Zn(e) {
10182
- e.id || (e.id = ne.options.generateID()), e.children && Jn(e.children);
10289
+ function er(e) {
10290
+ e.id || (e.id = oe.options.generateID()), e.children && tr(e.children);
10183
10291
  }
10184
- function Jn(e) {
10292
+ function tr(e) {
10185
10293
  for (const t of e)
10186
- Zn(t);
10294
+ er(t);
10187
10295
  }
10188
10296
  export {
10189
- Ki as AudioBlock,
10190
- vt as BlockNoteEditor,
10297
+ Xi as AudioBlock,
10298
+ Ct as BlockNoteEditor,
10191
10299
  Ne as BlockNoteSchema,
10192
- Ji as FileBlock,
10193
- rn as FilePanelProsemirrorPlugin,
10194
- nn as FilePanelView,
10195
- ln as FormattingToolbarProsemirrorPlugin,
10196
- an as FormattingToolbarView,
10197
- _t as HTMLToBlocks,
10198
- oo as ImageBlock,
10199
- un as LinkToolbarProsemirrorPlugin,
10200
- bn as SideMenuProsemirrorPlugin,
10201
- fn as SideMenuView,
10202
- yn as SuggestionMenuProseMirrorPlugin,
10203
- Cn as TableHandlesProsemirrorPlugin,
10204
- En as TableHandlesView,
10205
- ne as UniqueID,
10206
- A as UnreachableCaseError,
10207
- co as VideoBlock,
10208
- Zn as addIdsToBlock,
10209
- Jn as addIdsToBlocks,
10210
- Ai as addInlineContentAttributes,
10211
- Ni as addInlineContentKeyboardShortcuts,
10212
- ji as addStyleAttributes,
10213
- Er as assertEmpty,
10214
- Vi as audioBlockConfig,
10215
- Fi as audioParse,
10216
- Ri as audioPropSchema,
10217
- Oi as audioRender,
10218
- Gi as audioToExternalHTML,
10219
- H as blockToNode,
10220
- Xo as blocksToMarkdown,
10221
- le as camelToDataKebab,
10222
- Pr as checkBlockHasDefaultProp,
10223
- Ro as checkBlockIsDefaultType,
10224
- Ir as checkBlockIsFileBlock,
10225
- Nr as checkBlockIsFileBlockWithPlaceholder,
10226
- Ar as checkBlockIsFileBlockWithPreview,
10227
- Vo as checkBlockTypeHasDefaultProp,
10228
- C as checkDefaultBlockTypeInSchema,
10229
- zo as checkDefaultInlineContentTypeInSchema,
10300
+ to as FileBlock,
10301
+ dn as FilePanelProsemirrorPlugin,
10302
+ ln as FilePanelView,
10303
+ pn as FormattingToolbarProsemirrorPlugin,
10304
+ cn as FormattingToolbarView,
10305
+ yt as HTMLToBlocks,
10306
+ so as ImageBlock,
10307
+ fn as LinkToolbarProsemirrorPlugin,
10308
+ wn as SideMenuProsemirrorPlugin,
10309
+ kn as SideMenuView,
10310
+ En as SuggestionMenuProseMirrorPlugin,
10311
+ Bn as TableHandlesProsemirrorPlugin,
10312
+ Tn as TableHandlesView,
10313
+ oe as UniqueID,
10314
+ P as UnreachableCaseError,
10315
+ mo as VideoBlock,
10316
+ er as addIdsToBlock,
10317
+ tr as addIdsToBlocks,
10318
+ Fe as addInlineContentAttributes,
10319
+ Ui as addInlineContentKeyboardShortcuts,
10320
+ Ri as addStyleAttributes,
10321
+ Pi as applyNonSelectableBlockFix,
10322
+ Tr as assertEmpty,
10323
+ Wi as audioBlockConfig,
10324
+ $i as audioParse,
10325
+ Gi as audioPropSchema,
10326
+ Ki as audioRender,
10327
+ qi as audioToExternalHTML,
10328
+ U as blockToNode,
10329
+ Qo as blocksToMarkdown,
10330
+ se as camelToDataKebab,
10331
+ jr as checkBlockHasDefaultProp,
10332
+ Go as checkBlockIsDefaultType,
10333
+ Hr as checkBlockIsFileBlock,
10334
+ Dr as checkBlockIsFileBlockWithPlaceholder,
10335
+ Ur as checkBlockIsFileBlockWithPreview,
10336
+ Wo as checkBlockTypeHasDefaultProp,
10337
+ T as checkDefaultBlockTypeInSchema,
10338
+ Fo as checkDefaultInlineContentTypeInSchema,
10230
10339
  Ie as cleanHTMLToMarkdown,
10231
10340
  Se as contentNodeToInlineContent,
10232
- pe as createAddFileButton,
10341
+ Fi as createAddFileButton,
10233
10342
  ce as createBlockSpec,
10234
10343
  X as createBlockSpecFromStronglyTypedTiptapNode,
10235
- R as createDefaultBlockDOMOutputSpec,
10236
- ue as createDefaultFilePreview,
10344
+ O as createDefaultBlockDOMOutputSpec,
10345
+ ht as createDefaultFilePreview,
10237
10346
  de as createExternalHTMLExporter,
10238
10347
  Te as createFigureWithCaption,
10239
- V as createFileAndCaptionWrapper,
10240
- Mr as createInlineContentSpec,
10241
- Hi as createInlineContentSpecFromTipTapNode,
10242
- st as createInternalBlockSpec,
10348
+ ne as createFileAndCaptionWrapper,
10349
+ ue as createFileBlockWrapper,
10350
+ Ir as createInlineContentSpec,
10351
+ ji as createInlineContentSpecFromTipTapNode,
10352
+ lt as createInternalBlockSpec,
10243
10353
  Me as createInternalHTMLSerializer,
10244
- Pi as createInternalInlineContentSpec,
10245
- ct as createInternalStyleSpec,
10246
- me as createLinkWithCaption,
10247
- pt as createResizeHandlesWrapper,
10248
- O as createStronglyTypedTiptapNode,
10249
- Tr as createStyleSpec,
10250
- U as createStyleSpecFromTipTapMark,
10251
- Hr as createSuggestionMenu,
10252
- Uo as defaultBlockSchema,
10253
- ht as defaultBlockSpecs,
10254
- Ve as defaultBlockToHTML,
10255
- jo as defaultInlineContentSchema,
10256
- ft as defaultInlineContentSpecs,
10257
- k as defaultProps,
10258
- Lr as defaultStyleSchema,
10259
- mt as defaultStyleSpecs,
10260
- P as esmDependencies,
10261
- $i as fileBlockConfig,
10262
- Xi as fileParse,
10263
- Wi as filePropSchema,
10264
- qi as fileRender,
10265
- Zi as fileToExternalHTML,
10266
- Sr as filenameFromURL,
10267
- jr as filterSuggestionItems,
10354
+ Di as createInternalInlineContentSpec,
10355
+ ut as createInternalStyleSpec,
10356
+ he as createLinkWithCaption,
10357
+ mt as createResizeHandlesWrapper,
10358
+ F as createStronglyTypedTiptapNode,
10359
+ Ar as createStyleSpec,
10360
+ j as createStyleSpecFromTipTapMark,
10361
+ zr as createSuggestionMenu,
10362
+ Ro as defaultBlockSchema,
10363
+ ft as defaultBlockSpecs,
10364
+ Oe as defaultBlockToHTML,
10365
+ Oo as defaultInlineContentSchema,
10366
+ bt as defaultInlineContentSpecs,
10367
+ w as defaultProps,
10368
+ Pr as defaultStyleSchema,
10369
+ gt as defaultStyleSpecs,
10370
+ H as esmDependencies,
10371
+ Ji as fileBlockConfig,
10372
+ Qi as fileParse,
10373
+ Zi as filePropSchema,
10374
+ Yi as fileRender,
10375
+ eo as fileToExternalHTML,
10376
+ Lr as filenameFromURL,
10377
+ Or as filterSuggestionItems,
10268
10378
  D as formatKeyboardShortcut,
10269
- sn as formattingToolbarPluginKey,
10270
- Li as getBlockFromPos,
10271
- Fn as getBlockNoteExtensions,
10272
- lt as getBlockSchemaFromSpecs,
10273
- S as getCurrentBlockContentType,
10274
- Dr as getDefaultEmojiPickerItems,
10275
- Ur as getDefaultSlashMenuItems,
10276
- fe as getDraggableBlockFromElement,
10277
- Di as getInlineContentParseRules,
10278
- dt as getInlineContentSchemaFromSpecs,
10279
- Ii as getParseRules,
10280
- zi as getStyleParseRules,
10281
- ut as getStyleSchemaFromSpecs,
10282
- Qi as imageBlockConfig,
10283
- to as imageParse,
10284
- Yi as imagePropSchema,
10285
- eo as imageRender,
10286
- io as imageToExternalHTML,
10287
- rt as inheritedProps,
10288
- oe as initializeESMDependencies,
10289
- $ as inlineContentToNodes,
10290
- E as insertOrUpdateBlock,
10291
- Bi as isAppleOS,
10379
+ un as formattingToolbarPluginKey,
10380
+ Ni as getBlockFromPos,
10381
+ Wn as getBlockNoteExtensions,
10382
+ dt as getBlockSchemaFromSpecs,
10383
+ B as getCurrentBlockContentType,
10384
+ Vr as getDefaultEmojiPickerItems,
10385
+ Rr as getDefaultSlashMenuItems,
10386
+ me as getDraggableBlockFromElement,
10387
+ zi as getInlineContentParseRules,
10388
+ ct as getInlineContentSchemaFromSpecs,
10389
+ Hi as getParseRules,
10390
+ Oi as getStyleParseRules,
10391
+ pt as getStyleSchemaFromSpecs,
10392
+ oo as imageBlockConfig,
10393
+ ro as imageParse,
10394
+ io as imagePropSchema,
10395
+ no as imageRender,
10396
+ ao as imageToExternalHTML,
10397
+ at as inheritedProps,
10398
+ ie as initializeESMDependencies,
10399
+ V as inlineContentToNodes,
10400
+ M as insertOrUpdateBlock,
10401
+ Ai as isAppleOS,
10292
10402
  ze as isLinkInlineContent,
10293
- Qe as isPartialLinkInlineContent,
10294
- Cr as isSafari,
10295
- ie as isStyledTextInlineContent,
10296
- cn as linkToolbarPluginKey,
10297
- xr as locales,
10298
- on as markdownToBlocks,
10299
- z as mergeCSSClasses,
10300
- x as nodeToBlock,
10301
- it as nodeToCustomInlineContent,
10302
- Oe as parseEmbedElement,
10303
- he as parseFigureElement,
10304
- Ge as parseImageElement,
10305
- Et as partialBlockToBlockForTesting,
10306
- zr as partialBlocksToBlocksForTesting,
10307
- at as propsToAttributes,
10308
- gn as sideMenuPluginKey,
10309
- Ui as stylePropsToAttributes,
10310
- et as tableContentToNodes,
10311
- ee as tableHandlesPluginKey,
10312
- Br as uploadToTmpFilesDotOrg_DEV_ONLY,
10313
- ro as videoBlockConfig,
10314
- so as videoParse,
10315
- no as videoPropSchema,
10316
- ao as videoRender,
10317
- lo as videoToExternalHTML,
10318
- be as wrapInBlockStructure
10403
+ tt as isPartialLinkInlineContent,
10404
+ Br as isSafari,
10405
+ te as isStyledTextInlineContent,
10406
+ mn as linkToolbarPluginKey,
10407
+ Mr as locales,
10408
+ sn as markdownToBlocks,
10409
+ R as mergeCSSClasses,
10410
+ C as nodeToBlock,
10411
+ xe as nodeToCustomInlineContent,
10412
+ Ge as parseEmbedElement,
10413
+ pe as parseFigureElement,
10414
+ Ke as parseImageElement,
10415
+ Mt as partialBlockToBlockForTesting,
10416
+ Fr as partialBlocksToBlocksForTesting,
10417
+ st as propsToAttributes,
10418
+ yn as sideMenuPluginKey,
10419
+ Vi as stylePropsToAttributes,
10420
+ it as tableContentToNodes,
10421
+ Q as tableHandlesPluginKey,
10422
+ Nr as uploadToTmpFilesDotOrg_DEV_ONLY,
10423
+ co as videoBlockConfig,
10424
+ po as videoParse,
10425
+ lo as videoPropSchema,
10426
+ uo as videoRender,
10427
+ ho as videoToExternalHTML,
10428
+ ge as wrapInBlockStructure
10319
10429
  };
10320
10430
  //# sourceMappingURL=blocknote.js.map