@blocknote/core 0.13.2 → 0.13.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 +5282 -2785
- 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__/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/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__/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/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +212 -4
- 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/testUtil/cases/customBlocks.ts +79 -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 +114 -4
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +162 -0
- package/src/blocks/AudioBlockContent/audioBlockHelpers.ts +5 -0
- package/src/blocks/FileBlockContent/FileBlockContent.ts +121 -0
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +377 -0
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +135 -356
- package/src/blocks/ImageBlockContent/imageBlockHelpers.ts +6 -0
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +182 -0
- package/src/blocks/VideoBlockContent/videoBlockHelpers.ts +6 -0
- package/src/blocks/defaultBlockTypeGuards.ts +53 -1
- package/src/blocks/defaultBlocks.ts +8 -2
- package/src/editor/Block.css +67 -27
- package/src/editor/BlockNoteEditor.ts +14 -10
- package/src/editor/BlockNoteSchema.ts +12 -3
- 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 +59 -2
- package/src/i18n/locales/en.ts +102 -11
- package/src/i18n/locales/fr.ts +104 -11
- package/src/i18n/locales/index.ts +8 -2
- package/src/i18n/locales/is.ts +288 -0
- package/src/i18n/locales/ja.ts +300 -0
- package/src/i18n/locales/ko.ts +292 -0
- package/src/i18n/locales/nl.ts +101 -8
- package/src/i18n/locales/pl.ts +280 -0
- package/src/i18n/locales/pt.ts +281 -0
- package/src/i18n/locales/vi.ts +281 -0
- package/src/i18n/locales/zh.ts +107 -8
- package/src/index.ts +9 -2
- package/src/pm-nodes/BlockContainer.ts +2 -2
- package/src/schema/blocks/createSpec.ts +1 -0
- package/src/schema/blocks/internal.ts +10 -0
- package/src/schema/blocks/types.ts +41 -5
- package/src/util/string.ts +12 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +228 -42
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +178 -4
- package/types/src/api/testUtil/cases/customStyles.d.ts +178 -4
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +104 -0
- package/types/src/blocks/AudioBlockContent/audioBlockHelpers.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +96 -0
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +30 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +53 -14
- package/types/src/blocks/ImageBlockContent/imageBlockHelpers.d.ts +4 -0
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +132 -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 +356 -8
- package/types/src/editor/BlockNoteEditor.d.ts +5 -5
- package/types/src/extensions/{ImagePanel/ImageToolbarPlugin.d.ts → FilePanel/FilePanelPlugin.d.ts} +9 -12
- package/types/src/i18n/locales/en.d.ts +49 -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/schema/blocks/internal.d.ts +1 -1
- package/types/src/schema/blocks/types.d.ts +26 -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
|
@@ -1,184 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
heading: {
|
|
4
|
-
title: string;
|
|
5
|
-
subtext: string;
|
|
6
|
-
aliases: string[];
|
|
7
|
-
group: string;
|
|
8
|
-
};
|
|
9
|
-
heading_2: {
|
|
10
|
-
title: string;
|
|
11
|
-
subtext: string;
|
|
12
|
-
aliases: string[];
|
|
13
|
-
group: string;
|
|
14
|
-
};
|
|
15
|
-
heading_3: {
|
|
16
|
-
title: string;
|
|
17
|
-
subtext: string;
|
|
18
|
-
aliases: string[];
|
|
19
|
-
group: string;
|
|
20
|
-
};
|
|
21
|
-
numbered_list: {
|
|
22
|
-
title: string;
|
|
23
|
-
subtext: string;
|
|
24
|
-
aliases: string[];
|
|
25
|
-
group: string;
|
|
26
|
-
};
|
|
27
|
-
bullet_list: {
|
|
28
|
-
title: string;
|
|
29
|
-
subtext: string;
|
|
30
|
-
aliases: string[];
|
|
31
|
-
group: string;
|
|
32
|
-
};
|
|
33
|
-
paragraph: {
|
|
34
|
-
title: string;
|
|
35
|
-
subtext: string;
|
|
36
|
-
aliases: string[];
|
|
37
|
-
group: string;
|
|
38
|
-
};
|
|
39
|
-
table: {
|
|
40
|
-
title: string;
|
|
41
|
-
subtext: string;
|
|
42
|
-
aliases: string[];
|
|
43
|
-
group: string;
|
|
44
|
-
};
|
|
45
|
-
image: {
|
|
46
|
-
title: string;
|
|
47
|
-
subtext: string;
|
|
48
|
-
aliases: string[];
|
|
49
|
-
group: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
placeholders: {
|
|
53
|
-
default: string;
|
|
54
|
-
heading: string;
|
|
55
|
-
bulletListItem: string;
|
|
56
|
-
numberedListItem: string;
|
|
57
|
-
};
|
|
58
|
-
image: {
|
|
59
|
-
add_button: string;
|
|
60
|
-
};
|
|
61
|
-
side_menu: {
|
|
62
|
-
add_block_label: string;
|
|
63
|
-
drag_handle_label: string;
|
|
64
|
-
};
|
|
65
|
-
drag_handle: {
|
|
66
|
-
delete_menuitem: string;
|
|
67
|
-
colors_menuitem: string;
|
|
68
|
-
};
|
|
69
|
-
table_handle: {
|
|
70
|
-
delete_column_menuitem: string;
|
|
71
|
-
delete_row_menuitem: string;
|
|
72
|
-
add_left_menuitem: string;
|
|
73
|
-
add_right_menuitem: string;
|
|
74
|
-
add_above_menuitem: string;
|
|
75
|
-
add_below_menuitem: string;
|
|
76
|
-
};
|
|
77
|
-
suggestion_menu: {
|
|
78
|
-
no_items_title: string;
|
|
79
|
-
loading: string;
|
|
80
|
-
};
|
|
81
|
-
color_picker: {
|
|
82
|
-
text_title: string;
|
|
83
|
-
background_title: string;
|
|
84
|
-
colors: {
|
|
85
|
-
default: string;
|
|
86
|
-
gray: string;
|
|
87
|
-
brown: string;
|
|
88
|
-
red: string;
|
|
89
|
-
orange: string;
|
|
90
|
-
yellow: string;
|
|
91
|
-
green: string;
|
|
92
|
-
blue: string;
|
|
93
|
-
purple: string;
|
|
94
|
-
pink: string;
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
formatting_toolbar: {
|
|
98
|
-
bold: {
|
|
99
|
-
tooltip: string;
|
|
100
|
-
secondary_tooltip: string;
|
|
101
|
-
};
|
|
102
|
-
italic: {
|
|
103
|
-
tooltip: string;
|
|
104
|
-
secondary_tooltip: string;
|
|
105
|
-
};
|
|
106
|
-
underline: {
|
|
107
|
-
tooltip: string;
|
|
108
|
-
secondary_tooltip: string;
|
|
109
|
-
};
|
|
110
|
-
strike: {
|
|
111
|
-
tooltip: string;
|
|
112
|
-
secondary_tooltip: string;
|
|
113
|
-
};
|
|
114
|
-
code: {
|
|
115
|
-
tooltip: string;
|
|
116
|
-
secondary_tooltip: string;
|
|
117
|
-
};
|
|
118
|
-
colors: {
|
|
119
|
-
tooltip: string;
|
|
120
|
-
};
|
|
121
|
-
link: {
|
|
122
|
-
tooltip: string;
|
|
123
|
-
secondary_tooltip: string;
|
|
124
|
-
};
|
|
125
|
-
image_caption: {
|
|
126
|
-
tooltip: string;
|
|
127
|
-
input_placeholder: string;
|
|
128
|
-
};
|
|
129
|
-
image_replace: {
|
|
130
|
-
tooltip: string;
|
|
131
|
-
};
|
|
132
|
-
nest: {
|
|
133
|
-
tooltip: string;
|
|
134
|
-
secondary_tooltip: string;
|
|
135
|
-
};
|
|
136
|
-
unnest: {
|
|
137
|
-
tooltip: string;
|
|
138
|
-
secondary_tooltip: string;
|
|
139
|
-
};
|
|
140
|
-
align_left: {
|
|
141
|
-
tooltip: string;
|
|
142
|
-
};
|
|
143
|
-
align_center: {
|
|
144
|
-
tooltip: string;
|
|
145
|
-
};
|
|
146
|
-
align_right: {
|
|
147
|
-
tooltip: string;
|
|
148
|
-
};
|
|
149
|
-
align_justify: {
|
|
150
|
-
tooltip: string;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
image_panel: {
|
|
154
|
-
upload: {
|
|
155
|
-
title: string;
|
|
156
|
-
file_placeholder: string;
|
|
157
|
-
upload_error: string;
|
|
158
|
-
};
|
|
159
|
-
embed: {
|
|
160
|
-
title: string;
|
|
161
|
-
embed_button: string;
|
|
162
|
-
url_placeholder: string;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
link_toolbar: {
|
|
166
|
-
delete: {
|
|
167
|
-
tooltip: string;
|
|
168
|
-
};
|
|
169
|
-
edit: {
|
|
170
|
-
text: string;
|
|
171
|
-
tooltip: string;
|
|
172
|
-
};
|
|
173
|
-
open: {
|
|
174
|
-
tooltip: string;
|
|
175
|
-
};
|
|
176
|
-
form: {
|
|
177
|
-
title_placeholder: string;
|
|
178
|
-
url_placeholder: string;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
generic: {
|
|
182
|
-
ctrl_shortcut: string;
|
|
183
|
-
};
|
|
184
|
-
};
|
|
1
|
+
import { Dictionary } from "../dictionary";
|
|
2
|
+
export declare const fr: Dictionary;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export * from "./en";
|
|
2
|
+
export * from "./fr";
|
|
3
|
+
export * from "./is";
|
|
4
|
+
export * from "./ja";
|
|
5
|
+
export * from "./ko";
|
|
2
6
|
export * from "./nl";
|
|
7
|
+
export * from "./pl";
|
|
8
|
+
export * from "./pt";
|
|
9
|
+
export * from "./vi";
|
|
3
10
|
export * from "./zh";
|
|
4
|
-
export * from "./fr";
|
package/types/src/index.d.ts
CHANGED
|
@@ -2,7 +2,12 @@ import * as locales from "./i18n/locales";
|
|
|
2
2
|
export * from "./api/exporters/html/externalHTMLExporter";
|
|
3
3
|
export * from "./api/exporters/html/internalHTMLSerializer";
|
|
4
4
|
export * from "./api/testUtil";
|
|
5
|
-
export * from "./blocks/
|
|
5
|
+
export * from "./blocks/FileBlockContent/FileBlockContent";
|
|
6
|
+
export * from "./blocks/ImageBlockContent/ImageBlockContent";
|
|
7
|
+
export * from "./blocks/VideoBlockContent/VideoBlockContent";
|
|
8
|
+
export * from "./blocks/AudioBlockContent/AudioBlockContent";
|
|
9
|
+
export * from "./blocks/FileBlockContent/fileBlockHelpers";
|
|
10
|
+
export * from "./blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY";
|
|
6
11
|
export * from "./blocks/defaultBlockTypeGuards";
|
|
7
12
|
export * from "./blocks/defaultBlocks";
|
|
8
13
|
export * from "./blocks/defaultProps";
|
|
@@ -11,8 +16,8 @@ export * from "./editor/BlockNoteExtensions";
|
|
|
11
16
|
export * from "./editor/BlockNoteSchema";
|
|
12
17
|
export * from "./editor/selectionTypes";
|
|
13
18
|
export * from "./extensions-shared/UiElementPosition";
|
|
19
|
+
export * from "./extensions/FilePanel/FilePanelPlugin";
|
|
14
20
|
export * from "./extensions/FormattingToolbar/FormattingToolbarPlugin";
|
|
15
|
-
export * from "./extensions/ImagePanel/ImageToolbarPlugin";
|
|
16
21
|
export * from "./extensions/LinkToolbar/LinkToolbarPlugin";
|
|
17
22
|
export * from "./extensions/SideMenu/SideMenuPlugin";
|
|
18
23
|
export * from "./extensions/SuggestionMenu/DefaultSuggestionItem";
|
|
@@ -28,3 +33,4 @@ export * from "./extensions/UniqueID/UniqueID";
|
|
|
28
33
|
export * from "./i18n/dictionary";
|
|
29
34
|
export { UnreachableCaseError, assertEmpty } from "./util/typescript";
|
|
30
35
|
export { locales };
|
|
36
|
+
export { parseImageElement } from "./blocks/ImageBlockContent/imageBlockHelpers";
|
|
@@ -10,7 +10,7 @@ export declare function wrapInBlockStructure<BType extends string, PSchema exten
|
|
|
10
10
|
dom: HTMLElement;
|
|
11
11
|
contentDOM?: HTMLElement;
|
|
12
12
|
destroy?: () => void;
|
|
13
|
-
}, blockType: BType, blockProps: Props<PSchema>, propSchema: PSchema, domAttributes?: Record<string, string>): {
|
|
13
|
+
}, blockType: BType, blockProps: Props<PSchema>, propSchema: PSchema, isFileBlock?: boolean, domAttributes?: Record<string, string>): {
|
|
14
14
|
dom: HTMLElement;
|
|
15
15
|
contentDOM?: HTMLElement;
|
|
16
16
|
destroy?: () => void;
|
|
@@ -8,11 +8,36 @@ export type BlockNoteDOMElement = "editor" | "block" | "blockGroup" | "blockCont
|
|
|
8
8
|
export type BlockNoteDOMAttributes = Partial<{
|
|
9
9
|
[DOMElement in BlockNoteDOMElement]: Record<string, string>;
|
|
10
10
|
}>;
|
|
11
|
+
export type FileBlockConfig = {
|
|
12
|
+
type: string;
|
|
13
|
+
readonly propSchema: PropSchema & {
|
|
14
|
+
caption: {
|
|
15
|
+
default: "";
|
|
16
|
+
};
|
|
17
|
+
name: {
|
|
18
|
+
default: "";
|
|
19
|
+
};
|
|
20
|
+
url?: {
|
|
21
|
+
default: "";
|
|
22
|
+
};
|
|
23
|
+
showPreview?: {
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
previewWidth?: {
|
|
27
|
+
default: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
content: "none";
|
|
31
|
+
isFileBlock: true;
|
|
32
|
+
isFileBlockPlaceholder: (block: any) => boolean;
|
|
33
|
+
fileBlockAcceptMimeTypes?: string[];
|
|
34
|
+
};
|
|
11
35
|
export type BlockConfig = {
|
|
12
36
|
type: string;
|
|
13
37
|
readonly propSchema: PropSchema;
|
|
14
38
|
content: "inline" | "none" | "table";
|
|
15
|
-
|
|
39
|
+
isFileBlock?: false;
|
|
40
|
+
} | FileBlockConfig;
|
|
16
41
|
export type TiptapBlockImplementation<T extends BlockConfig, B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
17
42
|
requiredExtensions?: Array<Extension | Node>;
|
|
18
43
|
node: Node;
|
/package/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.ts
RENAMED
|
File without changes
|
|
File without changes
|