@atlaskit/media-card 74.1.9 → 74.2.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 (37) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/card/card.js +11 -6
  3. package/dist/cjs/card/cardAnalytics.js +6 -5
  4. package/dist/cjs/card/getCardPreview/helpers.js +3 -3
  5. package/dist/cjs/card/getCardPreview/index.js +6 -6
  6. package/dist/cjs/utils/analytics.js +14 -8
  7. package/dist/cjs/utils/ufoExperiences.js +1 -1
  8. package/dist/cjs/utils/videoSnapshot.js +36 -11
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/card/card.js +13 -6
  11. package/dist/es2019/card/cardAnalytics.js +6 -6
  12. package/dist/es2019/card/getCardPreview/helpers.js +2 -2
  13. package/dist/es2019/card/getCardPreview/index.js +5 -4
  14. package/dist/es2019/utils/analytics.js +14 -8
  15. package/dist/es2019/utils/ufoExperiences.js +1 -1
  16. package/dist/es2019/utils/videoSnapshot.js +36 -5
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/card/card.js +13 -6
  19. package/dist/esm/card/cardAnalytics.js +6 -5
  20. package/dist/esm/card/getCardPreview/helpers.js +3 -3
  21. package/dist/esm/card/getCardPreview/index.js +6 -6
  22. package/dist/esm/utils/analytics.js +14 -8
  23. package/dist/esm/utils/ufoExperiences.js +1 -1
  24. package/dist/esm/utils/videoSnapshot.js +36 -10
  25. package/dist/esm/version.json +1 -1
  26. package/dist/types/card/card.d.ts +1 -0
  27. package/dist/types/card/cardAnalytics.d.ts +3 -3
  28. package/dist/types/card/getCardPreview/helpers.d.ts +1 -1
  29. package/dist/types/card/getCardPreview/index.d.ts +3 -2
  30. package/dist/types/utils/analytics.d.ts +8 -8
  31. package/dist/types-ts4.0/card/card.d.ts +1 -0
  32. package/dist/types-ts4.0/card/cardAnalytics.d.ts +3 -3
  33. package/dist/types-ts4.0/card/getCardPreview/helpers.d.ts +1 -1
  34. package/dist/types-ts4.0/card/getCardPreview/index.d.ts +3 -2
  35. package/dist/types-ts4.0/utils/analytics.d.ts +8 -8
  36. package/package.json +7 -8
  37. package/report.api.md +192 -85
package/report.api.md CHANGED
@@ -1,6 +1,10 @@
1
- ## API Report File for "@atlaskit/media-card".
1
+ ## API Report File for "@atlaskit/media-card"
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
4
8
 
5
9
  [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
6
10
 
@@ -27,68 +31,96 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
27
31
  import { WithMediaClientConfigProps } from '@atlaskit/media-client';
28
32
  import { WrappedComponentProps } from 'react-intl-next';
29
33
 
30
- export declare const Card: React_2.FC<CardWithMediaClientConfigProps>;
34
+ // @public (undocumented)
35
+ export const Card: React_2.FC<CardWithMediaClientConfigProps>;
31
36
 
32
- export declare interface CardAction {
33
- label?: string;
37
+ // @public (undocumented)
38
+ export interface CardAction {
39
+ // (undocumented)
34
40
  handler: CardEventHandler;
41
+ // (undocumented)
35
42
  icon?: ReactNode;
43
+ // (undocumented)
44
+ label?: string;
36
45
  }
37
46
 
38
- export declare type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
47
+ // @public (undocumented)
48
+ export type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
39
49
 
40
- declare type CardBaseProps = CardProps &
50
+ // @public (undocumented)
51
+ type CardBaseProps = CardProps &
41
52
  WithAnalyticsEventsProps &
42
53
  Partial<WrappedComponentProps>;
43
54
 
44
- export declare interface CardDimensions {
45
- width?: CardDimensionValue;
55
+ // @public (undocumented)
56
+ export interface CardDimensions {
57
+ // (undocumented)
46
58
  height?: CardDimensionValue;
59
+ // (undocumented)
60
+ width?: CardDimensionValue;
47
61
  }
48
62
 
49
- export declare type CardDimensionValue = number | string;
63
+ // @public (undocumented)
64
+ export type CardDimensionValue = number | string;
50
65
 
51
- export declare class CardError extends Component<ErrorCardProps, {}> {
66
+ // @public (undocumented)
67
+ export class CardError extends Component<ErrorCardProps, {}> {
68
+ // (undocumented)
52
69
  static defaultProps: {
53
70
  size: string;
54
71
  };
55
- render(): JSX.Element;
72
+ // (undocumented)
56
73
  get icon(): JSX.Element;
74
+ // (undocumented)
75
+ render(): JSX.Element;
57
76
  }
58
77
 
59
- export declare interface CardEvent {
78
+ // @public (undocumented)
79
+ export interface CardEvent {
80
+ // (undocumented)
60
81
  event: MouseEvent_2<HTMLElement>;
82
+ // (undocumented)
61
83
  mediaItemDetails?: FileDetails;
62
84
  }
63
85
 
64
- export declare type CardEventHandler = (item?: FileItem, event?: Event) => void;
86
+ // @public (undocumented)
87
+ export type CardEventHandler = (item?: FileItem, event?: Event) => void;
65
88
 
66
- declare interface CardEventProps {
89
+ // @public (undocumented)
90
+ interface CardEventProps {
91
+ // (undocumented)
67
92
  readonly onClick?: CardOnClickCallback;
68
- readonly onMouseEnter?: (result: CardEvent) => void;
69
- /** Callback function to be called when video enters and exit fullscreen.
70
- * `fullscreen = true` indicates video enters fullscreen
71
- * `fullscreen = false` indicates video exits fullscreen
72
- */
73
93
  readonly onFullscreenChange?: (fullscreen: boolean) => void;
94
+ // (undocumented)
95
+ readonly onMouseEnter?: (result: CardEvent) => void;
74
96
  }
75
97
 
76
- export declare class CardLoading extends Component<StaticCardProps, {}> {
98
+ // @public (undocumented)
99
+ export class CardLoading extends Component<StaticCardProps, {}> {
100
+ // (undocumented)
77
101
  render(): JSX.Element;
78
102
  }
79
103
 
80
- export declare interface CardOnClickCallback {
104
+ // @public (undocumented)
105
+ export interface CardOnClickCallback {
106
+ // (undocumented)
81
107
  (result: CardEvent, analyticsEvent?: UIAnalyticsEvent): void;
82
108
  }
83
109
 
84
- export declare interface CardPreview {
110
+ // @public (undocumented)
111
+ export interface CardPreview {
112
+ // (undocumented)
85
113
  dataURI: string;
86
- orientation?: number;
114
+ // (undocumented)
87
115
  dimensions?: CardDimensions;
116
+ // (undocumented)
117
+ orientation?: number;
118
+ // (undocumented)
88
119
  source: CardPreviewSource;
89
120
  }
90
121
 
91
- declare type CardPreviewSource =
122
+ // @public (undocumented)
123
+ type CardPreviewSource =
92
124
  | 'local'
93
125
  | 'remote'
94
126
  | 'ssr-server'
@@ -100,34 +132,58 @@ declare type CardPreviewSource =
100
132
  | 'cache-ssr-server'
101
133
  | 'external';
102
134
 
103
- export declare interface CardProps extends SharedCardProps, CardEventProps {
104
- readonly mediaClient: MediaClient;
135
+ // @public (undocumented)
136
+ export interface CardProps extends SharedCardProps, CardEventProps {
137
+ // (undocumented)
138
+ readonly contextId?: string;
139
+ // (undocumented)
105
140
  readonly identifier: Identifier;
141
+ // (undocumented)
106
142
  readonly isLazy?: boolean;
107
- readonly useInlinePlayer?: boolean;
108
- readonly shouldOpenMediaViewer?: boolean;
143
+ // (undocumented)
144
+ readonly mediaClient: MediaClient;
145
+ // (undocumented)
109
146
  readonly mediaViewerDataSource?: MediaViewerDataSource;
110
- readonly contextId?: string;
147
+ // (undocumented)
111
148
  readonly shouldEnableDownloadButton?: boolean;
149
+ // (undocumented)
150
+ readonly shouldOpenMediaViewer?: boolean;
151
+ // (undocumented)
112
152
  readonly ssr?: SSR;
153
+ // (undocumented)
154
+ readonly useInlinePlayer?: boolean;
113
155
  }
114
156
 
115
- export declare interface CardState {
116
- status: CardStatus;
117
- isCardVisible: boolean;
118
- shouldAutoplay?: boolean;
119
- isPlayingFile: boolean;
120
- mediaViewerSelectedItem?: Identifier;
121
- fileState?: FileState;
122
- progress?: number;
157
+ // @public (undocumented)
158
+ export interface CardState {
159
+ // (undocumented)
123
160
  cardPreview?: CardPreview;
124
- error?: MediaCardError;
161
+ // (undocumented)
125
162
  cardRef: HTMLDivElement | null;
163
+ // (undocumented)
164
+ error?: MediaCardError;
165
+ // (undocumented)
166
+ fileState?: FileState;
167
+ // (undocumented)
126
168
  isBannedLocalPreview: boolean;
169
+ // (undocumented)
170
+ isCardVisible: boolean;
171
+ // (undocumented)
172
+ isPlayingFile: boolean;
173
+ // (undocumented)
174
+ mediaViewerSelectedItem?: Identifier;
175
+ // (undocumented)
127
176
  previewDidRender: boolean;
177
+ // (undocumented)
178
+ progress?: number;
179
+ // (undocumented)
180
+ shouldAutoplay?: boolean;
181
+ // (undocumented)
182
+ status: CardStatus;
128
183
  }
129
184
 
130
- export declare type CardStatus =
185
+ // @public (undocumented)
186
+ export type CardStatus =
131
187
  | 'uploading'
132
188
  | 'loading'
133
189
  | 'processing'
@@ -136,31 +192,37 @@ export declare type CardStatus =
136
192
  | 'error'
137
193
  | 'failed-processing';
138
194
 
139
- declare type CardWithMediaClientConfigProps = WithMediaClientConfigProps<
140
- CardBaseProps
141
- >;
195
+ // @public (undocumented)
196
+ type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
142
197
 
143
- export declare const defaultImageCardDimensions: {
198
+ // @public (undocumented)
199
+ export const defaultImageCardDimensions: {
144
200
  width: number;
145
201
  height: number;
146
202
  };
147
203
 
148
- declare type ErrorBoundaryComponent = React_2.ComponentType<{
204
+ // @public (undocumented)
205
+ type ErrorBoundaryComponent = React_2.ComponentType<{
149
206
  data?: {
150
207
  [k: string]: any;
151
208
  };
152
209
  }>;
153
210
 
154
- declare interface ErrorCardProps extends StaticCardProps {
211
+ // @public (undocumented)
212
+ interface ErrorCardProps extends StaticCardProps {
213
+ // (undocumented)
155
214
  readonly size: 'small' | 'medium' | 'large' | 'xlarge';
156
215
  }
157
216
 
158
- export declare const fileCardImageViewSelectedSelector =
217
+ // @public (undocumented)
218
+ export const fileCardImageViewSelectedSelector =
159
219
  'media-file-card-view-selected';
160
220
 
161
- export declare const fileCardImageViewSelector = 'media-file-card-view';
221
+ // @public (undocumented)
222
+ export const fileCardImageViewSelector = 'media-file-card-view';
162
223
 
163
- declare type ImageLoadPrimaryReason =
224
+ // @public (undocumented)
225
+ type ImageLoadPrimaryReason =
164
226
  | 'cache-remote-uri'
165
227
  | 'cache-local-uri'
166
228
  | 'local-uri'
@@ -168,29 +230,31 @@ declare type ImageLoadPrimaryReason =
168
230
  | 'external-uri'
169
231
  | 'unknown-uri';
170
232
 
171
- export declare const inlinePlayerClassName = 'media-card-inline-player';
233
+ // @public (undocumented)
234
+ export const inlinePlayerClassName = 'media-card-inline-player';
172
235
 
173
- declare type LocalPreviewPrimaryReason =
236
+ // @public (undocumented)
237
+ type LocalPreviewPrimaryReason =
174
238
  | 'local-preview-get'
175
239
  | 'local-preview-unsupported'
176
240
  | 'local-preview-rejected'
177
241
  | 'local-preview-image'
178
242
  | 'local-preview-video';
179
243
 
180
- declare class MediaCardError extends Error {
181
- readonly primaryReason: MediaCardErrorPrimaryReason;
182
- readonly secondaryError?: Error | undefined;
244
+ // @public (undocumented)
245
+ class MediaCardError extends Error {
183
246
  constructor(
184
247
  primaryReason: MediaCardErrorPrimaryReason,
185
248
  secondaryError?: Error | undefined,
186
249
  );
250
+ // (undocumented)
251
+ readonly primaryReason: MediaCardErrorPrimaryReason;
252
+ // (undocumented)
253
+ readonly secondaryError?: Error | undefined;
187
254
  }
188
255
 
189
- /**
190
- * Primary reason is logged through Data Portal.
191
- * Make sure all the values are whitelisted in Measure -> Event Regitry -> "mediaCardRender failed" event
192
- */
193
- declare type MediaCardErrorPrimaryReason =
256
+ // @public
257
+ type MediaCardErrorPrimaryReason =
194
258
  | 'upload'
195
259
  | 'metadata-fetch'
196
260
  | 'error-file-state'
@@ -201,79 +265,122 @@ declare type MediaCardErrorPrimaryReason =
201
265
  | 'missing-error-data'
202
266
  | 'preview-fetch';
203
267
 
204
- export declare class MediaInlineCard extends React_2.PureComponent<
268
+ // @public (undocumented)
269
+ export class MediaInlineCard extends React_2.PureComponent<
205
270
  MediaInlineCardWithMediaClientConfigProps & MediaInlineCardLoaderState,
206
271
  MediaInlineCardLoaderState
207
272
  > {
273
+ // (undocumented)
274
+ componentDidMount(): Promise<void>;
275
+ // (undocumented)
276
+ componentWillUnmount(): Promise<void>;
277
+ // (undocumented)
208
278
  static displayName: string;
209
- static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
279
+ // (undocumented)
210
280
  static ErrorBoundary?: ErrorBoundaryComponent;
281
+ // (undocumented)
211
282
  isMounted: boolean;
212
- state: MediaInlineCardLoaderState;
213
- componentDidMount(): Promise<void>;
214
- componentWillUnmount(): Promise<void>;
283
+ // (undocumented)
284
+ static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
285
+ // (undocumented)
215
286
  render(): JSX.Element;
287
+ // (undocumented)
288
+ state: MediaInlineCardLoaderState;
216
289
  }
217
290
 
218
- declare interface MediaInlineCardLoaderState {
219
- MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
291
+ // @public (undocumented)
292
+ interface MediaInlineCardLoaderState {
293
+ // (undocumented)
220
294
  ErrorBoundary?: ErrorBoundaryComponent;
295
+ // (undocumented)
296
+ MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
221
297
  }
222
298
 
223
- declare interface MediaInlineCardProps {
299
+ // @public (undocumented)
300
+ interface MediaInlineCardProps {
301
+ // (undocumented)
224
302
  identifier: FileIdentifier;
225
- mediaClient: MediaClient;
226
- shouldOpenMediaViewer?: boolean;
303
+ // (undocumented)
227
304
  isSelected?: boolean;
228
- onClick?: React_2.EventHandler<React_2.MouseEvent | React_2.KeyboardEvent>;
305
+ // (undocumented)
306
+ mediaClient: MediaClient;
307
+ // (undocumented)
229
308
  mediaViewerDataSource?: MediaViewerDataSource;
309
+ // (undocumented)
310
+ onClick?: React_2.EventHandler<React_2.MouseEvent | React_2.KeyboardEvent>;
311
+ // (undocumented)
312
+ shouldOpenMediaViewer?: boolean;
230
313
  }
231
314
 
232
- declare type MediaInlineCardWithMediaClientConfigComponent = React_2.ComponentType<
315
+ // @public (undocumented)
316
+ type MediaInlineCardWithMediaClientConfigComponent = React_2.ComponentType<
233
317
  MediaInlineCardWithMediaClientConfigProps
234
318
  >;
235
319
 
236
- declare type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<
320
+ // @public (undocumented)
321
+ type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<
237
322
  MediaInlineCardProps
238
323
  >;
239
324
 
240
- export declare const newFileExperienceClassName = 'new-file-experience-wrapper';
325
+ // @public (undocumented)
326
+ export const newFileExperienceClassName = 'new-file-experience-wrapper';
241
327
 
242
328
  export { NumericalCardDimensions };
243
329
 
244
- declare type RemotePreviewPrimaryReason =
330
+ // @public (undocumented)
331
+ type RemotePreviewPrimaryReason =
245
332
  | 'remote-preview-fetch'
246
333
  | 'remote-preview-not-ready';
247
334
 
248
- export declare interface SharedCardProps {
249
- readonly disableOverlay?: boolean;
250
- readonly resizeMode?: ImageResizeMode;
251
- readonly featureFlags?: MediaFeatureFlags;
335
+ // @public (undocumented)
336
+ export interface SharedCardProps {
337
+ // (undocumented)
338
+ readonly actions?: Array<CardAction>;
339
+ // (undocumented)
340
+ readonly alt?: string;
341
+ // (undocumented)
252
342
  readonly appearance?: CardAppearance;
343
+ // (undocumented)
253
344
  readonly dimensions?: CardDimensions;
345
+ // (undocumented)
346
+ readonly disableOverlay?: boolean;
347
+ // (undocumented)
348
+ readonly featureFlags?: MediaFeatureFlags;
349
+ // (undocumented)
254
350
  readonly originalDimensions?: NumericalCardDimensions;
255
- readonly actions?: Array<CardAction>;
351
+ // (undocumented)
352
+ readonly resizeMode?: ImageResizeMode;
353
+ // (undocumented)
256
354
  readonly selectable?: boolean;
355
+ // (undocumented)
257
356
  readonly selected?: boolean;
258
- readonly alt?: string;
357
+ // (undocumented)
259
358
  readonly testId?: string;
359
+ // (undocumented)
260
360
  readonly titleBoxBgColor?: string;
361
+ // (undocumented)
261
362
  readonly titleBoxIcon?: TitleBoxIcon;
262
363
  }
263
364
 
264
- declare type SsrPreviewPrimaryReason =
365
+ // @public (undocumented)
366
+ type SsrPreviewPrimaryReason =
265
367
  | 'ssr-client-uri'
266
368
  | 'ssr-client-load'
267
369
  | 'ssr-server-uri'
268
370
  | 'ssr-server-load';
269
371
 
270
- declare interface StaticCardProps {
372
+ // @public (undocumented)
373
+ interface StaticCardProps {
374
+ // (undocumented)
271
375
  dimensions?: CardDimensions;
272
- testId?: string;
376
+ // (undocumented)
273
377
  featureFlags?: MediaFeatureFlags;
378
+ // (undocumented)
379
+ testId?: string;
274
380
  }
275
381
 
276
- export declare type TitleBoxIcon = 'LockFilledIcon';
382
+ // @public (undocumented)
383
+ export type TitleBoxIcon = 'LockFilledIcon';
277
384
 
278
- export {};
385
+ // (No @packageDocumentation comment for this package)
279
386
  ```