@atlaskit/media-file-preview 0.5.0 → 0.5.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,59 +1,93 @@
1
1
  # @atlaskit/media-file-preview
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.5.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
14
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
15
+ Upgrade Typescript from `4.9.5` to `5.4.2`
16
+
3
17
  ## 0.5.0
4
18
 
5
19
  ### Minor Changes
6
20
 
7
- - [#73279](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73279) [`cdad00f21119`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cdad00f21119) - Create useMediaImage hook
21
+ - [#73279](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73279)
22
+ [`cdad00f21119`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cdad00f21119) -
23
+ Create useMediaImage hook
8
24
 
9
25
  ## 0.4.2
10
26
 
11
27
  ### Patch Changes
12
28
 
13
- - [#71793](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71793) [`26115be71855`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/26115be71855) - Added support for Error File State
29
+ - [#71793](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71793)
30
+ [`26115be71855`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/26115be71855) -
31
+ Added support for Error File State
14
32
 
15
33
  ## 0.4.1
16
34
 
17
35
  ### Patch Changes
18
36
 
19
- - [#71409](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71409) [`5c76dfba92dd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c76dfba92dd) - Pass trace context to global scope error
37
+ - [#71409](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71409)
38
+ [`5c76dfba92dd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c76dfba92dd) -
39
+ Pass trace context to global scope error
20
40
 
21
41
  ## 0.4.0
22
42
 
23
43
  ### Minor Changes
24
44
 
25
- - [#70446](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70446) [`48eae199c6fa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/48eae199c6fa) - Breaking: return ref object ssrReliabilityRef is replaced by object ssrReliability
45
+ - [#70446](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70446)
46
+ [`48eae199c6fa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/48eae199c6fa) -
47
+ Breaking: return ref object ssrReliabilityRef is replaced by object ssrReliability
26
48
 
27
49
  ### Patch Changes
28
50
 
29
- - [#70446](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70446) [`0ff07ca94009`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0ff07ca94009) - Better support for onImageError callback
51
+ - [#70446](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70446)
52
+ [`0ff07ca94009`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0ff07ca94009) -
53
+ Better support for onImageError callback
30
54
 
31
55
  ## 0.3.1
32
56
 
33
57
  ### Patch Changes
34
58
 
35
- - [#70361](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70361) [`6bcee8c57dac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6bcee8c57dac) - Support for files failed to process
59
+ - [#70361](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70361)
60
+ [`6bcee8c57dac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6bcee8c57dac) -
61
+ Support for files failed to process
36
62
 
37
63
  ## 0.3.0
38
64
 
39
65
  ### Minor Changes
40
66
 
41
- - [#70034](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70034) [`0cf829b2ca1f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0cf829b2ca1f) - Breaking: renamed return value from getScriptProps to getSsrScriptProps
67
+ - [#70034](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70034)
68
+ [`0cf829b2ca1f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0cf829b2ca1f) -
69
+ Breaking: renamed return value from getScriptProps to getSsrScriptProps
42
70
 
43
71
  ## 0.2.1
44
72
 
45
73
  ### Patch Changes
46
74
 
47
- - [#69372](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69372) [`d719e8e81e2c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d719e8e81e2c) - Fixed status for processed files with no preview
75
+ - [#69372](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69372)
76
+ [`d719e8e81e2c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d719e8e81e2c) -
77
+ Fixed status for processed files with no preview
48
78
 
49
79
  ## 0.2.0
50
80
 
51
81
  ### Minor Changes
52
82
 
53
- - [#65817](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65817) [`de45ff7a33a9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/de45ff7a33a9) - Breaking: removed previewDidRender property
83
+ - [#65817](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65817)
84
+ [`de45ff7a33a9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/de45ff7a33a9) -
85
+ Breaking: removed previewDidRender property
54
86
 
55
87
  ## 0.1.0
56
88
 
57
89
  ### Minor Changes
58
90
 
59
- - [#65749](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65749) [`cf9674e67f0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cf9674e67f0c) - Breaking: updated prop types
91
+ - [#65749](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65749)
92
+ [`cf9674e67f0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cf9674e67f0c) -
93
+ Breaking: updated prop types
@@ -19,7 +19,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
19
19
  var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
20
20
  var _mediaClientReact = require("@atlaskit/media-client-react");
21
21
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
22
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
23
  /**
24
24
  * Primary reason is logged through Data Portal.
25
25
  * Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
@@ -14,7 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
14
14
  var _eventemitter = require("eventemitter2");
15
15
  var _lru_map = require("lru_map");
16
16
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
17
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
18
  var PREVIEW_CACHE_LRU_SIZE = exports.PREVIEW_CACHE_LRU_SIZE = 50;
19
19
  var ExtendedLRUCache = /*#__PURE__*/function (_LRUMap) {
20
20
  (0, _inherits2.default)(ExtendedLRUCache, _LRUMap);
package/dist/cjs/types.js CHANGED
@@ -1,5 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ "use strict";
@@ -3,6 +3,7 @@ import { createObjectURLCache } from './objectURLCache';
3
3
 
4
4
  // Dimensions are used to create a key.
5
5
  // Cache is invalidated when different dimensions are provided.
6
+
6
7
  export const getCacheKey = (id, mode) => {
7
8
  const resizeMode = mode || 'crop';
8
9
  return [id, resizeMode].join('-');
@@ -4,6 +4,7 @@ import { printFunctionCall, printScript } from './printScript';
4
4
  // Any changes to this file must be tested directly in product before merging.
5
5
  // The scripts printed here might differ from what we observe in our internal tests
6
6
  // due to minimification, for example.
7
+
7
8
  export const GLOBAL_MEDIA_CARD_SSR = 'mediaCardSsr';
8
9
  export const GLOBAL_MEDIA_NAMESPACE = '__MEDIA_INTERNAL';
9
10
  export function getMediaGlobalScope(globalScope = window) {
@@ -1 +0,0 @@
1
- export {};
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
8
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
10
  import { MediaFileStateError } from '@atlaskit/media-client-react';
11
11
 
12
12
  /**
@@ -5,6 +5,7 @@ import { createObjectURLCache } from './objectURLCache';
5
5
 
6
6
  // Dimensions are used to create a key.
7
7
  // Cache is invalidated when different dimensions are provided.
8
+
8
9
  export var getCacheKey = function getCacheKey(id, mode) {
9
10
  var resizeMode = mode || 'crop';
10
11
  return [id, resizeMode].join('-');
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  import { EventEmitter2 } from 'eventemitter2';
10
10
  import { LRUMap } from 'lru_map';
11
11
  export var PREVIEW_CACHE_LRU_SIZE = 50;
@@ -4,6 +4,7 @@ import { printFunctionCall, printScript } from './printScript';
4
4
  // Any changes to this file must be tested directly in product before merging.
5
5
  // The scripts printed here might differ from what we observe in our internal tests
6
6
  // due to minimification, for example.
7
+
7
8
  export var GLOBAL_MEDIA_CARD_SSR = 'mediaCardSsr';
8
9
  export var GLOBAL_MEDIA_NAMESPACE = '__MEDIA_INTERNAL';
9
10
  export function getMediaGlobalScope() {
package/dist/esm/types.js CHANGED
@@ -1 +0,0 @@
1
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-file-preview",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "A React Hook to fetch and render file previews. It's overloaded with fancy features like SSR, lazy loading, memory cache and local preview.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,10 +35,10 @@
35
35
  ".": "./src/index.ts"
36
36
  },
37
37
  "dependencies": {
38
- "@atlaskit/media-client": "^26.2.0",
38
+ "@atlaskit/media-client": "^27.0.0",
39
39
  "@atlaskit/media-client-react": "^2.0.1",
40
- "@atlaskit/media-common": "^11.0.0",
41
- "@atlaskit/media-ui": "^25.1.0",
40
+ "@atlaskit/media-common": "^11.2.0",
41
+ "@atlaskit/media-ui": "^25.10.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "eventemitter2": "^4.1.0",
44
44
  "lru_map": "^0.4.1"
@@ -50,15 +50,15 @@
50
50
  "@af/integration-testing": "*",
51
51
  "@af/visual-regression": "*",
52
52
  "@atlaskit/media-state": "^1.0.3",
53
- "@atlaskit/media-test-data": "^1.2.0",
54
- "@atlaskit/section-message": "^6.4.17",
53
+ "@atlaskit/media-test-data": "^2.1.0",
54
+ "@atlaskit/section-message": "^6.5.0",
55
55
  "@atlaskit/ssr": "*",
56
56
  "@atlaskit/visual-regression": "*",
57
57
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
58
58
  "@testing-library/react": "^12.1.5",
59
59
  "@testing-library/react-hooks": "^8.0.1",
60
60
  "react-dom": "^16.8.0",
61
- "typescript": "~4.9.5",
61
+ "typescript": "~5.4.2",
62
62
  "wait-for-expect": "^1.2.0"
63
63
  },
64
64
  "techstack": {
@@ -97,4 +97,4 @@
97
97
  }
98
98
  },
99
99
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
100
- }
100
+ }