@atlaskit/smart-card 26.71.0 → 26.72.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 +9 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -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 -1
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -0
- 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 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -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 -1
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/BlockCard/index.d.ts +2 -2
- package/dist/types/view/BlockCard/views/flexible/unresolved-view/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +10 -5
- package/dist/types/view/FlexibleCard/components/elements/icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/icon/types.d.ts +7 -2
- package/dist/types/view/FlexibleCard/components/elements/link/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/link/types.d.ts +3 -3
- package/dist/types-ts4.5/view/BlockCard/index.d.ts +2 -2
- package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +10 -5
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/icon/types.d.ts +7 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/link/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/link/types.d.ts +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.72.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#103201](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103201)
|
|
8
|
+
[`7cb62c61f30e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7cb62c61f30e) -
|
|
9
|
+
[ux] Added a new `icon` prop to override the icon rendered in the smart card TitleBlock
|
|
10
|
+
component.
|
|
11
|
+
|
|
3
12
|
## 26.71.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.72.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -15,7 +15,7 @@ var _block = _interopRequireDefault(require("../../block"));
|
|
|
15
15
|
var _constants = require("../../../../../../constants");
|
|
16
16
|
var _utils = require("../../../utils");
|
|
17
17
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
18
|
-
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "hideIcon"];
|
|
18
|
+
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
19
19
|
/** @jsx jsx */
|
|
20
20
|
var actionStyles = (0, _react2.css)({
|
|
21
21
|
cursor: 'pointer',
|
|
@@ -50,6 +50,7 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
50
50
|
position = _ref.position,
|
|
51
51
|
testId = _ref.testId,
|
|
52
52
|
title = _ref.title,
|
|
53
|
+
icon = _ref.icon,
|
|
53
54
|
hideIcon = _ref.hideIcon,
|
|
54
55
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
55
56
|
var _ref2 = retry || {},
|
|
@@ -62,6 +63,7 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
62
63
|
return (0, _react2.jsx)(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
63
64
|
testId: "".concat(testId, "-errored-view")
|
|
64
65
|
}), !hideIcon && (0, _react2.jsx)(_elements.LinkIcon, {
|
|
66
|
+
overrideIcon: icon,
|
|
65
67
|
position: position
|
|
66
68
|
}), title, descriptor && (0, _react2.jsx)(_elementGroup.default, {
|
|
67
69
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
@@ -18,7 +18,7 @@ var _errored = _interopRequireDefault(require("./errored"));
|
|
|
18
18
|
var _resolving = _interopRequireDefault(require("./resolving"));
|
|
19
19
|
var _actionGroup = _interopRequireDefault(require("../action-group"));
|
|
20
20
|
var _elements = require("../../elements");
|
|
21
|
-
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
21
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "icon", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
22
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
24
|
var getActionStyles = function getActionStyles(showOnHover, isOpen) {
|
|
@@ -77,6 +77,7 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
77
77
|
_ref$testId = _ref.testId,
|
|
78
78
|
testId = _ref$testId === void 0 ? 'smart-block-title' : _ref$testId,
|
|
79
79
|
text = _ref.text,
|
|
80
|
+
icon = _ref.icon,
|
|
80
81
|
theme = _ref.theme,
|
|
81
82
|
hideRetry = _ref.hideRetry,
|
|
82
83
|
metadataPosition = _ref.metadataPosition,
|
|
@@ -124,7 +125,8 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
124
125
|
testId: testId,
|
|
125
126
|
title: title,
|
|
126
127
|
metadataPosition: metadataPosition,
|
|
127
|
-
hideIcon: hideIcon
|
|
128
|
+
hideIcon: hideIcon,
|
|
129
|
+
icon: icon
|
|
128
130
|
}));
|
|
129
131
|
};
|
|
130
132
|
var _default = exports.default = TitleBlock;
|
|
@@ -14,7 +14,7 @@ var _block = _interopRequireDefault(require("../../block"));
|
|
|
14
14
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
15
15
|
var _constants = require("../../../../../../constants");
|
|
16
16
|
var _utils = require("../../utils");
|
|
17
|
-
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title", "metadataPosition", "hideIcon"];
|
|
17
|
+
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "icon", "title", "metadataPosition", "hideIcon"];
|
|
18
18
|
/**
|
|
19
19
|
* This renders a fully resolved TitleBlock.
|
|
20
20
|
* This should render when a Smart Link returns a valid response.
|
|
@@ -29,6 +29,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
29
29
|
subtitle = _ref$subtitle === void 0 ? [] : _ref$subtitle,
|
|
30
30
|
testId = _ref.testId,
|
|
31
31
|
text = _ref.text,
|
|
32
|
+
icon = _ref.icon,
|
|
32
33
|
title = _ref.title,
|
|
33
34
|
metadataPosition = _ref.metadataPosition,
|
|
34
35
|
hideIcon = _ref.hideIcon,
|
|
@@ -38,6 +39,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
38
39
|
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
39
40
|
testId: "".concat(testId, "-resolved-view")
|
|
40
41
|
}), !hideIcon && /*#__PURE__*/_react.default.createElement(_elements.LinkIcon, {
|
|
42
|
+
overrideIcon: icon,
|
|
41
43
|
position: position
|
|
42
44
|
}), /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
43
45
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
@@ -81,6 +81,7 @@ var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
|
81
81
|
*/
|
|
82
82
|
var Icon = function Icon(_ref) {
|
|
83
83
|
var icon = _ref.icon,
|
|
84
|
+
overrideIcon = _ref.overrideIcon,
|
|
84
85
|
_ref$label = _ref.label,
|
|
85
86
|
label = _ref$label === void 0 ? 'Link' : _ref$label,
|
|
86
87
|
name = _ref.name,
|
|
@@ -95,8 +96,8 @@ var Icon = function Icon(_ref) {
|
|
|
95
96
|
url = _ref.url;
|
|
96
97
|
var element = (0, _react.useMemo)(function () {
|
|
97
98
|
var defaultIcon = renderDefaultIcon(label, testId);
|
|
98
|
-
return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
99
|
-
}, [icon, label, render, testId, url]);
|
|
99
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
100
|
+
}, [overrideIcon, icon, label, render, testId, url]);
|
|
100
101
|
var width = (0, _utils.getIconWidth)(size);
|
|
101
102
|
var styles = getIconStyles(position, width);
|
|
102
103
|
var renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.
|
|
20
|
+
packageVersion: "26.72.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.72.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -41,6 +41,7 @@ const TitleBlockErroredView = ({
|
|
|
41
41
|
position,
|
|
42
42
|
testId,
|
|
43
43
|
title,
|
|
44
|
+
icon,
|
|
44
45
|
hideIcon,
|
|
45
46
|
...blockProps
|
|
46
47
|
}) => {
|
|
@@ -56,6 +57,7 @@ const TitleBlockErroredView = ({
|
|
|
56
57
|
return jsx(Block, _extends({}, blockProps, {
|
|
57
58
|
testId: `${testId}-errored-view`
|
|
58
59
|
}), !hideIcon && jsx(LinkIcon, {
|
|
60
|
+
overrideIcon: icon,
|
|
59
61
|
position: position
|
|
60
62
|
}), title, descriptor && jsx(ElementGroup, {
|
|
61
63
|
direction: SmartLinkDirection.Horizontal,
|
|
@@ -61,6 +61,7 @@ const TitleBlock = ({
|
|
|
61
61
|
showActionOnHover,
|
|
62
62
|
testId = 'smart-block-title',
|
|
63
63
|
text,
|
|
64
|
+
icon,
|
|
64
65
|
theme,
|
|
65
66
|
hideRetry,
|
|
66
67
|
metadataPosition,
|
|
@@ -105,7 +106,8 @@ const TitleBlock = ({
|
|
|
105
106
|
testId: testId,
|
|
106
107
|
title: title,
|
|
107
108
|
metadataPosition: metadataPosition,
|
|
108
|
-
hideIcon: hideIcon
|
|
109
|
+
hideIcon: hideIcon,
|
|
110
|
+
icon: icon
|
|
109
111
|
}));
|
|
110
112
|
};
|
|
111
113
|
export default TitleBlock;
|
|
@@ -19,6 +19,7 @@ const TitleBlockResolvedView = ({
|
|
|
19
19
|
subtitle = [],
|
|
20
20
|
testId,
|
|
21
21
|
text,
|
|
22
|
+
icon,
|
|
22
23
|
title,
|
|
23
24
|
metadataPosition,
|
|
24
25
|
hideIcon,
|
|
@@ -29,6 +30,7 @@ const TitleBlockResolvedView = ({
|
|
|
29
30
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
30
31
|
testId: `${testId}-resolved-view`
|
|
31
32
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
33
|
+
overrideIcon: icon,
|
|
32
34
|
position: position
|
|
33
35
|
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
34
36
|
direction: SmartLinkDirection.Vertical,
|
|
@@ -64,6 +64,7 @@ const renderImageIcon = (defaultIcon, url, testId) => {
|
|
|
64
64
|
*/
|
|
65
65
|
const Icon = ({
|
|
66
66
|
icon,
|
|
67
|
+
overrideIcon,
|
|
67
68
|
label = 'Link',
|
|
68
69
|
name,
|
|
69
70
|
position = SmartLinkPosition.Top,
|
|
@@ -75,8 +76,8 @@ const Icon = ({
|
|
|
75
76
|
}) => {
|
|
76
77
|
const element = useMemo(() => {
|
|
77
78
|
const defaultIcon = renderDefaultIcon(label, testId);
|
|
78
|
-
return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
79
|
-
}, [icon, label, render, testId, url]);
|
|
79
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
80
|
+
}, [overrideIcon, icon, label, render, testId, url]);
|
|
80
81
|
const width = getIconWidth(size);
|
|
81
82
|
const styles = getIconStyles(position, width);
|
|
82
83
|
const renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "26.
|
|
10
|
+
packageVersion: "26.72.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.72.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "hideIcon"];
|
|
3
|
+
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -43,6 +43,7 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
43
43
|
position = _ref.position,
|
|
44
44
|
testId = _ref.testId,
|
|
45
45
|
title = _ref.title,
|
|
46
|
+
icon = _ref.icon,
|
|
46
47
|
hideIcon = _ref.hideIcon,
|
|
47
48
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
48
49
|
var _ref2 = retry || {},
|
|
@@ -55,6 +56,7 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
55
56
|
return jsx(Block, _extends({}, blockProps, {
|
|
56
57
|
testId: "".concat(testId, "-errored-view")
|
|
57
58
|
}), !hideIcon && jsx(LinkIcon, {
|
|
59
|
+
overrideIcon: icon,
|
|
58
60
|
position: position
|
|
59
61
|
}), title, descriptor && jsx(ElementGroup, {
|
|
60
62
|
direction: SmartLinkDirection.Horizontal,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
4
|
+
var _excluded = ["actions", "anchorTarget", "hideTitleTooltip", "maxLines", "onActionMenuOpenChange", "onClick", "overrideCss", "status", "showActionOnHover", "testId", "text", "icon", "theme", "hideRetry", "metadataPosition", "hideIcon"];
|
|
5
5
|
import React, { useCallback, useState } from 'react';
|
|
6
6
|
import { css } from '@emotion/react';
|
|
7
7
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
@@ -67,6 +67,7 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
67
67
|
_ref$testId = _ref.testId,
|
|
68
68
|
testId = _ref$testId === void 0 ? 'smart-block-title' : _ref$testId,
|
|
69
69
|
text = _ref.text,
|
|
70
|
+
icon = _ref.icon,
|
|
70
71
|
theme = _ref.theme,
|
|
71
72
|
hideRetry = _ref.hideRetry,
|
|
72
73
|
metadataPosition = _ref.metadataPosition,
|
|
@@ -114,7 +115,8 @@ var TitleBlock = function TitleBlock(_ref) {
|
|
|
114
115
|
testId: testId,
|
|
115
116
|
title: title,
|
|
116
117
|
metadataPosition: metadataPosition,
|
|
117
|
-
hideIcon: hideIcon
|
|
118
|
+
hideIcon: hideIcon,
|
|
119
|
+
icon: icon
|
|
118
120
|
}));
|
|
119
121
|
};
|
|
120
122
|
export default TitleBlock;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "title", "metadataPosition", "hideIcon"];
|
|
3
|
+
var _excluded = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "icon", "title", "metadataPosition", "hideIcon"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { LinkIcon } from '../../../elements';
|
|
@@ -23,6 +23,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
23
23
|
subtitle = _ref$subtitle === void 0 ? [] : _ref$subtitle,
|
|
24
24
|
testId = _ref.testId,
|
|
25
25
|
text = _ref.text,
|
|
26
|
+
icon = _ref.icon,
|
|
26
27
|
title = _ref.title,
|
|
27
28
|
metadataPosition = _ref.metadataPosition,
|
|
28
29
|
hideIcon = _ref.hideIcon,
|
|
@@ -32,6 +33,7 @@ var TitleBlockResolvedView = function TitleBlockResolvedView(_ref) {
|
|
|
32
33
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
33
34
|
testId: "".concat(testId, "-resolved-view")
|
|
34
35
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
36
|
+
overrideIcon: icon,
|
|
35
37
|
position: position
|
|
36
38
|
}), /*#__PURE__*/React.createElement(ElementGroup, {
|
|
37
39
|
direction: SmartLinkDirection.Vertical,
|
|
@@ -70,6 +70,7 @@ var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
|
70
70
|
*/
|
|
71
71
|
var Icon = function Icon(_ref) {
|
|
72
72
|
var icon = _ref.icon,
|
|
73
|
+
overrideIcon = _ref.overrideIcon,
|
|
73
74
|
_ref$label = _ref.label,
|
|
74
75
|
label = _ref$label === void 0 ? 'Link' : _ref$label,
|
|
75
76
|
name = _ref.name,
|
|
@@ -84,8 +85,8 @@ var Icon = function Icon(_ref) {
|
|
|
84
85
|
url = _ref.url;
|
|
85
86
|
var element = useMemo(function () {
|
|
86
87
|
var defaultIcon = renderDefaultIcon(label, testId);
|
|
87
|
-
return (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
88
|
-
}, [icon, label, render, testId, url]);
|
|
88
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId) || renderAtlaskitIcon(icon, label, testId) || defaultIcon;
|
|
89
|
+
}, [overrideIcon, icon, label, render, testId, url]);
|
|
89
90
|
var width = getIconWidth(size);
|
|
90
91
|
var styles = getIconStyles(position, width);
|
|
91
92
|
var renderStyles = render ? getCustomRenderStyles(width) : undefined;
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.72.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
import { BlockCardProps } from './types';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import { type BlockCardProps } from './types';
|
|
4
4
|
import { AuthorizeAction } from './actions/AuthorizeAction';
|
|
5
5
|
import { ForbiddenAction } from './actions/ForbiddenAction';
|
|
6
6
|
import { ResolvedView as BlockCardResolvedView } from './views/ResolvedView';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { UnresolvedViewProps } from './types';
|
|
2
|
+
import { type UnresolvedViewProps } from './types';
|
|
3
3
|
declare const UnresolvedView: ({ actions, cardState, children, onAuthorize, onClick, onError, showPreview, testId, title, url, }: UnresolvedViewProps) => JSX.Element;
|
|
4
4
|
export default UnresolvedView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TitleBlockProps } from './types';
|
|
2
|
+
import { type TitleBlockProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a TitleBlock, which is the foundation of Flexible UI.
|
|
5
5
|
* This contains an icon, the link, and any associated metadata and actions in one block.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ActionItem, BlockProps, ElementItem, OnActionMenuOpenChangeOptions } from '../types';
|
|
3
|
-
import { SmartLinkPosition, SmartLinkTheme } from '../../../../../constants';
|
|
4
|
-
import { RetryOptions } from '../../../types';
|
|
5
|
-
import { AnchorTarget } from '../../types';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type ActionItem, type BlockProps, type ElementItem, type OnActionMenuOpenChangeOptions } from '../types';
|
|
3
|
+
import { type SmartLinkPosition, type SmartLinkTheme } from '../../../../../constants';
|
|
4
|
+
import { type RetryOptions } from '../../../types';
|
|
5
|
+
import { type AnchorTarget } from '../../types';
|
|
6
6
|
export type TitleBlockProps = {
|
|
7
7
|
/**
|
|
8
8
|
* An array of action items to be displayed after the title
|
|
@@ -80,6 +80,11 @@ export type TitleBlockProps = {
|
|
|
80
80
|
* the Smart Link.
|
|
81
81
|
*/
|
|
82
82
|
text?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The icon to display in the title block. Overrides any icon that is retrieved from
|
|
85
|
+
* the Smart Link.
|
|
86
|
+
*/
|
|
87
|
+
icon?: React.ReactNode;
|
|
83
88
|
/**
|
|
84
89
|
* The theme of the link text. Can be Black or Link (default URL blue)
|
|
85
90
|
* @internal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ElementProps } from '../types';
|
|
3
|
-
import { IconType, SmartLinkPosition } from '../../../../../constants';
|
|
2
|
+
import { type ElementProps } from '../types';
|
|
3
|
+
import { type IconType, type SmartLinkPosition } from '../../../../../constants';
|
|
4
4
|
export type IconProps = ElementProps & {
|
|
5
5
|
/**
|
|
6
6
|
* If provided, Icon element will use this render function instead.
|
|
@@ -11,6 +11,11 @@ export type IconProps = ElementProps & {
|
|
|
11
11
|
* will be used.
|
|
12
12
|
*/
|
|
13
13
|
icon?: IconType;
|
|
14
|
+
/**
|
|
15
|
+
* If provided, overrideIcon will be rendered in the place of the provided icon or one that is
|
|
16
|
+
* supplied by the URL.
|
|
17
|
+
*/
|
|
18
|
+
overrideIcon?: React.ReactNode;
|
|
14
19
|
/**
|
|
15
20
|
* The label provided to the Atlaskit Icon.
|
|
16
21
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ElementProps } from '../types';
|
|
3
|
-
import { SmartLinkTheme } from '../../../../../constants';
|
|
4
|
-
import { AnchorTarget } from '../../types';
|
|
2
|
+
import { type ElementProps } from '../types';
|
|
3
|
+
import { type SmartLinkTheme } from '../../../../../constants';
|
|
4
|
+
import { type AnchorTarget } from '../../types';
|
|
5
5
|
export type LinkProps = ElementProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Determines whether the link should display tooltip on hover.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
import { BlockCardProps } from './types';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import { type BlockCardProps } from './types';
|
|
4
4
|
import { AuthorizeAction } from './actions/AuthorizeAction';
|
|
5
5
|
import { ForbiddenAction } from './actions/ForbiddenAction';
|
|
6
6
|
import { ResolvedView as BlockCardResolvedView } from './views/ResolvedView';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { UnresolvedViewProps } from './types';
|
|
2
|
+
import { type UnresolvedViewProps } from './types';
|
|
3
3
|
declare const UnresolvedView: ({ actions, cardState, children, onAuthorize, onClick, onError, showPreview, testId, title, url, }: UnresolvedViewProps) => JSX.Element;
|
|
4
4
|
export default UnresolvedView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TitleBlockProps } from './types';
|
|
2
|
+
import { type TitleBlockProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a TitleBlock, which is the foundation of Flexible UI.
|
|
5
5
|
* This contains an icon, the link, and any associated metadata and actions in one block.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ActionItem, BlockProps, ElementItem, OnActionMenuOpenChangeOptions } from '../types';
|
|
3
|
-
import { SmartLinkPosition, SmartLinkTheme } from '../../../../../constants';
|
|
4
|
-
import { RetryOptions } from '../../../types';
|
|
5
|
-
import { AnchorTarget } from '../../types';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type ActionItem, type BlockProps, type ElementItem, type OnActionMenuOpenChangeOptions } from '../types';
|
|
3
|
+
import { type SmartLinkPosition, type SmartLinkTheme } from '../../../../../constants';
|
|
4
|
+
import { type RetryOptions } from '../../../types';
|
|
5
|
+
import { type AnchorTarget } from '../../types';
|
|
6
6
|
export type TitleBlockProps = {
|
|
7
7
|
/**
|
|
8
8
|
* An array of action items to be displayed after the title
|
|
@@ -80,6 +80,11 @@ export type TitleBlockProps = {
|
|
|
80
80
|
* the Smart Link.
|
|
81
81
|
*/
|
|
82
82
|
text?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The icon to display in the title block. Overrides any icon that is retrieved from
|
|
85
|
+
* the Smart Link.
|
|
86
|
+
*/
|
|
87
|
+
icon?: React.ReactNode;
|
|
83
88
|
/**
|
|
84
89
|
* The theme of the link text. Can be Black or Link (default URL blue)
|
|
85
90
|
* @internal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ElementProps } from '../types';
|
|
3
|
-
import { IconType, SmartLinkPosition } from '../../../../../constants';
|
|
2
|
+
import { type ElementProps } from '../types';
|
|
3
|
+
import { type IconType, type SmartLinkPosition } from '../../../../../constants';
|
|
4
4
|
export type IconProps = ElementProps & {
|
|
5
5
|
/**
|
|
6
6
|
* If provided, Icon element will use this render function instead.
|
|
@@ -11,6 +11,11 @@ export type IconProps = ElementProps & {
|
|
|
11
11
|
* will be used.
|
|
12
12
|
*/
|
|
13
13
|
icon?: IconType;
|
|
14
|
+
/**
|
|
15
|
+
* If provided, overrideIcon will be rendered in the place of the provided icon or one that is
|
|
16
|
+
* supplied by the URL.
|
|
17
|
+
*/
|
|
18
|
+
overrideIcon?: React.ReactNode;
|
|
14
19
|
/**
|
|
15
20
|
* The label provided to the Atlaskit Icon.
|
|
16
21
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ElementProps } from '../types';
|
|
3
|
-
import { SmartLinkTheme } from '../../../../../constants';
|
|
4
|
-
import { AnchorTarget } from '../../types';
|
|
2
|
+
import { type ElementProps } from '../types';
|
|
3
|
+
import { type SmartLinkTheme } from '../../../../../constants';
|
|
4
|
+
import { type AnchorTarget } from '../../types';
|
|
5
5
|
export type LinkProps = ElementProps & {
|
|
6
6
|
/**
|
|
7
7
|
* Determines whether the link should display tooltip on hover.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.72.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/button": "^17.15.0",
|
|
37
37
|
"@atlaskit/checkbox": "^13.3.0",
|
|
38
38
|
"@atlaskit/dropdown-menu": "^12.10.0",
|
|
39
|
-
"@atlaskit/form": "^10.
|
|
39
|
+
"@atlaskit/form": "^10.2.0",
|
|
40
40
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
41
41
|
"@atlaskit/heading": "^2.3.0",
|
|
42
42
|
"@atlaskit/icon": "^22.3.0",
|