@blocknote/core 0.30.1 → 0.31.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 (139) hide show
  1. package/dist/blocknote.cjs +9 -9
  2. package/dist/blocknote.cjs.map +1 -1
  3. package/dist/blocknote.js +2754 -2230
  4. package/dist/blocknote.js.map +1 -1
  5. package/dist/{en-D4taoCs4.cjs → en-BXVKCwYt.cjs} +2 -2
  6. package/dist/en-BXVKCwYt.cjs.map +1 -0
  7. package/dist/{en-B7ycW7c8.js → en-qGo6sk9V.js} +2 -3
  8. package/dist/en-qGo6sk9V.js.map +1 -0
  9. package/dist/locales.cjs +1 -1
  10. package/dist/locales.cjs.map +1 -1
  11. package/dist/locales.js +20 -39
  12. package/dist/locales.js.map +1 -1
  13. package/dist/style.css +1 -1
  14. package/dist/webpack-stats.json +1 -1
  15. package/package.json +4 -5
  16. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -3
  17. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +1 -1
  18. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2816 -0
  19. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +158 -0
  20. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +87 -17
  21. package/src/api/blockManipulation/selections/selection.ts +48 -1
  22. package/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.ts → textCursorPosition.ts} +7 -7
  23. package/src/api/getBlockInfoFromPos.ts +1 -1
  24. package/src/api/nodeConversions/blockToNode.ts +5 -2
  25. package/src/api/nodeConversions/nodeToBlock.ts +203 -8
  26. package/src/api/pmUtil.ts +3 -3
  27. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +6 -6
  28. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +1 -1
  29. package/src/blocks/TableBlockContent/TableBlockContent.ts +32 -2
  30. package/src/editor/Block.css +27 -1
  31. package/src/editor/BlockNoteEditor.test.ts +7 -0
  32. package/src/editor/BlockNoteEditor.ts +88 -37
  33. package/src/editor/BlockNoteExtension.ts +26 -0
  34. package/src/editor/BlockNoteExtensions.ts +28 -12
  35. package/src/editor/BlockNoteTipTapEditor.ts +23 -2
  36. package/src/extensions/Collaboration/CursorPlugin.ts +13 -7
  37. package/src/extensions/Collaboration/ForkYDocPlugin.test.ts +166 -0
  38. package/src/extensions/Collaboration/ForkYDocPlugin.ts +174 -0
  39. package/src/extensions/Collaboration/SyncPlugin.ts +7 -4
  40. package/src/extensions/Collaboration/UndoPlugin.ts +7 -4
  41. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +30 -0
  42. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +30 -0
  43. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -0
  44. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -0
  45. package/src/extensions/Comments/CommentsPlugin.ts +75 -70
  46. package/src/extensions/FilePanel/FilePanelPlugin.ts +50 -49
  47. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +56 -26
  48. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +22 -21
  49. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
  50. package/src/extensions/Placeholder/PlaceholderPlugin.ts +111 -108
  51. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +179 -170
  52. package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +22 -19
  53. package/src/extensions/SideMenu/SideMenuPlugin.ts +19 -18
  54. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +168 -168
  55. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -4
  56. package/src/extensions/Suggestions/SuggestionMarks.ts +175 -0
  57. package/src/extensions/TableHandles/TableHandlesPlugin.ts +153 -150
  58. package/src/i18n/locales/ar.ts +0 -1
  59. package/src/i18n/locales/de.ts +0 -1
  60. package/src/i18n/locales/en.ts +0 -1
  61. package/src/i18n/locales/es.ts +0 -1
  62. package/src/i18n/locales/fr.ts +0 -1
  63. package/src/i18n/locales/hr.ts +0 -1
  64. package/src/i18n/locales/is.ts +0 -1
  65. package/src/i18n/locales/it.ts +0 -1
  66. package/src/i18n/locales/ja.ts +0 -1
  67. package/src/i18n/locales/ko.ts +0 -1
  68. package/src/i18n/locales/nl.ts +0 -1
  69. package/src/i18n/locales/no.ts +0 -1
  70. package/src/i18n/locales/pl.ts +0 -1
  71. package/src/i18n/locales/pt.ts +0 -1
  72. package/src/i18n/locales/ru.ts +0 -1
  73. package/src/i18n/locales/sk.ts +0 -1
  74. package/src/i18n/locales/uk.ts +0 -1
  75. package/src/i18n/locales/vi.ts +0 -1
  76. package/src/i18n/locales/zh-tw.ts +0 -1
  77. package/src/i18n/locales/zh.ts +0 -1
  78. package/src/index.ts +18 -8
  79. package/src/pm-nodes/BlockContainer.ts +1 -1
  80. package/src/pm-nodes/BlockGroup.ts +1 -1
  81. package/src/pm-nodes/Doc.ts +1 -0
  82. package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +1 -1
  83. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +4 -0
  84. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
  85. package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +3 -1
  86. package/types/src/api/blockManipulation/selections/selection.d.ts +10 -0
  87. package/types/src/api/blockManipulation/selections/textCursorPosition.d.ts +5 -0
  88. package/types/src/api/blockManipulation/transactions.test.d.ts +0 -0
  89. package/types/src/api/clipboard/clipboardExternal.test.d.ts +1 -0
  90. package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
  91. package/types/src/api/clipboard/testUtil.d.ts +541 -0
  92. package/types/src/api/exporters/html/htmlConversion.test.d.ts +1 -0
  93. package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +1 -0
  94. package/types/src/api/nodeConversions/nodeConversions.test.d.ts +1 -0
  95. package/types/src/api/nodeConversions/nodeToBlock.d.ts +39 -2
  96. package/types/src/api/parsers/html/parseHTML.test.d.ts +1 -0
  97. package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +1 -0
  98. package/types/src/api/pmUtil.d.ts +3 -3
  99. package/types/src/api/testUtil/cases/customBlocks.d.ts +670 -0
  100. package/types/src/api/testUtil/cases/customInlineContent.d.ts +558 -0
  101. package/types/src/api/testUtil/cases/customStyles.d.ts +552 -0
  102. package/types/src/api/testUtil/cases/defaultSchema.d.ts +4 -0
  103. package/types/src/api/testUtil/index.d.ts +14 -0
  104. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +9 -0
  105. package/types/src/api/testUtil/paste.d.ts +2 -0
  106. package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +6 -0
  107. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +9 -1
  108. package/types/src/editor/BlockNoteEditor.d.ts +55 -9
  109. package/types/src/editor/BlockNoteExtension.d.ts +9 -0
  110. package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
  111. package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
  112. package/types/src/extensions/Collaboration/CursorPlugin.d.ts +3 -3
  113. package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +41 -0
  114. package/types/src/extensions/Collaboration/ForkYDocPlugin.test.d.ts +1 -0
  115. package/types/src/extensions/Collaboration/SyncPlugin.d.ts +3 -3
  116. package/types/src/extensions/Collaboration/UndoPlugin.d.ts +3 -3
  117. package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +17 -0
  118. package/types/src/extensions/Comments/CommentsPlugin.d.ts +2 -4
  119. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +3 -4
  120. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -5
  121. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +3 -4
  122. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -3
  123. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +2 -3
  124. package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +2 -3
  125. package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +2 -3
  126. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +3 -4
  127. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +2 -4
  128. package/types/src/extensions/Suggestions/SuggestionMarks.d.ts +4 -0
  129. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +5 -6
  130. package/types/src/i18n/locales/en.d.ts +0 -1
  131. package/types/src/i18n/locales/sk.d.ts +0 -1
  132. package/types/src/index.d.ts +15 -8
  133. package/dist/en-B7ycW7c8.js.map +0 -1
  134. package/dist/en-D4taoCs4.cjs.map +0 -1
  135. package/dist/tsconfig.tsbuildinfo +0 -1
  136. package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +0 -844
  137. package/src/api/blockManipulation/selections/selection.test.ts +0 -72
  138. package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +0 -316
  139. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +0 -74
@@ -21,13 +21,20 @@ import { EditorView } from "prosemirror-view";
21
21
  import { BlocksChanged } from "../api/nodeUtil.js";
22
22
  import { CodeBlockOptions } from "../blocks/CodeBlockContent/CodeBlockContent.js";
23
23
  import type { ThreadStore, User } from "../comments/index.js";
24
- import "../style.css";
24
+ import type { ForkYDocPlugin } from "../extensions/Collaboration/ForkYDocPlugin.js";
25
25
  import { EventEmitter } from "../util/EventEmitter.js";
26
+ import { BlockNoteExtension } from "./BlockNoteExtension.js";
27
+ import "../style.css";
28
+ /**
29
+ * A factory function that returns a BlockNoteExtension
30
+ * This is useful so we can create extensions that require an editor instance
31
+ * in the constructor
32
+ */
26
33
  export type BlockNoteExtensionFactory = (editor: BlockNoteEditor<any, any, any>) => BlockNoteExtension;
27
- export type BlockNoteExtension = AnyExtension | {
28
- plugin: Plugin;
29
- priority?: number;
30
- };
34
+ /**
35
+ * We support Tiptap extensions and BlockNoteExtension based extensions
36
+ */
37
+ export type SupportedExtension = AnyExtension | BlockNoteExtension;
31
38
  export type BlockCache<BSchema extends BlockSchema = any, ISchema extends InlineContentSchema = any, SSchema extends StyleSchema = any> = WeakMap<Node, Block<BSchema, ISchema, SSchema>>;
32
39
  export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> = {
33
40
  /**
@@ -224,9 +231,15 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends
224
231
  */
225
232
  _tiptapOptions: Partial<EditorOptions>;
226
233
  /**
227
- * (experimental) add extra prosemirror plugins or tiptap extensions to the editor
234
+ * (experimental) add extra extensions to the editor
235
+ *
236
+ * @deprecated, should use `extensions` instead
228
237
  */
229
238
  _extensions: Record<string, BlockNoteExtension | BlockNoteExtensionFactory>;
239
+ /**
240
+ * Register
241
+ */
242
+ extensions: Array<BlockNoteExtension | BlockNoteExtensionFactory>;
230
243
  /**
231
244
  * Boolean indicating whether the editor is in headless mode.
232
245
  * Headless mode means we can use features like importing / exporting blocks,
@@ -247,7 +260,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
247
260
  /**
248
261
  * extensions that are added to the editor, can be tiptap extensions or prosemirror plugins
249
262
  */
250
- readonly extensions: Record<string, BlockNoteExtension>;
263
+ extensions: Record<string, SupportedExtension>;
251
264
  /**
252
265
  * Boolean indicating whether the editor is in headless mode.
253
266
  * Headless mode means we can use features like importing / exporting blocks,
@@ -290,7 +303,10 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
290
303
  readonly tableHandles?: TableHandlesProsemirrorPlugin<ISchema, SSchema>;
291
304
  readonly comments?: CommentsPlugin;
292
305
  private readonly showSelectionPlugin;
293
- private readonly cursorPlugin;
306
+ /**
307
+ * The plugin for forking a document, only defined if in collaboration mode
308
+ */
309
+ readonly forkYDocPlugin?: ForkYDocPlugin;
294
310
  /**
295
311
  * The `uploadFile` method is what the editor uses when files need to be uploaded (for example when selecting an image to upload).
296
312
  * This method should set when creating the editor as this is application-specific.
@@ -374,6 +390,17 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
374
390
  * If another `transact` call is made within the callback, it will be passed the same transaction as the parent call.
375
391
  */
376
392
  tr: Transaction) => T): T;
393
+ /**
394
+ * Shorthand to get a typed extension from the editor, by
395
+ * just passing in the extension class.
396
+ *
397
+ * @param ext - The extension class to get
398
+ * @param key - optional, the key of the extension in the extensions object (defaults to the extension name)
399
+ * @returns The extension instance
400
+ */
401
+ extension<T extends BlockNoteExtension>(ext: {
402
+ new (...args: any[]): T;
403
+ } & typeof BlockNoteExtension, key?: string): T;
377
404
  /**
378
405
  * Mount the editor to a parent DOM element. Call mount(undefined) to clean up
379
406
  *
@@ -473,9 +500,28 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
473
500
  */
474
501
  setTextCursorPosition(targetBlock: BlockIdentifier, placement?: "start" | "end"): void;
475
502
  /**
476
- * Gets a snapshot of the current selection.
503
+ * Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
504
+ * that the selection spans across.
505
+ *
506
+ * If the selection starts / ends halfway through a block, the returned data will contain the entire block.
477
507
  */
478
508
  getSelection(): Selection<BSchema, ISchema, SSchema> | undefined;
509
+ /**
510
+ * Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
511
+ * that the selection spans across.
512
+ *
513
+ * If the selection starts / ends halfway through a block, the returned block will be
514
+ * only the part of the block that is included in the selection.
515
+ */
516
+ getSelectionCutBlocks(): {
517
+ blocks: Block<Record<string, import("../index.js").BlockConfig>, InlineContentSchema, StyleSchema>[];
518
+ blockCutAtStart: string | undefined;
519
+ blockCutAtEnd: string | undefined;
520
+ _meta: {
521
+ startPos: number;
522
+ endPos: number;
523
+ };
524
+ };
479
525
  /**
480
526
  * Sets the selection to a range of blocks.
481
527
  * @param startBlock The identifier of the block that should be the start of the selection.
@@ -0,0 +1,9 @@
1
+ import { Plugin } from "prosemirror-state";
2
+ import { EventEmitter } from "../util/EventEmitter.js";
3
+ export declare abstract class BlockNoteExtension<TEvent extends Record<string, any> = any> extends EventEmitter<TEvent> {
4
+ static name(): string;
5
+ protected addProsemirrorPlugin(plugin: Plugin): void;
6
+ readonly plugins: Plugin[];
7
+ get priority(): number | undefined;
8
+ constructor(..._args: any[]);
9
+ }
@@ -2,7 +2,7 @@ import { Plugin } from "prosemirror-state";
2
2
  import * as Y from "yjs";
3
3
  import type { ThreadStore } from "../comments/index.js";
4
4
  import { BlockNoteDOMAttributes, BlockSchema, BlockSpecs, InlineContentSchema, InlineContentSpecs, StyleSchema, StyleSpecs } from "../schema/index.js";
5
- import type { BlockNoteEditor, BlockNoteEditorOptions, BlockNoteExtension } from "./BlockNoteEditor.js";
5
+ import type { BlockNoteEditor, BlockNoteEditorOptions, SupportedExtension } from "./BlockNoteEditor.js";
6
6
  type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
7
7
  editor: BlockNoteEditor<BSchema, I, S>;
8
8
  domAttributes: Partial<BlockNoteDOMAttributes>;
@@ -37,5 +37,5 @@ type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema
37
37
  /**
38
38
  * Get all the Tiptap extensions BlockNote is configured with by default
39
39
  */
40
- export declare const getBlockNoteExtensions: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(opts: ExtensionOptions<BSchema, I, S>) => Record<string, BlockNoteExtension>;
40
+ export declare const getBlockNoteExtensions: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(opts: ExtensionOptions<BSchema, I, S>) => Record<string, SupportedExtension>;
41
41
  export {};
@@ -1,5 +1,4 @@
1
- import { Editor, EditorOptions } from "@tiptap/core";
2
- import { Editor as TiptapEditor } from "@tiptap/core";
1
+ import { Editor, EditorOptions, Editor as TiptapEditor } from "@tiptap/core";
3
2
  import { EditorState, Transaction } from "@tiptap/pm/state";
4
3
  import { PartialBlock } from "../blocks/defaultBlocks.js";
5
4
  import { StyleSchema } from "../schema/index.js";
@@ -17,6 +16,7 @@ export declare class BlockNoteTipTapEditor extends TiptapEditor {
17
16
  protected constructor(options: BlockNoteTipTapEditorOptions, styleSchema: StyleSchema);
18
17
  get state(): EditorState;
19
18
  dispatch(transaction: Transaction): void;
19
+ forceEnablePlugins(): void;
20
20
  /**
21
21
  * Replace the default `createView` method with a custom one - which we call on mount
22
22
  */
@@ -1,14 +1,14 @@
1
- import { Plugin } from "prosemirror-state";
2
1
  import { Awareness } from "y-protocols/awareness.js";
3
2
  import * as Y from "yjs";
3
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
4
4
  export type CollaborationUser = {
5
5
  name: string;
6
6
  color: string;
7
7
  [key: string]: string;
8
8
  };
9
- export declare class CursorPlugin {
9
+ export declare class CursorPlugin extends BlockNoteExtension {
10
10
  private collaboration;
11
- plugin: Plugin;
11
+ static name(): string;
12
12
  private provider;
13
13
  private recentlyUpdatedCursors;
14
14
  constructor(collaboration: {
@@ -0,0 +1,41 @@
1
+ import { BlockNoteEditor, BlockNoteEditorOptions } from "../../editor/BlockNoteEditor.js";
2
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
3
+ export declare class ForkYDocPlugin extends BlockNoteExtension<{
4
+ forked: boolean;
5
+ }> {
6
+ static name(): string;
7
+ private editor;
8
+ private collaboration;
9
+ constructor({ editor, collaboration, }: {
10
+ editor: BlockNoteEditor<any, any, any>;
11
+ collaboration: BlockNoteEditorOptions<any, any, any>["collaboration"];
12
+ });
13
+ /**
14
+ * To find a fragment in another ydoc, we need to search for it.
15
+ */
16
+ private findTypeInOtherYdoc;
17
+ /**
18
+ * Whether the editor is editing a forked document,
19
+ * preserving a reference to the original document and the forked document.
20
+ */
21
+ get isForkedFromRemote(): boolean;
22
+ /**
23
+ * Stores whether the editor is editing a forked document,
24
+ * preserving a reference to the original document and the forked document.
25
+ */
26
+ private forkedState;
27
+ /**
28
+ * Fork the Y.js document from syncing to the remote,
29
+ * allowing modifications to the document without affecting the remote.
30
+ * These changes can later be rolled back or applied to the remote.
31
+ */
32
+ fork(): void;
33
+ /**
34
+ * Resume syncing the Y.js document to the remote
35
+ * If `keepChanges` is true, any changes that have been made to the forked document will be applied to the original document.
36
+ * Otherwise, the original document will be restored and the changes will be discarded.
37
+ */
38
+ merge({ keepChanges }: {
39
+ keepChanges: boolean;
40
+ }): void;
41
+ }
@@ -1,7 +1,7 @@
1
- import { Plugin } from "prosemirror-state";
2
1
  import type * as Y from "yjs";
3
- export declare class SyncPlugin {
4
- plugin: Plugin;
2
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
3
+ export declare class SyncPlugin extends BlockNoteExtension {
4
+ static name(): string;
5
5
  constructor(fragment: Y.XmlFragment);
6
6
  get priority(): number;
7
7
  }
@@ -1,6 +1,6 @@
1
- import { Plugin } from "prosemirror-state";
2
- export declare class UndoPlugin {
3
- plugin: Plugin;
1
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
2
+ export declare class UndoPlugin extends BlockNoteExtension {
3
+ static name(): string;
4
4
  constructor();
5
5
  get priority(): number;
6
6
  }
@@ -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, import("@tiptap/extension-collaboration").CollaborationStorage> | import("@tiptap/core").Extension<import("@tiptap/extension-collaboration-cursor").CollaborationCursorOptions, {
13
+ users: {
14
+ clientId: number;
15
+ [key: string]: any;
16
+ }[];
17
+ }>)[];
@@ -1,13 +1,11 @@
1
- import { Plugin } from "prosemirror-state";
2
1
  import type { CommentBody, ThreadStore, User } from "../../comments/index.js";
3
2
  import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
4
- import { EventEmitter } from "../../util/EventEmitter.js";
3
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
5
4
  import { UserStore } from "./userstore/UserStore.js";
6
- export declare class CommentsPlugin extends EventEmitter<any> {
5
+ export declare class CommentsPlugin extends BlockNoteExtension {
7
6
  private readonly editor;
8
7
  readonly threadStore: ThreadStore;
9
8
  private readonly markType;
10
- readonly plugin: Plugin;
11
9
  readonly userStore: UserStore<User>;
12
10
  /**
13
11
  * Whether a comment is currently being composed
@@ -1,9 +1,9 @@
1
- import { EditorState, Plugin, PluginKey, PluginView } from "prosemirror-state";
1
+ import { EditorState, PluginKey, PluginView } from "prosemirror-state";
2
2
  import { EditorView } from "prosemirror-view";
3
3
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
4
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
4
5
  import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
5
6
  import type { BlockFromConfig, FileBlockConfig, InlineContentSchema, StyleSchema } from "../../schema/index.js";
6
- import { EventEmitter } from "../../util/EventEmitter.js";
7
7
  export type FilePanelState<I extends InlineContentSchema, S extends StyleSchema> = UiElementPosition & {
8
8
  block: BlockFromConfig<FileBlockConfig, I, S>;
9
9
  };
@@ -21,9 +21,8 @@ export declare class FilePanelView<I extends InlineContentSchema, S extends Styl
21
21
  closeMenu: () => void;
22
22
  destroy(): void;
23
23
  }
24
- export declare class FilePanelProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
24
+ export declare class FilePanelProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
25
25
  private view;
26
- readonly plugin: Plugin;
27
26
  constructor(editor: BlockNoteEditor<Record<string, FileBlockConfig>, I, S>);
28
27
  get shown(): boolean;
29
28
  onUpdate(callback: (state: FilePanelState<I, S>) => void): () => void;
@@ -1,9 +1,9 @@
1
- import { EditorState, Plugin, PluginKey, PluginView } from "prosemirror-state";
1
+ import { EditorState, PluginKey, PluginView } from "prosemirror-state";
2
2
  import { EditorView } from "prosemirror-view";
3
3
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
4
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
4
5
  import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
5
6
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
6
- import { EventEmitter } from "../../util/EventEmitter.js";
7
7
  export type FormattingToolbarState = UiElementPosition;
8
8
  export declare class FormattingToolbarView implements PluginView {
9
9
  private readonly editor;
@@ -20,7 +20,8 @@ export declare class FormattingToolbarView implements PluginView {
20
20
  }) => boolean;
21
21
  constructor(editor: BlockNoteEditor<BlockSchema, InlineContentSchema, StyleSchema>, pmView: EditorView, emitUpdate: (state: FormattingToolbarState) => void);
22
22
  blurHandler: (event: FocusEvent) => void;
23
- viewMousedownHandler: () => void;
23
+ isElementWithinEditorWrapper: (element: Node | null) => boolean;
24
+ viewMousedownHandler: (e: MouseEvent) => void;
24
25
  mouseupHandler: () => void;
25
26
  dragHandler: () => void;
26
27
  scrollHandler: () => void;
@@ -30,9 +31,8 @@ export declare class FormattingToolbarView implements PluginView {
30
31
  getSelectionBoundingBox(): DOMRect;
31
32
  }
32
33
  export declare const formattingToolbarPluginKey: PluginKey<any>;
33
- export declare class FormattingToolbarProsemirrorPlugin extends EventEmitter<any> {
34
+ export declare class FormattingToolbarProsemirrorPlugin extends BlockNoteExtension {
34
35
  private view;
35
- readonly plugin: Plugin;
36
36
  constructor(editor: BlockNoteEditor<any, any, any>);
37
37
  get shown(): boolean;
38
38
  onUpdate(callback: (state: FormattingToolbarState) => void): () => void;
@@ -1,16 +1,15 @@
1
- import { Plugin, PluginKey } from "prosemirror-state";
1
+ import { PluginKey } from "prosemirror-state";
2
2
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
3
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
3
4
  import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
4
5
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
5
- import { EventEmitter } from "../../util/EventEmitter.js";
6
6
  export type LinkToolbarState = UiElementPosition & {
7
7
  url: string;
8
8
  text: string;
9
9
  };
10
10
  export declare const linkToolbarPluginKey: PluginKey<any>;
11
- export declare class LinkToolbarProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
11
+ export declare class LinkToolbarProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
12
12
  private view;
13
- readonly plugin: Plugin;
14
13
  constructor(editor: BlockNoteEditor<BSchema, I, S>);
15
14
  onUpdate(callback: (state: LinkToolbarState) => void): () => void;
16
15
  /**
@@ -1,5 +1,4 @@
1
- import { Plugin } from "prosemirror-state";
2
- export declare class NodeSelectionKeyboardPlugin {
3
- readonly plugin: Plugin;
1
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
2
+ export declare class NodeSelectionKeyboardPlugin extends BlockNoteExtension {
4
3
  constructor();
5
4
  }
@@ -1,6 +1,5 @@
1
- import { Plugin } from "prosemirror-state";
2
1
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
3
- export declare class PlaceholderPlugin {
4
- readonly plugin: Plugin;
2
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
3
+ export declare class PlaceholderPlugin extends BlockNoteExtension {
5
4
  constructor(editor: BlockNoteEditor<any, any, any>, placeholders: Record<string | "default" | "emptyDocument", string | undefined>);
6
5
  }
@@ -1,4 +1,4 @@
1
- import { Plugin } from "prosemirror-state";
1
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
2
2
  /**
3
3
  * This plugin tracks transformation of Block node attributes, so we can support CSS transitions.
4
4
  *
@@ -7,7 +7,6 @@ import { Plugin } from "prosemirror-state";
7
7
  *
8
8
  * Solution: When attributes change on a node, this plugin sets a data-* attribute with the "previous" value. This way we can still use CSS transitions. (See block.module.css)
9
9
  */
10
- export declare class PreviousBlockTypePlugin {
11
- readonly plugin: Plugin;
10
+ export declare class PreviousBlockTypePlugin extends BlockNoteExtension {
12
11
  constructor();
13
12
  }
@@ -1,13 +1,12 @@
1
- import { Plugin } from "prosemirror-state";
2
1
  import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
3
3
  /**
4
4
  * Plugin that shows adds a decoration around the current selection
5
5
  * This can be used to highlight the current selection in the UI even when the
6
6
  * text editor is not focused.
7
7
  */
8
- export declare class ShowSelectionPlugin {
8
+ export declare class ShowSelectionPlugin extends BlockNoteExtension {
9
9
  private readonly editor;
10
- readonly plugin: Plugin;
11
10
  private enabled;
12
11
  constructor(editor: BlockNoteEditor<any, any, any>);
13
12
  setEnabled(enabled: boolean): void;
@@ -1,10 +1,10 @@
1
- import { EditorState, Plugin, PluginKey, PluginView } from "@tiptap/pm/state";
1
+ import { EditorState, PluginKey, PluginView } from "@tiptap/pm/state";
2
2
  import { EditorView } from "@tiptap/pm/view";
3
3
  import { Block } from "../../blocks/defaultBlocks.js";
4
4
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
5
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
5
6
  import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
6
7
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
7
- import { EventEmitter } from "../../util/EventEmitter.js";
8
8
  export type SideMenuState<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = UiElementPosition & {
9
9
  block: Block<BSchema, I, S>;
10
10
  };
@@ -59,10 +59,9 @@ export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineC
59
59
  destroy(): void;
60
60
  }
61
61
  export declare const sideMenuPluginKey: PluginKey<any>;
62
- export declare class SideMenuProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
62
+ export declare class SideMenuProsemirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
63
63
  private readonly editor;
64
64
  view: SideMenuView<BSchema, I, S> | undefined;
65
- readonly plugin: Plugin;
66
65
  constructor(editor: BlockNoteEditor<BSchema, I, S>, sideMenuDetection: "viewport" | "editor");
67
66
  onUpdate(callback: (state: SideMenuState<BSchema, I, S>) => void): () => void;
68
67
  /**
@@ -1,8 +1,7 @@
1
- import { Plugin } from "prosemirror-state";
2
1
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
3
3
  import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
4
4
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
5
- import { EventEmitter } from "../../util/EventEmitter.js";
6
5
  export type SuggestionMenuState = UiElementPosition & {
7
6
  query: string;
8
7
  ignoreQueryLength?: boolean;
@@ -17,9 +16,8 @@ export type SuggestionMenuState = UiElementPosition & {
17
16
  * - This version hides some unnecessary complexity from the user of the plugin.
18
17
  * - This version handles key events differently
19
18
  */
20
- export declare class SuggestionMenuProseMirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
19
+ export declare class SuggestionMenuProseMirrorPlugin<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
21
20
  private view;
22
- readonly plugin: Plugin;
23
21
  private triggerCharacters;
24
22
  constructor(editor: BlockNoteEditor<BSchema, I, S>);
25
23
  onUpdate(triggerCharacter: string, callback: (state: SuggestionMenuState) => void): () => void;
@@ -0,0 +1,4 @@
1
+ import { Mark } from "@tiptap/core";
2
+ export declare const SuggestionAddMark: Mark<any, any>;
3
+ export declare const SuggestionDeleteMark: Mark<any, any>;
4
+ export declare const SuggestionModificationMark: Mark<any, any>;
@@ -1,10 +1,10 @@
1
- import { Plugin, PluginKey, PluginView } from "prosemirror-state";
1
+ import { PluginKey, PluginView } from "prosemirror-state";
2
2
  import { EditorView } from "prosemirror-view";
3
3
  import { RelativeCellIndices } from "../../api/blockManipulation/tables/tables.js";
4
4
  import { DefaultBlockSchema } from "../../blocks/defaultBlocks.js";
5
5
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
6
+ import { BlockNoteExtension } from "../../editor/BlockNoteExtension.js";
6
7
  import { BlockFromConfigNoChildren, BlockSchemaWithBlock, InlineContentSchema, StyleSchema } from "../../schema/index.js";
7
- import { EventEmitter } from "../../util/EventEmitter.js";
8
8
  export type TableHandlesState<I extends InlineContentSchema, S extends StyleSchema> = {
9
9
  show: boolean;
10
10
  showAddOrRemoveRowsButton: boolean;
@@ -42,10 +42,9 @@ export declare class TableHandlesView<I extends InlineContentSchema, S extends S
42
42
  destroy(): void;
43
43
  }
44
44
  export declare const tableHandlesPluginKey: PluginKey<any>;
45
- export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends EventEmitter<any> {
45
+ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema, S extends StyleSchema> extends BlockNoteExtension {
46
46
  private readonly editor;
47
47
  private view;
48
- readonly plugin: Plugin;
49
48
  constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, I, S>);
50
49
  onUpdate(callback: (state: TableHandlesState<I, S>) => void): () => void;
51
50
  /**
@@ -138,9 +137,9 @@ export declare class TableHandlesProsemirrorPlugin<I extends InlineContentSchema
138
137
  */
139
138
  getMergeDirection: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any> | undefined) => "vertical" | "horizontal" | undefined;
140
139
  cropEmptyRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, removeEmpty: "columns" | "rows") => {
141
- cells: (import("../../index.js").StyledText<any> | import("../../index.js").Link<any> | import("../../index.js").CustomInlineContentFromConfig<any, any>)[][] | import("../../index.js").TableCell<any, any>[];
140
+ cells: (import("../../index.js").CustomInlineContentFromConfig<any, any> | import("../../index.js").StyledText<any> | import("../../index.js").Link<any>)[][] | import("../../index.js").TableCell<any, any>[];
142
141
  }[];
143
142
  addRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, addType: "columns" | "rows", numToAdd: number) => {
144
- cells: (import("../../index.js").StyledText<any> | import("../../index.js").Link<any> | import("../../index.js").CustomInlineContentFromConfig<any, any>)[][] | import("../../index.js").TableCell<any, any>[];
143
+ cells: (import("../../index.js").CustomInlineContentFromConfig<any, any> | import("../../index.js").StyledText<any> | import("../../index.js").Link<any>)[][] | import("../../index.js").TableCell<any, any>[];
145
144
  }[];
146
145
  }
@@ -135,7 +135,6 @@ export declare const en: {
135
135
  };
136
136
  suggestion_menu: {
137
137
  no_items_title: string;
138
- loading: string;
139
138
  };
140
139
  color_picker: {
141
140
  text_title: string;
@@ -135,7 +135,6 @@ export declare const sk: {
135
135
  };
136
136
  suggestion_menu: {
137
137
  no_items_title: string;
138
- loading: string;
139
138
  };
140
139
  color_picker: {
141
140
  text_title: string;
@@ -1,10 +1,17 @@
1
+ export * from "./api/blockManipulation/commands/insertBlocks/insertBlocks.js";
2
+ export * from "./api/blockManipulation/commands/replaceBlocks/replaceBlocks.js";
1
3
  export * from "./api/blockManipulation/commands/updateBlock/updateBlock.js";
2
4
  export * from "./api/exporters/html/externalHTMLExporter.js";
3
5
  export * from "./api/exporters/html/internalHTMLSerializer.js";
4
6
  export * from "./api/getBlockInfoFromPos.js";
5
7
  export * from "./api/nodeUtil.js";
8
+ export * from "./api/pmUtil.js";
6
9
  export * from "./blocks/AudioBlockContent/AudioBlockContent.js";
7
10
  export * from "./blocks/CodeBlockContent/CodeBlockContent.js";
11
+ export * from "./blocks/defaultBlockHelpers.js";
12
+ export * from "./blocks/defaultBlocks.js";
13
+ export * from "./blocks/defaultBlockTypeGuards.js";
14
+ export * from "./blocks/defaultProps.js";
8
15
  export * from "./blocks/FileBlockContent/FileBlockContent.js";
9
16
  export * from "./blocks/FileBlockContent/helpers/parse/parseEmbedElement.js";
10
17
  export * from "./blocks/FileBlockContent/helpers/parse/parseFigureElement.js";
@@ -16,16 +23,13 @@ export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createFigureWith
16
23
  export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js";
17
24
  export * from "./blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js";
18
25
  export * from "./blocks/ImageBlockContent/ImageBlockContent.js";
19
- export * from "./blocks/PageBreakBlockContent/PageBreakBlockContent.js";
20
26
  export * from "./blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.js";
27
+ export * from "./blocks/PageBreakBlockContent/PageBreakBlockContent.js";
21
28
  export * from "./blocks/PageBreakBlockContent/schema.js";
22
29
  export { EMPTY_CELL_HEIGHT, EMPTY_CELL_WIDTH, } from "./blocks/TableBlockContent/TableExtension.js";
23
30
  export * from "./blocks/VideoBlockContent/VideoBlockContent.js";
24
- export * from "./blocks/defaultBlockHelpers.js";
25
- export * from "./blocks/defaultBlockTypeGuards.js";
26
- export * from "./blocks/defaultBlocks.js";
27
- export * from "./blocks/defaultProps.js";
28
31
  export * from "./editor/BlockNoteEditor.js";
32
+ export * from "./editor/BlockNoteExtension.js";
29
33
  export * from "./editor/BlockNoteExtensions.js";
30
34
  export * from "./editor/BlockNoteSchema.js";
31
35
  export * from "./editor/defaultColors.js";
@@ -39,20 +43,21 @@ export * from "./extensions/LinkToolbar/protocols.js";
39
43
  export * from "./extensions/SideMenu/SideMenuPlugin.js";
40
44
  export * from "./extensions/SuggestionMenu/DefaultGridSuggestionItem.js";
41
45
  export * from "./extensions/SuggestionMenu/DefaultSuggestionItem.js";
42
- export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
43
46
  export * from "./extensions/SuggestionMenu/getDefaultEmojiPickerItems.js";
44
47
  export * from "./extensions/SuggestionMenu/getDefaultSlashMenuItems.js";
48
+ export * from "./extensions/SuggestionMenu/SuggestionPlugin.js";
45
49
  export * from "./extensions/TableHandles/TableHandlesPlugin.js";
46
50
  export * from "./i18n/dictionary.js";
47
51
  export * from "./schema/index.js";
48
52
  export * from "./util/browser.js";
49
53
  export * from "./util/combineByGroup.js";
50
54
  export * from "./util/esmDependencies.js";
51
- export * from "./util/table.js";
52
55
  export * from "./util/string.js";
56
+ export * from "./util/table.js";
53
57
  export * from "./util/typescript.js";
54
58
  export type { CodeBlockOptions } from "./blocks/CodeBlockContent/CodeBlockContent.js";
55
- export { UnreachableCaseError, assertEmpty } from "./util/typescript.js";
59
+ export { assertEmpty, UnreachableCaseError } from "./util/typescript.js";
60
+ export * from "./util/EventEmitter.js";
56
61
  export { selectedFragmentToHTML } from "./api/clipboard/toClipboard/copyExtension.js";
57
62
  export * from "./api/nodeConversions/blockToNode.js";
58
63
  export * from "./api/nodeConversions/nodeToBlock.js";
@@ -60,3 +65,5 @@ export * from "./extensions/UniqueID/UniqueID.js";
60
65
  export * from "./api/exporters/markdown/markdownExporter.js";
61
66
  export * from "./api/parsers/html/parseHTML.js";
62
67
  export * from "./api/parsers/markdown/parseMarkdown.js";
68
+ export * from "./api/blockManipulation/getBlock/getBlock.js";
69
+ export * from "./api/positionMapping.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"en-B7ycW7c8.js","sources":["../src/i18n/locales/en.ts"],"sourcesContent":["export const en = {\n slash_menu: {\n heading: {\n title: \"Heading 1\",\n subtext: \"Top-level heading\",\n aliases: [\"h\", \"heading1\", \"h1\"],\n group: \"Headings\",\n },\n heading_2: {\n title: \"Heading 2\",\n subtext: \"Key section heading\",\n aliases: [\"h2\", \"heading2\", \"subheading\"],\n group: \"Headings\",\n },\n heading_3: {\n title: \"Heading 3\",\n subtext: \"Subsection and group heading\",\n aliases: [\"h3\", \"heading3\", \"subheading\"],\n group: \"Headings\",\n },\n quote: {\n title: \"Quote\",\n subtext: \"Quote or excerpt\",\n aliases: [\"quotation\", \"blockquote\", \"bq\"],\n group: \"Basic blocks\",\n },\n numbered_list: {\n title: \"Numbered List\",\n subtext: \"List with ordered items\",\n aliases: [\"ol\", \"li\", \"list\", \"numberedlist\", \"numbered list\"],\n group: \"Basic blocks\",\n },\n bullet_list: {\n title: \"Bullet List\",\n subtext: \"List with unordered items\",\n aliases: [\"ul\", \"li\", \"list\", \"bulletlist\", \"bullet list\"],\n group: \"Basic blocks\",\n },\n check_list: {\n title: \"Check List\",\n subtext: \"List with checkboxes\",\n aliases: [\n \"ul\",\n \"li\",\n \"list\",\n \"checklist\",\n \"check list\",\n \"checked list\",\n \"checkbox\",\n ],\n group: \"Basic blocks\",\n },\n paragraph: {\n title: \"Paragraph\",\n subtext: \"The body of your document\",\n aliases: [\"p\", \"paragraph\"],\n group: \"Basic blocks\",\n },\n code_block: {\n title: \"Code Block\",\n subtext: \"Code block with syntax highlighting\",\n aliases: [\"code\", \"pre\"],\n group: \"Basic blocks\",\n },\n page_break: {\n title: \"Page Break\",\n subtext: \"Page separator\",\n aliases: [\"page\", \"break\", \"separator\"],\n group: \"Basic blocks\",\n },\n table: {\n title: \"Table\",\n subtext: \"Table with editable cells\",\n aliases: [\"table\"],\n group: \"Advanced\",\n },\n image: {\n title: \"Image\",\n subtext: \"Resizable image with caption\",\n aliases: [\n \"image\",\n \"imageUpload\",\n \"upload\",\n \"img\",\n \"picture\",\n \"media\",\n \"url\",\n ],\n group: \"Media\",\n },\n video: {\n title: \"Video\",\n subtext: \"Resizable video with caption\",\n aliases: [\n \"video\",\n \"videoUpload\",\n \"upload\",\n \"mp4\",\n \"film\",\n \"media\",\n \"url\",\n ],\n group: \"Media\",\n },\n audio: {\n title: \"Audio\",\n subtext: \"Embedded audio with caption\",\n aliases: [\n \"audio\",\n \"audioUpload\",\n \"upload\",\n \"mp3\",\n \"sound\",\n \"media\",\n \"url\",\n ],\n group: \"Media\",\n },\n file: {\n title: \"File\",\n subtext: \"Embedded file\",\n aliases: [\"file\", \"upload\", \"embed\", \"media\", \"url\"],\n group: \"Media\",\n },\n emoji: {\n title: \"Emoji\",\n subtext: \"Search for and insert an emoji\",\n aliases: [\"emoji\", \"emote\", \"emotion\", \"face\"],\n group: \"Others\",\n },\n },\n placeholders: {\n default: \"Enter text or type '/' for commands\",\n heading: \"Heading\",\n bulletListItem: \"List\",\n numberedListItem: \"List\",\n checkListItem: \"List\",\n emptyDocument: undefined,\n new_comment: \"Write a comment...\",\n edit_comment: \"Edit comment...\",\n comment_reply: \"Add comment...\",\n } as Record<string | \"default\" | \"emptyDocument\", string | undefined>,\n file_blocks: {\n image: {\n add_button_text: \"Add image\",\n },\n video: {\n add_button_text: \"Add video\",\n },\n audio: {\n add_button_text: \"Add audio\",\n },\n file: {\n add_button_text: \"Add file\",\n },\n },\n // from react package:\n side_menu: {\n add_block_label: \"Add block\",\n drag_handle_label: \"Open block menu\",\n },\n drag_handle: {\n delete_menuitem: \"Delete\",\n colors_menuitem: \"Colors\",\n header_row_menuitem: \"Header row\",\n header_column_menuitem: \"Header column\",\n },\n table_handle: {\n delete_column_menuitem: \"Delete column\",\n delete_row_menuitem: \"Delete row\",\n add_left_menuitem: \"Add column left\",\n add_right_menuitem: \"Add column right\",\n add_above_menuitem: \"Add row above\",\n add_below_menuitem: \"Add row below\",\n split_cell_menuitem: \"Split cell\",\n merge_cells_menuitem: \"Merge cells\",\n background_color_menuitem: \"Background color\",\n },\n suggestion_menu: {\n no_items_title: \"No items found\",\n loading: \"Loading…\",\n },\n color_picker: {\n text_title: \"Text\",\n background_title: \"Background\",\n colors: {\n default: \"Default\",\n gray: \"Gray\",\n brown: \"Brown\",\n red: \"Red\",\n orange: \"Orange\",\n yellow: \"Yellow\",\n green: \"Green\",\n blue: \"Blue\",\n purple: \"Purple\",\n pink: \"Pink\",\n },\n },\n\n formatting_toolbar: {\n bold: {\n tooltip: \"Bold\",\n secondary_tooltip: \"Mod+B\",\n },\n italic: {\n tooltip: \"Italic\",\n secondary_tooltip: \"Mod+I\",\n },\n underline: {\n tooltip: \"Underline\",\n secondary_tooltip: \"Mod+U\",\n },\n strike: {\n tooltip: \"Strike\",\n secondary_tooltip: \"Mod+Shift+S\",\n },\n code: {\n tooltip: \"Code\",\n secondary_tooltip: \"\",\n },\n colors: {\n tooltip: \"Colors\",\n },\n link: {\n tooltip: \"Create link\",\n secondary_tooltip: \"Mod+K\",\n },\n file_caption: {\n tooltip: \"Edit caption\",\n input_placeholder: \"Edit caption\",\n },\n file_replace: {\n tooltip: {\n image: \"Replace image\",\n video: \"Replace video\",\n audio: \"Replace audio\",\n file: \"Replace file\",\n } as Record<string, string>,\n },\n file_rename: {\n tooltip: {\n image: \"Rename image\",\n video: \"Rename video\",\n audio: \"Rename audio\",\n file: \"Rename file\",\n } as Record<string, string>,\n input_placeholder: {\n image: \"Rename image\",\n video: \"Rename video\",\n audio: \"Rename audio\",\n file: \"Rename file\",\n } as Record<string, string>,\n },\n file_download: {\n tooltip: {\n image: \"Download image\",\n video: \"Download video\",\n audio: \"Download audio\",\n file: \"Download file\",\n } as Record<string, string>,\n },\n file_delete: {\n tooltip: {\n image: \"Delete image\",\n video: \"Delete video\",\n audio: \"Delete audio\",\n file: \"Delete file\",\n } as Record<string, string>,\n },\n file_preview_toggle: {\n tooltip: \"Toggle preview\",\n },\n nest: {\n tooltip: \"Nest block\",\n secondary_tooltip: \"Tab\",\n },\n unnest: {\n tooltip: \"Unnest block\",\n secondary_tooltip: \"Shift+Tab\",\n },\n align_left: {\n tooltip: \"Align text left\",\n },\n align_center: {\n tooltip: \"Align text center\",\n },\n align_right: {\n tooltip: \"Align text right\",\n },\n align_justify: {\n tooltip: \"Justify text\",\n },\n table_cell_merge: {\n tooltip: \"Merge cells\",\n },\n comment: {\n tooltip: \"Add comment\",\n },\n },\n file_panel: {\n upload: {\n title: \"Upload\",\n file_placeholder: {\n image: \"Upload image\",\n video: \"Upload video\",\n audio: \"Upload audio\",\n file: \"Upload file\",\n } as Record<string, string>,\n upload_error: \"Error: Upload failed\",\n },\n embed: {\n title: \"Embed\",\n embed_button: {\n image: \"Embed image\",\n video: \"Embed video\",\n audio: \"Embed audio\",\n file: \"Embed file\",\n } as Record<string, string>,\n url_placeholder: \"Enter URL\",\n },\n },\n link_toolbar: {\n delete: {\n tooltip: \"Remove link\",\n },\n edit: {\n text: \"Edit link\",\n tooltip: \"Edit\",\n },\n open: {\n tooltip: \"Open in new tab\",\n },\n form: {\n title_placeholder: \"Edit title\",\n url_placeholder: \"Edit URL\",\n },\n },\n comments: {\n actions: {\n add_reaction: \"Add reaction\",\n resolve: \"Resolve\",\n edit_comment: \"Edit comment\",\n delete_comment: \"Delete comment\",\n more_actions: \"More actions\",\n },\n reactions: {\n reacted_by: \"Reacted by\",\n },\n sidebar: {\n marked_as_resolved: \"Marked as resolved\",\n more_replies: (count: number) => `${count} more replies`,\n },\n },\n generic: {\n ctrl_shortcut: \"Ctrl\",\n },\n};\n"],"names":["en","count"],"mappings":"AAAO,MAAMA,IAAK;AAAA,EAChB,YAAY;AAAA,IACV,SAAS;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,KAAK,YAAY,IAAI;AAAA,MAC/B,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,MAAM,YAAY,YAAY;AAAA,MACxC,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS,CAAC,MAAM,YAAY,YAAY;AAAA,MACxC,OAAO;AAAA,IACT;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS;A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