@atlaskit/smart-card 43.17.4 → 43.17.6
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/__tests__/vr-tests/__snapshots__/block-card/block-card-unauthorised-view-with-experiment--default--platform-sl-3p-unauth-paste-as-block-card-card-by-default-and-new-design.png +0 -0
- package/dist/cjs/extractors/flexible/icon/extract-document-type-icon.js +41 -16
- package/dist/cjs/extractors/flexible/icon/extract-file-formatIcon.js +89 -46
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +31 -12
- package/dist/cjs/utils/index.js +1 -10
- package/dist/cjs/view/EmbedModal/components/link-info/index.compiled.css +15 -1
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +108 -1
- package/dist/cjs/view/EmbedModal/index.js +13 -4
- package/dist/es2019/__tests__/vr-tests/__snapshots__/block-card/block-card-unauthorised-view-with-experiment--default--platform-sl-3p-unauth-paste-as-block-card-card-by-default-and-new-design.png +0 -0
- package/dist/es2019/extractors/flexible/icon/extract-document-type-icon.js +41 -16
- package/dist/es2019/extractors/flexible/icon/extract-file-formatIcon.js +89 -45
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +31 -12
- package/dist/es2019/utils/index.js +0 -8
- package/dist/es2019/view/EmbedModal/components/link-info/index.compiled.css +15 -1
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +103 -1
- package/dist/es2019/view/EmbedModal/index.js +13 -4
- package/dist/esm/__tests__/vr-tests/__snapshots__/block-card/block-card-unauthorised-view-with-experiment--default--platform-sl-3p-unauth-paste-as-block-card-card-by-default-and-new-design.png +0 -0
- package/dist/esm/extractors/flexible/icon/extract-document-type-icon.js +41 -16
- package/dist/esm/extractors/flexible/icon/extract-file-formatIcon.js +89 -45
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +31 -12
- package/dist/esm/utils/index.js +0 -9
- package/dist/esm/view/EmbedModal/components/link-info/index.compiled.css +15 -1
- package/dist/esm/view/EmbedModal/components/link-info/index.js +108 -1
- package/dist/esm/view/EmbedModal/index.js +13 -4
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/view/EmbedModal/components/link-info/index.d.ts +7 -2
- package/dist/types/view/EmbedModal/components/link-info/types.d.ts +2 -0
- package/dist/types-ts4.5/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/view/EmbedModal/components/link-info/index.d.ts +7 -2
- package/dist/types-ts4.5/view/EmbedModal/components/link-info/types.d.ts +2 -0
- package/package.json +12 -6
|
@@ -18,6 +18,7 @@ var _fullscreenExit = _interopRequireDefault(require("@atlaskit/icon/core/fullsc
|
|
|
18
18
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
19
19
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
20
20
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
21
22
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
22
23
|
var _messages = require("../../../../messages");
|
|
23
24
|
var _Icon = require("../../../common/Icon");
|
|
@@ -33,6 +34,9 @@ var iconSize = '24px';
|
|
|
33
34
|
var iconCss = null;
|
|
34
35
|
var titleCss = null;
|
|
35
36
|
var actionCss = null;
|
|
37
|
+
var buttonGroupCss = null;
|
|
38
|
+
var listItemCSS = null;
|
|
39
|
+
var resizeButtonCss = null;
|
|
36
40
|
var LinkInfo = function LinkInfo(_ref) {
|
|
37
41
|
var icon = _ref.icon,
|
|
38
42
|
providerName = _ref.providerName,
|
|
@@ -137,4 +141,107 @@ var LinkInfo = function LinkInfo(_ref) {
|
|
|
137
141
|
testId: testId
|
|
138
142
|
}))));
|
|
139
143
|
};
|
|
140
|
-
var
|
|
144
|
+
var LinkInfoNew = function LinkInfoNew(_ref2) {
|
|
145
|
+
var focusRef = _ref2.focusRef,
|
|
146
|
+
icon = _ref2.icon,
|
|
147
|
+
providerName = _ref2.providerName,
|
|
148
|
+
onDownloadButtonClick = _ref2.onDownloadButtonClick,
|
|
149
|
+
onResizeButtonClick = _ref2.onResizeButtonClick,
|
|
150
|
+
onViewButtonClick = _ref2.onViewButtonClick,
|
|
151
|
+
size = _ref2.size,
|
|
152
|
+
testId = _ref2.testId,
|
|
153
|
+
title = _ref2.title;
|
|
154
|
+
var _useModal2 = (0, _modalDialog.useModal)(),
|
|
155
|
+
onClose = _useModal2.onClose;
|
|
156
|
+
var _useIntl2 = (0, _reactIntlNext.useIntl)(),
|
|
157
|
+
formatMessage = _useIntl2.formatMessage;
|
|
158
|
+
var downloadButton = (0, _react.useMemo)(function () {
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
160
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.download),
|
|
161
|
+
icon: function icon() {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(_download.default, {
|
|
163
|
+
label: "",
|
|
164
|
+
spacing: "spacious",
|
|
165
|
+
color: "currentColor"
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
label: _messages.messages.download,
|
|
169
|
+
onClick: onDownloadButtonClick,
|
|
170
|
+
testId: "".concat(testId, "-download")
|
|
171
|
+
});
|
|
172
|
+
}, [onDownloadButtonClick, testId]);
|
|
173
|
+
var urlButton = (0, _react.useMemo)(function () {
|
|
174
|
+
if (onViewButtonClick) {
|
|
175
|
+
var content = providerName ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.viewIn), " ", providerName) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.viewOriginal);
|
|
176
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
177
|
+
content: content,
|
|
178
|
+
icon: function icon() {
|
|
179
|
+
return /*#__PURE__*/_react.default.createElement(_linkExternal.default, {
|
|
180
|
+
label: "",
|
|
181
|
+
spacing: "spacious",
|
|
182
|
+
color: "currentColor"
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
label: _messages.messages.viewOriginal,
|
|
186
|
+
onClick: onViewButtonClick,
|
|
187
|
+
testId: "".concat(testId, "-url")
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}, [onViewButtonClick, providerName, testId]);
|
|
191
|
+
var sizeButton = (0, _react.useMemo)(function () {
|
|
192
|
+
var isFullScreen = size === _constants.MAX_MODAL_SIZE;
|
|
193
|
+
var message = isFullScreen ? _messages.messages.preview_min_size : _messages.messages.preview_max_size;
|
|
194
|
+
var _icon2 = isFullScreen ? /*#__PURE__*/_react.default.createElement(_fullscreenExit.default, {
|
|
195
|
+
label: "",
|
|
196
|
+
spacing: "spacious",
|
|
197
|
+
color: "currentColor"
|
|
198
|
+
}) : /*#__PURE__*/_react.default.createElement(_fullscreenEnter.default, {
|
|
199
|
+
label: "",
|
|
200
|
+
spacing: "spacious",
|
|
201
|
+
color: "currentColor"
|
|
202
|
+
});
|
|
203
|
+
return /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
|
|
204
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, message),
|
|
205
|
+
icon: function icon() {
|
|
206
|
+
return _icon2;
|
|
207
|
+
},
|
|
208
|
+
label: message,
|
|
209
|
+
onClick: onResizeButtonClick,
|
|
210
|
+
testId: "".concat(testId, "-resize")
|
|
211
|
+
});
|
|
212
|
+
}, [onResizeButtonClick, size, testId]);
|
|
213
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
214
|
+
className: (0, _runtime.ax)(["_zulpu2gc _1e0c1txw _19bv1ejb _u5f31ejb _ca0q1ejb _n3tdpxbi _1wpz1fhb _4t3i1tcg"])
|
|
215
|
+
}, icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
216
|
+
"data-testid": "".concat(testId, "-icon"),
|
|
217
|
+
className: (0, _runtime.ax)(["_4t3i1tcg _gire1tcg _yrry1tcg _1bnm1tcg _bna71tcg _1xjx1tcg _17521tcg _1tke1tcg _x9xj1tcg _v5981tcg _z15s1tcg _qci81tcg _15iz1tcg _erub1tcg _c71l1tcg _1q121tcg _2s1x1tcg _1rh41tcg _19l31tcg _1pr21tcg _1u5t1tcg _1bsb1tcg _1xyl1tcg _1h1b1tcg _prfw1tcg _mezj1tcg _e2oo1tcg _w8l51tcg _1ul91tcg _1ekg1tcg _jbhf1tcg _11hh1tcg _1rg21tcg _q7cv1tcg _xwbj1tcg _p12f1tcg _1mj01tcg _1r9c1tcg _1xch1tcg _rtys1tcg _b8nk1tcg _4x201tcg"])
|
|
218
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.Icon, icon)), /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
className: (0, _runtime.ax)(["_16jlkb7n _1o9zidpf _i0dlf1ug _1e0c1txw _2lx21bp4 _1bah1h6o _1wpz1fhb"])
|
|
220
|
+
}, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
221
|
+
size: "small",
|
|
222
|
+
color: "color.text",
|
|
223
|
+
ref: focusRef,
|
|
224
|
+
testId: "".concat(testId, "-title")
|
|
225
|
+
}, title)), /*#__PURE__*/_react.default.createElement("ul", {
|
|
226
|
+
role: "list",
|
|
227
|
+
className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _qtt8glyw _1e0c1txw _19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _1pfhze3t _6rthze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _bozgze3t"])
|
|
228
|
+
}, onDownloadButtonClick && /*#__PURE__*/_react.default.createElement("li", {
|
|
229
|
+
className: (0, _runtime.ax)(["_4cvr1h6o _19pkidpf"])
|
|
230
|
+
}, downloadButton), /*#__PURE__*/_react.default.createElement("li", {
|
|
231
|
+
className: (0, _runtime.ax)(["_4cvr1h6o _19pkidpf"])
|
|
232
|
+
}, urlButton), /*#__PURE__*/_react.default.createElement("li", {
|
|
233
|
+
className: (0, _runtime.ax)(["_4cvr1h6o _19pkidpf", "_1dt6glyw"])
|
|
234
|
+
}, sizeButton), /*#__PURE__*/_react.default.createElement("li", {
|
|
235
|
+
className: (0, _runtime.ax)(["_4cvr1h6o _19pkidpf"])
|
|
236
|
+
}, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
237
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.preview_close),
|
|
238
|
+
hideTooltipOnClick: true,
|
|
239
|
+
tag: "span",
|
|
240
|
+
testId: "".concat(testId, "-close-tooltip")
|
|
241
|
+
}, /*#__PURE__*/_react.default.createElement(_modalDialog.CloseButton, {
|
|
242
|
+
onClick: onClose,
|
|
243
|
+
label: formatMessage(_messages.messages.preview_close),
|
|
244
|
+
testId: testId
|
|
245
|
+
})))));
|
|
246
|
+
};
|
|
247
|
+
var _default = exports.default = (0, _platformFeatureFlagsReact.componentWithFG)('platform_navx_sl_a11y_embed_modal', LinkInfoNew, LinkInfo);
|
|
@@ -10,6 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _tokens = require("@atlaskit/tokens");
|
|
14
15
|
var _constants = require("../../constants");
|
|
15
16
|
var _useInvokeClientAction = _interopRequireDefault(require("../../state/hooks/use-invoke-client-action"));
|
|
@@ -60,6 +61,9 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
60
61
|
width = _useState4[0],
|
|
61
62
|
setWidth = _useState4[1];
|
|
62
63
|
var openAt = (0, _react.useRef)();
|
|
64
|
+
var focusRef = (0, _platformFeatureFlags.fg)('platform_navx_sl_a11y_embed_modal') ?
|
|
65
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
66
|
+
(0, _react.useRef)(null) : undefined;
|
|
63
67
|
var invoke = (0, _useInvokeClientAction.default)({
|
|
64
68
|
fireEvent: fireEvent
|
|
65
69
|
});
|
|
@@ -103,7 +107,9 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
103
107
|
if (previewUrl && isSupportTheming) {
|
|
104
108
|
previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
|
|
105
109
|
}
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, isOpen && /*#__PURE__*/_react.default.createElement(_modalDialog.default, (0, _extends2.default)({}, (0, _platformFeatureFlags.fg)('platform_navx_sl_a11y_embed_modal') ? {
|
|
111
|
+
autoFocus: focusRef
|
|
112
|
+
} : undefined, {
|
|
107
113
|
height: "100%",
|
|
108
114
|
onClose: handleOnClose,
|
|
109
115
|
onCloseComplete: handleOnCloseComplete,
|
|
@@ -112,13 +118,16 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
112
118
|
width: width,
|
|
113
119
|
label: title,
|
|
114
120
|
isBlanketHidden: isBlanketHidden
|
|
115
|
-
}, /*#__PURE__*/_react.default.createElement(_linkInfo.default, {
|
|
121
|
+
}), /*#__PURE__*/_react.default.createElement(_linkInfo.default, (0, _extends2.default)({
|
|
116
122
|
icon: linkIcon && {
|
|
117
123
|
icon: /*#__PURE__*/_react.default.createElement(_common.BaseIconElement, (0, _extends2.default)({}, linkIcon, {
|
|
118
124
|
size: _constants.SmartLinkSize.Large
|
|
119
125
|
})),
|
|
120
126
|
isFlexibleUi: true
|
|
121
|
-
}
|
|
127
|
+
}
|
|
128
|
+
}, (0, _platformFeatureFlags.fg)('platform_navx_sl_a11y_embed_modal') ? {
|
|
129
|
+
focusRef: focusRef
|
|
130
|
+
} : undefined, {
|
|
122
131
|
providerName: providerName,
|
|
123
132
|
onViewButtonClick: invokeViewAction ? handleOnViewActionClick : undefined,
|
|
124
133
|
onDownloadButtonClick: invokeDownloadAction ? handleOnDownloadActionClick : undefined,
|
|
@@ -126,7 +135,7 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
126
135
|
size: width,
|
|
127
136
|
title: title,
|
|
128
137
|
testId: testId
|
|
129
|
-
}), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_embedContent.default, {
|
|
138
|
+
})), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_embedContent.default, {
|
|
130
139
|
isTrusted: isTrusted,
|
|
131
140
|
name: iframeName,
|
|
132
141
|
src: previewUrl,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isConfluenceGenerator } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { IconType } from '../../../constants';
|
|
3
4
|
/**
|
|
4
5
|
* Computes the relevant icon for a document type.
|
|
@@ -18,53 +19,77 @@ import { IconType } from '../../../constants';
|
|
|
18
19
|
const extractDocumentTypeIcon = (documentType, label, providerId) => {
|
|
19
20
|
switch (documentType) {
|
|
20
21
|
case 'schema:BlogPosting':
|
|
21
|
-
|
|
22
|
-
return {
|
|
22
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
23
23
|
icon: IconType.Blog,
|
|
24
|
+
label
|
|
25
|
+
} : {
|
|
26
|
+
icon: IconType.Blog,
|
|
27
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
24
28
|
label: label || 'Blog'
|
|
25
29
|
};
|
|
26
30
|
case 'schema:DigitalDocument':
|
|
27
31
|
if (providerId && isConfluenceGenerator(providerId)) {
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
33
|
+
icon: IconType.LiveDocument,
|
|
34
|
+
label
|
|
35
|
+
} : {
|
|
30
36
|
icon: IconType.LiveDocument,
|
|
37
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
31
38
|
label: label || 'Live Document'
|
|
32
39
|
};
|
|
33
40
|
} else {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
42
|
+
icon: IconType.File,
|
|
43
|
+
label
|
|
44
|
+
} : {
|
|
36
45
|
icon: IconType.File,
|
|
46
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
37
47
|
label: label || 'File'
|
|
38
48
|
};
|
|
39
49
|
}
|
|
40
50
|
case 'schema:TextDigitalDocument':
|
|
41
|
-
|
|
42
|
-
return {
|
|
51
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
43
52
|
icon: IconType.Document,
|
|
53
|
+
label
|
|
54
|
+
} : {
|
|
55
|
+
icon: IconType.Document,
|
|
56
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
44
57
|
label: label || 'Document'
|
|
45
58
|
};
|
|
46
59
|
case 'schema:PresentationDigitalDocument':
|
|
47
|
-
|
|
48
|
-
return {
|
|
60
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
49
61
|
icon: IconType.Presentation,
|
|
62
|
+
label
|
|
63
|
+
} : {
|
|
64
|
+
icon: IconType.Presentation,
|
|
65
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
50
66
|
label: label || 'Presentation'
|
|
51
67
|
};
|
|
52
68
|
case 'schema:SpreadsheetDigitalDocument':
|
|
53
|
-
|
|
54
|
-
return {
|
|
69
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
55
70
|
icon: IconType.Spreadsheet,
|
|
71
|
+
label
|
|
72
|
+
} : {
|
|
73
|
+
icon: IconType.Spreadsheet,
|
|
74
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
56
75
|
label: label || 'Spreadsheet'
|
|
57
76
|
};
|
|
58
77
|
case 'atlassian:Template':
|
|
59
|
-
|
|
60
|
-
return {
|
|
78
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
61
79
|
icon: IconType.Template,
|
|
80
|
+
label
|
|
81
|
+
} : {
|
|
82
|
+
icon: IconType.Template,
|
|
83
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
62
84
|
label: label || 'Template'
|
|
63
85
|
};
|
|
64
86
|
case 'atlassian:UndefinedLink':
|
|
65
|
-
|
|
66
|
-
return {
|
|
87
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
67
88
|
icon: IconType.Document,
|
|
89
|
+
label
|
|
90
|
+
} : {
|
|
91
|
+
icon: IconType.Document,
|
|
92
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
68
93
|
label: label || 'Undefined link'
|
|
69
94
|
};
|
|
70
95
|
default:
|
|
@@ -1,87 +1,111 @@
|
|
|
1
|
-
|
|
1
|
+
import { fg } from "@atlaskit/platform-feature-flags";
|
|
2
2
|
import { IconType } from '../../../constants';
|
|
3
3
|
const extractFileFormatIcon = fileFormat => {
|
|
4
4
|
switch (fileFormat) {
|
|
5
5
|
// Generic documents
|
|
6
6
|
case 'folder':
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
8
|
+
icon: IconType.Folder
|
|
9
|
+
} : {
|
|
9
10
|
icon: IconType.Folder,
|
|
11
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
10
12
|
label: 'Folder'
|
|
11
13
|
};
|
|
12
14
|
case 'text/plain':
|
|
13
15
|
case 'application/vnd.oasis.opendocument.text':
|
|
14
16
|
case 'application/vnd.apple.pages':
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
18
|
+
icon: IconType.Document
|
|
19
|
+
} : {
|
|
17
20
|
icon: IconType.Document,
|
|
21
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
18
22
|
label: 'Document'
|
|
19
23
|
};
|
|
20
24
|
case 'application/pdf':
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
26
|
+
icon: IconType.PDF
|
|
27
|
+
} : {
|
|
23
28
|
icon: IconType.PDF,
|
|
29
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
24
30
|
label: 'PDF document'
|
|
25
31
|
};
|
|
26
32
|
case 'application/vnd.oasis.opendocument.presentation':
|
|
27
33
|
case 'application/vnd.apple.keynote':
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
35
|
+
icon: IconType.Presentation
|
|
36
|
+
} : {
|
|
30
37
|
icon: IconType.Presentation,
|
|
38
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
31
39
|
label: 'Presentation'
|
|
32
40
|
};
|
|
33
41
|
case 'application/vnd.oasis.opendocument.spreadsheet':
|
|
34
42
|
case 'application/vnd.apple.numbers':
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
44
|
+
icon: IconType.Spreadsheet
|
|
45
|
+
} : {
|
|
37
46
|
icon: IconType.Spreadsheet,
|
|
47
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
38
48
|
label: 'Spreadsheet'
|
|
39
49
|
};
|
|
40
50
|
// Google Drive
|
|
41
51
|
case 'application/vnd.google-apps.document':
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
53
|
+
icon: IconType.GoogleDocs
|
|
54
|
+
} : {
|
|
44
55
|
icon: IconType.GoogleDocs,
|
|
56
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
45
57
|
label: 'Google Docs'
|
|
46
58
|
};
|
|
47
59
|
case 'application/vnd.google-apps.form':
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
61
|
+
icon: IconType.GoogleForms
|
|
62
|
+
} : {
|
|
50
63
|
icon: IconType.GoogleForms,
|
|
64
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
51
65
|
label: 'Google Form'
|
|
52
66
|
};
|
|
53
67
|
case 'application/vnd.google-apps.spreadsheet':
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
69
|
+
icon: IconType.GoogleSheets
|
|
70
|
+
} : {
|
|
56
71
|
icon: IconType.GoogleSheets,
|
|
72
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
57
73
|
label: 'Google Sheets'
|
|
58
74
|
};
|
|
59
75
|
case 'application/vnd.google-apps.presentation':
|
|
60
|
-
|
|
61
|
-
|
|
76
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
77
|
+
icon: IconType.GoogleSlides
|
|
78
|
+
} : {
|
|
62
79
|
icon: IconType.GoogleSlides,
|
|
80
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
63
81
|
label: 'Google Slides'
|
|
64
82
|
};
|
|
65
83
|
// Microsoft
|
|
66
84
|
case 'application/vnd.ms-excel':
|
|
67
85
|
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
68
|
-
|
|
69
|
-
|
|
86
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
87
|
+
icon: IconType.MSExcel
|
|
88
|
+
} : {
|
|
70
89
|
icon: IconType.MSExcel,
|
|
90
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
71
91
|
label: 'Excel spreadsheet'
|
|
72
92
|
};
|
|
73
93
|
case 'application/vnd.ms-powerpoint':
|
|
74
94
|
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
96
|
+
icon: IconType.MSPowerpoint
|
|
97
|
+
} : {
|
|
77
98
|
icon: IconType.MSPowerpoint,
|
|
99
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
78
100
|
label: 'PowerPoint presentation'
|
|
79
101
|
};
|
|
80
102
|
case 'application/msword':
|
|
81
103
|
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
105
|
+
icon: IconType.MSWord
|
|
106
|
+
} : {
|
|
84
107
|
icon: IconType.MSWord,
|
|
108
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
85
109
|
label: 'Word document'
|
|
86
110
|
};
|
|
87
111
|
case 'image/png':
|
|
@@ -89,15 +113,19 @@ const extractFileFormatIcon = fileFormat => {
|
|
|
89
113
|
case 'image/bmp':
|
|
90
114
|
case 'image/webp':
|
|
91
115
|
case 'image/svg+xml':
|
|
92
|
-
|
|
93
|
-
|
|
116
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
117
|
+
icon: IconType.Image
|
|
118
|
+
} : {
|
|
94
119
|
icon: IconType.Image,
|
|
120
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
95
121
|
label: 'Image'
|
|
96
122
|
};
|
|
97
123
|
case 'image/gif':
|
|
98
|
-
|
|
99
|
-
|
|
124
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
125
|
+
icon: IconType.GIF
|
|
126
|
+
} : {
|
|
100
127
|
icon: IconType.GIF,
|
|
128
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
101
129
|
label: 'GIF'
|
|
102
130
|
};
|
|
103
131
|
case 'audio/midi':
|
|
@@ -105,9 +133,11 @@ const extractFileFormatIcon = fileFormat => {
|
|
|
105
133
|
case 'audio/webm':
|
|
106
134
|
case 'audio/ogg':
|
|
107
135
|
case 'audio/wav':
|
|
108
|
-
|
|
109
|
-
|
|
136
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
137
|
+
icon: IconType.Audio
|
|
138
|
+
} : {
|
|
110
139
|
icon: IconType.Audio,
|
|
140
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
111
141
|
label: 'Audio'
|
|
112
142
|
};
|
|
113
143
|
case 'video/mp4':
|
|
@@ -117,18 +147,22 @@ const extractFileFormatIcon = fileFormat => {
|
|
|
117
147
|
case 'video/ogg':
|
|
118
148
|
case 'video/x-ms-wmv':
|
|
119
149
|
case 'video/x-msvideo':
|
|
120
|
-
|
|
121
|
-
|
|
150
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
151
|
+
icon: IconType.Video
|
|
152
|
+
} : {
|
|
122
153
|
icon: IconType.Video,
|
|
154
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
123
155
|
label: 'Video'
|
|
124
156
|
};
|
|
125
157
|
// Others
|
|
126
158
|
case 'text/css':
|
|
127
159
|
case 'text/html':
|
|
128
160
|
case 'application/javascript':
|
|
129
|
-
|
|
130
|
-
|
|
161
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
162
|
+
icon: IconType.Code
|
|
163
|
+
} : {
|
|
131
164
|
icon: IconType.Code,
|
|
165
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
132
166
|
label: 'Source Code'
|
|
133
167
|
};
|
|
134
168
|
case 'application/zip':
|
|
@@ -137,33 +171,43 @@ const extractFileFormatIcon = fileFormat => {
|
|
|
137
171
|
case 'application/x-7z-compressed':
|
|
138
172
|
case 'application/x-apple-diskimage':
|
|
139
173
|
case 'application/vnd.rar':
|
|
140
|
-
|
|
141
|
-
|
|
174
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
175
|
+
icon: IconType.Archive
|
|
176
|
+
} : {
|
|
142
177
|
icon: IconType.Archive,
|
|
178
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
143
179
|
label: 'Archive'
|
|
144
180
|
};
|
|
145
181
|
case 'application/dmg':
|
|
146
|
-
|
|
147
|
-
|
|
182
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
183
|
+
icon: IconType.Executable
|
|
184
|
+
} : {
|
|
148
185
|
icon: IconType.Executable,
|
|
186
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
149
187
|
label: 'Executable'
|
|
150
188
|
};
|
|
151
189
|
case 'application/sketch':
|
|
152
|
-
|
|
153
|
-
|
|
190
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
191
|
+
icon: IconType.Sketch
|
|
192
|
+
} : {
|
|
154
193
|
icon: IconType.Sketch,
|
|
194
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
155
195
|
label: 'Sketch'
|
|
156
196
|
};
|
|
157
197
|
case 'application/octet-stream':
|
|
158
|
-
|
|
159
|
-
|
|
198
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
199
|
+
icon: IconType.Generic
|
|
200
|
+
} : {
|
|
160
201
|
icon: IconType.Generic,
|
|
202
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
161
203
|
label: 'Binary file'
|
|
162
204
|
};
|
|
163
205
|
case 'application/invision.prototype':
|
|
164
|
-
|
|
165
|
-
|
|
206
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
207
|
+
icon: IconType.Generic
|
|
208
|
+
} : {
|
|
166
209
|
icon: IconType.Generic,
|
|
210
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
167
211
|
label: 'Prototype'
|
|
168
212
|
};
|
|
169
213
|
default:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { extractTitle } from '@atlaskit/link-extractors';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { IconType } from '../../../constants';
|
|
3
4
|
import { prioritiseIcon } from '../../common/icon';
|
|
4
5
|
import { extractorPriorityMap as priorityMap } from '../../common/icon/priority';
|
|
@@ -61,39 +62,57 @@ function typeToIconDescriptor({
|
|
|
61
62
|
}) {
|
|
62
63
|
switch (type) {
|
|
63
64
|
case 'atlassian:Goal':
|
|
64
|
-
|
|
65
|
-
return {
|
|
65
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
66
66
|
icon: IconType.Task,
|
|
67
|
+
label
|
|
68
|
+
} : {
|
|
69
|
+
icon: IconType.Task,
|
|
70
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
67
71
|
label: label || 'Goal'
|
|
68
72
|
};
|
|
69
73
|
case 'atlassian:Project':
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
75
|
+
icon: IconType.Project,
|
|
76
|
+
label
|
|
77
|
+
} : {
|
|
72
78
|
icon: IconType.Project,
|
|
79
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
73
80
|
label: label || 'Project'
|
|
74
81
|
};
|
|
75
82
|
case 'atlassian:SourceCodeCommit':
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
84
|
+
icon: IconType.Commit,
|
|
85
|
+
label
|
|
86
|
+
} : {
|
|
78
87
|
icon: IconType.Commit,
|
|
88
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
79
89
|
label: label || 'Commit'
|
|
80
90
|
};
|
|
81
91
|
case 'atlassian:SourceCodePullRequest':
|
|
82
|
-
|
|
83
|
-
return {
|
|
92
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
84
93
|
icon: IconType.PullRequest,
|
|
94
|
+
label
|
|
95
|
+
} : {
|
|
96
|
+
icon: IconType.PullRequest,
|
|
97
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
85
98
|
label: label || 'Pull request'
|
|
86
99
|
};
|
|
87
100
|
case 'atlassian:SourceCodeReference':
|
|
88
|
-
|
|
89
|
-
|
|
101
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
102
|
+
icon: IconType.Branch,
|
|
103
|
+
label
|
|
104
|
+
} : {
|
|
90
105
|
icon: IconType.Branch,
|
|
106
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
91
107
|
label: label || 'Reference'
|
|
92
108
|
};
|
|
93
109
|
case 'atlassian:SourceCodeRepository':
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
return fg('navx-2827-eslint-object-translation-smart-links') ? {
|
|
111
|
+
icon: IconType.Repo,
|
|
112
|
+
label
|
|
113
|
+
} : {
|
|
96
114
|
icon: IconType.Repo,
|
|
115
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
97
116
|
label: label || 'Repository'
|
|
98
117
|
};
|
|
99
118
|
case 'atlassian:Task':
|
|
@@ -44,14 +44,6 @@ export const getIconForFileType = fileMimeType => {
|
|
|
44
44
|
testId: "document-file-format-icon"
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
export const getLabelForFileType = fileMimeType => {
|
|
48
|
-
let icon = getTypeToIconMap(fileMimeType.toLowerCase());
|
|
49
|
-
if (!icon) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const [label] = icon;
|
|
53
|
-
return label;
|
|
54
|
-
};
|
|
55
47
|
// prettier-ignore
|
|
56
48
|
export const getLazyIcons = () => {
|
|
57
49
|
return {
|