@atlaskit/media-viewer 53.0.0 → 53.0.2

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/media-viewer
2
2
 
3
+ ## 53.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`87c390129e175`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/87c390129e175) -
8
+ [ux] Fix accessibility suppression for media components behind feature gate
9
+ `platform_media_a11y_suppression_fixes`. Replaces `role="presentation"` with `role="none"` and
10
+ removes `tabIndex={-1}`, `onKeyDown`, and `onFocus` handlers from non-interactive media wrappers
11
+ to prevent focus being stolen from the editor when media cards are clicked.
12
+
13
+ ## 53.0.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [`e3d1ec1074c7e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3d1ec1074c7e) -
18
+ Removing UNSAFE_componentWillReceiveProps from media-picker, media-avatar-picker and media-viewer
19
+ package to support React19 migration
20
+
3
21
  ## 53.0.0
4
22
 
5
23
  ### Major Changes
@@ -1,5 +1,4 @@
1
1
 
2
- ._kkk2n7od{all:unset}
3
2
  ._11q75a80{background:linear-gradient(180deg,#101214,rgba(14,22,36,0)) no-repeat}
4
3
  ._151kfhey._151kfhey h1{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
5
4
  ._2rkofajl{border-radius:var(--ds-radius-small,3px)}
@@ -28,7 +27,6 @@
28
27
  ._1bto1l2s{text-overflow:ellipsis}
29
28
  ._1e0c1o8l{display:inline-block}
30
29
  ._1e0c1txw{display:flex}
31
- ._1e0c1ule{display:block}
32
30
  ._1ghp1kxc video{max-height:100vh}
33
31
  ._1itkdlpg{background-image:linear-gradient(0deg,#101214,rgba(14,22,36,0))}
34
32
  ._1jyy1poe._1jyy1poe h1{color:#c7d1db}
@@ -19,8 +19,6 @@ var _useCallbackRef = require("use-callback-ref");
19
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
20
  var _primitives = require("@atlaskit/primitives");
21
21
  var _heading = _interopRequireDefault(require("@atlaskit/heading"));
22
- var _reactIntl = require("react-intl");
23
- var _mediaUi = require("@atlaskit/media-ui");
24
22
  var _excluded = ["canDrag", "isDragging", "shouldPixelate", "data-testid", "src", "style", "onLoad", "onError", "alt", "className"];
25
23
  /* eslint-disable @atlaskit/design-system/use-tokens-typography */
26
24
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
@@ -74,7 +72,6 @@ var downloadButtonWrapperStyles = null;
74
72
  var customVideoPlayerWrapperStyles = null;
75
73
  var sidebarWrapperStyles = null;
76
74
  var spinnerWrapperStyles = null;
77
- var resetButtonStyle = null;
78
75
  var formattedMessageWrapperStyles = null;
79
76
  // We are keeping this data-testid since JIRA is still using it in their codebase to perform checks. Before removing this, we need to ensure this 'media-viewer-popup' test id is not being used anywhere else in other codebases
80
77
  var Blanket = exports.Blanket = function Blanket(_ref) {
@@ -247,33 +244,22 @@ var LeftHeader = exports.LeftHeader = function LeftHeader(_ref18) {
247
244
  var ImageWrapper = exports.ImageWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref19, ref) {
248
245
  var children = _ref19.children,
249
246
  datatestId = _ref19['data-testid'],
250
- _onClick = _ref19.onClick,
247
+ onClick = _ref19.onClick,
251
248
  style = _ref19.style,
252
249
  className = _ref19.className;
253
- var intl = (0, _reactIntl.useIntl)();
254
- return (0, _platformFeatureFlags.fg)('platform_media_a11y_suppression_fixes') ? /*#__PURE__*/React.createElement("button", {
250
+ var a11yProps = (0, _platformFeatureFlags.fg)("platform_media_a11y_suppression_fixes") ? {
251
+ role: "none"
252
+ } : {};
253
+ return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({}, a11yProps, {
255
254
  "data-testid": datatestId,
256
- onClick: function onClick(event) {
257
- return _onClick && _onClick(event);
258
- },
259
- ref: ref,
260
- "aria-label": intl.formatMessage(_mediaUi.messages.svg_image_preview_label_assistive_text)
261
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
262
- ,
263
- style: style
264
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
265
- ,
266
- className: (0, _runtime.ax)(["_kkk2n7od _1e0c1ule", "_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
267
- }, children) : /*#__PURE__*/React.createElement("div", {
268
- "data-testid": datatestId,
269
- onClick: _onClick,
255
+ onClick: onClick,
270
256
  ref: ref,
271
257
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
272
258
  style: style
273
259
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
274
260
  ,
275
261
  className: (0, _runtime.ax)(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
276
- }, children);
262
+ }), children);
277
263
  });
278
264
  var BaselineExtend = exports.BaselineExtend = function BaselineExtend() {
279
265
  return /*#__PURE__*/React.createElement("div", {
@@ -1,9 +1,11 @@
1
1
 
2
+ ._kkk2n7od{all:unset}
2
3
  ._19itglyw{border:none}
3
4
  ._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
4
5
  ._2rkofajl{border-radius:var(--ds-radius-small,3px)}
5
6
  ._v564rca0{transition:background-color .3s}
6
- ._v564t24z{transition:all 1s}._154iidpf{top:0}
7
+ ._v564t24z{transition:all 1s}
8
+ ._154iidpf{top:0}
7
9
  ._16jlkb7n{flex-grow:1}
8
10
  ._18m915vq{overflow-y:hidden}
9
11
  ._18m915zi{overflow-y:scroll}
@@ -17,6 +19,7 @@
17
19
  ._1bsb1osq{width:100%}
18
20
  ._1bto1l2s{text-overflow:ellipsis}
19
21
  ._1e0c1txw{display:flex}
22
+ ._1e0c1ule{display:block}
20
23
  ._1ltv15ov{left:var(--_53yrec)}
21
24
  ._1ltvidpf{left:0}
22
25
  ._1o51q7pw{animation-fill-mode:forwards}
@@ -53,7 +56,10 @@
53
56
  ._u5f31v6z{padding-right:7px}
54
57
  ._u5f3v47k{padding-right:var(--ds-space-250,20px)}
55
58
  ._vchhusvi{box-sizing:border-box}
56
- ._vwz41xde{line-height:1.14286}
59
+ ._vwz41xde{line-height:1.14286}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
60
+ ._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
61
+ ._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
62
+ ._ra3xnqa1:focus-visible{outline-style:solid}
57
63
  ._d0altlke:hover{cursor:pointer}
58
64
  ._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
59
65
  ._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
@@ -20,6 +20,7 @@ var archiveItemViewerWrapperStyles = null;
20
20
  var archiveSideBarStyles = null;
21
21
  var slideDown = null;
22
22
  var archiveDownloadButtonWrapperStyles = null;
23
+ var archiveDownloadButtonWrapperStyleFix = null;
23
24
  var disabledArchiveDownloadButtonWrapperStyles = null;
24
25
  var archiveSidebarFolderWrapperStyles = null;
25
26
  var sidebarItemWrapperStyles = null;
@@ -65,7 +66,7 @@ var ArchiveDownloadButtonWrapper = exports.ArchiveDownloadButtonWrapper = functi
65
66
  return _onClick && _onClick(event);
66
67
  },
67
68
  "data-testid": "media-archiveDownloadButton",
68
- className: (0, _runtime.ax)(["_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
69
+ className: (0, _runtime.ax)(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
69
70
  }, children) : /*#__PURE__*/React.createElement("div", {
70
71
  onClick: _onClick,
71
72
  "data-testid": "media-archiveDownloadButton",
@@ -17,6 +17,7 @@ var _reactIntl = require("react-intl");
17
17
  var _mediaUi = require("@atlaskit/media-ui");
18
18
  var _deepEqual = _interopRequireDefault(require("deep-equal"));
19
19
  var _mediaClient = require("@atlaskit/media-client");
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var _errorMessage = _interopRequireDefault(require("../errorMessage"));
21
22
  var _loading = require("../loading");
22
23
  var _download = require("../download");
@@ -73,6 +74,9 @@ var BaseViewer = exports.BaseViewer = /*#__PURE__*/function (_React$Component) {
73
74
  }, {
74
75
  key: "UNSAFE_componentWillReceiveProps",
75
76
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
77
+ if ((0, _platformFeatureFlags.fg)('platform_media_package_react19_lifecycle_fix')) {
78
+ return;
79
+ }
76
80
  if (this.needsReset(nextProps, this.props)) {
77
81
  this.release();
78
82
  this.setState(this.initialState);
@@ -81,8 +85,16 @@ var BaseViewer = exports.BaseViewer = /*#__PURE__*/function (_React$Component) {
81
85
  }, {
82
86
  key: "componentDidUpdate",
83
87
  value: function componentDidUpdate(prevProps) {
84
- if (this.needsReset(prevProps, this.props)) {
85
- this.init();
88
+ if ((0, _platformFeatureFlags.fg)('platform_media_package_react19_lifecycle_fix')) {
89
+ if (this.needsReset(prevProps, this.props)) {
90
+ this.release();
91
+ this.setState(this.initialState);
92
+ this.init();
93
+ }
94
+ } else {
95
+ if (this.needsReset(prevProps, this.props)) {
96
+ this.init();
97
+ }
86
98
  }
87
99
  }
88
100
  }, {
@@ -1,6 +1,7 @@
1
1
  /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  var _typeof = require("@babel/runtime/helpers/typeof");
5
6
  Object.defineProperty(exports, "__esModule", {
6
7
  value: true
@@ -8,9 +9,8 @@ Object.defineProperty(exports, "__esModule", {
8
9
  exports.ImageWrapper = void 0;
9
10
  require("./ImageWrapper-compiled.compiled.css");
10
11
  var _runtime = require("@compiled/react/runtime");
11
- var _mediaUi = require("@atlaskit/media-ui");
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
13
  var _react = _interopRequireWildcard(require("react"));
13
- var _reactIntl = require("react-intl");
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
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); }
16
16
  var imageWrapperStyles = null;
@@ -19,17 +19,13 @@ var ImageWrapper = exports.ImageWrapper = /*#__PURE__*/(0, _react.forwardRef)(fu
19
19
  var children = _ref.children,
20
20
  onClick = _ref.onClick,
21
21
  isHidden = _ref.isHidden;
22
- var intl = (0, _reactIntl.useIntl)();
23
- return (0, _platformFeatureFlags.fg)('platform_media_a11y_suppression_fixes') ? /*#__PURE__*/_react.default.createElement("button", {
22
+ var a11yProps = (0, _platformFeatureFlags.fg)('platform_media_a11y_suppression_fixes') ? {
23
+ role: 'none'
24
+ } : {};
25
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, a11yProps, {
24
26
  "data-testid": "media-viewer-svg-wrapper",
25
27
  onClick: onClick,
26
28
  ref: ref,
27
- "aria-label": intl.formatMessage(_mediaUi.messages.svg_image_preview_label_assistive_text),
28
29
  className: (0, _runtime.ax)(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
29
- }, children) : /*#__PURE__*/_react.default.createElement("div", {
30
- "data-testid": "media-viewer-svg-wrapper",
31
- onClick: onClick,
32
- ref: ref,
33
- className: (0, _runtime.ax)(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
34
- }, children);
30
+ }), children);
35
31
  });
@@ -1,5 +1,4 @@
1
1
 
2
- ._kkk2n7od{all:unset}
3
2
  ._11q75a80{background:linear-gradient(180deg,#101214,rgba(14,22,36,0)) no-repeat}
4
3
  ._151kfhey._151kfhey h1{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
5
4
  ._2rkofajl{border-radius:var(--ds-radius-small,3px)}
@@ -28,7 +27,6 @@
28
27
  ._1bto1l2s{text-overflow:ellipsis}
29
28
  ._1e0c1o8l{display:inline-block}
30
29
  ._1e0c1txw{display:flex}
31
- ._1e0c1ule{display:block}
32
30
  ._1ghp1kxc video{max-height:100vh}
33
31
  ._1itkdlpg{background-image:linear-gradient(0deg,#101214,rgba(14,22,36,0))}
34
32
  ._1jyy1poe._1jyy1poe h1{color:#c7d1db}
@@ -12,8 +12,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
13
13
  import { Box, xcss } from '@atlaskit/primitives';
14
14
  import Heading from '@atlaskit/heading';
15
- import { useIntl } from 'react-intl';
16
- import { messages } from '@atlaskit/media-ui';
17
15
  const blanketStyles = null;
18
16
  const headerWrapperStyles = null;
19
17
  const archiveHeaderWrapperStyles = null;
@@ -61,7 +59,6 @@ const downloadButtonWrapperStyles = null;
61
59
  const customVideoPlayerWrapperStyles = null;
62
60
  const sidebarWrapperStyles = null;
63
61
  const spinnerWrapperStyles = null;
64
- const resetButtonStyle = null;
65
62
  const formattedMessageWrapperStyles = null;
66
63
  // We are keeping this data-testid since JIRA is still using it in their codebase to perform checks. Before removing this, we need to ensure this 'media-viewer-popup' test id is not being used anywhere else in other codebases
67
64
  export const Blanket = ({
@@ -222,19 +219,10 @@ export const ImageWrapper = /*#__PURE__*/forwardRef(({
222
219
  style,
223
220
  className
224
221
  }, ref) => {
225
- const intl = useIntl();
226
- return fg('platform_media_a11y_suppression_fixes') ? /*#__PURE__*/React.createElement("button", {
227
- "data-testid": datatestId,
228
- onClick: event => onClick && onClick(event),
229
- ref: ref,
230
- "aria-label": intl.formatMessage(messages.svg_image_preview_label_assistive_text)
231
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
232
- ,
233
- style: style
234
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
235
- ,
236
- className: ax(["_kkk2n7od _1e0c1ule", "_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
237
- }, children) : /*#__PURE__*/React.createElement("div", {
222
+ const a11yProps = fg("platform_media_a11y_suppression_fixes") ? {
223
+ role: "none"
224
+ } : {};
225
+ return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
238
226
  "data-testid": datatestId,
239
227
  onClick: onClick,
240
228
  ref: ref,
@@ -243,7 +231,7 @@ export const ImageWrapper = /*#__PURE__*/forwardRef(({
243
231
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
244
232
  ,
245
233
  className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
246
- }, children);
234
+ }), children);
247
235
  });
248
236
  export const BaselineExtend = () => /*#__PURE__*/React.createElement("div", {
249
237
  className: ax(["_4t3i1osq _1e0c1o8l _s7n4nkob"])
@@ -1,9 +1,11 @@
1
1
 
2
+ ._kkk2n7od{all:unset}
2
3
  ._19itglyw{border:none}
3
4
  ._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
4
5
  ._2rkofajl{border-radius:var(--ds-radius-small,3px)}
5
6
  ._v564rca0{transition:background-color .3s}
6
- ._v564t24z{transition:all 1s}._154iidpf{top:0}
7
+ ._v564t24z{transition:all 1s}
8
+ ._154iidpf{top:0}
7
9
  ._16jlkb7n{flex-grow:1}
8
10
  ._18m915vq{overflow-y:hidden}
9
11
  ._18m915zi{overflow-y:scroll}
@@ -17,6 +19,7 @@
17
19
  ._1bsb1osq{width:100%}
18
20
  ._1bto1l2s{text-overflow:ellipsis}
19
21
  ._1e0c1txw{display:flex}
22
+ ._1e0c1ule{display:block}
20
23
  ._1ltv1mjv{left:300px}
21
24
  ._1ltvidpf{left:0}
22
25
  ._1o51q7pw{animation-fill-mode:forwards}
@@ -53,7 +56,10 @@
53
56
  ._u5f31v6z{padding-right:7px}
54
57
  ._u5f3v47k{padding-right:var(--ds-space-250,20px)}
55
58
  ._vchhusvi{box-sizing:border-box}
56
- ._vwz41xde{line-height:1.14286}
59
+ ._vwz41xde{line-height:1.14286}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
60
+ ._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
61
+ ._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
62
+ ._ra3xnqa1:focus-visible{outline-style:solid}
57
63
  ._d0altlke:hover{cursor:pointer}
58
64
  ._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
59
65
  ._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
@@ -13,6 +13,7 @@ const archiveItemViewerWrapperStyles = null;
13
13
  const archiveSideBarStyles = null;
14
14
  const slideDown = null;
15
15
  const archiveDownloadButtonWrapperStyles = null;
16
+ const archiveDownloadButtonWrapperStyleFix = null;
16
17
  const disabledArchiveDownloadButtonWrapperStyles = null;
17
18
  const archiveSidebarFolderWrapperStyles = null;
18
19
  const sidebarItemWrapperStyles = null;
@@ -57,7 +58,7 @@ export const ArchiveDownloadButtonWrapper = ({
57
58
  "aria-label": intl.formatMessage(messages.archive_download_label_assistive_text),
58
59
  onClick: event => onClick && onClick(event),
59
60
  "data-testid": "media-archiveDownloadButton",
60
- className: ax(["_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
61
+ className: ax(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
61
62
  }, children) : /*#__PURE__*/React.createElement("div", {
62
63
  onClick: onClick,
63
64
  "data-testid": "media-archiveDownloadButton",
@@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl';
4
4
  import { messages } from '@atlaskit/media-ui';
5
5
  import deepEqual from 'deep-equal';
6
6
  import { globalMediaEventEmitter } from '@atlaskit/media-client';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import ErrorMessage from '../errorMessage';
8
9
  import { Spinner } from '../loading';
9
10
  import { ErrorViewDownloadButton } from '../download';
@@ -45,14 +46,25 @@ export class BaseViewer extends React.Component {
45
46
  // However, this lifecycle method might eventually be deprecated, so be careful
46
47
  // when working with it.
47
48
  UNSAFE_componentWillReceiveProps(nextProps) {
49
+ if (fg('platform_media_package_react19_lifecycle_fix')) {
50
+ return;
51
+ }
48
52
  if (this.needsReset(nextProps, this.props)) {
49
53
  this.release();
50
54
  this.setState(this.initialState);
51
55
  }
52
56
  }
53
57
  componentDidUpdate(prevProps) {
54
- if (this.needsReset(prevProps, this.props)) {
55
- this.init();
58
+ if (fg('platform_media_package_react19_lifecycle_fix')) {
59
+ if (this.needsReset(prevProps, this.props)) {
60
+ this.release();
61
+ this.setState(this.initialState);
62
+ this.init();
63
+ }
64
+ } else {
65
+ if (this.needsReset(prevProps, this.props)) {
66
+ this.init();
67
+ }
56
68
  }
57
69
  }
58
70
  render() {
@@ -1,9 +1,8 @@
1
1
  /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import "./ImageWrapper-compiled.compiled.css";
3
4
  import { ax, ix } from "@compiled/react/runtime";
4
- import { messages } from '@atlaskit/media-ui';
5
5
  import React, { forwardRef } from 'react';
6
- import { useIntl } from 'react-intl';
7
6
  import { fg } from '@atlaskit/platform-feature-flags';
8
7
  const imageWrapperStyles = null;
9
8
  const dynamicImageWrapperStyles = null;
@@ -12,17 +11,13 @@ export const ImageWrapper = /*#__PURE__*/forwardRef(({
12
11
  onClick,
13
12
  isHidden
14
13
  }, ref) => {
15
- const intl = useIntl();
16
- return fg('platform_media_a11y_suppression_fixes') ? /*#__PURE__*/React.createElement("button", {
14
+ const a11yProps = fg('platform_media_a11y_suppression_fixes') ? {
15
+ role: 'none'
16
+ } : {};
17
+ return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
17
18
  "data-testid": "media-viewer-svg-wrapper",
18
19
  onClick: onClick,
19
20
  ref: ref,
20
- "aria-label": intl.formatMessage(messages.svg_image_preview_label_assistive_text),
21
21
  className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
22
- }, children) : /*#__PURE__*/React.createElement("div", {
23
- "data-testid": "media-viewer-svg-wrapper",
24
- onClick: onClick,
25
- ref: ref,
26
- className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
27
- }, children);
22
+ }), children);
28
23
  });
@@ -1,5 +1,4 @@
1
1
 
2
- ._kkk2n7od{all:unset}
3
2
  ._11q75a80{background:linear-gradient(180deg,#101214,rgba(14,22,36,0)) no-repeat}
4
3
  ._151kfhey._151kfhey h1{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
5
4
  ._2rkofajl{border-radius:var(--ds-radius-small,3px)}
@@ -28,7 +27,6 @@
28
27
  ._1bto1l2s{text-overflow:ellipsis}
29
28
  ._1e0c1o8l{display:inline-block}
30
29
  ._1e0c1txw{display:flex}
31
- ._1e0c1ule{display:block}
32
30
  ._1ghp1kxc video{max-height:100vh}
33
31
  ._1itkdlpg{background-image:linear-gradient(0deg,#101214,rgba(14,22,36,0))}
34
32
  ._1jyy1poe._1jyy1poe h1{color:#c7d1db}
@@ -17,8 +17,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
17
17
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
18
18
  import { Box, xcss } from '@atlaskit/primitives';
19
19
  import Heading from '@atlaskit/heading';
20
- import { useIntl } from 'react-intl';
21
- import { messages } from '@atlaskit/media-ui';
22
20
  var blanketStyles = null;
23
21
  var headerWrapperStyles = null;
24
22
  var archiveHeaderWrapperStyles = null;
@@ -66,7 +64,6 @@ var downloadButtonWrapperStyles = null;
66
64
  var customVideoPlayerWrapperStyles = null;
67
65
  var sidebarWrapperStyles = null;
68
66
  var spinnerWrapperStyles = null;
69
- var resetButtonStyle = null;
70
67
  var formattedMessageWrapperStyles = null;
71
68
  // We are keeping this data-testid since JIRA is still using it in their codebase to perform checks. Before removing this, we need to ensure this 'media-viewer-popup' test id is not being used anywhere else in other codebases
72
69
  export var Blanket = function Blanket(_ref) {
@@ -239,33 +236,22 @@ export var LeftHeader = function LeftHeader(_ref18) {
239
236
  export var ImageWrapper = /*#__PURE__*/forwardRef(function (_ref19, ref) {
240
237
  var children = _ref19.children,
241
238
  datatestId = _ref19['data-testid'],
242
- _onClick = _ref19.onClick,
239
+ onClick = _ref19.onClick,
243
240
  style = _ref19.style,
244
241
  className = _ref19.className;
245
- var intl = useIntl();
246
- return fg('platform_media_a11y_suppression_fixes') ? /*#__PURE__*/React.createElement("button", {
242
+ var a11yProps = fg("platform_media_a11y_suppression_fixes") ? {
243
+ role: "none"
244
+ } : {};
245
+ return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
247
246
  "data-testid": datatestId,
248
- onClick: function onClick(event) {
249
- return _onClick && _onClick(event);
250
- },
251
- ref: ref,
252
- "aria-label": intl.formatMessage(messages.svg_image_preview_label_assistive_text)
253
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
254
- ,
255
- style: style
256
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
257
- ,
258
- className: ax(["_kkk2n7od _1e0c1ule", "_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
259
- }, children) : /*#__PURE__*/React.createElement("div", {
260
- "data-testid": datatestId,
261
- onClick: _onClick,
247
+ onClick: onClick,
262
248
  ref: ref,
263
249
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
264
250
  style: style
265
251
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
266
252
  ,
267
253
  className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", className])
268
- }, children);
254
+ }), children);
269
255
  });
270
256
  export var BaselineExtend = function BaselineExtend() {
271
257
  return /*#__PURE__*/React.createElement("div", {
@@ -1,9 +1,11 @@
1
1
 
2
+ ._kkk2n7od{all:unset}
2
3
  ._19itglyw{border:none}
3
4
  ._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}
4
5
  ._2rkofajl{border-radius:var(--ds-radius-small,3px)}
5
6
  ._v564rca0{transition:background-color .3s}
6
- ._v564t24z{transition:all 1s}._154iidpf{top:0}
7
+ ._v564t24z{transition:all 1s}
8
+ ._154iidpf{top:0}
7
9
  ._16jlkb7n{flex-grow:1}
8
10
  ._18m915vq{overflow-y:hidden}
9
11
  ._18m915zi{overflow-y:scroll}
@@ -17,6 +19,7 @@
17
19
  ._1bsb1osq{width:100%}
18
20
  ._1bto1l2s{text-overflow:ellipsis}
19
21
  ._1e0c1txw{display:flex}
22
+ ._1e0c1ule{display:block}
20
23
  ._1ltv15ov{left:var(--_53yrec)}
21
24
  ._1ltvidpf{left:0}
22
25
  ._1o51q7pw{animation-fill-mode:forwards}
@@ -53,7 +56,10 @@
53
56
  ._u5f31v6z{padding-right:7px}
54
57
  ._u5f3v47k{padding-right:var(--ds-space-250,20px)}
55
58
  ._vchhusvi{box-sizing:border-box}
56
- ._vwz41xde{line-height:1.14286}
59
+ ._vwz41xde{line-height:1.14286}._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
60
+ ._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
61
+ ._mizu1v1w:focus-visible{outline-color:var(--ds-border-focused,#4688ec)}
62
+ ._ra3xnqa1:focus-visible{outline-style:solid}
57
63
  ._d0altlke:hover{cursor:pointer}
58
64
  ._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
59
65
  ._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
@@ -13,6 +13,7 @@ var archiveItemViewerWrapperStyles = null;
13
13
  var archiveSideBarStyles = null;
14
14
  var slideDown = null;
15
15
  var archiveDownloadButtonWrapperStyles = null;
16
+ var archiveDownloadButtonWrapperStyleFix = null;
16
17
  var disabledArchiveDownloadButtonWrapperStyles = null;
17
18
  var archiveSidebarFolderWrapperStyles = null;
18
19
  var sidebarItemWrapperStyles = null;
@@ -58,7 +59,7 @@ export var ArchiveDownloadButtonWrapper = function ArchiveDownloadButtonWrapper(
58
59
  return _onClick && _onClick(event);
59
60
  },
60
61
  "data-testid": "media-archiveDownloadButton",
61
- className: ax(["_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
62
+ className: ax(["_kkk2n7od _1e0c1ule _1ah3v77o _128mdkaa _mizu1v1w _ra3xnqa1", "_19itglyw _2rkofajl _ca0qu2gc _u5f31v6z _n3td14y2 _19bvu2gc _bfhk1j28 _syaz1q3r _d0altlke _irr31dpa _1qamtlke _1di6fcek"])
62
63
  }, children) : /*#__PURE__*/React.createElement("div", {
63
64
  onClick: _onClick,
64
65
  "data-testid": "media-archiveDownloadButton",
@@ -13,6 +13,7 @@ import { FormattedMessage } from 'react-intl';
13
13
  import { messages } from '@atlaskit/media-ui';
14
14
  import deepEqual from 'deep-equal';
15
15
  import { globalMediaEventEmitter } from '@atlaskit/media-client';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import ErrorMessage from '../errorMessage';
17
18
  import { Spinner } from '../loading';
18
19
  import { ErrorViewDownloadButton } from '../download';
@@ -64,6 +65,9 @@ export var BaseViewer = /*#__PURE__*/function (_React$Component) {
64
65
  }, {
65
66
  key: "UNSAFE_componentWillReceiveProps",
66
67
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
68
+ if (fg('platform_media_package_react19_lifecycle_fix')) {
69
+ return;
70
+ }
67
71
  if (this.needsReset(nextProps, this.props)) {
68
72
  this.release();
69
73
  this.setState(this.initialState);
@@ -72,8 +76,16 @@ export var BaseViewer = /*#__PURE__*/function (_React$Component) {
72
76
  }, {
73
77
  key: "componentDidUpdate",
74
78
  value: function componentDidUpdate(prevProps) {
75
- if (this.needsReset(prevProps, this.props)) {
76
- this.init();
79
+ if (fg('platform_media_package_react19_lifecycle_fix')) {
80
+ if (this.needsReset(prevProps, this.props)) {
81
+ this.release();
82
+ this.setState(this.initialState);
83
+ this.init();
84
+ }
85
+ } else {
86
+ if (this.needsReset(prevProps, this.props)) {
87
+ this.init();
88
+ }
77
89
  }
78
90
  }
79
91
  }, {
@@ -1,9 +1,8 @@
1
1
  /* ImageWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import "./ImageWrapper-compiled.compiled.css";
3
4
  import { ax, ix } from "@compiled/react/runtime";
4
- import { messages } from '@atlaskit/media-ui';
5
5
  import React, { forwardRef } from 'react';
6
- import { useIntl } from 'react-intl';
7
6
  import { fg } from '@atlaskit/platform-feature-flags';
8
7
  var imageWrapperStyles = null;
9
8
  var dynamicImageWrapperStyles = null;
@@ -11,17 +10,13 @@ export var ImageWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
11
10
  var children = _ref.children,
12
11
  onClick = _ref.onClick,
13
12
  isHidden = _ref.isHidden;
14
- var intl = useIntl();
15
- return fg('platform_media_a11y_suppression_fixes') ? /*#__PURE__*/React.createElement("button", {
13
+ var a11yProps = fg('platform_media_a11y_suppression_fixes') ? {
14
+ role: 'none'
15
+ } : {};
16
+ return /*#__PURE__*/React.createElement("div", _extends({}, a11yProps, {
16
17
  "data-testid": "media-viewer-svg-wrapper",
17
18
  onClick: onClick,
18
19
  ref: ref,
19
- "aria-label": intl.formatMessage(messages.svg_image_preview_label_assistive_text),
20
20
  className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
21
- }, children) : /*#__PURE__*/React.createElement("div", {
22
- "data-testid": "media-viewer-svg-wrapper",
23
- onClick: onClick,
24
- ref: ref,
25
- className: ax(["_1reo1wug _18m91wug _1bsbauwl _4t3i1kxc _y3gn1h6o _s7n4nkob _o5721q9c", isHidden && "_1reo15vq _18m915vq"])
26
- }, children);
21
+ }), children);
27
22
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-viewer",
3
- "version": "53.0.0",
3
+ "version": "53.0.2",
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/"
@@ -37,9 +37,9 @@
37
37
  "@atlaskit/css": "^0.19.0",
38
38
  "@atlaskit/form": "^15.5.0",
39
39
  "@atlaskit/heading": "^5.4.0",
40
- "@atlaskit/icon": "^34.2.0",
40
+ "@atlaskit/icon": "^34.3.0",
41
41
  "@atlaskit/icon-file-type": "^7.0.0",
42
- "@atlaskit/icon-lab": "^6.5.0",
42
+ "@atlaskit/icon-lab": "^6.6.0",
43
43
  "@atlaskit/media-client": "^36.0.0",
44
44
  "@atlaskit/media-client-react": "^5.0.0",
45
45
  "@atlaskit/media-common": "^13.0.0",
@@ -52,9 +52,9 @@
52
52
  "@atlaskit/side-navigation": "^11.2.0",
53
53
  "@atlaskit/spinner": "^19.1.0",
54
54
  "@atlaskit/textfield": "^8.3.0",
55
- "@atlaskit/theme": "^23.1.0",
55
+ "@atlaskit/theme": "^23.2.0",
56
56
  "@atlaskit/tokens": "^13.0.0",
57
- "@atlaskit/tooltip": "^21.1.0",
57
+ "@atlaskit/tooltip": "^21.2.0",
58
58
  "@atlaskit/ufo": "^0.4.0",
59
59
  "@babel/runtime": "^7.0.0",
60
60
  "@codemirror/language": "6.10.8",
@@ -131,6 +131,9 @@
131
131
  "platform_media_react19_support": {
132
132
  "type": "boolean"
133
133
  },
134
+ "platform_media_package_react19_lifecycle_fix": {
135
+ "type": "boolean"
136
+ },
134
137
  "platform_media_a11y_suppression_fixes": {
135
138
  "type": "boolean"
136
139
  }