@atlaskit/smart-card 33.1.0 → 33.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/extractors/flexible/actions/extract-copy-link-action.js +1 -20
- package/dist/cjs/extractors/flexible/actions/extract-download-action.js +1 -23
- package/dist/cjs/extractors/flexible/actions/extract-preview-action.js +1 -34
- package/dist/cjs/extractors/flexible/actions/index.js +2 -15
- package/dist/cjs/extractors/flexible/extract-state.js +1 -5
- package/dist/cjs/extractors/flexible/index.js +3 -7
- 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/use-invoke-client-action/index.js +21 -44
- package/dist/cjs/state/hooks/useSmartLink.js +1 -4
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +5 -21
- package/dist/cjs/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/cjs/state/index.js +1 -8
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +3 -37
- 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 +13 -33
- package/dist/cjs/view/CardWithUrl/loader.js +10 -22
- 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/components/analytics/index.js +40 -89
- package/dist/cjs/view/EmbedModal/index.js +9 -68
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +27 -67
- package/dist/cjs/view/FlexibleCard/components/actions/download-action/index.js +5 -44
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +5 -51
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +3 -3
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +10 -26
- package/dist/cjs/view/FlexibleCard/components/utils.js +1 -28
- package/dist/cjs/view/FlexibleCard/index.js +3 -17
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -3
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +13 -30
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +3 -5
- package/dist/cjs/view/HoverCard/index.js +10 -22
- package/dist/cjs/view/InlineCard/index.js +1 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-copy-link-action.js +0 -19
- package/dist/es2019/extractors/flexible/actions/extract-download-action.js +0 -21
- package/dist/es2019/extractors/flexible/actions/extract-preview-action.js +0 -34
- package/dist/es2019/extractors/flexible/actions/index.js +4 -23
- package/dist/es2019/extractors/flexible/extract-state.js +1 -5
- package/dist/es2019/extractors/flexible/index.js +3 -4
- 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/use-invoke-client-action/index.js +21 -44
- package/dist/es2019/state/hooks/useSmartLink.js +1 -4
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +5 -21
- package/dist/es2019/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/es2019/state/index.js +1 -2
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +3 -40
- 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 +14 -34
- package/dist/es2019/view/CardWithUrl/loader.js +11 -23
- 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/components/analytics/index.js +39 -88
- package/dist/es2019/view/EmbedModal/index.js +10 -35
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +13 -37
- package/dist/es2019/view/FlexibleCard/components/actions/download-action/index.js +6 -27
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +6 -32
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +3 -3
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +6 -24
- package/dist/es2019/view/FlexibleCard/components/utils.js +0 -25
- package/dist/es2019/view/FlexibleCard/index.js +3 -15
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -3
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +12 -25
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +2 -4
- package/dist/es2019/view/HoverCard/index.js +11 -23
- package/dist/es2019/view/InlineCard/index.js +0 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-copy-link-action.js +0 -19
- package/dist/esm/extractors/flexible/actions/extract-download-action.js +0 -23
- package/dist/esm/extractors/flexible/actions/extract-preview-action.js +0 -34
- package/dist/esm/extractors/flexible/actions/index.js +4 -17
- package/dist/esm/extractors/flexible/extract-state.js +1 -5
- package/dist/esm/extractors/flexible/index.js +3 -4
- 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/use-invoke-client-action/index.js +21 -44
- package/dist/esm/state/hooks/useSmartLink.js +1 -4
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +5 -21
- package/dist/esm/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/esm/state/index.js +1 -2
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +3 -37
- 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 +14 -34
- package/dist/esm/view/CardWithUrl/loader.js +10 -22
- 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/components/analytics/index.js +40 -89
- package/dist/esm/view/EmbedModal/index.js +11 -70
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +28 -68
- package/dist/esm/view/FlexibleCard/components/actions/download-action/index.js +6 -45
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +6 -52
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +3 -3
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +6 -26
- package/dist/esm/view/FlexibleCard/components/utils.js +0 -27
- package/dist/esm/view/FlexibleCard/index.js +4 -18
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -3
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +13 -30
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +3 -5
- package/dist/esm/view/HoverCard/index.js +10 -22
- 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/extractors/flexible/actions/extract-copy-link-action.d.ts +0 -7
- package/dist/types/extractors/flexible/actions/extract-download-action.d.ts +0 -7
- package/dist/types/extractors/flexible/actions/extract-preview-action.d.ts +0 -7
- package/dist/types/extractors/flexible/actions/index.d.ts +0 -6
- 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 +4 -25
- package/dist/types/state/hooks/use-invoke/types.d.ts +0 -6
- package/dist/types/state/hooks/use-invoke-client-action/index.d.ts +1 -1
- package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +0 -6
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -22
- package/dist/types/state/index.d.ts +0 -1
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +1 -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 -22
- 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/EmbedModal/index.d.ts +0 -2
- package/dist/types/view/EmbedModal/types.d.ts +0 -3
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/types.d.ts +0 -6
- package/dist/types/view/FlexibleCard/components/utils.d.ts +0 -6
- 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/CustomPopupContainer.d.ts +1 -1
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/index.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 +0 -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/extractors/flexible/actions/extract-copy-link-action.d.ts +0 -7
- package/dist/types-ts4.5/extractors/flexible/actions/extract-download-action.d.ts +0 -7
- package/dist/types-ts4.5/extractors/flexible/actions/extract-preview-action.d.ts +0 -7
- package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +0 -6
- 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 +4 -25
- package/dist/types-ts4.5/state/hooks/use-invoke/types.d.ts +0 -6
- package/dist/types-ts4.5/state/hooks/use-invoke-client-action/index.d.ts +1 -1
- 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 -22
- package/dist/types-ts4.5/state/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +1 -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 -22
- 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/EmbedModal/index.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedModal/types.d.ts +0 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/types.d.ts +0 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +0 -6
- 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/CustomPopupContainer.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/index.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 +0 -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 -4
- package/dist/cjs/extractors/action/extractDownloadActionProps.js +0 -32
- package/dist/cjs/extractors/action/extractPreviewActionProps.js +0 -47
- package/dist/cjs/extractors/action/extractViewActionProps.js +0 -31
- package/dist/cjs/extractors/flexible/actions/extract-view-action.js +0 -27
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +0 -311
- package/dist/es2019/extractors/action/extractDownloadActionProps.js +0 -24
- package/dist/es2019/extractors/action/extractPreviewActionProps.js +0 -36
- package/dist/es2019/extractors/action/extractViewActionProps.js +0 -23
- package/dist/es2019/extractors/flexible/actions/extract-view-action.js +0 -20
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +0 -296
- package/dist/esm/extractors/action/extractDownloadActionProps.js +0 -27
- package/dist/esm/extractors/action/extractPreviewActionProps.js +0 -41
- package/dist/esm/extractors/action/extractViewActionProps.js +0 -26
- package/dist/esm/extractors/flexible/actions/extract-view-action.js +0 -22
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +0 -304
- package/dist/types/extractors/action/extractDownloadActionProps.d.ts +0 -7
- package/dist/types/extractors/action/extractPreviewActionProps.d.ts +0 -7
- package/dist/types/extractors/action/extractViewActionProps.d.ts +0 -7
- package/dist/types/extractors/flexible/actions/extract-view-action.d.ts +0 -7
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +0 -91
- package/dist/types/utils/analytics/__mocks__/analytics.d.ts +0 -2
- package/dist/types/view/FlexibleCard/components/actions/follow-action/__fixtures__/follow-goal-context.d.ts +0 -3
- package/dist/types-ts4.5/extractors/action/extractDownloadActionProps.d.ts +0 -7
- package/dist/types-ts4.5/extractors/action/extractPreviewActionProps.d.ts +0 -7
- package/dist/types-ts4.5/extractors/action/extractViewActionProps.d.ts +0 -7
- package/dist/types-ts4.5/extractors/flexible/actions/extract-view-action.d.ts +0 -7
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +0 -91
- package/dist/types-ts4.5/utils/analytics/__mocks__/analytics.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/__fixtures__/follow-goal-context.d.ts +0 -3
|
@@ -8,11 +8,9 @@ import { startUfoExperience } from '../analytics';
|
|
|
8
8
|
import { getByDefinitionId, getDefinitionId, getExtensionKey, getServices } from '../helpers';
|
|
9
9
|
import useInvokeClientAction from '../hooks/use-invoke-client-action';
|
|
10
10
|
import useResolve from '../hooks/use-resolve';
|
|
11
|
-
export const useSmartCardActions = (id, url
|
|
11
|
+
export const useSmartCardActions = (id, url) => {
|
|
12
12
|
const resolveUrl = useResolve();
|
|
13
|
-
const invokeClientAction = useInvokeClientAction({
|
|
14
|
-
analytics
|
|
15
|
-
});
|
|
13
|
+
const invokeClientAction = useInvokeClientAction({});
|
|
16
14
|
const {
|
|
17
15
|
fireEvent
|
|
18
16
|
} = useAnalyticsEvents();
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience } from './ufoExperiences';
|
|
2
|
-
export { useSmartLinkAnalytics } from './useSmartLinkAnalytics';
|
|
1
|
+
export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience } from './ufoExperiences';
|
|
@@ -6,13 +6,6 @@ import { createContext, useContext } from 'react';
|
|
|
6
6
|
export const FlexibleUiContext = /*#__PURE__*/createContext(undefined);
|
|
7
7
|
export const useFlexibleUiContext = () => useContext(FlexibleUiContext);
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
11
|
-
* underlying elements.
|
|
12
|
-
*/
|
|
13
|
-
export const FlexibleUiAnalyticsContext = /*#__PURE__*/createContext(undefined);
|
|
14
|
-
export const useFlexibleUiAnalyticsContext = () => useContext(FlexibleUiAnalyticsContext);
|
|
15
|
-
|
|
16
9
|
/**
|
|
17
10
|
* This provides the ui options that will be used by Smart Links Flexible UI
|
|
18
11
|
* to render its underlying elements.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
5
4
|
import * as measure from '../../../utils/performance';
|
|
6
5
|
import { failUfoExperience, startUfoExperience, succeedUfoExperience } from '../../analytics';
|
|
@@ -10,7 +9,6 @@ const ACTION_EXPERIENCE_NAME = 'smart-link-action-invocation';
|
|
|
10
9
|
* Invoke client action such as preview, download and open link
|
|
11
10
|
*/
|
|
12
11
|
const useInvokeClientAction = ({
|
|
13
|
-
analytics,
|
|
14
12
|
fireEvent: fireEventProp
|
|
15
13
|
}) => {
|
|
16
14
|
const {
|
|
@@ -33,6 +31,7 @@ const useInvokeClientAction = ({
|
|
|
33
31
|
const markName = `${experienceId}-${actionType}`;
|
|
34
32
|
measure.mark(markName, 'pending');
|
|
35
33
|
try {
|
|
34
|
+
var _measure$getMeasure$d, _measure$getMeasure;
|
|
36
35
|
// Begin UFO experience
|
|
37
36
|
startUfoExperience(ACTION_EXPERIENCE_NAME, experienceId, {
|
|
38
37
|
actionType,
|
|
@@ -42,7 +41,7 @@ const useInvokeClientAction = ({
|
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
// Begin analytics instrumentation.
|
|
45
|
-
if (actionSubjectId
|
|
44
|
+
if (actionSubjectId !== undefined) {
|
|
46
45
|
fireEvent(`ui.button.clicked.${actionSubjectId}`, {
|
|
47
46
|
actionType: actionType !== null && actionType !== void 0 ? actionType : null,
|
|
48
47
|
definitionId,
|
|
@@ -50,57 +49,35 @@ const useInvokeClientAction = ({
|
|
|
50
49
|
id: id !== null && id !== void 0 ? id : experienceId,
|
|
51
50
|
resourceType
|
|
52
51
|
});
|
|
53
|
-
} else {
|
|
54
|
-
analytics === null || analytics === void 0 ? void 0 : analytics.ui.actionClickedEvent({
|
|
55
|
-
actionType,
|
|
56
|
-
display
|
|
57
|
-
});
|
|
58
52
|
}
|
|
59
|
-
|
|
60
53
|
// Invoke action
|
|
61
54
|
const result = await actionFn();
|
|
62
55
|
measure.mark(markName, 'resolved');
|
|
63
56
|
succeedUfoExperience(ACTION_EXPERIENCE_NAME, experienceId);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
resourceType
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
analytics === null || analytics === void 0 ? void 0 : analytics.operational.invokeSucceededEvent({
|
|
76
|
-
actionType,
|
|
77
|
-
display
|
|
78
|
-
});
|
|
79
|
-
}
|
|
57
|
+
fireEvent('operational.smartLinkAction.resolved', {
|
|
58
|
+
actionType: actionType !== null && actionType !== void 0 ? actionType : null,
|
|
59
|
+
definitionId,
|
|
60
|
+
display: display !== null && display !== void 0 ? display : null,
|
|
61
|
+
duration: (_measure$getMeasure$d = (_measure$getMeasure = measure.getMeasure(markName, 'resolved')) === null || _measure$getMeasure === void 0 ? void 0 : _measure$getMeasure.duration) !== null && _measure$getMeasure$d !== void 0 ? _measure$getMeasure$d : null,
|
|
62
|
+
id: id !== null && id !== void 0 ? id : experienceId,
|
|
63
|
+
resourceType
|
|
64
|
+
});
|
|
80
65
|
return result;
|
|
81
66
|
} catch (err) {
|
|
67
|
+
var _measure$getMeasure$d2, _measure$getMeasure2;
|
|
82
68
|
measure.mark(markName, 'errored');
|
|
83
69
|
failUfoExperience(ACTION_EXPERIENCE_NAME, experienceId);
|
|
84
70
|
const reason = typeof err === 'string' ? err : err === null || err === void 0 ? void 0 : err.message;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
resourceType
|
|
95
|
-
});
|
|
96
|
-
} else {
|
|
97
|
-
analytics === null || analytics === void 0 ? void 0 : analytics.operational.invokeFailedEvent({
|
|
98
|
-
actionType,
|
|
99
|
-
display,
|
|
100
|
-
reason
|
|
101
|
-
});
|
|
102
|
-
}
|
|
71
|
+
fireEvent('operational.smartLinkAction.unresolved', {
|
|
72
|
+
actionType: actionType !== null && actionType !== void 0 ? actionType : null,
|
|
73
|
+
definitionId,
|
|
74
|
+
display: display !== null && display !== void 0 ? display : null,
|
|
75
|
+
duration: (_measure$getMeasure$d2 = (_measure$getMeasure2 = measure.getMeasure(markName, 'errored')) === null || _measure$getMeasure2 === void 0 ? void 0 : _measure$getMeasure2.duration) !== null && _measure$getMeasure$d2 !== void 0 ? _measure$getMeasure$d2 : null,
|
|
76
|
+
id: id !== null && id !== void 0 ? id : experienceId,
|
|
77
|
+
reason,
|
|
78
|
+
resourceType
|
|
79
|
+
});
|
|
103
80
|
}
|
|
104
|
-
}, [
|
|
81
|
+
}, [fireEvent]);
|
|
105
82
|
};
|
|
106
83
|
export default useInvokeClientAction;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
3
3
|
import { useSmartCardActions as useSmartLinkActions } from '../actions';
|
|
4
|
-
import { useSmartLinkAnalytics } from '../analytics';
|
|
5
4
|
import { useSmartLinkConfig } from '../config';
|
|
6
5
|
import { useSmartLinkRenderers } from '../renderers';
|
|
7
6
|
import { useSmartCardState as useSmartLinkState } from '../store';
|
|
@@ -10,8 +9,7 @@ export function useSmartLink(id, url) {
|
|
|
10
9
|
const {
|
|
11
10
|
store
|
|
12
11
|
} = useSmartLinkContext();
|
|
13
|
-
const
|
|
14
|
-
const actions = useSmartLinkActions(id, url, analytics);
|
|
12
|
+
const actions = useSmartLinkActions(id, url);
|
|
15
13
|
const config = useSmartLinkConfig();
|
|
16
14
|
const renderers = useSmartLinkRenderers();
|
|
17
15
|
|
|
@@ -30,7 +28,6 @@ export function useSmartLink(id, url) {
|
|
|
30
28
|
state,
|
|
31
29
|
actions,
|
|
32
30
|
config,
|
|
33
|
-
analytics,
|
|
34
31
|
renderers,
|
|
35
32
|
error
|
|
36
33
|
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import uuid from 'uuid';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
5
4
|
import { extractInvokeDownloadAction } from '../../extractors/action/extract-invoke-download-action';
|
|
6
5
|
import { extractInvokePreviewAction } from '../../extractors/action/extract-invoke-preview-action';
|
|
7
6
|
import { extractInvokeViewAction } from '../../extractors/action/extract-invoke-view-action';
|
|
8
|
-
import { extractDownloadActionProps } from '../../extractors/action/extractDownloadActionProps';
|
|
9
|
-
import { extractPreviewActionProps } from '../../extractors/action/extractPreviewActionProps';
|
|
10
|
-
import { extractViewActionProps } from '../../extractors/action/extractViewActionProps';
|
|
11
7
|
import { messages } from '../../messages';
|
|
12
8
|
import { toAction } from '../../utils/actions/to-action';
|
|
13
|
-
import { useSmartLinkAnalytics as useLinkAnalytics } from '../analytics';
|
|
14
|
-
import { getExtensionKey } from '../helpers';
|
|
15
9
|
import useInvokeClientAction from '../hooks/use-invoke-client-action';
|
|
16
10
|
import { useSmartCardState as useLinkState } from '../store';
|
|
17
11
|
export function useSmartLinkActions({
|
|
@@ -22,23 +16,13 @@ export function useSmartLinkActions({
|
|
|
22
16
|
}) {
|
|
23
17
|
const id = useMemo(() => uuid(), []);
|
|
24
18
|
const linkState = useLinkState(url);
|
|
25
|
-
const linkAnalytics = useLinkAnalytics(url, id);
|
|
26
19
|
const {
|
|
27
20
|
fireEvent
|
|
28
21
|
} = useAnalyticsEvents();
|
|
29
22
|
const invokeClientAction = useInvokeClientAction({
|
|
30
|
-
|
|
23
|
+
fireEvent
|
|
31
24
|
});
|
|
32
25
|
if (linkState.details && !(actionOptions !== null && actionOptions !== void 0 && actionOptions.hide)) {
|
|
33
|
-
const opts = {
|
|
34
|
-
response: linkState.details,
|
|
35
|
-
handleInvoke: invokeClientAction,
|
|
36
|
-
analytics: linkAnalytics,
|
|
37
|
-
origin,
|
|
38
|
-
extensionKey: getExtensionKey(linkState.details),
|
|
39
|
-
source: appearance,
|
|
40
|
-
actionOptions
|
|
41
|
-
};
|
|
42
26
|
const actions = [];
|
|
43
27
|
const invokeParam = {
|
|
44
28
|
actionOptions,
|
|
@@ -46,19 +30,19 @@ export function useSmartLinkActions({
|
|
|
46
30
|
id,
|
|
47
31
|
response: linkState.details
|
|
48
32
|
};
|
|
49
|
-
const downloadActionProps =
|
|
33
|
+
const downloadActionProps = extractInvokeDownloadAction(invokeParam);
|
|
50
34
|
if (downloadActionProps) {
|
|
51
35
|
actions.push(toAction(downloadActionProps, invokeClientAction, messages.download, 'download-content'));
|
|
52
36
|
}
|
|
53
|
-
const viewActionProps =
|
|
37
|
+
const viewActionProps = extractInvokeViewAction(invokeParam);
|
|
54
38
|
if (viewActionProps) {
|
|
55
39
|
actions.push(toAction(viewActionProps, invokeClientAction, messages.view, 'view-content'));
|
|
56
40
|
}
|
|
57
|
-
const previewActionProps =
|
|
41
|
+
const previewActionProps = extractInvokePreviewAction({
|
|
58
42
|
...invokeParam,
|
|
59
43
|
fireEvent,
|
|
60
44
|
origin
|
|
61
|
-
})
|
|
45
|
+
});
|
|
62
46
|
if (previewActionProps) {
|
|
63
47
|
actions.push(toAction(previewActionProps, invokeClientAction, messages.preview_improved, 'preview-content'));
|
|
64
48
|
}
|
|
@@ -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
|
|
@@ -11,7 +10,6 @@ export function useSmartLinkReload({
|
|
|
11
10
|
url
|
|
12
11
|
}) {
|
|
13
12
|
const id = useMemo(() => uuid(), []);
|
|
14
|
-
const
|
|
15
|
-
const linkActions = useLinkActions(id, url, linkAnalytics);
|
|
13
|
+
const linkActions = useLinkActions(id, url);
|
|
16
14
|
return linkActions.reload;
|
|
17
15
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import React, { useMemo } from 'react';
|
|
3
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
4
3
|
import { getResolvedAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
5
4
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
6
5
|
import { getUrl } from '@atlaskit/linking-common';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
6
|
import { useSmartCardState as useSmartLinkState } from '../../state/store';
|
|
9
7
|
import { context } from './analytics';
|
|
10
|
-
import { LinkAnalyticsContext } from './LinkAnalyticsContext';
|
|
11
8
|
const getExtendedResolvedAttributes = (linkDetails, details, linkStatus) => {
|
|
12
9
|
var _details$meta$definit, _details$meta, _details$meta$resourc, _details$meta2;
|
|
13
10
|
return {
|
|
@@ -52,14 +49,14 @@ export const useSmartLinkAnalyticsContext = ({
|
|
|
52
49
|
} = useSmartLinkContext();
|
|
53
50
|
const state = store ? getUrl(store, url) : undefined;
|
|
54
51
|
return useMemo(() => {
|
|
55
|
-
return
|
|
52
|
+
return getSmartLinkAnalyticsContext({
|
|
56
53
|
display,
|
|
57
54
|
id,
|
|
58
55
|
response: state === null || state === void 0 ? void 0 : state.details,
|
|
59
56
|
source,
|
|
60
57
|
status: state === null || state === void 0 ? void 0 : state.status,
|
|
61
58
|
url
|
|
62
|
-
})
|
|
59
|
+
});
|
|
63
60
|
}, [display, id, source, state === null || state === void 0 ? void 0 : state.details, state === null || state === void 0 ? void 0 : state.status, url]);
|
|
64
61
|
};
|
|
65
62
|
|
|
@@ -67,7 +64,7 @@ export const useSmartLinkAnalyticsContext = ({
|
|
|
67
64
|
* Provides an analytics context to supply attributes to events based on a URL
|
|
68
65
|
* and the link state in the store
|
|
69
66
|
*/
|
|
70
|
-
const
|
|
67
|
+
export const SmartLinkAnalyticsContext = ({
|
|
71
68
|
children,
|
|
72
69
|
display,
|
|
73
70
|
id,
|
|
@@ -89,38 +86,4 @@ const ExtendedSmartLinkAnalyticsContext = ({
|
|
|
89
86
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
90
87
|
data: data
|
|
91
88
|
}, children);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Provides an analytics context to supply attributes to events based on a URL
|
|
96
|
-
* and the link state in the store
|
|
97
|
-
*/
|
|
98
|
-
const LegacySmartLinkAnalyticsContext = props => {
|
|
99
|
-
const {
|
|
100
|
-
children,
|
|
101
|
-
url,
|
|
102
|
-
display
|
|
103
|
-
} = props;
|
|
104
|
-
const {
|
|
105
|
-
details,
|
|
106
|
-
status
|
|
107
|
-
} = useSmartLinkState(url);
|
|
108
|
-
const attributes = getResolvedAttributes({
|
|
109
|
-
url
|
|
110
|
-
}, details, status);
|
|
111
|
-
return /*#__PURE__*/React.createElement(LinkAnalyticsContext, _extends({}, props, {
|
|
112
|
-
display: display
|
|
113
|
-
}), /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
114
|
-
data: {
|
|
115
|
-
attributes
|
|
116
|
-
}
|
|
117
|
-
}, children));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Provides an analytics context to supply attributes to events based on a URL
|
|
122
|
-
* and the link state in the store
|
|
123
|
-
*/
|
|
124
|
-
export const SmartLinkAnalyticsContext = props => {
|
|
125
|
-
return fg('platform-smart-card-migrate-embed-modal-analytics') ? /*#__PURE__*/React.createElement(ExtendedSmartLinkAnalyticsContext, props) : /*#__PURE__*/React.createElement(LegacySmartLinkAnalyticsContext, props);
|
|
126
89
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { getMeasure } from '../performance';
|
|
2
1
|
export const ANALYTICS_CHANNEL = 'media';
|
|
3
2
|
export const context = {
|
|
4
3
|
componentName: 'smart-cards',
|
|
5
4
|
packageName: "@atlaskit/smart-card",
|
|
6
|
-
packageVersion: "33.
|
|
5
|
+
packageVersion: "33.3.0"
|
|
7
6
|
};
|
|
8
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
9
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,12 +14,6 @@ export let TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActi
|
|
|
15
14
|
TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
|
|
16
15
|
return TrackQuickActionFailureReason;
|
|
17
16
|
}({});
|
|
18
|
-
const uiActionSubjectIds = {
|
|
19
|
-
DownloadAction: 'downloadDocument',
|
|
20
|
-
PreviewAction: 'invokePreviewScreen',
|
|
21
|
-
ViewAction: 'shortcutGoToLink',
|
|
22
|
-
StatusAction: 'issueStatusUpdate'
|
|
23
|
-
};
|
|
24
17
|
export class SmartLinkEvents {
|
|
25
18
|
insertSmartLink(url, type, createAnalyticsEvent) {
|
|
26
19
|
fireSmartLinkEvent({
|
|
@@ -40,140 +33,4 @@ export const fireSmartLinkEvent = (payload, createAnalyticsEvent) => {
|
|
|
40
33
|
if (createAnalyticsEvent) {
|
|
41
34
|
createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
|
|
42
35
|
}
|
|
43
|
-
};
|
|
44
|
-
export const invokeSucceededEvent = ({
|
|
45
|
-
id,
|
|
46
|
-
actionType,
|
|
47
|
-
display,
|
|
48
|
-
extensionKey,
|
|
49
|
-
definitionId,
|
|
50
|
-
destinationProduct,
|
|
51
|
-
destinationSubproduct,
|
|
52
|
-
location
|
|
53
|
-
}) => {
|
|
54
|
-
const measure = id ? getMeasure(id, 'resolved') : undefined;
|
|
55
|
-
return {
|
|
56
|
-
action: 'resolved',
|
|
57
|
-
actionSubject: 'smartLinkAction',
|
|
58
|
-
eventType: 'operational',
|
|
59
|
-
attributes: {
|
|
60
|
-
...context,
|
|
61
|
-
id,
|
|
62
|
-
actionType,
|
|
63
|
-
display,
|
|
64
|
-
definitionId,
|
|
65
|
-
destinationProduct,
|
|
66
|
-
destinationSubproduct,
|
|
67
|
-
location,
|
|
68
|
-
extensionKey,
|
|
69
|
-
duration: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
export const invokeFailedEvent = ({
|
|
74
|
-
id,
|
|
75
|
-
actionType,
|
|
76
|
-
display,
|
|
77
|
-
reason,
|
|
78
|
-
extensionKey,
|
|
79
|
-
definitionId,
|
|
80
|
-
destinationProduct,
|
|
81
|
-
destinationSubproduct,
|
|
82
|
-
location
|
|
83
|
-
}) => {
|
|
84
|
-
const measure = id ? getMeasure(id, 'errored') : undefined;
|
|
85
|
-
return {
|
|
86
|
-
action: 'unresolved',
|
|
87
|
-
actionSubject: 'smartLinkAction',
|
|
88
|
-
eventType: 'operational',
|
|
89
|
-
attributes: {
|
|
90
|
-
...context,
|
|
91
|
-
id,
|
|
92
|
-
actionType,
|
|
93
|
-
display,
|
|
94
|
-
extensionKey,
|
|
95
|
-
definitionId,
|
|
96
|
-
destinationProduct,
|
|
97
|
-
destinationSubproduct,
|
|
98
|
-
location,
|
|
99
|
-
duration: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
100
|
-
reason
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
export const uiActionClickedEvent = ({
|
|
105
|
-
id,
|
|
106
|
-
actionType,
|
|
107
|
-
extensionKey,
|
|
108
|
-
display,
|
|
109
|
-
definitionId,
|
|
110
|
-
destinationProduct,
|
|
111
|
-
destinationSubproduct,
|
|
112
|
-
location
|
|
113
|
-
}) => ({
|
|
114
|
-
action: 'clicked',
|
|
115
|
-
actionSubject: 'button',
|
|
116
|
-
actionSubjectId: uiActionSubjectIds[actionType],
|
|
117
|
-
eventType: 'ui',
|
|
118
|
-
attributes: {
|
|
119
|
-
...context,
|
|
120
|
-
id,
|
|
121
|
-
display,
|
|
122
|
-
actionType: actionType,
|
|
123
|
-
extensionKey: extensionKey,
|
|
124
|
-
definitionId,
|
|
125
|
-
destinationProduct,
|
|
126
|
-
destinationSubproduct,
|
|
127
|
-
location
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
export const uiRenderSuccessEvent = ({
|
|
131
|
-
display,
|
|
132
|
-
status,
|
|
133
|
-
extensionKey,
|
|
134
|
-
definitionId,
|
|
135
|
-
destinationProduct,
|
|
136
|
-
destinationSubproduct,
|
|
137
|
-
location,
|
|
138
|
-
canBeDatasource
|
|
139
|
-
}) => ({
|
|
140
|
-
action: 'renderSuccess',
|
|
141
|
-
actionSubject: 'smartLink',
|
|
142
|
-
eventType: 'ui',
|
|
143
|
-
attributes: {
|
|
144
|
-
...context,
|
|
145
|
-
status,
|
|
146
|
-
extensionKey,
|
|
147
|
-
definitionId,
|
|
148
|
-
destinationProduct,
|
|
149
|
-
destinationSubproduct,
|
|
150
|
-
location,
|
|
151
|
-
display,
|
|
152
|
-
canBeDatasource
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
export const uiRenderFailedEvent = ({
|
|
156
|
-
display,
|
|
157
|
-
error,
|
|
158
|
-
errorInfo,
|
|
159
|
-
extensionKey,
|
|
160
|
-
definitionId,
|
|
161
|
-
destinationProduct,
|
|
162
|
-
destinationSubproduct,
|
|
163
|
-
location
|
|
164
|
-
}) => ({
|
|
165
|
-
actionSubject: 'smartLink',
|
|
166
|
-
action: 'renderFailed',
|
|
167
|
-
eventType: 'ui',
|
|
168
|
-
attributes: {
|
|
169
|
-
...context,
|
|
170
|
-
error,
|
|
171
|
-
errorInfo,
|
|
172
|
-
display,
|
|
173
|
-
extensionKey,
|
|
174
|
-
definitionId,
|
|
175
|
-
destinationProduct,
|
|
176
|
-
destinationSubproduct,
|
|
177
|
-
location
|
|
178
|
-
}
|
|
179
|
-
});
|
|
36
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent
|
|
1
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent } from './analytics';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -204,26 +204,4 @@ export const fakeFactory = (implementation, implementationPost, implementationPr
|
|
|
204
204
|
return await implementationAri(aris);
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
export const waitFor = (time = 1) => new Promise(res => setTimeout(res, time));
|
|
208
|
-
export const mockAnalytics = {
|
|
209
|
-
ui: {
|
|
210
|
-
actionClickedEvent: () => {},
|
|
211
|
-
buttonClickedEvent: () => {},
|
|
212
|
-
modalClosedEvent: () => {},
|
|
213
|
-
renderSuccessEvent: () => {},
|
|
214
|
-
renderFailedEvent: () => {},
|
|
215
|
-
smartLinkServerActionClickedEvent: () => {}
|
|
216
|
-
},
|
|
217
|
-
operational: {
|
|
218
|
-
invokeSucceededEvent: () => {},
|
|
219
|
-
invokeFailedEvent: () => {}
|
|
220
|
-
},
|
|
221
|
-
track: {
|
|
222
|
-
smartLinkQuickActionFailed: () => {},
|
|
223
|
-
smartLinkQuickActionStarted: () => {},
|
|
224
|
-
smartLinkQuickActionSuccess: () => {}
|
|
225
|
-
},
|
|
226
|
-
screen: {
|
|
227
|
-
modalViewedEvent: () => {}
|
|
228
|
-
}
|
|
229
|
-
};
|
|
207
|
+
export const waitFor = (time = 1) => new Promise(res => setTimeout(res, time));
|
|
@@ -19,7 +19,6 @@ export const BlockCard = ({
|
|
|
19
19
|
onResolve,
|
|
20
20
|
onError,
|
|
21
21
|
testId,
|
|
22
|
-
analytics,
|
|
23
22
|
actionOptions
|
|
24
23
|
}) => {
|
|
25
24
|
const {
|
|
@@ -34,8 +33,7 @@ export const BlockCard = ({
|
|
|
34
33
|
onError,
|
|
35
34
|
onResolve,
|
|
36
35
|
renderers,
|
|
37
|
-
actionOptions
|
|
38
|
-
analytics
|
|
36
|
+
actionOptions
|
|
39
37
|
};
|
|
40
38
|
switch (status) {
|
|
41
39
|
case 'pending':
|
|
@@ -19,8 +19,7 @@ const ResolvedView = ({
|
|
|
19
19
|
onResolve,
|
|
20
20
|
actionOptions,
|
|
21
21
|
testId = 'smart-block-resolved-view',
|
|
22
|
-
url
|
|
23
|
-
analytics
|
|
22
|
+
url
|
|
24
23
|
}) => {
|
|
25
24
|
const [isPreviewBlockErrored, setIsPreviewBlockErrored] = useState(false);
|
|
26
25
|
useEffect(() => {
|
|
@@ -42,7 +41,6 @@ const ResolvedView = ({
|
|
|
42
41
|
hideIcon: true
|
|
43
42
|
}], []);
|
|
44
43
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
45
|
-
analytics: analytics,
|
|
46
44
|
appearance: "block",
|
|
47
45
|
cardState: cardState,
|
|
48
46
|
onClick: onClick,
|
|
@@ -35,7 +35,6 @@ const UnauthorisedView = ({
|
|
|
35
35
|
}) => {
|
|
36
36
|
var _cardState$details, _extractProvider;
|
|
37
37
|
const {
|
|
38
|
-
analytics,
|
|
39
38
|
cardState,
|
|
40
39
|
onAuthorize
|
|
41
40
|
} = props;
|
|
@@ -54,13 +53,12 @@ const UnauthorisedView = ({
|
|
|
54
53
|
const content = useMemo(() => onAuthorize ? jsx(UnauthorisedViewContent, {
|
|
55
54
|
providerName: providerName,
|
|
56
55
|
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
57
|
-
analytics: analytics,
|
|
58
56
|
testId: testId
|
|
59
57
|
}) : jsx(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
|
|
60
58
|
values: {
|
|
61
59
|
context: providerName
|
|
62
60
|
}
|
|
63
|
-
})), [
|
|
61
|
+
})), [isProductIntegrationSupported, onAuthorize, providerName, testId]);
|
|
64
62
|
const actions = useMemo(() => onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [], [handleAuthorize, onAuthorize, providerName]);
|
|
65
63
|
return jsx(UnresolvedView, _extends({}, props, {
|
|
66
64
|
actions: actions,
|