@blocknote/core 0.49.0 → 0.51.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 (147) hide show
  1. package/dist/blocknote.cjs +1 -1
  2. package/dist/blocknote.js +4 -4
  3. package/dist/{blocks-CSfJen16.js → blocks-D0lMxErU.js} +612 -568
  4. package/dist/blocks-D0lMxErU.js.map +1 -0
  5. package/dist/blocks-KyMOxPT3.cjs +11 -0
  6. package/dist/blocks-KyMOxPT3.cjs.map +1 -0
  7. package/dist/blocks.cjs +1 -1
  8. package/dist/blocks.js +2 -2
  9. package/dist/comments.cjs +1 -1
  10. package/dist/comments.cjs.map +1 -1
  11. package/dist/comments.js +17 -14
  12. package/dist/comments.js.map +1 -1
  13. package/dist/{en-QsSI16s5.js → en-B9hMApn4.js} +4 -2
  14. package/dist/en-B9hMApn4.js.map +1 -0
  15. package/dist/{en-C4ykW581.cjs → en-Cj5r8sW_.cjs} +2 -2
  16. package/dist/en-Cj5r8sW_.cjs.map +1 -0
  17. package/dist/{extensions-C3nguvVr.js → extensions-CQFfm5f5.js} +621 -353
  18. package/dist/extensions-CQFfm5f5.js.map +1 -0
  19. package/dist/extensions-Cuw3zOdC.cjs +52 -0
  20. package/dist/extensions-Cuw3zOdC.cjs.map +1 -0
  21. package/dist/extensions.cjs +1 -1
  22. package/dist/extensions.js +3 -3
  23. package/dist/locales.cjs +1 -1
  24. package/dist/locales.cjs.map +1 -1
  25. package/dist/locales.js +68 -24
  26. package/dist/locales.js.map +1 -1
  27. package/dist/{src-DQfz4zLM.js → src-DK_8q1j5.js} +1135 -625
  28. package/dist/src-DK_8q1j5.js.map +1 -0
  29. package/dist/src-_83jmA7A.cjs +21 -0
  30. package/dist/src-_83jmA7A.cjs.map +1 -0
  31. package/dist/style.css +1 -1
  32. package/dist/webpack-stats.json +1 -1
  33. package/dist/yjs.cjs +1 -1
  34. package/dist/yjs.js +8 -8
  35. package/package.json +1 -13
  36. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +7 -7
  37. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +5 -3
  38. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +5 -5
  39. package/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap +2550 -291
  40. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +83 -2
  41. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +103 -42
  42. package/src/api/blockManipulation/commands/nestBlock/__snapshots__/nestBlock.test.ts.snap +0 -143
  43. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +12 -12
  44. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +5 -3
  45. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +6 -6
  46. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +22 -22
  47. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +12 -8
  48. package/src/api/blockManipulation/setupTestEnv.ts +1 -1
  49. package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +2 -6
  50. package/src/api/clipboard/fromClipboard/pasteExtension.ts +7 -2
  51. package/src/api/clipboard/toClipboard/copyExtension.ts +21 -16
  52. package/src/api/exporters/markdown/htmlToMarkdown.ts +813 -0
  53. package/src/api/exporters/markdown/markdownExporter.ts +2 -21
  54. package/src/api/nodeConversions/blockToNode.ts +3 -2
  55. package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +122 -107
  56. package/src/api/parsers/html/util/nestedLists.test.ts +1 -12
  57. package/src/api/parsers/markdown/markdownToHtml.ts +1194 -0
  58. package/src/api/parsers/markdown/parseMarkdown.ts +2 -101
  59. package/src/blocks/Audio/block.ts +1 -4
  60. package/src/blocks/Code/block.test.ts +258 -0
  61. package/src/blocks/File/block.ts +1 -4
  62. package/src/blocks/File/helpers/render/createFileBlockWrapper.ts +7 -2
  63. package/src/blocks/Image/block.ts +9 -6
  64. package/src/blocks/ListItem/BulletListItem/block.ts +7 -4
  65. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +3 -4
  66. package/src/blocks/Table/TableExtension.ts +38 -9
  67. package/src/blocks/Video/block.ts +4 -5
  68. package/src/blocks/Video/parseVideoElement.ts +2 -1
  69. package/src/blocks/defaultBlocks.ts +34 -1
  70. package/src/comments/extension.ts +30 -11
  71. package/src/editor/Block.css +22 -18
  72. package/src/editor/BlockNoteEditor.test.ts +10 -4
  73. package/src/editor/BlockNoteEditor.ts +30 -13
  74. package/src/editor/managers/BlockManager.ts +10 -6
  75. package/src/editor/managers/ExtensionManager/extensions.ts +8 -9
  76. package/src/editor/managers/ExtensionManager/index.ts +80 -25
  77. package/src/editor/performance.test.ts +2 -2
  78. package/src/editor/transformPasted.test.ts +295 -0
  79. package/src/editor/transformPasted.ts +77 -0
  80. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +1 -12
  81. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +0 -11
  82. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
  83. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
  84. package/src/extensions/SideMenu/SideMenu.ts +2 -2
  85. package/src/extensions/SideMenu/dragging.ts +7 -10
  86. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +21 -0
  87. package/src/extensions/TableHandles/TableHandles.ts +2 -0
  88. package/src/extensions/TrailingNode/TrailingNode.ts +124 -65
  89. package/src/extensions/tiptap-extensions/Link/index.ts +1 -1
  90. package/src/extensions/tiptap-extensions/Link/link.ts +49 -18
  91. package/src/i18n/locales/ar.ts +3 -1
  92. package/src/i18n/locales/de.ts +3 -1
  93. package/src/i18n/locales/en.ts +3 -1
  94. package/src/i18n/locales/es.ts +3 -1
  95. package/src/i18n/locales/fa.ts +3 -1
  96. package/src/i18n/locales/fr.ts +4 -2
  97. package/src/i18n/locales/he.ts +3 -1
  98. package/src/i18n/locales/hr.ts +3 -1
  99. package/src/i18n/locales/is.ts +3 -1
  100. package/src/i18n/locales/it.ts +3 -1
  101. package/src/i18n/locales/ja.ts +3 -1
  102. package/src/i18n/locales/ko.ts +3 -1
  103. package/src/i18n/locales/nl.ts +3 -1
  104. package/src/i18n/locales/no.ts +3 -1
  105. package/src/i18n/locales/pl.ts +3 -1
  106. package/src/i18n/locales/pt.ts +3 -1
  107. package/src/i18n/locales/ru.ts +3 -1
  108. package/src/i18n/locales/sk.ts +3 -1
  109. package/src/i18n/locales/uk.ts +3 -1
  110. package/src/i18n/locales/uz.ts +3 -1
  111. package/src/i18n/locales/vi.ts +3 -1
  112. package/src/i18n/locales/zh-tw.ts +3 -1
  113. package/src/i18n/locales/zh.ts +3 -1
  114. package/types/src/api/blockManipulation/commands/moveBlocks/moveBlocks.d.ts +13 -2
  115. package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +1 -1
  116. package/types/src/api/exporters/markdown/htmlToMarkdown.d.ts +11 -0
  117. package/types/src/api/parsers/markdown/markdownToHtml.d.ts +5 -0
  118. package/types/src/blocks/Code/block.test.d.ts +1 -0
  119. package/types/src/blocks/Video/block.d.ts +2 -0
  120. package/types/src/blocks/Video/parseVideoElement.d.ts +1 -0
  121. package/types/src/comments/extension.d.ts +2 -1
  122. package/types/src/editor/BlockNoteEditor.d.ts +20 -6
  123. package/types/src/editor/managers/BlockManager.d.ts +8 -4
  124. package/types/src/editor/transformPasted.test.d.ts +1 -0
  125. package/types/src/extensions/TrailingNode/TrailingNode.d.ts +8 -3
  126. package/types/src/extensions/tiptap-extensions/Link/index.d.ts +1 -1
  127. package/types/src/extensions/tiptap-extensions/Link/link.d.ts +12 -0
  128. package/types/src/i18n/locales/en.d.ts +2 -0
  129. package/types/src/i18n/locales/fa.d.ts +2 -0
  130. package/types/src/i18n/locales/sk.d.ts +2 -0
  131. package/dist/blocks-CSfJen16.js.map +0 -1
  132. package/dist/blocks-_lpGWKOa.cjs +0 -11
  133. package/dist/blocks-_lpGWKOa.cjs.map +0 -1
  134. package/dist/en-C4ykW581.cjs.map +0 -1
  135. package/dist/en-QsSI16s5.js.map +0 -1
  136. package/dist/extensions-BfYaEv6F.cjs +0 -2
  137. package/dist/extensions-BfYaEv6F.cjs.map +0 -1
  138. package/dist/extensions-C3nguvVr.js.map +0 -1
  139. package/dist/src-ChTwrMcE.cjs +0 -5
  140. package/dist/src-ChTwrMcE.cjs.map +0 -1
  141. package/dist/src-DQfz4zLM.js.map +0 -1
  142. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +0 -42
  143. package/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts +0 -19
  144. package/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts +0 -39
  145. package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +0 -7
  146. package/types/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.d.ts +0 -2
  147. package/types/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.d.ts +0 -6
@@ -221,7 +221,7 @@ export const pt: Dictionary = {
221
221
  text_title: "Texto",
222
222
  background_title: "Fundo",
223
223
  colors: {
224
- default: "Padrão",
224
+ default: "Automático",
225
225
  gray: "Cinza",
226
226
  brown: "Marrom",
227
227
  red: "Vermelho",
@@ -376,9 +376,11 @@ export const pt: Dictionary = {
376
376
  edited: "editado",
377
377
  save_button_text: "Salvar",
378
378
  cancel_button_text: "Cancelar",
379
+ deleted_reference_text: "Conteúdo original excluído",
379
380
  actions: {
380
381
  add_reaction: "Adicionar reação",
381
382
  resolve: "Resolver",
383
+ reopen: "Reabrir",
382
384
  edit_comment: "Editar comentário",
383
385
  delete_comment: "Excluir comentário",
384
386
  more_actions: "Mais ações",
@@ -272,7 +272,7 @@ export const ru: Dictionary = {
272
272
  text_title: "Текст",
273
273
  background_title: "Задний фон",
274
274
  colors: {
275
- default: "По умолчанию",
275
+ default: "Авто",
276
276
  gray: "Серый",
277
277
  brown: "Коричневый",
278
278
  red: "Красный",
@@ -427,9 +427,11 @@ export const ru: Dictionary = {
427
427
  edited: "изменен",
428
428
  save_button_text: "Сохранить",
429
429
  cancel_button_text: "Отменить",
430
+ deleted_reference_text: "Исходный контент удалён",
430
431
  actions: {
431
432
  add_reaction: "Добавить реакцию",
432
433
  resolve: "Решить",
434
+ reopen: "Возобновить",
433
435
  edit_comment: "Редактировать комментарий",
434
436
  delete_comment: "Удалить комментарий",
435
437
  more_actions: "Другие действия",
@@ -228,7 +228,7 @@ export const sk = {
228
228
  text_title: "Text",
229
229
  background_title: "Pozadie",
230
230
  colors: {
231
- default: "Predvolená",
231
+ default: "Automaticky",
232
232
  gray: "Sivá",
233
233
  brown: "Hnedá",
234
234
  red: "Červená",
@@ -382,9 +382,11 @@ export const sk = {
382
382
  edited: "upravený",
383
383
  save_button_text: "Uložiť",
384
384
  cancel_button_text: "Zrušiť",
385
+ deleted_reference_text: "Pôvodný obsah odstránený",
385
386
  actions: {
386
387
  add_reaction: "Pridať reakciu",
387
388
  resolve: "Vyriešiť",
389
+ reopen: "Znovu otvoriť",
388
390
  edit_comment: "Upraviť komentár",
389
391
  delete_comment: "Vymazať komentár",
390
392
  more_actions: "Ďalšie akcie",
@@ -254,7 +254,7 @@ export const uk: Dictionary = {
254
254
  text_title: "Текст",
255
255
  background_title: "Фон",
256
256
  colors: {
257
- default: "За замовчуванням",
257
+ default: "Авто",
258
258
  gray: "Сірий",
259
259
  brown: "Коричневий",
260
260
  red: "Червоний",
@@ -408,9 +408,11 @@ export const uk: Dictionary = {
408
408
  edited: "відредаговано",
409
409
  save_button_text: "Зберегти",
410
410
  cancel_button_text: "Скасувати",
411
+ deleted_reference_text: "Оригінальний вміст видалено",
411
412
  actions: {
412
413
  add_reaction: "Додати реакцію",
413
414
  resolve: "Вирішити",
415
+ reopen: "Відкрити знову",
414
416
  edit_comment: "Редагувати коментар",
415
417
  delete_comment: "Видалити коментар",
416
418
  more_actions: "Більше дій",
@@ -294,7 +294,7 @@ export const uz: Dictionary = {
294
294
  text_title: "Matn",
295
295
  background_title: "Fon",
296
296
  colors: {
297
- default: "Standart",
297
+ default: "Avtomatik",
298
298
  gray: "Kulrang",
299
299
  brown: "Jigarrang",
300
300
  red: "Qizil",
@@ -417,9 +417,11 @@ export const uz: Dictionary = {
417
417
  edited: "tahrirlangan",
418
418
  save_button_text: "Saqlash",
419
419
  cancel_button_text: "Bekor qilish",
420
+ deleted_reference_text: "Asl tarkib o‘chirildi",
420
421
  actions: {
421
422
  add_reaction: "Reaksiya qo‘shish",
422
423
  resolve: "Hal qilish",
424
+ reopen: "Qayta ochish",
423
425
  edit_comment: "Izohni tahrirlash",
424
426
  delete_comment: "Izohni o‘chirish",
425
427
  more_actions: "Boshqa amallar",
@@ -228,7 +228,7 @@ export const vi: Dictionary = {
228
228
  text_title: "Văn bản",
229
229
  background_title: "Nền",
230
230
  colors: {
231
- default: "Mặc định",
231
+ default: "Tự động",
232
232
  gray: "Xám",
233
233
  brown: "Nâu",
234
234
  red: "Đỏ",
@@ -383,9 +383,11 @@ export const vi: Dictionary = {
383
383
  edited: "đã chỉnh sửa",
384
384
  save_button_text: "Lưu",
385
385
  cancel_button_text: "Hủy",
386
+ deleted_reference_text: "Nội dung gốc đã bị xóa",
386
387
  actions: {
387
388
  add_reaction: "Thêm phản ứng",
388
389
  resolve: "Giải quyết",
390
+ reopen: "Mở lại",
389
391
  edit_comment: "Chỉnh sửa bình luận",
390
392
  delete_comment: "Xóa bình luận",
391
393
  more_actions: "Thêm hành động",
@@ -270,7 +270,7 @@ export const zhTW: Dictionary = {
270
270
  text_title: "文字",
271
271
  background_title: "背景色",
272
272
  colors: {
273
- default: "預設",
273
+ default: "自動",
274
274
  gray: "灰色",
275
275
  brown: "棕色",
276
276
  red: "紅色",
@@ -425,9 +425,11 @@ export const zhTW: Dictionary = {
425
425
  edited: "已編輯",
426
426
  save_button_text: "儲存",
427
427
  cancel_button_text: "取消",
428
+ deleted_reference_text: "原始內容已刪除",
428
429
  actions: {
429
430
  add_reaction: "新增回應",
430
431
  resolve: "解決",
432
+ reopen: "重新開啟",
431
433
  edit_comment: "編輯評論",
432
434
  delete_comment: "刪除評論",
433
435
  more_actions: "更多操作",
@@ -270,7 +270,7 @@ export const zh: Dictionary = {
270
270
  text_title: "文本",
271
271
  background_title: "背景色",
272
272
  colors: {
273
- default: "默认",
273
+ default: "自动",
274
274
  gray: "灰色",
275
275
  brown: "棕色",
276
276
  red: "红色",
@@ -425,9 +425,11 @@ export const zh: Dictionary = {
425
425
  edited: "已编辑",
426
426
  save_button_text: "保存",
427
427
  cancel_button_text: "取消",
428
+ deleted_reference_text: "原始内容已删除",
428
429
  actions: {
429
430
  add_reaction: "添加反应",
430
431
  resolve: "解决",
432
+ reopen: "重新打开",
431
433
  edit_comment: "编辑评论",
432
434
  delete_comment: "删除评论",
433
435
  more_actions: "更多操作",
@@ -1,5 +1,16 @@
1
+ import { Block } from "../../../../blocks/defaultBlocks.js";
1
2
  import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor";
2
3
  import { BlockIdentifier } from "../../../../schema/index.js";
4
+ /**
5
+ * Removes the given blocks from the editor, then inserts them before/after a
6
+ * reference block.
7
+ * @param editor The BlockNote editor instance to move the blocks in.
8
+ * @param blocks The blocks to move.
9
+ * @param referenceBlock The reference block to insert the blocks before/after.
10
+ * @param placement Whether to insert the blocks before or after the reference
11
+ * block.
12
+ */
13
+ export declare function moveBlocks(editor: BlockNoteEditor<any, any, any>, blocks: Block<any, any, any>[], referenceBlock: BlockIdentifier, placement: "before" | "after"): void;
3
14
  /**
4
15
  * Removes the selected blocks from the editor, then inserts them before/after a
5
16
  * reference block. Also updates the selection to match the original selection
@@ -11,5 +22,5 @@ import { BlockIdentifier } from "../../../../schema/index.js";
11
22
  * reference block.
12
23
  */
13
24
  export declare function moveSelectedBlocksAndSelection(editor: BlockNoteEditor<any, any, any>, referenceBlock: BlockIdentifier, placement: "before" | "after"): void;
14
- export declare function moveBlocksUp(editor: BlockNoteEditor<any, any, any>): void;
15
- export declare function moveBlocksDown(editor: BlockNoteEditor<any, any, any>): void;
25
+ export declare function moveBlocksUp(editor: BlockNoteEditor<any, any, any>, blockIdentifier?: BlockIdentifier): void;
26
+ export declare function moveBlocksDown(editor: BlockNoteEditor<any, any, any>, blockIdentifier?: BlockIdentifier): void;
@@ -1,2 +1,2 @@
1
1
  import { EditorView } from "prosemirror-view";
2
- export declare function handleVSCodePaste(event: ClipboardEvent, view: EditorView): Promise<boolean>;
2
+ export declare function handleVSCodePaste(event: ClipboardEvent, view: EditorView): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Custom HTML-to-Markdown serializer for BlockNote.
3
+ * Replaces the unified/rehype-remark pipeline with a direct DOM-based implementation.
4
+ *
5
+ * Input: HTML string from createExternalHTMLExporter
6
+ * Output: GFM-compatible markdown string
7
+ */
8
+ /**
9
+ * Convert an HTML string (from BlockNote's external HTML exporter) to markdown.
10
+ */
11
+ export declare function htmlToMarkdown(html: string): string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Convert a markdown string to an HTML string.
3
+ * This is a direct replacement for the unified/remark/rehype pipeline.
4
+ */
5
+ export declare function markdownToHtml(markdown: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -32,11 +32,13 @@ export declare const videoParse: (_config: VideoOptions) => (element: HTMLElemen
32
32
  backgroundColor: string | undefined;
33
33
  url: string | undefined;
34
34
  previewWidth: number | undefined;
35
+ name: string | undefined;
35
36
  } | {
36
37
  backgroundColor: string | undefined;
37
38
  caption: string | undefined;
38
39
  url: string | undefined;
39
40
  previewWidth: number | undefined;
41
+ name: string | undefined;
40
42
  } | undefined;
41
43
  export declare const createVideoBlockSpec: (options?: Partial<{
42
44
  icon: string;
@@ -1,4 +1,5 @@
1
1
  export declare const parseVideoElement: (videoElement: HTMLVideoElement) => {
2
2
  url: string | undefined;
3
3
  previewWidth: number | undefined;
4
+ name: string | undefined;
4
5
  };
@@ -50,6 +50,8 @@ export declare const CommentsExtension: (options: {
50
50
  to: number;
51
51
  }>;
52
52
  }>;
53
+ readonly runsBefore: readonly ["link"];
54
+ readonly tiptapExtensions: readonly [import("@tiptap/core").Mark<any, any>];
53
55
  readonly prosemirrorPlugins: readonly [Plugin<CommentsPluginState>];
54
56
  readonly threadStore: ThreadStore;
55
57
  readonly mount: () => () => void;
@@ -65,6 +67,5 @@ export declare const CommentsExtension: (options: {
65
67
  }) => Promise<void>;
66
68
  readonly userStore: UserStore<User>;
67
69
  readonly commentEditorSchema: CustomBlockNoteSchema<any, any, any> | undefined;
68
- readonly tiptapExtensions: readonly [import("@tiptap/core").Mark<any, any>];
69
70
  }>;
70
71
  export {};
@@ -224,7 +224,8 @@ export interface BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema ext
224
224
  headers?: boolean;
225
225
  };
226
226
  /**
227
- * An option which user can pass with `false` value to disable the automatic creation of a trailing new block on the next line when the user types or edits any block.
227
+ * When the editor document doesn't end in an empty paragraph block, this option causes the editor to render an element simulating one.
228
+ * When clicked by the user, it gets turned into an actual block at the end of the document. This element is not shown when the option is `false`.
228
229
  *
229
230
  * @default true
230
231
  */
@@ -392,9 +393,18 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
392
393
  /**
393
394
  * Mount the editor to a DOM element.
394
395
  *
396
+ * @param element The DOM element to mount the editor's contenteditable into.
397
+ * @param options.portalTarget Where to mount `editor.portalElement` — the
398
+ * container that floating UI (toolbars, menus, etc) portals into. When
399
+ * omitted, defaults to `element.parentElement` (which is the editor's
400
+ * `bn-container` in typical React usage), or to `document.body` /
401
+ * the surrounding shadow root when no parent is available.
402
+ *
395
403
  * @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
396
404
  */
397
- mount: (element: HTMLElement) => void;
405
+ mount: (element: HTMLElement, options?: {
406
+ portalTarget?: HTMLElement | null;
407
+ }) => void;
398
408
  /**
399
409
  * Unmount the editor from the DOM element it is bound to
400
410
  */
@@ -683,15 +693,19 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
683
693
  /**
684
694
  * Moves the selected blocks up. If the previous block has children, moves
685
695
  * them to the end of its children. If there is no previous block, but the
686
- * current blocks share a common parent, moves them out of & before it.
696
+ * current blocks share a common parent, moves them out of & before it. If a
697
+ * `blockIdentifier` is provided, that block is moved instead of the
698
+ * selection, and the selection is left unchanged.
687
699
  */
688
- moveBlocksUp(): void;
700
+ moveBlocksUp(blockIdentifier?: BlockIdentifier): void;
689
701
  /**
690
702
  * Moves the selected blocks down. If the next block has children, moves
691
703
  * them to the start of its children. If there is no next block, but the
692
- * current blocks share a common parent, moves them out of & after it.
704
+ * current blocks share a common parent, moves them out of & after it. If a
705
+ * `blockIdentifier` is provided, that block is moved instead of the
706
+ * selection, and the selection is left unchanged.
693
707
  */
694
- moveBlocksDown(): void;
708
+ moveBlocksDown(blockIdentifier?: BlockIdentifier): void;
695
709
  /**
696
710
  * Exports blocks into a simplified HTML string. To better conform to HTML standards, children of blocks which aren't list
697
711
  * items are un-nested in the output HTML.
@@ -102,13 +102,17 @@ export declare class BlockManager<BSchema extends BlockSchema = DefaultBlockSche
102
102
  /**
103
103
  * Moves the selected blocks up. If the previous block has children, moves
104
104
  * them to the end of its children. If there is no previous block, but the
105
- * current blocks share a common parent, moves them out of & before it.
105
+ * current blocks share a common parent, moves them out of & before it. If a
106
+ * `blockIdentifier` is provided, that block is moved instead of the
107
+ * selection, and the selection is left unchanged.
106
108
  */
107
- moveBlocksUp(): void;
109
+ moveBlocksUp(blockIdentifier?: BlockIdentifier): void;
108
110
  /**
109
111
  * Moves the selected blocks down. If the next block has children, moves
110
112
  * them to the start of its children. If there is no next block, but the
111
- * current blocks share a common parent, moves them out of & after it.
113
+ * current blocks share a common parent, moves them out of & after it. If a
114
+ * `blockIdentifier` is provided, that block is moved instead of the
115
+ * selection, and the selection is left unchanged.
112
116
  */
113
- moveBlocksDown(): void;
117
+ moveBlocksDown(blockIdentifier?: BlockIdentifier): void;
114
118
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,13 @@
1
1
  import { Plugin } from "prosemirror-state";
2
+ import { DecorationSet } from "prosemirror-view";
2
3
  /**
3
- * Add a trailing node to the document so the user can always click at the bottom of the document and start typing
4
+ * Renders a fake trailing block as a widget decoration after the last block of
5
+ * the document. Clicking it inserts a real trailing block and moves the
6
+ * selection into it. This way the trailing block is not part of the document
7
+ * content, so it doesn't appear when the editor is read-only or when the
8
+ * content is exported.
4
9
  */
5
- export declare const TrailingNodeExtension: () => import("../../index.js").ExtensionFactoryInstance<{
10
+ export declare const TrailingNodeExtension: (options?: Record<string, any> | undefined) => import("../../index.js").ExtensionFactoryInstance<{
6
11
  readonly key: "trailingNode";
7
- readonly prosemirrorPlugins: readonly [Plugin<void>];
12
+ readonly prosemirrorPlugins: readonly [Plugin<DecorationSet>];
8
13
  }>;
@@ -1,2 +1,2 @@
1
- export { Link } from "./link.js";
1
+ export { Link, LinkExtension } from "./link.js";
2
2
  export { isAllowedUri } from "./link.js";
@@ -11,3 +11,15 @@ export type LinkOptions = {
11
11
  * BlockNote Link mark extension.
12
12
  */
13
13
  export declare const Link: Mark<LinkOptions, any>;
14
+ type LinkExtensionOptions = {
15
+ HTMLAttributes?: Record<string, any>;
16
+ onClick?: (event: MouseEvent, editor: BlockNoteEditor<any, any, any>) => boolean | void;
17
+ isValidLink?: (href: string) => boolean;
18
+ };
19
+ /**
20
+ * BlockNote extension wrapping the {@link Link} TipTap mark. Wrapping the mark
21
+ * lets other extensions order their click handlers relative to the link click
22
+ * handler via `runsBefore: ["link"]`.
23
+ */
24
+ export declare const LinkExtension: (options: LinkExtensionOptions) => import("../../../index.js").ExtensionFactoryInstance<import("../../../index.js").Extension<any, string>>;
25
+ export {};
@@ -299,9 +299,11 @@ export declare const en: {
299
299
  edited: string;
300
300
  save_button_text: string;
301
301
  cancel_button_text: string;
302
+ deleted_reference_text: string;
302
303
  actions: {
303
304
  add_reaction: string;
304
305
  resolve: string;
306
+ reopen: string;
305
307
  edit_comment: string;
306
308
  delete_comment: string;
307
309
  more_actions: string;
@@ -299,9 +299,11 @@ export declare const fa: {
299
299
  edited: string;
300
300
  save_button_text: string;
301
301
  cancel_button_text: string;
302
+ deleted_reference_text: string;
302
303
  actions: {
303
304
  add_reaction: string;
304
305
  resolve: string;
306
+ reopen: string;
305
307
  edit_comment: string;
306
308
  delete_comment: string;
307
309
  more_actions: string;
@@ -334,9 +334,11 @@ export declare const sk: {
334
334
  edited: string;
335
335
  save_button_text: string;
336
336
  cancel_button_text: string;
337
+ deleted_reference_text: string;
337
338
  actions: {
338
339
  add_reaction: string;
339
340
  resolve: string;
341
+ reopen: string;
340
342
  edit_comment: string;
341
343
  delete_comment: string;
342
344
  more_actions: string;