@atlaskit/smart-card 23.8.2 → 23.9.1
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 +12 -0
- package/dist/cjs/utils/flexible.js +8 -2
- package/dist/cjs/utils/mocks.js +38 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/flexible/AuthorizeAction.js +2 -1
- package/dist/cjs/view/BlockCard/actions/flexible/ForbiddenAction.js +2 -1
- package/dist/cjs/view/BlockCard/actions/flexible/RetryAction.js +2 -1
- package/dist/cjs/view/BlockCard/index.js +24 -0
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -1
- package/dist/cjs/view/CardWithUrl/component.js +1 -6
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +1 -6
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +2 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +17 -2
- package/dist/cjs/view/FlexibleCard/components/container/index.js +34 -3
- package/dist/cjs/view/FlexibleCard/index.js +3 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +15 -3
- package/dist/cjs/view/InlineCard/index.js +7 -0
- package/dist/es2019/utils/flexible.js +3 -2
- package/dist/es2019/utils/mocks.js +38 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/flexible/AuthorizeAction.js +2 -1
- package/dist/es2019/view/BlockCard/actions/flexible/ForbiddenAction.js +2 -1
- package/dist/es2019/view/BlockCard/actions/flexible/RetryAction.js +2 -1
- package/dist/es2019/view/BlockCard/index.js +24 -0
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -1
- package/dist/es2019/view/CardWithUrl/component.js +1 -6
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +1 -6
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +11 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +25 -5
- package/dist/es2019/view/FlexibleCard/index.js +3 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +13 -3
- package/dist/es2019/view/InlineCard/index.js +6 -0
- package/dist/esm/utils/flexible.js +4 -1
- package/dist/esm/utils/mocks.js +38 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/flexible/AuthorizeAction.js +2 -1
- package/dist/esm/view/BlockCard/actions/flexible/ForbiddenAction.js +2 -1
- package/dist/esm/view/BlockCard/actions/flexible/RetryAction.js +2 -1
- package/dist/esm/view/BlockCard/index.js +24 -0
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -1
- package/dist/esm/view/CardWithUrl/component.js +1 -6
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +1 -6
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +2 -7
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +11 -2
- package/dist/esm/view/FlexibleCard/components/container/index.js +34 -5
- package/dist/esm/view/FlexibleCard/index.js +3 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +15 -3
- package/dist/esm/view/InlineCard/index.js +6 -0
- package/dist/types/utils/flexible.d.ts +1 -0
- package/dist/types/utils/mocks.d.ts +2 -0
- package/dist/types/view/BlockCard/views/flexible/FlexibleResolvedView.d.ts +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/types.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/container/types.d.ts +5 -0
- package/dist/types/view/FlexibleCard/types.d.ts +5 -0
- package/dist/types/view/HoverCard/index.d.ts +1 -1
- package/dist/types/view/HoverCard/types.d.ts +24 -0
- package/package.json +1 -1
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
|
@@ -10,6 +10,7 @@ import { InlineCardResolvedView } from './ResolvedView';
|
|
|
10
10
|
import { InlineCardResolvingView } from './ResolvingView';
|
|
11
11
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
12
12
|
import { extractProvider } from '@atlaskit/linking-common/extractors';
|
|
13
|
+
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
13
14
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
14
15
|
export var InlineCard = function InlineCard(_ref) {
|
|
15
16
|
var _details$meta;
|
|
@@ -31,6 +32,11 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
31
32
|
details = cardState.details;
|
|
32
33
|
var cardDetails = details && details.data || getEmptyJsonLd();
|
|
33
34
|
var testIdWithStatus = testId ? "".concat(testId, "-").concat(status, "-view") : undefined;
|
|
35
|
+
var showHoverPreviewFlag = useFeatureFlag('showHoverPreview');
|
|
36
|
+
|
|
37
|
+
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
38
|
+
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
39
|
+
}
|
|
34
40
|
|
|
35
41
|
switch (status) {
|
|
36
42
|
case 'pending':
|
|
@@ -4,3 +4,4 @@ export declare const isFlexibleUiBlock: (node: React.ReactNode) => boolean;
|
|
|
4
4
|
export declare const isFlexibleUiElement: (node: React.ReactNode) => boolean;
|
|
5
5
|
export declare const isFlexibleUiTitleBlock: (node: React.ReactNode) => boolean;
|
|
6
6
|
export declare const isFlexibleUiPreviewBlock: (node: React.ReactNode) => boolean;
|
|
7
|
+
export declare const isFlexibleUiFooterBlock: (node: React.ReactNode) => boolean;
|
|
@@ -9,7 +9,9 @@ export declare const mocks: {
|
|
|
9
9
|
success: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
10
10
|
notFound: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
11
11
|
forbidden: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
12
|
+
forbiddenWithNoAuth: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
12
13
|
unauthorized: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
14
|
+
unauthorizedWithNoAuth: JsonLd.Response<JsonLd.Data.BaseData>;
|
|
13
15
|
actionSuccess: {
|
|
14
16
|
meta: {
|
|
15
17
|
visibility: string;
|
|
@@ -5,5 +5,5 @@ import { FlexibleBlockCardProps } from './types';
|
|
|
5
5
|
* @see SmartLinkStatus
|
|
6
6
|
* @see FlexibleCardProps
|
|
7
7
|
*/
|
|
8
|
-
declare const FlexibleResolvedView: ({ id, cardState, onClick, onError, testId, ui, url, analytics, }: FlexibleBlockCardProps) => JSX.Element;
|
|
8
|
+
declare const FlexibleResolvedView: ({ id, cardState, onClick, onError, onResolve, testId, ui, url, analytics, }: FlexibleBlockCardProps) => JSX.Element;
|
|
9
9
|
export default FlexibleResolvedView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardAppearance, CardPlatform, CardProps } from './types';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "showActions" | "
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "appearance" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "ui" | "showActions" | "showHoverPreview" | "onResolve" | "platform" | "isFrameVisible" | "embedIframeRef" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -25,7 +25,7 @@ export declare type ActionGroupProps = {
|
|
|
25
25
|
*/
|
|
26
26
|
visibleButtonsNum?: number;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Called when the action dropdown menu (if present) is open/closed.
|
|
29
29
|
*/
|
|
30
30
|
onDropdownOpenChange?: (isOpen: boolean) => void;
|
|
31
31
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionItem, BlockProps } from '../types';
|
|
2
|
+
import { OnActionMenuOpenChangeOptions } from '../types';
|
|
2
3
|
export declare type FooterBlockProps = {
|
|
3
4
|
/**
|
|
4
5
|
* An array of actions to be displayed on the right.
|
|
@@ -7,4 +8,8 @@ export declare type FooterBlockProps = {
|
|
|
7
8
|
* @see ActionItem
|
|
8
9
|
*/
|
|
9
10
|
actions?: ActionItem[];
|
|
11
|
+
/**
|
|
12
|
+
* Function to be called when footer action dropdown open state is changed.
|
|
13
|
+
*/
|
|
14
|
+
onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
|
|
10
15
|
} & BlockProps;
|
|
@@ -22,6 +22,11 @@ export declare type ContainerProps = FlexibleUiOptions & {
|
|
|
22
22
|
* serving as a hook for automated tests
|
|
23
23
|
*/
|
|
24
24
|
testId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Determine whether or not a preview card should show up when a user hovers
|
|
27
|
+
* over the smartlink.
|
|
28
|
+
*/
|
|
29
|
+
showHoverPreview?: Boolean;
|
|
25
30
|
};
|
|
26
31
|
export declare type ChildrenOptions = {
|
|
27
32
|
previewOnLeft?: boolean;
|
|
@@ -71,6 +71,11 @@ export declare type FlexibleCardProps = {
|
|
|
71
71
|
* Determines the URL of the Smart Link.
|
|
72
72
|
*/
|
|
73
73
|
url: string;
|
|
74
|
+
/**
|
|
75
|
+
* Determine whether or not a preview card should show up when a user hovers
|
|
76
|
+
* over the smartlink. Default value is false.
|
|
77
|
+
*/
|
|
78
|
+
showHoverPreview?: Boolean;
|
|
74
79
|
};
|
|
75
80
|
export declare type FlexibleUiOptions = {
|
|
76
81
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HoverCardProps } from './types';
|
|
3
|
-
export declare const HoverCard: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").PropsWithChildren<HoverCardProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "key" | "id" | "analyticsContext" | "onAuthorize"> & import("react").RefAttributes<any>>;
|
|
3
|
+
export declare const HoverCard: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").PropsWithChildren<HoverCardProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "children" | "key" | "id" | "analyticsContext" | "onAuthorize" | "canOpen" | "closeOnChildClick"> & import("react").RefAttributes<any>>;
|
|
@@ -8,14 +8,38 @@ import { AnalyticsHandler } from '../../utils/types';
|
|
|
8
8
|
import { ReactElement, MouseEventHandler } from 'react';
|
|
9
9
|
import { JsonLd } from 'json-ld-types';
|
|
10
10
|
export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
11
|
+
/**
|
|
12
|
+
* Unique ID for a hover card. Used for analytics.
|
|
13
|
+
*/
|
|
11
14
|
id?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Hover card will display data from this url.
|
|
17
|
+
*/
|
|
12
18
|
url: string;
|
|
19
|
+
/**
|
|
20
|
+
* React children component over which the hover card can be triggered.
|
|
21
|
+
*/
|
|
13
22
|
children: ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* Function to be called when user is authorized to view a link.
|
|
25
|
+
*/
|
|
14
26
|
onAuthorize?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Determines if the hover card is allowed to open. If changed from true to false while the
|
|
29
|
+
* hover card is open, the hover card will be closed.
|
|
30
|
+
*/
|
|
31
|
+
canOpen?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Determines if the hover card should close when the children passed in are
|
|
34
|
+
* clicked.
|
|
35
|
+
*/
|
|
36
|
+
closeOnChildClick?: boolean;
|
|
15
37
|
}
|
|
16
38
|
export interface HoverCardComponentProps extends HoverCardProps {
|
|
17
39
|
analyticsHandler: AnalyticsHandler;
|
|
18
40
|
analytics: AnalyticsFacade;
|
|
41
|
+
canOpen?: boolean;
|
|
42
|
+
closeOnChildClick?: boolean;
|
|
19
43
|
}
|
|
20
44
|
export declare type PreviewDisplay = 'card' | 'embed';
|
|
21
45
|
export declare type PreviewInvokeMethod = 'keyboard' | 'mouse_hover' | 'mouse_click';
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -538,6 +538,7 @@ export const FooterBlock: React_2.FC<FooterBlockProps>;
|
|
|
538
538
|
// @public (undocumented)
|
|
539
539
|
type FooterBlockProps = {
|
|
540
540
|
actions?: ActionItem[];
|
|
541
|
+
onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
|
|
541
542
|
} & BlockProps;
|
|
542
543
|
|
|
543
544
|
export { InlineCardAdf };
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -419,6 +419,7 @@ export const FooterBlock: React_2.FC<FooterBlockProps>;
|
|
|
419
419
|
// @public (undocumented)
|
|
420
420
|
type FooterBlockProps = {
|
|
421
421
|
actions?: ActionItem[];
|
|
422
|
+
onActionMenuOpenChange?: (options: OnActionMenuOpenChangeOptions) => void;
|
|
422
423
|
} & BlockProps;
|
|
423
424
|
|
|
424
425
|
export { InlineCardAdf }
|