@atlaskit/smart-card 26.3.10 → 26.4.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.
- package/CHANGELOG.md +12 -0
- 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/HoverCard/components/views/resolved/index.js +4 -1
- 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/HoverCard/components/views/resolved/index.js +5 -2
- 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/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 +2 -2
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 26.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`2b7f0f3b158`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b7f0f3b158) - [ux] Fix issue with metadata alignment of Title Block component in Confluence Web links.
|
|
14
|
+
|
|
3
15
|
## 26.3.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
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;
|
|
@@ -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,
|
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;
|
|
@@ -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,
|
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;
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.4.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/link-analytics": "^8.0.2",
|
|
45
45
|
"@atlaskit/link-client-extension": "^1.1.0",
|
|
46
46
|
"@atlaskit/linking-common": "^2.13.0",
|
|
47
|
-
"@atlaskit/linking-types": "^
|
|
47
|
+
"@atlaskit/linking-types": "^5.0.0",
|
|
48
48
|
"@atlaskit/logo": "^13.14.0",
|
|
49
49
|
"@atlaskit/lozenge": "^11.4.0",
|
|
50
50
|
"@atlaskit/media-common": "^5.0.0",
|
package/report.api.md
CHANGED