@atlaskit/media-viewer 53.0.0 → 53.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 53.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e3d1ec1074c7e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3d1ec1074c7e) -
|
|
8
|
+
Removing UNSAFE_componentWillReceiveProps from media-picker, media-avatar-picker and media-viewer
|
|
9
|
+
package to support React19 migration
|
|
10
|
+
|
|
3
11
|
## 53.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
|
@@ -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 (
|
|
85
|
-
this.
|
|
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
|
}, {
|
|
@@ -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 (
|
|
55
|
-
this.
|
|
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() {
|
|
@@ -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 (
|
|
76
|
-
this.
|
|
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
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "53.0.
|
|
3
|
+
"version": "53.0.1",
|
|
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/"
|
|
@@ -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
|
}
|