@atlaskit/media-card 79.0.2 → 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 +17 -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 +1 -25
- 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 +2 -26
- 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 +2 -26
- 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 +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
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
|
+
|
|
11
|
+
## 79.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#117537](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/117537)
|
|
16
|
+
[`1aafb49d776e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1aafb49d776e0) -
|
|
17
|
+
Integrated Media Viewer with internal DS Portal (removed feature flag)
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 79.0.2
|
|
4
21
|
|
|
5
22
|
### 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
|
|
@@ -17,7 +17,6 @@ var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
|
17
17
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
18
18
|
var _mediaViewer = require("@atlaskit/media-viewer");
|
|
19
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
21
20
|
var _useCallbackRef = require("use-callback-ref");
|
|
22
21
|
var _errors = require("../errors");
|
|
23
22
|
var _types = require("../types");
|
|
@@ -39,18 +38,10 @@ var _performance = require("./performance");
|
|
|
39
38
|
var _dateOverrideContext = require("../dateOverrideContext");
|
|
40
39
|
var _reactIntlNext = require("react-intl-next");
|
|
41
40
|
var _abuseModal = require("@atlaskit/media-ui/abuseModal");
|
|
42
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
43
41
|
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); }
|
|
44
42
|
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; }
|
|
45
43
|
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; }
|
|
46
44
|
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; }
|
|
47
|
-
var MediaViewerComponent = function MediaViewerComponent(props) {
|
|
48
|
-
if ((0, _platformFeatureFlags.fg)('media_viewer_integrates_ds_portal')) {
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, props);
|
|
50
|
-
} else {
|
|
51
|
-
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, props), document.body);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
45
|
var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
55
46
|
var _ref$appearance = _ref.appearance,
|
|
56
47
|
appearance = _ref$appearance === void 0 ? 'auto' : _ref$appearance,
|
|
@@ -346,9 +337,6 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
346
337
|
fireNonCriticalErrorEventRef.current(nonCriticalError);
|
|
347
338
|
}
|
|
348
339
|
}, [nonCriticalError, fireNonCriticalErrorEventRef]);
|
|
349
|
-
var fireScreenEventRef = (0, _useCurrentValueRef.useCurrentValueRef)(function () {
|
|
350
|
-
createAnalyticsEvent && (0, _cardAnalytics.fireScreenEvent)(createAnalyticsEvent, fileAttributes);
|
|
351
|
-
});
|
|
352
340
|
var startUfoExperienceRef = (0, _useCurrentValueRef.useCurrentValueRef)(function () {
|
|
353
341
|
if (shouldSendPerformanceEventRef.current) {
|
|
354
342
|
(0, _ufoExperiences.startUfoExperience)(internalOccurrenceKey);
|
|
@@ -483,18 +471,6 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
483
471
|
}
|
|
484
472
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
485
473
|
|
|
486
|
-
//----------------------------------------------------------------//
|
|
487
|
-
//----------------- fireScreenEvent ------------------------------//
|
|
488
|
-
//----------------------------------------------------------------//
|
|
489
|
-
|
|
490
|
-
(0, _react.useEffect)(function () {
|
|
491
|
-
if (prevStatus !== undefined && finalStatus !== prevStatus) {
|
|
492
|
-
if (finalStatus === 'complete' || fileAttributes.fileMediatype === 'video' && !!preview && finalStatus === 'processing') {
|
|
493
|
-
fireScreenEventRef.current();
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}, [finalStatus, prevStatus, fileAttributes, preview, fireScreenEventRef]);
|
|
497
|
-
|
|
498
474
|
//----------------------------------------------------------------//
|
|
499
475
|
//----------------- abort UFO experience -------------------------//
|
|
500
476
|
//----------------------------------------------------------------//
|
|
@@ -670,7 +646,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
|
|
|
670
646
|
testId: testId,
|
|
671
647
|
cardPreview: preview,
|
|
672
648
|
videoControlsWrapperRef: videoControlsWrapperRef
|
|
673
|
-
})) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/_react.default.createElement(
|
|
649
|
+
})) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
|
|
674
650
|
collectionName: collectionName,
|
|
675
651
|
items: mediaViewerItems || [],
|
|
676
652
|
mediaClientConfig: mediaClient.config,
|
|
@@ -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
|
|
@@ -4,7 +4,6 @@ import { useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
|
4
4
|
import { getRandomHex, isMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
5
5
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
6
6
|
import React, { Suspense, useEffect, useMemo, useRef, useState, useCallback } from 'react';
|
|
7
|
-
import ReactDOM from 'react-dom';
|
|
8
7
|
import { useMergeRefs } from 'use-callback-ref';
|
|
9
8
|
import { MediaCardError } from '../errors';
|
|
10
9
|
import { isSSRPreview } from '../types';
|
|
@@ -17,7 +16,7 @@ import { useCurrentValueRef } from '../utils/useCurrentValueRef';
|
|
|
17
16
|
import { usePrevious } from '../utils/usePrevious';
|
|
18
17
|
import { ViewportDetector } from '../utils/viewportDetector';
|
|
19
18
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
20
|
-
import { fireNonCriticalErrorEvent, fireOperationalEvent,
|
|
19
|
+
import { fireNonCriticalErrorEvent, fireOperationalEvent, fireDownloadSucceededEvent, fireDownloadFailedEvent } from './cardAnalytics';
|
|
21
20
|
import { CardView } from './cardView';
|
|
22
21
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
23
22
|
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
@@ -27,14 +26,6 @@ import { useContext } from 'react';
|
|
|
27
26
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
28
27
|
import { useIntl } from 'react-intl-next';
|
|
29
28
|
import { AbuseModal } from '@atlaskit/media-ui/abuseModal';
|
|
30
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
31
|
-
const MediaViewerComponent = props => {
|
|
32
|
-
if (fg('media_viewer_integrates_ds_portal')) {
|
|
33
|
-
return /*#__PURE__*/React.createElement(MediaViewer, props);
|
|
34
|
-
} else {
|
|
35
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, props), document.body);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
29
|
export const FileCard = ({
|
|
39
30
|
appearance = 'auto',
|
|
40
31
|
resizeMode = 'crop',
|
|
@@ -266,9 +257,6 @@ export const FileCard = ({
|
|
|
266
257
|
fireNonCriticalErrorEventRef.current(nonCriticalError);
|
|
267
258
|
}
|
|
268
259
|
}, [nonCriticalError, fireNonCriticalErrorEventRef]);
|
|
269
|
-
const fireScreenEventRef = useCurrentValueRef(() => {
|
|
270
|
-
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, fileAttributes);
|
|
271
|
-
});
|
|
272
260
|
const startUfoExperienceRef = useCurrentValueRef(() => {
|
|
273
261
|
if (shouldSendPerformanceEventRef.current) {
|
|
274
262
|
startUfoExperience(internalOccurrenceKey);
|
|
@@ -404,18 +392,6 @@ export const FileCard = ({
|
|
|
404
392
|
}
|
|
405
393
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
406
394
|
|
|
407
|
-
//----------------------------------------------------------------//
|
|
408
|
-
//----------------- fireScreenEvent ------------------------------//
|
|
409
|
-
//----------------------------------------------------------------//
|
|
410
|
-
|
|
411
|
-
useEffect(() => {
|
|
412
|
-
if (prevStatus !== undefined && finalStatus !== prevStatus) {
|
|
413
|
-
if (finalStatus === 'complete' || fileAttributes.fileMediatype === 'video' && !!preview && finalStatus === 'processing') {
|
|
414
|
-
fireScreenEventRef.current();
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}, [finalStatus, prevStatus, fileAttributes, preview, fireScreenEventRef]);
|
|
418
|
-
|
|
419
395
|
//----------------------------------------------------------------//
|
|
420
396
|
//----------------- abort UFO experience -------------------------//
|
|
421
397
|
//----------------------------------------------------------------//
|
|
@@ -589,7 +565,7 @@ export const FileCard = ({
|
|
|
589
565
|
testId: testId,
|
|
590
566
|
cardPreview: preview,
|
|
591
567
|
videoControlsWrapperRef: videoControlsWrapperRef
|
|
592
|
-
})) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/React.createElement(
|
|
568
|
+
})) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/React.createElement(MediaViewer, {
|
|
593
569
|
collectionName: collectionName,
|
|
594
570
|
items: mediaViewerItems || [],
|
|
595
571
|
mediaClientConfig: mediaClient.config,
|
|
@@ -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
|
|
@@ -11,7 +11,6 @@ import { useFileState, useMediaClient } from '@atlaskit/media-client-react';
|
|
|
11
11
|
import { getRandomHex, isMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
|
|
12
12
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
13
13
|
import React, { Suspense, useEffect, useMemo, useRef, useState, useCallback } from 'react';
|
|
14
|
-
import ReactDOM from 'react-dom';
|
|
15
14
|
import { useMergeRefs } from 'use-callback-ref';
|
|
16
15
|
import { MediaCardError } from '../errors';
|
|
17
16
|
import { isSSRPreview } from '../types';
|
|
@@ -24,7 +23,7 @@ import { useCurrentValueRef } from '../utils/useCurrentValueRef';
|
|
|
24
23
|
import { usePrevious } from '../utils/usePrevious';
|
|
25
24
|
import { ViewportDetector } from '../utils/viewportDetector';
|
|
26
25
|
import { getDefaultCardDimensions } from '../utils/cardDimensions';
|
|
27
|
-
import { fireNonCriticalErrorEvent, fireOperationalEvent,
|
|
26
|
+
import { fireNonCriticalErrorEvent, fireOperationalEvent, fireDownloadSucceededEvent, fireDownloadFailedEvent } from './cardAnalytics';
|
|
28
27
|
import { CardView } from './cardView';
|
|
29
28
|
import { InlinePlayerLazy } from './inlinePlayerLazy';
|
|
30
29
|
import { useFilePreview } from '@atlaskit/media-file-preview';
|
|
@@ -34,14 +33,6 @@ import { useContext } from 'react';
|
|
|
34
33
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
35
34
|
import { useIntl } from 'react-intl-next';
|
|
36
35
|
import { AbuseModal } from '@atlaskit/media-ui/abuseModal';
|
|
37
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
38
|
-
var MediaViewerComponent = function MediaViewerComponent(props) {
|
|
39
|
-
if (fg('media_viewer_integrates_ds_portal')) {
|
|
40
|
-
return /*#__PURE__*/React.createElement(MediaViewer, props);
|
|
41
|
-
} else {
|
|
42
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(MediaViewer, props), document.body);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
36
|
export var FileCard = function FileCard(_ref) {
|
|
46
37
|
var _ref$appearance = _ref.appearance,
|
|
47
38
|
appearance = _ref$appearance === void 0 ? 'auto' : _ref$appearance,
|
|
@@ -337,9 +328,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
337
328
|
fireNonCriticalErrorEventRef.current(nonCriticalError);
|
|
338
329
|
}
|
|
339
330
|
}, [nonCriticalError, fireNonCriticalErrorEventRef]);
|
|
340
|
-
var fireScreenEventRef = useCurrentValueRef(function () {
|
|
341
|
-
createAnalyticsEvent && fireScreenEvent(createAnalyticsEvent, fileAttributes);
|
|
342
|
-
});
|
|
343
331
|
var startUfoExperienceRef = useCurrentValueRef(function () {
|
|
344
332
|
if (shouldSendPerformanceEventRef.current) {
|
|
345
333
|
startUfoExperience(internalOccurrenceKey);
|
|
@@ -474,18 +462,6 @@ export var FileCard = function FileCard(_ref) {
|
|
|
474
462
|
}
|
|
475
463
|
}, [isCardVisible, disableOverlay, fileAttributes.fileMediatype, fileStateValue, identifier, isPlayingFile, finalStatus, useInlinePlayer]);
|
|
476
464
|
|
|
477
|
-
//----------------------------------------------------------------//
|
|
478
|
-
//----------------- fireScreenEvent ------------------------------//
|
|
479
|
-
//----------------------------------------------------------------//
|
|
480
|
-
|
|
481
|
-
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
465
|
//----------------------------------------------------------------//
|
|
490
466
|
//----------------- abort UFO experience -------------------------//
|
|
491
467
|
//----------------------------------------------------------------//
|
|
@@ -661,7 +637,7 @@ export var FileCard = function FileCard(_ref) {
|
|
|
661
637
|
testId: testId,
|
|
662
638
|
cardPreview: preview,
|
|
663
639
|
videoControlsWrapperRef: videoControlsWrapperRef
|
|
664
|
-
})) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/React.createElement(
|
|
640
|
+
})) : renderCard(), mediaViewerSelectedItem ? /*#__PURE__*/React.createElement(MediaViewer, {
|
|
665
641
|
collectionName: collectionName,
|
|
666
642
|
items: mediaViewerItems || [],
|
|
667
643
|
mediaClientConfig: mediaClient.config,
|
|
@@ -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/"
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@atlaskit/media-file-preview": "^0.11.0",
|
|
48
48
|
"@atlaskit/media-svg": "^2.0.0",
|
|
49
49
|
"@atlaskit/media-ui": "^28.0.0",
|
|
50
|
-
"@atlaskit/media-viewer": "^
|
|
50
|
+
"@atlaskit/media-viewer": "^52.0.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
52
52
|
"@atlaskit/primitives": "^14.1.0",
|
|
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",
|
|
@@ -118,9 +118,6 @@
|
|
|
118
118
|
"platform_media_cdn_single_host": {
|
|
119
119
|
"type": "boolean"
|
|
120
120
|
},
|
|
121
|
-
"media_viewer_integrates_ds_portal": {
|
|
122
|
-
"type": "boolean"
|
|
123
|
-
},
|
|
124
121
|
"platform_media_compiled": {
|
|
125
122
|
"type": "boolean"
|
|
126
123
|
}
|