@blocknote/core 0.23.6 → 0.24.0
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 +676 -542
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +492 -0
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +6 -0
- package/src/api/nodeConversions/blockToNode.ts +5 -3
- package/src/api/nodeConversions/nodeToBlock.ts +11 -5
- package/src/editor/BlockNoteEditor.ts +21 -6
- package/src/editor/BlockNoteExtensions.ts +9 -4
- package/src/editor/BlockNoteTipTapEditor.ts +37 -36
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +69 -54
- package/src/i18n/locales/ar.ts +3 -0
- package/src/i18n/locales/de.ts +3 -0
- package/src/i18n/locales/en.ts +4 -1
- package/src/i18n/locales/es.ts +3 -0
- package/src/i18n/locales/fr.ts +3 -0
- package/src/i18n/locales/hr.ts +3 -0
- package/src/i18n/locales/is.ts +3 -0
- package/src/i18n/locales/it.ts +316 -314
- package/src/i18n/locales/ja.ts +3 -0
- package/src/i18n/locales/ko.ts +3 -0
- package/src/i18n/locales/nl.ts +3 -0
- package/src/i18n/locales/pl.ts +3 -0
- package/src/i18n/locales/pt.ts +3 -0
- package/src/i18n/locales/ru.ts +3 -0
- package/src/i18n/locales/uk.ts +337 -278
- package/src/i18n/locales/vi.ts +3 -0
- package/src/i18n/locales/zh.ts +3 -0
- package/types/src/editor/BlockNoteEditor.d.ts +2 -2
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +1 -2
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +1 -1
- package/types/src/i18n/locales/de.d.ts +3 -0
- package/types/src/i18n/locales/en.d.ts +4 -7
- package/types/src/i18n/locales/es.d.ts +3 -0
- package/types/src/i18n/locales/hr.d.ts +3 -0
- package/types/src/i18n/locales/it.d.ts +3 -0
package/src/i18n/locales/zh.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends
|
|
|
40
40
|
/**
|
|
41
41
|
* @deprecated, provide placeholders via dictionary instead
|
|
42
42
|
*/
|
|
43
|
-
placeholders: Record<string | "default", string>;
|
|
43
|
+
placeholders: Record<string | "default" | "emptyDocument", string | undefined>;
|
|
44
44
|
/**
|
|
45
45
|
* An object containing attributes that should be added to HTML elements of the editor.
|
|
46
46
|
*
|
|
@@ -224,7 +224,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
224
224
|
*
|
|
225
225
|
* @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
|
|
226
226
|
*/
|
|
227
|
-
mount: (parentElement?: HTMLElement | null) => void;
|
|
227
|
+
mount: (parentElement?: HTMLElement | null, contentComponent?: any) => void;
|
|
228
228
|
get prosemirrorView(): EditorView | undefined;
|
|
229
229
|
get domElement(): HTMLDivElement | undefined;
|
|
230
230
|
isFocused(): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "prosemirror-state";
|
|
2
2
|
import * as Y from "yjs";
|
|
3
|
-
import type { BlockNoteEditor, BlockNoteExtension } from "./BlockNoteEditor.js";
|
|
4
3
|
import { BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema/index.js";
|
|
4
|
+
import type { BlockNoteEditor, BlockNoteExtension } from "./BlockNoteEditor.js";
|
|
5
5
|
type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
6
6
|
editor: BlockNoteEditor<BSchema, I, S>;
|
|
7
7
|
domAttributes: Partial<BlockNoteDOMAttributes>;
|
|
@@ -25,7 +25,7 @@ type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema
|
|
|
25
25
|
animations: boolean;
|
|
26
26
|
tableHandles: boolean;
|
|
27
27
|
dropCursor: (opts: any) => Plugin;
|
|
28
|
-
placeholders: Record<string | "default", string>;
|
|
28
|
+
placeholders: Record<string | "default" | "emptyDocument", string | undefined>;
|
|
29
29
|
tabBehavior?: "prefer-navigate-ui" | "prefer-indent";
|
|
30
30
|
sideMenuDetection: "viewport" | "editor";
|
|
31
31
|
};
|
|
@@ -12,7 +12,6 @@ export type BlockNoteTipTapEditorOptions = Partial<Omit<EditorOptions, "content"
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class BlockNoteTipTapEditor extends TiptapEditor {
|
|
14
14
|
private _state;
|
|
15
|
-
private _creating;
|
|
16
15
|
static create: (options: BlockNoteTipTapEditorOptions, styleSchema: StyleSchema) => BlockNoteTipTapEditor;
|
|
17
16
|
protected constructor(options: BlockNoteTipTapEditorOptions, styleSchema: StyleSchema);
|
|
18
17
|
get state(): EditorState;
|
|
@@ -26,5 +25,5 @@ export declare class BlockNoteTipTapEditor extends TiptapEditor {
|
|
|
26
25
|
*
|
|
27
26
|
* @param element DOM element to mount to, ur null / undefined to destroy
|
|
28
27
|
*/
|
|
29
|
-
mount: (element?: HTMLElement | null) => void;
|
|
28
|
+
mount: (element?: HTMLElement | null, contentComponent?: any) => void;
|
|
30
29
|
}
|
|
@@ -2,5 +2,5 @@ import { Plugin } from "prosemirror-state";
|
|
|
2
2
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
3
3
|
export declare class PlaceholderPlugin {
|
|
4
4
|
readonly plugin: Plugin;
|
|
5
|
-
constructor(editor: BlockNoteEditor<any, any, any>, placeholders: Record<string | "default", string>);
|
|
5
|
+
constructor(editor: BlockNoteEditor<any, any, any>, placeholders: Record<string | "default" | "emptyDocument", string | undefined>);
|
|
6
6
|
}
|
|
@@ -91,13 +91,7 @@ export declare const en: {
|
|
|
91
91
|
group: string;
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
placeholders:
|
|
95
|
-
default: string;
|
|
96
|
-
heading: string;
|
|
97
|
-
bulletListItem: string;
|
|
98
|
-
numberedListItem: string;
|
|
99
|
-
checkListItem: string;
|
|
100
|
-
};
|
|
94
|
+
placeholders: Record<string, string | undefined>;
|
|
101
95
|
file_blocks: {
|
|
102
96
|
image: {
|
|
103
97
|
add_button_text: string;
|
|
@@ -216,6 +210,9 @@ export declare const en: {
|
|
|
216
210
|
align_justify: {
|
|
217
211
|
tooltip: string;
|
|
218
212
|
};
|
|
213
|
+
comment: {
|
|
214
|
+
tooltip: string;
|
|
215
|
+
};
|
|
219
216
|
};
|
|
220
217
|
file_panel: {
|
|
221
218
|
upload: {
|