@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
|
@@ -9,7 +9,6 @@ const relevantFlags = {
|
|
|
9
9
|
observedWidth: true,
|
|
10
10
|
mediaInline: false,
|
|
11
11
|
folderUploads: false,
|
|
12
|
-
mediaUploadApiV2: true,
|
|
13
12
|
memoryCacheLogging: true
|
|
14
13
|
};
|
|
15
14
|
export const LOGGED_FEATURE_FLAGS = filterFeatureFlagNames(relevantFlags);
|
|
@@ -45,7 +44,7 @@ export const getRenderCommencedEventPayload = (fileAttributes, performanceAttrib
|
|
|
45
44
|
}
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
|
-
export const getRenderSucceededEventPayload = (fileAttributes, performanceAttributes, ssrReliability, traceContext) => ({
|
|
47
|
+
export const getRenderSucceededEventPayload = (fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) => ({
|
|
49
48
|
eventType: 'operational',
|
|
50
49
|
action: 'succeeded',
|
|
51
50
|
actionSubject: 'mediaCardRender',
|
|
@@ -54,7 +53,8 @@ export const getRenderSucceededEventPayload = (fileAttributes, performanceAttrib
|
|
|
54
53
|
performanceAttributes,
|
|
55
54
|
status: 'success',
|
|
56
55
|
ssrReliability,
|
|
57
|
-
traceContext
|
|
56
|
+
traceContext,
|
|
57
|
+
metadataTraceContext
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
export const getCacheHitEventPayload = cardPreviewAttributes => ({
|
|
@@ -109,19 +109,27 @@ export const getRenderErrorErrorDetail = error => {
|
|
|
109
109
|
return error.message;
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
+
export const getErrorTraceContext = error => {
|
|
113
|
+
if (isMediaCardError(error) && !!error.secondaryError && isRequestError(error.secondaryError)) {
|
|
114
|
+
var _error$secondaryError;
|
|
115
|
+
|
|
116
|
+
return (_error$secondaryError = error.secondaryError.metadata) === null || _error$secondaryError === void 0 ? void 0 : _error$secondaryError.traceContext;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
112
119
|
export const getRenderErrorRequestMetadata = error => {
|
|
113
120
|
if (isMediaCardError(error) && !!error.secondaryError && isRequestError(error.secondaryError)) {
|
|
114
121
|
return error.secondaryError.metadata;
|
|
115
122
|
}
|
|
116
123
|
};
|
|
117
|
-
export const extractErrorInfo = error => {
|
|
124
|
+
export const extractErrorInfo = (error, metadataTraceContext) => {
|
|
118
125
|
return {
|
|
119
126
|
failReason: getRenderErrorFailReason(error),
|
|
120
127
|
error: getRenderErrorErrorReason(error),
|
|
121
|
-
errorDetail: getRenderErrorErrorDetail(error)
|
|
128
|
+
errorDetail: getRenderErrorErrorDetail(error),
|
|
129
|
+
metadataTraceContext: metadataTraceContext !== null && metadataTraceContext !== void 0 ? metadataTraceContext : getErrorTraceContext(error)
|
|
122
130
|
};
|
|
123
131
|
};
|
|
124
|
-
export const getRenderErrorEventPayload = (fileAttributes, performanceAttributes, error, ssrReliability, traceContext) => ({
|
|
132
|
+
export const getRenderErrorEventPayload = (fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext) => ({
|
|
125
133
|
eventType: 'operational',
|
|
126
134
|
action: 'failed',
|
|
127
135
|
actionSubject: 'mediaCardRender',
|
|
@@ -129,13 +137,27 @@ export const getRenderErrorEventPayload = (fileAttributes, performanceAttributes
|
|
|
129
137
|
fileAttributes,
|
|
130
138
|
performanceAttributes,
|
|
131
139
|
status: 'fail',
|
|
132
|
-
...extractErrorInfo(error),
|
|
140
|
+
...extractErrorInfo(error, metadataTraceContext),
|
|
133
141
|
request: getRenderErrorRequestMetadata(error),
|
|
134
142
|
ssrReliability,
|
|
135
143
|
traceContext
|
|
136
144
|
}
|
|
137
145
|
});
|
|
138
|
-
export const
|
|
146
|
+
export const getErrorEventPayload = (cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext) => ({
|
|
147
|
+
eventType: 'operational',
|
|
148
|
+
action: 'nonCriticalFail',
|
|
149
|
+
actionSubject: 'mediaCardRender',
|
|
150
|
+
attributes: {
|
|
151
|
+
fileAttributes,
|
|
152
|
+
status: 'fail',
|
|
153
|
+
...extractErrorInfo(error, metadataTraceContext),
|
|
154
|
+
request: getRenderErrorRequestMetadata(error),
|
|
155
|
+
ssrReliability,
|
|
156
|
+
traceContext,
|
|
157
|
+
cardStatus
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
export const getRenderFailedFileStatusPayload = (fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) => ({
|
|
139
161
|
eventType: 'operational',
|
|
140
162
|
action: 'failed',
|
|
141
163
|
actionSubject: 'mediaCardRender',
|
|
@@ -145,7 +167,8 @@ export const getRenderFailedFileStatusPayload = (fileAttributes, performanceAttr
|
|
|
145
167
|
status: 'fail',
|
|
146
168
|
failReason: 'failed-processing',
|
|
147
169
|
ssrReliability,
|
|
148
|
-
traceContext
|
|
170
|
+
traceContext,
|
|
171
|
+
metadataTraceContext
|
|
149
172
|
}
|
|
150
173
|
});
|
|
151
174
|
export const getCopiedFilePayload = fileId => ({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N500, N0 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { token } from '@atlaskit/tokens';
|
|
4
3
|
import { borderRadius, size, center } from '@atlaskit/media-ui';
|
|
5
4
|
import { rootStyles } from '../../card/styles';
|
|
6
5
|
import { rgba } from '../../card/styles/mixins';
|
|
@@ -19,7 +18,7 @@ export let CardActionIconButtonVariant;
|
|
|
19
18
|
|
|
20
19
|
const getVariantStyles = variant => {
|
|
21
20
|
return variant === 'filled' ? `
|
|
22
|
-
background-color: ${
|
|
21
|
+
background-color: ${`var(--ds-surface-overlay, ${rgba(N0, 0.8)})`};
|
|
23
22
|
margin-right: 8px;
|
|
24
23
|
|
|
25
24
|
&:last-child {
|
|
@@ -27,11 +26,11 @@ const getVariantStyles = variant => {
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
&:hover {
|
|
30
|
-
background-color: ${
|
|
29
|
+
background-color: ${`var(--ds-surface-overlay-hovered, ${rgba(N0, 0.6)})`}
|
|
31
30
|
}
|
|
32
31
|
` : `
|
|
33
32
|
&:hover {
|
|
34
|
-
background-color: ${
|
|
33
|
+
background-color: ${"var(--ds-background-neutral-subtle-hovered, rgba(9, 30, 66, 0.06))"};
|
|
35
34
|
}
|
|
36
35
|
`;
|
|
37
36
|
};
|
|
@@ -42,7 +41,7 @@ export const cardActionButtonStyles = ({
|
|
|
42
41
|
${center}
|
|
43
42
|
${borderRadius}
|
|
44
43
|
${size(26)}
|
|
45
|
-
color: ${
|
|
44
|
+
color: ${`var(--ds-icon, ${N500})`};
|
|
46
45
|
|
|
47
46
|
&:hover {
|
|
48
47
|
cursor: pointer;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { css, keyframes } from '@emotion/react';
|
|
2
|
-
import { token } from '@atlaskit/tokens';
|
|
3
2
|
import { center, borderRadius } from '@atlaskit/media-ui';
|
|
4
3
|
import { themed } from '@atlaskit/theme/components';
|
|
5
4
|
import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
|
|
@@ -22,14 +21,14 @@ export const wrapperStyles = ({
|
|
|
22
21
|
}) => css`
|
|
23
22
|
${center}
|
|
24
23
|
background: ${themed({
|
|
25
|
-
light:
|
|
26
|
-
dark:
|
|
24
|
+
light: `var(--ds-background-neutral, ${N20})`,
|
|
25
|
+
dark: `var(--ds-background-neutral, ${DN50})`
|
|
27
26
|
})({
|
|
28
27
|
theme
|
|
29
28
|
})};
|
|
30
29
|
color: ${themed({
|
|
31
|
-
light:
|
|
32
|
-
dark:
|
|
30
|
+
light: `var(--ds-icon, ${N50})`,
|
|
31
|
+
dark: `var(--ds-icon, ${DN100})`
|
|
33
32
|
})({
|
|
34
33
|
theme
|
|
35
34
|
})};
|
|
@@ -3,7 +3,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KE
|
|
|
3
3
|
import { MediaCardError } from '../errors';
|
|
4
4
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
5
5
|
const packageName = "@atlaskit/media-card";
|
|
6
|
-
const packageVersion = "74.
|
|
6
|
+
const packageVersion = "74.4.1";
|
|
7
7
|
let concurrentExperience;
|
|
8
8
|
|
|
9
9
|
const getExperience = id => {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/card/card.js
CHANGED
|
@@ -34,7 +34,7 @@ import { getFileDetails } from '../utils/metadata';
|
|
|
34
34
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
35
35
|
import { getFileAttributes, extractErrorInfo, LOGGED_FEATURE_FLAGS } from '../utils/analytics';
|
|
36
36
|
import { isLocalPreviewError, MediaCardError, ensureMediaCardError, ImageLoadError } from '../errors';
|
|
37
|
-
import { fireOperationalEvent as _fireOperationalEvent, fireCommencedEvent as _fireCommencedEvent, fireCopiedEvent, fireScreenEvent } from './cardAnalytics';
|
|
37
|
+
import { fireOperationalEvent as _fireOperationalEvent, fireCommencedEvent as _fireCommencedEvent, fireCopiedEvent, fireScreenEvent, fireNonCriticalErrorEvent } from './cardAnalytics';
|
|
38
38
|
import getDocument from '../utils/document';
|
|
39
39
|
import { StoreSSRDataScript, getSSRData } from '../utils/globalScope';
|
|
40
40
|
import { getCardStateFromFileState, createStateUpdater } from './cardState';
|
|
@@ -44,7 +44,7 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
44
44
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
45
45
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
46
46
|
var packageName = "@atlaskit/media-card";
|
|
47
|
-
var packageVersion = "74.
|
|
47
|
+
var packageVersion = "74.4.1";
|
|
48
48
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
49
49
|
_inherits(CardBase, _Component);
|
|
50
50
|
|
|
@@ -83,7 +83,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
83
83
|
_defineProperty(_assertThisInitialized(_this), "timeElapsedTillCommenced", performance.now());
|
|
84
84
|
|
|
85
85
|
_defineProperty(_assertThisInitialized(_this), "traceContext", {
|
|
86
|
-
traceId: getRandomHex(
|
|
86
|
+
traceId: getRandomHex(8)
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
_defineProperty(_assertThisInitialized(_this), "getImageURLParams", function (_ref) {
|
|
@@ -133,7 +133,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
133
133
|
mediaClient: mediaClient,
|
|
134
134
|
id: id,
|
|
135
135
|
dimensions: dimensions,
|
|
136
|
-
onLocalPreviewError: _this.
|
|
136
|
+
onLocalPreviewError: _this.fireNonCriticalErrorEvent,
|
|
137
137
|
filePreview: isBannedLocalPreview ? undefined : getFilePreviewFromFileState(fileState),
|
|
138
138
|
isRemotePreviewReady: isImageRepresentationReady(fileState),
|
|
139
139
|
imageUrlParams: _this.getImageURLParams(identifier),
|
|
@@ -158,7 +158,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
158
158
|
|
|
159
159
|
_defineProperty(_assertThisInitialized(_this), "refetchSSRPreview", /*#__PURE__*/function () {
|
|
160
160
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(identifier) {
|
|
161
|
-
var _this$props4, mediaClient, _this$props4$dimensio, dimensions, cardPreview;
|
|
161
|
+
var _this$props4, mediaClient, _this$props4$dimensio, dimensions, cardPreview, wrappedError;
|
|
162
162
|
|
|
163
163
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
164
164
|
while (1) {
|
|
@@ -176,14 +176,17 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
176
176
|
cardPreview: cardPreview
|
|
177
177
|
});
|
|
178
178
|
|
|
179
|
-
_context.next =
|
|
179
|
+
_context.next = 12;
|
|
180
180
|
break;
|
|
181
181
|
|
|
182
182
|
case 8:
|
|
183
183
|
_context.prev = 8;
|
|
184
184
|
_context.t0 = _context["catch"](1);
|
|
185
|
+
wrappedError = ensureMediaCardError('remote-preview-fetch-ssr', _context.t0, true);
|
|
185
186
|
|
|
186
|
-
|
|
187
|
+
_this.fireNonCriticalErrorEvent(wrappedError);
|
|
188
|
+
|
|
189
|
+
case 12:
|
|
187
190
|
case "end":
|
|
188
191
|
return _context.stop();
|
|
189
192
|
}
|
|
@@ -227,6 +230,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
227
230
|
// If it's any other error we set status 'error'
|
|
228
231
|
|
|
229
232
|
if (isLocalPreviewError(wrappedError)) {
|
|
233
|
+
// This error should already been logged inside the getCardPreview. No need to log it here.
|
|
230
234
|
_this.safeSetState({
|
|
231
235
|
isBannedLocalPreview: true
|
|
232
236
|
});
|
|
@@ -306,7 +310,7 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
306
310
|
if (isLocal) {
|
|
307
311
|
updateState.isBannedLocalPreview = true;
|
|
308
312
|
|
|
309
|
-
_this.
|
|
313
|
+
_this.fireNonCriticalErrorEvent(error);
|
|
310
314
|
}
|
|
311
315
|
|
|
312
316
|
var _this$props5 = _this.props,
|
|
@@ -368,18 +372,22 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
368
372
|
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, _this.fileAttributes);
|
|
369
373
|
});
|
|
370
374
|
|
|
371
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
372
|
-
|
|
375
|
+
_defineProperty(_assertThisInitialized(_this), "fireNonCriticalErrorEvent", function (error) {
|
|
376
|
+
var createAnalyticsEvent = _this.props.createAnalyticsEvent;
|
|
377
|
+
var fileState = _this.state.fileState;
|
|
378
|
+
createAnalyticsEvent && fireNonCriticalErrorEvent(createAnalyticsEvent, _this.state.status, _this.fileAttributes, _this.ssrReliability, error, _this.traceContext, fileState === null || fileState === void 0 ? void 0 : fileState.metadataTraceContext);
|
|
373
379
|
});
|
|
374
380
|
|
|
375
|
-
_defineProperty(_assertThisInitialized(_this), "safeSetState", function (
|
|
381
|
+
_defineProperty(_assertThisInitialized(_this), "safeSetState", function (newState) {
|
|
376
382
|
if (_this.hasBeenMounted) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
+
/**
|
|
384
|
+
* createStateUpdater helper returns a callback to be passed to setState.
|
|
385
|
+
* It decides wether to update the 'status' depending on the current state vs the input state.
|
|
386
|
+
* From docs: "Both state and props received by the updater function are guaranteed to be up-to-date."
|
|
387
|
+
* 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.
|
|
388
|
+
* If the error persists int the state, it means it is a critical error and should be logged as a failed event for Card
|
|
389
|
+
*/
|
|
390
|
+
_this.setState(createStateUpdater(newState, _this.fireNonCriticalErrorEvent));
|
|
383
391
|
}
|
|
384
392
|
});
|
|
385
393
|
|
|
@@ -978,9 +986,10 @@ export var CardBase = /*#__PURE__*/function (_Component) {
|
|
|
978
986
|
value: function fireOperationalEvent() {
|
|
979
987
|
var _this$state7 = this.state,
|
|
980
988
|
status = _this$state7.status,
|
|
981
|
-
error = _this$state7.error
|
|
989
|
+
error = _this$state7.error,
|
|
990
|
+
fileState = _this$state7.fileState;
|
|
982
991
|
var createAnalyticsEvent = this.props.createAnalyticsEvent;
|
|
983
|
-
createAnalyticsEvent && _fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error, this.traceContext);
|
|
992
|
+
createAnalyticsEvent && _fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error, this.traceContext, fileState === null || fileState === void 0 ? void 0 : fileState.metadataTraceContext);
|
|
984
993
|
completeUfoExperience(this.internalOccurrenceKey, status, this.fileAttributes, this.fileStateFlags, this.ssrReliability, error);
|
|
985
994
|
}
|
|
986
995
|
}, {
|
|
@@ -1,8 +1,9 @@
|
|
|
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
3
|
export var fireOperationalEvent = function fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability) {
|
|
4
4
|
var error = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : new MediaCardError('missing-error-data');
|
|
5
5
|
var traceContext = arguments.length > 6 ? arguments[6] : undefined;
|
|
6
|
+
var metadataTraceContext = arguments.length > 7 ? arguments[7] : undefined;
|
|
6
7
|
|
|
7
8
|
var fireEvent = function fireEvent(payload) {
|
|
8
9
|
return fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
@@ -10,15 +11,15 @@ export var fireOperationalEvent = function fireOperationalEvent(createAnalyticsE
|
|
|
10
11
|
|
|
11
12
|
switch (status) {
|
|
12
13
|
case 'complete':
|
|
13
|
-
fireEvent(getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext));
|
|
14
|
+
fireEvent(getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext));
|
|
14
15
|
break;
|
|
15
16
|
|
|
16
17
|
case 'failed-processing':
|
|
17
|
-
fireEvent(getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext));
|
|
18
|
+
fireEvent(getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext));
|
|
18
19
|
break;
|
|
19
20
|
|
|
20
21
|
case 'error':
|
|
21
|
-
fireEvent(getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext));
|
|
22
|
+
fireEvent(getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext));
|
|
22
23
|
break;
|
|
23
24
|
}
|
|
24
25
|
};
|
|
@@ -38,4 +39,11 @@ export var fireCopiedEvent = function fireCopiedEvent(createAnalyticsEvent, file
|
|
|
38
39
|
};
|
|
39
40
|
export var fireScreenEvent = function fireScreenEvent(createAnalyticsEvent, fileAttributes) {
|
|
40
41
|
fireMediaCardEvent(getRenderPreviewableCardPayload(fileAttributes), createAnalyticsEvent);
|
|
42
|
+
};
|
|
43
|
+
export var fireNonCriticalErrorEvent = function fireNonCriticalErrorEvent(createAnalyticsEvent, cardStatus, fileAttributes, ssrReliability) {
|
|
44
|
+
var error = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new MediaCardError('missing-error-data');
|
|
45
|
+
var traceContext = arguments.length > 5 ? arguments[5] : undefined;
|
|
46
|
+
var metadataTraceContext = arguments.length > 6 ? arguments[6] : undefined;
|
|
47
|
+
var errorPayload = getErrorEventPayload(cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext);
|
|
48
|
+
fireMediaCardEvent(errorPayload, createAnalyticsEvent);
|
|
41
49
|
};
|
|
@@ -15,7 +15,6 @@ import { jsx } from '@emotion/react';
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { Component } from 'react';
|
|
17
17
|
import cx from 'classnames';
|
|
18
|
-
import { token } from '@atlaskit/tokens';
|
|
19
18
|
import TickIcon from '@atlaskit/icon/glyph/check';
|
|
20
19
|
import { Ellipsify } from '@atlaskit/media-ui'; // We dont require things directly from "utils" to avoid circular dependencies
|
|
21
20
|
|
|
@@ -94,7 +93,7 @@ export var CardOverlay = /*#__PURE__*/function (_Component) {
|
|
|
94
93
|
selected = _this$props2.selected,
|
|
95
94
|
actions = _this$props2.actions;
|
|
96
95
|
var titleText = resolveTitleText(cardStatus, mediaName, error, selected);
|
|
97
|
-
var menuTriggerColor = !persistent ?
|
|
96
|
+
var menuTriggerColor = !persistent ? "var(--ds-icon-inverse, white)" : undefined;
|
|
98
97
|
return jsx(Overlay, {
|
|
99
98
|
hasError: !!error,
|
|
100
99
|
noHover: noHover,
|
|
@@ -12,9 +12,8 @@ import { css } from '@emotion/react';
|
|
|
12
12
|
import { borderRadius, size, ellipsis, absolute } from '@atlaskit/media-ui';
|
|
13
13
|
import { themed } from '@atlaskit/theme/components';
|
|
14
14
|
import * as colors from '@atlaskit/theme/colors';
|
|
15
|
-
import { token } from '@atlaskit/tokens';
|
|
16
15
|
import { rgba, easeOutCubic, transition, antialiased } from '../../styles';
|
|
17
|
-
export var tickBoxStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color: ", ";\n position: absolute;\n top: 8px;\n right: 8px;\n border-radius: 20px;\n color: ", "; /* CLEANUP - TODO FIL-3884: Align color with new design */\n display: flex;\n opacity: 0;\n\n &.selected {\n opacity: 1;\n color: ", ";\n background-color: ", "; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */\n }\n\n /* Enforce dimensions of \"tick\" icon */\n svg {\n position: absolute;\n width: 14px;\n }\n"])), size(14), transition(),
|
|
16
|
+
export var tickBoxStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color: ", ";\n position: absolute;\n top: 8px;\n right: 8px;\n border-radius: 20px;\n color: ", "; /* CLEANUP - TODO FIL-3884: Align color with new design */\n display: flex;\n opacity: 0;\n\n &.selected {\n opacity: 1;\n color: ", ";\n background-color: ", "; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */\n }\n\n /* Enforce dimensions of \"tick\" icon */\n svg {\n position: absolute;\n width: 14px;\n }\n"])), size(14), transition(), "var(--ds-surface-overlay, ".concat(rgba('#ffffff', 0.5), ")"), "var(--ds-icon-subtle, #798599)", "var(--ds-icon-inverse, white)", "var(--ds-icon-selected, #0052cc)");
|
|
18
17
|
|
|
19
18
|
var getOverlayStyles = function getOverlayStyles(_ref) {
|
|
20
19
|
var hasError = _ref.hasError,
|
|
@@ -26,22 +25,22 @@ var getOverlayStyles = function getOverlayStyles(_ref) {
|
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
export var overlayStyles = function overlayStyles(props) {
|
|
29
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", " display: flex;\n justify-content: space-between;\n flex-direction: column;\n background: transparent;\n transition: 0.3s background ", ", 0.3s border-color;\n padding: 16px;\n\n ", "\n &:not(.persistent):hover, &.active {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n\n &.noHover:hover {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n\n .file-type-icon {\n display: block;\n }\n\n &:not(.persistent) {\n &:not(.error, .noHover):hover {\n background-color: ", ";\n }\n\n &.selectable {\n &.selected {\n background-color: ", ";\n\n &:hover {\n /* CLEANUP - TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */\n background-color: ", ";\n }\n\n .title,\n .bottom-row,\n .file-size {\n color: ", ";\n }\n }\n }\n }\n\n &.persistent {\n &:not(.active) {\n overflow: hidden;\n }\n\n .top-row {\n .title {\n transition: opacity 0.3s;\n opacity: 0;\n color: ", ";\n visibility: hidden;\n }\n }\n\n .bottom-row {\n opacity: 0;\n transition: transform 0.2s, opacity 0.5s;\n /* This is the height of the overlay footer, needs to be present now since the parent uses flex and 100% doesn't look right anymore */\n transform: translateY(35px);\n\n .file-type-icon {\n display: none;\n }\n\n .file-size {\n color: ", ";\n display: none;\n }\n }\n\n &:hover,\n &.active {\n background-color: ", ";\n\n .title {\n opacity: 1;\n visibility: visible;\n }\n\n .file-type-icon,\n .file-size {\n display: block;\n }\n\n .bottom-row {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n /* Selectable */\n &.selectable {\n &:hover {\n .tickbox {\n opacity: 1;\n }\n }\n\n &.selected {\n .tickbox {\n background-color: ", " !important;\n color: ", ";\n }\n }\n }\n }\n\n &.error {\n .top-row {\n overflow: visible;\n }\n &:hover,\n &.active {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n }\n"])), size(), absolute(), borderRadius, easeOutCubic, getOverlayStyles(props),
|
|
28
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", " display: flex;\n justify-content: space-between;\n flex-direction: column;\n background: transparent;\n transition: 0.3s background ", ", 0.3s border-color;\n padding: 16px;\n\n ", "\n &:not(.persistent):hover, &.active {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n\n &.noHover:hover {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n\n .file-type-icon {\n display: block;\n }\n\n &:not(.persistent) {\n &:not(.error, .noHover):hover {\n background-color: ", ";\n }\n\n &.selectable {\n &.selected {\n background-color: ", ";\n\n &:hover {\n /* CLEANUP - TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */\n background-color: ", ";\n }\n\n .title,\n .bottom-row,\n .file-size {\n color: ", ";\n }\n }\n }\n }\n\n &.persistent {\n &:not(.active) {\n overflow: hidden;\n }\n\n .top-row {\n .title {\n transition: opacity 0.3s;\n opacity: 0;\n color: ", ";\n visibility: hidden;\n }\n }\n\n .bottom-row {\n opacity: 0;\n transition: transform 0.2s, opacity 0.5s;\n /* This is the height of the overlay footer, needs to be present now since the parent uses flex and 100% doesn't look right anymore */\n transform: translateY(35px);\n\n .file-type-icon {\n display: none;\n }\n\n .file-size {\n color: ", ";\n display: none;\n }\n }\n\n &:hover,\n &.active {\n background-color: ", ";\n\n .title {\n opacity: 1;\n visibility: visible;\n }\n\n .file-type-icon,\n .file-size {\n display: block;\n }\n\n .bottom-row {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n /* Selectable */\n &.selectable {\n &:hover {\n .tickbox {\n opacity: 1;\n }\n }\n\n &.selected {\n .tickbox {\n background-color: ", " !important;\n color: ", ";\n }\n }\n }\n }\n\n &.error {\n .top-row {\n overflow: visible;\n }\n &:hover,\n &.active {\n .top-row {\n .title {\n color: ", ";\n }\n }\n }\n }\n"])), size(), absolute(), borderRadius, easeOutCubic, getOverlayStyles(props), "var(--ds-text-information, ".concat(colors.B400, ")"), "var(--ds-text, ".concat(colors.N800, ")"), "var(--ds-background-neutral-hovered, ".concat(rgba(colors.N900, 0.06), ")"), "var(--ds-background-selected, ".concat(colors.B200, ")"), "var(--ds-background-selected-hovered, ".concat(rgba(colors.N900, 0.16), ")"), "var(--ds-text, ".concat(colors.N900, ")"), "var(--ds-text, white)", "var(--ds-text, white)", "var(--ds-interaction-hovered, ".concat(rgba(colors.N900, 0.5), ")"), "var(--ds-background-selected-bold, ".concat(colors.B200, ")"), "var(--ds-icon-inverse, white)", "var(--ds-text, ".concat(colors.N800, ")"));
|
|
30
29
|
};
|
|
31
30
|
export var errorLineStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 24px;\n display: flex;\n align-items: center;\n"])));
|
|
32
31
|
export var leftColumnStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n position: relative;\n box-sizing: border-box;\n vertical-align: middle;\n"])));
|
|
33
32
|
export var topRowStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral([""])));
|
|
34
33
|
export var bottomRowStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: 16px;\n"])));
|
|
35
34
|
export var rightColumnStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral([""])));
|
|
36
|
-
export var errorMessageStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", " display: inline-block;\n vertical-align: middle;\n font-weight: bold;\n color: ", ";\n font-size: 12px;\n line-height: 15px;\n overflow: hidden;\n max-width: 'calc(100% - 24px)';\n text-overflow: ellipsis;\n white-space: nowrap;\n margin: auto 3px;\n"])), antialiased,
|
|
35
|
+
export var errorMessageStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", " display: inline-block;\n vertical-align: middle;\n font-weight: bold;\n color: ", ";\n font-size: 12px;\n line-height: 15px;\n overflow: hidden;\n max-width: 'calc(100% - 24px)';\n text-overflow: ellipsis;\n white-space: nowrap;\n margin: auto 3px;\n"])), antialiased, "var(--ds-text-subtlest, ".concat(colors.N70, ")"));
|
|
37
36
|
export var altWrapperStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", "\n font-weight: normal;\n"])), errorMessageStyles);
|
|
38
37
|
export var titleWrapperStyles = function titleWrapperStyles(theme) {
|
|
39
38
|
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n word-wrap: break-word;\n color: ", ";\n font-size: 12px;\n line-height: 18px;\n"])), themed({
|
|
40
|
-
light:
|
|
41
|
-
dark:
|
|
39
|
+
light: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
40
|
+
dark: "var(--ds-text, ".concat(colors.DN900, ")")
|
|
42
41
|
})({
|
|
43
42
|
theme: theme
|
|
44
43
|
}));
|
|
45
44
|
};
|
|
46
|
-
export var subtitleStyles = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", " font-size: 12px;\n color: ", ";\n"])), ellipsis('100px'),
|
|
45
|
+
export var subtitleStyles = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", " font-size: 12px;\n color: ", ";\n"])), ellipsis('100px'), "var(--ds-text-subtlest, #5e6c84)");
|
|
47
46
|
export var metadataStyles = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
|
|
@@ -13,7 +13,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
/**@jsx jsx */
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
15
|
import React, { Component } from 'react';
|
|
16
|
-
import { token } from '@atlaskit/tokens';
|
|
17
16
|
import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
|
|
18
17
|
import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
|
|
19
18
|
import { CardOverlay } from './cardOverlay';
|
|
@@ -233,7 +232,7 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
|
|
|
233
232
|
css: cardActionsWrapperStyles
|
|
234
233
|
}, actions ? jsx(CardActions, {
|
|
235
234
|
actions: actions,
|
|
236
|
-
triggerColor:
|
|
235
|
+
triggerColor: "var(--ds-icon-inverse, white)"
|
|
237
236
|
}) : null))));
|
|
238
237
|
});
|
|
239
238
|
|
|
@@ -3,7 +3,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
6
|
import { absolute, borderRadius, size } from '@atlaskit/media-ui';
|
|
8
7
|
import { themed } from '@atlaskit/theme/components';
|
|
9
8
|
import { N20, DN50, N0 } from '@atlaskit/theme/colors';
|
|
@@ -18,21 +17,21 @@ var getShadowAttribute = function getShadowAttribute(props) {
|
|
|
18
17
|
var getBackgroundColor = function getBackgroundColor(props) {
|
|
19
18
|
var mediaType = props.mediaType;
|
|
20
19
|
return "background: ".concat(mediaType === 'image' ? 'transparent' : themed({
|
|
21
|
-
light:
|
|
22
|
-
dark:
|
|
20
|
+
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
21
|
+
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
23
22
|
})(props), ";");
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export var wrapperStyles = function wrapperStyles(props) {
|
|
27
26
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n ", "\n\n line-height: normal;\n position: relative;\n\n ", "\n\n ", " .wrapper {\n ", ";\n display: block;\n height: inherit;\n position: relative;\n\n .img-wrapper {\n position: relative;\n width: inherit;\n height: inherit;\n overflow: hidden;\n display: block;\n ", "\n }\n }\n"])), rootStyles(), getShadowAttribute(props), borderRadius, getBackgroundColor(props), getSelectedBorderStyle(props), size(), borderRadius, borderRadius);
|
|
28
27
|
};
|
|
29
|
-
export var playIconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n\n /* we want to override default icon size and hover state */\n &:hover > * {\n width: 64px;\n height: 64px;\n }\n"])),
|
|
30
|
-
export var playIconBackgroundStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: 100%;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition-property: width, height;\n transition-duration: 0.1s;\n width: 56px;\n height: 56px;\n"])),
|
|
28
|
+
export var playIconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ", ";\n\n /* we want to override default icon size and hover state */\n &:hover > * {\n width: 64px;\n height: 64px;\n }\n"])), "var(--ds-icon-inverse, white)");
|
|
29
|
+
export var playIconBackgroundStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: 100%;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition-property: width, height;\n transition-duration: 0.1s;\n width: 56px;\n height: 56px;\n"])), "var(--ds-background-neutral-bold, rgba(23, 43, 77, 0.7))");
|
|
31
30
|
var bodyHeight = 26;
|
|
32
31
|
export var progressBarWrapperStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n height: 100%;\n width: 100%;\n"])));
|
|
33
|
-
export var overlayStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", "\n ", "\n border-radius: inherit;\n background-color: ", ";\n"])), absolute(), size(),
|
|
34
|
-
export var titleStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", " width: 100%;\n padding: 8px;\n color: ", ";\n font-size: 12px;\n line-height: 18px;\n word-wrap: break-word;\n"])), absolute(),
|
|
35
|
-
export var bodyStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n position: absolute;\n bottom: 0;\n width: 100%;\n padding: 8px;\n color: ", ";\n"])),
|
|
32
|
+
export var overlayStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", "\n ", "\n border-radius: inherit;\n background-color: ", ";\n"])), absolute(), size(), "var(--ds-blanket, rgba(9, 30, 66, 0.5))");
|
|
33
|
+
export var titleStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", " width: 100%;\n padding: 8px;\n color: ", ";\n font-size: 12px;\n line-height: 18px;\n word-wrap: break-word;\n"])), absolute(), "var(--ds-text-inverse, ".concat(N0, ")"));
|
|
34
|
+
export var bodyStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n position: absolute;\n bottom: 0;\n width: 100%;\n padding: 8px;\n color: ", ";\n"])), "var(--ds-text-inverse, ".concat(N0, ")"));
|
|
36
35
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
37
36
|
|
|
38
37
|
export var progressWrapperStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n flex-grow: 1;\n\n /*\n force the height to always be 20px (the height of the cancel icon),\n so that the height of the progress bar doesn't jump when cards with\n and without a cancel icon are rendered side-by-side.\n */\n height: ", "px;\n\n /*\n vertically center the progress bar within the 20px, keeping the progress bar full width\n */\n display: flex;\n flex-direction: column;\n justify-content: center;\n"])), bodyHeight);
|
|
@@ -26,7 +26,7 @@ var MediaCardErrorBoundary = Loadable({
|
|
|
26
26
|
loader: function loader() {
|
|
27
27
|
return import(
|
|
28
28
|
/* webpackChunkName: "@atlaskit-internal_media-card-error-boundary" */
|
|
29
|
-
'
|
|
29
|
+
'./media-card-analytics-error-boundary').then(function (mod) {
|
|
30
30
|
return mod.default;
|
|
31
31
|
});
|
|
32
32
|
},
|
|
@@ -52,12 +52,21 @@ var MediaCardWithMediaClient = Loadable({
|
|
|
52
52
|
|
|
53
53
|
var CardWithMediaClient = function CardWithMediaClient(props) {
|
|
54
54
|
var withMediaClient = props.withMediaClient,
|
|
55
|
-
|
|
55
|
+
dimensions = props.dimensions,
|
|
56
|
+
featureFlags = props.featureFlags,
|
|
57
|
+
onClick = props.onClick;
|
|
56
58
|
var memoizedFeatureFlags = useMemoizeFeatureFlags(featureFlags);
|
|
57
59
|
var Card = React.useMemo(function () {
|
|
58
60
|
return withMediaClient(MediaCard, memoizedFeatureFlags);
|
|
59
61
|
}, [withMediaClient, memoizedFeatureFlags]);
|
|
60
|
-
return
|
|
62
|
+
return (
|
|
63
|
+
/*#__PURE__*/
|
|
64
|
+
// onClick is passed into MediaCardErrorBoundary so MediaGroup items can get the toolbar menu in Editor
|
|
65
|
+
React.createElement(MediaCardErrorBoundary, {
|
|
66
|
+
dimensions: dimensions,
|
|
67
|
+
onClick: onClick
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Card, props))
|
|
69
|
+
);
|
|
61
70
|
};
|
|
62
71
|
|
|
63
72
|
var CardLoader = function CardLoader(props) {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
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) { _defineProperty(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; }
|
|
6
|
-
|
|
7
1
|
import { isErrorFileState } from '@atlaskit/media-client';
|
|
8
2
|
import { MediaCardError } from '../errors';
|
|
9
3
|
import { getCardStatus, isFinalCardStatus } from './getCardStatus';
|
|
10
4
|
import { extractFilePreviewStatus } from './getCardPreview';
|
|
11
|
-
|
|
5
|
+
/**
|
|
6
|
+
* From docs: "Both state and props received by the updater function are guaranteed to be up-to-date.
|
|
7
|
+
* The output of the updater is shallowly merged with state."
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export var createStateUpdater = function createStateUpdater(newState, fireErrorEvent) {
|
|
12
11
|
return function (prevState) {
|
|
13
|
-
// Only override if previous status is non-final
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
// Only override if previous status is non-final or new status is 'complete'
|
|
13
|
+
if (!!newState.status && isFinalCardStatus(prevState.status) && newState.status !== 'complete') {
|
|
14
|
+
// Log the error if the new state is not going to store it.
|
|
15
|
+
// i.e. this is a non critical error
|
|
16
|
+
!!newState.error && fireErrorEvent(newState.error);
|
|
16
17
|
return prevState;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
return
|
|
20
|
+
return newState;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
export var getCardStateFromFileState = function getCardStateFromFileState(fileState, isBannedLocalPreview, featureFlags) {
|