@atlaskit/editor-plugin-media 1.32.2 → 1.33.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 +20 -0
- package/dist/cjs/nodeviews/mediaSingle.js +15 -1
- package/dist/cjs/toolbar/utils.js +5 -2
- package/dist/cjs/ui/MediaViewer/PortalWrapper.js +34 -3
- package/dist/es2019/nodeviews/mediaSingle.js +15 -0
- package/dist/es2019/toolbar/utils.js +4 -1
- package/dist/es2019/ui/MediaViewer/PortalWrapper.js +31 -0
- package/dist/esm/nodeviews/mediaSingle.js +15 -1
- package/dist/esm/toolbar/utils.js +4 -1
- package/dist/esm/ui/MediaViewer/PortalWrapper.js +34 -3
- package/dist/types/toolbar/utils.d.ts +3 -2
- package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +2 -2
- package/dist/types-ts4.5/toolbar/utils.d.ts +3 -2
- package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.33.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#145306](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/145306)
|
|
8
|
+
[`ca98d98a06d25`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ca98d98a06d25) -
|
|
9
|
+
ED-25128 Add exposure point for when external media is rendered platform_editor_add_media_from_url
|
|
10
|
+
|
|
11
|
+
## 1.33.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#145463](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/145463)
|
|
16
|
+
[`d63935e60e04b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d63935e60e04b) -
|
|
17
|
+
[ux] ED-24924 Fix media preview broken for external images
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 1.32.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -301,6 +301,7 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
301
301
|
key: "componentDidMount",
|
|
302
302
|
value: function () {
|
|
303
303
|
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
304
|
+
var _this$props$node$firs2;
|
|
304
305
|
var contextIdentifierProvider;
|
|
305
306
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
306
307
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -319,7 +320,20 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
319
320
|
contextIdentifierProvider: _context3.t1
|
|
320
321
|
};
|
|
321
322
|
_context3.t0.setState.call(_context3.t0, _context3.t2);
|
|
322
|
-
|
|
323
|
+
// No-op but logging an exposure when an external image is rendered
|
|
324
|
+
// Remove this block when cleaning up platform_editor_add_media_from_url
|
|
325
|
+
if (((_this$props$node$firs2 = this.props.node.firstChild) === null || _this$props$node$firs2 === void 0 ? void 0 : _this$props$node$firs2.attrs.type) === 'external') {
|
|
326
|
+
if ((0, _experiments.editorExperiment)('add-media-from-url', true)) {
|
|
327
|
+
(0, _experiments.editorExperiment)('add-media-from-url', true, {
|
|
328
|
+
exposure: true
|
|
329
|
+
});
|
|
330
|
+
} else {
|
|
331
|
+
(0, _experiments.editorExperiment)('add-media-from-url', true, {
|
|
332
|
+
exposure: false
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
case 11:
|
|
323
337
|
case "end":
|
|
324
338
|
return _context3.stop();
|
|
325
339
|
}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.removeMediaGroupNode = exports.getSelectedNearestMediaContainerNodeAttrs = exports.getSelectedMediaSingle = exports.getSelectedLayoutIcon = exports.getPixelWidthOfElement = exports.getMaxToolbarWidth = exports.downloadMedia = exports.canShowSwitchButtons = exports.calcNewLayout = void 0;
|
|
7
|
+
exports.removeMediaGroupNode = exports.isExternalMedia = exports.getSelectedNearestMediaContainerNodeAttrs = exports.getSelectedMediaSingle = exports.getSelectedLayoutIcon = exports.getPixelWidthOfElement = exports.getMaxToolbarWidth = exports.downloadMedia = exports.canShowSwitchButtons = exports.calcNewLayout = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
@@ -14,6 +14,9 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
16
16
|
var _mediaSingle2 = require("../utils/media-single");
|
|
17
|
+
var isExternalMedia = exports.isExternalMedia = function isExternalMedia(attrs) {
|
|
18
|
+
return attrs.type === 'external';
|
|
19
|
+
};
|
|
17
20
|
var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
18
21
|
var _mediaPluginState$sel;
|
|
19
22
|
var selectedNode = (_mediaPluginState$sel = mediaPluginState.selectedMediaContainerNode) === null || _mediaPluginState$sel === void 0 ? void 0 : _mediaPluginState$sel.call(mediaPluginState);
|
|
@@ -46,7 +49,7 @@ var downloadMedia = exports.downloadMedia = /*#__PURE__*/function () {
|
|
|
46
49
|
case 0:
|
|
47
50
|
_context.prev = 0;
|
|
48
51
|
selectedNodeAttrs = isViewMode ? getSelectedNearestMediaContainerNodeAttrs(mediaPluginState) : getSelectedMediaContainerNodeAttrs(mediaPluginState);
|
|
49
|
-
if (!(selectedNodeAttrs && mediaPluginState.mediaClientConfig)) {
|
|
52
|
+
if (!(selectedNodeAttrs && mediaPluginState.mediaClientConfig && !isExternalMedia(selectedNodeAttrs))) {
|
|
50
53
|
_context.next = 10;
|
|
51
54
|
break;
|
|
52
55
|
}
|
|
@@ -8,13 +8,44 @@ exports.RenderMediaViewer = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
10
|
var _mediaViewer = require("@atlaskit/media-viewer");
|
|
11
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
|
+
var _utils = require("../../toolbar/utils");
|
|
13
|
+
var getIdentifier = function getIdentifier(attrs) {
|
|
14
|
+
if ((0, _utils.isExternalMedia)(attrs)) {
|
|
15
|
+
return {
|
|
16
|
+
mediaItemType: 'external-image',
|
|
17
|
+
dataURI: attrs.url
|
|
18
|
+
};
|
|
19
|
+
} else {
|
|
20
|
+
var id = attrs.id,
|
|
21
|
+
_attrs$collection = attrs.collection,
|
|
22
|
+
collection = _attrs$collection === void 0 ? '' : _attrs$collection;
|
|
23
|
+
return {
|
|
24
|
+
id: id,
|
|
25
|
+
mediaItemType: 'file',
|
|
26
|
+
collectionName: collection
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
11
30
|
var RenderMediaViewer = exports.RenderMediaViewer = function RenderMediaViewer(_ref) {
|
|
12
31
|
var mediaClientConfig = _ref.mediaClientConfig,
|
|
13
32
|
onClose = _ref.onClose,
|
|
14
33
|
selectedNodeAttrs = _ref.selectedNodeAttrs;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
if ((0, _experiments.editorExperiment)('add-media-from-url', true)) {
|
|
35
|
+
var _identifier = getIdentifier(selectedNodeAttrs);
|
|
36
|
+
var collectionName = (0, _utils.isExternalMedia)(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
37
|
+
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
|
|
38
|
+
collectionName: collectionName,
|
|
39
|
+
items: [],
|
|
40
|
+
mediaClientConfig: mediaClientConfig,
|
|
41
|
+
selectedItem: _identifier,
|
|
42
|
+
onClose: onClose
|
|
43
|
+
}), document.body);
|
|
44
|
+
}
|
|
45
|
+
var _ref2 = selectedNodeAttrs,
|
|
46
|
+
id = _ref2.id,
|
|
47
|
+
_ref2$collection = _ref2.collection,
|
|
48
|
+
collection = _ref2$collection === void 0 ? '' : _ref2$collection;
|
|
18
49
|
var identifier = {
|
|
19
50
|
id: id,
|
|
20
51
|
mediaItemType: 'file',
|
|
@@ -226,6 +226,7 @@ export default class MediaSingleNode extends Component {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
async componentDidMount() {
|
|
229
|
+
var _this$props$node$firs2;
|
|
229
230
|
const {
|
|
230
231
|
contextIdentifierProvider
|
|
231
232
|
} = this.props;
|
|
@@ -234,6 +235,20 @@ export default class MediaSingleNode extends Component {
|
|
|
234
235
|
this.setState({
|
|
235
236
|
contextIdentifierProvider: await contextIdentifierProvider
|
|
236
237
|
});
|
|
238
|
+
|
|
239
|
+
// No-op but logging an exposure when an external image is rendered
|
|
240
|
+
// Remove this block when cleaning up platform_editor_add_media_from_url
|
|
241
|
+
if (((_this$props$node$firs2 = this.props.node.firstChild) === null || _this$props$node$firs2 === void 0 ? void 0 : _this$props$node$firs2.attrs.type) === 'external') {
|
|
242
|
+
if (editorExperiment('add-media-from-url', true)) {
|
|
243
|
+
editorExperiment('add-media-from-url', true, {
|
|
244
|
+
exposure: true
|
|
245
|
+
});
|
|
246
|
+
} else {
|
|
247
|
+
editorExperiment('add-media-from-url', true, {
|
|
248
|
+
exposure: false
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
237
252
|
}
|
|
238
253
|
render() {
|
|
239
254
|
var _mediaOptions$getEdit, _pluginInjectionApi$m, _pluginInjectionApi$m2, _node$firstChild, _mediaOptions$getEdit2, _mediaOptions$getEdit3;
|
|
@@ -5,6 +5,9 @@ import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, r
|
|
|
5
5
|
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
7
7
|
import { isVideo } from '../utils/media-single';
|
|
8
|
+
export const isExternalMedia = attrs => {
|
|
9
|
+
return attrs.type === 'external';
|
|
10
|
+
};
|
|
8
11
|
const getSelectedMediaContainerNodeAttrs = mediaPluginState => {
|
|
9
12
|
var _mediaPluginState$sel;
|
|
10
13
|
const selectedNode = (_mediaPluginState$sel = mediaPluginState.selectedMediaContainerNode) === null || _mediaPluginState$sel === void 0 ? void 0 : _mediaPluginState$sel.call(mediaPluginState);
|
|
@@ -32,7 +35,7 @@ export const getSelectedNearestMediaContainerNodeAttrs = mediaPluginState => {
|
|
|
32
35
|
export const downloadMedia = async (mediaPluginState, isViewMode) => {
|
|
33
36
|
try {
|
|
34
37
|
const selectedNodeAttrs = isViewMode ? getSelectedNearestMediaContainerNodeAttrs(mediaPluginState) : getSelectedMediaContainerNodeAttrs(mediaPluginState);
|
|
35
|
-
if (selectedNodeAttrs && mediaPluginState.mediaClientConfig) {
|
|
38
|
+
if (selectedNodeAttrs && mediaPluginState.mediaClientConfig && !isExternalMedia(selectedNodeAttrs)) {
|
|
36
39
|
const {
|
|
37
40
|
id,
|
|
38
41
|
collection = ''
|
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
+
import { isExternalMedia } from '../../toolbar/utils';
|
|
6
|
+
const getIdentifier = attrs => {
|
|
7
|
+
if (isExternalMedia(attrs)) {
|
|
8
|
+
return {
|
|
9
|
+
mediaItemType: 'external-image',
|
|
10
|
+
dataURI: attrs.url
|
|
11
|
+
};
|
|
12
|
+
} else {
|
|
13
|
+
const {
|
|
14
|
+
id,
|
|
15
|
+
collection = ''
|
|
16
|
+
} = attrs;
|
|
17
|
+
return {
|
|
18
|
+
id,
|
|
19
|
+
mediaItemType: 'file',
|
|
20
|
+
collectionName: collection
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
};
|
|
4
24
|
export const RenderMediaViewer = ({
|
|
5
25
|
mediaClientConfig,
|
|
6
26
|
onClose,
|
|
7
27
|
selectedNodeAttrs
|
|
8
28
|
}) => {
|
|
29
|
+
if (editorExperiment('add-media-from-url', true)) {
|
|
30
|
+
const identifier = getIdentifier(selectedNodeAttrs);
|
|
31
|
+
const collectionName = isExternalMedia(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
32
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
|
|
33
|
+
collectionName: collectionName,
|
|
34
|
+
items: [],
|
|
35
|
+
mediaClientConfig: mediaClientConfig,
|
|
36
|
+
selectedItem: identifier,
|
|
37
|
+
onClose: onClose
|
|
38
|
+
}), document.body);
|
|
39
|
+
}
|
|
9
40
|
const {
|
|
10
41
|
id,
|
|
11
42
|
collection = ''
|
|
@@ -295,6 +295,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
295
295
|
key: "componentDidMount",
|
|
296
296
|
value: function () {
|
|
297
297
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
298
|
+
var _this$props$node$firs2;
|
|
298
299
|
var contextIdentifierProvider;
|
|
299
300
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
300
301
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -313,7 +314,20 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
313
314
|
contextIdentifierProvider: _context3.t1
|
|
314
315
|
};
|
|
315
316
|
_context3.t0.setState.call(_context3.t0, _context3.t2);
|
|
316
|
-
|
|
317
|
+
// No-op but logging an exposure when an external image is rendered
|
|
318
|
+
// Remove this block when cleaning up platform_editor_add_media_from_url
|
|
319
|
+
if (((_this$props$node$firs2 = this.props.node.firstChild) === null || _this$props$node$firs2 === void 0 ? void 0 : _this$props$node$firs2.attrs.type) === 'external') {
|
|
320
|
+
if (editorExperiment('add-media-from-url', true)) {
|
|
321
|
+
editorExperiment('add-media-from-url', true, {
|
|
322
|
+
exposure: true
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
editorExperiment('add-media-from-url', true, {
|
|
326
|
+
exposure: false
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
case 11:
|
|
317
331
|
case "end":
|
|
318
332
|
return _context3.stop();
|
|
319
333
|
}
|
|
@@ -7,6 +7,9 @@ import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, r
|
|
|
7
7
|
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
9
9
|
import { isVideo } from '../utils/media-single';
|
|
10
|
+
export var isExternalMedia = function isExternalMedia(attrs) {
|
|
11
|
+
return attrs.type === 'external';
|
|
12
|
+
};
|
|
10
13
|
var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
11
14
|
var _mediaPluginState$sel;
|
|
12
15
|
var selectedNode = (_mediaPluginState$sel = mediaPluginState.selectedMediaContainerNode) === null || _mediaPluginState$sel === void 0 ? void 0 : _mediaPluginState$sel.call(mediaPluginState);
|
|
@@ -39,7 +42,7 @@ export var downloadMedia = /*#__PURE__*/function () {
|
|
|
39
42
|
case 0:
|
|
40
43
|
_context.prev = 0;
|
|
41
44
|
selectedNodeAttrs = isViewMode ? getSelectedNearestMediaContainerNodeAttrs(mediaPluginState) : getSelectedMediaContainerNodeAttrs(mediaPluginState);
|
|
42
|
-
if (!(selectedNodeAttrs && mediaPluginState.mediaClientConfig)) {
|
|
45
|
+
if (!(selectedNodeAttrs && mediaPluginState.mediaClientConfig && !isExternalMedia(selectedNodeAttrs))) {
|
|
43
46
|
_context.next = 10;
|
|
44
47
|
break;
|
|
45
48
|
}
|
|
@@ -1,13 +1,44 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
+
import { isExternalMedia } from '../../toolbar/utils';
|
|
6
|
+
var getIdentifier = function getIdentifier(attrs) {
|
|
7
|
+
if (isExternalMedia(attrs)) {
|
|
8
|
+
return {
|
|
9
|
+
mediaItemType: 'external-image',
|
|
10
|
+
dataURI: attrs.url
|
|
11
|
+
};
|
|
12
|
+
} else {
|
|
13
|
+
var id = attrs.id,
|
|
14
|
+
_attrs$collection = attrs.collection,
|
|
15
|
+
collection = _attrs$collection === void 0 ? '' : _attrs$collection;
|
|
16
|
+
return {
|
|
17
|
+
id: id,
|
|
18
|
+
mediaItemType: 'file',
|
|
19
|
+
collectionName: collection
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
4
23
|
export var RenderMediaViewer = function RenderMediaViewer(_ref) {
|
|
5
24
|
var mediaClientConfig = _ref.mediaClientConfig,
|
|
6
25
|
onClose = _ref.onClose,
|
|
7
26
|
selectedNodeAttrs = _ref.selectedNodeAttrs;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
27
|
+
if (editorExperiment('add-media-from-url', true)) {
|
|
28
|
+
var _identifier = getIdentifier(selectedNodeAttrs);
|
|
29
|
+
var collectionName = isExternalMedia(selectedNodeAttrs) ? '' : selectedNodeAttrs.collection;
|
|
30
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, {
|
|
31
|
+
collectionName: collectionName,
|
|
32
|
+
items: [],
|
|
33
|
+
mediaClientConfig: mediaClientConfig,
|
|
34
|
+
selectedItem: _identifier,
|
|
35
|
+
onClose: onClose
|
|
36
|
+
}), document.body);
|
|
37
|
+
}
|
|
38
|
+
var _ref2 = selectedNodeAttrs,
|
|
39
|
+
id = _ref2.id,
|
|
40
|
+
_ref2$collection = _ref2.collection,
|
|
41
|
+
collection = _ref2$collection === void 0 ? '' : _ref2$collection;
|
|
11
42
|
var identifier = {
|
|
12
43
|
id: id,
|
|
13
44
|
mediaItemType: 'file',
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { LayoutIcon } from '@atlaskit/editor-common/card';
|
|
3
3
|
import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const isExternalMedia: (attrs: MediaADFAttrs) => attrs is ExternalMediaAttributes;
|
|
9
|
+
export declare const getSelectedNearestMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaADFAttrs | null;
|
|
9
10
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState, isViewMode?: boolean) => Promise<boolean>;
|
|
10
11
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
11
12
|
export declare const getSelectedMediaSingle: (state: EditorState) => ReturnType<ReturnType<typeof findSelectedNodeOfType>> | ReturnType<ReturnType<typeof findParentNodeOfType>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-client';
|
|
4
4
|
interface RenderMediaViewerProps {
|
|
5
5
|
mediaClientConfig: MediaClientConfig;
|
|
6
6
|
onClose: () => void;
|
|
7
|
-
selectedNodeAttrs:
|
|
7
|
+
selectedNodeAttrs: MediaADFAttrs;
|
|
8
8
|
}
|
|
9
9
|
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
10
10
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { LayoutIcon } from '@atlaskit/editor-common/card';
|
|
3
3
|
import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const isExternalMedia: (attrs: MediaADFAttrs) => attrs is ExternalMediaAttributes;
|
|
9
|
+
export declare const getSelectedNearestMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaADFAttrs | null;
|
|
9
10
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState, isViewMode?: boolean) => Promise<boolean>;
|
|
10
11
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
11
12
|
export declare const getSelectedMediaSingle: (state: EditorState) => ReturnType<ReturnType<typeof findSelectedNodeOfType>> | ReturnType<ReturnType<typeof findParentNodeOfType>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-client';
|
|
4
4
|
interface RenderMediaViewerProps {
|
|
5
5
|
mediaClientConfig: MediaClientConfig;
|
|
6
6
|
onClose: () => void;
|
|
7
|
-
selectedNodeAttrs:
|
|
7
|
+
selectedNodeAttrs: MediaADFAttrs;
|
|
8
8
|
}
|
|
9
9
|
export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, }: RenderMediaViewerProps) => React.ReactPortal;
|
|
10
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^6.12.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
38
|
-
"@atlaskit/button": "^20.
|
|
39
|
-
"@atlaskit/editor-common": "^91.
|
|
38
|
+
"@atlaskit/button": "^20.2.0",
|
|
39
|
+
"@atlaskit/editor-common": "^91.1.0",
|
|
40
40
|
"@atlaskit/editor-palette": "1.6.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
42
42
|
"@atlaskit/editor-plugin-annotation": "1.19.8",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"@atlaskit/editor-plugin-selection": "^1.4.0",
|
|
51
51
|
"@atlaskit/editor-plugin-width": "^1.3.0",
|
|
52
52
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
53
|
-
"@atlaskit/editor-shared-styles": "^
|
|
53
|
+
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
54
54
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
55
55
|
"@atlaskit/form": "^10.5.0",
|
|
56
56
|
"@atlaskit/icon": "^22.18.0",
|
|
57
57
|
"@atlaskit/media-card": "^78.5.0",
|
|
58
58
|
"@atlaskit/media-client": "^28.0.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^2.2.0",
|
|
60
|
-
"@atlaskit/media-common": "^11.
|
|
61
|
-
"@atlaskit/media-filmstrip": "^47.
|
|
60
|
+
"@atlaskit/media-common": "^11.5.0",
|
|
61
|
+
"@atlaskit/media-filmstrip": "^47.4.0",
|
|
62
62
|
"@atlaskit/media-picker": "^66.7.0",
|
|
63
63
|
"@atlaskit/media-ui": "^25.15.0",
|
|
64
64
|
"@atlaskit/media-viewer": "^48.10.0",
|