@blocknote/core 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/blocknote.js +3145 -2970
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +9 -9
- 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 +110 -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 +5 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +31 -0
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +71 -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 +111 -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 +165 -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 +145 -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 +113 -0
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +224 -0
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +45 -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 +130 -0
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +1 -0
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +52 -0
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +1 -0
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js +129 -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 +746 -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 +195 -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 +339 -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 +54 -0
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +1 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +84 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -0
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +187 -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 +5 -5
- package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +0 -6
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +2 -0
- package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +0 -5
- 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 +0 -8
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +7 -3
- 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 +439 -2
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +6 -0
- package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +2 -82
- package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +0 -8
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +96 -20
- package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +0 -6
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +8 -4
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +13 -12
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +0 -490
- 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/fromClipboard/acceptedMIMETypes.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +7 -6
- package/src/api/clipboard/toClipboard/copyExtension.ts +1 -1
- package/src/api/exporters/html/htmlConversion.test.ts +1 -4
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +56 -19
- package/src/api/exporters/markdown/markdownExporter.test.ts +1 -4
- package/src/api/getBlockInfoFromPos.ts +125 -80
- package/src/api/nodeConversions/blockToNode.ts +50 -25
- package/src/api/nodeConversions/fragmentToBlocks.ts +18 -0
- package/src/api/nodeConversions/nodeToBlock.ts +24 -21
- package/src/api/nodeUtil.ts +1 -1
- package/src/api/parsers/html/__snapshots__/parse-notion-html.json +1 -2
- package/src/api/testUtil/partialBlockTestUtil.ts +15 -3
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +4 -2
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +5 -4
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +35 -35
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +4 -2
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +14 -12
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +28 -16
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +5 -3
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -4
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +13 -11
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +8 -9
- package/src/blocks/TableBlockContent/TableBlockContent.ts +0 -1
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +4 -2
- package/src/blocks/defaultBlockHelpers.ts +7 -2
- package/src/editor/Block.css +22 -1
- package/src/editor/BlockNoteEditor.test.ts +4 -7
- package/src/editor/BlockNoteEditor.ts +87 -61
- package/src/editor/BlockNoteExtensions.ts +92 -17
- package/src/editor/BlockNoteTipTapEditor.ts +8 -1
- package/src/editor/defaultColors.ts +77 -0
- package/src/editor/editor.css +10 -0
- 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/KeyboardShortcuts/KeyboardShortcutsExtension.ts +233 -53
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +94 -90
- package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +173 -169
- package/src/extensions/SideMenu/SideMenuPlugin.ts +141 -52
- package/src/extensions/SideMenu/dragging.ts +3 -54
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +4 -6
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +1 -1
- package/src/extensions/TrailingNode/TrailingNodeExtension.ts +1 -1
- package/src/extensions/getDraggableBlockFromElement.ts +19 -0
- package/src/i18n/locales/de.ts +5 -5
- package/src/i18n/locales/pt.ts +5 -5
- package/src/index.ts +9 -5
- 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 +1 -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/commands/removeBlocks/removeBlocks.d.ts +0 -3
- package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -0
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +0 -6
- package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
- package/types/src/api/getBlockInfoFromPos.d.ts +38 -13
- 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 +0 -6
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -6
- package/types/src/api/testUtil/cases/customStyles.d.ts +0 -6
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +1 -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 -9
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +1 -0
- package/types/src/blocks/defaultBlocks.d.ts +0 -12
- package/types/src/editor/BlockNoteEditor.d.ts +23 -5
- package/types/src/editor/BlockNoteExtensions.d.ts +14 -7
- 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/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +4 -1
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +4 -1
- package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +4 -5
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +2 -1
- package/types/src/extensions/SideMenu/dragging.d.ts +1 -6
- package/types/src/extensions/getDraggableBlockFromElement.d.ts +5 -0
- package/types/src/index.d.ts +9 -5
- 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 +1 -1
- package/types/src/util/combineByGroup.d.ts +9 -0
- package/dist/angular-html-HQGguTAE.js +0 -33
- package/dist/angular-html-HQGguTAE.js.map +0 -1
- package/dist/angular-ts-q9PqJiJb.js +0 -22
- package/dist/angular-ts-q9PqJiJb.js.map +0 -1
- package/dist/astro-0iWgpDaK.js +0 -17
- package/dist/astro-0iWgpDaK.js.map +0 -1
- package/dist/blade-C3Z8AhvY.js +0 -19
- package/dist/blade-C3Z8AhvY.js.map +0 -1
- package/dist/c-TKJGJdXV.js +0 -7
- package/dist/c-TKJGJdXV.js.map +0 -1
- package/dist/coffee-CN_y6cG3.js +0 -9
- package/dist/coffee-CN_y6cG3.js.map +0 -1
- package/dist/cpp-Be_e67JE.js +0 -19
- package/dist/cpp-Be_e67JE.js.map +0 -1
- package/dist/css-DHLSoXzW.js +0 -7
- package/dist/css-DHLSoXzW.js.map +0 -1
- package/dist/glsl-8qSUIm5B.js +0 -9
- package/dist/glsl-8qSUIm5B.js.map +0 -1
- package/dist/graphql-D7_Dk2ma.js +0 -15
- package/dist/graphql-D7_Dk2ma.js.map +0 -1
- package/dist/haml-S3dmcfEW.js +0 -11
- package/dist/haml-S3dmcfEW.js.map +0 -1
- package/dist/handlebars-DaIrqVg3.js +0 -15
- package/dist/handlebars-DaIrqVg3.js.map +0 -1
- package/dist/html-Bx3A18fV.js +0 -11
- package/dist/html-Bx3A18fV.js.map +0 -1
- package/dist/html-derivative-Cf3KTZBS.js +0 -9
- package/dist/html-derivative-Cf3KTZBS.js.map +0 -1
- package/dist/http-BphR83YX.js +0 -15
- package/dist/http-BphR83YX.js.map +0 -1
- package/dist/imba-CmP25v0O.js +0 -9
- package/dist/imba-CmP25v0O.js.map +0 -1
- package/dist/java-Dg4kxH6C.js +0 -7
- package/dist/java-Dg4kxH6C.js.map +0 -1
- package/dist/javascript-CipAzIn1.js +0 -7
- package/dist/javascript-CipAzIn1.js.map +0 -1
- package/dist/jinja-tioldiz6.js +0 -12
- package/dist/jinja-tioldiz6.js.map +0 -1
- package/dist/jison-DWJFEE_I.js +0 -9
- package/dist/jison-DWJFEE_I.js.map +0 -1
- package/dist/json-_04EL6MS.js +0 -7
- package/dist/json-_04EL6MS.js.map +0 -1
- package/dist/json5-Dwmp5XFI.js +0 -7
- package/dist/json5-Dwmp5XFI.js.map +0 -1
- package/dist/jsonc-LqD5auy0.js +0 -7
- package/dist/jsonc-LqD5auy0.js.map +0 -1
- package/dist/jsonl-B4yVuYQH.js +0 -7
- package/dist/jsonl-B4yVuYQH.js.map +0 -1
- package/dist/jsx-Mg4WaD5k.js +0 -7
- package/dist/jsx-Mg4WaD5k.js.map +0 -1
- package/dist/julia-CWi-ZdpN.js +0 -17
- package/dist/julia-CWi-ZdpN.js.map +0 -1
- package/dist/less-BBvTHIGe.js +0 -7
- package/dist/less-BBvTHIGe.js.map +0 -1
- package/dist/markdown-DAXqtk9a.js +0 -7
- package/dist/markdown-DAXqtk9a.js.map +0 -1
- package/dist/marko-0aaNgUGV.js +0 -15
- package/dist/marko-0aaNgUGV.js.map +0 -1
- package/dist/mdc-hXJ2B4O0.js +0 -13
- package/dist/mdc-hXJ2B4O0.js.map +0 -1
- package/dist/mdx-CSCKbb_f.js +0 -7
- package/dist/mdx-CSCKbb_f.js.map +0 -1
- package/dist/php-B_-4RJ09.js +0 -19
- package/dist/php-B_-4RJ09.js.map +0 -1
- package/dist/postcss-SJfTvo_B.js +0 -7
- package/dist/postcss-SJfTvo_B.js.map +0 -1
- package/dist/pug-3q2tx0nf.js +0 -13
- package/dist/pug-3q2tx0nf.js.map +0 -1
- package/dist/python-Dpup1-fE.js +0 -7
- package/dist/python-Dpup1-fE.js.map +0 -1
- package/dist/r-Chyv38Fv.js +0 -7
- package/dist/r-Chyv38Fv.js.map +0 -1
- package/dist/regexp-BF0hfxNW.js +0 -7
- package/dist/regexp-BF0hfxNW.js.map +0 -1
- package/dist/sass-p2RMoqDT.js +0 -7
- package/dist/sass-p2RMoqDT.js.map +0 -1
- package/dist/scss-DmlHSoOY.js +0 -9
- package/dist/scss-DmlHSoOY.js.map +0 -1
- package/dist/shellscript-CZpPN8_x.js +0 -7
- package/dist/shellscript-CZpPN8_x.js.map +0 -1
- package/dist/sql-DtlkUz2m.js +0 -7
- package/dist/sql-DtlkUz2m.js.map +0 -1
- package/dist/stylus-DEr8eSLm.js +0 -7
- package/dist/stylus-DEr8eSLm.js.map +0 -1
- package/dist/svelte-BRIJF62h.js +0 -15
- package/dist/svelte-BRIJF62h.js.map +0 -1
- package/dist/ts-tags-qkUtuI0N.js +0 -42
- package/dist/ts-tags-qkUtuI0N.js.map +0 -1
- package/dist/tsx-DTfbgJxi.js +0 -7
- package/dist/tsx-DTfbgJxi.js.map +0 -1
- package/dist/typescript-CCd4aQHh.js +0 -7
- package/dist/typescript-CCd4aQHh.js.map +0 -1
- package/dist/vue-B3TdbERm.js +0 -32
- package/dist/vue-B3TdbERm.js.map +0 -1
- package/dist/vue-html-BGmTBZk0.js +0 -11
- package/dist/vue-html-BGmTBZk0.js.map +0 -1
- package/dist/wasm-VDIDph3E.js +0 -7
- package/dist/wasm-VDIDph3E.js.map +0 -1
- package/dist/wgsl-2np_U3Z8.js +0 -7
- package/dist/wgsl-2np_U3Z8.js.map +0 -1
- package/dist/xml-CNyphW9R.js +0 -9
- package/dist/xml-CNyphW9R.js.map +0 -1
- package/dist/yaml-DxFiVFcM.js +0 -7
- package/dist/yaml-DxFiVFcM.js.map +0 -1
package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap
CHANGED
|
@@ -344,7 +344,6 @@ exports[`Test updateBlock > Revert all props 1`] = `
|
|
|
344
344
|
},
|
|
345
345
|
"id": "table-0",
|
|
346
346
|
"props": {
|
|
347
|
-
"backgroundColor": "default",
|
|
348
347
|
"textColor": "default",
|
|
349
348
|
},
|
|
350
349
|
"type": "table",
|
|
@@ -820,7 +819,6 @@ exports[`Test updateBlock > Revert single prop 1`] = `
|
|
|
820
819
|
},
|
|
821
820
|
"id": "table-0",
|
|
822
821
|
"props": {
|
|
823
|
-
"backgroundColor": "default",
|
|
824
822
|
"textColor": "default",
|
|
825
823
|
},
|
|
826
824
|
"type": "table",
|
|
@@ -1296,7 +1294,6 @@ exports[`Test updateBlock > Update all props 1`] = `
|
|
|
1296
1294
|
},
|
|
1297
1295
|
"id": "table-0",
|
|
1298
1296
|
"props": {
|
|
1299
|
-
"backgroundColor": "default",
|
|
1300
1297
|
"textColor": "default",
|
|
1301
1298
|
},
|
|
1302
1299
|
"type": "table",
|
|
@@ -1772,7 +1769,6 @@ exports[`Test updateBlock > Update children 1`] = `
|
|
|
1772
1769
|
},
|
|
1773
1770
|
"id": "table-0",
|
|
1774
1771
|
"props": {
|
|
1775
|
-
"backgroundColor": "default",
|
|
1776
1772
|
"textColor": "default",
|
|
1777
1773
|
},
|
|
1778
1774
|
"type": "table",
|
|
@@ -1904,479 +1900,6 @@ exports[`Test updateBlock > Update children 1`] = `
|
|
|
1904
1900
|
]
|
|
1905
1901
|
`;
|
|
1906
1902
|
|
|
1907
|
-
exports[`Test updateBlock > Update inline content to empty table content 1`] = `
|
|
1908
|
-
[
|
|
1909
|
-
{
|
|
1910
|
-
"children": [],
|
|
1911
|
-
"content": {
|
|
1912
|
-
"columnWidths": [],
|
|
1913
|
-
"rows": [],
|
|
1914
|
-
"type": "tableContent",
|
|
1915
|
-
},
|
|
1916
|
-
"id": "paragraph-0",
|
|
1917
|
-
"props": {
|
|
1918
|
-
"backgroundColor": "default",
|
|
1919
|
-
"textColor": "default",
|
|
1920
|
-
},
|
|
1921
|
-
"type": "table",
|
|
1922
|
-
},
|
|
1923
|
-
{
|
|
1924
|
-
"children": [],
|
|
1925
|
-
"content": [
|
|
1926
|
-
{
|
|
1927
|
-
"styles": {},
|
|
1928
|
-
"text": "Paragraph 1",
|
|
1929
|
-
"type": "text",
|
|
1930
|
-
},
|
|
1931
|
-
],
|
|
1932
|
-
"id": "paragraph-1",
|
|
1933
|
-
"props": {
|
|
1934
|
-
"backgroundColor": "default",
|
|
1935
|
-
"textAlignment": "left",
|
|
1936
|
-
"textColor": "default",
|
|
1937
|
-
},
|
|
1938
|
-
"type": "paragraph",
|
|
1939
|
-
},
|
|
1940
|
-
{
|
|
1941
|
-
"children": [
|
|
1942
|
-
{
|
|
1943
|
-
"children": [
|
|
1944
|
-
{
|
|
1945
|
-
"children": [],
|
|
1946
|
-
"content": [
|
|
1947
|
-
{
|
|
1948
|
-
"styles": {},
|
|
1949
|
-
"text": "Double Nested Paragraph 0",
|
|
1950
|
-
"type": "text",
|
|
1951
|
-
},
|
|
1952
|
-
],
|
|
1953
|
-
"id": "double-nested-paragraph-0",
|
|
1954
|
-
"props": {
|
|
1955
|
-
"backgroundColor": "default",
|
|
1956
|
-
"textAlignment": "left",
|
|
1957
|
-
"textColor": "default",
|
|
1958
|
-
},
|
|
1959
|
-
"type": "paragraph",
|
|
1960
|
-
},
|
|
1961
|
-
],
|
|
1962
|
-
"content": [
|
|
1963
|
-
{
|
|
1964
|
-
"styles": {},
|
|
1965
|
-
"text": "Nested Paragraph 0",
|
|
1966
|
-
"type": "text",
|
|
1967
|
-
},
|
|
1968
|
-
],
|
|
1969
|
-
"id": "nested-paragraph-0",
|
|
1970
|
-
"props": {
|
|
1971
|
-
"backgroundColor": "default",
|
|
1972
|
-
"textAlignment": "left",
|
|
1973
|
-
"textColor": "default",
|
|
1974
|
-
},
|
|
1975
|
-
"type": "paragraph",
|
|
1976
|
-
},
|
|
1977
|
-
],
|
|
1978
|
-
"content": [
|
|
1979
|
-
{
|
|
1980
|
-
"styles": {},
|
|
1981
|
-
"text": "Paragraph with children",
|
|
1982
|
-
"type": "text",
|
|
1983
|
-
},
|
|
1984
|
-
],
|
|
1985
|
-
"id": "paragraph-with-children",
|
|
1986
|
-
"props": {
|
|
1987
|
-
"backgroundColor": "default",
|
|
1988
|
-
"textAlignment": "left",
|
|
1989
|
-
"textColor": "default",
|
|
1990
|
-
},
|
|
1991
|
-
"type": "paragraph",
|
|
1992
|
-
},
|
|
1993
|
-
{
|
|
1994
|
-
"children": [],
|
|
1995
|
-
"content": [
|
|
1996
|
-
{
|
|
1997
|
-
"styles": {},
|
|
1998
|
-
"text": "Paragraph 2",
|
|
1999
|
-
"type": "text",
|
|
2000
|
-
},
|
|
2001
|
-
],
|
|
2002
|
-
"id": "paragraph-2",
|
|
2003
|
-
"props": {
|
|
2004
|
-
"backgroundColor": "default",
|
|
2005
|
-
"textAlignment": "left",
|
|
2006
|
-
"textColor": "default",
|
|
2007
|
-
},
|
|
2008
|
-
"type": "paragraph",
|
|
2009
|
-
},
|
|
2010
|
-
{
|
|
2011
|
-
"children": [],
|
|
2012
|
-
"content": [
|
|
2013
|
-
{
|
|
2014
|
-
"styles": {},
|
|
2015
|
-
"text": "Paragraph with props",
|
|
2016
|
-
"type": "text",
|
|
2017
|
-
},
|
|
2018
|
-
],
|
|
2019
|
-
"id": "paragraph-with-props",
|
|
2020
|
-
"props": {
|
|
2021
|
-
"backgroundColor": "default",
|
|
2022
|
-
"textAlignment": "center",
|
|
2023
|
-
"textColor": "red",
|
|
2024
|
-
},
|
|
2025
|
-
"type": "paragraph",
|
|
2026
|
-
},
|
|
2027
|
-
{
|
|
2028
|
-
"children": [],
|
|
2029
|
-
"content": [
|
|
2030
|
-
{
|
|
2031
|
-
"styles": {},
|
|
2032
|
-
"text": "Paragraph 3",
|
|
2033
|
-
"type": "text",
|
|
2034
|
-
},
|
|
2035
|
-
],
|
|
2036
|
-
"id": "paragraph-3",
|
|
2037
|
-
"props": {
|
|
2038
|
-
"backgroundColor": "default",
|
|
2039
|
-
"textAlignment": "left",
|
|
2040
|
-
"textColor": "default",
|
|
2041
|
-
},
|
|
2042
|
-
"type": "paragraph",
|
|
2043
|
-
},
|
|
2044
|
-
{
|
|
2045
|
-
"children": [],
|
|
2046
|
-
"content": [
|
|
2047
|
-
{
|
|
2048
|
-
"styles": {
|
|
2049
|
-
"bold": true,
|
|
2050
|
-
},
|
|
2051
|
-
"text": "Paragraph",
|
|
2052
|
-
"type": "text",
|
|
2053
|
-
},
|
|
2054
|
-
{
|
|
2055
|
-
"styles": {},
|
|
2056
|
-
"text": " with styled ",
|
|
2057
|
-
"type": "text",
|
|
2058
|
-
},
|
|
2059
|
-
{
|
|
2060
|
-
"styles": {
|
|
2061
|
-
"italic": true,
|
|
2062
|
-
},
|
|
2063
|
-
"text": "content",
|
|
2064
|
-
"type": "text",
|
|
2065
|
-
},
|
|
2066
|
-
],
|
|
2067
|
-
"id": "paragraph-with-styled-content",
|
|
2068
|
-
"props": {
|
|
2069
|
-
"backgroundColor": "default",
|
|
2070
|
-
"textAlignment": "left",
|
|
2071
|
-
"textColor": "default",
|
|
2072
|
-
},
|
|
2073
|
-
"type": "paragraph",
|
|
2074
|
-
},
|
|
2075
|
-
{
|
|
2076
|
-
"children": [],
|
|
2077
|
-
"content": [
|
|
2078
|
-
{
|
|
2079
|
-
"styles": {},
|
|
2080
|
-
"text": "Paragraph 4",
|
|
2081
|
-
"type": "text",
|
|
2082
|
-
},
|
|
2083
|
-
],
|
|
2084
|
-
"id": "paragraph-4",
|
|
2085
|
-
"props": {
|
|
2086
|
-
"backgroundColor": "default",
|
|
2087
|
-
"textAlignment": "left",
|
|
2088
|
-
"textColor": "default",
|
|
2089
|
-
},
|
|
2090
|
-
"type": "paragraph",
|
|
2091
|
-
},
|
|
2092
|
-
{
|
|
2093
|
-
"children": [],
|
|
2094
|
-
"content": [
|
|
2095
|
-
{
|
|
2096
|
-
"styles": {},
|
|
2097
|
-
"text": "Heading 1",
|
|
2098
|
-
"type": "text",
|
|
2099
|
-
},
|
|
2100
|
-
],
|
|
2101
|
-
"id": "heading-0",
|
|
2102
|
-
"props": {
|
|
2103
|
-
"backgroundColor": "default",
|
|
2104
|
-
"level": 1,
|
|
2105
|
-
"textAlignment": "left",
|
|
2106
|
-
"textColor": "default",
|
|
2107
|
-
},
|
|
2108
|
-
"type": "heading",
|
|
2109
|
-
},
|
|
2110
|
-
{
|
|
2111
|
-
"children": [],
|
|
2112
|
-
"content": [
|
|
2113
|
-
{
|
|
2114
|
-
"styles": {},
|
|
2115
|
-
"text": "Paragraph 5",
|
|
2116
|
-
"type": "text",
|
|
2117
|
-
},
|
|
2118
|
-
],
|
|
2119
|
-
"id": "paragraph-5",
|
|
2120
|
-
"props": {
|
|
2121
|
-
"backgroundColor": "default",
|
|
2122
|
-
"textAlignment": "left",
|
|
2123
|
-
"textColor": "default",
|
|
2124
|
-
},
|
|
2125
|
-
"type": "paragraph",
|
|
2126
|
-
},
|
|
2127
|
-
{
|
|
2128
|
-
"children": [],
|
|
2129
|
-
"content": undefined,
|
|
2130
|
-
"id": "image-0",
|
|
2131
|
-
"props": {
|
|
2132
|
-
"backgroundColor": "default",
|
|
2133
|
-
"caption": "",
|
|
2134
|
-
"name": "",
|
|
2135
|
-
"previewWidth": 512,
|
|
2136
|
-
"showPreview": true,
|
|
2137
|
-
"textAlignment": "left",
|
|
2138
|
-
"url": "https://via.placeholder.com/150",
|
|
2139
|
-
},
|
|
2140
|
-
"type": "image",
|
|
2141
|
-
},
|
|
2142
|
-
{
|
|
2143
|
-
"children": [],
|
|
2144
|
-
"content": [
|
|
2145
|
-
{
|
|
2146
|
-
"styles": {},
|
|
2147
|
-
"text": "Paragraph 6",
|
|
2148
|
-
"type": "text",
|
|
2149
|
-
},
|
|
2150
|
-
],
|
|
2151
|
-
"id": "paragraph-6",
|
|
2152
|
-
"props": {
|
|
2153
|
-
"backgroundColor": "default",
|
|
2154
|
-
"textAlignment": "left",
|
|
2155
|
-
"textColor": "default",
|
|
2156
|
-
},
|
|
2157
|
-
"type": "paragraph",
|
|
2158
|
-
},
|
|
2159
|
-
{
|
|
2160
|
-
"children": [],
|
|
2161
|
-
"content": {
|
|
2162
|
-
"columnWidths": [
|
|
2163
|
-
undefined,
|
|
2164
|
-
undefined,
|
|
2165
|
-
undefined,
|
|
2166
|
-
],
|
|
2167
|
-
"rows": [
|
|
2168
|
-
{
|
|
2169
|
-
"cells": [
|
|
2170
|
-
[
|
|
2171
|
-
{
|
|
2172
|
-
"styles": {},
|
|
2173
|
-
"text": "Cell 1",
|
|
2174
|
-
"type": "text",
|
|
2175
|
-
},
|
|
2176
|
-
],
|
|
2177
|
-
[
|
|
2178
|
-
{
|
|
2179
|
-
"styles": {},
|
|
2180
|
-
"text": "Cell 2",
|
|
2181
|
-
"type": "text",
|
|
2182
|
-
},
|
|
2183
|
-
],
|
|
2184
|
-
[
|
|
2185
|
-
{
|
|
2186
|
-
"styles": {},
|
|
2187
|
-
"text": "Cell 3",
|
|
2188
|
-
"type": "text",
|
|
2189
|
-
},
|
|
2190
|
-
],
|
|
2191
|
-
],
|
|
2192
|
-
},
|
|
2193
|
-
{
|
|
2194
|
-
"cells": [
|
|
2195
|
-
[
|
|
2196
|
-
{
|
|
2197
|
-
"styles": {},
|
|
2198
|
-
"text": "Cell 4",
|
|
2199
|
-
"type": "text",
|
|
2200
|
-
},
|
|
2201
|
-
],
|
|
2202
|
-
[
|
|
2203
|
-
{
|
|
2204
|
-
"styles": {},
|
|
2205
|
-
"text": "Cell 5",
|
|
2206
|
-
"type": "text",
|
|
2207
|
-
},
|
|
2208
|
-
],
|
|
2209
|
-
[
|
|
2210
|
-
{
|
|
2211
|
-
"styles": {},
|
|
2212
|
-
"text": "Cell 6",
|
|
2213
|
-
"type": "text",
|
|
2214
|
-
},
|
|
2215
|
-
],
|
|
2216
|
-
],
|
|
2217
|
-
},
|
|
2218
|
-
{
|
|
2219
|
-
"cells": [
|
|
2220
|
-
[
|
|
2221
|
-
{
|
|
2222
|
-
"styles": {},
|
|
2223
|
-
"text": "Cell 7",
|
|
2224
|
-
"type": "text",
|
|
2225
|
-
},
|
|
2226
|
-
],
|
|
2227
|
-
[
|
|
2228
|
-
{
|
|
2229
|
-
"styles": {},
|
|
2230
|
-
"text": "Cell 8",
|
|
2231
|
-
"type": "text",
|
|
2232
|
-
},
|
|
2233
|
-
],
|
|
2234
|
-
[
|
|
2235
|
-
{
|
|
2236
|
-
"styles": {},
|
|
2237
|
-
"text": "Cell 9",
|
|
2238
|
-
"type": "text",
|
|
2239
|
-
},
|
|
2240
|
-
],
|
|
2241
|
-
],
|
|
2242
|
-
},
|
|
2243
|
-
],
|
|
2244
|
-
"type": "tableContent",
|
|
2245
|
-
},
|
|
2246
|
-
"id": "table-0",
|
|
2247
|
-
"props": {
|
|
2248
|
-
"backgroundColor": "default",
|
|
2249
|
-
"textColor": "default",
|
|
2250
|
-
},
|
|
2251
|
-
"type": "table",
|
|
2252
|
-
},
|
|
2253
|
-
{
|
|
2254
|
-
"children": [],
|
|
2255
|
-
"content": [
|
|
2256
|
-
{
|
|
2257
|
-
"styles": {},
|
|
2258
|
-
"text": "Paragraph 7",
|
|
2259
|
-
"type": "text",
|
|
2260
|
-
},
|
|
2261
|
-
],
|
|
2262
|
-
"id": "paragraph-7",
|
|
2263
|
-
"props": {
|
|
2264
|
-
"backgroundColor": "default",
|
|
2265
|
-
"textAlignment": "left",
|
|
2266
|
-
"textColor": "default",
|
|
2267
|
-
},
|
|
2268
|
-
"type": "paragraph",
|
|
2269
|
-
},
|
|
2270
|
-
{
|
|
2271
|
-
"children": [],
|
|
2272
|
-
"content": [],
|
|
2273
|
-
"id": "empty-paragraph",
|
|
2274
|
-
"props": {
|
|
2275
|
-
"backgroundColor": "default",
|
|
2276
|
-
"textAlignment": "left",
|
|
2277
|
-
"textColor": "default",
|
|
2278
|
-
},
|
|
2279
|
-
"type": "paragraph",
|
|
2280
|
-
},
|
|
2281
|
-
{
|
|
2282
|
-
"children": [],
|
|
2283
|
-
"content": [
|
|
2284
|
-
{
|
|
2285
|
-
"styles": {},
|
|
2286
|
-
"text": "Paragraph 8",
|
|
2287
|
-
"type": "text",
|
|
2288
|
-
},
|
|
2289
|
-
],
|
|
2290
|
-
"id": "paragraph-8",
|
|
2291
|
-
"props": {
|
|
2292
|
-
"backgroundColor": "default",
|
|
2293
|
-
"textAlignment": "left",
|
|
2294
|
-
"textColor": "default",
|
|
2295
|
-
},
|
|
2296
|
-
"type": "paragraph",
|
|
2297
|
-
},
|
|
2298
|
-
{
|
|
2299
|
-
"children": [
|
|
2300
|
-
{
|
|
2301
|
-
"children": [
|
|
2302
|
-
{
|
|
2303
|
-
"children": [],
|
|
2304
|
-
"content": [
|
|
2305
|
-
{
|
|
2306
|
-
"styles": {},
|
|
2307
|
-
"text": "Double Nested Paragraph 1",
|
|
2308
|
-
"type": "text",
|
|
2309
|
-
},
|
|
2310
|
-
],
|
|
2311
|
-
"id": "double-nested-paragraph-1",
|
|
2312
|
-
"props": {
|
|
2313
|
-
"backgroundColor": "default",
|
|
2314
|
-
"textAlignment": "left",
|
|
2315
|
-
"textColor": "default",
|
|
2316
|
-
},
|
|
2317
|
-
"type": "paragraph",
|
|
2318
|
-
},
|
|
2319
|
-
],
|
|
2320
|
-
"content": [
|
|
2321
|
-
{
|
|
2322
|
-
"styles": {},
|
|
2323
|
-
"text": "Nested Paragraph 1",
|
|
2324
|
-
"type": "text",
|
|
2325
|
-
},
|
|
2326
|
-
],
|
|
2327
|
-
"id": "nested-paragraph-1",
|
|
2328
|
-
"props": {
|
|
2329
|
-
"backgroundColor": "default",
|
|
2330
|
-
"textAlignment": "left",
|
|
2331
|
-
"textColor": "default",
|
|
2332
|
-
},
|
|
2333
|
-
"type": "paragraph",
|
|
2334
|
-
},
|
|
2335
|
-
],
|
|
2336
|
-
"content": [
|
|
2337
|
-
{
|
|
2338
|
-
"styles": {
|
|
2339
|
-
"bold": true,
|
|
2340
|
-
},
|
|
2341
|
-
"text": "Heading",
|
|
2342
|
-
"type": "text",
|
|
2343
|
-
},
|
|
2344
|
-
{
|
|
2345
|
-
"styles": {},
|
|
2346
|
-
"text": " with styled ",
|
|
2347
|
-
"type": "text",
|
|
2348
|
-
},
|
|
2349
|
-
{
|
|
2350
|
-
"styles": {
|
|
2351
|
-
"italic": true,
|
|
2352
|
-
},
|
|
2353
|
-
"text": "content",
|
|
2354
|
-
"type": "text",
|
|
2355
|
-
},
|
|
2356
|
-
],
|
|
2357
|
-
"id": "heading-with-everything",
|
|
2358
|
-
"props": {
|
|
2359
|
-
"backgroundColor": "red",
|
|
2360
|
-
"level": 2,
|
|
2361
|
-
"textAlignment": "center",
|
|
2362
|
-
"textColor": "red",
|
|
2363
|
-
},
|
|
2364
|
-
"type": "heading",
|
|
2365
|
-
},
|
|
2366
|
-
{
|
|
2367
|
-
"children": [],
|
|
2368
|
-
"content": [],
|
|
2369
|
-
"id": "trailing-paragraph",
|
|
2370
|
-
"props": {
|
|
2371
|
-
"backgroundColor": "default",
|
|
2372
|
-
"textAlignment": "left",
|
|
2373
|
-
"textColor": "default",
|
|
2374
|
-
},
|
|
2375
|
-
"type": "paragraph",
|
|
2376
|
-
},
|
|
2377
|
-
]
|
|
2378
|
-
`;
|
|
2379
|
-
|
|
2380
1903
|
exports[`Test updateBlock > Update inline content to no content 1`] = `
|
|
2381
1904
|
[
|
|
2382
1905
|
{
|
|
@@ -2719,7 +2242,6 @@ exports[`Test updateBlock > Update inline content to no content 1`] = `
|
|
|
2719
2242
|
},
|
|
2720
2243
|
"id": "table-0",
|
|
2721
2244
|
"props": {
|
|
2722
|
-
"backgroundColor": "default",
|
|
2723
2245
|
"textColor": "default",
|
|
2724
2246
|
},
|
|
2725
2247
|
"type": "table",
|
|
@@ -2942,7 +2464,6 @@ exports[`Test updateBlock > Update inline content to table content 1`] = `
|
|
|
2942
2464
|
},
|
|
2943
2465
|
"id": "paragraph-0",
|
|
2944
2466
|
"props": {
|
|
2945
|
-
"backgroundColor": "default",
|
|
2946
2467
|
"textColor": "default",
|
|
2947
2468
|
},
|
|
2948
2469
|
"type": "table",
|
|
@@ -3272,7 +2793,6 @@ exports[`Test updateBlock > Update inline content to table content 1`] = `
|
|
|
3272
2793
|
},
|
|
3273
2794
|
"id": "table-0",
|
|
3274
2795
|
"props": {
|
|
3275
|
-
"backgroundColor": "default",
|
|
3276
2796
|
"textColor": "default",
|
|
3277
2797
|
},
|
|
3278
2798
|
"type": "table",
|
|
@@ -3744,7 +3264,6 @@ exports[`Test updateBlock > Update no content to empty inline content 1`] = `
|
|
|
3744
3264
|
},
|
|
3745
3265
|
"id": "table-0",
|
|
3746
3266
|
"props": {
|
|
3747
|
-
"backgroundColor": "default",
|
|
3748
3267
|
"textColor": "default",
|
|
3749
3268
|
},
|
|
3750
3269
|
"type": "table",
|
|
@@ -4108,7 +3627,6 @@ exports[`Test updateBlock > Update no content to empty table content 1`] = `
|
|
|
4108
3627
|
},
|
|
4109
3628
|
"id": "image-0",
|
|
4110
3629
|
"props": {
|
|
4111
|
-
"backgroundColor": "default",
|
|
4112
3630
|
"textColor": "default",
|
|
4113
3631
|
},
|
|
4114
3632
|
"type": "table",
|
|
@@ -4219,7 +3737,6 @@ exports[`Test updateBlock > Update no content to empty table content 1`] = `
|
|
|
4219
3737
|
},
|
|
4220
3738
|
"id": "table-0",
|
|
4221
3739
|
"props": {
|
|
4222
|
-
"backgroundColor": "default",
|
|
4223
3740
|
"textColor": "default",
|
|
4224
3741
|
},
|
|
4225
3742
|
"type": "table",
|
|
@@ -4697,7 +4214,6 @@ exports[`Test updateBlock > Update no content to inline content 1`] = `
|
|
|
4697
4214
|
},
|
|
4698
4215
|
"id": "table-0",
|
|
4699
4216
|
"props": {
|
|
4700
|
-
"backgroundColor": "default",
|
|
4701
4217
|
"textColor": "default",
|
|
4702
4218
|
},
|
|
4703
4219
|
"type": "table",
|
|
@@ -5141,7 +4657,6 @@ exports[`Test updateBlock > Update no content to table content 1`] = `
|
|
|
5141
4657
|
},
|
|
5142
4658
|
"id": "image-0",
|
|
5143
4659
|
"props": {
|
|
5144
|
-
"backgroundColor": "default",
|
|
5145
4660
|
"textColor": "default",
|
|
5146
4661
|
},
|
|
5147
4662
|
"type": "table",
|
|
@@ -5252,7 +4767,6 @@ exports[`Test updateBlock > Update no content to table content 1`] = `
|
|
|
5252
4767
|
},
|
|
5253
4768
|
"id": "table-0",
|
|
5254
4769
|
"props": {
|
|
5255
|
-
"backgroundColor": "default",
|
|
5256
4770
|
"textColor": "default",
|
|
5257
4771
|
},
|
|
5258
4772
|
"type": "table",
|
|
@@ -5728,7 +5242,6 @@ exports[`Test updateBlock > Update single prop 1`] = `
|
|
|
5728
5242
|
},
|
|
5729
5243
|
"id": "table-0",
|
|
5730
5244
|
"props": {
|
|
5731
|
-
"backgroundColor": "default",
|
|
5732
5245
|
"textColor": "default",
|
|
5733
5246
|
},
|
|
5734
5247
|
"type": "table",
|
|
@@ -7393,7 +6906,6 @@ exports[`Test updateBlock > Update type 1`] = `
|
|
|
7393
6906
|
},
|
|
7394
6907
|
"id": "table-0",
|
|
7395
6908
|
"props": {
|
|
7396
|
-
"backgroundColor": "default",
|
|
7397
6909
|
"textColor": "default",
|
|
7398
6910
|
},
|
|
7399
6911
|
"type": "table",
|
|
@@ -7868,7 +7380,6 @@ exports[`Test updateBlock > Update with plain content 1`] = `
|
|
|
7868
7380
|
},
|
|
7869
7381
|
"id": "table-0",
|
|
7870
7382
|
"props": {
|
|
7871
|
-
"backgroundColor": "default",
|
|
7872
7383
|
"textColor": "default",
|
|
7873
7384
|
},
|
|
7874
7385
|
"type": "table",
|
|
@@ -8330,7 +7841,6 @@ exports[`Test updateBlock > Update with styled content 1`] = `
|
|
|
8330
7841
|
},
|
|
8331
7842
|
"id": "table-0",
|
|
8332
7843
|
"props": {
|
|
8333
|
-
"backgroundColor": "default",
|
|
8334
7844
|
"textColor": "default",
|
|
8335
7845
|
},
|
|
8336
7846
|
"type": "table",
|
|
@@ -189,11 +189,11 @@ describe("Test updateBlock", () => {
|
|
|
189
189
|
});
|
|
190
190
|
|
|
191
191
|
it("Update inline content to empty table content", () => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
expect(() => {
|
|
193
|
+
updateBlock(getEditor(), "paragraph-0", {
|
|
194
|
+
type: "table",
|
|
195
|
+
});
|
|
196
|
+
}).toThrow();
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
it("Update table content to empty inline content", () => {
|