@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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type PreviewActionData } from '../../../../../../../state/flexible-ui-context/types';
|
|
2
1
|
import { type InvokeClientActionProps } from '../../../../../../../state/hooks/use-invoke-client-action/types';
|
|
3
2
|
import { type MessageProps } from '../../../../types';
|
|
4
3
|
export type LozengeActionErrorProps = {
|
|
@@ -22,11 +21,6 @@ export type LozengeActionErrorProps = {
|
|
|
22
21
|
* The url of the link. Used in reload functionality
|
|
23
22
|
*/
|
|
24
23
|
url?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Preview Modal information. If present, will be used to render an embed modal on an error link click
|
|
27
|
-
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
28
|
-
*/
|
|
29
|
-
previewData?: PreviewActionData | null;
|
|
30
24
|
};
|
|
31
25
|
export declare const LozengeActionErrorMessages: {
|
|
32
26
|
noData: {
|
|
@@ -4,8 +4,6 @@ import { type IntlShape, type MessageDescriptor } from 'react-intl-next';
|
|
|
4
4
|
import { type Spacing } from '@atlaskit/button';
|
|
5
5
|
import type { Space } from '@atlaskit/primitives';
|
|
6
6
|
import { SmartLinkSize } from '../../../constants';
|
|
7
|
-
import { type PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
8
|
-
import { type EmbedModalProps } from '../../EmbedModal/types';
|
|
9
7
|
import { type MessageProps } from './types';
|
|
10
8
|
export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
|
|
11
9
|
export declare const getFormattedMessage: (message?: MessageProps) => JSX.Element | undefined;
|
|
@@ -29,7 +27,3 @@ export declare const getPrimitivesInlineSpaceBySize: (size: SmartLinkSize) => Sp
|
|
|
29
27
|
export declare const getPrimitivesPaddingSpaceBySize: (size: SmartLinkSize) => Space;
|
|
30
28
|
export declare const getTruncateStyles: (maxLines: number, lineHeight?: string, wordBreak?: 'break-word' | 'break-all') => SerializedStyles;
|
|
31
29
|
export declare const hasWhiteSpace: (str: string) => boolean;
|
|
32
|
-
/**
|
|
33
|
-
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
34
|
-
*/
|
|
35
|
-
export declare const openEmbedModalWithFlexibleUiIcon: ({ linkIcon, ...props }: Partial<EmbedModalProps> & Pick<PreviewActionData, 'linkIcon'>) => Promise<void>;
|
|
@@ -6,5 +6,5 @@ import { type FlexibleCardProps } from './types';
|
|
|
6
6
|
* Note: TitleBlock is mandatory for a Flexible Card to render.
|
|
7
7
|
* @see Container
|
|
8
8
|
*/
|
|
9
|
-
declare const FlexibleCard: ({
|
|
9
|
+
declare const FlexibleCard: ({ appearance, cardState, children, id, onAuthorize, onClick, onError, onResolve, origin, renderers, showHoverPreview, hoverPreviewOptions, actionOptions, testId, ui, url, }: FlexibleCardProps) => JSX.Element;
|
|
10
10
|
export default FlexibleCard;
|
|
@@ -5,7 +5,6 @@ import { type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
|
5
5
|
import { type CardState, type LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
|
|
6
6
|
import { type FireEventFunction } from '../../common/analytics/types';
|
|
7
7
|
import { type SmartLinkSize, type SmartLinkStatus, type SmartLinkTheme } from '../../constants';
|
|
8
|
-
import { type AnalyticsFacade } from '../../state/analytics';
|
|
9
8
|
import { type AISummaryConfig } from '../../state/hooks/use-ai-summary-config/types';
|
|
10
9
|
import { type ResolveFunction } from '../../state/hooks/use-resolve';
|
|
11
10
|
import { type AnalyticsOrigin } from '../../utils/types';
|
|
@@ -17,11 +16,6 @@ export type FlexibleCardProps = {
|
|
|
17
16
|
* @internal A unique ID for a Smart Link.
|
|
18
17
|
*/
|
|
19
18
|
id?: string;
|
|
20
|
-
/**
|
|
21
|
-
* An analytics facade object which will be used to send analytics.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
analytics?: AnalyticsFacade;
|
|
25
19
|
/**
|
|
26
20
|
* Determines the appearance of the Smart Link.
|
|
27
21
|
* @internal
|
|
@@ -9,5 +9,5 @@ import { type PopupComponentProps } from '@atlaskit/popup';
|
|
|
9
9
|
* HoverCard border implementation is in ContentContainer where it can
|
|
10
10
|
* change between the default border and prism border during runtime.
|
|
11
11
|
*/
|
|
12
|
-
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "appearance" | "style" | "id" | "tabIndex" | "role" | "children" | "data-testid" | "
|
|
12
|
+
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "appearance" | "style" | "id" | "tabIndex" | "role" | "children" | "data-testid" | "xcss" | "shouldFitContainer" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export default CustomPopupContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type HoverCardContentProps } from '../types';
|
|
3
3
|
export declare const hoverCardClassName = "smart-links-hover-preview";
|
|
4
|
-
declare const HoverCardContent: ({ id,
|
|
4
|
+
declare const HoverCardContent: ({ id, cardState, onActionClick, onResolve, renderers, url, onMouseEnter, onMouseLeave, actionOptions, }: HoverCardContentProps) => jsx.JSX.Element | null;
|
|
5
5
|
export default HoverCardContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type HoverCardResolvedProps } from './types';
|
|
3
|
-
declare const HoverCardResolvedView: ({
|
|
3
|
+
declare const HoverCardResolvedView: ({ cardState, extensionKey, flexibleCardProps, isAISummaryEnabled, onActionClick, titleBlockProps, id, }: HoverCardResolvedProps) => JSX.Element;
|
|
4
4
|
export default HoverCardResolvedView;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { type CardState } from '@atlaskit/linking-common';
|
|
2
2
|
import type { ActionName } from '../../../../../constants';
|
|
3
|
-
import { type AnalyticsFacade } from '../../../../../state/analytics';
|
|
4
3
|
import { type LinkAction } from '../../../../../state/hooks-external/useSmartLinkActions';
|
|
5
4
|
import { type HoverCardLoadingViewProps } from '../resolving/types';
|
|
6
5
|
export type HoverCardResolvedProps = {
|
|
7
6
|
extensionKey?: string;
|
|
8
7
|
id?: string;
|
|
9
8
|
url: string;
|
|
10
|
-
analytics: AnalyticsFacade;
|
|
11
9
|
cardActions?: LinkAction[];
|
|
12
10
|
cardState: CardState;
|
|
13
11
|
isAISummaryEnabled?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type HoverCardUnauthorisedProps } from './types';
|
|
3
|
-
declare const HoverCardUnauthorisedView: ({
|
|
3
|
+
declare const HoverCardUnauthorisedView: ({ id, flexibleCardProps, testId, url, }: HoverCardUnauthorisedProps) => JSX.Element;
|
|
4
4
|
export default HoverCardUnauthorisedView;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { type AnalyticsFacade } from '../../../../../state/analytics';
|
|
2
1
|
import { type FlexibleCardProps } from '../../../../FlexibleCard/types';
|
|
3
2
|
export type HoverCardUnauthorisedProps = {
|
|
4
|
-
/**
|
|
5
|
-
* An AnalyticsFacade object used for calling analytics.
|
|
6
|
-
*/
|
|
7
|
-
analytics: AnalyticsFacade;
|
|
8
3
|
/**
|
|
9
4
|
* Provides the extensionKey of a Smart Link resolver invoked.
|
|
10
5
|
*/
|
|
@@ -4,7 +4,6 @@ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
|
4
4
|
import { type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
5
5
|
import { type CardState } from '@atlaskit/linking-common';
|
|
6
6
|
import type { ActionName } from '../../constants';
|
|
7
|
-
import { type AnalyticsFacade } from '../../state/analytics';
|
|
8
7
|
import { type AnalyticsHandler } from '../../utils/types';
|
|
9
8
|
import type { CardActionOptions } from '../Card/types';
|
|
10
9
|
export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
@@ -63,13 +62,11 @@ export interface HoverCardInternalProps {
|
|
|
63
62
|
}
|
|
64
63
|
export interface HoverCardComponentProps extends HoverCardProps, HoverCardInternalProps {
|
|
65
64
|
analyticsHandler?: AnalyticsHandler;
|
|
66
|
-
analytics?: AnalyticsFacade;
|
|
67
65
|
canOpen?: boolean;
|
|
68
66
|
closeOnChildClick?: boolean;
|
|
69
67
|
}
|
|
70
68
|
export type HoverCardContentProps = {
|
|
71
69
|
id?: string;
|
|
72
|
-
analytics?: AnalyticsFacade;
|
|
73
70
|
cardState: CardState;
|
|
74
71
|
renderers?: CardProviderRenderers;
|
|
75
72
|
onActionClick: (actionId: string | ActionName) => void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type AnalyticsFacade } from '../../../state/analytics';
|
|
3
2
|
export interface InlineCardUnauthorizedViewProps {
|
|
4
3
|
/** The url to display */
|
|
5
4
|
url: string;
|
|
@@ -19,8 +18,6 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
19
18
|
showHoverPreview?: boolean;
|
|
20
19
|
/** A smart link id that may be used in analytics */
|
|
21
20
|
id?: string;
|
|
22
|
-
/** An AnalyticsFacade object used for calling analytics. */
|
|
23
|
-
analytics: AnalyticsFacade;
|
|
24
21
|
/** An identifier of the provider which will be executing the action. */
|
|
25
22
|
extensionKey?: string;
|
|
26
23
|
/** Truncates the card to one line */
|
|
@@ -6,4 +6,4 @@ import { InlineCardResolvingView } from './ResolvingView';
|
|
|
6
6
|
import { type InlineCardProps } from './types';
|
|
7
7
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
8
8
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
|
|
9
|
-
export declare const InlineCard: ({
|
|
9
|
+
export declare const InlineCard: ({ id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, }: InlineCardProps) => JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type EventHandler, type KeyboardEvent, type MouseEvent } from 'react';
|
|
2
2
|
import { type CardProviderRenderers } from '@atlaskit/link-provider';
|
|
3
|
-
import { type AnalyticsFacade } from '../../state/analytics';
|
|
4
3
|
import { type CardState } from '../../state/types';
|
|
5
4
|
import type { CardActionOptions } from '../Card/types';
|
|
6
5
|
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
@@ -24,7 +23,6 @@ export type InlineCardProps = {
|
|
|
24
23
|
showHoverPreview?: boolean;
|
|
25
24
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
26
25
|
actionOptions?: CardActionOptions;
|
|
27
|
-
analytics: AnalyticsFacade;
|
|
28
26
|
removeTextHighlightingFromTitle?: boolean;
|
|
29
27
|
resolvingPlaceholder?: string;
|
|
30
28
|
truncateInline?: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type AnalyticsFacade } from '../../state/analytics';
|
|
3
2
|
type UnauthorisedViewContentProps = {
|
|
4
3
|
/**
|
|
5
4
|
* Is the name of the provider for the account that needs to be connected
|
|
@@ -17,11 +16,6 @@ type UnauthorisedViewContentProps = {
|
|
|
17
16
|
* serving as a hook for automated tests
|
|
18
17
|
*/
|
|
19
18
|
testId?: string;
|
|
20
|
-
/**
|
|
21
|
-
* An analytics facade object which will be used to send analytics.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
analytics?: AnalyticsFacade;
|
|
25
19
|
};
|
|
26
20
|
/**
|
|
27
21
|
* This component is used in unauthorized views of a smart link.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "33.
|
|
3
|
+
"version": "33.3.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -171,9 +171,6 @@
|
|
|
171
171
|
"smart_links_for_plans_platform": {
|
|
172
172
|
"type": "boolean"
|
|
173
173
|
},
|
|
174
|
-
"platform-smart-card-migrate-embed-modal-analytics": {
|
|
175
|
-
"type": "boolean"
|
|
176
|
-
},
|
|
177
174
|
"platform_editor_hyperlink_underline": {
|
|
178
175
|
"type": "boolean"
|
|
179
176
|
},
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractDownloadActionProps = void 0;
|
|
7
|
-
var _constants = require("../../constants");
|
|
8
|
-
var _utils = require("../../utils");
|
|
9
|
-
var _extractDownloadAction = require("../flexible/actions/extract-download-action");
|
|
10
|
-
/**
|
|
11
|
-
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
12
|
-
* Replace with platform/packages/linking-platform/smart-card/src/extractors/action/extract-invoke-download-action.ts
|
|
13
|
-
*/
|
|
14
|
-
var extractDownloadActionProps = exports.extractDownloadActionProps = function extractDownloadActionProps(_ref) {
|
|
15
|
-
var response = _ref.response,
|
|
16
|
-
actionOptions = _ref.actionOptions,
|
|
17
|
-
_ref$extensionKey = _ref.extensionKey,
|
|
18
|
-
extensionKey = _ref$extensionKey === void 0 ? 'empty-object-provider' : _ref$extensionKey,
|
|
19
|
-
_ref$source = _ref.source,
|
|
20
|
-
source = _ref$source === void 0 ? 'block' : _ref$source;
|
|
21
|
-
var data = (0, _extractDownloadAction.extractDownloadAction)(response.data, actionOptions);
|
|
22
|
-
if (data) {
|
|
23
|
-
return {
|
|
24
|
-
actionType: _constants.ActionName.DownloadAction,
|
|
25
|
-
actionFn: function actionFn() {
|
|
26
|
-
return (0, _utils.downloadUrl)(data.downloadUrl);
|
|
27
|
-
},
|
|
28
|
-
display: source,
|
|
29
|
-
extensionKey: extensionKey
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.extractPreviewActionProps = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _constants = require("../../constants");
|
|
10
|
-
var _utils = require("../../view/EmbedModal/utils");
|
|
11
|
-
var _extractPreviewAction = require("../flexible/actions/extract-preview-action");
|
|
12
|
-
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; }
|
|
13
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
14
|
-
/**
|
|
15
|
-
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
16
|
-
* Replaced with platform/packages/linking-platform/smart-card/src/extractors/action/extract-invoke-preview-action.ts
|
|
17
|
-
*/
|
|
18
|
-
var extractPreviewActionProps = exports.extractPreviewActionProps = function extractPreviewActionProps(_ref) {
|
|
19
|
-
var response = _ref.response,
|
|
20
|
-
analytics = _ref.analytics,
|
|
21
|
-
_ref$extensionKey = _ref.extensionKey,
|
|
22
|
-
extensionKey = _ref$extensionKey === void 0 ? 'empty-object-provider' : _ref$extensionKey,
|
|
23
|
-
_ref$source = _ref.source,
|
|
24
|
-
source = _ref$source === void 0 ? 'block' : _ref$source,
|
|
25
|
-
actionOptions = _ref.actionOptions,
|
|
26
|
-
origin = _ref.origin;
|
|
27
|
-
var data = (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions);
|
|
28
|
-
if (data !== null && data !== void 0 && data.src) {
|
|
29
|
-
return {
|
|
30
|
-
actionType: _constants.ActionName.PreviewAction,
|
|
31
|
-
actionFn: function actionFn() {
|
|
32
|
-
return (0, _utils.openEmbedModal)(_objectSpread({
|
|
33
|
-
download: data === null || data === void 0 ? void 0 : data.downloadUrl,
|
|
34
|
-
showModal: true,
|
|
35
|
-
onClose: function onClose() {},
|
|
36
|
-
analytics: analytics,
|
|
37
|
-
extensionKey: extensionKey,
|
|
38
|
-
origin: origin
|
|
39
|
-
}, data));
|
|
40
|
-
},
|
|
41
|
-
// These values have already been set in analytics context.
|
|
42
|
-
// We only pass these here for ufo experience.
|
|
43
|
-
display: source,
|
|
44
|
-
extensionKey: extensionKey
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractViewActionProps = void 0;
|
|
7
|
-
var _utils = require("../../utils");
|
|
8
|
-
var _extractViewAction = require("../flexible/actions/extract-view-action");
|
|
9
|
-
/**
|
|
10
|
-
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
11
|
-
* Replace with platform/packages/linking-platform/smart-card/src/extractors/action/extract-invoke-view-action.ts
|
|
12
|
-
*/
|
|
13
|
-
var extractViewActionProps = exports.extractViewActionProps = function extractViewActionProps(_ref) {
|
|
14
|
-
var response = _ref.response,
|
|
15
|
-
actionOptions = _ref.actionOptions,
|
|
16
|
-
_ref$extensionKey = _ref.extensionKey,
|
|
17
|
-
extensionKey = _ref$extensionKey === void 0 ? 'empty-object-provider' : _ref$extensionKey,
|
|
18
|
-
_ref$source = _ref.source,
|
|
19
|
-
source = _ref$source === void 0 ? 'block' : _ref$source;
|
|
20
|
-
var data = (0, _extractViewAction.extractViewAction)(response.data, actionOptions);
|
|
21
|
-
if (data) {
|
|
22
|
-
return {
|
|
23
|
-
actionType: 'ViewAction',
|
|
24
|
-
actionFn: function actionFn() {
|
|
25
|
-
return (0, _utils.openUrl)(data.viewUrl);
|
|
26
|
-
},
|
|
27
|
-
display: source,
|
|
28
|
-
extensionKey: extensionKey
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractViewAction = void 0;
|
|
7
|
-
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
8
|
-
var _canShowAction = require("../../../utils/actions/can-show-action");
|
|
9
|
-
var _types = require("../../../view/Card/types");
|
|
10
|
-
var _extractActions = require("../../common/actions/extractActions");
|
|
11
|
-
/**
|
|
12
|
-
* TODO: Remove on cleanup of platform-smart-card-migrate-embed-modal-analytics
|
|
13
|
-
*/
|
|
14
|
-
var extractViewAction = exports.extractViewAction = function extractViewAction(data, actionOptions) {
|
|
15
|
-
if (!(0, _canShowAction.canShowAction)(_types.CardAction.ViewAction, actionOptions)) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
var viewActionExists = (0, _extractActions.getActionsFromJsonLd)(data).find(function (action) {
|
|
19
|
-
return action['@type'] === 'ViewAction';
|
|
20
|
-
});
|
|
21
|
-
if (viewActionExists) {
|
|
22
|
-
return {
|
|
23
|
-
viewUrl: (0, _linkExtractors.extractLink)(data)
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
};
|