@atlaskit/media-card 77.8.0 → 77.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/inline/index.js +14 -1
- package/dist/cjs/inline/loader.js +1 -1
- package/dist/cjs/inline/mediaInlineCardAnalytics.js +13 -1
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/es2019/card/card.js +1 -1
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/inline/index.js +2 -1
- package/dist/es2019/inline/loader.js +1 -1
- package/dist/es2019/inline/mediaInlineCardAnalytics.js +10 -1
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/esm/card/card.js +1 -1
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/inline/index.js +2 -1
- package/dist/esm/inline/loader.js +1 -1
- package/dist/esm/inline/mediaInlineCardAnalytics.js +13 -1
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/inline/index.d.ts +1 -0
- package/dist/types/inline/mediaInlineCardAnalytics.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/inline/index.d.ts +1 -0
- package/dist/types-ts4.5/inline/mediaInlineCardAnalytics.d.ts +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#71201](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71201) [`1b48cdd3c074`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b48cdd3c074) - ED-21767 export inline image analytic function.
|
|
8
|
+
|
|
3
9
|
## 77.8.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/cjs/card/card.js
CHANGED
|
@@ -50,7 +50,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
50
50
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
51
51
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
52
52
|
var packageName = "@atlaskit/media-card";
|
|
53
|
-
var packageVersion = "77.
|
|
53
|
+
var packageVersion = "77.9.0";
|
|
54
54
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
55
55
|
(0, _inherits2.default)(CardBase, _Component);
|
|
56
56
|
var _super = _createSuper(CardBase);
|
|
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
90
90
|
}(_react.default.Component);
|
|
91
91
|
(0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
92
92
|
var packageName = "@atlaskit/media-card";
|
|
93
|
-
var packageVersion = "77.
|
|
93
|
+
var packageVersion = "77.9.0";
|
|
94
94
|
var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
95
95
|
packageVersion: packageVersion,
|
|
96
96
|
packageName: packageName,
|
|
@@ -16,7 +16,7 @@ var _externalImageCard = require("./externalImageCard");
|
|
|
16
16
|
var _fileCard = require("./fileCard");
|
|
17
17
|
var _excluded = ["identifier"];
|
|
18
18
|
var packageName = "@atlaskit/media-card";
|
|
19
|
-
var packageVersion = "77.
|
|
19
|
+
var packageVersion = "77.9.0";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
package/dist/cjs/index.js
CHANGED
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "DateOverrideContext", {
|
|
|
27
27
|
return _dateOverrideContext.DateOverrideContext;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "MediaCardError", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _errors.MediaCardError;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "MediaInlineCard", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function get() {
|
|
@@ -45,6 +51,18 @@ Object.defineProperty(exports, "fileCardImageViewSelector", {
|
|
|
45
51
|
return _classnames.fileCardImageViewSelector;
|
|
46
52
|
}
|
|
47
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "fireFailedMediaInlineEvent", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _inline.fireFailedMediaInlineEvent;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "fireSucceededMediaInlineEvent", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _inline.fireSucceededMediaInlineEvent;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
48
66
|
Object.defineProperty(exports, "inlinePlayerClassName", {
|
|
49
67
|
enumerable: true,
|
|
50
68
|
get: function get() {
|
|
@@ -59,6 +77,7 @@ Object.defineProperty(exports, "newFileExperienceClassName", {
|
|
|
59
77
|
});
|
|
60
78
|
var _card = require("./card");
|
|
61
79
|
var _inline = require("./inline");
|
|
80
|
+
var _errors = require("./errors");
|
|
62
81
|
var _cardLoading = require("./utils/lightCards/cardLoading");
|
|
63
82
|
var _cardError = require("./utils/lightCards/cardError");
|
|
64
83
|
var _cardDimensions = require("./utils/cardDimensions");
|
package/dist/cjs/inline/index.js
CHANGED
|
@@ -10,4 +10,17 @@ Object.defineProperty(exports, "MediaInlineCard", {
|
|
|
10
10
|
return _loader.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
|
|
13
|
+
Object.defineProperty(exports, "fireFailedMediaInlineEvent", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _mediaInlineCardAnalytics.fireFailedOperationalEvent;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "fireSucceededMediaInlineEvent", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _mediaInlineCardAnalytics.fireSucceededOperationalEvent;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var _loader = _interopRequireDefault(require("./loader"));
|
|
26
|
+
var _mediaInlineCardAnalytics = require("./mediaInlineCardAnalytics");
|
|
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
|
|
|
119
119
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
120
120
|
var analyticsContext = {
|
|
121
121
|
packageVersion: "@atlaskit/media-card",
|
|
122
|
-
packageName: "77.
|
|
122
|
+
packageName: "77.9.0",
|
|
123
123
|
componentName: 'mediaInlineCard',
|
|
124
124
|
component: 'mediaInlineCard'
|
|
125
125
|
};
|
|
@@ -4,9 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.getSucceededStatusPayload = exports.getFailedProcessingStatusPayload = exports.getErrorStatusPayload = void 0;
|
|
7
|
+
exports.getSucceededStatusPayload = exports.getFailedProcessingStatusPayload = exports.getErrorStatusPayload = exports.fireSucceededOperationalEvent = exports.fireFailedOperationalEvent = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("../utils/analytics");
|
|
10
|
+
var _errors = require("../errors");
|
|
10
11
|
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; }
|
|
11
12
|
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; }
|
|
12
13
|
var getSucceededStatusPayload = exports.getSucceededStatusPayload = function getSucceededStatusPayload(fileState) {
|
|
@@ -54,4 +55,15 @@ var getFailedProcessingStatusPayload = exports.getFailedProcessingStatusPayload
|
|
|
54
55
|
failReason: 'failed-processing'
|
|
55
56
|
}
|
|
56
57
|
};
|
|
58
|
+
};
|
|
59
|
+
var fireFailedOperationalEvent = exports.fireFailedOperationalEvent = function fireFailedOperationalEvent(fileState) {
|
|
60
|
+
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new _errors.MediaCardError('missing-error-data');
|
|
61
|
+
var failReason = arguments.length > 2 ? arguments[2] : undefined;
|
|
62
|
+
var createAnalyticsEvent = arguments.length > 3 ? arguments[3] : undefined;
|
|
63
|
+
var payload = failReason ? getFailedProcessingStatusPayload(fileState) : getErrorStatusPayload(error, fileState);
|
|
64
|
+
(0, _analytics.fireMediaCardEvent)(payload, createAnalyticsEvent);
|
|
65
|
+
};
|
|
66
|
+
var fireSucceededOperationalEvent = exports.fireSucceededOperationalEvent = function fireSucceededOperationalEvent(fileState, createAnalyticsEvent) {
|
|
67
|
+
var payload = getSucceededStatusPayload(fileState);
|
|
68
|
+
(0, _analytics.fireMediaCardEvent)(payload, createAnalyticsEvent);
|
|
57
69
|
};
|
|
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
|
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
16
|
var packageName = "@atlaskit/media-card";
|
|
17
|
-
var packageVersion = "77.
|
|
17
|
+
var packageVersion = "77.9.0";
|
|
18
18
|
var concurrentExperience;
|
|
19
19
|
var getExperience = function getExperience(id) {
|
|
20
20
|
if (!concurrentExperience) {
|
package/dist/es2019/card/card.js
CHANGED
|
@@ -28,7 +28,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
28
28
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
29
29
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
30
30
|
const packageName = "@atlaskit/media-card";
|
|
31
|
-
const packageVersion = "77.
|
|
31
|
+
const packageVersion = "77.9.0";
|
|
32
32
|
export class CardBase extends Component {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
super(props);
|
|
@@ -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 = "77.
|
|
69
|
+
const packageVersion = "77.9.0";
|
|
70
70
|
const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
71
71
|
packageVersion,
|
|
72
72
|
packageName,
|
|
@@ -7,7 +7,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
7
7
|
import { ExternalImageCard } from './externalImageCard';
|
|
8
8
|
import { FileCard } from './fileCard';
|
|
9
9
|
const packageName = "@atlaskit/media-card";
|
|
10
|
-
const packageVersion = "77.
|
|
10
|
+
const packageVersion = "77.9.0";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
package/dist/es2019/index.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { Card } from './card';
|
|
7
|
-
export { MediaInlineCard } from './inline';
|
|
7
|
+
export { MediaInlineCard, fireFailedMediaInlineEvent, fireSucceededMediaInlineEvent } from './inline';
|
|
8
|
+
export { MediaCardError } from './errors';
|
|
8
9
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
9
10
|
export { CardError } from './utils/lightCards/cardError';
|
|
10
11
|
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as MediaInlineCard } from './loader';
|
|
1
|
+
export { default as MediaInlineCard } from './loader';
|
|
2
|
+
export { fireFailedOperationalEvent as fireFailedMediaInlineEvent, fireSucceededOperationalEvent as fireSucceededMediaInlineEvent } from './mediaInlineCardAnalytics';
|
|
@@ -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: "77.
|
|
40
|
+
packageName: "77.9.0",
|
|
41
41
|
componentName: 'mediaInlineCard',
|
|
42
42
|
component: 'mediaInlineCard'
|
|
43
43
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { extractErrorInfo } from '../utils/analytics';
|
|
1
|
+
import { extractErrorInfo, fireMediaCardEvent } from '../utils/analytics';
|
|
2
|
+
import { MediaCardError } from '../errors';
|
|
2
3
|
export const getSucceededStatusPayload = fileState => {
|
|
3
4
|
return {
|
|
4
5
|
eventType: 'operational',
|
|
@@ -45,4 +46,12 @@ export const getFailedProcessingStatusPayload = fileState => {
|
|
|
45
46
|
failReason: 'failed-processing'
|
|
46
47
|
}
|
|
47
48
|
};
|
|
49
|
+
};
|
|
50
|
+
export const fireFailedOperationalEvent = (fileState, error = new MediaCardError('missing-error-data'), failReason, createAnalyticsEvent) => {
|
|
51
|
+
const payload = failReason ? getFailedProcessingStatusPayload(fileState) : getErrorStatusPayload(error, fileState);
|
|
52
|
+
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
53
|
+
};
|
|
54
|
+
export const fireSucceededOperationalEvent = (fileState, createAnalyticsEvent) => {
|
|
55
|
+
const payload = getSucceededStatusPayload(fileState);
|
|
56
|
+
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
48
57
|
};
|
|
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
4
4
|
import { MediaCardError } from '../errors';
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
const packageName = "@atlaskit/media-card";
|
|
7
|
-
const packageVersion = "77.
|
|
7
|
+
const packageVersion = "77.9.0";
|
|
8
8
|
let concurrentExperience;
|
|
9
9
|
const getExperience = id => {
|
|
10
10
|
if (!concurrentExperience) {
|
package/dist/esm/card/card.js
CHANGED
|
@@ -41,7 +41,7 @@ import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '.
|
|
|
41
41
|
import { generateUniqueId } from '../utils/generateUniqueId';
|
|
42
42
|
import { DateOverrideContext } from '../dateOverrideContext';
|
|
43
43
|
var packageName = "@atlaskit/media-card";
|
|
44
|
-
var packageVersion = "77.
|
|
44
|
+
var packageVersion = "77.9.0";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
var _super = _createSuper(CardBase);
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "77.
|
|
86
|
+
var packageVersion = "77.9.0";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
|
|
|
9
9
|
import { ExternalImageCard } from './externalImageCard';
|
|
10
10
|
import { FileCard } from './fileCard';
|
|
11
11
|
var packageName = "@atlaskit/media-card";
|
|
12
|
-
var packageVersion = "77.
|
|
12
|
+
var packageVersion = "77.9.0";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { Card } from './card';
|
|
7
|
-
export { MediaInlineCard } from './inline';
|
|
7
|
+
export { MediaInlineCard, fireFailedMediaInlineEvent, fireSucceededMediaInlineEvent } from './inline';
|
|
8
|
+
export { MediaCardError } from './errors';
|
|
8
9
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
9
10
|
export { CardError } from './utils/lightCards/cardError';
|
|
10
11
|
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
package/dist/esm/inline/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default as MediaInlineCard } from './loader';
|
|
1
|
+
export { default as MediaInlineCard } from './loader';
|
|
2
|
+
export { fireFailedOperationalEvent as fireFailedMediaInlineEvent, fireSucceededOperationalEvent as fireSucceededMediaInlineEvent } from './mediaInlineCardAnalytics';
|
|
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
103
|
ErrorBoundary = _this$state.ErrorBoundary;
|
|
104
104
|
var analyticsContext = {
|
|
105
105
|
packageVersion: "@atlaskit/media-card",
|
|
106
|
-
packageName: "77.
|
|
106
|
+
packageName: "77.9.0",
|
|
107
107
|
componentName: 'mediaInlineCard',
|
|
108
108
|
component: 'mediaInlineCard'
|
|
109
109
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
|
-
import { extractErrorInfo } from '../utils/analytics';
|
|
4
|
+
import { extractErrorInfo, fireMediaCardEvent } from '../utils/analytics';
|
|
5
|
+
import { MediaCardError } from '../errors';
|
|
5
6
|
export var getSucceededStatusPayload = function getSucceededStatusPayload(fileState) {
|
|
6
7
|
return {
|
|
7
8
|
eventType: 'operational',
|
|
@@ -47,4 +48,15 @@ export var getFailedProcessingStatusPayload = function getFailedProcessingStatus
|
|
|
47
48
|
failReason: 'failed-processing'
|
|
48
49
|
}
|
|
49
50
|
};
|
|
51
|
+
};
|
|
52
|
+
export var fireFailedOperationalEvent = function fireFailedOperationalEvent(fileState) {
|
|
53
|
+
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new MediaCardError('missing-error-data');
|
|
54
|
+
var failReason = arguments.length > 2 ? arguments[2] : undefined;
|
|
55
|
+
var createAnalyticsEvent = arguments.length > 3 ? arguments[3] : undefined;
|
|
56
|
+
var payload = failReason ? getFailedProcessingStatusPayload(fileState) : getErrorStatusPayload(error, fileState);
|
|
57
|
+
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
58
|
+
};
|
|
59
|
+
export var fireSucceededOperationalEvent = function fireSucceededOperationalEvent(fileState, createAnalyticsEvent) {
|
|
60
|
+
var payload = getSucceededStatusPayload(fileState);
|
|
61
|
+
fireMediaCardEvent(payload, createAnalyticsEvent);
|
|
50
62
|
};
|
|
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
|
|
|
7
7
|
import { MediaCardError } from '../errors';
|
|
8
8
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
9
9
|
var packageName = "@atlaskit/media-card";
|
|
10
|
-
var packageVersion = "77.
|
|
10
|
+
var packageVersion = "77.9.0";
|
|
11
11
|
var concurrentExperience;
|
|
12
12
|
var getExperience = function getExperience(id) {
|
|
13
13
|
if (!concurrentExperience) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
|
6
6
|
export type { CardAction, CardEventHandler } from './card/actions';
|
|
7
7
|
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, TitleBoxIcon, CardEvent, InlineCardEvent, SharedCardProps, CardOnClickCallback, InlineCardOnClickCallback, CardProps, CardState, CardDimensions, } from './types';
|
|
8
8
|
export { Card } from './card';
|
|
9
|
-
export { MediaInlineCard } from './inline';
|
|
9
|
+
export { MediaInlineCard, fireFailedMediaInlineEvent, fireSucceededMediaInlineEvent, } from './inline';
|
|
10
|
+
export { MediaCardError } from './errors';
|
|
10
11
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
11
12
|
export { CardError } from './utils/lightCards/cardError';
|
|
12
13
|
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
2
|
import { RenderInlineCardFailedEventPayload, RenderInlineCardSucceededEventPayload } from '../utils/analytics';
|
|
3
3
|
import { MediaCardError } from '../errors';
|
|
4
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
5
|
export declare const getSucceededStatusPayload: (fileState?: FileState) => RenderInlineCardSucceededEventPayload;
|
|
5
6
|
export declare const getErrorStatusPayload: (error: MediaCardError, fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
6
7
|
export declare const getFailedProcessingStatusPayload: (fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
8
|
+
export declare const fireFailedOperationalEvent: (fileState: FileState, error?: MediaCardError, failReason?: 'failed-processing', createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
9
|
+
export declare const fireSucceededOperationalEvent: (fileState: FileState, createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
@@ -6,7 +6,8 @@ export type { NumericalCardDimensions } from '@atlaskit/media-common';
|
|
|
6
6
|
export type { CardAction, CardEventHandler } from './card/actions';
|
|
7
7
|
export type { CardStatus, CardAppearance, CardDimensionValue, CardPreview, TitleBoxIcon, CardEvent, InlineCardEvent, SharedCardProps, CardOnClickCallback, InlineCardOnClickCallback, CardProps, CardState, CardDimensions, } from './types';
|
|
8
8
|
export { Card } from './card';
|
|
9
|
-
export { MediaInlineCard } from './inline';
|
|
9
|
+
export { MediaInlineCard, fireFailedMediaInlineEvent, fireSucceededMediaInlineEvent, } from './inline';
|
|
10
|
+
export { MediaCardError } from './errors';
|
|
10
11
|
export { CardLoading } from './utils/lightCards/cardLoading';
|
|
11
12
|
export { CardError } from './utils/lightCards/cardError';
|
|
12
13
|
export { defaultImageCardDimensions } from './utils/cardDimensions';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { FileState } from '@atlaskit/media-client';
|
|
2
2
|
import { RenderInlineCardFailedEventPayload, RenderInlineCardSucceededEventPayload } from '../utils/analytics';
|
|
3
3
|
import { MediaCardError } from '../errors';
|
|
4
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
5
|
export declare const getSucceededStatusPayload: (fileState?: FileState) => RenderInlineCardSucceededEventPayload;
|
|
5
6
|
export declare const getErrorStatusPayload: (error: MediaCardError, fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
6
7
|
export declare const getFailedProcessingStatusPayload: (fileState?: FileState) => RenderInlineCardFailedEventPayload;
|
|
8
|
+
export declare const fireFailedOperationalEvent: (fileState: FileState, error?: MediaCardError, failReason?: 'failed-processing', createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
9
|
+
export declare const fireSucceededOperationalEvent: (fileState: FileState, createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
package/package.json
CHANGED