@atlaskit/smart-card 32.7.6 → 32.7.8
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/flexible/actions/index.js +5 -7
- package/dist/cjs/state/actions/index.js +13 -38
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +54 -305
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -2
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +4 -5
- package/dist/cjs/utils/analytics/analytics.js +28 -304
- package/dist/cjs/utils/analytics/index.js +0 -66
- package/dist/cjs/utils/mocks.js +5 -7
- package/dist/cjs/view/BlockCard/views/styled.js +1 -1
- package/dist/cjs/view/Card/index.js +5 -7
- package/dist/cjs/view/CardWithUrl/component.js +7 -22
- package/dist/cjs/view/EmbedCard/EmbedResizeMessageListener.js +7 -10
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +10 -12
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +61 -61
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +34 -34
- package/dist/cjs/view/FlexibleCard/components/utils.js +5 -5
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/cjs/view/HoverCard/styled.js +1 -1
- package/dist/cjs/view/InlineCard/ErroredView/index.js +8 -11
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +10 -13
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +7 -10
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +5 -7
- package/dist/cjs/view/InlineCard/ResolvingView/index.js +5 -7
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/LinkView/index.js +5 -7
- package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/es2019/state/actions/index.js +13 -38
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +2 -238
- package/dist/es2019/utils/analytics/analytics.js +2 -286
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/view/BlockCard/views/styled.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +8 -23
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/es2019/view/FlexibleCard/components/utils.js +3 -3
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/es2019/view/HoverCard/styled.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/esm/extractors/flexible/actions/index.js +5 -7
- package/dist/esm/state/actions/index.js +13 -38
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +55 -306
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +1 -2
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +4 -5
- package/dist/esm/utils/analytics/analytics.js +27 -303
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/utils/mocks.js +5 -7
- package/dist/esm/view/BlockCard/views/styled.js +1 -1
- package/dist/esm/view/Card/index.js +5 -7
- package/dist/esm/view/CardWithUrl/component.js +8 -23
- package/dist/esm/view/EmbedCard/EmbedResizeMessageListener.js +7 -10
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/common/test-utils.js +10 -12
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +61 -61
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +34 -34
- package/dist/esm/view/FlexibleCard/components/utils.js +5 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
- package/dist/esm/view/HoverCard/styled.js +1 -1
- package/dist/esm/view/InlineCard/ErroredView/index.js +8 -11
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +10 -13
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +7 -10
- package/dist/esm/view/InlineCard/ResolvedView/index.js +5 -7
- package/dist/esm/view/InlineCard/ResolvingView/index.js +5 -7
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/LinkView/index.js +5 -7
- package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types/utils/analytics/analytics.d.ts +1 -51
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +0 -60
- package/dist/types/utils/mocks.d.ts +0 -12
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +1 -101
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -51
- package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -60
- package/dist/types-ts4.5/utils/mocks.d.ts +0 -12
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
- package/package.json +2 -5
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _SmartLinkActionTypeT, _SmartLinkActionTypeU;
|
|
5
4
|
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; }
|
|
6
5
|
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; }
|
|
7
|
-
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
8
6
|
import { getMeasure } from '../performance';
|
|
9
7
|
export var ANALYTICS_CHANNEL = 'media';
|
|
10
8
|
export var context = {
|
|
11
9
|
componentName: 'smart-cards',
|
|
12
10
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "32.7.
|
|
11
|
+
packageVersion: "32.7.8"
|
|
14
12
|
};
|
|
15
13
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
16
14
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -22,8 +20,6 @@ export var TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
|
|
|
22
20
|
TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
|
|
23
21
|
return TrackQuickActionFailureReason;
|
|
24
22
|
}({});
|
|
25
|
-
export var SmartLinkActionTypeTrackingEventMapper = (_SmartLinkActionTypeT = {}, _defineProperty(_SmartLinkActionTypeT, SmartLinkActionType.FollowEntityAction, 'Follow'), _defineProperty(_SmartLinkActionTypeT, SmartLinkActionType.StatusUpdateAction, 'StatusUpdate'), _defineProperty(_SmartLinkActionTypeT, SmartLinkActionType.UnfollowEntityAction, 'Unfollow'), _SmartLinkActionTypeT);
|
|
26
|
-
export var SmartLinkActionTypeUiEventMapper = (_SmartLinkActionTypeU = {}, _defineProperty(_SmartLinkActionTypeU, SmartLinkActionType.FollowEntityAction, 'smartLinkFollowButton'), _defineProperty(_SmartLinkActionTypeU, SmartLinkActionType.UnfollowEntityAction, 'smartLinkFollowButton'), _SmartLinkActionTypeU);
|
|
27
23
|
var uiActionSubjectIds = {
|
|
28
24
|
DownloadAction: 'downloadDocument',
|
|
29
25
|
PreviewAction: 'invokePreviewScreen',
|
|
@@ -34,7 +30,7 @@ export var SmartLinkEvents = /*#__PURE__*/function () {
|
|
|
34
30
|
function SmartLinkEvents() {
|
|
35
31
|
_classCallCheck(this, SmartLinkEvents);
|
|
36
32
|
}
|
|
37
|
-
_createClass(SmartLinkEvents, [{
|
|
33
|
+
return _createClass(SmartLinkEvents, [{
|
|
38
34
|
key: "insertSmartLink",
|
|
39
35
|
value: function insertSmartLink(url, type, createAnalyticsEvent) {
|
|
40
36
|
fireSmartLinkEvent({
|
|
@@ -50,7 +46,6 @@ export var SmartLinkEvents = /*#__PURE__*/function () {
|
|
|
50
46
|
}, createAnalyticsEvent);
|
|
51
47
|
}
|
|
52
48
|
}]);
|
|
53
|
-
return SmartLinkEvents;
|
|
54
49
|
}();
|
|
55
50
|
export var fireSmartLinkEvent = function fireSmartLinkEvent(payload, createAnalyticsEvent) {
|
|
56
51
|
if (createAnalyticsEvent) {
|
|
@@ -113,100 +108,15 @@ export var invokeFailedEvent = function invokeFailedEvent(_ref2) {
|
|
|
113
108
|
})
|
|
114
109
|
};
|
|
115
110
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*/
|
|
120
|
-
export var uiAuthEvent = function uiAuthEvent(_ref3) {
|
|
121
|
-
var definitionId = _ref3.definitionId,
|
|
111
|
+
export var uiActionClickedEvent = function uiActionClickedEvent(_ref3) {
|
|
112
|
+
var id = _ref3.id,
|
|
113
|
+
actionType = _ref3.actionType,
|
|
122
114
|
extensionKey = _ref3.extensionKey,
|
|
115
|
+
display = _ref3.display,
|
|
116
|
+
definitionId = _ref3.definitionId,
|
|
123
117
|
destinationProduct = _ref3.destinationProduct,
|
|
124
118
|
destinationSubproduct = _ref3.destinationSubproduct,
|
|
125
|
-
location = _ref3.location
|
|
126
|
-
display = _ref3.display;
|
|
127
|
-
return {
|
|
128
|
-
action: 'clicked',
|
|
129
|
-
actionSubject: 'button',
|
|
130
|
-
actionSubjectId: 'connectAccount',
|
|
131
|
-
eventType: 'ui',
|
|
132
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
133
|
-
definitionId: definitionId,
|
|
134
|
-
extensionKey: extensionKey,
|
|
135
|
-
destinationProduct: destinationProduct,
|
|
136
|
-
destinationSubproduct: destinationSubproduct,
|
|
137
|
-
location: location,
|
|
138
|
-
display: display
|
|
139
|
-
})
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
145
|
-
*/
|
|
146
|
-
export var uiAuthAlternateAccountEvent = function uiAuthAlternateAccountEvent(_ref4) {
|
|
147
|
-
var definitionId = _ref4.definitionId,
|
|
148
|
-
extensionKey = _ref4.extensionKey,
|
|
149
|
-
destinationProduct = _ref4.destinationProduct,
|
|
150
|
-
destinationSubproduct = _ref4.destinationSubproduct,
|
|
151
|
-
location = _ref4.location,
|
|
152
|
-
display = _ref4.display;
|
|
153
|
-
return {
|
|
154
|
-
action: 'clicked',
|
|
155
|
-
actionSubject: 'smartLink',
|
|
156
|
-
actionSubjectId: 'tryAnotherAccount',
|
|
157
|
-
eventType: 'ui',
|
|
158
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
159
|
-
definitionId: definitionId,
|
|
160
|
-
extensionKey: extensionKey,
|
|
161
|
-
destinationProduct: destinationProduct,
|
|
162
|
-
destinationSubproduct: destinationSubproduct,
|
|
163
|
-
location: location,
|
|
164
|
-
display: display
|
|
165
|
-
})
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
171
|
-
*/
|
|
172
|
-
export var uiCardClickedEvent = function uiCardClickedEvent(_ref5) {
|
|
173
|
-
var id = _ref5.id,
|
|
174
|
-
display = _ref5.display,
|
|
175
|
-
status = _ref5.status,
|
|
176
|
-
definitionId = _ref5.definitionId,
|
|
177
|
-
extensionKey = _ref5.extensionKey,
|
|
178
|
-
isModifierKeyPressed = _ref5.isModifierKeyPressed,
|
|
179
|
-
location = _ref5.location,
|
|
180
|
-
destinationProduct = _ref5.destinationProduct,
|
|
181
|
-
destinationSubproduct = _ref5.destinationSubproduct,
|
|
182
|
-
actionSubjectId = _ref5.actionSubjectId;
|
|
183
|
-
return {
|
|
184
|
-
action: 'clicked',
|
|
185
|
-
actionSubject: 'smartLink',
|
|
186
|
-
actionSubjectId: actionSubjectId,
|
|
187
|
-
eventType: 'ui',
|
|
188
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
189
|
-
id: id,
|
|
190
|
-
status: status,
|
|
191
|
-
definitionId: definitionId,
|
|
192
|
-
extensionKey: extensionKey,
|
|
193
|
-
display: display,
|
|
194
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
195
|
-
location: location,
|
|
196
|
-
destinationProduct: destinationProduct,
|
|
197
|
-
destinationSubproduct: destinationSubproduct
|
|
198
|
-
})
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
export var uiActionClickedEvent = function uiActionClickedEvent(_ref6) {
|
|
202
|
-
var id = _ref6.id,
|
|
203
|
-
actionType = _ref6.actionType,
|
|
204
|
-
extensionKey = _ref6.extensionKey,
|
|
205
|
-
display = _ref6.display,
|
|
206
|
-
definitionId = _ref6.definitionId,
|
|
207
|
-
destinationProduct = _ref6.destinationProduct,
|
|
208
|
-
destinationSubproduct = _ref6.destinationSubproduct,
|
|
209
|
-
location = _ref6.location;
|
|
119
|
+
location = _ref3.location;
|
|
210
120
|
return {
|
|
211
121
|
action: 'clicked',
|
|
212
122
|
actionSubject: 'button',
|
|
@@ -224,40 +134,15 @@ export var uiActionClickedEvent = function uiActionClickedEvent(_ref6) {
|
|
|
224
134
|
})
|
|
225
135
|
};
|
|
226
136
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
destinationSubproduct = _ref7.destinationSubproduct,
|
|
237
|
-
location = _ref7.location;
|
|
238
|
-
return {
|
|
239
|
-
action: 'closed',
|
|
240
|
-
actionSubject: 'consentModal',
|
|
241
|
-
eventType: 'ui',
|
|
242
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
243
|
-
extensionKey: extensionKey,
|
|
244
|
-
definitionId: definitionId,
|
|
245
|
-
destinationProduct: destinationProduct,
|
|
246
|
-
destinationSubproduct: destinationSubproduct,
|
|
247
|
-
location: location,
|
|
248
|
-
display: display
|
|
249
|
-
})
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
|
-
export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref8) {
|
|
253
|
-
var display = _ref8.display,
|
|
254
|
-
status = _ref8.status,
|
|
255
|
-
extensionKey = _ref8.extensionKey,
|
|
256
|
-
definitionId = _ref8.definitionId,
|
|
257
|
-
destinationProduct = _ref8.destinationProduct,
|
|
258
|
-
destinationSubproduct = _ref8.destinationSubproduct,
|
|
259
|
-
location = _ref8.location,
|
|
260
|
-
canBeDatasource = _ref8.canBeDatasource;
|
|
137
|
+
export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref4) {
|
|
138
|
+
var display = _ref4.display,
|
|
139
|
+
status = _ref4.status,
|
|
140
|
+
extensionKey = _ref4.extensionKey,
|
|
141
|
+
definitionId = _ref4.definitionId,
|
|
142
|
+
destinationProduct = _ref4.destinationProduct,
|
|
143
|
+
destinationSubproduct = _ref4.destinationSubproduct,
|
|
144
|
+
location = _ref4.location,
|
|
145
|
+
canBeDatasource = _ref4.canBeDatasource;
|
|
261
146
|
return {
|
|
262
147
|
action: 'renderSuccess',
|
|
263
148
|
actionSubject: 'smartLink',
|
|
@@ -274,15 +159,15 @@ export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref8) {
|
|
|
274
159
|
})
|
|
275
160
|
};
|
|
276
161
|
};
|
|
277
|
-
export var uiRenderFailedEvent = function uiRenderFailedEvent(
|
|
278
|
-
var display =
|
|
279
|
-
error =
|
|
280
|
-
errorInfo =
|
|
281
|
-
extensionKey =
|
|
282
|
-
definitionId =
|
|
283
|
-
destinationProduct =
|
|
284
|
-
destinationSubproduct =
|
|
285
|
-
location =
|
|
162
|
+
export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref5) {
|
|
163
|
+
var display = _ref5.display,
|
|
164
|
+
error = _ref5.error,
|
|
165
|
+
errorInfo = _ref5.errorInfo,
|
|
166
|
+
extensionKey = _ref5.extensionKey,
|
|
167
|
+
definitionId = _ref5.definitionId,
|
|
168
|
+
destinationProduct = _ref5.destinationProduct,
|
|
169
|
+
destinationSubproduct = _ref5.destinationSubproduct,
|
|
170
|
+
location = _ref5.location;
|
|
286
171
|
return {
|
|
287
172
|
actionSubject: 'smartLink',
|
|
288
173
|
action: 'renderFailed',
|
|
@@ -298,165 +183,4 @@ export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref9) {
|
|
|
298
183
|
location: location
|
|
299
184
|
})
|
|
300
185
|
};
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
305
|
-
*/
|
|
306
|
-
export var uiHoverCardViewedEvent = function uiHoverCardViewedEvent(_ref10) {
|
|
307
|
-
var id = _ref10.id,
|
|
308
|
-
previewDisplay = _ref10.previewDisplay,
|
|
309
|
-
extensionKey = _ref10.extensionKey,
|
|
310
|
-
definitionId = _ref10.definitionId,
|
|
311
|
-
destinationProduct = _ref10.destinationProduct,
|
|
312
|
-
destinationSubproduct = _ref10.destinationSubproduct,
|
|
313
|
-
location = _ref10.location,
|
|
314
|
-
previewInvokeMethod = _ref10.previewInvokeMethod,
|
|
315
|
-
status = _ref10.status;
|
|
316
|
-
return {
|
|
317
|
-
action: 'viewed',
|
|
318
|
-
actionSubject: 'hoverCard',
|
|
319
|
-
eventType: 'ui',
|
|
320
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
321
|
-
id: id,
|
|
322
|
-
previewDisplay: previewDisplay,
|
|
323
|
-
extensionKey: extensionKey,
|
|
324
|
-
definitionId: definitionId,
|
|
325
|
-
destinationProduct: destinationProduct,
|
|
326
|
-
destinationSubproduct: destinationSubproduct,
|
|
327
|
-
location: location,
|
|
328
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
329
|
-
status: status
|
|
330
|
-
})
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
336
|
-
*/
|
|
337
|
-
export var uiHoverCardDismissedEvent = function uiHoverCardDismissedEvent(_ref11) {
|
|
338
|
-
var id = _ref11.id,
|
|
339
|
-
previewDisplay = _ref11.previewDisplay,
|
|
340
|
-
hoverTime = _ref11.hoverTime,
|
|
341
|
-
extensionKey = _ref11.extensionKey,
|
|
342
|
-
definitionId = _ref11.definitionId,
|
|
343
|
-
destinationProduct = _ref11.destinationProduct,
|
|
344
|
-
destinationSubproduct = _ref11.destinationSubproduct,
|
|
345
|
-
location = _ref11.location,
|
|
346
|
-
previewInvokeMethod = _ref11.previewInvokeMethod,
|
|
347
|
-
status = _ref11.status;
|
|
348
|
-
return {
|
|
349
|
-
action: 'dismissed',
|
|
350
|
-
actionSubject: 'hoverCard',
|
|
351
|
-
eventType: 'ui',
|
|
352
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
353
|
-
id: id,
|
|
354
|
-
previewDisplay: previewDisplay,
|
|
355
|
-
hoverTime: hoverTime,
|
|
356
|
-
extensionKey: extensionKey,
|
|
357
|
-
definitionId: definitionId,
|
|
358
|
-
destinationProduct: destinationProduct,
|
|
359
|
-
destinationSubproduct: destinationSubproduct,
|
|
360
|
-
location: location,
|
|
361
|
-
previewInvokeMethod: previewInvokeMethod,
|
|
362
|
-
status: status
|
|
363
|
-
})
|
|
364
|
-
};
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
369
|
-
*/
|
|
370
|
-
export var uiHoverCardOpenLinkClickedEvent = function uiHoverCardOpenLinkClickedEvent(_ref12) {
|
|
371
|
-
var id = _ref12.id,
|
|
372
|
-
previewDisplay = _ref12.previewDisplay,
|
|
373
|
-
extensionKey = _ref12.extensionKey,
|
|
374
|
-
definitionId = _ref12.definitionId,
|
|
375
|
-
destinationProduct = _ref12.destinationProduct,
|
|
376
|
-
destinationSubproduct = _ref12.destinationSubproduct,
|
|
377
|
-
location = _ref12.location,
|
|
378
|
-
previewInvokeMethod = _ref12.previewInvokeMethod;
|
|
379
|
-
return {
|
|
380
|
-
action: 'clicked',
|
|
381
|
-
actionSubject: 'button',
|
|
382
|
-
actionSubjectId: 'shortcutGoToLink',
|
|
383
|
-
eventType: 'ui',
|
|
384
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
385
|
-
id: id,
|
|
386
|
-
previewDisplay: previewDisplay,
|
|
387
|
-
extensionKey: extensionKey,
|
|
388
|
-
definitionId: definitionId,
|
|
389
|
-
destinationProduct: destinationProduct,
|
|
390
|
-
destinationSubproduct: destinationSubproduct,
|
|
391
|
-
location: location,
|
|
392
|
-
previewInvokeMethod: previewInvokeMethod
|
|
393
|
-
})
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
399
|
-
*/
|
|
400
|
-
export var uiLearnMoreLinkClickedEvent = function uiLearnMoreLinkClickedEvent() {
|
|
401
|
-
return {
|
|
402
|
-
action: 'clicked',
|
|
403
|
-
actionSubject: 'button',
|
|
404
|
-
actionSubjectId: 'learnMore',
|
|
405
|
-
eventType: 'ui',
|
|
406
|
-
attributes: _objectSpread({}, context)
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
412
|
-
*/
|
|
413
|
-
export var uiSmartLinkStatusLozengeButtonClicked = function uiSmartLinkStatusLozengeButtonClicked() {
|
|
414
|
-
return {
|
|
415
|
-
action: 'clicked',
|
|
416
|
-
actionSubject: 'button',
|
|
417
|
-
actionSubjectId: 'smartLinkStatusLozenge',
|
|
418
|
-
eventType: 'ui',
|
|
419
|
-
attributes: _objectSpread({}, context)
|
|
420
|
-
};
|
|
421
|
-
};
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
425
|
-
*/
|
|
426
|
-
export var uiSmartLinkStatusListItemButtonClicked = function uiSmartLinkStatusListItemButtonClicked() {
|
|
427
|
-
return {
|
|
428
|
-
action: 'clicked',
|
|
429
|
-
actionSubject: 'button',
|
|
430
|
-
actionSubjectId: 'smartLinkStatusListItem',
|
|
431
|
-
eventType: 'ui',
|
|
432
|
-
attributes: _objectSpread({}, context)
|
|
433
|
-
};
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
438
|
-
*/
|
|
439
|
-
export var uiSmartLinkStatusOpenPreviewButtonClicked = function uiSmartLinkStatusOpenPreviewButtonClicked() {
|
|
440
|
-
return {
|
|
441
|
-
action: 'clicked',
|
|
442
|
-
actionSubject: 'button',
|
|
443
|
-
actionSubjectId: 'smartLinkStatusOpenPreview',
|
|
444
|
-
eventType: 'ui',
|
|
445
|
-
attributes: _objectSpread({}, context)
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
|
|
451
|
-
*/
|
|
452
|
-
export var uiServerActionClicked = function uiServerActionClicked(_ref13) {
|
|
453
|
-
var _SmartLinkActionTypeU2;
|
|
454
|
-
var smartLinkActionType = _ref13.smartLinkActionType;
|
|
455
|
-
return {
|
|
456
|
-
action: 'clicked',
|
|
457
|
-
actionSubject: 'button',
|
|
458
|
-
actionSubjectId: (_SmartLinkActionTypeU2 = SmartLinkActionTypeUiEventMapper[smartLinkActionType]) !== null && _SmartLinkActionTypeU2 !== void 0 ? _SmartLinkActionTypeU2 : smartLinkActionType,
|
|
459
|
-
eventType: 'ui',
|
|
460
|
-
attributes: _objectSpread({}, context)
|
|
461
|
-
};
|
|
462
186
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent,
|
|
1
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, invokeSucceededEvent, invokeFailedEvent, uiActionClickedEvent, uiRenderSuccessEvent, uiRenderFailedEvent } from './analytics';
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
-
function
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
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; }
|
|
12
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) { _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; }
|
|
@@ -201,13 +201,12 @@ export var fakeResponse = function fakeResponse() {
|
|
|
201
201
|
};
|
|
202
202
|
export var fakeFactory = function fakeFactory(implementation, implementationPost, implementationPrefetch, implementationAri) {
|
|
203
203
|
return /*#__PURE__*/function (_CardClient) {
|
|
204
|
-
_inherits(CustomClient, _CardClient);
|
|
205
|
-
var _super = _createSuper(CustomClient);
|
|
206
204
|
function CustomClient() {
|
|
207
205
|
_classCallCheck(this, CustomClient);
|
|
208
|
-
return
|
|
206
|
+
return _callSuper(this, CustomClient, arguments);
|
|
209
207
|
}
|
|
210
|
-
|
|
208
|
+
_inherits(CustomClient, _CardClient);
|
|
209
|
+
return _createClass(CustomClient, [{
|
|
211
210
|
key: "fetchData",
|
|
212
211
|
value: // @ts-ignore
|
|
213
212
|
function () {
|
|
@@ -297,7 +296,6 @@ export var fakeFactory = function fakeFactory(implementation, implementationPost
|
|
|
297
296
|
return fetchDataAris;
|
|
298
297
|
}()
|
|
299
298
|
}]);
|
|
300
|
-
return CustomClient;
|
|
301
299
|
}(CardClient);
|
|
302
300
|
};
|
|
303
301
|
export var waitFor = function waitFor() {
|
|
@@ -23,7 +23,7 @@ export var titleBlockCss = css({
|
|
|
23
23
|
gap: "var(--ds-space-100, 0.5em)",
|
|
24
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
25
25
|
"[data-smart-element='Title']": {
|
|
26
|
-
fontWeight: 600
|
|
26
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)"
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { injectIntl, IntlProvider } from 'react-intl-next';
|
|
@@ -11,13 +11,12 @@ import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-n
|
|
|
11
11
|
import { context } from '../../utils/analytics';
|
|
12
12
|
import { CardWithURLRenderer } from '../CardWithUrl/loader';
|
|
13
13
|
var PlainCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
14
|
-
_inherits(PlainCard, _React$PureComponent);
|
|
15
|
-
var _super = _createSuper(PlainCard);
|
|
16
14
|
function PlainCard() {
|
|
17
15
|
_classCallCheck(this, PlainCard);
|
|
18
|
-
return
|
|
16
|
+
return _callSuper(this, PlainCard, arguments);
|
|
19
17
|
}
|
|
20
|
-
|
|
18
|
+
_inherits(PlainCard, _React$PureComponent);
|
|
19
|
+
return _createClass(PlainCard, [{
|
|
21
20
|
key: "render",
|
|
22
21
|
value: function render() {
|
|
23
22
|
var content = /*#__PURE__*/React.createElement(CardWithURLRenderer, this.props);
|
|
@@ -26,7 +25,6 @@ var PlainCard = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
26
25
|
}, content);
|
|
27
26
|
}
|
|
28
27
|
}]);
|
|
29
|
-
return PlainCard;
|
|
30
28
|
}(React.PureComponent);
|
|
31
29
|
export var Card = withAnalyticsContext(context)(withAnalyticsEvents()(injectIntl(PlainCard, {
|
|
32
30
|
enforceContext: false
|
|
@@ -5,7 +5,7 @@ import { useAnalyticsEvents } from '../../common/analytics/generated/use-analyti
|
|
|
5
5
|
import { CardDisplay } from '../../constants';
|
|
6
6
|
import { useSmartLink } from '../../state';
|
|
7
7
|
import { succeedUfoExperience } from '../../state/analytics';
|
|
8
|
-
import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey,
|
|
8
|
+
import { getCanBeDatasource, getClickUrl, getDefinitionId, getExtensionKey, getResourceType, getServices, isFinalState } from '../../state/helpers';
|
|
9
9
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
10
10
|
import { isSpecialEvent } from '../../utils';
|
|
11
11
|
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
@@ -60,8 +60,6 @@ function Component(_ref) {
|
|
|
60
60
|
var definitionId = getDefinitionId(state.details);
|
|
61
61
|
var extensionKey = getExtensionKey(state.details);
|
|
62
62
|
var resourceType = getResourceType(state.details);
|
|
63
|
-
var product = getProduct(state.details);
|
|
64
|
-
var subproduct = getSubproduct(state.details);
|
|
65
63
|
var services = getServices(state.details);
|
|
66
64
|
var canBeDatasource = getCanBeDatasource(state.details);
|
|
67
65
|
var isFlexibleUi = useMemo(function () {
|
|
@@ -75,25 +73,12 @@ function Component(_ref) {
|
|
|
75
73
|
// Setup UI handlers.
|
|
76
74
|
var handleClickWrapper = useCallback(function (event) {
|
|
77
75
|
var isModifierKeyPressed = isSpecialEvent(event);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
-
analytics.ui.cardClickedEvent({
|
|
87
|
-
id: id,
|
|
88
|
-
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
89
|
-
status: state.status,
|
|
90
|
-
definitionId: definitionId,
|
|
91
|
-
extensionKey: extensionKey,
|
|
92
|
-
isModifierKeyPressed: isModifierKeyPressed,
|
|
93
|
-
destinationProduct: product,
|
|
94
|
-
destinationSubproduct: subproduct
|
|
95
|
-
});
|
|
96
|
-
}
|
|
76
|
+
fireEvent('ui.smartLink.clicked', {
|
|
77
|
+
id: id,
|
|
78
|
+
display: isFlexibleUi ? CardDisplay.Flexible : appearance,
|
|
79
|
+
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
80
|
+
isModifierKeyPressed: isModifierKeyPressed
|
|
81
|
+
});
|
|
97
82
|
if (!onClick && !isFlexibleUi) {
|
|
98
83
|
var clickUrl = getClickUrl(url, state.details);
|
|
99
84
|
// Ctrl+left click on mac typically doesn't trigger onClick
|
|
@@ -113,7 +98,7 @@ function Component(_ref) {
|
|
|
113
98
|
}
|
|
114
99
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
115
100
|
}
|
|
116
|
-
}, [id, url, state.details,
|
|
101
|
+
}, [id, url, state.details, appearance, definitionId, onClick, isFlexibleUi, createAnalyticsEvent, fireEvent]);
|
|
117
102
|
var handleAuthorize = useCallback(function () {
|
|
118
103
|
return actions.authorize(appearance);
|
|
119
104
|
}, [actions, appearance]);
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import { embedHeaderHeight } from './components/styled';
|
|
12
11
|
export var EmbedResizeMessageListener = /*#__PURE__*/function (_React$Component) {
|
|
13
|
-
_inherits(EmbedResizeMessageListener, _React$Component);
|
|
14
|
-
var _super = _createSuper(EmbedResizeMessageListener);
|
|
15
12
|
function EmbedResizeMessageListener() {
|
|
16
13
|
var _this;
|
|
17
14
|
_classCallCheck(this, EmbedResizeMessageListener);
|
|
18
15
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
16
|
args[_key] = arguments[_key];
|
|
20
17
|
}
|
|
21
|
-
_this =
|
|
22
|
-
_defineProperty(
|
|
18
|
+
_this = _callSuper(this, EmbedResizeMessageListener, [].concat(args));
|
|
19
|
+
_defineProperty(_this, "messageCallback", function (event) {
|
|
23
20
|
var embedIframeRef = _this.props.embedIframeRef;
|
|
24
21
|
var isFromExpectedIframe = embedIframeRef.current && event.source === embedIframeRef.current.contentWindow;
|
|
25
22
|
var isStringData = typeof event.data === 'string';
|
|
@@ -34,14 +31,15 @@ export var EmbedResizeMessageListener = /*#__PURE__*/function (_React$Component)
|
|
|
34
31
|
} catch (e) {}
|
|
35
32
|
}
|
|
36
33
|
});
|
|
37
|
-
_defineProperty(
|
|
34
|
+
_defineProperty(_this, "onEmbedHeightChange", function (data) {
|
|
38
35
|
var onHeightUpdate = _this.props.onHeightUpdate;
|
|
39
36
|
var height = data.height + embedHeaderHeight;
|
|
40
37
|
onHeightUpdate(height);
|
|
41
38
|
});
|
|
42
39
|
return _this;
|
|
43
40
|
}
|
|
44
|
-
|
|
41
|
+
_inherits(EmbedResizeMessageListener, _React$Component);
|
|
42
|
+
return _createClass(EmbedResizeMessageListener, [{
|
|
45
43
|
key: "componentDidMount",
|
|
46
44
|
value: function componentDidMount() {
|
|
47
45
|
window.addEventListener('message', this.messageCallback);
|
|
@@ -57,5 +55,4 @@ export var EmbedResizeMessageListener = /*#__PURE__*/function (_React$Component)
|
|
|
57
55
|
return this.props.children;
|
|
58
56
|
}
|
|
59
57
|
}]);
|
|
60
|
-
return EmbedResizeMessageListener;
|
|
61
58
|
}(React.Component);
|
|
@@ -26,7 +26,7 @@ var getButtonStyle = function getButtonStyle(size, iconOnly) {
|
|
|
26
26
|
case SmartLinkSize.Small:
|
|
27
27
|
return css({
|
|
28
28
|
fontSize: '0.75rem',
|
|
29
|
-
fontWeight: 500,
|
|
29
|
+
fontWeight: "var(--ds-font-weight-medium, 500)",
|
|
30
30
|
lineHeight: '1rem',
|
|
31
31
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
32
|
'button, button:hover, button:focus, button:active': [{
|
|
@@ -5,9 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
5
5
|
var _excluded = ["action", "onClick", "onError"];
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
10
|
-
import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
|
|
11
9
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
12
10
|
import { getInvokeFailureReason } from '../../../../../../state/hooks/use-invoke/utils';
|
|
13
11
|
import useResolve from '../../../../../../state/hooks/use-resolve';
|
|
@@ -22,7 +20,6 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
22
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
21
|
isLoading = _useState2[0],
|
|
24
22
|
setIsLoading = _useState2[1];
|
|
25
|
-
var analytics = useFlexibleUiAnalyticsContext();
|
|
26
23
|
var invoke = useInvoke();
|
|
27
24
|
var reload = useResolve();
|
|
28
25
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -39,16 +36,10 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
39
36
|
smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
40
37
|
_context.prev = 2;
|
|
41
38
|
setIsLoading(true);
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
45
|
-
} else {
|
|
46
|
-
fireEvent("ui.button.clicked.".concat(smartLinkActionType), {});
|
|
47
|
-
}
|
|
39
|
+
if (smartLinkActionType === 'FollowEntityAction' || smartLinkActionType === 'UnfollowEntityAction') {
|
|
40
|
+
fireEvent('ui.button.clicked.smartLinkFollowButton', {});
|
|
48
41
|
} else {
|
|
49
|
-
|
|
50
|
-
smartLinkActionType: smartLinkActionType
|
|
51
|
-
});
|
|
42
|
+
fireEvent("ui.button.clicked.".concat(smartLinkActionType), {});
|
|
52
43
|
}
|
|
53
44
|
fireEvent('track.smartLinkQuickAction.started', {
|
|
54
45
|
smartLinkActionType: smartLinkActionType
|
|
@@ -87,7 +78,7 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
87
78
|
return _context.stop();
|
|
88
79
|
}
|
|
89
80
|
}, _callee, null, [[2, 17]]);
|
|
90
|
-
})), [action,
|
|
81
|
+
})), [action, invoke, onClick, onErrorCallback, reload, fireEvent]);
|
|
91
82
|
return /*#__PURE__*/React.createElement(Action, _extends({}, props, {
|
|
92
83
|
isLoading: isLoading,
|
|
93
84
|
onClick: handleClick
|