@blocknote/core 0.51.4 → 0.52.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/BlockNoteExtension-B_IEJHS8.js +38 -0
- package/dist/BlockNoteExtension-B_IEJHS8.js.map +1 -0
- package/dist/BlockNoteExtension-M0znTzxP.cjs +2 -0
- package/dist/BlockNoteExtension-M0znTzxP.cjs.map +1 -0
- package/dist/ThreadStore-Bx-gSEh1.cjs +2 -0
- package/dist/ThreadStore-Bx-gSEh1.cjs.map +1 -0
- package/dist/ThreadStore-et9wB5Xt.js +11 -0
- package/dist/ThreadStore-et9wB5Xt.js.map +1 -0
- package/dist/UserStore-DCG6lsla.cjs +2 -0
- package/dist/UserStore-DCG6lsla.cjs.map +1 -0
- package/dist/UserStore-QbbPFj0z.js +73 -0
- package/dist/UserStore-QbbPFj0z.js.map +1 -0
- package/dist/blocknote.cjs +1 -1
- package/dist/blocknote.js +6 -7
- package/dist/blocks-BqHv0xhc.cjs +12 -0
- package/dist/blocks-BqHv0xhc.cjs.map +1 -0
- package/dist/{blocks-DGsP5WKr.js → blocks-CiuUGa1E.js} +1093 -994
- package/dist/blocks-CiuUGa1E.js.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 +75 -340
- package/dist/comments.js.map +1 -1
- package/dist/{en-Cj5r8sW_.cjs → en-C5Z4Ag9_.cjs} +2 -2
- package/dist/en-C5Z4Ag9_.cjs.map +1 -0
- package/dist/{en-B9hMApn4.js → en-CGKXfWma.js} +9 -1
- package/dist/en-CGKXfWma.js.map +1 -0
- package/dist/{extensions-Co4y7P63.js → extensions-CrUGDOks.js} +655 -583
- package/dist/extensions-CrUGDOks.js.map +1 -0
- package/dist/extensions-Ghr9QqqR.cjs +52 -0
- package/dist/extensions-Ghr9QqqR.cjs.map +1 -0
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.js +4 -4
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +177 -1
- package/dist/locales.js.map +1 -1
- package/dist/{src-Bcud0PIg.js → src-DTF83Cl9.js} +1243 -1297
- package/dist/src-DTF83Cl9.js.map +1 -0
- package/dist/src-OfbaVbMw.cjs +21 -0
- package/dist/src-OfbaVbMw.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/dist/y.cjs +2 -0
- package/dist/y.cjs.map +1 -0
- package/dist/y.js +989 -0
- package/dist/y.js.map +1 -0
- package/dist/yjs.cjs +1 -1
- package/dist/yjs.cjs.map +1 -1
- package/dist/yjs.js +535 -14
- package/dist/yjs.js.map +1 -1
- package/package.json +46 -19
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +1 -1
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +1 -1
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +3 -3
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +25 -20
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +39 -29
- package/src/api/blockManipulation/commands/nestBlock/nestBlock.test.ts +2 -2
- package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +4 -8
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +1 -1
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +21 -9
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +6 -5
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +362 -4
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +240 -30
- package/src/api/blockManipulation/getBlock/getBlock.ts +4 -9
- package/src/api/blockManipulation/selections/selection.ts +3 -6
- package/src/api/blockManipulation/selections/textCursorPosition.ts +10 -10
- package/src/api/blockManipulation/setupTestEnv.ts +1 -1
- package/src/api/blockManipulation/tables/tables.test.ts +1 -1
- package/src/api/clipboard/fromClipboard/fileDropExtension.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +8 -4
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +1 -1
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +2 -1
- package/src/api/exporters/markdown/htmlToMarkdown.ts +79 -43
- package/src/api/getBlockInfoFromPos.test.ts +256 -0
- package/src/api/getBlockInfoFromPos.ts +53 -15
- package/src/api/getBlocksChangedByTransaction.test.ts +2 -1
- package/src/api/getBlocksChangedByTransaction.ts +6 -6
- package/src/api/nodeConversions/blockToNode.test.ts +113 -0
- package/src/api/nodeConversions/blockToNode.ts +15 -3
- package/src/api/nodeConversions/fragmentToBlocks.ts +2 -4
- package/src/api/nodeConversions/nodeToBlock.ts +28 -58
- package/src/api/nodeUtil.ts +6 -2
- package/src/api/parsers/html/parseHTML.ts +1 -1
- package/src/api/parsers/html/util/nestedLists.test.ts +1 -1
- package/src/api/parsers/markdown/detectMarkdown.test.ts +1 -1
- package/src/api/parsers/markdown/markdownToHtml.ts +228 -82
- package/src/api/pmUtil.ts +18 -1
- package/src/api/positionMapping.test.ts +20 -345
- package/src/api/positionMapping.ts +13 -83
- package/src/blocks/Audio/block.ts +1 -1
- package/src/blocks/Code/block.test.ts +14 -7
- package/src/blocks/Code/block.ts +2 -2
- package/src/blocks/Image/block.ts +1 -1
- package/src/blocks/ListItem/CheckListItem/block.test.ts +1 -1
- package/src/blocks/ListItem/ListItemKeyboardShortcuts.ts +2 -2
- package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts +4 -11
- package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +47 -50
- package/src/blocks/Table/TableExtension.test.ts +9 -6
- package/src/blocks/Table/TableExtension.ts +20 -6
- package/src/blocks/Table/block.ts +18 -5
- package/src/blocks/Video/block.ts +1 -1
- package/src/blocks/utils/listItemEnterHandler.ts +3 -2
- package/src/comments/extension.ts +30 -21
- package/src/comments/index.ts +0 -3
- package/src/comments/mark.ts +4 -0
- package/src/comments/threadstore/ThreadStore.ts +4 -8
- package/src/comments/types.ts +0 -8
- package/src/editor/Block.css +307 -3
- package/src/editor/BlockNoteEditor.test.ts +21 -18
- package/src/editor/BlockNoteEditor.ts +22 -57
- package/src/editor/BlockNoteExtension.test.ts +1 -1
- package/src/editor/managers/BlockManager.ts +1 -1
- package/src/editor/managers/ExtensionManager/ExtensionManager.test.ts +249 -0
- package/src/editor/managers/ExtensionManager/extensions.ts +7 -18
- package/src/editor/managers/ExtensionManager/index.ts +168 -68
- package/src/editor/managers/StateManager.ts +4 -3
- package/src/editor/performance.test.ts +14 -1
- package/src/editor/transformPasted.test.ts +1 -1
- package/src/extensions/Placeholder/Placeholder.ts +1 -0
- package/src/extensions/PositionMapping/PositionMapping.ts +68 -0
- package/src/extensions/PreviousBlockType/PreviousBlockType.test.ts +14 -1
- package/src/extensions/PreviousBlockType/PreviousBlockType.ts +14 -11
- package/src/extensions/SideMenu/SideMenu.ts +9 -2
- package/src/extensions/SuggestionMenu/SuggestionMenu.test.ts +1 -1
- package/src/extensions/TableHandles/TableHandles.ts +18 -20
- package/src/extensions/TrailingNode/TrailingNode.ts +33 -1
- package/src/extensions/Versioning/Versioning.test.ts +435 -0
- package/src/extensions/Versioning/Versioning.ts +628 -0
- package/src/extensions/Versioning/inMemoryVersioning.test.ts +469 -0
- package/src/extensions/Versioning/inMemoryVersioning.ts +263 -0
- package/src/extensions/Versioning/index.ts +2 -0
- package/src/extensions/index.ts +6 -9
- package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.ts +155 -0
- package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +6 -8
- package/src/extensions/tiptap-extensions/Link/helpers/autolink.ts +9 -9
- package/src/extensions/tiptap-extensions/Link/helpers/linkDetector.ts +8 -10
- package/src/extensions/tiptap-extensions/Link/helpers/whitespace.ts +2 -2
- package/src/extensions/tiptap-extensions/Link/link.test.ts +26 -22
- package/src/extensions/tiptap-extensions/UniqueID/UniqueID.test.ts +187 -0
- package/src/extensions/tiptap-extensions/UniqueID/UniqueID.ts +37 -24
- package/src/extensions/tiptap-extensions/index.ts +1 -25
- package/src/i18n/locales/ar.ts +9 -0
- package/src/i18n/locales/de.ts +9 -0
- package/src/i18n/locales/en.ts +10 -1
- package/src/i18n/locales/es.ts +9 -0
- package/src/i18n/locales/fa.ts +11 -1
- package/src/i18n/locales/fr.ts +9 -0
- package/src/i18n/locales/he.ts +10 -1
- package/src/i18n/locales/hr.ts +10 -0
- package/src/i18n/locales/is.ts +10 -0
- package/src/i18n/locales/it.ts +9 -0
- package/src/i18n/locales/ja.ts +9 -0
- package/src/i18n/locales/ko.ts +9 -0
- package/src/i18n/locales/nl.ts +10 -0
- package/src/i18n/locales/no.ts +10 -0
- package/src/i18n/locales/pl.ts +9 -0
- package/src/i18n/locales/pt.ts +10 -0
- package/src/i18n/locales/ru.ts +10 -0
- package/src/i18n/locales/sk.ts +10 -1
- package/src/i18n/locales/uk.ts +9 -0
- package/src/i18n/locales/uz.ts +9 -0
- package/src/i18n/locales/vi.ts +9 -0
- package/src/i18n/locales/zh-tw.ts +9 -0
- package/src/i18n/locales/zh.ts +9 -0
- package/src/index.ts +2 -0
- package/src/pm-nodes/BlockContainer.ts +4 -1
- package/src/pm-nodes/BlockGroup.ts +4 -1
- package/src/pm-nodes/Doc.ts +4 -1
- package/src/pm-nodes/suggestionMarks.ts +43 -0
- package/src/schema/blocks/createSpec.test.ts +123 -0
- package/src/schema/blocks/createSpec.ts +82 -24
- package/src/schema/blocks/extendBlockSpec.test.ts +188 -0
- package/src/schema/blocks/internal.ts +13 -43
- package/src/schema/blocks/types.ts +69 -22
- package/src/schema/contentTypePropagation.test.ts +182 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/inlineContent/internal.ts +1 -1
- package/src/schema/inlineContent/types.ts +3 -3
- package/src/schema/markGroups.ts +50 -0
- package/src/user/UserStore.ts +199 -0
- package/src/user/createUserStore.test.ts +126 -0
- package/src/user/index.ts +2 -0
- package/src/user/userColors.ts +72 -0
- package/src/util/string.ts +1 -1
- package/src/util/topo-sort.test.ts +1 -1
- package/src/util/typescript.ts +2 -1
- package/src/vite-env.d.ts +1 -1
- package/src/y/README.md +5 -0
- package/src/{comments/threadstore/yjs → y/comments}/RESTYjsThreadStore.ts +8 -14
- package/src/y/comments/YjsThreadStore.test.ts +295 -0
- package/src/y/comments/YjsThreadStore.ts +358 -0
- package/src/y/comments/YjsThreadStoreBase.ts +50 -0
- package/src/y/comments/index.ts +3 -0
- package/src/y/comments/yjsHelpers.ts +125 -0
- package/src/y/extensions/AttributionExtension.test.ts +86 -0
- package/src/y/extensions/AttributionExtension.ts +378 -0
- package/src/y/extensions/DiffVersioningExtension.test.ts +193 -0
- package/src/y/extensions/DiffVersioningExtension.ts +228 -0
- package/src/y/extensions/ForkYDoc.test.ts +253 -0
- package/src/y/extensions/ForkYDoc.ts +108 -0
- package/src/y/extensions/RelativePositionMapping.test.ts +418 -0
- package/src/y/extensions/RelativePositionMapping.ts +49 -0
- package/src/y/extensions/Suggestions.ts +174 -0
- package/src/y/extensions/Versioning.test.ts +395 -0
- package/src/y/extensions/Versioning.ts +115 -0
- package/src/y/extensions/YAttributionMarks.ts +320 -0
- package/src/{extensions/Collaboration → y/extensions}/YCursorPlugin.ts +15 -7
- package/src/y/extensions/YSync.ts +125 -0
- package/src/y/extensions/blockMatchNodes.ts +182 -0
- package/src/y/extensions/index.ts +156 -0
- package/src/y/index.ts +4 -0
- package/src/y/utils.test.ts +1042 -0
- package/src/y/utils.ts +242 -0
- package/src/y/versioning/__test__/fixtures/activity-all-after.bin +0 -0
- package/src/y/versioning/__test__/fixtures/activity-all-after.json +50 -0
- package/src/y/versioning/__test__/fixtures/activity-all.bin +0 -0
- package/src/y/versioning/__test__/fixtures/activity-all.json +20 -0
- package/src/y/versioning/__test__/fixtures/activity-filtered-after.bin +0 -0
- package/src/y/versioning/__test__/fixtures/activity-filtered-after.json +32 -0
- package/src/y/versioning/__test__/fixtures/activity-filtered-before.json +1 -0
- package/src/y/versioning/__test__/fixtures/changeset.bin +0 -0
- package/src/y/versioning/__test__/fixtures/patch-response.json +4 -0
- package/src/y/versioning/__test__/yhub.test.ts +752 -0
- package/src/y/versioning/index.ts +1 -0
- package/src/y/versioning/yhub.ts +631 -0
- package/src/yjs/README.md +5 -0
- package/src/yjs/comments/RESTYjsThreadStore.ts +166 -0
- package/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStore.test.ts +3 -3
- package/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStore.ts +7 -3
- package/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStoreBase.ts +3 -3
- package/src/yjs/comments/index.ts +3 -0
- package/src/{comments/threadstore/yjs → yjs/comments}/yjsHelpers.ts +5 -1
- package/src/yjs/extensions/FixUpSchema.test.ts +421 -0
- package/src/yjs/extensions/FixUpSchema.ts +88 -0
- package/src/yjs/extensions/ForkYDoc.test.ts +216 -0
- package/src/{extensions/Collaboration → yjs/extensions}/ForkYDoc.ts +38 -57
- package/src/yjs/extensions/RelativePositionMapping.test.ts +418 -0
- package/src/yjs/extensions/RelativePositionMapping.ts +71 -0
- package/src/yjs/extensions/Versioning.test.ts +549 -0
- package/src/yjs/extensions/Versioning.ts +83 -0
- package/src/yjs/extensions/YCursorPlugin.ts +201 -0
- package/src/{extensions/Collaboration → yjs/extensions}/YSync.ts +1 -1
- package/src/yjs/extensions/index.ts +89 -0
- package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/moveColorAttributes.test.ts +1 -1
- package/src/yjs/index.ts +2 -0
- package/src/yjs/utils.test.ts +5 -15
- package/src/yjs/utils.ts +36 -0
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +3 -1
- package/types/src/api/blockManipulation/selections/selection.d.ts +1 -1
- package/types/src/api/getBlockInfoFromPos.d.ts +5 -9
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +4 -6
- package/types/src/api/pmUtil.d.ts +12 -1
- package/types/src/blocks/Audio/block.d.ts +2 -2
- package/types/src/blocks/Code/block.d.ts +2 -2
- package/types/src/blocks/File/block.d.ts +2 -2
- package/types/src/blocks/Heading/block.d.ts +21 -21
- package/types/src/blocks/Image/block.d.ts +3 -3
- package/types/src/blocks/ListItem/CheckListItem/block.d.ts +6 -6
- package/types/src/blocks/ListItem/NumberedListItem/block.d.ts +6 -6
- package/types/src/blocks/Video/block.d.ts +3 -3
- package/types/src/blocks/defaultBlocks.d.ts +17 -17
- package/types/src/comments/extension.d.ts +18 -5
- package/types/src/comments/index.d.ts +0 -3
- package/types/src/comments/threadstore/ThreadStore.d.ts +4 -8
- package/types/src/comments/types.d.ts +0 -8
- package/types/src/editor/BlockNoteEditor.d.ts +8 -9
- package/types/src/editor/managers/BlockManager.d.ts +1 -1
- package/types/src/editor/managers/ExtensionManager/extensions.d.ts +2 -2
- package/types/src/editor/managers/ExtensionManager/index.d.ts +13 -0
- package/types/src/editor/managers/SelectionManager.d.ts +1 -1
- package/types/src/extensions/PositionMapping/PositionMapping.d.ts +4 -0
- package/types/src/extensions/TableHandles/TableHandles.d.ts +6 -6
- package/types/src/extensions/Versioning/Versioning.d.ts +352 -0
- package/types/src/extensions/Versioning/Versioning.test.d.ts +1 -0
- package/types/src/extensions/Versioning/inMemoryVersioning.d.ts +37 -0
- package/types/src/extensions/Versioning/inMemoryVersioning.test.d.ts +1 -0
- package/types/src/extensions/Versioning/index.d.ts +2 -0
- package/types/src/extensions/index.d.ts +6 -9
- package/types/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.d.ts +1 -0
- package/types/src/extensions/tiptap-extensions/UniqueID/UniqueID.d.ts +6 -1
- package/types/src/extensions/tiptap-extensions/UniqueID/UniqueID.test.d.ts +4 -0
- package/types/src/extensions/tiptap-extensions/index.d.ts +1 -5
- package/types/src/i18n/locales/en.d.ts +9 -1
- package/types/src/i18n/locales/fa.d.ts +9 -1
- package/types/src/i18n/locales/sk.d.ts +9 -1
- package/types/src/index.d.ts +2 -0
- package/types/src/pm-nodes/suggestionMarks.d.ts +26 -0
- package/types/src/schema/blocks/createSpec.d.ts +4 -4
- package/types/src/schema/blocks/createSpec.test.d.ts +1 -0
- package/types/src/schema/blocks/extendBlockSpec.test.d.ts +1 -0
- package/types/src/schema/blocks/internal.d.ts +5 -7
- package/types/src/schema/blocks/types.d.ts +22 -14
- package/types/src/schema/contentTypePropagation.test.d.ts +1 -0
- package/types/src/schema/index.d.ts +1 -0
- package/types/src/schema/inlineContent/types.d.ts +3 -3
- package/types/src/schema/markGroups.d.ts +33 -0
- package/types/src/user/UserStore.d.ts +105 -0
- package/types/src/user/createUserStore.test.d.ts +1 -0
- package/types/src/user/index.d.ts +2 -0
- package/types/src/user/userColors.d.ts +36 -0
- package/types/src/y/comments/RESTYjsThreadStore.d.ts +77 -0
- package/types/src/y/comments/YjsThreadStore.d.ts +79 -0
- package/types/src/y/comments/YjsThreadStore.test.d.ts +1 -0
- package/types/src/y/comments/YjsThreadStoreBase.d.ts +15 -0
- package/types/src/y/comments/index.d.ts +3 -0
- package/types/src/y/comments/yjsHelpers.d.ts +13 -0
- package/types/src/y/extensions/AttributionExtension.d.ts +74 -0
- package/types/src/y/extensions/AttributionExtension.test.d.ts +1 -0
- package/types/src/y/extensions/DiffVersioningExtension.d.ts +69 -0
- package/types/src/y/extensions/DiffVersioningExtension.test.d.ts +1 -0
- package/types/src/{extensions/Collaboration → y/extensions}/ForkYDoc.d.ts +4 -2
- package/types/src/y/extensions/ForkYDoc.test.d.ts +1 -0
- package/types/src/y/extensions/RelativePositionMapping.d.ts +4 -0
- package/types/src/y/extensions/RelativePositionMapping.test.d.ts +1 -0
- package/types/src/y/extensions/Suggestions.d.ts +36 -0
- package/types/src/y/extensions/Versioning.d.ts +17 -0
- package/types/src/y/extensions/Versioning.test.d.ts +1 -0
- package/types/src/y/extensions/YAttributionMarks.d.ts +67 -0
- package/types/src/y/extensions/YCursorPlugin.d.ts +14 -0
- package/types/src/y/extensions/YSync.d.ts +32 -0
- package/types/src/y/extensions/blockMatchNodes.d.ts +25 -0
- package/types/src/y/extensions/index.d.ts +189 -0
- package/types/src/y/index.d.ts +4 -0
- package/types/src/y/utils.d.ts +82 -0
- package/types/src/y/utils.test.d.ts +1 -0
- package/types/src/y/versioning/__test__/yhub.test.d.ts +1 -0
- package/types/src/y/versioning/index.d.ts +1 -0
- package/types/src/y/versioning/yhub.d.ts +87 -0
- package/types/src/{comments/threadstore/yjs → yjs/comments}/RESTYjsThreadStore.d.ts +6 -10
- package/types/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStore.d.ts +3 -3
- package/types/src/yjs/comments/YjsThreadStore.test.d.ts +1 -0
- package/types/src/{comments/threadstore/yjs → yjs/comments}/YjsThreadStoreBase.d.ts +3 -3
- package/types/src/yjs/comments/index.d.ts +3 -0
- package/types/src/{comments/threadstore/yjs → yjs/comments}/yjsHelpers.d.ts +1 -1
- package/types/src/yjs/extensions/FixUpSchema.d.ts +3 -0
- package/types/src/yjs/extensions/FixUpSchema.test.d.ts +1 -0
- package/types/src/yjs/extensions/ForkYDoc.d.ts +27 -0
- package/types/src/yjs/extensions/ForkYDoc.test.d.ts +1 -0
- package/types/src/yjs/extensions/RelativePositionMapping.d.ts +4 -0
- package/types/src/yjs/extensions/RelativePositionMapping.test.d.ts +1 -0
- package/types/src/yjs/extensions/Versioning.d.ts +26 -0
- package/types/src/yjs/extensions/Versioning.test.d.ts +1 -0
- package/types/src/{extensions/Collaboration → yjs/extensions}/YCursorPlugin.d.ts +5 -2
- package/types/src/{extensions/Collaboration → yjs/extensions}/YSync.d.ts +1 -1
- package/types/src/{extensions/Collaboration/Collaboration.d.ts → yjs/extensions/index.d.ts} +36 -15
- package/types/src/yjs/extensions/schemaMigration/migrationRules/moveColorAttributes.test.d.ts +1 -0
- package/types/src/yjs/index.d.ts +2 -0
- package/types/src/yjs/utils.d.ts +5 -0
- package/dist/BlockNoteExtension-B6RhuQ3V.js +0 -27
- package/dist/BlockNoteExtension-B6RhuQ3V.js.map +0 -1
- package/dist/BlockNoteExtension-ab0REuob.cjs +0 -2
- package/dist/BlockNoteExtension-ab0REuob.cjs.map +0 -1
- package/dist/EventEmitter-CuPnGDYt.js +0 -22
- package/dist/EventEmitter-CuPnGDYt.js.map +0 -1
- package/dist/EventEmitter-DHdSnYCD.cjs +0 -2
- package/dist/EventEmitter-DHdSnYCD.cjs.map +0 -1
- package/dist/ShowSelection-BsHFfdMi.js +0 -29
- package/dist/ShowSelection-BsHFfdMi.js.map +0 -1
- package/dist/ShowSelection-DhXglbt8.cjs +0 -2
- package/dist/ShowSelection-DhXglbt8.cjs.map +0 -1
- package/dist/blocks-Bm6IfL1R.cjs +0 -11
- package/dist/blocks-Bm6IfL1R.cjs.map +0 -1
- package/dist/blocks-DGsP5WKr.js.map +0 -1
- package/dist/en-B9hMApn4.js.map +0 -1
- package/dist/en-Cj5r8sW_.cjs.map +0 -1
- package/dist/extensions-Co4y7P63.js.map +0 -1
- package/dist/extensions-IJK3t0sz.cjs +0 -52
- package/dist/extensions-IJK3t0sz.cjs.map +0 -1
- package/dist/src-B6rlChSc.cjs +0 -21
- package/dist/src-B6rlChSc.cjs.map +0 -1
- package/dist/src-Bcud0PIg.js.map +0 -1
- package/src/comments/userstore/UserStore.ts +0 -72
- package/src/extensions/Collaboration/Collaboration.ts +0 -55
- package/src/extensions/Collaboration/ForkYDoc.test.ts +0 -179
- package/src/extensions/tiptap-extensions/Suggestions/SuggestionMarks.ts +0 -175
- package/types/src/comments/userstore/UserStore.d.ts +0 -31
- package/types/src/extensions/tiptap-extensions/Suggestions/SuggestionMarks.d.ts +0 -4
- /package/src/{extensions/Collaboration → yjs/extensions}/YUndo.ts +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap-editor-forked.json +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap-editor.json +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap-forked.html +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/__snapshots__/fork-yjs-snap.html +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/SchemaMigration.ts +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/index.ts +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/migrationRule.ts +0 -0
- /package/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/moveColorAttributes.ts +0 -0
- /package/types/src/{comments/threadstore/yjs/YjsThreadStore.test.d.ts → api/getBlockInfoFromPos.test.d.ts} +0 -0
- /package/types/src/{extensions/Collaboration/ForkYDoc.test.d.ts → api/nodeConversions/blockToNode.test.d.ts} +0 -0
- /package/types/src/{extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.d.ts → editor/managers/ExtensionManager/ExtensionManager.test.d.ts} +0 -0
- /package/types/src/{extensions/Collaboration → yjs/extensions}/YUndo.d.ts +0 -0
- /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/SchemaMigration.d.ts +0 -0
- /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/index.d.ts +0 -0
- /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/migrationRule.d.ts +0 -0
- /package/types/src/{extensions/Collaboration → yjs/extensions}/schemaMigration/migrationRules/moveColorAttributes.d.ts +0 -0
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export type CheckListItemBlockConfig = ReturnType<typeof createCheckListItemConfig>;
|
|
2
2
|
export declare const createCheckListItemConfig: () => import("../../../index.js").BlockConfig<"checkListItem", {
|
|
3
|
-
readonly checked: {
|
|
4
|
-
readonly default: false;
|
|
5
|
-
readonly type: "boolean";
|
|
6
|
-
};
|
|
7
3
|
readonly backgroundColor: {
|
|
8
4
|
default: "default";
|
|
9
5
|
};
|
|
@@ -14,12 +10,12 @@ export declare const createCheckListItemConfig: () => import("../../../index.js"
|
|
|
14
10
|
default: "left";
|
|
15
11
|
values: readonly ["left", "center", "right", "justify"];
|
|
16
12
|
};
|
|
17
|
-
}, "inline">;
|
|
18
|
-
export declare const createCheckListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"checkListItem", {
|
|
19
13
|
readonly checked: {
|
|
20
14
|
readonly default: false;
|
|
21
15
|
readonly type: "boolean";
|
|
22
16
|
};
|
|
17
|
+
}, "inline">;
|
|
18
|
+
export declare const createCheckListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"checkListItem", {
|
|
23
19
|
readonly backgroundColor: {
|
|
24
20
|
default: "default";
|
|
25
21
|
};
|
|
@@ -30,4 +26,8 @@ export declare const createCheckListItemBlockSpec: (options?: Partial<Partial<Re
|
|
|
30
26
|
default: "left";
|
|
31
27
|
values: readonly ["left", "center", "right", "justify"];
|
|
32
28
|
};
|
|
29
|
+
readonly checked: {
|
|
30
|
+
readonly default: false;
|
|
31
|
+
readonly type: "boolean";
|
|
32
|
+
};
|
|
33
33
|
}, "inline">;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export type NumberedListItemBlockConfig = ReturnType<typeof createNumberedListItemBlockConfig>;
|
|
2
2
|
export declare const createNumberedListItemBlockConfig: () => import("../../../index.js").BlockConfig<"numberedListItem", {
|
|
3
|
-
readonly start: {
|
|
4
|
-
readonly default: undefined;
|
|
5
|
-
readonly type: "number";
|
|
6
|
-
};
|
|
7
3
|
readonly backgroundColor: {
|
|
8
4
|
default: "default";
|
|
9
5
|
};
|
|
@@ -14,12 +10,12 @@ export declare const createNumberedListItemBlockConfig: () => import("../../../i
|
|
|
14
10
|
default: "left";
|
|
15
11
|
values: readonly ["left", "center", "right", "justify"];
|
|
16
12
|
};
|
|
17
|
-
}, "inline">;
|
|
18
|
-
export declare const createNumberedListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"numberedListItem", {
|
|
19
13
|
readonly start: {
|
|
20
14
|
readonly default: undefined;
|
|
21
15
|
readonly type: "number";
|
|
22
16
|
};
|
|
17
|
+
}, "inline">;
|
|
18
|
+
export declare const createNumberedListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"numberedListItem", {
|
|
23
19
|
readonly backgroundColor: {
|
|
24
20
|
default: "default";
|
|
25
21
|
};
|
|
@@ -30,4 +26,8 @@ export declare const createNumberedListItemBlockSpec: (options?: Partial<Partial
|
|
|
30
26
|
default: "left";
|
|
31
27
|
values: readonly ["left", "center", "right", "justify"];
|
|
32
28
|
};
|
|
29
|
+
readonly start: {
|
|
30
|
+
readonly default: undefined;
|
|
31
|
+
readonly type: "number";
|
|
32
|
+
};
|
|
33
33
|
}, "inline">;
|
|
@@ -29,16 +29,16 @@ export declare const createVideoBlockConfig: (options: VideoOptions) => import("
|
|
|
29
29
|
};
|
|
30
30
|
}, "none">;
|
|
31
31
|
export declare const videoParse: (_config: VideoOptions) => (element: HTMLElement) => {
|
|
32
|
-
backgroundColor: string | undefined;
|
|
33
32
|
url: string | undefined;
|
|
34
33
|
previewWidth: number | undefined;
|
|
35
34
|
name: string | undefined;
|
|
36
|
-
} | {
|
|
37
35
|
backgroundColor: string | undefined;
|
|
38
|
-
|
|
36
|
+
} | {
|
|
39
37
|
url: string | undefined;
|
|
40
38
|
previewWidth: number | undefined;
|
|
41
39
|
name: string | undefined;
|
|
40
|
+
backgroundColor: string | undefined;
|
|
41
|
+
caption: string | undefined;
|
|
42
42
|
} | undefined;
|
|
43
43
|
export declare const createVideoBlockSpec: (options?: Partial<{
|
|
44
44
|
icon: string;
|
|
@@ -30,10 +30,6 @@ export declare const defaultBlockSpecs: {
|
|
|
30
30
|
};
|
|
31
31
|
}, "inline">;
|
|
32
32
|
readonly checkListItem: import("../index.js").BlockSpec<"checkListItem", {
|
|
33
|
-
readonly checked: {
|
|
34
|
-
readonly default: false;
|
|
35
|
-
readonly type: "boolean";
|
|
36
|
-
};
|
|
37
33
|
readonly backgroundColor: {
|
|
38
34
|
default: "default";
|
|
39
35
|
};
|
|
@@ -44,12 +40,16 @@ export declare const defaultBlockSpecs: {
|
|
|
44
40
|
default: "left";
|
|
45
41
|
values: readonly ["left", "center", "right", "justify"];
|
|
46
42
|
};
|
|
43
|
+
readonly checked: {
|
|
44
|
+
readonly default: false;
|
|
45
|
+
readonly type: "boolean";
|
|
46
|
+
};
|
|
47
47
|
}, "inline">;
|
|
48
48
|
readonly codeBlock: import("../index.js").BlockSpec<"codeBlock", {
|
|
49
49
|
readonly language: {
|
|
50
50
|
readonly default: string;
|
|
51
51
|
};
|
|
52
|
-
}, "
|
|
52
|
+
}, "plain">;
|
|
53
53
|
readonly divider: import("../index.js").BlockSpec<"divider", {}, "none">;
|
|
54
54
|
readonly file: import("../index.js").BlockSpec<"file", {
|
|
55
55
|
readonly backgroundColor: {
|
|
@@ -66,14 +66,6 @@ export declare const defaultBlockSpecs: {
|
|
|
66
66
|
};
|
|
67
67
|
}, "none">;
|
|
68
68
|
readonly heading: import("../index.js").BlockSpec<"heading", {
|
|
69
|
-
readonly isToggleable?: {
|
|
70
|
-
readonly default: false;
|
|
71
|
-
readonly optional: true;
|
|
72
|
-
} | undefined;
|
|
73
|
-
readonly level: {
|
|
74
|
-
readonly default: 1 | 4 | 2 | 3 | 5 | 6;
|
|
75
|
-
readonly values: readonly number[];
|
|
76
|
-
};
|
|
77
69
|
readonly backgroundColor: {
|
|
78
70
|
default: "default";
|
|
79
71
|
};
|
|
@@ -84,6 +76,14 @@ export declare const defaultBlockSpecs: {
|
|
|
84
76
|
default: "left";
|
|
85
77
|
values: readonly ["left", "center", "right", "justify"];
|
|
86
78
|
};
|
|
79
|
+
readonly level: {
|
|
80
|
+
readonly default: 1 | 2 | 3 | 4 | 5 | 6;
|
|
81
|
+
readonly values: readonly number[];
|
|
82
|
+
};
|
|
83
|
+
readonly isToggleable?: {
|
|
84
|
+
readonly default: false;
|
|
85
|
+
readonly optional: true;
|
|
86
|
+
} | undefined;
|
|
87
87
|
}, "inline">;
|
|
88
88
|
readonly image: import("../index.js").BlockSpec<"image", {
|
|
89
89
|
readonly textAlignment: {
|
|
@@ -111,10 +111,6 @@ export declare const defaultBlockSpecs: {
|
|
|
111
111
|
};
|
|
112
112
|
}, "none">;
|
|
113
113
|
readonly numberedListItem: import("../index.js").BlockSpec<"numberedListItem", {
|
|
114
|
-
readonly start: {
|
|
115
|
-
readonly default: undefined;
|
|
116
|
-
readonly type: "number";
|
|
117
|
-
};
|
|
118
114
|
readonly backgroundColor: {
|
|
119
115
|
default: "default";
|
|
120
116
|
};
|
|
@@ -125,6 +121,10 @@ export declare const defaultBlockSpecs: {
|
|
|
125
121
|
default: "left";
|
|
126
122
|
values: readonly ["left", "center", "right", "justify"];
|
|
127
123
|
};
|
|
124
|
+
readonly start: {
|
|
125
|
+
readonly default: undefined;
|
|
126
|
+
readonly type: "number";
|
|
127
|
+
};
|
|
128
128
|
}, "inline">;
|
|
129
129
|
readonly paragraph: import("../index.js").BlockSpec<"paragraph", {
|
|
130
130
|
backgroundColor: {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Plugin } from "prosemirror-state";
|
|
2
2
|
import { DecorationSet } from "prosemirror-view";
|
|
3
|
+
import { UserStoreOrResolver } from "../user/index.js";
|
|
3
4
|
import { CustomBlockNoteSchema } from "../schema/schema.js";
|
|
4
5
|
import type { ThreadStore } from "./threadstore/ThreadStore.js";
|
|
5
6
|
import type { CommentBody } from "./types.js";
|
|
6
|
-
import { User } from "./types.js";
|
|
7
|
-
import { UserStore } from "./userstore/UserStore.js";
|
|
8
7
|
type CommentsPluginState = {
|
|
9
8
|
/**
|
|
10
9
|
* Decorations to be rendered, specifically to indicate the selected thread
|
|
@@ -17,15 +16,28 @@ export declare const CommentsExtension: (options: {
|
|
|
17
16
|
*/
|
|
18
17
|
threadStore: ThreadStore;
|
|
19
18
|
/**
|
|
20
|
-
* Resolve user information for
|
|
19
|
+
* Resolve user information (names, avatars) for comment authors.
|
|
20
|
+
*
|
|
21
|
+
* Either a resolver function (called with the ids of users that are not yet
|
|
22
|
+
* cached, returning their information) or a pre-built user store (see
|
|
23
|
+
* `createUserStore`). Pass the same store to the collaboration options so a
|
|
24
|
+
* single de-duped user cache is shared across comments and collaboration.
|
|
21
25
|
*
|
|
22
26
|
* See [Comments](https://www.blocknotejs.org/docs/features/collaboration/comments) for more info.
|
|
23
27
|
*/
|
|
24
|
-
resolveUsers:
|
|
28
|
+
resolveUsers: UserStoreOrResolver;
|
|
25
29
|
/**
|
|
26
30
|
* A schema to use for the comment editor (which allows you to customize the blocks and styles that are available in the comment editor)
|
|
27
31
|
*/
|
|
28
32
|
schema?: CustomBlockNoteSchema<any, any, any>;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to ask the user for confirmation before discarding unsaved text
|
|
35
|
+
* in a comment composer (a new comment, a reply, or an in-progress edit)
|
|
36
|
+
* when it's dismissed (e.g. by clicking outside or pressing Escape).
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
confirmBeforeDiscard?: boolean;
|
|
29
41
|
}) => import("../index.js").ExtensionFactoryInstance<{
|
|
30
42
|
readonly key: "comments";
|
|
31
43
|
readonly store: import("@tanstack/store").Store<{
|
|
@@ -50,6 +62,7 @@ export declare const CommentsExtension: (options: {
|
|
|
50
62
|
to: number;
|
|
51
63
|
}>;
|
|
52
64
|
}>;
|
|
65
|
+
readonly userStore: import("../index.js").UserStore<import("../index.js").User>;
|
|
53
66
|
readonly runsBefore: readonly ["link"];
|
|
54
67
|
readonly tiptapExtensions: readonly [import("@tiptap/core").Mark<any, any>];
|
|
55
68
|
readonly prosemirrorPlugins: readonly [Plugin<CommentsPluginState>];
|
|
@@ -65,7 +78,7 @@ export declare const CommentsExtension: (options: {
|
|
|
65
78
|
};
|
|
66
79
|
metadata?: any;
|
|
67
80
|
}) => Promise<void>;
|
|
68
|
-
readonly userStore: UserStore<User>;
|
|
69
81
|
readonly commentEditorSchema: CustomBlockNoteSchema<any, any, any> | undefined;
|
|
82
|
+
readonly confirmBeforeDiscard: boolean;
|
|
70
83
|
}>;
|
|
71
84
|
export {};
|
|
@@ -4,7 +4,4 @@ export * from "./threadstore/DefaultThreadStoreAuth.js";
|
|
|
4
4
|
export * from "./threadstore/ThreadStore.js";
|
|
5
5
|
export * from "./threadstore/ThreadStoreAuth.js";
|
|
6
6
|
export * from "./threadstore/TipTapThreadStore.js";
|
|
7
|
-
export * from "./threadstore/yjs/RESTYjsThreadStore.js";
|
|
8
|
-
export * from "./threadstore/yjs/YjsThreadStore.js";
|
|
9
|
-
export * from "./threadstore/yjs/YjsThreadStoreBase.js";
|
|
10
7
|
export * from "./types.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
1
2
|
import { CommentBody, CommentData, ThreadData } from "../types.js";
|
|
2
3
|
import { ThreadStoreAuth } from "./ThreadStoreAuth.js";
|
|
3
4
|
/**
|
|
@@ -18,15 +19,10 @@ export declare abstract class ThreadStore {
|
|
|
18
19
|
abstract addThreadToDocument?(options: {
|
|
19
20
|
threadId: string;
|
|
20
21
|
selection: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
anchor: number;
|
|
24
|
-
};
|
|
25
|
-
yjs?: {
|
|
26
|
-
head: any;
|
|
27
|
-
anchor: any;
|
|
28
|
-
};
|
|
22
|
+
head: number;
|
|
23
|
+
anchor: number;
|
|
29
24
|
};
|
|
25
|
+
editor: BlockNoteEditor<any, any, any>;
|
|
30
26
|
}): Promise<void>;
|
|
31
27
|
/**
|
|
32
28
|
* Creates a new thread with an initial comment.
|
|
@@ -3,7 +3,6 @@ import { type Command, type Transaction } from "@tiptap/pm/state";
|
|
|
3
3
|
import { Node, Schema } from "prosemirror-model";
|
|
4
4
|
import type { BlocksChanged } from "../api/getBlocksChangedByTransaction.js";
|
|
5
5
|
import { Block, BlockNoteSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from "../blocks/index.js";
|
|
6
|
-
import type { CollaborationOptions } from "../extensions/Collaboration/Collaboration.js";
|
|
7
6
|
import { DropCursorOptions } from "../extensions/index.js";
|
|
8
7
|
import type { Dictionary } from "../i18n/dictionary.js";
|
|
9
8
|
import type { BlockIdentifier, BlockNoteDOMAttributes, BlockSchema, BlockSpecs, CustomBlockNoteSchema, InlineContentSchema, InlineContentSpecs, PartialInlineContent, Styles, StyleSchema, StyleSpecs } from "../schema/index.js";
|
|
@@ -28,11 +27,6 @@ export interface BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema ext
|
|
|
28
27
|
* @default false
|
|
29
28
|
*/
|
|
30
29
|
autofocus?: FocusPosition;
|
|
31
|
-
/**
|
|
32
|
-
* When enabled, allows for collaboration between multiple users.
|
|
33
|
-
* See [Real-time Collaboration](https://www.blocknotejs.org/docs/advanced/real-time-collaboration) for more info.
|
|
34
|
-
*/
|
|
35
|
-
collaboration?: CollaborationOptions;
|
|
36
30
|
/**
|
|
37
31
|
* Use default BlockNote font and reset the styles of <p> <li> <h1> elements etc., that are used in BlockNote.
|
|
38
32
|
*
|
|
@@ -124,7 +118,7 @@ export interface BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema ext
|
|
|
124
118
|
* @deprecated, provide placeholders via dictionary instead
|
|
125
119
|
* @internal
|
|
126
120
|
*/
|
|
127
|
-
placeholders?: Record<string
|
|
121
|
+
placeholders?: Record<string, string | undefined>;
|
|
128
122
|
/**
|
|
129
123
|
* Custom paste handler that can be used to override the default paste behavior.
|
|
130
124
|
*
|
|
@@ -386,6 +380,11 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
386
380
|
* Register extension(s) to the editor
|
|
387
381
|
*/
|
|
388
382
|
registerExtension: ExtensionManager["registerExtension"];
|
|
383
|
+
/**
|
|
384
|
+
* Atomically unregister old extensions and register new ones in a single
|
|
385
|
+
* plugin update, avoiding re-entrant dispatch issues.
|
|
386
|
+
*/
|
|
387
|
+
replaceExtension: ExtensionManager["replaceExtension"];
|
|
389
388
|
/**
|
|
390
389
|
* Get an extension from the editor
|
|
391
390
|
*/
|
|
@@ -546,7 +545,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
546
545
|
* only the part of the block that is included in the selection.
|
|
547
546
|
*/
|
|
548
547
|
getSelectionCutBlocks(expandToWords?: boolean): {
|
|
549
|
-
blocks: Block<Record<string, import("../index.js").BlockConfig<string, import("../index.js").PropSchema, "inline" | "none" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
548
|
+
blocks: Block<Record<string, import("../index.js").BlockConfig<string, import("../index.js").PropSchema, "inline" | "none" | "plain" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
550
549
|
blockCutAtStart: string | undefined;
|
|
551
550
|
blockCutAtEnd: string | undefined;
|
|
552
551
|
_meta: {
|
|
@@ -591,7 +590,7 @@ export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockS
|
|
|
591
590
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
592
591
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
593
592
|
*/
|
|
594
|
-
removeBlocks(blocksToRemove: BlockIdentifier[]): Block<Record<string, import("../index.js").BlockConfig<string, import("../index.js").PropSchema, "inline" | "none" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
593
|
+
removeBlocks(blocksToRemove: BlockIdentifier[]): Block<Record<string, import("../index.js").BlockConfig<string, import("../index.js").PropSchema, "inline" | "none" | "plain" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
595
594
|
/**
|
|
596
595
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
597
596
|
* are at different nesting levels, `blocksToInsert` will be inserted at the position of the first block in
|
|
@@ -71,7 +71,7 @@ export declare class BlockManager<BSchema extends BlockSchema = DefaultBlockSche
|
|
|
71
71
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
72
72
|
* @param blocksToRemove An array of identifiers for existing blocks that should be removed.
|
|
73
73
|
*/
|
|
74
|
-
removeBlocks(blocksToRemove: BlockIdentifier[]): Block<Record<string, import("../../index.js").BlockConfig<string, import("../../index.js").PropSchema, "inline" | "none" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
74
|
+
removeBlocks(blocksToRemove: BlockIdentifier[]): Block<Record<string, import("../../index.js").BlockConfig<string, import("../../index.js").PropSchema, "inline" | "none" | "plain" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
75
75
|
/**
|
|
76
76
|
* Replaces existing blocks in the editor with new blocks. If the blocks that should be removed are not adjacent or
|
|
77
77
|
* are at different nesting levels, `blocksToInsert` will be inserted at the position of the first block in
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyExtension as AnyTiptapExtension } from "@tiptap/core";
|
|
2
|
-
import { BlockNoteEditor, BlockNoteEditorOptions } from "../../BlockNoteEditor.js";
|
|
3
|
-
import { ExtensionFactoryInstance } from "../../BlockNoteExtension.js";
|
|
2
|
+
import type { BlockNoteEditor, BlockNoteEditorOptions } from "../../BlockNoteEditor.js";
|
|
3
|
+
import type { ExtensionFactoryInstance } from "../../BlockNoteExtension.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get all the Tiptap extensions BlockNote is configured with by default
|
|
6
6
|
*/
|
|
@@ -25,6 +25,12 @@ export declare class ExtensionManager {
|
|
|
25
25
|
* We need to keep track of all the plugins for each extension, so that we can remove them when the extension is unregistered
|
|
26
26
|
*/
|
|
27
27
|
private extensionPlugins;
|
|
28
|
+
/**
|
|
29
|
+
* Maps an extension key to the set of extension keys that declared it as a
|
|
30
|
+
* dependency via `blockNoteExtensions`. A sub-extension is a dependency of
|
|
31
|
+
* the extension that declares it, so it must run *before* its parent(s).
|
|
32
|
+
*/
|
|
33
|
+
private blockNoteExtensionDependents;
|
|
28
34
|
constructor(editor: BlockNoteEditor<any, any, any>, options: BlockNoteEditorOptions<any, any, any>);
|
|
29
35
|
/**
|
|
30
36
|
* Register one or more extensions to the editor after the editor is initialized.
|
|
@@ -50,6 +56,13 @@ export declare class ExtensionManager {
|
|
|
50
56
|
* @returns void
|
|
51
57
|
*/
|
|
52
58
|
unregisterExtension(toUnregister: undefined | string | Extension | ExtensionFactory | (Extension | ExtensionFactory | string | undefined)[]): void;
|
|
59
|
+
/**
|
|
60
|
+
* Atomically replace extension instances in the editor.
|
|
61
|
+
* @param toUnregister - The extensions to unregister, can be a string key, an extension instance, an extension factory, or an array of any of those
|
|
62
|
+
* @param toRegister - The extensions to register, can be an extension instance, an extension factory, or an array of any of those
|
|
63
|
+
* @returns void
|
|
64
|
+
*/
|
|
65
|
+
replaceExtension(toUnregister: undefined | string | Extension | ExtensionFactory | (Extension | ExtensionFactory | string | undefined)[], toRegister: Extension | ExtensionFactoryInstance | (Extension | ExtensionFactoryInstance)[]): void;
|
|
53
66
|
/**
|
|
54
67
|
* Allows resetting the current prosemirror state's plugins
|
|
55
68
|
* @param update - A function that takes the current plugins and returns the new plugins
|
|
@@ -21,7 +21,7 @@ export declare class SelectionManager<BSchema extends BlockSchema = DefaultBlock
|
|
|
21
21
|
* only the part of the block that is included in the selection.
|
|
22
22
|
*/
|
|
23
23
|
getSelectionCutBlocks(expandToWords?: boolean): {
|
|
24
|
-
blocks: import("../../index.js").Block<Record<string, import("../../index.js").BlockConfig<string, import("../../index.js").PropSchema, "inline" | "none" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
24
|
+
blocks: import("../../index.js").Block<Record<string, import("../../index.js").BlockConfig<string, import("../../index.js").PropSchema, "inline" | "none" | "plain" | "table">>, InlineContentSchema, StyleSchema>[];
|
|
25
25
|
blockCutAtStart: string | undefined;
|
|
26
26
|
blockCutAtEnd: string | undefined;
|
|
27
27
|
_meta: {
|
|
@@ -31,7 +31,7 @@ export declare class TableHandlesView implements PluginView {
|
|
|
31
31
|
menuFrozen: boolean;
|
|
32
32
|
mouseState: "up" | "down" | "selecting";
|
|
33
33
|
prevWasEditable: boolean | null;
|
|
34
|
-
constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, any, any>, pmView: EditorView, emitUpdate: (state: TableHandlesState) => void);
|
|
34
|
+
constructor(editor: BlockNoteEditor<BlockSchemaWithBlock<"table", DefaultBlockSchema["table"]>, any, any>, pmView: EditorView, emitUpdate: (state: TableHandlesState | undefined) => void);
|
|
35
35
|
viewMousedownHandler: () => void;
|
|
36
36
|
mouseUpHandler: (event: MouseEvent) => void;
|
|
37
37
|
mouseMoveHandler: (event: MouseEvent) => false | undefined;
|
|
@@ -99,7 +99,7 @@ export declare const TableHandlesExtension: (options?: any) => import("../../ind
|
|
|
99
99
|
/**
|
|
100
100
|
* Adds a row or column to the table using prosemirror-table commands
|
|
101
101
|
*/
|
|
102
|
-
readonly addRowOrColumn: (index: RelativeCellIndices["row"]
|
|
102
|
+
readonly addRowOrColumn: (index: RelativeCellIndices["row"], direction: {
|
|
103
103
|
orientation: "row";
|
|
104
104
|
side: "above" | "below";
|
|
105
105
|
} | {
|
|
@@ -109,7 +109,7 @@ export declare const TableHandlesExtension: (options?: any) => import("../../ind
|
|
|
109
109
|
/**
|
|
110
110
|
* Removes a row or column from the table using prosemirror-table commands
|
|
111
111
|
*/
|
|
112
|
-
readonly removeRowOrColumn: (index: RelativeCellIndices["row"]
|
|
112
|
+
readonly removeRowOrColumn: (index: RelativeCellIndices["row"], direction: "row" | "column") => boolean;
|
|
113
113
|
/**
|
|
114
114
|
* Merges the cells in the table block.
|
|
115
115
|
*/
|
|
@@ -139,11 +139,11 @@ export declare const TableHandlesExtension: (options?: any) => import("../../ind
|
|
|
139
139
|
*
|
|
140
140
|
* Returns undefined when there is no cell selection, or the selection is not within a table.
|
|
141
141
|
*/
|
|
142
|
-
readonly getMergeDirection: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any> | undefined) => "
|
|
142
|
+
readonly getMergeDirection: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any> | undefined) => "horizontal" | "vertical" | undefined;
|
|
143
143
|
readonly cropEmptyRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, removeEmpty: "columns" | "rows") => {
|
|
144
|
-
cells: (import("../../index.js").
|
|
144
|
+
cells: (import("../../index.js").CustomInlineContentFromConfig<any, any> | import("../../index.js").Link<any> | import("../../index.js").StyledText<any>)[][] | import("../../index.js").TableCell<any, any>[];
|
|
145
145
|
}[];
|
|
146
146
|
readonly addRowsOrColumns: (block: BlockFromConfigNoChildren<DefaultBlockSchema["table"], any, any>, addType: "columns" | "rows", numToAdd: number) => {
|
|
147
|
-
cells: (import("../../index.js").
|
|
147
|
+
cells: (import("../../index.js").CustomInlineContentFromConfig<any, any> | import("../../index.js").Link<any> | import("../../index.js").StyledText<any>)[][] | import("../../index.js").TableCell<any, any>[];
|
|
148
148
|
}[];
|
|
149
149
|
}>;
|