@atlaskit/smart-card 17.7.3 → 17.7.6

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 (120) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/classNames.js +2 -2
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +1 -1
  5. package/dist/cjs/view/BlockCard/components/ActionList.js +1 -1
  6. package/dist/cjs/view/BlockCard/components/CollaboratorList.js +1 -1
  7. package/dist/cjs/view/BlockCard/components/Content.js +1 -1
  8. package/dist/cjs/view/BlockCard/components/ContentFooter.js +1 -1
  9. package/dist/cjs/view/BlockCard/components/Emoji.js +1 -1
  10. package/dist/cjs/view/BlockCard/components/Frame.js +1 -1
  11. package/dist/cjs/view/BlockCard/components/Name.js +1 -1
  12. package/dist/cjs/view/BlockCard/components/Provider.js +1 -1
  13. package/dist/cjs/view/BlockCard/components/Thumbnail.js +1 -1
  14. package/dist/cjs/view/BlockCard/views/ErroredView.js +1 -1
  15. package/dist/cjs/view/BlockCard/views/ForbiddenView.js +1 -1
  16. package/dist/cjs/view/BlockCard/views/NotFoundView.js +1 -1
  17. package/dist/cjs/view/BlockCard/views/ResolvedView.js +4 -4
  18. package/dist/cjs/view/BlockCard/views/ResolvingView.js +1 -1
  19. package/dist/cjs/view/BlockCard/views/UnauthorizedView.js +1 -1
  20. package/dist/cjs/view/EmbedCard/components/styled.js +1 -1
  21. package/dist/cjs/view/EmbedCard/views/ErroredView.js +1 -1
  22. package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +1 -1
  23. package/dist/cjs/view/HoverCard/index.js +37 -0
  24. package/dist/cjs/view/HoverCard/styled.js +19 -0
  25. package/dist/cjs/view/HoverCard/types.js +5 -0
  26. package/dist/cjs/view/InlineCard/ResolvedView/index.js +15 -2
  27. package/dist/cjs/view/InlineCard/index.js +3 -1
  28. package/dist/cjs/view/{BlockCard/components → common}/Byline.js +1 -1
  29. package/dist/cjs/view/{BlockCard/components → common}/Icon.js +1 -1
  30. package/dist/cjs/view/{BlockCard/components → common}/Metadata.js +1 -1
  31. package/dist/cjs/view/{BlockCard/components → common}/MetadataList.js +1 -1
  32. package/dist/cjs/view/{BlockCard/components → common}/Modal.js +1 -1
  33. package/dist/cjs/view/{BlockCard/components → common}/ModalHeader.js +1 -1
  34. package/dist/cjs/view/{BlockCard/utils/index.js → common/utils.js} +0 -0
  35. package/dist/es2019/classNames.js +2 -2
  36. package/dist/es2019/version.json +1 -1
  37. package/dist/es2019/view/BlockCard/actions/PreviewAction.js +1 -1
  38. package/dist/es2019/view/BlockCard/components/ActionList.js +1 -1
  39. package/dist/es2019/view/BlockCard/components/CollaboratorList.js +1 -1
  40. package/dist/es2019/view/BlockCard/components/Content.js +1 -1
  41. package/dist/es2019/view/BlockCard/components/ContentFooter.js +1 -1
  42. package/dist/es2019/view/BlockCard/components/Emoji.js +1 -1
  43. package/dist/es2019/view/BlockCard/components/Frame.js +1 -1
  44. package/dist/es2019/view/BlockCard/components/Name.js +1 -1
  45. package/dist/es2019/view/BlockCard/components/Provider.js +1 -1
  46. package/dist/es2019/view/BlockCard/components/Thumbnail.js +1 -1
  47. package/dist/es2019/view/BlockCard/views/ErroredView.js +1 -1
  48. package/dist/es2019/view/BlockCard/views/ForbiddenView.js +1 -1
  49. package/dist/es2019/view/BlockCard/views/NotFoundView.js +1 -1
  50. package/dist/es2019/view/BlockCard/views/ResolvedView.js +4 -4
  51. package/dist/es2019/view/BlockCard/views/ResolvingView.js +1 -1
  52. package/dist/es2019/view/BlockCard/views/UnauthorizedView.js +1 -1
  53. package/dist/es2019/view/EmbedCard/components/styled.js +1 -1
  54. package/dist/es2019/view/EmbedCard/views/ErroredView.js +1 -1
  55. package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +1 -1
  56. package/dist/es2019/view/HoverCard/index.js +20 -0
  57. package/dist/es2019/view/HoverCard/styled.js +9 -0
  58. package/dist/es2019/view/HoverCard/types.js +1 -0
  59. package/dist/es2019/view/InlineCard/ResolvedView/index.js +12 -2
  60. package/dist/es2019/view/InlineCard/index.js +3 -1
  61. package/dist/es2019/view/{BlockCard/components → common}/Byline.js +1 -1
  62. package/dist/es2019/view/{BlockCard/components → common}/Icon.js +1 -1
  63. package/dist/es2019/view/{BlockCard/components → common}/Metadata.js +1 -1
  64. package/dist/es2019/view/{BlockCard/components → common}/MetadataList.js +1 -1
  65. package/dist/es2019/view/{BlockCard/components → common}/Modal.js +1 -1
  66. package/dist/es2019/view/{BlockCard/components → common}/ModalHeader.js +1 -1
  67. package/dist/es2019/view/{BlockCard/utils/index.js → common/utils.js} +0 -0
  68. package/dist/esm/classNames.js +2 -2
  69. package/dist/esm/version.json +1 -1
  70. package/dist/esm/view/BlockCard/actions/PreviewAction.js +1 -1
  71. package/dist/esm/view/BlockCard/components/ActionList.js +1 -1
  72. package/dist/esm/view/BlockCard/components/CollaboratorList.js +1 -1
  73. package/dist/esm/view/BlockCard/components/Content.js +1 -1
  74. package/dist/esm/view/BlockCard/components/ContentFooter.js +1 -1
  75. package/dist/esm/view/BlockCard/components/Emoji.js +1 -1
  76. package/dist/esm/view/BlockCard/components/Frame.js +1 -1
  77. package/dist/esm/view/BlockCard/components/Name.js +1 -1
  78. package/dist/esm/view/BlockCard/components/Provider.js +1 -1
  79. package/dist/esm/view/BlockCard/components/Thumbnail.js +1 -1
  80. package/dist/esm/view/BlockCard/views/ErroredView.js +1 -1
  81. package/dist/esm/view/BlockCard/views/ForbiddenView.js +1 -1
  82. package/dist/esm/view/BlockCard/views/NotFoundView.js +1 -1
  83. package/dist/esm/view/BlockCard/views/ResolvedView.js +4 -4
  84. package/dist/esm/view/BlockCard/views/ResolvingView.js +1 -1
  85. package/dist/esm/view/BlockCard/views/UnauthorizedView.js +1 -1
  86. package/dist/esm/view/EmbedCard/components/styled.js +1 -1
  87. package/dist/esm/view/EmbedCard/views/ErroredView.js +1 -1
  88. package/dist/esm/view/EmbedCard/views/UnresolvedView.js +1 -1
  89. package/dist/esm/view/HoverCard/index.js +19 -0
  90. package/dist/esm/view/HoverCard/styled.js +7 -0
  91. package/dist/esm/view/HoverCard/types.js +1 -0
  92. package/dist/esm/view/InlineCard/ResolvedView/index.js +13 -2
  93. package/dist/esm/view/InlineCard/index.js +3 -1
  94. package/dist/esm/view/{BlockCard/components → common}/Byline.js +1 -1
  95. package/dist/esm/view/{BlockCard/components → common}/Icon.js +1 -1
  96. package/dist/esm/view/{BlockCard/components → common}/Metadata.js +1 -1
  97. package/dist/esm/view/{BlockCard/components → common}/MetadataList.js +1 -1
  98. package/dist/esm/view/{BlockCard/components → common}/Modal.js +1 -1
  99. package/dist/esm/view/{BlockCard/components → common}/ModalHeader.js +1 -1
  100. package/dist/esm/view/{BlockCard/utils/index.js → common/utils.js} +0 -0
  101. package/dist/types/classNames.d.ts +2 -2
  102. package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +3 -3
  103. package/dist/types/view/BlockCard/views/ForbiddenView.d.ts +1 -1
  104. package/dist/types/view/BlockCard/views/NotFoundView.d.ts +1 -1
  105. package/dist/types/view/BlockCard/views/ResolvedView.d.ts +2 -2
  106. package/dist/types/view/BlockCard/views/UnauthorizedView.d.ts +1 -1
  107. package/dist/types/view/Card/index.d.ts +1 -1
  108. package/dist/types/view/HoverCard/index.d.ts +3 -0
  109. package/dist/types/view/HoverCard/styled.d.ts +2 -0
  110. package/dist/types/view/HoverCard/types.d.ts +3 -0
  111. package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
  112. package/dist/types/view/InlineCard/types.d.ts +1 -0
  113. package/dist/types/view/{BlockCard/components → common}/Byline.d.ts +0 -0
  114. package/dist/types/view/{BlockCard/components → common}/Icon.d.ts +0 -0
  115. package/dist/types/view/{BlockCard/components → common}/Metadata.d.ts +0 -0
  116. package/dist/types/view/{BlockCard/components → common}/MetadataList.d.ts +0 -0
  117. package/dist/types/view/{BlockCard/components → common}/Modal.d.ts +0 -0
  118. package/dist/types/view/{BlockCard/components → common}/ModalHeader.d.ts +0 -0
  119. package/dist/types/view/{BlockCard/utils/index.d.ts → common/utils.d.ts} +0 -0
  120. package/package.json +1 -1
@@ -4,7 +4,7 @@ import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
4
4
  import { N50, N90 } from '@atlaskit/theme/colors';
5
5
  import { fontSize } from '@atlaskit/theme/constants';
6
6
  import { Frame } from '../components/Frame';
7
- import { gs } from '../utils';
7
+ import { gs } from '../../common/utils';
8
8
  import { FormattedMessage } from 'react-intl-next';
9
9
  import { messages } from '@atlaskit/media-ui/messages';
10
10
  export const blockCardResolvingViewClassName = 'block-card-resolving-view';
@@ -5,7 +5,7 @@ import { jsx } from '@emotion/core';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import { Frame } from '../components/Frame';
7
7
  import { Provider } from '../components/Provider';
8
- import { Byline } from '../components/Byline';
8
+ import { Byline } from '../../common/Byline';
9
9
  import { ActionList } from '../components/ActionList';
10
10
  import { Content } from '../components/Content';
11
11
  import { messages } from '@atlaskit/media-ui/messages';
@@ -2,7 +2,7 @@ import styled from '@emotion/styled';
2
2
  import { size as csssize, borderRadius, size, ellipsis } from '@atlaskit/media-ui';
3
3
  import { fontFamily } from '@atlaskit/theme/constants';
4
4
  import * as colors from '@atlaskit/theme/colors';
5
- import { gs as gridSize } from '../../BlockCard/utils';
5
+ import { gs as gridSize } from '../../common/utils';
6
6
  export const className = 'media-card-frame';
7
7
  export const cardShadow = ``;
8
8
 
@@ -7,7 +7,7 @@ import { R300 } from '@atlaskit/theme/colors';
7
7
  import { Frame } from '../../BlockCard/components/Frame';
8
8
  import { FormattedMessage } from 'react-intl-next';
9
9
  import { messages } from '@atlaskit/media-ui/messages';
10
- import { gs } from '../../BlockCard/utils';
10
+ import { gs } from '../../common/utils';
11
11
  export const EmbedCardErroredView = ({
12
12
  onRetry,
13
13
  isSelected = false,
@@ -6,7 +6,7 @@ import Button from '@atlaskit/button/custom-theme-button';
6
6
  import { fontSize } from '@atlaskit/theme/constants';
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { messages } from '@atlaskit/media-ui/messages';
9
- import { gs as gridSize } from '../../BlockCard/utils';
9
+ import { gs as gridSize } from '../../common/utils';
10
10
  export const EmbedCardUnresolvedView = ({
11
11
  image,
12
12
  title,
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import Tooltip from '@atlaskit/tooltip';
3
+ import { TitleBlock, SnippetBlock, FooterBlock } from '../FlexibleCard/components/blocks';
4
+ import { Card } from '../Card';
5
+ import { HoverCardContainer } from './styled';
6
+ export const HoverCard = ({
7
+ children,
8
+ url
9
+ }) => {
10
+ const cardComponent = /*#__PURE__*/React.createElement(Card, {
11
+ appearance: "block",
12
+ url: url
13
+ }, /*#__PURE__*/React.createElement(TitleBlock, null), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(FooterBlock, null));
14
+ return /*#__PURE__*/React.createElement(Tooltip, {
15
+ content: cardComponent,
16
+ component: HoverCardContainer,
17
+ testId: "hover-card",
18
+ tag: "span"
19
+ }, children);
20
+ };
@@ -0,0 +1,9 @@
1
+ import styled from '@emotion/styled';
2
+ import { TooltipPrimitive } from '@atlaskit/tooltip';
3
+ export const HoverCardContainer = styled(TooltipPrimitive)`
4
+ background: none;
5
+ border-width: 0;
6
+ box-sizing: content-box; /* do not set this to border-box or it will break the overflow handling */
7
+ max-width: 500px;
8
+ padding: 0;
9
+ `;
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ import { Frame } from '../Frame';
3
3
  import Lozenge from '@atlaskit/lozenge';
4
4
  import { IconAndTitleLayout } from '../IconAndTitleLayout';
5
5
  import { LozengeWrapper } from '../IconAndTitleLayout/styled';
6
+ import { HoverCard } from '../../../view/HoverCard/index';
6
7
  export class InlineCardResolvedView extends React.Component {
7
8
  renderLozenge() {
8
9
  const {
@@ -28,9 +29,10 @@ export class InlineCardResolvedView extends React.Component {
28
29
  link,
29
30
  testId = 'inline-card-resolved-view',
30
31
  titleTextColor,
31
- titlePrefix
32
+ titlePrefix,
33
+ showHoverPreview = false
32
34
  } = this.props;
33
- return /*#__PURE__*/React.createElement(Frame, {
35
+ const inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
34
36
  testId: testId,
35
37
  link: link,
36
38
  isSelected: isSelected,
@@ -41,6 +43,14 @@ export class InlineCardResolvedView extends React.Component {
41
43
  title: title,
42
44
  titleTextColor: titleTextColor
43
45
  }), this.renderLozenge());
46
+
47
+ if (showHoverPreview && link) {
48
+ return /*#__PURE__*/React.createElement(HoverCard, {
49
+ url: link
50
+ }, inlineCardResolvedView);
51
+ }
52
+
53
+ return inlineCardResolvedView;
44
54
  }
45
55
 
46
56
  }
@@ -19,7 +19,8 @@ export const InlineCard = ({
19
19
  renderers,
20
20
  onResolve,
21
21
  testId,
22
- inlinePreloaderStyle
22
+ inlinePreloaderStyle,
23
+ showHoverPreview
23
24
  }) => {
24
25
  var _details$meta;
25
26
 
@@ -52,6 +53,7 @@ export const InlineCard = ({
52
53
  }
53
54
 
54
55
  return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
56
+ showHoverPreview: showHoverPreview,
55
57
  link: url,
56
58
  isSelected: isSelected,
57
59
  onClick: handleFrameClick,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import { N300 } from '@atlaskit/theme/colors';
4
- import { gs, mq } from '../utils';
4
+ import { gs, mq } from './utils';
5
5
  export const Byline = ({
6
6
  text,
7
7
  children,
@@ -3,7 +3,7 @@ import { jsx } from '@emotion/core';
3
3
  import React from 'react';
4
4
  import ImageLoader from 'react-render-image';
5
5
  import LinkIcon from '@atlaskit/icon/glyph/link';
6
- import { gs } from '../utils';
6
+ import { gs } from './utils';
7
7
  export const blockCardIconImageClassName = 'block-card-icon-image';
8
8
  export const Icon = ({
9
9
  url,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import Tooltip from '@atlaskit/tooltip';
4
- import { gs } from '../utils';
4
+ import { gs } from './utils';
5
5
  import { N300 } from '@atlaskit/theme/colors';
6
6
  export const Metadata = ({
7
7
  text,
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  /** @jsx jsx */
4
4
  import { jsx } from '@emotion/core';
5
5
  import { Metadata } from './Metadata';
6
- import { gs } from '../utils';
6
+ import { gs } from './utils';
7
7
  export const metadataListClassName = 'smart-link-metadata-list';
8
8
  export const MetadataList = ({
9
9
  items,
@@ -17,7 +17,7 @@ https://atlassian.design/components/modal-dialog/examples#customizing-modal-dial
17
17
  import React, { useState } from 'react';
18
18
  import ModalDialog, { ModalTransition, ModalBody } from '@atlaskit/modal-dialog';
19
19
  import { Header } from './ModalHeader';
20
- import { getIframeSandboxAttribute } from '../../../utils';
20
+ import { getIframeSandboxAttribute } from '../../utils';
21
21
  const iframeStyles = {
22
22
  width: `100%`,
23
23
  height: 'calc(100vh - 248px)'
@@ -7,7 +7,7 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
7
7
  import Button from '@atlaskit/button/custom-theme-button';
8
8
  import { N100, N30A } from '@atlaskit/theme/colors';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
- import { gs } from '../utils';
10
+ import { gs } from './utils';
11
11
  import { Icon } from './Icon';
12
12
  import { MetadataList } from './MetadataList';
13
13
  import { Byline } from './Byline';
@@ -1,9 +1,9 @@
1
1
  export { contentFooterClassName } from './view/BlockCard/components/ContentFooter';
2
- export { metadataListClassName } from './view/BlockCard/components/MetadataList';
2
+ export { metadataListClassName } from './view/common/MetadataList';
3
3
  export { blockCardResolvingViewClassName } from './view/BlockCard/views/ResolvingView';
4
4
  export { blockCardResolvedViewClassName, blockCardResolvedViewByClassName } from './view/BlockCard/views/ResolvedView';
5
5
  export { blockCardForbiddenViewClassName, blockCardForbiddenViewLinkClassName } from './view/BlockCard/views/ForbiddenView';
6
- export { blockCardIconImageClassName } from './view/BlockCard/components/Icon';
6
+ export { blockCardIconImageClassName } from './view/common/Icon';
7
7
  export { blockCardContentClassName } from './view/BlockCard/components/Content';
8
8
  export { blockCardContentHeaderClassName } from './view/BlockCard/components/ContentHeader';
9
9
  export { blockCardContentHeaderNameClassName } from './view/BlockCard/components/Name';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.7.3",
3
+ "version": "17.7.6",
4
4
  "sideEffects": false
5
5
  }
@@ -55,7 +55,7 @@ function _previewFunction() {
55
55
  }
56
56
 
57
57
  _context.next = 5;
58
- return import('../components/Modal');
58
+ return import('../../common/Modal');
59
59
 
60
60
  case 5:
61
61
  Modal = _context.sent;
@@ -9,7 +9,7 @@ import Button from '@atlaskit/button/standard-button';
9
9
  import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
10
10
  import MoreIcon from '@atlaskit/icon/glyph/more';
11
11
  import { Action } from './Action';
12
- import { gs, mq } from '../utils';
12
+ import { gs, mq } from '../../common/utils';
13
13
  export var ActionList = function ActionList(_ref) {
14
14
  var items = _ref.items;
15
15
  var actionsToShow = items.slice(0, 2);
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import AvatarGroup from '@atlaskit/avatar-group';
4
- import { mq } from '../utils';
4
+ import { mq } from '../../common/utils';
5
5
  export var CollaboratorList = function CollaboratorList(_ref) {
6
6
  var items = _ref.items,
7
7
  _ref$handleAvatarClic = _ref.handleAvatarClick,
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
- import { gs, mq } from '../utils';
3
+ import { gs, mq } from '../../common/utils';
4
4
  export var blockCardContentClassName = 'block-card-content';
5
5
  export var Content = function Content(_ref) {
6
6
  var children = _ref.children,
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
- import { gs, mq } from '../utils';
3
+ import { gs, mq } from '../../common/utils';
4
4
  export var contentFooterClassName = 'smart-link-content-footer';
5
5
  export var ContentFooter = function ContentFooter(_ref) {
6
6
  var children = _ref.children,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import React from 'react';
4
- import { gs } from '../utils';
4
+ import { gs } from '../../common/utils';
5
5
  export var Emoji = function Emoji(_ref) {
6
6
  var emoji = _ref.emoji;
7
7
  return jsx("span", {
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
  import { jsx } from '@emotion/core';
9
9
  import React from 'react';
10
10
  import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
11
- import { gs, br, mq } from '../utils';
11
+ import { gs, br, mq } from '../../common/utils';
12
12
  export var Frame = function Frame() {
13
13
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
14
14
  isSelected: false,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import { fontSize } from '@atlaskit/theme/constants';
4
- import { gs } from '../utils';
4
+ import { gs } from '../../common/utils';
5
5
  export var blockCardContentHeaderNameClassName = 'block-card-content-header-name';
6
6
  export var Name = function Name(_ref) {
7
7
  var name = _ref.name,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import { N300 } from '@atlaskit/theme/colors';
4
- import { gs } from '../utils';
4
+ import { gs } from '../../common/utils';
5
5
  export var Provider = function Provider(_ref) {
6
6
  var name = _ref.name,
7
7
  icon = _ref.icon;
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
 
7
7
  /** @jsx jsx */
8
8
  import { jsx } from '@emotion/core';
9
- import { gs, mq } from '../utils';
9
+ import { gs, mq } from '../../common/utils';
10
10
  export var Thumbnail = function Thumbnail(props) {
11
11
  return props.color ? jsx(ThumbnailWithBackground, props) : jsx(ThumbnailDefault, props);
12
12
  };
@@ -11,7 +11,7 @@ import { useMemo } from 'react';
11
11
  import { R300 } from '@atlaskit/theme/colors';
12
12
  import WarningIcon from '@atlaskit/icon/glyph/warning';
13
13
  import { Frame } from '../components/Frame';
14
- import { Byline } from '../components/Byline';
14
+ import { Byline } from '../../common/Byline';
15
15
  import { ActionList } from '../components/ActionList';
16
16
  import { Content } from '../components/Content';
17
17
  import { messages } from '@atlaskit/media-ui/messages';
@@ -8,7 +8,7 @@ import { R300 } from '@atlaskit/theme/colors';
8
8
  import LockIcon from '@atlaskit/icon/glyph/lock-filled';
9
9
  import { Frame } from '../components/Frame';
10
10
  import { Provider } from '../components/Provider';
11
- import { Byline } from '../components/Byline';
11
+ import { Byline } from '../../common/Byline';
12
12
  import { ActionList } from '../components/ActionList';
13
13
  import { Content } from '../components/Content';
14
14
  import { messages } from '@atlaskit/media-ui/messages';
@@ -12,7 +12,7 @@ import { R300 } from '@atlaskit/theme/colors';
12
12
  import WarningIcon from '@atlaskit/icon/glyph/warning';
13
13
  import { Frame } from '../components/Frame';
14
14
  import { Provider } from '../components/Provider';
15
- import { Byline } from '../components/Byline';
15
+ import { Byline } from '../../common/Byline';
16
16
  import { Content } from '../components/Content';
17
17
  import { messages } from '@atlaskit/media-ui/messages';
18
18
  import { ContentFooter } from '../components/ContentFooter';
@@ -5,17 +5,17 @@ import { Frame } from '../components/Frame';
5
5
  import { Thumbnail } from '../components/Thumbnail';
6
6
  import { Provider } from '../components/Provider';
7
7
  import { Name } from '../components/Name';
8
- import { Byline } from '../components/Byline';
8
+ import { Byline } from '../../common/Byline';
9
9
  import { ActionList } from '../components/ActionList';
10
10
  import { CollaboratorList } from '../components/CollaboratorList';
11
11
  import { Emoji } from '../components/Emoji';
12
- import { Icon } from '../components/Icon';
12
+ import { Icon } from '../../common/Icon';
13
13
  import { Content } from '../components/Content';
14
- import { MetadataList } from '../components/MetadataList';
14
+ import { MetadataList } from '../../common/MetadataList';
15
15
  import { LozengeBlockWrapper } from '../../InlineCard/IconAndTitleLayout/styled';
16
16
  import { ContentHeader } from '../components/ContentHeader';
17
17
  import { ContentFooter } from '../components/ContentFooter';
18
- import { gs } from '../utils';
18
+ import { gs } from '../../common/utils';
19
19
  import { handleClickCommon } from '../utils/handlers';
20
20
  export var blockCardResolvedViewClassName = 'block-card-resolved-view';
21
21
  export var blockCardResolvedViewByClassName = 'block-card-resolved-view-by';
@@ -4,7 +4,7 @@ import DocumentFilledIcon from '@atlaskit/icon/glyph/document-filled';
4
4
  import { N50, N90 } from '@atlaskit/theme/colors';
5
5
  import { fontSize } from '@atlaskit/theme/constants';
6
6
  import { Frame } from '../components/Frame';
7
- import { gs } from '../utils';
7
+ import { gs } from '../../common/utils';
8
8
  import { FormattedMessage } from 'react-intl-next';
9
9
  import { messages } from '@atlaskit/media-ui/messages';
10
10
  export var blockCardResolvingViewClassName = 'block-card-resolving-view';
@@ -10,7 +10,7 @@ import { jsx } from '@emotion/core';
10
10
  import { FormattedMessage } from 'react-intl-next';
11
11
  import { Frame } from '../components/Frame';
12
12
  import { Provider } from '../components/Provider';
13
- import { Byline } from '../components/Byline';
13
+ import { Byline } from '../../common/Byline';
14
14
  import { ActionList } from '../components/ActionList';
15
15
  import { Content } from '../components/Content';
16
16
  import { messages } from '@atlaskit/media-ui/messages';
@@ -6,7 +6,7 @@ import styled from '@emotion/styled';
6
6
  import { size as csssize, borderRadius, size, ellipsis } from '@atlaskit/media-ui';
7
7
  import { fontFamily } from '@atlaskit/theme/constants';
8
8
  import * as colors from '@atlaskit/theme/colors';
9
- import { gs as gridSize } from '../../BlockCard/utils';
9
+ import { gs as gridSize } from '../../common/utils';
10
10
  export var className = 'media-card-frame';
11
11
  export var cardShadow = "";
12
12
 
@@ -7,7 +7,7 @@ import { R300 } from '@atlaskit/theme/colors';
7
7
  import { Frame } from '../../BlockCard/components/Frame';
8
8
  import { FormattedMessage } from 'react-intl-next';
9
9
  import { messages } from '@atlaskit/media-ui/messages';
10
- import { gs } from '../../BlockCard/utils';
10
+ import { gs } from '../../common/utils';
11
11
  export var EmbedCardErroredView = function EmbedCardErroredView(_ref) {
12
12
  var onRetry = _ref.onRetry,
13
13
  _ref$isSelected = _ref.isSelected,
@@ -6,7 +6,7 @@ import Button from '@atlaskit/button/custom-theme-button';
6
6
  import { fontSize } from '@atlaskit/theme/constants';
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { messages } from '@atlaskit/media-ui/messages';
9
- import { gs as gridSize } from '../../BlockCard/utils';
9
+ import { gs as gridSize } from '../../common/utils';
10
10
  export var EmbedCardUnresolvedView = function EmbedCardUnresolvedView(_ref) {
11
11
  var image = _ref.image,
12
12
  title = _ref.title,
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import Tooltip from '@atlaskit/tooltip';
3
+ import { TitleBlock, SnippetBlock, FooterBlock } from '../FlexibleCard/components/blocks';
4
+ import { Card } from '../Card';
5
+ import { HoverCardContainer } from './styled';
6
+ export var HoverCard = function HoverCard(_ref) {
7
+ var children = _ref.children,
8
+ url = _ref.url;
9
+ var cardComponent = /*#__PURE__*/React.createElement(Card, {
10
+ appearance: "block",
11
+ url: url
12
+ }, /*#__PURE__*/React.createElement(TitleBlock, null), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(FooterBlock, null));
13
+ return /*#__PURE__*/React.createElement(Tooltip, {
14
+ content: cardComponent,
15
+ component: HoverCardContainer,
16
+ testId: "hover-card",
17
+ tag: "span"
18
+ }, children);
19
+ };
@@ -0,0 +1,7 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ import styled from '@emotion/styled';
6
+ import { TooltipPrimitive } from '@atlaskit/tooltip';
7
+ export var HoverCardContainer = styled(TooltipPrimitive)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: content-box; /* do not set this to border-box or it will break the overflow handling */\n max-width: 500px;\n padding: 0;\n"])));
@@ -0,0 +1 @@
1
+ export {};
@@ -13,6 +13,7 @@ import { Frame } from '../Frame';
13
13
  import Lozenge from '@atlaskit/lozenge';
14
14
  import { IconAndTitleLayout } from '../IconAndTitleLayout';
15
15
  import { LozengeWrapper } from '../IconAndTitleLayout/styled';
16
+ import { HoverCard } from '../../../view/HoverCard/index';
16
17
  export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
17
18
  _inherits(InlineCardResolvedView, _React$Component);
18
19
 
@@ -51,8 +52,10 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
51
52
  _this$props$testId = _this$props.testId,
52
53
  testId = _this$props$testId === void 0 ? 'inline-card-resolved-view' : _this$props$testId,
53
54
  titleTextColor = _this$props.titleTextColor,
54
- titlePrefix = _this$props.titlePrefix;
55
- return /*#__PURE__*/React.createElement(Frame, {
55
+ titlePrefix = _this$props.titlePrefix,
56
+ _this$props$showHover = _this$props.showHoverPreview,
57
+ showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover;
58
+ var inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
56
59
  testId: testId,
57
60
  link: link,
58
61
  isSelected: isSelected,
@@ -63,6 +66,14 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
63
66
  title: title,
64
67
  titleTextColor: titleTextColor
65
68
  }), this.renderLozenge());
69
+
70
+ if (showHoverPreview && link) {
71
+ return /*#__PURE__*/React.createElement(HoverCard, {
72
+ url: link
73
+ }, inlineCardResolvedView);
74
+ }
75
+
76
+ return inlineCardResolvedView;
66
77
  }
67
78
  }]);
68
79
 
@@ -21,7 +21,8 @@ export var InlineCard = function InlineCard(_ref) {
21
21
  renderers = _ref.renderers,
22
22
  onResolve = _ref.onResolve,
23
23
  testId = _ref.testId,
24
- inlinePreloaderStyle = _ref.inlinePreloaderStyle;
24
+ inlinePreloaderStyle = _ref.inlinePreloaderStyle,
25
+ showHoverPreview = _ref.showHoverPreview;
25
26
  var status = cardState.status,
26
27
  details = cardState.details;
27
28
  var cardDetails = details && details.data || getEmptyJsonLd();
@@ -49,6 +50,7 @@ export var InlineCard = function InlineCard(_ref) {
49
50
  }
50
51
 
51
52
  return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
53
+ showHoverPreview: showHoverPreview,
52
54
  link: url,
53
55
  isSelected: isSelected,
54
56
  onClick: handleFrameClick,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import { N300 } from '@atlaskit/theme/colors';
4
- import { gs, mq } from '../utils';
4
+ import { gs, mq } from './utils';
5
5
  export var Byline = function Byline(_ref) {
6
6
  var text = _ref.text,
7
7
  children = _ref.children,
@@ -3,7 +3,7 @@ import { jsx } from '@emotion/core';
3
3
  import React from 'react';
4
4
  import ImageLoader from 'react-render-image';
5
5
  import LinkIcon from '@atlaskit/icon/glyph/link';
6
- import { gs } from '../utils';
6
+ import { gs } from './utils';
7
7
  export var blockCardIconImageClassName = 'block-card-icon-image';
8
8
  export var Icon = function Icon(_ref) {
9
9
  var url = _ref.url,
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/core';
3
3
  import Tooltip from '@atlaskit/tooltip';
4
- import { gs } from '../utils';
4
+ import { gs } from './utils';
5
5
  import { N300 } from '@atlaskit/theme/colors';
6
6
  export var Metadata = function Metadata(_ref) {
7
7
  var text = _ref.text,
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  /** @jsx jsx */
4
4
  import { jsx } from '@emotion/core';
5
5
  import { Metadata } from './Metadata';
6
- import { gs } from '../utils';
6
+ import { gs } from './utils';
7
7
  export var metadataListClassName = 'smart-link-metadata-list';
8
8
  export var MetadataList = function MetadataList(_ref) {
9
9
  var items = _ref.items,
@@ -28,7 +28,7 @@ https://atlassian.design/components/modal-dialog/examples#customizing-modal-dial
28
28
  import React, { useState } from 'react';
29
29
  import ModalDialog, { ModalTransition, ModalBody } from '@atlaskit/modal-dialog';
30
30
  import { Header } from './ModalHeader';
31
- import { getIframeSandboxAttribute } from '../../../utils';
31
+ import { getIframeSandboxAttribute } from '../../utils';
32
32
  var iframeStyles = {
33
33
  width: "100%",
34
34
  height: 'calc(100vh - 248px)'
@@ -7,7 +7,7 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
7
7
  import Button from '@atlaskit/button/custom-theme-button';
8
8
  import { N100, N30A } from '@atlaskit/theme/colors';
9
9
  import { FormattedMessage } from 'react-intl-next';
10
- import { gs } from '../utils';
10
+ import { gs } from './utils';
11
11
  import { Icon } from './Icon';
12
12
  import { MetadataList } from './MetadataList';
13
13
  import { Byline } from './Byline';
@@ -1,9 +1,9 @@
1
1
  export { contentFooterClassName } from './view/BlockCard/components/ContentFooter';
2
- export { metadataListClassName } from './view/BlockCard/components/MetadataList';
2
+ export { metadataListClassName } from './view/common/MetadataList';
3
3
  export { blockCardResolvingViewClassName } from './view/BlockCard/views/ResolvingView';
4
4
  export { blockCardResolvedViewClassName, blockCardResolvedViewByClassName, } from './view/BlockCard/views/ResolvedView';
5
5
  export { blockCardForbiddenViewClassName, blockCardForbiddenViewLinkClassName, } from './view/BlockCard/views/ForbiddenView';
6
- export { blockCardIconImageClassName } from './view/BlockCard/components/Icon';
6
+ export { blockCardIconImageClassName } from './view/common/Icon';
7
7
  export { blockCardContentClassName } from './view/BlockCard/components/Content';
8
8
  export { blockCardContentHeaderClassName } from './view/BlockCard/components/ContentHeader';
9
9
  export { blockCardContentHeaderNameClassName } from './view/BlockCard/components/Name';
@@ -1,8 +1,8 @@
1
1
  import React, { ErrorInfo } from 'react';
2
- import { ModalProps } from '../components/Modal';
2
+ import { ModalProps } from '../../common/Modal';
3
3
  import { ActionProps } from '../components/Action';
4
- import { IconProps } from '../components/Icon';
5
- import { MetadataProps } from '../components/Metadata';
4
+ import { IconProps } from '../../common/Icon';
5
+ import { MetadataProps } from '../../common/Metadata';
6
6
  export interface PreviewFunctionArg extends ModalProps {
7
7
  popupMountPointId: string;
8
8
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ActionProps } from '../components/Action';
3
- import { IconProps } from '../components/Icon';
3
+ import { IconProps } from '../../common/Icon';
4
4
  import { RequestAccessContextProps } from '../../types';
5
5
  export interface PermissionDeniedProps {
6
6
  actions?: Array<ActionProps>;