@atlaskit/smart-card 26.2.2 → 26.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/state/hooks/use-invoke/index.js +8 -28
- package/dist/cjs/utils/analytics/analytics.js +13 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +38 -30
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js +31 -0
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js +1 -1
- package/dist/es2019/state/hooks/use-invoke/index.js +4 -23
- package/dist/es2019/utils/analytics/analytics.js +10 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +14 -6
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js +21 -0
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js +1 -0
- package/dist/esm/state/hooks/use-invoke/index.js +8 -28
- package/dist/esm/utils/analytics/analytics.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +38 -30
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js +21 -0
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js +1 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -3
- package/dist/types/state/flexible-ui-context/index.d.ts +10 -6
- package/dist/types/state/hooks/use-invoke/index.d.ts +1 -7
- package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types/utils/analytics/analytics.d.ts +11 -3
- package/dist/types/utils/mocks.d.ts +5 -3
- package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.d.ts +21 -0
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -3
- package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +10 -6
- package/dist/types-ts4.5/state/hooks/use-invoke/index.d.ts +1 -7
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +11 -3
- package/dist/types-ts4.5/utils/mocks.d.ts +5 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.d.ts +21 -0
- package/package.json +1 -1
- package/report.api.md +21 -3
- package/tmp/api-report-tmp.d.ts +927 -0
|
@@ -17,6 +17,8 @@ import createStatusUpdateRequest from '../../../../../utils/actions/create-statu
|
|
|
17
17
|
import useResolve from '../../../../../state/hooks/use-resolve';
|
|
18
18
|
import { LozengeActionErrorMessages } from './lozenge-action-error/types';
|
|
19
19
|
import { useFlexibleUiAnalyticsContext } from '../../../../../state/flexible-ui-context';
|
|
20
|
+
import { TrackQuickActionType } from '../../../../../utils/analytics/analytics';
|
|
21
|
+
import { permissionLoadErrorAnalyticsPayload, unknownLoadErrorAnalyticsPayload, unknownUpdateErrorAnalyticsPayload, validationUpdateErrorAnalyticsPayload } from './lozenge-action-analytics';
|
|
20
22
|
var validateItems = function validateItems() {
|
|
21
23
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
22
24
|
var text = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -65,11 +67,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
65
67
|
var reload = useResolve();
|
|
66
68
|
//TODO EDM-6583 Replace usage of useFlexibleUiAnalyticsContext with linking platform analytics context from find team.
|
|
67
69
|
var analytics = useFlexibleUiAnalyticsContext();
|
|
68
|
-
var invoke = useInvoke(
|
|
69
|
-
started: analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionStarted,
|
|
70
|
-
success: analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionSuccess,
|
|
71
|
-
failed: analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed
|
|
72
|
-
});
|
|
70
|
+
var invoke = useInvoke();
|
|
73
71
|
useEffect(function () {
|
|
74
72
|
setSelected({
|
|
75
73
|
text: text,
|
|
@@ -88,47 +86,52 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
88
86
|
case 0:
|
|
89
87
|
setIsOpen(args.isOpen);
|
|
90
88
|
if (!args.isOpen) {
|
|
91
|
-
_context.next =
|
|
89
|
+
_context.next = 24;
|
|
92
90
|
break;
|
|
93
91
|
}
|
|
94
92
|
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionClickedEvent();
|
|
93
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionStarted({
|
|
94
|
+
smartLinkActionType: TrackQuickActionType.StatusUpdate
|
|
95
|
+
});
|
|
95
96
|
if (!(!isLoaded && action !== null && action !== void 0 && action.read)) {
|
|
96
|
-
_context.next =
|
|
97
|
+
_context.next = 24;
|
|
97
98
|
break;
|
|
98
99
|
}
|
|
99
|
-
_context.prev =
|
|
100
|
+
_context.prev = 5;
|
|
100
101
|
setIsLoading(true);
|
|
101
|
-
_context.next =
|
|
102
|
+
_context.next = 9;
|
|
102
103
|
return invoke(action.read, extractLozengeActionItems);
|
|
103
|
-
case
|
|
104
|
+
case 9:
|
|
104
105
|
responseItems = _context.sent;
|
|
105
106
|
validItems = typeof text === 'string' ? validateItems(responseItems, text) : responseItems;
|
|
106
107
|
setItems(validItems);
|
|
107
108
|
setIsLoaded(true);
|
|
108
109
|
if ((validItems === null || validItems === void 0 ? void 0 : validItems.length) === 0) {
|
|
110
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed(permissionLoadErrorAnalyticsPayload);
|
|
109
111
|
setErrorMessage(LozengeActionErrorMessages.noData);
|
|
110
112
|
setIsLoaded(false);
|
|
111
113
|
}
|
|
112
|
-
_context.next =
|
|
114
|
+
_context.next = 21;
|
|
113
115
|
break;
|
|
114
|
-
case
|
|
115
|
-
_context.prev =
|
|
116
|
-
_context.t0 = _context["catch"](
|
|
116
|
+
case 16:
|
|
117
|
+
_context.prev = 16;
|
|
118
|
+
_context.t0 = _context["catch"](5);
|
|
117
119
|
setErrorMessage(LozengeActionErrorMessages.unknown);
|
|
118
120
|
setIsLoaded(false);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed(unknownLoadErrorAnalyticsPayload);
|
|
122
|
+
case 21:
|
|
123
|
+
_context.prev = 21;
|
|
121
124
|
setIsLoading(false);
|
|
122
|
-
return _context.finish(
|
|
123
|
-
case
|
|
125
|
+
return _context.finish(21);
|
|
126
|
+
case 24:
|
|
124
127
|
if (!args.isOpen) {
|
|
125
128
|
setErrorMessage(undefined);
|
|
126
129
|
}
|
|
127
|
-
case
|
|
130
|
+
case 25:
|
|
128
131
|
case "end":
|
|
129
132
|
return _context.stop();
|
|
130
133
|
}
|
|
131
|
-
}, _callee, null, [[
|
|
134
|
+
}, _callee, null, [[5, 16, 21, 24]]);
|
|
132
135
|
}));
|
|
133
136
|
return function (_x) {
|
|
134
137
|
return _ref3.apply(this, arguments);
|
|
@@ -151,7 +154,7 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
151
154
|
analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionListItemClickedEvent();
|
|
152
155
|
updateAction = action === null || action === void 0 ? void 0 : action.update;
|
|
153
156
|
if (!(updateAction && id)) {
|
|
154
|
-
_context2.next =
|
|
157
|
+
_context2.next = 17;
|
|
155
158
|
break;
|
|
156
159
|
}
|
|
157
160
|
setIsLoading(true);
|
|
@@ -167,34 +170,39 @@ var LozengeAction = function LozengeAction(_ref) {
|
|
|
167
170
|
setIsLoaded(false);
|
|
168
171
|
setIsOpen(false);
|
|
169
172
|
setItems([]);
|
|
173
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionSuccess({
|
|
174
|
+
smartLinkActionType: TrackQuickActionType.StatusUpdate
|
|
175
|
+
});
|
|
170
176
|
if (!url) {
|
|
171
|
-
_context2.next =
|
|
177
|
+
_context2.next = 17;
|
|
172
178
|
break;
|
|
173
179
|
}
|
|
174
|
-
_context2.next =
|
|
180
|
+
_context2.next = 17;
|
|
175
181
|
return reload(url, true, undefined, linkId);
|
|
176
|
-
case
|
|
177
|
-
_context2.next =
|
|
182
|
+
case 17:
|
|
183
|
+
_context2.next = 23;
|
|
178
184
|
break;
|
|
179
|
-
case
|
|
180
|
-
_context2.prev =
|
|
185
|
+
case 19:
|
|
186
|
+
_context2.prev = 19;
|
|
181
187
|
_context2.t0 = _context2["catch"](0);
|
|
182
188
|
setIsLoading(false);
|
|
183
189
|
if (isInvokeCustomError(_context2.t0)) {
|
|
184
190
|
setErrorMessage(_context2.t0.message);
|
|
191
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed(validationUpdateErrorAnalyticsPayload);
|
|
185
192
|
} else {
|
|
186
193
|
setErrorMessage(LozengeActionErrorMessages.updateFailed);
|
|
194
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.track.smartLinkQuickActionFailed(unknownUpdateErrorAnalyticsPayload);
|
|
187
195
|
}
|
|
188
|
-
case
|
|
196
|
+
case 23:
|
|
189
197
|
case "end":
|
|
190
198
|
return _context2.stop();
|
|
191
199
|
}
|
|
192
|
-
}, _callee2, null, [[0,
|
|
200
|
+
}, _callee2, null, [[0, 19]]);
|
|
193
201
|
}));
|
|
194
202
|
return function (_x2, _x3, _x4) {
|
|
195
203
|
return _ref4.apply(this, arguments);
|
|
196
204
|
};
|
|
197
|
-
}(), [action === null || action === void 0 ? void 0 : action.update, analytics
|
|
205
|
+
}(), [action === null || action === void 0 ? void 0 : action.update, analytics, invoke, linkId, reload, url]);
|
|
198
206
|
var dropdownItemGroup = useMemo(function () {
|
|
199
207
|
if (errorMessage) {
|
|
200
208
|
return jsx(LozengeActionError, {
|
package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../utils/analytics/analytics';
|
|
2
|
+
export var unknownLoadErrorAnalyticsPayload = {
|
|
3
|
+
smartLinkActionType: TrackQuickActionType.StatusUpdate,
|
|
4
|
+
reason: TrackQuickActionFailureReason.UnknownError,
|
|
5
|
+
step: 'load'
|
|
6
|
+
};
|
|
7
|
+
export var permissionLoadErrorAnalyticsPayload = {
|
|
8
|
+
smartLinkActionType: TrackQuickActionType.StatusUpdate,
|
|
9
|
+
reason: TrackQuickActionFailureReason.PermissionError,
|
|
10
|
+
step: 'load'
|
|
11
|
+
};
|
|
12
|
+
export var unknownUpdateErrorAnalyticsPayload = {
|
|
13
|
+
smartLinkActionType: TrackQuickActionType.StatusUpdate,
|
|
14
|
+
reason: TrackQuickActionFailureReason.UnknownError,
|
|
15
|
+
step: 'update'
|
|
16
|
+
};
|
|
17
|
+
export var validationUpdateErrorAnalyticsPayload = {
|
|
18
|
+
smartLinkActionType: TrackQuickActionType.StatusUpdate,
|
|
19
|
+
reason: TrackQuickActionFailureReason.ValidationError,
|
|
20
|
+
step: 'update'
|
|
21
|
+
};
|
package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getTruncateStyles } from '../../../utils';
|
|
|
6
6
|
export var dropdownItemGroupStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n button {\n width: 220px;\n\n &:hover {\n background-color: inherit;\n cursor: default;\n }\n }\n"])));
|
|
7
7
|
var sharedBlockStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n gap: 0.5rem;\n line-height: 1rem;\n min-width: 0;\n overflow: hidden;\n flex-direction: row;\n align-items: center;\n"])));
|
|
8
8
|
export var contentStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", ";\n\n margin-top: ", ";\n align-items: flex-start;\n\n > span,\n > div {\n font-size: 0.875rem;\n line-height: 1.25rem;\n color: ", ";\n }\n"])), sharedBlockStyles, "var(--ds-space-025, 2px)", "var(--ds-text, ".concat(N800, ")"));
|
|
9
|
-
export var linkStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n\n font-size: 0.875rem;\n margin-top: 10px;\n margin-left: ", ";\n margin-bottom: ", ";\n"])), sharedBlockStyles, "var(--ds-space-400, 32px)", "var(--ds-space-025, 2px)");
|
|
9
|
+
export var linkStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n\n cursor: pointer;\n font-size: 0.875rem;\n margin-top: 10px;\n margin-left: ", ";\n margin-bottom: ", ";\n"])), sharedBlockStyles, "var(--ds-space-400, 32px)", "var(--ds-space-025, 2px)");
|
|
10
10
|
export var textStyles = function textStyles(maxLines) {
|
|
11
11
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n line-height: 1rem;\n white-space: normal;\n ", ";\n"])), getTruncateStyles(maxLines));
|
|
12
12
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnalyticsHandler, AnalyticsName, AnalyticsPayload } from '../../utils/types';
|
|
2
2
|
import { CommonEventProps, ConnectFailedEventProps, ConnectSucceededEventProps, InstrumentEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiIframeDwelledEventProps, UiIframeFocusedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps } from '../../utils/analytics/types';
|
|
3
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../utils/analytics/analytics';
|
|
3
4
|
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
4
5
|
/**
|
|
5
6
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
@@ -249,19 +250,21 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
|
|
|
249
250
|
* This fires a tracking event before an action invoke api call is made
|
|
250
251
|
*/
|
|
251
252
|
smartLinkQuickActionStarted: (props: {
|
|
252
|
-
smartLinkActionType: SmartLinkActionType;
|
|
253
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
253
254
|
}) => void;
|
|
254
255
|
/**
|
|
255
256
|
* This fires a tracking event after an action invoke api call is successful
|
|
256
257
|
*/
|
|
257
258
|
smartLinkQuickActionSuccess: (props: {
|
|
258
|
-
smartLinkActionType: SmartLinkActionType;
|
|
259
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
259
260
|
}) => void;
|
|
260
261
|
/**
|
|
261
262
|
* This fires a tracking event after an action invoke api call has failed
|
|
262
263
|
*/
|
|
263
264
|
smartLinkQuickActionFailed: (props: {
|
|
264
|
-
smartLinkActionType: SmartLinkActionType;
|
|
265
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
266
|
+
reason?: TrackQuickActionFailureReason;
|
|
267
|
+
step?: string;
|
|
265
268
|
}) => void;
|
|
266
269
|
};
|
|
267
270
|
screen: {
|
|
@@ -51,13 +51,15 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
|
|
|
51
51
|
[key: string]: any;
|
|
52
52
|
}) => void;
|
|
53
53
|
smartLinkQuickActionStarted: (props: {
|
|
54
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
54
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
55
55
|
}) => void;
|
|
56
56
|
smartLinkQuickActionSuccess: (props: {
|
|
57
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
57
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
58
58
|
}) => void;
|
|
59
59
|
smartLinkQuickActionFailed: (props: {
|
|
60
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
60
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
61
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
62
|
+
step?: string | undefined;
|
|
61
63
|
}) => void;
|
|
62
64
|
};
|
|
63
65
|
screen: {
|
|
@@ -107,13 +109,15 @@ export declare const useFlexibleUiAnalyticsContext: () => {
|
|
|
107
109
|
[key: string]: any;
|
|
108
110
|
}) => void;
|
|
109
111
|
smartLinkQuickActionStarted: (props: {
|
|
110
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
112
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
111
113
|
}) => void;
|
|
112
114
|
smartLinkQuickActionSuccess: (props: {
|
|
113
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
115
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
114
116
|
}) => void;
|
|
115
117
|
smartLinkQuickActionFailed: (props: {
|
|
116
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
118
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
119
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
120
|
+
step?: string | undefined;
|
|
117
121
|
}) => void;
|
|
118
122
|
};
|
|
119
123
|
screen: {
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { InvokeRequest } from '@atlaskit/linking-types/smart-link-actions';
|
|
2
|
-
|
|
3
|
-
type InvokeRequestTracker = {
|
|
4
|
-
started?: AnalyticsFacade['track']['smartLinkQuickActionStarted'];
|
|
5
|
-
success?: AnalyticsFacade['track']['smartLinkQuickActionSuccess'];
|
|
6
|
-
failed?: AnalyticsFacade['track']['smartLinkQuickActionFailed'];
|
|
7
|
-
};
|
|
8
|
-
declare const useInvoke: ({ failed, started, success }?: InvokeRequestTracker) => (req: InvokeRequest, cb?: Function) => Promise<any>;
|
|
2
|
+
declare const useInvoke: () => (req: InvokeRequest, cb?: Function) => Promise<any>;
|
|
9
3
|
export default useInvoke;
|
|
@@ -54,13 +54,15 @@ dispatchAnalytics?: AnalyticsHandler): {
|
|
|
54
54
|
[key: string]: any;
|
|
55
55
|
}) => void;
|
|
56
56
|
smartLinkQuickActionStarted: (props: {
|
|
57
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
57
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
58
58
|
}) => void;
|
|
59
59
|
smartLinkQuickActionSuccess: (props: {
|
|
60
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
60
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
61
61
|
}) => void;
|
|
62
62
|
smartLinkQuickActionFailed: (props: {
|
|
63
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
63
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
64
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
65
|
+
step?: string | undefined;
|
|
64
66
|
}) => void;
|
|
65
67
|
};
|
|
66
68
|
screen: {
|
|
@@ -9,6 +9,14 @@ export declare const context: {
|
|
|
9
9
|
packageName: any;
|
|
10
10
|
packageVersion: any;
|
|
11
11
|
};
|
|
12
|
+
export declare enum TrackQuickActionType {
|
|
13
|
+
StatusUpdate = "StatusUpdate"
|
|
14
|
+
}
|
|
15
|
+
export declare enum TrackQuickActionFailureReason {
|
|
16
|
+
PermissionError = "PermissionError",
|
|
17
|
+
ValidationError = "ValidationError",
|
|
18
|
+
UnknownError = "UnknownError"
|
|
19
|
+
}
|
|
12
20
|
export declare class SmartLinkEvents {
|
|
13
21
|
insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
14
22
|
}
|
|
@@ -25,13 +33,13 @@ export declare const trackLinkUpdated: ({ actionSubjectId, ...attributes }: Comm
|
|
|
25
33
|
[key: string]: any;
|
|
26
34
|
}) => AnalyticsPayload;
|
|
27
35
|
export declare const trackSmartLinkQuickActionStarted: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
28
|
-
smartLinkActionType: SmartLinkActionType;
|
|
36
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
29
37
|
}) => AnalyticsPayload;
|
|
30
38
|
export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
31
|
-
smartLinkActionType: SmartLinkActionType;
|
|
39
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
32
40
|
}) => AnalyticsPayload;
|
|
33
41
|
export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
34
|
-
smartLinkActionType: SmartLinkActionType;
|
|
42
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
35
43
|
}) => AnalyticsPayload;
|
|
36
44
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
37
45
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
@@ -79,13 +79,15 @@ export declare const mockAnalytics: {
|
|
|
79
79
|
[key: string]: any;
|
|
80
80
|
}) => void;
|
|
81
81
|
smartLinkQuickActionStarted: (props: {
|
|
82
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
82
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
83
83
|
}) => void;
|
|
84
84
|
smartLinkQuickActionSuccess: (props: {
|
|
85
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
85
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
86
86
|
}) => void;
|
|
87
87
|
smartLinkQuickActionFailed: (props: {
|
|
88
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
88
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
89
|
+
reason?: import("./analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
90
|
+
step?: string | undefined;
|
|
89
91
|
}) => void;
|
|
90
92
|
};
|
|
91
93
|
screen: {
|
package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../utils/analytics/analytics';
|
|
2
|
+
export declare const unknownLoadErrorAnalyticsPayload: {
|
|
3
|
+
smartLinkActionType: TrackQuickActionType;
|
|
4
|
+
reason: TrackQuickActionFailureReason;
|
|
5
|
+
step: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const permissionLoadErrorAnalyticsPayload: {
|
|
8
|
+
smartLinkActionType: TrackQuickActionType;
|
|
9
|
+
reason: TrackQuickActionFailureReason;
|
|
10
|
+
step: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const unknownUpdateErrorAnalyticsPayload: {
|
|
13
|
+
smartLinkActionType: TrackQuickActionType;
|
|
14
|
+
reason: TrackQuickActionFailureReason;
|
|
15
|
+
step: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const validationUpdateErrorAnalyticsPayload: {
|
|
18
|
+
smartLinkActionType: TrackQuickActionType;
|
|
19
|
+
reason: TrackQuickActionFailureReason;
|
|
20
|
+
step: string;
|
|
21
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnalyticsHandler, AnalyticsName, AnalyticsPayload } from '../../utils/types';
|
|
2
2
|
import { CommonEventProps, ConnectFailedEventProps, ConnectSucceededEventProps, InstrumentEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiIframeDwelledEventProps, UiIframeFocusedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps } from '../../utils/analytics/types';
|
|
3
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../utils/analytics/analytics';
|
|
3
4
|
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
4
5
|
/**
|
|
5
6
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
@@ -249,19 +250,21 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
|
|
|
249
250
|
* This fires a tracking event before an action invoke api call is made
|
|
250
251
|
*/
|
|
251
252
|
smartLinkQuickActionStarted: (props: {
|
|
252
|
-
smartLinkActionType: SmartLinkActionType;
|
|
253
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
253
254
|
}) => void;
|
|
254
255
|
/**
|
|
255
256
|
* This fires a tracking event after an action invoke api call is successful
|
|
256
257
|
*/
|
|
257
258
|
smartLinkQuickActionSuccess: (props: {
|
|
258
|
-
smartLinkActionType: SmartLinkActionType;
|
|
259
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
259
260
|
}) => void;
|
|
260
261
|
/**
|
|
261
262
|
* This fires a tracking event after an action invoke api call has failed
|
|
262
263
|
*/
|
|
263
264
|
smartLinkQuickActionFailed: (props: {
|
|
264
|
-
smartLinkActionType: SmartLinkActionType;
|
|
265
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
266
|
+
reason?: TrackQuickActionFailureReason;
|
|
267
|
+
step?: string;
|
|
265
268
|
}) => void;
|
|
266
269
|
};
|
|
267
270
|
screen: {
|
|
@@ -51,13 +51,15 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
|
|
|
51
51
|
[key: string]: any;
|
|
52
52
|
}) => void;
|
|
53
53
|
smartLinkQuickActionStarted: (props: {
|
|
54
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
54
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
55
55
|
}) => void;
|
|
56
56
|
smartLinkQuickActionSuccess: (props: {
|
|
57
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
57
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
58
58
|
}) => void;
|
|
59
59
|
smartLinkQuickActionFailed: (props: {
|
|
60
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
60
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
61
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
62
|
+
step?: string | undefined;
|
|
61
63
|
}) => void;
|
|
62
64
|
};
|
|
63
65
|
screen: {
|
|
@@ -107,13 +109,15 @@ export declare const useFlexibleUiAnalyticsContext: () => {
|
|
|
107
109
|
[key: string]: any;
|
|
108
110
|
}) => void;
|
|
109
111
|
smartLinkQuickActionStarted: (props: {
|
|
110
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
112
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
111
113
|
}) => void;
|
|
112
114
|
smartLinkQuickActionSuccess: (props: {
|
|
113
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
115
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
114
116
|
}) => void;
|
|
115
117
|
smartLinkQuickActionFailed: (props: {
|
|
116
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
118
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
119
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
120
|
+
step?: string | undefined;
|
|
117
121
|
}) => void;
|
|
118
122
|
};
|
|
119
123
|
screen: {
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { InvokeRequest } from '@atlaskit/linking-types/smart-link-actions';
|
|
2
|
-
|
|
3
|
-
type InvokeRequestTracker = {
|
|
4
|
-
started?: AnalyticsFacade['track']['smartLinkQuickActionStarted'];
|
|
5
|
-
success?: AnalyticsFacade['track']['smartLinkQuickActionSuccess'];
|
|
6
|
-
failed?: AnalyticsFacade['track']['smartLinkQuickActionFailed'];
|
|
7
|
-
};
|
|
8
|
-
declare const useInvoke: ({ failed, started, success }?: InvokeRequestTracker) => (req: InvokeRequest, cb?: Function) => Promise<any>;
|
|
2
|
+
declare const useInvoke: () => (req: InvokeRequest, cb?: Function) => Promise<any>;
|
|
9
3
|
export default useInvoke;
|
|
@@ -54,13 +54,15 @@ dispatchAnalytics?: AnalyticsHandler): {
|
|
|
54
54
|
[key: string]: any;
|
|
55
55
|
}) => void;
|
|
56
56
|
smartLinkQuickActionStarted: (props: {
|
|
57
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
57
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
58
58
|
}) => void;
|
|
59
59
|
smartLinkQuickActionSuccess: (props: {
|
|
60
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
60
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
61
61
|
}) => void;
|
|
62
62
|
smartLinkQuickActionFailed: (props: {
|
|
63
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
63
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
64
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
65
|
+
step?: string | undefined;
|
|
64
66
|
}) => void;
|
|
65
67
|
};
|
|
66
68
|
screen: {
|
|
@@ -9,6 +9,14 @@ export declare const context: {
|
|
|
9
9
|
packageName: any;
|
|
10
10
|
packageVersion: any;
|
|
11
11
|
};
|
|
12
|
+
export declare enum TrackQuickActionType {
|
|
13
|
+
StatusUpdate = "StatusUpdate"
|
|
14
|
+
}
|
|
15
|
+
export declare enum TrackQuickActionFailureReason {
|
|
16
|
+
PermissionError = "PermissionError",
|
|
17
|
+
ValidationError = "ValidationError",
|
|
18
|
+
UnknownError = "UnknownError"
|
|
19
|
+
}
|
|
12
20
|
export declare class SmartLinkEvents {
|
|
13
21
|
insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
14
22
|
}
|
|
@@ -25,13 +33,13 @@ export declare const trackLinkUpdated: ({ actionSubjectId, ...attributes }: Comm
|
|
|
25
33
|
[key: string]: any;
|
|
26
34
|
}) => AnalyticsPayload;
|
|
27
35
|
export declare const trackSmartLinkQuickActionStarted: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
28
|
-
smartLinkActionType: SmartLinkActionType;
|
|
36
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
29
37
|
}) => AnalyticsPayload;
|
|
30
38
|
export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
31
|
-
smartLinkActionType: SmartLinkActionType;
|
|
39
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
32
40
|
}) => AnalyticsPayload;
|
|
33
41
|
export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
34
|
-
smartLinkActionType: SmartLinkActionType;
|
|
42
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
35
43
|
}) => AnalyticsPayload;
|
|
36
44
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
37
45
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
@@ -79,13 +79,15 @@ export declare const mockAnalytics: {
|
|
|
79
79
|
[key: string]: any;
|
|
80
80
|
}) => void;
|
|
81
81
|
smartLinkQuickActionStarted: (props: {
|
|
82
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
82
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
83
83
|
}) => void;
|
|
84
84
|
smartLinkQuickActionSuccess: (props: {
|
|
85
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
85
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
86
86
|
}) => void;
|
|
87
87
|
smartLinkQuickActionFailed: (props: {
|
|
88
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
88
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
89
|
+
reason?: import("./analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
90
|
+
step?: string | undefined;
|
|
89
91
|
}) => void;
|
|
90
92
|
};
|
|
91
93
|
screen: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../utils/analytics/analytics';
|
|
2
|
+
export declare const unknownLoadErrorAnalyticsPayload: {
|
|
3
|
+
smartLinkActionType: TrackQuickActionType;
|
|
4
|
+
reason: TrackQuickActionFailureReason;
|
|
5
|
+
step: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const permissionLoadErrorAnalyticsPayload: {
|
|
8
|
+
smartLinkActionType: TrackQuickActionType;
|
|
9
|
+
reason: TrackQuickActionFailureReason;
|
|
10
|
+
step: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const unknownUpdateErrorAnalyticsPayload: {
|
|
13
|
+
smartLinkActionType: TrackQuickActionType;
|
|
14
|
+
reason: TrackQuickActionFailureReason;
|
|
15
|
+
step: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const validationUpdateErrorAnalyticsPayload: {
|
|
18
|
+
smartLinkActionType: TrackQuickActionType;
|
|
19
|
+
reason: TrackQuickActionFailureReason;
|
|
20
|
+
step: string;
|
|
21
|
+
};
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -894,6 +894,22 @@ type TitleBlockProps = {
|
|
|
894
894
|
// @public (undocumented)
|
|
895
895
|
type TrackAppAccountConnectedProps = CommonEventProps;
|
|
896
896
|
|
|
897
|
+
// @public (undocumented)
|
|
898
|
+
enum TrackQuickActionFailureReason {
|
|
899
|
+
// (undocumented)
|
|
900
|
+
PermissionError = 'PermissionError',
|
|
901
|
+
// (undocumented)
|
|
902
|
+
UnknownError = 'UnknownError',
|
|
903
|
+
// (undocumented)
|
|
904
|
+
ValidationError = 'ValidationError',
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// @public (undocumented)
|
|
908
|
+
enum TrackQuickActionType {
|
|
909
|
+
// (undocumented)
|
|
910
|
+
StatusUpdate = 'StatusUpdate',
|
|
911
|
+
}
|
|
912
|
+
|
|
897
913
|
// @public (undocumented)
|
|
898
914
|
type UiActionClickedEventProps = CommonEventProps & {
|
|
899
915
|
id: string;
|
|
@@ -1214,13 +1230,15 @@ export const useSmartLinkAnalytics: (
|
|
|
1214
1230
|
},
|
|
1215
1231
|
) => void;
|
|
1216
1232
|
smartLinkQuickActionStarted: (props: {
|
|
1217
|
-
smartLinkActionType: SmartLinkActionType;
|
|
1233
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
1218
1234
|
}) => void;
|
|
1219
1235
|
smartLinkQuickActionSuccess: (props: {
|
|
1220
|
-
smartLinkActionType: SmartLinkActionType;
|
|
1236
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
1221
1237
|
}) => void;
|
|
1222
1238
|
smartLinkQuickActionFailed: (props: {
|
|
1223
|
-
smartLinkActionType: SmartLinkActionType;
|
|
1239
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
1240
|
+
reason?: TrackQuickActionFailureReason;
|
|
1241
|
+
step?: string;
|
|
1224
1242
|
}) => void;
|
|
1225
1243
|
};
|
|
1226
1244
|
screen: {
|