@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.
Files changed (200) hide show
  1. package/dist/BlockNoteExtension-BWw0r8Gy.cjs +2 -0
  2. package/dist/BlockNoteExtension-BWw0r8Gy.cjs.map +1 -0
  3. package/dist/BlockNoteExtension-C2X7LW-V.js +25 -0
  4. package/dist/BlockNoteExtension-C2X7LW-V.js.map +1 -0
  5. package/dist/BlockNoteSchema-CbSavEwr.js +270 -0
  6. package/dist/BlockNoteSchema-CbSavEwr.js.map +1 -0
  7. package/dist/BlockNoteSchema-D8TyvlfU.cjs +2 -0
  8. package/dist/BlockNoteSchema-D8TyvlfU.cjs.map +1 -0
  9. package/dist/EventEmitter-CLwfmbqG.cjs +2 -0
  10. package/dist/EventEmitter-CLwfmbqG.cjs.map +1 -0
  11. package/dist/EventEmitter-CjSwpTbz.js +27 -0
  12. package/dist/EventEmitter-CjSwpTbz.js.map +1 -0
  13. package/dist/ShowSelection-BW37oJ6h.cjs +2 -0
  14. package/dist/ShowSelection-BW37oJ6h.cjs.map +1 -0
  15. package/dist/ShowSelection-Dz-NEase.js +43 -0
  16. package/dist/ShowSelection-Dz-NEase.js.map +1 -0
  17. package/dist/TrailingNode-BUhuMJrB.js +2096 -0
  18. package/dist/TrailingNode-BUhuMJrB.js.map +1 -0
  19. package/dist/TrailingNode-CaT_wbho.cjs +2 -0
  20. package/dist/TrailingNode-CaT_wbho.cjs.map +1 -0
  21. package/dist/{blockToNode-DIfPWLH8.js → blockToNode-DBNbhwwC.js} +33 -33
  22. package/dist/blockToNode-DBNbhwwC.js.map +1 -0
  23. package/dist/blockToNode-w7H99R6p.cjs.map +1 -1
  24. package/dist/blocknote.cjs +4 -4
  25. package/dist/blocknote.cjs.map +1 -1
  26. package/dist/blocknote.js +2401 -5592
  27. package/dist/blocknote.js.map +1 -1
  28. package/dist/blocks.cjs +1 -1
  29. package/dist/blocks.js +71 -70
  30. package/dist/blocks.js.map +1 -1
  31. package/dist/comments.cjs +1 -1
  32. package/dist/comments.cjs.map +1 -1
  33. package/dist/comments.js +451 -137
  34. package/dist/comments.js.map +1 -1
  35. package/dist/{BlockNoteSchema-Bi-eeHal.js → defaultBlocks-BJtxTOM2.js} +991 -1047
  36. package/dist/defaultBlocks-BJtxTOM2.js.map +1 -0
  37. package/dist/defaultBlocks-BxFclIGP.cjs +6 -0
  38. package/dist/defaultBlocks-BxFclIGP.cjs.map +1 -0
  39. package/dist/extensions.cjs +2 -0
  40. package/dist/extensions.cjs.map +1 -0
  41. package/dist/extensions.js +57 -0
  42. package/dist/extensions.js.map +1 -0
  43. package/dist/tsconfig.tsbuildinfo +1 -1
  44. package/dist/webpack-stats.json +1 -1
  45. package/dist/yjs.js +1 -1
  46. package/package.json +12 -6
  47. package/src/api/nodeConversions/blockToNode.ts +1 -1
  48. package/src/api/nodeConversions/nodeToBlock.ts +1 -1
  49. package/src/blocks/Code/block.ts +4 -4
  50. package/src/blocks/Divider/block.ts +2 -2
  51. package/src/blocks/File/helpers/render/createAddFileButton.ts +7 -5
  52. package/src/blocks/Heading/block.ts +23 -20
  53. package/src/blocks/ListItem/BulletListItem/block.ts +2 -2
  54. package/src/blocks/ListItem/CheckListItem/block.ts +2 -2
  55. package/src/blocks/ListItem/NumberedListItem/block.ts +3 -3
  56. package/src/blocks/ListItem/ToggleListItem/block.ts +2 -2
  57. package/src/blocks/PageBreak/getPageBreakSlashMenuItems.ts +2 -2
  58. package/src/blocks/Paragraph/block.ts +2 -2
  59. package/src/blocks/Quote/block.ts +2 -2
  60. package/src/blocks/Table/block.ts +4 -3
  61. package/src/blocks/ToggleWrapper/createToggleWrapper.ts +2 -1
  62. package/src/comments/extension.ts +353 -0
  63. package/src/comments/index.ts +2 -1
  64. package/src/comments/types.ts +8 -0
  65. package/src/{extensions/Comments → comments}/userstore/UserStore.ts +2 -2
  66. package/src/editor/BlockNoteEditor.test.ts +2 -23
  67. package/src/editor/BlockNoteEditor.ts +66 -453
  68. package/src/editor/BlockNoteExtension.test.ts +103 -0
  69. package/src/editor/BlockNoteExtension.ts +174 -56
  70. package/src/editor/managers/EventManager.ts +64 -35
  71. package/src/editor/managers/ExtensionManager/extensions.ts +214 -0
  72. package/src/editor/managers/ExtensionManager/index.ts +514 -0
  73. package/src/editor/managers/ExtensionManager/symbol.ts +6 -0
  74. package/src/editor/managers/SelectionManager.ts +5 -1
  75. package/src/editor/managers/StateManager.ts +29 -17
  76. package/src/editor/managers/index.ts +1 -5
  77. package/src/extensions/BlockChange/{BlockChangePlugin.ts → BlockChange.ts} +27 -29
  78. package/src/extensions/Collaboration/{ForkYDocPlugin.test.ts → ForkYDoc.test.ts} +6 -5
  79. package/src/extensions/Collaboration/ForkYDoc.ts +158 -0
  80. package/src/extensions/Collaboration/YCursorPlugin.ts +183 -0
  81. package/src/extensions/Collaboration/YSync.ts +16 -0
  82. package/src/extensions/Collaboration/YUndo.ts +12 -0
  83. package/src/extensions/Collaboration/schemaMigration/SchemaMigration.ts +59 -0
  84. package/src/extensions/DropCursor/DropCursor.ts +26 -0
  85. package/src/extensions/FilePanel/FilePanel.ts +41 -0
  86. package/src/extensions/FormattingToolbar/FormattingToolbar.ts +119 -0
  87. package/src/extensions/History/History.ts +11 -0
  88. package/src/extensions/LinkToolbar/LinkToolbar.ts +121 -0
  89. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.ts +74 -0
  90. package/src/extensions/Placeholder/Placeholder.ts +148 -0
  91. package/src/extensions/PreviousBlockType/{PreviousBlockTypePlugin.ts → PreviousBlockType.ts} +9 -13
  92. package/src/extensions/ShowSelection/{ShowSelectionPlugin.ts → ShowSelection.ts} +27 -33
  93. package/src/extensions/SideMenu/{SideMenuPlugin.ts → SideMenu.ts} +63 -83
  94. package/src/extensions/SuggestionMenu/{SuggestionPlugin.ts → SuggestionMenu.ts} +71 -77
  95. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +29 -44
  96. package/src/extensions/TableHandles/{TableHandlesPlugin.ts → TableHandles.ts} +416 -437
  97. package/src/extensions/TrailingNode/{TrailingNodeExtension.ts → TrailingNode.ts} +8 -17
  98. package/src/extensions/index.ts +24 -0
  99. package/src/extensions/{BackgroundColor → tiptap-extensions/BackgroundColor}/BackgroundColorExtension.ts +1 -1
  100. package/src/extensions/{KeyboardShortcuts → tiptap-extensions/KeyboardShortcuts}/KeyboardShortcutsExtension.ts +21 -16
  101. package/src/extensions/{TextColor → tiptap-extensions/TextColor}/TextColorExtension.ts +1 -1
  102. package/src/extensions/tiptap-extensions/index.ts +31 -0
  103. package/src/index.ts +1 -13
  104. package/src/schema/blocks/createSpec.ts +14 -11
  105. package/src/schema/blocks/internal.ts +2 -2
  106. package/src/schema/blocks/types.ts +8 -5
  107. package/src/schema/schema.ts +11 -36
  108. package/src/util/topo-sort.ts +46 -0
  109. package/types/src/comments/extension.d.ts +70 -0
  110. package/types/src/comments/index.d.ts +2 -1
  111. package/types/src/comments/types.d.ts +8 -0
  112. package/types/src/{extensions/Comments → comments}/userstore/UserStore.d.ts +2 -2
  113. package/types/src/editor/BlockNoteEditor.d.ts +34 -105
  114. package/types/src/editor/BlockNoteExtension.d.ts +87 -22
  115. package/types/src/editor/managers/EventManager.d.ts +25 -16
  116. package/types/src/editor/managers/ExtensionManager/extensions.d.ts +8 -0
  117. package/types/src/editor/managers/ExtensionManager/index.d.ts +83 -0
  118. package/types/src/editor/managers/ExtensionManager/symbol.d.ts +5 -0
  119. package/types/src/editor/managers/StateManager.d.ts +1 -12
  120. package/types/src/editor/managers/index.d.ts +1 -2
  121. package/types/src/extensions/BlockChange/BlockChange.d.ts +16 -0
  122. package/types/src/extensions/Collaboration/ForkYDoc.d.ts +34 -0
  123. package/types/src/extensions/Collaboration/ForkYDoc.test.d.ts +1 -0
  124. package/types/src/extensions/Collaboration/YCursorPlugin.d.ts +24 -0
  125. package/types/src/extensions/Collaboration/YSync.d.ts +8 -0
  126. package/types/src/extensions/Collaboration/YUndo.d.ts +12 -0
  127. package/types/src/extensions/Collaboration/schemaMigration/SchemaMigration.d.ts +8 -0
  128. package/types/src/extensions/DropCursor/DropCursor.d.ts +5 -0
  129. package/types/src/extensions/FilePanel/FilePanel.d.ts +11 -0
  130. package/types/src/extensions/FormattingToolbar/FormattingToolbar.d.ts +9 -0
  131. package/types/src/extensions/History/History.d.ts +6 -0
  132. package/types/src/extensions/LinkToolbar/LinkToolbar.d.ts +24 -0
  133. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboard.d.ts +5 -0
  134. package/types/src/extensions/Placeholder/Placeholder.d.ts +6 -0
  135. package/types/src/extensions/PreviousBlockType/{PreviousBlockTypePlugin.d.ts → PreviousBlockType.d.ts} +9 -5
  136. package/types/src/extensions/ShowSelection/ShowSelection.d.ts +21 -0
  137. package/types/src/extensions/SideMenu/{SideMenuPlugin.d.ts → SideMenu.d.ts} +11 -15
  138. package/types/src/extensions/SuggestionMenu/SuggestionMenu.d.ts +54 -0
  139. package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +1 -1
  140. package/types/src/extensions/TableHandles/{TableHandlesPlugin.d.ts → TableHandles.d.ts} +28 -31
  141. package/types/src/extensions/TrailingNode/TrailingNode.d.ts +8 -0
  142. package/types/src/extensions/index.d.ts +24 -0
  143. package/types/src/extensions/{KeyboardShortcuts → tiptap-extensions/KeyboardShortcuts}/KeyboardShortcutsExtension.d.ts +1 -1
  144. package/types/src/extensions/tiptap-extensions/index.d.ts +11 -0
  145. package/types/src/index.d.ts +1 -13
  146. package/types/src/schema/blocks/createSpec.d.ts +4 -4
  147. package/types/src/schema/blocks/internal.d.ts +2 -2
  148. package/types/src/schema/blocks/types.d.ts +5 -5
  149. package/types/src/util/topo-sort.d.ts +8 -0
  150. package/dist/BlockNoteSchema-Bi-eeHal.js.map +0 -1
  151. package/dist/BlockNoteSchema-DjDaA2C3.cjs +0 -6
  152. package/dist/BlockNoteSchema-DjDaA2C3.cjs.map +0 -1
  153. package/dist/blockToNode-DIfPWLH8.js.map +0 -1
  154. package/src/comments/models/User.ts +0 -8
  155. package/src/editor/BlockNoteExtensions.ts +0 -325
  156. package/src/editor/managers/CollaborationManager.ts +0 -212
  157. package/src/editor/managers/ExtensionManager.ts +0 -130
  158. package/src/extensions/Collaboration/CursorPlugin.ts +0 -189
  159. package/src/extensions/Collaboration/ForkYDocPlugin.ts +0 -192
  160. package/src/extensions/Collaboration/SyncPlugin.ts +0 -18
  161. package/src/extensions/Collaboration/UndoPlugin.ts +0 -18
  162. package/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts +0 -59
  163. package/src/extensions/Comments/CommentsPlugin.ts +0 -392
  164. package/src/extensions/FilePanel/FilePanelPlugin.ts +0 -206
  165. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +0 -363
  166. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +0 -380
  167. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +0 -75
  168. package/src/extensions/Placeholder/PlaceholderPlugin.ts +0 -147
  169. package/types/src/comments/models/User.d.ts +0 -8
  170. package/types/src/editor/BlockNoteExtensions.d.ts +0 -43
  171. package/types/src/editor/managers/CollaborationManager.d.ts +0 -115
  172. package/types/src/editor/managers/ExtensionManager.d.ts +0 -68
  173. package/types/src/extensions/BlockChange/BlockChangePlugin.d.ts +0 -15
  174. package/types/src/extensions/Collaboration/CursorPlugin.d.ts +0 -37
  175. package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +0 -41
  176. package/types/src/extensions/Collaboration/SyncPlugin.d.ts +0 -7
  177. package/types/src/extensions/Collaboration/UndoPlugin.d.ts +0 -9
  178. package/types/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.d.ts +0 -7
  179. package/types/src/extensions/Comments/CommentsPlugin.d.ts +0 -66
  180. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +0 -31
  181. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +0 -41
  182. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +0 -42
  183. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +0 -5
  184. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +0 -6
  185. package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +0 -15
  186. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +0 -31
  187. package/types/src/extensions/TrailingNode/TrailingNodeExtension.d.ts +0 -13
  188. /package/src/{extensions/Comments/CommentMark.ts → comments/mark.ts} +0 -0
  189. /package/src/extensions/{HardBreak → tiptap-extensions/HardBreak}/HardBreak.ts +0 -0
  190. /package/src/extensions/{Suggestions → tiptap-extensions/Suggestions}/SuggestionMarks.ts +0 -0
  191. /package/src/extensions/{TextAlignment → tiptap-extensions/TextAlignment}/TextAlignmentExtension.ts +0 -0
  192. /package/src/extensions/{UniqueID → tiptap-extensions/UniqueID}/UniqueID.ts +0 -0
  193. /package/types/src/{extensions/Comments/CommentMark.d.ts → comments/mark.d.ts} +0 -0
  194. /package/types/src/{extensions/Collaboration/ForkYDocPlugin.test.d.ts → editor/BlockNoteExtension.test.d.ts} +0 -0
  195. /package/types/src/extensions/{BackgroundColor → tiptap-extensions/BackgroundColor}/BackgroundColorExtension.d.ts +0 -0
  196. /package/types/src/extensions/{HardBreak → tiptap-extensions/HardBreak}/HardBreak.d.ts +0 -0
  197. /package/types/src/extensions/{Suggestions → tiptap-extensions/Suggestions}/SuggestionMarks.d.ts +0 -0
  198. /package/types/src/extensions/{TextAlignment → tiptap-extensions/TextAlignment}/TextAlignmentExtension.d.ts +0 -0
  199. /package/types/src/extensions/{TextColor → tiptap-extensions/TextColor}/TextColorExtension.d.ts +0 -0
  200. /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,5 @@
1
+ import { Plugin } from "prosemirror-state";
2
+ export declare const NodeSelectionKeyboardExtension: () => import("../../index.js").ExtensionFactoryInstance<{
3
+ readonly key: "nodeSelectionKeyboard";
4
+ readonly prosemirrorPlugins: readonly [Plugin<any>];
5
+ }>;
@@ -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 { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
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 class PreviousBlockTypePlugin extends BlockNoteExtension {
11
- static key(): string;
12
- constructor();
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 class SideMenuProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
104
- private readonly editor;
105
- static key(): string;
106
- view: SideMenuView<BSchema, I, S> | undefined;
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<BSchema, I, S>) => void;
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 insertOrUpdateBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, block: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
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 { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
7
- import { BlockFromConfigNoChildren, BlockSchemaWithBlock, InlineContentSchema, StyleSchema } from "../../schema/index.js";
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"], I, S>;
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<I extends InlineContentSchema, S extends StyleSchema> implements PluginView {
23
+ export declare class TableHandlesView implements PluginView {
25
24
  private readonly editor;
26
25
  private readonly pmView;
27
- state?: TableHandlesState<I, S>;
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"]>, I, S>, pmView: EditorView, emitUpdate: (state: TableHandlesState<I, S>) => void);
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 class TableHandlesProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
46
- private readonly editor;
47
- static key(): string;
48
- private view;
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
- private setCellSelection;
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 "../../editor/BlockNoteEditor.js";
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>)[];
@@ -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 { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
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?: BlockNoteExtension<any>[], priority?: number): LooseBlockSpec<TName, TProps, TContent>;
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?: BlockNoteExtension<any>[] | (TOptions extends undefined ? () => BlockNoteExtension<any>[] : (options: Partial<TOptions>) => BlockNoteExtension<any>[])): (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?: BlockNoteExtension<any>[] | (TOptions extends undefined ? () => BlockNoteExtension<any>[] : (options: Partial<TOptions>) => BlockNoteExtension<any>[])): (options?: Partial<TOptions>) => BlockSpec<BlockConf["type"], BlockConf["propSchema"], BlockConf["content"]>;
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 { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
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?: BlockNoteExtension<any>[]): LooseBlockSpec<T["type"], P, T["content"]>;
23
+ }, P extends PropSchema>(config: T, propSchema: P, extensions?: ExtensionFactoryInstance[]): LooseBlockSpec<T["type"], P, T["content"]>;