@atlaskit/editor-plugin-media 1.24.4 → 1.25.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/CHANGELOG.md +14 -0
- package/dist/cjs/hooks/useMediaProvider.js +16 -0
- package/dist/cjs/nodeviews/mediaGroup.js +32 -3
- package/dist/cjs/nodeviews/mediaInline.js +30 -4
- package/dist/cjs/nodeviews/mediaNodeView/index.js +13 -6
- package/dist/cjs/nodeviews/mediaSingle.js +12 -3
- package/dist/cjs/nodeviews/styles.js +4 -1
- package/dist/cjs/plugin.js +45 -36
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +4 -1
- package/dist/cjs/pm-plugins/main.js +9 -2
- package/dist/cjs/toolbar/layout-group.js +4 -1
- package/dist/cjs/toolbar/linking-toolbar-appearance.js +4 -1
- package/dist/cjs/ui/CaptionPlaceholder/index.js +4 -1
- package/dist/cjs/ui/ImageBorder/index.js +4 -1
- package/dist/cjs/ui/Media/DropPlaceholder.js +4 -1
- package/dist/cjs/ui/MediaLinkingToolbar.js +4 -1
- package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +140 -34
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +4 -1
- package/dist/cjs/ui/PixelEntry/index.js +4 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +4 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -1
- package/dist/cjs/ui/ResizableMediaSingle/index.js +4 -1
- package/dist/es2019/hooks/useMediaProvider.js +11 -0
- package/dist/es2019/nodeviews/mediaGroup.js +32 -3
- package/dist/es2019/nodeviews/mediaInline.js +29 -5
- package/dist/es2019/nodeviews/mediaNodeView/index.js +13 -6
- package/dist/es2019/nodeviews/mediaSingle.js +11 -4
- package/dist/es2019/nodeviews/styles.js +4 -1
- package/dist/es2019/plugin.js +8 -0
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +4 -1
- package/dist/es2019/pm-plugins/main.js +9 -2
- package/dist/es2019/toolbar/layout-group.js +4 -1
- package/dist/es2019/toolbar/linking-toolbar-appearance.js +4 -1
- package/dist/es2019/ui/CaptionPlaceholder/index.js +4 -1
- package/dist/es2019/ui/ImageBorder/index.js +4 -1
- package/dist/es2019/ui/Media/DropPlaceholder.js +4 -1
- package/dist/es2019/ui/MediaLinkingToolbar.js +4 -1
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +64 -3
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +4 -1
- package/dist/es2019/ui/PixelEntry/index.js +4 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +4 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -1
- package/dist/es2019/ui/ResizableMediaSingle/index.js +4 -1
- package/dist/esm/hooks/useMediaProvider.js +10 -0
- package/dist/esm/nodeviews/mediaGroup.js +32 -3
- package/dist/esm/nodeviews/mediaInline.js +31 -5
- package/dist/esm/nodeviews/mediaNodeView/index.js +13 -6
- package/dist/esm/nodeviews/mediaSingle.js +13 -4
- package/dist/esm/nodeviews/styles.js +4 -1
- package/dist/esm/plugin.js +45 -36
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +4 -1
- package/dist/esm/pm-plugins/main.js +9 -2
- package/dist/esm/toolbar/layout-group.js +4 -1
- package/dist/esm/toolbar/linking-toolbar-appearance.js +4 -1
- package/dist/esm/ui/CaptionPlaceholder/index.js +4 -1
- package/dist/esm/ui/ImageBorder/index.js +4 -1
- package/dist/esm/ui/Media/DropPlaceholder.js +4 -1
- package/dist/esm/ui/MediaLinkingToolbar.js +4 -1
- package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +136 -34
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +4 -1
- package/dist/esm/ui/PixelEntry/index.js +4 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +4 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -1
- package/dist/esm/ui/ResizableMediaSingle/index.js +4 -1
- package/dist/types/hooks/useMediaProvider.d.ts +3 -0
- package/dist/types/next-plugin-type.d.ts +8 -0
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +5 -3
- package/dist/types/nodeviews/mediaSingle.d.ts +4 -1
- package/dist/types/nodeviews/styles.d.ts +4 -1
- package/dist/types/toolbar/layout-group.d.ts +4 -1
- package/dist/types/toolbar/linking-toolbar-appearance.d.ts +4 -1
- package/dist/types/ui/CaptionPlaceholder/index.d.ts +4 -1
- package/dist/types/ui/Media/DropPlaceholder.d.ts +4 -1
- package/dist/types/ui/MediaLinkingToolbar.d.ts +4 -1
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -13
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +4 -1
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +4 -1
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +4 -1
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +4 -1
- package/dist/types-ts4.5/hooks/useMediaProvider.d.ts +3 -0
- package/dist/types-ts4.5/next-plugin-type.d.ts +8 -0
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +5 -3
- package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +4 -1
- package/dist/types-ts4.5/nodeviews/styles.d.ts +4 -1
- package/dist/types-ts4.5/toolbar/layout-group.d.ts +4 -1
- package/dist/types-ts4.5/toolbar/linking-toolbar-appearance.d.ts +4 -1
- package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +4 -1
- package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +4 -1
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -13
- package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +4 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +4 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +4 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +4 -1
- package/package.json +5 -5
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
import React, { Fragment } from 'react';
|
|
4
7
|
|
|
5
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
|
4
4
|
import { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -11,9 +11,67 @@ const dummyMediaPickerObject = {
|
|
|
11
11
|
destroy: () => {},
|
|
12
12
|
setUploadParams: () => {}
|
|
13
13
|
};
|
|
14
|
+
function PickerFacadeProviderNew({
|
|
15
|
+
mediaState,
|
|
16
|
+
analyticsName,
|
|
17
|
+
children
|
|
18
|
+
}) {
|
|
19
|
+
const [state, setState] = useState({
|
|
20
|
+
pickerFacadeInstance: undefined,
|
|
21
|
+
config: undefined,
|
|
22
|
+
mediaClientConfig: undefined
|
|
23
|
+
});
|
|
24
|
+
const mediaProvider = useMemo(() => mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
|
|
25
|
+
const handleMediaProvider = useCallback(async (_name, provider) => {
|
|
26
|
+
const mediaProvider = await provider;
|
|
27
|
+
if (!mediaProvider || !mediaProvider.uploadParams) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const resolvedMediaClientConfig = (await mediaProvider.uploadMediaClientConfig) || (await mediaProvider.viewMediaClientConfig);
|
|
31
|
+
if (!resolvedMediaClientConfig) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const pickerFacadeConfig = {
|
|
35
|
+
mediaClientConfig: resolvedMediaClientConfig,
|
|
36
|
+
errorReporter: mediaState.options.errorReporter || new ErrorReporter(),
|
|
37
|
+
featureFlags: mediaState.mediaOptions && mediaState.mediaOptions.featureFlags
|
|
38
|
+
};
|
|
39
|
+
const pickerFacadeInstance = await new PickerFacade('customMediaPicker', pickerFacadeConfig, dummyMediaPickerObject, analyticsName).init();
|
|
40
|
+
pickerFacadeInstance.onNewMedia(mediaState.insertFile);
|
|
41
|
+
pickerFacadeInstance.setUploadParams(mediaProvider.uploadParams);
|
|
42
|
+
const config = {
|
|
43
|
+
uploadParams: mediaProvider.uploadParams
|
|
44
|
+
};
|
|
45
|
+
flushSync(() => {
|
|
46
|
+
setState({
|
|
47
|
+
pickerFacadeInstance,
|
|
48
|
+
config,
|
|
49
|
+
mediaClientConfig: resolvedMediaClientConfig
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}, [analyticsName, mediaState.insertFile, mediaState.mediaOptions, mediaState.options.errorReporter]);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (mediaProvider) {
|
|
55
|
+
handleMediaProvider('mediaProvider', Promise.resolve(mediaProvider));
|
|
56
|
+
}
|
|
57
|
+
}, [mediaProvider, handleMediaProvider]);
|
|
58
|
+
const {
|
|
59
|
+
mediaClientConfig,
|
|
60
|
+
config,
|
|
61
|
+
pickerFacadeInstance
|
|
62
|
+
} = state;
|
|
63
|
+
if (!mediaClientConfig || !config || !pickerFacadeInstance) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return children({
|
|
67
|
+
mediaClientConfig,
|
|
68
|
+
config,
|
|
69
|
+
pickerFacadeInstance
|
|
70
|
+
});
|
|
71
|
+
}
|
|
14
72
|
|
|
15
|
-
//eslint-disable-next-line @repo/internal/react/no-class-components
|
|
16
|
-
|
|
73
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
74
|
+
class PickerFacadeProviderOld extends React.Component {
|
|
17
75
|
constructor(...args) {
|
|
18
76
|
super(...args);
|
|
19
77
|
_defineProperty(this, "state", {});
|
|
@@ -91,4 +149,7 @@ export default class PickerFacadeProvider extends React.Component {
|
|
|
91
149
|
pickerFacadeInstance
|
|
92
150
|
});
|
|
93
151
|
}
|
|
152
|
+
}
|
|
153
|
+
export default function PickerFacadeProvider(props) {
|
|
154
|
+
return fg('platform_editor_media_provider_from_plugin_config') ? /*#__PURE__*/React.createElement(PickerFacadeProviderNew, props) : /*#__PURE__*/React.createElement(PickerFacadeProviderOld, props);
|
|
94
155
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
8
|
import { jsx } from '@emotion/react';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
2
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
6
|
import { jsx } from '@emotion/react';
|
|
4
7
|
import { resizableMediaMigrationNotificationStyle } from './styles';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
import React from 'react';
|
|
4
7
|
|
|
5
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
4
7
|
import React from 'react';
|
|
5
8
|
|
|
6
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
export var useMediaProvider = function useMediaProvider(pluginInjectionApi) {
|
|
4
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['media']),
|
|
5
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
6
|
+
var provider = useMemo(function () {
|
|
7
|
+
return mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider;
|
|
8
|
+
}, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
|
|
9
|
+
return provider;
|
|
10
|
+
};
|
|
@@ -21,6 +21,8 @@ import { isNodeSelectedOrInRange, SelectedState, setNodeSelection } from '@atlas
|
|
|
21
21
|
import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
|
|
22
22
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
23
23
|
import { Filmstrip } from '@atlaskit/media-filmstrip';
|
|
24
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
25
|
+
import { useMediaProvider } from '../hooks/useMediaProvider';
|
|
24
26
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
25
27
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
26
28
|
var isMediaGroupSelectedFromProps = function isMediaGroupSelectedFromProps(props) {
|
|
@@ -303,9 +305,11 @@ function MediaGroupNodeViewInternal(_ref3) {
|
|
|
303
305
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorDisabled', 'editorViewMode']),
|
|
304
306
|
editorDisabledPlugin = _useSharedPluginState.editorDisabledState,
|
|
305
307
|
editorViewModePlugin = _useSharedPluginState.editorViewModeState;
|
|
308
|
+
var mediaProvider = useMediaProvider(pluginInjectionApi);
|
|
306
309
|
return renderFn({
|
|
307
310
|
editorDisabledPlugin: editorDisabledPlugin,
|
|
308
|
-
editorViewModePlugin: editorViewModePlugin
|
|
311
|
+
editorViewModePlugin: editorViewModePlugin,
|
|
312
|
+
mediaProvider: mediaProvider
|
|
309
313
|
});
|
|
310
314
|
}
|
|
311
315
|
var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
@@ -323,7 +327,10 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
323
327
|
mediaOptions = props.mediaOptions,
|
|
324
328
|
pluginInjectionApi = props.pluginInjectionApi;
|
|
325
329
|
var getPos = this.getPos;
|
|
326
|
-
return /*#__PURE__*/React.createElement(WithProviders
|
|
330
|
+
return /*#__PURE__*/React.createElement(WithProviders
|
|
331
|
+
// Cleanup: `platform_editor_media_provider_from_plugin_config`
|
|
332
|
+
// Remove `mediaProvider`
|
|
333
|
+
, {
|
|
327
334
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
328
335
|
providerFactory: providerFactory,
|
|
329
336
|
renderNode: function renderNode(_ref4) {
|
|
@@ -331,7 +338,29 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
331
338
|
contextIdentifierProvider = _ref4.contextIdentifierProvider;
|
|
332
339
|
var renderFn = function renderFn(_ref5) {
|
|
333
340
|
var editorDisabledPlugin = _ref5.editorDisabledPlugin,
|
|
334
|
-
editorViewModePlugin = _ref5.editorViewModePlugin
|
|
341
|
+
editorViewModePlugin = _ref5.editorViewModePlugin,
|
|
342
|
+
mediaProviderFromState = _ref5.mediaProvider;
|
|
343
|
+
if (fg('platform_editor_media_provider_from_plugin_config')) {
|
|
344
|
+
var newMediaProvider = mediaProviderFromState ? Promise.resolve(mediaProviderFromState) : undefined;
|
|
345
|
+
if (!newMediaProvider) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
return /*#__PURE__*/React.createElement(IntlMediaGroup, {
|
|
349
|
+
node: _this3.node,
|
|
350
|
+
getPos: getPos,
|
|
351
|
+
view: _this3.view,
|
|
352
|
+
forwardRef: forwardRef,
|
|
353
|
+
disabled: (editorDisabledPlugin || {}).editorDisabled,
|
|
354
|
+
allowLazyLoading: mediaOptions.allowLazyLoading,
|
|
355
|
+
mediaProvider: newMediaProvider,
|
|
356
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
357
|
+
isCopyPasteEnabled: mediaOptions.isCopyPasteEnabled,
|
|
358
|
+
anchorPos: _this3.view.state.selection.$anchor.pos,
|
|
359
|
+
headPos: _this3.view.state.selection.$head.pos,
|
|
360
|
+
mediaOptions: mediaOptions,
|
|
361
|
+
editorViewMode: (editorViewModePlugin === null || editorViewModePlugin === void 0 ? void 0 : editorViewModePlugin.mode) === 'view'
|
|
362
|
+
});
|
|
363
|
+
}
|
|
335
364
|
if (!mediaProvider) {
|
|
336
365
|
return null;
|
|
337
366
|
}
|
|
@@ -12,8 +12,11 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
12
12
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @jsxRuntime classic
|
|
17
|
+
* @jsx jsx
|
|
18
|
+
*/
|
|
19
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
17
20
|
|
|
18
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
22
|
import { jsx } from '@emotion/react';
|
|
@@ -24,6 +27,7 @@ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-
|
|
|
24
27
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
25
28
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
26
29
|
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
30
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
31
|
import { MediaViewerContainer } from '../ui/MediaViewer/MediaViewerContainer';
|
|
28
32
|
import { isImage } from '../utils/is-type';
|
|
29
33
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
@@ -220,7 +224,26 @@ var MediaInlineSharedState = function MediaInlineSharedState(_ref3) {
|
|
|
220
224
|
var _useSharedPluginState = useSharedPluginState(api, ['editorViewMode', 'media']),
|
|
221
225
|
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
222
226
|
mediaState = _useSharedPluginState.mediaState;
|
|
223
|
-
|
|
227
|
+
var newMediaProvider = useMemo(function () {
|
|
228
|
+
return mediaState !== null && mediaState !== void 0 && mediaState.mediaProvider ? Promise.resolve(mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider) : undefined;
|
|
229
|
+
}, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
|
|
230
|
+
if (fg('platform_editor_media_provider_from_plugin_config')) {
|
|
231
|
+
if (!mediaState || !newMediaProvider) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
return jsx(MediaInline, {
|
|
235
|
+
identifier: identifier,
|
|
236
|
+
mediaProvider: newMediaProvider,
|
|
237
|
+
mediaPluginState: mediaState,
|
|
238
|
+
node: node,
|
|
239
|
+
isSelected: isSelected,
|
|
240
|
+
view: view,
|
|
241
|
+
getPos: getPos,
|
|
242
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
243
|
+
editorViewMode: (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view'
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
if (!mediaState || !mediaProvider) {
|
|
224
247
|
return null;
|
|
225
248
|
}
|
|
226
249
|
return jsx(MediaInline, {
|
|
@@ -270,13 +293,16 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
270
293
|
api = props.api;
|
|
271
294
|
var view = this.view;
|
|
272
295
|
var getPos = this.getPos;
|
|
273
|
-
return jsx(WithProviders
|
|
296
|
+
return jsx(WithProviders
|
|
297
|
+
// Cleanup: `platform_editor_media_provider_from_plugin_config`
|
|
298
|
+
// Remove `mediaProvider`
|
|
299
|
+
, {
|
|
274
300
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
275
301
|
providerFactory: providerFactory,
|
|
276
302
|
renderNode: function renderNode(_ref4) {
|
|
277
303
|
var mediaProvider = _ref4.mediaProvider,
|
|
278
304
|
contextIdentifierProvider = _ref4.contextIdentifierProvider;
|
|
279
|
-
if (!mediaProvider) {
|
|
305
|
+
if (!mediaProvider && !fg('platform_editor_media_provider_from_plugin_config')) {
|
|
280
306
|
return null;
|
|
281
307
|
}
|
|
282
308
|
return jsx(MediaInlineSharedState, {
|
|
@@ -18,16 +18,19 @@ import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-comm
|
|
|
18
18
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
19
19
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
20
20
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
21
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
22
|
import { updateCurrentMediaNodeAttrs } from '../../commands/helpers';
|
|
22
23
|
import { isMediaBlobUrlFromAttrs } from '../../utils/media-common';
|
|
23
24
|
import MediaNode from './media';
|
|
24
25
|
var MediaNodeWithProviders = function MediaNodeWithProviders(_ref) {
|
|
25
26
|
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
26
27
|
innerComponent = _ref.innerComponent;
|
|
27
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width']),
|
|
28
|
-
widthState = _useSharedPluginState.widthState
|
|
28
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width', 'media']),
|
|
29
|
+
widthState = _useSharedPluginState.widthState,
|
|
30
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
29
31
|
return innerComponent({
|
|
30
|
-
width: widthState
|
|
32
|
+
width: widthState,
|
|
33
|
+
newMediaProvider: mediaState !== null && mediaState !== void 0 && mediaState.mediaProvider ? Promise.resolve(mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider) : undefined
|
|
31
34
|
});
|
|
32
35
|
};
|
|
33
36
|
function isMediaDecorationSpec(decoration) {
|
|
@@ -62,7 +65,8 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
62
65
|
});
|
|
63
66
|
_defineProperty(_assertThisInitialized(_this), "renderMediaNodeWithState", function (mediaProvider, contextIdentifierProvider) {
|
|
64
67
|
return function (_ref2) {
|
|
65
|
-
var editorWidth = _ref2.width
|
|
68
|
+
var editorWidth = _ref2.width,
|
|
69
|
+
newMediaProvider = _ref2.newMediaProvider;
|
|
66
70
|
var getPos = _this.getPos;
|
|
67
71
|
var mediaOptions = _this.reactComponentProps.mediaOptions;
|
|
68
72
|
var attrs = _this.getAttrs();
|
|
@@ -98,7 +102,7 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
98
102
|
originalDimensions: originalDimensions,
|
|
99
103
|
maxDimensions: maxDimensions,
|
|
100
104
|
url: url,
|
|
101
|
-
mediaProvider: mediaProvider,
|
|
105
|
+
mediaProvider: fg('platform_editor_media_provider_from_plugin_config') ? newMediaProvider : mediaProvider,
|
|
102
106
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
103
107
|
mediaOptions: mediaOptions,
|
|
104
108
|
onExternalImageLoaded: _this.onExternalImageLoaded
|
|
@@ -170,7 +174,10 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
170
174
|
key: "render",
|
|
171
175
|
value: function render() {
|
|
172
176
|
var providerFactory = this.reactComponentProps.providerFactory;
|
|
173
|
-
return /*#__PURE__*/React.createElement(WithProviders
|
|
177
|
+
return /*#__PURE__*/React.createElement(WithProviders
|
|
178
|
+
// Cleanup: `platform_editor_media_provider_from_plugin_config`
|
|
179
|
+
// Remove `mediaProvider`
|
|
180
|
+
, {
|
|
174
181
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
175
182
|
providerFactory: providerFactory,
|
|
176
183
|
renderNode: this.renderMediaNodeWithProviders
|
|
@@ -13,9 +13,12 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
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); }; }
|
|
15
15
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @jsxRuntime classic
|
|
18
|
+
* @jsx jsx
|
|
19
|
+
*/
|
|
17
20
|
|
|
18
|
-
import React, { Component, Fragment } from 'react';
|
|
21
|
+
import React, { Component, Fragment, useMemo } from 'react';
|
|
19
22
|
|
|
20
23
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
21
24
|
import { css, jsx } from '@emotion/react';
|
|
@@ -501,12 +504,15 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
501
504
|
annotationState = _useSharedPluginState.annotationState,
|
|
502
505
|
editorDisabledState = _useSharedPluginState.editorDisabledState,
|
|
503
506
|
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
507
|
+
var newMediaProvider = useMemo(function () {
|
|
508
|
+
return mediaState !== null && mediaState !== void 0 && mediaState.mediaProvider ? Promise.resolve(mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider) : undefined;
|
|
509
|
+
}, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
|
|
504
510
|
return jsx(MediaSingleNode, {
|
|
505
511
|
width: widthState.width,
|
|
506
512
|
lineLength: widthState.lineLength,
|
|
507
513
|
node: node,
|
|
508
514
|
getPos: getPos,
|
|
509
|
-
mediaProvider: mediaProvider,
|
|
515
|
+
mediaProvider: fg('platform_editor_media_provider_from_plugin_config') ? newMediaProvider : mediaProvider,
|
|
510
516
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
511
517
|
mediaOptions: mediaOptions,
|
|
512
518
|
view: view,
|
|
@@ -647,7 +653,10 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
647
653
|
|
|
648
654
|
// getPos is a boolean for marks, since this is a node we know it must be a function
|
|
649
655
|
var getPos = this.getPos;
|
|
650
|
-
return jsx(WithProviders
|
|
656
|
+
return jsx(WithProviders
|
|
657
|
+
// Cleanup: `platform_editor_media_provider_from_plugin_config`
|
|
658
|
+
// Remove `mediaProvider`
|
|
659
|
+
, {
|
|
651
660
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
652
661
|
providerFactory: providerFactory,
|
|
653
662
|
renderNode: function renderNode(_ref7) {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -57,16 +57,25 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
57
57
|
insertMediaAsMediaSingle: function insertMediaAsMediaSingle(view, node, inputMethod) {
|
|
58
58
|
var _api$analytics;
|
|
59
59
|
return _insertMediaAsMediaSingle(view, node, inputMethod, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
60
|
+
},
|
|
61
|
+
setProvider: function setProvider(provider) {
|
|
62
|
+
var _api$core$actions$exe;
|
|
63
|
+
return (_api$core$actions$exe = api === null || api === void 0 ? void 0 : api.core.actions.execute(function (_ref3) {
|
|
64
|
+
var tr = _ref3.tr;
|
|
65
|
+
return tr.setMeta(stateKey, {
|
|
66
|
+
mediaProvider: provider
|
|
67
|
+
});
|
|
68
|
+
})) !== null && _api$core$actions$exe !== void 0 ? _api$core$actions$exe : false;
|
|
60
69
|
}
|
|
61
70
|
},
|
|
62
71
|
nodes: function nodes() {
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
allowMediaGroup =
|
|
66
|
-
|
|
67
|
-
allowMediaSingle =
|
|
68
|
-
allowCaptions =
|
|
69
|
-
mediaFeatureFlags =
|
|
72
|
+
var _ref4 = options || {},
|
|
73
|
+
_ref4$allowMediaGroup = _ref4.allowMediaGroup,
|
|
74
|
+
allowMediaGroup = _ref4$allowMediaGroup === void 0 ? true : _ref4$allowMediaGroup,
|
|
75
|
+
_ref4$allowMediaSingl = _ref4.allowMediaSingle,
|
|
76
|
+
allowMediaSingle = _ref4$allowMediaSingl === void 0 ? false : _ref4$allowMediaSingl,
|
|
77
|
+
allowCaptions = _ref4.allowCaptions,
|
|
78
|
+
mediaFeatureFlags = _ref4.featureFlags;
|
|
70
79
|
var allowMediaInline = getMediaFeatureFlag('mediaInline', mediaFeatureFlags);
|
|
71
80
|
var mediaSingleOption = getBooleanFF('platform.editor.media.extended-resize-experience') ? {
|
|
72
81
|
withCaption: allowCaptions,
|
|
@@ -104,16 +113,16 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
104
113
|
pmPlugins: function pmPlugins() {
|
|
105
114
|
var pmPlugins = [{
|
|
106
115
|
name: 'media',
|
|
107
|
-
plugin: function plugin(
|
|
108
|
-
var schema =
|
|
109
|
-
dispatch =
|
|
110
|
-
getIntl =
|
|
111
|
-
eventDispatcher =
|
|
112
|
-
providerFactory =
|
|
113
|
-
errorReporter =
|
|
114
|
-
portalProviderAPI =
|
|
115
|
-
reactContext =
|
|
116
|
-
dispatchAnalyticsEvent =
|
|
116
|
+
plugin: function plugin(_ref5) {
|
|
117
|
+
var schema = _ref5.schema,
|
|
118
|
+
dispatch = _ref5.dispatch,
|
|
119
|
+
getIntl = _ref5.getIntl,
|
|
120
|
+
eventDispatcher = _ref5.eventDispatcher,
|
|
121
|
+
providerFactory = _ref5.providerFactory,
|
|
122
|
+
errorReporter = _ref5.errorReporter,
|
|
123
|
+
portalProviderAPI = _ref5.portalProviderAPI,
|
|
124
|
+
reactContext = _ref5.reactContext,
|
|
125
|
+
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
117
126
|
return createPlugin(schema, {
|
|
118
127
|
providerFactory: providerFactory,
|
|
119
128
|
nodeViews: {
|
|
@@ -132,17 +141,17 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
132
141
|
}
|
|
133
142
|
}, {
|
|
134
143
|
name: 'mediaKeymap',
|
|
135
|
-
plugin: function plugin(
|
|
144
|
+
plugin: function plugin(_ref6) {
|
|
136
145
|
var _api$analytics2, _api$selection;
|
|
137
|
-
var getIntl =
|
|
146
|
+
var getIntl = _ref6.getIntl;
|
|
138
147
|
return keymapPlugin(options, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.actions, api === null || api === void 0 ? void 0 : api.width, getIntl);
|
|
139
148
|
}
|
|
140
149
|
}];
|
|
141
150
|
if (options && options.allowMediaSingle) {
|
|
142
151
|
pmPlugins.push({
|
|
143
152
|
name: 'mediaSingleKeymap',
|
|
144
|
-
plugin: function plugin(
|
|
145
|
-
var schema =
|
|
153
|
+
plugin: function plugin(_ref7) {
|
|
154
|
+
var schema = _ref7.schema;
|
|
146
155
|
return keymapMediaSinglePlugin(schema);
|
|
147
156
|
}
|
|
148
157
|
});
|
|
@@ -154,9 +163,9 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
154
163
|
});
|
|
155
164
|
pmPlugins.push({
|
|
156
165
|
name: 'mediaAltTextKeymap',
|
|
157
|
-
plugin: function plugin(
|
|
166
|
+
plugin: function plugin(_ref8) {
|
|
158
167
|
var _api$analytics3;
|
|
159
|
-
var schema =
|
|
168
|
+
var schema = _ref8.schema;
|
|
160
169
|
return keymapMediaAltTextPlugin(schema, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
161
170
|
}
|
|
162
171
|
});
|
|
@@ -164,15 +173,15 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
164
173
|
if (options && options.allowLinking) {
|
|
165
174
|
pmPlugins.push({
|
|
166
175
|
name: 'mediaLinking',
|
|
167
|
-
plugin: function plugin(
|
|
168
|
-
var dispatch =
|
|
176
|
+
plugin: function plugin(_ref9) {
|
|
177
|
+
var dispatch = _ref9.dispatch;
|
|
169
178
|
return linkingPlugin(dispatch);
|
|
170
179
|
}
|
|
171
180
|
});
|
|
172
181
|
pmPlugins.push({
|
|
173
182
|
name: 'mediaLinkingKeymap',
|
|
174
|
-
plugin: function plugin(
|
|
175
|
-
var schema =
|
|
183
|
+
plugin: function plugin(_ref10) {
|
|
184
|
+
var schema = _ref10.schema;
|
|
176
185
|
return keymapLinkingPlugin(schema);
|
|
177
186
|
}
|
|
178
187
|
});
|
|
@@ -208,19 +217,19 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
208
217
|
});
|
|
209
218
|
return pmPlugins;
|
|
210
219
|
},
|
|
211
|
-
contentComponent: function contentComponent(
|
|
212
|
-
var editorView =
|
|
213
|
-
appearance =
|
|
220
|
+
contentComponent: function contentComponent(_ref11) {
|
|
221
|
+
var editorView = _ref11.editorView,
|
|
222
|
+
appearance = _ref11.appearance;
|
|
214
223
|
return /*#__PURE__*/React.createElement(MediaPickerFunctionalComponent, {
|
|
215
224
|
editorDomElement: editorView.dom,
|
|
216
225
|
appearance: appearance,
|
|
217
226
|
api: api
|
|
218
227
|
});
|
|
219
228
|
},
|
|
220
|
-
secondaryToolbarComponent: function secondaryToolbarComponent(
|
|
221
|
-
var editorView =
|
|
222
|
-
eventDispatcher =
|
|
223
|
-
disabled =
|
|
229
|
+
secondaryToolbarComponent: function secondaryToolbarComponent(_ref12) {
|
|
230
|
+
var editorView = _ref12.editorView,
|
|
231
|
+
eventDispatcher = _ref12.eventDispatcher,
|
|
232
|
+
disabled = _ref12.disabled;
|
|
224
233
|
return /*#__PURE__*/React.createElement(ToolbarMedia, {
|
|
225
234
|
isDisabled: disabled,
|
|
226
235
|
isReducedSpacing: true,
|
|
@@ -228,8 +237,8 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
228
237
|
});
|
|
229
238
|
},
|
|
230
239
|
pluginsOptions: {
|
|
231
|
-
quickInsert: function quickInsert(
|
|
232
|
-
var formatMessage =
|
|
240
|
+
quickInsert: function quickInsert(_ref13) {
|
|
241
|
+
var formatMessage = _ref13.formatMessage;
|
|
233
242
|
return [{
|
|
234
243
|
id: 'media',
|
|
235
244
|
title: formatMessage(messages.mediaFiles),
|
|
@@ -7,7 +7,10 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
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); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @jsxRuntime classic
|
|
12
|
+
* @jsx jsx
|
|
13
|
+
*/
|
|
11
14
|
|
|
12
15
|
import React from 'react';
|
|
13
16
|
|
|
@@ -485,8 +485,10 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
485
485
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
486
486
|
var nodes = _state.schema.nodes;
|
|
487
487
|
assert(nodes.media && (nodes.mediaGroup || nodes.mediaSingle), 'Editor: unable to init media plugin - media or mediaGroup/mediaSingle node absent in schema');
|
|
488
|
-
if (
|
|
489
|
-
|
|
488
|
+
if (fg('platform_editor_media_provider_from_plugin_config')) {
|
|
489
|
+
if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.provider) {
|
|
490
|
+
this.setMediaProvider(mediaOptions === null || mediaOptions === void 0 ? void 0 : mediaOptions.provider);
|
|
491
|
+
}
|
|
490
492
|
} else {
|
|
491
493
|
options.providerFactory.subscribe('mediaProvider', function (_name, provider) {
|
|
492
494
|
return _this.setMediaProvider(provider);
|
|
@@ -714,8 +716,10 @@ export var createPlugin = function createPlugin(_schema, options, reactContext,
|
|
|
714
716
|
return new MediaPluginStateImplementation(state, options, mediaOptions, newInsertionBehaviour, dispatch, pluginInjectionApi);
|
|
715
717
|
},
|
|
716
718
|
apply: function apply(tr, pluginState) {
|
|
719
|
+
var _tr$getMeta;
|
|
717
720
|
var isResizing = tr.getMeta(MEDIA_PLUGIN_IS_RESIZING_KEY);
|
|
718
721
|
var resizingWidth = tr.getMeta(MEDIA_PLUGIN_RESIZING_WIDTH_KEY);
|
|
722
|
+
var mediaProvider = (_tr$getMeta = tr.getMeta(stateKey)) === null || _tr$getMeta === void 0 ? void 0 : _tr$getMeta.mediaProvider;
|
|
719
723
|
// Yes, I agree with you; this approach, using the clone() fuction, below is horrifying.
|
|
720
724
|
// However, we needed to implement this workaround to solve the singleton Media PluginState.
|
|
721
725
|
// The entire PluginInjectionAPI relies on the following axiom: "A PluginState that reflects a new EditorState.". We can not have the mutable singleton instance for all EditorState.
|
|
@@ -725,6 +729,9 @@ export var createPlugin = function createPlugin(_schema, options, reactContext,
|
|
|
725
729
|
pluginState.setIsResizing(isResizing);
|
|
726
730
|
nextPluginState = nextPluginState.clone();
|
|
727
731
|
}
|
|
732
|
+
if (mediaProvider && fg('platform_editor_media_provider_from_plugin_config')) {
|
|
733
|
+
pluginState.setMediaProvider(mediaProvider);
|
|
734
|
+
}
|
|
728
735
|
if (resizingWidth) {
|
|
729
736
|
pluginState.setResizingWidth(resizingWidth);
|
|
730
737
|
nextPluginState = nextPluginState.clone();
|