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