@atlaskit/media-common 2.17.0 → 2.19.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 +19 -0
- package/dist/cjs/docs/index.js +9 -1
- package/dist/cjs/docs/media-use-only.js +41 -0
- package/dist/cjs/mediaFeatureFlags/mediaFeatureFlags.js +4 -4
- package/dist/cjs/mediaFeatureFlags/productKeys.js +6 -8
- package/dist/cjs/utils/helpers.js +22 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/docs/index.js +2 -1
- package/dist/es2019/docs/media-use-only.js +29 -0
- package/dist/es2019/mediaFeatureFlags/mediaFeatureFlags.js +4 -4
- package/dist/es2019/mediaFeatureFlags/productKeys.js +6 -8
- package/dist/es2019/utils/helpers.js +21 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/docs/index.js +2 -1
- package/dist/esm/docs/media-use-only.js +31 -0
- package/dist/esm/mediaFeatureFlags/mediaFeatureFlags.js +4 -4
- package/dist/esm/mediaFeatureFlags/productKeys.js +6 -8
- package/dist/esm/utils/helpers.js +23 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types.d.ts +2 -1
- package/dist/types/docs/index.d.ts +1 -0
- package/dist/types/docs/media-use-only.d.ts +5 -0
- package/dist/types/mediaFeatureFlags/types.d.ts +1 -1
- package/dist/types/utils/helpers.d.ts +1 -1
- package/package.json +3 -11
- package/report.api.md +68 -31
- package/dist/types-ts4.0/analytics/constants.d.ts +0 -1
- package/dist/types-ts4.0/analytics/index.d.ts +0 -3
- package/dist/types-ts4.0/analytics/types.d.ts +0 -80
- package/dist/types-ts4.0/analytics/withMediaAnalyticsContext.d.ts +0 -18
- package/dist/types-ts4.0/docs/index.d.ts +0 -1
- package/dist/types-ts4.0/docs/rxjs-notice.d.ts +0 -2
- package/dist/types-ts4.0/downloadUrl.d.ts +0 -4
- package/dist/types-ts4.0/index.d.ts +0 -19
- package/dist/types-ts4.0/mediaFeatureFlag-local.d.ts +0 -1
- package/dist/types-ts4.0/mediaFeatureFlags/index.d.ts +0 -2
- package/dist/types-ts4.0/mediaFeatureFlags/mediaFeatureFlags.d.ts +0 -26
- package/dist/types-ts4.0/mediaFeatureFlags/productKeys.d.ts +0 -2
- package/dist/types-ts4.0/mediaFeatureFlags/types.d.ts +0 -21
- package/dist/types-ts4.0/mediaTypeUtils/index.d.ts +0 -4
- package/dist/types-ts4.0/mediaTypeUtils/isArchive.d.ts +0 -1
- package/dist/types-ts4.0/mediaTypeUtils/isMimeTypeSupportedByBrowser.d.ts +0 -14
- package/dist/types-ts4.0/mediaTypeUtils/isMimeTypeSupportedByServer.d.ts +0 -6
- package/dist/types-ts4.0/utils/helpers.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/media-common
|
|
2
2
|
|
|
3
|
+
## 2.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2b3859896cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b3859896cc) - Added new Feature Flag to control internal Media Client behaviour
|
|
8
|
+
|
|
9
|
+
## 2.18.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`81573c1dfa7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/81573c1dfa7) - Items call creates a batched metadata trace Id
|
|
14
|
+
- [`0bccac57db6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0bccac57db6) - remove mediaUploadApiV2 Feature flag
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`a8eeb045e3a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a8eeb045e3a) - adding media only callouts to docs
|
|
19
|
+
- [`3d40d5e9b37`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d40d5e9b37) - Refactor traceId generator getRandomHex function to avoid id collision
|
|
20
|
+
- [`10480433c71`](https://bitbucket.org/atlassian/atlassian-frontend/commits/10480433c71) - Fix getRandomHex function to mitigate the issue of lacking digits in hex value.
|
|
21
|
+
|
|
3
22
|
## 2.17.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/cjs/docs/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "createMediaUseOnlyNotice", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _mediaUseOnly.createMediaUseOnlyNotice;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "createRxjsNotice", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function get() {
|
|
@@ -10,4 +16,6 @@ Object.defineProperty(exports, "createRxjsNotice", {
|
|
|
10
16
|
}
|
|
11
17
|
});
|
|
12
18
|
|
|
13
|
-
var _rxjsNotice = require("./rxjs-notice");
|
|
19
|
+
var _rxjsNotice = require("./rxjs-notice");
|
|
20
|
+
|
|
21
|
+
var _mediaUseOnly = require("./media-use-only");
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createMediaUseOnlyNotice = createMediaUseOnlyNotice;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _sectionMessage = _interopRequireDefault(require("@atlaskit/section-message"));
|
|
13
|
+
|
|
14
|
+
function AlternativePackagesMessage(_ref) {
|
|
15
|
+
var alternatePackages = _ref.alternatePackages;
|
|
16
|
+
|
|
17
|
+
if (!alternatePackages) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (alternatePackages.length === 1) {
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement("p", null, "Consider using", ' ', /*#__PURE__*/_react.default.createElement("a", {
|
|
23
|
+
href: alternatePackages[0].link
|
|
24
|
+
}, alternatePackages[0].name), ' ', "instead.");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement("p", null, "Consider using one of these packages instead:", /*#__PURE__*/_react.default.createElement("ul", null, alternatePackages.map(function (p) {
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
|
|
29
|
+
href: p.link
|
|
30
|
+
}, p.name));
|
|
31
|
+
})));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function createMediaUseOnlyNotice(componentName, alternatePackages) {
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_sectionMessage.default, {
|
|
36
|
+
title: "Internal Media Use Only",
|
|
37
|
+
appearance: "error"
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, componentName, " is intended for internal use by the Media Platform and as a transitive dependency of a media package within your product."), /*#__PURE__*/_react.default.createElement("p", null, "Direct use of this component is not supported."), /*#__PURE__*/_react.default.createElement(AlternativePackagesMessage, {
|
|
39
|
+
alternatePackages: alternatePackages
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
@@ -35,8 +35,8 @@ var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
|
|
|
35
35
|
folderUploads: ffA.folderUploads === ffB.folderUploads,
|
|
36
36
|
observedWidth: ffA.observedWidth === ffB.observedWidth,
|
|
37
37
|
timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging,
|
|
39
|
+
fetchFileStateAfterUpload: ffA.fetchFileStateAfterUpload === ffB.fetchFileStateAfterUpload
|
|
40
40
|
};
|
|
41
41
|
return Object.values(results).every(function (result) {
|
|
42
42
|
return result;
|
|
@@ -107,8 +107,8 @@ var defaultMediaFeatureFlags = {
|
|
|
107
107
|
folderUploads: false,
|
|
108
108
|
observedWidth: false,
|
|
109
109
|
timestampOnVideo: false,
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
memoryCacheLogging: false,
|
|
111
|
+
fetchFileStateAfterUpload: false
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
114
|
* Public accessor from components to fallback to defaults if flags not passed,
|
|
@@ -12,10 +12,9 @@ var productKeys = {
|
|
|
12
12
|
folderUploads: 'confluence.frontend.media.picker.folder.uploads',
|
|
13
13
|
//TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
|
|
14
14
|
observedWidth: '',
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging'
|
|
15
|
+
timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
|
|
16
|
+
memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging',
|
|
17
|
+
fetchFileStateAfterUpload: 'confluence-frontend-media-client-fetch-file-state-after-upload'
|
|
19
18
|
},
|
|
20
19
|
jira: {
|
|
21
20
|
newCardExperience: 'issue.details.media-cards-new-experience',
|
|
@@ -25,10 +24,9 @@ var productKeys = {
|
|
|
25
24
|
folderUploads: 'issue.details.media-picker-folder-upload',
|
|
26
25
|
//TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
|
|
27
26
|
observedWidth: '',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging'
|
|
27
|
+
timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
|
|
28
|
+
memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging',
|
|
29
|
+
fetchFileStateAfterUpload: 'jira-frontend-media-client-fetch-file-state-after-upload'
|
|
32
30
|
}
|
|
33
31
|
};
|
|
34
32
|
|
|
@@ -80,8 +80,28 @@ var matches = function matches(srcObj) {
|
|
|
80
80
|
|
|
81
81
|
exports.matches = matches;
|
|
82
82
|
|
|
83
|
-
function
|
|
84
|
-
return (0, _toConsumableArray2.default)(Array(
|
|
83
|
+
function getRandomHexValues(byte) {
|
|
84
|
+
return (0, _toConsumableArray2.default)(Array(byte * 2)).map(function () {
|
|
85
85
|
return Math.floor(Math.random() * 16).toString(16);
|
|
86
86
|
}).join('');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getRandomHex(byte) {
|
|
90
|
+
var _window;
|
|
91
|
+
|
|
92
|
+
var randomHex;
|
|
93
|
+
|
|
94
|
+
if ((_window = window) !== null && _window !== void 0 && _window.crypto) {
|
|
95
|
+
try {
|
|
96
|
+
randomHex = Array.from(window.crypto.getRandomValues(new Uint8Array(byte))).map(function (b) {
|
|
97
|
+
return b.toString(16).padStart(2, '0');
|
|
98
|
+
}).join('');
|
|
99
|
+
} catch (e) {
|
|
100
|
+
randomHex = getRandomHexValues(byte);
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
randomHex = getRandomHexValues(byte);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return randomHex;
|
|
87
107
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { createRxjsNotice } from './rxjs-notice';
|
|
1
|
+
export { createRxjsNotice } from './rxjs-notice';
|
|
2
|
+
export { createMediaUseOnlyNotice } from './media-use-only';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SectionMessage from '@atlaskit/section-message';
|
|
3
|
+
|
|
4
|
+
function AlternativePackagesMessage({
|
|
5
|
+
alternatePackages
|
|
6
|
+
}) {
|
|
7
|
+
if (!alternatePackages) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (alternatePackages.length === 1) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("p", null, "Consider using", ' ', /*#__PURE__*/React.createElement("a", {
|
|
13
|
+
href: alternatePackages[0].link
|
|
14
|
+
}, alternatePackages[0].name), ' ', "instead.");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement("p", null, "Consider using one of these packages instead:", /*#__PURE__*/React.createElement("ul", null, alternatePackages.map(p => /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
|
|
18
|
+
href: p.link
|
|
19
|
+
}, p.name)))));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function createMediaUseOnlyNotice(componentName, alternatePackages) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(SectionMessage, {
|
|
24
|
+
title: "Internal Media Use Only",
|
|
25
|
+
appearance: "error"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("p", null, componentName, " is intended for internal use by the Media Platform and as a transitive dependency of a media package within your product."), /*#__PURE__*/React.createElement("p", null, "Direct use of this component is not supported."), /*#__PURE__*/React.createElement(AlternativePackagesMessage, {
|
|
27
|
+
alternatePackages: alternatePackages
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
@@ -18,8 +18,8 @@ export const areEqualFeatureFlags = (ffA, ffB) => {
|
|
|
18
18
|
folderUploads: ffA.folderUploads === ffB.folderUploads,
|
|
19
19
|
observedWidth: ffA.observedWidth === ffB.observedWidth,
|
|
20
20
|
timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging,
|
|
22
|
+
fetchFileStateAfterUpload: ffA.fetchFileStateAfterUpload === ffB.fetchFileStateAfterUpload
|
|
23
23
|
};
|
|
24
24
|
return Object.values(results).every(result => result);
|
|
25
25
|
};
|
|
@@ -58,8 +58,8 @@ export const defaultMediaFeatureFlags = {
|
|
|
58
58
|
folderUploads: false,
|
|
59
59
|
observedWidth: false,
|
|
60
60
|
timestampOnVideo: false,
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
memoryCacheLogging: false,
|
|
62
|
+
fetchFileStateAfterUpload: false
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* Public accessor from components to fallback to defaults if flags not passed,
|
|
@@ -6,10 +6,9 @@ const productKeys = {
|
|
|
6
6
|
folderUploads: 'confluence.frontend.media.picker.folder.uploads',
|
|
7
7
|
//TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
|
|
8
8
|
observedWidth: '',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging'
|
|
9
|
+
timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
|
|
10
|
+
memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging',
|
|
11
|
+
fetchFileStateAfterUpload: 'confluence-frontend-media-client-fetch-file-state-after-upload'
|
|
13
12
|
},
|
|
14
13
|
jira: {
|
|
15
14
|
newCardExperience: 'issue.details.media-cards-new-experience',
|
|
@@ -19,10 +18,9 @@ const productKeys = {
|
|
|
19
18
|
folderUploads: 'issue.details.media-picker-folder-upload',
|
|
20
19
|
//TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
|
|
21
20
|
observedWidth: '',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging'
|
|
21
|
+
timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
|
|
22
|
+
memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging',
|
|
23
|
+
fetchFileStateAfterUpload: 'jira-frontend-media-client-fetch-file-state-after-upload'
|
|
26
24
|
}
|
|
27
25
|
};
|
|
28
26
|
export const getProductKeys = () => productKeys;
|
|
@@ -27,6 +27,25 @@ export const matches = srcObj => {
|
|
|
27
27
|
return true;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
|
|
31
|
+
function getRandomHexValues(byte) {
|
|
32
|
+
return [...Array(byte * 2)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getRandomHex(byte) {
|
|
36
|
+
var _window;
|
|
37
|
+
|
|
38
|
+
let randomHex;
|
|
39
|
+
|
|
40
|
+
if ((_window = window) !== null && _window !== void 0 && _window.crypto) {
|
|
41
|
+
try {
|
|
42
|
+
randomHex = Array.from(window.crypto.getRandomValues(new Uint8Array(byte))).map(b => b.toString(16).padStart(2, '0')).join('');
|
|
43
|
+
} catch (e) {
|
|
44
|
+
randomHex = getRandomHexValues(byte);
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
randomHex = getRandomHexValues(byte);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return randomHex;
|
|
32
51
|
}
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/docs/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { createRxjsNotice } from './rxjs-notice';
|
|
1
|
+
export { createRxjsNotice } from './rxjs-notice';
|
|
2
|
+
export { createMediaUseOnlyNotice } from './media-use-only';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SectionMessage from '@atlaskit/section-message';
|
|
3
|
+
|
|
4
|
+
function AlternativePackagesMessage(_ref) {
|
|
5
|
+
var alternatePackages = _ref.alternatePackages;
|
|
6
|
+
|
|
7
|
+
if (!alternatePackages) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (alternatePackages.length === 1) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("p", null, "Consider using", ' ', /*#__PURE__*/React.createElement("a", {
|
|
13
|
+
href: alternatePackages[0].link
|
|
14
|
+
}, alternatePackages[0].name), ' ', "instead.");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement("p", null, "Consider using one of these packages instead:", /*#__PURE__*/React.createElement("ul", null, alternatePackages.map(function (p) {
|
|
18
|
+
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
|
|
19
|
+
href: p.link
|
|
20
|
+
}, p.name));
|
|
21
|
+
})));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function createMediaUseOnlyNotice(componentName, alternatePackages) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(SectionMessage, {
|
|
26
|
+
title: "Internal Media Use Only",
|
|
27
|
+
appearance: "error"
|
|
28
|
+
}, /*#__PURE__*/React.createElement("p", null, componentName, " is intended for internal use by the Media Platform and as a transitive dependency of a media package within your product."), /*#__PURE__*/React.createElement("p", null, "Direct use of this component is not supported."), /*#__PURE__*/React.createElement(AlternativePackagesMessage, {
|
|
29
|
+
alternatePackages: alternatePackages
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
@@ -19,8 +19,8 @@ export var areEqualFeatureFlags = function areEqualFeatureFlags(ffA, ffB) {
|
|
|
19
19
|
folderUploads: ffA.folderUploads === ffB.folderUploads,
|
|
20
20
|
observedWidth: ffA.observedWidth === ffB.observedWidth,
|
|
21
21
|
timestampOnVideo: ffA.timestampOnVideo === ffB.timestampOnVideo,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
memoryCacheLogging: ffA.memoryCacheLogging === ffB.memoryCacheLogging,
|
|
23
|
+
fetchFileStateAfterUpload: ffA.fetchFileStateAfterUpload === ffB.fetchFileStateAfterUpload
|
|
24
24
|
};
|
|
25
25
|
return Object.values(results).every(function (result) {
|
|
26
26
|
return result;
|
|
@@ -80,8 +80,8 @@ export var defaultMediaFeatureFlags = {
|
|
|
80
80
|
folderUploads: false,
|
|
81
81
|
observedWidth: false,
|
|
82
82
|
timestampOnVideo: false,
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
memoryCacheLogging: false,
|
|
84
|
+
fetchFileStateAfterUpload: false
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* Public accessor from components to fallback to defaults if flags not passed,
|
|
@@ -6,10 +6,9 @@ var productKeys = {
|
|
|
6
6
|
folderUploads: 'confluence.frontend.media.picker.folder.uploads',
|
|
7
7
|
//TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
|
|
8
8
|
observedWidth: '',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging'
|
|
9
|
+
timestampOnVideo: 'confluence.frontend.media.timestamp.on.video',
|
|
10
|
+
memoryCacheLogging: 'confluence-frontend-media-card-memory-cache-logging',
|
|
11
|
+
fetchFileStateAfterUpload: 'confluence-frontend-media-client-fetch-file-state-after-upload'
|
|
13
12
|
},
|
|
14
13
|
jira: {
|
|
15
14
|
newCardExperience: 'issue.details.media-cards-new-experience',
|
|
@@ -19,10 +18,9 @@ var productKeys = {
|
|
|
19
18
|
folderUploads: 'issue.details.media-picker-folder-upload',
|
|
20
19
|
//TODO fill the value after https://product-fabric.atlassian.net/browse/MEX-1593
|
|
21
20
|
observedWidth: '',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging'
|
|
21
|
+
timestampOnVideo: 'issue.details.media-cards-timestamp-on-video',
|
|
22
|
+
memoryCacheLogging: 'jira-frontend-media-card-memory-cache-logging',
|
|
23
|
+
fetchFileStateAfterUpload: 'jira-frontend-media-client-fetch-file-state-after-upload'
|
|
26
24
|
}
|
|
27
25
|
};
|
|
28
26
|
export var getProductKeys = function getProductKeys() {
|
|
@@ -52,8 +52,29 @@ export var matches = function matches(srcObj) {
|
|
|
52
52
|
return true;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
|
|
56
|
+
function getRandomHexValues(byte) {
|
|
57
|
+
return _toConsumableArray(Array(byte * 2)).map(function () {
|
|
57
58
|
return Math.floor(Math.random() * 16).toString(16);
|
|
58
59
|
}).join('');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function getRandomHex(byte) {
|
|
63
|
+
var _window;
|
|
64
|
+
|
|
65
|
+
var randomHex;
|
|
66
|
+
|
|
67
|
+
if ((_window = window) !== null && _window !== void 0 && _window.crypto) {
|
|
68
|
+
try {
|
|
69
|
+
randomHex = Array.from(window.crypto.getRandomValues(new Uint8Array(byte))).map(function (b) {
|
|
70
|
+
return b.toString(16).padStart(2, '0');
|
|
71
|
+
}).join('');
|
|
72
|
+
} catch (e) {
|
|
73
|
+
randomHex = getRandomHexValues(byte);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
randomHex = getRandomHexValues(byte);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return randomHex;
|
|
59
80
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -33,6 +33,7 @@ export declare type WithPerformanceAttributes = {
|
|
|
33
33
|
};
|
|
34
34
|
export declare type WithTraceContext = {
|
|
35
35
|
traceContext?: MediaTraceContext;
|
|
36
|
+
metadataTraceContext?: MediaTraceContext;
|
|
36
37
|
};
|
|
37
38
|
export declare type SuccessAttributes = {
|
|
38
39
|
status: 'success';
|
|
@@ -45,7 +46,7 @@ export declare type FailureAttributes = {
|
|
|
45
46
|
errorDetail?: string;
|
|
46
47
|
};
|
|
47
48
|
export declare type StatusAttributes = SuccessAttributes | FailureAttributes;
|
|
48
|
-
export declare type OperationalAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes);
|
|
49
|
+
export declare type OperationalAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes & WithTraceContext);
|
|
49
50
|
export declare type OperationalEventPayload<Attributes extends OperationalAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
50
51
|
eventType: 'operational';
|
|
51
52
|
action: Action;
|
|
@@ -5,8 +5,8 @@ export interface MediaFeatureFlags {
|
|
|
5
5
|
folderUploads?: boolean;
|
|
6
6
|
observedWidth?: boolean;
|
|
7
7
|
timestampOnVideo?: boolean;
|
|
8
|
-
mediaUploadApiV2?: boolean;
|
|
9
8
|
memoryCacheLogging?: boolean;
|
|
9
|
+
fetchFileStateAfterUpload?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface WithMediaFeatureFlags {
|
|
12
12
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -7,4 +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 function getRandomHex(
|
|
10
|
+
export declare function getRandomHex(byte: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "Includes common utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.0 <4.5": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.0/*",
|
|
19
|
-
"dist/types-ts4.0/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": false,
|
|
24
16
|
"atlaskit:src": "src/index.ts",
|
|
25
17
|
"af:exports": {
|
|
@@ -41,7 +33,7 @@
|
|
|
41
33
|
"scripts": {},
|
|
42
34
|
"dependencies": {
|
|
43
35
|
"@atlaskit/analytics-gas-types": "^5.0.5",
|
|
44
|
-
"@atlaskit/analytics-namespaced-context": "^6.
|
|
36
|
+
"@atlaskit/analytics-namespaced-context": "^6.6.0",
|
|
45
37
|
"@atlaskit/analytics-next": "^8.1.1",
|
|
46
38
|
"@atlaskit/section-message": "^6.3.0",
|
|
47
39
|
"@babel/runtime": "^7.0.0"
|
|
@@ -52,7 +44,7 @@
|
|
|
52
44
|
},
|
|
53
45
|
"devDependencies": {
|
|
54
46
|
"@atlaskit/docs": "*",
|
|
55
|
-
"@atlaskit/media-test-helpers": "^30.
|
|
47
|
+
"@atlaskit/media-test-helpers": "^30.1.0",
|
|
56
48
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
57
49
|
"enzyme": "^3.10.0",
|
|
58
50
|
"react": "^16.8.0",
|
package/report.api.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/media-common"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
13
|
+
### Main Entry Types
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
16
|
|
|
11
17
|
```ts
|
|
12
18
|
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
@@ -79,11 +85,11 @@ export type FileAttributes = {
|
|
|
79
85
|
|
|
80
86
|
// @public (undocumented)
|
|
81
87
|
export type FileStatus =
|
|
82
|
-
| 'uploading'
|
|
83
|
-
| 'processing'
|
|
84
|
-
| 'processed'
|
|
85
88
|
| 'error'
|
|
86
|
-
| 'failed-processing'
|
|
89
|
+
| 'failed-processing'
|
|
90
|
+
| 'processed'
|
|
91
|
+
| 'processing'
|
|
92
|
+
| 'uploading';
|
|
87
93
|
|
|
88
94
|
// @public
|
|
89
95
|
export const filterFeatureFlagKeysAllProducts: (
|
|
@@ -104,6 +110,9 @@ export function getMediaFeatureFlag<T = boolean>(
|
|
|
104
110
|
// @public (undocumented)
|
|
105
111
|
export const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
|
|
106
112
|
|
|
113
|
+
// @public (undocumented)
|
|
114
|
+
export function getRandomHex(byte: number): string;
|
|
115
|
+
|
|
107
116
|
// @public (undocumented)
|
|
108
117
|
export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
109
118
|
|
|
@@ -144,12 +153,12 @@ export interface MediaFeatureFlags {
|
|
|
144
153
|
// (undocumented)
|
|
145
154
|
captions?: boolean;
|
|
146
155
|
// (undocumented)
|
|
156
|
+
fetchFileStateAfterUpload?: boolean;
|
|
157
|
+
// (undocumented)
|
|
147
158
|
folderUploads?: boolean;
|
|
148
159
|
// (undocumented)
|
|
149
160
|
mediaInline?: boolean;
|
|
150
161
|
// (undocumented)
|
|
151
|
-
mediaUploadApiV2?: boolean;
|
|
152
|
-
// (undocumented)
|
|
153
162
|
memoryCacheLogging?: boolean;
|
|
154
163
|
// (undocumented)
|
|
155
164
|
newCardExperience?: boolean;
|
|
@@ -159,14 +168,20 @@ export interface MediaFeatureFlags {
|
|
|
159
168
|
timestampOnVideo?: boolean;
|
|
160
169
|
}
|
|
161
170
|
|
|
171
|
+
// @public (undocumented)
|
|
172
|
+
export type MediaTraceContext = {
|
|
173
|
+
traceId: string;
|
|
174
|
+
spanId?: string;
|
|
175
|
+
};
|
|
176
|
+
|
|
162
177
|
// @public (undocumented)
|
|
163
178
|
export type MediaType =
|
|
164
|
-
| '
|
|
179
|
+
| 'archive'
|
|
165
180
|
| 'audio'
|
|
166
|
-
| '
|
|
181
|
+
| 'doc'
|
|
167
182
|
| 'image'
|
|
168
|
-
| '
|
|
169
|
-
| '
|
|
183
|
+
| 'unknown'
|
|
184
|
+
| 'video';
|
|
170
185
|
|
|
171
186
|
// @public (undocumented)
|
|
172
187
|
export interface NumericalCardDimensions {
|
|
@@ -186,20 +201,21 @@ export const omitBy: (
|
|
|
186
201
|
|
|
187
202
|
// @public (undocumented)
|
|
188
203
|
export type OperationalAttributes =
|
|
189
|
-
| BaseAttributes
|
|
190
|
-
| (BaseAttributes & WithFileAttributes)
|
|
191
|
-
| (BaseAttributes & WithFileAttributes & StatusAttributes)
|
|
192
204
|
| (BaseAttributes &
|
|
193
205
|
WithFileAttributes &
|
|
194
206
|
StatusAttributes &
|
|
195
|
-
WithPerformanceAttributes
|
|
207
|
+
WithPerformanceAttributes &
|
|
208
|
+
WithTraceContext)
|
|
209
|
+
| (BaseAttributes & WithFileAttributes & StatusAttributes)
|
|
210
|
+
| (BaseAttributes & WithFileAttributes)
|
|
211
|
+
| BaseAttributes;
|
|
196
212
|
|
|
197
213
|
// @public (undocumented)
|
|
198
214
|
export type OperationalEventPayload<
|
|
199
215
|
Attributes extends OperationalAttributes,
|
|
200
216
|
Action extends string,
|
|
201
217
|
ActionSubject extends string,
|
|
202
|
-
ActionSubjectId extends string = string
|
|
218
|
+
ActionSubjectId extends string = string,
|
|
203
219
|
> = BaseEventPayload<Attributes> & {
|
|
204
220
|
eventType: 'operational';
|
|
205
221
|
action: Action;
|
|
@@ -239,13 +255,13 @@ type RequiredMediaFeatureFlags = Record<
|
|
|
239
255
|
|
|
240
256
|
// @public (undocumented)
|
|
241
257
|
export type ScreenAttributes =
|
|
242
|
-
| BaseAttributes
|
|
243
|
-
|
|
|
258
|
+
| (BaseAttributes & WithFileAttributes)
|
|
259
|
+
| BaseAttributes;
|
|
244
260
|
|
|
245
261
|
// @public (undocumented)
|
|
246
262
|
export type ScreenEventPayload<
|
|
247
263
|
Attributes extends ScreenAttributes,
|
|
248
|
-
ActionSubject extends string
|
|
264
|
+
ActionSubject extends string,
|
|
249
265
|
> = BaseEventPayload<Attributes> & {
|
|
250
266
|
eventType: 'screen';
|
|
251
267
|
actionSubject: ActionSubject;
|
|
@@ -256,7 +272,7 @@ export type ScreenEventPayload<
|
|
|
256
272
|
export type SSR = 'client' | 'server';
|
|
257
273
|
|
|
258
274
|
// @public (undocumented)
|
|
259
|
-
type StatusAttributes =
|
|
275
|
+
type StatusAttributes = FailureAttributes | SuccessAttributes;
|
|
260
276
|
|
|
261
277
|
// @public (undocumented)
|
|
262
278
|
export type SuccessAttributes = {
|
|
@@ -266,15 +282,15 @@ export type SuccessAttributes = {
|
|
|
266
282
|
|
|
267
283
|
// @public (undocumented)
|
|
268
284
|
export type TrackAttributes =
|
|
269
|
-
| BaseAttributes
|
|
270
|
-
|
|
|
285
|
+
| (BaseAttributes & WithFileAttributes)
|
|
286
|
+
| BaseAttributes;
|
|
271
287
|
|
|
272
288
|
// @public (undocumented)
|
|
273
289
|
export type TrackEventPayload<
|
|
274
290
|
Attributes extends TrackAttributes,
|
|
275
291
|
Action extends string,
|
|
276
292
|
ActionSubject extends string,
|
|
277
|
-
ActionSubjectId extends string = string
|
|
293
|
+
ActionSubjectId extends string = string,
|
|
278
294
|
> = BaseEventPayload<Attributes> & {
|
|
279
295
|
eventType: 'track';
|
|
280
296
|
action: Action;
|
|
@@ -284,14 +300,14 @@ export type TrackEventPayload<
|
|
|
284
300
|
|
|
285
301
|
// @public (undocumented)
|
|
286
302
|
export type UIAttributes =
|
|
287
|
-
| BaseAttributes
|
|
288
|
-
|
|
|
303
|
+
| (BaseAttributes & WithFileAttributes)
|
|
304
|
+
| BaseAttributes;
|
|
289
305
|
|
|
290
306
|
// @public (undocumented)
|
|
291
307
|
export type UIEventPayload<
|
|
292
308
|
Attributes extends UIAttributes,
|
|
293
309
|
Action extends string,
|
|
294
|
-
ActionSubject extends string
|
|
310
|
+
ActionSubject extends string,
|
|
295
311
|
> = BaseEventPayload<Attributes> & {
|
|
296
312
|
eventType: 'ui';
|
|
297
313
|
action: Action;
|
|
@@ -317,7 +333,7 @@ export const withMediaAnalyticsContext: (
|
|
|
317
333
|
},
|
|
318
334
|
) => <
|
|
319
335
|
Props extends WithMediaFeatureFlags,
|
|
320
|
-
Component extends React_2.ComponentType<Props
|
|
336
|
+
Component extends React_2.ComponentType<Props>,
|
|
321
337
|
>(
|
|
322
338
|
WrappedComponent: React_2.JSXElementConstructor<Props> & Component,
|
|
323
339
|
) => React_2.ForwardRefExoticComponent<
|
|
@@ -336,5 +352,26 @@ export type WithPerformanceAttributes = {
|
|
|
336
352
|
performanceAttributes?: PerformanceAttributes;
|
|
337
353
|
};
|
|
338
354
|
|
|
355
|
+
// @public (undocumented)
|
|
356
|
+
export type WithTraceContext = {
|
|
357
|
+
traceContext?: MediaTraceContext;
|
|
358
|
+
metadataTraceContext?: MediaTraceContext;
|
|
359
|
+
};
|
|
360
|
+
|
|
339
361
|
// (No @packageDocumentation comment for this package)
|
|
340
362
|
```
|
|
363
|
+
|
|
364
|
+
<!--SECTION END: Main Entry Types-->
|
|
365
|
+
|
|
366
|
+
### Peer Dependencies
|
|
367
|
+
|
|
368
|
+
<!--SECTION START: Peer Dependencies-->
|
|
369
|
+
|
|
370
|
+
```json
|
|
371
|
+
{
|
|
372
|
+
"react": "^16.8.0",
|
|
373
|
+
"react-dom": "^16.8.0"
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ANALYTICS_MEDIA_CHANNEL = "media";
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type { PackageAttributes, WithFileAttributes, FileAttributes, SuccessAttributes, FailureAttributes, OperationalAttributes, OperationalEventPayload, UIAttributes, UIEventPayload, ScreenAttributes, ScreenEventPayload, TrackAttributes, TrackEventPayload, ContextPublicAttributes, ContextStaticProps, } from './types';
|
|
2
|
-
export { withMediaAnalyticsContext } from './withMediaAnalyticsContext';
|
|
3
|
-
export { ANALYTICS_MEDIA_CHANNEL } from './constants';
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
2
|
-
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
3
|
-
import { MediaType, FileStatus, WithMediaFeatureFlags, MediaTraceContext } from '..';
|
|
4
|
-
export declare type BaseAttributes = {};
|
|
5
|
-
export declare type PackageAttributes = {
|
|
6
|
-
packageName: string;
|
|
7
|
-
packageVersion: string;
|
|
8
|
-
componentName: string;
|
|
9
|
-
component: string;
|
|
10
|
-
};
|
|
11
|
-
export declare type BaseEventPayload<Attributes extends BaseAttributes> = Omit<GasCorePayload, 'attributes'> & {
|
|
12
|
-
attributes: Attributes;
|
|
13
|
-
};
|
|
14
|
-
export declare type FileAttributes = {
|
|
15
|
-
fileId: string;
|
|
16
|
-
fileSize?: number;
|
|
17
|
-
fileMediatype?: MediaType;
|
|
18
|
-
fileMimetype?: string;
|
|
19
|
-
fileSource?: string;
|
|
20
|
-
fileStatus?: FileStatus;
|
|
21
|
-
};
|
|
22
|
-
export declare type PerformanceAttributes = {
|
|
23
|
-
overall: {
|
|
24
|
-
durationSincePageStart: number;
|
|
25
|
-
durationSinceCommenced?: number;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export declare type WithFileAttributes = {
|
|
29
|
-
fileAttributes: FileAttributes;
|
|
30
|
-
};
|
|
31
|
-
export declare type WithPerformanceAttributes = {
|
|
32
|
-
performanceAttributes?: PerformanceAttributes;
|
|
33
|
-
};
|
|
34
|
-
export declare type WithTraceContext = {
|
|
35
|
-
traceContext?: MediaTraceContext;
|
|
36
|
-
};
|
|
37
|
-
export declare type SuccessAttributes = {
|
|
38
|
-
status: 'success';
|
|
39
|
-
fileMediatype?: MediaType;
|
|
40
|
-
};
|
|
41
|
-
export declare type FailureAttributes = {
|
|
42
|
-
status: 'fail';
|
|
43
|
-
failReason: string;
|
|
44
|
-
error?: string;
|
|
45
|
-
errorDetail?: string;
|
|
46
|
-
};
|
|
47
|
-
export declare type StatusAttributes = SuccessAttributes | FailureAttributes;
|
|
48
|
-
export declare type OperationalAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes);
|
|
49
|
-
export declare type OperationalEventPayload<Attributes extends OperationalAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
50
|
-
eventType: 'operational';
|
|
51
|
-
action: Action;
|
|
52
|
-
actionSubject: ActionSubject;
|
|
53
|
-
actionSubjectId?: ActionSubjectId;
|
|
54
|
-
};
|
|
55
|
-
export declare type UIAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
56
|
-
export declare type UIEventPayload<Attributes extends UIAttributes, Action extends string, ActionSubject extends string> = BaseEventPayload<Attributes> & {
|
|
57
|
-
eventType: 'ui';
|
|
58
|
-
action: Action;
|
|
59
|
-
actionSubject: ActionSubject;
|
|
60
|
-
actionSubjectId?: string;
|
|
61
|
-
};
|
|
62
|
-
export declare type ScreenAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
63
|
-
export declare type ScreenEventPayload<Attributes extends ScreenAttributes, ActionSubject extends string> = BaseEventPayload<Attributes> & {
|
|
64
|
-
eventType: 'screen';
|
|
65
|
-
actionSubject: ActionSubject;
|
|
66
|
-
name: ActionSubject;
|
|
67
|
-
};
|
|
68
|
-
export declare type TrackAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
69
|
-
export declare type TrackEventPayload<Attributes extends TrackAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
70
|
-
eventType: 'track';
|
|
71
|
-
action: Action;
|
|
72
|
-
actionSubject: ActionSubject;
|
|
73
|
-
actionSubjectId?: ActionSubjectId;
|
|
74
|
-
};
|
|
75
|
-
export declare type ContextPublicAttributes = PackageAttributes;
|
|
76
|
-
export declare type ContextPrivateAttributes = WithMediaFeatureFlags;
|
|
77
|
-
export declare type ContextStaticProps = WithMediaFeatureFlags;
|
|
78
|
-
export declare type ContextData = ContextPublicAttributes & {
|
|
79
|
-
[MEDIA_CONTEXT]: ContextPrivateAttributes;
|
|
80
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MediaFeatureFlags } from '../mediaFeatureFlags';
|
|
3
|
-
import { ContextPublicAttributes } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* HOC for attaching MediaAnalyticsContext to a top-level React Component.
|
|
6
|
-
*
|
|
7
|
-
* Similar than "packages/analytics/analytics-next/src/hocs/withAnalyticsContext.tsx",
|
|
8
|
-
* except that we restrict attributes put in this context using ContextPublicAttributes and ContextPrivateAttributes.
|
|
9
|
-
*
|
|
10
|
-
* As a constraint, the wrapped React Component's props must extend ContextStaticProps.
|
|
11
|
-
*
|
|
12
|
-
* @param {ContextPublicAttributes} attributes public attributes to put in context
|
|
13
|
-
*
|
|
14
|
-
* @see packages/analytics/analytics-next/src/hocs/withAnalyticsContext.tsx
|
|
15
|
-
*/
|
|
16
|
-
export declare const withMediaAnalyticsContext: (contextPublicAttributes: ContextPublicAttributes, options?: {
|
|
17
|
-
filterFeatureFlags?: Array<keyof MediaFeatureFlags>;
|
|
18
|
-
}) => <Props extends import("../mediaFeatureFlags").WithMediaFeatureFlags, Component extends React.ComponentType<Props>>(WrappedComponent: React.JSXElementConstructor<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props>> & React.RefAttributes<any>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createRxjsNotice } from './rxjs-notice';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { downloadUrl } from './downloadUrl';
|
|
2
|
-
export declare type MediaType = 'doc' | 'audio' | 'video' | 'image' | 'archive' | 'unknown';
|
|
3
|
-
export declare type FileStatus = 'uploading' | 'processing' | 'processed' | 'error' | 'failed-processing';
|
|
4
|
-
export { getMediaFeatureFlag, defaultMediaFeatureFlags, areEqualFeatureFlags, useMemoizeFeatureFlags, filterFeatureFlagNames, filterFeatureFlagKeysAllProducts, } from './mediaFeatureFlags';
|
|
5
|
-
export type { MediaFeatureFlags, WithMediaFeatureFlags, } from './mediaFeatureFlags';
|
|
6
|
-
export interface NumericalCardDimensions {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}
|
|
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
|
-
export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext';
|
|
12
|
-
export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
|
|
13
|
-
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
|
|
14
|
-
export declare type SSR = 'client' | 'server';
|
|
15
|
-
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex, } from './utils/helpers';
|
|
16
|
-
export declare type MediaTraceContext = {
|
|
17
|
-
traceId: string;
|
|
18
|
-
spanId?: string;
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getLocalMediaFeatureFlag: (key: string) => string | null;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { getMediaFeatureFlag, useMemoizeFeatureFlags, defaultMediaFeatureFlags, areEqualFeatureFlags, filterFeatureFlagNames, filterFeatureFlagKeysAllProducts, } from './mediaFeatureFlags';
|
|
2
|
-
export type { MediaFeatureFlags, WithMediaFeatureFlags, SupportedProduct, } from './types';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { RequiredMediaFeatureFlags, MediaFeatureFlags, SupportedProduct } from './types';
|
|
2
|
-
export declare const areEqualFeatureFlags: (ffA?: MediaFeatureFlags | undefined, ffB?: MediaFeatureFlags | undefined) => boolean;
|
|
3
|
-
export declare const filterFeatureFlagNames: (flags: RequiredMediaFeatureFlags) => Array<keyof MediaFeatureFlags>;
|
|
4
|
-
/**
|
|
5
|
-
* Takes a record of {Media Feature Flag Names → boolean} and a supported product name.
|
|
6
|
-
* Returns the corresponding product’s Launch Darkly Keys for each of the flags set as true in the input record.
|
|
7
|
-
* */
|
|
8
|
-
export declare const mapAndFilterFeatureFlagNames: (flags: RequiredMediaFeatureFlags, product: SupportedProduct) => Array<string>;
|
|
9
|
-
/**
|
|
10
|
-
* Takes a record of {Media Feature Flag Names → boolean}.
|
|
11
|
-
* Returns the Launch Darkly Keys from all products for each of the flags set as true in the input record.
|
|
12
|
-
* */
|
|
13
|
-
export declare const filterFeatureFlagKeysAllProducts: (flags: RequiredMediaFeatureFlags) => Array<string>;
|
|
14
|
-
export declare const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
|
|
15
|
-
/**
|
|
16
|
-
* Public accessor from components to fallback to defaults if flags not passed,
|
|
17
|
-
* otherwise whatever product has set will be returned.
|
|
18
|
-
*
|
|
19
|
-
* To override locally for testing:
|
|
20
|
-
* - `localStorage[flagName] = true` to enable locally,
|
|
21
|
-
* - `delete localStorage[flagName]` to remove.
|
|
22
|
-
*
|
|
23
|
-
* (you will see a warning in console if override used)
|
|
24
|
-
* */
|
|
25
|
-
export declare function getMediaFeatureFlag<T = boolean>(flagName: keyof MediaFeatureFlags, featureFlags?: MediaFeatureFlags): T;
|
|
26
|
-
export declare const useMemoizeFeatureFlags: (featureFlags?: MediaFeatureFlags | undefined) => MediaFeatureFlags | undefined;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface MediaFeatureFlags {
|
|
2
|
-
newCardExperience?: boolean;
|
|
3
|
-
captions?: boolean;
|
|
4
|
-
mediaInline?: boolean;
|
|
5
|
-
folderUploads?: boolean;
|
|
6
|
-
observedWidth?: boolean;
|
|
7
|
-
timestampOnVideo?: boolean;
|
|
8
|
-
mediaUploadApiV2?: boolean;
|
|
9
|
-
memoryCacheLogging?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface WithMediaFeatureFlags {
|
|
12
|
-
featureFlags?: MediaFeatureFlags;
|
|
13
|
-
}
|
|
14
|
-
export declare type RequiredMediaFeatureFlags = Record<keyof Required<MediaFeatureFlags>, boolean>;
|
|
15
|
-
export declare type MediaFeatureFlagsMap = Record<keyof Required<MediaFeatureFlags>, string>;
|
|
16
|
-
export declare const supportedProducts: readonly [
|
|
17
|
-
"confluence",
|
|
18
|
-
"jira"
|
|
19
|
-
];
|
|
20
|
-
export declare type SupportedProduct = typeof supportedProducts[number];
|
|
21
|
-
export declare type ProductKeys = Record<SupportedProduct, MediaFeatureFlagsMap>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { MediaType } from '..';
|
|
2
|
-
export { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, } from './isMimeTypeSupportedByBrowser';
|
|
3
|
-
export { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './isMimeTypeSupportedByServer';
|
|
4
|
-
export declare const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isArchive: (mimeType: string) => boolean;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
2
|
-
export declare const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
3
|
-
export declare const isAudioMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
4
|
-
/**
|
|
5
|
-
* For backward compatilbity, we assume MP4/MOV is natively supported.
|
|
6
|
-
* TODO: Improve detection of supported video formats by the browser.
|
|
7
|
-
*
|
|
8
|
-
* See related tickets:
|
|
9
|
-
* - https://product-fabric.atlassian.net/browse/MPT-477
|
|
10
|
-
* - https://product-fabric.atlassian.net/browse/EDM-634
|
|
11
|
-
* - https://product-fabric.atlassian.net/browse/EDM-426
|
|
12
|
-
*/
|
|
13
|
-
export declare const isVideoMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
14
|
-
export declare const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
2
|
-
export declare const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
3
|
-
export declare const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
4
|
-
export declare const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
5
|
-
export declare const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
6
|
-
export declare const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const isUndefined: (value: any) => boolean;
|
|
2
|
-
export declare const pick: (obj?: Object | undefined, keys?: Array<String>) => {
|
|
3
|
-
[k: string]: any;
|
|
4
|
-
};
|
|
5
|
-
export declare const omitBy: (obj: Object, predicate: Function) => {
|
|
6
|
-
[k: string]: any;
|
|
7
|
-
};
|
|
8
|
-
export declare const debounce: (func: Function, wait: number) => (...args: any[]) => void;
|
|
9
|
-
export declare const matches: (srcObj: Object) => (obj: Object) => boolean;
|
|
10
|
-
export declare function getRandomHex(size: number): string;
|