@atlaskit/media-card 77.8.0 → 77.10.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 +12 -0
- package/dist/cjs/card/card.js +1 -1
- package/dist/cjs/card/cardView.js +1 -2
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/v2/cardV2.js +1 -1
- package/dist/cjs/card/v2/cardViewV2.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/cardView.js +1 -2
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/v2/cardV2.js +1 -1
- package/dist/es2019/card/v2/cardViewV2.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/cardView.js +1 -2
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/v2/cardV2.js +1 -1
- package/dist/esm/card/v2/cardViewV2.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 +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-card
|
|
2
2
|
|
|
3
|
+
## 77.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#72258](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72258) [`31cecb8f314b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/31cecb8f314b) - ECA11Y-78: removed feature flag
|
|
8
|
+
|
|
9
|
+
## 77.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
3
15
|
## 77.8.0
|
|
4
16
|
|
|
5
17
|
### 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.10.0";
|
|
54
54
|
var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
|
|
55
55
|
(0, _inherits2.default)(CardBase, _Component);
|
|
56
56
|
var _super = _createSuper(CardBase);
|
|
@@ -38,7 +38,6 @@ var _iconMessage = require("./ui/iconMessage");
|
|
|
38
38
|
var _errors = require("../errors");
|
|
39
39
|
var _wrapper = require("./ui/wrapper");
|
|
40
40
|
var _classnames = require("./classnames");
|
|
41
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
42
41
|
var _openMediaViewerButton = _interopRequireDefault(require("./ui/openMediaViewerButton/openMediaViewerButton"));
|
|
43
42
|
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; }
|
|
44
43
|
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; }
|
|
@@ -339,7 +338,7 @@ var CardViewBase = exports.CardViewBase = /*#__PURE__*/function (_React$Componen
|
|
|
339
338
|
forceSyncDisplay = _this$props6.forceSyncDisplay;
|
|
340
339
|
var _ref7 = this.props.metadata || {},
|
|
341
340
|
name = _ref7.name;
|
|
342
|
-
var altText =
|
|
341
|
+
var altText = alt || name;
|
|
343
342
|
return !!cardPreview && (0, _react.jsx)(_imageRenderer.ImageRenderer, {
|
|
344
343
|
cardPreview: cardPreview,
|
|
345
344
|
mediaType: mediaType,
|
|
@@ -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.10.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.10.0";
|
|
20
20
|
var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
|
|
21
21
|
var identifier = _ref.identifier,
|
|
22
22
|
otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -234,7 +234,7 @@ var CardViewV2Base = exports.CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
234
234
|
})), renderImageRenderer && !!cardPreview && (0, _react.jsx)(_imageRenderer.ImageRenderer, {
|
|
235
235
|
cardPreview: cardPreview,
|
|
236
236
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
237
|
-
alt: alt,
|
|
237
|
+
alt: alt || name,
|
|
238
238
|
resizeMode: resizeMode,
|
|
239
239
|
onDisplayImage: onDisplayImage,
|
|
240
240
|
onImageLoad: handleOnImageLoad,
|
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.10.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.10.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.10.0";
|
|
32
32
|
export class CardBase extends Component {
|
|
33
33
|
constructor(props) {
|
|
34
34
|
super(props);
|
|
@@ -26,7 +26,6 @@ import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUn
|
|
|
26
26
|
import { isUploadError, isRateLimitedError, isPollingError } from '../errors';
|
|
27
27
|
import { Wrapper } from './ui/wrapper';
|
|
28
28
|
import { fileCardImageViewSelector } from './classnames';
|
|
29
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
30
29
|
import OpenMediaViewerButton from './ui/openMediaViewerButton/openMediaViewerButton';
|
|
31
30
|
/**
|
|
32
31
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
@@ -326,7 +325,7 @@ export class CardViewBase extends React.Component {
|
|
|
326
325
|
const {
|
|
327
326
|
name
|
|
328
327
|
} = this.props.metadata || {};
|
|
329
|
-
const altText =
|
|
328
|
+
const altText = alt || name;
|
|
330
329
|
return !!cardPreview && jsx(ImageRenderer, {
|
|
331
330
|
cardPreview: cardPreview,
|
|
332
331
|
mediaType: mediaType,
|
|
@@ -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.10.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.10.0";
|
|
11
11
|
export const CardV2Base = ({
|
|
12
12
|
identifier,
|
|
13
13
|
...otherProps
|
|
@@ -229,7 +229,7 @@ export const CardViewV2Base = ({
|
|
|
229
229
|
})), renderImageRenderer && !!cardPreview && jsx(ImageRenderer, {
|
|
230
230
|
cardPreview: cardPreview,
|
|
231
231
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
232
|
-
alt: alt,
|
|
232
|
+
alt: alt || name,
|
|
233
233
|
resizeMode: resizeMode,
|
|
234
234
|
onDisplayImage: onDisplayImage,
|
|
235
235
|
onImageLoad: handleOnImageLoad,
|
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.10.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.10.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.10.0";
|
|
45
45
|
export var CardBase = /*#__PURE__*/function (_Component) {
|
|
46
46
|
_inherits(CardBase, _Component);
|
|
47
47
|
var _super = _createSuper(CardBase);
|
|
@@ -36,7 +36,6 @@ import { PreviewUnavailable, CreatingPreview, FailedToUpload, PreviewCurrentlyUn
|
|
|
36
36
|
import { isUploadError, isRateLimitedError, isPollingError } from '../errors';
|
|
37
37
|
import { Wrapper } from './ui/wrapper';
|
|
38
38
|
import { fileCardImageViewSelector } from './classnames';
|
|
39
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
40
39
|
import OpenMediaViewerButton from './ui/openMediaViewerButton/openMediaViewerButton';
|
|
41
40
|
/**
|
|
42
41
|
* This is classic vanilla CardView class. To create an instance of class one would need to supply
|
|
@@ -333,7 +332,7 @@ export var CardViewBase = /*#__PURE__*/function (_React$Component) {
|
|
|
333
332
|
forceSyncDisplay = _this$props6.forceSyncDisplay;
|
|
334
333
|
var _ref7 = this.props.metadata || {},
|
|
335
334
|
name = _ref7.name;
|
|
336
|
-
var altText =
|
|
335
|
+
var altText = alt || name;
|
|
337
336
|
return !!cardPreview && jsx(ImageRenderer, {
|
|
338
337
|
cardPreview: cardPreview,
|
|
339
338
|
mediaType: mediaType,
|
|
@@ -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.10.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.10.0";
|
|
13
13
|
export var CardV2Base = function CardV2Base(_ref) {
|
|
14
14
|
var identifier = _ref.identifier,
|
|
15
15
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -225,7 +225,7 @@ export var CardViewV2Base = function CardViewV2Base(_ref) {
|
|
|
225
225
|
})), renderImageRenderer && !!cardPreview && jsx(ImageRenderer, {
|
|
226
226
|
cardPreview: cardPreview,
|
|
227
227
|
mediaType: (metadata === null || metadata === void 0 ? void 0 : metadata.mediaType) || 'unknown',
|
|
228
|
-
alt: alt,
|
|
228
|
+
alt: alt || name,
|
|
229
229
|
resizeMode: resizeMode,
|
|
230
230
|
onDisplayImage: onDisplayImage,
|
|
231
231
|
onImageLoad: handleOnImageLoad,
|
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.10.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.10.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-card",
|
|
3
|
-
"version": "77.
|
|
3
|
+
"version": "77.10.0",
|
|
4
4
|
"description": "Includes all media card related components, CardView, CardViewSmall, Card...",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/dropdown-menu": "^12.5.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
42
42
|
"@atlaskit/icon": "^22.0.0",
|
|
43
|
-
"@atlaskit/media-client": "^26.
|
|
43
|
+
"@atlaskit/media-client": "^26.2.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^2.0.0",
|
|
45
45
|
"@atlaskit/media-common": "^11.0.0",
|
|
46
46
|
"@atlaskit/media-file-preview": "^0.4.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
50
50
|
"@atlaskit/spinner": "^16.0.0",
|
|
51
51
|
"@atlaskit/theme": "^12.6.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.37.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.1.0",
|
|
54
54
|
"@atlaskit/ufo": "^0.2.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
70
70
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
71
71
|
"@atlaskit/inline-message": "^12.0.0",
|
|
72
|
-
"@atlaskit/media-core": "^34.
|
|
73
|
-
"@atlaskit/media-picker": "^66.
|
|
72
|
+
"@atlaskit/media-core": "^34.2.0",
|
|
73
|
+
"@atlaskit/media-picker": "^66.3.0",
|
|
74
74
|
"@atlaskit/media-state": "^1.0.0",
|
|
75
75
|
"@atlaskit/media-test-data": "^1.2.0",
|
|
76
76
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
@@ -97,9 +97,6 @@
|
|
|
97
97
|
"platform.media-experience.cardv2_7zann": {
|
|
98
98
|
"type": "boolean"
|
|
99
99
|
},
|
|
100
|
-
"platform.editor.a11y-media_er96o": {
|
|
101
|
-
"type": "boolean"
|
|
102
|
-
},
|
|
103
100
|
"platform.media-experience.card-views-refactor_b91lr": {
|
|
104
101
|
"type": "boolean"
|
|
105
102
|
}
|