@blocknote/core 0.9.6 → 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 +3697 -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 +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 -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} +364 -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} +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 +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/BlockNoteEditor.d.ts +49 -36
- 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 +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/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,4 +1,4 @@
|
|
|
1
|
-
import { Props } from "./
|
|
1
|
+
import { Props } from "./blocks/types";
|
|
2
2
|
export declare const defaultProps: {
|
|
3
3
|
backgroundColor: {
|
|
4
4
|
default: "default";
|
|
@@ -12,3 +12,4 @@ export declare const defaultProps: {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export type DefaultProps = Props<typeof defaultProps>;
|
|
15
|
+
export declare const inheritedProps: string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ParseRule } from "@tiptap/pm/model";
|
|
2
|
+
import { StyleSchema } from "../styles/types";
|
|
3
|
+
import { CustomInlineContentConfig, InlineContentConfig, InlineContentFromConfig, InlineContentSpec } from "./types";
|
|
4
|
+
export type CustomInlineContentImplementation<T extends InlineContentConfig, S extends StyleSchema> = {
|
|
5
|
+
render: (
|
|
6
|
+
/**
|
|
7
|
+
* The custom inline content to render
|
|
8
|
+
*/
|
|
9
|
+
inlineContent: InlineContentFromConfig<T, S>
|
|
10
|
+
/**
|
|
11
|
+
* The BlockNote editor instance
|
|
12
|
+
* This is typed generically. If you want an editor with your custom schema, you need to
|
|
13
|
+
* cast it manually, e.g.: `const e = editor as BlockNoteEditor<typeof mySchema>;`
|
|
14
|
+
*/
|
|
15
|
+
) => {
|
|
16
|
+
dom: HTMLElement;
|
|
17
|
+
contentDOM?: HTMLElement;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function getInlineContentParseRules(config: CustomInlineContentConfig): ParseRule[];
|
|
21
|
+
export declare function createInlineContentSpec<T extends CustomInlineContentConfig, S extends StyleSchema>(inlineContentConfig: T, inlineContentImplementation: CustomInlineContentImplementation<T, S>): InlineContentSpec<T>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import { Props, PropSchema } from "../blocks/types";
|
|
3
|
+
import { InlineContentConfig, InlineContentImplementation, InlineContentSchemaFromSpecs, InlineContentSpecs } from "./types";
|
|
4
|
+
export declare function addInlineContentAttributes<IType extends string, PSchema extends PropSchema>(element: {
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
contentDOM?: HTMLElement;
|
|
7
|
+
}, inlineContentType: IType, inlineContentProps: Props<PSchema>, propSchema: PSchema): {
|
|
8
|
+
dom: HTMLElement;
|
|
9
|
+
contentDOM?: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
export declare function createInternalInlineContentSpec<T extends InlineContentConfig>(config: T, implementation: InlineContentImplementation<T>): {
|
|
12
|
+
config: T;
|
|
13
|
+
implementation: InlineContentImplementation<T>;
|
|
14
|
+
};
|
|
15
|
+
export declare function createInlineContentSpecFromTipTapNode<T extends Node, P extends PropSchema>(node: T, propSchema: P): {
|
|
16
|
+
config: {
|
|
17
|
+
type: T["name"];
|
|
18
|
+
propSchema: P;
|
|
19
|
+
content: "styled" | "none";
|
|
20
|
+
};
|
|
21
|
+
implementation: {
|
|
22
|
+
node: Node<any, any>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare function getInlineContentSchemaFromSpecs<T extends InlineContentSpecs>(specs: T): InlineContentSchemaFromSpecs<T>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
import { PropSchema, Props } from "../blocks/types";
|
|
3
|
+
import { StyleSchema, Styles } from "../styles/types";
|
|
4
|
+
export type CustomInlineContentConfig = {
|
|
5
|
+
type: string;
|
|
6
|
+
content: "styled" | "none";
|
|
7
|
+
readonly propSchema: PropSchema;
|
|
8
|
+
};
|
|
9
|
+
export type InlineContentConfig = CustomInlineContentConfig | "text" | "link";
|
|
10
|
+
export type InlineContentImplementation<T extends InlineContentConfig> = T extends "link" | "text" ? undefined : {
|
|
11
|
+
node: Node;
|
|
12
|
+
};
|
|
13
|
+
export type InlineContentSpec<T extends InlineContentConfig> = {
|
|
14
|
+
config: T;
|
|
15
|
+
implementation: InlineContentImplementation<T>;
|
|
16
|
+
};
|
|
17
|
+
export type InlineContentSchema = Record<string, InlineContentConfig>;
|
|
18
|
+
export type InlineContentSpecs = {
|
|
19
|
+
text: {
|
|
20
|
+
config: "text";
|
|
21
|
+
implementation: undefined;
|
|
22
|
+
};
|
|
23
|
+
link: {
|
|
24
|
+
config: "link";
|
|
25
|
+
implementation: undefined;
|
|
26
|
+
};
|
|
27
|
+
} & Record<string, InlineContentSpec<InlineContentConfig>>;
|
|
28
|
+
export type InlineContentSchemaFromSpecs<T extends InlineContentSpecs> = {
|
|
29
|
+
[K in keyof T]: T[K]["config"];
|
|
30
|
+
};
|
|
31
|
+
export type CustomInlineContentFromConfig<I extends CustomInlineContentConfig, S extends StyleSchema> = {
|
|
32
|
+
type: I["type"];
|
|
33
|
+
props: Props<I["propSchema"]>;
|
|
34
|
+
content: I["content"] extends "styled" ? StyledText<S>[] : I["content"] extends "plain" ? string : I["content"] extends "none" ? undefined : never;
|
|
35
|
+
};
|
|
36
|
+
export type InlineContentFromConfig<I extends InlineContentConfig, S extends StyleSchema> = I extends "text" ? StyledText<S> : I extends "link" ? Link<S> : I extends CustomInlineContentConfig ? CustomInlineContentFromConfig<I, S> : never;
|
|
37
|
+
export type PartialCustomInlineContentFromConfig<I extends CustomInlineContentConfig, S extends StyleSchema> = {
|
|
38
|
+
type: I["type"];
|
|
39
|
+
props?: Props<I["propSchema"]>;
|
|
40
|
+
content: I["content"] extends "styled" ? StyledText<S>[] | string : I["content"] extends "plain" ? string : I["content"] extends "none" ? undefined : never;
|
|
41
|
+
};
|
|
42
|
+
export type PartialInlineContentFromConfig<I extends InlineContentConfig, S extends StyleSchema> = I extends "text" ? string | StyledText<S> : I extends "link" ? PartialLink<S> : I extends CustomInlineContentConfig ? PartialCustomInlineContentFromConfig<I, S> : never;
|
|
43
|
+
export type StyledText<T extends StyleSchema> = {
|
|
44
|
+
type: "text";
|
|
45
|
+
text: string;
|
|
46
|
+
styles: Styles<T>;
|
|
47
|
+
};
|
|
48
|
+
export type Link<T extends StyleSchema> = {
|
|
49
|
+
type: "link";
|
|
50
|
+
href: string;
|
|
51
|
+
content: StyledText<T>[];
|
|
52
|
+
};
|
|
53
|
+
export type PartialLink<T extends StyleSchema> = Omit<Link<T>, "content"> & {
|
|
54
|
+
content: string | Link<T>["content"];
|
|
55
|
+
};
|
|
56
|
+
export type InlineContent<I extends InlineContentSchema, T extends StyleSchema> = InlineContentFromConfig<I[keyof I], T>;
|
|
57
|
+
type PartialInlineContentElement<I extends InlineContentSchema, T extends StyleSchema> = PartialInlineContentFromConfig<I[keyof I], T>;
|
|
58
|
+
export type PartialInlineContent<I extends InlineContentSchema, T extends StyleSchema> = PartialInlineContentElement<I, T>[] | string;
|
|
59
|
+
export declare function isLinkInlineContent<T extends StyleSchema>(content: InlineContent<any, T>): content is Link<T>;
|
|
60
|
+
export declare function isPartialLinkInlineContent<T extends StyleSchema>(content: PartialInlineContentElement<any, T>): content is PartialLink<T>;
|
|
61
|
+
export declare function isStyledTextInlineContent<T extends StyleSchema>(content: PartialInlineContentElement<any, T>): content is StyledText<T>;
|
|
62
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Block, BlockSchema } from "./
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Block, BlockSchema } from "./blocks/types";
|
|
2
|
+
import { InlineContentSchema } from "./inlineContent/types";
|
|
3
|
+
import { StyleSchema } from "./styles/types";
|
|
4
|
+
export type Selection<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> = {
|
|
5
|
+
blocks: Block<BSchema, I, S>[];
|
|
4
6
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ParseRule } from "@tiptap/pm/model";
|
|
2
|
+
import { StyleConfig, StyleSpec } from "./types";
|
|
3
|
+
export type CustomStyleImplementation<T extends StyleConfig> = {
|
|
4
|
+
render: T["propSchema"] extends "boolean" ? () => {
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
contentDOM?: HTMLElement;
|
|
7
|
+
} : (value: string) => {
|
|
8
|
+
dom: HTMLElement;
|
|
9
|
+
contentDOM?: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function getStyleParseRules(config: StyleConfig): ParseRule[];
|
|
13
|
+
export declare function createStyleSpec<T extends StyleConfig>(styleConfig: T, styleImplementation: CustomStyleImplementation<T>): StyleSpec<T>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Attributes, Mark } from "@tiptap/core";
|
|
2
|
+
import { StyleConfig, StyleImplementation, StylePropSchema, StyleSchemaFromSpecs, StyleSpecs } from "./types";
|
|
3
|
+
export declare function stylePropsToAttributes(propSchema: StylePropSchema): Attributes;
|
|
4
|
+
export declare function addStyleAttributes<SType extends string, PSchema extends StylePropSchema>(element: {
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
contentDOM?: HTMLElement;
|
|
7
|
+
}, styleType: SType, styleValue: PSchema extends "boolean" ? undefined : string, propSchema: PSchema): {
|
|
8
|
+
dom: HTMLElement;
|
|
9
|
+
contentDOM?: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
export declare function createInternalStyleSpec<T extends StyleConfig>(config: T, implementation: StyleImplementation): {
|
|
12
|
+
config: T;
|
|
13
|
+
implementation: StyleImplementation;
|
|
14
|
+
};
|
|
15
|
+
export declare function createStyleSpecFromTipTapMark<T extends Mark, P extends StylePropSchema>(mark: T, propSchema: P): {
|
|
16
|
+
config: {
|
|
17
|
+
type: T["name"];
|
|
18
|
+
propSchema: P;
|
|
19
|
+
};
|
|
20
|
+
implementation: StyleImplementation;
|
|
21
|
+
};
|
|
22
|
+
export declare function getStyleSchemaFromSpecs<T extends StyleSpecs>(specs: T): StyleSchemaFromSpecs<T>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Mark } from "@tiptap/core";
|
|
2
|
+
export type StylePropSchema = "boolean" | "string";
|
|
3
|
+
export type StyleConfig = {
|
|
4
|
+
type: string;
|
|
5
|
+
readonly propSchema: StylePropSchema;
|
|
6
|
+
};
|
|
7
|
+
export type StyleImplementation = {
|
|
8
|
+
mark: Mark;
|
|
9
|
+
};
|
|
10
|
+
export type StyleSpec<T extends StyleConfig> = {
|
|
11
|
+
config: T;
|
|
12
|
+
implementation: StyleImplementation;
|
|
13
|
+
};
|
|
14
|
+
export type StyleSchema = Record<string, StyleConfig>;
|
|
15
|
+
export type StyleSpecs = Record<string, StyleSpec<StyleConfig>>;
|
|
16
|
+
export type StyleSchemaFromSpecs<T extends StyleSpecs> = {
|
|
17
|
+
[K in keyof T]: T[K]["config"];
|
|
18
|
+
};
|
|
19
|
+
export type Styles<T extends StyleSchema> = {
|
|
20
|
+
[K in keyof T]?: T[K]["propSchema"] extends "boolean" ? boolean : T[K]["propSchema"] extends "string" ? string : never;
|
|
21
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Node } from "@tiptap/core";
|
|
2
|
-
import {
|
|
2
|
+
import { BlockNoteEditor } from "../../../BlockNoteEditor";
|
|
3
|
+
import { BlockSchema, PartialBlock } from "../api/blocks/types";
|
|
4
|
+
import { InlineContentSchema } from "../api/inlineContent/types";
|
|
5
|
+
import { StyleSchema } from "../api/styles/types";
|
|
3
6
|
declare module "@tiptap/core" {
|
|
4
7
|
interface Commands<ReturnType> {
|
|
5
8
|
block: {
|
|
@@ -7,8 +10,8 @@ declare module "@tiptap/core" {
|
|
|
7
10
|
BNDeleteBlock: (posInBlock: number) => ReturnType;
|
|
8
11
|
BNMergeBlocks: (posBetweenBlocks: number) => ReturnType;
|
|
9
12
|
BNSplitBlock: (posInBlock: number, keepType: boolean) => ReturnType;
|
|
10
|
-
BNUpdateBlock: <BSchema extends BlockSchema>(posInBlock: number, block: PartialBlock<BSchema>) => ReturnType;
|
|
11
|
-
BNCreateOrUpdateBlock: <BSchema extends BlockSchema>(posInBlock: number, block: PartialBlock<BSchema>) => ReturnType;
|
|
13
|
+
BNUpdateBlock: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(posInBlock: number, block: PartialBlock<BSchema, I, S>) => ReturnType;
|
|
14
|
+
BNCreateOrUpdateBlock: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(posInBlock: number, block: PartialBlock<BSchema, I, S>) => ReturnType;
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
17
|
}
|
|
@@ -17,10 +20,11 @@ declare module "@tiptap/core" {
|
|
|
17
20
|
*/
|
|
18
21
|
export declare const BlockContainer: Node<{
|
|
19
22
|
domAttributes?: Partial<{
|
|
23
|
+
editor: Record<string, string>;
|
|
20
24
|
blockContainer: Record<string, string>;
|
|
21
25
|
blockGroup: Record<string, string>;
|
|
22
|
-
editor: Record<string, string>;
|
|
23
26
|
blockContent: Record<string, string>;
|
|
24
27
|
inlineContent: Record<string, string>;
|
|
25
28
|
}> | undefined;
|
|
29
|
+
editor: BlockNoteEditor<BlockSchema, InlineContentSchema, StyleSchema>;
|
|
26
30
|
}, any>;
|
package/types/src/extensions/Blocks/nodes/BlockContent/HeadingBlockContent/HeadingBlockContent.d.ts
CHANGED
|
@@ -15,29 +15,44 @@ export declare const headingPropSchema: {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
export declare const Heading: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
default: "default";
|
|
37
|
-
};
|
|
38
|
-
textAlignment: {
|
|
39
|
-
default: "left";
|
|
40
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
18
|
+
config: {
|
|
19
|
+
type: "heading";
|
|
20
|
+
content: "inline";
|
|
21
|
+
propSchema: {
|
|
22
|
+
level: {
|
|
23
|
+
default: number;
|
|
24
|
+
values: readonly [1, 2, 3];
|
|
25
|
+
};
|
|
26
|
+
backgroundColor: {
|
|
27
|
+
default: "default";
|
|
28
|
+
};
|
|
29
|
+
textColor: {
|
|
30
|
+
default: "default";
|
|
31
|
+
};
|
|
32
|
+
textAlignment: {
|
|
33
|
+
default: "left";
|
|
34
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
35
|
+
};
|
|
41
36
|
};
|
|
42
37
|
};
|
|
38
|
+
implementation: import("../../../api/blocks/types").TiptapBlockImplementation<{
|
|
39
|
+
type: "heading";
|
|
40
|
+
content: "inline";
|
|
41
|
+
propSchema: {
|
|
42
|
+
level: {
|
|
43
|
+
default: number;
|
|
44
|
+
values: readonly [1, 2, 3];
|
|
45
|
+
};
|
|
46
|
+
backgroundColor: {
|
|
47
|
+
default: "default";
|
|
48
|
+
};
|
|
49
|
+
textColor: {
|
|
50
|
+
default: "default";
|
|
51
|
+
};
|
|
52
|
+
textAlignment: {
|
|
53
|
+
default: "left";
|
|
54
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}, any, import("../../../../..").InlineContentSchema, import("../../../../..").StyleSchema>;
|
|
43
58
|
};
|
package/types/src/extensions/Blocks/nodes/BlockContent/ImageBlockContent/ImageBlockContent.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNoteEditor } from "../../../../../BlockNoteEditor";
|
|
2
|
+
import { BlockFromConfig, BlockSchemaWithBlock } from "../../../api/blocks/types";
|
|
3
|
+
import { InlineContentSchema } from "../../../api/inlineContent/types";
|
|
4
|
+
import { StyleSchema } from "../../../api/styles/types";
|
|
2
5
|
export declare const imagePropSchema: {
|
|
3
6
|
textAlignment: {
|
|
4
7
|
default: "left";
|
|
@@ -17,21 +20,76 @@ export declare const imagePropSchema: {
|
|
|
17
20
|
default: 512;
|
|
18
21
|
};
|
|
19
22
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
declare const blockConfig: {
|
|
24
|
+
type: "image";
|
|
25
|
+
propSchema: {
|
|
26
|
+
textAlignment: {
|
|
27
|
+
default: "left";
|
|
28
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
29
|
+
};
|
|
30
|
+
backgroundColor: {
|
|
31
|
+
default: "default";
|
|
32
|
+
};
|
|
33
|
+
url: {
|
|
34
|
+
default: "";
|
|
35
|
+
};
|
|
36
|
+
caption: {
|
|
37
|
+
default: "";
|
|
38
|
+
};
|
|
39
|
+
width: {
|
|
40
|
+
default: 512;
|
|
41
|
+
};
|
|
30
42
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
content: "none";
|
|
44
|
+
};
|
|
45
|
+
export declare const renderImage: (block: BlockFromConfig<typeof blockConfig, InlineContentSchema, StyleSchema>, editor: BlockNoteEditor<BlockSchemaWithBlock<"image", typeof blockConfig>>) => {
|
|
46
|
+
dom: HTMLDivElement;
|
|
47
|
+
destroy: () => void;
|
|
48
|
+
};
|
|
49
|
+
export declare const Image: {
|
|
50
|
+
config: {
|
|
51
|
+
type: "image";
|
|
52
|
+
propSchema: {
|
|
53
|
+
textAlignment: {
|
|
54
|
+
default: "left";
|
|
55
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
56
|
+
};
|
|
57
|
+
backgroundColor: {
|
|
58
|
+
default: "default";
|
|
59
|
+
};
|
|
60
|
+
url: {
|
|
61
|
+
default: "";
|
|
62
|
+
};
|
|
63
|
+
caption: {
|
|
64
|
+
default: "";
|
|
65
|
+
};
|
|
66
|
+
width: {
|
|
67
|
+
default: 512;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
content: "none";
|
|
36
71
|
};
|
|
37
|
-
|
|
72
|
+
implementation: import("../../../api/blocks/types").TiptapBlockImplementation<{
|
|
73
|
+
type: "image";
|
|
74
|
+
propSchema: {
|
|
75
|
+
textAlignment: {
|
|
76
|
+
default: "left";
|
|
77
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
78
|
+
};
|
|
79
|
+
backgroundColor: {
|
|
80
|
+
default: "default";
|
|
81
|
+
};
|
|
82
|
+
url: {
|
|
83
|
+
default: "";
|
|
84
|
+
};
|
|
85
|
+
caption: {
|
|
86
|
+
default: "";
|
|
87
|
+
};
|
|
88
|
+
width: {
|
|
89
|
+
default: 512;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
content: "none";
|
|
93
|
+
}, any, InlineContentSchema, StyleSchema>;
|
|
94
|
+
};
|
|
95
|
+
export {};
|
|
@@ -11,25 +11,36 @@ export declare const bulletListItemPropSchema: {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export declare const BulletListItem: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
default: "default";
|
|
29
|
-
};
|
|
30
|
-
textAlignment: {
|
|
31
|
-
default: "left";
|
|
32
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
14
|
+
config: {
|
|
15
|
+
type: "bulletListItem";
|
|
16
|
+
content: "inline";
|
|
17
|
+
propSchema: {
|
|
18
|
+
backgroundColor: {
|
|
19
|
+
default: "default";
|
|
20
|
+
};
|
|
21
|
+
textColor: {
|
|
22
|
+
default: "default";
|
|
23
|
+
};
|
|
24
|
+
textAlignment: {
|
|
25
|
+
default: "left";
|
|
26
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
27
|
+
};
|
|
33
28
|
};
|
|
34
29
|
};
|
|
30
|
+
implementation: import("../../../../api/blocks/types").TiptapBlockImplementation<{
|
|
31
|
+
type: "bulletListItem";
|
|
32
|
+
content: "inline";
|
|
33
|
+
propSchema: {
|
|
34
|
+
backgroundColor: {
|
|
35
|
+
default: "default";
|
|
36
|
+
};
|
|
37
|
+
textColor: {
|
|
38
|
+
default: "default";
|
|
39
|
+
};
|
|
40
|
+
textAlignment: {
|
|
41
|
+
default: "left";
|
|
42
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, any, import("../../../../../..").InlineContentSchema, import("../../../../../..").StyleSchema>;
|
|
35
46
|
};
|
|
@@ -11,25 +11,36 @@ export declare const numberedListItemPropSchema: {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export declare const NumberedListItem: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
default: "default";
|
|
29
|
-
};
|
|
30
|
-
textAlignment: {
|
|
31
|
-
default: "left";
|
|
32
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
14
|
+
config: {
|
|
15
|
+
type: "numberedListItem";
|
|
16
|
+
content: "inline";
|
|
17
|
+
propSchema: {
|
|
18
|
+
backgroundColor: {
|
|
19
|
+
default: "default";
|
|
20
|
+
};
|
|
21
|
+
textColor: {
|
|
22
|
+
default: "default";
|
|
23
|
+
};
|
|
24
|
+
textAlignment: {
|
|
25
|
+
default: "left";
|
|
26
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
27
|
+
};
|
|
33
28
|
};
|
|
34
29
|
};
|
|
30
|
+
implementation: import("../../../../api/blocks/types").TiptapBlockImplementation<{
|
|
31
|
+
type: "numberedListItem";
|
|
32
|
+
content: "inline";
|
|
33
|
+
propSchema: {
|
|
34
|
+
backgroundColor: {
|
|
35
|
+
default: "default";
|
|
36
|
+
};
|
|
37
|
+
textColor: {
|
|
38
|
+
default: "default";
|
|
39
|
+
};
|
|
40
|
+
textAlignment: {
|
|
41
|
+
default: "left";
|
|
42
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, any, import("../../../../../..").InlineContentSchema, import("../../../../../..").StyleSchema>;
|
|
35
46
|
};
|
|
@@ -10,35 +10,43 @@ export declare const paragraphPropSchema: {
|
|
|
10
10
|
values: readonly ["left", "center", "right", "justify"];
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
export declare const ParagraphBlockContent: import("
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
inlineContent: Record<string, string>;
|
|
20
|
-
}> | undefined;
|
|
21
|
-
}, any>;
|
|
13
|
+
export declare const ParagraphBlockContent: import("@tiptap/core").Node<any, any> & {
|
|
14
|
+
name: "paragraph";
|
|
15
|
+
config: {
|
|
16
|
+
content: "inline*";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
22
19
|
export declare const Paragraph: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
default: "default";
|
|
38
|
-
};
|
|
39
|
-
textAlignment: {
|
|
40
|
-
default: "left";
|
|
41
|
-
values: readonly ["left", "center", "right", "justify"];
|
|
20
|
+
config: {
|
|
21
|
+
type: "paragraph";
|
|
22
|
+
content: "inline";
|
|
23
|
+
propSchema: {
|
|
24
|
+
backgroundColor: {
|
|
25
|
+
default: "default";
|
|
26
|
+
};
|
|
27
|
+
textColor: {
|
|
28
|
+
default: "default";
|
|
29
|
+
};
|
|
30
|
+
textAlignment: {
|
|
31
|
+
default: "left";
|
|
32
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
33
|
+
};
|
|
42
34
|
};
|
|
43
35
|
};
|
|
36
|
+
implementation: import("../../../../..").TiptapBlockImplementation<{
|
|
37
|
+
type: "paragraph";
|
|
38
|
+
content: "inline";
|
|
39
|
+
propSchema: {
|
|
40
|
+
backgroundColor: {
|
|
41
|
+
default: "default";
|
|
42
|
+
};
|
|
43
|
+
textColor: {
|
|
44
|
+
default: "default";
|
|
45
|
+
};
|
|
46
|
+
textAlignment: {
|
|
47
|
+
default: "left";
|
|
48
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}, any, import("../../../../..").InlineContentSchema, import("../../../../..").StyleSchema>;
|
|
44
52
|
};
|
package/types/src/extensions/Blocks/nodes/BlockContent/TableBlockContent/TableBlockContent.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
export declare const tablePropSchema: {
|
|
3
|
+
backgroundColor: {
|
|
4
|
+
default: "default";
|
|
5
|
+
};
|
|
6
|
+
textColor: {
|
|
7
|
+
default: "default";
|
|
8
|
+
};
|
|
9
|
+
textAlignment: {
|
|
10
|
+
default: "left";
|
|
11
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const TableBlockContent: Node<any, any> & {
|
|
15
|
+
name: "table";
|
|
16
|
+
config: {
|
|
17
|
+
content: "tableRow+";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const Table: {
|
|
21
|
+
config: {
|
|
22
|
+
type: "table";
|
|
23
|
+
content: "table";
|
|
24
|
+
propSchema: {
|
|
25
|
+
backgroundColor: {
|
|
26
|
+
default: "default";
|
|
27
|
+
};
|
|
28
|
+
textColor: {
|
|
29
|
+
default: "default";
|
|
30
|
+
};
|
|
31
|
+
textAlignment: {
|
|
32
|
+
default: "left";
|
|
33
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
implementation: import("../../../../..").TiptapBlockImplementation<{
|
|
38
|
+
type: "table";
|
|
39
|
+
content: "table";
|
|
40
|
+
propSchema: {
|
|
41
|
+
backgroundColor: {
|
|
42
|
+
default: "default";
|
|
43
|
+
};
|
|
44
|
+
textColor: {
|
|
45
|
+
default: "default";
|
|
46
|
+
};
|
|
47
|
+
textAlignment: {
|
|
48
|
+
default: "left";
|
|
49
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}, any, import("../../../../..").InlineContentSchema, import("../../../../..").StyleSchema>;
|
|
53
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../../../BlockNoteEditor";
|
|
2
|
+
import { Block } from "../../api/blocks/types";
|
|
3
|
+
import { InlineContentSchema } from "../../api/inlineContent/types";
|
|
4
|
+
import { StyleSchema } from "../../api/styles/types";
|
|
5
|
+
export declare function createDefaultBlockDOMOutputSpec(blockName: string, htmlTag: string, blockContentHTMLAttributes: Record<string, string>, inlineContentHTMLAttributes: Record<string, string>): {
|
|
6
|
+
dom: HTMLDivElement;
|
|
7
|
+
contentDOM: HTMLElement;
|
|
8
|
+
};
|
|
9
|
+
export declare const defaultBlockToHTML: <BSchema extends Record<string, import("../../api/blocks/types").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(block: Block<BSchema, I, S>, editor: BlockNoteEditor<BSchema, I, S>) => {
|
|
10
|
+
dom: HTMLElement;
|
|
11
|
+
contentDOM?: HTMLElement;
|
|
12
|
+
};
|