@atlaskit/media-card 79.8.1 → 79.9.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 +21 -0
- package/dist/cjs/card/fileCard.js +2 -1
- package/dist/cjs/utils/analytics/analytics.js +9 -3
- package/dist/cjs/utils/mediaPerformanceObserver/mediaPerformanceObserver.js +1 -1
- package/dist/es2019/card/fileCard.js +2 -1
- package/dist/es2019/utils/analytics/analytics.js +54 -42
- package/dist/es2019/utils/mediaPerformanceObserver/mediaPerformanceObserver.js +1 -1
- package/dist/esm/card/fileCard.js +2 -1
- package/dist/esm/utils/analytics/analytics.js +9 -3
- package/dist/esm/utils/mediaPerformanceObserver/mediaPerformanceObserver.js +1 -1
- package/dist/types/utils/analytics/analytics.d.ts +5 -2
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +5 -2
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 79.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2060fe01f7695`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2060fe01f7695) -
|
|
8
|
+
Optimised lazy loading by integrating the removal of lazy loading during SSR
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`2060fe01f7695`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2060fe01f7695) -
|
|
13
|
+
Add media-perf-lazy-loading-optimisation to perfObserver metrics to track impact
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 79.8.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`dee27fdf979fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dee27fdf979fb) -
|
|
21
|
+
Added statusCode at the top level of analytics failure events, for SignalFX compatibility.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 79.8.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -587,13 +587,14 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
587
587
|
var izLazyOverride = arguments.length > 2 ? arguments[2] : undefined;
|
|
588
588
|
var mediaItemType = identifier.mediaItemType;
|
|
589
589
|
var isLazyWithOverride = izLazyOverride === undefined ? isLazy : izLazyOverride;
|
|
590
|
+
var isLazyPreview = (0, _platformFeatureFlags.fg)('media-perf-lazy-loading-optimisation') ? preview === null || preview === void 0 ? void 0 : preview.lazy : true;
|
|
590
591
|
|
|
591
592
|
// We should natively lazy load an SSR preview when card is not visible,
|
|
592
593
|
// otherwise we'll fire the metadata fetch from outside the viewport
|
|
593
594
|
// Side note: We should not lazy load if the cardPreview is available from local cache,
|
|
594
595
|
// in order to avoid flickers during re-mount of the component
|
|
595
596
|
// CXP-2723 TODO: Create test cases for the above scenarios
|
|
596
|
-
var nativeLazyLoad = isLazyWithOverride && ((0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && (0, _types.isSSRPreview)(preview);
|
|
597
|
+
var nativeLazyLoad = isLazyWithOverride && ((0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && (0, _types.isSSRPreview)(preview) && isLazyPreview;
|
|
597
598
|
// Force Media Image to always display img for SSR
|
|
598
599
|
var forceSyncDisplay = !!ssr;
|
|
599
600
|
var card = /*#__PURE__*/_react.default.createElement(_cardView.CardView, {
|
|
@@ -129,6 +129,7 @@ var extractErrorInfo = exports.extractErrorInfo = function extractErrorInfo(erro
|
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
131
|
var getRenderErrorEventPayload = exports.getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext) {
|
|
132
|
+
var requestMetadata = getRenderErrorRequestMetadata(error);
|
|
132
133
|
return {
|
|
133
134
|
eventType: 'operational',
|
|
134
135
|
action: 'failed',
|
|
@@ -139,13 +140,15 @@ var getRenderErrorEventPayload = exports.getRenderErrorEventPayload = function g
|
|
|
139
140
|
performanceAttributes: performanceAttributes,
|
|
140
141
|
status: 'fail'
|
|
141
142
|
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
142
|
-
|
|
143
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
144
|
+
request: requestMetadata,
|
|
143
145
|
ssrReliability: ssrReliability,
|
|
144
146
|
traceContext: traceContext
|
|
145
147
|
})
|
|
146
148
|
};
|
|
147
149
|
};
|
|
148
150
|
var getDownloadFailedEventPayload = exports.getDownloadFailedEventPayload = function getDownloadFailedEventPayload(fileAttributes, error, traceContext, metadataTraceContext) {
|
|
151
|
+
var requestMetadata = getRenderErrorRequestMetadata(error);
|
|
149
152
|
return {
|
|
150
153
|
eventType: 'operational',
|
|
151
154
|
action: 'failed',
|
|
@@ -155,12 +158,14 @@ var getDownloadFailedEventPayload = exports.getDownloadFailedEventPayload = func
|
|
|
155
158
|
fileAttributes: fileAttributes,
|
|
156
159
|
status: 'fail'
|
|
157
160
|
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
158
|
-
|
|
161
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
162
|
+
request: requestMetadata,
|
|
159
163
|
traceContext: traceContext
|
|
160
164
|
})
|
|
161
165
|
};
|
|
162
166
|
};
|
|
163
167
|
var getErrorEventPayload = exports.getErrorEventPayload = function getErrorEventPayload(cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext) {
|
|
168
|
+
var requestMetadata = getRenderErrorRequestMetadata(error);
|
|
164
169
|
return {
|
|
165
170
|
eventType: 'operational',
|
|
166
171
|
action: 'nonCriticalFail',
|
|
@@ -169,7 +174,8 @@ var getErrorEventPayload = exports.getErrorEventPayload = function getErrorEvent
|
|
|
169
174
|
fileAttributes: fileAttributes,
|
|
170
175
|
status: 'fail'
|
|
171
176
|
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
172
|
-
|
|
177
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
178
|
+
request: requestMetadata,
|
|
173
179
|
ssrReliability: ssrReliability,
|
|
174
180
|
traceContext: traceContext,
|
|
175
181
|
cardStatus: cardStatus
|
|
@@ -39,7 +39,7 @@ var createAndGetResourceObserver = function createAndGetResourceObserver() {
|
|
|
39
39
|
fileId: fileId,
|
|
40
40
|
mediaClientId: clientId,
|
|
41
41
|
featureFlags: {
|
|
42
|
-
'media-
|
|
42
|
+
'media-perf-lazy-loading-optimisation': (0, _platformFeatureFlags.fg)('media-perf-lazy-loading-optimisation')
|
|
43
43
|
}
|
|
44
44
|
}, mediaDurationMetrics)
|
|
45
45
|
});
|
|
@@ -510,13 +510,14 @@ export const FileCard = ({
|
|
|
510
510
|
mediaItemType
|
|
511
511
|
} = identifier;
|
|
512
512
|
const isLazyWithOverride = izLazyOverride === undefined ? isLazy : izLazyOverride;
|
|
513
|
+
let isLazyPreview = fg('media-perf-lazy-loading-optimisation') ? preview === null || preview === void 0 ? void 0 : preview.lazy : true;
|
|
513
514
|
|
|
514
515
|
// We should natively lazy load an SSR preview when card is not visible,
|
|
515
516
|
// otherwise we'll fire the metadata fetch from outside the viewport
|
|
516
517
|
// Side note: We should not lazy load if the cardPreview is available from local cache,
|
|
517
518
|
// in order to avoid flickers during re-mount of the component
|
|
518
519
|
// CXP-2723 TODO: Create test cases for the above scenarios
|
|
519
|
-
const nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview);
|
|
520
|
+
const nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview) && isLazyPreview;
|
|
520
521
|
// Force Media Image to always display img for SSR
|
|
521
522
|
const forceSyncDisplay = !!ssr;
|
|
522
523
|
const card = /*#__PURE__*/React.createElement(CardView, {
|
|
@@ -112,48 +112,60 @@ export const extractErrorInfo = (error, metadataTraceContext) => {
|
|
|
112
112
|
metadataTraceContext: metadataTraceContext !== null && metadataTraceContext !== void 0 ? metadataTraceContext : getErrorTraceContext(error)
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
|
-
export const getRenderErrorEventPayload = (fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
115
|
+
export const getRenderErrorEventPayload = (fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext) => {
|
|
116
|
+
const requestMetadata = getRenderErrorRequestMetadata(error);
|
|
117
|
+
return {
|
|
118
|
+
eventType: 'operational',
|
|
119
|
+
action: 'failed',
|
|
120
|
+
actionSubject: 'mediaCardRender',
|
|
121
|
+
attributes: {
|
|
122
|
+
fileMimetype: fileAttributes.fileMimetype,
|
|
123
|
+
fileAttributes,
|
|
124
|
+
performanceAttributes,
|
|
125
|
+
status: 'fail',
|
|
126
|
+
...extractErrorInfo(error, metadataTraceContext),
|
|
127
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
128
|
+
request: requestMetadata,
|
|
129
|
+
ssrReliability,
|
|
130
|
+
traceContext
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export const getDownloadFailedEventPayload = (fileAttributes, error, traceContext, metadataTraceContext) => {
|
|
135
|
+
const requestMetadata = getRenderErrorRequestMetadata(error);
|
|
136
|
+
return {
|
|
137
|
+
eventType: 'operational',
|
|
138
|
+
action: 'failed',
|
|
139
|
+
actionSubject: 'mediaCardDownload',
|
|
140
|
+
attributes: {
|
|
141
|
+
fileMimetype: fileAttributes.fileMimetype,
|
|
142
|
+
fileAttributes,
|
|
143
|
+
status: 'fail',
|
|
144
|
+
...extractErrorInfo(error, metadataTraceContext),
|
|
145
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
146
|
+
request: requestMetadata,
|
|
147
|
+
traceContext
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export const getErrorEventPayload = (cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext) => {
|
|
152
|
+
const requestMetadata = getRenderErrorRequestMetadata(error);
|
|
153
|
+
return {
|
|
154
|
+
eventType: 'operational',
|
|
155
|
+
action: 'nonCriticalFail',
|
|
156
|
+
actionSubject: 'mediaCardRender',
|
|
157
|
+
attributes: {
|
|
158
|
+
fileAttributes,
|
|
159
|
+
status: 'fail',
|
|
160
|
+
...extractErrorInfo(error, metadataTraceContext),
|
|
161
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
162
|
+
request: requestMetadata,
|
|
163
|
+
ssrReliability,
|
|
164
|
+
traceContext,
|
|
165
|
+
cardStatus
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
};
|
|
157
169
|
export const getRenderFailedFileStatusPayload = (fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) => ({
|
|
158
170
|
eventType: 'operational',
|
|
159
171
|
action: 'failed',
|
|
@@ -29,7 +29,7 @@ const createAndGetResourceObserver = () => {
|
|
|
29
29
|
fileId: fileId,
|
|
30
30
|
mediaClientId: clientId,
|
|
31
31
|
featureFlags: {
|
|
32
|
-
'media-
|
|
32
|
+
'media-perf-lazy-loading-optimisation': fg('media-perf-lazy-loading-optimisation')
|
|
33
33
|
},
|
|
34
34
|
...mediaDurationMetrics
|
|
35
35
|
}
|
|
@@ -579,13 +579,14 @@ export var FileCard = function FileCard(_ref) {
|
|
|
579
579
|
var izLazyOverride = arguments.length > 2 ? arguments[2] : undefined;
|
|
580
580
|
var mediaItemType = identifier.mediaItemType;
|
|
581
581
|
var isLazyWithOverride = izLazyOverride === undefined ? isLazy : izLazyOverride;
|
|
582
|
+
var isLazyPreview = fg('media-perf-lazy-loading-optimisation') ? preview === null || preview === void 0 ? void 0 : preview.lazy : true;
|
|
582
583
|
|
|
583
584
|
// We should natively lazy load an SSR preview when card is not visible,
|
|
584
585
|
// otherwise we'll fire the metadata fetch from outside the viewport
|
|
585
586
|
// Side note: We should not lazy load if the cardPreview is available from local cache,
|
|
586
587
|
// in order to avoid flickers during re-mount of the component
|
|
587
588
|
// CXP-2723 TODO: Create test cases for the above scenarios
|
|
588
|
-
var nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview);
|
|
589
|
+
var nativeLazyLoad = isLazyWithOverride && (fg('media-perf-uplift-mutation-fix') || !isCardVisible) && preview && isSSRPreview(preview) && isLazyPreview;
|
|
589
590
|
// Force Media Image to always display img for SSR
|
|
590
591
|
var forceSyncDisplay = !!ssr;
|
|
591
592
|
var card = /*#__PURE__*/React.createElement(CardView, {
|
|
@@ -120,6 +120,7 @@ export var extractErrorInfo = function extractErrorInfo(error, metadataTraceCont
|
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
export var getRenderErrorEventPayload = function getRenderErrorEventPayload(fileAttributes, performanceAttributes, error, ssrReliability, traceContext, metadataTraceContext) {
|
|
123
|
+
var requestMetadata = getRenderErrorRequestMetadata(error);
|
|
123
124
|
return {
|
|
124
125
|
eventType: 'operational',
|
|
125
126
|
action: 'failed',
|
|
@@ -130,13 +131,15 @@ export var getRenderErrorEventPayload = function getRenderErrorEventPayload(file
|
|
|
130
131
|
performanceAttributes: performanceAttributes,
|
|
131
132
|
status: 'fail'
|
|
132
133
|
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
133
|
-
|
|
134
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
135
|
+
request: requestMetadata,
|
|
134
136
|
ssrReliability: ssrReliability,
|
|
135
137
|
traceContext: traceContext
|
|
136
138
|
})
|
|
137
139
|
};
|
|
138
140
|
};
|
|
139
141
|
export var getDownloadFailedEventPayload = function getDownloadFailedEventPayload(fileAttributes, error, traceContext, metadataTraceContext) {
|
|
142
|
+
var requestMetadata = getRenderErrorRequestMetadata(error);
|
|
140
143
|
return {
|
|
141
144
|
eventType: 'operational',
|
|
142
145
|
action: 'failed',
|
|
@@ -146,12 +149,14 @@ export var getDownloadFailedEventPayload = function getDownloadFailedEventPayloa
|
|
|
146
149
|
fileAttributes: fileAttributes,
|
|
147
150
|
status: 'fail'
|
|
148
151
|
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
149
|
-
|
|
152
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
153
|
+
request: requestMetadata,
|
|
150
154
|
traceContext: traceContext
|
|
151
155
|
})
|
|
152
156
|
};
|
|
153
157
|
};
|
|
154
158
|
export var getErrorEventPayload = function getErrorEventPayload(cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext) {
|
|
159
|
+
var requestMetadata = getRenderErrorRequestMetadata(error);
|
|
155
160
|
return {
|
|
156
161
|
eventType: 'operational',
|
|
157
162
|
action: 'nonCriticalFail',
|
|
@@ -160,7 +165,8 @@ export var getErrorEventPayload = function getErrorEventPayload(cardStatus, file
|
|
|
160
165
|
fileAttributes: fileAttributes,
|
|
161
166
|
status: 'fail'
|
|
162
167
|
}, extractErrorInfo(error, metadataTraceContext)), {}, {
|
|
163
|
-
|
|
168
|
+
statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
|
|
169
|
+
request: requestMetadata,
|
|
164
170
|
ssrReliability: ssrReliability,
|
|
165
171
|
traceContext: traceContext,
|
|
166
172
|
cardStatus: cardStatus
|
|
@@ -32,7 +32,7 @@ var createAndGetResourceObserver = function createAndGetResourceObserver() {
|
|
|
32
32
|
fileId: fileId,
|
|
33
33
|
mediaClientId: clientId,
|
|
34
34
|
featureFlags: {
|
|
35
|
-
'media-
|
|
35
|
+
'media-perf-lazy-loading-optimisation': fg('media-perf-lazy-loading-optimisation')
|
|
36
36
|
}
|
|
37
37
|
}, mediaDurationMetrics)
|
|
38
38
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ErrorInfo } from 'react';
|
|
2
|
-
import { type FileDetails, type FileStatus, type MediaClientErrorReason, type RequestMetadata } from '@atlaskit/media-client';
|
|
2
|
+
import { type FileDetails, type FileStatus, type MediaClientErrorReason, type RequestErrorMetadata, type RequestMetadata } from '@atlaskit/media-client';
|
|
3
3
|
import { type FileAttributes, type PerformanceAttributes, type OperationalEventPayload, type UIEventPayload, type WithFileAttributes, type WithPerformanceAttributes, type SuccessAttributes, type FailureAttributes, type MediaTraceContext, type WithTraceContext } from '@atlaskit/media-common/analytics';
|
|
4
4
|
import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { type MediaCardError, type MediaCardErrorPrimaryReason } from '../../errors';
|
|
@@ -63,17 +63,20 @@ export type WithSSRReliability = {
|
|
|
63
63
|
export type RenderFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
64
64
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
65
65
|
error?: MediaClientErrorReason | 'nativeError';
|
|
66
|
+
statusCode?: number;
|
|
66
67
|
request?: RequestMetadata;
|
|
67
68
|
}, 'failed', 'mediaCardRender'>;
|
|
68
69
|
export type DownloadFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithTraceContext & FailureAttributes & {
|
|
69
70
|
failReason: FailedErrorFailReason;
|
|
70
71
|
error?: MediaClientErrorReason | 'nativeError';
|
|
72
|
+
statusCode?: number;
|
|
71
73
|
request?: RequestMetadata;
|
|
72
74
|
}, 'failed', 'mediaCardDownload'>;
|
|
73
75
|
export type ErrorEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
74
76
|
cardStatus: CardStatus;
|
|
75
77
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
76
78
|
error?: MediaClientErrorReason | 'nativeError';
|
|
79
|
+
statusCode?: number;
|
|
77
80
|
request?: RequestMetadata;
|
|
78
81
|
}, 'nonCriticalFail', 'mediaCardRender'>;
|
|
79
82
|
export type ErrorBoundaryErrorInfo = {
|
|
@@ -113,7 +116,7 @@ export declare const getRenderErrorFailReason: (error: MediaCardError) => Failed
|
|
|
113
116
|
export declare const getRenderErrorErrorReason: (error: MediaCardError) => MediaClientErrorReason | "nativeError";
|
|
114
117
|
export declare const getRenderErrorErrorDetail: (error: MediaCardError) => string;
|
|
115
118
|
export declare const getErrorTraceContext: (error: MediaCardError) => MediaTraceContext | undefined;
|
|
116
|
-
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) =>
|
|
119
|
+
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) => RequestErrorMetadata | undefined;
|
|
117
120
|
export declare const extractErrorInfo: (error: MediaCardError, metadataTraceContext?: MediaTraceContext) => MediaCardErrorInfo;
|
|
118
121
|
export declare const getRenderErrorEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error: MediaCardError, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderFailedEventPayload;
|
|
119
122
|
export declare const getDownloadFailedEventPayload: (fileAttributes: FileAttributes, error: MediaCardError, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => DownloadFailedEventPayload;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ErrorInfo } from 'react';
|
|
2
|
-
import { type FileDetails, type FileStatus, type MediaClientErrorReason, type RequestMetadata } from '@atlaskit/media-client';
|
|
2
|
+
import { type FileDetails, type FileStatus, type MediaClientErrorReason, type RequestErrorMetadata, type RequestMetadata } from '@atlaskit/media-client';
|
|
3
3
|
import { type FileAttributes, type PerformanceAttributes, type OperationalEventPayload, type UIEventPayload, type WithFileAttributes, type WithPerformanceAttributes, type SuccessAttributes, type FailureAttributes, type MediaTraceContext, type WithTraceContext } from '@atlaskit/media-common/analytics';
|
|
4
4
|
import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { type MediaCardError, type MediaCardErrorPrimaryReason } from '../../errors';
|
|
@@ -63,17 +63,20 @@ export type WithSSRReliability = {
|
|
|
63
63
|
export type RenderFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
64
64
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
65
65
|
error?: MediaClientErrorReason | 'nativeError';
|
|
66
|
+
statusCode?: number;
|
|
66
67
|
request?: RequestMetadata;
|
|
67
68
|
}, 'failed', 'mediaCardRender'>;
|
|
68
69
|
export type DownloadFailedEventPayload = OperationalEventPayload<WithFileAttributes & WithTraceContext & FailureAttributes & {
|
|
69
70
|
failReason: FailedErrorFailReason;
|
|
70
71
|
error?: MediaClientErrorReason | 'nativeError';
|
|
72
|
+
statusCode?: number;
|
|
71
73
|
request?: RequestMetadata;
|
|
72
74
|
}, 'failed', 'mediaCardDownload'>;
|
|
73
75
|
export type ErrorEventPayload = OperationalEventPayload<WithFileAttributes & WithPerformanceAttributes & WithSSRReliability & WithTraceContext & FailureAttributes & {
|
|
74
76
|
cardStatus: CardStatus;
|
|
75
77
|
failReason: FailedErrorFailReason | 'failed-processing';
|
|
76
78
|
error?: MediaClientErrorReason | 'nativeError';
|
|
79
|
+
statusCode?: number;
|
|
77
80
|
request?: RequestMetadata;
|
|
78
81
|
}, 'nonCriticalFail', 'mediaCardRender'>;
|
|
79
82
|
export type ErrorBoundaryErrorInfo = {
|
|
@@ -113,7 +116,7 @@ export declare const getRenderErrorFailReason: (error: MediaCardError) => Failed
|
|
|
113
116
|
export declare const getRenderErrorErrorReason: (error: MediaCardError) => MediaClientErrorReason | "nativeError";
|
|
114
117
|
export declare const getRenderErrorErrorDetail: (error: MediaCardError) => string;
|
|
115
118
|
export declare const getErrorTraceContext: (error: MediaCardError) => MediaTraceContext | undefined;
|
|
116
|
-
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) =>
|
|
119
|
+
export declare const getRenderErrorRequestMetadata: (error: MediaCardError) => RequestErrorMetadata | undefined;
|
|
117
120
|
export declare const extractErrorInfo: (error: MediaCardError, metadataTraceContext?: MediaTraceContext) => MediaCardErrorInfo;
|
|
118
121
|
export declare const getRenderErrorEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, error: MediaCardError, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderFailedEventPayload;
|
|
119
122
|
export declare const getDownloadFailedEventPayload: (fileAttributes: FileAttributes, error: MediaCardError, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => DownloadFailedEventPayload;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "79.
|
|
3
|
+
"version": "79.9.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"@atlaskit/media-client": "^35.6.0",
|
|
40
40
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
41
41
|
"@atlaskit/media-common": "^12.3.0",
|
|
42
|
-
"@atlaskit/media-file-preview": "^0.
|
|
42
|
+
"@atlaskit/media-file-preview": "^0.15.0",
|
|
43
43
|
"@atlaskit/media-svg": "^2.1.0",
|
|
44
44
|
"@atlaskit/media-ui": "^28.7.0",
|
|
45
45
|
"@atlaskit/media-viewer": "^52.4.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
|
-
"@atlaskit/primitives": "^16.
|
|
47
|
+
"@atlaskit/primitives": "^16.4.0",
|
|
48
48
|
"@atlaskit/react-ufo": "^4.15.0",
|
|
49
49
|
"@atlaskit/spinner": "^19.0.0",
|
|
50
50
|
"@atlaskit/theme": "^21.0.0",
|
|
51
|
-
"@atlaskit/tokens": "^8.
|
|
51
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
52
52
|
"@atlaskit/tooltip": "^20.10.0",
|
|
53
53
|
"@atlaskit/ufo": "^0.4.0",
|
|
54
54
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"@af/integration-testing": "workspace:^",
|
|
72
72
|
"@atlaskit/analytics-listeners": "^9.1.0",
|
|
73
73
|
"@atlaskit/analytics-namespaced-context": "^7.2.0",
|
|
74
|
-
"@atlaskit/form": "^14.
|
|
74
|
+
"@atlaskit/form": "^14.3.0",
|
|
75
75
|
"@atlaskit/inline-message": "^15.4.0",
|
|
76
76
|
"@atlaskit/media-core": "^37.0.0",
|
|
77
|
-
"@atlaskit/media-picker": "^70.
|
|
77
|
+
"@atlaskit/media-picker": "^70.1.0",
|
|
78
78
|
"@atlaskit/media-state": "^1.8.0",
|
|
79
79
|
"@atlaskit/media-test-data": "^3.2.0",
|
|
80
80
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
@@ -137,6 +137,9 @@
|
|
|
137
137
|
},
|
|
138
138
|
"media-perf-uplift-mutation-fix": {
|
|
139
139
|
"type": "boolean"
|
|
140
|
+
},
|
|
141
|
+
"media-perf-lazy-loading-optimisation": {
|
|
142
|
+
"type": "boolean"
|
|
140
143
|
}
|
|
141
144
|
},
|
|
142
145
|
"techstack": {
|