@blocknote/core 0.4.6-alpha.0 → 0.4.6-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +52 -52
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +2 -2
- package/dist/blocknote.umd.cjs.map +1 -1
- package/package.json +2 -2
- package/src/BlockNoteEditor.ts +2 -2
- package/src/api/formatConversions/formatConversions.ts +4 -4
- package/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.ts +3 -3
- package/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +2 -2
- package/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +2 -2
- package/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.ts +1 -1
- package/types/src/BlockNoteEditor.d.ts +1 -1
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-alpha.
|
|
6
|
+
"version": "0.4.6-alpha.3",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"types",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"access": "public",
|
|
110
110
|
"registry": "https://registry.npmjs.org/"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "5e0103855c5d5c15237eb6aa05db23cfb25b23eb"
|
|
113
113
|
}
|
package/src/BlockNoteEditor.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type BlockNoteEditorOptions = {
|
|
|
38
38
|
slashCommands: BaseSlashMenuItem[];
|
|
39
39
|
parentElement: HTMLElement;
|
|
40
40
|
editorDOMAttributes: Record<string, string>;
|
|
41
|
-
|
|
41
|
+
onEditorReady: (editor: BlockNoteEditor) => void;
|
|
42
42
|
onEditorContentChange: (editor: BlockNoteEditor) => void;
|
|
43
43
|
onTextCursorPositionChange: (editor: BlockNoteEditor) => void;
|
|
44
44
|
|
|
@@ -75,7 +75,7 @@ export class BlockNoteEditor {
|
|
|
75
75
|
...blockNoteTipTapOptions,
|
|
76
76
|
...options._tiptapOptions,
|
|
77
77
|
onCreate: () => {
|
|
78
|
-
options.
|
|
78
|
+
options.onEditorReady?.(this);
|
|
79
79
|
},
|
|
80
80
|
onUpdate: () => {
|
|
81
81
|
options.onEditorContentChange?.(this);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DOMParser, DOMSerializer, Schema } from "prosemirror-model";
|
|
2
|
-
import { unified } from "unified";
|
|
3
2
|
import rehypeParse from "rehype-parse";
|
|
4
|
-
import rehypeStringify from "rehype-stringify";
|
|
5
3
|
import rehypeRemark from "rehype-remark";
|
|
4
|
+
import rehypeStringify from "rehype-stringify";
|
|
6
5
|
import remarkGfm from "remark-gfm";
|
|
7
|
-
import remarkStringify from "remark-stringify";
|
|
8
6
|
import remarkParse from "remark-parse";
|
|
9
7
|
import remarkRehype from "remark-rehype";
|
|
8
|
+
import remarkStringify from "remark-stringify";
|
|
9
|
+
import { unified } from "unified";
|
|
10
10
|
import { Block } from "../../extensions/Blocks/api/blockTypes";
|
|
11
11
|
import { blockToNode, nodeToBlock } from "../nodeConversions/nodeConversions";
|
|
12
|
-
import { simplifyBlocks } from "./simplifyBlocksRehypePlugin";
|
|
13
12
|
import { removeUnderlines } from "./removeUnderlinesRehypePlugin";
|
|
13
|
+
import { simplifyBlocks } from "./simplifyBlocksRehypePlugin";
|
|
14
14
|
|
|
15
15
|
export async function blocksToHTML(
|
|
16
16
|
blocks: Block[],
|
|
@@ -48,17 +48,17 @@ export const HeadingBlockContent = Node.create({
|
|
|
48
48
|
{
|
|
49
49
|
tag: "h1",
|
|
50
50
|
attrs: { level: "1" },
|
|
51
|
-
node: "
|
|
51
|
+
node: "heading",
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
tag: "h2",
|
|
55
55
|
attrs: { level: "2" },
|
|
56
|
-
node: "
|
|
56
|
+
node: "heading",
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
tag: "h3",
|
|
60
60
|
attrs: { level: "3" },
|
|
61
|
-
node: "
|
|
61
|
+
node: "heading",
|
|
62
62
|
},
|
|
63
63
|
];
|
|
64
64
|
},
|
|
@@ -53,7 +53,7 @@ export const BulletListItemBlockContent = Node.create({
|
|
|
53
53
|
|
|
54
54
|
return false;
|
|
55
55
|
},
|
|
56
|
-
node: "
|
|
56
|
+
node: "bulletListItem",
|
|
57
57
|
},
|
|
58
58
|
// Case for BlockNote list structure.
|
|
59
59
|
{
|
|
@@ -76,7 +76,7 @@ export const BulletListItemBlockContent = Node.create({
|
|
|
76
76
|
return false;
|
|
77
77
|
},
|
|
78
78
|
priority: 300,
|
|
79
|
-
node: "
|
|
79
|
+
node: "bulletListItem",
|
|
80
80
|
},
|
|
81
81
|
];
|
|
82
82
|
},
|
|
@@ -73,7 +73,7 @@ export const NumberedListItemBlockContent = Node.create({
|
|
|
73
73
|
|
|
74
74
|
return false;
|
|
75
75
|
},
|
|
76
|
-
node: "
|
|
76
|
+
node: "numberedListItem",
|
|
77
77
|
},
|
|
78
78
|
// Case for BlockNote list structure.
|
|
79
79
|
// (e.g.: when pasting from blocknote)
|
|
@@ -97,7 +97,7 @@ export const NumberedListItemBlockContent = Node.create({
|
|
|
97
97
|
return false;
|
|
98
98
|
},
|
|
99
99
|
priority: 300,
|
|
100
|
-
node: "
|
|
100
|
+
node: "numberedListItem",
|
|
101
101
|
},
|
|
102
102
|
];
|
|
103
103
|
},
|
|
@@ -10,7 +10,7 @@ export type BlockNoteEditorOptions = {
|
|
|
10
10
|
slashCommands: BaseSlashMenuItem[];
|
|
11
11
|
parentElement: HTMLElement;
|
|
12
12
|
editorDOMAttributes: Record<string, string>;
|
|
13
|
-
|
|
13
|
+
onEditorReady: (editor: BlockNoteEditor) => void;
|
|
14
14
|
onEditorContentChange: (editor: BlockNoteEditor) => void;
|
|
15
15
|
onTextCursorPositionChange: (editor: BlockNoteEditor) => void;
|
|
16
16
|
_tiptapOptions: any;
|