@blocknote/core 0.9.5 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +3699 -2600
- 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 +8 -4
- 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/empty/markdown.md +0 -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 -98
- 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 +117 -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} +70 -66
- package/src/{BlockNoteEditor.test.ts → editor/BlockNoteEditor.test.ts} +2 -2
- package/src/{BlockNoteEditor.ts → editor/BlockNoteEditor.ts} +382 -159
- 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} +42 -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 +77 -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/BlockNoteEditor.d.ts +51 -37
- package/types/src/BlockNoteExtensions.d.ts +8 -3
- 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/exporters/markdown/markdownExporter.test.d.ts +1 -0
- package/types/src/api/getBlockInfoFromPos.d.ts +27 -0
- package/types/src/api/nodeConversions/nodeConversions.d.ts +14 -6
- package/types/src/api/nodeConversions/testUtil.d.ts +7 -2
- package/types/src/api/nodeUtil.d.ts +8 -0
- 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/testCases/cases/customBlocks.d.ts +345 -0
- package/types/src/api/testCases/cases/customInlineContent.d.ts +29 -0
- package/types/src/api/testCases/cases/customStyles.d.ts +64 -0
- package/types/src/api/testCases/cases/defaultSchema.d.ts +3 -0
- package/types/src/api/testCases/index.d.ts +12 -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/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +1 -0
- package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +46 -0
- package/types/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +2 -0
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.d.ts +2 -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/blocks/defaultProps.d.ts +15 -0
- package/types/src/editor/BlockNoteEditor.d.ts +299 -0
- package/types/src/editor/BlockNoteEditor.test.d.ts +1 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +24 -0
- 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/Blocks/api/blocks/createSpec.d.ts +35 -0
- package/types/src/extensions/Blocks/api/blocks/internal.d.ts +45 -0
- package/types/src/extensions/Blocks/api/blocks/types.d.ts +114 -0
- package/types/src/extensions/Blocks/api/cursorPositionTypes.d.ts +7 -5
- package/types/src/extensions/Blocks/api/defaultBlocks.d.ts +573 -113
- package/types/src/extensions/Blocks/api/defaultProps.d.ts +2 -1
- package/types/src/extensions/Blocks/api/inlineContent/createSpec.d.ts +21 -0
- package/types/src/extensions/Blocks/api/inlineContent/internal.d.ts +25 -0
- package/types/src/extensions/Blocks/api/inlineContent/types.d.ts +62 -0
- package/types/src/extensions/Blocks/api/selectionTypes.d.ts +5 -3
- package/types/src/extensions/Blocks/api/styles/createSpec.d.ts +13 -0
- package/types/src/extensions/Blocks/api/styles/internal.d.ts +22 -0
- package/types/src/extensions/Blocks/api/styles/types.d.ts +21 -0
- package/types/src/extensions/Blocks/nodes/BlockContainer.d.ts +8 -4
- package/types/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.d.ts +38 -23
- package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.d.ts +75 -17
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +30 -19
- package/types/src/extensions/Blocks/nodes/BlockContent/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +30 -19
- package/types/src/extensions/Blocks/nodes/BlockContent/ParagraphBlockContent/ParagraphBlockContent.d.ts +36 -28
- package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableBlockContent.d.ts +53 -0
- package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableExtension.d.ts +2 -0
- package/types/src/extensions/Blocks/nodes/BlockContent/defaultBlockHelpers.d.ts +12 -0
- package/types/src/extensions/Blocks/nodes/BlockGroup.d.ts +1 -1
- 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/NonEditableBlocks/NonEditableBlockPlugin.d.ts +2 -0
- package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +14 -0
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +19 -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/extensions-shared/BaseUiElementTypes.d.ts +7 -0
- package/types/src/extensions-shared/suggestion/SuggestionItem.d.ts +3 -0
- package/types/src/extensions-shared/suggestion/SuggestionPlugin.d.ts +36 -0
- package/types/src/index.d.ts +20 -15
- package/types/src/pm-nodes/BlockContainer.d.ts +28 -0
- package/types/src/pm-nodes/BlockGroup.d.ts +10 -0
- 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/plugins/suggestion/SuggestionPlugin.d.ts +4 -2
- package/types/src/util/EventEmitter.d.ts +11 -0
- package/types/src/util/browser.d.ts +3 -0
- 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/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/inlineContentTypes.d.ts +0 -30
- package/types/src/extensions/Blocks/api/serialization.d.ts +0 -2
- /package/src/{shared/EditorElement.ts → api/exporters/markdown/__snapshots__/hardbreak/only/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/api/{formatConversions/formatConversions.test.d.ts → 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 → exporters/markdown}/removeUnderlinesRehypePlugin.d.ts +0 -0
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import { Block, BlockSchema, PartialBlock } from "../../extensions/Blocks/api/
|
|
2
|
-
|
|
1
|
+
import { Block, BlockSchema, PartialBlock } from "../../extensions/Blocks/api/blocks/types";
|
|
2
|
+
import { InlineContentSchema } from "../../extensions/Blocks/api/inlineContent/types";
|
|
3
|
+
import { StyleSchema } from "../../extensions/Blocks/api/styles/types";
|
|
4
|
+
export declare function partialBlocksToBlocksForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BSchema, partialBlocks: Array<PartialBlock<BSchema, I, S>>): Array<Block<BSchema, I, S>>;
|
|
5
|
+
export declare function partialBlockToBlockForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BSchema, partialBlock: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
|
|
6
|
+
export declare function addIdsToBlock(block: PartialBlock<any, any, any>): void;
|
|
7
|
+
export declare function addIdsToBlocks(blocks: PartialBlock<any, any, any>[]): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
|
|
3
|
+
export declare function HTMLToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(html: string, blockSchema: BSchema, icSchema: I, styleSchema: S, pmSchema: Schema): Promise<Block<BSchema, I, S>[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nestedListsToBlockNoteStructure(elementOrHTML: HTMLElement | string): HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
|
|
3
|
+
export declare function markdownToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(markdown: string, blockSchema: BSchema, icSchema: I, styleSchema: S, pmSchema: Schema): Promise<Block<BSchema, I, S>[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Extension } from "@tiptap/core";
|
|
2
|
+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
|
|
3
|
+
import { InlineContentSchema, StyleSchema } from "../../schema";
|
|
4
|
+
export declare const createPasteFromClipboardExtension: <BSchema extends Record<string, import("../../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>) => Extension<{
|
|
5
|
+
editor: BlockNoteEditor<BSchema, I, S>;
|
|
6
|
+
}, undefined>;
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { EditorTestCases } from "..";
|
|
2
|
+
import { BlockSchemaFromSpecs } from "../../../extensions/Blocks/api/blocks/types";
|
|
3
|
+
import { DefaultInlineContentSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
4
|
+
declare const customSpecs: {
|
|
5
|
+
simpleImage: {
|
|
6
|
+
config: {
|
|
7
|
+
type: "simpleImage";
|
|
8
|
+
propSchema: {
|
|
9
|
+
textAlignment: {
|
|
10
|
+
default: "left";
|
|
11
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
12
|
+
};
|
|
13
|
+
backgroundColor: {
|
|
14
|
+
default: "default";
|
|
15
|
+
};
|
|
16
|
+
url: {
|
|
17
|
+
default: "";
|
|
18
|
+
};
|
|
19
|
+
caption: {
|
|
20
|
+
default: "";
|
|
21
|
+
};
|
|
22
|
+
width: {
|
|
23
|
+
default: 512;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
content: "none";
|
|
27
|
+
};
|
|
28
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
29
|
+
type: "simpleImage";
|
|
30
|
+
propSchema: {
|
|
31
|
+
textAlignment: {
|
|
32
|
+
default: "left";
|
|
33
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
34
|
+
};
|
|
35
|
+
backgroundColor: {
|
|
36
|
+
default: "default";
|
|
37
|
+
};
|
|
38
|
+
url: {
|
|
39
|
+
default: "";
|
|
40
|
+
};
|
|
41
|
+
caption: {
|
|
42
|
+
default: "";
|
|
43
|
+
};
|
|
44
|
+
width: {
|
|
45
|
+
default: 512;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
content: "none";
|
|
49
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
50
|
+
};
|
|
51
|
+
customParagraph: {
|
|
52
|
+
config: {
|
|
53
|
+
type: "customParagraph";
|
|
54
|
+
propSchema: {
|
|
55
|
+
backgroundColor: {
|
|
56
|
+
default: "default";
|
|
57
|
+
};
|
|
58
|
+
textColor: {
|
|
59
|
+
default: "default";
|
|
60
|
+
};
|
|
61
|
+
textAlignment: {
|
|
62
|
+
default: "left";
|
|
63
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
content: "inline";
|
|
67
|
+
};
|
|
68
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
69
|
+
type: "customParagraph";
|
|
70
|
+
propSchema: {
|
|
71
|
+
backgroundColor: {
|
|
72
|
+
default: "default";
|
|
73
|
+
};
|
|
74
|
+
textColor: {
|
|
75
|
+
default: "default";
|
|
76
|
+
};
|
|
77
|
+
textAlignment: {
|
|
78
|
+
default: "left";
|
|
79
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
content: "inline";
|
|
83
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
84
|
+
};
|
|
85
|
+
simpleCustomParagraph: {
|
|
86
|
+
config: {
|
|
87
|
+
type: "simpleCustomParagraph";
|
|
88
|
+
propSchema: {
|
|
89
|
+
backgroundColor: {
|
|
90
|
+
default: "default";
|
|
91
|
+
};
|
|
92
|
+
textColor: {
|
|
93
|
+
default: "default";
|
|
94
|
+
};
|
|
95
|
+
textAlignment: {
|
|
96
|
+
default: "left";
|
|
97
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
content: "inline";
|
|
101
|
+
};
|
|
102
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
103
|
+
type: "simpleCustomParagraph";
|
|
104
|
+
propSchema: {
|
|
105
|
+
backgroundColor: {
|
|
106
|
+
default: "default";
|
|
107
|
+
};
|
|
108
|
+
textColor: {
|
|
109
|
+
default: "default";
|
|
110
|
+
};
|
|
111
|
+
textAlignment: {
|
|
112
|
+
default: "left";
|
|
113
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
content: "inline";
|
|
117
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
118
|
+
};
|
|
119
|
+
paragraph: {
|
|
120
|
+
config: {
|
|
121
|
+
type: "paragraph";
|
|
122
|
+
content: "inline";
|
|
123
|
+
propSchema: {
|
|
124
|
+
backgroundColor: {
|
|
125
|
+
default: "default";
|
|
126
|
+
};
|
|
127
|
+
textColor: {
|
|
128
|
+
default: "default";
|
|
129
|
+
};
|
|
130
|
+
textAlignment: {
|
|
131
|
+
default: "left";
|
|
132
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
137
|
+
type: "paragraph";
|
|
138
|
+
content: "inline";
|
|
139
|
+
propSchema: {
|
|
140
|
+
backgroundColor: {
|
|
141
|
+
default: "default";
|
|
142
|
+
};
|
|
143
|
+
textColor: {
|
|
144
|
+
default: "default";
|
|
145
|
+
};
|
|
146
|
+
textAlignment: {
|
|
147
|
+
default: "left";
|
|
148
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
152
|
+
};
|
|
153
|
+
heading: {
|
|
154
|
+
config: {
|
|
155
|
+
type: "heading";
|
|
156
|
+
content: "inline";
|
|
157
|
+
propSchema: {
|
|
158
|
+
level: {
|
|
159
|
+
default: number;
|
|
160
|
+
values: readonly [1, 2, 3];
|
|
161
|
+
};
|
|
162
|
+
backgroundColor: {
|
|
163
|
+
default: "default";
|
|
164
|
+
};
|
|
165
|
+
textColor: {
|
|
166
|
+
default: "default";
|
|
167
|
+
};
|
|
168
|
+
textAlignment: {
|
|
169
|
+
default: "left";
|
|
170
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
175
|
+
type: "heading";
|
|
176
|
+
content: "inline";
|
|
177
|
+
propSchema: {
|
|
178
|
+
level: {
|
|
179
|
+
default: number;
|
|
180
|
+
values: readonly [1, 2, 3];
|
|
181
|
+
};
|
|
182
|
+
backgroundColor: {
|
|
183
|
+
default: "default";
|
|
184
|
+
};
|
|
185
|
+
textColor: {
|
|
186
|
+
default: "default";
|
|
187
|
+
};
|
|
188
|
+
textAlignment: {
|
|
189
|
+
default: "left";
|
|
190
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
194
|
+
};
|
|
195
|
+
bulletListItem: {
|
|
196
|
+
config: {
|
|
197
|
+
type: "bulletListItem";
|
|
198
|
+
content: "inline";
|
|
199
|
+
propSchema: {
|
|
200
|
+
backgroundColor: {
|
|
201
|
+
default: "default";
|
|
202
|
+
};
|
|
203
|
+
textColor: {
|
|
204
|
+
default: "default";
|
|
205
|
+
};
|
|
206
|
+
textAlignment: {
|
|
207
|
+
default: "left";
|
|
208
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
213
|
+
type: "bulletListItem";
|
|
214
|
+
content: "inline";
|
|
215
|
+
propSchema: {
|
|
216
|
+
backgroundColor: {
|
|
217
|
+
default: "default";
|
|
218
|
+
};
|
|
219
|
+
textColor: {
|
|
220
|
+
default: "default";
|
|
221
|
+
};
|
|
222
|
+
textAlignment: {
|
|
223
|
+
default: "left";
|
|
224
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
228
|
+
};
|
|
229
|
+
numberedListItem: {
|
|
230
|
+
config: {
|
|
231
|
+
type: "numberedListItem";
|
|
232
|
+
content: "inline";
|
|
233
|
+
propSchema: {
|
|
234
|
+
backgroundColor: {
|
|
235
|
+
default: "default";
|
|
236
|
+
};
|
|
237
|
+
textColor: {
|
|
238
|
+
default: "default";
|
|
239
|
+
};
|
|
240
|
+
textAlignment: {
|
|
241
|
+
default: "left";
|
|
242
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
247
|
+
type: "numberedListItem";
|
|
248
|
+
content: "inline";
|
|
249
|
+
propSchema: {
|
|
250
|
+
backgroundColor: {
|
|
251
|
+
default: "default";
|
|
252
|
+
};
|
|
253
|
+
textColor: {
|
|
254
|
+
default: "default";
|
|
255
|
+
};
|
|
256
|
+
textAlignment: {
|
|
257
|
+
default: "left";
|
|
258
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
262
|
+
};
|
|
263
|
+
image: {
|
|
264
|
+
config: {
|
|
265
|
+
type: "image";
|
|
266
|
+
propSchema: {
|
|
267
|
+
textAlignment: {
|
|
268
|
+
default: "left";
|
|
269
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
270
|
+
};
|
|
271
|
+
backgroundColor: {
|
|
272
|
+
default: "default";
|
|
273
|
+
};
|
|
274
|
+
url: {
|
|
275
|
+
default: "";
|
|
276
|
+
};
|
|
277
|
+
caption: {
|
|
278
|
+
default: "";
|
|
279
|
+
};
|
|
280
|
+
width: {
|
|
281
|
+
default: 512;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
content: "none";
|
|
285
|
+
};
|
|
286
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
287
|
+
type: "image";
|
|
288
|
+
propSchema: {
|
|
289
|
+
textAlignment: {
|
|
290
|
+
default: "left";
|
|
291
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
292
|
+
};
|
|
293
|
+
backgroundColor: {
|
|
294
|
+
default: "default";
|
|
295
|
+
};
|
|
296
|
+
url: {
|
|
297
|
+
default: "";
|
|
298
|
+
};
|
|
299
|
+
caption: {
|
|
300
|
+
default: "";
|
|
301
|
+
};
|
|
302
|
+
width: {
|
|
303
|
+
default: 512;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
content: "none";
|
|
307
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
308
|
+
};
|
|
309
|
+
table: {
|
|
310
|
+
config: {
|
|
311
|
+
type: "table";
|
|
312
|
+
content: "table";
|
|
313
|
+
propSchema: {
|
|
314
|
+
backgroundColor: {
|
|
315
|
+
default: "default";
|
|
316
|
+
};
|
|
317
|
+
textColor: {
|
|
318
|
+
default: "default";
|
|
319
|
+
};
|
|
320
|
+
textAlignment: {
|
|
321
|
+
default: "left";
|
|
322
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
implementation: import("../../../extensions/Blocks/api/blocks/types").TiptapBlockImplementation<{
|
|
327
|
+
type: "table";
|
|
328
|
+
content: "table";
|
|
329
|
+
propSchema: {
|
|
330
|
+
backgroundColor: {
|
|
331
|
+
default: "default";
|
|
332
|
+
};
|
|
333
|
+
textColor: {
|
|
334
|
+
default: "default";
|
|
335
|
+
};
|
|
336
|
+
textAlignment: {
|
|
337
|
+
default: "left";
|
|
338
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
}, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
export declare const customBlocksTestCases: EditorTestCases<BlockSchemaFromSpecs<typeof customSpecs>, DefaultInlineContentSchema, DefaultStyleSchema>;
|
|
345
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EditorTestCases } from "..";
|
|
2
|
+
import { DefaultBlockSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
3
|
+
import { InlineContentSchemaFromSpecs } from "../../../extensions/Blocks/api/inlineContent/types";
|
|
4
|
+
declare const customInlineContent: {
|
|
5
|
+
mention: import("../../../extensions/Blocks/api/inlineContent/types").InlineContentSpec<{
|
|
6
|
+
type: "mention";
|
|
7
|
+
propSchema: {
|
|
8
|
+
user: {
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
content: "none";
|
|
13
|
+
}>;
|
|
14
|
+
tag: import("../../../extensions/Blocks/api/inlineContent/types").InlineContentSpec<{
|
|
15
|
+
type: "tag";
|
|
16
|
+
propSchema: {};
|
|
17
|
+
content: "styled";
|
|
18
|
+
}>;
|
|
19
|
+
text: {
|
|
20
|
+
config: "text";
|
|
21
|
+
implementation: any;
|
|
22
|
+
};
|
|
23
|
+
link: {
|
|
24
|
+
config: "link";
|
|
25
|
+
implementation: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const customInlineContentTestCases: EditorTestCases<DefaultBlockSchema, InlineContentSchemaFromSpecs<typeof customInlineContent>, DefaultStyleSchema>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EditorTestCases } from "..";
|
|
2
|
+
import { DefaultBlockSchema, DefaultInlineContentSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
3
|
+
import { StyleSchemaFromSpecs } from "../../../extensions/Blocks/api/styles/types";
|
|
4
|
+
declare const customStyles: {
|
|
5
|
+
small: import("../../../extensions/Blocks/api/styles/types").StyleSpec<{
|
|
6
|
+
type: string;
|
|
7
|
+
propSchema: "boolean";
|
|
8
|
+
}>;
|
|
9
|
+
fontSize: import("../../../extensions/Blocks/api/styles/types").StyleSpec<{
|
|
10
|
+
type: string;
|
|
11
|
+
propSchema: "string";
|
|
12
|
+
}>;
|
|
13
|
+
bold: {
|
|
14
|
+
config: {
|
|
15
|
+
type: string;
|
|
16
|
+
propSchema: "boolean";
|
|
17
|
+
};
|
|
18
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
19
|
+
};
|
|
20
|
+
italic: {
|
|
21
|
+
config: {
|
|
22
|
+
type: string;
|
|
23
|
+
propSchema: "boolean";
|
|
24
|
+
};
|
|
25
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
26
|
+
};
|
|
27
|
+
underline: {
|
|
28
|
+
config: {
|
|
29
|
+
type: string;
|
|
30
|
+
propSchema: "boolean";
|
|
31
|
+
};
|
|
32
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
33
|
+
};
|
|
34
|
+
strike: {
|
|
35
|
+
config: {
|
|
36
|
+
type: string;
|
|
37
|
+
propSchema: "boolean";
|
|
38
|
+
};
|
|
39
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
40
|
+
};
|
|
41
|
+
code: {
|
|
42
|
+
config: {
|
|
43
|
+
type: string;
|
|
44
|
+
propSchema: "boolean";
|
|
45
|
+
};
|
|
46
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
47
|
+
};
|
|
48
|
+
textColor: {
|
|
49
|
+
config: {
|
|
50
|
+
type: string;
|
|
51
|
+
propSchema: "string";
|
|
52
|
+
};
|
|
53
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
54
|
+
};
|
|
55
|
+
backgroundColor: {
|
|
56
|
+
config: {
|
|
57
|
+
type: string;
|
|
58
|
+
propSchema: "string";
|
|
59
|
+
};
|
|
60
|
+
implementation: import("../../../extensions/Blocks/api/styles/types").StyleImplementation;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const customStylesTestCases: EditorTestCases<DefaultBlockSchema, DefaultInlineContentSchema, StyleSchemaFromSpecs<typeof customStyles>>;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EditorTestCases } from "..";
|
|
2
|
+
import { DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema } from "../../../extensions/Blocks/api/defaultBlocks";
|
|
3
|
+
export declare const defaultSchemaTestCases: EditorTestCases<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../BlockNoteEditor";
|
|
2
|
+
import { BlockSchema, PartialBlock } from "../../extensions/Blocks/api/blocks/types";
|
|
3
|
+
import { InlineContentSchema } from "../../extensions/Blocks/api/inlineContent/types";
|
|
4
|
+
import { StyleSchema } from "../../extensions/Blocks/api/styles/types";
|
|
5
|
+
export type EditorTestCases<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
6
|
+
name: string;
|
|
7
|
+
createEditor: () => BlockNoteEditor<B, I, S>;
|
|
8
|
+
documents: Array<{
|
|
9
|
+
name: string;
|
|
10
|
+
blocks: PartialBlock<B, I, S>[];
|
|
11
|
+
}>;
|
|
12
|
+
};
|