@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.
- package/dist/blocknote.cjs +1 -1
- package/dist/blocknote.js +4 -4
- package/dist/{blocks-CSfJen16.js → blocks-D0lMxErU.js} +612 -568
- package/dist/blocks-D0lMxErU.js.map +1 -0
- package/dist/blocks-KyMOxPT3.cjs +11 -0
- package/dist/blocks-KyMOxPT3.cjs.map +1 -0
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +2 -2
- package/dist/comments.cjs +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js +17 -14
- package/dist/comments.js.map +1 -1
- package/dist/{en-QsSI16s5.js → en-B9hMApn4.js} +4 -2
- package/dist/en-B9hMApn4.js.map +1 -0
- package/dist/{en-C4ykW581.cjs → en-Cj5r8sW_.cjs} +2 -2
- package/dist/en-Cj5r8sW_.cjs.map +1 -0
- package/dist/{extensions-C3nguvVr.js → extensions-CQFfm5f5.js} +621 -353
- package/dist/extensions-CQFfm5f5.js.map +1 -0
- package/dist/extensions-Cuw3zOdC.cjs +52 -0
- package/dist/extensions-Cuw3zOdC.cjs.map +1 -0
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.js +3 -3
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +68 -24
- package/dist/locales.js.map +1 -1
- package/dist/{src-DQfz4zLM.js → src-DK_8q1j5.js} +1135 -625
- package/dist/src-DK_8q1j5.js.map +1 -0
- package/dist/src-_83jmA7A.cjs +21 -0
- package/dist/src-_83jmA7A.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/dist/yjs.cjs +1 -1
- package/dist/yjs.js +8 -8
- package/package.json +1 -13
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +7 -7
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +5 -3
- package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +5 -5
- package/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap +2550 -291
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +83 -2
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +103 -42
- package/src/api/blockManipulation/commands/nestBlock/__snapshots__/nestBlock.test.ts.snap +0 -143
- package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +12 -12
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +5 -3
- package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +6 -6
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +22 -22
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +12 -8
- package/src/api/blockManipulation/setupTestEnv.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +2 -6
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +7 -2
- package/src/api/clipboard/toClipboard/copyExtension.ts +21 -16
- package/src/api/exporters/markdown/htmlToMarkdown.ts +813 -0
- package/src/api/exporters/markdown/markdownExporter.ts +2 -21
- package/src/api/nodeConversions/blockToNode.ts +3 -2
- package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +122 -107
- package/src/api/parsers/html/util/nestedLists.test.ts +1 -12
- package/src/api/parsers/markdown/markdownToHtml.ts +1194 -0
- package/src/api/parsers/markdown/parseMarkdown.ts +2 -101
- package/src/blocks/Audio/block.ts +1 -4
- package/src/blocks/Code/block.test.ts +258 -0
- package/src/blocks/File/block.ts +1 -4
- package/src/blocks/File/helpers/render/createFileBlockWrapper.ts +7 -2
- package/src/blocks/Image/block.ts +9 -6
- package/src/blocks/ListItem/BulletListItem/block.ts +7 -4
- package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +3 -4
- package/src/blocks/Table/TableExtension.ts +38 -9
- package/src/blocks/Video/block.ts +4 -5
- package/src/blocks/Video/parseVideoElement.ts +2 -1
- package/src/blocks/defaultBlocks.ts +34 -1
- package/src/comments/extension.ts +30 -11
- package/src/editor/Block.css +22 -18
- package/src/editor/BlockNoteEditor.test.ts +10 -4
- package/src/editor/BlockNoteEditor.ts +30 -13
- package/src/editor/managers/BlockManager.ts +10 -6
- package/src/editor/managers/ExtensionManager/extensions.ts +8 -9
- package/src/editor/managers/ExtensionManager/index.ts +80 -25
- package/src/editor/performance.test.ts +2 -2
- package/src/editor/transformPasted.test.ts +295 -0
- package/src/editor/transformPasted.ts +77 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +1 -12
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +0 -11
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
- package/src/extensions/SideMenu/SideMenu.ts +2 -2
- package/src/extensions/SideMenu/dragging.ts +7 -10
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +21 -0
- package/src/extensions/TableHandles/TableHandles.ts +2 -0
- package/src/extensions/TrailingNode/TrailingNode.ts +124 -65
- package/src/extensions/tiptap-extensions/Link/index.ts +1 -1
- package/src/extensions/tiptap-extensions/Link/link.ts +49 -18
- package/src/i18n/locales/ar.ts +3 -1
- package/src/i18n/locales/de.ts +3 -1
- package/src/i18n/locales/en.ts +3 -1
- package/src/i18n/locales/es.ts +3 -1
- package/src/i18n/locales/fa.ts +3 -1
- package/src/i18n/locales/fr.ts +4 -2
- package/src/i18n/locales/he.ts +3 -1
- package/src/i18n/locales/hr.ts +3 -1
- package/src/i18n/locales/is.ts +3 -1
- package/src/i18n/locales/it.ts +3 -1
- package/src/i18n/locales/ja.ts +3 -1
- package/src/i18n/locales/ko.ts +3 -1
- package/src/i18n/locales/nl.ts +3 -1
- package/src/i18n/locales/no.ts +3 -1
- package/src/i18n/locales/pl.ts +3 -1
- package/src/i18n/locales/pt.ts +3 -1
- package/src/i18n/locales/ru.ts +3 -1
- package/src/i18n/locales/sk.ts +3 -1
- package/src/i18n/locales/uk.ts +3 -1
- package/src/i18n/locales/uz.ts +3 -1
- package/src/i18n/locales/vi.ts +3 -1
- package/src/i18n/locales/zh-tw.ts +3 -1
- package/src/i18n/locales/zh.ts +3 -1
- package/types/src/api/blockManipulation/commands/moveBlocks/moveBlocks.d.ts +13 -2
- package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +1 -1
- package/types/src/api/exporters/markdown/htmlToMarkdown.d.ts +11 -0
- package/types/src/api/parsers/markdown/markdownToHtml.d.ts +5 -0
- package/types/src/blocks/Code/block.test.d.ts +1 -0
- package/types/src/blocks/Video/block.d.ts +2 -0
- package/types/src/blocks/Video/parseVideoElement.d.ts +1 -0
- package/types/src/comments/extension.d.ts +2 -1
- package/types/src/editor/BlockNoteEditor.d.ts +20 -6
- package/types/src/editor/managers/BlockManager.d.ts +8 -4
- package/types/src/editor/transformPasted.test.d.ts +1 -0
- package/types/src/extensions/TrailingNode/TrailingNode.d.ts +8 -3
- package/types/src/extensions/tiptap-extensions/Link/index.d.ts +1 -1
- package/types/src/extensions/tiptap-extensions/Link/link.d.ts +12 -0
- package/types/src/i18n/locales/en.d.ts +2 -0
- package/types/src/i18n/locales/fa.d.ts +2 -0
- package/types/src/i18n/locales/sk.d.ts +2 -0
- package/dist/blocks-CSfJen16.js.map +0 -1
- package/dist/blocks-_lpGWKOa.cjs +0 -11
- package/dist/blocks-_lpGWKOa.cjs.map +0 -1
- package/dist/en-C4ykW581.cjs.map +0 -1
- package/dist/en-QsSI16s5.js.map +0 -1
- package/dist/extensions-BfYaEv6F.cjs +0 -2
- package/dist/extensions-BfYaEv6F.cjs.map +0 -1
- package/dist/extensions-C3nguvVr.js.map +0 -1
- package/dist/src-ChTwrMcE.cjs +0 -5
- package/dist/src-ChTwrMcE.cjs.map +0 -1
- package/dist/src-DQfz4zLM.js.map +0 -1
- package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +0 -42
- package/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts +0 -19
- package/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.ts +0 -39
- package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +0 -7
- package/types/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.d.ts +0 -2
- package/types/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.d.ts +0 -6
package/src/i18n/locales/pt.ts
CHANGED
|
@@ -221,7 +221,7 @@ export const pt: Dictionary = {
|
|
|
221
221
|
text_title: "Texto",
|
|
222
222
|
background_title: "Fundo",
|
|
223
223
|
colors: {
|
|
224
|
-
default: "
|
|
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",
|
package/src/i18n/locales/ru.ts
CHANGED
|
@@ -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: "Другие действия",
|
package/src/i18n/locales/sk.ts
CHANGED
|
@@ -228,7 +228,7 @@ export const sk = {
|
|
|
228
228
|
text_title: "Text",
|
|
229
229
|
background_title: "Pozadie",
|
|
230
230
|
colors: {
|
|
231
|
-
default: "
|
|
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",
|
package/src/i18n/locales/uk.ts
CHANGED
|
@@ -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: "Більше дій",
|
package/src/i18n/locales/uz.ts
CHANGED
|
@@ -294,7 +294,7 @@ export const uz: Dictionary = {
|
|
|
294
294
|
text_title: "Matn",
|
|
295
295
|
background_title: "Fon",
|
|
296
296
|
colors: {
|
|
297
|
-
default: "
|
|
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",
|
package/src/i18n/locales/vi.ts
CHANGED
|
@@ -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: "
|
|
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: "更多操作",
|
package/src/i18n/locales/zh.ts
CHANGED
|
@@ -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
|
|
15
|
-
export declare function moveBlocksDown(editor: BlockNoteEditor<any, any, any
|
|
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):
|
|
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 @@
|
|
|
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;
|
|
@@ -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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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<
|
|
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;
|