@atlaskit/editor-plugin-media 0.3.8 → 0.3.9
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 +7 -0
- package/dist/cjs/nodeviews/mediaNodeUpdater.js +6 -5
- package/dist/cjs/toolbar/utils.js +2 -2
- package/dist/cjs/utils/check-media-type.js +2 -2
- package/dist/es2019/nodeviews/mediaNodeUpdater.js +2 -1
- package/dist/es2019/toolbar/utils.js +1 -1
- package/dist/es2019/utils/check-media-type.js +1 -1
- package/dist/esm/nodeviews/mediaNodeUpdater.js +2 -1
- package/dist/esm/toolbar/utils.js +1 -1
- package/dist/esm/utils/check-media-type.js +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 0.3.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41659](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41659) [`a0c97a19dba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a0c97a19dba) - Remove unused utils and depreciated exports in mediaClient.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 0.3.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -14,6 +14,7 @@ var _v = _interopRequireDefault(require("uuid/v4"));
|
|
|
14
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
15
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
16
16
|
var _mediaClient = require("@atlaskit/media-client");
|
|
17
|
+
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
17
18
|
var _helpers = require("../commands/helpers");
|
|
18
19
|
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; }
|
|
19
20
|
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) { (0, _defineProperty2.default)(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; }
|
|
@@ -102,7 +103,7 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
102
103
|
return _context3.abrupt("return");
|
|
103
104
|
case 6:
|
|
104
105
|
mediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
105
|
-
mediaClient = (0,
|
|
106
|
+
mediaClient = (0, _mediaClientReact.getMediaClient)(mediaClientConfig);
|
|
106
107
|
id = attrs.id, collectionName = attrs.collection;
|
|
107
108
|
_context3.prev = 9;
|
|
108
109
|
_context3.next = 12;
|
|
@@ -245,7 +246,7 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
245
246
|
}
|
|
246
247
|
return _context7.abrupt("return");
|
|
247
248
|
case 8:
|
|
248
|
-
mediaClient = (0,
|
|
249
|
+
mediaClient = (0, _mediaClientReact.getMediaClient)(uploadMediaClientConfig);
|
|
249
250
|
collection = mediaProvider.uploadParams && mediaProvider.uploadParams.collection;
|
|
250
251
|
_context7.prev = 10;
|
|
251
252
|
_context7.next = 13;
|
|
@@ -414,7 +415,7 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
414
415
|
}
|
|
415
416
|
return _context10.abrupt("return");
|
|
416
417
|
case 17:
|
|
417
|
-
mediaClient = (0,
|
|
418
|
+
mediaClient = (0, _mediaClientReact.getMediaClient)(uploadMediaClientConfig);
|
|
418
419
|
_context10.next = 20;
|
|
419
420
|
return uploadMediaClientConfig.getAuthFromContext(contextId);
|
|
420
421
|
case 20:
|
|
@@ -559,7 +560,7 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
559
560
|
}
|
|
560
561
|
return _context13.abrupt("return");
|
|
561
562
|
case 9:
|
|
562
|
-
mediaClient = (0,
|
|
563
|
+
mediaClient = (0, _mediaClientReact.getMediaClient)(uploadMediaClientConfig);
|
|
563
564
|
_context13.next = 12;
|
|
564
565
|
return uploadMediaClientConfig.getAuthFromContext(nodeContextId);
|
|
565
566
|
case 12:
|
|
@@ -658,7 +659,7 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
658
659
|
});
|
|
659
660
|
case 15:
|
|
660
661
|
viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
661
|
-
mediaClient = (0,
|
|
662
|
+
mediaClient = (0, _mediaClientReact.getMediaClient)(viewMediaClientConfig);
|
|
662
663
|
_context14.next = 19;
|
|
663
664
|
return mediaClient.file.getCurrentState(id, {
|
|
664
665
|
collectionName: collection
|
|
@@ -11,7 +11,7 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
|
11
11
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
12
12
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
-
var
|
|
14
|
+
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
15
15
|
var getSelectedMediaContainerNodeAttrs = exports.getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
16
16
|
var selectedNode = mediaPluginState.selectedMediaContainerNode();
|
|
17
17
|
if (selectedNode && selectedNode.attrs) {
|
|
@@ -32,7 +32,7 @@ var downloadMedia = exports.downloadMedia = /*#__PURE__*/function () {
|
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
id = selectedNodeAttrs.id, _selectedNodeAttrs$co = selectedNodeAttrs.collection, collection = _selectedNodeAttrs$co === void 0 ? '' : _selectedNodeAttrs$co;
|
|
35
|
-
mediaClient = (0,
|
|
35
|
+
mediaClient = (0, _mediaClientReact.getMediaClient)(mediaPluginState.mediaClientConfig);
|
|
36
36
|
_context.next = 7;
|
|
37
37
|
return mediaClient.file.getCurrentState(id, {
|
|
38
38
|
collectionName: collection
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.checkMediaType = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var
|
|
10
|
+
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
11
11
|
var checkMediaType = exports.checkMediaType = /*#__PURE__*/function () {
|
|
12
12
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(mediaNode, mediaClientConfig) {
|
|
13
13
|
var fileState;
|
|
@@ -28,7 +28,7 @@ var checkMediaType = exports.checkMediaType = /*#__PURE__*/function () {
|
|
|
28
28
|
case 4:
|
|
29
29
|
_context.prev = 4;
|
|
30
30
|
_context.next = 7;
|
|
31
|
-
return (0,
|
|
31
|
+
return (0, _mediaClientReact.getMediaClient)(mediaClientConfig).file.getCurrentState(mediaNode.attrs.id, {
|
|
32
32
|
collectionName: mediaNode.attrs.collection
|
|
33
33
|
});
|
|
34
34
|
case 7:
|
|
@@ -2,7 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import uuidV4 from 'uuid/v4';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
5
|
-
import { getAttrsFromUrl,
|
|
5
|
+
import { getAttrsFromUrl, isImageRepresentationReady, isMediaBlobUrl } from '@atlaskit/media-client';
|
|
6
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
6
7
|
import { replaceExternalMedia, updateAllMediaSingleNodesAttrs, updateCurrentMediaNodeAttrs, updateMediaSingleNodeAttrs } from '../commands/helpers';
|
|
7
8
|
export class MediaNodeUpdater {
|
|
8
9
|
constructor(props) {
|
|
@@ -2,7 +2,7 @@ import memoizeOne from 'memoize-one';
|
|
|
2
2
|
import { wrappedLayouts } from '@atlaskit/editor-common/media-single';
|
|
3
3
|
import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import { getMediaClient } from '@atlaskit/media-client';
|
|
5
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
6
6
|
export const getSelectedMediaContainerNodeAttrs = mediaPluginState => {
|
|
7
7
|
const selectedNode = mediaPluginState.selectedMediaContainerNode();
|
|
8
8
|
if (selectedNode && selectedNode.attrs) {
|
|
@@ -8,7 +8,8 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
8
8
|
import uuidV4 from 'uuid/v4';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
11
|
-
import { getAttrsFromUrl,
|
|
11
|
+
import { getAttrsFromUrl, isImageRepresentationReady, isMediaBlobUrl as _isMediaBlobUrl } from '@atlaskit/media-client';
|
|
12
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
12
13
|
import { replaceExternalMedia, updateAllMediaSingleNodesAttrs, updateCurrentMediaNodeAttrs, updateMediaSingleNodeAttrs } from '../commands/helpers';
|
|
13
14
|
export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
14
15
|
function MediaNodeUpdater(props) {
|
|
@@ -4,7 +4,7 @@ import memoizeOne from 'memoize-one';
|
|
|
4
4
|
import { wrappedLayouts } from '@atlaskit/editor-common/media-single';
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { getMediaClient } from '@atlaskit/media-client';
|
|
7
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
8
8
|
export var getSelectedMediaContainerNodeAttrs = function getSelectedMediaContainerNodeAttrs(mediaPluginState) {
|
|
9
9
|
var selectedNode = mediaPluginState.selectedMediaContainerNode();
|
|
10
10
|
if (selectedNode && selectedNode.attrs) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { getMediaClient } from '@atlaskit/media-client';
|
|
3
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
4
4
|
export var checkMediaType = /*#__PURE__*/function () {
|
|
5
5
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mediaNode, mediaClientConfig) {
|
|
6
6
|
var fileState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
38
38
|
"@atlaskit/button": "^16.11.0",
|
|
39
|
-
"@atlaskit/editor-common": "^76.
|
|
39
|
+
"@atlaskit/editor-common": "^76.15.0",
|
|
40
40
|
"@atlaskit/editor-palette": "1.5.1",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"@atlaskit/form": "^8.11.0",
|
|
54
54
|
"@atlaskit/icon": "^21.12.0",
|
|
55
55
|
"@atlaskit/media-card": "^77.2.0",
|
|
56
|
-
"@atlaskit/media-client": "^
|
|
56
|
+
"@atlaskit/media-client": "^25.0.0",
|
|
57
|
+
"@atlaskit/media-client-react": "^1.3.0",
|
|
57
58
|
"@atlaskit/media-common": "^9.0.0",
|
|
58
59
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
59
60
|
"@atlaskit/media-picker": "^66.2.0",
|