@blocknote/core 0.23.0 → 0.23.2

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 (32) hide show
  1. package/dist/blocknote.js +2926 -2603
  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 +2 -2
  8. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +4 -2
  9. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +1 -0
  10. package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +3 -0
  11. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +6 -2
  12. package/src/api/exporters/markdown/__snapshots__/codeBlock/contains-newlines/markdown.md +4 -0
  13. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +27 -0
  14. package/src/api/nodeConversions/blockToNode.ts +35 -9
  15. package/src/api/testUtil/cases/defaultSchema.ts +9 -0
  16. package/src/editor/BlockNoteEditor.ts +20 -12
  17. package/src/editor/BlockNoteExtensions.ts +4 -128
  18. package/src/extensions/Collaboration/createCollaborationExtensions.ts +151 -0
  19. package/src/extensions/SideMenu/SideMenuPlugin.ts +89 -28
  20. package/src/i18n/locales/fr.ts +2 -2
  21. package/src/i18n/locales/index.ts +2 -1
  22. package/src/i18n/locales/uk.ts +289 -0
  23. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
  24. package/types/src/api/nodeConversions/blockToNode.d.ts +1 -1
  25. package/types/src/editor/BlockNoteEditor.d.ts +3 -2
  26. package/types/src/editor/BlockNoteExtensions.d.ts +1 -1
  27. package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +17 -0
  28. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +1 -5
  29. package/types/src/i18n/locales/index.d.ts +2 -1
  30. package/types/src/i18n/locales/uk.d.ts +2 -0
  31. package/types/src/pm-nodes/BlockContainer.d.ts +1 -1
  32. package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
@@ -1,6 +1,6 @@
1
- import type { BlockNoteEditor, BlockNoteExtension } from "./BlockNoteEditor.js";
2
1
  import { Plugin } from "prosemirror-state";
3
2
  import * as Y from "yjs";
3
+ import type { BlockNoteEditor, BlockNoteExtension } from "./BlockNoteEditor.js";
4
4
  import { BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema/index.js";
5
5
  type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
6
6
  editor: BlockNoteEditor<BSchema, I, S>;
@@ -0,0 +1,17 @@
1
+ import * as Y from "yjs";
2
+ export declare const createCollaborationExtensions: (collaboration: {
3
+ fragment: Y.XmlFragment;
4
+ user: {
5
+ name: string;
6
+ color: string;
7
+ [key: string]: string;
8
+ };
9
+ provider: any;
10
+ renderCursor?: (user: any) => HTMLElement;
11
+ showCursorLabels?: "always" | "activity";
12
+ }) => (import("@tiptap/core").Extension<import("@tiptap/extension-collaboration").CollaborationOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-collaboration-cursor").CollaborationCursorOptions, {
13
+ users: {
14
+ [key: string]: any;
15
+ clientId: number;
16
+ }[];
17
+ }>)[];
@@ -24,11 +24,6 @@ export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineC
24
24
  constructor(editor: BlockNoteEditor<BSchema, I, S>, sideMenuDetection: "viewport" | "editor", pmView: EditorView, emitUpdate: (state: SideMenuState<BSchema, I, S>) => void);
25
25
  updateState: (state: SideMenuState<BSchema, I, S>) => void;
26
26
  updateStateFromMousePos: () => void;
27
- /**
28
- * If the event is outside the editor contents,
29
- * we dispatch a fake event, so that we can still drop the content
30
- * when dragging / dropping to the side of the editor
31
- */
32
27
  onDrop: (event: DragEvent) => void;
33
28
  /**
34
29
  * If a block is being dragged, ProseMirror usually gets the context of what's
@@ -58,6 +53,7 @@ export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineC
58
53
  onKeyDown: (_event: KeyboardEvent) => void;
59
54
  onMouseMove: (event: MouseEvent) => void;
60
55
  private createSyntheticEvent;
56
+ onScroll: () => void;
61
57
  update(_view: EditorView, prevState: EditorState): void;
62
58
  destroy(): void;
63
59
  }
@@ -5,12 +5,13 @@ export * from "./es.js";
5
5
  export * from "./fr.js";
6
6
  export * from "./hr.js";
7
7
  export * from "./is.js";
8
+ export * from "./it.js";
8
9
  export * from "./ja.js";
9
10
  export * from "./ko.js";
10
11
  export * from "./nl.js";
11
12
  export * from "./pl.js";
12
13
  export * from "./pt.js";
13
14
  export * from "./ru.js";
15
+ export * from "./uk.js";
14
16
  export * from "./vi.js";
15
17
  export * from "./zh.js";
16
- export * from "./it.js";
@@ -0,0 +1,2 @@
1
+ import { Dictionary } from "../dictionary.js";
2
+ export declare const uk: Dictionary;
@@ -5,8 +5,8 @@ import type { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
5
5
  */
6
6
  export declare const BlockContainer: Node<{
7
7
  domAttributes?: Partial<{
8
- blockContent: Record<string, string>;
9
8
  blockGroup: Record<string, string>;
9
+ blockContent: Record<string, string>;
10
10
  editor: Record<string, string>;
11
11
  block: Record<string, string>;
12
12
  inlineContent: Record<string, string>;
@@ -1,8 +1,8 @@
1
1
  import { Node } from "@tiptap/core";
2
2
  export declare const BlockGroup: Node<{
3
3
  domAttributes?: Partial<{
4
- blockContent: Record<string, string>;
5
4
  blockGroup: Record<string, string>;
5
+ blockContent: Record<string, string>;
6
6
  editor: Record<string, string>;
7
7
  block: Record<string, string>;
8
8
  inlineContent: Record<string, string>;