@atlaskit/media-common 4.0.0 → 4.1.1
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 +16 -0
- package/analytics/package.json +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/types.js +15 -1
- package/dist/es2019/index.js +5 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/types.js +15 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types.d.ts +23 -23
- package/dist/types/downloadUrl.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/mediaFeatureFlags/mediaFeatureFlags.d.ts +2 -2
- package/dist/types/mediaFeatureFlags/types.d.ts +4 -4
- package/dist/types/utils/helpers.d.ts +1 -1
- package/downloadUrl/package.json +2 -2
- package/mediaFeatureFlags/package.json +2 -2
- package/mediaTypeUtils/package.json +2 -2
- package/package.json +15 -7
- package/example-helpers/styled.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/media-common
|
|
2
2
|
|
|
3
|
+
## 4.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
8
|
+
|
|
9
|
+
## 4.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 4.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
package/analytics/package.json
CHANGED
package/dist/cjs/version.json
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
1
|
+
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
2
|
+
|
|
3
|
+
// Base Media Analytics Event Shape
|
|
4
|
+
|
|
5
|
+
// Base Attributes ...
|
|
6
|
+
|
|
7
|
+
// Operational Events ...
|
|
8
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329315/Operational+Events
|
|
9
|
+
// UI Events ...
|
|
10
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329336/UI+Events
|
|
11
|
+
// Screen Events ...
|
|
12
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329341/Screen+Events
|
|
13
|
+
// Track Events ...
|
|
14
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329319/Track+Events
|
|
15
|
+
// Media Analytics Context Types
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export { downloadUrl } from './downloadUrl';
|
|
2
2
|
// Warning! You can't add new media types!
|
|
3
3
|
// See packages/media/media-core/src/__tests__/cache-backward-compatibility.spec.ts
|
|
4
|
-
|
|
5
4
|
// Media Feature Flags
|
|
6
5
|
export { getMediaFeatureFlag, defaultMediaFeatureFlags, areEqualFeatureFlags, useMemoizeFeatureFlags, filterFeatureFlagNames, getFeatureFlagKeysAllProducts } from './mediaFeatureFlags';
|
|
6
|
+
|
|
7
|
+
// TODO EDM-689 Please, consolidate these two CardDimensions types
|
|
8
|
+
|
|
9
|
+
// Analytics base types
|
|
10
|
+
|
|
7
11
|
// Analytics context
|
|
8
12
|
export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext';
|
|
9
13
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
1
|
+
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
2
|
+
|
|
3
|
+
// Base Media Analytics Event Shape
|
|
4
|
+
|
|
5
|
+
// Base Attributes ...
|
|
6
|
+
|
|
7
|
+
// Operational Events ...
|
|
8
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329315/Operational+Events
|
|
9
|
+
// UI Events ...
|
|
10
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329336/UI+Events
|
|
11
|
+
// Screen Events ...
|
|
12
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329341/Screen+Events
|
|
13
|
+
// Track Events ...
|
|
14
|
+
// https://hello.atlassian.net/wiki/spaces/MEASURE/pages/134329319/Track+Events
|
|
15
|
+
// Media Analytics Context Types
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export { downloadUrl } from './downloadUrl';
|
|
2
2
|
// Warning! You can't add new media types!
|
|
3
3
|
// See packages/media/media-core/src/__tests__/cache-backward-compatibility.spec.ts
|
|
4
|
-
|
|
5
4
|
// Media Feature Flags
|
|
6
5
|
export { getMediaFeatureFlag, defaultMediaFeatureFlags, areEqualFeatureFlags, useMemoizeFeatureFlags, filterFeatureFlagNames, getFeatureFlagKeysAllProducts } from './mediaFeatureFlags';
|
|
6
|
+
|
|
7
|
+
// TODO EDM-689 Please, consolidate these two CardDimensions types
|
|
8
|
+
|
|
9
|
+
// Analytics base types
|
|
10
|
+
|
|
7
11
|
// Analytics context
|
|
8
12
|
export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext';
|
|
9
13
|
|
package/dist/esm/version.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { GasCorePayload } from '@atlaskit/analytics-gas-types';
|
|
2
2
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext';
|
|
3
3
|
import { MediaType, FileStatus, WithMediaFeatureFlags, MediaTraceContext } from '..';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type BaseAttributes = {};
|
|
5
|
+
export type PackageAttributes = {
|
|
6
6
|
packageName: string;
|
|
7
7
|
packageVersion: string;
|
|
8
8
|
componentName: string;
|
|
9
9
|
component: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type BaseEventPayload<Attributes extends BaseAttributes> = Omit<GasCorePayload, 'attributes'> & {
|
|
12
12
|
attributes: Attributes;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type FileAttributes = {
|
|
15
15
|
fileId: string;
|
|
16
16
|
fileSize?: number;
|
|
17
17
|
fileMediatype?: MediaType;
|
|
@@ -19,63 +19,63 @@ export declare type FileAttributes = {
|
|
|
19
19
|
fileSource?: string;
|
|
20
20
|
fileStatus?: FileStatus;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type PerformanceAttributes = {
|
|
23
23
|
overall: {
|
|
24
24
|
durationSincePageStart: number;
|
|
25
25
|
durationSinceCommenced?: number;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type WithFileAttributes = {
|
|
29
29
|
fileAttributes: FileAttributes;
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type WithPerformanceAttributes = {
|
|
32
32
|
performanceAttributes?: PerformanceAttributes;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type WithTraceContext = {
|
|
35
35
|
traceContext?: MediaTraceContext;
|
|
36
36
|
metadataTraceContext?: MediaTraceContext;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type SuccessAttributes = {
|
|
39
39
|
status: 'success';
|
|
40
40
|
fileMediatype?: MediaType;
|
|
41
41
|
};
|
|
42
|
-
export
|
|
42
|
+
export type FailureAttributes = {
|
|
43
43
|
status: 'fail';
|
|
44
44
|
failReason: string;
|
|
45
45
|
error?: string;
|
|
46
46
|
errorDetail?: string;
|
|
47
47
|
};
|
|
48
|
-
export
|
|
49
|
-
export
|
|
50
|
-
export
|
|
48
|
+
export type StatusAttributes = SuccessAttributes | FailureAttributes;
|
|
49
|
+
export type OperationalAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes & WithTraceContext);
|
|
50
|
+
export type OperationalEventPayload<Attributes extends OperationalAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
51
51
|
eventType: 'operational';
|
|
52
52
|
action: Action;
|
|
53
53
|
actionSubject: ActionSubject;
|
|
54
54
|
actionSubjectId?: ActionSubjectId;
|
|
55
55
|
};
|
|
56
|
-
export
|
|
57
|
-
export
|
|
56
|
+
export type UIAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
57
|
+
export type UIEventPayload<Attributes extends UIAttributes, Action extends string, ActionSubject extends string> = BaseEventPayload<Attributes> & {
|
|
58
58
|
eventType: 'ui';
|
|
59
59
|
action: Action;
|
|
60
60
|
actionSubject: ActionSubject;
|
|
61
61
|
actionSubjectId?: string;
|
|
62
62
|
};
|
|
63
|
-
export
|
|
64
|
-
export
|
|
63
|
+
export type ScreenAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
64
|
+
export type ScreenEventPayload<Attributes extends ScreenAttributes, ActionSubject extends string> = BaseEventPayload<Attributes> & {
|
|
65
65
|
eventType: 'screen';
|
|
66
66
|
actionSubject: ActionSubject;
|
|
67
67
|
name: ActionSubject;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
70
|
-
export
|
|
69
|
+
export type TrackAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes);
|
|
70
|
+
export type TrackEventPayload<Attributes extends TrackAttributes, Action extends string, ActionSubject extends string, ActionSubjectId extends string = string> = BaseEventPayload<Attributes> & {
|
|
71
71
|
eventType: 'track';
|
|
72
72
|
action: Action;
|
|
73
73
|
actionSubject: ActionSubject;
|
|
74
74
|
actionSubjectId?: ActionSubjectId;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
77
|
-
export
|
|
78
|
-
export
|
|
79
|
-
export
|
|
76
|
+
export type ContextPublicAttributes = PackageAttributes;
|
|
77
|
+
export type ContextPrivateAttributes = WithMediaFeatureFlags;
|
|
78
|
+
export type ContextStaticProps = WithMediaFeatureFlags;
|
|
79
|
+
export type ContextData = ContextPublicAttributes & {
|
|
80
80
|
[MEDIA_CONTEXT]: ContextPrivateAttributes;
|
|
81
81
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { downloadUrl } from './downloadUrl';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type MediaType = 'doc' | 'audio' | 'video' | 'image' | 'archive' | 'unknown';
|
|
3
|
+
export type FileStatus = 'uploading' | 'processing' | 'processed' | 'error' | 'failed-processing';
|
|
4
4
|
export { getMediaFeatureFlag, defaultMediaFeatureFlags, areEqualFeatureFlags, useMemoizeFeatureFlags, filterFeatureFlagNames, getFeatureFlagKeysAllProducts, } from './mediaFeatureFlags';
|
|
5
5
|
export type { MediaFeatureFlags, WithMediaFeatureFlags, } from './mediaFeatureFlags';
|
|
6
6
|
export interface NumericalCardDimensions {
|
|
@@ -11,9 +11,9 @@ export type { PackageAttributes, WithFileAttributes, WithPerformanceAttributes,
|
|
|
11
11
|
export { withMediaAnalyticsContext } from './analytics/withMediaAnalyticsContext';
|
|
12
12
|
export { ANALYTICS_MEDIA_CHANNEL } from './analytics/constants';
|
|
13
13
|
export { getMediaTypeFromMimeType, isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './mediaTypeUtils';
|
|
14
|
-
export
|
|
14
|
+
export type SSR = 'client' | 'server';
|
|
15
15
|
export { isUndefined, pick, omitBy, debounce, matches, getRandomHex, } from './utils/helpers';
|
|
16
|
-
export
|
|
16
|
+
export type MediaTraceContext = {
|
|
17
17
|
traceId: string;
|
|
18
18
|
spanId?: string;
|
|
19
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequiredMediaFeatureFlags, MediaFeatureFlags } from './types';
|
|
2
|
-
export declare const areEqualFeatureFlags: (ffA?: MediaFeatureFlags
|
|
2
|
+
export declare const areEqualFeatureFlags: (ffA?: MediaFeatureFlags, ffB?: MediaFeatureFlags) => boolean;
|
|
3
3
|
export declare const filterFeatureFlagNames: (flags: RequiredMediaFeatureFlags) => Array<keyof MediaFeatureFlags>;
|
|
4
4
|
/**
|
|
5
5
|
* Takes a record of {Media Feature Flag Names → boolean}.
|
|
@@ -29,4 +29,4 @@ export declare const defaultMediaFeatureFlags: Required<MediaFeatureFlags>;
|
|
|
29
29
|
* (you will see a warning in console if override used)
|
|
30
30
|
* */
|
|
31
31
|
export declare function getMediaFeatureFlag<T = boolean>(flagName: keyof MediaFeatureFlags, featureFlags?: MediaFeatureFlags): T;
|
|
32
|
-
export declare const useMemoizeFeatureFlags: (featureFlags?: MediaFeatureFlags
|
|
32
|
+
export declare const useMemoizeFeatureFlags: (featureFlags?: MediaFeatureFlags) => MediaFeatureFlags | undefined;
|
|
@@ -11,8 +11,8 @@ export interface MediaFeatureFlags {
|
|
|
11
11
|
export interface WithMediaFeatureFlags {
|
|
12
12
|
featureFlags?: MediaFeatureFlags;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type RequiredMediaFeatureFlags = Record<keyof Required<MediaFeatureFlags>, boolean>;
|
|
15
|
+
export type MediaFeatureFlagsMap = Record<keyof Required<MediaFeatureFlags>, string>;
|
|
16
16
|
export declare const supportedProducts: readonly ["confluence", "jira"];
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type SupportedProduct = (typeof supportedProducts)[number];
|
|
18
|
+
export type ProductKeys = Record<SupportedProduct, MediaFeatureFlagsMap>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const isUndefined: (value: any) => boolean;
|
|
2
|
-
export declare const pick: (obj?: Object
|
|
2
|
+
export declare const pick: (obj?: Object, keys?: Array<String>) => {
|
|
3
3
|
[k: string]: any;
|
|
4
4
|
};
|
|
5
5
|
export declare const omitBy: (obj: Object, predicate: Function) => {
|
package/downloadUrl/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/mediaFeatureFlags/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/mediaFeatureFlags/index.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/mediaTypeUtils/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/mediaTypeUtils/index.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Includes common utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,14 @@
|
|
|
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.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.ts",
|
|
17
25
|
"af:exports": {
|
|
@@ -32,10 +40,10 @@
|
|
|
32
40
|
},
|
|
33
41
|
"scripts": {},
|
|
34
42
|
"dependencies": {
|
|
35
|
-
"@atlaskit/analytics-gas-types": "^5.0
|
|
36
|
-
"@atlaskit/analytics-namespaced-context": "^6.
|
|
37
|
-
"@atlaskit/analytics-next": "^9.
|
|
38
|
-
"@atlaskit/section-message": "^6.
|
|
43
|
+
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
44
|
+
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
45
|
+
"@atlaskit/analytics-next": "^9.1.0",
|
|
46
|
+
"@atlaskit/section-message": "^6.4.0",
|
|
39
47
|
"@babel/runtime": "^7.0.0"
|
|
40
48
|
},
|
|
41
49
|
"peerDependencies": {
|
|
@@ -44,12 +52,12 @@
|
|
|
44
52
|
},
|
|
45
53
|
"devDependencies": {
|
|
46
54
|
"@atlaskit/docs": "*",
|
|
47
|
-
"@atlaskit/media-test-helpers": "^
|
|
55
|
+
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
48
56
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
49
57
|
"enzyme": "^3.10.0",
|
|
50
58
|
"react": "^16.8.0",
|
|
51
59
|
"react-dom": "^16.8.0",
|
|
52
|
-
"typescript": "4.
|
|
60
|
+
"typescript": "~4.9.5"
|
|
53
61
|
},
|
|
54
62
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
55
63
|
}
|
|
File without changes
|