@atlaskit/smart-card 26.2.1 → 26.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/extractors/block/index.js +5 -4
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +4 -2
- package/dist/cjs/messages.js +6 -0
- package/dist/cjs/state/actions/index.js +27 -11
- package/dist/cjs/state/hooks/use-invoke/index.js +8 -28
- package/dist/cjs/state/hooks/use-resolve/index.js +28 -12
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +47 -0
- package/dist/cjs/utils/analytics/analytics.js +13 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +4 -2
- package/dist/cjs/view/BlockCard/index.js +3 -1
- package/dist/cjs/view/CardWithUrl/component.js +13 -3
- package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +7 -1
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/index.js +38 -30
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js +31 -0
- package/dist/cjs/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +21 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +26 -3
- package/dist/es2019/extractors/block/index.js +5 -4
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +4 -2
- package/dist/es2019/messages.js +6 -0
- package/dist/es2019/state/actions/index.js +32 -12
- package/dist/es2019/state/hooks/use-invoke/index.js +4 -23
- package/dist/es2019/state/hooks/use-resolve/index.js +28 -12
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +35 -0
- package/dist/es2019/utils/analytics/analytics.js +10 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/PreviewAction.js +17 -13
- package/dist/es2019/view/BlockCard/index.js +3 -1
- package/dist/es2019/view/CardWithUrl/component.js +9 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +7 -1
- package/dist/es2019/view/FlexibleCard/components/actions/utils.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/index.js +14 -6
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js +21 -0
- package/dist/es2019/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js +1 -0
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +21 -2
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +36 -11
- package/dist/esm/extractors/block/index.js +5 -4
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +4 -2
- package/dist/esm/messages.js +6 -0
- package/dist/esm/state/actions/index.js +27 -11
- package/dist/esm/state/hooks/use-invoke/index.js +8 -28
- package/dist/esm/state/hooks/use-resolve/index.js +28 -12
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +36 -0
- package/dist/esm/utils/analytics/analytics.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +4 -2
- package/dist/esm/view/BlockCard/index.js +3 -1
- package/dist/esm/view/CardWithUrl/component.js +11 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +7 -1
- package/dist/esm/view/FlexibleCard/components/actions/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/index.js +38 -30
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.js +21 -0
- package/dist/esm/view/FlexibleCard/components/common/lozenge-action/lozenge-action-error/styled.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +21 -2
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +26 -3
- package/dist/types/extractors/block/index.d.ts +2 -2
- package/dist/types/extractors/block/types.d.ts +1 -0
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -3
- package/dist/types/state/flexible-ui-context/index.d.ts +10 -6
- package/dist/types/state/hooks/use-invoke/index.d.ts +1 -7
- package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +9 -0
- package/dist/types/utils/analytics/analytics.d.ts +11 -3
- package/dist/types/utils/mocks.d.ts +5 -3
- package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +2 -1
- package/dist/types/view/BlockCard/views/ResolvedView.d.ts +2 -0
- package/dist/types/view/CardWithUrl/component.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.d.ts +21 -0
- package/dist/types/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/block/index.d.ts +2 -2
- package/dist/types-ts4.5/extractors/block/types.d.ts +1 -0
- package/dist/types-ts4.5/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -3
- package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +10 -6
- package/dist/types-ts4.5/state/hooks/use-invoke/index.d.ts +1 -7
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +5 -3
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +9 -0
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +11 -3
- package/dist/types-ts4.5/utils/mocks.d.ts +5 -3
- package/dist/types-ts4.5/view/BlockCard/actions/PreviewAction.d.ts +2 -1
- package/dist/types-ts4.5/view/BlockCard/views/ResolvedView.d.ts +2 -0
- package/dist/types-ts4.5/view/CardWithUrl/component.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.d.ts +21 -0
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/index.d.ts +1 -1
- package/package.json +11 -3
- package/report.api.md +21 -3
- package/tmp/api-report-tmp.d.ts +21 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
type SmartLinkAnalyticsContextProps = {
|
|
4
|
+
url: string;
|
|
5
|
+
appearance: CardInnerAppearance;
|
|
6
|
+
id: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const SmartLinkAnalyticsContext: FC<SmartLinkAnalyticsContextProps>;
|
|
9
|
+
export {};
|
|
@@ -9,6 +9,14 @@ export declare const context: {
|
|
|
9
9
|
packageName: any;
|
|
10
10
|
packageVersion: any;
|
|
11
11
|
};
|
|
12
|
+
export declare enum TrackQuickActionType {
|
|
13
|
+
StatusUpdate = "StatusUpdate"
|
|
14
|
+
}
|
|
15
|
+
export declare enum TrackQuickActionFailureReason {
|
|
16
|
+
PermissionError = "PermissionError",
|
|
17
|
+
ValidationError = "ValidationError",
|
|
18
|
+
UnknownError = "UnknownError"
|
|
19
|
+
}
|
|
12
20
|
export declare class SmartLinkEvents {
|
|
13
21
|
insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
14
22
|
}
|
|
@@ -25,13 +33,13 @@ export declare const trackLinkUpdated: ({ actionSubjectId, ...attributes }: Comm
|
|
|
25
33
|
[key: string]: any;
|
|
26
34
|
}) => AnalyticsPayload;
|
|
27
35
|
export declare const trackSmartLinkQuickActionStarted: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
28
|
-
smartLinkActionType: SmartLinkActionType;
|
|
36
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
29
37
|
}) => AnalyticsPayload;
|
|
30
38
|
export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
31
|
-
smartLinkActionType: SmartLinkActionType;
|
|
39
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
32
40
|
}) => AnalyticsPayload;
|
|
33
41
|
export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
34
|
-
smartLinkActionType: SmartLinkActionType;
|
|
42
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
35
43
|
}) => AnalyticsPayload;
|
|
36
44
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
37
45
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
@@ -79,13 +79,15 @@ export declare const mockAnalytics: {
|
|
|
79
79
|
[key: string]: any;
|
|
80
80
|
}) => void;
|
|
81
81
|
smartLinkQuickActionStarted: (props: {
|
|
82
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
82
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
83
83
|
}) => void;
|
|
84
84
|
smartLinkQuickActionSuccess: (props: {
|
|
85
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
85
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
86
86
|
}) => void;
|
|
87
87
|
smartLinkQuickActionFailed: (props: {
|
|
88
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
88
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
89
|
+
reason?: import("./analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
90
|
+
step?: string | undefined;
|
|
89
91
|
}) => void;
|
|
90
92
|
};
|
|
91
93
|
screen: {
|
|
@@ -26,6 +26,7 @@ type PreviewInfo = {
|
|
|
26
26
|
analytics: AnalyticsFacade;
|
|
27
27
|
origin?: AnalyticsOrigin;
|
|
28
28
|
isSupportTheming?: boolean;
|
|
29
|
+
enableImprovedPreviewAction?: boolean;
|
|
29
30
|
};
|
|
30
|
-
declare const _default: ({ details, ...rest }: PreviewInfo) => ActionProps;
|
|
31
|
+
declare const _default: ({ details, enableImprovedPreviewAction, ...rest }: PreviewInfo) => ActionProps;
|
|
31
32
|
export default _default;
|
|
@@ -30,6 +30,8 @@ export interface ResolvedViewProps {
|
|
|
30
30
|
isTrusted?: boolean;
|
|
31
31
|
/** It determines whether a link source supports different design theme modes */
|
|
32
32
|
isSupportTheming?: boolean;
|
|
33
|
+
/** Determines whether a preview action's text should display 'Open preview' or 'Full screen view' */
|
|
34
|
+
enableImprovedPreviewAction?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare const blockCardResolvedViewClassName = "block-card-resolved-view";
|
|
35
37
|
export declare const blockCardResolvedViewByClassName = "block-card-resolved-view-by";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardWithUrlContentProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const CardWithUrlContent: (props: CardWithUrlContentProps) => JSX.Element;
|
package/dist/types/view/FlexibleCard/components/common/lozenge-action/lozenge-action-analytics.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../utils/analytics/analytics';
|
|
2
|
+
export declare const unknownLoadErrorAnalyticsPayload: {
|
|
3
|
+
smartLinkActionType: TrackQuickActionType;
|
|
4
|
+
reason: TrackQuickActionFailureReason;
|
|
5
|
+
step: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const permissionLoadErrorAnalyticsPayload: {
|
|
8
|
+
smartLinkActionType: TrackQuickActionType;
|
|
9
|
+
reason: TrackQuickActionFailureReason;
|
|
10
|
+
step: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const unknownUpdateErrorAnalyticsPayload: {
|
|
13
|
+
smartLinkActionType: TrackQuickActionType;
|
|
14
|
+
reason: TrackQuickActionFailureReason;
|
|
15
|
+
step: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const validationUpdateErrorAnalyticsPayload: {
|
|
18
|
+
smartLinkActionType: TrackQuickActionType;
|
|
19
|
+
reason: TrackQuickActionFailureReason;
|
|
20
|
+
step: string;
|
|
21
|
+
};
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
3
3
|
import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
4
4
|
import { HoverCardResolvedProps } from './types';
|
|
5
|
-
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined) => ActionItem[];
|
|
5
|
+
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined, enableImprovedPreviewAction?: boolean) => ActionItem[];
|
|
6
6
|
declare const HoverCardResolvedView: React.FC<HoverCardResolvedProps>;
|
|
7
7
|
export default HoverCardResolvedView;
|
|
@@ -5,6 +5,6 @@ import { ExtractBlockOpts } from './types';
|
|
|
5
5
|
import { CardPlatform } from '../../view/Card';
|
|
6
6
|
import { BlockCardResolvedViewProps } from '../../view/BlockCard';
|
|
7
7
|
import { ActionProps } from '../../view/BlockCard/components/Action';
|
|
8
|
-
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts, platform?: CardPlatform, meta?: JsonLd.Meta.BaseMeta) => ActionProps[];
|
|
8
|
+
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts, platform?: CardPlatform, meta?: JsonLd.Meta.BaseMeta, enableImprovedPreviewAction?: boolean) => ActionProps[];
|
|
9
9
|
export declare const extractBlockUsers: (jsonLd: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
|
|
10
|
-
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta, opts?: ExtractBlockOpts, renderers?: CardProviderRenderers, platform?: CardPlatform) => BlockCardResolvedViewProps;
|
|
10
|
+
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta, opts?: ExtractBlockOpts, renderers?: CardProviderRenderers, platform?: CardPlatform, enableImprovedPreviewAction?: boolean) => BlockCardResolvedViewProps;
|
|
@@ -2,7 +2,7 @@ import { JsonLd } from 'json-ld-types';
|
|
|
2
2
|
import { CardPlatform } from '../../../view/Card/types';
|
|
3
3
|
import { BlockCardResolvedViewProps } from '../../../view/BlockCard';
|
|
4
4
|
import { ExtractBlockOpts } from '../../block/types';
|
|
5
|
-
export declare const extractPreviewAction: ({ extensionKey, viewProps, jsonLd, handleInvoke, testId, platform, origin, source, analytics, meta, }: ExtractBlockOpts & {
|
|
5
|
+
export declare const extractPreviewAction: ({ extensionKey, viewProps, jsonLd, handleInvoke, testId, platform, origin, source, analytics, meta, enableImprovedPreviewAction, }: ExtractBlockOpts & {
|
|
6
6
|
viewProps: BlockCardResolvedViewProps;
|
|
7
7
|
jsonLd: JsonLd.Data.BaseData;
|
|
8
8
|
platform?: JsonLd.Primitives.Platforms | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export type MessageKey = 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnalyticsHandler, AnalyticsName, AnalyticsPayload } from '../../utils/types';
|
|
2
2
|
import { CommonEventProps, ConnectFailedEventProps, ConnectSucceededEventProps, InstrumentEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiIframeDwelledEventProps, UiIframeFocusedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps } from '../../utils/analytics/types';
|
|
3
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../utils/analytics/analytics';
|
|
3
4
|
import { SmartLinkActionType } from '@atlaskit/linking-types';
|
|
4
5
|
/**
|
|
5
6
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
@@ -249,19 +250,21 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
|
|
|
249
250
|
* This fires a tracking event before an action invoke api call is made
|
|
250
251
|
*/
|
|
251
252
|
smartLinkQuickActionStarted: (props: {
|
|
252
|
-
smartLinkActionType: SmartLinkActionType;
|
|
253
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
253
254
|
}) => void;
|
|
254
255
|
/**
|
|
255
256
|
* This fires a tracking event after an action invoke api call is successful
|
|
256
257
|
*/
|
|
257
258
|
smartLinkQuickActionSuccess: (props: {
|
|
258
|
-
smartLinkActionType: SmartLinkActionType;
|
|
259
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
259
260
|
}) => void;
|
|
260
261
|
/**
|
|
261
262
|
* This fires a tracking event after an action invoke api call has failed
|
|
262
263
|
*/
|
|
263
264
|
smartLinkQuickActionFailed: (props: {
|
|
264
|
-
smartLinkActionType: SmartLinkActionType;
|
|
265
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
266
|
+
reason?: TrackQuickActionFailureReason;
|
|
267
|
+
step?: string;
|
|
265
268
|
}) => void;
|
|
266
269
|
};
|
|
267
270
|
screen: {
|
|
@@ -51,13 +51,15 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
|
|
|
51
51
|
[key: string]: any;
|
|
52
52
|
}) => void;
|
|
53
53
|
smartLinkQuickActionStarted: (props: {
|
|
54
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
54
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
55
55
|
}) => void;
|
|
56
56
|
smartLinkQuickActionSuccess: (props: {
|
|
57
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
57
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
58
58
|
}) => void;
|
|
59
59
|
smartLinkQuickActionFailed: (props: {
|
|
60
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
60
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
61
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
62
|
+
step?: string | undefined;
|
|
61
63
|
}) => void;
|
|
62
64
|
};
|
|
63
65
|
screen: {
|
|
@@ -107,13 +109,15 @@ export declare const useFlexibleUiAnalyticsContext: () => {
|
|
|
107
109
|
[key: string]: any;
|
|
108
110
|
}) => void;
|
|
109
111
|
smartLinkQuickActionStarted: (props: {
|
|
110
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
112
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
111
113
|
}) => void;
|
|
112
114
|
smartLinkQuickActionSuccess: (props: {
|
|
113
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
115
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
114
116
|
}) => void;
|
|
115
117
|
smartLinkQuickActionFailed: (props: {
|
|
116
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
118
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
119
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
120
|
+
step?: string | undefined;
|
|
117
121
|
}) => void;
|
|
118
122
|
};
|
|
119
123
|
screen: {
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { InvokeRequest } from '@atlaskit/linking-types/smart-link-actions';
|
|
2
|
-
|
|
3
|
-
type InvokeRequestTracker = {
|
|
4
|
-
started?: AnalyticsFacade['track']['smartLinkQuickActionStarted'];
|
|
5
|
-
success?: AnalyticsFacade['track']['smartLinkQuickActionSuccess'];
|
|
6
|
-
failed?: AnalyticsFacade['track']['smartLinkQuickActionFailed'];
|
|
7
|
-
};
|
|
8
|
-
declare const useInvoke: ({ failed, started, success }?: InvokeRequestTracker) => (req: InvokeRequest, cb?: Function) => Promise<any>;
|
|
2
|
+
declare const useInvoke: () => (req: InvokeRequest, cb?: Function) => Promise<any>;
|
|
9
3
|
export default useInvoke;
|
|
@@ -54,13 +54,15 @@ dispatchAnalytics?: AnalyticsHandler): {
|
|
|
54
54
|
[key: string]: any;
|
|
55
55
|
}) => void;
|
|
56
56
|
smartLinkQuickActionStarted: (props: {
|
|
57
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
57
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
58
58
|
}) => void;
|
|
59
59
|
smartLinkQuickActionSuccess: (props: {
|
|
60
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
60
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
61
61
|
}) => void;
|
|
62
62
|
smartLinkQuickActionFailed: (props: {
|
|
63
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
63
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../utils/analytics/analytics").TrackQuickActionType;
|
|
64
|
+
reason?: import("../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
65
|
+
step?: string | undefined;
|
|
64
66
|
}) => void;
|
|
65
67
|
};
|
|
66
68
|
screen: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
type SmartLinkAnalyticsContextProps = {
|
|
4
|
+
url: string;
|
|
5
|
+
appearance: CardInnerAppearance;
|
|
6
|
+
id: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const SmartLinkAnalyticsContext: FC<SmartLinkAnalyticsContextProps>;
|
|
9
|
+
export {};
|
|
@@ -9,6 +9,14 @@ export declare const context: {
|
|
|
9
9
|
packageName: any;
|
|
10
10
|
packageVersion: any;
|
|
11
11
|
};
|
|
12
|
+
export declare enum TrackQuickActionType {
|
|
13
|
+
StatusUpdate = "StatusUpdate"
|
|
14
|
+
}
|
|
15
|
+
export declare enum TrackQuickActionFailureReason {
|
|
16
|
+
PermissionError = "PermissionError",
|
|
17
|
+
ValidationError = "ValidationError",
|
|
18
|
+
UnknownError = "UnknownError"
|
|
19
|
+
}
|
|
12
20
|
export declare class SmartLinkEvents {
|
|
13
21
|
insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
14
22
|
}
|
|
@@ -25,13 +33,13 @@ export declare const trackLinkUpdated: ({ actionSubjectId, ...attributes }: Comm
|
|
|
25
33
|
[key: string]: any;
|
|
26
34
|
}) => AnalyticsPayload;
|
|
27
35
|
export declare const trackSmartLinkQuickActionStarted: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
28
|
-
smartLinkActionType: SmartLinkActionType;
|
|
36
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
29
37
|
}) => AnalyticsPayload;
|
|
30
38
|
export declare const trackSmartLinkQuickActionSuccess: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
31
|
-
smartLinkActionType: SmartLinkActionType;
|
|
39
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
32
40
|
}) => AnalyticsPayload;
|
|
33
41
|
export declare const trackSmartLinkQuickActionFailed: ({ smartLinkActionType, ...attributes }: CommonEventProps & {
|
|
34
|
-
smartLinkActionType: SmartLinkActionType;
|
|
42
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
35
43
|
}) => AnalyticsPayload;
|
|
36
44
|
export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
|
|
37
45
|
export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
|
|
@@ -79,13 +79,15 @@ export declare const mockAnalytics: {
|
|
|
79
79
|
[key: string]: any;
|
|
80
80
|
}) => void;
|
|
81
81
|
smartLinkQuickActionStarted: (props: {
|
|
82
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
82
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
83
83
|
}) => void;
|
|
84
84
|
smartLinkQuickActionSuccess: (props: {
|
|
85
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
85
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
86
86
|
}) => void;
|
|
87
87
|
smartLinkQuickActionFailed: (props: {
|
|
88
|
-
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType;
|
|
88
|
+
smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("./analytics/analytics").TrackQuickActionType;
|
|
89
|
+
reason?: import("./analytics/analytics").TrackQuickActionFailureReason | undefined;
|
|
90
|
+
step?: string | undefined;
|
|
89
91
|
}) => void;
|
|
90
92
|
};
|
|
91
93
|
screen: {
|
|
@@ -26,6 +26,7 @@ type PreviewInfo = {
|
|
|
26
26
|
analytics: AnalyticsFacade;
|
|
27
27
|
origin?: AnalyticsOrigin;
|
|
28
28
|
isSupportTheming?: boolean;
|
|
29
|
+
enableImprovedPreviewAction?: boolean;
|
|
29
30
|
};
|
|
30
|
-
declare const _default: ({ details, ...rest }: PreviewInfo) => ActionProps;
|
|
31
|
+
declare const _default: ({ details, enableImprovedPreviewAction, ...rest }: PreviewInfo) => ActionProps;
|
|
31
32
|
export default _default;
|
|
@@ -30,6 +30,8 @@ export interface ResolvedViewProps {
|
|
|
30
30
|
isTrusted?: boolean;
|
|
31
31
|
/** It determines whether a link source supports different design theme modes */
|
|
32
32
|
isSupportTheming?: boolean;
|
|
33
|
+
/** Determines whether a preview action's text should display 'Open preview' or 'Full screen view' */
|
|
34
|
+
enableImprovedPreviewAction?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare const blockCardResolvedViewClassName = "block-card-resolved-view";
|
|
35
37
|
export declare const blockCardResolvedViewByClassName = "block-card-resolved-view-by";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardWithUrlContentProps } from './types';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const CardWithUrlContent: (props: CardWithUrlContentProps) => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../utils/analytics/analytics';
|
|
2
|
+
export declare const unknownLoadErrorAnalyticsPayload: {
|
|
3
|
+
smartLinkActionType: TrackQuickActionType;
|
|
4
|
+
reason: TrackQuickActionFailureReason;
|
|
5
|
+
step: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const permissionLoadErrorAnalyticsPayload: {
|
|
8
|
+
smartLinkActionType: TrackQuickActionType;
|
|
9
|
+
reason: TrackQuickActionFailureReason;
|
|
10
|
+
step: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const unknownUpdateErrorAnalyticsPayload: {
|
|
13
|
+
smartLinkActionType: TrackQuickActionType;
|
|
14
|
+
reason: TrackQuickActionFailureReason;
|
|
15
|
+
step: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const validationUpdateErrorAnalyticsPayload: {
|
|
18
|
+
smartLinkActionType: TrackQuickActionType;
|
|
19
|
+
reason: TrackQuickActionFailureReason;
|
|
20
|
+
step: string;
|
|
21
|
+
};
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
3
3
|
import { LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
4
4
|
import { HoverCardResolvedProps } from './types';
|
|
5
|
-
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined) => ActionItem[];
|
|
5
|
+
export declare const toFooterActions: (cardActions: LinkAction[], onActionClick?: ((actionId: string) => void) | undefined, enableImprovedPreviewAction?: boolean) => ActionItem[];
|
|
6
6
|
declare const HoverCardResolvedView: React.FC<HoverCardResolvedProps>;
|
|
7
7
|
export default HoverCardResolvedView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -41,14 +41,16 @@
|
|
|
41
41
|
"@atlaskit/icon-object": "^6.3.0",
|
|
42
42
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
43
43
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
44
|
+
"@atlaskit/link-analytics": "^8.0.2",
|
|
44
45
|
"@atlaskit/link-client-extension": "^1.1.0",
|
|
45
|
-
"@atlaskit/linking-common": "^2.
|
|
46
|
+
"@atlaskit/linking-common": "^2.12.0",
|
|
46
47
|
"@atlaskit/linking-types": "^1.6.0",
|
|
47
48
|
"@atlaskit/logo": "^13.14.0",
|
|
48
49
|
"@atlaskit/lozenge": "^11.4.0",
|
|
49
50
|
"@atlaskit/media-common": "^4.1.0",
|
|
50
51
|
"@atlaskit/modal-dialog": "^12.5.0",
|
|
51
52
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
53
|
+
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
52
54
|
"@atlaskit/popup": "^1.6.0",
|
|
53
55
|
"@atlaskit/spinner": "^15.5.0",
|
|
54
56
|
"@atlaskit/theme": "^12.5.0",
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
"@atlaskit/field-base": "^15.2.0",
|
|
84
86
|
"@atlaskit/form": "^8.11.0",
|
|
85
87
|
"@atlaskit/inline-message": "^11.5.0",
|
|
86
|
-
"@atlaskit/link-test-helpers": "^2.
|
|
88
|
+
"@atlaskit/link-test-helpers": "^2.4.0",
|
|
87
89
|
"@atlaskit/lozenge": "^11.4.0",
|
|
88
90
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
89
91
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
"@atlaskit/toggle": "^12.6.0",
|
|
100
102
|
"@atlaskit/visual-regression": "*",
|
|
101
103
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
104
|
+
"@atlassian/feature-flags-test-utils": "^0.1.1",
|
|
102
105
|
"@testing-library/dom": "^8.17.1",
|
|
103
106
|
"@testing-library/jest-dom": "^5.16.5",
|
|
104
107
|
"@testing-library/react": "^12.1.5",
|
|
@@ -135,6 +138,11 @@
|
|
|
135
138
|
"./link-url": "./src/linkUrl.ts",
|
|
136
139
|
".": "./src/index.ts"
|
|
137
140
|
},
|
|
141
|
+
"platform-feature-flags": {
|
|
142
|
+
"platform.linking-platform.smart-card.enable-analytics-context": {
|
|
143
|
+
"type": "boolean"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
138
146
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
139
147
|
"techstack": {
|
|
140
148
|
"@repo/internal": {
|
package/report.api.md
CHANGED
|
@@ -894,6 +894,22 @@ type TitleBlockProps = {
|
|
|
894
894
|
// @public (undocumented)
|
|
895
895
|
type TrackAppAccountConnectedProps = CommonEventProps;
|
|
896
896
|
|
|
897
|
+
// @public (undocumented)
|
|
898
|
+
enum TrackQuickActionFailureReason {
|
|
899
|
+
// (undocumented)
|
|
900
|
+
PermissionError = 'PermissionError',
|
|
901
|
+
// (undocumented)
|
|
902
|
+
UnknownError = 'UnknownError',
|
|
903
|
+
// (undocumented)
|
|
904
|
+
ValidationError = 'ValidationError',
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// @public (undocumented)
|
|
908
|
+
enum TrackQuickActionType {
|
|
909
|
+
// (undocumented)
|
|
910
|
+
StatusUpdate = 'StatusUpdate',
|
|
911
|
+
}
|
|
912
|
+
|
|
897
913
|
// @public (undocumented)
|
|
898
914
|
type UiActionClickedEventProps = CommonEventProps & {
|
|
899
915
|
id: string;
|
|
@@ -1214,13 +1230,15 @@ export const useSmartLinkAnalytics: (
|
|
|
1214
1230
|
},
|
|
1215
1231
|
) => void;
|
|
1216
1232
|
smartLinkQuickActionStarted: (props: {
|
|
1217
|
-
smartLinkActionType: SmartLinkActionType;
|
|
1233
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
1218
1234
|
}) => void;
|
|
1219
1235
|
smartLinkQuickActionSuccess: (props: {
|
|
1220
|
-
smartLinkActionType: SmartLinkActionType;
|
|
1236
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
1221
1237
|
}) => void;
|
|
1222
1238
|
smartLinkQuickActionFailed: (props: {
|
|
1223
|
-
smartLinkActionType: SmartLinkActionType;
|
|
1239
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
1240
|
+
reason?: TrackQuickActionFailureReason;
|
|
1241
|
+
step?: string;
|
|
1224
1242
|
}) => void;
|
|
1225
1243
|
};
|
|
1226
1244
|
screen: {
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -751,6 +751,22 @@ type TitleBlockProps = {
|
|
|
751
751
|
// @public (undocumented)
|
|
752
752
|
type TrackAppAccountConnectedProps = CommonEventProps;
|
|
753
753
|
|
|
754
|
+
// @public (undocumented)
|
|
755
|
+
enum TrackQuickActionFailureReason {
|
|
756
|
+
// (undocumented)
|
|
757
|
+
PermissionError = "PermissionError",
|
|
758
|
+
// (undocumented)
|
|
759
|
+
UnknownError = "UnknownError",
|
|
760
|
+
// (undocumented)
|
|
761
|
+
ValidationError = "ValidationError"
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
// @public (undocumented)
|
|
765
|
+
enum TrackQuickActionType {
|
|
766
|
+
// (undocumented)
|
|
767
|
+
StatusUpdate = "StatusUpdate"
|
|
768
|
+
}
|
|
769
|
+
|
|
754
770
|
// @public (undocumented)
|
|
755
771
|
type UiActionClickedEventProps = CommonEventProps & {
|
|
756
772
|
id: string;
|
|
@@ -874,13 +890,15 @@ export const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: Analytics
|
|
|
874
890
|
[key: string]: any;
|
|
875
891
|
}) => void;
|
|
876
892
|
smartLinkQuickActionStarted: (props: {
|
|
877
|
-
smartLinkActionType: SmartLinkActionType;
|
|
893
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
878
894
|
}) => void;
|
|
879
895
|
smartLinkQuickActionSuccess: (props: {
|
|
880
|
-
smartLinkActionType: SmartLinkActionType;
|
|
896
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
881
897
|
}) => void;
|
|
882
898
|
smartLinkQuickActionFailed: (props: {
|
|
883
|
-
smartLinkActionType: SmartLinkActionType;
|
|
899
|
+
smartLinkActionType: SmartLinkActionType | TrackQuickActionType;
|
|
900
|
+
reason?: TrackQuickActionFailureReason;
|
|
901
|
+
step?: string;
|
|
884
902
|
}) => void;
|
|
885
903
|
};
|
|
886
904
|
screen: {
|