@atlaskit/smart-card 33.2.0 → 33.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/state/actions/index.js +2 -4
- package/dist/cjs/state/analytics/index.js +1 -8
- package/dist/cjs/state/flexible-ui-context/index.js +1 -10
- package/dist/cjs/state/hooks/useSmartLink.js +1 -4
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +1 -3
- package/dist/cjs/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/cjs/state/index.js +1 -8
- package/dist/cjs/utils/analytics/analytics.js +2 -144
- package/dist/cjs/utils/analytics/index.js +0 -30
- package/dist/cjs/utils/analytics/types.js +1 -5
- package/dist/cjs/utils/mocks.js +1 -23
- package/dist/cjs/view/BlockCard/index.js +1 -3
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +1 -3
- package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +2 -4
- package/dist/cjs/view/CardWithUrl/component.js +1 -8
- package/dist/cjs/view/EmbedCard/index.js +0 -4
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +3 -5
- package/dist/cjs/view/EmbedModal/index.js +1 -3
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/components/actions/download-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/index.js +3 -17
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -5
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +3 -5
- package/dist/cjs/view/InlineCard/index.js +1 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/actions/index.js +2 -4
- package/dist/es2019/state/analytics/index.js +1 -2
- package/dist/es2019/state/flexible-ui-context/index.js +0 -7
- package/dist/es2019/state/hooks/useSmartLink.js +1 -4
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +1 -3
- package/dist/es2019/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/es2019/state/index.js +1 -2
- package/dist/es2019/utils/analytics/analytics.js +2 -145
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/utils/analytics/types.js +0 -1
- package/dist/es2019/utils/mocks.js +1 -23
- package/dist/es2019/view/BlockCard/index.js +1 -3
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +1 -3
- package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +1 -3
- package/dist/es2019/view/CardWithUrl/component.js +1 -8
- package/dist/es2019/view/EmbedCard/index.js +0 -4
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +1 -3
- package/dist/es2019/view/EmbedModal/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/components/actions/download-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/index.js +3 -15
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +9 -5
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +2 -4
- package/dist/es2019/view/InlineCard/index.js +0 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/actions/index.js +2 -4
- package/dist/esm/state/analytics/index.js +1 -2
- package/dist/esm/state/flexible-ui-context/index.js +0 -9
- package/dist/esm/state/hooks/useSmartLink.js +1 -4
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +1 -3
- package/dist/esm/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/esm/state/index.js +1 -2
- package/dist/esm/utils/analytics/analytics.js +1 -143
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/utils/analytics/types.js +0 -1
- package/dist/esm/utils/mocks.js +0 -22
- package/dist/esm/view/BlockCard/index.js +1 -3
- package/dist/esm/view/BlockCard/views/ResolvedView.js +1 -3
- package/dist/esm/view/BlockCard/views/UnauthorisedView.js +2 -4
- package/dist/esm/view/CardWithUrl/component.js +1 -8
- package/dist/esm/view/EmbedCard/index.js +0 -4
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +3 -5
- package/dist/esm/view/EmbedModal/index.js +1 -3
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/components/actions/download-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/index.js +4 -18
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +3 -5
- package/dist/esm/view/InlineCard/index.js +1 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/actions/types.d.ts +0 -2
- package/dist/types/state/actions/index.d.ts +1 -2
- package/dist/types/state/analytics/index.d.ts +0 -2
- package/dist/types/state/flexible-ui-context/index.d.ts +1 -7
- package/dist/types/state/flexible-ui-context/types.d.ts +0 -6
- package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +0 -6
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -7
- package/dist/types/state/index.d.ts +0 -1
- package/dist/types/utils/analytics/analytics.d.ts +0 -6
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +0 -42
- package/dist/types/utils/mocks.d.ts +0 -7
- package/dist/types/view/BlockCard/index.d.ts +1 -1
- package/dist/types/view/BlockCard/types.d.ts +0 -2
- package/dist/types/view/BlockCard/views/types.d.ts +1 -1
- package/dist/types/view/CardWithUrl/types.d.ts +0 -2
- package/dist/types/view/EmbedCard/types.d.ts +0 -2
- package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +0 -2
- package/dist/types/view/EmbedModal/components/analytics/types.d.ts +0 -2
- package/dist/types/view/FlexibleCard/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +0 -6
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -2
- package/dist/types/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +0 -5
- package/dist/types/view/HoverCard/types.d.ts +15 -3
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +0 -3
- package/dist/types/view/InlineCard/index.d.ts +1 -1
- package/dist/types/view/InlineCard/types.d.ts +0 -2
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +0 -6
- package/dist/types-ts4.5/extractors/common/actions/types.d.ts +0 -2
- package/dist/types-ts4.5/state/actions/index.d.ts +1 -2
- package/dist/types-ts4.5/state/analytics/index.d.ts +0 -2
- package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +1 -7
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +0 -6
- package/dist/types-ts4.5/state/hooks/use-invoke-client-action/types.d.ts +0 -6
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -7
- package/dist/types-ts4.5/state/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +0 -6
- package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -42
- package/dist/types-ts4.5/utils/mocks.d.ts +0 -7
- package/dist/types-ts4.5/view/BlockCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/BlockCard/types.d.ts +0 -2
- package/dist/types-ts4.5/view/BlockCard/views/types.d.ts +1 -1
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/index.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +0 -6
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +0 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/types.d.ts +0 -5
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +15 -3
- package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +0 -3
- package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +0 -2
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +0 -6
- package/package.json +1 -1
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +0 -139
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +0 -126
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +0 -132
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +0 -33
- package/dist/types/utils/analytics/__mocks__/analytics.d.ts +0 -2
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +0 -33
- package/dist/types-ts4.5/utils/analytics/__mocks__/analytics.d.ts +0 -2
|
@@ -8,7 +8,6 @@ import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
|
8
8
|
import UnresolvedView from '../unresolved-view';
|
|
9
9
|
import { UnauthorizedSVG } from './unauthorized-svg';
|
|
10
10
|
const UnauthorizedView = ({
|
|
11
|
-
analytics,
|
|
12
11
|
context,
|
|
13
12
|
extensionKey,
|
|
14
13
|
isProductIntegrationSupported,
|
|
@@ -43,7 +42,6 @@ const UnauthorizedView = ({
|
|
|
43
42
|
values: values
|
|
44
43
|
})),
|
|
45
44
|
description: /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
46
|
-
analytics: analytics,
|
|
47
45
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
48
46
|
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
49
47
|
testId: testId
|
|
@@ -80,7 +78,7 @@ const UnauthorizedView = ({
|
|
|
80
78
|
title: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_name_no_provider),
|
|
81
79
|
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_description_no_provider)
|
|
82
80
|
};
|
|
83
|
-
}, [
|
|
81
|
+
}, [context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
84
82
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
|
|
85
83
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
86
84
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : /*#__PURE__*/React.createElement(UnauthorizedSVG, null),
|
|
@@ -15,7 +15,6 @@ import { EmbedModalSize } from './types';
|
|
|
15
15
|
const toSize = width => width === MAX_MODAL_SIZE ? EmbedModalSize.Large : EmbedModalSize.Small;
|
|
16
16
|
const toWidth = size => size === EmbedModalSize.Large ? MAX_MODAL_SIZE : MIN_MODAL_SIZE;
|
|
17
17
|
const EmbedModal = ({
|
|
18
|
-
analytics,
|
|
19
18
|
invokeDownloadAction,
|
|
20
19
|
fireEvent,
|
|
21
20
|
iframeName,
|
|
@@ -38,7 +37,6 @@ const EmbedModal = ({
|
|
|
38
37
|
const [width, setWidth] = useState(defaultWidth);
|
|
39
38
|
const openAt = useRef();
|
|
40
39
|
const invoke = useInvokeClientAction({
|
|
41
|
-
analytics,
|
|
42
40
|
fireEvent
|
|
43
41
|
});
|
|
44
42
|
const handleOnOpenComplete = useCallback(() => {
|
|
@@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
4
4
|
import LinkIcon from '@atlaskit/icon/core/migration/link';
|
|
5
5
|
import { ActionName } from '../../../../../constants';
|
|
6
6
|
import { messages } from '../../../../../messages';
|
|
7
|
-
import {
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
8
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
9
9
|
import Action from '../action';
|
|
10
10
|
const CopyLinkAction = ({
|
|
@@ -13,10 +13,7 @@ const CopyLinkAction = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
var _context$actions;
|
|
15
15
|
const context = useFlexibleUiContext();
|
|
16
|
-
const
|
|
17
|
-
const invoke = useInvokeClientAction({
|
|
18
|
-
analytics
|
|
19
|
-
});
|
|
16
|
+
const invoke = useInvokeClientAction({});
|
|
20
17
|
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
|
|
21
18
|
const [tooltipMessage, setTooltipMessage] = useState(messages.copy_url_to_clipboard);
|
|
22
19
|
const onClick = useCallback(() => {
|
|
@@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
4
4
|
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
5
5
|
import { ActionName } from '../../../../../constants';
|
|
6
6
|
import { messages } from '../../../../../messages';
|
|
7
|
-
import {
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
8
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
9
9
|
import Action from '../action';
|
|
10
10
|
const DownloadAction = ({
|
|
@@ -13,10 +13,7 @@ const DownloadAction = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
var _context$actions;
|
|
15
15
|
const context = useFlexibleUiContext();
|
|
16
|
-
const
|
|
17
|
-
const invoke = useInvokeClientAction({
|
|
18
|
-
analytics
|
|
19
|
-
});
|
|
16
|
+
const invoke = useInvokeClientAction({});
|
|
20
17
|
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.DownloadAction];
|
|
21
18
|
const onClick = useCallback(() => {
|
|
22
19
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
@@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
4
4
|
import MediaServicesActualSizeIcon from '@atlaskit/icon/core/migration/grow-diagonal--media-services-actual-size';
|
|
5
5
|
import { ActionName } from '../../../../../constants';
|
|
6
6
|
import { messages } from '../../../../../messages';
|
|
7
|
-
import {
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
8
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
9
9
|
import Action from '../action';
|
|
10
10
|
const PreviewAction = ({
|
|
@@ -13,10 +13,7 @@ const PreviewAction = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
var _context$actions;
|
|
15
15
|
const context = useFlexibleUiContext();
|
|
16
|
-
const
|
|
17
|
-
const invoke = useInvokeClientAction({
|
|
18
|
-
analytics
|
|
19
|
-
});
|
|
16
|
+
const invoke = useInvokeClientAction({});
|
|
20
17
|
const data = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.PreviewAction];
|
|
21
18
|
const onClick = useCallback(() => {
|
|
22
19
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
4
4
|
import { SmartLinkStatus } from '../../constants';
|
|
5
|
-
import {
|
|
5
|
+
import { FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
6
6
|
import { useAISummaryConfig } from '../../state/hooks/use-ai-summary-config';
|
|
7
7
|
import useResolve from '../../state/hooks/use-resolve';
|
|
8
8
|
import Container from './components/container';
|
|
@@ -15,7 +15,6 @@ import { getContextByStatus, getRetryOptions } from './utils';
|
|
|
15
15
|
* @see Container
|
|
16
16
|
*/
|
|
17
17
|
const FlexibleCard = ({
|
|
18
|
-
analytics,
|
|
19
18
|
appearance = 'flexible',
|
|
20
19
|
cardState,
|
|
21
20
|
children,
|
|
@@ -33,7 +32,6 @@ const FlexibleCard = ({
|
|
|
33
32
|
ui,
|
|
34
33
|
url
|
|
35
34
|
}) => {
|
|
36
|
-
var _details$meta2;
|
|
37
35
|
const aiSummaryConfig = useAISummaryConfig();
|
|
38
36
|
const resolve = useResolve();
|
|
39
37
|
const {
|
|
@@ -61,14 +59,6 @@ const FlexibleCard = ({
|
|
|
61
59
|
const {
|
|
62
60
|
title
|
|
63
61
|
} = context || {};
|
|
64
|
-
const analyticsContext = useMemo(() => {
|
|
65
|
-
var _details$meta;
|
|
66
|
-
return analytics ? {
|
|
67
|
-
...analytics,
|
|
68
|
-
display: appearance,
|
|
69
|
-
extensionKey: details === null || details === void 0 ? void 0 : (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.key
|
|
70
|
-
} : undefined;
|
|
71
|
-
}, [analytics, appearance, details === null || details === void 0 ? void 0 : (_details$meta2 = details.meta) === null || _details$meta2 === void 0 ? void 0 : _details$meta2.key]);
|
|
72
62
|
useEffect(() => {
|
|
73
63
|
switch (status) {
|
|
74
64
|
case SmartLinkStatus.Resolved:
|
|
@@ -93,9 +83,7 @@ const FlexibleCard = ({
|
|
|
93
83
|
break;
|
|
94
84
|
}
|
|
95
85
|
}, [onError, onResolve, status, title, url]);
|
|
96
|
-
return /*#__PURE__*/React.createElement(
|
|
97
|
-
value: analyticsContext
|
|
98
|
-
}, /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
|
|
86
|
+
return /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
|
|
99
87
|
value: ui
|
|
100
88
|
}, /*#__PURE__*/React.createElement(FlexibleUiContext.Provider, {
|
|
101
89
|
value: context
|
|
@@ -108,6 +96,6 @@ const FlexibleCard = ({
|
|
|
108
96
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
109
97
|
actionOptions: actionOptions,
|
|
110
98
|
status: status
|
|
111
|
-
}), children)))
|
|
99
|
+
}), children)));
|
|
112
100
|
};
|
|
113
101
|
export default FlexibleCard;
|
|
@@ -10,7 +10,6 @@ import { jsx } from '@emotion/react';
|
|
|
10
10
|
import Popup from '@atlaskit/popup';
|
|
11
11
|
import { ActionName, CardDisplay } from '../../../constants';
|
|
12
12
|
import { useSmartCardActions } from '../../../state/actions';
|
|
13
|
-
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
14
13
|
import { useSmartLinkRenderers } from '../../../state/renderers';
|
|
15
14
|
import { useSmartCardState as useLinkState } from '../../../state/store';
|
|
16
15
|
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
@@ -31,7 +30,10 @@ export const HoverCardComponent = ({
|
|
|
31
30
|
allowEventPropagation = false,
|
|
32
31
|
zIndex = HOVER_CARD_Z_INDEX,
|
|
33
32
|
noFadeDelay = false,
|
|
34
|
-
hoverPreviewOptions
|
|
33
|
+
hoverPreviewOptions,
|
|
34
|
+
role,
|
|
35
|
+
label,
|
|
36
|
+
titleId
|
|
35
37
|
}) => {
|
|
36
38
|
var _hoverPreviewOptions$;
|
|
37
39
|
const fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
@@ -44,10 +46,9 @@ export const HoverCardComponent = ({
|
|
|
44
46
|
const parentSpan = useRef(null);
|
|
45
47
|
const renderers = useSmartLinkRenderers();
|
|
46
48
|
const linkState = useLinkState(url);
|
|
47
|
-
const analytics = useSmartLinkAnalytics(url, id);
|
|
48
49
|
const {
|
|
49
50
|
loadMetadata
|
|
50
|
-
} = useSmartCardActions(id, url
|
|
51
|
+
} = useSmartCardActions(id, url);
|
|
51
52
|
const setMousePosition = useCallback(event => {
|
|
52
53
|
if (isOpen && canOpen) {
|
|
53
54
|
return;
|
|
@@ -206,7 +207,10 @@ export const HoverCardComponent = ({
|
|
|
206
207
|
autoFocus: false,
|
|
207
208
|
content: content,
|
|
208
209
|
trigger: trigger,
|
|
209
|
-
zIndex: zIndex
|
|
210
|
+
zIndex: zIndex,
|
|
211
|
+
role: role,
|
|
212
|
+
titleId: titleId,
|
|
213
|
+
label: label
|
|
210
214
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
211
215
|
,
|
|
212
216
|
popupComponent: CustomPopupContainer
|
|
@@ -10,7 +10,6 @@ import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytic
|
|
|
10
10
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
11
11
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
12
12
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
13
|
-
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
14
13
|
import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
15
14
|
import { useSmartCardState } from '../../../state/store';
|
|
16
15
|
import { isSpecialEvent } from '../../../utils';
|
|
@@ -26,7 +25,6 @@ import HoverCardUnauthorisedView from './views/unauthorised';
|
|
|
26
25
|
export const hoverCardClassName = 'smart-links-hover-preview';
|
|
27
26
|
const HoverCardContent = ({
|
|
28
27
|
id = '',
|
|
29
|
-
analytics: _analytics,
|
|
30
28
|
cardState,
|
|
31
29
|
onActionClick,
|
|
32
30
|
onResolve,
|
|
@@ -43,8 +41,6 @@ const HoverCardContent = ({
|
|
|
43
41
|
const {
|
|
44
42
|
fireEvent
|
|
45
43
|
} = useAnalyticsEvents();
|
|
46
|
-
const defaultAnalytics = useSmartLinkAnalytics(url, id);
|
|
47
|
-
const analytics = _analytics !== null && _analytics !== void 0 ? _analytics : defaultAnalytics;
|
|
48
44
|
const extensionKey = useMemo(() => getExtensionKey(cardState.details), [cardState.details]);
|
|
49
45
|
const linkState = useSmartCardState(url);
|
|
50
46
|
const linkStatus = (_linkState$status = linkState.status) !== null && _linkState$status !== void 0 ? _linkState$status : 'pending';
|
|
@@ -126,8 +122,7 @@ const HoverCardContent = ({
|
|
|
126
122
|
actionOptions,
|
|
127
123
|
ui: flexibleUiOptions,
|
|
128
124
|
url: url,
|
|
129
|
-
children: null
|
|
130
|
-
analytics
|
|
125
|
+
children: null
|
|
131
126
|
};
|
|
132
127
|
const onClickStopPropagation = useCallback(e => e.stopPropagation(), []);
|
|
133
128
|
const getCardView = cardState => {
|
|
@@ -139,7 +134,6 @@ const HoverCardContent = ({
|
|
|
139
134
|
}
|
|
140
135
|
if (cardState.status === 'unauthorized' && services !== null && services !== void 0 && services.length) {
|
|
141
136
|
return jsx(HoverCardUnauthorisedView, {
|
|
142
|
-
analytics: analytics,
|
|
143
137
|
extensionKey: extensionKey,
|
|
144
138
|
id: id,
|
|
145
139
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -153,7 +147,6 @@ const HoverCardContent = ({
|
|
|
153
147
|
}
|
|
154
148
|
if (cardState.status === 'resolved') {
|
|
155
149
|
return jsx(HoverCardResolvedView, {
|
|
156
|
-
analytics: analytics,
|
|
157
150
|
cardState: cardState,
|
|
158
151
|
extensionKey: extensionKey,
|
|
159
152
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -14,7 +14,6 @@ import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group
|
|
|
14
14
|
import { LinkIcon } from '../../../../FlexibleCard/components/elements';
|
|
15
15
|
import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled';
|
|
16
16
|
const HoverCardUnauthorisedView = ({
|
|
17
|
-
analytics,
|
|
18
17
|
id = '',
|
|
19
18
|
flexibleCardProps,
|
|
20
19
|
testId = 'hover-card-unauthorised-view',
|
|
@@ -29,7 +28,7 @@ const HoverCardUnauthorisedView = ({
|
|
|
29
28
|
const isProductIntegrationSupported = hasAuthScopeOverrides(cardState.details);
|
|
30
29
|
const {
|
|
31
30
|
authorize
|
|
32
|
-
} = useSmartCardActions(id, url
|
|
31
|
+
} = useSmartCardActions(id, url);
|
|
33
32
|
const {
|
|
34
33
|
fireEvent
|
|
35
34
|
} = useAnalyticsEvents();
|
|
@@ -62,8 +61,7 @@ const HoverCardUnauthorisedView = ({
|
|
|
62
61
|
testId: `${testId}-content`
|
|
63
62
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
64
63
|
providerName: providerName,
|
|
65
|
-
isProductIntegrationSupported: isProductIntegrationSupported
|
|
66
|
-
analytics: analytics
|
|
64
|
+
isProductIntegrationSupported: isProductIntegrationSupported
|
|
67
65
|
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
68
66
|
overrideCss: connectButtonStyles,
|
|
69
67
|
testId: `${testId}-button`
|
|
@@ -16,7 +16,6 @@ import { InlineCardResolvingView } from './ResolvingView';
|
|
|
16
16
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
17
17
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
18
18
|
export const InlineCard = ({
|
|
19
|
-
analytics,
|
|
20
19
|
id,
|
|
21
20
|
url,
|
|
22
21
|
cardState,
|
|
@@ -111,7 +110,6 @@ export const InlineCard = ({
|
|
|
111
110
|
testId: testIdWithStatus,
|
|
112
111
|
showHoverPreview: showHoverPreview,
|
|
113
112
|
id: id,
|
|
114
|
-
analytics: analytics,
|
|
115
113
|
extensionKey: extensionKey,
|
|
116
114
|
truncateInline: truncateInline
|
|
117
115
|
});
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "33.
|
|
13
|
+
packageVersion: "33.4.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -10,11 +10,9 @@ import { startUfoExperience } from '../analytics';
|
|
|
10
10
|
import { getByDefinitionId, getDefinitionId, getExtensionKey, getServices } from '../helpers';
|
|
11
11
|
import useInvokeClientAction from '../hooks/use-invoke-client-action';
|
|
12
12
|
import useResolve from '../hooks/use-resolve';
|
|
13
|
-
export var useSmartCardActions = function useSmartCardActions(id, url
|
|
13
|
+
export var useSmartCardActions = function useSmartCardActions(id, url) {
|
|
14
14
|
var resolveUrl = useResolve();
|
|
15
|
-
var invokeClientAction = useInvokeClientAction({
|
|
16
|
-
analytics: analytics
|
|
17
|
-
});
|
|
15
|
+
var invokeClientAction = useInvokeClientAction({});
|
|
18
16
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
19
17
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
20
18
|
var _useSmartLinkContext = useSmartLinkContext(),
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience } from './ufoExperiences';
|
|
2
|
-
export { useSmartLinkAnalytics } from './useSmartLinkAnalytics';
|
|
1
|
+
export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience } from './ufoExperiences';
|
|
@@ -8,15 +8,6 @@ export var useFlexibleUiContext = function useFlexibleUiContext() {
|
|
|
8
8
|
return useContext(FlexibleUiContext);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
13
|
-
* underlying elements.
|
|
14
|
-
*/
|
|
15
|
-
export var FlexibleUiAnalyticsContext = /*#__PURE__*/createContext(undefined);
|
|
16
|
-
export var useFlexibleUiAnalyticsContext = function useFlexibleUiAnalyticsContext() {
|
|
17
|
-
return useContext(FlexibleUiAnalyticsContext);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
11
|
/**
|
|
21
12
|
* This provides the ui options that will be used by Smart Links Flexible UI
|
|
22
13
|
* to render its underlying elements.
|
|
@@ -2,7 +2,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
4
|
import { useSmartCardActions as useSmartLinkActions } from '../actions';
|
|
5
|
-
import { useSmartLinkAnalytics } from '../analytics';
|
|
6
5
|
import { useSmartLinkConfig } from '../config';
|
|
7
6
|
import { useSmartLinkRenderers } from '../renderers';
|
|
8
7
|
import { useSmartCardState as useSmartLinkState } from '../store';
|
|
@@ -10,8 +9,7 @@ export function useSmartLink(id, url) {
|
|
|
10
9
|
var state = useSmartLinkState(url);
|
|
11
10
|
var _useSmartLinkContext = useSmartLinkContext(),
|
|
12
11
|
store = _useSmartLinkContext.store;
|
|
13
|
-
var
|
|
14
|
-
var actions = useSmartLinkActions(id, url, analytics);
|
|
12
|
+
var actions = useSmartLinkActions(id, url);
|
|
15
13
|
var config = useSmartLinkConfig();
|
|
16
14
|
var renderers = useSmartLinkRenderers();
|
|
17
15
|
|
|
@@ -35,7 +33,6 @@ export function useSmartLink(id, url) {
|
|
|
35
33
|
state: state,
|
|
36
34
|
actions: actions,
|
|
37
35
|
config: config,
|
|
38
|
-
analytics: analytics,
|
|
39
36
|
renderers: renderers,
|
|
40
37
|
error: error
|
|
41
38
|
};
|
|
@@ -9,7 +9,6 @@ import { extractInvokePreviewAction } from '../../extractors/action/extract-invo
|
|
|
9
9
|
import { extractInvokeViewAction } from '../../extractors/action/extract-invoke-view-action';
|
|
10
10
|
import { messages } from '../../messages';
|
|
11
11
|
import { toAction } from '../../utils/actions/to-action';
|
|
12
|
-
import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
|
|
13
12
|
import useInvokeClientAction from '../hooks/use-invoke-client-action';
|
|
14
13
|
import { useSmartCardState as useLinkState } from '../store';
|
|
15
14
|
export function useSmartLinkActions(_ref) {
|
|
@@ -21,11 +20,10 @@ export function useSmartLinkActions(_ref) {
|
|
|
21
20
|
return uuid();
|
|
22
21
|
}, []);
|
|
23
22
|
var linkState = useLinkState(url);
|
|
24
|
-
var linkAnalytics = useLinkAnalytics(url, id);
|
|
25
23
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
26
24
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
27
25
|
var invokeClientAction = useInvokeClientAction({
|
|
28
|
-
|
|
26
|
+
fireEvent: fireEvent
|
|
29
27
|
});
|
|
30
28
|
if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
|
|
31
29
|
var actions = [];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
3
|
import { useSmartCardActions as useLinkActions } from '../actions';
|
|
4
|
-
import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
|
|
5
4
|
/**
|
|
6
5
|
* Exposes a programmatic way to reload the data being used to render a Smart Link.
|
|
7
6
|
* @param
|
|
@@ -12,7 +11,6 @@ export function useSmartLinkReload(_ref) {
|
|
|
12
11
|
var id = useMemo(function () {
|
|
13
12
|
return uuid();
|
|
14
13
|
}, []);
|
|
15
|
-
var
|
|
16
|
-
var linkActions = useLinkActions(id, url, linkAnalytics);
|
|
14
|
+
var linkActions = useLinkActions(id, url);
|
|
17
15
|
return linkActions.reload;
|
|
18
16
|
}
|
package/dist/esm/state/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import { getMeasure } from '../performance';
|
|
7
3
|
export var ANALYTICS_CHANNEL = 'media';
|
|
8
4
|
export var context = {
|
|
9
5
|
componentName: 'smart-cards',
|
|
10
6
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "33.
|
|
7
|
+
packageVersion: "33.4.0"
|
|
12
8
|
};
|
|
13
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
14
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -20,12 +16,6 @@ export var TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
|
|
|
20
16
|
TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
|
|
21
17
|
return TrackQuickActionFailureReason;
|
|
22
18
|
}({});
|
|
23
|
-
var uiActionSubjectIds = {
|
|
24
|
-
DownloadAction: 'downloadDocument',
|
|
25
|
-
PreviewAction: 'invokePreviewScreen',
|
|
26
|
-
ViewAction: 'shortcutGoToLink',
|
|
27
|
-
StatusAction: 'issueStatusUpdate'
|
|
28
|
-
};
|
|
29
19
|
export var SmartLinkEvents = /*#__PURE__*/function () {
|
|
30
20
|
function SmartLinkEvents() {
|
|
31
21
|
_classCallCheck(this, SmartLinkEvents);
|
|
@@ -51,136 +41,4 @@ export var fireSmartLinkEvent = function fireSmartLinkEvent(payload, createAnaly
|
|
|
51
41
|
if (createAnalyticsEvent) {
|
|
52
42
|
createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
|
|
53
43
|
}
|
|
54
|
-
};
|
|
55
|
-
export var invokeSucceededEvent = function invokeSucceededEvent(_ref) {
|
|
56
|
-
var id = _ref.id,
|
|
57
|
-
actionType = _ref.actionType,
|
|
58
|
-
display = _ref.display,
|
|
59
|
-
extensionKey = _ref.extensionKey,
|
|
60
|
-
definitionId = _ref.definitionId,
|
|
61
|
-
destinationProduct = _ref.destinationProduct,
|
|
62
|
-
destinationSubproduct = _ref.destinationSubproduct,
|
|
63
|
-
location = _ref.location;
|
|
64
|
-
var measure = id ? getMeasure(id, 'resolved') : undefined;
|
|
65
|
-
return {
|
|
66
|
-
action: 'resolved',
|
|
67
|
-
actionSubject: 'smartLinkAction',
|
|
68
|
-
eventType: 'operational',
|
|
69
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
70
|
-
id: id,
|
|
71
|
-
actionType: actionType,
|
|
72
|
-
display: display,
|
|
73
|
-
definitionId: definitionId,
|
|
74
|
-
destinationProduct: destinationProduct,
|
|
75
|
-
destinationSubproduct: destinationSubproduct,
|
|
76
|
-
location: location,
|
|
77
|
-
extensionKey: extensionKey,
|
|
78
|
-
duration: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
79
|
-
})
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export var invokeFailedEvent = function invokeFailedEvent(_ref2) {
|
|
83
|
-
var id = _ref2.id,
|
|
84
|
-
actionType = _ref2.actionType,
|
|
85
|
-
display = _ref2.display,
|
|
86
|
-
reason = _ref2.reason,
|
|
87
|
-
extensionKey = _ref2.extensionKey,
|
|
88
|
-
definitionId = _ref2.definitionId,
|
|
89
|
-
destinationProduct = _ref2.destinationProduct,
|
|
90
|
-
destinationSubproduct = _ref2.destinationSubproduct,
|
|
91
|
-
location = _ref2.location;
|
|
92
|
-
var measure = id ? getMeasure(id, 'errored') : undefined;
|
|
93
|
-
return {
|
|
94
|
-
action: 'unresolved',
|
|
95
|
-
actionSubject: 'smartLinkAction',
|
|
96
|
-
eventType: 'operational',
|
|
97
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
98
|
-
id: id,
|
|
99
|
-
actionType: actionType,
|
|
100
|
-
display: display,
|
|
101
|
-
extensionKey: extensionKey,
|
|
102
|
-
definitionId: definitionId,
|
|
103
|
-
destinationProduct: destinationProduct,
|
|
104
|
-
destinationSubproduct: destinationSubproduct,
|
|
105
|
-
location: location,
|
|
106
|
-
duration: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
107
|
-
reason: reason
|
|
108
|
-
})
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
export var uiActionClickedEvent = function uiActionClickedEvent(_ref3) {
|
|
112
|
-
var id = _ref3.id,
|
|
113
|
-
actionType = _ref3.actionType,
|
|
114
|
-
extensionKey = _ref3.extensionKey,
|
|
115
|
-
display = _ref3.display,
|
|
116
|
-
definitionId = _ref3.definitionId,
|
|
117
|
-
destinationProduct = _ref3.destinationProduct,
|
|
118
|
-
destinationSubproduct = _ref3.destinationSubproduct,
|
|
119
|
-
location = _ref3.location;
|
|
120
|
-
return {
|
|
121
|
-
action: 'clicked',
|
|
122
|
-
actionSubject: 'button',
|
|
123
|
-
actionSubjectId: uiActionSubjectIds[actionType],
|
|
124
|
-
eventType: 'ui',
|
|
125
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
126
|
-
id: id,
|
|
127
|
-
display: display,
|
|
128
|
-
actionType: actionType,
|
|
129
|
-
extensionKey: extensionKey,
|
|
130
|
-
definitionId: definitionId,
|
|
131
|
-
destinationProduct: destinationProduct,
|
|
132
|
-
destinationSubproduct: destinationSubproduct,
|
|
133
|
-
location: location
|
|
134
|
-
})
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
export var uiRenderSuccessEvent = function uiRenderSuccessEvent(_ref4) {
|
|
138
|
-
var display = _ref4.display,
|
|
139
|
-
status = _ref4.status,
|
|
140
|
-
extensionKey = _ref4.extensionKey,
|
|
141
|
-
definitionId = _ref4.definitionId,
|
|
142
|
-
destinationProduct = _ref4.destinationProduct,
|
|
143
|
-
destinationSubproduct = _ref4.destinationSubproduct,
|
|
144
|
-
location = _ref4.location,
|
|
145
|
-
canBeDatasource = _ref4.canBeDatasource;
|
|
146
|
-
return {
|
|
147
|
-
action: 'renderSuccess',
|
|
148
|
-
actionSubject: 'smartLink',
|
|
149
|
-
eventType: 'ui',
|
|
150
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
151
|
-
status: status,
|
|
152
|
-
extensionKey: extensionKey,
|
|
153
|
-
definitionId: definitionId,
|
|
154
|
-
destinationProduct: destinationProduct,
|
|
155
|
-
destinationSubproduct: destinationSubproduct,
|
|
156
|
-
location: location,
|
|
157
|
-
display: display,
|
|
158
|
-
canBeDatasource: canBeDatasource
|
|
159
|
-
})
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
export var uiRenderFailedEvent = function uiRenderFailedEvent(_ref5) {
|
|
163
|
-
var display = _ref5.display,
|
|
164
|
-
error = _ref5.error,
|
|
165
|
-
errorInfo = _ref5.errorInfo,
|
|
166
|
-
extensionKey = _ref5.extensionKey,
|
|
167
|
-
definitionId = _ref5.definitionId,
|
|
168
|
-
destinationProduct = _ref5.destinationProduct,
|
|
169
|
-
destinationSubproduct = _ref5.destinationSubproduct,
|
|
170
|
-
location = _ref5.location;
|
|
171
|
-
return {
|
|
172
|
-
actionSubject: 'smartLink',
|
|
173
|
-
action: 'renderFailed',
|
|
174
|
-
eventType: 'ui',
|
|
175
|
-
attributes: _objectSpread(_objectSpread({}, context), {}, {
|
|
176
|
-
error: error,
|
|
177
|
-
errorInfo: errorInfo,
|
|
178
|
-
display: display,
|
|
179
|
-
extensionKey: extensionKey,
|
|
180
|
-
definitionId: definitionId,
|
|
181
|
-
destinationProduct: destinationProduct,
|
|
182
|
-
destinationSubproduct: destinationSubproduct,
|
|
183
|
-
location: location
|
|
184
|
-
})
|
|
185
|
-
};
|
|
186
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent
|
|
1
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent } from './analytics';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -303,26 +303,4 @@ export var waitFor = function waitFor() {
|
|
|
303
303
|
return new Promise(function (res) {
|
|
304
304
|
return setTimeout(res, time);
|
|
305
305
|
});
|
|
306
|
-
};
|
|
307
|
-
export var mockAnalytics = {
|
|
308
|
-
ui: {
|
|
309
|
-
actionClickedEvent: function actionClickedEvent() {},
|
|
310
|
-
buttonClickedEvent: function buttonClickedEvent() {},
|
|
311
|
-
modalClosedEvent: function modalClosedEvent() {},
|
|
312
|
-
renderSuccessEvent: function renderSuccessEvent() {},
|
|
313
|
-
renderFailedEvent: function renderFailedEvent() {},
|
|
314
|
-
smartLinkServerActionClickedEvent: function smartLinkServerActionClickedEvent() {}
|
|
315
|
-
},
|
|
316
|
-
operational: {
|
|
317
|
-
invokeSucceededEvent: function invokeSucceededEvent() {},
|
|
318
|
-
invokeFailedEvent: function invokeFailedEvent() {}
|
|
319
|
-
},
|
|
320
|
-
track: {
|
|
321
|
-
smartLinkQuickActionFailed: function smartLinkQuickActionFailed() {},
|
|
322
|
-
smartLinkQuickActionStarted: function smartLinkQuickActionStarted() {},
|
|
323
|
-
smartLinkQuickActionSuccess: function smartLinkQuickActionSuccess() {}
|
|
324
|
-
},
|
|
325
|
-
screen: {
|
|
326
|
-
modalViewedEvent: function modalViewedEvent() {}
|
|
327
|
-
}
|
|
328
306
|
};
|
|
@@ -19,7 +19,6 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
19
19
|
onResolve = _ref.onResolve,
|
|
20
20
|
onError = _ref.onError,
|
|
21
21
|
testId = _ref.testId,
|
|
22
|
-
analytics = _ref.analytics,
|
|
23
22
|
actionOptions = _ref.actionOptions;
|
|
24
23
|
var status = cardState.status;
|
|
25
24
|
var blockCardProps = {
|
|
@@ -33,8 +32,7 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
33
32
|
onError: onError,
|
|
34
33
|
onResolve: onResolve,
|
|
35
34
|
renderers: renderers,
|
|
36
|
-
actionOptions: actionOptions
|
|
37
|
-
analytics: analytics
|
|
35
|
+
actionOptions: actionOptions
|
|
38
36
|
};
|
|
39
37
|
switch (status) {
|
|
40
38
|
case 'pending':
|
|
@@ -21,8 +21,7 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
21
21
|
actionOptions = _ref.actionOptions,
|
|
22
22
|
_ref$testId = _ref.testId,
|
|
23
23
|
testId = _ref$testId === void 0 ? 'smart-block-resolved-view' : _ref$testId,
|
|
24
|
-
url = _ref.url
|
|
25
|
-
analytics = _ref.analytics;
|
|
24
|
+
url = _ref.url;
|
|
26
25
|
var _useState = useState(false),
|
|
27
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
27
|
isPreviewBlockErrored = _useState2[0],
|
|
@@ -47,7 +46,6 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
47
46
|
}];
|
|
48
47
|
}, []);
|
|
49
48
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
50
|
-
analytics: analytics,
|
|
51
49
|
appearance: "block",
|
|
52
50
|
cardState: cardState,
|
|
53
51
|
onClick: onClick,
|