@atlaskit/smart-card 43.21.0 → 43.22.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 +15 -0
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view-renders-correctly-when-hovering-over-url-in-errored-view--default.png +2 -2
- package/dist/cjs/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view-with-truncation--default.png +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-document-type-icon.js +8 -41
- package/dist/cjs/extractors/flexible/icon/extract-file-formatIcon.js +22 -111
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -31
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +4 -6
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +1 -5
- package/dist/cjs/view/InlineCard/Frame/styled.compiled.css +1 -0
- package/dist/cjs/view/InlineCard/Frame/styled.js +4 -4
- package/dist/cjs/view/InlineCard/index.js +4 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view-renders-correctly-when-hovering-over-url-in-errored-view--default.png +2 -2
- package/dist/es2019/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view-with-truncation--default.png +2 -2
- package/dist/es2019/extractors/flexible/icon/extract-document-type-icon.js +8 -41
- package/dist/es2019/extractors/flexible/icon/extract-file-formatIcon.js +22 -111
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -31
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +3 -4
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +1 -5
- package/dist/es2019/view/InlineCard/Frame/styled.compiled.css +1 -0
- package/dist/es2019/view/InlineCard/Frame/styled.js +3 -3
- package/dist/es2019/view/InlineCard/index.js +4 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view-renders-correctly-when-hovering-over-url-in-errored-view--default.png +2 -2
- package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view-with-truncation--default.png +2 -2
- package/dist/esm/extractors/flexible/icon/extract-document-type-icon.js +8 -41
- package/dist/esm/extractors/flexible/icon/extract-file-formatIcon.js +22 -111
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -31
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +4 -6
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +1 -5
- package/dist/esm/view/InlineCard/Frame/styled.compiled.css +1 -0
- package/dist/esm/view/InlineCard/Frame/styled.js +4 -4
- package/dist/esm/view/InlineCard/index.js +4 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/InlineCard/Frame/index.d.ts +2 -1
- package/dist/types/view/InlineCard/Frame/styled.d.ts +2 -1
- package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +2 -1
- package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +2 -1
- package/package.json +5 -8
|
@@ -1,144 +1,83 @@
|
|
|
1
|
-
import { fg } from "@atlaskit/platform-feature-flags";
|
|
2
1
|
import { IconType } from '../../../constants';
|
|
3
2
|
var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
4
3
|
switch (fileFormat) {
|
|
5
4
|
// Generic documents
|
|
6
5
|
case 'folder':
|
|
7
|
-
return
|
|
6
|
+
return {
|
|
8
7
|
icon: IconType.Folder
|
|
9
|
-
} : {
|
|
10
|
-
icon: IconType.Folder,
|
|
11
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
12
|
-
label: 'Folder'
|
|
13
8
|
};
|
|
14
9
|
case 'text/plain':
|
|
15
10
|
case 'application/vnd.oasis.opendocument.text':
|
|
16
11
|
case 'application/vnd.apple.pages':
|
|
17
|
-
return
|
|
12
|
+
return {
|
|
18
13
|
icon: IconType.Document
|
|
19
|
-
} : {
|
|
20
|
-
icon: IconType.Document,
|
|
21
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
22
|
-
label: 'Document'
|
|
23
14
|
};
|
|
24
15
|
case 'application/pdf':
|
|
25
|
-
return
|
|
16
|
+
return {
|
|
26
17
|
icon: IconType.PDF
|
|
27
|
-
} : {
|
|
28
|
-
icon: IconType.PDF,
|
|
29
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
30
|
-
label: 'PDF document'
|
|
31
18
|
};
|
|
32
19
|
case 'application/vnd.oasis.opendocument.presentation':
|
|
33
20
|
case 'application/vnd.apple.keynote':
|
|
34
|
-
return
|
|
21
|
+
return {
|
|
35
22
|
icon: IconType.Presentation
|
|
36
|
-
} : {
|
|
37
|
-
icon: IconType.Presentation,
|
|
38
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
39
|
-
label: 'Presentation'
|
|
40
23
|
};
|
|
41
24
|
case 'application/vnd.oasis.opendocument.spreadsheet':
|
|
42
25
|
case 'application/vnd.apple.numbers':
|
|
43
|
-
return
|
|
26
|
+
return {
|
|
44
27
|
icon: IconType.Spreadsheet
|
|
45
|
-
} : {
|
|
46
|
-
icon: IconType.Spreadsheet,
|
|
47
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
48
|
-
label: 'Spreadsheet'
|
|
49
28
|
};
|
|
50
29
|
// Google Drive
|
|
51
30
|
case 'application/vnd.google-apps.document':
|
|
52
|
-
return
|
|
31
|
+
return {
|
|
53
32
|
icon: IconType.GoogleDocs
|
|
54
|
-
} : {
|
|
55
|
-
icon: IconType.GoogleDocs,
|
|
56
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
57
|
-
label: 'Google Docs'
|
|
58
33
|
};
|
|
59
34
|
case 'application/vnd.google-apps.form':
|
|
60
|
-
return
|
|
35
|
+
return {
|
|
61
36
|
icon: IconType.GoogleForms
|
|
62
|
-
} : {
|
|
63
|
-
icon: IconType.GoogleForms,
|
|
64
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
65
|
-
label: 'Google Form'
|
|
66
37
|
};
|
|
67
38
|
case 'application/vnd.google-apps.spreadsheet':
|
|
68
|
-
return
|
|
39
|
+
return {
|
|
69
40
|
icon: IconType.GoogleSheets
|
|
70
|
-
} : {
|
|
71
|
-
icon: IconType.GoogleSheets,
|
|
72
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
73
|
-
label: 'Google Sheets'
|
|
74
41
|
};
|
|
75
42
|
case 'application/vnd.google-apps.presentation':
|
|
76
|
-
return
|
|
43
|
+
return {
|
|
77
44
|
icon: IconType.GoogleSlides
|
|
78
|
-
} : {
|
|
79
|
-
icon: IconType.GoogleSlides,
|
|
80
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
81
|
-
label: 'Google Slides'
|
|
82
45
|
};
|
|
83
46
|
// Microsoft
|
|
84
47
|
case 'application/vnd.ms-excel':
|
|
85
48
|
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
86
|
-
return
|
|
49
|
+
return {
|
|
87
50
|
icon: IconType.MSExcel
|
|
88
|
-
} : {
|
|
89
|
-
icon: IconType.MSExcel,
|
|
90
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
91
|
-
label: 'Excel spreadsheet'
|
|
92
51
|
};
|
|
93
52
|
case 'application/vnd.ms-powerpoint':
|
|
94
53
|
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
|
|
95
|
-
return
|
|
54
|
+
return {
|
|
96
55
|
icon: IconType.MSPowerpoint
|
|
97
|
-
} : {
|
|
98
|
-
icon: IconType.MSPowerpoint,
|
|
99
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
100
|
-
label: 'PowerPoint presentation'
|
|
101
56
|
};
|
|
102
57
|
case 'application/msword':
|
|
103
58
|
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
|
104
|
-
return
|
|
59
|
+
return {
|
|
105
60
|
icon: IconType.MSWord
|
|
106
|
-
} : {
|
|
107
|
-
icon: IconType.MSWord,
|
|
108
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
109
|
-
label: 'Word document'
|
|
110
61
|
};
|
|
111
62
|
case 'image/png':
|
|
112
63
|
case 'image/jpeg':
|
|
113
64
|
case 'image/bmp':
|
|
114
65
|
case 'image/webp':
|
|
115
66
|
case 'image/svg+xml':
|
|
116
|
-
return
|
|
67
|
+
return {
|
|
117
68
|
icon: IconType.Image
|
|
118
|
-
} : {
|
|
119
|
-
icon: IconType.Image,
|
|
120
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
121
|
-
label: 'Image'
|
|
122
69
|
};
|
|
123
70
|
case 'image/gif':
|
|
124
|
-
return
|
|
71
|
+
return {
|
|
125
72
|
icon: IconType.GIF
|
|
126
|
-
} : {
|
|
127
|
-
icon: IconType.GIF,
|
|
128
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
129
|
-
label: 'GIF'
|
|
130
73
|
};
|
|
131
74
|
case 'audio/midi':
|
|
132
75
|
case 'audio/mpeg':
|
|
133
76
|
case 'audio/webm':
|
|
134
77
|
case 'audio/ogg':
|
|
135
78
|
case 'audio/wav':
|
|
136
|
-
return
|
|
79
|
+
return {
|
|
137
80
|
icon: IconType.Audio
|
|
138
|
-
} : {
|
|
139
|
-
icon: IconType.Audio,
|
|
140
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
141
|
-
label: 'Audio'
|
|
142
81
|
};
|
|
143
82
|
case 'video/mp4':
|
|
144
83
|
case 'video/quicktime':
|
|
@@ -147,23 +86,15 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
147
86
|
case 'video/ogg':
|
|
148
87
|
case 'video/x-ms-wmv':
|
|
149
88
|
case 'video/x-msvideo':
|
|
150
|
-
return
|
|
89
|
+
return {
|
|
151
90
|
icon: IconType.Video
|
|
152
|
-
} : {
|
|
153
|
-
icon: IconType.Video,
|
|
154
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
155
|
-
label: 'Video'
|
|
156
91
|
};
|
|
157
92
|
// Others
|
|
158
93
|
case 'text/css':
|
|
159
94
|
case 'text/html':
|
|
160
95
|
case 'application/javascript':
|
|
161
|
-
return
|
|
96
|
+
return {
|
|
162
97
|
icon: IconType.Code
|
|
163
|
-
} : {
|
|
164
|
-
icon: IconType.Code,
|
|
165
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
166
|
-
label: 'Source Code'
|
|
167
98
|
};
|
|
168
99
|
case 'application/zip':
|
|
169
100
|
case 'application/x-tar':
|
|
@@ -171,44 +102,24 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
171
102
|
case 'application/x-7z-compressed':
|
|
172
103
|
case 'application/x-apple-diskimage':
|
|
173
104
|
case 'application/vnd.rar':
|
|
174
|
-
return
|
|
105
|
+
return {
|
|
175
106
|
icon: IconType.Archive
|
|
176
|
-
} : {
|
|
177
|
-
icon: IconType.Archive,
|
|
178
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
179
|
-
label: 'Archive'
|
|
180
107
|
};
|
|
181
108
|
case 'application/dmg':
|
|
182
|
-
return
|
|
109
|
+
return {
|
|
183
110
|
icon: IconType.Executable
|
|
184
|
-
} : {
|
|
185
|
-
icon: IconType.Executable,
|
|
186
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
187
|
-
label: 'Executable'
|
|
188
111
|
};
|
|
189
112
|
case 'application/sketch':
|
|
190
|
-
return
|
|
113
|
+
return {
|
|
191
114
|
icon: IconType.Sketch
|
|
192
|
-
} : {
|
|
193
|
-
icon: IconType.Sketch,
|
|
194
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
195
|
-
label: 'Sketch'
|
|
196
115
|
};
|
|
197
116
|
case 'application/octet-stream':
|
|
198
|
-
return
|
|
117
|
+
return {
|
|
199
118
|
icon: IconType.Generic
|
|
200
|
-
} : {
|
|
201
|
-
icon: IconType.Generic,
|
|
202
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
203
|
-
label: 'Binary file'
|
|
204
119
|
};
|
|
205
120
|
case 'application/invision.prototype':
|
|
206
|
-
return
|
|
121
|
+
return {
|
|
207
122
|
icon: IconType.Generic
|
|
208
|
-
} : {
|
|
209
|
-
icon: IconType.Generic,
|
|
210
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
211
|
-
label: 'Prototype'
|
|
212
123
|
};
|
|
213
124
|
default:
|
|
214
125
|
return undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { extractTitle } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { IconType } from '../../../constants';
|
|
4
3
|
import { prioritiseIcon } from '../../common/icon';
|
|
5
4
|
import { extractorPriorityMap as priorityMap } from '../../common/icon/priority';
|
|
@@ -63,58 +62,34 @@ function typeToIconDescriptor(_ref3) {
|
|
|
63
62
|
data = _ref3.data;
|
|
64
63
|
switch (type) {
|
|
65
64
|
case 'atlassian:Goal':
|
|
66
|
-
return
|
|
65
|
+
return {
|
|
67
66
|
icon: IconType.Task,
|
|
68
67
|
label: label
|
|
69
|
-
} : {
|
|
70
|
-
icon: IconType.Task,
|
|
71
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
72
|
-
label: label || 'Goal'
|
|
73
68
|
};
|
|
74
69
|
case 'atlassian:Project':
|
|
75
|
-
return
|
|
70
|
+
return {
|
|
76
71
|
icon: IconType.Project,
|
|
77
72
|
label: label
|
|
78
|
-
} : {
|
|
79
|
-
icon: IconType.Project,
|
|
80
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
81
|
-
label: label || 'Project'
|
|
82
73
|
};
|
|
83
74
|
case 'atlassian:SourceCodeCommit':
|
|
84
|
-
return
|
|
75
|
+
return {
|
|
85
76
|
icon: IconType.Commit,
|
|
86
77
|
label: label
|
|
87
|
-
} : {
|
|
88
|
-
icon: IconType.Commit,
|
|
89
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
90
|
-
label: label || 'Commit'
|
|
91
78
|
};
|
|
92
79
|
case 'atlassian:SourceCodePullRequest':
|
|
93
|
-
return
|
|
80
|
+
return {
|
|
94
81
|
icon: IconType.PullRequest,
|
|
95
82
|
label: label
|
|
96
|
-
} : {
|
|
97
|
-
icon: IconType.PullRequest,
|
|
98
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
99
|
-
label: label || 'Pull request'
|
|
100
83
|
};
|
|
101
84
|
case 'atlassian:SourceCodeReference':
|
|
102
|
-
return
|
|
85
|
+
return {
|
|
103
86
|
icon: IconType.Branch,
|
|
104
87
|
label: label
|
|
105
|
-
} : {
|
|
106
|
-
icon: IconType.Branch,
|
|
107
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
108
|
-
label: label || 'Reference'
|
|
109
88
|
};
|
|
110
89
|
case 'atlassian:SourceCodeRepository':
|
|
111
|
-
return
|
|
90
|
+
return {
|
|
112
91
|
icon: IconType.Repo,
|
|
113
92
|
label: label
|
|
114
|
-
} : {
|
|
115
|
-
icon: IconType.Repo,
|
|
116
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
117
|
-
label: label || 'Repository'
|
|
118
93
|
};
|
|
119
94
|
case 'atlassian:Task':
|
|
120
95
|
var taskLabel = label || 'Task';
|
|
@@ -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: "43.
|
|
7
|
+
packageVersion: "43.21.0"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -40,9 +40,8 @@ export var getIconForFileType = function getIconForFileType(fileMimeType) {
|
|
|
40
40
|
if (!icon) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
var _icon = _slicedToArray(icon,
|
|
44
|
-
|
|
45
|
-
importCb = _icon[1];
|
|
43
|
+
var _icon = _slicedToArray(icon, 1),
|
|
44
|
+
importCb = _icon[0];
|
|
46
45
|
if (!importCb) {
|
|
47
46
|
return;
|
|
48
47
|
}
|
|
@@ -58,7 +57,6 @@ export var getIconForFileType = function getIconForFileType(fileMimeType) {
|
|
|
58
57
|
}); // because we're using dynamic loading here, TS will not be able to infer the type
|
|
59
58
|
|
|
60
59
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
61
|
-
label: label,
|
|
62
60
|
testId: "document-file-format-icon"
|
|
63
61
|
});
|
|
64
62
|
};
|
|
@@ -418,11 +416,11 @@ export var getLazyIcons = function getLazyIcons() {
|
|
|
418
416
|
var getTypeToIconMap = function getTypeToIconMap(fileFormat) {
|
|
419
417
|
var _lazyIcons$iconDescri;
|
|
420
418
|
var iconDescriptor = extractFileFormatIcon(fileFormat);
|
|
421
|
-
if (!(iconDescriptor !== null && iconDescriptor !== void 0 && iconDescriptor.icon)
|
|
419
|
+
if (!(iconDescriptor !== null && iconDescriptor !== void 0 && iconDescriptor.icon)) {
|
|
422
420
|
return null;
|
|
423
421
|
}
|
|
424
422
|
var lazyIcons = getLazyIcons();
|
|
425
|
-
return [
|
|
423
|
+
return [(_lazyIcons$iconDescri = lazyIcons[iconDescriptor.icon]) === null || _lazyIcons$iconDescri === void 0 ? void 0 : _lazyIcons$iconDescri.default];
|
|
426
424
|
};
|
|
427
425
|
export var getIframeSandboxAttribute = function getIframeSandboxAttribute(isTrusted) {
|
|
428
426
|
if (isTrusted) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
|
|
7
6
|
var styles = null;
|
|
8
7
|
|
|
@@ -25,10 +24,7 @@ var LayeredLink = function LayeredLink(_ref) {
|
|
|
25
24
|
href: url,
|
|
26
25
|
onClick: onClick,
|
|
27
26
|
onMouseDown: onMouseDown,
|
|
28
|
-
target: target
|
|
29
|
-
tabIndex: fg('platform-linking-smart-card-layered-link-a11y') ? undefined : -1 // Hide tab index and let the title link be the link.
|
|
30
|
-
,
|
|
31
|
-
"aria-hidden": fg('platform-linking-smart-card-layered-link-a11y') ? undefined : true // This is to avoid screen readers reading out the link twice.
|
|
27
|
+
target: target
|
|
32
28
|
}, text);
|
|
33
29
|
};
|
|
34
30
|
export default LayeredLink;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
._1bto1l2s{text-overflow:ellipsis}
|
|
14
14
|
._1e0c1abx{display:-webkit-inline-box}
|
|
15
15
|
._1e0c1nu9{display:inline}
|
|
16
|
+
._1hms8stv{text-decoration-line:underline}
|
|
16
17
|
._1hmsglyw{text-decoration-line:none}
|
|
17
18
|
._1nmz9jpi{word-break:break-all}
|
|
18
19
|
._1qu2glyw{outline-style:none}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/* styled.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["truncateInline", "withoutBackground", "isHovered", "
|
|
4
|
+
var _excluded = ["truncateInline", "withoutBackground", "isHovered", "isSelected", "viewType"],
|
|
5
5
|
_excluded2 = ["truncateInline", "withoutBackground", "isHovered", "isInteractive", "isSelected", "href", "viewType"];
|
|
6
6
|
import "./styled.compiled.css";
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
import React, { forwardRef } from 'react';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { B100, B200, B400, B50, N40 } from '@atlaskit/theme/colors';
|
|
10
11
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
11
12
|
export var WrapperSpan = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
12
13
|
var truncateInline = _ref.truncateInline,
|
|
13
14
|
withoutBackground = _ref.withoutBackground,
|
|
14
15
|
isHovered = _ref.isHovered,
|
|
15
|
-
isInteractive = _ref.isInteractive,
|
|
16
16
|
isSelected = _ref.isSelected,
|
|
17
|
-
href = _ref.href,
|
|
18
17
|
viewType = _ref.viewType,
|
|
19
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
var experimentValue = viewType === 'unauthorised' ? expVal('platform_inline_smartcard_connect_button_exp', 'cohort', 'control') : 'control';
|
|
@@ -38,7 +37,7 @@ export var WrapperAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
38
37
|
href: href,
|
|
39
38
|
ref: ref
|
|
40
39
|
}, props, {
|
|
41
|
-
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
|
|
40
|
+
className: ax(["_1yt4x7n9 _2rko12b0 _v56415x0 _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _1e0c1abx _1yyjkb7n _sudp1e54 _nr8z1o8l _1voyv77o _3kwxidpf _jqg5v77o _6vwiidpf", truncateInline && experimentValue !== 'control' && "_syaz15cr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19it1x13 _bfhkhp5a _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _1nrm1r31 _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu1r31 _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b1r31 _4fprglyw _5goinqa1 _9oik1r31 _1bnxglyw _jf4cnqa1 _bfw71x13 _1nrm1r31 _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg", viewType === 'errored' && fg('navx-2565-inline-card-error-state-underline') && "_4bfu1r31 _1hms8stv _ajmmnqa1 _9oik1r31 _1bnxglyw _jf4cnqa1"])
|
|
42
41
|
}), props.children);
|
|
43
42
|
});
|
|
44
43
|
var baseWrapperStyles = null;
|
|
@@ -47,6 +46,7 @@ var baseWrapperStyles = null;
|
|
|
47
46
|
var interactiveStyles = null;
|
|
48
47
|
var hoveredStyles = null;
|
|
49
48
|
var hoveredWithBackgroundStyles = null;
|
|
49
|
+
var errorViewTypeStyles = null;
|
|
50
50
|
var withoutBackgroundStyles = null;
|
|
51
51
|
var withBackgroundStyles = null;
|
|
52
52
|
var truncateStyles = null;
|
|
@@ -155,12 +155,14 @@ export var InlineCard = function InlineCard(_ref2) {
|
|
|
155
155
|
case 'fallback':
|
|
156
156
|
case 'errored':
|
|
157
157
|
default:
|
|
158
|
-
return /*#__PURE__*/React.createElement(CardLinkView, {
|
|
158
|
+
return /*#__PURE__*/React.createElement(CardLinkView, _extends({
|
|
159
159
|
link: url,
|
|
160
160
|
isSelected: isSelected,
|
|
161
161
|
onClick: handleFrameClick,
|
|
162
162
|
testId: testIdWithStatus || 'inline-card-errored-view',
|
|
163
163
|
truncateInline: truncateInline
|
|
164
|
-
})
|
|
164
|
+
}, fg('navx-2565-inline-card-error-state-underline') ? {
|
|
165
|
+
viewType: 'errored'
|
|
166
|
+
} : {}));
|
|
165
167
|
}
|
|
166
168
|
};
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "43.
|
|
18
|
+
packageVersion: "43.21.0",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type ViewType = 'default' | 'unauthorised' | 'errored';
|
|
2
3
|
export interface FrameViewProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
className?: string;
|
|
@@ -14,7 +15,7 @@ export interface FrameViewProps {
|
|
|
14
15
|
/** A flag that determines whether a card is truncated to 1 line */
|
|
15
16
|
truncateInline?: boolean;
|
|
16
17
|
/** A flag that determines the type of view */
|
|
17
|
-
viewType?:
|
|
18
|
+
viewType?: ViewType;
|
|
18
19
|
/** A flag that determines whether the card needs a backgorund or not */
|
|
19
20
|
withoutBackground?: boolean;
|
|
20
21
|
}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import type { ViewType } from './index';
|
|
6
7
|
export interface WrapperProps extends React.ComponentProps<any> {
|
|
7
8
|
href?: string;
|
|
8
9
|
isHovered?: boolean;
|
|
9
10
|
isInteractive?: boolean;
|
|
10
11
|
isSelected?: boolean;
|
|
11
12
|
truncateInline?: boolean;
|
|
12
|
-
viewType?:
|
|
13
|
+
viewType?: ViewType;
|
|
13
14
|
withoutBackground?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const WrapperSpan: React.ForwardRefExoticComponent<Omit<WrapperProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type ViewType = 'default' | 'unauthorised' | 'errored';
|
|
2
3
|
export interface FrameViewProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
className?: string;
|
|
@@ -14,7 +15,7 @@ export interface FrameViewProps {
|
|
|
14
15
|
/** A flag that determines whether a card is truncated to 1 line */
|
|
15
16
|
truncateInline?: boolean;
|
|
16
17
|
/** A flag that determines the type of view */
|
|
17
|
-
viewType?:
|
|
18
|
+
viewType?: ViewType;
|
|
18
19
|
/** A flag that determines whether the card needs a backgorund or not */
|
|
19
20
|
withoutBackground?: boolean;
|
|
20
21
|
}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import type { ViewType } from './index';
|
|
6
7
|
export interface WrapperProps extends React.ComponentProps<any> {
|
|
7
8
|
href?: string;
|
|
8
9
|
isHovered?: boolean;
|
|
9
10
|
isInteractive?: boolean;
|
|
10
11
|
isSelected?: boolean;
|
|
11
12
|
truncateInline?: boolean;
|
|
12
|
-
viewType?:
|
|
13
|
+
viewType?: ViewType;
|
|
13
14
|
withoutBackground?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const WrapperSpan: React.ForwardRefExoticComponent<Omit<WrapperProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.22.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@atlassian/a11y-jest-testing": "^0.7.0",
|
|
107
107
|
"@atlassian/analytics-tooling": "workspace:^",
|
|
108
108
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
109
|
-
"@atlassian/gemini": "^1.
|
|
109
|
+
"@atlassian/gemini": "^1.29.0",
|
|
110
110
|
"@atlassian/testing-library": "^0.4.0",
|
|
111
111
|
"@testing-library/dom": "^10.1.0",
|
|
112
112
|
"@testing-library/jest-dom": "^6.4.5",
|
|
@@ -219,9 +219,6 @@
|
|
|
219
219
|
"navx-2478-sl-fix-hover-card-unresolved-view": {
|
|
220
220
|
"type": "boolean"
|
|
221
221
|
},
|
|
222
|
-
"platform-linking-smart-card-layered-link-a11y": {
|
|
223
|
-
"type": "boolean"
|
|
224
|
-
},
|
|
225
222
|
"platform_navx_flex_card_status_dropdown_a11y_fix": {
|
|
226
223
|
"type": "boolean"
|
|
227
224
|
},
|
|
@@ -234,14 +231,14 @@
|
|
|
234
231
|
"platform_navx_send_context_to_ugs_for_rel_links": {
|
|
235
232
|
"type": "boolean"
|
|
236
233
|
},
|
|
237
|
-
"navx-2827-eslint-object-translation-smart-links": {
|
|
238
|
-
"type": "boolean"
|
|
239
|
-
},
|
|
240
234
|
"navx-2811-smart-link-a11y-image-alt": {
|
|
241
235
|
"type": "boolean"
|
|
242
236
|
},
|
|
243
237
|
"ufo_hold_flexible_card": {
|
|
244
238
|
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
"navx-2565-inline-card-error-state-underline": {
|
|
241
|
+
"type": "boolean"
|
|
245
242
|
}
|
|
246
243
|
},
|
|
247
244
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|