@atlaskit/smart-card 26.15.3 → 26.15.4

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 (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/version.json +1 -1
  3. package/dist/cjs/view/BlockCard/index.js +12 -33
  4. package/dist/cjs/view/BlockCard/views/flexible/FlexibleErroredView.js +5 -3
  5. package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +5 -3
  6. package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +5 -3
  7. package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +5 -3
  8. package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  9. package/dist/cjs/view/BlockCard/views/flexible/styled.js +10 -3
  10. package/dist/cjs/view/BlockCard/views/flexible/{utils.js → utils/index.js} +3 -3
  11. package/dist/cjs/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +18 -0
  12. package/dist/cjs/view/HoverCard/components/CustomPopupContainer.js +25 -0
  13. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +6 -2
  14. package/dist/cjs/view/HoverCard/styled.js +12 -3
  15. package/dist/es2019/version.json +1 -1
  16. package/dist/es2019/view/BlockCard/index.js +12 -34
  17. package/dist/es2019/view/BlockCard/views/flexible/FlexibleErroredView.js +6 -3
  18. package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +5 -3
  19. package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +6 -3
  20. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +5 -3
  21. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  22. package/dist/es2019/view/BlockCard/views/flexible/styled.js +16 -1
  23. package/dist/es2019/view/BlockCard/views/flexible/{utils.js → utils/index.js} +3 -3
  24. package/dist/es2019/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +8 -0
  25. package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +14 -0
  26. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -2
  27. package/dist/es2019/view/HoverCard/styled.js +12 -0
  28. package/dist/esm/version.json +1 -1
  29. package/dist/esm/view/BlockCard/index.js +12 -32
  30. package/dist/esm/view/BlockCard/views/flexible/FlexibleErroredView.js +6 -3
  31. package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +5 -3
  32. package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +6 -3
  33. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +5 -3
  34. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  35. package/dist/esm/view/BlockCard/views/flexible/styled.js +8 -2
  36. package/dist/esm/view/BlockCard/views/flexible/{utils.js → utils/index.js} +3 -3
  37. package/dist/esm/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +10 -0
  38. package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +17 -0
  39. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +6 -2
  40. package/dist/esm/view/HoverCard/styled.js +10 -2
  41. package/dist/types/view/BlockCard/views/flexible/FlexibleErroredView.d.ts +2 -9
  42. package/dist/types/view/BlockCard/views/flexible/FlexibleForbiddenView.d.ts +2 -10
  43. package/dist/types/view/BlockCard/views/flexible/FlexibleNotFoundView.d.ts +2 -9
  44. package/dist/types/view/BlockCard/views/flexible/FlexibleResolvedView.d.ts +2 -8
  45. package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +2 -10
  46. package/dist/types/view/BlockCard/views/flexible/styled.d.ts +1 -0
  47. package/dist/{types-ts4.5/view/BlockCard/views/flexible/utils.d.ts → types/view/BlockCard/views/flexible/utils/index.d.ts} +1 -1
  48. package/dist/types/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.d.ts +4 -0
  49. package/dist/types/view/HoverCard/components/CustomPopupContainer.d.ts +5 -0
  50. package/dist/types/view/HoverCard/styled.d.ts +1 -0
  51. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleErroredView.d.ts +2 -9
  52. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleForbiddenView.d.ts +2 -10
  53. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleNotFoundView.d.ts +2 -9
  54. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleResolvedView.d.ts +2 -8
  55. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +2 -10
  56. package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +1 -0
  57. package/dist/{types/view/BlockCard/views/flexible/utils.d.ts → types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts} +1 -1
  58. package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.d.ts +4 -0
  59. package/dist/types-ts4.5/view/HoverCard/components/CustomPopupContainer.d.ts +5 -0
  60. package/dist/types-ts4.5/view/HoverCard/styled.d.ts +1 -0
  61. package/package.json +1 -1
@@ -7,6 +7,8 @@ import { R300 } from '@atlaskit/theme/colors';
7
7
  import BlockCardFooter from '../../components/flexible/footer';
8
8
  import Text from '../../../FlexibleCard/components/elements/text';
9
9
  import { CustomBlock } from '../../../FlexibleCard/components/blocks';
10
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
11
+
10
12
  /**
11
13
  * This view represents a Block Card with a 'Not_Found' status.
12
14
  *
@@ -18,7 +20,6 @@ const FlexibleNotFoundView = ({
18
20
  cardState,
19
21
  onAuthorize,
20
22
  onError,
21
- ui,
22
23
  url,
23
24
  onClick,
24
25
  testId = 'smart-block-not-found-view'
@@ -31,7 +32,9 @@ const FlexibleNotFoundView = ({
31
32
  onClick: onClick,
32
33
  onError: onError,
33
34
  testId: testId,
34
- ui: ui,
35
+ ui: {
36
+ hideElevation: true
37
+ },
35
38
  url: url
36
39
  }, /*#__PURE__*/React.createElement(TitleBlock, {
37
40
  hideRetry: true,
@@ -50,4 +53,4 @@ const FlexibleNotFoundView = ({
50
53
  status: status
51
54
  })));
52
55
  };
53
- export default FlexibleNotFoundView;
56
+ export default withFlexibleUIBlockCardStyle(FlexibleNotFoundView);
@@ -8,6 +8,7 @@ import { ActionName, CardDisplay, ElementName, MediaPlacement, SmartLinkPosition
8
8
  import uuid from 'uuid';
9
9
  import { getSimulatedMetadata, getSimulatedBetterMetadata } from './utils';
10
10
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
11
12
 
12
13
  /**
13
14
  * This view represents a Block card that has an 'Resolved' status.
@@ -23,7 +24,6 @@ const FlexibleResolvedView = ({
23
24
  showServerActions,
24
25
  anchorTarget,
25
26
  testId = 'smart-block-resolved-view',
26
- ui,
27
27
  url,
28
28
  analytics
29
29
  }) => {
@@ -46,7 +46,9 @@ const FlexibleResolvedView = ({
46
46
  onResolve: onResolve,
47
47
  showServerActions: showServerActions,
48
48
  testId: testId,
49
- ui: ui,
49
+ ui: {
50
+ hideElevation: true
51
+ },
50
52
  url: url
51
53
  }, /*#__PURE__*/React.createElement(TitleBlock, _extends({
52
54
  position: SmartLinkPosition.Center,
@@ -123,4 +125,4 @@ const FlexibleResolvedView = ({
123
125
  }]
124
126
  }));
125
127
  };
126
- export default FlexibleResolvedView;
128
+ export default withFlexibleUIBlockCardStyle(FlexibleResolvedView);
@@ -11,6 +11,7 @@ import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
11
11
  import { css } from '@emotion/react';
12
12
  import { tokens } from '../../../../utils/token';
13
13
  import { messages } from '../../../../messages';
14
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
14
15
  const contentStyles = css`
15
16
  color: ${tokens.text};
16
17
  margin-top: 0.5rem;
@@ -33,7 +34,6 @@ const FlexibleUnauthorisedView = ({
33
34
  onClick,
34
35
  onError,
35
36
  testId = 'smart-block-unauthorized-view',
36
- ui,
37
37
  url
38
38
  }) => {
39
39
  var _cardState$details, _extractProvider;
@@ -64,7 +64,9 @@ const FlexibleUnauthorisedView = ({
64
64
  onClick: onClick,
65
65
  onError: onError,
66
66
  testId: testId,
67
- ui: ui,
67
+ ui: {
68
+ hideElevation: true
69
+ },
68
70
  url: url
69
71
  }, /*#__PURE__*/React.createElement(TitleBlock, {
70
72
  hideRetry: true,
@@ -78,4 +80,4 @@ const FlexibleUnauthorisedView = ({
78
80
  actionGroupAppearance: "primary"
79
81
  })));
80
82
  };
81
- export default FlexibleUnauthorisedView;
83
+ export default withFlexibleUIBlockCardStyle(FlexibleUnauthorisedView);
@@ -1,4 +1,7 @@
1
+ import { tokens } from '../../../../utils/token';
1
2
  import { css } from '@emotion/react';
3
+ import { N40 } from '@atlaskit/theme/colors';
4
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
5
 
3
6
  // in editor prosemirror adds padding-left so we need to overwrite it
4
7
  export const metadataBlockCss = css`
@@ -11,4 +14,16 @@ export const metadataBlockCss = css`
11
14
  `;
12
15
  export const titleBlockCss = css`
13
16
  gap: 0.5em;
14
- `;
17
+ `;
18
+ const flexibleBlockCardElevationStyle = css`
19
+ border-radius: 1.5px;
20
+ box-shadow: ${tokens.elevation};
21
+ margin: ${"var(--ds-space-025, 2px)"};
22
+ `;
23
+ const refreshedFlexibleBlockCardStyle = css`
24
+ & > div {
25
+ border-radius: ${"var(--ds-border-radius-300, 12px)"};
26
+ border: 1px solid ${`var(--ds-border-input, ${N40})`};
27
+ }
28
+ `;
29
+ export const flexibleBlockCardStyle = getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
@@ -1,6 +1,6 @@
1
- import { ElementName } from '../../../../constants';
2
- import { extractOwnedBy, extractAssignedTo } from '../../../../extractors/flexible/utils';
3
- import { getExtensionKey } from '../../../../state/helpers';
1
+ import { ElementName } from '../../../../../constants';
2
+ import { extractOwnedBy, extractAssignedTo } from '../../../../../extractors/flexible/utils';
3
+ import { getExtensionKey } from '../../../../../state/helpers';
4
4
  const baseTopMetadata = [{
5
5
  name: ElementName.ModifiedOn
6
6
  }, {
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { flexibleBlockCardStyle } from '../styled';
4
+ export const withFlexibleUIBlockCardStyle = FlexibleBlockCardView => props => {
5
+ return jsx("div", {
6
+ css: flexibleBlockCardStyle
7
+ }, jsx(FlexibleBlockCardView, props));
8
+ };
@@ -0,0 +1,14 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /** @jsx jsx */
3
+ import React from 'react';
4
+ import { popupContainerStyles } from '../styled';
5
+ import { jsx } from '@emotion/react';
6
+ const CustomPopupContainer = /*#__PURE__*/React.forwardRef(({
7
+ children,
8
+ ...props
9
+ }, ref) => jsx("div", _extends({
10
+ css: popupContainerStyles
11
+ }, props, {
12
+ ref: ref
13
+ }), children));
14
+ export default CustomPopupContainer;
@@ -7,12 +7,14 @@ import { useSmartLinkActions } from '../../../state/hooks-external/useSmartLinkA
7
7
  import { useSmartLinkRenderers } from '../../../state/renderers';
8
8
  import { useSmartCardState as useLinkState } from '../../../state/store';
9
9
  import HoverCardContent from '../components/HoverCardContent';
10
+ import CustomPopupContainer from '../components/CustomPopupContainer';
10
11
  import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
11
12
  import { CardDisplay } from '../../../constants';
12
13
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
13
14
  import { useSmartCardActions } from '../../../state/actions';
14
15
  import { useSmartLinkAnalytics } from '../../../state/analytics';
15
16
  import { useFeatureFlag } from '@atlaskit/link-provider';
17
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
18
  const HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
17
19
  const FADE_IN_DELAY = 500;
18
20
  const FADE_OUT_DELAY = 300;
@@ -192,7 +194,7 @@ export const HoverCardComponent = ({
192
194
  onContextMenu: onContextMenuClick,
193
195
  "data-testid": "hover-card-trigger-wrapper"
194
196
  }), children)), [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition]);
195
- return jsx(Popup, {
197
+ return jsx(Popup, _extends({
196
198
  testId: "hover-card",
197
199
  isOpen: isOpen && canOpen,
198
200
  onClose: hideCard,
@@ -202,5 +204,7 @@ export const HoverCardComponent = ({
202
204
  content: content,
203
205
  trigger: trigger,
204
206
  zIndex: zIndex
205
- });
207
+ }, getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') && {
208
+ popupComponent: CustomPopupContainer
209
+ }));
206
210
  };
@@ -2,6 +2,7 @@ import { css } from '@emotion/react';
2
2
  import { loadingPlaceholderClassName } from '../../index';
3
3
  import { SmartLinkSize, SmartLinkTheme } from '../../constants';
4
4
  import { layers } from '@atlaskit/theme/constants';
5
+ import { themed } from '@atlaskit/theme/components';
5
6
 
6
7
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
7
8
  export const HOVER_CARD_Z_INDEX = layers.modal();
@@ -57,4 +58,15 @@ export const titleBlockCss = css`
57
58
  export const getTransitionStyles = snippetHeight => css`
58
59
  transition: height 300ms ease-in-out;
59
60
  height: ${snippetHeight}px;
61
+ `;
62
+ export const popupContainerStyles = css`
63
+ border-radius: ${"var(--ds-border-radius-300, 12px)"};
64
+ background-color: ${themed({
65
+ light: "var(--ds-surface-raised, white)",
66
+ dark: "var(--ds-surface-raised, #262B31)"
67
+ })()};
68
+ box-shadow: ${themed({
69
+ light: "var(--ds-shadow-overlay, 0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31))",
70
+ dark: "var(--ds-shadow-overlay, 0px 0px 0px rgba(188, 214, 240, 0.12),0px 8px 12px rgba(3, 4, 4, 0.36),0px 0px 1px rgba(3, 4, 4, 0.5))"
71
+ })()};
60
72
  `;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.15.3",
3
+ "version": "26.15.4",
4
4
  "sideEffects": false
5
5
  }
@@ -1,7 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- var _templateObject;
5
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
4
  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; }
7
5
  /** @jsx jsx */
@@ -24,14 +22,12 @@ import FlexibleUnauthorisedView from './views/flexible/FlexibleUnauthorisedView'
24
22
  import FlexibleNotFoundView from './views/flexible/FlexibleNotFoundView';
25
23
  import FlexibleErroredView from './views/flexible/FlexibleErroredView';
26
24
  import FlexibleForbiddenView from './views/flexible/FlexibleForbiddenView';
27
- import { tokens } from '../../utils/token';
28
- import { css, jsx } from '@emotion/react';
25
+ import { jsx } from '@emotion/react';
29
26
  import { handleClickCommon } from './utils/handlers';
30
27
  import { useFeatureFlag } from '@atlaskit/link-provider';
31
28
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
32
29
  export { default as PreviewAction } from './actions/PreviewAction';
33
30
  export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView };
34
- var flexibleBlockCardElevationStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: ", ";\n"])), tokens.elevation, "var(--ds-space-025, 2px)");
35
31
  export var BlockCard = function BlockCard(_ref) {
36
32
  var _details$meta, _forbiddenViewProps$c;
37
33
  var id = _ref.id,
@@ -65,9 +61,6 @@ export var BlockCard = function BlockCard(_ref) {
65
61
  };
66
62
  var enableImprovedPreviewAction = Boolean(useFeatureFlag('enableImprovedPreviewAction'));
67
63
  if (enableFlexibleBlockCard) {
68
- var ui = {
69
- hideElevation: true
70
- };
71
64
  var anchorTarget = getBooleanFF('platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab') ? '_self' : undefined;
72
65
  var flexibleProps = _objectSpread({
73
66
  id: id,
@@ -81,7 +74,6 @@ export var BlockCard = function BlockCard(_ref) {
81
74
  onResolve: onResolve,
82
75
  renderers: renderers,
83
76
  showServerActions: showServerActions,
84
- ui: ui,
85
77
  analytics: analytics,
86
78
  extensionKey: extensionKey
87
79
  }, anchorTarget ? {
@@ -90,33 +82,23 @@ export var BlockCard = function BlockCard(_ref) {
90
82
  switch (status) {
91
83
  case 'pending':
92
84
  case 'resolving':
93
- return jsx("div", {
94
- css: flexibleBlockCardElevationStyle
95
- }, jsx(FlexibleResolvedView, _extends({}, flexibleProps, {
85
+ return jsx(FlexibleResolvedView, _extends({}, flexibleProps, {
96
86
  testId: 'smart-block-resolving-view'
97
- })));
87
+ }));
98
88
  case 'resolved':
99
- return jsx("div", {
100
- css: flexibleBlockCardElevationStyle
101
- }, jsx(FlexibleResolvedView, flexibleProps));
89
+ return jsx(FlexibleResolvedView, flexibleProps);
102
90
  case 'unauthorized':
103
- return jsx("div", {
104
- css: flexibleBlockCardElevationStyle
105
- }, jsx(FlexibleUnauthorisedView, _extends({}, flexibleProps, {
91
+ return jsx(FlexibleUnauthorisedView, _extends({}, flexibleProps, {
106
92
  onAuthorize: handleAuthorize
107
- })));
93
+ }));
108
94
  case 'forbidden':
109
- return jsx("div", {
110
- css: flexibleBlockCardElevationStyle
111
- }, jsx(FlexibleForbiddenView, _extends({}, flexibleProps, {
95
+ return jsx(FlexibleForbiddenView, _extends({}, flexibleProps, {
112
96
  onAuthorize: handleAuthorize
113
- })));
97
+ }));
114
98
  case 'not_found':
115
- return jsx("div", {
116
- css: flexibleBlockCardElevationStyle
117
- }, jsx(FlexibleNotFoundView, _extends({}, flexibleProps, {
99
+ return jsx(FlexibleNotFoundView, _extends({}, flexibleProps, {
118
100
  onAuthorize: handleAuthorize
119
- })));
101
+ }));
120
102
  case 'fallback':
121
103
  case 'errored':
122
104
  default:
@@ -134,11 +116,9 @@ export var BlockCard = function BlockCard(_ref) {
134
116
  testId: "".concat(testId, "-").concat(status)
135
117
  });
136
118
  }
137
- return jsx("div", {
138
- css: flexibleBlockCardElevationStyle
139
- }, jsx(FlexibleErroredView, _extends({}, flexibleProps, {
119
+ return jsx(FlexibleErroredView, _extends({}, flexibleProps, {
140
120
  onAuthorize: handleAuthorize
141
- })));
121
+ }));
142
122
  }
143
123
  }
144
124
  switch (status) {
@@ -8,6 +8,8 @@ import BlockCardFooter from '../../components/flexible/footer';
8
8
  import { RetryAction } from '../../actions/flexible/RetryAction';
9
9
  import { CustomBlock } from '../../../FlexibleCard/components/blocks';
10
10
  import Text from '../../../FlexibleCard/components/elements/text';
11
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
12
+
11
13
  /**
12
14
  * This view represents a Block Card with an 'Errored' status.
13
15
  *
@@ -19,7 +21,6 @@ var FlexibleErroredView = function FlexibleErroredView(_ref) {
19
21
  cardState = _ref.cardState,
20
22
  onAuthorize = _ref.onAuthorize,
21
23
  onError = _ref.onError,
22
- ui = _ref.ui,
23
24
  url = _ref.url,
24
25
  onClick = _ref.onClick,
25
26
  _ref$testId = _ref.testId,
@@ -34,7 +35,9 @@ var FlexibleErroredView = function FlexibleErroredView(_ref) {
34
35
  onClick: onClick,
35
36
  onError: onError,
36
37
  testId: testId,
37
- ui: ui,
38
+ ui: {
39
+ hideElevation: true
40
+ },
38
41
  url: url
39
42
  }, /*#__PURE__*/React.createElement(TitleBlock, {
40
43
  hideRetry: true,
@@ -53,4 +56,4 @@ var FlexibleErroredView = function FlexibleErroredView(_ref) {
53
56
  status: status
54
57
  })));
55
58
  };
56
- export default FlexibleErroredView;
59
+ export default withFlexibleUIBlockCardStyle(FlexibleErroredView);
@@ -12,6 +12,7 @@ import Text from '../../../FlexibleCard/components/elements/text';
12
12
  import { getForbiddenJsonLd } from '../../../../utils/jsonld';
13
13
  import { extractProvider } from '@atlaskit/link-extractors';
14
14
  import { extractRequestAccessContext } from '../../../../extractors/common/context';
15
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
15
16
 
16
17
  /**
17
18
  * This view represent a Block Card with the 'Forbidden' status.
@@ -29,7 +30,6 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
29
30
  onError = _ref.onError,
30
31
  _ref$testId = _ref.testId,
31
32
  testId = _ref$testId === void 0 ? 'smart-block-forbidden-view' : _ref$testId,
32
- ui = _ref.ui,
33
33
  url = _ref.url;
34
34
  var status = cardState.status;
35
35
  var details = cardState === null || cardState === void 0 ? void 0 : cardState.details;
@@ -59,7 +59,9 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
59
59
  onClick: onClick,
60
60
  onError: onError,
61
61
  testId: testId,
62
- ui: ui,
62
+ ui: {
63
+ hideElevation: true
64
+ },
63
65
  url: url
64
66
  }, /*#__PURE__*/React.createElement(TitleBlock, {
65
67
  hideRetry: true,
@@ -81,4 +83,4 @@ var FlexibleForbiddenView = function FlexibleForbiddenView(_ref) {
81
83
  status: status
82
84
  })));
83
85
  };
84
- export default FlexibleForbiddenView;
86
+ export default withFlexibleUIBlockCardStyle(FlexibleForbiddenView);
@@ -7,6 +7,8 @@ import { R300 } from '@atlaskit/theme/colors';
7
7
  import BlockCardFooter from '../../components/flexible/footer';
8
8
  import Text from '../../../FlexibleCard/components/elements/text';
9
9
  import { CustomBlock } from '../../../FlexibleCard/components/blocks';
10
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
11
+
10
12
  /**
11
13
  * This view represents a Block Card with a 'Not_Found' status.
12
14
  *
@@ -18,7 +20,6 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
18
20
  cardState = _ref.cardState,
19
21
  onAuthorize = _ref.onAuthorize,
20
22
  onError = _ref.onError,
21
- ui = _ref.ui,
22
23
  url = _ref.url,
23
24
  onClick = _ref.onClick,
24
25
  _ref$testId = _ref.testId,
@@ -31,7 +32,9 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
31
32
  onClick: onClick,
32
33
  onError: onError,
33
34
  testId: testId,
34
- ui: ui,
35
+ ui: {
36
+ hideElevation: true
37
+ },
35
38
  url: url
36
39
  }, /*#__PURE__*/React.createElement(TitleBlock, {
37
40
  hideRetry: true,
@@ -50,4 +53,4 @@ var FlexibleNotFoundView = function FlexibleNotFoundView(_ref) {
50
53
  status: status
51
54
  })));
52
55
  };
53
- export default FlexibleNotFoundView;
56
+ export default withFlexibleUIBlockCardStyle(FlexibleNotFoundView);
@@ -9,6 +9,7 @@ import { ActionName, CardDisplay, ElementName, MediaPlacement, SmartLinkPosition
9
9
  import uuid from 'uuid';
10
10
  import { getSimulatedMetadata, getSimulatedBetterMetadata } from './utils';
11
11
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
12
13
 
13
14
  /**
14
15
  * This view represents a Block card that has an 'Resolved' status.
@@ -25,7 +26,6 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
25
26
  anchorTarget = _ref.anchorTarget,
26
27
  _ref$testId = _ref.testId,
27
28
  testId = _ref$testId === void 0 ? 'smart-block-resolved-view' : _ref$testId,
28
- ui = _ref.ui,
29
29
  url = _ref.url,
30
30
  analytics = _ref.analytics;
31
31
  var _useState = useState(false),
@@ -53,7 +53,9 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
53
53
  onResolve: onResolve,
54
54
  showServerActions: showServerActions,
55
55
  testId: testId,
56
- ui: ui,
56
+ ui: {
57
+ hideElevation: true
58
+ },
57
59
  url: url
58
60
  }, /*#__PURE__*/React.createElement(TitleBlock, _extends({
59
61
  position: SmartLinkPosition.Center,
@@ -130,4 +132,4 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
130
132
  }]
131
133
  }));
132
134
  };
133
- export default FlexibleResolvedView;
135
+ export default withFlexibleUIBlockCardStyle(FlexibleResolvedView);
@@ -13,6 +13,7 @@ import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
13
13
  import { css } from '@emotion/react';
14
14
  import { tokens } from '../../../../utils/token';
15
15
  import { messages } from '../../../../messages';
16
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
16
17
  var contentStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n margin-top: 0.5rem;\n font-size: 0.75rem;\n"])), tokens.text);
17
18
 
18
19
  /**
@@ -34,7 +35,6 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
34
35
  onError = _ref.onError,
35
36
  _ref$testId = _ref.testId,
36
37
  testId = _ref$testId === void 0 ? 'smart-block-unauthorized-view' : _ref$testId,
37
- ui = _ref.ui,
38
38
  url = _ref.url;
39
39
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
40
40
  var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
@@ -67,7 +67,9 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
67
67
  onClick: onClick,
68
68
  onError: onError,
69
69
  testId: testId,
70
- ui: ui,
70
+ ui: {
71
+ hideElevation: true
72
+ },
71
73
  url: url
72
74
  }, /*#__PURE__*/React.createElement(TitleBlock, {
73
75
  hideRetry: true,
@@ -81,4 +83,4 @@ var FlexibleUnauthorisedView = function FlexibleUnauthorisedView(_ref) {
81
83
  actionGroupAppearance: "primary"
82
84
  })));
83
85
  };
84
- export default FlexibleUnauthorisedView;
86
+ export default withFlexibleUIBlockCardStyle(FlexibleUnauthorisedView);
@@ -1,7 +1,13 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
+ import { tokens } from '../../../../utils/token';
3
4
  import { css } from '@emotion/react';
5
+ import { N40 } from '@atlaskit/theme/colors';
6
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
7
 
5
8
  // in editor prosemirror adds padding-left so we need to overwrite it
6
9
  export var metadataBlockCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* primary element group */\n span[data-smart-element-avatar-group] {\n > ul {\n padding-left: 0px;\n }\n }\n"])));
7
- export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n gap: 0.5em;\n"])));
10
+ export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n gap: 0.5em;\n"])));
11
+ var flexibleBlockCardElevationStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: ", ";\n"])), tokens.elevation, "var(--ds-space-025, 2px)");
12
+ var refreshedFlexibleBlockCardStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n & > div {\n border-radius: ", ";\n border: 1px solid ", ";\n }\n"])), "var(--ds-border-radius-300, 12px)", "var(--ds-border-input, ".concat(N40, ")"));
13
+ export var flexibleBlockCardStyle = getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? refreshedFlexibleBlockCardStyle : flexibleBlockCardElevationStyle;
@@ -1,6 +1,6 @@
1
- import { ElementName } from '../../../../constants';
2
- import { extractOwnedBy, extractAssignedTo } from '../../../../extractors/flexible/utils';
3
- import { getExtensionKey } from '../../../../state/helpers';
1
+ import { ElementName } from '../../../../../constants';
2
+ import { extractOwnedBy, extractAssignedTo } from '../../../../../extractors/flexible/utils';
3
+ import { getExtensionKey } from '../../../../../state/helpers';
4
4
  var baseTopMetadata = [{
5
5
  name: ElementName.ModifiedOn
6
6
  }, {
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ import { flexibleBlockCardStyle } from '../styled';
4
+ export var withFlexibleUIBlockCardStyle = function withFlexibleUIBlockCardStyle(FlexibleBlockCardView) {
5
+ return function (props) {
6
+ return jsx("div", {
7
+ css: flexibleBlockCardStyle
8
+ }, jsx(FlexibleBlockCardView, props));
9
+ };
10
+ };
@@ -0,0 +1,17 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children"];
4
+ /** @jsx jsx */
5
+ import React from 'react';
6
+ import { popupContainerStyles } from '../styled';
7
+ import { jsx } from '@emotion/react';
8
+ var CustomPopupContainer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
9
+ var children = _ref.children,
10
+ props = _objectWithoutProperties(_ref, _excluded);
11
+ return jsx("div", _extends({
12
+ css: popupContainerStyles
13
+ }, props, {
14
+ ref: ref
15
+ }), children);
16
+ });
17
+ export default CustomPopupContainer;
@@ -8,12 +8,14 @@ import { useSmartLinkActions } from '../../../state/hooks-external/useSmartLinkA
8
8
  import { useSmartLinkRenderers } from '../../../state/renderers';
9
9
  import { useSmartCardState as useLinkState } from '../../../state/store';
10
10
  import HoverCardContent from '../components/HoverCardContent';
11
+ import CustomPopupContainer from '../components/CustomPopupContainer';
11
12
  import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
12
13
  import { CardDisplay } from '../../../constants';
13
14
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
14
15
  import { useSmartCardActions } from '../../../state/actions';
15
16
  import { useSmartLinkAnalytics } from '../../../state/analytics';
16
17
  import { useFeatureFlag } from '@atlaskit/link-provider';
18
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
17
19
  var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
18
20
  var FADE_IN_DELAY = 500;
19
21
  var FADE_OUT_DELAY = 300;
@@ -209,7 +211,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
209
211
  "data-testid": "hover-card-trigger-wrapper"
210
212
  }), children));
211
213
  }, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition]);
212
- return jsx(Popup, {
214
+ return jsx(Popup, _extends({
213
215
  testId: "hover-card",
214
216
  isOpen: isOpen && canOpen,
215
217
  onClose: hideCard,
@@ -219,5 +221,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
219
221
  content: content,
220
222
  trigger: trigger,
221
223
  zIndex: zIndex
222
- });
224
+ }, getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') && {
225
+ popupComponent: CustomPopupContainer
226
+ }));
223
227
  };
@@ -1,9 +1,10 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
3
3
  import { css } from '@emotion/react';
4
4
  import { loadingPlaceholderClassName } from '../../index';
5
5
  import { SmartLinkSize, SmartLinkTheme } from '../../constants';
6
6
  import { layers } from '@atlaskit/theme/constants';
7
+ import { themed } from '@atlaskit/theme/components';
7
8
 
8
9
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
9
10
  export var HOVER_CARD_Z_INDEX = layers.modal();
@@ -27,4 +28,11 @@ export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _tag
27
28
  export var titleBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: ", ";\n\n ", "\n\n // title and subtitle element group\n [data-smart-element-group] {\n // gap between title and subtitle\n gap: 0.06rem;\n display: flex;\n /* subtitle element group */\n > [data-smart-element-group] {\n > span {\n margin-right: ", ";\n }\n }\n }\n"])), blockGap, separatorCss, elementGap);
28
29
  export var getTransitionStyles = function getTransitionStyles(snippetHeight) {
29
30
  return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transition: height 300ms ease-in-out;\n height: ", "px;\n"])), snippetHeight);
30
- };
31
+ };
32
+ export var popupContainerStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-radius: ", ";\n background-color: ", ";\n box-shadow: ", ";\n"])), "var(--ds-border-radius-300, 12px)", themed({
33
+ light: "var(--ds-surface-raised, white)",
34
+ dark: "var(--ds-surface-raised, #262B31)"
35
+ })(), themed({
36
+ light: "var(--ds-shadow-overlay, 0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31))",
37
+ dark: "var(--ds-shadow-overlay, 0px 0px 0px rgba(188, 214, 240, 0.12),0px 8px 12px rgba(3, 4, 4, 0.36),0px 0px 1px rgba(3, 4, 4, 0.5))"
38
+ })());
@@ -1,10 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FlexibleBlockCardProps } from './types';
3
- /**
4
- * This view represents a Block Card with an 'Errored' status.
5
- *
6
- * @see SmartLinkStatus
7
- * @see FlexibleCardProps
8
- */
9
- declare const FlexibleErroredView: ({ anchorTarget, cardState, onAuthorize, onError, ui, url, onClick, testId, }: FlexibleBlockCardProps) => JSX.Element;
10
- export default FlexibleErroredView;
2
+ declare const _default: (props: FlexibleBlockCardProps) => import("@emotion/react").jsx.JSX.Element;
3
+ export default _default;
@@ -1,11 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FlexibleBlockCardProps } from './types';
3
- /**
4
- * This view represent a Block Card with the 'Forbidden' status.
5
- * It should have a "Try another account" button that will allow a user to connect another account and view the block card.
6
- *
7
- * @see SmartLinkStatus
8
- * @see FlexibleCardProps
9
- */
10
- declare const FlexibleForbiddenView: ({ anchorTarget, cardState, onAuthorize, onClick, onError, testId, ui, url, }: FlexibleBlockCardProps) => JSX.Element;
11
- export default FlexibleForbiddenView;
2
+ declare const _default: (props: FlexibleBlockCardProps) => import("@emotion/react").jsx.JSX.Element;
3
+ export default _default;