@atlaskit/media-common 2.19.2 → 3.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,15 @@
1
1
  # @atlaskit/media-common
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`c2bc38829e1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2bc38829e1) - Removed mediaUploadApiV2 feature flag (now as a breaking change)
8
+
9
+ ### Minor Changes
10
+
11
+ - [`8a0a92b2885`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a0a92b2885) - MEX-2210 improve inconsistent behaviour on timestampOnVideo playback
12
+
3
13
  ## 2.19.2
4
14
 
5
15
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -117,6 +117,12 @@ Object.defineProperty(exports, "isUnknownMimeTypeSupportedByServer", {
117
117
  return _mediaTypeUtils.isUnknownMimeTypeSupportedByServer;
118
118
  }
119
119
  });
120
+ Object.defineProperty(exports, "isVideoMimeTypeSupportedByBrowser", {
121
+ enumerable: true,
122
+ get: function get() {
123
+ return _mediaTypeUtils.isVideoMimeTypeSupportedByBrowser;
124
+ }
125
+ });
120
126
  Object.defineProperty(exports, "isVideoMimeTypeSupportedByServer", {
121
127
  enumerable: true,
122
128
  get: function get() {
@@ -26,8 +26,6 @@ var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
26
26
  folderUploads: ffA.folderUploads === ffB.folderUploads,
27
27
  observedWidth: ffA.observedWidth === ffB.observedWidth,
28
28
  timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
29
- // @ts-ignore
30
- mediaUploadApiV2: ffA.mediaUploadApiV2 === ffB.mediaUploadApiV2,
31
29
  memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging,
32
30
  fetchFileStateAfterUpload: ffA.fetchFileStateAfterUpload === ffB.fetchFileStateAfterUpload
33
31
  };
@@ -81,7 +79,17 @@ var filterFeatureFlagKeysAllProducts = function filterFeatureFlagKeysAllProducts
81
79
  });
82
80
  };
83
81
 
84
- // default values defined here, not necessary for components to know directly as they should use the function below
82
+ /**
83
+ * defaultMediaFeatureFlags set default values used by the getter function getMediaFeatureFlag
84
+ *
85
+ * *************************************
86
+ * ************* IMPORTANT *************
87
+ * *************************************
88
+ * Only in exceptional cases a FF should be 'true' by default.
89
+ * Making a flag default to 'true' can lead to confusing and unexpected scenarios.
90
+ * If you must set a flag default = true, whenever you remove that flag
91
+ * that change should be released as a MAJOR, because it's a breaking change.
92
+ */
85
93
  exports.filterFeatureFlagKeysAllProducts = filterFeatureFlagKeysAllProducts;
86
94
  var defaultMediaFeatureFlags = {
87
95
  newCardExperience: false,
@@ -92,8 +100,6 @@ var defaultMediaFeatureFlags = {
92
100
  folderUploads: false,
93
101
  observedWidth: false,
94
102
  timestampOnVideo: false,
95
- // @ts-ignore
96
- mediaUploadApiV2: true,
97
103
  memoryCacheLogging: false,
98
104
  fetchFileStateAfterUpload: false
99
105
  };
@@ -13,8 +13,6 @@ var productKeys = {
13
13
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
14
14
  observedWidth: '',
15
15
  timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
16
- // @ts-ignore
17
- mediaUploadApiV2: 'confluence.enable.media.upload.api.v2',
18
16
  memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging',
19
17
  fetchFileStateAfterUpload: 'confluence-frontend-media-client-fetch-file-state-after-upload'
20
18
  },
@@ -27,8 +25,6 @@ var productKeys = {
27
25
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
28
26
  observedWidth: '',
29
27
  timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
30
- // @ts-ignore
31
- mediaUploadApiV2: 'issue.details.enable-media-upload-api-version-2',
32
28
  memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging',
33
29
  fetchFileStateAfterUpload: 'jira-frontend-media-client-fetch-file-state-after-upload'
34
30
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "2.19.2",
3
+ "version": "3.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -9,5 +9,5 @@ export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext
9
9
 
10
10
  // Analytics constants
11
11
  export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
12
- export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './mediaTypeUtils';
12
+ export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './mediaTypeUtils';
13
13
  export { isUndefined, pick, omitBy, debounce, matches, getRandomHex } from './utils/helpers';
@@ -16,8 +16,6 @@ export const areEqualFeatureFlags = (ffA, ffB) => {
16
16
  folderUploads: ffA.folderUploads === ffB.folderUploads,
17
17
  observedWidth: ffA.observedWidth === ffB.observedWidth,
18
18
  timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
19
- // @ts-ignore
20
- mediaUploadApiV2: ffA.mediaUploadApiV2 === ffB.mediaUploadApiV2,
21
19
  memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging,
22
20
  fetchFileStateAfterUpload: ffA.fetchFileStateAfterUpload === ffB.fetchFileStateAfterUpload
23
21
  };
@@ -49,7 +47,17 @@ export const filterFeatureFlagKeysAllProducts = flags => {
49
47
  return ldFeatureFlags.filter(flag => flag !== '');
50
48
  };
51
49
 
52
- // default values defined here, not necessary for components to know directly as they should use the function below
50
+ /**
51
+ * defaultMediaFeatureFlags set default values used by the getter function getMediaFeatureFlag
52
+ *
53
+ * *************************************
54
+ * ************* IMPORTANT *************
55
+ * *************************************
56
+ * Only in exceptional cases a FF should be 'true' by default.
57
+ * Making a flag default to 'true' can lead to confusing and unexpected scenarios.
58
+ * If you must set a flag default = true, whenever you remove that flag
59
+ * that change should be released as a MAJOR, because it's a breaking change.
60
+ */
53
61
  export const defaultMediaFeatureFlags = {
54
62
  newCardExperience: false,
55
63
  captions: false,
@@ -59,8 +67,6 @@ export const defaultMediaFeatureFlags = {
59
67
  folderUploads: false,
60
68
  observedWidth: false,
61
69
  timestampOnVideo: false,
62
- // @ts-ignore
63
- mediaUploadApiV2: true,
64
70
  memoryCacheLogging: false,
65
71
  fetchFileStateAfterUpload: false
66
72
  };
@@ -7,8 +7,6 @@ const productKeys = {
7
7
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
8
8
  observedWidth: '',
9
9
  timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
10
- // @ts-ignore
11
- mediaUploadApiV2: 'confluence.enable.media.upload.api.v2',
12
10
  memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging',
13
11
  fetchFileStateAfterUpload: 'confluence-frontend-media-client-fetch-file-state-after-upload'
14
12
  },
@@ -21,8 +19,6 @@ const productKeys = {
21
19
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
22
20
  observedWidth: '',
23
21
  timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
24
- // @ts-ignore
25
- mediaUploadApiV2: 'issue.details.enable-media-upload-api-version-2',
26
22
  memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging',
27
23
  fetchFileStateAfterUpload: 'jira-frontend-media-client-fetch-file-state-after-upload'
28
24
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "2.19.2",
3
+ "version": "3.0.0",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/index.js CHANGED
@@ -9,5 +9,5 @@ export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext
9
9
 
10
10
  // Analytics constants
11
11
  export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
12
- export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './mediaTypeUtils';
12
+ export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './mediaTypeUtils';
13
13
  export { isUndefined, pick, omitBy, debounce, matches, getRandomHex } from './utils/helpers';
@@ -17,8 +17,6 @@ export var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
17
17
  folderUploads: ffA.folderUploads === ffB.folderUploads,
18
18
  observedWidth: ffA.observedWidth === ffB.observedWidth,
19
19
  timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
20
- // @ts-ignore
21
- mediaUploadApiV2: ffA.mediaUploadApiV2 === ffB.mediaUploadApiV2,
22
20
  memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging,
23
21
  fetchFileStateAfterUpload: ffA.fetchFileStateAfterUpload === ffB.fetchFileStateAfterUpload
24
22
  };
@@ -69,7 +67,17 @@ export var filterFeatureFlagKeysAllProducts = function filterFeatureFlagKeysAllP
69
67
  });
70
68
  };
71
69
 
72
- // default values defined here, not necessary for components to know directly as they should use the function below
70
+ /**
71
+ * defaultMediaFeatureFlags set default values used by the getter function getMediaFeatureFlag
72
+ *
73
+ * *************************************
74
+ * ************* IMPORTANT *************
75
+ * *************************************
76
+ * Only in exceptional cases a FF should be 'true' by default.
77
+ * Making a flag default to 'true' can lead to confusing and unexpected scenarios.
78
+ * If you must set a flag default = true, whenever you remove that flag
79
+ * that change should be released as a MAJOR, because it's a breaking change.
80
+ */
73
81
  export var defaultMediaFeatureFlags = {
74
82
  newCardExperience: false,
75
83
  captions: false,
@@ -79,8 +87,6 @@ export var defaultMediaFeatureFlags = {
79
87
  folderUploads: false,
80
88
  observedWidth: false,
81
89
  timestampOnVideo: false,
82
- // @ts-ignore
83
- mediaUploadApiV2: true,
84
90
  memoryCacheLogging: false,
85
91
  fetchFileStateAfterUpload: false
86
92
  };
@@ -7,8 +7,6 @@ var productKeys = {
7
7
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
8
8
  observedWidth: '',
9
9
  timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
10
- // @ts-ignore
11
- mediaUploadApiV2: 'confluence.enable.media.upload.api.v2',
12
10
  memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging',
13
11
  fetchFileStateAfterUpload: 'confluence-frontend-media-client-fetch-file-state-after-upload'
14
12
  },
@@ -21,8 +19,6 @@ var productKeys = {
21
19
  //TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
22
20
  observedWidth: '',
23
21
  timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
24
- // @ts-ignore
25
- mediaUploadApiV2: 'issue.details.enable-media-upload-api-version-2',
26
22
  memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging',
27
23
  fetchFileStateAfterUpload: 'jira-frontend-media-client-fetch-file-state-after-upload'
28
24
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "2.19.2",
3
+ "version": "3.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -10,7 +10,7 @@ export interface NumericalCardDimensions {
10
10
  export type { PackageAttributes, WithFileAttributes, WithPerformanceAttributes, WithTraceContext, FileAttributes, PerformanceAttributes, SuccessAttributes, FailureAttributes, OperationalAttributes, OperationalEventPayload, UIAttributes, UIEventPayload, ScreenAttributes, ScreenEventPayload, TrackAttributes, TrackEventPayload, ContextPublicAttributes, ContextStaticProps, } from './analytics/types';
11
11
  export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext';
12
12
  export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
13
- export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
13
+ export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
14
14
  export declare type SSR = 'client' | 'server';
15
15
  export { isUndefined, pick, omitBy, debounce, matches, getRandomHex, } from './utils/helpers';
16
16
  export declare type MediaTraceContext = {
@@ -11,6 +11,17 @@ export declare const mapAndFilterFeatureFlagNames: (flags: RequiredMediaFeatureF
11
11
  * Returns the Launch Darkly Keys from all products for each of the flags set as true in the input record.
12
12
  * */
13
13
  export declare const filterFeatureFlagKeysAllProducts: (flags: RequiredMediaFeatureFlags) => Array<string>;
14
+ /**
15
+ * defaultMediaFeatureFlags set default values used by the getter function getMediaFeatureFlag
16
+ *
17
+ * *************************************
18
+ * ************* IMPORTANT *************
19
+ * *************************************
20
+ * Only in exceptional cases a FF should be 'true' by default.
21
+ * Making a flag default to 'true' can lead to confusing and unexpected scenarios.
22
+ * If you must set a flag default = true, whenever you remove that flag
23
+ * that change should be released as a MAJOR, because it's a breaking change.
24
+ */
14
25
  export declare const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
15
26
  /**
16
27
  * Public accessor from components to fallback to defaults if flags not passed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "2.19.2",
3
+ "version": "3.0.0",
4
4
  "description": "Includes common utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -50,7 +50,7 @@ export const debounce: (
50
50
  wait: number,
51
51
  ) => (...args: any[]) => void;
52
52
 
53
- // @public (undocumented)
53
+ // @public
54
54
  export const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
55
55
 
56
56
  // @public (undocumented)
@@ -142,6 +142,9 @@ export const isUndefined: (value: any) => boolean;
142
142
  // @public (undocumented)
143
143
  export const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
144
144
 
145
+ // @public
146
+ export const isVideoMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
147
+
145
148
  // @public (undocumented)
146
149
  export const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
147
150