@atlaskit/media-client 26.1.1 → 26.1.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,11 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 26.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#71336](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71336) [`9abd05a91e25`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9abd05a91e25) - Fixed image load performance issue where setting max age in getFileImageURL params to undefined would override the default
|
|
8
|
+
|
|
3
9
|
## 26.1.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -20,14 +20,14 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
20
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
21
|
var MEDIA_API_REGION = 'media-api-region';
|
|
22
22
|
var MEDIA_API_ENVIRONMENT = 'media-api-environment';
|
|
23
|
-
var defaultImageOptions = {
|
|
24
|
-
'max-age': _constants.FILE_CACHE_MAX_AGE,
|
|
25
|
-
allowAnimated: true,
|
|
26
|
-
mode: 'crop'
|
|
27
|
-
};
|
|
28
23
|
var extendImageParams = function extendImageParams(params) {
|
|
24
|
+
var _params$maxAge, _params$allowAnimated, _params$mode;
|
|
29
25
|
var fetchMaxRes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
30
|
-
return _objectSpread(_objectSpread(
|
|
26
|
+
return _objectSpread(_objectSpread({}, params), {}, {
|
|
27
|
+
'max-age': (_params$maxAge = params === null || params === void 0 ? void 0 : params['max-age']) !== null && _params$maxAge !== void 0 ? _params$maxAge : _constants.FILE_CACHE_MAX_AGE,
|
|
28
|
+
allowAnimated: (_params$allowAnimated = params === null || params === void 0 ? void 0 : params.allowAnimated) !== null && _params$allowAnimated !== void 0 ? _params$allowAnimated : true,
|
|
29
|
+
mode: (_params$mode = params === null || params === void 0 ? void 0 : params.mode) !== null && _params$mode !== void 0 ? _params$mode : 'crop'
|
|
30
|
+
}, fetchMaxRes ? {
|
|
31
31
|
width: _constants.MAX_RESOLUTION,
|
|
32
32
|
height: _constants.MAX_RESOLUTION
|
|
33
33
|
} : {});
|
|
@@ -7,15 +7,13 @@ import { createUrl, createMapResponseToJson, createMapResponseToBlob } from '../
|
|
|
7
7
|
import { resolveAuth, resolveInitialAuth } from './resolveAuth';
|
|
8
8
|
const MEDIA_API_REGION = 'media-api-region';
|
|
9
9
|
const MEDIA_API_ENVIRONMENT = 'media-api-environment';
|
|
10
|
-
const defaultImageOptions = {
|
|
11
|
-
'max-age': FILE_CACHE_MAX_AGE,
|
|
12
|
-
allowAnimated: true,
|
|
13
|
-
mode: 'crop'
|
|
14
|
-
};
|
|
15
10
|
const extendImageParams = (params, fetchMaxRes = false) => {
|
|
11
|
+
var _params$maxAge, _params$allowAnimated, _params$mode;
|
|
16
12
|
return {
|
|
17
|
-
...defaultImageOptions,
|
|
18
13
|
...params,
|
|
14
|
+
'max-age': (_params$maxAge = params === null || params === void 0 ? void 0 : params['max-age']) !== null && _params$maxAge !== void 0 ? _params$maxAge : FILE_CACHE_MAX_AGE,
|
|
15
|
+
allowAnimated: (_params$allowAnimated = params === null || params === void 0 ? void 0 : params.allowAnimated) !== null && _params$allowAnimated !== void 0 ? _params$allowAnimated : true,
|
|
16
|
+
mode: (_params$mode = params === null || params === void 0 ? void 0 : params.mode) !== null && _params$mode !== void 0 ? _params$mode : 'crop',
|
|
19
17
|
...(fetchMaxRes ? {
|
|
20
18
|
width: MAX_RESOLUTION,
|
|
21
19
|
height: MAX_RESOLUTION
|
|
@@ -13,14 +13,14 @@ import { createUrl, createMapResponseToJson, createMapResponseToBlob } from '../
|
|
|
13
13
|
import { resolveAuth, resolveInitialAuth } from './resolveAuth';
|
|
14
14
|
var MEDIA_API_REGION = 'media-api-region';
|
|
15
15
|
var MEDIA_API_ENVIRONMENT = 'media-api-environment';
|
|
16
|
-
var defaultImageOptions = {
|
|
17
|
-
'max-age': FILE_CACHE_MAX_AGE,
|
|
18
|
-
allowAnimated: true,
|
|
19
|
-
mode: 'crop'
|
|
20
|
-
};
|
|
21
16
|
var extendImageParams = function extendImageParams(params) {
|
|
17
|
+
var _params$maxAge, _params$allowAnimated, _params$mode;
|
|
22
18
|
var fetchMaxRes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
23
|
-
return _objectSpread(_objectSpread(
|
|
19
|
+
return _objectSpread(_objectSpread({}, params), {}, {
|
|
20
|
+
'max-age': (_params$maxAge = params === null || params === void 0 ? void 0 : params['max-age']) !== null && _params$maxAge !== void 0 ? _params$maxAge : FILE_CACHE_MAX_AGE,
|
|
21
|
+
allowAnimated: (_params$allowAnimated = params === null || params === void 0 ? void 0 : params.allowAnimated) !== null && _params$allowAnimated !== void 0 ? _params$allowAnimated : true,
|
|
22
|
+
mode: (_params$mode = params === null || params === void 0 ? void 0 : params.mode) !== null && _params$mode !== void 0 ? _params$mode : 'crop'
|
|
23
|
+
}, fetchMaxRes ? {
|
|
24
24
|
width: MAX_RESOLUTION,
|
|
25
25
|
height: MAX_RESOLUTION
|
|
26
26
|
} : {});
|