@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/pm-nodes/README.md
CHANGED
|
@@ -2,41 +2,140 @@
|
|
|
2
2
|
|
|
3
3
|
Defines the prosemirror nodes and base node structure. See below:
|
|
4
4
|
|
|
5
|
+
# Block structure
|
|
6
|
+
|
|
7
|
+
In the BlockNote API, recall that blocks look like this:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
{
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
children: Block[];
|
|
14
|
+
content: InlineContent[] | undefined;
|
|
15
|
+
props: Record<string, any>;
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`children` describes child blocks that have their own `id` and also map to a `Block` type. Most of the cases these are nested blocks, but they can also be blocks within a `column` or `columnList`.
|
|
20
|
+
|
|
21
|
+
`content` is the block's Inline Content. Inline content doesn't have any `id`, it's "loose" content within the node.
|
|
22
|
+
|
|
23
|
+
This is a bit different from the Prosemirror structure we use internally. This document describes the Prosemirror schema architecture.
|
|
5
24
|
|
|
6
25
|
# Node structure
|
|
7
26
|
|
|
8
|
-
|
|
27
|
+
## BlockGroup
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
name: "blockGroup",
|
|
31
|
+
group: "childContainer",
|
|
32
|
+
content: "blockGroupChild+"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A `blockGroup` is a container node that can contain multiple Blocks. It is used as:
|
|
36
|
+
|
|
37
|
+
- The root node of the Prosemirror document
|
|
38
|
+
- When a block has nested children, they are wrapped in a `blockGroup`
|
|
39
|
+
|
|
40
|
+
## BlockContainer
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
name: "blockContainer",
|
|
44
|
+
group: "blockGroupChild bnBlock",
|
|
45
|
+
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
46
|
+
content: "blockContent blockGroup?",
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
A `blockContainer` is a container node that always contains a `blockContent` node, and optionally a `blockGroup` node (for nested children). It is used as the wrapper for most blocks. This structure makes it possible to nest blocks within blocks.
|
|
50
|
+
|
|
51
|
+
### BlockContent (group)
|
|
52
|
+
|
|
53
|
+
Example:
|
|
9
54
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
55
|
+
```typescript
|
|
56
|
+
name: "paragraph", // name corresponds to the block type in the BlockNote API
|
|
57
|
+
content: "inline*", // can also be no content (for image blocks)
|
|
58
|
+
group: "blockContent",
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Blocks that are part of the `blockContent` group define the appearance / behaviour of the main element of the block (i.e.: headings, paragraphs, list items, etc.).
|
|
62
|
+
These are only used for "regular" blocks that are represented as `blockContainer` nodes.
|
|
63
|
+
|
|
64
|
+
## Multi-column
|
|
65
|
+
|
|
66
|
+
The `multi-column` package makes it possible to order blocks side by side in
|
|
67
|
+
columns. It adds the `columnList` and `column` nodes to the schema.
|
|
68
|
+
|
|
69
|
+
### ColumnList
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
name: "columnList",
|
|
73
|
+
group: "childContainer bnBlock blockGroupChild",
|
|
74
|
+
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
75
|
+
content: "column column+", // min two columns
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The column list contains 2 or more columns.
|
|
13
79
|
|
|
14
|
-
|
|
80
|
+
### Column
|
|
15
81
|
|
|
16
|
-
|
|
17
|
-
|
|
82
|
+
```typescript
|
|
83
|
+
name: "column",
|
|
84
|
+
group: "bnBlock childContainer",
|
|
85
|
+
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
86
|
+
content: "blockContainer+",
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The column contains 1 or more block containers.
|
|
90
|
+
|
|
91
|
+
# Groups
|
|
92
|
+
|
|
93
|
+
We use Prosemirror "groups" to help organize this schema. Here is a list of the different groups:
|
|
18
94
|
|
|
19
|
-
|
|
95
|
+
- `blockContent`: described above (contain the content for blocks that are represented as `BlockContainer` nodes)
|
|
96
|
+
- `blockGroupChild`: anything that is allowed inside a `blockGroup`. In practice, `blockContainer` and `columnList`
|
|
97
|
+
- `childContainer`: think of this as the container node that can hold nodes corresponding to `block.children` in the BlockNote API. So for regular blocks, this is the `BlockGroup`, but for columns, both `columnList` and `column` are considered to be `childContainer` nodes.
|
|
98
|
+
- `bnBlock`: think of this as the node that directly maps to a `Block` in the BlockNote API. For example, this node will store the `id`. Both `blockContainer`, `column` and `columnList` are part of this group.
|
|
99
|
+
|
|
100
|
+
_Note that the last two groups, `bnBlock` and `childContainer`, are not used anywhere in the schema. They are however helpful while programming. For example, we can check whether a node is a `bnBlock`, and then we know it corresponds to a BlockNote Block. Or, we can check whether a node is a `childContainer`, and then we know it's a container of a BlockNote Block's `children`. See `getBlockInfoFromPos` for an example of how this is used._
|
|
101
|
+
|
|
102
|
+
## Example document
|
|
20
103
|
|
|
21
104
|
```xml
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
</
|
|
29
|
-
</
|
|
30
|
-
</
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
</
|
|
37
|
-
</
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
</
|
|
41
|
-
|
|
105
|
+
<blockGroup>
|
|
106
|
+
<blockContaine id="0">
|
|
107
|
+
<blockContent>Parent element 1</blockContent>
|
|
108
|
+
<blockGroup>
|
|
109
|
+
<blockContainer id="1">
|
|
110
|
+
<blockContent>Nested / child / indented item</blockContent>
|
|
111
|
+
</blockContainer>
|
|
112
|
+
</blockGroup>
|
|
113
|
+
</blockContainer>
|
|
114
|
+
<blockContainer id="2">
|
|
115
|
+
<blockContent>Parent element 2</blockContent>
|
|
116
|
+
<blockGroup>
|
|
117
|
+
<blockContainer id="3">...</blockContainer>
|
|
118
|
+
<blockContainer id="4">...</blockContainer>
|
|
119
|
+
</blockGroup>
|
|
120
|
+
</blockContainer>
|
|
121
|
+
<blockContainer id="5">
|
|
122
|
+
<blockContent>Element 3 without children</blockContent>
|
|
123
|
+
</blockContainer>
|
|
124
|
+
<columnList id="6">
|
|
125
|
+
<column id="7">
|
|
126
|
+
<blockContainer id="8">
|
|
127
|
+
<blockContent>Column 1</blockContent>
|
|
128
|
+
</blockContainer>
|
|
129
|
+
</column>
|
|
130
|
+
<column id="9">
|
|
131
|
+
<blockContainer id="10">
|
|
132
|
+
<blockContent>Column 2</blockContent>
|
|
133
|
+
</blockContainer>
|
|
134
|
+
</column>
|
|
135
|
+
</columnList>
|
|
136
|
+
</blockGroup>
|
|
42
137
|
```
|
|
138
|
+
|
|
139
|
+
## Tables
|
|
140
|
+
|
|
141
|
+
Tables are implemented a special type of blockContent node. The rows and columns are stored in the `content` fields, not in the `children`. This is because children of tables (rows / columns / cells) are not considered to be blocks (they don't have an id, for example).
|
|
@@ -137,7 +137,10 @@ export function createBlockSpec<
|
|
|
137
137
|
T extends CustomBlockConfig,
|
|
138
138
|
I extends InlineContentSchema,
|
|
139
139
|
S extends StyleSchema
|
|
140
|
-
>(
|
|
140
|
+
>(
|
|
141
|
+
blockConfig: T,
|
|
142
|
+
blockImplementation: CustomBlockImplementation<NoInfer<T>, I, S>
|
|
143
|
+
) {
|
|
141
144
|
const node = createStronglyTypedTiptapNode({
|
|
142
145
|
name: blockConfig.type as T["type"],
|
|
143
146
|
content: (blockConfig.content === "inline"
|
|
@@ -201,12 +201,22 @@ export function wrapInBlockStructure<
|
|
|
201
201
|
// Helper type to keep track of the `name` and `content` properties after calling Node.create.
|
|
202
202
|
type StronglyTypedTipTapNode<
|
|
203
203
|
Name extends string,
|
|
204
|
-
Content extends
|
|
204
|
+
Content extends
|
|
205
|
+
| "inline*"
|
|
206
|
+
| "tableRow+"
|
|
207
|
+
| "blockContainer+"
|
|
208
|
+
| "column column+"
|
|
209
|
+
| ""
|
|
205
210
|
> = Node & { name: Name; config: { content: Content } };
|
|
206
211
|
|
|
207
212
|
export function createStronglyTypedTiptapNode<
|
|
208
213
|
Name extends string,
|
|
209
|
-
Content extends
|
|
214
|
+
Content extends
|
|
215
|
+
| "inline*"
|
|
216
|
+
| "tableRow+"
|
|
217
|
+
| "blockContainer+"
|
|
218
|
+
| "column column+"
|
|
219
|
+
| ""
|
|
210
220
|
>(config: NodeConfig & { name: Name; content: Content }) {
|
|
211
221
|
return Node.create(config) as StronglyTypedTipTapNode<Name, Content>; // force re-typing (should be safe as it's type-checked from the config)
|
|
212
222
|
}
|
|
@@ -104,7 +104,7 @@ export type BlockSpec<
|
|
|
104
104
|
S extends StyleSchema
|
|
105
105
|
> = {
|
|
106
106
|
config: T;
|
|
107
|
-
implementation: TiptapBlockImplementation<T
|
|
107
|
+
implementation: TiptapBlockImplementation<NoInfer<T>, B, I, S>;
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
// Utility type. For a given object block schema, ensures that the key of each
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combines items by group. This can be used to combine multiple slash menu item arrays,
|
|
3
|
+
* while making sure that items from the same group are adjacent to each other.
|
|
4
|
+
*/
|
|
5
|
+
export function combineByGroup<T extends { group?: string }>(
|
|
6
|
+
items: T[],
|
|
7
|
+
...additionalItemsArray: {
|
|
8
|
+
group?: string;
|
|
9
|
+
}[][]
|
|
10
|
+
) {
|
|
11
|
+
const combinedItems = [...items];
|
|
12
|
+
for (const additionalItems of additionalItemsArray) {
|
|
13
|
+
for (const additionalItem of additionalItems) {
|
|
14
|
+
const lastItemWithSameGroup = combinedItems.findLastIndex(
|
|
15
|
+
(item) => item.group === additionalItem.group
|
|
16
|
+
);
|
|
17
|
+
if (lastItemWithSameGroup === -1) {
|
|
18
|
+
combinedItems.push(additionalItem as T);
|
|
19
|
+
} else {
|
|
20
|
+
combinedItems.splice(lastItemWithSameGroup + 1, 0, additionalItem as T);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return combinedItems;
|
|
25
|
+
}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
import { Node
|
|
1
|
+
import { Node } from "prosemirror-model";
|
|
2
2
|
import { EditorState } from "prosemirror-state";
|
|
3
|
-
|
|
3
|
+
import { BlockInfo } from "../../../getBlockInfoFromPos.js";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the block info from the parent block
|
|
6
|
+
* or undefined if we're at the root
|
|
7
|
+
*/
|
|
8
|
+
export declare const getParentBlockInfo: (doc: Node, beforePos: number) => BlockInfo | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the block info from the sibling block before (above) the given block,
|
|
11
|
+
* or undefined if the given block is the first sibling.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getPrevBlockInfo: (doc: Node, beforePos: number) => BlockInfo | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* If a block has children like this:
|
|
16
|
+
* A
|
|
17
|
+
* - B
|
|
18
|
+
* - C
|
|
19
|
+
* -- D
|
|
20
|
+
*
|
|
21
|
+
* Then the bottom nested block returned is D.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getBottomNestedBlockInfo: (doc: Node, blockInfo: BlockInfo) => BlockInfo;
|
|
4
24
|
export declare const mergeBlocksCommand: (posBetweenBlocks: number) => ({ state, dispatch, }: {
|
|
5
25
|
state: EditorState;
|
|
6
26
|
dispatch: ((args?: any) => any) | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
|
|
2
|
+
export declare function nestBlock(editor: BlockNoteEditor<any, any, any>): boolean;
|
|
3
|
+
export declare function unnestBlock(editor: BlockNoteEditor<any, any, any>): void;
|
|
4
|
+
export declare function canNestBlock(editor: BlockNoteEditor<any, any, any>): boolean;
|
|
5
|
+
export declare function canUnnestBlock(editor: BlockNoteEditor<any, any, any>): boolean;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Node } from "prosemirror-model";
|
|
2
|
-
import { Transaction } from "prosemirror-state";
|
|
3
1
|
import { Block } from "../../../../blocks/defaultBlocks.js";
|
|
4
2
|
import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor";
|
|
5
3
|
import { BlockIdentifier, BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
|
|
6
|
-
export declare function removeBlocksWithCallback<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocksToRemove: BlockIdentifier[], callback?: (node: Node, pos: number, tr: Transaction, removedSize: number) => number): Block<BSchema, I, S>[];
|
|
7
4
|
export declare function removeBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocksToRemove: BlockIdentifier[]): Block<BSchema, I, S>[];
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Block, PartialBlock } from "../../../../blocks/defaultBlocks.js";
|
|
2
2
|
import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor";
|
|
3
3
|
import { BlockIdentifier, BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
|
|
4
|
+
export declare function removeAndInsertBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocksToRemove: BlockIdentifier[], blocksToInsert: PartialBlock<BSchema, I, S>[]): {
|
|
5
|
+
insertedBlocks: Block<BSchema, I, S>[];
|
|
6
|
+
removedBlocks: Block<BSchema, I, S>[];
|
|
7
|
+
};
|
|
4
8
|
export declare function replaceBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocksToRemove: BlockIdentifier[], blocksToInsert: PartialBlock<BSchema, I, S>[]): {
|
|
5
9
|
insertedBlocks: Block<BSchema, I, S>[];
|
|
6
10
|
removedBlocks: Block<BSchema, I, S>[];
|
|
@@ -211,9 +211,6 @@ export declare function setupTestEnv(): () => BlockNoteEditor<import("../../inde
|
|
|
211
211
|
type: "table";
|
|
212
212
|
content: "table";
|
|
213
213
|
propSchema: {
|
|
214
|
-
backgroundColor: {
|
|
215
|
-
default: "default";
|
|
216
|
-
};
|
|
217
214
|
textColor: {
|
|
218
215
|
default: "default";
|
|
219
216
|
};
|
|
@@ -223,9 +220,6 @@ export declare function setupTestEnv(): () => BlockNoteEditor<import("../../inde
|
|
|
223
220
|
type: "table";
|
|
224
221
|
content: "table";
|
|
225
222
|
propSchema: {
|
|
226
|
-
backgroundColor: {
|
|
227
|
-
default: "default";
|
|
228
|
-
};
|
|
229
223
|
textColor: {
|
|
230
224
|
default: "default";
|
|
231
225
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const acceptedMIMETypes: readonly ["vscode-editor-data", "blocknote/html", "
|
|
1
|
+
export declare const acceptedMIMETypes: readonly ["vscode-editor-data", "blocknote/html", "text/html", "text/plain", "Files"];
|
|
@@ -6,23 +6,48 @@ type SingleBlockInfo = {
|
|
|
6
6
|
afterPos: number;
|
|
7
7
|
};
|
|
8
8
|
export type BlockInfo = {
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The outer node that represents a BlockNote block. This is the node that has the ID.
|
|
11
|
+
* Most of the time, this will be a blockContainer node, but it could also be a Column or ColumnList
|
|
12
|
+
*/
|
|
13
|
+
bnBlock: SingleBlockInfo;
|
|
14
|
+
/**
|
|
15
|
+
* The type of BlockNote block that this node represents.
|
|
16
|
+
* When dealing with a blockContainer, this is retrieved from the blockContent node, otherwise it's retrieved from the bnBlock node.
|
|
17
|
+
*/
|
|
18
|
+
blockNoteType: string;
|
|
19
|
+
} & ({
|
|
20
|
+
/**
|
|
21
|
+
* The Prosemirror node that holds block.children. For non-blockContainer, this node will be the same as bnBlock.
|
|
22
|
+
*/
|
|
23
|
+
childContainer: SingleBlockInfo;
|
|
24
|
+
isBlockContainer: false;
|
|
25
|
+
} | {
|
|
26
|
+
/**
|
|
27
|
+
* The Prosemirror node that holds block.children. For blockContainers, this is the blockGroup node, if it exists.
|
|
28
|
+
*/
|
|
29
|
+
childContainer?: SingleBlockInfo;
|
|
30
|
+
/**
|
|
31
|
+
* The Prosemirror node that wraps block.content and has most of the props
|
|
32
|
+
*/
|
|
10
33
|
blockContent: SingleBlockInfo;
|
|
11
|
-
|
|
12
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Whether bnBlock is a blockContainer node
|
|
36
|
+
*/
|
|
37
|
+
isBlockContainer: true;
|
|
38
|
+
});
|
|
13
39
|
/**
|
|
14
|
-
* Retrieves the position just before the nearest
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* just before the last blockContainer is returned.
|
|
40
|
+
* Retrieves the position just before the nearest block node in a ProseMirror
|
|
41
|
+
* doc, relative to a position. If the position is within a block node or its
|
|
42
|
+
* descendants, the position just before it is returned. If the position is not
|
|
43
|
+
* within a block node or its descendants, the position just before the next
|
|
44
|
+
* closest block node is returned. If the position is beyond the last block, the
|
|
45
|
+
* position just before the last block is returned.
|
|
21
46
|
* @param doc The ProseMirror doc.
|
|
22
47
|
* @param pos An integer position in the document.
|
|
23
48
|
* @returns The position just before the nearest blockContainer node.
|
|
24
49
|
*/
|
|
25
|
-
export declare function
|
|
50
|
+
export declare function getNearestBlockPos(doc: Node, pos: number): {
|
|
26
51
|
posBeforeNode: number;
|
|
27
52
|
node: Node;
|
|
28
53
|
};
|
|
@@ -34,10 +59,10 @@ export declare function getNearestBlockContainerPos(doc: Node, pos: number): {
|
|
|
34
59
|
* the ProseMirror positions just before & after each node.
|
|
35
60
|
* @param node The main `blockContainer` node that the block information should
|
|
36
61
|
* be retrieved from,
|
|
37
|
-
* @param
|
|
62
|
+
* @param bnBlockBeforePosOffset the position just before the
|
|
38
63
|
* `blockContainer` node in the document.
|
|
39
64
|
*/
|
|
40
|
-
export declare function getBlockInfoWithManualOffset(node: Node,
|
|
65
|
+
export declare function getBlockInfoWithManualOffset(node: Node, bnBlockBeforePosOffset: number): BlockInfo;
|
|
41
66
|
/**
|
|
42
67
|
* Gets information regarding the ProseMirror nodes that make up a block in a
|
|
43
68
|
* BlockNote document. This includes the main `blockContainer` node, the
|
|
@@ -10,6 +10,6 @@ export declare function inlineContentToNodes<I extends InlineContentSchema, S ex
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function tableContentToNodes<I extends InlineContentSchema, S extends StyleSchema>(tableContent: PartialTableContent<I, S>, schema: Schema, styleSchema: StyleSchema): Node[];
|
|
12
12
|
/**
|
|
13
|
-
* Converts a BlockNote block to a
|
|
13
|
+
* Converts a BlockNote block to a Prosemirror node.
|
|
14
14
|
*/
|
|
15
15
|
export declare function blockToNode(block: PartialBlock<any, any, any>, schema: Schema, styleSchema: StyleSchema): Node;
|
|
@@ -11,6 +11,8 @@ export declare function contentNodeToTableContent<I extends InlineContentSchema,
|
|
|
11
11
|
export declare function contentNodeToInlineContent<I extends InlineContentSchema, S extends StyleSchema>(contentNode: Node, inlineContentSchema: I, styleSchema: S): InlineContent<I, S>[];
|
|
12
12
|
export declare function nodeToCustomInlineContent<I extends InlineContentSchema, S extends StyleSchema>(node: Node, inlineContentSchema: I, styleSchema: S): InlineContent<I, S>;
|
|
13
13
|
/**
|
|
14
|
-
* Convert a
|
|
14
|
+
* Convert a Prosemirror node to a BlockNote block.
|
|
15
|
+
*
|
|
16
|
+
* TODO: test changes
|
|
15
17
|
*/
|
|
16
18
|
export declare function nodeToBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(node: Node, blockSchema: BSchema, inlineContentSchema: I, styleSchema: S, blockCache?: WeakMap<Node, Block<BSchema, I, S>>): Block<BSchema, I, S>;
|
|
@@ -339,9 +339,6 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
|
|
|
339
339
|
type: "table";
|
|
340
340
|
content: "table";
|
|
341
341
|
propSchema: {
|
|
342
|
-
backgroundColor: {
|
|
343
|
-
default: "default";
|
|
344
|
-
};
|
|
345
342
|
textColor: {
|
|
346
343
|
default: "default";
|
|
347
344
|
};
|
|
@@ -351,9 +348,6 @@ declare const schema: BlockNoteSchema<import("../../../schema/index.js").BlockSc
|
|
|
351
348
|
type: "table";
|
|
352
349
|
content: "table";
|
|
353
350
|
propSchema: {
|
|
354
|
-
backgroundColor: {
|
|
355
|
-
default: "default";
|
|
356
|
-
};
|
|
357
351
|
textColor: {
|
|
358
352
|
default: "default";
|
|
359
353
|
};
|
|
@@ -213,9 +213,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
213
213
|
type: "table";
|
|
214
214
|
content: "table";
|
|
215
215
|
propSchema: {
|
|
216
|
-
backgroundColor: {
|
|
217
|
-
default: "default";
|
|
218
|
-
};
|
|
219
216
|
textColor: {
|
|
220
217
|
default: "default";
|
|
221
218
|
};
|
|
@@ -225,9 +222,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
225
222
|
type: "table";
|
|
226
223
|
content: "table";
|
|
227
224
|
propSchema: {
|
|
228
|
-
backgroundColor: {
|
|
229
|
-
default: "default";
|
|
230
|
-
};
|
|
231
225
|
textColor: {
|
|
232
226
|
default: "default";
|
|
233
227
|
};
|
|
@@ -213,9 +213,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
213
213
|
type: "table";
|
|
214
214
|
content: "table";
|
|
215
215
|
propSchema: {
|
|
216
|
-
backgroundColor: {
|
|
217
|
-
default: "default";
|
|
218
|
-
};
|
|
219
216
|
textColor: {
|
|
220
217
|
default: "default";
|
|
221
218
|
};
|
|
@@ -225,9 +222,6 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
225
222
|
type: "table";
|
|
226
223
|
content: "table";
|
|
227
224
|
propSchema: {
|
|
228
|
-
backgroundColor: {
|
|
229
|
-
default: "default";
|
|
230
|
-
};
|
|
231
225
|
textColor: {
|
|
232
226
|
default: "default";
|
|
233
227
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Block, PartialBlock } from "../../blocks/defaultBlocks.js";
|
|
2
|
+
import { BlockNoteSchema } from "../../editor/BlockNoteSchema.js";
|
|
2
3
|
import { BlockSchema } from "../../schema/blocks/types.js";
|
|
3
4
|
import { InlineContentSchema } from "../../schema/inlineContent/types.js";
|
|
4
5
|
import { StyleSchema } from "../../schema/styles/types.js";
|
|
5
|
-
export declare function partialBlocksToBlocksForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BSchema, partialBlocks: Array<PartialBlock<BSchema
|
|
6
|
+
export declare function partialBlocksToBlocksForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BlockNoteSchema<BSchema, I, S>, partialBlocks: Array<PartialBlock<NoInfer<BSchema>, NoInfer<I>, NoInfer<S>>>): Array<Block<BSchema, I, S>>;
|
|
6
7
|
export declare function partialBlockToBlockForTesting<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BSchema, partialBlock: PartialBlock<BSchema, I, S>): Block<BSchema, I, S>;
|
|
7
8
|
export declare function addIdsToBlock(block: PartialBlock<any, any, any>): void;
|
|
8
9
|
export declare function addIdsToBlocks(blocks: PartialBlock<any, any, any>[]): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
2
|
import { BlockFromConfig, Props } from "../../schema/index.js";
|
|
3
|
+
export declare const FILE_AUDIO_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z\"></path></svg>";
|
|
3
4
|
export declare const audioPropSchema: {
|
|
4
5
|
backgroundColor: {
|
|
5
6
|
default: "default";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
2
|
import { BlockFromConfig, BlockSchemaWithBlock, FileBlockConfig } from "../../schema/index.js";
|
|
3
|
+
export declare const FILE_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\"></path></svg>";
|
|
3
4
|
export declare const createFileBlockWrapper: (block: BlockFromConfig<FileBlockConfig, any, any>, editor: BlockNoteEditor<BlockSchemaWithBlock<FileBlockConfig["type"], FileBlockConfig>, any, any>, element: {
|
|
4
5
|
dom: HTMLElement;
|
|
5
6
|
destroy?: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
2
|
import { BlockFromConfig, Props } from "../../schema/index.js";
|
|
3
|
+
export declare const FILE_IMAGE_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z\"></path></svg>";
|
|
3
4
|
export declare const imagePropSchema: {
|
|
4
5
|
textAlignment: {
|
|
5
6
|
default: "left";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { Node } from "@tiptap/core";
|
|
2
2
|
export declare const tablePropSchema: {
|
|
3
|
-
backgroundColor: {
|
|
4
|
-
default: "default";
|
|
5
|
-
};
|
|
6
3
|
textColor: {
|
|
7
4
|
default: "default";
|
|
8
5
|
};
|
|
@@ -18,9 +15,6 @@ export declare const Table: {
|
|
|
18
15
|
type: "table";
|
|
19
16
|
content: "table";
|
|
20
17
|
propSchema: {
|
|
21
|
-
backgroundColor: {
|
|
22
|
-
default: "default";
|
|
23
|
-
};
|
|
24
18
|
textColor: {
|
|
25
19
|
default: "default";
|
|
26
20
|
};
|
|
@@ -30,9 +24,6 @@ export declare const Table: {
|
|
|
30
24
|
type: "table";
|
|
31
25
|
content: "table";
|
|
32
26
|
propSchema: {
|
|
33
|
-
backgroundColor: {
|
|
34
|
-
default: "default";
|
|
35
|
-
};
|
|
36
27
|
textColor: {
|
|
37
28
|
default: "default";
|
|
38
29
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
2
|
import { BlockFromConfig, Props } from "../../schema/index.js";
|
|
3
|
+
export declare const FILE_VIDEO_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z\"></path></svg>";
|
|
3
4
|
export declare const videoPropSchema: {
|
|
4
5
|
textAlignment: {
|
|
5
6
|
default: "left";
|
|
@@ -212,9 +212,6 @@ export declare const defaultBlockSpecs: {
|
|
|
212
212
|
type: "table";
|
|
213
213
|
content: "table";
|
|
214
214
|
propSchema: {
|
|
215
|
-
backgroundColor: {
|
|
216
|
-
default: "default";
|
|
217
|
-
};
|
|
218
215
|
textColor: {
|
|
219
216
|
default: "default";
|
|
220
217
|
};
|
|
@@ -224,9 +221,6 @@ export declare const defaultBlockSpecs: {
|
|
|
224
221
|
type: "table";
|
|
225
222
|
content: "table";
|
|
226
223
|
propSchema: {
|
|
227
|
-
backgroundColor: {
|
|
228
|
-
default: "default";
|
|
229
|
-
};
|
|
230
224
|
textColor: {
|
|
231
225
|
default: "default";
|
|
232
226
|
};
|
|
@@ -658,9 +652,6 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
658
652
|
type: "table";
|
|
659
653
|
content: "table";
|
|
660
654
|
propSchema: {
|
|
661
|
-
backgroundColor: {
|
|
662
|
-
default: "default";
|
|
663
|
-
};
|
|
664
655
|
textColor: {
|
|
665
656
|
default: "default";
|
|
666
657
|
};
|
|
@@ -670,9 +661,6 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
670
661
|
type: "table";
|
|
671
662
|
content: "table";
|
|
672
663
|
propSchema: {
|
|
673
|
-
backgroundColor: {
|
|
674
|
-
default: "default";
|
|
675
|
-
};
|
|
676
664
|
textColor: {
|
|
677
665
|
default: "default";
|
|
678
666
|
};
|