@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
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- import ImageIcon from '@atlaskit/icon/glyph/image';
3
- import AudioIcon from '@atlaskit/icon/glyph/audio';
4
- import ArchiveIcon from '@atlaskit/icon/glyph/media-services/zip';
5
- import VideoIcon from '@atlaskit/icon/glyph/media-services/video';
6
- import DocIcon from '@atlaskit/icon/glyph/document';
7
- import UnknownIcon from '@atlaskit/icon/glyph/page';
8
- import { IconWrapper } from './iconWrapper';
9
- const icons = {
10
- image: ImageIcon,
11
- audio: AudioIcon,
12
- video: VideoIcon,
13
- doc: DocIcon,
14
- unknown: UnknownIcon,
15
- archive: ArchiveIcon
16
- };
17
- export class MediaTypeIcon extends React.Component {
18
- // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
19
- render() {
20
- const {
21
- type,
22
- size = 'small',
23
- className
24
- } = this.props;
25
- const Icon = type && icons[type] || icons.unknown;
26
- return /*#__PURE__*/React.createElement(IconWrapper, {
27
- type: type || 'unknown'
28
- }, /*#__PURE__*/React.createElement(Icon, {
29
- label: "media-type",
30
- size: size,
31
- className: className
32
- }));
33
- }
34
-
35
- }
@@ -1,22 +0,0 @@
1
- import { css } from '@emotion/react';
2
- import { Y200, P200, B300 } from '@atlaskit/theme/colors';
3
- const typeToColorMap = {
4
- image: Y200,
5
- audio: P200,
6
- video: '#ff7143',
7
- doc: B300,
8
- unknown: '#3dc7dc',
9
- archive: '' // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
10
-
11
- };
12
-
13
- const getWrapperColor = ({
14
- type
15
- }) => {
16
- return typeToColorMap[type] || typeToColorMap.unknown;
17
- };
18
-
19
- export const iconWrapperStyles = props => css`
20
- display: inline-flex;
21
- color: ${getWrapperColor(props)};
22
- `;
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { iconWrapperStyles } from './styles';
4
- export var IconWrapper = function IconWrapper(props) {
5
- return jsx("div", {
6
- id: "iconWrapper",
7
- css: iconWrapperStyles(props)
8
- }, props.children);
9
- };
@@ -1,59 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _inherits from "@babel/runtime/helpers/inherits";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
-
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); }; }
8
-
9
- 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
- import React from 'react';
12
- import ImageIcon from '@atlaskit/icon/glyph/image';
13
- import AudioIcon from '@atlaskit/icon/glyph/audio';
14
- import ArchiveIcon from '@atlaskit/icon/glyph/media-services/zip';
15
- import VideoIcon from '@atlaskit/icon/glyph/media-services/video';
16
- import DocIcon from '@atlaskit/icon/glyph/document';
17
- import UnknownIcon from '@atlaskit/icon/glyph/page';
18
- import { IconWrapper } from './iconWrapper';
19
- var icons = {
20
- image: ImageIcon,
21
- audio: AudioIcon,
22
- video: VideoIcon,
23
- doc: DocIcon,
24
- unknown: UnknownIcon,
25
- archive: ArchiveIcon
26
- };
27
- export var MediaTypeIcon = /*#__PURE__*/function (_React$Component) {
28
- _inherits(MediaTypeIcon, _React$Component);
29
-
30
- var _super = _createSuper(MediaTypeIcon);
31
-
32
- function MediaTypeIcon() {
33
- _classCallCheck(this, MediaTypeIcon);
34
-
35
- return _super.apply(this, arguments);
36
- }
37
-
38
- _createClass(MediaTypeIcon, [{
39
- key: "render",
40
- value: // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
41
- function render() {
42
- var _this$props = this.props,
43
- type = _this$props.type,
44
- _this$props$size = _this$props.size,
45
- size = _this$props$size === void 0 ? 'small' : _this$props$size,
46
- className = _this$props.className;
47
- var Icon = type && icons[type] || icons.unknown;
48
- return /*#__PURE__*/React.createElement(IconWrapper, {
49
- type: type || 'unknown'
50
- }, /*#__PURE__*/React.createElement(Icon, {
51
- label: "media-type",
52
- size: size,
53
- className: className
54
- }));
55
- }
56
- }]);
57
-
58
- return MediaTypeIcon;
59
- }(React.Component);
@@ -1,24 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject;
4
-
5
- import { css } from '@emotion/react';
6
- import { Y200, P200, B300 } from '@atlaskit/theme/colors';
7
- var typeToColorMap = {
8
- image: Y200,
9
- audio: P200,
10
- video: '#ff7143',
11
- doc: B300,
12
- unknown: '#3dc7dc',
13
- archive: '' // TODO [BMPT-389]: Remove this and use existing MediaTypeIcon in media-ui
14
-
15
- };
16
-
17
- var getWrapperColor = function getWrapperColor(_ref) {
18
- var type = _ref.type;
19
- return typeToColorMap[type] || typeToColorMap.unknown;
20
- };
21
-
22
- export var iconWrapperStyles = function iconWrapperStyles(props) {
23
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n color: ", ";\n"])), getWrapperColor(props));
24
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { IconWrapperProps } from './types';
4
- export declare const IconWrapper: (props: IconWrapperProps) => jsx.JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { MediaType } from '@atlaskit/media-client';
3
- export interface FileIconProps {
4
- type?: MediaType;
5
- size?: string;
6
- className?: string;
7
- }
8
- export declare class MediaTypeIcon extends React.Component<FileIconProps, {}> {
9
- render(): JSX.Element;
10
- }
@@ -1,2 +0,0 @@
1
- import { IconWrapperProps } from './types';
2
- export declare const iconWrapperStyles: (props: IconWrapperProps) => import("@emotion/react").SerializedStyles;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { MediaType } from '@atlaskit/media-client';
3
- export interface IconWrapperProps {
4
- type: MediaType;
5
- children?: JSX.Element;
6
- }
@@ -1,9 +0,0 @@
1
- import { FileItem, FileDetails } from '@atlaskit/media-client';
2
- import { ReactNode } from 'react';
3
- export interface CardAction {
4
- label?: string;
5
- handler: CardEventHandler;
6
- icon?: ReactNode;
7
- }
8
- export declare type CardEventHandler = (item?: FileItem, event?: Event) => void;
9
- export declare function attachDetailsToActions(actions: Array<CardAction>, details: FileDetails): Array<CardAction>;
@@ -1,59 +0,0 @@
1
- import React, { Component } from 'react';
2
- import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import { FileIdentifier, FileState, MediaSubscription } from '@atlaskit/media-client';
4
- import { WrappedComponentProps } from 'react-intl-next';
5
- import { CardAction } from './actions';
6
- import { CardProps, CardState, CardStatus } from '../types';
7
- export declare type CardBaseProps = CardProps & WithAnalyticsEventsProps & Partial<WrappedComponentProps>;
8
- export declare class CardBase extends Component<CardBaseProps, CardState> {
9
- private internalOccurrenceKey;
10
- private hasBeenMounted;
11
- private fileStateFlags;
12
- private ssrReliability;
13
- private timeElapsedTillCommenced;
14
- subscription?: MediaSubscription;
15
- private ssrData?;
16
- static defaultProps: Partial<CardProps>;
17
- constructor(props: CardBaseProps);
18
- componentDidMount(): void;
19
- componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
20
- componentWillUnmount(): void;
21
- updateStateForIdentifier(identifier: FileIdentifier): void;
22
- private getImageURLParams;
23
- private getMediaBlobUrlAttrs;
24
- private getCardPreviewParams;
25
- private setCacheSSRPreview;
26
- private refetchSSRPreview;
27
- private resolvePreview;
28
- updateFileStateFlag(fileState?: FileState): void;
29
- subscribeInternalFile(identifier: FileIdentifier): void;
30
- private get requestedDimensions();
31
- private get metadata();
32
- private get fileAttributes();
33
- private getPerformanceAttributes;
34
- private logSSRImageError;
35
- private onImageError;
36
- private onImageLoad;
37
- private fireOperationalEvent;
38
- private fireCommencedEvent;
39
- private fireCopiedEvent;
40
- private fireScreenEvent;
41
- private fireLocalPreviewErrorEvent;
42
- private safeSetState;
43
- unsubscribe: () => void;
44
- get actions(): CardAction[];
45
- onCardViewClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
46
- onInlinePlayerError: () => void;
47
- setRef: (cardRef: HTMLDivElement | null) => void;
48
- renderInlinePlayer: () => JSX.Element;
49
- onMediaViewerClose: () => void;
50
- private onDisplayImage;
51
- renderMediaViewer: () => React.ReactPortal | undefined;
52
- renderCard: (withCallbacks?: boolean, cardStatusOverride?: CardStatus | undefined, izLazyOverride?: boolean | undefined) => JSX.Element;
53
- private storeSSRData;
54
- render(): JSX.Element;
55
- private onCardInViewport;
56
- onClick: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
57
- onMouseEnter: (event: React.MouseEvent<HTMLDivElement>) => void;
58
- }
59
- export declare const Card: React.ComponentType<CardBaseProps>;
@@ -1,9 +0,0 @@
1
- import { FileAttributes, PerformanceAttributes } from '@atlaskit/media-common';
2
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import { SSRStatus } from '../utils/analytics';
4
- import { CardStatus } from '../types';
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;
8
- export declare const fireCopiedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileId: string, cardRef: HTMLDivElement) => void;
9
- export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
@@ -1 +0,0 @@
1
- export declare const newFileExperienceClassName = "new-file-experience-wrapper";
@@ -1,6 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { WrapperProps } from './styles';
4
- export declare const CardImageViewWrapper: (props: WrapperProps) => jsx.JSX.Element;
5
- export declare const PlayIconWrapper: (props: any) => jsx.JSX.Element;
6
- export declare const ProgressBarWrapper: (props: any) => jsx.JSX.Element;
@@ -1,8 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { OverlayProps } from './styles';
4
- export declare const Overlay: (props: OverlayProps) => jsx.JSX.Element;
5
- export declare const ErrorMessage: (props: any) => jsx.JSX.Element;
6
- export declare const AltWrapper: (props: any) => jsx.JSX.Element;
7
- export declare const TitleWrapper: (props: any) => jsx.JSX.Element;
8
- export declare const Metadata: (props: any) => jsx.JSX.Element;
@@ -1,39 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { MouseEvent, Component, ReactNode } from 'react';
4
- import { MediaType } from '@atlaskit/media-client';
5
- import { CardAction, CardEventHandler } from '../../actions';
6
- import { CardStatus } from '../../../types';
7
- export interface CardOverlayProps {
8
- readonly cardStatus: CardStatus;
9
- mediaType?: MediaType;
10
- mediaName?: string;
11
- subtitle?: string;
12
- selectable?: boolean;
13
- selected?: boolean;
14
- persistent: boolean;
15
- error?: ReactNode;
16
- alt?: string;
17
- noHover?: boolean;
18
- actions?: Array<CardAction>;
19
- icon?: string;
20
- }
21
- export interface CardOverlayState {
22
- isMenuExpanded: boolean;
23
- }
24
- export declare class CardOverlay extends Component<CardOverlayProps, CardOverlayState> {
25
- static defaultProps: {
26
- actions: never[];
27
- mediaName: string;
28
- };
29
- constructor(props: CardOverlayProps);
30
- private get wrapperClassNames();
31
- render(): jsx.JSX.Element;
32
- errorLine(): false | "" | 0 | jsx.JSX.Element | null | undefined;
33
- tickBox(): false | jsx.JSX.Element | undefined;
34
- bottomLeftColumn(): jsx.JSX.Element | undefined;
35
- onMenuToggle: (attrs: {
36
- isOpen: boolean;
37
- }) => void;
38
- removeBtnClick(handler: CardEventHandler): (e: MouseEvent<HTMLDivElement, any>) => void;
39
- }
@@ -1,26 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * Everything about this file change is just wrong.
4
- * Mostly because we do bad things with classes.
5
- * This is all wrong and hopefully will be removed from existence with card v3,
6
- * so please don’t be too sad about all this!
7
- */
8
- import { GlobalThemeTokens } from '@atlaskit/theme/components';
9
- export interface OverlayProps {
10
- hasError?: boolean;
11
- noHover?: boolean;
12
- className?: string;
13
- children?: JSX.Element[];
14
- }
15
- export declare const tickBoxStyles: import("@emotion/react").SerializedStyles;
16
- export declare const overlayStyles: (props: OverlayProps) => import("@emotion/react").SerializedStyles;
17
- export declare const errorLineStyles: import("@emotion/react").SerializedStyles;
18
- export declare const leftColumnStyles: import("@emotion/react").SerializedStyles;
19
- export declare const topRowStyles: import("@emotion/react").SerializedStyles;
20
- export declare const bottomRowStyles: import("@emotion/react").SerializedStyles;
21
- export declare const rightColumnStyles: import("@emotion/react").SerializedStyles;
22
- export declare const errorMessageStyles: import("@emotion/react").SerializedStyles;
23
- export declare const altWrapperStyles: import("@emotion/react").SerializedStyles;
24
- export declare const titleWrapperStyles: (theme: GlobalThemeTokens) => import("@emotion/react").SerializedStyles;
25
- export declare const subtitleStyles: import("@emotion/react").SerializedStyles;
26
- export declare const metadataStyles: import("@emotion/react").SerializedStyles;
@@ -1,4 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { WrapperProps } from '../types';
4
- export declare const Wrapper: (props: WrapperProps) => jsx.JSX.Element;
@@ -1,2 +0,0 @@
1
- export declare const fileCardImageViewSelector = "media-file-card-view";
2
- export declare const fileCardImageViewSelectedSelector = "media-file-card-view-selected";
@@ -1,49 +0,0 @@
1
- /**@jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { Component, ReactNode } from 'react';
4
- import { MediaItemType, MediaType, ImageResizeMode } from '@atlaskit/media-client';
5
- import { CardStatus, CardPreview, CardDimensions } from '../../types';
6
- import { CardAction } from '../actions';
7
- export interface FileCardImageViewProps {
8
- readonly mediaName?: string;
9
- readonly mediaType?: MediaType;
10
- readonly mimeType?: string;
11
- readonly fileSize?: string;
12
- readonly dataURI?: string;
13
- readonly alt?: string;
14
- readonly progress?: number;
15
- readonly status: CardStatus;
16
- readonly mediaItemType: MediaItemType;
17
- readonly dimensions?: CardDimensions;
18
- readonly resizeMode?: ImageResizeMode;
19
- readonly disableOverlay?: boolean;
20
- readonly selectable?: boolean;
21
- readonly selected?: boolean;
22
- readonly error?: ReactNode;
23
- readonly actions?: CardAction[];
24
- readonly onDisplayImage?: () => void;
25
- readonly previewOrientation?: number;
26
- readonly onImageError?: (cardPreview: CardPreview) => void;
27
- readonly onImageLoad?: (cardPreview: CardPreview) => void;
28
- readonly cardPreview: CardPreview;
29
- }
30
- export declare class FileCardImageView extends Component<FileCardImageViewProps> {
31
- private wasThumbnailDisplayed;
32
- static defaultProps: Partial<FileCardImageViewProps>;
33
- render(): jsx.JSX.Element;
34
- private renderCardContents;
35
- private renderLoadingContents;
36
- private renderErrorContents;
37
- private renderFailedContents;
38
- private renderUploadingCardOverlay;
39
- private renderPlayButton;
40
- onImageLoad: () => void;
41
- onImageError: () => void;
42
- private renderMediaImage;
43
- private renderProgressBar;
44
- private renderSuccessCardContents;
45
- private renderSuccessCardOverlay;
46
- private get isFileCardImageReadyForDisplay();
47
- private get isCropped();
48
- private get isStretched();
49
- }
@@ -1,2 +0,0 @@
1
- export { FileCardImageView } from './fileCardImageView';
2
- export type { FileCardImageViewProps } from './fileCardImageView';
@@ -1,24 +0,0 @@
1
- /// <reference types="react" />
2
- import { GlobalThemeTokens } from '@atlaskit/theme/components';
3
- import { CardStatus } from '../../types';
4
- export interface WrapperProps {
5
- disableOverlay?: boolean;
6
- selectable?: boolean;
7
- selected?: boolean;
8
- hasOnClick?: boolean;
9
- mediaType?: string;
10
- mediaName?: string;
11
- progress?: number;
12
- status?: CardStatus;
13
- theme?: GlobalThemeTokens;
14
- children?: JSX.Element | JSX.Element[];
15
- }
16
- export declare const wrapperStyles: (props: WrapperProps) => import("@emotion/react").SerializedStyles;
17
- export declare const playIconWrapperStyles: import("@emotion/react").SerializedStyles;
18
- export declare const playIconBackgroundStyles: import("@emotion/react").SerializedStyles;
19
- export declare const progressBarWrapperStyles: import("@emotion/react").SerializedStyles;
20
- export declare const overlayStyles: import("@emotion/react").SerializedStyles;
21
- export declare const titleStyles: import("@emotion/react").SerializedStyles;
22
- export declare const bodyStyles: import("@emotion/react").SerializedStyles;
23
- export declare const progressWrapperStyles: import("@emotion/react").SerializedStyles;
24
- export declare const cardActionsWrapperStyles: import("@emotion/react").SerializedStyles;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { WithMediaClientConfigProps } from '@atlaskit/media-client';
3
- import type { CardBaseProps } from './card';
4
- export declare type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
5
- declare const CardLoader: React.FC<CardWithMediaClientConfigProps>;
6
- export default CardLoader;
@@ -1,5 +0,0 @@
1
- import { FileState } from '@atlaskit/media-client';
2
- import { MediaFeatureFlags } from '@atlaskit/media-common';
3
- import { CardState } from '../types';
4
- export declare const createStateUpdater: (newState: Partial<CardState>) => (prevState: CardState) => Pick<CardState, keyof CardState>;
5
- export declare const getCardStateFromFileState: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags | undefined) => Partial<CardState>;
@@ -1,80 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import React, { MouseEvent } from 'react';
4
- import { MessageDescriptor } from 'react-intl-next';
5
- import { MediaItemType, FileDetails } from '@atlaskit/media-client';
6
- import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
7
- import { SharedCardProps, CardStatus } from '../types';
8
- import { MediaCardError } from '../errors';
9
- import { CardPreview } from '../types';
10
- import { MediaCardCursor } from '../types';
11
- export interface CardViewOwnProps extends SharedCardProps {
12
- readonly status: CardStatus;
13
- readonly mediaItemType: MediaItemType;
14
- readonly mediaCardCursor?: MediaCardCursor;
15
- readonly metadata?: FileDetails;
16
- readonly error?: MediaCardError;
17
- readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
18
- readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
19
- readonly onDisplayImage?: () => void;
20
- readonly cardPreview?: CardPreview;
21
- readonly progress?: number;
22
- readonly innerRef?: (instance: HTMLDivElement | null) => void;
23
- readonly onImageLoad: (cardPreview: CardPreview) => void;
24
- readonly onImageError: (cardPreview: CardPreview) => void;
25
- readonly nativeLazyLoad?: boolean;
26
- readonly forceSyncDisplay?: boolean;
27
- disableAnimation?: boolean;
28
- }
29
- export interface CardViewState {
30
- elementWidth?: number;
31
- didImageRender: boolean;
32
- }
33
- export declare type CardViewProps = CardViewOwnProps & WithAnalyticsEventsProps;
34
- export interface RenderConfigByStatus {
35
- renderTypeIcon?: boolean;
36
- iconMessage?: JSX.Element;
37
- renderImageRenderer?: boolean;
38
- renderPlayButton?: boolean;
39
- renderTitleBox?: boolean;
40
- renderBlanket?: boolean;
41
- isFixedBlanket?: boolean;
42
- renderProgressBar?: boolean;
43
- renderSpinner?: boolean;
44
- renderFailedTitleBox?: boolean;
45
- renderTickBox?: boolean;
46
- customTitleMessage?: MessageDescriptor;
47
- }
48
- /**
49
- * This is classic vanilla CardView class. To create an instance of class one would need to supply
50
- * `createAnalyticsEvent` prop to satisfy it's Analytics Events needs.
51
- */
52
- export declare class CardViewBase extends React.Component<CardViewProps, CardViewState> {
53
- state: CardViewState;
54
- divRef: React.RefObject<HTMLDivElement>;
55
- static defaultProps: Partial<CardViewOwnProps>;
56
- componentDidMount(): void;
57
- componentDidUpdate({ cardPreview: prevCardPreview }: CardViewProps): void;
58
- private onImageLoad;
59
- private onImageError;
60
- private get width();
61
- private get breakpoint();
62
- saveElementWidth: () => void;
63
- render(): jsx.JSX.Element;
64
- private renderSpinner;
65
- private shouldRenderPlayButton;
66
- private renderPlayButton;
67
- private renderBlanket;
68
- private renderTitleBox;
69
- private renderFailedTitleBox;
70
- private renderProgressBar;
71
- private renderImageRenderer;
72
- private renderTickBox;
73
- private renderMediaTypeIcon;
74
- private renderActionsBar;
75
- private renderFileNewExperience;
76
- private renderFile;
77
- private getRenderConfigByStatus;
78
- private renderNewExperienceCard;
79
- }
80
- export declare const CardView: React.ForwardRefExoticComponent<Pick<Omit<CardViewProps, keyof WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<CardViewProps, keyof WithAnalyticsEventsProps>, keyof CardViewOwnProps>> & Partial<Pick<Partial<CardViewOwnProps>, never>> & React.RefAttributes<any>>;
@@ -1,19 +0,0 @@
1
- import { ImageResizeMode } from '@atlaskit/media-client';
2
- import { ObjectURLCache } from '../../utils/objectURLCache';
3
- import { CardPreview } from '../../types';
4
- declare type Mode = ImageResizeMode | undefined;
5
- export declare const getCacheKey: (id: string, mode: Mode) => string;
6
- export interface CardPreviewCache {
7
- get(id: string, mode: Mode): CardPreview | undefined;
8
- set(id: string, mode: Mode, cardPreview: CardPreview): void;
9
- remove(id: string, mode: Mode): void;
10
- }
11
- export declare class CardPreviewCacheImpl implements CardPreviewCache {
12
- private previewCache;
13
- constructor(previewCache: ObjectURLCache);
14
- get: (id: string, mode: Mode) => CardPreview | undefined;
15
- set: (id: string, mode: Mode, cardPreview: CardPreview) => void;
16
- remove: (id: string, mode: Mode) => void;
17
- }
18
- declare const _default: CardPreviewCacheImpl;
19
- export default _default;
@@ -1,5 +0,0 @@
1
- import { MediaFeatureFlags } from '@atlaskit/media-common';
2
- import { CardStatus, FilePreviewStatus } from '../../types';
3
- import { FileState } from '@atlaskit/media-client';
4
- export declare const extractFilePreviewStatus: (fileState: FileState, isBannedLocalPreview: boolean, featureFlags?: MediaFeatureFlags | undefined) => FilePreviewStatus;
5
- export declare const isPreviewableStatus: (cardStatus: CardStatus, { isPreviewable, hasPreview, isSupportedByBrowser }: FilePreviewStatus) => boolean;
@@ -1,9 +0,0 @@
1
- import { MediaClient, FilePreview, MediaStoreGetFileImageParams, MediaType } from '@atlaskit/media-client';
2
- import { CardPreview } from '../../types';
3
- /**
4
- * This method tells the support for the media
5
- * types covered in getCardPreviewFromFilePreview
6
- */
7
- export declare const isSupportedLocalPreview: (mediaType?: MediaType | undefined) => boolean;
8
- export declare const getCardPreviewFromFilePreview: (filePreview: FilePreview | Promise<FilePreview>) => Promise<CardPreview>;
9
- export declare const getCardPreviewFromBackend: (mediaClient: MediaClient, id: string, params: MediaStoreGetFileImageParams) => Promise<CardPreview>;
@@ -1,10 +0,0 @@
1
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { CardDimensions } from '../../types';
3
- import { CardPreviewAttributes } from '../../utils/analytics';
4
- declare type cardAction = 'cache-hit' | 'remote-success';
5
- export declare const fireImageFetchingOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, action: cardAction, cardPreviewAttributes: CardPreviewAttributes) => void;
6
- export declare const calculatePercentageDifference: (prevDimensions: CardDimensions | undefined, currentDimensions: CardDimensions | undefined) => {
7
- width: string;
8
- height: string;
9
- } | undefined;
10
- export {};