@atlaskit/smart-card 36.2.6 → 36.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/common/ui/icons/generic-error-icon.compiled.css +3 -0
  3. package/dist/cjs/common/ui/icons/generic-error-icon.js +54 -0
  4. package/dist/cjs/messages.js +40 -0
  5. package/dist/cjs/utils/analytics/analytics.js +1 -1
  6. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -1
  7. package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +7 -1
  8. package/dist/cjs/view/LinkUrl/index.js +1 -1
  9. package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +4 -2
  10. package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.compiled.css +13 -1
  11. package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +14 -4
  12. package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.compiled.css +2 -1
  13. package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +20 -6
  14. package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/search-no-result/index.js +18 -0
  15. package/dist/cjs/view/RelatedLinksModal/views/errored/index.js +9 -1
  16. package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +17 -4
  17. package/dist/cjs/view/RelatedLinksModal/views/unavailable/index.js +12 -1
  18. package/dist/cjs/view/common/render-svg.compiled.css +3 -0
  19. package/dist/cjs/view/common/render-svg.js +32 -0
  20. package/dist/es2019/common/ui/icons/generic-error-icon.compiled.css +3 -0
  21. package/dist/es2019/common/ui/icons/generic-error-icon.js +41 -0
  22. package/dist/es2019/messages.js +40 -0
  23. package/dist/es2019/utils/analytics/analytics.js +1 -1
  24. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -1
  25. package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +7 -1
  26. package/dist/es2019/view/LinkUrl/index.js +1 -1
  27. package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +4 -2
  28. package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.compiled.css +13 -1
  29. package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +11 -4
  30. package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.compiled.css +2 -1
  31. package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +17 -6
  32. package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/search-no-result/index.js +11 -0
  33. package/dist/es2019/view/RelatedLinksModal/views/errored/index.js +7 -1
  34. package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +13 -4
  35. package/dist/es2019/view/RelatedLinksModal/views/unavailable/index.js +10 -1
  36. package/dist/es2019/view/common/render-svg.compiled.css +3 -0
  37. package/dist/es2019/view/common/render-svg.js +23 -0
  38. package/dist/esm/common/ui/icons/generic-error-icon.compiled.css +3 -0
  39. package/dist/esm/common/ui/icons/generic-error-icon.js +44 -0
  40. package/dist/esm/messages.js +40 -0
  41. package/dist/esm/utils/analytics/analytics.js +1 -1
  42. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +2 -1
  43. package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +7 -1
  44. package/dist/esm/view/LinkUrl/index.js +1 -1
  45. package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +4 -2
  46. package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.compiled.css +13 -1
  47. package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +14 -4
  48. package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.compiled.css +2 -1
  49. package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +20 -6
  50. package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/search-no-result/index.js +11 -0
  51. package/dist/esm/view/RelatedLinksModal/views/errored/index.js +9 -1
  52. package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +17 -4
  53. package/dist/esm/view/RelatedLinksModal/views/unavailable/index.js +12 -1
  54. package/dist/esm/view/common/render-svg.compiled.css +3 -0
  55. package/dist/esm/view/common/render-svg.js +22 -0
  56. package/dist/types/common/ui/icons/generic-error-icon.d.ts +2 -0
  57. package/dist/types/messages.d.ts +1 -1
  58. package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +1 -1
  59. package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +1 -1
  60. package/dist/types/view/RelatedLinksModal/components/types.d.ts +4 -0
  61. package/dist/types/view/RelatedLinksModal/views/errored/error-svg/search-no-result/index.d.ts +3 -0
  62. package/dist/types/view/common/render-svg.d.ts +16 -0
  63. package/dist/types-ts4.5/common/ui/icons/generic-error-icon.d.ts +2 -0
  64. package/dist/types-ts4.5/messages.d.ts +1 -1
  65. package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +1 -1
  66. package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/index.d.ts +1 -1
  67. package/dist/types-ts4.5/view/RelatedLinksModal/components/types.d.ts +4 -0
  68. package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/error-svg/search-no-result/index.d.ts +3 -0
  69. package/dist/types-ts4.5/view/common/render-svg.d.ts +16 -0
  70. package/package.json +9 -5
@@ -700,16 +700,31 @@ export const messages = defineMessages({
700
700
  defaultMessage: 'Recent links',
701
701
  description: 'Shown as the title for the related links modal'
702
702
  },
703
+ related_links_modal_title_v2: {
704
+ id: 'fabric.linking.related_links_modal_title_v2',
705
+ defaultMessage: 'Related links',
706
+ description: 'Shown as the title for the related links modal'
707
+ },
703
708
  related_links_view_related_urls: {
704
709
  id: 'fabric.linking.related_links_view_related_urls',
705
710
  defaultMessage: 'View recent links',
706
711
  description: 'Action to view related links to the given resource'
707
712
  },
713
+ related_links_view_related_links: {
714
+ id: 'fabric.linking.related_links_view_related_links',
715
+ defaultMessage: 'View related links',
716
+ description: 'Action to view related links to the given resource'
717
+ },
708
718
  related_links_found_in: {
709
719
  id: 'fabric.linking.related_links_found_in',
710
720
  defaultMessage: 'Found In',
711
721
  description: 'Informs the user of the resources are found in the given url'
712
722
  },
723
+ related_links_found_in_v2: {
724
+ id: 'fabric.linking.related_links_found_in_v2',
725
+ defaultMessage: 'Found in',
726
+ description: 'Informs the user of the resources are found in the given url'
727
+ },
713
728
  related_links_not_found: {
714
729
  id: 'fabric.linking.related_links_not_found',
715
730
  defaultMessage: "We didn't find any links to show here.",
@@ -720,16 +735,41 @@ export const messages = defineMessages({
720
735
  defaultMessage: 'Includes Links To',
721
736
  description: 'Informs the user of the resources the url links to'
722
737
  },
738
+ related_links_includes_links_to_v2: {
739
+ id: 'fabric.linking.related_links_includes_links_to_v2',
740
+ defaultMessage: 'Includes links to',
741
+ description: 'Informs the user of the resources the url links to'
742
+ },
723
743
  related_links_modal_error_header: {
724
744
  id: 'fabric.linking.related_links_modal_error_header',
725
745
  defaultMessage: 'Something went wrong',
726
746
  description: 'Title for related links error'
727
747
  },
748
+ related_links_modal_error_title: {
749
+ id: 'fabric.linking.related_links_modal_error_title',
750
+ defaultMessage: `We're having trouble loading related links`,
751
+ description: 'Title for related links error'
752
+ },
753
+ related_links_modal_unavailable_title: {
754
+ id: 'fabric.linking.related_links_modal_unavailable_title',
755
+ defaultMessage: `We couldn't find any related links`,
756
+ description: 'Title for related links error'
757
+ },
728
758
  related_links_modal_error_message: {
729
759
  id: 'fabric.linking.related_links_modal_error_message',
730
760
  defaultMessage: 'We ran into an issue trying to load recent links. Check your connection or refresh to try again.',
731
761
  description: 'Informs the user that there was a problem loading related links'
732
762
  },
763
+ related_links_modal_error_description: {
764
+ id: 'fabric.linking.related_links_modal_error_description',
765
+ defaultMessage: 'Check your connection or refresh the page to try again',
766
+ description: 'Informs the user that there was a problem loading related links'
767
+ },
768
+ related_links_modal_unavailable_description: {
769
+ id: 'fabric.linking.related_links_modal_unavailable_description',
770
+ defaultMessage: 'We continuously review and add related links for updated pages or other content types',
771
+ description: 'Informs the user that there was a problem loading related links'
772
+ },
733
773
  related_links_modal_unavailable_header: {
734
774
  id: 'fabric.linking.related_links_modal_unavailable_header',
735
775
  defaultMessage: 'No recent links',
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "36.2.6"
5
+ packageVersion: "36.3.0"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { lazy, useCallback } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
5
6
  import { messages } from '../../../../../messages';
6
7
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
@@ -32,7 +33,7 @@ const ViewRelatedLinksAction = ({
32
33
  onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
33
34
  }, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
34
35
  return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
35
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_urls),
36
+ content: /*#__PURE__*/React.createElement(FormattedMessage, fg('platform-linking-visual-refresh-v2') ? messages.related_links_view_related_links : messages.related_links_view_related_urls),
36
37
  icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, null),
37
38
  onClick: onClick,
38
39
  testId: "smart-action-view-related-links-action",
@@ -2,13 +2,19 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import ClockIcon from '@atlaskit/icon/core/clock';
5
6
  import ChildIssuesIcon from '@atlaskit/icon/core/migration/child-issues';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
6
8
  const rotateSvg = null;
7
9
 
8
10
  /**
9
11
  * ChildIssuesIcon but 180 degrees rotated
10
12
  */
11
- const RelatedLinksActionIcon = () => /*#__PURE__*/React.createElement("span", {
13
+ const RelatedLinksActionIcon = () => fg('platform-linking-visual-refresh-v2') ? /*#__PURE__*/React.createElement(ClockIcon, {
14
+ color: "currentColor",
15
+ spacing: "spacious",
16
+ label: "View related links..."
17
+ }) : /*#__PURE__*/React.createElement("span", {
12
18
  className: ax(["_t9ec1sub _1e0c1o8l"])
13
19
  }, /*#__PURE__*/React.createElement(ChildIssuesIcon, {
14
20
  color: "currentColor",
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "36.2.6",
13
+ packageVersion: "36.3.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -6,6 +6,7 @@ import { useCallback, useRef } from 'react';
6
6
  import { FormattedMessage } from 'react-intl-next';
7
7
  import Button from '@atlaskit/button/new';
8
8
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { Box } from '@atlaskit/primitives/compiled';
10
11
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
11
12
  import { messages } from '../../../messages';
@@ -40,8 +41,9 @@ const RelatedLinksBaseModal = ({
40
41
  width: fixedWidth,
41
42
  autoFocus: false,
42
43
  shouldReturnFocus: false,
43
- onOpenComplete: openCompleteHandler
44
- }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_title))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Box, {
44
+ onOpenComplete: openCompleteHandler,
45
+ height: fg('platform-linking-visual-refresh-v2') ? '504px' : undefined
46
+ }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, fg('platform-linking-visual-refresh-v2') ? messages.related_links_modal_title_v2 : messages.related_links_modal_title))), /*#__PURE__*/React.createElement(ModalBody, null, fg('platform-linking-visual-refresh-v2') ? children : /*#__PURE__*/React.createElement(Box, {
45
47
  xcss: styles.box
46
48
  }, children)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
47
49
  appearance: "primary",
@@ -1,8 +1,20 @@
1
1
 
2
2
  ._11c81o8v{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
3
3
  ._zulputpp{gap:var(--ds-space-150,9pt)}
4
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
5
+ ._195gmgjw{margin-inline:var(--ds-space-negative-200,-1pc)}
6
+ ._1kl71vrj{border-left:2px solid transparent}
7
+ ._1kl7neh2{border-left:2px solid var(--ds-border-selected,#0c66e4)}
8
+ ._bfhkfg4m{background-color:var(--ds-background-selected,#e9f2ff)}
4
9
  ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
5
10
  ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
6
11
  ._8vu4iti9:hover{border-radius:var(--ds-border-radius-100,4px)}._10swu2gc:hover{padding-inline:var(--ds-space-100,8px)}
7
12
  ._1mxox0bf:hover{margin-inline:var(--ds-space-negative-100,-8px)}
8
- ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
13
+ ._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
14
+ ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
15
+ ._irr3i1yw:hover{background-color:var(--ds-background-selected-hovered,#cce0ff)}
16
+ ._1di619ru:active{background-color:var(--ds-background-selected-pressed,#85b8ff)}
17
+ ._1di61dty:active{background-color:var(--ds-background-neutral-subtle-pressed,#091e4224)}
18
+ ._1ohyglyw:active{outline-style:none}
19
+ ._1q5t1r31:active{outline-color:currentColor}
20
+ ._1r9x1o36:active{outline-width:medium}
@@ -2,13 +2,19 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { SmartLinkStatus } from '../../../../constants';
6
7
  import { Card, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, TitleBlock } from '../../../../index';
8
+ const hoverStyleOld = null;
7
9
  const hoverStyle = null;
10
+ const baseStyle = null;
11
+ const selectedStyle = null;
8
12
  const relatedLinkItemStyles = null;
9
13
  const RelatedLinkItem = ({
10
14
  url,
11
- testId
15
+ testId,
16
+ isSelected,
17
+ onFocus
12
18
  }) => {
13
19
  const subtitle = [{
14
20
  name: ElementName.Provider,
@@ -20,11 +26,12 @@ const RelatedLinkItem = ({
20
26
  hideBackground: true,
21
27
  theme: SmartLinkTheme.Black,
22
28
  clickableContainer: true,
23
- size: SmartLinkSize.Large
29
+ size: fg('platform-linking-visual-refresh-v2') ? SmartLinkSize.Medium : SmartLinkSize.Large
24
30
  };
25
31
  return /*#__PURE__*/React.createElement("div", {
26
32
  "data-testId": testId,
27
- className: ax(["_8vu4iti9 _1mxox0bf _10swu2gc _irr31d5g"])
33
+ onFocus: onFocus,
34
+ className: ax([fg('platform-linking-visual-refresh-v2') && "_195gmgjw _18zrpxbi _1kl71vrj", fg('platform-linking-visual-refresh-v2') ? "_irr3166n _1di61dty" : "_8vu4iti9 _1mxox0bf _10swu2gc _irr31d5g", isSelected && fg('platform-linking-visual-refresh-v2') && "_1kl7neh2 _bfhkfg4m _irr3i1yw _1q5t1r31 _1ohyglyw _1r9x1o36 _1di619ru"])
28
35
  }, /*#__PURE__*/React.createElement(Card, {
29
36
  appearance: "block",
30
37
  ui: ui,
@@ -32,7 +39,7 @@ const RelatedLinkItem = ({
32
39
  }, /*#__PURE__*/React.createElement(TitleBlock, {
33
40
  maxLines: 1,
34
41
  hideTitleTooltip: true,
35
- position: SmartLinkPosition.Center,
42
+ position: fg('platform-linking-visual-refresh-v2') ? SmartLinkPosition.Top : SmartLinkPosition.Center,
36
43
  subtitle: subtitle,
37
44
  anchorTarget: "_blank",
38
45
  size: ui.size,
@@ -1,4 +1,5 @@
1
1
  ._11c81o8v{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
2
2
  ._11c81vhk{font:var(--ds-font-heading-xxsmall,normal 600 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
3
3
  ._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
4
- ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
4
+ ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
5
+ ._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
@@ -3,27 +3,38 @@ import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { FormattedMessage } from 'react-intl-next';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { Box, Stack } from '@atlaskit/primitives/compiled';
7
8
  import { messages } from '../../../../messages';
8
9
  import RelatedLinkItem from '../related-link-item';
9
10
  const styles = {
10
- sectionTitle: "_11c81vhk _1q511b66",
11
+ sectionTitleOld: "_11c81vhk _1q511b66",
12
+ sectionTitle: "_11c81vhk _syaz1gjq _1q511b66",
11
13
  boxStyle: "_11c81o8v _1rjcu2gc"
12
14
  };
13
15
  const RelatedLinksList = ({
14
16
  urls,
15
17
  title,
16
- testId
18
+ testId,
19
+ selected,
20
+ handleSelectedUpdate
17
21
  }) => {
22
+ const TitleWrapper = ({
23
+ children
24
+ }) => fg('platform-linking-visual-refresh-v2') ? /*#__PURE__*/React.createElement(Box, {
25
+ xcss: styles.sectionTitle
26
+ }, children) : /*#__PURE__*/React.createElement(Box, {
27
+ xcss: styles.sectionTitleOld
28
+ }, children);
18
29
  return /*#__PURE__*/React.createElement(Stack, {
19
30
  testId: testId
20
- }, /*#__PURE__*/React.createElement(Box, {
21
- xcss: styles.sectionTitle
22
- }, /*#__PURE__*/React.createElement(FormattedMessage, title)), urls.length > 0 && /*#__PURE__*/React.createElement(Box, null, urls.map((url, idx) => /*#__PURE__*/React.createElement(Stack, {
31
+ }, /*#__PURE__*/React.createElement(TitleWrapper, null, /*#__PURE__*/React.createElement(FormattedMessage, title)), urls.length > 0 && /*#__PURE__*/React.createElement(Box, null, urls.map((url, idx) => /*#__PURE__*/React.createElement(Stack, {
23
32
  key: `${idx}-${url}`
24
33
  }, /*#__PURE__*/React.createElement(RelatedLinkItem, {
25
34
  url: url,
26
- testId: `${testId}-item-${idx}`
35
+ testId: `${testId}-item-${idx}`,
36
+ isSelected: selected === `${idx}-${url}`,
37
+ onFocus: () => handleSelectedUpdate && handleSelectedUpdate(`${idx}-${url}`)
27
38
  })))), urls.length === 0 && /*#__PURE__*/React.createElement(Box, {
28
39
  xcss: styles.boxStyle
29
40
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_not_found)));
@@ -0,0 +1,11 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import { RenderSVG } from '../../../../../common/render-svg';
4
+ import Dark from './assets/dark.svg';
5
+ import Light from './assets/light.svg';
6
+ export const SpotSearchNoResult = props => {
7
+ return /*#__PURE__*/React.createElement(RenderSVG, _extends({
8
+ src: Light,
9
+ srcDark: Dark
10
+ }, props));
11
+ };
@@ -1,11 +1,17 @@
1
1
  import React from 'react';
2
2
  import { FormattedMessage, useIntl } from 'react-intl-next';
3
+ import { fg } from "@atlaskit/platform-feature-flags";
4
+ import { GenericErrorIcon } from "../../../../common/ui/icons/generic-error-icon";
3
5
  import { messages } from '../../../../messages';
4
6
  import { EmptyState } from '../../components/EmptyState';
5
7
  import { ErrorSVG } from './error-svg';
6
8
  const RelatedLinksErroredView = () => {
7
9
  const intl = useIntl();
8
- return /*#__PURE__*/React.createElement(EmptyState, {
10
+ return fg('platform-linking-visual-refresh-v2') ? /*#__PURE__*/React.createElement(EmptyState, {
11
+ renderImage: () => /*#__PURE__*/React.createElement(GenericErrorIcon, null),
12
+ header: intl.formatMessage(messages.related_links_modal_error_title),
13
+ description: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_error_description)
14
+ }) : /*#__PURE__*/React.createElement(EmptyState, {
9
15
  renderImage: () => /*#__PURE__*/React.createElement(ErrorSVG, null),
10
16
  header: intl.formatMessage(messages.related_links_modal_error_header),
11
17
  description: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_error_message)
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AnalyticsContext } from '@atlaskit/analytics-next';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { Stack } from '@atlaskit/primitives/compiled';
4
5
  import { messages } from '../../../../messages';
5
6
  import RelatedLinksList from '../../components/related-links-list';
@@ -7,6 +8,10 @@ const RelatedLinksResolvedView = ({
7
8
  incomingLinks = [],
8
9
  outgoingLinks = []
9
10
  }) => {
11
+ const [selected, setSelected] = React.useState('');
12
+ const handleSelectedUpdate = selectedKey => {
13
+ setSelected(selectedKey);
14
+ };
10
15
  return /*#__PURE__*/React.createElement(Stack, {
11
16
  space: "space.150"
12
17
  }, /*#__PURE__*/React.createElement(AnalyticsContext, {
@@ -15,16 +20,20 @@ const RelatedLinksResolvedView = ({
15
20
  }
16
21
  }, /*#__PURE__*/React.createElement(RelatedLinksList, {
17
22
  urls: incomingLinks,
18
- title: messages.related_links_found_in,
19
- testId: "incoming-related-links-list"
23
+ title: fg('platform-linking-visual-refresh-v2') ? messages.related_links_found_in_v2 : messages.related_links_found_in,
24
+ testId: "incoming-related-links-list",
25
+ selected: selected,
26
+ handleSelectedUpdate: handleSelectedUpdate
20
27
  })), /*#__PURE__*/React.createElement(AnalyticsContext, {
21
28
  data: {
22
29
  component: 'relatedLinksOutgoing'
23
30
  }
24
31
  }, /*#__PURE__*/React.createElement(RelatedLinksList, {
25
32
  urls: outgoingLinks,
26
- title: messages.related_links_includes_links_to,
27
- testId: "outgoing-related-links-list"
33
+ title: fg('platform-linking-visual-refresh-v2') ? messages.related_links_includes_links_to_v2 : messages.related_links_includes_links_to,
34
+ testId: "outgoing-related-links-list",
35
+ selected: selected,
36
+ handleSelectedUpdate: handleSelectedUpdate
28
37
  })));
29
38
  };
30
39
  export default RelatedLinksResolvedView;
@@ -1,11 +1,20 @@
1
1
  import React from 'react';
2
2
  import { FormattedMessage, useIntl } from 'react-intl-next';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { messages } from '../../../../messages';
4
5
  import { EmptyState } from '../../components/EmptyState';
6
+ import { SpotSearchNoResult } from '../errored/error-svg/search-no-result';
5
7
  import { UnavailableSVG } from './unavailable-svg';
6
8
  const RelatedLinksUnavailableView = () => {
7
9
  const intl = useIntl();
8
- return /*#__PURE__*/React.createElement(EmptyState, {
10
+ return fg('platform-linking-visual-refresh-v2') ? /*#__PURE__*/React.createElement(EmptyState, {
11
+ renderImage: () => /*#__PURE__*/React.createElement(SpotSearchNoResult, {
12
+ size: 'large',
13
+ alt: intl.formatMessage(messages.related_links_modal_unavailable_title)
14
+ }),
15
+ header: intl.formatMessage(messages.related_links_modal_unavailable_title),
16
+ description: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_unavailable_description)
17
+ }) : /*#__PURE__*/React.createElement(EmptyState, {
9
18
  renderImage: () => /*#__PURE__*/React.createElement(UnavailableSVG, null),
10
19
  header: intl.formatMessage(messages.related_links_modal_unavailable_header),
11
20
  description: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_unavailable_message)
@@ -0,0 +1,3 @@
1
+ ._1bsb1lit{width:10pc}
2
+ ._1bsb1wqb{width:60px}
3
+ ._1bsb53f4{width:75pt}
@@ -0,0 +1,23 @@
1
+ /* render-svg.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./render-svg.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import Image from '@atlaskit/image';
6
+ const imageSizeStyles = {
7
+ xlarge: "_1bsb1lit",
8
+ large: "_1bsb53f4",
9
+ medium: "_1bsb1wqb"
10
+ };
11
+ export const RenderSVG = ({
12
+ alt,
13
+ size,
14
+ src,
15
+ srcDark
16
+ }) => {
17
+ return /*#__PURE__*/React.createElement(Image, {
18
+ src: src,
19
+ srcDark: srcDark,
20
+ alt: alt,
21
+ className: ax([size && imageSizeStyles[size]])
22
+ });
23
+ };
@@ -0,0 +1,3 @@
1
+ ._1bsbwdok{width:var(--_cjikvn)}
2
+ ._1e0c1ule{display:block}
3
+ ._4t3iwdok{height:var(--_cjikvn)}
@@ -0,0 +1,44 @@
1
+ /* generic-error-icon.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./generic-error-icon.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
6
+ var SIZE = 96;
7
+ var genericErrorStyles = null;
8
+ export var GenericErrorIcon = function GenericErrorIcon(props) {
9
+ return /*#__PURE__*/React.createElement("svg", _extends({
10
+ viewBox: "0 0 96 96",
11
+ fill: "none",
12
+ xmlns: "http://www.w3.org/2000/svg"
13
+ }, props, {
14
+ className: ax(["_1bsbwdok _4t3iwdok _1e0c1ule"]),
15
+ style: {
16
+ "--_cjikvn": ix("".concat(SIZE, "px"))
17
+ }
18
+ }), /*#__PURE__*/React.createElement("path", {
19
+ fill: "#fff",
20
+ d: "M64.861 32.06a27.753 27.753 0 0 0-2.667-4.133 28.187 28.187 0 0 0-3.376-3.669c-6.985-6.311-15.57-6.89-23.609-2.53a30.226 30.226 0 0 0-4.056 2.656 30.624 30.624 0 0 0-3.735 3.4c-6.225 6.717-7.82 15.154-3.505 23.462a28.108 28.108 0 0 0 2.698 4.193 27.67 27.67 0 0 0 3.33 3.62c6.94 6.266 15.518 6.85 23.596 2.507a30.492 30.492 0 0 0 4.23-2.758 30.07 30.07 0 0 0 3.593-3.257c6.252-6.692 7.847-15.161 3.494-23.49h.007Z"
21
+ }), /*#__PURE__*/React.createElement("path", {
22
+ fill: "#DDDEE1",
23
+ d: "M43.092 66.774c-5.306 0-10.382-1.997-14.75-5.938a30.405 30.405 0 0 1-3.62-3.93 30.243 30.243 0 0 1-2.928-4.553c-4.657-8.961-3.247-18.509 3.871-26.192a33.271 33.271 0 0 1 4.025-3.67 32.834 32.834 0 0 1 4.378-2.869c9.209-4.995 18.816-3.951 26.353 2.86a30.945 30.945 0 0 1 3.665 3.98 30.303 30.303 0 0 1 2.898 4.488c4.705 9.003 3.295 18.565-3.868 26.231a32.148 32.148 0 0 1-3.879 3.515 33.415 33.415 0 0 1-4.562 2.975c-3.858 2.073-7.782 3.1-11.583 3.1v.003Zm2.53-45.486c-3.019 0-6.147.84-9.275 2.54a28.433 28.433 0 0 0-3.735 2.448 28.059 28.059 0 0 0-3.442 3.135c-5.746 6.203-6.86 13.566-3.135 20.736a25.395 25.395 0 0 0 2.472 3.83 25.304 25.304 0 0 0 3.044 3.309c5.99 5.41 13.398 6.182 20.862 2.175a28.02 28.02 0 0 0 3.899-2.545 28.03 28.03 0 0 0 3.31-2.999c5.777-6.182 6.883-13.552 3.124-20.75a25.553 25.553 0 0 0-2.44-3.777 25.848 25.848 0 0 0-3.087-3.358c-3.49-3.153-7.442-4.744-11.59-4.744h-.006Z"
24
+ }), /*#__PURE__*/React.createElement("path", {
25
+ fill: "#DDDEE1",
26
+ d: "M62.822 59.694c-1.235-1.72-2.562-1.71-3.857-.708-1.215.939-1.54 2.21-.244 3.882l1.48 1.913 4.102-3.174-1.48-1.913Z"
27
+ }), /*#__PURE__*/React.createElement("path", {
28
+ fill: "#DDDEE1",
29
+ d: "m65.334 60.811-6.159 4.762L70.748 80.54l6.16-4.761L65.333 60.81Z"
30
+ }), /*#__PURE__*/React.createElement("path", {
31
+ fill: "#B7B9BE",
32
+ d: "m64.344 61.577-4.178 3.23 3.925 5.076 4.178-3.23-3.925-5.076Z"
33
+ }), /*#__PURE__*/React.createElement("path", {
34
+ fill: "#DDDEE1",
35
+ fillRule: "evenodd",
36
+ d: "M55.057 33.452 36.213 52.296l-2.468-2.469 18.844-18.844 2.468 2.469Z",
37
+ clipRule: "evenodd"
38
+ }), /*#__PURE__*/React.createElement("path", {
39
+ fill: "#DDDEE1",
40
+ fillRule: "evenodd",
41
+ d: "M52.589 52.296 33.745 33.452l2.468-2.469 18.844 18.844-2.468 2.469Z",
42
+ clipRule: "evenodd"
43
+ }));
44
+ };
@@ -700,16 +700,31 @@ export var messages = defineMessages({
700
700
  defaultMessage: 'Recent links',
701
701
  description: 'Shown as the title for the related links modal'
702
702
  },
703
+ related_links_modal_title_v2: {
704
+ id: 'fabric.linking.related_links_modal_title_v2',
705
+ defaultMessage: 'Related links',
706
+ description: 'Shown as the title for the related links modal'
707
+ },
703
708
  related_links_view_related_urls: {
704
709
  id: 'fabric.linking.related_links_view_related_urls',
705
710
  defaultMessage: 'View recent links',
706
711
  description: 'Action to view related links to the given resource'
707
712
  },
713
+ related_links_view_related_links: {
714
+ id: 'fabric.linking.related_links_view_related_links',
715
+ defaultMessage: 'View related links',
716
+ description: 'Action to view related links to the given resource'
717
+ },
708
718
  related_links_found_in: {
709
719
  id: 'fabric.linking.related_links_found_in',
710
720
  defaultMessage: 'Found In',
711
721
  description: 'Informs the user of the resources are found in the given url'
712
722
  },
723
+ related_links_found_in_v2: {
724
+ id: 'fabric.linking.related_links_found_in_v2',
725
+ defaultMessage: 'Found in',
726
+ description: 'Informs the user of the resources are found in the given url'
727
+ },
713
728
  related_links_not_found: {
714
729
  id: 'fabric.linking.related_links_not_found',
715
730
  defaultMessage: "We didn't find any links to show here.",
@@ -720,16 +735,41 @@ export var messages = defineMessages({
720
735
  defaultMessage: 'Includes Links To',
721
736
  description: 'Informs the user of the resources the url links to'
722
737
  },
738
+ related_links_includes_links_to_v2: {
739
+ id: 'fabric.linking.related_links_includes_links_to_v2',
740
+ defaultMessage: 'Includes links to',
741
+ description: 'Informs the user of the resources the url links to'
742
+ },
723
743
  related_links_modal_error_header: {
724
744
  id: 'fabric.linking.related_links_modal_error_header',
725
745
  defaultMessage: 'Something went wrong',
726
746
  description: 'Title for related links error'
727
747
  },
748
+ related_links_modal_error_title: {
749
+ id: 'fabric.linking.related_links_modal_error_title',
750
+ defaultMessage: "We're having trouble loading related links",
751
+ description: 'Title for related links error'
752
+ },
753
+ related_links_modal_unavailable_title: {
754
+ id: 'fabric.linking.related_links_modal_unavailable_title',
755
+ defaultMessage: "We couldn't find any related links",
756
+ description: 'Title for related links error'
757
+ },
728
758
  related_links_modal_error_message: {
729
759
  id: 'fabric.linking.related_links_modal_error_message',
730
760
  defaultMessage: 'We ran into an issue trying to load recent links. Check your connection or refresh to try again.',
731
761
  description: 'Informs the user that there was a problem loading related links'
732
762
  },
763
+ related_links_modal_error_description: {
764
+ id: 'fabric.linking.related_links_modal_error_description',
765
+ defaultMessage: 'Check your connection or refresh the page to try again',
766
+ description: 'Informs the user that there was a problem loading related links'
767
+ },
768
+ related_links_modal_unavailable_description: {
769
+ id: 'fabric.linking.related_links_modal_unavailable_description',
770
+ defaultMessage: 'We continuously review and add related links for updated pages or other content types',
771
+ description: 'Informs the user that there was a problem loading related links'
772
+ },
733
773
  related_links_modal_unavailable_header: {
734
774
  id: 'fabric.linking.related_links_modal_unavailable_header',
735
775
  defaultMessage: 'No recent links',
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "36.2.6"
7
+ packageVersion: "36.3.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -3,6 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["onClick"];
4
4
  import React, { lazy, useCallback } from 'react';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
7
8
  import { messages } from '../../../../../messages';
8
9
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
@@ -36,7 +37,7 @@ var ViewRelatedLinksAction = function ViewRelatedLinksAction(_ref) {
36
37
  onClickCallback === null || onClickCallback === void 0 || onClickCallback();
37
38
  }, [actionData === null || actionData === void 0 ? void 0 : actionData.ari, fireEvent, modal, onClickCallback]);
38
39
  return actionData ? /*#__PURE__*/React.createElement(Action, _extends({
39
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_view_related_urls),
40
+ content: /*#__PURE__*/React.createElement(FormattedMessage, fg('platform-linking-visual-refresh-v2') ? messages.related_links_view_related_links : messages.related_links_view_related_urls),
40
41
  icon: /*#__PURE__*/React.createElement(RelatedLinksActionIcon, null),
41
42
  onClick: onClick,
42
43
  testId: "smart-action-view-related-links-action",
@@ -2,14 +2,20 @@
2
2
  import "./index.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import ClockIcon from '@atlaskit/icon/core/clock';
5
6
  import ChildIssuesIcon from '@atlaskit/icon/core/migration/child-issues';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
6
8
  var rotateSvg = null;
7
9
 
8
10
  /**
9
11
  * ChildIssuesIcon but 180 degrees rotated
10
12
  */
11
13
  var RelatedLinksActionIcon = function RelatedLinksActionIcon() {
12
- return /*#__PURE__*/React.createElement("span", {
14
+ return fg('platform-linking-visual-refresh-v2') ? /*#__PURE__*/React.createElement(ClockIcon, {
15
+ color: "currentColor",
16
+ spacing: "spacious",
17
+ label: "View related links..."
18
+ }) : /*#__PURE__*/React.createElement("span", {
13
19
  className: ax(["_t9ec1sub _1e0c1o8l"])
14
20
  }, /*#__PURE__*/React.createElement(ChildIssuesIcon, {
15
21
  color: "currentColor",
@@ -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: "36.2.6",
16
+ packageVersion: "36.3.0",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -6,6 +6,7 @@ import { useCallback, useRef } from 'react';
6
6
  import { FormattedMessage } from 'react-intl-next';
7
7
  import Button from '@atlaskit/button/new';
8
8
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { Box } from '@atlaskit/primitives/compiled';
10
11
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
11
12
  import { messages } from '../../../messages';
@@ -38,8 +39,9 @@ var RelatedLinksBaseModal = function RelatedLinksBaseModal(_ref) {
38
39
  width: fixedWidth,
39
40
  autoFocus: false,
40
41
  shouldReturnFocus: false,
41
- onOpenComplete: openCompleteHandler
42
- }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_title))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Box, {
42
+ onOpenComplete: openCompleteHandler,
43
+ height: fg('platform-linking-visual-refresh-v2') ? '504px' : undefined
44
+ }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, fg('platform-linking-visual-refresh-v2') ? messages.related_links_modal_title_v2 : messages.related_links_modal_title))), /*#__PURE__*/React.createElement(ModalBody, null, fg('platform-linking-visual-refresh-v2') ? children : /*#__PURE__*/React.createElement(Box, {
43
45
  xcss: styles.box
44
46
  }, children)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
45
47
  appearance: "primary",
@@ -1,8 +1,20 @@
1
1
 
2
2
  ._11c81o8v{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
3
3
  ._zulputpp{gap:var(--ds-space-150,9pt)}
4
+ ._18zrpxbi{padding-inline:var(--ds-space-200,1pc)}
5
+ ._195gmgjw{margin-inline:var(--ds-space-negative-200,-1pc)}
6
+ ._1kl71vrj{border-left:2px solid transparent}
7
+ ._1kl7nmxp{border-left:var(--_nu2mv8)}
8
+ ._bfhkfg4m{background-color:var(--ds-background-selected,#e9f2ff)}
4
9
  ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
5
10
  ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
6
11
  ._8vu4iti9:hover{border-radius:var(--ds-border-radius-100,4px)}._10swu2gc:hover{padding-inline:var(--ds-space-100,8px)}
7
12
  ._1mxox0bf:hover{margin-inline:var(--ds-space-negative-100,-8px)}
8
- ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
13
+ ._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
14
+ ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
15
+ ._irr3i1yw:hover{background-color:var(--ds-background-selected-hovered,#cce0ff)}
16
+ ._1di619ru:active{background-color:var(--ds-background-selected-pressed,#85b8ff)}
17
+ ._1di61dty:active{background-color:var(--ds-background-neutral-subtle-pressed,#091e4224)}
18
+ ._1ohyglyw:active{outline-style:none}
19
+ ._1q5t1r31:active{outline-color:currentColor}
20
+ ._1r9x1o36:active{outline-width:medium}