@atlaskit/smart-card 21.0.1 → 21.0.4
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 +18 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +87 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +31 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +52 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +42 -104
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +44 -15
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +16 -3
- package/dist/cjs/view/FlexibleCard/components/utils.js +7 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +20 -20
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +88 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +18 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +35 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +26 -110
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +31 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +23 -2
- package/dist/es2019/view/FlexibleCard/components/utils.js +6 -0
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +20 -20
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +67 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-button/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/index.js +19 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-dropdown-item/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +39 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +41 -99
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +44 -16
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +14 -2
- package/dist/esm/view/FlexibleCard/components/utils.js +3 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +20 -20
- package/dist/types/view/FlexibleCard/components/actions/action/action-button/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-button/types.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-dropdown-item/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-dropdown-item/types.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-icon/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +7 -0
- package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +0 -3
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +0 -16
- package/dist/types/view/FlexibleCard/components/blocks/utils.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/utils.d.ts +2 -0
- package/package.json +8 -5
- package/report.api.md +32 -2
|
@@ -7,6 +7,7 @@ export declare type ElementDisplaySchemaType = 'inline' | 'block';
|
|
|
7
7
|
export declare const ElementDisplaySchema: Record<ElementName, ElementDisplaySchemaType[]>;
|
|
8
8
|
export declare const getGapSize: (size: SmartLinkSize) => number;
|
|
9
9
|
export declare const getBaseStyles: (direction: SmartLinkDirection, size: SmartLinkSize) => SerializedStyles;
|
|
10
|
+
export declare const highlightRemoveStyles: SerializedStyles;
|
|
10
11
|
export declare const renderChildren: (children: React.ReactNode, size: SmartLinkSize) => React.ReactNode;
|
|
11
12
|
export declare const renderElementItems: (items?: ElementItem[], display?: ElementDisplaySchemaType) => React.ReactNode | undefined;
|
|
12
|
-
export declare const renderActionItems: (items?: ActionItem[], size?: SmartLinkSize, appearance?: Appearance | undefined, asDropDownItems?: boolean | undefined) => React.ReactNode | undefined;
|
|
13
|
+
export declare const renderActionItems: (items?: ActionItem[], size?: SmartLinkSize, appearance?: Appearance | undefined, asDropDownItems?: boolean | undefined, onActionItemClick?: (() => void) | undefined) => React.ReactNode | undefined;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SerializedStyles } from '@emotion/core';
|
|
3
|
+
import { Spacing } from '@atlaskit/button';
|
|
3
4
|
import { SmartLinkSize } from '../../../constants';
|
|
4
5
|
import { MessageProps } from './types';
|
|
6
|
+
export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
|
|
5
7
|
export declare const getFormattedMessage: (message?: MessageProps | undefined) => JSX.Element | undefined;
|
|
6
8
|
export declare const getIconSizeStyles: (width: string) => SerializedStyles;
|
|
7
9
|
export declare const getIconWidth: (size?: SmartLinkSize | undefined) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.4",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/avatar": "^21.0.0",
|
|
28
28
|
"@atlaskit/avatar-group": "^9.0.0",
|
|
29
29
|
"@atlaskit/button": "^16.3.0",
|
|
30
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
30
|
+
"@atlaskit/dropdown-menu": "^11.3.0",
|
|
31
31
|
"@atlaskit/icon": "^21.10.0",
|
|
32
32
|
"@atlaskit/icon-file-type": "^6.3.0",
|
|
33
33
|
"@atlaskit/icon-object": "^6.2.0",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@atlaskit/linking-common": "^1.5.0",
|
|
37
37
|
"@atlaskit/logo": "^13.8.0",
|
|
38
38
|
"@atlaskit/lozenge": "^11.1.0",
|
|
39
|
-
"@atlaskit/media-common": "^2.
|
|
39
|
+
"@atlaskit/media-common": "^2.16.0",
|
|
40
40
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
41
41
|
"@atlaskit/outbound-auth-flow-client": "^3.3.0",
|
|
42
|
-
"@atlaskit/popup": "^1.
|
|
42
|
+
"@atlaskit/popup": "^1.4.0",
|
|
43
43
|
"@atlaskit/spinner": "^15.1.0",
|
|
44
44
|
"@atlaskit/theme": "^12.1.0",
|
|
45
45
|
"@atlaskit/tokens": "^0.10.0",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@atlaskit/avatar": "^21.0.0",
|
|
68
68
|
"@atlaskit/checkbox": "^12.3.0",
|
|
69
|
+
"@atlaskit/code": "^14.3.0",
|
|
69
70
|
"@atlaskit/css-reset": "^6.3.0",
|
|
70
71
|
"@atlaskit/docs": "*",
|
|
71
72
|
"@atlaskit/field-base": "^15.0.6",
|
|
@@ -78,11 +79,12 @@
|
|
|
78
79
|
"@atlaskit/radio": "^5.3.0",
|
|
79
80
|
"@atlaskit/range": "^6.0.0",
|
|
80
81
|
"@atlaskit/section-message": "^6.1.5",
|
|
81
|
-
"@atlaskit/select": "^15.
|
|
82
|
+
"@atlaskit/select": "^15.5.0",
|
|
82
83
|
"@atlaskit/table-tree": "^9.1.0",
|
|
83
84
|
"@atlaskit/tabs": "^13.2.10",
|
|
84
85
|
"@atlaskit/textarea": "^4.3.0",
|
|
85
86
|
"@atlaskit/textfield": "^5.1.0",
|
|
87
|
+
"@atlaskit/toggle": "^12.4.0",
|
|
86
88
|
"@atlaskit/visual-regression": "*",
|
|
87
89
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
88
90
|
"@testing-library/jest-dom": "^4.1.0",
|
|
@@ -103,6 +105,7 @@
|
|
|
103
105
|
"mockdate": "^3.0.2",
|
|
104
106
|
"react": "^16.8.0",
|
|
105
107
|
"react-ace": "^6.1.0",
|
|
108
|
+
"react-beautiful-dnd": "^12.1.1",
|
|
106
109
|
"react-dom": "^16.8.0",
|
|
107
110
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
108
111
|
"react-test-renderer": "^16.8.0",
|
package/report.api.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/smart-card"
|
|
1
|
+
## API Report File for "@atlaskit/smart-card".
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
4
6
|
|
|
5
7
|
```ts
|
|
6
8
|
/// <reference types="react" />
|
|
@@ -18,6 +20,7 @@ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
18
20
|
import { EditorCardProvider } from '@atlaskit/link-provider';
|
|
19
21
|
import { editorCardProvider } from '@atlaskit/link-provider';
|
|
20
22
|
import { EmbedCardAdf } from '@atlaskit/linking-common';
|
|
23
|
+
import { ErrorInfo } from 'react';
|
|
21
24
|
import { GasPayload } from '@atlaskit/analytics-gas-types';
|
|
22
25
|
import { InlineCardAdf } from '@atlaskit/linking-common';
|
|
23
26
|
import { JsonLd } from 'json-ld-types';
|
|
@@ -254,6 +257,7 @@ export declare const Card: React_2.ForwardRefExoticComponent<
|
|
|
254
257
|
| 'inheritDimensions'
|
|
255
258
|
| 'id'
|
|
256
259
|
| 'placeholder'
|
|
260
|
+
| 'onError'
|
|
257
261
|
| 'onClick'
|
|
258
262
|
| 'analyticsContext'
|
|
259
263
|
| 'key'
|
|
@@ -298,6 +302,7 @@ export declare interface CardProps extends WithAnalyticsEventsProps {
|
|
|
298
302
|
testId?: string;
|
|
299
303
|
showActions?: boolean;
|
|
300
304
|
onResolve?: OnResolveCallback;
|
|
305
|
+
onError?: OnErrorCallback;
|
|
301
306
|
inheritDimensions?: boolean;
|
|
302
307
|
embedIframeRef?: React.Ref<HTMLIFrameElement>;
|
|
303
308
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
@@ -488,6 +493,13 @@ export declare class EmbedResizeMessageListener extends React_2.Component<
|
|
|
488
493
|
render(): React_2.ReactNode;
|
|
489
494
|
}
|
|
490
495
|
|
|
496
|
+
declare type ErrorCardType =
|
|
497
|
+
| 'errored'
|
|
498
|
+
| 'fallback'
|
|
499
|
+
| 'forbidden'
|
|
500
|
+
| 'not_found'
|
|
501
|
+
| 'unauthorized';
|
|
502
|
+
|
|
491
503
|
declare type FlexibleUiOptions = {
|
|
492
504
|
/**
|
|
493
505
|
* Determines whether the entire Smart Link container should be clickable.
|
|
@@ -629,6 +641,11 @@ declare type NamedActionItem = BaseActionItem & {
|
|
|
629
641
|
name: Exclude<ActionName, ActionName.CustomAction>;
|
|
630
642
|
};
|
|
631
643
|
|
|
644
|
+
declare type OnErrorCallback = (data: {
|
|
645
|
+
status: Extract<CardType, ErrorCardType>;
|
|
646
|
+
url: string;
|
|
647
|
+
}) => void;
|
|
648
|
+
|
|
632
649
|
declare type OnResolveCallback = (data: {
|
|
633
650
|
url?: string;
|
|
634
651
|
title?: string;
|
|
@@ -1060,6 +1077,19 @@ export declare const useSmartLinkAnalytics: (
|
|
|
1060
1077
|
definitionId?: string | undefined,
|
|
1061
1078
|
extensionKey?: string | undefined,
|
|
1062
1079
|
) => void;
|
|
1080
|
+
/**
|
|
1081
|
+
* This fires an event that represents when a Smart Link renders unsuccessfuly.
|
|
1082
|
+
* @param display Whether the card was an Inline, Block, Embed or Flexible UI.
|
|
1083
|
+
* @param id The unique ID for this Smart Link.
|
|
1084
|
+
* @param error: An error representing why the Smart Link render failed.
|
|
1085
|
+
* @param errorInfo: Additional details about the error including the stack trace.
|
|
1086
|
+
*/
|
|
1087
|
+
renderFailedEvent: (
|
|
1088
|
+
display: CardInnerAppearance,
|
|
1089
|
+
id: string | undefined,
|
|
1090
|
+
error: Error,
|
|
1091
|
+
errorInfo: ErrorInfo,
|
|
1092
|
+
) => void;
|
|
1063
1093
|
/**
|
|
1064
1094
|
* This fires an event that represents a hover preview being opened.
|
|
1065
1095
|
* @param hoverDisplay Whether the hover preview was displayed as a card or embed.
|