@blocknote/core 0.23.5 → 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.
Files changed (44) hide show
  1. package/dist/blocknote.js +750 -610
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +6 -6
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +3 -3
  8. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +492 -0
  9. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +6 -0
  10. package/src/api/clipboard/toClipboard/copyExtension.ts +37 -2
  11. package/src/api/nodeConversions/blockToNode.ts +5 -3
  12. package/src/api/nodeConversions/nodeToBlock.ts +11 -5
  13. package/src/blocks/TableBlockContent/TableBlockContent.ts +2 -1
  14. package/src/editor/BlockNoteEditor.ts +21 -6
  15. package/src/editor/BlockNoteExtensions.ts +9 -4
  16. package/src/editor/BlockNoteTipTapEditor.ts +37 -36
  17. package/src/extensions/Placeholder/PlaceholderPlugin.ts +69 -54
  18. package/src/extensions/SideMenu/dragging.ts +2 -5
  19. package/src/i18n/locales/ar.ts +3 -0
  20. package/src/i18n/locales/de.ts +3 -0
  21. package/src/i18n/locales/en.ts +4 -1
  22. package/src/i18n/locales/es.ts +3 -0
  23. package/src/i18n/locales/fr.ts +3 -0
  24. package/src/i18n/locales/hr.ts +3 -0
  25. package/src/i18n/locales/is.ts +3 -0
  26. package/src/i18n/locales/it.ts +316 -314
  27. package/src/i18n/locales/ja.ts +3 -0
  28. package/src/i18n/locales/ko.ts +3 -0
  29. package/src/i18n/locales/nl.ts +3 -0
  30. package/src/i18n/locales/pl.ts +3 -0
  31. package/src/i18n/locales/pt.ts +3 -0
  32. package/src/i18n/locales/ru.ts +3 -0
  33. package/src/i18n/locales/uk.ts +337 -278
  34. package/src/i18n/locales/vi.ts +3 -0
  35. package/src/i18n/locales/zh.ts +3 -0
  36. package/types/src/editor/BlockNoteEditor.d.ts +2 -2
  37. package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
  38. package/types/src/editor/BlockNoteTipTapEditor.d.ts +1 -2
  39. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +1 -1
  40. package/types/src/i18n/locales/de.d.ts +3 -0
  41. package/types/src/i18n/locales/en.d.ts +4 -7
  42. package/types/src/i18n/locales/es.d.ts +3 -0
  43. package/types/src/i18n/locales/hr.d.ts +3 -0
  44. package/types/src/i18n/locales/it.d.ts +3 -0
@@ -309,6 +309,9 @@ export const zh: Dictionary = {
309
309
  align_justify: {
310
310
  tooltip: "文本对齐",
311
311
  },
312
+ comment: {
313
+ tooltip: "添加评论",
314
+ },
312
315
  },
313
316
  file_panel: {
314
317
  upload: {
@@ -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
  }
@@ -241,6 +241,9 @@ export declare const de: {
241
241
  align_justify: {
242
242
  tooltip: string;
243
243
  };
244
+ comment: {
245
+ tooltip: string;
246
+ };
244
247
  };
245
248
  file_panel: {
246
249
  upload: {
@@ -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: {
@@ -216,6 +216,9 @@ export declare const es: {
216
216
  align_justify: {
217
217
  tooltip: string;
218
218
  };
219
+ comment: {
220
+ tooltip: string;
221
+ };
219
222
  };
220
223
  file_panel: {
221
224
  upload: {
@@ -210,6 +210,9 @@ export declare const hr: {
210
210
  align_justify: {
211
211
  tooltip: string;
212
212
  };
213
+ comment: {
214
+ tooltip: string;
215
+ };
213
216
  };
214
217
  file_panel: {
215
218
  upload: {
@@ -210,6 +210,9 @@ export declare const it: {
210
210
  align_justify: {
211
211
  tooltip: string;
212
212
  };
213
+ comment: {
214
+ tooltip: string;
215
+ };
213
216
  };
214
217
  file_panel: {
215
218
  upload: {