@atlaskit/media-card 74.1.8 → 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.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/card/card.js +11 -6
- package/dist/cjs/card/cardAnalytics.js +6 -5
- package/dist/cjs/card/getCardPreview/helpers.js +3 -3
- package/dist/cjs/card/getCardPreview/index.js +6 -6
- package/dist/cjs/utils/analytics.js +14 -8
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/videoSnapshot.js +36 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +13 -6
- package/dist/es2019/card/cardAnalytics.js +6 -6
- package/dist/es2019/card/getCardPreview/helpers.js +2 -2
- package/dist/es2019/card/getCardPreview/index.js +5 -4
- package/dist/es2019/utils/analytics.js +14 -8
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/utils/videoSnapshot.js +36 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +13 -6
- package/dist/esm/card/cardAnalytics.js +6 -5
- package/dist/esm/card/getCardPreview/helpers.js +3 -3
- package/dist/esm/card/getCardPreview/index.js +6 -6
- package/dist/esm/utils/analytics.js +14 -8
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/videoSnapshot.js +36 -10
- package/dist/esm/version.json +1 -1
- package/dist/types/card/card.d.ts +1 -0
- package/dist/types/card/cardAnalytics.d.ts +3 -3
- package/dist/types/card/getCardPreview/helpers.d.ts +1 -1
- package/dist/types/card/getCardPreview/index.d.ts +3 -2
- package/dist/types/utils/analytics.d.ts +8 -8
- package/dist/types-ts4.0/card/card.d.ts +1 -0
- package/dist/types-ts4.0/card/cardAnalytics.d.ts +3 -3
- package/dist/types-ts4.0/card/getCardPreview/helpers.d.ts +1 -1
- package/dist/types-ts4.0/card/getCardPreview/index.d.ts +3 -2
- package/dist/types-ts4.0/utils/analytics.d.ts +8 -8
- package/package.json +9 -11
- package/report.api.md +192 -85
- package/dist/cjs/__tests_external__/index.js +0 -13
- package/dist/cjs/__tests_external__/page-objects/MediaCard.js +0 -67
- package/dist/cjs/in-product.js +0 -13
- package/dist/es2019/__tests_external__/index.js +0 -1
- package/dist/es2019/__tests_external__/page-objects/MediaCard.js +0 -23
- package/dist/es2019/in-product.js +0 -5
- package/dist/esm/__tests_external__/index.js +0 -1
- package/dist/esm/__tests_external__/page-objects/MediaCard.js +0 -53
- package/dist/esm/in-product.js +0 -5
- package/dist/types/__tests_external__/index.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/MediaCard.d.ts +0 -8
- package/dist/types/in-product.d.ts +0 -5
- package/dist/types-ts4.0/__tests_external__/index.d.ts +0 -1
- package/dist/types-ts4.0/__tests_external__/page-objects/MediaCard.d.ts +0 -8
- package/dist/types-ts4.0/in-product.d.ts +0 -5
- package/in-product/package.json +0 -15
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.
|
|
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
|
-
|
|
34
|
+
// @public (undocumented)
|
|
35
|
+
export const Card: React_2.FC<CardWithMediaClientConfigProps>;
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
47
|
+
// @public (undocumented)
|
|
48
|
+
export type CardAppearance = 'auto' | 'image' | 'square' | 'horizontal';
|
|
39
49
|
|
|
40
|
-
|
|
50
|
+
// @public (undocumented)
|
|
51
|
+
type CardBaseProps = CardProps &
|
|
41
52
|
WithAnalyticsEventsProps &
|
|
42
53
|
Partial<WrappedComponentProps>;
|
|
43
54
|
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
// @public (undocumented)
|
|
56
|
+
export interface CardDimensions {
|
|
57
|
+
// (undocumented)
|
|
46
58
|
height?: CardDimensionValue;
|
|
59
|
+
// (undocumented)
|
|
60
|
+
width?: CardDimensionValue;
|
|
47
61
|
}
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export type CardDimensionValue = number | string;
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
// @public (undocumented)
|
|
67
|
+
export class CardError extends Component<ErrorCardProps, {}> {
|
|
68
|
+
// (undocumented)
|
|
52
69
|
static defaultProps: {
|
|
53
70
|
size: string;
|
|
54
71
|
};
|
|
55
|
-
|
|
72
|
+
// (undocumented)
|
|
56
73
|
get icon(): JSX.Element;
|
|
74
|
+
// (undocumented)
|
|
75
|
+
render(): JSX.Element;
|
|
57
76
|
}
|
|
58
77
|
|
|
59
|
-
|
|
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
|
-
|
|
86
|
+
// @public (undocumented)
|
|
87
|
+
export type CardEventHandler = (item?: FileItem, event?: Event) => void;
|
|
65
88
|
|
|
66
|
-
|
|
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
|
-
|
|
98
|
+
// @public (undocumented)
|
|
99
|
+
export class CardLoading extends Component<StaticCardProps, {}> {
|
|
100
|
+
// (undocumented)
|
|
77
101
|
render(): JSX.Element;
|
|
78
102
|
}
|
|
79
103
|
|
|
80
|
-
|
|
104
|
+
// @public (undocumented)
|
|
105
|
+
export interface CardOnClickCallback {
|
|
106
|
+
// (undocumented)
|
|
81
107
|
(result: CardEvent, analyticsEvent?: UIAnalyticsEvent): void;
|
|
82
108
|
}
|
|
83
109
|
|
|
84
|
-
|
|
110
|
+
// @public (undocumented)
|
|
111
|
+
export interface CardPreview {
|
|
112
|
+
// (undocumented)
|
|
85
113
|
dataURI: string;
|
|
86
|
-
|
|
114
|
+
// (undocumented)
|
|
87
115
|
dimensions?: CardDimensions;
|
|
116
|
+
// (undocumented)
|
|
117
|
+
orientation?: number;
|
|
118
|
+
// (undocumented)
|
|
88
119
|
source: CardPreviewSource;
|
|
89
120
|
}
|
|
90
121
|
|
|
91
|
-
|
|
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
|
-
|
|
104
|
-
|
|
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
|
-
|
|
108
|
-
readonly
|
|
143
|
+
// (undocumented)
|
|
144
|
+
readonly mediaClient: MediaClient;
|
|
145
|
+
// (undocumented)
|
|
109
146
|
readonly mediaViewerDataSource?: MediaViewerDataSource;
|
|
110
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
>;
|
|
195
|
+
// @public (undocumented)
|
|
196
|
+
type CardWithMediaClientConfigProps = WithMediaClientConfigProps<CardBaseProps>;
|
|
142
197
|
|
|
143
|
-
|
|
198
|
+
// @public (undocumented)
|
|
199
|
+
export const defaultImageCardDimensions: {
|
|
144
200
|
width: number;
|
|
145
201
|
height: number;
|
|
146
202
|
};
|
|
147
203
|
|
|
148
|
-
|
|
204
|
+
// @public (undocumented)
|
|
205
|
+
type ErrorBoundaryComponent = React_2.ComponentType<{
|
|
149
206
|
data?: {
|
|
150
207
|
[k: string]: any;
|
|
151
208
|
};
|
|
152
209
|
}>;
|
|
153
210
|
|
|
154
|
-
|
|
211
|
+
// @public (undocumented)
|
|
212
|
+
interface ErrorCardProps extends StaticCardProps {
|
|
213
|
+
// (undocumented)
|
|
155
214
|
readonly size: 'small' | 'medium' | 'large' | 'xlarge';
|
|
156
215
|
}
|
|
157
216
|
|
|
158
|
-
|
|
217
|
+
// @public (undocumented)
|
|
218
|
+
export const fileCardImageViewSelectedSelector =
|
|
159
219
|
'media-file-card-view-selected';
|
|
160
220
|
|
|
161
|
-
|
|
221
|
+
// @public (undocumented)
|
|
222
|
+
export const fileCardImageViewSelector = 'media-file-card-view';
|
|
162
223
|
|
|
163
|
-
|
|
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
|
-
|
|
233
|
+
// @public (undocumented)
|
|
234
|
+
export const inlinePlayerClassName = 'media-card-inline-player';
|
|
172
235
|
|
|
173
|
-
|
|
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
|
-
|
|
181
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
279
|
+
// (undocumented)
|
|
210
280
|
static ErrorBoundary?: ErrorBoundaryComponent;
|
|
281
|
+
// (undocumented)
|
|
211
282
|
isMounted: boolean;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
283
|
+
// (undocumented)
|
|
284
|
+
static MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
285
|
+
// (undocumented)
|
|
215
286
|
render(): JSX.Element;
|
|
287
|
+
// (undocumented)
|
|
288
|
+
state: MediaInlineCardLoaderState;
|
|
216
289
|
}
|
|
217
290
|
|
|
218
|
-
|
|
219
|
-
|
|
291
|
+
// @public (undocumented)
|
|
292
|
+
interface MediaInlineCardLoaderState {
|
|
293
|
+
// (undocumented)
|
|
220
294
|
ErrorBoundary?: ErrorBoundaryComponent;
|
|
295
|
+
// (undocumented)
|
|
296
|
+
MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
|
|
221
297
|
}
|
|
222
298
|
|
|
223
|
-
|
|
299
|
+
// @public (undocumented)
|
|
300
|
+
interface MediaInlineCardProps {
|
|
301
|
+
// (undocumented)
|
|
224
302
|
identifier: FileIdentifier;
|
|
225
|
-
|
|
226
|
-
shouldOpenMediaViewer?: boolean;
|
|
303
|
+
// (undocumented)
|
|
227
304
|
isSelected?: boolean;
|
|
228
|
-
|
|
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
|
-
|
|
315
|
+
// @public (undocumented)
|
|
316
|
+
type MediaInlineCardWithMediaClientConfigComponent = React_2.ComponentType<
|
|
233
317
|
MediaInlineCardWithMediaClientConfigProps
|
|
234
318
|
>;
|
|
235
319
|
|
|
236
|
-
|
|
320
|
+
// @public (undocumented)
|
|
321
|
+
type MediaInlineCardWithMediaClientConfigProps = WithMediaClientConfigProps<
|
|
237
322
|
MediaInlineCardProps
|
|
238
323
|
>;
|
|
239
324
|
|
|
240
|
-
|
|
325
|
+
// @public (undocumented)
|
|
326
|
+
export const newFileExperienceClassName = 'new-file-experience-wrapper';
|
|
241
327
|
|
|
242
328
|
export { NumericalCardDimensions };
|
|
243
329
|
|
|
244
|
-
|
|
330
|
+
// @public (undocumented)
|
|
331
|
+
type RemotePreviewPrimaryReason =
|
|
245
332
|
| 'remote-preview-fetch'
|
|
246
333
|
| 'remote-preview-not-ready';
|
|
247
334
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
readonly
|
|
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
|
-
|
|
351
|
+
// (undocumented)
|
|
352
|
+
readonly resizeMode?: ImageResizeMode;
|
|
353
|
+
// (undocumented)
|
|
256
354
|
readonly selectable?: boolean;
|
|
355
|
+
// (undocumented)
|
|
257
356
|
readonly selected?: boolean;
|
|
258
|
-
|
|
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
|
-
|
|
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
|
-
|
|
372
|
+
// @public (undocumented)
|
|
373
|
+
interface StaticCardProps {
|
|
374
|
+
// (undocumented)
|
|
271
375
|
dimensions?: CardDimensions;
|
|
272
|
-
|
|
376
|
+
// (undocumented)
|
|
273
377
|
featureFlags?: MediaFeatureFlags;
|
|
378
|
+
// (undocumented)
|
|
379
|
+
testId?: string;
|
|
274
380
|
}
|
|
275
381
|
|
|
276
|
-
|
|
382
|
+
// @public (undocumented)
|
|
383
|
+
export type TitleBoxIcon = 'LockFilledIcon';
|
|
277
384
|
|
|
278
|
-
|
|
385
|
+
// (No @packageDocumentation comment for this package)
|
|
279
386
|
```
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "MediaCardPageObject", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _MediaCard.MediaCardPageObject;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _MediaCard = require("./page-objects/MediaCard");
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.MediaCardPageObject = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
|
|
16
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
-
|
|
18
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
-
|
|
20
|
-
var _inProductTesting = require("@atlaskit/in-product-testing");
|
|
21
|
-
|
|
22
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
|
-
|
|
24
|
-
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; } }
|
|
25
|
-
|
|
26
|
-
var MediaCardPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
27
|
-
(0, _inherits2.default)(MediaCardPageObject, _InProductTestPageObj);
|
|
28
|
-
|
|
29
|
-
var _super = _createSuper(MediaCardPageObject);
|
|
30
|
-
|
|
31
|
-
function MediaCardPageObject() {
|
|
32
|
-
(0, _classCallCheck2.default)(this, MediaCardPageObject);
|
|
33
|
-
return _super.apply(this, arguments);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
(0, _createClass2.default)(MediaCardPageObject, [{
|
|
37
|
-
key: "expectCardReady",
|
|
38
|
-
value: function expectCardReady(numOfCards) {
|
|
39
|
-
var _this = this;
|
|
40
|
-
|
|
41
|
-
return this.cy.get('[data-test-media-name]').should('have.length', numOfCards).each(function (element) {
|
|
42
|
-
_this.cy.wrap(element) // NOTE: `be.visible` is used to ensure the file is still visible
|
|
43
|
-
// whilst it is being uploaded.
|
|
44
|
-
.should('be.visible').should('have.attr', 'data-test-status', 'complete');
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
key: "findCardNth",
|
|
49
|
-
value: function findCardNth(nth) {
|
|
50
|
-
return this.cy.get('[data-test-media-name][data-test-status="complete"]').should('have.length.at.least', nth).should('be.visible').eq(nth - 1);
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
key: "findImage",
|
|
54
|
-
value: function findImage(nth) {
|
|
55
|
-
return this.cy.get(this.toTestId('media-image')).should('have.length.at.least', nth).should('be.visible').eq(nth - 1);
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "assertAltText",
|
|
59
|
-
value: function assertAltText(altText) {
|
|
60
|
-
var nth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
61
|
-
return this.findImage(nth).should('have.attr', 'alt', altText);
|
|
62
|
-
}
|
|
63
|
-
}]);
|
|
64
|
-
return MediaCardPageObject;
|
|
65
|
-
}(_inProductTesting.InProductTestPageObject);
|
|
66
|
-
|
|
67
|
-
exports.MediaCardPageObject = MediaCardPageObject;
|
package/dist/cjs/in-product.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "MediaCardPageObject", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _tests_external__.MediaCardPageObject;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _tests_external__ = require("./__tests_external__");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MediaCardPageObject } from './page-objects/MediaCard';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
2
|
-
export class MediaCardPageObject extends InProductTestPageObject {
|
|
3
|
-
expectCardReady(numOfCards) {
|
|
4
|
-
return this.cy.get('[data-test-media-name]').should('have.length', numOfCards).each(element => {
|
|
5
|
-
this.cy.wrap(element) // NOTE: `be.visible` is used to ensure the file is still visible
|
|
6
|
-
// whilst it is being uploaded.
|
|
7
|
-
.should('be.visible').should('have.attr', 'data-test-status', 'complete');
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
findCardNth(nth) {
|
|
12
|
-
return this.cy.get('[data-test-media-name][data-test-status="complete"]').should('have.length.at.least', nth).should('be.visible').eq(nth - 1);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
findImage(nth) {
|
|
16
|
-
return this.cy.get(this.toTestId('media-image')).should('have.length.at.least', nth).should('be.visible').eq(nth - 1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
assertAltText(altText, nth = 1) {
|
|
20
|
-
return this.findImage(nth).should('have.attr', 'alt', altText);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MediaCardPageObject } from './page-objects/MediaCard';
|
|
@@ -1,53 +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 { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
12
|
-
export var MediaCardPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
13
|
-
_inherits(MediaCardPageObject, _InProductTestPageObj);
|
|
14
|
-
|
|
15
|
-
var _super = _createSuper(MediaCardPageObject);
|
|
16
|
-
|
|
17
|
-
function MediaCardPageObject() {
|
|
18
|
-
_classCallCheck(this, MediaCardPageObject);
|
|
19
|
-
|
|
20
|
-
return _super.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
_createClass(MediaCardPageObject, [{
|
|
24
|
-
key: "expectCardReady",
|
|
25
|
-
value: function expectCardReady(numOfCards) {
|
|
26
|
-
var _this = this;
|
|
27
|
-
|
|
28
|
-
return this.cy.get('[data-test-media-name]').should('have.length', numOfCards).each(function (element) {
|
|
29
|
-
_this.cy.wrap(element) // NOTE: `be.visible` is used to ensure the file is still visible
|
|
30
|
-
// whilst it is being uploaded.
|
|
31
|
-
.should('be.visible').should('have.attr', 'data-test-status', 'complete');
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
key: "findCardNth",
|
|
36
|
-
value: function findCardNth(nth) {
|
|
37
|
-
return this.cy.get('[data-test-media-name][data-test-status="complete"]').should('have.length.at.least', nth).should('be.visible').eq(nth - 1);
|
|
38
|
-
}
|
|
39
|
-
}, {
|
|
40
|
-
key: "findImage",
|
|
41
|
-
value: function findImage(nth) {
|
|
42
|
-
return this.cy.get(this.toTestId('media-image')).should('have.length.at.least', nth).should('be.visible').eq(nth - 1);
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
key: "assertAltText",
|
|
46
|
-
value: function assertAltText(altText) {
|
|
47
|
-
var nth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
48
|
-
return this.findImage(nth).should('have.attr', 'alt', altText);
|
|
49
|
-
}
|
|
50
|
-
}]);
|
|
51
|
-
|
|
52
|
-
return MediaCardPageObject;
|
|
53
|
-
}(InProductTestPageObject);
|
package/dist/esm/in-product.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MediaCardPageObject } from './page-objects/MediaCard';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
3
|
-
export declare class MediaCardPageObject extends InProductTestPageObject {
|
|
4
|
-
expectCardReady(numOfCards: number): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
5
|
-
findCardNth(nth: number): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
6
|
-
findImage(nth: number): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
7
|
-
assertAltText(altText: string, nth?: number): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MediaCardPageObject } from './page-objects/MediaCard';
|