@blocknote/core 0.21.0 → 0.22.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 +1023 -999
- 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/paragraphInCustomBlock.html +1 -0
- package/src/api/clipboard/clipboardExternal.test.ts +161 -0
- package/src/api/clipboard/{clipboard.test.ts → clipboardInternal.test.ts} +60 -38
- package/src/api/clipboard/testUtil.ts +27 -0
- package/src/api/clipboard/toClipboard/copyExtension.ts +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/nodeConversions/nodeToBlock.ts +4 -1
- package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +2 -2
- package/src/api/testUtil/partialBlockTestUtil.ts +4 -1
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +3 -19
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +3 -15
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -3
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +25 -5
- package/src/editor/Block.css +3 -3
- package/src/editor/BlockNoteEditor.test.ts +21 -1
- package/src/editor/editor.css +6 -6
- package/src/editor/transformPasted.ts +57 -4
- 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/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +12 -0
- package/types/src/blocks/defaultBlocks.d.ts +16 -0
- package/types/src/editor/transformPasted.d.ts +8 -4
- 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,110 +0,0 @@
|
|
|
1
|
-
import { bundledLanguagesInfo } from "shiki";
|
|
2
|
-
export const defaultSupportedLanguages = [
|
|
3
|
-
{
|
|
4
|
-
id: "text",
|
|
5
|
-
name: "Plain Text",
|
|
6
|
-
match: ["text", "txt", "plain"],
|
|
7
|
-
},
|
|
8
|
-
...bundledLanguagesInfo
|
|
9
|
-
.filter((lang) => {
|
|
10
|
-
return [
|
|
11
|
-
"c",
|
|
12
|
-
"cpp",
|
|
13
|
-
"css",
|
|
14
|
-
"glsl",
|
|
15
|
-
"graphql",
|
|
16
|
-
"haml",
|
|
17
|
-
"html",
|
|
18
|
-
"java",
|
|
19
|
-
"javascript",
|
|
20
|
-
"json",
|
|
21
|
-
"jsonc",
|
|
22
|
-
"jsonl",
|
|
23
|
-
"jsx",
|
|
24
|
-
"julia",
|
|
25
|
-
"less",
|
|
26
|
-
"markdown",
|
|
27
|
-
"mdx",
|
|
28
|
-
"php",
|
|
29
|
-
"postcss",
|
|
30
|
-
"pug",
|
|
31
|
-
"python",
|
|
32
|
-
"r",
|
|
33
|
-
"regexp",
|
|
34
|
-
"sass",
|
|
35
|
-
"scss",
|
|
36
|
-
"shellscript",
|
|
37
|
-
"sql",
|
|
38
|
-
"svelte",
|
|
39
|
-
"typescript",
|
|
40
|
-
"vue",
|
|
41
|
-
"vue-html",
|
|
42
|
-
"wasm",
|
|
43
|
-
"wgsl",
|
|
44
|
-
"xml",
|
|
45
|
-
"yaml",
|
|
46
|
-
].includes(lang.id);
|
|
47
|
-
})
|
|
48
|
-
.map((lang) => ({
|
|
49
|
-
match: [lang.id, ...(lang.aliases || [])],
|
|
50
|
-
id: lang.id,
|
|
51
|
-
name: lang.name,
|
|
52
|
-
})),
|
|
53
|
-
{ id: "tsx", name: "TSX", match: ["tsx", "typescriptreact"] },
|
|
54
|
-
{
|
|
55
|
-
id: "haskell",
|
|
56
|
-
name: "Haskell",
|
|
57
|
-
match: ["haskell", "hs"],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "csharp",
|
|
61
|
-
name: "C#",
|
|
62
|
-
match: ["c#", "csharp", "cs"],
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: "latex",
|
|
66
|
-
name: "LaTeX",
|
|
67
|
-
match: ["latex"],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: "lua",
|
|
71
|
-
name: "Lua",
|
|
72
|
-
match: ["lua"],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: "mermaid",
|
|
76
|
-
name: "Mermaid",
|
|
77
|
-
match: ["mermaid", "mmd"],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: "ruby",
|
|
81
|
-
name: "Ruby",
|
|
82
|
-
match: ["ruby", "rb"],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: "rust",
|
|
86
|
-
name: "Rust",
|
|
87
|
-
match: ["rust", "rs"],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "scala",
|
|
91
|
-
name: "Scala",
|
|
92
|
-
match: ["scala"],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: "swift",
|
|
96
|
-
name: "Swift",
|
|
97
|
-
match: ["swift"],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "kotlin",
|
|
101
|
-
name: "Kotlin",
|
|
102
|
-
match: ["kotlin", "kt", "kts"],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: "objective-c",
|
|
106
|
-
name: "Objective C",
|
|
107
|
-
match: ["objective-c", "objc"],
|
|
108
|
-
},
|
|
109
|
-
];
|
|
110
|
-
//# sourceMappingURL=defaultSupportedLanguages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultSupportedLanguages.js","sourceRoot":"","sources":["../../../../src/blocks/CodeBlockContent/defaultSupportedLanguages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAQ7C,MAAM,CAAC,MAAM,yBAAyB,GAA8B;IAClE;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;KAChC;IACD,GAAG,oBAAoB;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,OAAO;YACL,GAAG;YACH,KAAK;YACL,KAAK;YACL,MAAM;YACN,SAAS;YACT,MAAM;YACN,MAAM;YACN,MAAM;YACN,YAAY;YACZ,MAAM;YACN,OAAO;YACP,OAAO;YACP,KAAK;YACL,OAAO;YACP,MAAM;YACN,UAAU;YACV,KAAK;YACL,KAAK;YACL,SAAS;YACT,KAAK;YACL,QAAQ;YACR,GAAG;YACH,QAAQ;YACR,MAAM;YACN,MAAM;YACN,aAAa;YACb,KAAK;YACL,QAAQ;YACR,YAAY;YACZ,KAAK;YACL,UAAU;YACV,MAAM;YACN,MAAM;YACN,KAAK;YACL,MAAM;SACP,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACd,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE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AC/B;IACD;QACE,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;KAC/B;CACF,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { createBlockSpec, } from "../../schema/index.js";
|
|
2
|
-
import { defaultProps } from "../defaultProps.js";
|
|
3
|
-
import { parseEmbedElement } from "./helpers/parse/parseEmbedElement.js";
|
|
4
|
-
import { parseFigureElement } from "./helpers/parse/parseFigureElement.js";
|
|
5
|
-
import { createFileBlockWrapper } from "./helpers/render/createFileBlockWrapper.js";
|
|
6
|
-
import { createLinkWithCaption } from "./helpers/toExternalHTML/createLinkWithCaption.js";
|
|
7
|
-
export const filePropSchema = {
|
|
8
|
-
backgroundColor: defaultProps.backgroundColor,
|
|
9
|
-
// File name.
|
|
10
|
-
name: {
|
|
11
|
-
default: "",
|
|
12
|
-
},
|
|
13
|
-
// File url.
|
|
14
|
-
url: {
|
|
15
|
-
default: "",
|
|
16
|
-
},
|
|
17
|
-
// File caption.
|
|
18
|
-
caption: {
|
|
19
|
-
default: "",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export const fileBlockConfig = {
|
|
23
|
-
type: "file",
|
|
24
|
-
propSchema: filePropSchema,
|
|
25
|
-
content: "none",
|
|
26
|
-
isFileBlock: true,
|
|
27
|
-
};
|
|
28
|
-
export const fileRender = (block, editor) => {
|
|
29
|
-
return createFileBlockWrapper(block, editor);
|
|
30
|
-
};
|
|
31
|
-
export const fileParse = (element) => {
|
|
32
|
-
if (element.tagName === "EMBED") {
|
|
33
|
-
return parseEmbedElement(element);
|
|
34
|
-
}
|
|
35
|
-
if (element.tagName === "FIGURE") {
|
|
36
|
-
const parsedFigure = parseFigureElement(element, "embed");
|
|
37
|
-
if (!parsedFigure) {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
const { targetElement, caption } = parsedFigure;
|
|
41
|
-
return {
|
|
42
|
-
...parseEmbedElement(targetElement),
|
|
43
|
-
caption,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return undefined;
|
|
47
|
-
};
|
|
48
|
-
export const fileToExternalHTML = (block) => {
|
|
49
|
-
if (!block.props.url) {
|
|
50
|
-
const div = document.createElement("p");
|
|
51
|
-
div.textContent = "Add file";
|
|
52
|
-
return {
|
|
53
|
-
dom: div,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
const fileSrcLink = document.createElement("a");
|
|
57
|
-
fileSrcLink.href = block.props.url;
|
|
58
|
-
fileSrcLink.textContent = block.props.name || block.props.url;
|
|
59
|
-
if (block.props.caption) {
|
|
60
|
-
return createLinkWithCaption(fileSrcLink, block.props.caption);
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
dom: fileSrcLink,
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export const FileBlock = createBlockSpec(fileBlockConfig, {
|
|
67
|
-
render: fileRender,
|
|
68
|
-
parse: fileParse,
|
|
69
|
-
toExternalHTML: fileToExternalHTML,
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=FileBlockContent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileBlockContent.js","sourceRoot":"","sources":["../../../../src/blocks/FileBlockContent/FileBlockContent.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAE1F,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe,EAAE,YAAY,CAAC,eAAe;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;QACxC,GAAG,CAAC,WAAW,GAAG,UAAU,CAAC;QAE7B,OAAO;YACL,GAAG,EAAE,GAAG;SACT,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAChD,WAAW,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;IACnC,WAAW,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;IAE9D,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,OAAO;QACL,GAAG,EAAE,WAAW;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC,eAAe,EAAE;IACxD,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,kBAAkB;CACnC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseEmbedElement.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,EAAE;IAClE,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,SAAS,CAAC;IAE1C,OAAO,EAAE,GAAG,EAAE,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const parseFigureElement = (figureElement, targetTag) => {
|
|
2
|
-
const targetElement = figureElement.querySelector(targetTag);
|
|
3
|
-
if (!targetElement) {
|
|
4
|
-
return undefined;
|
|
5
|
-
}
|
|
6
|
-
const captionElement = figureElement.querySelector("figcaption");
|
|
7
|
-
const caption = captionElement?.textContent ?? undefined;
|
|
8
|
-
return { targetElement, caption };
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=parseFigureElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseFigureElement.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,aAA0B,EAC1B,SAAiB,EACjB,EAAE;IACF,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAC/C,SAAS,CACY,CAAC;IACxB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,cAAc,EAAE,WAAW,IAAI,SAAS,CAAC;IAEzD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export const createAddFileButton = (block, editor, buttonText, buttonIcon) => {
|
|
2
|
-
const addFileButton = document.createElement("div");
|
|
3
|
-
addFileButton.className = "bn-add-file-button";
|
|
4
|
-
const addFileButtonIcon = document.createElement("div");
|
|
5
|
-
addFileButtonIcon.className = "bn-add-file-button-icon";
|
|
6
|
-
if (buttonIcon) {
|
|
7
|
-
addFileButtonIcon.appendChild(buttonIcon);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
addFileButtonIcon.innerHTML =
|
|
11
|
-
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';
|
|
12
|
-
}
|
|
13
|
-
addFileButton.appendChild(addFileButtonIcon);
|
|
14
|
-
const addFileButtonText = document.createElement("p");
|
|
15
|
-
addFileButtonText.className = "bn-add-file-button-text";
|
|
16
|
-
addFileButtonText.innerHTML =
|
|
17
|
-
buttonText || editor.dictionary.file_blocks.file.add_button_text;
|
|
18
|
-
addFileButton.appendChild(addFileButtonText);
|
|
19
|
-
// Prevents focus from moving to the button.
|
|
20
|
-
const addFileButtonMouseDownHandler = (event) => {
|
|
21
|
-
event.preventDefault();
|
|
22
|
-
};
|
|
23
|
-
// Opens the file toolbar.
|
|
24
|
-
const addFileButtonClickHandler = () => {
|
|
25
|
-
editor.dispatch(editor._tiptapEditor.state.tr.setMeta(editor.filePanel.plugin, {
|
|
26
|
-
block: block,
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
29
|
-
addFileButton.addEventListener("mousedown", addFileButtonMouseDownHandler, true);
|
|
30
|
-
addFileButton.addEventListener("click", addFileButtonClickHandler, true);
|
|
31
|
-
return {
|
|
32
|
-
dom: addFileButton,
|
|
33
|
-
destroy: () => {
|
|
34
|
-
addFileButton.removeEventListener("mousedown", addFileButtonMouseDownHandler, true);
|
|
35
|
-
addFileButton.removeEventListener("click", addFileButtonClickHandler, true);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=createAddFileButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createAddFileButton.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAiD,EACjD,MAAsC,EACtC,UAAmB,EACnB,UAAwB,EACxB,EAAE;IACF,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpD,aAAa,CAAC,SAAS,GAAG,oBAAoB,CAAC;IAE/C,MAAM,iBAAiB,GAAG,QAA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CAAC;YACF,aAAa,CAAC,mBAAmB,CAC/B,OAAO,EACP,yBAAyB,EACzB,IAAI,CACL,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { createAddFileButton } from "./createAddFileButton.js";
|
|
2
|
-
import { createFileNameWithIcon } from "./createFileNameWithIcon.js";
|
|
3
|
-
export const createFileBlockWrapper = (block, editor, element, buttonText, buttonIcon) => {
|
|
4
|
-
const wrapper = document.createElement("div");
|
|
5
|
-
wrapper.className = "bn-file-block-content-wrapper";
|
|
6
|
-
// Show the add file button if the file has not been uploaded yet. Change to
|
|
7
|
-
// show a loader if a file upload for the block begins.
|
|
8
|
-
if (block.props.url === "") {
|
|
9
|
-
const addFileButton = createAddFileButton(block, editor, buttonText, buttonIcon);
|
|
10
|
-
wrapper.appendChild(addFileButton.dom);
|
|
11
|
-
const destroyUploadStartHandler = editor.onUploadStart((blockId) => {
|
|
12
|
-
if (blockId === block.id) {
|
|
13
|
-
wrapper.removeChild(addFileButton.dom);
|
|
14
|
-
const loading = document.createElement("div");
|
|
15
|
-
loading.className = "bn-file-loading-preview";
|
|
16
|
-
loading.textContent = "Loading...";
|
|
17
|
-
wrapper.appendChild(loading);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
dom: wrapper,
|
|
22
|
-
destroy: () => {
|
|
23
|
-
destroyUploadStartHandler();
|
|
24
|
-
addFileButton.destroy();
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const ret = { dom: wrapper };
|
|
29
|
-
// Show the file preview, or the file name and icon.
|
|
30
|
-
if (block.props.showPreview === false || !element) {
|
|
31
|
-
// Show file name and icon.
|
|
32
|
-
const fileNameWithIcon = createFileNameWithIcon(block);
|
|
33
|
-
wrapper.appendChild(fileNameWithIcon.dom);
|
|
34
|
-
ret.destroy = () => {
|
|
35
|
-
fileNameWithIcon.destroy?.();
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// Show file preview.
|
|
40
|
-
wrapper.appendChild(element.dom);
|
|
41
|
-
}
|
|
42
|
-
// Show the caption if there is one.
|
|
43
|
-
if (block.props.caption) {
|
|
44
|
-
const caption = document.createElement("p");
|
|
45
|
-
caption.className = "bn-file-caption";
|
|
46
|
-
caption.textContent = block.props.caption;
|
|
47
|
-
wrapper.appendChild(caption);
|
|
48
|
-
}
|
|
49
|
-
return ret;
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=createFileBlockWrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFileBlockWrapper.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAiD,EACjD,MAIC,EACD,OAAoD,EACpD,UAAmB,EACnB,UAAwB,EACxB,EAAE;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,SAAS,GAAG,+BAA+B,CAAC;IAEpD,4EAA4E;IAC5E,uDAAuD;IACvD,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,aAAa,GAAG,mBAAmB,CACvC,KAAK,EACL,MAAM,EACN,UAAU,EACV,UAAU,CACX,CAAC;QACF,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAEvC,MAAM,yBAAyB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,EAAE;YACjE,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;gBACzB,OAAO,CA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,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const FILE_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`;
|
|
2
|
-
export const createFileNameWithIcon = (block) => {
|
|
3
|
-
const file = document.createElement("div");
|
|
4
|
-
file.className = "bn-file-name-with-icon";
|
|
5
|
-
const icon = document.createElement("div");
|
|
6
|
-
icon.className = "bn-file-icon";
|
|
7
|
-
icon.innerHTML = FILE_ICON_SVG;
|
|
8
|
-
file.appendChild(icon);
|
|
9
|
-
const fileName = document.createElement("p");
|
|
10
|
-
fileName.className = "bn-file-name";
|
|
11
|
-
fileName.textContent = block.props.name;
|
|
12
|
-
file.appendChild(fileName);
|
|
13
|
-
return {
|
|
14
|
-
dom: file,
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=createFileNameWithIcon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFileNameWithIcon.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,qQAAqQ,CAAC;AAEnS,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAiD,EACL,EAAE;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,wBAAwB,CAAC;IAE1C,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC;IAChC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;IAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEvB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7C,QAAQ,CAAC,SAAS,GAAG,cAAc,CAAC;IACpC,QAAQ,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;IACxC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE3B,OAAO;QACL,GAAG,EAAE,IAAI;KACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { createFileBlockWrapper } from "./createFileBlockWrapper.js";
|
|
2
|
-
export const createResizableFileBlockWrapper = (block, editor, element, resizeHandlesContainerElement, buttonText, buttonIcon) => {
|
|
3
|
-
const { dom, destroy } = createFileBlockWrapper(block, editor, element, buttonText, buttonIcon);
|
|
4
|
-
const wrapper = dom;
|
|
5
|
-
if (block.props.url && block.props.showPreview) {
|
|
6
|
-
wrapper.style.width = `${block.props.previewWidth}px`;
|
|
7
|
-
}
|
|
8
|
-
const leftResizeHandle = document.createElement("div");
|
|
9
|
-
leftResizeHandle.className = "bn-resize-handle";
|
|
10
|
-
leftResizeHandle.style.left = "4px";
|
|
11
|
-
const rightResizeHandle = document.createElement("div");
|
|
12
|
-
rightResizeHandle.className = "bn-resize-handle";
|
|
13
|
-
rightResizeHandle.style.right = "4px";
|
|
14
|
-
// Temporary parameters set when the user begins resizing the element, used to
|
|
15
|
-
// calculate the new width of the element.
|
|
16
|
-
let resizeParams;
|
|
17
|
-
let width = block.props.previewWidth;
|
|
18
|
-
// Updates the element width with an updated width depending on the cursor X
|
|
19
|
-
// offset from when the resize began, and which resize handle is being used.
|
|
20
|
-
const windowMouseMoveHandler = (event) => {
|
|
21
|
-
if (!resizeParams) {
|
|
22
|
-
if (!editor.isEditable &&
|
|
23
|
-
resizeHandlesContainerElement.contains(leftResizeHandle) &&
|
|
24
|
-
resizeHandlesContainerElement.contains(rightResizeHandle)) {
|
|
25
|
-
resizeHandlesContainerElement.removeChild(leftResizeHandle);
|
|
26
|
-
resizeHandlesContainerElement.removeChild(rightResizeHandle);
|
|
27
|
-
}
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
let newWidth;
|
|
31
|
-
if (block.props.textAlignment === "center") {
|
|
32
|
-
if (resizeParams.handleUsed === "left") {
|
|
33
|
-
newWidth =
|
|
34
|
-
resizeParams.initialWidth +
|
|
35
|
-
(resizeParams.initialClientX - event.clientX) * 2;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
newWidth =
|
|
39
|
-
resizeParams.initialWidth +
|
|
40
|
-
(event.clientX - resizeParams.initialClientX) * 2;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
if (resizeParams.handleUsed === "left") {
|
|
45
|
-
newWidth =
|
|
46
|
-
resizeParams.initialWidth +
|
|
47
|
-
resizeParams.initialClientX -
|
|
48
|
-
event.clientX;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
newWidth =
|
|
52
|
-
resizeParams.initialWidth +
|
|
53
|
-
event.clientX -
|
|
54
|
-
resizeParams.initialClientX;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// Min element width in px.
|
|
58
|
-
const minWidth = 64;
|
|
59
|
-
// Ensures the element is not wider than the editor and not narrower than a
|
|
60
|
-
// predetermined minimum width.
|
|
61
|
-
width = Math.max(newWidth, minWidth);
|
|
62
|
-
wrapper.style.width = `${width}px`;
|
|
63
|
-
};
|
|
64
|
-
// Stops mouse movements from resizing the element and updates the block's
|
|
65
|
-
// `width` prop to the new value.
|
|
66
|
-
const windowMouseUpHandler = (event) => {
|
|
67
|
-
// Hides the drag handles if the cursor is no longer over the element.
|
|
68
|
-
if ((!event.target ||
|
|
69
|
-
!wrapper.contains(event.target) ||
|
|
70
|
-
!editor.isEditable) &&
|
|
71
|
-
resizeHandlesContainerElement.contains(leftResizeHandle) &&
|
|
72
|
-
resizeHandlesContainerElement.contains(rightResizeHandle)) {
|
|
73
|
-
resizeHandlesContainerElement.removeChild(leftResizeHandle);
|
|
74
|
-
resizeHandlesContainerElement.removeChild(rightResizeHandle);
|
|
75
|
-
}
|
|
76
|
-
if (!resizeParams) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
resizeParams = undefined;
|
|
80
|
-
editor.updateBlock(block, {
|
|
81
|
-
props: {
|
|
82
|
-
previewWidth: width,
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
// Shows the resize handles when hovering over the wrapper with the cursor.
|
|
87
|
-
const wrapperMouseEnterHandler = () => {
|
|
88
|
-
if (editor.isEditable) {
|
|
89
|
-
resizeHandlesContainerElement.appendChild(leftResizeHandle);
|
|
90
|
-
resizeHandlesContainerElement.appendChild(rightResizeHandle);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
// Hides the resize handles when the cursor leaves the wrapper, unless the
|
|
94
|
-
// cursor moves to one of the resize handles.
|
|
95
|
-
const wrapperMouseLeaveHandler = (event) => {
|
|
96
|
-
if (event.relatedTarget === leftResizeHandle ||
|
|
97
|
-
event.relatedTarget === rightResizeHandle) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (resizeParams) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (editor.isEditable &&
|
|
104
|
-
resizeHandlesContainerElement.contains(leftResizeHandle) &&
|
|
105
|
-
resizeHandlesContainerElement.contains(rightResizeHandle)) {
|
|
106
|
-
resizeHandlesContainerElement.removeChild(leftResizeHandle);
|
|
107
|
-
resizeHandlesContainerElement.removeChild(rightResizeHandle);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
// Sets the resize params, allowing the user to begin resizing the element by
|
|
111
|
-
// moving the cursor left or right.
|
|
112
|
-
const leftResizeHandleMouseDownHandler = (event) => {
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
resizeParams = {
|
|
115
|
-
handleUsed: "left",
|
|
116
|
-
initialWidth: wrapper.clientWidth,
|
|
117
|
-
initialClientX: event.clientX,
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
const rightResizeHandleMouseDownHandler = (event) => {
|
|
121
|
-
event.preventDefault();
|
|
122
|
-
resizeParams = {
|
|
123
|
-
handleUsed: "right",
|
|
124
|
-
initialWidth: wrapper.clientWidth,
|
|
125
|
-
initialClientX: event.clientX,
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
window.addEventListener("mousemove", windowMouseMoveHandler);
|
|
129
|
-
window.addEventListener("mouseup", windowMouseUpHandler);
|
|
130
|
-
wrapper.addEventListener("mouseenter", wrapperMouseEnterHandler);
|
|
131
|
-
wrapper.addEventListener("mouseleave", wrapperMouseLeaveHandler);
|
|
132
|
-
leftResizeHandle.addEventListener("mousedown", leftResizeHandleMouseDownHandler);
|
|
133
|
-
rightResizeHandle.addEventListener("mousedown", rightResizeHandleMouseDownHandler);
|
|
134
|
-
return {
|
|
135
|
-
dom: wrapper,
|
|
136
|
-
destroy: () => {
|
|
137
|
-
destroy?.();
|
|
138
|
-
window.removeEventListener("mousemove", windowMouseMoveHandler);
|
|
139
|
-
window.removeEventListener("mouseup", windowMouseUpHandler);
|
|
140
|
-
wrapper.removeEventListener("mouseenter", wrapperMouseEnterHandler);
|
|
141
|
-
wrapper.removeEventListener("mouseleave", wrapperMouseLeaveHandler);
|
|
142
|
-
leftResizeHandle.removeEventListener("mousedown", leftResizeHandleMouseDownHandler);
|
|
143
|
-
rightResizeHandle.removeEventListener("mousedown", rightResizeHandleMouseDownHandler);
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
//# sourceMappingURL=createResizableFileBlockWrapper.js.map
|
package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createResizableFileBlockWrapper.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,KAAiD,EACjD,MAAsC,EACtC,OAAmD,EACnD,6BAA0C,EAC1C,UAAkB,EAClB,UAAuB,EACoB,EAAE;IAC7C,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,sBAAsB,CAC7C,KAAK,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,CACX,CAAC;IACF,MAAM,OAAO,GAAG,GAAG,CAAC;IACpB,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC/C,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC;IACxD,CAAC;IAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACvD,gBAAgB,CAAC,SAAS,GAAG,kBAAkB,CAAC;IAChD,gBAAgB,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACxD,iBAAiB,CAAC,SAAS,GAAG,kBAAkB,CAAC;IACjD,iBAAiB,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAEtC,8EAA8E;IAC9E,0CAA0C;IAC1C,IAAI,YAMS,CAAC;IACd,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,YAAuB,CAAC;IAEhD,4EAA4E;IAC5E,4EAA4E;IAC5E,MAAM,sBAAsB,GAAG,CA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AG,EAAE;YACZ,OAAO,EAAE,EAAE,CAAC;YACZ,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;YAChE,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YAC5D,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;YACpE,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;YACpE,gBAAgB,CAAC,mBAAmB,CAClC,WAAW,EACX,gCAAgC,CACjC,CAAC;YACF,iBAAiB,CAAC,mBAAmB,CACnC,WAAW,EACX,iCAAiC,CAClC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const createFigureWithCaption = (element, caption) => {
|
|
2
|
-
const figure = document.createElement("figure");
|
|
3
|
-
const captionElement = document.createElement("figcaption");
|
|
4
|
-
captionElement.textContent = caption;
|
|
5
|
-
figure.appendChild(element);
|
|
6
|
-
figure.appendChild(captionElement);
|
|
7
|
-
return { dom: figure };
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=createFigureWithCaption.js.map
|
package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFigureWithCaption.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,OAAoB,EACpB,OAAe,EACf,EAAE;IACF,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5D,cAAc,CAAC,WAAW,GAAG,OAAO,CAAC;IAErC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAEnC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const createLinkWithCaption = (element, caption) => {
|
|
2
|
-
const wrapper = document.createElement("div");
|
|
3
|
-
const fileCaption = document.createElement("p");
|
|
4
|
-
fileCaption.textContent = caption;
|
|
5
|
-
wrapper.appendChild(element);
|
|
6
|
-
wrapper.appendChild(fileCaption);
|
|
7
|
-
return {
|
|
8
|
-
dom: wrapper,
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=createLinkWithCaption.js.map
|
package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createLinkWithCaption.js","sourceRoot":"","sources":["../../../../../../src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,OAAoB,EACpB,OAAe,EACf,EAAE;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAChD,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC;IAElC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO;QACL,GAAG,EAAE,OAAO;KACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Uploads a file to tmpfiles.org and returns the URL to the uploaded file.
|
|
3
|
-
*
|
|
4
|
-
* @warning This function should only be used for development purposes, replace with your own backend!
|
|
5
|
-
*/
|
|
6
|
-
export const uploadToTmpFilesDotOrg_DEV_ONLY = async (file) => {
|
|
7
|
-
const body = new FormData();
|
|
8
|
-
body.append("file", file);
|
|
9
|
-
const ret = await fetch("https://tmpfiles.org/api/v1/upload", {
|
|
10
|
-
method: "POST",
|
|
11
|
-
body: body,
|
|
12
|
-
});
|
|
13
|
-
return (await ret.json()).data.url.replace("tmpfiles.org/", "tmpfiles.org/dl/");
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=uploadToTmpFilesDotOrg_DEV_ONLY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uploadToTmpFilesDotOrg_DEV_ONLY.js","sourceRoot":"","sources":["../../../../src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,EAClD,IAAU,EACO,EAAE;IACnB,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE1B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,oCAAoC,EAAE;QAC5D,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CACxC,eAAe,EACf,kBAAkB,CACnB,CAAC;AACJ,CAAC,CAAC"}
|