@atlaskit/media-card 74.3.2 → 74.4.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 +23 -0
- package/dist/cjs/card/card.js +27 -18
- package/dist/cjs/card/cardAnalytics.js +16 -5
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +1 -3
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +6 -8
- package/dist/cjs/card/cardImageView/fileCardImageView.js +1 -3
- package/dist/cjs/card/cardImageView/styles.js +7 -9
- package/dist/cjs/card/cardLoader.js +12 -3
- package/dist/cjs/card/cardState.js +11 -13
- package/dist/cjs/card/media-card-analytics-error-boundary.js +129 -0
- package/dist/cjs/card/styles/index.js +1 -3
- package/dist/cjs/card/ui/blanket/styles.js +1 -3
- package/dist/cjs/card/ui/iconMessage/styles.js +1 -3
- package/dist/cjs/card/ui/loadingRateLimited/styles.js +1 -3
- package/dist/cjs/card/ui/newFileExperience/newFileExperienceWrapper.js +5 -1
- package/dist/cjs/card/ui/newFileExperience/styles.js +12 -4
- package/dist/cjs/card/ui/playButton/styles.js +2 -4
- package/dist/cjs/card/ui/styles.js +1 -3
- package/dist/cjs/card/ui/tickBox/styles.js +2 -4
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +1 -3
- package/dist/cjs/card/ui/titleBox/styles.js +19 -5
- package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +5 -1
- package/dist/cjs/card/ui/unhandledErrorCard/index.js +112 -0
- package/dist/cjs/card/ui/unhandledErrorCard/types.js +5 -0
- package/dist/cjs/errors.js +12 -3
- package/dist/cjs/inline/loader.js +4 -4
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +113 -0
- package/dist/cjs/utils/analytics.js +41 -10
- package/dist/cjs/utils/cardActions/styles.js +2 -4
- package/dist/cjs/utils/errorIcon/styles.js +1 -3
- package/dist/cjs/utils/lightCards/styles.js +4 -6
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +29 -17
- package/dist/es2019/card/cardAnalytics.js +9 -5
- package/dist/es2019/card/cardImageView/cardOverlay/index.js +1 -2
- package/dist/es2019/card/cardImageView/cardOverlay/styles.js +20 -21
- package/dist/es2019/card/cardImageView/fileCardImageView.js +1 -2
- package/dist/es2019/card/cardImageView/styles.js +7 -8
- package/dist/es2019/card/cardLoader.js +12 -3
- package/dist/es2019/card/cardState.js +12 -7
- package/dist/es2019/card/media-card-analytics-error-boundary.js +90 -0
- package/dist/es2019/card/styles/index.js +1 -2
- package/dist/es2019/card/ui/blanket/styles.js +1 -2
- package/dist/es2019/card/ui/iconMessage/styles.js +1 -2
- package/dist/es2019/card/ui/loadingRateLimited/styles.js +1 -2
- package/dist/es2019/card/ui/newFileExperience/newFileExperienceWrapper.js +4 -1
- package/dist/es2019/card/ui/newFileExperience/styles.js +10 -3
- package/dist/es2019/card/ui/playButton/styles.js +2 -3
- package/dist/es2019/card/ui/styles.js +1 -2
- package/dist/es2019/card/ui/tickBox/styles.js +4 -5
- package/dist/es2019/card/ui/titleBox/failedTitleBox.js +1 -2
- package/dist/es2019/card/ui/titleBox/styles.js +20 -7
- package/dist/es2019/card/ui/titleBox/titleBoxComponents.js +4 -1
- package/dist/es2019/card/ui/unhandledErrorCard/index.js +79 -0
- package/dist/es2019/card/ui/unhandledErrorCard/types.js +1 -0
- package/dist/es2019/errors.js +13 -2
- package/dist/es2019/inline/loader.js +4 -4
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +75 -0
- package/dist/es2019/utils/analytics.js +32 -9
- package/dist/es2019/utils/cardActions/styles.js +4 -5
- package/dist/es2019/utils/errorIcon/styles.js +1 -2
- package/dist/es2019/utils/lightCards/styles.js +4 -5
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +28 -19
- package/dist/esm/card/cardAnalytics.js +12 -4
- package/dist/esm/card/cardImageView/cardOverlay/index.js +1 -2
- package/dist/esm/card/cardImageView/cardOverlay/styles.js +6 -7
- package/dist/esm/card/cardImageView/fileCardImageView.js +1 -2
- package/dist/esm/card/cardImageView/styles.js +7 -8
- package/dist/esm/card/cardLoader.js +12 -3
- package/dist/esm/card/cardState.js +12 -11
- package/dist/esm/card/media-card-analytics-error-boundary.js +115 -0
- package/dist/esm/card/styles/index.js +1 -2
- package/dist/esm/card/ui/blanket/styles.js +1 -2
- package/dist/esm/card/ui/iconMessage/styles.js +1 -2
- package/dist/esm/card/ui/loadingRateLimited/styles.js +1 -2
- package/dist/esm/card/ui/newFileExperience/newFileExperienceWrapper.js +4 -1
- package/dist/esm/card/ui/newFileExperience/styles.js +10 -3
- package/dist/esm/card/ui/playButton/styles.js +2 -3
- package/dist/esm/card/ui/styles.js +1 -2
- package/dist/esm/card/ui/tickBox/styles.js +2 -3
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +1 -2
- package/dist/esm/card/ui/titleBox/styles.js +19 -5
- package/dist/esm/card/ui/titleBox/titleBoxComponents.js +4 -1
- package/dist/esm/card/ui/unhandledErrorCard/index.js +93 -0
- package/dist/esm/card/ui/unhandledErrorCard/types.js +1 -0
- package/dist/esm/errors.js +12 -3
- package/dist/esm/inline/loader.js +5 -5
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +99 -0
- package/dist/esm/utils/analytics.js +34 -9
- package/dist/esm/utils/cardActions/styles.js +2 -3
- package/dist/esm/utils/errorIcon/styles.js +1 -2
- package/dist/esm/utils/lightCards/styles.js +4 -5
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/card/card.d.ts +1 -1
- package/dist/types/card/cardAnalytics.d.ts +2 -1
- package/dist/types/card/cardState.d.ts +6 -1
- package/dist/types/card/getCardPreview/index.d.ts +1 -1
- package/dist/types/card/media-card-analytics-error-boundary.d.ts +14 -0
- package/dist/types/card/ui/newFileExperience/styles.d.ts +1 -1
- package/dist/types/card/ui/newFileExperience/types.d.ts +2 -0
- package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
- package/dist/types/card/ui/titleBox/types.d.ts +2 -0
- package/dist/types/card/ui/unhandledErrorCard/index.d.ts +7 -0
- package/dist/types/card/ui/unhandledErrorCard/types.d.ts +6 -0
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +11 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/types/utils/analytics.d.ts +26 -6
- package/example-helpers/styles.ts +13 -0
- package/package.json +9 -8
- package/report.api.md +18 -2
- package/dist/cjs/utils/media-card-analytics-error-boundary.js +0 -59
- package/dist/es2019/utils/media-card-analytics-error-boundary.js +0 -19
- package/dist/esm/utils/media-card-analytics-error-boundary.js +0 -46
- package/dist/types/utils/media-card-analytics-error-boundary.d.ts +0 -10
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.extractErrorInfo = exports.createAndFireMediaCardEvent = exports.LOGGED_FEATURE_FLAG_KEYS = exports.LOGGED_FEATURE_FLAGS = void 0;
|
|
9
9
|
exports.fireMediaCardEvent = fireMediaCardEvent;
|
|
10
|
-
exports.getRenderSucceededEventPayload = exports.getRenderPreviewableCardPayload = exports.getRenderFailedFileStatusPayload = exports.getRenderFailedExternalUriPayload = exports.getRenderErrorRequestMetadata = exports.getRenderErrorFailReason = exports.getRenderErrorEventPayload = exports.getRenderErrorErrorReason = exports.getRenderErrorErrorDetail = exports.getRenderCommencedEventPayload = exports.getRemoteSuccessEventPayload = exports.getFileAttributes = exports.getCopiedFilePayload = exports.getCacheHitEventPayload = void 0;
|
|
10
|
+
exports.getRenderSucceededEventPayload = exports.getRenderPreviewableCardPayload = exports.getRenderFailedFileStatusPayload = exports.getRenderFailedExternalUriPayload = exports.getRenderErrorRequestMetadata = exports.getRenderErrorFailReason = exports.getRenderErrorEventPayload = exports.getRenderErrorErrorReason = exports.getRenderErrorErrorDetail = exports.getRenderCommencedEventPayload = exports.getRemoteSuccessEventPayload = exports.getFileAttributes = exports.getErrorTraceContext = exports.getErrorEventPayload = exports.getCopiedFilePayload = exports.getCacheHitEventPayload = void 0;
|
|
11
11
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
|
|
@@ -30,7 +30,6 @@ var relevantFlags = {
|
|
|
30
30
|
observedWidth: true,
|
|
31
31
|
mediaInline: false,
|
|
32
32
|
folderUploads: false,
|
|
33
|
-
mediaUploadApiV2: true,
|
|
34
33
|
memoryCacheLogging: true
|
|
35
34
|
};
|
|
36
35
|
var LOGGED_FEATURE_FLAGS = (0, _mediaCommon.filterFeatureFlagNames)(relevantFlags);
|
|
@@ -82,7 +81,7 @@ var getRenderCommencedEventPayload = function getRenderCommencedEventPayload(fil
|
|
|
82
81
|
|
|
83
82
|
exports.getRenderCommencedEventPayload = getRenderCommencedEventPayload;
|
|
84
83
|
|
|
85
|
-
var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext) {
|
|
84
|
+
var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) {
|
|
86
85
|
return {
|
|
87
86
|
eventType: 'operational',
|
|
88
87
|
action: 'succeeded',
|
|
@@ -92,7 +91,8 @@ var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fil
|
|
|
92
91
|
performanceAttributes: performanceAttributes,
|
|
93
92
|
status: 'success',
|
|
94
93
|
ssrReliability: ssrReliability,
|
|
95
|
-
traceContext: traceContext
|
|
94
|
+
traceContext: traceContext,
|
|
95
|
+
metadataTraceContext: metadataTraceContext
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
};
|
|
@@ -175,6 +175,16 @@ var getRenderErrorErrorDetail = function getRenderErrorErrorDetail(error) {
|
|
|
175
175
|
|
|
176
176
|
exports.getRenderErrorErrorDetail = getRenderErrorErrorDetail;
|
|
177
177
|
|
|
178
|
+
var getErrorTraceContext = function getErrorTraceContext(error) {
|
|
179
|
+
if ((0, _errors.isMediaCardError)(error) && !!error.secondaryError && (0, _mediaClient.isRequestError)(error.secondaryError)) {
|
|
180
|
+
var _error$secondaryError;
|
|
181
|
+
|
|
182
|
+
return (_error$secondaryError = error.secondaryError.metadata) === null || _error$secondaryError === void 0 ? void 0 : _error$secondaryError.traceContext;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
exports.getErrorTraceContext = getErrorTraceContext;
|
|
187
|
+
|
|
178
188
|
var getRenderErrorRequestMetadata = function getRenderErrorRequestMetadata(error) {
|
|
179
189
|
if ((0, _errors.isMediaCardError)(error) && !!error.secondaryError && (0, _mediaClient.isRequestError)(error.secondaryError)) {
|
|
180
190
|
return error.secondaryError.metadata;
|
|
@@ -183,17 +193,18 @@ var getRenderErrorRequestMetadata = function getRenderErrorRequestMetadata(error
|
|
|
183
193
|
|
|
184
194
|
exports.getRenderErrorRequestMetadata = getRenderErrorRequestMetadata;
|
|
185
195
|
|
|
186
|
-
var extractErrorInfo = function extractErrorInfo(error) {
|
|
196
|
+
var extractErrorInfo = function extractErrorInfo(error, metadataTraceContext) {
|
|
187
197
|
return {
|
|
188
198
|
failReason: getRenderErrorFailReason(error),
|
|
189
199
|
error: getRenderErrorErrorReason(error),
|
|
190
|
-
errorDetail: getRenderErrorErrorDetail(error)
|
|
200
|
+
errorDetail: getRenderErrorErrorDetail(error),
|
|
201
|
+
metadataTraceContext: metadataTraceContext !== null && metadataTraceContext !== void 0 ? metadataTraceContext : getErrorTraceContext(error)
|
|
191
202
|
};
|
|
192
203
|
};
|
|
193
204
|
|
|
194
205
|
exports.extractErrorInfo = extractErrorInfo;
|
|
195
206
|
|
|
196
|
-
var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext) {
|
|
207
|
+
var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext) {
|
|
197
208
|
return {
|
|
198
209
|
eventType: 'operational',
|
|
199
210
|
action: 'failed',
|
|
@@ -202,7 +213,7 @@ var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttribu
|
|
|
202
213
|
fileAttributes: fileAttributes,
|
|
203
214
|
performanceAttributes: performanceAttributes,
|
|
204
215
|
status: 'fail'
|
|
205
|
-
}, extractErrorInfo(error)), {}, {
|
|
216
|
+
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
206
217
|
request: getRenderErrorRequestMetadata(error),
|
|
207
218
|
ssrReliability: ssrReliability,
|
|
208
219
|
traceContext: traceContext
|
|
@@ -212,7 +223,26 @@ var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttribu
|
|
|
212
223
|
|
|
213
224
|
exports.getRenderErrorEventPayload = getRenderErrorEventPayload;
|
|
214
225
|
|
|
215
|
-
var
|
|
226
|
+
var getErrorEventPayload = function getErrorEventPayload(cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext) {
|
|
227
|
+
return {
|
|
228
|
+
eventType: 'operational',
|
|
229
|
+
action: 'nonCriticalFail',
|
|
230
|
+
actionSubject: 'mediaCardRender',
|
|
231
|
+
attributes: _objectSpread(_objectSpread({
|
|
232
|
+
fileAttributes: fileAttributes,
|
|
233
|
+
status: 'fail'
|
|
234
|
+
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
235
|
+
request: getRenderErrorRequestMetadata(error),
|
|
236
|
+
ssrReliability: ssrReliability,
|
|
237
|
+
traceContext: traceContext,
|
|
238
|
+
cardStatus: cardStatus
|
|
239
|
+
})
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
exports.getErrorEventPayload = getErrorEventPayload;
|
|
244
|
+
|
|
245
|
+
var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) {
|
|
216
246
|
return {
|
|
217
247
|
eventType: 'operational',
|
|
218
248
|
action: 'failed',
|
|
@@ -223,7 +253,8 @@ var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload
|
|
|
223
253
|
status: 'fail',
|
|
224
254
|
failReason: 'failed-processing',
|
|
225
255
|
ssrReliability: ssrReliability,
|
|
226
|
-
traceContext: traceContext
|
|
256
|
+
traceContext: traceContext,
|
|
257
|
+
metadataTraceContext: metadataTraceContext
|
|
227
258
|
}
|
|
228
259
|
};
|
|
229
260
|
};
|
|
@@ -13,8 +13,6 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
|
|
16
|
-
var _tokens = require("@atlaskit/tokens");
|
|
17
|
-
|
|
18
16
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
19
17
|
|
|
20
18
|
var _styles = require("../../card/styles");
|
|
@@ -34,12 +32,12 @@ exports.CardActionIconButtonVariant = CardActionIconButtonVariant;
|
|
|
34
32
|
})(CardActionIconButtonVariant || (exports.CardActionIconButtonVariant = CardActionIconButtonVariant = {}));
|
|
35
33
|
|
|
36
34
|
var getVariantStyles = function getVariantStyles(variant) {
|
|
37
|
-
return variant === 'filled' ? "\n background-color: ".concat((
|
|
35
|
+
return variant === 'filled' ? "\n background-color: ".concat("var(--ds-surface-overlay, ".concat((0, _mixins.rgba)(_colors.N0, 0.8), ")"), ";\n margin-right: 8px;\n\n &:last-child {\n margin-right: 0;\n }\n\n &:hover {\n background-color: ", "var(--ds-surface-overlay-hovered, ".concat((0, _mixins.rgba)(_colors.N0, 0.6), ")"), "\n }\n ") : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, rgba(9, 30, 66, 0.06))", ";\n }\n ");
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
var cardActionButtonStyles = function cardActionButtonStyles(_ref) {
|
|
41
39
|
var variant = _ref.variant;
|
|
42
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), _mediaUi.center, _mediaUi.borderRadius, (0, _mediaUi.size)(26), (
|
|
40
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), _mediaUi.center, _mediaUi.borderRadius, (0, _mediaUi.size)(26), "var(--ds-icon, ".concat(_colors.N500, ")"), getVariantStyles(variant));
|
|
43
41
|
};
|
|
44
42
|
|
|
45
43
|
exports.cardActionButtonStyles = cardActionButtonStyles;
|
|
@@ -9,11 +9,9 @@ exports.errorIconWrapperStyles = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _tokens = require("@atlaskit/tokens");
|
|
13
|
-
|
|
14
12
|
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _templateObject;
|
|
17
15
|
|
|
18
|
-
var errorIconWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n color: ", ";\n"])), (
|
|
16
|
+
var errorIconWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n color: ", ";\n"])), "var(--ds-icon-warning, #ff991f)");
|
|
19
17
|
exports.errorIconWrapperStyles = errorIconWrapperStyles;
|
|
@@ -11,8 +11,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
11
11
|
|
|
12
12
|
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
|
-
var _tokens = require("@atlaskit/tokens");
|
|
15
|
-
|
|
16
14
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
17
15
|
|
|
18
16
|
var _components = require("@atlaskit/theme/components");
|
|
@@ -28,13 +26,13 @@ var wrapperStyles = function wrapperStyles(_ref) {
|
|
|
28
26
|
var dimensions = _ref.dimensions,
|
|
29
27
|
theme = _ref.theme;
|
|
30
28
|
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n background: ", ";\n color: ", ";\n ", "\n max-height: 100%;\n max-width: 100%;\n width: ", ";\n height: ", ";\n"])), _mediaUi.center, (0, _components.themed)({
|
|
31
|
-
light: (
|
|
32
|
-
dark: (
|
|
29
|
+
light: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
30
|
+
dark: "var(--ds-background-neutral, ".concat(_colors.DN50, ")")
|
|
33
31
|
})({
|
|
34
32
|
theme: theme
|
|
35
33
|
}), (0, _components.themed)({
|
|
36
|
-
light: (
|
|
37
|
-
dark: (
|
|
34
|
+
light: "var(--ds-icon, ".concat(_colors.N50, ")"),
|
|
35
|
+
dark: "var(--ds-icon, ".concat(_colors.DN100, ")")
|
|
38
36
|
})({
|
|
39
37
|
theme: theme
|
|
40
38
|
}), _mediaUi.borderRadius, dimensions.width, dimensions.height);
|
|
@@ -22,7 +22,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
22
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
23
|
|
|
24
24
|
var packageName = "@atlaskit/media-card";
|
|
25
|
-
var packageVersion = "74.
|
|
25
|
+
var packageVersion = "74.4.1";
|
|
26
26
|
var concurrentExperience;
|
|
27
27
|
|
|
28
28
|
var getExperience = function getExperience(id) {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/card/card.js
CHANGED
|
@@ -16,7 +16,7 @@ import { getFileDetails } from '../utils/metadata';
|
|
|
16
16
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
17
17
|
import { getFileAttributes, extractErrorInfo, LOGGED_FEATURE_FLAGS } from '../utils/analytics';
|
|
18
18
|
import { isLocalPreviewError, MediaCardError, ensureMediaCardError, ImageLoadError } from '../errors';
|
|
19
|
-
import { fireOperationalEvent, fireCommencedEvent, fireCopiedEvent, fireScreenEvent } from './cardAnalytics';
|
|
19
|
+
import { fireOperationalEvent, fireCommencedEvent, fireCopiedEvent, fireScreenEvent, fireNonCriticalErrorEvent } from './cardAnalytics';
|
|
20
20
|
import getDocument from '../utils/document';
|
|
21
21
|
import { StoreSSRDataScript, getSSRData } from '../utils/globalScope';
|
|
22
22
|
import { getCardStateFromFileState, createStateUpdater } from './cardState';
|
|
@@ -26,7 +26,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
26
26
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
27
27
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
28
28
|
const packageName = "@atlaskit/media-card";
|
|
29
|
-
const packageVersion = "74.
|
|
29
|
+
const packageVersion = "74.4.1";
|
|
30
30
|
export class CardBase extends Component {
|
|
31
31
|
// An internalOccurrenceKey is a randomly generated value to differentiate various instances
|
|
32
32
|
// of Cards regardless of whether it shares the same file (either internal or external)
|
|
@@ -57,7 +57,7 @@ export class CardBase extends Component {
|
|
|
57
57
|
_defineProperty(this, "timeElapsedTillCommenced", performance.now());
|
|
58
58
|
|
|
59
59
|
_defineProperty(this, "traceContext", {
|
|
60
|
-
traceId: getRandomHex(
|
|
60
|
+
traceId: getRandomHex(8)
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
_defineProperty(this, "getImageURLParams", ({
|
|
@@ -112,7 +112,7 @@ export class CardBase extends Component {
|
|
|
112
112
|
mediaClient,
|
|
113
113
|
id,
|
|
114
114
|
dimensions,
|
|
115
|
-
onLocalPreviewError: this.
|
|
115
|
+
onLocalPreviewError: this.fireNonCriticalErrorEvent,
|
|
116
116
|
filePreview: isBannedLocalPreview ? undefined : getFilePreviewFromFileState(fileState),
|
|
117
117
|
isRemotePreviewReady: isImageRepresentationReady(fileState),
|
|
118
118
|
imageUrlParams: this.getImageURLParams(identifier),
|
|
@@ -146,8 +146,9 @@ export class CardBase extends Component {
|
|
|
146
146
|
this.safeSetState({
|
|
147
147
|
cardPreview
|
|
148
148
|
});
|
|
149
|
-
} catch (e) {
|
|
150
|
-
|
|
149
|
+
} catch (e) {
|
|
150
|
+
const wrappedError = ensureMediaCardError('remote-preview-fetch-ssr', e, true);
|
|
151
|
+
this.fireNonCriticalErrorEvent(wrappedError);
|
|
151
152
|
}
|
|
152
153
|
});
|
|
153
154
|
|
|
@@ -165,6 +166,7 @@ export class CardBase extends Component {
|
|
|
165
166
|
// If it's any other error we set status 'error'
|
|
166
167
|
|
|
167
168
|
if (isLocalPreviewError(wrappedError)) {
|
|
169
|
+
// This error should already been logged inside the getCardPreview. No need to log it here.
|
|
168
170
|
this.safeSetState({
|
|
169
171
|
isBannedLocalPreview: true
|
|
170
172
|
});
|
|
@@ -234,7 +236,7 @@ export class CardBase extends Component {
|
|
|
234
236
|
|
|
235
237
|
if (isLocal) {
|
|
236
238
|
updateState.isBannedLocalPreview = true;
|
|
237
|
-
this.
|
|
239
|
+
this.fireNonCriticalErrorEvent(error);
|
|
238
240
|
}
|
|
239
241
|
|
|
240
242
|
const {
|
|
@@ -304,17 +306,26 @@ export class CardBase extends Component {
|
|
|
304
306
|
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, this.fileAttributes);
|
|
305
307
|
});
|
|
306
308
|
|
|
307
|
-
_defineProperty(this, "
|
|
308
|
-
|
|
309
|
+
_defineProperty(this, "fireNonCriticalErrorEvent", error => {
|
|
310
|
+
const {
|
|
311
|
+
createAnalyticsEvent
|
|
312
|
+
} = this.props;
|
|
313
|
+
const {
|
|
314
|
+
fileState
|
|
315
|
+
} = this.state;
|
|
316
|
+
createAnalyticsEvent && fireNonCriticalErrorEvent(createAnalyticsEvent, this.state.status, this.fileAttributes, this.ssrReliability, error, this.traceContext, fileState === null || fileState === void 0 ? void 0 : fileState.metadataTraceContext);
|
|
309
317
|
});
|
|
310
318
|
|
|
311
|
-
_defineProperty(this, "safeSetState",
|
|
319
|
+
_defineProperty(this, "safeSetState", newState => {
|
|
312
320
|
if (this.hasBeenMounted) {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
321
|
+
/**
|
|
322
|
+
* createStateUpdater helper returns a callback to be passed to setState.
|
|
323
|
+
* It decides wether to update the 'status' depending on the current state vs the input state.
|
|
324
|
+
* From docs: "Both state and props received by the updater function are guaranteed to be up-to-date."
|
|
325
|
+
* If the input state brings an error and it won't be updating the state, the error will be logged as non-critical inside the helper.
|
|
326
|
+
* If the error persists int the state, it means it is a critical error and should be logged as a failed event for Card
|
|
327
|
+
*/
|
|
328
|
+
this.setState(createStateUpdater(newState, this.fireNonCriticalErrorEvent));
|
|
318
329
|
}
|
|
319
330
|
});
|
|
320
331
|
|
|
@@ -939,12 +950,13 @@ export class CardBase extends Component {
|
|
|
939
950
|
fireOperationalEvent() {
|
|
940
951
|
const {
|
|
941
952
|
status,
|
|
942
|
-
error
|
|
953
|
+
error,
|
|
954
|
+
fileState
|
|
943
955
|
} = this.state;
|
|
944
956
|
const {
|
|
945
957
|
createAnalyticsEvent
|
|
946
958
|
} = this.props;
|
|
947
|
-
createAnalyticsEvent && fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error, this.traceContext);
|
|
959
|
+
createAnalyticsEvent && fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error, this.traceContext, fileState === null || fileState === void 0 ? void 0 : fileState.metadataTraceContext);
|
|
948
960
|
completeUfoExperience(this.internalOccurrenceKey, status, this.fileAttributes, this.fileStateFlags, this.ssrReliability, error);
|
|
949
961
|
}
|
|
950
962
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload, getCopiedFilePayload, getRenderCommencedEventPayload, getRenderPreviewableCardPayload } from '../utils/analytics';
|
|
1
|
+
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload, getCopiedFilePayload, getRenderCommencedEventPayload, getRenderPreviewableCardPayload, getErrorEventPayload } from '../utils/analytics';
|
|
2
2
|
import { MediaCardError } from '../errors';
|
|
3
|
-
export const fireOperationalEvent = (createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error = new MediaCardError('missing-error-data'), traceContext) => {
|
|
3
|
+
export const fireOperationalEvent = (createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error = new MediaCardError('missing-error-data'), traceContext, metadataTraceContext) => {
|
|
4
4
|
const fireEvent = payload => fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
5
5
|
|
|
6
6
|
switch (status) {
|
|
7
7
|
case 'complete':
|
|
8
|
-
fireEvent(getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext));
|
|
8
|
+
fireEvent(getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext));
|
|
9
9
|
break;
|
|
10
10
|
|
|
11
11
|
case 'failed-processing':
|
|
12
|
-
fireEvent(getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext));
|
|
12
|
+
fireEvent(getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext));
|
|
13
13
|
break;
|
|
14
14
|
|
|
15
15
|
case 'error':
|
|
16
|
-
fireEvent(getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext));
|
|
16
|
+
fireEvent(getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext));
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
@@ -33,4 +33,8 @@ export const fireCopiedEvent = (createAnalyticsEvent, fileId, cardRef) => {
|
|
|
33
33
|
};
|
|
34
34
|
export const fireScreenEvent = (createAnalyticsEvent, fileAttributes) => {
|
|
35
35
|
fireMediaCardEvent(getRenderPreviewableCardPayload(fileAttributes), createAnalyticsEvent);
|
|
36
|
+
};
|
|
37
|
+
export const fireNonCriticalErrorEvent = (createAnalyticsEvent, cardStatus, fileAttributes, ssrReliability, error = new MediaCardError('missing-error-data'), traceContext, metadataTraceContext) => {
|
|
38
|
+
const errorPayload = getErrorEventPayload(cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext);
|
|
39
|
+
fireMediaCardEvent(errorPayload, createAnalyticsEvent);
|
|
36
40
|
};
|
|
@@ -5,7 +5,6 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Component } from 'react';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
8
|
import TickIcon from '@atlaskit/icon/glyph/check';
|
|
10
9
|
import { Ellipsify } from '@atlaskit/media-ui'; // We dont require things directly from "utils" to avoid circular dependencies
|
|
11
10
|
|
|
@@ -76,7 +75,7 @@ export class CardOverlay extends Component {
|
|
|
76
75
|
actions
|
|
77
76
|
} = this.props;
|
|
78
77
|
const titleText = resolveTitleText(cardStatus, mediaName, error, selected);
|
|
79
|
-
const menuTriggerColor = !persistent ?
|
|
78
|
+
const menuTriggerColor = !persistent ? "var(--ds-icon-inverse, white)" : undefined;
|
|
80
79
|
return jsx(Overlay, {
|
|
81
80
|
hasError: !!error,
|
|
82
81
|
noHover: noHover,
|
|
@@ -8,24 +8,23 @@ import { css } from '@emotion/react';
|
|
|
8
8
|
import { borderRadius, size, ellipsis, absolute } from '@atlaskit/media-ui';
|
|
9
9
|
import { themed } from '@atlaskit/theme/components';
|
|
10
10
|
import * as colors from '@atlaskit/theme/colors';
|
|
11
|
-
import { token } from '@atlaskit/tokens';
|
|
12
11
|
import { rgba, easeOutCubic, transition, antialiased } from '../../styles';
|
|
13
12
|
export const tickBoxStyles = css`
|
|
14
13
|
${size(14)}
|
|
15
14
|
${transition()}
|
|
16
|
-
background-color: ${
|
|
15
|
+
background-color: ${`var(--ds-surface-overlay, ${rgba('#ffffff', 0.5)})`};
|
|
17
16
|
position: absolute;
|
|
18
17
|
top: 8px;
|
|
19
18
|
right: 8px;
|
|
20
19
|
border-radius: 20px;
|
|
21
|
-
color: ${
|
|
20
|
+
color: ${"var(--ds-icon-subtle, #798599)"}; /* CLEANUP - TODO FIL-3884: Align color with new design */
|
|
22
21
|
display: flex;
|
|
23
22
|
opacity: 0;
|
|
24
23
|
|
|
25
24
|
&.selected {
|
|
26
25
|
opacity: 1;
|
|
27
|
-
color: ${
|
|
28
|
-
background-color: ${
|
|
26
|
+
color: ${"var(--ds-icon-inverse, white)"};
|
|
27
|
+
background-color: ${"var(--ds-icon-selected, #0052cc)"}; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
/* Enforce dimensions of "tick" icon */
|
|
@@ -64,7 +63,7 @@ export const overlayStyles = props => css`
|
|
|
64
63
|
&:not(.persistent):hover, &.active {
|
|
65
64
|
.top-row {
|
|
66
65
|
.title {
|
|
67
|
-
color: ${
|
|
66
|
+
color: ${`var(--ds-text-information, ${colors.B400})`};
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
}
|
|
@@ -72,7 +71,7 @@ export const overlayStyles = props => css`
|
|
|
72
71
|
&.noHover:hover {
|
|
73
72
|
.top-row {
|
|
74
73
|
.title {
|
|
75
|
-
color: ${
|
|
74
|
+
color: ${`var(--ds-text, ${colors.N800})`};
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
}
|
|
@@ -83,22 +82,22 @@ export const overlayStyles = props => css`
|
|
|
83
82
|
|
|
84
83
|
&:not(.persistent) {
|
|
85
84
|
&:not(.error, .noHover):hover {
|
|
86
|
-
background-color: ${
|
|
85
|
+
background-color: ${`var(--ds-background-neutral-hovered, ${rgba(colors.N900, 0.06)})`};
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
&.selectable {
|
|
90
89
|
&.selected {
|
|
91
|
-
background-color: ${
|
|
90
|
+
background-color: ${`var(--ds-background-selected, ${colors.B200})`};
|
|
92
91
|
|
|
93
92
|
&:hover {
|
|
94
93
|
/* CLEANUP - TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */
|
|
95
|
-
background-color: ${
|
|
94
|
+
background-color: ${`var(--ds-background-selected-hovered, ${rgba(colors.N900, 0.16)})`};
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
.title,
|
|
99
98
|
.bottom-row,
|
|
100
99
|
.file-size {
|
|
101
|
-
color: ${
|
|
100
|
+
color: ${`var(--ds-text, ${colors.N900})`};
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
}
|
|
@@ -113,7 +112,7 @@ export const overlayStyles = props => css`
|
|
|
113
112
|
.title {
|
|
114
113
|
transition: opacity 0.3s;
|
|
115
114
|
opacity: 0;
|
|
116
|
-
color: ${
|
|
115
|
+
color: ${"var(--ds-text, white)"};
|
|
117
116
|
visibility: hidden;
|
|
118
117
|
}
|
|
119
118
|
}
|
|
@@ -129,14 +128,14 @@ export const overlayStyles = props => css`
|
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
.file-size {
|
|
132
|
-
color: ${
|
|
131
|
+
color: ${"var(--ds-text, white)"};
|
|
133
132
|
display: none;
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
&:hover,
|
|
138
137
|
&.active {
|
|
139
|
-
background-color: ${
|
|
138
|
+
background-color: ${`var(--ds-interaction-hovered, ${rgba(colors.N900, 0.5)})`};
|
|
140
139
|
|
|
141
140
|
.title {
|
|
142
141
|
opacity: 1;
|
|
@@ -164,8 +163,8 @@ export const overlayStyles = props => css`
|
|
|
164
163
|
|
|
165
164
|
&.selected {
|
|
166
165
|
.tickbox {
|
|
167
|
-
background-color: ${
|
|
168
|
-
color: ${
|
|
166
|
+
background-color: ${`var(--ds-background-selected-bold, ${colors.B200})`} !important;
|
|
167
|
+
color: ${"var(--ds-icon-inverse, white)"};
|
|
169
168
|
}
|
|
170
169
|
}
|
|
171
170
|
}
|
|
@@ -179,7 +178,7 @@ export const overlayStyles = props => css`
|
|
|
179
178
|
&.active {
|
|
180
179
|
.top-row {
|
|
181
180
|
.title {
|
|
182
|
-
color: ${
|
|
181
|
+
color: ${`var(--ds-text, ${colors.N800})`};
|
|
183
182
|
}
|
|
184
183
|
}
|
|
185
184
|
}
|
|
@@ -207,7 +206,7 @@ export const errorMessageStyles = css`
|
|
|
207
206
|
${antialiased} display: inline-block;
|
|
208
207
|
vertical-align: middle;
|
|
209
208
|
font-weight: bold;
|
|
210
|
-
color: ${
|
|
209
|
+
color: ${`var(--ds-text-subtlest, ${colors.N70})`};
|
|
211
210
|
font-size: 12px;
|
|
212
211
|
line-height: 15px;
|
|
213
212
|
overflow: hidden;
|
|
@@ -224,8 +223,8 @@ export const titleWrapperStyles = theme => css`
|
|
|
224
223
|
box-sizing: border-box;
|
|
225
224
|
word-wrap: break-word;
|
|
226
225
|
color: ${themed({
|
|
227
|
-
light:
|
|
228
|
-
dark:
|
|
226
|
+
light: `var(--ds-text, ${colors.N800})`,
|
|
227
|
+
dark: `var(--ds-text, ${colors.DN900})`
|
|
229
228
|
})({
|
|
230
229
|
theme
|
|
231
230
|
})};
|
|
@@ -234,7 +233,7 @@ export const titleWrapperStyles = theme => css`
|
|
|
234
233
|
`;
|
|
235
234
|
export const subtitleStyles = css`
|
|
236
235
|
${ellipsis('100px')} font-size: 12px;
|
|
237
|
-
color: ${
|
|
236
|
+
color: ${"var(--ds-text-subtlest, #5e6c84)"};
|
|
238
237
|
`;
|
|
239
238
|
export const metadataStyles = css`
|
|
240
239
|
display: flex;
|
|
@@ -3,7 +3,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
/**@jsx jsx */
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import React, { Component } from 'react';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
6
|
import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
|
|
8
7
|
import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
|
|
9
8
|
import { CardOverlay } from './cardOverlay';
|
|
@@ -220,7 +219,7 @@ export class FileCardImageView extends Component {
|
|
|
220
219
|
css: cardActionsWrapperStyles
|
|
221
220
|
}, actions ? jsx(CardActions, {
|
|
222
221
|
actions: actions,
|
|
223
|
-
triggerColor:
|
|
222
|
+
triggerColor: "var(--ds-icon-inverse, white)"
|
|
224
223
|
}) : null))));
|
|
225
224
|
});
|
|
226
225
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import { token } from '@atlaskit/tokens';
|
|
3
2
|
import { absolute, borderRadius, size } from '@atlaskit/media-ui';
|
|
4
3
|
import { themed } from '@atlaskit/theme/components';
|
|
5
4
|
import { N20, DN50, N0 } from '@atlaskit/theme/colors';
|
|
@@ -18,8 +17,8 @@ const getBackgroundColor = props => {
|
|
|
18
17
|
mediaType
|
|
19
18
|
} = props;
|
|
20
19
|
return `background: ${mediaType === 'image' ? 'transparent' : themed({
|
|
21
|
-
light:
|
|
22
|
-
dark:
|
|
20
|
+
light: `var(--ds-background-neutral, ${N20})`,
|
|
21
|
+
dark: `var(--ds-background-neutral, ${DN50})`
|
|
23
22
|
})(props)};`;
|
|
24
23
|
};
|
|
25
24
|
|
|
@@ -59,7 +58,7 @@ export const playIconWrapperStyles = css`
|
|
|
59
58
|
display: flex;
|
|
60
59
|
align-items: center;
|
|
61
60
|
justify-content: center;
|
|
62
|
-
color: ${
|
|
61
|
+
color: ${"var(--ds-icon-inverse, white)"};
|
|
63
62
|
|
|
64
63
|
/* we want to override default icon size and hover state */
|
|
65
64
|
&:hover > * {
|
|
@@ -68,7 +67,7 @@ export const playIconWrapperStyles = css`
|
|
|
68
67
|
}
|
|
69
68
|
`;
|
|
70
69
|
export const playIconBackgroundStyles = css`
|
|
71
|
-
background: ${
|
|
70
|
+
background: ${"var(--ds-background-neutral-bold, rgba(23, 43, 77, 0.7))"};
|
|
72
71
|
border-radius: 100%;
|
|
73
72
|
padding: 10px;
|
|
74
73
|
display: flex;
|
|
@@ -89,12 +88,12 @@ export const overlayStyles = css`
|
|
|
89
88
|
${absolute()}
|
|
90
89
|
${size()}
|
|
91
90
|
border-radius: inherit;
|
|
92
|
-
background-color: ${
|
|
91
|
+
background-color: ${"var(--ds-blanket, rgba(9, 30, 66, 0.5))"};
|
|
93
92
|
`;
|
|
94
93
|
export const titleStyles = css`
|
|
95
94
|
${absolute()} width: 100%;
|
|
96
95
|
padding: 8px;
|
|
97
|
-
color: ${
|
|
96
|
+
color: ${`var(--ds-text-inverse, ${N0})`};
|
|
98
97
|
font-size: 12px;
|
|
99
98
|
line-height: 18px;
|
|
100
99
|
word-wrap: break-word;
|
|
@@ -105,7 +104,7 @@ export const bodyStyles = css`
|
|
|
105
104
|
bottom: 0;
|
|
106
105
|
width: 100%;
|
|
107
106
|
padding: 8px;
|
|
108
|
-
color: ${
|
|
107
|
+
color: ${`var(--ds-text-inverse, ${N0})`};
|
|
109
108
|
`;
|
|
110
109
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
111
110
|
|
|
@@ -19,7 +19,7 @@ const MediaCard = Loadable({
|
|
|
19
19
|
const MediaCardErrorBoundary = Loadable({
|
|
20
20
|
loader: () => import(
|
|
21
21
|
/* webpackChunkName: "@atlaskit-internal_media-card-error-boundary" */
|
|
22
|
-
'
|
|
22
|
+
'./media-card-analytics-error-boundary').then(mod => mod.default),
|
|
23
23
|
loading: () => /*#__PURE__*/React.createElement(CardLoadingWithContext, null)
|
|
24
24
|
});
|
|
25
25
|
const MediaCardWithMediaClient = Loadable({
|
|
@@ -35,13 +35,22 @@ const MediaCardWithMediaClient = Loadable({
|
|
|
35
35
|
const CardWithMediaClient = props => {
|
|
36
36
|
const {
|
|
37
37
|
withMediaClient,
|
|
38
|
-
|
|
38
|
+
dimensions,
|
|
39
|
+
featureFlags,
|
|
40
|
+
onClick
|
|
39
41
|
} = props;
|
|
40
42
|
const memoizedFeatureFlags = useMemoizeFeatureFlags(featureFlags);
|
|
41
43
|
const Card = React.useMemo(() => {
|
|
42
44
|
return withMediaClient(MediaCard, memoizedFeatureFlags);
|
|
43
45
|
}, [withMediaClient, memoizedFeatureFlags]);
|
|
44
|
-
return
|
|
46
|
+
return (
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
// onClick is passed into MediaCardErrorBoundary so MediaGroup items can get the toolbar menu in Editor
|
|
49
|
+
React.createElement(MediaCardErrorBoundary, {
|
|
50
|
+
dimensions: dimensions,
|
|
51
|
+
onClick: onClick
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Card, props))
|
|
53
|
+
);
|
|
45
54
|
};
|
|
46
55
|
|
|
47
56
|
const CardLoader = props => {
|