@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.
Files changed (238) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/card/card.js +9 -4
  3. package/dist/cjs/card/cardAnalytics.js +6 -5
  4. package/dist/cjs/card/cardImageView/cardOverlay/index.js +3 -1
  5. package/dist/cjs/card/cardImageView/cardOverlay/styles.js +8 -6
  6. package/dist/cjs/card/cardImageView/fileCardImageView.js +3 -1
  7. package/dist/cjs/card/cardImageView/styles.js +11 -7
  8. package/dist/cjs/card/getCardPreview/helpers.js +3 -3
  9. package/dist/cjs/card/getCardPreview/index.js +6 -6
  10. package/dist/cjs/card/styles/index.js +3 -1
  11. package/dist/cjs/card/ui/blanket/styles.js +3 -1
  12. package/dist/cjs/card/ui/iconMessage/styles.js +3 -1
  13. package/dist/cjs/card/ui/loadingRateLimited/styles.js +3 -1
  14. package/dist/cjs/card/ui/newFileExperience/styles.js +3 -1
  15. package/dist/cjs/card/ui/playButton/styles.js +4 -2
  16. package/dist/cjs/card/ui/progressBar/styles.js +5 -1
  17. package/dist/cjs/card/ui/styles.js +3 -1
  18. package/dist/cjs/card/ui/tickBox/styles.js +4 -2
  19. package/dist/cjs/card/ui/titleBox/failedTitleBox.js +3 -1
  20. package/dist/cjs/card/ui/titleBox/styles.js +3 -1
  21. package/dist/cjs/utils/analytics.js +14 -8
  22. package/dist/cjs/utils/cardActions/styles.js +6 -2
  23. package/dist/cjs/utils/errorIcon/styles.js +3 -1
  24. package/dist/cjs/utils/fileIcon/index.js +1 -1
  25. package/dist/cjs/utils/lightCards/styles.js +6 -4
  26. package/dist/cjs/utils/ufoExperiences.js +1 -1
  27. package/dist/cjs/utils/videoSnapshot.js +36 -11
  28. package/dist/cjs/version.json +1 -1
  29. package/dist/es2019/card/card.js +11 -4
  30. package/dist/es2019/card/cardAnalytics.js +6 -6
  31. package/dist/es2019/card/cardImageView/cardOverlay/index.js +2 -1
  32. package/dist/es2019/card/cardImageView/cardOverlay/styles.js +24 -55
  33. package/dist/es2019/card/cardImageView/fileCardImageView.js +3 -3
  34. package/dist/es2019/card/cardImageView/styles.js +10 -7
  35. package/dist/es2019/card/getCardPreview/helpers.js +2 -2
  36. package/dist/es2019/card/getCardPreview/index.js +5 -4
  37. package/dist/es2019/card/styles/index.js +2 -1
  38. package/dist/es2019/card/ui/blanket/styles.js +2 -1
  39. package/dist/es2019/card/ui/iconMessage/styles.js +2 -1
  40. package/dist/es2019/card/ui/loadingRateLimited/styles.js +2 -1
  41. package/dist/es2019/card/ui/newFileExperience/styles.js +9 -8
  42. package/dist/es2019/card/ui/playButton/styles.js +3 -2
  43. package/dist/es2019/card/ui/progressBar/styles.js +5 -2
  44. package/dist/es2019/card/ui/styles.js +2 -1
  45. package/dist/es2019/card/ui/tickBox/styles.js +5 -4
  46. package/dist/es2019/card/ui/titleBox/failedTitleBox.js +2 -1
  47. package/dist/es2019/card/ui/titleBox/styles.js +2 -1
  48. package/dist/es2019/utils/analytics.js +14 -8
  49. package/dist/es2019/utils/cardActions/styles.js +6 -5
  50. package/dist/es2019/utils/errorIcon/styles.js +2 -1
  51. package/dist/es2019/utils/fileIcon/index.js +1 -1
  52. package/dist/es2019/utils/lightCards/styles.js +6 -6
  53. package/dist/es2019/utils/progressBar/styles.js +1 -0
  54. package/dist/es2019/utils/ufoExperiences.js +1 -1
  55. package/dist/es2019/utils/videoSnapshot.js +36 -5
  56. package/dist/es2019/version.json +1 -1
  57. package/dist/esm/card/card.js +11 -4
  58. package/dist/esm/card/cardAnalytics.js +6 -5
  59. package/dist/esm/card/cardImageView/cardOverlay/index.js +2 -1
  60. package/dist/esm/card/cardImageView/cardOverlay/styles.js +8 -7
  61. package/dist/esm/card/cardImageView/fileCardImageView.js +3 -3
  62. package/dist/esm/card/cardImageView/styles.js +10 -7
  63. package/dist/esm/card/getCardPreview/helpers.js +3 -3
  64. package/dist/esm/card/getCardPreview/index.js +6 -6
  65. package/dist/esm/card/styles/index.js +2 -1
  66. package/dist/esm/card/ui/blanket/styles.js +2 -1
  67. package/dist/esm/card/ui/iconMessage/styles.js +2 -1
  68. package/dist/esm/card/ui/loadingRateLimited/styles.js +2 -1
  69. package/dist/esm/card/ui/newFileExperience/styles.js +2 -1
  70. package/dist/esm/card/ui/playButton/styles.js +3 -2
  71. package/dist/esm/card/ui/progressBar/styles.js +5 -2
  72. package/dist/esm/card/ui/styles.js +2 -1
  73. package/dist/esm/card/ui/tickBox/styles.js +3 -2
  74. package/dist/esm/card/ui/titleBox/failedTitleBox.js +2 -1
  75. package/dist/esm/card/ui/titleBox/styles.js +2 -1
  76. package/dist/esm/utils/analytics.js +14 -8
  77. package/dist/esm/utils/cardActions/styles.js +4 -2
  78. package/dist/esm/utils/errorIcon/styles.js +2 -1
  79. package/dist/esm/utils/fileIcon/index.js +1 -1
  80. package/dist/esm/utils/lightCards/styles.js +6 -6
  81. package/dist/esm/utils/progressBar/styles.js +1 -0
  82. package/dist/esm/utils/ufoExperiences.js +1 -1
  83. package/dist/esm/utils/videoSnapshot.js +36 -10
  84. package/dist/esm/version.json +1 -1
  85. package/dist/types/card/card.d.ts +1 -0
  86. package/dist/types/card/cardAnalytics.d.ts +3 -3
  87. package/dist/types/card/getCardPreview/helpers.d.ts +2 -1
  88. package/dist/types/card/getCardPreview/index.d.ts +4 -3
  89. package/dist/types/card/styles/index.d.ts +1 -1
  90. package/dist/types/utils/analytics.d.ts +8 -8
  91. package/example-helpers/styles.ts +10 -6
  92. package/package.json +16 -19
  93. package/report.api.md +228 -116
  94. package/dist/cjs/utils/mediaTypeIcon/iconWrapper.js +0 -20
  95. package/dist/cjs/utils/mediaTypeIcon/index.js +0 -81
  96. package/dist/cjs/utils/mediaTypeIcon/styles.js +0 -37
  97. package/dist/cjs/utils/mediaTypeIcon/types.js +0 -5
  98. package/dist/es2019/utils/mediaTypeIcon/iconWrapper.js +0 -9
  99. package/dist/es2019/utils/mediaTypeIcon/index.js +0 -35
  100. package/dist/es2019/utils/mediaTypeIcon/styles.js +0 -22
  101. package/dist/es2019/utils/mediaTypeIcon/types.js +0 -1
  102. package/dist/esm/utils/mediaTypeIcon/iconWrapper.js +0 -9
  103. package/dist/esm/utils/mediaTypeIcon/index.js +0 -59
  104. package/dist/esm/utils/mediaTypeIcon/styles.js +0 -24
  105. package/dist/esm/utils/mediaTypeIcon/types.js +0 -1
  106. package/dist/types/utils/mediaTypeIcon/iconWrapper.d.ts +0 -4
  107. package/dist/types/utils/mediaTypeIcon/index.d.ts +0 -10
  108. package/dist/types/utils/mediaTypeIcon/styles.d.ts +0 -2
  109. package/dist/types/utils/mediaTypeIcon/types.d.ts +0 -6
  110. package/dist/types-ts4.0/card/actions.d.ts +0 -9
  111. package/dist/types-ts4.0/card/card.d.ts +0 -59
  112. package/dist/types-ts4.0/card/cardAnalytics.d.ts +0 -9
  113. package/dist/types-ts4.0/card/cardConstants.d.ts +0 -1
  114. package/dist/types-ts4.0/card/cardImageView/cardImageViewWrapper.d.ts +0 -6
  115. package/dist/types-ts4.0/card/cardImageView/cardOverlay/cardOverlayComponents.d.ts +0 -8
  116. package/dist/types-ts4.0/card/cardImageView/cardOverlay/index.d.ts +0 -39
  117. package/dist/types-ts4.0/card/cardImageView/cardOverlay/styles.d.ts +0 -26
  118. package/dist/types-ts4.0/card/cardImageView/cardViewWrapper.d.ts +0 -4
  119. package/dist/types-ts4.0/card/cardImageView/classnames.d.ts +0 -2
  120. package/dist/types-ts4.0/card/cardImageView/fileCardImageView.d.ts +0 -49
  121. package/dist/types-ts4.0/card/cardImageView/index.d.ts +0 -2
  122. package/dist/types-ts4.0/card/cardImageView/styles.d.ts +0 -24
  123. package/dist/types-ts4.0/card/cardLoader.d.ts +0 -6
  124. package/dist/types-ts4.0/card/cardState.d.ts +0 -5
  125. package/dist/types-ts4.0/card/cardView.d.ts +0 -80
  126. package/dist/types-ts4.0/card/getCardPreview/cache.d.ts +0 -19
  127. package/dist/types-ts4.0/card/getCardPreview/filePreviewStatus.d.ts +0 -5
  128. package/dist/types-ts4.0/card/getCardPreview/helpers.d.ts +0 -9
  129. package/dist/types-ts4.0/card/getCardPreview/imageRefetchingAnalytics.d.ts +0 -10
  130. package/dist/types-ts4.0/card/getCardPreview/index.d.ts +0 -57
  131. package/dist/types-ts4.0/card/getCardStatus.d.ts +0 -4
  132. package/dist/types-ts4.0/card/index.d.ts +0 -1
  133. package/dist/types-ts4.0/card/inlinePlayer.d.ts +0 -52
  134. package/dist/types-ts4.0/card/inlinePlayerLazy.d.ts +0 -2
  135. package/dist/types-ts4.0/card/inlinePlayerWrapper.d.ts +0 -4
  136. package/dist/types-ts4.0/card/styles/animations.d.ts +0 -1
  137. package/dist/types-ts4.0/card/styles/config.d.ts +0 -1
  138. package/dist/types-ts4.0/card/styles/easing.d.ts +0 -2
  139. package/dist/types-ts4.0/card/styles/getSelectedBorderStyle.d.ts +0 -3
  140. package/dist/types-ts4.0/card/styles/index.d.ts +0 -9
  141. package/dist/types-ts4.0/card/styles/mixins.d.ts +0 -21
  142. package/dist/types-ts4.0/card/styles/styles.d.ts +0 -10
  143. package/dist/types-ts4.0/card/types.d.ts +0 -24
  144. package/dist/types-ts4.0/card/ui/actionsBar/actionsBar.d.ts +0 -5
  145. package/dist/types-ts4.0/card/ui/actionsBar/actionsBarWrapper.d.ts +0 -4
  146. package/dist/types-ts4.0/card/ui/actionsBar/styles.d.ts +0 -6
  147. package/dist/types-ts4.0/card/ui/actionsBar/types.d.ts +0 -10
  148. package/dist/types-ts4.0/card/ui/blanket/blanket.d.ts +0 -6
  149. package/dist/types-ts4.0/card/ui/blanket/styles.d.ts +0 -6
  150. package/dist/types-ts4.0/card/ui/common.d.ts +0 -23
  151. package/dist/types-ts4.0/card/ui/iconMessage/iconMessageWrapper.d.ts +0 -4
  152. package/dist/types-ts4.0/card/ui/iconMessage/index.d.ts +0 -8
  153. package/dist/types-ts4.0/card/ui/iconMessage/styles.d.ts +0 -5
  154. package/dist/types-ts4.0/card/ui/iconMessage/types.d.ts +0 -19
  155. package/dist/types-ts4.0/card/ui/iconWrapper/iconWrapper.d.ts +0 -4
  156. package/dist/types-ts4.0/card/ui/iconWrapper/styles.d.ts +0 -7
  157. package/dist/types-ts4.0/card/ui/iconWrapper/types.d.ts +0 -6
  158. package/dist/types-ts4.0/card/ui/imageRenderer/imageRenderer.d.ts +0 -15
  159. package/dist/types-ts4.0/card/ui/loadingRateLimited/styles.d.ts +0 -13
  160. package/dist/types-ts4.0/card/ui/newFileExperience/newFileExperienceWrapper.d.ts +0 -4
  161. package/dist/types-ts4.0/card/ui/newFileExperience/styles.d.ts +0 -5
  162. package/dist/types-ts4.0/card/ui/newFileExperience/types.d.ts +0 -23
  163. package/dist/types-ts4.0/card/ui/playButton/playButton.d.ts +0 -2
  164. package/dist/types-ts4.0/card/ui/playButton/playButtonBackground.d.ts +0 -3
  165. package/dist/types-ts4.0/card/ui/playButton/playButtonWrapper.d.ts +0 -3
  166. package/dist/types-ts4.0/card/ui/playButton/styles.d.ts +0 -5
  167. package/dist/types-ts4.0/card/ui/progressBar/progressBar.d.ts +0 -10
  168. package/dist/types-ts4.0/card/ui/progressBar/styledBar.d.ts +0 -4
  169. package/dist/types-ts4.0/card/ui/progressBar/styles.d.ts +0 -7
  170. package/dist/types-ts4.0/card/ui/progressBar/types.d.ts +0 -7
  171. package/dist/types-ts4.0/card/ui/styles.d.ts +0 -11
  172. package/dist/types-ts4.0/card/ui/tickBox/styles.d.ts +0 -7
  173. package/dist/types-ts4.0/card/ui/tickBox/tickBox.d.ts +0 -3
  174. package/dist/types-ts4.0/card/ui/tickBox/tickBoxWrapper.d.ts +0 -4
  175. package/dist/types-ts4.0/card/ui/tickBox/types.d.ts +0 -4
  176. package/dist/types-ts4.0/card/ui/titleBox/failedTitleBox.d.ts +0 -3
  177. package/dist/types-ts4.0/card/ui/titleBox/styles.d.ts +0 -15
  178. package/dist/types-ts4.0/card/ui/titleBox/titleBox.d.ts +0 -4
  179. package/dist/types-ts4.0/card/ui/titleBox/titleBoxComponents.d.ts +0 -8
  180. package/dist/types-ts4.0/card/ui/titleBox/types.d.ts +0 -32
  181. package/dist/types-ts4.0/classnames.d.ts +0 -5
  182. package/dist/types-ts4.0/errors.d.ts +0 -41
  183. package/dist/types-ts4.0/index.d.ts +0 -15
  184. package/dist/types-ts4.0/inline/index.d.ts +0 -1
  185. package/dist/types-ts4.0/inline/loader.d.ts +0 -25
  186. package/dist/types-ts4.0/inline/mediaInlineCard.d.ts +0 -14
  187. package/dist/types-ts4.0/types.d.ts +0 -96
  188. package/dist/types-ts4.0/utils/analytics.d.ts +0 -77
  189. package/dist/types-ts4.0/utils/breakpoint.d.ts +0 -11
  190. package/dist/types-ts4.0/utils/cardActions/cardActionButton.d.ts +0 -3
  191. package/dist/types-ts4.0/utils/cardActions/cardActionIconButton.d.ts +0 -12
  192. package/dist/types-ts4.0/utils/cardActions/cardActionsDropdownMenu.d.ts +0 -14
  193. package/dist/types-ts4.0/utils/cardActions/cardActionsView.d.ts +0 -16
  194. package/dist/types-ts4.0/utils/cardActions/index.d.ts +0 -7
  195. package/dist/types-ts4.0/utils/cardActions/styles.d.ts +0 -18
  196. package/dist/types-ts4.0/utils/cardDimensions.d.ts +0 -49
  197. package/dist/types-ts4.0/utils/containsPixelUnit.d.ts +0 -1
  198. package/dist/types-ts4.0/utils/dimensionComparer.d.ts +0 -3
  199. package/dist/types-ts4.0/utils/document.d.ts +0 -2
  200. package/dist/types-ts4.0/utils/errorIcon/index.d.ts +0 -12
  201. package/dist/types-ts4.0/utils/errorIcon/styles.d.ts +0 -1
  202. package/dist/types-ts4.0/utils/fileIcon/index.d.ts +0 -12
  203. package/dist/types-ts4.0/utils/fileIcon/styles.d.ts +0 -1
  204. package/dist/types-ts4.0/utils/generateUniqueId.d.ts +0 -1
  205. package/dist/types-ts4.0/utils/getCSSUnitValue.d.ts +0 -1
  206. package/dist/types-ts4.0/utils/getDataURIDimension.d.ts +0 -9
  207. package/dist/types-ts4.0/utils/getElementDimension.d.ts +0 -2
  208. package/dist/types-ts4.0/utils/getErrorMessage.d.ts +0 -2
  209. package/dist/types-ts4.0/utils/getMediaCardCursor.d.ts +0 -6
  210. package/dist/types-ts4.0/utils/globalScope/getSSRData.d.ts +0 -3
  211. package/dist/types-ts4.0/utils/globalScope/globalScope.d.ts +0 -21
  212. package/dist/types-ts4.0/utils/globalScope/index.d.ts +0 -4
  213. package/dist/types-ts4.0/utils/globalScope/types.d.ts +0 -8
  214. package/dist/types-ts4.0/utils/index.d.ts +0 -14
  215. package/dist/types-ts4.0/utils/isRetina.d.ts +0 -1
  216. package/dist/types-ts4.0/utils/isValidPercentageUnit.d.ts +0 -1
  217. package/dist/types-ts4.0/utils/lightCards/cardError.d.ts +0 -12
  218. package/dist/types-ts4.0/utils/lightCards/cardLoading.d.ts +0 -5
  219. package/dist/types-ts4.0/utils/lightCards/getDimensionsWithDefault.d.ts +0 -2
  220. package/dist/types-ts4.0/utils/lightCards/lightCardWrappers.d.ts +0 -5
  221. package/dist/types-ts4.0/utils/lightCards/styles.d.ts +0 -4
  222. package/dist/types-ts4.0/utils/lightCards/types.d.ts +0 -15
  223. package/dist/types-ts4.0/utils/media-card-analytics-error-boundary.d.ts +0 -10
  224. package/dist/types-ts4.0/utils/mediaTypeIcon/iconWrapper.d.ts +0 -4
  225. package/dist/types-ts4.0/utils/mediaTypeIcon/index.d.ts +0 -10
  226. package/dist/types-ts4.0/utils/mediaTypeIcon/styles.d.ts +0 -2
  227. package/dist/types-ts4.0/utils/mediaTypeIcon/types.d.ts +0 -6
  228. package/dist/types-ts4.0/utils/metadata.d.ts +0 -2
  229. package/dist/types-ts4.0/utils/objectURLCache.d.ts +0 -11
  230. package/dist/types-ts4.0/utils/preventClickThrough.d.ts +0 -8
  231. package/dist/types-ts4.0/utils/printScript.d.ts +0 -2
  232. package/dist/types-ts4.0/utils/progressBar/index.d.ts +0 -9
  233. package/dist/types-ts4.0/utils/progressBar/styles.d.ts +0 -1
  234. package/dist/types-ts4.0/utils/resizeModeToMediaImageProps.d.ts +0 -5
  235. package/dist/types-ts4.0/utils/shouldDisplayImageThumbnail.d.ts +0 -3
  236. package/dist/types-ts4.0/utils/ufoExperiences.d.ts +0 -7
  237. package/dist/types-ts4.0/utils/videoSnapshot.d.ts +0 -1
  238. package/dist/types-ts4.0/utils/viewportDetector.d.ts +0 -6
@@ -12,8 +12,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
12
12
 
13
13
  /**@jsx jsx */
14
14
  import { jsx } from '@emotion/react';
15
- import React from 'react';
16
- import { Component } from 'react';
15
+ import React, { Component } from 'react';
16
+ import { token } from '@atlaskit/tokens';
17
17
  import { Ellipsify, MediaImage } from '@atlaskit/media-ui';
18
18
  import VidPlayIcon from '@atlaskit/icon/glyph/vid-play';
19
19
  import { CardOverlay } from './cardOverlay';
@@ -233,7 +233,7 @@ export var FileCardImageView = /*#__PURE__*/function (_Component) {
233
233
  css: cardActionsWrapperStyles
234
234
  }, actions ? jsx(CardActions, {
235
235
  actions: actions,
236
- triggerColor: "white"
236
+ triggerColor: token('color.icon.inverse', 'white')
237
237
  }) : null))));
238
238
  });
239
239
 
@@ -3,6 +3,7 @@ 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';
6
7
  import { absolute, borderRadius, size } from '@atlaskit/media-ui';
7
8
  import { themed } from '@atlaskit/theme/components';
8
9
  import { N20, DN50, N0 } from '@atlaskit/theme/colors';
@@ -17,20 +18,22 @@ var getShadowAttribute = function getShadowAttribute(props) {
17
18
  var getBackgroundColor = function getBackgroundColor(props) {
18
19
  var mediaType = props.mediaType;
19
20
  return "background: ".concat(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
 
25
26
  export var wrapperStyles = function wrapperStyles(props) {
26
27
  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);
27
28
  };
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: white;\n\n /* we want to override default icon size and hover state */\n &:hover > * {\n width: 64px;\n height: 64px;\n }\n"])));
29
- export var playIconBackgroundStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: rgba(23, 43, 77, 0.7);\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"])));
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"])), token('color.icon.inverse', 'white'));
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"])), token('color.background.neutral.bold', 'rgba(23, 43, 77, 0.7)'));
30
31
  var bodyHeight = 26;
31
32
  export var progressBarWrapperStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n height: 100%;\n width: 100%;\n"])));
32
- export var overlayStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", "\n ", "\n border-radius: inherit;\n background-color: rgba(9, 30, 66, 0.5);\n"])), absolute(), size());
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(), 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"])), N0);
33
+ export var overlayStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", "\n ", "\n border-radius: inherit;\n background-color: ", ";\n"])), absolute(), size(), token('color.blanket', 'rgba(9, 30, 66, 0.5)'));
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(), token('color.text.inverse', N0));
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"])), token('color.text.inverse', N0));
36
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
37
+
35
38
  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);
36
39
  export var cardActionsWrapperStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin-left: 4px;\n /*\n button must appear above overlay\n */\n z-index: 2;\n"])));
@@ -157,7 +157,7 @@ export var getCardPreviewFromFilePreview = /*#__PURE__*/function () {
157
157
  };
158
158
  }();
159
159
  export var getCardPreviewFromBackend = /*#__PURE__*/function () {
160
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(mediaClient, id, params) {
160
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(mediaClient, id, params, traceContext) {
161
161
  var blob;
162
162
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
163
163
  while (1) {
@@ -165,7 +165,7 @@ export var getCardPreviewFromBackend = /*#__PURE__*/function () {
165
165
  case 0:
166
166
  _context4.prev = 0;
167
167
  _context4.next = 3;
168
- return mediaClient.getImage(id, params);
168
+ return mediaClient.getImage(id, params, undefined, undefined, traceContext);
169
169
 
170
170
  case 3:
171
171
  blob = _context4.sent;
@@ -188,7 +188,7 @@ export var getCardPreviewFromBackend = /*#__PURE__*/function () {
188
188
  }, _callee4, null, [[0, 7]]);
189
189
  }));
190
190
 
191
- return function getCardPreviewFromBackend(_x4, _x5, _x6) {
191
+ return function getCardPreviewFromBackend(_x4, _x5, _x6, _x7) {
192
192
  return _ref4.apply(this, arguments);
193
193
  };
194
194
  }();
@@ -77,13 +77,13 @@ var extendAndCachePreview = function extendAndCachePreview(id, mode, preview, me
77
77
 
78
78
  export var getCardPreview = /*#__PURE__*/function () {
79
79
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
80
- var mediaClient, id, _ref$dimensions, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, mode, cachedPreview, dimensionsAreBigger, localPreview, remotePreview;
80
+ var mediaClient, id, _ref$dimensions, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, traceContext, mode, cachedPreview, dimensionsAreBigger, localPreview, remotePreview;
81
81
 
82
82
  return _regeneratorRuntime.wrap(function _callee$(_context) {
83
83
  while (1) {
84
84
  switch (_context.prev = _context.next) {
85
85
  case 0:
86
- mediaClient = _ref.mediaClient, id = _ref.id, _ref$dimensions = _ref.dimensions, dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions, filePreview = _ref.filePreview, onLocalPreviewError = _ref.onLocalPreviewError, isRemotePreviewReady = _ref.isRemotePreviewReady, imageUrlParams = _ref.imageUrlParams, mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs, createAnalyticsEvent = _ref.createAnalyticsEvent, featureFlags = _ref.featureFlags;
86
+ mediaClient = _ref.mediaClient, id = _ref.id, _ref$dimensions = _ref.dimensions, dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions, filePreview = _ref.filePreview, onLocalPreviewError = _ref.onLocalPreviewError, isRemotePreviewReady = _ref.isRemotePreviewReady, imageUrlParams = _ref.imageUrlParams, mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs, createAnalyticsEvent = _ref.createAnalyticsEvent, featureFlags = _ref.featureFlags, traceContext = _ref.traceContext;
87
87
  mode = imageUrlParams.mode;
88
88
  cachedPreview = cardPreviewCache.get(id, mode);
89
89
  dimensionsAreBigger = isBigger(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions);
@@ -165,7 +165,7 @@ export var getCardPreview = /*#__PURE__*/function () {
165
165
 
166
166
  case 22:
167
167
  _context.next = 24;
168
- return fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs);
168
+ return fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs, traceContext);
169
169
 
170
170
  case 24:
171
171
  remotePreview = _context.sent;
@@ -245,14 +245,14 @@ export var isSSRDataPreview = function isSSRDataPreview(preview) {
245
245
  return preview.source === 'ssr-data';
246
246
  };
247
247
  export var fetchAndCacheRemotePreview = /*#__PURE__*/function () {
248
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(mediaClient, id, dimensions, params, mediaBlobUrlAttrs) {
248
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(mediaClient, id, dimensions, params, mediaBlobUrlAttrs, traceContext) {
249
249
  var remotePreview;
250
250
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
251
251
  while (1) {
252
252
  switch (_context2.prev = _context2.next) {
253
253
  case 0:
254
254
  _context2.next = 2;
255
- return getCardPreviewFromBackend(mediaClient, id, params);
255
+ return getCardPreviewFromBackend(mediaClient, id, params, traceContext);
256
256
 
257
257
  case 2:
258
258
  remotePreview = _context2.sent;
@@ -268,7 +268,7 @@ export var fetchAndCacheRemotePreview = /*#__PURE__*/function () {
268
268
  }, _callee2);
269
269
  }));
270
270
 
271
- return function fetchAndCacheRemotePreview(_x2, _x3, _x4, _x5, _x6) {
271
+ return function fetchAndCacheRemotePreview(_x2, _x3, _x4, _x5, _x6, _x7) {
272
272
  return _ref4.apply(this, arguments);
273
273
  };
274
274
  }();
@@ -5,6 +5,7 @@ var _templateObject, _templateObject2;
5
5
  import { css } from '@emotion/react';
6
6
  import { fontFamily } from '@atlaskit/theme/constants';
7
7
  import { fadeIn } from '@atlaskit/media-ui';
8
+ import { token } from '@atlaskit/tokens';
8
9
  export { defaultTransitionDuration } from './config';
9
10
  export { antialiased, borderRadiusLeft, capitalize, centerSelf, centerSelfX, centerSelfY, centerX, hexToRgb, rgba, spaceAround, transition, withAppearance } from './mixins';
10
11
  export { easeOutCubic, easeOutExpo } from './easing';
@@ -12,7 +13,7 @@ export { spin } from './animations';
12
13
  export var rootStyles = function rootStyles() {
13
14
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n font-family: ", ";\n\n * {\n box-sizing: border-box;\n }\n"])), fontFamily());
14
15
  };
15
- export var cardShadow = "\n box-shadow: 0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24);\n";
16
+ export var cardShadow = "\n box-shadow: ".concat(token('elevation.shadow.raised', '0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24)'), ";\n");
16
17
  export var fadeinImageStyles = function fadeinImageStyles() {
17
18
  return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n"])), fadeIn);
18
19
  };
@@ -2,11 +2,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject;
4
4
 
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { css } from '@emotion/react';
6
7
  import { transition } from '../../styles';
7
8
  import { N90A } from '@atlaskit/theme/colors';
8
9
  export var blanketClassName = 'media-card-blanket';
9
- export var fixedBlanketStyles = "background-color: ".concat(N90A, ";");
10
+ export var fixedBlanketStyles = "background-color: ".concat(token('color.blanket', N90A), ";");
10
11
  export var blanketStyles = function blanketStyles(isFixed) {
11
12
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n position: absolute;\n width: 100%;\n height: 100%;\n max-height: 100%;\n max-width: 100%;\n left: 0;\n top: 0;\n ", "\n"])), transition(), isFixed ? fixedBlanketStyles : '');
12
13
  };
@@ -2,6 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
4
 
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { css, keyframes } from '@emotion/react';
6
7
  import { N300 } from '@atlaskit/theme/colors';
7
8
  var breatheAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% { opacity: 1}\n 50% { opacity: 0.3 }\n 100% { opacity: 1; }"])));
@@ -10,7 +11,7 @@ var animatedStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplate
10
11
  var getStylesBasedOnProps = function getStylesBasedOnProps(_ref) {
11
12
  var animated = _ref.animated,
12
13
  reducedFont = _ref.reducedFont;
13
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n opacity: 1;\n font-weight: 450;\n ", "\n color: ", ";\n text-align: center;\n ", "\n margin-bottom: -1em;\n padding: 3px 10px;\n"])), reducedFont ? 'font-size: 0.7em;' : '', N300, animated ? animatedStyles : '');
14
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n opacity: 1;\n font-weight: 450;\n ", "\n color: ", ";\n text-align: center;\n ", "\n margin-bottom: -1em;\n padding: 3px 10px;\n"])), reducedFont ? 'font-size: 0.7em;' : '', token('color.text.subtlest', N300), animated ? animatedStyles : '');
14
15
  };
15
16
 
16
17
  export var iconMessageWrapperStyles = function iconMessageWrapperStyles(props) {
@@ -2,6 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
4
4
 
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { css } from '@emotion/react';
6
7
  import { generateResponsiveStyles } from '../progressBar/styles';
7
8
  import { N300 } from '@atlaskit/theme/colors';
@@ -10,7 +11,7 @@ export var warningIconWrapperStyles = css(_templateObject2 || (_templateObject2
10
11
  export var loadingRateLimitedTextWrapperStyles = function loadingRateLimitedTextWrapperStyles(_ref) {
11
12
  var breakpoint = _ref.breakpoint,
12
13
  positionBottom = _ref.positionBottom;
13
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: 10px;\n overflow: hidden;\n color: ", ";\n display: block;\n width: 100%;\n text-align: center;\n ", "\n"])), N300, generateResponsiveStyles(breakpoint, positionBottom, false, 1));
14
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: 10px;\n overflow: hidden;\n color: ", ";\n display: block;\n width: 100%;\n text-align: center;\n ", "\n"])), token('color.text.subtlest', N300), generateResponsiveStyles(breakpoint, positionBottom, false, 1));
14
15
  };
15
16
  loadingRateLimitedTextWrapperStyles.displayName = 'LoadingRateLimitedTextWrapper';
16
17
  export var couldntLoadWrapperStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-weight: 550;\n"])));
@@ -6,6 +6,7 @@ import { css } from '@emotion/react';
6
6
  import { fontFamily } from '@atlaskit/theme/constants';
7
7
  import { borderRadius } from '@atlaskit/media-ui';
8
8
  import { N20 } from '@atlaskit/theme/colors';
9
+ import { token } from '@atlaskit/tokens';
9
10
  import { hideNativeBrowserTextSelectionStyles } from '@atlaskit/editor-shared-styles/selection';
10
11
  import { transition } from '../../styles';
11
12
  import { fixedBlanketStyles, blanketClassName } from '../blanket/styles';
@@ -22,6 +23,6 @@ export var newFileExperienceWrapperStyles = function newFileExperienceWrapperSty
22
23
  isTickBoxSelectable = _ref.isTickBoxSelectable,
23
24
  shouldDisplayTooltip = _ref.shouldDisplayTooltip,
24
25
  mediaCardCursor = _ref.mediaCardCursor;
25
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground ? "background-color: ".concat(N20, ";") : '', borderRadius, getCursorStyle(mediaCardCursor), getWrapperShadow(disableOverlay, selected), generateResponsiveStyles(breakpoint), hideNativeBrowserTextSelectionStyles, getClickablePlayButtonStyles(isPlayButtonClickable), getSelectableTickBoxStyles(isTickBoxSelectable), blanketClassName, fixedBlanketStyles, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip ? "> div { width: 100%; height: 100% }" : '');
26
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n position: relative;\n font-family: ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n\n /* We use classnames from here exceptionally to be able to handle styles when the Card is on hover */\n ", "\n ", "\n &:hover .", " {\n ", "\n }\n &:hover .", " {\n ", "\n }\n\n /* Tooltip does not support percentage dimensions. We enforce them here */\n ", "\n"])), transition(), fontFamily(), getWrapperDimensions(dimensions, appearance), displayBackground && "background-color: ".concat(token('color.background.neutral', N20), ";"), borderRadius, getCursorStyle(mediaCardCursor), getWrapperShadow(disableOverlay, selected), generateResponsiveStyles(breakpoint), hideNativeBrowserTextSelectionStyles, getClickablePlayButtonStyles(isPlayButtonClickable), getSelectableTickBoxStyles(isTickBoxSelectable), blanketClassName, fixedBlanketStyles, actionsBarClassName, fixedActionBarStyles, shouldDisplayTooltip && "> div { width: 100%; height: 100%; }");
26
27
  };
27
28
  newFileExperienceWrapperStyles.displayName = 'NewFileExperienceWrapper';
@@ -4,10 +4,11 @@ var _templateObject, _templateObject2;
4
4
 
5
5
  import { css } from '@emotion/react';
6
6
  import { N0, N90A } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
7
8
  export var playButtonClassName = 'media-card-play-button';
8
9
  export var bkgClassName = 'play-icon-background';
9
10
  var discSize = 48;
10
11
  var discSizeHover = 56;
11
12
  export var fixedPlayButtonStyles = "\n .".concat(bkgClassName, " {\n width: ").concat(discSizeHover, "px;\n height: ").concat(discSizeHover, "px;\n }\n");
12
- export var playButtonWrapperStyles = css(_templateObject || (_templateObject = _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 span {\n position: absolute;\n }\n"])), N0);
13
- export var backgroundStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n transition-property: width, height;\n transition-duration: 0.1s;\n position: absolute;\n width: ", "px;\n height: ", "px;\n background: ", ";\n border-radius: 100%;\n"])), discSize, discSize, N90A);
13
+ export var playButtonWrapperStyles = css(_templateObject || (_templateObject = _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 span {\n position: absolute;\n }\n"])), token('color.icon.inverse', N0));
14
+ export var backgroundStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n transition-property: width, height;\n transition-duration: 0.1s;\n position: absolute;\n width: ", "px;\n height: ", "px;\n background: ", ";\n border-radius: 100%;\n"])), discSize, discSize, token('color.background.neutral.bold', N90A));
@@ -5,7 +5,7 @@ var _templateObject;
5
5
  import { css } from '@emotion/react';
6
6
  import { borderRadius } from '@atlaskit/media-ui';
7
7
  import { rgba } from '../../styles/mixins';
8
- import { N0, N400 } from '@atlaskit/theme/colors';
8
+ import { N0 } from '@atlaskit/theme/colors';
9
9
  import { Breakpoint, getTitleBoxHeight, responsiveSettings } from '../common';
10
10
  var height = 3;
11
11
  var padding = 1;
@@ -26,14 +26,17 @@ export function generateResponsiveStyles(breakpoint, positionBottom, showOnTop)
26
26
  var marginBottom = setting.marginBottom * multiplier + (positionBottom ? marginPositionBottom : getTitleBoxHeight(breakpoint));
27
27
  return "\n ".concat(showOnTop ? 'top' : 'bottom', ": ").concat(marginBottom, "px\n ");
28
28
  }
29
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
29
30
 
30
31
  var getStyledBarStylesBasedOnProps = function getStyledBarStylesBasedOnProps(_ref) {
31
32
  var progress = _ref.progress,
32
33
  breakpoint = _ref.breakpoint,
33
34
  positionBottom = _ref.positionBottom,
34
35
  showOnTop = _ref.showOnTop;
35
- return "\n".concat(borderRadius, "\noverflow: hidden;\nposition: absolute;\nwidth: ").concat(width, "%;\nleft: ").concat(left, "%;\nbackground-color: ").concat(rgba(N0, 0.8), ";\nheight: ").concat(height + padding * 2, "px;\npadding: ").concat(padding, "px;\nbox-sizing: border-box;\n\n::before {\n content: '';\n width: ").concat(progress, "%;\n height: 100%;\n background-color: ").concat(N400, ";\n ").concat(borderRadius, "\n display: block;\n}\n").concat(generateResponsiveStyles(breakpoint, positionBottom, showOnTop), "\n");
36
+ return "\n".concat(borderRadius, "\noverflow: hidden;\nposition: absolute;\nwidth: ").concat(width, "%;\nleft: ").concat(left, "%;\nbackground-color: ").concat(rgba(N0, 0.8), ";\nheight: ").concat(height + padding * 2, "px;\npadding: ").concat(padding, "px;\nbox-sizing: border-box;\n\n::before {\n content: '';\n width: ").concat(progress, "%;\n height: 100%;\n background-color: #44546F;\n ").concat(borderRadius, "\n display: block;\n}\n").concat(generateResponsiveStyles(breakpoint, positionBottom, showOnTop), "\n");
36
37
  };
38
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
39
+
37
40
 
38
41
  export var styledBarStyles = function styledBarStyles(props) {
39
42
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n "])), getStyledBarStylesBasedOnProps(props));
@@ -6,6 +6,7 @@ var _templateObject;
6
6
  import { css } from '@emotion/react';
7
7
  import { borderRadius } from '@atlaskit/media-ui';
8
8
  import { N60A } from '@atlaskit/theme/colors';
9
+ import { token } from '@atlaskit/tokens';
9
10
  import { akEditorSelectedBoxShadow } from '@atlaskit/editor-shared-styles/consts';
10
11
  import { getCSSUnitValue } from '../../utils/getCSSUnitValue';
11
12
  import { getDefaultCardDimensions } from '../../utils/cardDimensions';
@@ -47,7 +48,7 @@ export var getWrapperDimensions = function getWrapperDimensions(dimensions, appe
47
48
  // CSS outline has no 'radius', therefore we can't achieve the same effect with it
48
49
 
49
50
  export var getWrapperShadow = function getWrapperShadow(disableOverlay, selected) {
50
- var withOverlayShadow = !disableOverlay ? "0 1px 1px ".concat(N60A, ", 0 0 1px 0 ").concat(N60A) : '';
51
+ var withOverlayShadow = !disableOverlay ? "".concat(token('elevation.shadow.raised', "0 1px 1px ".concat(N60A, ", 0 0 1px 0 ").concat(N60A))) : '';
51
52
  var selectedShadow = selected ? akEditorSelectedBoxShadow : '';
52
53
  var shadow = [selectedShadow, withOverlayShadow].filter(Boolean).join(', ');
53
54
  return shadow ? "box-shadow: ".concat(shadow, ";") : '';
@@ -5,10 +5,11 @@ var _templateObject;
5
5
  import { css } from '@emotion/react';
6
6
  import { transition } from '../../styles';
7
7
  import { B200, N0, N100 } from '@atlaskit/theme/colors';
8
+ import { token } from '@atlaskit/tokens';
8
9
  export var tickBoxClassName = 'media-card-tickbox';
9
- export var tickboxFixedStyles = "\n background-color: ".concat(N0, ";\n color: ").concat(N100, ";\n");
10
+ export var tickboxFixedStyles = "\n background-color: ".concat(token('color.background.input', N0), ";\n color: ").concat(token('color.icon.subtle', N100), ";\n");
10
11
  export var getSelectedStyles = function getSelectedStyles(selected) {
11
- return selected ? "background-color: ".concat(B200, ";\n color: white;") : "";
12
+ return selected ? "background-color: ".concat(token('color.icon.information', B200), ";\n color: ").concat(token('color.icon.inverse', 'white'), ";") : "";
12
13
  };
13
14
  export var wrapperStyles = function wrapperStyles(selected) {
14
15
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n font-size: 14px;\n width: 14px;\n height: 14px;\n position: absolute;\n top: 7px;\n left: 7px;\n border-radius: 20px;\n color: transparent;\n /* Enforce dimensions and position of \"tick\" icon */\n span {\n display: block;\n svg {\n height: 14px;\n }\n }\n ", "\n"])), transition(), getSelectedStyles(selected));
@@ -3,6 +3,7 @@ import { FormattedMessage } from 'react-intl-next';
3
3
  import EditorWarningIcon from '@atlaskit/icon/glyph/editor/warning';
4
4
  import { messages } from '@atlaskit/media-ui';
5
5
  import { R300 } from '@atlaskit/theme/colors';
6
+ import { token } from '@atlaskit/tokens';
6
7
  import { ErrorMessageWrapper, TitleBoxWrapper } from './titleBoxComponents';
7
8
  export var FailedTitleBox = function FailedTitleBox(_ref) {
8
9
  var breakpoint = _ref.breakpoint,
@@ -13,6 +14,6 @@ export var FailedTitleBox = function FailedTitleBox(_ref) {
13
14
  }, /*#__PURE__*/React.createElement(ErrorMessageWrapper, null, /*#__PURE__*/React.createElement(EditorWarningIcon, {
14
15
  label: 'Warning',
15
16
  size: 'small',
16
- primaryColor: R300
17
+ primaryColor: token('color.text.danger', R300)
17
18
  }), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, customMessage))));
18
19
  };
@@ -3,6 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
4
4
 
5
5
  import { css } from '@emotion/react';
6
+ import { token } from '@atlaskit/tokens';
6
7
  import { responsiveSettings, getTitleBoxHeight, Breakpoint } from '../common';
7
8
  import { N0 } from '@atlaskit/theme/colors';
8
9
  import { rgba } from '../../styles/mixins';
@@ -20,7 +21,7 @@ var HEX_REGEX = /^#[0-9A-F]{6}$/i;
20
21
  export var titleBoxWrapperStyles = function titleBoxWrapperStyles(_ref) {
21
22
  var breakpoint = _ref.breakpoint,
22
23
  titleBoxBgColor = _ref.titleBoxBgColor;
23
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: inherit;\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 0.8), generateResponsiveStyles(breakpoint));
24
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n width: 100%;\n background-color: ", ";\n color: inherit;\n cursor: inherit;\n pointer-events: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n"])), token('elevation.surface', rgba(titleBoxBgColor && HEX_REGEX.test(titleBoxBgColor) ? titleBoxBgColor : N0, 0.8)), generateResponsiveStyles(breakpoint));
24
25
  };
25
26
  titleBoxWrapperStyles.displayName = 'TitleBoxWrapper';
26
27
  var infoStyles = "white-space: nowrap;\n overflow: hidden;";
@@ -41,18 +41,21 @@ export var getRenderPreviewableCardPayload = function getRenderPreviewableCardPa
41
41
  }
42
42
  };
43
43
  };
44
- export var getRenderCommencedEventPayload = function getRenderCommencedEventPayload(fileAttributes, performanceAttributes) {
44
+ export var getRenderCommencedEventPayload = function getRenderCommencedEventPayload(fileAttributes, performanceAttributes, traceContext) {
45
45
  return {
46
46
  eventType: 'operational',
47
47
  action: 'commenced',
48
48
  actionSubject: 'mediaCardRender',
49
49
  attributes: {
50
50
  fileAttributes: fileAttributes,
51
- performanceAttributes: performanceAttributes
51
+ performanceAttributes: performanceAttributes,
52
+ traceContext: {
53
+ traceId: traceContext.traceId
54
+ }
52
55
  }
53
56
  };
54
57
  };
55
- export var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability) {
58
+ export var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext) {
56
59
  return {
57
60
  eventType: 'operational',
58
61
  action: 'succeeded',
@@ -61,7 +64,8 @@ export var getRenderSucceededEventPayload = function getRenderSucceededEventPayl
61
64
  fileAttributes: fileAttributes,
62
65
  performanceAttributes: performanceAttributes,
63
66
  status: 'success',
64
- ssrReliability: ssrReliability
67
+ ssrReliability: ssrReliability,
68
+ traceContext: traceContext
65
69
  }
66
70
  };
67
71
  };
@@ -135,7 +139,7 @@ export var extractErrorInfo = function extractErrorInfo(error) {
135
139
  errorDetail: getRenderErrorErrorDetail(error)
136
140
  };
137
141
  };
138
- export var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability) {
142
+ export var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext) {
139
143
  return {
140
144
  eventType: 'operational',
141
145
  action: 'failed',
@@ -146,11 +150,12 @@ export var getRenderErrorEventPayload = function getRenderErrorEventPayload(file
146
150
  status: 'fail'
147
151
  }, extractErrorInfo(error)), {}, {
148
152
  request: getRenderErrorRequestMetadata(error),
149
- ssrReliability: ssrReliability
153
+ ssrReliability: ssrReliability,
154
+ traceContext: traceContext
150
155
  })
151
156
  };
152
157
  };
153
- export var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability) {
158
+ export var getRenderFailedFileStatusPayload = function getRenderFailedFileStatusPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext) {
154
159
  return {
155
160
  eventType: 'operational',
156
161
  action: 'failed',
@@ -160,7 +165,8 @@ export var getRenderFailedFileStatusPayload = function getRenderFailedFileStatus
160
165
  performanceAttributes: performanceAttributes,
161
166
  status: 'fail',
162
167
  failReason: 'failed-processing',
163
- ssrReliability: ssrReliability
168
+ ssrReliability: ssrReliability,
169
+ traceContext: traceContext
164
170
  }
165
171
  };
166
172
  };
@@ -4,8 +4,10 @@ var _templateObject, _templateObject2;
4
4
 
5
5
  import { css } from '@emotion/react';
6
6
  import { N500, N0 } from '@atlaskit/theme/colors';
7
+ import { token } from '@atlaskit/tokens';
7
8
  import { borderRadius, size, center } from '@atlaskit/media-ui';
8
9
  import { rootStyles } from '../../card/styles';
10
+ import { rgba } from '../../card/styles/mixins';
9
11
  export var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n display: flex;\n position: relative;\n line-height: 0;\n"])), rootStyles());
10
12
  export var CardActionIconButtonVariant;
11
13
 
@@ -15,10 +17,10 @@ export var CardActionIconButtonVariant;
15
17
  })(CardActionIconButtonVariant || (CardActionIconButtonVariant = {}));
16
18
 
17
19
  var getVariantStyles = function getVariantStyles(variant) {
18
- return variant === 'filled' ? "\n background: ".concat(N0, ";\n margin-right: 8px;\n opacity: 0.8;\n\n &:last-child {\n margin-right: 0;\n }\n\n &:hover {\n opacity: 0.6;\n }\n ") : "\n &:hover {\n background-color: rgba(9, 30, 66, 0.06);\n }\n ";
20
+ return variant === 'filled' ? "\n background-color: ".concat(token('elevation.surface.overlay', rgba(N0, 0.8)), ";\n margin-right: 8px;\n\n &:last-child {\n margin-right: 0;\n }\n\n &:hover {\n background-color: ").concat(token('elevation.surface.overlay.hovered', rgba(N0, 0.6)), "\n }\n ") : "\n &:hover {\n background-color: ".concat(token('color.background.neutral.subtle.hovered', 'rgba(9, 30, 66, 0.06)'), ";\n }\n ");
19
21
  };
20
22
 
21
23
  export var cardActionButtonStyles = function cardActionButtonStyles(_ref) {
22
24
  var variant = _ref.variant;
23
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), center, borderRadius, size(26), N500, getVariantStyles(variant));
25
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), center, borderRadius, size(26), token('color.icon', N500), getVariantStyles(variant));
24
26
  };
@@ -2,5 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject;
4
4
 
5
+ import { token } from '@atlaskit/tokens';
5
6
  import { css } from '@emotion/react';
6
- export var errorIconWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n color: #ff991f;\n"])));
7
+ export var errorIconWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n color: ", ";\n"])), token('color.icon.warning', '#ff991f'));
@@ -11,7 +11,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
11
11
  /**@jsx jsx */
12
12
  import { jsx } from '@emotion/react';
13
13
  import { Component } from 'react';
14
- import { MediaTypeIcon } from '../mediaTypeIcon';
14
+ import { MediaTypeIcon } from '@atlaskit/media-ui/media-type-icon';
15
15
  import { fileTypeIconStyles } from './styles';
16
16
  var fileTypeIconClass = 'file-type-icon';
17
17
  export var FileIcon = /*#__PURE__*/function (_Component) {
@@ -2,8 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2, _templateObject3;
4
4
 
5
- import { css } from '@emotion/react';
6
- import { keyframes } from '@emotion/react';
5
+ import { css, keyframes } from '@emotion/react';
6
+ import { token } from '@atlaskit/tokens';
7
7
  import { center, borderRadius } from '@atlaskit/media-ui';
8
8
  import { themed } from '@atlaskit/theme/components';
9
9
  import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
@@ -12,13 +12,13 @@ export var wrapperStyles = function wrapperStyles(_ref) {
12
12
  var dimensions = _ref.dimensions,
13
13
  theme = _ref.theme;
14
14
  return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n background: ", ";\n color: ", ";\n ", "\n max-height: 100%;\n max-width: 100%;\n width: ", ";\n height: ", ";\n"])), center, themed({
15
- light: N20,
16
- dark: DN50
15
+ light: token('color.background.neutral', N20),
16
+ dark: token('color.background.neutral', DN50)
17
17
  })({
18
18
  theme: theme
19
19
  }), themed({
20
- light: N50,
21
- dark: DN100
20
+ light: token('color.icon', N50),
21
+ dark: token('color.icon', DN100)
22
22
  })({
23
23
  theme: theme
24
24
  }), borderRadius, dimensions.width, dimensions.height);
@@ -2,6 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject;
4
4
 
5
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
5
6
  import { css } from '@emotion/react';
6
7
  import { borderRadius } from '@atlaskit/media-ui';
7
8
  export var progressWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", " z-index: 30;\n overflow: hidden;\n background-color: rgba(255, 255, 255, 0.3);\n\n .progressBar {\n width: 0%;\n height: 3px;\n transition: width 0.25s ease-in;\n background-color: white;\n }\n"])), borderRadius);
@@ -9,7 +9,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata, LOGGED_FEATURE_FLAG_KE
9
9
  import { MediaCardError } from '../errors';
10
10
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
11
11
  var packageName = "@atlaskit/media-card";
12
- var packageVersion = "74.1.9";
12
+ var packageVersion = "74.3.0";
13
13
  var concurrentExperience;
14
14
 
15
15
  var getExperience = function getExperience(id) {
@@ -1,23 +1,49 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import VideoSnapshot from 'video-snapshot';
4
3
  export var takeSnapshot = /*#__PURE__*/function () {
5
4
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(blob) {
6
- var snapshooter, dataUri;
7
5
  return _regeneratorRuntime.wrap(function _callee$(_context) {
8
6
  while (1) {
9
7
  switch (_context.prev = _context.next) {
10
8
  case 0:
11
- snapshooter = new VideoSnapshot(blob);
12
- _context.next = 3;
13
- return snapshooter.takeSnapshot();
9
+ return _context.abrupt("return", new Promise(function (resolve, reject) {
10
+ var url = URL.createObjectURL(blob);
11
+ var video = document.createElement('video');
12
+ video.preload = 'metadata';
13
+ video.src = url;
14
+ video.muted = true;
15
+ video.play().catch(function () {
16
+ return reject(new Error('failed to play video'));
17
+ });
18
+ video.addEventListener('timeupdate', function timeUpdateHandler() {
19
+ video.removeEventListener('timeupdate', timeUpdateHandler);
20
+ video.pause();
21
+ URL.revokeObjectURL(url); //create canvas to draw our first frame on.
14
22
 
15
- case 3:
16
- dataUri = _context.sent;
17
- snapshooter.end();
18
- return _context.abrupt("return", dataUri);
23
+ if (!video.videoWidth && !video.videoHeight) {
24
+ return reject(new Error('error retrieving video dimensions'));
25
+ }
19
26
 
20
- case 6:
27
+ var canvas = document.createElement('canvas');
28
+ canvas.width = video.videoWidth;
29
+ canvas.height = video.videoHeight;
30
+ var context = canvas.getContext('2d');
31
+
32
+ if (!context) {
33
+ return reject(new Error('error creating canvas context'));
34
+ }
35
+
36
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
37
+ var dataURL = canvas.toDataURL('image/jpeg', 0.85);
38
+ resolve(dataURL);
39
+ });
40
+ video.addEventListener('error', function () {
41
+ reject(new Error('failed to load video'));
42
+ URL.revokeObjectURL(url);
43
+ });
44
+ }));
45
+
46
+ case 1:
21
47
  case "end":
22
48
  return _context.stop();
23
49
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.1.9",
3
+ "version": "74.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -13,6 +13,7 @@ export declare class CardBase extends Component<CardBaseProps, CardState> {
13
13
  private timeElapsedTillCommenced;
14
14
  subscription?: MediaSubscription;
15
15
  private ssrData?;
16
+ private traceContext;
16
17
  static defaultProps: Partial<CardProps>;
17
18
  constructor(props: CardBaseProps);
18
19
  componentDidMount(): void;
@@ -1,9 +1,9 @@
1
- import { FileAttributes, PerformanceAttributes } from '@atlaskit/media-common';
1
+ import { FileAttributes, MediaTraceContext, PerformanceAttributes } from '@atlaskit/media-common';
2
2
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import { SSRStatus } from '../utils/analytics';
4
4
  import { CardStatus } from '../types';
5
5
  import { MediaCardError } from '../errors';
6
- export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error?: MediaCardError) => void;
7
- export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => void;
6
+ export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext) => void;
7
+ export declare const fireCommencedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, traceContext: MediaTraceContext) => void;
8
8
  export declare const fireCopiedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileId: string, cardRef: HTMLDivElement) => void;
9
9
  export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;