@atlaskit/media-card 74.0.0 → 74.1.2
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 +26 -0
- package/dist/cjs/errors.js +4 -0
- package/dist/cjs/root/card/cardAnalytics.js +6 -2
- package/dist/cjs/root/card/getCardPreview/index.js +47 -20
- package/dist/cjs/root/card/imageRefetchingAnalytics.js +45 -0
- package/dist/cjs/root/card/index.js +35 -29
- package/dist/cjs/root/inlinePlayerLazy.js +48 -0
- package/dist/cjs/utils/analytics.js +29 -2
- package/dist/cjs/utils/document.js +9 -1
- package/dist/cjs/utils/ufoExperiences.js +7 -3
- package/dist/cjs/utils/viewportDetector.js +11 -36
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/errors.js +4 -0
- package/dist/es2019/root/card/cardAnalytics.js +3 -2
- package/dist/es2019/root/card/getCardPreview/index.js +27 -2
- package/dist/es2019/root/card/imageRefetchingAnalytics.js +30 -0
- package/dist/es2019/root/card/index.js +32 -33
- package/dist/es2019/root/inlinePlayerLazy.js +11 -0
- package/dist/es2019/utils/analytics.js +18 -1
- package/dist/es2019/utils/document.js +11 -1
- package/dist/es2019/utils/ufoExperiences.js +4 -3
- package/dist/es2019/utils/viewportDetector.js +9 -36
- package/dist/es2019/version.json +1 -1
- package/dist/esm/errors.js +4 -0
- package/dist/esm/root/card/cardAnalytics.js +5 -2
- package/dist/esm/root/card/getCardPreview/index.js +47 -20
- package/dist/esm/root/card/imageRefetchingAnalytics.js +32 -0
- package/dist/esm/root/card/index.js +37 -33
- package/dist/esm/root/inlinePlayerLazy.js +29 -0
- package/dist/esm/utils/analytics.js +22 -1
- package/dist/esm/utils/document.js +9 -1
- package/dist/esm/utils/ufoExperiences.js +6 -3
- package/dist/esm/utils/viewportDetector.js +9 -36
- package/dist/esm/version.json +1 -1
- package/dist/types/errors.d.ts +5 -1
- package/dist/types/root/card/cardAnalytics.d.ts +1 -1
- package/dist/types/root/card/getCardPreview/index.d.ts +4 -1
- package/dist/types/root/card/imageRefetchingAnalytics.d.ts +10 -0
- package/dist/types/root/card/index.d.ts +2 -4
- package/dist/types/root/inlinePlayerLazy.d.ts +2 -0
- package/dist/types/utils/analytics.d.ts +17 -1
- package/dist/types/utils/document.d.ts +1 -1
- package/dist/types/utils/ufoExperiences.d.ts +1 -1
- package/dist/types/utils/viewportDetector.d.ts +0 -10
- package/package.json +11 -10
|
@@ -2,6 +2,18 @@ import { FileDetails, MediaClientErrorReason, RequestMetadata } from '@atlaskit/
|
|
|
2
2
|
import { FileAttributes, PerformanceAttributes, OperationalEventPayload, UIEventPayload, WithFileAttributes, WithPerformanceAttributes, SuccessAttributes, FailureAttributes, ScreenEventPayload, ScreenAttributes } from '@atlaskit/media-common';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
4
|
import { MediaCardError, MediaCardErrorPrimaryReason } from '../errors';
|
|
5
|
+
import { CardDimensions } from './cardDimensions';
|
|
6
|
+
import { CardPreviewSource } from '../types';
|
|
7
|
+
export declare type CardPreviewAttributes = {
|
|
8
|
+
fileId: string;
|
|
9
|
+
prevDimensions: CardDimensions | undefined;
|
|
10
|
+
currentDimensions: CardDimensions | undefined;
|
|
11
|
+
dimensionsPercentageDiff?: CardDimensions | undefined;
|
|
12
|
+
source: CardPreviewSource;
|
|
13
|
+
};
|
|
14
|
+
declare type WithCardPreviewCacheAttributes = {
|
|
15
|
+
cardPreviewAttributes: CardPreviewAttributes;
|
|
16
|
+
};
|
|
5
17
|
export declare const LOGGED_FEATURE_FLAGS: (keyof import("@atlaskit/media-common").MediaFeatureFlags)[];
|
|
6
18
|
export declare const LOGGED_FEATURE_FLAG_KEYS: string[];
|
|
7
19
|
export declare type FileUriFailReason = 'local-uri' | 'remote-uri' | `unknown-uri`;
|
|
@@ -33,6 +45,8 @@ export declare type RenderFailedEventPayload = OperationalEventPayload<WithFileA
|
|
|
33
45
|
}, 'failed', 'mediaCardRender'>;
|
|
34
46
|
export declare type RenderSucceededEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & SuccessAttributes, 'succeeded', 'mediaCardRender'>;
|
|
35
47
|
export declare type RenderCommencedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes, 'commenced', 'mediaCardRender'>;
|
|
48
|
+
export declare type CacheHitEventPayload = OperationalEventPayload<WithCardPreviewCacheAttributes, 'cache-hit', 'mediaCardCache'>;
|
|
49
|
+
export declare type RemoteSuccessEventPayload = OperationalEventPayload<WithCardPreviewCacheAttributes, 'Remote-success', 'mediaCardCache'>;
|
|
36
50
|
export declare type CopiedFileEventPayload = UIEventPayload<{}, 'copied', string>;
|
|
37
51
|
export declare type ClickedEventPayload = UIEventPayload<{
|
|
38
52
|
label?: string;
|
|
@@ -43,11 +57,13 @@ export declare type RenderScreenEventPayload = Omit<ScreenEventPayload<ScreenAtt
|
|
|
43
57
|
fileAttributes: FileAttributes;
|
|
44
58
|
};
|
|
45
59
|
};
|
|
46
|
-
export declare type MediaCardAnalyticsEventPayload = RenderCommencedEventPayload | RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | RenderScreenEventPayload;
|
|
60
|
+
export declare type MediaCardAnalyticsEventPayload = RenderCommencedEventPayload | RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | RenderScreenEventPayload | CacheHitEventPayload | RemoteSuccessEventPayload;
|
|
47
61
|
export declare const getFileAttributes: (metadata: FileDetails, fileStatus?: import("@atlaskit/media-common").FileStatus | undefined) => FileAttributes;
|
|
48
62
|
export declare const getRenderPreviewableCardPayload: (fileAttributes: FileAttributes) => RenderScreenEventPayload;
|
|
49
63
|
export declare const getRenderCommencedEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => RenderCommencedEventPayload;
|
|
50
64
|
export declare const getRenderSucceededEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus) => RenderSucceededEventPayload;
|
|
65
|
+
export declare const getCacheHitEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => CacheHitEventPayload;
|
|
66
|
+
export declare const getRemoteSuccessEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => RemoteSuccessEventPayload;
|
|
51
67
|
export declare const getRenderFailedExternalUriPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes) => RenderFailedEventPayload;
|
|
52
68
|
export declare const getRenderErrorFailReason: (error: MediaCardError) => FailedErrorFailReason;
|
|
53
69
|
export declare const getRenderErrorErrorReason: (error: MediaCardError) => MediaClientErrorReason | 'nativeError';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => Document;
|
|
1
|
+
declare const _default: () => Document | undefined;
|
|
2
2
|
export default _default;
|
|
@@ -4,4 +4,4 @@ import { SSRStatus } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { FileStateFlags } from '../types';
|
|
6
6
|
export declare const startUfoExperience: (id: string) => void;
|
|
7
|
-
export declare const completeUfoExperience: (id: string, status: CardStatus, fileAttributes: FileAttributes, fileStateFlags: FileStateFlags, ssrReliability: SSRStatus, error?: MediaCardError
|
|
7
|
+
export declare const completeUfoExperience: (id: string, status: CardStatus, fileAttributes: FileAttributes, fileStateFlags: FileStateFlags, ssrReliability: SSRStatus, error?: MediaCardError) => void;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* As IntersectionObserver::rootMargin doesn't work within IFrames, we use an empty div + dynamic offsetTop to eagerly detect cards entering viewport.
|
|
4
|
-
* Using this approach, we can lazy load cards ABS_VIEWPORT_ANCHOR_OFFSET_TOP px before they enter viewport.
|
|
5
|
-
*/
|
|
6
|
-
export declare const ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900;
|
|
7
|
-
export declare const ViewportAnchor: React.ForwardRefExoticComponent<{
|
|
8
|
-
offsetTop: number;
|
|
9
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
2
|
export declare type ViewportDetectorProps = {
|
|
11
3
|
cardEl: HTMLElement | null;
|
|
12
|
-
preAnchorRef: React.RefObject<HTMLDivElement>;
|
|
13
|
-
postAnchorRef: React.RefObject<HTMLDivElement>;
|
|
14
4
|
onVisible: () => void;
|
|
15
5
|
};
|
|
16
6
|
export declare const ViewportDetector: React.FC<ViewportDetectorProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.1.2",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
33
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
33
|
+
"@atlaskit/dropdown-menu": "^11.4.0",
|
|
34
34
|
"@atlaskit/editor-shared-styles": "^2.1.0",
|
|
35
35
|
"@atlaskit/icon": "^21.10.0",
|
|
36
36
|
"@atlaskit/in-product-testing": "^0.1.0",
|
|
37
37
|
"@atlaskit/media-client": "^17.1.0",
|
|
38
|
-
"@atlaskit/media-common": "^2.
|
|
38
|
+
"@atlaskit/media-common": "^2.16.0",
|
|
39
39
|
"@atlaskit/media-ui": "^22.1.0",
|
|
40
|
-
"@atlaskit/media-viewer": "^47.
|
|
40
|
+
"@atlaskit/media-viewer": "^47.1.0",
|
|
41
41
|
"@atlaskit/spinner": "^15.1.0",
|
|
42
|
-
"@atlaskit/theme": "^12.
|
|
42
|
+
"@atlaskit/theme": "^12.2.0",
|
|
43
43
|
"@atlaskit/tooltip": "^17.5.0",
|
|
44
44
|
"@atlaskit/ufo": "^0.1.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
@@ -61,14 +61,15 @@
|
|
|
61
61
|
"@atlaskit/button": "^16.3.0",
|
|
62
62
|
"@atlaskit/checkbox": "^12.3.0",
|
|
63
63
|
"@atlaskit/docs": "*",
|
|
64
|
-
"@atlaskit/inline-message": "^11.
|
|
64
|
+
"@atlaskit/inline-message": "^11.4.0",
|
|
65
65
|
"@atlaskit/media-core": "^33.0.0",
|
|
66
|
+
"@atlaskit/media-picker": "^63.0.1",
|
|
66
67
|
"@atlaskit/media-test-helpers": "^30.0.0",
|
|
67
|
-
"@atlaskit/radio": "^5.
|
|
68
|
+
"@atlaskit/radio": "^5.4.0",
|
|
68
69
|
"@atlaskit/range": "^6.0.0",
|
|
69
|
-
"@atlaskit/select": "^15.
|
|
70
|
+
"@atlaskit/select": "^15.7.0",
|
|
70
71
|
"@atlaskit/ssr": "*",
|
|
71
|
-
"@atlaskit/toggle": "^12.
|
|
72
|
+
"@atlaskit/toggle": "^12.5.0",
|
|
72
73
|
"@atlaskit/visual-regression": "*",
|
|
73
74
|
"@atlaskit/webdriver-runner": "*",
|
|
74
75
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
"react": "^16.8.0",
|
|
84
85
|
"react-dom": "^16.8.0",
|
|
85
86
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
86
|
-
"typescript": "4.
|
|
87
|
+
"typescript": "4.3.5",
|
|
87
88
|
"uuid": "^3.1.0",
|
|
88
89
|
"wait-for-expect": "^1.2.0"
|
|
89
90
|
},
|