@atlaskit/media-card 74.5.0 → 74.5.2

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 (267) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/card/actions.js +0 -5
  3. package/dist/cjs/card/card.js +126 -260
  4. package/dist/cjs/card/cardAnalytics.js +0 -18
  5. package/dist/cjs/card/cardImageView/cardImageViewWrapper.js +7 -16
  6. package/dist/cjs/card/cardImageView/cardOverlay/cardOverlayComponents.js +3 -15
  7. package/dist/cjs/card/cardImageView/cardOverlay/index.js +20 -52
  8. package/dist/cjs/card/cardImageView/cardOverlay/styles.js +1 -19
  9. package/dist/cjs/card/cardImageView/cardViewWrapper.js +7 -10
  10. package/dist/cjs/card/cardImageView/fileCardImageView.js +66 -111
  11. package/dist/cjs/card/cardImageView/index.js +0 -1
  12. package/dist/cjs/card/cardImageView/styles.js +0 -14
  13. package/dist/cjs/card/cardLoader.js +3 -20
  14. package/dist/cjs/card/cardState.js +0 -9
  15. package/dist/cjs/card/cardView.js +105 -198
  16. package/dist/cjs/card/getCardPreview/cache.js +0 -12
  17. package/dist/cjs/card/getCardPreview/filePreviewStatus.js +8 -16
  18. package/dist/cjs/card/getCardPreview/helpers.js +0 -39
  19. package/dist/cjs/card/getCardPreview/imageRefetchingAnalytics.js +0 -8
  20. package/dist/cjs/card/getCardPreview/index.js +16 -85
  21. package/dist/cjs/card/getCardStatus.js +5 -24
  22. package/dist/cjs/card/index.js +0 -2
  23. package/dist/cjs/card/inlinePlayer.js +19 -102
  24. package/dist/cjs/card/inlinePlayerLazy.js +0 -11
  25. package/dist/cjs/card/inlinePlayerWrapper.js +5 -8
  26. package/dist/cjs/card/media-card-analytics-error-boundary.js +6 -34
  27. package/dist/cjs/card/styles/animations.js +0 -5
  28. package/dist/cjs/card/styles/getSelectedBorderStyle.js +0 -4
  29. package/dist/cjs/card/styles/index.js +0 -14
  30. package/dist/cjs/card/styles/mixins.js +0 -11
  31. package/dist/cjs/card/styles/styles.js +4 -20
  32. package/dist/cjs/card/ui/actionsBar/actionsBar.js +2 -20
  33. package/dist/cjs/card/ui/actionsBar/actionsBarWrapper.js +1 -4
  34. package/dist/cjs/card/ui/actionsBar/styles.js +0 -8
  35. package/dist/cjs/card/ui/blanket/blanket.js +1 -4
  36. package/dist/cjs/card/ui/blanket/styles.js +0 -9
  37. package/dist/cjs/card/ui/common.js +0 -8
  38. package/dist/cjs/card/ui/iconMessage/iconMessageWrapper.js +2 -5
  39. package/dist/cjs/card/ui/iconMessage/index.js +4 -22
  40. package/dist/cjs/card/ui/iconMessage/styles.js +1 -10
  41. package/dist/cjs/card/ui/iconWrapper/iconWrapper.js +2 -5
  42. package/dist/cjs/card/ui/iconWrapper/styles.js +3 -11
  43. package/dist/cjs/card/ui/imageRenderer/imageRenderer.js +8 -21
  44. package/dist/cjs/card/ui/loadingRateLimited/styles.js +1 -10
  45. package/dist/cjs/card/ui/newFileExperience/newFileExperienceWrapper.js +14 -19
  46. package/dist/cjs/card/ui/newFileExperience/styles.js +10 -26
  47. package/dist/cjs/card/ui/playButton/playButton.js +0 -7
  48. package/dist/cjs/card/ui/playButton/playButtonBackground.js +1 -4
  49. package/dist/cjs/card/ui/playButton/playButtonWrapper.js +1 -4
  50. package/dist/cjs/card/ui/playButton/styles.js +0 -6
  51. package/dist/cjs/card/ui/progressBar/progressBar.js +6 -14
  52. package/dist/cjs/card/ui/progressBar/styledBar.js +4 -7
  53. package/dist/cjs/card/ui/progressBar/styles.js +4 -18
  54. package/dist/cjs/card/ui/styles.js +12 -46
  55. package/dist/cjs/card/ui/tickBox/styles.js +0 -11
  56. package/dist/cjs/card/ui/tickBox/tickBox.js +0 -6
  57. package/dist/cjs/card/ui/tickBox/tickBoxWrapper.js +1 -4
  58. package/dist/cjs/card/ui/titleBox/failedTitleBox.js +2 -11
  59. package/dist/cjs/card/ui/titleBox/styles.js +4 -19
  60. package/dist/cjs/card/ui/titleBox/titleBox.js +9 -21
  61. package/dist/cjs/card/ui/titleBox/titleBoxComponents.js +2 -14
  62. package/dist/cjs/card/ui/unhandledErrorCard/index.js +6 -36
  63. package/dist/cjs/classnames.js +0 -1
  64. package/dist/cjs/errors.js +7 -66
  65. package/dist/cjs/index.js +0 -8
  66. package/dist/cjs/inline/index.js +0 -2
  67. package/dist/cjs/inline/loader.js +2 -43
  68. package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +4 -29
  69. package/dist/cjs/inline/mediaInlineCard.js +21 -57
  70. package/dist/cjs/types.js +0 -2
  71. package/dist/cjs/utils/analytics.js +0 -49
  72. package/dist/cjs/utils/breakpoint.js +0 -10
  73. package/dist/cjs/utils/cardActions/cardActionButton.js +1 -4
  74. package/dist/cjs/utils/cardActions/cardActionIconButton.js +7 -29
  75. package/dist/cjs/utils/cardActions/cardActionsDropdownMenu.js +6 -35
  76. package/dist/cjs/utils/cardActions/cardActionsView.js +7 -34
  77. package/dist/cjs/utils/cardActions/index.js +0 -4
  78. package/dist/cjs/utils/cardActions/styles.js +0 -13
  79. package/dist/cjs/utils/cardDimensions.js +5 -22
  80. package/dist/cjs/utils/containsPixelUnit.js +0 -2
  81. package/dist/cjs/utils/dimensionComparer.js +0 -8
  82. package/dist/cjs/utils/document.js +0 -4
  83. package/dist/cjs/utils/errorIcon/index.js +0 -18
  84. package/dist/cjs/utils/errorIcon/styles.js +0 -5
  85. package/dist/cjs/utils/fileIcon/index.js +3 -21
  86. package/dist/cjs/utils/fileIcon/styles.js +0 -6
  87. package/dist/cjs/utils/generateUniqueId.js +0 -2
  88. package/dist/cjs/utils/getCSSUnitValue.js +0 -1
  89. package/dist/cjs/utils/getDataURIDimension.js +0 -13
  90. package/dist/cjs/utils/getElementDimension.js +0 -2
  91. package/dist/cjs/utils/getErrorMessage.js +0 -6
  92. package/dist/cjs/utils/getMediaCardCursor.js +1 -6
  93. package/dist/cjs/utils/globalScope/getSSRData.js +0 -5
  94. package/dist/cjs/utils/globalScope/globalScope.js +8 -25
  95. package/dist/cjs/utils/globalScope/index.js +0 -2
  96. package/dist/cjs/utils/index.js +0 -12
  97. package/dist/cjs/utils/isRetina.js +0 -1
  98. package/dist/cjs/utils/isValidPercentageUnit.js +0 -2
  99. package/dist/cjs/utils/lightCards/cardError.js +0 -21
  100. package/dist/cjs/utils/lightCards/cardLoading.js +3 -27
  101. package/dist/cjs/utils/lightCards/getDimensionsWithDefault.js +0 -2
  102. package/dist/cjs/utils/lightCards/lightCardWrappers.js +1 -9
  103. package/dist/cjs/utils/lightCards/styles.js +1 -13
  104. package/dist/cjs/utils/metadata.js +0 -7
  105. package/dist/cjs/utils/objectURLCache.js +0 -22
  106. package/dist/cjs/utils/preventClickThrough.js +0 -5
  107. package/dist/cjs/utils/printScript.js +0 -10
  108. package/dist/cjs/utils/progressBar/index.js +0 -17
  109. package/dist/cjs/utils/progressBar/styles.js +0 -6
  110. package/dist/cjs/utils/resizeModeToMediaImageProps.js +0 -1
  111. package/dist/cjs/utils/shouldDisplayImageThumbnail.js +0 -5
  112. package/dist/cjs/utils/ufoExperiences.js +1 -21
  113. package/dist/cjs/utils/videoSnapshot.js +2 -11
  114. package/dist/cjs/utils/viewportDetector.js +5 -24
  115. package/dist/cjs/version.json +1 -1
  116. package/dist/es2019/card/actions.js +2 -1
  117. package/dist/es2019/card/card.js +26 -121
  118. package/dist/es2019/card/cardAnalytics.js +0 -5
  119. package/dist/es2019/card/cardImageView/cardOverlay/index.js +2 -16
  120. package/dist/es2019/card/cardImageView/cardOverlay/styles.js +1 -2
  121. package/dist/es2019/card/cardImageView/fileCardImageView.js +3 -36
  122. package/dist/es2019/card/cardImageView/styles.js +0 -3
  123. package/dist/es2019/card/cardLoader.js +3 -14
  124. package/dist/es2019/card/cardState.js +1 -2
  125. package/dist/es2019/card/cardView.js +24 -68
  126. package/dist/es2019/card/getCardPreview/cache.js +0 -4
  127. package/dist/es2019/card/getCardPreview/filePreviewStatus.js +8 -5
  128. package/dist/es2019/card/getCardPreview/helpers.js +0 -9
  129. package/dist/es2019/card/getCardPreview/imageRefetchingAnalytics.js +0 -3
  130. package/dist/es2019/card/getCardPreview/index.js +16 -30
  131. package/dist/es2019/card/getCardStatus.js +2 -15
  132. package/dist/es2019/card/inlinePlayer.js +2 -35
  133. package/dist/es2019/card/inlinePlayerLazy.js +1 -2
  134. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -15
  135. package/dist/es2019/card/styles/getSelectedBorderStyle.js +1 -1
  136. package/dist/es2019/card/styles/styles.js +0 -3
  137. package/dist/es2019/card/ui/actionsBar/actionsBar.js +0 -3
  138. package/dist/es2019/card/ui/common.js +0 -2
  139. package/dist/es2019/card/ui/iconMessage/styles.js +0 -2
  140. package/dist/es2019/card/ui/iconWrapper/styles.js +2 -2
  141. package/dist/es2019/card/ui/imageRenderer/imageRenderer.js +0 -3
  142. package/dist/es2019/card/ui/progressBar/styles.js +1 -3
  143. package/dist/es2019/card/ui/styles.js +3 -4
  144. package/dist/es2019/card/ui/titleBox/styles.js +2 -3
  145. package/dist/es2019/card/ui/unhandledErrorCard/index.js +0 -8
  146. package/dist/es2019/errors.js +8 -17
  147. package/dist/es2019/index.js +1 -0
  148. package/dist/es2019/inline/loader.js +1 -18
  149. package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +1 -12
  150. package/dist/es2019/inline/mediaInlineCard.js +0 -15
  151. package/dist/es2019/types.js +1 -1
  152. package/dist/es2019/utils/analytics.js +0 -3
  153. package/dist/es2019/utils/breakpoint.js +0 -4
  154. package/dist/es2019/utils/cardActions/cardActionIconButton.js +3 -5
  155. package/dist/es2019/utils/cardActions/cardActionsDropdownMenu.js +0 -5
  156. package/dist/es2019/utils/cardActions/cardActionsView.js +0 -10
  157. package/dist/es2019/utils/cardActions/styles.js +0 -3
  158. package/dist/es2019/utils/cardDimensions.js +7 -14
  159. package/dist/es2019/utils/dimensionComparer.js +0 -3
  160. package/dist/es2019/utils/document.js +0 -2
  161. package/dist/es2019/utils/errorIcon/index.js +0 -3
  162. package/dist/es2019/utils/fileIcon/index.js +0 -1
  163. package/dist/es2019/utils/getDataURIDimension.js +0 -4
  164. package/dist/es2019/utils/getMediaCardCursor.js +1 -4
  165. package/dist/es2019/utils/globalScope/getSSRData.js +0 -2
  166. package/dist/es2019/utils/globalScope/globalScope.js +3 -10
  167. package/dist/es2019/utils/lightCards/cardError.js +0 -3
  168. package/dist/es2019/utils/lightCards/cardLoading.js +0 -3
  169. package/dist/es2019/utils/lightCards/lightCardWrappers.js +0 -1
  170. package/dist/es2019/utils/metadata.js +0 -5
  171. package/dist/es2019/utils/objectURLCache.js +0 -10
  172. package/dist/es2019/utils/printScript.js +0 -3
  173. package/dist/es2019/utils/progressBar/index.js +0 -2
  174. package/dist/es2019/utils/shouldDisplayImageThumbnail.js +0 -2
  175. package/dist/es2019/utils/ufoExperiences.js +5 -10
  176. package/dist/es2019/utils/videoSnapshot.js +2 -4
  177. package/dist/es2019/utils/viewportDetector.js +0 -5
  178. package/dist/es2019/version.json +1 -1
  179. package/dist/esm/card/actions.js +0 -3
  180. package/dist/esm/card/card.js +126 -254
  181. package/dist/esm/card/cardAnalytics.js +0 -6
  182. package/dist/esm/card/cardImageView/cardImageViewWrapper.js +6 -6
  183. package/dist/esm/card/cardImageView/cardOverlay/cardOverlayComponents.js +2 -2
  184. package/dist/esm/card/cardImageView/cardOverlay/index.js +22 -37
  185. package/dist/esm/card/cardImageView/cardOverlay/styles.js +2 -6
  186. package/dist/esm/card/cardImageView/cardViewWrapper.js +6 -6
  187. package/dist/esm/card/cardImageView/fileCardImageView.js +66 -104
  188. package/dist/esm/card/cardImageView/styles.js +0 -5
  189. package/dist/esm/card/cardLoader.js +6 -17
  190. package/dist/esm/card/cardState.js +1 -2
  191. package/dist/esm/card/cardView.js +105 -171
  192. package/dist/esm/card/getCardPreview/cache.js +0 -7
  193. package/dist/esm/card/getCardPreview/filePreviewStatus.js +11 -11
  194. package/dist/esm/card/getCardPreview/helpers.js +0 -28
  195. package/dist/esm/card/getCardPreview/imageRefetchingAnalytics.js +0 -3
  196. package/dist/esm/card/getCardPreview/index.js +16 -53
  197. package/dist/esm/card/getCardStatus.js +5 -20
  198. package/dist/esm/card/inlinePlayer.js +19 -85
  199. package/dist/esm/card/inlinePlayerLazy.js +1 -5
  200. package/dist/esm/card/inlinePlayerWrapper.js +4 -4
  201. package/dist/esm/card/media-card-analytics-error-boundary.js +6 -28
  202. package/dist/esm/card/styles/animations.js +0 -2
  203. package/dist/esm/card/styles/getSelectedBorderStyle.js +1 -1
  204. package/dist/esm/card/styles/index.js +0 -2
  205. package/dist/esm/card/styles/styles.js +4 -9
  206. package/dist/esm/card/ui/actionsBar/actionsBar.js +2 -12
  207. package/dist/esm/card/ui/actionsBar/styles.js +0 -2
  208. package/dist/esm/card/ui/blanket/styles.js +0 -2
  209. package/dist/esm/card/ui/common.js +0 -4
  210. package/dist/esm/card/ui/iconMessage/iconMessageWrapper.js +1 -1
  211. package/dist/esm/card/ui/iconMessage/index.js +4 -4
  212. package/dist/esm/card/ui/iconMessage/styles.js +1 -5
  213. package/dist/esm/card/ui/iconWrapper/iconWrapper.js +1 -1
  214. package/dist/esm/card/ui/iconWrapper/styles.js +3 -5
  215. package/dist/esm/card/ui/imageRenderer/imageRenderer.js +8 -11
  216. package/dist/esm/card/ui/loadingRateLimited/styles.js +1 -3
  217. package/dist/esm/card/ui/newFileExperience/newFileExperienceWrapper.js +13 -13
  218. package/dist/esm/card/ui/newFileExperience/styles.js +10 -12
  219. package/dist/esm/card/ui/playButton/styles.js +0 -2
  220. package/dist/esm/card/ui/progressBar/progressBar.js +6 -6
  221. package/dist/esm/card/ui/progressBar/styledBar.js +3 -3
  222. package/dist/esm/card/ui/progressBar/styles.js +4 -8
  223. package/dist/esm/card/ui/styles.js +12 -20
  224. package/dist/esm/card/ui/tickBox/styles.js +0 -2
  225. package/dist/esm/card/ui/titleBox/failedTitleBox.js +2 -2
  226. package/dist/esm/card/ui/titleBox/styles.js +4 -7
  227. package/dist/esm/card/ui/titleBox/titleBox.js +9 -11
  228. package/dist/esm/card/ui/titleBox/titleBoxComponents.js +1 -1
  229. package/dist/esm/card/ui/unhandledErrorCard/index.js +6 -24
  230. package/dist/esm/errors.js +8 -40
  231. package/dist/esm/index.js +1 -0
  232. package/dist/esm/inline/loader.js +3 -40
  233. package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +4 -23
  234. package/dist/esm/inline/mediaInlineCard.js +21 -40
  235. package/dist/esm/types.js +1 -1
  236. package/dist/esm/utils/analytics.js +0 -6
  237. package/dist/esm/utils/breakpoint.js +0 -5
  238. package/dist/esm/utils/cardActions/cardActionIconButton.js +7 -18
  239. package/dist/esm/utils/cardActions/cardActionsDropdownMenu.js +6 -19
  240. package/dist/esm/utils/cardActions/cardActionsView.js +7 -22
  241. package/dist/esm/utils/cardActions/styles.js +0 -5
  242. package/dist/esm/utils/cardDimensions.js +7 -14
  243. package/dist/esm/utils/dimensionComparer.js +0 -3
  244. package/dist/esm/utils/document.js +0 -2
  245. package/dist/esm/utils/errorIcon/index.js +0 -9
  246. package/dist/esm/utils/errorIcon/styles.js +0 -2
  247. package/dist/esm/utils/fileIcon/index.js +3 -11
  248. package/dist/esm/utils/fileIcon/styles.js +0 -2
  249. package/dist/esm/utils/getDataURIDimension.js +0 -4
  250. package/dist/esm/utils/getMediaCardCursor.js +1 -4
  251. package/dist/esm/utils/globalScope/getSSRData.js +0 -2
  252. package/dist/esm/utils/globalScope/globalScope.js +8 -15
  253. package/dist/esm/utils/lightCards/cardError.js +0 -9
  254. package/dist/esm/utils/lightCards/cardLoading.js +3 -13
  255. package/dist/esm/utils/lightCards/lightCardWrappers.js +0 -1
  256. package/dist/esm/utils/lightCards/styles.js +1 -3
  257. package/dist/esm/utils/metadata.js +0 -5
  258. package/dist/esm/utils/objectURLCache.js +0 -15
  259. package/dist/esm/utils/printScript.js +0 -5
  260. package/dist/esm/utils/progressBar/index.js +0 -9
  261. package/dist/esm/utils/progressBar/styles.js +0 -2
  262. package/dist/esm/utils/shouldDisplayImageThumbnail.js +0 -2
  263. package/dist/esm/utils/ufoExperiences.js +1 -12
  264. package/dist/esm/utils/videoSnapshot.js +2 -6
  265. package/dist/esm/utils/viewportDetector.js +5 -16
  266. package/dist/esm/version.json +1 -1
  267. package/package.json +2 -2
@@ -6,11 +6,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _extends from "@babel/runtime/helpers/extends";
8
8
  var _excluded = ["triggerRef"];
9
-
10
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
-
12
10
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
-
14
11
  import React from 'react';
15
12
  import { Component } from 'react';
16
13
  import MoreIcon from '@atlaskit/icon/glyph/more';
@@ -27,17 +24,15 @@ var CardActionButtonWithAnalytics = withAnalyticsEvents({
27
24
  attributes: {}
28
25
  })
29
26
  })(CardActionButton);
30
-
31
27
  // Trick applied due to the lack of props type of DropdownItem
32
28
  var DropdownItemWithProps = function DropdownItemWithProps(props) {
33
29
  return /*#__PURE__*/React.createElement(DropdownItem, _extends({
34
30
  testId: "media-card-actions-menu-item"
35
31
  }, props));
36
32
  };
37
-
38
33
  var createDropdownItemWithAnalytics = function createDropdownItemWithAnalytics(action, index) {
39
34
  var label = action.label,
40
- handler = action.handler;
35
+ handler = action.handler;
41
36
  var DropdownItemWithAnalytics = withAnalyticsEvents({
42
37
  onClick: createAndFireMediaCardEvent({
43
38
  eventType: 'ui',
@@ -54,35 +49,28 @@ var createDropdownItemWithAnalytics = function createDropdownItemWithAnalytics(a
54
49
  onClick: handler
55
50
  }, label);
56
51
  };
57
-
58
52
  export var CardActionsDropdownMenu = /*#__PURE__*/function (_Component) {
59
53
  _inherits(CardActionsDropdownMenu, _Component);
60
-
61
54
  var _super = _createSuper(CardActionsDropdownMenu);
62
-
63
55
  function CardActionsDropdownMenu() {
64
56
  _classCallCheck(this, CardActionsDropdownMenu);
65
-
66
57
  return _super.apply(this, arguments);
67
58
  }
68
-
69
59
  _createClass(CardActionsDropdownMenu, [{
70
60
  key: "render",
71
61
  value: function render() {
72
62
  var _this$props = this.props,
73
- actions = _this$props.actions,
74
- triggerColor = _this$props.triggerColor,
75
- onOpenChange = _this$props.onOpenChange,
76
- triggerVariant = _this$props.triggerVariant;
77
-
63
+ actions = _this$props.actions,
64
+ triggerColor = _this$props.triggerColor,
65
+ onOpenChange = _this$props.onOpenChange,
66
+ triggerVariant = _this$props.triggerVariant;
78
67
  if (actions.length > 0) {
79
68
  return /*#__PURE__*/React.createElement(DropdownMenu, {
80
69
  testId: "media-card-actions-menu",
81
70
  onOpenChange: onOpenChange,
82
71
  trigger: function trigger(_ref) {
83
72
  var triggerRef = _ref.triggerRef,
84
- providedProps = _objectWithoutProperties(_ref, _excluded);
85
-
73
+ providedProps = _objectWithoutProperties(_ref, _excluded);
86
74
  return /*#__PURE__*/React.createElement(CardActionButtonWithAnalytics, _extends({
87
75
  variant: triggerVariant,
88
76
  style: {
@@ -99,6 +87,5 @@ export var CardActionsDropdownMenu = /*#__PURE__*/function (_Component) {
99
87
  }
100
88
  }
101
89
  }]);
102
-
103
90
  return CardActionsDropdownMenu;
104
91
  }(Component);
@@ -3,11 +3,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  /**@jsx jsx */
12
9
  import { jsx } from '@emotion/react';
13
10
  import { Component } from 'react';
@@ -17,31 +14,23 @@ import { CardActionsDropdownMenu } from './cardActionsDropdownMenu';
17
14
  import { PreventClickThrough } from '../preventClickThrough';
18
15
  import { createAndFireMediaCardEvent } from '../analytics';
19
16
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
20
-
21
17
  var CardActionIconButtonWithProps = function CardActionIconButtonWithProps(props) {
22
18
  return jsx(CardActionIconButton, props);
23
19
  };
24
-
25
20
  export var CardActionsView = /*#__PURE__*/function (_Component) {
26
21
  _inherits(CardActionsView, _Component);
27
-
28
22
  var _super = _createSuper(CardActionsView);
29
-
30
23
  function CardActionsView() {
31
24
  _classCallCheck(this, CardActionsView);
32
-
33
25
  return _super.apply(this, arguments);
34
26
  }
35
-
36
27
  _createClass(CardActionsView, [{
37
28
  key: "render",
38
29
  value: function render() {
39
30
  var actions = this.props.actions;
40
-
41
31
  if (!actions.length) {
42
32
  return null;
43
33
  }
44
-
45
34
  var primaryAction = actions.find(actionWithIcon);
46
35
  var otherActions = actions.filter(actionNotEqualTo(primaryAction));
47
36
  return jsx(PreventClickThrough, null, jsx("div", {
@@ -52,11 +41,11 @@ export var CardActionsView = /*#__PURE__*/function (_Component) {
52
41
  key: "renderActionIconButton",
53
42
  value: function renderActionIconButton(action, isPrimary) {
54
43
  var _this$props = this.props,
55
- triggerColor = _this$props.triggerColor,
56
- variant = _this$props.variant;
44
+ triggerColor = _this$props.triggerColor,
45
+ variant = _this$props.variant;
57
46
  var icon = action.icon,
58
- handler = action.handler,
59
- label = action.label;
47
+ handler = action.handler,
48
+ label = action.label;
60
49
  var actionSubjectId = isPrimary ? 'mediaCardPrimaryActionButton' : 'mediaCardSecondaryActionButton';
61
50
  var CardActionIconButtonWithAnalytics = withAnalyticsEvents({
62
51
  onClick: createAndFireMediaCardEvent({
@@ -85,12 +74,11 @@ export var CardActionsView = /*#__PURE__*/function (_Component) {
85
74
  return null;
86
75
  } else {
87
76
  var _this$props2 = this.props,
88
- triggerColor = _this$props2.triggerColor,
89
- onToggle = _this$props2.onToggle,
90
- variant = _this$props2.variant;
77
+ triggerColor = _this$props2.triggerColor,
78
+ onToggle = _this$props2.onToggle,
79
+ variant = _this$props2.variant;
91
80
  var firstActionWithIcon = actions.find(actionWithIcon);
92
81
  var otherActions = actions.filter(actionNotEqualTo(firstActionWithIcon));
93
-
94
82
  if (firstActionWithIcon && otherActions.length === 0) {
95
83
  return this.renderActionIconButton(firstActionWithIcon, false);
96
84
  } else {
@@ -104,14 +92,11 @@ export var CardActionsView = /*#__PURE__*/function (_Component) {
104
92
  }
105
93
  }
106
94
  }]);
107
-
108
95
  return CardActionsView;
109
96
  }(Component);
110
-
111
97
  function actionWithIcon(action) {
112
98
  return !!action.icon;
113
99
  }
114
-
115
100
  function actionNotEqualTo(otherAction) {
116
101
  return function (action) {
117
102
  return action !== otherAction;
@@ -1,7 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject, _templateObject2;
4
-
5
3
  import { css } from '@emotion/react';
6
4
  import { N500, N0 } from '@atlaskit/theme/colors';
7
5
  import { borderRadius, size, center } from '@atlaskit/media-ui';
@@ -9,16 +7,13 @@ import { rootStyles } from '../../card/styles';
9
7
  import { rgba } from '../../card/styles/mixins';
10
8
  export var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n display: flex;\n position: relative;\n line-height: 0;\n"])), rootStyles());
11
9
  export var CardActionIconButtonVariant;
12
-
13
10
  (function (CardActionIconButtonVariant) {
14
11
  CardActionIconButtonVariant["default"] = "default";
15
12
  CardActionIconButtonVariant["filled"] = "filled";
16
13
  })(CardActionIconButtonVariant || (CardActionIconButtonVariant = {}));
17
-
18
14
  var getVariantStyles = function getVariantStyles(variant) {
19
15
  return variant === 'filled' ? "\n background-color: ".concat("var(--ds-surface-overlay, ".concat(rgba(N0, 0.8), ")"), ";\n margin-right: 8px;\n\n &:last-child {\n margin-right: 0;\n }\n\n &:hover {\n background-color: ", "var(--ds-surface-overlay-hovered, ".concat(rgba(N0, 0.6), ")"), "\n }\n ") : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, rgba(9, 30, 66, 0.06))", ";\n }\n ");
20
16
  };
21
-
22
17
  export var cardActionButtonStyles = function cardActionButtonStyles(_ref) {
23
18
  var variant = _ref.variant;
24
19
  return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n color: ", ";\n\n &:hover {\n cursor: pointer;\n }\n\n ", "\n"])), center, borderRadius, size(26), "var(--ds-icon, ".concat(N500, ")"), getVariantStyles(variant));
@@ -1,4 +1,5 @@
1
1
  // Default dimensions
2
+
2
3
  export var defaultSmallCardDimensions = {
3
4
  width: '100%',
4
5
  height: 42
@@ -14,7 +15,9 @@ export var defaultHorizontalCardDimensions = {
14
15
  export var defaultSquareCardDimensions = {
15
16
  width: 300,
16
17
  height: 300
17
- }; // Small dimensions
18
+ };
19
+
20
+ // Small dimensions
18
21
 
19
22
  export var minSmallCardDimensions = {
20
23
  width: 200,
@@ -31,7 +34,9 @@ export var minSquareCardDimensions = {
31
34
  export var minHorizontalCardDimensions = {
32
35
  width: 400,
33
36
  height: 125
34
- }; // Max dimensions
37
+ };
38
+
39
+ // Max dimensions
35
40
 
36
41
  export var maxImageCardDimensions = {
37
42
  width: 480,
@@ -49,59 +54,47 @@ export var getCardMaxHeight = function getCardMaxHeight(appearance) {
49
54
  if (appearance === 'image') {
50
55
  return maxImageCardDimensions.height;
51
56
  }
52
-
53
57
  if (appearance === 'horizontal') {
54
58
  return maxHorizontalCardDimensions.height;
55
59
  }
56
-
57
60
  if (appearance === 'square') {
58
61
  return maxSquareCardDimensions.height;
59
62
  }
60
-
61
63
  return maxSquareCardDimensions.width;
62
64
  };
63
65
  export var getCardMinWidth = function getCardMinWidth(appearance) {
64
66
  if (appearance === 'image') {
65
67
  return minImageCardDimensions.width;
66
68
  }
67
-
68
69
  if (appearance === 'horizontal') {
69
70
  return minHorizontalCardDimensions.width;
70
71
  }
71
-
72
72
  if (appearance === 'square') {
73
73
  return minSquareCardDimensions.width;
74
74
  }
75
-
76
75
  return minSmallCardDimensions.width;
77
76
  };
78
77
  export var getCardMaxWidth = function getCardMaxWidth(appearance) {
79
78
  if (appearance === 'image') {
80
79
  return maxImageCardDimensions.width;
81
80
  }
82
-
83
81
  if (appearance === 'horizontal') {
84
82
  return maxHorizontalCardDimensions.width;
85
83
  }
86
-
87
84
  if (appearance === 'square') {
88
85
  return maxSquareCardDimensions.width;
89
86
  }
90
-
91
87
  return maxSquareCardDimensions.width;
92
88
  };
93
89
  export var getDefaultCardDimensions = function getDefaultCardDimensions(appearance) {
94
90
  if (appearance === 'image') {
95
91
  return defaultImageCardDimensions;
96
92
  }
97
-
98
93
  if (appearance === 'square') {
99
94
  return defaultSquareCardDimensions;
100
95
  }
101
-
102
96
  if (appearance === 'horizontal') {
103
97
  return defaultHorizontalCardDimensions;
104
98
  }
105
-
106
99
  return defaultImageCardDimensions;
107
100
  };
@@ -1,15 +1,12 @@
1
1
  import { isValidPercentageUnit } from './isValidPercentageUnit';
2
2
  import { containsPixelUnit } from './containsPixelUnit';
3
-
4
3
  var isPixelEquivalent = function isPixelEquivalent(dimension) {
5
4
  return typeof dimension === 'number' || containsPixelUnit("".concat(dimension));
6
5
  };
7
-
8
6
  export var canCompareDimension = function canCompareDimension(current, next) {
9
7
  if (!current || !next) {
10
8
  return false;
11
9
  }
12
-
13
10
  var bothPixelEquivalent = isPixelEquivalent(current) && isPixelEquivalent(next);
14
11
  var bothPercentage = isValidPercentageUnit(current) && isValidPercentageUnit(next);
15
12
  return bothPixelEquivalent || bothPercentage;
@@ -2,10 +2,8 @@ export default (function () {
2
2
  if (typeof window === 'undefined') {
3
3
  return;
4
4
  }
5
-
6
5
  if (typeof window.document === 'undefined') {
7
6
  return;
8
7
  }
9
-
10
8
  return window.document;
11
9
  });
@@ -4,11 +4,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
-
8
7
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
-
10
8
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
-
12
9
  /**@jsx jsx */
13
10
  import { jsx } from '@emotion/react';
14
11
  import { Component } from 'react';
@@ -16,15 +13,11 @@ import WarningIcon from '@atlaskit/icon/glyph/editor/warning';
16
13
  import { errorIconWrapperStyles } from './styles';
17
14
  export var ErrorIcon = /*#__PURE__*/function (_Component) {
18
15
  _inherits(ErrorIcon, _Component);
19
-
20
16
  var _super = _createSuper(ErrorIcon);
21
-
22
17
  function ErrorIcon() {
23
18
  _classCallCheck(this, ErrorIcon);
24
-
25
19
  return _super.apply(this, arguments);
26
20
  }
27
-
28
21
  _createClass(ErrorIcon, [{
29
22
  key: "render",
30
23
  value: function render() {
@@ -37,10 +30,8 @@ export var ErrorIcon = /*#__PURE__*/function (_Component) {
37
30
  }));
38
31
  }
39
32
  }]);
40
-
41
33
  return ErrorIcon;
42
34
  }(Component);
43
-
44
35
  _defineProperty(ErrorIcon, "defaultProps", {
45
36
  size: 'small'
46
37
  });
@@ -1,6 +1,4 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject;
4
-
5
3
  import { css } from '@emotion/react';
6
4
  export var errorIconWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n color: ", ";\n"])), "var(--ds-icon-warning, #ff991f)");
@@ -3,11 +3,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  /**@jsx jsx */
12
9
  import { jsx } from '@emotion/react';
13
10
  import { Component } from 'react';
@@ -16,22 +13,18 @@ import { fileTypeIconStyles } from './styles';
16
13
  var fileTypeIconClass = 'file-type-icon';
17
14
  export var FileIcon = /*#__PURE__*/function (_Component) {
18
15
  _inherits(FileIcon, _Component);
19
-
20
16
  var _super = _createSuper(FileIcon);
21
-
22
17
  function FileIcon() {
23
18
  _classCallCheck(this, FileIcon);
24
-
25
19
  return _super.apply(this, arguments);
26
20
  }
27
-
28
21
  _createClass(FileIcon, [{
29
22
  key: "render",
30
23
  value: function render() {
31
24
  var _this$props = this.props,
32
- mediaType = _this$props.mediaType,
33
- iconUrl = _this$props.iconUrl,
34
- style = _this$props.style;
25
+ mediaType = _this$props.mediaType,
26
+ iconUrl = _this$props.iconUrl,
27
+ style = _this$props.style;
35
28
  var type = mediaType || 'unknown';
36
29
  var defaultIcon = jsx(MediaTypeIcon, {
37
30
  type: mediaType,
@@ -50,6 +43,5 @@ export var FileIcon = /*#__PURE__*/function (_Component) {
50
43
  }, icon);
51
44
  }
52
45
  }]);
53
-
54
46
  return FileIcon;
55
47
  }(Component);
@@ -1,7 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject;
4
-
5
3
  import { css } from '@emotion/react';
6
4
  import { size } from '@atlaskit/media-ui';
7
5
  export var fileTypeIconStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n float: left;\n margin-right: 6px;\n position: relative;\n top: 1px;\n img {\n ", ";\n }\n"])), size('12px !important'));
@@ -6,19 +6,15 @@ import { containsPixelUnit } from './containsPixelUnit';
6
6
  export var getDataURIDimension = function getDataURIDimension(dimension, options) {
7
7
  var retinaFactor = isRetina() ? 2 : 1;
8
8
  var dimensionValue = options.dimensions && options.dimensions[dimension] || '';
9
-
10
9
  if (isValidPercentageUnit(dimensionValue) && options.element) {
11
10
  return getElementDimension(options.element, dimension) * retinaFactor;
12
11
  }
13
-
14
12
  if (typeof dimensionValue === 'number') {
15
13
  return dimensionValue * retinaFactor;
16
14
  }
17
-
18
15
  if (containsPixelUnit("".concat(dimensionValue))) {
19
16
  return parseInt("".concat(dimensionValue), 10) * retinaFactor;
20
17
  }
21
-
22
18
  return defaultImageCardDimensions[dimension] * retinaFactor;
23
19
  };
24
20
  export var getRequestedDimensions = function getRequestedDimensions(options) {
@@ -1,23 +1,20 @@
1
1
  import { MediaCardCursor } from '../types';
2
-
3
2
  /**
4
3
  * When the returned value is undefined, we'd expect the media card to take the parent's cursor style.
5
4
  */
5
+
6
6
  export var getMediaCardCursor = function getMediaCardCursor(useInlinePlayer, useMediaViewer, isErrorStatus, hasCardPreview, mediaType) {
7
7
  // If error status or no action is requested = NoAction
8
8
  if (isErrorStatus || !useInlinePlayer && !useMediaViewer) {
9
9
  return;
10
10
  }
11
-
12
11
  if (!mediaType && (useInlinePlayer || useInlinePlayer && useMediaViewer)) {
13
12
  return MediaCardCursor.NotReady;
14
13
  } else if (mediaType === 'video' && hasCardPreview && useInlinePlayer) {
15
14
  return MediaCardCursor.Action;
16
15
  }
17
-
18
16
  if (useMediaViewer) {
19
17
  return MediaCardCursor.Action;
20
18
  }
21
-
22
19
  return;
23
20
  };
@@ -1,10 +1,8 @@
1
1
  import { getMediaCardSSR, getKey } from './globalScope';
2
2
  export var getSSRData = function getSSRData(identifier) {
3
3
  var mediaCardSsr = getMediaCardSSR();
4
-
5
4
  if (!mediaCardSsr) {
6
5
  return;
7
6
  }
8
-
9
7
  return mediaCardSsr[getKey(identifier)];
10
8
  };
@@ -5,40 +5,35 @@ import { printFunctionCall, printScript } from '../printScript';
5
5
  // Any changes to this file must be tested directly in product before merging.
6
6
  // The scripts printed here might differ from what we observe in our internal tests
7
7
  // due to minimification, for example.
8
+
8
9
  export var GLOBAL_MEDIA_CARD_SSR = 'mediaCardSsr';
9
10
  export var GLOBAL_MEDIA_NAMESPACE = '__MEDIA_INTERNAL';
10
11
  export function getMediaGlobalScope() {
11
12
  var globalScope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
12
13
  // Must match GLOBAL_MEDIA_NAMESPACE. Can't reference the constant from here.
13
14
  var namespace = '__MEDIA_INTERNAL';
14
-
15
15
  if (!globalScope[namespace]) {
16
16
  globalScope[namespace] = {};
17
17
  }
18
-
19
18
  return globalScope[namespace];
20
19
  }
21
20
  export function getMediaCardSSR() {
22
21
  var globalScope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
23
- var globalMedia = getMediaGlobalScope(globalScope); // Must match GLOBAL_MEDIA_CARD_SSR. Can't reference the constant from here.
24
-
22
+ var globalMedia = getMediaGlobalScope(globalScope);
23
+ // Must match GLOBAL_MEDIA_CARD_SSR. Can't reference the constant from here.
25
24
  var key = 'mediaCardSsr';
26
-
27
25
  if (!globalMedia[key]) {
28
26
  globalMedia[key] = {};
29
27
  }
30
-
31
28
  return globalMedia[key];
32
29
  }
33
-
34
30
  var dashed = function dashed(param) {
35
31
  return param ? "-".concat(param) : '';
36
32
  };
37
-
38
33
  export var getKey = function getKey(_ref) {
39
34
  var id = _ref.id,
40
- collectionName = _ref.collectionName,
41
- occurrenceKey = _ref.occurrenceKey;
35
+ collectionName = _ref.collectionName,
36
+ occurrenceKey = _ref.occurrenceKey;
42
37
  return "".concat(id).concat(dashed(collectionName)).concat(dashed(occurrenceKey));
43
38
  };
44
39
  export var storeDataURI = function storeDataURI(key, dataURI, dimensions, error) {
@@ -50,17 +45,15 @@ export var storeDataURI = function storeDataURI(key, dataURI, dimensions, error)
50
45
  error: error
51
46
  };
52
47
  };
53
-
54
48
  var generateScript = function generateScript(identifier, dataURI, dimensions, error) {
55
49
  var functionCall = printFunctionCall(storeDataURI, getKey(identifier), dataURI, dimensions, error);
56
50
  return printScript([getMediaCardSSR.toString(), getMediaGlobalScope.toString(), functionCall]);
57
51
  };
58
-
59
52
  export var StoreSSRDataScript = function StoreSSRDataScript(_ref2) {
60
53
  var dataURI = _ref2.dataURI,
61
- identifier = _ref2.identifier,
62
- dimensions = _ref2.dimensions,
63
- error = _ref2.error;
54
+ identifier = _ref2.identifier,
55
+ dimensions = _ref2.dimensions,
56
+ error = _ref2.error;
64
57
  return /*#__PURE__*/React.createElement("script", {
65
58
  dangerouslySetInnerHTML: {
66
59
  __html: generateScript(identifier, dataURI, dimensions, error)
@@ -4,11 +4,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
-
8
7
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
-
10
8
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
-
12
9
  import React from 'react';
13
10
  import { Component } from 'react';
14
11
  import { ErrorIcon } from '../errorIcon';
@@ -16,15 +13,11 @@ import { Wrapper } from './lightCardWrappers';
16
13
  import { getDimensionsWithDefault } from './getDimensionsWithDefault';
17
14
  export var CardError = /*#__PURE__*/function (_Component) {
18
15
  _inherits(CardError, _Component);
19
-
20
16
  var _super = _createSuper(CardError);
21
-
22
17
  function CardError() {
23
18
  _classCallCheck(this, CardError);
24
-
25
19
  return _super.apply(this, arguments);
26
20
  }
27
-
28
21
  _createClass(CardError, [{
29
22
  key: "render",
30
23
  value: function render() {
@@ -42,10 +35,8 @@ export var CardError = /*#__PURE__*/function (_Component) {
42
35
  });
43
36
  }
44
37
  }]);
45
-
46
38
  return CardError;
47
39
  }(Component);
48
-
49
40
  _defineProperty(CardError, "defaultProps", {
50
41
  size: 'medium'
51
42
  });
@@ -3,11 +3,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
7
6
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
-
9
7
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
-
11
8
  import React from 'react';
12
9
  import { Component } from 'react';
13
10
  import { getDimensionsWithDefault } from './getDimensionsWithDefault';
@@ -17,24 +14,19 @@ import FileIcon from '@atlaskit/icon/glyph/file';
17
14
  import { getMediaFeatureFlag } from '@atlaskit/media-common';
18
15
  export var CardLoading = /*#__PURE__*/function (_Component) {
19
16
  _inherits(CardLoading, _Component);
20
-
21
17
  var _super = _createSuper(CardLoading);
22
-
23
18
  function CardLoading() {
24
19
  _classCallCheck(this, CardLoading);
25
-
26
20
  return _super.apply(this, arguments);
27
21
  }
28
-
29
22
  _createClass(CardLoading, [{
30
23
  key: "render",
31
24
  value: function render() {
32
25
  var _this$props = this.props,
33
- dimensionsProp = _this$props.dimensions,
34
- testId = _this$props.testId,
35
- featureFlags = _this$props.featureFlags;
26
+ dimensionsProp = _this$props.dimensions,
27
+ testId = _this$props.testId,
28
+ featureFlags = _this$props.featureFlags;
36
29
  var dimensions = getDimensionsWithDefault(dimensionsProp);
37
-
38
30
  if (getMediaFeatureFlag('newCardExperience', featureFlags)) {
39
31
  return /*#__PURE__*/React.createElement(Wrapper, {
40
32
  "data-testid": testId || 'media-card-loading',
@@ -42,7 +34,6 @@ export var CardLoading = /*#__PURE__*/function (_Component) {
42
34
  dimensions: dimensions
43
35
  }, /*#__PURE__*/React.createElement(SpinnerIcon, null));
44
36
  }
45
-
46
37
  return /*#__PURE__*/React.createElement(AnimatedWrapper, {
47
38
  "data-testid": testId || 'media-card-loading',
48
39
  "data-test-loading": true,
@@ -53,6 +44,5 @@ export var CardLoading = /*#__PURE__*/function (_Component) {
53
44
  }));
54
45
  }
55
46
  }]);
56
-
57
47
  return CardLoading;
58
48
  }(Component);
@@ -1,5 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
-
3
2
  /**@jsx jsx */
4
3
  import { jsx } from '@emotion/react';
5
4
  import { wrapperStyles, animatedWrapperStyles } from './styles';
@@ -1,7 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
2
  var _templateObject, _templateObject2, _templateObject3;
4
-
5
3
  import { css, keyframes } from '@emotion/react';
6
4
  import { center, borderRadius } from '@atlaskit/media-ui';
7
5
  import { themed } from '@atlaskit/theme/components';
@@ -9,7 +7,7 @@ import { N20, DN50, N50, DN100 } from '@atlaskit/theme/colors';
9
7
  export var blinkLoadingAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0%{\n opacity: 1;\n }\n\n 50%{\n opacity: 0.6;\n }\n\n 100%{\n opacity: 1;\n }\n"])));
10
8
  export var wrapperStyles = function wrapperStyles(_ref) {
11
9
  var dimensions = _ref.dimensions,
12
- theme = _ref.theme;
10
+ theme = _ref.theme;
13
11
  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({
14
12
  light: "var(--ds-background-neutral, ".concat(N20, ")"),
15
13
  dark: "var(--ds-background-neutral, ".concat(DN50, ")")