@blocknote/core 0.41.1 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BlockNoteSchema-Bi-eeHal.js +3288 -0
- package/dist/BlockNoteSchema-Bi-eeHal.js.map +1 -0
- package/dist/BlockNoteSchema-DjDaA2C3.cjs +6 -0
- package/dist/BlockNoteSchema-DjDaA2C3.cjs.map +1 -0
- package/dist/blockToNode-DIfPWLH8.js +1140 -0
- package/dist/blockToNode-DIfPWLH8.js.map +1 -0
- package/dist/blockToNode-w7H99R6p.cjs +7 -0
- package/dist/blockToNode-w7H99R6p.cjs.map +1 -0
- package/dist/blocknote.cjs +4 -4
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +1413 -1366
- package/dist/blocknote.js.map +1 -1
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +1 -1
- package/dist/comments.cjs +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js +49 -49
- package/dist/comments.js.map +1 -1
- package/dist/en-Cl87Uuyf.cjs.map +1 -1
- package/dist/en-njEqD7AG.js.map +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/webpack-stats.json +1 -1
- package/dist/yjs.cjs +2 -0
- package/dist/yjs.cjs.map +1 -0
- package/dist/yjs.js +44 -0
- package/dist/yjs.js.map +1 -0
- package/package.json +30 -25
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +19 -6
- package/src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.ts +173 -0
- package/src/api/nodeConversions/nodeToBlock.ts +17 -14
- package/src/blocks/Code/block.ts +1 -0
- package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +2 -1
- package/src/blocks/defaultBlockTypeGuards.ts +7 -18
- package/src/comments/threadstore/yjs/YjsThreadStoreBase.ts +3 -1
- package/src/editor/BlockNoteEditor.test.ts +70 -1
- package/src/editor/BlockNoteEditor.ts +55 -4
- package/src/editor/managers/ExportManager.ts +1 -1
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +2 -2
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +2 -2
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
- package/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts +10 -3
- package/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.ts +130 -0
- package/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts +34 -21
- package/src/extensions/Comments/CommentsPlugin.ts +37 -7
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +30 -128
- package/src/extensions/SideMenu/SideMenuPlugin.ts +2 -0
- package/src/index.ts +1 -0
- package/src/schema/inlineContent/createSpec.ts +3 -0
- package/src/schema/inlineContent/types.ts +1 -0
- package/src/schema/schema.ts +49 -6
- package/src/schema/styles/createSpec.ts +6 -0
- package/src/schema/styles/types.ts +1 -0
- package/src/yjs/index.ts +1 -0
- package/src/yjs/utils.test.ts +1023 -0
- package/src/yjs/utils.ts +150 -0
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +1 -1
- package/types/src/api/blockManipulation/commands/replaceBlocks/util/fixColumnList.d.ts +32 -0
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +1 -1
- package/types/src/editor/BlockNoteEditor.d.ts +6 -1
- package/types/src/editor/managers/ExportManager.d.ts +1 -1
- package/types/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.d.ts +1 -0
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +1 -1
- package/types/src/index.d.ts +1 -0
- package/types/src/schema/inlineContent/createSpec.d.ts +1 -0
- package/types/src/schema/inlineContent/types.d.ts +1 -0
- package/types/src/schema/styles/createSpec.d.ts +1 -0
- package/types/src/schema/styles/types.d.ts +1 -0
- package/types/src/yjs/index.d.ts +1 -0
- package/types/src/yjs/utils.d.ts +55 -0
- package/types/src/yjs/utils.test.d.ts +1 -0
- package/dist/BlockNoteSchema-COA0fsXW.cjs +0 -11
- package/dist/BlockNoteSchema-COA0fsXW.cjs.map +0 -1
- package/dist/BlockNoteSchema-CYRHak18.js +0 -4375
- package/dist/BlockNoteSchema-CYRHak18.js.map +0 -1
- package/src/extensions/BackgroundColor/BackgroundColorMark.ts +0 -46
- package/src/extensions/TextColor/TextColorMark.ts +0 -38
- package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +0 -10
- package/types/src/extensions/TextColor/TextColorMark.d.ts +0 -10
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Mark } from "@tiptap/core";
|
|
2
|
-
import { createStyleSpecFromTipTapMark } from "../../schema/index.js";
|
|
3
|
-
import { getBackgroundColorAttribute } from "../../blocks/defaultProps.js";
|
|
4
|
-
|
|
5
|
-
const BackgroundColorMark = Mark.create({
|
|
6
|
-
name: "backgroundColor",
|
|
7
|
-
|
|
8
|
-
addAttributes() {
|
|
9
|
-
return {
|
|
10
|
-
stringValue: getBackgroundColorAttribute("stringValue"),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
parseHTML() {
|
|
15
|
-
return [
|
|
16
|
-
{
|
|
17
|
-
tag: "span",
|
|
18
|
-
getAttrs: (element) => {
|
|
19
|
-
if (typeof element === "string") {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
element.hasAttribute("data-background-color") ||
|
|
25
|
-
element.style.backgroundColor
|
|
26
|
-
) {
|
|
27
|
-
return {
|
|
28
|
-
stringValue: element.getAttribute("data-background-color"),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return false;
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
renderHTML({ HTMLAttributes }) {
|
|
39
|
-
return ["span", HTMLAttributes, 0];
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export const BackgroundColor = createStyleSpecFromTipTapMark(
|
|
44
|
-
BackgroundColorMark,
|
|
45
|
-
"string",
|
|
46
|
-
);
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Mark } from "@tiptap/core";
|
|
2
|
-
import { createStyleSpecFromTipTapMark } from "../../schema/index.js";
|
|
3
|
-
import { getTextColorAttribute } from "../../blocks/defaultProps.js";
|
|
4
|
-
|
|
5
|
-
const TextColorMark = Mark.create({
|
|
6
|
-
name: "textColor",
|
|
7
|
-
|
|
8
|
-
addAttributes() {
|
|
9
|
-
return {
|
|
10
|
-
stringValue: getTextColorAttribute("stringValue"),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
parseHTML() {
|
|
15
|
-
return [
|
|
16
|
-
{
|
|
17
|
-
tag: "span",
|
|
18
|
-
getAttrs: (element) => {
|
|
19
|
-
if (typeof element === "string") {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (element.hasAttribute("data-text-color") || element.style.color) {
|
|
24
|
-
return {};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return false;
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
renderHTML({ HTMLAttributes }) {
|
|
34
|
-
return ["span", HTMLAttributes, 0];
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const TextColor = createStyleSpecFromTipTapMark(TextColorMark, "string");
|