@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
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AnyExtension,
|
|
3
|
+
EditorOptions,
|
|
4
|
+
Extension,
|
|
5
|
+
getSchema,
|
|
6
|
+
Mark,
|
|
7
|
+
Node as TipTapNode,
|
|
8
|
+
} from "@tiptap/core";
|
|
2
9
|
import { Node, Schema } from "prosemirror-model";
|
|
3
10
|
// import "./blocknote.css";
|
|
4
11
|
import * as Y from "yjs";
|
|
@@ -7,6 +14,12 @@ import {
|
|
|
7
14
|
moveBlockDown,
|
|
8
15
|
moveBlockUp,
|
|
9
16
|
} from "../api/blockManipulation/commands/moveBlock/moveBlock.js";
|
|
17
|
+
import {
|
|
18
|
+
canNestBlock,
|
|
19
|
+
canUnnestBlock,
|
|
20
|
+
nestBlock,
|
|
21
|
+
unnestBlock,
|
|
22
|
+
} from "../api/blockManipulation/commands/nestBlock/nestBlock.js";
|
|
10
23
|
import { removeBlocks } from "../api/blockManipulation/commands/removeBlocks/removeBlocks.js";
|
|
11
24
|
import { replaceBlocks } from "../api/blockManipulation/commands/replaceBlocks/replaceBlocks.js";
|
|
12
25
|
import { updateBlock } from "../api/blockManipulation/commands/updateBlock/updateBlock.js";
|
|
@@ -17,7 +30,6 @@ import {
|
|
|
17
30
|
} from "../api/blockManipulation/selections/textCursorPosition/textCursorPosition.js";
|
|
18
31
|
import { createExternalHTMLExporter } from "../api/exporters/html/externalHTMLExporter.js";
|
|
19
32
|
import { blocksToMarkdown } from "../api/exporters/markdown/markdownExporter.js";
|
|
20
|
-
import { getBlockInfoFromSelection } from "../api/getBlockInfoFromPos.js";
|
|
21
33
|
import { HTMLToBlocks } from "../api/parsers/html/parseHTML.js";
|
|
22
34
|
import { markdownToBlocks } from "../api/parsers/markdown/parseMarkdown.js";
|
|
23
35
|
import {
|
|
@@ -42,9 +54,9 @@ import {
|
|
|
42
54
|
InlineContentSchema,
|
|
43
55
|
InlineContentSpecs,
|
|
44
56
|
PartialInlineContent,
|
|
57
|
+
Styles,
|
|
45
58
|
StyleSchema,
|
|
46
59
|
StyleSpecs,
|
|
47
|
-
Styles,
|
|
48
60
|
} from "../schema/index.js";
|
|
49
61
|
import { mergeCSSClasses } from "../util/browser.js";
|
|
50
62
|
import { NoInfer, UnreachableCaseError } from "../util/typescript.js";
|
|
@@ -62,18 +74,22 @@ import {
|
|
|
62
74
|
BlockNoteTipTapEditorOptions,
|
|
63
75
|
} from "./BlockNoteTipTapEditor.js";
|
|
64
76
|
|
|
65
|
-
import { PlaceholderPlugin } from "../extensions/Placeholder/PlaceholderPlugin.js";
|
|
66
77
|
import { Dictionary } from "../i18n/dictionary.js";
|
|
67
78
|
import { en } from "../i18n/locales/index.js";
|
|
68
79
|
|
|
69
|
-
import { Transaction } from "@tiptap/pm/state";
|
|
80
|
+
import { Plugin, Transaction } from "@tiptap/pm/state";
|
|
81
|
+
import { dropCursor } from "prosemirror-dropcursor";
|
|
70
82
|
import { createInternalHTMLSerializer } from "../api/exporters/html/internalHTMLSerializer.js";
|
|
71
83
|
import { inlineContentToNodes } from "../api/nodeConversions/blockToNode.js";
|
|
72
84
|
import { nodeToBlock } from "../api/nodeConversions/nodeToBlock.js";
|
|
73
|
-
import { NodeSelectionKeyboardPlugin } from "../extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js";
|
|
74
|
-
import { PreviousBlockTypePlugin } from "../extensions/PreviousBlockType/PreviousBlockTypePlugin.js";
|
|
75
85
|
import "../style.css";
|
|
76
86
|
|
|
87
|
+
export type BlockNoteExtension =
|
|
88
|
+
| AnyExtension
|
|
89
|
+
| {
|
|
90
|
+
plugin: Plugin;
|
|
91
|
+
};
|
|
92
|
+
|
|
77
93
|
export type BlockNoteEditorOptions<
|
|
78
94
|
BSchema extends BlockSchema,
|
|
79
95
|
ISchema extends InlineContentSchema,
|
|
@@ -86,11 +102,15 @@ export type BlockNoteEditorOptions<
|
|
|
86
102
|
*/
|
|
87
103
|
animations?: boolean;
|
|
88
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Disable internal extensions (based on keys / extension name)
|
|
107
|
+
*/
|
|
89
108
|
disableExtensions: string[];
|
|
109
|
+
|
|
90
110
|
/**
|
|
91
111
|
* A dictionary object containing translations for the editor.
|
|
92
112
|
*/
|
|
93
|
-
dictionary?: Dictionary
|
|
113
|
+
dictionary?: Dictionary & Record<string, any>;
|
|
94
114
|
|
|
95
115
|
/**
|
|
96
116
|
* @deprecated, provide placeholders via dictionary instead
|
|
@@ -167,9 +187,16 @@ export type BlockNoteEditorOptions<
|
|
|
167
187
|
renderCursor?: (user: any) => HTMLElement;
|
|
168
188
|
};
|
|
169
189
|
|
|
170
|
-
|
|
190
|
+
/**
|
|
191
|
+
* additional tiptap options, undocumented
|
|
192
|
+
*/
|
|
171
193
|
_tiptapOptions: Partial<EditorOptions>;
|
|
172
194
|
|
|
195
|
+
/**
|
|
196
|
+
* (experimental) add extra prosemirror plugins or tiptap extensions to the editor
|
|
197
|
+
*/
|
|
198
|
+
_extensions: Record<string, BlockNoteExtension>;
|
|
199
|
+
|
|
173
200
|
trailingBlock?: boolean;
|
|
174
201
|
|
|
175
202
|
/**
|
|
@@ -190,6 +217,8 @@ export type BlockNoteEditorOptions<
|
|
|
190
217
|
* (note that the id is always set on the `data-id` attribute)
|
|
191
218
|
*/
|
|
192
219
|
setIdAttribute?: boolean;
|
|
220
|
+
|
|
221
|
+
dropCursor?: (opts: any) => Plugin;
|
|
193
222
|
};
|
|
194
223
|
|
|
195
224
|
const blockNoteTipTapOptions = {
|
|
@@ -205,6 +234,11 @@ export class BlockNoteEditor<
|
|
|
205
234
|
> {
|
|
206
235
|
private readonly _pmSchema: Schema;
|
|
207
236
|
|
|
237
|
+
/**
|
|
238
|
+
* extensions that are added to the editor, can be tiptap extensions or prosemirror plugins
|
|
239
|
+
*/
|
|
240
|
+
public readonly extensions: Record<string, BlockNoteExtension> = {};
|
|
241
|
+
|
|
208
242
|
/**
|
|
209
243
|
* Boolean indicating whether the editor is in headless mode.
|
|
210
244
|
* Headless mode means we can use features like importing / exporting blocks,
|
|
@@ -236,7 +270,7 @@ export class BlockNoteEditor<
|
|
|
236
270
|
/**
|
|
237
271
|
* The dictionary contains translations for the editor.
|
|
238
272
|
*/
|
|
239
|
-
public readonly dictionary: Dictionary
|
|
273
|
+
public readonly dictionary: Dictionary & Record<string, any>;
|
|
240
274
|
|
|
241
275
|
/**
|
|
242
276
|
* The schema of the editor. The schema defines which Blocks, InlineContent, and Styles are available in the editor.
|
|
@@ -347,17 +381,7 @@ export class BlockNoteEditor<
|
|
|
347
381
|
this.inlineContentImplementations = newOptions.schema.inlineContentSpecs;
|
|
348
382
|
this.styleImplementations = newOptions.schema.styleSpecs;
|
|
349
383
|
|
|
350
|
-
this.
|
|
351
|
-
this.linkToolbar = new LinkToolbarProsemirrorPlugin(this);
|
|
352
|
-
this.sideMenu = new SideMenuProsemirrorPlugin(this);
|
|
353
|
-
this.suggestionMenus = new SuggestionMenuProseMirrorPlugin(this);
|
|
354
|
-
this.filePanel = new FilePanelProsemirrorPlugin(this as any);
|
|
355
|
-
|
|
356
|
-
if (checkDefaultBlockTypeInSchema("table", this)) {
|
|
357
|
-
this.tableHandles = new TableHandlesProsemirrorPlugin(this as any);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
const extensions = getBlockNoteExtensions({
|
|
384
|
+
this.extensions = getBlockNoteExtensions({
|
|
361
385
|
editor: this,
|
|
362
386
|
domAttributes: newOptions.domAttributes || {},
|
|
363
387
|
blockSpecs: this.schema.blockSpecs,
|
|
@@ -367,28 +391,28 @@ export class BlockNoteEditor<
|
|
|
367
391
|
trailingBlock: newOptions.trailingBlock,
|
|
368
392
|
disableExtensions: newOptions.disableExtensions,
|
|
369
393
|
setIdAttribute: newOptions.setIdAttribute,
|
|
394
|
+
animations: newOptions.animations ?? true,
|
|
395
|
+
tableHandles: checkDefaultBlockTypeInSchema("table", this),
|
|
396
|
+
dropCursor: this.options.dropCursor ?? dropCursor,
|
|
397
|
+
placeholders: newOptions.placeholders,
|
|
370
398
|
});
|
|
371
399
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
this.suggestionMenus.plugin,
|
|
381
|
-
...(this.filePanel ? [this.filePanel.plugin] : []),
|
|
382
|
-
...(this.tableHandles ? [this.tableHandles.plugin] : []),
|
|
383
|
-
PlaceholderPlugin(this, newOptions.placeholders),
|
|
384
|
-
NodeSelectionKeyboardPlugin(),
|
|
385
|
-
...(this.options.animations ?? true
|
|
386
|
-
? [PreviousBlockTypePlugin()]
|
|
387
|
-
: []),
|
|
388
|
-
];
|
|
389
|
-
},
|
|
400
|
+
// add extensions from _tiptapOptions
|
|
401
|
+
(newOptions._tiptapOptions?.extensions || []).forEach((ext) => {
|
|
402
|
+
this.extensions[ext.name] = ext;
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
// add extensions from options
|
|
406
|
+
Object.entries(newOptions._extensions || {}).forEach(([key, ext]) => {
|
|
407
|
+
this.extensions[key] = ext;
|
|
390
408
|
});
|
|
391
|
-
|
|
409
|
+
|
|
410
|
+
this.formattingToolbar = this.extensions["formattingToolbar"] as any;
|
|
411
|
+
this.linkToolbar = this.extensions["linkToolbar"] as any;
|
|
412
|
+
this.sideMenu = this.extensions["sideMenu"] as any;
|
|
413
|
+
this.suggestionMenus = this.extensions["suggestionMenus"] as any;
|
|
414
|
+
this.filePanel = this.extensions["filePanel"] as any;
|
|
415
|
+
this.tableHandles = this.extensions["tableHandles"] as any;
|
|
392
416
|
|
|
393
417
|
if (newOptions.uploadFile) {
|
|
394
418
|
const uploadFile = newOptions.uploadFile;
|
|
@@ -439,14 +463,29 @@ export class BlockNoteEditor<
|
|
|
439
463
|
);
|
|
440
464
|
}
|
|
441
465
|
|
|
466
|
+
const tiptapExtensions = [
|
|
467
|
+
...Object.entries(this.extensions).map(([key, ext]) => {
|
|
468
|
+
if (
|
|
469
|
+
ext instanceof Extension ||
|
|
470
|
+
ext instanceof TipTapNode ||
|
|
471
|
+
ext instanceof Mark
|
|
472
|
+
) {
|
|
473
|
+
// tiptap extension
|
|
474
|
+
return ext;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// "blocknote" extensions (prosemirror plugins)
|
|
478
|
+
return Extension.create({
|
|
479
|
+
name: key,
|
|
480
|
+
addProseMirrorPlugins: () => [ext.plugin],
|
|
481
|
+
});
|
|
482
|
+
}),
|
|
483
|
+
];
|
|
442
484
|
const tiptapOptions: BlockNoteTipTapEditorOptions = {
|
|
443
485
|
...blockNoteTipTapOptions,
|
|
444
486
|
...newOptions._tiptapOptions,
|
|
445
487
|
content: initialContent,
|
|
446
|
-
extensions:
|
|
447
|
-
...(newOptions._tiptapOptions?.extensions || []),
|
|
448
|
-
...extensions,
|
|
449
|
-
],
|
|
488
|
+
extensions: tiptapExtensions,
|
|
450
489
|
editorProps: {
|
|
451
490
|
...newOptions._tiptapOptions?.editorProps,
|
|
452
491
|
attributes: {
|
|
@@ -962,41 +1001,28 @@ export class BlockNoteEditor<
|
|
|
962
1001
|
* Checks if the block containing the text cursor can be nested.
|
|
963
1002
|
*/
|
|
964
1003
|
public canNestBlock() {
|
|
965
|
-
|
|
966
|
-
this._tiptapEditor.state
|
|
967
|
-
);
|
|
968
|
-
|
|
969
|
-
return (
|
|
970
|
-
this._tiptapEditor.state.doc.resolve(blockContainer.beforePos)
|
|
971
|
-
.nodeBefore !== null
|
|
972
|
-
);
|
|
1004
|
+
return canNestBlock(this);
|
|
973
1005
|
}
|
|
974
1006
|
|
|
975
1007
|
/**
|
|
976
1008
|
* Nests the block containing the text cursor into the block above it.
|
|
977
1009
|
*/
|
|
978
1010
|
public nestBlock() {
|
|
979
|
-
this
|
|
1011
|
+
nestBlock(this);
|
|
980
1012
|
}
|
|
981
1013
|
|
|
982
1014
|
/**
|
|
983
1015
|
* Checks if the block containing the text cursor is nested.
|
|
984
1016
|
*/
|
|
985
1017
|
public canUnnestBlock() {
|
|
986
|
-
|
|
987
|
-
this._tiptapEditor.state
|
|
988
|
-
);
|
|
989
|
-
|
|
990
|
-
return (
|
|
991
|
-
this._tiptapEditor.state.doc.resolve(blockContainer.beforePos).depth > 1
|
|
992
|
-
);
|
|
1018
|
+
return canUnnestBlock(this);
|
|
993
1019
|
}
|
|
994
1020
|
|
|
995
1021
|
/**
|
|
996
1022
|
* Lifts the block containing the text cursor out of its parent.
|
|
997
1023
|
*/
|
|
998
1024
|
public unnestBlock() {
|
|
999
|
-
this
|
|
1025
|
+
unnestBlock(this);
|
|
1000
1026
|
}
|
|
1001
1027
|
|
|
1002
1028
|
/**
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyExtension, Extension, extensions } from "@tiptap/core";
|
|
2
2
|
|
|
3
|
-
import type { BlockNoteEditor } from "./BlockNoteEditor.js";
|
|
3
|
+
import type { BlockNoteEditor, BlockNoteExtension } from "./BlockNoteEditor.js";
|
|
4
4
|
|
|
5
5
|
import Collaboration from "@tiptap/extension-collaboration";
|
|
6
6
|
import CollaborationCursor from "@tiptap/extension-collaboration-cursor";
|
|
7
|
-
import { Dropcursor } from "@tiptap/extension-dropcursor";
|
|
8
7
|
import { Gapcursor } from "@tiptap/extension-gapcursor";
|
|
9
8
|
import { HardBreak } from "@tiptap/extension-hard-break";
|
|
10
9
|
import { History } from "@tiptap/extension-history";
|
|
11
10
|
import { Link } from "@tiptap/extension-link";
|
|
12
11
|
import { Text } from "@tiptap/extension-text";
|
|
12
|
+
import { Plugin } from "prosemirror-state";
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { createDropFileExtension } from "../api/clipboard/fromClipboard/fileDropExtension.js";
|
|
15
15
|
import { createPasteFromClipboardExtension } from "../api/clipboard/fromClipboard/pasteExtension.js";
|
|
16
16
|
import { createCopyToClipboardExtension } from "../api/clipboard/toClipboard/copyExtension.js";
|
|
17
17
|
import { BackgroundColorExtension } from "../extensions/BackgroundColor/BackgroundColorExtension.js";
|
|
18
|
+
import { FilePanelProsemirrorPlugin } from "../extensions/FilePanel/FilePanelPlugin.js";
|
|
19
|
+
import { FormattingToolbarProsemirrorPlugin } from "../extensions/FormattingToolbar/FormattingToolbarPlugin.js";
|
|
18
20
|
import { KeyboardShortcutsExtension } from "../extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js";
|
|
21
|
+
import { LinkToolbarProsemirrorPlugin } from "../extensions/LinkToolbar/LinkToolbarPlugin.js";
|
|
22
|
+
import { NodeSelectionKeyboardPlugin } from "../extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js";
|
|
23
|
+
import { PlaceholderPlugin } from "../extensions/Placeholder/PlaceholderPlugin.js";
|
|
24
|
+
import { PreviousBlockTypePlugin } from "../extensions/PreviousBlockType/PreviousBlockTypePlugin.js";
|
|
25
|
+
import { SideMenuProsemirrorPlugin } from "../extensions/SideMenu/SideMenuPlugin.js";
|
|
26
|
+
import { SuggestionMenuProseMirrorPlugin } from "../extensions/SuggestionMenu/SuggestionPlugin.js";
|
|
27
|
+
import { TableHandlesProsemirrorPlugin } from "../extensions/TableHandles/TableHandlesPlugin.js";
|
|
19
28
|
import { TextAlignmentExtension } from "../extensions/TextAlignment/TextAlignmentExtension.js";
|
|
20
29
|
import { TextColorExtension } from "../extensions/TextColor/TextColorExtension.js";
|
|
21
30
|
import { TrailingNode } from "../extensions/TrailingNode/TrailingNodeExtension.js";
|
|
@@ -31,14 +40,11 @@ import {
|
|
|
31
40
|
StyleSpecs,
|
|
32
41
|
} from "../schema/index.js";
|
|
33
42
|
|
|
34
|
-
|
|
35
|
-
* Get all the Tiptap extensions BlockNote is configured with by default
|
|
36
|
-
*/
|
|
37
|
-
export const getBlockNoteExtensions = <
|
|
43
|
+
type ExtensionOptions<
|
|
38
44
|
BSchema extends BlockSchema,
|
|
39
45
|
I extends InlineContentSchema,
|
|
40
46
|
S extends StyleSchema
|
|
41
|
-
>
|
|
47
|
+
> = {
|
|
42
48
|
editor: BlockNoteEditor<BSchema, I, S>;
|
|
43
49
|
domAttributes: Partial<BlockNoteDOMAttributes>;
|
|
44
50
|
blockSpecs: BlockSpecs;
|
|
@@ -57,8 +63,77 @@ export const getBlockNoteExtensions = <
|
|
|
57
63
|
};
|
|
58
64
|
disableExtensions: string[] | undefined;
|
|
59
65
|
setIdAttribute?: boolean;
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
animations: boolean;
|
|
67
|
+
tableHandles: boolean;
|
|
68
|
+
dropCursor: (opts: any) => Plugin;
|
|
69
|
+
placeholders: Record<string | "default", string>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get all the Tiptap extensions BlockNote is configured with by default
|
|
74
|
+
*/
|
|
75
|
+
export const getBlockNoteExtensions = <
|
|
76
|
+
BSchema extends BlockSchema,
|
|
77
|
+
I extends InlineContentSchema,
|
|
78
|
+
S extends StyleSchema
|
|
79
|
+
>(
|
|
80
|
+
opts: ExtensionOptions<BSchema, I, S>
|
|
81
|
+
) => {
|
|
82
|
+
const ret: Record<string, BlockNoteExtension> = {};
|
|
83
|
+
const tiptapExtensions = getTipTapExtensions(opts);
|
|
84
|
+
|
|
85
|
+
for (const ext of tiptapExtensions) {
|
|
86
|
+
ret[ext.name] = ext;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Note: this is pretty hardcoded and will break when user provides plugins with same keys.
|
|
90
|
+
// Define name on plugins instead and not make this a map?
|
|
91
|
+
ret["formattingToolbar"] = new FormattingToolbarProsemirrorPlugin(
|
|
92
|
+
opts.editor
|
|
93
|
+
);
|
|
94
|
+
ret["linkToolbar"] = new LinkToolbarProsemirrorPlugin(opts.editor);
|
|
95
|
+
ret["sideMenu"] = new SideMenuProsemirrorPlugin(opts.editor);
|
|
96
|
+
ret["suggestionMenus"] = new SuggestionMenuProseMirrorPlugin(opts.editor);
|
|
97
|
+
ret["filePanel"] = new FilePanelProsemirrorPlugin(opts.editor as any);
|
|
98
|
+
ret["placeholder"] = new PlaceholderPlugin(opts.editor, opts.placeholders);
|
|
99
|
+
|
|
100
|
+
if (opts.animations ?? true) {
|
|
101
|
+
ret["animations"] = new PreviousBlockTypePlugin();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (opts.tableHandles) {
|
|
105
|
+
ret["tableHandles"] = new TableHandlesProsemirrorPlugin(opts.editor as any);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
ret["dropCursor"] = {
|
|
109
|
+
plugin: opts.dropCursor({
|
|
110
|
+
width: 5,
|
|
111
|
+
color: "#ddeeff",
|
|
112
|
+
editor: opts.editor,
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
ret["nodeSelectionKeyboard"] = new NodeSelectionKeyboardPlugin();
|
|
117
|
+
|
|
118
|
+
const disableExtensions: string[] = opts.disableExtensions || [];
|
|
119
|
+
for (const ext of Object.keys(disableExtensions)) {
|
|
120
|
+
delete ret[ext];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return ret;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get all the Tiptap extensions BlockNote is configured with by default
|
|
128
|
+
*/
|
|
129
|
+
const getTipTapExtensions = <
|
|
130
|
+
BSchema extends BlockSchema,
|
|
131
|
+
I extends InlineContentSchema,
|
|
132
|
+
S extends StyleSchema
|
|
133
|
+
>(
|
|
134
|
+
opts: ExtensionOptions<BSchema, I, S>
|
|
135
|
+
) => {
|
|
136
|
+
const tiptapExtensions: AnyExtension[] = [
|
|
62
137
|
extensions.ClipboardTextSerializer,
|
|
63
138
|
extensions.Commands,
|
|
64
139
|
extensions.Editable,
|
|
@@ -70,7 +145,8 @@ export const getBlockNoteExtensions = <
|
|
|
70
145
|
|
|
71
146
|
// DropCursor,
|
|
72
147
|
UniqueID.configure({
|
|
73
|
-
|
|
148
|
+
// everything from bnBlock group (nodes that represent a BlockNote block should have an id)
|
|
149
|
+
types: ["blockContainer", "columnList", "column"],
|
|
74
150
|
setIdAttribute: opts.setIdAttribute,
|
|
75
151
|
}),
|
|
76
152
|
HardBreak.extend({ priority: 10 }),
|
|
@@ -81,6 +157,7 @@ export const getBlockNoteExtensions = <
|
|
|
81
157
|
|
|
82
158
|
// marks:
|
|
83
159
|
Link.extend({
|
|
160
|
+
inclusive: false,
|
|
84
161
|
addKeyboardShortcuts() {
|
|
85
162
|
return {
|
|
86
163
|
"Mod-k": () => {
|
|
@@ -155,7 +232,6 @@ export const getBlockNoteExtensions = <
|
|
|
155
232
|
createPasteFromClipboardExtension(opts.editor),
|
|
156
233
|
createDropFileExtension(opts.editor),
|
|
157
234
|
|
|
158
|
-
Dropcursor.configure({ width: 5, color: "#ddeeff" }),
|
|
159
235
|
// This needs to be at the bottom of this list, because Key events (such as enter, when selecting a /command),
|
|
160
236
|
// should be handled before Enter handlers in other components like splitListItem
|
|
161
237
|
...(opts.trailingBlock === undefined || opts.trailingBlock
|
|
@@ -164,7 +240,7 @@ export const getBlockNoteExtensions = <
|
|
|
164
240
|
];
|
|
165
241
|
|
|
166
242
|
if (opts.collaboration) {
|
|
167
|
-
|
|
243
|
+
tiptapExtensions.push(
|
|
168
244
|
Collaboration.configure({
|
|
169
245
|
fragment: opts.collaboration.fragment,
|
|
170
246
|
})
|
|
@@ -189,7 +265,7 @@ export const getBlockNoteExtensions = <
|
|
|
189
265
|
cursor.insertBefore(nonbreakingSpace2, null);
|
|
190
266
|
return cursor;
|
|
191
267
|
};
|
|
192
|
-
|
|
268
|
+
tiptapExtensions.push(
|
|
193
269
|
CollaborationCursor.configure({
|
|
194
270
|
user: opts.collaboration.user,
|
|
195
271
|
render: opts.collaboration.renderCursor || defaultRender,
|
|
@@ -199,9 +275,8 @@ export const getBlockNoteExtensions = <
|
|
|
199
275
|
}
|
|
200
276
|
} else {
|
|
201
277
|
// disable history extension when collaboration is enabled as Yjs takes care of undo / redo
|
|
202
|
-
|
|
278
|
+
tiptapExtensions.push(History);
|
|
203
279
|
}
|
|
204
280
|
|
|
205
|
-
|
|
206
|
-
return ret.filter((ex) => !disableExtensions.includes(ex.name));
|
|
281
|
+
return tiptapExtensions;
|
|
207
282
|
};
|
|
@@ -24,7 +24,7 @@ export type BlockNoteTipTapEditorOptions = Partial<
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
export class BlockNoteTipTapEditor extends TiptapEditor {
|
|
26
26
|
private _state: EditorState;
|
|
27
|
-
|
|
27
|
+
private _creating = false;
|
|
28
28
|
public static create = (
|
|
29
29
|
options: BlockNoteTipTapEditorOptions,
|
|
30
30
|
styleSchema: StyleSchema
|
|
@@ -151,8 +151,12 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
|
|
|
151
151
|
* Replace the default `createView` method with a custom one - which we call on mount
|
|
152
152
|
*/
|
|
153
153
|
private createViewAlternative() {
|
|
154
|
+
this._creating = true;
|
|
154
155
|
// Without queueMicrotask, custom IC / styles will give a React FlushSync error
|
|
155
156
|
queueMicrotask(() => {
|
|
157
|
+
if (!this._creating) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
156
160
|
this.view = new EditorView(
|
|
157
161
|
{ mount: this.options.element as any }, // use mount option so that we reuse the existing element instead of creating a new one
|
|
158
162
|
{
|
|
@@ -178,6 +182,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
|
|
|
178
182
|
this.commands.focus(this.options.autofocus);
|
|
179
183
|
this.emit("create", { editor: this });
|
|
180
184
|
this.isInitialized = true;
|
|
185
|
+
this._creating = false;
|
|
181
186
|
});
|
|
182
187
|
}
|
|
183
188
|
|
|
@@ -189,6 +194,8 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
|
|
|
189
194
|
public mount = (element?: HTMLElement | null) => {
|
|
190
195
|
if (!element) {
|
|
191
196
|
this.destroy();
|
|
197
|
+
// cancel pending microtask
|
|
198
|
+
this._creating = false;
|
|
192
199
|
} else {
|
|
193
200
|
this.options.element = element;
|
|
194
201
|
// @ts-ignore
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const COLORS_DEFAULT = {
|
|
2
|
+
gray: {
|
|
3
|
+
text: "#9b9a97",
|
|
4
|
+
background: "#ebeced",
|
|
5
|
+
},
|
|
6
|
+
brown: {
|
|
7
|
+
text: "#64473a",
|
|
8
|
+
background: "#e9e5e3",
|
|
9
|
+
},
|
|
10
|
+
red: {
|
|
11
|
+
text: "#e03e3e",
|
|
12
|
+
background: "#fbe4e4",
|
|
13
|
+
},
|
|
14
|
+
orange: {
|
|
15
|
+
text: "#d9730d",
|
|
16
|
+
background: "#f6e9d9",
|
|
17
|
+
},
|
|
18
|
+
yellow: {
|
|
19
|
+
text: "#dfab01",
|
|
20
|
+
background: "#fbf3db",
|
|
21
|
+
},
|
|
22
|
+
green: {
|
|
23
|
+
text: "#4d6461",
|
|
24
|
+
background: "#ddedea",
|
|
25
|
+
},
|
|
26
|
+
blue: {
|
|
27
|
+
text: "#0b6e99",
|
|
28
|
+
background: "#ddebf1",
|
|
29
|
+
},
|
|
30
|
+
purple: {
|
|
31
|
+
text: "#6940a5",
|
|
32
|
+
background: "#eae4f2",
|
|
33
|
+
},
|
|
34
|
+
pink: {
|
|
35
|
+
text: "#ad1a72",
|
|
36
|
+
background: "#f4dfeb",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const COLORS_DARK_MODE_DEFAULT = {
|
|
41
|
+
gray: {
|
|
42
|
+
text: "#bebdb8",
|
|
43
|
+
background: "#9b9a97",
|
|
44
|
+
},
|
|
45
|
+
brown: {
|
|
46
|
+
text: "#8e6552",
|
|
47
|
+
background: "#64473a",
|
|
48
|
+
},
|
|
49
|
+
red: {
|
|
50
|
+
text: "#ec4040",
|
|
51
|
+
background: "#be3434",
|
|
52
|
+
},
|
|
53
|
+
orange: {
|
|
54
|
+
text: "#e3790d",
|
|
55
|
+
background: "#b7600a",
|
|
56
|
+
},
|
|
57
|
+
yellow: {
|
|
58
|
+
text: "#dfab01",
|
|
59
|
+
background: "#b58b00",
|
|
60
|
+
},
|
|
61
|
+
green: {
|
|
62
|
+
text: "#6b8b87",
|
|
63
|
+
background: "#4d6461",
|
|
64
|
+
},
|
|
65
|
+
blue: {
|
|
66
|
+
text: "#0e87bc",
|
|
67
|
+
background: "#0b6e99",
|
|
68
|
+
},
|
|
69
|
+
purple: {
|
|
70
|
+
text: "#8552d7",
|
|
71
|
+
background: "#6940a5",
|
|
72
|
+
},
|
|
73
|
+
pink: {
|
|
74
|
+
text: "#da208f",
|
|
75
|
+
background: "#ad1a72",
|
|
76
|
+
},
|
|
77
|
+
};
|
package/src/editor/editor.css
CHANGED
|
@@ -151,3 +151,13 @@ Tippy popups that are appended to document.body directly
|
|
|
151
151
|
/* if there's no explicit width set and the column is not being resized, set a default width */
|
|
152
152
|
min-width: var(--default-cell-min-width) !important;
|
|
153
153
|
}
|
|
154
|
+
|
|
155
|
+
.prosemirror-dropcursor-block {
|
|
156
|
+
transition-property: top, bottom;
|
|
157
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
158
|
+
transition-duration: 0.15s;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.prosemirror-dropcursor-vertical {
|
|
162
|
+
transition-property: left, right;
|
|
163
|
+
}
|
|
@@ -32,7 +32,10 @@ export function wrapTableRows(f: Fragment, schema: Schema) {
|
|
|
32
32
|
newItems[newItems.length - 1] = newTable;
|
|
33
33
|
} else {
|
|
34
34
|
// create new table to wrap tableRow with
|
|
35
|
-
const newTable = schema.nodes.table.
|
|
35
|
+
const newTable = schema.nodes.table.createChecked(
|
|
36
|
+
undefined,
|
|
37
|
+
f.child(i)
|
|
38
|
+
);
|
|
36
39
|
newItems.push(newTable);
|
|
37
40
|
}
|
|
38
41
|
} else {
|
|
@@ -64,7 +67,7 @@ export function transformPasted(slice: Slice, view: EditorView) {
|
|
|
64
67
|
// (if we remove this if-block, the nesting bug will be fixed, but lists won't be nested correctly)
|
|
65
68
|
if (
|
|
66
69
|
i + 1 < f.childCount &&
|
|
67
|
-
f.child(i + 1).type.
|
|
70
|
+
f.child(i + 1).type.name === "blockGroup" // TODO
|
|
68
71
|
) {
|
|
69
72
|
const nestedChild = f
|
|
70
73
|
.child(i + 1)
|
|
@@ -80,7 +83,7 @@ export function transformPasted(slice: Slice, view: EditorView) {
|
|
|
80
83
|
f = removeChild(f, i + 1);
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
|
-
const container = view.state.schema.nodes.blockContainer.
|
|
86
|
+
const container = view.state.schema.nodes.blockContainer.createChecked(
|
|
84
87
|
undefined,
|
|
85
88
|
content
|
|
86
89
|
);
|