@atlaskit/smart-card 17.7.2 → 17.7.5
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.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/classNames.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +1 -1
- package/dist/cjs/view/BlockCard/components/ActionList.js +1 -1
- package/dist/cjs/view/BlockCard/components/CollaboratorList.js +1 -1
- package/dist/cjs/view/BlockCard/components/Content.js +1 -1
- package/dist/cjs/view/BlockCard/components/ContentFooter.js +1 -1
- package/dist/cjs/view/BlockCard/components/Emoji.js +1 -1
- package/dist/cjs/view/BlockCard/components/Frame.js +1 -1
- package/dist/cjs/view/BlockCard/components/Name.js +1 -1
- package/dist/cjs/view/BlockCard/components/Provider.js +1 -1
- package/dist/cjs/view/BlockCard/components/Thumbnail.js +1 -1
- package/dist/cjs/view/BlockCard/views/ErroredView.js +1 -1
- package/dist/cjs/view/BlockCard/views/ForbiddenView.js +1 -1
- package/dist/cjs/view/BlockCard/views/NotFoundView.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +4 -4
- package/dist/cjs/view/BlockCard/views/ResolvingView.js +1 -1
- package/dist/cjs/view/BlockCard/views/UnauthorizedView.js +1 -1
- package/dist/cjs/view/EmbedCard/components/styled.js +1 -1
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +15 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +40 -11
- package/dist/cjs/view/HoverCard/index.js +37 -0
- package/dist/cjs/view/HoverCard/styled.js +19 -0
- package/dist/cjs/view/HoverCard/types.js +5 -0
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +15 -2
- package/dist/cjs/view/InlineCard/index.js +3 -1
- package/dist/cjs/view/{BlockCard/components → common}/Byline.js +1 -1
- package/dist/cjs/view/{BlockCard/components → common}/Icon.js +1 -1
- package/dist/cjs/view/{BlockCard/components → common}/Metadata.js +1 -1
- package/dist/cjs/view/{BlockCard/components → common}/MetadataList.js +1 -1
- package/dist/cjs/view/{BlockCard/components → common}/Modal.js +1 -1
- package/dist/cjs/view/{BlockCard/components → common}/ModalHeader.js +1 -1
- package/dist/cjs/view/{BlockCard/utils/index.js → common/utils.js} +0 -0
- package/dist/es2019/classNames.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/PreviewAction.js +1 -1
- package/dist/es2019/view/BlockCard/components/ActionList.js +1 -1
- package/dist/es2019/view/BlockCard/components/CollaboratorList.js +1 -1
- package/dist/es2019/view/BlockCard/components/Content.js +1 -1
- package/dist/es2019/view/BlockCard/components/ContentFooter.js +1 -1
- package/dist/es2019/view/BlockCard/components/Emoji.js +1 -1
- package/dist/es2019/view/BlockCard/components/Frame.js +1 -1
- package/dist/es2019/view/BlockCard/components/Name.js +1 -1
- package/dist/es2019/view/BlockCard/components/Provider.js +1 -1
- package/dist/es2019/view/BlockCard/components/Thumbnail.js +1 -1
- package/dist/es2019/view/BlockCard/views/ErroredView.js +1 -1
- package/dist/es2019/view/BlockCard/views/ForbiddenView.js +1 -1
- package/dist/es2019/view/BlockCard/views/NotFoundView.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +4 -4
- package/dist/es2019/view/BlockCard/views/ResolvingView.js +1 -1
- package/dist/es2019/view/BlockCard/views/UnauthorizedView.js +1 -1
- package/dist/es2019/view/EmbedCard/components/styled.js +1 -1
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +10 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +30 -10
- package/dist/es2019/view/HoverCard/index.js +20 -0
- package/dist/es2019/view/HoverCard/styled.js +9 -0
- package/dist/es2019/view/HoverCard/types.js +1 -0
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +12 -2
- package/dist/es2019/view/InlineCard/index.js +3 -1
- package/dist/es2019/view/{BlockCard/components → common}/Byline.js +1 -1
- package/dist/es2019/view/{BlockCard/components → common}/Icon.js +1 -1
- package/dist/es2019/view/{BlockCard/components → common}/Metadata.js +1 -1
- package/dist/es2019/view/{BlockCard/components → common}/MetadataList.js +1 -1
- package/dist/es2019/view/{BlockCard/components → common}/Modal.js +1 -1
- package/dist/es2019/view/{BlockCard/components → common}/ModalHeader.js +1 -1
- package/dist/es2019/view/{BlockCard/utils/index.js → common/utils.js} +0 -0
- package/dist/esm/classNames.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +1 -1
- package/dist/esm/view/BlockCard/components/ActionList.js +1 -1
- package/dist/esm/view/BlockCard/components/CollaboratorList.js +1 -1
- package/dist/esm/view/BlockCard/components/Content.js +1 -1
- package/dist/esm/view/BlockCard/components/ContentFooter.js +1 -1
- package/dist/esm/view/BlockCard/components/Emoji.js +1 -1
- package/dist/esm/view/BlockCard/components/Frame.js +1 -1
- package/dist/esm/view/BlockCard/components/Name.js +1 -1
- package/dist/esm/view/BlockCard/components/Provider.js +1 -1
- package/dist/esm/view/BlockCard/components/Thumbnail.js +1 -1
- package/dist/esm/view/BlockCard/views/ErroredView.js +1 -1
- package/dist/esm/view/BlockCard/views/ForbiddenView.js +1 -1
- package/dist/esm/view/BlockCard/views/NotFoundView.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +4 -4
- package/dist/esm/view/BlockCard/views/ResolvingView.js +1 -1
- package/dist/esm/view/BlockCard/views/UnauthorizedView.js +1 -1
- package/dist/esm/view/EmbedCard/components/styled.js +1 -1
- package/dist/esm/view/EmbedCard/views/ErroredView.js +1 -1
- package/dist/esm/view/EmbedCard/views/UnresolvedView.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +15 -7
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +31 -11
- package/dist/esm/view/HoverCard/index.js +19 -0
- package/dist/esm/view/HoverCard/styled.js +7 -0
- package/dist/esm/view/HoverCard/types.js +1 -0
- package/dist/esm/view/InlineCard/ResolvedView/index.js +13 -2
- package/dist/esm/view/InlineCard/index.js +3 -1
- package/dist/esm/view/{BlockCard/components → common}/Byline.js +1 -1
- package/dist/esm/view/{BlockCard/components → common}/Icon.js +1 -1
- package/dist/esm/view/{BlockCard/components → common}/Metadata.js +1 -1
- package/dist/esm/view/{BlockCard/components → common}/MetadataList.js +1 -1
- package/dist/esm/view/{BlockCard/components → common}/Modal.js +1 -1
- package/dist/esm/view/{BlockCard/components → common}/ModalHeader.js +1 -1
- package/dist/esm/view/{BlockCard/utils/index.js → common/utils.js} +0 -0
- package/dist/types/classNames.d.ts +2 -2
- package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +3 -3
- package/dist/types/view/BlockCard/views/ForbiddenView.d.ts +1 -1
- package/dist/types/view/BlockCard/views/NotFoundView.d.ts +1 -1
- package/dist/types/view/BlockCard/views/ResolvedView.d.ts +2 -2
- package/dist/types/view/BlockCard/views/UnauthorizedView.d.ts +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/action-group/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +2 -0
- package/dist/types/view/HoverCard/index.d.ts +3 -0
- package/dist/types/view/HoverCard/styled.d.ts +2 -0
- package/dist/types/view/HoverCard/types.d.ts +3 -0
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/types.d.ts +1 -0
- package/dist/types/view/{BlockCard/components → common}/Byline.d.ts +0 -0
- package/dist/types/view/{BlockCard/components → common}/Icon.d.ts +0 -0
- package/dist/types/view/{BlockCard/components → common}/Metadata.d.ts +0 -0
- package/dist/types/view/{BlockCard/components → common}/MetadataList.d.ts +0 -0
- package/dist/types/view/{BlockCard/components → common}/Modal.d.ts +0 -0
- package/dist/types/view/{BlockCard/components → common}/ModalHeader.d.ts +0 -0
- package/dist/types/view/{BlockCard/utils/index.d.ts → common/utils.d.ts} +0 -0
- package/package.json +1 -1
|
@@ -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 '
|
|
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 '
|
|
12
|
+
import { Icon } from '../../common/Icon';
|
|
13
13
|
import { Content } from '../components/Content';
|
|
14
|
-
import { MetadataList } from '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '../../
|
|
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 '../../
|
|
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 '../../
|
|
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,
|
|
@@ -21,19 +21,27 @@ var ActionGroup = function ActionGroup(_ref) {
|
|
|
21
21
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
22
22
|
_ref$size = _ref.size,
|
|
23
23
|
size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
|
|
24
|
-
appearance = _ref.appearance
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
appearance = _ref.appearance,
|
|
25
|
+
_ref$visibleButtonsNu = _ref.visibleButtonsNum,
|
|
26
|
+
visibleButtonsNum = _ref$visibleButtonsNu === void 0 ? 2 : _ref$visibleButtonsNu,
|
|
27
|
+
onDropdownOpenChange = _ref.onDropdownOpenChange;
|
|
28
|
+
var isMoreThenTwoItems = items.length > visibleButtonsNum;
|
|
29
|
+
var firstActions = isMoreThenTwoItems ? items.slice(0, visibleButtonsNum - 1) : items;
|
|
30
|
+
var restActions = isMoreThenTwoItems ? items.slice(visibleButtonsNum - 1) : [];
|
|
28
31
|
return jsx("div", {
|
|
29
32
|
css: styles
|
|
30
33
|
}, jsx(ButtonGroup, null, renderActionItems(firstActions, size, appearance), restActions.length > 0 ? jsx(DropdownMenu, {
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
+
onOpenChange: function onOpenChange(_ref2) {
|
|
35
|
+
var isOpen = _ref2.isOpen;
|
|
36
|
+
return onDropdownOpenChange && onDropdownOpenChange(isOpen);
|
|
37
|
+
},
|
|
38
|
+
trigger: function trigger(_ref3) {
|
|
39
|
+
var triggerRef = _ref3.triggerRef,
|
|
40
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
34
41
|
|
|
35
42
|
return jsx(Button, _extends({}, props, {
|
|
36
43
|
spacing: sizeToSpacing[size],
|
|
44
|
+
className: "action-group-more-button",
|
|
37
45
|
testId: "action-group-more-button",
|
|
38
46
|
iconBefore: jsx(MoreIcon, {
|
|
39
47
|
label: "more"
|
|
@@ -19,9 +19,10 @@ var Block = function Block(_ref) {
|
|
|
19
19
|
_ref$size = _ref.size,
|
|
20
20
|
size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
|
|
21
21
|
_ref$testId = _ref.testId,
|
|
22
|
-
testId = _ref$testId === void 0 ? 'smart-block' : _ref$testId
|
|
22
|
+
testId = _ref$testId === void 0 ? 'smart-block' : _ref$testId,
|
|
23
|
+
extraCss = _ref.extraCss;
|
|
23
24
|
return jsx("div", {
|
|
24
|
-
css: getBlockStyles(direction, size),
|
|
25
|
+
css: [getBlockStyles(direction, size), extraCss],
|
|
25
26
|
"data-smart-block": true,
|
|
26
27
|
"data-testid": testId
|
|
27
28
|
}, renderChildren(children, size));
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
|
+
var _excluded = ["maxLines", "metadata", "position", "subtitle", "actions", "testId", "theme", "text", "showActionOnHover"];
|
|
6
|
+
|
|
7
|
+
var _templateObject;
|
|
8
|
+
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import { css, jsx } from '@emotion/core';
|
|
5
12
|
import { LinkIcon, Title } from '../../../elements';
|
|
6
13
|
import Block from '../../block';
|
|
7
14
|
import ElementGroup from '../../element-group';
|
|
8
15
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkWidth } from '../../../../../../constants';
|
|
9
16
|
import { renderElementItems } from '../../utils';
|
|
10
17
|
import ActionGroup from '../../action-group';
|
|
18
|
+
var actionOnHoverOnlyStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .action-group-more-button {\n visibility: hidden;\n }\n\n &:hover {\n .action-group-more-button {\n visibility: visible;\n }\n }\n"])));
|
|
11
19
|
|
|
12
20
|
var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
13
21
|
var maxLines = _ref.maxLines,
|
|
@@ -21,30 +29,42 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
21
29
|
testId = _ref.testId,
|
|
22
30
|
theme = _ref.theme,
|
|
23
31
|
text = _ref.text,
|
|
32
|
+
showActionOnHover = _ref.showActionOnHover,
|
|
24
33
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
34
|
|
|
35
|
+
var _useState = useState(false),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
actionDropdownOpen = _useState2[0],
|
|
38
|
+
setActionDropdownOpen = _useState2[1];
|
|
39
|
+
|
|
26
40
|
var metadataElements = renderElementItems(metadata);
|
|
27
41
|
var subtitleElements = renderElementItems(subtitle);
|
|
28
42
|
var overrideText = !!text ? {
|
|
29
43
|
text: text
|
|
30
44
|
} : {};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
var extraCss = showActionOnHover && !actionDropdownOpen ? actionOnHoverOnlyStyle : undefined;
|
|
46
|
+
return jsx(Block, _extends({}, blockProps, {
|
|
47
|
+
testId: "".concat(testId, "-resolved-view"),
|
|
48
|
+
extraCss: extraCss
|
|
49
|
+
}), jsx(LinkIcon, {
|
|
34
50
|
position: position
|
|
35
|
-
}),
|
|
51
|
+
}), jsx(ElementGroup, {
|
|
36
52
|
direction: SmartLinkDirection.Vertical,
|
|
37
53
|
width: SmartLinkWidth.Flexible
|
|
38
|
-
},
|
|
54
|
+
}, jsx(Title, _extends({
|
|
39
55
|
maxLines: maxLines,
|
|
40
56
|
theme: theme
|
|
41
|
-
}, overrideText)), subtitleElements &&
|
|
57
|
+
}, overrideText)), subtitleElements && jsx(ElementGroup, {
|
|
42
58
|
direction: SmartLinkDirection.Horizontal
|
|
43
|
-
}, subtitleElements)), metadataElements &&
|
|
59
|
+
}, subtitleElements)), metadataElements && jsx(ElementGroup, {
|
|
44
60
|
direction: SmartLinkDirection.Horizontal,
|
|
45
61
|
align: SmartLinkAlignment.Right
|
|
46
|
-
}, metadataElements), actions.length > 0 &&
|
|
47
|
-
items: actions
|
|
62
|
+
}, metadataElements), actions.length > 0 && jsx(ActionGroup, {
|
|
63
|
+
items: actions,
|
|
64
|
+
visibleButtonsNum: showActionOnHover ? 1 : 2,
|
|
65
|
+
onDropdownOpenChange: function onDropdownOpenChange(isOpen) {
|
|
66
|
+
return setActionDropdownOpen(isOpen);
|
|
67
|
+
}
|
|
48
68
|
}));
|
|
49
69
|
};
|
|
50
70
|
|
|
@@ -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
|
-
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
10
|
+
import { gs } from './utils';
|
|
11
11
|
import { Icon } from './Icon';
|
|
12
12
|
import { MetadataList } from './MetadataList';
|
|
13
13
|
import { Byline } from './Byline';
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { contentFooterClassName } from './view/BlockCard/components/ContentFooter';
|
|
2
|
-
export { metadataListClassName } from './view/
|
|
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/
|
|
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 '
|
|
2
|
+
import { ModalProps } from '../../common/Modal';
|
|
3
3
|
import { ActionProps } from '../components/Action';
|
|
4
|
-
import { IconProps } from '
|
|
5
|
-
import { MetadataProps } from '
|
|
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 '
|
|
3
|
+
import { IconProps } from '../../common/Icon';
|
|
4
4
|
import { RequestAccessContextProps } from '../../types';
|
|
5
5
|
export interface PermissionDeniedProps {
|
|
6
6
|
actions?: Array<ActionProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AvatarClickEventHandler } from '@atlaskit/avatar';
|
|
3
3
|
import { Collaborator } from '../components/CollaboratorList';
|
|
4
|
-
import { IconProps } from '
|
|
4
|
+
import { IconProps } from '../../common/Icon';
|
|
5
5
|
import { ActionProps } from '../components/Action';
|
|
6
|
-
import { MetadataProps } from '
|
|
6
|
+
import { MetadataProps } from '../../common/Metadata';
|
|
7
7
|
import { ContextViewModel } from '../../types';
|
|
8
8
|
import { LozengeProps } from '../../../types';
|
|
9
9
|
export interface ResolvedViewProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardAppearance, CardPlatform, CardProps } from './types';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Pick<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "onClick" | "url" | "
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Pick<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "onClick" | "url" | "forwardedRef" | "platform" | "isFrameVisible" | "importer" | "container" | "showActions" | "onResolve" | "embedIframeRef" | "inlinePreloaderStyle" | "ui"> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "onClick" | "analyticsContext" | "key" | "url" | "forwardedRef" | "platform" | "isFrameVisible" | "importer" | "container" | "showActions" | "onResolve" | "embedIframeRef" | "inlinePreloaderStyle" | "ui"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ActionName, ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkStatus } from '../../../../constants';
|
|
2
|
+
import { SerializedStyles } from '@emotion/core';
|
|
2
3
|
import { ActionProps } from '../actions/action/types';
|
|
3
4
|
export declare type BlockProps = {
|
|
4
5
|
direction?: SmartLinkDirection;
|
|
5
6
|
size?: SmartLinkSize;
|
|
6
7
|
status?: SmartLinkStatus;
|
|
7
8
|
testId?: string;
|
|
9
|
+
extraCss?: SerializedStyles;
|
|
8
10
|
};
|
|
9
11
|
export declare type ElementItem = {
|
|
10
12
|
name: ElementName;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const HoverCardContainer: import("@emotion/styled-base").StyledComponent<Pick<import("@atlaskit/tooltip").TooltipPrimitiveProps, "children" | "style" | "testId" | "className" | "id" | "onMouseOut" | "onMouseOver" | "placement" | "truncate"> & import("react").RefAttributes<HTMLDivElement> & import("react").Attributes, Pick<Pick<import("@atlaskit/tooltip").TooltipPrimitiveProps, "children" | "style" | "testId" | "className" | "id" | "onMouseOut" | "onMouseOver" | "placement" | "truncate"> & import("react").RefAttributes<HTMLDivElement> & import("react").Attributes, "children" | "style" | "testId" | "className" | "id" | "onMouseOut" | "onMouseOver" | "placement" | "truncate">, any>;
|
|
@@ -19,6 +19,8 @@ export interface InlineCardResolvedViewProps {
|
|
|
19
19
|
titleTextColor?: string;
|
|
20
20
|
/** The Emoji icon prefix that was added to the title text via Add emoji button */
|
|
21
21
|
titlePrefix?: React.ReactNode;
|
|
22
|
+
/** Enables showing a custom preview on hover of link */
|
|
23
|
+
showHoverPreview?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare class InlineCardResolvedView extends React.Component<InlineCardResolvedViewProps> {
|
|
24
26
|
renderLozenge(): JSX.Element | null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|