@atlaskit/editor-plugin-media 14.0.4 → 14.1.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 +12 -0
- package/dist/cjs/mediaPlugin.js +8 -4
- package/dist/cjs/nodeviews/mediaGroupNext.js +3 -1
- package/dist/cjs/nodeviews/mediaInline.js +2 -1
- package/dist/cjs/nodeviews/mediaNodeView/media.js +1 -0
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/cjs/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/es2019/mediaPlugin.js +8 -4
- package/dist/es2019/nodeviews/mediaGroupNext.js +4 -2
- package/dist/es2019/nodeviews/mediaInline.js +2 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +1 -0
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/es2019/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/esm/mediaPlugin.js +8 -4
- package/dist/esm/nodeviews/mediaGroupNext.js +3 -1
- package/dist/esm/nodeviews/mediaInline.js +2 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +1 -0
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +3 -1
- package/dist/esm/ui/MediaViewer/PortalWrapper.js +4 -2
- package/dist/types/types/media-plugin-options.d.ts +6 -0
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +2 -1
- package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +2 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 14.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`19773530cd51c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/19773530cd51c) -
|
|
8
|
+
Add fallbackMediaNameFetcher support to MediaCard (FileCard) and MediaViewer (header display),
|
|
9
|
+
gated behind the platform_editor_media_name_fallback_viewer_card experiment
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 14.0.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/mediaPlugin.js
CHANGED
|
@@ -83,7 +83,8 @@ var mediaViewerStateSelector = function mediaViewerStateSelector(states) {
|
|
|
83
83
|
var MediaViewerFunctionalComponent = function MediaViewerFunctionalComponent(_ref2) {
|
|
84
84
|
var api = _ref2.api,
|
|
85
85
|
editorView = _ref2.editorView,
|
|
86
|
-
mediaViewerExtensions = _ref2.mediaViewerExtensions
|
|
86
|
+
mediaViewerExtensions = _ref2.mediaViewerExtensions,
|
|
87
|
+
fallbackMediaNameFetcher = _ref2.fallbackMediaNameFetcher;
|
|
87
88
|
// Only traverse document once when media viewer is visible, media viewer items will not update
|
|
88
89
|
// when document changes are made while media viewer is open
|
|
89
90
|
var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['media'], mediaViewerStateSelector),
|
|
@@ -111,7 +112,8 @@ var MediaViewerFunctionalComponent = function MediaViewerFunctionalComponent(_re
|
|
|
111
112
|
onClose: handleOnClose,
|
|
112
113
|
selectedNodeAttrs: mediaViewerSelectedMedia,
|
|
113
114
|
items: mediaItems,
|
|
114
|
-
extensions: mediaViewerExtensions
|
|
115
|
+
extensions: mediaViewerExtensions,
|
|
116
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
115
117
|
});
|
|
116
118
|
};
|
|
117
119
|
var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
@@ -252,7 +254,8 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
252
254
|
waitForMediaUpload: options && options.waitForMediaUpload,
|
|
253
255
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
254
256
|
customMediaPicker: options && options.customMediaPicker,
|
|
255
|
-
allowResizing: !!(options && options.allowResizing)
|
|
257
|
+
allowResizing: !!(options && options.allowResizing),
|
|
258
|
+
fallbackMediaNameFetcher: options && options.fallbackMediaNameFetcher
|
|
256
259
|
}, getIntl, api, nodeViewPortalProviderAPI, dispatch, options);
|
|
257
260
|
}
|
|
258
261
|
}, {
|
|
@@ -354,7 +357,8 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
354
357
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(MediaViewerFunctionalComponent, {
|
|
355
358
|
api: api,
|
|
356
359
|
editorView: editorView,
|
|
357
|
-
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions
|
|
360
|
+
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions,
|
|
361
|
+
fallbackMediaNameFetcher: options === null || options === void 0 ? void 0 : options.fallbackMediaNameFetcher
|
|
358
362
|
}), /*#__PURE__*/_react.default.createElement(MediaPickerFunctionalComponent, {
|
|
359
363
|
editorDomElement: editorView.dom,
|
|
360
364
|
appearance: appearance,
|
|
@@ -179,6 +179,7 @@ var MediaGroupNext = exports.MediaGroupNext = (0, _reactIntl.injectIntl)( /*#__P
|
|
|
179
179
|
allowMediaInlineImages = _props$mediaOptions.allowMediaInlineImages,
|
|
180
180
|
enableDownloadButton = _props$mediaOptions.enableDownloadButton,
|
|
181
181
|
featureFlags = _props$mediaOptions.featureFlags,
|
|
182
|
+
fallbackMediaNameFetcher = _props$mediaOptions.fallbackMediaNameFetcher,
|
|
182
183
|
intl = props.intl,
|
|
183
184
|
_getPos = props.getPos,
|
|
184
185
|
anchorPos = props.anchorPos,
|
|
@@ -295,7 +296,8 @@ var MediaGroupNext = exports.MediaGroupNext = (0, _reactIntl.injectIntl)( /*#__P
|
|
|
295
296
|
items: items,
|
|
296
297
|
mediaClientConfig: viewMediaClientConfig,
|
|
297
298
|
featureFlags: featureFlags,
|
|
298
|
-
shouldOpenMediaViewer: editorViewMode && (0, _experiments.editorExperiment)('platform_editor_controls', 'control')
|
|
299
|
+
shouldOpenMediaViewer: editorViewMode && (0, _experiments.editorExperiment)('platform_editor_controls', 'control'),
|
|
300
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
299
301
|
});
|
|
300
302
|
}));
|
|
301
303
|
MediaGroupNext.displayName = 'MediaGroup';
|
|
@@ -217,7 +217,8 @@ var MediaInline = exports.MediaInline = function MediaInline(props) {
|
|
|
217
217
|
mediaClientConfig: props.mediaClientConfig,
|
|
218
218
|
isEditorViewMode: props.editorViewMode,
|
|
219
219
|
isSelected: props.isSelected,
|
|
220
|
-
isInline: true
|
|
220
|
+
isInline: true,
|
|
221
|
+
fallbackMediaNameFetcher: props.fallbackMediaNameFetcher
|
|
221
222
|
}, (0, _react2.jsx)(_mediaCard.MediaInlineCard, {
|
|
222
223
|
isSelected: props.isSelected,
|
|
223
224
|
identifier: identifier,
|
|
@@ -396,6 +396,7 @@ var MediaNode = exports.MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
396
396
|
mediaSettings: this.getMediaSettings(viewAndUploadMediaClientConfig, this.props.isViewOnly),
|
|
397
397
|
isAIGenerating: !!this.props.isAIGenerating,
|
|
398
398
|
onPreviewRender: this.onPreviewRender,
|
|
399
|
+
fallbackMediaNameFetcher: mediaOptions === null || mediaOptions === void 0 ? void 0 : mediaOptions.fallbackMediaNameFetcher,
|
|
399
400
|
onError: (0, _expValEquals.expValEquals)('platform_editor_media_error_analytics', 'isEnabled', true) ? this.onError : undefined
|
|
400
401
|
})));
|
|
401
402
|
}
|
|
@@ -37,6 +37,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
|
|
|
37
37
|
_ref$isInline = _ref.isInline,
|
|
38
38
|
isInline = _ref$isInline === void 0 ? false : _ref$isInline,
|
|
39
39
|
mediaViewerExtensions = _ref.mediaViewerExtensions,
|
|
40
|
+
fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher,
|
|
40
41
|
children = _ref.children;
|
|
41
42
|
var _useState = (0, _react.useState)(false),
|
|
42
43
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -68,6 +69,7 @@ var MediaViewerContainer = exports.MediaViewerContainer = function MediaViewerCo
|
|
|
68
69
|
selectedNodeAttrs: selectedNodeAttrs,
|
|
69
70
|
mediaClientConfig: mediaClientConfig,
|
|
70
71
|
onClose: closeMediaViewer,
|
|
71
|
-
extensions: mediaViewerExtensions
|
|
72
|
+
extensions: mediaViewerExtensions,
|
|
73
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
72
74
|
})) : children);
|
|
73
75
|
};
|
|
@@ -32,7 +32,8 @@ var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_
|
|
|
32
32
|
selectedNodeAttrs = _ref.selectedNodeAttrs,
|
|
33
33
|
_ref$items = _ref.items,
|
|
34
34
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
35
|
-
extensions = _ref.extensions
|
|
35
|
+
extensions = _ref.extensions,
|
|
36
|
+
fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher;
|
|
36
37
|
var identifier = getIdentifier(selectedNodeAttrs);
|
|
37
38
|
var collectionName = (0, _utils.isExternalMedia)(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
38
39
|
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
|
|
@@ -44,6 +45,7 @@ var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_
|
|
|
44
45
|
mediaClientConfig: mediaClientConfig,
|
|
45
46
|
selectedItem: identifier,
|
|
46
47
|
onClose: onClose,
|
|
47
|
-
extensions: extensions
|
|
48
|
+
extensions: extensions,
|
|
49
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
48
50
|
}), document.body);
|
|
49
51
|
};
|
|
@@ -73,7 +73,8 @@ const mediaViewerStateSelector = states => {
|
|
|
73
73
|
const MediaViewerFunctionalComponent = ({
|
|
74
74
|
api,
|
|
75
75
|
editorView,
|
|
76
|
-
mediaViewerExtensions
|
|
76
|
+
mediaViewerExtensions,
|
|
77
|
+
fallbackMediaNameFetcher
|
|
77
78
|
}) => {
|
|
78
79
|
// Only traverse document once when media viewer is visible, media viewer items will not update
|
|
79
80
|
// when document changes are made while media viewer is open
|
|
@@ -103,7 +104,8 @@ const MediaViewerFunctionalComponent = ({
|
|
|
103
104
|
onClose: handleOnClose,
|
|
104
105
|
selectedNodeAttrs: mediaViewerSelectedMedia,
|
|
105
106
|
items: mediaItems,
|
|
106
|
-
extensions: mediaViewerExtensions
|
|
107
|
+
extensions: mediaViewerExtensions,
|
|
108
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
107
109
|
});
|
|
108
110
|
};
|
|
109
111
|
export const mediaPlugin = ({
|
|
@@ -244,7 +246,8 @@ export const mediaPlugin = ({
|
|
|
244
246
|
waitForMediaUpload: options && options.waitForMediaUpload,
|
|
245
247
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
246
248
|
customMediaPicker: options && options.customMediaPicker,
|
|
247
|
-
allowResizing: !!(options && options.allowResizing)
|
|
249
|
+
allowResizing: !!(options && options.allowResizing),
|
|
250
|
+
fallbackMediaNameFetcher: options && options.fallbackMediaNameFetcher
|
|
248
251
|
}, getIntl, api, nodeViewPortalProviderAPI, dispatch, options);
|
|
249
252
|
}
|
|
250
253
|
}, {
|
|
@@ -349,7 +352,8 @@ export const mediaPlugin = ({
|
|
|
349
352
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaViewerFunctionalComponent, {
|
|
350
353
|
api: api,
|
|
351
354
|
editorView: editorView,
|
|
352
|
-
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions
|
|
355
|
+
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions,
|
|
356
|
+
fallbackMediaNameFetcher: options === null || options === void 0 ? void 0 : options.fallbackMediaNameFetcher
|
|
353
357
|
}), /*#__PURE__*/React.createElement(MediaPickerFunctionalComponent, {
|
|
354
358
|
editorDomElement: editorView.dom,
|
|
355
359
|
appearance: appearance,
|
|
@@ -134,7 +134,8 @@ export const MediaGroupNext = injectIntl( /*#__PURE__*/React.memo(props => {
|
|
|
134
134
|
allowLazyLoading,
|
|
135
135
|
allowMediaInlineImages,
|
|
136
136
|
enableDownloadButton,
|
|
137
|
-
featureFlags
|
|
137
|
+
featureFlags,
|
|
138
|
+
fallbackMediaNameFetcher
|
|
138
139
|
},
|
|
139
140
|
intl,
|
|
140
141
|
getPos,
|
|
@@ -250,7 +251,8 @@ export const MediaGroupNext = injectIntl( /*#__PURE__*/React.memo(props => {
|
|
|
250
251
|
items: items,
|
|
251
252
|
mediaClientConfig: viewMediaClientConfig,
|
|
252
253
|
featureFlags: featureFlags,
|
|
253
|
-
shouldOpenMediaViewer: editorViewMode && editorExperiment('platform_editor_controls', 'control')
|
|
254
|
+
shouldOpenMediaViewer: editorViewMode && editorExperiment('platform_editor_controls', 'control'),
|
|
255
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
254
256
|
});
|
|
255
257
|
}));
|
|
256
258
|
MediaGroupNext.displayName = 'MediaGroup';
|
|
@@ -149,7 +149,8 @@ export const MediaInline = props => {
|
|
|
149
149
|
mediaClientConfig: props.mediaClientConfig,
|
|
150
150
|
isEditorViewMode: props.editorViewMode,
|
|
151
151
|
isSelected: props.isSelected,
|
|
152
|
-
isInline: true
|
|
152
|
+
isInline: true,
|
|
153
|
+
fallbackMediaNameFetcher: props.fallbackMediaNameFetcher
|
|
153
154
|
}, jsx(MediaInlineCard, {
|
|
154
155
|
isSelected: props.isSelected,
|
|
155
156
|
identifier: identifier,
|
|
@@ -338,6 +338,7 @@ export class MediaNode extends Component {
|
|
|
338
338
|
mediaSettings: this.getMediaSettings(viewAndUploadMediaClientConfig, this.props.isViewOnly),
|
|
339
339
|
isAIGenerating: !!this.props.isAIGenerating,
|
|
340
340
|
onPreviewRender: this.onPreviewRender,
|
|
341
|
+
fallbackMediaNameFetcher: mediaOptions === null || mediaOptions === void 0 ? void 0 : mediaOptions.fallbackMediaNameFetcher,
|
|
341
342
|
onError: expValEquals('platform_editor_media_error_analytics', 'isEnabled', true) ? this.onError : undefined
|
|
342
343
|
})));
|
|
343
344
|
}
|
|
@@ -22,6 +22,7 @@ export const MediaViewerContainer = ({
|
|
|
22
22
|
isSelected = true,
|
|
23
23
|
isInline = false,
|
|
24
24
|
mediaViewerExtensions,
|
|
25
|
+
fallbackMediaNameFetcher,
|
|
25
26
|
children
|
|
26
27
|
}) => {
|
|
27
28
|
var _mediaNode$firstChild;
|
|
@@ -52,6 +53,7 @@ export const MediaViewerContainer = ({
|
|
|
52
53
|
selectedNodeAttrs: selectedNodeAttrs,
|
|
53
54
|
mediaClientConfig: mediaClientConfig,
|
|
54
55
|
onClose: closeMediaViewer,
|
|
55
|
-
extensions: mediaViewerExtensions
|
|
56
|
+
extensions: mediaViewerExtensions,
|
|
57
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
56
58
|
})) : children);
|
|
57
59
|
};
|
|
@@ -25,7 +25,8 @@ export const RenderMediaViewer = ({
|
|
|
25
25
|
onClose,
|
|
26
26
|
selectedNodeAttrs,
|
|
27
27
|
items = [],
|
|
28
|
-
extensions
|
|
28
|
+
extensions,
|
|
29
|
+
fallbackMediaNameFetcher
|
|
29
30
|
}) => {
|
|
30
31
|
const identifier = getIdentifier(selectedNodeAttrs);
|
|
31
32
|
const collectionName = isExternalMedia(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
@@ -38,6 +39,7 @@ export const RenderMediaViewer = ({
|
|
|
38
39
|
mediaClientConfig: mediaClientConfig,
|
|
39
40
|
selectedItem: identifier,
|
|
40
41
|
onClose: onClose,
|
|
41
|
-
extensions: extensions
|
|
42
|
+
extensions: extensions,
|
|
43
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
42
44
|
}), document.body);
|
|
43
45
|
};
|
package/dist/esm/mediaPlugin.js
CHANGED
|
@@ -74,7 +74,8 @@ var mediaViewerStateSelector = function mediaViewerStateSelector(states) {
|
|
|
74
74
|
var MediaViewerFunctionalComponent = function MediaViewerFunctionalComponent(_ref2) {
|
|
75
75
|
var api = _ref2.api,
|
|
76
76
|
editorView = _ref2.editorView,
|
|
77
|
-
mediaViewerExtensions = _ref2.mediaViewerExtensions
|
|
77
|
+
mediaViewerExtensions = _ref2.mediaViewerExtensions,
|
|
78
|
+
fallbackMediaNameFetcher = _ref2.fallbackMediaNameFetcher;
|
|
78
79
|
// Only traverse document once when media viewer is visible, media viewer items will not update
|
|
79
80
|
// when document changes are made while media viewer is open
|
|
80
81
|
var _useSharedPluginState2 = useSharedPluginStateWithSelector(api, ['media'], mediaViewerStateSelector),
|
|
@@ -102,7 +103,8 @@ var MediaViewerFunctionalComponent = function MediaViewerFunctionalComponent(_re
|
|
|
102
103
|
onClose: handleOnClose,
|
|
103
104
|
selectedNodeAttrs: mediaViewerSelectedMedia,
|
|
104
105
|
items: mediaItems,
|
|
105
|
-
extensions: mediaViewerExtensions
|
|
106
|
+
extensions: mediaViewerExtensions,
|
|
107
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
106
108
|
});
|
|
107
109
|
};
|
|
108
110
|
export var mediaPlugin = function mediaPlugin(_ref3) {
|
|
@@ -243,7 +245,8 @@ export var mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
243
245
|
waitForMediaUpload: options && options.waitForMediaUpload,
|
|
244
246
|
customDropzoneContainer: options && options.customDropzoneContainer,
|
|
245
247
|
customMediaPicker: options && options.customMediaPicker,
|
|
246
|
-
allowResizing: !!(options && options.allowResizing)
|
|
248
|
+
allowResizing: !!(options && options.allowResizing),
|
|
249
|
+
fallbackMediaNameFetcher: options && options.fallbackMediaNameFetcher
|
|
247
250
|
}, getIntl, api, nodeViewPortalProviderAPI, dispatch, options);
|
|
248
251
|
}
|
|
249
252
|
}, {
|
|
@@ -345,7 +348,8 @@ export var mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
345
348
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MediaViewerFunctionalComponent, {
|
|
346
349
|
api: api,
|
|
347
350
|
editorView: editorView,
|
|
348
|
-
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions
|
|
351
|
+
mediaViewerExtensions: options === null || options === void 0 ? void 0 : options.mediaViewerExtensions,
|
|
352
|
+
fallbackMediaNameFetcher: options === null || options === void 0 ? void 0 : options.fallbackMediaNameFetcher
|
|
349
353
|
}), /*#__PURE__*/React.createElement(MediaPickerFunctionalComponent, {
|
|
350
354
|
editorDomElement: editorView.dom,
|
|
351
355
|
appearance: appearance,
|
|
@@ -170,6 +170,7 @@ export var MediaGroupNext = injectIntl( /*#__PURE__*/React.memo(function (props)
|
|
|
170
170
|
allowMediaInlineImages = _props$mediaOptions.allowMediaInlineImages,
|
|
171
171
|
enableDownloadButton = _props$mediaOptions.enableDownloadButton,
|
|
172
172
|
featureFlags = _props$mediaOptions.featureFlags,
|
|
173
|
+
fallbackMediaNameFetcher = _props$mediaOptions.fallbackMediaNameFetcher,
|
|
173
174
|
intl = props.intl,
|
|
174
175
|
_getPos = props.getPos,
|
|
175
176
|
anchorPos = props.anchorPos,
|
|
@@ -286,7 +287,8 @@ export var MediaGroupNext = injectIntl( /*#__PURE__*/React.memo(function (props)
|
|
|
286
287
|
items: items,
|
|
287
288
|
mediaClientConfig: viewMediaClientConfig,
|
|
288
289
|
featureFlags: featureFlags,
|
|
289
|
-
shouldOpenMediaViewer: editorViewMode && editorExperiment('platform_editor_controls', 'control')
|
|
290
|
+
shouldOpenMediaViewer: editorViewMode && editorExperiment('platform_editor_controls', 'control'),
|
|
291
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
290
292
|
});
|
|
291
293
|
}));
|
|
292
294
|
MediaGroupNext.displayName = 'MediaGroup';
|
|
@@ -213,7 +213,8 @@ export var MediaInline = function MediaInline(props) {
|
|
|
213
213
|
mediaClientConfig: props.mediaClientConfig,
|
|
214
214
|
isEditorViewMode: props.editorViewMode,
|
|
215
215
|
isSelected: props.isSelected,
|
|
216
|
-
isInline: true
|
|
216
|
+
isInline: true,
|
|
217
|
+
fallbackMediaNameFetcher: props.fallbackMediaNameFetcher
|
|
217
218
|
}, jsx(MediaInlineCard, {
|
|
218
219
|
isSelected: props.isSelected,
|
|
219
220
|
identifier: identifier,
|
|
@@ -388,6 +388,7 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
388
388
|
mediaSettings: this.getMediaSettings(viewAndUploadMediaClientConfig, this.props.isViewOnly),
|
|
389
389
|
isAIGenerating: !!this.props.isAIGenerating,
|
|
390
390
|
onPreviewRender: this.onPreviewRender,
|
|
391
|
+
fallbackMediaNameFetcher: mediaOptions === null || mediaOptions === void 0 ? void 0 : mediaOptions.fallbackMediaNameFetcher,
|
|
391
392
|
onError: expValEquals('platform_editor_media_error_analytics', 'isEnabled', true) ? this.onError : undefined
|
|
392
393
|
})));
|
|
393
394
|
}
|
|
@@ -27,6 +27,7 @@ export var MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
|
27
27
|
_ref$isInline = _ref.isInline,
|
|
28
28
|
isInline = _ref$isInline === void 0 ? false : _ref$isInline,
|
|
29
29
|
mediaViewerExtensions = _ref.mediaViewerExtensions,
|
|
30
|
+
fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher,
|
|
30
31
|
children = _ref.children;
|
|
31
32
|
var _useState = useState(false),
|
|
32
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -58,6 +59,7 @@ export var MediaViewerContainer = function MediaViewerContainer(_ref) {
|
|
|
58
59
|
selectedNodeAttrs: selectedNodeAttrs,
|
|
59
60
|
mediaClientConfig: mediaClientConfig,
|
|
60
61
|
onClose: closeMediaViewer,
|
|
61
|
-
extensions: mediaViewerExtensions
|
|
62
|
+
extensions: mediaViewerExtensions,
|
|
63
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
62
64
|
})) : children);
|
|
63
65
|
};
|
|
@@ -25,7 +25,8 @@ export var RenderMediaViewer = function RenderMediaViewer(_ref) {
|
|
|
25
25
|
selectedNodeAttrs = _ref.selectedNodeAttrs,
|
|
26
26
|
_ref$items = _ref.items,
|
|
27
27
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
28
|
-
extensions = _ref.extensions
|
|
28
|
+
extensions = _ref.extensions,
|
|
29
|
+
fallbackMediaNameFetcher = _ref.fallbackMediaNameFetcher;
|
|
29
30
|
var identifier = getIdentifier(selectedNodeAttrs);
|
|
30
31
|
var collectionName = isExternalMedia(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
31
32
|
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
|
|
@@ -37,6 +38,7 @@ export var RenderMediaViewer = function RenderMediaViewer(_ref) {
|
|
|
37
38
|
mediaClientConfig: mediaClientConfig,
|
|
38
39
|
selectedItem: identifier,
|
|
39
40
|
onClose: onClose,
|
|
40
|
-
extensions: extensions
|
|
41
|
+
extensions: extensions,
|
|
42
|
+
fallbackMediaNameFetcher: fallbackMediaNameFetcher
|
|
41
43
|
}), document.body);
|
|
42
44
|
};
|
|
@@ -13,4 +13,10 @@ export type MediaPluginOptions = {
|
|
|
13
13
|
providerFactory: ProviderFactory;
|
|
14
14
|
uploadErrorHandler?: (state: MediaState) => void;
|
|
15
15
|
waitForMediaUpload?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Optional fallback fetcher to retrieve the media filename from another service.
|
|
18
|
+
* Workaround for #hot-301450 where media service is missing filenames for DC -> Cloud migrated media.
|
|
19
|
+
* Receives the file ID and should resolve to the filename string.
|
|
20
|
+
*/
|
|
21
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
16
22
|
};
|
|
@@ -9,6 +9,7 @@ import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
|
9
9
|
import type { MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
10
10
|
type MediaViewerContainerProps = {
|
|
11
11
|
children?: React.ReactNode;
|
|
12
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
12
13
|
isEditorViewMode?: boolean;
|
|
13
14
|
isInline?: boolean;
|
|
14
15
|
isSelected?: boolean;
|
|
@@ -17,5 +18,5 @@ type MediaViewerContainerProps = {
|
|
|
17
18
|
mediaViewerExtensions?: MediaViewerExtensions;
|
|
18
19
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
19
20
|
};
|
|
20
|
-
export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, mediaViewerExtensions, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
21
|
+
export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, mediaViewerExtensions, fallbackMediaNameFetcher, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -4,10 +4,11 @@ import type { Identifier, MediaClientConfig } from '@atlaskit/media-client';
|
|
|
4
4
|
import { type MediaViewerExtensions } from '@atlaskit/media-viewer';
|
|
5
5
|
interface RenderMediaViewerProps {
|
|
6
6
|
extensions?: MediaViewerExtensions;
|
|
7
|
+
fallbackMediaNameFetcher?: (id: string) => Promise<string>;
|
|
7
8
|
items?: Identifier[];
|
|
8
9
|
mediaClientConfig: MediaClientConfig;
|
|
9
10
|
onClose: () => void;
|
|
10
11
|
selectedNodeAttrs: MediaADFAttrs;
|
|
11
12
|
}
|
|
12
|
-
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, extensions, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
13
|
+
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, extensions, fallbackMediaNameFetcher, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
13
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@atlaskit/adf-schema": "^
|
|
24
|
+
"@atlaskit/adf-schema": "^56.0.0",
|
|
25
25
|
"@atlaskit/analytics-namespaced-context": "^8.0.0",
|
|
26
26
|
"@atlaskit/analytics-next": "^12.0.0",
|
|
27
|
-
"@atlaskit/button": "^24.
|
|
27
|
+
"@atlaskit/button": "^24.1.0",
|
|
28
28
|
"@atlaskit/editor-palette": "^3.1.0",
|
|
29
29
|
"@atlaskit/editor-plugin-analytics": "^12.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-annotation": "^12.0.0",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"@atlaskit/form": "^16.0.0",
|
|
47
47
|
"@atlaskit/icon": "^36.0.0",
|
|
48
48
|
"@atlaskit/icon-lab": "^7.0.0",
|
|
49
|
-
"@atlaskit/media-card": "^81.
|
|
49
|
+
"@atlaskit/media-card": "^81.1.0",
|
|
50
50
|
"@atlaskit/media-client": "^37.0.0",
|
|
51
51
|
"@atlaskit/media-client-react": "^6.0.0",
|
|
52
52
|
"@atlaskit/media-common": "^14.0.0",
|
|
53
|
-
"@atlaskit/media-filmstrip": "^52.
|
|
53
|
+
"@atlaskit/media-filmstrip": "^52.1.0",
|
|
54
54
|
"@atlaskit/media-picker": "^72.0.0",
|
|
55
55
|
"@atlaskit/media-ui": "^30.1.0",
|
|
56
|
-
"@atlaskit/media-viewer": "^54.
|
|
56
|
+
"@atlaskit/media-viewer": "^54.1.0",
|
|
57
57
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
58
58
|
"@atlaskit/primitives": "^20.0.0",
|
|
59
59
|
"@atlaskit/textfield": "^9.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^108.
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^108.3.0",
|
|
61
61
|
"@atlaskit/tokens": "^14.0.0",
|
|
62
62
|
"@atlaskit/tooltip": "^23.0.0",
|
|
63
63
|
"@babel/runtime": "^7.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"uuid": "^3.1.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@atlaskit/editor-common": "^116.
|
|
72
|
+
"@atlaskit/editor-common": "^116.4.0",
|
|
73
73
|
"@atlaskit/media-core": "^38.0.0",
|
|
74
74
|
"react": "^18.2.0",
|
|
75
75
|
"react-dom": "^18.2.0",
|