@atlaskit/smart-card 28.2.0 → 28.3.0

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/CardWithUrl/component.js +4 -2
  4. package/dist/cjs/view/CardWithUrl/loader.js +4 -2
  5. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +1 -4
  6. package/dist/cjs/view/InlineCard/ErroredView/index.js +4 -2
  7. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +4 -2
  8. package/dist/cjs/view/InlineCard/Frame/index.js +4 -2
  9. package/dist/cjs/view/InlineCard/Frame/styled.js +30 -3
  10. package/dist/cjs/view/InlineCard/ResolvedView/index.js +4 -2
  11. package/dist/cjs/view/InlineCard/ResolvingView/index.js +6 -3
  12. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +4 -2
  13. package/dist/cjs/view/InlineCard/index.js +14 -7
  14. package/dist/cjs/view/LinkUrl/index.js +1 -1
  15. package/dist/es2019/utils/analytics/analytics.js +1 -1
  16. package/dist/es2019/view/CardWithUrl/component.js +4 -2
  17. package/dist/es2019/view/CardWithUrl/loader.js +4 -2
  18. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -4
  19. package/dist/es2019/view/InlineCard/ErroredView/index.js +4 -2
  20. package/dist/es2019/view/InlineCard/ForbiddenView/index.js +4 -2
  21. package/dist/es2019/view/InlineCard/Frame/index.js +4 -2
  22. package/dist/es2019/view/InlineCard/Frame/styled.js +35 -3
  23. package/dist/es2019/view/InlineCard/ResolvedView/index.js +4 -2
  24. package/dist/es2019/view/InlineCard/ResolvingView/index.js +6 -3
  25. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +4 -2
  26. package/dist/es2019/view/InlineCard/index.js +14 -7
  27. package/dist/es2019/view/LinkUrl/index.js +1 -1
  28. package/dist/esm/utils/analytics/analytics.js +1 -1
  29. package/dist/esm/view/CardWithUrl/component.js +4 -2
  30. package/dist/esm/view/CardWithUrl/loader.js +4 -2
  31. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -4
  32. package/dist/esm/view/InlineCard/ErroredView/index.js +4 -2
  33. package/dist/esm/view/InlineCard/ForbiddenView/index.js +4 -2
  34. package/dist/esm/view/InlineCard/Frame/index.js +4 -2
  35. package/dist/esm/view/InlineCard/Frame/styled.js +30 -3
  36. package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -2
  37. package/dist/esm/view/InlineCard/ResolvingView/index.js +6 -3
  38. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +4 -2
  39. package/dist/esm/view/InlineCard/index.js +14 -7
  40. package/dist/esm/view/LinkUrl/index.js +1 -1
  41. package/dist/types/view/Card/index.d.ts +1 -1
  42. package/dist/types/view/Card/types.d.ts +2 -0
  43. package/dist/types/view/CardWithUrl/types.d.ts +1 -0
  44. package/dist/types/view/InlineCard/ErroredView/index.d.ts +2 -0
  45. package/dist/types/view/InlineCard/ForbiddenView/index.d.ts +2 -0
  46. package/dist/types/view/InlineCard/Frame/index.d.ts +2 -0
  47. package/dist/types/view/InlineCard/Frame/styled.d.ts +1 -0
  48. package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
  49. package/dist/types/view/InlineCard/ResolvingView/index.d.ts +2 -0
  50. package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
  51. package/dist/types/view/InlineCard/index.d.ts +1 -1
  52. package/dist/types/view/InlineCard/types.d.ts +1 -0
  53. package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
  54. package/dist/types-ts4.5/view/Card/types.d.ts +2 -0
  55. package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +1 -0
  56. package/dist/types-ts4.5/view/InlineCard/ErroredView/index.d.ts +2 -0
  57. package/dist/types-ts4.5/view/InlineCard/ForbiddenView/index.d.ts +2 -0
  58. package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +2 -0
  59. package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +1 -0
  60. package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +2 -0
  61. package/dist/types-ts4.5/view/InlineCard/ResolvingView/index.d.ts +2 -0
  62. package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +2 -0
  63. package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
  64. package/dist/types-ts4.5/view/InlineCard/types.d.ts +1 -0
  65. package/package.json +2 -5
@@ -34,7 +34,8 @@ export const InlineCard = ({
34
34
  showAuthTooltip,
35
35
  actionOptions,
36
36
  removeTextHighlightingFromTitle,
37
- resolvingPlaceholder
37
+ resolvingPlaceholder,
38
+ truncateInline
38
39
  }) => {
39
40
  var _details$meta, _providerForbidden$te;
40
41
  const {
@@ -83,7 +84,8 @@ export const InlineCard = ({
83
84
  onClick: handleFrameClick,
84
85
  testId: testIdWithStatus,
85
86
  inlinePreloaderStyle: inlinePreloaderStyle,
86
- resolvingPlaceholder: resolvingPlaceholder
87
+ resolvingPlaceholder: resolvingPlaceholder,
88
+ truncateInline: truncateInline
87
89
  });
88
90
  case 'resolved':
89
91
  return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
@@ -95,7 +97,8 @@ export const InlineCard = ({
95
97
  isSelected: isSelected,
96
98
  isHovered: isHovered,
97
99
  onClick: handleFrameClick,
98
- testId: testIdWithStatus
100
+ testId: testIdWithStatus,
101
+ truncateInline: truncateInline
99
102
  }));
100
103
  case 'unauthorized':
101
104
  const provider = extractProvider(cardDetails);
@@ -110,7 +113,8 @@ export const InlineCard = ({
110
113
  showAuthTooltip: showAuthTooltip,
111
114
  id: id,
112
115
  analytics: analytics,
113
- extensionKey: extensionKey
116
+ extensionKey: extensionKey,
117
+ truncateInline: truncateInline
114
118
  });
115
119
  case 'forbidden':
116
120
  const providerForbidden = extractProvider(cardDetails);
@@ -130,7 +134,8 @@ export const InlineCard = ({
130
134
  onAuthorise: handleAuthorize,
131
135
  testId: testIdWithStatus,
132
136
  requestAccessContext: requestAccessContext,
133
- showHoverPreview: showHoverPreview
137
+ showHoverPreview: showHoverPreview,
138
+ truncateInline: truncateInline
134
139
  });
135
140
  case 'not_found':
136
141
  const providerNotFound = extractProvider(cardDetails);
@@ -141,7 +146,8 @@ export const InlineCard = ({
141
146
  message: "Can't find link",
142
147
  onClick: handleFrameClick,
143
148
  testId: testIdWithStatus || 'inline-card-not-found-view',
144
- showHoverPreview: showHoverPreview
149
+ showHoverPreview: showHoverPreview,
150
+ truncateInline: truncateInline
145
151
  });
146
152
  case 'fallback':
147
153
  case 'errored':
@@ -150,7 +156,8 @@ export const InlineCard = ({
150
156
  link: url,
151
157
  isSelected: isSelected,
152
158
  onClick: handleFrameClick,
153
- testId: testIdWithStatus || 'inline-card-errored-view'
159
+ testId: testIdWithStatus || 'inline-card-errored-view',
160
+ truncateInline: truncateInline
154
161
  });
155
162
  }
156
163
  };
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "28.2.0",
10
+ packageVersion: "28.3.0",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -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.2.0"
18
+ packageVersion: "28.3.0"
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,
@@ -18,7 +18,6 @@ import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAna
18
18
  import { combineActionOptions } from '../../../utils/actions/combine-action-options';
19
19
  import { useSmartCardActions } from '../../../state/actions';
20
20
  import { useSmartLinkAnalytics } from '../../../state/analytics';
21
- import { fg } from '@atlaskit/platform-feature-flags';
22
21
  var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
23
22
  var FADE_IN_DELAY = 500;
24
23
  var FADE_OUT_DELAY = 300;
@@ -205,9 +204,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
205
204
  var trigger = useCallback(function (triggerProps) {
206
205
  return jsx("span", {
207
206
  ref: parentSpan
208
- }, jsx("span", _extends({}, triggerProps, fg('platform-hover-card-aria-expanded-a11y-fix') && {
209
- role: 'button'
210
- }, {
207
+ }, jsx("span", _extends({}, triggerProps, {
211
208
  onMouseOver: initShowCard,
212
209
  onMouseLeave: initHideCard,
213
210
  onMouseMove: setMousePosition,
@@ -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: '22px',
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.2.0",
13
+ packageVersion: "28.3.0",
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
  }
@@ -52,4 +52,5 @@ export type CardWithUrlContentProps = {
52
52
  useLegacyBlockCard?: boolean;
53
53
  removeTextHighlightingFromTitle?: boolean;
54
54
  resolvingPlaceholder?: string;
55
+ truncateInline?: boolean;
55
56
  };
@@ -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;
@@ -28,4 +28,5 @@ export type InlineCardProps = {
28
28
  analytics: AnalyticsFacade;
29
29
  removeTextHighlightingFromTitle?: boolean;
30
30
  resolvingPlaceholder?: string;
31
+ truncateInline?: boolean;
31
32
  };
@@ -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
  }
@@ -52,4 +52,5 @@ export type CardWithUrlContentProps = {
52
52
  useLegacyBlockCard?: boolean;
53
53
  removeTextHighlightingFromTitle?: boolean;
54
54
  resolvingPlaceholder?: string;
55
+ truncateInline?: boolean;
55
56
  };
@@ -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;
@@ -28,4 +28,5 @@ export type InlineCardProps = {
28
28
  analytics: AnalyticsFacade;
29
29
  removeTextHighlightingFromTitle?: boolean;
30
30
  resolvingPlaceholder?: string;
31
+ truncateInline?: boolean;
31
32
  };