@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.
- package/dist/blocknote.cjs +9 -9
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +2793 -2213
- package/dist/blocknote.js.map +1 -1
- package/dist/{en-D4taoCs4.cjs → en-BXVKCwYt.cjs} +2 -2
- package/dist/en-BXVKCwYt.cjs.map +1 -0
- package/dist/{en-B7ycW7c8.js → en-qGo6sk9V.js} +2 -3
- package/dist/en-qGo6sk9V.js.map +1 -0
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +20 -39
- package/dist/locales.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +5 -6
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -3
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +1 -1
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2816 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +158 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +87 -17
- package/src/api/blockManipulation/selections/selection.ts +48 -1
- package/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.ts → textCursorPosition.ts} +7 -7
- package/src/api/getBlockInfoFromPos.ts +1 -1
- package/src/api/nodeConversions/blockToNode.ts +5 -2
- package/src/api/nodeConversions/nodeToBlock.ts +203 -8
- package/src/api/pmUtil.ts +3 -3
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +6 -6
- package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +1 -1
- package/src/blocks/TableBlockContent/TableBlockContent.ts +32 -2
- package/src/editor/Block.css +27 -1
- package/src/editor/BlockNoteEditor.test.ts +7 -0
- package/src/editor/BlockNoteEditor.ts +124 -39
- package/src/editor/BlockNoteExtension.ts +26 -0
- package/src/editor/BlockNoteExtensions.ts +28 -12
- package/src/editor/BlockNoteTipTapEditor.ts +23 -2
- package/src/extensions/Collaboration/CursorPlugin.ts +13 -7
- package/src/extensions/Collaboration/ForkYDocPlugin.test.ts +166 -0
- package/src/extensions/Collaboration/ForkYDocPlugin.ts +174 -0
- package/src/extensions/Collaboration/SyncPlugin.ts +7 -4
- package/src/extensions/Collaboration/UndoPlugin.ts +7 -4
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +30 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +30 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -0
- package/src/extensions/Comments/CommentsPlugin.ts +79 -70
- package/src/extensions/FilePanel/FilePanelPlugin.ts +54 -49
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +60 -26
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +26 -21
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +49 -42
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +115 -108
- package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +183 -170
- package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +26 -19
- package/src/extensions/SideMenu/SideMenuPlugin.ts +23 -18
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +172 -168
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -4
- package/src/extensions/Suggestions/SuggestionMarks.ts +175 -0
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +157 -150
- package/src/i18n/locales/ar.ts +0 -1
- package/src/i18n/locales/de.ts +0 -1
- package/src/i18n/locales/en.ts +0 -1
- package/src/i18n/locales/es.ts +0 -1
- package/src/i18n/locales/fr.ts +0 -1
- package/src/i18n/locales/hr.ts +0 -1
- package/src/i18n/locales/is.ts +0 -1
- package/src/i18n/locales/it.ts +0 -1
- package/src/i18n/locales/ja.ts +0 -1
- package/src/i18n/locales/ko.ts +0 -1
- package/src/i18n/locales/nl.ts +0 -1
- package/src/i18n/locales/no.ts +0 -1
- package/src/i18n/locales/pl.ts +0 -1
- package/src/i18n/locales/pt.ts +0 -1
- package/src/i18n/locales/ru.ts +0 -1
- package/src/i18n/locales/sk.ts +0 -1
- package/src/i18n/locales/uk.ts +0 -1
- package/src/i18n/locales/vi.ts +0 -1
- package/src/i18n/locales/zh-tw.ts +0 -1
- package/src/i18n/locales/zh.ts +0 -1
- package/src/index.ts +18 -8
- package/src/pm-nodes/BlockContainer.ts +1 -1
- package/src/pm-nodes/BlockGroup.ts +1 -1
- package/src/pm-nodes/Doc.ts +1 -0
- package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +1 -1
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +3 -1
- package/types/src/api/blockManipulation/selections/selection.d.ts +10 -0
- package/types/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.d.ts → textCursorPosition.d.ts} +2 -2
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +39 -2
- package/types/src/api/pmUtil.d.ts +3 -3
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +9 -1
- package/types/src/editor/BlockNoteEditor.d.ts +62 -10
- package/types/src/editor/BlockNoteExtension.d.ts +9 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
- package/types/src/extensions/Collaboration/CursorPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +41 -0
- package/types/src/extensions/Collaboration/SyncPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/UndoPlugin.d.ts +3 -3
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +3 -4
- package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +6 -5
- package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +4 -4
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +3 -3
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +3 -3
- package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +3 -3
- package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +3 -3
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +4 -4
- package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +3 -4
- package/types/src/extensions/Suggestions/SuggestionMarks.d.ts +4 -0
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +6 -6
- package/types/src/i18n/locales/en.d.ts +0 -1
- package/types/src/i18n/locales/sk.d.ts +0 -1
- package/types/src/index.d.ts +15 -8
- package/dist/en-B7ycW7c8.js.map +0 -1
- package/dist/en-D4taoCs4.cjs.map +0 -1
- package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +0 -844
- package/src/api/blockManipulation/selections/selection.test.ts +0 -72
- package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +0 -316
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +0 -74
- package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.d.ts +0 -1
- /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
|
|
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.
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
this.
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
this.view.state.
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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
|
-
|
|
698
|
-
|
|
699
|
-
rowResolvedPos.
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
//
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
//
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
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
|
-
|
|
744
|
-
|
|
745
|
-
rowResolvedPos.
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
cellResolvedPos.
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
//
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
//
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
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
|
-
|
|
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) {
|
package/src/i18n/locales/ar.ts
CHANGED
package/src/i18n/locales/de.ts
CHANGED
package/src/i18n/locales/en.ts
CHANGED
package/src/i18n/locales/es.ts
CHANGED
package/src/i18n/locales/fr.ts
CHANGED
package/src/i18n/locales/hr.ts
CHANGED
package/src/i18n/locales/is.ts
CHANGED
package/src/i18n/locales/it.ts
CHANGED
package/src/i18n/locales/ja.ts
CHANGED
package/src/i18n/locales/ko.ts
CHANGED
package/src/i18n/locales/nl.ts
CHANGED
package/src/i18n/locales/no.ts
CHANGED
package/src/i18n/locales/pl.ts
CHANGED
package/src/i18n/locales/pt.ts
CHANGED
package/src/i18n/locales/ru.ts
CHANGED
package/src/i18n/locales/sk.ts
CHANGED
package/src/i18n/locales/uk.ts
CHANGED
package/src/i18n/locales/vi.ts
CHANGED
package/src/i18n/locales/zh.ts
CHANGED
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 {
|
|
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";
|
package/src/pm-nodes/Doc.ts
CHANGED
|
@@ -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>[];
|