@atlaskit/smart-card 23.7.3 → 23.8.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/constants.js +14 -2
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -1
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +41 -13
- package/dist/cjs/utils/analytics/analytics.js +128 -96
- package/dist/cjs/utils/analytics/index.js +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/cjs/view/BlockCard/index.js +4 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -3
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +17 -4
- package/dist/cjs/view/CardWithUrl/component.js +3 -1
- package/dist/cjs/view/EmbedCard/index.js +6 -2
- package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +21 -4
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +4 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +11 -10
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +6 -4
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +26 -7
- package/dist/cjs/view/HoverCard/index.js +6 -3
- package/dist/cjs/view/HoverCard/utils.js +1 -4
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/cjs/view/InlineCard/index.js +2 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +14 -3
- package/dist/es2019/constants.js +12 -1
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +33 -8
- package/dist/es2019/utils/analytics/analytics.js +28 -4
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/es2019/view/BlockCard/index.js +4 -2
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -3
- package/dist/es2019/view/CardWithUrl/component.js +2 -1
- package/dist/es2019/view/EmbedCard/index.js +6 -2
- package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +14 -3
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +3 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +11 -10
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +8 -6
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -3
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +23 -7
- package/dist/es2019/view/HoverCard/index.js +6 -3
- package/dist/es2019/view/HoverCard/utils.js +0 -1
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/es2019/view/InlineCard/index.js +2 -1
- package/dist/es2019/view/common/UnauthorisedViewContent.js +18 -11
- package/dist/esm/constants.js +12 -1
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +42 -14
- package/dist/esm/utils/analytics/analytics.js +118 -92
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +1 -1
- package/dist/esm/view/BlockCard/index.js +4 -2
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +18 -5
- package/dist/esm/view/CardWithUrl/component.js +2 -1
- package/dist/esm/view/EmbedCard/index.js +6 -2
- package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +15 -4
- package/dist/esm/view/EmbedModal/components/analytics/index.js +3 -2
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +11 -10
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +8 -6
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -3
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +27 -9
- package/dist/esm/view/HoverCard/index.js +6 -3
- package/dist/esm/view/HoverCard/utils.js +0 -1
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +2 -1
- package/dist/esm/view/InlineCard/index.js +2 -1
- package/dist/esm/view/common/UnauthorisedViewContent.js +8 -3
- package/dist/types/constants.d.ts +8 -0
- package/dist/types/state/actions/index.d.ts +1 -2
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +17 -4
- package/dist/types/state/flexible-ui-context/index.d.ts +8 -4
- package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types/utils/analytics/analytics.d.ts +4 -2
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +2 -0
- package/dist/types/utils/mocks.d.ts +4 -2
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +1 -1
- package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
- package/dist/types/view/BlockCard/views/flexible/types.d.ts +17 -13
- package/dist/types/view/Card/types.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +3 -0
- package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +15 -4
- package/dist/types/view/HoverCard/types.d.ts +0 -2
- package/dist/types/view/HoverCard/utils.d.ts +0 -1
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +7 -1
- package/package.json +5 -5
- package/report.api.md +15 -1
- package/tmp/api-report-tmp.d.ts +8 -4
|
@@ -35,6 +35,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
35
35
|
inheritDimensions = _ref.inheritDimensions;
|
|
36
36
|
var data = details && details.data || getEmptyJsonLd();
|
|
37
37
|
var meta = details && details.meta;
|
|
38
|
+
var extensionKey = getExtensionKey(details);
|
|
38
39
|
|
|
39
40
|
switch (status) {
|
|
40
41
|
case 'pending':
|
|
@@ -80,7 +81,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
80
81
|
analytics: analytics,
|
|
81
82
|
origin: 'smartLinkEmbed',
|
|
82
83
|
handleInvoke: handleInvoke,
|
|
83
|
-
extensionKey:
|
|
84
|
+
extensionKey: extensionKey
|
|
84
85
|
});
|
|
85
86
|
return /*#__PURE__*/React.createElement(BlockCardResolvedView, _extends({}, resolvedBlockViewProps, {
|
|
86
87
|
isSelected: isSelected,
|
|
@@ -103,7 +104,10 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
103
104
|
isSelected: isSelected,
|
|
104
105
|
onAuthorise: handleAuthorize,
|
|
105
106
|
inheritDimensions: inheritDimensions,
|
|
106
|
-
onClick: handleFrameClick
|
|
107
|
+
onClick: handleFrameClick,
|
|
108
|
+
analytics: analytics,
|
|
109
|
+
extensionKey: extensionKey,
|
|
110
|
+
testId: testId
|
|
107
111
|
}));
|
|
108
112
|
|
|
109
113
|
case 'forbidden':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import { EmbedCardUnresolvedView } from './UnresolvedView';
|
|
3
3
|
import { UnauthorisedImage } from '../constants';
|
|
4
4
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
@@ -7,17 +7,27 @@ import UnauthorisedViewContent from '../../common/UnauthorisedViewContent';
|
|
|
7
7
|
export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref) {
|
|
8
8
|
var _context$image;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var analytics = _ref.analytics,
|
|
11
|
+
link = _ref.link,
|
|
11
12
|
context = _ref.context,
|
|
12
13
|
isSelected = _ref.isSelected,
|
|
13
14
|
_ref$testId = _ref.testId,
|
|
14
15
|
testId = _ref$testId === void 0 ? 'embed-card-unauthorized-view' : _ref$testId,
|
|
15
16
|
onAuthorise = _ref.onAuthorise,
|
|
16
17
|
inheritDimensions = _ref.inheritDimensions,
|
|
17
|
-
onClick = _ref.onClick
|
|
18
|
+
onClick = _ref.onClick,
|
|
19
|
+
extensionKey = _ref.extensionKey;
|
|
18
20
|
var icon = context && context.icon && /*#__PURE__*/React.createElement(ImageIcon, {
|
|
19
21
|
src: typeof context.icon === 'string' ? context.icon : undefined
|
|
20
22
|
});
|
|
23
|
+
var handleOnAuthorizeClick = useCallback(function () {
|
|
24
|
+
if (onAuthorise) {
|
|
25
|
+
analytics.track.appAccountAuthStarted({
|
|
26
|
+
extensionKey: extensionKey
|
|
27
|
+
});
|
|
28
|
+
onAuthorise();
|
|
29
|
+
}
|
|
30
|
+
}, [onAuthorise, analytics.track, extensionKey]);
|
|
21
31
|
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
22
32
|
href: link,
|
|
23
33
|
icon: icon,
|
|
@@ -38,9 +48,10 @@ export var EmbedCardUnauthorisedView = function EmbedCardUnauthorisedView(_ref)
|
|
|
38
48
|
text: 'connect_unauthorised_account_action',
|
|
39
49
|
testId: 'connect-account'
|
|
40
50
|
},
|
|
41
|
-
onClick:
|
|
51
|
+
onClick: handleOnAuthorizeClick,
|
|
42
52
|
testId: testId
|
|
43
53
|
}, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
54
|
+
analytics: analytics,
|
|
44
55
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
45
56
|
testId: testId
|
|
46
57
|
})));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { EmbedModalSize } from '../../types';
|
|
4
|
+
import { CardDisplay } from '../../../../constants';
|
|
4
5
|
|
|
5
6
|
var getResizeFrom = function getResizeFrom(size) {
|
|
6
7
|
return size === EmbedModalSize.Small ? EmbedModalSize.Large : EmbedModalSize.Small;
|
|
@@ -24,7 +25,7 @@ var withAnalytics = function withAnalytics(Component) {
|
|
|
24
25
|
});
|
|
25
26
|
analytics.ui.renderSuccessEvent({
|
|
26
27
|
status: 'resolved',
|
|
27
|
-
display:
|
|
28
|
+
display: CardDisplay.EmbedPreview
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
if (onOpen) {
|
|
@@ -33,7 +34,7 @@ var withAnalytics = function withAnalytics(Component) {
|
|
|
33
34
|
}, [analytics.screen, analytics.ui, onOpen, origin]);
|
|
34
35
|
var handleOnOpenFailed = useCallback(function (error, errorInfo) {
|
|
35
36
|
analytics.ui.renderFailedEvent({
|
|
36
|
-
display:
|
|
37
|
+
display: CardDisplay.EmbedPreview,
|
|
37
38
|
error: error,
|
|
38
39
|
errorInfo: errorInfo
|
|
39
40
|
});
|
|
@@ -10,14 +10,13 @@ import { useSmartLinkRenderers } from '../../../state/renderers';
|
|
|
10
10
|
import { useSmartCardState as useLinkState } from '../../../state/store';
|
|
11
11
|
import HoverCardContent from '../components/HoverCardContent';
|
|
12
12
|
import { HoverCardContainer, CARD_GAP_PX } from '../styled';
|
|
13
|
-
import {
|
|
13
|
+
import { CardDisplay } from '../../../constants';
|
|
14
14
|
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
15
15
|
export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
16
16
|
var children = _ref.children,
|
|
17
17
|
url = _ref.url,
|
|
18
18
|
analyticsHandler = _ref.analyticsHandler,
|
|
19
|
-
analytics = _ref.analytics
|
|
20
|
-
onAuthorize = _ref.onAuthorize;
|
|
19
|
+
analytics = _ref.analytics;
|
|
21
20
|
var delay = 300;
|
|
22
21
|
|
|
23
22
|
var _React$useState = React.useState(false),
|
|
@@ -33,6 +32,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
33
32
|
var parentSpan = useRef(null);
|
|
34
33
|
var renderers = useSmartLinkRenderers();
|
|
35
34
|
var linkState = useLinkState(url);
|
|
35
|
+
var linkStatus = linkState.status;
|
|
36
36
|
var hoverDisplay = 'card';
|
|
37
37
|
var invokeMethod = 'mouse_hover';
|
|
38
38
|
var setMousePosition = useCallback(function (event) {
|
|
@@ -52,12 +52,13 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
52
52
|
analytics.ui.hoverCardDismissedEvent({
|
|
53
53
|
previewDisplay: 'card',
|
|
54
54
|
hoverTime: hoverTime,
|
|
55
|
-
previewInvokeMethod: 'mouse_hover'
|
|
55
|
+
previewInvokeMethod: 'mouse_hover',
|
|
56
|
+
status: linkStatus
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
setIsOpen(false);
|
|
60
|
-
}, [analytics.ui, isOpen]);
|
|
61
|
+
}, [analytics.ui, isOpen, linkStatus]);
|
|
61
62
|
var initHideCard = useCallback(function () {
|
|
62
63
|
if (fadeInTimeoutId.current) {
|
|
63
64
|
clearTimeout(fadeInTimeoutId.current);
|
|
@@ -80,7 +81,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
80
81
|
cardOpenTime.current = Date.now();
|
|
81
82
|
analytics.ui.hoverCardViewedEvent({
|
|
82
83
|
previewDisplay: hoverDisplay,
|
|
83
|
-
previewInvokeMethod: invokeMethod
|
|
84
|
+
previewInvokeMethod: invokeMethod,
|
|
85
|
+
status: linkStatus
|
|
84
86
|
});
|
|
85
87
|
} //If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
86
88
|
|
|
@@ -95,10 +97,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
95
97
|
|
|
96
98
|
setIsOpen(true);
|
|
97
99
|
}, delay);
|
|
98
|
-
}, [isOpen, setMousePosition, analytics.ui]);
|
|
100
|
+
}, [isOpen, setMousePosition, analytics.ui, linkStatus]);
|
|
99
101
|
var linkActions = useSmartLinkActions({
|
|
100
102
|
url: url,
|
|
101
|
-
appearance:
|
|
103
|
+
appearance: CardDisplay.HoverCardPreview,
|
|
102
104
|
analyticsHandler: analyticsHandler,
|
|
103
105
|
origin: 'smartLinkPreviewHoverCard'
|
|
104
106
|
});
|
|
@@ -134,8 +136,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
134
136
|
onActionClick: onActionClick,
|
|
135
137
|
onResolve: update,
|
|
136
138
|
renderers: renderers,
|
|
137
|
-
url: url
|
|
138
|
-
onAuthorize: onAuthorize
|
|
139
|
+
url: url
|
|
139
140
|
}));
|
|
140
141
|
},
|
|
141
142
|
trigger: function trigger(triggerProps) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
2
2
|
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
3
3
|
import React, { useCallback, useMemo } from 'react';
|
|
4
|
-
import { ActionName, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
4
|
+
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
5
5
|
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
6
6
|
import { getExtensionKey } from '../../../state/helpers';
|
|
7
7
|
import { isSpecialEvent } from '../../../utils';
|
|
8
8
|
import { flexibleUiOptions, titleBlockCss } from '../styled';
|
|
9
|
-
import { getSimulatedMetadata
|
|
9
|
+
import { getSimulatedMetadata } from '../utils';
|
|
10
10
|
import HoverCardLoadingView from './views/resolving';
|
|
11
11
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
12
12
|
import HoverCardResolvedView from './views/resolved';
|
|
@@ -47,8 +47,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
47
47
|
onActionClick = _ref.onActionClick,
|
|
48
48
|
onResolve = _ref.onResolve,
|
|
49
49
|
renderers = _ref.renderers,
|
|
50
|
-
url = _ref.url
|
|
51
|
-
onAuthorize = _ref.onAuthorize;
|
|
50
|
+
url = _ref.url;
|
|
52
51
|
var extensionKey = useMemo(function () {
|
|
53
52
|
return getExtensionKey(cardState.details);
|
|
54
53
|
}, [cardState.details]);
|
|
@@ -56,7 +55,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
56
55
|
var isModifierKeyPressed = isSpecialEvent(event);
|
|
57
56
|
analytics.ui.cardClickedEvent({
|
|
58
57
|
id: id,
|
|
59
|
-
display:
|
|
58
|
+
display: CardDisplay.HoverCardPreview,
|
|
60
59
|
status: cardState.status,
|
|
61
60
|
isModifierKeyPressed: isModifierKeyPressed,
|
|
62
61
|
actionSubjectId: 'titleGoToLink'
|
|
@@ -99,8 +98,11 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
99
98
|
|
|
100
99
|
if (cardState.status === 'unauthorized') {
|
|
101
100
|
return /*#__PURE__*/React.createElement(HoverCardUnauthorisedView, {
|
|
101
|
+
analytics: analytics,
|
|
102
|
+
extensionKey: extensionKey,
|
|
103
|
+
id: id,
|
|
102
104
|
flexibleCardProps: flexibleCardProps,
|
|
103
|
-
|
|
105
|
+
url: url
|
|
104
106
|
});
|
|
105
107
|
} // if metadataStatus is 'errored' simply render using data available (normal path)
|
|
106
108
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
3
3
|
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
4
|
-
import { ActionName, SmartLinkSize } from '../../../../../constants';
|
|
4
|
+
import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
|
|
5
5
|
import { FooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
6
6
|
import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
|
|
7
7
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
8
8
|
import { useSmartCardActions } from '../../../../../state/actions';
|
|
9
|
-
import { getSimulatedMetadata, toActionableMetadata
|
|
9
|
+
import { getSimulatedMetadata, toActionableMetadata } from '../../../utils';
|
|
10
10
|
import SnippetOrPreview from '../../SnippetOrPreview';
|
|
11
11
|
import { extractMetadata } from '../../../../../extractors/hover/extractMetadata';
|
|
12
12
|
export var toFooterActions = function toFooterActions(cardActions, onActionClick) {
|
|
@@ -49,7 +49,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
49
49
|
// Since this hover view is only rendered on resolved status,
|
|
50
50
|
// there is no need to check for statuses.
|
|
51
51
|
analytics.ui.renderSuccessEvent({
|
|
52
|
-
display:
|
|
52
|
+
display: CardDisplay.HoverCardPreview,
|
|
53
53
|
status: cardState.status
|
|
54
54
|
});
|
|
55
55
|
}, [analytics.ui, cardState.status]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
5
5
|
import { messages } from '../../../../../messages';
|
|
@@ -9,29 +9,46 @@ import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled'
|
|
|
9
9
|
import UnauthorisedViewContent from '../../../../common/UnauthorisedViewContent';
|
|
10
10
|
import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group';
|
|
11
11
|
import { LinkIcon } from '../../../../FlexibleCard/components/elements';
|
|
12
|
-
import { ActionName } from '../../../../../constants';
|
|
12
|
+
import { ActionName, CardDisplay } from '../../../../../constants';
|
|
13
|
+
import { useSmartCardActions } from '../../../../../state/actions';
|
|
13
14
|
|
|
14
15
|
var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
15
16
|
var _cardState$details, _extractProvider;
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
+
var analytics = _ref.analytics,
|
|
19
|
+
extensionKey = _ref.extensionKey,
|
|
20
|
+
_ref$id = _ref.id,
|
|
21
|
+
id = _ref$id === void 0 ? '' : _ref$id,
|
|
22
|
+
flexibleCardProps = _ref.flexibleCardProps,
|
|
18
23
|
_ref$testId = _ref.testId,
|
|
19
24
|
testId = _ref$testId === void 0 ? 'hover-card-unauthorised-view' : _ref$testId,
|
|
20
|
-
|
|
25
|
+
url = _ref.url;
|
|
21
26
|
var cardState = flexibleCardProps.cardState;
|
|
22
27
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
23
28
|
var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
29
|
+
|
|
30
|
+
var _useSmartCardActions = useSmartCardActions(id, url, analytics),
|
|
31
|
+
authorize = _useSmartCardActions.authorize;
|
|
32
|
+
|
|
33
|
+
var handleAuthorize = useCallback(function () {
|
|
34
|
+
if (authorize) {
|
|
35
|
+
analytics.track.appAccountAuthStarted({
|
|
36
|
+
extensionKey: extensionKey
|
|
37
|
+
});
|
|
38
|
+
authorize(CardDisplay.HoverCardPreview);
|
|
39
|
+
}
|
|
40
|
+
}, [authorize, extensionKey, analytics.track]);
|
|
24
41
|
var actions = useMemo(function () {
|
|
25
|
-
return
|
|
42
|
+
return [{
|
|
26
43
|
name: ActionName.CustomAction,
|
|
27
44
|
content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
|
|
28
45
|
values: {
|
|
29
46
|
context: providerName
|
|
30
47
|
}
|
|
31
48
|
})),
|
|
32
|
-
onClick:
|
|
33
|
-
}]
|
|
34
|
-
}, [
|
|
49
|
+
onClick: handleAuthorize
|
|
50
|
+
}];
|
|
51
|
+
}, [handleAuthorize, providerName]);
|
|
35
52
|
return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
|
|
36
53
|
testId: testId
|
|
37
54
|
}), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
@@ -45,7 +62,8 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
45
62
|
overrideCss: mainTextStyles,
|
|
46
63
|
testId: "".concat(testId, "-content")
|
|
47
64
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
48
|
-
providerName: providerName
|
|
65
|
+
providerName: providerName,
|
|
66
|
+
analytics: analytics
|
|
49
67
|
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
50
68
|
overrideCss: connectButtonStyles,
|
|
51
69
|
testId: "".concat(testId, "-button")
|
|
@@ -8,7 +8,7 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
8
8
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
9
9
|
import { fireSmartLinkEvent } from '../../utils/analytics';
|
|
10
10
|
import { HoverCardComponent } from './components/HoverCardComponent';
|
|
11
|
-
import {
|
|
11
|
+
import { CardDisplay } from '../../constants';
|
|
12
12
|
|
|
13
13
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
14
14
|
var url = props.url,
|
|
@@ -21,7 +21,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
21
21
|
var analytics = useSmartLinkAnalytics(url, analyticsHandler, id);
|
|
22
22
|
var onError = useCallback(function (error, info) {
|
|
23
23
|
analytics.ui.renderFailedEvent({
|
|
24
|
-
display:
|
|
24
|
+
display: CardDisplay.HoverCardPreview,
|
|
25
25
|
id: id,
|
|
26
26
|
error: error,
|
|
27
27
|
errorInfo: info
|
|
@@ -37,5 +37,8 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export var HoverCard = withAnalyticsContext({
|
|
40
|
-
source: 'smartLinkPreviewHoverCard'
|
|
40
|
+
source: 'smartLinkPreviewHoverCard',
|
|
41
|
+
attributes: {
|
|
42
|
+
display: CardDisplay.HoverCardPreview
|
|
43
|
+
}
|
|
41
44
|
})(withAnalyticsEvents()(HoverCardWithErrorBoundary));
|
|
@@ -5,7 +5,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { ElementName } from '../../constants';
|
|
8
|
-
export var SMART_CARD_ANALYTICS_DISPLAY = 'flexible';
|
|
9
8
|
export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
10
9
|
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
11
10
|
var types = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -98,7 +98,8 @@ export var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component)
|
|
|
98
98
|
if (showAuthTooltip) {
|
|
99
99
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
100
100
|
url: url,
|
|
101
|
-
onAuthorize: this.props.onAuthorise
|
|
101
|
+
onAuthorize: this.props.onAuthorise,
|
|
102
|
+
id: this.props.id
|
|
102
103
|
}, inlineCardUnauthenticatedView);
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import { messages } from '../../messages';
|
|
5
5
|
import { CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
|
|
@@ -11,7 +11,11 @@ import { CONTENT_URL_SECURITY_AND_PERMISSIONS } from '../../constants';
|
|
|
11
11
|
var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
12
12
|
var providerName = _ref.providerName,
|
|
13
13
|
_ref$testId = _ref.testId,
|
|
14
|
-
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId
|
|
14
|
+
testId = _ref$testId === void 0 ? 'unauthorised-view-content' : _ref$testId,
|
|
15
|
+
analytics = _ref.analytics;
|
|
16
|
+
var handleLearnMoreClick = useCallback(function () {
|
|
17
|
+
analytics === null || analytics === void 0 ? void 0 : analytics.ui.learnMoreClickedEvent();
|
|
18
|
+
}, [analytics === null || analytics === void 0 ? void 0 : analytics.ui]);
|
|
15
19
|
return /*#__PURE__*/React.createElement(React.Fragment, null, providerName ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_description, {
|
|
16
20
|
values: {
|
|
17
21
|
context: providerName
|
|
@@ -19,7 +23,8 @@ var UnauthorisedViewContent = function UnauthorisedViewContent(_ref) {
|
|
|
19
23
|
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.connect_unauthorised_account_description_no_provider), ' ', /*#__PURE__*/React.createElement("a", {
|
|
20
24
|
href: CONTENT_URL_SECURITY_AND_PERMISSIONS,
|
|
21
25
|
target: "_blank",
|
|
22
|
-
"data-testid": "".concat(testId, "-learn-more")
|
|
26
|
+
"data-testid": "".concat(testId, "-learn-more"),
|
|
27
|
+
onClick: handleLearnMoreClick
|
|
23
28
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.learn_more_about_smart_links)));
|
|
24
29
|
};
|
|
25
30
|
|
|
@@ -195,3 +195,11 @@ export declare enum MediaPlacement {
|
|
|
195
195
|
Left = "left",
|
|
196
196
|
Right = "right"
|
|
197
197
|
}
|
|
198
|
+
export declare enum CardDisplay {
|
|
199
|
+
Inline = "inline",
|
|
200
|
+
Block = "block",
|
|
201
|
+
Embed = "embed",
|
|
202
|
+
EmbedPreview = "embedPreview",
|
|
203
|
+
Flexible = "flexible",
|
|
204
|
+
HoverCardPreview = "hoverCardPreview"
|
|
205
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
-
import { CardAppearance } from '../../view/Card';
|
|
3
2
|
import { InvokeServerOpts, InvokeClientOpts } from '../../model/invoke-opts';
|
|
4
3
|
import { AnalyticsFacade } from '../analytics';
|
|
5
4
|
import { CardInnerAppearance } from '../../view/Card/types';
|
|
6
5
|
export declare const useSmartCardActions: (id: string, url: string, analytics: AnalyticsFacade) => {
|
|
7
6
|
register: () => Promise<void>;
|
|
8
7
|
reload: () => void;
|
|
9
|
-
authorize: (appearance:
|
|
8
|
+
authorize: (appearance: CardInnerAppearance) => void;
|
|
10
9
|
invoke: (opts: InvokeClientOpts | InvokeServerOpts, appearance: CardInnerAppearance) => Promise<JsonLd.Response | void>;
|
|
11
10
|
loadMetadata: () => Promise<void> | undefined;
|
|
12
11
|
};
|
|
@@ -110,17 +110,23 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
|
|
|
110
110
|
* @param previewInvokeMethod How the preview was triggered.
|
|
111
111
|
* @returns
|
|
112
112
|
*/
|
|
113
|
-
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiHoverCardViewedEventProps) => void;
|
|
113
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: UiHoverCardViewedEventProps) => void;
|
|
114
114
|
/**
|
|
115
115
|
* This fires an event that represents a hover preview being dismissed.
|
|
116
116
|
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|
|
117
117
|
* @param hoverTime The duration that the user hovered over a Smart Link before the preview was dismissed.
|
|
118
118
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
119
|
-
* @param extensionKey The extensionKey of the Smart Link
|
|
119
|
+
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
120
120
|
* @param previewInvokeMethod How the preview was triggered.
|
|
121
121
|
* @returns
|
|
122
122
|
*/
|
|
123
|
-
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiHoverCardDismissedEventProps) => void;
|
|
123
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: UiHoverCardDismissedEventProps) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card
|
|
126
|
+
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
127
|
+
* @param location The location where a link is displayed (jiraWebLinks, confluencePages etc)
|
|
128
|
+
*/
|
|
129
|
+
learnMoreClickedEvent: () => void;
|
|
124
130
|
};
|
|
125
131
|
operational: {
|
|
126
132
|
/**
|
|
@@ -168,12 +174,19 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
|
|
|
168
174
|
};
|
|
169
175
|
track: {
|
|
170
176
|
/**
|
|
171
|
-
* This fires an event which represents a user
|
|
177
|
+
* This fires an event which represents a user connecting their account to view a Smart Link.
|
|
172
178
|
* @param definitionId The definitionId of the Smart Link resolver invoked.
|
|
173
179
|
* @param extensionKey The extensionKey of the Smart Link resovler invoked.
|
|
174
180
|
* @returns
|
|
175
181
|
*/
|
|
176
182
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => void;
|
|
183
|
+
/**
|
|
184
|
+
* This fires an event which represents a user starting the Smart Link connect account process.
|
|
185
|
+
* @param location a location where the Smart Link auth action was initiated.
|
|
186
|
+
* @param extensionKey The extensionKey of the Smart Link resolver invoked.
|
|
187
|
+
* @returns
|
|
188
|
+
*/
|
|
189
|
+
appAccountAuthStarted: ({ extensionKey, location, }: TrackAppAccountConnectedProps) => void;
|
|
177
190
|
};
|
|
178
191
|
screen: {
|
|
179
192
|
/**
|
|
@@ -26,8 +26,9 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
|
|
|
26
26
|
}) => void;
|
|
27
27
|
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
|
|
28
28
|
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderFailedEventProps) => void;
|
|
29
|
-
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
30
|
-
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
29
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
30
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
31
|
+
learnMoreClickedEvent: () => void;
|
|
31
32
|
};
|
|
32
33
|
operational: {
|
|
33
34
|
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
|
|
@@ -38,6 +39,7 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
|
|
|
38
39
|
};
|
|
39
40
|
track: {
|
|
40
41
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
42
|
+
appAccountAuthStarted: ({ extensionKey, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
41
43
|
};
|
|
42
44
|
screen: {
|
|
43
45
|
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
@@ -62,8 +64,9 @@ export declare const useFlexibleUiAnalyticsContext: () => {
|
|
|
62
64
|
}) => void;
|
|
63
65
|
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
|
|
64
66
|
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderFailedEventProps) => void;
|
|
65
|
-
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
66
|
-
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
67
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
68
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
69
|
+
learnMoreClickedEvent: () => void;
|
|
67
70
|
};
|
|
68
71
|
operational: {
|
|
69
72
|
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
|
|
@@ -74,6 +77,7 @@ export declare const useFlexibleUiAnalyticsContext: () => {
|
|
|
74
77
|
};
|
|
75
78
|
track: {
|
|
76
79
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
80
|
+
appAccountAuthStarted: ({ extensionKey, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
77
81
|
};
|
|
78
82
|
screen: {
|
|
79
83
|
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
@@ -4,7 +4,7 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
|
|
|
4
4
|
actions: {
|
|
5
5
|
register: () => Promise<void>;
|
|
6
6
|
reload: () => void;
|
|
7
|
-
authorize: (appearance: import("
|
|
7
|
+
authorize: (appearance: import("../../view/Card/types").CardInnerAppearance) => void;
|
|
8
8
|
invoke: (opts: import("../../model/invoke-opts").InvokeClientOpts | import("../../model/invoke-opts").InvokeServerOpts, appearance: import("../../view/Card/types").CardInnerAppearance) => Promise<void | import("json-ld-types").JsonLd.Response<import("json-ld-types").JsonLd.Data.BaseData>>;
|
|
9
9
|
loadMetadata: () => Promise<void> | undefined;
|
|
10
10
|
};
|
|
@@ -25,8 +25,9 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
|
|
|
25
25
|
}) => void;
|
|
26
26
|
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
|
|
27
27
|
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderFailedEventProps) => void;
|
|
28
|
-
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
29
|
-
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
28
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
29
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
30
|
+
learnMoreClickedEvent: () => void;
|
|
30
31
|
};
|
|
31
32
|
operational: {
|
|
32
33
|
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
|
|
@@ -37,6 +38,7 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
|
|
|
37
38
|
};
|
|
38
39
|
track: {
|
|
39
40
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
41
|
+
appAccountAuthStarted: ({ extensionKey, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
40
42
|
};
|
|
41
43
|
screen: {
|
|
42
44
|
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
@@ -19,6 +19,7 @@ export declare const invokeFailedEvent: ({ id, actionType, display, reason, exte
|
|
|
19
19
|
export declare const connectSucceededEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => AnalyticsPayload;
|
|
20
20
|
export declare const connectFailedEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, reason, }: ConnectFailedEventProps) => AnalyticsPayload;
|
|
21
21
|
export declare const trackAppAccountConnected: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
|
|
22
|
+
export declare const trackAppAccountAuthStarted: ({ extensionKey, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
|
|
22
23
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
23
24
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
24
25
|
export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
|
|
@@ -27,6 +28,7 @@ export declare const uiClosedAuthEvent: ({ display, extensionKey, definitionId,
|
|
|
27
28
|
export declare const screenAuthPopupEvent: ({ extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => AnalyticsPayload;
|
|
28
29
|
export declare const uiRenderSuccessEvent: ({ display, status, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderSuccessEventProps) => AnalyticsPayload;
|
|
29
30
|
export declare const uiRenderFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => AnalyticsPayload;
|
|
30
|
-
export declare const uiHoverCardViewedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardViewedEventProps) => AnalyticsPayload;
|
|
31
|
-
export declare const uiHoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardDismissedEventProps) => AnalyticsPayload;
|
|
31
|
+
export declare const uiHoverCardViewedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, status, }: UiHoverCardViewedEventProps) => AnalyticsPayload;
|
|
32
|
+
export declare const uiHoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, status, }: UiHoverCardDismissedEventProps) => AnalyticsPayload;
|
|
32
33
|
export declare const uiHoverCardOpenLinkClickedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => AnalyticsPayload;
|
|
34
|
+
export declare const uiLearnMoreLinkClickedEvent: () => AnalyticsPayload;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AnalyticsPayload } from '../types';
|
|
2
2
|
import { InstrumentEventProps } from './types';
|
|
3
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, } from './analytics';
|
|
3
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountAuthStarted, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, uiLearnMoreLinkClickedEvent, } from './analytics';
|
|
4
4
|
export declare const instrumentEvent: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => AnalyticsPayload | undefined;
|
|
@@ -76,11 +76,13 @@ export declare type UiRenderFailedEventProps = CommonEventProps & {
|
|
|
76
76
|
export declare type UiHoverCardViewedEventProps = CommonEventProps & {
|
|
77
77
|
previewDisplay: PreviewDisplay;
|
|
78
78
|
previewInvokeMethod?: PreviewInvokeMethod;
|
|
79
|
+
status: CardType;
|
|
79
80
|
};
|
|
80
81
|
export declare type UiHoverCardDismissedEventProps = CommonEventProps & {
|
|
81
82
|
previewDisplay: PreviewDisplay;
|
|
82
83
|
hoverTime: number;
|
|
83
84
|
previewInvokeMethod?: PreviewInvokeMethod;
|
|
85
|
+
status: CardType;
|
|
84
86
|
};
|
|
85
87
|
export declare type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
|
|
86
88
|
previewDisplay: PreviewDisplay;
|
|
@@ -53,8 +53,9 @@ export declare const mockAnalytics: {
|
|
|
53
53
|
}) => void;
|
|
54
54
|
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderSuccessEventProps) => void;
|
|
55
55
|
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderFailedEventProps) => void;
|
|
56
|
-
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiHoverCardViewedEventProps) => void;
|
|
57
|
-
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
56
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("./analytics/types").UiHoverCardViewedEventProps) => void;
|
|
57
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("./analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
58
|
+
learnMoreClickedEvent: () => void;
|
|
58
59
|
};
|
|
59
60
|
operational: {
|
|
60
61
|
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
|
|
@@ -65,6 +66,7 @@ export declare const mockAnalytics: {
|
|
|
65
66
|
};
|
|
66
67
|
track: {
|
|
67
68
|
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
|
|
69
|
+
appAccountAuthStarted: ({ extensionKey, location, }: import("./analytics/types").CommonEventProps) => void;
|
|
68
70
|
};
|
|
69
71
|
screen: {
|
|
70
72
|
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
|