@blocknote/core 0.30.1 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/blocknote.cjs +9 -9
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +2793 -2213
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/{en-D4taoCs4.cjs → en-BXVKCwYt.cjs} +2 -2
  6. package/dist/en-BXVKCwYt.cjs.map +1 -0
  7. package/dist/{en-B7ycW7c8.js → en-qGo6sk9V.js} +2 -3
  8. package/dist/en-qGo6sk9V.js.map +1 -0
  9. package/dist/locales.cjs +1 -1
  10. package/dist/locales.cjs.map +1 -1
  11. package/dist/locales.js +20 -39
  12. package/dist/locales.js.map +1 -1
  13. package/dist/style.css +1 -1
  14. package/dist/tsconfig.tsbuildinfo +1 -1
  15. package/dist/webpack-stats.json +1 -1
  16. package/package.json +5 -6
  17. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -3
  18. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +1 -1
  19. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2816 -0
  20. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +158 -0
  21. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +87 -17
  22. package/src/api/blockManipulation/selections/selection.ts +48 -1
  23. package/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.ts → textCursorPosition.ts} +7 -7
  24. package/src/api/getBlockInfoFromPos.ts +1 -1
  25. package/src/api/nodeConversions/blockToNode.ts +5 -2
  26. package/src/api/nodeConversions/nodeToBlock.ts +203 -8
  27. package/src/api/pmUtil.ts +3 -3
  28. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +6 -6
  29. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +1 -1
  30. package/src/blocks/TableBlockContent/TableBlockContent.ts +32 -2
  31. package/src/editor/Block.css +27 -1
  32. package/src/editor/BlockNoteEditor.test.ts +7 -0
  33. package/src/editor/BlockNoteEditor.ts +124 -39
  34. package/src/editor/BlockNoteExtension.ts +26 -0
  35. package/src/editor/BlockNoteExtensions.ts +28 -12
  36. package/src/editor/BlockNoteTipTapEditor.ts +23 -2
  37. package/src/extensions/Collaboration/CursorPlugin.ts +13 -7
  38. package/src/extensions/Collaboration/ForkYDocPlugin.test.ts +166 -0
  39. package/src/extensions/Collaboration/ForkYDocPlugin.ts +174 -0
  40. package/src/extensions/Collaboration/SyncPlugin.ts +7 -4
  41. package/src/extensions/Collaboration/UndoPlugin.ts +7 -4
  42. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +30 -0
  43. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +30 -0
  44. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -0
  45. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -0
  46. package/src/extensions/Comments/CommentsPlugin.ts +79 -70
  47. package/src/extensions/FilePanel/FilePanelPlugin.ts +54 -49
  48. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +60 -26
  49. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +26 -21
  50. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +49 -42
  51. package/src/extensions/Placeholder/PlaceholderPlugin.ts +115 -108
  52. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +183 -170
  53. package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +26 -19
  54. package/src/extensions/SideMenu/SideMenuPlugin.ts +23 -18
  55. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +172 -168
  56. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -4
  57. package/src/extensions/Suggestions/SuggestionMarks.ts +175 -0
  58. package/src/extensions/TableHandles/TableHandlesPlugin.ts +157 -150
  59. package/src/i18n/locales/ar.ts +0 -1
  60. package/src/i18n/locales/de.ts +0 -1
  61. package/src/i18n/locales/en.ts +0 -1
  62. package/src/i18n/locales/es.ts +0 -1
  63. package/src/i18n/locales/fr.ts +0 -1
  64. package/src/i18n/locales/hr.ts +0 -1
  65. package/src/i18n/locales/is.ts +0 -1
  66. package/src/i18n/locales/it.ts +0 -1
  67. package/src/i18n/locales/ja.ts +0 -1
  68. package/src/i18n/locales/ko.ts +0 -1
  69. package/src/i18n/locales/nl.ts +0 -1
  70. package/src/i18n/locales/no.ts +0 -1
  71. package/src/i18n/locales/pl.ts +0 -1
  72. package/src/i18n/locales/pt.ts +0 -1
  73. package/src/i18n/locales/ru.ts +0 -1
  74. package/src/i18n/locales/sk.ts +0 -1
  75. package/src/i18n/locales/uk.ts +0 -1
  76. package/src/i18n/locales/vi.ts +0 -1
  77. package/src/i18n/locales/zh-tw.ts +0 -1
  78. package/src/i18n/locales/zh.ts +0 -1
  79. package/src/index.ts +18 -8
  80. package/src/pm-nodes/BlockContainer.ts +1 -1
  81. package/src/pm-nodes/BlockGroup.ts +1 -1
  82. package/src/pm-nodes/Doc.ts +1 -0
  83. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +1 -1
  84. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +3 -1
  85. package/types/src/api/blockManipulation/selections/selection.d.ts +10 -0
  86. package/types/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.d.ts → textCursorPosition.d.ts} +2 -2
  87. package/types/src/api/nodeConversions/nodeToBlock.d.ts +39 -2
  88. package/types/src/api/pmUtil.d.ts +3 -3
  89. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +9 -1
  90. package/types/src/editor/BlockNoteEditor.d.ts +62 -10
  91. package/types/src/editor/BlockNoteExtension.d.ts +9 -0
  92. package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
  93. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
  94. package/types/src/extensions/Collaboration/CursorPlugin.d.ts +3 -3
  95. package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +41 -0
  96. package/types/src/extensions/Collaboration/SyncPlugin.d.ts +3 -3
  97. package/types/src/extensions/Collaboration/UndoPlugin.d.ts +3 -3
  98. package/types/src/extensions/Comments/CommentsPlugin.d.ts +3 -4
  99. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
  100. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +6 -5
  101. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +4 -4
  102. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +3 -3
  103. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +3 -3
  104. package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +3 -3
  105. package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +3 -3
  106. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +4 -4
  107. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +3 -4
  108. package/types/src/extensions/Suggestions/SuggestionMarks.d.ts +4 -0
  109. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +6 -6
  110. package/types/src/i18n/locales/en.d.ts +0 -1
  111. package/types/src/i18n/locales/sk.d.ts +0 -1
  112. package/types/src/index.d.ts +15 -8
  113. package/dist/en-B7ycW7c8.js.map +0 -1
  114. package/dist/en-D4taoCs4.cjs.map +0 -1
  115. package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +0 -844
  116. package/src/api/blockManipulation/selections/selection.test.ts +0 -72
  117. package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +0 -316
  118. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +0 -74
  119. package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.d.ts +0 -1
  120. /package/types/src/{api/blockManipulation/selections/selection.test.d.ts → extensions/Collaboration/ForkYDocPlugin.test.d.ts} +0 -0
@@ -32,13 +32,13 @@ import {
32
32
  } from "../../blocks/defaultBlockTypeGuards.js";
33
33
  import { DefaultBlockSchema } from "../../blocks/defaultBlocks.js";
34
34
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
35
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
35
36
  import {
36
37
  BlockFromConfigNoChildren,
37
38
  BlockSchemaWithBlock,
38
39
  InlineContentSchema,
39
40
  StyleSchema,
40
41
  } from "../../schema/index.js";
41
- import { EventEmitter } from "../../util/EventEmitter.js";
42
42
  import { getDraggableBlockFromElement } from "../getDraggableBlockFromElement.js";
43
43
 
44
44
  let dragImageElement: HTMLElement | undefined;
@@ -617,9 +617,12 @@ export const tableHandlesPluginKey = new PluginKey("TableHandlesPlugin");
617
617
  export class TableHandlesProsemirrorPlugin<
618
618
  I extends InlineContentSchema,
619
619
  S extends StyleSchema,
620
- > extends EventEmitter<any> {
620
+ > extends BlockNoteExtension {
621
+ public static key() {
622
+ return "tableHandles";
623
+ }
624
+
621
625
  private view: TableHandlesView<I, S> | undefined;
622
- public readonly plugin: Plugin;
623
626
 
624
627
  constructor(
625
628
  private readonly editor: BlockNoteEditor<
@@ -629,159 +632,163 @@ export class TableHandlesProsemirrorPlugin<
629
632
  >,
630
633
  ) {
631
634
  super();
632
- this.plugin = new Plugin({
633
- key: tableHandlesPluginKey,
634
- view: (editorView) => {
635
- this.view = new TableHandlesView(editor, editorView, (state) => {
636
- this.emit("update", state);
637
- });
638
- return this.view;
639
- },
640
- // We use decorations to render the drop cursor when dragging a table row
641
- // or column. The decorations are updated in the `dragOverHandler` method.
642
- props: {
643
- decorations: (state) => {
644
- if (
645
- this.view === undefined ||
646
- this.view.state === undefined ||
647
- this.view.state.draggingState === undefined ||
648
- this.view.tablePos === undefined
649
- ) {
650
- return;
651
- }
652
-
653
- const newIndex =
654
- this.view.state.draggingState.draggedCellOrientation === "row"
655
- ? this.view.state.rowIndex
656
- : this.view.state.colIndex;
657
-
658
- if (newIndex === undefined) {
659
- return;
660
- }
661
-
662
- const decorations: Decoration[] = [];
663
- const { block, draggingState } = this.view.state;
664
- const { originalIndex, draggedCellOrientation } = draggingState;
665
-
666
- // Return empty decorations if:
667
- // - Dragging to same position
668
- // - No block exists
669
- // - Row drag not allowed
670
- // - Column drag not allowed
671
- if (
672
- newIndex === originalIndex ||
673
- !block ||
674
- (draggedCellOrientation === "row" &&
675
- !canRowBeDraggedInto(block, originalIndex, newIndex)) ||
676
- (draggedCellOrientation === "col" &&
677
- !canColumnBeDraggedInto(block, originalIndex, newIndex))
678
- ) {
679
- return DecorationSet.create(state.doc, decorations);
680
- }
681
-
682
- // Gets the table to show the drop cursor in.
683
- const tableResolvedPos = state.doc.resolve(this.view.tablePos + 1);
684
-
685
- if (this.view.state.draggingState.draggedCellOrientation === "row") {
686
- const cellsInRow = getCellsAtRowHandle(
687
- this.view.state.block,
688
- newIndex,
689
- );
690
-
691
- cellsInRow.forEach(({ row, col }) => {
692
- // Gets each row in the table.
693
- const rowResolvedPos = state.doc.resolve(
694
- tableResolvedPos.posAtIndex(row) + 1,
635
+ this.addProsemirrorPlugin(
636
+ new Plugin({
637
+ key: tableHandlesPluginKey,
638
+ view: (editorView) => {
639
+ this.view = new TableHandlesView(editor, editorView, (state) => {
640
+ this.emit("update", state);
641
+ });
642
+ return this.view;
643
+ },
644
+ // We use decorations to render the drop cursor when dragging a table row
645
+ // or column. The decorations are updated in the `dragOverHandler` method.
646
+ props: {
647
+ decorations: (state) => {
648
+ if (
649
+ this.view === undefined ||
650
+ this.view.state === undefined ||
651
+ this.view.state.draggingState === undefined ||
652
+ this.view.tablePos === undefined
653
+ ) {
654
+ return;
655
+ }
656
+
657
+ const newIndex =
658
+ this.view.state.draggingState.draggedCellOrientation === "row"
659
+ ? this.view.state.rowIndex
660
+ : this.view.state.colIndex;
661
+
662
+ if (newIndex === undefined) {
663
+ return;
664
+ }
665
+
666
+ const decorations: Decoration[] = [];
667
+ const { block, draggingState } = this.view.state;
668
+ const { originalIndex, draggedCellOrientation } = draggingState;
669
+
670
+ // Return empty decorations if:
671
+ // - Dragging to same position
672
+ // - No block exists
673
+ // - Row drag not allowed
674
+ // - Column drag not allowed
675
+ if (
676
+ newIndex === originalIndex ||
677
+ !block ||
678
+ (draggedCellOrientation === "row" &&
679
+ !canRowBeDraggedInto(block, originalIndex, newIndex)) ||
680
+ (draggedCellOrientation === "col" &&
681
+ !canColumnBeDraggedInto(block, originalIndex, newIndex))
682
+ ) {
683
+ return DecorationSet.create(state.doc, decorations);
684
+ }
685
+
686
+ // Gets the table to show the drop cursor in.
687
+ const tableResolvedPos = state.doc.resolve(this.view.tablePos + 1);
688
+
689
+ if (
690
+ this.view.state.draggingState.draggedCellOrientation === "row"
691
+ ) {
692
+ const cellsInRow = getCellsAtRowHandle(
693
+ this.view.state.block,
694
+ newIndex,
695
695
  );
696
696
 
697
- // Gets the cell within the row.
698
- const cellResolvedPos = state.doc.resolve(
699
- rowResolvedPos.posAtIndex(col) + 1,
700
- );
701
- const cellNode = cellResolvedPos.node();
702
- // Creates a decoration at the start or end of each cell,
703
- // depending on whether the new index is before or after the
704
- // original index.
705
- const decorationPos =
706
- cellResolvedPos.pos +
707
- (newIndex > originalIndex ? cellNode.nodeSize - 2 : 0);
708
- decorations.push(
709
- // The widget is a small bar which spans the width of the cell.
710
- Decoration.widget(decorationPos, () => {
711
- const widget = document.createElement("div");
712
- widget.className = "bn-table-drop-cursor";
713
- widget.style.left = "0";
714
- widget.style.right = "0";
715
- // This is only necessary because the drop indicator's height
716
- // is an even number of pixels, whereas the border between
717
- // table cells is an odd number of pixels. So this makes the
718
- // positioning slightly more consistent regardless of where
719
- // the row is being dropped.
720
- if (newIndex > originalIndex) {
721
- widget.style.bottom = "-2px";
722
- } else {
723
- widget.style.top = "-3px";
724
- }
725
- widget.style.height = "4px";
726
-
727
- return widget;
728
- }),
729
- );
730
- });
731
- } else {
732
- const cellsInColumn = getCellsAtColumnHandle(
733
- this.view.state.block,
734
- newIndex,
735
- );
736
-
737
- cellsInColumn.forEach(({ row, col }) => {
738
- // Gets each row in the table.
739
- const rowResolvedPos = state.doc.resolve(
740
- tableResolvedPos.posAtIndex(row) + 1,
697
+ cellsInRow.forEach(({ row, col }) => {
698
+ // Gets each row in the table.
699
+ const rowResolvedPos = state.doc.resolve(
700
+ tableResolvedPos.posAtIndex(row) + 1,
701
+ );
702
+
703
+ // Gets the cell within the row.
704
+ const cellResolvedPos = state.doc.resolve(
705
+ rowResolvedPos.posAtIndex(col) + 1,
706
+ );
707
+ const cellNode = cellResolvedPos.node();
708
+ // Creates a decoration at the start or end of each cell,
709
+ // depending on whether the new index is before or after the
710
+ // original index.
711
+ const decorationPos =
712
+ cellResolvedPos.pos +
713
+ (newIndex > originalIndex ? cellNode.nodeSize - 2 : 0);
714
+ decorations.push(
715
+ // The widget is a small bar which spans the width of the cell.
716
+ Decoration.widget(decorationPos, () => {
717
+ const widget = document.createElement("div");
718
+ widget.className = "bn-table-drop-cursor";
719
+ widget.style.left = "0";
720
+ widget.style.right = "0";
721
+ // This is only necessary because the drop indicator's height
722
+ // is an even number of pixels, whereas the border between
723
+ // table cells is an odd number of pixels. So this makes the
724
+ // positioning slightly more consistent regardless of where
725
+ // the row is being dropped.
726
+ if (newIndex > originalIndex) {
727
+ widget.style.bottom = "-2px";
728
+ } else {
729
+ widget.style.top = "-3px";
730
+ }
731
+ widget.style.height = "4px";
732
+
733
+ return widget;
734
+ }),
735
+ );
736
+ });
737
+ } else {
738
+ const cellsInColumn = getCellsAtColumnHandle(
739
+ this.view.state.block,
740
+ newIndex,
741
741
  );
742
742
 
743
- // Gets the cell within the row.
744
- const cellResolvedPos = state.doc.resolve(
745
- rowResolvedPos.posAtIndex(col) + 1,
746
- );
747
- const cellNode = cellResolvedPos.node();
748
-
749
- // Creates a decoration at the start or end of each cell,
750
- // depending on whether the new index is before or after the
751
- // original index.
752
- const decorationPos =
753
- cellResolvedPos.pos +
754
- (newIndex > originalIndex ? cellNode.nodeSize - 2 : 0);
755
-
756
- decorations.push(
757
- // The widget is a small bar which spans the height of the cell.
758
- Decoration.widget(decorationPos, () => {
759
- const widget = document.createElement("div");
760
- widget.className = "bn-table-drop-cursor";
761
- widget.style.top = "0";
762
- widget.style.bottom = "0";
763
- // This is only necessary because the drop indicator's width
764
- // is an even number of pixels, whereas the border between
765
- // table cells is an odd number of pixels. So this makes the
766
- // positioning slightly more consistent regardless of where
767
- // the column is being dropped.
768
- if (newIndex > originalIndex) {
769
- widget.style.right = "-2px";
770
- } else {
771
- widget.style.left = "-3px";
772
- }
773
- widget.style.width = "4px";
774
-
775
- return widget;
776
- }),
777
- );
778
- });
779
- }
743
+ cellsInColumn.forEach(({ row, col }) => {
744
+ // Gets each row in the table.
745
+ const rowResolvedPos = state.doc.resolve(
746
+ tableResolvedPos.posAtIndex(row) + 1,
747
+ );
748
+
749
+ // Gets the cell within the row.
750
+ const cellResolvedPos = state.doc.resolve(
751
+ rowResolvedPos.posAtIndex(col) + 1,
752
+ );
753
+ const cellNode = cellResolvedPos.node();
754
+
755
+ // Creates a decoration at the start or end of each cell,
756
+ // depending on whether the new index is before or after the
757
+ // original index.
758
+ const decorationPos =
759
+ cellResolvedPos.pos +
760
+ (newIndex > originalIndex ? cellNode.nodeSize - 2 : 0);
761
+
762
+ decorations.push(
763
+ // The widget is a small bar which spans the height of the cell.
764
+ Decoration.widget(decorationPos, () => {
765
+ const widget = document.createElement("div");
766
+ widget.className = "bn-table-drop-cursor";
767
+ widget.style.top = "0";
768
+ widget.style.bottom = "0";
769
+ // This is only necessary because the drop indicator's width
770
+ // is an even number of pixels, whereas the border between
771
+ // table cells is an odd number of pixels. So this makes the
772
+ // positioning slightly more consistent regardless of where
773
+ // the column is being dropped.
774
+ if (newIndex > originalIndex) {
775
+ widget.style.right = "-2px";
776
+ } else {
777
+ widget.style.left = "-3px";
778
+ }
779
+ widget.style.width = "4px";
780
+
781
+ return widget;
782
+ }),
783
+ );
784
+ });
785
+ }
780
786
 
781
- return DecorationSet.create(state.doc, decorations);
787
+ return DecorationSet.create(state.doc, decorations);
788
+ },
782
789
  },
783
- },
784
- });
790
+ }),
791
+ );
785
792
  }
786
793
 
787
794
  public onUpdate(callback: (state: TableHandlesState<I, S>) => void) {
@@ -163,7 +163,6 @@ export const ar: Dictionary = {
163
163
  },
164
164
  suggestion_menu: {
165
165
  no_items_title: "لم يتم العثور على عناصر",
166
- loading: "جارٍ التحميل…",
167
166
  },
168
167
  color_picker: {
169
168
  text_title: "نص",
@@ -178,7 +178,6 @@ export const de: Dictionary = {
178
178
  },
179
179
  suggestion_menu: {
180
180
  no_items_title: "Keine Elemente gefunden",
181
- loading: "Laden …",
182
181
  },
183
182
  color_picker: {
184
183
  text_title: "Text",
@@ -178,7 +178,6 @@ export const en = {
178
178
  },
179
179
  suggestion_menu: {
180
180
  no_items_title: "No items found",
181
- loading: "Loading…",
182
181
  },
183
182
  color_picker: {
184
183
  text_title: "Text",
@@ -177,7 +177,6 @@ export const es: Dictionary = {
177
177
  },
178
178
  suggestion_menu: {
179
179
  no_items_title: "No se encontraron elementos",
180
- loading: "Cargando…",
181
180
  },
182
181
  color_picker: {
183
182
  text_title: "Texto",
@@ -202,7 +202,6 @@ export const fr: Dictionary = {
202
202
  },
203
203
  suggestion_menu: {
204
204
  no_items_title: "Aucun élément trouvé",
205
- loading: "Chargement…",
206
205
  },
207
206
  color_picker: {
208
207
  text_title: "Texte",
@@ -191,7 +191,6 @@ export const hr: Dictionary = {
191
191
  },
192
192
  suggestion_menu: {
193
193
  no_items_title: "Stavke nisu pronađene",
194
- loading: "Učitavanje…",
195
194
  },
196
195
  color_picker: {
197
196
  text_title: "Tekst",
@@ -170,7 +170,6 @@ export const is: Dictionary = {
170
170
  },
171
171
  suggestion_menu: {
172
172
  no_items_title: "Engir hlutir fundust",
173
- loading: "Hleður…",
174
173
  },
175
174
  color_picker: {
176
175
  text_title: "Texti",
@@ -179,7 +179,6 @@ export const it: Dictionary = {
179
179
  },
180
180
  suggestion_menu: {
181
181
  no_items_title: "Nessun elemento trovato",
182
- loading: "Caricamento…",
183
182
  },
184
183
  color_picker: {
185
184
  text_title: "Testo",
@@ -198,7 +198,6 @@ export const ja: Dictionary = {
198
198
  },
199
199
  suggestion_menu: {
200
200
  no_items_title: "アイテムが見つかりません",
201
- loading: "読込中…",
202
201
  },
203
202
  color_picker: {
204
203
  text_title: "文字色",
@@ -191,7 +191,6 @@ export const ko: Dictionary = {
191
191
  },
192
192
  suggestion_menu: {
193
193
  no_items_title: "항목을 찾을 수 없음",
194
- loading: "로딩 중…",
195
194
  },
196
195
  color_picker: {
197
196
  text_title: "텍스트",
@@ -178,7 +178,6 @@ export const nl: Dictionary = {
178
178
  },
179
179
  suggestion_menu: {
180
180
  no_items_title: "Geen items gevonden",
181
- loading: "Laden…",
182
181
  },
183
182
  color_picker: {
184
183
  text_title: "Tekst",
@@ -178,7 +178,6 @@ export const no: Dictionary = {
178
178
  },
179
179
  suggestion_menu: {
180
180
  no_items_title: "Ingen elementer funnet",
181
- loading: "Laster…",
182
181
  },
183
182
  color_picker: {
184
183
  text_title: "Tekst",
@@ -162,7 +162,6 @@ export const pl: Dictionary = {
162
162
  },
163
163
  suggestion_menu: {
164
164
  no_items_title: "Nie znaleziono elementów",
165
- loading: "Ładowanie…",
166
165
  },
167
166
  color_picker: {
168
167
  text_title: "Tekst",
@@ -170,7 +170,6 @@ export const pt: Dictionary = {
170
170
  },
171
171
  suggestion_menu: {
172
172
  no_items_title: "Nenhum item encontrado",
173
- loading: "Carregando…",
174
173
  },
175
174
  color_picker: {
176
175
  text_title: "Texto",
@@ -205,7 +205,6 @@ export const ru: Dictionary = {
205
205
  },
206
206
  suggestion_menu: {
207
207
  no_items_title: "ничего не найдено",
208
- loading: "Загрузка…",
209
208
  },
210
209
  color_picker: {
211
210
  text_title: "Текст",
@@ -177,7 +177,6 @@ export const sk = {
177
177
  },
178
178
  suggestion_menu: {
179
179
  no_items_title: "Nenašli sa žiadne položky",
180
- loading: "Načítava sa…",
181
180
  },
182
181
  color_picker: {
183
182
  text_title: "Text",
@@ -203,7 +203,6 @@ export const uk: Dictionary = {
203
203
  },
204
204
  suggestion_menu: {
205
205
  no_items_title: "Нічого не знайдено",
206
- loading: "Завантаження…",
207
206
  },
208
207
  color_picker: {
209
208
  text_title: "Текст",
@@ -177,7 +177,6 @@ export const vi: Dictionary = {
177
177
  },
178
178
  suggestion_menu: {
179
179
  no_items_title: "Không tìm thấy mục nào",
180
- loading: "Đang tải...",
181
180
  },
182
181
  color_picker: {
183
182
  text_title: "Văn bản",
@@ -211,7 +211,6 @@ export const zhTW: Dictionary = {
211
211
  },
212
212
  suggestion_menu: {
213
213
  no_items_title: "無相符項目",
214
- loading: "載入中…",
215
214
  },
216
215
  color_picker: {
217
216
  text_title: "文字",
@@ -211,7 +211,6 @@ export const zh: Dictionary = {
211
211
  },
212
212
  suggestion_menu: {
213
213
  no_items_title: "无匹配项",
214
- loading: "加载中…",
215
214
  },
216
215
  color_picker: {
217
216
  text_title: "文本",
package/src/index.ts CHANGED
@@ -1,10 +1,17 @@
1
+ export * from "./api/blockManipulation/commands/insertBlocks/insertBlocks.js";
2
+ export * from "./api/blockManipulation/commands/replaceBlocks/replaceBlocks.js";
1
3
  export * from "./api/blockManipulation/commands/updateBlock/updateBlock.js";
2
4
  export * from "./api/exporters/html/externalHTMLExporter.js";
3
5
  export * from "./api/exporters/html/internalHTMLSerializer.js";
4
6
  export * from "./api/getBlockInfoFromPos.js";
5
7
  export * from "./api/nodeUtil.js";
8
+ export * from "./api/pmUtil.js";
6
9
  export * from "./blocks/AudioBlockContent/AudioBlockContent.js";
7
10
  export * from "./blocks/CodeBlockContent/CodeBlockContent.js";
11
+ export * from "./blocks/defaultBlockHelpers.js";
12
+ export * from "./blocks/defaultBlocks.js";
13
+ export * from "./blocks/defaultBlockTypeGuards.js";
14
+ export * from "./blocks/defaultProps.js";
8
15
  export * from "./blocks/FileBlockContent/FileBlockContent.js";
9
16
  export * from "./blocks/FileBlockContent/helpers/parse/parseEmbedElement.js";
10
17
  export * from "./blocks/FileBlockContent/helpers/parse/parseFigureElement.js";
@@ -16,19 +23,16 @@ export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createFigureWith
16
23
  export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js";
17
24
  export * from "./blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js";
18
25
  export * from "./blocks/ImageBlockContent/ImageBlockContent.js";
19
- export * from "./blocks/PageBreakBlockContent/PageBreakBlockContent.js";
20
26
  export * from "./blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.js";
27
+ export * from "./blocks/PageBreakBlockContent/PageBreakBlockContent.js";
21
28
  export * from "./blocks/PageBreakBlockContent/schema.js";
22
29
  export {
23
30
  EMPTY_CELL_HEIGHT,
24
31
  EMPTY_CELL_WIDTH,
25
32
  } from "./blocks/TableBlockContent/TableExtension.js";
26
33
  export * from "./blocks/VideoBlockContent/VideoBlockContent.js";
27
- export * from "./blocks/defaultBlockHelpers.js";
28
- export * from "./blocks/defaultBlockTypeGuards.js";
29
- export * from "./blocks/defaultBlocks.js";
30
- export * from "./blocks/defaultProps.js";
31
34
  export * from "./editor/BlockNoteEditor.js";
35
+ export * from "./editor/BlockNoteExtension.js";
32
36
  export * from "./editor/BlockNoteExtensions.js";
33
37
  export * from "./editor/BlockNoteSchema.js";
34
38
  export * from "./editor/defaultColors.js";
@@ -42,22 +46,24 @@ export * from "./extensions/LinkToolbar/protocols.js";
42
46
  export * from "./extensions/SideMenu/SideMenuPlugin.js";
43
47
  export * from "./extensions/SuggestionMenu/DefaultGridSuggestionItem.js";
44
48
  export * from "./extensions/SuggestionMenu/DefaultSuggestionItem.js";
45
- export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
46
49
  export * from "./extensions/SuggestionMenu/getDefaultEmojiPickerItems.js";
47
50
  export * from "./extensions/SuggestionMenu/getDefaultSlashMenuItems.js";
51
+ export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
48
52
  export * from "./extensions/TableHandles/TableHandlesPlugin.js";
49
53
  export * from "./i18n/dictionary.js";
50
54
  export * from "./schema/index.js";
51
55
  export * from "./util/browser.js";
52
56
  export * from "./util/combineByGroup.js";
53
57
  export * from "./util/esmDependencies.js";
54
- export * from "./util/table.js";
55
58
  export * from "./util/string.js";
59
+ export * from "./util/table.js";
56
60
  export * from "./util/typescript.js";
57
61
 
58
62
  export type { CodeBlockOptions } from "./blocks/CodeBlockContent/CodeBlockContent.js";
59
- export { UnreachableCaseError, assertEmpty } from "./util/typescript.js";
63
+ export { assertEmpty, UnreachableCaseError } from "./util/typescript.js";
60
64
 
65
+ export * from "./util/EventEmitter.js";
66
+ // for testing from react (TODO: move):
61
67
  // Unit testing
62
68
  export { selectedFragmentToHTML } from "./api/clipboard/toClipboard/copyExtension.js";
63
69
 
@@ -70,3 +76,7 @@ export * from "./extensions/UniqueID/UniqueID.js";
70
76
  export * from "./api/exporters/markdown/markdownExporter.js";
71
77
  export * from "./api/parsers/html/parseHTML.js";
72
78
  export * from "./api/parsers/markdown/parseMarkdown.js";
79
+
80
+ // TODO: for ai, remove?
81
+ export * from "./api/blockManipulation/getBlock/getBlock.js";
82
+ export * from "./api/positionMapping.js";
@@ -27,7 +27,7 @@ export const BlockContainer = Node.create<{
27
27
  // Ensures content-specific keyboard handlers trigger first.
28
28
  priority: 50,
29
29
  defining: true,
30
-
30
+ marks: "insertion modification deletion",
31
31
  parseHTML() {
32
32
  return [
33
33
  {
@@ -8,7 +8,7 @@ export const BlockGroup = Node.create<{
8
8
  name: "blockGroup",
9
9
  group: "childContainer",
10
10
  content: "blockGroupChild+",
11
-
11
+ marks: "deletion insertion modification",
12
12
  parseHTML() {
13
13
  return [
14
14
  {
@@ -4,4 +4,5 @@ export const Doc = Node.create({
4
4
  name: "doc",
5
5
  topNode: true,
6
6
  content: "blockGroup",
7
+ marks: "insertion modification deletion",
7
8
  });
@@ -1,4 +1,4 @@
1
+ import type { Transaction } from "prosemirror-state";
1
2
  import { Block, PartialBlock } from "../../../../blocks/defaultBlocks.js";
2
3
  import { BlockIdentifier, BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
3
- import type { Transaction } from "prosemirror-state";
4
4
  export declare function insertBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(tr: Transaction, blocksToInsert: PartialBlock<BSchema, I, S>[], referenceBlock: BlockIdentifier, placement?: "before" | "after"): Block<BSchema, I, S>[];