@blocknote/core 0.17.1 → 0.19.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 +2774 -1804
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +9 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +27 -0
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +99 -0
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +97 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +88 -0
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js +116 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js +106 -0
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +57 -0
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +43 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +27 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +29 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +157 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +27 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +64 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +145 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +252 -0
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +1 -0
- package/dist/src/api/blockManipulation/insertContentAt.js +64 -0
- package/dist/src/api/blockManipulation/insertContentAt.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +76 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +33 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +1 -0
- package/dist/src/api/blockManipulation/setupTestEnv.js +172 -0
- package/dist/src/api/blockManipulation/setupTestEnv.js.map +1 -0
- package/dist/src/api/clipboard/clipboard.test.js +246 -0
- package/dist/src/api/clipboard/clipboard.test.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +8 -0
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +38 -0
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +109 -0
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +26 -0
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +1 -0
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +57 -0
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +1 -0
- package/dist/src/api/clipboard/toClipboard/copyExtension.js +132 -0
- package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +1 -0
- package/dist/src/api/exporters/html/externalHTMLExporter.js +35 -0
- package/dist/src/api/exporters/html/externalHTMLExporter.js.map +1 -0
- package/dist/src/api/exporters/html/htmlConversion.test.js +72 -0
- package/dist/src/api/exporters/html/htmlConversion.test.js.map +1 -0
- package/dist/src/api/exporters/html/internalHTMLSerializer.js +21 -0
- package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +1 -0
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +141 -0
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +1 -0
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +96 -0
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +1 -0
- package/dist/src/api/exporters/markdown/markdownExporter.js +31 -0
- package/dist/src/api/exporters/markdown/markdownExporter.js.map +1 -0
- package/dist/src/api/exporters/markdown/markdownExporter.test.js +57 -0
- package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +1 -0
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +33 -0
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +1 -0
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +37 -0
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +1 -0
- package/dist/src/api/getBlockInfoFromPos.js +171 -0
- package/dist/src/api/getBlockInfoFromPos.js.map +1 -0
- package/dist/src/api/nodeConversions/blockToNode.js +197 -0
- package/dist/src/api/nodeConversions/blockToNode.js.map +1 -0
- package/dist/src/api/nodeConversions/fragmentToBlocks.js +50 -0
- package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +1 -0
- package/dist/src/api/nodeConversions/nodeConversions.test.js +54 -0
- package/dist/src/api/nodeConversions/nodeConversions.test.js.map +1 -0
- package/dist/src/api/nodeConversions/nodeToBlock.js +316 -0
- package/dist/src/api/nodeConversions/nodeToBlock.js.map +1 -0
- package/dist/src/api/nodeUtil.js +28 -0
- package/dist/src/api/nodeUtil.js.map +1 -0
- package/dist/src/api/parsers/html/parseHTML.js +19 -0
- package/dist/src/api/parsers/html/parseHTML.js.map +1 -0
- package/dist/src/api/parsers/html/parseHTML.test.js +470 -0
- package/dist/src/api/parsers/html/parseHTML.test.js.map +1 -0
- package/dist/src/api/parsers/html/util/nestedLists.js +106 -0
- package/dist/src/api/parsers/html/util/nestedLists.js.map +1 -0
- package/dist/src/api/parsers/html/util/nestedLists.test.js +166 -0
- package/dist/src/api/parsers/html/util/nestedLists.test.js.map +1 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.js +52 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.js.map +1 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js +109 -0
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +1 -0
- package/dist/src/api/testUtil/cases/customBlocks.js +313 -0
- package/dist/src/api/testUtil/cases/customBlocks.js.map +1 -0
- package/dist/src/api/testUtil/cases/customInlineContent.js +91 -0
- package/dist/src/api/testUtil/cases/customInlineContent.js.map +1 -0
- package/dist/src/api/testUtil/cases/customStyles.js +83 -0
- package/dist/src/api/testUtil/cases/customStyles.js.map +1 -0
- package/dist/src/api/testUtil/cases/defaultSchema.js +673 -0
- package/dist/src/api/testUtil/cases/defaultSchema.js.map +1 -0
- package/dist/src/api/testUtil/index.js +2 -0
- package/dist/src/api/testUtil/index.js.map +1 -0
- package/dist/src/api/testUtil/partialBlockTestUtil.js +114 -0
- package/dist/src/api/testUtil/partialBlockTestUtil.js.map +1 -0
- package/dist/src/api/testUtil/paste.js +29 -0
- package/dist/src/api/testUtil/paste.js.map +1 -0
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +97 -0
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +1 -0
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js +5 -0
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js.map +1 -0
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +273 -0
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +1 -0
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +90 -0
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js +70 -0
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js +317 -0
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +15 -0
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +1 -0
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +141 -0
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +1 -0
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +106 -0
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +1 -0
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js +6 -0
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +111 -0
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +218 -0
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +41 -0
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +58 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +128 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +51 -0
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +1 -0
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js +130 -0
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +1 -0
- package/dist/src/blocks/TableBlockContent/TableExtension.js +57 -0
- package/dist/src/blocks/TableBlockContent/TableExtension.js.map +1 -0
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +103 -0
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +1 -0
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js +6 -0
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js.map +1 -0
- package/dist/src/blocks/defaultBlockHelpers.js +50 -0
- package/dist/src/blocks/defaultBlockHelpers.js.map +1 -0
- package/dist/src/blocks/defaultBlockTypeGuards.js +40 -0
- package/dist/src/blocks/defaultBlockTypeGuards.js.map +1 -0
- package/dist/src/blocks/defaultBlocks.js +50 -0
- package/dist/src/blocks/defaultBlocks.js.map +1 -0
- package/dist/src/blocks/defaultProps.js +19 -0
- package/dist/src/blocks/defaultProps.js.map +1 -0
- package/dist/src/editor/BlockNoteEditor.js +750 -0
- package/dist/src/editor/BlockNoteEditor.js.map +1 -0
- package/dist/src/editor/BlockNoteEditor.test.js +65 -0
- package/dist/src/editor/BlockNoteEditor.test.js.map +1 -0
- package/dist/src/editor/BlockNoteExtensions.js +149 -0
- package/dist/src/editor/BlockNoteExtensions.js.map +1 -0
- package/dist/src/editor/BlockNoteSchema.js +38 -0
- package/dist/src/editor/BlockNoteSchema.js.map +1 -0
- package/dist/src/editor/BlockNoteTipTapEditor.js +169 -0
- package/dist/src/editor/BlockNoteTipTapEditor.js.map +1 -0
- package/dist/src/editor/cursorPositionTypes.js +2 -0
- package/dist/src/editor/cursorPositionTypes.js.map +1 -0
- package/dist/src/editor/defaultColors.js +77 -0
- package/dist/src/editor/defaultColors.js.map +1 -0
- package/dist/src/editor/selectionTypes.js +2 -0
- package/dist/src/editor/selectionTypes.js.map +1 -0
- package/dist/src/editor/transformPasted.js +79 -0
- package/dist/src/editor/transformPasted.js.map +1 -0
- package/dist/src/exporter/Exporter.js +36 -0
- package/dist/src/exporter/Exporter.js.map +1 -0
- package/dist/src/exporter/index.js +3 -0
- package/dist/src/exporter/index.js.map +1 -0
- package/dist/src/exporter/mapping.js +12 -0
- package/dist/src/exporter/mapping.js.map +1 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +30 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +1 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +39 -0
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +1 -0
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js +131 -0
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +1 -0
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +195 -0
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +1 -0
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +309 -0
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +1 -0
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +247 -0
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +1 -0
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +51 -0
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +1 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +81 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -0
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +183 -0
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +1 -0
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +68 -0
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +1 -0
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js +339 -0
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +1 -0
- package/dist/src/extensions/SideMenu/dragging.js +128 -0
- package/dist/src/extensions/SideMenu/dragging.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +2 -0
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +2 -0
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +245 -0
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +26 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +1 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +244 -0
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +1 -0
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +553 -0
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +1 -0
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +36 -0
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +1 -0
- package/dist/src/extensions/TextColor/TextColorExtension.js +29 -0
- package/dist/src/extensions/TextColor/TextColorExtension.js.map +1 -0
- package/dist/src/extensions/TextColor/TextColorMark.js +37 -0
- package/dist/src/extensions/TextColor/TextColorMark.js.map +1 -0
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +58 -0
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +1 -0
- package/dist/src/extensions/UniqueID/UniqueID.js +283 -0
- package/dist/src/extensions/UniqueID/UniqueID.js.map +1 -0
- package/dist/src/extensions/getDraggableBlockFromElement.js +13 -0
- package/dist/src/extensions/getDraggableBlockFromElement.js.map +1 -0
- package/dist/src/extensions-shared/UiElementPosition.js +2 -0
- package/dist/src/extensions-shared/UiElementPosition.js.map +1 -0
- package/dist/src/i18n/dictionary.js +4 -0
- package/dist/src/i18n/dictionary.js.map +1 -0
- package/dist/src/i18n/locales/ar.js +298 -0
- package/dist/src/i18n/locales/ar.js.map +1 -0
- package/dist/src/i18n/locales/de.js +313 -0
- package/dist/src/i18n/locales/de.js.map +1 -0
- package/dist/src/i18n/locales/en.js +314 -0
- package/dist/src/i18n/locales/en.js.map +1 -0
- package/dist/src/i18n/locales/es.js +312 -0
- package/dist/src/i18n/locales/es.js.map +1 -0
- package/dist/src/i18n/locales/fr.js +313 -0
- package/dist/src/i18n/locales/fr.js.map +1 -0
- package/dist/src/i18n/locales/hr.js +308 -0
- package/dist/src/i18n/locales/hr.js.map +1 -0
- package/dist/src/i18n/locales/index.js +16 -0
- package/dist/src/i18n/locales/index.js.map +1 -0
- package/dist/src/i18n/locales/is.js +305 -0
- package/dist/src/i18n/locales/is.js.map +1 -0
- package/dist/src/i18n/locales/ja.js +333 -0
- package/dist/src/i18n/locales/ja.js.map +1 -0
- package/dist/src/i18n/locales/ko.js +326 -0
- package/dist/src/i18n/locales/ko.js.map +1 -0
- package/dist/src/i18n/locales/nl.js +313 -0
- package/dist/src/i18n/locales/nl.js.map +1 -0
- package/dist/src/i18n/locales/pl.js +297 -0
- package/dist/src/i18n/locales/pl.js.map +1 -0
- package/dist/src/i18n/locales/pt.js +305 -0
- package/dist/src/i18n/locales/pt.js.map +1 -0
- package/dist/src/i18n/locales/ru.js +340 -0
- package/dist/src/i18n/locales/ru.js.map +1 -0
- package/dist/src/i18n/locales/vi.js +312 -0
- package/dist/src/i18n/locales/vi.js.map +1 -0
- package/dist/src/i18n/locales/zh.js +346 -0
- package/dist/src/i18n/locales/zh.js.map +1 -0
- package/dist/src/index.js +55 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/pm-nodes/BlockContainer.js +72 -0
- package/dist/src/pm-nodes/BlockContainer.js.map +1 -0
- package/dist/src/pm-nodes/BlockGroup.js +43 -0
- package/dist/src/pm-nodes/BlockGroup.js.map +1 -0
- package/dist/src/pm-nodes/Doc.js +7 -0
- package/dist/src/pm-nodes/Doc.js.map +1 -0
- package/dist/src/pm-nodes/index.js +4 -0
- package/dist/src/pm-nodes/index.js.map +1 -0
- package/dist/src/schema/blocks/createSpec.js +126 -0
- package/dist/src/schema/blocks/createSpec.js.map +1 -0
- package/dist/src/schema/blocks/internal.js +147 -0
- package/dist/src/schema/blocks/internal.js.map +1 -0
- package/dist/src/schema/blocks/types.js +2 -0
- package/dist/src/schema/blocks/types.js.map +1 -0
- package/dist/src/schema/index.js +11 -0
- package/dist/src/schema/index.js.map +1 -0
- package/dist/src/schema/inlineContent/createSpec.js +64 -0
- package/dist/src/schema/inlineContent/createSpec.js.map +1 -0
- package/dist/src/schema/inlineContent/internal.js +52 -0
- package/dist/src/schema/inlineContent/internal.js.map +1 -0
- package/dist/src/schema/inlineContent/types.js +10 -0
- package/dist/src/schema/inlineContent/types.js.map +1 -0
- package/dist/src/schema/propTypes.js +2 -0
- package/dist/src/schema/propTypes.js.map +1 -0
- package/dist/src/schema/styles/createSpec.js +48 -0
- package/dist/src/schema/styles/createSpec.js.map +1 -0
- package/dist/src/schema/styles/internal.js +53 -0
- package/dist/src/schema/styles/internal.js.map +1 -0
- package/dist/src/schema/styles/types.js +2 -0
- package/dist/src/schema/styles/types.js.map +1 -0
- package/dist/src/util/EventEmitter.js +33 -0
- package/dist/src/util/EventEmitter.js.map +1 -0
- package/dist/src/util/browser.js +17 -0
- package/dist/src/util/browser.js.map +1 -0
- package/dist/src/util/combineByGroup.js +20 -0
- package/dist/src/util/combineByGroup.js.map +1 -0
- package/dist/src/util/esmDependencies.js +35 -0
- package/dist/src/util/esmDependencies.js.map +1 -0
- package/dist/src/util/string.js +14 -0
- package/dist/src/util/string.js.map +1 -0
- package/dist/src/util/typescript.js +12 -0
- package/dist/src/util/typescript.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/webpack-stats.json +1 -1
- package/package.json +9 -7
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +30 -0
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -0
- package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +25 -0
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +2 -2
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +104 -39
- package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +40 -0
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +3 -5
- package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +100 -0
- package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +10 -0
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +1 -1
- package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +40 -0
- package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +30 -0
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +8 -4
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +11 -7
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +87 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +5 -5
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +192 -107
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +48 -33
- package/src/api/clipboard/clipboard.test.ts +1 -1
- package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -0
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +49 -0
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +6 -0
- package/src/api/clipboard/toClipboard/copyExtension.ts +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/table/allColWidths/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/table/allColWidths/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/table/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/table/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/table/mixedColWidths/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/table/mixedColWidths/internal.html +1 -0
- package/src/api/exporters/html/htmlConversion.test.ts +1 -4
- package/src/api/exporters/html/internalHTMLSerializer.ts +2 -7
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +75 -33
- package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +2 -0
- package/src/api/exporters/markdown/__snapshots__/codeBlock/python/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/table/allColWidths/markdown.md +5 -0
- package/src/api/exporters/markdown/__snapshots__/table/basic/markdown.md +5 -0
- package/src/api/exporters/markdown/__snapshots__/table/mixedColWidths/markdown.md +5 -0
- package/src/api/exporters/markdown/markdownExporter.test.ts +1 -4
- package/src/api/getBlockInfoFromPos.ts +113 -58
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +711 -0
- package/src/api/nodeConversions/blockToNode.ts +62 -26
- package/src/api/nodeConversions/fragmentToBlocks.ts +18 -0
- package/src/api/nodeConversions/nodeToBlock.ts +35 -22
- package/src/api/nodeUtil.ts +1 -1
- package/src/api/parsers/html/__snapshots__/parse-notion-html.json +5 -0
- package/src/api/parsers/markdown/parseMarkdown.ts +1 -1
- package/src/api/testUtil/cases/defaultSchema.ts +95 -0
- package/src/api/testUtil/partialBlockTestUtil.ts +41 -4
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +4 -2
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +369 -0
- package/src/blocks/CodeBlockContent/defaultSupportedLanguages.ts +96 -0
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +10 -2
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +19 -31
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +4 -2
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +5 -9
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +6 -10
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +1 -1
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -4
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +5 -9
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +4 -8
- package/src/blocks/TableBlockContent/TableBlockContent.ts +83 -8
- package/src/blocks/TableBlockContent/TableExtension.ts +10 -1
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +4 -2
- package/src/blocks/defaultBlockHelpers.ts +7 -2
- package/src/blocks/defaultBlocks.ts +4 -0
- package/src/editor/Block.css +71 -3
- package/src/editor/BlockNoteEditor.test.ts +2 -2
- package/src/editor/BlockNoteEditor.ts +18 -21
- package/src/editor/BlockNoteExtensions.ts +2 -3
- package/src/editor/BlockNoteTipTapEditor.ts +8 -1
- package/src/editor/defaultColors.ts +77 -0
- package/src/editor/editor.css +43 -5
- package/src/editor/transformPasted.ts +6 -3
- package/src/exporter/Exporter.ts +101 -0
- package/src/exporter/index.ts +2 -0
- package/src/exporter/mapping.ts +75 -0
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +8 -0
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +201 -48
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +1 -1
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +5 -0
- package/src/extensions/SideMenu/SideMenuPlugin.ts +141 -52
- package/src/extensions/SideMenu/dragging.ts +3 -54
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +5 -0
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +2 -1
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +22 -6
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +225 -120
- package/src/extensions/TrailingNode/TrailingNodeExtension.ts +1 -1
- package/src/extensions/getDraggableBlockFromElement.ts +19 -0
- package/src/i18n/locales/ar.ts +6 -0
- package/src/i18n/locales/de.ts +299 -294
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +310 -274
- package/src/i18n/locales/fr.ts +6 -0
- package/src/i18n/locales/is.ts +6 -0
- package/src/i18n/locales/ja.ts +6 -0
- package/src/i18n/locales/ko.ts +6 -0
- package/src/i18n/locales/nl.ts +6 -0
- package/src/i18n/locales/pl.ts +6 -0
- package/src/i18n/locales/pt.ts +10 -4
- package/src/i18n/locales/ru.ts +6 -0
- package/src/i18n/locales/vi.ts +6 -0
- package/src/i18n/locales/zh.ts +6 -0
- package/src/index.ts +9 -0
- package/src/pm-nodes/BlockContainer.ts +1 -1
- package/src/pm-nodes/BlockGroup.ts +2 -2
- package/src/pm-nodes/README.md +127 -28
- package/src/schema/blocks/createSpec.ts +4 -1
- package/src/schema/blocks/internal.ts +12 -2
- package/src/schema/blocks/types.ts +3 -1
- package/src/util/combineByGroup.ts +25 -0
- package/types/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.d.ts +22 -2
- package/types/src/api/blockManipulation/commands/nestBlock/nestBlock.d.ts +5 -0
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +22 -8
- package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
- package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +3 -0
- package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +2 -3
- package/types/src/api/getBlockInfoFromPos.d.ts +55 -5
- package/types/src/api/nodeConversions/blockToNode.d.ts +1 -1
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +3 -1
- package/types/src/api/testUtil/cases/customBlocks.d.ts +22 -8
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +22 -8
- package/types/src/api/testUtil/cases/customStyles.d.ts +22 -8
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +1 -0
- package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +57 -0
- package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +6 -0
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +1 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +1 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -12
- package/types/src/blocks/TableBlockContent/TableExtension.d.ts +3 -0
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +1 -0
- package/types/src/blocks/defaultBlocks.d.ts +45 -16
- package/types/src/editor/BlockNoteEditor.d.ts +4 -3
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +1 -0
- package/types/src/editor/defaultColors.d.ts +76 -0
- package/types/src/exporter/Exporter.d.ts +43 -0
- package/types/src/exporter/index.d.ts +2 -0
- package/types/src/exporter/mapping.d.ts +30 -0
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +2 -1
- package/types/src/extensions/SideMenu/dragging.d.ts +1 -6
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +9 -5
- package/types/src/extensions/getDraggableBlockFromElement.d.ts +5 -0
- package/types/src/i18n/locales/de.d.ts +6 -0
- package/types/src/i18n/locales/en.d.ts +6 -0
- package/types/src/i18n/locales/es.d.ts +6 -0
- package/types/src/index.d.ts +6 -0
- package/types/src/schema/blocks/createSpec.d.ts +1 -1
- package/types/src/schema/blocks/internal.d.ts +2 -2
- package/types/src/schema/blocks/types.d.ts +3 -1
- package/types/src/util/combineByGroup.d.ts +9 -0
|
@@ -662,6 +662,75 @@ exports[`Test BlockNote-Prosemirror conversion > Case: custom style schema > Con
|
|
|
662
662
|
}
|
|
663
663
|
`;
|
|
664
664
|
|
|
665
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/defaultLanguage to/from prosemirror 1`] = `
|
|
666
|
+
{
|
|
667
|
+
"attrs": {
|
|
668
|
+
"backgroundColor": "default",
|
|
669
|
+
"id": "1",
|
|
670
|
+
"textColor": "default",
|
|
671
|
+
},
|
|
672
|
+
"content": [
|
|
673
|
+
{
|
|
674
|
+
"attrs": {
|
|
675
|
+
"language": "javascript",
|
|
676
|
+
},
|
|
677
|
+
"content": [
|
|
678
|
+
{
|
|
679
|
+
"text": "console.log('Hello, world!');",
|
|
680
|
+
"type": "text",
|
|
681
|
+
},
|
|
682
|
+
],
|
|
683
|
+
"type": "codeBlock",
|
|
684
|
+
},
|
|
685
|
+
],
|
|
686
|
+
"type": "blockContainer",
|
|
687
|
+
}
|
|
688
|
+
`;
|
|
689
|
+
|
|
690
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/empty to/from prosemirror 1`] = `
|
|
691
|
+
{
|
|
692
|
+
"attrs": {
|
|
693
|
+
"backgroundColor": "default",
|
|
694
|
+
"id": "1",
|
|
695
|
+
"textColor": "default",
|
|
696
|
+
},
|
|
697
|
+
"content": [
|
|
698
|
+
{
|
|
699
|
+
"attrs": {
|
|
700
|
+
"language": "javascript",
|
|
701
|
+
},
|
|
702
|
+
"type": "codeBlock",
|
|
703
|
+
},
|
|
704
|
+
],
|
|
705
|
+
"type": "blockContainer",
|
|
706
|
+
}
|
|
707
|
+
`;
|
|
708
|
+
|
|
709
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert codeBlock/python to/from prosemirror 1`] = `
|
|
710
|
+
{
|
|
711
|
+
"attrs": {
|
|
712
|
+
"backgroundColor": "default",
|
|
713
|
+
"id": "1",
|
|
714
|
+
"textColor": "default",
|
|
715
|
+
},
|
|
716
|
+
"content": [
|
|
717
|
+
{
|
|
718
|
+
"attrs": {
|
|
719
|
+
"language": "python",
|
|
720
|
+
},
|
|
721
|
+
"content": [
|
|
722
|
+
{
|
|
723
|
+
"text": "print('Hello, world!')",
|
|
724
|
+
"type": "text",
|
|
725
|
+
},
|
|
726
|
+
],
|
|
727
|
+
"type": "codeBlock",
|
|
728
|
+
},
|
|
729
|
+
],
|
|
730
|
+
"type": "blockContainer",
|
|
731
|
+
}
|
|
732
|
+
`;
|
|
733
|
+
|
|
665
734
|
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert complex/misc to/from prosemirror 1`] = `
|
|
666
735
|
{
|
|
667
736
|
"attrs": {
|
|
@@ -1752,3 +1821,645 @@ exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert
|
|
|
1752
1821
|
"type": "blockContainer",
|
|
1753
1822
|
}
|
|
1754
1823
|
`;
|
|
1824
|
+
|
|
1825
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/allColWidths to/from prosemirror 1`] = `
|
|
1826
|
+
{
|
|
1827
|
+
"attrs": {
|
|
1828
|
+
"backgroundColor": "default",
|
|
1829
|
+
"id": "1",
|
|
1830
|
+
"textColor": "default",
|
|
1831
|
+
},
|
|
1832
|
+
"content": [
|
|
1833
|
+
{
|
|
1834
|
+
"content": [
|
|
1835
|
+
{
|
|
1836
|
+
"content": [
|
|
1837
|
+
{
|
|
1838
|
+
"attrs": {
|
|
1839
|
+
"colspan": 1,
|
|
1840
|
+
"colwidth": [
|
|
1841
|
+
100,
|
|
1842
|
+
],
|
|
1843
|
+
"rowspan": 1,
|
|
1844
|
+
},
|
|
1845
|
+
"content": [
|
|
1846
|
+
{
|
|
1847
|
+
"content": [
|
|
1848
|
+
{
|
|
1849
|
+
"text": "Table Cell",
|
|
1850
|
+
"type": "text",
|
|
1851
|
+
},
|
|
1852
|
+
],
|
|
1853
|
+
"type": "tableParagraph",
|
|
1854
|
+
},
|
|
1855
|
+
],
|
|
1856
|
+
"type": "tableCell",
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
"attrs": {
|
|
1860
|
+
"colspan": 1,
|
|
1861
|
+
"colwidth": [
|
|
1862
|
+
200,
|
|
1863
|
+
],
|
|
1864
|
+
"rowspan": 1,
|
|
1865
|
+
},
|
|
1866
|
+
"content": [
|
|
1867
|
+
{
|
|
1868
|
+
"content": [
|
|
1869
|
+
{
|
|
1870
|
+
"text": "Table Cell",
|
|
1871
|
+
"type": "text",
|
|
1872
|
+
},
|
|
1873
|
+
],
|
|
1874
|
+
"type": "tableParagraph",
|
|
1875
|
+
},
|
|
1876
|
+
],
|
|
1877
|
+
"type": "tableCell",
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
"attrs": {
|
|
1881
|
+
"colspan": 1,
|
|
1882
|
+
"colwidth": [
|
|
1883
|
+
300,
|
|
1884
|
+
],
|
|
1885
|
+
"rowspan": 1,
|
|
1886
|
+
},
|
|
1887
|
+
"content": [
|
|
1888
|
+
{
|
|
1889
|
+
"content": [
|
|
1890
|
+
{
|
|
1891
|
+
"text": "Table Cell",
|
|
1892
|
+
"type": "text",
|
|
1893
|
+
},
|
|
1894
|
+
],
|
|
1895
|
+
"type": "tableParagraph",
|
|
1896
|
+
},
|
|
1897
|
+
],
|
|
1898
|
+
"type": "tableCell",
|
|
1899
|
+
},
|
|
1900
|
+
],
|
|
1901
|
+
"type": "tableRow",
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
"content": [
|
|
1905
|
+
{
|
|
1906
|
+
"attrs": {
|
|
1907
|
+
"colspan": 1,
|
|
1908
|
+
"colwidth": [
|
|
1909
|
+
100,
|
|
1910
|
+
],
|
|
1911
|
+
"rowspan": 1,
|
|
1912
|
+
},
|
|
1913
|
+
"content": [
|
|
1914
|
+
{
|
|
1915
|
+
"content": [
|
|
1916
|
+
{
|
|
1917
|
+
"text": "Table Cell",
|
|
1918
|
+
"type": "text",
|
|
1919
|
+
},
|
|
1920
|
+
],
|
|
1921
|
+
"type": "tableParagraph",
|
|
1922
|
+
},
|
|
1923
|
+
],
|
|
1924
|
+
"type": "tableCell",
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
"attrs": {
|
|
1928
|
+
"colspan": 1,
|
|
1929
|
+
"colwidth": [
|
|
1930
|
+
200,
|
|
1931
|
+
],
|
|
1932
|
+
"rowspan": 1,
|
|
1933
|
+
},
|
|
1934
|
+
"content": [
|
|
1935
|
+
{
|
|
1936
|
+
"content": [
|
|
1937
|
+
{
|
|
1938
|
+
"text": "Table Cell",
|
|
1939
|
+
"type": "text",
|
|
1940
|
+
},
|
|
1941
|
+
],
|
|
1942
|
+
"type": "tableParagraph",
|
|
1943
|
+
},
|
|
1944
|
+
],
|
|
1945
|
+
"type": "tableCell",
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"attrs": {
|
|
1949
|
+
"colspan": 1,
|
|
1950
|
+
"colwidth": [
|
|
1951
|
+
300,
|
|
1952
|
+
],
|
|
1953
|
+
"rowspan": 1,
|
|
1954
|
+
},
|
|
1955
|
+
"content": [
|
|
1956
|
+
{
|
|
1957
|
+
"content": [
|
|
1958
|
+
{
|
|
1959
|
+
"text": "Table Cell",
|
|
1960
|
+
"type": "text",
|
|
1961
|
+
},
|
|
1962
|
+
],
|
|
1963
|
+
"type": "tableParagraph",
|
|
1964
|
+
},
|
|
1965
|
+
],
|
|
1966
|
+
"type": "tableCell",
|
|
1967
|
+
},
|
|
1968
|
+
],
|
|
1969
|
+
"type": "tableRow",
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
"content": [
|
|
1973
|
+
{
|
|
1974
|
+
"attrs": {
|
|
1975
|
+
"colspan": 1,
|
|
1976
|
+
"colwidth": [
|
|
1977
|
+
100,
|
|
1978
|
+
],
|
|
1979
|
+
"rowspan": 1,
|
|
1980
|
+
},
|
|
1981
|
+
"content": [
|
|
1982
|
+
{
|
|
1983
|
+
"content": [
|
|
1984
|
+
{
|
|
1985
|
+
"text": "Table Cell",
|
|
1986
|
+
"type": "text",
|
|
1987
|
+
},
|
|
1988
|
+
],
|
|
1989
|
+
"type": "tableParagraph",
|
|
1990
|
+
},
|
|
1991
|
+
],
|
|
1992
|
+
"type": "tableCell",
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"attrs": {
|
|
1996
|
+
"colspan": 1,
|
|
1997
|
+
"colwidth": [
|
|
1998
|
+
200,
|
|
1999
|
+
],
|
|
2000
|
+
"rowspan": 1,
|
|
2001
|
+
},
|
|
2002
|
+
"content": [
|
|
2003
|
+
{
|
|
2004
|
+
"content": [
|
|
2005
|
+
{
|
|
2006
|
+
"text": "Table Cell",
|
|
2007
|
+
"type": "text",
|
|
2008
|
+
},
|
|
2009
|
+
],
|
|
2010
|
+
"type": "tableParagraph",
|
|
2011
|
+
},
|
|
2012
|
+
],
|
|
2013
|
+
"type": "tableCell",
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
"attrs": {
|
|
2017
|
+
"colspan": 1,
|
|
2018
|
+
"colwidth": [
|
|
2019
|
+
300,
|
|
2020
|
+
],
|
|
2021
|
+
"rowspan": 1,
|
|
2022
|
+
},
|
|
2023
|
+
"content": [
|
|
2024
|
+
{
|
|
2025
|
+
"content": [
|
|
2026
|
+
{
|
|
2027
|
+
"text": "Table Cell",
|
|
2028
|
+
"type": "text",
|
|
2029
|
+
},
|
|
2030
|
+
],
|
|
2031
|
+
"type": "tableParagraph",
|
|
2032
|
+
},
|
|
2033
|
+
],
|
|
2034
|
+
"type": "tableCell",
|
|
2035
|
+
},
|
|
2036
|
+
],
|
|
2037
|
+
"type": "tableRow",
|
|
2038
|
+
},
|
|
2039
|
+
],
|
|
2040
|
+
"type": "table",
|
|
2041
|
+
},
|
|
2042
|
+
],
|
|
2043
|
+
"type": "blockContainer",
|
|
2044
|
+
}
|
|
2045
|
+
`;
|
|
2046
|
+
|
|
2047
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/basic to/from prosemirror 1`] = `
|
|
2048
|
+
{
|
|
2049
|
+
"attrs": {
|
|
2050
|
+
"backgroundColor": "default",
|
|
2051
|
+
"id": "1",
|
|
2052
|
+
"textColor": "default",
|
|
2053
|
+
},
|
|
2054
|
+
"content": [
|
|
2055
|
+
{
|
|
2056
|
+
"content": [
|
|
2057
|
+
{
|
|
2058
|
+
"content": [
|
|
2059
|
+
{
|
|
2060
|
+
"attrs": {
|
|
2061
|
+
"colspan": 1,
|
|
2062
|
+
"colwidth": null,
|
|
2063
|
+
"rowspan": 1,
|
|
2064
|
+
},
|
|
2065
|
+
"content": [
|
|
2066
|
+
{
|
|
2067
|
+
"content": [
|
|
2068
|
+
{
|
|
2069
|
+
"text": "Table Cell",
|
|
2070
|
+
"type": "text",
|
|
2071
|
+
},
|
|
2072
|
+
],
|
|
2073
|
+
"type": "tableParagraph",
|
|
2074
|
+
},
|
|
2075
|
+
],
|
|
2076
|
+
"type": "tableCell",
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
"attrs": {
|
|
2080
|
+
"colspan": 1,
|
|
2081
|
+
"colwidth": null,
|
|
2082
|
+
"rowspan": 1,
|
|
2083
|
+
},
|
|
2084
|
+
"content": [
|
|
2085
|
+
{
|
|
2086
|
+
"content": [
|
|
2087
|
+
{
|
|
2088
|
+
"text": "Table Cell",
|
|
2089
|
+
"type": "text",
|
|
2090
|
+
},
|
|
2091
|
+
],
|
|
2092
|
+
"type": "tableParagraph",
|
|
2093
|
+
},
|
|
2094
|
+
],
|
|
2095
|
+
"type": "tableCell",
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
"attrs": {
|
|
2099
|
+
"colspan": 1,
|
|
2100
|
+
"colwidth": null,
|
|
2101
|
+
"rowspan": 1,
|
|
2102
|
+
},
|
|
2103
|
+
"content": [
|
|
2104
|
+
{
|
|
2105
|
+
"content": [
|
|
2106
|
+
{
|
|
2107
|
+
"text": "Table Cell",
|
|
2108
|
+
"type": "text",
|
|
2109
|
+
},
|
|
2110
|
+
],
|
|
2111
|
+
"type": "tableParagraph",
|
|
2112
|
+
},
|
|
2113
|
+
],
|
|
2114
|
+
"type": "tableCell",
|
|
2115
|
+
},
|
|
2116
|
+
],
|
|
2117
|
+
"type": "tableRow",
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
"content": [
|
|
2121
|
+
{
|
|
2122
|
+
"attrs": {
|
|
2123
|
+
"colspan": 1,
|
|
2124
|
+
"colwidth": null,
|
|
2125
|
+
"rowspan": 1,
|
|
2126
|
+
},
|
|
2127
|
+
"content": [
|
|
2128
|
+
{
|
|
2129
|
+
"content": [
|
|
2130
|
+
{
|
|
2131
|
+
"text": "Table Cell",
|
|
2132
|
+
"type": "text",
|
|
2133
|
+
},
|
|
2134
|
+
],
|
|
2135
|
+
"type": "tableParagraph",
|
|
2136
|
+
},
|
|
2137
|
+
],
|
|
2138
|
+
"type": "tableCell",
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
"attrs": {
|
|
2142
|
+
"colspan": 1,
|
|
2143
|
+
"colwidth": null,
|
|
2144
|
+
"rowspan": 1,
|
|
2145
|
+
},
|
|
2146
|
+
"content": [
|
|
2147
|
+
{
|
|
2148
|
+
"content": [
|
|
2149
|
+
{
|
|
2150
|
+
"text": "Table Cell",
|
|
2151
|
+
"type": "text",
|
|
2152
|
+
},
|
|
2153
|
+
],
|
|
2154
|
+
"type": "tableParagraph",
|
|
2155
|
+
},
|
|
2156
|
+
],
|
|
2157
|
+
"type": "tableCell",
|
|
2158
|
+
},
|
|
2159
|
+
{
|
|
2160
|
+
"attrs": {
|
|
2161
|
+
"colspan": 1,
|
|
2162
|
+
"colwidth": null,
|
|
2163
|
+
"rowspan": 1,
|
|
2164
|
+
},
|
|
2165
|
+
"content": [
|
|
2166
|
+
{
|
|
2167
|
+
"content": [
|
|
2168
|
+
{
|
|
2169
|
+
"text": "Table Cell",
|
|
2170
|
+
"type": "text",
|
|
2171
|
+
},
|
|
2172
|
+
],
|
|
2173
|
+
"type": "tableParagraph",
|
|
2174
|
+
},
|
|
2175
|
+
],
|
|
2176
|
+
"type": "tableCell",
|
|
2177
|
+
},
|
|
2178
|
+
],
|
|
2179
|
+
"type": "tableRow",
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
"content": [
|
|
2183
|
+
{
|
|
2184
|
+
"attrs": {
|
|
2185
|
+
"colspan": 1,
|
|
2186
|
+
"colwidth": null,
|
|
2187
|
+
"rowspan": 1,
|
|
2188
|
+
},
|
|
2189
|
+
"content": [
|
|
2190
|
+
{
|
|
2191
|
+
"content": [
|
|
2192
|
+
{
|
|
2193
|
+
"text": "Table Cell",
|
|
2194
|
+
"type": "text",
|
|
2195
|
+
},
|
|
2196
|
+
],
|
|
2197
|
+
"type": "tableParagraph",
|
|
2198
|
+
},
|
|
2199
|
+
],
|
|
2200
|
+
"type": "tableCell",
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
"attrs": {
|
|
2204
|
+
"colspan": 1,
|
|
2205
|
+
"colwidth": null,
|
|
2206
|
+
"rowspan": 1,
|
|
2207
|
+
},
|
|
2208
|
+
"content": [
|
|
2209
|
+
{
|
|
2210
|
+
"content": [
|
|
2211
|
+
{
|
|
2212
|
+
"text": "Table Cell",
|
|
2213
|
+
"type": "text",
|
|
2214
|
+
},
|
|
2215
|
+
],
|
|
2216
|
+
"type": "tableParagraph",
|
|
2217
|
+
},
|
|
2218
|
+
],
|
|
2219
|
+
"type": "tableCell",
|
|
2220
|
+
},
|
|
2221
|
+
{
|
|
2222
|
+
"attrs": {
|
|
2223
|
+
"colspan": 1,
|
|
2224
|
+
"colwidth": null,
|
|
2225
|
+
"rowspan": 1,
|
|
2226
|
+
},
|
|
2227
|
+
"content": [
|
|
2228
|
+
{
|
|
2229
|
+
"content": [
|
|
2230
|
+
{
|
|
2231
|
+
"text": "Table Cell",
|
|
2232
|
+
"type": "text",
|
|
2233
|
+
},
|
|
2234
|
+
],
|
|
2235
|
+
"type": "tableParagraph",
|
|
2236
|
+
},
|
|
2237
|
+
],
|
|
2238
|
+
"type": "tableCell",
|
|
2239
|
+
},
|
|
2240
|
+
],
|
|
2241
|
+
"type": "tableRow",
|
|
2242
|
+
},
|
|
2243
|
+
],
|
|
2244
|
+
"type": "table",
|
|
2245
|
+
},
|
|
2246
|
+
],
|
|
2247
|
+
"type": "blockContainer",
|
|
2248
|
+
}
|
|
2249
|
+
`;
|
|
2250
|
+
|
|
2251
|
+
exports[`Test BlockNote-Prosemirror conversion > Case: default schema > Convert table/mixedColWidths to/from prosemirror 1`] = `
|
|
2252
|
+
{
|
|
2253
|
+
"attrs": {
|
|
2254
|
+
"backgroundColor": "default",
|
|
2255
|
+
"id": "1",
|
|
2256
|
+
"textColor": "default",
|
|
2257
|
+
},
|
|
2258
|
+
"content": [
|
|
2259
|
+
{
|
|
2260
|
+
"content": [
|
|
2261
|
+
{
|
|
2262
|
+
"content": [
|
|
2263
|
+
{
|
|
2264
|
+
"attrs": {
|
|
2265
|
+
"colspan": 1,
|
|
2266
|
+
"colwidth": [
|
|
2267
|
+
100,
|
|
2268
|
+
],
|
|
2269
|
+
"rowspan": 1,
|
|
2270
|
+
},
|
|
2271
|
+
"content": [
|
|
2272
|
+
{
|
|
2273
|
+
"content": [
|
|
2274
|
+
{
|
|
2275
|
+
"text": "Table Cell",
|
|
2276
|
+
"type": "text",
|
|
2277
|
+
},
|
|
2278
|
+
],
|
|
2279
|
+
"type": "tableParagraph",
|
|
2280
|
+
},
|
|
2281
|
+
],
|
|
2282
|
+
"type": "tableCell",
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
"attrs": {
|
|
2286
|
+
"colspan": 1,
|
|
2287
|
+
"colwidth": null,
|
|
2288
|
+
"rowspan": 1,
|
|
2289
|
+
},
|
|
2290
|
+
"content": [
|
|
2291
|
+
{
|
|
2292
|
+
"content": [
|
|
2293
|
+
{
|
|
2294
|
+
"text": "Table Cell",
|
|
2295
|
+
"type": "text",
|
|
2296
|
+
},
|
|
2297
|
+
],
|
|
2298
|
+
"type": "tableParagraph",
|
|
2299
|
+
},
|
|
2300
|
+
],
|
|
2301
|
+
"type": "tableCell",
|
|
2302
|
+
},
|
|
2303
|
+
{
|
|
2304
|
+
"attrs": {
|
|
2305
|
+
"colspan": 1,
|
|
2306
|
+
"colwidth": [
|
|
2307
|
+
300,
|
|
2308
|
+
],
|
|
2309
|
+
"rowspan": 1,
|
|
2310
|
+
},
|
|
2311
|
+
"content": [
|
|
2312
|
+
{
|
|
2313
|
+
"content": [
|
|
2314
|
+
{
|
|
2315
|
+
"text": "Table Cell",
|
|
2316
|
+
"type": "text",
|
|
2317
|
+
},
|
|
2318
|
+
],
|
|
2319
|
+
"type": "tableParagraph",
|
|
2320
|
+
},
|
|
2321
|
+
],
|
|
2322
|
+
"type": "tableCell",
|
|
2323
|
+
},
|
|
2324
|
+
],
|
|
2325
|
+
"type": "tableRow",
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
"content": [
|
|
2329
|
+
{
|
|
2330
|
+
"attrs": {
|
|
2331
|
+
"colspan": 1,
|
|
2332
|
+
"colwidth": [
|
|
2333
|
+
100,
|
|
2334
|
+
],
|
|
2335
|
+
"rowspan": 1,
|
|
2336
|
+
},
|
|
2337
|
+
"content": [
|
|
2338
|
+
{
|
|
2339
|
+
"content": [
|
|
2340
|
+
{
|
|
2341
|
+
"text": "Table Cell",
|
|
2342
|
+
"type": "text",
|
|
2343
|
+
},
|
|
2344
|
+
],
|
|
2345
|
+
"type": "tableParagraph",
|
|
2346
|
+
},
|
|
2347
|
+
],
|
|
2348
|
+
"type": "tableCell",
|
|
2349
|
+
},
|
|
2350
|
+
{
|
|
2351
|
+
"attrs": {
|
|
2352
|
+
"colspan": 1,
|
|
2353
|
+
"colwidth": null,
|
|
2354
|
+
"rowspan": 1,
|
|
2355
|
+
},
|
|
2356
|
+
"content": [
|
|
2357
|
+
{
|
|
2358
|
+
"content": [
|
|
2359
|
+
{
|
|
2360
|
+
"text": "Table Cell",
|
|
2361
|
+
"type": "text",
|
|
2362
|
+
},
|
|
2363
|
+
],
|
|
2364
|
+
"type": "tableParagraph",
|
|
2365
|
+
},
|
|
2366
|
+
],
|
|
2367
|
+
"type": "tableCell",
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
"attrs": {
|
|
2371
|
+
"colspan": 1,
|
|
2372
|
+
"colwidth": [
|
|
2373
|
+
300,
|
|
2374
|
+
],
|
|
2375
|
+
"rowspan": 1,
|
|
2376
|
+
},
|
|
2377
|
+
"content": [
|
|
2378
|
+
{
|
|
2379
|
+
"content": [
|
|
2380
|
+
{
|
|
2381
|
+
"text": "Table Cell",
|
|
2382
|
+
"type": "text",
|
|
2383
|
+
},
|
|
2384
|
+
],
|
|
2385
|
+
"type": "tableParagraph",
|
|
2386
|
+
},
|
|
2387
|
+
],
|
|
2388
|
+
"type": "tableCell",
|
|
2389
|
+
},
|
|
2390
|
+
],
|
|
2391
|
+
"type": "tableRow",
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
"content": [
|
|
2395
|
+
{
|
|
2396
|
+
"attrs": {
|
|
2397
|
+
"colspan": 1,
|
|
2398
|
+
"colwidth": [
|
|
2399
|
+
100,
|
|
2400
|
+
],
|
|
2401
|
+
"rowspan": 1,
|
|
2402
|
+
},
|
|
2403
|
+
"content": [
|
|
2404
|
+
{
|
|
2405
|
+
"content": [
|
|
2406
|
+
{
|
|
2407
|
+
"text": "Table Cell",
|
|
2408
|
+
"type": "text",
|
|
2409
|
+
},
|
|
2410
|
+
],
|
|
2411
|
+
"type": "tableParagraph",
|
|
2412
|
+
},
|
|
2413
|
+
],
|
|
2414
|
+
"type": "tableCell",
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
"attrs": {
|
|
2418
|
+
"colspan": 1,
|
|
2419
|
+
"colwidth": null,
|
|
2420
|
+
"rowspan": 1,
|
|
2421
|
+
},
|
|
2422
|
+
"content": [
|
|
2423
|
+
{
|
|
2424
|
+
"content": [
|
|
2425
|
+
{
|
|
2426
|
+
"text": "Table Cell",
|
|
2427
|
+
"type": "text",
|
|
2428
|
+
},
|
|
2429
|
+
],
|
|
2430
|
+
"type": "tableParagraph",
|
|
2431
|
+
},
|
|
2432
|
+
],
|
|
2433
|
+
"type": "tableCell",
|
|
2434
|
+
},
|
|
2435
|
+
{
|
|
2436
|
+
"attrs": {
|
|
2437
|
+
"colspan": 1,
|
|
2438
|
+
"colwidth": [
|
|
2439
|
+
300,
|
|
2440
|
+
],
|
|
2441
|
+
"rowspan": 1,
|
|
2442
|
+
},
|
|
2443
|
+
"content": [
|
|
2444
|
+
{
|
|
2445
|
+
"content": [
|
|
2446
|
+
{
|
|
2447
|
+
"text": "Table Cell",
|
|
2448
|
+
"type": "text",
|
|
2449
|
+
},
|
|
2450
|
+
],
|
|
2451
|
+
"type": "tableParagraph",
|
|
2452
|
+
},
|
|
2453
|
+
],
|
|
2454
|
+
"type": "tableCell",
|
|
2455
|
+
},
|
|
2456
|
+
],
|
|
2457
|
+
"type": "tableRow",
|
|
2458
|
+
},
|
|
2459
|
+
],
|
|
2460
|
+
"type": "table",
|
|
2461
|
+
},
|
|
2462
|
+
],
|
|
2463
|
+
"type": "blockContainer",
|
|
2464
|
+
}
|
|
2465
|
+
`;
|