@atlaskit/media-common 2.16.4 → 2.17.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 +10 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/mediaFeatureFlags/mediaFeatureFlags.js +0 -14
- package/dist/cjs/utils/helpers.js +10 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/mediaFeatureFlags/mediaFeatureFlags.js +0 -12
- package/dist/es2019/utils/helpers.js +3 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/mediaFeatureFlags/mediaFeatureFlags.js +0 -12
- package/dist/esm/utils/helpers.js +6 -8
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types.d.ts +4 -1
- package/dist/types/index.d.ts +6 -2
- package/dist/types/utils/helpers.d.ts +1 -5
- package/dist/types-ts4.0/analytics/types.d.ts +4 -1
- package/dist/types-ts4.0/index.d.ts +6 -2
- package/dist/types-ts4.0/utils/helpers.d.ts +1 -5
- package/package.json +3 -2
- package/report.api.md +128 -100
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/media-common
|
|
2
2
|
|
|
3
|
+
## 2.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2c402e87213`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2c402e87213) - [Experimental] Add traceId in media card get image request.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`19141d537a4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19141d537a4) - Removes use of console.info in runtime
|
|
12
|
+
|
|
3
13
|
## 2.16.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "getMediaTypeFromMimeType", {
|
|
|
57
57
|
return _mediaTypeUtils.getMediaTypeFromMimeType;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "getRandomHex", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _helpers.getRandomHex;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
Object.defineProperty(exports, "isAudioMimeTypeSupportedByServer", {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function get() {
|
|
@@ -19,8 +19,6 @@ var _types = require("./types");
|
|
|
19
19
|
|
|
20
20
|
var _productKeys = require("./productKeys");
|
|
21
21
|
|
|
22
|
-
var _helpers = require("../utils/helpers");
|
|
23
|
-
|
|
24
22
|
var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
|
|
25
23
|
if (!ffA && !ffB) {
|
|
26
24
|
return true;
|
|
@@ -140,18 +138,6 @@ function getMediaFeatureFlag(flagName, featureFlags) {
|
|
|
140
138
|
|
|
141
139
|
return defaultMediaFeatureFlags[flagName];
|
|
142
140
|
}
|
|
143
|
-
/**
|
|
144
|
-
* do a check for any localStorage overrides, warn user once only
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
Object.keys(defaultMediaFeatureFlags).forEach(function (flagName) {
|
|
149
|
-
var localOverride = (0, _mediaFeatureFlagLocal.getLocalMediaFeatureFlag)(flagName);
|
|
150
|
-
|
|
151
|
-
if (localOverride !== null) {
|
|
152
|
-
(0, _helpers.getConsole)().info("%c* LOCAL * MediaFeatureFlag.".concat(flagName, " = ").concat(localOverride), 'font-weight:bold;color:cyan');
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
141
|
|
|
156
142
|
var useMemoizeFeatureFlags = function useMemoizeFeatureFlags(featureFlags) {
|
|
157
143
|
var ref = (0, _react.useRef)();
|
|
@@ -5,7 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.debounce = void 0;
|
|
9
|
+
exports.getRandomHex = getRandomHex;
|
|
10
|
+
exports.pick = exports.omitBy = exports.matches = exports.isUndefined = void 0;
|
|
11
|
+
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
13
|
|
|
10
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
15
|
|
|
@@ -75,14 +79,9 @@ var matches = function matches(srcObj) {
|
|
|
75
79
|
};
|
|
76
80
|
|
|
77
81
|
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
82
|
|
|
88
|
-
|
|
83
|
+
function getRandomHex(size) {
|
|
84
|
+
return (0, _toConsumableArray2.default)(Array(size)).map(function () {
|
|
85
|
+
return Math.floor(Math.random() * 16).toString(16);
|
|
86
|
+
}).join('');
|
|
87
|
+
}
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
|
@@ -8,4 +8,4 @@ export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext
|
|
|
8
8
|
|
|
9
9
|
export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
|
|
10
10
|
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './mediaTypeUtils';
|
|
11
|
-
export { isUndefined, pick, omitBy, debounce, matches } from './utils/helpers';
|
|
11
|
+
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex } from './utils/helpers';
|
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
export const areEqualFeatureFlags = (ffA, ffB) => {
|
|
7
6
|
if (!ffA && !ffB) {
|
|
8
7
|
return true;
|
|
@@ -88,17 +87,6 @@ export function getMediaFeatureFlag(flagName, featureFlags) {
|
|
|
88
87
|
|
|
89
88
|
return defaultMediaFeatureFlags[flagName];
|
|
90
89
|
}
|
|
91
|
-
/**
|
|
92
|
-
* do a check for any localStorage overrides, warn user once only
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
Object.keys(defaultMediaFeatureFlags).forEach(flagName => {
|
|
96
|
-
const localOverride = getLocalMediaFeatureFlag(flagName);
|
|
97
|
-
|
|
98
|
-
if (localOverride !== null) {
|
|
99
|
-
getConsole().info(`%c* LOCAL * MediaFeatureFlag.${flagName} = ${localOverride}`, 'font-weight:bold;color:cyan');
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
90
|
export const useMemoizeFeatureFlags = featureFlags => {
|
|
103
91
|
const ref = useRef();
|
|
104
92
|
|
|
@@ -27,9 +27,6 @@ export const matches = srcObj => {
|
|
|
27
27
|
return true;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
error: () => {}
|
|
34
|
-
};
|
|
35
|
-
export const getConsole = () => typeof console !== 'undefined' ? console : fakeConsole;
|
|
30
|
+
export function getRandomHex(size) {
|
|
31
|
+
return [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
32
|
+
}
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -8,4 +8,4 @@ export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext
|
|
|
8
8
|
|
|
9
9
|
export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
|
|
10
10
|
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './mediaTypeUtils';
|
|
11
|
-
export { isUndefined, pick, omitBy, debounce, matches } from './utils/helpers';
|
|
11
|
+
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex } from './utils/helpers';
|
|
@@ -3,7 +3,6 @@ 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';
|
|
7
6
|
export var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
|
|
8
7
|
if (!ffA && !ffB) {
|
|
9
8
|
return true;
|
|
@@ -110,17 +109,6 @@ export function getMediaFeatureFlag(flagName, featureFlags) {
|
|
|
110
109
|
|
|
111
110
|
return defaultMediaFeatureFlags[flagName];
|
|
112
111
|
}
|
|
113
|
-
/**
|
|
114
|
-
* do a check for any localStorage overrides, warn user once only
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
Object.keys(defaultMediaFeatureFlags).forEach(function (flagName) {
|
|
118
|
-
var localOverride = getLocalMediaFeatureFlag(flagName);
|
|
119
|
-
|
|
120
|
-
if (localOverride !== null) {
|
|
121
|
-
getConsole().info("%c* LOCAL * MediaFeatureFlag.".concat(flagName, " = ").concat(localOverride), 'font-weight:bold;color:cyan');
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
112
|
export var useMemoizeFeatureFlags = function useMemoizeFeatureFlags(featureFlags) {
|
|
125
113
|
var ref = useRef();
|
|
126
114
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
export var isUndefined = function isUndefined(value) {
|
|
3
4
|
return value === undefined;
|
|
@@ -51,11 +52,8 @@ export var matches = function matches(srcObj) {
|
|
|
51
52
|
return true;
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
export var getConsole = function getConsole() {
|
|
60
|
-
return typeof console !== 'undefined' ? console : fakeConsole;
|
|
61
|
-
};
|
|
55
|
+
export function getRandomHex(size) {
|
|
56
|
+
return _toConsumableArray(Array(size)).map(function () {
|
|
57
|
+
return Math.floor(Math.random() * 16).toString(16);
|
|
58
|
+
}).join('');
|
|
59
|
+
}
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
2
2
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
3
|
-
import { MediaType, FileStatus, WithMediaFeatureFlags } from '..';
|
|
3
|
+
import { MediaType, FileStatus, WithMediaFeatureFlags, MediaTraceContext } from '..';
|
|
4
4
|
export declare type BaseAttributes = {};
|
|
5
5
|
export declare type PackageAttributes = {
|
|
6
6
|
packageName: string;
|
|
@@ -31,6 +31,9 @@ export declare type WithFileAttributes = {
|
|
|
31
31
|
export declare type WithPerformanceAttributes = {
|
|
32
32
|
performanceAttributes?: PerformanceAttributes;
|
|
33
33
|
};
|
|
34
|
+
export declare type WithTraceContext = {
|
|
35
|
+
traceContext?: MediaTraceContext;
|
|
36
|
+
};
|
|
34
37
|
export declare type SuccessAttributes = {
|
|
35
38
|
status: 'success';
|
|
36
39
|
fileMediatype?: MediaType;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,9 +7,13 @@ export interface NumericalCardDimensions {
|
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
}
|
|
10
|
-
export type { PackageAttributes, WithFileAttributes, WithPerformanceAttributes, FileAttributes, PerformanceAttributes, SuccessAttributes, FailureAttributes, OperationalAttributes, OperationalEventPayload, UIAttributes, UIEventPayload, ScreenAttributes, ScreenEventPayload, TrackAttributes, TrackEventPayload, ContextPublicAttributes, ContextStaticProps, } from './analytics/types';
|
|
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
13
|
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
|
|
14
14
|
export declare type SSR = 'client' | 'server';
|
|
15
|
-
export { isUndefined, pick, omitBy, debounce, matches } from './utils/helpers';
|
|
15
|
+
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex, } from './utils/helpers';
|
|
16
|
+
export declare type MediaTraceContext = {
|
|
17
|
+
traceId: string;
|
|
18
|
+
spanId?: string;
|
|
19
|
+
};
|
|
@@ -7,8 +7,4 @@ 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
|
|
11
|
-
info: () => void;
|
|
12
|
-
log: () => void;
|
|
13
|
-
error: () => void;
|
|
14
|
-
} | Console;
|
|
10
|
+
export declare function getRandomHex(size: number): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
2
2
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
3
|
-
import { MediaType, FileStatus, WithMediaFeatureFlags } from '..';
|
|
3
|
+
import { MediaType, FileStatus, WithMediaFeatureFlags, MediaTraceContext } from '..';
|
|
4
4
|
export declare type BaseAttributes = {};
|
|
5
5
|
export declare type PackageAttributes = {
|
|
6
6
|
packageName: string;
|
|
@@ -31,6 +31,9 @@ export declare type WithFileAttributes = {
|
|
|
31
31
|
export declare type WithPerformanceAttributes = {
|
|
32
32
|
performanceAttributes?: PerformanceAttributes;
|
|
33
33
|
};
|
|
34
|
+
export declare type WithTraceContext = {
|
|
35
|
+
traceContext?: MediaTraceContext;
|
|
36
|
+
};
|
|
34
37
|
export declare type SuccessAttributes = {
|
|
35
38
|
status: 'success';
|
|
36
39
|
fileMediatype?: MediaType;
|
|
@@ -7,9 +7,13 @@ export interface NumericalCardDimensions {
|
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
}
|
|
10
|
-
export type { PackageAttributes, WithFileAttributes, WithPerformanceAttributes, FileAttributes, PerformanceAttributes, SuccessAttributes, FailureAttributes, OperationalAttributes, OperationalEventPayload, UIAttributes, UIEventPayload, ScreenAttributes, ScreenEventPayload, TrackAttributes, TrackEventPayload, ContextPublicAttributes, ContextStaticProps, } from './analytics/types';
|
|
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
13
|
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
|
|
14
14
|
export declare type SSR = 'client' | 'server';
|
|
15
|
-
export { isUndefined, pick, omitBy, debounce, matches } from './utils/helpers';
|
|
15
|
+
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex, } from './utils/helpers';
|
|
16
|
+
export declare type MediaTraceContext = {
|
|
17
|
+
traceId: string;
|
|
18
|
+
spanId?: string;
|
|
19
|
+
};
|
|
@@ -7,8 +7,4 @@ 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
|
|
11
|
-
info: () => void;
|
|
12
|
-
log: () => void;
|
|
13
|
-
error: () => void;
|
|
14
|
-
} | Console;
|
|
10
|
+
export declare function getRandomHex(size: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "Includes common utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"typesVersions": {
|
|
16
16
|
">=4.0 <4.5": {
|
|
17
17
|
"*": [
|
|
18
|
-
"dist/types-ts4.0/*"
|
|
18
|
+
"dist/types-ts4.0/*",
|
|
19
|
+
"dist/types-ts4.0/index.d.ts"
|
|
19
20
|
]
|
|
20
21
|
}
|
|
21
22
|
},
|
package/report.api.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
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. 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
|
|
|
@@ -8,50 +12,63 @@
|
|
|
8
12
|
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
9
13
|
import { default as React_2 } from 'react';
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
// @public (undocumented)
|
|
16
|
+
export const ANALYTICS_MEDIA_CHANNEL = 'media';
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
export const areEqualFeatureFlags: (
|
|
14
20
|
ffA?: MediaFeatureFlags | undefined,
|
|
15
21
|
ffB?: MediaFeatureFlags | undefined,
|
|
16
22
|
) => boolean;
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
type BaseAttributes = {};
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
// @public (undocumented)
|
|
28
|
+
type BaseEventPayload<Attributes extends BaseAttributes> = Omit<
|
|
21
29
|
GasCorePayload,
|
|
22
30
|
'attributes'
|
|
23
31
|
> & {
|
|
24
32
|
attributes: Attributes;
|
|
25
33
|
};
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
// @public (undocumented)
|
|
36
|
+
export type ContextPublicAttributes = PackageAttributes;
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
// @public (undocumented)
|
|
39
|
+
export type ContextStaticProps = WithMediaFeatureFlags;
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
// @public (undocumented)
|
|
42
|
+
export const debounce: (
|
|
32
43
|
func: Function,
|
|
33
44
|
wait: number,
|
|
34
45
|
) => (...args: any[]) => void;
|
|
35
46
|
|
|
36
|
-
|
|
47
|
+
// @public (undocumented)
|
|
48
|
+
export const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
|
|
37
49
|
|
|
38
|
-
|
|
50
|
+
// @public (undocumented)
|
|
51
|
+
export const downloadUrl: (
|
|
39
52
|
url: string,
|
|
40
53
|
options?: DownloadUrlOptions | undefined,
|
|
41
54
|
) => void;
|
|
42
55
|
|
|
43
|
-
|
|
56
|
+
// @public (undocumented)
|
|
57
|
+
interface DownloadUrlOptions {
|
|
58
|
+
// (undocumented)
|
|
44
59
|
name?: string;
|
|
45
60
|
}
|
|
46
61
|
|
|
47
|
-
|
|
62
|
+
// @public (undocumented)
|
|
63
|
+
export type FailureAttributes = {
|
|
48
64
|
status: 'fail';
|
|
49
65
|
failReason: string;
|
|
50
66
|
error?: string;
|
|
51
67
|
errorDetail?: string;
|
|
52
68
|
};
|
|
53
69
|
|
|
54
|
-
|
|
70
|
+
// @public (undocumented)
|
|
71
|
+
export type FileAttributes = {
|
|
55
72
|
fileId: string;
|
|
56
73
|
fileSize?: number;
|
|
57
74
|
fileMediatype?: MediaType;
|
|
@@ -60,92 +77,90 @@ export declare type FileAttributes = {
|
|
|
60
77
|
fileStatus?: FileStatus;
|
|
61
78
|
};
|
|
62
79
|
|
|
63
|
-
|
|
80
|
+
// @public (undocumented)
|
|
81
|
+
export type FileStatus =
|
|
64
82
|
| 'uploading'
|
|
65
83
|
| 'processing'
|
|
66
84
|
| 'processed'
|
|
67
85
|
| 'error'
|
|
68
86
|
| 'failed-processing';
|
|
69
87
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* Returns the Launch Darkly Keys from all products for each of the flags set as true in the input record.
|
|
73
|
-
* */
|
|
74
|
-
export declare const filterFeatureFlagKeysAllProducts: (
|
|
88
|
+
// @public
|
|
89
|
+
export const filterFeatureFlagKeysAllProducts: (
|
|
75
90
|
flags: RequiredMediaFeatureFlags,
|
|
76
91
|
) => Array<string>;
|
|
77
92
|
|
|
78
|
-
|
|
93
|
+
// @public (undocumented)
|
|
94
|
+
export const filterFeatureFlagNames: (
|
|
79
95
|
flags: RequiredMediaFeatureFlags,
|
|
80
96
|
) => Array<keyof MediaFeatureFlags>;
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* otherwise whatever product has set will be returned.
|
|
85
|
-
*
|
|
86
|
-
* To override locally for testing:
|
|
87
|
-
* - `localStorage[flagName] = true` to enable locally,
|
|
88
|
-
* - `delete localStorage[flagName]` to remove.
|
|
89
|
-
*
|
|
90
|
-
* (you will see a warning in console if override used)
|
|
91
|
-
* */
|
|
92
|
-
export declare function getMediaFeatureFlag<T = boolean>(
|
|
98
|
+
// @public
|
|
99
|
+
export function getMediaFeatureFlag<T = boolean>(
|
|
93
100
|
flagName: keyof MediaFeatureFlags,
|
|
94
101
|
featureFlags?: MediaFeatureFlags,
|
|
95
102
|
): T;
|
|
96
103
|
|
|
97
|
-
|
|
104
|
+
// @public (undocumented)
|
|
105
|
+
export const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
|
|
98
106
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
) => boolean;
|
|
107
|
+
// @public (undocumented)
|
|
108
|
+
export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
102
109
|
|
|
103
|
-
|
|
110
|
+
// @public (undocumented)
|
|
111
|
+
export const isDocumentMimeTypeSupportedByBrowser: (
|
|
104
112
|
mimeType: string,
|
|
105
113
|
) => boolean;
|
|
106
114
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
) => boolean;
|
|
115
|
+
// @public (undocumented)
|
|
116
|
+
export const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
110
117
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
) => boolean;
|
|
118
|
+
// @public (undocumented)
|
|
119
|
+
export const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
114
120
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
) => boolean;
|
|
121
|
+
// @public (undocumented)
|
|
122
|
+
export const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
) => boolean;
|
|
124
|
+
// @public (undocumented)
|
|
125
|
+
export const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
122
126
|
|
|
123
|
-
|
|
127
|
+
// @public (undocumented)
|
|
128
|
+
export const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
124
129
|
|
|
125
|
-
|
|
130
|
+
// @public (undocumented)
|
|
131
|
+
export const isUndefined: (value: any) => boolean;
|
|
126
132
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
) => boolean;
|
|
133
|
+
// @public (undocumented)
|
|
134
|
+
export const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
130
135
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
) => boolean;
|
|
136
|
+
// @public (undocumented)
|
|
137
|
+
export const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
134
138
|
|
|
135
|
-
|
|
139
|
+
// @public (undocumented)
|
|
140
|
+
export const matches: (srcObj: Object) => (obj: Object) => boolean;
|
|
136
141
|
|
|
137
|
-
|
|
138
|
-
|
|
142
|
+
// @public (undocumented)
|
|
143
|
+
export interface MediaFeatureFlags {
|
|
144
|
+
// (undocumented)
|
|
139
145
|
captions?: boolean;
|
|
140
|
-
|
|
146
|
+
// (undocumented)
|
|
141
147
|
folderUploads?: boolean;
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
// (undocumented)
|
|
149
|
+
mediaInline?: boolean;
|
|
150
|
+
// (undocumented)
|
|
144
151
|
mediaUploadApiV2?: boolean;
|
|
152
|
+
// (undocumented)
|
|
145
153
|
memoryCacheLogging?: boolean;
|
|
154
|
+
// (undocumented)
|
|
155
|
+
newCardExperience?: boolean;
|
|
156
|
+
// (undocumented)
|
|
157
|
+
observedWidth?: boolean;
|
|
158
|
+
// (undocumented)
|
|
159
|
+
timestampOnVideo?: boolean;
|
|
146
160
|
}
|
|
147
161
|
|
|
148
|
-
|
|
162
|
+
// @public (undocumented)
|
|
163
|
+
export type MediaType =
|
|
149
164
|
| 'doc'
|
|
150
165
|
| 'audio'
|
|
151
166
|
| 'video'
|
|
@@ -153,19 +168,24 @@ export declare type MediaType =
|
|
|
153
168
|
| 'archive'
|
|
154
169
|
| 'unknown';
|
|
155
170
|
|
|
156
|
-
|
|
157
|
-
|
|
171
|
+
// @public (undocumented)
|
|
172
|
+
export interface NumericalCardDimensions {
|
|
173
|
+
// (undocumented)
|
|
158
174
|
height: number;
|
|
175
|
+
// (undocumented)
|
|
176
|
+
width: number;
|
|
159
177
|
}
|
|
160
178
|
|
|
161
|
-
|
|
179
|
+
// @public (undocumented)
|
|
180
|
+
export const omitBy: (
|
|
162
181
|
obj: Object,
|
|
163
182
|
predicate: Function,
|
|
164
183
|
) => {
|
|
165
184
|
[k: string]: any;
|
|
166
185
|
};
|
|
167
186
|
|
|
168
|
-
|
|
187
|
+
// @public (undocumented)
|
|
188
|
+
export type OperationalAttributes =
|
|
169
189
|
| BaseAttributes
|
|
170
190
|
| (BaseAttributes & WithFileAttributes)
|
|
171
191
|
| (BaseAttributes & WithFileAttributes & StatusAttributes)
|
|
@@ -174,7 +194,8 @@ export declare type OperationalAttributes =
|
|
|
174
194
|
StatusAttributes &
|
|
175
195
|
WithPerformanceAttributes);
|
|
176
196
|
|
|
177
|
-
|
|
197
|
+
// @public (undocumented)
|
|
198
|
+
export type OperationalEventPayload<
|
|
178
199
|
Attributes extends OperationalAttributes,
|
|
179
200
|
Action extends string,
|
|
180
201
|
ActionSubject extends string,
|
|
@@ -186,37 +207,43 @@ export declare type OperationalEventPayload<
|
|
|
186
207
|
actionSubjectId?: ActionSubjectId;
|
|
187
208
|
};
|
|
188
209
|
|
|
189
|
-
|
|
210
|
+
// @public (undocumented)
|
|
211
|
+
export type PackageAttributes = {
|
|
190
212
|
packageName: string;
|
|
191
213
|
packageVersion: string;
|
|
192
214
|
componentName: string;
|
|
193
215
|
component: string;
|
|
194
216
|
};
|
|
195
217
|
|
|
196
|
-
|
|
218
|
+
// @public (undocumented)
|
|
219
|
+
export type PerformanceAttributes = {
|
|
197
220
|
overall: {
|
|
198
221
|
durationSincePageStart: number;
|
|
199
222
|
durationSinceCommenced?: number;
|
|
200
223
|
};
|
|
201
224
|
};
|
|
202
225
|
|
|
203
|
-
|
|
226
|
+
// @public (undocumented)
|
|
227
|
+
export const pick: (
|
|
204
228
|
obj?: Object | undefined,
|
|
205
229
|
keys?: Array<String>,
|
|
206
230
|
) => {
|
|
207
231
|
[k: string]: any;
|
|
208
232
|
};
|
|
209
233
|
|
|
210
|
-
|
|
234
|
+
// @public (undocumented)
|
|
235
|
+
type RequiredMediaFeatureFlags = Record<
|
|
211
236
|
keyof Required<MediaFeatureFlags>,
|
|
212
237
|
boolean
|
|
213
238
|
>;
|
|
214
239
|
|
|
215
|
-
|
|
240
|
+
// @public (undocumented)
|
|
241
|
+
export type ScreenAttributes =
|
|
216
242
|
| BaseAttributes
|
|
217
243
|
| (BaseAttributes & WithFileAttributes);
|
|
218
244
|
|
|
219
|
-
|
|
245
|
+
// @public (undocumented)
|
|
246
|
+
export type ScreenEventPayload<
|
|
220
247
|
Attributes extends ScreenAttributes,
|
|
221
248
|
ActionSubject extends string
|
|
222
249
|
> = BaseEventPayload<Attributes> & {
|
|
@@ -225,20 +252,25 @@ export declare type ScreenEventPayload<
|
|
|
225
252
|
name: ActionSubject;
|
|
226
253
|
};
|
|
227
254
|
|
|
228
|
-
|
|
255
|
+
// @public (undocumented)
|
|
256
|
+
export type SSR = 'client' | 'server';
|
|
229
257
|
|
|
230
|
-
|
|
258
|
+
// @public (undocumented)
|
|
259
|
+
type StatusAttributes = SuccessAttributes | FailureAttributes;
|
|
231
260
|
|
|
232
|
-
|
|
261
|
+
// @public (undocumented)
|
|
262
|
+
export type SuccessAttributes = {
|
|
233
263
|
status: 'success';
|
|
234
264
|
fileMediatype?: MediaType;
|
|
235
265
|
};
|
|
236
266
|
|
|
237
|
-
|
|
267
|
+
// @public (undocumented)
|
|
268
|
+
export type TrackAttributes =
|
|
238
269
|
| BaseAttributes
|
|
239
270
|
| (BaseAttributes & WithFileAttributes);
|
|
240
271
|
|
|
241
|
-
|
|
272
|
+
// @public (undocumented)
|
|
273
|
+
export type TrackEventPayload<
|
|
242
274
|
Attributes extends TrackAttributes,
|
|
243
275
|
Action extends string,
|
|
244
276
|
ActionSubject extends string,
|
|
@@ -250,11 +282,13 @@ export declare type TrackEventPayload<
|
|
|
250
282
|
actionSubjectId?: ActionSubjectId;
|
|
251
283
|
};
|
|
252
284
|
|
|
253
|
-
|
|
285
|
+
// @public (undocumented)
|
|
286
|
+
export type UIAttributes =
|
|
254
287
|
| BaseAttributes
|
|
255
288
|
| (BaseAttributes & WithFileAttributes);
|
|
256
289
|
|
|
257
|
-
|
|
290
|
+
// @public (undocumented)
|
|
291
|
+
export type UIEventPayload<
|
|
258
292
|
Attributes extends UIAttributes,
|
|
259
293
|
Action extends string,
|
|
260
294
|
ActionSubject extends string
|
|
@@ -265,27 +299,18 @@ export declare type UIEventPayload<
|
|
|
265
299
|
actionSubjectId?: string;
|
|
266
300
|
};
|
|
267
301
|
|
|
268
|
-
|
|
302
|
+
// @public (undocumented)
|
|
303
|
+
export const useMemoizeFeatureFlags: (
|
|
269
304
|
featureFlags?: MediaFeatureFlags | undefined,
|
|
270
305
|
) => MediaFeatureFlags | undefined;
|
|
271
306
|
|
|
272
|
-
|
|
307
|
+
// @public (undocumented)
|
|
308
|
+
export type WithFileAttributes = {
|
|
273
309
|
fileAttributes: FileAttributes;
|
|
274
310
|
};
|
|
275
311
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
*
|
|
279
|
-
* Similar than "packages/analytics/analytics-next/src/hocs/withAnalyticsContext.tsx",
|
|
280
|
-
* except that we restrict attributes put in this context using ContextPublicAttributes and ContextPrivateAttributes.
|
|
281
|
-
*
|
|
282
|
-
* As a constraint, the wrapped React Component's props must extend ContextStaticProps.
|
|
283
|
-
*
|
|
284
|
-
* @param {ContextPublicAttributes} attributes public attributes to put in context
|
|
285
|
-
*
|
|
286
|
-
* @see packages/analytics/analytics-next/src/hocs/withAnalyticsContext.tsx
|
|
287
|
-
*/
|
|
288
|
-
export declare const withMediaAnalyticsContext: (
|
|
312
|
+
// @public
|
|
313
|
+
export const withMediaAnalyticsContext: (
|
|
289
314
|
contextPublicAttributes: ContextPublicAttributes,
|
|
290
315
|
options?: {
|
|
291
316
|
filterFeatureFlags?: Array<keyof MediaFeatureFlags>;
|
|
@@ -300,13 +325,16 @@ export declare const withMediaAnalyticsContext: (
|
|
|
300
325
|
React_2.RefAttributes<any>
|
|
301
326
|
>;
|
|
302
327
|
|
|
303
|
-
|
|
328
|
+
// @public (undocumented)
|
|
329
|
+
export interface WithMediaFeatureFlags {
|
|
330
|
+
// (undocumented)
|
|
304
331
|
featureFlags?: MediaFeatureFlags;
|
|
305
332
|
}
|
|
306
333
|
|
|
307
|
-
|
|
334
|
+
// @public (undocumented)
|
|
335
|
+
export type WithPerformanceAttributes = {
|
|
308
336
|
performanceAttributes?: PerformanceAttributes;
|
|
309
337
|
};
|
|
310
338
|
|
|
311
|
-
|
|
339
|
+
// (No @packageDocumentation comment for this package)
|
|
312
340
|
```
|