@atlaskit/media-viewer 54.5.31 → 54.5.33
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/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/styleWrappers.js +3 -6
- package/dist/cjs/viewers/archiveSidebar/styleWrappers.js +1 -6
- package/dist/cjs/viewers/image/index.js +11 -7
- package/dist/cjs/viewers/svg/ImageWrapper-compiled.js +3 -8
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/styleWrappers.js +3 -6
- package/dist/es2019/viewers/archiveSidebar/styleWrappers.js +1 -6
- package/dist/es2019/viewers/image/index.js +11 -2
- package/dist/es2019/viewers/svg/ImageWrapper-compiled.js +3 -7
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/styleWrappers.js +3 -6
- package/dist/esm/viewers/archiveSidebar/styleWrappers.js +1 -6
- package/dist/esm/viewers/image/index.js +11 -7
- package/dist/esm/viewers/svg/ImageWrapper-compiled.js +3 -7
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 54.5.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`be5f53435795e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be5f53435795e) -
|
|
8
|
+
Cleanup feature gate `platform_media_a11y_suppression_fixes`. The accessible wrapper behavior is
|
|
9
|
+
now permanent in media card, viewer, and filmstrip.
|
|
10
|
+
|
|
11
|
+
## 54.5.32
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`aa2113836d418`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa2113836d418) -
|
|
16
|
+
[BMPT-8156] Image viewer now decides unsupported-MIME routing based on the MIME type of the actual
|
|
17
|
+
fetched bytes (`Blob.type`) rather than the declared `mimeType` from the items call. This handles
|
|
18
|
+
just-in-time (JIT) transformation correctly (e.g. a TIFF that is transcoded to JPEG on the fly, or
|
|
19
|
+
left as TIFF when the transform fails). Behaviour is unchanged when the
|
|
20
|
+
`platform_media_unsupported_mime_routing` feature gate is off.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 54.5.31
|
|
4
24
|
|
|
5
25
|
### 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 = "54.5.
|
|
13
|
+
var packageVersion = exports.packageVersion = "54.5.32";
|
|
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 = "54.5.
|
|
16
|
+
var packageVersion = "54.5.32";
|
|
17
17
|
var ufoExperience;
|
|
18
18
|
var getExperience = function getExperience() {
|
|
19
19
|
if (!ufoExperience) {
|
|
@@ -16,7 +16,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
16
16
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
17
|
var _reactScrolllock = require("react-scrolllock");
|
|
18
18
|
var _useCallbackRef = require("use-callback-ref");
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
19
|
var _primitives = require("@atlaskit/primitives");
|
|
21
20
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
22
21
|
var _excluded = ["canDrag", "isDragging", "shouldPixelate", "data-testid", "src", "style", "onLoad", "onError", "alt", "className"];
|
|
@@ -247,10 +246,8 @@ var ImageWrapper = exports.ImageWrapper = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
247
246
|
onClick = _ref19.onClick,
|
|
248
247
|
style = _ref19.style,
|
|
249
248
|
className = _ref19.className;
|
|
250
|
-
|
|
251
|
-
role:
|
|
252
|
-
} : {};
|
|
253
|
-
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, a11yProps, {
|
|
249
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
250
|
+
role: "none",
|
|
254
251
|
"data-testid": datatestId,
|
|
255
252
|
onClick: onClick,
|
|
256
253
|
ref: ref,
|
|
@@ -259,7 +256,7 @@ var ImageWrapper = exports.ImageWrapper = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
259
256
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
260
257
|
,
|
|
261
258
|
className: (0, _runtime.ax)(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
|
|
262
|
-
}
|
|
259
|
+
}, children);
|
|
263
260
|
});
|
|
264
261
|
var BaselineExtend = exports.BaselineExtend = function BaselineExtend() {
|
|
265
262
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -12,7 +12,6 @@ var React = _react;
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _reactIntl = require("react-intl");
|
|
14
14
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
17
|
var ARCHIVE_SIDE_BAR_WIDTH = exports.ARCHIVE_SIDE_BAR_WIDTH = 300;
|
|
@@ -60,17 +59,13 @@ var ArchiveDownloadButtonWrapper = exports.ArchiveDownloadButtonWrapper = functi
|
|
|
60
59
|
var children = _ref4.children,
|
|
61
60
|
_onClick = _ref4.onClick;
|
|
62
61
|
var intl = (0, _reactIntl.useIntl)();
|
|
63
|
-
return
|
|
62
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
64
63
|
"aria-label": intl.formatMessage(_mediaUi.messages.archive_download_label_assistive_text),
|
|
65
64
|
onClick: function onClick(event) {
|
|
66
65
|
return _onClick && _onClick(event);
|
|
67
66
|
},
|
|
68
67
|
"data-testid": "media-archiveDownloadButton",
|
|
69
68
|
className: (0, _runtime.ax)(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
|
|
70
|
-
}, children) : /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
onClick: _onClick,
|
|
72
|
-
"data-testid": "media-archiveDownloadButton",
|
|
73
|
-
className: (0, _runtime.ax)(["_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
|
|
74
69
|
}, children);
|
|
75
70
|
};
|
|
76
71
|
var DisabledArchiveDownloadButtonWrapper = exports.DisabledArchiveDownloadButtonWrapper = function DisabledArchiveDownloadButtonWrapper(_ref5) {
|
|
@@ -67,7 +67,7 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
67
67
|
key: "init",
|
|
68
68
|
value: function () {
|
|
69
69
|
var _init = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
70
|
-
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, preview, _yield$preview, value, origin, item, response, unsupportedError, imgError, _t, _t2
|
|
70
|
+
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, renderedBlobMimeType, preview, _yield$preview, value, origin, item, response, blob, effectiveMimeType, unsupportedError, imgError, _t, _t2;
|
|
71
71
|
return _regenerator.default.wrap(function (_context) {
|
|
72
72
|
while (1) switch (_context.prev = _context.next) {
|
|
73
73
|
case 0:
|
|
@@ -81,7 +81,7 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
81
81
|
controller = typeof AbortController !== 'undefined' ? new AbortController() : undefined;
|
|
82
82
|
_context.prev = 2;
|
|
83
83
|
orientation = 1;
|
|
84
|
-
isLocalFileReference = false;
|
|
84
|
+
isLocalFileReference = false; // The MIME type of the actual bytes that will be rendered.
|
|
85
85
|
_context.prev = 3;
|
|
86
86
|
_context.next = 4;
|
|
87
87
|
return mediaClient.getClientId(collectionName);
|
|
@@ -114,6 +114,7 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
114
114
|
orientation = _context.sent;
|
|
115
115
|
objectUrl = URL.createObjectURL(value);
|
|
116
116
|
isLocalFileReference = origin === 'local';
|
|
117
|
+
renderedBlobMimeType = value.type || undefined;
|
|
117
118
|
_context.next = 10;
|
|
118
119
|
break;
|
|
119
120
|
case 9:
|
|
@@ -134,11 +135,12 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
134
135
|
this.cancelImageFetch = function () {
|
|
135
136
|
return controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
136
137
|
};
|
|
137
|
-
_t2 = URL;
|
|
138
138
|
_context.next = 12;
|
|
139
139
|
return response;
|
|
140
140
|
case 12:
|
|
141
|
-
|
|
141
|
+
blob = _context.sent;
|
|
142
|
+
renderedBlobMimeType = blob.type || undefined;
|
|
143
|
+
objectUrl = URL.createObjectURL(blob);
|
|
142
144
|
_context.next = 14;
|
|
143
145
|
break;
|
|
144
146
|
case 13:
|
|
@@ -153,7 +155,9 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
153
155
|
_context.next = 17;
|
|
154
156
|
break;
|
|
155
157
|
}
|
|
156
|
-
|
|
158
|
+
// Prefer the MIME type of the actual fetched bytes over the declared one.
|
|
159
|
+
effectiveMimeType = (0, _platformFeatureFlags.fg)('platform_media_unsupported_mime_routing') ? renderedBlobMimeType !== null && renderedBlobMimeType !== void 0 ? renderedBlobMimeType : fileState.mimeType : fileState.mimeType;
|
|
160
|
+
if (!(0, _mediaCommon.isImageMimeTypeSupportedByBrowser)(effectiveMimeType)) {
|
|
157
161
|
_context.next = 16;
|
|
158
162
|
break;
|
|
159
163
|
}
|
|
@@ -192,10 +196,10 @@ var ImageViewer = exports.ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
192
196
|
break;
|
|
193
197
|
case 18:
|
|
194
198
|
_context.prev = 18;
|
|
195
|
-
|
|
199
|
+
_t2 = _context["catch"](2);
|
|
196
200
|
// TODO : properly handle aborted requests (MS-2843)
|
|
197
201
|
if (!(controller !== null && controller !== void 0 && controller.signal.aborted)) {
|
|
198
|
-
imgError = new _errors.MediaViewerError('imageviewer-fetch-url',
|
|
202
|
+
imgError = new _errors.MediaViewerError('imageviewer-fetch-url', _t2 instanceof Error ? _t2 : undefined);
|
|
199
203
|
this.setState({
|
|
200
204
|
content: _domain.Outcome.failed(imgError)
|
|
201
205
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
5
|
Object.defineProperty(exports, "__esModule", {
|
|
7
6
|
value: true
|
|
@@ -9,9 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
8
|
exports.ImageWrapper = void 0;
|
|
10
9
|
require("./ImageWrapper-compiled.compiled.css");
|
|
11
10
|
var _runtime = require("@compiled/react/runtime");
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
13
|
var imageWrapperStyles = null;
|
|
17
14
|
var dynamicImageWrapperStyles = null;
|
|
@@ -19,13 +16,11 @@ var ImageWrapper = exports.ImageWrapper = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
19
16
|
var children = _ref.children,
|
|
20
17
|
onClick = _ref.onClick,
|
|
21
18
|
isHidden = _ref.isHidden;
|
|
22
|
-
|
|
23
|
-
role:
|
|
24
|
-
} : {};
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, a11yProps, {
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
role: "none",
|
|
26
21
|
"data-testid": "media-viewer-svg-wrapper",
|
|
27
22
|
onClick: onClick,
|
|
28
23
|
ref: ref,
|
|
29
24
|
className: (0, _runtime.ax)(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
|
|
30
|
-
}
|
|
25
|
+
}, children);
|
|
31
26
|
});
|
|
@@ -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 = "54.5.
|
|
4
|
+
const packageVersion = "54.5.32";
|
|
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 = "54.5.
|
|
6
|
+
const packageVersion = "54.5.32";
|
|
7
7
|
let ufoExperience;
|
|
8
8
|
const getExperience = () => {
|
|
9
9
|
if (!ufoExperience) {
|
|
@@ -8,7 +8,6 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
import { forwardRef, useMemo } from 'react';
|
|
9
9
|
import { TouchScrollable } from 'react-scrolllock';
|
|
10
10
|
import { useMergeRefs } from 'use-callback-ref';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
13
12
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
14
13
|
import Heading from '@atlaskit/heading';
|
|
@@ -219,10 +218,8 @@ export const ImageWrapper = /*#__PURE__*/forwardRef(({
|
|
|
219
218
|
style,
|
|
220
219
|
className
|
|
221
220
|
}, ref) => {
|
|
222
|
-
|
|
223
|
-
role:
|
|
224
|
-
} : {};
|
|
225
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
|
|
221
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
222
|
+
role: "none",
|
|
226
223
|
"data-testid": datatestId,
|
|
227
224
|
onClick: onClick,
|
|
228
225
|
ref: ref,
|
|
@@ -231,7 +228,7 @@ export const ImageWrapper = /*#__PURE__*/forwardRef(({
|
|
|
231
228
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
232
229
|
,
|
|
233
230
|
className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
|
|
234
|
-
}
|
|
231
|
+
}, children);
|
|
235
232
|
});
|
|
236
233
|
export const BaselineExtend = () => /*#__PURE__*/React.createElement("div", {
|
|
237
234
|
className: ax(["_4t3i1osq _1e0c1o8l _s7n4nkob"])
|
|
@@ -7,7 +7,6 @@ import { forwardRef } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
9
9
|
import { messages } from '@atlaskit/media-ui';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
export const ARCHIVE_SIDE_BAR_WIDTH = 300;
|
|
12
11
|
const archiveItemViewerWrapperStyles = null;
|
|
13
12
|
const archiveSideBarStyles = null;
|
|
@@ -54,15 +53,11 @@ export const ArchiveDownloadButtonWrapper = ({
|
|
|
54
53
|
onClick
|
|
55
54
|
}) => {
|
|
56
55
|
const intl = useIntl();
|
|
57
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
58
57
|
"aria-label": intl.formatMessage(messages.archive_download_label_assistive_text),
|
|
59
58
|
onClick: event => onClick && onClick(event),
|
|
60
59
|
"data-testid": "media-archiveDownloadButton",
|
|
61
60
|
className: ax(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
|
|
62
|
-
}, children) : /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
onClick: onClick,
|
|
64
|
-
"data-testid": "media-archiveDownloadButton",
|
|
65
|
-
className: ax(["_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
|
|
66
61
|
}, children);
|
|
67
62
|
};
|
|
68
63
|
export const DisabledArchiveDownloadButtonWrapper = ({
|
|
@@ -55,6 +55,8 @@ export class ImageViewer extends BaseViewer {
|
|
|
55
55
|
let originalBinaryImageUrl;
|
|
56
56
|
let isLocalFileReference = false;
|
|
57
57
|
let clientId;
|
|
58
|
+
// The MIME type of the actual bytes that will be rendered.
|
|
59
|
+
let renderedBlobMimeType;
|
|
58
60
|
|
|
59
61
|
// Fetch clientId for cross-client copy
|
|
60
62
|
try {
|
|
@@ -74,6 +76,7 @@ export class ImageViewer extends BaseViewer {
|
|
|
74
76
|
orientation = await getOrientation(value);
|
|
75
77
|
objectUrl = URL.createObjectURL(value);
|
|
76
78
|
isLocalFileReference = origin === 'local';
|
|
79
|
+
renderedBlobMimeType = value.type || undefined;
|
|
77
80
|
} else {
|
|
78
81
|
objectUrl = value;
|
|
79
82
|
}
|
|
@@ -84,7 +87,9 @@ export class ImageViewer extends BaseViewer {
|
|
|
84
87
|
mode: 'fit'
|
|
85
88
|
}, controller, true, traceContext);
|
|
86
89
|
this.cancelImageFetch = () => controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
87
|
-
|
|
90
|
+
const blob = await response;
|
|
91
|
+
renderedBlobMimeType = blob.type || undefined;
|
|
92
|
+
objectUrl = URL.createObjectURL(blob);
|
|
88
93
|
} else {
|
|
89
94
|
this.setState({
|
|
90
95
|
content: Outcome.pending()
|
|
@@ -94,7 +99,11 @@ export class ImageViewer extends BaseViewer {
|
|
|
94
99
|
if (!isLocalFileReference &&
|
|
95
100
|
// objectUrl at this point is binary file already
|
|
96
101
|
!isErrorFileState(fileState) && fileState.status !== 'uploading' && fileState.mediaType === 'image') {
|
|
97
|
-
|
|
102
|
+
var _renderedBlobMimeType;
|
|
103
|
+
// Prefer the MIME type of the actual fetched bytes over the declared one.
|
|
104
|
+
|
|
105
|
+
const effectiveMimeType = fg('platform_media_unsupported_mime_routing') ? (_renderedBlobMimeType = renderedBlobMimeType) !== null && _renderedBlobMimeType !== void 0 ? _renderedBlobMimeType : fileState.mimeType : fileState.mimeType;
|
|
106
|
+
if (isImageMimeTypeSupportedByBrowser(effectiveMimeType)) {
|
|
98
107
|
originalBinaryImageUrl = await mediaClient.file.getFileBinaryURL(fileState.id, collectionName);
|
|
99
108
|
} else if (fg('platform_media_unsupported_mime_routing')) {
|
|
100
109
|
// Route unsupported MIME types browser can't natively decode straight to the
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import "./ImageWrapper-compiled.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React, { forwardRef } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
5
|
const imageWrapperStyles = null;
|
|
8
6
|
const dynamicImageWrapperStyles = null;
|
|
9
7
|
export const ImageWrapper = /*#__PURE__*/forwardRef(({
|
|
@@ -11,13 +9,11 @@ export const ImageWrapper = /*#__PURE__*/forwardRef(({
|
|
|
11
9
|
onClick,
|
|
12
10
|
isHidden
|
|
13
11
|
}, ref) => {
|
|
14
|
-
|
|
15
|
-
role:
|
|
16
|
-
} : {};
|
|
17
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
role: "none",
|
|
18
14
|
"data-testid": "media-viewer-svg-wrapper",
|
|
19
15
|
onClick: onClick,
|
|
20
16
|
ref: ref,
|
|
21
17
|
className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
|
|
22
|
-
}
|
|
18
|
+
}, children);
|
|
23
19
|
});
|
|
@@ -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 = "54.5.
|
|
4
|
+
var packageVersion = "54.5.32";
|
|
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 = "54.5.
|
|
9
|
+
var packageVersion = "54.5.32";
|
|
10
10
|
var ufoExperience;
|
|
11
11
|
var getExperience = function getExperience() {
|
|
12
12
|
if (!ufoExperience) {
|
|
@@ -13,7 +13,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
import { forwardRef, useMemo } from 'react';
|
|
14
14
|
import { TouchScrollable } from 'react-scrolllock';
|
|
15
15
|
import { useMergeRefs } from 'use-callback-ref';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
18
17
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
19
18
|
import Heading from '@atlaskit/heading';
|
|
@@ -239,10 +238,8 @@ export var ImageWrapper = /*#__PURE__*/forwardRef(function (_ref19, ref) {
|
|
|
239
238
|
onClick = _ref19.onClick,
|
|
240
239
|
style = _ref19.style,
|
|
241
240
|
className = _ref19.className;
|
|
242
|
-
|
|
243
|
-
role:
|
|
244
|
-
} : {};
|
|
245
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
|
|
241
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
role: "none",
|
|
246
243
|
"data-testid": datatestId,
|
|
247
244
|
onClick: onClick,
|
|
248
245
|
ref: ref,
|
|
@@ -251,7 +248,7 @@ export var ImageWrapper = /*#__PURE__*/forwardRef(function (_ref19, ref) {
|
|
|
251
248
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
252
249
|
,
|
|
253
250
|
className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
|
|
254
|
-
}
|
|
251
|
+
}, children);
|
|
255
252
|
});
|
|
256
253
|
export var BaselineExtend = function BaselineExtend() {
|
|
257
254
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -7,7 +7,6 @@ import { forwardRef } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
9
9
|
import { messages } from '@atlaskit/media-ui';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
export var ARCHIVE_SIDE_BAR_WIDTH = 300;
|
|
12
11
|
var archiveItemViewerWrapperStyles = null;
|
|
13
12
|
var archiveSideBarStyles = null;
|
|
@@ -53,17 +52,13 @@ export var ArchiveDownloadButtonWrapper = function ArchiveDownloadButtonWrapper(
|
|
|
53
52
|
var children = _ref4.children,
|
|
54
53
|
_onClick = _ref4.onClick;
|
|
55
54
|
var intl = useIntl();
|
|
56
|
-
return
|
|
55
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
57
56
|
"aria-label": intl.formatMessage(messages.archive_download_label_assistive_text),
|
|
58
57
|
onClick: function onClick(event) {
|
|
59
58
|
return _onClick && _onClick(event);
|
|
60
59
|
},
|
|
61
60
|
"data-testid": "media-archiveDownloadButton",
|
|
62
61
|
className: ax(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
|
|
63
|
-
}, children) : /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
onClick: _onClick,
|
|
65
|
-
"data-testid": "media-archiveDownloadButton",
|
|
66
|
-
className: ax(["_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
|
|
67
62
|
}, children);
|
|
68
63
|
};
|
|
69
64
|
export var DisabledArchiveDownloadButtonWrapper = function DisabledArchiveDownloadButtonWrapper(_ref5) {
|
|
@@ -60,7 +60,7 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
60
60
|
key: "init",
|
|
61
61
|
value: function () {
|
|
62
62
|
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
63
|
-
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, preview, _yield$preview, value, origin, item, response, unsupportedError, imgError, _t, _t2
|
|
63
|
+
var _this$props, fileState, mediaClient, collectionName, traceContext, controller, orientation, objectUrl, originalBinaryImageUrl, isLocalFileReference, clientId, renderedBlobMimeType, preview, _yield$preview, value, origin, item, response, blob, effectiveMimeType, unsupportedError, imgError, _t, _t2;
|
|
64
64
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
|
66
66
|
case 0:
|
|
@@ -74,7 +74,7 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
74
74
|
controller = typeof AbortController !== 'undefined' ? new AbortController() : undefined;
|
|
75
75
|
_context.prev = 2;
|
|
76
76
|
orientation = 1;
|
|
77
|
-
isLocalFileReference = false;
|
|
77
|
+
isLocalFileReference = false; // The MIME type of the actual bytes that will be rendered.
|
|
78
78
|
_context.prev = 3;
|
|
79
79
|
_context.next = 4;
|
|
80
80
|
return mediaClient.getClientId(collectionName);
|
|
@@ -107,6 +107,7 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
107
107
|
orientation = _context.sent;
|
|
108
108
|
objectUrl = URL.createObjectURL(value);
|
|
109
109
|
isLocalFileReference = origin === 'local';
|
|
110
|
+
renderedBlobMimeType = value.type || undefined;
|
|
110
111
|
_context.next = 10;
|
|
111
112
|
break;
|
|
112
113
|
case 9:
|
|
@@ -127,11 +128,12 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
127
128
|
this.cancelImageFetch = function () {
|
|
128
129
|
return controller === null || controller === void 0 ? void 0 : controller.abort();
|
|
129
130
|
};
|
|
130
|
-
_t2 = URL;
|
|
131
131
|
_context.next = 12;
|
|
132
132
|
return response;
|
|
133
133
|
case 12:
|
|
134
|
-
|
|
134
|
+
blob = _context.sent;
|
|
135
|
+
renderedBlobMimeType = blob.type || undefined;
|
|
136
|
+
objectUrl = URL.createObjectURL(blob);
|
|
135
137
|
_context.next = 14;
|
|
136
138
|
break;
|
|
137
139
|
case 13:
|
|
@@ -146,7 +148,9 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
146
148
|
_context.next = 17;
|
|
147
149
|
break;
|
|
148
150
|
}
|
|
149
|
-
|
|
151
|
+
// Prefer the MIME type of the actual fetched bytes over the declared one.
|
|
152
|
+
effectiveMimeType = fg('platform_media_unsupported_mime_routing') ? renderedBlobMimeType !== null && renderedBlobMimeType !== void 0 ? renderedBlobMimeType : fileState.mimeType : fileState.mimeType;
|
|
153
|
+
if (!isImageMimeTypeSupportedByBrowser(effectiveMimeType)) {
|
|
150
154
|
_context.next = 16;
|
|
151
155
|
break;
|
|
152
156
|
}
|
|
@@ -185,10 +189,10 @@ export var ImageViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
185
189
|
break;
|
|
186
190
|
case 18:
|
|
187
191
|
_context.prev = 18;
|
|
188
|
-
|
|
192
|
+
_t2 = _context["catch"](2);
|
|
189
193
|
// TODO : properly handle aborted requests (MS-2843)
|
|
190
194
|
if (!(controller !== null && controller !== void 0 && controller.signal.aborted)) {
|
|
191
|
-
imgError = new MediaViewerError('imageviewer-fetch-url',
|
|
195
|
+
imgError = new MediaViewerError('imageviewer-fetch-url', _t2 instanceof Error ? _t2 : undefined);
|
|
192
196
|
this.setState({
|
|
193
197
|
content: Outcome.failed(imgError)
|
|
194
198
|
});
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import "./ImageWrapper-compiled.compiled.css";
|
|
4
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React, { forwardRef } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
5
|
var imageWrapperStyles = null;
|
|
8
6
|
var dynamicImageWrapperStyles = null;
|
|
9
7
|
export var ImageWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
8
|
var children = _ref.children,
|
|
11
9
|
onClick = _ref.onClick,
|
|
12
10
|
isHidden = _ref.isHidden;
|
|
13
|
-
|
|
14
|
-
role:
|
|
15
|
-
} : {};
|
|
16
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
role: "none",
|
|
17
13
|
"data-testid": "media-viewer-svg-wrapper",
|
|
18
14
|
onClick: onClick,
|
|
19
15
|
ref: ref,
|
|
20
16
|
className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
|
|
21
|
-
}
|
|
17
|
+
}, children);
|
|
22
18
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "54.5.
|
|
3
|
+
"version": "54.5.33",
|
|
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/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/media-client": "^37.2.0",
|
|
43
43
|
"@atlaskit/media-client-react": "^6.1.0",
|
|
44
44
|
"@atlaskit/media-common": "^14.4.0",
|
|
45
|
-
"@atlaskit/media-document-viewer": "^
|
|
45
|
+
"@atlaskit/media-document-viewer": "^2.0.0",
|
|
46
46
|
"@atlaskit/media-state": "^3.1.0",
|
|
47
47
|
"@atlaskit/media-svg": "^3.1.0",
|
|
48
48
|
"@atlaskit/media-ui": "^30.11.0",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@atlaskit/spinner": "^20.1.0",
|
|
55
55
|
"@atlaskit/textfield": "^10.0.0",
|
|
56
56
|
"@atlaskit/theme": "^27.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
58
|
-
"@atlaskit/tokens": "^16.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^142.0.0",
|
|
58
|
+
"@atlaskit/tokens": "^16.4.0",
|
|
59
59
|
"@atlaskit/tooltip": "^24.0.0",
|
|
60
60
|
"@atlaskit/ufo": "^1.0.0",
|
|
61
61
|
"@babel/runtime": "^7.0.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@atlaskit/media-test-helpers": "^42.2.0",
|
|
93
93
|
"@atlaskit/ssr": "workspace:^",
|
|
94
94
|
"@atlaskit/toggle": "^17.1.0",
|
|
95
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
95
|
+
"@atlassian/a11y-jest-testing": "^0.15.0",
|
|
96
96
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
97
97
|
"@atlassian/testing-library": "^0.11.0",
|
|
98
98
|
"@atlassian/ufo": "^0.9.0",
|
|
@@ -132,9 +132,6 @@
|
|
|
132
132
|
"platform_media_react19_support": {
|
|
133
133
|
"type": "boolean"
|
|
134
134
|
},
|
|
135
|
-
"platform_media_a11y_suppression_fixes": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
135
|
"platform_media_a11y_nav_button_labels": {
|
|
139
136
|
"type": "boolean"
|
|
140
137
|
},
|