@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,170 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _get from "@babel/runtime/helpers/get";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
13
|
+
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
14
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
15
|
+
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
16
|
+
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
17
|
+
import { isMediaBlobUrlFromAttrs } from '../../utils/media-common';
|
|
18
|
+
import MediaNode from './media';
|
|
19
|
+
var MediaNodeWithProviders = function MediaNodeWithProviders(_ref) {
|
|
20
|
+
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
21
|
+
innerComponent = _ref.innerComponent;
|
|
22
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width']),
|
|
23
|
+
widthState = _useSharedPluginState.widthState;
|
|
24
|
+
return innerComponent({
|
|
25
|
+
width: widthState
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
function isMediaDecorationSpec(decoration) {
|
|
29
|
+
return decoration.spec.type !== undefined && decoration.spec.selected !== undefined;
|
|
30
|
+
}
|
|
31
|
+
var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
32
|
+
_inherits(MediaNodeView, _SelectionBasedNodeVi);
|
|
33
|
+
var _super = _createSuper(MediaNodeView);
|
|
34
|
+
function MediaNodeView() {
|
|
35
|
+
var _this;
|
|
36
|
+
_classCallCheck(this, MediaNodeView);
|
|
37
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
|
+
args[_key] = arguments[_key];
|
|
39
|
+
}
|
|
40
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "isSelected", false);
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "renderMediaNodeWithState", function (mediaProvider, contextIdentifierProvider) {
|
|
43
|
+
return function (_ref2) {
|
|
44
|
+
var editorWidth = _ref2.width;
|
|
45
|
+
var getPos = _this.getPos;
|
|
46
|
+
var mediaOptions = _this.reactComponentProps.mediaOptions;
|
|
47
|
+
var attrs = _this.getAttrs();
|
|
48
|
+
var url = attrs.type === 'external' ? attrs.url : '';
|
|
49
|
+
var width = attrs.width,
|
|
50
|
+
height = attrs.height;
|
|
51
|
+
if (_this.isMediaBlobUrl()) {
|
|
52
|
+
var urlAttrs = getAttrsFromUrl(url);
|
|
53
|
+
if (urlAttrs) {
|
|
54
|
+
var urlWidth = urlAttrs.width,
|
|
55
|
+
urlHeight = urlAttrs.height;
|
|
56
|
+
width = width || urlWidth;
|
|
57
|
+
height = height || urlHeight;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
width = width || DEFAULT_IMAGE_WIDTH;
|
|
61
|
+
height = height || DEFAULT_IMAGE_HEIGHT;
|
|
62
|
+
var maxDimensions = {
|
|
63
|
+
width: "".concat(editorWidth.width, "px"),
|
|
64
|
+
height: "".concat(height / width * editorWidth.width, "px")
|
|
65
|
+
};
|
|
66
|
+
var originalDimensions = {
|
|
67
|
+
width: width,
|
|
68
|
+
height: height
|
|
69
|
+
};
|
|
70
|
+
return /*#__PURE__*/React.createElement(MediaNode, {
|
|
71
|
+
view: _this.view,
|
|
72
|
+
node: _this.node,
|
|
73
|
+
getPos: getPos,
|
|
74
|
+
selected: _this.nodeInsideSelection(),
|
|
75
|
+
originalDimensions: originalDimensions,
|
|
76
|
+
maxDimensions: maxDimensions,
|
|
77
|
+
url: url,
|
|
78
|
+
mediaProvider: mediaProvider,
|
|
79
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
80
|
+
mediaOptions: mediaOptions
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "renderMediaNodeWithProviders", function (_ref3) {
|
|
85
|
+
var mediaProvider = _ref3.mediaProvider,
|
|
86
|
+
contextIdentifierProvider = _ref3.contextIdentifierProvider;
|
|
87
|
+
var pluginInjectionApi = _this.reactComponentProps.pluginInjectionApi;
|
|
88
|
+
return /*#__PURE__*/React.createElement(MediaNodeWithProviders, {
|
|
89
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
90
|
+
innerComponent: _this.renderMediaNodeWithState(mediaProvider, contextIdentifierProvider)
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
return _this;
|
|
94
|
+
}
|
|
95
|
+
_createClass(MediaNodeView, [{
|
|
96
|
+
key: "createDomRef",
|
|
97
|
+
value: function createDomRef() {
|
|
98
|
+
var domRef = document.createElement('div');
|
|
99
|
+
if (this.reactComponentProps.mediaOptions && this.reactComponentProps.mediaOptions.allowMediaSingleEditable) {
|
|
100
|
+
// workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
|
|
101
|
+
// see also: https://github.com/ProseMirror/prosemirror/issues/884
|
|
102
|
+
domRef.contentEditable = 'true';
|
|
103
|
+
}
|
|
104
|
+
return domRef;
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "viewShouldUpdate",
|
|
108
|
+
value: function viewShouldUpdate(nextNode, decorations) {
|
|
109
|
+
var hasMediaNodeSelectedDecoration = decorations.some(function (decoration) {
|
|
110
|
+
return isMediaDecorationSpec(decoration) && decoration.spec.type === 'media' && decoration.spec.selected;
|
|
111
|
+
});
|
|
112
|
+
if (this.isSelected !== hasMediaNodeSelectedDecoration) {
|
|
113
|
+
this.isSelected = hasMediaNodeSelectedDecoration;
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
if (this.node.attrs !== nextNode.attrs) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return _get(_getPrototypeOf(MediaNodeView.prototype), "viewShouldUpdate", this).call(this, nextNode, decorations);
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "stopEvent",
|
|
123
|
+
value: function stopEvent(event) {
|
|
124
|
+
// Don't trap right click events on media node
|
|
125
|
+
if (['mousedown', 'contextmenu'].indexOf(event.type) !== -1) {
|
|
126
|
+
var mouseEvent = event;
|
|
127
|
+
if (mouseEvent.button === 2) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
key: "getAttrs",
|
|
135
|
+
value: function getAttrs() {
|
|
136
|
+
var attrs = this.node.attrs;
|
|
137
|
+
return attrs;
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
key: "isMediaBlobUrl",
|
|
141
|
+
value: function isMediaBlobUrl() {
|
|
142
|
+
var attrs = this.getAttrs();
|
|
143
|
+
return isMediaBlobUrlFromAttrs(attrs);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "render",
|
|
147
|
+
value: function render() {
|
|
148
|
+
var providerFactory = this.reactComponentProps.providerFactory;
|
|
149
|
+
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
150
|
+
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
151
|
+
providerFactory: providerFactory,
|
|
152
|
+
renderNode: this.renderMediaNodeWithProviders
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}]);
|
|
156
|
+
return MediaNodeView;
|
|
157
|
+
}(SelectionBasedNodeView);
|
|
158
|
+
export var ReactMediaNode = function ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory) {
|
|
159
|
+
var mediaOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
160
|
+
var pluginInjectionApi = arguments.length > 4 ? arguments[4] : undefined;
|
|
161
|
+
return function (node, view, getPos) {
|
|
162
|
+
var hasIntlContext = true;
|
|
163
|
+
return new MediaNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
164
|
+
eventDispatcher: eventDispatcher,
|
|
165
|
+
providerFactory: providerFactory,
|
|
166
|
+
mediaOptions: mediaOptions,
|
|
167
|
+
pluginInjectionApi: pluginInjectionApi
|
|
168
|
+
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
169
|
+
};
|
|
170
|
+
};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
import React, { Component } from 'react';
|
|
13
|
+
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
14
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
15
|
+
import { setNodeSelection, setTextSelection, withImageLoader } from '@atlaskit/editor-common/utils';
|
|
16
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
17
|
+
import { Card, CardLoading } from '@atlaskit/media-card';
|
|
18
|
+
import { stateKey as mediaStateKey } from '../../pm-plugins/plugin-key';
|
|
19
|
+
import { MediaCardWrapper } from '../styles';
|
|
20
|
+
|
|
21
|
+
// This is being used by DropPlaceholder now
|
|
22
|
+
export var MEDIA_HEIGHT = 125;
|
|
23
|
+
export var FILE_WIDTH = 156;
|
|
24
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
25
|
+
export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
26
|
+
_inherits(MediaNode, _Component);
|
|
27
|
+
var _super = _createSuper(MediaNode);
|
|
28
|
+
function MediaNode(_props) {
|
|
29
|
+
var _this;
|
|
30
|
+
_classCallCheck(this, MediaNode);
|
|
31
|
+
_this = _super.call(this, _props);
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "state", {});
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "setViewMediaClientConfig", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
34
|
+
var mediaProvider, viewMediaClientConfig;
|
|
35
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
36
|
+
while (1) switch (_context.prev = _context.next) {
|
|
37
|
+
case 0:
|
|
38
|
+
_context.next = 2;
|
|
39
|
+
return _this.props.mediaProvider;
|
|
40
|
+
case 2:
|
|
41
|
+
mediaProvider = _context.sent;
|
|
42
|
+
if (mediaProvider) {
|
|
43
|
+
viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
44
|
+
_this.setState({
|
|
45
|
+
viewMediaClientConfig: viewMediaClientConfig
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
case 4:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
})));
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "selectMediaSingleFromCard", function (_ref2) {
|
|
55
|
+
var event = _ref2.event;
|
|
56
|
+
_this.selectMediaSingle(event);
|
|
57
|
+
});
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "selectMediaSingle", function (event) {
|
|
59
|
+
var propPos = _this.props.getPos();
|
|
60
|
+
if (typeof propPos !== 'number') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// We need to call "stopPropagation" here in order to prevent the browser from navigating to
|
|
65
|
+
// another URL if the media node is wrapped in a link mark.
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
var state = _this.props.view.state;
|
|
68
|
+
if (event.shiftKey) {
|
|
69
|
+
// don't select text if there is current selection in a table (as this would override selected cells)
|
|
70
|
+
if (state.selection instanceof CellSelection) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setTextSelection(_this.props.view, state.selection.from < propPos ? state.selection.from : propPos - 1,
|
|
74
|
+
// + 3 needed for offset of the media inside mediaSingle and cursor to make whole mediaSingle selected
|
|
75
|
+
state.selection.to > propPos ? state.selection.to : propPos + 2);
|
|
76
|
+
} else {
|
|
77
|
+
setNodeSelection(_this.props.view, propPos - 1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "onFullscreenChange", function (fullscreen) {
|
|
81
|
+
var _this$mediaPluginStat;
|
|
82
|
+
(_this$mediaPluginStat = _this.mediaPluginState) === null || _this$mediaPluginStat === void 0 || _this$mediaPluginStat.updateAndDispatch({
|
|
83
|
+
isFullscreen: fullscreen
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
_defineProperty(_assertThisInitialized(_this), "handleNewNode", function (props) {
|
|
87
|
+
var _this$mediaPluginStat2;
|
|
88
|
+
var node = props.node;
|
|
89
|
+
(_this$mediaPluginStat2 = _this.mediaPluginState) === null || _this$mediaPluginStat2 === void 0 || _this$mediaPluginStat2.handleMediaNodeMount(node, function () {
|
|
90
|
+
return _this.props.getPos();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
var view = _this.props.view;
|
|
94
|
+
_this.mediaPluginState = mediaStateKey.getState(view.state);
|
|
95
|
+
return _this;
|
|
96
|
+
}
|
|
97
|
+
_createClass(MediaNode, [{
|
|
98
|
+
key: "shouldComponentUpdate",
|
|
99
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
100
|
+
var hasNewViewMediaClientConfig = !this.state.viewMediaClientConfig && nextState.viewMediaClientConfig;
|
|
101
|
+
if (this.props.selected !== nextProps.selected || this.props.node.attrs.id !== nextProps.node.attrs.id || this.props.node.attrs.collection !== nextProps.node.attrs.collection || this.props.maxDimensions.height !== nextProps.maxDimensions.height || this.props.maxDimensions.width !== nextProps.maxDimensions.width || this.props.contextIdentifierProvider !== nextProps.contextIdentifierProvider || this.props.isLoading !== nextProps.isLoading || this.props.mediaProvider !== nextProps.mediaProvider || hasNewViewMediaClientConfig) {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "componentDidMount",
|
|
108
|
+
value: function () {
|
|
109
|
+
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
110
|
+
var contextIdentifierProvider;
|
|
111
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
112
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
this.handleNewNode(this.props);
|
|
115
|
+
contextIdentifierProvider = this.props.contextIdentifierProvider;
|
|
116
|
+
_context2.t0 = this;
|
|
117
|
+
_context2.next = 5;
|
|
118
|
+
return contextIdentifierProvider;
|
|
119
|
+
case 5:
|
|
120
|
+
_context2.t1 = _context2.sent;
|
|
121
|
+
_context2.t2 = {
|
|
122
|
+
contextIdentifierProvider: _context2.t1
|
|
123
|
+
};
|
|
124
|
+
_context2.t0.setState.call(_context2.t0, _context2.t2);
|
|
125
|
+
_context2.next = 10;
|
|
126
|
+
return this.setViewMediaClientConfig();
|
|
127
|
+
case 10:
|
|
128
|
+
case "end":
|
|
129
|
+
return _context2.stop();
|
|
130
|
+
}
|
|
131
|
+
}, _callee2, this);
|
|
132
|
+
}));
|
|
133
|
+
function componentDidMount() {
|
|
134
|
+
return _componentDidMount.apply(this, arguments);
|
|
135
|
+
}
|
|
136
|
+
return componentDidMount;
|
|
137
|
+
}()
|
|
138
|
+
}, {
|
|
139
|
+
key: "componentWillUnmount",
|
|
140
|
+
value: function componentWillUnmount() {
|
|
141
|
+
var _this$mediaPluginStat3;
|
|
142
|
+
var node = this.props.node;
|
|
143
|
+
(_this$mediaPluginStat3 = this.mediaPluginState) === null || _this$mediaPluginStat3 === void 0 || _this$mediaPluginStat3.handleMediaNodeUnmount(node);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "componentDidUpdate",
|
|
147
|
+
value: function componentDidUpdate(prevProps) {
|
|
148
|
+
var _this$mediaPluginStat5;
|
|
149
|
+
if (prevProps.node.attrs.id !== this.props.node.attrs.id) {
|
|
150
|
+
var _this$mediaPluginStat4;
|
|
151
|
+
(_this$mediaPluginStat4 = this.mediaPluginState) === null || _this$mediaPluginStat4 === void 0 || _this$mediaPluginStat4.handleMediaNodeUnmount(prevProps.node);
|
|
152
|
+
this.handleNewNode(this.props);
|
|
153
|
+
}
|
|
154
|
+
(_this$mediaPluginStat5 = this.mediaPluginState) === null || _this$mediaPluginStat5 === void 0 || _this$mediaPluginStat5.updateElement();
|
|
155
|
+
this.setViewMediaClientConfig();
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "render",
|
|
159
|
+
value: function render() {
|
|
160
|
+
var _this$props = this.props,
|
|
161
|
+
node = _this$props.node,
|
|
162
|
+
selected = _this$props.selected,
|
|
163
|
+
originalDimensions = _this$props.originalDimensions,
|
|
164
|
+
isLoading = _this$props.isLoading,
|
|
165
|
+
maxDimensions = _this$props.maxDimensions,
|
|
166
|
+
mediaOptions = _this$props.mediaOptions;
|
|
167
|
+
var borderMark = node.marks.find(function (m) {
|
|
168
|
+
return m.type.name === 'border';
|
|
169
|
+
});
|
|
170
|
+
var _this$state = this.state,
|
|
171
|
+
viewMediaClientConfig = _this$state.viewMediaClientConfig,
|
|
172
|
+
contextIdentifierProvider = _this$state.contextIdentifierProvider;
|
|
173
|
+
var _node$attrs = node.attrs,
|
|
174
|
+
id = _node$attrs.id,
|
|
175
|
+
type = _node$attrs.type,
|
|
176
|
+
collection = _node$attrs.collection,
|
|
177
|
+
url = _node$attrs.url,
|
|
178
|
+
alt = _node$attrs.alt;
|
|
179
|
+
if (isLoading || type !== 'external' && !viewMediaClientConfig) {
|
|
180
|
+
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
181
|
+
dimensions: originalDimensions
|
|
182
|
+
}, /*#__PURE__*/React.createElement(CardLoading, null));
|
|
183
|
+
}
|
|
184
|
+
var contextId = contextIdentifierProvider && contextIdentifierProvider.objectId;
|
|
185
|
+
var identifier = type === 'external' ? {
|
|
186
|
+
dataURI: url,
|
|
187
|
+
name: url,
|
|
188
|
+
mediaItemType: 'external-image'
|
|
189
|
+
} : {
|
|
190
|
+
id: id,
|
|
191
|
+
mediaItemType: 'file',
|
|
192
|
+
collectionName: collection
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// mediaClientConfig is not needed for "external" case. So we have to cheat here.
|
|
196
|
+
// there is a possibility mediaClientConfig will be part of a identifier,
|
|
197
|
+
// so this might be not an issue
|
|
198
|
+
var mediaClientConfig = viewMediaClientConfig || {
|
|
199
|
+
authProvider: function authProvider() {
|
|
200
|
+
return {};
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
return /*#__PURE__*/React.createElement(MediaCardWrapper, {
|
|
204
|
+
dimensions: originalDimensions,
|
|
205
|
+
onContextMenu: this.selectMediaSingle,
|
|
206
|
+
borderWidth: borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size,
|
|
207
|
+
selected: selected
|
|
208
|
+
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
209
|
+
data: _defineProperty({}, MEDIA_CONTEXT, {
|
|
210
|
+
border: !!borderMark
|
|
211
|
+
})
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
213
|
+
mediaClientConfig: mediaClientConfig,
|
|
214
|
+
resizeMode: "stretchy-fit",
|
|
215
|
+
dimensions: maxDimensions,
|
|
216
|
+
originalDimensions: originalDimensions,
|
|
217
|
+
identifier: identifier,
|
|
218
|
+
selectable: true,
|
|
219
|
+
selected: selected,
|
|
220
|
+
disableOverlay: true,
|
|
221
|
+
onFullscreenChange: this.onFullscreenChange,
|
|
222
|
+
onClick: this.selectMediaSingleFromCard,
|
|
223
|
+
useInlinePlayer: mediaOptions && mediaOptions.allowLazyLoading,
|
|
224
|
+
isLazy: mediaOptions && mediaOptions.allowLazyLoading,
|
|
225
|
+
featureFlags: mediaOptions && mediaOptions.featureFlags,
|
|
226
|
+
contextId: contextId,
|
|
227
|
+
alt: alt
|
|
228
|
+
})));
|
|
229
|
+
}
|
|
230
|
+
}]);
|
|
231
|
+
return MediaNode;
|
|
232
|
+
}(Component);
|
|
233
|
+
export default withImageLoader(MediaNode);
|