@blocknote/core 0.20.0 → 0.22.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.js +1602 -1569
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +3 -3
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +3 -3
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +1 -3
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +1 -1
- package/src/api/blockManipulation/selections/selection.ts +5 -5
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteImage.html +111 -0
- package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteTable.html +149 -0
- package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +124 -0
- package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/tableAllCells.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/tableCell.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/tableRow.html +1 -0
- package/src/api/clipboard/clipboardExternal.test.ts +161 -0
- package/src/api/clipboard/{clipboard.test.ts → clipboardInternal.test.ts} +66 -40
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +7 -14
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +6 -6
- package/src/api/clipboard/testUtil.ts +27 -0
- package/src/api/clipboard/toClipboard/copyExtension.ts +8 -2
- package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -1
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +2 -2
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +1 -1
- package/src/api/nodeConversions/nodeToBlock.ts +4 -1
- package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +2 -2
- package/src/api/parsers/markdown/parseMarkdown.test.ts +5 -7
- package/src/api/testUtil/partialBlockTestUtil.ts +4 -1
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +13 -14
- package/src/blocks/FileBlockContent/FileBlockContent.ts +5 -12
- package/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts +5 -0
- package/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts +16 -0
- package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +63 -0
- package/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts +80 -0
- package/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts +24 -0
- package/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts +204 -0
- package/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts +13 -0
- package/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts +15 -0
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +3 -19
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +20 -28
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +3 -15
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -3
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +25 -5
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +20 -27
- package/src/editor/Block.css +38 -54
- package/src/editor/BlockNoteEditor.test.ts +21 -1
- package/src/editor/BlockNoteEditor.ts +14 -7
- package/src/editor/BlockNoteExtensions.ts +7 -8
- package/src/editor/editor.css +7 -6
- package/src/editor/transformPasted.ts +57 -4
- package/src/extensions/LinkToolbar/protocols.ts +13 -0
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +6 -6
- package/src/extensions/SideMenu/SideMenuPlugin.ts +5 -1
- package/src/extensions/SideMenu/dragging.ts +3 -0
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +3 -6
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +15 -3
- package/src/index.ts +9 -2
- package/src/schema/blocks/createSpec.ts +1 -1
- package/src/schema/blocks/internal.ts +16 -6
- package/src/schema/inlineContent/createSpec.ts +2 -2
- package/src/schema/inlineContent/internal.ts +4 -1
- package/src/schema/propTypes.ts +41 -18
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +8 -0
- package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
- package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +2 -3
- package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +1 -3
- package/types/src/api/clipboard/testUtil.d.ts +509 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +8 -0
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +8 -0
- package/types/src/api/testUtil/cases/customStyles.d.ts +8 -0
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +2 -5
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +2 -5
- package/types/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.d.ts +4 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createAddFileButton.d.ts +6 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +9 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.d.ts +6 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.d.ts +9 -0
- package/types/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.d.ts +3 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -5
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +12 -0
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -5
- package/types/src/blocks/defaultBlocks.d.ts +16 -0
- package/types/src/editor/BlockNoteEditor.d.ts +6 -4
- package/types/src/editor/transformPasted.d.ts +8 -4
- package/types/src/extensions/LinkToolbar/protocols.d.ts +2 -0
- package/types/src/index.d.ts +9 -2
- package/types/src/schema/propTypes.d.ts +20 -2
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +0 -30
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +0 -99
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +0 -97
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +0 -88
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +0 -219
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +0 -175
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +0 -57
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +0 -5
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +0 -31
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +0 -71
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +0 -157
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +0 -27
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +0 -67
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +0 -148
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +0 -252
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +0 -1
- package/dist/src/api/blockManipulation/getBlock/getBlock.js +0 -56
- package/dist/src/api/blockManipulation/getBlock/getBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/insertContentAt.js +0 -64
- package/dist/src/api/blockManipulation/insertContentAt.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/selection.js +0 -149
- package/dist/src/api/blockManipulation/selections/selection.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/selection.test.js +0 -39
- package/dist/src/api/blockManipulation/selections/selection.test.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +0 -79
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +0 -33
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +0 -1
- package/dist/src/api/blockManipulation/setupTestEnv.js +0 -172
- package/dist/src/api/blockManipulation/setupTestEnv.js.map +0 -1
- package/dist/src/api/clipboard/clipboard.test.js +0 -246
- package/dist/src/api/clipboard/clipboard.test.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +0 -8
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +0 -38
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +0 -111
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +0 -26
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +0 -57
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +0 -1
- package/dist/src/api/clipboard/toClipboard/copyExtension.js +0 -132
- package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +0 -1
- package/dist/src/api/exporters/html/externalHTMLExporter.js +0 -35
- package/dist/src/api/exporters/html/externalHTMLExporter.js.map +0 -1
- package/dist/src/api/exporters/html/htmlConversion.test.js +0 -72
- package/dist/src/api/exporters/html/htmlConversion.test.js.map +0 -1
- package/dist/src/api/exporters/html/internalHTMLSerializer.js +0 -21
- package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +0 -1
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +0 -141
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +0 -1
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +0 -96
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +0 -1
- package/dist/src/api/exporters/markdown/markdownExporter.js +0 -31
- package/dist/src/api/exporters/markdown/markdownExporter.js.map +0 -1
- package/dist/src/api/exporters/markdown/markdownExporter.test.js +0 -57
- package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +0 -1
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +0 -33
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +0 -1
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +0 -37
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +0 -1
- package/dist/src/api/getBlockInfoFromPos.js +0 -165
- package/dist/src/api/getBlockInfoFromPos.js.map +0 -1
- package/dist/src/api/nodeConversions/blockToNode.js +0 -197
- package/dist/src/api/nodeConversions/blockToNode.js.map +0 -1
- package/dist/src/api/nodeConversions/fragmentToBlocks.js +0 -50
- package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +0 -1
- package/dist/src/api/nodeConversions/nodeConversions.test.js +0 -54
- package/dist/src/api/nodeConversions/nodeConversions.test.js.map +0 -1
- package/dist/src/api/nodeConversions/nodeToBlock.js +0 -316
- package/dist/src/api/nodeConversions/nodeToBlock.js.map +0 -1
- package/dist/src/api/nodeUtil.js +0 -28
- package/dist/src/api/nodeUtil.js.map +0 -1
- package/dist/src/api/parsers/html/parseHTML.js +0 -19
- package/dist/src/api/parsers/html/parseHTML.js.map +0 -1
- package/dist/src/api/parsers/html/parseHTML.test.js +0 -470
- package/dist/src/api/parsers/html/parseHTML.test.js.map +0 -1
- package/dist/src/api/parsers/html/util/nestedLists.js +0 -106
- package/dist/src/api/parsers/html/util/nestedLists.js.map +0 -1
- package/dist/src/api/parsers/html/util/nestedLists.test.js +0 -166
- package/dist/src/api/parsers/html/util/nestedLists.test.js.map +0 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.js +0 -52
- package/dist/src/api/parsers/markdown/parseMarkdown.js.map +0 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js +0 -109
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +0 -1
- package/dist/src/api/testUtil/cases/customBlocks.js +0 -313
- package/dist/src/api/testUtil/cases/customBlocks.js.map +0 -1
- package/dist/src/api/testUtil/cases/customInlineContent.js +0 -91
- package/dist/src/api/testUtil/cases/customInlineContent.js.map +0 -1
- package/dist/src/api/testUtil/cases/customStyles.js +0 -83
- package/dist/src/api/testUtil/cases/customStyles.js.map +0 -1
- package/dist/src/api/testUtil/cases/defaultSchema.js +0 -673
- package/dist/src/api/testUtil/cases/defaultSchema.js.map +0 -1
- package/dist/src/api/testUtil/index.js +0 -2
- package/dist/src/api/testUtil/index.js.map +0 -1
- package/dist/src/api/testUtil/partialBlockTestUtil.js +0 -114
- package/dist/src/api/testUtil/partialBlockTestUtil.js.map +0 -1
- package/dist/src/api/testUtil/paste.js +0 -29
- package/dist/src/api/testUtil/paste.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +0 -97
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js +0 -5
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js.map +0 -1
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +0 -281
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +0 -1
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +0 -110
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js +0 -70
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js +0 -317
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +0 -15
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +0 -1
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +0 -145
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +0 -106
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js +0 -6
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +0 -113
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +0 -224
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +0 -45
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +0 -58
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +0 -130
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +0 -52
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +0 -1
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -129
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +0 -1
- package/dist/src/blocks/TableBlockContent/TableExtension.js +0 -64
- package/dist/src/blocks/TableBlockContent/TableExtension.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +0 -103
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js +0 -6
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js.map +0 -1
- package/dist/src/blocks/defaultBlockHelpers.js +0 -50
- package/dist/src/blocks/defaultBlockHelpers.js.map +0 -1
- package/dist/src/blocks/defaultBlockTypeGuards.js +0 -40
- package/dist/src/blocks/defaultBlockTypeGuards.js.map +0 -1
- package/dist/src/blocks/defaultBlocks.js +0 -50
- package/dist/src/blocks/defaultBlocks.js.map +0 -1
- package/dist/src/blocks/defaultProps.js +0 -19
- package/dist/src/blocks/defaultProps.js.map +0 -1
- package/dist/src/editor/BlockNoteEditor.js +0 -748
- package/dist/src/editor/BlockNoteEditor.js.map +0 -1
- package/dist/src/editor/BlockNoteEditor.test.js +0 -65
- package/dist/src/editor/BlockNoteEditor.test.js.map +0 -1
- package/dist/src/editor/BlockNoteExtensions.js +0 -196
- package/dist/src/editor/BlockNoteExtensions.js.map +0 -1
- package/dist/src/editor/BlockNoteSchema.js +0 -38
- package/dist/src/editor/BlockNoteSchema.js.map +0 -1
- package/dist/src/editor/BlockNoteTipTapEditor.js +0 -169
- package/dist/src/editor/BlockNoteTipTapEditor.js.map +0 -1
- package/dist/src/editor/cursorPositionTypes.js +0 -2
- package/dist/src/editor/cursorPositionTypes.js.map +0 -1
- package/dist/src/editor/defaultColors.js +0 -77
- package/dist/src/editor/defaultColors.js.map +0 -1
- package/dist/src/editor/selectionTypes.js +0 -2
- package/dist/src/editor/selectionTypes.js.map +0 -1
- package/dist/src/editor/transformPasted.js +0 -79
- package/dist/src/editor/transformPasted.js.map +0 -1
- package/dist/src/exporter/Exporter.js +0 -36
- package/dist/src/exporter/Exporter.js.map +0 -1
- package/dist/src/exporter/index.js +0 -3
- package/dist/src/exporter/index.js.map +0 -1
- package/dist/src/exporter/mapping.js +0 -12
- package/dist/src/exporter/mapping.js.map +0 -1
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +0 -30
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +0 -1
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +0 -39
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +0 -1
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js +0 -131
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +0 -1
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +0 -197
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +0 -1
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +0 -341
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +0 -1
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +0 -251
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +0 -1
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +0 -54
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +0 -1
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +0 -90
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +0 -1
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +0 -187
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +0 -1
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +0 -68
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +0 -1
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js +0 -343
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +0 -1
- package/dist/src/extensions/SideMenu/dragging.js +0 -132
- package/dist/src/extensions/SideMenu/dragging.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +0 -2
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +0 -2
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +0 -245
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +0 -26
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +0 -241
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +0 -1
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +0 -570
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +0 -1
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +0 -36
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +0 -1
- package/dist/src/extensions/TextColor/TextColorExtension.js +0 -29
- package/dist/src/extensions/TextColor/TextColorExtension.js.map +0 -1
- package/dist/src/extensions/TextColor/TextColorMark.js +0 -37
- package/dist/src/extensions/TextColor/TextColorMark.js.map +0 -1
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +0 -58
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +0 -1
- package/dist/src/extensions/UniqueID/UniqueID.js +0 -283
- package/dist/src/extensions/UniqueID/UniqueID.js.map +0 -1
- package/dist/src/extensions/getDraggableBlockFromElement.js +0 -13
- package/dist/src/extensions/getDraggableBlockFromElement.js.map +0 -1
- package/dist/src/extensions-shared/UiElementPosition.js +0 -2
- package/dist/src/extensions-shared/UiElementPosition.js.map +0 -1
- package/dist/src/i18n/dictionary.js +0 -4
- package/dist/src/i18n/dictionary.js.map +0 -1
- package/dist/src/i18n/locales/ar.js +0 -298
- package/dist/src/i18n/locales/ar.js.map +0 -1
- package/dist/src/i18n/locales/de.js +0 -313
- package/dist/src/i18n/locales/de.js.map +0 -1
- package/dist/src/i18n/locales/en.js +0 -314
- package/dist/src/i18n/locales/en.js.map +0 -1
- package/dist/src/i18n/locales/es.js +0 -312
- package/dist/src/i18n/locales/es.js.map +0 -1
- package/dist/src/i18n/locales/fr.js +0 -313
- package/dist/src/i18n/locales/fr.js.map +0 -1
- package/dist/src/i18n/locales/hr.js +0 -308
- package/dist/src/i18n/locales/hr.js.map +0 -1
- package/dist/src/i18n/locales/index.js +0 -16
- package/dist/src/i18n/locales/index.js.map +0 -1
- package/dist/src/i18n/locales/is.js +0 -305
- package/dist/src/i18n/locales/is.js.map +0 -1
- package/dist/src/i18n/locales/ja.js +0 -333
- package/dist/src/i18n/locales/ja.js.map +0 -1
- package/dist/src/i18n/locales/ko.js +0 -326
- package/dist/src/i18n/locales/ko.js.map +0 -1
- package/dist/src/i18n/locales/nl.js +0 -313
- package/dist/src/i18n/locales/nl.js.map +0 -1
- package/dist/src/i18n/locales/pl.js +0 -297
- package/dist/src/i18n/locales/pl.js.map +0 -1
- package/dist/src/i18n/locales/pt.js +0 -305
- package/dist/src/i18n/locales/pt.js.map +0 -1
- package/dist/src/i18n/locales/ru.js +0 -340
- package/dist/src/i18n/locales/ru.js.map +0 -1
- package/dist/src/i18n/locales/vi.js +0 -312
- package/dist/src/i18n/locales/vi.js.map +0 -1
- package/dist/src/i18n/locales/zh.js +0 -346
- package/dist/src/i18n/locales/zh.js.map +0 -1
- package/dist/src/index.js +0 -56
- package/dist/src/index.js.map +0 -1
- package/dist/src/pm-nodes/BlockContainer.js +0 -72
- package/dist/src/pm-nodes/BlockContainer.js.map +0 -1
- package/dist/src/pm-nodes/BlockGroup.js +0 -43
- package/dist/src/pm-nodes/BlockGroup.js.map +0 -1
- package/dist/src/pm-nodes/Doc.js +0 -7
- package/dist/src/pm-nodes/Doc.js.map +0 -1
- package/dist/src/pm-nodes/index.js +0 -4
- package/dist/src/pm-nodes/index.js.map +0 -1
- package/dist/src/schema/blocks/createSpec.js +0 -126
- package/dist/src/schema/blocks/createSpec.js.map +0 -1
- package/dist/src/schema/blocks/internal.js +0 -147
- package/dist/src/schema/blocks/internal.js.map +0 -1
- package/dist/src/schema/blocks/types.js +0 -2
- package/dist/src/schema/blocks/types.js.map +0 -1
- package/dist/src/schema/index.js +0 -11
- package/dist/src/schema/index.js.map +0 -1
- package/dist/src/schema/inlineContent/createSpec.js +0 -64
- package/dist/src/schema/inlineContent/createSpec.js.map +0 -1
- package/dist/src/schema/inlineContent/internal.js +0 -52
- package/dist/src/schema/inlineContent/internal.js.map +0 -1
- package/dist/src/schema/inlineContent/types.js +0 -10
- package/dist/src/schema/inlineContent/types.js.map +0 -1
- package/dist/src/schema/propTypes.js +0 -2
- package/dist/src/schema/propTypes.js.map +0 -1
- package/dist/src/schema/styles/createSpec.js +0 -48
- package/dist/src/schema/styles/createSpec.js.map +0 -1
- package/dist/src/schema/styles/internal.js +0 -53
- package/dist/src/schema/styles/internal.js.map +0 -1
- package/dist/src/schema/styles/types.js +0 -2
- package/dist/src/schema/styles/types.js.map +0 -1
- package/dist/src/util/EventEmitter.js +0 -33
- package/dist/src/util/EventEmitter.js.map +0 -1
- package/dist/src/util/browser.js +0 -17
- package/dist/src/util/browser.js.map +0 -1
- package/dist/src/util/combineByGroup.js +0 -20
- package/dist/src/util/combineByGroup.js.map +0 -1
- package/dist/src/util/esmDependencies.js +0 -35
- package/dist/src/util/esmDependencies.js.map +0 -1
- package/dist/src/util/string.js +0 -14
- package/dist/src/util/string.js.map +0 -1
- package/dist/src/util/typescript.js +0 -12
- package/dist/src/util/typescript.js.map +0 -1
- package/src/api/clipboard/__snapshots__/tableAllCells.html +0 -1
- package/src/api/clipboard/__snapshots__/tableCell.html +0 -1
- package/src/api/clipboard/__snapshots__/tableRow.html +0 -1
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +0 -456
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +0 -41
- /package/src/api/clipboard/__snapshots__/{childToParent.html → internal/childToParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{childrenToNextParent.html → internal/childrenToNextParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{childrenToNextParentsChildren.html → internal/childrenToNextParentsChildren.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{image.html → internal/image.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{multipleChildren.html → internal/multipleChildren.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{multipleStyledText.html → internal/multipleStyledText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{nestedImage.html → internal/nestedImage.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{partialChildToParent.html → internal/partialChildToParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{styledText.html → internal/styledText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableCellText.html → internal/tableCellText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{unstyledText.html → internal/unstyledText.html} +0 -0
- /package/src/blocks/AudioBlockContent/{audioBlockHelpers.ts → parseAudioElement.ts} +0 -0
- /package/src/blocks/ImageBlockContent/{imageBlockHelpers.ts → parseImageElement.ts} +0 -0
- /package/src/blocks/VideoBlockContent/{videoBlockHelpers.ts → parseVideoElement.ts} +0 -0
- /package/types/src/api/clipboard/{clipboard.test.d.ts → clipboardExternal.test.d.ts} +0 -0
- /package/types/src/blocks/AudioBlockContent/{audioBlockHelpers.d.ts → parseAudioElement.d.ts} +0 -0
- /package/types/src/blocks/ImageBlockContent/{imageBlockHelpers.d.ts → parseImageElement.d.ts} +0 -0
- /package/types/src/blocks/VideoBlockContent/{videoBlockHelpers.d.ts → parseVideoElement.d.ts} +0 -0
package/src/editor/Block.css
CHANGED
|
@@ -114,13 +114,13 @@ NESTED BLOCKS
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/* HEADINGS*/
|
|
117
|
-
[data-
|
|
117
|
+
[data-content-type="heading"] {
|
|
118
118
|
--level: 3em;
|
|
119
119
|
}
|
|
120
|
-
[data-level="2"] {
|
|
120
|
+
[data-content-type="heading"][data-level="2"] {
|
|
121
121
|
--level: 2em;
|
|
122
122
|
}
|
|
123
|
-
[data-level="3"] {
|
|
123
|
+
[data-content-type="heading"][data-level="3"] {
|
|
124
124
|
--level: 1.3em;
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -310,85 +310,66 @@ NESTED BLOCKS
|
|
|
310
310
|
|
|
311
311
|
/* FILES */
|
|
312
312
|
|
|
313
|
-
/*
|
|
314
|
-
[data-file-block] .bn-file-block-content-wrapper:has(.bn-add-file-button),
|
|
315
|
-
[data-file-block] .bn-file-block-content-wrapper:has(.bn-file-default-preview) {
|
|
316
|
-
width: 100%;
|
|
317
|
-
}
|
|
318
|
-
|
|
313
|
+
/* Element that wraps content for all file blocks */
|
|
319
314
|
[data-file-block] .bn-file-block-content-wrapper {
|
|
320
315
|
cursor: pointer;
|
|
321
316
|
display: flex;
|
|
322
317
|
flex-direction: column;
|
|
323
|
-
justify-content: stretch;
|
|
324
318
|
user-select: none;
|
|
325
319
|
}
|
|
326
320
|
|
|
321
|
+
/* Add block button & default element (name with icon) */
|
|
322
|
+
[data-file-block] .bn-file-block-content-wrapper:has(.bn-add-file-button),
|
|
323
|
+
[data-file-block] .bn-file-block-content-wrapper:has(.bn-file-name-with-icon) {
|
|
324
|
+
width: 100%;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
327
|
[data-file-block] .bn-add-file-button {
|
|
328
328
|
align-items: center;
|
|
329
329
|
background-color: rgb(242, 241, 238);
|
|
330
330
|
border-radius: 4px;
|
|
331
331
|
color: rgb(125, 121, 122);
|
|
332
332
|
display: flex;
|
|
333
|
-
flex-direction: row;
|
|
334
333
|
gap: 10px;
|
|
335
334
|
padding: 12px;
|
|
336
|
-
width: 100%;
|
|
337
335
|
}
|
|
338
336
|
|
|
339
|
-
.bn-editor[contenteditable="true"] [data-file-block] .bn-add-file-button:hover
|
|
337
|
+
.bn-editor[contenteditable="true"] [data-file-block] .bn-add-file-button:hover,
|
|
338
|
+
[data-file-block] .bn-file-name-with-icon:hover,
|
|
339
|
+
.ProseMirror-selectednode .bn-file-name-with-icon{
|
|
340
340
|
background-color: rgb(225, 225, 225);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
[data-file-block] .bn-add-file-button-icon
|
|
343
|
+
[data-file-block] .bn-add-file-button-icon,
|
|
344
|
+
[data-file-block] .bn-file-icon {
|
|
344
345
|
width: 24px;
|
|
345
346
|
height: 24px;
|
|
346
347
|
}
|
|
347
348
|
|
|
348
|
-
[data-file-block] .bn-add-file-button
|
|
349
|
+
[data-file-block] .bn-add-file-button-text {
|
|
349
350
|
font-size: 0.9rem;
|
|
350
351
|
}
|
|
351
352
|
|
|
352
|
-
[data-file-block] .bn-file-
|
|
353
|
-
display: flex;
|
|
354
|
-
flex-direction: column;
|
|
355
|
-
border-radius: 4px;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
[data-file-block] .bn-file-default-preview {
|
|
359
|
-
align-items: center;
|
|
353
|
+
[data-file-block] .bn-file-name-with-icon {
|
|
360
354
|
border-radius: 4px;
|
|
361
355
|
display: flex;
|
|
362
|
-
flex-direction: row;
|
|
363
356
|
gap: 4px;
|
|
364
357
|
padding: 4px;
|
|
365
|
-
width: 100%;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
[data-file-block] .bn-file-default-preview:hover,
|
|
369
|
-
.ProseMirror-selectednode .bn-file-default-preview {
|
|
370
|
-
background-color: rgb(225, 225, 225);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
[data-file-block] .bn-file-default-preview-icon {
|
|
374
|
-
width: 24px;
|
|
375
|
-
height: 24px;
|
|
376
358
|
}
|
|
377
359
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
width: fit-content;
|
|
360
|
+
/* File captions */
|
|
361
|
+
[data-file-block] .bn-file-caption {
|
|
362
|
+
font-size: 0.8em;
|
|
363
|
+
padding-block: 4px;
|
|
364
|
+
word-break: break-word;
|
|
384
365
|
}
|
|
385
366
|
|
|
386
|
-
[data-file-block] .bn-
|
|
387
|
-
|
|
388
|
-
max-width: 100%;
|
|
367
|
+
[data-file-block] .bn-file-caption:empty {
|
|
368
|
+
padding-block: 0;
|
|
389
369
|
}
|
|
390
370
|
|
|
391
|
-
|
|
371
|
+
/* Resize handles */
|
|
372
|
+
[data-file-block] .bn-resize-handle {
|
|
392
373
|
position: absolute;
|
|
393
374
|
width: 8px;
|
|
394
375
|
height: 30px;
|
|
@@ -398,19 +379,22 @@ NESTED BLOCKS
|
|
|
398
379
|
cursor: ew-resize;
|
|
399
380
|
}
|
|
400
381
|
|
|
401
|
-
|
|
402
|
-
.bn-
|
|
403
|
-
|
|
382
|
+
/* Visual media file blocks, e.g. images & videos */
|
|
383
|
+
[data-file-block] .bn-visual-media-wrapper {
|
|
384
|
+
display: flex;
|
|
385
|
+
align-items: center;
|
|
386
|
+
position: relative;
|
|
404
387
|
}
|
|
405
388
|
|
|
406
|
-
[data-file-block] .bn-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
word-break: break-word;
|
|
389
|
+
[data-file-block] .bn-visual-media {
|
|
390
|
+
border-radius: 4px;
|
|
391
|
+
width: 100%;
|
|
410
392
|
}
|
|
411
393
|
|
|
412
|
-
|
|
413
|
-
|
|
394
|
+
/* Block-specific styles */
|
|
395
|
+
[data-content-type="audio"] > .bn-file-block-content-wrapper,
|
|
396
|
+
.bn-audio {
|
|
397
|
+
width: 100%;
|
|
414
398
|
}
|
|
415
399
|
|
|
416
400
|
/* PLACEHOLDERS*/
|
|
@@ -71,6 +71,26 @@ it("adds id attribute when requested", async () => {
|
|
|
71
71
|
);
|
|
72
72
|
editor.replaceBlocks(editor.document, blocks);
|
|
73
73
|
expect(await editor.blocksToFullHTML(editor.document)).toMatchInlineSnapshot(
|
|
74
|
-
`"<div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1" id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1" id="1"><div class="bn-block-content" data-content-type="paragraph"><p class="bn-inline-content">This is a normal text</p></div></div></div><div class="bn-block-outer" data-node-type="blockOuter" data-id="2" id="2"><div class="bn-block" data-node-type="blockContainer" data-id="2" id="2"><div class="bn-block-content" data-content-type="heading"
|
|
74
|
+
`"<div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1" id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1" id="1"><div class="bn-block-content" data-content-type="paragraph"><p class="bn-inline-content">This is a normal text</p></div></div></div><div class="bn-block-outer" data-node-type="blockOuter" data-id="2" id="2"><div class="bn-block" data-node-type="blockContainer" data-id="2" id="2"><div class="bn-block-content" data-content-type="heading"><h1 class="bn-inline-content">And this is a large heading</h1></div></div></div></div>"`
|
|
75
75
|
);
|
|
76
76
|
});
|
|
77
|
+
|
|
78
|
+
it("block prop types", () => {
|
|
79
|
+
// this test checks whether the block props are correctly typed in typescript
|
|
80
|
+
const editor = BlockNoteEditor.create();
|
|
81
|
+
const block = editor.document[0];
|
|
82
|
+
if (block.type === "paragraph") {
|
|
83
|
+
// @ts-expect-error
|
|
84
|
+
const level = block.props.level; // doesn't have level prop
|
|
85
|
+
|
|
86
|
+
// eslint-disable-next-line
|
|
87
|
+
expect(level).toBe(undefined);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (block.type === "heading") {
|
|
91
|
+
const level = block.props.level; // does have level prop
|
|
92
|
+
|
|
93
|
+
// eslint-disable-next-line
|
|
94
|
+
expect(level).toBe(1);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
@@ -93,6 +93,7 @@ import { createInternalHTMLSerializer } from "../api/exporters/html/internalHTML
|
|
|
93
93
|
import { inlineContentToNodes } from "../api/nodeConversions/blockToNode.js";
|
|
94
94
|
import { nodeToBlock } from "../api/nodeConversions/nodeToBlock.js";
|
|
95
95
|
import "../style.css";
|
|
96
|
+
import { EditorView } from "prosemirror-view";
|
|
96
97
|
|
|
97
98
|
export type BlockNoteExtension =
|
|
98
99
|
| AnyExtension
|
|
@@ -274,7 +275,8 @@ export class BlockNoteEditor<
|
|
|
274
275
|
public readonly headless: boolean = false;
|
|
275
276
|
|
|
276
277
|
public readonly _tiptapEditor:
|
|
277
|
-
| BlockNoteTipTapEditor & {
|
|
278
|
+
| Omit<BlockNoteTipTapEditor, "view"> & {
|
|
279
|
+
view: EditorView | undefined;
|
|
278
280
|
contentComponent: any;
|
|
279
281
|
} = undefined as any; // TODO: Type should actually reflect that it can be `undefined` in headless mode
|
|
280
282
|
|
|
@@ -344,7 +346,7 @@ export class BlockNoteEditor<
|
|
|
344
346
|
private onUploadStartCallbacks: ((blockId?: string) => void)[] = [];
|
|
345
347
|
private onUploadEndCallbacks: ((blockId?: string) => void)[] = [];
|
|
346
348
|
|
|
347
|
-
public readonly resolveFileUrl
|
|
349
|
+
public readonly resolveFileUrl?: (url: string) => Promise<string>;
|
|
348
350
|
|
|
349
351
|
public get pmSchema() {
|
|
350
352
|
return this._pmSchema;
|
|
@@ -456,7 +458,7 @@ export class BlockNoteEditor<
|
|
|
456
458
|
};
|
|
457
459
|
}
|
|
458
460
|
|
|
459
|
-
this.resolveFileUrl = newOptions.resolveFileUrl
|
|
461
|
+
this.resolveFileUrl = newOptions.resolveFileUrl;
|
|
460
462
|
this.headless = newOptions._headless;
|
|
461
463
|
|
|
462
464
|
if (newOptions.collaboration && newOptions.initialContent) {
|
|
@@ -542,6 +544,7 @@ export class BlockNoteEditor<
|
|
|
542
544
|
tiptapOptions,
|
|
543
545
|
this.schema.styleSchema
|
|
544
546
|
) as BlockNoteTipTapEditor & {
|
|
547
|
+
view: any;
|
|
545
548
|
contentComponent: any;
|
|
546
549
|
};
|
|
547
550
|
this._pmSchema = this._tiptapEditor.schema;
|
|
@@ -570,15 +573,15 @@ export class BlockNoteEditor<
|
|
|
570
573
|
}
|
|
571
574
|
|
|
572
575
|
public get domElement() {
|
|
573
|
-
return this.
|
|
576
|
+
return this.prosemirrorView?.dom as HTMLDivElement | undefined;
|
|
574
577
|
}
|
|
575
578
|
|
|
576
579
|
public isFocused() {
|
|
577
|
-
return this.
|
|
580
|
+
return this.prosemirrorView?.hasFocus() || false;
|
|
578
581
|
}
|
|
579
582
|
|
|
580
583
|
public focus() {
|
|
581
|
-
this.
|
|
584
|
+
this.prosemirrorView?.focus();
|
|
582
585
|
}
|
|
583
586
|
|
|
584
587
|
public onUploadStart(callback: (blockId?: string) => void) {
|
|
@@ -1198,7 +1201,11 @@ export class BlockNoteEditor<
|
|
|
1198
1201
|
ignoreQueryLength?: boolean;
|
|
1199
1202
|
}
|
|
1200
1203
|
) {
|
|
1201
|
-
const tr = this.prosemirrorView
|
|
1204
|
+
const tr = this.prosemirrorView?.state.tr;
|
|
1205
|
+
if (!tr) {
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1202
1209
|
const transaction =
|
|
1203
1210
|
pluginState && pluginState.deleteTriggerCharacter
|
|
1204
1211
|
? tr.insertText(triggerCharacter)
|
|
@@ -19,6 +19,10 @@ import { FilePanelProsemirrorPlugin } from "../extensions/FilePanel/FilePanelPlu
|
|
|
19
19
|
import { FormattingToolbarProsemirrorPlugin } from "../extensions/FormattingToolbar/FormattingToolbarPlugin.js";
|
|
20
20
|
import { KeyboardShortcutsExtension } from "../extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js";
|
|
21
21
|
import { LinkToolbarProsemirrorPlugin } from "../extensions/LinkToolbar/LinkToolbarPlugin.js";
|
|
22
|
+
import {
|
|
23
|
+
DEFAULT_LINK_PROTOCOL,
|
|
24
|
+
VALID_LINK_PROTOCOLS,
|
|
25
|
+
} from "../extensions/LinkToolbar/protocols.js";
|
|
22
26
|
import { NodeSelectionKeyboardPlugin } from "../extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js";
|
|
23
27
|
import { PlaceholderPlugin } from "../extensions/Placeholder/PlaceholderPlugin.js";
|
|
24
28
|
import { PreviousBlockTypePlugin } from "../extensions/PreviousBlockType/PreviousBlockTypePlugin.js";
|
|
@@ -159,14 +163,9 @@ const getTipTapExtensions = <
|
|
|
159
163
|
// marks:
|
|
160
164
|
Link.extend({
|
|
161
165
|
inclusive: false,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
this.editor.commands.toggleLink({ href: "" });
|
|
166
|
-
return true;
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
},
|
|
166
|
+
}).configure({
|
|
167
|
+
defaultProtocol: DEFAULT_LINK_PROTOCOL,
|
|
168
|
+
protocols: VALID_LINK_PROTOCOLS,
|
|
170
169
|
}),
|
|
171
170
|
...Object.values(opts.styleSpecs).map((styleSpec) => {
|
|
172
171
|
return styleSpec.implementation.mark;
|
package/src/editor/editor.css
CHANGED
|
@@ -86,6 +86,7 @@ Tippy popups that are appended to document.body directly
|
|
|
86
86
|
pointer-events: none;
|
|
87
87
|
position: relative;
|
|
88
88
|
word-break: normal;
|
|
89
|
+
white-space: nowrap !important;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
/* Render the username above the caret */
|
|
@@ -108,7 +109,7 @@ Tippy popups that are appended to document.body directly
|
|
|
108
109
|
padding
|
|
109
110
|
} */
|
|
110
111
|
|
|
111
|
-
.
|
|
112
|
+
.bn-editor [data-content-type="table"] .tableWrapper {
|
|
112
113
|
position: relative;
|
|
113
114
|
top: -16px;
|
|
114
115
|
left: -16px;
|
|
@@ -118,7 +119,7 @@ Tippy popups that are appended to document.body directly
|
|
|
118
119
|
overflow-y: hidden;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
.
|
|
122
|
+
.bn-editor [data-content-type="table"] .tableWrapper-inner {
|
|
122
123
|
/* position: relative; */
|
|
123
124
|
/* top: -16px;
|
|
124
125
|
left: -16px; */
|
|
@@ -126,17 +127,17 @@ Tippy popups that are appended to document.body directly
|
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
/* table related: */
|
|
129
|
-
.bn-editor table {
|
|
130
|
+
.bn-editor [data-content-type="table"] table {
|
|
130
131
|
width: auto !important;
|
|
131
132
|
word-break: break-word;
|
|
132
133
|
}
|
|
133
|
-
.bn-editor th,
|
|
134
|
-
.bn-editor td {
|
|
134
|
+
.bn-editor [data-content-type="table"] th,
|
|
135
|
+
.bn-editor [data-content-type="table"] td {
|
|
135
136
|
border: 1px solid #ddd;
|
|
136
137
|
padding: 3px 5px;
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
.bn-editor th {
|
|
140
|
+
.bn-editor [data-content-type="table"] th {
|
|
140
141
|
font-weight: bold;
|
|
141
142
|
text-align: left;
|
|
142
143
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Fragment, Schema, Slice } from "@tiptap/pm/model";
|
|
2
2
|
import { EditorView } from "@tiptap/pm/view";
|
|
3
3
|
|
|
4
|
+
import { getBlockInfoFromSelection } from "../api/getBlockInfoFromPos.js";
|
|
5
|
+
|
|
4
6
|
// helper function to remove a child from a fragment
|
|
5
7
|
function removeChild(node: Fragment, n: number) {
|
|
6
8
|
const children: any[] = [];
|
|
@@ -49,16 +51,25 @@ export function wrapTableRows(f: Fragment, schema: Schema) {
|
|
|
49
51
|
/**
|
|
50
52
|
* fix for https://github.com/ProseMirror/prosemirror/issues/1430#issuecomment-1822570821
|
|
51
53
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
54
|
+
* This fix wraps pasted ProseMirror nodes in their own `blockContainer` nodes
|
|
55
|
+
* in most cases. This is to ensure that ProseMirror inserts them as separate
|
|
56
|
+
* blocks, which it sometimes doesn't do because it doesn't have enough context
|
|
57
|
+
* about the hierarchy of the pasted nodes. The issue can be seen when pasting
|
|
58
|
+
* e.g. an image or two consecutive paragraphs, where PM tries to nest the
|
|
59
|
+
* pasted block(s) when it shouldn't.
|
|
55
60
|
*
|
|
56
|
-
*
|
|
61
|
+
* However, the fix is not applied in a few cases. See `shouldApplyFix` for
|
|
62
|
+
* which cases are excluded.
|
|
57
63
|
*/
|
|
58
64
|
export function transformPasted(slice: Slice, view: EditorView) {
|
|
59
65
|
let f = Fragment.from(slice.content);
|
|
60
66
|
f = wrapTableRows(f, view.state.schema);
|
|
61
67
|
|
|
68
|
+
if (!shouldApplyFix(f, view)) {
|
|
69
|
+
// Don't apply the fix.
|
|
70
|
+
return new Slice(f, slice.openStart, slice.openEnd);
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
for (let i = 0; i < f.childCount; i++) {
|
|
63
74
|
if (f.child(i).type.spec.group === "blockContent") {
|
|
64
75
|
const content = [f.child(i)];
|
|
@@ -92,3 +103,45 @@ export function transformPasted(slice: Slice, view: EditorView) {
|
|
|
92
103
|
}
|
|
93
104
|
return new Slice(f, slice.openStart, slice.openEnd);
|
|
94
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Used in `transformPasted` to check if the fix there should be applied, i.e.
|
|
109
|
+
* if the pasted fragment should be wrapped in a `blockContainer` node. This
|
|
110
|
+
* will explicitly tell ProseMirror to treat it as a separate block.
|
|
111
|
+
*/
|
|
112
|
+
function shouldApplyFix(fragment: Fragment, view: EditorView) {
|
|
113
|
+
const nodeHasSingleChild = fragment.childCount === 1;
|
|
114
|
+
const nodeHasInlineContent =
|
|
115
|
+
fragment.firstChild?.type.spec.content === "inline*";
|
|
116
|
+
const nodeHasTableContent =
|
|
117
|
+
fragment.firstChild?.type.spec.content === "tableRow+";
|
|
118
|
+
|
|
119
|
+
if (nodeHasSingleChild) {
|
|
120
|
+
if (nodeHasInlineContent) {
|
|
121
|
+
// Case when we paste a single node with inline content, e.g. a paragraph
|
|
122
|
+
// or heading. We want to insert the content in-line for better UX instead
|
|
123
|
+
// of a separate block, so we return false.
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (nodeHasTableContent) {
|
|
128
|
+
// Not ideal that we check selection here, as `transformPasted` is called
|
|
129
|
+
// for both paste and drop events. Drop events can potentially cause
|
|
130
|
+
// issues as they don't always happen at the current selection.
|
|
131
|
+
const blockInfo = getBlockInfoFromSelection(view.state);
|
|
132
|
+
if (blockInfo.isBlockContainer) {
|
|
133
|
+
const selectedBlockHasTableContent =
|
|
134
|
+
blockInfo.blockContent.node.type.spec.content === "tableRow+";
|
|
135
|
+
|
|
136
|
+
// Case for when we paste a single node with table content, i.e. a
|
|
137
|
+
// table. Normally, we return true as we want to ensure the table is
|
|
138
|
+
// inserted as a separate block. However, if the selection is in an
|
|
139
|
+
// existing table, we return false, as we want the content of the pasted
|
|
140
|
+
// table to be added to the existing one for better UX.
|
|
141
|
+
return !selectedBlockHasTableContent;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
@@ -18,10 +18,10 @@ export class PlaceholderPlugin {
|
|
|
18
18
|
if (nonce) {
|
|
19
19
|
styleEl.setAttribute("nonce", nonce);
|
|
20
20
|
}
|
|
21
|
-
if (editor.
|
|
22
|
-
editor.
|
|
21
|
+
if (editor.prosemirrorView?.root instanceof ShadowRoot) {
|
|
22
|
+
editor.prosemirrorView.root.append(styleEl);
|
|
23
23
|
} else {
|
|
24
|
-
editor.
|
|
24
|
+
editor.prosemirrorView?.root.head.appendChild(styleEl);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const styleSheet = styleEl.sheet!;
|
|
@@ -78,10 +78,10 @@ export class PlaceholderPlugin {
|
|
|
78
78
|
|
|
79
79
|
return {
|
|
80
80
|
destroy: () => {
|
|
81
|
-
if (editor.
|
|
82
|
-
editor.
|
|
81
|
+
if (editor.prosemirrorView?.root instanceof ShadowRoot) {
|
|
82
|
+
editor.prosemirrorView.root.removeChild(styleEl);
|
|
83
83
|
} else {
|
|
84
|
-
editor.
|
|
84
|
+
editor.prosemirrorView?.root.head.removeChild(styleEl);
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
};
|
|
@@ -485,7 +485,11 @@ export class SideMenuProsemirrorPlugin<
|
|
|
485
485
|
/**
|
|
486
486
|
* Handles drag & drop events for blocks.
|
|
487
487
|
*/
|
|
488
|
-
blockDragEnd = () =>
|
|
488
|
+
blockDragEnd = () => {
|
|
489
|
+
if (this.editor.prosemirrorView) {
|
|
490
|
+
unsetDragImage(this.editor.prosemirrorView.root);
|
|
491
|
+
}
|
|
492
|
+
};
|
|
489
493
|
/**
|
|
490
494
|
* Freezes the side menu. When frozen, the side menu will stay
|
|
491
495
|
* attached to the same block regardless of which block is hovered by the
|
|
@@ -45,12 +45,12 @@ class SuggestionMenuView<
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
this.rootEl = this.editor.
|
|
48
|
+
this.rootEl = this.editor.prosemirrorView?.root;
|
|
49
49
|
|
|
50
50
|
// Setting capture=true ensures that any parent container of the editor that
|
|
51
51
|
// gets scrolled will trigger the scroll event. Scroll events do not bubble
|
|
52
52
|
// and so won't propagate to the document by default.
|
|
53
|
-
this.rootEl
|
|
53
|
+
this.rootEl?.addEventListener("scroll", this.handleScroll, true);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
handleScroll = () => {
|
|
@@ -113,10 +113,7 @@ class SuggestionMenuView<
|
|
|
113
113
|
|
|
114
114
|
closeMenu = () => {
|
|
115
115
|
this.editor.dispatch(
|
|
116
|
-
this.editor._tiptapEditor.
|
|
117
|
-
suggestionMenuPluginKey,
|
|
118
|
-
null
|
|
119
|
-
)
|
|
116
|
+
this.editor._tiptapEditor.state.tr.setMeta(suggestionMenuPluginKey, null)
|
|
120
117
|
);
|
|
121
118
|
};
|
|
122
119
|
|
|
@@ -742,7 +742,11 @@ export class TableHandlesProsemirrorPlugin<
|
|
|
742
742
|
})
|
|
743
743
|
);
|
|
744
744
|
|
|
745
|
-
|
|
745
|
+
if (!this.editor.prosemirrorView) {
|
|
746
|
+
throw new Error("Editor view not initialized.");
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
setHiddenDragImage(this.editor.prosemirrorView.root);
|
|
746
750
|
event.dataTransfer!.setDragImage(dragImageElement!, 0, 0);
|
|
747
751
|
event.dataTransfer!.effectAllowed = "move";
|
|
748
752
|
};
|
|
@@ -781,7 +785,11 @@ export class TableHandlesProsemirrorPlugin<
|
|
|
781
785
|
})
|
|
782
786
|
);
|
|
783
787
|
|
|
784
|
-
|
|
788
|
+
if (!this.editor.prosemirrorView) {
|
|
789
|
+
throw new Error("Editor view not initialized.");
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
setHiddenDragImage(this.editor.prosemirrorView.root);
|
|
785
793
|
event.dataTransfer!.setDragImage(dragImageElement!, 0, 0);
|
|
786
794
|
event.dataTransfer!.effectAllowed = "copyMove";
|
|
787
795
|
};
|
|
@@ -804,7 +812,11 @@ export class TableHandlesProsemirrorPlugin<
|
|
|
804
812
|
this.editor._tiptapEditor.state.tr.setMeta(tableHandlesPluginKey, null)
|
|
805
813
|
);
|
|
806
814
|
|
|
807
|
-
|
|
815
|
+
if (!this.editor.prosemirrorView) {
|
|
816
|
+
throw new Error("Editor view not initialized.");
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
unsetHiddenDragImage(this.editor.prosemirrorView.root);
|
|
808
820
|
};
|
|
809
821
|
|
|
810
822
|
/**
|
package/src/index.ts
CHANGED
|
@@ -7,10 +7,16 @@ export * from "./api/testUtil/index.js";
|
|
|
7
7
|
export * from "./blocks/AudioBlockContent/AudioBlockContent.js";
|
|
8
8
|
export * from "./blocks/CodeBlockContent/CodeBlockContent.js";
|
|
9
9
|
export * from "./blocks/FileBlockContent/FileBlockContent.js";
|
|
10
|
-
export * from "./blocks/FileBlockContent/
|
|
10
|
+
export * from "./blocks/FileBlockContent/helpers/parse/parseEmbedElement.js";
|
|
11
|
+
export * from "./blocks/FileBlockContent/helpers/parse/parseFigureElement.js";
|
|
12
|
+
export * from "./blocks/FileBlockContent/helpers/render/createAddFileButton.js";
|
|
13
|
+
export * from "./blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js";
|
|
14
|
+
export * from "./blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js";
|
|
15
|
+
export * from "./blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js";
|
|
16
|
+
export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js";
|
|
17
|
+
export * from "./blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js";
|
|
11
18
|
export * from "./blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js";
|
|
12
19
|
export * from "./blocks/ImageBlockContent/ImageBlockContent.js";
|
|
13
|
-
export { parseImageElement } from "./blocks/ImageBlockContent/imageBlockHelpers.js";
|
|
14
20
|
export {
|
|
15
21
|
EMPTY_CELL_HEIGHT,
|
|
16
22
|
EMPTY_CELL_WIDTH,
|
|
@@ -30,6 +36,7 @@ export * from "./extensions-shared/UiElementPosition.js";
|
|
|
30
36
|
export * from "./extensions/FilePanel/FilePanelPlugin.js";
|
|
31
37
|
export * from "./extensions/FormattingToolbar/FormattingToolbarPlugin.js";
|
|
32
38
|
export * from "./extensions/LinkToolbar/LinkToolbarPlugin.js";
|
|
39
|
+
export * from "./extensions/LinkToolbar/protocols.js";
|
|
33
40
|
export * from "./extensions/SideMenu/SideMenuPlugin.js";
|
|
34
41
|
export * from "./extensions/SuggestionMenu/DefaultGridSuggestionItem.js";
|
|
35
42
|
export * from "./extensions/SuggestionMenu/DefaultSuggestionItem.js";
|
|
@@ -148,7 +148,7 @@ export function createBlockSpec<
|
|
|
148
148
|
: "") as T["content"] extends "inline" ? "inline*" : "",
|
|
149
149
|
group: "blockContent",
|
|
150
150
|
selectable: blockConfig.isSelectable ?? true,
|
|
151
|
-
|
|
151
|
+
isolating: true,
|
|
152
152
|
addAttributes() {
|
|
153
153
|
return propsToAttributes(blockConfig.propSchema);
|
|
154
154
|
},
|
|
@@ -46,7 +46,10 @@ export function propsToAttributes(propSchema: PropSchema): Attributes {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
if (
|
|
49
|
+
if (
|
|
50
|
+
(spec.default === undefined && spec.type === "boolean") ||
|
|
51
|
+
(spec.default !== undefined && typeof spec.default === "boolean")
|
|
52
|
+
) {
|
|
50
53
|
if (value === "true") {
|
|
51
54
|
return true;
|
|
52
55
|
}
|
|
@@ -58,7 +61,10 @@ export function propsToAttributes(propSchema: PropSchema): Attributes {
|
|
|
58
61
|
return null;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
|
-
if (
|
|
64
|
+
if (
|
|
65
|
+
(spec.default === undefined && spec.type === "number") ||
|
|
66
|
+
(spec.default !== undefined && typeof spec.default === "number")
|
|
67
|
+
) {
|
|
62
68
|
const asNumber = parseFloat(value);
|
|
63
69
|
const isNumeric =
|
|
64
70
|
!Number.isNaN(asNumber) && Number.isFinite(asNumber);
|
|
@@ -72,12 +78,14 @@ export function propsToAttributes(propSchema: PropSchema): Attributes {
|
|
|
72
78
|
|
|
73
79
|
return value;
|
|
74
80
|
},
|
|
75
|
-
renderHTML: (attributes) =>
|
|
76
|
-
|
|
81
|
+
renderHTML: (attributes) => {
|
|
82
|
+
// don't render to html if the value is the same as the default
|
|
83
|
+
return attributes[name] !== spec.default
|
|
77
84
|
? {
|
|
78
85
|
[camelToDataKebab(name)]: attributes[name],
|
|
79
86
|
}
|
|
80
|
-
: {}
|
|
87
|
+
: {};
|
|
88
|
+
},
|
|
81
89
|
};
|
|
82
90
|
});
|
|
83
91
|
|
|
@@ -173,7 +181,9 @@ export function wrapInBlockStructure<
|
|
|
173
181
|
// which are already added as HTML attributes to the parent `blockContent`
|
|
174
182
|
// element (inheritedProps) and props set to their default values.
|
|
175
183
|
for (const [prop, value] of Object.entries(blockProps)) {
|
|
176
|
-
|
|
184
|
+
const spec = propSchema[prop];
|
|
185
|
+
const defaultValue = spec.default;
|
|
186
|
+
if (!inheritedProps.includes(prop) && value !== defaultValue) {
|
|
177
187
|
blockContent.setAttribute(camelToDataKebab(prop), value);
|
|
178
188
|
}
|
|
179
189
|
}
|
|
@@ -142,8 +142,8 @@ export function createInlineContentSpec<
|
|
|
142
142
|
editor.schema.styleSchema
|
|
143
143
|
);
|
|
144
144
|
|
|
145
|
-
editor.
|
|
146
|
-
editor.
|
|
145
|
+
editor.dispatch(
|
|
146
|
+
editor.prosemirrorView.state.tr.replaceWith(
|
|
147
147
|
getPos(),
|
|
148
148
|
getPos() + node.nodeSize,
|
|
149
149
|
content
|