@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
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Fragment, Slice } from "@tiptap/pm/model";
|
|
2
|
-
// helper function to remove a child from a fragment
|
|
3
|
-
function removeChild(node, n) {
|
|
4
|
-
const children = [];
|
|
5
|
-
node.forEach((child, _, i) => {
|
|
6
|
-
if (i !== n) {
|
|
7
|
-
children.push(child);
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
return Fragment.from(children);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Wrap adjacent tableRow items in a table.
|
|
14
|
-
*
|
|
15
|
-
* This makes sure the content that we paste is always a table (and not a tableRow)
|
|
16
|
-
* A table works better for the remaing paste handling logic, as it's actually a blockContent node
|
|
17
|
-
*/
|
|
18
|
-
export function wrapTableRows(f, schema) {
|
|
19
|
-
const newItems = [];
|
|
20
|
-
for (let i = 0; i < f.childCount; i++) {
|
|
21
|
-
if (f.child(i).type.name === "tableRow") {
|
|
22
|
-
if (newItems.length > 0 &&
|
|
23
|
-
newItems[newItems.length - 1].type.name === "table") {
|
|
24
|
-
// append to existing table
|
|
25
|
-
const prevTable = newItems[newItems.length - 1];
|
|
26
|
-
const newTable = prevTable.copy(prevTable.content.addToEnd(f.child(i)));
|
|
27
|
-
newItems[newItems.length - 1] = newTable;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
// create new table to wrap tableRow with
|
|
31
|
-
const newTable = schema.nodes.table.createChecked(undefined, f.child(i));
|
|
32
|
-
newItems.push(newTable);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
newItems.push(f.child(i));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
f = Fragment.from(newItems);
|
|
40
|
-
return f;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* fix for https://github.com/ProseMirror/prosemirror/issues/1430#issuecomment-1822570821
|
|
44
|
-
*
|
|
45
|
-
* Without this fix, pasting two paragraphs would cause the second one to be indented in the other
|
|
46
|
-
* this fix wraps every element in the slice in it's own blockContainer, to prevent Prosemirror from nesting the
|
|
47
|
-
* elements on paste.
|
|
48
|
-
*
|
|
49
|
-
* The exception is when we encounter blockGroups with listitems, because those actually should be nested
|
|
50
|
-
*/
|
|
51
|
-
export function transformPasted(slice, view) {
|
|
52
|
-
let f = Fragment.from(slice.content);
|
|
53
|
-
f = wrapTableRows(f, view.state.schema);
|
|
54
|
-
for (let i = 0; i < f.childCount; i++) {
|
|
55
|
-
if (f.child(i).type.spec.group === "blockContent") {
|
|
56
|
-
const content = [f.child(i)];
|
|
57
|
-
// when there is a blockGroup with lists, it should be nested in the new blockcontainer
|
|
58
|
-
// (if we remove this if-block, the nesting bug will be fixed, but lists won't be nested correctly)
|
|
59
|
-
if (i + 1 < f.childCount &&
|
|
60
|
-
f.child(i + 1).type.name === "blockGroup" // TODO
|
|
61
|
-
) {
|
|
62
|
-
const nestedChild = f
|
|
63
|
-
.child(i + 1)
|
|
64
|
-
.child(0)
|
|
65
|
-
.child(0);
|
|
66
|
-
if (nestedChild.type.name === "bulletListItem" ||
|
|
67
|
-
nestedChild.type.name === "numberedListItem" ||
|
|
68
|
-
nestedChild.type.name === "checkListItem") {
|
|
69
|
-
content.push(f.child(i + 1));
|
|
70
|
-
f = removeChild(f, i + 1);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
const container = view.state.schema.nodes.blockContainer.createChecked(undefined, content);
|
|
74
|
-
f = f.replaceChild(i, container);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return new Slice(f, slice.openStart, slice.openEnd);
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=transformPasted.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformPasted.js","sourceRoot":"","sources":["../../../src/editor/transformPasted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG3D,oDAAoD;AACpD,SAAS,WAAW,CAAC,IAAc,EAAE,CAAS;IAC5C,MAAM,QAAQ,GAAU,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI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,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBAC7B,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC5B,CAAC;YACH,CAAC;YACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CACpE,SAAS,EACT,OAAO,CACR,CAAC;YACF,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export class Exporter {
|
|
2
|
-
mappings;
|
|
3
|
-
options;
|
|
4
|
-
constructor(_schema, // only used for type inference
|
|
5
|
-
mappings, options) {
|
|
6
|
-
this.mappings = mappings;
|
|
7
|
-
this.options = options;
|
|
8
|
-
}
|
|
9
|
-
async resolveFile(url) {
|
|
10
|
-
if (!this.options?.resolveFileUrl) {
|
|
11
|
-
return (await fetch(url)).blob();
|
|
12
|
-
}
|
|
13
|
-
const ret = await this.options.resolveFileUrl(url);
|
|
14
|
-
if (ret instanceof Blob) {
|
|
15
|
-
return ret;
|
|
16
|
-
}
|
|
17
|
-
return (await fetch(ret)).blob();
|
|
18
|
-
}
|
|
19
|
-
mapStyles(styles) {
|
|
20
|
-
const stylesArray = Object.entries(styles).map(([key, value]) => {
|
|
21
|
-
const mappedStyle = this.mappings.styleMapping[key](value, this);
|
|
22
|
-
return mappedStyle;
|
|
23
|
-
});
|
|
24
|
-
return stylesArray;
|
|
25
|
-
}
|
|
26
|
-
mapInlineContent(inlineContent) {
|
|
27
|
-
return this.mappings.inlineContentMapping[inlineContent.type](inlineContent, this);
|
|
28
|
-
}
|
|
29
|
-
transformInlineContent(inlineContentArray) {
|
|
30
|
-
return inlineContentArray.map((ic) => this.mapInlineContent(ic));
|
|
31
|
-
}
|
|
32
|
-
async mapBlock(block, nestingLevel, numberedListIndex) {
|
|
33
|
-
return this.mappings.blockMapping[block.type](block, this, nestingLevel, numberedListIndex);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=Exporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Exporter.js","sourceRoot":"","sources":["../../../src/exporter/Exporter.ts"],"names":[],"mappings":"AAqCA,MAAM,OAAgB,QAAQ;IAWP;IAKH;IAPlB,YACE,OAAiC,EAAE,+BAA+B;IAC/C,QAIlB,EACe,OAAwB;QALrB,aAAQ,GAAR,QAAQ,CAI1B;QACe,YAAO,GAAP,OAAO,CAAiB;IACvC,CAAC;IAEG,KAAK,CAAC,WAAW,CAAC,GAAW;QAClC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;YAClC,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,GAAG,YAAY,IAAI,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAEM,SAAS,CAAC,MAAiB;QAChC,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACjE,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;IACrB,CAAC;IAEM,gBAAgB,CAAC,aAAkC;QACxD,OAAO,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,CAC3D,aAAa,EACb,IAAI,CACL,CAAC;IACJ,CAAC;IAEM,sBAAsB,CAAC,kBAAyC;QACrE,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAIM,KAAK,CAAC,QAAQ,CACnB,KAAwC,EACxC,YAAoB,EACpB,iBAAyB;QAEzB,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAC3C,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,iBAAiB,CAClB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exporter/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The mapping factory is a utility function to easily create mappings for
|
|
3
|
-
* a BlockNoteSchema. Using the factory makes it easier to get typescript code completion etc.
|
|
4
|
-
*/
|
|
5
|
-
export function mappingFactory(_schema) {
|
|
6
|
-
return {
|
|
7
|
-
createBlockMapping: (mapping) => mapping,
|
|
8
|
-
createInlineContentMapping: (mapping) => mapping,
|
|
9
|
-
createStyleMapping: (mapping) => mapping,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=mapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../src/exporter/mapping.ts"],"names":[],"mappings":"AAyDA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAI5B,OAAiC;IACjC,OAAO;QACL,kBAAkB,EAAE,CAAQ,OAAqC,EAAE,EAAE,CACnE,OAAO;QACT,0BAA0B,EAAE,CAC1B,OAA0C,EAC1C,EAAE,CAAC,OAAO;QACZ,kBAAkB,EAAE,CAAI,OAA2B,EAAE,EAAE,CAAC,OAAO;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Extension } from "@tiptap/core";
|
|
2
|
-
import { defaultProps } from "../../blocks/defaultProps.js";
|
|
3
|
-
export const BackgroundColorExtension = Extension.create({
|
|
4
|
-
name: "blockBackgroundColor",
|
|
5
|
-
addGlobalAttributes() {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
types: ["blockContainer"],
|
|
9
|
-
attributes: {
|
|
10
|
-
backgroundColor: {
|
|
11
|
-
default: defaultProps.backgroundColor.default,
|
|
12
|
-
parseHTML: (element) => element.hasAttribute("data-background-color")
|
|
13
|
-
? element.getAttribute("data-background-color")
|
|
14
|
-
: defaultProps.backgroundColor.default,
|
|
15
|
-
renderHTML: (attributes) => {
|
|
16
|
-
if (attributes.backgroundColor ===
|
|
17
|
-
defaultProps.backgroundColor.default) {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
"data-background-color": attributes.backgroundColor,
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
];
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=BackgroundColorExtension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundColorExtension.js","sourceRoot":"","sources":["../../../../src/extensions/BackgroundColor/BackgroundColorExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,CAAC;IACvD,IAAI,EAAE,sBAAsB;IAE5B,mBAAmB;QACjB,OAAO;YACL;gBACE,KAAK,EAAE,CAAC,gBAAgB,CAAC;gBACzB,UAAU,EAAE;oBACV,eAAe,EAAE;wBACf,OAAO,EAAE,YAAY,CAAC,eAAe,CAAC,OAAO;wBAC7C,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CACrB,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC;4BAC3C,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC;4BAC/C,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,OAAO;wBAC1C,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE;4BACzB,IACE,UAAU,CAAC,eAAe;gCAC1B,YAAY,CAAC,eAAe,CAAC,OAAO,EACpC,CAAC;gCACD,OAAO,EAAE,CAAC;4BACZ,CAAC;4BACD,OAAO;gCACL,uBAAuB,EAAE,UAAU,CAAC,eAAe;6BACpD,CAAC;wBACJ,CAAC;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Mark } from "@tiptap/core";
|
|
2
|
-
import { createStyleSpecFromTipTapMark } from "../../schema/index.js";
|
|
3
|
-
const BackgroundColorMark = Mark.create({
|
|
4
|
-
name: "backgroundColor",
|
|
5
|
-
addAttributes() {
|
|
6
|
-
return {
|
|
7
|
-
stringValue: {
|
|
8
|
-
default: undefined,
|
|
9
|
-
parseHTML: (element) => element.getAttribute("data-background-color"),
|
|
10
|
-
renderHTML: (attributes) => ({
|
|
11
|
-
"data-background-color": attributes.stringValue,
|
|
12
|
-
}),
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
parseHTML() {
|
|
17
|
-
return [
|
|
18
|
-
{
|
|
19
|
-
tag: "span",
|
|
20
|
-
getAttrs: (element) => {
|
|
21
|
-
if (typeof element === "string") {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if (element.hasAttribute("data-background-color")) {
|
|
25
|
-
return {
|
|
26
|
-
stringValue: element.getAttribute("data-background-color"),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
},
|
|
34
|
-
renderHTML({ HTMLAttributes }) {
|
|
35
|
-
return ["span", HTMLAttributes, 0];
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
export const BackgroundColor = createStyleSpecFromTipTapMark(BackgroundColorMark, "string");
|
|
39
|
-
//# sourceMappingURL=BackgroundColorMark.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundColorMark.js","sourceRoot":"","sources":["../../../../src/extensions/BackgroundColor/BackgroundColorMark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAEtE,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,iBAAiB;IAEvB,aAAa;QACX,OAAO;YACL,WAAW,EAAE;gBACX,OAAO,EAAE,SAAS;gBAClB,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC;gBACrE,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;oBAC3B,uBAAuB,EAAE,UAAU,CAAC,WAAW;iBAChD,CAAC;aACH;SACF,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,MAAM;gBACX,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;oBACpB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;wBAChC,OAAO,KAAK,CAAC;oBACf,CAAC;oBAED,IAAI,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC;wBAClD,OAAO;4BACL,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC;yBAC3D,CAAC;oBACJ,CAAC;oBAED,OAAO,KAAK,CAAC;gBACf,CAAC;aACF;SACF,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,6BAA6B,CAC1D,mBAAmB,EACnB,QAAQ,CACT,CAAC"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { Plugin, PluginKey } from "prosemirror-state";
|
|
2
|
-
import { EventEmitter } from "../../util/EventEmitter.js";
|
|
3
|
-
export class FilePanelView {
|
|
4
|
-
editor;
|
|
5
|
-
pluginKey;
|
|
6
|
-
pmView;
|
|
7
|
-
state;
|
|
8
|
-
emitUpdate;
|
|
9
|
-
constructor(editor, pluginKey, pmView, emitUpdate) {
|
|
10
|
-
this.editor = editor;
|
|
11
|
-
this.pluginKey = pluginKey;
|
|
12
|
-
this.pmView = pmView;
|
|
13
|
-
this.emitUpdate = () => {
|
|
14
|
-
if (!this.state) {
|
|
15
|
-
throw new Error("Attempting to update uninitialized file panel");
|
|
16
|
-
}
|
|
17
|
-
emitUpdate(this.state);
|
|
18
|
-
};
|
|
19
|
-
pmView.dom.addEventListener("mousedown", this.mouseDownHandler);
|
|
20
|
-
pmView.dom.addEventListener("dragstart", this.dragstartHandler);
|
|
21
|
-
// Setting capture=true ensures that any parent container of the editor that
|
|
22
|
-
// gets scrolled will trigger the scroll event. Scroll events do not bubble
|
|
23
|
-
// and so won't propagate to the document by default.
|
|
24
|
-
pmView.root.addEventListener("scroll", this.scrollHandler, true);
|
|
25
|
-
}
|
|
26
|
-
mouseDownHandler = () => {
|
|
27
|
-
if (this.state?.show) {
|
|
28
|
-
this.state.show = false;
|
|
29
|
-
this.emitUpdate();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
// For dragging the whole editor.
|
|
33
|
-
dragstartHandler = () => {
|
|
34
|
-
if (this.state?.show) {
|
|
35
|
-
this.state.show = false;
|
|
36
|
-
this.emitUpdate();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
scrollHandler = () => {
|
|
40
|
-
if (this.state?.show) {
|
|
41
|
-
const blockElement = this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);
|
|
42
|
-
if (!blockElement) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
this.state.referencePos = blockElement.getBoundingClientRect();
|
|
46
|
-
this.emitUpdate();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
update(view, prevState) {
|
|
50
|
-
const pluginState = this.pluginKey.getState(view.state);
|
|
51
|
-
if (!this.state?.show && pluginState.block && this.editor.isEditable) {
|
|
52
|
-
const blockElement = this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${pluginState.block.id}"]`);
|
|
53
|
-
if (!blockElement) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this.state = {
|
|
57
|
-
show: true,
|
|
58
|
-
referencePos: blockElement.getBoundingClientRect(),
|
|
59
|
-
block: pluginState.block,
|
|
60
|
-
};
|
|
61
|
-
this.emitUpdate();
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (!view.state.selection.eq(prevState.selection) ||
|
|
65
|
-
!view.state.doc.eq(prevState.doc) ||
|
|
66
|
-
!this.editor.isEditable) {
|
|
67
|
-
if (this.state?.show) {
|
|
68
|
-
this.state.show = false;
|
|
69
|
-
this.emitUpdate();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
closeMenu = () => {
|
|
74
|
-
if (this.state?.show) {
|
|
75
|
-
this.state.show = false;
|
|
76
|
-
this.emitUpdate();
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
destroy() {
|
|
80
|
-
this.pmView.dom.removeEventListener("mousedown", this.mouseDownHandler);
|
|
81
|
-
this.pmView.dom.removeEventListener("dragstart", this.dragstartHandler);
|
|
82
|
-
this.pmView.root.removeEventListener("scroll", this.scrollHandler, true);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const filePanelPluginKey = new PluginKey("FilePanelPlugin");
|
|
86
|
-
export class FilePanelProsemirrorPlugin extends EventEmitter {
|
|
87
|
-
view;
|
|
88
|
-
plugin;
|
|
89
|
-
constructor(editor) {
|
|
90
|
-
super();
|
|
91
|
-
this.plugin = new Plugin({
|
|
92
|
-
key: filePanelPluginKey,
|
|
93
|
-
view: (editorView) => {
|
|
94
|
-
this.view = new FilePanelView(editor, filePanelPluginKey, editorView, (state) => {
|
|
95
|
-
this.emit("update", state);
|
|
96
|
-
});
|
|
97
|
-
return this.view;
|
|
98
|
-
},
|
|
99
|
-
props: {
|
|
100
|
-
handleKeyDown: (_view, event) => {
|
|
101
|
-
if (event.key === "Escape" && this.shown) {
|
|
102
|
-
this.view?.closeMenu();
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
return false;
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
state: {
|
|
109
|
-
init: () => {
|
|
110
|
-
return {
|
|
111
|
-
block: undefined,
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
apply: (transaction) => {
|
|
115
|
-
const block = transaction.getMeta(filePanelPluginKey)?.block;
|
|
116
|
-
return {
|
|
117
|
-
block,
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
get shown() {
|
|
124
|
-
return this.view?.state?.show || false;
|
|
125
|
-
}
|
|
126
|
-
onUpdate(callback) {
|
|
127
|
-
return this.on("update", callback);
|
|
128
|
-
}
|
|
129
|
-
closeMenu = () => this.view?.closeMenu();
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=FilePanelPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilePanelPlugin.js","sourceRoot":"","sources":["../../../../src/extensions/FilePanel/FilePanelPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAW/E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAU1D,MAAM,OAAO,aAAa;IAOL;IAKA;IACA;IAVZ,KAAK,CAAwB;IAC7B,UAAU,CAAa;IAE9B,YACmB,MAIhB,EACgB,SAAoB,EACpB,MAAkB,EACnC,UAAiD;QAPhC,WAAM,GAAN,MAAM,CAItB;QACgB,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAY;QAGnC,IAAI,CAAC,UAAU,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;YACnE,CAAC;YAED,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAAC;QAEF,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEhE,4EAA4E;QAC5E,2EAA2E;QAC3E,qDAAqD;QACrD,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,gBAAgB,GAAG,GAAG,EAAE;QACtB,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;YACr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IACrC,CAAC;IAEM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;CACjD"}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { isNodeSelection, isTextSelection, posToDOMRect } from "@tiptap/core";
|
|
2
|
-
import { Plugin, PluginKey } from "prosemirror-state";
|
|
3
|
-
import { EventEmitter } from "../../util/EventEmitter.js";
|
|
4
|
-
export class FormattingToolbarView {
|
|
5
|
-
editor;
|
|
6
|
-
pmView;
|
|
7
|
-
state;
|
|
8
|
-
emitUpdate;
|
|
9
|
-
preventHide = false;
|
|
10
|
-
preventShow = false;
|
|
11
|
-
shouldShow = ({ state, from, to, view }) => {
|
|
12
|
-
const { doc, selection } = state;
|
|
13
|
-
const { empty } = selection;
|
|
14
|
-
// Sometime check for `empty` is not enough.
|
|
15
|
-
// Doubleclick an empty paragraph returns a node size of 2.
|
|
16
|
-
// So we check also for an empty text size.
|
|
17
|
-
const isEmptyTextBlock = !doc.textBetween(from, to).length && isTextSelection(state.selection);
|
|
18
|
-
// Don't show toolbar inside code blocks
|
|
19
|
-
if (selection.$from.parent.type.spec.code ||
|
|
20
|
-
(isNodeSelection(selection) && selection.node.type.spec.code)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
// check view.hasFocus so that the toolbar doesn't show up when the editor is not focused or when for example a code block is focused
|
|
24
|
-
return !(!view.hasFocus() || empty || isEmptyTextBlock);
|
|
25
|
-
};
|
|
26
|
-
constructor(editor, pmView, emitUpdate) {
|
|
27
|
-
this.editor = editor;
|
|
28
|
-
this.pmView = pmView;
|
|
29
|
-
this.emitUpdate = () => {
|
|
30
|
-
if (!this.state) {
|
|
31
|
-
throw new Error("Attempting to update uninitialized formatting toolbar");
|
|
32
|
-
}
|
|
33
|
-
emitUpdate(this.state);
|
|
34
|
-
};
|
|
35
|
-
pmView.dom.addEventListener("mousedown", this.viewMousedownHandler);
|
|
36
|
-
pmView.dom.addEventListener("mouseup", this.viewMouseupHandler);
|
|
37
|
-
pmView.dom.addEventListener("dragstart", this.dragHandler);
|
|
38
|
-
pmView.dom.addEventListener("dragover", this.dragHandler);
|
|
39
|
-
pmView.dom.addEventListener("blur", this.blurHandler);
|
|
40
|
-
// Setting capture=true ensures that any parent container of the editor that
|
|
41
|
-
// gets scrolled will trigger the scroll event. Scroll events do not bubble
|
|
42
|
-
// and so won't propagate to the document by default.
|
|
43
|
-
pmView.root.addEventListener("scroll", this.scrollHandler, true);
|
|
44
|
-
}
|
|
45
|
-
blurHandler = (event) => {
|
|
46
|
-
if (this.preventHide) {
|
|
47
|
-
this.preventHide = false;
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const editorWrapper = this.pmView.dom.parentElement;
|
|
51
|
-
// Checks if the focus is moving to an element outside the editor. If it is,
|
|
52
|
-
// the toolbar is hidden.
|
|
53
|
-
if (
|
|
54
|
-
// An element is clicked.
|
|
55
|
-
event &&
|
|
56
|
-
event.relatedTarget &&
|
|
57
|
-
// Element is inside the editor.
|
|
58
|
-
(editorWrapper === event.relatedTarget ||
|
|
59
|
-
editorWrapper.contains(event.relatedTarget) ||
|
|
60
|
-
event.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (this.state?.show) {
|
|
64
|
-
this.state.show = false;
|
|
65
|
-
this.emitUpdate();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
viewMousedownHandler = () => {
|
|
69
|
-
this.preventShow = true;
|
|
70
|
-
};
|
|
71
|
-
viewMouseupHandler = () => {
|
|
72
|
-
this.preventShow = false;
|
|
73
|
-
setTimeout(() => this.update(this.pmView));
|
|
74
|
-
};
|
|
75
|
-
// For dragging the whole editor.
|
|
76
|
-
dragHandler = () => {
|
|
77
|
-
if (this.state?.show) {
|
|
78
|
-
this.state.show = false;
|
|
79
|
-
this.emitUpdate();
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
scrollHandler = () => {
|
|
83
|
-
if (this.state?.show) {
|
|
84
|
-
this.state.referencePos = this.getSelectionBoundingBox();
|
|
85
|
-
this.emitUpdate();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
update(view, oldState) {
|
|
89
|
-
// Delays the update to handle edge case with drag and drop, where the view
|
|
90
|
-
// is blurred asynchronously and happens only after the state update.
|
|
91
|
-
// Wrapping in a setTimeout gives enough time to wait for the blur event to
|
|
92
|
-
// occur before updating the toolbar.
|
|
93
|
-
const { state, composing } = view;
|
|
94
|
-
const { selection } = state;
|
|
95
|
-
const isSame = oldState &&
|
|
96
|
-
oldState.selection.from === state.selection.from &&
|
|
97
|
-
oldState.selection.to === state.selection.to;
|
|
98
|
-
if (composing || isSame) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
// support for CellSelections
|
|
102
|
-
const { ranges } = selection;
|
|
103
|
-
const from = Math.min(...ranges.map((range) => range.$from.pos));
|
|
104
|
-
const to = Math.max(...ranges.map((range) => range.$to.pos));
|
|
105
|
-
const shouldShow = this.shouldShow?.({
|
|
106
|
-
view,
|
|
107
|
-
state,
|
|
108
|
-
from,
|
|
109
|
-
to,
|
|
110
|
-
});
|
|
111
|
-
// Checks if menu should be shown/updated.
|
|
112
|
-
if (!this.preventShow && (shouldShow || this.preventHide)) {
|
|
113
|
-
// Unlike other UI elements, we don't prevent the formatting toolbar from
|
|
114
|
-
// showing when the editor is not editable. This is because some buttons,
|
|
115
|
-
// e.g. the download file button, should still be accessible. Therefore,
|
|
116
|
-
// logic for hiding when the editor is non-editable is handled
|
|
117
|
-
// individually in each button.
|
|
118
|
-
this.state = {
|
|
119
|
-
show: true,
|
|
120
|
-
referencePos: this.getSelectionBoundingBox(),
|
|
121
|
-
};
|
|
122
|
-
this.emitUpdate();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
// Checks if menu should be hidden.
|
|
126
|
-
if (this.state?.show &&
|
|
127
|
-
!this.preventHide &&
|
|
128
|
-
(!shouldShow || this.preventShow || !this.editor.isEditable)) {
|
|
129
|
-
this.state.show = false;
|
|
130
|
-
this.emitUpdate();
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
destroy() {
|
|
135
|
-
this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler);
|
|
136
|
-
this.pmView.dom.removeEventListener("mouseup", this.viewMouseupHandler);
|
|
137
|
-
this.pmView.dom.removeEventListener("dragstart", this.dragHandler);
|
|
138
|
-
this.pmView.dom.removeEventListener("dragover", this.dragHandler);
|
|
139
|
-
this.pmView.dom.removeEventListener("blur", this.blurHandler);
|
|
140
|
-
this.pmView.root.removeEventListener("scroll", this.scrollHandler, true);
|
|
141
|
-
}
|
|
142
|
-
closeMenu = () => {
|
|
143
|
-
if (this.state?.show) {
|
|
144
|
-
this.state.show = false;
|
|
145
|
-
this.emitUpdate();
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
getSelectionBoundingBox() {
|
|
149
|
-
const { state } = this.pmView;
|
|
150
|
-
const { selection } = state;
|
|
151
|
-
// support for CellSelections
|
|
152
|
-
const { ranges } = selection;
|
|
153
|
-
const from = Math.min(...ranges.map((range) => range.$from.pos));
|
|
154
|
-
const to = Math.max(...ranges.map((range) => range.$to.pos));
|
|
155
|
-
if (isNodeSelection(selection)) {
|
|
156
|
-
const node = this.pmView.nodeDOM(from);
|
|
157
|
-
if (node) {
|
|
158
|
-
return node.getBoundingClientRect();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return posToDOMRect(this.pmView, from, to);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
export const formattingToolbarPluginKey = new PluginKey("FormattingToolbarPlugin");
|
|
165
|
-
export class FormattingToolbarProsemirrorPlugin extends EventEmitter {
|
|
166
|
-
view;
|
|
167
|
-
plugin;
|
|
168
|
-
constructor(editor) {
|
|
169
|
-
super();
|
|
170
|
-
this.plugin = new Plugin({
|
|
171
|
-
key: formattingToolbarPluginKey,
|
|
172
|
-
view: (editorView) => {
|
|
173
|
-
this.view = new FormattingToolbarView(editor, editorView, (state) => {
|
|
174
|
-
this.emit("update", state);
|
|
175
|
-
});
|
|
176
|
-
return this.view;
|
|
177
|
-
},
|
|
178
|
-
props: {
|
|
179
|
-
handleKeyDown: (_view, event) => {
|
|
180
|
-
if (event.key === "Escape" && this.shown) {
|
|
181
|
-
this.view.closeMenu();
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
return false;
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
get shown() {
|
|
190
|
-
return this.view?.state?.show || false;
|
|
191
|
-
}
|
|
192
|
-
onUpdate(callback) {
|
|
193
|
-
return this.on("update", callback);
|
|
194
|
-
}
|
|
195
|
-
closeMenu = () => this.view.closeMenu();
|
|
196
|
-
}
|
|
197
|
-
//# sourceMappingURL=FormattingToolbarPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormattingToolbarPlugin.js","sourceRoot":"","sources":["../../../../src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAe,MAAM,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAU/E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,MAAM,OAAO,qBAAqB;IAmCb;IAKA;IAvCZ,KAAK,CAA0B;IAC/B,UAAU,CAAa;IAEvB,WAAW,GAAG,KAAK,CAAC;IACpB,WAAW,GAAG,KAAK,CAAC;IAEpB,UAAU,GAKD,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC5C,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QACjC,MAAM,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