@atlaskit/smart-card 23.7.2 → 23.8.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 (220) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/constants.js +14 -2
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -1
  4. package/dist/cjs/i18n/cs.js +6 -1
  5. package/dist/cjs/i18n/da.js +7 -1
  6. package/dist/cjs/i18n/de.js +6 -1
  7. package/dist/cjs/i18n/en.js +8 -1
  8. package/dist/cjs/i18n/en_GB.js +8 -1
  9. package/dist/cjs/i18n/es.js +5 -1
  10. package/dist/cjs/i18n/fi.js +7 -1
  11. package/dist/cjs/i18n/fr.js +7 -1
  12. package/dist/cjs/i18n/hu.js +6 -1
  13. package/dist/cjs/i18n/it.js +7 -1
  14. package/dist/cjs/i18n/ja.js +11 -5
  15. package/dist/cjs/i18n/ko.js +7 -1
  16. package/dist/cjs/i18n/nb.js +6 -1
  17. package/dist/cjs/i18n/nl.js +7 -1
  18. package/dist/cjs/i18n/pl.js +6 -1
  19. package/dist/cjs/i18n/pt_BR.js +7 -1
  20. package/dist/cjs/i18n/ru.js +7 -1
  21. package/dist/cjs/i18n/sv.js +7 -1
  22. package/dist/cjs/i18n/th.js +7 -1
  23. package/dist/cjs/i18n/tr.js +6 -1
  24. package/dist/cjs/i18n/uk.js +6 -1
  25. package/dist/cjs/i18n/vi.js +7 -1
  26. package/dist/cjs/i18n/zh.js +6 -1
  27. package/dist/cjs/i18n/zh_TW.js +6 -1
  28. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +41 -13
  29. package/dist/cjs/utils/analytics/analytics.js +128 -96
  30. package/dist/cjs/utils/analytics/index.js +12 -0
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +1 -1
  33. package/dist/cjs/view/BlockCard/index.js +4 -2
  34. package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  35. package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +3 -3
  36. package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +17 -4
  37. package/dist/cjs/view/CardWithUrl/component.js +3 -1
  38. package/dist/cjs/view/EmbedCard/index.js +6 -2
  39. package/dist/cjs/view/EmbedCard/views/UnauthorisedView.js +21 -4
  40. package/dist/cjs/view/EmbedModal/components/analytics/index.js +4 -2
  41. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +11 -10
  42. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +6 -4
  43. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +1 -1
  44. package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +26 -7
  45. package/dist/cjs/view/HoverCard/index.js +6 -3
  46. package/dist/cjs/view/HoverCard/utils.js +1 -4
  47. package/dist/cjs/view/InlineCard/ErroredView/index.js +6 -11
  48. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +17 -21
  49. package/dist/cjs/view/InlineCard/Frame/index.js +4 -4
  50. package/dist/cjs/view/InlineCard/Frame/styled.js +22 -34
  51. package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +52 -7
  52. package/dist/cjs/view/InlineCard/ResolvingView/index.js +3 -5
  53. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +10 -12
  54. package/dist/cjs/view/InlineCard/index.js +2 -1
  55. package/dist/cjs/view/InlineCard/styled.js +2 -2
  56. package/dist/cjs/view/common/UnauthorisedViewContent.js +14 -3
  57. package/dist/es2019/constants.js +12 -1
  58. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +2 -1
  59. package/dist/es2019/i18n/cs.js +6 -1
  60. package/dist/es2019/i18n/da.js +7 -1
  61. package/dist/es2019/i18n/de.js +6 -1
  62. package/dist/es2019/i18n/en.js +8 -1
  63. package/dist/es2019/i18n/en_GB.js +8 -1
  64. package/dist/es2019/i18n/es.js +5 -1
  65. package/dist/es2019/i18n/fi.js +7 -1
  66. package/dist/es2019/i18n/fr.js +7 -1
  67. package/dist/es2019/i18n/hu.js +6 -1
  68. package/dist/es2019/i18n/it.js +7 -1
  69. package/dist/es2019/i18n/ja.js +11 -5
  70. package/dist/es2019/i18n/ko.js +7 -1
  71. package/dist/es2019/i18n/nb.js +6 -1
  72. package/dist/es2019/i18n/nl.js +7 -1
  73. package/dist/es2019/i18n/pl.js +6 -1
  74. package/dist/es2019/i18n/pt_BR.js +7 -1
  75. package/dist/es2019/i18n/ru.js +7 -1
  76. package/dist/es2019/i18n/sv.js +7 -1
  77. package/dist/es2019/i18n/th.js +7 -1
  78. package/dist/es2019/i18n/tr.js +6 -1
  79. package/dist/es2019/i18n/uk.js +6 -1
  80. package/dist/es2019/i18n/vi.js +7 -1
  81. package/dist/es2019/i18n/zh.js +6 -1
  82. package/dist/es2019/i18n/zh_TW.js +6 -1
  83. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +33 -8
  84. package/dist/es2019/utils/analytics/analytics.js +28 -4
  85. package/dist/es2019/utils/analytics/index.js +1 -1
  86. package/dist/es2019/version.json +1 -1
  87. package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +1 -1
  88. package/dist/es2019/view/BlockCard/index.js +4 -2
  89. package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  90. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
  91. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +15 -3
  92. package/dist/es2019/view/CardWithUrl/component.js +2 -1
  93. package/dist/es2019/view/EmbedCard/index.js +6 -2
  94. package/dist/es2019/view/EmbedCard/views/UnauthorisedView.js +14 -3
  95. package/dist/es2019/view/EmbedModal/components/analytics/index.js +3 -2
  96. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +11 -10
  97. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +8 -6
  98. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +3 -3
  99. package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +23 -7
  100. package/dist/es2019/view/HoverCard/index.js +6 -3
  101. package/dist/es2019/view/HoverCard/utils.js +0 -1
  102. package/dist/es2019/view/InlineCard/ErroredView/index.js +7 -9
  103. package/dist/es2019/view/InlineCard/ForbiddenView/index.js +8 -9
  104. package/dist/es2019/view/InlineCard/Frame/index.js +4 -4
  105. package/dist/es2019/view/InlineCard/Frame/styled.js +18 -31
  106. package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +47 -6
  107. package/dist/es2019/view/InlineCard/ResolvingView/index.js +3 -5
  108. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +11 -11
  109. package/dist/es2019/view/InlineCard/index.js +2 -1
  110. package/dist/es2019/view/InlineCard/styled.js +1 -6
  111. package/dist/es2019/view/common/UnauthorisedViewContent.js +18 -11
  112. package/dist/esm/constants.js +12 -1
  113. package/dist/esm/extractors/common/actions/extractPreviewAction.js +2 -1
  114. package/dist/esm/i18n/cs.js +6 -1
  115. package/dist/esm/i18n/da.js +7 -1
  116. package/dist/esm/i18n/de.js +6 -1
  117. package/dist/esm/i18n/en.js +8 -1
  118. package/dist/esm/i18n/en_GB.js +8 -1
  119. package/dist/esm/i18n/es.js +5 -1
  120. package/dist/esm/i18n/fi.js +7 -1
  121. package/dist/esm/i18n/fr.js +7 -1
  122. package/dist/esm/i18n/hu.js +6 -1
  123. package/dist/esm/i18n/it.js +7 -1
  124. package/dist/esm/i18n/ja.js +11 -5
  125. package/dist/esm/i18n/ko.js +7 -1
  126. package/dist/esm/i18n/nb.js +6 -1
  127. package/dist/esm/i18n/nl.js +7 -1
  128. package/dist/esm/i18n/pl.js +6 -1
  129. package/dist/esm/i18n/pt_BR.js +7 -1
  130. package/dist/esm/i18n/ru.js +7 -1
  131. package/dist/esm/i18n/sv.js +7 -1
  132. package/dist/esm/i18n/th.js +7 -1
  133. package/dist/esm/i18n/tr.js +6 -1
  134. package/dist/esm/i18n/uk.js +6 -1
  135. package/dist/esm/i18n/vi.js +7 -1
  136. package/dist/esm/i18n/zh.js +6 -1
  137. package/dist/esm/i18n/zh_TW.js +6 -1
  138. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +42 -14
  139. package/dist/esm/utils/analytics/analytics.js +118 -92
  140. package/dist/esm/utils/analytics/index.js +1 -1
  141. package/dist/esm/version.json +1 -1
  142. package/dist/esm/view/BlockCard/components/flexible/footer/index.js +1 -1
  143. package/dist/esm/view/BlockCard/index.js +4 -2
  144. package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +1 -1
  145. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +4 -4
  146. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +18 -5
  147. package/dist/esm/view/CardWithUrl/component.js +2 -1
  148. package/dist/esm/view/EmbedCard/index.js +6 -2
  149. package/dist/esm/view/EmbedCard/views/UnauthorisedView.js +15 -4
  150. package/dist/esm/view/EmbedModal/components/analytics/index.js +3 -2
  151. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +11 -10
  152. package/dist/esm/view/HoverCard/components/HoverCardContent.js +8 -6
  153. package/dist/esm/view/HoverCard/components/views/resolved/index.js +3 -3
  154. package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +27 -9
  155. package/dist/esm/view/HoverCard/index.js +6 -3
  156. package/dist/esm/view/HoverCard/utils.js +0 -1
  157. package/dist/esm/view/InlineCard/ErroredView/index.js +7 -9
  158. package/dist/esm/view/InlineCard/ForbiddenView/index.js +18 -20
  159. package/dist/esm/view/InlineCard/Frame/index.js +4 -4
  160. package/dist/esm/view/InlineCard/Frame/styled.js +17 -31
  161. package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +49 -7
  162. package/dist/esm/view/InlineCard/ResolvingView/index.js +3 -5
  163. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +11 -11
  164. package/dist/esm/view/InlineCard/index.js +2 -1
  165. package/dist/esm/view/InlineCard/styled.js +2 -2
  166. package/dist/esm/view/common/UnauthorisedViewContent.js +8 -3
  167. package/dist/types/constants.d.ts +8 -0
  168. package/dist/types/i18n/cs.d.ts +5 -0
  169. package/dist/types/i18n/da.d.ts +6 -0
  170. package/dist/types/i18n/de.d.ts +5 -0
  171. package/dist/types/i18n/en.d.ts +7 -0
  172. package/dist/types/i18n/en_GB.d.ts +7 -0
  173. package/dist/types/i18n/es.d.ts +4 -0
  174. package/dist/types/i18n/fi.d.ts +6 -0
  175. package/dist/types/i18n/fr.d.ts +6 -0
  176. package/dist/types/i18n/hu.d.ts +5 -0
  177. package/dist/types/i18n/it.d.ts +6 -0
  178. package/dist/types/i18n/ja.d.ts +6 -0
  179. package/dist/types/i18n/ko.d.ts +6 -0
  180. package/dist/types/i18n/nb.d.ts +5 -0
  181. package/dist/types/i18n/nl.d.ts +6 -0
  182. package/dist/types/i18n/pl.d.ts +5 -0
  183. package/dist/types/i18n/pt_BR.d.ts +6 -0
  184. package/dist/types/i18n/ru.d.ts +6 -0
  185. package/dist/types/i18n/sv.d.ts +6 -0
  186. package/dist/types/i18n/th.d.ts +6 -0
  187. package/dist/types/i18n/tr.d.ts +5 -0
  188. package/dist/types/i18n/uk.d.ts +5 -0
  189. package/dist/types/i18n/vi.d.ts +6 -0
  190. package/dist/types/i18n/zh.d.ts +5 -0
  191. package/dist/types/i18n/zh_TW.d.ts +5 -0
  192. package/dist/types/state/actions/index.d.ts +1 -2
  193. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +17 -4
  194. package/dist/types/state/flexible-ui-context/index.d.ts +8 -4
  195. package/dist/types/state/hooks/useSmartLink.d.ts +5 -3
  196. package/dist/types/utils/analytics/analytics.d.ts +4 -2
  197. package/dist/types/utils/analytics/index.d.ts +1 -1
  198. package/dist/types/utils/analytics/types.d.ts +2 -0
  199. package/dist/types/utils/mocks.d.ts +4 -2
  200. package/dist/types/utils/types.d.ts +1 -1
  201. package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +1 -1
  202. package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +1 -1
  203. package/dist/types/view/BlockCard/views/flexible/types.d.ts +17 -13
  204. package/dist/types/view/Card/types.d.ts +1 -1
  205. package/dist/types/view/EmbedCard/views/UnauthorisedView.d.ts +3 -0
  206. package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +15 -4
  207. package/dist/types/view/HoverCard/types.d.ts +0 -2
  208. package/dist/types/view/HoverCard/utils.d.ts +0 -1
  209. package/dist/types/view/InlineCard/ErroredView/index.d.ts +1 -1
  210. package/dist/types/view/InlineCard/ForbiddenView/index.d.ts +1 -1
  211. package/dist/types/view/InlineCard/Frame/index.d.ts +0 -1
  212. package/dist/types/view/InlineCard/Frame/styled.d.ts +3 -2
  213. package/dist/types/view/InlineCard/IconAndTitleLayout/index.d.ts +5 -0
  214. package/dist/types/view/InlineCard/ResolvingView/index.d.ts +0 -1
  215. package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +3 -1
  216. package/dist/types/view/InlineCard/styled.d.ts +1 -1
  217. package/dist/types/view/common/UnauthorisedViewContent.d.ts +7 -1
  218. package/package.json +5 -5
  219. package/report.api.md +15 -1
  220. package/tmp/api-report-tmp.d.ts +8 -4
@@ -10,14 +10,13 @@ import { useSmartLinkRenderers } from '../../../state/renderers';
10
10
  import { useSmartCardState as useLinkState } from '../../../state/store';
11
11
  import HoverCardContent from '../components/HoverCardContent';
12
12
  import { HoverCardContainer, CARD_GAP_PX } from '../styled';
13
- import { SMART_CARD_ANALYTICS_DISPLAY } from '../utils';
13
+ import { CardDisplay } from '../../../constants';
14
14
  export var hoverCardClassName = 'smart-links-hover-preview';
15
15
  export var HoverCardComponent = function HoverCardComponent(_ref) {
16
16
  var children = _ref.children,
17
17
  url = _ref.url,
18
18
  analyticsHandler = _ref.analyticsHandler,
19
- analytics = _ref.analytics,
20
- onAuthorize = _ref.onAuthorize;
19
+ analytics = _ref.analytics;
21
20
  var delay = 300;
22
21
 
23
22
  var _React$useState = React.useState(false),
@@ -33,6 +32,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
33
32
  var parentSpan = useRef(null);
34
33
  var renderers = useSmartLinkRenderers();
35
34
  var linkState = useLinkState(url);
35
+ var linkStatus = linkState.status;
36
36
  var hoverDisplay = 'card';
37
37
  var invokeMethod = 'mouse_hover';
38
38
  var setMousePosition = useCallback(function (event) {
@@ -52,12 +52,13 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
52
52
  analytics.ui.hoverCardDismissedEvent({
53
53
  previewDisplay: 'card',
54
54
  hoverTime: hoverTime,
55
- previewInvokeMethod: 'mouse_hover'
55
+ previewInvokeMethod: 'mouse_hover',
56
+ status: linkStatus
56
57
  });
57
58
  }
58
59
 
59
60
  setIsOpen(false);
60
- }, [analytics.ui, isOpen]);
61
+ }, [analytics.ui, isOpen, linkStatus]);
61
62
  var initHideCard = useCallback(function () {
62
63
  if (fadeInTimeoutId.current) {
63
64
  clearTimeout(fadeInTimeoutId.current);
@@ -80,7 +81,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
80
81
  cardOpenTime.current = Date.now();
81
82
  analytics.ui.hoverCardViewedEvent({
82
83
  previewDisplay: hoverDisplay,
83
- previewInvokeMethod: invokeMethod
84
+ previewInvokeMethod: invokeMethod,
85
+ status: linkStatus
84
86
  });
85
87
  } //If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
86
88
 
@@ -95,10 +97,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
95
97
 
96
98
  setIsOpen(true);
97
99
  }, delay);
98
- }, [isOpen, setMousePosition, analytics.ui]);
100
+ }, [isOpen, setMousePosition, analytics.ui, linkStatus]);
99
101
  var linkActions = useSmartLinkActions({
100
102
  url: url,
101
- appearance: SMART_CARD_ANALYTICS_DISPLAY,
103
+ appearance: CardDisplay.HoverCardPreview,
102
104
  analyticsHandler: analyticsHandler,
103
105
  origin: 'smartLinkPreviewHoverCard'
104
106
  });
@@ -134,8 +136,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
134
136
  onActionClick: onActionClick,
135
137
  onResolve: update,
136
138
  renderers: renderers,
137
- url: url,
138
- onAuthorize: onAuthorize
139
+ url: url
139
140
  }));
140
141
  },
141
142
  trigger: function trigger(triggerProps) {
@@ -1,12 +1,12 @@
1
1
  import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
2
2
  import { extractType } from '@atlaskit/linking-common/extractors';
3
3
  import React, { useCallback, useMemo } from 'react';
4
- import { ActionName, SmartLinkPosition, SmartLinkSize } from '../../../constants';
4
+ import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
5
5
  import { extractMetadata } from '../../../extractors/hover/extractMetadata';
6
6
  import { getExtensionKey } from '../../../state/helpers';
7
7
  import { isSpecialEvent } from '../../../utils';
8
8
  import { flexibleUiOptions, titleBlockCss } from '../styled';
9
- import { getSimulatedMetadata, SMART_CARD_ANALYTICS_DISPLAY } from '../utils';
9
+ import { getSimulatedMetadata } from '../utils';
10
10
  import HoverCardLoadingView from './views/resolving';
11
11
  import HoverCardUnauthorisedView from './views/unauthorised';
12
12
  import HoverCardResolvedView from './views/resolved';
@@ -47,8 +47,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
47
47
  onActionClick = _ref.onActionClick,
48
48
  onResolve = _ref.onResolve,
49
49
  renderers = _ref.renderers,
50
- url = _ref.url,
51
- onAuthorize = _ref.onAuthorize;
50
+ url = _ref.url;
52
51
  var extensionKey = useMemo(function () {
53
52
  return getExtensionKey(cardState.details);
54
53
  }, [cardState.details]);
@@ -56,7 +55,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
56
55
  var isModifierKeyPressed = isSpecialEvent(event);
57
56
  analytics.ui.cardClickedEvent({
58
57
  id: id,
59
- display: SMART_CARD_ANALYTICS_DISPLAY,
58
+ display: CardDisplay.HoverCardPreview,
60
59
  status: cardState.status,
61
60
  isModifierKeyPressed: isModifierKeyPressed,
62
61
  actionSubjectId: 'titleGoToLink'
@@ -99,8 +98,11 @@ var HoverCardContent = function HoverCardContent(_ref) {
99
98
 
100
99
  if (cardState.status === 'unauthorized') {
101
100
  return /*#__PURE__*/React.createElement(HoverCardUnauthorisedView, {
101
+ analytics: analytics,
102
+ extensionKey: extensionKey,
103
+ id: id,
102
104
  flexibleCardProps: flexibleCardProps,
103
- onAuthorize: onAuthorize
105
+ url: url
104
106
  });
105
107
  } // if metadataStatus is 'errored' simply render using data available (normal path)
106
108
 
@@ -1,12 +1,12 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
2
  import { useFeatureFlag } from '@atlaskit/link-provider';
3
3
  import { extractType } from '@atlaskit/linking-common/extractors';
4
- import { ActionName, SmartLinkSize } from '../../../../../constants';
4
+ import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
5
5
  import { FooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
6
6
  import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
7
7
  import FlexibleCard from '../../../../FlexibleCard';
8
8
  import { useSmartCardActions } from '../../../../../state/actions';
9
- import { getSimulatedMetadata, toActionableMetadata, SMART_CARD_ANALYTICS_DISPLAY } from '../../../utils';
9
+ import { getSimulatedMetadata, toActionableMetadata } from '../../../utils';
10
10
  import SnippetOrPreview from '../../SnippetOrPreview';
11
11
  import { extractMetadata } from '../../../../../extractors/hover/extractMetadata';
12
12
  export var toFooterActions = function toFooterActions(cardActions, onActionClick) {
@@ -49,7 +49,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
49
49
  // Since this hover view is only rendered on resolved status,
50
50
  // there is no need to check for statuses.
51
51
  analytics.ui.renderSuccessEvent({
52
- display: SMART_CARD_ANALYTICS_DISPLAY,
52
+ display: CardDisplay.HoverCardPreview,
53
53
  status: cardState.status
54
54
  });
55
55
  }, [analytics.ui, cardState.status]);
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useMemo } from 'react';
2
+ import React, { useCallback, useMemo } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
4
  import FlexibleCard from '../../../../FlexibleCard';
5
5
  import { messages } from '../../../../../messages';
@@ -9,29 +9,46 @@ import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled'
9
9
  import UnauthorisedViewContent from '../../../../common/UnauthorisedViewContent';
10
10
  import ActionGroup from '../../../../FlexibleCard/components/blocks/action-group';
11
11
  import { LinkIcon } from '../../../../FlexibleCard/components/elements';
12
- import { ActionName } from '../../../../../constants';
12
+ import { ActionName, CardDisplay } from '../../../../../constants';
13
+ import { useSmartCardActions } from '../../../../../state/actions';
13
14
 
14
15
  var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
15
16
  var _cardState$details, _extractProvider;
16
17
 
17
- var flexibleCardProps = _ref.flexibleCardProps,
18
+ var analytics = _ref.analytics,
19
+ extensionKey = _ref.extensionKey,
20
+ _ref$id = _ref.id,
21
+ id = _ref$id === void 0 ? '' : _ref$id,
22
+ flexibleCardProps = _ref.flexibleCardProps,
18
23
  _ref$testId = _ref.testId,
19
24
  testId = _ref$testId === void 0 ? 'hover-card-unauthorised-view' : _ref$testId,
20
- onAuthorize = _ref.onAuthorize;
25
+ url = _ref.url;
21
26
  var cardState = flexibleCardProps.cardState;
22
27
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
23
28
  var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
29
+
30
+ var _useSmartCardActions = useSmartCardActions(id, url, analytics),
31
+ authorize = _useSmartCardActions.authorize;
32
+
33
+ var handleAuthorize = useCallback(function () {
34
+ if (authorize) {
35
+ analytics.track.appAccountAuthStarted({
36
+ extensionKey: extensionKey
37
+ });
38
+ authorize(CardDisplay.HoverCardPreview);
39
+ }
40
+ }, [authorize, extensionKey, analytics.track]);
24
41
  var actions = useMemo(function () {
25
- return onAuthorize ? [{
42
+ return [{
26
43
  name: ActionName.CustomAction,
27
44
  content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.connect_unauthorised_account_action, {
28
45
  values: {
29
46
  context: providerName
30
47
  }
31
48
  })),
32
- onClick: onAuthorize
33
- }] : [];
34
- }, [onAuthorize, providerName]);
49
+ onClick: handleAuthorize
50
+ }];
51
+ }, [handleAuthorize, providerName]);
35
52
  return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
36
53
  testId: testId
37
54
  }), /*#__PURE__*/React.createElement(CustomBlock, {
@@ -45,7 +62,8 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
45
62
  overrideCss: mainTextStyles,
46
63
  testId: "".concat(testId, "-content")
47
64
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
48
- providerName: providerName
65
+ providerName: providerName,
66
+ analytics: analytics
49
67
  }))), /*#__PURE__*/React.createElement(CustomBlock, {
50
68
  overrideCss: connectButtonStyles,
51
69
  testId: "".concat(testId, "-button")
@@ -8,7 +8,7 @@ import { ErrorBoundary } from 'react-error-boundary';
8
8
  import { useSmartLinkAnalytics } from '../../state/analytics';
9
9
  import { fireSmartLinkEvent } from '../../utils/analytics';
10
10
  import { HoverCardComponent } from './components/HoverCardComponent';
11
- import { SMART_CARD_ANALYTICS_DISPLAY } from './utils';
11
+ import { CardDisplay } from '../../constants';
12
12
 
13
13
  var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
14
14
  var url = props.url,
@@ -21,7 +21,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
21
21
  var analytics = useSmartLinkAnalytics(url, analyticsHandler, id);
22
22
  var onError = useCallback(function (error, info) {
23
23
  analytics.ui.renderFailedEvent({
24
- display: SMART_CARD_ANALYTICS_DISPLAY,
24
+ display: CardDisplay.HoverCardPreview,
25
25
  id: id,
26
26
  error: error,
27
27
  errorInfo: info
@@ -37,5 +37,8 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
37
37
  };
38
38
 
39
39
  export var HoverCard = withAnalyticsContext({
40
- source: 'smartLinkPreviewHoverCard'
40
+ source: 'smartLinkPreviewHoverCard',
41
+ attributes: {
42
+ display: CardDisplay.HoverCardPreview
43
+ }
41
44
  })(withAnalyticsEvents()(HoverCardWithErrorBoundary));
@@ -5,7 +5,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
7
  import { ElementName } from '../../constants';
8
- export var SMART_CARD_ANALYTICS_DISPLAY = 'flexible';
9
8
  export var getSimulatedMetadata = function getSimulatedMetadata() {
10
9
  var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11
10
  var types = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
@@ -20,7 +20,7 @@ import { IconAndTitleLayout } from '../IconAndTitleLayout';
20
20
  import { AKIconWrapper } from '../Icon';
21
21
  import { messages } from '../../../messages';
22
22
  import { FormattedMessage } from 'react-intl-next';
23
- import { LinkAppearance, IconStyledButton, LowercaseAppearance, NoLinkAppearance } from '../styled';
23
+ import { IconStyledButton, LowercaseAppearance } from '../styled';
24
24
  export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
25
25
  _inherits(InlineCardErroredView, _React$Component);
26
26
 
@@ -47,14 +47,11 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
47
47
  }
48
48
  });
49
49
 
50
- _defineProperty(_assertThisInitialized(_this), "renderMessage", function () {
50
+ _defineProperty(_assertThisInitialized(_this), "renderRightSide", function () {
51
51
  var _this$props = _this.props,
52
52
  onRetry = _this$props.onRetry,
53
- url = _this$props.url,
54
53
  message = _this$props.message;
55
- var link = /*#__PURE__*/React.createElement(LinkAppearance, null, url);
56
- var errorMessage = /*#__PURE__*/React.createElement(NoLinkAppearance, null, message);
57
- return !onRetry ? /*#__PURE__*/React.createElement(React.Fragment, null, link, " - ", errorMessage) : /*#__PURE__*/React.createElement(React.Fragment, null, link, " - ", errorMessage, ",\xA0", /*#__PURE__*/React.createElement(Button, {
54
+ return !onRetry ? message : /*#__PURE__*/React.createElement(React.Fragment, null, message, ', ', /*#__PURE__*/React.createElement(Button, {
58
55
  spacing: "none",
59
56
  appearance: "subtle-link",
60
57
  component: IconStyledButton,
@@ -79,8 +76,6 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
79
76
  icon = _this$props2.icon;
80
77
  return /*#__PURE__*/React.createElement(Frame, {
81
78
  testId: testId,
82
- link: url,
83
- onClick: onClick,
84
79
  isSelected: isSelected
85
80
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
86
81
  icon: icon || /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(ErrorIcon, {
@@ -88,7 +83,10 @@ export var InlineCardErroredView = /*#__PURE__*/function (_React$Component) {
88
83
  size: "small",
89
84
  primaryColor: token('color.icon.danger', R300)
90
85
  })),
91
- title: this.renderMessage()
86
+ link: url,
87
+ title: url,
88
+ onClick: onClick,
89
+ rightSide: this.renderRightSide()
92
90
  }));
93
91
  }
94
92
  }]);
@@ -21,7 +21,7 @@ import { IconAndTitleLayout } from '../IconAndTitleLayout';
21
21
  import { AKIconWrapper } from '../Icon';
22
22
  import { messages } from '../../../messages';
23
23
  import { FormattedMessage } from 'react-intl-next';
24
- import { IconStyledButton, LowercaseAppearance, LinkAppearance } from '../styled';
24
+ import { IconStyledButton, LowercaseAppearance } from '../styled';
25
25
  var FallbackForbiddenIcon = /*#__PURE__*/React.createElement(AKIconWrapper, null, /*#__PURE__*/React.createElement(LockIcon, {
26
26
  label: "error",
27
27
  size: "small",
@@ -76,21 +76,18 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
76
76
  }));
77
77
  });
78
78
 
79
- _defineProperty(_assertThisInitialized(_this), "renderMessage", function () {
80
- var _this$props4, _this$props4$requestA;
79
+ _defineProperty(_assertThisInitialized(_this), "renderRightSide", function () {
80
+ var _this$props3, _this$props3$requestA;
81
81
 
82
- var _this$props3 = _this.props,
83
- url = _this$props3.url,
84
- onAuthorise = _this$props3.onAuthorise;
85
- var link = /*#__PURE__*/React.createElement(LinkAppearance, null, url);
86
- var hasRequestAccessContextMessage = (_this$props4 = _this.props) === null || _this$props4 === void 0 ? void 0 : (_this$props4$requestA = _this$props4.requestAccessContext) === null || _this$props4$requestA === void 0 ? void 0 : _this$props4$requestA.callToActionMessageKey;
87
- return !onAuthorise && !hasRequestAccessContextMessage ? link : /*#__PURE__*/React.createElement(React.Fragment, null, link, ' - ', /*#__PURE__*/React.createElement(Button, {
82
+ var onAuthorise = _this.props.onAuthorise;
83
+ var hasRequestAccessContextMessage = (_this$props3 = _this.props) === null || _this$props3 === void 0 ? void 0 : (_this$props3$requestA = _this$props3.requestAccessContext) === null || _this$props3$requestA === void 0 ? void 0 : _this$props3$requestA.callToActionMessageKey;
84
+ return onAuthorise || hasRequestAccessContextMessage ? /*#__PURE__*/React.createElement(Button, {
88
85
  spacing: "none",
89
86
  appearance: "subtle-link",
90
87
  onClick: _this.handleRetry,
91
88
  component: IconStyledButton,
92
89
  testId: "button-connect-other-account"
93
- }, _this.renderForbiddenAccessMessage()));
90
+ }, _this.renderForbiddenAccessMessage()) : null;
94
91
  });
95
92
 
96
93
  return _this;
@@ -99,21 +96,22 @@ export var InlineCardForbiddenView = /*#__PURE__*/function (_React$Component) {
99
96
  _createClass(InlineCardForbiddenView, [{
100
97
  key: "render",
101
98
  value: function render() {
102
- var _this$props5 = this.props,
103
- url = _this$props5.url,
104
- icon = _this$props5.icon,
105
- onClick = _this$props5.onClick,
106
- isSelected = _this$props5.isSelected,
107
- _this$props5$testId = _this$props5.testId,
108
- testId = _this$props5$testId === void 0 ? 'inline-card-forbidden-view' : _this$props5$testId;
99
+ var _this$props4 = this.props,
100
+ url = _this$props4.url,
101
+ icon = _this$props4.icon,
102
+ onClick = _this$props4.onClick,
103
+ isSelected = _this$props4.isSelected,
104
+ _this$props4$testId = _this$props4.testId,
105
+ testId = _this$props4$testId === void 0 ? 'inline-card-forbidden-view' : _this$props4$testId;
109
106
  return /*#__PURE__*/React.createElement(Frame, {
110
107
  testId: testId,
111
- link: url,
112
- onClick: onClick,
113
108
  isSelected: isSelected
114
109
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
115
110
  icon: icon ? icon : FallbackForbiddenIcon,
116
- title: this.renderMessage(),
111
+ link: url,
112
+ title: url,
113
+ onClick: onClick,
114
+ rightSide: this.renderRightSide(),
117
115
  titleColor: token('color.text.subtle', N500)
118
116
  }));
119
117
  }
@@ -1,13 +1,12 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useGlobalTheme } from '@atlaskit/theme/components';
3
- import { Wrapper } from './styled';
3
+ import { WrapperAnchor, WrapperSpan } from './styled';
4
4
  export var Frame = function Frame(props) {
5
5
  var isSelected = props.isSelected,
6
6
  children = props.children,
7
7
  onClick = props.onClick,
8
8
  link = props.link,
9
9
  withoutBackground = props.withoutBackground,
10
- withoutHover = props.withoutHover,
11
10
  testId = props.testId,
12
11
  className = props.className;
13
12
  var handleClick = useCallback(function (event) {
@@ -28,14 +27,15 @@ export var Frame = function Frame(props) {
28
27
  onClick(event);
29
28
  }
30
29
  }, [onClick]);
31
- var isInteractive = Boolean(onClick); // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
30
+ var isInteractive = Boolean(onClick); // Depending on whenever Frame was given onClick or link itself we display span or anchor elements
31
+
32
+ var Wrapper = link || onClick ? WrapperAnchor : WrapperSpan; // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
32
33
  // It will be worked as part of https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-154
33
34
 
34
35
  return /*#__PURE__*/React.createElement(Wrapper, {
35
36
  theme: useGlobalTheme(),
36
37
  href: link,
37
38
  withoutBackground: withoutBackground,
38
- withoutHover: withoutHover,
39
39
  isSelected: isSelected,
40
40
  isInteractive: isInteractive,
41
41
  tabIndex: isInteractive ? 0 : undefined,
@@ -1,13 +1,12 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject;
3
+ var _templateObject, _templateObject2;
4
4
 
5
5
  import styled from '@emotion/styled';
6
6
  import { B100, B400, B50, DN40A, DN50A, N20, N40A, N50A } from '@atlaskit/theme/colors';
7
7
  import { borderRadius as akBorderRadius } from '@atlaskit/theme/constants';
8
8
  import { themed } from '@atlaskit/theme/components';
9
9
  import { token } from '@atlaskit/tokens';
10
- import { TitleWrapperClassName } from '../IconAndTitleLayout/styled';
11
10
  var BACKGROUND_COLOR_DARK = '#262B31';
12
11
  var selected = "\n cursor: pointer;\n box-shadow: 0 0 0 2px ".concat(token('color.border.selected', B100), ";\n outline: none;\n user-select: none;\n &, :hover, :focus, :active {\n text-decoration: none;\n }\n");
13
12
 
@@ -15,13 +14,13 @@ var isInteractive = function isInteractive(_ref) {
15
14
  var isInteractive = _ref.isInteractive;
16
15
 
17
16
  if (isInteractive) {
18
- return "\n cursor: pointer;\n :hover {\n background-color: ".concat(themed({
17
+ return "\n :hover {\n background-color: ".concat(themed({
19
18
  light: token('color.background.neutral.subtle.hovered', N20),
20
19
  dark: token('color.background.neutral.subtle.hovered', BACKGROUND_COLOR_DARK)
21
- }), ";\n text-decoration: none;\n }\n :active {\n background-color: ").concat(themed({
20
+ }), ";\n }\n :active {\n background-color: ").concat(themed({
22
21
  light: token('color.background.selected', B50),
23
22
  dark: token('color.background.selected', BACKGROUND_COLOR_DARK)
24
- }), ";\n text-decoration: none;\n }\n :focus {\n ").concat(selected, "\n text-decoration: none;\n }\n ");
23
+ }), ";\n }\n :focus {\n ").concat(selected, "\n }\n ");
25
24
  } else {
26
25
  return '';
27
26
  }
@@ -36,11 +35,6 @@ var isSelected = function isSelected(_ref2) {
36
35
  return 'user-select: text';
37
36
  }
38
37
  };
39
-
40
- var withoutHover = function withoutHover(_ref3) {
41
- var withoutHover = _ref3.withoutHover;
42
- return withoutHover ? "\n &:hover {\n text-decoration: none;\n }\n " : '';
43
- };
44
38
  /*
45
39
  Inline smart cards should have the following layout:
46
40
  ------------------------------------
@@ -55,28 +49,20 @@ var withoutHover = function withoutHover(_ref3) {
55
49
  // NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
56
50
 
57
51
 
58
- export var Wrapper = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n line-height: 16px;\n padding: 1px 0.24em 2px 0.24em;\n ", "\n display: inline;\n box-decoration-break: clone;\n border-radius: ", "px;\n color: ", ";\n background-color: ", ";\n ", "\n ", "\n ", ";\n ", "\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n\n &:hover span.", " {\n text-decoration: ", ";\n }\n"])), function (props) {
59
- return props.withoutBackground ? "padding-left: 0; margin-left:-2px;" : '';
60
- }, akBorderRadius(), themed({
61
- light: token('color.link', B400),
62
- dark: token('color.link', '#4794FF')
63
- }), function (props) {
64
- return props.withoutBackground ? '' : themed({
52
+ var baseWrapperStyle = function baseWrapperStyle(props) {
53
+ return "\n line-height: 16px;\n padding: 1px 0.24em 2px 0.24em;\n ".concat(props.withoutBackground ? "padding-left: 0; margin-left:-2px;" : '', "\n display: inline;\n box-decoration-break: clone;\n border-radius: ").concat(akBorderRadius(), "px;\n color: ").concat(themed({
54
+ light: token('color.link', B400),
55
+ dark: token('color.link', '#4794FF')
56
+ })(props), ";\n background-color: ").concat(props.withoutBackground ? '' : themed({
65
57
  light: token('elevation.surface.raised', 'white'),
66
58
  dark: token('elevation.surface.raised', BACKGROUND_COLOR_DARK)
67
- });
68
- }, function (props) {
69
- return props.withoutBackground ? '' : themed({
59
+ })(props), ";\n ").concat(props.withoutBackground ? '' : themed({
70
60
  light: "box-shadow: ".concat(token('elevation.shadow.raised', "0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A)), ";"),
71
61
  dark: "box-shadow: ".concat(token('elevation.shadow.raised', "0 1px 1px ".concat(DN50A, ", 0 0 1px 1px ").concat(DN40A)), ";")
72
- });
73
- }, function (props) {
74
- return isInteractive(props);
75
- }, function (props) {
76
- return isSelected(props);
77
- }, function (props) {
78
- return withoutHover(props);
79
- }, TitleWrapperClassName, function (_ref4) {
80
- var withoutHover = _ref4.withoutHover;
81
- return withoutHover ? 'none' : 'underline';
82
- });
62
+ })(props), "\n ").concat(isSelected(props), ";\n transition: 0.1s all ease-in-out;\n -moz-user-select: none;\n");
63
+ };
64
+
65
+ export var WrapperAnchor = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n"])), baseWrapperStyle, isInteractive);
66
+ WrapperAnchor.displayName = 'WrapperAnchor';
67
+ export var WrapperSpan = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), baseWrapperStyle);
68
+ WrapperSpan.displayName = 'WrapperSpan';
@@ -1,8 +1,10 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
3
4
  import _inherits from "@babel/runtime/helpers/inherits";
4
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
8
 
7
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
10
 
@@ -13,15 +15,48 @@ import ImageLoader from 'react-render-image';
13
15
  import { Icon, Shimmer } from '../Icon';
14
16
  import { IconEmptyWrapper, IconPositionWrapper, IconTitleWrapper, IconWrapper, TitleWrapper, EmojiWrapper, TitleWrapperClassName } from './styled';
15
17
  import LinkIcon from '@atlaskit/icon/glyph/link';
18
+ import { LinkAppearance, NoLinkAppearance } from '../styled';
16
19
  export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
17
20
  _inherits(IconAndTitleLayout, _React$Component);
18
21
 
19
22
  var _super = _createSuper(IconAndTitleLayout);
20
23
 
21
24
  function IconAndTitleLayout() {
25
+ var _this;
26
+
22
27
  _classCallCheck(this, IconAndTitleLayout);
23
28
 
24
- return _super.apply(this, arguments);
29
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
30
+ args[_key] = arguments[_key];
31
+ }
32
+
33
+ _this = _super.call.apply(_super, [this].concat(args));
34
+
35
+ _defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
36
+ var onClick = _this.props.onClick;
37
+
38
+ if (onClick) {
39
+ event.preventDefault();
40
+ event.stopPropagation();
41
+ onClick(event);
42
+ }
43
+ });
44
+
45
+ _defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (event) {
46
+ var onClick = _this.props.onClick;
47
+
48
+ if (event.key !== ' ' && event.key !== 'Enter') {
49
+ return;
50
+ }
51
+
52
+ if (onClick) {
53
+ event.preventDefault();
54
+ event.stopPropagation();
55
+ onClick(event);
56
+ }
57
+ });
58
+
59
+ return _this;
25
60
  }
26
61
 
27
62
  _createClass(IconAndTitleLayout, [{
@@ -103,18 +138,25 @@ export var IconAndTitleLayout = /*#__PURE__*/function (_React$Component) {
103
138
  title = _this$props2.title,
104
139
  titleColor = _this$props2.titleColor,
105
140
  titleTextColor = _this$props2.titleTextColor,
141
+ link = _this$props2.link,
142
+ rightSide = _this$props2.rightSide,
106
143
  _this$props2$testId = _this$props2.testId,
107
144
  testId = _this$props2$testId === void 0 ? 'inline-card-icon-and-title' : _this$props2$testId;
108
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconTitleWrapper, {
109
- style: {
110
- color: titleColor
111
- }
112
- }, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper, {
145
+ var titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper, {
113
146
  style: {
114
147
  color: titleTextColor
115
148
  },
116
149
  className: TitleWrapperClassName
117
- }, title)));
150
+ }, title));
151
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconTitleWrapper, {
152
+ style: {
153
+ color: titleColor
154
+ }
155
+ }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
156
+ href: link,
157
+ onClick: this.handleClick,
158
+ onKeyPress: this.handleKeyPress
159
+ }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, ' - ', rightSide) : null));
118
160
  }
119
161
  }]);
120
162
 
@@ -35,13 +35,11 @@ export var InlineCardResolvingView = /*#__PURE__*/function (_React$Component) {
35
35
  inlinePreloaderStyle = _this$props.inlinePreloaderStyle,
36
36
  _this$props$testId = _this$props.testId,
37
37
  testId = _this$props$testId === void 0 ? 'inline-card-resolving-view' : _this$props$testId,
38
- titleTextColor = _this$props.titleTextColor,
39
- withoutHover = _this$props.withoutHover;
38
+ titleTextColor = _this$props.titleTextColor;
40
39
 
41
40
  if (inlinePreloaderStyle === 'on-right-without-skeleton') {
42
41
  return /*#__PURE__*/React.createElement(Frame, {
43
42
  withoutBackground: true,
44
- withoutHover: withoutHover,
45
43
  testId: testId,
46
44
  onClick: onClick,
47
45
  isSelected: isSelected
@@ -54,9 +52,9 @@ export var InlineCardResolvingView = /*#__PURE__*/function (_React$Component) {
54
52
  return /*#__PURE__*/React.createElement(Frame, {
55
53
  testId: testId,
56
54
  onClick: onClick,
57
- isSelected: isSelected,
58
- withoutHover: withoutHover
55
+ isSelected: isSelected
59
56
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
57
+ link: url,
60
58
  title: url,
61
59
  titleTextColor: titleTextColor
62
60
  }, /*#__PURE__*/React.createElement(SpinnerWrapper, {