@atlaskit/media-common 2.16.3 → 2.16.4
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 +7 -0
- package/dist/cjs/mediaFeatureFlags/mediaFeatureFlags.js +3 -2
- package/dist/cjs/utils/helpers.js +13 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/mediaFeatureFlags/mediaFeatureFlags.js +2 -2
- package/dist/es2019/utils/helpers.js +7 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/mediaFeatureFlags/mediaFeatureFlags.js +2 -2
- package/dist/esm/utils/helpers.js +8 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/utils/helpers.d.ts +5 -0
- package/dist/types-ts4.0/utils/helpers.d.ts +5 -0
- package/package.json +2 -2
- package/report.api.md +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/media-common
|
|
2
2
|
|
|
3
|
+
## 2.16.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`42116304154`](https://bitbucket.org/atlassian/atlassian-frontend/commits/42116304154) - Mocks console when it's not available
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 2.16.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -19,6 +19,8 @@ var _types = require("./types");
|
|
|
19
19
|
|
|
20
20
|
var _productKeys = require("./productKeys");
|
|
21
21
|
|
|
22
|
+
var _helpers = require("../utils/helpers");
|
|
23
|
+
|
|
22
24
|
var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
|
|
23
25
|
if (!ffA && !ffB) {
|
|
24
26
|
return true;
|
|
@@ -147,8 +149,7 @@ Object.keys(defaultMediaFeatureFlags).forEach(function (flagName) {
|
|
|
147
149
|
var localOverride = (0, _mediaFeatureFlagLocal.getLocalMediaFeatureFlag)(flagName);
|
|
148
150
|
|
|
149
151
|
if (localOverride !== null) {
|
|
150
|
-
|
|
151
|
-
console.info("%c* LOCAL * MediaFeatureFlag.".concat(flagName, " = ").concat(localOverride), 'font-weight:bold;color:cyan');
|
|
152
|
+
(0, _helpers.getConsole)().info("%c* LOCAL * MediaFeatureFlag.".concat(flagName, " = ").concat(localOverride), 'font-weight:bold;color:cyan');
|
|
152
153
|
}
|
|
153
154
|
});
|
|
154
155
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.pick = exports.omitBy = exports.matches = exports.isUndefined = exports.debounce = void 0;
|
|
8
|
+
exports.pick = exports.omitBy = exports.matches = exports.isUndefined = exports.getConsole = exports.debounce = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
@@ -74,4 +74,15 @@ var matches = function matches(srcObj) {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
exports.matches = matches;
|
|
77
|
+
exports.matches = matches;
|
|
78
|
+
var fakeConsole = {
|
|
79
|
+
info: function info() {},
|
|
80
|
+
log: function log() {},
|
|
81
|
+
error: function error() {}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var getConsole = function getConsole() {
|
|
85
|
+
return typeof console !== 'undefined' ? console : fakeConsole;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
exports.getConsole = getConsole;
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,6 +2,7 @@ import { useRef } from 'react';
|
|
|
2
2
|
import { getLocalMediaFeatureFlag } from '../mediaFeatureFlag-local';
|
|
3
3
|
import { supportedProducts } from './types';
|
|
4
4
|
import { getProductKeys } from './productKeys';
|
|
5
|
+
import { getConsole } from '../utils/helpers';
|
|
5
6
|
export const areEqualFeatureFlags = (ffA, ffB) => {
|
|
6
7
|
if (!ffA && !ffB) {
|
|
7
8
|
return true;
|
|
@@ -95,8 +96,7 @@ Object.keys(defaultMediaFeatureFlags).forEach(flagName => {
|
|
|
95
96
|
const localOverride = getLocalMediaFeatureFlag(flagName);
|
|
96
97
|
|
|
97
98
|
if (localOverride !== null) {
|
|
98
|
-
|
|
99
|
-
console.info(`%c* LOCAL * MediaFeatureFlag.${flagName} = ${localOverride}`, 'font-weight:bold;color:cyan');
|
|
99
|
+
getConsole().info(`%c* LOCAL * MediaFeatureFlag.${flagName} = ${localOverride}`, 'font-weight:bold;color:cyan');
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
export const useMemoizeFeatureFlags = featureFlags => {
|
package/dist/es2019/version.json
CHANGED
|
@@ -3,6 +3,7 @@ import { useRef } from 'react';
|
|
|
3
3
|
import { getLocalMediaFeatureFlag } from '../mediaFeatureFlag-local';
|
|
4
4
|
import { supportedProducts } from './types';
|
|
5
5
|
import { getProductKeys } from './productKeys';
|
|
6
|
+
import { getConsole } from '../utils/helpers';
|
|
6
7
|
export var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
|
|
7
8
|
if (!ffA && !ffB) {
|
|
8
9
|
return true;
|
|
@@ -117,8 +118,7 @@ Object.keys(defaultMediaFeatureFlags).forEach(function (flagName) {
|
|
|
117
118
|
var localOverride = getLocalMediaFeatureFlag(flagName);
|
|
118
119
|
|
|
119
120
|
if (localOverride !== null) {
|
|
120
|
-
|
|
121
|
-
console.info("%c* LOCAL * MediaFeatureFlag.".concat(flagName, " = ").concat(localOverride), 'font-weight:bold;color:cyan');
|
|
121
|
+
getConsole().info("%c* LOCAL * MediaFeatureFlag.".concat(flagName, " = ").concat(localOverride), 'font-weight:bold;color:cyan');
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
export var useMemoizeFeatureFlags = function useMemoizeFeatureFlags(featureFlags) {
|
|
@@ -50,4 +50,12 @@ export var matches = function matches(srcObj) {
|
|
|
50
50
|
|
|
51
51
|
return true;
|
|
52
52
|
};
|
|
53
|
+
};
|
|
54
|
+
var fakeConsole = {
|
|
55
|
+
info: function info() {},
|
|
56
|
+
log: function log() {},
|
|
57
|
+
error: function error() {}
|
|
58
|
+
};
|
|
59
|
+
export var getConsole = function getConsole() {
|
|
60
|
+
return typeof console !== 'undefined' ? console : fakeConsole;
|
|
53
61
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -7,3 +7,8 @@ export declare const omitBy: (obj: Object, predicate: Function) => {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const debounce: (func: Function, wait: number) => (...args: any[]) => void;
|
|
9
9
|
export declare const matches: (srcObj: Object) => (obj: Object) => boolean;
|
|
10
|
+
export declare const getConsole: () => {
|
|
11
|
+
info: () => void;
|
|
12
|
+
log: () => void;
|
|
13
|
+
error: () => void;
|
|
14
|
+
} | Console;
|
|
@@ -7,3 +7,8 @@ export declare const omitBy: (obj: Object, predicate: Function) => {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const debounce: (func: Function, wait: number) => (...args: any[]) => void;
|
|
9
9
|
export declare const matches: (srcObj: Object) => (obj: Object) => boolean;
|
|
10
|
+
export declare const getConsole: () => {
|
|
11
|
+
info: () => void;
|
|
12
|
+
log: () => void;
|
|
13
|
+
error: () => void;
|
|
14
|
+
} | Console;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-common",
|
|
3
|
-
"version": "2.16.
|
|
3
|
+
"version": "2.16.4",
|
|
4
4
|
"description": "Includes common utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/analytics-gas-types": "^5.0.5",
|
|
43
43
|
"@atlaskit/analytics-namespaced-context": "^6.5.0",
|
|
44
44
|
"@atlaskit/analytics-next": "^8.1.1",
|
|
45
|
-
"@atlaskit/section-message": "^6.
|
|
45
|
+
"@atlaskit/section-message": "^6.3.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
package/report.api.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/media-common"
|
|
1
|
+
## API Report File for "@atlaskit/media-common".
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
4
6
|
|
|
5
7
|
```ts
|
|
6
8
|
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
@@ -140,6 +142,7 @@ export declare interface MediaFeatureFlags {
|
|
|
140
142
|
observedWidth?: boolean;
|
|
141
143
|
timestampOnVideo?: boolean;
|
|
142
144
|
mediaUploadApiV2?: boolean;
|
|
145
|
+
memoryCacheLogging?: boolean;
|
|
143
146
|
}
|
|
144
147
|
|
|
145
148
|
export declare type MediaType =
|
|
@@ -228,6 +231,7 @@ declare type StatusAttributes = SuccessAttributes | FailureAttributes;
|
|
|
228
231
|
|
|
229
232
|
export declare type SuccessAttributes = {
|
|
230
233
|
status: 'success';
|
|
234
|
+
fileMediatype?: MediaType;
|
|
231
235
|
};
|
|
232
236
|
|
|
233
237
|
export declare type TrackAttributes =
|