@atlaskit/smart-card 34.4.0 → 34.5.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 +17 -0
- package/dist/cjs/common/ui/icons/angle-brackets-icon.js +2 -11
- package/dist/cjs/common/ui/icons/audio-icon.js +2 -11
- package/dist/cjs/common/ui/icons/blog-icon.js +13 -0
- package/dist/cjs/common/ui/icons/chart-bar-icon.js +2 -11
- package/dist/cjs/common/ui/icons/file-icon.js +2 -11
- package/dist/cjs/common/ui/icons/folder-icon.js +2 -11
- package/dist/cjs/common/ui/icons/image-icon.js +2 -11
- package/dist/cjs/common/ui/icons/list-bullet-icon.js +2 -11
- package/dist/cjs/common/ui/icons/page-icon.js +2 -12
- package/dist/cjs/common/ui/icons/types.js +5 -0
- package/dist/cjs/common/ui/icons/utils.js +47 -0
- package/dist/cjs/common/ui/icons/video-icon.js +2 -11
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +398 -181
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +12 -12
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.js +85 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +39 -29
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +38 -20
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +27 -6
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +43 -17
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +28 -8
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +0 -2
- package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +13 -12
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +35 -8
- package/dist/cjs/view/FlexibleCard/components/utils.js +23 -2
- package/dist/cjs/view/HoverCard/components/views/resolving/index.js +29 -14
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/common/ui/icons/angle-brackets-icon.js +2 -11
- package/dist/es2019/common/ui/icons/audio-icon.js +2 -11
- package/dist/es2019/common/ui/icons/blog-icon.js +6 -0
- package/dist/es2019/common/ui/icons/chart-bar-icon.js +2 -11
- package/dist/es2019/common/ui/icons/file-icon.js +2 -11
- package/dist/es2019/common/ui/icons/folder-icon.js +2 -11
- package/dist/es2019/common/ui/icons/image-icon.js +2 -11
- package/dist/es2019/common/ui/icons/list-bullet-icon.js +2 -11
- package/dist/es2019/common/ui/icons/page-icon.js +2 -12
- package/dist/es2019/common/ui/icons/types.js +1 -0
- package/dist/es2019/common/ui/icons/utils.js +39 -0
- package/dist/es2019/common/ui/icons/video-icon.js +2 -11
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +171 -54
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +12 -12
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.js +75 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +29 -24
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +8 -3
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +24 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +27 -6
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +46 -21
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +28 -8
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +0 -2
- package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +14 -12
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +35 -10
- package/dist/es2019/view/FlexibleCard/components/utils.js +22 -1
- package/dist/es2019/view/HoverCard/components/views/resolving/index.js +21 -6
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +2 -2
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.js +2 -2
- package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +2 -2
- package/dist/esm/common/ui/icons/angle-brackets-icon.js +2 -11
- package/dist/esm/common/ui/icons/audio-icon.js +2 -11
- package/dist/esm/common/ui/icons/blog-icon.js +6 -0
- package/dist/esm/common/ui/icons/chart-bar-icon.js +2 -11
- package/dist/esm/common/ui/icons/file-icon.js +2 -11
- package/dist/esm/common/ui/icons/folder-icon.js +2 -11
- package/dist/esm/common/ui/icons/image-icon.js +2 -11
- package/dist/esm/common/ui/icons/list-bullet-icon.js +2 -11
- package/dist/esm/common/ui/icons/page-icon.js +2 -12
- package/dist/esm/common/ui/icons/types.js +1 -0
- package/dist/esm/common/ui/icons/utils.js +40 -0
- package/dist/esm/common/ui/icons/video-icon.js +2 -11
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +264 -97
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +12 -12
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.js +80 -0
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.compiled.css +10 -0
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +29 -24
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +8 -3
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +37 -19
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +27 -6
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +47 -21
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +28 -8
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +0 -2
- package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +13 -11
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +35 -8
- package/dist/esm/view/FlexibleCard/components/utils.js +22 -1
- package/dist/esm/view/HoverCard/components/views/resolving/index.js +21 -6
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +2 -2
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.js +2 -2
- package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +2 -2
- package/dist/types/common/ui/icons/angle-brackets-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/audio-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/blog-icon.d.ts +8 -0
- package/dist/types/common/ui/icons/chart-bar-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/file-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/folder-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/image-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/list-bullet-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/page-icon.d.ts +2 -6
- package/dist/types/common/ui/icons/types.d.ts +6 -0
- package/dist/types/common/ui/icons/utils.d.ts +15 -0
- package/dist/types/common/ui/icons/video-icon.d.ts +2 -6
- package/dist/types/utils/index.d.ts +8 -2
- package/dist/types/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +2 -9
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +3 -1
- package/dist/types/view/FlexibleCard/components/common/atlaskit-icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/common/atlaskit-icon/types.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/common/image-icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/common/image-icon/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +4 -3
- package/dist/types/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +17 -1
- package/dist/types/view/FlexibleCard/components/utils.d.ts +2 -0
- package/dist/types/view/HoverCard/components/views/resolving/index.d.ts +0 -4
- package/dist/types-ts4.5/common/ui/icons/angle-brackets-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/audio-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/blog-icon.d.ts +8 -0
- package/dist/types-ts4.5/common/ui/icons/chart-bar-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/file-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/folder-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/image-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/list-bullet-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/page-icon.d.ts +2 -6
- package/dist/types-ts4.5/common/ui/icons/types.d.ts +6 -0
- package/dist/types-ts4.5/common/ui/icons/utils.d.ts +15 -0
- package/dist/types-ts4.5/common/ui/icons/video-icon.d.ts +2 -6
- package/dist/types-ts4.5/utils/index.d.ts +8 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/MetadataBlockOld.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +2 -9
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +3 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/atlaskit-icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/atlaskit-icon/types.d.ts +2 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/image-icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/image-icon/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +4 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/types.d.ts +17 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +2 -0
- package/dist/types-ts4.5/view/HoverCard/components/views/resolving/index.d.ts +0 -4
- package/package.json +8 -1
|
@@ -40,22 +40,22 @@ var positionStyle = {
|
|
|
40
40
|
};
|
|
41
41
|
var horizontalStyleBase = null;
|
|
42
42
|
var horizontalStyleByHeight = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
xlarge: "_1e0ccj1k _102k1m1q",
|
|
44
|
+
large: "_1e0ccj1k _102k1m1q",
|
|
45
|
+
medium: "_1e0ccj1k _102k1k8s",
|
|
46
|
+
small: "_1e0ccj1k _102k1k8s"
|
|
47
47
|
};
|
|
48
48
|
var gapStylesLeft = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
xlarge: "_7yhb147b _m6ukidpf",
|
|
50
|
+
large: "_7yhb1e9d _m6ukidpf",
|
|
51
|
+
medium: "_7yhbcxkx _m6ukidpf",
|
|
52
|
+
small: "_7yhbpdf9 _m6ukidpf"
|
|
53
53
|
};
|
|
54
54
|
var gapStylesRight = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
xlarge: "_24rc147b _3dveidpf",
|
|
56
|
+
large: "_24rc1e9d _3dveidpf",
|
|
57
|
+
medium: "_24rccxkx _3dveidpf",
|
|
58
|
+
small: "_24rcpdf9 _3dveidpf"
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
12
|
+
var _constants = require("../../../../../constants");
|
|
13
|
+
var _utils = require("../../utils");
|
|
14
|
+
var _block = _interopRequireDefault(require("../block"));
|
|
15
|
+
var _elementGroup = _interopRequireDefault(require("../element-group"));
|
|
16
|
+
var _utils2 = require("../utils");
|
|
17
|
+
var _excluded = ["maxLines", "status", "testId", "primary", "secondary"]; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
+
var DEFAULT_MAX_LINES = 2;
|
|
19
|
+
var MAXIMUM_MAX_LINES = 2;
|
|
20
|
+
var MINIMUM_MAX_LINES = 1;
|
|
21
|
+
var getElementGroupStyles = function getElementGroupStyles(size, maxLines) {
|
|
22
|
+
// MetadataBlock allows metadata elements to be displayed in
|
|
23
|
+
// multiple lines, with maximum of 2 lines.
|
|
24
|
+
// We need the height of the line to be equal on both left and right
|
|
25
|
+
// sides so they line up nicely.
|
|
26
|
+
var lineHeight = (0, _utils.getMaxLineHeight)(size);
|
|
27
|
+
return (0, _react2.css)({
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/use-tokens-typography -- Ignored via go/DSP-18766
|
|
29
|
+
lineHeight: "".concat(lineHeight, "rem")
|
|
30
|
+
},
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
|
+
(0, _utils.getTruncateStyles)(maxLines, lineHeight + 'rem'));
|
|
33
|
+
};
|
|
34
|
+
var getMaxLines = function getMaxLines(maxLines) {
|
|
35
|
+
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
36
|
+
return DEFAULT_MAX_LINES;
|
|
37
|
+
}
|
|
38
|
+
if (maxLines < MINIMUM_MAX_LINES) {
|
|
39
|
+
return MINIMUM_MAX_LINES;
|
|
40
|
+
}
|
|
41
|
+
return maxLines;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Represents a MetadataBlock, designed to contain groups of metadata in the form of elements.
|
|
46
|
+
* Accepts an array of elements to be shown either primary (left hand side) or secondary (right hand side).
|
|
47
|
+
* @public
|
|
48
|
+
* @param {MetadataBlockProps} MetadataBlockProps
|
|
49
|
+
* @see Block
|
|
50
|
+
*/
|
|
51
|
+
var MetadataBlockOld = function MetadataBlockOld(_ref) {
|
|
52
|
+
var _ref$maxLines = _ref.maxLines,
|
|
53
|
+
maxLines = _ref$maxLines === void 0 ? DEFAULT_MAX_LINES : _ref$maxLines,
|
|
54
|
+
_ref$status = _ref.status,
|
|
55
|
+
status = _ref$status === void 0 ? _constants.SmartLinkStatus.Fallback : _ref$status,
|
|
56
|
+
_ref$testId = _ref.testId,
|
|
57
|
+
testId = _ref$testId === void 0 ? 'smart-block-metadata' : _ref$testId,
|
|
58
|
+
_ref$primary = _ref.primary,
|
|
59
|
+
primary = _ref$primary === void 0 ? [] : _ref$primary,
|
|
60
|
+
_ref$secondary = _ref.secondary,
|
|
61
|
+
secondary = _ref$secondary === void 0 ? [] : _ref$secondary,
|
|
62
|
+
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
63
|
+
if (primary.length === 0 && secondary.length === 0 || status !== _constants.SmartLinkStatus.Resolved) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
var primaryElements = (0, _utils2.renderElementItems)(primary);
|
|
67
|
+
var secondaryElements = (0, _utils2.renderElementItems)(secondary);
|
|
68
|
+
var _blockProps$size = blockProps.size,
|
|
69
|
+
size = _blockProps$size === void 0 ? _constants.SmartLinkSize.Medium : _blockProps$size;
|
|
70
|
+
var elementGroupStyles = getElementGroupStyles(size, getMaxLines(maxLines));
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
72
|
+
testId: "".concat(testId, "-resolved-view")
|
|
73
|
+
}), primaryElements && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
74
|
+
align: _constants.SmartLinkAlignment.Left,
|
|
75
|
+
overrideCss: elementGroupStyles,
|
|
76
|
+
direction: _constants.SmartLinkDirection.Horizontal,
|
|
77
|
+
width: _constants.SmartLinkWidth.Flexible
|
|
78
|
+
}, primaryElements), secondaryElements && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
|
|
79
|
+
align: _constants.SmartLinkAlignment.Right,
|
|
80
|
+
overrideCss: elementGroupStyles,
|
|
81
|
+
direction: _constants.SmartLinkDirection.Horizontal,
|
|
82
|
+
width: _constants.SmartLinkWidth.Flexible
|
|
83
|
+
}, secondaryElements));
|
|
84
|
+
};
|
|
85
|
+
var _default = exports.default = MetadataBlockOld;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18m915vq{overflow-y:hidden}
|
|
3
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
4
|
+
._1e0ccj1k{display:-webkit-box}
|
|
5
|
+
._1nmz1hna{word-break:break-word}
|
|
6
|
+
._1reo15vq{overflow-x:hidden}
|
|
7
|
+
._1yyjcs5v{-webkit-line-clamp:2}
|
|
8
|
+
._1yyjkb7n{-webkit-line-clamp:1}
|
|
9
|
+
._sudp1e54{-webkit-box-orient:vertical}
|
|
10
|
+
@supports not (-webkit-line-clamp:1){._102k1k7u{max-height:3.5rem}._102k1wto{max-height:3rem}}
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
require("./index.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var
|
|
11
|
-
var _react2 = require("@emotion/react");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
16
|
var _constants = require("../../../../../constants");
|
|
13
|
-
var _utils = require("../../utils");
|
|
14
17
|
var _block = _interopRequireDefault(require("../block"));
|
|
15
|
-
var _elementGroup =
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
+
var _elementGroup = require("../element-group");
|
|
19
|
+
var _utils = require("../utils");
|
|
20
|
+
var _MetadataBlockOld = _interopRequireDefault(require("./MetadataBlockOld"));
|
|
21
|
+
var _excluded = ["maxLines", "status", "testId", "primary", "secondary"];
|
|
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
|
+
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 && {}.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; }
|
|
18
24
|
var DEFAULT_MAX_LINES = 2;
|
|
19
25
|
var MAXIMUM_MAX_LINES = 2;
|
|
20
26
|
var MINIMUM_MAX_LINES = 1;
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
|
-
(0, _utils.getTruncateStyles)(maxLines, lineHeight + 'rem'));
|
|
27
|
+
var truncateStyles = {
|
|
28
|
+
'1': "_1reo15vq _18m915vq _1e0ccj1k _1bto1l2s _1nmz1hna _1yyjkb7n _sudp1e54",
|
|
29
|
+
'2': "_1reo15vq _18m915vq _1e0ccj1k _1bto1l2s _1nmz1hna _1yyjcs5v _sudp1e54"
|
|
30
|
+
};
|
|
31
|
+
var sizeStyles = {
|
|
32
|
+
xlarge: "_11c81oud _102k1k7u",
|
|
33
|
+
large: "_11c81oud _102k1k7u",
|
|
34
|
+
medium: "_11c81oud _102k1wto",
|
|
35
|
+
small: "_11c81oud _102k1wto"
|
|
33
36
|
};
|
|
34
37
|
var getMaxLines = function getMaxLines(maxLines) {
|
|
35
38
|
if (maxLines > MAXIMUM_MAX_LINES) {
|
|
@@ -63,23 +66,30 @@ var MetadataBlock = function MetadataBlock(_ref) {
|
|
|
63
66
|
if (primary.length === 0 && secondary.length === 0 || status !== _constants.SmartLinkStatus.Resolved) {
|
|
64
67
|
return null;
|
|
65
68
|
}
|
|
66
|
-
var primaryElements = (0,
|
|
67
|
-
var secondaryElements = (0,
|
|
69
|
+
var primaryElements = (0, _utils.renderElementItems)(primary);
|
|
70
|
+
var secondaryElements = (0, _utils.renderElementItems)(secondary);
|
|
68
71
|
var _blockProps$size = blockProps.size,
|
|
69
72
|
size = _blockProps$size === void 0 ? _constants.SmartLinkSize.Medium : _blockProps$size;
|
|
70
|
-
var
|
|
71
|
-
return /*#__PURE__*/
|
|
73
|
+
var maxLinesTotal = getMaxLines(maxLines);
|
|
74
|
+
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
72
75
|
testId: "".concat(testId, "-resolved-view")
|
|
73
|
-
}), primaryElements && /*#__PURE__*/
|
|
76
|
+
}), primaryElements && /*#__PURE__*/React.createElement(_elementGroup.ElementGroupNew, {
|
|
74
77
|
align: _constants.SmartLinkAlignment.Left,
|
|
75
|
-
overrideCss: elementGroupStyles,
|
|
76
78
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
77
|
-
width: _constants.SmartLinkWidth.Flexible
|
|
78
|
-
|
|
79
|
+
width: _constants.SmartLinkWidth.Flexible,
|
|
80
|
+
className: (0, _runtime.ax)([truncateStyles[maxLinesTotal], sizeStyles[size]])
|
|
81
|
+
}, primaryElements), secondaryElements && /*#__PURE__*/React.createElement(_elementGroup.ElementGroupNew, {
|
|
79
82
|
align: _constants.SmartLinkAlignment.Right,
|
|
80
|
-
overrideCss: elementGroupStyles,
|
|
81
83
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
82
|
-
width: _constants.SmartLinkWidth.Flexible
|
|
84
|
+
width: _constants.SmartLinkWidth.Flexible,
|
|
85
|
+
className: (0, _runtime.ax)([truncateStyles[maxLinesTotal], sizeStyles[size]])
|
|
83
86
|
}, secondaryElements));
|
|
84
87
|
};
|
|
85
|
-
var
|
|
88
|
+
var MetadataBlockExported = function MetadataBlockExported(props) {
|
|
89
|
+
if ((0, _platformFeatureFlags.fg)('bandicoots-compiled-migration-smartcard')) {
|
|
90
|
+
return /*#__PURE__*/React.createElement(MetadataBlock, props);
|
|
91
|
+
} else {
|
|
92
|
+
return /*#__PURE__*/React.createElement(_MetadataBlockOld.default, props);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var _default = exports.default = MetadataBlockExported;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = exports.TitleBlockErroredViewNew = void 0;
|
|
10
|
+
require("./index.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
15
|
var _reactIntlNext = require("react-intl-next");
|
|
12
16
|
var _primitives = require("@atlaskit/primitives");
|
|
13
17
|
var _constants = require("../../../../../../constants");
|
|
@@ -16,6 +20,8 @@ var _block = _interopRequireDefault(require("../../block"));
|
|
|
16
20
|
var _elementGroup = _interopRequireDefault(require("../../element-group"));
|
|
17
21
|
var _TitleBlockErroredViewOld = _interopRequireDefault(require("./TitleBlockErroredViewOld"));
|
|
18
22
|
var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
23
|
+
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); }
|
|
24
|
+
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 && {}.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; }
|
|
19
25
|
/**
|
|
20
26
|
* Represents an Errored TitleBlock view.
|
|
21
27
|
* This will render when a Smart Link did not successfully resolve.
|
|
@@ -37,20 +43,22 @@ var TitleBlockErroredViewNew = exports.TitleBlockErroredViewNew = function Title
|
|
|
37
43
|
onClick = _ref2.onClick,
|
|
38
44
|
values = _ref2.values;
|
|
39
45
|
var hasAction = onClick !== undefined;
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
testId: "".concat(testId, "-errored-view")
|
|
42
|
-
|
|
46
|
+
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
47
|
+
testId: "".concat(testId, "-errored-view"),
|
|
48
|
+
className: (0, _runtime.ax)(["_zulpu2gc"])
|
|
49
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(_elements.LinkIcon, {
|
|
43
50
|
overrideIcon: icon,
|
|
44
51
|
position: position
|
|
45
|
-
}), title, descriptor && /*#__PURE__*/
|
|
52
|
+
}), title, descriptor && /*#__PURE__*/React.createElement(_elementGroup.default, {
|
|
46
53
|
direction: _constants.SmartLinkDirection.Horizontal,
|
|
47
54
|
align: _constants.SmartLinkAlignment.Right
|
|
48
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/React.createElement(_primitives.Box, {
|
|
49
56
|
onClick: onClick,
|
|
50
57
|
testId: "".concat(testId, "-errored-view-message"),
|
|
51
58
|
tabIndex: hasAction ? 0 : -1
|
|
52
|
-
}, /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, descriptor, {
|
|
53
60
|
values: values
|
|
54
61
|
})))), actionGroup);
|
|
55
62
|
};
|
|
56
|
-
var _default = exports.default = _TitleBlockErroredViewOld.default;
|
|
63
|
+
var _default = exports.default = _TitleBlockErroredViewOld.default;
|
|
64
|
+
var titleBlockGapStyle = null;
|
package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
._zulppdf9{gap:var(--ds-space-050,.25rem)}
|
|
1
|
+
._zulppdf9{gap:var(--ds-space-050,.25rem)}
|
|
2
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
@@ -6,50 +6,68 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.default = exports.TitleBlockResolvedViewNew = void 0;
|
|
9
|
+
exports.default = exports.TitleBlockResolvedViewNew = exports.BlockFeatureGated = void 0;
|
|
10
10
|
require("./index.compiled.css");
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _constants = require("../../../../../../constants");
|
|
16
17
|
var _elements = require("../../../elements");
|
|
17
18
|
var _block = _interopRequireDefault(require("../../block"));
|
|
18
19
|
var _elementGroup = require("../../element-group");
|
|
19
20
|
var _utils = require("../../utils");
|
|
20
21
|
var _TitleBlockResolvedViewOld = _interopRequireDefault(require("./TitleBlockResolvedViewOld"));
|
|
21
|
-
var _excluded = ["
|
|
22
|
+
var _excluded = ["className"],
|
|
23
|
+
_excluded2 = ["actionGroup", "metadata", "position", "subtitle", "testId", "text", "icon", "title", "metadataPosition", "hideIcon"];
|
|
22
24
|
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
25
|
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 && {}.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
26
|
var style = null;
|
|
27
|
+
var titleBlockGapStyle = null;
|
|
28
|
+
var BlockFeatureGated = exports.BlockFeatureGated = function BlockFeatureGated(_ref) {
|
|
29
|
+
var className = _ref.className,
|
|
30
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration')) {
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- This will be deleted when cleaning the gate
|
|
33
|
+
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, props, {
|
|
34
|
+
className: className
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(_block.default, props);
|
|
38
|
+
};
|
|
25
39
|
|
|
26
40
|
/**
|
|
27
41
|
* This renders a fully resolved TitleBlock.
|
|
28
42
|
* This should render when a Smart Link returns a valid response.
|
|
29
43
|
* @see TitleBlock
|
|
30
44
|
*/
|
|
31
|
-
var TitleBlockResolvedViewNew = exports.TitleBlockResolvedViewNew = function TitleBlockResolvedViewNew(
|
|
32
|
-
var actionGroup =
|
|
33
|
-
|
|
34
|
-
metadata =
|
|
35
|
-
position =
|
|
36
|
-
|
|
37
|
-
subtitle =
|
|
38
|
-
testId =
|
|
39
|
-
text =
|
|
40
|
-
icon =
|
|
41
|
-
title =
|
|
42
|
-
metadataPosition =
|
|
43
|
-
hideIcon =
|
|
44
|
-
blockProps = (0, _objectWithoutProperties2.default)(
|
|
45
|
+
var TitleBlockResolvedViewNew = exports.TitleBlockResolvedViewNew = function TitleBlockResolvedViewNew(_ref2) {
|
|
46
|
+
var actionGroup = _ref2.actionGroup,
|
|
47
|
+
_ref2$metadata = _ref2.metadata,
|
|
48
|
+
metadata = _ref2$metadata === void 0 ? [] : _ref2$metadata,
|
|
49
|
+
position = _ref2.position,
|
|
50
|
+
_ref2$subtitle = _ref2.subtitle,
|
|
51
|
+
subtitle = _ref2$subtitle === void 0 ? [] : _ref2$subtitle,
|
|
52
|
+
testId = _ref2.testId,
|
|
53
|
+
text = _ref2.text,
|
|
54
|
+
icon = _ref2.icon,
|
|
55
|
+
title = _ref2.title,
|
|
56
|
+
metadataPosition = _ref2.metadataPosition,
|
|
57
|
+
hideIcon = _ref2.hideIcon,
|
|
58
|
+
blockProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
59
|
+
var size = blockProps.size;
|
|
45
60
|
var metadataElements = (0, _utils.renderElementItems)(metadata);
|
|
46
61
|
var subtitleElements = (0, _utils.renderElementItems)(subtitle);
|
|
47
|
-
return /*#__PURE__*/React.createElement(
|
|
48
|
-
testId: "".concat(testId, "-resolved-view")
|
|
49
|
-
|
|
62
|
+
return /*#__PURE__*/React.createElement(BlockFeatureGated, (0, _extends2.default)({}, blockProps, {
|
|
63
|
+
testId: "".concat(testId, "-resolved-view"),
|
|
64
|
+
className: (0, _runtime.ax)(["_zulpu2gc"])
|
|
65
|
+
}), !hideIcon && /*#__PURE__*/React.createElement(_elements.LinkIcon, (0, _extends2.default)({
|
|
50
66
|
overrideIcon: icon,
|
|
51
67
|
position: position
|
|
52
|
-
}
|
|
68
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') && {
|
|
69
|
+
size: size
|
|
70
|
+
})), /*#__PURE__*/React.createElement(_elementGroup.ElementGroupNew, {
|
|
53
71
|
direction: _constants.SmartLinkDirection.Vertical,
|
|
54
72
|
width: _constants.SmartLinkWidth.Flexible,
|
|
55
73
|
size: blockProps.size,
|
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = require("@emotion/react");
|
|
11
11
|
var _constants = require("../../../../../../constants");
|
|
12
|
-
var _loadingSkeleton =
|
|
12
|
+
var _loadingSkeleton = require("../../../common/loading-skeleton");
|
|
13
13
|
var _utils = require("../../../utils");
|
|
14
14
|
var _block = _interopRequireDefault(require("../../block"));
|
|
15
15
|
var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
|
|
@@ -41,7 +41,7 @@ var TitleBlockResolvingView = function TitleBlockResolvingView(_ref) {
|
|
|
41
41
|
(0, _react.jsx)("span", {
|
|
42
42
|
css: iconStyles,
|
|
43
43
|
"data-testid": "".concat(testId, "-icon")
|
|
44
|
-
}, (0, _react.jsx)(_loadingSkeleton.
|
|
44
|
+
}, (0, _react.jsx)(_loadingSkeleton.LoadingSkeletonOld, {
|
|
45
45
|
testId: "".concat(testId, "-icon-loading")
|
|
46
46
|
})), title, actionGroup);
|
|
47
47
|
};
|
package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}._16jlidpf{flex-grow:0}
|
|
2
3
|
._19l31j6v img, ._1pr21j6v span, ._1u5t1j6v svg{max-height:1rem}
|
|
3
4
|
._19l31k8s img, ._1pr21k8s span, ._1u5t1k8s svg{max-height:1.5rem}
|
|
4
5
|
._19l3oqnp img, ._1pr2oqnp span, ._1u5toqnp svg{max-height:.75rem}
|
|
@@ -12,8 +12,10 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _constants = require("../../../../../../constants");
|
|
16
|
-
var _loadingSkeleton =
|
|
17
|
+
var _loadingSkeleton = require("../../../common/loading-skeleton");
|
|
18
|
+
var _utils = require("../../../utils");
|
|
17
19
|
var _block = _interopRequireDefault(require("../../block"));
|
|
18
20
|
var _TitleBlockResolvingViewOld = _interopRequireDefault(require("./TitleBlockResolvingViewOld"));
|
|
19
21
|
var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
|
|
@@ -21,11 +23,13 @@ var _excluded = ["actionGroup", "testId", "title", "hideIcon"];
|
|
|
21
23
|
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); }
|
|
22
24
|
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 && {}.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; }
|
|
23
25
|
var iconStyle = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
xlarge: "_16jlidpf _1o9zidpf _i0dl1wug _4t3iviql _1tkeviql _c71lviql _1bsbviql _1ul9viql _p12fviql _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna7viql _1xjxviql _1752viql _qci8viql _15izviql _erubviql _19l3viql _1pr2viql _1u5tviql _mezjviql _e2ooviql _w8l5viql _1rg2viql _q7cvviql _xwbjviql _rtysviql _b8nkviql _4x20viql",
|
|
27
|
+
large: "_16jlidpf _1o9zidpf _i0dl1wug _4t3i1k8s _1tke1k8s _c71l1k8s _1bsb1k8s _1ul91k8s _p12f1k8s _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna71k8s _1xjx1k8s _17521k8s _qci81k8s _15iz1k8s _erub1k8s _19l31k8s _1pr21k8s _1u5t1k8s _mezj1k8s _e2oo1k8s _w8l51k8s _1rg21k8s _q7cv1k8s _xwbj1k8s _rtys1k8s _b8nk1k8s _4x201k8s",
|
|
28
|
+
medium: "_16jlidpf _1o9zidpf _i0dl1wug _4t3i1j6v _1tke1j6v _c71l1j6v _1bsb1j6v _1ul91j6v _p12f1j6v _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna71j6v _1xjx1j6v _17521j6v _qci81j6v _15iz1j6v _erub1j6v _19l31j6v _1pr21j6v _1u5t1j6v _mezj1j6v _e2oo1j6v _w8l51j6v _1rg21j6v _q7cv1j6v _xwbj1j6v _rtys1j6v _b8nk1j6v _4x201j6v",
|
|
29
|
+
small: "_16jlidpf _1o9zidpf _i0dl1wug _4t3ioqnp _1tkeoqnp _c71loqnp _1bsboqnp _1ul9oqnp _p12foqnp _i2i3idpf _uhasidpf _5jw9idpf _7wy9idpf _bna7oqnp _1xjxoqnp _1752oqnp _qci8oqnp _15izoqnp _eruboqnp _19l3oqnp _1pr2oqnp _1u5toqnp _mezjoqnp _e2oooqnp _w8l5oqnp _1rg2oqnp _q7cvoqnp _xwbjoqnp _rtysoqnp _b8nkoqnp _4x20oqnp"
|
|
28
30
|
};
|
|
31
|
+
var titleBlockGapStyle = null;
|
|
32
|
+
|
|
29
33
|
/**
|
|
30
34
|
* This represents a TitleBlock for a Smart Link that is currently waiting
|
|
31
35
|
* for a request to finish.
|
|
@@ -40,12 +44,29 @@ var TitleBlockResolvingViewNew = exports.TitleBlockResolvingViewNew = function T
|
|
|
40
44
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
45
|
var _blockProps$size = blockProps.size,
|
|
42
46
|
size = _blockProps$size === void 0 ? _constants.SmartLinkSize.Medium : _blockProps$size;
|
|
47
|
+
if ((0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration')) {
|
|
48
|
+
var iconWidth = (0, _utils.getIconWidthNew)(size);
|
|
49
|
+
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
50
|
+
testId: "".concat(testId, "-resolving-view"),
|
|
51
|
+
className: (0, _runtime.ax)(["_zulpu2gc"])
|
|
52
|
+
}), !hideIcon && /*#__PURE__*/React.createElement("span", {
|
|
53
|
+
style: {
|
|
54
|
+
width: iconWidth,
|
|
55
|
+
height: iconWidth
|
|
56
|
+
},
|
|
57
|
+
"data-testid": "".concat(testId, "-icon")
|
|
58
|
+
}, /*#__PURE__*/React.createElement(_loadingSkeleton.LoadingSkeletonNew, {
|
|
59
|
+
width: iconWidth,
|
|
60
|
+
height: iconWidth,
|
|
61
|
+
testId: "".concat(testId, "-icon-loading")
|
|
62
|
+
})), title, actionGroup);
|
|
63
|
+
}
|
|
43
64
|
return /*#__PURE__*/React.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
44
65
|
testId: "".concat(testId, "-resolving-view")
|
|
45
66
|
}), !hideIcon && /*#__PURE__*/React.createElement("span", {
|
|
46
67
|
"data-testid": "".concat(testId, "-icon"),
|
|
47
68
|
className: (0, _runtime.ax)([iconStyle[size]])
|
|
48
|
-
}, /*#__PURE__*/React.createElement(_loadingSkeleton.
|
|
69
|
+
}, /*#__PURE__*/React.createElement(_loadingSkeleton.LoadingSkeletonOld, {
|
|
49
70
|
testId: "".concat(testId, "-icon-loading")
|
|
50
71
|
})), title, actionGroup);
|
|
51
72
|
};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
|
11
12
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
@@ -14,6 +15,8 @@ var _2 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/blog/16"));
|
|
|
14
15
|
var _logo = require("@atlaskit/logo");
|
|
15
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
|
+
var _blogIcon = _interopRequireDefault(require("../../../../../common/ui/icons/blog-icon"));
|
|
19
|
+
var _pageIcon = _interopRequireDefault(require("../../../../../common/ui/icons/page-icon"));
|
|
17
20
|
var _constants = require("../../../../../constants");
|
|
18
21
|
var _utils = require("../../../../../utils");
|
|
19
22
|
var _importIconMapperOld;
|
|
@@ -275,9 +278,13 @@ var importIconMapperOld = (_importIconMapperOld = {}, (0, _defineProperty2.defau
|
|
|
275
278
|
return _interopRequireWildcard(require( /* webpackChunkName: "glyphSubtaskProgress" */'@atlaskit/icon/glyph/subtask'));
|
|
276
279
|
});
|
|
277
280
|
}));
|
|
278
|
-
var getIconImportFn = function getIconImportFn(icon) {
|
|
281
|
+
var getIconImportFn = function getIconImportFn(icon, size) {
|
|
279
282
|
if ((0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration')) {
|
|
280
|
-
|
|
283
|
+
var item = (0, _utils.getLazyIcons)()[icon];
|
|
284
|
+
if ((0, _utils.isIconSizeLarge)(size) && item !== null && item !== void 0 && item.large) {
|
|
285
|
+
return item.large;
|
|
286
|
+
}
|
|
287
|
+
return item === null || item === void 0 ? void 0 : item.default;
|
|
281
288
|
}
|
|
282
289
|
return importIconMapperOld[icon];
|
|
283
290
|
};
|
|
@@ -296,48 +303,67 @@ var importIcon = function importIcon(importFn) {
|
|
|
296
303
|
var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
297
304
|
var icon = _ref3.icon,
|
|
298
305
|
label = _ref3.label,
|
|
299
|
-
testId = _ref3.testId
|
|
306
|
+
testId = _ref3.testId,
|
|
307
|
+
_ref3$size = _ref3.size,
|
|
308
|
+
size = _ref3$size === void 0 ? _constants.SmartLinkSize.Medium : _ref3$size;
|
|
309
|
+
var DocumentIcon = (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') ? _pageIcon.default : _.default;
|
|
310
|
+
var BlogIcon = (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') ? _blogIcon.default : _2.default;
|
|
311
|
+
|
|
300
312
|
// Check for synchonously loaded icons first for SSR purposes
|
|
301
313
|
switch (icon) {
|
|
302
314
|
case _constants.IconType.Document:
|
|
303
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
315
|
+
return /*#__PURE__*/_react.default.createElement(DocumentIcon, (0, _extends2.default)({
|
|
304
316
|
label: label || 'document',
|
|
305
317
|
testId: testId
|
|
306
|
-
})
|
|
318
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') && {
|
|
319
|
+
size: size
|
|
320
|
+
}));
|
|
307
321
|
case _constants.IconType.Blog:
|
|
308
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
322
|
+
return /*#__PURE__*/_react.default.createElement(BlogIcon, (0, _extends2.default)({
|
|
309
323
|
label: label || 'blog',
|
|
310
324
|
testId: testId
|
|
311
|
-
})
|
|
325
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') && {
|
|
326
|
+
size: size
|
|
327
|
+
}));
|
|
312
328
|
}
|
|
313
|
-
var importFn = getIconImportFn(icon);
|
|
329
|
+
var importFn = getIconImportFn(icon, size);
|
|
314
330
|
if (!importFn) {
|
|
315
331
|
return null;
|
|
316
332
|
}
|
|
317
333
|
var ImportedIcon = importIcon(importFn);
|
|
318
334
|
switch (icon) {
|
|
319
335
|
case _constants.IconType.Confluence:
|
|
320
|
-
return /*#__PURE__*/_react.default.createElement(_logo.ConfluenceIcon, {
|
|
336
|
+
return /*#__PURE__*/_react.default.createElement(_logo.ConfluenceIcon, (0, _extends2.default)({
|
|
321
337
|
appearance: "brand",
|
|
322
338
|
testId: testId
|
|
323
|
-
})
|
|
339
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') && {
|
|
340
|
+
size: size === _constants.SmartLinkSize.Large ? 'small' : 'xsmall'
|
|
341
|
+
}));
|
|
324
342
|
case _constants.IconType.Jira:
|
|
325
|
-
return /*#__PURE__*/_react.default.createElement(_logo.JiraIcon, {
|
|
343
|
+
return /*#__PURE__*/_react.default.createElement(_logo.JiraIcon, (0, _extends2.default)({
|
|
326
344
|
appearance: "brand",
|
|
327
345
|
testId: testId
|
|
328
|
-
})
|
|
346
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') && {
|
|
347
|
+
size: size === _constants.SmartLinkSize.Large ? 'small' : 'xsmall'
|
|
348
|
+
}));
|
|
329
349
|
case _constants.IconType.Error:
|
|
330
350
|
case _constants.IconType.Forbidden:
|
|
331
|
-
return /*#__PURE__*/_react.default.createElement(ImportedIcon, {
|
|
351
|
+
return /*#__PURE__*/_react.default.createElement(ImportedIcon, (0, _extends2.default)({
|
|
332
352
|
label: label,
|
|
333
|
-
testId: testId
|
|
353
|
+
testId: testId
|
|
354
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') ? {
|
|
355
|
+
size: size,
|
|
356
|
+
color: "var(--ds-icon-danger, #C9372C)"
|
|
357
|
+
} : {
|
|
334
358
|
primaryColor: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
|
|
335
|
-
});
|
|
359
|
+
}));
|
|
336
360
|
default:
|
|
337
|
-
return /*#__PURE__*/_react.default.createElement(ImportedIcon, {
|
|
361
|
+
return /*#__PURE__*/_react.default.createElement(ImportedIcon, (0, _extends2.default)({
|
|
338
362
|
label: label,
|
|
339
363
|
testId: testId
|
|
340
|
-
})
|
|
364
|
+
}, (0, _platformFeatureFlags.fg)('platform-smart-card-icon-migration') && {
|
|
365
|
+
size: size
|
|
366
|
+
}));
|
|
341
367
|
}
|
|
342
368
|
};
|
|
343
369
|
var _default = exports.default = AtlaskitIcon;
|