@atlaskit/smart-card 26.19.0 → 26.20.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 +6 -0
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +14 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +7 -3
- package/dist/cjs/view/FlexibleCard/components/utils.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +13 -2
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +7 -3
- package/dist/es2019/view/FlexibleCard/components/utils.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/messages.js +5 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +14 -2
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +7 -3
- package/dist/esm/view/FlexibleCard/components/utils.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/avatar-group/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/utils.d.ts +1 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/avatar-group/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f2cb6463788`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f2cb6463788) - We are testing a fallback avatar in Assigned Avatar Group in Flex UI behind a feature flag. If this update is successful it will be available in a later release.
|
|
8
|
+
|
|
3
9
|
## 26.19.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/cjs/messages.js
CHANGED
|
@@ -426,6 +426,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
426
426
|
defaultMessage: "We can't display private pages",
|
|
427
427
|
description: 'Shown when a user does not have access to a link.'
|
|
428
428
|
},
|
|
429
|
+
unassigned: {
|
|
430
|
+
id: 'fabric.linking.unassigned',
|
|
431
|
+
defaultMessage: 'Unassigned',
|
|
432
|
+
description: 'Shown as a tooltip text for a default unassigned fallback avatar'
|
|
433
|
+
},
|
|
429
434
|
unlink_account: {
|
|
430
435
|
id: 'fabric.linking.unlink_account',
|
|
431
436
|
defaultMessage: 'Unlink Account',
|
|
@@ -21,7 +21,7 @@ exports.ANALYTICS_CHANNEL = ANALYTICS_CHANNEL;
|
|
|
21
21
|
var context = {
|
|
22
22
|
componentName: 'smart-cards',
|
|
23
23
|
packageName: "@atlaskit/smart-card",
|
|
24
|
-
packageVersion: "26.
|
|
24
|
+
packageVersion: "26.20.0"
|
|
25
25
|
};
|
|
26
26
|
exports.context = context;
|
|
27
27
|
var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
@@ -34,7 +34,7 @@ var baseBottomMetaData = [{
|
|
|
34
34
|
name: _constants.ElementName.ChecklistProgress
|
|
35
35
|
}];
|
|
36
36
|
var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails) {
|
|
37
|
-
var _getExtensionKey;
|
|
37
|
+
var _getExtensionKey, _data$Type$includes, _data$Type;
|
|
38
38
|
var extensionKey = (_getExtensionKey = (0, _helpers.getExtensionKey)(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
39
39
|
var data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
|
|
40
40
|
var defaultTitleMetadata = [{
|
|
@@ -58,9 +58,10 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails
|
|
|
58
58
|
bottomMetadata: defaultBottomMetadata
|
|
59
59
|
};
|
|
60
60
|
case 'jira-object-provider':
|
|
61
|
+
var isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
|
|
61
62
|
return {
|
|
62
63
|
titleMetadata: defaultTitleMetadata,
|
|
63
|
-
topMetadata:
|
|
64
|
+
topMetadata: isJiraTask ? [{
|
|
64
65
|
name: _constants.ElementName.AssignedToGroup
|
|
65
66
|
}, {
|
|
66
67
|
name: _constants.ElementName.AssignedTo
|
|
@@ -67,9 +67,21 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
67
67
|
_ref$testId = _ref.testId,
|
|
68
68
|
testId = _ref$testId === void 0 ? 'smart-element-avatar-group' : _ref$testId,
|
|
69
69
|
_ref$showNamePrefix = _ref.showNamePrefix,
|
|
70
|
-
showNamePrefix = _ref$showNamePrefix === void 0 ? false : _ref$showNamePrefix
|
|
70
|
+
showNamePrefix = _ref$showNamePrefix === void 0 ? false : _ref$showNamePrefix,
|
|
71
|
+
_ref$showFallbackAvat = _ref.showFallbackAvatar,
|
|
72
|
+
showFallbackAvatar = _ref$showFallbackAvat === void 0 ? true : _ref$showFallbackAvat;
|
|
71
73
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
72
74
|
var data = (0, _react.useMemo)(function () {
|
|
75
|
+
if (!items.length && showFallbackAvatar) {
|
|
76
|
+
switch (name) {
|
|
77
|
+
case _constants.ElementName.AssignedToGroup:
|
|
78
|
+
return [{
|
|
79
|
+
name: (0, _utils.getFormattedMessageAsString)(intl, _messages.messages.unassigned)
|
|
80
|
+
}];
|
|
81
|
+
default:
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
73
85
|
if (name && showNamePrefix) {
|
|
74
86
|
return items.map(function (person) {
|
|
75
87
|
return _objectSpread(_objectSpread({}, person), {}, {
|
|
@@ -78,7 +90,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
78
90
|
});
|
|
79
91
|
}
|
|
80
92
|
return items;
|
|
81
|
-
}, [name, items, showNamePrefix, intl]);
|
|
93
|
+
}, [name, items, showNamePrefix, showFallbackAvatar, intl]);
|
|
82
94
|
if (!data.length) {
|
|
83
95
|
return null;
|
|
84
96
|
}
|
|
@@ -147,11 +147,13 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
147
147
|
}
|
|
148
148
|
var data = context[contextKey];
|
|
149
149
|
switch (elementName) {
|
|
150
|
-
case _constants.ElementName.AuthorGroup:
|
|
151
150
|
case _constants.ElementName.AssignedToGroup:
|
|
151
|
+
case _constants.ElementName.AuthorGroup:
|
|
152
152
|
case _constants.ElementName.CollaboratorGroup:
|
|
153
153
|
case _constants.ElementName.OwnedByGroup:
|
|
154
|
-
|
|
154
|
+
var AvatarGroupsWithFallback = [_constants.ElementName.AssignedToGroup];
|
|
155
|
+
var showFallbackAvatar = AvatarGroupsWithFallback.includes(elementName);
|
|
156
|
+
return toAvatarGroupProps(data, showFallbackAvatar);
|
|
155
157
|
case _constants.ElementName.AttachmentCount:
|
|
156
158
|
case _constants.ElementName.ChecklistProgress:
|
|
157
159
|
case _constants.ElementName.CommentCount:
|
|
@@ -193,9 +195,11 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
193
195
|
return (0, _typeof2.default)(data) === 'object' ? data : undefined;
|
|
194
196
|
}
|
|
195
197
|
};
|
|
196
|
-
var toAvatarGroupProps = function toAvatarGroupProps(items) {
|
|
198
|
+
var toAvatarGroupProps = function toAvatarGroupProps(items, showFallbackAvatar) {
|
|
197
199
|
return items ? {
|
|
198
200
|
items: items
|
|
201
|
+
} : showFallbackAvatar ? {
|
|
202
|
+
items: []
|
|
199
203
|
} : undefined;
|
|
200
204
|
};
|
|
201
205
|
var toBadgeProps = function toBadgeProps(label) {
|
|
@@ -31,7 +31,7 @@ var getFormattedMessageAsString = function getFormattedMessageAsString(intl, mes
|
|
|
31
31
|
var formatMessage = intl.formatMessage;
|
|
32
32
|
return message ? formatMessage(message, {
|
|
33
33
|
context: context
|
|
34
|
-
}) :
|
|
34
|
+
}) : '';
|
|
35
35
|
};
|
|
36
36
|
exports.getFormattedMessageAsString = getFormattedMessageAsString;
|
|
37
37
|
var getIconDimensionStyles = function getIconDimensionStyles(value) {
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.
|
|
21
|
+
packageVersion: "26.20.0",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/messages.js
CHANGED
|
@@ -420,6 +420,11 @@ export const messages = defineMessages({
|
|
|
420
420
|
defaultMessage: "We can't display private pages",
|
|
421
421
|
description: 'Shown when a user does not have access to a link.'
|
|
422
422
|
},
|
|
423
|
+
unassigned: {
|
|
424
|
+
id: 'fabric.linking.unassigned',
|
|
425
|
+
defaultMessage: 'Unassigned',
|
|
426
|
+
description: 'Shown as a tooltip text for a default unassigned fallback avatar'
|
|
427
|
+
},
|
|
423
428
|
unlink_account: {
|
|
424
429
|
id: 'fabric.linking.unlink_account',
|
|
425
430
|
defaultMessage: 'Unlink Account',
|
|
@@ -3,7 +3,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
3
3
|
export const context = {
|
|
4
4
|
componentName: 'smart-cards',
|
|
5
5
|
packageName: "@atlaskit/smart-card",
|
|
6
|
-
packageVersion: "26.
|
|
6
|
+
packageVersion: "26.20.0"
|
|
7
7
|
};
|
|
8
8
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
9
9
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementName } from '../../../../../constants';
|
|
2
|
-
import { extractOwnedBy
|
|
2
|
+
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
4
4
|
const baseTopMetadata = [{
|
|
5
5
|
name: ElementName.ModifiedOn
|
|
@@ -28,7 +28,7 @@ const baseBottomMetaData = [{
|
|
|
28
28
|
name: ElementName.ChecklistProgress
|
|
29
29
|
}];
|
|
30
30
|
export const getSimulatedBetterMetadata = cardDetails => {
|
|
31
|
-
var _getExtensionKey;
|
|
31
|
+
var _getExtensionKey, _data$Type$includes, _data$Type;
|
|
32
32
|
const extensionKey = (_getExtensionKey = getExtensionKey(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
33
33
|
const data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
|
|
34
34
|
const defaultTitleMetadata = [{
|
|
@@ -52,9 +52,10 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
52
52
|
bottomMetadata: defaultBottomMetadata
|
|
53
53
|
};
|
|
54
54
|
case 'jira-object-provider':
|
|
55
|
+
const isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
|
|
55
56
|
return {
|
|
56
57
|
titleMetadata: defaultTitleMetadata,
|
|
57
|
-
topMetadata:
|
|
58
|
+
topMetadata: isJiraTask ? [{
|
|
58
59
|
name: ElementName.AssignedToGroup
|
|
59
60
|
}, {
|
|
60
61
|
name: ElementName.AssignedTo
|
|
@@ -64,10 +64,21 @@ const AvatarGroup = ({
|
|
|
64
64
|
overrideCss,
|
|
65
65
|
size = SmartLinkSize.Medium,
|
|
66
66
|
testId = 'smart-element-avatar-group',
|
|
67
|
-
showNamePrefix = false
|
|
67
|
+
showNamePrefix = false,
|
|
68
|
+
showFallbackAvatar = true
|
|
68
69
|
}) => {
|
|
69
70
|
const intl = useIntl();
|
|
70
71
|
const data = useMemo(() => {
|
|
72
|
+
if (!items.length && showFallbackAvatar) {
|
|
73
|
+
switch (name) {
|
|
74
|
+
case ElementName.AssignedToGroup:
|
|
75
|
+
return [{
|
|
76
|
+
name: getFormattedMessageAsString(intl, messages.unassigned)
|
|
77
|
+
}];
|
|
78
|
+
default:
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
71
82
|
if (name && showNamePrefix) {
|
|
72
83
|
return items.map(person => {
|
|
73
84
|
return {
|
|
@@ -77,7 +88,7 @@ const AvatarGroup = ({
|
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
90
|
return items;
|
|
80
|
-
}, [name, items, showNamePrefix, intl]);
|
|
91
|
+
}, [name, items, showNamePrefix, showFallbackAvatar, intl]);
|
|
81
92
|
if (!data.length) {
|
|
82
93
|
return null;
|
|
83
94
|
}
|
|
@@ -170,11 +170,13 @@ const getData = (elementName, contextKey, context) => {
|
|
|
170
170
|
}
|
|
171
171
|
const data = context[contextKey];
|
|
172
172
|
switch (elementName) {
|
|
173
|
-
case ElementName.AuthorGroup:
|
|
174
173
|
case ElementName.AssignedToGroup:
|
|
174
|
+
case ElementName.AuthorGroup:
|
|
175
175
|
case ElementName.CollaboratorGroup:
|
|
176
176
|
case ElementName.OwnedByGroup:
|
|
177
|
-
|
|
177
|
+
const AvatarGroupsWithFallback = [ElementName.AssignedToGroup];
|
|
178
|
+
const showFallbackAvatar = AvatarGroupsWithFallback.includes(elementName);
|
|
179
|
+
return toAvatarGroupProps(data, showFallbackAvatar);
|
|
178
180
|
case ElementName.AttachmentCount:
|
|
179
181
|
case ElementName.ChecklistProgress:
|
|
180
182
|
case ElementName.CommentCount:
|
|
@@ -216,9 +218,11 @@ const getData = (elementName, contextKey, context) => {
|
|
|
216
218
|
return typeof data === 'object' ? data : undefined;
|
|
217
219
|
}
|
|
218
220
|
};
|
|
219
|
-
const toAvatarGroupProps = items => {
|
|
221
|
+
const toAvatarGroupProps = (items, showFallbackAvatar) => {
|
|
220
222
|
return items ? {
|
|
221
223
|
items
|
|
224
|
+
} : showFallbackAvatar ? {
|
|
225
|
+
items: []
|
|
222
226
|
} : undefined;
|
|
223
227
|
};
|
|
224
228
|
const toBadgeProps = label => {
|
|
@@ -8,7 +8,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
const PACKAGE_DATA = {
|
|
10
10
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "26.
|
|
11
|
+
packageVersion: "26.20.0",
|
|
12
12
|
componentName: 'linkUrl'
|
|
13
13
|
};
|
|
14
14
|
const Link = withLinkClickedEvent('a');
|
package/dist/esm/messages.js
CHANGED
|
@@ -420,6 +420,11 @@ export var messages = defineMessages({
|
|
|
420
420
|
defaultMessage: "We can't display private pages",
|
|
421
421
|
description: 'Shown when a user does not have access to a link.'
|
|
422
422
|
},
|
|
423
|
+
unassigned: {
|
|
424
|
+
id: 'fabric.linking.unassigned',
|
|
425
|
+
defaultMessage: 'Unassigned',
|
|
426
|
+
description: 'Shown as a tooltip text for a default unassigned fallback avatar'
|
|
427
|
+
},
|
|
423
428
|
unlink_account: {
|
|
424
429
|
id: 'fabric.linking.unlink_account',
|
|
425
430
|
defaultMessage: 'Unlink Account',
|
|
@@ -13,7 +13,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
13
13
|
export var context = {
|
|
14
14
|
componentName: 'smart-cards',
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "26.
|
|
16
|
+
packageVersion: "26.20.0"
|
|
17
17
|
};
|
|
18
18
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
19
19
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementName } from '../../../../../constants';
|
|
2
|
-
import { extractOwnedBy
|
|
2
|
+
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
4
4
|
var baseTopMetadata = [{
|
|
5
5
|
name: ElementName.ModifiedOn
|
|
@@ -28,7 +28,7 @@ var baseBottomMetaData = [{
|
|
|
28
28
|
name: ElementName.ChecklistProgress
|
|
29
29
|
}];
|
|
30
30
|
export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails) {
|
|
31
|
-
var _getExtensionKey;
|
|
31
|
+
var _getExtensionKey, _data$Type$includes, _data$Type;
|
|
32
32
|
var extensionKey = (_getExtensionKey = getExtensionKey(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
33
33
|
var data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
|
|
34
34
|
var defaultTitleMetadata = [{
|
|
@@ -52,9 +52,10 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
52
52
|
bottomMetadata: defaultBottomMetadata
|
|
53
53
|
};
|
|
54
54
|
case 'jira-object-provider':
|
|
55
|
+
var isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
|
|
55
56
|
return {
|
|
56
57
|
titleMetadata: defaultTitleMetadata,
|
|
57
|
-
topMetadata:
|
|
58
|
+
topMetadata: isJiraTask ? [{
|
|
58
59
|
name: ElementName.AssignedToGroup
|
|
59
60
|
}, {
|
|
60
61
|
name: ElementName.AssignedTo
|
|
@@ -58,9 +58,21 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
58
58
|
_ref$testId = _ref.testId,
|
|
59
59
|
testId = _ref$testId === void 0 ? 'smart-element-avatar-group' : _ref$testId,
|
|
60
60
|
_ref$showNamePrefix = _ref.showNamePrefix,
|
|
61
|
-
showNamePrefix = _ref$showNamePrefix === void 0 ? false : _ref$showNamePrefix
|
|
61
|
+
showNamePrefix = _ref$showNamePrefix === void 0 ? false : _ref$showNamePrefix,
|
|
62
|
+
_ref$showFallbackAvat = _ref.showFallbackAvatar,
|
|
63
|
+
showFallbackAvatar = _ref$showFallbackAvat === void 0 ? true : _ref$showFallbackAvat;
|
|
62
64
|
var intl = useIntl();
|
|
63
65
|
var data = useMemo(function () {
|
|
66
|
+
if (!items.length && showFallbackAvatar) {
|
|
67
|
+
switch (name) {
|
|
68
|
+
case ElementName.AssignedToGroup:
|
|
69
|
+
return [{
|
|
70
|
+
name: getFormattedMessageAsString(intl, messages.unassigned)
|
|
71
|
+
}];
|
|
72
|
+
default:
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
64
76
|
if (name && showNamePrefix) {
|
|
65
77
|
return items.map(function (person) {
|
|
66
78
|
return _objectSpread(_objectSpread({}, person), {}, {
|
|
@@ -69,7 +81,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
69
81
|
});
|
|
70
82
|
}
|
|
71
83
|
return items;
|
|
72
|
-
}, [name, items, showNamePrefix, intl]);
|
|
84
|
+
}, [name, items, showNamePrefix, showFallbackAvatar, intl]);
|
|
73
85
|
if (!data.length) {
|
|
74
86
|
return null;
|
|
75
87
|
}
|
|
@@ -137,11 +137,13 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
137
137
|
}
|
|
138
138
|
var data = context[contextKey];
|
|
139
139
|
switch (elementName) {
|
|
140
|
-
case ElementName.AuthorGroup:
|
|
141
140
|
case ElementName.AssignedToGroup:
|
|
141
|
+
case ElementName.AuthorGroup:
|
|
142
142
|
case ElementName.CollaboratorGroup:
|
|
143
143
|
case ElementName.OwnedByGroup:
|
|
144
|
-
|
|
144
|
+
var AvatarGroupsWithFallback = [ElementName.AssignedToGroup];
|
|
145
|
+
var showFallbackAvatar = AvatarGroupsWithFallback.includes(elementName);
|
|
146
|
+
return toAvatarGroupProps(data, showFallbackAvatar);
|
|
145
147
|
case ElementName.AttachmentCount:
|
|
146
148
|
case ElementName.ChecklistProgress:
|
|
147
149
|
case ElementName.CommentCount:
|
|
@@ -183,9 +185,11 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
183
185
|
return _typeof(data) === 'object' ? data : undefined;
|
|
184
186
|
}
|
|
185
187
|
};
|
|
186
|
-
var toAvatarGroupProps = function toAvatarGroupProps(items) {
|
|
188
|
+
var toAvatarGroupProps = function toAvatarGroupProps(items, showFallbackAvatar) {
|
|
187
189
|
return items ? {
|
|
188
190
|
items: items
|
|
191
|
+
} : showFallbackAvatar ? {
|
|
192
|
+
items: []
|
|
189
193
|
} : undefined;
|
|
190
194
|
};
|
|
191
195
|
var toBadgeProps = function toBadgeProps(label) {
|
|
@@ -22,7 +22,7 @@ export var getFormattedMessageAsString = function getFormattedMessageAsString(in
|
|
|
22
22
|
var formatMessage = intl.formatMessage;
|
|
23
23
|
return message ? formatMessage(message, {
|
|
24
24
|
context: context
|
|
25
|
-
}) :
|
|
25
|
+
}) : '';
|
|
26
26
|
};
|
|
27
27
|
var getIconDimensionStyles = function getIconDimensionStyles(value) {
|
|
28
28
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", ";\n min-height: ", ";\n max-height: ", ";\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n"])), value, value, value, value, value, value);
|
|
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
11
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
var PACKAGE_DATA = {
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "26.
|
|
14
|
+
packageVersion: "26.20.0",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -208,6 +208,10 @@ export type AssignedToGroup = {
|
|
|
208
208
|
* Shows a name prefix Assigned To in the Avatar tooltip.
|
|
209
209
|
*/
|
|
210
210
|
showNamePrefix?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Shows a default unassigned fallback avatar when no person is assigned.
|
|
213
|
+
*/
|
|
214
|
+
showFallbackAvatar?: boolean;
|
|
211
215
|
};
|
|
212
216
|
/**
|
|
213
217
|
* Represents the props available for an ChecklistProgress element.
|
|
@@ -22,4 +22,8 @@ export type AvatarGroupProps = ElementProps & {
|
|
|
22
22
|
* Shows a name prefix in the Avatar tooltip (Created by, Assigned To, Owned by)
|
|
23
23
|
*/
|
|
24
24
|
showNamePrefix?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Shows a default fallback avatar if no persons in the AvatarGroup.
|
|
27
|
+
*/
|
|
28
|
+
showFallbackAvatar?: boolean;
|
|
25
29
|
};
|
|
@@ -8,7 +8,7 @@ import { PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
|
8
8
|
import { IntlShape, MessageDescriptor } from 'react-intl-next';
|
|
9
9
|
export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
|
|
10
10
|
export declare const getFormattedMessage: (message?: MessageProps) => JSX.Element | undefined;
|
|
11
|
-
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string
|
|
11
|
+
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string;
|
|
12
12
|
export declare const getIconSizeStyles: (width: string) => SerializedStyles;
|
|
13
13
|
export declare const getIconWidth: (size?: SmartLinkSize) => string;
|
|
14
14
|
export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_description' | 'request_denied_description';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'could_not_load_link' | 'download' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey;
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -208,6 +208,10 @@ export type AssignedToGroup = {
|
|
|
208
208
|
* Shows a name prefix Assigned To in the Avatar tooltip.
|
|
209
209
|
*/
|
|
210
210
|
showNamePrefix?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Shows a default unassigned fallback avatar when no person is assigned.
|
|
213
|
+
*/
|
|
214
|
+
showFallbackAvatar?: boolean;
|
|
211
215
|
};
|
|
212
216
|
/**
|
|
213
217
|
* Represents the props available for an ChecklistProgress element.
|
|
@@ -22,4 +22,8 @@ export type AvatarGroupProps = ElementProps & {
|
|
|
22
22
|
* Shows a name prefix in the Avatar tooltip (Created by, Assigned To, Owned by)
|
|
23
23
|
*/
|
|
24
24
|
showNamePrefix?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Shows a default fallback avatar if no persons in the AvatarGroup.
|
|
27
|
+
*/
|
|
28
|
+
showFallbackAvatar?: boolean;
|
|
25
29
|
};
|
|
@@ -8,7 +8,7 @@ import { PreviewActionData } from '../../../state/flexible-ui-context/types';
|
|
|
8
8
|
import { IntlShape, MessageDescriptor } from 'react-intl-next';
|
|
9
9
|
export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
|
|
10
10
|
export declare const getFormattedMessage: (message?: MessageProps) => JSX.Element | undefined;
|
|
11
|
-
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string
|
|
11
|
+
export declare const getFormattedMessageAsString: (intl: IntlShape, message: MessageDescriptor, context?: string) => string;
|
|
12
12
|
export declare const getIconSizeStyles: (width: string) => SerializedStyles;
|
|
13
13
|
export declare const getIconWidth: (size?: SmartLinkSize) => string;
|
|
14
14
|
export declare const getLinkLineHeight: (size: SmartLinkSize) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.20.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
48
48
|
"@atlaskit/popup": "^1.9.0",
|
|
49
49
|
"@atlaskit/spinner": "^15.5.0",
|
|
50
|
-
"@atlaskit/theme": "^12.
|
|
50
|
+
"@atlaskit/theme": "^12.6.0",
|
|
51
51
|
"@atlaskit/tokens": "^1.18.0",
|
|
52
52
|
"@atlaskit/tooltip": "^17.8.0",
|
|
53
53
|
"@atlaskit/ufo": "^0.2.0",
|
package/report.api.md
CHANGED