@atlaskit/smart-card 28.2.1 → 28.3.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 +14 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +4 -2
- package/dist/cjs/view/CardWithUrl/loader.js +4 -2
- package/dist/cjs/view/InlineCard/ErroredView/index.js +4 -2
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +4 -2
- package/dist/cjs/view/InlineCard/Frame/index.js +4 -2
- package/dist/cjs/view/InlineCard/Frame/styled.js +30 -3
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +4 -2
- package/dist/cjs/view/InlineCard/ResolvingView/index.js +6 -3
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +4 -2
- package/dist/cjs/view/InlineCard/index.js +14 -7
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +4 -2
- package/dist/es2019/view/CardWithUrl/loader.js +4 -2
- package/dist/es2019/view/InlineCard/ErroredView/index.js +4 -2
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +4 -2
- package/dist/es2019/view/InlineCard/Frame/index.js +4 -2
- package/dist/es2019/view/InlineCard/Frame/styled.js +35 -3
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +4 -2
- package/dist/es2019/view/InlineCard/ResolvingView/index.js +6 -3
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +4 -2
- package/dist/es2019/view/InlineCard/index.js +14 -7
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +4 -2
- package/dist/esm/view/CardWithUrl/loader.js +4 -2
- package/dist/esm/view/InlineCard/ErroredView/index.js +4 -2
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +4 -2
- package/dist/esm/view/InlineCard/Frame/index.js +4 -2
- package/dist/esm/view/InlineCard/Frame/styled.js +30 -3
- package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -2
- package/dist/esm/view/InlineCard/ResolvingView/index.js +6 -3
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +4 -2
- package/dist/esm/view/InlineCard/index.js +14 -7
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -0
- package/dist/types/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types/view/InlineCard/ErroredView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/ForbiddenView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/ResolvingView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/index.d.ts +1 -1
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/ErroredView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/ForbiddenView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/ResolvingView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +1 -0
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "28.
|
|
18
|
+
packageVersion: "28.3.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -41,7 +41,8 @@ function Component(_ref) {
|
|
|
41
41
|
analyticsEvents = _ref.analyticsEvents,
|
|
42
42
|
useLegacyBlockCard = _ref.useLegacyBlockCard,
|
|
43
43
|
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle,
|
|
44
|
-
resolvingPlaceholder = _ref.resolvingPlaceholder
|
|
44
|
+
resolvingPlaceholder = _ref.resolvingPlaceholder,
|
|
45
|
+
truncateInline = _ref.truncateInline;
|
|
45
46
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
46
47
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
47
48
|
|
|
@@ -226,7 +227,8 @@ function Component(_ref) {
|
|
|
226
227
|
showAuthTooltip: showAuthTooltip,
|
|
227
228
|
actionOptions: actionOptions,
|
|
228
229
|
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
|
|
229
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
230
|
+
resolvingPlaceholder: resolvingPlaceholder,
|
|
231
|
+
truncateInline: truncateInline
|
|
230
232
|
});
|
|
231
233
|
case 'block':
|
|
232
234
|
return /*#__PURE__*/React.createElement(BlockCard, {
|
|
@@ -53,7 +53,8 @@ export function CardWithURLRenderer(props) {
|
|
|
53
53
|
fallbackComponent = props.fallbackComponent,
|
|
54
54
|
useLegacyBlockCard = props.useLegacyBlockCard,
|
|
55
55
|
removeTextHighlightingFromTitle = props.removeTextHighlightingFromTitle,
|
|
56
|
-
resolvingPlaceholder = props.resolvingPlaceholder
|
|
56
|
+
resolvingPlaceholder = props.resolvingPlaceholder,
|
|
57
|
+
truncateInline = props.truncateInline;
|
|
57
58
|
var analytics = useSmartLinkAnalytics(url !== null && url !== void 0 ? url : '', undefined, id);
|
|
58
59
|
var isFlexibleUi = isFlexibleUiCard(children);
|
|
59
60
|
var errorHandler = useCallback(function (error, info) {
|
|
@@ -123,7 +124,8 @@ export function CardWithURLRenderer(props) {
|
|
|
123
124
|
placeholder: placeholder,
|
|
124
125
|
useLegacyBlockCard: useLegacyBlockCard,
|
|
125
126
|
removeTextHighlightingFromTitle: removeTextHighlightingFromTitle,
|
|
126
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
127
|
+
resolvingPlaceholder: resolvingPlaceholder,
|
|
128
|
+
truncateInline: truncateInline
|
|
127
129
|
};
|
|
128
130
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
129
131
|
FallbackComponent: ErrorFallback,
|
|
@@ -60,11 +60,13 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
|
|
|
60
60
|
_this$props$testId = _this$props.testId,
|
|
61
61
|
testId = _this$props$testId === void 0 ? 'inline-card-errored-view' : _this$props$testId,
|
|
62
62
|
icon = _this$props.icon,
|
|
63
|
-
message = _this$props.message
|
|
63
|
+
message = _this$props.message,
|
|
64
|
+
truncateInline = _this$props.truncateInline;
|
|
64
65
|
var content = /*#__PURE__*/React.createElement(Frame, {
|
|
65
66
|
testId: testId,
|
|
66
67
|
isSelected: isSelected,
|
|
67
|
-
ref: this.frameRef
|
|
68
|
+
ref: this.frameRef,
|
|
69
|
+
truncateInline: truncateInline
|
|
68
70
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
69
71
|
icon: icon || /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
70
72
|
label: "error",
|
|
@@ -107,11 +107,13 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
|
|
|
107
107
|
onClick = _this$props4.onClick,
|
|
108
108
|
isSelected = _this$props4.isSelected,
|
|
109
109
|
_this$props4$testId = _this$props4.testId,
|
|
110
|
-
testId = _this$props4$testId === void 0 ? 'inline-card-forbidden-view' : _this$props4$testId
|
|
110
|
+
testId = _this$props4$testId === void 0 ? 'inline-card-forbidden-view' : _this$props4$testId,
|
|
111
|
+
truncateInline = _this$props4.truncateInline;
|
|
111
112
|
var content = /*#__PURE__*/React.createElement(Frame, {
|
|
112
113
|
testId: testId,
|
|
113
114
|
isSelected: isSelected,
|
|
114
|
-
ref: this.frameRef
|
|
115
|
+
ref: this.frameRef,
|
|
116
|
+
truncateInline: truncateInline
|
|
115
117
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
116
118
|
icon: icon ? icon : FallbackForbiddenIcon,
|
|
117
119
|
link: url,
|
|
@@ -9,7 +9,8 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
9
9
|
withoutBackground = props.withoutBackground,
|
|
10
10
|
testId = props.testId,
|
|
11
11
|
className = props.className,
|
|
12
|
-
isHovered = props.isHovered
|
|
12
|
+
isHovered = props.isHovered,
|
|
13
|
+
truncateInline = props.truncateInline;
|
|
13
14
|
var handleClick = useCallback(function (event) {
|
|
14
15
|
if (onClick) {
|
|
15
16
|
event.preventDefault();
|
|
@@ -47,6 +48,7 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
48
|
,
|
|
48
49
|
className: className,
|
|
49
50
|
ref: ref,
|
|
50
|
-
isHovered: isHovered
|
|
51
|
+
isHovered: isHovered,
|
|
52
|
+
truncateInline: truncateInline
|
|
51
53
|
}, children);
|
|
52
54
|
});
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import styled from '@emotion/styled';
|
|
6
6
|
import { B50, B100, B200, B400, N40 } from '@atlaskit/theme/colors';
|
|
7
|
+
var lineHeight = 22;
|
|
7
8
|
var selectedStyles = {
|
|
8
9
|
cursor: 'pointer',
|
|
9
10
|
boxShadow: "0 0 0 2px ".concat("var(--ds-border-selected, ".concat(B100, ")")),
|
|
@@ -67,7 +68,7 @@ var hoveredWihBorderStyles = function hoveredWihBorderStyles(props) {
|
|
|
67
68
|
// NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
|
|
68
69
|
var baseWrapperStyles = function baseWrapperStyles(props) {
|
|
69
70
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
70
|
-
lineHeight:
|
|
71
|
+
lineHeight: "".concat(lineHeight, "px"),
|
|
71
72
|
padding: "var(--ds-space-025, 2px)".concat(" 0px")
|
|
72
73
|
}, props.withoutBackground ? {
|
|
73
74
|
paddingLeft: 0,
|
|
@@ -88,15 +89,41 @@ var baseWrapperStyles = function baseWrapperStyles(props) {
|
|
|
88
89
|
MozUserSelect: 'none'
|
|
89
90
|
}, props.isHovered ? hoveredWihBorderStyles(props) : undefined);
|
|
90
91
|
};
|
|
92
|
+
var truncateStyles = {
|
|
93
|
+
overflow: 'hidden',
|
|
94
|
+
textOverflow: 'ellipsis',
|
|
95
|
+
wordBreak: 'break-all',
|
|
96
|
+
// The height of a truncated card is 1px higher than that of a non-truncated card, so we subtract 1px from the line height.
|
|
97
|
+
lineHeight: "".concat(lineHeight - 1, "px"),
|
|
98
|
+
display: '-webkit-inline-box',
|
|
99
|
+
WebkitLineClamp: 1,
|
|
100
|
+
WebkitBoxOrient: 'vertical',
|
|
101
|
+
// We need to remove the padding because display: -webkit-inline-box will cause any padding to be
|
|
102
|
+
// added to the total height, causing truncated cards to have greater height than non-truncated cards which use display: inline.
|
|
103
|
+
padding: 0,
|
|
104
|
+
'@supports not (-webkit-line-clamp: 1)': {
|
|
105
|
+
display: 'inline-block',
|
|
106
|
+
maxHeight: "".concat(lineHeight, "px"),
|
|
107
|
+
// If the browser does not support webkit, we don't need to remove the padding
|
|
108
|
+
padding: "var(--ds-space-025, 2px)".concat(" 0px")
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
var isTruncated = function isTruncated(_ref3) {
|
|
112
|
+
var truncateInline = _ref3.truncateInline;
|
|
113
|
+
if (truncateInline) {
|
|
114
|
+
return truncateStyles;
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
};
|
|
91
118
|
|
|
92
119
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
93
120
|
export var WrapperAnchor = styled.a(function (props) {
|
|
94
|
-
return _objectSpread(_objectSpread({}, baseWrapperStyles(props)), isInteractive(props));
|
|
121
|
+
return _objectSpread(_objectSpread(_objectSpread({}, baseWrapperStyles(props)), isInteractive(props)), isTruncated(props));
|
|
95
122
|
});
|
|
96
123
|
WrapperAnchor.displayName = 'WrapperAnchor';
|
|
97
124
|
|
|
98
125
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
99
126
|
export var WrapperSpan = styled.span(function (props) {
|
|
100
|
-
return _objectSpread({}, baseWrapperStyles(props));
|
|
127
|
+
return _objectSpread(_objectSpread({}, baseWrapperStyles(props)), isTruncated(props));
|
|
101
128
|
});
|
|
102
129
|
WrapperSpan.displayName = 'WrapperSpan';
|
|
@@ -54,13 +54,15 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
54
54
|
_this$props$showHover = _this$props.showHoverPreview,
|
|
55
55
|
showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover,
|
|
56
56
|
hoverPreviewOptions = _this$props.hoverPreviewOptions,
|
|
57
|
-
actionOptions = _this$props.actionOptions
|
|
57
|
+
actionOptions = _this$props.actionOptions,
|
|
58
|
+
truncateInline = _this$props.truncateInline;
|
|
58
59
|
var inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
|
|
59
60
|
testId: testId,
|
|
60
61
|
link: link,
|
|
61
62
|
isSelected: isSelected,
|
|
62
63
|
isHovered: isHovered,
|
|
63
|
-
onClick: onClick
|
|
64
|
+
onClick: onClick,
|
|
65
|
+
truncateInline: truncateInline
|
|
64
66
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
65
67
|
emoji: titlePrefix,
|
|
66
68
|
icon: icon,
|
|
@@ -29,13 +29,15 @@ export var InlineCardResolvingView = /*#__PURE__*/function (_React$Component) {
|
|
|
29
29
|
_this$props$testId = _this$props.testId,
|
|
30
30
|
testId = _this$props$testId === void 0 ? 'inline-card-resolving-view' : _this$props$testId,
|
|
31
31
|
titleTextColor = _this$props.titleTextColor,
|
|
32
|
-
resolvingPlaceholder = _this$props.resolvingPlaceholder
|
|
32
|
+
resolvingPlaceholder = _this$props.resolvingPlaceholder,
|
|
33
|
+
truncateInline = _this$props.truncateInline;
|
|
33
34
|
if (inlinePreloaderStyle === 'on-right-without-skeleton') {
|
|
34
35
|
return /*#__PURE__*/React.createElement(Frame, {
|
|
35
36
|
withoutBackground: true,
|
|
36
37
|
testId: testId,
|
|
37
38
|
onClick: onClick,
|
|
38
|
-
isSelected: isSelected
|
|
39
|
+
isSelected: isSelected,
|
|
40
|
+
truncateInline: truncateInline
|
|
39
41
|
}, /*#__PURE__*/React.createElement(IconTitleWrapper, null, url, /*#__PURE__*/React.createElement(RightIconPositionWrapper, null, /*#__PURE__*/React.createElement(SpinnerWrapper, {
|
|
40
42
|
className: "inline-resolving-spinner"
|
|
41
43
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
@@ -46,7 +48,8 @@ export var InlineCardResolvingView = /*#__PURE__*/function (_React$Component) {
|
|
|
46
48
|
testId: testId,
|
|
47
49
|
onClick: onClick,
|
|
48
50
|
isSelected: isSelected,
|
|
49
|
-
link: url
|
|
51
|
+
link: url,
|
|
52
|
+
truncateInline: truncateInline
|
|
50
53
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
51
54
|
title: resolvingPlaceholder !== null && resolvingPlaceholder !== void 0 ? resolvingPlaceholder : url,
|
|
52
55
|
titleTextColor: titleTextColor
|
|
@@ -80,11 +80,13 @@ export var InlineCardUnauthorizedView = /*#__PURE__*/function (_React$Component)
|
|
|
80
80
|
_this$props3$testId = _this$props3.testId,
|
|
81
81
|
testId = _this$props3$testId === void 0 ? 'inline-card-unauthorized-view' : _this$props3$testId,
|
|
82
82
|
_this$props3$showAuth = _this$props3.showAuthTooltip,
|
|
83
|
-
showAuthTooltip = _this$props3$showAuth === void 0 ? false : _this$props3$showAuth
|
|
83
|
+
showAuthTooltip = _this$props3$showAuth === void 0 ? false : _this$props3$showAuth,
|
|
84
|
+
truncateInline = _this$props3.truncateInline;
|
|
84
85
|
var inlineCardUnauthenticatedView = /*#__PURE__*/React.createElement(Frame, {
|
|
85
86
|
testId: testId,
|
|
86
87
|
isSelected: isSelected,
|
|
87
|
-
ref: this.frameRef
|
|
88
|
+
ref: this.frameRef,
|
|
89
|
+
truncateInline: truncateInline
|
|
88
90
|
}, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
|
|
89
91
|
icon: icon ? icon : FallbackUnauthorizedIcon,
|
|
90
92
|
title: url,
|
|
@@ -35,7 +35,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
35
35
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
36
36
|
actionOptions = _ref.actionOptions,
|
|
37
37
|
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle,
|
|
38
|
-
resolvingPlaceholder = _ref.resolvingPlaceholder
|
|
38
|
+
resolvingPlaceholder = _ref.resolvingPlaceholder,
|
|
39
|
+
truncateInline = _ref.truncateInline;
|
|
39
40
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
40
41
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
41
42
|
var status = cardState.status,
|
|
@@ -79,7 +80,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
79
80
|
onClick: handleFrameClick,
|
|
80
81
|
testId: testIdWithStatus,
|
|
81
82
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
82
|
-
resolvingPlaceholder: resolvingPlaceholder
|
|
83
|
+
resolvingPlaceholder: resolvingPlaceholder,
|
|
84
|
+
truncateInline: truncateInline
|
|
83
85
|
});
|
|
84
86
|
case 'resolved':
|
|
85
87
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
@@ -91,7 +93,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
91
93
|
isSelected: isSelected,
|
|
92
94
|
isHovered: isHovered,
|
|
93
95
|
onClick: handleFrameClick,
|
|
94
|
-
testId: testIdWithStatus
|
|
96
|
+
testId: testIdWithStatus,
|
|
97
|
+
truncateInline: truncateInline
|
|
95
98
|
}));
|
|
96
99
|
case 'unauthorized':
|
|
97
100
|
var provider = extractProvider(cardDetails);
|
|
@@ -106,7 +109,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
106
109
|
showAuthTooltip: showAuthTooltip,
|
|
107
110
|
id: id,
|
|
108
111
|
analytics: analytics,
|
|
109
|
-
extensionKey: extensionKey
|
|
112
|
+
extensionKey: extensionKey,
|
|
113
|
+
truncateInline: truncateInline
|
|
110
114
|
});
|
|
111
115
|
case 'forbidden':
|
|
112
116
|
var providerForbidden = extractProvider(cardDetails);
|
|
@@ -126,7 +130,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
126
130
|
onAuthorise: handleAuthorize,
|
|
127
131
|
testId: testIdWithStatus,
|
|
128
132
|
requestAccessContext: requestAccessContext,
|
|
129
|
-
showHoverPreview: showHoverPreview
|
|
133
|
+
showHoverPreview: showHoverPreview,
|
|
134
|
+
truncateInline: truncateInline
|
|
130
135
|
});
|
|
131
136
|
case 'not_found':
|
|
132
137
|
var providerNotFound = extractProvider(cardDetails);
|
|
@@ -137,7 +142,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
137
142
|
message: "Can't find link",
|
|
138
143
|
onClick: handleFrameClick,
|
|
139
144
|
testId: testIdWithStatus || 'inline-card-not-found-view',
|
|
140
|
-
showHoverPreview: showHoverPreview
|
|
145
|
+
showHoverPreview: showHoverPreview,
|
|
146
|
+
truncateInline: truncateInline
|
|
141
147
|
});
|
|
142
148
|
case 'fallback':
|
|
143
149
|
case 'errored':
|
|
@@ -146,7 +152,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
146
152
|
link: url,
|
|
147
153
|
isSelected: isSelected,
|
|
148
154
|
onClick: handleFrameClick,
|
|
149
|
-
testId: testIdWithStatus || 'inline-card-errored-view'
|
|
155
|
+
testId: testIdWithStatus || 'inline-card-errored-view',
|
|
156
|
+
truncateInline: truncateInline
|
|
150
157
|
});
|
|
151
158
|
}
|
|
152
159
|
};
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "28.
|
|
13
|
+
packageVersion: "28.3.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -124,4 +124,6 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
124
124
|
* When defined, this placeholder will be displayed while the smart card is resolving. This is only useful for inline cards.
|
|
125
125
|
*/
|
|
126
126
|
resolvingPlaceholder?: string;
|
|
127
|
+
/** When set to true, inline cards will be truncated to one line. */
|
|
128
|
+
truncateInline?: boolean;
|
|
127
129
|
}
|
|
@@ -15,6 +15,8 @@ export interface InlineCardErroredViewProps {
|
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
/** Enables showing a custom preview on hover of link */
|
|
17
17
|
showHoverPreview?: boolean;
|
|
18
|
+
/** Truncates the card to one line */
|
|
19
|
+
truncateInline?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare class InlineCardErroredView extends React.Component<InlineCardErroredViewProps> {
|
|
20
22
|
private frameRef;
|
|
@@ -18,6 +18,8 @@ export interface InlineCardForbiddenViewProps {
|
|
|
18
18
|
requestAccessContext?: RequestAccessContextProps;
|
|
19
19
|
/** Enables showing a custom preview on hover of link */
|
|
20
20
|
showHoverPreview?: boolean;
|
|
21
|
+
/** Truncates the card to one line */
|
|
22
|
+
truncateInline?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare class InlineCardForbiddenView extends React.Component<InlineCardForbiddenViewProps> {
|
|
23
25
|
private frameRef;
|
|
@@ -13,5 +13,7 @@ export interface FrameViewProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
/** A flag that determines whether a card is in hover state in edit mode. */
|
|
15
15
|
isHovered?: boolean;
|
|
16
|
+
/** A flag that determines whether a card is truncated to 1 line */
|
|
17
|
+
truncateInline?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare const Frame: React.ForwardRefExoticComponent<FrameViewProps & React.RefAttributes<never>>;
|
|
@@ -5,6 +5,7 @@ export interface WrapperProps {
|
|
|
5
5
|
isInteractive?: boolean;
|
|
6
6
|
withoutBackground?: boolean;
|
|
7
7
|
isHovered?: boolean;
|
|
8
|
+
truncateInline?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare const WrapperAnchor: import("@emotion/styled").StyledComponent<{
|
|
10
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -30,6 +30,8 @@ export interface InlineCardResolvedViewProps {
|
|
|
30
30
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
31
31
|
/** Configure visibility of server and client actions */
|
|
32
32
|
actionOptions?: CardActionOptions;
|
|
33
|
+
/** Truncates the card to one line */
|
|
34
|
+
truncateInline?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare class InlineCardResolvedView extends React.Component<InlineCardResolvedViewProps> {
|
|
35
37
|
renderLozenge(): JSX.Element | null;
|
|
@@ -13,6 +13,8 @@ export interface InlineCardResolvingViewProps {
|
|
|
13
13
|
titleTextColor?: string;
|
|
14
14
|
/** An optional placeholder displayed while the smart card is resolving. */
|
|
15
15
|
resolvingPlaceholder?: string;
|
|
16
|
+
/** Truncates the card to one line */
|
|
17
|
+
truncateInline?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare class InlineCardResolvingView extends React.Component<InlineCardResolvingViewProps> {
|
|
18
20
|
render(): JSX.Element;
|
|
@@ -23,6 +23,8 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
23
23
|
analytics: AnalyticsFacade;
|
|
24
24
|
/** An identifier of the provider which will be executing the action. */
|
|
25
25
|
extensionKey?: string;
|
|
26
|
+
/** Truncates the card to one line */
|
|
27
|
+
truncateInline?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare class InlineCardUnauthorizedView extends React.Component<InlineCardUnauthorizedViewProps> {
|
|
28
30
|
private frameRef;
|
|
@@ -6,4 +6,4 @@ import { InlineCardResolvedView } from './ResolvedView';
|
|
|
6
6
|
import { InlineCardResolvingView } from './ResolvingView';
|
|
7
7
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
8
8
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
|
|
9
|
-
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, }: InlineCardProps) => JSX.Element;
|
|
9
|
+
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, }: InlineCardProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "removeTextHighlightingFromTitle" | "resolvingPlaceholder" | "truncateInline" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -124,4 +124,6 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
124
124
|
* When defined, this placeholder will be displayed while the smart card is resolving. This is only useful for inline cards.
|
|
125
125
|
*/
|
|
126
126
|
resolvingPlaceholder?: string;
|
|
127
|
+
/** When set to true, inline cards will be truncated to one line. */
|
|
128
|
+
truncateInline?: boolean;
|
|
127
129
|
}
|
|
@@ -15,6 +15,8 @@ export interface InlineCardErroredViewProps {
|
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
/** Enables showing a custom preview on hover of link */
|
|
17
17
|
showHoverPreview?: boolean;
|
|
18
|
+
/** Truncates the card to one line */
|
|
19
|
+
truncateInline?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare class InlineCardErroredView extends React.Component<InlineCardErroredViewProps> {
|
|
20
22
|
private frameRef;
|
|
@@ -18,6 +18,8 @@ export interface InlineCardForbiddenViewProps {
|
|
|
18
18
|
requestAccessContext?: RequestAccessContextProps;
|
|
19
19
|
/** Enables showing a custom preview on hover of link */
|
|
20
20
|
showHoverPreview?: boolean;
|
|
21
|
+
/** Truncates the card to one line */
|
|
22
|
+
truncateInline?: boolean;
|
|
21
23
|
}
|
|
22
24
|
export declare class InlineCardForbiddenView extends React.Component<InlineCardForbiddenViewProps> {
|
|
23
25
|
private frameRef;
|
|
@@ -13,5 +13,7 @@ export interface FrameViewProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
/** A flag that determines whether a card is in hover state in edit mode. */
|
|
15
15
|
isHovered?: boolean;
|
|
16
|
+
/** A flag that determines whether a card is truncated to 1 line */
|
|
17
|
+
truncateInline?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare const Frame: React.ForwardRefExoticComponent<FrameViewProps & React.RefAttributes<never>>;
|
|
@@ -5,6 +5,7 @@ export interface WrapperProps {
|
|
|
5
5
|
isInteractive?: boolean;
|
|
6
6
|
withoutBackground?: boolean;
|
|
7
7
|
isHovered?: boolean;
|
|
8
|
+
truncateInline?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare const WrapperAnchor: import("@emotion/styled").StyledComponent<{
|
|
10
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -30,6 +30,8 @@ export interface InlineCardResolvedViewProps {
|
|
|
30
30
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
31
31
|
/** Configure visibility of server and client actions */
|
|
32
32
|
actionOptions?: CardActionOptions;
|
|
33
|
+
/** Truncates the card to one line */
|
|
34
|
+
truncateInline?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare class InlineCardResolvedView extends React.Component<InlineCardResolvedViewProps> {
|
|
35
37
|
renderLozenge(): JSX.Element | null;
|
|
@@ -13,6 +13,8 @@ export interface InlineCardResolvingViewProps {
|
|
|
13
13
|
titleTextColor?: string;
|
|
14
14
|
/** An optional placeholder displayed while the smart card is resolving. */
|
|
15
15
|
resolvingPlaceholder?: string;
|
|
16
|
+
/** Truncates the card to one line */
|
|
17
|
+
truncateInline?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export declare class InlineCardResolvingView extends React.Component<InlineCardResolvingViewProps> {
|
|
18
20
|
render(): JSX.Element;
|
|
@@ -23,6 +23,8 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
23
23
|
analytics: AnalyticsFacade;
|
|
24
24
|
/** An identifier of the provider which will be executing the action. */
|
|
25
25
|
extensionKey?: string;
|
|
26
|
+
/** Truncates the card to one line */
|
|
27
|
+
truncateInline?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare class InlineCardUnauthorizedView extends React.Component<InlineCardUnauthorizedViewProps> {
|
|
28
30
|
private frameRef;
|
|
@@ -6,4 +6,4 @@ import { InlineCardResolvedView } from './ResolvedView';
|
|
|
6
6
|
import { InlineCardResolvingView } from './ResolvingView';
|
|
7
7
|
import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
8
8
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
|
|
9
|
-
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, }: InlineCardProps) => JSX.Element;
|
|
9
|
+
export declare const InlineCard: ({ analytics, id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, showAuthTooltip, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, }: InlineCardProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.3.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/textarea": "^5.6.0",
|
|
60
60
|
"@atlaskit/textfield": "^6.5.0",
|
|
61
61
|
"@atlaskit/theme": "^13.0.0",
|
|
62
|
-
"@atlaskit/tokens": "^
|
|
62
|
+
"@atlaskit/tokens": "^2.0.0",
|
|
63
63
|
"@atlaskit/tooltip": "^18.7.0",
|
|
64
64
|
"@atlaskit/ufo": "^0.3.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|