@atlaskit/media-card 77.0.3 → 77.1.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 +107 -95
- package/dist/cjs/card/card.js +8 -10
- package/dist/cjs/card/cardAnalytics.js +6 -11
- package/dist/cjs/card/cardConstants.js +1 -2
- package/dist/cjs/card/cardLoader.js +1 -2
- package/dist/cjs/card/cardState.js +3 -5
- package/dist/cjs/card/cardSwitcher.js +5 -2
- package/dist/cjs/card/cardView.js +3 -5
- package/dist/cjs/card/classnames.js +2 -4
- package/dist/cjs/card/getCardPreview/cache.js +3 -6
- package/dist/cjs/card/getCardPreview/filePreviewStatus.js +3 -5
- package/dist/cjs/card/getCardPreview/helpers.js +4 -7
- package/dist/cjs/card/getCardPreview/index.js +13 -25
- package/dist/cjs/card/getCardStatus.js +3 -5
- package/dist/cjs/card/inlinePlayer.js +3 -6
- package/dist/cjs/card/inlinePlayerLazy.js +2 -3
- package/dist/cjs/card/inlinePlayerWrapper.js +2 -3
- package/dist/cjs/card/inlinePlayerWrapperStyles.js +2 -4
- package/dist/cjs/card/media-card-analytics-error-boundary.js +5 -6
- package/dist/cjs/card/ui/actionsBar/actionsBar.js +2 -3
- package/dist/cjs/card/ui/actionsBar/actionsBarWrapper.js +2 -3
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionButton.js +2 -3
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionIconButton.js +2 -3
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsDropdownMenu.js +2 -3
- package/dist/cjs/card/ui/actionsBar/cardActions/cardActionsView.js +1 -2
- package/dist/cjs/card/ui/actionsBar/cardActions/styles.js +4 -7
- package/dist/cjs/card/ui/actionsBar/styles.js +3 -6
- package/dist/cjs/card/ui/blanket/blanket.js +4 -4
- package/dist/cjs/card/ui/blanket/styles.js +3 -6
- package/dist/cjs/card/ui/common.js +4 -7
- package/dist/cjs/card/ui/iconMessage/iconMessageWrapper.js +2 -3
- package/dist/cjs/card/ui/iconMessage/index.js +7 -13
- package/dist/cjs/card/ui/iconMessage/styles.js +1 -2
- package/dist/cjs/card/ui/iconWrapper/iconWrapper.js +2 -3
- package/dist/cjs/card/ui/iconWrapper/styles.js +1 -2
- package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +2 -3
- package/dist/cjs/card/ui/playButton/playButton.js +2 -3
- package/dist/cjs/card/ui/playButton/playButtonBackground.js +2 -3
- package/dist/cjs/card/ui/playButton/playButtonWrapper.js +2 -3
- package/dist/cjs/card/ui/playButton/styles.js +5 -10
- package/dist/cjs/card/ui/progressBar/progressBar.js +3 -5
- package/dist/cjs/card/ui/progressBar/styledBar.js +2 -3
- package/dist/cjs/card/ui/progressBar/styles.js +1 -2
- package/dist/cjs/card/ui/styles.js +11 -21
- package/dist/cjs/card/ui/tickBox/styles.js +5 -9
- package/dist/cjs/card/ui/tickBox/tickBox.js +2 -3
- package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +2 -3
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +2 -3
- package/dist/cjs/card/ui/titleBox/styles.js +5 -10
- package/dist/cjs/card/ui/titleBox/titleBox.js +3 -5
- package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +6 -11
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +2 -3
- package/dist/cjs/card/ui/wrapper/styles.js +1 -2
- package/dist/cjs/card/ui/wrapper/wrapper.js +2 -3
- package/dist/cjs/card/v2/cardV2.js +11 -13
- package/dist/cjs/card/v2/cardV2Loader.js +1 -2
- package/dist/cjs/card/v2/cardViewV2.js +308 -0
- package/dist/cjs/errors.js +13 -25
- package/dist/cjs/inline/loader.js +2 -3
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +3 -4
- package/dist/cjs/inline/mediaInlineCard.js +3 -5
- package/dist/cjs/inline/mediaInlineCardAnalytics.js +4 -7
- package/dist/cjs/types.js +2 -3
- package/dist/cjs/utils/analytics.js +23 -41
- package/dist/cjs/utils/cardDimensions.js +5 -9
- package/dist/cjs/utils/containsPixelUnit.js +2 -3
- package/dist/cjs/utils/dimensionComparer.js +3 -5
- package/dist/cjs/utils/document.js +2 -3
- package/dist/cjs/utils/generateUniqueId.js +2 -3
- package/dist/cjs/utils/getDataURIDimension.js +3 -5
- package/dist/cjs/utils/getElementDimension.js +2 -3
- package/dist/cjs/utils/getMediaCardCursor.js +2 -3
- package/dist/cjs/utils/globalScope/getSSRData.js +2 -3
- package/dist/cjs/utils/globalScope/globalScope.js +6 -11
- package/dist/cjs/utils/isValidPercentageUnit.js +2 -3
- package/dist/cjs/utils/lightCards/cardError.js +1 -2
- package/dist/cjs/utils/lightCards/cardLoading.js +2 -3
- package/dist/cjs/utils/lightCards/errorIcon/index.js +1 -2
- package/dist/cjs/utils/lightCards/errorIcon/styles.js +1 -2
- package/dist/cjs/utils/lightCards/getDimensionsWithDefault.js +2 -3
- package/dist/cjs/utils/lightCards/lightCardWrappers.js +2 -3
- package/dist/cjs/utils/lightCards/styles.js +2 -3
- package/dist/cjs/utils/metadata.js +2 -3
- package/dist/cjs/utils/mockIntersectionObserver.js +5 -6
- package/dist/cjs/utils/objectURLCache.js +4 -7
- package/dist/cjs/utils/preventClickThrough.js +2 -3
- package/dist/cjs/utils/printScript.js +3 -5
- package/dist/cjs/utils/ufoExperiences.js +3 -5
- package/dist/cjs/utils/videoIsPlayable.js +2 -3
- package/dist/cjs/utils/videoSnapshot.js +2 -3
- package/dist/cjs/utils/viewportDetector.js +2 -3
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardSwitcher.js +5 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/blanket/blanket.js +2 -1
- package/dist/es2019/card/ui/tickBox/styles.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +4 -4
- package/dist/es2019/card/v2/cardViewV2.js +300 -0
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +5 -5
- package/dist/esm/card/cardSwitcher.js +5 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +4 -4
- package/dist/esm/card/ui/blanket/blanket.js +2 -1
- package/dist/esm/card/ui/tickBox/styles.js +1 -1
- package/dist/esm/card/v2/cardV2.js +8 -8
- package/dist/esm/card/v2/cardViewV2.js +299 -0
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +2 -2
- package/dist/esm/utils/analytics.js +4 -4
- package/dist/esm/utils/mockIntersectionObserver.js +3 -3
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/cardSwitcher.d.ts +3 -2
- package/dist/types/card/v2/cardViewV2.d.ts +44 -0
- package/dist/types-ts4.5/card/cardSwitcher.d.ts +3 -2
- package/dist/types-ts4.5/card/v2/cardViewV2.d.ts +44 -0
- package/package.json +2 -2
- package/report.api.md +1 -2
- package/tmp/api-report-tmp.d.ts +1 -2
|
@@ -26,7 +26,7 @@ var getFileDetailsFromFileState = function getFileDetailsFromFileState(state) {
|
|
|
26
26
|
processingStatus: getProcessingStatusFromFileState(state.status)
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
var getFileDetails = function getFileDetails(identifier, fileState) {
|
|
29
|
+
var getFileDetails = exports.getFileDetails = function getFileDetails(identifier, fileState) {
|
|
30
30
|
return (0, _mediaClient.isFileIdentifier)(identifier) ? fileState && !(0, _mediaClient.isErrorFileState)(fileState) ? getFileDetailsFromFileState(fileState) : {
|
|
31
31
|
id: identifier.id
|
|
32
32
|
} : {
|
|
@@ -34,5 +34,4 @@ var getFileDetails = function getFileDetails(identifier, fileState) {
|
|
|
34
34
|
name: identifier.name || identifier.dataURI,
|
|
35
35
|
mediaType: 'image'
|
|
36
36
|
};
|
|
37
|
-
};
|
|
38
|
-
exports.getFileDetails = getFileDetails;
|
|
37
|
+
};
|
|
@@ -9,7 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var noop = function noop() {};
|
|
12
|
-
var MockIntersectionObserver = /*#__PURE__*/function () {
|
|
12
|
+
var MockIntersectionObserver = exports.MockIntersectionObserver = /*#__PURE__*/function () {
|
|
13
13
|
function MockIntersectionObserver() {
|
|
14
14
|
(0, _classCallCheck2.default)(this, MockIntersectionObserver);
|
|
15
15
|
(0, _defineProperty2.default)(this, "callback", noop);
|
|
@@ -22,15 +22,15 @@ var MockIntersectionObserver = /*#__PURE__*/function () {
|
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
23
23
|
var outerThis = this;
|
|
24
24
|
this.mockObserver = /*#__PURE__*/function () {
|
|
25
|
-
function
|
|
26
|
-
(0, _classCallCheck2.default)(this,
|
|
25
|
+
function _class3(callback) {
|
|
26
|
+
(0, _classCallCheck2.default)(this, _class3);
|
|
27
27
|
(0, _defineProperty2.default)(this, "observe", observe !== null && observe !== void 0 ? observe : noop);
|
|
28
28
|
(0, _defineProperty2.default)(this, "unobserve", noop);
|
|
29
29
|
(0, _defineProperty2.default)(this, "disconnect", disconnect !== null && disconnect !== void 0 ? disconnect : noop);
|
|
30
30
|
outerThis.callback = callback;
|
|
31
31
|
outerThis.mockObserverInstance = this;
|
|
32
32
|
}
|
|
33
|
-
return (0, _createClass2.default)(
|
|
33
|
+
return (0, _createClass2.default)(_class3);
|
|
34
34
|
}();
|
|
35
35
|
}
|
|
36
36
|
}, {
|
|
@@ -64,5 +64,4 @@ var MockIntersectionObserver = /*#__PURE__*/function () {
|
|
|
64
64
|
}
|
|
65
65
|
}]);
|
|
66
66
|
return MockIntersectionObserver;
|
|
67
|
-
}();
|
|
68
|
-
exports.MockIntersectionObserver = MockIntersectionObserver;
|
|
67
|
+
}();
|
|
@@ -15,8 +15,7 @@ var _lru_map = require("lru_map");
|
|
|
15
15
|
var _eventemitter = require("eventemitter2");
|
|
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
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; } }
|
|
18
|
-
var PREVIEW_CACHE_LRU_SIZE = 50;
|
|
19
|
-
exports.PREVIEW_CACHE_LRU_SIZE = PREVIEW_CACHE_LRU_SIZE;
|
|
18
|
+
var PREVIEW_CACHE_LRU_SIZE = exports.PREVIEW_CACHE_LRU_SIZE = 50;
|
|
20
19
|
var ExtendedLRUCache = /*#__PURE__*/function (_LRUMap) {
|
|
21
20
|
(0, _inherits2.default)(ExtendedLRUCache, _LRUMap);
|
|
22
21
|
var _super = _createSuper(ExtendedLRUCache);
|
|
@@ -42,7 +41,7 @@ var ExtendedLRUCache = /*#__PURE__*/function (_LRUMap) {
|
|
|
42
41
|
}]);
|
|
43
42
|
return ExtendedLRUCache;
|
|
44
43
|
}(_lru_map.LRUMap);
|
|
45
|
-
var ObjectURLCache = /*#__PURE__*/function () {
|
|
44
|
+
var ObjectURLCache = exports.ObjectURLCache = /*#__PURE__*/function () {
|
|
46
45
|
function ObjectURLCache(size) {
|
|
47
46
|
(0, _classCallCheck2.default)(this, ObjectURLCache);
|
|
48
47
|
this.cache = new ExtendedLRUCache(size);
|
|
@@ -81,8 +80,6 @@ var ObjectURLCache = /*#__PURE__*/function () {
|
|
|
81
80
|
}]);
|
|
82
81
|
return ObjectURLCache;
|
|
83
82
|
}();
|
|
84
|
-
exports.
|
|
85
|
-
var createObjectURLCache = function createObjectURLCache() {
|
|
83
|
+
var createObjectURLCache = exports.createObjectURLCache = function createObjectURLCache() {
|
|
86
84
|
return new ObjectURLCache(PREVIEW_CACHE_LRU_SIZE);
|
|
87
|
-
};
|
|
88
|
-
exports.createObjectURLCache = createObjectURLCache;
|
|
85
|
+
};
|
|
@@ -17,11 +17,10 @@ function PreventClickThrough(_ref) {
|
|
|
17
17
|
"data-testid": "prevent-click-through"
|
|
18
18
|
}, children);
|
|
19
19
|
}
|
|
20
|
-
var createPreventClickThrough = function createPreventClickThrough(onClick) {
|
|
20
|
+
var createPreventClickThrough = exports.createPreventClickThrough = function createPreventClickThrough(onClick) {
|
|
21
21
|
return function (event) {
|
|
22
22
|
event.stopPropagation();
|
|
23
23
|
event.preventDefault();
|
|
24
24
|
onClick();
|
|
25
25
|
};
|
|
26
|
-
};
|
|
27
|
-
exports.createPreventClickThrough = createPreventClickThrough;
|
|
26
|
+
};
|
|
@@ -21,14 +21,12 @@ var printParams = function printParams(args) {
|
|
|
21
21
|
return printParam(arg);
|
|
22
22
|
}).join(',');
|
|
23
23
|
};
|
|
24
|
-
var printFunctionCall = function printFunctionCall(fn) {
|
|
24
|
+
var printFunctionCall = exports.printFunctionCall = function printFunctionCall(fn) {
|
|
25
25
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
26
26
|
args[_key - 1] = arguments[_key];
|
|
27
27
|
}
|
|
28
28
|
return "(".concat(fn.toString(), ")(").concat(printParams(args), ");");
|
|
29
29
|
};
|
|
30
|
-
exports.
|
|
31
|
-
var printScript = function printScript(statements) {
|
|
30
|
+
var printScript = exports.printScript = function printScript(statements) {
|
|
32
31
|
return "(function(){\n ".concat(statements.join(';'), "\n})();\n");
|
|
33
|
-
};
|
|
34
|
-
exports.printScript = printScript;
|
|
32
|
+
};
|
|
@@ -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.
|
|
17
|
+
var packageVersion = "77.1.1";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
|
@@ -30,11 +30,10 @@ var getExperience = function getExperience(id) {
|
|
|
30
30
|
}
|
|
31
31
|
return concurrentExperience.getInstance(id);
|
|
32
32
|
};
|
|
33
|
-
var startUfoExperience = function startUfoExperience(id) {
|
|
33
|
+
var startUfoExperience = exports.startUfoExperience = function startUfoExperience(id) {
|
|
34
34
|
getExperience(id).start();
|
|
35
35
|
};
|
|
36
|
-
exports.
|
|
37
|
-
var completeUfoExperience = function completeUfoExperience(id, status, fileAttributes, fileStateFlags, ssrReliability) {
|
|
36
|
+
var completeUfoExperience = exports.completeUfoExperience = function completeUfoExperience(id, status, fileAttributes, fileStateFlags, ssrReliability) {
|
|
38
37
|
var error = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : new _errors.MediaCardError('missing-error-data');
|
|
39
38
|
switch (status) {
|
|
40
39
|
case 'complete':
|
|
@@ -63,7 +62,6 @@ var completeUfoExperience = function completeUfoExperience(id, status, fileAttri
|
|
|
63
62
|
break;
|
|
64
63
|
}
|
|
65
64
|
};
|
|
66
|
-
exports.completeUfoExperience = completeUfoExperience;
|
|
67
65
|
var succeedUfoExperience = function succeedUfoExperience(id, properties) {
|
|
68
66
|
getExperience(id).success({
|
|
69
67
|
metadata: _objectSpread(_objectSpread({}, properties), {}, {
|
|
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.videoIsPlayable = void 0;
|
|
7
7
|
var _mediaClient = require("@atlaskit/media-client");
|
|
8
8
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
9
|
-
var videoIsPlayable = function videoIsPlayable(isBannedLocalPreview, fileState, mimeType) {
|
|
9
|
+
var videoIsPlayable = exports.videoIsPlayable = function videoIsPlayable(isBannedLocalPreview, fileState, mimeType) {
|
|
10
10
|
var localPreviewAvailable = mimeType && !isBannedLocalPreview && (0, _mediaCommon.isVideoMimeTypeSupportedByBrowser)(mimeType);
|
|
11
11
|
var videoProcessedByServer = fileState && (0, _mediaClient.isProcessedFileState)(fileState);
|
|
12
12
|
return !!(localPreviewAvailable || videoProcessedByServer);
|
|
13
|
-
};
|
|
14
|
-
exports.videoIsPlayable = videoIsPlayable;
|
|
13
|
+
};
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.takeSnapshot = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var takeSnapshot = /*#__PURE__*/function () {
|
|
10
|
+
var takeSnapshot = exports.takeSnapshot = /*#__PURE__*/function () {
|
|
11
11
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(blob) {
|
|
12
12
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
13
13
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -55,5 +55,4 @@ var takeSnapshot = /*#__PURE__*/function () {
|
|
|
55
55
|
return function takeSnapshot(_x) {
|
|
56
56
|
return _ref.apply(this, arguments);
|
|
57
57
|
};
|
|
58
|
-
}();
|
|
59
|
-
exports.takeSnapshot = takeSnapshot;
|
|
58
|
+
}();
|
|
@@ -59,7 +59,7 @@ var ViewportObserver = function ViewportObserver(_ref) {
|
|
|
59
59
|
}, [cardEl, onVisible]);
|
|
60
60
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
61
61
|
};
|
|
62
|
-
var ViewportDetector = function ViewportDetector(_ref2) {
|
|
62
|
+
var ViewportDetector = exports.ViewportDetector = function ViewportDetector(_ref2) {
|
|
63
63
|
var cardEl = _ref2.cardEl,
|
|
64
64
|
onVisible = _ref2.onVisible,
|
|
65
65
|
children = _ref2.children;
|
|
@@ -70,5 +70,4 @@ var ViewportDetector = function ViewportDetector(_ref2) {
|
|
|
70
70
|
cardEl: cardEl,
|
|
71
71
|
onVisible: onVisible
|
|
72
72
|
}, children);
|
|
73
|
-
};
|
|
74
|
-
exports.ViewportDetector = ViewportDetector;
|
|
73
|
+
};
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -27,7 +27,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
27
27
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
const packageName = "@atlaskit/media-card";
|
|
30
|
-
const packageVersion = "77.
|
|
30
|
+
const packageVersion = "77.1.1";
|
|
31
31
|
export class CardBase extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import CardLoader from './cardLoader';
|
|
3
4
|
import CardV2Loader from './v2/cardV2Loader';
|
|
4
|
-
|
|
5
|
+
function CardSwitcher(props) {
|
|
6
|
+
return getBooleanFF('platform.media-experience.cardv2_7zann') ? /*#__PURE__*/React.createElement(CardV2Loader, props) : /*#__PURE__*/React.createElement(CardLoader, props);
|
|
7
|
+
}
|
|
8
|
+
export default CardSwitcher;
|
|
@@ -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.
|
|
69
|
+
const packageVersion = "77.1.1";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -11,7 +11,7 @@ export const getSelectedStyles = selected => selected ? `background-color: ${`va
|
|
|
11
11
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
13
13
|
export const wrapperStyles = selected => css`
|
|
14
|
-
${transition()}
|
|
14
|
+
${transition && transition()}
|
|
15
15
|
font-size: 14px;
|
|
16
16
|
width: 14px;
|
|
17
17
|
height: 14px;
|
|
@@ -9,7 +9,7 @@ import { getRandomHex } from '@atlaskit/media-common';
|
|
|
9
9
|
import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECENTS_COLLECTION, isImageRepresentationReady, isExternalImageIdentifier, imageResizeModeToFileImageMode } from '@atlaskit/media-client';
|
|
10
10
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
11
11
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
12
|
-
import {
|
|
12
|
+
import { CardViewV2 } from './cardViewV2';
|
|
13
13
|
import { ViewportDetector } from '../../utils/viewportDetector';
|
|
14
14
|
import { videoIsPlayable } from '../../utils/videoIsPlayable';
|
|
15
15
|
import { getRequestedDimensions } from '../../utils/getDataURIDimension';
|
|
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience } from '../../utils/ufoExperi
|
|
|
28
28
|
import { generateUniqueId } from '../../utils/generateUniqueId';
|
|
29
29
|
import { useFileState } from '@atlaskit/media-client-react';
|
|
30
30
|
const packageName = "@atlaskit/media-card";
|
|
31
|
-
const packageVersion = "77.
|
|
31
|
+
const packageVersion = "77.1.1";
|
|
32
32
|
export class CardV2Base extends Component {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
super(props);
|
|
@@ -537,7 +537,7 @@ export class CardV2Base extends Component {
|
|
|
537
537
|
// Force Media Image to always display img for SSR
|
|
538
538
|
const forceSyncDisplay = !!ssr;
|
|
539
539
|
const mediaCardCursor = getMediaCardCursor(!!useInlinePlayer, !!shouldOpenMediaViewer, status === 'error' || status === 'failed-processing', !!this.state.cardPreview, metadata.mediaType);
|
|
540
|
-
const card = /*#__PURE__*/React.createElement(
|
|
540
|
+
const card = /*#__PURE__*/React.createElement(CardViewV2, {
|
|
541
541
|
status: cardStatusOverride || status,
|
|
542
542
|
error: error,
|
|
543
543
|
mediaItemType: mediaItemType,
|
|
@@ -672,7 +672,7 @@ export class CardV2Base extends Component {
|
|
|
672
672
|
previewDidRender: false,
|
|
673
673
|
error: _error,
|
|
674
674
|
wasResolvedUpfrontPreview: false,
|
|
675
|
-
shouldUpdateStateForIdentifier:
|
|
675
|
+
shouldUpdateStateForIdentifier: _isCardVisible && isFileIdentifier(_identifier)
|
|
676
676
|
};
|
|
677
677
|
}
|
|
678
678
|
getSSRPreview(ssr, identifier, mediaClient) {
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
4
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
+
import { MimeTypeIcon } from '@atlaskit/media-ui/mime-type-icon';
|
|
6
|
+
import SpinnerIcon from '@atlaskit/spinner';
|
|
7
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
8
|
+
import { messages } from '@atlaskit/media-ui';
|
|
9
|
+
import { defaultImageCardDimensions } from '../../utils/cardDimensions';
|
|
10
|
+
import { isValidPercentageUnit } from '../../utils/isValidPercentageUnit';
|
|
11
|
+
import { getElementDimension } from '../../utils/getElementDimension';
|
|
12
|
+
import { createAndFireMediaCardEvent } from '../../utils/analytics';
|
|
13
|
+
import { attachDetailsToActions } from '../actions';
|
|
14
|
+
import { cardImageContainerStyles, calcBreakpointSize } from '../ui/styles';
|
|
15
|
+
import { ImageRenderer } from '../ui/imageRenderer/imageRenderer';
|
|
16
|
+
import { TitleBox } from '../ui/titleBox/titleBox';
|
|
17
|
+
import { FailedTitleBox } from '../ui/titleBox/failedTitleBox';
|
|
18
|
+
import { ProgressBar } from '../ui/progressBar/progressBar';
|
|
19
|
+
import { PlayButton } from '../ui/playButton/playButton';
|
|
20
|
+
import { TickBox } from '../ui/tickBox/tickBox';
|
|
21
|
+
import { Blanket } from '../ui/blanket/blanket';
|
|
22
|
+
import { ActionsBar } from '../ui/actionsBar/actionsBar';
|
|
23
|
+
import { IconWrapper } from '../ui/iconWrapper/iconWrapper';
|
|
24
|
+
import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUnavailable, FailedToLoad } from '../ui/iconMessage';
|
|
25
|
+
import { isUploadError, isRateLimitedError, isPollingError } from '../../errors';
|
|
26
|
+
import { Wrapper } from '../ui/wrapper';
|
|
27
|
+
import { fileCardImageViewSelector } from '../classnames';
|
|
28
|
+
export const CardViewV2Base = ({
|
|
29
|
+
innerRef,
|
|
30
|
+
onImageLoad,
|
|
31
|
+
onImageError,
|
|
32
|
+
dimensions,
|
|
33
|
+
appearance = 'auto',
|
|
34
|
+
onClick,
|
|
35
|
+
onMouseEnter,
|
|
36
|
+
testId,
|
|
37
|
+
metadata,
|
|
38
|
+
status,
|
|
39
|
+
selected,
|
|
40
|
+
selectable,
|
|
41
|
+
cardPreview,
|
|
42
|
+
mediaCardCursor,
|
|
43
|
+
shouldHideTooltip,
|
|
44
|
+
progress,
|
|
45
|
+
alt,
|
|
46
|
+
resizeMode,
|
|
47
|
+
onDisplayImage,
|
|
48
|
+
nativeLazyLoad,
|
|
49
|
+
forceSyncDisplay,
|
|
50
|
+
actions,
|
|
51
|
+
disableOverlay,
|
|
52
|
+
titleBoxBgColor,
|
|
53
|
+
titleBoxIcon,
|
|
54
|
+
error,
|
|
55
|
+
disableAnimation
|
|
56
|
+
}) => {
|
|
57
|
+
const [elementWidth, setElementWidth] = useState();
|
|
58
|
+
const [didImageRender, setDidImageRender] = useState(false);
|
|
59
|
+
const divRef = useRef(null);
|
|
60
|
+
const prevCardPreviewRef = useRef();
|
|
61
|
+
const width = (dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) || 0;
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
// If the dimensions.width is a percentage, we need to transform it into a pixel value in order to get the right breakpoints applied.
|
|
64
|
+
if (width && isValidPercentageUnit(width) && !!divRef.current) {
|
|
65
|
+
const elementWidth = getElementDimension(divRef.current, 'width');
|
|
66
|
+
setElementWidth(elementWidth);
|
|
67
|
+
}
|
|
68
|
+
}, [width]);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
innerRef && !!divRef.current && innerRef(divRef.current);
|
|
71
|
+
}, [innerRef]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
// We should only switch didImageRender to false when cardPreview goes undefined, not when it is changed. as this method could be triggered after onImageLoad callback, falling on a race condition
|
|
74
|
+
if (prevCardPreviewRef.current && !cardPreview) {
|
|
75
|
+
setDidImageRender(false);
|
|
76
|
+
}
|
|
77
|
+
prevCardPreviewRef.current = cardPreview;
|
|
78
|
+
}, [cardPreview]);
|
|
79
|
+
const handleOnImageLoad = prevCardPreview => {
|
|
80
|
+
if (prevCardPreview.dataURI !== (cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
We render the icon & icon message always, even if there is cardPreview available.
|
|
86
|
+
If the image fails to load/render, the icon will remain, i.e. the user won't see a change until the root card decides to chage status to error.
|
|
87
|
+
If the image renders successfully, we switch this variable to hide the icon & icon message behind the thumbnail in case the image has transparency.
|
|
88
|
+
It is less likely that root component replaces a suceeded cardPreview for a failed one than the opposite case. Therefore we prefer to hide the icon instead show when the image fails, for a smoother transition
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
setDidImageRender(true);
|
|
92
|
+
onImageLoad === null || onImageLoad === void 0 ? void 0 : onImageLoad(cardPreview);
|
|
93
|
+
};
|
|
94
|
+
const handleOnImageError = cardPreview => {
|
|
95
|
+
setDidImageRender(false);
|
|
96
|
+
onImageError === null || onImageError === void 0 ? void 0 : onImageError(cardPreview);
|
|
97
|
+
};
|
|
98
|
+
const breakpoint = useMemo(() => {
|
|
99
|
+
const width = elementWidth || (dimensions ? dimensions.width : '') || defaultImageCardDimensions.width;
|
|
100
|
+
return calcBreakpointSize(parseInt(`${width}`, 10));
|
|
101
|
+
}, [elementWidth, dimensions]);
|
|
102
|
+
const shouldRenderPlayButton = () => {
|
|
103
|
+
const {
|
|
104
|
+
mediaType
|
|
105
|
+
} = metadata || {};
|
|
106
|
+
if (mediaType !== 'video' || !cardPreview) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
};
|
|
111
|
+
const getRenderConfigByStatus = () => {
|
|
112
|
+
const {
|
|
113
|
+
name,
|
|
114
|
+
mediaType
|
|
115
|
+
} = metadata || {};
|
|
116
|
+
const isZeroSize = metadata && metadata.size === 0;
|
|
117
|
+
const defaultConfig = {
|
|
118
|
+
renderTypeIcon: !didImageRender,
|
|
119
|
+
renderImageRenderer: !!cardPreview,
|
|
120
|
+
renderPlayButton: !!cardPreview && mediaType === 'video',
|
|
121
|
+
renderBlanket: !disableOverlay,
|
|
122
|
+
renderTitleBox: !disableOverlay && !!name,
|
|
123
|
+
renderTickBox: !disableOverlay && !!selectable
|
|
124
|
+
};
|
|
125
|
+
switch (status) {
|
|
126
|
+
case 'uploading':
|
|
127
|
+
return {
|
|
128
|
+
...defaultConfig,
|
|
129
|
+
renderBlanket: !disableOverlay || mediaType !== 'video',
|
|
130
|
+
isFixedBlanket: true,
|
|
131
|
+
renderProgressBar: true
|
|
132
|
+
};
|
|
133
|
+
case 'processing':
|
|
134
|
+
return {
|
|
135
|
+
...defaultConfig,
|
|
136
|
+
iconMessage: !didImageRender && !isZeroSize ? jsx(CreatingPreview, {
|
|
137
|
+
disableAnimation: disableAnimation
|
|
138
|
+
}) : undefined
|
|
139
|
+
};
|
|
140
|
+
case 'complete':
|
|
141
|
+
return defaultConfig;
|
|
142
|
+
case 'error':
|
|
143
|
+
case 'failed-processing':
|
|
144
|
+
const baseErrorConfig = {
|
|
145
|
+
...defaultConfig,
|
|
146
|
+
renderTypeIcon: true,
|
|
147
|
+
renderImageRenderer: false,
|
|
148
|
+
renderTitleBox: false,
|
|
149
|
+
renderPlayButton: false
|
|
150
|
+
};
|
|
151
|
+
let iconMessage;
|
|
152
|
+
let customTitleMessage;
|
|
153
|
+
const {
|
|
154
|
+
secondaryError
|
|
155
|
+
} = error || {};
|
|
156
|
+
if (isRateLimitedError(secondaryError) || isPollingError(secondaryError)) {
|
|
157
|
+
iconMessage = jsx(PreviewCurrentlyUnavailable, null);
|
|
158
|
+
} else if (isUploadError(error)) {
|
|
159
|
+
iconMessage = jsx(FailedToUpload, null);
|
|
160
|
+
customTitleMessage = messages.failed_to_upload;
|
|
161
|
+
} else if (!metadata) {
|
|
162
|
+
iconMessage = jsx(FailedToLoad, null);
|
|
163
|
+
} else {
|
|
164
|
+
iconMessage = jsx(PreviewUnavailable, null);
|
|
165
|
+
}
|
|
166
|
+
if (!disableOverlay) {
|
|
167
|
+
const renderFailedTitleBox = !name || !!customTitleMessage;
|
|
168
|
+
return {
|
|
169
|
+
...baseErrorConfig,
|
|
170
|
+
renderTitleBox: !!name && !customTitleMessage,
|
|
171
|
+
renderFailedTitleBox,
|
|
172
|
+
iconMessage: !renderFailedTitleBox ? iconMessage : undefined,
|
|
173
|
+
customTitleMessage
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
...baseErrorConfig,
|
|
178
|
+
iconMessage
|
|
179
|
+
};
|
|
180
|
+
case 'loading-preview':
|
|
181
|
+
case 'loading':
|
|
182
|
+
default:
|
|
183
|
+
return {
|
|
184
|
+
...defaultConfig,
|
|
185
|
+
renderPlayButton: false,
|
|
186
|
+
renderTypeIcon: false,
|
|
187
|
+
renderSpinner: !didImageRender
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const {
|
|
192
|
+
renderTypeIcon,
|
|
193
|
+
iconMessage,
|
|
194
|
+
renderImageRenderer,
|
|
195
|
+
renderSpinner,
|
|
196
|
+
renderPlayButton,
|
|
197
|
+
renderBlanket,
|
|
198
|
+
renderProgressBar,
|
|
199
|
+
renderTitleBox,
|
|
200
|
+
renderFailedTitleBox,
|
|
201
|
+
renderTickBox,
|
|
202
|
+
isFixedBlanket,
|
|
203
|
+
customTitleMessage
|
|
204
|
+
} = getRenderConfigByStatus();
|
|
205
|
+
const shouldDisplayBackground = !cardPreview || !disableOverlay || status === 'error' || status === 'failed-processing';
|
|
206
|
+
const isPlayButtonClickable = shouldRenderPlayButton() && !!disableOverlay;
|
|
207
|
+
const isTickBoxSelectable = !disableOverlay && !!selectable && !selected;
|
|
208
|
+
// Disable tooltip for Media Single
|
|
209
|
+
const shouldDisplayTooltip = !disableOverlay && !shouldHideTooltip;
|
|
210
|
+
const hasTitleBox = !!(renderTitleBox || renderFailedTitleBox);
|
|
211
|
+
const {
|
|
212
|
+
mediaType,
|
|
213
|
+
mimeType,
|
|
214
|
+
name,
|
|
215
|
+
createdAt
|
|
216
|
+
} = metadata || {};
|
|
217
|
+
const actionsWithDetails = metadata && actions ? attachDetailsToActions(actions, metadata) : [];
|
|
218
|
+
const content = jsx(React.Fragment, null, jsx("div", {
|
|
219
|
+
css: cardImageContainerStyles,
|
|
220
|
+
className: fileCardImageViewSelector,
|
|
221
|
+
"data-testid": fileCardImageViewSelector,
|
|
222
|
+
"data-test-media-name": name,
|
|
223
|
+
"data-test-status": status,
|
|
224
|
+
"data-test-progress": progress,
|
|
225
|
+
"data-test-selected": selected
|
|
226
|
+
}, renderTypeIcon && jsx(IconWrapper, {
|
|
227
|
+
breakpoint: breakpoint,
|
|
228
|
+
hasTitleBox: hasTitleBox
|
|
229
|
+
}, jsx(MimeTypeIcon, {
|
|
230
|
+
testId: "media-card-file-type-icon",
|
|
231
|
+
mediaType: mediaType,
|
|
232
|
+
mimeType: mimeType,
|
|
233
|
+
name: name
|
|
234
|
+
}), iconMessage), renderSpinner && jsx(IconWrapper, {
|
|
235
|
+
breakpoint: breakpoint,
|
|
236
|
+
hasTitleBox: hasTitleBox
|
|
237
|
+
}, jsx(SpinnerIcon, {
|
|
238
|
+
testId: "media-card-loading"
|
|
239
|
+
})), renderImageRenderer && !!cardPreview && jsx(ImageRenderer, {
|
|
240
|
+
cardPreview: cardPreview,
|
|
241
|
+
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
242
|
+
alt: alt,
|
|
243
|
+
resizeMode: resizeMode,
|
|
244
|
+
onDisplayImage: onDisplayImage,
|
|
245
|
+
onImageLoad: handleOnImageLoad,
|
|
246
|
+
onImageError: handleOnImageError,
|
|
247
|
+
nativeLazyLoad: nativeLazyLoad,
|
|
248
|
+
forceSyncDisplay: forceSyncDisplay
|
|
249
|
+
}), renderPlayButton && jsx(IconWrapper, {
|
|
250
|
+
breakpoint: breakpoint,
|
|
251
|
+
hasTitleBox: hasTitleBox
|
|
252
|
+
}, jsx(PlayButton, null)), renderBlanket && jsx(Blanket, {
|
|
253
|
+
isFixed: isFixedBlanket
|
|
254
|
+
}), renderTitleBox && name && jsx(TitleBox, {
|
|
255
|
+
name: name,
|
|
256
|
+
createdAt: createdAt,
|
|
257
|
+
breakpoint: breakpoint,
|
|
258
|
+
titleBoxIcon: titleBoxIcon,
|
|
259
|
+
titleBoxBgColor: titleBoxBgColor
|
|
260
|
+
}), renderFailedTitleBox && jsx(FailedTitleBox, {
|
|
261
|
+
breakpoint: breakpoint,
|
|
262
|
+
customMessage: customTitleMessage
|
|
263
|
+
}), renderProgressBar && jsx(ProgressBar, {
|
|
264
|
+
progress: progress,
|
|
265
|
+
breakpoint: breakpoint,
|
|
266
|
+
positionBottom: !hasTitleBox
|
|
267
|
+
}), renderTickBox && jsx(TickBox, {
|
|
268
|
+
selected: selected
|
|
269
|
+
})), disableOverlay || !actions || actions.length === 0 ? null : jsx(ActionsBar, {
|
|
270
|
+
actions: actionsWithDetails
|
|
271
|
+
}));
|
|
272
|
+
return jsx(Wrapper, {
|
|
273
|
+
testId: testId || 'media-card-view',
|
|
274
|
+
dimensions: dimensions,
|
|
275
|
+
appearance: appearance,
|
|
276
|
+
onClick: onClick,
|
|
277
|
+
onMouseEnter: onMouseEnter,
|
|
278
|
+
innerRef: divRef,
|
|
279
|
+
breakpoint: breakpoint,
|
|
280
|
+
mediaCardCursor: mediaCardCursor,
|
|
281
|
+
disableOverlay: !!disableOverlay,
|
|
282
|
+
selected: !!selected,
|
|
283
|
+
displayBackground: shouldDisplayBackground,
|
|
284
|
+
isPlayButtonClickable: isPlayButtonClickable,
|
|
285
|
+
isTickBoxSelectable: isTickBoxSelectable,
|
|
286
|
+
shouldDisplayTooltip: shouldDisplayTooltip
|
|
287
|
+
}, shouldDisplayTooltip ? jsx(Tooltip, {
|
|
288
|
+
content: name,
|
|
289
|
+
position: "bottom",
|
|
290
|
+
tag: "div"
|
|
291
|
+
}, content) : content);
|
|
292
|
+
};
|
|
293
|
+
export const CardViewV2 = withAnalyticsEvents({
|
|
294
|
+
onClick: createAndFireMediaCardEvent({
|
|
295
|
+
eventType: 'ui',
|
|
296
|
+
action: 'clicked',
|
|
297
|
+
actionSubject: 'mediaCard',
|
|
298
|
+
attributes: {}
|
|
299
|
+
})
|
|
300
|
+
})(CardViewV2Base);
|
|
@@ -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.
|
|
40
|
+
packageName: "77.1.1",
|
|
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.
|
|
7
|
+
const packageVersion = "77.1.1";
|
|
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 } from '../utils/ufoExperiences';
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
var packageName = "@atlaskit/media-card";
|
|
43
|
-
var packageVersion = "77.
|
|
43
|
+
var packageVersion = "77.1.1";
|
|
44
44
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
45
45
|
_inherits(CardBase, _Component);
|
|
46
46
|
var _super = _createSuper(CardBase);
|
|
@@ -744,7 +744,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
744
744
|
// and then check if the triggered listener is from the card
|
|
745
745
|
// that contains a div in current window.getSelection()
|
|
746
746
|
// won't work in IE11
|
|
747
|
-
(_getDocument = getDocument()) === null || _getDocument === void 0
|
|
747
|
+
(_getDocument = getDocument()) === null || _getDocument === void 0 || _getDocument.addEventListener('copy', this.fireCopiedEvent);
|
|
748
748
|
}
|
|
749
749
|
}, {
|
|
750
750
|
key: "componentDidUpdate",
|
|
@@ -866,7 +866,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
866
866
|
var _getDocument2;
|
|
867
867
|
this.hasBeenMounted = false;
|
|
868
868
|
this.unsubscribe();
|
|
869
|
-
(_getDocument2 = getDocument()) === null || _getDocument2 === void 0
|
|
869
|
+
(_getDocument2 = getDocument()) === null || _getDocument2 === void 0 || _getDocument2.removeEventListener('copy', this.fireCopiedEvent);
|
|
870
870
|
}
|
|
871
871
|
}, {
|
|
872
872
|
key: "updateStateForIdentifier",
|
|
@@ -936,8 +936,8 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
936
936
|
}, {
|
|
937
937
|
key: "fileAttributes",
|
|
938
938
|
get: function get() {
|
|
939
|
-
var _this$state6
|
|
940
|
-
return getFileAttributes(this.metadata, (_this$state6 = this.state) === null || _this$state6 === void 0
|
|
939
|
+
var _this$state6;
|
|
940
|
+
return getFileAttributes(this.metadata, (_this$state6 = this.state) === null || _this$state6 === void 0 || (_this$state6 = _this$state6.fileState) === null || _this$state6 === void 0 ? void 0 : _this$state6.status);
|
|
941
941
|
}
|
|
942
942
|
}, {
|
|
943
943
|
key: "fireOperationalEvent",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import CardLoader from './cardLoader';
|
|
3
4
|
import CardV2Loader from './v2/cardV2Loader';
|
|
4
|
-
|
|
5
|
+
function CardSwitcher(props) {
|
|
6
|
+
return getBooleanFF('platform.media-experience.cardv2_7zann') ? /*#__PURE__*/React.createElement(CardV2Loader, props) : /*#__PURE__*/React.createElement(CardLoader, props);
|
|
7
|
+
}
|
|
8
|
+
export default CardSwitcher;
|