@atlaskit/smart-card 26.3.9 → 26.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +0 -4
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +2 -1
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +4 -1
- package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -5
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +4 -0
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +5 -2
- package/dist/esm/utils/analytics/LinkAnalyticsContext.js +0 -4
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +2 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +5 -2
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +5 -0
- package/package.json +1 -1
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2b7f0f3b158`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b7f0f3b158) - [ux] Fix issue with metadata alignment of Title Block component in Confluence Web links.
|
|
8
|
+
|
|
9
|
+
## 26.3.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`d8263ae659f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8263ae659f) - [ux] Small css fix for avatar alignment in smart links
|
|
14
|
+
- [`438b90799c4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/438b90799c4) - Removes urlHash from linking platform events.
|
|
15
|
+
|
|
3
16
|
## 26.3.9
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.LinkAnalyticsContext = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
10
|
-
var _resolvedAttributes = require("@atlaskit/link-analytics/resolved-attributes");
|
|
11
10
|
/**
|
|
12
11
|
* Provides an analytics context to supply attributes to events based on a URL
|
|
13
12
|
*/
|
|
@@ -18,15 +17,12 @@ var LinkAnalyticsContext = function LinkAnalyticsContext(_ref) {
|
|
|
18
17
|
id = _ref.id,
|
|
19
18
|
children = _ref.children,
|
|
20
19
|
source = _ref.source;
|
|
21
|
-
var _getUrlAttributes = (0, _resolvedAttributes.getUrlAttributes)(url),
|
|
22
|
-
urlHash = _getUrlAttributes.urlHash;
|
|
23
20
|
var displayCategory = display === 'url' ? 'link' : undefined;
|
|
24
21
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
25
22
|
data: {
|
|
26
23
|
source: source,
|
|
27
24
|
attributes: {
|
|
28
25
|
displayCategory: displayCategory,
|
|
29
|
-
urlHash: urlHash,
|
|
30
26
|
display: display,
|
|
31
27
|
id: id
|
|
32
28
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -93,7 +93,8 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
93
93
|
hideRetry: true,
|
|
94
94
|
subtitle: [{
|
|
95
95
|
name: _constants.ElementName.Location
|
|
96
|
-
}]
|
|
96
|
+
}],
|
|
97
|
+
metadataPosition: _constants.SmartLinkPosition.Top
|
|
97
98
|
}), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
98
99
|
primary: metadata,
|
|
99
100
|
maxLines: 1
|
|
@@ -19,7 +19,7 @@ var _errored = _interopRequireDefault(require("./errored"));
|
|
|
19
19
|
var _resolving = _interopRequireDefault(require("./resolving"));
|
|
20
20
|
var _actionGroup = _interopRequireDefault(require("../action-group"));
|
|
21
21
|
var _elements = require("../../elements");
|
|
22
|
-
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry"];
|
|
22
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry", "metadataPosition"];
|
|
23
23
|
var _templateObject, _templateObject2;
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -74,6 +74,7 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
74
74
|
text = _ref.text,
|
|
75
75
|
theme = _ref.theme,
|
|
76
76
|
hideRetry = _ref.hideRetry,
|
|
77
|
+
metadataPosition = _ref.metadataPosition,
|
|
77
78
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
78
79
|
if (hideRetry && props.retry) {
|
|
79
80
|
delete props.retry;
|
|
@@ -114,7 +115,8 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
114
115
|
actionGroup: actionGroup,
|
|
115
116
|
overrideCss: combinedCss,
|
|
116
117
|
testId: testId,
|
|
117
|
-
title: title
|
|
118
|
+
title: title,
|
|
119
|
+
metadataPosition: metadataPosition
|
|
118
120
|
}));
|
|
119
121
|
};
|
|
120
122
|
var _default = TitleBlock;
|
|
@@ -16,7 +16,7 @@ var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
|
16
16
|
var _constants = require("../../../../../../constants");
|
|
17
17
|
var _utils = require("../../utils");
|
|
18
18
|
var _templateObject;
|
|
19
|
-
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title"];
|
|
19
|
+
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title", "metadataPosition"];
|
|
20
20
|
/**
|
|
21
21
|
* This renders a fully resolved TitleBlock.
|
|
22
22
|
* This should render when a Smart Link returns a valid response.
|
|
@@ -32,6 +32,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
32
32
|
testId = _ref.testId,
|
|
33
33
|
text = _ref.text,
|
|
34
34
|
title = _ref.title,
|
|
35
|
+
metadataPosition = _ref.metadataPosition,
|
|
35
36
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
36
37
|
var metadataElements = (0, _utils.renderElementItems)(metadata);
|
|
37
38
|
var subtitleElements = (0, _utils.renderElementItems)(subtitle);
|
|
@@ -48,7 +49,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
48
49
|
}, subtitleElements)), metadataElements && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
49
50
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
50
51
|
align: _constants.SmartLinkAlignment.Right,
|
|
51
|
-
position: _constants.SmartLinkPosition.
|
|
52
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : _constants.SmartLinkPosition.Center
|
|
52
53
|
}, metadataElements), actionGroup);
|
|
53
54
|
};
|
|
54
55
|
var _default = TitleBlockResolvedView;
|
|
@@ -14,7 +14,8 @@ var _templateObject, _templateObject2;
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
var MAX_COUNT = 4;
|
|
16
16
|
var getStyles = function getStyles(size) {
|
|
17
|
-
|
|
17
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
18
|
+
var styles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n ul {\n margin-right: 8px;\n }\n "])));
|
|
18
19
|
switch (size) {
|
|
19
20
|
case _constants.SmartLinkSize.XLarge:
|
|
20
21
|
case _constants.SmartLinkSize.Large:
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.toFooterActions = exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
@@ -106,7 +107,9 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
106
107
|
data: data,
|
|
107
108
|
snippetHeight: snippetHeight.current
|
|
108
109
|
});
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, flexibleCardProps, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock,
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_FlexibleCard.default, flexibleCardProps, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, titleBlockProps, {
|
|
111
|
+
metadataPosition: _constants.SmartLinkPosition.Top
|
|
112
|
+
})), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
110
113
|
primary: primary,
|
|
111
114
|
secondary: secondary,
|
|
112
115
|
size: _constants.SmartLinkSize.Large,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
-
import { getUrlAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
4
3
|
/**
|
|
5
4
|
* Provides an analytics context to supply attributes to events based on a URL
|
|
6
5
|
*/
|
|
@@ -11,16 +10,12 @@ export const LinkAnalyticsContext = ({
|
|
|
11
10
|
children,
|
|
12
11
|
source
|
|
13
12
|
}) => {
|
|
14
|
-
const {
|
|
15
|
-
urlHash
|
|
16
|
-
} = getUrlAttributes(url);
|
|
17
13
|
const displayCategory = display === 'url' ? 'link' : undefined;
|
|
18
14
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
19
15
|
data: {
|
|
20
16
|
source,
|
|
21
17
|
attributes: {
|
|
22
18
|
displayCategory,
|
|
23
|
-
urlHash,
|
|
24
19
|
display,
|
|
25
20
|
id
|
|
26
21
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -65,6 +65,7 @@ const TitleBlock = ({
|
|
|
65
65
|
text,
|
|
66
66
|
theme,
|
|
67
67
|
hideRetry,
|
|
68
|
+
metadataPosition,
|
|
68
69
|
...props
|
|
69
70
|
}) => {
|
|
70
71
|
if (hideRetry && props.retry) {
|
|
@@ -105,7 +106,8 @@ const TitleBlock = ({
|
|
|
105
106
|
actionGroup: actionGroup,
|
|
106
107
|
overrideCss: combinedCss,
|
|
107
108
|
testId: testId,
|
|
108
|
-
title: title
|
|
109
|
+
title: title,
|
|
110
|
+
metadataPosition: metadataPosition
|
|
109
111
|
}));
|
|
110
112
|
};
|
|
111
113
|
export default TitleBlock;
|
|
@@ -20,6 +20,7 @@ const TitleBlockResolvedView = ({
|
|
|
20
20
|
testId,
|
|
21
21
|
text,
|
|
22
22
|
title,
|
|
23
|
+
metadataPosition,
|
|
23
24
|
...blockProps
|
|
24
25
|
}) => {
|
|
25
26
|
const metadataElements = renderElementItems(metadata);
|
|
@@ -39,7 +40,7 @@ const TitleBlockResolvedView = ({
|
|
|
39
40
|
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
40
41
|
direction: SmartLinkDirection.Horizontal,
|
|
41
42
|
align: SmartLinkAlignment.Right,
|
|
42
|
-
position: SmartLinkPosition.
|
|
43
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center
|
|
43
44
|
}, metadataElements), actionGroup);
|
|
44
45
|
};
|
|
45
46
|
export default TitleBlockResolvedView;
|
|
@@ -5,8 +5,12 @@ import AtlaskitAvatarGroup from '@atlaskit/avatar-group';
|
|
|
5
5
|
import { SmartLinkSize } from '../../../../../constants';
|
|
6
6
|
const MAX_COUNT = 4;
|
|
7
7
|
const getStyles = size => {
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
8
9
|
const styles = css`
|
|
9
10
|
display: inline-flex;
|
|
11
|
+
ul {
|
|
12
|
+
margin-right: 8px;
|
|
13
|
+
}
|
|
10
14
|
`;
|
|
11
15
|
switch (size) {
|
|
12
16
|
case SmartLinkSize.XLarge:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
3
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
3
4
|
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
4
|
-
import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
|
|
5
|
+
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
5
6
|
import { FooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
6
7
|
import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
|
|
7
8
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
@@ -91,7 +92,9 @@ const HoverCardResolvedView = ({
|
|
|
91
92
|
data: data,
|
|
92
93
|
snippetHeight: snippetHeight.current
|
|
93
94
|
});
|
|
94
|
-
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, /*#__PURE__*/React.createElement(TitleBlock,
|
|
95
|
+
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
96
|
+
metadataPosition: SmartLinkPosition.Top
|
|
97
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
95
98
|
primary: primary,
|
|
96
99
|
secondary: secondary,
|
|
97
100
|
size: SmartLinkSize.Large,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
-
import { getUrlAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
4
3
|
/**
|
|
5
4
|
* Provides an analytics context to supply attributes to events based on a URL
|
|
6
5
|
*/
|
|
@@ -11,15 +10,12 @@ export var LinkAnalyticsContext = function LinkAnalyticsContext(_ref) {
|
|
|
11
10
|
id = _ref.id,
|
|
12
11
|
children = _ref.children,
|
|
13
12
|
source = _ref.source;
|
|
14
|
-
var _getUrlAttributes = getUrlAttributes(url),
|
|
15
|
-
urlHash = _getUrlAttributes.urlHash;
|
|
16
13
|
var displayCategory = display === 'url' ? 'link' : undefined;
|
|
17
14
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
18
15
|
data: {
|
|
19
16
|
source: source,
|
|
20
17
|
attributes: {
|
|
21
18
|
displayCategory: displayCategory,
|
|
22
|
-
urlHash: urlHash,
|
|
23
19
|
display: display,
|
|
24
20
|
id: id
|
|
25
21
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -83,7 +83,8 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
83
83
|
hideRetry: true,
|
|
84
84
|
subtitle: [{
|
|
85
85
|
name: ElementName.Location
|
|
86
|
-
}]
|
|
86
|
+
}],
|
|
87
|
+
metadataPosition: SmartLinkPosition.Top
|
|
87
88
|
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
88
89
|
primary: metadata,
|
|
89
90
|
maxLines: 1
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
|
-
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry"];
|
|
5
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry", "metadataPosition"];
|
|
6
6
|
var _templateObject, _templateObject2;
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
8
|
import { css } from '@emotion/react';
|
|
@@ -64,6 +64,7 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
64
64
|
text = _ref.text,
|
|
65
65
|
theme = _ref.theme,
|
|
66
66
|
hideRetry = _ref.hideRetry,
|
|
67
|
+
metadataPosition = _ref.metadataPosition,
|
|
67
68
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
68
69
|
if (hideRetry && props.retry) {
|
|
69
70
|
delete props.retry;
|
|
@@ -104,7 +105,8 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
104
105
|
actionGroup: actionGroup,
|
|
105
106
|
overrideCss: combinedCss,
|
|
106
107
|
testId: testId,
|
|
107
|
-
title: title
|
|
108
|
+
title: title,
|
|
109
|
+
metadataPosition: metadataPosition
|
|
108
110
|
}));
|
|
109
111
|
};
|
|
110
112
|
export default TitleBlock;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _templateObject;
|
|
5
|
-
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title"];
|
|
5
|
+
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title", "metadataPosition"];
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { css } from '@emotion/react';
|
|
8
8
|
import { LinkIcon } from '../../../elements';
|
|
@@ -26,6 +26,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
26
26
|
testId = _ref.testId,
|
|
27
27
|
text = _ref.text,
|
|
28
28
|
title = _ref.title,
|
|
29
|
+
metadataPosition = _ref.metadataPosition,
|
|
29
30
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
31
|
var metadataElements = renderElementItems(metadata);
|
|
31
32
|
var subtitleElements = renderElementItems(subtitle);
|
|
@@ -42,7 +43,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
42
43
|
}, subtitleElements)), metadataElements && /*#__PURE__*/React.createElement(ElementGroup, {
|
|
43
44
|
direction: SmartLinkDirection.Horizontal,
|
|
44
45
|
align: SmartLinkAlignment.Right,
|
|
45
|
-
position: SmartLinkPosition.
|
|
46
|
+
position: metadataPosition !== null && metadataPosition !== void 0 ? metadataPosition : SmartLinkPosition.Center
|
|
46
47
|
}, metadataElements), actionGroup);
|
|
47
48
|
};
|
|
48
49
|
export default TitleBlockResolvedView;
|
|
@@ -7,7 +7,8 @@ import AtlaskitAvatarGroup from '@atlaskit/avatar-group';
|
|
|
7
7
|
import { SmartLinkSize } from '../../../../../constants';
|
|
8
8
|
var MAX_COUNT = 4;
|
|
9
9
|
var getStyles = function getStyles(size) {
|
|
10
|
-
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
11
|
+
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n ul {\n margin-right: 8px;\n }\n "])));
|
|
11
12
|
switch (size) {
|
|
12
13
|
case SmartLinkSize.XLarge:
|
|
13
14
|
case SmartLinkSize.Large:
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
5
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
5
6
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
6
7
|
import { extractType } from '@atlaskit/linking-common/extractors';
|
|
7
|
-
import { ActionName, CardDisplay, SmartLinkSize } from '../../../../../constants';
|
|
8
|
+
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
8
9
|
import { FooterBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
9
10
|
import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
|
|
10
11
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
@@ -95,7 +96,9 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
95
96
|
data: data,
|
|
96
97
|
snippetHeight: snippetHeight.current
|
|
97
98
|
});
|
|
98
|
-
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, /*#__PURE__*/React.createElement(TitleBlock,
|
|
99
|
+
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
100
|
+
metadataPosition: SmartLinkPosition.Top
|
|
101
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
99
102
|
primary: primary,
|
|
100
103
|
secondary: secondary,
|
|
101
104
|
size: SmartLinkSize.Large,
|
|
@@ -85,6 +85,11 @@ export type TitleBlockProps = {
|
|
|
85
85
|
* @internal
|
|
86
86
|
*/
|
|
87
87
|
theme?: SmartLinkTheme;
|
|
88
|
+
/**
|
|
89
|
+
* The vertical position of the metadata fields. Internal prop, please DO NOT USE.
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
metadataPosition?: SmartLinkPosition;
|
|
88
93
|
} & BlockProps;
|
|
89
94
|
export type TitleBlockViewProps = TitleBlockProps & {
|
|
90
95
|
actionGroup?: React.ReactNode;
|
|
@@ -85,6 +85,11 @@ export type TitleBlockProps = {
|
|
|
85
85
|
* @internal
|
|
86
86
|
*/
|
|
87
87
|
theme?: SmartLinkTheme;
|
|
88
|
+
/**
|
|
89
|
+
* The vertical position of the metadata fields. Internal prop, please DO NOT USE.
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
metadataPosition?: SmartLinkPosition;
|
|
88
93
|
} & BlockProps;
|
|
89
94
|
export type TitleBlockViewProps = TitleBlockProps & {
|
|
90
95
|
actionGroup?: React.ReactNode;
|
package/package.json
CHANGED
package/report.api.md
CHANGED