@atlaskit/smart-card 26.24.0 → 26.26.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 +16 -0
- package/dist/cjs/extractors/block/index.js +1 -1
- package/dist/cjs/extractors/common/actions/extractActions.js +3 -31
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +10 -15
- package/dist/cjs/state/hooks/use-invoke/utils.js +23 -0
- package/dist/cjs/state/hooks/use-invoke-client-action/index.js +20 -14
- package/dist/cjs/utils/analytics/analytics.js +28 -7
- package/dist/cjs/utils/mocks.js +7 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleErroredView.js +1 -0
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -45
- package/dist/cjs/view/FlexibleCard/components/actions/action/download-action/index.js +33 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +41 -15
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +32 -15
- package/dist/cjs/view/FlexibleCard/components/actions/action/view-action/index.js +33 -1
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +2 -4
- package/dist/cjs/view/FlexibleCard/components/utils.js +9 -20
- package/dist/cjs/view/FlexibleCard/index.js +14 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/block/index.js +2 -2
- package/dist/es2019/extractors/common/actions/extractActions.js +2 -23
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +10 -17
- package/dist/es2019/state/hooks/use-invoke/utils.js +13 -0
- package/dist/es2019/state/hooks/use-invoke-client-action/index.js +14 -8
- package/dist/es2019/utils/analytics/analytics.js +65 -32
- package/dist/es2019/utils/mocks.js +7 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleErroredView.js +1 -0
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -42
- package/dist/es2019/view/FlexibleCard/components/actions/action/download-action/index.js +15 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +18 -7
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +19 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/view-action/index.js +15 -1
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/utils.js +3 -17
- package/dist/es2019/view/FlexibleCard/index.js +11 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/block/index.js +2 -2
- package/dist/esm/extractors/common/actions/extractActions.js +2 -30
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +11 -16
- package/dist/esm/state/hooks/use-invoke/utils.js +15 -0
- package/dist/esm/state/hooks/use-invoke-client-action/index.js +20 -14
- package/dist/esm/utils/analytics/analytics.js +23 -5
- package/dist/esm/utils/mocks.js +7 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleErroredView.js +1 -0
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -46
- package/dist/esm/view/FlexibleCard/components/actions/action/download-action/index.js +33 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +41 -15
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +32 -15
- package/dist/esm/view/FlexibleCard/components/actions/action/view-action/index.js +33 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +1 -3
- package/dist/esm/view/FlexibleCard/components/utils.js +9 -20
- package/dist/esm/view/FlexibleCard/index.js +14 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +0 -1
- package/dist/types/extractors/common/actions/extractActions.d.ts +1 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -5
- package/dist/types/state/flexible-ui-context/index.d.ts +3 -119
- package/dist/types/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types/state/hooks/use-invoke/utils.d.ts +4 -0
- package/dist/types/state/hooks/useSmartLink.d.ts +4 -3
- package/dist/types/utils/analytics/analytics.d.ts +4 -1
- package/dist/types/utils/analytics/types.d.ts +7 -3
- package/dist/types/utils/mocks.d.ts +4 -3
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/utils.d.ts +2 -63
- package/dist/types/view/FlexibleCard/types.d.ts +2 -3
- package/dist/types-ts4.5/extractors/common/__mocks__/jsonld.d.ts +0 -1
- package/dist/types-ts4.5/extractors/common/actions/extractActions.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -5
- package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +3 -119
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +6 -0
- package/dist/types-ts4.5/state/hooks/use-invoke/utils.d.ts +4 -0
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +4 -3
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +4 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +7 -3
- package/dist/types-ts4.5/utils/mocks.d.ts +4 -3
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +2 -63
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +2 -3
- package/package.json +2 -2
- package/report.api.md +14 -6
- package/tmp/api-report-tmp.d.ts +12 -6
|
@@ -13,9 +13,11 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _useInvoke = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke"));
|
|
16
|
+
var _utils = require("../../../../../../state/hooks/use-invoke/utils");
|
|
16
17
|
var _useResolve = _interopRequireDefault(require("../../../../../../state/hooks/use-resolve"));
|
|
17
18
|
var _createInvokeRequest = _interopRequireDefault(require("../../../../../../utils/actions/create-invoke-request"));
|
|
18
19
|
var _index = _interopRequireDefault(require("../index"));
|
|
20
|
+
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
19
21
|
var _excluded = ["action", "onClick"];
|
|
20
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -27,46 +29,61 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
27
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
30
|
isLoading = _useState2[0],
|
|
29
31
|
setIsLoading = _useState2[1];
|
|
32
|
+
var analytics = (0, _flexibleUiContext.useFlexibleUiAnalyticsContext)();
|
|
30
33
|
var invoke = (0, _useInvoke.default)();
|
|
31
34
|
var reload = (0, _useResolve.default)();
|
|
32
35
|
var handleClick = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
33
|
-
var request;
|
|
36
|
+
var _action$action, smartLinkActionType, request;
|
|
34
37
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
35
38
|
while (1) switch (_context.prev = _context.next) {
|
|
36
39
|
case 0:
|
|
37
40
|
if (!action) {
|
|
38
|
-
_context.next =
|
|
41
|
+
_context.next = 21;
|
|
39
42
|
break;
|
|
40
43
|
}
|
|
41
|
-
|
|
44
|
+
smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
45
|
+
_context.prev = 2;
|
|
42
46
|
setIsLoading(true);
|
|
47
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkServerActionClickedEvent({
|
|
48
|
+
smartLinkActionType: smartLinkActionType
|
|
49
|
+
});
|
|
50
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionStarted({
|
|
51
|
+
smartLinkActionType: smartLinkActionType
|
|
52
|
+
});
|
|
43
53
|
request = (0, _createInvokeRequest.default)(action);
|
|
44
|
-
_context.next =
|
|
54
|
+
_context.next = 9;
|
|
45
55
|
return invoke(request);
|
|
46
|
-
case
|
|
56
|
+
case 9:
|
|
57
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionSuccess({
|
|
58
|
+
smartLinkActionType: smartLinkActionType
|
|
59
|
+
});
|
|
47
60
|
if (!(action.reload && action.reload.url)) {
|
|
48
|
-
_context.next =
|
|
61
|
+
_context.next = 13;
|
|
49
62
|
break;
|
|
50
63
|
}
|
|
51
|
-
_context.next =
|
|
64
|
+
_context.next = 13;
|
|
52
65
|
return reload(action.reload.url, true, undefined, action.reload.id);
|
|
53
|
-
case
|
|
66
|
+
case 13:
|
|
54
67
|
setIsLoading(false);
|
|
55
68
|
if (onClick) {
|
|
56
69
|
onClick();
|
|
57
70
|
}
|
|
58
|
-
_context.next =
|
|
71
|
+
_context.next = 21;
|
|
59
72
|
break;
|
|
60
|
-
case
|
|
61
|
-
_context.prev =
|
|
62
|
-
_context.t0 = _context["catch"](
|
|
73
|
+
case 17:
|
|
74
|
+
_context.prev = 17;
|
|
75
|
+
_context.t0 = _context["catch"](2);
|
|
63
76
|
setIsLoading(false);
|
|
64
|
-
|
|
77
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed({
|
|
78
|
+
smartLinkActionType: smartLinkActionType,
|
|
79
|
+
reason: (0, _utils.getInvokeFailureReason)(_context.t0)
|
|
80
|
+
});
|
|
81
|
+
case 21:
|
|
65
82
|
case "end":
|
|
66
83
|
return _context.stop();
|
|
67
84
|
}
|
|
68
|
-
}, _callee, null, [[
|
|
69
|
-
})), [action, invoke, onClick, reload]);
|
|
85
|
+
}, _callee, null, [[2, 17]]);
|
|
86
|
+
})), [action, analytics === null || analytics === void 0 ? void 0 : analytics.track, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, reload]);
|
|
70
87
|
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
|
|
71
88
|
isLoading: isLoading,
|
|
72
89
|
onClick: handleClick
|
|
@@ -5,11 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
var _index = _interopRequireDefault(require("../index"));
|
|
12
14
|
var _utils = require("../../../../../../utils");
|
|
15
|
+
var _constants = require("../../../../../../constants");
|
|
16
|
+
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
17
|
+
var _useInvokeClientAction = _interopRequireDefault(require("../../../../../../state/hooks/use-invoke-client-action"));
|
|
13
18
|
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; }
|
|
14
19
|
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; }
|
|
15
20
|
var ViewAction = function ViewAction(props) {
|
|
@@ -19,10 +24,37 @@ var ViewAction = function ViewAction(props) {
|
|
|
19
24
|
_onClick = props.onClick,
|
|
20
25
|
viewUrl = props.viewUrl,
|
|
21
26
|
url = props.url;
|
|
27
|
+
var analytics = (0, _flexibleUiContext.useFlexibleUiAnalyticsContext)();
|
|
28
|
+
var invoke = (0, _useInvokeClientAction.default)({
|
|
29
|
+
analytics: analytics
|
|
30
|
+
});
|
|
22
31
|
if (viewUrl && url) {
|
|
23
32
|
var action = _objectSpread(_objectSpread({}, props), {}, {
|
|
24
33
|
onClick: function onClick() {
|
|
25
|
-
(
|
|
34
|
+
invoke({
|
|
35
|
+
actionType: _constants.ActionName.ViewAction,
|
|
36
|
+
actionFn: function () {
|
|
37
|
+
var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
38
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
return _context.abrupt("return", (0, _utils.openUrl)(viewUrl));
|
|
42
|
+
case 1:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}, _callee);
|
|
47
|
+
}));
|
|
48
|
+
function actionFn() {
|
|
49
|
+
return _actionFn.apply(this, arguments);
|
|
50
|
+
}
|
|
51
|
+
return actionFn;
|
|
52
|
+
}(),
|
|
53
|
+
// These values have already been set in analytics context.
|
|
54
|
+
// We only pass these here for ufo experience.
|
|
55
|
+
display: analytics === null || analytics === void 0 ? void 0 : analytics.display,
|
|
56
|
+
extensionKey: analytics === null || analytics === void 0 ? void 0 : analytics.extensionKey
|
|
57
|
+
});
|
|
26
58
|
if (_onClick) {
|
|
27
59
|
_onClick();
|
|
28
60
|
}
|
|
@@ -23,6 +23,7 @@ var _extractLozengeActionItems = _interopRequireDefault(require("../../../../../
|
|
|
23
23
|
var _createStatusUpdateRequest = _interopRequireDefault(require("../../../../../../utils/actions/create-status-update-request"));
|
|
24
24
|
var _useResolve = _interopRequireDefault(require("../../../../../../state/hooks/use-resolve"));
|
|
25
25
|
var _types = require("./lozenge-action-error/types");
|
|
26
|
+
var _utils = require("../../../../../../state/hooks/use-invoke/utils");
|
|
26
27
|
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
27
28
|
var _analytics = require("../../../../../../utils/analytics/analytics");
|
|
28
29
|
var _lozengeActionAnalytics = require("./lozenge-action-analytics");
|
|
@@ -37,9 +38,6 @@ var validateItems = function validateItems() {
|
|
|
37
38
|
return item.text !== text;
|
|
38
39
|
});
|
|
39
40
|
};
|
|
40
|
-
var isInvokeCustomError = function isInvokeCustomError(err) {
|
|
41
|
-
return err.message !== undefined && err.errorCode !== undefined;
|
|
42
|
-
};
|
|
43
41
|
var LozengeAction = function LozengeAction(_ref) {
|
|
44
42
|
var _action$update;
|
|
45
43
|
var action = _ref.action,
|
|
@@ -199,7 +197,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
199
197
|
_context2.prev = 19;
|
|
200
198
|
_context2.t0 = _context2["catch"](0);
|
|
201
199
|
setIsLoading(false);
|
|
202
|
-
if (isInvokeCustomError(_context2.t0)) {
|
|
200
|
+
if ((0, _utils.isInvokeCustomError)(_context2.t0)) {
|
|
203
201
|
setErrorMessage(_context2.t0.message);
|
|
204
202
|
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed(_lozengeActionAnalytics.validationUpdateErrorAnalyticsPayload);
|
|
205
203
|
} else {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.sizeToButtonSpacing = exports.openEmbedModalWithFlexibleUiIcon = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessageAsString = exports.getFormattedMessage = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -14,7 +15,10 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
14
15
|
var _constants = require("../../../constants");
|
|
15
16
|
var _icon = _interopRequireDefault(require("./elements/icon"));
|
|
16
17
|
var _utils = require("../../EmbedModal/utils");
|
|
18
|
+
var _excluded = ["linkIcon"];
|
|
17
19
|
var _sizeToButtonSpacing, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
18
22
|
var sizeToButtonSpacing = (_sizeToButtonSpacing = {}, (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.Small, 'none'), (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.Medium, 'compact'), (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.Large, 'compact'), (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.XLarge, 'default'), _sizeToButtonSpacing);
|
|
19
23
|
exports.sizeToButtonSpacing = sizeToButtonSpacing;
|
|
20
24
|
var getFormattedMessage = function getFormattedMessage(message) {
|
|
@@ -116,35 +120,20 @@ var hasWhiteSpace = function hasWhiteSpace(str) {
|
|
|
116
120
|
};
|
|
117
121
|
exports.hasWhiteSpace = hasWhiteSpace;
|
|
118
122
|
var openEmbedModalWithFlexibleUiIcon = function openEmbedModalWithFlexibleUiIcon(_ref) {
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
linkIcon = _ref.linkIcon,
|
|
122
|
-
onClose = _ref.onClose,
|
|
123
|
-
providerName = _ref.providerName,
|
|
124
|
-
src = _ref.src,
|
|
125
|
-
title = _ref.title,
|
|
126
|
-
url = _ref.url,
|
|
127
|
-
isSupportTheming = _ref.isSupportTheming;
|
|
123
|
+
var linkIcon = _ref.linkIcon,
|
|
124
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
128
125
|
var icon = {
|
|
129
126
|
icon: /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({}, linkIcon, {
|
|
130
127
|
size: _constants.SmartLinkSize.Large
|
|
131
128
|
})),
|
|
132
129
|
isFlexibleUi: true
|
|
133
130
|
};
|
|
134
|
-
return (0, _utils.openEmbedModal)({
|
|
135
|
-
analytics: analytics,
|
|
136
|
-
download: downloadUrl,
|
|
131
|
+
return (0, _utils.openEmbedModal)(_objectSpread(_objectSpread({}, props), {}, {
|
|
137
132
|
icon: icon,
|
|
138
133
|
// Flex should not send origin as block card. It should be able to support
|
|
139
134
|
// its internal parent components like hover card, block card and
|
|
140
135
|
// itself as a standalone. To be investigated and fix in EDM-7520.
|
|
141
|
-
origin: 'smartLinkCard'
|
|
142
|
-
|
|
143
|
-
onClose: onClose,
|
|
144
|
-
src: src,
|
|
145
|
-
title: title,
|
|
146
|
-
url: url,
|
|
147
|
-
isSupportTheming: isSupportTheming
|
|
148
|
-
});
|
|
136
|
+
origin: 'smartLinkCard'
|
|
137
|
+
}));
|
|
149
138
|
};
|
|
150
139
|
exports.openEmbedModalWithFlexibleUiIcon = openEmbedModalWithFlexibleUiIcon;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _constants = require("../../constants");
|
|
12
13
|
var _container = _interopRequireDefault(require("./components/container"));
|
|
@@ -14,6 +15,8 @@ var _flexibleUiContext = require("../../state/flexible-ui-context");
|
|
|
14
15
|
var _utils = require("./utils");
|
|
15
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
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; }
|
|
19
|
+
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
20
|
/**
|
|
18
21
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
19
22
|
* This is the container in which all Flexible UI Blocks and Elements exist.
|
|
@@ -21,7 +24,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
24
|
* @see Container
|
|
22
25
|
*/
|
|
23
26
|
var FlexibleCard = function FlexibleCard(_ref) {
|
|
27
|
+
var _details$meta2;
|
|
24
28
|
var analytics = _ref.analytics,
|
|
29
|
+
_ref$appearance = _ref.appearance,
|
|
30
|
+
appearance = _ref$appearance === void 0 ? 'flexible' : _ref$appearance,
|
|
25
31
|
cardState = _ref.cardState,
|
|
26
32
|
children = _ref.children,
|
|
27
33
|
id = _ref.id,
|
|
@@ -52,6 +58,13 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
52
58
|
var retry = (0, _utils.getRetryOptions)(url, status, details, onAuthorize);
|
|
53
59
|
var _ref2 = context || {},
|
|
54
60
|
title = _ref2.title;
|
|
61
|
+
var analyticsContext = (0, _react.useMemo)(function () {
|
|
62
|
+
var _details$meta;
|
|
63
|
+
return analytics ? _objectSpread(_objectSpread({}, analytics), {}, {
|
|
64
|
+
display: appearance,
|
|
65
|
+
extensionKey: details === null || details === void 0 ? void 0 : (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.key
|
|
66
|
+
}) : undefined;
|
|
67
|
+
}, [analytics, appearance, details === null || details === void 0 ? void 0 : (_details$meta2 = details.meta) === null || _details$meta2 === void 0 ? void 0 : _details$meta2.key]);
|
|
55
68
|
(0, _react.useEffect)(function () {
|
|
56
69
|
switch (status) {
|
|
57
70
|
case _constants.SmartLinkStatus.Resolved:
|
|
@@ -77,7 +90,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
77
90
|
}
|
|
78
91
|
}, [onError, onResolve, status, title, url]);
|
|
79
92
|
return /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiAnalyticsContext.Provider, {
|
|
80
|
-
value:
|
|
93
|
+
value: analyticsContext
|
|
81
94
|
}, /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiOptionContext.Provider, {
|
|
82
95
|
value: ui
|
|
83
96
|
}, /*#__PURE__*/_react.default.createElement(_flexibleUiContext.FlexibleUiContext.Provider, {
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.
|
|
21
|
+
packageVersion: "26.26.0",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -5,7 +5,7 @@ import { extractCommentCount, extractProgrammingLanguage, extractSubscriberCount
|
|
|
5
5
|
import { extractLink, extractTitle, extractProvider, extractMembers, extractPersonAssignedTo, extractPersonCreatedBy, extractPersonUpdatedBy, extractImage } from '@atlaskit/link-extractors';
|
|
6
6
|
import { extractByline } from '../common/byline/extractByline';
|
|
7
7
|
import { extractTitlePrefix } from '../common/title-prefix/extractTitlePrefix';
|
|
8
|
-
import {
|
|
8
|
+
import { extractClientActions } from '../common/actions/extractActions';
|
|
9
9
|
import { extractPreviewAction } from '../common/actions/extractPreviewAction';
|
|
10
10
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
11
11
|
const extractBlockIcon = jsonLd => {
|
|
@@ -26,7 +26,7 @@ export const extractBlockActions = (props, jsonLd, opts, platform, meta) => {
|
|
|
26
26
|
const {
|
|
27
27
|
handleInvoke
|
|
28
28
|
} = opts;
|
|
29
|
-
const actions =
|
|
29
|
+
const actions = extractClientActions(jsonLd, handleInvoke);
|
|
30
30
|
const previewAction = extractPreviewAction({
|
|
31
31
|
...opts,
|
|
32
32
|
viewProps: props,
|
|
@@ -30,25 +30,6 @@ const getClientActionProps = (jsonLd, action, handler) => {
|
|
|
30
30
|
promise: () => handler(clientActionInvokeOpts)
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
const getServerActionProps = (jsonLd, action, handler) => {
|
|
34
|
-
const id = action['@id'] || action['@type'];
|
|
35
|
-
const data = {
|
|
36
|
-
type: 'server',
|
|
37
|
-
key: action.identifier,
|
|
38
|
-
action: {
|
|
39
|
-
type: action['@type'],
|
|
40
|
-
payload: {
|
|
41
|
-
id,
|
|
42
|
-
context: jsonLd.context
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
id,
|
|
48
|
-
text: action.name,
|
|
49
|
-
promise: () => handler(data)
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
33
|
export const getActionsFromJsonLd = jsonLd => {
|
|
53
34
|
let actions = jsonLd && jsonLd['schema:potentialAction'];
|
|
54
35
|
if (!actions) {
|
|
@@ -59,11 +40,9 @@ export const getActionsFromJsonLd = jsonLd => {
|
|
|
59
40
|
}
|
|
60
41
|
return actions;
|
|
61
42
|
};
|
|
62
|
-
export function
|
|
43
|
+
export function extractClientActions(jsonLd, handler) {
|
|
63
44
|
const actions = getActionsFromJsonLd(jsonLd);
|
|
64
45
|
const clientActions = actions.filter(isClientAction);
|
|
65
|
-
const serverActions = actions.filter(action => !isClientAction(action));
|
|
66
46
|
const clientActionImpls = clientActions.map(action => getClientActionProps(jsonLd, action, handler));
|
|
67
|
-
|
|
68
|
-
return [...clientActionImpls, ...serverActionImpls];
|
|
47
|
+
return clientActionImpls;
|
|
69
48
|
}
|
|
@@ -4,7 +4,7 @@ import { chunkloadFailedEvent, connectFailedEvent, connectSucceededEvent, contex
|
|
|
4
4
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from './ufoExperiences';
|
|
5
5
|
import { getDefinitionId, getExtensionKey, getProduct, getResourceType, getStatusDetails, getSubproduct } from '../helpers';
|
|
6
6
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
7
|
-
import { trackHoverCardResolutionStarted, trackSmartLinkQuickActionFailed, trackSmartLinkQuickActionStarted, trackSmartLinkQuickActionSuccess, uiIframeDwelledEvent, uiIframeFocusedEvent } from '../../utils/analytics/analytics';
|
|
7
|
+
import { trackHoverCardResolutionStarted, trackSmartLinkQuickActionFailed, trackSmartLinkQuickActionStarted, trackSmartLinkQuickActionSuccess, uiIframeDwelledEvent, uiIframeFocusedEvent, uiServerActionClicked } from '../../utils/analytics/analytics';
|
|
8
8
|
import { useDispatchAnalytics } from './useDispatchAnalytics';
|
|
9
9
|
const applyCommonAttributes = (event, commonAttributes) => {
|
|
10
10
|
if (event && event.attributes) {
|
|
@@ -235,11 +235,11 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
235
235
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
236
236
|
* @param actionType The type of the action that was clicked, e.g. PreviewAction
|
|
237
237
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
238
|
-
* @param invokeType
|
|
238
|
+
* @param invokeType @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
|
|
239
239
|
* @returns
|
|
240
240
|
*/
|
|
241
241
|
actionClickedEvent: ({
|
|
242
|
-
id
|
|
242
|
+
id,
|
|
243
243
|
actionType,
|
|
244
244
|
display,
|
|
245
245
|
invokeType,
|
|
@@ -251,14 +251,8 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
251
251
|
location
|
|
252
252
|
}) => {
|
|
253
253
|
const extensionKey = overrideExtensionKey !== null && overrideExtensionKey !== void 0 ? overrideExtensionKey : extractedExtensionKey;
|
|
254
|
-
startUfoExperience('smart-link-action-invocation', experienceId, {
|
|
255
|
-
actionType,
|
|
256
|
-
display,
|
|
257
|
-
extensionKey,
|
|
258
|
-
invokeType
|
|
259
|
-
});
|
|
260
254
|
dispatchAnalytics(applyCommonAttributes(uiActionClickedEvent({
|
|
261
|
-
id: defaultId,
|
|
255
|
+
id: id !== null && id !== void 0 ? id : defaultId,
|
|
262
256
|
actionType,
|
|
263
257
|
display,
|
|
264
258
|
extensionKey,
|
|
@@ -494,7 +488,8 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
494
488
|
/**
|
|
495
489
|
* Fires an event that represent a click was performed on a Status Lozenge open preview button
|
|
496
490
|
*/
|
|
497
|
-
smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusOpenPreviewButtonClicked(), commonAttributes))
|
|
491
|
+
smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => dispatchAnalytics(applyCommonAttributes(uiSmartLinkStatusOpenPreviewButtonClicked(), commonAttributes)),
|
|
492
|
+
smartLinkServerActionClickedEvent: props => dispatchAnalytics(applyCommonAttributes(uiServerActionClicked(props), commonAttributes))
|
|
498
493
|
}), [dispatchAnalytics, commonAttributes, defaultId, extractedExtensionKey]);
|
|
499
494
|
|
|
500
495
|
/** Contains all operational analytics events */
|
|
@@ -507,7 +502,7 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
507
502
|
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
508
503
|
*/
|
|
509
504
|
invokeSucceededEvent: ({
|
|
510
|
-
id
|
|
505
|
+
id,
|
|
511
506
|
actionType,
|
|
512
507
|
display,
|
|
513
508
|
extensionKey,
|
|
@@ -517,9 +512,8 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
517
512
|
destinationSubproduct,
|
|
518
513
|
location
|
|
519
514
|
}) => {
|
|
520
|
-
succeedUfoExperience('smart-link-action-invocation', experienceId);
|
|
521
515
|
dispatchAnalytics(applyCommonAttributes(invokeSucceededEvent({
|
|
522
|
-
id: defaultId,
|
|
516
|
+
id: id !== null && id !== void 0 ? id : defaultId,
|
|
523
517
|
actionType,
|
|
524
518
|
display,
|
|
525
519
|
extensionKey,
|
|
@@ -539,7 +533,7 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
539
533
|
* @param reason The reason the invocation failed.
|
|
540
534
|
*/
|
|
541
535
|
invokeFailedEvent: ({
|
|
542
|
-
id
|
|
536
|
+
id,
|
|
543
537
|
actionType,
|
|
544
538
|
display,
|
|
545
539
|
reason,
|
|
@@ -550,9 +544,8 @@ export const useSmartLinkAnalytics = (url, _dispatchAnalytics, id, defaultLocati
|
|
|
550
544
|
destinationSubproduct,
|
|
551
545
|
location
|
|
552
546
|
}) => {
|
|
553
|
-
failUfoExperience('smart-link-action-invocation', experienceId);
|
|
554
547
|
dispatchAnalytics(applyCommonAttributes(invokeFailedEvent({
|
|
555
|
-
id: defaultId,
|
|
548
|
+
id: id !== null && id !== void 0 ? id : defaultId,
|
|
556
549
|
actionType,
|
|
557
550
|
display,
|
|
558
551
|
reason,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TrackQuickActionFailureReason } from '../../../utils/analytics/analytics';
|
|
2
|
+
export const getInvokeFailureReason = err => {
|
|
3
|
+
if (!isInvokeCustomError(err)) {
|
|
4
|
+
return TrackQuickActionFailureReason.UnknownError;
|
|
5
|
+
}
|
|
6
|
+
switch (err === null || err === void 0 ? void 0 : err.errorCode) {
|
|
7
|
+
case 403:
|
|
8
|
+
return TrackQuickActionFailureReason.PermissionError;
|
|
9
|
+
default:
|
|
10
|
+
return TrackQuickActionFailureReason.UnknownError;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const isInvokeCustomError = err => (err === null || err === void 0 ? void 0 : err.message) !== undefined && (err === null || err === void 0 ? void 0 : err.errorCode) !== undefined;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
3
|
import * as measure from '../../../utils/performance';
|
|
4
|
+
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from '../../analytics';
|
|
5
|
+
const ACTION_EXPERIENCE_NAME = 'smart-link-action-invocation';
|
|
6
|
+
|
|
4
7
|
/**
|
|
5
8
|
* Invoke client action such as preview, download and open link
|
|
6
9
|
*/
|
|
@@ -18,31 +21,34 @@ const useInvokeClientAction = ({
|
|
|
18
21
|
const markName = `${experienceId}-${actionType}`;
|
|
19
22
|
measure.mark(markName, 'pending');
|
|
20
23
|
try {
|
|
21
|
-
// Begin
|
|
22
|
-
|
|
23
|
-
id: experienceId,
|
|
24
|
-
extensionKey,
|
|
24
|
+
// Begin UFO experience
|
|
25
|
+
startUfoExperience(ACTION_EXPERIENCE_NAME, experienceId, {
|
|
25
26
|
actionType,
|
|
26
27
|
display,
|
|
28
|
+
extensionKey,
|
|
27
29
|
invokeType: 'client'
|
|
28
30
|
});
|
|
29
31
|
|
|
32
|
+
// Begin analytics instrumentation.
|
|
33
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.ui.actionClickedEvent({
|
|
34
|
+
actionType,
|
|
35
|
+
display
|
|
36
|
+
});
|
|
37
|
+
|
|
30
38
|
// Invoke action
|
|
31
39
|
const result = await actionFn();
|
|
32
40
|
measure.mark(markName, 'resolved');
|
|
41
|
+
succeedUfoExperience(ACTION_EXPERIENCE_NAME, experienceId);
|
|
33
42
|
analytics === null || analytics === void 0 ? void 0 : analytics.operational.invokeSucceededEvent({
|
|
34
|
-
id: experienceId,
|
|
35
|
-
extensionKey,
|
|
36
43
|
actionType,
|
|
37
44
|
display
|
|
38
45
|
});
|
|
39
46
|
return result;
|
|
40
47
|
} catch (err) {
|
|
41
48
|
measure.mark(markName, 'errored');
|
|
49
|
+
failUfoExperience(ACTION_EXPERIENCE_NAME, experienceId);
|
|
42
50
|
const reason = typeof err === 'string' ? err : err === null || err === void 0 ? void 0 : err.message;
|
|
43
51
|
analytics === null || analytics === void 0 ? void 0 : analytics.operational.invokeFailedEvent({
|
|
44
|
-
id: experienceId,
|
|
45
|
-
extensionKey,
|
|
46
52
|
actionType,
|
|
47
53
|
display,
|
|
48
54
|
reason
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getMeasure } from '../performance';
|
|
2
|
+
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
2
3
|
export const ANALYTICS_CHANNEL = 'media';
|
|
3
4
|
export const context = {
|
|
4
5
|
componentName: 'smart-cards',
|
|
5
6
|
packageName: "@atlaskit/smart-card",
|
|
6
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.26.0"
|
|
7
8
|
};
|
|
8
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
9
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,6 +16,15 @@ export let TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
|
|
|
15
16
|
TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
|
|
16
17
|
return TrackQuickActionFailureReason;
|
|
17
18
|
}({});
|
|
19
|
+
export const SmartLinkActionTypeTrackingEventMapper = {
|
|
20
|
+
[SmartLinkActionType.FollowEntityAction]: 'Follow',
|
|
21
|
+
[SmartLinkActionType.StatusUpdateAction]: 'StatusUpdate',
|
|
22
|
+
[SmartLinkActionType.UnfollowEntityAction]: 'Unfollow'
|
|
23
|
+
};
|
|
24
|
+
export const SmartLinkActionTypeUiEventMapper = {
|
|
25
|
+
[SmartLinkActionType.FollowEntityAction]: 'smartLinkFollowButton',
|
|
26
|
+
[SmartLinkActionType.UnfollowEntityAction]: 'smartLinkFollowButton'
|
|
27
|
+
};
|
|
18
28
|
const uiActionSubjectIds = {
|
|
19
29
|
DownloadAction: 'downloadDocument',
|
|
20
30
|
PreviewAction: 'invokePreviewScreen',
|
|
@@ -229,42 +239,51 @@ export const trackAppAccountAuthStarted = ({
|
|
|
229
239
|
export const trackSmartLinkQuickActionStarted = ({
|
|
230
240
|
smartLinkActionType,
|
|
231
241
|
...attributes
|
|
232
|
-
}) =>
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
+
}) => {
|
|
243
|
+
var _SmartLinkActionTypeT;
|
|
244
|
+
return {
|
|
245
|
+
action: 'started',
|
|
246
|
+
actionSubject: 'smartLinkQuickAction',
|
|
247
|
+
eventType: 'track',
|
|
248
|
+
attributes: {
|
|
249
|
+
...context,
|
|
250
|
+
...attributes,
|
|
251
|
+
smartLinkActionType: (_SmartLinkActionTypeT = SmartLinkActionTypeTrackingEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeT !== void 0 ? _SmartLinkActionTypeT : smartLinkActionType
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
};
|
|
242
255
|
export const trackSmartLinkQuickActionSuccess = ({
|
|
243
256
|
smartLinkActionType,
|
|
244
257
|
...attributes
|
|
245
|
-
}) =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
258
|
+
}) => {
|
|
259
|
+
var _SmartLinkActionTypeT2;
|
|
260
|
+
return {
|
|
261
|
+
action: 'success',
|
|
262
|
+
actionSubject: 'smartLinkQuickAction',
|
|
263
|
+
eventType: 'track',
|
|
264
|
+
attributes: {
|
|
265
|
+
...context,
|
|
266
|
+
...attributes,
|
|
267
|
+
smartLinkActionType: (_SmartLinkActionTypeT2 = SmartLinkActionTypeTrackingEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeT2 !== void 0 ? _SmartLinkActionTypeT2 : smartLinkActionType
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
};
|
|
255
271
|
export const trackSmartLinkQuickActionFailed = ({
|
|
256
272
|
smartLinkActionType,
|
|
257
273
|
...attributes
|
|
258
|
-
}) =>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
274
|
+
}) => {
|
|
275
|
+
var _SmartLinkActionTypeT3;
|
|
276
|
+
return {
|
|
277
|
+
action: 'failed',
|
|
278
|
+
actionSubject: 'smartLinkQuickAction',
|
|
279
|
+
eventType: 'track',
|
|
280
|
+
attributes: {
|
|
281
|
+
...context,
|
|
282
|
+
...attributes,
|
|
283
|
+
smartLinkActionType: (_SmartLinkActionTypeT3 = SmartLinkActionTypeTrackingEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeT3 !== void 0 ? _SmartLinkActionTypeT3 : smartLinkActionType
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
};
|
|
268
287
|
export const trackHoverCardResolutionStarted = ({
|
|
269
288
|
display,
|
|
270
289
|
...attributes
|
|
@@ -660,4 +679,18 @@ export const uiSmartLinkStatusOpenPreviewButtonClicked = () => ({
|
|
|
660
679
|
attributes: {
|
|
661
680
|
...context
|
|
662
681
|
}
|
|
663
|
-
});
|
|
682
|
+
});
|
|
683
|
+
export const uiServerActionClicked = ({
|
|
684
|
+
smartLinkActionType
|
|
685
|
+
}) => {
|
|
686
|
+
var _SmartLinkActionTypeU;
|
|
687
|
+
return {
|
|
688
|
+
action: 'clicked',
|
|
689
|
+
actionSubject: 'button',
|
|
690
|
+
actionSubjectId: (_SmartLinkActionTypeU = SmartLinkActionTypeUiEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeU !== void 0 ? _SmartLinkActionTypeU : smartLinkActionType,
|
|
691
|
+
eventType: 'ui',
|
|
692
|
+
attributes: {
|
|
693
|
+
...context
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
};
|