@blocknote/core 0.28.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.cjs +9 -9
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +3221 -3351
- package/dist/blocknote.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/__snapshots__/blocks-deleted-nested-deep.json +26 -0
- package/src/api/__snapshots__/blocks-deleted-nested.json +68 -0
- package/src/api/__snapshots__/blocks-deleted.json +26 -0
- package/src/api/__snapshots__/blocks-inserted-nested.json +62 -0
- package/src/api/__snapshots__/blocks-inserted.json +20 -0
- package/src/api/__snapshots__/blocks-updated-content-inserted.json +42 -0
- package/src/api/__snapshots__/blocks-updated-multiple-insert.json +50 -0
- package/src/api/__snapshots__/blocks-updated-multiple.json +82 -0
- package/src/api/__snapshots__/blocks-updated-nested-deep.json +42 -0
- package/src/api/__snapshots__/blocks-updated-nested-multiple.json +118 -0
- package/src/api/__snapshots__/blocks-updated-nested.json +78 -0
- package/src/api/__snapshots__/blocks-updated-single.json +42 -0
- package/src/api/__snapshots__/blocks-updated.json +42 -0
- package/src/api/blockManipulation/__snapshots__/transactions.test.ts.snap +34 -0
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +312 -0
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +127 -94
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +19 -37
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +8 -6
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +25 -31
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +93 -91
- package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +16 -20
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +14 -1
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +18 -56
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +52 -46
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +1051 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +247 -154
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +109 -142
- package/src/api/blockManipulation/getBlock/getBlock.ts +23 -48
- package/src/api/blockManipulation/insertContentAt.ts +4 -17
- package/src/api/blockManipulation/selections/selection.test.ts +32 -16
- package/src/api/blockManipulation/selections/selection.ts +25 -51
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +35 -14
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +34 -65
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +8 -10
- package/src/api/clipboard/toClipboard/copyExtension.ts +7 -7
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -16
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -17
- package/src/api/getBlockInfoFromPos.ts +13 -1
- package/src/api/nodeConversions/blockToNode.ts +21 -10
- package/src/api/nodeConversions/fragmentToBlocks.ts +5 -18
- package/src/api/nodeConversions/nodeToBlock.ts +11 -8
- package/src/api/nodeUtil.test.ts +228 -0
- package/src/api/nodeUtil.ts +235 -2
- package/src/api/parsers/html/parseHTML.ts +2 -10
- package/src/api/parsers/markdown/parseMarkdown.ts +2 -8
- package/src/api/pmUtil.ts +54 -0
- package/src/api/positionMapping.ts +4 -2
- package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +2 -2
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +9 -13
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +5 -9
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +19 -31
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +10 -8
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +9 -13
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +1 -1
- package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +5 -9
- package/src/blocks/defaultBlockHelpers.ts +1 -1
- package/src/editor/BlockNoteEditor.test.ts +1 -1
- package/src/editor/BlockNoteEditor.ts +259 -131
- package/src/editor/BlockNoteTipTapEditor.ts +91 -8
- package/src/extensions/Comments/CommentsPlugin.ts +32 -34
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +4 -8
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +12 -13
- package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +1 -3
- package/src/extensions/SideMenu/MultipleNodeSelection.ts +3 -1
- package/src/extensions/SideMenu/dragging.ts +1 -1
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +22 -19
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +8 -8
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +150 -136
- package/src/index.ts +4 -3
- package/src/schema/inlineContent/createSpec.ts +1 -5
- package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +2 -2
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -8
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +9 -10
- package/types/src/api/blockManipulation/getBlock/getBlock.d.ts +7 -7
- package/types/src/api/blockManipulation/insertContentAt.d.ts +5 -3
- package/types/src/api/blockManipulation/selections/selection.d.ts +3 -3
- package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.d.ts +5 -5
- package/types/src/api/getBlockInfoFromPos.d.ts +8 -1
- package/types/src/api/nodeConversions/blockToNode.d.ts +3 -3
- package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +1 -2
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +2 -2
- package/types/src/api/nodeUtil.d.ts +67 -1
- package/types/src/api/parsers/html/parseHTML.d.ts +1 -1
- package/types/src/api/parsers/markdown/parseMarkdown.d.ts +1 -1
- package/types/src/api/pmUtil.d.ts +12 -0
- package/types/src/editor/BlockNoteEditor.d.ts +72 -10
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +15 -2
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
- package/types/src/index.d.ts +1 -2
- package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +0 -1859
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +0 -40
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +0 -20
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +0 -138
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +0 -138
- package/src/api/clipboard/__snapshots__/external/pasteImage.html +0 -153
- package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +0 -138
- package/src/api/clipboard/__snapshots__/external/pasteTable.html +0 -233
- package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +0 -216
- package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/childToParent.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/childrenToNextParent.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/childrenToNextParentsChildren.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/image.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/multipleChildren.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/multipleStyledText.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/nestedImage.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/partialChildToParent.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/styledText.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/tableAllCells.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/tableCell.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/tableCellText.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/tableRow.html +0 -1
- package/src/api/clipboard/__snapshots__/internal/unstyledText.html +0 -1
- package/src/api/clipboard/clipboardExternal.test.ts +0 -161
- package/src/api/clipboard/clipboardInternal.test.ts +0 -435
- package/src/api/clipboard/testUtil.ts +0 -27
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +0 -3
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/complex/misc/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/complex/misc/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/customBlock/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/customBlock/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/lineBreaks/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/lineBreaks/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/styled/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/customParagraph/styled/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/button/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/button/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/noName/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/file/noName/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/fontSize/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/fontSize/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/between-links/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/between-links/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/end/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/end/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/link/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/link/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/multiple/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/multiple/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/only/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/only/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/start/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/start/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/styles/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/hardbreak/styles/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/button/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/button/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/noName/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/link/adjacent/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/link/adjacent/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/link/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/link/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/link/styled/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/link/styled/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/lists/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/lists/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/mention/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/mention/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/pageBreak/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/pageBreak/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/empty/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/empty/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/lineBreaks/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/styled/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/paragraph/styled/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/paste/parse-basic-block-types.json +0 -140
- package/src/api/exporters/html/__snapshots__/paste/parse-deep-nested-content.json +0 -240
- package/src/api/exporters/html/__snapshots__/paste/parse-div-with-inline-content.json +0 -91
- package/src/api/exporters/html/__snapshots__/paste/parse-divs.json +0 -19
- package/src/api/exporters/html/__snapshots__/paste/parse-fake-image-caption.json +0 -31
- package/src/api/exporters/html/__snapshots__/paste/parse-mixed-nested-lists.json +0 -70
- package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +0 -70
- package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists.json +0 -70
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/small/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/small/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/allColWidths/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/allColWidths/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/basic/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/headerCols/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/headerCols/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/headerRows/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/headerRows/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/headersRows/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/headersRows/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/mixedCellColors/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/mixedCellColors/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/mixedColWidths/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/mixedColWidths/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/mixedRowspansAndColspans/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/table/mixedRowspansAndColspans/internal.html +0 -1
- package/src/api/exporters/html/__snapshots__/tag/basic/external.html +0 -1
- package/src/api/exporters/html/__snapshots__/tag/basic/internal.html +0 -1
- package/src/api/exporters/html/htmlConversion.test.ts +0 -110
- package/src/api/exporters/markdown/__snapshots__/codeBlock/contains-newlines/markdown.md +0 -4
- package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +0 -2
- package/src/api/exporters/markdown/__snapshots__/codeBlock/python/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/customBlock/basic/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/customParagraph/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/customParagraph/lineBreaks/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/customParagraph/nested/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/customParagraph/styled/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +0 -7
- package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/fontSize/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/hardbreak/basic/markdown.md +0 -2
- package/src/api/exporters/markdown/__snapshots__/hardbreak/between-links/markdown.md +0 -2
- package/src/api/exporters/markdown/__snapshots__/hardbreak/end/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/hardbreak/link/markdown.md +0 -2
- package/src/api/exporters/markdown/__snapshots__/hardbreak/multiple/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/hardbreak/only/markdown.md +0 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/start/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/hardbreak/styles/markdown.md +0 -2
- package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +0 -7
- package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/link/adjacent/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/link/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/link/styled/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +0 -10
- package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +0 -10
- package/src/api/exporters/markdown/__snapshots__/mention/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/pageBreak/basic/markdown.md +0 -0
- package/src/api/exporters/markdown/__snapshots__/paragraph/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/paragraph/empty/markdown.md +0 -0
- package/src/api/exporters/markdown/__snapshots__/paragraph/lineBreaks/markdown.md +0 -2
- package/src/api/exporters/markdown/__snapshots__/paragraph/nested/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/paragraph/styled/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/nested/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/styled/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +0 -7
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +0 -7
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +0 -3
- package/src/api/exporters/markdown/__snapshots__/small/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/__snapshots__/table/allColWidths/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/table/basic/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/table/headerCols/markdown.md +0 -4
- package/src/api/exporters/markdown/__snapshots__/table/headerRows/markdown.md +0 -4
- package/src/api/exporters/markdown/__snapshots__/table/mixedCellColors/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/table/mixedColWidths/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/table/mixedRowspansAndColspans/markdown.md +0 -5
- package/src/api/exporters/markdown/__snapshots__/tag/basic/markdown.md +0 -1
- package/src/api/exporters/markdown/markdownExporter.test.ts +0 -86
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +0 -3473
- package/src/api/nodeConversions/nodeConversions.test.ts +0 -83
- package/src/api/parsers/html/__snapshots__/list-test.json +0 -177
- package/src/api/parsers/html/__snapshots__/parse-2-tables.json +0 -129
- package/src/api/parsers/html/__snapshots__/parse-basic-block-types.json +0 -142
- package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +0 -62
- package/src/api/parsers/html/__snapshots__/parse-div-with-inline-content.json +0 -91
- package/src/api/parsers/html/__snapshots__/parse-divs.json +0 -121
- package/src/api/parsers/html/__snapshots__/parse-fake-image-caption.json +0 -33
- package/src/api/parsers/html/__snapshots__/parse-image-in-paragraph.json +0 -16
- package/src/api/parsers/html/__snapshots__/parse-mixed-nested-lists.json +0 -265
- package/src/api/parsers/html/__snapshots__/parse-nested-lists-with-paragraphs.json +0 -265
- package/src/api/parsers/html/__snapshots__/parse-nested-lists.json +0 -265
- package/src/api/parsers/html/__snapshots__/parse-notion-html.json +0 -565
- package/src/api/parsers/html/__snapshots__/parse-two-divs.json +0 -36
- package/src/api/parsers/html/parseHTML.test.ts +0 -563
- package/src/api/parsers/markdown/__snapshots__/complex.json +0 -353
- package/src/api/parsers/markdown/__snapshots__/issue-226-1.json +0 -71
- package/src/api/parsers/markdown/__snapshots__/issue-226-2.json +0 -144
- package/src/api/parsers/markdown/__snapshots__/nested.json +0 -72
- package/src/api/parsers/markdown/__snapshots__/non-nested.json +0 -71
- package/src/api/parsers/markdown/__snapshots__/pasted/complex.json +0 -319
- package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-1.json +0 -81
- package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-2.json +0 -165
- package/src/api/parsers/markdown/__snapshots__/pasted/nested.json +0 -81
- package/src/api/parsers/markdown/__snapshots__/pasted/non-nested.json +0 -81
- package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +0 -61
- package/src/api/parsers/markdown/__snapshots__/pasted/whitespace bold.json +0 -42
- package/src/api/parsers/markdown/__snapshots__/styled.json +0 -58
- package/src/api/parsers/markdown/__snapshots__/whitespace bold.json +0 -19
- package/src/api/parsers/markdown/parseMarkdown.test.ts +0 -135
- package/src/api/testUtil/cases/customBlocks.ts +0 -342
- package/src/api/testUtil/cases/customInlineContent.ts +0 -113
- package/src/api/testUtil/cases/customStyles.ts +0 -102
- package/src/api/testUtil/cases/defaultSchema.ts +0 -1493
- package/src/api/testUtil/index.ts +0 -19
- package/src/api/testUtil/partialBlockTestUtil.ts +0 -198
- package/src/api/testUtil/paste.ts +0 -46
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +0 -4
- package/types/src/api/clipboard/clipboardExternal.test.d.ts +0 -1
- package/types/src/api/clipboard/clipboardInternal.test.d.ts +0 -1
- package/types/src/api/clipboard/testUtil.d.ts +0 -541
- package/types/src/api/exporters/html/htmlConversion.test.d.ts +0 -1
- package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +0 -1
- package/types/src/api/nodeConversions/nodeConversions.test.d.ts +0 -1
- package/types/src/api/parsers/html/parseHTML.test.d.ts +0 -1
- package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +0 -1
- package/types/src/api/testUtil/cases/customBlocks.d.ts +0 -670
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -558
- package/types/src/api/testUtil/cases/customStyles.d.ts +0 -552
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +0 -4
- package/types/src/api/testUtil/index.d.ts +0 -14
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +0 -9
- package/types/src/api/testUtil/paste.d.ts +0 -2
- /package/types/src/api/{blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts → nodeUtil.test.d.ts} +0 -0
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"children": [],
|
|
4
|
-
"content": [
|
|
5
|
-
{
|
|
6
|
-
"styles": {},
|
|
7
|
-
"text": "Paragraph",
|
|
8
|
-
"type": "text",
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
"id": "0",
|
|
12
|
-
"props": {
|
|
13
|
-
"backgroundColor": "default",
|
|
14
|
-
"textAlignment": "left",
|
|
15
|
-
"textColor": "default",
|
|
16
|
-
},
|
|
17
|
-
"type": "paragraph",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"children": [],
|
|
21
|
-
"content": {
|
|
22
|
-
"columnWidths": [
|
|
23
|
-
undefined,
|
|
24
|
-
undefined,
|
|
25
|
-
],
|
|
26
|
-
"headerCols": undefined,
|
|
27
|
-
"headerRows": undefined,
|
|
28
|
-
"rows": [
|
|
29
|
-
{
|
|
30
|
-
"cells": [
|
|
31
|
-
{
|
|
32
|
-
"content": [
|
|
33
|
-
{
|
|
34
|
-
"styles": {},
|
|
35
|
-
"text": "Cell 1",
|
|
36
|
-
"type": "text",
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
"props": {
|
|
40
|
-
"backgroundColor": "default",
|
|
41
|
-
"colspan": 1,
|
|
42
|
-
"rowspan": 1,
|
|
43
|
-
"textAlignment": "left",
|
|
44
|
-
"textColor": "default",
|
|
45
|
-
},
|
|
46
|
-
"type": "tableCell",
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"content": [
|
|
50
|
-
{
|
|
51
|
-
"styles": {},
|
|
52
|
-
"text": "Cell 2",
|
|
53
|
-
"type": "text",
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
"props": {
|
|
57
|
-
"backgroundColor": "default",
|
|
58
|
-
"colspan": 1,
|
|
59
|
-
"rowspan": 1,
|
|
60
|
-
"textAlignment": "left",
|
|
61
|
-
"textColor": "default",
|
|
62
|
-
},
|
|
63
|
-
"type": "tableCell",
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"cells": [
|
|
69
|
-
{
|
|
70
|
-
"content": [
|
|
71
|
-
{
|
|
72
|
-
"styles": {},
|
|
73
|
-
"text": "Cell 3",
|
|
74
|
-
"type": "text",
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
"props": {
|
|
78
|
-
"backgroundColor": "default",
|
|
79
|
-
"colspan": 1,
|
|
80
|
-
"rowspan": 1,
|
|
81
|
-
"textAlignment": "left",
|
|
82
|
-
"textColor": "default",
|
|
83
|
-
},
|
|
84
|
-
"type": "tableCell",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"content": [
|
|
88
|
-
{
|
|
89
|
-
"styles": {},
|
|
90
|
-
"text": "Cell 4",
|
|
91
|
-
"type": "text",
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
"props": {
|
|
95
|
-
"backgroundColor": "default",
|
|
96
|
-
"colspan": 1,
|
|
97
|
-
"rowspan": 1,
|
|
98
|
-
"textAlignment": "left",
|
|
99
|
-
"textColor": "default",
|
|
100
|
-
},
|
|
101
|
-
"type": "tableCell",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
"type": "tableContent",
|
|
107
|
-
},
|
|
108
|
-
"id": "4",
|
|
109
|
-
"props": {
|
|
110
|
-
"textColor": "default",
|
|
111
|
-
},
|
|
112
|
-
"type": "table",
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"children": [],
|
|
116
|
-
"content": {
|
|
117
|
-
"columnWidths": [
|
|
118
|
-
undefined,
|
|
119
|
-
undefined,
|
|
120
|
-
],
|
|
121
|
-
"headerCols": undefined,
|
|
122
|
-
"headerRows": undefined,
|
|
123
|
-
"rows": [
|
|
124
|
-
{
|
|
125
|
-
"cells": [
|
|
126
|
-
{
|
|
127
|
-
"content": [
|
|
128
|
-
{
|
|
129
|
-
"styles": {},
|
|
130
|
-
"text": "Table Cell",
|
|
131
|
-
"type": "text",
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
"props": {
|
|
135
|
-
"backgroundColor": "default",
|
|
136
|
-
"colspan": 1,
|
|
137
|
-
"rowspan": 1,
|
|
138
|
-
"textAlignment": "left",
|
|
139
|
-
"textColor": "default",
|
|
140
|
-
},
|
|
141
|
-
"type": "tableCell",
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"content": [
|
|
145
|
-
{
|
|
146
|
-
"styles": {},
|
|
147
|
-
"text": "Table Cell",
|
|
148
|
-
"type": "text",
|
|
149
|
-
},
|
|
150
|
-
],
|
|
151
|
-
"props": {
|
|
152
|
-
"backgroundColor": "default",
|
|
153
|
-
"colspan": 1,
|
|
154
|
-
"rowspan": 1,
|
|
155
|
-
"textAlignment": "left",
|
|
156
|
-
"textColor": "default",
|
|
157
|
-
},
|
|
158
|
-
"type": "tableCell",
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"cells": [
|
|
164
|
-
{
|
|
165
|
-
"content": [
|
|
166
|
-
{
|
|
167
|
-
"styles": {},
|
|
168
|
-
"text": "Table Cell",
|
|
169
|
-
"type": "text",
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
"props": {
|
|
173
|
-
"backgroundColor": "default",
|
|
174
|
-
"colspan": 1,
|
|
175
|
-
"rowspan": 1,
|
|
176
|
-
"textAlignment": "left",
|
|
177
|
-
"textColor": "default",
|
|
178
|
-
},
|
|
179
|
-
"type": "tableCell",
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"content": [
|
|
183
|
-
{
|
|
184
|
-
"styles": {},
|
|
185
|
-
"text": "Table Cell",
|
|
186
|
-
"type": "text",
|
|
187
|
-
},
|
|
188
|
-
],
|
|
189
|
-
"props": {
|
|
190
|
-
"backgroundColor": "default",
|
|
191
|
-
"colspan": 1,
|
|
192
|
-
"rowspan": 1,
|
|
193
|
-
"textAlignment": "left",
|
|
194
|
-
"textColor": "default",
|
|
195
|
-
},
|
|
196
|
-
"type": "tableCell",
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
},
|
|
200
|
-
],
|
|
201
|
-
"type": "tableContent",
|
|
202
|
-
},
|
|
203
|
-
"id": "1",
|
|
204
|
-
"props": {
|
|
205
|
-
"textColor": "default",
|
|
206
|
-
},
|
|
207
|
-
"type": "table",
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"children": [],
|
|
211
|
-
"content": [
|
|
212
|
-
{
|
|
213
|
-
"styles": {},
|
|
214
|
-
"text": "Custom Paragraph",
|
|
215
|
-
"type": "text",
|
|
216
|
-
},
|
|
217
|
-
],
|
|
218
|
-
"id": "2",
|
|
219
|
-
"props": {},
|
|
220
|
-
"type": "customParagraph",
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"children": [],
|
|
224
|
-
"content": [],
|
|
225
|
-
"id": "3",
|
|
226
|
-
"props": {
|
|
227
|
-
"backgroundColor": "default",
|
|
228
|
-
"textAlignment": "left",
|
|
229
|
-
"textColor": "default",
|
|
230
|
-
},
|
|
231
|
-
"type": "paragraph",
|
|
232
|
-
},
|
|
233
|
-
]
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"children": [],
|
|
4
|
-
"content": [
|
|
5
|
-
{
|
|
6
|
-
"styles": {},
|
|
7
|
-
"text": "Paragraph",
|
|
8
|
-
"type": "text",
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
"id": "0",
|
|
12
|
-
"props": {
|
|
13
|
-
"backgroundColor": "default",
|
|
14
|
-
"textAlignment": "left",
|
|
15
|
-
"textColor": "default",
|
|
16
|
-
},
|
|
17
|
-
"type": "paragraph",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"children": [],
|
|
21
|
-
"content": {
|
|
22
|
-
"columnWidths": [
|
|
23
|
-
undefined,
|
|
24
|
-
undefined,
|
|
25
|
-
undefined,
|
|
26
|
-
],
|
|
27
|
-
"headerCols": undefined,
|
|
28
|
-
"headerRows": undefined,
|
|
29
|
-
"rows": [
|
|
30
|
-
{
|
|
31
|
-
"cells": [
|
|
32
|
-
{
|
|
33
|
-
"content": [
|
|
34
|
-
{
|
|
35
|
-
"styles": {},
|
|
36
|
-
"text": "Table Cell",
|
|
37
|
-
"type": "text",
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
"props": {
|
|
41
|
-
"backgroundColor": "default",
|
|
42
|
-
"colspan": 1,
|
|
43
|
-
"rowspan": 1,
|
|
44
|
-
"textAlignment": "left",
|
|
45
|
-
"textColor": "default",
|
|
46
|
-
},
|
|
47
|
-
"type": "tableCell",
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"content": [
|
|
51
|
-
{
|
|
52
|
-
"styles": {},
|
|
53
|
-
"text": "Table Cell",
|
|
54
|
-
"type": "text",
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
"props": {
|
|
58
|
-
"backgroundColor": "default",
|
|
59
|
-
"colspan": 1,
|
|
60
|
-
"rowspan": 1,
|
|
61
|
-
"textAlignment": "left",
|
|
62
|
-
"textColor": "default",
|
|
63
|
-
},
|
|
64
|
-
"type": "tableCell",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"content": [],
|
|
68
|
-
"props": {
|
|
69
|
-
"backgroundColor": "default",
|
|
70
|
-
"colspan": 1,
|
|
71
|
-
"rowspan": 1,
|
|
72
|
-
"textAlignment": "left",
|
|
73
|
-
"textColor": "default",
|
|
74
|
-
},
|
|
75
|
-
"type": "tableCell",
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"cells": [
|
|
81
|
-
{
|
|
82
|
-
"content": [
|
|
83
|
-
{
|
|
84
|
-
"styles": {},
|
|
85
|
-
"text": "Table Cell",
|
|
86
|
-
"type": "text",
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
"props": {
|
|
90
|
-
"backgroundColor": "default",
|
|
91
|
-
"colspan": 1,
|
|
92
|
-
"rowspan": 1,
|
|
93
|
-
"textAlignment": "left",
|
|
94
|
-
"textColor": "default",
|
|
95
|
-
},
|
|
96
|
-
"type": "tableCell",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"content": [
|
|
100
|
-
{
|
|
101
|
-
"styles": {},
|
|
102
|
-
"text": "Cell 1",
|
|
103
|
-
"type": "text",
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
"props": {
|
|
107
|
-
"backgroundColor": "default",
|
|
108
|
-
"colspan": 1,
|
|
109
|
-
"rowspan": 1,
|
|
110
|
-
"textAlignment": "left",
|
|
111
|
-
"textColor": "default",
|
|
112
|
-
},
|
|
113
|
-
"type": "tableCell",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"content": [
|
|
117
|
-
{
|
|
118
|
-
"styles": {},
|
|
119
|
-
"text": "Cell 2",
|
|
120
|
-
"type": "text",
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
"props": {
|
|
124
|
-
"backgroundColor": "default",
|
|
125
|
-
"colspan": 1,
|
|
126
|
-
"rowspan": 1,
|
|
127
|
-
"textAlignment": "left",
|
|
128
|
-
"textColor": "default",
|
|
129
|
-
},
|
|
130
|
-
"type": "tableCell",
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"cells": [
|
|
136
|
-
{
|
|
137
|
-
"content": [],
|
|
138
|
-
"props": {
|
|
139
|
-
"backgroundColor": "default",
|
|
140
|
-
"colspan": 1,
|
|
141
|
-
"rowspan": 1,
|
|
142
|
-
"textAlignment": "left",
|
|
143
|
-
"textColor": "default",
|
|
144
|
-
},
|
|
145
|
-
"type": "tableCell",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"content": [
|
|
149
|
-
{
|
|
150
|
-
"styles": {},
|
|
151
|
-
"text": "Cell 3",
|
|
152
|
-
"type": "text",
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
"props": {
|
|
156
|
-
"backgroundColor": "default",
|
|
157
|
-
"colspan": 1,
|
|
158
|
-
"rowspan": 1,
|
|
159
|
-
"textAlignment": "left",
|
|
160
|
-
"textColor": "default",
|
|
161
|
-
},
|
|
162
|
-
"type": "tableCell",
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"content": [
|
|
166
|
-
{
|
|
167
|
-
"styles": {},
|
|
168
|
-
"text": "Cell 4",
|
|
169
|
-
"type": "text",
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
"props": {
|
|
173
|
-
"backgroundColor": "default",
|
|
174
|
-
"colspan": 1,
|
|
175
|
-
"rowspan": 1,
|
|
176
|
-
"textAlignment": "left",
|
|
177
|
-
"textColor": "default",
|
|
178
|
-
},
|
|
179
|
-
"type": "tableCell",
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
"type": "tableContent",
|
|
185
|
-
},
|
|
186
|
-
"id": "1",
|
|
187
|
-
"props": {
|
|
188
|
-
"textColor": "default",
|
|
189
|
-
},
|
|
190
|
-
"type": "table",
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"children": [],
|
|
194
|
-
"content": [
|
|
195
|
-
{
|
|
196
|
-
"styles": {},
|
|
197
|
-
"text": "Custom Paragraph",
|
|
198
|
-
"type": "text",
|
|
199
|
-
},
|
|
200
|
-
],
|
|
201
|
-
"id": "2",
|
|
202
|
-
"props": {},
|
|
203
|
-
"type": "customParagraph",
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
"children": [],
|
|
207
|
-
"content": [],
|
|
208
|
-
"id": "3",
|
|
209
|
-
"props": {
|
|
210
|
-
"backgroundColor": "default",
|
|
211
|
-
"textAlignment": "left",
|
|
212
|
-
"textColor": "default",
|
|
213
|
-
},
|
|
214
|
-
"type": "paragraph",
|
|
215
|
-
},
|
|
216
|
-
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>Paragraph</p><h1>Heading</h1><ol><li><p>Numbered List Item</p></li></ol><ul><li><p>Bullet List Item</p></li><li><input type="checkbox"><p class="bn-inline-content">Check List Item</p></li></ul><pre><code class="bn-inline-content language-text" data-language="text">console.log("Hello World");</code></pre><table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table><p>Add image</p><p data-text-color="red"></p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p data-text-color="red">Paragraph</p><h2 data-level="2">Heading</h2><ol start="2"><li><p data-start="2">Numbered List Item</p></li></ol><ul><li><p data-background-color="red">Bullet List Item</p></li><li><input type="checkbox" checked="" data-checked="true"><p class="bn-inline-content">Check List Item</p></li></ul><pre><code class="bn-inline-content language-typescript" data-language="typescript">console.log("Hello World");</code></pre><table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table><figure data-name="1280px-Placeholder_view_vector.svg.png" data-url="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Placeholder_view_vector.svg/1280px-Placeholder_view_vector.svg.png" data-caption="Placeholder" data-preview-width="256"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Placeholder_view_vector.svg/1280px-Placeholder_view_vector.svg.png" alt="1280px-Placeholder_view_vector.svg.png" width="256"><figcaption>Placeholder</figcaption></figure><p></p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h2 data-text-color="red" data-level="2">Heading 1</h2><p>Nested Paragraph 1</p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>Nested Paragraph 1</p><p>Nested Paragraph 2</p><p>Nested Paragraph 3</p><h2 data-text-color="red" data-level="2">Heading 2</h2>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>Nested Paragraph 1</p><p>Nested Paragraph 2</p><p>Nested Paragraph 3</p><h2 data-text-color="red" data-level="2">Heading 2</h2><p>Nested Paragraph 1</p><p>Nested Paragraph 2</p><p>Nested Paragraph 3</p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<img src="https://ralfvanveen.com/wp-content/uploads/2021/06/Placeholder-_-Glossary.svg" alt="BlockNote image" width="512" data-url="https://ralfvanveen.com/wp-content/uploads/2021/06/Placeholder-_-Glossary.svg"><p>Nested Paragraph</p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>Nested Paragraph 1</p><p>Nested Paragraph 2</p><p>Nested Paragraph 3</p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<strong>Bold</strong><em>Italic</em>Regular
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h2 data-text-color="red" data-level="2"><strong>Bold</strong><em>Italic</em>Regular</h2><img src="https://ralfvanveen.com/wp-content/uploads/2021/06/Placeholder-_-Glossary.svg" alt="BlockNote image" width="512" data-url="https://ralfvanveen.com/wp-content/uploads/2021/06/Placeholder-_-Glossary.svg"><p>Nested Paragraph</p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Paragraph
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h2 data-text-color="red" data-level="2">ding 1</h2><p>Nested </p>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<em>Italic</em>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Table Cell
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<table><tr><td colspan="1" rowspan="1"><p>Table Cell</p></td><td colspan="1" rowspan="1"><p>Table Cell</p></td></tr></table>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Regular
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { Node } from "prosemirror-model";
|
|
2
|
-
import { Selection, TextSelection } from "prosemirror-state";
|
|
3
|
-
import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
4
|
-
|
|
5
|
-
import { PartialBlock } from "../../blocks/defaultBlocks.js";
|
|
6
|
-
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
7
|
-
import { initializeESMDependencies } from "../../util/esmDependencies.js";
|
|
8
|
-
import { doPaste } from "../testUtil/paste.js";
|
|
9
|
-
import { schema } from "./testUtil.js";
|
|
10
|
-
|
|
11
|
-
type SelectionTestCase = {
|
|
12
|
-
testName: string;
|
|
13
|
-
createSelection: (doc: Node) => Selection;
|
|
14
|
-
} & (
|
|
15
|
-
| {
|
|
16
|
-
html: string;
|
|
17
|
-
}
|
|
18
|
-
| {
|
|
19
|
-
plainText: string;
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
// These tests are meant to test the pasting of external HTML in the editor.
|
|
24
|
-
// Each test case has an HTML string to be pasted, and a selection in the editor
|
|
25
|
-
// to paste at.
|
|
26
|
-
describe("Test external clipboard HTML", () => {
|
|
27
|
-
const initialContent: PartialBlock<typeof schema.blockSchema>[] = [
|
|
28
|
-
{
|
|
29
|
-
type: "paragraph",
|
|
30
|
-
content: "Paragraph",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
type: "table",
|
|
34
|
-
content: {
|
|
35
|
-
type: "tableContent",
|
|
36
|
-
rows: [
|
|
37
|
-
{
|
|
38
|
-
cells: ["Table Cell", "Table Cell"],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
cells: ["Table Cell", "Table Cell"],
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: "customParagraph",
|
|
48
|
-
content: "Custom Paragraph",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: "paragraph",
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
let editor: BlockNoteEditor<typeof schema.blockSchema>;
|
|
56
|
-
const div = document.createElement("div");
|
|
57
|
-
|
|
58
|
-
beforeEach(() => {
|
|
59
|
-
editor.replaceBlocks(editor.document, initialContent);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
beforeAll(async () => {
|
|
63
|
-
(window as any).__TEST_OPTIONS = (window as any).__TEST_OPTIONS || {};
|
|
64
|
-
|
|
65
|
-
editor = BlockNoteEditor.create({ schema });
|
|
66
|
-
editor.mount(div);
|
|
67
|
-
|
|
68
|
-
await initializeESMDependencies();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
afterAll(() => {
|
|
72
|
-
editor.mount(undefined);
|
|
73
|
-
editor._tiptapEditor.destroy();
|
|
74
|
-
editor = undefined as any;
|
|
75
|
-
|
|
76
|
-
delete (window as Window & { __TEST_OPTIONS?: any }).__TEST_OPTIONS;
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// Sets the editor selection to the given start and end positions, then
|
|
80
|
-
// pastes the HTML and compares it the document after to a snapshot.
|
|
81
|
-
async function testPasteExternalHTML(testCase: SelectionTestCase) {
|
|
82
|
-
if (!editor.prosemirrorView) {
|
|
83
|
-
throw new Error("Editor view not initialized.");
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
editor.dispatch(
|
|
87
|
-
editor._tiptapEditor.state.tr.setSelection(
|
|
88
|
-
testCase.createSelection(editor.prosemirrorView.state.doc)
|
|
89
|
-
)
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
doPaste(
|
|
93
|
-
editor.prosemirrorView,
|
|
94
|
-
"plainText" in testCase ? testCase.plainText : "",
|
|
95
|
-
"html" in testCase ? testCase.html : "",
|
|
96
|
-
"plainText" in testCase,
|
|
97
|
-
new ClipboardEvent("paste")
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
await expect(editor.document).toMatchFileSnapshot(
|
|
101
|
-
`./__snapshots__/external/${testCase.testName}.html`
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const testCases: SelectionTestCase[] = [
|
|
106
|
-
{
|
|
107
|
-
testName: "pasteEndOfParagraph",
|
|
108
|
-
createSelection: (doc) => TextSelection.create(doc, 12),
|
|
109
|
-
html: `<p>Paragraph</p>`,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
testName: "pasteEndOfParagraphText",
|
|
113
|
-
createSelection: (doc) => TextSelection.create(doc, 12),
|
|
114
|
-
plainText: `Paragraph`,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
testName: "pasteImage",
|
|
118
|
-
createSelection: (doc) => TextSelection.create(doc, 12),
|
|
119
|
-
html: `<img src="exampleURL">`,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
testName: "pasteTable",
|
|
123
|
-
createSelection: (doc) => TextSelection.create(doc, 12),
|
|
124
|
-
html: `<table>
|
|
125
|
-
<tr>
|
|
126
|
-
<td>Cell 1</td>
|
|
127
|
-
<td>Cell 2</td>
|
|
128
|
-
</tr>
|
|
129
|
-
<tr>
|
|
130
|
-
<td>Cell 3</td>
|
|
131
|
-
<td>Cell 4</td>
|
|
132
|
-
</tr>
|
|
133
|
-
</table>`,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
testName: "pasteTableInExistingTable",
|
|
137
|
-
createSelection: (doc) => TextSelection.create(doc, 73),
|
|
138
|
-
html: `<table>
|
|
139
|
-
<tr>
|
|
140
|
-
<td>Cell 1</td>
|
|
141
|
-
<td>Cell 2</td>
|
|
142
|
-
</tr>
|
|
143
|
-
<tr>
|
|
144
|
-
<td>Cell 3</td>
|
|
145
|
-
<td>Cell 4</td>
|
|
146
|
-
</tr>
|
|
147
|
-
</table>`,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
testName: "pasteParagraphInCustomBlock",
|
|
151
|
-
createSelection: (doc) => TextSelection.create(doc, 80, 96),
|
|
152
|
-
html: `<p>Paragraph</p>`,
|
|
153
|
-
},
|
|
154
|
-
];
|
|
155
|
-
|
|
156
|
-
for (const testCase of testCases) {
|
|
157
|
-
it(`${testCase.testName}`, async () => {
|
|
158
|
-
await testPasteExternalHTML(testCase);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
});
|