@atlaskit/media-common 5.0.0 → 7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/media-common
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`5dcaf51b269`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5dcaf51b269) - Removed memoryCacheLogging feature flag
8
+
9
+ ## 6.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [`a425ccdeb0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a425ccdeb0c) - Remove 'newCardExperience' feature flag
14
+
3
15
  ## 5.0.0
4
16
 
5
17
  ### Major Changes
@@ -21,13 +21,11 @@ var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
21
21
  return false;
22
22
  }
23
23
  var results = {
24
- newCardExperience: ffA.newCardExperience === ffB.newCardExperience,
25
24
  captions: ffA.captions === ffB.captions,
26
25
  mediaInline: ffA.mediaInline === ffB.mediaInline,
27
26
  folderUploads: ffA.folderUploads === ffB.folderUploads,
28
27
  observedWidth: ffA.observedWidth === ffB.observedWidth,
29
- timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
30
- memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging
28
+ timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo
31
29
  };
32
30
  return Object.values(results).every(function (result) {
33
31
  return result;
@@ -78,15 +76,13 @@ var getFeatureFlagKeysAllProducts = function getFeatureFlagKeysAllProducts() {
78
76
  */
79
77
  exports.getFeatureFlagKeysAllProducts = getFeatureFlagKeysAllProducts;
80
78
  var defaultMediaFeatureFlags = {
81
- newCardExperience: false,
82
79
  captions: false,
83
80
  mediaInline: false,
84
81
  // We can't yet switch this feature on
85
82
  // TODO https://product-fabric.atlassian.net/browse/MEX-104
86
83
  folderUploads: false,
87
84
  observedWidth: false,
88
- timestampOnVideo: false,
89
- memoryCacheLogging: false
85
+ timestampOnVideo: false
90
86
  };
91
87
 
92
88
  /**
@@ -9,25 +9,21 @@ var productKeys = {
9
9
  /**
10
10
  * Note: Confluence Flags must be prefixed with "confluence.frontend" in order to integrate properly with the product
11
11
  */
12
- newCardExperience: 'confluence.frontend.media.cards.new.experience',
13
12
  captions: 'confluence.frontend.fabric.editor.media.captions',
14
13
  mediaInline: 'confluence.frontend.fabric.editor.media.inline',
15
14
  folderUploads: 'confluence.frontend.media.picker.folder.uploads',
16
15
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
17
16
  observedWidth: '',
18
- timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
19
- memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging'
17
+ timestampOnVideo: 'confluence.frontend.media.timestamp.on.video'
20
18
  },
21
19
  jira: {
22
- newCardExperience: 'issue.details.media-cards-new-experience',
23
20
  captions: 'issue.details.editor.media.captions',
24
21
  // Manged by Linking Platform. No Rollout plan found for Jira
25
22
  mediaInline: '',
26
23
  folderUploads: 'issue.details.media-picker-folder-upload',
27
24
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
28
25
  observedWidth: '',
29
- timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
30
- memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging'
26
+ timestampOnVideo: 'issue.details.media-cards-timestamp-on-video'
31
27
  }
32
28
  };
33
29
  var getProductKeys = function getProductKeys() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -10,13 +10,11 @@ export const areEqualFeatureFlags = (ffA, ffB) => {
10
10
  return false;
11
11
  }
12
12
  const results = {
13
- newCardExperience: ffA.newCardExperience === ffB.newCardExperience,
14
13
  captions: ffA.captions === ffB.captions,
15
14
  mediaInline: ffA.mediaInline === ffB.mediaInline,
16
15
  folderUploads: ffA.folderUploads === ffB.folderUploads,
17
16
  observedWidth: ffA.observedWidth === ffB.observedWidth,
18
- timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
19
- memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging
17
+ timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo
20
18
  };
21
19
  return Object.values(results).every(result => result);
22
20
  };
@@ -51,15 +49,13 @@ export const getFeatureFlagKeysAllProducts = () => {
51
49
  * that change should be released as a MAJOR, because it's a breaking change.
52
50
  */
53
51
  export const defaultMediaFeatureFlags = {
54
- newCardExperience: false,
55
52
  captions: false,
56
53
  mediaInline: false,
57
54
  // We can't yet switch this feature on
58
55
  // TODO https://product-fabric.atlassian.net/browse/MEX-104
59
56
  folderUploads: false,
60
57
  observedWidth: false,
61
- timestampOnVideo: false,
62
- memoryCacheLogging: false
58
+ timestampOnVideo: false
63
59
  };
64
60
 
65
61
  /**
@@ -3,25 +3,21 @@ const productKeys = {
3
3
  /**
4
4
  * Note: Confluence Flags must be prefixed with "confluence.frontend" in order to integrate properly with the product
5
5
  */
6
- newCardExperience: 'confluence.frontend.media.cards.new.experience',
7
6
  captions: 'confluence.frontend.fabric.editor.media.captions',
8
7
  mediaInline: 'confluence.frontend.fabric.editor.media.inline',
9
8
  folderUploads: 'confluence.frontend.media.picker.folder.uploads',
10
9
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
11
10
  observedWidth: '',
12
- timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
13
- memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging'
11
+ timestampOnVideo: 'confluence.frontend.media.timestamp.on.video'
14
12
  },
15
13
  jira: {
16
- newCardExperience: 'issue.details.media-cards-new-experience',
17
14
  captions: 'issue.details.editor.media.captions',
18
15
  // Manged by Linking Platform. No Rollout plan found for Jira
19
16
  mediaInline: '',
20
17
  folderUploads: 'issue.details.media-picker-folder-upload',
21
18
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
22
19
  observedWidth: '',
23
- timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
24
- memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging'
20
+ timestampOnVideo: 'issue.details.media-cards-timestamp-on-video'
25
21
  }
26
22
  };
27
23
  export const getProductKeys = () => productKeys;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -12,13 +12,11 @@ export var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
12
12
  return false;
13
13
  }
14
14
  var results = {
15
- newCardExperience: ffA.newCardExperience === ffB.newCardExperience,
16
15
  captions: ffA.captions === ffB.captions,
17
16
  mediaInline: ffA.mediaInline === ffB.mediaInline,
18
17
  folderUploads: ffA.folderUploads === ffB.folderUploads,
19
18
  observedWidth: ffA.observedWidth === ffB.observedWidth,
20
- timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
21
- memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging
19
+ timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo
22
20
  };
23
21
  return Object.values(results).every(function (result) {
24
22
  return result;
@@ -66,15 +64,13 @@ export var getFeatureFlagKeysAllProducts = function getFeatureFlagKeysAllProduct
66
64
  * that change should be released as a MAJOR, because it's a breaking change.
67
65
  */
68
66
  export var defaultMediaFeatureFlags = {
69
- newCardExperience: false,
70
67
  captions: false,
71
68
  mediaInline: false,
72
69
  // We can't yet switch this feature on
73
70
  // TODO https://product-fabric.atlassian.net/browse/MEX-104
74
71
  folderUploads: false,
75
72
  observedWidth: false,
76
- timestampOnVideo: false,
77
- memoryCacheLogging: false
73
+ timestampOnVideo: false
78
74
  };
79
75
 
80
76
  /**
@@ -3,25 +3,21 @@ var productKeys = {
3
3
  /**
4
4
  * Note: Confluence Flags must be prefixed with "confluence.frontend" in order to integrate properly with the product
5
5
  */
6
- newCardExperience: 'confluence.frontend.media.cards.new.experience',
7
6
  captions: 'confluence.frontend.fabric.editor.media.captions',
8
7
  mediaInline: 'confluence.frontend.fabric.editor.media.inline',
9
8
  folderUploads: 'confluence.frontend.media.picker.folder.uploads',
10
9
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
11
10
  observedWidth: '',
12
- timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
13
- memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging'
11
+ timestampOnVideo: 'confluence.frontend.media.timestamp.on.video'
14
12
  },
15
13
  jira: {
16
- newCardExperience: 'issue.details.media-cards-new-experience',
17
14
  captions: 'issue.details.editor.media.captions',
18
15
  // Manged by Linking Platform. No Rollout plan found for Jira
19
16
  mediaInline: '',
20
17
  folderUploads: 'issue.details.media-picker-folder-upload',
21
18
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
22
19
  observedWidth: '',
23
- timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
24
- memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging'
20
+ timestampOnVideo: 'issue.details.media-cards-timestamp-on-video'
25
21
  }
26
22
  };
27
23
  export var getProductKeys = function getProductKeys() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,11 +1,9 @@
1
1
  export interface MediaFeatureFlags {
2
- newCardExperience?: boolean;
3
2
  captions?: boolean;
4
3
  mediaInline?: boolean;
5
4
  folderUploads?: boolean;
6
5
  observedWidth?: boolean;
7
6
  timestampOnVideo?: boolean;
8
- memoryCacheLogging?: boolean;
9
7
  }
10
8
  export interface WithMediaFeatureFlags {
11
9
  featureFlags?: MediaFeatureFlags;
@@ -1,11 +1,9 @@
1
1
  export interface MediaFeatureFlags {
2
- newCardExperience?: boolean;
3
2
  captions?: boolean;
4
3
  mediaInline?: boolean;
5
4
  folderUploads?: boolean;
6
5
  observedWidth?: boolean;
7
6
  timestampOnVideo?: boolean;
8
- memoryCacheLogging?: boolean;
9
7
  }
10
8
  export interface WithMediaFeatureFlags {
11
9
  featureFlags?: MediaFeatureFlags;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Includes common utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,7 +33,7 @@
33
33
  "atlassian": {
34
34
  "team": "Media Experience",
35
35
  "inPublicMirror": true,
36
- "releaseModel": "scheduled",
36
+ "releaseModel": "continuous",
37
37
  "website": {
38
38
  "name": "Media Common"
39
39
  }
package/report.api.md CHANGED
@@ -155,10 +155,6 @@ export interface MediaFeatureFlags {
155
155
  // (undocumented)
156
156
  mediaInline?: boolean;
157
157
  // (undocumented)
158
- memoryCacheLogging?: boolean;
159
- // (undocumented)
160
- newCardExperience?: boolean;
161
- // (undocumented)
162
158
  observedWidth?: boolean;
163
159
  // (undocumented)
164
160
  timestampOnVideo?: boolean;
@@ -0,0 +1,262 @@
1
+ ## API Report File for "@atlaskit/media-common"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { GasCorePayload } from '@atlaskit/analytics-gas-types';
8
+ import { default as React_2 } from 'react';
9
+
10
+ // @public (undocumented)
11
+ export const ANALYTICS_MEDIA_CHANNEL = "media";
12
+
13
+ // @public (undocumented)
14
+ export const areEqualFeatureFlags: (ffA?: MediaFeatureFlags, ffB?: MediaFeatureFlags) => boolean;
15
+
16
+ // @public (undocumented)
17
+ type BaseAttributes = {};
18
+
19
+ // @public (undocumented)
20
+ type BaseEventPayload<Attributes extends BaseAttributes> = Omit<GasCorePayload, 'attributes'> & {
21
+ attributes: Attributes;
22
+ };
23
+
24
+ // @public (undocumented)
25
+ export type ContextPublicAttributes = PackageAttributes;
26
+
27
+ // @public (undocumented)
28
+ export type ContextStaticProps = WithMediaFeatureFlags;
29
+
30
+ // @public (undocumented)
31
+ export const debounce: (func: Function, wait: number) => (...args: any[]) => void;
32
+
33
+ // @public
34
+ export const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
35
+
36
+ // @public (undocumented)
37
+ export const downloadUrl: (url: string, options?: DownloadUrlOptions) => void;
38
+
39
+ // @public (undocumented)
40
+ interface DownloadUrlOptions {
41
+ // (undocumented)
42
+ name?: string;
43
+ }
44
+
45
+ // @public (undocumented)
46
+ export type FailureAttributes = {
47
+ status: 'fail';
48
+ failReason: string;
49
+ error?: string;
50
+ errorDetail?: string;
51
+ };
52
+
53
+ // @public (undocumented)
54
+ export type FileAttributes = {
55
+ fileId: string;
56
+ fileSize?: number;
57
+ fileMediatype?: MediaType;
58
+ fileMimetype?: string;
59
+ fileSource?: string;
60
+ fileStatus?: FileStatus;
61
+ };
62
+
63
+ // @public (undocumented)
64
+ export type FileStatus = 'error' | 'failed-processing' | 'processed' | 'processing' | 'uploading';
65
+
66
+ // @public (undocumented)
67
+ export const filterFeatureFlagNames: (flags: RequiredMediaFeatureFlags) => Array<keyof MediaFeatureFlags>;
68
+
69
+ // @public
70
+ export const getFeatureFlagKeysAllProducts: () => Array<string>;
71
+
72
+ // @public
73
+ export function getMediaFeatureFlag<T = boolean>(flagName: keyof MediaFeatureFlags, featureFlags?: MediaFeatureFlags): T;
74
+
75
+ // @public (undocumented)
76
+ export const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
77
+
78
+ // @public (undocumented)
79
+ export function getRandomHex(byte: number): string;
80
+
81
+ // @public (undocumented)
82
+ export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
83
+
84
+ // @public (undocumented)
85
+ export const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
86
+
87
+ // @public (undocumented)
88
+ export const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
89
+
90
+ // @public (undocumented)
91
+ export const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
92
+
93
+ // @public (undocumented)
94
+ export const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
95
+
96
+ // @public (undocumented)
97
+ export const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
98
+
99
+ // @public (undocumented)
100
+ export const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
101
+
102
+ // @public (undocumented)
103
+ export const isUndefined: (value: any) => boolean;
104
+
105
+ // @public (undocumented)
106
+ export const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
107
+
108
+ // @public
109
+ export const isVideoMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
110
+
111
+ // @public (undocumented)
112
+ export const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
113
+
114
+ // @public (undocumented)
115
+ export const matches: (srcObj: Object) => (obj: Object) => boolean;
116
+
117
+ // @public (undocumented)
118
+ export interface MediaFeatureFlags {
119
+ // (undocumented)
120
+ captions?: boolean;
121
+ // (undocumented)
122
+ folderUploads?: boolean;
123
+ // (undocumented)
124
+ mediaInline?: boolean;
125
+ // (undocumented)
126
+ observedWidth?: boolean;
127
+ // (undocumented)
128
+ timestampOnVideo?: boolean;
129
+ }
130
+
131
+ // @public (undocumented)
132
+ export type MediaTraceContext = {
133
+ traceId: string;
134
+ spanId?: string;
135
+ };
136
+
137
+ // @public (undocumented)
138
+ export type MediaType = 'archive' | 'audio' | 'doc' | 'image' | 'unknown' | 'video';
139
+
140
+ // @public (undocumented)
141
+ export interface NumericalCardDimensions {
142
+ // (undocumented)
143
+ height: number;
144
+ // (undocumented)
145
+ width: number;
146
+ }
147
+
148
+ // @public (undocumented)
149
+ export const omitBy: (obj: Object, predicate: Function) => {
150
+ [k: string]: any;
151
+ };
152
+
153
+ // @public (undocumented)
154
+ export type OperationalAttributes = (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes & WithTraceContext) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes) | BaseAttributes;
155
+
156
+ // @public (undocumented)
157
+ export type OperationalEventPayload<Attributes extends OperationalAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
158
+ eventType: 'operational';
159
+ action: Action;
160
+ actionSubject: ActionSubject;
161
+ actionSubjectId?: ActionSubjectId;
162
+ };
163
+
164
+ // @public (undocumented)
165
+ export type PackageAttributes = {
166
+ packageName: string;
167
+ packageVersion: string;
168
+ componentName: string;
169
+ component: string;
170
+ };
171
+
172
+ // @public (undocumented)
173
+ export type PerformanceAttributes = {
174
+ overall: {
175
+ durationSincePageStart: number;
176
+ durationSinceCommenced?: number;
177
+ };
178
+ };
179
+
180
+ // @public (undocumented)
181
+ export const pick: (obj?: Object, keys?: Array<String>) => {
182
+ [k: string]: any;
183
+ };
184
+
185
+ // @public (undocumented)
186
+ type RequiredMediaFeatureFlags = Record<keyof Required<MediaFeatureFlags>, boolean>;
187
+
188
+ // @public (undocumented)
189
+ export type ScreenAttributes = (BaseAttributes & WithFileAttributes) | BaseAttributes;
190
+
191
+ // @public (undocumented)
192
+ export type ScreenEventPayload<Attributes extends ScreenAttributes, ActionSubject extends string> = BaseEventPayload<Attributes> & {
193
+ eventType: 'screen';
194
+ actionSubject: ActionSubject;
195
+ name: ActionSubject;
196
+ };
197
+
198
+ // @public (undocumented)
199
+ export type SSR = 'client' | 'server';
200
+
201
+ // @public (undocumented)
202
+ type StatusAttributes = FailureAttributes | SuccessAttributes;
203
+
204
+ // @public (undocumented)
205
+ export type SuccessAttributes = {
206
+ status: 'success';
207
+ fileMediatype?: MediaType;
208
+ };
209
+
210
+ // @public (undocumented)
211
+ export type TrackAttributes = (BaseAttributes & WithFileAttributes) | BaseAttributes;
212
+
213
+ // @public (undocumented)
214
+ export type TrackEventPayload<Attributes extends TrackAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
215
+ eventType: 'track';
216
+ action: Action;
217
+ actionSubject: ActionSubject;
218
+ actionSubjectId?: ActionSubjectId;
219
+ };
220
+
221
+ // @public (undocumented)
222
+ export type UIAttributes = (BaseAttributes & WithFileAttributes) | BaseAttributes;
223
+
224
+ // @public (undocumented)
225
+ export type UIEventPayload<Attributes extends UIAttributes, Action extends string, ActionSubject extends string> = BaseEventPayload<Attributes> & {
226
+ eventType: 'ui';
227
+ action: Action;
228
+ actionSubject: ActionSubject;
229
+ actionSubjectId?: string;
230
+ };
231
+
232
+ // @public (undocumented)
233
+ export const useMemoizeFeatureFlags: (featureFlags?: MediaFeatureFlags) => MediaFeatureFlags | undefined;
234
+
235
+ // @public (undocumented)
236
+ export type WithFileAttributes = {
237
+ fileAttributes: FileAttributes;
238
+ };
239
+
240
+ // @public
241
+ export const withMediaAnalyticsContext: (contextPublicAttributes: ContextPublicAttributes) => <Props extends WithMediaFeatureFlags, Component extends React_2.ComponentType<Props>>(WrappedComponent: React_2.JSXElementConstructor<Props> & Component) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props>> & React_2.RefAttributes<any>>;
242
+
243
+ // @public (undocumented)
244
+ export interface WithMediaFeatureFlags {
245
+ // (undocumented)
246
+ featureFlags?: MediaFeatureFlags;
247
+ }
248
+
249
+ // @public (undocumented)
250
+ export type WithPerformanceAttributes = {
251
+ performanceAttributes?: PerformanceAttributes;
252
+ };
253
+
254
+ // @public (undocumented)
255
+ export type WithTraceContext = {
256
+ traceContext?: MediaTraceContext;
257
+ metadataTraceContext?: MediaTraceContext;
258
+ };
259
+
260
+ // (No @packageDocumentation comment for this package)
261
+
262
+ ```