@atlaskit/smart-card 36.13.2 → 36.15.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 +27 -0
- package/dist/cjs/common/ui/icons/angle-brackets-icon.js +2 -1
- package/dist/cjs/common/ui/icons/audio-icon.js +2 -1
- package/dist/cjs/common/ui/icons/chart-bar-icon.js +2 -1
- package/dist/cjs/common/ui/icons/file-icon.js +2 -1
- package/dist/cjs/common/ui/icons/folder-icon.js +2 -1
- package/dist/cjs/common/ui/icons/image-icon.js +2 -1
- package/dist/cjs/common/ui/icons/list-bullet-icon.js +2 -1
- package/dist/cjs/common/ui/icons/page-icon.js +2 -1
- package/dist/cjs/common/ui/icons/utils.js +3 -1
- package/dist/cjs/common/ui/icons/video-icon.js +2 -1
- package/dist/cjs/messages.js +3 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +35 -315
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +16 -6
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.compiled.css +3 -64
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +13 -26
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +6 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +11 -0
- package/dist/cjs/view/FlexibleCard/components/utils.js +2 -25
- package/dist/cjs/view/FlexibleCard/external.js +22 -4
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +4 -3
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +4 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/common/ui/icons/angle-brackets-icon.js +3 -2
- package/dist/es2019/common/ui/icons/audio-icon.js +3 -2
- package/dist/es2019/common/ui/icons/chart-bar-icon.js +3 -2
- package/dist/es2019/common/ui/icons/file-icon.js +3 -2
- package/dist/es2019/common/ui/icons/folder-icon.js +3 -2
- package/dist/es2019/common/ui/icons/image-icon.js +3 -2
- package/dist/es2019/common/ui/icons/list-bullet-icon.js +3 -2
- package/dist/es2019/common/ui/icons/page-icon.js +3 -2
- package/dist/es2019/common/ui/icons/utils.js +3 -1
- package/dist/es2019/common/ui/icons/video-icon.js +3 -2
- package/dist/es2019/messages.js +3 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +35 -131
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +15 -6
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.compiled.css +3 -64
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +15 -28
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +5 -2
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +11 -0
- package/dist/es2019/view/FlexibleCard/components/utils.js +1 -24
- package/dist/es2019/view/FlexibleCard/external.js +27 -3
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +4 -3
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +4 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/common/ui/icons/angle-brackets-icon.js +3 -2
- package/dist/esm/common/ui/icons/audio-icon.js +3 -2
- package/dist/esm/common/ui/icons/chart-bar-icon.js +3 -2
- package/dist/esm/common/ui/icons/file-icon.js +3 -2
- package/dist/esm/common/ui/icons/folder-icon.js +3 -2
- package/dist/esm/common/ui/icons/image-icon.js +3 -2
- package/dist/esm/common/ui/icons/list-bullet-icon.js +3 -2
- package/dist/esm/common/ui/icons/page-icon.js +3 -2
- package/dist/esm/common/ui/icons/utils.js +3 -1
- package/dist/esm/common/ui/icons/video-icon.js +3 -2
- package/dist/esm/messages.js +3 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +37 -192
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +16 -6
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.compiled.css +3 -64
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +13 -26
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +6 -2
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +11 -0
- package/dist/esm/view/FlexibleCard/components/utils.js +1 -24
- package/dist/esm/view/FlexibleCard/external.js +22 -4
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +4 -3
- package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/ui/icons/utils.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/date-time/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/date-time/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/text/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/text/types.d.ts +6 -1
- package/dist/types/view/FlexibleCard/components/utils.d.ts +0 -2
- package/dist/types/view/FlexibleCard/external.d.ts +12 -3
- package/dist/types/view/HoverCard/types.d.ts +1 -0
- package/dist/types-ts4.5/common/ui/icons/utils.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/date-time/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/date-time/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/text/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/text/types.d.ts +6 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +12 -3
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +1 -0
- package/package.json +9 -6
|
@@ -24,35 +24,23 @@ var positionStyleMap = {
|
|
|
24
24
|
center: "_1wpz1h6o",
|
|
25
25
|
top: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1wpz1y6m"
|
|
26
26
|
};
|
|
27
|
-
var
|
|
28
|
-
xlarge: "
|
|
29
|
-
large: "
|
|
30
|
-
medium: "
|
|
31
|
-
small: "
|
|
32
|
-
};
|
|
33
|
-
var customRenderStyleMapOld = {
|
|
34
|
-
xlarge: "_1reo15vq _18m915vq _1e0ccj1k _1nmz1hna _1yyjkb7n _vwz4viql _1wybviql _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102kviql",
|
|
35
|
-
large: "_1reo15vq _18m915vq _1e0ccj1k _1nmz1hna _1yyjkb7n _vwz41k8s _1wyb1k8s _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102k1k8s",
|
|
36
|
-
medium: "_1reo15vq _18m915vq _1e0ccj1k _1nmz1hna _1yyjkb7n _vwz41j6v _1wyb1j6v _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102k1j6v",
|
|
37
|
-
small: "_1reo15vq _18m915vq _1e0ccj1k _1nmz1hna _1yyjkb7n _vwz4oqnp _1wyboqnp _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102koqnp"
|
|
38
|
-
};
|
|
39
|
-
var customRenderStyleMapNew = {
|
|
40
|
-
xlarge: "_1reo15vq _18m915vq _11c8nf1z _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102kz42d",
|
|
41
|
-
large: "_1reo15vq _18m915vq _11c8nf1z _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102kz42d",
|
|
42
|
-
medium: "_1reo15vq _18m915vq _11c8nbxd _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102kptym",
|
|
43
|
-
small: "_1reo15vq _18m915vq _11c8nbxd _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _102kptym"
|
|
27
|
+
var customRenderStyleMap = {
|
|
28
|
+
xlarge: "_1reo15vq _18m915vq _11c8nf1z _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _1xjx1osq _e2oo1osq _102kz42d",
|
|
29
|
+
large: "_1reo15vq _18m915vq _11c8nf1z _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _1xjx1osq _e2oo1osq _102kz42d",
|
|
30
|
+
medium: "_1reo15vq _18m915vq _11c8nbxd _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _1xjx1osq _e2oo1osq _102kptym",
|
|
31
|
+
small: "_1reo15vq _18m915vq _11c8nbxd _1e0ccj1k _1nmz1hna _1yyjkb7n _y3gn1h6o _1btozryt _sudpn7od _1ipkidpf _1kdcidpf _3glyidpf _1w2uidpf _1oh2idpf _99ztidpf _1m2uidpf _9n9oidpf _e4km1q9y _1xjx1osq _e2oo1osq _102kptym"
|
|
44
32
|
};
|
|
45
33
|
var renderAtlaskitIcon = function renderAtlaskitIcon(icon, testId) {
|
|
46
34
|
var size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SmartLinkSize.Medium;
|
|
47
35
|
if (icon) {
|
|
48
|
-
return /*#__PURE__*/React.createElement(AtlaskitIcon,
|
|
36
|
+
return /*#__PURE__*/React.createElement(AtlaskitIcon, {
|
|
49
37
|
icon: icon,
|
|
50
38
|
testId: "".concat(testId, "-icon"),
|
|
51
39
|
"aria-hidden": "true",
|
|
52
40
|
label: "" // Since we already set aria-hidden="true", the label should be given an empty string
|
|
53
|
-
|
|
41
|
+
,
|
|
54
42
|
size: size
|
|
55
|
-
})
|
|
43
|
+
});
|
|
56
44
|
}
|
|
57
45
|
};
|
|
58
46
|
var renderDefaultIcon = function renderDefaultIcon(label, testId) {
|
|
@@ -70,8 +58,7 @@ var renderImageIcon = function renderImageIcon(defaultIcon, url, testId) {
|
|
|
70
58
|
return /*#__PURE__*/React.createElement(ImageIcon, _extends({
|
|
71
59
|
defaultIcon: defaultIcon,
|
|
72
60
|
testId: testId,
|
|
73
|
-
url: url
|
|
74
|
-
}, fg('platform-smart-card-icon-migration') && {
|
|
61
|
+
url: url,
|
|
75
62
|
width: width,
|
|
76
63
|
height: width
|
|
77
64
|
}, fg('platform-linking-visual-refresh-v2') && {
|
|
@@ -105,7 +92,7 @@ var Icon = function Icon(_ref) {
|
|
|
105
92
|
appearance = _ref$appearance === void 0 ? 'square' : _ref$appearance;
|
|
106
93
|
var element = useMemo(function () {
|
|
107
94
|
var defaultIcon = renderDefaultIcon(label, testId);
|
|
108
|
-
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId,
|
|
95
|
+
return overrideIcon || (render === null || render === void 0 ? void 0 : render()) || renderImageIcon(defaultIcon, url, testId, size, fg('platform-linking-visual-refresh-v2') ? appearance : undefined) || renderAtlaskitIcon(icon, testId, size) || defaultIcon;
|
|
109
96
|
}, [label, testId, overrideIcon, render, url, size, appearance, icon]);
|
|
110
97
|
var width = getIconWidth(size);
|
|
111
98
|
return /*#__PURE__*/React.createElement("div", _extends({}, fg('platform-linking-visual-refresh-v1') ? {} : _defineProperty({}, 'data-fit-to-content', true), {
|
|
@@ -114,13 +101,13 @@ var Icon = function Icon(_ref) {
|
|
|
114
101
|
"data-testid": testId
|
|
115
102
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
116
103
|
,
|
|
117
|
-
className: ax([
|
|
118
|
-
}),
|
|
104
|
+
className: ax([styles.container, positionStyleMap[position], render && customRenderStyleMap[size], className])
|
|
105
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
119
106
|
xcss: styles.iconWrapperStyle,
|
|
120
107
|
style: {
|
|
121
108
|
width: width,
|
|
122
109
|
height: width
|
|
123
110
|
}
|
|
124
|
-
}, element)
|
|
111
|
+
}, element));
|
|
125
112
|
};
|
|
126
113
|
export default Icon;
|
|
@@ -22,11 +22,15 @@ var Text = function Text(_ref) {
|
|
|
22
22
|
name = _ref.name,
|
|
23
23
|
className = _ref.className,
|
|
24
24
|
_ref$testId = _ref.testId,
|
|
25
|
-
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId
|
|
25
|
+
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId,
|
|
26
|
+
_ref$hideFormat = _ref.hideFormat,
|
|
27
|
+
hideFormat = _ref$hideFormat === void 0 ? false : _ref$hideFormat;
|
|
26
28
|
if (!message && !content) {
|
|
27
29
|
return null;
|
|
28
30
|
}
|
|
29
31
|
var dynamicCss = null;
|
|
32
|
+
var newContent = hideFormat && content ? content : getFormattedMessage(message) || content;
|
|
33
|
+
var oldContent = getFormattedMessage(message) || content;
|
|
30
34
|
return /*#__PURE__*/React.createElement("span", {
|
|
31
35
|
"data-separator": true,
|
|
32
36
|
"data-smart-element": name,
|
|
@@ -39,6 +43,6 @@ var Text = function Text(_ref) {
|
|
|
39
43
|
"--_1erfju8": ix(maxLines),
|
|
40
44
|
"--_ohw86c": ix("calc(".concat(maxLines, " * 1rem)"))
|
|
41
45
|
}
|
|
42
|
-
},
|
|
46
|
+
}, fg('platform-linking-additional-flexible-element-props') ? newContent : oldContent);
|
|
43
47
|
};
|
|
44
48
|
export default Text;
|
|
@@ -228,6 +228,17 @@ var toDateTimeProps = function toDateTimeProps(type, dateString) {
|
|
|
228
228
|
} : undefined;
|
|
229
229
|
};
|
|
230
230
|
var toFormattedTextProps = function toFormattedTextProps(descriptor, context) {
|
|
231
|
+
if (fg('platform-linking-additional-flexible-element-props')) {
|
|
232
|
+
return context ? {
|
|
233
|
+
message: {
|
|
234
|
+
descriptor: descriptor,
|
|
235
|
+
values: {
|
|
236
|
+
context: context
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
content: context
|
|
240
|
+
} : undefined;
|
|
241
|
+
}
|
|
231
242
|
return context ? {
|
|
232
243
|
message: {
|
|
233
244
|
descriptor: descriptor,
|
|
@@ -3,7 +3,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
5
|
import Loadable from 'react-loadable';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { SmartLinkSize } from '../../../constants';
|
|
8
7
|
export var sizeToButtonSpacing = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, SmartLinkSize.Small, 'none'), SmartLinkSize.Medium, 'compact'), SmartLinkSize.Large, 'compact'), SmartLinkSize.XLarge, 'default');
|
|
9
8
|
export var getFormattedMessage = function getFormattedMessage(message) {
|
|
@@ -21,24 +20,7 @@ export var getFormattedMessageAsString = function getFormattedMessageAsString(in
|
|
|
21
20
|
context: context
|
|
22
21
|
}) : '';
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
// TODO Delete when cleaning platform-smart-card-icon-migration
|
|
26
|
-
export var getIconWidthOld = function getIconWidthOld(size) {
|
|
27
|
-
switch (size) {
|
|
28
|
-
case SmartLinkSize.XLarge:
|
|
29
|
-
return '2rem';
|
|
30
|
-
case SmartLinkSize.Large:
|
|
31
|
-
return '1.5rem';
|
|
32
|
-
case SmartLinkSize.Medium:
|
|
33
|
-
return '1rem';
|
|
34
|
-
case SmartLinkSize.Small:
|
|
35
|
-
default:
|
|
36
|
-
return '.75rem';
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// TODO Rename to getIconWidth when cleaning platform-smart-card-icon-migration
|
|
41
|
-
export var getIconWidthNew = function getIconWidthNew(size) {
|
|
23
|
+
export var getIconWidth = function getIconWidth(size) {
|
|
42
24
|
switch (size) {
|
|
43
25
|
case SmartLinkSize.XLarge:
|
|
44
26
|
case SmartLinkSize.Large:
|
|
@@ -49,11 +31,6 @@ export var getIconWidthNew = function getIconWidthNew(size) {
|
|
|
49
31
|
return "var(--ds-space-200, 16px)";
|
|
50
32
|
}
|
|
51
33
|
};
|
|
52
|
-
|
|
53
|
-
// TODO Delete when cleaning platform-smart-card-icon-migration
|
|
54
|
-
export var getIconWidth = function getIconWidth(size) {
|
|
55
|
-
return fg('platform-smart-card-icon-migration') ? getIconWidthNew(size) : getIconWidthOld(size);
|
|
56
|
-
};
|
|
57
34
|
export var importIcon = function importIcon(importFn) {
|
|
58
35
|
return Loadable({
|
|
59
36
|
loader: function loader() {
|
|
@@ -8,6 +8,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
8
8
|
* DO NOT add a new prop to these components until we are ready to support it externally.
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { SmartLinkSize } from '../../constants';
|
|
11
13
|
import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent, UnresolvedAction as UnresolvedActionComponent } from './components/actions';
|
|
12
14
|
import { AssignedTo, AssignedToGroup, AttachmentCount, AuthorGroup, ChecklistProgress, CollaboratorGroup, CommentCount, CreatedBy, CreatedOn, DueOn, LatestCommit, LinkIcon, Location, ModifiedBy, ModifiedOn, OwnedBy, OwnedByGroup, Preview, Priority, ProgrammingLanguage, Provider, ReactCount, ReadTime, SentOn, Snippet, SourceBranch, State, StoryPoints, SubscriberCount, SubTasksProgress, TargetBranch, Title, ViewCount, VoteCount } from './components/elements';
|
|
13
15
|
// ---- EXPORTED METADATA COMPONENT ---- //
|
|
@@ -44,8 +46,14 @@ export var DueOnElement = function DueOnElement() {
|
|
|
44
46
|
export var LatestCommitElement = function LatestCommitElement() {
|
|
45
47
|
return /*#__PURE__*/React.createElement(LatestCommit, null);
|
|
46
48
|
};
|
|
47
|
-
export var LinkIconElement = function LinkIconElement() {
|
|
48
|
-
|
|
49
|
+
export var LinkIconElement = function LinkIconElement(props) {
|
|
50
|
+
if (fg('platform-linking-additional-flexible-element-props')) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(LinkIcon, null);
|
|
52
|
+
}
|
|
53
|
+
return /*#__PURE__*/React.createElement(LinkIcon, {
|
|
54
|
+
size: (props === null || props === void 0 ? void 0 : props.iconTileSize) === 24 ? SmartLinkSize.Large : SmartLinkSize.Medium,
|
|
55
|
+
render: props === null || props === void 0 ? void 0 : props.render
|
|
56
|
+
});
|
|
49
57
|
};
|
|
50
58
|
export var LocationElement = function LocationElement() {
|
|
51
59
|
return /*#__PURE__*/React.createElement(Location, null);
|
|
@@ -53,10 +61,20 @@ export var LocationElement = function LocationElement() {
|
|
|
53
61
|
export var ModifiedByElement = function ModifiedByElement() {
|
|
54
62
|
return /*#__PURE__*/React.createElement(ModifiedBy, null);
|
|
55
63
|
};
|
|
56
|
-
export var ModifiedOnElement = function ModifiedOnElement() {
|
|
64
|
+
export var ModifiedOnElement = function ModifiedOnElement(props) {
|
|
65
|
+
if (fg('platform-linking-additional-flexible-element-props')) {
|
|
66
|
+
return /*#__PURE__*/React.createElement(ModifiedOn, {
|
|
67
|
+
hideDatePrefix: props === null || props === void 0 ? void 0 : props.hideDatePrefix
|
|
68
|
+
});
|
|
69
|
+
}
|
|
57
70
|
return /*#__PURE__*/React.createElement(ModifiedOn, null);
|
|
58
71
|
};
|
|
59
|
-
export var OwnedByElement = function OwnedByElement() {
|
|
72
|
+
export var OwnedByElement = function OwnedByElement(props) {
|
|
73
|
+
if (fg('platform-linking-additional-flexible-element-props')) {
|
|
74
|
+
return /*#__PURE__*/React.createElement(OwnedBy, {
|
|
75
|
+
hideFormat: props === null || props === void 0 ? void 0 : props.hidePrefix
|
|
76
|
+
});
|
|
77
|
+
}
|
|
60
78
|
return /*#__PURE__*/React.createElement(OwnedBy, null);
|
|
61
79
|
};
|
|
62
80
|
export var OwnedByGroupElement = function OwnedByGroupElement() {
|
|
@@ -210,9 +210,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
210
210
|
onMouseMove: setMousePosition,
|
|
211
211
|
onClick: onChildClick,
|
|
212
212
|
onContextMenu: onContextMenuClick,
|
|
213
|
-
"data-testid": "hover-card-trigger-wrapper"
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
"data-testid": "hover-card-trigger-wrapper"
|
|
214
|
+
}, !fg('platform_bandicoots-smart-card-disable-aria') ? {
|
|
215
|
+
'aria-label': showLabel ? formatMessage(messages.more_information_about_this_work_item) : undefined
|
|
216
|
+
} : {}, fg('fix_a11y_violation_in_hover_card_trigger') ? {
|
|
216
217
|
role: 'button'
|
|
217
218
|
} : {}), children));
|
|
218
219
|
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage, showLabel]);
|
|
@@ -73,13 +73,14 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
73
73
|
type: type
|
|
74
74
|
})), this.renderLozenge());
|
|
75
75
|
if (showHoverPreview && link) {
|
|
76
|
-
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
76
|
+
return /*#__PURE__*/React.createElement(HoverCard, _extends({
|
|
77
77
|
id: id,
|
|
78
78
|
url: link,
|
|
79
79
|
actionOptions: actionOptions,
|
|
80
|
-
hoverPreviewOptions: hoverPreviewOptions
|
|
80
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
81
|
+
}, !fg('platform_bandicoots-smart-card-disable-aria') ? {
|
|
81
82
|
showLabel: false
|
|
82
|
-
}, inlineCardResolvedView);
|
|
83
|
+
} : {}), inlineCardResolvedView);
|
|
83
84
|
}
|
|
84
85
|
return inlineCardResolvedView;
|
|
85
86
|
}
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "36.
|
|
16
|
+
packageVersion: "36.15.0",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -11,5 +11,5 @@ export declare const renderIconPerSize: (IconSmall: ComponentType<IconProps>, Ic
|
|
|
11
11
|
size?: SmartLinkSize;
|
|
12
12
|
}>;
|
|
13
13
|
type IconTileProps = ComponentPropsWithoutRef<typeof IconTile>;
|
|
14
|
-
export declare const renderIconTile: (Icon: IconTileProps['icon'], appearance: IconTileProps['appearance'], LegacyIcon?: ComponentType<
|
|
14
|
+
export declare const renderIconTile: (Icon: IconTileProps['icon'], appearance: IconTileProps['appearance'], LegacyIcon?: ComponentType<AtlaskitIconTileProps>) => React.FC<AtlaskitIconTileProps>;
|
|
15
15
|
export {};
|
|
@@ -8,5 +8,5 @@ import { type DateTimeProps } from './types';
|
|
|
8
8
|
* @see ModifiedOn
|
|
9
9
|
* @see SentOn
|
|
10
10
|
*/
|
|
11
|
-
declare const DateTime: ({ date, name, className, type, testId, text, }: DateTimeProps) => JSX.Element | null;
|
|
11
|
+
declare const DateTime: ({ date, name, className, type, testId, text, hideDatePrefix, }: DateTimeProps) => JSX.Element | null;
|
|
12
12
|
export default DateTime;
|
|
@@ -6,5 +6,5 @@ import { type TextProps } from './types';
|
|
|
6
6
|
* @param {TextProps} TextProps - The props necessary for the Text element.
|
|
7
7
|
* @see Title
|
|
8
8
|
*/
|
|
9
|
-
declare const Text: ({ content, maxLines, message, name, className, testId, }: TextProps) => JSX.Element | null;
|
|
9
|
+
declare const Text: ({ content, maxLines, message, name, className, testId, hideFormat, }: TextProps) => JSX.Element | null;
|
|
10
10
|
export default Text;
|
|
@@ -3,7 +3,7 @@ import { type ElementProps } from '../types';
|
|
|
3
3
|
export type TextProps = ElementProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Determines the formatted message (i18n) to display.
|
|
6
|
-
* If this is provided, the content prop will not be displayed.
|
|
6
|
+
* If this is provided and hideFormat is false, the content prop will not be displayed.
|
|
7
7
|
*/
|
|
8
8
|
message?: MessageProps;
|
|
9
9
|
/**
|
|
@@ -14,4 +14,9 @@ export type TextProps = ElementProps & {
|
|
|
14
14
|
* The maximum number of lines the text should span over. Maximum is 2 unless its an error message.
|
|
15
15
|
*/
|
|
16
16
|
maxLines?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Determines whether the text formatting should be hidden when both message and content are provided.
|
|
19
|
+
* If true, content will be displayed instead of the formatted message.
|
|
20
|
+
*/
|
|
21
|
+
hideFormat?: boolean;
|
|
17
22
|
};
|
|
@@ -7,8 +7,6 @@ import { type MessageProps } from './types';
|
|
|
7
7
|
export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
|
|
8
8
|
export declare const getFormattedMessage: (message?: MessageProps) => React.JSX.Element | undefined;
|
|
9
9
|
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string;
|
|
10
|
-
export declare const getIconWidthOld: (size?: SmartLinkSize) => string;
|
|
11
|
-
export declare const getIconWidthNew: (size?: SmartLinkSize) => string;
|
|
12
10
|
export declare const getIconWidth: (size?: SmartLinkSize) => string;
|
|
13
11
|
export declare const importIcon: (importFn: () => Promise<any>) => any;
|
|
14
12
|
export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.75 | 1.5;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* DO NOT add a new prop to these components until we are ready to support it externally.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import { type DateTimeProps } from './components/elements/date-time/types';
|
|
11
|
+
import { type IconProps } from './components/elements/icon/types';
|
|
10
12
|
import { type LinkProps } from './components/elements/link/types';
|
|
11
13
|
import { type TextProps } from './components/elements/text/types';
|
|
12
14
|
export declare const AssignedToElement: () => React.JSX.Element;
|
|
@@ -20,11 +22,18 @@ export declare const CreatedOnElement: () => React.JSX.Element;
|
|
|
20
22
|
export declare const CreatedByElement: () => React.JSX.Element;
|
|
21
23
|
export declare const DueOnElement: () => React.JSX.Element;
|
|
22
24
|
export declare const LatestCommitElement: () => React.JSX.Element;
|
|
23
|
-
|
|
25
|
+
type LinkIconElementProps = Pick<IconProps, 'render'> & {
|
|
26
|
+
iconTileSize?: 16 | 24;
|
|
27
|
+
};
|
|
28
|
+
export declare const LinkIconElement: (props?: LinkIconElementProps) => React.JSX.Element;
|
|
24
29
|
export declare const LocationElement: () => React.JSX.Element;
|
|
25
30
|
export declare const ModifiedByElement: () => React.JSX.Element;
|
|
26
|
-
|
|
27
|
-
export declare const
|
|
31
|
+
type ModifiedOnElementProps = Pick<DateTimeProps, 'hideDatePrefix'>;
|
|
32
|
+
export declare const ModifiedOnElement: (props?: ModifiedOnElementProps) => React.JSX.Element;
|
|
33
|
+
type OwnedByElementProps = {
|
|
34
|
+
hidePrefix?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare const OwnedByElement: (props?: OwnedByElementProps) => React.JSX.Element;
|
|
28
37
|
export declare const OwnedByGroupElement: () => React.JSX.Element;
|
|
29
38
|
export declare const PreviewElement: () => React.JSX.Element;
|
|
30
39
|
export declare const PriorityElement: () => React.JSX.Element;
|
|
@@ -11,5 +11,5 @@ export declare const renderIconPerSize: (IconSmall: ComponentType<IconProps>, Ic
|
|
|
11
11
|
size?: SmartLinkSize;
|
|
12
12
|
}>;
|
|
13
13
|
type IconTileProps = ComponentPropsWithoutRef<typeof IconTile>;
|
|
14
|
-
export declare const renderIconTile: (Icon: IconTileProps['icon'], appearance: IconTileProps['appearance'], LegacyIcon?: ComponentType<
|
|
14
|
+
export declare const renderIconTile: (Icon: IconTileProps['icon'], appearance: IconTileProps['appearance'], LegacyIcon?: ComponentType<AtlaskitIconTileProps>) => React.FC<AtlaskitIconTileProps>;
|
|
15
15
|
export {};
|
|
@@ -8,5 +8,5 @@ import { type DateTimeProps } from './types';
|
|
|
8
8
|
* @see ModifiedOn
|
|
9
9
|
* @see SentOn
|
|
10
10
|
*/
|
|
11
|
-
declare const DateTime: ({ date, name, className, type, testId, text, }: DateTimeProps) => JSX.Element | null;
|
|
11
|
+
declare const DateTime: ({ date, name, className, type, testId, text, hideDatePrefix, }: DateTimeProps) => JSX.Element | null;
|
|
12
12
|
export default DateTime;
|
|
@@ -6,5 +6,5 @@ import { type TextProps } from './types';
|
|
|
6
6
|
* @param {TextProps} TextProps - The props necessary for the Text element.
|
|
7
7
|
* @see Title
|
|
8
8
|
*/
|
|
9
|
-
declare const Text: ({ content, maxLines, message, name, className, testId, }: TextProps) => JSX.Element | null;
|
|
9
|
+
declare const Text: ({ content, maxLines, message, name, className, testId, hideFormat, }: TextProps) => JSX.Element | null;
|
|
10
10
|
export default Text;
|
|
@@ -3,7 +3,7 @@ import { type ElementProps } from '../types';
|
|
|
3
3
|
export type TextProps = ElementProps & {
|
|
4
4
|
/**
|
|
5
5
|
* Determines the formatted message (i18n) to display.
|
|
6
|
-
* If this is provided, the content prop will not be displayed.
|
|
6
|
+
* If this is provided and hideFormat is false, the content prop will not be displayed.
|
|
7
7
|
*/
|
|
8
8
|
message?: MessageProps;
|
|
9
9
|
/**
|
|
@@ -14,4 +14,9 @@ export type TextProps = ElementProps & {
|
|
|
14
14
|
* The maximum number of lines the text should span over. Maximum is 2 unless its an error message.
|
|
15
15
|
*/
|
|
16
16
|
maxLines?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Determines whether the text formatting should be hidden when both message and content are provided.
|
|
19
|
+
* If true, content will be displayed instead of the formatted message.
|
|
20
|
+
*/
|
|
21
|
+
hideFormat?: boolean;
|
|
17
22
|
};
|
|
@@ -7,8 +7,6 @@ import { type MessageProps } from './types';
|
|
|
7
7
|
export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
|
|
8
8
|
export declare const getFormattedMessage: (message?: MessageProps) => React.JSX.Element | undefined;
|
|
9
9
|
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string;
|
|
10
|
-
export declare const getIconWidthOld: (size?: SmartLinkSize) => string;
|
|
11
|
-
export declare const getIconWidthNew: (size?: SmartLinkSize) => string;
|
|
12
10
|
export declare const getIconWidth: (size?: SmartLinkSize) => string;
|
|
13
11
|
export declare const importIcon: (importFn: () => Promise<any>) => any;
|
|
14
12
|
export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.75 | 1.5;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* DO NOT add a new prop to these components until we are ready to support it externally.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import { type DateTimeProps } from './components/elements/date-time/types';
|
|
11
|
+
import { type IconProps } from './components/elements/icon/types';
|
|
10
12
|
import { type LinkProps } from './components/elements/link/types';
|
|
11
13
|
import { type TextProps } from './components/elements/text/types';
|
|
12
14
|
export declare const AssignedToElement: () => React.JSX.Element;
|
|
@@ -20,11 +22,18 @@ export declare const CreatedOnElement: () => React.JSX.Element;
|
|
|
20
22
|
export declare const CreatedByElement: () => React.JSX.Element;
|
|
21
23
|
export declare const DueOnElement: () => React.JSX.Element;
|
|
22
24
|
export declare const LatestCommitElement: () => React.JSX.Element;
|
|
23
|
-
|
|
25
|
+
type LinkIconElementProps = Pick<IconProps, 'render'> & {
|
|
26
|
+
iconTileSize?: 16 | 24;
|
|
27
|
+
};
|
|
28
|
+
export declare const LinkIconElement: (props?: LinkIconElementProps) => React.JSX.Element;
|
|
24
29
|
export declare const LocationElement: () => React.JSX.Element;
|
|
25
30
|
export declare const ModifiedByElement: () => React.JSX.Element;
|
|
26
|
-
|
|
27
|
-
export declare const
|
|
31
|
+
type ModifiedOnElementProps = Pick<DateTimeProps, 'hideDatePrefix'>;
|
|
32
|
+
export declare const ModifiedOnElement: (props?: ModifiedOnElementProps) => React.JSX.Element;
|
|
33
|
+
type OwnedByElementProps = {
|
|
34
|
+
hidePrefix?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare const OwnedByElement: (props?: OwnedByElementProps) => React.JSX.Element;
|
|
28
37
|
export declare const OwnedByGroupElement: () => React.JSX.Element;
|
|
29
38
|
export declare const PreviewElement: () => React.JSX.Element;
|
|
30
39
|
export declare const PriorityElement: () => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.15.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/popup": "^4.1.0",
|
|
63
|
-
"@atlaskit/primitives": "^14.
|
|
63
|
+
"@atlaskit/primitives": "^14.7.0",
|
|
64
64
|
"@atlaskit/section-message": "^8.2.0",
|
|
65
65
|
"@atlaskit/select": "^20.4.0",
|
|
66
66
|
"@atlaskit/spinner": "^18.0.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
97
97
|
"@atlaskit/css-reset": "^7.2.0",
|
|
98
98
|
"@atlaskit/link-test-helpers": "^8.0.0",
|
|
99
|
-
"@atlaskit/media-test-helpers": "^
|
|
99
|
+
"@atlaskit/media-test-helpers": "^36.0.0",
|
|
100
100
|
"@atlaskit/react-ufo": "^3.9.0",
|
|
101
101
|
"@atlaskit/ssr": "workspace:^",
|
|
102
102
|
"@atlaskit/visual-regression": "workspace:^",
|
|
@@ -196,9 +196,6 @@
|
|
|
196
196
|
"platform-smart-card-shift-key": {
|
|
197
197
|
"type": "boolean"
|
|
198
198
|
},
|
|
199
|
-
"platform-smart-card-icon-migration": {
|
|
200
|
-
"type": "boolean"
|
|
201
|
-
},
|
|
202
199
|
"icon-object-migration": {
|
|
203
200
|
"type": "boolean",
|
|
204
201
|
"showOnWebsiteForTransitiveDependencies": true
|
|
@@ -215,6 +212,9 @@
|
|
|
215
212
|
"fix_a11y_violation_in_hover_card_trigger": {
|
|
216
213
|
"type": "boolean"
|
|
217
214
|
},
|
|
215
|
+
"platform_bandicoots-smart-card-disable-aria": {
|
|
216
|
+
"type": "boolean"
|
|
217
|
+
},
|
|
218
218
|
"platform_smart_links_controlled_dsp_export_view": {
|
|
219
219
|
"type": "boolean"
|
|
220
220
|
},
|
|
@@ -233,6 +233,9 @@
|
|
|
233
233
|
"platform-smart-card-remove-legacy-button": {
|
|
234
234
|
"type": "boolean",
|
|
235
235
|
"showOnWebsiteForTransitiveDependencies": true
|
|
236
|
+
},
|
|
237
|
+
"platform-linking-additional-flexible-element-props": {
|
|
238
|
+
"type": "boolean"
|
|
236
239
|
}
|
|
237
240
|
}
|
|
238
241
|
}
|