@atlaskit/smart-card 36.2.1 → 36.2.3
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 +18 -0
- package/dist/cjs/constants.js +8 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +3 -1
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +7 -7
- package/dist/cjs/extractors/inline/index.js +5 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +5 -3
- package/dist/cjs/view/InlineCard/Frame/index.js +0 -1
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +2 -1
- package/dist/cjs/view/InlineCard/index.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/constants.js +8 -0
- package/dist/es2019/extractors/common/icon/extractIcon.js +3 -2
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +7 -7
- package/dist/es2019/extractors/inline/index.js +5 -5
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +4 -3
- package/dist/es2019/view/InlineCard/Frame/index.js +0 -1
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +2 -1
- package/dist/es2019/view/InlineCard/index.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/constants.js +8 -0
- package/dist/esm/extractors/common/icon/extractIcon.js +3 -1
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +7 -7
- package/dist/esm/extractors/inline/index.js +5 -3
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +5 -3
- package/dist/esm/view/InlineCard/Frame/index.js +0 -1
- package/dist/esm/view/InlineCard/ResolvedView/index.js +2 -1
- package/dist/esm/view/InlineCard/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/__fixtures__/atlas-project.d.ts +1 -1
- package/dist/types/__fixtures__/dropbox-file.d.ts +1 -1
- package/dist/types/extractors/action/types.d.ts +1 -1
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +1 -1
- package/dist/types/extractors/common/actions/extractActions.d.ts +1 -1
- package/dist/types/extractors/common/actions/types.d.ts +1 -1
- package/dist/types/extractors/common/context/extractAccessContext.d.ts +1 -1
- package/dist/types/extractors/common/download/extractDownloadUrl.d.ts +1 -1
- package/dist/types/extractors/common/icon/extractFileFormat.d.ts +1 -1
- package/dist/types/extractors/common/icon/extractIcon.d.ts +3 -2
- package/dist/types/extractors/common/icon/priority.d.ts +1 -1
- package/dist/types/extractors/common/lozenge/extractLozenge.d.ts +1 -1
- package/dist/types/extractors/common/lozenge/extractTag.d.ts +1 -1
- package/dist/types/extractors/common/lozenge/extractTaskStatus.d.ts +1 -1
- package/dist/types/extractors/common/lozenge/extractTaskType.d.ts +1 -1
- package/dist/types/extractors/common/lozenge/types.d.ts +1 -1
- package/dist/types/extractors/common/meta/extractIsSupportTheming.d.ts +1 -1
- package/dist/types/extractors/common/meta/extractIsTrusted.d.ts +1 -1
- package/dist/types/extractors/common/primitives/extractSummary.d.ts +1 -1
- package/dist/types/extractors/common/primitives/extractTitleTextColor.d.ts +1 -1
- package/dist/types/extractors/common/primitives/extractVisitUrl.d.ts +1 -1
- package/dist/types/extractors/common/title-prefix/extractTitlePrefix.d.ts +1 -1
- package/dist/types/extractors/embed/index.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/extract-ai-summary-action.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/extract-automation-action.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/extract-follow-action.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/extract-view-related-links-action.d.ts +1 -1
- package/dist/types/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types/extractors/flexible/collaboratorGroup/index.d.ts +1 -1
- package/dist/types/extractors/flexible/extract-preview.d.ts +1 -1
- package/dist/types/extractors/flexible/extract-priority.d.ts +1 -1
- package/dist/types/extractors/flexible/extract-server-action.d.ts +1 -1
- package/dist/types/extractors/flexible/extract-state.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/extract-icon-renderer.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/extract-jsonld-data-icon.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/extract-provider-icon.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/extract-url-icon.d.ts +1 -1
- package/dist/types/extractors/flexible/icon/index.d.ts +1 -1
- package/dist/types/extractors/flexible/latest-commit/index.d.ts +1 -1
- package/dist/types/extractors/flexible/utils.d.ts +1 -1
- package/dist/types/extractors/inline/index.d.ts +3 -3
- package/dist/types/model/invoke-handler.d.ts +1 -1
- package/dist/types/state/actions/index.d.ts +1 -1
- package/dist/types/state/helpers.d.ts +1 -1
- package/dist/types/state/hooks/use-response/index.d.ts +1 -1
- package/dist/types/state/hooks/useSmartLink.d.ts +1 -1
- package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/utils/ai-summary.d.ts +1 -1
- package/dist/types/utils/jsonld.d.ts +1 -1
- package/dist/types/utils/mocks.d.ts +1 -1
- package/dist/types/view/BlockCard/views/utils/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/utils.d.ts +1 -1
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types/view/HoverCard/types.d.ts +5 -1
- package/dist/types/view/HoverCard/utils.d.ts +1 -1
- package/dist/types-ts4.5/__fixtures__/atlas-project.d.ts +1 -1
- package/dist/types-ts4.5/__fixtures__/dropbox-file.d.ts +1 -1
- package/dist/types-ts4.5/extractors/action/types.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/__mocks__/jsonld.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/actions/extractActions.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/actions/types.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/context/extractAccessContext.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/download/extractDownloadUrl.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/icon/extractFileFormat.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/icon/extractIcon.d.ts +3 -2
- package/dist/types-ts4.5/extractors/common/icon/priority.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/lozenge/extractLozenge.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/lozenge/extractTag.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/lozenge/extractTaskStatus.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/lozenge/extractTaskType.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/lozenge/types.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/meta/extractIsSupportTheming.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/meta/extractIsTrusted.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/primitives/extractSummary.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/primitives/extractTitleTextColor.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/primitives/extractVisitUrl.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/title-prefix/extractTitlePrefix.d.ts +1 -1
- package/dist/types-ts4.5/extractors/embed/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-ai-summary-action.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-automation-action.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-follow-action.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-view-related-links-action.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/collaboratorGroup/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/extract-preview.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/extract-priority.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/extract-server-action.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/extract-state.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/icon/extract-icon-renderer.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/icon/extract-jsonld-data-icon.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/icon/extract-provider-icon.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/icon/extract-url-icon.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/icon/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/latest-commit/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/utils.d.ts +1 -1
- package/dist/types-ts4.5/extractors/inline/index.d.ts +3 -3
- package/dist/types-ts4.5/model/invoke-handler.d.ts +1 -1
- package/dist/types-ts4.5/state/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/state/helpers.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/use-response/index.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +1 -1
- package/dist/types-ts4.5/state/hooks-external/useSmartLinkActions.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/ai-summary.d.ts +1 -1
- package/dist/types-ts4.5/utils/jsonld.d.ts +1 -1
- package/dist/types-ts4.5/utils/mocks.d.ts +1 -1
- package/dist/types-ts4.5/view/BlockCard/views/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/utils.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +5 -1
- package/dist/types-ts4.5/view/HoverCard/utils.d.ts +1 -1
- package/package.json +6 -6
- package/report.api.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 36.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132126](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132126)
|
|
8
|
+
[`5d45dce9796da`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d45dce9796da) -
|
|
9
|
+
Updated dependency json-ld-types to @atlaskit/json-ld-types
|
|
10
|
+
- [#132869](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132869)
|
|
11
|
+
[`02c6598e7fcbd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02c6598e7fcbd) -
|
|
12
|
+
Add showLabel flag to control showing aria-labels on the inlineCard / HoverCard
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 36.2.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 36.2.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -68,11 +68,13 @@ var SmartLinkStatus = exports.SmartLinkStatus = /*#__PURE__*/function (SmartLink
|
|
|
68
68
|
* This determine the styling of the link.
|
|
69
69
|
*/
|
|
70
70
|
var SmartLinkTheme = exports.SmartLinkTheme = /*#__PURE__*/function (SmartLinkTheme) {
|
|
71
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
71
72
|
SmartLinkTheme["Black"] = "black";
|
|
72
73
|
SmartLinkTheme["Link"] = "link";
|
|
73
74
|
return SmartLinkTheme;
|
|
74
75
|
}({});
|
|
75
76
|
var SmartLinkInternalTheme = exports.SmartLinkInternalTheme = /*#__PURE__*/function (SmartLinkInternalTheme) {
|
|
77
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
76
78
|
SmartLinkInternalTheme["Grey"] = "grey";
|
|
77
79
|
return SmartLinkInternalTheme;
|
|
78
80
|
}({});
|
|
@@ -186,11 +188,13 @@ var IconType = exports.IconType = /*#__PURE__*/function (IconType) {
|
|
|
186
188
|
IconType["Spreadsheet"] = "FileType:Spreadsheet";
|
|
187
189
|
IconType["Template"] = "FileType:Template";
|
|
188
190
|
IconType["Video"] = "FileType:Video";
|
|
191
|
+
// BitBucket?
|
|
189
192
|
IconType["Branch"] = "BitBucket:Branch";
|
|
190
193
|
IconType["Commit"] = "BitBucket:Commit";
|
|
191
194
|
IconType["Project"] = "BitBucket:Project";
|
|
192
195
|
IconType["PullRequest"] = "BitBucket:PullRequest";
|
|
193
196
|
IconType["Repo"] = "BitBucket:Repo";
|
|
197
|
+
// Jira?
|
|
194
198
|
IconType["Bug"] = "Jira:Bug";
|
|
195
199
|
IconType["Change"] = "Jira:Change";
|
|
196
200
|
IconType["Epic"] = "Jira:Epic";
|
|
@@ -200,12 +204,16 @@ var IconType = exports.IconType = /*#__PURE__*/function (IconType) {
|
|
|
200
204
|
IconType["Story"] = "Jira:Story";
|
|
201
205
|
IconType["SubTask"] = "Jira:SubTask";
|
|
202
206
|
IconType["Task"] = "Jira:Task";
|
|
207
|
+
// Confluence
|
|
203
208
|
IconType["LiveDocument"] = "Confluence:LiveDocument";
|
|
209
|
+
// Provider
|
|
204
210
|
IconType["Confluence"] = "Provider:Confluence";
|
|
205
211
|
IconType["Jira"] = "Provider:Jira";
|
|
212
|
+
// Fallback
|
|
206
213
|
IconType["Default"] = "Default";
|
|
207
214
|
IconType["Error"] = "Default:Error";
|
|
208
215
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
216
|
+
// Badge
|
|
209
217
|
IconType["Attachment"] = "Badge:Attachment";
|
|
210
218
|
IconType["CheckItem"] = "Badge:Task";
|
|
211
219
|
IconType["Comment"] = "Badge:Comment";
|
|
@@ -22,6 +22,7 @@ var _prioritiseIcon = require("./prioritiseIcon");
|
|
|
22
22
|
var _priority = require("./priority");
|
|
23
23
|
var extractIcon = exports.extractIcon = function extractIcon(jsonLd) {
|
|
24
24
|
var priority = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'type';
|
|
25
|
+
var showIconLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
25
26
|
var type = jsonLd['@type'];
|
|
26
27
|
var opts = {
|
|
27
28
|
title: (0, _linkExtractors.extractTitle)(jsonLd),
|
|
@@ -29,7 +30,8 @@ var extractIcon = exports.extractIcon = function extractIcon(jsonLd) {
|
|
|
29
30
|
fileFormat: (0, _extractFileFormat.extractFileFormat)(jsonLd),
|
|
30
31
|
taskType: (0, _extractTaskType.extractTaskType)(jsonLd),
|
|
31
32
|
icon: jsonLd.icon && (0, _linkExtractors.extractUrlFromIconJsonLd)(jsonLd.icon),
|
|
32
|
-
priority: priority
|
|
33
|
+
priority: priority,
|
|
34
|
+
showIconLabel: showIconLabel
|
|
33
35
|
};
|
|
34
36
|
if (Array.isArray(type)) {
|
|
35
37
|
var highestPriorityType = type.sort(function (a, b) {
|
|
@@ -97,35 +97,35 @@ var documentTypeToIcon = function documentTypeToIcon(type, opts) {
|
|
|
97
97
|
switch (type) {
|
|
98
98
|
case 'schema:BlogPosting':
|
|
99
99
|
return /*#__PURE__*/_react.default.createElement(BlogIcon, {
|
|
100
|
-
label: opts.title || 'blog',
|
|
100
|
+
label: opts.showIconLabel ? opts.title || 'blog' : '',
|
|
101
101
|
testId: "blog-icon"
|
|
102
102
|
});
|
|
103
103
|
case 'schema:DigitalDocument':
|
|
104
104
|
return digitalDocumentToIcon(opts);
|
|
105
105
|
case 'schema:TextDigitalDocument':
|
|
106
106
|
return /*#__PURE__*/_react.default.createElement(DocumentIcon, {
|
|
107
|
-
label: opts.title || 'document',
|
|
107
|
+
label: opts.showIconLabel ? opts.title || 'document' : '',
|
|
108
108
|
testId: "document-icon"
|
|
109
109
|
});
|
|
110
110
|
case 'schema:PresentationDigitalDocument':
|
|
111
111
|
return /*#__PURE__*/_react.default.createElement(PresentationIcon, {
|
|
112
|
-
label: opts.title || 'presentation',
|
|
112
|
+
label: opts.showIconLabel ? opts.title || 'presentation' : '',
|
|
113
113
|
testId: "presentation-icon"
|
|
114
114
|
});
|
|
115
115
|
case 'schema:SpreadsheetDigitalDocument':
|
|
116
116
|
return /*#__PURE__*/_react.default.createElement(SpreadsheetIcon, {
|
|
117
|
-
label: opts.title || 'spreadsheet',
|
|
117
|
+
label: opts.showIconLabel ? opts.title || 'spreadsheet' : '',
|
|
118
118
|
testId: "spreadsheet-icon"
|
|
119
119
|
});
|
|
120
120
|
case 'atlassian:Template':
|
|
121
121
|
return /*#__PURE__*/_react.default.createElement(DocumentFilledIcon, {
|
|
122
122
|
color: "currentColor",
|
|
123
|
-
label: opts.title || 'template',
|
|
123
|
+
label: opts.showIconLabel ? opts.title || 'template' : '',
|
|
124
124
|
testId: "document-filled-icon"
|
|
125
125
|
});
|
|
126
126
|
case 'atlassian:UndefinedLink':
|
|
127
127
|
return /*#__PURE__*/_react.default.createElement(DocumentIcon, {
|
|
128
|
-
label: opts.title || 'undefinedLink',
|
|
128
|
+
label: opts.showIconLabel ? opts.title || 'undefinedLink' : '',
|
|
129
129
|
testId: "document-icon"
|
|
130
130
|
});
|
|
131
131
|
}
|
|
@@ -148,7 +148,7 @@ var digitalDocumentToIcon = function digitalDocumentToIcon(opts) {
|
|
|
148
148
|
});
|
|
149
149
|
} else {
|
|
150
150
|
return /*#__PURE__*/_react.default.createElement(FileIcon, {
|
|
151
|
-
label: opts.title || 'file',
|
|
151
|
+
label: opts.showIconLabel ? opts.title || 'file' : '',
|
|
152
152
|
testId: "file-icon"
|
|
153
153
|
});
|
|
154
154
|
}
|
|
@@ -11,20 +11,22 @@ var _primitives = require("../common/primitives");
|
|
|
11
11
|
var _titlePrefix = require("../common/title-prefix");
|
|
12
12
|
var _constants = require("../constants");
|
|
13
13
|
var extractInlineIcon = exports.extractInlineIcon = function extractInlineIcon(jsonLd) {
|
|
14
|
+
var showIconLabel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
14
15
|
var provider = (0, _linkExtractors.extractProvider)(jsonLd);
|
|
15
16
|
if (provider && provider.id) {
|
|
16
17
|
if (provider.id === _constants.CONFLUENCE_GENERATOR_ID || provider.id === _constants.JIRA_GENERATOR_ID) {
|
|
17
|
-
return (0, _icon.extractIcon)(jsonLd);
|
|
18
|
+
return (0, _icon.extractIcon)(jsonLd, 'type', showIconLabel);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
return (0, _icon.extractIcon)(jsonLd, 'provider');
|
|
21
|
+
return (0, _icon.extractIcon)(jsonLd, 'provider', showIconLabel);
|
|
21
22
|
};
|
|
22
23
|
var extractInlineProps = exports.extractInlineProps = function extractInlineProps(jsonLd, renderers, removeTextHighlightingFromTitle) {
|
|
24
|
+
var showLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
23
25
|
return {
|
|
24
26
|
link: (0, _linkExtractors.extractLink)(jsonLd),
|
|
25
27
|
title: (0, _linkExtractors.extractTitle)(jsonLd, removeTextHighlightingFromTitle),
|
|
26
28
|
lozenge: (0, _lozenge.extractLozenge)(jsonLd),
|
|
27
|
-
icon: extractInlineIcon(jsonLd),
|
|
29
|
+
icon: extractInlineIcon(jsonLd, showLabel),
|
|
28
30
|
titleTextColor: (0, _primitives.extractTitleTextColor)(jsonLd),
|
|
29
31
|
titlePrefix: (0, _titlePrefix.extractTitlePrefix)(jsonLd, renderers, 'inline')
|
|
30
32
|
};
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "36.2.
|
|
14
|
+
packageVersion: "36.2.3"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -49,7 +49,9 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
49
49
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
50
50
|
role = _ref.role,
|
|
51
51
|
label = _ref.label,
|
|
52
|
-
titleId = _ref.titleId
|
|
52
|
+
titleId = _ref.titleId,
|
|
53
|
+
_ref$showLabel = _ref.showLabel,
|
|
54
|
+
showLabel = _ref$showLabel === void 0 ? true : _ref$showLabel;
|
|
53
55
|
var fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
54
56
|
var _React$useState = _react.default.useState(false),
|
|
55
57
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
@@ -219,11 +221,11 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
219
221
|
onClick: onChildClick,
|
|
220
222
|
onContextMenu: onContextMenuClick,
|
|
221
223
|
"data-testid": "hover-card-trigger-wrapper",
|
|
222
|
-
"aria-label": formatMessage(_messages.messages.more_information_about_this_work_item)
|
|
224
|
+
"aria-label": showLabel ? formatMessage(_messages.messages.more_information_about_this_work_item) : undefined
|
|
223
225
|
}, (0, _platformFeatureFlags.fg)('fix_a11y_violation_in_hover_card_trigger') ? {
|
|
224
226
|
role: 'button'
|
|
225
227
|
} : {}), children));
|
|
226
|
-
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage]);
|
|
228
|
+
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage, showLabel]);
|
|
227
229
|
return /*#__PURE__*/_react.default.createElement(_popup.default, {
|
|
228
230
|
testId: "hover-card",
|
|
229
231
|
isOpen: isOpen && canOpen,
|
|
@@ -49,7 +49,6 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
49
49
|
isSelected: isSelected,
|
|
50
50
|
isInteractive: isInteractive,
|
|
51
51
|
tabIndex: isInteractive ? 0 : undefined,
|
|
52
|
-
"aria-label": isAnchor ? link !== null && link !== void 0 ? link : 'Link' : undefined,
|
|
53
52
|
role: isInteractive ? 'button' : undefined,
|
|
54
53
|
onClick: handleClick,
|
|
55
54
|
onMouseDown: handleMouseDown,
|
|
@@ -80,7 +80,8 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
80
80
|
id: id,
|
|
81
81
|
url: link,
|
|
82
82
|
actionOptions: actionOptions,
|
|
83
|
-
hoverPreviewOptions: hoverPreviewOptions
|
|
83
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
84
|
+
showLabel: false
|
|
84
85
|
}, inlineCardResolvedView);
|
|
85
86
|
}
|
|
86
87
|
return inlineCardResolvedView;
|
|
@@ -85,7 +85,7 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
85
85
|
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
86
86
|
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
87
87
|
}
|
|
88
|
-
var resolvedProps = status === _constants.SmartLinkStatus.Resolved ? (0, _inline.extractInlineProps)(cardDetails, renderers, removeTextHighlightingFromTitle) : {};
|
|
88
|
+
var resolvedProps = status === _constants.SmartLinkStatus.Resolved ? (0, _inline.extractInlineProps)(cardDetails, renderers, removeTextHighlightingFromTitle, false) : {};
|
|
89
89
|
(0, _react.useEffect)(function () {
|
|
90
90
|
switch (status) {
|
|
91
91
|
case _constants.SmartLinkStatus.Resolved:
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "36.2.
|
|
23
|
+
packageVersion: "36.2.3",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/constants.js
CHANGED
|
@@ -67,11 +67,13 @@ export let SmartLinkStatus = /*#__PURE__*/function (SmartLinkStatus) {
|
|
|
67
67
|
* This determine the styling of the link.
|
|
68
68
|
*/
|
|
69
69
|
export let SmartLinkTheme = /*#__PURE__*/function (SmartLinkTheme) {
|
|
70
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
70
71
|
SmartLinkTheme["Black"] = "black";
|
|
71
72
|
SmartLinkTheme["Link"] = "link";
|
|
72
73
|
return SmartLinkTheme;
|
|
73
74
|
}({});
|
|
74
75
|
export let SmartLinkInternalTheme = /*#__PURE__*/function (SmartLinkInternalTheme) {
|
|
76
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
75
77
|
SmartLinkInternalTheme["Grey"] = "grey";
|
|
76
78
|
return SmartLinkInternalTheme;
|
|
77
79
|
}({});
|
|
@@ -189,11 +191,13 @@ export let IconType = /*#__PURE__*/function (IconType) {
|
|
|
189
191
|
IconType["Spreadsheet"] = "FileType:Spreadsheet";
|
|
190
192
|
IconType["Template"] = "FileType:Template";
|
|
191
193
|
IconType["Video"] = "FileType:Video";
|
|
194
|
+
// BitBucket?
|
|
192
195
|
IconType["Branch"] = "BitBucket:Branch";
|
|
193
196
|
IconType["Commit"] = "BitBucket:Commit";
|
|
194
197
|
IconType["Project"] = "BitBucket:Project";
|
|
195
198
|
IconType["PullRequest"] = "BitBucket:PullRequest";
|
|
196
199
|
IconType["Repo"] = "BitBucket:Repo";
|
|
200
|
+
// Jira?
|
|
197
201
|
IconType["Bug"] = "Jira:Bug";
|
|
198
202
|
IconType["Change"] = "Jira:Change";
|
|
199
203
|
IconType["Epic"] = "Jira:Epic";
|
|
@@ -203,12 +207,16 @@ export let IconType = /*#__PURE__*/function (IconType) {
|
|
|
203
207
|
IconType["Story"] = "Jira:Story";
|
|
204
208
|
IconType["SubTask"] = "Jira:SubTask";
|
|
205
209
|
IconType["Task"] = "Jira:Task";
|
|
210
|
+
// Confluence
|
|
206
211
|
IconType["LiveDocument"] = "Confluence:LiveDocument";
|
|
212
|
+
// Provider
|
|
207
213
|
IconType["Confluence"] = "Provider:Confluence";
|
|
208
214
|
IconType["Jira"] = "Provider:Jira";
|
|
215
|
+
// Fallback
|
|
209
216
|
IconType["Default"] = "Default";
|
|
210
217
|
IconType["Error"] = "Default:Error";
|
|
211
218
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
219
|
+
// Badge
|
|
212
220
|
IconType["Attachment"] = "Badge:Attachment";
|
|
213
221
|
IconType["CheckItem"] = "Badge:Task";
|
|
214
222
|
IconType["Comment"] = "Badge:Comment";
|
|
@@ -13,7 +13,7 @@ import { extractIconFromDocument } from './extractIconFromDocument';
|
|
|
13
13
|
import { extractIconFromTask } from './extractIconFromTask';
|
|
14
14
|
import { prioritiseIcon } from './prioritiseIcon';
|
|
15
15
|
import { extractorPriorityMap } from './priority';
|
|
16
|
-
export const extractIcon = (jsonLd, priority = 'type') => {
|
|
16
|
+
export const extractIcon = (jsonLd, priority = 'type', showIconLabel = true) => {
|
|
17
17
|
const type = jsonLd['@type'];
|
|
18
18
|
const opts = {
|
|
19
19
|
title: extractTitle(jsonLd),
|
|
@@ -21,7 +21,8 @@ export const extractIcon = (jsonLd, priority = 'type') => {
|
|
|
21
21
|
fileFormat: extractFileFormat(jsonLd),
|
|
22
22
|
taskType: extractTaskType(jsonLd),
|
|
23
23
|
icon: jsonLd.icon && extractUrlFromIconJsonLd(jsonLd.icon),
|
|
24
|
-
priority
|
|
24
|
+
priority,
|
|
25
|
+
showIconLabel
|
|
25
26
|
};
|
|
26
27
|
if (Array.isArray(type)) {
|
|
27
28
|
const highestPriorityType = type.sort((a, b) => extractorPriorityMap[b] - extractorPriorityMap[a])[0];
|
|
@@ -91,35 +91,35 @@ const documentTypeToIcon = (type, opts) => {
|
|
|
91
91
|
switch (type) {
|
|
92
92
|
case 'schema:BlogPosting':
|
|
93
93
|
return /*#__PURE__*/React.createElement(BlogIcon, {
|
|
94
|
-
label: opts.title || 'blog',
|
|
94
|
+
label: opts.showIconLabel ? opts.title || 'blog' : '',
|
|
95
95
|
testId: "blog-icon"
|
|
96
96
|
});
|
|
97
97
|
case 'schema:DigitalDocument':
|
|
98
98
|
return digitalDocumentToIcon(opts);
|
|
99
99
|
case 'schema:TextDigitalDocument':
|
|
100
100
|
return /*#__PURE__*/React.createElement(DocumentIcon, {
|
|
101
|
-
label: opts.title || 'document',
|
|
101
|
+
label: opts.showIconLabel ? opts.title || 'document' : '',
|
|
102
102
|
testId: "document-icon"
|
|
103
103
|
});
|
|
104
104
|
case 'schema:PresentationDigitalDocument':
|
|
105
105
|
return /*#__PURE__*/React.createElement(PresentationIcon, {
|
|
106
|
-
label: opts.title || 'presentation',
|
|
106
|
+
label: opts.showIconLabel ? opts.title || 'presentation' : '',
|
|
107
107
|
testId: "presentation-icon"
|
|
108
108
|
});
|
|
109
109
|
case 'schema:SpreadsheetDigitalDocument':
|
|
110
110
|
return /*#__PURE__*/React.createElement(SpreadsheetIcon, {
|
|
111
|
-
label: opts.title || 'spreadsheet',
|
|
111
|
+
label: opts.showIconLabel ? opts.title || 'spreadsheet' : '',
|
|
112
112
|
testId: "spreadsheet-icon"
|
|
113
113
|
});
|
|
114
114
|
case 'atlassian:Template':
|
|
115
115
|
return /*#__PURE__*/React.createElement(DocumentFilledIcon, {
|
|
116
116
|
color: "currentColor",
|
|
117
|
-
label: opts.title || 'template',
|
|
117
|
+
label: opts.showIconLabel ? opts.title || 'template' : '',
|
|
118
118
|
testId: "document-filled-icon"
|
|
119
119
|
});
|
|
120
120
|
case 'atlassian:UndefinedLink':
|
|
121
121
|
return /*#__PURE__*/React.createElement(DocumentIcon, {
|
|
122
|
-
label: opts.title || 'undefinedLink',
|
|
122
|
+
label: opts.showIconLabel ? opts.title || 'undefinedLink' : '',
|
|
123
123
|
testId: "document-icon"
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -142,7 +142,7 @@ const digitalDocumentToIcon = opts => {
|
|
|
142
142
|
});
|
|
143
143
|
} else {
|
|
144
144
|
return /*#__PURE__*/React.createElement(FileIcon, {
|
|
145
|
-
label: opts.title || 'file',
|
|
145
|
+
label: opts.showIconLabel ? opts.title || 'file' : '',
|
|
146
146
|
testId: "file-icon"
|
|
147
147
|
});
|
|
148
148
|
}
|
|
@@ -4,20 +4,20 @@ import { extractLozenge } from '../common/lozenge';
|
|
|
4
4
|
import { extractTitleTextColor } from '../common/primitives';
|
|
5
5
|
import { extractTitlePrefix } from '../common/title-prefix';
|
|
6
6
|
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../constants';
|
|
7
|
-
export const extractInlineIcon = jsonLd => {
|
|
7
|
+
export const extractInlineIcon = (jsonLd, showIconLabel = true) => {
|
|
8
8
|
const provider = extractProvider(jsonLd);
|
|
9
9
|
if (provider && provider.id) {
|
|
10
10
|
if (provider.id === CONFLUENCE_GENERATOR_ID || provider.id === JIRA_GENERATOR_ID) {
|
|
11
|
-
return extractIcon(jsonLd);
|
|
11
|
+
return extractIcon(jsonLd, 'type', showIconLabel);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
return extractIcon(jsonLd, 'provider');
|
|
14
|
+
return extractIcon(jsonLd, 'provider', showIconLabel);
|
|
15
15
|
};
|
|
16
|
-
export const extractInlineProps = (jsonLd, renderers, removeTextHighlightingFromTitle) => ({
|
|
16
|
+
export const extractInlineProps = (jsonLd, renderers, removeTextHighlightingFromTitle, showLabel = true) => ({
|
|
17
17
|
link: extractLink(jsonLd),
|
|
18
18
|
title: extractTitle(jsonLd, removeTextHighlightingFromTitle),
|
|
19
19
|
lozenge: extractLozenge(jsonLd),
|
|
20
|
-
icon: extractInlineIcon(jsonLd),
|
|
20
|
+
icon: extractInlineIcon(jsonLd, showLabel),
|
|
21
21
|
titleTextColor: extractTitleTextColor(jsonLd),
|
|
22
22
|
titlePrefix: extractTitlePrefix(jsonLd, renderers, 'inline')
|
|
23
23
|
});
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "36.2.
|
|
5
|
+
packageVersion: "36.2.3"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -29,7 +29,8 @@ export const HoverCardComponent = ({
|
|
|
29
29
|
hoverPreviewOptions,
|
|
30
30
|
role,
|
|
31
31
|
label,
|
|
32
|
-
titleId
|
|
32
|
+
titleId,
|
|
33
|
+
showLabel = true
|
|
33
34
|
}) => {
|
|
34
35
|
var _hoverPreviewOptions$;
|
|
35
36
|
const fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
@@ -196,10 +197,10 @@ export const HoverCardComponent = ({
|
|
|
196
197
|
onClick: onChildClick,
|
|
197
198
|
onContextMenu: onContextMenuClick,
|
|
198
199
|
"data-testid": "hover-card-trigger-wrapper",
|
|
199
|
-
"aria-label": formatMessage(messages.more_information_about_this_work_item)
|
|
200
|
+
"aria-label": showLabel ? formatMessage(messages.more_information_about_this_work_item) : undefined
|
|
200
201
|
}, fg('fix_a11y_violation_in_hover_card_trigger') ? {
|
|
201
202
|
role: 'button'
|
|
202
|
-
} : {}), children)), [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage]);
|
|
203
|
+
} : {}), children)), [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage, showLabel]);
|
|
203
204
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
204
205
|
testId: "hover-card",
|
|
205
206
|
isOpen: isOpen && canOpen,
|
|
@@ -42,7 +42,6 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
42
42
|
isSelected: isSelected,
|
|
43
43
|
isInteractive: isInteractive,
|
|
44
44
|
tabIndex: isInteractive ? 0 : undefined,
|
|
45
|
-
"aria-label": isAnchor ? link !== null && link !== void 0 ? link : 'Link' : undefined,
|
|
46
45
|
role: isInteractive ? 'button' : undefined,
|
|
47
46
|
onClick: handleClick,
|
|
48
47
|
onMouseDown: handleMouseDown,
|
|
@@ -57,7 +57,8 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
57
57
|
id: id,
|
|
58
58
|
url: link,
|
|
59
59
|
actionOptions: actionOptions,
|
|
60
|
-
hoverPreviewOptions: hoverPreviewOptions
|
|
60
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
61
|
+
showLabel: false
|
|
61
62
|
}, inlineCardResolvedView);
|
|
62
63
|
}
|
|
63
64
|
return inlineCardResolvedView;
|
|
@@ -50,7 +50,7 @@ export const InlineCard = ({
|
|
|
50
50
|
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
51
51
|
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
52
52
|
}
|
|
53
|
-
const resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers, removeTextHighlightingFromTitle) : {};
|
|
53
|
+
const resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers, removeTextHighlightingFromTitle, false) : {};
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
switch (status) {
|
|
56
56
|
case SmartLinkStatus.Resolved:
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "36.2.
|
|
13
|
+
packageVersion: "36.2.3",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
package/dist/esm/constants.js
CHANGED
|
@@ -67,11 +67,13 @@ export var SmartLinkStatus = /*#__PURE__*/function (SmartLinkStatus) {
|
|
|
67
67
|
* This determine the styling of the link.
|
|
68
68
|
*/
|
|
69
69
|
export var SmartLinkTheme = /*#__PURE__*/function (SmartLinkTheme) {
|
|
70
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
70
71
|
SmartLinkTheme["Black"] = "black";
|
|
71
72
|
SmartLinkTheme["Link"] = "link";
|
|
72
73
|
return SmartLinkTheme;
|
|
73
74
|
}({});
|
|
74
75
|
export var SmartLinkInternalTheme = /*#__PURE__*/function (SmartLinkInternalTheme) {
|
|
76
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
75
77
|
SmartLinkInternalTheme["Grey"] = "grey";
|
|
76
78
|
return SmartLinkInternalTheme;
|
|
77
79
|
}({});
|
|
@@ -189,11 +191,13 @@ export var IconType = /*#__PURE__*/function (IconType) {
|
|
|
189
191
|
IconType["Spreadsheet"] = "FileType:Spreadsheet";
|
|
190
192
|
IconType["Template"] = "FileType:Template";
|
|
191
193
|
IconType["Video"] = "FileType:Video";
|
|
194
|
+
// BitBucket?
|
|
192
195
|
IconType["Branch"] = "BitBucket:Branch";
|
|
193
196
|
IconType["Commit"] = "BitBucket:Commit";
|
|
194
197
|
IconType["Project"] = "BitBucket:Project";
|
|
195
198
|
IconType["PullRequest"] = "BitBucket:PullRequest";
|
|
196
199
|
IconType["Repo"] = "BitBucket:Repo";
|
|
200
|
+
// Jira?
|
|
197
201
|
IconType["Bug"] = "Jira:Bug";
|
|
198
202
|
IconType["Change"] = "Jira:Change";
|
|
199
203
|
IconType["Epic"] = "Jira:Epic";
|
|
@@ -203,12 +207,16 @@ export var IconType = /*#__PURE__*/function (IconType) {
|
|
|
203
207
|
IconType["Story"] = "Jira:Story";
|
|
204
208
|
IconType["SubTask"] = "Jira:SubTask";
|
|
205
209
|
IconType["Task"] = "Jira:Task";
|
|
210
|
+
// Confluence
|
|
206
211
|
IconType["LiveDocument"] = "Confluence:LiveDocument";
|
|
212
|
+
// Provider
|
|
207
213
|
IconType["Confluence"] = "Provider:Confluence";
|
|
208
214
|
IconType["Jira"] = "Provider:Jira";
|
|
215
|
+
// Fallback
|
|
209
216
|
IconType["Default"] = "Default";
|
|
210
217
|
IconType["Error"] = "Default:Error";
|
|
211
218
|
IconType["Forbidden"] = "Default:Forbidden";
|
|
219
|
+
// Badge
|
|
212
220
|
IconType["Attachment"] = "Badge:Attachment";
|
|
213
221
|
IconType["CheckItem"] = "Badge:Task";
|
|
214
222
|
IconType["Comment"] = "Badge:Comment";
|
|
@@ -15,6 +15,7 @@ import { prioritiseIcon } from './prioritiseIcon';
|
|
|
15
15
|
import { extractorPriorityMap } from './priority';
|
|
16
16
|
export var extractIcon = function extractIcon(jsonLd) {
|
|
17
17
|
var priority = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'type';
|
|
18
|
+
var showIconLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
18
19
|
var type = jsonLd['@type'];
|
|
19
20
|
var opts = {
|
|
20
21
|
title: extractTitle(jsonLd),
|
|
@@ -22,7 +23,8 @@ export var extractIcon = function extractIcon(jsonLd) {
|
|
|
22
23
|
fileFormat: extractFileFormat(jsonLd),
|
|
23
24
|
taskType: extractTaskType(jsonLd),
|
|
24
25
|
icon: jsonLd.icon && extractUrlFromIconJsonLd(jsonLd.icon),
|
|
25
|
-
priority: priority
|
|
26
|
+
priority: priority,
|
|
27
|
+
showIconLabel: showIconLabel
|
|
26
28
|
};
|
|
27
29
|
if (Array.isArray(type)) {
|
|
28
30
|
var highestPriorityType = type.sort(function (a, b) {
|
|
@@ -91,35 +91,35 @@ var documentTypeToIcon = function documentTypeToIcon(type, opts) {
|
|
|
91
91
|
switch (type) {
|
|
92
92
|
case 'schema:BlogPosting':
|
|
93
93
|
return /*#__PURE__*/React.createElement(BlogIcon, {
|
|
94
|
-
label: opts.title || 'blog',
|
|
94
|
+
label: opts.showIconLabel ? opts.title || 'blog' : '',
|
|
95
95
|
testId: "blog-icon"
|
|
96
96
|
});
|
|
97
97
|
case 'schema:DigitalDocument':
|
|
98
98
|
return digitalDocumentToIcon(opts);
|
|
99
99
|
case 'schema:TextDigitalDocument':
|
|
100
100
|
return /*#__PURE__*/React.createElement(DocumentIcon, {
|
|
101
|
-
label: opts.title || 'document',
|
|
101
|
+
label: opts.showIconLabel ? opts.title || 'document' : '',
|
|
102
102
|
testId: "document-icon"
|
|
103
103
|
});
|
|
104
104
|
case 'schema:PresentationDigitalDocument':
|
|
105
105
|
return /*#__PURE__*/React.createElement(PresentationIcon, {
|
|
106
|
-
label: opts.title || 'presentation',
|
|
106
|
+
label: opts.showIconLabel ? opts.title || 'presentation' : '',
|
|
107
107
|
testId: "presentation-icon"
|
|
108
108
|
});
|
|
109
109
|
case 'schema:SpreadsheetDigitalDocument':
|
|
110
110
|
return /*#__PURE__*/React.createElement(SpreadsheetIcon, {
|
|
111
|
-
label: opts.title || 'spreadsheet',
|
|
111
|
+
label: opts.showIconLabel ? opts.title || 'spreadsheet' : '',
|
|
112
112
|
testId: "spreadsheet-icon"
|
|
113
113
|
});
|
|
114
114
|
case 'atlassian:Template':
|
|
115
115
|
return /*#__PURE__*/React.createElement(DocumentFilledIcon, {
|
|
116
116
|
color: "currentColor",
|
|
117
|
-
label: opts.title || 'template',
|
|
117
|
+
label: opts.showIconLabel ? opts.title || 'template' : '',
|
|
118
118
|
testId: "document-filled-icon"
|
|
119
119
|
});
|
|
120
120
|
case 'atlassian:UndefinedLink':
|
|
121
121
|
return /*#__PURE__*/React.createElement(DocumentIcon, {
|
|
122
|
-
label: opts.title || 'undefinedLink',
|
|
122
|
+
label: opts.showIconLabel ? opts.title || 'undefinedLink' : '',
|
|
123
123
|
testId: "document-icon"
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -142,7 +142,7 @@ var digitalDocumentToIcon = function digitalDocumentToIcon(opts) {
|
|
|
142
142
|
});
|
|
143
143
|
} else {
|
|
144
144
|
return /*#__PURE__*/React.createElement(FileIcon, {
|
|
145
|
-
label: opts.title || 'file',
|
|
145
|
+
label: opts.showIconLabel ? opts.title || 'file' : '',
|
|
146
146
|
testId: "file-icon"
|
|
147
147
|
});
|
|
148
148
|
}
|
|
@@ -5,20 +5,22 @@ import { extractTitleTextColor } from '../common/primitives';
|
|
|
5
5
|
import { extractTitlePrefix } from '../common/title-prefix';
|
|
6
6
|
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../constants';
|
|
7
7
|
export var extractInlineIcon = function extractInlineIcon(jsonLd) {
|
|
8
|
+
var showIconLabel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8
9
|
var provider = extractProvider(jsonLd);
|
|
9
10
|
if (provider && provider.id) {
|
|
10
11
|
if (provider.id === CONFLUENCE_GENERATOR_ID || provider.id === JIRA_GENERATOR_ID) {
|
|
11
|
-
return extractIcon(jsonLd);
|
|
12
|
+
return extractIcon(jsonLd, 'type', showIconLabel);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
return extractIcon(jsonLd, 'provider');
|
|
15
|
+
return extractIcon(jsonLd, 'provider', showIconLabel);
|
|
15
16
|
};
|
|
16
17
|
export var extractInlineProps = function extractInlineProps(jsonLd, renderers, removeTextHighlightingFromTitle) {
|
|
18
|
+
var showLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
17
19
|
return {
|
|
18
20
|
link: extractLink(jsonLd),
|
|
19
21
|
title: extractTitle(jsonLd, removeTextHighlightingFromTitle),
|
|
20
22
|
lozenge: extractLozenge(jsonLd),
|
|
21
|
-
icon: extractInlineIcon(jsonLd),
|
|
23
|
+
icon: extractInlineIcon(jsonLd, showLabel),
|
|
22
24
|
titleTextColor: extractTitleTextColor(jsonLd),
|
|
23
25
|
titlePrefix: extractTitlePrefix(jsonLd, renderers, 'inline')
|
|
24
26
|
};
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "36.2.
|
|
7
|
+
packageVersion: "36.2.3"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -39,7 +39,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
39
39
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
40
40
|
role = _ref.role,
|
|
41
41
|
label = _ref.label,
|
|
42
|
-
titleId = _ref.titleId
|
|
42
|
+
titleId = _ref.titleId,
|
|
43
|
+
_ref$showLabel = _ref.showLabel,
|
|
44
|
+
showLabel = _ref$showLabel === void 0 ? true : _ref$showLabel;
|
|
43
45
|
var fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
44
46
|
var _React$useState = React.useState(false),
|
|
45
47
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -209,11 +211,11 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
209
211
|
onClick: onChildClick,
|
|
210
212
|
onContextMenu: onContextMenuClick,
|
|
211
213
|
"data-testid": "hover-card-trigger-wrapper",
|
|
212
|
-
"aria-label": formatMessage(messages.more_information_about_this_work_item)
|
|
214
|
+
"aria-label": showLabel ? formatMessage(messages.more_information_about_this_work_item) : undefined
|
|
213
215
|
}, fg('fix_a11y_violation_in_hover_card_trigger') ? {
|
|
214
216
|
role: 'button'
|
|
215
217
|
} : {}), children));
|
|
216
|
-
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage]);
|
|
218
|
+
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition, formatMessage, showLabel]);
|
|
217
219
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
218
220
|
testId: "hover-card",
|
|
219
221
|
isOpen: isOpen && canOpen,
|