@atlaskit/smart-card 26.15.2 → 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 (71) hide show
  1. package/CHANGELOG.md +12 -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/cjs/view/LinkUrl/LinkWarningModal/index.js +14 -8
  16. package/dist/cjs/view/LinkUrl/LinkWarningModal/styled.js +12 -0
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/es2019/view/BlockCard/index.js +12 -34
  19. package/dist/es2019/view/BlockCard/views/flexible/FlexibleErroredView.js +6 -3
  20. package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +5 -3
  21. package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +6 -3
  22. package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +5 -3
  23. package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  24. package/dist/es2019/view/BlockCard/views/flexible/styled.js +16 -1
  25. package/dist/es2019/view/BlockCard/views/flexible/{utils.js → utils/index.js} +3 -3
  26. package/dist/es2019/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +8 -0
  27. package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +14 -0
  28. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -2
  29. package/dist/es2019/view/HoverCard/styled.js +12 -0
  30. package/dist/es2019/view/LinkUrl/LinkWarningModal/index.js +13 -8
  31. package/dist/es2019/view/LinkUrl/LinkWarningModal/styled.js +5 -0
  32. package/dist/esm/version.json +1 -1
  33. package/dist/esm/view/BlockCard/index.js +12 -32
  34. package/dist/esm/view/BlockCard/views/flexible/FlexibleErroredView.js +6 -3
  35. package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +5 -3
  36. package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +6 -3
  37. package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +5 -3
  38. package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +5 -3
  39. package/dist/esm/view/BlockCard/views/flexible/styled.js +8 -2
  40. package/dist/esm/view/BlockCard/views/flexible/{utils.js → utils/index.js} +3 -3
  41. package/dist/esm/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.js +10 -0
  42. package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +17 -0
  43. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +6 -2
  44. package/dist/esm/view/HoverCard/styled.js +10 -2
  45. package/dist/esm/view/LinkUrl/LinkWarningModal/index.js +13 -8
  46. package/dist/esm/view/LinkUrl/LinkWarningModal/styled.js +4 -0
  47. package/dist/types/view/BlockCard/views/flexible/FlexibleErroredView.d.ts +2 -9
  48. package/dist/types/view/BlockCard/views/flexible/FlexibleForbiddenView.d.ts +2 -10
  49. package/dist/types/view/BlockCard/views/flexible/FlexibleNotFoundView.d.ts +2 -9
  50. package/dist/types/view/BlockCard/views/flexible/FlexibleResolvedView.d.ts +2 -8
  51. package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +2 -10
  52. package/dist/types/view/BlockCard/views/flexible/styled.d.ts +1 -0
  53. package/dist/{types-ts4.5/view/BlockCard/views/flexible/utils.d.ts → types/view/BlockCard/views/flexible/utils/index.d.ts} +1 -1
  54. package/dist/types/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.d.ts +4 -0
  55. package/dist/types/view/HoverCard/components/CustomPopupContainer.d.ts +5 -0
  56. package/dist/types/view/HoverCard/styled.d.ts +1 -0
  57. package/dist/types/view/LinkUrl/LinkWarningModal/index.d.ts +1 -0
  58. package/dist/types/view/LinkUrl/LinkWarningModal/styled.d.ts +1 -0
  59. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleErroredView.d.ts +2 -9
  60. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleForbiddenView.d.ts +2 -10
  61. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleNotFoundView.d.ts +2 -9
  62. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleResolvedView.d.ts +2 -8
  63. package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +2 -10
  64. package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +1 -0
  65. package/dist/{types/view/BlockCard/views/flexible/utils.d.ts → types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts} +1 -1
  66. package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/withFlexibleUIBlockCardStyle.d.ts +4 -0
  67. package/dist/types-ts4.5/view/HoverCard/components/CustomPopupContainer.d.ts +5 -0
  68. package/dist/types-ts4.5/view/HoverCard/styled.d.ts +1 -0
  69. package/dist/types-ts4.5/view/LinkUrl/LinkWarningModal/index.d.ts +1 -0
  70. package/dist/types-ts4.5/view/LinkUrl/LinkWarningModal/styled.d.ts +1 -0
  71. package/package.json +1 -1
@@ -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 @@ const FlexibleErroredView = ({
19
21
  cardState,
20
22
  onAuthorize,
21
23
  onError,
22
- ui,
23
24
  url,
24
25
  onClick,
25
26
  testId = 'smart-block-errored-view'
@@ -32,7 +33,9 @@ const FlexibleErroredView = ({
32
33
  onClick: onClick,
33
34
  onError: onError,
34
35
  testId: testId,
35
- ui: ui,
36
+ ui: {
37
+ hideElevation: true
38
+ },
36
39
  url: url
37
40
  }, /*#__PURE__*/React.createElement(TitleBlock, {
38
41
  hideRetry: true,
@@ -51,4 +54,4 @@ const FlexibleErroredView = ({
51
54
  status: status
52
55
  })));
53
56
  };
54
- export default FlexibleErroredView;
57
+ export default withFlexibleUIBlockCardStyle(FlexibleErroredView);
@@ -11,6 +11,7 @@ import Text from '../../../FlexibleCard/components/elements/text';
11
11
  import { getForbiddenJsonLd } from '../../../../utils/jsonld';
12
12
  import { extractProvider } from '@atlaskit/link-extractors';
13
13
  import { extractRequestAccessContext } from '../../../../extractors/common/context';
14
+ import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
14
15
 
15
16
  /**
16
17
  * This view represent a Block Card with the 'Forbidden' status.
@@ -26,7 +27,6 @@ const FlexibleForbiddenView = ({
26
27
  onClick,
27
28
  onError,
28
29
  testId = 'smart-block-forbidden-view',
29
- ui,
30
30
  url
31
31
  }) => {
32
32
  var _details$meta;
@@ -60,7 +60,9 @@ const FlexibleForbiddenView = ({
60
60
  onClick: onClick,
61
61
  onError: onError,
62
62
  testId: testId,
63
- ui: ui,
63
+ ui: {
64
+ hideElevation: true
65
+ },
64
66
  url: url
65
67
  }, /*#__PURE__*/React.createElement(TitleBlock, {
66
68
  hideRetry: true,
@@ -82,4 +84,4 @@ const FlexibleForbiddenView = ({
82
84
  status: status
83
85
  })));
84
86
  };
85
- export default FlexibleForbiddenView;
87
+ 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 @@ 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,8 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ /** @jsx jsx */
2
3
  import React from 'react';
3
4
  import Button from '@atlaskit/button/standard-button';
4
5
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
5
6
  import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl-next';
7
+ import { breakWordsCss } from './styled';
8
+ import { jsx } from '@emotion/react';
6
9
  import { messages } from '../../../messages';
7
10
  const WarningModal = props => {
8
11
  const {
@@ -13,29 +16,31 @@ const WarningModal = props => {
13
16
  onContinue,
14
17
  intl
15
18
  } = props;
16
- const content = /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(Modal, {
19
+ const content = jsx(ModalTransition, null, isOpen && jsx(Modal, {
17
20
  onClose: onClose,
18
21
  testId: "link-with-safety-warning"
19
- }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
22
+ }, jsx(ModalHeader, null, jsx(ModalTitle, {
20
23
  appearance: "warning"
21
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.check_this_link))), /*#__PURE__*/React.createElement(ModalBody, null, url && unsafeLinkText && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.link_safety_warning_message, {
24
+ }, jsx(FormattedMessage, messages.check_this_link))), jsx(ModalBody, null, jsx("div", {
25
+ css: breakWordsCss
26
+ }, url && unsafeLinkText && jsx(FormattedMessage, _extends({}, messages.link_safety_warning_message, {
22
27
  values: {
23
28
  unsafeLinkText: unsafeLinkText,
24
- a: () => /*#__PURE__*/React.createElement("a", {
29
+ a: () => jsx("a", {
25
30
  href: url,
26
31
  target: "_blank",
27
32
  rel: "noopener noreferrer"
28
33
  }, url)
29
34
  }
30
- }))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
35
+ })))), jsx(ModalFooter, null, jsx(Button, {
31
36
  appearance: "subtle",
32
37
  onClick: onClose
33
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.go_back)), /*#__PURE__*/React.createElement(Button, {
38
+ }, jsx(FormattedMessage, messages.go_back)), jsx(Button, {
34
39
  appearance: "warning",
35
40
  onClick: onContinue,
36
41
  autoFocus: true
37
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.continue)))));
38
- return intl ? content : /*#__PURE__*/React.createElement(IntlProvider, {
42
+ }, jsx(FormattedMessage, messages.continue)))));
43
+ return intl ? content : jsx(IntlProvider, {
39
44
  locale: "en"
40
45
  }, content);
41
46
  };
@@ -0,0 +1,5 @@
1
+ import { css } from '@emotion/react';
2
+ export const breakWordsCss = css`
3
+ white-space: pre-line;
4
+ word-break: break-all;
5
+ `;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.15.2",
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
  }, {