@blocknote/core 0.25.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/blocknote.cjs +7 -7
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +781 -646
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/comments.cjs +1 -1
  6. package/dist/comments.cjs.map +1 -1
  7. package/dist/comments.js +45 -44
  8. package/dist/comments.js.map +1 -1
  9. package/dist/style.css +1 -1
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/dist/webpack-stats.json +1 -1
  12. package/package.json +2 -2
  13. package/src/api/nodeConversions/nodeToBlock.ts +3 -2
  14. package/src/api/parsers/html/__snapshots__/parse-2-tables.json +129 -0
  15. package/src/api/parsers/html/parseHTML.test.ts +35 -0
  16. package/src/comments/threadstore/ThreadStore.ts +1 -1
  17. package/src/comments/threadstore/yjs/YjsThreadStore.ts +1 -0
  18. package/src/comments/threadstore/yjs/yjsHelpers.ts +3 -1
  19. package/src/comments/types.ts +4 -0
  20. package/src/editor/Block.css +1 -1
  21. package/src/editor/BlockNoteEditor.ts +1 -7
  22. package/src/editor/BlockNoteTipTapEditor.ts +18 -7
  23. package/src/extensions/Comments/CommentMark.ts +0 -1
  24. package/src/extensions/Comments/CommentsPlugin.ts +79 -30
  25. package/src/extensions/SideMenu/dragging.ts +13 -0
  26. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +6 -2
  27. package/src/extensions/TableHandles/TableHandlesPlugin.ts +25 -26
  28. package/src/i18n/locales/ar.ts +4 -0
  29. package/src/i18n/locales/de.ts +15 -1
  30. package/src/i18n/locales/en.ts +4 -0
  31. package/src/i18n/locales/es.ts +15 -1
  32. package/src/i18n/locales/fr.ts +4 -0
  33. package/src/i18n/locales/hr.ts +21 -4
  34. package/src/i18n/locales/is.ts +4 -0
  35. package/src/i18n/locales/it.ts +15 -1
  36. package/src/i18n/locales/ja.ts +4 -0
  37. package/src/i18n/locales/ko.ts +4 -0
  38. package/src/i18n/locales/nl.ts +4 -0
  39. package/src/i18n/locales/no.ts +4 -0
  40. package/src/i18n/locales/pl.ts +4 -0
  41. package/src/i18n/locales/pt.ts +4 -0
  42. package/src/i18n/locales/ru.ts +4 -0
  43. package/src/i18n/locales/uk.ts +4 -0
  44. package/src/i18n/locales/vi.ts +4 -0
  45. package/src/i18n/locales/zh.ts +4 -0
  46. package/types/src/comments/threadstore/ThreadStore.d.ts +1 -1
  47. package/types/src/comments/types.d.ts +4 -0
  48. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -1
  49. package/types/src/extensions/Comments/CommentsPlugin.d.ts +16 -1
  50. package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +47 -0
  51. package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +121 -0
  52. package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +12 -0
  53. package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +97 -0
  54. package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +83 -0
  55. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +79 -0
  56. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +1 -0
  57. package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +15 -0
  58. package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +13 -0
  59. package/types/src/extensions/Comments/types.d.ts +109 -0
  60. package/types/src/i18n/locales/de.d.ts +2 -304
  61. package/types/src/i18n/locales/en.d.ts +4 -0
  62. package/types/src/i18n/locales/es.d.ts +2 -269
  63. package/types/src/i18n/locales/hr.d.ts +2 -266
  64. package/types/src/i18n/locales/it.d.ts +2 -269
  65. package/types/src/models/User.d.ts +5 -0
package/dist/blocknote.js CHANGED
@@ -2,30 +2,30 @@ var Uo = Object.defineProperty;
2
2
  var Ho = (e, o, t) => o in e ? Uo(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
3
  var p = (e, o, t) => Ho(e, typeof o != "symbol" ? o + "" : o, t);
4
4
  import { Slice as ee, Fragment as U, DOMSerializer as Ut, DOMParser as Ht, Node as Oo } from "prosemirror-model";
5
- import { ReplaceStep as Vo, ReplaceAroundStep as ze } from "prosemirror-transform";
6
- import { Extension as j, combineTransactionSteps as zo, getChangedRanges as Fo, findChildrenInRange as $o, Node as de, Mark as ge, InputRule as le, isTextSelection as Ot, callOrReturn as Go, getExtensionField as Wo, selectionToInsertionEnd as Ko, mergeAttributes as qo, isNodeSelection as Fe, posToDOMRect as Te, getMarkRange as pt, findChildren as mt, findParentNode as Xo, extensions as ce, Editor as Zo, createDocument as Jo, getSchema as Yo } from "@tiptap/core";
5
+ import { ReplaceStep as zo, ReplaceAroundStep as Ve } from "prosemirror-transform";
6
+ import { Extension as j, combineTransactionSteps as Vo, getChangedRanges as Fo, findChildrenInRange as $o, Node as de, Mark as ge, InputRule as le, isTextSelection as Ot, callOrReturn as Go, getExtensionField as Ko, selectionToInsertionEnd as Wo, mergeAttributes as qo, isNodeSelection as Fe, posToDOMRect as Te, getMarkRange as pt, findChildren as mt, findParentNode as Zo, extensions as ce, Editor as Xo, createDocument as Jo, getSchema as Yo } from "@tiptap/core";
7
7
  import { Plugin as T, PluginKey as A, TextSelection as V, NodeSelection as be, Selection as De, EditorState as Qo } from "prosemirror-state";
8
- import { v4 as Vt } from "uuid";
8
+ import { v4 as zt } from "uuid";
9
9
  import { createHighlightPlugin as ei } from "prosemirror-highlight";
10
10
  import { createParser as ti } from "prosemirror-highlight/shiki";
11
- import { bundledLanguagesInfo as zt, createHighlighter as oi } from "shiki";
12
- import { columnResizing as ii, tableEditing as ni, goToNextCell as ht, TableView as ri, CellSelection as ke, TableMap as ft, addRowBefore as ai, addRowAfter as si, addColumnBefore as li, addColumnAfter as di, deleteRow as ci, deleteColumn as ui, mergeCells as pi, splitCell as mi } from "prosemirror-tables";
11
+ import { bundledLanguagesInfo as Vt, createHighlighter as oi } from "shiki";
12
+ import { columnResizing as ii, tableEditing as ni, goToNextCell as ht, TableView as ri, CellSelection as _e, TableMap as ft, addRowBefore as ai, addRowAfter as si, addColumnBefore as li, addColumnAfter as di, deleteRow as ci, deleteColumn as ui, mergeCells as pi, splitCell as mi } from "prosemirror-tables";
13
13
  import hi from "@tiptap/extension-bold";
14
14
  import fi from "@tiptap/extension-code";
15
15
  import gi from "@tiptap/extension-italic";
16
16
  import bi from "@tiptap/extension-strike";
17
- import ki from "@tiptap/extension-underline";
18
- import { TableCell as _i } from "@tiptap/extension-table-cell";
17
+ import _i from "@tiptap/extension-underline";
18
+ import { TableCell as ki } from "@tiptap/extension-table-cell";
19
19
  import { TableHeader as wi } from "@tiptap/extension-table-header";
20
- import { TableRow as yi } from "@tiptap/extension-table-row";
21
- import { Gapcursor as vi } from "@tiptap/extension-gapcursor";
20
+ import { TableRow as vi } from "@tiptap/extension-table-row";
21
+ import { Gapcursor as yi } from "@tiptap/extension-gapcursor";
22
22
  import { HardBreak as Ci } from "@tiptap/extension-hard-break";
23
23
  import { History as xi } from "@tiptap/extension-history";
24
24
  import { Link as Si } from "@tiptap/extension-link";
25
25
  import { Text as Ei } from "@tiptap/extension-text";
26
26
  import Bi from "@tiptap/extension-collaboration";
27
27
  import Ti from "@tiptap/extension-collaboration-cursor";
28
- import { DecorationSet as N, Decoration as F, EditorView as Mi } from "prosemirror-view";
28
+ import { DecorationSet as H, Decoration as F, EditorView as Mi } from "prosemirror-view";
29
29
  import { ySyncPluginKey as Ft, getRelativeSelection as Li } from "y-prosemirror";
30
30
  import { dropCursor as Ii } from "prosemirror-dropcursor";
31
31
  const Ai = {
@@ -351,6 +351,10 @@ const Ai = {
351
351
  },
352
352
  reactions: {
353
353
  reacted_by: "تفاعل بواسطة"
354
+ },
355
+ sidebar: {
356
+ marked_as_resolved: "تم وضع علامة كتم الحل",
357
+ more_replies: (e) => `${e} ردود أخرى`
354
358
  }
355
359
  },
356
360
  generic: {
@@ -511,7 +515,9 @@ const Ai = {
511
515
  },
512
516
  drag_handle: {
513
517
  delete_menuitem: "Löschen",
514
- colors_menuitem: "Farben"
518
+ colors_menuitem: "Farben",
519
+ header_row_menuitem: "Kopfzeile",
520
+ header_column_menuitem: "Kopfspalte"
515
521
  },
516
522
  table_handle: {
517
523
  delete_column_menuitem: "Spalte löschen",
@@ -519,7 +525,10 @@ const Ai = {
519
525
  add_left_menuitem: "Spalte links hinzufügen",
520
526
  add_right_menuitem: "Spalte rechts hinzufügen",
521
527
  add_above_menuitem: "Zeile oberhalb hinzufügen",
522
- add_below_menuitem: "Zeile unterhalb hinzufügen"
528
+ add_below_menuitem: "Zeile unterhalb hinzufügen",
529
+ split_cell_menuitem: "Zelle teilen",
530
+ merge_cells_menuitem: "Zellen zusammenführen",
531
+ background_color_menuitem: "Hintergrundfarbe"
523
532
  },
524
533
  suggestion_menu: {
525
534
  no_items_title: "Keine Elemente gefunden",
@@ -634,6 +643,9 @@ const Ai = {
634
643
  align_justify: {
635
644
  tooltip: "Text Blocksatz"
636
645
  },
646
+ table_cell_merge: {
647
+ tooltip: "Zellen zusammenführen"
648
+ },
637
649
  comment: {
638
650
  tooltip: "Kommentar hinzufügen"
639
651
  }
@@ -686,6 +698,10 @@ const Ai = {
686
698
  },
687
699
  reactions: {
688
700
  reacted_by: "Reagiert von"
701
+ },
702
+ sidebar: {
703
+ marked_as_resolved: "Als gelöst markiert",
704
+ more_replies: (e) => `${e} weitere Antworten`
689
705
  }
690
706
  },
691
707
  generic: {
@@ -1031,12 +1047,16 @@ const Ai = {
1031
1047
  },
1032
1048
  reactions: {
1033
1049
  reacted_by: "Reacted by"
1050
+ },
1051
+ sidebar: {
1052
+ marked_as_resolved: "Marked as resolved",
1053
+ more_replies: (e) => `${e} more replies`
1034
1054
  }
1035
1055
  },
1036
1056
  generic: {
1037
1057
  ctrl_shortcut: "Ctrl"
1038
1058
  }
1039
- }, Ni = {
1059
+ }, ji = {
1040
1060
  slash_menu: {
1041
1061
  heading: {
1042
1062
  title: "Encabezado 1",
@@ -1190,7 +1210,9 @@ const Ai = {
1190
1210
  },
1191
1211
  drag_handle: {
1192
1212
  delete_menuitem: "Eliminar",
1193
- colors_menuitem: "Colores"
1213
+ colors_menuitem: "Colores",
1214
+ header_row_menuitem: "Fila de encabezado",
1215
+ header_column_menuitem: "Columna de encabezado"
1194
1216
  },
1195
1217
  table_handle: {
1196
1218
  delete_column_menuitem: "Eliminar columna",
@@ -1198,7 +1220,10 @@ const Ai = {
1198
1220
  add_left_menuitem: "Agregar columna a la izquierda",
1199
1221
  add_right_menuitem: "Agregar columna a la derecha",
1200
1222
  add_above_menuitem: "Agregar fila arriba",
1201
- add_below_menuitem: "Agregar fila abajo"
1223
+ add_below_menuitem: "Agregar fila abajo",
1224
+ split_cell_menuitem: "Dividir celda",
1225
+ merge_cells_menuitem: "Combinar celdas",
1226
+ background_color_menuitem: "Color de fondo"
1202
1227
  },
1203
1228
  suggestion_menu: {
1204
1229
  no_items_title: "No se encontraron elementos",
@@ -1313,6 +1338,9 @@ const Ai = {
1313
1338
  align_justify: {
1314
1339
  tooltip: "Justificar texto"
1315
1340
  },
1341
+ table_cell_merge: {
1342
+ tooltip: "Combinar celdas"
1343
+ },
1316
1344
  comment: {
1317
1345
  tooltip: "Añadir comentario"
1318
1346
  }
@@ -1365,12 +1393,16 @@ const Ai = {
1365
1393
  },
1366
1394
  reactions: {
1367
1395
  reacted_by: "Reaccionado por"
1396
+ },
1397
+ sidebar: {
1398
+ marked_as_resolved: "Marcado como resuelto",
1399
+ more_replies: (e) => `${e} respuestas más`
1368
1400
  }
1369
1401
  },
1370
1402
  generic: {
1371
1403
  ctrl_shortcut: "Ctrl"
1372
1404
  }
1373
- }, ji = {
1405
+ }, Ni = {
1374
1406
  slash_menu: {
1375
1407
  heading: {
1376
1408
  title: "Titre 1",
@@ -1730,6 +1762,10 @@ const Ai = {
1730
1762
  },
1731
1763
  reactions: {
1732
1764
  reacted_by: "Réagi par"
1765
+ },
1766
+ sidebar: {
1767
+ marked_as_resolved: "Marqué comme résolu",
1768
+ more_replies: (e) => `${e} réponses de plus`
1733
1769
  }
1734
1770
  },
1735
1771
  generic: {
@@ -1805,6 +1841,12 @@ const Ai = {
1805
1841
  aliases: ["tablica"],
1806
1842
  group: "Napredno"
1807
1843
  },
1844
+ code_block: {
1845
+ title: "Blok koda",
1846
+ subtext: "Blok koda sa sintaksnim isticanjem",
1847
+ aliases: ["code", "pre"],
1848
+ group: "Osnovni blokovi"
1849
+ },
1808
1850
  page_break: {
1809
1851
  title: "Prijelom stranice",
1810
1852
  subtext: "Razdjelnik stranice",
@@ -1864,9 +1906,6 @@ const Ai = {
1864
1906
  subtext: "Pretraži i umetni emoji",
1865
1907
  aliases: ["emoji", "emotikon", "emocija", "lice"],
1866
1908
  group: "Ostalo"
1867
- },
1868
- comment: {
1869
- tooltip: "Dodaj komentar"
1870
1909
  }
1871
1910
  },
1872
1911
  placeholders: {
@@ -1900,7 +1939,9 @@ const Ai = {
1900
1939
  },
1901
1940
  drag_handle: {
1902
1941
  delete_menuitem: "Ukloni",
1903
- colors_menuitem: "Boje"
1942
+ colors_menuitem: "Boje",
1943
+ header_row_menuitem: "Zaglavni redak",
1944
+ header_column_menuitem: "Zaglavni stupac"
1904
1945
  },
1905
1946
  table_handle: {
1906
1947
  delete_column_menuitem: "Ukloni stupac",
@@ -1908,7 +1949,10 @@ const Ai = {
1908
1949
  add_left_menuitem: "Dodaj stupac lijevo",
1909
1950
  add_right_menuitem: "Dodaj stupac desno",
1910
1951
  add_above_menuitem: "Dodaj redak iznad",
1911
- add_below_menuitem: "Dodaj redak ispod"
1952
+ add_below_menuitem: "Dodaj redak ispod",
1953
+ split_cell_menuitem: "Podijeli ćeliju",
1954
+ merge_cells_menuitem: "Spoji ćelije",
1955
+ background_color_menuitem: "Boja pozadine"
1912
1956
  },
1913
1957
  suggestion_menu: {
1914
1958
  no_items_title: "Stavke nisu pronađene",
@@ -2023,6 +2067,9 @@ const Ai = {
2023
2067
  align_justify: {
2024
2068
  tooltip: "Poravnaj tekst obostrano"
2025
2069
  },
2070
+ table_cell_merge: {
2071
+ tooltip: "Spoji ćelije"
2072
+ },
2026
2073
  comment: {
2027
2074
  tooltip: "Dodaj komentar"
2028
2075
  }
@@ -2075,6 +2122,10 @@ const Ai = {
2075
2122
  },
2076
2123
  reactions: {
2077
2124
  reacted_by: "Reagirao/la"
2125
+ },
2126
+ sidebar: {
2127
+ marked_as_resolved: "Označeno kao riješeno",
2128
+ more_replies: (e) => `${e} dodatnih odgovora`
2078
2129
  }
2079
2130
  },
2080
2131
  generic: {
@@ -2410,6 +2461,10 @@ const Ai = {
2410
2461
  },
2411
2462
  reactions: {
2412
2463
  reacted_by: "Brást við af"
2464
+ },
2465
+ sidebar: {
2466
+ marked_as_resolved: "Merkt sem leyst",
2467
+ more_replies: (e) => `${e} fleiri svör`
2413
2468
  }
2414
2469
  },
2415
2470
  generic: {
@@ -2571,7 +2626,9 @@ const Ai = {
2571
2626
  },
2572
2627
  drag_handle: {
2573
2628
  delete_menuitem: "Elimina",
2574
- colors_menuitem: "Colori"
2629
+ colors_menuitem: "Colori",
2630
+ header_row_menuitem: "Riga intestazione",
2631
+ header_column_menuitem: "Colonna intestazione"
2575
2632
  },
2576
2633
  table_handle: {
2577
2634
  delete_column_menuitem: "Elimina colonna",
@@ -2579,7 +2636,10 @@ const Ai = {
2579
2636
  add_left_menuitem: "Aggiungi colonna a sinistra",
2580
2637
  add_right_menuitem: "Aggiungi colonna a destra",
2581
2638
  add_above_menuitem: "Aggiungi riga sopra",
2582
- add_below_menuitem: "Aggiungi riga sotto"
2639
+ add_below_menuitem: "Aggiungi riga sotto",
2640
+ split_cell_menuitem: "Dividi cella",
2641
+ merge_cells_menuitem: "Unisci celle",
2642
+ background_color_menuitem: "Colore di sfondo"
2583
2643
  },
2584
2644
  suggestion_menu: {
2585
2645
  no_items_title: "Nessun elemento trovato",
@@ -2694,6 +2754,9 @@ const Ai = {
2694
2754
  align_justify: {
2695
2755
  tooltip: "Giustifica testo"
2696
2756
  },
2757
+ table_cell_merge: {
2758
+ tooltip: "Unisci celle"
2759
+ },
2697
2760
  comment: {
2698
2761
  tooltip: "Aggiungi commento"
2699
2762
  }
@@ -2746,6 +2809,10 @@ const Ai = {
2746
2809
  },
2747
2810
  reactions: {
2748
2811
  reacted_by: "Reagito da"
2812
+ },
2813
+ sidebar: {
2814
+ marked_as_resolved: "Contrassegnato come risolto",
2815
+ more_replies: (e) => `${e} altre risposte`
2749
2816
  }
2750
2817
  },
2751
2818
  generic: {
@@ -3109,6 +3176,10 @@ const Ai = {
3109
3176
  },
3110
3177
  reactions: {
3111
3178
  reacted_by: "リアクションした人"
3179
+ },
3180
+ sidebar: {
3181
+ marked_as_resolved: "解決済みとしてマーク",
3182
+ more_replies: (e) => `${e} 件の追加返信`
3112
3183
  }
3113
3184
  },
3114
3185
  generic: {
@@ -3465,12 +3536,16 @@ const Ai = {
3465
3536
  },
3466
3537
  reactions: {
3467
3538
  reacted_by: "반응한 사람"
3539
+ },
3540
+ sidebar: {
3541
+ marked_as_resolved: "해결됨으로 표시됨",
3542
+ more_replies: (e) => `${e}개의 추가 답글`
3468
3543
  }
3469
3544
  },
3470
3545
  generic: {
3471
3546
  ctrl_shortcut: "Ctrl"
3472
3547
  }
3473
- }, Vi = {
3548
+ }, zi = {
3474
3549
  slash_menu: {
3475
3550
  heading: {
3476
3551
  title: "Kop 1",
@@ -3808,12 +3883,16 @@ const Ai = {
3808
3883
  },
3809
3884
  reactions: {
3810
3885
  reacted_by: "Gereageerd door"
3886
+ },
3887
+ sidebar: {
3888
+ marked_as_resolved: "Gemarkeerd als opgelost",
3889
+ more_replies: (e) => `${e} extra reacties`
3811
3890
  }
3812
3891
  },
3813
3892
  generic: {
3814
3893
  ctrl_shortcut: "Ctrl"
3815
3894
  }
3816
- }, zi = {
3895
+ }, Vi = {
3817
3896
  slash_menu: {
3818
3897
  heading: {
3819
3898
  title: "Overskrift 1",
@@ -4151,6 +4230,10 @@ const Ai = {
4151
4230
  },
4152
4231
  reactions: {
4153
4232
  reacted_by: "Reagert av"
4233
+ },
4234
+ sidebar: {
4235
+ marked_as_resolved: "Merket som løst",
4236
+ more_replies: (e) => `${e} flere svar`
4154
4237
  }
4155
4238
  },
4156
4239
  generic: {
@@ -4478,6 +4561,10 @@ const Ai = {
4478
4561
  },
4479
4562
  reactions: {
4480
4563
  reacted_by: "Zareagowali"
4564
+ },
4565
+ sidebar: {
4566
+ marked_as_resolved: "Oznaczone jako rozwiązane",
4567
+ more_replies: (e) => `${e} więcej odpowiedzi`
4481
4568
  }
4482
4569
  },
4483
4570
  generic: {
@@ -4813,6 +4900,10 @@ const Ai = {
4813
4900
  },
4814
4901
  reactions: {
4815
4902
  reacted_by: "Reagido por"
4903
+ },
4904
+ sidebar: {
4905
+ marked_as_resolved: "Marcado como resolvido",
4906
+ more_replies: (e) => `${e} respostas a mais`
4816
4907
  }
4817
4908
  },
4818
4909
  generic: {
@@ -5183,12 +5274,16 @@ const Ai = {
5183
5274
  },
5184
5275
  reactions: {
5185
5276
  reacted_by: "Отреагировал(а)"
5277
+ },
5278
+ sidebar: {
5279
+ marked_as_resolved: "Отмечено как решенное",
5280
+ more_replies: (e) => `${e} дополнительных ответов`
5186
5281
  }
5187
5282
  },
5188
5283
  generic: {
5189
5284
  ctrl_shortcut: "Ctrl"
5190
5285
  }
5191
- }, Wi = {
5286
+ }, Ki = {
5192
5287
  slash_menu: {
5193
5288
  heading: {
5194
5289
  title: "Заголовок 1",
@@ -5551,12 +5646,16 @@ const Ai = {
5551
5646
  },
5552
5647
  reactions: {
5553
5648
  reacted_by: "Відреагував(ла)"
5649
+ },
5650
+ sidebar: {
5651
+ marked_as_resolved: "Позначено як вирішене",
5652
+ more_replies: (e) => `${e} додаткових відповідей`
5554
5653
  }
5555
5654
  },
5556
5655
  generic: {
5557
5656
  ctrl_shortcut: "Ctrl"
5558
5657
  }
5559
- }, Ki = {
5658
+ }, Wi = {
5560
5659
  slash_menu: {
5561
5660
  heading: {
5562
5661
  title: "Tiêu đề H1",
@@ -5893,6 +5992,10 @@ const Ai = {
5893
5992
  },
5894
5993
  reactions: {
5895
5994
  reacted_by: "Phản ứng bởi"
5995
+ },
5996
+ sidebar: {
5997
+ marked_as_resolved: "Đã đánh dấu là đã giải quyết",
5998
+ more_replies: (e) => `${e} câu trả lời nữa`
5896
5999
  }
5897
6000
  },
5898
6001
  generic: {
@@ -6269,38 +6372,42 @@ const Ai = {
6269
6372
  },
6270
6373
  reactions: {
6271
6374
  reacted_by: "已回应"
6375
+ },
6376
+ sidebar: {
6377
+ marked_as_resolved: "标记为已解决",
6378
+ more_replies: (e) => `还有 ${e} 条回复`
6272
6379
  }
6273
6380
  },
6274
6381
  generic: {
6275
6382
  ctrl_shortcut: "Ctrl"
6276
6383
  }
6277
- }, Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6384
+ }, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6278
6385
  __proto__: null,
6279
6386
  ar: Ai,
6280
6387
  de: Pi,
6281
6388
  en: $t,
6282
- es: Ni,
6283
- fr: ji,
6389
+ es: ji,
6390
+ fr: Ni,
6284
6391
  hr: Ri,
6285
6392
  is: Di,
6286
6393
  it: Ui,
6287
6394
  ja: Hi,
6288
6395
  ko: Oi,
6289
- nl: Vi,
6290
- no: zi,
6396
+ nl: zi,
6397
+ no: Vi,
6291
6398
  pl: Fi,
6292
6399
  pt: $i,
6293
6400
  ru: Gi,
6294
- uk: Wi,
6295
- vi: Ki,
6401
+ uk: Ki,
6402
+ vi: Wi,
6296
6403
  zh: qi
6297
6404
  }, Symbol.toStringTag, { value: "Module" }));
6298
- class H extends Error {
6405
+ class O extends Error {
6299
6406
  constructor(o) {
6300
6407
  super(`Unreachable case: ${o}`);
6301
6408
  }
6302
6409
  }
6303
- function Zs(e, o = !0) {
6410
+ function Xs(e, o = !0) {
6304
6411
  const { "data-test": t, ...i } = e;
6305
6412
  if (Object.keys(i).length > 0 && o)
6306
6413
  throw new Error("Object must be empty " + JSON.stringify(e));
@@ -6388,29 +6495,29 @@ function tt(e, o) {
6388
6495
  function te(e) {
6389
6496
  return tt(e.node, e.posBeforeNode);
6390
6497
  }
6391
- function _e(e) {
6498
+ function ke(e) {
6392
6499
  if (!e.nodeAfter)
6393
6500
  throw new Error(
6394
6501
  `Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`
6395
6502
  );
6396
6503
  return tt(e.nodeAfter, e.pos);
6397
6504
  }
6398
- function y(e) {
6505
+ function v(e) {
6399
6506
  const o = q(e.doc, e.selection.anchor);
6400
6507
  return te(o);
6401
6508
  }
6402
- function Xi(e, o = JSON.stringify) {
6509
+ function Zi(e, o = JSON.stringify) {
6403
6510
  const t = {};
6404
6511
  return e.filter((i) => {
6405
6512
  const n = o(i);
6406
6513
  return Object.prototype.hasOwnProperty.call(t, n) ? !1 : t[n] = !0;
6407
6514
  });
6408
6515
  }
6409
- function Zi(e) {
6516
+ function Xi(e) {
6410
6517
  const o = e.filter(
6411
6518
  (i, n) => e.indexOf(i) !== n
6412
6519
  );
6413
- return Xi(o);
6520
+ return Zi(o);
6414
6521
  }
6415
6522
  const we = j.create({
6416
6523
  name: "uniqueID",
@@ -6427,7 +6534,7 @@ const we = j.create({
6427
6534
  const e = window.__TEST_OPTIONS;
6428
6535
  return e.mockID === void 0 ? e.mockID = 0 : e.mockID++, e.mockID.toString();
6429
6536
  }
6430
- return Vt();
6537
+ return zt();
6431
6538
  },
6432
6539
  filterTransaction: null
6433
6540
  };
@@ -6490,25 +6597,25 @@ const we = j.create({
6490
6597
  new T({
6491
6598
  key: new A("uniqueID"),
6492
6599
  appendTransaction: (t, i, n) => {
6493
- const r = t.some((g) => g.docChanged) && !i.doc.eq(n.doc), a = this.options.filterTransaction && t.some((g) => {
6494
- let f, b;
6495
- return !(!((b = (f = this.options).filterTransaction) === null || b === void 0) && b.call(f, g));
6600
+ const r = t.some((f) => f.docChanged) && !i.doc.eq(n.doc), a = this.options.filterTransaction && t.some((f) => {
6601
+ let g, b;
6602
+ return !(!((b = (g = this.options).filterTransaction) === null || b === void 0) && b.call(g, f));
6496
6603
  });
6497
6604
  if (!r || a)
6498
6605
  return;
6499
- const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = zo(
6606
+ const { tr: s } = n, { types: l, attributeName: d, generateID: c } = this.options, u = Vo(
6500
6607
  i.doc,
6501
6608
  t
6502
6609
  ), { mapping: m } = u;
6503
- if (Fo(u).forEach(({ newRange: g }) => {
6504
- const f = $o(
6610
+ if (Fo(u).forEach(({ newRange: f }) => {
6611
+ const g = $o(
6505
6612
  n.doc,
6506
- g,
6507
- (_) => l.includes(_.type.name)
6508
- ), b = f.map(({ node: _ }) => _.attrs[d]).filter((_) => _ !== null), k = Zi(b);
6509
- f.forEach(({ node: _, pos: w }) => {
6510
- let v;
6511
- const C = (v = s.doc.nodeAt(w)) === null || v === void 0 ? void 0 : v.attrs[d];
6613
+ f,
6614
+ (k) => l.includes(k.type.name)
6615
+ ), b = g.map(({ node: k }) => k.attrs[d]).filter((k) => k !== null), _ = Xi(b);
6616
+ g.forEach(({ node: k, pos: w }) => {
6617
+ let y;
6618
+ const C = (y = s.doc.nodeAt(w)) === null || y === void 0 ? void 0 : y.attrs[d];
6512
6619
  if (C === null) {
6513
6620
  const E = i.doc.type.createAndFill().content;
6514
6621
  if (i.doc.content.findDiffStart(E) === null) {
@@ -6517,21 +6624,21 @@ const we = j.create({
6517
6624
  );
6518
6625
  if (ut.content[0].content[0].attrs.id = "initialBlockId", JSON.stringify(ut.content) === JSON.stringify(E.toJSON())) {
6519
6626
  s.setNodeMarkup(w, void 0, {
6520
- ..._.attrs,
6627
+ ...k.attrs,
6521
6628
  [d]: "initialBlockId"
6522
6629
  });
6523
6630
  return;
6524
6631
  }
6525
6632
  }
6526
6633
  s.setNodeMarkup(w, void 0, {
6527
- ..._.attrs,
6634
+ ...k.attrs,
6528
6635
  [d]: c()
6529
6636
  });
6530
6637
  return;
6531
6638
  }
6532
- const { deleted: O } = m.invert().mapResult(w);
6533
- O && k.includes(C) && s.setNodeMarkup(w, void 0, {
6534
- ..._.attrs,
6639
+ const { deleted: z } = m.invert().mapResult(w);
6640
+ z && _.includes(C) && s.setNodeMarkup(w, void 0, {
6641
+ ...k.attrs,
6535
6642
  [d]: c()
6536
6643
  });
6537
6644
  });
@@ -6608,7 +6715,7 @@ function gt(e) {
6608
6715
  function ot(e) {
6609
6716
  return typeof e != "string" && e.type === "link";
6610
6717
  }
6611
- function X(e) {
6718
+ function Z(e) {
6612
6719
  return typeof e != "string" && e.type === "text";
6613
6720
  }
6614
6721
  function $e(e) {
@@ -6648,23 +6755,23 @@ function Ge(e) {
6648
6755
  return it(e) ? e.props.rowspan ?? 1 : 1;
6649
6756
  }
6650
6757
  const Ji = () => typeof navigator < "u" && (/Mac/.test(navigator.platform) || /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent));
6651
- function K(e, o = "Ctrl") {
6758
+ function W(e, o = "Ctrl") {
6652
6759
  return Ji() ? e.replace("Mod", "⌘") : e.replace("Mod", o);
6653
6760
  }
6654
- function Z(...e) {
6761
+ function X(...e) {
6655
6762
  return e.filter((o) => o).join(" ");
6656
6763
  }
6657
6764
  const Js = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
6658
6765
  function $(e, o, t, i) {
6659
6766
  const n = document.createElement("div");
6660
- n.className = Z(
6767
+ n.className = X(
6661
6768
  "bn-block-content",
6662
6769
  t.class
6663
6770
  ), n.setAttribute("data-content-type", e);
6664
6771
  for (const [a, s] of Object.entries(t))
6665
6772
  a !== "class" && n.setAttribute(a, s);
6666
6773
  const r = document.createElement(o);
6667
- r.className = Z(
6774
+ r.className = X(
6668
6775
  "bn-inline-content",
6669
6776
  i.class
6670
6777
  );
@@ -6711,7 +6818,7 @@ function Ys(e) {
6711
6818
  return !o.length || // invalid?
6712
6819
  o[o.length - 1] === "" ? e : o[o.length - 1];
6713
6820
  }
6714
- function ye(e) {
6821
+ function ve(e) {
6715
6822
  const o = {};
6716
6823
  return Object.entries(e).filter(([t, i]) => !Gt.includes(t)).forEach(([t, i]) => {
6717
6824
  o[t] = {
@@ -6756,7 +6863,7 @@ function xe(e, o, t, i, n = !1, r) {
6756
6863
  if (r !== void 0)
6757
6864
  for (const [s, l] of Object.entries(r))
6758
6865
  s !== "class" && a.setAttribute(s, l);
6759
- a.className = Z(
6866
+ a.className = X(
6760
6867
  "bn-block-content",
6761
6868
  (r == null ? void 0 : r.class) || ""
6762
6869
  ), a.setAttribute("data-content-type", o);
@@ -6764,7 +6871,7 @@ function xe(e, o, t, i, n = !1, r) {
6764
6871
  const c = i[s].default;
6765
6872
  !Gt.includes(s) && l !== c && a.setAttribute(Me(s), l);
6766
6873
  }
6767
- return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = Z(
6874
+ return n && a.setAttribute("data-file-block", ""), a.appendChild(e.dom), e.contentDOM !== void 0 && (e.contentDOM.className = X(
6768
6875
  "bn-inline-content",
6769
6876
  e.contentDOM.className
6770
6877
  ), e.contentDOM.setAttribute("data-editable", "")), {
@@ -6775,14 +6882,14 @@ function xe(e, o, t, i, n = !1, r) {
6775
6882
  function G(e) {
6776
6883
  return de.create(e);
6777
6884
  }
6778
- function Wt(e, o) {
6885
+ function Kt(e, o) {
6779
6886
  return {
6780
6887
  config: e,
6781
6888
  implementation: o
6782
6889
  };
6783
6890
  }
6784
6891
  function J(e, o, t) {
6785
- return Wt(
6892
+ return Kt(
6786
6893
  {
6787
6894
  type: e.name,
6788
6895
  content: e.config.content === "inline*" ? "inline" : e.config.content === "tableRow+" ? "table" : "none",
@@ -6797,7 +6904,7 @@ function J(e, o, t) {
6797
6904
  }
6798
6905
  );
6799
6906
  }
6800
- function Kt(e) {
6907
+ function Wt(e) {
6801
6908
  return Object.fromEntries(
6802
6909
  Object.entries(e).map(([o, t]) => [o, t.config])
6803
6910
  );
@@ -6824,7 +6931,7 @@ function en(e, o) {
6824
6931
  }
6825
6932
  }), t;
6826
6933
  }
6827
- function ve(e, o) {
6934
+ function ye(e, o) {
6828
6935
  const t = G({
6829
6936
  name: e.type,
6830
6937
  content: e.content === "inline" ? "inline*" : "",
@@ -6832,7 +6939,7 @@ function ve(e, o) {
6832
6939
  selectable: e.isSelectable ?? !0,
6833
6940
  isolating: !0,
6834
6941
  addAttributes() {
6835
- return ye(e.propSchema);
6942
+ return ve(e.propSchema);
6836
6943
  },
6837
6944
  parseHTML() {
6838
6945
  return en(e, o.parse);
@@ -6874,7 +6981,7 @@ function ve(e, o) {
6874
6981
  throw new Error(
6875
6982
  "Node name does not match block type. This is a bug in BlockNote."
6876
6983
  );
6877
- return Wt(e, {
6984
+ return Kt(e, {
6878
6985
  node: t,
6879
6986
  toInternalHTML: (i, n) => {
6880
6987
  var s;
@@ -6909,7 +7016,7 @@ function ve(e, o) {
6909
7016
  });
6910
7017
  }
6911
7018
  function qt(e, o, t) {
6912
- var r;
7019
+ var r, a;
6913
7020
  const i = {
6914
7021
  type: "tableContent",
6915
7022
  columnWidths: [],
@@ -6917,37 +7024,37 @@ function qt(e, o, t) {
6917
7024
  headerCols: void 0,
6918
7025
  rows: []
6919
7026
  }, n = [];
6920
- e.content.forEach((a, s, l) => {
6921
- const d = {
7027
+ e.content.forEach((s, l, d) => {
7028
+ const c = {
6922
7029
  cells: []
6923
7030
  };
6924
- l === 0 && a.content.forEach((c) => {
6925
- let u = c.attrs.colwidth;
6926
- u == null && (u = new Array(c.attrs.colspan ?? 1).fill(void 0)), i.columnWidths.push(...u);
6927
- }), d.cells = a.content.content.map((c, u) => (n[l] || (n[l] = []), n[l][u] = c.type.name === "tableHeader", {
7031
+ d === 0 && s.content.forEach((u) => {
7032
+ let m = u.attrs.colwidth;
7033
+ m == null && (m = new Array(u.attrs.colspan ?? 1).fill(void 0)), i.columnWidths.push(...m);
7034
+ }), c.cells = s.content.content.map((u, m) => (n[d] || (n[d] = []), n[d][m] = u.type.name === "tableHeader", {
6928
7035
  type: "tableCell",
6929
- content: c.content.content.map(
6930
- (h) => Ae(h, o, t)
6931
- ).reduce((h, g) => {
6932
- if (!h.length)
7036
+ content: u.content.content.map(
7037
+ (f) => Ae(f, o, t)
7038
+ ).reduce((f, g) => {
7039
+ if (!f.length)
6933
7040
  return g;
6934
- const f = h[h.length - 1], b = g[0];
6935
- return X(f) && X(b) && JSON.stringify(f.styles) === JSON.stringify(b.styles) ? (f.text += `
6936
- ` + b.text, h.push(...g.slice(1)), h) : (h.push(...g), h);
7041
+ const b = f[f.length - 1], _ = g[0];
7042
+ return _ && Z(b) && Z(_) && JSON.stringify(b.styles) === JSON.stringify(_.styles) ? (b.text += `
7043
+ ` + _.text, f.push(...g.slice(1)), f) : (f.push(...g), f);
6937
7044
  }, []),
6938
7045
  props: {
6939
- colspan: c.attrs.colspan,
6940
- rowspan: c.attrs.rowspan,
6941
- backgroundColor: c.attrs.backgroundColor,
6942
- textColor: c.attrs.textColor,
6943
- textAlignment: c.attrs.textAlignment
7046
+ colspan: u.attrs.colspan,
7047
+ rowspan: u.attrs.rowspan,
7048
+ backgroundColor: u.attrs.backgroundColor,
7049
+ textColor: u.attrs.textColor,
7050
+ textAlignment: u.attrs.textAlignment
6944
7051
  }
6945
- })), i.rows.push(d);
7052
+ })), i.rows.push(c);
6946
7053
  });
6947
- for (let a = 0; a < n.length; a++)
6948
- n[a].every((s) => s) && (i.headerRows = (i.headerRows ?? 0) + 1);
6949
- for (let a = 0; a < ((r = n[0]) == null ? void 0 : r.length); a++)
6950
- n.every((s) => s[a]) && (i.headerCols = (i.headerCols ?? 0) + 1);
7054
+ for (let s = 0; s < n.length; s++)
7055
+ (r = n[s]) != null && r.every((l) => l) && (i.headerRows = (i.headerRows ?? 0) + 1);
7056
+ for (let s = 0; s < ((a = n[0]) == null ? void 0 : a.length); s++)
7057
+ n != null && n.every((l) => l[s]) && (i.headerCols = (i.headerCols ?? 0) + 1);
6951
7058
  return i;
6952
7059
  }
6953
7060
  function Ae(e, o, t) {
@@ -6956,7 +7063,7 @@ function Ae(e, o, t) {
6956
7063
  return e.content.forEach((r) => {
6957
7064
  if (r.type.name === "hardBreak") {
6958
7065
  if (n)
6959
- if (X(n))
7066
+ if (Z(n))
6960
7067
  n.text += `
6961
7068
  `;
6962
7069
  else if (gt(n))
@@ -6979,7 +7086,7 @@ function Ae(e, o, t) {
6979
7086
  return;
6980
7087
  }
6981
7088
  n && (i.push(n), n = void 0), i.push(
6982
- We(r, o, t)
7089
+ Ke(r, o, t)
6983
7090
  );
6984
7091
  return;
6985
7092
  }
@@ -7000,9 +7107,9 @@ function Ae(e, o, t) {
7000
7107
  else if (d.propSchema === "string")
7001
7108
  a[d.type] = l.attrs.stringValue;
7002
7109
  else
7003
- throw new H(d.propSchema);
7110
+ throw new O(d.propSchema);
7004
7111
  }
7005
- n ? X(n) ? s ? (i.push(n), n = {
7112
+ n ? Z(n) ? s ? (i.push(n), n = {
7006
7113
  type: "link",
7007
7114
  href: s.attrs.href,
7008
7115
  content: [
@@ -7053,7 +7160,7 @@ function Ae(e, o, t) {
7053
7160
  };
7054
7161
  }), n && i.push(n), i;
7055
7162
  }
7056
- function We(e, o, t) {
7163
+ function Ke(e, o, t) {
7057
7164
  if (e.type.name === "text" || e.type.name === "link")
7058
7165
  throw new Error("unexpected");
7059
7166
  const i = {}, n = o[e.type.name];
@@ -7075,7 +7182,7 @@ function We(e, o, t) {
7075
7182
  };
7076
7183
  }
7077
7184
  function x(e, o, t, i, n) {
7078
- var g;
7185
+ var f;
7079
7186
  if (!e.type.isInGroup("bnBlock"))
7080
7187
  throw Error(
7081
7188
  "Node must be in bnBlock group, but is of type" + e.type.name
@@ -7090,18 +7197,18 @@ function x(e, o, t, i, n) {
7090
7197
  if (!l)
7091
7198
  throw Error("Block is of an unrecognized type: " + a.blockNoteType);
7092
7199
  const d = {};
7093
- for (const [f, b] of Object.entries({
7200
+ for (const [g, b] of Object.entries({
7094
7201
  ...e.attrs,
7095
7202
  ...a.isBlockContainer ? a.blockContent.node.attrs : {}
7096
7203
  })) {
7097
- const k = l.propSchema;
7098
- f in k && !(k[f].default === void 0 && b === void 0) && (d[f] = b);
7204
+ const _ = l.propSchema;
7205
+ g in _ && !(_[g].default === void 0 && b === void 0) && (d[g] = b);
7099
7206
  }
7100
7207
  const c = o[a.blockNoteType], u = [];
7101
- (g = a.childContainer) == null || g.node.forEach((f) => {
7208
+ (f = a.childContainer) == null || f.node.forEach((g) => {
7102
7209
  u.push(
7103
7210
  x(
7104
- f,
7211
+ g,
7105
7212
  o,
7106
7213
  t,
7107
7214
  i,
@@ -7129,7 +7236,7 @@ function x(e, o, t, i, n) {
7129
7236
  } else if (c.content === "none")
7130
7237
  m = void 0;
7131
7238
  else
7132
- throw new H(c.content);
7239
+ throw new O(c.content);
7133
7240
  const h = {
7134
7241
  id: s,
7135
7242
  type: c.type,
@@ -7139,7 +7246,7 @@ function x(e, o, t, i, n) {
7139
7246
  };
7140
7247
  return n == null || n.set(e, h), h;
7141
7248
  }
7142
- function kt(e, o, t, i) {
7249
+ function _t(e, o, t, i) {
7143
7250
  return e.dom.setAttribute("data-inline-content-type", o), Object.entries(t).filter(([n, r]) => {
7144
7251
  const a = i[n];
7145
7252
  return r !== a.default;
@@ -7171,7 +7278,7 @@ function nn(e, o) {
7171
7278
  }
7172
7279
  );
7173
7280
  }
7174
- function Xt(e) {
7281
+ function Zt(e) {
7175
7282
  return Object.fromEntries(
7176
7283
  Object.entries(e).map(([o, t]) => [o, t.config])
7177
7284
  );
@@ -7196,7 +7303,7 @@ function Qs(e, o) {
7196
7303
  atom: e.content === "none",
7197
7304
  content: e.content === "styled" ? "inline*" : "",
7198
7305
  addAttributes() {
7199
- return ye(e.propSchema);
7306
+ return ve(e.propSchema);
7200
7307
  },
7201
7308
  addKeyboardShortcuts() {
7202
7309
  return tn(e);
@@ -7206,7 +7313,7 @@ function Qs(e, o) {
7206
7313
  },
7207
7314
  renderHTML({ node: i }) {
7208
7315
  const n = this.options.editor, r = o.render(
7209
- We(
7316
+ Ke(
7210
7317
  i,
7211
7318
  n.schema.inlineContentSchema,
7212
7319
  n.schema.styleSchema
@@ -7216,7 +7323,7 @@ function Qs(e, o) {
7216
7323
  },
7217
7324
  n
7218
7325
  );
7219
- return kt(
7326
+ return _t(
7220
7327
  r,
7221
7328
  e.type,
7222
7329
  i.attrs,
@@ -7226,7 +7333,7 @@ function Qs(e, o) {
7226
7333
  addNodeView() {
7227
7334
  return ({ node: i, getPos: n }) => {
7228
7335
  const r = this.options.editor, a = o.render(
7229
- We(
7336
+ Ke(
7230
7337
  i,
7231
7338
  r.schema.inlineContentSchema,
7232
7339
  r.schema.styleSchema
@@ -7235,7 +7342,7 @@ function Qs(e, o) {
7235
7342
  (s) => {
7236
7343
  if (typeof n == "boolean")
7237
7344
  return;
7238
- const l = D(
7345
+ const l = R(
7239
7346
  [s],
7240
7347
  r._tiptapEditor.schema,
7241
7348
  r.schema.styleSchema
@@ -7250,7 +7357,7 @@ function Qs(e, o) {
7250
7357
  },
7251
7358
  r
7252
7359
  );
7253
- return kt(
7360
+ return _t(
7254
7361
  a,
7255
7362
  e.type,
7256
7363
  i.attrs,
@@ -7279,14 +7386,14 @@ function an(e) {
7279
7386
  function sn(e, o, t, i) {
7280
7387
  return e.dom.setAttribute("data-style-type", o), i === "string" && e.dom.setAttribute("data-value", t), e.contentDOM !== void 0 && e.contentDOM.setAttribute("data-editable", ""), e;
7281
7388
  }
7282
- function Zt(e, o) {
7389
+ function Xt(e, o) {
7283
7390
  return {
7284
7391
  config: e,
7285
7392
  implementation: o
7286
7393
  };
7287
7394
  }
7288
7395
  function Q(e, o) {
7289
- return Zt(
7396
+ return Xt(
7290
7397
  {
7291
7398
  type: e.name,
7292
7399
  propSchema: o
@@ -7328,7 +7435,7 @@ function el(e, o) {
7328
7435
  else if (e.propSchema === "string")
7329
7436
  n = o.render(i.attrs.stringValue);
7330
7437
  else
7331
- throw new H(e.propSchema);
7438
+ throw new O(e.propSchema);
7332
7439
  return sn(
7333
7440
  n,
7334
7441
  e.type,
@@ -7337,7 +7444,7 @@ function el(e, o) {
7337
7444
  );
7338
7445
  }
7339
7446
  });
7340
- return Zt(e, {
7447
+ return Xt(e, {
7341
7448
  mark: t
7342
7449
  });
7343
7450
  }
@@ -7408,7 +7515,7 @@ function Yt(e, o, t = Y(o)) {
7408
7515
  cell: i.cell
7409
7516
  };
7410
7517
  }
7411
- function Ke(e, o) {
7518
+ function We(e, o) {
7412
7519
  var r;
7413
7520
  const t = Y(e);
7414
7521
  if (o < 0 || o >= t.length)
@@ -7489,16 +7596,16 @@ function cn(e, o, t, i = Y(e)) {
7489
7596
  ), [a] = i.splice(n, 1);
7490
7597
  return i.splice(r, 0, a), fe(i);
7491
7598
  }
7492
- function Xe(e) {
7493
- return e ? me(e) ? Xe(e.content) : typeof e == "string" ? e.length === 0 : Array.isArray(e) ? e.every(
7494
- (o) => typeof o == "string" ? o.length === 0 : X(o) ? o.text.length === 0 : ot(o) ? typeof o.content == "string" ? o.content.length === 0 : o.content.every((t) => t.text.length === 0) : !1
7599
+ function Ze(e) {
7600
+ return e ? me(e) ? Ze(e.content) : typeof e == "string" ? e.length === 0 : Array.isArray(e) ? e.every(
7601
+ (o) => typeof o == "string" ? o.length === 0 : Z(o) ? o.text.length === 0 : ot(o) ? typeof o.content == "string" ? o.content.length === 0 : o.content.every((t) => t.text.length === 0) : !1
7495
7602
  ) : !1 : !0;
7496
7603
  }
7497
7604
  function un(e, o, t = Y(e)) {
7498
7605
  if (o === "columns") {
7499
7606
  let r = 0;
7500
7607
  for (let a = t[0].length - 1; a >= 0 && t.every(
7501
- (l) => Xe(l[a].cell) && l[a].colspan === 1
7608
+ (l) => Ze(l[a].cell) && l[a].colspan === 1
7502
7609
  ); a--)
7503
7610
  r++;
7504
7611
  for (let a = t.length - 1; a >= 0; a--) {
@@ -7512,7 +7619,7 @@ function un(e, o, t = Y(e)) {
7512
7619
  }
7513
7620
  let i = 0;
7514
7621
  for (let r = t.length - 1; r >= 0 && t[r].every(
7515
- (s) => Xe(s.cell) && s.rowspan === 1
7622
+ (s) => Ze(s.cell) && s.rowspan === 1
7516
7623
  ); r--)
7517
7624
  i++;
7518
7625
  const n = Math.min(i, t.length - 1);
@@ -7549,7 +7656,7 @@ function pn(e, o, t, i = Y(e)) {
7549
7656
  return fe(i);
7550
7657
  }
7551
7658
  function Qt(e, o, t) {
7552
- const i = Ke(e, t);
7659
+ const i = We(e, t);
7553
7660
  if (!i.some((l) => Ge(l.cell) > 1))
7554
7661
  return !0;
7555
7662
  let r = t, a = t;
@@ -7572,7 +7679,7 @@ function mn(e, o, t) {
7572
7679
  const i = oe(e, t), n = oe(o, t);
7573
7680
  return i.col === n.col;
7574
7681
  }
7575
- function _t(e, o, t, i) {
7682
+ function kt(e, o, t, i) {
7576
7683
  const n = [];
7577
7684
  for (const [a, s] of Object.entries(e.styles)) {
7578
7685
  const l = t[a];
@@ -7583,7 +7690,7 @@ function _t(e, o, t, i) {
7583
7690
  else if (l.propSchema === "string")
7584
7691
  n.push(o.mark(a, { stringValue: s }));
7585
7692
  else
7586
- throw new H(l.propSchema);
7693
+ throw new O(l.propSchema);
7587
7694
  }
7588
7695
  return !i || !o.nodes[i].spec.code ? e.text.split(/(\n)/g).filter((a) => a.length > 0).map((a) => a === `
7589
7696
  ` ? o.nodes.hardBreak.createChecked() : o.text(a, n)) : [o.text(e.text, n)];
@@ -7592,7 +7699,7 @@ function hn(e, o, t) {
7592
7699
  const i = o.marks.link.create({
7593
7700
  href: e.href
7594
7701
  });
7595
- return Ze(e.content, o, t).map(
7702
+ return Xe(e.content, o, t).map(
7596
7703
  (n) => {
7597
7704
  if (n.type.name === "text")
7598
7705
  return n.mark([...n.marks, i]);
@@ -7602,11 +7709,11 @@ function hn(e, o, t) {
7602
7709
  }
7603
7710
  );
7604
7711
  }
7605
- function Ze(e, o, t, i) {
7712
+ function Xe(e, o, t, i) {
7606
7713
  const n = [];
7607
7714
  if (typeof e == "string")
7608
7715
  return n.push(
7609
- ..._t(
7716
+ ...kt(
7610
7717
  { type: "text", text: e, styles: {} },
7611
7718
  o,
7612
7719
  t,
@@ -7615,17 +7722,17 @@ function Ze(e, o, t, i) {
7615
7722
  ), n;
7616
7723
  for (const r of e)
7617
7724
  n.push(
7618
- ..._t(r, o, t, i)
7725
+ ...kt(r, o, t, i)
7619
7726
  );
7620
7727
  return n;
7621
7728
  }
7622
- function D(e, o, t, i) {
7729
+ function R(e, o, t, i) {
7623
7730
  const n = [];
7624
7731
  for (const r of e)
7625
7732
  typeof r == "string" ? n.push(
7626
- ...Ze(r, o, t, i)
7627
- ) : ot(r) ? n.push(...hn(r, o, t)) : X(r) ? n.push(
7628
- ...Ze([r], o, t, i)
7733
+ ...Xe(r, o, t, i)
7734
+ ) : ot(r) ? n.push(...hn(r, o, t)) : Z(r) ? n.push(
7735
+ ...Xe([r], o, t, i)
7629
7736
  ) : n.push(
7630
7737
  to(r, o, t)
7631
7738
  );
@@ -7636,30 +7743,30 @@ function Pe(e, o, t) {
7636
7743
  for (let s = 0; s < e.rows.length; s++) {
7637
7744
  const l = e.rows[s], d = [], c = n[s];
7638
7745
  for (let m = 0; m < l.cells.length; m++) {
7639
- const h = l.cells[m], g = r[m], f = void 0;
7746
+ const h = l.cells[m], f = r[m], g = void 0;
7640
7747
  let b = null;
7641
- const k = oe(
7748
+ const _ = oe(
7642
7749
  {
7643
7750
  row: s,
7644
7751
  col: m
7645
7752
  },
7646
7753
  { type: "table", content: e }
7647
7754
  );
7648
- let _ = a[k.col] ? [a[k.col]] : null;
7755
+ let k = a[_.col] ? [a[_.col]] : null;
7649
7756
  if (h) if (typeof h == "string")
7650
7757
  b = o.text(h);
7651
7758
  else if (me(h)) {
7652
- h.content && (b = D(h.content, o, t));
7653
- const v = he(h);
7654
- v > 1 && (_ = new Array(v).fill(!1).map((C, O) => a[k.col + O] ?? void 0));
7759
+ h.content && (b = R(h.content, o, t));
7760
+ const y = he(h);
7761
+ y > 1 && (k = new Array(y).fill(!1).map((C, z) => a[_.col + z] ?? void 0));
7655
7762
  } else
7656
- b = D(h, o, t);
7657
- const w = o.nodes[g || c ? "tableHeader" : "tableCell"].createChecked(
7763
+ b = R(h, o, t);
7764
+ const w = o.nodes[f || c ? "tableHeader" : "tableCell"].createChecked(
7658
7765
  {
7659
7766
  ...me(h) ? h.props : {},
7660
- colwidth: _
7767
+ colwidth: k
7661
7768
  },
7662
- o.nodes.tableParagraph.createChecked(f, b)
7769
+ o.nodes.tableParagraph.createChecked(g, b)
7663
7770
  );
7664
7771
  d.push(w);
7665
7772
  }
@@ -7675,7 +7782,7 @@ function to(e, o, t) {
7675
7782
  if (!e.content)
7676
7783
  i = o.nodes[n].createChecked(e.props);
7677
7784
  else if (typeof e.content == "string") {
7678
- const r = D(
7785
+ const r = R(
7679
7786
  [e.content],
7680
7787
  o,
7681
7788
  t,
@@ -7683,7 +7790,7 @@ function to(e, o, t) {
7683
7790
  );
7684
7791
  i = o.nodes[n].createChecked(e.props, r);
7685
7792
  } else if (Array.isArray(e.content)) {
7686
- const r = D(
7793
+ const r = R(
7687
7794
  e.content,
7688
7795
  o,
7689
7796
  t,
@@ -7694,7 +7801,7 @@ function to(e, o, t) {
7694
7801
  const r = Pe(e.content, o, t);
7695
7802
  i = o.nodes[n].createChecked(e.props, r);
7696
7803
  } else
7697
- throw new H(e.content.type);
7804
+ throw new O(e.content.type);
7698
7805
  return i;
7699
7806
  }
7700
7807
  function ie(e, o, t) {
@@ -7732,7 +7839,7 @@ function ie(e, o, t) {
7732
7839
  );
7733
7840
  }
7734
7841
  }
7735
- function R(e, o) {
7842
+ function N(e, o) {
7736
7843
  let t, i;
7737
7844
  if (o.firstChild.descendants((n, r) => t ? !1 : !n.type.isInGroup("bnBlock") || n.attrs.id !== e ? !0 : (t = n, i = r + 1, !1)), !(t === void 0 || i === void 0))
7738
7845
  return {
@@ -7744,7 +7851,7 @@ const M = (e, o, t) => ({
7744
7851
  state: i,
7745
7852
  dispatch: n
7746
7853
  }) => {
7747
- const r = _e(
7854
+ const r = ke(
7748
7855
  i.doc.resolve(o)
7749
7856
  );
7750
7857
  if (n) {
@@ -7793,14 +7900,14 @@ function fn(e, o, t, i, n, r) {
7793
7900
  let a = "keep";
7794
7901
  if (e.content)
7795
7902
  if (typeof e.content == "string")
7796
- a = D(
7903
+ a = R(
7797
7904
  [e.content],
7798
7905
  o.schema,
7799
7906
  t.schema.styleSchema,
7800
7907
  n.name
7801
7908
  );
7802
7909
  else if (Array.isArray(e.content))
7803
- a = D(
7910
+ a = R(
7804
7911
  e.content,
7805
7912
  o.schema,
7806
7913
  t.schema.styleSchema,
@@ -7813,7 +7920,7 @@ function fn(e, o, t, i, n, r) {
7813
7920
  t.schema.styleSchema
7814
7921
  );
7815
7922
  else
7816
- throw new H(e.content.type);
7923
+ throw new O(e.content.type);
7817
7924
  else
7818
7925
  i.spec.content === "" || n.spec.content !== i.spec.content && (a = []);
7819
7926
  a === "keep" ? o.tr.setNodeMarkup(
@@ -7840,7 +7947,7 @@ function wt(e, o, t, i) {
7840
7947
  const n = e.children.map((r) => ie(r, o.schema, t.schema.styleSchema));
7841
7948
  if (i.childContainer)
7842
7949
  o.tr.step(
7843
- new Vo(
7950
+ new zo(
7844
7951
  i.childContainer.beforePos + 1,
7845
7952
  i.childContainer.afterPos - 1,
7846
7953
  new ee(U.from(n), 0, 0)
@@ -7857,7 +7964,7 @@ function wt(e, o, t, i) {
7857
7964
  }
7858
7965
  }
7859
7966
  function gn(e, o, t) {
7860
- const i = e._tiptapEditor, n = typeof o == "string" ? o : o.id, r = R(n, i.state.doc);
7967
+ const i = e._tiptapEditor, n = typeof o == "string" ? o : o.id, r = N(n, i.state.doc);
7861
7968
  if (!r)
7862
7969
  throw new Error(`Block with ID ${n} not found`);
7863
7970
  i.commands.command(({ state: s, dispatch: l }) => (M(
@@ -7884,13 +7991,13 @@ function io(e, o, t, i) {
7884
7991
  let n;
7885
7992
  if (o)
7886
7993
  if (typeof o == "string")
7887
- n = D(
7994
+ n = R(
7888
7995
  [o],
7889
7996
  e.pmSchema,
7890
7997
  e.schema.styleSchema
7891
7998
  );
7892
7999
  else if (Array.isArray(o))
7893
- n = D(
8000
+ n = R(
7894
8001
  o,
7895
8002
  e.pmSchema,
7896
8003
  e.schema.styleSchema
@@ -7902,13 +8009,13 @@ function io(e, o, t, i) {
7902
8009
  e.schema.styleSchema
7903
8010
  );
7904
8011
  else
7905
- throw new H(o.type);
8012
+ throw new O(o.type);
7906
8013
  else throw new Error("blockContent is required");
7907
8014
  const r = t.serializeFragment(U.from(n), i);
7908
8015
  return r.nodeType === 1 && oo(r), r;
7909
8016
  }
7910
8017
  function bn(e, o, t, i, n, r, a) {
7911
- var f, b, k, _, w, v, C, O;
8018
+ var g, b, _, k, w, y, C, z;
7912
8019
  const s = (a == null ? void 0 : a.document) ?? document, l = o.pmSchema.nodes.blockContainer;
7913
8020
  let d = t.props;
7914
8021
  if (!t.props) {
@@ -7918,8 +8025,8 @@ function bn(e, o, t, i, n, r, a) {
7918
8025
  ))
7919
8026
  E.default !== void 0 && (d[S] = E.default);
7920
8027
  }
7921
- const u = [...((b = (f = l.spec) == null ? void 0 : f.toDOM) == null ? void 0 : b.call(
7922
- f,
8028
+ const u = [...((b = (g = l.spec) == null ? void 0 : g.toDOM) == null ? void 0 : b.call(
8029
+ g,
7923
8030
  l.create({
7924
8031
  id: t.id,
7925
8032
  ...d
@@ -7944,11 +8051,11 @@ function bn(e, o, t, i, n, r, a) {
7944
8051
  );
7945
8052
  m.contentDOM.appendChild(S);
7946
8053
  }
7947
- let g;
7948
- if (n.has(t.type) ? g = "OL" : r.has(t.type) && (g = "UL"), g) {
7949
- if (((k = e.lastChild) == null ? void 0 : k.nodeName) !== g) {
7950
- const E = s.createElement(g);
7951
- g === "OL" && (d != null && d.start) && (d == null ? void 0 : d.start) !== 1 && E.setAttribute("start", d.start + ""), e.append(E);
8054
+ let f;
8055
+ if (n.has(t.type) ? f = "OL" : r.has(t.type) && (f = "UL"), f) {
8056
+ if (((_ = e.lastChild) == null ? void 0 : _.nodeName) !== f) {
8057
+ const E = s.createElement(f);
8058
+ f === "OL" && (d != null && d.start) && (d == null ? void 0 : d.start) !== 1 && E.setAttribute("start", d.start + ""), e.append(E);
7952
8059
  }
7953
8060
  const S = s.createElement("li");
7954
8061
  S.append(h), e.lastChild.appendChild(S);
@@ -7964,10 +8071,10 @@ function bn(e, o, t, i, n, r, a) {
7964
8071
  n,
7965
8072
  r,
7966
8073
  a
7967
- ), ((_ = e.lastChild) == null ? void 0 : _.nodeName) === "UL" || ((w = e.lastChild) == null ? void 0 : w.nodeName) === "OL")
7968
- for (; ((v = S.firstChild) == null ? void 0 : v.nodeName) === "UL" || ((C = S.firstChild) == null ? void 0 : C.nodeName) === "OL"; )
8074
+ ), ((k = e.lastChild) == null ? void 0 : k.nodeName) === "UL" || ((w = e.lastChild) == null ? void 0 : w.nodeName) === "OL")
8075
+ for (; ((y = S.firstChild) == null ? void 0 : y.nodeName) === "UL" || ((C = S.firstChild) == null ? void 0 : C.nodeName) === "OL"; )
7969
8076
  e.lastChild.lastChild.appendChild(S.firstChild);
7970
- o.pmSchema.nodes[t.type].isInGroup("blockContent") ? e.append(S) : (O = m.contentDOM) == null || O.append(S);
8077
+ o.pmSchema.nodes[t.type].isInGroup("blockContent") ? e.append(S) : (z = m.contentDOM) == null || z.append(S);
7971
8078
  }
7972
8079
  }
7973
8080
  const no = (e, o, t, i, n, r, a) => {
@@ -7981,7 +8088,7 @@ const no = (e, o, t, i, n, r, a) => {
7981
8088
  r,
7982
8089
  a
7983
8090
  );
7984
- }, kn = (e, o, t, i, n, r) => {
8091
+ }, _n = (e, o, t, i, n, r) => {
7985
8092
  const s = ((r == null ? void 0 : r.document) ?? document).createDocumentFragment();
7986
8093
  return no(
7987
8094
  s,
@@ -7992,11 +8099,11 @@ const no = (e, o, t, i, n, r, a) => {
7992
8099
  n,
7993
8100
  r
7994
8101
  ), s;
7995
- }, Ne = (e, o) => {
8102
+ }, je = (e, o) => {
7996
8103
  const t = Ut.fromSchema(e);
7997
8104
  return {
7998
8105
  exportBlocks: (i, n) => {
7999
- const r = kn(
8106
+ const r = _n(
8000
8107
  o,
8001
8108
  i,
8002
8109
  t,
@@ -8017,18 +8124,18 @@ const no = (e, o, t, i, n, r, a) => {
8017
8124
  }
8018
8125
  };
8019
8126
  };
8020
- function _n(e, o, t, i, n) {
8127
+ function kn(e, o, t, i, n) {
8021
8128
  let r;
8022
8129
  if (o)
8023
8130
  if (typeof o == "string")
8024
- r = D(
8131
+ r = R(
8025
8132
  [o],
8026
8133
  e.pmSchema,
8027
8134
  e.schema.styleSchema,
8028
8135
  i
8029
8136
  );
8030
8137
  else if (Array.isArray(o))
8031
- r = D(
8138
+ r = R(
8032
8139
  o,
8033
8140
  e.pmSchema,
8034
8141
  e.schema.styleSchema,
@@ -8041,24 +8148,24 @@ function _n(e, o, t, i, n) {
8041
8148
  e.schema.styleSchema
8042
8149
  );
8043
8150
  else
8044
- throw new H(o.type);
8151
+ throw new O(o.type);
8045
8152
  else throw new Error("blockContent is required");
8046
8153
  return t.serializeFragment(U.from(r), n);
8047
8154
  }
8048
8155
  function wn(e, o, t, i, n) {
8049
- var u, m, h, g, f;
8156
+ var u, m, h, f, g;
8050
8157
  const r = e.pmSchema.nodes.blockContainer;
8051
8158
  let a = o.props;
8052
8159
  if (!o.props) {
8053
8160
  a = {};
8054
- for (const [b, k] of Object.entries(
8161
+ for (const [b, _] of Object.entries(
8055
8162
  e.schema.blockSchema[o.type].propSchema
8056
8163
  ))
8057
- k.default !== void 0 && (a[b] = k.default);
8164
+ _.default !== void 0 && (a[b] = _.default);
8058
8165
  }
8059
8166
  const l = e.blockImplementations[o.type].implementation.toInternalHTML({ ...o, props: a }, e);
8060
8167
  if (o.type === "numberedListItem" && l.dom.setAttribute("data-index", i.toString()), l.contentDOM && o.content) {
8061
- const b = _n(
8168
+ const b = kn(
8062
8169
  e,
8063
8170
  o.content,
8064
8171
  // TODO
@@ -8087,7 +8194,7 @@ function wn(e, o, t, i, n) {
8087
8194
  ...a
8088
8195
  })
8089
8196
  );
8090
- return (g = c.contentDOM) == null || g.appendChild(l.dom), o.children && o.children.length > 0 && ((f = c.contentDOM) == null || f.appendChild(
8197
+ return (f = c.contentDOM) == null || f.appendChild(l.dom), o.children && o.children.length > 0 && ((g = c.contentDOM) == null || g.appendChild(
8091
8198
  ao(e, o.children, t, n)
8092
8199
  )), c.dom;
8093
8200
  }
@@ -8111,12 +8218,12 @@ const ao = (e, o, t, i) => {
8111
8218
  var s;
8112
8219
  const n = e.pmSchema.nodes.blockGroup, r = n.spec.toDOM(n.create({})), a = ro(e, o, t, i);
8113
8220
  return (s = r.contentDOM) == null || s.appendChild(a), r.dom;
8114
- }, yn = (e, o) => {
8221
+ }, vn = (e, o) => {
8115
8222
  const t = Ut.fromSchema(e);
8116
8223
  return {
8117
8224
  serializeBlocks: (i, n) => ao(o, i, t, n).outerHTML
8118
8225
  };
8119
- }, je = (e, o) => {
8226
+ }, Ne = (e, o) => {
8120
8227
  const t = e.querySelector(
8121
8228
  o
8122
8229
  );
@@ -8124,7 +8231,7 @@ const ao = (e, o, t, i) => {
8124
8231
  return;
8125
8232
  const i = e.querySelector("figcaption"), n = (i == null ? void 0 : i.textContent) ?? void 0;
8126
8233
  return { targetElement: t, caption: n };
8127
- }, vn = (e, o, t, i) => {
8234
+ }, yn = (e, o, t, i) => {
8128
8235
  const n = document.createElement("div");
8129
8236
  n.className = "bn-add-file-button";
8130
8237
  const r = document.createElement("div");
@@ -8170,7 +8277,7 @@ const ao = (e, o, t, i) => {
8170
8277
  }, rt = (e, o, t, i, n) => {
8171
8278
  const r = document.createElement("div");
8172
8279
  if (r.className = "bn-file-block-content-wrapper", e.props.url === "") {
8173
- const s = vn(
8280
+ const s = yn(
8174
8281
  e,
8175
8282
  o,
8176
8283
  i,
@@ -8213,7 +8320,7 @@ const ao = (e, o, t, i) => {
8213
8320
  return i.textContent = o, t.appendChild(e), t.appendChild(i), {
8214
8321
  dom: t
8215
8322
  };
8216
- }, yt = (e) => ({ url: e.src || void 0 }), Sn = '<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>', En = {
8323
+ }, vt = (e) => ({ url: e.src || void 0 }), Sn = '<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>', En = {
8217
8324
  backgroundColor: B.backgroundColor,
8218
8325
  // File name.
8219
8326
  name: {
@@ -8251,14 +8358,14 @@ const ao = (e, o, t, i) => {
8251
8358
  );
8252
8359
  }, Mn = (e) => {
8253
8360
  if (e.tagName === "AUDIO")
8254
- return yt(e);
8361
+ return vt(e);
8255
8362
  if (e.tagName === "FIGURE") {
8256
- const o = je(e, "audio");
8363
+ const o = Ne(e, "audio");
8257
8364
  if (!o)
8258
8365
  return;
8259
8366
  const { targetElement: t, caption: i } = o;
8260
8367
  return {
8261
- ...yt(t),
8368
+ ...vt(t),
8262
8369
  caption: i
8263
8370
  };
8264
8371
  }
@@ -8273,7 +8380,7 @@ const ao = (e, o, t, i) => {
8273
8380
  return e.props.showPreview ? (o = document.createElement("audio"), o.src = e.props.url) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? at(o, e.props.caption) : Re(o, e.props.caption) : {
8274
8381
  dom: o
8275
8382
  };
8276
- }, In = ve(Bn, {
8383
+ }, In = ye(Bn, {
8277
8384
  render: Tn,
8278
8385
  parse: Mn,
8279
8386
  toExternalHTML: Ln
@@ -8283,7 +8390,7 @@ const ao = (e, o, t, i) => {
8283
8390
  name: "Plain Text",
8284
8391
  match: ["text", "txt", "plain"]
8285
8392
  },
8286
- ...zt.filter((e) => [
8393
+ ...Vt.filter((e) => [
8287
8394
  "c",
8288
8395
  "cpp",
8289
8396
  "css",
@@ -8380,7 +8487,7 @@ const ao = (e, o, t, i) => {
8380
8487
  name: "Objective C",
8381
8488
  match: ["objective-c", "objc"]
8382
8489
  }
8383
- ], vt = Symbol.for("blocknote.shikiParser"), Ue = Symbol.for(
8490
+ ], yt = Symbol.for("blocknote.shikiParser"), Ue = Symbol.for(
8384
8491
  "blocknote.shikiHighlighterPromise"
8385
8492
  ), Je = {
8386
8493
  language: {
@@ -8467,12 +8574,12 @@ const ao = (e, o, t, i) => {
8467
8574
  },
8468
8575
  ((m = this.options.domAttributes) == null ? void 0 : m.inlineContent) || {}
8469
8576
  ), c = (h) => {
8470
- const g = h.target.value;
8471
- o.commands.command(({ tr: f }) => (f.setNodeAttribute(i(), "language", g), !0));
8577
+ const f = h.target.value;
8578
+ o.commands.command(({ tr: g }) => (g.setNodeAttribute(i(), "language", f), !0));
8472
8579
  };
8473
- return e.forEach(({ id: h, name: g }) => {
8474
- const f = document.createElement("option");
8475
- f.value = h, f.text = g, a.appendChild(f);
8580
+ return e.forEach(({ id: h, name: f }) => {
8581
+ const g = document.createElement("option");
8582
+ g.value = h, g.text = f, a.appendChild(g);
8476
8583
  }), s.contentEditable = "false", a.value = t.attrs.language || this.options.defaultLanguage, l.removeChild(d), l.appendChild(s), l.appendChild(r), r.appendChild(d), s.appendChild(a), a.addEventListener("change", c), {
8477
8584
  dom: l,
8478
8585
  contentDOM: d,
@@ -8498,7 +8605,7 @@ const ao = (e, o, t, i) => {
8498
8605
  }
8499
8606
  );
8500
8607
  const s = a.language;
8501
- return s && s !== "text" && !t.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) && zt.find(({ id: l }) => l === s) ? t.loadLanguage(s) : (i || (i = o[vt] || ti(t), o[vt] = i), i(a));
8608
+ return s && s !== "text" && !t.getLoadedLanguages().includes(s) && e.find(({ id: l }) => l === s) && Vt.find(({ id: l }) => l === s) ? t.loadLanguage(s) : (i || (i = o[yt] || ti(t), o[yt] = i), i(a));
8502
8609
  },
8503
8610
  languageExtractor: (a) => a.attrs.language,
8504
8611
  nodeTypes: [this.name]
@@ -8587,16 +8694,16 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8587
8694
  caption: {
8588
8695
  default: ""
8589
8696
  }
8590
- }, Nn = {
8697
+ }, jn = {
8591
8698
  type: "file",
8592
8699
  propSchema: Pn,
8593
8700
  content: "none",
8594
8701
  isFileBlock: !0
8595
- }, jn = (e, o) => rt(e, o), Rn = (e) => {
8702
+ }, Nn = (e, o) => rt(e, o), Rn = (e) => {
8596
8703
  if (e.tagName === "EMBED")
8597
8704
  return Ct(e);
8598
8705
  if (e.tagName === "FIGURE") {
8599
- const o = je(e, "embed");
8706
+ const o = Ne(e, "embed");
8600
8707
  if (!o)
8601
8708
  return;
8602
8709
  const { targetElement: t, caption: i } = o;
@@ -8616,8 +8723,8 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8616
8723
  return o.href = e.props.url, o.textContent = e.props.name || e.props.url, e.props.caption ? Re(o, e.props.caption) : {
8617
8724
  dom: o
8618
8725
  };
8619
- }, Un = ve(Nn, {
8620
- render: jn,
8726
+ }, Un = ye(jn, {
8727
+ render: Nn,
8621
8728
  parse: Rn,
8622
8729
  toExternalHTML: Dn
8623
8730
  }), co = (e, o, t, i, n, r) => {
@@ -8639,46 +8746,46 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8639
8746
  !o.isEditable && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c));
8640
8747
  return;
8641
8748
  }
8642
- let v;
8643
- e.props.textAlignment === "center" ? u.handleUsed === "left" ? v = u.initialWidth + (u.initialClientX - w.clientX) * 2 : v = u.initialWidth + (w.clientX - u.initialClientX) * 2 : u.handleUsed === "left" ? v = u.initialWidth + u.initialClientX - w.clientX : v = u.initialWidth + w.clientX - u.initialClientX, m = Math.max(v, 64), l.style.width = `${m}px`;
8644
- }, g = (w) => {
8749
+ let y;
8750
+ e.props.textAlignment === "center" ? u.handleUsed === "left" ? y = u.initialWidth + (u.initialClientX - w.clientX) * 2 : y = u.initialWidth + (w.clientX - u.initialClientX) * 2 : u.handleUsed === "left" ? y = u.initialWidth + u.initialClientX - w.clientX : y = u.initialWidth + w.clientX - u.initialClientX, m = Math.max(y, 64), l.style.width = `${m}px`;
8751
+ }, f = (w) => {
8645
8752
  (!w.target || !l.contains(w.target) || !o.isEditable) && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c)), u && (u = void 0, o.updateBlock(e, {
8646
8753
  props: {
8647
8754
  previewWidth: m
8648
8755
  }
8649
8756
  }));
8650
- }, f = () => {
8757
+ }, g = () => {
8651
8758
  o.isEditable && (i.appendChild(d), i.appendChild(c));
8652
8759
  }, b = (w) => {
8653
8760
  w.relatedTarget === d || w.relatedTarget === c || u || o.isEditable && i.contains(d) && i.contains(c) && (i.removeChild(d), i.removeChild(c));
8654
- }, k = (w) => {
8761
+ }, _ = (w) => {
8655
8762
  w.preventDefault(), u = {
8656
8763
  handleUsed: "left",
8657
8764
  initialWidth: l.clientWidth,
8658
8765
  initialClientX: w.clientX
8659
8766
  };
8660
- }, _ = (w) => {
8767
+ }, k = (w) => {
8661
8768
  w.preventDefault(), u = {
8662
8769
  handleUsed: "right",
8663
8770
  initialWidth: l.clientWidth,
8664
8771
  initialClientX: w.clientX
8665
8772
  };
8666
8773
  };
8667
- return window.addEventListener("mousemove", h), window.addEventListener("mouseup", g), l.addEventListener("mouseenter", f), l.addEventListener("mouseleave", b), d.addEventListener(
8774
+ return window.addEventListener("mousemove", h), window.addEventListener("mouseup", f), l.addEventListener("mouseenter", g), l.addEventListener("mouseleave", b), d.addEventListener(
8668
8775
  "mousedown",
8669
- k
8776
+ _
8670
8777
  ), c.addEventListener(
8671
8778
  "mousedown",
8672
- _
8779
+ k
8673
8780
  ), {
8674
8781
  dom: l,
8675
8782
  destroy: () => {
8676
- s == null || s(), window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", g), l.removeEventListener("mouseenter", f), l.removeEventListener("mouseleave", b), d.removeEventListener(
8783
+ s == null || s(), window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", f), l.removeEventListener("mouseenter", g), l.removeEventListener("mouseleave", b), d.removeEventListener(
8677
8784
  "mousedown",
8678
- k
8785
+ _
8679
8786
  ), c.removeEventListener(
8680
8787
  "mousedown",
8681
- _
8788
+ k
8682
8789
  );
8683
8790
  }
8684
8791
  };
@@ -8716,13 +8823,13 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8716
8823
  previewWidth: {
8717
8824
  default: 512
8718
8825
  }
8719
- }, Vn = {
8826
+ }, zn = {
8720
8827
  type: "image",
8721
8828
  propSchema: On,
8722
8829
  content: "none",
8723
8830
  isFileBlock: !0,
8724
8831
  fileBlockAccept: ["image/*"]
8725
- }, zn = (e, o) => {
8832
+ }, Vn = (e, o) => {
8726
8833
  const t = document.createElement("div");
8727
8834
  t.innerHTML = Hn;
8728
8835
  const i = document.createElement("div");
@@ -8742,7 +8849,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8742
8849
  if (e.tagName === "IMG")
8743
8850
  return xt(e);
8744
8851
  if (e.tagName === "FIGURE") {
8745
- const o = je(e, "img");
8852
+ const o = Ne(e, "img");
8746
8853
  if (!o)
8747
8854
  return;
8748
8855
  const { targetElement: t, caption: i } = o;
@@ -8762,17 +8869,17 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8762
8869
  return e.props.showPreview ? (o = document.createElement("img"), o.src = e.props.url, o.alt = e.props.name || e.props.caption || "BlockNote image", o.width = e.props.previewWidth) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? at(o, e.props.caption) : Re(o, e.props.caption) : {
8763
8870
  dom: o
8764
8871
  };
8765
- }, Gn = ve(Vn, {
8766
- render: zn,
8872
+ }, Gn = ye(zn, {
8873
+ render: Vn,
8767
8874
  parse: Fn,
8768
8875
  toExternalHTML: $n
8769
- }), Wn = {
8876
+ }), Kn = {
8770
8877
  type: "pageBreak",
8771
8878
  propSchema: {},
8772
8879
  content: "none",
8773
8880
  isFileBlock: !1,
8774
8881
  isSelectable: !1
8775
- }, Kn = () => {
8882
+ }, Wn = () => {
8776
8883
  const e = document.createElement("div");
8777
8884
  return e.className = "bn-page-break", e.setAttribute("data-page-break", ""), {
8778
8885
  dom: e
@@ -8782,15 +8889,15 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8782
8889
  return {
8783
8890
  type: "pageBreak"
8784
8891
  };
8785
- }, Xn = () => {
8892
+ }, Zn = () => {
8786
8893
  const e = document.createElement("div");
8787
8894
  return e.setAttribute("data-page-break", ""), {
8788
8895
  dom: e
8789
8896
  };
8790
- }, Zn = ve(Wn, {
8791
- render: Kn,
8897
+ }, Xn = ye(Kn, {
8898
+ render: Wn,
8792
8899
  parse: qn,
8793
- toExternalHTML: Xn
8900
+ toExternalHTML: Zn
8794
8901
  }), Jn = ge.create({
8795
8902
  name: "backgroundColor",
8796
8903
  addAttributes() {
@@ -8852,14 +8959,14 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8852
8959
  content: "inline*",
8853
8960
  group: "blockContent",
8854
8961
  addAttributes() {
8855
- return ye(uo);
8962
+ return ve(uo);
8856
8963
  },
8857
8964
  addInputRules() {
8858
8965
  return [
8859
8966
  ...[1, 2, 3].map((e) => new le({
8860
8967
  find: new RegExp(`^(#{${e}})\\s$`),
8861
8968
  handler: ({ state: o, chain: t, range: i }) => {
8862
- const n = y(o);
8969
+ const n = v(o);
8863
8970
  !n.isBlockContainer || n.blockContent.node.type.spec.content !== "inline*" || t().command(
8864
8971
  M(
8865
8972
  this.options.editor,
@@ -8879,7 +8986,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8879
8986
  addKeyboardShortcuts() {
8880
8987
  return {
8881
8988
  "Mod-Alt-1": () => {
8882
- const e = y(this.editor.state);
8989
+ const e = v(this.editor.state);
8883
8990
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
8884
8991
  M(this.options.editor, e.bnBlock.beforePos, {
8885
8992
  type: "heading",
@@ -8890,7 +8997,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8890
8997
  );
8891
8998
  },
8892
8999
  "Mod-Alt-2": () => {
8893
- const e = y(this.editor.state);
9000
+ const e = v(this.editor.state);
8894
9001
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
8895
9002
  M(this.options.editor, e.bnBlock.beforePos, {
8896
9003
  type: "heading",
@@ -8901,7 +9008,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8901
9008
  );
8902
9009
  },
8903
9010
  "Mod-Alt-3": () => {
8904
- const e = y(this.editor.state);
9011
+ const e = v(this.editor.state);
8905
9012
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
8906
9013
  M(this.options.editor, e.bnBlock.beforePos, {
8907
9014
  type: "heading",
@@ -8972,7 +9079,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
8972
9079
  ];
8973
9080
  return n && i.tr.split(e, 2, s), !0;
8974
9081
  }, st = (e) => {
8975
- const o = e._tiptapEditor, t = y(o.state);
9082
+ const o = e._tiptapEditor, t = v(o.state);
8976
9083
  if (!t.isBlockContainer)
8977
9084
  return !1;
8978
9085
  const { bnBlock: i, blockContent: n } = t, r = o.state.selection.anchor === o.state.selection.head;
@@ -9007,7 +9114,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9007
9114
  new le({
9008
9115
  find: new RegExp("^[-+*]\\s$"),
9009
9116
  handler: ({ state: e, chain: o, range: t }) => {
9010
- const i = y(e);
9117
+ const i = v(e);
9011
9118
  !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || o().command(
9012
9119
  M(
9013
9120
  this.options.editor,
@@ -9026,7 +9133,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9026
9133
  return {
9027
9134
  Enter: () => st(this.options.editor),
9028
9135
  "Mod-Shift-8": () => {
9029
- const e = y(this.editor.state);
9136
+ const e = v(this.editor.state);
9030
9137
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
9031
9138
  M(this.options.editor, e.bnBlock.beforePos, {
9032
9139
  type: "bulletListItem",
@@ -9094,7 +9201,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9094
9201
  content: "inline*",
9095
9202
  group: "blockContent",
9096
9203
  addAttributes() {
9097
- return ye(mo);
9204
+ return ve(mo);
9098
9205
  },
9099
9206
  addInputRules() {
9100
9207
  return [
@@ -9102,7 +9209,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9102
9209
  new le({
9103
9210
  find: new RegExp("\\[\\s*\\]\\s$"),
9104
9211
  handler: ({ state: e, chain: o, range: t }) => {
9105
- const i = y(e);
9212
+ const i = v(e);
9106
9213
  !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || o().command(
9107
9214
  M(
9108
9215
  this.options.editor,
@@ -9120,7 +9227,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9120
9227
  new le({
9121
9228
  find: new RegExp("\\[[Xx]\\]\\s$"),
9122
9229
  handler: ({ state: e, chain: o, range: t }) => {
9123
- const i = y(e);
9230
+ const i = v(e);
9124
9231
  !i.isBlockContainer || i.blockContent.node.type.spec.content !== "inline*" || o().command(
9125
9232
  M(
9126
9233
  this.options.editor,
@@ -9141,7 +9248,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9141
9248
  return {
9142
9249
  Enter: () => st(this.options.editor),
9143
9250
  "Mod-Shift-9": () => {
9144
- const e = y(this.editor.state);
9251
+ const e = v(this.editor.state);
9145
9252
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
9146
9253
  M(this.options.editor, e.bnBlock.beforePos, {
9147
9254
  type: "checkListItem",
@@ -9286,26 +9393,26 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9286
9393
  d.bnBlock.beforePos
9287
9394
  ).nodeBefore;
9288
9395
  if (c) {
9289
- const g = te({
9396
+ const f = te({
9290
9397
  posBeforeNode: d.bnBlock.beforePos - c.nodeSize,
9291
9398
  node: c
9292
9399
  });
9293
- if (g.blockNoteType === "numberedListItem") {
9294
- if (!g.isBlockContainer)
9400
+ if (f.blockNoteType === "numberedListItem") {
9401
+ if (!f.isBlockContainer)
9295
9402
  throw new Error("impossible");
9296
- const b = g.blockContent.node.attrs.index;
9403
+ const b = f.blockContent.node.attrs.index;
9297
9404
  l = (parseInt(b) + 1).toString();
9298
9405
  }
9299
9406
  }
9300
9407
  const u = d.blockContent.node, m = u.attrs.index, h = ((s = c == null ? void 0 : c.firstChild) == null ? void 0 : s.type.name) !== "numberedListItem";
9301
9408
  if (m !== l || u.attrs.start && !h) {
9302
9409
  n = !0;
9303
- const { start: g, ...f } = u.attrs;
9410
+ const { start: f, ...g } = u.attrs;
9304
9411
  i.setNodeMarkup(d.blockContent.beforePos, void 0, {
9305
- ...f,
9412
+ ...g,
9306
9413
  index: l,
9307
- ...typeof g == "number" && h && {
9308
- start: g
9414
+ ...typeof f == "number" && h && {
9415
+ start: f
9309
9416
  }
9310
9417
  });
9311
9418
  }
@@ -9322,7 +9429,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9322
9429
  priority: 90,
9323
9430
  addAttributes() {
9324
9431
  return {
9325
- ...ye(ho),
9432
+ ...ve(ho),
9326
9433
  // the index attribute is only used internally (it's not part of the blocknote schema)
9327
9434
  // that's why it's defined explicitly here, and not part of the prop schema
9328
9435
  index: {
@@ -9340,7 +9447,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9340
9447
  new le({
9341
9448
  find: new RegExp("^(\\d+)\\.\\s$"),
9342
9449
  handler: ({ state: e, chain: o, range: t, match: i }) => {
9343
- const n = y(e);
9450
+ const n = v(e);
9344
9451
  if (!n.isBlockContainer || n.blockContent.node.type.spec.content !== "inline*" || n.blockNoteType === "numberedListItem")
9345
9452
  return;
9346
9453
  const r = parseInt(i[1]);
@@ -9364,7 +9471,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9364
9471
  return {
9365
9472
  Enter: () => st(this.options.editor),
9366
9473
  "Mod-Shift-7": () => {
9367
- const e = y(this.editor.state);
9474
+ const e = v(this.editor.state);
9368
9475
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
9369
9476
  M(this.options.editor, e.bnBlock.beforePos, {
9370
9477
  type: "numberedListItem",
@@ -9444,7 +9551,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9444
9551
  addKeyboardShortcuts() {
9445
9552
  return {
9446
9553
  "Mod-Alt-0": () => {
9447
- const e = y(this.editor.state);
9554
+ const e = v(this.editor.state);
9448
9555
  return !e.isBlockContainer || e.blockContent.node.type.spec.content !== "inline*" ? !0 : this.editor.commands.command(
9449
9556
  M(this.options.editor, e.bnBlock.beforePos, {
9450
9557
  type: "paragraph",
@@ -9523,13 +9630,13 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9523
9630
  };
9524
9631
  return {
9525
9632
  tableRole: Go(
9526
- Wo(e, "tableRole", o)
9633
+ Ko(e, "tableRole", o)
9527
9634
  )
9528
9635
  };
9529
9636
  }
9530
9637
  }), br = {
9531
9638
  textColor: B.textColor
9532
- }, kr = G({
9639
+ }, _r = G({
9533
9640
  name: "table",
9534
9641
  content: "tableRow+",
9535
9642
  group: "blockContent",
@@ -9564,7 +9671,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9564
9671
  constructor(r, a, s) {
9565
9672
  super(r, a), this.node = r, this.cellMinWidth = a, this.blockContentHTMLAttributes = s;
9566
9673
  const l = document.createElement("div");
9567
- l.className = Z(
9674
+ l.className = X(
9568
9675
  "bn-block-content",
9569
9676
  s.class
9570
9677
  ), l.setAttribute("data-content-type", "table");
@@ -9587,7 +9694,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9587
9694
  });
9588
9695
  };
9589
9696
  }
9590
- }), _r = G({
9697
+ }), kr = G({
9591
9698
  name: "tableParagraph",
9592
9699
  group: "tableContent",
9593
9700
  content: "inline*",
@@ -9617,11 +9724,11 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9617
9724
  return ["p", e, 0];
9618
9725
  }
9619
9726
  }), wr = J(
9620
- kr,
9727
+ _r,
9621
9728
  br,
9622
9729
  [
9623
9730
  gr,
9624
- _r,
9731
+ kr,
9625
9732
  wi.extend({
9626
9733
  /**
9627
9734
  * We allow table headers and cells to have multiple tableContent nodes because
@@ -9632,15 +9739,15 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9632
9739
  */
9633
9740
  content: "tableContent+"
9634
9741
  }),
9635
- _i.extend({
9742
+ ki.extend({
9636
9743
  content: "tableContent+"
9637
9744
  }),
9638
- yi
9745
+ vi
9639
9746
  ]
9640
9747
  ), St = (e) => {
9641
9748
  const o = e.src || void 0, t = e.width || void 0;
9642
9749
  return { url: o, previewWidth: t };
9643
- }, yr = '<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>', vr = {
9750
+ }, vr = '<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>', yr = {
9644
9751
  textAlignment: B.textAlignment,
9645
9752
  backgroundColor: B.backgroundColor,
9646
9753
  // File name.
@@ -9664,13 +9771,13 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9664
9771
  }
9665
9772
  }, Cr = {
9666
9773
  type: "video",
9667
- propSchema: vr,
9774
+ propSchema: yr,
9668
9775
  content: "none",
9669
9776
  isFileBlock: !0,
9670
9777
  fileBlockAccept: ["video/*"]
9671
9778
  }, xr = (e, o) => {
9672
9779
  const t = document.createElement("div");
9673
- t.innerHTML = yr;
9780
+ t.innerHTML = vr;
9674
9781
  const i = document.createElement("div");
9675
9782
  i.className = "bn-visual-media-wrapper";
9676
9783
  const n = document.createElement("video");
@@ -9688,7 +9795,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9688
9795
  if (e.tagName === "VIDEO")
9689
9796
  return St(e);
9690
9797
  if (e.tagName === "FIGURE") {
9691
- const o = je(e, "video");
9798
+ const o = Ne(e, "video");
9692
9799
  if (!o)
9693
9800
  return;
9694
9801
  const { targetElement: t, caption: i } = o;
@@ -9708,7 +9815,7 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9708
9815
  return e.props.showPreview ? (o = document.createElement("video"), o.src = e.props.url, o.width = e.props.previewWidth) : (o = document.createElement("a"), o.href = e.props.url, o.textContent = e.props.name || e.props.url), e.props.caption ? e.props.showPreview ? at(o, e.props.caption) : Re(o, e.props.caption) : {
9709
9816
  dom: o
9710
9817
  };
9711
- }, Br = ve(Cr, {
9818
+ }, Br = ye(Cr, {
9712
9819
  render: xr,
9713
9820
  parse: Sr,
9714
9821
  toExternalHTML: Er
@@ -9724,19 +9831,19 @@ const Ct = (e) => ({ url: e.src || void 0 }), Pn = {
9724
9831
  image: Gn,
9725
9832
  video: Br,
9726
9833
  audio: In
9727
- }, Tr = Kt(go), bo = {
9834
+ }, Tr = Wt(go), bo = {
9728
9835
  bold: Q(hi, "boolean"),
9729
9836
  italic: Q(gi, "boolean"),
9730
- underline: Q(ki, "boolean"),
9837
+ underline: Q(_i, "boolean"),
9731
9838
  strike: Q(bi, "boolean"),
9732
9839
  code: Q(fi, "boolean"),
9733
9840
  textColor: er,
9734
9841
  backgroundColor: Yn
9735
- }, nl = Jt(bo), ko = {
9842
+ }, nl = Jt(bo), _o = {
9736
9843
  text: { config: "text", implementation: {} },
9737
9844
  link: { config: "link", implementation: {} }
9738
- }, Mr = Xt(
9739
- ko
9845
+ }, Mr = Zt(
9846
+ _o
9740
9847
  );
9741
9848
  function P(e, o) {
9742
9849
  return e in o.schema.blockSchema && o.schema.blockSchema[e] === Tr[e];
@@ -9763,19 +9870,22 @@ function ll(e, o, t) {
9763
9870
  return Ar(e, o.type, t);
9764
9871
  }
9765
9872
  function Et(e) {
9766
- return e instanceof ke;
9873
+ return e instanceof _e;
9767
9874
  }
9768
9875
  function Pr(e) {
9769
9876
  let o = e.getTextCursorPosition().block, t = e.schema.blockSchema[o.type].content;
9770
- for (; t === "none"; )
9771
- o = e.getTextCursorPosition().nextBlock, t = e.schema.blockSchema[o.type].content, e.setTextCursorPosition(o, "end");
9877
+ for (; t === "none"; ) {
9878
+ if (o = e.getTextCursorPosition().nextBlock, o === void 0)
9879
+ return;
9880
+ t = e.schema.blockSchema[o.type].content, e.setTextCursorPosition(o, "end");
9881
+ }
9772
9882
  }
9773
9883
  function L(e, o) {
9774
9884
  const t = e.getTextCursorPosition().block;
9775
9885
  if (t.content === void 0)
9776
9886
  throw new Error("Slash Menu open in a block that doesn't contain content.");
9777
9887
  let i;
9778
- return Array.isArray(t.content) && (t.content.length === 1 && X(t.content[0]) && t.content[0].type === "text" && t.content[0].text === "/" || t.content.length === 0) ? (i = e.updateBlock(t, o), e.setTextCursorPosition(i)) : (i = e.insertBlocks([o], t, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), Pr(e), i;
9888
+ return Array.isArray(t.content) && (t.content.length === 1 && Z(t.content[0]) && t.content[0].type === "text" && t.content[0].text === "/" || t.content.length === 0) ? (i = e.updateBlock(t, o), e.setTextCursorPosition(i)) : (i = e.insertBlocks([o], t, "after")[0], e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)), Pr(e), i;
9779
9889
  }
9780
9890
  function dl(e) {
9781
9891
  const o = [];
@@ -9787,7 +9897,7 @@ function dl(e) {
9787
9897
  props: { level: 1 }
9788
9898
  });
9789
9899
  },
9790
- badge: K("Mod-Alt-1"),
9900
+ badge: W("Mod-Alt-1"),
9791
9901
  key: "heading",
9792
9902
  ...e.dictionary.slash_menu.heading
9793
9903
  },
@@ -9798,7 +9908,7 @@ function dl(e) {
9798
9908
  props: { level: 2 }
9799
9909
  });
9800
9910
  },
9801
- badge: K("Mod-Alt-2"),
9911
+ badge: W("Mod-Alt-2"),
9802
9912
  key: "heading_2",
9803
9913
  ...e.dictionary.slash_menu.heading_2
9804
9914
  },
@@ -9809,7 +9919,7 @@ function dl(e) {
9809
9919
  props: { level: 3 }
9810
9920
  });
9811
9921
  },
9812
- badge: K("Mod-Alt-3"),
9922
+ badge: W("Mod-Alt-3"),
9813
9923
  key: "heading_3",
9814
9924
  ...e.dictionary.slash_menu.heading_3
9815
9925
  }
@@ -9819,7 +9929,7 @@ function dl(e) {
9819
9929
  type: "numberedListItem"
9820
9930
  });
9821
9931
  },
9822
- badge: K("Mod-Shift-7"),
9932
+ badge: W("Mod-Shift-7"),
9823
9933
  key: "numbered_list",
9824
9934
  ...e.dictionary.slash_menu.numbered_list
9825
9935
  }), P("bulletListItem", e) && o.push({
@@ -9828,7 +9938,7 @@ function dl(e) {
9828
9938
  type: "bulletListItem"
9829
9939
  });
9830
9940
  },
9831
- badge: K("Mod-Shift-8"),
9941
+ badge: W("Mod-Shift-8"),
9832
9942
  key: "bullet_list",
9833
9943
  ...e.dictionary.slash_menu.bullet_list
9834
9944
  }), P("checkListItem", e) && o.push({
@@ -9837,7 +9947,7 @@ function dl(e) {
9837
9947
  type: "checkListItem"
9838
9948
  });
9839
9949
  },
9840
- badge: K("Mod-Shift-9"),
9950
+ badge: W("Mod-Shift-9"),
9841
9951
  key: "check_list",
9842
9952
  ...e.dictionary.slash_menu.check_list
9843
9953
  }), P("paragraph", e) && o.push({
@@ -9846,7 +9956,7 @@ function dl(e) {
9846
9956
  type: "paragraph"
9847
9957
  });
9848
9958
  },
9849
- badge: K("Mod-Alt-0"),
9959
+ badge: W("Mod-Alt-0"),
9850
9960
  key: "paragraph",
9851
9961
  ...e.dictionary.slash_menu.paragraph
9852
9962
  }), P("codeBlock", e) && o.push({
@@ -9855,7 +9965,7 @@ function dl(e) {
9855
9965
  type: "codeBlock"
9856
9966
  });
9857
9967
  },
9858
- badge: K("Mod-Alt-c"),
9968
+ badge: W("Mod-Alt-c"),
9859
9969
  key: "code_block",
9860
9970
  ...e.dictionary.slash_menu.code_block
9861
9971
  }), P("table", e) && o.push({
@@ -9965,7 +10075,7 @@ class Ce {
9965
10075
  p(this, "BlockNoteEditor", "only for types");
9966
10076
  p(this, "Block", "only for types");
9967
10077
  p(this, "PartialBlock", "only for types");
9968
- this.blockSpecs = He(o == null ? void 0 : o.blockSpecs) || go, this.inlineContentSpecs = He(o == null ? void 0 : o.inlineContentSpecs) || ko, this.styleSpecs = He(o == null ? void 0 : o.styleSpecs) || bo, this.blockSchema = Kt(this.blockSpecs), this.inlineContentSchema = Xt(
10078
+ this.blockSpecs = He(o == null ? void 0 : o.blockSpecs) || go, this.inlineContentSpecs = He(o == null ? void 0 : o.inlineContentSpecs) || _o, this.styleSpecs = He(o == null ? void 0 : o.styleSpecs) || bo, this.blockSchema = Wt(this.blockSpecs), this.inlineContentSchema = Zt(
9969
10079
  this.inlineContentSpecs
9970
10080
  ), this.styleSchema = Jt(this.styleSpecs);
9971
10081
  }
@@ -9973,24 +10083,24 @@ class Ce {
9973
10083
  return new Ce(o);
9974
10084
  }
9975
10085
  }
9976
- const _o = Ce.create({
10086
+ const ko = Ce.create({
9977
10087
  blockSpecs: {
9978
- pageBreak: Zn
10088
+ pageBreak: Xn
9979
10089
  }
9980
10090
  }), ul = (e) => Ce.create({
9981
10091
  blockSpecs: {
9982
10092
  ...e.blockSpecs,
9983
- ..._o.blockSpecs
10093
+ ...ko.blockSpecs
9984
10094
  },
9985
10095
  inlineContentSpecs: e.inlineContentSpecs,
9986
10096
  styleSpecs: e.styleSpecs
9987
10097
  });
9988
- function Nr(e) {
9989
- return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak === _o.blockSchema.pageBreak;
10098
+ function jr(e) {
10099
+ return "pageBreak" in e.schema.blockSchema && e.schema.blockSchema.pageBreak === ko.blockSchema.pageBreak;
9990
10100
  }
9991
10101
  function pl(e) {
9992
10102
  const o = [];
9993
- return Nr(e) && o.push({
10103
+ return jr(e) && o.push({
9994
10104
  ...e.dictionary.slash_menu.page_break,
9995
10105
  onItemClick: () => {
9996
10106
  L(e, {
@@ -10000,13 +10110,13 @@ function pl(e) {
10000
10110
  key: "page_break"
10001
10111
  }), o;
10002
10112
  }
10003
- function jr(e, o, t, i = "before") {
10113
+ function Nr(e, o, t, i = "before") {
10004
10114
  const n = typeof t == "string" ? t : t.id, r = [];
10005
10115
  for (const l of o)
10006
10116
  r.push(
10007
10117
  ie(l, e.pmSchema, e.schema.styleSchema)
10008
10118
  );
10009
- const a = R(n, e._tiptapEditor.state.doc);
10119
+ const a = N(n, e._tiptapEditor.state.doc);
10010
10120
  if (!a)
10011
10121
  throw new Error(`Block with ID ${n} not found`);
10012
10122
  i === "before" && e.dispatch(
@@ -10032,7 +10142,7 @@ function jr(e, o, t, i = "before") {
10032
10142
  }
10033
10143
  function Rr(e) {
10034
10144
  const o = e._tiptapEditor.state, t = o.selection, i = q(o.doc, t.anchor);
10035
- if (t instanceof ke)
10145
+ if (t instanceof _e)
10036
10146
  return {
10037
10147
  type: "cell",
10038
10148
  anchorBlockId: i.node.attrs.id,
@@ -10057,7 +10167,7 @@ function Rr(e) {
10057
10167
  }
10058
10168
  function Dr(e, o) {
10059
10169
  var n, r;
10060
- const t = (n = R(
10170
+ const t = (n = N(
10061
10171
  o.anchorBlockId,
10062
10172
  e._tiptapEditor.state.doc
10063
10173
  )) == null ? void 0 : n.posBeforeNode;
@@ -10067,7 +10177,7 @@ function Dr(e, o) {
10067
10177
  );
10068
10178
  let i;
10069
10179
  if (o.type === "cell")
10070
- i = ke.create(
10180
+ i = _e.create(
10071
10181
  e._tiptapEditor.state.doc,
10072
10182
  t + o.anchorCellOffset,
10073
10183
  t + o.headCellOffset
@@ -10078,7 +10188,7 @@ function Dr(e, o) {
10078
10188
  t + 1
10079
10189
  );
10080
10190
  else {
10081
- const a = (r = R(
10191
+ const a = (r = N(
10082
10192
  o.headBlockId,
10083
10193
  e._tiptapEditor.state.doc
10084
10194
  )) == null ? void 0 : r.posBeforeNode;
@@ -10107,15 +10217,15 @@ function wo(e, o, t) {
10107
10217
  ], n = Rr(e);
10108
10218
  e.removeBlocks(i), e.insertBlocks(Ye(i), o, t), Dr(e, n);
10109
10219
  }
10110
- function yo(e) {
10220
+ function vo(e) {
10111
10221
  return !e || e.type !== "columnList";
10112
10222
  }
10113
- function vo(e, o, t) {
10223
+ function yo(e, o, t) {
10114
10224
  let i, n;
10115
10225
  if (o ? o.children.length > 0 ? (i = o.children[o.children.length - 1], n = "after") : (i = o, n = "before") : t && (i = t, n = "before"), !i || !n)
10116
10226
  return;
10117
10227
  const r = e.getParentBlock(i);
10118
- return yo(r) ? { referenceBlock: i, placement: n } : vo(
10228
+ return vo(r) ? { referenceBlock: i, placement: n } : yo(
10119
10229
  e,
10120
10230
  n === "after" ? i : e.getPrevBlock(i),
10121
10231
  r
@@ -10126,14 +10236,14 @@ function Co(e, o, t) {
10126
10236
  if (o ? o.children.length > 0 ? (i = o.children[0], n = "before") : (i = o, n = "after") : t && (i = t, n = "after"), !i || !n)
10127
10237
  return;
10128
10238
  const r = e.getParentBlock(i);
10129
- return yo(r) ? { referenceBlock: i, placement: n } : Co(
10239
+ return vo(r) ? { referenceBlock: i, placement: n } : Co(
10130
10240
  e,
10131
10241
  n === "before" ? i : e.getNextBlock(i),
10132
10242
  r
10133
10243
  );
10134
10244
  }
10135
10245
  function Ur(e) {
10136
- const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[0]) || e.getTextCursorPosition().block, i = vo(
10246
+ const o = e.getSelection(), t = (o == null ? void 0 : o.blocks[0]) || e.getTextCursorPosition().block, i = yo(
10137
10247
  e,
10138
10248
  e.getPrevBlock(t),
10139
10249
  e.getParentBlock(t)
@@ -10179,14 +10289,14 @@ function Or(e, o) {
10179
10289
  ),
10180
10290
  c ? 3 : 1,
10181
10291
  0
10182
- ), h = a.start, g = a.end;
10292
+ ), h = a.start, f = a.end;
10183
10293
  i(
10184
10294
  t.tr.step(
10185
- new ze(
10295
+ new Ve(
10186
10296
  h - (c ? 3 : 1),
10187
- g,
10297
+ f,
10188
10298
  h,
10189
- g,
10299
+ f,
10190
10300
  m,
10191
10301
  1,
10192
10302
  !0
@@ -10205,17 +10315,17 @@ function xo(e) {
10205
10315
  )
10206
10316
  );
10207
10317
  }
10208
- function Vr(e) {
10318
+ function zr(e) {
10209
10319
  e._tiptapEditor.commands.liftListItem("blockContainer");
10210
10320
  }
10211
- function zr(e) {
10212
- const { bnBlock: o } = y(
10321
+ function Vr(e) {
10322
+ const { bnBlock: o } = v(
10213
10323
  e._tiptapEditor.state
10214
10324
  );
10215
10325
  return e._tiptapEditor.state.doc.resolve(o.beforePos).nodeBefore !== null;
10216
10326
  }
10217
10327
  function Fr(e) {
10218
- const { bnBlock: o } = y(
10328
+ const { bnBlock: o } = v(
10219
10329
  e._tiptapEditor.state
10220
10330
  );
10221
10331
  return e._tiptapEditor.state.doc.resolve(o.beforePos).depth > 1;
@@ -10250,13 +10360,13 @@ function So(e, o, t) {
10250
10360
  ), a.delete(u.attrs.id), t.length > 0 && u.attrs.id === l) {
10251
10361
  const b = n.doc.nodeSize;
10252
10362
  n = n.insert(m, r);
10253
- const k = n.doc.nodeSize;
10254
- d += b - k;
10363
+ const _ = n.doc.nodeSize;
10364
+ d += b - _;
10255
10365
  }
10256
- const h = n.doc.nodeSize, g = n.doc.resolve(m - d);
10257
- g.node().type.name === "blockGroup" && g.node(g.depth - 1).type.name !== "doc" && g.node().childCount === 1 ? n = n.delete(g.before(), g.after()) : n = n.delete(m - d, m - d + u.nodeSize);
10258
- const f = n.doc.nodeSize;
10259
- return d += h - f, !1;
10366
+ const h = n.doc.nodeSize, f = n.doc.resolve(m - d);
10367
+ f.node().type.name === "blockGroup" && f.node(f.depth - 1).type.name !== "doc" && f.node().childCount === 1 ? n = n.delete(f.before(), f.after()) : n = n.delete(m - d, m - d + u.nodeSize);
10368
+ const g = n.doc.nodeSize;
10369
+ return d += h - g, !1;
10260
10370
  }), a.size > 0) {
10261
10371
  const u = [...a].join(`
10262
10372
  `);
@@ -10284,8 +10394,8 @@ function $r(e, o, t) {
10284
10394
  function Gr(e, o) {
10285
10395
  return So(e, o, []).removedBlocks;
10286
10396
  }
10287
- function Wr(e, o) {
10288
- const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
10397
+ function Kr(e, o) {
10398
+ const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
10289
10399
  if (i)
10290
10400
  return x(
10291
10401
  i.node,
@@ -10295,8 +10405,8 @@ function Wr(e, o) {
10295
10405
  e.blockCache
10296
10406
  );
10297
10407
  }
10298
- function Kr(e, o) {
10299
- const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
10408
+ function Wr(e, o) {
10409
+ const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
10300
10410
  if (!i)
10301
10411
  return;
10302
10412
  const r = e._tiptapEditor.state.doc.resolve(
@@ -10312,7 +10422,7 @@ function Kr(e, o) {
10312
10422
  );
10313
10423
  }
10314
10424
  function qr(e, o) {
10315
- const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
10425
+ const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
10316
10426
  if (!i)
10317
10427
  return;
10318
10428
  const r = e._tiptapEditor.state.doc.resolve(
@@ -10327,8 +10437,8 @@ function qr(e, o) {
10327
10437
  e.blockCache
10328
10438
  );
10329
10439
  }
10330
- function Xr(e, o) {
10331
- const t = typeof o == "string" ? o : o.id, i = R(t, e._tiptapEditor.state.doc);
10440
+ function Zr(e, o) {
10441
+ const t = typeof o == "string" ? o : o.id, i = N(t, e._tiptapEditor.state.doc);
10332
10442
  if (!i)
10333
10443
  return;
10334
10444
  const n = e._tiptapEditor.state.doc.resolve(
@@ -10343,7 +10453,7 @@ function Xr(e, o) {
10343
10453
  e.blockCache
10344
10454
  );
10345
10455
  }
10346
- function Zr(e, o, t, i = { updateSelection: !0 }) {
10456
+ function Xr(e, o, t, i = { updateSelection: !0 }) {
10347
10457
  const n = t._tiptapEditor.state.tr;
10348
10458
  let { from: r, to: a } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, s = !0, l = !0, d = "";
10349
10459
  if (o.forEach((c) => {
@@ -10352,7 +10462,7 @@ function Zr(e, o, t, i = { updateSelection: !0 }) {
10352
10462
  const { parent: c } = n.doc.resolve(r);
10353
10463
  c.isTextblock && !c.type.spec.code && !c.childCount && (r -= 1, a += 1);
10354
10464
  }
10355
- return s ? n.insertText(d, r, a) : n.replaceWith(r, a, o), i.updateSelection && Ko(n, n.steps.length - 1, -1), t.dispatch(n), !0;
10465
+ return s ? n.insertText(d, r, a) : n.replaceWith(r, a, o), i.updateSelection && Wo(n, n.steps.length - 1, -1), t.dispatch(n), !0;
10356
10466
  }
10357
10467
  function Jr(e) {
10358
10468
  const o = e._tiptapEditor.state;
@@ -10410,10 +10520,10 @@ function Yr(e, o, t) {
10410
10520
  throw new Error(
10411
10521
  `Attempting to set selection with the same anchor and head blocks (id ${i})`
10412
10522
  );
10413
- const r = e._tiptapEditor.state.doc, a = R(i, r);
10523
+ const r = e._tiptapEditor.state.doc, a = N(i, r);
10414
10524
  if (!a)
10415
10525
  throw new Error(`Block with ID ${i} not found`);
10416
- const s = R(n, r);
10526
+ const s = N(n, r);
10417
10527
  if (!s)
10418
10528
  throw new Error(`Block with ID ${n} not found`);
10419
10529
  const l = te(a), d = te(s), c = e.schema.blockSchema[l.blockNoteType], u = e.schema.blockSchema[d.blockNoteType];
@@ -10427,17 +10537,17 @@ function Yr(e, o, t) {
10427
10537
  );
10428
10538
  let m, h;
10429
10539
  if (c.content === "table") {
10430
- const g = ft.get(l.blockContent.node);
10431
- m = l.blockContent.beforePos + g.positionAt(0, 0, l.blockContent.node) + 1 + 2;
10540
+ const f = ft.get(l.blockContent.node);
10541
+ m = l.blockContent.beforePos + f.positionAt(0, 0, l.blockContent.node) + 1 + 2;
10432
10542
  } else
10433
10543
  m = l.blockContent.beforePos + 1;
10434
10544
  if (u.content === "table") {
10435
- const g = ft.get(d.blockContent.node), f = d.blockContent.beforePos + g.positionAt(
10436
- g.height - 1,
10437
- g.width - 1,
10545
+ const f = ft.get(d.blockContent.node), g = d.blockContent.beforePos + f.positionAt(
10546
+ f.height - 1,
10547
+ f.width - 1,
10438
10548
  d.blockContent.node
10439
- ) + 1, b = r.resolve(f).nodeAfter.nodeSize;
10440
- h = f + b - 2;
10549
+ ) + 1, b = r.resolve(g).nodeAfter.nodeSize;
10550
+ h = g + b - 2;
10441
10551
  } else
10442
10552
  h = d.blockContent.afterPos - 1;
10443
10553
  e._tiptapEditor.dispatch(
@@ -10447,7 +10557,7 @@ function Yr(e, o, t) {
10447
10557
  );
10448
10558
  }
10449
10559
  function Qr(e) {
10450
- const { bnBlock: o } = y(e._tiptapEditor.state), t = e._tiptapEditor.state.doc.resolve(o.beforePos), i = t.nodeBefore, n = e._tiptapEditor.state.doc.resolve(
10560
+ const { bnBlock: o } = v(e._tiptapEditor.state), t = e._tiptapEditor.state.doc.resolve(o.beforePos), i = t.nodeBefore, n = e._tiptapEditor.state.doc.resolve(
10451
10561
  o.afterPos
10452
10562
  ).nodeAfter;
10453
10563
  let r;
@@ -10483,7 +10593,7 @@ function Qr(e) {
10483
10593
  };
10484
10594
  }
10485
10595
  function Eo(e, o, t = "start") {
10486
- const i = typeof o == "string" ? o : o.id, n = R(i, e._tiptapEditor.state.doc);
10596
+ const i = typeof o == "string" ? o : o.id, n = N(i, e._tiptapEditor.state.doc);
10487
10597
  if (!n)
10488
10598
  throw new Error(`Block with ID ${i} not found`);
10489
10599
  const r = te(n), a = e.schema.blockSchema[r.blockNoteType].content;
@@ -10506,7 +10616,7 @@ function Eo(e, o, t = "start") {
10506
10616
  s.afterPos - 4
10507
10617
  );
10508
10618
  else
10509
- throw new H(a);
10619
+ throw new O(a);
10510
10620
  } else {
10511
10621
  const s = t === "start" ? r.childContainer.node.firstChild : r.childContainer.node.lastChild;
10512
10622
  Eo(e, s.attrs.id, t);
@@ -10591,7 +10701,7 @@ function dt(e) {
10591
10701
  }
10592
10702
  async function oa(e, o, t, i) {
10593
10703
  await lt();
10594
- const r = Ne(o, t).exportBlocks(e, i);
10704
+ const r = je(o, t).exportBlocks(e, i);
10595
10705
  return dt(r);
10596
10706
  }
10597
10707
  function ia(e) {
@@ -10754,18 +10864,18 @@ async function Mo(e, o) {
10754
10864
  };
10755
10865
  let u;
10756
10866
  if (e.type === "paste") {
10757
- const g = o.getTextCursorPosition().block;
10758
- u = Tt(o, g, c);
10867
+ const f = o.getTextCursorPosition().block;
10868
+ u = Tt(o, f, c);
10759
10869
  } else if (e.type === "drop") {
10760
- const g = {
10870
+ const f = {
10761
10871
  left: e.clientX,
10762
10872
  top: e.clientY
10763
- }, f = (a = o.prosemirrorView) == null ? void 0 : a.posAtCoords(g);
10764
- if (!f)
10873
+ }, g = (a = o.prosemirrorView) == null ? void 0 : a.posAtCoords(f);
10874
+ if (!g)
10765
10875
  return;
10766
10876
  const b = q(
10767
10877
  o._tiptapEditor.state.doc,
10768
- f.pos
10878
+ g.pos
10769
10879
  );
10770
10880
  u = Tt(
10771
10881
  o,
@@ -10882,7 +10992,7 @@ function Lo(e, o) {
10882
10992
  function fa(e, o, t) {
10883
10993
  var s;
10884
10994
  let i = !1;
10885
- const n = e.state.selection instanceof ke;
10995
+ const n = e.state.selection instanceof _e;
10886
10996
  if (!n) {
10887
10997
  const l = e.state.doc.slice(
10888
10998
  e.state.selection.from,
@@ -10896,7 +11006,7 @@ function fa(e, o, t) {
10896
11006
  ) === void 0, i && (o = l);
10897
11007
  }
10898
11008
  let r;
10899
- const a = Ne(
11009
+ const a = je(
10900
11010
  e.state.schema,
10901
11011
  t
10902
11012
  );
@@ -11009,7 +11119,7 @@ const Mt = () => {
11009
11119
  }
11010
11120
  ];
11011
11121
  }
11012
- }), ka = (e) => {
11122
+ }), _a = (e) => {
11013
11123
  var i;
11014
11124
  const o = [];
11015
11125
  o.push(
@@ -11084,8 +11194,6 @@ const Mt = () => {
11084
11194
  excludes: "",
11085
11195
  inclusive: !1,
11086
11196
  keepOnSplit: !0,
11087
- group: "blocknoteIgnore",
11088
- // ignore in blocknote json
11089
11197
  addAttributes() {
11090
11198
  return {
11091
11199
  // orphans are marks that currently don't have an active thread. It could be
@@ -11125,7 +11233,7 @@ const Mt = () => {
11125
11233
  } : {};
11126
11234
  }
11127
11235
  });
11128
- class W {
11236
+ class K {
11129
11237
  constructor() {
11130
11238
  // eslint-disable-next-line @typescript-eslint/ban-types
11131
11239
  p(this, "callbacks", {});
@@ -11145,7 +11253,7 @@ class W {
11145
11253
  this.callbacks = {};
11146
11254
  }
11147
11255
  }
11148
- class _a extends W {
11256
+ class ka extends K {
11149
11257
  constructor(t) {
11150
11258
  super();
11151
11259
  p(this, "userCache", /* @__PURE__ */ new Map());
@@ -11193,40 +11301,44 @@ class _a extends W {
11193
11301
  }
11194
11302
  }
11195
11303
  const Se = new A("blocknote-comments"), wa = "SET_SELECTED_THREAD_ID";
11196
- function ya(e, o, t) {
11197
- const i = /* @__PURE__ */ new Map(), n = [];
11198
- return e.descendants((r, a) => {
11199
- r.marks.forEach((s) => {
11200
- if (s.type.name === t) {
11201
- const l = s.attrs.threadId;
11202
- if (!l)
11304
+ function va(e, o) {
11305
+ const t = /* @__PURE__ */ new Map();
11306
+ return e.descendants((i, n) => {
11307
+ i.marks.forEach((r) => {
11308
+ if (r.type.name === o) {
11309
+ const a = r.attrs.threadId;
11310
+ if (!a)
11203
11311
  return;
11204
- const d = a, c = d + r.nodeSize, u = i.get(l) ?? {
11312
+ const s = n, l = s + i.nodeSize, d = t.get(a) ?? {
11205
11313
  from: 1 / 0,
11206
11314
  to: 0
11207
11315
  };
11208
- i.set(l, {
11209
- from: Math.min(d, u.from),
11210
- to: Math.max(c, u.to)
11211
- }), o === l && n.push(
11212
- F.inline(d, c, {
11213
- class: "bn-thread-mark-selected"
11214
- })
11215
- );
11316
+ t.set(a, {
11317
+ from: Math.min(s, d.from),
11318
+ to: Math.max(l, d.to)
11319
+ });
11216
11320
  }
11217
11321
  });
11218
- }), {
11219
- decorations: N.create(e, n),
11220
- threadPositions: i
11221
- };
11322
+ }), t;
11222
11323
  }
11223
- class va extends W {
11324
+ class ya extends K {
11224
11325
  constructor(t, i, n) {
11225
11326
  super();
11226
11327
  p(this, "plugin");
11227
11328
  p(this, "userStore");
11329
+ /**
11330
+ * Whether a comment is currently being composed
11331
+ */
11228
11332
  p(this, "pendingComment", !1);
11333
+ /**
11334
+ * The currently selected thread id
11335
+ */
11229
11336
  p(this, "selectedThreadId");
11337
+ /**
11338
+ * Store the positions of all threads in the document.
11339
+ * this can be used later to implement a floating sidebar
11340
+ */
11341
+ p(this, "threadPositions", /* @__PURE__ */ new Map());
11230
11342
  /**
11231
11343
  * when a thread is resolved or deleted, we need to update the marks to reflect the new state
11232
11344
  */
@@ -11256,7 +11368,7 @@ class va extends W {
11256
11368
  });
11257
11369
  if (this.editor = t, this.threadStore = i, this.markType = n, !t.resolveUsers)
11258
11370
  throw new Error("resolveUsers is required for comments");
11259
- this.userStore = new _a(t.resolveUsers), this.threadStore.subscribe(this.updateMarksFromThreads), t.onCreate(() => {
11371
+ this.userStore = new ka(t.resolveUsers), this.threadStore.subscribe(this.updateMarksFromThreads), t.onCreate(() => {
11260
11372
  this.updateMarksFromThreads(this.threadStore.getThreads()), t.onSelectionChange(() => {
11261
11373
  this.pendingComment && (this.pendingComment = !1, this.emitStateUpdate());
11262
11374
  });
@@ -11267,19 +11379,39 @@ class va extends W {
11267
11379
  state: {
11268
11380
  init() {
11269
11381
  return {
11270
- threadPositions: /* @__PURE__ */ new Map(),
11271
- decorations: N.empty
11382
+ decorations: H.empty
11272
11383
  };
11273
11384
  },
11274
11385
  apply(a, s) {
11275
11386
  const l = a.getMeta(Se);
11276
- return !a.docChanged && !l ? s : ya(a.doc, r.selectedThreadId, n);
11387
+ if (!a.docChanged && !l)
11388
+ return s;
11389
+ const d = a.docChanged ? va(a.doc, r.markType) : r.threadPositions;
11390
+ (d.size > 0 || r.threadPositions.size > 0) && (r.threadPositions = d, r.emitStateUpdate());
11391
+ const c = [];
11392
+ if (r.selectedThreadId) {
11393
+ const u = d.get(
11394
+ r.selectedThreadId
11395
+ );
11396
+ u && c.push(
11397
+ F.inline(
11398
+ u.from,
11399
+ u.to,
11400
+ {
11401
+ class: "bn-thread-mark-selected"
11402
+ }
11403
+ )
11404
+ );
11405
+ }
11406
+ return {
11407
+ decorations: H.create(a.doc, c)
11408
+ };
11277
11409
  }
11278
11410
  },
11279
11411
  props: {
11280
11412
  decorations(a) {
11281
11413
  var s;
11282
- return ((s = Se.getState(a)) == null ? void 0 : s.decorations) ?? N.empty;
11414
+ return ((s = Se.getState(a)) == null ? void 0 : s.decorations) ?? H.empty;
11283
11415
  },
11284
11416
  /**
11285
11417
  * Handle click on a thread mark and mark it as selected
@@ -11295,7 +11427,7 @@ class va extends W {
11295
11427
  const c = d.marks.find(
11296
11428
  (m) => m.type.name === n && m.attrs.orphan !== !0
11297
11429
  ), u = c == null ? void 0 : c.attrs.threadId;
11298
- r.selectThread(u);
11430
+ r.selectThread(u, !1);
11299
11431
  }
11300
11432
  }
11301
11433
  });
@@ -11303,7 +11435,8 @@ class va extends W {
11303
11435
  emitStateUpdate() {
11304
11436
  this.emit("update", {
11305
11437
  selectedThreadId: this.selectedThreadId,
11306
- pendingComment: this.pendingComment
11438
+ pendingComment: this.pendingComment,
11439
+ threadPositions: this.threadPositions
11307
11440
  });
11308
11441
  }
11309
11442
  /**
@@ -11315,12 +11448,21 @@ class va extends W {
11315
11448
  /**
11316
11449
  * Set the selected thread
11317
11450
  */
11318
- selectThread(t) {
11319
- this.selectedThreadId !== t && (this.selectedThreadId = t, this.emitStateUpdate(), this.editor.dispatch(
11451
+ selectThread(t, i = !0) {
11452
+ var n, r;
11453
+ if (this.selectedThreadId !== t && (this.selectedThreadId = t, this.emitStateUpdate(), this.editor.dispatch(
11320
11454
  this.editor.prosemirrorView.state.tr.setMeta(Se, {
11321
11455
  name: wa
11322
11456
  })
11323
- ));
11457
+ ), t && i)) {
11458
+ const a = this.threadPositions.get(t);
11459
+ if (!a)
11460
+ return;
11461
+ (r = (n = this.editor.prosemirrorView) == null ? void 0 : n.domAtPos(a.from).node) == null || r.scrollIntoView({
11462
+ behavior: "smooth",
11463
+ block: "center"
11464
+ });
11465
+ }
11324
11466
  }
11325
11467
  /**
11326
11468
  * Start a pending comment (e.g.: when clicking the "Add comment" button)
@@ -11345,7 +11487,8 @@ class va extends W {
11345
11487
  head: r.head,
11346
11488
  anchor: r.anchor
11347
11489
  },
11348
- yjs: Li(a.binding, n.state)
11490
+ yjs: a ? Li(a.binding, n.state) : void 0
11491
+ // if we're not using yjs
11349
11492
  };
11350
11493
  await this.threadStore.addThreadToDocument({
11351
11494
  threadId: i.id,
@@ -11415,7 +11558,7 @@ class Ca {
11415
11558
  }
11416
11559
  }
11417
11560
  const Oe = new A("FilePanelPlugin");
11418
- class xa extends W {
11561
+ class xa extends K {
11419
11562
  constructor(t) {
11420
11563
  super();
11421
11564
  p(this, "view");
@@ -11550,7 +11693,7 @@ class Sa {
11550
11693
  const Ea = new A(
11551
11694
  "FormattingToolbarPlugin"
11552
11695
  );
11553
- class Ba extends W {
11696
+ class Ba extends K {
11554
11697
  constructor(t) {
11555
11698
  super();
11556
11699
  p(this, "view");
@@ -11582,7 +11725,7 @@ const It = (e, o) => {
11582
11725
  t.index(t.depth - 1),
11583
11726
  t.depth - 1
11584
11727
  );
11585
- return _e(
11728
+ return ke(
11586
11729
  e.resolve(i)
11587
11730
  );
11588
11731
  }, Qe = (e, o) => {
@@ -11590,13 +11733,13 @@ const It = (e, o) => {
11590
11733
  if (i === 0)
11591
11734
  return;
11592
11735
  const n = t.posAtIndex(i - 1);
11593
- return _e(
11736
+ return ke(
11594
11737
  e.resolve(n)
11595
11738
  );
11596
11739
  }, Po = (e, o) => {
11597
11740
  for (; o.childContainer; ) {
11598
11741
  const t = o.childContainer.node, i = e.resolve(o.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
11599
- o = _e(e.resolve(i));
11742
+ o = ke(e.resolve(i));
11600
11743
  }
11601
11744
  return o;
11602
11745
  }, Ta = (e, o) => e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*" && e.blockContent.node.childCount > 0 && o.isBlockContainer && o.blockContent.node.type.spec.content === "inline*", Ma = (e, o, t, i) => {
@@ -11632,7 +11775,7 @@ const It = (e, o) => {
11632
11775
  state: o,
11633
11776
  dispatch: t
11634
11777
  }) => {
11635
- const i = o.doc.resolve(e), n = _e(i), r = Qe(
11778
+ const i = o.doc.resolve(e), n = ke(i), r = Qe(
11636
11779
  o.doc,
11637
11780
  n.bnBlock.beforePos
11638
11781
  );
@@ -11656,7 +11799,7 @@ const It = (e, o) => {
11656
11799
  () => n.undoInputRule(),
11657
11800
  // Reverts block content type to a paragraph if the selection is at the start of the block.
11658
11801
  () => n.command(({ state: r }) => {
11659
- const a = y(r);
11802
+ const a = v(r);
11660
11803
  if (!a.isBlockContainer)
11661
11804
  return !1;
11662
11805
  const s = r.selection.from === a.blockContent.beforePos + 1, l = a.blockContent.node.type.name === "paragraph";
@@ -11673,7 +11816,7 @@ const It = (e, o) => {
11673
11816
  }),
11674
11817
  // Removes a level of nesting if the block is indented if the selection is at the start of the block.
11675
11818
  () => n.command(({ state: r }) => {
11676
- const a = y(r);
11819
+ const a = v(r);
11677
11820
  if (!a.isBlockContainer)
11678
11821
  return !1;
11679
11822
  const { blockContent: s } = a;
@@ -11682,14 +11825,14 @@ const It = (e, o) => {
11682
11825
  // Merges block with the previous one if it isn't indented, and the selection is at the start of the
11683
11826
  // block. The target block for merging must contain inline content.
11684
11827
  () => n.command(({ state: r }) => {
11685
- const a = y(r);
11828
+ const a = v(r);
11686
11829
  if (!a.isBlockContainer)
11687
11830
  return !1;
11688
11831
  const { bnBlock: s, blockContent: l } = a, d = r.selection.from === l.beforePos + 1, c = r.selection.empty, u = s.beforePos;
11689
11832
  return d && c ? i().command(At(u)).scrollIntoView().run() : !1;
11690
11833
  }),
11691
11834
  () => n.command(({ state: r, dispatch: a }) => {
11692
- const s = y(r);
11835
+ const s = v(r);
11693
11836
  if (!s.isBlockContainer || !(r.selection.from === s.blockContent.beforePos + 1) || Qe(
11694
11837
  r.doc,
11695
11838
  s.bnBlock.beforePos
@@ -11707,17 +11850,17 @@ const It = (e, o) => {
11707
11850
  );
11708
11851
  if ((m == null ? void 0 : m.blockNoteType) !== "columnList")
11709
11852
  throw new Error("parent of column is not a column list");
11710
- const h = u.childContainer.node.childCount === 1, g = h && m.childContainer.node.childCount === 2, f = m.childContainer.node.firstChild === u.bnBlock.node;
11853
+ const h = u.childContainer.node.childCount === 1, f = h && m.childContainer.node.childCount === 2, g = m.childContainer.node.firstChild === u.bnBlock.node;
11711
11854
  if (a) {
11712
11855
  const b = r.doc.slice(
11713
11856
  s.bnBlock.beforePos,
11714
11857
  s.bnBlock.afterPos,
11715
11858
  !1
11716
11859
  );
11717
- if (g)
11718
- if (f) {
11860
+ if (f)
11861
+ if (g) {
11719
11862
  r.tr.step(
11720
- new ze(
11863
+ new Ve(
11721
11864
  // replace entire column list
11722
11865
  m.bnBlock.beforePos,
11723
11866
  m.bnBlock.afterPos,
@@ -11730,11 +11873,11 @@ const It = (e, o) => {
11730
11873
  !1
11731
11874
  )
11732
11875
  );
11733
- const k = r.tr.doc.resolve(u.bnBlock.beforePos);
11734
- r.tr.setSelection(V.between(k, k));
11876
+ const _ = r.tr.doc.resolve(u.bnBlock.beforePos);
11877
+ r.tr.setSelection(V.between(_, _));
11735
11878
  } else {
11736
11879
  r.tr.step(
11737
- new ze(
11880
+ new Ve(
11738
11881
  // replace entire column list
11739
11882
  m.bnBlock.beforePos,
11740
11883
  m.bnBlock.afterPos,
@@ -11747,13 +11890,13 @@ const It = (e, o) => {
11747
11890
  !1
11748
11891
  )
11749
11892
  );
11750
- const k = r.tr.doc.resolve(
11893
+ const _ = r.tr.doc.resolve(
11751
11894
  r.tr.mapping.map(u.bnBlock.beforePos - 1)
11752
11895
  );
11753
- r.tr.setSelection(V.between(k, k));
11896
+ r.tr.setSelection(V.between(_, _));
11754
11897
  }
11755
11898
  else if (h)
11756
- if (f) {
11899
+ if (g) {
11757
11900
  r.tr.delete(
11758
11901
  u.bnBlock.beforePos,
11759
11902
  u.bnBlock.afterPos
@@ -11761,10 +11904,10 @@ const It = (e, o) => {
11761
11904
  m.bnBlock.beforePos,
11762
11905
  b.content
11763
11906
  );
11764
- const k = r.tr.doc.resolve(
11907
+ const _ = r.tr.doc.resolve(
11765
11908
  m.bnBlock.beforePos
11766
11909
  );
11767
- r.tr.setSelection(V.between(k, k));
11910
+ r.tr.setSelection(V.between(_, _));
11768
11911
  } else
11769
11912
  r.tr.delete(
11770
11913
  u.bnBlock.beforePos - 1,
@@ -11774,15 +11917,15 @@ const It = (e, o) => {
11774
11917
  r.tr.delete(
11775
11918
  s.bnBlock.beforePos,
11776
11919
  s.bnBlock.afterPos
11777
- ), f ? r.tr.insert(
11920
+ ), g ? r.tr.insert(
11778
11921
  m.bnBlock.beforePos - 1,
11779
11922
  b.content
11780
11923
  ) : r.tr.insert(
11781
11924
  u.bnBlock.beforePos - 1,
11782
11925
  b.content
11783
11926
  );
11784
- const k = r.tr.doc.resolve(u.bnBlock.beforePos - 1);
11785
- r.tr.setSelection(V.between(k, k));
11927
+ const _ = r.tr.doc.resolve(u.bnBlock.beforePos - 1);
11928
+ r.tr.setSelection(V.between(_, _));
11786
11929
  }
11787
11930
  }
11788
11931
  return !0;
@@ -11791,7 +11934,7 @@ const It = (e, o) => {
11791
11934
  // when the selection is empty and at the start of the block. Moves the
11792
11935
  // current block into the deleted block's place.
11793
11936
  () => n.command(({ state: r }) => {
11794
- const a = y(r);
11937
+ const a = v(r);
11795
11938
  if (!a.isBlockContainer)
11796
11939
  throw new Error("todo");
11797
11940
  const s = r.selection.from === a.blockContent.beforePos + 1, l = r.selection.empty, d = Qe(
@@ -11827,7 +11970,7 @@ const It = (e, o) => {
11827
11970
  // if one exists, the block has no children, and the selection is at the
11828
11971
  // end of the block.
11829
11972
  () => i.command(({ state: n }) => {
11830
- const r = y(n);
11973
+ const r = v(n);
11831
11974
  if (!r.isBlockContainer)
11832
11975
  return !1;
11833
11976
  const {
@@ -11836,10 +11979,10 @@ const It = (e, o) => {
11836
11979
  childContainer: l
11837
11980
  } = r, { depth: d } = n.doc.resolve(a.beforePos), c = a.afterPos === n.doc.nodeSize - 3, u = n.selection.from === s.afterPos - 1, m = n.selection.empty;
11838
11981
  if (!c && u && m && !(l !== void 0)) {
11839
- let g = d, f = a.afterPos + 1, b = n.doc.resolve(f).depth;
11840
- for (; b < g; )
11841
- g = b, f += 2, b = n.doc.resolve(f).depth;
11842
- return i.command(At(f - 1));
11982
+ let f = d, g = a.afterPos + 1, b = n.doc.resolve(g).depth;
11983
+ for (; b < f; )
11984
+ f = b, g += 2, b = n.doc.resolve(g).depth;
11985
+ return i.command(At(g - 1));
11843
11986
  }
11844
11987
  return !1;
11845
11988
  })
@@ -11848,7 +11991,7 @@ const It = (e, o) => {
11848
11991
  // Removes a level of nesting if the block is empty & indented, while the selection is also empty & at the start
11849
11992
  // of the block.
11850
11993
  () => i.command(({ state: n }) => {
11851
- const r = y(n);
11994
+ const r = v(n);
11852
11995
  if (!r.isBlockContainer)
11853
11996
  return !1;
11854
11997
  const { bnBlock: a, blockContent: s } = r, { depth: l } = n.doc.resolve(a.beforePos), d = n.selection.$anchor.parentOffset === 0, c = n.selection.anchor === n.selection.head, u = s.node.childCount === 0, m = l > 1;
@@ -11857,15 +12000,15 @@ const It = (e, o) => {
11857
12000
  // Creates a new block and moves the selection to it if the current one is empty, while the selection is also
11858
12001
  // empty & at the start of the block.
11859
12002
  () => i.command(({ state: n, dispatch: r }) => {
11860
- const a = y(n);
12003
+ const a = v(n);
11861
12004
  if (!a.isBlockContainer)
11862
12005
  return !1;
11863
12006
  const { bnBlock: s, blockContent: l } = a, d = n.selection.$anchor.parentOffset === 0, c = n.selection.anchor === n.selection.head, u = l.node.childCount === 0;
11864
12007
  if (d && c && u) {
11865
12008
  const m = s.afterPos, h = m + 2;
11866
12009
  if (r) {
11867
- const g = n.schema.nodes.blockContainer.createAndFill();
11868
- n.tr.insert(m, g).scrollIntoView(), n.tr.setSelection(
12010
+ const f = n.schema.nodes.blockContainer.createAndFill();
12011
+ n.tr.insert(m, f).scrollIntoView(), n.tr.setSelection(
11869
12012
  new V(n.doc.resolve(h))
11870
12013
  );
11871
12014
  }
@@ -11876,7 +12019,7 @@ const It = (e, o) => {
11876
12019
  // Splits the current block, moving content inside that's after the cursor to a new text block below. Also
11877
12020
  // deletes the selection beforehand, if it's not empty.
11878
12021
  () => i.command(({ state: n, chain: r }) => {
11879
- const a = y(n);
12022
+ const a = v(n);
11880
12023
  if (!a.isBlockContainer)
11881
12024
  return !1;
11882
12025
  const { blockContent: s } = a, l = n.selection.$anchor.parentOffset === 0;
@@ -12033,7 +12176,7 @@ class Ia {
12033
12176
  }
12034
12177
  }
12035
12178
  const Aa = new A("LinkToolbarPlugin");
12036
- class Pa extends W {
12179
+ class Pa extends K {
12037
12180
  constructor(t) {
12038
12181
  super();
12039
12182
  p(this, "view");
@@ -12089,7 +12232,7 @@ class Pa extends W {
12089
12232
  return ((i = (t = this.view) == null ? void 0 : t.state) == null ? void 0 : i.show) || !1;
12090
12233
  }
12091
12234
  }
12092
- const Na = [
12235
+ const ja = [
12093
12236
  "http",
12094
12237
  "https",
12095
12238
  "ftp",
@@ -12100,7 +12243,7 @@ const Na = [
12100
12243
  "sms",
12101
12244
  "cid",
12102
12245
  "xmpp"
12103
- ], ja = "https", Ra = new A("node-selection-keyboard");
12246
+ ], Na = "https", Ra = new A("node-selection-keyboard");
12104
12247
  class Da {
12105
12248
  constructor() {
12106
12249
  p(this, "plugin");
@@ -12141,7 +12284,7 @@ class Ha {
12141
12284
  key: Ua,
12142
12285
  view: (i) => {
12143
12286
  var d, c;
12144
- const n = `placeholder-selector-${Vt()}`;
12287
+ const n = `placeholder-selector-${zt()}`;
12145
12288
  i.dom.classList.add(n);
12146
12289
  const r = document.createElement("style"), a = o._tiptapEditor.options.injectNonce;
12147
12290
  a && r.setAttribute("nonce", a), ((d = o.prosemirrorView) == null ? void 0 : d.root) instanceof ShadowRoot ? o.prosemirrorView.root.append(r) : (c = o.prosemirrorView) == null || c.root.head.appendChild(r);
@@ -12152,21 +12295,21 @@ class Ha {
12152
12295
  emptyDocument: m,
12153
12296
  ...h
12154
12297
  } = t;
12155
- for (const [b, k] of Object.entries(h)) {
12156
- const _ = `[data-content-type="${b}"]`;
12298
+ for (const [b, _] of Object.entries(h)) {
12299
+ const k = `[data-content-type="${b}"]`;
12157
12300
  s.insertRule(
12158
- `${l(_)} { content: ${JSON.stringify(
12159
- k
12301
+ `${l(k)} { content: ${JSON.stringify(
12302
+ _
12160
12303
  )}; }`
12161
12304
  );
12162
12305
  }
12163
- const g = "[data-is-only-empty-block]", f = "[data-is-empty-and-focused]";
12306
+ const f = "[data-is-only-empty-block]", g = "[data-is-empty-and-focused]";
12164
12307
  s.insertRule(
12165
- `${l(g)} { content: ${JSON.stringify(
12308
+ `${l(f)} { content: ${JSON.stringify(
12166
12309
  m
12167
12310
  )}; }`
12168
12311
  ), s.insertRule(
12169
- `${l(f)} { content: ${JSON.stringify(
12312
+ `${l(g)} { content: ${JSON.stringify(
12170
12313
  u
12171
12314
  )}; }`
12172
12315
  );
@@ -12203,7 +12346,7 @@ class Ha {
12203
12346
  })
12204
12347
  );
12205
12348
  }
12206
- return N.create(n, a);
12349
+ return H.create(n, a);
12207
12350
  }
12208
12351
  }
12209
12352
  });
@@ -12219,7 +12362,7 @@ const Pt = new A("previous-blocks"), Oa = {
12219
12362
  depth: "depth",
12220
12363
  "depth-change": "depth-change"
12221
12364
  };
12222
- class Va {
12365
+ class za {
12223
12366
  constructor() {
12224
12367
  p(this, "plugin");
12225
12368
  let o;
@@ -12260,19 +12403,19 @@ class Va {
12260
12403
  for (const c of d) {
12261
12404
  const u = l.get(c.node.attrs.id), m = u == null ? void 0 : u.node.firstChild, h = c.node.firstChild;
12262
12405
  if (u && m && h) {
12263
- const g = {
12406
+ const f = {
12264
12407
  index: h.attrs.index,
12265
12408
  level: h.attrs.level,
12266
12409
  type: h.type.name,
12267
12410
  depth: r.doc.resolve(c.pos).depth
12268
12411
  };
12269
- let f = {
12412
+ let g = {
12270
12413
  index: m.attrs.index,
12271
12414
  level: m.attrs.level,
12272
12415
  type: m.type.name,
12273
12416
  depth: n.doc.resolve(u.pos).depth
12274
12417
  };
12275
- a[c.node.attrs.id] = f, t.getMeta("numberedListIndexing") && (c.node.attrs.id in i.prevTransactionOldBlockAttrs && (f = i.prevTransactionOldBlockAttrs[c.node.attrs.id]), g.type === "numberedListItem" && (f.index = g.index)), i.currentTransactionOldBlockAttrs[c.node.attrs.id] = f, JSON.stringify(f) !== JSON.stringify(g) && (f["depth-change"] = f.depth - g.depth, i.updatedBlocks.add(c.node.attrs.id));
12418
+ a[c.node.attrs.id] = g, t.getMeta("numberedListIndexing") && (c.node.attrs.id in i.prevTransactionOldBlockAttrs && (g = i.prevTransactionOldBlockAttrs[c.node.attrs.id]), f.type === "numberedListItem" && (g.index = f.index)), i.currentTransactionOldBlockAttrs[c.node.attrs.id] = g, JSON.stringify(g) !== JSON.stringify(f) && (g["depth-change"] = g.depth - f.depth, i.updatedBlocks.add(c.node.attrs.id));
12276
12419
  }
12277
12420
  }
12278
12421
  return i.prevTransactionOldBlockAttrs = a, i;
@@ -12294,28 +12437,28 @@ class Va {
12294
12437
  ...l
12295
12438
  });
12296
12439
  n.push(d);
12297
- }), N.create(t.doc, n);
12440
+ }), H.create(t.doc, n);
12298
12441
  }
12299
12442
  }
12300
12443
  });
12301
12444
  }
12302
12445
  }
12303
- const Nt = new A("blocknote-show-selection");
12304
- class za {
12446
+ const jt = new A("blocknote-show-selection");
12447
+ class Va {
12305
12448
  constructor(o) {
12306
12449
  p(this, "plugin");
12307
12450
  p(this, "enabled", !1);
12308
12451
  this.editor = o, this.plugin = new T({
12309
- key: Nt,
12452
+ key: jt,
12310
12453
  props: {
12311
12454
  decorations: (t) => {
12312
12455
  const { doc: i, selection: n } = t;
12313
12456
  if (!this.enabled)
12314
- return N.empty;
12457
+ return H.empty;
12315
12458
  const r = F.inline(n.from, n.to, {
12316
12459
  "data-show-selection": "true"
12317
12460
  });
12318
- return N.create(i, [r]);
12461
+ return H.create(i, [r]);
12319
12462
  }
12320
12463
  }
12321
12464
  });
@@ -12323,14 +12466,14 @@ class za {
12323
12466
  setEnabled(o) {
12324
12467
  var t, i;
12325
12468
  this.enabled !== o && (this.enabled = o, (i = this.editor.prosemirrorView) == null || i.dispatch(
12326
- (t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(Nt, {})
12469
+ (t = this.editor.prosemirrorView) == null ? void 0 : t.state.tr.setMeta(jt, {})
12327
12470
  ));
12328
12471
  }
12329
12472
  getEnabled() {
12330
12473
  return this.enabled;
12331
12474
  }
12332
12475
  }
12333
- function No(e, o) {
12476
+ function jo(e, o) {
12334
12477
  var t, i;
12335
12478
  for (; e && e.parentElement && e.parentElement !== o.dom && ((t = e.getAttribute) == null ? void 0 : t.call(e, "data-node-type")) !== "blockContainer"; )
12336
12479
  e = e.parentElement;
@@ -12372,7 +12515,7 @@ class re extends De {
12372
12515
  return { type: "node", anchor: this.anchor, head: this.head };
12373
12516
  }
12374
12517
  }
12375
- let z;
12518
+ let D;
12376
12519
  function Fa(e, o) {
12377
12520
  let t, i;
12378
12521
  const n = o.resolve(e.from).node().type.spec.group === "blockContent", r = o.resolve(e.to).node().type.spec.group === "blockContent", a = Math.min(e.$anchor.depth, e.$head.depth);
@@ -12383,9 +12526,9 @@ function Fa(e, o) {
12383
12526
  t = e.from, i = e.to;
12384
12527
  return { from: t, to: i };
12385
12528
  }
12386
- function jt(e, o, t = o) {
12529
+ function Nt(e, o, t = o) {
12387
12530
  o === t && (t += e.state.doc.resolve(o + 1).node().nodeSize);
12388
- const i = e.domAtPos(o).node.cloneNode(!0), n = e.domAtPos(o).node, r = (c, u) => Array.prototype.indexOf.call(c.children, u), a = r(
12531
+ const i = e.domAtPos(o).node.cloneNode(!0), n = e.domAtPos(o).node, r = (u, m) => Array.prototype.indexOf.call(u.children, m), a = r(
12389
12532
  n,
12390
12533
  // Expects from position to be just before the first selected block.
12391
12534
  e.domAtPos(o + 1).node.parentElement
@@ -12394,16 +12537,21 @@ function jt(e, o, t = o) {
12394
12537
  // Expects to position to be just after the last selected block.
12395
12538
  e.domAtPos(t - 1).node.parentElement
12396
12539
  );
12397
- for (let c = n.childElementCount - 1; c >= 0; c--)
12398
- (c > s || c < a) && i.removeChild(i.children[c]);
12399
- jo(e.root), z = i;
12400
- const d = e.dom.className.split(" ").filter(
12401
- (c) => c !== "ProseMirror" && c !== "bn-root" && c !== "bn-editor"
12540
+ for (let u = n.childElementCount - 1; u >= 0; u--)
12541
+ (u > s || u < a) && i.removeChild(i.children[u]);
12542
+ No(e.root), D = i;
12543
+ const l = D.getElementsByTagName("iframe");
12544
+ for (let u = 0; u < l.length; u++) {
12545
+ const m = l[u], h = m.parentElement;
12546
+ h && h.removeChild(m);
12547
+ }
12548
+ const c = e.dom.className.split(" ").filter(
12549
+ (u) => u !== "ProseMirror" && u !== "bn-root" && u !== "bn-editor"
12402
12550
  ).join(" ");
12403
- z.className = z.className + " bn-drag-preview " + d, e.root instanceof ShadowRoot ? e.root.appendChild(z) : e.root.body.appendChild(z);
12551
+ D.className = D.className + " bn-drag-preview " + c, e.root instanceof ShadowRoot ? e.root.appendChild(D) : e.root.body.appendChild(D);
12404
12552
  }
12405
- function jo(e) {
12406
- z !== void 0 && (e instanceof ShadowRoot ? e.removeChild(z) : e.body.removeChild(z), z = void 0);
12553
+ function No(e) {
12554
+ D !== void 0 && (e instanceof ShadowRoot ? e.removeChild(D) : e.body.removeChild(D), D = void 0);
12407
12555
  }
12408
12556
  function $a(e, o, t) {
12409
12557
  if (!e.dataTransfer)
@@ -12411,7 +12559,7 @@ function $a(e, o, t) {
12411
12559
  const i = t.prosemirrorView;
12412
12560
  if (!i)
12413
12561
  return;
12414
- const n = R(o.id, i.state.doc);
12562
+ const n = N(o.id, i.state.doc);
12415
12563
  if (!n)
12416
12564
  throw new Error(`Block with ID ${o.id} not found`);
12417
12565
  const r = n.posBeforeNode;
@@ -12419,11 +12567,11 @@ function $a(e, o, t) {
12419
12567
  const a = i.state.selection, s = i.state.doc, { from: l, to: d } = Fa(a, s), c = l <= r && r < d, u = a.$anchor.node() !== a.$head.node() || a instanceof re;
12420
12568
  c && u ? (i.dispatch(
12421
12569
  i.state.tr.setSelection(re.create(s, l, d))
12422
- ), jt(i, l, d)) : (i.dispatch(
12570
+ ), Nt(i, l, d)) : (i.dispatch(
12423
12571
  i.state.tr.setSelection(be.create(i.state.doc, r))
12424
- ), jt(i, r));
12425
- const m = i.state.selection.content(), h = t.pmSchema, g = i.serializeForClipboard(m).dom.innerHTML, f = Ne(h, t), b = Lo(m.content, t.schema), k = f.exportBlocks(b, {}), _ = dt(k);
12426
- e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", g), e.dataTransfer.setData("text/html", k), e.dataTransfer.setData("text/plain", _), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(z, 0, 0);
12572
+ ), Nt(i, r));
12573
+ const m = i.state.selection.content(), h = t.pmSchema, f = i.serializeForClipboard(m).dom.innerHTML, g = je(h, t), b = Lo(m.content, t.schema), _ = g.exportBlocks(b, {}), k = dt(_);
12574
+ e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", _), e.dataTransfer.setData("text/plain", k), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(D, 0, 0);
12427
12575
  }
12428
12576
  }
12429
12577
  const ue = 0.1;
@@ -12444,7 +12592,7 @@ function et(e, o, t, i = !0) {
12444
12592
  },
12445
12593
  t,
12446
12594
  !1
12447
- ) : No(r, e);
12595
+ ) : jo(r, e);
12448
12596
  }
12449
12597
  function Ga(e, o, t) {
12450
12598
  if (!o.dom.firstChild)
@@ -12461,7 +12609,7 @@ function Ga(e, o, t) {
12461
12609
  }
12462
12610
  return s;
12463
12611
  }
12464
- class Wa {
12612
+ class Ka {
12465
12613
  constructor(o, t, i, n) {
12466
12614
  p(this, "state");
12467
12615
  p(this, "emitUpdate");
@@ -12692,8 +12840,8 @@ class Wa {
12692
12840
  ), this.pmView.root.removeEventListener("scroll", this.onScroll, !0);
12693
12841
  }
12694
12842
  }
12695
- const Ka = new A("SideMenuPlugin");
12696
- class qa extends W {
12843
+ const Wa = new A("SideMenuPlugin");
12844
+ class qa extends K {
12697
12845
  constructor(t, i) {
12698
12846
  super();
12699
12847
  p(this, "view");
@@ -12708,7 +12856,7 @@ class qa extends W {
12708
12856
  * Handles drag & drop events for blocks.
12709
12857
  */
12710
12858
  p(this, "blockDragEnd", () => {
12711
- this.editor.prosemirrorView && jo(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
12859
+ this.editor.prosemirrorView && No(this.editor.prosemirrorView.root), this.view && (this.view.isDragOrigin = !1);
12712
12860
  });
12713
12861
  /**
12714
12862
  * Freezes the side menu. When frozen, the side menu will stay
@@ -12727,8 +12875,8 @@ class qa extends W {
12727
12875
  this.view.menuFrozen = !1, this.view.state.show = !1, this.view.emitUpdate(this.view.state);
12728
12876
  });
12729
12877
  this.editor = t, this.plugin = new T({
12730
- key: Ka,
12731
- view: (n) => (this.view = new Wa(
12878
+ key: Wa,
12879
+ view: (n) => (this.view = new Ka(
12732
12880
  t,
12733
12881
  i,
12734
12882
  n,
@@ -12742,8 +12890,8 @@ class qa extends W {
12742
12890
  return this.on("update", t);
12743
12891
  }
12744
12892
  }
12745
- const Xa = Xo((e) => e.type.name === "blockContainer");
12746
- class Za {
12893
+ const Za = Zo((e) => e.type.name === "blockContainer");
12894
+ class Xa {
12747
12895
  constructor(o, t) {
12748
12896
  p(this, "state");
12749
12897
  p(this, "emitUpdate");
@@ -12808,7 +12956,7 @@ class Za {
12808
12956
  }
12809
12957
  }
12810
12958
  const ae = new A("SuggestionMenuPlugin");
12811
- class Ja extends W {
12959
+ class Ja extends K {
12812
12960
  constructor(t) {
12813
12961
  super();
12814
12962
  p(this, "view");
@@ -12828,7 +12976,7 @@ class Ja extends W {
12828
12976
  const i = this.triggerCharacters;
12829
12977
  this.plugin = new T({
12830
12978
  key: ae,
12831
- view: () => (this.view = new Za(
12979
+ view: () => (this.view = new Xa(
12832
12980
  t,
12833
12981
  (n, r) => {
12834
12982
  this.emit(`update ${n}`, r);
@@ -12885,9 +13033,9 @@ class Ja extends W {
12885
13033
  if (r === void 0)
12886
13034
  return null;
12887
13035
  if (!r.deleteTriggerCharacter) {
12888
- const a = Xa(n.selection);
13036
+ const a = Za(n.selection);
12889
13037
  if (a)
12890
- return N.create(n.doc, [
13038
+ return H.create(n.doc, [
12891
13039
  F.node(
12892
13040
  a.pos,
12893
13041
  a.pos + a.node.nodeSize,
@@ -12899,7 +13047,7 @@ class Ja extends W {
12899
13047
  )
12900
13048
  ]);
12901
13049
  }
12902
- return N.create(n.doc, [
13050
+ return H.create(n.doc, [
12903
13051
  F.inline(
12904
13052
  r.queryStartPos - r.triggerCharacter.length,
12905
13053
  r.queryStartPos,
@@ -12977,7 +13125,7 @@ class ts {
12977
13125
  this.mouseState = "up", this.mouseMoveHandler(o);
12978
13126
  });
12979
13127
  p(this, "mouseMoveHandler", (o) => {
12980
- var d, c, u, m, h, g, f;
13128
+ var d, c, u, m, h, f, g;
12981
13129
  if (this.menuFrozen || this.mouseState === "selecting" || !(o.target instanceof Element) || !this.pmView.dom.contains(o.target))
12982
13130
  return;
12983
13131
  const t = Qa(o.target);
@@ -12991,12 +13139,12 @@ class ts {
12991
13139
  }
12992
13140
  if (!t.tbodyNode)
12993
13141
  return;
12994
- const i = t.tbodyNode.getBoundingClientRect(), n = No(t.domNode, this.pmView);
13142
+ const i = t.tbodyNode.getBoundingClientRect(), n = jo(t.domNode, this.pmView);
12995
13143
  if (!n)
12996
13144
  return;
12997
13145
  this.tableElement = n.node;
12998
13146
  let r;
12999
- const a = R(
13147
+ const a = N(
13000
13148
  n.id,
13001
13149
  this.editor._tiptapEditor.state.doc
13002
13150
  );
@@ -13015,33 +13163,33 @@ class ts {
13015
13163
  const l = (m = t.domNode.closest(".tableWrapper")) == null ? void 0 : m.querySelector(".table-widgets-container");
13016
13164
  if ((t == null ? void 0 : t.type) === "wrapper") {
13017
13165
  const b = o.clientY >= i.bottom - 1 && // -1 to account for fractions of pixels in "bottom"
13018
- o.clientY < i.bottom + 20, k = o.clientX >= i.right - 1 && o.clientX < i.right + 20, _ = o.clientX > i.right || o.clientY > i.bottom;
13166
+ o.clientY < i.bottom + 20, _ = o.clientX >= i.right - 1 && o.clientX < i.right + 20, k = o.clientX > i.right || o.clientY > i.bottom;
13019
13167
  this.state = {
13020
13168
  ...this.state,
13021
13169
  show: !0,
13022
13170
  showAddOrRemoveRowsButton: b,
13023
- showAddOrRemoveColumnsButton: k,
13171
+ showAddOrRemoveColumnsButton: _,
13024
13172
  referencePosTable: i,
13025
13173
  block: r,
13026
13174
  widgetContainer: l,
13027
- colIndex: _ || (h = this.state) == null ? void 0 : h.colIndex,
13028
- rowIndex: _ || (g = this.state) == null ? void 0 : g.rowIndex,
13029
- referencePosCell: _ || (f = this.state) == null ? void 0 : f.referencePosCell
13175
+ colIndex: k || (h = this.state) == null ? void 0 : h.colIndex,
13176
+ rowIndex: k || (f = this.state) == null ? void 0 : f.rowIndex,
13177
+ referencePosCell: k || (g = this.state) == null ? void 0 : g.referencePosCell
13030
13178
  };
13031
13179
  } else {
13032
- const b = Ee(t.domNode), k = Ee(t.domNode.parentElement), _ = t.domNode.getBoundingClientRect();
13033
- if (this.state !== void 0 && this.state.show && this.tableId === n.id && this.state.rowIndex === k && this.state.colIndex === b)
13180
+ const b = Ee(t.domNode), _ = Ee(t.domNode.parentElement), k = t.domNode.getBoundingClientRect();
13181
+ if (this.state !== void 0 && this.state.show && this.tableId === n.id && this.state.rowIndex === _ && this.state.colIndex === b)
13034
13182
  return;
13035
13183
  this.state = {
13036
13184
  show: !0,
13037
13185
  showAddOrRemoveColumnsButton: b === r.content.rows[0].cells.length - 1,
13038
- showAddOrRemoveRowsButton: k === r.content.rows.length - 1,
13186
+ showAddOrRemoveRowsButton: _ === r.content.rows.length - 1,
13039
13187
  referencePosTable: i,
13040
13188
  block: r,
13041
13189
  draggingState: void 0,
13042
- referencePosCell: _,
13190
+ referencePosCell: k,
13043
13191
  colIndex: b,
13044
- rowIndex: k,
13192
+ rowIndex: _,
13045
13193
  widgetContainer: l
13046
13194
  };
13047
13195
  }
@@ -13068,9 +13216,7 @@ class ts {
13068
13216
  (h) => h.tagName === "TD" || h.tagName === "TH"
13069
13217
  );
13070
13218
  if (i.length === 0)
13071
- throw new Error(
13072
- "Could not find table cell element that the mouse cursor is hovering over."
13073
- );
13219
+ return;
13074
13220
  const n = i[0];
13075
13221
  let r = !1;
13076
13222
  const a = Ee(n.parentElement), s = Ee(n), l = this.state.draggingState.draggedCellOrientation === "row" ? this.state.rowIndex : this.state.colIndex, c = (this.state.draggingState.draggedCellOrientation === "row" ? a : s) !== l;
@@ -13145,9 +13291,12 @@ class ts {
13145
13291
  }
13146
13292
  // Updates drag handles when the table is modified or removed.
13147
13293
  update() {
13294
+ var n;
13148
13295
  if (!this.state || !this.state.show)
13149
13296
  return;
13150
- if (this.state.block = this.editor.getBlock(this.state.block.id), !this.state.block) {
13297
+ if (this.state.block = this.editor.getBlock(this.state.block.id), !this.state.block || // when collaborating, the table element might be replaced and out of date
13298
+ // because yjs replaces the element when for example you change the color via the side menu
13299
+ !((n = this.tableElement) != null && n.isConnected)) {
13151
13300
  this.state.show = !1, this.state.showAddOrRemoveRowsButton = !1, this.state.showAddOrRemoveColumnsButton = !1, this.emitUpdate();
13152
13301
  return;
13153
13302
  }
@@ -13161,8 +13310,8 @@ class ts {
13161
13310
  "Table block does not contain a 'tbody' HTML element. This should never happen."
13162
13311
  );
13163
13312
  if (this.state.rowIndex !== void 0 && this.state.colIndex !== void 0) {
13164
- const r = i.children[this.state.rowIndex].children[this.state.colIndex];
13165
- r ? this.state.referencePosCell = r.getBoundingClientRect() : (this.state.rowIndex = void 0, this.state.colIndex = void 0);
13313
+ const a = i.children[this.state.rowIndex].children[this.state.colIndex];
13314
+ a ? this.state.referencePosCell = a.getBoundingClientRect() : (this.state.rowIndex = void 0, this.state.colIndex = void 0);
13166
13315
  }
13167
13316
  this.state.referencePosTable = i.getBoundingClientRect(), this.emitUpdate();
13168
13317
  }
@@ -13177,7 +13326,7 @@ class ts {
13177
13326
  }
13178
13327
  }
13179
13328
  const pe = new A("TableHandlesPlugin");
13180
- class os extends W {
13329
+ class os extends K {
13181
13330
  constructor(t) {
13182
13331
  super();
13183
13332
  p(this, "view");
@@ -13259,7 +13408,7 @@ class os extends W {
13259
13408
  p(this, "unfreezeHandles", () => {
13260
13409
  this.view.menuFrozen = !1;
13261
13410
  });
13262
- p(this, "getCellsAtRowHandle", (t, i) => Ke(t, i));
13411
+ p(this, "getCellsAtRowHandle", (t, i) => We(t, i));
13263
13412
  /**
13264
13413
  * Get all the cells in a column of the table block.
13265
13414
  */
@@ -13284,7 +13433,7 @@ class os extends W {
13284
13433
  d.posAtIndex(i.col)
13285
13434
  ), u = r.tr;
13286
13435
  return u.setSelection(
13287
- new ke(l, c)
13436
+ new _e(l, c)
13288
13437
  ), r.apply(u);
13289
13438
  });
13290
13439
  /**
@@ -13331,9 +13480,9 @@ class os extends W {
13331
13480
  const t = this.editor.prosemirrorState, i = t.selection;
13332
13481
  let n = i.$from, r = i.$to;
13333
13482
  if (Et(i)) {
13334
- const { ranges: g } = i;
13335
- g.forEach((f) => {
13336
- n = f.$from.min(n ?? f.$from), r = f.$to.max(r ?? f.$to);
13483
+ const { ranges: f } = i;
13484
+ f.forEach((g) => {
13485
+ n = g.$from.min(n ?? g.$from), r = g.$to.max(r ?? g.$to);
13337
13486
  });
13338
13487
  } else if (n = t.doc.resolve(
13339
13488
  i.$from.pos - i.$from.parentOffset - 1
@@ -13344,9 +13493,9 @@ class os extends W {
13344
13493
  const a = t.doc.resolve(
13345
13494
  n.pos - n.parentOffset - 1
13346
13495
  ), s = t.doc.resolve(r.pos - r.parentOffset - 1), l = t.doc.resolve(a.pos - a.parentOffset - 1), d = n.index(a.depth), c = a.index(l.depth), u = r.index(s.depth), m = s.index(l.depth), h = [];
13347
- for (let g = c; g <= m; g++)
13348
- for (let f = d; f <= u; f++)
13349
- h.push({ row: g, col: f });
13496
+ for (let f = c; f <= m; f++)
13497
+ for (let g = d; g <= u; g++)
13498
+ h.push({ row: f, col: g });
13350
13499
  return {
13351
13500
  from: {
13352
13501
  row: c,
@@ -13391,55 +13540,43 @@ class os extends W {
13391
13540
  const n = this.view.state.draggingState.draggedCellOrientation === "row" ? this.view.state.rowIndex : this.view.state.colIndex;
13392
13541
  if (n === void 0)
13393
13542
  return;
13394
- const r = [];
13395
- if (n === this.view.state.draggingState.originalIndex)
13396
- return N.create(i.doc, r);
13397
- if (this.view.state.draggingState.draggedCellOrientation === "row" && !Qt(
13543
+ const r = [], { block: a, draggingState: s } = this.view.state, { originalIndex: l, draggedCellOrientation: d } = s;
13544
+ if (n === l || !a || d === "row" && !Qt(a, l, n) || d === "col" && !eo(a, l, n))
13545
+ return H.create(i.doc, r);
13546
+ const c = i.doc.resolve(this.view.tablePos + 1);
13547
+ return this.view.state.draggingState.draggedCellOrientation === "row" ? We(
13398
13548
  this.view.state.block,
13399
- this.view.state.draggingState.originalIndex,
13400
13549
  n
13401
- ))
13402
- return N.create(i.doc, r);
13403
- if (this.view.state.draggingState.draggedCellOrientation === "col" && !eo(
13404
- this.view.state.block,
13405
- this.view.state.draggingState.originalIndex,
13406
- n
13407
- ))
13408
- return N.create(i.doc, r);
13409
- const a = i.doc.resolve(this.view.tablePos + 1), s = this.view.state.draggingState.originalIndex;
13410
- return this.view.state.draggingState.draggedCellOrientation === "row" ? Ke(
13411
- this.view.state.block,
13412
- n
13413
- ).forEach(({ row: d, col: c }) => {
13414
- const u = i.doc.resolve(
13415
- a.posAtIndex(d) + 1
13416
- ), m = i.doc.resolve(
13417
- u.posAtIndex(c) + 1
13418
- ), h = m.node(), g = m.pos + (n > s ? h.nodeSize - 2 : 0);
13550
+ ).forEach(({ row: m, col: h }) => {
13551
+ const f = i.doc.resolve(
13552
+ c.posAtIndex(m) + 1
13553
+ ), g = i.doc.resolve(
13554
+ f.posAtIndex(h) + 1
13555
+ ), b = g.node(), _ = g.pos + (n > l ? b.nodeSize - 2 : 0);
13419
13556
  r.push(
13420
13557
  // The widget is a small bar which spans the width of the cell.
13421
- F.widget(g, () => {
13422
- const f = document.createElement("div");
13423
- return f.className = "bn-table-drop-cursor", f.style.left = "0", f.style.right = "0", n > s ? f.style.bottom = "-2px" : f.style.top = "-3px", f.style.height = "4px", f;
13558
+ F.widget(_, () => {
13559
+ const k = document.createElement("div");
13560
+ return k.className = "bn-table-drop-cursor", k.style.left = "0", k.style.right = "0", n > l ? k.style.bottom = "-2px" : k.style.top = "-3px", k.style.height = "4px", k;
13424
13561
  })
13425
13562
  );
13426
13563
  }) : qe(
13427
13564
  this.view.state.block,
13428
13565
  n
13429
- ).forEach(({ row: d, col: c }) => {
13430
- const u = i.doc.resolve(
13431
- a.posAtIndex(d) + 1
13432
- ), m = i.doc.resolve(
13433
- u.posAtIndex(c) + 1
13434
- ), h = m.node(), g = m.pos + (n > s ? h.nodeSize - 2 : 0);
13566
+ ).forEach(({ row: m, col: h }) => {
13567
+ const f = i.doc.resolve(
13568
+ c.posAtIndex(m) + 1
13569
+ ), g = i.doc.resolve(
13570
+ f.posAtIndex(h) + 1
13571
+ ), b = g.node(), _ = g.pos + (n > l ? b.nodeSize - 2 : 0);
13435
13572
  r.push(
13436
13573
  // The widget is a small bar which spans the height of the cell.
13437
- F.widget(g, () => {
13438
- const f = document.createElement("div");
13439
- return f.className = "bn-table-drop-cursor", f.style.top = "0", f.style.bottom = "0", n > s ? f.style.right = "-2px" : f.style.left = "-3px", f.style.width = "4px", f;
13574
+ F.widget(_, () => {
13575
+ const k = document.createElement("div");
13576
+ return k.className = "bn-table-drop-cursor", k.style.top = "0", k.style.bottom = "0", n > l ? k.style.right = "-2px" : k.style.left = "-3px", k.style.width = "4px", k;
13440
13577
  })
13441
13578
  );
13442
- }), N.create(i.doc, r);
13579
+ }), H.create(i.doc, r);
13443
13580
  }
13444
13581
  }
13445
13582
  });
@@ -13568,7 +13705,7 @@ const is = j.create({
13568
13705
  ...((n = this.options.domAttributes) == null ? void 0 : n.block) || {},
13569
13706
  ...e
13570
13707
  }, i = document.createElement("div");
13571
- i.className = Z("bn-block", t.class), i.setAttribute("data-node-type", this.name);
13708
+ i.className = X("bn-block", t.class), i.setAttribute("data-node-type", this.name);
13572
13709
  for (const [r, a] of Object.entries(t))
13573
13710
  r !== "class" && i.setAttribute(r, a);
13574
13711
  return o.appendChild(i), {
@@ -13594,7 +13731,7 @@ const is = j.create({
13594
13731
  ...((i = this.options.domAttributes) == null ? void 0 : i.blockGroup) || {},
13595
13732
  ...e
13596
13733
  }, t = document.createElement("div");
13597
- t.className = Z(
13734
+ t.className = X(
13598
13735
  "bn-block-group",
13599
13736
  o.class
13600
13737
  ), t.setAttribute("data-node-type", "blockGroup");
@@ -13618,13 +13755,13 @@ const is = j.create({
13618
13755
  ), o.linkToolbar = new Pa(e.editor), o.sideMenu = new qa(
13619
13756
  e.editor,
13620
13757
  e.sideMenuDetection
13621
- ), o.suggestionMenus = new Ja(e.editor), o.filePanel = new xa(e.editor), o.placeholder = new Ha(e.editor, e.placeholders), (e.animations ?? !0) && (o.animations = new Va()), e.tableHandles && (o.tableHandles = new os(e.editor)), o.dropCursor = {
13758
+ ), o.suggestionMenus = new Ja(e.editor), o.filePanel = new xa(e.editor), o.placeholder = new Ha(e.editor, e.placeholders), (e.animations ?? !0) && (o.animations = new za()), e.tableHandles && (o.tableHandles = new os(e.editor)), o.dropCursor = {
13622
13759
  plugin: e.dropCursor({
13623
13760
  width: 5,
13624
13761
  color: "#ddeeff",
13625
13762
  editor: e.editor
13626
13763
  })
13627
- }, o.nodeSelectionKeyboard = new Da(), o.showSelection = new za(e.editor), e.comments && (o.comments = new va(
13764
+ }, o.nodeSelectionKeyboard = new Da(), o.showSelection = new Va(e.editor), e.comments && (o.comments = new ya(
13628
13765
  e.editor,
13629
13766
  e.comments.threadStore,
13630
13767
  Ao.name
@@ -13643,7 +13780,7 @@ const us = (e) => {
13643
13780
  ce.FocusEvents,
13644
13781
  ce.Tabindex,
13645
13782
  // DevTools,
13646
- vi,
13783
+ yi,
13647
13784
  // DropCursor,
13648
13785
  we.configure({
13649
13786
  // everything from bnBlock group (nodes that represent a BlockNote block should have an id)
@@ -13658,9 +13795,9 @@ const us = (e) => {
13658
13795
  Si.extend({
13659
13796
  inclusive: !1
13660
13797
  }).configure({
13661
- defaultProtocol: ja,
13798
+ defaultProtocol: Na,
13662
13799
  // only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
13663
- protocols: Dt ? [] : Na
13800
+ protocols: Dt ? [] : ja
13664
13801
  }),
13665
13802
  ...Object.values(e.styleSpecs).map((t) => t.implementation.mark.configure({
13666
13803
  editor: e.editor
@@ -13715,7 +13852,7 @@ const us = (e) => {
13715
13852
  ...e.trailingBlock === void 0 || e.trailingBlock ? [rs] : [],
13716
13853
  ...e.comments ? [Ao] : []
13717
13854
  ];
13718
- return Dt = !0, e.collaboration ? o.push(...ka(e.collaboration)) : o.push(xi), o;
13855
+ return Dt = !0, e.collaboration ? o.push(..._a(e.collaboration)) : o.push(xi), o;
13719
13856
  };
13720
13857
  function ps(e, o) {
13721
13858
  const t = [];
@@ -13767,14 +13904,14 @@ function fs(e, o) {
13767
13904
  if (i)
13768
13905
  return !1;
13769
13906
  if (n) {
13770
- const s = y(o.state);
13907
+ const s = v(o.state);
13771
13908
  if (s.isBlockContainer)
13772
13909
  return !(s.blockContent.node.type.spec.content === "tableRow+");
13773
13910
  }
13774
13911
  }
13775
13912
  return !0;
13776
13913
  }
13777
- const Ie = class Ie extends Zo {
13914
+ const Ie = class Ie extends Xo {
13778
13915
  constructor(t, i) {
13779
13916
  super({ ...t, content: void 0 });
13780
13917
  p(this, "_state");
@@ -13783,8 +13920,8 @@ const Ie = class Ie extends Zo {
13783
13920
  *
13784
13921
  * @param element DOM element to mount to, ur null / undefined to destroy
13785
13922
  */
13786
- p(this, "mount", (t, i) => {
13787
- t ? (this.options.element = t, this.createViewAlternative(i)) : this.destroy();
13923
+ p(this, "mount", (t, i, n) => {
13924
+ i ? (this.options.element = i, this.createViewAlternative(t, n)) : this.destroy();
13788
13925
  });
13789
13926
  const n = this.schema;
13790
13927
  let r;
@@ -13836,11 +13973,11 @@ const Ie = class Ie extends Zo {
13836
13973
  /**
13837
13974
  * Replace the default `createView` method with a custom one - which we call on mount
13838
13975
  */
13839
- createViewAlternative(t) {
13840
- this.contentComponent = t;
13841
- const i = {};
13842
- this.extensionManager.extensions.forEach((r) => {
13843
- r.type === "mark" && r.config.addMarkView && (i[r.name] = r.config.addMarkView);
13976
+ createViewAlternative(t, i) {
13977
+ this.contentComponent = i;
13978
+ const n = {};
13979
+ this.extensionManager.extensions.forEach((a) => {
13980
+ a.type === "mark" && a.config.addMarkView && (n[a.name] = a.config.addMarkView(t));
13844
13981
  }), this.view = new Mi(
13845
13982
  { mount: this.options.element },
13846
13983
  // use mount option so that we reuse the existing element instead of creating a new one
@@ -13849,13 +13986,14 @@ const Ie = class Ie extends Zo {
13849
13986
  // @ts-ignore
13850
13987
  dispatchTransaction: this.dispatchTransaction.bind(this),
13851
13988
  state: this.state,
13852
- markViews: i
13989
+ markViews: n,
13990
+ nodeViews: this.extensionManager.nodeViews
13853
13991
  }
13854
13992
  );
13855
- const n = this.state.reconfigure({
13993
+ const r = this.state.reconfigure({
13856
13994
  plugins: this.extensionManager.plugins
13857
13995
  });
13858
- this.view.updateState(n), this.createNodeViews(), this.commands.focus(
13996
+ this.view.updateState(r), this.commands.focus(
13859
13997
  this.options.autofocus || this.options.element.getAttribute("data-bn-autofocus") === "true",
13860
13998
  { scrollIntoView: !1 }
13861
13999
  ), this.emit("create", { editor: this }), this.isInitialized = !0;
@@ -13880,9 +14018,9 @@ const gs = {
13880
14018
  enablePasteRules: !0,
13881
14019
  enableCoreExtensions: !1
13882
14020
  };
13883
- class Ro extends W {
14021
+ class Ro extends K {
13884
14022
  constructor(t) {
13885
- var d, c, u, m, h, g, f, b, k, _, w;
14023
+ var d, c, u, m, h, f, g, b, _, k, w;
13886
14024
  super();
13887
14025
  /**
13888
14026
  * The underlying prosemirror schema
@@ -13959,7 +14097,7 @@ class Ro extends W {
13959
14097
  * @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
13960
14098
  */
13961
14099
  p(this, "mount", (t, i) => {
13962
- this._tiptapEditor.mount(t, i);
14100
+ this._tiptapEditor.mount(this, t, i);
13963
14101
  });
13964
14102
  this.options = t;
13965
14103
  const i = t;
@@ -14016,33 +14154,30 @@ class Ro extends W {
14016
14154
  tabBehavior: n.tabBehavior,
14017
14155
  sideMenuDetection: n.sideMenuDetection || "viewport",
14018
14156
  comments: n.comments
14019
- }), (((h = n._tiptapOptions) == null ? void 0 : h.extensions) || []).forEach((v) => {
14020
- this.extensions[v.name] = v;
14021
- }), Object.entries(n._extensions || {}).forEach(([v, C]) => {
14022
- typeof C == "function" && (C = C(this)), this.extensions[v] = C;
14157
+ }), (((h = n._tiptapOptions) == null ? void 0 : h.extensions) || []).forEach((y) => {
14158
+ this.extensions[y.name] = y;
14159
+ }), Object.entries(n._extensions || {}).forEach(([y, C]) => {
14160
+ typeof C == "function" && (C = C(this)), this.extensions[y] = C;
14023
14161
  }), 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, this.comments = this.extensions.comments, this.showSelectionPlugin = this.extensions.showSelection, n.uploadFile) {
14024
- const v = n.uploadFile;
14025
- this.uploadFile = async (C, O) => {
14162
+ const y = n.uploadFile;
14163
+ this.uploadFile = async (C, z) => {
14026
14164
  this.onUploadStartCallbacks.forEach(
14027
- (S) => S.apply(this, [O])
14165
+ (S) => S.apply(this, [z])
14028
14166
  );
14029
14167
  try {
14030
- return await v(C, O);
14168
+ return await y(C, z);
14031
14169
  } finally {
14032
14170
  this.onUploadEndCallbacks.forEach(
14033
- (S) => S.apply(this, [O])
14171
+ (S) => S.apply(this, [z])
14034
14172
  );
14035
14173
  }
14036
14174
  };
14037
14175
  }
14038
14176
  this.resolveFileUrl = n.resolveFileUrl, this.headless = n._headless;
14039
14177
  const r = "collaboration" in this.extensions || "liveblocksExtension" in this.extensions;
14040
- if (r && n.initialContent && console.warn(
14178
+ r && n.initialContent && console.warn(
14041
14179
  "When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
14042
- ), n.comments && !r)
14043
- throw new Error(
14044
- "Comments are only supported when collaboration is enabled, please set the collaboration option"
14045
- );
14180
+ );
14046
14181
  const a = n.initialContent || (r ? [
14047
14182
  {
14048
14183
  type: "paragraph",
@@ -14059,7 +14194,7 @@ class Ro extends W {
14059
14194
  "initialContent must be a non-empty array of blocks, received: " + a
14060
14195
  );
14061
14196
  const s = [
14062
- ...Object.entries(this.extensions).map(([v, C]) => {
14197
+ ...Object.entries(this.extensions).map(([y, C]) => {
14063
14198
  if (C instanceof j || C instanceof de || C instanceof ge)
14064
14199
  return C;
14065
14200
  if (!C.plugin)
@@ -14067,7 +14202,7 @@ class Ro extends W {
14067
14202
  "Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property"
14068
14203
  );
14069
14204
  return j.create({
14070
- name: v,
14205
+ name: y,
14071
14206
  addProseMirrorPlugins: () => [C.plugin]
14072
14207
  });
14073
14208
  })
@@ -14077,18 +14212,18 @@ class Ro extends W {
14077
14212
  content: a,
14078
14213
  extensions: s,
14079
14214
  editorProps: {
14080
- ...(g = n._tiptapOptions) == null ? void 0 : g.editorProps,
14215
+ ...(f = n._tiptapOptions) == null ? void 0 : f.editorProps,
14081
14216
  attributes: {
14082
14217
  // As of TipTap v2.5.0 the tabIndex is removed when the editor is not
14083
14218
  // editable, so you can't focus it. We want to revert this as we have
14084
14219
  // UI behaviour that relies on it.
14085
14220
  tabIndex: "0",
14086
- ...(b = (f = n._tiptapOptions) == null ? void 0 : f.editorProps) == null ? void 0 : b.attributes,
14087
- ...(k = n.domAttributes) == null ? void 0 : k.editor,
14088
- class: Z(
14221
+ ...(b = (g = n._tiptapOptions) == null ? void 0 : g.editorProps) == null ? void 0 : b.attributes,
14222
+ ...(_ = n.domAttributes) == null ? void 0 : _.editor,
14223
+ class: X(
14089
14224
  "bn-editor",
14090
14225
  n.defaultStyles ? "bn-default-styles" : "",
14091
- ((w = (_ = n.domAttributes) == null ? void 0 : _.editor) == null ? void 0 : w.class) || ""
14226
+ ((w = (k = n.domAttributes) == null ? void 0 : k.editor) == null ? void 0 : w.class) || ""
14092
14227
  )
14093
14228
  },
14094
14229
  transformPasted: hs
@@ -14168,7 +14303,7 @@ class Ro extends W {
14168
14303
  * matching block was found.
14169
14304
  */
14170
14305
  getBlock(t) {
14171
- return Wr(this, t);
14306
+ return Kr(this, t);
14172
14307
  }
14173
14308
  /**
14174
14309
  * Gets a snapshot of the previous sibling of an existing block from the
@@ -14180,7 +14315,7 @@ class Ro extends W {
14180
14315
  * in the document.
14181
14316
  */
14182
14317
  getPrevBlock(t) {
14183
- return Kr(this, t);
14318
+ return Wr(this, t);
14184
14319
  }
14185
14320
  /**
14186
14321
  * Gets a snapshot of the next sibling of an existing block from the editor.
@@ -14201,7 +14336,7 @@ class Ro extends W {
14201
14336
  * if no matching block was found, or the block isn't nested.
14202
14337
  */
14203
14338
  getParentBlock(t) {
14204
- return Xr(this, t);
14339
+ return Zr(this, t);
14205
14340
  }
14206
14341
  /**
14207
14342
  * Traverses all blocks in the editor depth-first, and executes a callback for each.
@@ -14299,7 +14434,7 @@ class Ro extends W {
14299
14434
  * `referenceBlock`.
14300
14435
  */
14301
14436
  insertBlocks(t, i, n = "before") {
14302
- return jr(this, t, i, n);
14437
+ return Nr(this, t, i, n);
14303
14438
  }
14304
14439
  /**
14305
14440
  * Updates an existing block in the editor. Since updatedBlock is a PartialBlock object, some fields might not be
@@ -14334,12 +14469,12 @@ class Ro extends W {
14334
14469
  * @param content can be a string, or array of partial inline content elements
14335
14470
  */
14336
14471
  insertInlineContent(t) {
14337
- const i = D(
14472
+ const i = R(
14338
14473
  t,
14339
14474
  this.pmSchema,
14340
14475
  this.schema.styleSchema
14341
14476
  );
14342
- Zr(
14477
+ Xr(
14343
14478
  {
14344
14479
  from: this._tiptapEditor.state.selection.from,
14345
14480
  to: this._tiptapEditor.state.selection.to
@@ -14379,7 +14514,7 @@ class Ro extends W {
14379
14514
  else if (r.propSchema === "string")
14380
14515
  this._tiptapEditor.commands.setMark(i, { stringValue: n });
14381
14516
  else
14382
- throw new H(r.propSchema);
14517
+ throw new O(r.propSchema);
14383
14518
  }
14384
14519
  }
14385
14520
  /**
@@ -14404,7 +14539,7 @@ class Ro extends W {
14404
14539
  else if (r.propSchema === "string")
14405
14540
  this._tiptapEditor.commands.toggleMark(i, { stringValue: n });
14406
14541
  else
14407
- throw new H(r.propSchema);
14542
+ throw new O(r.propSchema);
14408
14543
  }
14409
14544
  }
14410
14545
  /**
@@ -14441,7 +14576,7 @@ class Ro extends W {
14441
14576
  * Checks if the block containing the text cursor can be nested.
14442
14577
  */
14443
14578
  canNestBlock() {
14444
- return zr(this);
14579
+ return Vr(this);
14445
14580
  }
14446
14581
  /**
14447
14582
  * Nests the block containing the text cursor into the block above it.
@@ -14459,7 +14594,7 @@ class Ro extends W {
14459
14594
  * Lifts the block containing the text cursor out of its parent.
14460
14595
  */
14461
14596
  unnestBlock() {
14462
- Vr(this);
14597
+ zr(this);
14463
14598
  }
14464
14599
  /**
14465
14600
  * Moves the selected blocks up. If the previous block has children, moves
@@ -14485,7 +14620,7 @@ class Ro extends W {
14485
14620
  * @returns The blocks, serialized as an HTML string.
14486
14621
  */
14487
14622
  async blocksToHTMLLossy(t = this.document) {
14488
- return Ne(this.pmSchema, this).exportBlocks(t, {});
14623
+ return je(this.pmSchema, this).exportBlocks(t, {});
14489
14624
  }
14490
14625
  /**
14491
14626
  * Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
@@ -14497,7 +14632,7 @@ class Ro extends W {
14497
14632
  * @returns The blocks, serialized as an HTML string.
14498
14633
  */
14499
14634
  async blocksToFullHTML(t) {
14500
- return yn(this.pmSchema, this).serializeBlocks(t, {});
14635
+ return vn(this.pmSchema, this).serializeBlocks(t, {});
14501
14636
  }
14502
14637
  /**
14503
14638
  * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
@@ -14760,7 +14895,7 @@ async function bs() {
14760
14895
  return await t.init({ data: i }), { emojiMart: t, emojiData: i };
14761
14896
  })(), Be);
14762
14897
  }
14763
- async function kl(e, o) {
14898
+ async function _l(e, o) {
14764
14899
  if (!Lr("text", e))
14765
14900
  return [];
14766
14901
  const { emojiData: t, emojiMart: i } = await bs();
@@ -14769,7 +14904,7 @@ async function kl(e, o) {
14769
14904
  onItemClick: () => e.insertInlineContent(r.skins[0].native + " ")
14770
14905
  }));
14771
14906
  }
14772
- function _l(e, ...o) {
14907
+ function kl(e, ...o) {
14773
14908
  const t = [...e];
14774
14909
  for (const i of o)
14775
14910
  for (const n of i) {
@@ -14780,7 +14915,7 @@ function _l(e, ...o) {
14780
14915
  }
14781
14916
  return t;
14782
14917
  }
14783
- function Ve(e = "") {
14918
+ function ze(e = "") {
14784
14919
  return typeof e == "string" ? [
14785
14920
  {
14786
14921
  type: "text",
@@ -14791,10 +14926,10 @@ function Ve(e = "") {
14791
14926
  }
14792
14927
  function se(e) {
14793
14928
  var o, t, i, n, r;
14794
- return typeof e == "string" ? Ve(e) : Array.isArray(e) ? e.flatMap((a) => typeof a == "string" ? Ve(a) : ot(a) ? {
14929
+ return typeof e == "string" ? ze(e) : Array.isArray(e) ? e.flatMap((a) => typeof a == "string" ? ze(a) : ot(a) ? {
14795
14930
  ...a,
14796
- content: Ve(a.content)
14797
- } : X(a) ? a : {
14931
+ content: ze(a.content)
14932
+ } : Z(a) ? a : {
14798
14933
  props: {},
14799
14934
  ...a,
14800
14935
  content: se(a.content)
@@ -14868,12 +15003,12 @@ function Do(e, o) {
14868
15003
  children: i.children.map((r) => Do(e, r))
14869
15004
  };
14870
15005
  }
14871
- function ks(e) {
14872
- e.id || (e.id = we.options.generateID()), e.children && _s(e.children);
14873
- }
14874
15006
  function _s(e) {
15007
+ e.id || (e.id = we.options.generateID()), e.children && ks(e.children);
15008
+ }
15009
+ function ks(e) {
14875
15010
  for (const o of e)
14876
- ks(o);
15011
+ _s(o);
14877
15012
  }
14878
15013
  export {
14879
15014
  In as AudioBlock,
@@ -14882,14 +15017,14 @@ export {
14882
15017
  fl as COLORS_DARK_MODE_DEFAULT,
14883
15018
  hl as COLORS_DEFAULT,
14884
15019
  An as CodeBlock,
14885
- ja as DEFAULT_LINK_PROTOCOL,
15020
+ Na as DEFAULT_LINK_PROTOCOL,
14886
15021
  il as EMPTY_CELL_HEIGHT,
14887
15022
  fo as EMPTY_CELL_WIDTH,
14888
15023
  gl as Exporter,
14889
15024
  Sn as FILE_AUDIO_ICON_SVG,
14890
15025
  Cn as FILE_ICON_SVG,
14891
15026
  Hn as FILE_IMAGE_ICON_SVG,
14892
- yr as FILE_VIDEO_ICON_SVG,
15027
+ vr as FILE_VIDEO_ICON_SVG,
14893
15028
  Un as FileBlock,
14894
15029
  xa as FilePanelProsemirrorPlugin,
14895
15030
  Ca as FilePanelView,
@@ -14898,23 +15033,23 @@ export {
14898
15033
  To as HTMLToBlocks,
14899
15034
  Gn as ImageBlock,
14900
15035
  Pa as LinkToolbarProsemirrorPlugin,
14901
- Zn as PageBreak,
15036
+ Xn as PageBreak,
14902
15037
  qa as SideMenuProsemirrorPlugin,
14903
- Wa as SideMenuView,
15038
+ Ka as SideMenuView,
14904
15039
  Ja as SuggestionMenuProseMirrorPlugin,
14905
15040
  os as TableHandlesProsemirrorPlugin,
14906
15041
  ts as TableHandlesView,
14907
15042
  we as UniqueID,
14908
- H as UnreachableCaseError,
14909
- Na as VALID_LINK_PROTOCOLS,
15043
+ O as UnreachableCaseError,
15044
+ ja as VALID_LINK_PROTOCOLS,
14910
15045
  Br as VideoBlock,
14911
- ks as addIdsToBlock,
14912
- _s as addIdsToBlocks,
14913
- kt as addInlineContentAttributes,
15046
+ _s as addIdsToBlock,
15047
+ ks as addIdsToBlocks,
15048
+ _t as addInlineContentAttributes,
14914
15049
  tn as addInlineContentKeyboardShortcuts,
14915
15050
  sn as addStyleAttributes,
14916
15051
  Qi as applyNonSelectableBlockFix,
14917
- Zs as assertEmpty,
15052
+ Xs as assertEmpty,
14918
15053
  Bn as audioBlockConfig,
14919
15054
  Mn as audioParse,
14920
15055
  En as audioPropSchema,
@@ -14931,25 +15066,25 @@ export {
14931
15066
  Ar as checkBlockTypeHasDefaultProp,
14932
15067
  P as checkDefaultBlockTypeInSchema,
14933
15068
  Lr as checkDefaultInlineContentTypeInSchema,
14934
- Nr as checkPageBreakBlocksInSchema,
15069
+ jr as checkPageBreakBlocksInSchema,
14935
15070
  dt as cleanHTMLToMarkdown,
14936
- _l as combineByGroup,
15071
+ kl as combineByGroup,
14937
15072
  Ae as contentNodeToInlineContent,
14938
15073
  qt as contentNodeToTableContent,
14939
- vn as createAddFileButton,
14940
- ve as createBlockSpec,
15074
+ yn as createAddFileButton,
15075
+ ye as createBlockSpec,
14941
15076
  J as createBlockSpecFromStronglyTypedTiptapNode,
14942
15077
  $ as createDefaultBlockDOMOutputSpec,
14943
- Ne as createExternalHTMLExporter,
15078
+ je as createExternalHTMLExporter,
14944
15079
  at as createFigureWithCaption,
14945
15080
  rt as createFileBlockWrapper,
14946
15081
  xn as createFileNameWithIcon,
14947
15082
  Qs as createInlineContentSpec,
14948
15083
  nn as createInlineContentSpecFromTipTapNode,
14949
- Wt as createInternalBlockSpec,
14950
- yn as createInternalHTMLSerializer,
15084
+ Kt as createInternalBlockSpec,
15085
+ vn as createInternalHTMLSerializer,
14951
15086
  on as createInternalInlineContentSpec,
14952
- Zt as createInternalStyleSpec,
15087
+ Xt as createInternalStyleSpec,
14953
15088
  Re as createLinkWithCaption,
14954
15089
  co as createResizableFileBlockWrapper,
14955
15090
  G as createStronglyTypedTiptapNode,
@@ -14962,77 +15097,77 @@ export {
14962
15097
  bt as defaultBlockToHTML,
14963
15098
  Je as defaultCodeBlockPropSchema,
14964
15099
  Mr as defaultInlineContentSchema,
14965
- ko as defaultInlineContentSpecs,
15100
+ _o as defaultInlineContentSpecs,
14966
15101
  B as defaultProps,
14967
15102
  nl as defaultStyleSchema,
14968
15103
  bo as defaultStyleSpecs,
14969
15104
  ne as esmDependencies,
14970
- Nn as fileBlockConfig,
15105
+ jn as fileBlockConfig,
14971
15106
  Rn as fileParse,
14972
15107
  Pn as filePropSchema,
14973
- jn as fileRender,
15108
+ Nn as fileRender,
14974
15109
  Dn as fileToExternalHTML,
14975
15110
  Ys as filenameFromURL,
14976
15111
  cl as filterSuggestionItems,
14977
- K as formatKeyboardShortcut,
15112
+ W as formatKeyboardShortcut,
14978
15113
  Ea as formattingToolbarPluginKey,
14979
15114
  Yi as getBlockFromPos,
14980
15115
  te as getBlockInfo,
14981
- _e as getBlockInfoFromResolvedPos,
14982
- y as getBlockInfoFromSelection,
15116
+ ke as getBlockInfoFromResolvedPos,
15117
+ v as getBlockInfoFromSelection,
14983
15118
  tt as getBlockInfoWithManualOffset,
14984
15119
  cs as getBlockNoteExtensions,
14985
- Kt as getBlockSchemaFromSpecs,
15120
+ Wt as getBlockSchemaFromSpecs,
14986
15121
  he as getColspan,
14987
- kl as getDefaultEmojiPickerItems,
15122
+ _l as getDefaultEmojiPickerItems,
14988
15123
  dl as getDefaultSlashMenuItems,
14989
15124
  rn as getInlineContentParseRules,
14990
- Xt as getInlineContentSchemaFromSpecs,
15125
+ Zt as getInlineContentSchemaFromSpecs,
14991
15126
  q as getNearestBlockPos,
14992
- R as getNodeById,
15127
+ N as getNodeById,
14993
15128
  pl as getPageBreakSlashMenuItems,
14994
15129
  en as getParseRules,
14995
15130
  Ge as getRowspan,
14996
15131
  ln as getStyleParseRules,
14997
15132
  Jt as getStyleSchemaFromSpecs,
14998
- Vn as imageBlockConfig,
15133
+ zn as imageBlockConfig,
14999
15134
  Fn as imageParse,
15000
15135
  On as imagePropSchema,
15001
- zn as imageRender,
15136
+ Vn as imageRender,
15002
15137
  $n as imageToExternalHTML,
15003
15138
  Gt as inheritedProps,
15004
15139
  lt as initializeESMDependencies,
15005
- D as inlineContentToNodes,
15140
+ R as inlineContentToNodes,
15006
15141
  L as insertOrUpdateBlock,
15007
15142
  Ji as isAppleOS,
15008
15143
  gt as isLinkInlineContent,
15009
15144
  ot as isPartialLinkInlineContent,
15010
15145
  me as isPartialTableCell,
15011
15146
  Js as isSafari,
15012
- X as isStyledTextInlineContent,
15147
+ Z as isStyledTextInlineContent,
15013
15148
  it as isTableCell,
15014
15149
  Et as isTableCellSelection,
15015
15150
  Aa as linkToolbarPluginKey,
15016
- Xs as locales,
15151
+ Zs as locales,
15017
15152
  $e as mapTableCell,
15018
15153
  bl as mappingFactory,
15019
15154
  da as markdownToBlocks,
15020
- Z as mergeCSSClasses,
15155
+ X as mergeCSSClasses,
15021
15156
  x as nodeToBlock,
15022
- We as nodeToCustomInlineContent,
15023
- Wn as pageBreakConfig,
15157
+ Ke as nodeToCustomInlineContent,
15158
+ Kn as pageBreakConfig,
15024
15159
  qn as pageBreakParse,
15025
- Kn as pageBreakRender,
15026
- _o as pageBreakSchema,
15027
- Xn as pageBreakToExternalHTML,
15160
+ Wn as pageBreakRender,
15161
+ ko as pageBreakSchema,
15162
+ Zn as pageBreakToExternalHTML,
15028
15163
  Ct as parseEmbedElement,
15029
- je as parseFigureElement,
15164
+ Ne as parseFigureElement,
15030
15165
  Do as partialBlockToBlockForTesting,
15031
15166
  wl as partialBlocksToBlocksForTesting,
15032
- ye as propsToAttributes,
15167
+ ve as propsToAttributes,
15033
15168
  Ue as shikiHighlighterPromiseSymbol,
15034
- vt as shikiParserSymbol,
15035
- Ka as sideMenuPluginKey,
15169
+ yt as shikiParserSymbol,
15170
+ Wa as sideMenuPluginKey,
15036
15171
  an as stylePropsToAttributes,
15037
15172
  Pe as tableContentToNodes,
15038
15173
  pe as tableHandlesPluginKey,
@@ -15041,7 +15176,7 @@ export {
15041
15176
  ol as uploadToTmpFilesDotOrg_DEV_ONLY,
15042
15177
  Cr as videoBlockConfig,
15043
15178
  Sr as videoParse,
15044
- vr as videoPropSchema,
15179
+ yr as videoPropSchema,
15045
15180
  xr as videoRender,
15046
15181
  Er as videoToExternalHTML,
15047
15182
  ul as withPageBreak,