@blocknote/core 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +2320 -1692
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +7 -7
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +3 -3
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteImage.html +111 -0
- package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +96 -0
- package/src/api/clipboard/__snapshots__/external/pasteTable.html +149 -0
- package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +124 -0
- package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +1 -0
- package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +1 -0
- package/src/api/clipboard/clipboardExternal.test.ts +161 -0
- package/src/api/clipboard/{clipboard.test.ts → clipboardInternal.test.ts} +186 -38
- package/src/api/clipboard/testUtil.ts +27 -0
- package/src/api/clipboard/toClipboard/copyExtension.ts +1 -0
- package/src/api/exporters/html/__snapshots__/pageBreak/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/pageBreak/basic/internal.html +1 -0
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -1
- package/src/api/exporters/markdown/__snapshots__/pageBreak/basic/markdown.md +0 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +16 -0
- package/src/api/nodeConversions/nodeToBlock.ts +4 -1
- package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +62 -0
- package/src/api/parsers/html/parseHTML.test.ts +9 -0
- package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +2 -2
- package/src/api/testUtil/cases/defaultSchema.ts +15 -1
- package/src/api/testUtil/partialBlockTestUtil.ts +4 -1
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +32 -11
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +3 -28
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +1 -1
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +4 -16
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -3
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +26 -6
- package/src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts +49 -0
- package/src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.ts +45 -0
- package/src/blocks/PageBreakBlockContent/schema.ts +40 -0
- package/src/editor/Block.css +18 -4
- package/src/editor/BlockNoteEditor.test.ts +21 -1
- package/src/editor/BlockNoteEditor.ts +17 -0
- package/src/editor/BlockNoteExtensions.ts +111 -16
- package/src/editor/editor.css +28 -13
- package/src/editor/transformPasted.ts +57 -4
- package/src/extensions/SideMenu/SideMenuPlugin.ts +115 -23
- package/src/extensions/SideMenu/dragging.ts +0 -1
- package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +1 -1
- package/src/i18n/locales/ar.ts +6 -0
- package/src/i18n/locales/de.ts +6 -0
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +6 -0
- package/src/i18n/locales/fr.ts +47 -17
- package/src/i18n/locales/hr.ts +72 -54
- package/src/i18n/locales/index.ts +1 -0
- package/src/i18n/locales/is.ts +6 -0
- package/src/i18n/locales/it.ts +315 -0
- package/src/i18n/locales/ja.ts +6 -0
- package/src/i18n/locales/ko.ts +6 -0
- package/src/i18n/locales/nl.ts +6 -0
- package/src/i18n/locales/pl.ts +6 -0
- package/src/i18n/locales/pt.ts +6 -0
- package/src/i18n/locales/ru.ts +6 -0
- package/src/i18n/locales/vi.ts +6 -0
- package/src/i18n/locales/zh.ts +6 -0
- package/src/index.ts +3 -0
- package/src/schema/blocks/createSpec.ts +1 -1
- package/src/schema/blocks/internal.ts +16 -6
- package/src/schema/inlineContent/internal.ts +4 -1
- package/src/schema/propTypes.ts +41 -18
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +8 -0
- package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
- package/types/src/api/clipboard/testUtil.d.ts +509 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +8 -0
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +8 -0
- package/types/src/api/testUtil/cases/customStyles.d.ts +8 -0
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +2 -1
- package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +2 -0
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +12 -0
- package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +31 -0
- package/types/src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.d.ts +8 -0
- package/types/src/blocks/PageBreakBlockContent/schema.d.ts +86 -0
- package/types/src/blocks/defaultBlocks.d.ts +16 -0
- package/types/src/editor/BlockNoteEditor.d.ts +15 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -0
- package/types/src/editor/transformPasted.d.ts +8 -4
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +25 -5
- package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +1 -1
- package/types/src/i18n/locales/de.d.ts +6 -0
- package/types/src/i18n/locales/en.d.ts +6 -0
- package/types/src/i18n/locales/es.d.ts +6 -0
- package/types/src/i18n/locales/hr.d.ts +6 -0
- package/types/src/i18n/locales/index.d.ts +1 -0
- package/types/src/i18n/locales/it.d.ts +245 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/schema/propTypes.d.ts +20 -2
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +0 -30
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +0 -99
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +0 -97
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +0 -88
- package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +0 -219
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +0 -175
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +0 -57
- package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +0 -5
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +0 -31
- package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +0 -71
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +0 -157
- package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +0 -27
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +0 -67
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +0 -148
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +0 -252
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +0 -1
- package/dist/src/api/blockManipulation/getBlock/getBlock.js +0 -56
- package/dist/src/api/blockManipulation/getBlock/getBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/insertContentAt.js +0 -64
- package/dist/src/api/blockManipulation/insertContentAt.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/selection.js +0 -149
- package/dist/src/api/blockManipulation/selections/selection.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/selection.test.js +0 -39
- package/dist/src/api/blockManipulation/selections/selection.test.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +0 -79
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +0 -1
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +0 -33
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +0 -1
- package/dist/src/api/blockManipulation/setupTestEnv.js +0 -172
- package/dist/src/api/blockManipulation/setupTestEnv.js.map +0 -1
- package/dist/src/api/clipboard/clipboard.test.js +0 -249
- package/dist/src/api/clipboard/clipboard.test.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +0 -8
- package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +0 -38
- package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +0 -111
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +0 -25
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +0 -1
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +0 -57
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +0 -1
- package/dist/src/api/clipboard/toClipboard/copyExtension.js +0 -134
- package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +0 -1
- package/dist/src/api/exporters/html/externalHTMLExporter.js +0 -35
- package/dist/src/api/exporters/html/externalHTMLExporter.js.map +0 -1
- package/dist/src/api/exporters/html/htmlConversion.test.js +0 -72
- package/dist/src/api/exporters/html/htmlConversion.test.js.map +0 -1
- package/dist/src/api/exporters/html/internalHTMLSerializer.js +0 -21
- package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +0 -1
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +0 -141
- package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +0 -1
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +0 -96
- package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +0 -1
- package/dist/src/api/exporters/markdown/markdownExporter.js +0 -31
- package/dist/src/api/exporters/markdown/markdownExporter.js.map +0 -1
- package/dist/src/api/exporters/markdown/markdownExporter.test.js +0 -57
- package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +0 -1
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +0 -33
- package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +0 -1
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +0 -37
- package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +0 -1
- package/dist/src/api/getBlockInfoFromPos.js +0 -165
- package/dist/src/api/getBlockInfoFromPos.js.map +0 -1
- package/dist/src/api/nodeConversions/blockToNode.js +0 -197
- package/dist/src/api/nodeConversions/blockToNode.js.map +0 -1
- package/dist/src/api/nodeConversions/fragmentToBlocks.js +0 -50
- package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +0 -1
- package/dist/src/api/nodeConversions/nodeConversions.test.js +0 -54
- package/dist/src/api/nodeConversions/nodeConversions.test.js.map +0 -1
- package/dist/src/api/nodeConversions/nodeToBlock.js +0 -316
- package/dist/src/api/nodeConversions/nodeToBlock.js.map +0 -1
- package/dist/src/api/nodeUtil.js +0 -28
- package/dist/src/api/nodeUtil.js.map +0 -1
- package/dist/src/api/parsers/html/parseHTML.js +0 -19
- package/dist/src/api/parsers/html/parseHTML.js.map +0 -1
- package/dist/src/api/parsers/html/parseHTML.test.js +0 -470
- package/dist/src/api/parsers/html/parseHTML.test.js.map +0 -1
- package/dist/src/api/parsers/html/util/nestedLists.js +0 -106
- package/dist/src/api/parsers/html/util/nestedLists.js.map +0 -1
- package/dist/src/api/parsers/html/util/nestedLists.test.js +0 -166
- package/dist/src/api/parsers/html/util/nestedLists.test.js.map +0 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.js +0 -52
- package/dist/src/api/parsers/markdown/parseMarkdown.js.map +0 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js +0 -112
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +0 -1
- package/dist/src/api/testUtil/cases/customBlocks.js +0 -313
- package/dist/src/api/testUtil/cases/customBlocks.js.map +0 -1
- package/dist/src/api/testUtil/cases/customInlineContent.js +0 -91
- package/dist/src/api/testUtil/cases/customInlineContent.js.map +0 -1
- package/dist/src/api/testUtil/cases/customStyles.js +0 -83
- package/dist/src/api/testUtil/cases/customStyles.js.map +0 -1
- package/dist/src/api/testUtil/cases/defaultSchema.js +0 -673
- package/dist/src/api/testUtil/cases/defaultSchema.js.map +0 -1
- package/dist/src/api/testUtil/index.js +0 -2
- package/dist/src/api/testUtil/index.js.map +0 -1
- package/dist/src/api/testUtil/partialBlockTestUtil.js +0 -114
- package/dist/src/api/testUtil/partialBlockTestUtil.js.map +0 -1
- package/dist/src/api/testUtil/paste.js +0 -29
- package/dist/src/api/testUtil/paste.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +0 -104
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/parseAudioElement.js +0 -5
- package/dist/src/blocks/AudioBlockContent/parseAudioElement.js.map +0 -1
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +0 -281
- package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +0 -1
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +0 -110
- package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js +0 -71
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js +0 -5
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js +0 -10
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js +0 -39
- package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js +0 -51
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js +0 -17
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js +0 -147
- package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js +0 -9
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js +0 -11
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +0 -15
- package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +0 -1
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +0 -145
- package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +0 -114
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/parseImageElement.js +0 -6
- package/dist/src/blocks/ImageBlockContent/parseImageElement.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +0 -113
- package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +0 -224
- package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +0 -45
- package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +0 -58
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +0 -1
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +0 -130
- package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +0 -1
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +0 -52
- package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +0 -1
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -129
- package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +0 -1
- package/dist/src/blocks/TableBlockContent/TableExtension.js +0 -64
- package/dist/src/blocks/TableBlockContent/TableExtension.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +0 -114
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/parseVideoElement.js +0 -6
- package/dist/src/blocks/VideoBlockContent/parseVideoElement.js.map +0 -1
- package/dist/src/blocks/defaultBlockHelpers.js +0 -50
- package/dist/src/blocks/defaultBlockHelpers.js.map +0 -1
- package/dist/src/blocks/defaultBlockTypeGuards.js +0 -40
- package/dist/src/blocks/defaultBlockTypeGuards.js.map +0 -1
- package/dist/src/blocks/defaultBlocks.js +0 -50
- package/dist/src/blocks/defaultBlocks.js.map +0 -1
- package/dist/src/blocks/defaultProps.js +0 -19
- package/dist/src/blocks/defaultProps.js.map +0 -1
- package/dist/src/editor/BlockNoteEditor.js +0 -751
- package/dist/src/editor/BlockNoteEditor.js.map +0 -1
- package/dist/src/editor/BlockNoteEditor.test.js +0 -65
- package/dist/src/editor/BlockNoteEditor.test.js.map +0 -1
- package/dist/src/editor/BlockNoteExtensions.js +0 -192
- package/dist/src/editor/BlockNoteExtensions.js.map +0 -1
- package/dist/src/editor/BlockNoteSchema.js +0 -38
- package/dist/src/editor/BlockNoteSchema.js.map +0 -1
- package/dist/src/editor/BlockNoteTipTapEditor.js +0 -169
- package/dist/src/editor/BlockNoteTipTapEditor.js.map +0 -1
- package/dist/src/editor/cursorPositionTypes.js +0 -2
- package/dist/src/editor/cursorPositionTypes.js.map +0 -1
- package/dist/src/editor/defaultColors.js +0 -77
- package/dist/src/editor/defaultColors.js.map +0 -1
- package/dist/src/editor/selectionTypes.js +0 -2
- package/dist/src/editor/selectionTypes.js.map +0 -1
- package/dist/src/editor/transformPasted.js +0 -79
- package/dist/src/editor/transformPasted.js.map +0 -1
- package/dist/src/exporter/Exporter.js +0 -36
- package/dist/src/exporter/Exporter.js.map +0 -1
- package/dist/src/exporter/index.js +0 -3
- package/dist/src/exporter/index.js.map +0 -1
- package/dist/src/exporter/mapping.js +0 -12
- package/dist/src/exporter/mapping.js.map +0 -1
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +0 -30
- package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +0 -1
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +0 -39
- package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +0 -1
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js +0 -131
- package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +0 -1
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +0 -197
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +0 -1
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +0 -341
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +0 -1
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +0 -251
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +0 -1
- package/dist/src/extensions/LinkToolbar/protocols.js +0 -14
- package/dist/src/extensions/LinkToolbar/protocols.js.map +0 -1
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +0 -54
- package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +0 -1
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +0 -90
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +0 -1
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +0 -187
- package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +0 -1
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +0 -68
- package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +0 -1
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js +0 -347
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +0 -1
- package/dist/src/extensions/SideMenu/dragging.js +0 -135
- package/dist/src/extensions/SideMenu/dragging.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +0 -2
- package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +0 -2
- package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +0 -245
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +0 -26
- package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +0 -1
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +0 -241
- package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +0 -1
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +0 -579
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +0 -1
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +0 -36
- package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +0 -1
- package/dist/src/extensions/TextColor/TextColorExtension.js +0 -29
- package/dist/src/extensions/TextColor/TextColorExtension.js.map +0 -1
- package/dist/src/extensions/TextColor/TextColorMark.js +0 -37
- package/dist/src/extensions/TextColor/TextColorMark.js.map +0 -1
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +0 -58
- package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +0 -1
- package/dist/src/extensions/UniqueID/UniqueID.js +0 -283
- package/dist/src/extensions/UniqueID/UniqueID.js.map +0 -1
- package/dist/src/extensions/getDraggableBlockFromElement.js +0 -13
- package/dist/src/extensions/getDraggableBlockFromElement.js.map +0 -1
- package/dist/src/extensions-shared/UiElementPosition.js +0 -2
- package/dist/src/extensions-shared/UiElementPosition.js.map +0 -1
- package/dist/src/i18n/dictionary.js +0 -4
- package/dist/src/i18n/dictionary.js.map +0 -1
- package/dist/src/i18n/locales/ar.js +0 -298
- package/dist/src/i18n/locales/ar.js.map +0 -1
- package/dist/src/i18n/locales/de.js +0 -313
- package/dist/src/i18n/locales/de.js.map +0 -1
- package/dist/src/i18n/locales/en.js +0 -314
- package/dist/src/i18n/locales/en.js.map +0 -1
- package/dist/src/i18n/locales/es.js +0 -312
- package/dist/src/i18n/locales/es.js.map +0 -1
- package/dist/src/i18n/locales/fr.js +0 -313
- package/dist/src/i18n/locales/fr.js.map +0 -1
- package/dist/src/i18n/locales/hr.js +0 -308
- package/dist/src/i18n/locales/hr.js.map +0 -1
- package/dist/src/i18n/locales/index.js +0 -16
- package/dist/src/i18n/locales/index.js.map +0 -1
- package/dist/src/i18n/locales/is.js +0 -305
- package/dist/src/i18n/locales/is.js.map +0 -1
- package/dist/src/i18n/locales/ja.js +0 -333
- package/dist/src/i18n/locales/ja.js.map +0 -1
- package/dist/src/i18n/locales/ko.js +0 -326
- package/dist/src/i18n/locales/ko.js.map +0 -1
- package/dist/src/i18n/locales/nl.js +0 -313
- package/dist/src/i18n/locales/nl.js.map +0 -1
- package/dist/src/i18n/locales/pl.js +0 -297
- package/dist/src/i18n/locales/pl.js.map +0 -1
- package/dist/src/i18n/locales/pt.js +0 -305
- package/dist/src/i18n/locales/pt.js.map +0 -1
- package/dist/src/i18n/locales/ru.js +0 -340
- package/dist/src/i18n/locales/ru.js.map +0 -1
- package/dist/src/i18n/locales/vi.js +0 -312
- package/dist/src/i18n/locales/vi.js.map +0 -1
- package/dist/src/i18n/locales/zh.js +0 -346
- package/dist/src/i18n/locales/zh.js.map +0 -1
- package/dist/src/index.js +0 -63
- package/dist/src/index.js.map +0 -1
- package/dist/src/pm-nodes/BlockContainer.js +0 -72
- package/dist/src/pm-nodes/BlockContainer.js.map +0 -1
- package/dist/src/pm-nodes/BlockGroup.js +0 -43
- package/dist/src/pm-nodes/BlockGroup.js.map +0 -1
- package/dist/src/pm-nodes/Doc.js +0 -7
- package/dist/src/pm-nodes/Doc.js.map +0 -1
- package/dist/src/pm-nodes/index.js +0 -4
- package/dist/src/pm-nodes/index.js.map +0 -1
- package/dist/src/schema/blocks/createSpec.js +0 -126
- package/dist/src/schema/blocks/createSpec.js.map +0 -1
- package/dist/src/schema/blocks/internal.js +0 -147
- package/dist/src/schema/blocks/internal.js.map +0 -1
- package/dist/src/schema/blocks/types.js +0 -2
- package/dist/src/schema/blocks/types.js.map +0 -1
- package/dist/src/schema/index.js +0 -11
- package/dist/src/schema/index.js.map +0 -1
- package/dist/src/schema/inlineContent/createSpec.js +0 -64
- package/dist/src/schema/inlineContent/createSpec.js.map +0 -1
- package/dist/src/schema/inlineContent/internal.js +0 -52
- package/dist/src/schema/inlineContent/internal.js.map +0 -1
- package/dist/src/schema/inlineContent/types.js +0 -10
- package/dist/src/schema/inlineContent/types.js.map +0 -1
- package/dist/src/schema/propTypes.js +0 -2
- package/dist/src/schema/propTypes.js.map +0 -1
- package/dist/src/schema/styles/createSpec.js +0 -48
- package/dist/src/schema/styles/createSpec.js.map +0 -1
- package/dist/src/schema/styles/internal.js +0 -53
- package/dist/src/schema/styles/internal.js.map +0 -1
- package/dist/src/schema/styles/types.js +0 -2
- package/dist/src/schema/styles/types.js.map +0 -1
- package/dist/src/util/EventEmitter.js +0 -33
- package/dist/src/util/EventEmitter.js.map +0 -1
- package/dist/src/util/browser.js +0 -17
- package/dist/src/util/browser.js.map +0 -1
- package/dist/src/util/combineByGroup.js +0 -20
- package/dist/src/util/combineByGroup.js.map +0 -1
- package/dist/src/util/esmDependencies.js +0 -35
- package/dist/src/util/esmDependencies.js.map +0 -1
- package/dist/src/util/string.js +0 -14
- package/dist/src/util/string.js.map +0 -1
- package/dist/src/util/typescript.js +0 -12
- package/dist/src/util/typescript.js.map +0 -1
- /package/src/api/clipboard/__snapshots__/{childToParent.html → internal/childToParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{childrenToNextParent.html → internal/childrenToNextParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{childrenToNextParentsChildren.html → internal/childrenToNextParentsChildren.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{image.html → internal/image.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{multipleChildren.html → internal/multipleChildren.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{multipleStyledText.html → internal/multipleStyledText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{nestedImage.html → internal/nestedImage.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{partialChildToParent.html → internal/partialChildToParent.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{styledText.html → internal/styledText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableAllCells.html → internal/tableAllCells.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableCell.html → internal/tableCell.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableCellText.html → internal/tableCellText.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{tableRow.html → internal/tableRow.html} +0 -0
- /package/src/api/clipboard/__snapshots__/{unstyledText.html → internal/unstyledText.html} +0 -0
- /package/types/src/api/clipboard/{clipboard.test.d.ts → clipboardExternal.test.d.ts} +0 -0
|
@@ -139,6 +139,10 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
139
139
|
type: "numberedListItem";
|
|
140
140
|
content: "inline";
|
|
141
141
|
propSchema: {
|
|
142
|
+
start: {
|
|
143
|
+
default: undefined;
|
|
144
|
+
type: "number";
|
|
145
|
+
};
|
|
142
146
|
backgroundColor: {
|
|
143
147
|
default: "default";
|
|
144
148
|
};
|
|
@@ -155,6 +159,10 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
155
159
|
type: "numberedListItem";
|
|
156
160
|
content: "inline";
|
|
157
161
|
propSchema: {
|
|
162
|
+
start: {
|
|
163
|
+
default: undefined;
|
|
164
|
+
type: "number";
|
|
165
|
+
};
|
|
158
166
|
backgroundColor: {
|
|
159
167
|
default: "default";
|
|
160
168
|
};
|
|
@@ -139,6 +139,10 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
139
139
|
type: "numberedListItem";
|
|
140
140
|
content: "inline";
|
|
141
141
|
propSchema: {
|
|
142
|
+
start: {
|
|
143
|
+
default: undefined;
|
|
144
|
+
type: "number";
|
|
145
|
+
};
|
|
142
146
|
backgroundColor: {
|
|
143
147
|
default: "default";
|
|
144
148
|
};
|
|
@@ -155,6 +159,10 @@ declare const schema: BlockNoteSchema<import("../../../index.js").BlockSchemaFro
|
|
|
155
159
|
type: "numberedListItem";
|
|
156
160
|
content: "inline";
|
|
157
161
|
propSchema: {
|
|
162
|
+
start: {
|
|
163
|
+
default: undefined;
|
|
164
|
+
type: "number";
|
|
165
|
+
};
|
|
158
166
|
backgroundColor: {
|
|
159
167
|
default: "default";
|
|
160
168
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { EditorTestCases } from "../index.js";
|
|
2
2
|
import { DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema } from "../../../blocks/defaultBlocks.js";
|
|
3
|
-
|
|
3
|
+
import { pageBreakSchema } from "../../../blocks/PageBreakBlockContent/schema.js";
|
|
4
|
+
export declare const defaultSchemaTestCases: EditorTestCases<DefaultBlockSchema & typeof pageBreakSchema.blockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
|
|
@@ -4,6 +4,8 @@ interface CodeBlockOptions {
|
|
|
4
4
|
indentLineWithTab: boolean;
|
|
5
5
|
supportedLanguages: SupportedLanguageConfig[];
|
|
6
6
|
}
|
|
7
|
+
export declare const shikiParserSymbol: unique symbol;
|
|
8
|
+
export declare const shikiHighlighterPromiseSymbol: unique symbol;
|
|
7
9
|
export declare const defaultCodeBlockPropSchema: {
|
|
8
10
|
language: {
|
|
9
11
|
default: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const numberedListItemPropSchema: {
|
|
2
|
+
start: {
|
|
3
|
+
default: undefined;
|
|
4
|
+
type: "number";
|
|
5
|
+
};
|
|
2
6
|
backgroundColor: {
|
|
3
7
|
default: "default";
|
|
4
8
|
};
|
|
@@ -15,6 +19,10 @@ export declare const NumberedListItem: {
|
|
|
15
19
|
type: "numberedListItem";
|
|
16
20
|
content: "inline";
|
|
17
21
|
propSchema: {
|
|
22
|
+
start: {
|
|
23
|
+
default: undefined;
|
|
24
|
+
type: "number";
|
|
25
|
+
};
|
|
18
26
|
backgroundColor: {
|
|
19
27
|
default: "default";
|
|
20
28
|
};
|
|
@@ -31,6 +39,10 @@ export declare const NumberedListItem: {
|
|
|
31
39
|
type: "numberedListItem";
|
|
32
40
|
content: "inline";
|
|
33
41
|
propSchema: {
|
|
42
|
+
start: {
|
|
43
|
+
default: undefined;
|
|
44
|
+
type: "number";
|
|
45
|
+
};
|
|
34
46
|
backgroundColor: {
|
|
35
47
|
default: "default";
|
|
36
48
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Props } from "../../schema/index.js";
|
|
2
|
+
export declare const pageBreakConfig: {
|
|
3
|
+
type: "pageBreak";
|
|
4
|
+
propSchema: {};
|
|
5
|
+
content: "none";
|
|
6
|
+
isFileBlock: false;
|
|
7
|
+
isSelectable: false;
|
|
8
|
+
};
|
|
9
|
+
export declare const pageBreakRender: () => {
|
|
10
|
+
dom: HTMLDivElement;
|
|
11
|
+
};
|
|
12
|
+
export declare const pageBreakParse: (element: HTMLElement) => Partial<Props<typeof pageBreakConfig.propSchema>> | undefined;
|
|
13
|
+
export declare const pageBreakToExternalHTML: () => {
|
|
14
|
+
dom: HTMLDivElement;
|
|
15
|
+
};
|
|
16
|
+
export declare const PageBreak: {
|
|
17
|
+
config: {
|
|
18
|
+
type: "pageBreak";
|
|
19
|
+
propSchema: {};
|
|
20
|
+
content: "none";
|
|
21
|
+
isFileBlock: false;
|
|
22
|
+
isSelectable: false;
|
|
23
|
+
};
|
|
24
|
+
implementation: import("../../schema/index.js").TiptapBlockImplementation<{
|
|
25
|
+
type: "pageBreak";
|
|
26
|
+
propSchema: {};
|
|
27
|
+
content: "none";
|
|
28
|
+
isFileBlock: false;
|
|
29
|
+
isSelectable: false;
|
|
30
|
+
}, any, import("../../schema/index.js").InlineContentSchema, import("../../schema/index.js").StyleSchema>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
2
|
+
import { DefaultSuggestionItem } from "../../extensions/SuggestionMenu/DefaultSuggestionItem.js";
|
|
3
|
+
import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
|
|
4
|
+
import { pageBreakSchema } from "./schema.js";
|
|
5
|
+
export declare function checkPageBreakBlocksInSchema<I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>): editor is BlockNoteEditor<typeof pageBreakSchema.blockSchema, I, S>;
|
|
6
|
+
export declare function getPageBreakSlashMenuItems<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>): (Omit<DefaultSuggestionItem, "key"> & {
|
|
7
|
+
key: "page_break";
|
|
8
|
+
})[];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BlockNoteSchema } from "../../editor/BlockNoteSchema.js";
|
|
2
|
+
import { InlineContentSchema, StyleSchema } from "../../schema/index.js";
|
|
3
|
+
import { PageBreak } from "./PageBreakBlockContent.js";
|
|
4
|
+
export declare const pageBreakSchema: BlockNoteSchema<import("../../schema/index.js").BlockSchemaFromSpecs<{
|
|
5
|
+
pageBreak: {
|
|
6
|
+
config: {
|
|
7
|
+
type: "pageBreak";
|
|
8
|
+
propSchema: {};
|
|
9
|
+
content: "none";
|
|
10
|
+
isFileBlock: false;
|
|
11
|
+
isSelectable: false;
|
|
12
|
+
};
|
|
13
|
+
implementation: import("../../schema/index.js").TiptapBlockImplementation<{
|
|
14
|
+
type: "pageBreak";
|
|
15
|
+
propSchema: {};
|
|
16
|
+
content: "none";
|
|
17
|
+
isFileBlock: false;
|
|
18
|
+
isSelectable: false;
|
|
19
|
+
}, any, InlineContentSchema, StyleSchema>;
|
|
20
|
+
};
|
|
21
|
+
}>, import("../../schema/index.js").InlineContentSchemaFromSpecs<{
|
|
22
|
+
text: {
|
|
23
|
+
config: "text";
|
|
24
|
+
implementation: any;
|
|
25
|
+
};
|
|
26
|
+
link: {
|
|
27
|
+
config: "link";
|
|
28
|
+
implementation: any;
|
|
29
|
+
};
|
|
30
|
+
}>, import("../../schema/index.js").StyleSchemaFromSpecs<{
|
|
31
|
+
bold: {
|
|
32
|
+
config: {
|
|
33
|
+
type: string;
|
|
34
|
+
propSchema: "boolean";
|
|
35
|
+
};
|
|
36
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
37
|
+
};
|
|
38
|
+
italic: {
|
|
39
|
+
config: {
|
|
40
|
+
type: string;
|
|
41
|
+
propSchema: "boolean";
|
|
42
|
+
};
|
|
43
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
44
|
+
};
|
|
45
|
+
underline: {
|
|
46
|
+
config: {
|
|
47
|
+
type: string;
|
|
48
|
+
propSchema: "boolean";
|
|
49
|
+
};
|
|
50
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
51
|
+
};
|
|
52
|
+
strike: {
|
|
53
|
+
config: {
|
|
54
|
+
type: string;
|
|
55
|
+
propSchema: "boolean";
|
|
56
|
+
};
|
|
57
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
58
|
+
};
|
|
59
|
+
code: {
|
|
60
|
+
config: {
|
|
61
|
+
type: string;
|
|
62
|
+
propSchema: "boolean";
|
|
63
|
+
};
|
|
64
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
65
|
+
};
|
|
66
|
+
textColor: {
|
|
67
|
+
config: {
|
|
68
|
+
type: string;
|
|
69
|
+
propSchema: "string";
|
|
70
|
+
};
|
|
71
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
72
|
+
};
|
|
73
|
+
backgroundColor: {
|
|
74
|
+
config: {
|
|
75
|
+
type: string;
|
|
76
|
+
propSchema: "string";
|
|
77
|
+
};
|
|
78
|
+
implementation: import("../../schema/index.js").StyleImplementation;
|
|
79
|
+
};
|
|
80
|
+
}>>;
|
|
81
|
+
/**
|
|
82
|
+
* Adds page break support to the given schema.
|
|
83
|
+
*/
|
|
84
|
+
export declare const withPageBreak: <B extends Record<string, import("../../schema/index.js").BlockConfig>, I extends InlineContentSchema, S extends StyleSchema>(schema: BlockNoteSchema<B, I, S>) => BlockNoteSchema<B & {
|
|
85
|
+
pageBreak: typeof PageBreak.config;
|
|
86
|
+
}, I, S>;
|
|
@@ -138,6 +138,10 @@ export declare const defaultBlockSpecs: {
|
|
|
138
138
|
type: "numberedListItem";
|
|
139
139
|
content: "inline";
|
|
140
140
|
propSchema: {
|
|
141
|
+
start: {
|
|
142
|
+
default: undefined;
|
|
143
|
+
type: "number";
|
|
144
|
+
};
|
|
141
145
|
backgroundColor: {
|
|
142
146
|
default: "default";
|
|
143
147
|
};
|
|
@@ -154,6 +158,10 @@ export declare const defaultBlockSpecs: {
|
|
|
154
158
|
type: "numberedListItem";
|
|
155
159
|
content: "inline";
|
|
156
160
|
propSchema: {
|
|
161
|
+
start: {
|
|
162
|
+
default: undefined;
|
|
163
|
+
type: "number";
|
|
164
|
+
};
|
|
157
165
|
backgroundColor: {
|
|
158
166
|
default: "default";
|
|
159
167
|
};
|
|
@@ -578,6 +586,10 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
578
586
|
type: "numberedListItem";
|
|
579
587
|
content: "inline";
|
|
580
588
|
propSchema: {
|
|
589
|
+
start: {
|
|
590
|
+
default: undefined;
|
|
591
|
+
type: "number";
|
|
592
|
+
};
|
|
581
593
|
backgroundColor: {
|
|
582
594
|
default: "default";
|
|
583
595
|
};
|
|
@@ -594,6 +606,10 @@ export declare const defaultBlockSchema: import("../schema/index.js").BlockSchem
|
|
|
594
606
|
type: "numberedListItem";
|
|
595
607
|
content: "inline";
|
|
596
608
|
propSchema: {
|
|
609
|
+
start: {
|
|
610
|
+
default: undefined;
|
|
611
|
+
type: "number";
|
|
612
|
+
};
|
|
597
613
|
backgroundColor: {
|
|
598
614
|
default: "default";
|
|
599
615
|
};
|
|
@@ -96,6 +96,13 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends
|
|
|
96
96
|
* Optional function to customize how cursors of users are rendered
|
|
97
97
|
*/
|
|
98
98
|
renderCursor?: (user: any) => HTMLElement;
|
|
99
|
+
/**
|
|
100
|
+
* Optional flag to set when the user label should be shown with the default
|
|
101
|
+
* collaboration cursor. Setting to "always" will always show the label,
|
|
102
|
+
* while "activity" will only show the label when the user moves the cursor
|
|
103
|
+
* or types. Defaults to "activity".
|
|
104
|
+
*/
|
|
105
|
+
showCursorLabels?: "always" | "activity";
|
|
99
106
|
};
|
|
100
107
|
/**
|
|
101
108
|
* additional tiptap options, undocumented
|
|
@@ -138,6 +145,14 @@ export type BlockNoteEditorOptions<BSchema extends BlockSchema, ISchema extends
|
|
|
138
145
|
@default "prefer-navigate-ui"
|
|
139
146
|
*/
|
|
140
147
|
tabBehavior: "prefer-navigate-ui" | "prefer-indent";
|
|
148
|
+
/**
|
|
149
|
+
* The detection mode for showing the side menu - "viewport" always shows the
|
|
150
|
+
* side menu for the block next to the mouse cursor, while "editor" only shows
|
|
151
|
+
* it when hovering the editor or the side menu itself.
|
|
152
|
+
*
|
|
153
|
+
* @default "viewport"
|
|
154
|
+
*/
|
|
155
|
+
sideMenuDetection: "viewport" | "editor";
|
|
141
156
|
};
|
|
142
157
|
export declare class BlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema> {
|
|
143
158
|
protected readonly options: Partial<BlockNoteEditorOptions<any, any, any>>;
|
|
@@ -18,6 +18,7 @@ type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema
|
|
|
18
18
|
};
|
|
19
19
|
provider: any;
|
|
20
20
|
renderCursor?: (user: any) => HTMLElement;
|
|
21
|
+
showCursorLabels?: "always" | "activity";
|
|
21
22
|
};
|
|
22
23
|
disableExtensions: string[] | undefined;
|
|
23
24
|
setIdAttribute?: boolean;
|
|
@@ -26,6 +27,7 @@ type ExtensionOptions<BSchema extends BlockSchema, I extends InlineContentSchema
|
|
|
26
27
|
dropCursor: (opts: any) => Plugin;
|
|
27
28
|
placeholders: Record<string | "default", string>;
|
|
28
29
|
tabBehavior?: "prefer-navigate-ui" | "prefer-indent";
|
|
30
|
+
sideMenuDetection: "viewport" | "editor";
|
|
29
31
|
};
|
|
30
32
|
/**
|
|
31
33
|
* Get all the Tiptap extensions BlockNote is configured with by default
|
|
@@ -10,10 +10,14 @@ export declare function wrapTableRows(f: Fragment, schema: Schema): Fragment;
|
|
|
10
10
|
/**
|
|
11
11
|
* fix for https://github.com/ProseMirror/prosemirror/issues/1430#issuecomment-1822570821
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* This fix wraps pasted ProseMirror nodes in their own `blockContainer` nodes
|
|
14
|
+
* in most cases. This is to ensure that ProseMirror inserts them as separate
|
|
15
|
+
* blocks, which it sometimes doesn't do because it doesn't have enough context
|
|
16
|
+
* about the hierarchy of the pasted nodes. The issue can be seen when pasting
|
|
17
|
+
* e.g. an image or two consecutive paragraphs, where PM tries to nest the
|
|
18
|
+
* pasted block(s) when it shouldn't.
|
|
16
19
|
*
|
|
17
|
-
*
|
|
20
|
+
* However, the fix is not applied in a few cases. See `shouldApplyFix` for
|
|
21
|
+
* which cases are excluded.
|
|
18
22
|
*/
|
|
19
23
|
export declare function transformPasted(slice: Slice, view: EditorView): Slice;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { PluginView } from "@tiptap/pm/state";
|
|
2
|
-
import {
|
|
3
|
-
import { EditorView } from "prosemirror-view";
|
|
1
|
+
import { EditorState, Plugin, PluginKey, PluginView } from "@tiptap/pm/state";
|
|
2
|
+
import { EditorView } from "@tiptap/pm/view";
|
|
4
3
|
import { Block } from "../../blocks/defaultBlocks.js";
|
|
5
4
|
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
|
|
6
5
|
import { UiElementPosition } from "../../extensions-shared/UiElementPosition.js";
|
|
@@ -14,13 +13,15 @@ export type SideMenuState<BSchema extends BlockSchema, I extends InlineContentSc
|
|
|
14
13
|
*/
|
|
15
14
|
export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> implements PluginView {
|
|
16
15
|
private readonly editor;
|
|
16
|
+
private readonly sideMenuDetection;
|
|
17
17
|
private readonly pmView;
|
|
18
18
|
state?: SideMenuState<BSchema, I, S>;
|
|
19
19
|
readonly emitUpdate: (state: SideMenuState<BSchema, I, S>) => void;
|
|
20
20
|
private mousePos;
|
|
21
21
|
private hoveredBlock;
|
|
22
22
|
menuFrozen: boolean;
|
|
23
|
-
|
|
23
|
+
isDragOrigin: boolean;
|
|
24
|
+
constructor(editor: BlockNoteEditor<BSchema, I, S>, sideMenuDetection: "viewport" | "editor", pmView: EditorView, emitUpdate: (state: SideMenuState<BSchema, I, S>) => void);
|
|
24
25
|
updateState: (state: SideMenuState<BSchema, I, S>) => void;
|
|
25
26
|
updateStateFromMousePos: () => void;
|
|
26
27
|
/**
|
|
@@ -29,6 +30,25 @@ export declare class SideMenuView<BSchema extends BlockSchema, I extends InlineC
|
|
|
29
30
|
* when dragging / dropping to the side of the editor
|
|
30
31
|
*/
|
|
31
32
|
onDrop: (event: DragEvent) => void;
|
|
33
|
+
/**
|
|
34
|
+
* If a block is being dragged, ProseMirror usually gets the context of what's
|
|
35
|
+
* being dragged from `view.dragging`, which is automatically set when a
|
|
36
|
+
* `dragstart` event fires in the editor. However, if the user tries to drag
|
|
37
|
+
* and drop blocks between multiple editors, only the one in which the drag
|
|
38
|
+
* began has that context, so we need to set it on the others manually. This
|
|
39
|
+
* ensures that PM always drops the blocks in between other blocks, and not
|
|
40
|
+
* inside them.
|
|
41
|
+
*
|
|
42
|
+
* After the `dragstart` event fires on the drag handle, it sets
|
|
43
|
+
* `blocknote/html` data on the clipboard. This handler fires right after,
|
|
44
|
+
* parsing the `blocknote/html` data into nodes and setting them on
|
|
45
|
+
* `view.dragging`.
|
|
46
|
+
*
|
|
47
|
+
* Note: Setting `view.dragging` on `dragover` would be better as the user
|
|
48
|
+
* could then drag between editors in different windows, but you can only
|
|
49
|
+
* access `dataTransfer` contents on `dragstart` and `drop` events.
|
|
50
|
+
*/
|
|
51
|
+
onDragStart: (event: DragEvent) => void;
|
|
32
52
|
/**
|
|
33
53
|
* If the event is outside the editor contents,
|
|
34
54
|
* we dispatch a fake event, so that we can still drop the content
|
|
@@ -46,7 +66,7 @@ export declare class SideMenuProsemirrorPlugin<BSchema extends BlockSchema, I ex
|
|
|
46
66
|
private readonly editor;
|
|
47
67
|
view: SideMenuView<BSchema, I, S> | undefined;
|
|
48
68
|
readonly plugin: Plugin;
|
|
49
|
-
constructor(editor: BlockNoteEditor<BSchema, I, S
|
|
69
|
+
constructor(editor: BlockNoteEditor<BSchema, I, S>, sideMenuDetection: "viewport" | "editor");
|
|
50
70
|
onUpdate(callback: (state: SideMenuState<BSchema, I, S>) => void): () => void;
|
|
51
71
|
/**
|
|
52
72
|
* Handles drag & drop events for blocks.
|