@blocknote/core 0.23.6 → 0.24.1

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 (43) hide show
  1. package/dist/blocknote.js +690 -550
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +6 -6
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +2 -2
  8. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +492 -0
  9. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +6 -0
  10. package/src/api/nodeConversions/blockToNode.ts +5 -3
  11. package/src/api/nodeConversions/nodeToBlock.ts +11 -5
  12. package/src/editor/BlockNoteEditor.ts +21 -6
  13. package/src/editor/BlockNoteExtensions.ts +9 -4
  14. package/src/editor/BlockNoteTipTapEditor.ts +37 -36
  15. package/src/extensions/Collaboration/createCollaborationExtensions.ts +4 -2
  16. package/src/extensions/Placeholder/PlaceholderPlugin.ts +69 -54
  17. package/src/extensions/SideMenu/SideMenuPlugin.ts +49 -39
  18. package/src/i18n/locales/ar.ts +3 -0
  19. package/src/i18n/locales/de.ts +3 -0
  20. package/src/i18n/locales/en.ts +4 -1
  21. package/src/i18n/locales/es.ts +3 -0
  22. package/src/i18n/locales/fr.ts +3 -0
  23. package/src/i18n/locales/hr.ts +3 -0
  24. package/src/i18n/locales/is.ts +3 -0
  25. package/src/i18n/locales/it.ts +316 -314
  26. package/src/i18n/locales/ja.ts +3 -0
  27. package/src/i18n/locales/ko.ts +3 -0
  28. package/src/i18n/locales/nl.ts +3 -0
  29. package/src/i18n/locales/pl.ts +3 -0
  30. package/src/i18n/locales/pt.ts +3 -0
  31. package/src/i18n/locales/ru.ts +3 -0
  32. package/src/i18n/locales/uk.ts +337 -278
  33. package/src/i18n/locales/vi.ts +3 -0
  34. package/src/i18n/locales/zh.ts +3 -0
  35. package/types/src/editor/BlockNoteEditor.d.ts +2 -2
  36. package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
  37. package/types/src/editor/BlockNoteTipTapEditor.d.ts +1 -2
  38. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +1 -1
  39. package/types/src/i18n/locales/de.d.ts +3 -0
  40. package/types/src/i18n/locales/en.d.ts +4 -7
  41. package/types/src/i18n/locales/es.d.ts +3 -0
  42. package/types/src/i18n/locales/hr.d.ts +3 -0
  43. package/types/src/i18n/locales/it.d.ts +3 -0
package/dist/blocknote.js CHANGED
@@ -1,13 +1,13 @@
1
- var go = Object.defineProperty;
2
- var bo = (e, t, o) => t in e ? go(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var p = (e, t, o) => bo(e, typeof t != "symbol" ? t + "" : t, o);
4
- import { Slice as q, Fragment as j, DOMSerializer as vt, DOMParser as wt, Node as ko } from "prosemirror-model";
5
- import { Extension as L, combineTransactionSteps as _o, getChangedRanges as yo, findChildrenInRange as vo, Node as X, Mark as xe, InputRule as te, isTextSelection as xt, callOrReturn as wo, getExtensionField as xo, selectionToInsertionEnd as Co, isNodeSelection as Ye, posToDOMRect as je, getMarkRange as Qe, findChildren as et, findParentNode as Eo, extensions as re, Editor as So, createDocument as Bo, getSchema as To } from "@tiptap/core";
6
- import { Plugin as B, PluginKey as N, TextSelection as U, NodeSelection as ce, Selection as Me, EditorState as Mo } from "prosemirror-state";
7
- import { v4 as Io } from "uuid";
1
+ var bo = Object.defineProperty;
2
+ var ko = (e, t, o) => t in e ? bo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var p = (e, t, o) => ko(e, typeof t != "symbol" ? t + "" : t, o);
4
+ import { Slice as q, Fragment as j, DOMSerializer as vt, DOMParser as wt, Node as _o } from "prosemirror-model";
5
+ import { Extension as L, combineTransactionSteps as yo, getChangedRanges as vo, findChildrenInRange as wo, Node as Z, Mark as xe, InputRule as oe, isTextSelection as xt, callOrReturn as xo, getExtensionField as Co, selectionToInsertionEnd as Eo, isNodeSelection as Ye, posToDOMRect as je, getMarkRange as Qe, findChildren as et, findParentNode as So, extensions as re, Editor as Bo, createDocument as To, getSchema as Mo } from "@tiptap/core";
6
+ import { Plugin as B, PluginKey as N, TextSelection as U, NodeSelection as ce, Selection as Me, EditorState as Io } from "prosemirror-state";
7
+ import { v4 as Ct } from "uuid";
8
8
  import { createHighlightPlugin as Lo } from "prosemirror-highlight";
9
9
  import { createParser as Ao } from "prosemirror-highlight/shiki";
10
- import { bundledLanguagesInfo as Ct, createHighlighter as Po } from "shiki";
10
+ import { bundledLanguagesInfo as Et, createHighlighter as Po } from "shiki";
11
11
  import No from "@tiptap/extension-bold";
12
12
  import jo from "@tiptap/extension-code";
13
13
  import Do from "@tiptap/extension-italic";
@@ -23,9 +23,9 @@ import { HardBreak as Ko } from "@tiptap/extension-hard-break";
23
23
  import { History as qo } from "@tiptap/extension-history";
24
24
  import { Link as Xo } from "@tiptap/extension-link";
25
25
  import { Text as Zo } from "@tiptap/extension-text";
26
- import { Decoration as oe, DecorationSet as ie, EditorView as Jo } from "prosemirror-view";
27
- import Yo from "@tiptap/extension-collaboration";
28
- import Qo from "@tiptap/extension-collaboration-cursor";
26
+ import Jo from "@tiptap/extension-collaboration";
27
+ import Yo from "@tiptap/extension-collaboration-cursor";
28
+ import { Decoration as X, DecorationSet as ie, EditorView as Qo } from "prosemirror-view";
29
29
  import { dropCursor as ei } from "prosemirror-dropcursor";
30
30
  const ti = {
31
31
  slash_menu: {
@@ -286,6 +286,9 @@ const ti = {
286
286
  },
287
287
  align_justify: {
288
288
  tooltip: "ضبط النص"
289
+ },
290
+ comment: {
291
+ tooltip: "إضافة ملاحظة"
289
292
  }
290
293
  },
291
294
  file_panel: {
@@ -603,6 +606,9 @@ const ti = {
603
606
  },
604
607
  align_justify: {
605
608
  tooltip: "Text Blocksatz"
609
+ },
610
+ comment: {
611
+ tooltip: "Kommentar hinzufügen"
606
612
  }
607
613
  },
608
614
  file_panel: {
@@ -646,7 +652,7 @@ const ti = {
646
652
  generic: {
647
653
  ctrl_shortcut: "Strg"
648
654
  }
649
- }, Et = {
655
+ }, St = {
650
656
  slash_menu: {
651
657
  heading: {
652
658
  title: "Heading 1",
@@ -921,6 +927,9 @@ const ti = {
921
927
  },
922
928
  align_justify: {
923
929
  tooltip: "Justify text"
930
+ },
931
+ comment: {
932
+ tooltip: "Add comment"
924
933
  }
925
934
  },
926
935
  file_panel: {
@@ -1237,6 +1246,9 @@ const ti = {
1237
1246
  },
1238
1247
  align_justify: {
1239
1248
  tooltip: "Justificar texto"
1249
+ },
1250
+ comment: {
1251
+ tooltip: "Agregar comentario"
1240
1252
  }
1241
1253
  },
1242
1254
  file_panel: {
@@ -1576,6 +1588,9 @@ const ti = {
1576
1588
  },
1577
1589
  align_justify: {
1578
1590
  tooltip: "Justifier le texte"
1591
+ },
1592
+ comment: {
1593
+ tooltip: "Ajouter un commentaire"
1579
1594
  }
1580
1595
  },
1581
1596
  file_panel: {
@@ -1900,6 +1915,9 @@ const ti = {
1900
1915
  },
1901
1916
  align_justify: {
1902
1917
  tooltip: "Poravnaj tekst obostrano"
1918
+ },
1919
+ comment: {
1920
+ tooltip: "Dodaj komentar"
1903
1921
  }
1904
1922
  },
1905
1923
  file_panel: {
@@ -2209,6 +2227,9 @@ const ti = {
2209
2227
  },
2210
2228
  align_justify: {
2211
2229
  tooltip: "Jafna texta"
2230
+ },
2231
+ comment: {
2232
+ tooltip: "Bæta við athugun"
2212
2233
  }
2213
2234
  },
2214
2235
  file_panel: {
@@ -2521,6 +2542,9 @@ const ti = {
2521
2542
  },
2522
2543
  align_justify: {
2523
2544
  tooltip: "Giustifica testo"
2545
+ },
2546
+ comment: {
2547
+ tooltip: "Aggiungi commento"
2524
2548
  }
2525
2549
  },
2526
2550
  file_panel: {
@@ -2858,6 +2882,9 @@ const ti = {
2858
2882
  },
2859
2883
  align_justify: {
2860
2884
  tooltip: "両端揃え"
2885
+ },
2886
+ comment: {
2887
+ tooltip: "コメントを追加"
2861
2888
  }
2862
2889
  },
2863
2890
  file_panel: {
@@ -3188,6 +3215,9 @@ const ti = {
3188
3215
  },
3189
3216
  align_justify: {
3190
3217
  tooltip: "텍스트 양쪽 맞춤"
3218
+ },
3219
+ comment: {
3220
+ tooltip: "코멘트 추가"
3191
3221
  }
3192
3222
  },
3193
3223
  file_panel: {
@@ -3505,6 +3535,9 @@ const ti = {
3505
3535
  },
3506
3536
  align_justify: {
3507
3537
  tooltip: "Tekst uitvullen"
3538
+ },
3539
+ comment: {
3540
+ tooltip: "Commentaar toevoegen"
3508
3541
  }
3509
3542
  },
3510
3543
  file_panel: {
@@ -3806,6 +3839,9 @@ const ti = {
3806
3839
  },
3807
3840
  align_justify: {
3808
3841
  tooltip: "Wyjustuj tekst"
3842
+ },
3843
+ comment: {
3844
+ tooltip: "Dodaj komentarz"
3809
3845
  }
3810
3846
  },
3811
3847
  file_panel: {
@@ -4115,6 +4151,9 @@ const ti = {
4115
4151
  },
4116
4152
  align_justify: {
4117
4153
  tooltip: "Justificar texto"
4154
+ },
4155
+ comment: {
4156
+ tooltip: "Adicionar comentário"
4118
4157
  }
4119
4158
  },
4120
4159
  file_panel: {
@@ -4459,6 +4498,9 @@ const ti = {
4459
4498
  },
4460
4499
  align_justify: {
4461
4500
  tooltip: "По середине текст"
4501
+ },
4502
+ comment: {
4503
+ tooltip: "Добавить комментарий"
4462
4504
  }
4463
4505
  },
4464
4506
  file_panel: {
@@ -4525,19 +4567,45 @@ const ti = {
4525
4567
  numbered_list: {
4526
4568
  title: "Нумерований список",
4527
4569
  subtext: "Список із впорядкованими елементами",
4528
- aliases: ["ol", "li", "list", "numberedlist", "numbered list", "список", "нумерований список"],
4570
+ aliases: [
4571
+ "ol",
4572
+ "li",
4573
+ "list",
4574
+ "numberedlist",
4575
+ "numbered list",
4576
+ "список",
4577
+ "нумерований список"
4578
+ ],
4529
4579
  group: "Базові блоки"
4530
4580
  },
4531
4581
  bullet_list: {
4532
4582
  title: "Маркований список",
4533
4583
  subtext: "Список із невпорядкованими елементами",
4534
- aliases: ["ul", "li", "list", "bulletlist", "bullet list", "список", "маркований список"],
4584
+ aliases: [
4585
+ "ul",
4586
+ "li",
4587
+ "list",
4588
+ "bulletlist",
4589
+ "bullet list",
4590
+ "список",
4591
+ "маркований список"
4592
+ ],
4535
4593
  group: "Базові блоки"
4536
4594
  },
4537
4595
  check_list: {
4538
4596
  title: "Чек-лист",
4539
4597
  subtext: "Список із чекбоксами",
4540
- aliases: ["ul", "li", "list", "checklist", "check list", "checked list", "checkbox", "чекбокс", "чек-лист"],
4598
+ aliases: [
4599
+ "ul",
4600
+ "li",
4601
+ "list",
4602
+ "checklist",
4603
+ "check list",
4604
+ "checked list",
4605
+ "checkbox",
4606
+ "чекбокс",
4607
+ "чек-лист"
4608
+ ],
4541
4609
  group: "Базові блоки"
4542
4610
  },
4543
4611
  paragraph: {
@@ -4567,19 +4635,49 @@ const ti = {
4567
4635
  image: {
4568
4636
  title: "Зображення",
4569
4637
  subtext: "Масштабоване зображення з підписом",
4570
- aliases: ["image", "imageUpload", "upload", "img", "picture", "media", "url", "зображення", "медіа"],
4638
+ aliases: [
4639
+ "image",
4640
+ "imageUpload",
4641
+ "upload",
4642
+ "img",
4643
+ "picture",
4644
+ "media",
4645
+ "url",
4646
+ "зображення",
4647
+ "медіа"
4648
+ ],
4571
4649
  group: "Медіа"
4572
4650
  },
4573
4651
  video: {
4574
4652
  title: "Відео",
4575
4653
  subtext: "Масштабоване відео з підписом",
4576
- aliases: ["video", "videoUpload", "upload", "mp4", "film", "media", "url", "відео", "медіа"],
4654
+ aliases: [
4655
+ "video",
4656
+ "videoUpload",
4657
+ "upload",
4658
+ "mp4",
4659
+ "film",
4660
+ "media",
4661
+ "url",
4662
+ "відео",
4663
+ "медіа"
4664
+ ],
4577
4665
  group: "Медіа"
4578
4666
  },
4579
4667
  audio: {
4580
4668
  title: "Аудіо",
4581
4669
  subtext: "Вбудоване аудіо з підписом",
4582
- aliases: ["audio", "audioUpload", "upload", "mp3", "sound", "media", "url", "аудіо", "медіа"],
4670
+ aliases: [
4671
+ "audio",
4672
+ "audioUpload",
4673
+ "upload",
4674
+ "mp3",
4675
+ "sound",
4676
+ "media",
4677
+ "url",
4678
+ "аудіо",
4679
+ "медіа"
4680
+ ],
4583
4681
  group: "Медіа"
4584
4682
  },
4585
4683
  file: {
@@ -4745,6 +4843,9 @@ const ti = {
4745
4843
  },
4746
4844
  align_justify: {
4747
4845
  tooltip: "Вирівняти за шириною"
4846
+ },
4847
+ comment: {
4848
+ tooltip: "Додати коментар"
4748
4849
  }
4749
4850
  },
4750
4851
  file_panel: {
@@ -5061,6 +5162,9 @@ const ti = {
5061
5162
  },
5062
5163
  align_justify: {
5063
5164
  tooltip: "Căn đều văn bản"
5165
+ },
5166
+ comment: {
5167
+ tooltip: "Thêm bình luận"
5064
5168
  }
5065
5169
  },
5066
5170
  file_panel: {
@@ -5411,6 +5515,9 @@ const ti = {
5411
5515
  },
5412
5516
  align_justify: {
5413
5517
  tooltip: "文本对齐"
5518
+ },
5519
+ comment: {
5520
+ tooltip: "添加评论"
5414
5521
  }
5415
5522
  },
5416
5523
  file_panel: {
@@ -5458,7 +5565,7 @@ const ti = {
5458
5565
  __proto__: null,
5459
5566
  ar: ti,
5460
5567
  de: oi,
5461
- en: Et,
5568
+ en: St,
5462
5569
  es: ii,
5463
5570
  fr: ni,
5464
5571
  hr: ri,
@@ -5512,7 +5619,7 @@ const ue = L.create({
5512
5619
  const e = window.__TEST_OPTIONS;
5513
5620
  return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
5514
5621
  }
5515
- return Io();
5622
+ return Ct();
5516
5623
  },
5517
5624
  filterTransaction: null
5518
5625
  };
@@ -5581,42 +5688,42 @@ const ue = L.create({
5581
5688
  });
5582
5689
  if (!r || a)
5583
5690
  return;
5584
- const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = _o(
5691
+ const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = yo(
5585
5692
  i.doc,
5586
5693
  o
5587
5694
  ), { mapping: h } = u;
5588
- if (yo(u).forEach(({ newRange: f }) => {
5589
- const g = vo(
5695
+ if (vo(u).forEach(({ newRange: f }) => {
5696
+ const g = wo(
5590
5697
  n.doc,
5591
5698
  f,
5592
- (C) => l.includes(C.type.name)
5593
- ), b = g.map(({ node: C }) => C.attrs[d]).filter((C) => C !== null), k = ki(b);
5594
- g.forEach(({ node: C, pos: y }) => {
5699
+ (v) => l.includes(v.type.name)
5700
+ ), b = g.map(({ node: v }) => v.attrs[d]).filter((v) => v !== null), k = ki(b);
5701
+ g.forEach(({ node: v, pos: y }) => {
5595
5702
  let P;
5596
- const J = (P = s.doc.nodeAt(y)) === null || P === void 0 ? void 0 : P.attrs[d];
5597
- if (J === null) {
5598
- const w = i.doc.type.createAndFill().content;
5599
- if (i.doc.content.findDiffStart(w) === null) {
5703
+ const Y = (P = s.doc.nodeAt(y)) === null || P === void 0 ? void 0 : P.attrs[d];
5704
+ if (Y === null) {
5705
+ const x = i.doc.type.createAndFill().content;
5706
+ if (i.doc.content.findDiffStart(x) === null) {
5600
5707
  const Je = JSON.parse(
5601
5708
  JSON.stringify(n.doc.toJSON())
5602
5709
  );
5603
- if (Je.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Je.content) === JSON.stringify(w.toJSON())) {
5710
+ if (Je.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(Je.content) === JSON.stringify(x.toJSON())) {
5604
5711
  s.setNodeMarkup(y, void 0, {
5605
- ...C.attrs,
5712
+ ...v.attrs,
5606
5713
  [d]: "initialBlockId"
5607
5714
  });
5608
5715
  return;
5609
5716
  }
5610
5717
  }
5611
5718
  s.setNodeMarkup(y, void 0, {
5612
- ...C.attrs,
5719
+ ...v.attrs,
5613
5720
  [d]: c()
5614
5721
  });
5615
5722
  return;
5616
5723
  }
5617
5724
  const { deleted: ge } = h.invert().mapResult(y);
5618
- ge && k.includes(J) && s.setNodeMarkup(y, void 0, {
5619
- ...C.attrs,
5725
+ ge && k.includes(Y) && s.setNodeMarkup(y, void 0, {
5726
+ ...v.attrs,
5620
5727
  [d]: c()
5621
5728
  });
5622
5729
  });
@@ -5689,7 +5796,7 @@ const ue = L.create({
5689
5796
  function it(e) {
5690
5797
  return e.type === "link";
5691
5798
  }
5692
- function St(e) {
5799
+ function Bt(e) {
5693
5800
  return typeof e != "string" && e.type === "link";
5694
5801
  }
5695
5802
  function de(e) {
@@ -5747,10 +5854,10 @@ function H(e, t, o, i) {
5747
5854
  for (const r of e)
5748
5855
  typeof r == "string" ? n.push(
5749
5856
  ...He(r, t, o, i)
5750
- ) : St(r) ? n.push(..._i(r, t, o)) : de(r) ? n.push(
5857
+ ) : Bt(r) ? n.push(..._i(r, t, o)) : de(r) ? n.push(
5751
5858
  ...He([r], t, o, i)
5752
5859
  ) : n.push(
5753
- Bt(r, t, o)
5860
+ Tt(r, t, o)
5754
5861
  );
5755
5862
  return n;
5756
5863
  }
@@ -5789,7 +5896,7 @@ function Ce(e, t, o) {
5789
5896
  }
5790
5897
  return i;
5791
5898
  }
5792
- function Bt(e, t, o) {
5899
+ function Tt(e, t, o) {
5793
5900
  let i, n = e.type;
5794
5901
  if (n === void 0 && (n = "paragraph"), !t.nodes[n])
5795
5902
  throw new Error(`node type ${n} not found in schema`);
@@ -5818,16 +5925,16 @@ function Bt(e, t, o) {
5818
5925
  throw new D(e.content.type);
5819
5926
  return i;
5820
5927
  }
5821
- function Z(e, t, o) {
5928
+ function J(e, t, o) {
5822
5929
  let i = e.id;
5823
5930
  i === void 0 && (i = ue.options.generateID());
5824
5931
  const n = [];
5825
5932
  if (e.children)
5826
5933
  for (const a of e.children)
5827
- n.push(Z(a, t, o));
5828
- const r = t.nodes[e.type];
5829
- if (r.isInGroup("blockContent")) {
5830
- const a = Bt(
5934
+ n.push(J(a, t, o));
5935
+ if (!e.type || // can happen if block.type is not defined (this should create the default node)
5936
+ t.nodes[e.type].isInGroup("blockContent")) {
5937
+ const a = Tt(
5831
5938
  e,
5832
5939
  t,
5833
5940
  o
@@ -5840,7 +5947,7 @@ function Z(e, t, o) {
5840
5947
  s ? [a, s] : a
5841
5948
  );
5842
5949
  } else {
5843
- if (r.isInGroup("bnBlock"))
5950
+ if (t.nodes[e.type].isInGroup("bnBlock"))
5844
5951
  return t.nodes[e.type].createChecked(
5845
5952
  {
5846
5953
  id: i,
@@ -5853,13 +5960,13 @@ function Z(e, t, o) {
5853
5960
  );
5854
5961
  }
5855
5962
  }
5856
- function Tt(e) {
5963
+ function Mt(e) {
5857
5964
  const t = [...e.classList].filter(
5858
5965
  (o) => !o.startsWith("bn-")
5859
5966
  ) || [];
5860
5967
  t.length > 0 ? e.className = t.join(" ") : e.removeAttribute("class");
5861
5968
  }
5862
- function Mt(e, t, o, i) {
5969
+ function It(e, t, o, i) {
5863
5970
  let n;
5864
5971
  if (t)
5865
5972
  if (typeof t == "string")
@@ -5884,18 +5991,18 @@ function Mt(e, t, o, i) {
5884
5991
  throw new D(t.type);
5885
5992
  else throw new Error("blockContent is required");
5886
5993
  const r = o.serializeFragment(j.from(n), i);
5887
- return r.nodeType === 1 && Tt(r), r;
5994
+ return r.nodeType === 1 && Mt(r), r;
5888
5995
  }
5889
5996
  function yi(e, t, o, i, n, r, a) {
5890
- var g, b, k, C, y, P, J, ge;
5997
+ var g, b, k, v, y, P, Y, ge;
5891
5998
  const s = (a == null ? void 0 : a.document) ?? document, l = t.pmSchema.nodes.blockContainer;
5892
5999
  let d = o.props;
5893
6000
  if (!o.props) {
5894
6001
  d = {};
5895
- for (const [E, w] of Object.entries(
6002
+ for (const [E, x] of Object.entries(
5896
6003
  t.schema.blockSchema[o.type].propSchema
5897
6004
  ))
5898
- w.default !== void 0 && (d[E] = w.default);
6005
+ x.default !== void 0 && (d[E] = x.default);
5899
6006
  }
5900
6007
  const u = [...((b = (g = l.spec) == null ? void 0 : g.toDOM) == null ? void 0 : b.call(
5901
6008
  g,
@@ -5906,15 +6013,15 @@ function yi(e, t, o, i, n, r, a) {
5906
6013
  )).dom.attributes], h = t.blockImplementations[o.type].implementation.toExternalHTML({ ...o, props: d }, t), m = s.createDocumentFragment();
5907
6014
  if (h.dom.classList.contains("bn-block-content")) {
5908
6015
  const E = [...u, ...h.dom.attributes].filter(
5909
- (w) => w.name.startsWith("data") && w.name !== "data-content-type" && w.name !== "data-file-block" && w.name !== "data-node-view-wrapper" && w.name !== "data-node-type" && w.name !== "data-id" && w.name !== "data-index" && w.name !== "data-editable"
6016
+ (x) => x.name.startsWith("data") && x.name !== "data-content-type" && x.name !== "data-file-block" && x.name !== "data-node-view-wrapper" && x.name !== "data-node-type" && x.name !== "data-id" && x.name !== "data-index" && x.name !== "data-editable"
5910
6017
  );
5911
- for (const w of E)
5912
- h.dom.firstChild.setAttribute(w.name, w.value);
5913
- Tt(h.dom.firstChild), m.append(...h.dom.childNodes);
6018
+ for (const x of E)
6019
+ h.dom.firstChild.setAttribute(x.name, x.value);
6020
+ Mt(h.dom.firstChild), m.append(...h.dom.childNodes);
5914
6021
  } else
5915
6022
  m.append(h.dom);
5916
6023
  if (h.contentDOM && o.content) {
5917
- const E = Mt(
6024
+ const E = It(
5918
6025
  t,
5919
6026
  o.content,
5920
6027
  // TODO
@@ -5926,8 +6033,8 @@ function yi(e, t, o, i, n, r, a) {
5926
6033
  let f;
5927
6034
  if (n.has(o.type) ? f = "OL" : r.has(o.type) && (f = "UL"), f) {
5928
6035
  if (((k = e.lastChild) == null ? void 0 : k.nodeName) !== f) {
5929
- const w = s.createElement(f);
5930
- f === "OL" && (d != null && d.start) && (d == null ? void 0 : d.start) !== 1 && w.setAttribute("start", d.start + ""), e.append(w);
6036
+ const x = s.createElement(f);
6037
+ f === "OL" && (d != null && d.start) && (d == null ? void 0 : d.start) !== 1 && x.setAttribute("start", d.start + ""), e.append(x);
5931
6038
  }
5932
6039
  const E = s.createElement("li");
5933
6040
  E.append(m), e.lastChild.appendChild(E);
@@ -5935,7 +6042,7 @@ function yi(e, t, o, i, n, r, a) {
5935
6042
  e.append(m);
5936
6043
  if (o.children && o.children.length > 0) {
5937
6044
  const E = s.createDocumentFragment();
5938
- if (It(
6045
+ if (Lt(
5939
6046
  E,
5940
6047
  t,
5941
6048
  o.children,
@@ -5943,13 +6050,13 @@ function yi(e, t, o, i, n, r, a) {
5943
6050
  n,
5944
6051
  r,
5945
6052
  a
5946
- ), ((C = e.lastChild) == null ? void 0 : C.nodeName) === "UL" || ((y = e.lastChild) == null ? void 0 : y.nodeName) === "OL")
5947
- for (; ((P = E.firstChild) == null ? void 0 : P.nodeName) === "UL" || ((J = E.firstChild) == null ? void 0 : J.nodeName) === "OL"; )
6053
+ ), ((v = e.lastChild) == null ? void 0 : v.nodeName) === "UL" || ((y = e.lastChild) == null ? void 0 : y.nodeName) === "OL")
6054
+ for (; ((P = E.firstChild) == null ? void 0 : P.nodeName) === "UL" || ((Y = E.firstChild) == null ? void 0 : Y.nodeName) === "OL"; )
5948
6055
  e.lastChild.lastChild.appendChild(E.firstChild);
5949
6056
  t.pmSchema.nodes[o.type].isInGroup("blockContent") ? e.append(E) : (ge = h.contentDOM) == null || ge.append(E);
5950
6057
  }
5951
6058
  }
5952
- const It = (e, t, o, i, n, r, a) => {
6059
+ const Lt = (e, t, o, i, n, r, a) => {
5953
6060
  for (const s of o)
5954
6061
  yi(
5955
6062
  e,
@@ -5962,7 +6069,7 @@ const It = (e, t, o, i, n, r, a) => {
5962
6069
  );
5963
6070
  }, vi = (e, t, o, i, n, r) => {
5964
6071
  const s = ((r == null ? void 0 : r.document) ?? document).createDocumentFragment();
5965
- return It(
6072
+ return Lt(
5966
6073
  s,
5967
6074
  e,
5968
6075
  t,
@@ -5986,7 +6093,7 @@ const It = (e, t, o, i, n, r, a) => {
5986
6093
  return a.append(r), a.innerHTML;
5987
6094
  },
5988
6095
  exportInlineContent: (i, n) => {
5989
- const r = Mt(
6096
+ const r = It(
5990
6097
  t,
5991
6098
  i,
5992
6099
  o,
@@ -6049,7 +6156,7 @@ function xi(e, t, o, i, n) {
6049
6156
  }
6050
6157
  if (e.pmSchema.nodes[t.type].isInGroup("bnBlock")) {
6051
6158
  if (t.children && t.children.length > 0) {
6052
- const b = Lt(
6159
+ const b = At(
6053
6160
  e,
6054
6161
  t.children,
6055
6162
  o,
@@ -6067,10 +6174,10 @@ function xi(e, t, o, i, n) {
6067
6174
  })
6068
6175
  );
6069
6176
  return (f = c.contentDOM) == null || f.appendChild(l.dom), t.children && t.children.length > 0 && ((g = c.contentDOM) == null || g.appendChild(
6070
- At(e, t.children, o, n)
6177
+ Pt(e, t.children, o, n)
6071
6178
  )), c.dom;
6072
6179
  }
6073
- function Lt(e, t, o, i) {
6180
+ function At(e, t, o, i) {
6074
6181
  const r = ((i == null ? void 0 : i.document) ?? document).createDocumentFragment();
6075
6182
  let a = 0;
6076
6183
  for (const s of t) {
@@ -6086,14 +6193,14 @@ function Lt(e, t, o, i) {
6086
6193
  }
6087
6194
  return r;
6088
6195
  }
6089
- const At = (e, t, o, i) => {
6196
+ const Pt = (e, t, o, i) => {
6090
6197
  var s;
6091
- const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = Lt(e, t, o, i);
6198
+ const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = At(e, t, o, i);
6092
6199
  return (s = r.contentDOM) == null || s.appendChild(a), r.dom;
6093
6200
  }, Ci = (e, t) => {
6094
6201
  const o = vt.fromSchema(e);
6095
6202
  return {
6096
- serializeBlocks: (i, n) => At(t, i, o, n).outerHTML
6203
+ serializeBlocks: (i, n) => Pt(t, i, o, n).outerHTML
6097
6204
  };
6098
6205
  };
6099
6206
  function z(e, t) {
@@ -6229,7 +6336,7 @@ function R(e, t, o, i) {
6229
6336
  };
6230
6337
  }
6231
6338
  const rt = (e, t) => {
6232
- let o = Z(e, t.pmSchema, t.schema.styleSchema);
6339
+ let o = J(e, t.pmSchema, t.schema.styleSchema);
6233
6340
  o.type.name === "blockContainer" && (o = o.firstChild);
6234
6341
  const i = t.pmSchema.nodes[o.type.name].spec.toDOM;
6235
6342
  if (i === void 0)
@@ -6242,7 +6349,7 @@ const rt = (e, t) => {
6242
6349
  "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."
6243
6350
  );
6244
6351
  return n;
6245
- }, x = {
6352
+ }, C = {
6246
6353
  backgroundColor: {
6247
6354
  default: "default"
6248
6355
  },
@@ -6253,7 +6360,7 @@ const rt = (e, t) => {
6253
6360
  default: "left",
6254
6361
  values: ["left", "center", "right", "justify"]
6255
6362
  }
6256
- }, Pt = ["backgroundColor", "textColor"];
6363
+ }, Nt = ["backgroundColor", "textColor"];
6257
6364
  function ye(e) {
6258
6365
  return "data-" + e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
6259
6366
  }
@@ -6264,7 +6371,7 @@ function ls(e) {
6264
6371
  }
6265
6372
  function he(e) {
6266
6373
  const t = {};
6267
- return Object.entries(e).filter(([o, i]) => !Pt.includes(o)).forEach(([o, i]) => {
6374
+ return Object.entries(e).filter(([o, i]) => !Nt.includes(o)).forEach(([o, i]) => {
6268
6375
  t[o] = {
6269
6376
  default: i.default,
6270
6377
  keepOnSplit: !0,
@@ -6313,7 +6420,7 @@ function be(e, t, o, i, n = !1, r) {
6313
6420
  ), a.setAttribute("data-content-type", t);
6314
6421
  for (const [s, l] of Object.entries(o)) {
6315
6422
  const c = i[s].default;
6316
- !Pt.includes(s) && l !== c && a.setAttribute(ye(s), l);
6423
+ !Nt.includes(s) && l !== c && a.setAttribute(ye(s), l);
6317
6424
  }
6318
6425
  return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = G(
6319
6426
  "bn-inline-content",
@@ -6324,16 +6431,16 @@ function be(e, t, o, i, n = !1, r) {
6324
6431
  };
6325
6432
  }
6326
6433
  function $(e) {
6327
- return X.create(e);
6434
+ return Z.create(e);
6328
6435
  }
6329
- function Nt(e, t) {
6436
+ function jt(e, t) {
6330
6437
  return {
6331
6438
  config: e,
6332
6439
  implementation: t
6333
6440
  };
6334
6441
  }
6335
6442
  function W(e, t, o) {
6336
- return Nt(
6443
+ return jt(
6337
6444
  {
6338
6445
  type: e.name,
6339
6446
  content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
@@ -6348,7 +6455,7 @@ function W(e, t, o) {
6348
6455
  }
6349
6456
  );
6350
6457
  }
6351
- function jt(e) {
6458
+ function Dt(e) {
6352
6459
  return Object.fromEntries(
6353
6460
  Object.entries(e).map(([t, o]) => [t, o.config])
6354
6461
  );
@@ -6425,7 +6532,7 @@ function me(e, t) {
6425
6532
  throw new Error(
6426
6533
  "Node name does not match block type. This is a bug in BlockNote."
6427
6534
  );
6428
- return Nt(e, {
6535
+ return jt(e, {
6429
6536
  node: o,
6430
6537
  toInternalHTML: (i, n) => {
6431
6538
  var s;
@@ -6459,7 +6566,7 @@ function me(e, t) {
6459
6566
  }
6460
6567
  });
6461
6568
  }
6462
- function Dt(e, t, o) {
6569
+ function Ht(e, t, o) {
6463
6570
  const i = {
6464
6571
  type: "tableContent",
6465
6572
  columnWidths: [],
@@ -6506,7 +6613,11 @@ function Se(e, t, o) {
6506
6613
  };
6507
6614
  return;
6508
6615
  }
6509
- if (r.type.name !== "link" && r.type.name !== "text" && t[r.type.name]) {
6616
+ if (r.type.name !== "link" && r.type.name !== "text") {
6617
+ if (!t[r.type.name]) {
6618
+ console.warn("unrecognized inline content type", r.type.name);
6619
+ return;
6620
+ }
6510
6621
  n && (i.push(n), n = void 0), i.push(
6511
6622
  Ue(r, t, o)
6512
6623
  );
@@ -6519,8 +6630,11 @@ function Se(e, t, o) {
6519
6630
  s = l;
6520
6631
  else {
6521
6632
  const d = o[l.type.name];
6522
- if (!d)
6633
+ if (!d) {
6634
+ if (l.type.spec.blocknoteIgnore)
6635
+ continue;
6523
6636
  throw new Error(`style ${l.type.name} not found in styleSchema`);
6637
+ }
6524
6638
  if (d.propSchema === "boolean")
6525
6639
  a[d.type] = !0;
6526
6640
  else if (d.propSchema === "string")
@@ -6600,7 +6714,7 @@ function Ue(e, t, o) {
6600
6714
  content: r
6601
6715
  };
6602
6716
  }
6603
- function v(e, t, o, i, n) {
6717
+ function w(e, t, o, i, n) {
6604
6718
  var f;
6605
6719
  if (!e.type.isInGroup("bnBlock"))
6606
6720
  throw Error(
@@ -6626,7 +6740,7 @@ function v(e, t, o, i, n) {
6626
6740
  const c = t[a.blockNoteType], u = [];
6627
6741
  (f = a.childContainer) == null || f.node.forEach((g) => {
6628
6742
  u.push(
6629
- v(
6743
+ w(
6630
6744
  g,
6631
6745
  t,
6632
6746
  o,
@@ -6647,7 +6761,7 @@ function v(e, t, o, i, n) {
6647
6761
  } else if (c.content === "table") {
6648
6762
  if (!a.isBlockContainer)
6649
6763
  throw new Error("impossible");
6650
- h = Dt(
6764
+ h = Ht(
6651
6765
  a.blockContent.node,
6652
6766
  o,
6653
6767
  i
@@ -6697,7 +6811,7 @@ function Li(e, t) {
6697
6811
  }
6698
6812
  );
6699
6813
  }
6700
- function Ht(e) {
6814
+ function Ut(e) {
6701
6815
  return Object.fromEntries(
6702
6816
  Object.entries(e).map(([t, o]) => [t, o.config])
6703
6817
  );
@@ -6714,7 +6828,7 @@ function Ai(e) {
6714
6828
  ];
6715
6829
  }
6716
6830
  function ds(e, t) {
6717
- const o = X.create({
6831
+ const o = Z.create({
6718
6832
  name: e.type,
6719
6833
  inline: !0,
6720
6834
  group: "inline",
@@ -6805,14 +6919,14 @@ function Pi(e) {
6805
6919
  function Ni(e, t, o, i) {
6806
6920
  return e.dom.setAttribute("data-style-type", t), i === "string" && e.dom.setAttribute("data-value", o), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
6807
6921
  }
6808
- function Ut(e, t) {
6922
+ function Ot(e, t) {
6809
6923
  return {
6810
6924
  config: e,
6811
6925
  implementation: t
6812
6926
  };
6813
6927
  }
6814
6928
  function K(e, t) {
6815
- return Ut(
6929
+ return Ot(
6816
6930
  {
6817
6931
  type: e.name,
6818
6932
  propSchema: t
@@ -6822,7 +6936,7 @@ function K(e, t) {
6822
6936
  }
6823
6937
  );
6824
6938
  }
6825
- function Ot(e) {
6939
+ function Rt(e) {
6826
6940
  return Object.fromEntries(
6827
6941
  Object.entries(e).map(([t, o]) => [t, o.config])
6828
6942
  );
@@ -6863,7 +6977,7 @@ function cs(e, t) {
6863
6977
  );
6864
6978
  }
6865
6979
  });
6866
- return Ut(e, {
6980
+ return Ot(e, {
6867
6981
  mark: o
6868
6982
  });
6869
6983
  }
@@ -6965,7 +7079,7 @@ const Be = (e, t) => {
6965
7079
  dom: o
6966
7080
  };
6967
7081
  }, st = (e) => ({ url: e.src || void 0 }), Oi = '<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>', Ri = {
6968
- backgroundColor: x.backgroundColor,
7082
+ backgroundColor: C.backgroundColor,
6969
7083
  // File name.
6970
7084
  name: {
6971
7085
  default: ""
@@ -7028,13 +7142,13 @@ const Be = (e, t) => {
7028
7142
  render: zi,
7029
7143
  parse: Fi,
7030
7144
  toExternalHTML: Gi
7031
- }), Rt = [
7145
+ }), Vt = [
7032
7146
  {
7033
7147
  id: "text",
7034
7148
  name: "Plain Text",
7035
7149
  match: ["text", "txt", "plain"]
7036
7150
  },
7037
- ...Ct.filter((e) => [
7151
+ ...Et.filter((e) => [
7038
7152
  "c",
7039
7153
  "cpp",
7040
7154
  "css",
@@ -7136,9 +7250,9 @@ const Be = (e, t) => {
7136
7250
  ), Oe = {
7137
7251
  language: {
7138
7252
  default: "javascript",
7139
- values: [...Rt.map((e) => e.id)]
7253
+ values: [...Vt.map((e) => e.id)]
7140
7254
  }
7141
- }, Vt = $({
7255
+ }, zt = $({
7142
7256
  name: "codeBlock",
7143
7257
  content: "inline*",
7144
7258
  group: "blockContent",
@@ -7149,7 +7263,7 @@ const Be = (e, t) => {
7149
7263
  return {
7150
7264
  defaultLanguage: "javascript",
7151
7265
  indentLineWithTab: !0,
7152
- supportedLanguages: Rt
7266
+ supportedLanguages: Vt
7153
7267
  };
7154
7268
  },
7155
7269
  addAttributes() {
@@ -7249,7 +7363,7 @@ const Be = (e, t) => {
7249
7363
  }
7250
7364
  );
7251
7365
  const s = a.language;
7252
- return s && s !== "text" && !o.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) && Ct.find(({ id: l }) => l === s) ? o.loadLanguage(s) : (i || (i = t[lt] || Ao(o), t[lt] = i), i(a));
7366
+ return s && s !== "text" && !o.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) && Et.find(({ id: l }) => l === s) ? o.loadLanguage(s) : (i || (i = t[lt] || Ao(o), t[lt] = i), i(a));
7253
7367
  },
7254
7368
  languageExtractor: (a) => a.attrs.language,
7255
7369
  nodeTypes: [this.name]
@@ -7258,7 +7372,7 @@ const Be = (e, t) => {
7258
7372
  addInputRules() {
7259
7373
  const e = this.options.supportedLanguages;
7260
7374
  return [
7261
- new te({
7375
+ new oe({
7262
7376
  find: /^```(.*?)\s$/,
7263
7377
  handler: ({ state: t, range: o, match: i }) => {
7264
7378
  var s;
@@ -7309,13 +7423,13 @@ const Be = (e, t) => {
7309
7423
  };
7310
7424
  }
7311
7425
  }), Wi = W(
7312
- Vt,
7426
+ zt,
7313
7427
  Oe
7314
7428
  );
7315
7429
  function us(e) {
7316
7430
  var t;
7317
7431
  return W(
7318
- Vt.configure(e),
7432
+ zt.configure(e),
7319
7433
  {
7320
7434
  language: {
7321
7435
  default: e.defaultLanguage || Oe.language.default,
@@ -7403,7 +7517,7 @@ const Ki = {
7403
7517
  return ["span", e, 0];
7404
7518
  }
7405
7519
  }), tn = K(en, "string"), dt = (e) => ({ url: e.src || void 0 }), on = {
7406
- backgroundColor: x.backgroundColor,
7520
+ backgroundColor: C.backgroundColor,
7407
7521
  // File name.
7408
7522
  name: {
7409
7523
  default: ""
@@ -7470,7 +7584,7 @@ const Ki = {
7470
7584
  else if (!r.isBlockContainer && s.isInGroup("bnBlock"))
7471
7585
  ct(o, i, e, r);
7472
7586
  else {
7473
- const d = v(
7587
+ const d = w(
7474
7588
  r.bnBlock.node,
7475
7589
  e.schema.blockSchema,
7476
7590
  e.schema.inlineContentSchema,
@@ -7480,7 +7594,7 @@ const Ki = {
7480
7594
  return i.tr.replaceWith(
7481
7595
  r.bnBlock.beforePos,
7482
7596
  r.bnBlock.afterPos,
7483
- Z(
7597
+ J(
7484
7598
  {
7485
7599
  children: d.children,
7486
7600
  // if no children are passed in, use existing children
@@ -7546,7 +7660,7 @@ function dn(e, t, o, i, n, r) {
7546
7660
  }
7547
7661
  function ct(e, t, o, i) {
7548
7662
  if (e.children !== void 0) {
7549
- const n = e.children.map((r) => Z(r, t.schema, o.schema.styleSchema));
7663
+ const n = e.children.map((r) => J(r, t.schema, o.schema.styleSchema));
7550
7664
  if (i.childContainer)
7551
7665
  t.tr.step(
7552
7666
  new Oo(
@@ -7575,7 +7689,7 @@ function cn(e, t, o) {
7575
7689
  o
7576
7690
  )({ state: s, dispatch: l }), !0));
7577
7691
  const a = i.state.doc.resolve(r.posBeforeNode + 1).node();
7578
- return v(
7692
+ return w(
7579
7693
  a,
7580
7694
  e.schema.blockSchema,
7581
7695
  e.schema.inlineContentSchema,
@@ -7583,19 +7697,19 @@ function cn(e, t, o) {
7583
7697
  e.blockCache
7584
7698
  );
7585
7699
  }
7586
- const zt = {
7587
- ...x,
7700
+ const Ft = {
7701
+ ...C,
7588
7702
  level: { default: 1, values: [1, 2, 3] }
7589
7703
  }, un = $({
7590
7704
  name: "heading",
7591
7705
  content: "inline*",
7592
7706
  group: "blockContent",
7593
7707
  addAttributes() {
7594
- return he(zt);
7708
+ return he(Ft);
7595
7709
  },
7596
7710
  addInputRules() {
7597
7711
  return [
7598
- ...[1, 2, 3].map((e) => new te({
7712
+ ...[1, 2, 3].map((e) => new oe({
7599
7713
  find: new RegExp(`^(#{${e}})\\s$`),
7600
7714
  handler: ({ state: t, chain: o, range: i }) => {
7601
7715
  const n = _(t);
@@ -7688,8 +7802,8 @@ const zt = {
7688
7802
  }
7689
7803
  }), pn = W(
7690
7804
  un,
7691
- zt
7692
- ), Ft = (e, t, o, i, n, r) => {
7805
+ Ft
7806
+ ), Gt = (e, t, o, i, n, r) => {
7693
7807
  const { dom: a, destroy: s } = $e(
7694
7808
  e,
7695
7809
  t,
@@ -7726,7 +7840,7 @@ const zt = {
7726
7840
  initialWidth: l.clientWidth,
7727
7841
  initialClientX: y.clientX
7728
7842
  };
7729
- }, C = (y) => {
7843
+ }, v = (y) => {
7730
7844
  y.preventDefault(), u = {
7731
7845
  handleUsed: "right",
7732
7846
  initialWidth: l.clientWidth,
@@ -7738,7 +7852,7 @@ const zt = {
7738
7852
  k
7739
7853
  ), c.addEventListener(
7740
7854
  "mousedown",
7741
- C
7855
+ v
7742
7856
  ), {
7743
7857
  dom: l,
7744
7858
  destroy: () => {
@@ -7747,7 +7861,7 @@ const zt = {
7747
7861
  k
7748
7862
  ), c.removeEventListener(
7749
7863
  "mousedown",
7750
- C
7864
+ v
7751
7865
  );
7752
7866
  }
7753
7867
  };
@@ -7755,8 +7869,8 @@ const zt = {
7755
7869
  const t = e.src || void 0, o = e.width || void 0;
7756
7870
  return { url: t, previewWidth: o };
7757
7871
  }, hn = '<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>', mn = {
7758
- textAlignment: x.textAlignment,
7759
- backgroundColor: x.backgroundColor,
7872
+ textAlignment: C.textAlignment,
7873
+ backgroundColor: C.backgroundColor,
7760
7874
  // File name.
7761
7875
  name: {
7762
7876
  default: ""
@@ -7790,7 +7904,7 @@ const zt = {
7790
7904
  const n = document.createElement("img");
7791
7905
  return n.className = "bn-visual-media", t.resolveFileUrl ? t.resolveFileUrl(e.props.url).then((r) => {
7792
7906
  n.src = r;
7793
- }) : n.src = e.props.url, n.alt = e.props.name || e.props.caption || "BlockNote image", n.contentEditable = "false", n.draggable = !1, i.appendChild(n), Ft(
7907
+ }) : n.src = e.props.url, n.alt = e.props.name || e.props.caption || "BlockNote image", n.contentEditable = "false", n.draggable = !1, i.appendChild(n), Gt(
7794
7908
  e,
7795
7909
  t,
7796
7910
  { dom: i },
@@ -7826,7 +7940,7 @@ const zt = {
7826
7940
  render: gn,
7827
7941
  parse: bn,
7828
7942
  toExternalHTML: kn
7829
- }), Gt = (e, t, o) => ({
7943
+ }), $t = (e, t, o) => ({
7830
7944
  state: i,
7831
7945
  dispatch: n
7832
7946
  }) => {
@@ -7865,11 +7979,11 @@ const zt = {
7865
7979
  () => (
7866
7980
  // Splits the current block, moving content inside that's after the cursor
7867
7981
  // to a new block of the same type below.
7868
- l.command(() => n.node.childCount > 0 ? (s().deleteSelection().command(Gt(a.selection.from, !0)).run(), !0) : !1)
7982
+ l.command(() => n.node.childCount > 0 ? (s().deleteSelection().command($t(a.selection.from, !0)).run(), !0) : !1)
7869
7983
  )
7870
7984
  ]);
7871
7985
  }, yn = {
7872
- ...x
7986
+ ...C
7873
7987
  }, vn = $({
7874
7988
  name: "bulletListItem",
7875
7989
  content: "inline*",
@@ -7880,7 +7994,7 @@ const zt = {
7880
7994
  addInputRules() {
7881
7995
  return [
7882
7996
  // Creates an unordered list when starting with "-", "+", or "*".
7883
- new te({
7997
+ new oe({
7884
7998
  find: new RegExp("^[-+*]\\s$"),
7885
7999
  handler: ({ state: e, chain: t, range: o }) => {
7886
8000
  const i = _(e);
@@ -7960,8 +8074,8 @@ const zt = {
7960
8074
  }), wn = W(
7961
8075
  vn,
7962
8076
  yn
7963
- ), $t = {
7964
- ...x,
8077
+ ), Wt = {
8078
+ ...C,
7965
8079
  checked: {
7966
8080
  default: !1
7967
8081
  }
@@ -7970,12 +8084,12 @@ const zt = {
7970
8084
  content: "inline*",
7971
8085
  group: "blockContent",
7972
8086
  addAttributes() {
7973
- return he($t);
8087
+ return he(Wt);
7974
8088
  },
7975
8089
  addInputRules() {
7976
8090
  return [
7977
8091
  // Creates a checklist when starting with "[]" or "[X]".
7978
- new te({
8092
+ new oe({
7979
8093
  find: new RegExp("\\[\\s*\\]\\s$"),
7980
8094
  handler: ({ state: e, chain: t, range: o }) => {
7981
8095
  const i = _(e);
@@ -7993,7 +8107,7 @@ const zt = {
7993
8107
  ).deleteRange({ from: o.from, to: o.to });
7994
8108
  }
7995
8109
  }),
7996
- new te({
8110
+ new oe({
7997
8111
  find: new RegExp("\\[[Xx]\\]\\s$"),
7998
8112
  handler: ({ state: e, chain: t, range: o }) => {
7999
8113
  const i = _(e);
@@ -8141,7 +8255,7 @@ const zt = {
8141
8255
  }
8142
8256
  }), Cn = W(
8143
8257
  xn,
8144
- $t
8258
+ Wt
8145
8259
  ), En = new N("numbered-list-indexing"), Sn = () => new B({
8146
8260
  key: En,
8147
8261
  appendTransaction: (e, t, o) => {
@@ -8188,8 +8302,8 @@ const zt = {
8188
8302
  }
8189
8303
  }), n ? i : null;
8190
8304
  }
8191
- }), Wt = {
8192
- ...x,
8305
+ }), Kt = {
8306
+ ...C,
8193
8307
  start: { default: void 0, type: "number" }
8194
8308
  }, Bn = $({
8195
8309
  name: "numberedListItem",
@@ -8198,7 +8312,7 @@ const zt = {
8198
8312
  priority: 90,
8199
8313
  addAttributes() {
8200
8314
  return {
8201
- ...he(Wt),
8315
+ ...he(Kt),
8202
8316
  // the index attribute is only used internally (it's not part of the blocknote schema)
8203
8317
  // that's why it's defined explicitly here, and not part of the prop schema
8204
8318
  index: {
@@ -8213,7 +8327,7 @@ const zt = {
8213
8327
  addInputRules() {
8214
8328
  return [
8215
8329
  // Creates an ordered list when starting with "1.".
8216
- new te({
8330
+ new oe({
8217
8331
  find: new RegExp("^(\\d+)\\.\\s$"),
8218
8332
  handler: ({ state: e, chain: t, range: o, match: i }) => {
8219
8333
  const n = _(e);
@@ -8310,9 +8424,9 @@ const zt = {
8310
8424
  }
8311
8425
  }), Tn = W(
8312
8426
  Bn,
8313
- Wt
8427
+ Kt
8314
8428
  ), Mn = {
8315
- ...x
8429
+ ...C
8316
8430
  }, In = $({
8317
8431
  name: "paragraph",
8318
8432
  content: "inline*",
@@ -8359,12 +8473,12 @@ const zt = {
8359
8473
  }), Ln = W(
8360
8474
  In,
8361
8475
  Mn
8362
- ), An = 35, Kt = 120, ps = 31, Pn = L.create({
8476
+ ), An = 35, qt = 120, ps = 31, Pn = L.create({
8363
8477
  name: "BlockNoteTableExtension",
8364
8478
  addProseMirrorPlugins: () => [
8365
8479
  Fo({
8366
8480
  cellMinWidth: An,
8367
- defaultCellMinWidth: Kt,
8481
+ defaultCellMinWidth: qt,
8368
8482
  // We set this to null as we implement our own node view in the table
8369
8483
  // block content. This node view is the same as what's used by default,
8370
8484
  // but is wrapped in a `blockContent` HTML element.
@@ -8398,13 +8512,13 @@ const zt = {
8398
8512
  storage: e.storage
8399
8513
  };
8400
8514
  return {
8401
- tableRole: wo(
8402
- xo(e, "tableRole", t)
8515
+ tableRole: xo(
8516
+ Co(e, "tableRole", t)
8403
8517
  )
8404
8518
  };
8405
8519
  }
8406
8520
  }), Nn = {
8407
- textColor: x.textColor
8521
+ textColor: C.textColor
8408
8522
  }, jn = $({
8409
8523
  name: "table",
8410
8524
  content: "tableRow+",
@@ -8457,13 +8571,13 @@ const zt = {
8457
8571
  return !r.target.closest(".tableWrapper-inner") || super.ignoreMutation(r);
8458
8572
  }
8459
8573
  }
8460
- return new o(e, Kt, {
8574
+ return new o(e, qt, {
8461
8575
  ...((i = this.options.domAttributes) == null ? void 0 : i.blockContent) || {},
8462
8576
  ...t
8463
8577
  });
8464
8578
  };
8465
8579
  }
8466
- }), Dn = X.create({
8580
+ }), Dn = Z.create({
8467
8581
  name: "tableParagraph",
8468
8582
  group: "tableContent",
8469
8583
  content: "inline*",
@@ -8510,8 +8624,8 @@ const zt = {
8510
8624
  const t = e.src || void 0, o = e.width || void 0;
8511
8625
  return { url: t, previewWidth: o };
8512
8626
  }, Un = '<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>', On = {
8513
- textAlignment: x.textAlignment,
8514
- backgroundColor: x.backgroundColor,
8627
+ textAlignment: C.textAlignment,
8628
+ backgroundColor: C.backgroundColor,
8515
8629
  // File name.
8516
8630
  name: {
8517
8631
  default: ""
@@ -8545,7 +8659,7 @@ const zt = {
8545
8659
  const n = document.createElement("video");
8546
8660
  return n.className = "bn-visual-media", t.resolveFileUrl ? t.resolveFileUrl(e.props.url).then((r) => {
8547
8661
  n.src = r;
8548
- }) : n.src = e.props.url, n.controls = !0, n.contentEditable = "false", n.draggable = !1, n.width = e.props.previewWidth, i.appendChild(n), Ft(
8662
+ }) : n.src = e.props.url, n.controls = !0, n.contentEditable = "false", n.draggable = !1, n.width = e.props.previewWidth, i.appendChild(n), Gt(
8549
8663
  e,
8550
8664
  t,
8551
8665
  { dom: i },
@@ -8581,7 +8695,7 @@ const zt = {
8581
8695
  render: Vn,
8582
8696
  parse: zn,
8583
8697
  toExternalHTML: Fn
8584
- }), qt = {
8698
+ }), Xt = {
8585
8699
  paragraph: Ln,
8586
8700
  heading: pn,
8587
8701
  codeBlock: Wi,
@@ -8593,7 +8707,7 @@ const zt = {
8593
8707
  image: _n,
8594
8708
  video: Gn,
8595
8709
  audio: $i
8596
- }, $n = jt(qt), Xt = {
8710
+ }, $n = Dt(Xt), Zt = {
8597
8711
  bold: K(No, "boolean"),
8598
8712
  italic: K(Do, "boolean"),
8599
8713
  underline: K(Uo, "boolean"),
@@ -8601,11 +8715,11 @@ const zt = {
8601
8715
  code: K(jo, "boolean"),
8602
8716
  textColor: tn,
8603
8717
  backgroundColor: Qi
8604
- }, hs = Ot(Xt), Zt = {
8718
+ }, hs = Rt(Zt), Jt = {
8605
8719
  text: { config: "text", implementation: {} },
8606
8720
  link: { config: "link", implementation: {} }
8607
- }, Wn = Ht(
8608
- Zt
8721
+ }, Wn = Ut(
8722
+ Jt
8609
8723
  );
8610
8724
  function I(e, t) {
8611
8725
  return e in t.schema.blockSchema && t.schema.blockSchema[e] === $n[e];
@@ -8626,7 +8740,7 @@ function gs(e, t) {
8626
8740
  return t.schema.blockSchema[e.type].isFileBlock && !e.props.url;
8627
8741
  }
8628
8742
  function Xn(e, t, o) {
8629
- return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === x[e];
8743
+ return t in o.schema.blockSchema && e in o.schema.blockSchema[t].propSchema && o.schema.blockSchema[t].propSchema[e] === C[e];
8630
8744
  }
8631
8745
  function bs(e, t, o) {
8632
8746
  return Xn(e, t.type, o);
@@ -8831,28 +8945,28 @@ class fe {
8831
8945
  p(this, "BlockNoteEditor", "only for types");
8832
8946
  p(this, "Block", "only for types");
8833
8947
  p(this, "PartialBlock", "only for types");
8834
- this.blockSpecs = Le(t == null ? void 0 : t.blockSpecs) || qt, this.inlineContentSpecs = Le(t == null ? void 0 : t.inlineContentSpecs) || Zt, this.styleSpecs = Le(t == null ? void 0 : t.styleSpecs) || Xt, this.blockSchema = jt(this.blockSpecs), this.inlineContentSchema = Ht(
8948
+ this.blockSpecs = Le(t == null ? void 0 : t.blockSpecs) || Xt, this.inlineContentSpecs = Le(t == null ? void 0 : t.inlineContentSpecs) || Jt, this.styleSpecs = Le(t == null ? void 0 : t.styleSpecs) || Zt, this.blockSchema = Dt(this.blockSpecs), this.inlineContentSchema = Ut(
8835
8949
  this.inlineContentSpecs
8836
- ), this.styleSchema = Ot(this.styleSpecs);
8950
+ ), this.styleSchema = Rt(this.styleSpecs);
8837
8951
  }
8838
8952
  static create(t) {
8839
8953
  return new fe(t);
8840
8954
  }
8841
8955
  }
8842
- const Jt = fe.create({
8956
+ const Yt = fe.create({
8843
8957
  blockSpecs: {
8844
8958
  pageBreak: Ji
8845
8959
  }
8846
8960
  }), ys = (e) => fe.create({
8847
8961
  blockSpecs: {
8848
8962
  ...e.blockSpecs,
8849
- ...Jt.blockSpecs
8963
+ ...Yt.blockSpecs
8850
8964
  },
8851
8965
  inlineContentSpecs: e.inlineContentSpecs,
8852
8966
  styleSpecs: e.styleSpecs
8853
8967
  });
8854
8968
  function Jn(e) {
8855
- return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak === Jt.blockSchema.pageBreak;
8969
+ return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak === Yt.blockSchema.pageBreak;
8856
8970
  }
8857
8971
  function vs(e) {
8858
8972
  const t = [];
@@ -8880,7 +8994,7 @@ function Yn(e, t, o, i = "before") {
8880
8994
  const n = typeof o == "string" ? o : o.id, r = [];
8881
8995
  for (const l of t)
8882
8996
  r.push(
8883
- Z(l, e.pmSchema, e.schema.styleSchema)
8997
+ J(l, e.pmSchema, e.schema.styleSchema)
8884
8998
  );
8885
8999
  const a = A(n, e._tiptapEditor.state.doc);
8886
9000
  if (!a)
@@ -8896,7 +9010,7 @@ function Yn(e, t, o, i = "before") {
8896
9010
  const s = [];
8897
9011
  for (const l of r)
8898
9012
  s.push(
8899
- v(
9013
+ w(
8900
9014
  l,
8901
9015
  e.schema.blockSchema,
8902
9016
  e.schema.inlineContentSchema,
@@ -8976,57 +9090,57 @@ function Re(e) {
8976
9090
  children: Re(t.children)
8977
9091
  }).flat();
8978
9092
  }
8979
- function Yt(e, t, o) {
9093
+ function Qt(e, t, o) {
8980
9094
  var r;
8981
9095
  const i = ((r = e.getSelection()) == null ? void 0 : r.blocks) || [
8982
9096
  e.getTextCursorPosition().block
8983
9097
  ], n = Qn(e);
8984
9098
  e.removeBlocks(i), e.insertBlocks(Re(i), t, o), er(e, n);
8985
9099
  }
8986
- function Qt(e) {
9100
+ function eo(e) {
8987
9101
  return !e || e.type !== "columnList";
8988
9102
  }
8989
- function eo(e, t, o) {
9103
+ function to(e, t, o) {
8990
9104
  let i, n;
8991
9105
  if (t ? t.children.length > 0 ? (i = t.children[t.children.length - 1], n = "after") : (i = t, n = "before") : o && (i = o, n = "before"), !i || !n)
8992
9106
  return;
8993
9107
  const r = e.getParentBlock(i);
8994
- return Qt(r) ? { referenceBlock: i, placement: n } : eo(
9108
+ return eo(r) ? { referenceBlock: i, placement: n } : to(
8995
9109
  e,
8996
9110
  n === "after" ? i : e.getPrevBlock(i),
8997
9111
  r
8998
9112
  );
8999
9113
  }
9000
- function to(e, t, o) {
9114
+ function oo(e, t, o) {
9001
9115
  let i, n;
9002
9116
  if (t ? t.children.length > 0 ? (i = t.children[0], n = "before") : (i = t, n = "after") : o && (i = o, n = "after"), !i || !n)
9003
9117
  return;
9004
9118
  const r = e.getParentBlock(i);
9005
- return Qt(r) ? { referenceBlock: i, placement: n } : to(
9119
+ return eo(r) ? { referenceBlock: i, placement: n } : oo(
9006
9120
  e,
9007
9121
  n === "before" ? i : e.getNextBlock(i),
9008
9122
  r
9009
9123
  );
9010
9124
  }
9011
9125
  function tr(e) {
9012
- const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[0]) || e.getTextCursorPosition().block, i = eo(
9126
+ const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[0]) || e.getTextCursorPosition().block, i = to(
9013
9127
  e,
9014
9128
  e.getPrevBlock(o),
9015
9129
  e.getParentBlock(o)
9016
9130
  );
9017
- i && Yt(
9131
+ i && Qt(
9018
9132
  e,
9019
9133
  i.referenceBlock,
9020
9134
  i.placement
9021
9135
  );
9022
9136
  }
9023
9137
  function or(e) {
9024
- const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[(t == null ? void 0 : t.blocks.length) - 1]) || e.getTextCursorPosition().block, i = to(
9138
+ const t = e.getSelection(), o = (t == null ? void 0 : t.blocks[(t == null ? void 0 : t.blocks.length) - 1]) || e.getTextCursorPosition().block, i = oo(
9025
9139
  e,
9026
9140
  e.getNextBlock(o),
9027
9141
  e.getParentBlock(o)
9028
9142
  );
9029
- i && Yt(
9143
+ i && Qt(
9030
9144
  e,
9031
9145
  i.referenceBlock,
9032
9146
  i.placement
@@ -9073,7 +9187,7 @@ function ir(e, t) {
9073
9187
  return !0;
9074
9188
  };
9075
9189
  }
9076
- function oo(e) {
9190
+ function io(e) {
9077
9191
  return e._tiptapEditor.commands.command(
9078
9192
  ir(
9079
9193
  e._tiptapEditor.schema.nodes.blockContainer,
@@ -9096,13 +9210,13 @@ function ar(e) {
9096
9210
  );
9097
9211
  return e._tiptapEditor.state.doc.resolve(t.beforePos).depth > 1;
9098
9212
  }
9099
- function io(e, t, o) {
9213
+ function no(e, t, o) {
9100
9214
  const i = e._tiptapEditor;
9101
9215
  let n = i.state.tr;
9102
9216
  const r = [];
9103
9217
  for (const u of o)
9104
9218
  r.push(
9105
- Z(u, e.pmSchema, e.schema.styleSchema)
9219
+ J(u, e.pmSchema, e.schema.styleSchema)
9106
9220
  );
9107
9221
  const a = new Set(
9108
9222
  t.map(
@@ -9116,7 +9230,7 @@ function io(e, t, o) {
9116
9230
  if (!u.type.isInGroup("bnBlock") || !a.has(u.attrs.id))
9117
9231
  return !0;
9118
9232
  if (s.push(
9119
- v(
9233
+ w(
9120
9234
  u,
9121
9235
  e.schema.blockSchema,
9122
9236
  e.schema.inlineContentSchema,
@@ -9144,7 +9258,7 @@ function io(e, t, o) {
9144
9258
  const c = [];
9145
9259
  for (const u of r)
9146
9260
  c.push(
9147
- v(
9261
+ w(
9148
9262
  u,
9149
9263
  e.schema.blockSchema,
9150
9264
  e.schema.inlineContentSchema,
@@ -9155,15 +9269,15 @@ function io(e, t, o) {
9155
9269
  return { insertedBlocks: c, removedBlocks: s };
9156
9270
  }
9157
9271
  function sr(e, t, o) {
9158
- return io(e, t, o);
9272
+ return no(e, t, o);
9159
9273
  }
9160
9274
  function lr(e, t) {
9161
- return io(e, t, []).removedBlocks;
9275
+ return no(e, t, []).removedBlocks;
9162
9276
  }
9163
9277
  function dr(e, t) {
9164
9278
  const o = typeof t == "string" ? t : t.id, i = A(o, e._tiptapEditor.state.doc);
9165
9279
  if (i)
9166
- return v(
9280
+ return w(
9167
9281
  i.node,
9168
9282
  e.schema.blockSchema,
9169
9283
  e.schema.inlineContentSchema,
@@ -9179,7 +9293,7 @@ function cr(e, t) {
9179
9293
  i.posBeforeNode
9180
9294
  ).nodeBefore;
9181
9295
  if (r)
9182
- return v(
9296
+ return w(
9183
9297
  r,
9184
9298
  e.schema.blockSchema,
9185
9299
  e.schema.inlineContentSchema,
@@ -9195,7 +9309,7 @@ function ur(e, t) {
9195
9309
  i.posBeforeNode + i.node.nodeSize
9196
9310
  ).nodeAfter;
9197
9311
  if (r)
9198
- return v(
9312
+ return w(
9199
9313
  r,
9200
9314
  e.schema.blockSchema,
9201
9315
  e.schema.inlineContentSchema,
@@ -9211,7 +9325,7 @@ function pr(e, t) {
9211
9325
  i.posBeforeNode
9212
9326
  ), r = n.node(), a = n.node(-1), s = a.type.name !== "doc" ? r.type.name === "blockGroup" ? a : r : void 0;
9213
9327
  if (s)
9214
- return v(
9328
+ return w(
9215
9329
  s,
9216
9330
  e.schema.blockSchema,
9217
9331
  e.schema.inlineContentSchema,
@@ -9228,7 +9342,7 @@ function hr(e, t, o, i = { updateSelection: !0 }) {
9228
9342
  const { parent: c } = n.doc.resolve(r);
9229
9343
  c.isTextblock && !c.type.spec.code && !c.childCount && (r -= 1, a += 1);
9230
9344
  }
9231
- return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && Co(n, n.steps.length - 1, -1), o.dispatch(n), !0;
9345
+ return s ? n.insertText(d, r, a) : n.replaceWith(r, a, t), i.updateSelection && Eo(n, n.steps.length - 1, -1), o.dispatch(n), !0;
9232
9346
  }
9233
9347
  function mr(e) {
9234
9348
  const t = e._tiptapEditor.state;
@@ -9244,7 +9358,7 @@ function mr(e) {
9244
9358
  throw new Error(
9245
9359
  `Error getting selection - node not found at position ${u}`
9246
9360
  );
9247
- return v(
9361
+ return w(
9248
9362
  h,
9249
9363
  e.schema.blockSchema,
9250
9364
  e.schema.inlineContentSchema,
@@ -9254,7 +9368,7 @@ function mr(e) {
9254
9368
  }, r = [], a = o.sharedDepth(i.pos), s = o.index(a), l = i.index(a);
9255
9369
  if (o.depth > a) {
9256
9370
  r.push(
9257
- v(
9371
+ w(
9258
9372
  o.nodeAfter,
9259
9373
  e.schema.blockSchema,
9260
9374
  e.schema.inlineContentSchema,
@@ -9328,28 +9442,28 @@ function gr(e) {
9328
9442
  ).nodeAfter;
9329
9443
  let r;
9330
9444
  return o.depth > 1 && (r = o.node(), r.type.isInGroup("bnBlock") || (r = o.node(o.depth - 1))), {
9331
- block: v(
9445
+ block: w(
9332
9446
  t.node,
9333
9447
  e.schema.blockSchema,
9334
9448
  e.schema.inlineContentSchema,
9335
9449
  e.schema.styleSchema,
9336
9450
  e.blockCache
9337
9451
  ),
9338
- prevBlock: i === null ? void 0 : v(
9452
+ prevBlock: i === null ? void 0 : w(
9339
9453
  i,
9340
9454
  e.schema.blockSchema,
9341
9455
  e.schema.inlineContentSchema,
9342
9456
  e.schema.styleSchema,
9343
9457
  e.blockCache
9344
9458
  ),
9345
- nextBlock: n === null ? void 0 : v(
9459
+ nextBlock: n === null ? void 0 : w(
9346
9460
  n,
9347
9461
  e.schema.blockSchema,
9348
9462
  e.schema.inlineContentSchema,
9349
9463
  e.schema.styleSchema,
9350
9464
  e.blockCache
9351
9465
  ),
9352
- parentBlock: r === void 0 ? void 0 : v(
9466
+ parentBlock: r === void 0 ? void 0 : w(
9353
9467
  r,
9354
9468
  e.schema.blockSchema,
9355
9469
  e.schema.inlineContentSchema,
@@ -9358,7 +9472,7 @@ function gr(e) {
9358
9472
  )
9359
9473
  };
9360
9474
  }
9361
- function no(e, t, o = "start") {
9475
+ function ro(e, t, o = "start") {
9362
9476
  const i = typeof t == "string" ? t : t.id, n = A(i, e._tiptapEditor.state.doc);
9363
9477
  if (!n)
9364
9478
  throw new Error(`Block with ID ${i} not found`);
@@ -9385,13 +9499,13 @@ function no(e, t, o = "start") {
9385
9499
  throw new D(a);
9386
9500
  } else {
9387
9501
  const s = o === "start" ? r.childContainer.node.firstChild : r.childContainer.node.lastChild;
9388
- no(e, s.attrs.id, o);
9502
+ ro(e, s.attrs.id, o);
9389
9503
  }
9390
9504
  }
9391
- let Y;
9505
+ let Q;
9392
9506
  async function qe() {
9393
- if (Y)
9394
- return Y;
9507
+ if (Q)
9508
+ return Q;
9395
9509
  const e = await Promise.all([
9396
9510
  import("rehype-parse"),
9397
9511
  import("rehype-stringify"),
@@ -9404,7 +9518,7 @@ async function qe() {
9404
9518
  import("remark-rehype"),
9405
9519
  import("rehype-format")
9406
9520
  ]);
9407
- return Y = {
9521
+ return Q = {
9408
9522
  rehypeParse: e[0],
9409
9523
  rehypeStringify: e[1],
9410
9524
  unified: e[2],
@@ -9415,7 +9529,7 @@ async function qe() {
9415
9529
  remarkParse: e[7],
9416
9530
  remarkRehype: e[8],
9417
9531
  rehypeFormat: e[9]
9418
- }, Y;
9532
+ }, Q;
9419
9533
  }
9420
9534
  function br() {
9421
9535
  const e = (t) => {
@@ -9434,7 +9548,7 @@ function br() {
9434
9548
  return e;
9435
9549
  }
9436
9550
  function kr() {
9437
- const e = Y;
9551
+ const e = Q;
9438
9552
  if (!e)
9439
9553
  throw new Error(
9440
9554
  "addSpacesToCheckboxes requires ESM dependencies to be initialized"
@@ -9456,7 +9570,7 @@ function kr() {
9456
9570
  return t;
9457
9571
  }
9458
9572
  function Xe(e) {
9459
- const t = Y;
9573
+ const t = Q;
9460
9574
  if (!t)
9461
9575
  throw new Error(
9462
9576
  "cleanHTMLToMarkdown requires ESM dependencies to be initialized"
@@ -9505,20 +9619,20 @@ let ht = null;
9505
9619
  function Cr() {
9506
9620
  return ht || (ht = document.implementation.createHTMLDocument("title"));
9507
9621
  }
9508
- function ro(e) {
9622
+ function ao(e) {
9509
9623
  if (typeof e == "string") {
9510
9624
  const t = Cr().createElement("div");
9511
9625
  t.innerHTML = e, e = t;
9512
9626
  }
9513
9627
  return wr(e), xr(e), e;
9514
9628
  }
9515
- async function ao(e, t, o, i, n) {
9516
- const r = ro(e), s = wt.fromSchema(n).parse(r, {
9629
+ async function so(e, t, o, i, n) {
9630
+ const r = ao(e), s = wt.fromSchema(n).parse(r, {
9517
9631
  topNode: n.nodes.blockGroup.create()
9518
9632
  }), l = [];
9519
9633
  for (let d = 0; d < s.childCount; d++)
9520
9634
  l.push(
9521
- v(s.child(d), t, o, i)
9635
+ w(s.child(d), t, o, i)
9522
9636
  );
9523
9637
  return l;
9524
9638
  }
@@ -9545,7 +9659,7 @@ async function Sr(e, t, o, i, n) {
9545
9659
  code: Er
9546
9660
  }
9547
9661
  }).use(r.rehypeStringify.default).processSync(e);
9548
- return ao(
9662
+ return so(
9549
9663
  a.value,
9550
9664
  t,
9551
9665
  o,
@@ -9573,7 +9687,7 @@ function Tr(e, t) {
9573
9687
  throw new Error(`The string ${t} is not a valid MIME type.`);
9574
9688
  return o[1] === "*" || i[1] === "*" ? o[0] === i[0] : (o[0] === "*" || i[0] === "*" || o[0] === i[0]) && o[1] === i[1];
9575
9689
  }
9576
- async function so(e, t) {
9690
+ async function lo(e, t) {
9577
9691
  var a;
9578
9692
  if (!t.uploadFile) {
9579
9693
  console.warn(
@@ -9670,7 +9784,7 @@ const Mr = (e) => L.create({
9670
9784
  i = n;
9671
9785
  break;
9672
9786
  }
9673
- return i === null ? !0 : i === "Files" ? (so(o, e), !0) : !1;
9787
+ return i === null ? !0 : i === "Files" ? (lo(o, e), !0) : !1;
9674
9788
  }
9675
9789
  }
9676
9790
  }
@@ -9717,9 +9831,9 @@ const Lr = (e) => L.create({
9717
9831
  if (i === "vscode-editor-data")
9718
9832
  return Ir(o, t), !0;
9719
9833
  if (i === "Files")
9720
- return so(o, e), !0;
9834
+ return lo(o, e), !0;
9721
9835
  let n = o.clipboardData.getData(i);
9722
- return i === "blocknote/html" ? (t.pasteHTML(n), !0) : i === "text/html" ? (n = ro(n.trim()).innerHTML, t.pasteHTML(n), !0) : (t.pasteText(n), !0);
9836
+ return i === "blocknote/html" ? (t.pasteHTML(n), !0) : i === "text/html" ? (n = ao(n.trim()).innerHTML, t.pasteHTML(n), !0) : (t.pasteText(n), !0);
9723
9837
  }
9724
9838
  }
9725
9839
  }
@@ -9727,13 +9841,13 @@ const Lr = (e) => L.create({
9727
9841
  ];
9728
9842
  }
9729
9843
  });
9730
- function lo(e, t) {
9844
+ function co(e, t) {
9731
9845
  const o = [];
9732
9846
  return e.descendants((i) => {
9733
9847
  var n, r;
9734
9848
  return i.type.name === "blockContainer" && ((n = i.firstChild) == null ? void 0 : n.type.name) === "blockGroup" ? !0 : i.type.name === "columnList" && i.childCount === 1 ? ((r = i.firstChild) == null || r.forEach((a) => {
9735
9849
  o.push(
9736
- v(
9850
+ w(
9737
9851
  a,
9738
9852
  t.blockSchema,
9739
9853
  t.inlineContentSchema,
@@ -9741,7 +9855,7 @@ function lo(e, t) {
9741
9855
  )
9742
9856
  );
9743
9857
  }), !1) : i.type.isInGroup("bnBlock") ? (o.push(
9744
- v(
9858
+ w(
9745
9859
  i,
9746
9860
  t.blockSchema,
9747
9861
  t.inlineContentSchema,
@@ -9773,7 +9887,7 @@ function Ar(e, t, o) {
9773
9887
  );
9774
9888
  if (n) {
9775
9889
  ((s = t.firstChild) == null ? void 0 : s.type.name) === "table" && (t = t.firstChild.content);
9776
- const l = Dt(
9890
+ const l = Ht(
9777
9891
  t,
9778
9892
  o.schema.inlineContentSchema,
9779
9893
  o.schema.styleSchema
@@ -9790,12 +9904,12 @@ function Ar(e, t, o) {
9790
9904
  );
9791
9905
  r = a.exportInlineContent(l, {});
9792
9906
  } else {
9793
- const l = lo(t, o.schema);
9907
+ const l = co(t, o.schema);
9794
9908
  r = a.exportBlocks(l, {});
9795
9909
  }
9796
9910
  return r;
9797
9911
  }
9798
- function co(e, t) {
9912
+ function uo(e, t) {
9799
9913
  "node" in e.state.selection && e.state.selection.node.type.spec.group === "blockContent" && t.dispatch(
9800
9914
  t._tiptapEditor.state.tr.setSelection(
9801
9915
  new ce(e.state.doc.resolve(e.state.selection.from - 1))
@@ -9823,7 +9937,7 @@ const mt = () => {
9823
9937
  return !1;
9824
9938
  }, ft = (e, t, o) => {
9825
9939
  o.preventDefault(), o.clipboardData.clearData();
9826
- const { clipboardHTML: i, externalHTML: n, markdown: r } = co(
9940
+ const { clipboardHTML: i, externalHTML: n, markdown: r } = uo(
9827
9941
  t,
9828
9942
  e
9829
9943
  );
@@ -9854,7 +9968,7 @@ const mt = () => {
9854
9968
  )
9855
9969
  )
9856
9970
  ), o.preventDefault(), o.dataTransfer.clearData();
9857
- const { clipboardHTML: i, externalHTML: n, markdown: r } = co(t, e);
9971
+ const { clipboardHTML: i, externalHTML: n, markdown: r } = uo(t, e);
9858
9972
  return o.dataTransfer.setData("blocknote/html", i), o.dataTransfer.setData("text/html", n), o.dataTransfer.setData("text/plain", r), !0;
9859
9973
  }
9860
9974
  }
@@ -9870,9 +9984,9 @@ const mt = () => {
9870
9984
  types: ["blockContainer"],
9871
9985
  attributes: {
9872
9986
  backgroundColor: {
9873
- default: x.backgroundColor.default,
9874
- parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : x.backgroundColor.default,
9875
- renderHTML: (e) => e.backgroundColor === x.backgroundColor.default ? {} : {
9987
+ default: C.backgroundColor.default,
9988
+ parseHTML: (e) => e.hasAttribute("data-background-color") ? e.getAttribute("data-background-color") : C.backgroundColor.default,
9989
+ renderHTML: (e) => e.backgroundColor === C.backgroundColor.default ? {} : {
9876
9990
  "data-background-color": e.backgroundColor
9877
9991
  }
9878
9992
  }
@@ -9880,7 +9994,84 @@ const mt = () => {
9880
9994
  }
9881
9995
  ];
9882
9996
  }
9883
- });
9997
+ }), jr = (e) => {
9998
+ var i;
9999
+ const t = [];
10000
+ t.push(
10001
+ Jo.configure({
10002
+ fragment: e.fragment
10003
+ })
10004
+ );
10005
+ const o = (i = e.provider) == null ? void 0 : i.awareness;
10006
+ if (o) {
10007
+ const n = /* @__PURE__ */ new Map();
10008
+ e.showCursorLabels !== "always" && o.on(
10009
+ "change",
10010
+ ({
10011
+ updated: s
10012
+ }) => {
10013
+ for (const l of s) {
10014
+ const d = n.get(l);
10015
+ d && (d.element.setAttribute("data-active", ""), d.hideTimeout && clearTimeout(d.hideTimeout), n.set(l, {
10016
+ element: d.element,
10017
+ hideTimeout: setTimeout(() => {
10018
+ d.element.removeAttribute("data-active");
10019
+ }, 2e3)
10020
+ }));
10021
+ }
10022
+ }
10023
+ );
10024
+ const r = (s) => {
10025
+ const l = document.createElement("span");
10026
+ l.classList.add("collaboration-cursor__base");
10027
+ const d = document.createElement("span");
10028
+ d.setAttribute("contentedEditable", "false"), d.classList.add("collaboration-cursor__caret"), d.setAttribute("style", `background-color: ${s.color}`);
10029
+ const c = document.createElement("span");
10030
+ return c.classList.add("collaboration-cursor__label"), c.setAttribute("style", `background-color: ${s.color}`), c.insertBefore(document.createTextNode(s.name), null), d.insertBefore(c, null), l.insertBefore(document.createTextNode("⁠"), null), l.insertBefore(d, null), l.insertBefore(document.createTextNode("⁠"), null), l;
10031
+ }, a = (s) => {
10032
+ var u;
10033
+ const l = [...o.getStates().entries()].find(
10034
+ (h) => h[1].user === s
10035
+ );
10036
+ if (!l)
10037
+ throw new Error(
10038
+ "Could not find client state for user, " + JSON.stringify(s)
10039
+ );
10040
+ const d = l[0];
10041
+ let c = n.get(d);
10042
+ if (!c) {
10043
+ const h = ((u = e == null ? void 0 : e.renderCursor) == null ? void 0 : u.call(e, s)) || r(s);
10044
+ (e == null ? void 0 : e.showCursorLabels) !== "always" && (h.addEventListener("mouseenter", () => {
10045
+ const m = n.get(d);
10046
+ m.element.setAttribute("data-active", ""), m.hideTimeout && (clearTimeout(m.hideTimeout), n.set(d, {
10047
+ element: m.element,
10048
+ hideTimeout: void 0
10049
+ }));
10050
+ }), h.addEventListener("mouseleave", () => {
10051
+ const m = n.get(d);
10052
+ n.set(d, {
10053
+ element: m.element,
10054
+ hideTimeout: setTimeout(() => {
10055
+ m.element.removeAttribute("data-active");
10056
+ }, 2e3)
10057
+ });
10058
+ })), c = {
10059
+ element: h,
10060
+ hideTimeout: void 0
10061
+ }, n.set(d, c);
10062
+ }
10063
+ return c.element;
10064
+ };
10065
+ t.push(
10066
+ Yo.configure({
10067
+ user: e.user,
10068
+ render: a,
10069
+ provider: e.provider
10070
+ })
10071
+ );
10072
+ }
10073
+ return t;
10074
+ };
9884
10075
  class ne {
9885
10076
  constructor() {
9886
10077
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -9901,7 +10092,7 @@ class ne {
9901
10092
  this.callbacks = {};
9902
10093
  }
9903
10094
  }
9904
- class jr {
10095
+ class Dr {
9905
10096
  constructor(t, o, i, n) {
9906
10097
  p(this, "state");
9907
10098
  p(this, "emitUpdate");
@@ -9958,7 +10149,7 @@ class jr {
9958
10149
  }
9959
10150
  }
9960
10151
  const Ae = new N("FilePanelPlugin");
9961
- class Dr extends ne {
10152
+ class Hr extends ne {
9962
10153
  constructor(o) {
9963
10154
  super();
9964
10155
  p(this, "view");
@@ -9969,7 +10160,7 @@ class Dr extends ne {
9969
10160
  });
9970
10161
  this.plugin = new B({
9971
10162
  key: Ae,
9972
- view: (i) => (this.view = new jr(
10163
+ view: (i) => (this.view = new Dr(
9973
10164
  o,
9974
10165
  Ae,
9975
10166
  i,
@@ -10004,7 +10195,7 @@ class Dr extends ne {
10004
10195
  return this.on("update", o);
10005
10196
  }
10006
10197
  }
10007
- class Hr {
10198
+ class Ur {
10008
10199
  constructor(t, o, i) {
10009
10200
  p(this, "state");
10010
10201
  p(this, "emitUpdate");
@@ -10090,18 +10281,18 @@ class Hr {
10090
10281
  return je(this.pmView, n, r);
10091
10282
  }
10092
10283
  }
10093
- const Ur = new N(
10284
+ const Or = new N(
10094
10285
  "FormattingToolbarPlugin"
10095
10286
  );
10096
- class Or extends ne {
10287
+ class Rr extends ne {
10097
10288
  constructor(o) {
10098
10289
  super();
10099
10290
  p(this, "view");
10100
10291
  p(this, "plugin");
10101
10292
  p(this, "closeMenu", () => this.view.closeMenu());
10102
10293
  this.plugin = new B({
10103
- key: Ur,
10104
- view: (i) => (this.view = new Hr(o, i, (n) => {
10294
+ key: Or,
10295
+ view: (i) => (this.view = new Ur(o, i, (n) => {
10105
10296
  this.emit("update", n);
10106
10297
  }), this.view),
10107
10298
  props: {
@@ -10136,13 +10327,13 @@ const gt = (e, t) => {
10136
10327
  return pe(
10137
10328
  e.resolve(n)
10138
10329
  );
10139
- }, uo = (e, t) => {
10330
+ }, po = (e, t) => {
10140
10331
  for (; t.childContainer; ) {
10141
10332
  const o = t.childContainer.node, i = e.resolve(t.childContainer.beforePos + 1).posAtIndex(o.childCount - 1);
10142
10333
  t = pe(e.resolve(i));
10143
10334
  }
10144
10335
  return t;
10145
- }, Rr = (e, t) => e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*" && e.blockContent.node.childCount > 0 && t.isBlockContainer && t.blockContent.node.type.spec.content === "inline*", Vr = (e, t, o, i) => {
10336
+ }, Vr = (e, t) => e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*" && e.blockContent.node.childCount > 0 && t.isBlockContainer && t.blockContent.node.type.spec.content === "inline*", zr = (e, t, o, i) => {
10146
10337
  if (!i.isBlockContainer)
10147
10338
  throw new Error(
10148
10339
  `Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but next block is not a block container`
@@ -10181,12 +10372,12 @@ const gt = (e, t) => {
10181
10372
  );
10182
10373
  if (!r)
10183
10374
  return !1;
10184
- const a = uo(
10375
+ const a = po(
10185
10376
  t.doc,
10186
10377
  r
10187
10378
  );
10188
- return Rr(a, n) ? Vr(t, o, a, n) : !1;
10189
- }, zr = L.create({
10379
+ return Vr(a, n) ? zr(t, o, a, n) : !1;
10380
+ }, Fr = L.create({
10190
10381
  priority: 50,
10191
10382
  // TODO: The shortcuts need a refactor. Do we want to use a command priority
10192
10383
  // design as there is now, or clump the logic into a single function?
@@ -10342,7 +10533,7 @@ const gt = (e, t) => {
10342
10533
  a.bnBlock.beforePos
10343
10534
  );
10344
10535
  if (d && s && l) {
10345
- const c = uo(
10536
+ const c = po(
10346
10537
  r.doc,
10347
10538
  d
10348
10539
  );
@@ -10424,7 +10615,7 @@ const gt = (e, t) => {
10424
10615
  return !1;
10425
10616
  const { blockContent: s } = a, l = n.selection.$anchor.parentOffset === 0;
10426
10617
  return s.node.childCount === 0 ? !1 : (r().deleteSelection().command(
10427
- Gt(
10618
+ $t(
10428
10619
  n.selection.from,
10429
10620
  l,
10430
10621
  l
@@ -10436,7 +10627,7 @@ const gt = (e, t) => {
10436
10627
  // editor since the browser will try to use tab for keyboard navigation.
10437
10628
  Tab: () => {
10438
10629
  var i, n, r;
10439
- return this.options.tabBehavior !== "prefer-indent" && ((i = this.options.editor.formattingToolbar) != null && i.shown || (n = this.options.editor.linkToolbar) != null && n.shown || (r = this.options.editor.filePanel) != null && r.shown) ? !1 : oo(this.options.editor);
10630
+ return this.options.tabBehavior !== "prefer-indent" && ((i = this.options.editor.formattingToolbar) != null && i.shown || (n = this.options.editor.linkToolbar) != null && n.shown || (r = this.options.editor.filePanel) != null && r.shown) ? !1 : io(this.options.editor);
10440
10631
  },
10441
10632
  "Shift-Tab": () => {
10442
10633
  var i, n, r;
@@ -10447,7 +10638,7 @@ const gt = (e, t) => {
10447
10638
  };
10448
10639
  }
10449
10640
  });
10450
- class Fr {
10641
+ class Gr {
10451
10642
  constructor(t, o, i) {
10452
10643
  p(this, "state");
10453
10644
  p(this, "emitUpdate");
@@ -10575,8 +10766,8 @@ class Fr {
10575
10766
  );
10576
10767
  }
10577
10768
  }
10578
- const Gr = new N("LinkToolbarPlugin");
10579
- class $r extends ne {
10769
+ const $r = new N("LinkToolbarPlugin");
10770
+ class Wr extends ne {
10580
10771
  constructor(o) {
10581
10772
  super();
10582
10773
  p(this, "view");
@@ -10615,8 +10806,8 @@ class $r extends ne {
10615
10806
  });
10616
10807
  p(this, "closeMenu", () => this.view.closeMenu());
10617
10808
  this.plugin = new B({
10618
- key: Gr,
10619
- view: (i) => (this.view = new Fr(o, i, (n) => {
10809
+ key: $r,
10810
+ view: (i) => (this.view = new Gr(o, i, (n) => {
10620
10811
  this.emit("update", n);
10621
10812
  }), this.view),
10622
10813
  props: {
@@ -10632,7 +10823,7 @@ class $r extends ne {
10632
10823
  return ((i = (o = this.view) == null ? void 0 : o.state) == null ? void 0 : i.show) || !1;
10633
10824
  }
10634
10825
  }
10635
- const Wr = [
10826
+ const Kr = [
10636
10827
  "http",
10637
10828
  "https",
10638
10829
  "ftp",
@@ -10643,12 +10834,12 @@ const Wr = [
10643
10834
  "sms",
10644
10835
  "cid",
10645
10836
  "xmpp"
10646
- ], Kr = "https", qr = new N("node-selection-keyboard");
10647
- class Xr {
10837
+ ], qr = "https", Xr = new N("node-selection-keyboard");
10838
+ class Zr {
10648
10839
  constructor() {
10649
10840
  p(this, "plugin");
10650
10841
  this.plugin = new B({
10651
- key: qr,
10842
+ key: Xr,
10652
10843
  props: {
10653
10844
  handleKeyDown: (t, o) => {
10654
10845
  if ("node" in t.state.selection) {
@@ -10676,69 +10867,83 @@ class Xr {
10676
10867
  });
10677
10868
  }
10678
10869
  }
10679
- const Zr = new N("blocknote-placeholder");
10680
- class Jr {
10870
+ const Jr = new N("blocknote-placeholder");
10871
+ class Yr {
10681
10872
  constructor(t, o) {
10682
10873
  p(this, "plugin");
10683
10874
  this.plugin = new B({
10684
- key: Zr,
10685
- view: () => {
10686
- var l, d;
10687
- const i = document.createElement("style"), n = t._tiptapEditor.options.injectNonce;
10688
- n && i.setAttribute("nonce", n), ((l = t.prosemirrorView) == null ? void 0 : l.root) instanceof ShadowRoot ? t.prosemirrorView.root.append(i) : (d = t.prosemirrorView) == null || d.root.head.appendChild(i);
10689
- const r = i.sheet, a = (c = "") => `.bn-block-content${c} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`, s = (c, u = !0) => {
10690
- const h = u ? "[data-is-empty-and-focused]" : "";
10691
- if (c === "default")
10692
- return a(h);
10693
- const m = `[data-content-type="${c}"]`;
10694
- return a(h + m);
10695
- };
10696
- for (const [c, u] of Object.entries(o)) {
10697
- const h = c === "default";
10698
- try {
10699
- r.insertRule(
10700
- `${s(
10701
- c,
10702
- h
10703
- )} { content: ${JSON.stringify(u)}; }`
10704
- ), h || r.insertRule(
10705
- `${s(c, !0)} { content: ${JSON.stringify(
10706
- u
10875
+ key: Jr,
10876
+ view: (i) => {
10877
+ var d, c;
10878
+ const n = `placeholder-selector-${Ct()}`;
10879
+ i.dom.classList.add(n);
10880
+ const r = document.createElement("style"), a = t._tiptapEditor.options.injectNonce;
10881
+ a && r.setAttribute("nonce", a), ((d = t.prosemirrorView) == null ? void 0 : d.root) instanceof ShadowRoot ? t.prosemirrorView.root.append(r) : (c = t.prosemirrorView) == null || c.root.head.appendChild(r);
10882
+ const s = r.sheet, l = (u = "") => `.${n} .bn-block-content${u} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;
10883
+ try {
10884
+ const {
10885
+ default: u,
10886
+ emptyDocument: h,
10887
+ ...m
10888
+ } = o;
10889
+ for (const [b, k] of Object.entries(m)) {
10890
+ const v = `[data-content-type="${b}"]`;
10891
+ s.insertRule(
10892
+ `${l(v)} { content: ${JSON.stringify(
10893
+ k
10707
10894
  )}; }`
10708
10895
  );
10709
- } catch (m) {
10710
- console.warn(
10711
- "Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",
10712
- m
10713
- );
10714
10896
  }
10897
+ const f = "[data-is-only-empty-block]", g = "[data-is-empty-and-focused]";
10898
+ s.insertRule(
10899
+ `${l(f)} { content: ${JSON.stringify(
10900
+ h
10901
+ )}; }`
10902
+ ), s.insertRule(
10903
+ `${l(g)} { content: ${JSON.stringify(
10904
+ u
10905
+ )}; }`
10906
+ );
10907
+ } catch (u) {
10908
+ console.warn(
10909
+ "Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",
10910
+ u
10911
+ );
10715
10912
  }
10716
10913
  return {
10717
10914
  destroy: () => {
10718
- var c, u;
10719
- ((c = t.prosemirrorView) == null ? void 0 : c.root) instanceof ShadowRoot ? t.prosemirrorView.root.removeChild(i) : (u = t.prosemirrorView) == null || u.root.head.removeChild(i);
10915
+ var u, h;
10916
+ ((u = t.prosemirrorView) == null ? void 0 : u.root) instanceof ShadowRoot ? t.prosemirrorView.root.removeChild(r) : (h = t.prosemirrorView) == null || h.root.head.removeChild(r);
10720
10917
  }
10721
10918
  };
10722
10919
  },
10723
10920
  props: {
10724
- // TODO: maybe also add placeholder for empty document ("e.g.: start writing..")
10725
10921
  decorations: (i) => {
10726
10922
  const { doc: n, selection: r } = i;
10727
10923
  if (!t.isEditable || !r.empty || r.$from.parent.type.spec.code)
10728
10924
  return;
10729
- const a = r.$anchor, s = a.parent;
10730
- if (s.content.size > 0)
10731
- return null;
10732
- const l = a.before(), d = oe.node(l, l + s.nodeSize, {
10733
- "data-is-empty-and-focused": "true"
10734
- });
10735
- return ie.create(n, [d]);
10925
+ const a = [];
10926
+ i.doc.content.size === 6 && a.push(
10927
+ X.node(2, 4, {
10928
+ "data-is-only-empty-block": "true"
10929
+ })
10930
+ );
10931
+ const s = r.$anchor, l = s.parent;
10932
+ if (l.content.size === 0) {
10933
+ const d = s.before();
10934
+ a.push(
10935
+ X.node(d, d + l.nodeSize, {
10936
+ "data-is-empty-and-focused": "true"
10937
+ })
10938
+ );
10939
+ }
10940
+ return ie.create(n, a);
10736
10941
  }
10737
10942
  }
10738
10943
  });
10739
10944
  }
10740
10945
  }
10741
- const kt = new N("previous-blocks"), Yr = {
10946
+ const kt = new N("previous-blocks"), Qr = {
10742
10947
  // Numbered List Items
10743
10948
  index: "index",
10744
10949
  // Headings
@@ -10748,7 +10953,7 @@ const kt = new N("previous-blocks"), Yr = {
10748
10953
  depth: "depth",
10749
10954
  "depth-change": "depth-change"
10750
10955
  };
10751
- class Qr {
10956
+ class ea {
10752
10957
  constructor() {
10753
10958
  p(this, "plugin");
10754
10959
  let t;
@@ -10818,8 +11023,8 @@ class Qr {
10818
11023
  return;
10819
11024
  const s = i.currentTransactionOldBlockAttrs[r.attrs.id], l = {};
10820
11025
  for (const [c, u] of Object.entries(s))
10821
- l["data-prev-" + Yr[c]] = u || "none";
10822
- const d = oe.node(a, a + r.nodeSize, {
11026
+ l["data-prev-" + Qr[c]] = u || "none";
11027
+ const d = X.node(a, a + r.nodeSize, {
10823
11028
  ...l
10824
11029
  });
10825
11030
  n.push(d);
@@ -10829,14 +11034,14 @@ class Qr {
10829
11034
  });
10830
11035
  }
10831
11036
  }
10832
- function po(e, t) {
11037
+ function ho(e, t) {
10833
11038
  var o, i;
10834
11039
  for (; e && e.parentElement && e.parentElement !== t.dom && ((o = e.getAttribute) == null ? void 0 : o.call(e, "data-node-type")) !== "blockContainer"; )
10835
11040
  e = e.parentElement;
10836
11041
  if (((i = e.getAttribute) == null ? void 0 : i.call(e, "data-node-type")) === "blockContainer")
10837
11042
  return { node: e, id: e.getAttribute("data-id") };
10838
11043
  }
10839
- class Q extends Me {
11044
+ class ee extends Me {
10840
11045
  constructor(o, i) {
10841
11046
  super(o, i);
10842
11047
  p(this, "nodes");
@@ -10847,13 +11052,13 @@ class Q extends Me {
10847
11052
  });
10848
11053
  }
10849
11054
  static create(o, i, n = i) {
10850
- return new Q(o.resolve(i), o.resolve(n));
11055
+ return new ee(o.resolve(i), o.resolve(n));
10851
11056
  }
10852
11057
  content() {
10853
11058
  return new q(j.from(this.nodes), 0, 0);
10854
11059
  }
10855
11060
  eq(o) {
10856
- if (!(o instanceof Q) || this.nodes.length !== o.nodes.length || this.from !== o.from || this.to !== o.to)
11061
+ if (!(o instanceof ee) || this.nodes.length !== o.nodes.length || this.from !== o.from || this.to !== o.to)
10857
11062
  return !1;
10858
11063
  for (let i = 0; i < this.nodes.length; i++)
10859
11064
  if (!this.nodes[i].eq(o.nodes[i]))
@@ -10862,7 +11067,7 @@ class Q extends Me {
10862
11067
  }
10863
11068
  map(o, i) {
10864
11069
  const n = i.mapResult(this.from), r = i.mapResult(this.to);
10865
- return r.deleted ? Me.near(o.resolve(n.pos)) : n.deleted ? Me.near(o.resolve(r.pos)) : new Q(
11070
+ return r.deleted ? Me.near(o.resolve(n.pos)) : n.deleted ? Me.near(o.resolve(r.pos)) : new ee(
10866
11071
  o.resolve(n.pos),
10867
11072
  o.resolve(r.pos)
10868
11073
  );
@@ -10872,7 +11077,7 @@ class Q extends Me {
10872
11077
  }
10873
11078
  }
10874
11079
  let O;
10875
- function ea(e, t) {
11080
+ function ta(e, t) {
10876
11081
  let o, i;
10877
11082
  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);
10878
11083
  if (n && r) {
@@ -10895,16 +11100,16 @@ function _t(e, t, o = t) {
10895
11100
  );
10896
11101
  for (let c = n.childElementCount - 1; c >= 0; c--)
10897
11102
  (c > s || c < a) && i.removeChild(i.children[c]);
10898
- ho(e.root), O = i;
11103
+ mo(e.root), O = i;
10899
11104
  const d = e.dom.className.split(" ").filter(
10900
11105
  (c) => c !== "ProseMirror" && c !== "bn-root" && c !== "bn-editor"
10901
11106
  ).join(" ");
10902
11107
  O.className = O.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(O) : e.root.body.appendChild(O);
10903
11108
  }
10904
- function ho(e) {
11109
+ function mo(e) {
10905
11110
  O !== void 0 && (e instanceof ShadowRoot ? e.removeChild(O) : e.body.removeChild(O), O = void 0);
10906
11111
  }
10907
- function ta(e, t, o) {
11112
+ function oa(e, t, o) {
10908
11113
  if (!e.dataTransfer)
10909
11114
  return;
10910
11115
  const i = o.prosemirrorView;
@@ -10915,14 +11120,14 @@ function ta(e, t, o) {
10915
11120
  throw new Error(`Block with ID ${t.id} not found`);
10916
11121
  const r = n.posBeforeNode;
10917
11122
  if (r != null) {
10918
- const a = i.state.selection, s = i.state.doc, { from: l, to: d } = ea(a, s), c = l <= r && r < d, u = a.$anchor.node() !== a.$head.node() || a instanceof Q;
11123
+ const a = i.state.selection, s = i.state.doc, { from: l, to: d } = ta(a, s), c = l <= r && r < d, u = a.$anchor.node() !== a.$head.node() || a instanceof ee;
10919
11124
  c && u ? (i.dispatch(
10920
- i.state.tr.setSelection(Q.create(s, l, d))
11125
+ i.state.tr.setSelection(ee.create(s, l, d))
10921
11126
  ), _t(i, l, d)) : (i.dispatch(
10922
11127
  i.state.tr.setSelection(ce.create(i.state.doc, r))
10923
11128
  ), _t(i, r));
10924
- const h = i.state.selection.content(), m = o.pmSchema, f = i.serializeForClipboard(h).dom.innerHTML, g = Ee(m, o), b = lo(h.content, o.schema), k = g.exportBlocks(b, {}), C = Xe(k);
10925
- e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", k), e.dataTransfer.setData("text/plain", C), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(O, 0, 0);
11129
+ const h = i.state.selection.content(), m = o.pmSchema, f = i.serializeForClipboard(h).dom.innerHTML, g = Ee(m, o), b = co(h.content, o.schema), k = g.exportBlocks(b, {}), v = Xe(k);
11130
+ e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", k), e.dataTransfer.setData("text/plain", v), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(O, 0, 0);
10926
11131
  }
10927
11132
  }
10928
11133
  const ae = 0.1;
@@ -10943,9 +11148,9 @@ function ze(e, t, o, i = !0) {
10943
11148
  },
10944
11149
  o,
10945
11150
  !1
10946
- ) : po(r, e);
11151
+ ) : ho(r, e);
10947
11152
  }
10948
- function oa(e, t, o) {
11153
+ function ia(e, t, o) {
10949
11154
  if (!t.dom.firstChild)
10950
11155
  return;
10951
11156
  const i = t.dom.firstChild.getBoundingClientRect(), n = {
@@ -10960,7 +11165,7 @@ function oa(e, t, o) {
10960
11165
  }
10961
11166
  return s;
10962
11167
  }
10963
- class ia {
11168
+ class na {
10964
11169
  constructor(t, o, i, n) {
10965
11170
  p(this, "state");
10966
11171
  p(this, "emitUpdate");
@@ -10975,7 +11180,7 @@ class ia {
10975
11180
  var i, n, r, a;
10976
11181
  if (this.menuFrozen || !this.mousePos)
10977
11182
  return;
10978
- const t = oa(
11183
+ const t = ia(
10979
11184
  this.mousePos,
10980
11185
  this.pmView,
10981
11186
  this.sideMenuDetection
@@ -11011,26 +11216,30 @@ class ia {
11011
11216
  }
11012
11217
  });
11013
11218
  p(this, "onDrop", (t) => {
11014
- var i;
11015
- if (this.pmView.dragging === null || (this.editor._tiptapEditor.commands.blur(), !this.isDragOrigin && this.pmView.dom.contains(t.target) ? this.pmView.dispatch(
11219
+ var n, r;
11220
+ if (this.pmView.dragging === null)
11221
+ return;
11222
+ this.editor._tiptapEditor.commands.blur();
11223
+ const o = t.target instanceof Node && ((n = t.target instanceof HTMLElement ? t.target : t.target.parentElement) == null ? void 0 : n.closest(".bn-editor")) || null;
11224
+ if (o && (!this.isDragOrigin && this.pmView.dom === o ? this.pmView.dispatch(
11016
11225
  this.pmView.state.tr.setSelection(
11017
11226
  U.create(
11018
11227
  this.pmView.state.tr.doc,
11019
11228
  this.pmView.state.tr.selection.to
11020
11229
  )
11021
11230
  )
11022
- ) : this.isDragOrigin && !this.pmView.dom.contains(t.target) && setTimeout(
11231
+ ) : this.isDragOrigin && this.pmView.dom !== o && setTimeout(
11023
11232
  () => this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),
11024
11233
  0
11025
- ), setTimeout(() => this.pmView.dragging = null, 0), this.sideMenuDetection === "editor" || t.synthetic || !((i = t.dataTransfer) != null && i.types.includes("blocknote/html"))))
11234
+ ), setTimeout(() => this.pmView.dragging = null, 0)), this.sideMenuDetection === "editor" || t.synthetic || !((r = t.dataTransfer) != null && r.types.includes("blocknote/html")))
11026
11235
  return;
11027
- const o = this.pmView.posAtCoords({
11236
+ const i = this.pmView.posAtCoords({
11028
11237
  left: t.clientX,
11029
11238
  top: t.clientY
11030
11239
  });
11031
- if (!o || o.inside === -1) {
11032
- const n = this.createSyntheticEvent(t);
11033
- this.pmView.dom.dispatchEvent(n);
11240
+ if (!i || i.inside === -1) {
11241
+ const a = this.createSyntheticEvent(t);
11242
+ this.pmView.dom.dispatchEvent(a);
11034
11243
  }
11035
11244
  });
11036
11245
  /**
@@ -11176,8 +11385,8 @@ class ia {
11176
11385
  ), this.pmView.root.removeEventListener("scroll", this.onScroll, !0);
11177
11386
  }
11178
11387
  }
11179
- const na = new N("SideMenuPlugin");
11180
- class ra extends ne {
11388
+ const ra = new N("SideMenuPlugin");
11389
+ class aa extends ne {
11181
11390
  constructor(o, i) {
11182
11391
  super();
11183
11392
  p(this, "view");
@@ -11186,13 +11395,13 @@ class ra extends ne {
11186
11395
  * Handles drag & drop events for blocks.
11187
11396
  */
11188
11397
  p(this, "blockDragStart", (o, i) => {
11189
- this.view && (this.view.isDragOrigin = !0), ta(o, i, this.editor);
11398
+ this.view && (this.view.isDragOrigin = !0), oa(o, i, this.editor);
11190
11399
  });
11191
11400
  /**
11192
11401
  * Handles drag & drop events for blocks.
11193
11402
  */
11194
11403
  p(this, "blockDragEnd", () => {
11195
- this.editor.prosemirrorView && ho(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
11404
+ this.editor.prosemirrorView && mo(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
11196
11405
  });
11197
11406
  /**
11198
11407
  * Freezes the side menu. When frozen, the side menu will stay
@@ -11211,8 +11420,8 @@ class ra extends ne {
11211
11420
  this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
11212
11421
  });
11213
11422
  this.editor = o, this.plugin = new B({
11214
- key: na,
11215
- view: (n) => (this.view = new ia(
11423
+ key: ra,
11424
+ view: (n) => (this.view = new na(
11216
11425
  o,
11217
11426
  i,
11218
11427
  n,
@@ -11226,8 +11435,8 @@ class ra extends ne {
11226
11435
  return this.on("update", o);
11227
11436
  }
11228
11437
  }
11229
- const aa = Eo((e) => e.type.name === "blockContainer");
11230
- class sa {
11438
+ const sa = So((e) => e.type.name === "blockContainer");
11439
+ class la {
11231
11440
  constructor(t, o) {
11232
11441
  p(this, "state");
11233
11442
  p(this, "emitUpdate");
@@ -11246,7 +11455,7 @@ class sa {
11246
11455
  });
11247
11456
  p(this, "closeMenu", () => {
11248
11457
  this.editor.dispatch(
11249
- this.editor._tiptapEditor.state.tr.setMeta(ee, null)
11458
+ this.editor._tiptapEditor.state.tr.setMeta(te, null)
11250
11459
  );
11251
11460
  });
11252
11461
  p(this, "clearQuery", () => {
@@ -11268,7 +11477,7 @@ class sa {
11268
11477
  }
11269
11478
  update(t, o) {
11270
11479
  var d;
11271
- const i = ee.getState(o), n = ee.getState(
11480
+ const i = te.getState(o), n = te.getState(
11272
11481
  t.state
11273
11482
  ), r = i === void 0 && n !== void 0, a = i !== void 0 && n === void 0;
11274
11483
  if (!r && !(i !== void 0 && n !== void 0) && !a)
@@ -11291,8 +11500,8 @@ class sa {
11291
11500
  (t = this.rootEl) == null || t.removeEventListener("scroll", this.handleScroll, !0);
11292
11501
  }
11293
11502
  }
11294
- const ee = new N("SuggestionMenuPlugin");
11295
- class la extends ne {
11503
+ const te = new N("SuggestionMenuPlugin");
11504
+ class da extends ne {
11296
11505
  constructor(o) {
11297
11506
  super();
11298
11507
  p(this, "view");
@@ -11311,8 +11520,8 @@ class la extends ne {
11311
11520
  p(this, "clearQuery", () => this.view.clearQuery());
11312
11521
  const i = this.triggerCharacters;
11313
11522
  this.plugin = new B({
11314
- key: ee,
11315
- view: () => (this.view = new sa(
11523
+ key: te,
11524
+ view: () => (this.view = new la(
11316
11525
  o,
11317
11526
  (n, r) => {
11318
11527
  this.emit(`update ${n}`, r);
@@ -11326,7 +11535,7 @@ class la extends ne {
11326
11535
  apply(n, r, a, s) {
11327
11536
  if (n.getMeta("orderedListIndexing") !== void 0 || n.selection.$from.parent.type.spec.code)
11328
11537
  return r;
11329
- const l = n.getMeta(ee);
11538
+ const l = n.getMeta(te);
11330
11539
  if (typeof l == "object" && l !== null && r === void 0)
11331
11540
  return {
11332
11541
  triggerCharacter: l.triggerCharacter,
@@ -11358,7 +11567,7 @@ class la extends ne {
11358
11567
  handleTextInput(n, r, a, s) {
11359
11568
  const l = this.getState(n.state);
11360
11569
  return i.includes(s) && l === void 0 ? (n.dispatch(
11361
- n.state.tr.insertText(s).scrollIntoView().setMeta(ee, {
11570
+ n.state.tr.insertText(s).scrollIntoView().setMeta(te, {
11362
11571
  triggerCharacter: s
11363
11572
  })
11364
11573
  ), !0) : !1;
@@ -11369,10 +11578,10 @@ class la extends ne {
11369
11578
  if (r === void 0)
11370
11579
  return null;
11371
11580
  if (!r.deleteTriggerCharacter) {
11372
- const a = aa(n.selection);
11581
+ const a = sa(n.selection);
11373
11582
  if (a)
11374
11583
  return ie.create(n.doc, [
11375
- oe.node(
11584
+ X.node(
11376
11585
  a.pos,
11377
11586
  a.pos + a.node.nodeSize,
11378
11587
  {
@@ -11384,7 +11593,7 @@ class la extends ne {
11384
11593
  ]);
11385
11594
  }
11386
11595
  return ie.create(n.doc, [
11387
- oe.inline(
11596
+ X.inline(
11388
11597
  r.queryStartPos - r.triggerCharacter.length,
11389
11598
  r.queryStartPos,
11390
11599
  {
@@ -11413,13 +11622,13 @@ let M;
11413
11622
  function yt(e) {
11414
11623
  M || (M = document.createElement("div"), M.innerHTML = "_", M.style.opacity = "0", M.style.height = "1px", M.style.width = "1px", e instanceof Document ? e.body.appendChild(M) : e.appendChild(M));
11415
11624
  }
11416
- function da(e) {
11625
+ function ca(e) {
11417
11626
  M && (e instanceof Document ? e.body.removeChild(M) : e.removeChild(M), M = void 0);
11418
11627
  }
11419
11628
  function ke(e) {
11420
11629
  return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
11421
11630
  }
11422
- function ca(e) {
11631
+ function ua(e) {
11423
11632
  let t = e;
11424
11633
  for (; t && t.nodeName !== "TD" && t.nodeName !== "TH" && !t.classList.contains("tableWrapper"); ) {
11425
11634
  if (t.classList.contains("ProseMirror"))
@@ -11439,12 +11648,12 @@ function ca(e) {
11439
11648
  tbodyNode: t.querySelector("tbody")
11440
11649
  };
11441
11650
  }
11442
- function ua(e, t) {
11651
+ function pa(e, t) {
11443
11652
  const o = t.querySelectorAll(e);
11444
11653
  for (let i = 0; i < o.length; i++)
11445
11654
  o[i].style.visibility = "hidden";
11446
11655
  }
11447
- class pa {
11656
+ class ha {
11448
11657
  constructor(t, o, i) {
11449
11658
  p(this, "state");
11450
11659
  p(this, "emitUpdate");
@@ -11464,7 +11673,7 @@ class pa {
11464
11673
  var d, c, u, h;
11465
11674
  if (this.menuFrozen || this.mouseState === "selecting" || !(t.target instanceof Element) || !this.pmView.dom.contains(t.target))
11466
11675
  return;
11467
- const o = ca(t.target);
11676
+ const o = ua(t.target);
11468
11677
  if ((o == null ? void 0 : o.type) === "cell" && this.mouseState === "down" && !((d = this.state) != null && d.draggingState)) {
11469
11678
  this.mouseState = "selecting", (c = this.state) != null && c.show && (this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate());
11470
11679
  return;
@@ -11475,7 +11684,7 @@ class pa {
11475
11684
  }
11476
11685
  if (!o.tbodyNode)
11477
11686
  return;
11478
- const i = o.tbodyNode.getBoundingClientRect(), n = po(o.domNode, this.pmView);
11687
+ const i = o.tbodyNode.getBoundingClientRect(), n = ho(o.domNode, this.pmView);
11479
11688
  if (!n)
11480
11689
  return;
11481
11690
  this.tableElement = n.node;
@@ -11486,7 +11695,7 @@ class pa {
11486
11695
  );
11487
11696
  if (!a)
11488
11697
  throw new Error(`Block with ID ${n.id} not found`);
11489
- const s = v(
11698
+ const s = w(
11490
11699
  a.node,
11491
11700
  this.editor.schema.blockSchema,
11492
11701
  this.editor.schema.inlineContentSchema,
@@ -11535,7 +11744,7 @@ class pa {
11535
11744
  var h;
11536
11745
  if (((h = this.state) == null ? void 0 : h.draggingState) === void 0)
11537
11746
  return;
11538
- t.preventDefault(), t.dataTransfer.dropEffect = "move", ua(
11747
+ t.preventDefault(), t.dataTransfer.dropEffect = "move", pa(
11539
11748
  ".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",
11540
11749
  this.pmView.root
11541
11750
  );
@@ -11633,7 +11842,7 @@ class pa {
11633
11842
  }
11634
11843
  }
11635
11844
  const se = new N("TableHandlesPlugin");
11636
- class ha extends ne {
11845
+ class ma extends ne {
11637
11846
  constructor(o) {
11638
11847
  super();
11639
11848
  p(this, "view");
@@ -11699,7 +11908,7 @@ class ha extends ne {
11699
11908
  this.editor._tiptapEditor.state.tr.setMeta(se, null)
11700
11909
  ), !this.editor.prosemirrorView)
11701
11910
  throw new Error("Editor view not initialized.");
11702
- da(this.editor.prosemirrorView.root);
11911
+ ca(this.editor.prosemirrorView.root);
11703
11912
  });
11704
11913
  /**
11705
11914
  * Freezes the drag handles. When frozen, they will stay attached to the same
@@ -11717,7 +11926,7 @@ class ha extends ne {
11717
11926
  });
11718
11927
  this.editor = o, this.plugin = new B({
11719
11928
  key: se,
11720
- view: (i) => (this.view = new pa(o, i, (n) => {
11929
+ view: (i) => (this.view = new ha(o, i, (n) => {
11721
11930
  this.emit("update", n);
11722
11931
  }), this.view),
11723
11932
  // We use decorations to render the drop cursor when dragging a table row
@@ -11743,7 +11952,7 @@ class ha extends ne {
11743
11952
  ), h = u.node(), m = u.pos + (n > this.view.state.draggingState.originalIndex ? h.nodeSize - 2 : 0);
11744
11953
  r.push(
11745
11954
  // The widget is a small bar which spans the width of the cell.
11746
- oe.widget(m, () => {
11955
+ X.widget(m, () => {
11747
11956
  const f = document.createElement("div");
11748
11957
  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;
11749
11958
  })
@@ -11758,7 +11967,7 @@ class ha extends ne {
11758
11967
  ), u = c.node(), h = c.pos + (n > this.view.state.draggingState.originalIndex ? u.nodeSize - 2 : 0);
11759
11968
  r.push(
11760
11969
  // The widget is a small bar which spans the height of the cell.
11761
- oe.widget(h, () => {
11970
+ X.widget(h, () => {
11762
11971
  const m = document.createElement("div");
11763
11972
  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;
11764
11973
  })
@@ -11773,7 +11982,7 @@ class ha extends ne {
11773
11982
  return this.on("update", o);
11774
11983
  }
11775
11984
  }
11776
- const ma = L.create({
11985
+ const fa = L.create({
11777
11986
  name: "textAlignment",
11778
11987
  addGlobalAttributes() {
11779
11988
  return [
@@ -11799,7 +12008,7 @@ const ma = L.create({
11799
12008
  }
11800
12009
  ];
11801
12010
  }
11802
- }), fa = L.create({
12011
+ }), ga = L.create({
11803
12012
  name: "blockTextColor",
11804
12013
  addGlobalAttributes() {
11805
12014
  return [
@@ -11807,9 +12016,9 @@ const ma = L.create({
11807
12016
  types: ["blockContainer"],
11808
12017
  attributes: {
11809
12018
  textColor: {
11810
- default: x.textColor.default,
11811
- parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : x.textColor.default,
11812
- renderHTML: (e) => e.textColor === x.textColor.default ? {} : {
12019
+ default: C.textColor.default,
12020
+ parseHTML: (e) => e.hasAttribute("data-text-color") ? e.getAttribute("data-text-color") : C.textColor.default,
12021
+ renderHTML: (e) => e.textColor === C.textColor.default ? {} : {
11813
12022
  "data-text-color": e.textColor
11814
12023
  }
11815
12024
  }
@@ -11817,7 +12026,7 @@ const ma = L.create({
11817
12026
  }
11818
12027
  ];
11819
12028
  }
11820
- }), ga = L.create({
12029
+ }), ba = L.create({
11821
12030
  name: "trailingNode",
11822
12031
  addProseMirrorPlugins() {
11823
12032
  const e = new N(this.name);
@@ -11852,13 +12061,13 @@ const ma = L.create({
11852
12061
  })
11853
12062
  ];
11854
12063
  }
11855
- }), ba = {
12064
+ }), ka = {
11856
12065
  blockColor: "data-block-color",
11857
12066
  blockStyle: "data-block-style",
11858
12067
  id: "data-id",
11859
12068
  depth: "data-depth",
11860
12069
  depthChange: "data-depth-change"
11861
- }, ka = X.create({
12070
+ }, _a = Z.create({
11862
12071
  name: "blockContainer",
11863
12072
  group: "blockGroupChild bnBlock",
11864
12073
  // A block always contains content, and optionally a blockGroup which contains nested blocks
@@ -11874,7 +12083,7 @@ const ma = L.create({
11874
12083
  if (typeof e == "string")
11875
12084
  return !1;
11876
12085
  const t = {};
11877
- for (const [o, i] of Object.entries(ba))
12086
+ for (const [o, i] of Object.entries(ka))
11878
12087
  e.getAttribute(i) && (t[o] = e.getAttribute(i));
11879
12088
  return e.getAttribute("data-node-type") === "blockContainer" ? t : !1;
11880
12089
  }
@@ -11899,7 +12108,7 @@ const ma = L.create({
11899
12108
  contentDOM: i
11900
12109
  };
11901
12110
  }
11902
- }), _a = X.create({
12111
+ }), ya = Z.create({
11903
12112
  name: "blockGroup",
11904
12113
  group: "childContainer",
11905
12114
  content: "blockGroupChild+",
@@ -11928,101 +12137,26 @@ const ma = L.create({
11928
12137
  contentDOM: o
11929
12138
  };
11930
12139
  }
11931
- }), ya = X.create({
12140
+ }), va = Z.create({
11932
12141
  name: "doc",
11933
12142
  topNode: !0,
11934
12143
  content: "blockGroup"
11935
- }), va = (e) => {
11936
- var i;
11937
- const t = [];
11938
- t.push(
11939
- Yo.configure({
11940
- fragment: e.fragment
11941
- })
11942
- );
11943
- const o = (i = e.provider) == null ? void 0 : i.awareness;
11944
- if (o) {
11945
- const n = /* @__PURE__ */ new Map();
11946
- e.showCursorLabels !== "always" && o.on(
11947
- "change",
11948
- ({
11949
- updated: s
11950
- }) => {
11951
- for (const l of s) {
11952
- const d = n.get(l);
11953
- d && (d.element.setAttribute("data-active", ""), d.hideTimeout && clearTimeout(d.hideTimeout), n.set(l, {
11954
- element: d.element,
11955
- hideTimeout: setTimeout(() => {
11956
- d.element.removeAttribute("data-active");
11957
- }, 2e3)
11958
- }));
11959
- }
11960
- }
11961
- );
11962
- const r = (s) => {
11963
- const l = document.createElement("span");
11964
- l.classList.add("collaboration-cursor__base");
11965
- const d = document.createElement("span");
11966
- d.setAttribute("contentedEditable", "false"), d.classList.add("collaboration-cursor__caret"), d.setAttribute("style", `background-color: ${s.color}`);
11967
- const c = document.createElement("span");
11968
- return c.classList.add("collaboration-cursor__label"), c.setAttribute("style", `background-color: ${s.color}`), c.insertBefore(document.createTextNode(s.name), null), d.insertBefore(c, null), l.insertBefore(document.createTextNode("⁠"), null), l.insertBefore(d, null), l.insertBefore(document.createTextNode("⁠"), null), l;
11969
- }, a = (s) => {
11970
- var u;
11971
- const l = [...o.getStates().entries()].find(
11972
- (h) => h[1].user === s
11973
- );
11974
- if (!l)
11975
- throw new Error("Could not find client state for user");
11976
- const d = l[0];
11977
- let c = n.get(d);
11978
- if (!c) {
11979
- const h = ((u = e == null ? void 0 : e.renderCursor) == null ? void 0 : u.call(e, s)) || r(s);
11980
- (e == null ? void 0 : e.showCursorLabels) !== "always" && (h.addEventListener("mouseenter", () => {
11981
- const m = n.get(d);
11982
- m.element.setAttribute("data-active", ""), m.hideTimeout && (clearTimeout(m.hideTimeout), n.set(d, {
11983
- element: m.element,
11984
- hideTimeout: void 0
11985
- }));
11986
- }), h.addEventListener("mouseleave", () => {
11987
- const m = n.get(d);
11988
- n.set(d, {
11989
- element: m.element,
11990
- hideTimeout: setTimeout(() => {
11991
- m.element.removeAttribute("data-active");
11992
- }, 2e3)
11993
- });
11994
- })), c = {
11995
- element: h,
11996
- hideTimeout: void 0
11997
- }, n.set(d, c);
11998
- }
11999
- return c.element;
12000
- };
12001
- t.push(
12002
- Qo.configure({
12003
- user: e.user,
12004
- render: a,
12005
- provider: e.provider
12006
- })
12007
- );
12008
- }
12009
- return t;
12010
- }, wa = (e) => {
12144
+ }), wa = (e) => {
12011
12145
  const t = {}, o = xa(e);
12012
12146
  for (const n of o)
12013
12147
  t[n.name] = n;
12014
- t.formattingToolbar = new Or(
12148
+ t.formattingToolbar = new Rr(
12015
12149
  e.editor
12016
- ), t.linkToolbar = new $r(e.editor), t.sideMenu = new ra(
12150
+ ), t.linkToolbar = new Wr(e.editor), t.sideMenu = new aa(
12017
12151
  e.editor,
12018
12152
  e.sideMenuDetection
12019
- ), t.suggestionMenus = new la(e.editor), t.filePanel = new Dr(e.editor), t.placeholder = new Jr(e.editor, e.placeholders), (e.animations ?? !0) && (t.animations = new Qr()), e.tableHandles && (t.tableHandles = new ha(e.editor)), t.dropCursor = {
12153
+ ), t.suggestionMenus = new da(e.editor), t.filePanel = new Hr(e.editor), t.placeholder = new Yr(e.editor, e.placeholders), (e.animations ?? !0) && (t.animations = new ea()), e.tableHandles && (t.tableHandles = new ma(e.editor)), t.dropCursor = {
12020
12154
  plugin: e.dropCursor({
12021
12155
  width: 5,
12022
12156
  color: "#ddeeff",
12023
12157
  editor: e.editor
12024
12158
  })
12025
- }, t.nodeSelectionKeyboard = new Xr();
12159
+ }, t.nodeSelectionKeyboard = new Zr();
12026
12160
  const i = e.disableExtensions || [];
12027
12161
  for (const n of i)
12028
12162
  delete t[n];
@@ -12050,13 +12184,15 @@ const ma = L.create({
12050
12184
  Xo.extend({
12051
12185
  inclusive: !1
12052
12186
  }).configure({
12053
- defaultProtocol: Kr,
12054
- protocols: Wr
12187
+ defaultProtocol: qr,
12188
+ protocols: Kr
12055
12189
  }),
12056
- ...Object.values(e.styleSpecs).map((o) => o.implementation.mark),
12057
- fa,
12190
+ ...Object.values(e.styleSpecs).map((o) => o.implementation.mark.configure({
12191
+ editor: e.editor
12192
+ })),
12193
+ ga,
12058
12194
  Nr,
12059
- ma,
12195
+ fa,
12060
12196
  // make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
12061
12197
  L.create({
12062
12198
  name: "OverrideEscape",
@@ -12067,16 +12203,16 @@ const ma = L.create({
12067
12203
  }
12068
12204
  }),
12069
12205
  // nodes
12070
- ya,
12071
- ka.configure({
12206
+ va,
12207
+ _a.configure({
12072
12208
  editor: e.editor,
12073
12209
  domAttributes: e.domAttributes
12074
12210
  }),
12075
- zr.configure({
12211
+ Fr.configure({
12076
12212
  editor: e.editor,
12077
12213
  tabBehavior: e.tabBehavior
12078
12214
  }),
12079
- _a.configure({
12215
+ ya.configure({
12080
12216
  domAttributes: e.domAttributes
12081
12217
  }),
12082
12218
  ...Object.values(e.inlineContentSpecs).filter((o) => o.config !== "link" && o.config !== "text").map((o) => o.implementation.node.configure({
@@ -12101,9 +12237,9 @@ const ma = L.create({
12101
12237
  Mr(e.editor),
12102
12238
  // This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
12103
12239
  // should be handled before Enter handlers in other components like splitListItem
12104
- ...e.trailingBlock === void 0 || e.trailingBlock ? [ga] : []
12240
+ ...e.trailingBlock === void 0 || e.trailingBlock ? [ba] : []
12105
12241
  ];
12106
- return e.collaboration ? t.push(...va(e.collaboration)) : t.push(qo), t;
12242
+ return e.collaboration ? t.push(...jr(e.collaboration)) : t.push(qo), t;
12107
12243
  };
12108
12244
  function Ca(e, t) {
12109
12245
  const o = [];
@@ -12162,18 +12298,17 @@ function Ba(e, t) {
12162
12298
  }
12163
12299
  return !0;
12164
12300
  }
12165
- const we = class we extends So {
12301
+ const we = class we extends Bo {
12166
12302
  constructor(o, i) {
12167
12303
  super({ ...o, content: void 0 });
12168
12304
  p(this, "_state");
12169
- p(this, "_creating", !1);
12170
12305
  /**
12171
12306
  * Mounts / unmounts the editor to a dom element
12172
12307
  *
12173
12308
  * @param element DOM element to mount to, ur null / undefined to destroy
12174
12309
  */
12175
- p(this, "mount", (o) => {
12176
- o ? (this.options.element = o, this.createViewAlternative()) : (this.destroy(), this._creating = !1);
12310
+ p(this, "mount", (o, i) => {
12311
+ o ? (this.options.element = o, this.createViewAlternative(i)) : this.destroy();
12177
12312
  });
12178
12313
  const n = this.schema;
12179
12314
  let r;
@@ -12182,14 +12317,14 @@ const we = class we extends So {
12182
12317
  if (r)
12183
12318
  return r;
12184
12319
  const d = a.apply(n.nodes.doc, l), c = JSON.parse(JSON.stringify(d.toJSON()));
12185
- return c.content[0].content[0].attrs.id = "initialBlockId", r = ko.fromJSON(n, c), r;
12320
+ return c.content[0].content[0].attrs.id = "initialBlockId", r = _o.fromJSON(n, c), r;
12186
12321
  };
12187
12322
  let s;
12188
12323
  try {
12189
12324
  const l = o == null ? void 0 : o.content.map(
12190
- (d) => Z(d, this.schema, i).toJSON()
12325
+ (d) => J(d, this.schema, i).toJSON()
12191
12326
  );
12192
- s = Bo(
12327
+ s = To(
12193
12328
  {
12194
12329
  type: "doc",
12195
12330
  content: [
@@ -12210,7 +12345,7 @@ const we = class we extends So {
12210
12345
  "Error creating document from blocks passed as `initialContent`:\n" + +JSON.stringify(o.content)
12211
12346
  );
12212
12347
  }
12213
- this._state = Mo.create({
12348
+ this._state = Io.create({
12214
12349
  doc: s,
12215
12350
  schema: this.schema
12216
12351
  // selection: selection || undefined,
@@ -12225,25 +12360,26 @@ const we = class we extends So {
12225
12360
  /**
12226
12361
  * Replace the default `createView` method with a custom one - which we call on mount
12227
12362
  */
12228
- createViewAlternative() {
12229
- this._creating = !0, queueMicrotask(() => {
12230
- if (!this._creating)
12231
- return;
12232
- this.view = new Jo(
12233
- { mount: this.options.element },
12234
- // use mount option so that we reuse the existing element instead of creating a new one
12235
- {
12236
- ...this.options.editorProps,
12237
- // @ts-ignore
12238
- dispatchTransaction: this.dispatchTransaction.bind(this),
12239
- state: this.state
12240
- }
12241
- );
12242
- const o = this.state.reconfigure({
12243
- plugins: this.extensionManager.plugins
12244
- });
12245
- this.view.updateState(o), this.createNodeViews(), this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0, this._creating = !1;
12363
+ createViewAlternative(o) {
12364
+ this.contentComponent = o;
12365
+ const i = {};
12366
+ this.extensionManager.extensions.forEach((r) => {
12367
+ r.type === "mark" && r.config.addMarkView && (i[r.name] = r.config.addMarkView);
12368
+ }), this.view = new Qo(
12369
+ { mount: this.options.element },
12370
+ // use mount option so that we reuse the existing element instead of creating a new one
12371
+ {
12372
+ ...this.options.editorProps,
12373
+ // @ts-ignore
12374
+ dispatchTransaction: this.dispatchTransaction.bind(this),
12375
+ state: this.state,
12376
+ markViews: i
12377
+ }
12378
+ );
12379
+ const n = this.state.reconfigure({
12380
+ plugins: this.extensionManager.plugins
12246
12381
  });
12382
+ this.view.updateState(n), this.createNodeViews(), this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0;
12247
12383
  }
12248
12384
  };
12249
12385
  p(we, "create", (o, i) => {
@@ -12265,7 +12401,7 @@ const Ta = {
12265
12401
  enablePasteRules: !0,
12266
12402
  enableCoreExtensions: !1
12267
12403
  };
12268
- class mo {
12404
+ class fo {
12269
12405
  constructor(t) {
12270
12406
  p(this, "_pmSchema");
12271
12407
  /**
@@ -12328,10 +12464,10 @@ class mo {
12328
12464
  *
12329
12465
  * @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
12330
12466
  */
12331
- p(this, "mount", (t) => {
12332
- this._tiptapEditor.mount(t);
12467
+ p(this, "mount", (t, o) => {
12468
+ this._tiptapEditor.mount(t, o);
12333
12469
  });
12334
- var s, l, d, c, u, h, m;
12470
+ var l, d, c, u, h, m, f;
12335
12471
  this.options = t;
12336
12472
  const o = t;
12337
12473
  if (o.onEditorContentChange)
@@ -12350,7 +12486,7 @@ class mo {
12350
12486
  throw new Error(
12351
12487
  "editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false"
12352
12488
  );
12353
- this.dictionary = t.dictionary || Et;
12489
+ this.dictionary = t.dictionary || St;
12354
12490
  const i = {
12355
12491
  defaultStyles: !0,
12356
12492
  schema: t.schema || fe.create(),
@@ -12377,29 +12513,31 @@ class mo {
12377
12513
  placeholders: i.placeholders,
12378
12514
  tabBehavior: i.tabBehavior,
12379
12515
  sideMenuDetection: i.sideMenuDetection || "viewport"
12380
- }), (((s = i._tiptapOptions) == null ? void 0 : s.extensions) || []).forEach((f) => {
12381
- this.extensions[f.name] = f;
12382
- }), Object.entries(i._extensions || {}).forEach(([f, g]) => {
12383
- typeof g == "function" && (g = g(this)), this.extensions[f] = g;
12516
+ }), (((l = i._tiptapOptions) == null ? void 0 : l.extensions) || []).forEach((g) => {
12517
+ this.extensions[g.name] = g;
12518
+ }), Object.entries(i._extensions || {}).forEach(([g, b]) => {
12519
+ typeof b == "function" && (b = b(this)), this.extensions[g] = b;
12384
12520
  }), this.formattingToolbar = this.extensions.formattingToolbar, this.linkToolbar = this.extensions.linkToolbar, this.sideMenu = this.extensions.sideMenu, this.suggestionMenus = this.extensions.suggestionMenus, this.filePanel = this.extensions.filePanel, this.tableHandles = this.extensions.tableHandles, i.uploadFile) {
12385
- const f = i.uploadFile;
12386
- this.uploadFile = async (g, b) => {
12521
+ const g = i.uploadFile;
12522
+ this.uploadFile = async (b, k) => {
12387
12523
  this.onUploadStartCallbacks.forEach(
12388
- (k) => k.apply(this, [b])
12524
+ (v) => v.apply(this, [k])
12389
12525
  );
12390
12526
  try {
12391
- return await f(g, b);
12527
+ return await g(b, k);
12392
12528
  } finally {
12393
12529
  this.onUploadEndCallbacks.forEach(
12394
- (k) => k.apply(this, [b])
12530
+ (v) => v.apply(this, [k])
12395
12531
  );
12396
12532
  }
12397
12533
  };
12398
12534
  }
12399
- this.resolveFileUrl = i.resolveFileUrl, this.headless = i._headless, i.collaboration && i.initialContent && console.warn(
12535
+ this.resolveFileUrl = i.resolveFileUrl, this.headless = i._headless;
12536
+ const n = "collaboration" in this.extensions || "liveblocksExtension" in this.extensions;
12537
+ n && i.initialContent && console.warn(
12400
12538
  "When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
12401
12539
  );
12402
- const n = i.initialContent || (t.collaboration ? [
12540
+ const r = i.initialContent || (n ? [
12403
12541
  {
12404
12542
  type: "paragraph",
12405
12543
  id: "initialBlockId"
@@ -12410,48 +12548,48 @@ class mo {
12410
12548
  id: ue.options.generateID()
12411
12549
  }
12412
12550
  ]);
12413
- if (!Array.isArray(n) || n.length === 0)
12551
+ if (!Array.isArray(r) || r.length === 0)
12414
12552
  throw new Error(
12415
- "initialContent must be a non-empty array of blocks, received: " + n
12553
+ "initialContent must be a non-empty array of blocks, received: " + r
12416
12554
  );
12417
- const r = [
12418
- ...Object.entries(this.extensions).map(([f, g]) => {
12419
- if (g instanceof L || g instanceof X || g instanceof xe)
12420
- return g;
12421
- if (!g.plugin)
12555
+ const a = [
12556
+ ...Object.entries(this.extensions).map(([g, b]) => {
12557
+ if (b instanceof L || b instanceof Z || b instanceof xe)
12558
+ return b;
12559
+ if (!b.plugin)
12422
12560
  throw new Error(
12423
12561
  "Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property"
12424
12562
  );
12425
12563
  return L.create({
12426
- name: f,
12427
- addProseMirrorPlugins: () => [g.plugin]
12564
+ name: g,
12565
+ addProseMirrorPlugins: () => [b.plugin]
12428
12566
  });
12429
12567
  })
12430
- ], a = {
12568
+ ], s = {
12431
12569
  ...Ta,
12432
12570
  ...i._tiptapOptions,
12433
- content: n,
12434
- extensions: r,
12571
+ content: r,
12572
+ extensions: a,
12435
12573
  editorProps: {
12436
- ...(l = i._tiptapOptions) == null ? void 0 : l.editorProps,
12574
+ ...(d = i._tiptapOptions) == null ? void 0 : d.editorProps,
12437
12575
  attributes: {
12438
12576
  // As of TipTap v2.5.0 the tabIndex is removed when the editor is not
12439
12577
  // editable, so you can't focus it. We want to revert this as we have
12440
12578
  // UI behaviour that relies on it.
12441
12579
  tabIndex: "0",
12442
- ...(c = (d = i._tiptapOptions) == null ? void 0 : d.editorProps) == null ? void 0 : c.attributes,
12443
- ...(u = i.domAttributes) == null ? void 0 : u.editor,
12580
+ ...(u = (c = i._tiptapOptions) == null ? void 0 : c.editorProps) == null ? void 0 : u.attributes,
12581
+ ...(h = i.domAttributes) == null ? void 0 : h.editor,
12444
12582
  class: G(
12445
12583
  "bn-editor",
12446
12584
  i.defaultStyles ? "bn-default-styles" : "",
12447
- ((m = (h = i.domAttributes) == null ? void 0 : h.editor) == null ? void 0 : m.class) || ""
12585
+ ((f = (m = i.domAttributes) == null ? void 0 : m.editor) == null ? void 0 : f.class) || ""
12448
12586
  )
12449
12587
  },
12450
12588
  transformPasted: Sa
12451
12589
  }
12452
12590
  };
12453
- this.headless ? this._pmSchema = To(a.extensions) : (this._tiptapEditor = ve.create(
12454
- a,
12591
+ this.headless ? this._pmSchema = Mo(s.extensions) : (this._tiptapEditor = ve.create(
12592
+ s,
12455
12593
  this.schema.styleSchema
12456
12594
  ), this._pmSchema = this._tiptapEditor.schema);
12457
12595
  }
@@ -12459,7 +12597,7 @@ class mo {
12459
12597
  return this._pmSchema;
12460
12598
  }
12461
12599
  static create(t = {}) {
12462
- return new mo(t);
12600
+ return new fo(t);
12463
12601
  }
12464
12602
  dispatch(t) {
12465
12603
  this._tiptapEditor.dispatch(t);
@@ -12504,7 +12642,7 @@ class mo {
12504
12642
  get document() {
12505
12643
  const t = [];
12506
12644
  return this._tiptapEditor.state.doc.firstChild.descendants((o) => (t.push(
12507
- v(
12645
+ w(
12508
12646
  o,
12509
12647
  this.schema.blockSchema,
12510
12648
  this.schema.inlineContentSchema,
@@ -12604,7 +12742,7 @@ class mo {
12604
12742
  * @param placement Whether the text cursor should be placed at the start or end of the block.
12605
12743
  */
12606
12744
  setTextCursorPosition(t, o = "start") {
12607
- no(this, t, o);
12745
+ ro(this, t, o);
12608
12746
  }
12609
12747
  /**
12610
12748
  * Gets a snapshot of the current selection.
@@ -12705,7 +12843,9 @@ class mo {
12705
12843
  for (const i of o) {
12706
12844
  const n = this.schema.styleSchema[i.type.name];
12707
12845
  if (!n) {
12708
- i.type.name !== "link" && console.warn("mark not found in styleschema", i.type.name);
12846
+ // Links are not considered styles in blocknote
12847
+ i.type.name !== "link" && // "blocknoteIgnore" tagged marks (such as comments) are also not considered BlockNote "styles"
12848
+ !i.type.spec.blocknoteIgnore && console.warn("mark not found in styleschema", i.type.name);
12709
12849
  continue;
12710
12850
  }
12711
12851
  n.propSchema === "boolean" ? t[n.type] = !0 : t[n.type] = i.attrs.stringValue;
@@ -12794,7 +12934,7 @@ class mo {
12794
12934
  * Nests the block containing the text cursor into the block above it.
12795
12935
  */
12796
12936
  nestBlock() {
12797
- oo(this);
12937
+ io(this);
12798
12938
  }
12799
12939
  /**
12800
12940
  * Checks if the block containing the text cursor is nested.
@@ -12854,7 +12994,7 @@ class mo {
12854
12994
  * @returns The blocks parsed from the HTML string.
12855
12995
  */
12856
12996
  async tryParseHTMLToBlocks(t) {
12857
- return ao(
12997
+ return so(
12858
12998
  t,
12859
12999
  this.schema.blockSchema,
12860
13000
  this.schema.inlineContentSchema,
@@ -13094,7 +13234,7 @@ function Ne(e = "") {
13094
13234
  ] : e;
13095
13235
  }
13096
13236
  function le(e) {
13097
- return typeof e == "string" ? Ne(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? Ne(t) : St(t) ? {
13237
+ return typeof e == "string" ? Ne(e) : Array.isArray(e) ? e.flatMap((t) => typeof t == "string" ? Ne(t) : Bt(t) ? {
13098
13238
  ...t,
13099
13239
  content: Ne(t.content)
13100
13240
  } : de(t) ? t : {
@@ -13114,10 +13254,10 @@ function le(e) {
13114
13254
  }
13115
13255
  function Is(e, t) {
13116
13256
  return t.map(
13117
- (o) => fo(e.blockSchema, o)
13257
+ (o) => go(e.blockSchema, o)
13118
13258
  );
13119
13259
  }
13120
- function fo(e, t) {
13260
+ function go(e, t) {
13121
13261
  var n;
13122
13262
  const o = e[t.type].content, i = {
13123
13263
  id: "",
@@ -13148,7 +13288,7 @@ function fo(e, t) {
13148
13288
  return {
13149
13289
  ...i,
13150
13290
  content: le(i.content),
13151
- children: i.children.map((r) => fo(e, r))
13291
+ children: i.children.map((r) => go(e, r))
13152
13292
  };
13153
13293
  }
13154
13294
  function Ma(e) {
@@ -13160,36 +13300,36 @@ function Ia(e) {
13160
13300
  }
13161
13301
  export {
13162
13302
  $i as AudioBlock,
13163
- mo as BlockNoteEditor,
13303
+ fo as BlockNoteEditor,
13164
13304
  fe as BlockNoteSchema,
13165
13305
  Es as COLORS_DARK_MODE_DEFAULT,
13166
13306
  Cs as COLORS_DEFAULT,
13167
13307
  Wi as CodeBlock,
13168
- Kr as DEFAULT_LINK_PROTOCOL,
13308
+ qr as DEFAULT_LINK_PROTOCOL,
13169
13309
  ps as EMPTY_CELL_HEIGHT,
13170
- Kt as EMPTY_CELL_WIDTH,
13310
+ qt as EMPTY_CELL_WIDTH,
13171
13311
  Ss as Exporter,
13172
13312
  Oi as FILE_AUDIO_ICON_SVG,
13173
13313
  Hi as FILE_ICON_SVG,
13174
13314
  hn as FILE_IMAGE_ICON_SVG,
13175
13315
  Un as FILE_VIDEO_ICON_SVG,
13176
13316
  ln as FileBlock,
13177
- Dr as FilePanelProsemirrorPlugin,
13178
- jr as FilePanelView,
13179
- Or as FormattingToolbarProsemirrorPlugin,
13180
- Hr as FormattingToolbarView,
13181
- ao as HTMLToBlocks,
13317
+ Hr as FilePanelProsemirrorPlugin,
13318
+ Dr as FilePanelView,
13319
+ Rr as FormattingToolbarProsemirrorPlugin,
13320
+ Ur as FormattingToolbarView,
13321
+ so as HTMLToBlocks,
13182
13322
  _n as ImageBlock,
13183
- $r as LinkToolbarProsemirrorPlugin,
13323
+ Wr as LinkToolbarProsemirrorPlugin,
13184
13324
  Ji as PageBreak,
13185
- ra as SideMenuProsemirrorPlugin,
13186
- ia as SideMenuView,
13187
- la as SuggestionMenuProseMirrorPlugin,
13188
- ha as TableHandlesProsemirrorPlugin,
13189
- pa as TableHandlesView,
13325
+ aa as SideMenuProsemirrorPlugin,
13326
+ na as SideMenuView,
13327
+ da as SuggestionMenuProseMirrorPlugin,
13328
+ ma as TableHandlesProsemirrorPlugin,
13329
+ ha as TableHandlesView,
13190
13330
  ue as UniqueID,
13191
13331
  D as UnreachableCaseError,
13192
- Wr as VALID_LINK_PROTOCOLS,
13332
+ Kr as VALID_LINK_PROTOCOLS,
13193
13333
  Gn as VideoBlock,
13194
13334
  Ma as addIdsToBlock,
13195
13335
  Ia as addIdsToBlocks,
@@ -13203,7 +13343,7 @@ export {
13203
13343
  Ri as audioPropSchema,
13204
13344
  zi as audioRender,
13205
13345
  Gi as audioToExternalHTML,
13206
- Z as blockToNode,
13346
+ J as blockToNode,
13207
13347
  _r as blocksToMarkdown,
13208
13348
  ye as camelToDataKebab,
13209
13349
  bs as checkBlockHasDefaultProp,
@@ -13218,7 +13358,7 @@ export {
13218
13358
  Xe as cleanHTMLToMarkdown,
13219
13359
  Ms as combineByGroup,
13220
13360
  Se as contentNodeToInlineContent,
13221
- Dt as contentNodeToTableContent,
13361
+ Ht as contentNodeToTableContent,
13222
13362
  Di as createAddFileButton,
13223
13363
  me as createBlockSpec,
13224
13364
  W as createBlockSpecFromStronglyTypedTiptapNode,
@@ -13229,27 +13369,27 @@ export {
13229
13369
  Ui as createFileNameWithIcon,
13230
13370
  ds as createInlineContentSpec,
13231
13371
  Li as createInlineContentSpecFromTipTapNode,
13232
- Nt as createInternalBlockSpec,
13372
+ jt as createInternalBlockSpec,
13233
13373
  Ci as createInternalHTMLSerializer,
13234
13374
  Ii as createInternalInlineContentSpec,
13235
- Ut as createInternalStyleSpec,
13375
+ Ot as createInternalStyleSpec,
13236
13376
  Te as createLinkWithCaption,
13237
- Ft as createResizableFileBlockWrapper,
13377
+ Gt as createResizableFileBlockWrapper,
13238
13378
  $ as createStronglyTypedTiptapNode,
13239
13379
  cs as createStyleSpec,
13240
13380
  K as createStyleSpecFromTipTapMark,
13241
13381
  xs as createSuggestionMenu,
13242
13382
  us as customizeCodeBlock,
13243
13383
  $n as defaultBlockSchema,
13244
- qt as defaultBlockSpecs,
13384
+ Xt as defaultBlockSpecs,
13245
13385
  rt as defaultBlockToHTML,
13246
13386
  Oe as defaultCodeBlockPropSchema,
13247
13387
  Wn as defaultInlineContentSchema,
13248
- Zt as defaultInlineContentSpecs,
13249
- x as defaultProps,
13388
+ Jt as defaultInlineContentSpecs,
13389
+ C as defaultProps,
13250
13390
  hs as defaultStyleSchema,
13251
- Xt as defaultStyleSpecs,
13252
- Y as esmDependencies,
13391
+ Zt as defaultStyleSpecs,
13392
+ Q as esmDependencies,
13253
13393
  nn as fileBlockConfig,
13254
13394
  an as fileParse,
13255
13395
  on as filePropSchema,
@@ -13258,58 +13398,58 @@ export {
13258
13398
  ls as filenameFromURL,
13259
13399
  _s as filterSuggestionItems,
13260
13400
  V as formatKeyboardShortcut,
13261
- Ur as formattingToolbarPluginKey,
13401
+ Or as formattingToolbarPluginKey,
13262
13402
  Si as getBlockFromPos,
13263
13403
  F as getBlockInfo,
13264
13404
  pe as getBlockInfoFromResolvedPos,
13265
13405
  _ as getBlockInfoFromSelection,
13266
13406
  Ge as getBlockInfoWithManualOffset,
13267
13407
  wa as getBlockNoteExtensions,
13268
- jt as getBlockSchemaFromSpecs,
13408
+ Dt as getBlockSchemaFromSpecs,
13269
13409
  Ts as getDefaultEmojiPickerItems,
13270
13410
  ks as getDefaultSlashMenuItems,
13271
13411
  Ai as getInlineContentParseRules,
13272
- Ht as getInlineContentSchemaFromSpecs,
13412
+ Ut as getInlineContentSchemaFromSpecs,
13273
13413
  z as getNearestBlockPos,
13274
13414
  A as getNodeById,
13275
13415
  vs as getPageBreakSlashMenuItems,
13276
13416
  Ti as getParseRules,
13277
13417
  ji as getStyleParseRules,
13278
- Ot as getStyleSchemaFromSpecs,
13418
+ Rt as getStyleSchemaFromSpecs,
13279
13419
  fn as imageBlockConfig,
13280
13420
  bn as imageParse,
13281
13421
  mn as imagePropSchema,
13282
13422
  gn as imageRender,
13283
13423
  kn as imageToExternalHTML,
13284
- Pt as inheritedProps,
13424
+ Nt as inheritedProps,
13285
13425
  qe as initializeESMDependencies,
13286
13426
  H as inlineContentToNodes,
13287
13427
  T as insertOrUpdateBlock,
13288
13428
  Ei as isAppleOS,
13289
13429
  it as isLinkInlineContent,
13290
- St as isPartialLinkInlineContent,
13430
+ Bt as isPartialLinkInlineContent,
13291
13431
  ss as isSafari,
13292
13432
  de as isStyledTextInlineContent,
13293
- Gr as linkToolbarPluginKey,
13433
+ $r as linkToolbarPluginKey,
13294
13434
  rs as locales,
13295
13435
  Bs as mappingFactory,
13296
13436
  Sr as markdownToBlocks,
13297
13437
  G as mergeCSSClasses,
13298
- v as nodeToBlock,
13438
+ w as nodeToBlock,
13299
13439
  Ue as nodeToCustomInlineContent,
13300
13440
  Ki as pageBreakConfig,
13301
13441
  Xi as pageBreakParse,
13302
13442
  qi as pageBreakRender,
13303
- Jt as pageBreakSchema,
13443
+ Yt as pageBreakSchema,
13304
13444
  Zi as pageBreakToExternalHTML,
13305
13445
  dt as parseEmbedElement,
13306
13446
  Be as parseFigureElement,
13307
- fo as partialBlockToBlockForTesting,
13447
+ go as partialBlockToBlockForTesting,
13308
13448
  Is as partialBlocksToBlocksForTesting,
13309
13449
  he as propsToAttributes,
13310
13450
  Ie as shikiHighlighterPromiseSymbol,
13311
13451
  lt as shikiParserSymbol,
13312
- na as sideMenuPluginKey,
13452
+ ra as sideMenuPluginKey,
13313
13453
  Pi as stylePropsToAttributes,
13314
13454
  Ce as tableContentToNodes,
13315
13455
  se as tableHandlesPluginKey,