@atlaskit/smart-card 21.0.2 → 21.0.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 +6 -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/utils.js +12 -1
- package/dist/cjs/view/FlexibleCard/components/utils.js +7 -2
- 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/utils.js +12 -2
- package/dist/es2019/view/FlexibleCard/components/utils.js +6 -0
- 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/utils.js +12 -1
- package/dist/esm/view/FlexibleCard/components/utils.js +3 -1
- 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 +1 -1
- package/dist/types/view/FlexibleCard/components/utils.d.ts +2 -0
- package/package.json +8 -5
- package/report.api.md +32 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
5
|
var _excluded = ["triggerRef"];
|
|
5
6
|
|
|
6
7
|
var _templateObject;
|
|
7
8
|
|
|
8
9
|
/** @jsx jsx */
|
|
9
|
-
import { useCallback } from 'react';
|
|
10
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
10
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
12
|
import { css, jsx } from '@emotion/core';
|
|
12
13
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
@@ -16,7 +17,7 @@ import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
|
16
17
|
import { SmartLinkSize } from '../../../../../constants';
|
|
17
18
|
import Button from '@atlaskit/button/standard-button';
|
|
18
19
|
import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
19
|
-
import {
|
|
20
|
+
import { sizeToButtonSpacing } from '../../utils';
|
|
20
21
|
import { tokens } from '../../../../../utils/token';
|
|
21
22
|
import { messages } from '../../../../../messages';
|
|
22
23
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n line-height: 1rem;\n > div {\n align-items: center;\n button:focus {\n // AK button removes the default browser outline on focus and apply\n // box-shadow styling to create the outline appearance.\n // Due to our container elements (Container/Block/ElementGroup) has\n // overflow hidden to prevent the metadata element from leaking outside\n // of its container, the box-shadow doesn't show properly.\n // Invert the AK box-shadow styling.\n box-shadow: inset 0 0 0 2px ", ";\n }\n }\n"])), tokens.focus);
|
|
@@ -38,40 +39,67 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
38
39
|
visibleButtonsNum = _ref$visibleButtonsNu === void 0 ? 2 : _ref$visibleButtonsNu,
|
|
39
40
|
onDropdownOpenChange = _ref.onDropdownOpenChange,
|
|
40
41
|
testId = _ref.testId;
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
42
|
+
|
|
43
|
+
var _useState = useState(false),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
isOpen = _useState2[0],
|
|
46
|
+
setIsOpen = _useState2[1];
|
|
47
|
+
|
|
48
|
+
var _useMemo = useMemo(function () {
|
|
49
|
+
var isMoreThenTwoItems = items.length > visibleButtonsNum;
|
|
50
|
+
var buttons = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
51
|
+
var dropdownItems = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
52
|
+
return [buttons, dropdownItems];
|
|
53
|
+
}, [items, visibleButtonsNum]),
|
|
54
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
55
|
+
buttonActions = _useMemo2[0],
|
|
56
|
+
dropdownItemActions = _useMemo2[1]; // Stop AK dropdown menu to propagate event on click.
|
|
57
|
+
|
|
44
58
|
|
|
45
59
|
var onClick = useCallback(function (e) {
|
|
46
60
|
return e.stopPropagation();
|
|
47
61
|
}, []);
|
|
62
|
+
var onOpenChange = useCallback(function (attrs) {
|
|
63
|
+
setIsOpen(attrs.isOpen);
|
|
64
|
+
|
|
65
|
+
if (onDropdownOpenChange) {
|
|
66
|
+
onDropdownOpenChange(attrs.isOpen);
|
|
67
|
+
}
|
|
68
|
+
}, [onDropdownOpenChange]);
|
|
69
|
+
var onActionClick = useCallback(function () {
|
|
70
|
+
if (isOpen) {
|
|
71
|
+
onOpenChange({
|
|
72
|
+
isOpen: false
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}, [isOpen, onOpenChange]);
|
|
48
76
|
return jsx("div", {
|
|
49
77
|
css: styles,
|
|
50
78
|
className: "actions-button-group",
|
|
51
79
|
onClick: onClick
|
|
52
|
-
}, jsx(ButtonGroup, null, renderActionItems(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var triggerRef = _ref3.triggerRef,
|
|
59
|
-
props = _objectWithoutProperties(_ref3, _excluded);
|
|
80
|
+
}, jsx(ButtonGroup, null, renderActionItems(buttonActions, size, appearance, false, onActionClick), dropdownItemActions.length > 0 ? jsx(DropdownMenu, {
|
|
81
|
+
isOpen: isOpen,
|
|
82
|
+
onOpenChange: onOpenChange,
|
|
83
|
+
trigger: function trigger(_ref2) {
|
|
84
|
+
var triggerRef = _ref2.triggerRef,
|
|
85
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
60
86
|
|
|
61
87
|
return jsx(Tooltip, {
|
|
62
88
|
content: jsx(FormattedMessage, messages.more_actions),
|
|
89
|
+
hideTooltipOnClick: true,
|
|
63
90
|
testId: "action-group-more-button-tooltip",
|
|
64
91
|
tag: "span"
|
|
65
92
|
}, jsx(Button, _extends({}, props, {
|
|
66
|
-
spacing:
|
|
93
|
+
spacing: sizeToButtonSpacing[size],
|
|
67
94
|
testId: "action-group-more-button",
|
|
68
95
|
iconBefore: jsx(MoreIcon, {
|
|
69
96
|
label: "more"
|
|
70
97
|
}),
|
|
71
98
|
ref: triggerRef
|
|
72
99
|
})));
|
|
73
|
-
}
|
|
74
|
-
|
|
100
|
+
},
|
|
101
|
+
testId: "action-group-dropdown"
|
|
102
|
+
}, renderActionItems(dropdownItemActions, size, appearance, true, onActionClick)) : null));
|
|
75
103
|
};
|
|
76
104
|
|
|
77
105
|
export default ActionGroup;
|
|
@@ -116,6 +116,7 @@ export var renderActionItems = function renderActionItems() {
|
|
|
116
116
|
var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SmartLinkSize.Medium;
|
|
117
117
|
var appearance = arguments.length > 2 ? arguments[2] : undefined;
|
|
118
118
|
var asDropDownItems = arguments.length > 3 ? arguments[3] : undefined;
|
|
119
|
+
var onActionItemClick = arguments.length > 4 ? arguments[4] : undefined;
|
|
119
120
|
var actions = items.reduce(function (acc, curr, idx) {
|
|
120
121
|
var name = curr.name,
|
|
121
122
|
hideContent = curr.hideContent,
|
|
@@ -136,12 +137,22 @@ export var renderActionItems = function renderActionItems() {
|
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
if (Action) {
|
|
140
|
+
var handleOnClick = function handleOnClick() {
|
|
141
|
+
if (onActionItemClick) {
|
|
142
|
+
onActionItemClick();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (onClick) {
|
|
146
|
+
onClick();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
139
150
|
return [].concat(_toConsumableArray(acc), [/*#__PURE__*/React.createElement(Action, _extends({
|
|
140
151
|
asDropDownItem: asDropDownItems,
|
|
141
152
|
size: size,
|
|
142
153
|
key: idx,
|
|
143
154
|
appearance: appearance,
|
|
144
|
-
onClick:
|
|
155
|
+
onClick: handleOnClick
|
|
145
156
|
}, actionProps))]);
|
|
146
157
|
}
|
|
147
158
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
5
|
+
var _sizeToButtonSpacing, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
5
6
|
|
|
6
7
|
import React from 'react';
|
|
7
8
|
import { css } from '@emotion/core';
|
|
8
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
10
|
import { SmartLinkSize } from '../../../constants';
|
|
11
|
+
export var sizeToButtonSpacing = (_sizeToButtonSpacing = {}, _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Small, 'none'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Medium, 'compact'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Large, 'compact'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.XLarge, 'default'), _sizeToButtonSpacing);
|
|
10
12
|
export var getFormattedMessage = function getFormattedMessage(message) {
|
|
11
13
|
if (message) {
|
|
12
14
|
var descriptor = message.descriptor,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SmartLinkSize } from '../../../../../../constants';
|
|
3
|
+
import { ActionProps } from '../types';
|
|
4
|
+
export declare type ActionButtonProps = ActionProps & {
|
|
5
|
+
iconAfter?: React.ReactChild;
|
|
6
|
+
iconBefore?: React.ReactChild;
|
|
7
|
+
size: SmartLinkSize;
|
|
8
|
+
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Spacing } from '@atlaskit/button';
|
|
4
|
-
import { SmartLinkSize } from '../../../../../constants';
|
|
5
3
|
import { ActionProps } from './types';
|
|
6
|
-
export declare const sizeToSpacing: Record<SmartLinkSize, Spacing>;
|
|
7
4
|
/**
|
|
8
5
|
* A base action that can be triggered with an on click.
|
|
9
6
|
* @internal
|
|
@@ -46,19 +46,3 @@ export declare type ActionProps = {
|
|
|
46
46
|
*/
|
|
47
47
|
testId?: string;
|
|
48
48
|
};
|
|
49
|
-
export declare type ActionIconProps = {
|
|
50
|
-
/**
|
|
51
|
-
* Determines the size of the Icon within the Action.
|
|
52
|
-
*/
|
|
53
|
-
size?: SmartLinkSize;
|
|
54
|
-
/**
|
|
55
|
-
* Determines the icon within the Action.
|
|
56
|
-
*/
|
|
57
|
-
icon?: ReactChild;
|
|
58
|
-
/**
|
|
59
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
60
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
61
|
-
* serving as a hook for automated tests
|
|
62
|
-
*/
|
|
63
|
-
testId?: string;
|
|
64
|
-
};
|
|
@@ -9,4 +9,4 @@ export declare const getGapSize: (size: SmartLinkSize) => number;
|
|
|
9
9
|
export declare const getBaseStyles: (direction: SmartLinkDirection, size: SmartLinkSize) => SerializedStyles;
|
|
10
10
|
export declare const renderChildren: (children: React.ReactNode, size: SmartLinkSize) => React.ReactNode;
|
|
11
11
|
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;
|
|
12
|
+
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.3",
|
|
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.
|