@atlaskit/smart-card 27.1.0 → 27.2.1

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 (163) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/extractors/flexible/extract-state.js +1 -2
  3. package/dist/cjs/messages.js +17 -2
  4. package/dist/cjs/state/modal/index.js +69 -0
  5. package/dist/cjs/utils/analytics/analytics.js +1 -1
  6. package/dist/cjs/view/BlockCard/components/ActionIcon.js +22 -14
  7. package/dist/cjs/view/BlockCard/components/Content.js +3 -1
  8. package/dist/cjs/view/BlockCard/components/ContentFooter.js +3 -1
  9. package/dist/cjs/view/BlockCard/components/ContentHeader.js +3 -1
  10. package/dist/cjs/view/BlockCard/components/Frame.js +6 -2
  11. package/dist/cjs/view/BlockCard/components/Link.js +3 -1
  12. package/dist/cjs/view/BlockCard/components/Name.js +3 -1
  13. package/dist/cjs/view/BlockCard/components/Provider.js +1 -0
  14. package/dist/cjs/view/BlockCard/views/ErroredView.js +3 -1
  15. package/dist/cjs/view/BlockCard/views/ForbiddenView.js +6 -2
  16. package/dist/cjs/view/BlockCard/views/NotFoundView.js +3 -1
  17. package/dist/cjs/view/BlockCard/views/ResolvedView.js +6 -2
  18. package/dist/cjs/view/BlockCard/views/ResolvingView.js +3 -1
  19. package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
  20. package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
  21. package/dist/cjs/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
  22. package/dist/cjs/view/CardWithUrl/component.js +3 -2
  23. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +41 -29
  24. package/dist/cjs/view/EmbedCard/components/ImageIcon.js +3 -1
  25. package/dist/cjs/view/EmbedModal/components/link-info/index.js +11 -8
  26. package/dist/cjs/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
  27. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
  28. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
  29. package/dist/cjs/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
  30. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +1 -0
  31. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
  32. package/dist/cjs/view/HoverCard/components/ContentContainer.js +2 -0
  33. package/dist/cjs/view/HoverCard/index.js +2 -1
  34. package/dist/cjs/view/InlineCard/Frame/index.js +3 -1
  35. package/dist/cjs/view/InlineCard/Icon.js +3 -1
  36. package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +23 -13
  37. package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -1
  38. package/dist/cjs/view/LinkUrl/index.js +1 -1
  39. package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
  40. package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +56 -0
  41. package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +41 -0
  42. package/dist/cjs/view/RelatedLinksModal/components/types.js +5 -0
  43. package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +31 -0
  44. package/dist/cjs/view/RelatedLinksModal/views/resolved/types.js +1 -0
  45. package/dist/cjs/view/common/Byline.js +3 -1
  46. package/dist/cjs/view/common/Icon.js +3 -1
  47. package/dist/cjs/view/common/MetadataList.js +3 -1
  48. package/dist/es2019/extractors/flexible/extract-state.js +1 -2
  49. package/dist/es2019/messages.js +17 -2
  50. package/dist/es2019/state/modal/index.js +47 -0
  51. package/dist/es2019/utils/analytics/analytics.js +1 -1
  52. package/dist/es2019/view/BlockCard/components/ActionIcon.js +22 -14
  53. package/dist/es2019/view/BlockCard/components/Content.js +3 -1
  54. package/dist/es2019/view/BlockCard/components/ContentFooter.js +3 -1
  55. package/dist/es2019/view/BlockCard/components/ContentHeader.js +3 -1
  56. package/dist/es2019/view/BlockCard/components/Frame.js +6 -2
  57. package/dist/es2019/view/BlockCard/components/Link.js +3 -1
  58. package/dist/es2019/view/BlockCard/components/Name.js +3 -1
  59. package/dist/es2019/view/BlockCard/components/Provider.js +1 -0
  60. package/dist/es2019/view/BlockCard/views/ErroredView.js +3 -1
  61. package/dist/es2019/view/BlockCard/views/ForbiddenView.js +6 -2
  62. package/dist/es2019/view/BlockCard/views/NotFoundView.js +3 -1
  63. package/dist/es2019/view/BlockCard/views/ResolvedView.js +6 -2
  64. package/dist/es2019/view/BlockCard/views/ResolvingView.js +3 -1
  65. package/dist/es2019/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
  66. package/dist/es2019/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
  67. package/dist/es2019/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
  68. package/dist/es2019/view/CardWithUrl/component.js +3 -2
  69. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +14 -4
  70. package/dist/es2019/view/EmbedCard/components/ImageIcon.js +3 -1
  71. package/dist/es2019/view/EmbedModal/components/link-info/index.js +11 -8
  72. package/dist/es2019/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
  73. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
  74. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
  75. package/dist/es2019/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
  76. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +1 -0
  77. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
  78. package/dist/es2019/view/HoverCard/components/ContentContainer.js +2 -0
  79. package/dist/es2019/view/HoverCard/index.js +2 -1
  80. package/dist/es2019/view/InlineCard/Frame/index.js +3 -1
  81. package/dist/es2019/view/InlineCard/Icon.js +3 -1
  82. package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +23 -13
  83. package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
  84. package/dist/es2019/view/LinkUrl/index.js +1 -1
  85. package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
  86. package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +50 -0
  87. package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +33 -0
  88. package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +23 -0
  89. package/dist/es2019/view/RelatedLinksModal/views/resolved/types.js +0 -0
  90. package/dist/es2019/view/common/Byline.js +3 -1
  91. package/dist/es2019/view/common/Icon.js +3 -1
  92. package/dist/es2019/view/common/MetadataList.js +3 -1
  93. package/dist/esm/extractors/flexible/extract-state.js +1 -2
  94. package/dist/esm/messages.js +17 -2
  95. package/dist/esm/state/modal/index.js +59 -0
  96. package/dist/esm/state/modal/types.js +1 -0
  97. package/dist/esm/utils/analytics/analytics.js +1 -1
  98. package/dist/esm/view/BlockCard/components/ActionIcon.js +22 -14
  99. package/dist/esm/view/BlockCard/components/Content.js +3 -1
  100. package/dist/esm/view/BlockCard/components/ContentFooter.js +3 -1
  101. package/dist/esm/view/BlockCard/components/ContentHeader.js +3 -1
  102. package/dist/esm/view/BlockCard/components/Frame.js +6 -2
  103. package/dist/esm/view/BlockCard/components/Link.js +3 -1
  104. package/dist/esm/view/BlockCard/components/Name.js +3 -1
  105. package/dist/esm/view/BlockCard/components/Provider.js +1 -0
  106. package/dist/esm/view/BlockCard/views/ErroredView.js +3 -1
  107. package/dist/esm/view/BlockCard/views/ForbiddenView.js +6 -2
  108. package/dist/esm/view/BlockCard/views/NotFoundView.js +3 -1
  109. package/dist/esm/view/BlockCard/views/ResolvedView.js +6 -2
  110. package/dist/esm/view/BlockCard/views/ResolvingView.js +3 -1
  111. package/dist/esm/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -0
  112. package/dist/esm/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +3 -1
  113. package/dist/esm/view/CardWithUrl/component-lazy/LoadingCardLink.js +3 -1
  114. package/dist/esm/view/CardWithUrl/component.js +3 -2
  115. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +41 -29
  116. package/dist/esm/view/EmbedCard/components/ImageIcon.js +3 -1
  117. package/dist/esm/view/EmbedModal/components/link-info/index.js +11 -8
  118. package/dist/esm/view/FlexibleCard/components/actions/follow-action/unfollow-icon/index.js +3 -1
  119. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +3 -1
  120. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +1 -0
  121. package/dist/esm/view/FlexibleCard/components/common/motion-wrapper/index.js +3 -0
  122. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +1 -0
  123. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +3 -1
  124. package/dist/esm/view/HoverCard/components/ContentContainer.js +2 -0
  125. package/dist/esm/view/HoverCard/index.js +2 -1
  126. package/dist/esm/view/InlineCard/Frame/index.js +3 -1
  127. package/dist/esm/view/InlineCard/Icon.js +3 -1
  128. package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +23 -13
  129. package/dist/esm/view/InlineCard/ResolvedView/index.js +3 -1
  130. package/dist/esm/view/LinkUrl/index.js +1 -1
  131. package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +10 -7
  132. package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +49 -0
  133. package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +34 -0
  134. package/dist/esm/view/RelatedLinksModal/components/types.js +1 -0
  135. package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +24 -0
  136. package/dist/esm/view/RelatedLinksModal/views/resolved/types.js +0 -0
  137. package/dist/esm/view/common/Byline.js +3 -1
  138. package/dist/esm/view/common/Icon.js +3 -1
  139. package/dist/esm/view/common/MetadataList.js +3 -1
  140. package/dist/types/messages.d.ts +1 -1
  141. package/dist/types/state/modal/index.d.ts +19 -0
  142. package/dist/types/state/modal/types.d.ts +16 -0
  143. package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +5 -4
  144. package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +5 -0
  145. package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +5 -0
  146. package/dist/types/view/RelatedLinksModal/components/types.d.ts +16 -0
  147. package/dist/types/view/RelatedLinksModal/views/resolved/index.d.ts +5 -0
  148. package/dist/types/view/RelatedLinksModal/views/resolved/types.d.ts +4 -0
  149. package/dist/types-ts4.5/messages.d.ts +1 -1
  150. package/dist/types-ts4.5/state/modal/index.d.ts +19 -0
  151. package/dist/types-ts4.5/state/modal/types.d.ts +16 -0
  152. package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +5 -4
  153. package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +5 -0
  154. package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/index.d.ts +5 -0
  155. package/dist/types-ts4.5/view/RelatedLinksModal/components/types.d.ts +16 -0
  156. package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/index.d.ts +5 -0
  157. package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/types.d.ts +4 -0
  158. package/package.json +2 -5
  159. package/dist/types/view/RelatedLinksModal/types.d.ts +0 -6
  160. package/dist/types-ts4.5/view/RelatedLinksModal/types.d.ts +0 -6
  161. /package/dist/cjs/{view/RelatedLinksModal → state/modal}/types.js +0 -0
  162. /package/dist/es2019/{view/RelatedLinksModal → state/modal}/types.js +0 -0
  163. /package/dist/{esm/view/RelatedLinksModal → es2019/view/RelatedLinksModal/components}/types.js +0 -0
@@ -36,7 +36,9 @@ export const NotFoundView = ({
36
36
  const handleClick = event => handleClickCommon(event, onClick);
37
37
  return jsx(Frame, {
38
38
  isSelected: isSelected,
39
- testId: testId,
39
+ testId: testId
40
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
41
+ ,
40
42
  className: blockCardNotFoundViewClassName,
41
43
  isFluidHeight: true
42
44
  }, jsx(Content, {
@@ -63,14 +63,18 @@ export const ResolvedView = ({
63
63
  items: details
64
64
  }) : undefined;
65
65
  const resolvedByline = jsx(Byline, {
66
- testId: testId ? `${testId}-by` : undefined,
66
+ testId: testId ? `${testId}-by` : undefined
67
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
68
+ ,
67
69
  className: blockCardResolvedViewByClassName
68
70
  }, byline);
69
71
  const handleClick = event => handleClickCommon(event, onClick);
70
72
  const hasActions = actions.length > 0;
71
73
  return jsx(Frame, {
72
74
  isSelected: isSelected,
73
- testId: testId,
75
+ testId: testId
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
77
+ ,
74
78
  className: blockCardResolvedViewClassName
75
79
  }, jsx(Content, null, jsx("div", null, jsx("div", {
76
80
  css: styles
@@ -22,7 +22,9 @@ export const ResolvingView = ({
22
22
  inheritDimensions: inheritDimensions,
23
23
  compact: true,
24
24
  isSelected: isSelected,
25
- testId: testId,
25
+ testId: testId
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
27
+ ,
26
28
  className: blockCardResolvingViewClassName
27
29
  }, jsx(DocumentFilledIcon, {
28
30
  size: "small",
@@ -43,6 +43,8 @@ export function LazyIntersectionObserverCard(props) {
43
43
  const content = isIntersecting ? /*#__PURE__*/React.createElement(CardWithUrlContent, props) : /*#__PURE__*/React.createElement(ComponentObserver, {
44
44
  ref: ref
45
45
  }, /*#__PURE__*/React.createElement(LoadingCardLink, props));
46
+
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
46
48
  return /*#__PURE__*/React.createElement(Component, {
47
49
  className: "loader-wrapper"
48
50
  }, content);
@@ -16,7 +16,9 @@ export function LazyLazilyRenderCard(props) {
16
16
  });
17
17
  return /*#__PURE__*/React.createElement(LazilyRender, {
18
18
  offset: offset,
19
- component: appearance === 'inline' ? 'span' : 'div',
19
+ component: appearance === 'inline' ? 'span' : 'div'
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
21
+ ,
20
22
  className: "loader-wrapper",
21
23
  placeholder: /*#__PURE__*/React.createElement(LoadingCardLink, props),
22
24
  scrollContainer: container,
@@ -11,7 +11,9 @@ export const LoadingCardLink = ({
11
11
  testId: 'lazy-render-placeholder',
12
12
  "data-trello-do-not-use-override": "lazy-render-placeholder-trello",
13
13
  isSelected: isSelected,
14
- link: url,
14
+ link: url
15
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
16
+ ,
15
17
  className: loadingPlaceholderClassName,
16
18
  placeholder: placeholder
17
19
  });
@@ -1,6 +1,7 @@
1
1
  import React, { useEffect, useCallback, useMemo } from 'react';
2
2
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
3
  import { useFeatureFlag } from '@atlaskit/link-provider';
4
+ import { SmartLinkModalProvider } from '../../state/modal';
4
5
  import { combineFrameStyle, isSpecialEvent } from '../../utils';
5
6
  import * as measure from '../../utils/performance';
6
7
  import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct, getCanBeDatasource } from '../../state/helpers';
@@ -265,9 +266,9 @@ function Component({
265
266
  }
266
267
  export const CardWithUrlContent = props => {
267
268
  const display = isFlexibleUiCard(props.children) ? CardDisplay.Flexible : props.appearance;
268
- return /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
269
+ return /*#__PURE__*/React.createElement(SmartLinkModalProvider, null, /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
269
270
  url: props.url,
270
271
  id: props.id,
271
272
  display: display
272
- }, /*#__PURE__*/React.createElement(Component, props));
273
+ }, /*#__PURE__*/React.createElement(Component, props)));
273
274
  };
@@ -23,7 +23,10 @@ export const ExpandedFrame = ({
23
23
  const handleClick = event => handleClickCommon(event, onClick);
24
24
  const handleMouseDown = useMouseDownEvent();
25
25
  const isFixEmbedCardBlurEnabled = getBooleanFF('platform.linking-platform.smart-card.fix-embed-card-blurring') ? true : false;
26
- const renderHeaderOld = () => /*#__PURE__*/React.createElement(Header, {
26
+ const renderHeaderOld = () =>
27
+ /*#__PURE__*/
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
29
+ React.createElement(Header, {
27
30
  className: "embed-header",
28
31
  frameStyle: frameStyle
29
32
  }, /*#__PURE__*/React.createElement(IconWrapper, {
@@ -35,7 +38,10 @@ export const ExpandedFrame = ({
35
38
  onClick: handleClick,
36
39
  onMouseDown: handleMouseDown
37
40
  }, text)));
38
- const renderHeader = () => /*#__PURE__*/React.createElement(Header, {
41
+ const renderHeader = () =>
42
+ /*#__PURE__*/
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
44
+ React.createElement(Header, {
39
45
  className: "embed-header",
40
46
  frameStyle: frameStyle
41
47
  }, /*#__PURE__*/React.createElement(IconWrapper, {
@@ -58,7 +64,9 @@ export const ExpandedFrame = ({
58
64
  frameStyle: frameStyle
59
65
  }, children);
60
66
  if (!isPlaceholder && href) {
61
- return /*#__PURE__*/React.createElement(LinkWrapper, {
67
+ return /*#__PURE__*/React.createElement(LinkWrapper
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
69
+ , {
62
70
  className: className,
63
71
  isInteractive: isInteractive(),
64
72
  isSelected: isSelected,
@@ -73,7 +81,9 @@ export const ExpandedFrame = ({
73
81
  inheritDimensions: inheritDimensions
74
82
  }, getBooleanFF('platform.linking-platform.smart-card.enable-embed-card-header-tooltip_g9saw') ? renderHeader() : renderHeaderOld(), renderContent());
75
83
  } else {
76
- return /*#__PURE__*/React.createElement(Wrapper, {
84
+ return /*#__PURE__*/React.createElement(Wrapper
85
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
86
+ , {
77
87
  className: className,
78
88
  isInteractive: isInteractive(),
79
89
  isSelected: isSelected,
@@ -15,7 +15,9 @@ export const ImageIcon = ({
15
15
  return /*#__PURE__*/React.createElement(ImageLoader, {
16
16
  src: src,
17
17
  loading: defaultIcon,
18
- loaded: /*#__PURE__*/React.createElement(Image, {
18
+ loaded: /*#__PURE__*/React.createElement(Image
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
20
+ , {
19
21
  className: "smart-link-icon",
20
22
  src: src,
21
23
  alt: alt,
@@ -59,14 +59,17 @@ const LinkInfo = ({
59
59
  }) : jsx(VidFullScreenOnIcon, {
60
60
  label: message.defaultMessage
61
61
  });
62
- return jsx("span", {
63
- className: "smart-link-resize-button"
64
- }, jsx(LinkInfoButton, {
65
- content: jsx(FormattedMessage, message),
66
- icon: icon,
67
- onClick: onResizeButtonClick,
68
- testId: `${testId}-resize`
69
- }));
62
+ return (
63
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
64
+ jsx("span", {
65
+ className: "smart-link-resize-button"
66
+ }, jsx(LinkInfoButton, {
67
+ content: jsx(FormattedMessage, message),
68
+ icon: icon,
69
+ onClick: onResizeButtonClick,
70
+ testId: `${testId}-resize`
71
+ }))
72
+ );
70
73
  }, [onResizeButtonClick, size, testId]);
71
74
  return jsx("div", {
72
75
  css: containerStyles
@@ -6,7 +6,9 @@ const UnfollowGlyph = props => /*#__PURE__*/React.createElement("svg", {
6
6
  height: "16",
7
7
  viewBox: "0 0 16 16",
8
8
  "data-testid": props['data-testid'],
9
- "aria-label": props['aria-label'],
9
+ "aria-label": props['aria-label']
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
11
+ ,
10
12
  className: props.className,
11
13
  role: "presentation",
12
14
  xmlns: "http://www.w3.org/2000/svg"
@@ -103,7 +103,9 @@ const ActionGroup = ({
103
103
  return null;
104
104
  }, [appearance, isMoreThenTwoItems, isOpen, onActionItemClick, onOpenChange, renderableActionItems, size, ui === null || ui === void 0 ? void 0 : ui.zIndex, visibleButtonsNum]);
105
105
  return renderableActionItems.length > 0 ? jsx("div", {
106
- css: styles,
106
+ css: styles
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
108
+ ,
107
109
  className: "actions-button-group",
108
110
  "data-action-open": isOpen
109
111
  }, jsx(ButtonGroup, null, actionButtons, moreActionDropdown)) : null;
@@ -63,6 +63,7 @@ const TitleBlockErroredView = ({
63
63
  direction: SmartLinkDirection.Horizontal,
64
64
  align: SmartLinkAlignment.Right
65
65
  }, jsx("span", {
66
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
66
67
  className: hasAction ? 'has-action' : '',
67
68
  css: getMessageStyles(size, hasAction),
68
69
  onClick: onClick,
@@ -24,13 +24,16 @@ export const MotionWrapper = ({
24
24
  style: {
25
25
  height,
26
26
  minHeight,
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
27
28
  lineHeight: 0,
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
28
30
  overflow: 'hidden',
29
31
  // a fit for purpose state variable to control when the 'visible' styles should be appled
30
32
  opacity: height > 0 ? 1 : 0,
31
33
  // we only want to transition opacity and height when the error message is initially shown
32
34
  // not if its to be shown on mount
33
35
  transitionProperty: showTransition ? transition : 'none',
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
34
37
  transitionDuration: '0.3s'
35
38
  },
36
39
  ref: ref
@@ -49,6 +49,7 @@ const LayeredLink = ({
49
49
  }) => {
50
50
  const onMouseDown = useMouseDownEvent();
51
51
  return jsx("a", {
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
52
53
  className: "layered-link",
53
54
  css: styles,
54
55
  "data-testid": `${testId}-layered-link`,
@@ -35,7 +35,9 @@ const Lozenge = ({
35
35
  text: text,
36
36
  zIndex: ui === null || ui === void 0 ? void 0 : ui.zIndex
37
37
  }) : jsx(AtlaskitLozenge, {
38
- appearance: appearance,
38
+ appearance: appearance
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
40
+ ,
39
41
  style: style,
40
42
  testId: `${testId}-lozenge`
41
43
  }, text);
@@ -45,6 +45,7 @@ const ConnectedAIPrismContainer = ({
45
45
  setShowPrism(status === 'loading');
46
46
  }, [status]);
47
47
  const container = jsx("div", _extends({
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
48
49
  className: hoverCardClassName,
49
50
  css: [HoverCardContainer, !isAIEnabled ? popupContainerStyles : undefined],
50
51
  "data-testid": testId
@@ -69,6 +70,7 @@ const ContentContainer = ({
69
70
  }, props), children);
70
71
  }
71
72
  return jsx("div", _extends({
73
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
72
74
  className: hoverCardClassName,
73
75
  css: HoverCardContainer,
74
76
  "data-testid": testId
@@ -4,6 +4,7 @@ import { jsx } from '@emotion/react';
4
4
  import { useCallback } from 'react';
5
5
  import { ErrorBoundary } from 'react-error-boundary';
6
6
  import { useSmartLinkAnalytics } from '../../state/analytics';
7
+ import { SmartLinkModalProvider } from '../../state/modal';
7
8
  import { HoverCardComponent } from './components/HoverCardComponent';
8
9
  import { CardDisplay } from '../../constants';
9
10
  import { di } from 'react-magnetic-di';
@@ -25,7 +26,7 @@ const HoverCardWithErrorBoundary = props => {
25
26
  return jsx(ErrorBoundary, {
26
27
  fallback: children,
27
28
  onError: onError
28
- }, jsx(HoverCardComponent, props, children));
29
+ }, jsx(SmartLinkModalProvider, null, jsx(HoverCardComponent, props, children)));
29
30
  };
30
31
  const HoverCardWithoutAnalyticsContext = withAnalyticsEvents()(HoverCardWithErrorBoundary);
31
32
 
@@ -44,7 +44,9 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
44
44
  onClick: handleClick,
45
45
  onMouseDown: handleMouseDown,
46
46
  onKeyPress: handleKeyPress,
47
- "data-testid": testId,
47
+ "data-testid": testId
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
49
+ ,
48
50
  className: className,
49
51
  ref: ref,
50
52
  isHovered: isHovered
@@ -43,7 +43,9 @@ export const Shimmer = ({
43
43
  width: 14,
44
44
  height: 14,
45
45
  borderRadius: 2,
46
- testId: testId,
46
+ testId: testId
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
48
+ ,
47
49
  style: skeletonCustomStyles
48
50
  });
49
51
  };
@@ -54,7 +54,9 @@ export class IconAndTitleLayout extends React.Component {
54
54
  }
55
55
  return /*#__PURE__*/React.createElement(ImageLoader, {
56
56
  src: url,
57
- loaded: /*#__PURE__*/React.createElement(Icon, {
57
+ loaded: /*#__PURE__*/React.createElement(Icon
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
59
+ , {
58
60
  className: "smart-link-icon",
59
61
  src: url,
60
62
  "data-testid": `${testId}-image`
@@ -101,22 +103,30 @@ export class IconAndTitleLayout extends React.Component {
101
103
  rightSide,
102
104
  testId = 'inline-card-icon-and-title'
103
105
  } = this.props;
104
- const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper, {
106
+ const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, null), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
108
+ , {
105
109
  style: {
106
110
  color: titleTextColor
107
- },
111
+ }
112
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
113
+ ,
108
114
  className: TitleWrapperClassName
109
115
  }, title));
110
- return /*#__PURE__*/React.createElement(IconTitleWrapper, {
111
- style: {
112
- color: titleColor
113
- },
114
- "data-testid": testId
115
- }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
116
- href: link,
117
- onClick: this.handleClick,
118
- onKeyPress: this.handleKeyPress
119
- }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null);
116
+ return (
117
+ /*#__PURE__*/
118
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
119
+ React.createElement(IconTitleWrapper, {
120
+ style: {
121
+ color: titleColor
122
+ },
123
+ "data-testid": testId
124
+ }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
125
+ href: link,
126
+ onClick: this.handleClick,
127
+ onKeyPress: this.handleKeyPress
128
+ }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null)
129
+ );
120
130
  }
121
131
  }
122
132
  _defineProperty(IconAndTitleLayout, "defaultProps", {
@@ -15,7 +15,9 @@ export class InlineCardResolvedView extends React.Component {
15
15
  const appearance = lozenge.appearance || 'default';
16
16
  return /*#__PURE__*/React.createElement(LozengeWrapper, null, /*#__PURE__*/React.createElement(Lozenge, {
17
17
  testId: "inline-card-resolved-view-lozenge",
18
- appearance: appearance,
18
+ appearance: appearance
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
20
+ ,
19
21
  style: lozenge.style,
20
22
  isBold: lozenge.isBold
21
23
  }, lozenge.text));
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "27.1.0",
10
+ packageVersion: "27.2.1",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -1,18 +1,21 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
2
4
  import { FormattedMessage } from 'react-intl-next';
3
5
  import Button from '@atlaskit/button/new';
4
6
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
5
7
  import { messages } from '../../../messages';
6
- const RelatedLinksModal = ({
8
+ const RelatedLinksBaseModal = ({
7
9
  onClose,
8
10
  showModal,
9
11
  children
10
12
  }) => {
11
- return /*#__PURE__*/React.createElement(ModalTransition, null, showModal && /*#__PURE__*/React.createElement(Modal, {
12
- onClose: onClose
13
- }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.related_links_modal_title_nonfinal))), /*#__PURE__*/React.createElement(ModalBody, null, children), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
13
+ return jsx(ModalTransition, null, showModal && jsx(Modal, {
14
+ onClose: onClose,
15
+ width: "small"
16
+ }, jsx(ModalHeader, null, jsx(ModalTitle, null, jsx(FormattedMessage, messages.related_links_modal_title))), jsx(ModalBody, null, children), jsx(ModalFooter, null, jsx(Button, {
14
17
  appearance: "primary",
15
18
  onClick: onClose
16
- }, /*#__PURE__*/React.createElement(FormattedMessage, messages.close)))));
19
+ }, jsx(FormattedMessage, messages.close)))));
17
20
  };
18
- export default RelatedLinksModal;
21
+ export default RelatedLinksBaseModal;
@@ -0,0 +1,50 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+ import { Box, xcss } from '@atlaskit/primitives';
4
+ import { Card, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, TitleBlock } from '../../../../index';
5
+ const hoverStyles = xcss({
6
+ ':hover': {
7
+ backgroundColor: 'color.background.input.hovered',
8
+ borderRadius: 'border.radius.100',
9
+ marginInline: 'space.negative.100',
10
+ paddingInline: 'space.100'
11
+ }
12
+ });
13
+ const relatedLinkItemStyles = css({
14
+ paddingTop: "var(--ds-space-100, 8px)",
15
+ paddingBottom: "var(--ds-space-100, 8px)",
16
+ gap: "var(--ds-space-150, 12px)",
17
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
18
+ });
19
+ const RelatedLinkItem = ({
20
+ url,
21
+ testId
22
+ }) => {
23
+ const subtitle = [{
24
+ name: ElementName.Provider
25
+ }];
26
+ const ui = {
27
+ hideElevation: true,
28
+ hidePadding: true,
29
+ hideBackground: true,
30
+ theme: SmartLinkTheme.Black,
31
+ clickableContainer: true,
32
+ size: SmartLinkSize.Large
33
+ };
34
+ return jsx(Box, {
35
+ testId: testId,
36
+ xcss: hoverStyles
37
+ }, jsx(Card, {
38
+ appearance: "block",
39
+ ui: ui,
40
+ url: url
41
+ }, jsx(TitleBlock, {
42
+ maxLines: 1,
43
+ hideTitleTooltip: true,
44
+ position: SmartLinkPosition.Center,
45
+ subtitle: subtitle,
46
+ overrideCss: relatedLinkItemStyles,
47
+ anchorTarget: "_blank"
48
+ })));
49
+ };
50
+ export default RelatedLinkItem;
@@ -0,0 +1,33 @@
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
4
+ import { FormattedMessage } from 'react-intl-next';
5
+ import { Box, Stack, xcss } from '@atlaskit/primitives';
6
+ import RelatedLinkItem from '../related-link-item';
7
+ import { messages } from '../../../../messages';
8
+ const RelatedLinksList = ({
9
+ urls,
10
+ title,
11
+ testId
12
+ }) => {
13
+ return jsx(Stack, {
14
+ testId: testId
15
+ }, jsx(Box, {
16
+ paddingBlockStart: "space.050",
17
+ xcss: xcss({
18
+ font: "var(--ds-font-heading-xxsmall, normal 600 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
19
+ textTransform: 'uppercase'
20
+ })
21
+ }, jsx(FormattedMessage, title)), urls.length > 0 && jsx(Box, null, urls.map((url, idx) => jsx(Stack, {
22
+ key: `${idx}-${url}`
23
+ }, jsx(RelatedLinkItem, {
24
+ url: url,
25
+ testId: `${testId}-item-${idx}`
26
+ })))), urls.length === 0 && jsx(Box, {
27
+ paddingBlock: "space.100",
28
+ xcss: xcss({
29
+ font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
30
+ })
31
+ }, jsx(FormattedMessage, messages.related_links_not_found)));
32
+ };
33
+ export default RelatedLinksList;
@@ -0,0 +1,23 @@
1
+ /** @jsx jsx */
2
+
3
+ import { jsx } from '@emotion/react';
4
+ import { messages } from '../../../../messages';
5
+ import RelatedLinksList from '../../components/related-links-list';
6
+ import { Stack } from '@atlaskit/primitives';
7
+ const RelatedLinksResolvedView = ({
8
+ incomingLinks = [],
9
+ outgoingLinks = []
10
+ }) => {
11
+ return jsx(Stack, {
12
+ space: "space.150"
13
+ }, jsx(RelatedLinksList, {
14
+ urls: incomingLinks,
15
+ title: messages.related_links_found_in,
16
+ testId: "incoming-related-links-list"
17
+ }), jsx(RelatedLinksList, {
18
+ urls: outgoingLinks,
19
+ title: messages.related_links_includes_links_to,
20
+ testId: "outgoing-related-links-list"
21
+ }));
22
+ };
23
+ export default RelatedLinksResolvedView;
@@ -29,6 +29,8 @@ export const Byline = ({
29
29
  // due to HTML its unwrapping behaviour on paste.
30
30
  MozUserSelect: 'none'
31
31
  }),
32
- "data-testid": testId,
32
+ "data-testid": testId
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
34
+ ,
33
35
  className: className
34
36
  }, text || children);
@@ -55,7 +55,9 @@ export const Icon = ({
55
55
  });
56
56
  return jsx("span", {
57
57
  css: getSpanStyles(isFlexibleUi),
58
- "data-testid": testId,
58
+ "data-testid": testId
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
60
+ ,
59
61
  className: blockCardIconImageClassName
60
62
  }, icon || image || placeholder);
61
63
  };
@@ -18,7 +18,9 @@ export const MetadataList = ({
18
18
  marginRight: '0px'
19
19
  }
20
20
  },
21
- "data-testid": testId,
21
+ "data-testid": testId
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
23
+ ,
22
24
  className: metadataListClassName
23
25
  }, items.map(item => jsx(Metadata, _extends({
24
26
  key: item.text
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { extractLozenge } from '../common/lozenge';
5
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
5
  import { getExtensionKey } from '../../state/helpers';
7
6
  import extractServerAction from './extract-server-action';
8
7
  import { extractLink } from '@atlaskit/link-extractors';
@@ -58,7 +57,7 @@ var extractState = function extractState(response, actionOptions, id) {
58
57
  if (!lozenge) {
59
58
  return;
60
59
  }
61
- if (!canShowAction(CardAction.ChangeStatusAction, actionOptions) || getBooleanFF('platform.linking-platform.smart-card.disable-jira-status-action')) {
60
+ if (!canShowAction(CardAction.ChangeStatusAction, actionOptions)) {
62
61
  return lozenge;
63
62
  }
64
63
  var action = extractAction(response, id);
@@ -700,8 +700,8 @@ export var messages = defineMessages({
700
700
  defaultMessage: 'An error occurred',
701
701
  description: 'A generic error message to the user'
702
702
  },
703
- related_links_modal_title_nonfinal: {
704
- id: 'fabric.linking.related_links_modal_title.nonfinal',
703
+ related_links_modal_title: {
704
+ id: 'fabric.linking.related_links_modal_title',
705
705
  defaultMessage: 'Recent Links',
706
706
  description: 'Shown as the title for the related links modal'
707
707
  },
@@ -709,5 +709,20 @@ export var messages = defineMessages({
709
709
  id: 'fabric.linking.related_links_view_related_urls.nonfinal',
710
710
  defaultMessage: 'View recent links...',
711
711
  description: 'Action to view related links to the given resource'
712
+ },
713
+ related_links_found_in: {
714
+ id: 'fabric.linking.related_links_found_in',
715
+ defaultMessage: 'Found In',
716
+ description: 'Informs the user of the resources are found in the given url'
717
+ },
718
+ related_links_not_found: {
719
+ id: 'fabric.linking.related_links_not_found',
720
+ defaultMessage: 'We didn\'t find any links to show here.',
721
+ description: 'Informs the user that there are no related resources for the given url'
722
+ },
723
+ related_links_includes_links_to: {
724
+ id: 'fabric.linking.related_links_includes_links_to',
725
+ defaultMessage: 'Includes Links To',
726
+ description: 'Informs the user of the resources the url links to'
712
727
  }
713
728
  });