@blocknote/core 0.42.2 → 0.43.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.
- package/dist/BlockNoteExtension-BWw0r8Gy.cjs +2 -0
- package/dist/BlockNoteExtension-BWw0r8Gy.cjs.map +1 -0
- package/dist/BlockNoteExtension-C2X7LW-V.js +25 -0
- package/dist/BlockNoteExtension-C2X7LW-V.js.map +1 -0
- package/dist/BlockNoteSchema-CbSavEwr.js +270 -0
- package/dist/BlockNoteSchema-CbSavEwr.js.map +1 -0
- package/dist/BlockNoteSchema-D8TyvlfU.cjs +2 -0
- package/dist/BlockNoteSchema-D8TyvlfU.cjs.map +1 -0
- package/dist/EventEmitter-CLwfmbqG.cjs +2 -0
- package/dist/EventEmitter-CLwfmbqG.cjs.map +1 -0
- package/dist/EventEmitter-CjSwpTbz.js +27 -0
- package/dist/EventEmitter-CjSwpTbz.js.map +1 -0
- package/dist/ShowSelection-BW37oJ6h.cjs +2 -0
- package/dist/ShowSelection-BW37oJ6h.cjs.map +1 -0
- package/dist/ShowSelection-Dz-NEase.js +43 -0
- package/dist/ShowSelection-Dz-NEase.js.map +1 -0
- package/dist/TrailingNode-BUhuMJrB.js +2096 -0
- package/dist/TrailingNode-BUhuMJrB.js.map +1 -0
- package/dist/TrailingNode-CaT_wbho.cjs +2 -0
- package/dist/TrailingNode-CaT_wbho.cjs.map +1 -0
- package/dist/{blockToNode-DIfPWLH8.js → blockToNode-DBNbhwwC.js} +33 -33
- package/dist/blockToNode-DBNbhwwC.js.map +1 -0
- package/dist/blockToNode-w7H99R6p.cjs.map +1 -1
- package/dist/blocknote.cjs +4 -4
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +2401 -5592
- package/dist/blocknote.js.map +1 -1
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +71 -70
- package/dist/blocks.js.map +1 -1
- package/dist/comments.cjs +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js +451 -137
- package/dist/comments.js.map +1 -1
- package/dist/{BlockNoteSchema-Bi-eeHal.js → defaultBlocks-BJtxTOM2.js} +991 -1047
- package/dist/defaultBlocks-BJtxTOM2.js.map +1 -0
- package/dist/defaultBlocks-BxFclIGP.cjs +6 -0
- package/dist/defaultBlocks-BxFclIGP.cjs.map +1 -0
- package/dist/extensions.cjs +2 -0
- package/dist/extensions.cjs.map +1 -0
- package/dist/extensions.js +57 -0
- package/dist/extensions.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/dist/yjs.js +1 -1
- package/package.json +12 -6
- package/src/api/nodeConversions/blockToNode.ts +1 -1
- package/src/api/nodeConversions/nodeToBlock.ts +1 -1
- package/src/blocks/Code/block.ts +4 -4
- package/src/blocks/Divider/block.ts +2 -2
- package/src/blocks/File/helpers/render/createAddFileButton.ts +7 -5
- package/src/blocks/Heading/block.ts +23 -20
- package/src/blocks/ListItem/BulletListItem/block.ts +2 -2
- package/src/blocks/ListItem/CheckListItem/block.ts +2 -2
- package/src/blocks/ListItem/NumberedListItem/block.ts +3 -3
- package/src/blocks/ListItem/ToggleListItem/block.ts +2 -2
- package/src/blocks/PageBreak/getPageBreakSlashMenuItems.ts +2 -2
- package/src/blocks/Paragraph/block.ts +2 -2
- package/src/blocks/Quote/block.ts +2 -2
- package/src/blocks/Table/block.ts +4 -3
- package/src/blocks/ToggleWrapper/createToggleWrapper.ts +2 -1
- package/src/comments/extension.ts +353 -0
- package/src/comments/index.ts +2 -1
- package/src/comments/types.ts +8 -0
- package/src/{extensions/Comments → comments}/userstore/UserStore.ts +2 -2
- package/src/editor/BlockNoteEditor.test.ts +2 -23
- package/src/editor/BlockNoteEditor.ts +66 -453
- package/src/editor/BlockNoteExtension.test.ts +103 -0
- package/src/editor/BlockNoteExtension.ts +174 -56
- package/src/editor/managers/EventManager.ts +64 -35
- package/src/editor/managers/ExtensionManager/extensions.ts +214 -0
- package/src/editor/managers/ExtensionManager/index.ts +514 -0
- package/src/editor/managers/ExtensionManager/symbol.ts +6 -0
- package/src/editor/managers/SelectionManager.ts +5 -1
- package/src/editor/managers/StateManager.ts +29 -17
- package/src/editor/managers/index.ts +1 -5
- package/src/extensions/BlockChange/{BlockChangePlugin.ts → BlockChange.ts} +27 -29
- package/src/extensions/Collaboration/{ForkYDocPlugin.test.ts → ForkYDoc.test.ts} +6 -5
- package/src/extensions/Collaboration/ForkYDoc.ts +158 -0
- package/src/extensions/Collaboration/YCursorPlugin.ts +183 -0
- package/src/extensions/Collaboration/YSync.ts +16 -0
- package/src/extensions/Collaboration/YUndo.ts +12 -0
- package/src/extensions/Collaboration/schemaMigration/SchemaMigration.ts +59 -0
- package/src/extensions/DropCursor/DropCursor.ts +26 -0
- package/src/extensions/FilePanel/FilePanel.ts +41 -0
- package/src/extensions/FormattingToolbar/FormattingToolbar.ts +119 -0
- package/src/extensions/History/History.ts +11 -0
- package/src/extensions/LinkToolbar/LinkToolbar.ts +121 -0
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.ts +74 -0
- package/src/extensions/Placeholder/Placeholder.ts +148 -0
- package/src/extensions/PreviousBlockType/{PreviousBlockTypePlugin.ts → PreviousBlockType.ts} +9 -13
- package/src/extensions/ShowSelection/{ShowSelectionPlugin.ts → ShowSelection.ts} +27 -33
- package/src/extensions/SideMenu/{SideMenuPlugin.ts → SideMenu.ts} +63 -83
- package/src/extensions/SuggestionMenu/{SuggestionPlugin.ts → SuggestionMenu.ts} +71 -77
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +29 -44
- package/src/extensions/TableHandles/{TableHandlesPlugin.ts → TableHandles.ts} +416 -437
- package/src/extensions/TrailingNode/{TrailingNodeExtension.ts → TrailingNode.ts} +8 -17
- package/src/extensions/index.ts +24 -0
- package/src/extensions/{BackgroundColor → tiptap-extensions/BackgroundColor}/BackgroundColorExtension.ts +1 -1
- package/src/extensions/{KeyboardShortcuts → tiptap-extensions/KeyboardShortcuts}/KeyboardShortcutsExtension.ts +21 -16
- package/src/extensions/{TextColor → tiptap-extensions/TextColor}/TextColorExtension.ts +1 -1
- package/src/extensions/tiptap-extensions/index.ts +31 -0
- package/src/index.ts +1 -13
- package/src/schema/blocks/createSpec.ts +14 -11
- package/src/schema/blocks/internal.ts +2 -2
- package/src/schema/blocks/types.ts +8 -5
- package/src/schema/schema.ts +11 -36
- package/src/util/topo-sort.ts +46 -0
- package/types/src/comments/extension.d.ts +70 -0
- package/types/src/comments/index.d.ts +2 -1
- package/types/src/comments/types.d.ts +8 -0
- package/types/src/{extensions/Comments → comments}/userstore/UserStore.d.ts +2 -2
- package/types/src/editor/BlockNoteEditor.d.ts +34 -105
- package/types/src/editor/BlockNoteExtension.d.ts +87 -22
- package/types/src/editor/managers/EventManager.d.ts +25 -16
- package/types/src/editor/managers/ExtensionManager/extensions.d.ts +8 -0
- package/types/src/editor/managers/ExtensionManager/index.d.ts +83 -0
- package/types/src/editor/managers/ExtensionManager/symbol.d.ts +5 -0
- package/types/src/editor/managers/StateManager.d.ts +1 -12
- package/types/src/editor/managers/index.d.ts +1 -2
- package/types/src/extensions/BlockChange/BlockChange.d.ts +16 -0
- package/types/src/extensions/Collaboration/ForkYDoc.d.ts +34 -0
- package/types/src/extensions/Collaboration/ForkYDoc.test.d.ts +1 -0
- package/types/src/extensions/Collaboration/YCursorPlugin.d.ts +24 -0
- package/types/src/extensions/Collaboration/YSync.d.ts +8 -0
- package/types/src/extensions/Collaboration/YUndo.d.ts +12 -0
- package/types/src/extensions/Collaboration/schemaMigration/SchemaMigration.d.ts +8 -0
- package/types/src/extensions/DropCursor/DropCursor.d.ts +5 -0
- package/types/src/extensions/FilePanel/FilePanel.d.ts +11 -0
- package/types/src/extensions/FormattingToolbar/FormattingToolbar.d.ts +9 -0
- package/types/src/extensions/History/History.d.ts +6 -0
- package/types/src/extensions/LinkToolbar/LinkToolbar.d.ts +24 -0
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.d.ts +5 -0
- package/types/src/extensions/Placeholder/Placeholder.d.ts +6 -0
- package/types/src/extensions/PreviousBlockType/{PreviousBlockTypePlugin.d.ts → PreviousBlockType.d.ts} +9 -5
- package/types/src/extensions/ShowSelection/ShowSelection.d.ts +21 -0
- package/types/src/extensions/SideMenu/{SideMenuPlugin.d.ts → SideMenu.d.ts} +11 -15
- package/types/src/extensions/SuggestionMenu/SuggestionMenu.d.ts +54 -0
- package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +1 -1
- package/types/src/extensions/TableHandles/{TableHandlesPlugin.d.ts → TableHandles.d.ts} +28 -31
- package/types/src/extensions/TrailingNode/TrailingNode.d.ts +8 -0
- package/types/src/extensions/index.d.ts +24 -0
- package/types/src/extensions/{KeyboardShortcuts → tiptap-extensions/KeyboardShortcuts}/KeyboardShortcutsExtension.d.ts +1 -1
- package/types/src/extensions/tiptap-extensions/index.d.ts +11 -0
- package/types/src/index.d.ts +1 -13
- package/types/src/schema/blocks/createSpec.d.ts +4 -4
- package/types/src/schema/blocks/internal.d.ts +2 -2
- package/types/src/schema/blocks/types.d.ts +5 -5
- package/types/src/util/topo-sort.d.ts +8 -0
- package/dist/BlockNoteSchema-Bi-eeHal.js.map +0 -1
- package/dist/BlockNoteSchema-DjDaA2C3.cjs +0 -6
- package/dist/BlockNoteSchema-DjDaA2C3.cjs.map +0 -1
- package/dist/blockToNode-DIfPWLH8.js.map +0 -1
- package/src/comments/models/User.ts +0 -8
- package/src/editor/BlockNoteExtensions.ts +0 -325
- package/src/editor/managers/CollaborationManager.ts +0 -212
- package/src/editor/managers/ExtensionManager.ts +0 -130
- package/src/extensions/Collaboration/CursorPlugin.ts +0 -189
- package/src/extensions/Collaboration/ForkYDocPlugin.ts +0 -192
- package/src/extensions/Collaboration/SyncPlugin.ts +0 -18
- package/src/extensions/Collaboration/UndoPlugin.ts +0 -18
- package/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts +0 -59
- package/src/extensions/Comments/CommentsPlugin.ts +0 -392
- package/src/extensions/FilePanel/FilePanelPlugin.ts +0 -206
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +0 -363
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +0 -380
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +0 -75
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +0 -147
- package/types/src/comments/models/User.d.ts +0 -8
- package/types/src/editor/BlockNoteExtensions.d.ts +0 -43
- package/types/src/editor/managers/CollaborationManager.d.ts +0 -115
- package/types/src/editor/managers/ExtensionManager.d.ts +0 -68
- package/types/src/extensions/BlockChange/BlockChangePlugin.d.ts +0 -15
- package/types/src/extensions/Collaboration/CursorPlugin.d.ts +0 -37
- package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +0 -41
- package/types/src/extensions/Collaboration/SyncPlugin.d.ts +0 -7
- package/types/src/extensions/Collaboration/UndoPlugin.d.ts +0 -9
- package/types/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.d.ts +0 -7
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +0 -66
- package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +0 -31
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +0 -41
- package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +0 -42
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +0 -5
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +0 -6
- package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +0 -15
- package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +0 -31
- package/types/src/extensions/TrailingNode/TrailingNodeExtension.d.ts +0 -13
- /package/src/{extensions/Comments/CommentMark.ts → comments/mark.ts} +0 -0
- /package/src/extensions/{HardBreak → tiptap-extensions/HardBreak}/HardBreak.ts +0 -0
- /package/src/extensions/{Suggestions → tiptap-extensions/Suggestions}/SuggestionMarks.ts +0 -0
- /package/src/extensions/{TextAlignment → tiptap-extensions/TextAlignment}/TextAlignmentExtension.ts +0 -0
- /package/src/extensions/{UniqueID → tiptap-extensions/UniqueID}/UniqueID.ts +0 -0
- /package/types/src/{extensions/Comments/CommentMark.d.ts → comments/mark.d.ts} +0 -0
- /package/types/src/{extensions/Collaboration/ForkYDocPlugin.test.d.ts → editor/BlockNoteExtension.test.d.ts} +0 -0
- /package/types/src/extensions/{BackgroundColor → tiptap-extensions/BackgroundColor}/BackgroundColorExtension.d.ts +0 -0
- /package/types/src/extensions/{HardBreak → tiptap-extensions/HardBreak}/HardBreak.d.ts +0 -0
- /package/types/src/extensions/{Suggestions → tiptap-extensions/Suggestions}/SuggestionMarks.d.ts +0 -0
- /package/types/src/extensions/{TextAlignment → tiptap-extensions/TextAlignment}/TextAlignmentExtension.d.ts +0 -0
- /package/types/src/extensions/{TextColor → tiptap-extensions/TextColor}/TextColorExtension.d.ts +0 -0
- /package/types/src/extensions/{UniqueID → tiptap-extensions/UniqueID}/UniqueID.d.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type CollaborationUser = {
|
|
2
|
+
name: string;
|
|
3
|
+
color: string;
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const YCursorExtension: (options: {
|
|
7
|
+
fragment: import("yjs").XmlFragment;
|
|
8
|
+
user: {
|
|
9
|
+
name: string;
|
|
10
|
+
color: string;
|
|
11
|
+
};
|
|
12
|
+
provider: any;
|
|
13
|
+
renderCursor?: (user: any) => HTMLElement;
|
|
14
|
+
showCursorLabels?: "always" | "activity";
|
|
15
|
+
}) => import("../../index.js").ExtensionFactoryInstance<{
|
|
16
|
+
readonly key: "yCursor";
|
|
17
|
+
readonly prosemirrorPlugins: readonly [any];
|
|
18
|
+
readonly dependsOn: readonly ["ySync"];
|
|
19
|
+
readonly updateUser: (user: {
|
|
20
|
+
name: string;
|
|
21
|
+
color: string;
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { XmlFragment } from "yjs";
|
|
2
|
+
export declare const YSyncExtension: (options: {
|
|
3
|
+
fragment: XmlFragment;
|
|
4
|
+
}) => import("../../index.js").ExtensionFactoryInstance<{
|
|
5
|
+
readonly key: "ySync";
|
|
6
|
+
readonly prosemirrorPlugins: readonly [any];
|
|
7
|
+
readonly runsBefore: readonly ["default"];
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const YUndoExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
2
|
+
readonly key: "yUndo";
|
|
3
|
+
readonly prosemirrorPlugins: readonly [import("prosemirror-state").Plugin<{
|
|
4
|
+
undoManager: import("yjs").UndoManager;
|
|
5
|
+
prevSel: any;
|
|
6
|
+
hasUndoOps: boolean;
|
|
7
|
+
hasRedoOps: boolean;
|
|
8
|
+
}>];
|
|
9
|
+
readonly dependsOn: readonly ["yCursor", "ySync"];
|
|
10
|
+
readonly undoCommand: import("prosemirror-state").Command;
|
|
11
|
+
readonly redoCommand: import("prosemirror-state").Command;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from "@tiptap/pm/state";
|
|
2
|
+
import * as Y from "yjs";
|
|
3
|
+
export declare const SchemaMigration: (options: {
|
|
4
|
+
fragment: Y.XmlFragment;
|
|
5
|
+
}) => import("../../../index.js").ExtensionFactoryInstance<{
|
|
6
|
+
readonly key: "schemaMigration";
|
|
7
|
+
readonly prosemirrorPlugins: readonly [Plugin<any>];
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockNoteEditorOptions } from "../../editor/BlockNoteEditor.js";
|
|
2
|
+
export declare const DropCursorExtension: (options: Pick<BlockNoteEditorOptions<any, any, any>, "dropCursor">) => import("../../index.js").ExtensionFactoryInstance<{
|
|
3
|
+
readonly key: "dropCursor";
|
|
4
|
+
readonly prosemirrorPlugins: readonly [import("prosemirror-state").Plugin<any>];
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const FilePanelExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
2
|
+
readonly key: "filePanel";
|
|
3
|
+
readonly store: import("@tanstack/store").Store<string | undefined, (cb: string | undefined) => string | undefined>;
|
|
4
|
+
readonly mount: ({ signal }: {
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
root: Document | ShadowRoot;
|
|
7
|
+
signal: AbortSignal;
|
|
8
|
+
}) => void;
|
|
9
|
+
readonly closeMenu: () => void;
|
|
10
|
+
readonly showMenu: (blockId: string) => void;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const FormattingToolbarExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
2
|
+
readonly key: "formattingToolbar";
|
|
3
|
+
readonly store: import("@tanstack/store").Store<boolean, (cb: boolean) => boolean>;
|
|
4
|
+
readonly mount: ({ dom, signal }: {
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
root: Document | ShadowRoot;
|
|
7
|
+
signal: AbortSignal;
|
|
8
|
+
}) => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const HistoryExtension: () => import("../../index.js").ExtensionFactoryInstance<{
|
|
2
|
+
readonly key: "history";
|
|
3
|
+
readonly prosemirrorPlugins: readonly [import("prosemirror-state").Plugin<any>];
|
|
4
|
+
readonly undoCommand: import("prosemirror-state").Command;
|
|
5
|
+
readonly redoCommand: import("prosemirror-state").Command;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const LinkToolbarExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
2
|
+
readonly key: "linkToolbar";
|
|
3
|
+
readonly getLinkAtSelection: () => {
|
|
4
|
+
range: import("@tiptap/core").Range;
|
|
5
|
+
mark: import("prosemirror-model").Mark;
|
|
6
|
+
readonly text: string;
|
|
7
|
+
readonly position: DOMRect;
|
|
8
|
+
} | undefined;
|
|
9
|
+
readonly getLinkElementAtPos: (pos: number) => HTMLAnchorElement | null;
|
|
10
|
+
readonly getMarkAtPos: (pos: number, markType: string) => {
|
|
11
|
+
range: import("@tiptap/core").Range;
|
|
12
|
+
mark: import("prosemirror-model").Mark;
|
|
13
|
+
readonly text: string;
|
|
14
|
+
readonly position: DOMRect;
|
|
15
|
+
} | undefined;
|
|
16
|
+
readonly getLinkAtElement: (element: HTMLElement) => {
|
|
17
|
+
range: import("@tiptap/core").Range;
|
|
18
|
+
mark: import("prosemirror-model").Mark;
|
|
19
|
+
readonly text: string;
|
|
20
|
+
readonly position: DOMRect;
|
|
21
|
+
} | undefined;
|
|
22
|
+
readonly editLink: (url: string, text: string, position?: number) => void;
|
|
23
|
+
readonly deleteLink: (position?: number) => void;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Plugin } from "prosemirror-state";
|
|
2
|
+
import { BlockNoteEditorOptions } from "../../editor/BlockNoteEditor.js";
|
|
3
|
+
export declare const PlaceholderExtension: (options: Pick<BlockNoteEditorOptions<any, any, any>, "placeholders">) => import("../../index.js").ExtensionFactoryInstance<{
|
|
4
|
+
readonly key: "placeholder";
|
|
5
|
+
readonly prosemirrorPlugins: readonly [Plugin<any>];
|
|
6
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plugin } from "prosemirror-state";
|
|
2
2
|
/**
|
|
3
3
|
* This plugin tracks transformation of Block node attributes, so we can support CSS transitions.
|
|
4
4
|
*
|
|
@@ -7,7 +7,11 @@ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Solution: When attributes change on a node, this plugin sets a data-* attribute with the "previous" value. This way we can still use CSS transitions. (See block.module.css)
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export declare const PreviousBlockTypeExtension: () => import("../../index.js").ExtensionFactoryInstance<{
|
|
11
|
+
readonly key: "previousBlockType";
|
|
12
|
+
readonly prosemirrorPlugins: readonly [Plugin<{
|
|
13
|
+
prevTransactionOldBlockAttrs: any;
|
|
14
|
+
currentTransactionOldBlockAttrs: any;
|
|
15
|
+
updatedBlocks: Set<string>;
|
|
16
|
+
}>];
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Plugin } from "prosemirror-state";
|
|
2
|
+
/**
|
|
3
|
+
* Plugin that shows adds a decoration around the current selection
|
|
4
|
+
* This can be used to highlight the current selection in the UI even when the
|
|
5
|
+
* text editor is not focused.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ShowSelectionExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
8
|
+
readonly key: "showSelection";
|
|
9
|
+
readonly store: import("@tanstack/store").Store<{
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
}, (cb: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
}) => {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
readonly prosemirrorPlugins: readonly [Plugin<any>];
|
|
17
|
+
/**
|
|
18
|
+
* Show or hide the selection decoration
|
|
19
|
+
*/
|
|
20
|
+
readonly showSelection: (shouldShow: boolean) => void;
|
|
21
|
+
}>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { EditorState, PluginKey, PluginView } from "@tiptap/pm/state";
|
|
1
|
+
import { EditorState, Plugin, PluginKey, PluginView } from "@tiptap/pm/state";
|
|
2
2
|
import { EditorView } from "@tiptap/pm/view";
|
|
3
3
|
import { Block } from "../../blocks/defaultBlocks.js";
|
|
4
4
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
5
|
-
import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
|
|
6
5
|
import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
|
|
7
6
|
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
|
|
8
7
|
export type SideMenuState<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = UiElementPosition & {
|
|
@@ -95,38 +94,35 @@ export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineC
|
|
|
95
94
|
onKeyDown: (_event: KeyboardEvent) => void;
|
|
96
95
|
onMouseMove: (event: MouseEvent) => void;
|
|
97
96
|
private dispatchSyntheticEvent;
|
|
98
|
-
onScroll: () => void;
|
|
99
97
|
update(_view: EditorView, prevState: EditorState): void;
|
|
100
98
|
destroy(): void;
|
|
101
99
|
}
|
|
102
100
|
export declare const sideMenuPluginKey: PluginKey<any>;
|
|
103
|
-
export declare
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
constructor(editor: BlockNoteEditor<BSchema, I, S>);
|
|
108
|
-
onUpdate(callback: (state: SideMenuState<BSchema, I, S>) => void): () => void;
|
|
101
|
+
export declare const SideMenuExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
102
|
+
readonly key: "sideMenu";
|
|
103
|
+
readonly store: import("@tanstack/store").Store<SideMenuState<any, any, any> | undefined, (cb: SideMenuState<any, any, any> | undefined) => SideMenuState<any, any, any> | undefined>;
|
|
104
|
+
readonly prosemirrorPlugins: readonly [Plugin<any>];
|
|
109
105
|
/**
|
|
110
106
|
* Handles drag & drop events for blocks.
|
|
111
107
|
*/
|
|
112
|
-
blockDragStart: (event: {
|
|
108
|
+
readonly blockDragStart: (event: {
|
|
113
109
|
dataTransfer: DataTransfer | null;
|
|
114
110
|
clientY: number;
|
|
115
|
-
}, block: Block<
|
|
111
|
+
}, block: Block<any, any, any>) => void;
|
|
116
112
|
/**
|
|
117
113
|
* Handles drag & drop events for blocks.
|
|
118
114
|
*/
|
|
119
|
-
blockDragEnd: () => void;
|
|
115
|
+
readonly blockDragEnd: () => void;
|
|
120
116
|
/**
|
|
121
117
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
122
118
|
* attached to the same block regardless of which block is hovered by the
|
|
123
119
|
* mouse cursor.
|
|
124
120
|
*/
|
|
125
|
-
freezeMenu: () => void;
|
|
121
|
+
readonly freezeMenu: () => void;
|
|
126
122
|
/**
|
|
127
123
|
* Unfreezes the side menu. When frozen, the side menu will stay
|
|
128
124
|
* attached to the same block regardless of which block is hovered by the
|
|
129
125
|
* mouse cursor.
|
|
130
126
|
*/
|
|
131
|
-
unfreezeMenu: () => void;
|
|
132
|
-
}
|
|
127
|
+
readonly unfreezeMenu: () => void;
|
|
128
|
+
}>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Plugin } from "prosemirror-state";
|
|
2
|
+
import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
|
|
3
|
+
export type SuggestionMenuState = UiElementPosition & {
|
|
4
|
+
query: string;
|
|
5
|
+
ignoreQueryLength?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type SuggestionPluginState = {
|
|
8
|
+
triggerCharacter: string;
|
|
9
|
+
deleteTriggerCharacter: boolean;
|
|
10
|
+
queryStartPos: () => number;
|
|
11
|
+
query: string;
|
|
12
|
+
decorationId: string;
|
|
13
|
+
ignoreQueryLength?: boolean;
|
|
14
|
+
} | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A ProseMirror plugin for suggestions, designed to make '/'-commands possible as well as mentions.
|
|
17
|
+
*
|
|
18
|
+
* This is basically a simplified version of TipTap's [Suggestions](https://github.com/ueberdosis/tiptap/tree/db92a9b313c5993b723c85cd30256f1d4a0b65e1/packages/suggestion) plugin.
|
|
19
|
+
*
|
|
20
|
+
* This version is adapted from the aforementioned version in the following ways:
|
|
21
|
+
* - This version supports generic items instead of only strings (to allow for more advanced filtering for example)
|
|
22
|
+
* - This version hides some unnecessary complexity from the user of the plugin.
|
|
23
|
+
* - This version handles key events differently
|
|
24
|
+
*/
|
|
25
|
+
export declare const SuggestionMenu: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
26
|
+
readonly key: "suggestionMenu";
|
|
27
|
+
readonly store: import("@tanstack/store").Store<(UiElementPosition & {
|
|
28
|
+
query: string;
|
|
29
|
+
ignoreQueryLength?: boolean;
|
|
30
|
+
} & {
|
|
31
|
+
triggerCharacter: string;
|
|
32
|
+
}) | undefined, (cb: (UiElementPosition & {
|
|
33
|
+
query: string;
|
|
34
|
+
ignoreQueryLength?: boolean;
|
|
35
|
+
} & {
|
|
36
|
+
triggerCharacter: string;
|
|
37
|
+
}) | undefined) => (UiElementPosition & {
|
|
38
|
+
query: string;
|
|
39
|
+
ignoreQueryLength?: boolean;
|
|
40
|
+
} & {
|
|
41
|
+
triggerCharacter: string;
|
|
42
|
+
}) | undefined>;
|
|
43
|
+
readonly addTriggerCharacter: (triggerCharacter: string) => void;
|
|
44
|
+
readonly removeTriggerCharacter: (triggerCharacter: string) => void;
|
|
45
|
+
readonly closeMenu: () => void;
|
|
46
|
+
readonly clearQuery: () => void;
|
|
47
|
+
readonly shown: () => boolean;
|
|
48
|
+
readonly openSuggestionMenu: (triggerCharacter: string, pluginState?: {
|
|
49
|
+
deleteTriggerCharacter?: boolean;
|
|
50
|
+
ignoreQueryLength?: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
readonly prosemirrorPlugins: readonly [Plugin<SuggestionPluginState>];
|
|
53
|
+
}>;
|
|
54
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { Block, PartialBlock } from "../../blocks/defaultBlocks.js";
|
|
|
2
2
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
3
3
|
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
|
|
4
4
|
import { DefaultSuggestionItem } from "./DefaultSuggestionItem.js";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function insertOrUpdateBlockForSlashMenu<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, block: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
|
|
6
6
|
export declare function getDefaultSlashMenuItems<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>): DefaultSuggestionItem[];
|
|
7
7
|
export declare function filterSuggestionItems<T extends {
|
|
8
8
|
title: string;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { PluginKey, PluginView } from "prosemirror-state";
|
|
1
|
+
import { EditorState, Plugin, PluginKey, PluginView } from "prosemirror-state";
|
|
2
2
|
import { EditorView } from "prosemirror-view";
|
|
3
3
|
import { RelativeCellIndices } from "../../api/blockManipulation/tables/tables.js";
|
|
4
4
|
import { DefaultBlockSchema } from "../../blocks/defaultBlocks.js";
|
|
5
5
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export type TableHandlesState<I extends InlineContentSchema, S extends StyleSchema> = {
|
|
6
|
+
import { BlockFromConfigNoChildren, BlockSchemaWithBlock } from "../../schema/index.js";
|
|
7
|
+
export type TableHandlesState = {
|
|
9
8
|
show: boolean;
|
|
10
9
|
showAddOrRemoveRowsButton: boolean;
|
|
11
10
|
showAddOrRemoveColumnsButton: boolean;
|
|
12
11
|
referencePosCell: DOMRect | undefined;
|
|
13
12
|
referencePosTable: DOMRect;
|
|
14
|
-
block: BlockFromConfigNoChildren<DefaultBlockSchema["table"],
|
|
13
|
+
block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>;
|
|
15
14
|
colIndex: number | undefined;
|
|
16
15
|
rowIndex: number | undefined;
|
|
17
16
|
draggingState: {
|
|
@@ -21,10 +20,10 @@ export type TableHandlesState<I extends InlineContentSchema, S extends StyleSche
|
|
|
21
20
|
} | undefined;
|
|
22
21
|
widgetContainer: HTMLElement | undefined;
|
|
23
22
|
};
|
|
24
|
-
export declare class TableHandlesView
|
|
23
|
+
export declare class TableHandlesView implements PluginView {
|
|
25
24
|
private readonly editor;
|
|
26
25
|
private readonly pmView;
|
|
27
|
-
state?: TableHandlesState
|
|
26
|
+
state?: TableHandlesState;
|
|
28
27
|
emitUpdate: () => void;
|
|
29
28
|
tableId: string | undefined;
|
|
30
29
|
tablePos: number | undefined;
|
|
@@ -32,7 +31,7 @@ export declare class TableHandlesView<I extends InlineContentSchema, S extends S
|
|
|
32
31
|
menuFrozen: boolean;
|
|
33
32
|
mouseState: "up" | "down" | "selecting";
|
|
34
33
|
prevWasEditable: boolean | null;
|
|
35
|
-
constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>,
|
|
34
|
+
constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, any, any>, pmView: EditorView, emitUpdate: (state: TableHandlesState) => void);
|
|
36
35
|
viewMousedownHandler: () => void;
|
|
37
36
|
mouseUpHandler: (event: MouseEvent) => void;
|
|
38
37
|
mouseMoveHandler: (event: MouseEvent) => false | undefined;
|
|
@@ -42,17 +41,15 @@ export declare class TableHandlesView<I extends InlineContentSchema, S extends S
|
|
|
42
41
|
destroy(): void;
|
|
43
42
|
}
|
|
44
43
|
export declare const tableHandlesPluginKey: PluginKey<any>;
|
|
45
|
-
export declare
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, I, S>);
|
|
50
|
-
onUpdate(callback: (state: TableHandlesState<I, S>) => void): () => void;
|
|
44
|
+
export declare const TableHandlesExtension: (options?: any) => import("../../index.js").ExtensionFactoryInstance<{
|
|
45
|
+
readonly key: "tableHandles";
|
|
46
|
+
readonly store: import("@tanstack/store").Store<TableHandlesState | undefined, (cb: TableHandlesState | undefined) => TableHandlesState | undefined>;
|
|
47
|
+
readonly prosemirrorPlugins: readonly [Plugin<any>];
|
|
51
48
|
/**
|
|
52
49
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
53
50
|
* is used as the column drag handle.
|
|
54
51
|
*/
|
|
55
|
-
colDragStart: (event: {
|
|
52
|
+
readonly colDragStart: (event: {
|
|
56
53
|
dataTransfer: DataTransfer | null;
|
|
57
54
|
clientX: number;
|
|
58
55
|
}) => void;
|
|
@@ -60,7 +57,7 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
60
57
|
* Callback that should be set on the `dragStart` event for whichever element
|
|
61
58
|
* is used as the row drag handle.
|
|
62
59
|
*/
|
|
63
|
-
rowDragStart: (event: {
|
|
60
|
+
readonly rowDragStart: (event: {
|
|
64
61
|
dataTransfer: DataTransfer | null;
|
|
65
62
|
clientY: number;
|
|
66
63
|
}) => void;
|
|
@@ -68,35 +65,35 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
68
65
|
* Callback that should be set on the `dragEnd` event for both the element
|
|
69
66
|
* used as the row drag handle, and the one used as the column drag handle.
|
|
70
67
|
*/
|
|
71
|
-
dragEnd: () => void;
|
|
68
|
+
readonly dragEnd: () => void;
|
|
72
69
|
/**
|
|
73
70
|
* Freezes the drag handles. When frozen, they will stay attached to the same
|
|
74
71
|
* cell regardless of which cell is hovered by the mouse cursor.
|
|
75
72
|
*/
|
|
76
|
-
freezeHandles: () => void;
|
|
73
|
+
readonly freezeHandles: () => void;
|
|
77
74
|
/**
|
|
78
75
|
* Unfreezes the drag handles. When frozen, they will stay attached to the
|
|
79
76
|
* same cell regardless of which cell is hovered by the mouse cursor.
|
|
80
77
|
*/
|
|
81
|
-
unfreezeHandles: () => void;
|
|
82
|
-
getCellsAtRowHandle: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, relativeRowIndex: RelativeCellIndices["row"]) => (RelativeCellIndices & {
|
|
78
|
+
readonly unfreezeHandles: () => void;
|
|
79
|
+
readonly getCellsAtRowHandle: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, relativeRowIndex: RelativeCellIndices["row"]) => (RelativeCellIndices & {
|
|
83
80
|
cell: import("../../index.js").TableCell<any, any>;
|
|
84
81
|
})[];
|
|
85
82
|
/**
|
|
86
83
|
* Get all the cells in a column of the table block.
|
|
87
84
|
*/
|
|
88
|
-
getCellsAtColumnHandle: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, relativeColumnIndex: RelativeCellIndices["col"]) => (RelativeCellIndices & {
|
|
85
|
+
readonly getCellsAtColumnHandle: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, relativeColumnIndex: RelativeCellIndices["col"]) => (RelativeCellIndices & {
|
|
89
86
|
cell: import("../../index.js").TableCell<any, any>;
|
|
90
87
|
})[];
|
|
91
88
|
/**
|
|
92
89
|
* Sets the selection to the given cell or a range of cells.
|
|
93
90
|
* @returns The new state after the selection has been set.
|
|
94
91
|
*/
|
|
95
|
-
|
|
92
|
+
readonly setCellSelection: (state: EditorState, relativeStartCell: RelativeCellIndices, relativeEndCell?: RelativeCellIndices) => EditorState;
|
|
96
93
|
/**
|
|
97
94
|
* Adds a row or column to the table using prosemirror-table commands
|
|
98
95
|
*/
|
|
99
|
-
addRowOrColumn: (index: RelativeCellIndices["row"] | RelativeCellIndices["col"], direction: {
|
|
96
|
+
readonly addRowOrColumn: (index: RelativeCellIndices["row"] | RelativeCellIndices["col"], direction: {
|
|
100
97
|
orientation: "row";
|
|
101
98
|
side: "above" | "below";
|
|
102
99
|
} | {
|
|
@@ -106,11 +103,11 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
106
103
|
/**
|
|
107
104
|
* Removes a row or column from the table using prosemirror-table commands
|
|
108
105
|
*/
|
|
109
|
-
removeRowOrColumn: (index: RelativeCellIndices["row"] | RelativeCellIndices["col"], direction: "row" | "column") => boolean;
|
|
106
|
+
readonly removeRowOrColumn: (index: RelativeCellIndices["row"] | RelativeCellIndices["col"], direction: "row" | "column") => boolean;
|
|
110
107
|
/**
|
|
111
108
|
* Merges the cells in the table block.
|
|
112
109
|
*/
|
|
113
|
-
mergeCells: (cellsToMerge?: {
|
|
110
|
+
readonly mergeCells: (cellsToMerge?: {
|
|
114
111
|
relativeStartCell: RelativeCellIndices;
|
|
115
112
|
relativeEndCell: RelativeCellIndices;
|
|
116
113
|
}) => boolean;
|
|
@@ -118,12 +115,12 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
118
115
|
* Splits the cell in the table block.
|
|
119
116
|
* If no cell is provided, the current cell selected will be split.
|
|
120
117
|
*/
|
|
121
|
-
splitCell: (relativeCellToSplit?: RelativeCellIndices) => boolean;
|
|
118
|
+
readonly splitCell: (relativeCellToSplit?: RelativeCellIndices) => boolean;
|
|
122
119
|
/**
|
|
123
120
|
* Gets the start and end cells of the current cell selection.
|
|
124
121
|
* @returns The start and end cells of the current cell selection.
|
|
125
122
|
*/
|
|
126
|
-
getCellSelection: () => undefined | {
|
|
123
|
+
readonly getCellSelection: () => undefined | {
|
|
127
124
|
from: RelativeCellIndices;
|
|
128
125
|
to: RelativeCellIndices;
|
|
129
126
|
/**
|
|
@@ -136,11 +133,11 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
|
|
|
136
133
|
*
|
|
137
134
|
* Returns undefined when there is no cell selection, or the selection is not within a table.
|
|
138
135
|
*/
|
|
139
|
-
getMergeDirection: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any> | undefined) => "vertical" | "horizontal" | undefined;
|
|
140
|
-
cropEmptyRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, removeEmpty: "columns" | "rows") => {
|
|
136
|
+
readonly getMergeDirection: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any> | undefined) => "vertical" | "horizontal" | undefined;
|
|
137
|
+
readonly cropEmptyRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, removeEmpty: "columns" | "rows") => {
|
|
141
138
|
cells: (import("../../index.js").StyledText<any> | import("../../index.js").Link<any> | import("../../index.js").CustomInlineContentFromConfig<any, any>)[][] | import("../../index.js").TableCell<any, any>[];
|
|
142
139
|
}[];
|
|
143
|
-
addRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, addType: "columns" | "rows", numToAdd: number) => {
|
|
140
|
+
readonly addRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, addType: "columns" | "rows", numToAdd: number) => {
|
|
144
141
|
cells: (import("../../index.js").StyledText<any> | import("../../index.js").Link<any> | import("../../index.js").CustomInlineContentFromConfig<any, any>)[][] | import("../../index.js").TableCell<any, any>[];
|
|
145
142
|
}[];
|
|
146
|
-
}
|
|
143
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from "prosemirror-state";
|
|
2
|
+
/**
|
|
3
|
+
* Add a trailing node to the document so the user can always click at the bottom of the document and start typing
|
|
4
|
+
*/
|
|
5
|
+
export declare const TrailingNodeExtension: () => import("../../index.js").ExtensionFactoryInstance<{
|
|
6
|
+
readonly key: "trailingNode";
|
|
7
|
+
readonly prosemirrorPlugins: readonly [Plugin<void>];
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from "./BlockChange/BlockChange.js";
|
|
2
|
+
export * from "./Collaboration/ForkYDoc.js";
|
|
3
|
+
export * from "./Collaboration/schemaMigration/SchemaMigration.js";
|
|
4
|
+
export * from "./Collaboration/YCursorPlugin.js";
|
|
5
|
+
export * from "./Collaboration/YSync.js";
|
|
6
|
+
export * from "./Collaboration/YUndo.js";
|
|
7
|
+
export * from "./DropCursor/DropCursor.js";
|
|
8
|
+
export * from "./FilePanel/FilePanel.js";
|
|
9
|
+
export * from "./FormattingToolbar/FormattingToolbar.js";
|
|
10
|
+
export * from "./History/History.js";
|
|
11
|
+
export * from "./LinkToolbar/LinkToolbar.js";
|
|
12
|
+
export * from "./LinkToolbar/protocols.js";
|
|
13
|
+
export * from "./NodeSelectionKeyboard/NodeSelectionKeyboard.js";
|
|
14
|
+
export * from "./Placeholder/Placeholder.js";
|
|
15
|
+
export * from "./PreviousBlockType/PreviousBlockType.js";
|
|
16
|
+
export * from "./ShowSelection/ShowSelection.js";
|
|
17
|
+
export * from "./SideMenu/SideMenu.js";
|
|
18
|
+
export * from "./SuggestionMenu/SuggestionMenu.js";
|
|
19
|
+
export * from "./SuggestionMenu/getDefaultSlashMenuItems.js";
|
|
20
|
+
export * from "./SuggestionMenu/getDefaultEmojiPickerItems.js";
|
|
21
|
+
export * from "./SuggestionMenu/DefaultSuggestionItem.js";
|
|
22
|
+
export * from "./SuggestionMenu/DefaultGridSuggestionItem.js";
|
|
23
|
+
export * from "./TableHandles/TableHandles.js";
|
|
24
|
+
export * from "./TrailingNode/TrailingNode.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/core";
|
|
2
|
-
import { BlockNoteEditor } from "
|
|
2
|
+
import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
3
3
|
export declare const KeyboardShortcutsExtension: Extension<{
|
|
4
4
|
editor: BlockNoteEditor<any, any, any>;
|
|
5
5
|
tabBehavior: "prefer-navigate-ui" | "prefer-indent";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./BackgroundColor/BackgroundColorExtension.js";
|
|
2
|
+
export * from "./HardBreak/HardBreak.js";
|
|
3
|
+
export * from "./KeyboardShortcuts/KeyboardShortcutsExtension.js";
|
|
4
|
+
export * from "./Suggestions/SuggestionMarks.js";
|
|
5
|
+
export * from "./TextAlignment/TextAlignmentExtension.js";
|
|
6
|
+
export * from "./TextColor/TextColorExtension.js";
|
|
7
|
+
export * from "./UniqueID/UniqueID.js";
|
|
8
|
+
export declare const DEFAULT_TIP_TAP_EXTENSIONS: (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Mark<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Extension<{
|
|
9
|
+
editor: import("../../index.js").BlockNoteEditor<any, any, any>;
|
|
10
|
+
tabBehavior: "prefer-navigate-ui" | "prefer-indent";
|
|
11
|
+
}, any>)[];
|
package/types/src/index.d.ts
CHANGED
|
@@ -11,22 +11,10 @@ export * from "./api/pmUtil.js";
|
|
|
11
11
|
export * from "./blocks/index.js";
|
|
12
12
|
export * from "./editor/BlockNoteEditor.js";
|
|
13
13
|
export * from "./editor/BlockNoteExtension.js";
|
|
14
|
-
export * from "./editor/BlockNoteExtensions.js";
|
|
15
14
|
export * from "./editor/defaultColors.js";
|
|
16
15
|
export * from "./editor/selectionTypes.js";
|
|
17
16
|
export * from "./exporter/index.js";
|
|
18
17
|
export * from "./extensions-shared/UiElementPosition.js";
|
|
19
|
-
export * from "./extensions/FilePanel/FilePanelPlugin.js";
|
|
20
|
-
export * from "./extensions/FormattingToolbar/FormattingToolbarPlugin.js";
|
|
21
|
-
export * from "./extensions/LinkToolbar/LinkToolbarPlugin.js";
|
|
22
|
-
export * from "./extensions/LinkToolbar/protocols.js";
|
|
23
|
-
export * from "./extensions/SideMenu/SideMenuPlugin.js";
|
|
24
|
-
export * from "./extensions/SuggestionMenu/DefaultGridSuggestionItem.js";
|
|
25
|
-
export * from "./extensions/SuggestionMenu/DefaultSuggestionItem.js";
|
|
26
|
-
export * from "./extensions/SuggestionMenu/getDefaultEmojiPickerItems.js";
|
|
27
|
-
export * from "./extensions/SuggestionMenu/getDefaultSlashMenuItems.js";
|
|
28
|
-
export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
|
|
29
|
-
export * from "./extensions/TableHandles/TableHandlesPlugin.js";
|
|
30
18
|
export * from "./i18n/dictionary.js";
|
|
31
19
|
export * from "./schema/index.js";
|
|
32
20
|
export * from "./util/browser.js";
|
|
@@ -40,7 +28,7 @@ export * from "./util/EventEmitter.js";
|
|
|
40
28
|
export { selectedFragmentToHTML } from "./api/clipboard/toClipboard/copyExtension.js";
|
|
41
29
|
export * from "./api/nodeConversions/blockToNode.js";
|
|
42
30
|
export * from "./api/nodeConversions/nodeToBlock.js";
|
|
43
|
-
export * from "./extensions/UniqueID/UniqueID.js";
|
|
31
|
+
export * from "./extensions/tiptap-extensions/UniqueID/UniqueID.js";
|
|
44
32
|
export * from "./api/exporters/markdown/markdownExporter.js";
|
|
45
33
|
export * from "./api/parsers/html/parseHTML.js";
|
|
46
34
|
export * from "./api/parsers/markdown/parseMarkdown.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Editor } from "@tiptap/core";
|
|
2
2
|
import { TagParseRule } from "@tiptap/pm/model";
|
|
3
3
|
import { NodeView } from "@tiptap/pm/view";
|
|
4
|
-
import {
|
|
4
|
+
import { Extension, ExtensionFactoryInstance } from "../../editor/BlockNoteExtension.js";
|
|
5
5
|
import { PropSchema } from "../propTypes.js";
|
|
6
6
|
import { BlockConfig, BlockImplementation, BlockSpec, LooseBlockSpec } from "./types.js";
|
|
7
7
|
export declare function applyNonSelectableBlockFix(nodeView: NodeView, editor: Editor): void;
|
|
8
8
|
export declare function getParseRules<TName extends string, TProps extends PropSchema, TContent extends "inline" | "none" | "table">(config: BlockConfig<TName, TProps, TContent>, implementation: BlockImplementation<TName, TProps, TContent>): TagParseRule[];
|
|
9
|
-
export declare function addNodeAndExtensionsToSpec<TName extends string, TProps extends PropSchema, TContent extends "inline" | "none" | "table">(blockConfig: BlockConfig<TName, TProps, TContent>, blockImplementation: BlockImplementation<TName, TProps, TContent>, extensions?:
|
|
9
|
+
export declare function addNodeAndExtensionsToSpec<TName extends string, TProps extends PropSchema, TContent extends "inline" | "none" | "table">(blockConfig: BlockConfig<TName, TProps, TContent>, blockImplementation: BlockImplementation<TName, TProps, TContent>, extensions?: (ExtensionFactoryInstance | Extension)[], priority?: number): LooseBlockSpec<TName, TProps, TContent>;
|
|
10
10
|
/**
|
|
11
11
|
* Helper function to create a block config.
|
|
12
12
|
*/
|
|
@@ -15,5 +15,5 @@ export declare function createBlockConfig<TCallback extends (options: Partial<Re
|
|
|
15
15
|
* Helper function to create a block definition.
|
|
16
16
|
* Can accept either functions that return the required objects, or the objects directly.
|
|
17
17
|
*/
|
|
18
|
-
export declare function createBlockSpec<const TName extends string, const TProps extends PropSchema, const TContent extends "inline" | "none", const TOptions extends Partial<Record<string, any>> | undefined = undefined>(blockConfigOrCreator: BlockConfig<TName, TProps, TContent>, blockImplementationOrCreator: BlockImplementation<TName, TProps, TContent> | (TOptions extends undefined ? () => BlockImplementation<TName, TProps, TContent> : (options: Partial<TOptions>) => BlockImplementation<TName, TProps, TContent>), extensionsOrCreator?:
|
|
19
|
-
export declare function createBlockSpec<const TName extends string, const TProps extends PropSchema, const TContent extends "inline" | "none", const BlockConf extends BlockConfig<TName, TProps, TContent>, const TOptions extends Partial<Record<string, any>>>(blockCreator: (options: Partial<TOptions>) => BlockConf, blockImplementationOrCreator: BlockImplementation<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]> | (TOptions extends undefined ? () => BlockImplementation<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]> : (options: Partial<TOptions>) => BlockImplementation<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]>), extensionsOrCreator?:
|
|
18
|
+
export declare function createBlockSpec<const TName extends string, const TProps extends PropSchema, const TContent extends "inline" | "none", const TOptions extends Partial<Record<string, any>> | undefined = undefined>(blockConfigOrCreator: BlockConfig<TName, TProps, TContent>, blockImplementationOrCreator: BlockImplementation<TName, TProps, TContent> | (TOptions extends undefined ? () => BlockImplementation<TName, TProps, TContent> : (options: Partial<TOptions>) => BlockImplementation<TName, TProps, TContent>), extensionsOrCreator?: ExtensionFactoryInstance[] | (TOptions extends undefined ? () => ExtensionFactoryInstance[] : (options: Partial<TOptions>) => ExtensionFactoryInstance[])): (options?: Partial<TOptions>) => BlockSpec<TName, TProps, TContent>;
|
|
19
|
+
export declare function createBlockSpec<const TName extends string, const TProps extends PropSchema, const TContent extends "inline" | "none", const BlockConf extends BlockConfig<TName, TProps, TContent>, const TOptions extends Partial<Record<string, any>>>(blockCreator: (options: Partial<TOptions>) => BlockConf, blockImplementationOrCreator: BlockImplementation<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]> | (TOptions extends undefined ? () => BlockImplementation<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]> : (options: Partial<TOptions>) => BlockImplementation<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]>), extensionsOrCreator?: ExtensionFactoryInstance[] | (TOptions extends undefined ? () => ExtensionFactoryInstance[] : (options: Partial<TOptions>) => ExtensionFactoryInstance[])): (options?: Partial<TOptions>) => BlockSpec<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Attributes, Editor, Node } from "@tiptap/core";
|
|
2
2
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
3
|
-
import {
|
|
3
|
+
import type { ExtensionFactoryInstance } from "../../editor/BlockNoteExtension.js";
|
|
4
4
|
import { InlineContentSchema } from "../inlineContent/types.js";
|
|
5
5
|
import { PropSchema, Props } from "../propTypes.js";
|
|
6
6
|
import { StyleSchema } from "../styles/types.js";
|
|
@@ -20,4 +20,4 @@ export declare function createBlockSpecFromTiptapNode<const T extends {
|
|
|
20
20
|
node: Node;
|
|
21
21
|
type: string;
|
|
22
22
|
content: "inline" | "table" | "none";
|
|
23
|
-
}, P extends PropSchema>(config: T, propSchema: P, extensions?:
|
|
23
|
+
}, P extends PropSchema>(config: T, propSchema: P, extensions?: ExtensionFactoryInstance[]): LooseBlockSpec<T["type"], P, T["content"]>;
|