@atlaskit/media-card 77.6.5 → 77.6.6
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 +6 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/fileCard.js +2 -2
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/fileCard.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/fileCard.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/v2/cardViewV2.d.ts +1 -1
- package/dist/types/card/v2/cardviews/cardViewWrapper.d.ts +1 -1
- package/dist/types/card/v2/cardviews/index.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/cardviews/cardViewWrapper.d.ts +1 -1
- package/dist/types-ts4.5/card/v2/cardviews/index.d.ts +1 -1
- package/package.json +4 -3
- package/dist/cjs/card/v2/useFilePreview/analytics.js +0 -50
- package/dist/cjs/card/v2/useFilePreview/errors.js +0 -143
- package/dist/cjs/card/v2/useFilePreview/getPreview/cache.js +0 -39
- package/dist/cjs/card/v2/useFilePreview/getPreview/getPreview.js +0 -119
- package/dist/cjs/card/v2/useFilePreview/getPreview/helpers.js +0 -167
- package/dist/cjs/card/v2/useFilePreview/getPreview/index.js +0 -56
- package/dist/cjs/card/v2/useFilePreview/getPreview/objectURLCache.js +0 -85
- package/dist/cjs/card/v2/useFilePreview/getPreview/videoSnapshot.js +0 -58
- package/dist/cjs/card/v2/useFilePreview/globalScope/getSSRData.js +0 -14
- package/dist/cjs/card/v2/useFilePreview/globalScope/globalScope.js +0 -66
- package/dist/cjs/card/v2/useFilePreview/globalScope/index.js +0 -37
- package/dist/cjs/card/v2/useFilePreview/globalScope/printScript.js +0 -32
- package/dist/cjs/card/v2/useFilePreview/globalScope/types.js +0 -5
- package/dist/cjs/card/v2/useFilePreview/helpers.js +0 -56
- package/dist/cjs/card/v2/useFilePreview/index.js +0 -12
- package/dist/cjs/card/v2/useFilePreview/types.js +0 -5
- package/dist/cjs/card/v2/useFilePreview/useFilePreview.js +0 -355
- package/dist/es2019/card/v2/useFilePreview/analytics.js +0 -44
- package/dist/es2019/card/v2/useFilePreview/errors.js +0 -90
- package/dist/es2019/card/v2/useFilePreview/getPreview/cache.js +0 -30
- package/dist/es2019/card/v2/useFilePreview/getPreview/getPreview.js +0 -75
- package/dist/es2019/card/v2/useFilePreview/getPreview/helpers.js +0 -76
- package/dist/es2019/card/v2/useFilePreview/getPreview/index.js +0 -3
- package/dist/es2019/card/v2/useFilePreview/getPreview/objectURLCache.js +0 -44
- package/dist/es2019/card/v2/useFilePreview/getPreview/videoSnapshot.js +0 -36
- package/dist/es2019/card/v2/useFilePreview/globalScope/getSSRData.js +0 -8
- package/dist/es2019/card/v2/useFilePreview/globalScope/globalScope.js +0 -48
- package/dist/es2019/card/v2/useFilePreview/globalScope/index.js +0 -2
- package/dist/es2019/card/v2/useFilePreview/globalScope/printScript.js +0 -16
- package/dist/es2019/card/v2/useFilePreview/globalScope/types.js +0 -1
- package/dist/es2019/card/v2/useFilePreview/helpers.js +0 -54
- package/dist/es2019/card/v2/useFilePreview/index.js +0 -1
- package/dist/es2019/card/v2/useFilePreview/types.js +0 -1
- package/dist/es2019/card/v2/useFilePreview/useFilePreview.js +0 -333
- package/dist/esm/card/v2/useFilePreview/analytics.js +0 -44
- package/dist/esm/card/v2/useFilePreview/errors.js +0 -133
- package/dist/esm/card/v2/useFilePreview/getPreview/cache.js +0 -32
- package/dist/esm/card/v2/useFilePreview/getPreview/getPreview.js +0 -112
- package/dist/esm/card/v2/useFilePreview/getPreview/helpers.js +0 -160
- package/dist/esm/card/v2/useFilePreview/getPreview/index.js +0 -3
- package/dist/esm/card/v2/useFilePreview/getPreview/objectURLCache.js +0 -78
- package/dist/esm/card/v2/useFilePreview/getPreview/videoSnapshot.js +0 -51
- package/dist/esm/card/v2/useFilePreview/globalScope/getSSRData.js +0 -8
- package/dist/esm/card/v2/useFilePreview/globalScope/globalScope.js +0 -56
- package/dist/esm/card/v2/useFilePreview/globalScope/index.js +0 -2
- package/dist/esm/card/v2/useFilePreview/globalScope/printScript.js +0 -25
- package/dist/esm/card/v2/useFilePreview/globalScope/types.js +0 -1
- package/dist/esm/card/v2/useFilePreview/helpers.js +0 -50
- package/dist/esm/card/v2/useFilePreview/index.js +0 -1
- package/dist/esm/card/v2/useFilePreview/types.js +0 -1
- package/dist/esm/card/v2/useFilePreview/useFilePreview.js +0 -348
- package/dist/types/card/v2/useFilePreview/analytics.d.ts +0 -28
- package/dist/types/card/v2/useFilePreview/errors.d.ts +0 -42
- package/dist/types/card/v2/useFilePreview/getPreview/cache.d.ts +0 -21
- package/dist/types/card/v2/useFilePreview/getPreview/getPreview.d.ts +0 -9
- package/dist/types/card/v2/useFilePreview/getPreview/helpers.d.ts +0 -10
- package/dist/types/card/v2/useFilePreview/getPreview/index.d.ts +0 -3
- package/dist/types/card/v2/useFilePreview/getPreview/objectURLCache.d.ts +0 -12
- package/dist/types/card/v2/useFilePreview/getPreview/videoSnapshot.d.ts +0 -1
- package/dist/types/card/v2/useFilePreview/globalScope/getSSRData.d.ts +0 -3
- package/dist/types/card/v2/useFilePreview/globalScope/globalScope.d.ts +0 -15
- package/dist/types/card/v2/useFilePreview/globalScope/index.d.ts +0 -4
- package/dist/types/card/v2/useFilePreview/globalScope/printScript.d.ts +0 -2
- package/dist/types/card/v2/useFilePreview/globalScope/types.d.ts +0 -8
- package/dist/types/card/v2/useFilePreview/helpers.d.ts +0 -10
- package/dist/types/card/v2/useFilePreview/index.d.ts +0 -2
- package/dist/types/card/v2/useFilePreview/types.d.ts +0 -12
- package/dist/types/card/v2/useFilePreview/useFilePreview.d.ts +0 -33
- package/dist/types-ts4.5/card/v2/useFilePreview/analytics.d.ts +0 -28
- package/dist/types-ts4.5/card/v2/useFilePreview/errors.d.ts +0 -42
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/cache.d.ts +0 -21
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/getPreview.d.ts +0 -9
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/helpers.d.ts +0 -10
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/index.d.ts +0 -3
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/objectURLCache.d.ts +0 -12
- package/dist/types-ts4.5/card/v2/useFilePreview/getPreview/videoSnapshot.d.ts +0 -1
- package/dist/types-ts4.5/card/v2/useFilePreview/globalScope/getSSRData.d.ts +0 -3
- package/dist/types-ts4.5/card/v2/useFilePreview/globalScope/globalScope.d.ts +0 -15
- package/dist/types-ts4.5/card/v2/useFilePreview/globalScope/index.d.ts +0 -4
- package/dist/types-ts4.5/card/v2/useFilePreview/globalScope/printScript.d.ts +0 -2
- package/dist/types-ts4.5/card/v2/useFilePreview/globalScope/types.d.ts +0 -8
- package/dist/types-ts4.5/card/v2/useFilePreview/helpers.d.ts +0 -10
- package/dist/types-ts4.5/card/v2/useFilePreview/index.d.ts +0 -2
- package/dist/types-ts4.5/card/v2/useFilePreview/types.d.ts +0 -12
- package/dist/types-ts4.5/card/v2/useFilePreview/useFilePreview.d.ts +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.6.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#62664](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62664) [`d9ad2c26fedf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d9ad2c26fedf) - Media Card uses preview hook from public package
|
|
8
|
+
|
|
3
9
|
## 77.6.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -49,7 +49,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
49
49
|
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); }; }
|
|
50
50
|
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; } }
|
|
51
51
|
var packageName = "@atlaskit/media-card";
|
|
52
|
-
var packageVersion = "77.6.
|
|
52
|
+
var packageVersion = "77.6.6";
|
|
53
53
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
54
54
|
(0, _inherits2.default)(CardBase, _Component);
|
|
55
55
|
var _super = _createSuper(CardBase);
|
|
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
90
90
|
}(_react.default.Component);
|
|
91
91
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
92
92
|
var packageName = "@atlaskit/media-card";
|
|
93
|
-
var packageVersion = "77.6.
|
|
93
|
+
var packageVersion = "77.6.6";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -16,7 +16,7 @@ var _externalImageCard = require("./externalImageCard");
|
|
|
16
16
|
var _fileCard = require("./fileCard");
|
|
17
17
|
var _excluded = ["identifier"];
|
|
18
18
|
var packageName = "@atlaskit/media-card";
|
|
19
|
-
var packageVersion = "77.6.
|
|
19
|
+
var packageVersion = "77.6.6";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -34,7 +34,7 @@ var _getCardPreview = require("../getCardPreview");
|
|
|
34
34
|
var _cardViewV = require("./cardViewV2");
|
|
35
35
|
var _cardviews = require("./cardviews");
|
|
36
36
|
var _inlinePlayerLazyV = require("./inlinePlayerLazyV2");
|
|
37
|
-
var
|
|
37
|
+
var _mediaFilePreview = require("@atlaskit/media-file-preview");
|
|
38
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
39
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
40
40
|
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; }
|
|
@@ -176,7 +176,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
176
176
|
alt: alt
|
|
177
177
|
}) : undefined;
|
|
178
178
|
}, [alt, previewDimensions, contextId, fileStateValue, identifier, originalDimensions]);
|
|
179
|
-
var _useFilePreview = (0,
|
|
179
|
+
var _useFilePreview = (0, _mediaFilePreview.useFilePreview)({
|
|
180
180
|
mediaBlobUrlAttrs: mediaBlobUrlAttrs,
|
|
181
181
|
resizeMode: resizeMode,
|
|
182
182
|
identifier: identifier,
|
|
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
119
119
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
120
120
|
var analyticsContext = {
|
|
121
121
|
packageVersion: "@atlaskit/media-card",
|
|
122
|
-
packageName: "77.6.
|
|
122
|
+
packageName: "77.6.6",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "77.6.
|
|
17
|
+
var packageVersion = "77.6.6";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -27,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
27
27
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "77.6.
|
|
30
|
+
const packageVersion = "77.6.6";
|
|
31
31
|
export class CardBase extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "77.6.
|
|
69
|
+
const packageVersion = "77.6.6";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -7,7 +7,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
7
7
|
import { ExternalImageCard } from './externalImageCard';
|
|
8
8
|
import { FileCard } from './fileCard';
|
|
9
9
|
const packageName = "@atlaskit/media-card";
|
|
10
|
-
const packageVersion = "77.6.
|
|
10
|
+
const packageVersion = "77.6.6";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
@@ -23,7 +23,7 @@ import { isSSRPreview } from '../getCardPreview';
|
|
|
23
23
|
import { CardViewV2 } from './cardViewV2';
|
|
24
24
|
import { CardViews } from './cardviews';
|
|
25
25
|
import { InlinePlayerLazyV2 } from './inlinePlayerLazyV2';
|
|
26
|
-
import { useFilePreview } from '
|
|
26
|
+
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
27
27
|
const LoadedCardView = getBooleanFF('platform.media-experience.card-views-refactor_b91lr') ? CardViews : CardViewV2;
|
|
28
28
|
export const FileCard = ({
|
|
29
29
|
appearance = 'auto',
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "77.6.
|
|
40
|
+
packageName: "77.6.6",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "77.6.
|
|
7
|
+
const packageVersion = "77.6.6";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -40,7 +40,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
40
40
|
import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "77.6.
|
|
43
|
+
var packageVersion = "77.6.6";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "77.6.
|
|
86
|
+
var packageVersion = "77.6.6";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.6.
|
|
12
|
+
var packageVersion = "77.6.6";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -28,7 +28,7 @@ import { isSSRPreview } from '../getCardPreview';
|
|
|
28
28
|
import { CardViewV2 } from './cardViewV2';
|
|
29
29
|
import { CardViews } from './cardviews';
|
|
30
30
|
import { InlinePlayerLazyV2 } from './inlinePlayerLazyV2';
|
|
31
|
-
import { useFilePreview } from '
|
|
31
|
+
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
32
32
|
var LoadedCardView = getBooleanFF('platform.media-experience.card-views-refactor_b91lr') ? CardViews : CardViewV2;
|
|
33
33
|
export var FileCard = function FileCard(_ref) {
|
|
34
34
|
var _ref$appearance = _ref.appearance,
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.6.
|
|
106
|
+
packageName: "77.6.6",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.6.
|
|
10
|
+
var packageVersion = "77.6.6";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
|
@@ -5,7 +5,7 @@ import { MessageDescriptor } from 'react-intl-next';
|
|
|
5
5
|
import { MediaItemType, FileDetails, ImageResizeMode } from '@atlaskit/media-client';
|
|
6
6
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
7
|
import { CardStatus, MediaCardCursor, CardDimensions, TitleBoxIcon } from '../../types';
|
|
8
|
-
import { MediaFilePreview } from '
|
|
8
|
+
import { MediaFilePreview } from '@atlaskit/media-file-preview';
|
|
9
9
|
import { CardAction } from '../actions';
|
|
10
10
|
import { MediaCardError } from '../../errors';
|
|
11
11
|
export interface CardViewV2Props {
|
|
@@ -4,7 +4,7 @@ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
4
4
|
import { CardAppearance, CardDimensions, MediaCardCursor, TitleBoxIcon } from '../../../types';
|
|
5
5
|
import { CardAction } from '../../actions';
|
|
6
6
|
import { Breakpoint } from '../../ui/common';
|
|
7
|
-
import { MediaFilePreview } from '
|
|
7
|
+
import { MediaFilePreview } from '@atlaskit/media-file-preview';
|
|
8
8
|
export type SharedCardViewProps = {
|
|
9
9
|
readonly cardPreview?: MediaFilePreview;
|
|
10
10
|
readonly testId?: string;
|
|
@@ -6,7 +6,7 @@ import { MediaItemType, FileDetails } from '@atlaskit/media-client';
|
|
|
6
6
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
7
|
import { SharedCardProps, CardStatus, MediaCardCursor } from '../../../types';
|
|
8
8
|
import { MediaCardError } from '../../../errors';
|
|
9
|
-
import { MediaFilePreview } from '
|
|
9
|
+
import { MediaFilePreview } from '@atlaskit/media-file-preview';
|
|
10
10
|
export interface CardViewsOwnProps extends SharedCardProps {
|
|
11
11
|
readonly status: CardStatus;
|
|
12
12
|
readonly mediaItemType: MediaItemType;
|
|
@@ -5,7 +5,7 @@ import { MessageDescriptor } from 'react-intl-next';
|
|
|
5
5
|
import { MediaItemType, FileDetails, ImageResizeMode } from '@atlaskit/media-client';
|
|
6
6
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
7
|
import { CardStatus, MediaCardCursor, CardDimensions, TitleBoxIcon } from '../../types';
|
|
8
|
-
import { MediaFilePreview } from '
|
|
8
|
+
import { MediaFilePreview } from '@atlaskit/media-file-preview';
|
|
9
9
|
import { CardAction } from '../actions';
|
|
10
10
|
import { MediaCardError } from '../../errors';
|
|
11
11
|
export interface CardViewV2Props {
|
|
@@ -4,7 +4,7 @@ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
4
4
|
import { CardAppearance, CardDimensions, MediaCardCursor, TitleBoxIcon } from '../../../types';
|
|
5
5
|
import { CardAction } from '../../actions';
|
|
6
6
|
import { Breakpoint } from '../../ui/common';
|
|
7
|
-
import { MediaFilePreview } from '
|
|
7
|
+
import { MediaFilePreview } from '@atlaskit/media-file-preview';
|
|
8
8
|
export type SharedCardViewProps = {
|
|
9
9
|
readonly cardPreview?: MediaFilePreview;
|
|
10
10
|
readonly testId?: string;
|
|
@@ -6,7 +6,7 @@ import { MediaItemType, FileDetails } from '@atlaskit/media-client';
|
|
|
6
6
|
import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
7
|
import { SharedCardProps, CardStatus, MediaCardCursor } from '../../../types';
|
|
8
8
|
import { MediaCardError } from '../../../errors';
|
|
9
|
-
import { MediaFilePreview } from '
|
|
9
|
+
import { MediaFilePreview } from '@atlaskit/media-file-preview';
|
|
10
10
|
export interface CardViewsOwnProps extends SharedCardProps {
|
|
11
11
|
readonly status: CardStatus;
|
|
12
12
|
readonly mediaItemType: MediaItemType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.6.
|
|
3
|
+
"version": "77.6.6",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,13 +43,14 @@
|
|
|
43
43
|
"@atlaskit/media-client": "^26.1.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.0.0",
|
|
46
|
+
"@atlaskit/media-file-preview": "^0.0.1",
|
|
46
47
|
"@atlaskit/media-ui": "^25.0.0",
|
|
47
48
|
"@atlaskit/media-viewer": "^48.2.0",
|
|
48
49
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
49
50
|
"@atlaskit/spinner": "^16.0.0",
|
|
50
51
|
"@atlaskit/theme": "^12.6.0",
|
|
51
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
-
"@atlaskit/tooltip": "^18.
|
|
52
|
+
"@atlaskit/tokens": "^1.31.0",
|
|
53
|
+
"@atlaskit/tooltip": "^18.1.0",
|
|
53
54
|
"@atlaskit/ufo": "^0.2.0",
|
|
54
55
|
"@babel/runtime": "^7.0.0",
|
|
55
56
|
"classnames": "^2.2.5",
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getRenderErrorFailReason = exports.getRenderErrorErrorReason = exports.getRenderErrorErrorDetail = exports.getErrorTraceContext = exports.extractErrorInfo = void 0;
|
|
7
|
-
var _mediaClient = require("@atlaskit/media-client");
|
|
8
|
-
var _errors = require("./errors");
|
|
9
|
-
var getErrorTraceContext = exports.getErrorTraceContext = function getErrorTraceContext(error) {
|
|
10
|
-
if ((0, _errors.isMediaFilePreviewError)(error) && !!error.secondaryError) {
|
|
11
|
-
if ((0, _mediaClient.isRequestError)(error.secondaryError)) {
|
|
12
|
-
var _error$secondaryError;
|
|
13
|
-
return (_error$secondaryError = error.secondaryError.metadata) === null || _error$secondaryError === void 0 ? void 0 : _error$secondaryError.traceContext;
|
|
14
|
-
} else if ((0, _errors.isMediaFileStateError)(error.secondaryError)) {
|
|
15
|
-
var _error$secondaryError2;
|
|
16
|
-
return (_error$secondaryError2 = error.secondaryError.details) === null || _error$secondaryError2 === void 0 || (_error$secondaryError2 = _error$secondaryError2.metadata) === null || _error$secondaryError2 === void 0 ? void 0 : _error$secondaryError2.traceContext;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var getRenderErrorFailReason = exports.getRenderErrorFailReason = function getRenderErrorFailReason(error) {
|
|
21
|
-
if ((0, _errors.isMediaFilePreviewError)(error)) {
|
|
22
|
-
return error.primaryReason;
|
|
23
|
-
} else {
|
|
24
|
-
return 'nativeError';
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var getRenderErrorErrorReason = exports.getRenderErrorErrorReason = function getRenderErrorErrorReason(error) {
|
|
28
|
-
if ((0, _errors.isMediaFilePreviewError)(error) && error.secondaryError) {
|
|
29
|
-
var mediaClientReason = (0, _errors.isMediaFileStateError)(error.secondaryError) ? (0, _errors.getFileStateErrorReason)(error.secondaryError) : (0, _mediaClient.getMediaClientErrorReason)(error.secondaryError);
|
|
30
|
-
if (mediaClientReason !== 'unknown') {
|
|
31
|
-
return mediaClientReason;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return 'nativeError';
|
|
35
|
-
};
|
|
36
|
-
var getRenderErrorErrorDetail = exports.getRenderErrorErrorDetail = function getRenderErrorErrorDetail(error) {
|
|
37
|
-
if ((0, _errors.isMediaFilePreviewError)(error) && error.secondaryError) {
|
|
38
|
-
return error.secondaryError.message;
|
|
39
|
-
} else {
|
|
40
|
-
return error.message;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var extractErrorInfo = exports.extractErrorInfo = function extractErrorInfo(error, metadataTraceContext) {
|
|
44
|
-
return {
|
|
45
|
-
failReason: getRenderErrorFailReason(error),
|
|
46
|
-
error: getRenderErrorErrorReason(error),
|
|
47
|
-
errorDetail: getRenderErrorErrorDetail(error),
|
|
48
|
-
metadataTraceContext: metadataTraceContext !== null && metadataTraceContext !== void 0 ? metadataTraceContext : getErrorTraceContext(error)
|
|
49
|
-
};
|
|
50
|
-
};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ensureMediaFilePreviewError = exports.SsrPreviewError = exports.RemotePreviewError = exports.MediaFilePreviewError = exports.LocalPreviewError = exports.ImageLoadError = void 0;
|
|
8
|
-
exports.getFileStateErrorReason = getFileStateErrorReason;
|
|
9
|
-
exports.isLocalPreviewError = void 0;
|
|
10
|
-
exports.isMediaFilePreviewError = isMediaFilePreviewError;
|
|
11
|
-
exports.isMediaFileStateError = isMediaFileStateError;
|
|
12
|
-
exports.isUnsupportedLocalPreviewError = exports.isRemotePreviewError = void 0;
|
|
13
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
20
|
-
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
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; } }
|
|
23
|
-
/**
|
|
24
|
-
* Primary reason is logged through Data Portal.
|
|
25
|
-
* Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
|
|
26
|
-
*/
|
|
27
|
-
var MediaFilePreviewError = exports.MediaFilePreviewError = /*#__PURE__*/function (_Error) {
|
|
28
|
-
(0, _inherits2.default)(MediaFilePreviewError, _Error);
|
|
29
|
-
var _super = _createSuper(MediaFilePreviewError);
|
|
30
|
-
function MediaFilePreviewError(primaryReason, secondaryError) {
|
|
31
|
-
var _this;
|
|
32
|
-
(0, _classCallCheck2.default)(this, MediaFilePreviewError);
|
|
33
|
-
_this = _super.call(this, primaryReason);
|
|
34
|
-
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget
|
|
35
|
-
_this.primaryReason = primaryReason;
|
|
36
|
-
_this.secondaryError = secondaryError;
|
|
37
|
-
Object.setPrototypeOf((0, _assertThisInitialized2.default)(_this), (this instanceof MediaFilePreviewError ? this.constructor : void 0).prototype);
|
|
38
|
-
|
|
39
|
-
// https://v8.dev/docs/stack-trace-api
|
|
40
|
-
if ('captureStackTrace' in Error) {
|
|
41
|
-
Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), this instanceof MediaFilePreviewError ? this.constructor : void 0);
|
|
42
|
-
}
|
|
43
|
-
return _this;
|
|
44
|
-
}
|
|
45
|
-
return (0, _createClass2.default)(MediaFilePreviewError);
|
|
46
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
47
|
-
var LocalPreviewError = exports.LocalPreviewError = /*#__PURE__*/function (_MediaFilePreviewErro) {
|
|
48
|
-
(0, _inherits2.default)(LocalPreviewError, _MediaFilePreviewErro);
|
|
49
|
-
var _super2 = _createSuper(LocalPreviewError);
|
|
50
|
-
function LocalPreviewError(primaryReason, secondaryError) {
|
|
51
|
-
var _this2;
|
|
52
|
-
(0, _classCallCheck2.default)(this, LocalPreviewError);
|
|
53
|
-
_this2 = _super2.call(this, primaryReason, secondaryError);
|
|
54
|
-
_this2.primaryReason = primaryReason;
|
|
55
|
-
_this2.secondaryError = secondaryError;
|
|
56
|
-
return _this2;
|
|
57
|
-
}
|
|
58
|
-
return (0, _createClass2.default)(LocalPreviewError);
|
|
59
|
-
}(MediaFilePreviewError);
|
|
60
|
-
var RemotePreviewError = exports.RemotePreviewError = /*#__PURE__*/function (_MediaFilePreviewErro2) {
|
|
61
|
-
(0, _inherits2.default)(RemotePreviewError, _MediaFilePreviewErro2);
|
|
62
|
-
var _super3 = _createSuper(RemotePreviewError);
|
|
63
|
-
function RemotePreviewError(primaryReason, secondaryError) {
|
|
64
|
-
var _this3;
|
|
65
|
-
(0, _classCallCheck2.default)(this, RemotePreviewError);
|
|
66
|
-
_this3 = _super3.call(this, primaryReason, secondaryError);
|
|
67
|
-
_this3.primaryReason = primaryReason;
|
|
68
|
-
_this3.secondaryError = secondaryError;
|
|
69
|
-
return _this3;
|
|
70
|
-
}
|
|
71
|
-
return (0, _createClass2.default)(RemotePreviewError);
|
|
72
|
-
}(MediaFilePreviewError);
|
|
73
|
-
var SsrPreviewError = exports.SsrPreviewError = /*#__PURE__*/function (_MediaFilePreviewErro3) {
|
|
74
|
-
(0, _inherits2.default)(SsrPreviewError, _MediaFilePreviewErro3);
|
|
75
|
-
var _super4 = _createSuper(SsrPreviewError);
|
|
76
|
-
function SsrPreviewError(primaryReason, secondaryError) {
|
|
77
|
-
var _this4;
|
|
78
|
-
(0, _classCallCheck2.default)(this, SsrPreviewError);
|
|
79
|
-
_this4 = _super4.call(this, primaryReason, secondaryError);
|
|
80
|
-
_this4.primaryReason = primaryReason;
|
|
81
|
-
_this4.secondaryError = secondaryError;
|
|
82
|
-
return _this4;
|
|
83
|
-
}
|
|
84
|
-
return (0, _createClass2.default)(SsrPreviewError);
|
|
85
|
-
}(MediaFilePreviewError);
|
|
86
|
-
var getImageLoadPrimaryReason = function getImageLoadPrimaryReason(source) {
|
|
87
|
-
switch (source) {
|
|
88
|
-
case 'cache-remote':
|
|
89
|
-
return 'cache-remote-uri';
|
|
90
|
-
case 'cache-local':
|
|
91
|
-
return 'cache-local-uri';
|
|
92
|
-
case 'external':
|
|
93
|
-
return 'external-uri';
|
|
94
|
-
case 'local':
|
|
95
|
-
return 'local-uri';
|
|
96
|
-
case 'remote':
|
|
97
|
-
return 'remote-uri';
|
|
98
|
-
// This fail reason will come from a bug, most likely.
|
|
99
|
-
default:
|
|
100
|
-
return "unknown-uri";
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
var ImageLoadError = exports.ImageLoadError = /*#__PURE__*/function (_MediaFilePreviewErro4) {
|
|
104
|
-
(0, _inherits2.default)(ImageLoadError, _MediaFilePreviewErro4);
|
|
105
|
-
var _super5 = _createSuper(ImageLoadError);
|
|
106
|
-
function ImageLoadError(source) {
|
|
107
|
-
(0, _classCallCheck2.default)(this, ImageLoadError);
|
|
108
|
-
return _super5.call(this, getImageLoadPrimaryReason(source));
|
|
109
|
-
}
|
|
110
|
-
return (0, _createClass2.default)(ImageLoadError);
|
|
111
|
-
}(MediaFilePreviewError);
|
|
112
|
-
function isMediaFilePreviewError(err) {
|
|
113
|
-
return err instanceof MediaFilePreviewError;
|
|
114
|
-
}
|
|
115
|
-
var isLocalPreviewError = exports.isLocalPreviewError = function isLocalPreviewError(err) {
|
|
116
|
-
return err instanceof LocalPreviewError;
|
|
117
|
-
};
|
|
118
|
-
var isRemotePreviewError = exports.isRemotePreviewError = function isRemotePreviewError(err) {
|
|
119
|
-
return err instanceof RemotePreviewError;
|
|
120
|
-
};
|
|
121
|
-
var isUnsupportedLocalPreviewError = exports.isUnsupportedLocalPreviewError = function isUnsupportedLocalPreviewError(err) {
|
|
122
|
-
return isMediaFilePreviewError(err) && err.primaryReason === 'local-preview-unsupported';
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// In a try/catch statement, the error caught is the type of unknown.
|
|
126
|
-
// We can use this helper to ensure that the error handled is the type of MediaFilePreviewError if unsure
|
|
127
|
-
// If updatePrimaryReason is true, if it's a MediaFilePreviewError already, it will update it's primary reason
|
|
128
|
-
var ensureMediaFilePreviewError = exports.ensureMediaFilePreviewError = function ensureMediaFilePreviewError(primaryReason, error, updatePrimaryReason) {
|
|
129
|
-
if (isMediaFilePreviewError(error)) {
|
|
130
|
-
if (updatePrimaryReason && error.primaryReason !== primaryReason) {
|
|
131
|
-
return new MediaFilePreviewError(primaryReason, error.secondaryError);
|
|
132
|
-
}
|
|
133
|
-
return error;
|
|
134
|
-
}
|
|
135
|
-
return new MediaFilePreviewError(primaryReason, error);
|
|
136
|
-
};
|
|
137
|
-
function isMediaFileStateError(err) {
|
|
138
|
-
return err instanceof _mediaClientReact.MediaFileStateError;
|
|
139
|
-
}
|
|
140
|
-
function getFileStateErrorReason(err) {
|
|
141
|
-
var _err$details$reason, _err$details;
|
|
142
|
-
return (_err$details$reason = (_err$details = err.details) === null || _err$details === void 0 ? void 0 : _err$details.reason) !== null && _err$details$reason !== void 0 ? _err$details$reason : 'unknown';
|
|
143
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.mediaFilePreviewCache = exports.getCacheKey = exports.CardPreviewCacheImpl = void 0;
|
|
8
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _objectURLCache = require("./objectURLCache");
|
|
12
|
-
// Dimensions are used to create a key.
|
|
13
|
-
// Cache is invalidated when different dimensions are provided.
|
|
14
|
-
|
|
15
|
-
var getCacheKey = exports.getCacheKey = function getCacheKey(id, mode) {
|
|
16
|
-
var resizeMode = mode || 'crop';
|
|
17
|
-
return [id, resizeMode].join('-');
|
|
18
|
-
};
|
|
19
|
-
var CardPreviewCacheImpl = exports.CardPreviewCacheImpl = /*#__PURE__*/(0, _createClass2.default)(function CardPreviewCacheImpl(previewCache) {
|
|
20
|
-
var _this = this;
|
|
21
|
-
(0, _classCallCheck2.default)(this, CardPreviewCacheImpl);
|
|
22
|
-
(0, _defineProperty2.default)(this, "get", function (id, mode) {
|
|
23
|
-
var cacheKey = getCacheKey(id, mode);
|
|
24
|
-
return _this.previewCache.get(cacheKey);
|
|
25
|
-
});
|
|
26
|
-
(0, _defineProperty2.default)(this, "set", function (id, mode, cardPreview) {
|
|
27
|
-
var cacheKey = getCacheKey(id, mode);
|
|
28
|
-
_this.previewCache.set(cacheKey, cardPreview);
|
|
29
|
-
});
|
|
30
|
-
(0, _defineProperty2.default)(this, "remove", function (id, mode) {
|
|
31
|
-
var cacheKey = getCacheKey(id, mode);
|
|
32
|
-
_this.previewCache.remove(cacheKey);
|
|
33
|
-
});
|
|
34
|
-
(0, _defineProperty2.default)(this, "clear", function () {
|
|
35
|
-
_this.previewCache.clear();
|
|
36
|
-
});
|
|
37
|
-
this.previewCache = previewCache;
|
|
38
|
-
});
|
|
39
|
-
var mediaFilePreviewCache = exports.mediaFilePreviewCache = new CardPreviewCacheImpl((0, _objectURLCache.createObjectURLCache)());
|