@blocknote/core 0.13.2 → 0.13.4
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 +5730 -2891
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +7 -7
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/exporters/html/__snapshots__/file/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/button/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -0
- package/src/api/exporters/html/externalHTMLExporter.ts +4 -3
- package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +1 -1
- package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +2 -2
- package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -0
- package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +10 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +3 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +6 -2
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +3 -0
- package/src/api/exporters/markdown/markdownExporter.ts +2 -0
- package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +42 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +262 -4
- package/src/api/parsers/html/__snapshots__/paste/list-test.json +74 -2
- package/src/api/parsers/html/__snapshots__/paste/parse-basic-block-types.json +3 -1
- package/src/api/parsers/html/__snapshots__/paste/parse-fake-image-caption.json +3 -1
- package/src/api/parsers/html/__snapshots__/paste/parse-mixed-nested-lists.json +135 -10
- package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +132 -7
- package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists.json +111 -3
- package/src/api/parsers/html/parseHTML.test.ts +166 -95
- package/src/api/testUtil/cases/customBlocks.ts +82 -33
- package/src/api/testUtil/cases/customInlineContent.ts +1 -1
- package/src/api/testUtil/cases/customStyles.ts +1 -1
- package/src/api/testUtil/cases/defaultSchema.ts +185 -4
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +163 -0
- package/src/blocks/AudioBlockContent/audioBlockHelpers.ts +5 -0
- package/src/blocks/FileBlockContent/FileBlockContent.ts +120 -0
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +377 -0
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +134 -354
- package/src/blocks/ImageBlockContent/imageBlockHelpers.ts +6 -0
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +3 -0
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +266 -0
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +2 -1
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +1 -0
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +181 -0
- package/src/blocks/VideoBlockContent/videoBlockHelpers.ts +6 -0
- package/src/blocks/defaultBlockTypeGuards.ts +53 -1
- package/src/blocks/defaultBlocks.ts +11 -2
- package/src/editor/Block.css +89 -27
- package/src/editor/BlockNoteEditor.ts +24 -10
- package/src/editor/BlockNoteSchema.ts +12 -3
- package/src/editor/transformPasted.ts +2 -1
- package/src/extensions/{ImagePanel/ImageToolbarPlugin.ts → FilePanel/FilePanelPlugin.ts} +22 -25
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +14 -2
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +72 -2
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +27 -27
- package/src/extensions/TextAlignment/TextAlignmentExtension.ts +7 -1
- package/src/i18n/locales/en.ts +117 -11
- package/src/i18n/locales/fr.ts +118 -11
- package/src/i18n/locales/index.ts +8 -2
- package/src/i18n/locales/is.ts +295 -0
- package/src/i18n/locales/ja.ts +323 -0
- package/src/i18n/locales/ko.ts +307 -0
- package/src/i18n/locales/nl.ts +108 -8
- package/src/i18n/locales/pl.ts +287 -0
- package/src/i18n/locales/pt.ts +295 -0
- package/src/i18n/locales/vi.ts +295 -0
- package/src/i18n/locales/zh.ts +123 -8
- package/src/index.ts +9 -2
- package/src/pm-nodes/BlockContainer.ts +18 -6
- package/src/schema/blocks/createSpec.ts +1 -0
- package/src/schema/blocks/internal.ts +10 -0
- package/src/schema/blocks/types.ts +40 -5
- package/src/util/string.ts +12 -0
- package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +7 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +272 -54
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +222 -16
- package/types/src/api/testUtil/cases/customStyles.d.ts +222 -16
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +101 -0
- package/types/src/blocks/AudioBlockContent/audioBlockHelpers.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +93 -0
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +30 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +50 -14
- package/types/src/blocks/ImageBlockContent/imageBlockHelpers.d.ts +4 -0
- package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +55 -0
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +129 -0
- package/types/src/blocks/VideoBlockContent/videoBlockHelpers.d.ts +4 -0
- package/types/src/blocks/defaultBlockTypeGuards.d.ts +6 -1
- package/types/src/blocks/defaultBlocks.d.ts +444 -32
- package/types/src/editor/BlockNoteEditor.d.ts +12 -5
- package/types/src/extensions/{ImagePanel/ImageToolbarPlugin.d.ts → FilePanel/FilePanelPlugin.d.ts} +9 -12
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
- package/types/src/i18n/locales/en.d.ts +56 -7
- package/types/src/i18n/locales/fr.d.ts +2 -184
- package/types/src/i18n/locales/index.d.ts +7 -1
- package/types/src/i18n/locales/is.d.ts +2 -0
- package/types/src/i18n/locales/ja.d.ts +2 -0
- package/types/src/i18n/locales/ko.d.ts +2 -0
- package/types/src/i18n/locales/pl.d.ts +2 -0
- package/types/src/i18n/locales/pt.d.ts +2 -0
- package/types/src/i18n/locales/vi.d.ts +2 -0
- package/types/src/index.d.ts +8 -2
- package/types/src/pm-nodes/BlockContainer.d.ts +1 -1
- package/types/src/schema/blocks/internal.d.ts +1 -1
- package/types/src/schema/blocks/types.d.ts +25 -1
- package/types/src/util/string.d.ts +1 -0
- /package/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
- /package/types/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
2
|
+
import { BlockFromConfig } from "../../schema";
|
|
3
|
+
export declare const filePropSchema: {
|
|
4
|
+
backgroundColor: {
|
|
5
|
+
default: "default";
|
|
6
|
+
};
|
|
7
|
+
name: {
|
|
8
|
+
default: "";
|
|
9
|
+
};
|
|
10
|
+
url: {
|
|
11
|
+
default: "";
|
|
12
|
+
};
|
|
13
|
+
caption: {
|
|
14
|
+
default: "";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const fileBlockConfig: {
|
|
18
|
+
type: "file";
|
|
19
|
+
propSchema: {
|
|
20
|
+
backgroundColor: {
|
|
21
|
+
default: "default";
|
|
22
|
+
};
|
|
23
|
+
name: {
|
|
24
|
+
default: "";
|
|
25
|
+
};
|
|
26
|
+
url: {
|
|
27
|
+
default: "";
|
|
28
|
+
};
|
|
29
|
+
caption: {
|
|
30
|
+
default: "";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
content: "none";
|
|
34
|
+
isFileBlock: true;
|
|
35
|
+
};
|
|
36
|
+
export declare const fileRender: (block: BlockFromConfig<typeof fileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
|
|
37
|
+
dom: HTMLDivElement;
|
|
38
|
+
destroy: () => void;
|
|
39
|
+
} | {
|
|
40
|
+
dom: HTMLDivElement;
|
|
41
|
+
destroy?: undefined;
|
|
42
|
+
};
|
|
43
|
+
export declare const fileParse: (element: HTMLElement) => {
|
|
44
|
+
url: string | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
caption: string | undefined;
|
|
47
|
+
url: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
export declare const fileToExternalHTML: (block: BlockFromConfig<typeof fileBlockConfig, any, any>) => {
|
|
50
|
+
dom: HTMLParagraphElement;
|
|
51
|
+
} | {
|
|
52
|
+
dom: HTMLAnchorElement;
|
|
53
|
+
};
|
|
54
|
+
export declare const FileBlock: {
|
|
55
|
+
config: {
|
|
56
|
+
type: "file";
|
|
57
|
+
propSchema: {
|
|
58
|
+
backgroundColor: {
|
|
59
|
+
default: "default";
|
|
60
|
+
};
|
|
61
|
+
name: {
|
|
62
|
+
default: "";
|
|
63
|
+
};
|
|
64
|
+
url: {
|
|
65
|
+
default: "";
|
|
66
|
+
};
|
|
67
|
+
caption: {
|
|
68
|
+
default: "";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
content: "none";
|
|
72
|
+
isFileBlock: true;
|
|
73
|
+
};
|
|
74
|
+
implementation: import("../../schema").TiptapBlockImplementation<{
|
|
75
|
+
type: "file";
|
|
76
|
+
propSchema: {
|
|
77
|
+
backgroundColor: {
|
|
78
|
+
default: "default";
|
|
79
|
+
};
|
|
80
|
+
name: {
|
|
81
|
+
default: "";
|
|
82
|
+
};
|
|
83
|
+
url: {
|
|
84
|
+
default: "";
|
|
85
|
+
};
|
|
86
|
+
caption: {
|
|
87
|
+
default: "";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
content: "none";
|
|
91
|
+
isFileBlock: true;
|
|
92
|
+
}, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
|
|
93
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
2
|
+
import { BlockFromConfig, FileBlockConfig } from "../../schema";
|
|
3
|
+
export declare const createDefaultFilePreview: (block: BlockFromConfig<FileBlockConfig, any, any>) => {
|
|
4
|
+
dom: HTMLElement;
|
|
5
|
+
destroy?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const createFileAndCaptionWrapper: (block: BlockFromConfig<FileBlockConfig, any, any>, file: HTMLElement) => {
|
|
8
|
+
dom: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
export declare const createAddFileButton: (block: BlockFromConfig<FileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>, buttonText?: string, buttonIcon?: HTMLElement) => {
|
|
11
|
+
dom: HTMLDivElement;
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const parseEmbedElement: (embedElement: HTMLEmbedElement) => {
|
|
15
|
+
url: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare const parseFigureElement: (figureElement: HTMLElement, targetTag: string) => {
|
|
18
|
+
targetElement: HTMLElement;
|
|
19
|
+
caption: string | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
export declare const createLinkWithCaption: (element: HTMLElement, caption: string) => {
|
|
22
|
+
dom: HTMLDivElement;
|
|
23
|
+
};
|
|
24
|
+
export declare const createFigureWithCaption: (element: HTMLElement, caption: string) => {
|
|
25
|
+
dom: HTMLElement;
|
|
26
|
+
};
|
|
27
|
+
export declare const createResizeHandlesWrapper: (block: BlockFromConfig<FileBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>, element: HTMLElement, getWidth: () => number, setWidth: (width: number) => void) => {
|
|
28
|
+
dom: HTMLElement;
|
|
29
|
+
destroy: () => void;
|
|
30
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
2
|
-
import { BlockFromConfig,
|
|
2
|
+
import { BlockFromConfig, Props } from "../../schema";
|
|
3
3
|
export declare const imagePropSchema: {
|
|
4
4
|
textAlignment: {
|
|
5
5
|
default: "left";
|
|
@@ -8,17 +8,23 @@ export declare const imagePropSchema: {
|
|
|
8
8
|
backgroundColor: {
|
|
9
9
|
default: "default";
|
|
10
10
|
};
|
|
11
|
+
name: {
|
|
12
|
+
default: "";
|
|
13
|
+
};
|
|
11
14
|
url: {
|
|
12
15
|
default: "";
|
|
13
16
|
};
|
|
14
17
|
caption: {
|
|
15
18
|
default: "";
|
|
16
19
|
};
|
|
17
|
-
|
|
18
|
-
default:
|
|
20
|
+
showPreview: {
|
|
21
|
+
default: true;
|
|
22
|
+
};
|
|
23
|
+
previewWidth: {
|
|
24
|
+
default: number;
|
|
19
25
|
};
|
|
20
26
|
};
|
|
21
|
-
declare const
|
|
27
|
+
export declare const imageBlockConfig: {
|
|
22
28
|
type: "image";
|
|
23
29
|
propSchema: {
|
|
24
30
|
textAlignment: {
|
|
@@ -28,23 +34,38 @@ declare const blockConfig: {
|
|
|
28
34
|
backgroundColor: {
|
|
29
35
|
default: "default";
|
|
30
36
|
};
|
|
37
|
+
name: {
|
|
38
|
+
default: "";
|
|
39
|
+
};
|
|
31
40
|
url: {
|
|
32
41
|
default: "";
|
|
33
42
|
};
|
|
34
43
|
caption: {
|
|
35
44
|
default: "";
|
|
36
45
|
};
|
|
37
|
-
|
|
38
|
-
default:
|
|
46
|
+
showPreview: {
|
|
47
|
+
default: true;
|
|
48
|
+
};
|
|
49
|
+
previewWidth: {
|
|
50
|
+
default: number;
|
|
39
51
|
};
|
|
40
52
|
};
|
|
41
53
|
content: "none";
|
|
54
|
+
isFileBlock: true;
|
|
55
|
+
fileBlockAcceptMimeTypes: string[];
|
|
42
56
|
};
|
|
43
|
-
export declare const
|
|
57
|
+
export declare const imageRender: (block: BlockFromConfig<typeof imageBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
|
|
44
58
|
dom: HTMLDivElement;
|
|
45
59
|
destroy: () => void;
|
|
60
|
+
} | {
|
|
61
|
+
dom: HTMLDivElement;
|
|
62
|
+
destroy?: undefined;
|
|
46
63
|
};
|
|
47
|
-
export declare const
|
|
64
|
+
export declare const imageParse: (element: HTMLElement) => Partial<Props<typeof imageBlockConfig.propSchema>> | undefined;
|
|
65
|
+
export declare const imageToExternalHTML: (block: BlockFromConfig<typeof imageBlockConfig, any, any>) => {
|
|
66
|
+
dom: HTMLElement;
|
|
67
|
+
};
|
|
68
|
+
export declare const ImageBlock: {
|
|
48
69
|
config: {
|
|
49
70
|
type: "image";
|
|
50
71
|
propSchema: {
|
|
@@ -55,17 +76,25 @@ export declare const Image: {
|
|
|
55
76
|
backgroundColor: {
|
|
56
77
|
default: "default";
|
|
57
78
|
};
|
|
79
|
+
name: {
|
|
80
|
+
default: "";
|
|
81
|
+
};
|
|
58
82
|
url: {
|
|
59
83
|
default: "";
|
|
60
84
|
};
|
|
61
85
|
caption: {
|
|
62
86
|
default: "";
|
|
63
87
|
};
|
|
64
|
-
|
|
65
|
-
default:
|
|
88
|
+
showPreview: {
|
|
89
|
+
default: true;
|
|
90
|
+
};
|
|
91
|
+
previewWidth: {
|
|
92
|
+
default: number;
|
|
66
93
|
};
|
|
67
94
|
};
|
|
68
95
|
content: "none";
|
|
96
|
+
isFileBlock: true;
|
|
97
|
+
fileBlockAcceptMimeTypes: string[];
|
|
69
98
|
};
|
|
70
99
|
implementation: import("../../schema").TiptapBlockImplementation<{
|
|
71
100
|
type: "image";
|
|
@@ -77,17 +106,24 @@ export declare const Image: {
|
|
|
77
106
|
backgroundColor: {
|
|
78
107
|
default: "default";
|
|
79
108
|
};
|
|
109
|
+
name: {
|
|
110
|
+
default: "";
|
|
111
|
+
};
|
|
80
112
|
url: {
|
|
81
113
|
default: "";
|
|
82
114
|
};
|
|
83
115
|
caption: {
|
|
84
116
|
default: "";
|
|
85
117
|
};
|
|
86
|
-
|
|
87
|
-
default:
|
|
118
|
+
showPreview: {
|
|
119
|
+
default: true;
|
|
120
|
+
};
|
|
121
|
+
previewWidth: {
|
|
122
|
+
default: number;
|
|
88
123
|
};
|
|
89
124
|
};
|
|
90
125
|
content: "none";
|
|
91
|
-
|
|
126
|
+
isFileBlock: true;
|
|
127
|
+
fileBlockAcceptMimeTypes: string[];
|
|
128
|
+
}, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
|
|
92
129
|
};
|
|
93
|
-
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const checkListItemPropSchema: {
|
|
2
|
+
checked: {
|
|
3
|
+
default: false;
|
|
4
|
+
};
|
|
5
|
+
backgroundColor: {
|
|
6
|
+
default: "default";
|
|
7
|
+
};
|
|
8
|
+
textColor: {
|
|
9
|
+
default: "default";
|
|
10
|
+
};
|
|
11
|
+
textAlignment: {
|
|
12
|
+
default: "left";
|
|
13
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const CheckListItem: {
|
|
17
|
+
config: {
|
|
18
|
+
type: "checkListItem";
|
|
19
|
+
content: "inline";
|
|
20
|
+
propSchema: {
|
|
21
|
+
checked: {
|
|
22
|
+
default: false;
|
|
23
|
+
};
|
|
24
|
+
backgroundColor: {
|
|
25
|
+
default: "default";
|
|
26
|
+
};
|
|
27
|
+
textColor: {
|
|
28
|
+
default: "default";
|
|
29
|
+
};
|
|
30
|
+
textAlignment: {
|
|
31
|
+
default: "left";
|
|
32
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
implementation: import("../../../schema").TiptapBlockImplementation<{
|
|
37
|
+
type: "checkListItem";
|
|
38
|
+
content: "inline";
|
|
39
|
+
propSchema: {
|
|
40
|
+
checked: {
|
|
41
|
+
default: false;
|
|
42
|
+
};
|
|
43
|
+
backgroundColor: {
|
|
44
|
+
default: "default";
|
|
45
|
+
};
|
|
46
|
+
textColor: {
|
|
47
|
+
default: "default";
|
|
48
|
+
};
|
|
49
|
+
textAlignment: {
|
|
50
|
+
default: "left";
|
|
51
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}, any, import("../../../schema").InlineContentSchema, import("../../../schema").StyleSchema>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
2
|
+
import { BlockFromConfig, Props } from "../../schema";
|
|
3
|
+
export declare const videoPropSchema: {
|
|
4
|
+
textAlignment: {
|
|
5
|
+
default: "left";
|
|
6
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
7
|
+
};
|
|
8
|
+
backgroundColor: {
|
|
9
|
+
default: "default";
|
|
10
|
+
};
|
|
11
|
+
name: {
|
|
12
|
+
default: "";
|
|
13
|
+
};
|
|
14
|
+
url: {
|
|
15
|
+
default: "";
|
|
16
|
+
};
|
|
17
|
+
caption: {
|
|
18
|
+
default: "";
|
|
19
|
+
};
|
|
20
|
+
showPreview: {
|
|
21
|
+
default: true;
|
|
22
|
+
};
|
|
23
|
+
previewWidth: {
|
|
24
|
+
default: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const videoBlockConfig: {
|
|
28
|
+
type: "video";
|
|
29
|
+
propSchema: {
|
|
30
|
+
textAlignment: {
|
|
31
|
+
default: "left";
|
|
32
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
33
|
+
};
|
|
34
|
+
backgroundColor: {
|
|
35
|
+
default: "default";
|
|
36
|
+
};
|
|
37
|
+
name: {
|
|
38
|
+
default: "";
|
|
39
|
+
};
|
|
40
|
+
url: {
|
|
41
|
+
default: "";
|
|
42
|
+
};
|
|
43
|
+
caption: {
|
|
44
|
+
default: "";
|
|
45
|
+
};
|
|
46
|
+
showPreview: {
|
|
47
|
+
default: true;
|
|
48
|
+
};
|
|
49
|
+
previewWidth: {
|
|
50
|
+
default: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
content: "none";
|
|
54
|
+
isFileBlock: true;
|
|
55
|
+
fileBlockAcceptMimeTypes: string[];
|
|
56
|
+
};
|
|
57
|
+
export declare const videoRender: (block: BlockFromConfig<typeof videoBlockConfig, any, any>, editor: BlockNoteEditor<any, any, any>) => {
|
|
58
|
+
dom: HTMLDivElement;
|
|
59
|
+
destroy: () => void;
|
|
60
|
+
} | {
|
|
61
|
+
dom: HTMLDivElement;
|
|
62
|
+
destroy?: undefined;
|
|
63
|
+
};
|
|
64
|
+
export declare const videoParse: (element: HTMLElement) => Partial<Props<typeof videoBlockConfig.propSchema>> | undefined;
|
|
65
|
+
export declare const videoToExternalHTML: (block: BlockFromConfig<typeof videoBlockConfig, any, any>) => {
|
|
66
|
+
dom: HTMLElement;
|
|
67
|
+
};
|
|
68
|
+
export declare const VideoBlock: {
|
|
69
|
+
config: {
|
|
70
|
+
type: "video";
|
|
71
|
+
propSchema: {
|
|
72
|
+
textAlignment: {
|
|
73
|
+
default: "left";
|
|
74
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
75
|
+
};
|
|
76
|
+
backgroundColor: {
|
|
77
|
+
default: "default";
|
|
78
|
+
};
|
|
79
|
+
name: {
|
|
80
|
+
default: "";
|
|
81
|
+
};
|
|
82
|
+
url: {
|
|
83
|
+
default: "";
|
|
84
|
+
};
|
|
85
|
+
caption: {
|
|
86
|
+
default: "";
|
|
87
|
+
};
|
|
88
|
+
showPreview: {
|
|
89
|
+
default: true;
|
|
90
|
+
};
|
|
91
|
+
previewWidth: {
|
|
92
|
+
default: number;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
content: "none";
|
|
96
|
+
isFileBlock: true;
|
|
97
|
+
fileBlockAcceptMimeTypes: string[];
|
|
98
|
+
};
|
|
99
|
+
implementation: import("../../schema").TiptapBlockImplementation<{
|
|
100
|
+
type: "video";
|
|
101
|
+
propSchema: {
|
|
102
|
+
textAlignment: {
|
|
103
|
+
default: "left";
|
|
104
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
105
|
+
};
|
|
106
|
+
backgroundColor: {
|
|
107
|
+
default: "default";
|
|
108
|
+
};
|
|
109
|
+
name: {
|
|
110
|
+
default: "";
|
|
111
|
+
};
|
|
112
|
+
url: {
|
|
113
|
+
default: "";
|
|
114
|
+
};
|
|
115
|
+
caption: {
|
|
116
|
+
default: "";
|
|
117
|
+
};
|
|
118
|
+
showPreview: {
|
|
119
|
+
default: true;
|
|
120
|
+
};
|
|
121
|
+
previewWidth: {
|
|
122
|
+
default: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
content: "none";
|
|
126
|
+
isFileBlock: true;
|
|
127
|
+
fileBlockAcceptMimeTypes: string[];
|
|
128
|
+
}, any, import("../../schema").InlineContentSchema, import("../../schema").StyleSchema>;
|
|
129
|
+
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { BlockNoteEditor } from "../editor/BlockNoteEditor";
|
|
2
|
-
import { BlockFromConfig, InlineContentSchema, StyleSchema } from "../schema";
|
|
2
|
+
import { BlockFromConfig, BlockSchema, FileBlockConfig, InlineContentSchema, StyleSchema } from "../schema";
|
|
3
3
|
import { Block, DefaultBlockSchema } from "./defaultBlocks";
|
|
4
4
|
import { defaultProps } from "./defaultProps";
|
|
5
5
|
export declare function checkDefaultBlockTypeInSchema<BlockType extends keyof DefaultBlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blockType: BlockType, editor: BlockNoteEditor<any, I, S>): editor is BlockNoteEditor<{
|
|
6
6
|
Type: DefaultBlockSchema[BlockType];
|
|
7
7
|
}, I, S>;
|
|
8
8
|
export declare function checkBlockIsDefaultType<BlockType extends keyof DefaultBlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blockType: BlockType, block: Block<any, I, S>, editor: BlockNoteEditor<any, I, S>): block is BlockFromConfig<DefaultBlockSchema[BlockType], I, S>;
|
|
9
|
+
export declare function checkBlockIsFileBlock<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(block: Block<any, I, S>, editor: BlockNoteEditor<B, I, S>): block is BlockFromConfig<FileBlockConfig, I, S>;
|
|
10
|
+
export declare function checkBlockIsFileBlockWithPreview<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(block: Block<any, I, S>, editor: BlockNoteEditor<B, I, S>): block is BlockFromConfig<FileBlockConfig & {
|
|
11
|
+
propSchema: Required<FileBlockConfig["propSchema"]>;
|
|
12
|
+
}, I, S>;
|
|
13
|
+
export declare function checkBlockIsFileBlockWithPlaceholder<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(block: Block<B, I, S>, editor: BlockNoteEditor<B, I, S>): boolean | undefined;
|
|
9
14
|
export declare function checkBlockTypeHasDefaultProp<Prop extends keyof typeof defaultProps, I extends InlineContentSchema, S extends StyleSchema>(prop: Prop, blockType: string, editor: BlockNoteEditor<any, I, S>): editor is BlockNoteEditor<{
|
|
10
15
|
[BT in string]: {
|
|
11
16
|
type: BT;
|