@blocknote/core 0.9.6 → 0.10.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.js +3696 -2609
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +7 -7
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -0
- package/package.json +11 -5
- package/src/api/README.md +8 -0
- package/src/api/blockManipulation/blockManipulation.test.ts +72 -10
- package/src/api/blockManipulation/blockManipulation.ts +38 -18
- package/src/api/exporters/copyExtension.ts +68 -0
- package/src/api/exporters/html/__snapshots__/complex/misc/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/complex/misc/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/customParagraph/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/customParagraph/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/customParagraph/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/customParagraph/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/customParagraph/styled/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/customParagraph/styled/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/fontSize/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/fontSize/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/between-links/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/between-links/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/end/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/end/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/link/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/link/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/multiple/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/multiple/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/only/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/only/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/start/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/start/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/styles/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/hardbreak/styles/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/link/adjacent/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/link/adjacent/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/link/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/link/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/link/styled/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/link/styled/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/mention/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/mention/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/empty/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/empty/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/styled/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/paragraph/styled/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-basic-block-types.json +140 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-deep-nested-content.json +240 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-div-with-inline-content.json +91 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-divs.json +19 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-fake-image-caption.json +31 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-mixed-nested-lists.json +70 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +70 -0
- package/src/api/exporters/html/__snapshots__/paste/parse-nested-lists.json +70 -0
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleCustomParagraph/styled/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/small/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/small/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/tag/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/tag/basic/internal.html +1 -0
- package/src/api/exporters/html/externalHTMLExporter.ts +98 -0
- package/src/api/exporters/html/htmlConversion.test.ts +100 -0
- package/src/api/exporters/html/internalHTMLSerializer.ts +80 -0
- package/src/api/exporters/html/util/sharedHTMLConversion.ts +128 -0
- package/src/api/{formatConversions → exporters/html/util}/simplifyBlocksRehypePlugin.ts +13 -0
- package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +5 -0
- package/src/api/exporters/markdown/__snapshots__/customParagraph/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/customParagraph/nested/markdown.md +5 -0
- package/src/api/exporters/markdown/__snapshots__/customParagraph/styled/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/fontSize/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/basic/markdown.md +2 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/between-links/markdown.md +2 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/end/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/link/markdown.md +2 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/multiple/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/start/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/hardbreak/styles/markdown.md +2 -0
- package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/link/adjacent/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/link/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/link/styled/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/mention/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/paragraph/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/paragraph/nested/markdown.md +5 -0
- package/src/api/exporters/markdown/__snapshots__/paragraph/styled/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/nested/markdown.md +5 -0
- package/src/api/exporters/markdown/__snapshots__/simpleCustomParagraph/styled/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/small/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/tag/basic/markdown.md +1 -0
- package/src/api/exporters/markdown/markdownExporter.test.ts +85 -0
- package/src/api/exporters/markdown/markdownExporter.ts +42 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +486 -125
- package/src/api/nodeConversions/nodeConversions.test.ts +67 -498
- package/src/api/nodeConversions/nodeConversions.ts +311 -85
- package/src/api/parsers/html/__snapshots__/paste/list-test.json +105 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-basic-block-types.json +140 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-deep-nested-content.json +240 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-div-with-inline-content.json +91 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-divs.json +121 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-fake-image-caption.json +31 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-google-docs-html.json +476 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-mixed-nested-lists.json +140 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +140 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists.json +157 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-notion-html.json +470 -0
- package/src/api/parsers/html/__snapshots__/paste/parse-two-divs.json +36 -0
- package/src/api/parsers/html/parseHTML.test.ts +440 -0
- package/src/api/parsers/html/parseHTML.ts +42 -0
- package/src/api/parsers/html/util/__snapshots__/nestedLists.test.ts.snap +129 -0
- package/src/api/parsers/html/util/nestedLists.test.ts +176 -0
- package/src/api/parsers/html/util/nestedLists.ts +113 -0
- package/src/api/parsers/markdown/__snapshots__/complex.json +353 -0
- package/src/api/parsers/markdown/__snapshots__/issue-226-1.json +71 -0
- package/src/api/parsers/markdown/__snapshots__/issue-226-2.json +144 -0
- package/src/api/parsers/markdown/__snapshots__/nested.json +72 -0
- package/src/api/parsers/markdown/__snapshots__/non-nested.json +71 -0
- package/src/api/parsers/markdown/__snapshots__/styled.json +58 -0
- package/src/api/parsers/markdown/parseMarkdown.test.ts +114 -0
- package/src/api/parsers/markdown/parseMarkdown.ts +84 -0
- package/src/api/parsers/pasteExtension.ts +59 -0
- package/src/api/testUtil/cases/customBlocks.ts +282 -0
- package/src/api/testUtil/cases/customInlineContent.ts +114 -0
- package/src/api/testUtil/cases/customStyles.ts +100 -0
- package/src/api/testUtil/cases/defaultSchema.ts +399 -0
- package/src/api/testUtil/index.ts +17 -0
- package/src/api/testUtil/partialBlockTestUtil.ts +127 -0
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +136 -0
- package/src/{extensions/Blocks/nodes/BlockContent → blocks}/ImageBlockContent/ImageBlockContent.ts +87 -31
- package/src/{extensions/Blocks/nodes/BlockContent → blocks}/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +34 -47
- package/src/{extensions/Blocks/nodes/BlockContent → blocks}/ListItemBlockContent/ListItemKeyboardShortcuts.ts +1 -1
- package/src/{extensions/Blocks/nodes/BlockContent → blocks}/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +1 -1
- package/src/{extensions/Blocks/nodes/BlockContent → blocks}/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +34 -56
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +43 -0
- package/src/blocks/README.md +3 -0
- package/src/blocks/TableBlockContent/TableBlockContent.ts +74 -0
- package/src/blocks/TableBlockContent/TableExtension.ts +63 -0
- package/src/blocks/defaultBlockHelpers.ts +95 -0
- package/src/blocks/defaultBlocks.ts +60 -0
- package/src/blocks/defaultProps.ts +24 -0
- package/src/{extensions/Blocks/nodes/Block.module.css → editor/Block.css} +69 -62
- package/src/{BlockNoteEditor.test.ts → editor/BlockNoteEditor.test.ts} +2 -2
- package/src/{BlockNoteEditor.ts → editor/BlockNoteEditor.ts} +363 -153
- package/src/{BlockNoteExtensions.ts → editor/BlockNoteExtensions.ts} +59 -40
- package/src/editor/README.md +3 -0
- package/src/editor/cursorPositionTypes.ts +16 -0
- package/src/{editor.module.css → editor/editor.css} +43 -15
- package/src/editor/selectionTypes.ts +14 -0
- package/src/editor/transformPasted.ts +58 -0
- package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +1 -36
- package/src/extensions/BackgroundColor/BackgroundColorMark.ts +12 -27
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +16 -24
- package/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.ts +12 -10
- package/src/extensions/ImageToolbar/ImageToolbarPlugin.ts +35 -73
- package/src/extensions/Placeholder/PlaceholderExtension.ts +4 -4
- package/src/extensions/README.md +3 -0
- package/src/extensions/SideMenu/SideMenuPlugin.ts +66 -37
- package/src/extensions/SlashMenu/BaseSlashMenuItem.ts +7 -6
- package/src/extensions/SlashMenu/SlashMenuPlugin.ts +9 -7
- package/src/extensions/SlashMenu/defaultSlashMenuItems.ts +98 -35
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +617 -0
- package/src/extensions/TextAlignment/TextAlignmentExtension.ts +3 -51
- package/src/extensions/TextColor/TextColorExtension.ts +1 -29
- package/src/extensions/TextColor/TextColorMark.ts +7 -27
- package/src/extensions/UniqueID/UniqueID.ts +28 -2
- package/src/extensions-shared/README.md +3 -0
- package/src/{shared/plugins → extensions-shared}/suggestion/SuggestionPlugin.ts +19 -13
- package/src/index.ts +21 -15
- package/src/{extensions/Blocks/nodes → pm-nodes}/BlockContainer.ts +161 -96
- package/src/pm-nodes/BlockGroup.ts +54 -0
- package/src/pm-nodes/Doc.ts +7 -0
- package/src/pm-nodes/README.md +42 -0
- package/src/pm-nodes/index.ts +3 -0
- package/src/schema/README.md +3 -0
- package/src/schema/blocks/createSpec.ts +220 -0
- package/src/schema/blocks/internal.ts +253 -0
- package/src/schema/blocks/types.ts +252 -0
- package/src/schema/index.ts +10 -0
- package/src/schema/inlineContent/createSpec.ts +119 -0
- package/src/schema/inlineContent/internal.ts +105 -0
- package/src/schema/inlineContent/types.ts +144 -0
- package/src/schema/propTypes.ts +32 -0
- package/src/schema/styles/createSpec.ts +85 -0
- package/src/schema/styles/internal.ts +96 -0
- package/src/schema/styles/types.ts +42 -0
- package/src/util/README.md +3 -0
- package/src/{shared/utils.ts → util/browser.ts} +4 -8
- package/src/util/string.ts +3 -0
- package/src/util/typescript.ts +5 -0
- package/types/src/api/blockManipulation/blockManipulation.d.ts +5 -4
- package/types/src/api/exporters/copyExtension.d.ts +6 -0
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +8 -0
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +8 -0
- package/types/src/api/exporters/html/util/sharedHTMLConversion.d.ts +7 -0
- package/types/src/api/exporters/markdown/markdownExporter.d.ts +5 -0
- package/types/src/api/nodeConversions/nodeConversions.d.ts +14 -6
- package/types/src/api/parsers/html/parseHTML.d.ts +3 -0
- package/types/src/api/parsers/html/parseHTML.test.d.ts +1 -0
- package/types/src/api/parsers/html/util/nestedLists.d.ts +1 -0
- package/types/src/api/parsers/html/util/nestedLists.test.d.ts +1 -0
- package/types/src/api/parsers/markdown/parseMarkdown.d.ts +3 -0
- package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +1 -0
- package/types/src/api/parsers/pasteExtension.d.ts +6 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +345 -0
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +29 -0
- package/types/src/api/testUtil/cases/customStyles.d.ts +64 -0
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +3 -0
- package/types/src/api/testUtil/index.d.ts +12 -0
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +7 -0
- package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +58 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +93 -0
- package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +46 -0
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +46 -0
- package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +52 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +53 -0
- package/types/src/blocks/TableBlockContent/TableExtension.d.ts +2 -0
- package/types/src/blocks/defaultBlockHelpers.d.ts +10 -0
- package/types/src/blocks/defaultBlocks.d.ts +577 -0
- package/types/src/{extensions/Blocks/api → blocks}/defaultProps.d.ts +2 -1
- package/types/src/{BlockNoteEditor.d.ts → editor/BlockNoteEditor.d.ts} +54 -43
- package/types/src/editor/BlockNoteEditor.test.d.ts +1 -0
- package/types/src/{BlockNoteExtensions.d.ts → editor/BlockNoteExtensions.d.ts} +7 -4
- package/types/src/editor/cursorPositionTypes.d.ts +6 -0
- package/types/src/editor/selectionTypes.d.ts +4 -0
- package/types/src/editor/transformPasted.d.ts +12 -0
- package/types/src/extensions/BackgroundColor/BackgroundColorExtension.d.ts +0 -7
- package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +7 -9
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +8 -6
- package/types/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.d.ts +6 -6
- package/types/src/extensions/ImageToolbar/ImageToolbarPlugin.d.ts +11 -16
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +18 -11
- package/types/src/extensions/SlashMenu/BaseSlashMenuItem.d.ts +5 -6
- package/types/src/extensions/SlashMenu/SlashMenuPlugin.d.ts +6 -6
- package/types/src/extensions/SlashMenu/defaultSlashMenuItems.d.ts +2 -1
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +74 -0
- package/types/src/extensions/TextAlignment/TextAlignmentExtension.d.ts +0 -7
- package/types/src/extensions/TextColor/TextColorExtension.d.ts +0 -7
- package/types/src/extensions/TextColor/TextColorMark.d.ts +7 -9
- package/types/src/extensions/UniqueID/UniqueID.d.ts +1 -1
- package/types/src/{shared/plugins → extensions-shared}/suggestion/SuggestionPlugin.d.ts +5 -4
- package/types/src/index.d.ts +20 -15
- package/types/src/{extensions/Blocks/nodes → pm-nodes}/BlockContainer.d.ts +5 -3
- package/types/src/pm-nodes/Doc.d.ts +2 -0
- package/types/src/pm-nodes/index.d.ts +3 -0
- package/types/src/schema/blocks/createSpec.d.ts +35 -0
- package/types/src/schema/blocks/internal.d.ts +45 -0
- package/types/src/schema/blocks/types.d.ts +107 -0
- package/types/src/schema/index.d.ts +10 -0
- package/types/src/schema/inlineContent/createSpec.d.ts +21 -0
- package/types/src/schema/inlineContent/internal.d.ts +28 -0
- package/types/src/schema/inlineContent/types.d.ts +62 -0
- package/types/src/schema/propTypes.d.ts +8 -0
- package/types/src/schema/styles/createSpec.d.ts +13 -0
- package/types/src/schema/styles/internal.d.ts +22 -0
- package/types/src/schema/styles/types.d.ts +21 -0
- package/types/src/{shared/utils.d.ts → util/browser.d.ts} +0 -3
- package/types/src/util/string.d.ts +1 -0
- package/types/src/util/typescript.d.ts +3 -0
- package/src/api/formatConversions/__snapshots__/formatConversions.test.ts.snap +0 -346
- package/src/api/formatConversions/formatConversions.test.ts +0 -753
- package/src/api/formatConversions/formatConversions.ts +0 -133
- package/src/api/nodeConversions/testUtil.ts +0 -65
- package/src/extensions/Blocks/api/block.ts +0 -307
- package/src/extensions/Blocks/api/blockTypes.ts +0 -249
- package/src/extensions/Blocks/api/cursorPositionTypes.ts +0 -7
- package/src/extensions/Blocks/api/defaultBlocks.ts +0 -16
- package/src/extensions/Blocks/api/defaultProps.ts +0 -16
- package/src/extensions/Blocks/api/inlineContentTypes.ts +0 -36
- package/src/extensions/Blocks/api/selectionTypes.ts +0 -5
- package/src/extensions/Blocks/api/serialization.ts +0 -29
- package/src/extensions/Blocks/helpers/findBlock.ts +0 -5
- package/src/extensions/Blocks/index.ts +0 -8
- package/src/extensions/Blocks/nodes/BlockAttributes.ts +0 -10
- package/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.ts +0 -142
- package/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.ts +0 -62
- package/src/extensions/Blocks/nodes/BlockGroup.ts +0 -53
- package/types/src/api/formatConversions/formatConversions.d.ts +0 -6
- package/types/src/api/nodeConversions/testUtil.d.ts +0 -2
- package/types/src/extensions/Blocks/api/block.d.ts +0 -20
- package/types/src/extensions/Blocks/api/blockTypes.d.ts +0 -103
- package/types/src/extensions/Blocks/api/cursorPositionTypes.d.ts +0 -6
- package/types/src/extensions/Blocks/api/defaultBlocks.d.ts +0 -117
- package/types/src/extensions/Blocks/api/inlineContentTypes.d.ts +0 -30
- package/types/src/extensions/Blocks/api/selectionTypes.d.ts +0 -4
- package/types/src/extensions/Blocks/api/serialization.d.ts +0 -2
- package/types/src/extensions/Blocks/helpers/findBlock.d.ts +0 -6
- package/types/src/extensions/Blocks/index.d.ts +0 -4
- package/types/src/extensions/Blocks/nodes/BlockAttributes.d.ts +0 -2
- package/types/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.d.ts +0 -43
- package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.d.ts +0 -37
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +0 -35
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +0 -35
- package/types/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.d.ts +0 -44
- /package/src/{shared/EditorElement.ts → api/exporters/markdown/__snapshots__/hardbreak/only/markdown.md} +0 -0
- /package/{types/src/shared/EditorElement.d.ts → src/api/exporters/markdown/__snapshots__/paragraph/empty/markdown.md} +0 -0
- /package/src/api/{formatConversions → exporters/markdown}/removeUnderlinesRehypePlugin.ts +0 -0
- /package/src/{extensions/Blocks/helpers → api}/getBlockInfoFromPos.ts +0 -0
- /package/src/api/{util/nodeUtil.ts → nodeUtil.ts} +0 -0
- /package/src/{extensions/Blocks/nodes/BlockContent → blocks}/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
- /package/src/extensions/{Blocks → NonEditableBlocks}/NonEditableBlockPlugin.ts +0 -0
- /package/src/extensions/{Blocks → PreviousBlockType}/PreviousBlockTypePlugin.ts +0 -0
- /package/src/{shared → extensions-shared}/BaseUiElementTypes.ts +0 -0
- /package/src/{shared/plugins → extensions-shared}/suggestion/SuggestionItem.ts +0 -0
- /package/src/{shared → util}/EventEmitter.ts +0 -0
- /package/types/src/{BlockNoteEditor.test.d.ts → api/exporters/html/htmlConversion.test.d.ts} +0 -0
- /package/types/src/api/{formatConversions → exporters/html/util}/simplifyBlocksRehypePlugin.d.ts +0 -0
- /package/types/src/api/{formatConversions/formatConversions.test.d.ts → exporters/markdown/markdownExporter.test.d.ts} +0 -0
- /package/types/src/api/{formatConversions → exporters/markdown}/removeUnderlinesRehypePlugin.d.ts +0 -0
- /package/types/src/{extensions/Blocks/helpers → api}/getBlockInfoFromPos.d.ts +0 -0
- /package/types/src/api/{util/nodeUtil.d.ts → nodeUtil.d.ts} +0 -0
- /package/types/src/{extensions/Blocks/nodes/BlockContent → blocks}/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
- /package/types/src/{extensions/Blocks/nodes/BlockContent → blocks}/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +0 -0
- /package/types/src/{extensions/Blocks/nodes/BlockContent → blocks}/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.d.ts +0 -0
- /package/types/src/extensions/{Blocks → NonEditableBlocks}/NonEditableBlockPlugin.d.ts +0 -0
- /package/types/src/extensions/{Blocks → PreviousBlockType}/PreviousBlockTypePlugin.d.ts +0 -0
- /package/types/src/{shared → extensions-shared}/BaseUiElementTypes.d.ts +0 -0
- /package/types/src/{shared/plugins → extensions-shared}/suggestion/SuggestionItem.d.ts +0 -0
- /package/types/src/{extensions/Blocks/nodes → pm-nodes}/BlockGroup.d.ts +0 -0
- /package/types/src/{shared → util}/EventEmitter.d.ts +0 -0
|
@@ -1,6 +1,134 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: custom inline content schema > Convert mention/basic to/from prosemirror 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"attrs": {
|
|
6
|
+
"backgroundColor": "default",
|
|
7
|
+
"id": "1",
|
|
8
|
+
"textColor": "default",
|
|
9
|
+
},
|
|
10
|
+
"content": [
|
|
11
|
+
{
|
|
12
|
+
"attrs": {
|
|
13
|
+
"textAlignment": "left",
|
|
14
|
+
},
|
|
15
|
+
"content": [
|
|
16
|
+
{
|
|
17
|
+
"text": "I enjoy working with ",
|
|
18
|
+
"type": "text",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"attrs": {
|
|
22
|
+
"user": "Matthew",
|
|
23
|
+
},
|
|
24
|
+
"type": "mention",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
"type": "paragraph",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
"type": "blockContainer",
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: custom inline content schema > Convert tag/basic to/from prosemirror 1`] = `
|
|
35
|
+
{
|
|
36
|
+
"attrs": {
|
|
37
|
+
"backgroundColor": "default",
|
|
38
|
+
"id": "1",
|
|
39
|
+
"textColor": "default",
|
|
40
|
+
},
|
|
41
|
+
"content": [
|
|
42
|
+
{
|
|
43
|
+
"attrs": {
|
|
44
|
+
"textAlignment": "left",
|
|
45
|
+
},
|
|
46
|
+
"content": [
|
|
47
|
+
{
|
|
48
|
+
"text": "I love ",
|
|
49
|
+
"type": "text",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"content": [
|
|
53
|
+
{
|
|
54
|
+
"text": "BlockNote",
|
|
55
|
+
"type": "text",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
"type": "tag",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
"type": "paragraph",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
"type": "blockContainer",
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: custom style schema > Convert fontSize/basic to/from prosemirror 1`] = `
|
|
69
|
+
{
|
|
70
|
+
"attrs": {
|
|
71
|
+
"backgroundColor": "default",
|
|
72
|
+
"id": "1",
|
|
73
|
+
"textColor": "default",
|
|
74
|
+
},
|
|
75
|
+
"content": [
|
|
76
|
+
{
|
|
77
|
+
"attrs": {
|
|
78
|
+
"textAlignment": "left",
|
|
79
|
+
},
|
|
80
|
+
"content": [
|
|
81
|
+
{
|
|
82
|
+
"marks": [
|
|
83
|
+
{
|
|
84
|
+
"attrs": {
|
|
85
|
+
"stringValue": "18px",
|
|
86
|
+
},
|
|
87
|
+
"type": "fontSize",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
"text": "This is text with a custom fontSize",
|
|
91
|
+
"type": "text",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
"type": "paragraph",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
"type": "blockContainer",
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: custom style schema > Convert small/basic to/from prosemirror 1`] = `
|
|
102
|
+
{
|
|
103
|
+
"attrs": {
|
|
104
|
+
"backgroundColor": "default",
|
|
105
|
+
"id": "1",
|
|
106
|
+
"textColor": "default",
|
|
107
|
+
},
|
|
108
|
+
"content": [
|
|
109
|
+
{
|
|
110
|
+
"attrs": {
|
|
111
|
+
"textAlignment": "left",
|
|
112
|
+
},
|
|
113
|
+
"content": [
|
|
114
|
+
{
|
|
115
|
+
"marks": [
|
|
116
|
+
{
|
|
117
|
+
"type": "small",
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
"text": "This is a small text",
|
|
121
|
+
"type": "text",
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
"type": "paragraph",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
"type": "blockContainer",
|
|
128
|
+
}
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert complex/misc to/from prosemirror 1`] = `
|
|
4
132
|
{
|
|
5
133
|
"attrs": {
|
|
6
134
|
"backgroundColor": "blue",
|
|
@@ -89,68 +217,91 @@ exports[`Complex ProseMirror Node Conversions > Convert complex block to node 1`
|
|
|
89
217
|
}
|
|
90
218
|
`;
|
|
91
219
|
|
|
92
|
-
exports[`
|
|
220
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/basic to/from prosemirror 1`] = `
|
|
93
221
|
{
|
|
94
|
-
"
|
|
222
|
+
"attrs": {
|
|
223
|
+
"backgroundColor": "default",
|
|
224
|
+
"id": "1",
|
|
225
|
+
"textColor": "default",
|
|
226
|
+
},
|
|
227
|
+
"content": [
|
|
95
228
|
{
|
|
96
|
-
"
|
|
229
|
+
"attrs": {
|
|
230
|
+
"textAlignment": "left",
|
|
231
|
+
},
|
|
97
232
|
"content": [
|
|
98
233
|
{
|
|
99
|
-
"
|
|
100
|
-
"
|
|
234
|
+
"text": "Text1",
|
|
235
|
+
"type": "text",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"type": "hardBreak",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"text": "Text2",
|
|
101
242
|
"type": "text",
|
|
102
243
|
},
|
|
103
244
|
],
|
|
104
|
-
"id": "2",
|
|
105
|
-
"props": {
|
|
106
|
-
"backgroundColor": "red",
|
|
107
|
-
"textAlignment": "left",
|
|
108
|
-
"textColor": "default",
|
|
109
|
-
},
|
|
110
245
|
"type": "paragraph",
|
|
111
246
|
},
|
|
112
|
-
{
|
|
113
|
-
"children": [],
|
|
114
|
-
"content": [],
|
|
115
|
-
"id": "3",
|
|
116
|
-
"props": {
|
|
117
|
-
"backgroundColor": "default",
|
|
118
|
-
"textAlignment": "left",
|
|
119
|
-
"textColor": "default",
|
|
120
|
-
},
|
|
121
|
-
"type": "bulletListItem",
|
|
122
|
-
},
|
|
123
247
|
],
|
|
248
|
+
"type": "blockContainer",
|
|
249
|
+
}
|
|
250
|
+
`;
|
|
251
|
+
|
|
252
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/between-links to/from prosemirror 1`] = `
|
|
253
|
+
{
|
|
254
|
+
"attrs": {
|
|
255
|
+
"backgroundColor": "default",
|
|
256
|
+
"id": "1",
|
|
257
|
+
"textColor": "default",
|
|
258
|
+
},
|
|
124
259
|
"content": [
|
|
125
260
|
{
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"underline": true,
|
|
129
|
-
},
|
|
130
|
-
"text": "Heading ",
|
|
131
|
-
"type": "text",
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"styles": {
|
|
135
|
-
"italic": true,
|
|
136
|
-
"strike": true,
|
|
261
|
+
"attrs": {
|
|
262
|
+
"textAlignment": "left",
|
|
137
263
|
},
|
|
138
|
-
"
|
|
139
|
-
|
|
264
|
+
"content": [
|
|
265
|
+
{
|
|
266
|
+
"marks": [
|
|
267
|
+
{
|
|
268
|
+
"attrs": {
|
|
269
|
+
"class": null,
|
|
270
|
+
"href": "https://www.website.com",
|
|
271
|
+
"target": "_blank",
|
|
272
|
+
},
|
|
273
|
+
"type": "link",
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
"text": "Link1",
|
|
277
|
+
"type": "text",
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "hardBreak",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"marks": [
|
|
284
|
+
{
|
|
285
|
+
"attrs": {
|
|
286
|
+
"class": null,
|
|
287
|
+
"href": "https://www.website2.com",
|
|
288
|
+
"target": "_blank",
|
|
289
|
+
},
|
|
290
|
+
"type": "link",
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
"text": "Link2",
|
|
294
|
+
"type": "text",
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
"type": "paragraph",
|
|
140
298
|
},
|
|
141
299
|
],
|
|
142
|
-
"
|
|
143
|
-
"props": {
|
|
144
|
-
"backgroundColor": "blue",
|
|
145
|
-
"level": 2,
|
|
146
|
-
"textAlignment": "right",
|
|
147
|
-
"textColor": "yellow",
|
|
148
|
-
},
|
|
149
|
-
"type": "heading",
|
|
300
|
+
"type": "blockContainer",
|
|
150
301
|
}
|
|
151
302
|
`;
|
|
152
303
|
|
|
153
|
-
exports[`
|
|
304
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/end to/from prosemirror 1`] = `
|
|
154
305
|
{
|
|
155
306
|
"attrs": {
|
|
156
307
|
"backgroundColor": "default",
|
|
@@ -162,6 +313,15 @@ exports[`Simple ProseMirror Node Conversions > Convert simple block to node 1`]
|
|
|
162
313
|
"attrs": {
|
|
163
314
|
"textAlignment": "left",
|
|
164
315
|
},
|
|
316
|
+
"content": [
|
|
317
|
+
{
|
|
318
|
+
"text": "Text1",
|
|
319
|
+
"type": "text",
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"type": "hardBreak",
|
|
323
|
+
},
|
|
324
|
+
],
|
|
165
325
|
"type": "paragraph",
|
|
166
326
|
},
|
|
167
327
|
],
|
|
@@ -169,21 +329,59 @@ exports[`Simple ProseMirror Node Conversions > Convert simple block to node 1`]
|
|
|
169
329
|
}
|
|
170
330
|
`;
|
|
171
331
|
|
|
172
|
-
exports[`
|
|
332
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/link to/from prosemirror 1`] = `
|
|
173
333
|
{
|
|
174
|
-
"
|
|
175
|
-
"content": [],
|
|
176
|
-
"id": "1",
|
|
177
|
-
"props": {
|
|
334
|
+
"attrs": {
|
|
178
335
|
"backgroundColor": "default",
|
|
179
|
-
"
|
|
336
|
+
"id": "1",
|
|
180
337
|
"textColor": "default",
|
|
181
338
|
},
|
|
182
|
-
"
|
|
339
|
+
"content": [
|
|
340
|
+
{
|
|
341
|
+
"attrs": {
|
|
342
|
+
"textAlignment": "left",
|
|
343
|
+
},
|
|
344
|
+
"content": [
|
|
345
|
+
{
|
|
346
|
+
"marks": [
|
|
347
|
+
{
|
|
348
|
+
"attrs": {
|
|
349
|
+
"class": null,
|
|
350
|
+
"href": "https://www.website.com",
|
|
351
|
+
"target": "_blank",
|
|
352
|
+
},
|
|
353
|
+
"type": "link",
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
"text": "Link1",
|
|
357
|
+
"type": "text",
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"type": "hardBreak",
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"marks": [
|
|
364
|
+
{
|
|
365
|
+
"attrs": {
|
|
366
|
+
"class": null,
|
|
367
|
+
"href": "https://www.website.com",
|
|
368
|
+
"target": "_blank",
|
|
369
|
+
},
|
|
370
|
+
"type": "link",
|
|
371
|
+
},
|
|
372
|
+
],
|
|
373
|
+
"text": "Link1",
|
|
374
|
+
"type": "text",
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
"type": "paragraph",
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
"type": "blockContainer",
|
|
183
381
|
}
|
|
184
382
|
`;
|
|
185
383
|
|
|
186
|
-
exports[`
|
|
384
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/multiple to/from prosemirror 1`] = `
|
|
187
385
|
{
|
|
188
386
|
"attrs": {
|
|
189
387
|
"backgroundColor": "default",
|
|
@@ -207,6 +405,13 @@ exports[`hard breaks > Convert a block with a hard break 1`] = `
|
|
|
207
405
|
"text": "Text2",
|
|
208
406
|
"type": "text",
|
|
209
407
|
},
|
|
408
|
+
{
|
|
409
|
+
"type": "hardBreak",
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"text": "Text3",
|
|
413
|
+
"type": "text",
|
|
414
|
+
},
|
|
210
415
|
],
|
|
211
416
|
"type": "paragraph",
|
|
212
417
|
},
|
|
@@ -215,7 +420,7 @@ exports[`hard breaks > Convert a block with a hard break 1`] = `
|
|
|
215
420
|
}
|
|
216
421
|
`;
|
|
217
422
|
|
|
218
|
-
exports[`
|
|
423
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/only to/from prosemirror 1`] = `
|
|
219
424
|
{
|
|
220
425
|
"attrs": {
|
|
221
426
|
"backgroundColor": "default",
|
|
@@ -229,19 +434,34 @@ exports[`hard breaks > Convert a block with a hard break and different styles 1`
|
|
|
229
434
|
},
|
|
230
435
|
"content": [
|
|
231
436
|
{
|
|
232
|
-
"
|
|
233
|
-
"type": "text",
|
|
437
|
+
"type": "hardBreak",
|
|
234
438
|
},
|
|
439
|
+
],
|
|
440
|
+
"type": "paragraph",
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
"type": "blockContainer",
|
|
444
|
+
}
|
|
445
|
+
`;
|
|
446
|
+
|
|
447
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/start to/from prosemirror 1`] = `
|
|
448
|
+
{
|
|
449
|
+
"attrs": {
|
|
450
|
+
"backgroundColor": "default",
|
|
451
|
+
"id": "1",
|
|
452
|
+
"textColor": "default",
|
|
453
|
+
},
|
|
454
|
+
"content": [
|
|
455
|
+
{
|
|
456
|
+
"attrs": {
|
|
457
|
+
"textAlignment": "left",
|
|
458
|
+
},
|
|
459
|
+
"content": [
|
|
235
460
|
{
|
|
236
461
|
"type": "hardBreak",
|
|
237
462
|
},
|
|
238
463
|
{
|
|
239
|
-
"
|
|
240
|
-
{
|
|
241
|
-
"type": "bold",
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
"text": "Text2",
|
|
464
|
+
"text": "Text1",
|
|
245
465
|
"type": "text",
|
|
246
466
|
},
|
|
247
467
|
],
|
|
@@ -252,7 +472,7 @@ exports[`hard breaks > Convert a block with a hard break and different styles 1`
|
|
|
252
472
|
}
|
|
253
473
|
`;
|
|
254
474
|
|
|
255
|
-
exports[`
|
|
475
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert hardbreak/styles to/from prosemirror 1`] = `
|
|
256
476
|
{
|
|
257
477
|
"attrs": {
|
|
258
478
|
"backgroundColor": "default",
|
|
@@ -272,6 +492,15 @@ exports[`hard breaks > Convert a block with a hard break at the end 1`] = `
|
|
|
272
492
|
{
|
|
273
493
|
"type": "hardBreak",
|
|
274
494
|
},
|
|
495
|
+
{
|
|
496
|
+
"marks": [
|
|
497
|
+
{
|
|
498
|
+
"type": "bold",
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
"text": "Text2",
|
|
502
|
+
"type": "text",
|
|
503
|
+
},
|
|
275
504
|
],
|
|
276
505
|
"type": "paragraph",
|
|
277
506
|
},
|
|
@@ -280,7 +509,7 @@ exports[`hard breaks > Convert a block with a hard break at the end 1`] = `
|
|
|
280
509
|
}
|
|
281
510
|
`;
|
|
282
511
|
|
|
283
|
-
exports[`
|
|
512
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/basic to/from prosemirror 1`] = `
|
|
284
513
|
{
|
|
285
514
|
"attrs": {
|
|
286
515
|
"backgroundColor": "default",
|
|
@@ -290,25 +519,87 @@ exports[`hard breaks > Convert a block with a hard break at the start 1`] = `
|
|
|
290
519
|
"content": [
|
|
291
520
|
{
|
|
292
521
|
"attrs": {
|
|
522
|
+
"caption": "Caption",
|
|
293
523
|
"textAlignment": "left",
|
|
524
|
+
"url": "exampleURL",
|
|
525
|
+
"width": 256,
|
|
294
526
|
},
|
|
527
|
+
"type": "image",
|
|
528
|
+
},
|
|
529
|
+
],
|
|
530
|
+
"type": "blockContainer",
|
|
531
|
+
}
|
|
532
|
+
`;
|
|
533
|
+
|
|
534
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/button to/from prosemirror 1`] = `
|
|
535
|
+
{
|
|
536
|
+
"attrs": {
|
|
537
|
+
"backgroundColor": "default",
|
|
538
|
+
"id": "1",
|
|
539
|
+
"textColor": "default",
|
|
540
|
+
},
|
|
541
|
+
"content": [
|
|
542
|
+
{
|
|
543
|
+
"attrs": {
|
|
544
|
+
"caption": "",
|
|
545
|
+
"textAlignment": "left",
|
|
546
|
+
"url": "",
|
|
547
|
+
"width": 512,
|
|
548
|
+
},
|
|
549
|
+
"type": "image",
|
|
550
|
+
},
|
|
551
|
+
],
|
|
552
|
+
"type": "blockContainer",
|
|
553
|
+
}
|
|
554
|
+
`;
|
|
555
|
+
|
|
556
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert image/nested to/from prosemirror 1`] = `
|
|
557
|
+
{
|
|
558
|
+
"attrs": {
|
|
559
|
+
"backgroundColor": "default",
|
|
560
|
+
"id": "1",
|
|
561
|
+
"textColor": "default",
|
|
562
|
+
},
|
|
563
|
+
"content": [
|
|
564
|
+
{
|
|
565
|
+
"attrs": {
|
|
566
|
+
"caption": "Caption",
|
|
567
|
+
"textAlignment": "left",
|
|
568
|
+
"url": "exampleURL",
|
|
569
|
+
"width": 256,
|
|
570
|
+
},
|
|
571
|
+
"type": "image",
|
|
572
|
+
},
|
|
573
|
+
{
|
|
295
574
|
"content": [
|
|
296
575
|
{
|
|
297
|
-
"
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
576
|
+
"attrs": {
|
|
577
|
+
"backgroundColor": "default",
|
|
578
|
+
"id": "2",
|
|
579
|
+
"textColor": "default",
|
|
580
|
+
},
|
|
581
|
+
"content": [
|
|
582
|
+
{
|
|
583
|
+
"attrs": {
|
|
584
|
+
"caption": "Caption",
|
|
585
|
+
"textAlignment": "left",
|
|
586
|
+
"url": "exampleURL",
|
|
587
|
+
"width": 256,
|
|
588
|
+
},
|
|
589
|
+
"type": "image",
|
|
590
|
+
},
|
|
591
|
+
],
|
|
592
|
+
"type": "blockContainer",
|
|
302
593
|
},
|
|
303
594
|
],
|
|
304
|
-
"type": "
|
|
595
|
+
"type": "blockGroup",
|
|
305
596
|
},
|
|
306
597
|
],
|
|
307
598
|
"type": "blockContainer",
|
|
308
599
|
}
|
|
309
600
|
`;
|
|
310
601
|
|
|
311
|
-
exports[`
|
|
602
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/adjacent to/from prosemirror 1`] = `
|
|
312
603
|
{
|
|
313
604
|
"attrs": {
|
|
314
605
|
"backgroundColor": "default",
|
|
@@ -332,12 +623,9 @@ exports[`hard breaks > Convert a block with a hard break between links 1`] = `
|
|
|
332
623
|
"type": "link",
|
|
333
624
|
},
|
|
334
625
|
],
|
|
335
|
-
"text": "
|
|
626
|
+
"text": "Website",
|
|
336
627
|
"type": "text",
|
|
337
628
|
},
|
|
338
|
-
{
|
|
339
|
-
"type": "hardBreak",
|
|
340
|
-
},
|
|
341
629
|
{
|
|
342
630
|
"marks": [
|
|
343
631
|
{
|
|
@@ -349,7 +637,7 @@ exports[`hard breaks > Convert a block with a hard break between links 1`] = `
|
|
|
349
637
|
"type": "link",
|
|
350
638
|
},
|
|
351
639
|
],
|
|
352
|
-
"text": "
|
|
640
|
+
"text": "Website2",
|
|
353
641
|
"type": "text",
|
|
354
642
|
},
|
|
355
643
|
],
|
|
@@ -360,7 +648,7 @@ exports[`hard breaks > Convert a block with a hard break between links 1`] = `
|
|
|
360
648
|
}
|
|
361
649
|
`;
|
|
362
650
|
|
|
363
|
-
exports[`
|
|
651
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/basic to/from prosemirror 1`] = `
|
|
364
652
|
{
|
|
365
653
|
"attrs": {
|
|
366
654
|
"backgroundColor": "default",
|
|
@@ -384,11 +672,46 @@ exports[`hard breaks > Convert a block with a hard break in a link 1`] = `
|
|
|
384
672
|
"type": "link",
|
|
385
673
|
},
|
|
386
674
|
],
|
|
387
|
-
"text": "
|
|
675
|
+
"text": "Website",
|
|
388
676
|
"type": "text",
|
|
389
677
|
},
|
|
678
|
+
],
|
|
679
|
+
"type": "paragraph",
|
|
680
|
+
},
|
|
681
|
+
],
|
|
682
|
+
"type": "blockContainer",
|
|
683
|
+
}
|
|
684
|
+
`;
|
|
685
|
+
|
|
686
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert link/styled to/from prosemirror 1`] = `
|
|
687
|
+
{
|
|
688
|
+
"attrs": {
|
|
689
|
+
"backgroundColor": "default",
|
|
690
|
+
"id": "1",
|
|
691
|
+
"textColor": "default",
|
|
692
|
+
},
|
|
693
|
+
"content": [
|
|
694
|
+
{
|
|
695
|
+
"attrs": {
|
|
696
|
+
"textAlignment": "left",
|
|
697
|
+
},
|
|
698
|
+
"content": [
|
|
390
699
|
{
|
|
391
|
-
"
|
|
700
|
+
"marks": [
|
|
701
|
+
{
|
|
702
|
+
"type": "bold",
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"attrs": {
|
|
706
|
+
"class": null,
|
|
707
|
+
"href": "https://www.website.com",
|
|
708
|
+
"target": "_blank",
|
|
709
|
+
},
|
|
710
|
+
"type": "link",
|
|
711
|
+
},
|
|
712
|
+
],
|
|
713
|
+
"text": "Web",
|
|
714
|
+
"type": "text",
|
|
392
715
|
},
|
|
393
716
|
{
|
|
394
717
|
"marks": [
|
|
@@ -401,7 +724,7 @@ exports[`hard breaks > Convert a block with a hard break in a link 1`] = `
|
|
|
401
724
|
"type": "link",
|
|
402
725
|
},
|
|
403
726
|
],
|
|
404
|
-
"text": "
|
|
727
|
+
"text": "site",
|
|
405
728
|
"type": "text",
|
|
406
729
|
},
|
|
407
730
|
],
|
|
@@ -412,7 +735,7 @@ exports[`hard breaks > Convert a block with a hard break in a link 1`] = `
|
|
|
412
735
|
}
|
|
413
736
|
`;
|
|
414
737
|
|
|
415
|
-
exports[`
|
|
738
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/basic to/from prosemirror 1`] = `
|
|
416
739
|
{
|
|
417
740
|
"attrs": {
|
|
418
741
|
"backgroundColor": "default",
|
|
@@ -426,21 +749,7 @@ exports[`hard breaks > Convert a block with multiple hard breaks 1`] = `
|
|
|
426
749
|
},
|
|
427
750
|
"content": [
|
|
428
751
|
{
|
|
429
|
-
"text": "
|
|
430
|
-
"type": "text",
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
"type": "hardBreak",
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
"text": "Text2",
|
|
437
|
-
"type": "text",
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
"type": "hardBreak",
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
"text": "Text3",
|
|
752
|
+
"text": "Paragraph",
|
|
444
753
|
"type": "text",
|
|
445
754
|
},
|
|
446
755
|
],
|
|
@@ -451,7 +760,7 @@ exports[`hard breaks > Convert a block with multiple hard breaks 1`] = `
|
|
|
451
760
|
}
|
|
452
761
|
`;
|
|
453
762
|
|
|
454
|
-
exports[`
|
|
763
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/empty to/from prosemirror 1`] = `
|
|
455
764
|
{
|
|
456
765
|
"attrs": {
|
|
457
766
|
"backgroundColor": "default",
|
|
@@ -463,11 +772,6 @@ exports[`hard breaks > Convert a block with only a hard break 1`] = `
|
|
|
463
772
|
"attrs": {
|
|
464
773
|
"textAlignment": "left",
|
|
465
774
|
},
|
|
466
|
-
"content": [
|
|
467
|
-
{
|
|
468
|
-
"type": "hardBreak",
|
|
469
|
-
},
|
|
470
|
-
],
|
|
471
775
|
"type": "paragraph",
|
|
472
776
|
},
|
|
473
777
|
],
|
|
@@ -475,7 +779,7 @@ exports[`hard breaks > Convert a block with only a hard break 1`] = `
|
|
|
475
779
|
}
|
|
476
780
|
`;
|
|
477
781
|
|
|
478
|
-
exports[`
|
|
782
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/nested to/from prosemirror 1`] = `
|
|
479
783
|
{
|
|
480
784
|
"attrs": {
|
|
481
785
|
"backgroundColor": "default",
|
|
@@ -489,66 +793,123 @@ exports[`links > Convert a block with link 1`] = `
|
|
|
489
793
|
},
|
|
490
794
|
"content": [
|
|
491
795
|
{
|
|
492
|
-
"
|
|
796
|
+
"text": "Paragraph",
|
|
797
|
+
"type": "text",
|
|
798
|
+
},
|
|
799
|
+
],
|
|
800
|
+
"type": "paragraph",
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
"content": [
|
|
804
|
+
{
|
|
805
|
+
"attrs": {
|
|
806
|
+
"backgroundColor": "default",
|
|
807
|
+
"id": "2",
|
|
808
|
+
"textColor": "default",
|
|
809
|
+
},
|
|
810
|
+
"content": [
|
|
493
811
|
{
|
|
494
812
|
"attrs": {
|
|
495
|
-
"
|
|
496
|
-
"href": "https://www.website.com",
|
|
497
|
-
"target": "_blank",
|
|
813
|
+
"textAlignment": "left",
|
|
498
814
|
},
|
|
499
|
-
"
|
|
815
|
+
"content": [
|
|
816
|
+
{
|
|
817
|
+
"text": "Nested Paragraph 1",
|
|
818
|
+
"type": "text",
|
|
819
|
+
},
|
|
820
|
+
],
|
|
821
|
+
"type": "paragraph",
|
|
500
822
|
},
|
|
501
823
|
],
|
|
502
|
-
"
|
|
503
|
-
|
|
824
|
+
"type": "blockContainer",
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"attrs": {
|
|
828
|
+
"backgroundColor": "default",
|
|
829
|
+
"id": "3",
|
|
830
|
+
"textColor": "default",
|
|
831
|
+
},
|
|
832
|
+
"content": [
|
|
833
|
+
{
|
|
834
|
+
"attrs": {
|
|
835
|
+
"textAlignment": "left",
|
|
836
|
+
},
|
|
837
|
+
"content": [
|
|
838
|
+
{
|
|
839
|
+
"text": "Nested Paragraph 2",
|
|
840
|
+
"type": "text",
|
|
841
|
+
},
|
|
842
|
+
],
|
|
843
|
+
"type": "paragraph",
|
|
844
|
+
},
|
|
845
|
+
],
|
|
846
|
+
"type": "blockContainer",
|
|
504
847
|
},
|
|
505
848
|
],
|
|
506
|
-
"type": "
|
|
849
|
+
"type": "blockGroup",
|
|
507
850
|
},
|
|
508
851
|
],
|
|
509
852
|
"type": "blockContainer",
|
|
510
853
|
}
|
|
511
854
|
`;
|
|
512
855
|
|
|
513
|
-
exports[`
|
|
856
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert paragraph/styled to/from prosemirror 1`] = `
|
|
514
857
|
{
|
|
515
858
|
"attrs": {
|
|
516
|
-
"backgroundColor": "
|
|
859
|
+
"backgroundColor": "pink",
|
|
517
860
|
"id": "1",
|
|
518
|
-
"textColor": "
|
|
861
|
+
"textColor": "orange",
|
|
519
862
|
},
|
|
520
863
|
"content": [
|
|
521
864
|
{
|
|
522
865
|
"attrs": {
|
|
523
|
-
"textAlignment": "
|
|
866
|
+
"textAlignment": "center",
|
|
524
867
|
},
|
|
525
868
|
"content": [
|
|
869
|
+
{
|
|
870
|
+
"text": "Plain ",
|
|
871
|
+
"type": "text",
|
|
872
|
+
},
|
|
526
873
|
{
|
|
527
874
|
"marks": [
|
|
528
875
|
{
|
|
529
876
|
"attrs": {
|
|
530
|
-
"
|
|
531
|
-
"href": "https://www.website.com",
|
|
532
|
-
"target": "_blank",
|
|
877
|
+
"stringValue": "red",
|
|
533
878
|
},
|
|
534
|
-
"type": "
|
|
879
|
+
"type": "textColor",
|
|
535
880
|
},
|
|
536
881
|
],
|
|
537
|
-
"text": "
|
|
882
|
+
"text": "Red Text ",
|
|
538
883
|
"type": "text",
|
|
539
884
|
},
|
|
540
885
|
{
|
|
541
886
|
"marks": [
|
|
542
887
|
{
|
|
543
888
|
"attrs": {
|
|
544
|
-
"
|
|
545
|
-
"href": "https://www.website2.com",
|
|
546
|
-
"target": "_blank",
|
|
889
|
+
"stringValue": "blue",
|
|
547
890
|
},
|
|
548
|
-
"type": "
|
|
891
|
+
"type": "backgroundColor",
|
|
549
892
|
},
|
|
550
893
|
],
|
|
551
|
-
"text": "
|
|
894
|
+
"text": "Blue Background ",
|
|
895
|
+
"type": "text",
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"marks": [
|
|
899
|
+
{
|
|
900
|
+
"attrs": {
|
|
901
|
+
"stringValue": "red",
|
|
902
|
+
},
|
|
903
|
+
"type": "textColor",
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"attrs": {
|
|
907
|
+
"stringValue": "blue",
|
|
908
|
+
},
|
|
909
|
+
"type": "backgroundColor",
|
|
910
|
+
},
|
|
911
|
+
],
|
|
912
|
+
"text": "Mixed Colors",
|
|
552
913
|
"type": "text",
|
|
553
914
|
},
|
|
554
915
|
],
|