@atlaskit/smart-card 30.2.5 → 30.2.6
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 +8 -0
- package/analytics.spec.yaml +81 -0
- package/dist/cjs/state/actions/index.js +15 -5
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +6 -0
- package/dist/cjs/utils/analytics/analytics.js +33 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +12 -4
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +12 -4
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +34 -11
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +44 -12
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +12 -4
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +75 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/actions/index.js +16 -5
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +6 -0
- package/dist/es2019/utils/analytics/analytics.js +33 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +13 -4
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +13 -4
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +35 -11
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +45 -12
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +13 -4
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +69 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/actions/index.js +15 -5
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +6 -0
- package/dist/esm/utils/analytics/analytics.js +33 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +12 -4
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +12 -4
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +34 -11
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +44 -12
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +12 -4
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +75 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +39 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -0
- package/dist/types/utils/analytics/analytics.d.ts +24 -0
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +1 -6
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +39 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -0
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +24 -0
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +1 -6
- package/package.json +4 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -6,13 +5,16 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
9
9
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, 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
|
import React from 'react';
|
|
12
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
13
|
import Button from '@atlaskit/button';
|
|
14
14
|
import LockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
16
|
import { N500, R400 } from '@atlaskit/theme/colors';
|
|
17
|
+
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
16
18
|
import { messages } from '../../../messages';
|
|
17
19
|
import { HoverCard } from '../../HoverCard';
|
|
18
20
|
import { Frame } from '../Frame';
|
|
@@ -25,12 +27,69 @@ var FallbackUnauthorizedIcon = /*#__PURE__*/React.createElement(AKIconWrapper, n
|
|
|
25
27
|
size: "small",
|
|
26
28
|
primaryColor: "var(--ds-icon-danger, ".concat(R400, ")")
|
|
27
29
|
}));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
var InlineCardUnauthorizedViewNew = function InlineCardUnauthorizedViewNew(_ref) {
|
|
31
|
+
var url = _ref.url,
|
|
32
|
+
id = _ref.id,
|
|
33
|
+
icon = _ref.icon,
|
|
34
|
+
onAuthorise = _ref.onAuthorise,
|
|
35
|
+
onClick = _ref.onClick,
|
|
36
|
+
isSelected = _ref.isSelected,
|
|
37
|
+
_ref$testId = _ref.testId,
|
|
38
|
+
testId = _ref$testId === void 0 ? 'inline-card-unauthorized-view' : _ref$testId,
|
|
39
|
+
_ref$showAuthTooltip = _ref.showAuthTooltip,
|
|
40
|
+
showAuthTooltip = _ref$showAuthTooltip === void 0 ? false : _ref$showAuthTooltip,
|
|
41
|
+
truncateInline = _ref.truncateInline,
|
|
42
|
+
context = _ref.context;
|
|
43
|
+
var frameRef = React.useRef(null);
|
|
44
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
45
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
46
|
+
var handleConnectAccount = React.useCallback(function (event) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
if (onAuthorise) {
|
|
50
|
+
fireEvent('track.applicationAccount.authStarted', {});
|
|
51
|
+
onAuthorise();
|
|
52
|
+
}
|
|
53
|
+
}, [fireEvent, onAuthorise]);
|
|
54
|
+
var renderActionButton = React.useCallback(function () {
|
|
55
|
+
var ActionButton = withFrameStyleControl(Button, frameRef);
|
|
56
|
+
return onAuthorise ? /*#__PURE__*/React.createElement(ActionButton, {
|
|
57
|
+
spacing: "none",
|
|
58
|
+
component: IconStyledButton,
|
|
59
|
+
onClick: handleConnectAccount,
|
|
60
|
+
testId: "button-connect-account"
|
|
61
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_link_account_card_name, {
|
|
62
|
+
values: {
|
|
63
|
+
context: context
|
|
64
|
+
}
|
|
65
|
+
}))) : undefined;
|
|
66
|
+
}, [handleConnectAccount, onAuthorise, context]);
|
|
67
|
+
var inlineCardUnauthenticatedView = /*#__PURE__*/React.createElement(Frame, {
|
|
68
|
+
testId: testId,
|
|
69
|
+
isSelected: isSelected,
|
|
70
|
+
ref: frameRef,
|
|
71
|
+
truncateInline: truncateInline
|
|
72
|
+
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
73
|
+
icon: icon ? icon : FallbackUnauthorizedIcon,
|
|
74
|
+
title: url,
|
|
75
|
+
link: url,
|
|
76
|
+
onClick: onClick,
|
|
77
|
+
titleColor: "var(--ds-text-subtle, ".concat(N500, ")")
|
|
78
|
+
}), renderActionButton());
|
|
79
|
+
if (onAuthorise && showAuthTooltip) {
|
|
80
|
+
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
81
|
+
url: url,
|
|
82
|
+
id: id
|
|
83
|
+
}, inlineCardUnauthenticatedView);
|
|
84
|
+
}
|
|
85
|
+
return inlineCardUnauthenticatedView;
|
|
86
|
+
};
|
|
87
|
+
var InlineCardUnauthorizedViewOld = /*#__PURE__*/function (_React$Component) {
|
|
88
|
+
_inherits(InlineCardUnauthorizedViewOld, _React$Component);
|
|
89
|
+
var _super = _createSuper(InlineCardUnauthorizedViewOld);
|
|
90
|
+
function InlineCardUnauthorizedViewOld() {
|
|
32
91
|
var _this;
|
|
33
|
-
_classCallCheck(this,
|
|
92
|
+
_classCallCheck(this, InlineCardUnauthorizedViewOld);
|
|
34
93
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
94
|
args[_key] = arguments[_key];
|
|
36
95
|
}
|
|
@@ -68,7 +127,7 @@ export var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component)
|
|
|
68
127
|
});
|
|
69
128
|
return _this;
|
|
70
129
|
}
|
|
71
|
-
_createClass(
|
|
130
|
+
_createClass(InlineCardUnauthorizedViewOld, [{
|
|
72
131
|
key: "render",
|
|
73
132
|
value: function render() {
|
|
74
133
|
var _this$props3 = this.props,
|
|
@@ -103,5 +162,12 @@ export var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component)
|
|
|
103
162
|
return inlineCardUnauthenticatedView;
|
|
104
163
|
}
|
|
105
164
|
}]);
|
|
106
|
-
return
|
|
107
|
-
}(React.Component);
|
|
165
|
+
return InlineCardUnauthorizedViewOld;
|
|
166
|
+
}(React.Component);
|
|
167
|
+
export var InlineCardUnauthorizedView = function InlineCardUnauthorizedView(props) {
|
|
168
|
+
if (fg('smart-card-migrate-track-analytics')) {
|
|
169
|
+
return /*#__PURE__*/React.createElement(InlineCardUnauthorizedViewNew, props);
|
|
170
|
+
} else {
|
|
171
|
+
return /*#__PURE__*/React.createElement(InlineCardUnauthorizedViewOld, props);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "30.2.
|
|
13
|
+
packageVersion: "30.2.6",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::82b30bbee0df694864fcd2e2b938bffa>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
10
10
|
packageName: string;
|
|
11
11
|
packageVersion: string;
|
|
12
12
|
};
|
|
13
|
+
export type CommonContextType = {
|
|
14
|
+
extensionKey: string | null;
|
|
15
|
+
resourceType: string | null;
|
|
16
|
+
destinationObjectType: string | null;
|
|
17
|
+
destinationSubproduct: string | null;
|
|
18
|
+
destinationProduct: string | null;
|
|
19
|
+
location: string | null;
|
|
20
|
+
statusDetails: string | null;
|
|
21
|
+
};
|
|
13
22
|
export type ResolvedContextType = {
|
|
14
23
|
status: 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found' | null;
|
|
15
24
|
statusDetails: string | null;
|
|
@@ -67,6 +76,20 @@ export type SmartLinkIframeFocusAttributesType = {
|
|
|
67
76
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
68
77
|
definitionId: string | null;
|
|
69
78
|
};
|
|
79
|
+
export type ApplicationAccountConnectedAttributesType = {
|
|
80
|
+
definitionId: string | null;
|
|
81
|
+
};
|
|
82
|
+
export type ApplicationAccountAuthStartedAttributesType = {};
|
|
83
|
+
export type SmartLinkQuickActionStartedAttributesType = {
|
|
84
|
+
smartLinkActionType: 'FollowEntityAction' | 'GetStatusTransitionsAction' | 'StatusUpdateAction' | 'UnfollowEntityAction' | 'StatusUpdate';
|
|
85
|
+
};
|
|
86
|
+
export type SmartLinkQuickActionSuccessAttributesType = {
|
|
87
|
+
smartLinkActionType: 'FollowEntityAction' | 'GetStatusTransitionsAction' | 'StatusUpdateAction' | 'UnfollowEntityAction' | 'StatusUpdate';
|
|
88
|
+
};
|
|
89
|
+
export type SmartLinkQuickActionFailedAttributesType = {
|
|
90
|
+
smartLinkActionType: 'FollowEntityAction' | 'GetStatusTransitionsAction' | 'StatusUpdateAction' | 'UnfollowEntityAction' | 'StatusUpdate';
|
|
91
|
+
reason: 'PermissionError' | 'ValidationError' | 'UnknownError' | null;
|
|
92
|
+
};
|
|
70
93
|
export type AnalyticsEventAttributes = {
|
|
71
94
|
/**
|
|
72
95
|
* fired when an ai summary is clicked */
|
|
@@ -113,5 +136,20 @@ export type AnalyticsEventAttributes = {
|
|
|
113
136
|
/**
|
|
114
137
|
* fires when a user clicks or tabs into a Smart Link's iframe. */
|
|
115
138
|
'ui.smartLinkIframe.focus': SmartLinkIframeFocusAttributesType;
|
|
139
|
+
/**
|
|
140
|
+
* user connecting their account to view a Smart Link. */
|
|
141
|
+
'track.applicationAccount.connected': ApplicationAccountConnectedAttributesType;
|
|
142
|
+
/**
|
|
143
|
+
* user starting the Smart Link connect account process. */
|
|
144
|
+
'track.applicationAccount.authStarted': ApplicationAccountAuthStartedAttributesType;
|
|
145
|
+
/**
|
|
146
|
+
* fires event before an action invoke api call is made */
|
|
147
|
+
'track.smartLinkQuickAction.started': SmartLinkQuickActionStartedAttributesType;
|
|
148
|
+
/**
|
|
149
|
+
* fires a tracking event after an action invoke api call is successful */
|
|
150
|
+
'track.smartLinkQuickAction.success': SmartLinkQuickActionSuccessAttributesType;
|
|
151
|
+
/**
|
|
152
|
+
* fires a tracking event after an action invoke api call has failed */
|
|
153
|
+
'track.smartLinkQuickAction.failed': SmartLinkQuickActionFailedAttributesType;
|
|
116
154
|
};
|
|
117
155
|
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -229,6 +229,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
|
|
|
229
229
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
230
230
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
231
231
|
* @returns
|
|
232
|
+
* @deprecated
|
|
232
233
|
*/
|
|
233
234
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => void;
|
|
234
235
|
/**
|
|
@@ -236,22 +237,26 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
|
|
|
236
237
|
* @param location a location where the Smart Link auth action was initiated.
|
|
237
238
|
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
238
239
|
* @returns
|
|
240
|
+
* @deprecated
|
|
239
241
|
*/
|
|
240
242
|
appAccountAuthStarted: ({ extensionKey, location }: TrackAppAccountConnectedProps) => void;
|
|
241
243
|
/**
|
|
242
244
|
* This fires a tracking event before an action invoke api call is made
|
|
245
|
+
* @deprecated
|
|
243
246
|
*/
|
|
244
247
|
smartLinkQuickActionStarted: (props: {
|
|
245
248
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
246
249
|
}) => void;
|
|
247
250
|
/**
|
|
248
251
|
* This fires a tracking event after an action invoke api call is successful
|
|
252
|
+
* @deprecated
|
|
249
253
|
*/
|
|
250
254
|
smartLinkQuickActionSuccess: (props: {
|
|
251
255
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
252
256
|
}) => void;
|
|
253
257
|
/**
|
|
254
258
|
* This fires a tracking event after an action invoke api call has failed
|
|
259
|
+
* @deprecated
|
|
255
260
|
*/
|
|
256
261
|
smartLinkQuickActionFailed: (props: {
|
|
257
262
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
@@ -260,6 +265,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
|
|
|
260
265
|
}) => void;
|
|
261
266
|
/**
|
|
262
267
|
* Fires a track event when we call loadMetadata() to get information for a hover card
|
|
268
|
+
* @deprecated
|
|
263
269
|
*/
|
|
264
270
|
hoverCardResolutionStarted: () => void;
|
|
265
271
|
};
|
|
@@ -29,22 +29,46 @@ export declare const invokeSucceededEvent: ({ id, actionType, display, extension
|
|
|
29
29
|
export declare const invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => AnalyticsPayload;
|
|
30
30
|
export declare const connectSucceededEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => AnalyticsPayload;
|
|
31
31
|
export declare const connectFailedEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, reason, }: ConnectFailedEventProps) => AnalyticsPayload;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
32
35
|
export declare const trackAppAccountConnected: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated
|
|
38
|
+
*/
|
|
33
39
|
export declare const trackAppAccountAuthStarted: ({ extensionKey, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
*/
|
|
34
43
|
export declare const trackSmartLinkQuickActionStarted: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
35
44
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
36
45
|
}) => AnalyticsPayload;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
37
49
|
export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
38
50
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
39
51
|
}) => AnalyticsPayload;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated
|
|
54
|
+
*/
|
|
40
55
|
export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
41
56
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
42
57
|
}) => AnalyticsPayload;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated
|
|
60
|
+
*/
|
|
43
61
|
export declare const trackHoverCardResolutionStarted: ({ display, ...attributes }: UiAuthEventProps) => AnalyticsPayload;
|
|
44
62
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
45
63
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
46
64
|
export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
*/
|
|
47
68
|
export declare const uiIframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: UiIframeDwelledEventProps) => AnalyticsPayload;
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated
|
|
71
|
+
*/
|
|
48
72
|
export declare const uiIframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: UiIframeFocusedEventProps) => AnalyticsPayload;
|
|
49
73
|
export declare const uiActionClickedEvent: ({ id, actionType, extensionKey, display, definitionId, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => AnalyticsPayload;
|
|
50
74
|
export declare const uiClosedAuthEvent: ({ display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => AnalyticsPayload;
|
|
@@ -3,5 +3,5 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
4
4
|
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<Omit<CardProps & WrappedComponentProps, "intl"> & {
|
|
5
5
|
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
-
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "
|
|
6
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "actionOptions" | "hoverPreviewOptions" | "onResolve" | "showHoverPreview" | "showAuthTooltip" | "platform" | "forwardedRef" | "fallbackComponent" | "inlinePreloaderStyle" | "isHovered" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "useLegacyBlockCard" | "embedIframeRef" | "embedIframeUrlType" | "frameStyle"> & React.RefAttributes<any>>;
|
|
7
7
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -26,9 +26,4 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
26
26
|
/** Truncates the card to one line */
|
|
27
27
|
truncateInline?: boolean;
|
|
28
28
|
}
|
|
29
|
-
export declare
|
|
30
|
-
private frameRef;
|
|
31
|
-
handleConnectAccount: (event: React.MouseEvent<HTMLElement>) => void;
|
|
32
|
-
renderActionButton: () => JSX.Element | undefined;
|
|
33
|
-
render(): JSX.Element;
|
|
34
|
-
}
|
|
29
|
+
export declare const InlineCardUnauthorizedView: (props: InlineCardUnauthorizedViewProps) => JSX.Element;
|
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::82b30bbee0df694864fcd2e2b938bffa>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
10
10
|
packageName: string;
|
|
11
11
|
packageVersion: string;
|
|
12
12
|
};
|
|
13
|
+
export type CommonContextType = {
|
|
14
|
+
extensionKey: string | null;
|
|
15
|
+
resourceType: string | null;
|
|
16
|
+
destinationObjectType: string | null;
|
|
17
|
+
destinationSubproduct: string | null;
|
|
18
|
+
destinationProduct: string | null;
|
|
19
|
+
location: string | null;
|
|
20
|
+
statusDetails: string | null;
|
|
21
|
+
};
|
|
13
22
|
export type ResolvedContextType = {
|
|
14
23
|
status: 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found' | null;
|
|
15
24
|
statusDetails: string | null;
|
|
@@ -67,6 +76,20 @@ export type SmartLinkIframeFocusAttributesType = {
|
|
|
67
76
|
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
68
77
|
definitionId: string | null;
|
|
69
78
|
};
|
|
79
|
+
export type ApplicationAccountConnectedAttributesType = {
|
|
80
|
+
definitionId: string | null;
|
|
81
|
+
};
|
|
82
|
+
export type ApplicationAccountAuthStartedAttributesType = {};
|
|
83
|
+
export type SmartLinkQuickActionStartedAttributesType = {
|
|
84
|
+
smartLinkActionType: 'FollowEntityAction' | 'GetStatusTransitionsAction' | 'StatusUpdateAction' | 'UnfollowEntityAction' | 'StatusUpdate';
|
|
85
|
+
};
|
|
86
|
+
export type SmartLinkQuickActionSuccessAttributesType = {
|
|
87
|
+
smartLinkActionType: 'FollowEntityAction' | 'GetStatusTransitionsAction' | 'StatusUpdateAction' | 'UnfollowEntityAction' | 'StatusUpdate';
|
|
88
|
+
};
|
|
89
|
+
export type SmartLinkQuickActionFailedAttributesType = {
|
|
90
|
+
smartLinkActionType: 'FollowEntityAction' | 'GetStatusTransitionsAction' | 'StatusUpdateAction' | 'UnfollowEntityAction' | 'StatusUpdate';
|
|
91
|
+
reason: 'PermissionError' | 'ValidationError' | 'UnknownError' | null;
|
|
92
|
+
};
|
|
70
93
|
export type AnalyticsEventAttributes = {
|
|
71
94
|
/**
|
|
72
95
|
* fired when an ai summary is clicked */
|
|
@@ -113,5 +136,20 @@ export type AnalyticsEventAttributes = {
|
|
|
113
136
|
/**
|
|
114
137
|
* fires when a user clicks or tabs into a Smart Link's iframe. */
|
|
115
138
|
'ui.smartLinkIframe.focus': SmartLinkIframeFocusAttributesType;
|
|
139
|
+
/**
|
|
140
|
+
* user connecting their account to view a Smart Link. */
|
|
141
|
+
'track.applicationAccount.connected': ApplicationAccountConnectedAttributesType;
|
|
142
|
+
/**
|
|
143
|
+
* user starting the Smart Link connect account process. */
|
|
144
|
+
'track.applicationAccount.authStarted': ApplicationAccountAuthStartedAttributesType;
|
|
145
|
+
/**
|
|
146
|
+
* fires event before an action invoke api call is made */
|
|
147
|
+
'track.smartLinkQuickAction.started': SmartLinkQuickActionStartedAttributesType;
|
|
148
|
+
/**
|
|
149
|
+
* fires a tracking event after an action invoke api call is successful */
|
|
150
|
+
'track.smartLinkQuickAction.success': SmartLinkQuickActionSuccessAttributesType;
|
|
151
|
+
/**
|
|
152
|
+
* fires a tracking event after an action invoke api call has failed */
|
|
153
|
+
'track.smartLinkQuickAction.failed': SmartLinkQuickActionFailedAttributesType;
|
|
116
154
|
};
|
|
117
155
|
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -229,6 +229,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
|
|
|
229
229
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
230
230
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
231
231
|
* @returns
|
|
232
|
+
* @deprecated
|
|
232
233
|
*/
|
|
233
234
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => void;
|
|
234
235
|
/**
|
|
@@ -236,22 +237,26 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
|
|
|
236
237
|
* @param location a location where the Smart Link auth action was initiated.
|
|
237
238
|
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
238
239
|
* @returns
|
|
240
|
+
* @deprecated
|
|
239
241
|
*/
|
|
240
242
|
appAccountAuthStarted: ({ extensionKey, location }: TrackAppAccountConnectedProps) => void;
|
|
241
243
|
/**
|
|
242
244
|
* This fires a tracking event before an action invoke api call is made
|
|
245
|
+
* @deprecated
|
|
243
246
|
*/
|
|
244
247
|
smartLinkQuickActionStarted: (props: {
|
|
245
248
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
246
249
|
}) => void;
|
|
247
250
|
/**
|
|
248
251
|
* This fires a tracking event after an action invoke api call is successful
|
|
252
|
+
* @deprecated
|
|
249
253
|
*/
|
|
250
254
|
smartLinkQuickActionSuccess: (props: {
|
|
251
255
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
252
256
|
}) => void;
|
|
253
257
|
/**
|
|
254
258
|
* This fires a tracking event after an action invoke api call has failed
|
|
259
|
+
* @deprecated
|
|
255
260
|
*/
|
|
256
261
|
smartLinkQuickActionFailed: (props: {
|
|
257
262
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
@@ -260,6 +265,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
|
|
|
260
265
|
}) => void;
|
|
261
266
|
/**
|
|
262
267
|
* Fires a track event when we call loadMetadata() to get information for a hover card
|
|
268
|
+
* @deprecated
|
|
263
269
|
*/
|
|
264
270
|
hoverCardResolutionStarted: () => void;
|
|
265
271
|
};
|
|
@@ -29,22 +29,46 @@ export declare const invokeSucceededEvent: ({ id, actionType, display, extension
|
|
|
29
29
|
export declare const invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => AnalyticsPayload;
|
|
30
30
|
export declare const connectSucceededEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => AnalyticsPayload;
|
|
31
31
|
export declare const connectFailedEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, reason, }: ConnectFailedEventProps) => AnalyticsPayload;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
32
35
|
export declare const trackAppAccountConnected: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated
|
|
38
|
+
*/
|
|
33
39
|
export declare const trackAppAccountAuthStarted: ({ extensionKey, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
*/
|
|
34
43
|
export declare const trackSmartLinkQuickActionStarted: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
35
44
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
36
45
|
}) => AnalyticsPayload;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
37
49
|
export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
38
50
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
39
51
|
}) => AnalyticsPayload;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated
|
|
54
|
+
*/
|
|
40
55
|
export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
41
56
|
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
42
57
|
}) => AnalyticsPayload;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated
|
|
60
|
+
*/
|
|
43
61
|
export declare const trackHoverCardResolutionStarted: ({ display, ...attributes }: UiAuthEventProps) => AnalyticsPayload;
|
|
44
62
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
45
63
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
46
64
|
export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
*/
|
|
47
68
|
export declare const uiIframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: UiIframeDwelledEventProps) => AnalyticsPayload;
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated
|
|
71
|
+
*/
|
|
48
72
|
export declare const uiIframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: UiIframeFocusedEventProps) => AnalyticsPayload;
|
|
49
73
|
export declare const uiActionClickedEvent: ({ id, actionType, extensionKey, display, definitionId, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => AnalyticsPayload;
|
|
50
74
|
export declare const uiClosedAuthEvent: ({ display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => AnalyticsPayload;
|
|
@@ -3,5 +3,5 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
4
4
|
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<Omit<CardProps & WrappedComponentProps, "intl"> & {
|
|
5
5
|
forwardedRef?: React.Ref<any> | undefined;
|
|
6
|
-
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "
|
|
6
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "actionOptions" | "hoverPreviewOptions" | "onResolve" | "showHoverPreview" | "showAuthTooltip" | "platform" | "forwardedRef" | "fallbackComponent" | "inlinePreloaderStyle" | "isHovered" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "useLegacyBlockCard" | "embedIframeRef" | "embedIframeUrlType" | "frameStyle"> & React.RefAttributes<any>>;
|
|
7
7
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -26,9 +26,4 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
26
26
|
/** Truncates the card to one line */
|
|
27
27
|
truncateInline?: boolean;
|
|
28
28
|
}
|
|
29
|
-
export declare
|
|
30
|
-
private frameRef;
|
|
31
|
-
handleConnectAccount: (event: React.MouseEvent<HTMLElement>) => void;
|
|
32
|
-
renderActionButton: () => JSX.Element | undefined;
|
|
33
|
-
render(): JSX.Element;
|
|
34
|
-
}
|
|
29
|
+
export declare const InlineCardUnauthorizedView: (props: InlineCardUnauthorizedViewProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "30.2.
|
|
3
|
+
"version": "30.2.6",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -176,6 +176,9 @@
|
|
|
176
176
|
},
|
|
177
177
|
"smart-card-migrate-smartlinkiframe-analytics": {
|
|
178
178
|
"type": "boolean"
|
|
179
|
+
},
|
|
180
|
+
"smart-card-migrate-track-analytics": {
|
|
181
|
+
"type": "boolean"
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
}
|