@atlaskit/media-viewer 52.7.5 → 52.8.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/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/viewers/image/index.js +48 -34
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/viewers/image/index.js +13 -2
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/viewers/image/index.js +48 -34
- package/dist/types/viewers/image/index.d.ts +1 -0
- package/dist/types-ts4.5/viewers/image/index.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 52.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`c90ccf0c600ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c90ccf0c600ee) -
|
|
8
|
+
Enable cross product/cross client copy and paste of Media files by including clientId during Copy
|
|
9
|
+
operations.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 52.7.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ exports.packageVersion = exports.packageName = void 0;
|
|
|
10
10
|
var _analytics = require("@atlaskit/media-common/analytics");
|
|
11
11
|
var componentName = exports.component = exports.componentName = 'mediaViewer';
|
|
12
12
|
var packageName = exports.packageName = "@atlaskit/media-viewer";
|
|
13
|
-
var packageVersion = exports.packageVersion = "52.7.
|
|
13
|
+
var packageVersion = exports.packageVersion = "52.7.5";
|
|
14
14
|
function getFileAttributes(fileState) {
|
|
15
15
|
if (!fileState) {
|
|
16
16
|
return {
|
|
@@ -13,7 +13,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
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) { (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; }
|
|
15
15
|
var packageName = "@atlaskit/media-viewer";
|
|
16
|
-
var packageVersion = "52.7.
|
|
16
|
+
var packageVersion = "52.7.5";
|
|
17
17
|
var ufoExperience;
|
|
18
18
|
var getExperience = function getExperience() {
|
|
19
19
|
if (!ufoExperience) {
|
|
@@ -60,7 +60,7 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
60
60
|
key: "init",
|
|
61
61
|
value: function () {
|
|
62
62
|
var _init = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
63
|
-
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, preview, _yield$preview, value, origin, item, response, imgError;
|
|
63
|
+
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, preview, _yield$preview, value, origin, item, response, imgError;
|
|
64
64
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
|
66
66
|
case 0:
|
|
@@ -75,37 +75,48 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
75
75
|
_context.prev = 4;
|
|
76
76
|
orientation = 1;
|
|
77
77
|
isLocalFileReference = false;
|
|
78
|
+
_context.prev = 7;
|
|
79
|
+
_context.next = 10;
|
|
80
|
+
return mediaClient.getClientId(collectionName);
|
|
81
|
+
case 10:
|
|
82
|
+
clientId = _context.sent;
|
|
83
|
+
_context.next = 15;
|
|
84
|
+
break;
|
|
85
|
+
case 13:
|
|
86
|
+
_context.prev = 13;
|
|
87
|
+
_context.t0 = _context["catch"](7);
|
|
88
|
+
case 15:
|
|
78
89
|
preview = fileState.preview;
|
|
79
90
|
if (!preview) {
|
|
80
|
-
_context.next =
|
|
91
|
+
_context.next = 33;
|
|
81
92
|
break;
|
|
82
93
|
}
|
|
83
|
-
_context.next =
|
|
94
|
+
_context.next = 19;
|
|
84
95
|
return preview;
|
|
85
|
-
case
|
|
96
|
+
case 19:
|
|
86
97
|
_yield$preview = _context.sent;
|
|
87
98
|
value = _yield$preview.value;
|
|
88
99
|
origin = _yield$preview.origin;
|
|
89
100
|
if (!(value instanceof Blob)) {
|
|
90
|
-
_context.next =
|
|
101
|
+
_context.next = 30;
|
|
91
102
|
break;
|
|
92
103
|
}
|
|
93
|
-
_context.next =
|
|
104
|
+
_context.next = 25;
|
|
94
105
|
return (0, _mediaUi.getOrientation)(value);
|
|
95
|
-
case
|
|
106
|
+
case 25:
|
|
96
107
|
orientation = _context.sent;
|
|
97
108
|
objectUrl = URL.createObjectURL(value);
|
|
98
109
|
isLocalFileReference = origin === 'local';
|
|
99
|
-
_context.next =
|
|
110
|
+
_context.next = 31;
|
|
100
111
|
break;
|
|
101
|
-
case
|
|
112
|
+
case 30:
|
|
102
113
|
objectUrl = value;
|
|
103
|
-
case
|
|
104
|
-
_context.next =
|
|
114
|
+
case 31:
|
|
115
|
+
_context.next = 46;
|
|
105
116
|
break;
|
|
106
|
-
case
|
|
117
|
+
case 33:
|
|
107
118
|
if (!(0, _mediaClient.isImageRepresentationReady)(fileState)) {
|
|
108
|
-
_context.next =
|
|
119
|
+
_context.next = 44;
|
|
109
120
|
break;
|
|
110
121
|
}
|
|
111
122
|
item = processedFileStateToMediaItem(fileState);
|
|
@@ -116,56 +127,57 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
116
127
|
this.cancelImageFetch = function () {
|
|
117
128
|
return controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
118
129
|
};
|
|
119
|
-
_context.
|
|
120
|
-
_context.next =
|
|
130
|
+
_context.t1 = URL;
|
|
131
|
+
_context.next = 40;
|
|
121
132
|
return response;
|
|
122
|
-
case
|
|
123
|
-
_context.
|
|
124
|
-
objectUrl = _context.
|
|
125
|
-
_context.next =
|
|
133
|
+
case 40:
|
|
134
|
+
_context.t2 = _context.sent;
|
|
135
|
+
objectUrl = _context.t1.createObjectURL.call(_context.t1, _context.t2);
|
|
136
|
+
_context.next = 46;
|
|
126
137
|
break;
|
|
127
|
-
case
|
|
138
|
+
case 44:
|
|
128
139
|
this.setState({
|
|
129
140
|
content: _domain.Outcome.pending()
|
|
130
141
|
});
|
|
131
142
|
return _context.abrupt("return");
|
|
132
|
-
case
|
|
143
|
+
case 46:
|
|
133
144
|
if (!(!isLocalFileReference &&
|
|
134
145
|
// objectUrl at this point is binary file already
|
|
135
146
|
!(0, _mediaClient.isErrorFileState)(fileState) && fileState.status !== 'uploading' && fileState.mediaType === 'image' && (0, _mediaCommon.isImageMimeTypeSupportedByBrowser)(fileState.mimeType))) {
|
|
136
|
-
_context.next =
|
|
147
|
+
_context.next = 50;
|
|
137
148
|
break;
|
|
138
149
|
}
|
|
139
|
-
_context.next =
|
|
150
|
+
_context.next = 49;
|
|
140
151
|
return mediaClient.file.getFileBinaryURL(fileState.id, collectionName);
|
|
141
|
-
case
|
|
152
|
+
case 49:
|
|
142
153
|
originalBinaryImageUrl = _context.sent;
|
|
143
|
-
case
|
|
154
|
+
case 50:
|
|
144
155
|
this.setState({
|
|
145
156
|
content: _domain.Outcome.successful({
|
|
146
157
|
objectUrl: objectUrl,
|
|
147
158
|
orientation: orientation,
|
|
148
|
-
originalBinaryImageUrl: originalBinaryImageUrl
|
|
159
|
+
originalBinaryImageUrl: originalBinaryImageUrl,
|
|
160
|
+
clientId: clientId
|
|
149
161
|
})
|
|
150
162
|
});
|
|
151
|
-
_context.next =
|
|
163
|
+
_context.next = 56;
|
|
152
164
|
break;
|
|
153
|
-
case
|
|
154
|
-
_context.prev =
|
|
155
|
-
_context.
|
|
165
|
+
case 53:
|
|
166
|
+
_context.prev = 53;
|
|
167
|
+
_context.t3 = _context["catch"](4);
|
|
156
168
|
// TODO : properly handle aborted requests (MS-2843)
|
|
157
169
|
if (!(controller !== null && controller !== void 0 && controller.signal.aborted)) {
|
|
158
|
-
imgError = new _errors.MediaViewerError('imageviewer-fetch-url', _context.
|
|
170
|
+
imgError = new _errors.MediaViewerError('imageviewer-fetch-url', _context.t3 instanceof Error ? _context.t3 : undefined);
|
|
159
171
|
this.setState({
|
|
160
172
|
content: _domain.Outcome.failed(imgError)
|
|
161
173
|
});
|
|
162
174
|
this.props.onError(imgError);
|
|
163
175
|
}
|
|
164
|
-
case
|
|
176
|
+
case 56:
|
|
165
177
|
case "end":
|
|
166
178
|
return _context.stop();
|
|
167
179
|
}
|
|
168
|
-
}, _callee, this, [[4,
|
|
180
|
+
}, _callee, this, [[4, 53], [7, 13]]);
|
|
169
181
|
}));
|
|
170
182
|
function init() {
|
|
171
183
|
return _init.apply(this, arguments);
|
|
@@ -194,6 +206,7 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
194
206
|
}, {
|
|
195
207
|
key: "renderSuccessful",
|
|
196
208
|
value: function renderSuccessful(content) {
|
|
209
|
+
var _content$clientId;
|
|
197
210
|
var _this$props2 = this.props,
|
|
198
211
|
item = _this$props2.item,
|
|
199
212
|
onClose = _this$props2.onClose,
|
|
@@ -205,7 +218,8 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
205
218
|
var src = contextId ? (0, _mediaClient.addFileAttrsToUrl)(content.objectUrl, {
|
|
206
219
|
id: item.id,
|
|
207
220
|
contextId: contextId,
|
|
208
|
-
collection: collectionName
|
|
221
|
+
collection: collectionName,
|
|
222
|
+
clientId: (_content$clientId = content.clientId) !== null && _content$clientId !== void 0 ? _content$clientId : ''
|
|
209
223
|
}) : content.objectUrl;
|
|
210
224
|
return /*#__PURE__*/_react.default.createElement(_interactiveImg.InteractiveImg, {
|
|
211
225
|
onLoad: this.onLoad,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
const componentName = 'mediaViewer';
|
|
3
3
|
const packageName = "@atlaskit/media-viewer";
|
|
4
|
-
const packageVersion = "52.7.
|
|
4
|
+
const packageVersion = "52.7.5";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -3,7 +3,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
3
3
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
const packageName = "@atlaskit/media-viewer";
|
|
6
|
-
const packageVersion = "52.7.
|
|
6
|
+
const packageVersion = "52.7.5";
|
|
7
7
|
let ufoExperience;
|
|
8
8
|
const getExperience = () => {
|
|
9
9
|
if (!ufoExperience) {
|
|
@@ -47,6 +47,14 @@ export class ImageViewer extends BaseViewer {
|
|
|
47
47
|
let objectUrl;
|
|
48
48
|
let originalBinaryImageUrl;
|
|
49
49
|
let isLocalFileReference = false;
|
|
50
|
+
let clientId;
|
|
51
|
+
|
|
52
|
+
// Fetch clientId for cross-client copy
|
|
53
|
+
try {
|
|
54
|
+
clientId = await mediaClient.getClientId(collectionName);
|
|
55
|
+
} catch {
|
|
56
|
+
// ClientId is optional, silently fail
|
|
57
|
+
}
|
|
50
58
|
const {
|
|
51
59
|
preview
|
|
52
60
|
} = fileState;
|
|
@@ -85,7 +93,8 @@ export class ImageViewer extends BaseViewer {
|
|
|
85
93
|
content: Outcome.successful({
|
|
86
94
|
objectUrl,
|
|
87
95
|
orientation,
|
|
88
|
-
originalBinaryImageUrl
|
|
96
|
+
originalBinaryImageUrl,
|
|
97
|
+
clientId
|
|
89
98
|
})
|
|
90
99
|
});
|
|
91
100
|
} catch (err) {
|
|
@@ -115,6 +124,7 @@ export class ImageViewer extends BaseViewer {
|
|
|
115
124
|
URL.revokeObjectURL(objectUrl);
|
|
116
125
|
}
|
|
117
126
|
renderSuccessful(content) {
|
|
127
|
+
var _content$clientId;
|
|
118
128
|
const {
|
|
119
129
|
item,
|
|
120
130
|
onClose,
|
|
@@ -127,7 +137,8 @@ export class ImageViewer extends BaseViewer {
|
|
|
127
137
|
const src = contextId ? addFileAttrsToUrl(content.objectUrl, {
|
|
128
138
|
id: item.id,
|
|
129
139
|
contextId,
|
|
130
|
-
collection: collectionName
|
|
140
|
+
collection: collectionName,
|
|
141
|
+
clientId: (_content$clientId = content.clientId) !== null && _content$clientId !== void 0 ? _content$clientId : ''
|
|
131
142
|
}) : content.objectUrl;
|
|
132
143
|
return /*#__PURE__*/React.createElement(InteractiveImg, {
|
|
133
144
|
onLoad: this.onLoad,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
var componentName = 'mediaViewer';
|
|
3
3
|
var packageName = "@atlaskit/media-viewer";
|
|
4
|
-
var packageVersion = "52.7.
|
|
4
|
+
var packageVersion = "52.7.5";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -6,7 +6,7 @@ import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
|
6
6
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
var packageName = "@atlaskit/media-viewer";
|
|
9
|
-
var packageVersion = "52.7.
|
|
9
|
+
var packageVersion = "52.7.5";
|
|
10
10
|
var ufoExperience;
|
|
11
11
|
var getExperience = function getExperience() {
|
|
12
12
|
if (!ufoExperience) {
|
|
@@ -53,7 +53,7 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
53
53
|
key: "init",
|
|
54
54
|
value: function () {
|
|
55
55
|
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
56
|
-
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, preview, _yield$preview, value, origin, item, response, imgError;
|
|
56
|
+
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, preview, _yield$preview, value, origin, item, response, imgError;
|
|
57
57
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
58
58
|
while (1) switch (_context.prev = _context.next) {
|
|
59
59
|
case 0:
|
|
@@ -68,37 +68,48 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
68
68
|
_context.prev = 4;
|
|
69
69
|
orientation = 1;
|
|
70
70
|
isLocalFileReference = false;
|
|
71
|
+
_context.prev = 7;
|
|
72
|
+
_context.next = 10;
|
|
73
|
+
return mediaClient.getClientId(collectionName);
|
|
74
|
+
case 10:
|
|
75
|
+
clientId = _context.sent;
|
|
76
|
+
_context.next = 15;
|
|
77
|
+
break;
|
|
78
|
+
case 13:
|
|
79
|
+
_context.prev = 13;
|
|
80
|
+
_context.t0 = _context["catch"](7);
|
|
81
|
+
case 15:
|
|
71
82
|
preview = fileState.preview;
|
|
72
83
|
if (!preview) {
|
|
73
|
-
_context.next =
|
|
84
|
+
_context.next = 33;
|
|
74
85
|
break;
|
|
75
86
|
}
|
|
76
|
-
_context.next =
|
|
87
|
+
_context.next = 19;
|
|
77
88
|
return preview;
|
|
78
|
-
case
|
|
89
|
+
case 19:
|
|
79
90
|
_yield$preview = _context.sent;
|
|
80
91
|
value = _yield$preview.value;
|
|
81
92
|
origin = _yield$preview.origin;
|
|
82
93
|
if (!(value instanceof Blob)) {
|
|
83
|
-
_context.next =
|
|
94
|
+
_context.next = 30;
|
|
84
95
|
break;
|
|
85
96
|
}
|
|
86
|
-
_context.next =
|
|
97
|
+
_context.next = 25;
|
|
87
98
|
return getOrientation(value);
|
|
88
|
-
case
|
|
99
|
+
case 25:
|
|
89
100
|
orientation = _context.sent;
|
|
90
101
|
objectUrl = URL.createObjectURL(value);
|
|
91
102
|
isLocalFileReference = origin === 'local';
|
|
92
|
-
_context.next =
|
|
103
|
+
_context.next = 31;
|
|
93
104
|
break;
|
|
94
|
-
case
|
|
105
|
+
case 30:
|
|
95
106
|
objectUrl = value;
|
|
96
|
-
case
|
|
97
|
-
_context.next =
|
|
107
|
+
case 31:
|
|
108
|
+
_context.next = 46;
|
|
98
109
|
break;
|
|
99
|
-
case
|
|
110
|
+
case 33:
|
|
100
111
|
if (!isImageRepresentationReady(fileState)) {
|
|
101
|
-
_context.next =
|
|
112
|
+
_context.next = 44;
|
|
102
113
|
break;
|
|
103
114
|
}
|
|
104
115
|
item = processedFileStateToMediaItem(fileState);
|
|
@@ -109,56 +120,57 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
109
120
|
this.cancelImageFetch = function () {
|
|
110
121
|
return controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
111
122
|
};
|
|
112
|
-
_context.
|
|
113
|
-
_context.next =
|
|
123
|
+
_context.t1 = URL;
|
|
124
|
+
_context.next = 40;
|
|
114
125
|
return response;
|
|
115
|
-
case
|
|
116
|
-
_context.
|
|
117
|
-
objectUrl = _context.
|
|
118
|
-
_context.next =
|
|
126
|
+
case 40:
|
|
127
|
+
_context.t2 = _context.sent;
|
|
128
|
+
objectUrl = _context.t1.createObjectURL.call(_context.t1, _context.t2);
|
|
129
|
+
_context.next = 46;
|
|
119
130
|
break;
|
|
120
|
-
case
|
|
131
|
+
case 44:
|
|
121
132
|
this.setState({
|
|
122
133
|
content: Outcome.pending()
|
|
123
134
|
});
|
|
124
135
|
return _context.abrupt("return");
|
|
125
|
-
case
|
|
136
|
+
case 46:
|
|
126
137
|
if (!(!isLocalFileReference &&
|
|
127
138
|
// objectUrl at this point is binary file already
|
|
128
139
|
!isErrorFileState(fileState) && fileState.status !== 'uploading' && fileState.mediaType === 'image' && isImageMimeTypeSupportedByBrowser(fileState.mimeType))) {
|
|
129
|
-
_context.next =
|
|
140
|
+
_context.next = 50;
|
|
130
141
|
break;
|
|
131
142
|
}
|
|
132
|
-
_context.next =
|
|
143
|
+
_context.next = 49;
|
|
133
144
|
return mediaClient.file.getFileBinaryURL(fileState.id, collectionName);
|
|
134
|
-
case
|
|
145
|
+
case 49:
|
|
135
146
|
originalBinaryImageUrl = _context.sent;
|
|
136
|
-
case
|
|
147
|
+
case 50:
|
|
137
148
|
this.setState({
|
|
138
149
|
content: Outcome.successful({
|
|
139
150
|
objectUrl: objectUrl,
|
|
140
151
|
orientation: orientation,
|
|
141
|
-
originalBinaryImageUrl: originalBinaryImageUrl
|
|
152
|
+
originalBinaryImageUrl: originalBinaryImageUrl,
|
|
153
|
+
clientId: clientId
|
|
142
154
|
})
|
|
143
155
|
});
|
|
144
|
-
_context.next =
|
|
156
|
+
_context.next = 56;
|
|
145
157
|
break;
|
|
146
|
-
case
|
|
147
|
-
_context.prev =
|
|
148
|
-
_context.
|
|
158
|
+
case 53:
|
|
159
|
+
_context.prev = 53;
|
|
160
|
+
_context.t3 = _context["catch"](4);
|
|
149
161
|
// TODO : properly handle aborted requests (MS-2843)
|
|
150
162
|
if (!(controller !== null && controller !== void 0 && controller.signal.aborted)) {
|
|
151
|
-
imgError = new MediaViewerError('imageviewer-fetch-url', _context.
|
|
163
|
+
imgError = new MediaViewerError('imageviewer-fetch-url', _context.t3 instanceof Error ? _context.t3 : undefined);
|
|
152
164
|
this.setState({
|
|
153
165
|
content: Outcome.failed(imgError)
|
|
154
166
|
});
|
|
155
167
|
this.props.onError(imgError);
|
|
156
168
|
}
|
|
157
|
-
case
|
|
169
|
+
case 56:
|
|
158
170
|
case "end":
|
|
159
171
|
return _context.stop();
|
|
160
172
|
}
|
|
161
|
-
}, _callee, this, [[4,
|
|
173
|
+
}, _callee, this, [[4, 53], [7, 13]]);
|
|
162
174
|
}));
|
|
163
175
|
function init() {
|
|
164
176
|
return _init.apply(this, arguments);
|
|
@@ -187,6 +199,7 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
187
199
|
}, {
|
|
188
200
|
key: "renderSuccessful",
|
|
189
201
|
value: function renderSuccessful(content) {
|
|
202
|
+
var _content$clientId;
|
|
190
203
|
var _this$props2 = this.props,
|
|
191
204
|
item = _this$props2.item,
|
|
192
205
|
onClose = _this$props2.onClose,
|
|
@@ -198,7 +211,8 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
198
211
|
var src = contextId ? addFileAttrsToUrl(content.objectUrl, {
|
|
199
212
|
id: item.id,
|
|
200
213
|
contextId: contextId,
|
|
201
|
-
collection: collectionName
|
|
214
|
+
collection: collectionName,
|
|
215
|
+
clientId: (_content$clientId = content.clientId) !== null && _content$clientId !== void 0 ? _content$clientId : ''
|
|
202
216
|
}) : content.objectUrl;
|
|
203
217
|
return /*#__PURE__*/React.createElement(InteractiveImg, {
|
|
204
218
|
onLoad: this.onLoad,
|
|
@@ -19,6 +19,7 @@ export interface ImageViewerContent {
|
|
|
19
19
|
objectUrl: ObjectUrl;
|
|
20
20
|
originalBinaryImageUrl?: string;
|
|
21
21
|
orientation?: number;
|
|
22
|
+
clientId?: string;
|
|
22
23
|
}
|
|
23
24
|
export declare class ImageViewer extends BaseViewer<ImageViewerContent, ImageViewerProps> {
|
|
24
25
|
protected get initialState(): {
|
|
@@ -19,6 +19,7 @@ export interface ImageViewerContent {
|
|
|
19
19
|
objectUrl: ObjectUrl;
|
|
20
20
|
originalBinaryImageUrl?: string;
|
|
21
21
|
orientation?: number;
|
|
22
|
+
clientId?: string;
|
|
22
23
|
}
|
|
23
24
|
export declare class ImageViewer extends BaseViewer<ImageViewerContent, ImageViewerProps> {
|
|
24
25
|
protected get initialState(): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "52.
|
|
3
|
+
"version": "52.8.0",
|
|
4
4
|
"description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@atlaskit/icon": "^31.0.0",
|
|
41
41
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
42
42
|
"@atlaskit/icon-lab": "^5.16.0",
|
|
43
|
-
"@atlaskit/media-client": "^35.
|
|
44
|
-
"@atlaskit/media-client-react": "^4.
|
|
45
|
-
"@atlaskit/media-common": "^12.
|
|
43
|
+
"@atlaskit/media-client": "^35.8.0",
|
|
44
|
+
"@atlaskit/media-client-react": "^4.2.0",
|
|
45
|
+
"@atlaskit/media-common": "^12.4.0",
|
|
46
46
|
"@atlaskit/media-document-viewer": "^0.6.0",
|
|
47
47
|
"@atlaskit/media-svg": "^2.2.0",
|
|
48
48
|
"@atlaskit/media-ui": "^28.7.0",
|