@blocknote/core 0.15.11 → 0.17.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 +3349 -2773
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +5 -2
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +3087 -0
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +132 -0
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +71 -0
- package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +2276 -0
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +131 -0
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +103 -0
- package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +3767 -0
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +192 -0
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +178 -0
- package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +1136 -0
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +34 -0
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +100 -0
- package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +4931 -0
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +222 -0
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +70 -0
- package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +2924 -0
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +136 -0
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +48 -0
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +8376 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +300 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +199 -0
- package/src/api/blockManipulation/insertContentAt.ts +96 -0
- package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +316 -0
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +53 -0
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +130 -0
- package/src/api/blockManipulation/setupTestEnv.ts +179 -0
- package/src/api/clipboard/__snapshots__/childToParent.html +1 -0
- package/src/api/clipboard/__snapshots__/childrenToNextParent.html +1 -0
- package/src/api/clipboard/__snapshots__/childrenToNextParentsChildren.html +1 -0
- package/src/api/clipboard/__snapshots__/image.html +1 -0
- package/src/api/clipboard/__snapshots__/multipleStyledText.html +1 -0
- package/src/api/clipboard/__snapshots__/nestedImage.html +1 -0
- package/src/api/clipboard/__snapshots__/partialChildToParent.html +1 -0
- package/src/api/clipboard/__snapshots__/styledText.html +1 -0
- package/src/api/clipboard/__snapshots__/tableAllCells.html +1 -0
- package/src/api/clipboard/__snapshots__/tableCell.html +1 -0
- package/src/api/clipboard/__snapshots__/tableCellText.html +1 -0
- package/src/api/clipboard/__snapshots__/tableRow.html +1 -0
- package/src/api/clipboard/__snapshots__/unstyledText.html +1 -0
- package/src/api/clipboard/clipboard.test.ts +283 -0
- package/src/api/{parsers → clipboard/fromClipboard}/fileDropExtension.ts +8 -4
- package/src/api/{parsers → clipboard/fromClipboard}/handleFileInsertion.ts +12 -7
- package/src/api/{parsers → clipboard/fromClipboard}/pasteExtension.ts +19 -8
- package/src/api/clipboard/toClipboard/copyExtension.ts +243 -0
- package/src/api/exporters/html/__snapshots__/complex/misc/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -1
- package/src/api/exporters/html/externalHTMLExporter.ts +42 -87
- package/src/api/exporters/html/htmlConversion.test.ts +19 -156
- package/src/api/exporters/html/internalHTMLSerializer.ts +21 -69
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +263 -0
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +158 -0
- package/src/api/exporters/markdown/markdownExporter.test.ts +10 -10
- package/src/api/exporters/markdown/markdownExporter.ts +11 -7
- package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +2 -2
- package/src/api/getBlockInfoFromPos.ts +172 -90
- package/src/api/nodeConversions/blockToNode.ts +257 -0
- package/src/api/nodeConversions/fragmentToBlocks.ts +60 -0
- package/src/api/nodeConversions/nodeConversions.test.ts +9 -8
- package/src/api/nodeConversions/{nodeConversions.ts → nodeToBlock.ts} +20 -262
- package/src/api/parsers/html/parseHTML.test.ts +5 -8
- package/src/api/parsers/html/parseHTML.ts +8 -4
- package/src/api/parsers/html/util/nestedLists.test.ts +2 -2
- package/src/api/parsers/markdown/__snapshots__/pasted/complex.json +319 -0
- package/src/api/parsers/markdown/__snapshots__/pasted/issue-226-1.json +81 -0
- package/src/api/parsers/{html/__snapshots__/paste/parse-deep-nested-content.json → markdown/__snapshots__/pasted/issue-226-2.json} +35 -110
- package/src/api/parsers/markdown/__snapshots__/pasted/nested.json +81 -0
- package/src/api/parsers/markdown/__snapshots__/pasted/non-nested.json +81 -0
- package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +61 -0
- package/src/api/parsers/markdown/parseMarkdown.test.ts +16 -1
- package/src/api/parsers/markdown/parseMarkdown.ts +8 -4
- package/src/api/testUtil/cases/customBlocks.ts +11 -11
- package/src/api/testUtil/cases/customInlineContent.ts +6 -6
- package/src/api/testUtil/cases/customStyles.ts +6 -6
- package/src/api/testUtil/cases/defaultSchema.ts +4 -4
- package/src/api/testUtil/index.ts +6 -6
- package/src/api/testUtil/partialBlockTestUtil.ts +5 -5
- package/src/api/testUtil/paste.ts +46 -0
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +5 -5
- package/src/blocks/FileBlockContent/FileBlockContent.ts +4 -4
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +2 -2
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +61 -39
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +5 -5
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +30 -18
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +67 -33
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +23 -19
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +22 -24
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +31 -19
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +16 -11
- package/src/blocks/TableBlockContent/TableBlockContent.ts +4 -5
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +5 -5
- package/src/blocks/defaultBlockHelpers.ts +4 -4
- package/src/blocks/defaultBlockTypeGuards.ts +5 -5
- package/src/blocks/defaultBlocks.ts +13 -13
- package/src/blocks/defaultProps.ts +1 -1
- package/src/editor/BlockNoteEditor.test.ts +14 -7
- package/src/editor/BlockNoteEditor.ts +82 -149
- package/src/editor/BlockNoteExtensions.ts +15 -11
- package/src/editor/BlockNoteSchema.ts +7 -7
- package/src/editor/BlockNoteTipTapEditor.ts +5 -3
- package/src/editor/cursorPositionTypes.ts +7 -2
- package/src/editor/selectionTypes.ts +6 -2
- package/src/editor/transformPasted.ts +34 -2
- package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +1 -1
- package/src/extensions/BackgroundColor/BackgroundColorMark.ts +1 -1
- package/src/extensions/FilePanel/FilePanelPlugin.ts +4 -4
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +8 -4
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +333 -0
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +9 -4
- package/src/extensions/{NonEditableBlocks/NonEditableBlockPlugin.ts → NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts} +2 -2
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +1 -1
- package/src/extensions/SideMenu/SideMenuPlugin.ts +72 -402
- package/src/extensions/SideMenu/dragging.ts +251 -0
- package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +1 -1
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +8 -4
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +8 -4
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +19 -15
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +11 -7
- package/src/extensions/TextColor/TextColorExtension.ts +1 -1
- package/src/extensions/TextColor/TextColorMark.ts +1 -1
- package/src/i18n/dictionary.ts +1 -1
- package/src/i18n/locales/ar.ts +1 -1
- package/src/i18n/locales/fr.ts +1 -1
- package/src/i18n/locales/hr.ts +308 -0
- package/src/i18n/locales/index.ts +15 -14
- package/src/i18n/locales/is.ts +1 -1
- package/src/i18n/locales/ja.ts +1 -1
- package/src/i18n/locales/ko.ts +1 -1
- package/src/i18n/locales/nl.ts +1 -1
- package/src/i18n/locales/pl.ts +1 -1
- package/src/i18n/locales/pt.ts +1 -1
- package/src/i18n/locales/ru.ts +1 -1
- package/src/i18n/locales/vi.ts +1 -1
- package/src/i18n/locales/zh.ts +1 -1
- package/src/index.ts +45 -44
- package/src/pm-nodes/BlockContainer.ts +3 -647
- package/src/pm-nodes/BlockGroup.ts +2 -2
- package/src/pm-nodes/index.ts +3 -3
- package/src/schema/blocks/createSpec.ts +24 -14
- package/src/schema/blocks/internal.ts +9 -9
- package/src/schema/blocks/types.ts +4 -4
- package/src/schema/index.ts +10 -10
- package/src/schema/inlineContent/createSpec.ts +9 -10
- package/src/schema/inlineContent/internal.ts +3 -3
- package/src/schema/inlineContent/types.ts +2 -2
- package/src/schema/styles/createSpec.ts +4 -3
- package/src/schema/styles/internal.ts +1 -1
- package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +4 -0
- package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +7 -0
- package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.d.ts +5 -0
- package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +7 -0
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +7 -0
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.d.ts +5 -0
- package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +11 -0
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.test.d.ts +1 -0
- package/types/src/api/blockManipulation/insertContentAt.d.ts +6 -0
- package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.d.ts +5 -0
- package/types/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.d.ts +1 -0
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +492 -0
- package/types/src/api/clipboard/clipboard.test.d.ts +1 -0
- package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +6 -0
- package/types/src/api/{parsers → clipboard/fromClipboard}/handleFileInsertion.d.ts +2 -2
- package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +6 -0
- package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +12 -0
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +7 -8
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +6 -10
- package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +10 -0
- package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +11 -0
- package/types/src/api/exporters/markdown/markdownExporter.d.ts +3 -3
- package/types/src/api/getBlockInfoFromPos.d.ts +63 -20
- package/types/src/api/nodeConversions/blockToNode.d.ts +15 -0
- package/types/src/api/nodeConversions/fragmentToBlocks.d.ts +7 -0
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +16 -0
- package/types/src/api/parsers/html/parseHTML.d.ts +2 -2
- package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -2
- package/types/src/api/testUtil/cases/customBlocks.d.ts +39 -39
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +35 -35
- package/types/src/api/testUtil/cases/customStyles.d.ts +35 -35
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +2 -2
- package/types/src/api/testUtil/index.d.ts +6 -6
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +4 -4
- package/types/src/api/testUtil/paste.d.ts +2 -0
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +4 -4
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +4 -4
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +2 -2
- package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +2 -2
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +4 -4
- package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +2 -2
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +2 -2
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +4 -4
- package/types/src/blocks/defaultBlockHelpers.d.ts +3 -3
- package/types/src/blocks/defaultBlockTypeGuards.d.ts +4 -4
- package/types/src/blocks/defaultBlocks.d.ts +38 -38
- package/types/src/blocks/defaultProps.d.ts +1 -1
- package/types/src/editor/BlockNoteEditor.d.ts +28 -16
- package/types/src/editor/BlockNoteExtensions.d.ts +3 -3
- package/types/src/editor/BlockNoteSchema.d.ts +4 -4
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
- package/types/src/editor/cursorPositionTypes.d.ts +3 -2
- package/types/src/editor/selectionTypes.d.ts +2 -2
- package/types/src/editor/transformPasted.d.ts +8 -1
- package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +1 -1
- package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +4 -4
- package/types/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.d.ts +5 -0
- package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +4 -4
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -0
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +1 -1
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +12 -28
- package/types/src/extensions/SideMenu/dragging.d.ts +17 -0
- package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +1 -1
- package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +4 -4
- package/types/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.d.ts +3 -3
- package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +4 -4
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +4 -4
- package/types/src/extensions/TextColor/TextColorMark.d.ts +1 -1
- package/types/src/i18n/dictionary.d.ts +1 -1
- package/types/src/i18n/locales/ar.d.ts +1 -1
- package/types/src/i18n/locales/fr.d.ts +1 -1
- package/types/src/i18n/locales/hr.d.ts +239 -0
- package/types/src/i18n/locales/index.d.ts +15 -14
- package/types/src/i18n/locales/is.d.ts +1 -1
- package/types/src/i18n/locales/ja.d.ts +1 -1
- package/types/src/i18n/locales/ko.d.ts +1 -1
- package/types/src/i18n/locales/nl.d.ts +1 -1
- package/types/src/i18n/locales/pl.d.ts +1 -1
- package/types/src/i18n/locales/pt.d.ts +1 -1
- package/types/src/i18n/locales/ru.d.ts +1 -1
- package/types/src/i18n/locales/vi.d.ts +1 -1
- package/types/src/i18n/locales/zh.d.ts +1 -1
- package/types/src/index.d.ts +45 -44
- package/types/src/pm-nodes/BlockContainer.d.ts +2 -16
- package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
- package/types/src/pm-nodes/index.d.ts +3 -3
- package/types/src/schema/blocks/createSpec.d.ts +5 -5
- package/types/src/schema/blocks/internal.d.ts +5 -5
- package/types/src/schema/blocks/types.d.ts +4 -4
- package/types/src/schema/index.d.ts +10 -10
- package/types/src/schema/inlineContent/createSpec.d.ts +3 -3
- package/types/src/schema/inlineContent/internal.d.ts +2 -2
- package/types/src/schema/inlineContent/types.d.ts +2 -2
- package/types/src/schema/styles/createSpec.d.ts +1 -1
- package/types/src/schema/styles/internal.d.ts +1 -1
- package/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap +0 -714
- package/src/api/blockManipulation/blockManipulation.test.ts +0 -292
- package/src/api/blockManipulation/blockManipulation.ts +0 -350
- package/src/api/exporters/copyExtension.ts +0 -164
- package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionLeavesBlockChildren.html +0 -1
- package/src/api/exporters/html/__snapshots_fragment_edge_cases__/selectionSpansBlocksChildren.html +0 -1
- package/src/api/exporters/html/util/sharedHTMLConversion.ts +0 -130
- package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +0 -218
- package/src/api/getCurrentBlockContentType.ts +0 -14
- package/src/api/parsers/html/__snapshots__/paste/parse-google-docs-html.json +0 -476
- package/types/src/api/blockManipulation/blockManipulation.d.ts +0 -14
- package/types/src/api/exporters/copyExtension.d.ts +0 -6
- package/types/src/api/exporters/html/util/sharedHTMLConversion.d.ts +0 -9
- package/types/src/api/exporters/html/util/simplifyBlocksRehypePlugin.d.ts +0 -16
- package/types/src/api/getCurrentBlockContentType.d.ts +0 -2
- package/types/src/api/nodeConversions/nodeConversions.d.ts +0 -24
- package/types/src/api/parsers/fileDropExtension.d.ts +0 -6
- package/types/src/api/parsers/pasteExtension.d.ts +0 -6
- package/types/src/extensions/NonEditableBlocks/NonEditableBlockPlugin.d.ts +0 -2
- /package/src/api/{exporters/html/__snapshots_fragment_edge_cases__/selectionWithinBlockChildren.html → clipboard/__snapshots__/multipleChildren.html} +0 -0
- /package/src/api/{parsers → clipboard/fromClipboard}/acceptedMIMETypes.ts +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/list-test.json → list-test.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-basic-block-types.json → parse-basic-block-types.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-div-with-inline-content.json → parse-div-with-inline-content.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-divs.json → parse-divs.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-fake-image-caption.json → parse-fake-image-caption.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-image-in-paragraph.json → parse-image-in-paragraph.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-mixed-nested-lists.json → parse-mixed-nested-lists.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-nested-lists-with-paragraphs.json → parse-nested-lists-with-paragraphs.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-nested-lists.json → parse-nested-lists.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-notion-html.json → parse-notion-html.json} +0 -0
- /package/src/api/parsers/html/__snapshots__/{paste/parse-two-divs.json → parse-two-divs.json} +0 -0
- /package/types/src/api/blockManipulation/{blockManipulation.test.d.ts → commands/insertBlocks/insertBlocks.test.d.ts} +0 -0
- /package/types/src/api/{parsers → clipboard/fromClipboard}/acceptedMIMETypes.d.ts +0 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
|
+
export declare function setupTestEnv(): () => BlockNoteEditor<import("../../index.js").BlockSchemaFromSpecs<{
|
|
3
|
+
paragraph: {
|
|
4
|
+
config: {
|
|
5
|
+
type: "paragraph";
|
|
6
|
+
content: "inline";
|
|
7
|
+
propSchema: {
|
|
8
|
+
backgroundColor: {
|
|
9
|
+
default: "default";
|
|
10
|
+
};
|
|
11
|
+
textColor: {
|
|
12
|
+
default: "default";
|
|
13
|
+
};
|
|
14
|
+
textAlignment: {
|
|
15
|
+
default: "left";
|
|
16
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
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
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
36
|
+
};
|
|
37
|
+
heading: {
|
|
38
|
+
config: {
|
|
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
|
+
};
|
|
58
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
59
|
+
type: "heading";
|
|
60
|
+
content: "inline";
|
|
61
|
+
propSchema: {
|
|
62
|
+
level: {
|
|
63
|
+
default: number;
|
|
64
|
+
values: readonly [1, 2, 3];
|
|
65
|
+
};
|
|
66
|
+
backgroundColor: {
|
|
67
|
+
default: "default";
|
|
68
|
+
};
|
|
69
|
+
textColor: {
|
|
70
|
+
default: "default";
|
|
71
|
+
};
|
|
72
|
+
textAlignment: {
|
|
73
|
+
default: "left";
|
|
74
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
78
|
+
};
|
|
79
|
+
bulletListItem: {
|
|
80
|
+
config: {
|
|
81
|
+
type: "bulletListItem";
|
|
82
|
+
content: "inline";
|
|
83
|
+
propSchema: {
|
|
84
|
+
backgroundColor: {
|
|
85
|
+
default: "default";
|
|
86
|
+
};
|
|
87
|
+
textColor: {
|
|
88
|
+
default: "default";
|
|
89
|
+
};
|
|
90
|
+
textAlignment: {
|
|
91
|
+
default: "left";
|
|
92
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
97
|
+
type: "bulletListItem";
|
|
98
|
+
content: "inline";
|
|
99
|
+
propSchema: {
|
|
100
|
+
backgroundColor: {
|
|
101
|
+
default: "default";
|
|
102
|
+
};
|
|
103
|
+
textColor: {
|
|
104
|
+
default: "default";
|
|
105
|
+
};
|
|
106
|
+
textAlignment: {
|
|
107
|
+
default: "left";
|
|
108
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
112
|
+
};
|
|
113
|
+
numberedListItem: {
|
|
114
|
+
config: {
|
|
115
|
+
type: "numberedListItem";
|
|
116
|
+
content: "inline";
|
|
117
|
+
propSchema: {
|
|
118
|
+
backgroundColor: {
|
|
119
|
+
default: "default";
|
|
120
|
+
};
|
|
121
|
+
textColor: {
|
|
122
|
+
default: "default";
|
|
123
|
+
};
|
|
124
|
+
textAlignment: {
|
|
125
|
+
default: "left";
|
|
126
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
131
|
+
type: "numberedListItem";
|
|
132
|
+
content: "inline";
|
|
133
|
+
propSchema: {
|
|
134
|
+
backgroundColor: {
|
|
135
|
+
default: "default";
|
|
136
|
+
};
|
|
137
|
+
textColor: {
|
|
138
|
+
default: "default";
|
|
139
|
+
};
|
|
140
|
+
textAlignment: {
|
|
141
|
+
default: "left";
|
|
142
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
146
|
+
};
|
|
147
|
+
checkListItem: {
|
|
148
|
+
config: {
|
|
149
|
+
type: "checkListItem";
|
|
150
|
+
content: "inline";
|
|
151
|
+
propSchema: {
|
|
152
|
+
checked: {
|
|
153
|
+
default: false;
|
|
154
|
+
};
|
|
155
|
+
backgroundColor: {
|
|
156
|
+
default: "default";
|
|
157
|
+
};
|
|
158
|
+
textColor: {
|
|
159
|
+
default: "default";
|
|
160
|
+
};
|
|
161
|
+
textAlignment: {
|
|
162
|
+
default: "left";
|
|
163
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
168
|
+
type: "checkListItem";
|
|
169
|
+
content: "inline";
|
|
170
|
+
propSchema: {
|
|
171
|
+
checked: {
|
|
172
|
+
default: false;
|
|
173
|
+
};
|
|
174
|
+
backgroundColor: {
|
|
175
|
+
default: "default";
|
|
176
|
+
};
|
|
177
|
+
textColor: {
|
|
178
|
+
default: "default";
|
|
179
|
+
};
|
|
180
|
+
textAlignment: {
|
|
181
|
+
default: "left";
|
|
182
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
186
|
+
};
|
|
187
|
+
table: {
|
|
188
|
+
config: {
|
|
189
|
+
type: "table";
|
|
190
|
+
content: "table";
|
|
191
|
+
propSchema: {
|
|
192
|
+
backgroundColor: {
|
|
193
|
+
default: "default";
|
|
194
|
+
};
|
|
195
|
+
textColor: {
|
|
196
|
+
default: "default";
|
|
197
|
+
};
|
|
198
|
+
textAlignment: {
|
|
199
|
+
default: "left";
|
|
200
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
205
|
+
type: "table";
|
|
206
|
+
content: "table";
|
|
207
|
+
propSchema: {
|
|
208
|
+
backgroundColor: {
|
|
209
|
+
default: "default";
|
|
210
|
+
};
|
|
211
|
+
textColor: {
|
|
212
|
+
default: "default";
|
|
213
|
+
};
|
|
214
|
+
textAlignment: {
|
|
215
|
+
default: "left";
|
|
216
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
220
|
+
};
|
|
221
|
+
file: {
|
|
222
|
+
config: {
|
|
223
|
+
type: "file";
|
|
224
|
+
propSchema: {
|
|
225
|
+
backgroundColor: {
|
|
226
|
+
default: "default";
|
|
227
|
+
};
|
|
228
|
+
name: {
|
|
229
|
+
default: "";
|
|
230
|
+
};
|
|
231
|
+
url: {
|
|
232
|
+
default: "";
|
|
233
|
+
};
|
|
234
|
+
caption: {
|
|
235
|
+
default: "";
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
content: "none";
|
|
239
|
+
isFileBlock: true;
|
|
240
|
+
};
|
|
241
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
242
|
+
type: "file";
|
|
243
|
+
propSchema: {
|
|
244
|
+
backgroundColor: {
|
|
245
|
+
default: "default";
|
|
246
|
+
};
|
|
247
|
+
name: {
|
|
248
|
+
default: "";
|
|
249
|
+
};
|
|
250
|
+
url: {
|
|
251
|
+
default: "";
|
|
252
|
+
};
|
|
253
|
+
caption: {
|
|
254
|
+
default: "";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
content: "none";
|
|
258
|
+
isFileBlock: true;
|
|
259
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
260
|
+
};
|
|
261
|
+
image: {
|
|
262
|
+
config: {
|
|
263
|
+
type: "image";
|
|
264
|
+
propSchema: {
|
|
265
|
+
textAlignment: {
|
|
266
|
+
default: "left";
|
|
267
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
268
|
+
};
|
|
269
|
+
backgroundColor: {
|
|
270
|
+
default: "default";
|
|
271
|
+
};
|
|
272
|
+
name: {
|
|
273
|
+
default: "";
|
|
274
|
+
};
|
|
275
|
+
url: {
|
|
276
|
+
default: "";
|
|
277
|
+
};
|
|
278
|
+
caption: {
|
|
279
|
+
default: "";
|
|
280
|
+
};
|
|
281
|
+
showPreview: {
|
|
282
|
+
default: true;
|
|
283
|
+
};
|
|
284
|
+
previewWidth: {
|
|
285
|
+
default: number;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
content: "none";
|
|
289
|
+
isFileBlock: true;
|
|
290
|
+
fileBlockAccept: string[];
|
|
291
|
+
};
|
|
292
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
293
|
+
type: "image";
|
|
294
|
+
propSchema: {
|
|
295
|
+
textAlignment: {
|
|
296
|
+
default: "left";
|
|
297
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
298
|
+
};
|
|
299
|
+
backgroundColor: {
|
|
300
|
+
default: "default";
|
|
301
|
+
};
|
|
302
|
+
name: {
|
|
303
|
+
default: "";
|
|
304
|
+
};
|
|
305
|
+
url: {
|
|
306
|
+
default: "";
|
|
307
|
+
};
|
|
308
|
+
caption: {
|
|
309
|
+
default: "";
|
|
310
|
+
};
|
|
311
|
+
showPreview: {
|
|
312
|
+
default: true;
|
|
313
|
+
};
|
|
314
|
+
previewWidth: {
|
|
315
|
+
default: number;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
content: "none";
|
|
319
|
+
isFileBlock: true;
|
|
320
|
+
fileBlockAccept: string[];
|
|
321
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
322
|
+
};
|
|
323
|
+
video: {
|
|
324
|
+
config: {
|
|
325
|
+
type: "video";
|
|
326
|
+
propSchema: {
|
|
327
|
+
textAlignment: {
|
|
328
|
+
default: "left";
|
|
329
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
330
|
+
};
|
|
331
|
+
backgroundColor: {
|
|
332
|
+
default: "default";
|
|
333
|
+
};
|
|
334
|
+
name: {
|
|
335
|
+
default: "";
|
|
336
|
+
};
|
|
337
|
+
url: {
|
|
338
|
+
default: "";
|
|
339
|
+
};
|
|
340
|
+
caption: {
|
|
341
|
+
default: "";
|
|
342
|
+
};
|
|
343
|
+
showPreview: {
|
|
344
|
+
default: true;
|
|
345
|
+
};
|
|
346
|
+
previewWidth: {
|
|
347
|
+
default: number;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
content: "none";
|
|
351
|
+
isFileBlock: true;
|
|
352
|
+
fileBlockAccept: string[];
|
|
353
|
+
};
|
|
354
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
355
|
+
type: "video";
|
|
356
|
+
propSchema: {
|
|
357
|
+
textAlignment: {
|
|
358
|
+
default: "left";
|
|
359
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
360
|
+
};
|
|
361
|
+
backgroundColor: {
|
|
362
|
+
default: "default";
|
|
363
|
+
};
|
|
364
|
+
name: {
|
|
365
|
+
default: "";
|
|
366
|
+
};
|
|
367
|
+
url: {
|
|
368
|
+
default: "";
|
|
369
|
+
};
|
|
370
|
+
caption: {
|
|
371
|
+
default: "";
|
|
372
|
+
};
|
|
373
|
+
showPreview: {
|
|
374
|
+
default: true;
|
|
375
|
+
};
|
|
376
|
+
previewWidth: {
|
|
377
|
+
default: number;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
content: "none";
|
|
381
|
+
isFileBlock: true;
|
|
382
|
+
fileBlockAccept: string[];
|
|
383
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
384
|
+
};
|
|
385
|
+
audio: {
|
|
386
|
+
config: {
|
|
387
|
+
type: "audio";
|
|
388
|
+
propSchema: {
|
|
389
|
+
backgroundColor: {
|
|
390
|
+
default: "default";
|
|
391
|
+
};
|
|
392
|
+
name: {
|
|
393
|
+
default: "";
|
|
394
|
+
};
|
|
395
|
+
url: {
|
|
396
|
+
default: "";
|
|
397
|
+
};
|
|
398
|
+
caption: {
|
|
399
|
+
default: "";
|
|
400
|
+
};
|
|
401
|
+
showPreview: {
|
|
402
|
+
default: true;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
content: "none";
|
|
406
|
+
isFileBlock: true;
|
|
407
|
+
fileBlockAccept: string[];
|
|
408
|
+
};
|
|
409
|
+
implementation: import("../../index.js").TiptapBlockImplementation<{
|
|
410
|
+
type: "audio";
|
|
411
|
+
propSchema: {
|
|
412
|
+
backgroundColor: {
|
|
413
|
+
default: "default";
|
|
414
|
+
};
|
|
415
|
+
name: {
|
|
416
|
+
default: "";
|
|
417
|
+
};
|
|
418
|
+
url: {
|
|
419
|
+
default: "";
|
|
420
|
+
};
|
|
421
|
+
caption: {
|
|
422
|
+
default: "";
|
|
423
|
+
};
|
|
424
|
+
showPreview: {
|
|
425
|
+
default: true;
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
content: "none";
|
|
429
|
+
isFileBlock: true;
|
|
430
|
+
fileBlockAccept: string[];
|
|
431
|
+
}, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
|
|
432
|
+
};
|
|
433
|
+
}>, import("../../index.js").InlineContentSchemaFromSpecs<{
|
|
434
|
+
text: {
|
|
435
|
+
config: "text";
|
|
436
|
+
implementation: any;
|
|
437
|
+
};
|
|
438
|
+
link: {
|
|
439
|
+
config: "link";
|
|
440
|
+
implementation: any;
|
|
441
|
+
};
|
|
442
|
+
}>, import("../../index.js").StyleSchemaFromSpecs<{
|
|
443
|
+
bold: {
|
|
444
|
+
config: {
|
|
445
|
+
type: string;
|
|
446
|
+
propSchema: "boolean";
|
|
447
|
+
};
|
|
448
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
449
|
+
};
|
|
450
|
+
italic: {
|
|
451
|
+
config: {
|
|
452
|
+
type: string;
|
|
453
|
+
propSchema: "boolean";
|
|
454
|
+
};
|
|
455
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
456
|
+
};
|
|
457
|
+
underline: {
|
|
458
|
+
config: {
|
|
459
|
+
type: string;
|
|
460
|
+
propSchema: "boolean";
|
|
461
|
+
};
|
|
462
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
463
|
+
};
|
|
464
|
+
strike: {
|
|
465
|
+
config: {
|
|
466
|
+
type: string;
|
|
467
|
+
propSchema: "boolean";
|
|
468
|
+
};
|
|
469
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
470
|
+
};
|
|
471
|
+
code: {
|
|
472
|
+
config: {
|
|
473
|
+
type: string;
|
|
474
|
+
propSchema: "boolean";
|
|
475
|
+
};
|
|
476
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
477
|
+
};
|
|
478
|
+
textColor: {
|
|
479
|
+
config: {
|
|
480
|
+
type: string;
|
|
481
|
+
propSchema: "string";
|
|
482
|
+
};
|
|
483
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
484
|
+
};
|
|
485
|
+
backgroundColor: {
|
|
486
|
+
config: {
|
|
487
|
+
type: string;
|
|
488
|
+
propSchema: "string";
|
|
489
|
+
};
|
|
490
|
+
implementation: import("../../index.js").StyleImplementation;
|
|
491
|
+
};
|
|
492
|
+
}>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Extension } from "@tiptap/core";
|
|
2
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
3
|
+
import { InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
4
|
+
export declare const createDropFileExtension: <BSchema extends Record<string, import("../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>) => Extension<{
|
|
5
|
+
editor: BlockNoteEditor<BSchema, I, S>;
|
|
6
|
+
}, undefined>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BlockNoteEditor } from "
|
|
2
|
-
import { BlockSchema, InlineContentSchema, StyleSchema } from "
|
|
1
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
|
|
2
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
3
3
|
export declare function handleFileInsertion<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(event: DragEvent | ClipboardEvent, editor: BlockNoteEditor<BSchema, I, S>): Promise<void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Extension } from "@tiptap/core";
|
|
2
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
|
|
3
|
+
import { InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
4
|
+
export declare const createPasteFromClipboardExtension: <BSchema extends Record<string, import("../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>) => Extension<{
|
|
5
|
+
editor: BlockNoteEditor<BSchema, I, S>;
|
|
6
|
+
}, undefined>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Extension } from "@tiptap/core";
|
|
2
|
+
import { EditorView } from "prosemirror-view";
|
|
3
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
4
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
5
|
+
export declare function selectedFragmentToHTML<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(view: EditorView, editor: BlockNoteEditor<BSchema, I, S>): {
|
|
6
|
+
clipboardHTML: string;
|
|
7
|
+
externalHTML: string;
|
|
8
|
+
markdown: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const createCopyToClipboardExtension: <BSchema extends Record<string, import("../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>) => Extension<{
|
|
11
|
+
editor: BlockNoteEditor<BSchema, I, S>;
|
|
12
|
+
}, undefined>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PartialBlock } from "../../../blocks/defaultBlocks";
|
|
3
|
-
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { PartialBlock } from "../../../blocks/defaultBlocks.js";
|
|
3
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
4
|
+
import { InlineContent, InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
5
|
+
export declare const createExternalHTMLExporter: <BSchema extends Record<string, import("../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(schema: Schema, editor: BlockNoteEditor<BSchema, I, S>) => {
|
|
6
6
|
exportBlocks: (blocks: PartialBlock<BSchema, I, S>[], options: {
|
|
7
7
|
document?: Document;
|
|
8
8
|
}) => string;
|
|
9
|
-
|
|
9
|
+
exportInlineContent: (inlineContent: InlineContent<I, S>[], options: {
|
|
10
10
|
document?: Document;
|
|
11
11
|
}) => string;
|
|
12
|
-
}
|
|
13
|
-
export declare const createExternalHTMLExporter: <BSchema extends Record<string, import("../../../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(schema: Schema, editor: BlockNoteEditor<BSchema, I, S>) => ExternalHTMLExporter<BSchema, I, S>;
|
|
12
|
+
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PartialBlock } from "../../../blocks/defaultBlocks";
|
|
3
|
-
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
|
|
4
|
-
import {
|
|
5
|
-
export
|
|
6
|
-
serializeProseMirrorFragment: (fragment: Fragment, options: {
|
|
7
|
-
document?: Document;
|
|
8
|
-
}) => string;
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { PartialBlock } from "../../../blocks/defaultBlocks.js";
|
|
3
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
4
|
+
import { InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
5
|
+
export declare const createInternalHTMLSerializer: <BSchema extends Record<string, import("../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(schema: Schema, editor: BlockNoteEditor<BSchema, I, S>) => {
|
|
9
6
|
serializeBlocks: (blocks: PartialBlock<BSchema, I, S>[], options: {
|
|
10
7
|
document?: Document;
|
|
11
8
|
}) => string;
|
|
12
|
-
}
|
|
13
|
-
export declare const createInternalHTMLSerializer: <BSchema extends Record<string, import("../../../schema").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(schema: Schema, editor: BlockNoteEditor<BSchema, I, S>) => InternalHTMLSerializer<BSchema, I, S>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DOMSerializer } from "prosemirror-model";
|
|
2
|
+
import { PartialBlock } from "../../../../blocks/defaultBlocks.js";
|
|
3
|
+
import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
|
|
4
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
|
|
5
|
+
export declare function serializeInlineContentExternalHTML<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>, blockContent: PartialBlock<BSchema, I, S>["content"], serializer: DOMSerializer, options?: {
|
|
6
|
+
document?: Document;
|
|
7
|
+
}): HTMLElement | DocumentFragment;
|
|
8
|
+
export declare const serializeBlocksExternalHTML: <BSchema extends Record<string, import("../../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocks: PartialBlock<BSchema, I, S>[], serializer: DOMSerializer, orderedListItemBlockTypes: Set<string>, unorderedListItemBlockTypes: Set<string>, options?: {
|
|
9
|
+
document?: Document;
|
|
10
|
+
}) => DocumentFragment;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DOMSerializer } from "prosemirror-model";
|
|
2
|
+
import { PartialBlock } from "../../../../blocks/defaultBlocks.js";
|
|
3
|
+
import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
|
|
4
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
|
|
5
|
+
export declare function serializeInlineContentInternalHTML<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>, blockContent: PartialBlock<BSchema, I, S>["content"], serializer: DOMSerializer, _toExternalHTML: boolean, // TODO, externalHTML for IC
|
|
6
|
+
options?: {
|
|
7
|
+
document?: Document;
|
|
8
|
+
}): HTMLElement | DocumentFragment;
|
|
9
|
+
export declare const serializeBlocksInternalHTML: <BSchema extends Record<string, import("../../../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocks: PartialBlock<BSchema, I, S>[], serializer: DOMSerializer, toExternalHTML: boolean, options?: {
|
|
10
|
+
document?: Document;
|
|
11
|
+
}) => HTMLElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "prosemirror-model";
|
|
2
|
-
import { PartialBlock } from "../../../blocks/defaultBlocks";
|
|
3
|
-
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
|
|
4
|
-
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
|
|
2
|
+
import { PartialBlock } from "../../../blocks/defaultBlocks.js";
|
|
3
|
+
import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
|
|
4
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema/index.js";
|
|
5
5
|
export declare function cleanHTMLToMarkdown(cleanHTMLString: string): string;
|
|
6
6
|
export declare function blocksToMarkdown<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blocks: PartialBlock<BSchema, I, S>[], schema: Schema, editor: BlockNoteEditor<BSchema, I, S>, options: {
|
|
7
7
|
document?: Document;
|