@atlaskit/media-card 74.1.9 → 74.3.0
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 +25 -0
- package/dist/cjs/card/card.js +9 -4
- package/dist/cjs/card/cardAnalytics.js +6 -5
- package/dist/cjs/card/cardImageView/cardOverlay/index.js +3 -1
- package/dist/cjs/card/cardImageView/cardOverlay/styles.js +8 -6
- package/dist/cjs/card/cardImageView/fileCardImageView.js +3 -1
- package/dist/cjs/card/cardImageView/styles.js +11 -7
- package/dist/cjs/card/getCardPreview/helpers.js +3 -3
- package/dist/cjs/card/getCardPreview/index.js +6 -6
- package/dist/cjs/card/styles/index.js +3 -1
- package/dist/cjs/card/ui/blanket/styles.js +3 -1
- package/dist/cjs/card/ui/iconMessage/styles.js +3 -1
- package/dist/cjs/card/ui/loadingRateLimited/styles.js +3 -1
- package/dist/cjs/card/ui/newFileExperience/styles.js +3 -1
- package/dist/cjs/card/ui/playButton/styles.js +4 -2
- package/dist/cjs/card/ui/progressBar/styles.js +5 -1
- package/dist/cjs/card/ui/styles.js +3 -1
- package/dist/cjs/card/ui/tickBox/styles.js +4 -2
- package/dist/cjs/card/ui/titleBox/failedTitleBox.js +3 -1
- package/dist/cjs/card/ui/titleBox/styles.js +3 -1
- package/dist/cjs/utils/analytics.js +14 -8
- package/dist/cjs/utils/cardActions/styles.js +6 -2
- package/dist/cjs/utils/errorIcon/styles.js +3 -1
- package/dist/cjs/utils/fileIcon/index.js +1 -1
- package/dist/cjs/utils/lightCards/styles.js +6 -4
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/videoSnapshot.js +36 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +11 -4
- package/dist/es2019/card/cardAnalytics.js +6 -6
- package/dist/es2019/card/cardImageView/cardOverlay/index.js +2 -1
- package/dist/es2019/card/cardImageView/cardOverlay/styles.js +24 -55
- package/dist/es2019/card/cardImageView/fileCardImageView.js +3 -3
- package/dist/es2019/card/cardImageView/styles.js +10 -7
- package/dist/es2019/card/getCardPreview/helpers.js +2 -2
- package/dist/es2019/card/getCardPreview/index.js +5 -4
- package/dist/es2019/card/styles/index.js +2 -1
- package/dist/es2019/card/ui/blanket/styles.js +2 -1
- package/dist/es2019/card/ui/iconMessage/styles.js +2 -1
- package/dist/es2019/card/ui/loadingRateLimited/styles.js +2 -1
- package/dist/es2019/card/ui/newFileExperience/styles.js +9 -8
- package/dist/es2019/card/ui/playButton/styles.js +3 -2
- package/dist/es2019/card/ui/progressBar/styles.js +5 -2
- package/dist/es2019/card/ui/styles.js +2 -1
- package/dist/es2019/card/ui/tickBox/styles.js +5 -4
- package/dist/es2019/card/ui/titleBox/failedTitleBox.js +2 -1
- package/dist/es2019/card/ui/titleBox/styles.js +2 -1
- package/dist/es2019/utils/analytics.js +14 -8
- package/dist/es2019/utils/cardActions/styles.js +6 -5
- package/dist/es2019/utils/errorIcon/styles.js +2 -1
- package/dist/es2019/utils/fileIcon/index.js +1 -1
- package/dist/es2019/utils/lightCards/styles.js +6 -6
- package/dist/es2019/utils/progressBar/styles.js +1 -0
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/utils/videoSnapshot.js +36 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +11 -4
- package/dist/esm/card/cardAnalytics.js +6 -5
- package/dist/esm/card/cardImageView/cardOverlay/index.js +2 -1
- package/dist/esm/card/cardImageView/cardOverlay/styles.js +8 -7
- package/dist/esm/card/cardImageView/fileCardImageView.js +3 -3
- package/dist/esm/card/cardImageView/styles.js +10 -7
- package/dist/esm/card/getCardPreview/helpers.js +3 -3
- package/dist/esm/card/getCardPreview/index.js +6 -6
- package/dist/esm/card/styles/index.js +2 -1
- package/dist/esm/card/ui/blanket/styles.js +2 -1
- package/dist/esm/card/ui/iconMessage/styles.js +2 -1
- package/dist/esm/card/ui/loadingRateLimited/styles.js +2 -1
- package/dist/esm/card/ui/newFileExperience/styles.js +2 -1
- package/dist/esm/card/ui/playButton/styles.js +3 -2
- package/dist/esm/card/ui/progressBar/styles.js +5 -2
- package/dist/esm/card/ui/styles.js +2 -1
- package/dist/esm/card/ui/tickBox/styles.js +3 -2
- package/dist/esm/card/ui/titleBox/failedTitleBox.js +2 -1
- package/dist/esm/card/ui/titleBox/styles.js +2 -1
- package/dist/esm/utils/analytics.js +14 -8
- package/dist/esm/utils/cardActions/styles.js +4 -2
- package/dist/esm/utils/errorIcon/styles.js +2 -1
- package/dist/esm/utils/fileIcon/index.js +1 -1
- package/dist/esm/utils/lightCards/styles.js +6 -6
- package/dist/esm/utils/progressBar/styles.js +1 -0
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/videoSnapshot.js +36 -10
- package/dist/esm/version.json +1 -1
- package/dist/types/card/card.d.ts +1 -0
- package/dist/types/card/cardAnalytics.d.ts +3 -3
- package/dist/types/card/getCardPreview/helpers.d.ts +2 -1
- package/dist/types/card/getCardPreview/index.d.ts +4 -3
- package/dist/types/card/styles/index.d.ts +1 -1
- package/dist/types/utils/analytics.d.ts +8 -8
- package/example-helpers/styles.ts +10 -6
- package/package.json +16 -19
- package/report.api.md +228 -116
- package/dist/cjs/utils/mediaTypeIcon/iconWrapper.js +0 -20
- package/dist/cjs/utils/mediaTypeIcon/index.js +0 -81
- package/dist/cjs/utils/mediaTypeIcon/styles.js +0 -37
- package/dist/cjs/utils/mediaTypeIcon/types.js +0 -5
- package/dist/es2019/utils/mediaTypeIcon/iconWrapper.js +0 -9
- package/dist/es2019/utils/mediaTypeIcon/index.js +0 -35
- package/dist/es2019/utils/mediaTypeIcon/styles.js +0 -22
- package/dist/es2019/utils/mediaTypeIcon/types.js +0 -1
- package/dist/esm/utils/mediaTypeIcon/iconWrapper.js +0 -9
- package/dist/esm/utils/mediaTypeIcon/index.js +0 -59
- package/dist/esm/utils/mediaTypeIcon/styles.js +0 -24
- package/dist/esm/utils/mediaTypeIcon/types.js +0 -1
- package/dist/types/utils/mediaTypeIcon/iconWrapper.d.ts +0 -4
- package/dist/types/utils/mediaTypeIcon/index.d.ts +0 -10
- package/dist/types/utils/mediaTypeIcon/styles.d.ts +0 -2
- package/dist/types/utils/mediaTypeIcon/types.d.ts +0 -6
- package/dist/types-ts4.0/card/actions.d.ts +0 -9
- package/dist/types-ts4.0/card/card.d.ts +0 -59
- package/dist/types-ts4.0/card/cardAnalytics.d.ts +0 -9
- package/dist/types-ts4.0/card/cardConstants.d.ts +0 -1
- package/dist/types-ts4.0/card/cardImageView/cardImageViewWrapper.d.ts +0 -6
- package/dist/types-ts4.0/card/cardImageView/cardOverlay/cardOverlayComponents.d.ts +0 -8
- package/dist/types-ts4.0/card/cardImageView/cardOverlay/index.d.ts +0 -39
- package/dist/types-ts4.0/card/cardImageView/cardOverlay/styles.d.ts +0 -26
- package/dist/types-ts4.0/card/cardImageView/cardViewWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/cardImageView/classnames.d.ts +0 -2
- package/dist/types-ts4.0/card/cardImageView/fileCardImageView.d.ts +0 -49
- package/dist/types-ts4.0/card/cardImageView/index.d.ts +0 -2
- package/dist/types-ts4.0/card/cardImageView/styles.d.ts +0 -24
- package/dist/types-ts4.0/card/cardLoader.d.ts +0 -6
- package/dist/types-ts4.0/card/cardState.d.ts +0 -5
- package/dist/types-ts4.0/card/cardView.d.ts +0 -80
- package/dist/types-ts4.0/card/getCardPreview/cache.d.ts +0 -19
- package/dist/types-ts4.0/card/getCardPreview/filePreviewStatus.d.ts +0 -5
- package/dist/types-ts4.0/card/getCardPreview/helpers.d.ts +0 -9
- package/dist/types-ts4.0/card/getCardPreview/imageRefetchingAnalytics.d.ts +0 -10
- package/dist/types-ts4.0/card/getCardPreview/index.d.ts +0 -57
- package/dist/types-ts4.0/card/getCardStatus.d.ts +0 -4
- package/dist/types-ts4.0/card/index.d.ts +0 -1
- package/dist/types-ts4.0/card/inlinePlayer.d.ts +0 -52
- package/dist/types-ts4.0/card/inlinePlayerLazy.d.ts +0 -2
- package/dist/types-ts4.0/card/inlinePlayerWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/styles/animations.d.ts +0 -1
- package/dist/types-ts4.0/card/styles/config.d.ts +0 -1
- package/dist/types-ts4.0/card/styles/easing.d.ts +0 -2
- package/dist/types-ts4.0/card/styles/getSelectedBorderStyle.d.ts +0 -3
- package/dist/types-ts4.0/card/styles/index.d.ts +0 -9
- package/dist/types-ts4.0/card/styles/mixins.d.ts +0 -21
- package/dist/types-ts4.0/card/styles/styles.d.ts +0 -10
- package/dist/types-ts4.0/card/types.d.ts +0 -24
- package/dist/types-ts4.0/card/ui/actionsBar/actionsBar.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/actionsBar/styles.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/actionsBar/types.d.ts +0 -10
- package/dist/types-ts4.0/card/ui/blanket/blanket.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/blanket/styles.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/common.d.ts +0 -23
- package/dist/types-ts4.0/card/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/iconMessage/index.d.ts +0 -8
- package/dist/types-ts4.0/card/ui/iconMessage/styles.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/iconMessage/types.d.ts +0 -19
- package/dist/types-ts4.0/card/ui/iconWrapper/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/iconWrapper/styles.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/iconWrapper/types.d.ts +0 -6
- package/dist/types-ts4.0/card/ui/imageRenderer/imageRenderer.d.ts +0 -15
- package/dist/types-ts4.0/card/ui/loadingRateLimited/styles.d.ts +0 -13
- package/dist/types-ts4.0/card/ui/newFileExperience/newFileExperienceWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/newFileExperience/styles.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/newFileExperience/types.d.ts +0 -23
- package/dist/types-ts4.0/card/ui/playButton/playButton.d.ts +0 -2
- package/dist/types-ts4.0/card/ui/playButton/playButtonBackground.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/playButton/playButtonWrapper.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/playButton/styles.d.ts +0 -5
- package/dist/types-ts4.0/card/ui/progressBar/progressBar.d.ts +0 -10
- package/dist/types-ts4.0/card/ui/progressBar/styledBar.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/progressBar/styles.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/progressBar/types.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/styles.d.ts +0 -11
- package/dist/types-ts4.0/card/ui/tickBox/styles.d.ts +0 -7
- package/dist/types-ts4.0/card/ui/tickBox/tickBox.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/tickBox/tickBoxWrapper.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/tickBox/types.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/titleBox/failedTitleBox.d.ts +0 -3
- package/dist/types-ts4.0/card/ui/titleBox/styles.d.ts +0 -15
- package/dist/types-ts4.0/card/ui/titleBox/titleBox.d.ts +0 -4
- package/dist/types-ts4.0/card/ui/titleBox/titleBoxComponents.d.ts +0 -8
- package/dist/types-ts4.0/card/ui/titleBox/types.d.ts +0 -32
- package/dist/types-ts4.0/classnames.d.ts +0 -5
- package/dist/types-ts4.0/errors.d.ts +0 -41
- package/dist/types-ts4.0/index.d.ts +0 -15
- package/dist/types-ts4.0/inline/index.d.ts +0 -1
- package/dist/types-ts4.0/inline/loader.d.ts +0 -25
- package/dist/types-ts4.0/inline/mediaInlineCard.d.ts +0 -14
- package/dist/types-ts4.0/types.d.ts +0 -96
- package/dist/types-ts4.0/utils/analytics.d.ts +0 -77
- package/dist/types-ts4.0/utils/breakpoint.d.ts +0 -11
- package/dist/types-ts4.0/utils/cardActions/cardActionButton.d.ts +0 -3
- package/dist/types-ts4.0/utils/cardActions/cardActionIconButton.d.ts +0 -12
- package/dist/types-ts4.0/utils/cardActions/cardActionsDropdownMenu.d.ts +0 -14
- package/dist/types-ts4.0/utils/cardActions/cardActionsView.d.ts +0 -16
- package/dist/types-ts4.0/utils/cardActions/index.d.ts +0 -7
- package/dist/types-ts4.0/utils/cardActions/styles.d.ts +0 -18
- package/dist/types-ts4.0/utils/cardDimensions.d.ts +0 -49
- package/dist/types-ts4.0/utils/containsPixelUnit.d.ts +0 -1
- package/dist/types-ts4.0/utils/dimensionComparer.d.ts +0 -3
- package/dist/types-ts4.0/utils/document.d.ts +0 -2
- package/dist/types-ts4.0/utils/errorIcon/index.d.ts +0 -12
- package/dist/types-ts4.0/utils/errorIcon/styles.d.ts +0 -1
- package/dist/types-ts4.0/utils/fileIcon/index.d.ts +0 -12
- package/dist/types-ts4.0/utils/fileIcon/styles.d.ts +0 -1
- package/dist/types-ts4.0/utils/generateUniqueId.d.ts +0 -1
- package/dist/types-ts4.0/utils/getCSSUnitValue.d.ts +0 -1
- package/dist/types-ts4.0/utils/getDataURIDimension.d.ts +0 -9
- package/dist/types-ts4.0/utils/getElementDimension.d.ts +0 -2
- package/dist/types-ts4.0/utils/getErrorMessage.d.ts +0 -2
- package/dist/types-ts4.0/utils/getMediaCardCursor.d.ts +0 -6
- package/dist/types-ts4.0/utils/globalScope/getSSRData.d.ts +0 -3
- package/dist/types-ts4.0/utils/globalScope/globalScope.d.ts +0 -21
- package/dist/types-ts4.0/utils/globalScope/index.d.ts +0 -4
- package/dist/types-ts4.0/utils/globalScope/types.d.ts +0 -8
- package/dist/types-ts4.0/utils/index.d.ts +0 -14
- package/dist/types-ts4.0/utils/isRetina.d.ts +0 -1
- package/dist/types-ts4.0/utils/isValidPercentageUnit.d.ts +0 -1
- package/dist/types-ts4.0/utils/lightCards/cardError.d.ts +0 -12
- package/dist/types-ts4.0/utils/lightCards/cardLoading.d.ts +0 -5
- package/dist/types-ts4.0/utils/lightCards/getDimensionsWithDefault.d.ts +0 -2
- package/dist/types-ts4.0/utils/lightCards/lightCardWrappers.d.ts +0 -5
- package/dist/types-ts4.0/utils/lightCards/styles.d.ts +0 -4
- package/dist/types-ts4.0/utils/lightCards/types.d.ts +0 -15
- package/dist/types-ts4.0/utils/media-card-analytics-error-boundary.d.ts +0 -10
- package/dist/types-ts4.0/utils/mediaTypeIcon/iconWrapper.d.ts +0 -4
- package/dist/types-ts4.0/utils/mediaTypeIcon/index.d.ts +0 -10
- package/dist/types-ts4.0/utils/mediaTypeIcon/styles.d.ts +0 -2
- package/dist/types-ts4.0/utils/mediaTypeIcon/types.d.ts +0 -6
- package/dist/types-ts4.0/utils/metadata.d.ts +0 -2
- package/dist/types-ts4.0/utils/objectURLCache.d.ts +0 -11
- package/dist/types-ts4.0/utils/preventClickThrough.d.ts +0 -8
- package/dist/types-ts4.0/utils/printScript.d.ts +0 -2
- package/dist/types-ts4.0/utils/progressBar/index.d.ts +0 -9
- package/dist/types-ts4.0/utils/progressBar/styles.d.ts +0 -1
- package/dist/types-ts4.0/utils/resizeModeToMediaImageProps.d.ts +0 -5
- package/dist/types-ts4.0/utils/shouldDisplayImageThumbnail.d.ts +0 -3
- package/dist/types-ts4.0/utils/ufoExperiences.d.ts +0 -7
- package/dist/types-ts4.0/utils/videoSnapshot.d.ts +0 -1
- package/dist/types-ts4.0/utils/viewportDetector.d.ts +0 -6
|
@@ -65,21 +65,24 @@ var getRenderPreviewableCardPayload = function getRenderPreviewableCardPayload(f
|
|
|
65
65
|
|
|
66
66
|
exports.getRenderPreviewableCardPayload = getRenderPreviewableCardPayload;
|
|
67
67
|
|
|
68
|
-
var getRenderCommencedEventPayload = function getRenderCommencedEventPayload(fileAttributes, performanceAttributes) {
|
|
68
|
+
var getRenderCommencedEventPayload = function getRenderCommencedEventPayload(fileAttributes, performanceAttributes, traceContext) {
|
|
69
69
|
return {
|
|
70
70
|
eventType: 'operational',
|
|
71
71
|
action: 'commenced',
|
|
72
72
|
actionSubject: 'mediaCardRender',
|
|
73
73
|
attributes: {
|
|
74
74
|
fileAttributes: fileAttributes,
|
|
75
|
-
performanceAttributes: performanceAttributes
|
|
75
|
+
performanceAttributes: performanceAttributes,
|
|
76
|
+
traceContext: {
|
|
77
|
+
traceId: traceContext.traceId
|
|
78
|
+
}
|
|
76
79
|
}
|
|
77
80
|
};
|
|
78
81
|
};
|
|
79
82
|
|
|
80
83
|
exports.getRenderCommencedEventPayload = getRenderCommencedEventPayload;
|
|
81
84
|
|
|
82
|
-
var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability) {
|
|
85
|
+
var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext) {
|
|
83
86
|
return {
|
|
84
87
|
eventType: 'operational',
|
|
85
88
|
action: 'succeeded',
|
|
@@ -88,7 +91,8 @@ var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fil
|
|
|
88
91
|
fileAttributes: fileAttributes,
|
|
89
92
|
performanceAttributes: performanceAttributes,
|
|
90
93
|
status: 'success',
|
|
91
|
-
ssrReliability: ssrReliability
|
|
94
|
+
ssrReliability: ssrReliability,
|
|
95
|
+
traceContext: traceContext
|
|
92
96
|
}
|
|
93
97
|
};
|
|
94
98
|
};
|
|
@@ -189,7 +193,7 @@ var extractErrorInfo = function extractErrorInfo(error) {
|
|
|
189
193
|
|
|
190
194
|
exports.extractErrorInfo = extractErrorInfo;
|
|
191
195
|
|
|
192
|
-
var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability) {
|
|
196
|
+
var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext) {
|
|
193
197
|
return {
|
|
194
198
|
eventType: 'operational',
|
|
195
199
|
action: 'failed',
|
|
@@ -200,14 +204,15 @@ var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttribu
|
|
|
200
204
|
status: 'fail'
|
|
201
205
|
}, extractErrorInfo(error)), {}, {
|
|
202
206
|
request: getRenderErrorRequestMetadata(error),
|
|
203
|
-
ssrReliability: ssrReliability
|
|
207
|
+
ssrReliability: ssrReliability,
|
|
208
|
+
traceContext: traceContext
|
|
204
209
|
})
|
|
205
210
|
};
|
|
206
211
|
};
|
|
207
212
|
|
|
208
213
|
exports.getRenderErrorEventPayload = getRenderErrorEventPayload;
|
|
209
214
|
|
|
210
|
-
var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability) {
|
|
215
|
+
var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext) {
|
|
211
216
|
return {
|
|
212
217
|
eventType: 'operational',
|
|
213
218
|
action: 'failed',
|
|
@@ -217,7 +222,8 @@ var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload
|
|
|
217
222
|
performanceAttributes: performanceAttributes,
|
|
218
223
|
status: 'fail',
|
|
219
224
|
failReason: 'failed-processing',
|
|
220
|
-
ssrReliability: ssrReliability
|
|
225
|
+
ssrReliability: ssrReliability,
|
|
226
|
+
traceContext: traceContext
|
|
221
227
|
}
|
|
222
228
|
};
|
|
223
229
|
};
|
|
@@ -13,10 +13,14 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
|
|
16
|
+
var _tokens = require("@atlaskit/tokens");
|
|
17
|
+
|
|
16
18
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
17
19
|
|
|
18
20
|
var _styles = require("../../card/styles");
|
|
19
21
|
|
|
22
|
+
var _mixins = require("../../card/styles/mixins");
|
|
23
|
+
|
|
20
24
|
var _templateObject, _templateObject2;
|
|
21
25
|
|
|
22
26
|
var wrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n display: flex;\n position: relative;\n line-height: 0;\n"])), (0, _styles.rootStyles)());
|
|
@@ -30,12 +34,12 @@ exports.CardActionIconButtonVariant = CardActionIconButtonVariant;
|
|
|
30
34
|
})(CardActionIconButtonVariant || (exports.CardActionIconButtonVariant = CardActionIconButtonVariant = {}));
|
|
31
35
|
|
|
32
36
|
var getVariantStyles = function getVariantStyles(variant) {
|
|
33
|
-
return variant === 'filled' ? "\n background: ".concat(_colors.N0, ";\n margin-right: 8px;\n
|
|
37
|
+
return variant === 'filled' ? "\n background-color: ".concat((0, _tokens.token)('elevation.surface.overlay', (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: ").concat((0, _tokens.token)('elevation.surface.overlay.hovered', (0, _mixins.rgba)(_colors.N0, 0.6)), "\n }\n ") : "\n &:hover {\n background-color: ".concat((0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgba(9, 30, 66, 0.06)'), ";\n }\n ");
|
|
34
38
|
};
|
|
35
39
|
|
|
36
40
|
var cardActionButtonStyles = function cardActionButtonStyles(_ref) {
|
|
37
41
|
var variant = _ref.variant;
|
|
38
|
-
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), _colors.N500, getVariantStyles(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), (0, _tokens.token)('color.icon', _colors.N500), getVariantStyles(variant));
|
|
39
43
|
};
|
|
40
44
|
|
|
41
45
|
exports.cardActionButtonStyles = cardActionButtonStyles;
|
|
@@ -9,9 +9,11 @@ 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
|
+
|
|
12
14
|
var _react = require("@emotion/react");
|
|
13
15
|
|
|
14
16
|
var _templateObject;
|
|
15
17
|
|
|
16
|
-
var errorIconWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n color:
|
|
18
|
+
var errorIconWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n color: ", ";\n"])), (0, _tokens.token)('color.icon.warning', '#ff991f'));
|
|
17
19
|
exports.errorIconWrapperStyles = errorIconWrapperStyles;
|
|
@@ -11,6 +11,8 @@ 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
|
+
|
|
14
16
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
15
17
|
|
|
16
18
|
var _components = require("@atlaskit/theme/components");
|
|
@@ -26,13 +28,13 @@ var wrapperStyles = function wrapperStyles(_ref) {
|
|
|
26
28
|
var dimensions = _ref.dimensions,
|
|
27
29
|
theme = _ref.theme;
|
|
28
30
|
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)({
|
|
29
|
-
light: _colors.N20,
|
|
30
|
-
dark: _colors.DN50
|
|
31
|
+
light: (0, _tokens.token)('color.background.neutral', _colors.N20),
|
|
32
|
+
dark: (0, _tokens.token)('color.background.neutral', _colors.DN50)
|
|
31
33
|
})({
|
|
32
34
|
theme: theme
|
|
33
35
|
}), (0, _components.themed)({
|
|
34
|
-
light: _colors.N50,
|
|
35
|
-
dark: _colors.DN100
|
|
36
|
+
light: (0, _tokens.token)('color.icon', _colors.N50),
|
|
37
|
+
dark: (0, _tokens.token)('color.icon', _colors.DN100)
|
|
36
38
|
})({
|
|
37
39
|
theme: theme
|
|
38
40
|
}), _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.3.0";
|
|
26
26
|
var concurrentExperience;
|
|
27
27
|
|
|
28
28
|
var getExperience = function getExperience(id) {
|
|
@@ -11,25 +11,50 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
11
11
|
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
13
|
|
|
14
|
-
var _videoSnapshot = _interopRequireDefault(require("video-snapshot"));
|
|
15
|
-
|
|
16
14
|
var takeSnapshot = /*#__PURE__*/function () {
|
|
17
15
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(blob) {
|
|
18
|
-
var snapshooter, dataUri;
|
|
19
16
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
20
17
|
while (1) {
|
|
21
18
|
switch (_context.prev = _context.next) {
|
|
22
19
|
case 0:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
21
|
+
var url = URL.createObjectURL(blob);
|
|
22
|
+
var video = document.createElement('video');
|
|
23
|
+
video.preload = 'metadata';
|
|
24
|
+
video.src = url;
|
|
25
|
+
video.muted = true;
|
|
26
|
+
video.play().catch(function () {
|
|
27
|
+
return reject(new Error('failed to play video'));
|
|
28
|
+
});
|
|
29
|
+
video.addEventListener('timeupdate', function timeUpdateHandler() {
|
|
30
|
+
video.removeEventListener('timeupdate', timeUpdateHandler);
|
|
31
|
+
video.pause();
|
|
32
|
+
URL.revokeObjectURL(url); //create canvas to draw our first frame on.
|
|
33
|
+
|
|
34
|
+
if (!video.videoWidth && !video.videoHeight) {
|
|
35
|
+
return reject(new Error('error retrieving video dimensions'));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var canvas = document.createElement('canvas');
|
|
39
|
+
canvas.width = video.videoWidth;
|
|
40
|
+
canvas.height = video.videoHeight;
|
|
41
|
+
var context = canvas.getContext('2d');
|
|
42
|
+
|
|
43
|
+
if (!context) {
|
|
44
|
+
return reject(new Error('error creating canvas context'));
|
|
45
|
+
}
|
|
26
46
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
47
|
+
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
48
|
+
var dataURL = canvas.toDataURL('image/jpeg', 0.85);
|
|
49
|
+
resolve(dataURL);
|
|
50
|
+
});
|
|
51
|
+
video.addEventListener('error', function () {
|
|
52
|
+
reject(new Error('failed to load video'));
|
|
53
|
+
URL.revokeObjectURL(url);
|
|
54
|
+
});
|
|
55
|
+
}));
|
|
31
56
|
|
|
32
|
-
case
|
|
57
|
+
case 1:
|
|
33
58
|
case "end":
|
|
34
59
|
return _context.stop();
|
|
35
60
|
}
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/card/card.js
CHANGED
|
@@ -4,6 +4,7 @@ import ReactDOM from 'react-dom';
|
|
|
4
4
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
5
|
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
6
6
|
import DownloadIcon from '@atlaskit/icon/glyph/download';
|
|
7
|
+
import { getRandomHex } from '@atlaskit/media-common';
|
|
7
8
|
import { globalMediaEventEmitter, isDifferentIdentifier, isFileIdentifier, RECENTS_COLLECTION, isImageRepresentationReady, isExternalImageIdentifier, isProcessedFileState, imageResizeModeToFileImageMode } from '@atlaskit/media-client';
|
|
8
9
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
9
10
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
@@ -25,12 +26,13 @@ import { getMediaCardCursor } from '../utils/getMediaCardCursor';
|
|
|
25
26
|
import { completeUfoExperience, startUfoExperience } from '../utils/ufoExperiences';
|
|
26
27
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
27
28
|
const packageName = "@atlaskit/media-card";
|
|
28
|
-
const packageVersion = "74.
|
|
29
|
+
const packageVersion = "74.3.0";
|
|
29
30
|
export class CardBase extends Component {
|
|
30
31
|
// An internalOccurrenceKey is a randomly generated value to differentiate various instances
|
|
31
32
|
// of Cards regardless of whether it shares the same file (either internal or external)
|
|
32
33
|
// We initialise timeElapsedTillCommenced
|
|
33
34
|
// to avoid extra branching on a possibly undefined value.
|
|
35
|
+
// Generate unique traceId for file
|
|
34
36
|
constructor(props) {
|
|
35
37
|
super(props);
|
|
36
38
|
|
|
@@ -54,6 +56,10 @@ export class CardBase extends Component {
|
|
|
54
56
|
|
|
55
57
|
_defineProperty(this, "timeElapsedTillCommenced", performance.now());
|
|
56
58
|
|
|
59
|
+
_defineProperty(this, "traceContext", {
|
|
60
|
+
traceId: getRandomHex(16)
|
|
61
|
+
});
|
|
62
|
+
|
|
57
63
|
_defineProperty(this, "getImageURLParams", ({
|
|
58
64
|
collectionName: collection
|
|
59
65
|
}) => ({
|
|
@@ -112,7 +118,8 @@ export class CardBase extends Component {
|
|
|
112
118
|
imageUrlParams: this.getImageURLParams(identifier),
|
|
113
119
|
mediaBlobUrlAttrs: this.getMediaBlobUrlAttrs(identifier, fileState),
|
|
114
120
|
createAnalyticsEvent,
|
|
115
|
-
featureFlags: this.props.featureFlags
|
|
121
|
+
featureFlags: this.props.featureFlags,
|
|
122
|
+
traceContext: this.traceContext
|
|
116
123
|
};
|
|
117
124
|
});
|
|
118
125
|
|
|
@@ -937,7 +944,7 @@ export class CardBase extends Component {
|
|
|
937
944
|
const {
|
|
938
945
|
createAnalyticsEvent
|
|
939
946
|
} = this.props;
|
|
940
|
-
createAnalyticsEvent && fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error);
|
|
947
|
+
createAnalyticsEvent && fireOperationalEvent(createAnalyticsEvent, status, this.fileAttributes, this.getPerformanceAttributes(), this.ssrReliability, error, this.traceContext);
|
|
941
948
|
completeUfoExperience(this.internalOccurrenceKey, status, this.fileAttributes, this.fileStateFlags, this.ssrReliability, error);
|
|
942
949
|
}
|
|
943
950
|
|
|
@@ -950,7 +957,7 @@ export class CardBase extends Component {
|
|
|
950
957
|
overall: {
|
|
951
958
|
durationSincePageStart: this.timeElapsedTillCommenced
|
|
952
959
|
}
|
|
953
|
-
});
|
|
960
|
+
}, this.traceContext);
|
|
954
961
|
startUfoExperience(this.internalOccurrenceKey);
|
|
955
962
|
}
|
|
956
963
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload, getCopiedFilePayload, getRenderCommencedEventPayload, getRenderPreviewableCardPayload } from '../utils/analytics';
|
|
2
2
|
import { MediaCardError } from '../errors';
|
|
3
|
-
export const fireOperationalEvent = (createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error = new MediaCardError('missing-error-data')) => {
|
|
3
|
+
export const fireOperationalEvent = (createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error = new MediaCardError('missing-error-data'), traceContext) => {
|
|
4
4
|
const fireEvent = payload => fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
5
5
|
|
|
6
6
|
switch (status) {
|
|
7
7
|
case 'complete':
|
|
8
|
-
fireEvent(getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability));
|
|
8
|
+
fireEvent(getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext));
|
|
9
9
|
break;
|
|
10
10
|
|
|
11
11
|
case 'failed-processing':
|
|
12
|
-
fireEvent(getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability));
|
|
12
|
+
fireEvent(getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext));
|
|
13
13
|
break;
|
|
14
14
|
|
|
15
15
|
case 'error':
|
|
16
|
-
fireEvent(getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability));
|
|
16
|
+
fireEvent(getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext));
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
export const fireCommencedEvent = (createAnalyticsEvent, fileAttributes, performanceAttributes) => {
|
|
21
|
-
fireMediaCardEvent(getRenderCommencedEventPayload(fileAttributes, performanceAttributes), createAnalyticsEvent);
|
|
20
|
+
export const fireCommencedEvent = (createAnalyticsEvent, fileAttributes, performanceAttributes, traceContext) => {
|
|
21
|
+
fireMediaCardEvent(getRenderCommencedEventPayload(fileAttributes, performanceAttributes, traceContext), createAnalyticsEvent);
|
|
22
22
|
};
|
|
23
23
|
export const fireCopiedEvent = (createAnalyticsEvent, fileId, cardRef) => {
|
|
24
24
|
if (typeof window.getSelection === 'function') {
|
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
import TickIcon from '@atlaskit/icon/glyph/check';
|
|
9
10
|
import { Ellipsify } from '@atlaskit/media-ui'; // We dont require things directly from "utils" to avoid circular dependencies
|
|
10
11
|
|
|
@@ -75,7 +76,7 @@ export class CardOverlay extends Component {
|
|
|
75
76
|
actions
|
|
76
77
|
} = this.props;
|
|
77
78
|
const titleText = resolveTitleText(cardStatus, mediaName, error, selected);
|
|
78
|
-
const menuTriggerColor = !persistent ? 'white' : undefined;
|
|
79
|
+
const menuTriggerColor = !persistent ? token('color.icon.inverse', 'white') : undefined;
|
|
79
80
|
return jsx(Overlay, {
|
|
80
81
|
hasError: !!error,
|
|
81
82
|
noHover: noHover,
|
|
@@ -8,23 +8,24 @@ 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 {
|
|
11
|
+
import { token } from '@atlaskit/tokens';
|
|
12
|
+
import { rgba, easeOutCubic, transition, antialiased } from '../../styles';
|
|
12
13
|
export const tickBoxStyles = css`
|
|
13
14
|
${size(14)}
|
|
14
15
|
${transition()}
|
|
15
|
-
background-color: ${rgba('#ffffff', 0.5)};
|
|
16
|
+
background-color: ${token('elevation.surface.overlay', rgba('#ffffff', 0.5))};
|
|
16
17
|
position: absolute;
|
|
17
18
|
top: 8px;
|
|
18
19
|
right: 8px;
|
|
19
20
|
border-radius: 20px;
|
|
20
|
-
color: #798599; /* TODO FIL-3884: Align color with new design */
|
|
21
|
+
color: ${token('color.icon.subtle', '#798599')}; /* CLEANUP - TODO FIL-3884: Align color with new design */
|
|
21
22
|
display: flex;
|
|
22
23
|
opacity: 0;
|
|
23
24
|
|
|
24
25
|
&.selected {
|
|
25
26
|
opacity: 1;
|
|
26
|
-
color: white;
|
|
27
|
-
background-color: #0052cc; /* TODO FIL-3884: Align with tickbox icons */
|
|
27
|
+
color: ${token('color.icon.inverse', 'white')};
|
|
28
|
+
background-color: ${token('color.icon.selected', '#0052cc')}; /* CLEANUP - TODO FIL-3884: Align with tickbox icons */
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/* Enforce dimensions of "tick" icon */
|
|
@@ -63,13 +64,7 @@ export const overlayStyles = props => css`
|
|
|
63
64
|
&:not(.persistent):hover, &.active {
|
|
64
65
|
.top-row {
|
|
65
66
|
.title {
|
|
66
|
-
color: ${colors.B400};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.bottom-row {
|
|
71
|
-
.delete-btn {
|
|
72
|
-
display: flex;
|
|
67
|
+
color: ${token('color.text.information', colors.B400)};
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
70
|
}
|
|
@@ -77,7 +72,7 @@ export const overlayStyles = props => css`
|
|
|
77
72
|
&.noHover:hover {
|
|
78
73
|
.top-row {
|
|
79
74
|
.title {
|
|
80
|
-
color: ${colors.N800};
|
|
75
|
+
color: ${token('color.text', colors.N800)};
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
}
|
|
@@ -88,22 +83,22 @@ export const overlayStyles = props => css`
|
|
|
88
83
|
|
|
89
84
|
&:not(.persistent) {
|
|
90
85
|
&:not(.error, .noHover):hover {
|
|
91
|
-
background-color: ${rgba(colors.N900, 0.06)};
|
|
86
|
+
background-color: ${token('color.background.neutral.hovered', rgba(colors.N900, 0.06))};
|
|
92
87
|
}
|
|
93
88
|
|
|
94
89
|
&.selectable {
|
|
95
90
|
&.selected {
|
|
96
|
-
background-color: ${colors.B200};
|
|
91
|
+
background-color: ${token('color.background.selected', colors.B200)};
|
|
97
92
|
|
|
98
93
|
&:hover {
|
|
99
|
-
/* TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */
|
|
94
|
+
/* CLEANUP - TODO FIL-3884 add new overlay with rgba(colors.N900, 0.16) */
|
|
95
|
+
background-color: ${token('color.background.selected.hovered', rgba(colors.N900, 0.16))};
|
|
100
96
|
}
|
|
101
97
|
|
|
102
98
|
.title,
|
|
103
99
|
.bottom-row,
|
|
104
|
-
.file-size
|
|
105
|
-
|
|
106
|
-
color: ${colors.N0};
|
|
100
|
+
.file-size {
|
|
101
|
+
color: ${token('color.text', colors.N900)};
|
|
107
102
|
}
|
|
108
103
|
}
|
|
109
104
|
}
|
|
@@ -118,7 +113,7 @@ export const overlayStyles = props => css`
|
|
|
118
113
|
.title {
|
|
119
114
|
transition: opacity 0.3s;
|
|
120
115
|
opacity: 0;
|
|
121
|
-
color: white;
|
|
116
|
+
color: ${token('color.text', 'white')};
|
|
122
117
|
visibility: hidden;
|
|
123
118
|
}
|
|
124
119
|
}
|
|
@@ -134,31 +129,14 @@ export const overlayStyles = props => css`
|
|
|
134
129
|
}
|
|
135
130
|
|
|
136
131
|
.file-size {
|
|
137
|
-
color: white;
|
|
138
|
-
display: none;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.more-btn {
|
|
142
|
-
color: ${colors.N0};
|
|
143
|
-
display: none;
|
|
144
|
-
|
|
145
|
-
&:hover {
|
|
146
|
-
background-color: rgba(9, 30, 66, 0.2);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.delete-btn {
|
|
132
|
+
color: ${token('color.text', 'white')};
|
|
151
133
|
display: none;
|
|
152
|
-
|
|
153
|
-
&:hover {
|
|
154
|
-
background-color: rgba(9, 30, 66, 0.2);
|
|
155
|
-
}
|
|
156
134
|
}
|
|
157
135
|
}
|
|
158
136
|
|
|
159
137
|
&:hover,
|
|
160
138
|
&.active {
|
|
161
|
-
background-color: ${rgba(colors.N900, 0.5)};
|
|
139
|
+
background-color: ${token('color.interaction.hovered', rgba(colors.N900, 0.5))};
|
|
162
140
|
|
|
163
141
|
.title {
|
|
164
142
|
opacity: 1;
|
|
@@ -170,14 +148,6 @@ export const overlayStyles = props => css`
|
|
|
170
148
|
display: block;
|
|
171
149
|
}
|
|
172
150
|
|
|
173
|
-
.more-btn {
|
|
174
|
-
${centerX} color: ${colors.N0};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.delete-btn {
|
|
178
|
-
display: flex;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
151
|
.bottom-row {
|
|
182
152
|
opacity: 1;
|
|
183
153
|
transform: translateY(0);
|
|
@@ -194,9 +164,8 @@ export const overlayStyles = props => css`
|
|
|
194
164
|
|
|
195
165
|
&.selected {
|
|
196
166
|
.tickbox {
|
|
197
|
-
background-color: ${colors.B200} !important;
|
|
198
|
-
|
|
199
|
-
color: white;
|
|
167
|
+
background-color: ${token('color.background.selected.bold', colors.B200)} !important;
|
|
168
|
+
color: ${token('color.icon.inverse', 'white')};
|
|
200
169
|
}
|
|
201
170
|
}
|
|
202
171
|
}
|
|
@@ -210,7 +179,7 @@ export const overlayStyles = props => css`
|
|
|
210
179
|
&.active {
|
|
211
180
|
.top-row {
|
|
212
181
|
.title {
|
|
213
|
-
color: ${colors.N800};
|
|
182
|
+
color: ${token('color.text', colors.N800)};
|
|
214
183
|
}
|
|
215
184
|
}
|
|
216
185
|
}
|
|
@@ -238,7 +207,7 @@ export const errorMessageStyles = css`
|
|
|
238
207
|
${antialiased} display: inline-block;
|
|
239
208
|
vertical-align: middle;
|
|
240
209
|
font-weight: bold;
|
|
241
|
-
color: ${colors.N70};
|
|
210
|
+
color: ${token('color.text.subtlest', colors.N70)};
|
|
242
211
|
font-size: 12px;
|
|
243
212
|
line-height: 15px;
|
|
244
213
|
overflow: hidden;
|
|
@@ -255,8 +224,8 @@ export const titleWrapperStyles = theme => css`
|
|
|
255
224
|
box-sizing: border-box;
|
|
256
225
|
word-wrap: break-word;
|
|
257
226
|
color: ${themed({
|
|
258
|
-
light: colors.N800,
|
|
259
|
-
dark: colors.DN900
|
|
227
|
+
light: token('color.text', colors.N800),
|
|
228
|
+
dark: token('color.text', colors.DN900)
|
|
260
229
|
})({
|
|
261
230
|
theme
|
|
262
231
|
})};
|
|
@@ -265,7 +234,7 @@ export const titleWrapperStyles = theme => css`
|
|
|
265
234
|
`;
|
|
266
235
|
export const subtitleStyles = css`
|
|
267
236
|
${ellipsis('100px')} font-size: 12px;
|
|
268
|
-
color: #5e6c84;
|
|
237
|
+
color: ${token('color.text.subtlest', '#5e6c84')};
|
|
269
238
|
`;
|
|
270
239
|
export const metadataStyles = css`
|
|
271
240
|
display: flex;
|
|
@@ -2,8 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
|
|
3
3
|
/**@jsx jsx */
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import React, { Component } from 'react';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
7
7
|
import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
|
|
8
8
|
import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
|
|
9
9
|
import { CardOverlay } from './cardOverlay';
|
|
@@ -220,7 +220,7 @@ export class FileCardImageView extends Component {
|
|
|
220
220
|
css: cardActionsWrapperStyles
|
|
221
221
|
}, actions ? jsx(CardActions, {
|
|
222
222
|
actions: actions,
|
|
223
|
-
triggerColor:
|
|
223
|
+
triggerColor: token('color.icon.inverse', 'white')
|
|
224
224
|
}) : null))));
|
|
225
225
|
});
|
|
226
226
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
+
import { token } from '@atlaskit/tokens';
|
|
2
3
|
import { absolute, borderRadius, size } from '@atlaskit/media-ui';
|
|
3
4
|
import { themed } from '@atlaskit/theme/components';
|
|
4
5
|
import { N20, DN50, N0 } from '@atlaskit/theme/colors';
|
|
@@ -17,8 +18,8 @@ const getBackgroundColor = props => {
|
|
|
17
18
|
mediaType
|
|
18
19
|
} = props;
|
|
19
20
|
return `background: ${mediaType === 'image' ? 'transparent' : themed({
|
|
20
|
-
light: N20,
|
|
21
|
-
dark: DN50
|
|
21
|
+
light: token('color.background.neutral', N20),
|
|
22
|
+
dark: token('color.background.neutral', DN50)
|
|
22
23
|
})(props)};`;
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -58,7 +59,7 @@ export const playIconWrapperStyles = css`
|
|
|
58
59
|
display: flex;
|
|
59
60
|
align-items: center;
|
|
60
61
|
justify-content: center;
|
|
61
|
-
color: white;
|
|
62
|
+
color: ${token('color.icon.inverse', 'white')};
|
|
62
63
|
|
|
63
64
|
/* we want to override default icon size and hover state */
|
|
64
65
|
&:hover > * {
|
|
@@ -67,7 +68,7 @@ export const playIconWrapperStyles = css`
|
|
|
67
68
|
}
|
|
68
69
|
`;
|
|
69
70
|
export const playIconBackgroundStyles = css`
|
|
70
|
-
background: rgba(23, 43, 77, 0.7);
|
|
71
|
+
background: ${token('color.background.neutral.bold', 'rgba(23, 43, 77, 0.7)')};
|
|
71
72
|
border-radius: 100%;
|
|
72
73
|
padding: 10px;
|
|
73
74
|
display: flex;
|
|
@@ -88,12 +89,12 @@ export const overlayStyles = css`
|
|
|
88
89
|
${absolute()}
|
|
89
90
|
${size()}
|
|
90
91
|
border-radius: inherit;
|
|
91
|
-
background-color: rgba(9, 30, 66, 0.5);
|
|
92
|
+
background-color: ${token('color.blanket', 'rgba(9, 30, 66, 0.5)')};
|
|
92
93
|
`;
|
|
93
94
|
export const titleStyles = css`
|
|
94
95
|
${absolute()} width: 100%;
|
|
95
96
|
padding: 8px;
|
|
96
|
-
color: ${N0};
|
|
97
|
+
color: ${token('color.text.inverse', N0)};
|
|
97
98
|
font-size: 12px;
|
|
98
99
|
line-height: 18px;
|
|
99
100
|
word-wrap: break-word;
|
|
@@ -104,8 +105,10 @@ export const bodyStyles = css`
|
|
|
104
105
|
bottom: 0;
|
|
105
106
|
width: 100%;
|
|
106
107
|
padding: 8px;
|
|
107
|
-
color: ${N0};
|
|
108
|
+
color: ${token('color.text.inverse', N0)};
|
|
108
109
|
`;
|
|
110
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
111
|
+
|
|
109
112
|
export const progressWrapperStyles = css`
|
|
110
113
|
flex-grow: 1;
|
|
111
114
|
|
|
@@ -69,9 +69,9 @@ export const getCardPreviewFromFilePreview = async filePreview => {
|
|
|
69
69
|
|
|
70
70
|
throw new LocalPreviewError('local-preview-unsupported');
|
|
71
71
|
};
|
|
72
|
-
export const getCardPreviewFromBackend = async (mediaClient, id, params) => {
|
|
72
|
+
export const getCardPreviewFromBackend = async (mediaClient, id, params, traceContext) => {
|
|
73
73
|
try {
|
|
74
|
-
const blob = await mediaClient.getImage(id, params);
|
|
74
|
+
const blob = await mediaClient.getImage(id, params, undefined, undefined, traceContext);
|
|
75
75
|
return {
|
|
76
76
|
dataURI: URL.createObjectURL(blob),
|
|
77
77
|
orientation: 1,
|
|
@@ -75,7 +75,8 @@ export const getCardPreview = async ({
|
|
|
75
75
|
imageUrlParams,
|
|
76
76
|
mediaBlobUrlAttrs,
|
|
77
77
|
createAnalyticsEvent,
|
|
78
|
-
featureFlags
|
|
78
|
+
featureFlags,
|
|
79
|
+
traceContext
|
|
79
80
|
}) => {
|
|
80
81
|
const mode = imageUrlParams.mode;
|
|
81
82
|
const cachedPreview = cardPreviewCache.get(id, mode);
|
|
@@ -136,7 +137,7 @@ export const getCardPreview = async ({
|
|
|
136
137
|
throw new MediaCardError('remote-preview-not-ready');
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
const remotePreview = await fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs);
|
|
140
|
+
const remotePreview = await fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs, traceContext);
|
|
140
141
|
|
|
141
142
|
if (getMediaFeatureFlag('memoryCacheLogging', featureFlags)) {
|
|
142
143
|
createAnalyticsEvent && fireImageFetchingOperationalEvent(createAnalyticsEvent, 'remote-success', {
|
|
@@ -197,8 +198,8 @@ export const isSSRClientPreview = preview => {
|
|
|
197
198
|
return ssrClientSources.includes(preview.source);
|
|
198
199
|
};
|
|
199
200
|
export const isSSRDataPreview = preview => preview.source === 'ssr-data';
|
|
200
|
-
export const fetchAndCacheRemotePreview = async (mediaClient, id, dimensions, params, mediaBlobUrlAttrs) => {
|
|
201
|
-
const remotePreview = await getCardPreviewFromBackend(mediaClient, id, params);
|
|
201
|
+
export const fetchAndCacheRemotePreview = async (mediaClient, id, dimensions, params, mediaBlobUrlAttrs, traceContext) => {
|
|
202
|
+
const remotePreview = await getCardPreviewFromBackend(mediaClient, id, params, traceContext);
|
|
202
203
|
return extendAndCachePreview(id, params.mode, { ...remotePreview,
|
|
203
204
|
dimensions
|
|
204
205
|
}, mediaBlobUrlAttrs);
|