@atlaskit/smart-card 27.6.5 → 27.7.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 +12 -0
- package/dist/cjs/extractors/common/icon/extractIcon.js +67 -17
- package/dist/cjs/extractors/common/icon/extractIconFromDocument.js +0 -3
- package/dist/cjs/extractors/common/icon/prioritiseIcon.js +1 -16
- package/dist/cjs/extractors/embed/index.js +0 -1
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +90 -43
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/components/ActionList.js +12 -8
- package/dist/cjs/view/BlockCard/components/Content.js +10 -6
- package/dist/cjs/view/BlockCard/components/ContentFooter.js +15 -9
- package/dist/cjs/view/BlockCard/components/Frame.js +15 -9
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +8 -7
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.js +8 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/common/Byline.js +25 -25
- package/dist/es2019/extractors/common/icon/extractIcon.js +67 -19
- package/dist/es2019/extractors/common/icon/extractIconFromDocument.js +0 -5
- package/dist/es2019/extractors/common/icon/prioritiseIcon.js +0 -9
- package/dist/es2019/extractors/embed/index.js +0 -1
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +90 -42
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/components/ActionList.js +13 -8
- package/dist/es2019/view/BlockCard/components/Content.js +11 -7
- package/dist/es2019/view/BlockCard/components/ContentFooter.js +16 -10
- package/dist/es2019/view/BlockCard/components/Frame.js +13 -9
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +8 -7
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.js +8 -9
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/Byline.js +26 -26
- package/dist/esm/extractors/common/icon/extractIcon.js +67 -17
- package/dist/esm/extractors/common/icon/extractIconFromDocument.js +0 -3
- package/dist/esm/extractors/common/icon/prioritiseIcon.js +1 -16
- package/dist/esm/extractors/embed/index.js +0 -1
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +90 -44
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/components/ActionList.js +13 -8
- package/dist/esm/view/BlockCard/components/Content.js +11 -7
- package/dist/esm/view/BlockCard/components/ContentFooter.js +16 -10
- package/dist/esm/view/BlockCard/components/Frame.js +13 -10
- package/dist/esm/view/BlockCard/views/ResolvedView.js +8 -7
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.js +8 -9
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/common/Byline.js +26 -26
- package/dist/types/extractors/common/icon/prioritiseIcon.d.ts +1 -5
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +8 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/icon/prioritiseIcon.d.ts +1 -5
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +8 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-analytics.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { N300 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { gs, mq } from './utils';
|
|
6
|
+
const baseStyles = css({
|
|
7
|
+
// Spec: only allow two lines MAX to be shown.
|
|
8
|
+
display: '-webkit-box',
|
|
9
|
+
overflow: 'hidden',
|
|
10
|
+
textOverflow: 'ellipsis',
|
|
11
|
+
WebkitLineClamp: 2,
|
|
12
|
+
WebkitBoxOrient: 'vertical',
|
|
13
|
+
wordBreak: 'break-word',
|
|
14
|
+
whiteSpace: 'pre-line',
|
|
15
|
+
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
16
|
+
// due to HTML its unwrapping behaviour on paste.
|
|
17
|
+
MozUserSelect: 'none'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
21
|
+
const styles = mq({
|
|
22
|
+
fontSize: gs(1.5),
|
|
23
|
+
lineHeight: gs(2.5),
|
|
24
|
+
color: `${`var(--ds-text-subtlest, ${N300})`}`,
|
|
25
|
+
fontWeight: 'normal',
|
|
26
|
+
marginTop: gs(0.5),
|
|
27
|
+
// Fallback options.
|
|
28
|
+
maxHeight: gs(5)
|
|
29
|
+
});
|
|
6
30
|
export const Byline = ({
|
|
7
31
|
text,
|
|
8
32
|
children,
|
|
9
33
|
testId,
|
|
10
34
|
className
|
|
11
35
|
}) => jsx("span", {
|
|
12
|
-
|
|
13
|
-
css: mq({
|
|
14
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
15
|
-
fontSize: gs(1.5),
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
17
|
-
lineHeight: gs(2.5),
|
|
18
|
-
color: `${`var(--ds-text-subtlest, ${N300})`}`,
|
|
19
|
-
fontWeight: 'normal',
|
|
20
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
21
|
-
marginTop: gs(0.5),
|
|
22
|
-
// Spec: only allow two lines MAX to be shown.
|
|
23
|
-
display: '-webkit-box',
|
|
24
|
-
overflow: 'hidden',
|
|
25
|
-
textOverflow: 'ellipsis',
|
|
26
|
-
WebkitLineClamp: 2,
|
|
27
|
-
WebkitBoxOrient: 'vertical',
|
|
28
|
-
wordBreak: 'break-word',
|
|
29
|
-
// Fallback options.
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
31
|
-
maxHeight: gs(5),
|
|
32
|
-
whiteSpace: 'pre-line',
|
|
33
|
-
// EDM-713: fixes copy-paste from renderer to editor for Firefox
|
|
34
|
-
// due to HTML its unwrapping behaviour on paste.
|
|
35
|
-
MozUserSelect: 'none'
|
|
36
|
-
}),
|
|
36
|
+
css: [baseStyles, styles],
|
|
37
37
|
"data-testid": testId
|
|
38
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
39
39
|
,
|
|
@@ -6,6 +6,7 @@ import PullRequestIcon from '@atlaskit/icon-object/glyph/pull-request/16';
|
|
|
6
6
|
import BranchIcon from '@atlaskit/icon-object/glyph/branch/16';
|
|
7
7
|
import RepoIcon from '@atlaskit/icon-object/glyph/code/16';
|
|
8
8
|
import TaskIcon from '@atlaskit/icon-object/glyph/task/16';
|
|
9
|
+
import { getIconForFileType } from '../../../utils';
|
|
9
10
|
import { extractorPriorityMap } from './priority';
|
|
10
11
|
import { extractProvider, extractUrlFromIconJsonLd, extractTitle } from '@atlaskit/link-extractors';
|
|
11
12
|
import { extractFileFormat } from './extractFileFormat';
|
|
@@ -33,6 +34,56 @@ export var extractIcon = function extractIcon(jsonLd) {
|
|
|
33
34
|
return extractIconByType(type, opts);
|
|
34
35
|
}
|
|
35
36
|
};
|
|
37
|
+
function typeToIcon(type, opts) {
|
|
38
|
+
switch (type) {
|
|
39
|
+
case 'atlassian:SourceCodeCommit':
|
|
40
|
+
return /*#__PURE__*/React.createElement(CommitIcon, {
|
|
41
|
+
label: opts.title || 'commit',
|
|
42
|
+
testId: "commit-icon"
|
|
43
|
+
});
|
|
44
|
+
case 'atlassian:Project':
|
|
45
|
+
return /*#__PURE__*/React.createElement(ProjectIcon, {
|
|
46
|
+
label: opts.title || 'project',
|
|
47
|
+
size: "small",
|
|
48
|
+
testId: "project-icon"
|
|
49
|
+
});
|
|
50
|
+
case 'atlassian:SourceCodePullRequest':
|
|
51
|
+
return /*#__PURE__*/React.createElement(PullRequestIcon, {
|
|
52
|
+
label: opts.title || 'pullRequest',
|
|
53
|
+
testId: "pull-request-icon"
|
|
54
|
+
});
|
|
55
|
+
case 'atlassian:SourceCodeReference':
|
|
56
|
+
return /*#__PURE__*/React.createElement(BranchIcon, {
|
|
57
|
+
label: opts.title || 'reference',
|
|
58
|
+
testId: "branch-icon"
|
|
59
|
+
});
|
|
60
|
+
case 'atlassian:SourceCodeRepository':
|
|
61
|
+
return /*#__PURE__*/React.createElement(RepoIcon, {
|
|
62
|
+
label: opts.title || 'repository',
|
|
63
|
+
testId: "repo-icon"
|
|
64
|
+
});
|
|
65
|
+
case 'atlassian:Goal':
|
|
66
|
+
return /*#__PURE__*/React.createElement(TaskIcon, {
|
|
67
|
+
label: opts.title || 'goal',
|
|
68
|
+
testId: "task-icon"
|
|
69
|
+
});
|
|
70
|
+
case 'atlassian:Task':
|
|
71
|
+
return extractIconFromTask(opts);
|
|
72
|
+
default:
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function standardisedExtractIcon(type, opts) {
|
|
77
|
+
var iconFromType = typeToIcon(type, opts);
|
|
78
|
+
var iconFromFileFormat = opts.fileFormat ? getIconForFileType(opts.fileFormat) : undefined;
|
|
79
|
+
var iconFromProvider = opts.provider && opts.provider.icon;
|
|
80
|
+
return prioritiseIcon({
|
|
81
|
+
fileFormatIcon: iconFromFileFormat,
|
|
82
|
+
documentTypeIcon: iconFromType,
|
|
83
|
+
urlIcon: opts.icon,
|
|
84
|
+
providerIcon: iconFromProvider
|
|
85
|
+
});
|
|
86
|
+
}
|
|
36
87
|
|
|
37
88
|
/**
|
|
38
89
|
* Extracts an icon based on the given type.
|
|
@@ -45,6 +96,21 @@ export var extractIcon = function extractIcon(jsonLd) {
|
|
|
45
96
|
* @returns The extracted icon as a React node, or `undefined` if no icon is found.
|
|
46
97
|
*/
|
|
47
98
|
var extractIconByType = function extractIconByType(type, opts) {
|
|
99
|
+
if (getBooleanFF('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
100
|
+
switch (type) {
|
|
101
|
+
case 'Document':
|
|
102
|
+
case 'schema:BlogPosting':
|
|
103
|
+
case 'schema:DigitalDocument':
|
|
104
|
+
case 'schema:TextDigitalDocument':
|
|
105
|
+
case 'schema:PresentationDigitalDocument':
|
|
106
|
+
case 'schema:SpreadsheetDigitalDocument':
|
|
107
|
+
case 'atlassian:Template':
|
|
108
|
+
case 'atlassian:UndefinedLink':
|
|
109
|
+
return extractIconFromDocument(type, opts);
|
|
110
|
+
default:
|
|
111
|
+
return standardisedExtractIcon(type, opts);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
48
114
|
switch (type) {
|
|
49
115
|
case 'Document':
|
|
50
116
|
case 'schema:BlogPosting':
|
|
@@ -89,22 +155,6 @@ var extractIconByType = function extractIconByType(type, opts) {
|
|
|
89
155
|
case 'atlassian:Task':
|
|
90
156
|
return extractIconFromTask(opts);
|
|
91
157
|
default:
|
|
92
|
-
return
|
|
158
|
+
return opts.provider && opts.provider.icon;
|
|
93
159
|
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Choose which icon to show when the type is not recognized.
|
|
98
|
-
*/
|
|
99
|
-
var extractDefaultIcon = function extractDefaultIcon(opts) {
|
|
100
|
-
var _opts$provider;
|
|
101
|
-
var provider = opts.provider;
|
|
102
|
-
var providerId = provider === null || provider === void 0 ? void 0 : provider.id;
|
|
103
|
-
return prioritiseIcon({
|
|
104
|
-
providerId: providerId,
|
|
105
|
-
fileFormatIcon: undefined,
|
|
106
|
-
documentTypeIcon: undefined,
|
|
107
|
-
urlIcon: opts.icon,
|
|
108
|
-
providerIcon: (_opts$provider = opts.provider) === null || _opts$provider === void 0 ? void 0 : _opts$provider.icon
|
|
109
|
-
});
|
|
110
160
|
};
|
|
@@ -16,14 +16,11 @@ import { prioritiseIcon } from './prioritiseIcon';
|
|
|
16
16
|
* @returns The React node representing the extracted icon, or `undefined` if no icon is found.
|
|
17
17
|
*/
|
|
18
18
|
export var extractIconFromDocument = function extractIconFromDocument(type, opts) {
|
|
19
|
-
var provider = opts.provider;
|
|
20
19
|
var iconFromType = documentTypeToIcon(type, opts);
|
|
21
20
|
var iconFromFileFormat = documentFileFormatToIcon(opts);
|
|
22
21
|
var iconFromProvider = opts.provider && opts.provider.icon;
|
|
23
22
|
if (getBooleanFF('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
24
|
-
var providerId = provider === null || provider === void 0 ? void 0 : provider.id;
|
|
25
23
|
return prioritiseIcon({
|
|
26
|
-
providerId: providerId,
|
|
27
24
|
fileFormatIcon: iconFromFileFormat,
|
|
28
25
|
documentTypeIcon: iconFromType,
|
|
29
26
|
urlIcon: opts.icon,
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../../constants';
|
|
2
|
-
var isConfluenceProvider = function isConfluenceProvider(provider) {
|
|
3
|
-
return provider === CONFLUENCE_GENERATOR_ID;
|
|
4
|
-
};
|
|
5
|
-
var isJiraProvider = function isJiraProvider(provider) {
|
|
6
|
-
return provider === JIRA_GENERATOR_ID;
|
|
7
|
-
};
|
|
8
|
-
var isNativeProvider = function isNativeProvider(provider) {
|
|
9
|
-
return isConfluenceProvider(provider) || isJiraProvider(provider);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
1
|
/**
|
|
13
2
|
* Represents an icon. Should either contain a label and url, or a an icon type and label.
|
|
14
3
|
*/
|
|
@@ -22,13 +11,9 @@ var isNativeProvider = function isNativeProvider(provider) {
|
|
|
22
11
|
* Generic so it can be used to prioritise strings, or React components depending on the usage.
|
|
23
12
|
*/
|
|
24
13
|
export function prioritiseIcon(_ref) {
|
|
25
|
-
var
|
|
26
|
-
fileFormatIcon = _ref.fileFormatIcon,
|
|
14
|
+
var fileFormatIcon = _ref.fileFormatIcon,
|
|
27
15
|
documentTypeIcon = _ref.documentTypeIcon,
|
|
28
16
|
urlIcon = _ref.urlIcon,
|
|
29
17
|
providerIcon = _ref.providerIcon;
|
|
30
|
-
if (isNativeProvider(providerId)) {
|
|
31
|
-
return fileFormatIcon || documentTypeIcon || urlIcon || providerIcon;
|
|
32
|
-
}
|
|
33
18
|
return urlIcon || fileFormatIcon || documentTypeIcon || providerIcon;
|
|
34
19
|
}
|
|
@@ -26,7 +26,6 @@ function generateContext(jsonLd) {
|
|
|
26
26
|
}
|
|
27
27
|
var generator = jsonLd.generator;
|
|
28
28
|
var icon = prioritiseIcon({
|
|
29
|
-
providerId: generator && typeof generator !== 'string' && generator['@type'] !== 'Link' ? generator['@id'] : undefined,
|
|
30
29
|
fileFormatIcon: undefined,
|
|
31
30
|
documentTypeIcon: undefined,
|
|
32
31
|
urlIcon: extractUrlFromIconJsonLd(jsonLd.icon),
|
|
@@ -39,6 +39,82 @@ var isJiraProvider = function isJiraProvider(provider) {
|
|
|
39
39
|
var isNativeProvider = function isNativeProvider(provider) {
|
|
40
40
|
return isConfluenceProvider(provider) || isJiraProvider(provider);
|
|
41
41
|
};
|
|
42
|
+
function chooseIcon(_ref2) {
|
|
43
|
+
var _data$generator;
|
|
44
|
+
var urlIcon = _ref2.urlIcon,
|
|
45
|
+
type = _ref2.type,
|
|
46
|
+
label = _ref2.label,
|
|
47
|
+
data = _ref2.data,
|
|
48
|
+
providerIcon = _ref2.providerIcon;
|
|
49
|
+
var providerId = (_data$generator = data.generator) === null || _data$generator === void 0 ? void 0 : _data$generator['@id'];
|
|
50
|
+
var fileFormat = data === null || data === void 0 ? void 0 : data['schema:fileFormat'];
|
|
51
|
+
var fileFormatIcon = extractFileFormatIcon(fileFormat);
|
|
52
|
+
var documentTypeIcon = typeToIconDescriptor({
|
|
53
|
+
type: type,
|
|
54
|
+
label: label,
|
|
55
|
+
providerId: providerId,
|
|
56
|
+
data: data
|
|
57
|
+
}) || extractDocumentTypeIcon(type, label);
|
|
58
|
+
return prioritiseIcon({
|
|
59
|
+
fileFormatIcon: fileFormatIcon,
|
|
60
|
+
documentTypeIcon: documentTypeIcon,
|
|
61
|
+
urlIcon: urlIcon,
|
|
62
|
+
providerIcon: providerIcon
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function typeToIconDescriptor(_ref3) {
|
|
66
|
+
var type = _ref3.type,
|
|
67
|
+
label = _ref3.label,
|
|
68
|
+
providerId = _ref3.providerId,
|
|
69
|
+
data = _ref3.data;
|
|
70
|
+
switch (type) {
|
|
71
|
+
case 'atlassian:Goal':
|
|
72
|
+
return {
|
|
73
|
+
icon: IconType.Task,
|
|
74
|
+
label: label || 'Goal'
|
|
75
|
+
};
|
|
76
|
+
case 'atlassian:Project':
|
|
77
|
+
return {
|
|
78
|
+
icon: IconType.Project,
|
|
79
|
+
label: label || 'Project'
|
|
80
|
+
};
|
|
81
|
+
case 'atlassian:SourceCodeCommit':
|
|
82
|
+
return {
|
|
83
|
+
icon: IconType.Commit,
|
|
84
|
+
label: label || 'Commit'
|
|
85
|
+
};
|
|
86
|
+
case 'atlassian:SourceCodePullRequest':
|
|
87
|
+
return {
|
|
88
|
+
icon: IconType.PullRequest,
|
|
89
|
+
label: label || 'Pull request'
|
|
90
|
+
};
|
|
91
|
+
case 'atlassian:SourceCodeReference':
|
|
92
|
+
return {
|
|
93
|
+
icon: IconType.Branch,
|
|
94
|
+
label: label || 'Reference'
|
|
95
|
+
};
|
|
96
|
+
case 'atlassian:SourceCodeRepository':
|
|
97
|
+
return {
|
|
98
|
+
icon: IconType.Repo,
|
|
99
|
+
label: label || 'Repository'
|
|
100
|
+
};
|
|
101
|
+
case 'atlassian:Task':
|
|
102
|
+
var taskLabel = label || 'Task';
|
|
103
|
+
var taskIconDescriptor = {
|
|
104
|
+
icon: IconType.Task,
|
|
105
|
+
label: taskLabel
|
|
106
|
+
};
|
|
107
|
+
if (isJiraProvider(providerId)) {
|
|
108
|
+
var _extractTask = extractTask(data),
|
|
109
|
+
taskType = _extractTask.taskType,
|
|
110
|
+
taskIcon = _extractTask.taskIcon;
|
|
111
|
+
return taskType === 'JiraCustomTaskType' ? taskIcon || taskIconDescriptor : extractJiraTaskIcon(taskType, taskLabel);
|
|
112
|
+
}
|
|
113
|
+
return taskIconDescriptor;
|
|
114
|
+
default:
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
42
118
|
|
|
43
119
|
/**
|
|
44
120
|
* Return the icon object given a JSON-LD data object.
|
|
@@ -50,6 +126,15 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
50
126
|
var urlIcon = extractUrlIcon(data.icon, label);
|
|
51
127
|
var provider = generator === null || generator === void 0 ? void 0 : generator['@id'];
|
|
52
128
|
var providerIcon = extractProviderIcon(data);
|
|
129
|
+
if (getBooleanFF('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
130
|
+
return chooseIcon({
|
|
131
|
+
urlIcon: urlIcon,
|
|
132
|
+
providerIcon: providerIcon,
|
|
133
|
+
type: type,
|
|
134
|
+
label: label,
|
|
135
|
+
data: data
|
|
136
|
+
});
|
|
137
|
+
}
|
|
53
138
|
switch (type) {
|
|
54
139
|
case 'Document':
|
|
55
140
|
case 'schema:BlogPosting':
|
|
@@ -67,22 +152,13 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
67
152
|
var fileFormat = documentData === null || documentData === void 0 ? void 0 : documentData['schema:fileFormat'];
|
|
68
153
|
var fileFormatIcon = extractFileFormatIcon(fileFormat);
|
|
69
154
|
var documentTypeIcon = extractDocumentTypeIcon(type, label);
|
|
70
|
-
if (getBooleanFF('platform.linking-platform.smart-card.standardise-smart-link-icon-behaviour')) {
|
|
71
|
-
return prioritiseIcon({
|
|
72
|
-
providerId: provider,
|
|
73
|
-
fileFormatIcon: fileFormatIcon,
|
|
74
|
-
documentTypeIcon: documentTypeIcon,
|
|
75
|
-
urlIcon: urlIcon,
|
|
76
|
-
providerIcon: providerIcon
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
155
|
return isNativeProvider(provider) ? fileFormatIcon || documentTypeIcon || urlIcon || providerIcon : providerIcon || fileFormatIcon || documentTypeIcon;
|
|
80
156
|
case 'atlassian:Task':
|
|
81
157
|
var taskLabel = label || 'Task';
|
|
82
158
|
if (isJiraProvider(provider)) {
|
|
83
|
-
var
|
|
84
|
-
taskType =
|
|
85
|
-
taskIcon =
|
|
159
|
+
var _extractTask2 = extractTask(data),
|
|
160
|
+
taskType = _extractTask2.taskType,
|
|
161
|
+
taskIcon = _extractTask2.taskIcon;
|
|
86
162
|
return taskType === 'JiraCustomTaskType' ? taskIcon || urlIcon || providerIcon || {
|
|
87
163
|
icon: IconType.Task,
|
|
88
164
|
label: taskLabel
|
|
@@ -123,37 +199,7 @@ var extractJsonldDataIcon = function extractJsonldDataIcon(data) {
|
|
|
123
199
|
label: label || 'Repository'
|
|
124
200
|
};
|
|
125
201
|
default:
|
|
126
|
-
return
|
|
127
|
-
data: data,
|
|
128
|
-
type: type,
|
|
129
|
-
label: label,
|
|
130
|
-
provider: provider,
|
|
131
|
-
urlIcon: urlIcon,
|
|
132
|
-
providerIcon: providerIcon
|
|
133
|
-
}) : providerIcon;
|
|
202
|
+
return providerIcon;
|
|
134
203
|
}
|
|
135
204
|
};
|
|
136
|
-
export default extractJsonldDataIcon;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Choose which icon to show when the type is not recognized.
|
|
140
|
-
*/
|
|
141
|
-
var extractDefaultIcon = function extractDefaultIcon(_ref2) {
|
|
142
|
-
var data = _ref2.data,
|
|
143
|
-
type = _ref2.type,
|
|
144
|
-
label = _ref2.label,
|
|
145
|
-
provider = _ref2.provider,
|
|
146
|
-
urlIcon = _ref2.urlIcon,
|
|
147
|
-
providerIcon = _ref2.providerIcon;
|
|
148
|
-
var documentData = data;
|
|
149
|
-
var fileFormat = documentData === null || documentData === void 0 ? void 0 : documentData['schema:fileFormat'];
|
|
150
|
-
var fileFormatIcon = extractFileFormatIcon(fileFormat);
|
|
151
|
-
var documentTypeIcon = extractDocumentTypeIcon(type, label);
|
|
152
|
-
return prioritiseIcon({
|
|
153
|
-
providerId: provider,
|
|
154
|
-
fileFormatIcon: fileFormatIcon,
|
|
155
|
-
documentTypeIcon: documentTypeIcon,
|
|
156
|
-
urlIcon: urlIcon,
|
|
157
|
-
providerIcon: providerIcon
|
|
158
|
-
});
|
|
159
|
-
};
|
|
205
|
+
export default extractJsonldDataIcon;
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "27.
|
|
18
|
+
packageVersion: "27.7.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -11,20 +11,27 @@ import MoreIcon from '@atlaskit/icon/glyph/more';
|
|
|
11
11
|
import { Action } from './Action';
|
|
12
12
|
import { gs, mq } from '../../common/utils';
|
|
13
13
|
import { di } from 'react-magnetic-di';
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
16
|
+
var wrapperStyles = mq({
|
|
17
|
+
display: 'flex',
|
|
18
|
+
marginTop: [gs(2), 0]
|
|
19
|
+
});
|
|
14
20
|
var buttonStyles = css({
|
|
15
21
|
height: 'auto'
|
|
16
22
|
});
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
25
|
+
var actionsWrapperStyles = {
|
|
26
|
+
marginLeft: gs(0.5)
|
|
27
|
+
};
|
|
17
28
|
export var ActionList = function ActionList(_ref) {
|
|
18
29
|
var items = _ref.items;
|
|
19
30
|
var actionsToShow = items.slice(0, 2);
|
|
20
31
|
var actionsToList = items.slice(2, items.length);
|
|
21
32
|
return jsx("div", {
|
|
22
33
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
23
|
-
css:
|
|
24
|
-
display: 'flex',
|
|
25
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
26
|
-
marginTop: [gs(2), 0]
|
|
27
|
-
})
|
|
34
|
+
css: wrapperStyles
|
|
28
35
|
}, jsx(ButtonGroup, null, actionsToShow.map(function (action) {
|
|
29
36
|
return jsx(Action, _extends({
|
|
30
37
|
key: action.id
|
|
@@ -32,9 +39,7 @@ export var ActionList = function ActionList(_ref) {
|
|
|
32
39
|
})), actionsToList.length ?
|
|
33
40
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
34
41
|
jsx("div", {
|
|
35
|
-
css:
|
|
36
|
-
marginLeft: gs(0.5)
|
|
37
|
-
}
|
|
42
|
+
css: actionsWrapperStyles
|
|
38
43
|
}, jsx(DropdownMenu, {
|
|
39
44
|
trigger: function trigger(_ref2) {
|
|
40
45
|
var triggerRef = _ref2.triggerRef,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { gs, mq } from '../../common/utils';
|
|
5
5
|
/**
|
|
6
6
|
* Class name for selecting non-flexible block card content
|
|
@@ -9,20 +9,24 @@ import { gs, mq } from '../../common/utils';
|
|
|
9
9
|
* Using this selctor is deprecated as once the flexible block card feature flag is removed, this class will no longer be used.
|
|
10
10
|
*/
|
|
11
11
|
export var blockCardContentClassName = 'block-card-content';
|
|
12
|
+
var baseStyles = css({
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
flexGrow: 1
|
|
16
|
+
});
|
|
12
17
|
export var Content = function Content(_ref) {
|
|
13
18
|
var children = _ref.children,
|
|
14
19
|
_ref$isCompact = _ref.isCompact,
|
|
15
20
|
isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact;
|
|
16
21
|
return jsx("div", {
|
|
17
22
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
18
|
-
css:
|
|
23
|
+
css: [baseStyles,
|
|
24
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
25
|
+
mq({
|
|
19
26
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
20
27
|
padding: isCompact ? gs(1) : gs(2),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
justifyContent: isCompact ? 'unset' : ['unset', 'space-between'],
|
|
24
|
-
flexGrow: 1
|
|
25
|
-
}),
|
|
28
|
+
justifyContent: isCompact ? 'unset' : ['unset', 'space-between']
|
|
29
|
+
})],
|
|
26
30
|
"data-trello-do-not-use-override": "block-card-content"
|
|
27
31
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
28
32
|
,
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { gs, mq } from '../../common/utils';
|
|
5
5
|
export var contentFooterClassName = 'smart-link-content-footer';
|
|
6
|
+
var flexStyles = css({
|
|
7
|
+
display: 'flex'
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
11
|
+
var baseStyles = mq({
|
|
12
|
+
flexDirection: ['column', 'row'],
|
|
13
|
+
flexGrow: [1, 'unset'],
|
|
14
|
+
alignItems: ['unset', 'center'],
|
|
15
|
+
marginTop: [gs(1), gs(1.5)]
|
|
16
|
+
});
|
|
6
17
|
export var ContentFooter = function ContentFooter(_ref) {
|
|
7
18
|
var children = _ref.children,
|
|
8
19
|
_ref$hasSpaceBetween = _ref.hasSpaceBetween,
|
|
9
20
|
hasSpaceBetween = _ref$hasSpaceBetween === void 0 ? false : _ref$hasSpaceBetween;
|
|
10
21
|
return jsx("div", {
|
|
22
|
+
css: [flexStyles, baseStyles,
|
|
11
23
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
flexGrow: [1, 'unset'],
|
|
16
|
-
justifyContent: [hasSpaceBetween ? 'space-between' : 'flex-end', 'space-between'],
|
|
17
|
-
alignItems: ['unset', 'center'],
|
|
18
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
19
|
-
marginTop: [gs(1), gs(1.5)]
|
|
20
|
-
})
|
|
24
|
+
mq({
|
|
25
|
+
justifyContent: [hasSpaceBetween ? 'space-between' : 'flex-end', 'space-between']
|
|
26
|
+
})]
|
|
21
27
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
22
28
|
,
|
|
23
29
|
className: contentFooterClassName
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
/** @jsx jsx */
|
|
5
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
7
4
|
import React from 'react';
|
|
8
5
|
import { N20A, N30A, B200, N40A, N50A } from '@atlaskit/theme/colors';
|
|
9
6
|
import { gs, br, mq } from '../../common/utils';
|
|
@@ -15,10 +12,14 @@ export var Frame = function Frame() {
|
|
|
15
12
|
};
|
|
16
13
|
return props.compact ? jsx(CompactFrame, props) : jsx(ExpandedFrame, props);
|
|
17
14
|
};
|
|
15
|
+
var sharedBaseFrameStyles = css({
|
|
16
|
+
width: '100%',
|
|
17
|
+
display: 'flex'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
18
21
|
var sharedFrameStyles = {
|
|
19
22
|
maxWidth: gs(95),
|
|
20
|
-
width: '100%',
|
|
21
|
-
display: 'flex',
|
|
22
23
|
backgroundColor: "var(--ds-surface-raised, white)"
|
|
23
24
|
};
|
|
24
25
|
export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
@@ -29,8 +30,9 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
29
30
|
className = _ref.className,
|
|
30
31
|
isFluidHeight = _ref.isFluidHeight;
|
|
31
32
|
return jsx("div", {
|
|
33
|
+
css: [sharedBaseFrameStyles, sharedFrameStyles,
|
|
32
34
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
33
|
-
|
|
35
|
+
mq({
|
|
34
36
|
'&:hover': isHoverable ? {
|
|
35
37
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4064
|
|
36
38
|
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat(N20A, ")"),
|
|
@@ -44,7 +46,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
44
46
|
justifyContent: 'space-between',
|
|
45
47
|
overflow: 'hidden',
|
|
46
48
|
boxShadow: "var(--ds-shadow-raised, ".concat("0 1px 1px ".concat(N50A, ", 0 0 1px 1px ").concat(N40A), ")")
|
|
47
|
-
})
|
|
49
|
+
})],
|
|
48
50
|
"data-testid": testId
|
|
49
51
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
50
52
|
,
|
|
@@ -60,8 +62,9 @@ export var CompactFrame = function CompactFrame(_ref2) {
|
|
|
60
62
|
className = _ref2.className,
|
|
61
63
|
inheritDimensions = _ref2.inheritDimensions;
|
|
62
64
|
return jsx("div", {
|
|
65
|
+
css: [sharedBaseFrameStyles, sharedFrameStyles,
|
|
63
66
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
64
|
-
|
|
67
|
+
mq({
|
|
65
68
|
'&:hover': isHoverable ? {
|
|
66
69
|
backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N30A, ")")
|
|
67
70
|
} : undefined,
|
|
@@ -76,7 +79,7 @@ export var CompactFrame = function CompactFrame(_ref2) {
|
|
|
76
79
|
width: ['calc(100% - 16px)', '100%'],
|
|
77
80
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
78
81
|
padding: ["0px ".concat(gs(1)), '0']
|
|
79
|
-
})
|
|
82
|
+
})],
|
|
80
83
|
"data-testid": testId
|
|
81
84
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
82
85
|
,
|
|
@@ -24,6 +24,13 @@ var styles = css({
|
|
|
24
24
|
justifyContent: 'space-between',
|
|
25
25
|
alignItems: 'flex-start'
|
|
26
26
|
});
|
|
27
|
+
var lozengeStyles = {
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
29
|
+
height: gs(2.5),
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
justifyContent: 'center'
|
|
33
|
+
};
|
|
27
34
|
/**
|
|
28
35
|
* Class name for selecting non-flexible resolved block card
|
|
29
36
|
*
|
|
@@ -102,13 +109,7 @@ export var ResolvedView = function ResolvedView(_ref) {
|
|
|
102
109
|
name: title,
|
|
103
110
|
textColor: titleTextColor
|
|
104
111
|
}), lozenge && jsx(LozengeBlockWrapper, {
|
|
105
|
-
css:
|
|
106
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
107
|
-
height: gs(2.5),
|
|
108
|
-
display: 'flex',
|
|
109
|
-
alignItems: 'center',
|
|
110
|
-
justifyContent: 'center'
|
|
111
|
-
}
|
|
112
|
+
css: lozengeStyles
|
|
112
113
|
}, jsx(Lozenge, _extends({
|
|
113
114
|
style: lozenge.style
|
|
114
115
|
}, lozenge), lozenge.text))), jsx(CollaboratorList, {
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { TrackQuickActionFailureReason, TrackQuickActionType } from '../../../../../../utils/analytics/analytics';
|
|
2
1
|
export var unknownLoadErrorAnalyticsPayload = {
|
|
3
|
-
smartLinkActionType:
|
|
4
|
-
reason:
|
|
2
|
+
smartLinkActionType: 'StatusUpdate',
|
|
3
|
+
reason: 'UnknownError',
|
|
5
4
|
step: 'load'
|
|
6
5
|
};
|
|
7
6
|
export var permissionLoadErrorAnalyticsPayload = {
|
|
8
|
-
smartLinkActionType:
|
|
9
|
-
reason:
|
|
7
|
+
smartLinkActionType: 'StatusUpdate',
|
|
8
|
+
reason: 'PermissionError',
|
|
10
9
|
step: 'load'
|
|
11
10
|
};
|
|
12
11
|
export var unknownUpdateErrorAnalyticsPayload = {
|
|
13
|
-
smartLinkActionType:
|
|
14
|
-
reason:
|
|
12
|
+
smartLinkActionType: 'StatusUpdate',
|
|
13
|
+
reason: 'UnknownError',
|
|
15
14
|
step: 'update'
|
|
16
15
|
};
|
|
17
16
|
export var validationUpdateErrorAnalyticsPayload = {
|
|
18
|
-
smartLinkActionType:
|
|
19
|
-
reason:
|
|
17
|
+
smartLinkActionType: 'StatusUpdate',
|
|
18
|
+
reason: 'ValidationError',
|
|
20
19
|
step: 'update'
|
|
21
20
|
};
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "27.
|
|
13
|
+
packageVersion: "27.7.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|