@atlaskit/media-card 70.9.0 → 72.0.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 (181) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/cjs/errors.js +109 -6
  3. package/dist/cjs/files/cardImageView/index.js +58 -89
  4. package/dist/cjs/files/index.js +0 -6
  5. package/dist/cjs/index.js +16 -6
  6. package/dist/cjs/root/card/cardAnalytics.js +33 -19
  7. package/dist/cjs/root/card/cardConstants.js +8 -0
  8. package/dist/cjs/root/card/cardSSRView.js +114 -0
  9. package/dist/cjs/root/card/cardState.js +50 -0
  10. package/dist/cjs/root/card/getCardPreview/cache.js +49 -0
  11. package/dist/cjs/root/card/getCardPreview/filePreviewStatus.js +50 -0
  12. package/dist/cjs/root/card/getCardPreview/helpers.js +215 -0
  13. package/dist/cjs/root/card/getCardPreview/index.js +225 -0
  14. package/dist/cjs/root/card/getCardStatus.js +16 -21
  15. package/dist/cjs/root/card/index.js +339 -398
  16. package/dist/cjs/root/cardView.js +108 -56
  17. package/dist/cjs/root/index.js +9 -1
  18. package/dist/cjs/root/inline/loader.js +22 -21
  19. package/dist/cjs/root/inline/{inlineMediaCard.js → mediaInlineCard.js} +66 -24
  20. package/dist/cjs/root/inlinePlayer.js +5 -15
  21. package/dist/cjs/root/ui/Breakpoint.js +13 -0
  22. package/dist/cjs/root/ui/common.js +5 -11
  23. package/dist/cjs/root/ui/iconMessage/index.js +17 -9
  24. package/dist/cjs/root/ui/imageRenderer/imageRenderer.js +32 -115
  25. package/dist/cjs/root/ui/loadingRateLimited/loadingRateLimited.js +2 -2
  26. package/dist/cjs/root/ui/progressBar/progressBar.js +2 -2
  27. package/dist/cjs/root/ui/progressBar/styled.js +3 -1
  28. package/dist/cjs/root/ui/styled.js +17 -80
  29. package/dist/cjs/root/ui/styledSSR.js +108 -0
  30. package/dist/cjs/root/ui/titleBox/failedTitleBox.js +7 -3
  31. package/dist/cjs/root/ui/titleBox/styled.js +3 -1
  32. package/dist/cjs/utils/analytics.js +26 -43
  33. package/dist/cjs/utils/dimensionComparer.js +1 -1
  34. package/dist/cjs/utils/document.js +12 -0
  35. package/dist/cjs/utils/getDataURIDimension.js +13 -2
  36. package/dist/cjs/utils/metadata.js +11 -3
  37. package/dist/cjs/utils/objectURLCache.js +6 -0
  38. package/dist/cjs/utils/resizeModeToMediaImageProps.js +13 -0
  39. package/dist/cjs/utils/shouldDisplayImageThumbnail.js +1 -1
  40. package/dist/cjs/utils/videoSnapshot.js +45 -0
  41. package/dist/cjs/version.json +1 -1
  42. package/dist/es2019/errors.js +52 -2
  43. package/dist/es2019/files/cardImageView/index.js +12 -46
  44. package/dist/es2019/files/index.js +1 -1
  45. package/dist/es2019/index.js +3 -3
  46. package/dist/es2019/root/card/cardAnalytics.js +23 -17
  47. package/dist/es2019/root/card/cardConstants.js +1 -0
  48. package/dist/es2019/root/card/cardSSRView.js +93 -0
  49. package/dist/es2019/root/card/cardState.js +26 -0
  50. package/dist/es2019/root/card/getCardPreview/cache.js +29 -0
  51. package/dist/es2019/root/card/getCardPreview/filePreviewStatus.js +35 -0
  52. package/dist/es2019/root/card/getCardPreview/helpers.js +83 -0
  53. package/dist/es2019/root/card/getCardPreview/index.js +129 -0
  54. package/dist/es2019/root/card/getCardStatus.js +11 -15
  55. package/dist/es2019/root/card/index.js +292 -276
  56. package/dist/es2019/root/cardView.js +107 -53
  57. package/dist/es2019/root/index.js +2 -1
  58. package/dist/es2019/root/inline/loader.js +16 -15
  59. package/dist/es2019/root/inline/mediaInlineCard.js +127 -0
  60. package/dist/es2019/root/inlinePlayer.js +5 -13
  61. package/dist/es2019/root/ui/Breakpoint.js +6 -0
  62. package/dist/es2019/root/ui/common.js +1 -7
  63. package/dist/es2019/root/ui/iconMessage/index.js +10 -6
  64. package/dist/es2019/root/ui/imageRenderer/imageRenderer.js +22 -74
  65. package/dist/es2019/root/ui/loadingRateLimited/loadingRateLimited.js +1 -1
  66. package/dist/es2019/root/ui/progressBar/progressBar.js +1 -1
  67. package/dist/es2019/root/ui/progressBar/styled.js +2 -1
  68. package/dist/es2019/root/ui/styled.js +4 -64
  69. package/dist/es2019/root/ui/styledSSR.js +93 -0
  70. package/dist/es2019/root/ui/titleBox/failedTitleBox.js +5 -3
  71. package/dist/es2019/root/ui/titleBox/styled.js +2 -1
  72. package/dist/es2019/utils/analytics.js +29 -40
  73. package/dist/es2019/utils/dimensionComparer.js +1 -1
  74. package/dist/es2019/utils/document.js +1 -0
  75. package/dist/es2019/utils/getDataURIDimension.js +8 -0
  76. package/dist/es2019/utils/metadata.js +12 -4
  77. package/dist/es2019/utils/objectURLCache.js +5 -0
  78. package/dist/es2019/utils/resizeModeToMediaImageProps.js +6 -0
  79. package/dist/es2019/utils/shouldDisplayImageThumbnail.js +1 -1
  80. package/dist/es2019/utils/videoSnapshot.js +7 -0
  81. package/dist/es2019/version.json +1 -1
  82. package/dist/esm/errors.js +85 -2
  83. package/dist/esm/files/cardImageView/index.js +55 -87
  84. package/dist/esm/files/index.js +1 -1
  85. package/dist/esm/index.js +3 -3
  86. package/dist/esm/root/card/cardAnalytics.js +23 -18
  87. package/dist/esm/root/card/cardConstants.js +1 -0
  88. package/dist/esm/root/card/cardSSRView.js +92 -0
  89. package/dist/esm/root/card/cardState.js +32 -0
  90. package/dist/esm/root/card/getCardPreview/cache.js +33 -0
  91. package/dist/esm/root/card/getCardPreview/filePreviewStatus.js +35 -0
  92. package/dist/esm/root/card/getCardPreview/helpers.js +194 -0
  93. package/dist/esm/root/card/getCardPreview/index.js +174 -0
  94. package/dist/esm/root/card/getCardStatus.js +13 -17
  95. package/dist/esm/root/card/index.js +349 -401
  96. package/dist/esm/root/cardView.js +105 -52
  97. package/dist/esm/root/index.js +2 -1
  98. package/dist/esm/root/inline/loader.js +23 -22
  99. package/dist/esm/root/inline/{inlineMediaCard.js → mediaInlineCard.js} +62 -22
  100. package/dist/esm/root/inlinePlayer.js +5 -13
  101. package/dist/esm/root/ui/Breakpoint.js +6 -0
  102. package/dist/esm/root/ui/common.js +1 -7
  103. package/dist/esm/root/ui/iconMessage/index.js +12 -7
  104. package/dist/esm/root/ui/imageRenderer/imageRenderer.js +24 -106
  105. package/dist/esm/root/ui/loadingRateLimited/loadingRateLimited.js +1 -1
  106. package/dist/esm/root/ui/progressBar/progressBar.js +1 -1
  107. package/dist/esm/root/ui/progressBar/styled.js +2 -1
  108. package/dist/esm/root/ui/styled.js +13 -61
  109. package/dist/esm/root/ui/styledSSR.js +76 -0
  110. package/dist/esm/root/ui/titleBox/failedTitleBox.js +6 -3
  111. package/dist/esm/root/ui/titleBox/styled.js +2 -1
  112. package/dist/esm/utils/analytics.js +22 -35
  113. package/dist/esm/utils/dimensionComparer.js +1 -1
  114. package/dist/esm/utils/document.js +3 -0
  115. package/dist/esm/utils/getDataURIDimension.js +8 -0
  116. package/dist/esm/utils/metadata.js +12 -4
  117. package/dist/esm/utils/objectURLCache.js +6 -0
  118. package/dist/esm/utils/resizeModeToMediaImageProps.js +6 -0
  119. package/dist/esm/utils/shouldDisplayImageThumbnail.js +1 -1
  120. package/dist/esm/utils/videoSnapshot.js +31 -0
  121. package/dist/esm/version.json +1 -1
  122. package/dist/types/__tests_external__/page-objects/MediaCard.d.ts +4 -3
  123. package/dist/types/errors.d.ts +24 -2
  124. package/dist/types/files/cardImageView/index.d.ts +5 -12
  125. package/dist/types/files/cardImageView/styled.d.ts +1 -1
  126. package/dist/types/files/index.d.ts +1 -1
  127. package/dist/types/index.d.ts +9 -12
  128. package/dist/types/root/card/cardAnalytics.d.ts +5 -7
  129. package/dist/types/root/card/cardConstants.d.ts +1 -0
  130. package/dist/types/root/card/cardSSRView.d.ts +13 -0
  131. package/dist/types/root/card/cardState.d.ts +5 -0
  132. package/dist/types/root/card/getCardPreview/cache.d.ts +18 -0
  133. package/dist/types/root/card/getCardPreview/filePreviewStatus.d.ts +5 -0
  134. package/dist/types/root/card/getCardPreview/helpers.d.ts +9 -0
  135. package/dist/types/root/card/getCardPreview/index.d.ts +44 -0
  136. package/dist/types/root/card/getCardStatus.d.ts +4 -14
  137. package/dist/types/root/card/index.d.ts +17 -21
  138. package/dist/types/root/cardView.d.ts +12 -8
  139. package/dist/types/root/index.d.ts +1 -0
  140. package/dist/types/root/inline/loader.d.ts +8 -8
  141. package/dist/types/root/inline/{inlineMediaCard.d.ts → mediaInlineCard.d.ts} +4 -4
  142. package/dist/types/root/inlinePlayer.d.ts +1 -1
  143. package/dist/types/root/ui/Breakpoint.d.ts +4 -0
  144. package/dist/types/root/ui/common.d.ts +1 -4
  145. package/dist/types/root/ui/iconMessage/index.d.ts +7 -2
  146. package/dist/types/root/ui/iconWrapper/styled.d.ts +1 -1
  147. package/dist/types/root/ui/imageRenderer/imageRenderer.d.ts +2 -16
  148. package/dist/types/root/ui/loadingRateLimited/loadingRateLimited.d.ts +1 -1
  149. package/dist/types/root/ui/loadingRateLimited/styled.d.ts +1 -1
  150. package/dist/types/root/ui/progressBar/progressBar.d.ts +1 -1
  151. package/dist/types/root/ui/progressBar/styled.d.ts +1 -1
  152. package/dist/types/root/ui/styled.d.ts +3 -10
  153. package/dist/types/root/ui/styledSSR.d.ts +16 -0
  154. package/dist/types/root/ui/titleBox/failedTitleBox.d.ts +3 -1
  155. package/dist/types/root/ui/titleBox/styled.d.ts +1 -1
  156. package/dist/types/root/ui/titleBox/titleBox.d.ts +1 -1
  157. package/dist/types/types.d.ts +15 -1
  158. package/dist/types/utils/analytics.d.ts +20 -21
  159. package/dist/types/utils/cardDimensions.d.ts +5 -1
  160. package/dist/types/utils/dimensionComparer.d.ts +1 -1
  161. package/dist/types/utils/document.d.ts +2 -0
  162. package/dist/types/utils/getDataURIDimension.d.ts +3 -1
  163. package/dist/types/utils/index.d.ts +1 -0
  164. package/dist/types/utils/lazyContent/styled.d.ts +1 -1
  165. package/dist/types/utils/lightCards/types.d.ts +1 -1
  166. package/dist/types/utils/metadata.d.ts +2 -2
  167. package/dist/types/utils/objectURLCache.d.ts +2 -1
  168. package/dist/types/utils/resizeModeToMediaImageProps.d.ts +5 -0
  169. package/dist/types/utils/shouldDisplayImageThumbnail.d.ts +1 -1
  170. package/dist/types/utils/videoSnapshot.d.ts +1 -0
  171. package/example-helpers/index.tsx +21 -0
  172. package/package.json +19 -17
  173. package/dist/cjs/root/card/getCardPreview.js +0 -173
  174. package/dist/cjs/utils/fileAttributesContext.js +0 -40
  175. package/dist/es2019/root/card/getCardPreview.js +0 -86
  176. package/dist/es2019/root/inline/inlineMediaCard.js +0 -92
  177. package/dist/es2019/utils/fileAttributesContext.js +0 -19
  178. package/dist/esm/root/card/getCardPreview.js +0 -153
  179. package/dist/esm/utils/fileAttributesContext.js +0 -18
  180. package/dist/types/root/card/getCardPreview.d.ts +0 -8
  181. package/dist/types/utils/fileAttributesContext.d.ts +0 -10
@@ -1,8 +1,9 @@
1
1
  /// <reference types="cypress" />
2
2
  /// <reference types="jquery" />
3
- export declare class MediaCardPageObject {
4
- private cy;
5
- constructor(cy: Cypress.cy);
3
+ import { InProductTestPageObject } from '@atlaskit/in-product-testing';
4
+ export declare class MediaCardPageObject extends InProductTestPageObject {
6
5
  expectCardReady(numOfCards: number): Cypress.Chainable<JQuery<HTMLElement>>;
7
6
  findCardNth(nth: number): Cypress.Chainable<JQuery<HTMLElement>>;
7
+ findImage(nth: number): Cypress.Chainable<JQuery<HTMLElement>>;
8
+ assertAltText(altText: string, nth?: number): Cypress.Chainable<JQuery<HTMLElement>>;
8
9
  }
@@ -1,9 +1,31 @@
1
- export declare type MediaCardErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'local-preview-get' | 'remote-preview-fetch' | 'error-file-state' | 'preview-fetch';
1
+ import { CardPreview } from '.';
2
+ export declare type MediaCardErrorPrimaryReason = 'upload' | 'metadata-fetch' | 'error-file-state' | RemotePreviewPrimaryReason | LocalPreviewPrimaryReason | ImageLoadPrimaryReason | 'preview-fetch';
3
+ export declare type ImageLoadPrimaryReason = 'cache-remote-uri' | 'cache-local-uri' | 'local-uri' | 'remote-uri' | 'external-uri' | 'unknown-uri';
4
+ export declare type RemotePreviewPrimaryReason = 'remote-preview-fetch' | 'remote-preview-not-ready';
5
+ export declare type LocalPreviewPrimaryReason = 'local-preview-get' | 'local-preview-unsupported' | 'local-preview-rejected' | 'local-preview-image' | 'local-preview-video';
2
6
  export declare class MediaCardError extends Error {
3
7
  readonly primaryReason: MediaCardErrorPrimaryReason;
4
8
  readonly secondaryError?: Error | undefined;
5
9
  constructor(primaryReason: MediaCardErrorPrimaryReason, secondaryError?: Error | undefined);
6
10
  }
11
+ export declare class LocalPreviewError extends MediaCardError {
12
+ readonly primaryReason: LocalPreviewPrimaryReason;
13
+ readonly secondaryError?: Error | undefined;
14
+ constructor(primaryReason: LocalPreviewPrimaryReason, secondaryError?: Error | undefined);
15
+ }
16
+ export declare class RemotePreviewError extends MediaCardError {
17
+ readonly primaryReason: RemotePreviewPrimaryReason;
18
+ readonly secondaryError?: Error | undefined;
19
+ constructor(primaryReason: RemotePreviewPrimaryReason, secondaryError?: Error | undefined);
20
+ }
21
+ export declare const getImageLoadPrimaryReason: (source?: "local" | "remote" | "cache-local" | "cache-remote" | "external" | undefined) => ImageLoadPrimaryReason;
22
+ export declare class ImageLoadError extends MediaCardError {
23
+ constructor(source?: CardPreview['source']);
24
+ }
7
25
  export declare function isMediaCardError(err: Error): err is MediaCardError;
8
- export declare const isLocalPreviewError: (err: Error) => boolean;
26
+ export declare const isLocalPreviewError: (err: Error) => err is LocalPreviewError;
27
+ export declare const isRemotePreviewError: (err: Error) => err is LocalPreviewError;
28
+ export declare const isUnsupportedLocalPreviewError: (err: Error) => boolean;
29
+ export declare function isImageLoadError(err: Error): err is ImageLoadError;
9
30
  export declare const ensureMediaCardError: (primaryReason: MediaCardErrorPrimaryReason, error: Error) => MediaCardError;
31
+ export declare const isUploadError: (error: MediaCardError) => boolean;
@@ -1,11 +1,7 @@
1
- import React from 'react';
2
1
  import { Component, ReactNode } from 'react';
3
2
  import { MediaItemType, MediaType, ImageResizeMode } from '@atlaskit/media-client';
4
3
  import { CardDimensions, CardStatus } from '../../index';
5
4
  import { CardAction } from '../../actions';
6
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
7
- import { RenderEventAction } from '../../utils/analytics';
8
- import { WithFileAttributesProps } from '../../utils/fileAttributesContext';
9
5
  export interface FileCardImageViewProps {
10
6
  readonly mediaName?: string;
11
7
  readonly mediaType?: MediaType;
@@ -25,13 +21,14 @@ export interface FileCardImageViewProps {
25
21
  readonly actions?: CardAction[];
26
22
  readonly onDisplayImage?: () => void;
27
23
  readonly previewOrientation?: number;
24
+ readonly onImageError?: () => void;
25
+ readonly onImageLoad?: () => void;
28
26
  }
29
27
  export declare const fileCardImageViewSelector = "media-file-card-view";
30
- export declare type FileCardImageViewBaseProps = FileCardImageViewProps & WithAnalyticsEventsProps & WithFileAttributesProps;
31
- export declare class FileCardImageViewBase extends Component<FileCardImageViewBaseProps> {
28
+ export declare const fileCardImageViewSelectedSelector = "media-file-card-view-selected";
29
+ export declare class FileCardImageView extends Component<FileCardImageViewProps> {
32
30
  private wasThumbnailDisplayed;
33
- private lastAnalyticsAction;
34
- static defaultProps: Partial<FileCardImageViewBaseProps>;
31
+ static defaultProps: Partial<FileCardImageViewProps>;
35
32
  render(): JSX.Element;
36
33
  private renderCardContents;
37
34
  private renderLoadingContents;
@@ -39,10 +36,7 @@ export declare class FileCardImageViewBase extends Component<FileCardImageViewBa
39
36
  private renderFailedContents;
40
37
  private renderUploadingCardOverlay;
41
38
  private renderPlayButton;
42
- onImageLoad: () => void;
43
- onImageError: () => void;
44
39
  private renderMediaImage;
45
- shouldFireEvent: (action: RenderEventAction) => boolean;
46
40
  private renderProgressBar;
47
41
  private renderSuccessCardContents;
48
42
  private renderSuccessCardOverlay;
@@ -50,4 +44,3 @@ export declare class FileCardImageViewBase extends Component<FileCardImageViewBa
50
44
  private get isCropped();
51
45
  private get isStretched();
52
46
  }
53
- export declare const FileCardImageView: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<FileCardImageViewProps & WithAnalyticsEventsProps>, "progress" | "error" | "children" | "mediaType" | "actions" | "mediaName" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "mimeType" | "fileSize" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation"> & React.RefAttributes<any>>;
@@ -6,7 +6,7 @@ export interface WrapperProps {
6
6
  hasOnClick?: boolean;
7
7
  mediaType?: string;
8
8
  }
9
- export declare const Wrapper: import("styled-components").StyledComponentClass<import("react").HTMLAttributes<{}> & WrapperProps, any, Pick<import("react").HTMLAttributes<{}>, "dir" | "slot" | "style" | "title" | "id" | "children" | "onError" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css"> & {
9
+ export declare const Wrapper: import("styled-components").StyledComponentClass<import("react").HTMLAttributes<{}> & WrapperProps, any, Pick<import("react").HTMLAttributes<{}>, "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css"> & {
10
10
  theme?: any;
11
11
  } & WrapperProps>;
12
12
  export declare const PlayIconWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
- export { FileCardImageView, FileCardImageViewBase } from './cardImageView';
1
+ export { FileCardImageView } from './cardImageView';
2
2
  export type { FileCardImageViewProps } from './cardImageView';
@@ -4,20 +4,15 @@ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
4
4
  import { MediaFeatureFlags, NumericalCardDimensions } from '@atlaskit/media-common';
5
5
  import { CardAction } from './actions';
6
6
  import { MediaViewerDataSource } from '@atlaskit/media-viewer';
7
- import { CardPreview } from './root/card/getCardPreview';
8
- import { CardStatus } from './types';
7
+ import { CardPreview, CardStatus, CardAppearance } from './types';
9
8
  import { MediaCardError } from './errors';
9
+ import { CardDimensions } from './utils';
10
+ export type { CardDimensions } from './utils';
10
11
  export type { NumericalCardDimensions } from '@atlaskit/media-common';
11
- export { default as Card } from './root/card/cardLoader';
12
+ export { Card, MediaInlineCard } from './root';
12
13
  export type { CardAction, CardEventHandler } from './actions';
13
- export type { CardStatus } from './types';
14
- export declare type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
15
- export declare type CardDimensionValue = number | string;
14
+ export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, } from './types';
16
15
  export declare type TitleBoxIcon = 'LockFilledIcon';
17
- export interface CardDimensions {
18
- width?: CardDimensionValue;
19
- height?: CardDimensionValue;
20
- }
21
16
  export interface CardEvent {
22
17
  event: MouseEvent<HTMLElement>;
23
18
  mediaItemDetails?: FileDetails;
@@ -64,10 +59,12 @@ export interface CardState {
64
59
  cardPreview?: CardPreview;
65
60
  error?: MediaCardError;
66
61
  cardRef: HTMLDivElement | null;
62
+ isBannedLocalPreview: boolean;
63
+ previewDidRender: boolean;
67
64
  }
68
65
  export { CardLoading } from './utils/lightCards/cardLoading';
69
66
  export { CardError } from './utils/lightCards/cardError';
70
67
  export { defaultImageCardDimensions } from './utils/cardDimensions';
71
- export { fileCardImageViewSelector } from './files/cardImageView';
68
+ export { fileCardImageViewSelector, fileCardImageViewSelectedSelector, } from './files/cardImageView';
72
69
  export { inlinePlayerClassName } from './root/inlinePlayer';
73
- export { newFileExperienceClassName } from './root/cardView';
70
+ export { newFileExperienceClassName } from './root/card/cardConstants';
@@ -1,11 +1,9 @@
1
- import { FileAttributes, MediaFeatureFlags } from '@atlaskit/media-common';
1
+ import { FileAttributes, MediaFeatureFlags, PerformanceAttributes } from '@atlaskit/media-common';
2
2
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import { CardStatus } from '../..';
4
- import { CardPreview } from './getCardPreview';
5
4
  import { MediaCardError } from './../../errors';
6
5
  export declare const relevantFeatureFlagNames: Array<keyof MediaFeatureFlags>;
7
- export declare type FireOperationalEventParams = {
8
- cardPreview?: CardPreview;
9
- error?: MediaCardError;
10
- };
11
- export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, { cardPreview, error }?: FireOperationalEventParams) => void;
6
+ export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error?: MediaCardError | undefined) => 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;
@@ -0,0 +1 @@
1
+ export declare const newFileExperienceClassName = "new-file-experience-wrapper";
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { FileIdentifier, ImageResizeMode, MediaClient } from '@atlaskit/media-client';
3
+ import { CardDimensions } from '../../utils/cardDimensions';
4
+ export interface CardSSRViewProps {
5
+ readonly identifier: FileIdentifier;
6
+ readonly dimensions?: CardDimensions;
7
+ readonly mediaClient: MediaClient;
8
+ readonly resizeMode?: ImageResizeMode;
9
+ readonly alt?: string;
10
+ readonly disableOverlay: boolean;
11
+ readonly isLazy?: boolean;
12
+ }
13
+ export declare const CardSSRView: FC<CardSSRViewProps>;
@@ -0,0 +1,5 @@
1
+ import { FileState } from '@atlaskit/media-client';
2
+ import { MediaFeatureFlags } from '@atlaskit/media-common';
3
+ import { CardState } from '../..';
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>;
@@ -0,0 +1,18 @@
1
+ import { ObjectURLCache } from '../../../utils/objectURLCache';
2
+ import { CardDimensions } from '../../../utils/cardDimensions';
3
+ import { CardPreview } from '../../../types';
4
+ export declare const getCacheKey: (id: string, dimensions: CardDimensions) => string;
5
+ export interface CardPreviewCache {
6
+ get(id: string, dimensions: CardDimensions): CardPreview | undefined;
7
+ set(id: string, dimensions: CardDimensions, cardPreview: CardPreview): void;
8
+ remove(id: string, dimensions: CardDimensions): void;
9
+ }
10
+ export declare class CardPreviewCacheImpl implements CardPreviewCache {
11
+ private previewCache;
12
+ constructor(previewCache: ObjectURLCache);
13
+ get: (id: string, dimensions: CardDimensions) => CardPreview | undefined;
14
+ set: (id: string, dimensions: CardDimensions, cardPreview: CardPreview) => void;
15
+ remove: (id: string, dimensions: CardDimensions) => void;
16
+ }
17
+ declare const _default: CardPreviewCacheImpl;
18
+ export default _default;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,9 @@
1
+ import { MediaClient, FilePreview, MediaStoreGetFileImageParams } 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?: "audio" | "video" | "image" | "doc" | "archive" | "unknown" | 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>;
@@ -0,0 +1,44 @@
1
+ import { MediaClient, FilePreview, FileState, MediaStoreGetFileImageParams, MediaBlobUrlAttrs } from '@atlaskit/media-client';
2
+ import { MediaFeatureFlags } from '@atlaskit/media-common';
3
+ import { CardDimensions } from '../../../utils/cardDimensions';
4
+ import { MediaCardError } from '../../../errors';
5
+ import { CardStatus, CardPreview } from '../../../types';
6
+ export { getCardPreviewFromFilePreview, getCardPreviewFromBackend, isSupportedLocalPreview, } from './helpers';
7
+ export { extractFilePreviewStatus } from './filePreviewStatus';
8
+ export declare const getCardPreviewFromCache: (id: string, dimensions: CardDimensions) => CardPreview | undefined;
9
+ export declare const removeCardPreviewFromCache: (id: string, dimensions: CardDimensions) => void;
10
+ /**
11
+ * Will return the preview if available and supported by the browser
12
+ * See extractFilePreviewStatus "hasLocalPreview" logic
13
+ */
14
+ export declare const getFilePreviewFromFileState: (fileState: FileState) => FilePreview | Promise<FilePreview> | undefined;
15
+ export declare type CardPreviewParams = {
16
+ mediaClient: MediaClient;
17
+ id: string;
18
+ dimensions?: CardDimensions;
19
+ filePreview?: FilePreview | Promise<FilePreview>;
20
+ onLocalPreviewError?: (error: MediaCardError) => void;
21
+ isRemotePreviewReady: boolean;
22
+ imageUrlParams: MediaStoreGetFileImageParams;
23
+ mediaBlobUrlAttrs?: MediaBlobUrlAttrs;
24
+ };
25
+ /**
26
+ * This function will try to return a Card preview, either from cache, local preview or remote preview.
27
+ * It should only be called if there is a chance to get either a remote or a local preview, or both.
28
+ * This, in order to ensure there is always going to be a valid return value OR throw an error if the process fails.
29
+ * It is worth noting that local preview failures break the process if there is no remote preview available.
30
+ * In that case we throw an error immediately.
31
+ * Otherwise, if the local preview fails but there is a remote preview available, the failure does not break the process.
32
+ * In that case, we still want to report the local preview error to the caller, for feature realiability track.
33
+ * hence the use of the optional callback onLocalPreviewError
34
+ */
35
+ export declare const getCardPreview: ({ mediaClient, id, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, }: CardPreviewParams) => Promise<CardPreview>;
36
+ export declare const shouldResolvePreview: ({ status, fileState, dimensions, prevDimensions, hasCardPreview, isBannedLocalPreview, featureFlags, }: {
37
+ status: CardStatus;
38
+ fileState: FileState;
39
+ dimensions?: CardDimensions | undefined;
40
+ prevDimensions?: CardDimensions | undefined;
41
+ hasCardPreview: boolean;
42
+ isBannedLocalPreview: boolean;
43
+ featureFlags?: MediaFeatureFlags | undefined;
44
+ }) => boolean;
@@ -1,14 +1,4 @@
1
- import { FileStatus, FileState } from '@atlaskit/media-client';
2
- import { MediaFeatureFlags } from '@atlaskit/media-common';
3
- import { CardStatus } from '../../';
4
- export declare type GetCardStatusParams = {
5
- isPreviewableType: boolean;
6
- isPreviewableFileState: boolean;
7
- hasFilesize: boolean;
8
- };
9
- export declare const extractCardStatusParams: (fileState: FileState, featureFlags?: MediaFeatureFlags | undefined) => {
10
- isPreviewableType: boolean;
11
- hasFilesize: boolean;
12
- isPreviewableFileState: boolean;
13
- };
14
- export declare const getCardStatus: (fileStatus: FileStatus, { isPreviewableType, hasFilesize, isPreviewableFileState, }: GetCardStatusParams) => CardStatus;
1
+ import { FileStatus } from '@atlaskit/media-client';
2
+ import { CardStatus, FilePreviewStatus } from '../../types';
3
+ export declare const isFinalCardStatus: (status: CardStatus) => boolean;
4
+ export declare const getCardStatus: (fileStatus: FileStatus, { hasFilesize, isPreviewable, hasPreview }: FilePreviewStatus) => CardStatus;
@@ -1,43 +1,39 @@
1
1
  /// <reference types="react-intl" />
2
2
  import React, { Component } from 'react';
3
3
  import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
- import { FileIdentifier, MediaClient } from '@atlaskit/media-client';
4
+ import { FileIdentifier } from '@atlaskit/media-client';
5
5
  import { Subscription } from 'rxjs/Subscription';
6
- import { CardAction, CardDimensions, CardProps, CardState } from '../..';
6
+ import { CardAction, CardProps, CardState } from '../..';
7
7
  export declare type CardWithAnalyticsEventsProps = CardProps & WithAnalyticsEventsProps;
8
8
  export declare class CardBase extends Component<CardWithAnalyticsEventsProps, CardState> {
9
9
  private hasBeenMounted;
10
- private lastFileState?;
11
- private lastCardStatusUpdateTimestamp?;
10
+ private timeElapsedTillCommenced;
12
11
  subscription?: Subscription;
13
12
  static defaultProps: Partial<CardProps>;
14
13
  static contextTypes: {
15
14
  intl: ReactIntl.IntlShape;
16
15
  };
17
16
  constructor(props: CardWithAnalyticsEventsProps);
18
- onCopyListener: () => void;
19
- private getPreviewCacheKey;
20
17
  componentDidMount(): void;
21
18
  componentDidUpdate(prevProps: CardProps, prevState: CardState): void;
22
- static getDerivedStateFromProps: (props: CardProps) => {
23
- status: string;
24
- cardPreview: {
25
- dataURI: string;
26
- orientation: number;
27
- };
28
- } | null;
29
- shouldRefetchImage: (current?: CardDimensions | undefined, next?: CardDimensions | undefined) => boolean;
30
19
  componentWillUnmount(): void;
31
- updateStateForIdentifier(): void;
32
- private isLatestCardStatusUpdate;
33
- private getRequestedDimensions;
34
- private addContextToDataURI;
35
- private getCardPreview;
36
- subscribeInternalFile(identifier: FileIdentifier, mediaClient: MediaClient): void;
20
+ updateStateForIdentifier(identifier: FileIdentifier): void;
21
+ private getImageURLParams;
22
+ private getMediaBlobUrlAttrs;
23
+ private getCardPreviewParams;
24
+ private resolvePreview;
25
+ subscribeInternalFile(identifier: FileIdentifier): void;
26
+ private get requestedDimensions();
37
27
  private get metadata();
38
28
  private get fileAttributes();
29
+ private getPerformanceAttributes;
30
+ private onImageError;
31
+ private onImageLoad;
32
+ private fireOperationalEvent;
39
33
  private fireCommencedEvent;
40
- private fireFileCopiedEvent;
34
+ private fireCopiedEvent;
35
+ private fireScreenEvent;
36
+ private fireLocalPreviewErrorEvent;
41
37
  private safeSetState;
42
38
  unsubscribe: () => void;
43
39
  get actions(): CardAction[];
@@ -1,14 +1,14 @@
1
- import React from 'react';
2
- import { MouseEvent } from 'react';
1
+ import React, { MouseEvent } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
3
  import { MediaItemType, FileDetails } from '@atlaskit/media-client';
4
4
  import { WithAnalyticsEventsProps, UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  import { SharedCardProps, CardStatus } from '../index';
6
- export declare const newFileExperienceClassName = "new-file-experience-wrapper";
6
+ import { MediaCardError } from '../errors';
7
7
  export interface CardViewOwnProps extends SharedCardProps {
8
8
  readonly status: CardStatus;
9
9
  readonly mediaItemType: MediaItemType;
10
10
  readonly metadata?: FileDetails;
11
- readonly error?: Error;
11
+ readonly error?: MediaCardError;
12
12
  readonly onClick?: (event: React.MouseEvent<HTMLDivElement>, analyticsEvent?: UIAnalyticsEvent) => void;
13
13
  readonly onMouseEnter?: (event: MouseEvent<HTMLDivElement>) => void;
14
14
  readonly onDisplayImage?: () => void;
@@ -16,10 +16,13 @@ export interface CardViewOwnProps extends SharedCardProps {
16
16
  readonly progress?: number;
17
17
  readonly previewOrientation?: number;
18
18
  readonly innerRef?: (instance: HTMLDivElement | null) => void;
19
+ readonly onImageLoad: () => void;
20
+ readonly onImageError: () => void;
21
+ disableAnimation?: boolean;
19
22
  }
20
23
  export interface CardViewState {
21
24
  elementWidth?: number;
22
- isImageFailedToLoad: boolean;
25
+ didImageRender: boolean;
23
26
  }
24
27
  export declare type CardViewProps = CardViewOwnProps & WithAnalyticsEventsProps;
25
28
  export interface RenderConfigByStatus {
@@ -33,8 +36,8 @@ export interface RenderConfigByStatus {
33
36
  renderProgressBar?: boolean;
34
37
  renderSpinner?: boolean;
35
38
  renderFailedTitleBox?: boolean;
36
- renderLoadingRateLimited?: boolean;
37
39
  renderTickBox?: boolean;
40
+ customTitleMessage?: FormattedMessage.MessageDescriptor;
38
41
  }
39
42
  /**
40
43
  * This is classic vanilla CardView class. To create an instance of class one would need to supply
@@ -46,7 +49,8 @@ export declare class CardViewBase extends React.Component<CardViewProps, CardVie
46
49
  static defaultProps: Partial<CardViewOwnProps>;
47
50
  componentDidMount(): void;
48
51
  componentDidUpdate({ dataURI: prevDataURI }: CardViewProps): void;
49
- private onImageLoadError;
52
+ private onImageLoad;
53
+ private onImageError;
50
54
  private get width();
51
55
  private get breakpoint();
52
56
  saveElementWidth: () => void;
@@ -67,4 +71,4 @@ export declare class CardViewBase extends React.Component<CardViewProps, CardVie
67
71
  private getRenderConfigByStatus;
68
72
  private renderNewExperienceCard;
69
73
  }
70
- export declare const CardView: React.ForwardRefExoticComponent<Pick<Pick<CardViewProps, "progress" | "error" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "titleBoxBgColor" | "titleBoxIcon" | "originalDimensions">, never> & Partial<Pick<Pick<CardViewProps, "progress" | "error" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "titleBoxBgColor" | "titleBoxIcon" | "originalDimensions">, "progress" | "error" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "titleBoxBgColor" | "titleBoxIcon" | "originalDimensions">> & Partial<Pick<Partial<CardViewOwnProps>, never>> & React.RefAttributes<any>>;
74
+ export declare const CardView: React.ForwardRefExoticComponent<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "error" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError" | "onImageLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">, never> & Partial<Pick<Pick<CardViewProps, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "error" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError" | "onImageLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">, "progress" | "metadata" | "onClick" | "onMouseEnter" | "innerRef" | "appearance" | "error" | "actions" | "testId" | "selectable" | "selected" | "alt" | "disableOverlay" | "dimensions" | "featureFlags" | "dataURI" | "status" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError" | "onImageLoad" | "titleBoxBgColor" | "titleBoxIcon" | "disableAnimation" | "originalDimensions">> & Partial<Pick<Partial<CardViewOwnProps>, never>> & React.RefAttributes<any>>;
@@ -1 +1,2 @@
1
1
  export { default as Card } from './card/cardLoader';
2
+ export { default as MediaInlineCard } from './inline/loader';
@@ -1,22 +1,22 @@
1
1
  import React from 'react';
2
2
  import { WithMediaClientConfigProps } from '@atlaskit/media-client';
3
- import { InlineMediaCardProps } from './inlineMediaCard';
4
- export declare type InlineMediaCardWithMediaClientConfigProps = WithMediaClientConfigProps<InlineMediaCardProps>;
5
- declare type InlineMediaCardWithMediaClientConfigComponent = React.ComponentType<InlineMediaCardWithMediaClientConfigProps>;
3
+ import { MediaInlineCardProps } from './mediaInlineCard';
4
+ export declare type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<MediaInlineCardProps>;
5
+ declare type MediaInlineCardWithMediaClientConfigComponent = React.ComponentType<MediaInlineCardWithMediaClientConfigProps>;
6
6
  declare type ErrorBoundaryComponent = React.ComponentType<{
7
7
  data?: {
8
8
  [k: string]: any;
9
9
  };
10
10
  }>;
11
- export interface InlineMediaCardLoaderState {
12
- InlineMediaCard?: InlineMediaCardWithMediaClientConfigComponent;
11
+ export interface MediaInlineCardLoaderState {
12
+ MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
13
13
  ErrorBoundary?: ErrorBoundaryComponent;
14
14
  }
15
- export default class InlineMediaCardLoader extends React.PureComponent<InlineMediaCardWithMediaClientConfigProps & InlineMediaCardLoaderState, InlineMediaCardLoaderState> {
15
+ export default class MediaInlineCardLoader extends React.PureComponent<MediaInlineCardWithMediaClientConfigProps & MediaInlineCardLoaderState, MediaInlineCardLoaderState> {
16
16
  static displayName: string;
17
- static InlineMediaCard?: InlineMediaCardWithMediaClientConfigComponent;
17
+ static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
18
18
  static ErrorBoundary?: ErrorBoundaryComponent;
19
- state: InlineMediaCardLoaderState;
19
+ state: MediaInlineCardLoaderState;
20
20
  componentDidMount(): Promise<void>;
21
21
  render(): JSX.Element;
22
22
  }
@@ -2,7 +2,7 @@ import React, { FC } from 'react';
2
2
  import { FileIdentifier, MediaClient } from '@atlaskit/media-client';
3
3
  import { InjectedIntlProps } from 'react-intl';
4
4
  import { MediaViewerDataSource } from '@atlaskit/media-viewer';
5
- export interface InlineMediaCardProps {
5
+ export interface MediaInlineCardProps {
6
6
  identifier: FileIdentifier;
7
7
  mediaClient: MediaClient;
8
8
  shouldOpenMediaViewer?: boolean;
@@ -10,7 +10,7 @@ export interface InlineMediaCardProps {
10
10
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
11
11
  mediaViewerDataSource?: MediaViewerDataSource;
12
12
  }
13
- export declare const InlineMediaCardInternal: FC<InlineMediaCardProps & InjectedIntlProps>;
14
- export declare const InlineMediaCard: React.ComponentClass<InlineMediaCardProps, any> & {
15
- WrappedComponent: ReactIntl.ComponentConstructor<InlineMediaCardProps & InjectedIntlProps>;
13
+ export declare const MediaInlineCardInternal: FC<MediaInlineCardProps & InjectedIntlProps>;
14
+ export declare const MediaInlineCard: React.ComponentClass<MediaInlineCardProps, any> & {
15
+ WrappedComponent: ReactIntl.ComponentConstructor<MediaInlineCardProps & InjectedIntlProps>;
16
16
  };
@@ -40,4 +40,4 @@ export declare class InlinePlayerBase extends Component<InlinePlayerProps, Inlin
40
40
  onFirstPlay: () => void;
41
41
  render(): JSX.Element;
42
42
  }
43
- export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<Pick<InlinePlayerProps, "onError" | "onClick" | "createAnalyticsEvent" | "testId" | "selected" | "dimensions" | "originalDimensions" | "mediaClient" | "identifier" | "forwardRef"> & React.RefAttributes<HTMLDivElement>, "onError" | "key" | "onClick" | "testId" | "selected" | "dimensions" | "originalDimensions" | "mediaClient" | "identifier" | "forwardRef"> & React.RefAttributes<any>>;
43
+ export declare const InlinePlayer: React.ForwardRefExoticComponent<Pick<InlinePlayerProps, "onError" | "onClick" | "createAnalyticsEvent" | "testId" | "selected" | "dimensions" | "originalDimensions" | "mediaClient" | "identifier" | "forwardRef"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,4 @@
1
+ export declare enum Breakpoint {
2
+ SMALL = "small",
3
+ LARGE = "large"
4
+ }
@@ -1,7 +1,4 @@
1
- export declare enum Breakpoint {
2
- SMALL = "small",
3
- LARGE = "large"
4
- }
1
+ import { Breakpoint } from './Breakpoint';
5
2
  export declare const responsiveSettings: {
6
3
  small: {
7
4
  fontSize: number;
@@ -5,8 +5,13 @@ export declare type InternalIconMessageProps = {
5
5
  animated?: boolean;
6
6
  reducedFont?: boolean;
7
7
  };
8
+ declare type CreatingPreviewProps = {
9
+ disableAnimation?: boolean;
10
+ };
8
11
  export declare const IconMessage: React.FC<InternalIconMessageProps>;
9
- export declare const CreatingPreview: React.FC;
12
+ export declare const CreatingPreview: React.FC<CreatingPreviewProps>;
10
13
  export declare const PreviewUnavailable: React.FC;
11
- export declare const RateLimited: React.FC;
14
+ export declare const FailedToLoad: React.FC;
15
+ export declare const FailedToUpload: React.FC;
12
16
  export declare const PreviewCurrentlyUnavailable: React.FC;
17
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Breakpoint } from '../common';
2
+ import { Breakpoint } from '../Breakpoint';
3
3
  export declare function titleBoxHeight(hasTitleBox: boolean, breakpoint: Breakpoint): string;
4
4
  export declare type IconWrapperProps = {
5
5
  hasTitleBox: boolean;
@@ -1,8 +1,5 @@
1
1
  import React from 'react';
2
2
  import { MediaType, ImageResizeMode, MediaItemType } from '@atlaskit/media-client';
3
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
- import { RenderEventAction } from '../../../utils/analytics';
5
- import { WithFileAttributesProps } from '../../../utils/fileAttributesContext';
6
3
  export declare type ImageRendererProps = {
7
4
  readonly dataURI: string;
8
5
  readonly mediaType: MediaType;
@@ -12,17 +9,6 @@ export declare type ImageRendererProps = {
12
9
  readonly resizeMode?: ImageResizeMode;
13
10
  readonly onDisplayImage?: () => void;
14
11
  readonly onImageError?: () => void;
12
+ readonly onImageLoad?: () => void;
15
13
  };
16
- export declare const resizeModeToMediaImageProps: (resizeMode?: "crop" | "fit" | "full-fit" | "stretchy-fit" | undefined) => {
17
- crop: boolean;
18
- stretch: boolean;
19
- };
20
- export declare class ImageRendererBase extends React.Component<ImageRendererProps & WithAnalyticsEventsProps & WithFileAttributesProps> {
21
- private lastAnalyticsAction?;
22
- componentDidMount(): void;
23
- onImageLoad: () => void;
24
- onImageError: () => void;
25
- shouldFireEvent: (action: RenderEventAction) => boolean;
26
- render(): JSX.Element;
27
- }
28
- export declare const ImageRenderer: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<ImageRendererProps & WithAnalyticsEventsProps>, "children" | "mediaType" | "alt" | "dataURI" | "mediaItemType" | "resizeMode" | "onDisplayImage" | "previewOrientation" | "onImageError"> & React.RefAttributes<any>>;
14
+ export declare const ImageRenderer: React.FC<ImageRendererProps>;
@@ -1,4 +1,4 @@
1
- import { Breakpoint } from '../common';
1
+ import { Breakpoint } from '../Breakpoint';
2
2
  export declare const LoadingRateLimited: ({ breakpoint, positionBottom, }: {
3
3
  breakpoint?: Breakpoint | undefined;
4
4
  positionBottom?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes, ComponentClass } from 'react';
2
- import { Breakpoint } from '../common';
2
+ import { Breakpoint } from '../Breakpoint';
3
3
  export declare const LoadingRateLimitedContainer: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
4
4
  export declare const WarningIconWrapper: ComponentClass<HTMLAttributes<{}>>;
5
5
  export declare type StyledTextProps = {
@@ -1,4 +1,4 @@
1
- import { Breakpoint } from '../common';
1
+ import { Breakpoint } from '../Breakpoint';
2
2
  export declare type ProgressBarProps = {
3
3
  progress?: number;
4
4
  breakpoint?: Breakpoint;