@atlaskit/smart-card 39.2.2 → 39.4.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 (108) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/extractors/flexible/index.js +3 -7
  3. package/dist/cjs/state/flexible-ui-context/index.js +3 -24
  4. package/dist/cjs/utils/analytics/analytics.js +1 -1
  5. package/dist/cjs/view/BlockCard/views/ResolvedView.js +8 -21
  6. package/dist/cjs/view/BlockCard/views/unresolved-view/index.js +6 -16
  7. package/dist/cjs/view/BlockCard/views/utils/index.js +3 -10
  8. package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +1 -2
  9. package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/index.js +7 -18
  10. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +7 -18
  11. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +7 -18
  12. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +14 -46
  13. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +5 -12
  14. package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +8 -20
  15. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -22
  16. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +8 -28
  17. package/dist/cjs/view/FlexibleCard/components/container/index.js +36 -126
  18. package/dist/cjs/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js +4 -2
  19. package/dist/cjs/view/FlexibleCard/components/elements/title-element/index.js +1 -2
  20. package/dist/cjs/view/FlexibleCard/index.js +11 -30
  21. package/dist/cjs/view/FlexibleCard/utils.js +3 -7
  22. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -1
  23. package/dist/cjs/view/HoverCard/components/views/forbidden/index.js +10 -22
  24. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +8 -21
  25. package/dist/cjs/view/HoverCard/styled.js +1 -12
  26. package/dist/cjs/view/LinkUrl/index.js +1 -1
  27. package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +0 -3
  28. package/dist/es2019/extractors/flexible/index.js +2 -7
  29. package/dist/es2019/state/flexible-ui-context/index.js +2 -23
  30. package/dist/es2019/utils/analytics/analytics.js +1 -1
  31. package/dist/es2019/view/BlockCard/views/ResolvedView.js +10 -23
  32. package/dist/es2019/view/BlockCard/views/unresolved-view/index.js +7 -17
  33. package/dist/es2019/view/BlockCard/views/utils/index.js +2 -9
  34. package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +1 -2
  35. package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/index.js +5 -16
  36. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +5 -16
  37. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +5 -16
  38. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +12 -44
  39. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +3 -10
  40. package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +7 -18
  41. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +4 -24
  42. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +7 -26
  43. package/dist/es2019/view/FlexibleCard/components/container/index.js +8 -100
  44. package/dist/es2019/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js +6 -2
  45. package/dist/es2019/view/FlexibleCard/components/elements/title-element/index.js +2 -3
  46. package/dist/es2019/view/FlexibleCard/index.js +14 -33
  47. package/dist/es2019/view/FlexibleCard/utils.js +4 -8
  48. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -2
  49. package/dist/es2019/view/HoverCard/components/views/forbidden/index.js +10 -22
  50. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +9 -22
  51. package/dist/es2019/view/HoverCard/styled.js +0 -11
  52. package/dist/es2019/view/LinkUrl/index.js +1 -1
  53. package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +0 -3
  54. package/dist/esm/extractors/flexible/index.js +4 -8
  55. package/dist/esm/state/flexible-ui-context/index.js +2 -23
  56. package/dist/esm/utils/analytics/analytics.js +1 -1
  57. package/dist/esm/view/BlockCard/views/ResolvedView.js +10 -23
  58. package/dist/esm/view/BlockCard/views/unresolved-view/index.js +7 -17
  59. package/dist/esm/view/BlockCard/views/utils/index.js +2 -9
  60. package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +1 -2
  61. package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/index.js +7 -18
  62. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +7 -18
  63. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +7 -18
  64. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +14 -46
  65. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -12
  66. package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +8 -20
  67. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +4 -23
  68. package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +8 -28
  69. package/dist/esm/view/FlexibleCard/components/container/index.js +39 -130
  70. package/dist/esm/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js +4 -2
  71. package/dist/esm/view/FlexibleCard/components/elements/title-element/index.js +2 -3
  72. package/dist/esm/view/FlexibleCard/index.js +14 -33
  73. package/dist/esm/view/FlexibleCard/utils.js +3 -7
  74. package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -2
  75. package/dist/esm/view/HoverCard/components/views/forbidden/index.js +10 -22
  76. package/dist/esm/view/HoverCard/components/views/resolved/index.js +9 -22
  77. package/dist/esm/view/HoverCard/styled.js +0 -11
  78. package/dist/esm/view/LinkUrl/index.js +1 -1
  79. package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +0 -3
  80. package/dist/types/state/flexible-ui-context/index.d.ts +0 -12
  81. package/dist/types/state/flexible-ui-context/types.d.ts +0 -7
  82. package/dist/types/view/BlockCard/views/utils/index.d.ts +0 -4
  83. package/dist/types/view/FlexibleCard/components/blocks/ai-footer-block/index.d.ts +1 -1
  84. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +1 -1
  85. package/dist/types/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -1
  86. package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -1
  87. package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -1
  88. package/dist/types/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -1
  89. package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
  90. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +1 -13
  91. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -8
  92. package/dist/types/view/FlexibleCard/components/container/index.d.ts +1 -1
  93. package/dist/types/view/HoverCard/styled.d.ts +0 -4
  94. package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +0 -12
  95. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +0 -7
  96. package/dist/types-ts4.5/view/BlockCard/views/utils/index.d.ts +0 -4
  97. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-footer-block/index.d.ts +1 -1
  98. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +1 -1
  99. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -1
  100. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -1
  101. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -1
  102. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -1
  103. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
  104. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +1 -13
  105. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +1 -8
  106. package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +1 -1
  107. package/dist/types-ts4.5/view/HoverCard/styled.d.ts +0 -4
  108. package/package.json +4 -7
@@ -2,12 +2,11 @@
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "status", "showActionOnHover", "testId", "text", "icon", "theme", "hideRetry", "metadataPosition", "hideIcon", "className", "anchorRef", "CompetitorPrompt", "url", "hideIconLoadingSkeleton"];
5
+ var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "showActionOnHover", "testId", "text", "icon", "hideRetry", "metadataPosition", "hideIcon", "className", "anchorRef", "CompetitorPrompt", "url", "hideIconLoadingSkeleton"];
6
6
  import "./index.compiled.css";
7
7
  import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  import { useCallback, useState } from 'react';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { SmartLinkStatus } from '../../../../../constants';
12
11
  import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
13
12
  import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
@@ -54,15 +53,11 @@ var TitleBlock = function TitleBlock(_ref) {
54
53
  hideTitleTooltip = _ref.hideTitleTooltip,
55
54
  maxLines = _ref.maxLines,
56
55
  onActionMenuOpenChange = _ref.onActionMenuOpenChange,
57
- onClick = _ref.onClick,
58
- _ref$status = _ref.status,
59
- statusProp = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
60
56
  showActionOnHover = _ref.showActionOnHover,
61
57
  _ref$testId = _ref.testId,
62
58
  testId = _ref$testId === void 0 ? 'smart-block-title' : _ref$testId,
63
59
  text = _ref.text,
64
60
  icon = _ref.icon,
65
- theme = _ref.theme,
66
61
  hideRetry = _ref.hideRetry,
67
62
  metadataPosition = _ref.metadataPosition,
68
63
  _ref$hideIcon = _ref.hideIcon,
@@ -73,18 +68,11 @@ var TitleBlock = function TitleBlock(_ref) {
73
68
  url = _ref.url,
74
69
  hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton,
75
70
  props = _objectWithoutProperties(_ref, _excluded);
76
- var cardContext = fg('platform-linking-flexible-card-context') ?
77
- // eslint-disable-next-line react-hooks/rules-of-hooks
78
- useFlexibleCardContext() : undefined;
71
+ var cardContext = useFlexibleCardContext();
79
72
  var _ref2 = cardContext || {},
80
73
  _ref2$status = _ref2.status,
81
74
  status = _ref2$status === void 0 ? SmartLinkStatus.Fallback : _ref2$status,
82
75
  ui = _ref2.ui;
83
- if (!fg('platform-linking-flexible-card-unresolved-action')) {
84
- if (hideRetry && props.retry) {
85
- delete props.retry;
86
- }
87
- }
88
76
  var _useState = useState(false),
89
77
  _useState2 = _slicedToArray(_useState, 2),
90
78
  actionDropdownOpen = _useState2[0],
@@ -108,16 +96,13 @@ var TitleBlock = function TitleBlock(_ref) {
108
96
  var onMouseDown = useMouseDownEvent();
109
97
  var title = /*#__PURE__*/React.createElement(Title, _extends({
110
98
  hideTooltip: hideTitleTooltip,
111
- maxLines: maxLines
112
- }, fg('platform-linking-flexible-card-context') ? undefined : {
113
- onClick: onClick
114
- }, {
99
+ maxLines: maxLines,
115
100
  onMouseDown: onMouseDown,
116
101
  target: anchorTarget,
117
- theme: fg('platform-linking-flexible-card-context') ? ui === null || ui === void 0 ? void 0 : ui.theme : theme,
102
+ theme: ui === null || ui === void 0 ? void 0 : ui.theme,
118
103
  anchorRef: anchorRef
119
104
  }, overrideText));
120
- var Component = getTitleBlockViewComponent(fg('platform-linking-flexible-card-context') ? status : statusProp);
105
+ var Component = getTitleBlockViewComponent(status);
121
106
  return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
122
107
  actionGroup: actionGroup
123
108
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -126,16 +111,11 @@ var TitleBlock = function TitleBlock(_ref) {
126
111
  testId: testId,
127
112
  title: title,
128
113
  metadataPosition: metadataPosition,
129
- hideIcon: hideIcon
130
- }, fg('platform-linking-flexible-card-unresolved-action') ? {
131
- hideRetry: hideRetry
132
- } : undefined, {
114
+ hideIcon: hideIcon,
115
+ hideRetry: hideRetry,
133
116
  icon: icon,
134
117
  hideIconLoadingSkeleton: hideIconLoadingSkeleton,
135
- size: fg('platform-linking-flexible-card-context') ? (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : ui === null || ui === void 0 ? void 0 : ui.size : props === null || props === void 0 ? void 0 : props.size
136
- }, fg('platform-linking-flexible-card-context') ? undefined : {
137
- theme: theme
138
- }, {
118
+ size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : ui === null || ui === void 0 ? void 0 : ui.size,
139
119
  CompetitorPrompt: CompetitorPrompt,
140
120
  url: url
141
121
  }));
@@ -1,21 +1,14 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- var _excluded = ["containerSize"];
5
- import "./index.compiled.css";
6
- import { ax, ix } from "@compiled/react/runtime";
7
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
2
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
10
3
  /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
11
-
12
- import React, { useContext } from 'react';
4
+ import "./index.compiled.css";
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ import React from 'react';
13
7
  import { di } from 'react-magnetic-di';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
- import { MediaPlacement, SmartLinkSize, SmartLinkTheme } from '../../../../constants';
16
- import { FlexibleUiContext, useFlexibleUiContext } from '../../../../state/flexible-ui-context';
8
+ import { MediaPlacement, SmartLinkSize } from '../../../../constants';
9
+ import { useFlexibleUiContext } from '../../../../state/flexible-ui-context';
17
10
  import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
18
- import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isFlexibleUiTitleBlock, isStyleCacheProvider } from '../../../../utils/flexible';
11
+ import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isStyleCacheProvider } from '../../../../utils/flexible';
19
12
  import { TitleBlock } from '../blocks';
20
13
  import HoverCardControl from './hover-card-control';
21
14
  import LayeredLink from './layered-link';
@@ -46,83 +39,6 @@ var filterChildren = function filterChildren(children, removeBlockRestriction) {
46
39
  return /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child) ? child : undefined;
47
40
  });
48
41
  };
49
- var renderChildren = function renderChildren(children, containerSize, containerTheme, status, retry, onClick, removeBlockRestriction) {
50
- return React.Children.map(children, function (child) {
51
- if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child)) {
52
- if (isFlexibleUiTitleBlock(child)) {
53
- if (isStyleCacheProvider(child)) {
54
- return updateChildrenTitleBlock(child, {
55
- onClick: onClick,
56
- retry: retry,
57
- containerSize: containerSize,
58
- status: status,
59
- theme: containerTheme
60
- });
61
- } else {
62
- var _blockSize = child.props.size;
63
- var _size = _blockSize || containerSize;
64
- return /*#__PURE__*/React.cloneElement(child, _objectSpread({
65
- // @ts-expect-error
66
- onClick: onClick,
67
- size: _size,
68
- status: status,
69
- theme: containerTheme
70
- }, fg('platform-linking-flexible-card-unresolved-action') ? undefined : {
71
- retry: retry
72
- }));
73
- }
74
- }
75
- var blockSize = child.props.size;
76
- var size = blockSize || containerSize;
77
- if (isStyleCacheProvider(child)) {
78
- return updateChildrenBlock(child, size, status);
79
- }
80
-
81
- // @ts-expect-error
82
- return /*#__PURE__*/React.cloneElement(child, {
83
- size: size,
84
- status: status
85
- });
86
- }
87
- if (removeBlockRestriction) {
88
- return child;
89
- }
90
- });
91
- };
92
- var updateChildrenBlock = function updateChildrenBlock(node, size, status) {
93
- var updatedChildren = React.Children.map(node.props.children, function (child) {
94
- if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child)) {
95
- // @ts-expect-error
96
- return /*#__PURE__*/React.cloneElement(child, {
97
- size: size,
98
- status: status
99
- });
100
- }
101
- return child;
102
- });
103
- return /*#__PURE__*/React.cloneElement(node, {
104
- children: updatedChildren
105
- });
106
- };
107
- var updateChildrenTitleBlock = function updateChildrenTitleBlock(node, _ref) {
108
- var containerSize = _ref.containerSize,
109
- props = _objectWithoutProperties(_ref, _excluded);
110
- var updatedChildren = React.Children.map(node.props.children, function (child) {
111
- if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiTitleBlock(child)) {
112
- var _ref2 = child.props,
113
- blockSize = _ref2.size;
114
- var size = blockSize || containerSize;
115
- return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, props), {}, {
116
- size: size
117
- }));
118
- } else {
119
- return child;
120
- }
121
- });
122
- return /*#__PURE__*/React.cloneElement(node, {
123
- children: updatedChildren
124
- });
125
- };
126
42
 
127
43
  /**
128
44
  * Note: This function is only necessary for CompiledCSS within Jest tests due to the way it handles Styles.
@@ -162,19 +78,18 @@ var getTitleBlockProps = function getTitleBlockProps(children) {
162
78
  }
163
79
  };
164
80
  var getLayeredLink = function getLayeredLink(testId, context, children, onClick) {
165
- var _ref3 = context || {},
166
- linkTitle = _ref3.linkTitle,
167
- title = _ref3.title,
168
- _ref3$url = _ref3.url,
169
- url = _ref3$url === void 0 ? '' : _ref3$url;
170
- var _ref4 = getTitleBlockProps(children) || {},
171
- target = _ref4.anchorTarget,
172
- text = _ref4.text;
81
+ var _ref = context || {},
82
+ linkTitle = _ref.linkTitle,
83
+ _ref$url = _ref.url,
84
+ url = _ref$url === void 0 ? '' : _ref$url;
85
+ var _ref2 = getTitleBlockProps(children) || {},
86
+ target = _ref2.anchorTarget,
87
+ text = _ref2.text;
173
88
  return /*#__PURE__*/React.createElement(LayeredLink, {
174
89
  onClick: onClick,
175
90
  target: target,
176
91
  testId: testId,
177
- text: text || title || (linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text),
92
+ text: text || (linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text),
178
93
  url: url
179
94
  });
180
95
  };
@@ -241,38 +156,32 @@ var previewOnRightStyleMap = {
241
156
  * @internal
242
157
  * @see Block
243
158
  */
244
- var Container = function Container(_ref5) {
245
- var children = _ref5.children,
246
- _ref5$clickableContai = _ref5.clickableContainer,
247
- clickableContainer = _ref5$clickableContai === void 0 ? false : _ref5$clickableContai,
248
- _ref5$hideBackground = _ref5.hideBackground,
249
- hideBackground = _ref5$hideBackground === void 0 ? false : _ref5$hideBackground,
250
- _ref5$hideElevation = _ref5.hideElevation,
251
- hideElevation = _ref5$hideElevation === void 0 ? false : _ref5$hideElevation,
252
- _ref5$hidePadding = _ref5.hidePadding,
253
- hidePadding = _ref5$hidePadding === void 0 ? false : _ref5$hidePadding,
254
- onClick = _ref5.onClick,
255
- retry = _ref5.retry,
256
- _ref5$showHoverPrevie = _ref5.showHoverPreview,
257
- showHoverPreview = _ref5$showHoverPrevie === void 0 ? false : _ref5$showHoverPrevie,
258
- hoverPreviewOptions = _ref5.hoverPreviewOptions,
259
- actionOptions = _ref5.actionOptions,
260
- _ref5$removeBlockRest = _ref5.removeBlockRestriction,
261
- removeBlockRestriction = _ref5$removeBlockRest === void 0 ? false : _ref5$removeBlockRest,
262
- _ref5$size = _ref5.size,
263
- size = _ref5$size === void 0 ? SmartLinkSize.Medium : _ref5$size,
264
- status = _ref5.status,
265
- _ref5$testId = _ref5.testId,
266
- testId = _ref5$testId === void 0 ? 'smart-links-container' : _ref5$testId,
267
- _ref5$theme = _ref5.theme,
268
- theme = _ref5$theme === void 0 ? SmartLinkTheme.Link : _ref5$theme;
159
+ var Container = function Container(_ref3) {
160
+ var children = _ref3.children,
161
+ _ref3$clickableContai = _ref3.clickableContainer,
162
+ clickableContainer = _ref3$clickableContai === void 0 ? false : _ref3$clickableContai,
163
+ _ref3$hideBackground = _ref3.hideBackground,
164
+ hideBackground = _ref3$hideBackground === void 0 ? false : _ref3$hideBackground,
165
+ _ref3$hideElevation = _ref3.hideElevation,
166
+ hideElevation = _ref3$hideElevation === void 0 ? false : _ref3$hideElevation,
167
+ _ref3$hidePadding = _ref3.hidePadding,
168
+ hidePadding = _ref3$hidePadding === void 0 ? false : _ref3$hidePadding,
169
+ onClick = _ref3.onClick,
170
+ retry = _ref3.retry,
171
+ _ref3$showHoverPrevie = _ref3.showHoverPreview,
172
+ showHoverPreview = _ref3$showHoverPrevie === void 0 ? false : _ref3$showHoverPrevie,
173
+ hoverPreviewOptions = _ref3.hoverPreviewOptions,
174
+ actionOptions = _ref3.actionOptions,
175
+ _ref3$removeBlockRest = _ref3.removeBlockRestriction,
176
+ removeBlockRestriction = _ref3$removeBlockRest === void 0 ? false : _ref3$removeBlockRest,
177
+ _ref3$size = _ref3.size,
178
+ size = _ref3$size === void 0 ? SmartLinkSize.Medium : _ref3$size,
179
+ status = _ref3.status,
180
+ _ref3$testId = _ref3.testId,
181
+ testId = _ref3$testId === void 0 ? 'smart-links-container' : _ref3$testId;
269
182
  var padding = hidePadding ? '0px' : getPadding(size);
270
183
  var gap = getGap(size);
271
- var context = fg('platform-linking-flexible-card-context') ?
272
- // eslint-disable-next-line react-hooks/rules-of-hooks
273
- useFlexibleUiContext() :
274
- // eslint-disable-next-line react-hooks/rules-of-hooks
275
- useContext(FlexibleUiContext);
184
+ var context = useFlexibleUiContext();
276
185
  var _getChildrenOptions = getChildrenOptions(children, context),
277
186
  previewOnLeft = _getChildrenOptions.previewOnLeft,
278
187
  previewOnRight = _getChildrenOptions.previewOnRight;
@@ -291,7 +200,7 @@ var Container = function Container(_ref5) {
291
200
  "--_12k13bg": ix(previewOnRight ? gap : padding),
292
201
  "--_18x9sjc": ix("1px solid ".concat("var(--ds-border, #091E4224)"))
293
202
  }
294
- }, clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, fg('platform-linking-flexible-card-context') ? filterChildren(children, removeBlockRestriction) : renderChildren(children, size, theme, status, retry, onClick, removeBlockRestriction));
203
+ }, clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, filterChildren(children, removeBlockRestriction));
295
204
  if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
296
205
  return /*#__PURE__*/React.createElement(HoverCardControl, {
297
206
  isHoverPreview: canShowHoverPreview,
@@ -1,4 +1,5 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import "./index.compiled.css";
4
5
  import * as React from 'react';
@@ -8,6 +9,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
8
9
  import { useMemo } from 'react';
9
10
  import { useIntl } from 'react-intl-next';
10
11
  import AtlaskitAvatarGroup from '@atlaskit/avatar-group';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
11
13
  import { ElementName, SmartLinkSize } from '../../../../../../constants';
12
14
  import { messages } from '../../../../../../messages';
13
15
  import { getFormattedMessageAsString } from '../../../utils';
@@ -78,14 +80,14 @@ var BaseAvatarGroup = function BaseAvatarGroup(_ref) {
78
80
  if (!data.length) {
79
81
  return null;
80
82
  }
81
- return /*#__PURE__*/React.createElement("span", {
83
+ return /*#__PURE__*/React.createElement("span", _extends({}, fg('platform-linking-enable-avatar-data-separator') ? _defineProperty({}, 'data-separator', true) : {}, {
82
84
  "data-smart-element": name,
83
85
  "data-smart-element-avatar-group": true,
84
86
  "data-testid": testId
85
87
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
86
88
  ,
87
89
  className: ax([stylesMap[size], "_1ul91ns9", className])
88
- }, /*#__PURE__*/React.createElement(AtlaskitAvatarGroup, {
90
+ }), /*#__PURE__*/React.createElement(AtlaskitAvatarGroup, {
89
91
  maxCount: maxCount,
90
92
  appearance: "stack",
91
93
  size: "small",
@@ -1,12 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { ElementName } from '../../../../../constants';
5
4
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
6
- import { BaseLinkElement, toLinkProps } from '../common';
5
+ import { BaseLinkElement } from '../common';
7
6
  var TitleElement = function TitleElement(props) {
8
7
  var context = useFlexibleUiContext();
9
- var data = context ? fg('platform-linking-flexible-card-context') ? context === null || context === void 0 ? void 0 : context.linkTitle : toLinkProps(context.title, context.url) : null;
8
+ var data = context ? context === null || context === void 0 ? void 0 : context.linkTitle : null;
10
9
  return data ? /*#__PURE__*/React.createElement(BaseLinkElement, _extends({}, data, props, {
11
10
  name: ElementName.Title
12
11
  })) : null;
@@ -1,13 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect, useMemo } from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
5
- import { SmartLinkStatus } from '../../constants';
6
- import { FlexibleCardContext, FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
4
+ import { InternalActionName, SmartLinkStatus } from '../../constants';
5
+ import { FlexibleCardContext } from '../../state/flexible-ui-context';
7
6
  import { useAISummaryConfig } from '../../state/hooks/use-ai-summary-config';
8
7
  import useResolve from '../../state/hooks/use-resolve';
9
8
  import Container from './components/container';
10
- import { getContextByStatus, getRetryOptions } from './utils';
9
+ import { getContextByStatus } from './utils';
11
10
 
12
11
  /**
13
12
  * This represents a Flexible Card: a link represented by a card with metadata.
@@ -16,6 +15,7 @@ import { getContextByStatus, getRetryOptions } from './utils';
16
15
  * @see Container
17
16
  */
18
17
  var FlexibleCard = function FlexibleCard(_ref) {
18
+ var _flexibleCardContext$;
19
19
  var _ref$appearance = _ref.appearance,
20
20
  appearance = _ref$appearance === void 0 ? 'flexible' : _ref$appearance,
21
21
  cardState = _ref.cardState,
@@ -57,20 +57,16 @@ var FlexibleCard = function FlexibleCard(_ref) {
57
57
  url: url
58
58
  });
59
59
  }, [aiSummaryConfig, appearance, fireEvent, details, id, onAuthorize, onClick, origin, renderers, resolve, actionOptions, status, url]);
60
- var flexibleCardContext = fg('platform-linking-flexible-card-context') ?
61
- // eslint-disable-next-line react-hooks/rules-of-hooks
62
- useMemo(function () {
60
+ var flexibleCardContext = useMemo(function () {
63
61
  return {
64
62
  data: context,
65
63
  status: status,
66
64
  ui: ui
67
65
  };
68
- }, [context, status, ui]) : undefined;
69
- var retry = fg('platform-linking-flexible-card-unresolved-action') ? undefined : getRetryOptions(url, status, details, onAuthorize);
66
+ }, [context, status, ui]);
70
67
  var _ref2 = context || {},
71
- linkTitle = _ref2.linkTitle,
72
- titleOld = _ref2.title;
73
- var title = fg('platform-linking-flexible-card-context') ? linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text : titleOld;
68
+ linkTitle = _ref2.linkTitle;
69
+ var title = linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text;
74
70
  useEffect(function () {
75
71
  switch (status) {
76
72
  case SmartLinkStatus.Resolved:
@@ -95,33 +91,18 @@ var FlexibleCard = function FlexibleCard(_ref) {
95
91
  break;
96
92
  }
97
93
  }, [onError, onResolve, status, title, url]);
98
- if (fg('platform-linking-flexible-card-context')) {
99
- return /*#__PURE__*/React.createElement(FlexibleCardContext.Provider, {
100
- value: flexibleCardContext
101
- }, /*#__PURE__*/React.createElement(Container, _extends({
102
- testId: testId
103
- }, ui, {
104
- onClick: onClick,
105
- retry: retry,
106
- showHoverPreview: showHoverPreview,
107
- hoverPreviewOptions: hoverPreviewOptions,
108
- actionOptions: actionOptions,
109
- status: status
110
- }), children));
111
- }
112
- return /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
113
- value: ui
114
- }, /*#__PURE__*/React.createElement(FlexibleUiContext.Provider, {
115
- value: context
94
+ var retry = (_flexibleCardContext$ = flexibleCardContext.data) === null || _flexibleCardContext$ === void 0 || (_flexibleCardContext$ = _flexibleCardContext$.actions) === null || _flexibleCardContext$ === void 0 ? void 0 : _flexibleCardContext$[InternalActionName.UnresolvedAction];
95
+ return /*#__PURE__*/React.createElement(FlexibleCardContext.Provider, {
96
+ value: flexibleCardContext
116
97
  }, /*#__PURE__*/React.createElement(Container, _extends({
117
98
  testId: testId
118
99
  }, ui, {
119
100
  onClick: onClick,
120
- retry: retry,
121
101
  showHoverPreview: showHoverPreview,
122
102
  hoverPreviewOptions: hoverPreviewOptions,
123
103
  actionOptions: actionOptions,
124
- status: status
125
- }), children)));
104
+ status: status,
105
+ retry: retry
106
+ }), children));
126
107
  };
127
108
  export default FlexibleCard;
@@ -23,12 +23,9 @@ export var getContextByStatus = function getContextByStatus(params) {
23
23
  switch (status) {
24
24
  case SmartLinkStatus.Pending:
25
25
  case SmartLinkStatus.Resolving:
26
- return fg('platform-linking-flexible-card-context') ? {
26
+ return {
27
27
  linkTitle: extractLinkTitle(status, url, response, onClick),
28
28
  url: url
29
- } : {
30
- title: url,
31
- url: url
32
29
  };
33
30
  case SmartLinkStatus.Resolved:
34
31
  return extractFlexibleUiContext(params);
@@ -40,12 +37,11 @@ export var getContextByStatus = function getContextByStatus(params) {
40
37
  default:
41
38
  return _objectSpread({
42
39
  url: url,
43
- title: fg('platform-linking-flexible-card-context') ? undefined : url,
44
40
  linkIcon: extractErrorIcon(response, status),
45
- linkTitle: fg('platform-linking-flexible-card-context') ? extractLinkTitle(status, url, response, onClick) : undefined,
41
+ linkTitle: extractLinkTitle(status, url, response, onClick),
46
42
  preview: extractSmartLinkPreviewImage(response),
47
43
  provider: extractSmartLinkProviderIcon(response),
48
- actions: fg('platform-linking-flexible-card-unresolved-action') ? _defineProperty({}, InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize)) : undefined
44
+ actions: _defineProperty({}, InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize))
49
45
  }, fg('bandicoots-smart-card-teamwork-context') ? {
50
46
  meta: {
51
47
  accessType: response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.requestAccess) === null || _response$meta === void 0 ? void 0 : _response$meta.accessType
@@ -9,7 +9,7 @@ import { useSmartCardState } from '../../../state/store';
9
9
  import { isSpecialEvent } from '../../../utils';
10
10
  import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
11
11
  import { fireLinkClickedEvent } from '../../../utils/analytics/click';
12
- import { flexibleUiOptions, flexibleUiOptionsOld } from '../styled';
12
+ import { flexibleUiOptions } from '../styled';
13
13
  import { getMetadata } from '../utils';
14
14
  import ContentContainer from './ContentContainer';
15
15
  import HoverCardForbiddenView from './views/forbidden';
@@ -105,7 +105,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
105
105
  position: SmartLinkPosition.Center,
106
106
  subtitle: subtitle
107
107
  };
108
- var uiOptions = fg('platform-linking-flexible-card-context') ? flexibleUiOptions : flexibleUiOptionsOld;
108
+ var uiOptions = flexibleUiOptions;
109
109
  if (fg('cc-ai-linking-platform-snippet-renderer')) {
110
110
  uiOptions.enableSnippetRenderer = true;
111
111
  }
@@ -9,7 +9,6 @@ import ButtonOld from '@atlaskit/button';
9
9
  import Button from '@atlaskit/button/new';
10
10
  import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
- import { SmartLinkStatus } from '../../../../../constants';
13
12
  import { extractRequestAccessContextImproved } from '../../../../../extractors/common/context/extractAccessContext';
14
13
  import extractHostname from '../../../../../extractors/common/hostname/extractHostname';
15
14
  import { messages } from '../../../../../messages';
@@ -47,39 +46,28 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
47
46
  var ButtonComponent = fg('platform-smart-card-remove-legacy-button') ? Button : ButtonOld;
48
47
  return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
49
48
  testId: testId
50
- }), /*#__PURE__*/React.createElement(PreviewBlock, _extends({
49
+ }), /*#__PURE__*/React.createElement(PreviewBlock, {
51
50
  ignoreContainerPadding: true,
52
- testId: testId
53
- }, fg('platform-linking-flexible-card-context') ? undefined : {
54
- status: SmartLinkStatus.Forbidden
55
- }, {
51
+ testId: testId,
56
52
  className: ax(["_13lipd34 _qrwqpd34 _otyru2gc"])
57
- })), /*#__PURE__*/React.createElement(CustomBlock, _extends({
58
- testId: "".concat(testId, "-title")
59
- }, fg('platform-linking-flexible-card-context') ? undefined : {
60
- status: SmartLinkStatus.Forbidden
61
- }, {
53
+ }), /*#__PURE__*/React.createElement(CustomBlock, {
54
+ testId: "".concat(testId, "-title"),
62
55
  className: ax(["_1bah1h6o _k48p1pd9 _19pku2gc"])
63
- }), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[titleMessageKey], {
56
+ }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[titleMessageKey], {
64
57
  values: {
65
58
  product: product
66
59
  }
67
- }))), /*#__PURE__*/React.createElement(CustomBlock, _extends({
68
- testId: "".concat(testId, "-content")
69
- }, fg('platform-linking-flexible-card-context') ? undefined : {
70
- status: SmartLinkStatus.Forbidden
71
- }, {
60
+ }))), /*#__PURE__*/React.createElement(CustomBlock, {
61
+ testId: "".concat(testId, "-content"),
72
62
  className: ax(["_11c8dcr7 _1e0c1nu9 _1bah1h6o _19pkze3t _y3gn1h6o"])
73
- }), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
63
+ }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
74
64
  values: {
75
65
  product: product,
76
66
  hostname: hostname
77
67
  }
78
- }))), action && /*#__PURE__*/React.createElement(CustomBlock, _extends({}, fg('platform-linking-flexible-card-context') ? undefined : {
79
- status: SmartLinkStatus.Forbidden
80
- }, {
68
+ }))), action && /*#__PURE__*/React.createElement(CustomBlock, {
81
69
  className: ax(["_1bah1h6o _19pku2gc"])
82
- }), /*#__PURE__*/React.createElement(ButtonComponent, {
70
+ }, /*#__PURE__*/React.createElement(ButtonComponent, {
83
71
  testId: "".concat(testId, "-button"),
84
72
  onClick: action === null || action === void 0 ? void 0 : action.promise,
85
73
  appearance: "primary",
@@ -3,9 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
8
- import { CardDisplay, SmartLinkPosition, SmartLinkSize, SmartLinkStatus } from '../../../../../constants';
7
+ import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
9
8
  import { succeedUfoExperience } from '../../../../../state/analytics';
10
9
  import FlexibleCard from '../../../../FlexibleCard';
11
10
  import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
@@ -58,40 +57,28 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
58
57
  fallbackElementHeight: snippetHeight.current,
59
58
  response: cardState.details
60
59
  });
61
- var snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock, _extends({}, fg('platform-linking-flexible-card-context') ? undefined : {
62
- status: SmartLinkStatus.Resolved
63
- }, {
60
+ var snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock, {
64
61
  className: ax(["_ca0q1b66"])
65
- }));
62
+ });
66
63
  var aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
67
64
  return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
68
- metadataPosition: SmartLinkPosition.Top
69
- }, fg('platform-linking-flexible-card-context') ? undefined : {
70
- status: SmartLinkStatus.Resolved
71
- }, {
65
+ metadataPosition: SmartLinkPosition.Top,
72
66
  className: ax(["_zulpu2gc _quenze3t _oebj1txw _13mh1pd9"])
73
- })), /*#__PURE__*/React.createElement(MetadataBlock, _extends({
67
+ })), /*#__PURE__*/React.createElement(MetadataBlock, {
74
68
  primary: primary,
75
69
  secondary: secondary,
76
70
  maxLines: 1,
77
71
  size: SmartLinkSize.Medium
78
- }, fg('platform-linking-flexible-card-context') ? undefined : {
79
- status: SmartLinkStatus.Resolved
80
- })), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, _extends({
72
+ }), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
81
73
  aiSummaryMinHeight: aiSummaryMinHeight,
82
74
  placeholder: snippet
83
- }, fg('platform-linking-flexible-card-context') ? undefined : {
84
- status: SmartLinkStatus.Resolved
85
- })) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, _extends({
75
+ }) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
86
76
  testId: "hidden-snippet",
87
77
  onRender: onSnippetRender,
88
- blockRef: snippetBlockRef
89
- }, fg('platform-linking-flexible-card-context') ? undefined : {
90
- status: SmartLinkStatus.Resolved
91
- }, {
78
+ blockRef: snippetBlockRef,
92
79
  isHidden: true,
93
80
  className: ax(["_3um015vq _kqswstnw"])
94
- })), /*#__PURE__*/React.createElement(ActionBlock, {
81
+ }), /*#__PURE__*/React.createElement(ActionBlock, {
95
82
  onClick: onActionClick,
96
83
  spaceInline: "space.100",
97
84
  className: ax(["_n3td1b66"])
@@ -2,17 +2,6 @@ import { layers } from '@atlaskit/theme/constants';
2
2
  import { SmartLinkSize } from '../../constants';
3
3
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
4
4
  export var HOVER_CARD_Z_INDEX = layers.modal();
5
-
6
- /**
7
- * @deprecated Remove on platform-linking-flexible-card-context cleanup
8
- */
9
- export var flexibleUiOptionsOld = {
10
- hideBackground: true,
11
- hideElevation: true,
12
- hideLegacyButton: true,
13
- size: SmartLinkSize.Medium,
14
- zIndex: HOVER_CARD_Z_INDEX + 1
15
- };
16
5
  export var flexibleUiOptions = {
17
6
  hideBackground: true,
18
7
  hideElevation: true,
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  var PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "39.2.1",
16
+ packageVersion: "39.3.0",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');