@atlaskit/editor-plugin-media 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/commands/captions.js +59 -0
- package/dist/cjs/commands/helpers.js +127 -0
- package/dist/cjs/commands/index.js +24 -0
- package/dist/cjs/commands/linking.js +181 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/media-plugin-options.js +5 -0
- package/dist/cjs/next-plugin-type.js +5 -0
- package/dist/cjs/nodeviews/mediaGroup.js +376 -0
- package/dist/cjs/nodeviews/mediaInline.js +288 -0
- package/dist/cjs/nodeviews/mediaNodeUpdater.js +739 -0
- package/dist/cjs/nodeviews/mediaNodeView/index.js +177 -0
- package/dist/cjs/nodeviews/mediaNodeView/media.js +242 -0
- package/dist/cjs/nodeviews/mediaSingle.js +629 -0
- package/dist/cjs/nodeviews/messages.js +14 -0
- package/dist/cjs/nodeviews/styles.js +46 -0
- package/dist/cjs/nodeviews/types.js +5 -0
- package/dist/cjs/picker-facade.js +192 -0
- package/dist/cjs/plugin.js +293 -0
- package/dist/cjs/pm-plugins/alt-text/actions.js +5 -0
- package/dist/cjs/pm-plugins/alt-text/commands.js +59 -0
- package/dist/cjs/pm-plugins/alt-text/index.js +36 -0
- package/dist/cjs/pm-plugins/alt-text/keymap.js +15 -0
- package/dist/cjs/pm-plugins/alt-text/messages.js +44 -0
- package/dist/cjs/pm-plugins/alt-text/reducer.js +32 -0
- package/dist/cjs/pm-plugins/alt-text/types.js +5 -0
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +209 -0
- package/dist/cjs/pm-plugins/keymap-media-single.js +163 -0
- package/dist/cjs/pm-plugins/keymap.js +88 -0
- package/dist/cjs/pm-plugins/linking/actions.js +13 -0
- package/dist/cjs/pm-plugins/linking/index.js +65 -0
- package/dist/cjs/pm-plugins/linking/keymap.js +14 -0
- package/dist/cjs/pm-plugins/linking/reducer.js +43 -0
- package/dist/cjs/pm-plugins/linking/types.js +5 -0
- package/dist/cjs/pm-plugins/main.js +813 -0
- package/dist/cjs/pm-plugins/media-editor-plugin-factory.js +8 -0
- package/dist/cjs/pm-plugins/mediaTaskManager.js +101 -0
- package/dist/cjs/pm-plugins/plugin-key.js +8 -0
- package/dist/cjs/pm-plugins/types.js +5 -0
- package/dist/cjs/toolbar/alt-text.js +80 -0
- package/dist/cjs/toolbar/commands.js +236 -0
- package/dist/cjs/toolbar/filePreviewItem.js +66 -0
- package/dist/cjs/toolbar/imageBorder.js +20 -0
- package/dist/cjs/toolbar/index.js +523 -0
- package/dist/cjs/toolbar/linking-toolbar-appearance.js +100 -0
- package/dist/cjs/toolbar/linking.js +96 -0
- package/dist/cjs/toolbar/utils.js +110 -0
- package/dist/cjs/ui/CaptionPlaceholder/index.js +27 -0
- package/dist/cjs/ui/CaptionPlaceholder/messages.js +14 -0
- package/dist/cjs/ui/ImageBorder/index.js +226 -0
- package/dist/cjs/ui/ImageBorder/messages.js +49 -0
- package/dist/cjs/ui/ImageBorder/styles.js +52 -0
- package/dist/cjs/ui/Media/DropPlaceholder.js +38 -0
- package/dist/cjs/ui/Media/drop-placeholder-messages.js +14 -0
- package/dist/cjs/ui/MediaLinkingToolbar.js +196 -0
- package/dist/cjs/ui/MediaPicker/BrowserWrapper.js +40 -0
- package/dist/cjs/ui/MediaPicker/ClipboardWrapper.js +39 -0
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +51 -0
- package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +151 -0
- package/dist/cjs/ui/MediaPicker/index.js +103 -0
- package/dist/cjs/ui/PixelEntry/constants.js +7 -0
- package/dist/cjs/ui/PixelEntry/index.js +185 -0
- package/dist/cjs/ui/PixelEntry/messages.js +54 -0
- package/dist/cjs/ui/PixelEntry/styles.js +19 -0
- package/dist/cjs/ui/PixelEntry/types.js +5 -0
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +16 -0
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +541 -0
- package/dist/cjs/ui/ResizableMediaSingle/index.js +422 -0
- package/dist/cjs/ui/ResizableMediaSingle/styled.js +14 -0
- package/dist/cjs/ui/ResizableMediaSingle/styles.js +17 -0
- package/dist/cjs/ui/ResizableMediaSingle/types.js +5 -0
- package/dist/cjs/ui/ToolbarMedia/index.js +42 -0
- package/dist/cjs/ui/ToolbarMedia/toolbar-media-messages.js +14 -0
- package/dist/cjs/ui/media-linking-toolbar-messages.js +14 -0
- package/dist/cjs/utils/analytics.js +53 -0
- package/dist/cjs/utils/check-media-type.js +56 -0
- package/dist/cjs/utils/current-media-node.js +41 -0
- package/dist/cjs/utils/is-image.js +9 -0
- package/dist/cjs/utils/media-common.js +181 -0
- package/dist/cjs/utils/media-files.js +297 -0
- package/dist/cjs/utils/media-single.js +181 -0
- package/dist/es2019/commands/captions.js +47 -0
- package/dist/es2019/commands/helpers.js +113 -0
- package/dist/es2019/commands/index.js +1 -0
- package/dist/es2019/commands/linking.js +169 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/media-plugin-options.js +1 -0
- package/dist/es2019/next-plugin-type.js +1 -0
- package/dist/es2019/nodeviews/mediaGroup.js +314 -0
- package/dist/es2019/nodeviews/mediaInline.js +201 -0
- package/dist/es2019/nodeviews/mediaNodeUpdater.js +384 -0
- package/dist/es2019/nodeviews/mediaNodeView/index.js +149 -0
- package/dist/es2019/nodeviews/mediaNodeView/media.js +182 -0
- package/dist/es2019/nodeviews/mediaSingle.js +511 -0
- package/dist/es2019/nodeviews/messages.js +8 -0
- package/dist/es2019/nodeviews/styles.js +46 -0
- package/dist/es2019/nodeviews/types.js +1 -0
- package/dist/es2019/picker-facade.js +146 -0
- package/dist/es2019/plugin.js +284 -0
- package/dist/es2019/pm-plugins/alt-text/actions.js +1 -0
- package/dist/es2019/pm-plugins/alt-text/commands.js +42 -0
- package/dist/es2019/pm-plugins/alt-text/index.js +33 -0
- package/dist/es2019/pm-plugins/alt-text/keymap.js +9 -0
- package/dist/es2019/pm-plugins/alt-text/messages.js +38 -0
- package/dist/es2019/pm-plugins/alt-text/reducer.js +26 -0
- package/dist/es2019/pm-plugins/alt-text/types.js +1 -0
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +228 -0
- package/dist/es2019/pm-plugins/keymap-media-single.js +172 -0
- package/dist/es2019/pm-plugins/keymap.js +84 -0
- package/dist/es2019/pm-plugins/linking/actions.js +7 -0
- package/dist/es2019/pm-plugins/linking/index.js +56 -0
- package/dist/es2019/pm-plugins/linking/keymap.js +8 -0
- package/dist/es2019/pm-plugins/linking/reducer.js +37 -0
- package/dist/es2019/pm-plugins/linking/types.js +1 -0
- package/dist/es2019/pm-plugins/main.js +695 -0
- package/dist/es2019/pm-plugins/media-editor-plugin-factory.js +2 -0
- package/dist/es2019/pm-plugins/mediaTaskManager.js +64 -0
- package/dist/es2019/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/pm-plugins/types.js +1 -0
- package/dist/es2019/toolbar/alt-text.js +72 -0
- package/dist/es2019/toolbar/commands.js +212 -0
- package/dist/es2019/toolbar/filePreviewItem.js +54 -0
- package/dist/es2019/toolbar/imageBorder.js +15 -0
- package/dist/es2019/toolbar/index.js +538 -0
- package/dist/es2019/toolbar/linking-toolbar-appearance.js +90 -0
- package/dist/es2019/toolbar/linking.js +98 -0
- package/dist/es2019/toolbar/utils.js +86 -0
- package/dist/es2019/ui/CaptionPlaceholder/index.js +25 -0
- package/dist/es2019/ui/CaptionPlaceholder/messages.js +8 -0
- package/dist/es2019/ui/ImageBorder/index.js +213 -0
- package/dist/es2019/ui/ImageBorder/messages.js +43 -0
- package/dist/es2019/ui/ImageBorder/styles.js +126 -0
- package/dist/es2019/ui/Media/DropPlaceholder.js +47 -0
- package/dist/es2019/ui/Media/drop-placeholder-messages.js +8 -0
- package/dist/es2019/ui/MediaLinkingToolbar.js +190 -0
- package/dist/es2019/ui/MediaPicker/BrowserWrapper.js +31 -0
- package/dist/es2019/ui/MediaPicker/ClipboardWrapper.js +32 -0
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +42 -0
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +85 -0
- package/dist/es2019/ui/MediaPicker/index.js +82 -0
- package/dist/es2019/ui/PixelEntry/constants.js +1 -0
- package/dist/es2019/ui/PixelEntry/index.js +170 -0
- package/dist/es2019/ui/PixelEntry/messages.js +48 -0
- package/dist/es2019/ui/PixelEntry/styles.js +51 -0
- package/dist/es2019/ui/PixelEntry/types.js +1 -0
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +9 -0
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +454 -0
- package/dist/es2019/ui/ResizableMediaSingle/index.js +344 -0
- package/dist/es2019/ui/ResizableMediaSingle/styled.js +9 -0
- package/dist/es2019/ui/ResizableMediaSingle/styles.js +14 -0
- package/dist/es2019/ui/ResizableMediaSingle/types.js +1 -0
- package/dist/es2019/ui/ToolbarMedia/index.js +37 -0
- package/dist/es2019/ui/ToolbarMedia/toolbar-media-messages.js +8 -0
- package/dist/es2019/ui/media-linking-toolbar-messages.js +8 -0
- package/dist/es2019/utils/analytics.js +51 -0
- package/dist/es2019/utils/check-media-type.js +19 -0
- package/dist/es2019/utils/current-media-node.js +35 -0
- package/dist/es2019/utils/is-image.js +3 -0
- package/dist/es2019/utils/media-common.js +189 -0
- package/dist/es2019/utils/media-files.js +321 -0
- package/dist/es2019/utils/media-single.js +176 -0
- package/dist/esm/commands/captions.js +53 -0
- package/dist/esm/commands/helpers.js +120 -0
- package/dist/esm/commands/index.js +1 -0
- package/dist/esm/commands/linking.js +174 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/media-plugin-options.js +1 -0
- package/dist/esm/next-plugin-type.js +1 -0
- package/dist/esm/nodeviews/mediaGroup.js +369 -0
- package/dist/esm/nodeviews/mediaInline.js +278 -0
- package/dist/esm/nodeviews/mediaNodeUpdater.js +732 -0
- package/dist/esm/nodeviews/mediaNodeView/index.js +170 -0
- package/dist/esm/nodeviews/mediaNodeView/media.js +233 -0
- package/dist/esm/nodeviews/mediaSingle.js +622 -0
- package/dist/esm/nodeviews/messages.js +8 -0
- package/dist/esm/nodeviews/styles.js +39 -0
- package/dist/esm/nodeviews/types.js +1 -0
- package/dist/esm/picker-facade.js +186 -0
- package/dist/esm/plugin.js +282 -0
- package/dist/esm/pm-plugins/alt-text/actions.js +1 -0
- package/dist/esm/pm-plugins/alt-text/commands.js +52 -0
- package/dist/esm/pm-plugins/alt-text/index.js +31 -0
- package/dist/esm/pm-plugins/alt-text/keymap.js +9 -0
- package/dist/esm/pm-plugins/alt-text/messages.js +38 -0
- package/dist/esm/pm-plugins/alt-text/reducer.js +25 -0
- package/dist/esm/pm-plugins/alt-text/types.js +1 -0
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +206 -0
- package/dist/esm/pm-plugins/keymap-media-single.js +158 -0
- package/dist/esm/pm-plugins/keymap.js +81 -0
- package/dist/esm/pm-plugins/linking/actions.js +7 -0
- package/dist/esm/pm-plugins/linking/index.js +59 -0
- package/dist/esm/pm-plugins/linking/keymap.js +8 -0
- package/dist/esm/pm-plugins/linking/reducer.js +36 -0
- package/dist/esm/pm-plugins/linking/types.js +1 -0
- package/dist/esm/pm-plugins/main.js +798 -0
- package/dist/esm/pm-plugins/media-editor-plugin-factory.js +2 -0
- package/dist/esm/pm-plugins/mediaTaskManager.js +94 -0
- package/dist/esm/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/pm-plugins/types.js +1 -0
- package/dist/esm/toolbar/alt-text.js +70 -0
- package/dist/esm/toolbar/commands.js +229 -0
- package/dist/esm/toolbar/filePreviewItem.js +56 -0
- package/dist/esm/toolbar/imageBorder.js +14 -0
- package/dist/esm/toolbar/index.js +513 -0
- package/dist/esm/toolbar/linking-toolbar-appearance.js +91 -0
- package/dist/esm/toolbar/linking.js +88 -0
- package/dist/esm/toolbar/utils.js +103 -0
- package/dist/esm/ui/CaptionPlaceholder/index.js +20 -0
- package/dist/esm/ui/CaptionPlaceholder/messages.js +8 -0
- package/dist/esm/ui/ImageBorder/index.js +218 -0
- package/dist/esm/ui/ImageBorder/messages.js +43 -0
- package/dist/esm/ui/ImageBorder/styles.js +42 -0
- package/dist/esm/ui/Media/DropPlaceholder.js +31 -0
- package/dist/esm/ui/Media/drop-placeholder-messages.js +8 -0
- package/dist/esm/ui/MediaLinkingToolbar.js +188 -0
- package/dist/esm/ui/MediaPicker/BrowserWrapper.js +33 -0
- package/dist/esm/ui/MediaPicker/ClipboardWrapper.js +32 -0
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +44 -0
- package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +145 -0
- package/dist/esm/ui/MediaPicker/index.js +96 -0
- package/dist/esm/ui/PixelEntry/constants.js +1 -0
- package/dist/esm/ui/PixelEntry/index.js +174 -0
- package/dist/esm/ui/PixelEntry/messages.js +48 -0
- package/dist/esm/ui/PixelEntry/styles.js +12 -0
- package/dist/esm/ui/PixelEntry/types.js +1 -0
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +9 -0
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +535 -0
- package/dist/esm/ui/ResizableMediaSingle/index.js +417 -0
- package/dist/esm/ui/ResizableMediaSingle/styled.js +7 -0
- package/dist/esm/ui/ResizableMediaSingle/styles.js +7 -0
- package/dist/esm/ui/ResizableMediaSingle/types.js +1 -0
- package/dist/esm/ui/ToolbarMedia/index.js +35 -0
- package/dist/esm/ui/ToolbarMedia/toolbar-media-messages.js +8 -0
- package/dist/esm/ui/media-linking-toolbar-messages.js +8 -0
- package/dist/esm/utils/analytics.js +47 -0
- package/dist/esm/utils/check-media-type.js +49 -0
- package/dist/esm/utils/current-media-node.js +35 -0
- package/dist/esm/utils/is-image.js +3 -0
- package/dist/esm/utils/media-common.js +175 -0
- package/dist/esm/utils/media-files.js +291 -0
- package/dist/esm/utils/media-single.js +172 -0
- package/dist/types/commands/captions.d.ts +5 -0
- package/dist/types/commands/helpers.d.ts +15 -0
- package/dist/types/commands/index.d.ts +1 -0
- package/dist/types/commands/linking.d.ts +9 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/media-plugin-options.d.ts +17 -0
- package/dist/types/next-plugin-type.d.ts +33 -0
- package/dist/types/nodeviews/__mocks__/mediaNodeUpdater.d.ts +24 -0
- package/dist/types/nodeviews/mediaGroup.d.ts +33 -0
- package/dist/types/nodeviews/mediaInline.d.ts +50 -0
- package/dist/types/nodeviews/mediaNodeUpdater.d.ts +45 -0
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +28 -0
- package/dist/types/nodeviews/mediaNodeView/media.d.ts +44 -0
- package/dist/types/nodeviews/mediaSingle.d.ts +62 -0
- package/dist/types/nodeviews/messages.d.ts +7 -0
- package/dist/types/nodeviews/styles.d.ts +16 -0
- package/dist/types/nodeviews/types.d.ts +42 -0
- package/dist/types/picker-facade.d.ts +44 -0
- package/dist/types/plugin.d.ts +7 -0
- package/dist/types/pm-plugins/alt-text/actions.d.ts +10 -0
- package/dist/types/pm-plugins/alt-text/commands.d.ts +4 -0
- package/dist/types/pm-plugins/alt-text/index.d.ts +7 -0
- package/dist/types/pm-plugins/alt-text/keymap.d.ts +4 -0
- package/dist/types/pm-plugins/alt-text/messages.d.ts +37 -0
- package/dist/types/pm-plugins/alt-text/reducer.d.ts +4 -0
- package/dist/types/pm-plugins/alt-text/types.d.ts +3 -0
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +41 -0
- package/dist/types/pm-plugins/keymap-media-single.d.ts +3 -0
- package/dist/types/pm-plugins/keymap.d.ts +6 -0
- package/dist/types/pm-plugins/linking/actions.d.ts +20 -0
- package/dist/types/pm-plugins/linking/index.d.ts +10 -0
- package/dist/types/pm-plugins/linking/keymap.d.ts +3 -0
- package/dist/types/pm-plugins/linking/reducer.d.ts +4 -0
- package/dist/types/pm-plugins/linking/types.d.ts +12 -0
- package/dist/types/pm-plugins/main.d.ts +120 -0
- package/dist/types/pm-plugins/media-editor-plugin-factory.d.ts +3 -0
- package/dist/types/pm-plugins/mediaTaskManager.d.ts +9 -0
- package/dist/types/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/pm-plugins/types.d.ts +65 -0
- package/dist/types/toolbar/alt-text.d.ts +13 -0
- package/dist/types/toolbar/commands.d.ts +12 -0
- package/dist/types/toolbar/filePreviewItem.d.ts +9 -0
- package/dist/types/toolbar/imageBorder.d.ts +2 -0
- package/dist/types/toolbar/index.d.ts +6 -0
- package/dist/types/toolbar/linking-toolbar-appearance.d.ts +14 -0
- package/dist/types/toolbar/linking.d.ts +10 -0
- package/dist/types/toolbar/utils.d.ts +11 -0
- package/dist/types/types.d.ts +2 -1
- package/dist/types/ui/CaptionPlaceholder/index.d.ts +6 -0
- package/dist/types/ui/CaptionPlaceholder/messages.d.ts +7 -0
- package/dist/types/ui/ImageBorder/index.d.ts +11 -0
- package/dist/types/ui/ImageBorder/messages.d.ts +42 -0
- package/dist/types/ui/ImageBorder/styles.d.ts +15 -0
- package/dist/types/ui/Media/DropPlaceholder.d.ts +8 -0
- package/dist/types/ui/Media/drop-placeholder-messages.d.ts +7 -0
- package/dist/types/ui/MediaLinkingToolbar.d.ts +35 -0
- package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +11 -0
- package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +10 -0
- package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +13 -0
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +28 -0
- package/dist/types/ui/MediaPicker/index.d.ts +23 -0
- package/dist/types/ui/PixelEntry/constants.d.ts +1 -0
- package/dist/types/ui/PixelEntry/index.d.ts +8 -0
- package/dist/types/ui/PixelEntry/messages.d.ts +47 -0
- package/dist/types/ui/PixelEntry/styles.d.ts +8 -0
- package/dist/types/ui/PixelEntry/types.d.ts +58 -0
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +3 -0
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +59 -0
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +45 -0
- package/dist/types/ui/ResizableMediaSingle/styled.d.ts +2 -0
- package/dist/types/ui/ResizableMediaSingle/styles.d.ts +1 -0
- package/dist/types/ui/ResizableMediaSingle/types.d.ts +27 -0
- package/dist/types/ui/ToolbarMedia/index.d.ts +13 -0
- package/dist/types/ui/ToolbarMedia/toolbar-media-messages.d.ts +7 -0
- package/dist/types/ui/media-linking-toolbar-messages.d.ts +7 -0
- package/dist/types/utils/analytics.d.ts +3 -0
- package/dist/types/utils/check-media-type.d.ts +4 -0
- package/dist/types/utils/current-media-node.d.ts +9 -0
- package/dist/types/utils/is-image.d.ts +1 -0
- package/dist/types/utils/media-common.d.ts +20 -0
- package/dist/types/utils/media-files.d.ts +30 -0
- package/dist/types/utils/media-single.d.ts +20 -0
- package/package.json +32 -20
- package/report.api.md +430 -0
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/types.d.ts +0 -118
- package/tmp/api-report-tmp.d.ts +0 -9
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
+
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
11
|
+
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
12
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
13
|
+
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
14
|
+
import PickerFacade from '../picker-facade';
|
|
15
|
+
import type { MediaOptions, MediaState, MediaStateStatus, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
16
|
+
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
|
+
export type { MediaState, MediaProvider, MediaStateStatus };
|
|
18
|
+
export { stateKey } from './plugin-key';
|
|
19
|
+
export declare const MEDIA_CONTENT_WRAP_CLASS_NAME = "media-content-wrap";
|
|
20
|
+
export declare const MEDIA_PLUGIN_IS_RESIZING_KEY = "mediaSinglePlugin.isResizing";
|
|
21
|
+
export declare const MEDIA_PLUGIN_RESIZING_WIDTH_KEY = "mediaSinglePlugin.resizing-width";
|
|
22
|
+
export declare class MediaPluginStateImplementation implements MediaPluginState {
|
|
23
|
+
allowsUploads: boolean;
|
|
24
|
+
mediaClientConfig?: MediaClientConfig;
|
|
25
|
+
uploadMediaClientConfig?: MediaClientConfig;
|
|
26
|
+
ignoreLinks: boolean;
|
|
27
|
+
waitForMediaUpload: boolean;
|
|
28
|
+
allUploadsFinished: boolean;
|
|
29
|
+
showDropzone: boolean;
|
|
30
|
+
isFullscreen: boolean;
|
|
31
|
+
element?: HTMLElement;
|
|
32
|
+
layout: MediaSingleLayout;
|
|
33
|
+
mediaNodes: MediaNodeWithPosHandler[];
|
|
34
|
+
options: MediaPluginOptions;
|
|
35
|
+
mediaProvider?: MediaProvider;
|
|
36
|
+
newInsertionBehaviour?: boolean;
|
|
37
|
+
isResizing: boolean;
|
|
38
|
+
resizingWidth: number;
|
|
39
|
+
currentMaxWidth?: number;
|
|
40
|
+
private view;
|
|
41
|
+
private destroyed;
|
|
42
|
+
private contextIdentifierProvider?;
|
|
43
|
+
private errorReporter;
|
|
44
|
+
private customPicker?;
|
|
45
|
+
private removeOnCloseListener;
|
|
46
|
+
private openMediaPickerBrowser?;
|
|
47
|
+
private onPopupToggleCallback;
|
|
48
|
+
private nodeCount;
|
|
49
|
+
private taskManager;
|
|
50
|
+
pickers: PickerFacade[];
|
|
51
|
+
pickerPromises: Array<Promise<PickerFacade>>;
|
|
52
|
+
editingMediaSinglePos?: number;
|
|
53
|
+
showEditingDialog?: boolean;
|
|
54
|
+
mediaOptions?: MediaOptions;
|
|
55
|
+
dispatch?: Dispatch;
|
|
56
|
+
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
57
|
+
singletonCreatedAt: number;
|
|
58
|
+
constructor(state: EditorState, options: MediaPluginOptions, mediaOptions: MediaOptions | undefined, newInsertionBehaviour: boolean | undefined, dispatch: Dispatch | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined);
|
|
59
|
+
clone(): this;
|
|
60
|
+
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
61
|
+
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
62
|
+
getMediaOptions: () => MediaPluginOptions;
|
|
63
|
+
setIsResizing(isResizing: boolean): void;
|
|
64
|
+
setResizingWidth(width: number): void;
|
|
65
|
+
updateElement(): void;
|
|
66
|
+
private isMediaSchemaNode;
|
|
67
|
+
private getDomElement;
|
|
68
|
+
/**
|
|
69
|
+
* we insert a new file by inserting a initial state for that file.
|
|
70
|
+
*
|
|
71
|
+
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
72
|
+
*/
|
|
73
|
+
insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
74
|
+
addPendingTask: (task: Promise<any>) => void;
|
|
75
|
+
splitMediaGroup: () => boolean;
|
|
76
|
+
onPopupPickerClose: () => void;
|
|
77
|
+
showMediaPicker: () => void;
|
|
78
|
+
setBrowseFn: (browseFn: () => void) => void;
|
|
79
|
+
onPopupToggle: (onPopupToggleCallback: (isOpen: boolean) => void) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a promise that is resolved after all pending operations have been finished.
|
|
82
|
+
* An optional timeout will cause the promise to reject if the operation takes too long
|
|
83
|
+
*
|
|
84
|
+
* NOTE: The promise will resolve even if some of the media have failed to process.
|
|
85
|
+
*/
|
|
86
|
+
waitForPendingTasks: (timeout?: number | undefined, lastTask?: Promise<MediaState | null> | undefined) => Promise<MediaState | null>;
|
|
87
|
+
setView(view: EditorView): void;
|
|
88
|
+
/**
|
|
89
|
+
* Called from React UI Component when user clicks on "Delete" icon
|
|
90
|
+
* inside of it
|
|
91
|
+
*/
|
|
92
|
+
handleMediaNodeRemoval: (node: PMNode | undefined, getPos: ProsemirrorGetPosHandler) => void;
|
|
93
|
+
trackMediaNodeAddition: (node: PMNode) => void;
|
|
94
|
+
trackMediaNodeRemoval: (node: PMNode) => void;
|
|
95
|
+
/**
|
|
96
|
+
* Called from React UI Component on componentDidMount
|
|
97
|
+
*/
|
|
98
|
+
handleMediaNodeMount: (node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Called from React UI Component on componentWillUnmount and UNSAFE_componentWillReceiveProps
|
|
101
|
+
* when React component's underlying node property is replaced with a new node
|
|
102
|
+
*/
|
|
103
|
+
handleMediaNodeUnmount: (oldNode: PMNode) => void;
|
|
104
|
+
handleMediaGroupUpdate: (oldNodes: PMNode[], newNodes: PMNode[]) => void;
|
|
105
|
+
destroy(): void;
|
|
106
|
+
findMediaNode: (id: string) => MediaNodeWithPosHandler | null;
|
|
107
|
+
private destroyAllPickers;
|
|
108
|
+
private destroyPickers;
|
|
109
|
+
private initPickers;
|
|
110
|
+
private getInputMethod;
|
|
111
|
+
updateMediaSingleNodeAttrs: (id: string, attrs: object) => boolean | undefined;
|
|
112
|
+
private collectionFromProvider;
|
|
113
|
+
private handleMediaState;
|
|
114
|
+
removeSelectedMediaContainer: () => boolean;
|
|
115
|
+
selectedMediaContainerNode: () => PMNode | undefined;
|
|
116
|
+
handleDrag: (dragState: 'enter' | 'leave') => void;
|
|
117
|
+
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
118
|
+
}
|
|
119
|
+
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
120
|
+
export declare const createPlugin: (_schema: Schema, options: MediaPluginOptions, reactContext: () => {}, getIntl: () => IntlShape, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatch?: Dispatch, mediaOptions?: MediaOptions, newInsertionBehaviour?: boolean) => SafePlugin<MediaPluginState>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MediaState } from '../types';
|
|
2
|
+
export declare class MediaTaskManager {
|
|
3
|
+
private pendingTask;
|
|
4
|
+
private taskMap;
|
|
5
|
+
cancelPendingTask: (id: string) => void;
|
|
6
|
+
waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
|
|
7
|
+
resumePendingTask: (id: string) => void;
|
|
8
|
+
addPendingTask: (task: Promise<any>, id?: string) => Promise<MediaState | null>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
|
+
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
8
|
+
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
9
|
+
import type PickerFacade from '../picker-facade';
|
|
10
|
+
import type { MediaOptions, MediaState, ProsemirrorGetPosHandler } from '../types';
|
|
11
|
+
export interface MediaNodeWithPosHandler {
|
|
12
|
+
node: PMNode;
|
|
13
|
+
getPos: ProsemirrorGetPosHandler;
|
|
14
|
+
}
|
|
15
|
+
export interface MediaPluginState {
|
|
16
|
+
allowsUploads: boolean;
|
|
17
|
+
mediaClientConfig?: MediaClientConfig;
|
|
18
|
+
uploadMediaClientConfig?: MediaClientConfig;
|
|
19
|
+
ignoreLinks: boolean;
|
|
20
|
+
waitForMediaUpload: boolean;
|
|
21
|
+
allUploadsFinished: boolean;
|
|
22
|
+
showDropzone: boolean;
|
|
23
|
+
isFullscreen: boolean;
|
|
24
|
+
element?: HTMLElement;
|
|
25
|
+
layout: MediaSingleLayout;
|
|
26
|
+
mediaNodes: MediaNodeWithPosHandler[];
|
|
27
|
+
options: MediaPluginOptions;
|
|
28
|
+
mediaProvider?: MediaProvider;
|
|
29
|
+
pickers: PickerFacade[];
|
|
30
|
+
pickerPromises: Array<Promise<PickerFacade>>;
|
|
31
|
+
editingMediaSinglePos?: number;
|
|
32
|
+
showEditingDialog?: boolean;
|
|
33
|
+
mediaOptions?: MediaOptions;
|
|
34
|
+
isResizing: boolean;
|
|
35
|
+
resizingWidth: number;
|
|
36
|
+
currentMaxWidth?: number;
|
|
37
|
+
dispatch?: Dispatch;
|
|
38
|
+
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
39
|
+
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
40
|
+
getMediaOptions: () => MediaPluginOptions;
|
|
41
|
+
insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
42
|
+
addPendingTask: (promise: Promise<any>) => void;
|
|
43
|
+
splitMediaGroup: () => boolean;
|
|
44
|
+
onPopupPickerClose: () => void;
|
|
45
|
+
showMediaPicker: () => void;
|
|
46
|
+
setBrowseFn: (browseFn: () => void) => void;
|
|
47
|
+
onPopupToggle: (onPopupToogleCallback: (isOpen: boolean) => void) => void;
|
|
48
|
+
waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
|
|
49
|
+
handleMediaNodeRemoval: (node: PMNode | undefined, getPos: ProsemirrorGetPosHandler) => void;
|
|
50
|
+
handleMediaNodeMount: (node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
|
|
51
|
+
handleMediaNodeUnmount: (oldNode: PMNode) => void;
|
|
52
|
+
handleMediaGroupUpdate: (oldNodes: PMNode[], newNodes: PMNode[]) => void;
|
|
53
|
+
findMediaNode: (id: string) => MediaNodeWithPosHandler | null;
|
|
54
|
+
updateMediaSingleNodeAttrs: (id: string, attrs: object) => undefined | boolean;
|
|
55
|
+
removeSelectedMediaContainer: () => boolean;
|
|
56
|
+
selectedMediaContainerNode: () => PMNode | undefined;
|
|
57
|
+
handleDrag: (dragState: 'enter' | 'leave') => void;
|
|
58
|
+
updateElement(): void;
|
|
59
|
+
setIsResizing(isResizing: boolean): void;
|
|
60
|
+
setResizingWidth(width: number): void;
|
|
61
|
+
setView(view: EditorView): void;
|
|
62
|
+
destroy(): void;
|
|
63
|
+
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
64
|
+
clone(): MediaPluginState;
|
|
65
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { Command, FloatingToolbarButton, FloatingToolbarConfig, FloatingToolbarCustom } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
5
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import type { MediaToolbarBaseConfig } from '../types';
|
|
7
|
+
export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => FloatingToolbarButton<Command>;
|
|
8
|
+
export declare const altTextEditComponent: (options?: AltTextToolbarOptions) => FloatingToolbarCustom<Command>;
|
|
9
|
+
export interface AltTextToolbarOptions {
|
|
10
|
+
altTextValidator?: (value: string) => string[];
|
|
11
|
+
forceFocusSelector?: ForceFocusSelector;
|
|
12
|
+
}
|
|
13
|
+
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BorderMarkAttributes, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { PixelEntryValidation } from '../ui/PixelEntry/types';
|
|
5
|
+
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
6
|
+
export declare const DEFAULT_BORDER_SIZE = 2;
|
|
7
|
+
export declare const changeInlineToMediaCard: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
+
export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
9
|
+
export declare const removeInlineCard: Command;
|
|
10
|
+
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
11
|
+
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
12
|
+
export declare const updateMediaSingleWidth: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (width: number, validation: PixelEntryValidation, layout: RichMediaLayout) => Command;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { MediaPluginState } from '../pm-plugins/types';
|
|
4
|
+
interface FilePreviewProps {
|
|
5
|
+
mediaPluginState: MediaPluginState;
|
|
6
|
+
intl: IntlShape;
|
|
7
|
+
}
|
|
8
|
+
export declare const FilePreviewItem: FC<FilePreviewProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { ExtractInjectionAPI, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
5
|
+
import type { MediaFloatingToolbarOptions } from '../types';
|
|
6
|
+
export declare const floatingToolbar: (state: EditorState, intl: IntlShape, options: MediaFloatingToolbarOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { IntlShape } from 'react-intl-next';
|
|
4
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { MediaLinkingState } from '../pm-plugins/linking';
|
|
6
|
+
export interface LinkingToolbarProps {
|
|
7
|
+
editorState: EditorState;
|
|
8
|
+
intl: IntlShape;
|
|
9
|
+
mediaLinkingState: MediaLinkingState;
|
|
10
|
+
onAddLink: React.MouseEventHandler;
|
|
11
|
+
onEditLink: React.MouseEventHandler;
|
|
12
|
+
onOpenLink: React.MouseEventHandler;
|
|
13
|
+
}
|
|
14
|
+
export declare const LinkToolbarAppearance: React.FC<LinkingToolbarProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
|
+
import type { MediaLinkingState } from '../pm-plugins/linking';
|
|
8
|
+
import type { MediaToolbarBaseConfig } from '../types';
|
|
9
|
+
export declare function shouldShowMediaLinkToolbar(editorState: EditorState): boolean;
|
|
10
|
+
export declare const getLinkingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, mediaLinkingState: MediaLinkingState, state: EditorState, intl: IntlShape, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, providerFactory?: ProviderFactory) => FloatingToolbarConfig | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MediaBaseAttributes, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { MediaPluginState } from '../pm-plugins/types';
|
|
5
|
+
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
6
|
+
export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
|
|
7
|
+
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
8
|
+
export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils/dist/types").FindResult;
|
|
9
|
+
export declare const getPixelWidthOfElement: (editorView: EditorView, pos: number, mediaWidth: number) => number;
|
|
10
|
+
export declare const calcNewLayout: (width: number, layout: RichMediaLayout, contentWidth: number, fullWidthMode?: boolean) => RichMediaLayout;
|
|
11
|
+
export declare const getMaxToolbarWidth: () => number;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -115,4 +115,5 @@ export interface ReactNodeProps {
|
|
|
115
115
|
selected: boolean;
|
|
116
116
|
}
|
|
117
117
|
export type ForwardRef = (node: HTMLElement | null) => void;
|
|
118
|
-
export {};
|
|
118
|
+
export type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
119
|
+
export type { MediaPluginState } from './pm-plugins/types';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
|
|
4
|
+
export interface ImageBorderProps {
|
|
5
|
+
intl: IntlShape;
|
|
6
|
+
toggleBorder: () => void;
|
|
7
|
+
borderMark?: BorderMarkAttributes;
|
|
8
|
+
setBorder: (attrs: Partial<BorderMarkAttributes>) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const ImageBorder: ({ intl: { formatMessage }, toggleBorder, borderMark, setBorder, }: ImageBorderProps) => jsx.JSX.Element;
|
|
11
|
+
export default ImageBorder;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
borderColor: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
borderSize: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
addBorder: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
removeBorder: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
borderOptions: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
borderSizeSubtle: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
borderSizeMedium: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
borderSizeBold: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const menuItemDimensions: {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const itemSpacing: number;
|
|
6
|
+
export declare const contextualMenuArrow: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const contextualMenuColorIcon: (color?: string) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const contextualSubMenu: (index: number) => import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const buttonStyle: (selected: boolean) => import("@emotion/react").SerializedStyles;
|
|
10
|
+
export declare const buttonWrapperStyle: import("@emotion/react").SerializedStyles;
|
|
11
|
+
export declare const line: (size: number, selected: boolean) => import("@emotion/react").SerializedStyles;
|
|
12
|
+
export declare const toolbarButtonWrapper: ({ enabled, isOpen, }: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
}) => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import type { IntlShape, WrappedComponentProps } from 'react-intl-next';
|
|
5
|
+
import type { RecentSearchInputTypes } from '@atlaskit/editor-common/link';
|
|
6
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
7
|
+
export type Props = {
|
|
8
|
+
intl: IntlShape;
|
|
9
|
+
providerFactory: ProviderFactory;
|
|
10
|
+
editing: boolean;
|
|
11
|
+
onBack: (url: string, meta: {
|
|
12
|
+
inputMethod?: RecentSearchInputTypes;
|
|
13
|
+
}) => void;
|
|
14
|
+
onUnlink: () => void;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
onBlur: (href: string) => void;
|
|
17
|
+
onSubmit: (href: string, meta: {
|
|
18
|
+
inputMethod: RecentSearchInputTypes;
|
|
19
|
+
}) => void;
|
|
20
|
+
displayUrl?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare class LinkAddToolbar extends React.PureComponent<Props & WrappedComponentProps> {
|
|
23
|
+
state: {
|
|
24
|
+
validationErrors: never[];
|
|
25
|
+
};
|
|
26
|
+
private handleSubmit;
|
|
27
|
+
private handleOnBack;
|
|
28
|
+
private handleCancel;
|
|
29
|
+
private handleUnlink;
|
|
30
|
+
private handleOnBlur;
|
|
31
|
+
private getValidationErrors;
|
|
32
|
+
private renderContainer;
|
|
33
|
+
render(): jsx.JSX.Element;
|
|
34
|
+
}
|
|
35
|
+
export default LinkAddToolbar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
+
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
4
|
+
type Props = {
|
|
5
|
+
mediaState: MediaPluginState;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
onBrowseFn: (browse: () => void) => void;
|
|
8
|
+
featureFlags?: MediaFeatureFlags;
|
|
9
|
+
};
|
|
10
|
+
export declare const BrowserWrapper: ({ mediaState, isOpen, onBrowseFn, featureFlags, }: Props) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
+
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
4
|
+
type Props = {
|
|
5
|
+
mediaState: MediaPluginState;
|
|
6
|
+
featureFlags?: MediaFeatureFlags;
|
|
7
|
+
container?: HTMLElement;
|
|
8
|
+
};
|
|
9
|
+
export declare const ClipboardWrapper: ({ mediaState, featureFlags, container, }: Props) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
+
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
5
|
+
type Props = {
|
|
6
|
+
mediaState: MediaPluginState;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
featureFlags?: MediaFeatureFlags;
|
|
9
|
+
editorDomElement: Element;
|
|
10
|
+
appearance: EditorAppearance;
|
|
11
|
+
};
|
|
12
|
+
export declare const DropzoneWrapper: ({ mediaState, isActive, featureFlags, editorDomElement, appearance, }: Props) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
3
|
+
import type { BrowserConfig, ClipboardConfig, DropzoneConfig } from '@atlaskit/media-picker/types';
|
|
4
|
+
import PickerFacade from '../../picker-facade';
|
|
5
|
+
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
6
|
+
export interface ChildrenProps {
|
|
7
|
+
config: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
8
|
+
mediaClientConfig: MediaClientConfig;
|
|
9
|
+
pickerFacadeInstance: PickerFacade;
|
|
10
|
+
}
|
|
11
|
+
export type Props = {
|
|
12
|
+
mediaState: MediaPluginState;
|
|
13
|
+
analyticsName: string;
|
|
14
|
+
children: (props: ChildrenProps) => React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
type State = {
|
|
17
|
+
config?: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
18
|
+
mediaClientConfig?: MediaClientConfig;
|
|
19
|
+
pickerFacadeInstance?: PickerFacade;
|
|
20
|
+
};
|
|
21
|
+
export default class PickerFacadeProvider extends React.Component<Props, State> {
|
|
22
|
+
state: State;
|
|
23
|
+
private handleMediaProvider;
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
componentWillUnmount(): void;
|
|
26
|
+
render(): React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { MediaNextEditorPluginType } from '../../next-plugin-type';
|
|
4
|
+
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
5
|
+
type Props = {
|
|
6
|
+
mediaState: MediaPluginState;
|
|
7
|
+
editorDomElement: Element;
|
|
8
|
+
appearance: EditorAppearance;
|
|
9
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
10
|
+
};
|
|
11
|
+
type State = {
|
|
12
|
+
isPopupOpened: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare class MediaPickerComponents extends React.Component<Props, State> {
|
|
15
|
+
static displayName: string;
|
|
16
|
+
state: {
|
|
17
|
+
isPopupOpened: boolean;
|
|
18
|
+
};
|
|
19
|
+
componentDidMount(): void;
|
|
20
|
+
onBrowseFn: (nativeBrowseFn: () => void) => void;
|
|
21
|
+
render(): JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PIXELENTRY_MIGRATION_BUTTON_TESTID = "pixel-entry-convert-pixels-btn";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { IntlShape } from 'react-intl-next';
|
|
4
|
+
import type { PixelEntryProps } from './types';
|
|
5
|
+
export declare const PixelEntry: ({ width, mediaWidth, mediaHeight, onSubmit, minWidth, maxWidth, onChange, intl: { formatMessage }, showMigration, onMigrate, }: PixelEntryProps) => jsx.JSX.Element;
|
|
6
|
+
export declare const FullWidthDisplay: React.FC<{
|
|
7
|
+
intl: IntlShape;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
validationFailedMessage: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
inputWidthTooltip: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
inputWidthAriaLabel: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
inputHeightTooltip: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
inputHeightAriaLabel: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
submitButtonText: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
fullWidthLabel: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
migrationButtonText: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
migrationButtonTooltip: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const pixelSizingWrapper: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const pixelEntryForm: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const pixelSizingInput: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const pixelSizingLabel: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const pixelSizingWidthInput: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const pixelSizingHeightInput: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const pixelEntryHiddenSubmit: import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const pixelSizingFullWidthLabelStyles: import("@emotion/react").SerializedStyles;
|