@atlaskit/smart-card 26.52.2 → 26.52.3
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 +7 -0
- package/dist/cjs/extractors/flexible/actions/index.js +1 -1
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +72 -102
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +23 -6
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +94 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +36 -20
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +6 -2
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/preview-icon/index.js +19 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +72 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +6 -0
- package/dist/cjs/view/FlexibleCard/components/container/index.js +26 -5
- package/dist/cjs/view/FlexibleCard/components/utils.js +76 -8
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +2 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/index.js +2 -2
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +4 -4
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +21 -6
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +83 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +34 -17
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +6 -2
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/preview-icon/index.js +10 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +61 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +6 -0
- package/dist/es2019/view/FlexibleCard/components/container/index.js +23 -24
- package/dist/es2019/view/FlexibleCard/components/utils.js +73 -38
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/index.js +1 -1
- package/dist/esm/messages.js +5 -0
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +72 -102
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +22 -6
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +84 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +35 -18
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +6 -2
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/preview-icon/index.js +12 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +63 -0
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +6 -0
- package/dist/esm/view/FlexibleCard/components/container/index.js +26 -5
- package/dist/esm/view/FlexibleCard/components/utils.js +75 -7
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +2 -2
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +4 -4
- package/dist/types/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +4 -3
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +3 -6
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +24 -16
- package/dist/types/view/FlexibleCard/components/actions/preview-action/preview-icon/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/utils.d.ts +11 -0
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +2 -2
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +4 -4
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +4 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/index.d.ts +3 -6
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +24 -16
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/preview-action/preview-icon/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/types.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/utils.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +11 -0
- package/package.json +4 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ReactChild } from 'react';
|
|
2
|
-
import { SmartLinkSize } from '../../../../../../constants';
|
|
1
|
+
import type { ReactChild } from 'react';
|
|
2
|
+
import type { SmartLinkSize } from '../../../../../../constants';
|
|
3
3
|
export type ActionIconProps = {
|
|
4
4
|
size?: SmartLinkSize;
|
|
5
5
|
icon?: ReactChild;
|
|
6
|
-
testId?: string;
|
|
7
6
|
isDisabled?: boolean;
|
|
7
|
+
showBackground?: boolean;
|
|
8
|
+
testId?: string;
|
|
8
9
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Space, XCSS } from '@atlaskit/primitives';
|
|
2
|
+
import type { SmartLinkSize } from '../../../../../../constants';
|
|
3
|
+
import type { ActionProps } from '../types';
|
|
4
|
+
export type ActionStackItemProps = ActionProps & {
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
size: SmartLinkSize;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
space?: Space;
|
|
9
|
+
xcss?: XCSS;
|
|
10
|
+
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
3
|
-
import { ActionProps
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import { ActionProps } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* A base action that can be triggered with an on click.
|
|
6
6
|
* @internal
|
|
7
7
|
* @param {ActionProps} ActionProps - The props necessary for the Action.
|
|
8
|
-
* @see DeleteAction
|
|
9
|
-
* @see EditAction
|
|
10
|
-
* @see CustomAction
|
|
11
8
|
*/
|
|
12
|
-
declare const Action:
|
|
9
|
+
declare const Action: FC<ActionProps>;
|
|
13
10
|
export default Action;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ReactChild } from 'react';
|
|
1
|
+
import type { Appearance } from '@atlaskit/button/types';
|
|
2
|
+
import type { Space, XCSS } from '@atlaskit/primitives';
|
|
3
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
4
|
+
import type { ReactChild, ReactNode } from 'react';
|
|
5
|
+
import type { SmartLinkSize } from '../../../../../constants';
|
|
5
6
|
export type ActionProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Determines the appearance of the action.
|
|
9
|
+
*/
|
|
10
|
+
as?: 'button' | 'dropdown-item' | 'stack-item';
|
|
6
11
|
/**
|
|
7
12
|
* Determines the size of the Action. Corresponds to an Action appearance.
|
|
8
13
|
*/
|
|
@@ -10,7 +15,7 @@ export type ActionProps = {
|
|
|
10
15
|
/**
|
|
11
16
|
* Determines the text content of the Action.
|
|
12
17
|
*/
|
|
13
|
-
content?:
|
|
18
|
+
content?: ReactNode;
|
|
14
19
|
/**
|
|
15
20
|
* Determines the appearance of the action. Corresponds to the Atlaskit action appearance.
|
|
16
21
|
*/
|
|
@@ -27,18 +32,29 @@ export type ActionProps = {
|
|
|
27
32
|
* Determines where the icon should be rendered if text is provided.
|
|
28
33
|
*/
|
|
29
34
|
iconPosition?: 'before' | 'after';
|
|
35
|
+
/**
|
|
36
|
+
* Conditionally show a spinner over the top of a button or disable a dropdown item
|
|
37
|
+
* while server action is executing.
|
|
38
|
+
*/
|
|
39
|
+
isLoading?: boolean;
|
|
30
40
|
/**
|
|
31
41
|
* Determines the tooltip message when hovering over the Action.
|
|
32
42
|
*/
|
|
33
|
-
tooltipMessage?:
|
|
43
|
+
tooltipMessage?: ReactNode;
|
|
34
44
|
/**
|
|
45
|
+
* @deprecated Use 'as' instead
|
|
35
46
|
* Used to determine whether the Action is in a Dropdown.
|
|
36
47
|
*/
|
|
37
48
|
asDropDownItem?: boolean;
|
|
38
49
|
/**
|
|
39
50
|
* Additional CSS properties on the Action.
|
|
51
|
+
* Note: This should be replaced with xcss once component has migrate to use DS Primitives
|
|
40
52
|
*/
|
|
41
53
|
overrideCss?: SerializedStyles;
|
|
54
|
+
/**
|
|
55
|
+
* Used to add space along the inline axis in ActionStackItem.
|
|
56
|
+
*/
|
|
57
|
+
spaceInline?: Space;
|
|
42
58
|
/**
|
|
43
59
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
44
60
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -49,16 +65,8 @@ export type ActionProps = {
|
|
|
49
65
|
* Determines whether the button displays as disabled.
|
|
50
66
|
*/
|
|
51
67
|
isDisabled?: boolean;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* The internal props that should only be controlled by internal components
|
|
55
|
-
* and/or used by experiment. If there is a use case where these props/feature
|
|
56
|
-
* should be available as part of smart-card, please move them to ActionProps.
|
|
57
|
-
*/
|
|
58
|
-
export type InternalActionProps = {
|
|
59
68
|
/**
|
|
60
|
-
*
|
|
61
|
-
* while server action is executing.
|
|
69
|
+
* Additional styling properties for Primitives based component
|
|
62
70
|
*/
|
|
63
|
-
|
|
71
|
+
xcss?: XCSS;
|
|
64
72
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Space } from '@atlaskit/primitives';
|
|
2
|
+
import type { ActionName } from '../../../../../constants';
|
|
3
|
+
import type { BlockProps } from '../types';
|
|
4
|
+
export type ActionBlockProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Callback once action is executed.
|
|
7
|
+
*/
|
|
8
|
+
onClick?: (name: ActionName) => {};
|
|
9
|
+
/**
|
|
10
|
+
* Array.Sort function to order the actions
|
|
11
|
+
*/
|
|
12
|
+
sort?: (a: ActionName, b: ActionName) => number;
|
|
13
|
+
/**
|
|
14
|
+
* Used to add space along the inline axis (typically horizontal).
|
|
15
|
+
*/
|
|
16
|
+
spaceInline?: Space;
|
|
17
|
+
} & BlockProps;
|
|
@@ -7,3 +7,4 @@ export { default as CustomBlock } from './block';
|
|
|
7
7
|
export { default as InternalFooterBlock } from './footer-block/resolved';
|
|
8
8
|
export { default as RelatedUrlsBlock } from './related-urls-block';
|
|
9
9
|
export { default as AISummaryBlock } from './ai-summary-block';
|
|
10
|
+
export { default as ActionBlock } from './action-block';
|
|
@@ -5,6 +5,11 @@ import { ElementName, SmartLinkDirection, SmartLinkSize } from '../../../../cons
|
|
|
5
5
|
import type { FlexibleUiDataContext } from '../../../../state/flexible-ui-context/types';
|
|
6
6
|
export type ElementDisplaySchemaType = 'inline' | 'block';
|
|
7
7
|
export declare const ElementDisplaySchema: Record<ElementName, ElementDisplaySchemaType[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Get gap size between elements inside a block
|
|
10
|
+
* Equivalent version for DS primitives space token is getPrimitivesInlineSpaceBySize()
|
|
11
|
+
* at view/FlexibleCard/components/utils.tsx
|
|
12
|
+
*/
|
|
8
13
|
export declare const getGapSize: (size: SmartLinkSize) => number;
|
|
9
14
|
export declare const getBaseStyles: (direction: SmartLinkDirection, size: SmartLinkSize) => SerializedStyles;
|
|
10
15
|
export declare const highlightRemoveStyles: SerializedStyles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SerializedStyles } from '@emotion/react';
|
|
3
3
|
import { Spacing } from '@atlaskit/button';
|
|
4
|
+
import type { Space } from '@atlaskit/primitives';
|
|
4
5
|
import { SmartLinkSize } from '../../../constants';
|
|
5
6
|
import { MessageProps } from './types';
|
|
6
7
|
import { PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
@@ -15,6 +16,16 @@ export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
|
|
|
15
16
|
export declare const getLinkSizeStyles: (size: SmartLinkSize) => SerializedStyles;
|
|
16
17
|
export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.5 | 1.75;
|
|
17
18
|
export declare const getMaxLines: (value: number, defaultValue: number, max: number, min: number) => number;
|
|
19
|
+
/**
|
|
20
|
+
* A space between element based on smart link size
|
|
21
|
+
* To replace blocks/utils.tsz getGapSize() with space token for primitives
|
|
22
|
+
*/
|
|
23
|
+
export declare const getPrimitivesInlineSpaceBySize: (size: SmartLinkSize) => Space;
|
|
24
|
+
/**
|
|
25
|
+
* Get container padding based on smart link size
|
|
26
|
+
* To replace container/index.tsx getPadding() with space token for primitives
|
|
27
|
+
*/
|
|
28
|
+
export declare const getPrimitivesPaddingSpaceBySize: (size: SmartLinkSize) => Space;
|
|
18
29
|
export declare const getTruncateStyles: (maxLines: number, lineHeight?: string, wordBreak?: 'break-word' | 'break-all') => SerializedStyles;
|
|
19
30
|
export declare const hasWhiteSpace: (str: string) => boolean;
|
|
20
31
|
export declare const openEmbedModalWithFlexibleUiIcon: ({ linkIcon, ...props }: Partial<EmbedModalProps> & Pick<PreviewActionData, 'linkIcon'>) => Promise<void>;
|
|
@@ -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_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'beta' | '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' | 'follow' | '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' | 'learn_more_about_connecting_account' | '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_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' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'beta' | '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' | 'follow' | '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' | 'learn_more_about_connecting_account' | '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_description' | 'preview_improved' | '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' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AISummaryServiceProps, type AISummaryServiceInt, type AISummaryState, type StateSetter
|
|
1
|
+
import { type AISummaryServiceProps, type AISummaryServiceInt, type AISummaryState, type StateSetter } from './types';
|
|
2
2
|
export declare class AISummaryService implements AISummaryServiceInt {
|
|
3
3
|
state: AISummaryState;
|
|
4
4
|
private config;
|
|
@@ -10,7 +10,7 @@ export declare class AISummaryService implements AISummaryServiceInt {
|
|
|
10
10
|
private onError?;
|
|
11
11
|
constructor(props: AISummaryServiceProps);
|
|
12
12
|
private fetchStream;
|
|
13
|
-
summariseUrl(
|
|
13
|
+
summariseUrl(): Promise<void>;
|
|
14
14
|
private isExpectedError;
|
|
15
15
|
subscribe(stateSetter: StateSetter): () => void;
|
|
16
16
|
}
|
|
@@ -28,10 +28,10 @@ export type PostAgentPayload = {
|
|
|
28
28
|
export type AgentInputContext = {
|
|
29
29
|
content_url: string;
|
|
30
30
|
content_ari?: string;
|
|
31
|
-
|
|
31
|
+
prompt_id: PromptId;
|
|
32
32
|
summary_output_mimetype?: SummaryOutputMimeType;
|
|
33
33
|
};
|
|
34
|
-
export type
|
|
34
|
+
export type PromptId = 'smart_links';
|
|
35
35
|
export type SummaryOutputMimeType = 'text/adf' | 'text/markdown' | 'text/json';
|
|
36
36
|
export declare const errorMessages: readonly [
|
|
37
37
|
"NETWORK_ERROR",
|
|
@@ -134,7 +134,7 @@ export type Message = {
|
|
|
134
134
|
content: string;
|
|
135
135
|
content_mime_type: ContentType;
|
|
136
136
|
conversation_channel_id?: string;
|
|
137
|
-
experience_id:
|
|
137
|
+
experience_id: ExperienceId;
|
|
138
138
|
message_metadata?: Metadata;
|
|
139
139
|
plugin_invocations: PluginInvocationMessage[];
|
|
140
140
|
role: Role;
|
|
@@ -144,7 +144,7 @@ export type Message = {
|
|
|
144
144
|
sources?: Sources;
|
|
145
145
|
};
|
|
146
146
|
export type ContentType = 'text/markdown';
|
|
147
|
-
export type
|
|
147
|
+
export type ExperienceId = 'ai-mate' | 'smart-link';
|
|
148
148
|
export type Role = 'ASSISTANT';
|
|
149
149
|
export type Appendices = Array<Appendix>;
|
|
150
150
|
export type Appendix = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ReactChild } from 'react';
|
|
2
|
-
import { SmartLinkSize } from '../../../../../../constants';
|
|
1
|
+
import type { ReactChild } from 'react';
|
|
2
|
+
import type { SmartLinkSize } from '../../../../../../constants';
|
|
3
3
|
export type ActionIconProps = {
|
|
4
4
|
size?: SmartLinkSize;
|
|
5
5
|
icon?: ReactChild;
|
|
6
|
-
testId?: string;
|
|
7
6
|
isDisabled?: boolean;
|
|
7
|
+
showBackground?: boolean;
|
|
8
|
+
testId?: string;
|
|
8
9
|
};
|
package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Space, XCSS } from '@atlaskit/primitives';
|
|
2
|
+
import type { SmartLinkSize } from '../../../../../../constants';
|
|
3
|
+
import type { ActionProps } from '../types';
|
|
4
|
+
export type ActionStackItemProps = ActionProps & {
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
size: SmartLinkSize;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
space?: Space;
|
|
9
|
+
xcss?: XCSS;
|
|
10
|
+
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
3
|
-
import { ActionProps
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import { ActionProps } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* A base action that can be triggered with an on click.
|
|
6
6
|
* @internal
|
|
7
7
|
* @param {ActionProps} ActionProps - The props necessary for the Action.
|
|
8
|
-
* @see DeleteAction
|
|
9
|
-
* @see EditAction
|
|
10
|
-
* @see CustomAction
|
|
11
8
|
*/
|
|
12
|
-
declare const Action:
|
|
9
|
+
declare const Action: FC<ActionProps>;
|
|
13
10
|
export default Action;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ReactChild } from 'react';
|
|
1
|
+
import type { Appearance } from '@atlaskit/button/types';
|
|
2
|
+
import type { Space, XCSS } from '@atlaskit/primitives';
|
|
3
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
4
|
+
import type { ReactChild, ReactNode } from 'react';
|
|
5
|
+
import type { SmartLinkSize } from '../../../../../constants';
|
|
5
6
|
export type ActionProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Determines the appearance of the action.
|
|
9
|
+
*/
|
|
10
|
+
as?: 'button' | 'dropdown-item' | 'stack-item';
|
|
6
11
|
/**
|
|
7
12
|
* Determines the size of the Action. Corresponds to an Action appearance.
|
|
8
13
|
*/
|
|
@@ -10,7 +15,7 @@ export type ActionProps = {
|
|
|
10
15
|
/**
|
|
11
16
|
* Determines the text content of the Action.
|
|
12
17
|
*/
|
|
13
|
-
content?:
|
|
18
|
+
content?: ReactNode;
|
|
14
19
|
/**
|
|
15
20
|
* Determines the appearance of the action. Corresponds to the Atlaskit action appearance.
|
|
16
21
|
*/
|
|
@@ -27,18 +32,29 @@ export type ActionProps = {
|
|
|
27
32
|
* Determines where the icon should be rendered if text is provided.
|
|
28
33
|
*/
|
|
29
34
|
iconPosition?: 'before' | 'after';
|
|
35
|
+
/**
|
|
36
|
+
* Conditionally show a spinner over the top of a button or disable a dropdown item
|
|
37
|
+
* while server action is executing.
|
|
38
|
+
*/
|
|
39
|
+
isLoading?: boolean;
|
|
30
40
|
/**
|
|
31
41
|
* Determines the tooltip message when hovering over the Action.
|
|
32
42
|
*/
|
|
33
|
-
tooltipMessage?:
|
|
43
|
+
tooltipMessage?: ReactNode;
|
|
34
44
|
/**
|
|
45
|
+
* @deprecated Use 'as' instead
|
|
35
46
|
* Used to determine whether the Action is in a Dropdown.
|
|
36
47
|
*/
|
|
37
48
|
asDropDownItem?: boolean;
|
|
38
49
|
/**
|
|
39
50
|
* Additional CSS properties on the Action.
|
|
51
|
+
* Note: This should be replaced with xcss once component has migrate to use DS Primitives
|
|
40
52
|
*/
|
|
41
53
|
overrideCss?: SerializedStyles;
|
|
54
|
+
/**
|
|
55
|
+
* Used to add space along the inline axis in ActionStackItem.
|
|
56
|
+
*/
|
|
57
|
+
spaceInline?: Space;
|
|
42
58
|
/**
|
|
43
59
|
* A `testId` prop is provided for specified elements, which is a unique
|
|
44
60
|
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
@@ -49,16 +65,8 @@ export type ActionProps = {
|
|
|
49
65
|
* Determines whether the button displays as disabled.
|
|
50
66
|
*/
|
|
51
67
|
isDisabled?: boolean;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* The internal props that should only be controlled by internal components
|
|
55
|
-
* and/or used by experiment. If there is a use case where these props/feature
|
|
56
|
-
* should be available as part of smart-card, please move them to ActionProps.
|
|
57
|
-
*/
|
|
58
|
-
export type InternalActionProps = {
|
|
59
68
|
/**
|
|
60
|
-
*
|
|
61
|
-
* while server action is executing.
|
|
69
|
+
* Additional styling properties for Primitives based component
|
|
62
70
|
*/
|
|
63
|
-
|
|
71
|
+
xcss?: XCSS;
|
|
64
72
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Space } from '@atlaskit/primitives';
|
|
2
|
+
import type { ActionName } from '../../../../../constants';
|
|
3
|
+
import type { BlockProps } from '../types';
|
|
4
|
+
export type ActionBlockProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Callback once action is executed.
|
|
7
|
+
*/
|
|
8
|
+
onClick?: (name: ActionName) => {};
|
|
9
|
+
/**
|
|
10
|
+
* Array.Sort function to order the actions
|
|
11
|
+
*/
|
|
12
|
+
sort?: (a: ActionName, b: ActionName) => number;
|
|
13
|
+
/**
|
|
14
|
+
* Used to add space along the inline axis (typically horizontal).
|
|
15
|
+
*/
|
|
16
|
+
spaceInline?: Space;
|
|
17
|
+
} & BlockProps;
|
|
@@ -7,3 +7,4 @@ export { default as CustomBlock } from './block';
|
|
|
7
7
|
export { default as InternalFooterBlock } from './footer-block/resolved';
|
|
8
8
|
export { default as RelatedUrlsBlock } from './related-urls-block';
|
|
9
9
|
export { default as AISummaryBlock } from './ai-summary-block';
|
|
10
|
+
export { default as ActionBlock } from './action-block';
|
|
@@ -5,6 +5,11 @@ import { ElementName, SmartLinkDirection, SmartLinkSize } from '../../../../cons
|
|
|
5
5
|
import type { FlexibleUiDataContext } from '../../../../state/flexible-ui-context/types';
|
|
6
6
|
export type ElementDisplaySchemaType = 'inline' | 'block';
|
|
7
7
|
export declare const ElementDisplaySchema: Record<ElementName, ElementDisplaySchemaType[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Get gap size between elements inside a block
|
|
10
|
+
* Equivalent version for DS primitives space token is getPrimitivesInlineSpaceBySize()
|
|
11
|
+
* at view/FlexibleCard/components/utils.tsx
|
|
12
|
+
*/
|
|
8
13
|
export declare const getGapSize: (size: SmartLinkSize) => number;
|
|
9
14
|
export declare const getBaseStyles: (direction: SmartLinkDirection, size: SmartLinkSize) => SerializedStyles;
|
|
10
15
|
export declare const highlightRemoveStyles: SerializedStyles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SerializedStyles } from '@emotion/react';
|
|
3
3
|
import { Spacing } from '@atlaskit/button';
|
|
4
|
+
import type { Space } from '@atlaskit/primitives';
|
|
4
5
|
import { SmartLinkSize } from '../../../constants';
|
|
5
6
|
import { MessageProps } from './types';
|
|
6
7
|
import { PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
@@ -15,6 +16,16 @@ export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
|
|
|
15
16
|
export declare const getLinkSizeStyles: (size: SmartLinkSize) => SerializedStyles;
|
|
16
17
|
export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.5 | 1.75;
|
|
17
18
|
export declare const getMaxLines: (value: number, defaultValue: number, max: number, min: number) => number;
|
|
19
|
+
/**
|
|
20
|
+
* A space between element based on smart link size
|
|
21
|
+
* To replace blocks/utils.tsz getGapSize() with space token for primitives
|
|
22
|
+
*/
|
|
23
|
+
export declare const getPrimitivesInlineSpaceBySize: (size: SmartLinkSize) => Space;
|
|
24
|
+
/**
|
|
25
|
+
* Get container padding based on smart link size
|
|
26
|
+
* To replace container/index.tsx getPadding() with space token for primitives
|
|
27
|
+
*/
|
|
28
|
+
export declare const getPrimitivesPaddingSpaceBySize: (size: SmartLinkSize) => Space;
|
|
18
29
|
export declare const getTruncateStyles: (maxLines: number, lineHeight?: string, wordBreak?: 'break-word' | 'break-all') => SerializedStyles;
|
|
19
30
|
export declare const hasWhiteSpace: (str: string) => boolean;
|
|
20
31
|
export declare const openEmbedModalWithFlexibleUiIcon: ({ linkIcon, ...props }: Partial<EmbedModalProps> & Pick<PreviewActionData, 'linkIcon'>) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.52.
|
|
3
|
+
"version": "26.52.3",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -169,6 +169,9 @@
|
|
|
169
169
|
},
|
|
170
170
|
"platform.linking-platform.smart-card.enable-embed-card-header-tooltip_g9saw": {
|
|
171
171
|
"type": "boolean"
|
|
172
|
+
},
|
|
173
|
+
"platform.linking-platform.smart-card.hover-card-action-redesign": {
|
|
174
|
+
"type": "boolean"
|
|
172
175
|
}
|
|
173
176
|
},
|
|
174
177
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|