@blocknote/core 0.4.4 → 0.4.5
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/README.md +1 -1
- package/dist/blocknote.js +6440 -6441
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +20 -20
- package/dist/blocknote.umd.cjs.map +1 -1
- package/package.json +2 -2
- package/src/BlockNoteEditor.ts +21 -17
- package/types/src/BlockNoteEditor.d.ts +3 -3
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"homepage": "https://github.com/yousefed/blocknote",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "0.4.
|
|
6
|
+
"version": "0.4.5",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"types",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"access": "public",
|
|
107
107
|
"registry": "https://registry.npmjs.org/"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "c0d8a428dde4af76d16335a8da7f0e0ae1294eaf"
|
|
110
110
|
}
|
package/src/BlockNoteEditor.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { Editor, EditorOptions } from "@tiptap/core";
|
|
2
2
|
import { Node } from "prosemirror-model";
|
|
3
3
|
// import "./blocknote.css";
|
|
4
|
-
import {
|
|
5
|
-
Block,
|
|
6
|
-
BlockIdentifier,
|
|
7
|
-
PartialBlock,
|
|
8
|
-
} from "./extensions/Blocks/api/blockTypes";
|
|
9
|
-
import { getBlockNoteExtensions, UiFactories } from "./BlockNoteExtensions";
|
|
10
|
-
import styles from "./editor.module.css";
|
|
11
|
-
import {
|
|
12
|
-
defaultSlashMenuItems,
|
|
13
|
-
BaseSlashMenuItem,
|
|
14
|
-
} from "./extensions/SlashMenu";
|
|
15
4
|
import { Editor as TiptapEditor } from "@tiptap/core/dist/packages/core/src/Editor";
|
|
16
|
-
import { nodeToBlock } from "./api/nodeConversions/nodeConversions";
|
|
17
|
-
import { TextCursorPosition } from "./extensions/Blocks/api/cursorPositionTypes";
|
|
18
|
-
import { getBlockInfoFromPos } from "./extensions/Blocks/helpers/getBlockInfoFromPos";
|
|
19
|
-
import { getNodeById } from "./api/util/nodeUtil";
|
|
20
5
|
import {
|
|
21
6
|
insertBlocks,
|
|
22
|
-
updateBlock,
|
|
23
7
|
removeBlocks,
|
|
24
8
|
replaceBlocks,
|
|
9
|
+
updateBlock,
|
|
25
10
|
} from "./api/blockManipulation/blockManipulation";
|
|
26
11
|
import {
|
|
27
12
|
blocksToHTML,
|
|
28
|
-
HTMLToBlocks,
|
|
29
13
|
blocksToMarkdown,
|
|
14
|
+
HTMLToBlocks,
|
|
30
15
|
markdownToBlocks,
|
|
31
16
|
} from "./api/formatConversions/formatConversions";
|
|
17
|
+
import { nodeToBlock } from "./api/nodeConversions/nodeConversions";
|
|
18
|
+
import { getNodeById } from "./api/util/nodeUtil";
|
|
19
|
+
import { getBlockNoteExtensions, UiFactories } from "./BlockNoteExtensions";
|
|
20
|
+
import styles from "./editor.module.css";
|
|
21
|
+
import {
|
|
22
|
+
Block,
|
|
23
|
+
BlockIdentifier,
|
|
24
|
+
PartialBlock,
|
|
25
|
+
} from "./extensions/Blocks/api/blockTypes";
|
|
26
|
+
import { TextCursorPosition } from "./extensions/Blocks/api/cursorPositionTypes";
|
|
27
|
+
import { getBlockInfoFromPos } from "./extensions/Blocks/helpers/getBlockInfoFromPos";
|
|
28
|
+
import {
|
|
29
|
+
BaseSlashMenuItem,
|
|
30
|
+
defaultSlashMenuItems,
|
|
31
|
+
} from "./extensions/SlashMenu";
|
|
32
32
|
|
|
33
33
|
export type BlockNoteEditorOptions = {
|
|
34
34
|
// TODO: Figure out if enableBlockNoteExtensions/disableHistoryExtension are needed and document them.
|
|
@@ -99,6 +99,10 @@ export class BlockNoteEditor {
|
|
|
99
99
|
},
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
if (options.parentElement) {
|
|
103
|
+
tiptapOptions.element = options.parentElement;
|
|
104
|
+
}
|
|
105
|
+
|
|
102
106
|
this._tiptapEditor = new Editor(tiptapOptions) as Editor & {
|
|
103
107
|
contentComponent: any;
|
|
104
108
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Block, BlockIdentifier, PartialBlock } from "./extensions/Blocks/api/blockTypes";
|
|
2
|
-
import { UiFactories } from "./BlockNoteExtensions";
|
|
3
|
-
import { BaseSlashMenuItem } from "./extensions/SlashMenu";
|
|
4
1
|
import { Editor as TiptapEditor } from "@tiptap/core/dist/packages/core/src/Editor";
|
|
2
|
+
import { UiFactories } from "./BlockNoteExtensions";
|
|
3
|
+
import { Block, BlockIdentifier, PartialBlock } from "./extensions/Blocks/api/blockTypes";
|
|
5
4
|
import { TextCursorPosition } from "./extensions/Blocks/api/cursorPositionTypes";
|
|
5
|
+
import { BaseSlashMenuItem } from "./extensions/SlashMenu";
|
|
6
6
|
export type BlockNoteEditorOptions = {
|
|
7
7
|
enableBlockNoteExtensions: boolean;
|
|
8
8
|
disableHistoryExtension: boolean;
|