@atlaskit/media-common 11.2.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +333 -319
- package/dist/cjs/analytics/types.js +3 -1
- package/dist/cjs/mediaFeatureFlags/mediaFeatureFlags.js +2 -1
- package/dist/cjs/mediaFeatureFlags/productKeys.js +4 -2
- package/dist/es2019/analytics/types.js +1 -19
- package/dist/es2019/mediaFeatureFlags/mediaFeatureFlags.js +2 -1
- package/dist/es2019/mediaFeatureFlags/productKeys.js +4 -2
- package/dist/esm/analytics/types.js +1 -19
- package/dist/esm/mediaFeatureFlags/mediaFeatureFlags.js +2 -1
- package/dist/esm/mediaFeatureFlags/productKeys.js +4 -2
- package/dist/types/analytics/types.d.ts +6 -3
- package/dist/types/analytics/withMediaAnalyticsContext.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/mediaFeatureFlags/index.d.ts +1 -1
- package/dist/types/mediaFeatureFlags/types.d.ts +1 -0
- package/dist/types/mediaTypeUtils/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types.d.ts +6 -3
- package/dist/types-ts4.5/analytics/withMediaAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/mediaFeatureFlags/index.d.ts +1 -1
- package/dist/types-ts4.5/mediaFeatureFlags/types.d.ts +1 -0
- package/dist/types-ts4.5/mediaTypeUtils/index.d.ts +1 -1
- package/package.json +68 -69
- package/report.api.md +103 -133
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/media-common"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -25,11 +26,8 @@ export const ANALYTICS_MEDIA_CHANNEL = 'media';
|
|
|
25
26
|
type BaseAttributes = {};
|
|
26
27
|
|
|
27
28
|
// @public (undocumented)
|
|
28
|
-
type BaseEventPayload<Attributes extends BaseAttributes> = Omit<
|
|
29
|
-
|
|
30
|
-
'attributes'
|
|
31
|
-
> & {
|
|
32
|
-
attributes: Attributes;
|
|
29
|
+
type BaseEventPayload<Attributes extends BaseAttributes> = Omit<GasCorePayload, 'attributes'> & {
|
|
30
|
+
attributes: Attributes;
|
|
33
31
|
};
|
|
34
32
|
|
|
35
33
|
// @public (undocumented)
|
|
@@ -39,10 +37,7 @@ export type ContextPublicAttributes = PackageAttributes;
|
|
|
39
37
|
export type ContextStaticProps = WithMediaFeatureFlags;
|
|
40
38
|
|
|
41
39
|
// @public (undocumented)
|
|
42
|
-
export const debounce: (
|
|
43
|
-
func: Function,
|
|
44
|
-
wait: number,
|
|
45
|
-
) => (...args: any[]) => void;
|
|
40
|
+
export const debounce: (func: Function, wait: number) => (...args: any[]) => void;
|
|
46
41
|
|
|
47
42
|
// @public
|
|
48
43
|
export const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
|
|
@@ -52,39 +47,34 @@ export const downloadUrl: (url: string, options?: DownloadUrlOptions) => void;
|
|
|
52
47
|
|
|
53
48
|
// @public (undocumented)
|
|
54
49
|
interface DownloadUrlOptions {
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
// (undocumented)
|
|
51
|
+
name?: string;
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
// @public (undocumented)
|
|
60
55
|
export type FailureAttributes = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
status: 'fail';
|
|
57
|
+
failReason: string;
|
|
58
|
+
error?: string;
|
|
59
|
+
errorDetail?: string;
|
|
65
60
|
};
|
|
66
61
|
|
|
67
62
|
// @public (undocumented)
|
|
68
63
|
export type FileAttributes = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
fileId: string;
|
|
65
|
+
fileSize?: number;
|
|
66
|
+
fileMediatype?: MediaType;
|
|
67
|
+
fileMimetype?: string;
|
|
68
|
+
fileSource?: string;
|
|
69
|
+
fileStatus?: FileStatus;
|
|
75
70
|
};
|
|
76
71
|
|
|
77
72
|
// @public (undocumented)
|
|
78
|
-
export type FileStatus =
|
|
79
|
-
| 'error'
|
|
80
|
-
| 'failed-processing'
|
|
81
|
-
| 'processed'
|
|
82
|
-
| 'processing'
|
|
83
|
-
| 'uploading';
|
|
73
|
+
export type FileStatus = 'error' | 'failed-processing' | 'processed' | 'processing' | 'uploading';
|
|
84
74
|
|
|
85
75
|
// @public (undocumented)
|
|
86
76
|
export const filterFeatureFlagNames: (
|
|
87
|
-
|
|
77
|
+
flags: RequiredMediaFeatureFlags,
|
|
88
78
|
) => Array<keyof MediaFeatureFlags>;
|
|
89
79
|
|
|
90
80
|
// @public
|
|
@@ -92,8 +82,8 @@ export const getFeatureFlagKeysAllProducts: () => Array<string>;
|
|
|
92
82
|
|
|
93
83
|
// @public
|
|
94
84
|
export function getMediaFeatureFlag<T = boolean>(
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
flagName: keyof MediaFeatureFlags,
|
|
86
|
+
featureFlags?: MediaFeatureFlags,
|
|
97
87
|
): T;
|
|
98
88
|
|
|
99
89
|
// @public (undocumented)
|
|
@@ -106,9 +96,7 @@ export function getRandomHex(byte: number): string;
|
|
|
106
96
|
export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
107
97
|
|
|
108
98
|
// @public (undocumented)
|
|
109
|
-
export const isDocumentMimeTypeSupportedByBrowser: (
|
|
110
|
-
mimeType: string,
|
|
111
|
-
) => boolean;
|
|
99
|
+
export const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
112
100
|
|
|
113
101
|
// @public (undocumented)
|
|
114
102
|
export const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
@@ -142,110 +130,99 @@ export const matches: (srcObj: Object) => (obj: Object) => boolean;
|
|
|
142
130
|
|
|
143
131
|
// @public (undocumented)
|
|
144
132
|
export interface MediaFeatureFlags {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
// (undocumented)
|
|
134
|
+
folderUploads?: boolean;
|
|
135
|
+
// (undocumented)
|
|
136
|
+
mediaInline?: boolean;
|
|
149
137
|
}
|
|
150
138
|
|
|
151
139
|
// @public (undocumented)
|
|
152
140
|
export type MediaTraceContext = {
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
traceId: string;
|
|
142
|
+
spanId?: string;
|
|
155
143
|
};
|
|
156
144
|
|
|
157
145
|
// @public (undocumented)
|
|
158
|
-
export type MediaType =
|
|
159
|
-
| 'archive'
|
|
160
|
-
| 'audio'
|
|
161
|
-
| 'doc'
|
|
162
|
-
| 'image'
|
|
163
|
-
| 'unknown'
|
|
164
|
-
| 'video';
|
|
146
|
+
export type MediaType = 'archive' | 'audio' | 'doc' | 'image' | 'unknown' | 'video';
|
|
165
147
|
|
|
166
148
|
// @public (undocumented)
|
|
167
149
|
export interface NumericalCardDimensions {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
150
|
+
// (undocumented)
|
|
151
|
+
height: number;
|
|
152
|
+
// (undocumented)
|
|
153
|
+
width: number;
|
|
172
154
|
}
|
|
173
155
|
|
|
174
156
|
// @public (undocumented)
|
|
175
157
|
export const omitBy: (
|
|
176
|
-
|
|
177
|
-
|
|
158
|
+
obj: Object,
|
|
159
|
+
predicate: Function,
|
|
178
160
|
) => {
|
|
179
|
-
|
|
161
|
+
[k: string]: any;
|
|
180
162
|
};
|
|
181
163
|
|
|
182
164
|
// @public (undocumented)
|
|
183
165
|
export type OperationalAttributes =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
166
|
+
| (BaseAttributes &
|
|
167
|
+
WithFileAttributes &
|
|
168
|
+
StatusAttributes &
|
|
169
|
+
WithPerformanceAttributes &
|
|
170
|
+
WithTraceContext)
|
|
171
|
+
| (BaseAttributes & WithFileAttributes & StatusAttributes)
|
|
172
|
+
| (BaseAttributes & WithFileAttributes)
|
|
173
|
+
| BaseAttributes;
|
|
192
174
|
|
|
193
175
|
// @public (undocumented)
|
|
194
176
|
export type OperationalEventPayload<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
177
|
+
Attributes extends OperationalAttributes,
|
|
178
|
+
Action extends string,
|
|
179
|
+
ActionSubject extends string,
|
|
180
|
+
ActionSubjectId extends string = string,
|
|
199
181
|
> = BaseEventPayload<Attributes> & {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
182
|
+
eventType: 'operational';
|
|
183
|
+
action: Action;
|
|
184
|
+
actionSubject: ActionSubject;
|
|
185
|
+
actionSubjectId?: ActionSubjectId;
|
|
204
186
|
};
|
|
205
187
|
|
|
206
188
|
// @public (undocumented)
|
|
207
189
|
export type PackageAttributes = {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
190
|
+
packageName: string;
|
|
191
|
+
packageVersion: string;
|
|
192
|
+
componentName: string;
|
|
193
|
+
component: string;
|
|
212
194
|
};
|
|
213
195
|
|
|
214
196
|
// @public (undocumented)
|
|
215
197
|
export type PerformanceAttributes = {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
198
|
+
overall: {
|
|
199
|
+
durationSincePageStart: number;
|
|
200
|
+
durationSinceCommenced?: number;
|
|
201
|
+
};
|
|
220
202
|
};
|
|
221
203
|
|
|
222
204
|
// @public (undocumented)
|
|
223
205
|
export const pick: (
|
|
224
|
-
|
|
225
|
-
|
|
206
|
+
obj?: Object,
|
|
207
|
+
keys?: Array<String>,
|
|
226
208
|
) => {
|
|
227
|
-
|
|
209
|
+
[k: string]: any;
|
|
228
210
|
};
|
|
229
211
|
|
|
230
212
|
// @public (undocumented)
|
|
231
|
-
type RequiredMediaFeatureFlags = Record<
|
|
232
|
-
keyof Required<MediaFeatureFlags>,
|
|
233
|
-
boolean
|
|
234
|
-
>;
|
|
213
|
+
type RequiredMediaFeatureFlags = Record<keyof Required<MediaFeatureFlags>, boolean>;
|
|
235
214
|
|
|
236
215
|
// @public (undocumented)
|
|
237
|
-
export type ScreenAttributes =
|
|
238
|
-
| (BaseAttributes & WithFileAttributes)
|
|
239
|
-
| BaseAttributes;
|
|
216
|
+
export type ScreenAttributes = (BaseAttributes & WithFileAttributes) | BaseAttributes;
|
|
240
217
|
|
|
241
218
|
// @public (undocumented)
|
|
242
219
|
export type ScreenEventPayload<
|
|
243
|
-
|
|
244
|
-
|
|
220
|
+
Attributes extends ScreenAttributes,
|
|
221
|
+
ActionSubject extends string,
|
|
245
222
|
> = BaseEventPayload<Attributes> & {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
223
|
+
eventType: 'screen';
|
|
224
|
+
actionSubject: ActionSubject;
|
|
225
|
+
name: ActionSubject;
|
|
249
226
|
};
|
|
250
227
|
|
|
251
228
|
// @public (undocumented)
|
|
@@ -256,78 +233,71 @@ type StatusAttributes = FailureAttributes | SuccessAttributes;
|
|
|
256
233
|
|
|
257
234
|
// @public (undocumented)
|
|
258
235
|
export type SuccessAttributes = {
|
|
259
|
-
|
|
260
|
-
|
|
236
|
+
status: 'success';
|
|
237
|
+
fileMediatype?: MediaType;
|
|
261
238
|
};
|
|
262
239
|
|
|
263
240
|
// @public (undocumented)
|
|
264
|
-
export type TrackAttributes =
|
|
265
|
-
| (BaseAttributes & WithFileAttributes)
|
|
266
|
-
| BaseAttributes;
|
|
241
|
+
export type TrackAttributes = (BaseAttributes & WithFileAttributes) | BaseAttributes;
|
|
267
242
|
|
|
268
243
|
// @public (undocumented)
|
|
269
244
|
export type TrackEventPayload<
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
245
|
+
Attributes extends TrackAttributes,
|
|
246
|
+
Action extends string,
|
|
247
|
+
ActionSubject extends string,
|
|
248
|
+
ActionSubjectId extends string = string,
|
|
274
249
|
> = BaseEventPayload<Attributes> & {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
250
|
+
eventType: 'track';
|
|
251
|
+
action: Action;
|
|
252
|
+
actionSubject: ActionSubject;
|
|
253
|
+
actionSubjectId?: ActionSubjectId;
|
|
279
254
|
};
|
|
280
255
|
|
|
281
256
|
// @public (undocumented)
|
|
282
|
-
export type UIAttributes =
|
|
283
|
-
| (BaseAttributes & WithFileAttributes)
|
|
284
|
-
| BaseAttributes;
|
|
257
|
+
export type UIAttributes = (BaseAttributes & WithFileAttributes) | BaseAttributes;
|
|
285
258
|
|
|
286
259
|
// @public (undocumented)
|
|
287
260
|
export type UIEventPayload<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
261
|
+
Attributes extends UIAttributes,
|
|
262
|
+
Action extends string,
|
|
263
|
+
ActionSubject extends string,
|
|
291
264
|
> = BaseEventPayload<Attributes> & {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
265
|
+
eventType: 'ui';
|
|
266
|
+
action: Action;
|
|
267
|
+
actionSubject: ActionSubject;
|
|
268
|
+
actionSubjectId?: string;
|
|
296
269
|
};
|
|
297
270
|
|
|
298
271
|
// @public (undocumented)
|
|
299
272
|
export type WithFileAttributes = {
|
|
300
|
-
|
|
273
|
+
fileAttributes: FileAttributes;
|
|
301
274
|
};
|
|
302
275
|
|
|
303
276
|
// @public
|
|
304
277
|
export const withMediaAnalyticsContext: (
|
|
305
|
-
|
|
306
|
-
) => <
|
|
307
|
-
|
|
308
|
-
Component extends React_2.ComponentType<Props>,
|
|
309
|
-
>(
|
|
310
|
-
WrappedComponent: React_2.JSXElementConstructor<Props> & Component,
|
|
278
|
+
contextPublicAttributes: ContextPublicAttributes,
|
|
279
|
+
) => <Props extends WithMediaFeatureFlags, Component extends React_2.ComponentType<Props>>(
|
|
280
|
+
WrappedComponent: React_2.JSXElementConstructor<Props> & Component,
|
|
311
281
|
) => React_2.ForwardRefExoticComponent<
|
|
312
|
-
|
|
313
|
-
|
|
282
|
+
React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props>> &
|
|
283
|
+
React_2.RefAttributes<any>
|
|
314
284
|
>;
|
|
315
285
|
|
|
316
286
|
// @public (undocumented)
|
|
317
287
|
export interface WithMediaFeatureFlags {
|
|
318
|
-
|
|
319
|
-
|
|
288
|
+
// (undocumented)
|
|
289
|
+
featureFlags?: MediaFeatureFlags;
|
|
320
290
|
}
|
|
321
291
|
|
|
322
292
|
// @public (undocumented)
|
|
323
293
|
export type WithPerformanceAttributes = {
|
|
324
|
-
|
|
294
|
+
performanceAttributes?: PerformanceAttributes;
|
|
325
295
|
};
|
|
326
296
|
|
|
327
297
|
// @public (undocumented)
|
|
328
298
|
export type WithTraceContext = {
|
|
329
|
-
|
|
330
|
-
|
|
299
|
+
traceContext?: MediaTraceContext;
|
|
300
|
+
metadataTraceContext?: MediaTraceContext;
|
|
331
301
|
};
|
|
332
302
|
|
|
333
303
|
// (No @packageDocumentation comment for this package)
|
|
@@ -341,9 +311,9 @@ export type WithTraceContext = {
|
|
|
341
311
|
|
|
342
312
|
```json
|
|
343
313
|
{
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
314
|
+
"enzyme": ">=3.10.0",
|
|
315
|
+
"react": "^16.8.0",
|
|
316
|
+
"react-dom": "^16.8.0"
|
|
347
317
|
}
|
|
348
318
|
```
|
|
349
319
|
|