@atlaskit/media-card 79.0.3 → 79.0.4
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 +8 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardAnalytics.js +1 -4
- package/dist/cjs/card/externalImageCard.js +0 -10
- package/dist/cjs/card/fileCard.js +0 -15
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -13
- package/dist/cjs/utils/analytics/index.js +0 -6
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/cardAnalytics.js +1 -4
- package/dist/es2019/card/externalImageCard.js +1 -11
- package/dist/es2019/card/fileCard.js +1 -16
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +0 -10
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/cardAnalytics.js +1 -4
- package/dist/esm/card/externalImageCard.js +1 -11
- package/dist/esm/card/fileCard.js +1 -16
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +0 -12
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/card/cardAnalytics.d.ts +0 -1
- package/dist/types/utils/analytics/analytics.d.ts +2 -9
- package/dist/types/utils/analytics/index.d.ts +2 -2
- package/dist/types-ts4.5/card/cardAnalytics.d.ts +0 -1
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +2 -9
- package/dist/types-ts4.5/utils/analytics/index.d.ts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 79.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#121036](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/121036)
|
|
8
|
+
[`bcc65151d39a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bcc65151d39a7) -
|
|
9
|
+
Removed unused mediaCardRender screen event
|
|
10
|
+
|
|
3
11
|
## 79.0.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -21,7 +21,7 @@ var _excluded = ["identifier"];
|
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
23
|
var packageName = "@atlaskit/media-card";
|
|
24
|
-
var packageVersion = "79.0.
|
|
24
|
+
var packageVersion = "79.0.4";
|
|
25
25
|
var CardBase = exports.CardBase = function CardBase(_ref) {
|
|
26
26
|
var identifier = _ref.identifier,
|
|
27
27
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.fireOperationalEvent = exports.fireNonCriticalErrorEvent = exports.fireDownloadSucceededEvent = exports.fireDownloadFailedEvent = void 0;
|
|
7
7
|
var _analytics = require("../utils/analytics");
|
|
8
8
|
var _errors = require("../errors");
|
|
9
9
|
var fireOperationalEvent = exports.fireOperationalEvent = function fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability) {
|
|
@@ -25,9 +25,6 @@ var fireOperationalEvent = exports.fireOperationalEvent = function fireOperation
|
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
var fireScreenEvent = exports.fireScreenEvent = function fireScreenEvent(createAnalyticsEvent, fileAttributes) {
|
|
29
|
-
(0, _analytics.fireMediaCardEvent)((0, _analytics.getRenderPreviewableCardPayload)(fileAttributes), createAnalyticsEvent);
|
|
30
|
-
};
|
|
31
28
|
var fireNonCriticalErrorEvent = exports.fireNonCriticalErrorEvent = function fireNonCriticalErrorEvent(createAnalyticsEvent, cardStatus, fileAttributes, ssrReliability) {
|
|
32
29
|
var error = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new _errors.MediaCardError('missing-error-data');
|
|
33
30
|
var traceContext = arguments.length > 5 ? arguments[5] : undefined;
|
|
@@ -138,9 +138,6 @@ var ExternalImageCard = exports.ExternalImageCard = function ExternalImageCard(_
|
|
|
138
138
|
createAnalyticsEvent && (0, _cardAnalytics.fireOperationalEvent)(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error, traceContext, undefined);
|
|
139
139
|
shouldSendPerformanceEventRef.current && (0, _ufoExperiences.completeUfoExperience)(internalOccurrenceKey, status, fileAttributes, fileStateFlagsRef.current, ssrReliability, error);
|
|
140
140
|
});
|
|
141
|
-
var fireScreenEventRef = (0, _useCurrentValueRef.useCurrentValueRef)(function () {
|
|
142
|
-
createAnalyticsEvent && (0, _cardAnalytics.fireScreenEvent)(createAnalyticsEvent, fileAttributes);
|
|
143
|
-
});
|
|
144
141
|
var fireAbortedEventRef = (0, _useCurrentValueRef.useCurrentValueRef)(function () {
|
|
145
142
|
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
146
143
|
if (shouldSendPerformanceEventRef.current) {
|
|
@@ -170,13 +167,6 @@ var ExternalImageCard = exports.ExternalImageCard = function ExternalImageCard(_
|
|
|
170
167
|
setStatus('complete');
|
|
171
168
|
}
|
|
172
169
|
}, [previewDidRender, status]);
|
|
173
|
-
(0, _react.useEffect)(function () {
|
|
174
|
-
if (prevStatus !== undefined && status !== prevStatus) {
|
|
175
|
-
if (status === 'complete') {
|
|
176
|
-
fireScreenEventRef.current();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}, [fireScreenEventRef, prevStatus, status]);
|
|
180
170
|
(0, _react.useEffect)(function () {
|
|
181
171
|
return function () {
|
|
182
172
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -337,9 +337,6 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
337
337
|
fireNonCriticalErrorEventRef.current(nonCriticalError);
|
|
338
338
|
}
|
|
339
339
|
}, [nonCriticalError, fireNonCriticalErrorEventRef]);
|
|
340
|
-
var fireScreenEventRef = (0, _useCurrentValueRef.useCurrentValueRef)(function () {
|
|
341
|
-
createAnalyticsEvent && (0, _cardAnalytics.fireScreenEvent)(createAnalyticsEvent, fileAttributes);
|
|
342
|
-
});
|
|
343
340
|
var startUfoExperienceRef = (0, _useCurrentValueRef.useCurrentValueRef)(function () {
|
|
344
341
|
if (shouldSendPerformanceEventRef.current) {
|
|
345
342
|
(0, _ufoExperiences.startUfoExperience)(internalOccurrenceKey);
|
|
@@ -474,18 +471,6 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
474
471
|
}
|
|
475
472
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
476
473
|
|
|
477
|
-
//----------------------------------------------------------------//
|
|
478
|
-
//----------------- fireScreenEvent ------------------------------//
|
|
479
|
-
//----------------------------------------------------------------//
|
|
480
|
-
|
|
481
|
-
(0, _react.useEffect)(function () {
|
|
482
|
-
if (prevStatus !== undefined && finalStatus !== prevStatus) {
|
|
483
|
-
if (finalStatus === 'complete' || fileAttributes.fileMediatype === 'video' && !!preview && finalStatus === 'processing') {
|
|
484
|
-
fireScreenEventRef.current();
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}, [finalStatus, prevStatus, fileAttributes, preview, fireScreenEventRef]);
|
|
488
|
-
|
|
489
474
|
//----------------------------------------------------------------//
|
|
490
475
|
//----------------- abort UFO experience -------------------------//
|
|
491
476
|
//----------------------------------------------------------------//
|
|
@@ -87,7 +87,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
87
87
|
}(_react.default.Component);
|
|
88
88
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
89
89
|
var packageName = "@atlaskit/media-card";
|
|
90
|
-
var packageVersion = "79.0.
|
|
90
|
+
var packageVersion = "79.0.4";
|
|
91
91
|
|
|
92
92
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
93
93
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
@@ -117,7 +117,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
117
117
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
118
118
|
var analyticsContext = {
|
|
119
119
|
packageVersion: "@atlaskit/media-card",
|
|
120
|
-
packageName: "79.0.
|
|
120
|
+
packageName: "79.0.4",
|
|
121
121
|
componentName: 'mediaInlineCard',
|
|
122
122
|
component: 'mediaInlineCard'
|
|
123
123
|
};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.extractErrorInfo = exports.createAndFireMediaCardEvent = void 0;
|
|
8
8
|
exports.fireMediaCardEvent = fireMediaCardEvent;
|
|
9
|
-
exports.getRenderSucceededEventPayload = exports.
|
|
9
|
+
exports.getRenderSucceededEventPayload = exports.getRenderFailedFileStatusPayload = exports.getRenderFailedExternalUriPayload = exports.getRenderErrorRequestMetadata = exports.getRenderErrorFailReason = exports.getRenderErrorEventPayload = exports.getRenderErrorErrorReason = exports.getRenderErrorErrorDetail = exports.getRemoteSuccessEventPayload = exports.getFileAttributes = exports.getErrorTraceContext = exports.getErrorEventPayload = exports.getDownloadSucceededEventPayload = exports.getDownloadFailedEventPayload = exports.getCacheHitEventPayload = void 0;
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _mediaClient = require("@atlaskit/media-client");
|
|
12
12
|
var _analytics = require("@atlaskit/media-common/analytics");
|
|
@@ -22,18 +22,6 @@ var getFileAttributes = exports.getFileAttributes = function getFileAttributes(m
|
|
|
22
22
|
fileStatus: fileStatus
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
var getRenderPreviewableCardPayload = exports.getRenderPreviewableCardPayload = function getRenderPreviewableCardPayload(fileAttributes) {
|
|
26
|
-
return {
|
|
27
|
-
eventType: 'screen',
|
|
28
|
-
action: 'viewed',
|
|
29
|
-
actionSubject: 'mediaCardRenderScreen',
|
|
30
|
-
name: 'mediaCardRenderScreen',
|
|
31
|
-
attributes: {
|
|
32
|
-
type: fileAttributes.fileMediatype,
|
|
33
|
-
fileAttributes: fileAttributes
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
25
|
var getRenderSucceededEventPayload = exports.getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) {
|
|
38
26
|
return {
|
|
39
27
|
eventType: 'operational',
|
|
@@ -105,12 +105,6 @@ Object.defineProperty(exports, "getRenderFailedFileStatusPayload", {
|
|
|
105
105
|
return _analytics.getRenderFailedFileStatusPayload;
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
Object.defineProperty(exports, "getRenderPreviewableCardPayload", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function get() {
|
|
111
|
-
return _analytics.getRenderPreviewableCardPayload;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
108
|
Object.defineProperty(exports, "getRenderSucceededEventPayload", {
|
|
115
109
|
enumerable: true,
|
|
116
110
|
get: function get() {
|
|
@@ -15,7 +15,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
17
|
var packageName = "@atlaskit/media-card";
|
|
18
|
-
var packageVersion = "79.0.
|
|
18
|
+
var packageVersion = "79.0.4";
|
|
19
19
|
var SAMPLE_RATE = 0.05;
|
|
20
20
|
var concurrentExperience;
|
|
21
21
|
var getExperience = function getExperience(id) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -9,7 +9,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
11
11
|
const packageName = "@atlaskit/media-card";
|
|
12
|
-
const packageVersion = "79.0.
|
|
12
|
+
const packageVersion = "79.0.4";
|
|
13
13
|
export const CardBase = ({
|
|
14
14
|
identifier,
|
|
15
15
|
...otherProps
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload,
|
|
1
|
+
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload, getErrorEventPayload, getDownloadSucceededEventPayload, getDownloadFailedEventPayload } from '../utils/analytics';
|
|
2
2
|
import { MediaCardError } from '../errors';
|
|
3
3
|
export const fireOperationalEvent = (createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error = new MediaCardError('missing-error-data'), traceContext, metadataTraceContext) => {
|
|
4
4
|
const fireEvent = payload => fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
@@ -14,9 +14,6 @@ export const fireOperationalEvent = (createAnalyticsEvent, status, fileAttribute
|
|
|
14
14
|
break;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
export const fireScreenEvent = (createAnalyticsEvent, fileAttributes) => {
|
|
18
|
-
fireMediaCardEvent(getRenderPreviewableCardPayload(fileAttributes), createAnalyticsEvent);
|
|
19
|
-
};
|
|
20
17
|
export const fireNonCriticalErrorEvent = (createAnalyticsEvent, cardStatus, fileAttributes, ssrReliability, error = new MediaCardError('missing-error-data'), traceContext, metadataTraceContext) => {
|
|
21
18
|
const errorPayload = getErrorEventPayload(cardStatus, fileAttributes, error, ssrReliability, traceContext, metadataTraceContext);
|
|
22
19
|
fireMediaCardEvent(errorPayload, createAnalyticsEvent);
|
|
@@ -11,7 +11,7 @@ import { abortUfoExperience, completeUfoExperience, startUfoExperience, shouldPe
|
|
|
11
11
|
import { useCurrentValueRef } from '../utils/useCurrentValueRef';
|
|
12
12
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
13
13
|
import { usePrevious } from '../utils/usePrevious';
|
|
14
|
-
import { fireOperationalEvent
|
|
14
|
+
import { fireOperationalEvent } from './cardAnalytics';
|
|
15
15
|
import { CardView } from './cardView';
|
|
16
16
|
import { performanceNow } from './performance';
|
|
17
17
|
export const ExternalImageCard = ({
|
|
@@ -103,9 +103,6 @@ export const ExternalImageCard = ({
|
|
|
103
103
|
createAnalyticsEvent && fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error, traceContext, undefined);
|
|
104
104
|
shouldSendPerformanceEventRef.current && completeUfoExperience(internalOccurrenceKey, status, fileAttributes, fileStateFlagsRef.current, ssrReliability, error);
|
|
105
105
|
});
|
|
106
|
-
const fireScreenEventRef = useCurrentValueRef(() => {
|
|
107
|
-
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, fileAttributes);
|
|
108
|
-
});
|
|
109
106
|
const fireAbortedEventRef = useCurrentValueRef(() => {
|
|
110
107
|
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
111
108
|
if (shouldSendPerformanceEventRef.current) {
|
|
@@ -135,13 +132,6 @@ export const ExternalImageCard = ({
|
|
|
135
132
|
setStatus('complete');
|
|
136
133
|
}
|
|
137
134
|
}, [previewDidRender, status]);
|
|
138
|
-
useEffect(() => {
|
|
139
|
-
if (prevStatus !== undefined && status !== prevStatus) {
|
|
140
|
-
if (status === 'complete') {
|
|
141
|
-
fireScreenEventRef.current();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}, [fireScreenEventRef, prevStatus, status]);
|
|
145
135
|
useEffect(() => {
|
|
146
136
|
return () => {
|
|
147
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -16,7 +16,7 @@ import { useCurrentValueRef } from '../utils/useCurrentValueRef';
|
|
|
16
16
|
import { usePrevious } from '../utils/usePrevious';
|
|
17
17
|
import { ViewportDetector } from '../utils/viewportDetector';
|
|
18
18
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
19
|
-
import { fireNonCriticalErrorEvent, fireOperationalEvent,
|
|
19
|
+
import { fireNonCriticalErrorEvent, fireOperationalEvent, fireDownloadSucceededEvent, fireDownloadFailedEvent } from './cardAnalytics';
|
|
20
20
|
import { CardView } from './cardView';
|
|
21
21
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
22
22
|
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
@@ -257,9 +257,6 @@ export const FileCard = ({
|
|
|
257
257
|
fireNonCriticalErrorEventRef.current(nonCriticalError);
|
|
258
258
|
}
|
|
259
259
|
}, [nonCriticalError, fireNonCriticalErrorEventRef]);
|
|
260
|
-
const fireScreenEventRef = useCurrentValueRef(() => {
|
|
261
|
-
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, fileAttributes);
|
|
262
|
-
});
|
|
263
260
|
const startUfoExperienceRef = useCurrentValueRef(() => {
|
|
264
261
|
if (shouldSendPerformanceEventRef.current) {
|
|
265
262
|
startUfoExperience(internalOccurrenceKey);
|
|
@@ -395,18 +392,6 @@ export const FileCard = ({
|
|
|
395
392
|
}
|
|
396
393
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
397
394
|
|
|
398
|
-
//----------------------------------------------------------------//
|
|
399
|
-
//----------------- fireScreenEvent ------------------------------//
|
|
400
|
-
//----------------------------------------------------------------//
|
|
401
|
-
|
|
402
|
-
useEffect(() => {
|
|
403
|
-
if (prevStatus !== undefined && finalStatus !== prevStatus) {
|
|
404
|
-
if (finalStatus === 'complete' || fileAttributes.fileMediatype === 'video' && !!preview && finalStatus === 'processing') {
|
|
405
|
-
fireScreenEventRef.current();
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}, [finalStatus, prevStatus, fileAttributes, preview, fireScreenEventRef]);
|
|
409
|
-
|
|
410
395
|
//----------------------------------------------------------------//
|
|
411
396
|
//----------------- abort UFO experience -------------------------//
|
|
412
397
|
//----------------------------------------------------------------//
|
|
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
|
|
|
66
66
|
}
|
|
67
67
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
68
68
|
const packageName = "@atlaskit/media-card";
|
|
69
|
-
const packageVersion = "79.0.
|
|
69
|
+
const packageVersion = "79.0.4";
|
|
70
70
|
|
|
71
71
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
72
72
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
|
|
|
37
37
|
} = this.state;
|
|
38
38
|
const analyticsContext = {
|
|
39
39
|
packageVersion: "@atlaskit/media-card",
|
|
40
|
-
packageName: "79.0.
|
|
40
|
+
packageName: "79.0.4",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -8,16 +8,6 @@ export const getFileAttributes = (metadata, fileStatus) => ({
|
|
|
8
8
|
fileSize: metadata.size,
|
|
9
9
|
fileStatus
|
|
10
10
|
});
|
|
11
|
-
export const getRenderPreviewableCardPayload = fileAttributes => ({
|
|
12
|
-
eventType: 'screen',
|
|
13
|
-
action: 'viewed',
|
|
14
|
-
actionSubject: 'mediaCardRenderScreen',
|
|
15
|
-
name: 'mediaCardRenderScreen',
|
|
16
|
-
attributes: {
|
|
17
|
-
type: fileAttributes.fileMediatype,
|
|
18
|
-
fileAttributes
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
11
|
export const getRenderSucceededEventPayload = (fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) => ({
|
|
22
12
|
eventType: 'operational',
|
|
23
13
|
action: 'succeeded',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getFileAttributes,
|
|
1
|
+
export { getFileAttributes, getRenderSucceededEventPayload, getCacheHitEventPayload, getRemoteSuccessEventPayload, getRenderFailedExternalUriPayload, getRenderErrorFailReason, getRenderErrorErrorReason, getRenderErrorErrorDetail, getErrorTraceContext, getRenderErrorRequestMetadata, extractErrorInfo, getRenderErrorEventPayload, getErrorEventPayload, getRenderFailedFileStatusPayload, fireMediaCardEvent, createAndFireMediaCardEvent, getDownloadSucceededEventPayload, getDownloadFailedEventPayload } from './analytics';
|
|
@@ -5,7 +5,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
6
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
7
7
|
const packageName = "@atlaskit/media-card";
|
|
8
|
-
const packageVersion = "79.0.
|
|
8
|
+
const packageVersion = "79.0.4";
|
|
9
9
|
const SAMPLE_RATE = 0.05;
|
|
10
10
|
let concurrentExperience;
|
|
11
11
|
const getExperience = id => {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -11,7 +11,7 @@ import { startResourceObserver, setAnalyticsContext } from '../utils/mediaPerfor
|
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
12
|
import UFOLabel from '@atlaskit/react-ufo/label';
|
|
13
13
|
var packageName = "@atlaskit/media-card";
|
|
14
|
-
var packageVersion = "79.0.
|
|
14
|
+
var packageVersion = "79.0.4";
|
|
15
15
|
export var CardBase = function CardBase(_ref) {
|
|
16
16
|
var identifier = _ref.identifier,
|
|
17
17
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload,
|
|
1
|
+
import { fireMediaCardEvent, getRenderSucceededEventPayload, getRenderErrorEventPayload, getRenderFailedFileStatusPayload, getErrorEventPayload, getDownloadSucceededEventPayload, getDownloadFailedEventPayload } from '../utils/analytics';
|
|
2
2
|
import { MediaCardError } from '../errors';
|
|
3
3
|
export var fireOperationalEvent = function fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability) {
|
|
4
4
|
var error = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : new MediaCardError('missing-error-data');
|
|
@@ -19,9 +19,6 @@ export var fireOperationalEvent = function fireOperationalEvent(createAnalyticsE
|
|
|
19
19
|
break;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
export var fireScreenEvent = function fireScreenEvent(createAnalyticsEvent, fileAttributes) {
|
|
23
|
-
fireMediaCardEvent(getRenderPreviewableCardPayload(fileAttributes), createAnalyticsEvent);
|
|
24
|
-
};
|
|
25
22
|
export var fireNonCriticalErrorEvent = function fireNonCriticalErrorEvent(createAnalyticsEvent, cardStatus, fileAttributes, ssrReliability) {
|
|
26
23
|
var error = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new MediaCardError('missing-error-data');
|
|
27
24
|
var traceContext = arguments.length > 5 ? arguments[5] : undefined;
|
|
@@ -15,7 +15,7 @@ import { abortUfoExperience, completeUfoExperience, startUfoExperience, shouldPe
|
|
|
15
15
|
import { useCurrentValueRef } from '../utils/useCurrentValueRef';
|
|
16
16
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
17
17
|
import { usePrevious } from '../utils/usePrevious';
|
|
18
|
-
import { fireOperationalEvent
|
|
18
|
+
import { fireOperationalEvent } from './cardAnalytics';
|
|
19
19
|
import { CardView } from './cardView';
|
|
20
20
|
import { performanceNow } from './performance';
|
|
21
21
|
export var ExternalImageCard = function ExternalImageCard(_ref) {
|
|
@@ -128,9 +128,6 @@ export var ExternalImageCard = function ExternalImageCard(_ref) {
|
|
|
128
128
|
createAnalyticsEvent && fireOperationalEvent(createAnalyticsEvent, status, fileAttributes, performanceAttributes, ssrReliability, error, traceContext, undefined);
|
|
129
129
|
shouldSendPerformanceEventRef.current && completeUfoExperience(internalOccurrenceKey, status, fileAttributes, fileStateFlagsRef.current, ssrReliability, error);
|
|
130
130
|
});
|
|
131
|
-
var fireScreenEventRef = useCurrentValueRef(function () {
|
|
132
|
-
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, fileAttributes);
|
|
133
|
-
});
|
|
134
131
|
var fireAbortedEventRef = useCurrentValueRef(function () {
|
|
135
132
|
// UFO won't abort if it's already in a final state (succeeded, failed, aborted, etc)
|
|
136
133
|
if (shouldSendPerformanceEventRef.current) {
|
|
@@ -160,13 +157,6 @@ export var ExternalImageCard = function ExternalImageCard(_ref) {
|
|
|
160
157
|
setStatus('complete');
|
|
161
158
|
}
|
|
162
159
|
}, [previewDidRender, status]);
|
|
163
|
-
useEffect(function () {
|
|
164
|
-
if (prevStatus !== undefined && status !== prevStatus) {
|
|
165
|
-
if (status === 'complete') {
|
|
166
|
-
fireScreenEventRef.current();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}, [fireScreenEventRef, prevStatus, status]);
|
|
170
160
|
useEffect(function () {
|
|
171
161
|
return function () {
|
|
172
162
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -23,7 +23,7 @@ import { useCurrentValueRef } from '../utils/useCurrentValueRef';
|
|
|
23
23
|
import { usePrevious } from '../utils/usePrevious';
|
|
24
24
|
import { ViewportDetector } from '../utils/viewportDetector';
|
|
25
25
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
26
|
-
import { fireNonCriticalErrorEvent, fireOperationalEvent,
|
|
26
|
+
import { fireNonCriticalErrorEvent, fireOperationalEvent, fireDownloadSucceededEvent, fireDownloadFailedEvent } from './cardAnalytics';
|
|
27
27
|
import { CardView } from './cardView';
|
|
28
28
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
29
29
|
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
@@ -328,9 +328,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
328
328
|
fireNonCriticalErrorEventRef.current(nonCriticalError);
|
|
329
329
|
}
|
|
330
330
|
}, [nonCriticalError, fireNonCriticalErrorEventRef]);
|
|
331
|
-
var fireScreenEventRef = useCurrentValueRef(function () {
|
|
332
|
-
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, fileAttributes);
|
|
333
|
-
});
|
|
334
331
|
var startUfoExperienceRef = useCurrentValueRef(function () {
|
|
335
332
|
if (shouldSendPerformanceEventRef.current) {
|
|
336
333
|
startUfoExperience(internalOccurrenceKey);
|
|
@@ -465,18 +462,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
465
462
|
}
|
|
466
463
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
467
464
|
|
|
468
|
-
//----------------------------------------------------------------//
|
|
469
|
-
//----------------- fireScreenEvent ------------------------------//
|
|
470
|
-
//----------------------------------------------------------------//
|
|
471
|
-
|
|
472
|
-
useEffect(function () {
|
|
473
|
-
if (prevStatus !== undefined && finalStatus !== prevStatus) {
|
|
474
|
-
if (finalStatus === 'complete' || fileAttributes.fileMediatype === 'video' && !!preview && finalStatus === 'processing') {
|
|
475
|
-
fireScreenEventRef.current();
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}, [finalStatus, prevStatus, fileAttributes, preview, fireScreenEventRef]);
|
|
479
|
-
|
|
480
465
|
//----------------------------------------------------------------//
|
|
481
466
|
//----------------- abort UFO experience -------------------------//
|
|
482
467
|
//----------------------------------------------------------------//
|
|
@@ -80,7 +80,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
80
80
|
}(React.Component);
|
|
81
81
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
82
82
|
var packageName = "@atlaskit/media-card";
|
|
83
|
-
var packageVersion = "79.0.
|
|
83
|
+
var packageVersion = "79.0.4";
|
|
84
84
|
|
|
85
85
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
86
86
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
@@ -101,7 +101,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
101
101
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
102
102
|
var analyticsContext = {
|
|
103
103
|
packageVersion: "@atlaskit/media-card",
|
|
104
|
-
packageName: "79.0.
|
|
104
|
+
packageName: "79.0.4",
|
|
105
105
|
componentName: 'mediaInlineCard',
|
|
106
106
|
component: 'mediaInlineCard'
|
|
107
107
|
};
|
|
@@ -13,18 +13,6 @@ export var getFileAttributes = function getFileAttributes(metadata, fileStatus)
|
|
|
13
13
|
fileStatus: fileStatus
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export var getRenderPreviewableCardPayload = function getRenderPreviewableCardPayload(fileAttributes) {
|
|
17
|
-
return {
|
|
18
|
-
eventType: 'screen',
|
|
19
|
-
action: 'viewed',
|
|
20
|
-
actionSubject: 'mediaCardRenderScreen',
|
|
21
|
-
name: 'mediaCardRenderScreen',
|
|
22
|
-
attributes: {
|
|
23
|
-
type: fileAttributes.fileMediatype,
|
|
24
|
-
fileAttributes: fileAttributes
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
16
|
export var getRenderSucceededEventPayload = function getRenderSucceededEventPayload(fileAttributes, performanceAttributes, ssrReliability, traceContext, metadataTraceContext) {
|
|
29
17
|
return {
|
|
30
18
|
eventType: 'operational',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getFileAttributes,
|
|
1
|
+
export { getFileAttributes, getRenderSucceededEventPayload, getCacheHitEventPayload, getRemoteSuccessEventPayload, getRenderFailedExternalUriPayload, getRenderErrorFailReason, getRenderErrorErrorReason, getRenderErrorErrorDetail, getErrorTraceContext, getRenderErrorRequestMetadata, extractErrorInfo, getRenderErrorEventPayload, getErrorEventPayload, getRenderFailedFileStatusPayload, fireMediaCardEvent, createAndFireMediaCardEvent, getDownloadSucceededEventPayload, getDownloadFailedEventPayload } from './analytics';
|
|
@@ -8,7 +8,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
8
8
|
import { MediaCardError } from '../errors';
|
|
9
9
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
10
10
|
var packageName = "@atlaskit/media-card";
|
|
11
|
-
var packageVersion = "79.0.
|
|
11
|
+
var packageVersion = "79.0.4";
|
|
12
12
|
var SAMPLE_RATE = 0.05;
|
|
13
13
|
var concurrentExperience;
|
|
14
14
|
var getExperience = function getExperience(id) {
|
|
@@ -4,7 +4,6 @@ import { type SSRStatus } from '../utils/analytics';
|
|
|
4
4
|
import { type CardStatus } from '../types';
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
6
|
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
7
|
-
export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
|
|
8
7
|
export declare const fireNonCriticalErrorEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, cardStatus: CardStatus, fileAttributes: FileAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
9
8
|
export declare const fireDownloadSucceededEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
10
9
|
export declare const fireDownloadFailedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ErrorInfo } from 'react';
|
|
2
2
|
import { type FileDetails, type FileStatus, type MediaClientErrorReason, type RequestMetadata } from '@atlaskit/media-client';
|
|
3
|
-
import { type FileAttributes, type PerformanceAttributes, type OperationalEventPayload, type UIEventPayload, type WithFileAttributes, type WithPerformanceAttributes, type SuccessAttributes, type FailureAttributes, type
|
|
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';
|
|
6
6
|
import { type CardPreviewSource, type CardDimensions, type CardStatus } from '../../types';
|
|
@@ -102,15 +102,8 @@ export type CopiedFileEventPayload = UIEventPayload<{}, 'copied', string>;
|
|
|
102
102
|
export type ClickedEventPayload = UIEventPayload<{
|
|
103
103
|
label?: string;
|
|
104
104
|
}, 'clicked', string>;
|
|
105
|
-
export type
|
|
106
|
-
attributes: {
|
|
107
|
-
type: string | undefined;
|
|
108
|
-
fileAttributes: FileAttributes;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
export type MediaCardAnalyticsEventPayload = RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | RenderScreenEventPayload | CacheHitEventPayload | RemoteSuccessEventPayload | ErrorEventPayload | AnalyticsErrorBoundaryCardPayload | AnalyticsErrorBoundaryInlinePayload | RenderInlineCardFailedEventPayload | RenderInlineCardSucceededEventPayload | DownloadSucceededEventPayload | DownloadFailedEventPayload;
|
|
105
|
+
export type MediaCardAnalyticsEventPayload = RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | CacheHitEventPayload | RemoteSuccessEventPayload | ErrorEventPayload | AnalyticsErrorBoundaryCardPayload | AnalyticsErrorBoundaryInlinePayload | RenderInlineCardFailedEventPayload | RenderInlineCardSucceededEventPayload | DownloadSucceededEventPayload | DownloadFailedEventPayload;
|
|
112
106
|
export declare const getFileAttributes: (metadata: FileDetails, fileStatus?: FileStatus) => FileAttributes;
|
|
113
|
-
export declare const getRenderPreviewableCardPayload: (fileAttributes: FileAttributes) => RenderScreenEventPayload;
|
|
114
107
|
export declare const getRenderSucceededEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderSucceededEventPayload;
|
|
115
108
|
export declare const getDownloadSucceededEventPayload: (fileAttributes: FileAttributes, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => DownloadSucceededEventPayload;
|
|
116
109
|
export declare const getCacheHitEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => CacheHitEventPayload;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { CardPreviewAttributes, FileUriFailReason, FailedErrorFailReason, MediaCardErrorInfo, SSRStatusFail, SSRStatus, WithSSRReliability, RenderFailedEventPayload, ErrorEventPayload, ErrorBoundaryErrorInfo, AnalyticsErrorBoundaryAttributes, AnalyticsErrorBoundaryCardPayload, AnalyticsErrorBoundaryInlinePayload, RenderInlineCardSucceededEventPayload, RenderInlineCardFailedEventPayload, RenderSucceededEventPayload, CacheHitEventPayload, RemoteSuccessEventPayload, CopiedFileEventPayload, ClickedEventPayload,
|
|
2
|
-
export { getFileAttributes,
|
|
1
|
+
export type { CardPreviewAttributes, FileUriFailReason, FailedErrorFailReason, MediaCardErrorInfo, SSRStatusFail, SSRStatus, WithSSRReliability, RenderFailedEventPayload, ErrorEventPayload, ErrorBoundaryErrorInfo, AnalyticsErrorBoundaryAttributes, AnalyticsErrorBoundaryCardPayload, AnalyticsErrorBoundaryInlinePayload, RenderInlineCardSucceededEventPayload, RenderInlineCardFailedEventPayload, RenderSucceededEventPayload, CacheHitEventPayload, RemoteSuccessEventPayload, CopiedFileEventPayload, ClickedEventPayload, MediaCardAnalyticsEventPayload, } from './analytics';
|
|
2
|
+
export { getFileAttributes, getRenderSucceededEventPayload, getCacheHitEventPayload, getRemoteSuccessEventPayload, getRenderFailedExternalUriPayload, getRenderErrorFailReason, getRenderErrorErrorReason, getRenderErrorErrorDetail, getErrorTraceContext, getRenderErrorRequestMetadata, extractErrorInfo, getRenderErrorEventPayload, getErrorEventPayload, getRenderFailedFileStatusPayload, fireMediaCardEvent, createAndFireMediaCardEvent, getDownloadSucceededEventPayload, getDownloadFailedEventPayload, } from './analytics';
|
|
@@ -4,7 +4,6 @@ import { type SSRStatus } from '../utils/analytics';
|
|
|
4
4
|
import { type CardStatus } from '../types';
|
|
5
5
|
import { MediaCardError } from '../errors';
|
|
6
6
|
export declare const fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, status: CardStatus, fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
7
|
-
export declare const fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes) => void;
|
|
8
7
|
export declare const fireNonCriticalErrorEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, cardStatus: CardStatus, fileAttributes: FileAttributes, ssrReliability: SSRStatus, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
9
8
|
export declare const fireDownloadSucceededEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
10
9
|
export declare const fireDownloadFailedEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent, fileAttributes: FileAttributes, error: MediaCardError | undefined, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ErrorInfo } from 'react';
|
|
2
2
|
import { type FileDetails, type FileStatus, type MediaClientErrorReason, type RequestMetadata } from '@atlaskit/media-client';
|
|
3
|
-
import { type FileAttributes, type PerformanceAttributes, type OperationalEventPayload, type UIEventPayload, type WithFileAttributes, type WithPerformanceAttributes, type SuccessAttributes, type FailureAttributes, type
|
|
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';
|
|
6
6
|
import { type CardPreviewSource, type CardDimensions, type CardStatus } from '../../types';
|
|
@@ -102,15 +102,8 @@ export type CopiedFileEventPayload = UIEventPayload<{}, 'copied', string>;
|
|
|
102
102
|
export type ClickedEventPayload = UIEventPayload<{
|
|
103
103
|
label?: string;
|
|
104
104
|
}, 'clicked', string>;
|
|
105
|
-
export type
|
|
106
|
-
attributes: {
|
|
107
|
-
type: string | undefined;
|
|
108
|
-
fileAttributes: FileAttributes;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
export type MediaCardAnalyticsEventPayload = RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | RenderScreenEventPayload | CacheHitEventPayload | RemoteSuccessEventPayload | ErrorEventPayload | AnalyticsErrorBoundaryCardPayload | AnalyticsErrorBoundaryInlinePayload | RenderInlineCardFailedEventPayload | RenderInlineCardSucceededEventPayload | DownloadSucceededEventPayload | DownloadFailedEventPayload;
|
|
105
|
+
export type MediaCardAnalyticsEventPayload = RenderSucceededEventPayload | RenderFailedEventPayload | CopiedFileEventPayload | ClickedEventPayload | CacheHitEventPayload | RemoteSuccessEventPayload | ErrorEventPayload | AnalyticsErrorBoundaryCardPayload | AnalyticsErrorBoundaryInlinePayload | RenderInlineCardFailedEventPayload | RenderInlineCardSucceededEventPayload | DownloadSucceededEventPayload | DownloadFailedEventPayload;
|
|
112
106
|
export declare const getFileAttributes: (metadata: FileDetails, fileStatus?: FileStatus) => FileAttributes;
|
|
113
|
-
export declare const getRenderPreviewableCardPayload: (fileAttributes: FileAttributes) => RenderScreenEventPayload;
|
|
114
107
|
export declare const getRenderSucceededEventPayload: (fileAttributes: FileAttributes, performanceAttributes: PerformanceAttributes, ssrReliability: SSRStatus, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => RenderSucceededEventPayload;
|
|
115
108
|
export declare const getDownloadSucceededEventPayload: (fileAttributes: FileAttributes, traceContext: MediaTraceContext, metadataTraceContext?: MediaTraceContext) => DownloadSucceededEventPayload;
|
|
116
109
|
export declare const getCacheHitEventPayload: (cardPreviewAttributes: CardPreviewAttributes) => CacheHitEventPayload;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { CardPreviewAttributes, FileUriFailReason, FailedErrorFailReason, MediaCardErrorInfo, SSRStatusFail, SSRStatus, WithSSRReliability, RenderFailedEventPayload, ErrorEventPayload, ErrorBoundaryErrorInfo, AnalyticsErrorBoundaryAttributes, AnalyticsErrorBoundaryCardPayload, AnalyticsErrorBoundaryInlinePayload, RenderInlineCardSucceededEventPayload, RenderInlineCardFailedEventPayload, RenderSucceededEventPayload, CacheHitEventPayload, RemoteSuccessEventPayload, CopiedFileEventPayload, ClickedEventPayload,
|
|
2
|
-
export { getFileAttributes,
|
|
1
|
+
export type { CardPreviewAttributes, FileUriFailReason, FailedErrorFailReason, MediaCardErrorInfo, SSRStatusFail, SSRStatus, WithSSRReliability, RenderFailedEventPayload, ErrorEventPayload, ErrorBoundaryErrorInfo, AnalyticsErrorBoundaryAttributes, AnalyticsErrorBoundaryCardPayload, AnalyticsErrorBoundaryInlinePayload, RenderInlineCardSucceededEventPayload, RenderInlineCardFailedEventPayload, RenderSucceededEventPayload, CacheHitEventPayload, RemoteSuccessEventPayload, CopiedFileEventPayload, ClickedEventPayload, MediaCardAnalyticsEventPayload, } from './analytics';
|
|
2
|
+
export { getFileAttributes, getRenderSucceededEventPayload, getCacheHitEventPayload, getRemoteSuccessEventPayload, getRenderFailedExternalUriPayload, getRenderErrorFailReason, getRenderErrorErrorReason, getRenderErrorErrorDetail, getErrorTraceContext, getRenderErrorRequestMetadata, extractErrorInfo, getRenderErrorEventPayload, getErrorEventPayload, getRenderFailedFileStatusPayload, fireMediaCardEvent, createAndFireMediaCardEvent, getDownloadSucceededEventPayload, getDownloadFailedEventPayload, } from './analytics';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "79.0.
|
|
3
|
+
"version": "79.0.4",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/react-ufo": "^3.1.0",
|
|
54
54
|
"@atlaskit/spinner": "^18.0.0",
|
|
55
55
|
"@atlaskit/theme": "^17.0.0",
|
|
56
|
-
"@atlaskit/tokens": "^4.
|
|
56
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.0.0",
|
|
58
58
|
"@atlaskit/ufo": "^0.4.0",
|
|
59
59
|
"@atlaskit/visually-hidden": "^2.0.0",
|