@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,5 +1,4 @@
|
|
|
1
1
|
import { isConfluenceGenerator } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { IconType } from '../../../constants';
|
|
4
3
|
/**
|
|
5
4
|
* Computes the relevant icon for a document type.
|
|
@@ -19,78 +18,46 @@ import { IconType } from '../../../constants';
|
|
|
19
18
|
const extractDocumentTypeIcon = (documentType, label, providerId) => {
|
|
20
19
|
switch (documentType) {
|
|
21
20
|
case 'schema:BlogPosting':
|
|
22
|
-
return
|
|
21
|
+
return {
|
|
23
22
|
icon: IconType.Blog,
|
|
24
23
|
label
|
|
25
|
-
} : {
|
|
26
|
-
icon: IconType.Blog,
|
|
27
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
28
|
-
label: label || 'Blog'
|
|
29
24
|
};
|
|
30
25
|
case 'schema:DigitalDocument':
|
|
31
26
|
if (providerId && isConfluenceGenerator(providerId)) {
|
|
32
|
-
return
|
|
27
|
+
return {
|
|
33
28
|
icon: IconType.LiveDocument,
|
|
34
29
|
label
|
|
35
|
-
} : {
|
|
36
|
-
icon: IconType.LiveDocument,
|
|
37
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
38
|
-
label: label || 'Live Document'
|
|
39
30
|
};
|
|
40
31
|
} else {
|
|
41
|
-
return
|
|
32
|
+
return {
|
|
42
33
|
icon: IconType.File,
|
|
43
34
|
label
|
|
44
|
-
} : {
|
|
45
|
-
icon: IconType.File,
|
|
46
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
47
|
-
label: label || 'File'
|
|
48
35
|
};
|
|
49
36
|
}
|
|
50
37
|
case 'schema:TextDigitalDocument':
|
|
51
|
-
return
|
|
38
|
+
return {
|
|
52
39
|
icon: IconType.Document,
|
|
53
40
|
label
|
|
54
|
-
} : {
|
|
55
|
-
icon: IconType.Document,
|
|
56
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
57
|
-
label: label || 'Document'
|
|
58
41
|
};
|
|
59
42
|
case 'schema:PresentationDigitalDocument':
|
|
60
|
-
return
|
|
43
|
+
return {
|
|
61
44
|
icon: IconType.Presentation,
|
|
62
45
|
label
|
|
63
|
-
} : {
|
|
64
|
-
icon: IconType.Presentation,
|
|
65
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
66
|
-
label: label || 'Presentation'
|
|
67
46
|
};
|
|
68
47
|
case 'schema:SpreadsheetDigitalDocument':
|
|
69
|
-
return
|
|
48
|
+
return {
|
|
70
49
|
icon: IconType.Spreadsheet,
|
|
71
50
|
label
|
|
72
|
-
} : {
|
|
73
|
-
icon: IconType.Spreadsheet,
|
|
74
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
75
|
-
label: label || 'Spreadsheet'
|
|
76
51
|
};
|
|
77
52
|
case 'atlassian:Template':
|
|
78
|
-
return
|
|
53
|
+
return {
|
|
79
54
|
icon: IconType.Template,
|
|
80
55
|
label
|
|
81
|
-
} : {
|
|
82
|
-
icon: IconType.Template,
|
|
83
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
84
|
-
label: label || 'Template'
|
|
85
56
|
};
|
|
86
57
|
case 'atlassian:UndefinedLink':
|
|
87
|
-
return
|
|
58
|
+
return {
|
|
88
59
|
icon: IconType.Document,
|
|
89
60
|
label
|
|
90
|
-
} : {
|
|
91
|
-
icon: IconType.Document,
|
|
92
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
93
|
-
label: label || 'Undefined link'
|
|
94
61
|
};
|
|
95
62
|
default:
|
|
96
63
|
return undefined;
|
|
@@ -1,144 +1,83 @@
|
|
|
1
|
-
import { fg } from "@atlaskit/platform-feature-flags";
|
|
2
1
|
import { IconType } from '../../../constants';
|
|
3
2
|
const 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 @@ const 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 @@ const 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';
|
|
@@ -62,58 +61,34 @@ function typeToIconDescriptor({
|
|
|
62
61
|
}) {
|
|
63
62
|
switch (type) {
|
|
64
63
|
case 'atlassian:Goal':
|
|
65
|
-
return
|
|
64
|
+
return {
|
|
66
65
|
icon: IconType.Task,
|
|
67
66
|
label
|
|
68
|
-
} : {
|
|
69
|
-
icon: IconType.Task,
|
|
70
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
71
|
-
label: label || 'Goal'
|
|
72
67
|
};
|
|
73
68
|
case 'atlassian:Project':
|
|
74
|
-
return
|
|
69
|
+
return {
|
|
75
70
|
icon: IconType.Project,
|
|
76
71
|
label
|
|
77
|
-
} : {
|
|
78
|
-
icon: IconType.Project,
|
|
79
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
80
|
-
label: label || 'Project'
|
|
81
72
|
};
|
|
82
73
|
case 'atlassian:SourceCodeCommit':
|
|
83
|
-
return
|
|
74
|
+
return {
|
|
84
75
|
icon: IconType.Commit,
|
|
85
76
|
label
|
|
86
|
-
} : {
|
|
87
|
-
icon: IconType.Commit,
|
|
88
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
89
|
-
label: label || 'Commit'
|
|
90
77
|
};
|
|
91
78
|
case 'atlassian:SourceCodePullRequest':
|
|
92
|
-
return
|
|
79
|
+
return {
|
|
93
80
|
icon: IconType.PullRequest,
|
|
94
81
|
label
|
|
95
|
-
} : {
|
|
96
|
-
icon: IconType.PullRequest,
|
|
97
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
98
|
-
label: label || 'Pull request'
|
|
99
82
|
};
|
|
100
83
|
case 'atlassian:SourceCodeReference':
|
|
101
|
-
return
|
|
84
|
+
return {
|
|
102
85
|
icon: IconType.Branch,
|
|
103
86
|
label
|
|
104
|
-
} : {
|
|
105
|
-
icon: IconType.Branch,
|
|
106
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
107
|
-
label: label || 'Reference'
|
|
108
87
|
};
|
|
109
88
|
case 'atlassian:SourceCodeRepository':
|
|
110
|
-
return
|
|
89
|
+
return {
|
|
111
90
|
icon: IconType.Repo,
|
|
112
91
|
label
|
|
113
|
-
} : {
|
|
114
|
-
icon: IconType.Repo,
|
|
115
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
116
|
-
label: label || 'Repository'
|
|
117
92
|
};
|
|
118
93
|
case 'atlassian:Task':
|
|
119
94
|
const taskLabel = label || 'Task';
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "43.
|
|
5
|
+
packageVersion: "43.21.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -30,7 +30,7 @@ export const getIconForFileType = fileMimeType => {
|
|
|
30
30
|
if (!icon) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
const [
|
|
33
|
+
const [importCb] = icon;
|
|
34
34
|
if (!importCb) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
@@ -40,7 +40,6 @@ export const getIconForFileType = fileMimeType => {
|
|
|
40
40
|
}); // because we're using dynamic loading here, TS will not be able to infer the type
|
|
41
41
|
|
|
42
42
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
43
|
-
label: label,
|
|
44
43
|
testId: "document-file-format-icon"
|
|
45
44
|
});
|
|
46
45
|
};
|
|
@@ -286,11 +285,11 @@ export const getLazyIcons = () => {
|
|
|
286
285
|
const getTypeToIconMap = fileFormat => {
|
|
287
286
|
var _lazyIcons$iconDescri;
|
|
288
287
|
const iconDescriptor = extractFileFormatIcon(fileFormat);
|
|
289
|
-
if (!(iconDescriptor !== null && iconDescriptor !== void 0 && iconDescriptor.icon)
|
|
288
|
+
if (!(iconDescriptor !== null && iconDescriptor !== void 0 && iconDescriptor.icon)) {
|
|
290
289
|
return null;
|
|
291
290
|
}
|
|
292
291
|
const lazyIcons = getLazyIcons();
|
|
293
|
-
return [
|
|
292
|
+
return [(_lazyIcons$iconDescri = lazyIcons[iconDescriptor.icon]) === null || _lazyIcons$iconDescri === void 0 ? void 0 : _lazyIcons$iconDescri.default];
|
|
294
293
|
};
|
|
295
294
|
export const getIframeSandboxAttribute = isTrusted => {
|
|
296
295
|
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
|
const styles = null;
|
|
8
7
|
|
|
@@ -26,10 +25,7 @@ const LayeredLink = ({
|
|
|
26
25
|
href: url,
|
|
27
26
|
onClick: onClick,
|
|
28
27
|
onMouseDown: onMouseDown,
|
|
29
|
-
target: target
|
|
30
|
-
tabIndex: fg('platform-linking-smart-card-layered-link-a11y') ? undefined : -1 // Hide tab index and let the title link be the link.
|
|
31
|
-
,
|
|
32
|
-
"aria-hidden": fg('platform-linking-smart-card-layered-link-a11y') ? undefined : true // This is to avoid screen readers reading out the link twice.
|
|
28
|
+
target: target
|
|
33
29
|
}, text);
|
|
34
30
|
};
|
|
35
31
|
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}
|
|
@@ -3,15 +3,14 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./styled.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { B100, B200, B400, B50, N40 } from '@atlaskit/theme/colors';
|
|
7
8
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
8
9
|
export const WrapperSpan = /*#__PURE__*/forwardRef(({
|
|
9
10
|
truncateInline,
|
|
10
11
|
withoutBackground,
|
|
11
12
|
isHovered,
|
|
12
|
-
isInteractive,
|
|
13
13
|
isSelected,
|
|
14
|
-
href,
|
|
15
14
|
viewType,
|
|
16
15
|
...props
|
|
17
16
|
}, ref) => {
|
|
@@ -37,7 +36,7 @@ export const WrapperAnchor = /*#__PURE__*/forwardRef(({
|
|
|
37
36
|
href: href,
|
|
38
37
|
ref: ref
|
|
39
38
|
}, props, {
|
|
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"])
|
|
39
|
+
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"])
|
|
41
40
|
}), props.children);
|
|
42
41
|
});
|
|
43
42
|
const baseWrapperStyles = null;
|
|
@@ -46,6 +45,7 @@ const baseWrapperStyles = null;
|
|
|
46
45
|
const interactiveStyles = null;
|
|
47
46
|
const hoveredStyles = null;
|
|
48
47
|
const hoveredWithBackgroundStyles = null;
|
|
48
|
+
const errorViewTypeStyles = null;
|
|
49
49
|
const withoutBackgroundStyles = null;
|
|
50
50
|
const withBackgroundStyles = null;
|
|
51
51
|
const truncateStyles = null;
|
|
@@ -156,12 +156,14 @@ export const InlineCard = ({
|
|
|
156
156
|
case 'fallback':
|
|
157
157
|
case 'errored':
|
|
158
158
|
default:
|
|
159
|
-
return /*#__PURE__*/React.createElement(CardLinkView, {
|
|
159
|
+
return /*#__PURE__*/React.createElement(CardLinkView, _extends({
|
|
160
160
|
link: url,
|
|
161
161
|
isSelected: isSelected,
|
|
162
162
|
onClick: handleFrameClick,
|
|
163
163
|
testId: testIdWithStatus || 'inline-card-errored-view',
|
|
164
164
|
truncateInline: truncateInline
|
|
165
|
-
})
|
|
165
|
+
}, fg('navx-2565-inline-card-error-state-underline') ? {
|
|
166
|
+
viewType: 'errored'
|
|
167
|
+
} : {}));
|
|
166
168
|
}
|
|
167
169
|
};
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
const PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "43.
|
|
15
|
+
packageVersion: "43.21.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
package/dist/esm/__tests__/vr-tests/__snapshots__/inline-card/inline-card-error-view--default.png
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:ac3cb4d7414bc39e617615146ecf45fec6233b9dc4dbfc44b4159fd1b15ff064
|
|
3
|
+
size 2237
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:10a91775c476b53cb155078f29f8877f33d6deced7773c24cee25290bb9c0533
|
|
3
|
+
size 2205
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:78f131b89db0ba674b76b3417b107aac92d0cdb05b7d29d472a50cc9d3a0bbb6
|
|
3
|
+
size 1499
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isConfluenceGenerator } from '@atlaskit/link-extractors';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { IconType } from '../../../constants';
|
|
4
3
|
/**
|
|
5
4
|
* Computes the relevant icon for a document type.
|
|
@@ -19,78 +18,46 @@ import { IconType } from '../../../constants';
|
|
|
19
18
|
var extractDocumentTypeIcon = function extractDocumentTypeIcon(documentType, label, providerId) {
|
|
20
19
|
switch (documentType) {
|
|
21
20
|
case 'schema:BlogPosting':
|
|
22
|
-
return
|
|
21
|
+
return {
|
|
23
22
|
icon: IconType.Blog,
|
|
24
23
|
label: label
|
|
25
|
-
} : {
|
|
26
|
-
icon: IconType.Blog,
|
|
27
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
28
|
-
label: label || 'Blog'
|
|
29
24
|
};
|
|
30
25
|
case 'schema:DigitalDocument':
|
|
31
26
|
if (providerId && isConfluenceGenerator(providerId)) {
|
|
32
|
-
return
|
|
27
|
+
return {
|
|
33
28
|
icon: IconType.LiveDocument,
|
|
34
29
|
label: label
|
|
35
|
-
} : {
|
|
36
|
-
icon: IconType.LiveDocument,
|
|
37
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
38
|
-
label: label || 'Live Document'
|
|
39
30
|
};
|
|
40
31
|
} else {
|
|
41
|
-
return
|
|
32
|
+
return {
|
|
42
33
|
icon: IconType.File,
|
|
43
34
|
label: label
|
|
44
|
-
} : {
|
|
45
|
-
icon: IconType.File,
|
|
46
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
47
|
-
label: label || 'File'
|
|
48
35
|
};
|
|
49
36
|
}
|
|
50
37
|
case 'schema:TextDigitalDocument':
|
|
51
|
-
return
|
|
38
|
+
return {
|
|
52
39
|
icon: IconType.Document,
|
|
53
40
|
label: label
|
|
54
|
-
} : {
|
|
55
|
-
icon: IconType.Document,
|
|
56
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
57
|
-
label: label || 'Document'
|
|
58
41
|
};
|
|
59
42
|
case 'schema:PresentationDigitalDocument':
|
|
60
|
-
return
|
|
43
|
+
return {
|
|
61
44
|
icon: IconType.Presentation,
|
|
62
45
|
label: label
|
|
63
|
-
} : {
|
|
64
|
-
icon: IconType.Presentation,
|
|
65
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
66
|
-
label: label || 'Presentation'
|
|
67
46
|
};
|
|
68
47
|
case 'schema:SpreadsheetDigitalDocument':
|
|
69
|
-
return
|
|
48
|
+
return {
|
|
70
49
|
icon: IconType.Spreadsheet,
|
|
71
50
|
label: label
|
|
72
|
-
} : {
|
|
73
|
-
icon: IconType.Spreadsheet,
|
|
74
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
75
|
-
label: label || 'Spreadsheet'
|
|
76
51
|
};
|
|
77
52
|
case 'atlassian:Template':
|
|
78
|
-
return
|
|
53
|
+
return {
|
|
79
54
|
icon: IconType.Template,
|
|
80
55
|
label: label
|
|
81
|
-
} : {
|
|
82
|
-
icon: IconType.Template,
|
|
83
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
84
|
-
label: label || 'Template'
|
|
85
56
|
};
|
|
86
57
|
case 'atlassian:UndefinedLink':
|
|
87
|
-
return
|
|
58
|
+
return {
|
|
88
59
|
icon: IconType.Document,
|
|
89
60
|
label: label
|
|
90
|
-
} : {
|
|
91
|
-
icon: IconType.Document,
|
|
92
|
-
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
93
|
-
label: label || 'Undefined link'
|
|
94
61
|
};
|
|
95
62
|
default:
|
|
96
63
|
return undefined;
|