@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.
Files changed (32) hide show
  1. package/CHANGELOG.md +18 -0
  2. 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
  3. package/dist/cjs/extractors/flexible/icon/extract-document-type-icon.js +41 -16
  4. package/dist/cjs/extractors/flexible/icon/extract-file-formatIcon.js +89 -46
  5. package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +31 -12
  6. package/dist/cjs/utils/index.js +1 -10
  7. package/dist/cjs/view/EmbedModal/components/link-info/index.compiled.css +15 -1
  8. package/dist/cjs/view/EmbedModal/components/link-info/index.js +108 -1
  9. package/dist/cjs/view/EmbedModal/index.js +13 -4
  10. 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
  11. package/dist/es2019/extractors/flexible/icon/extract-document-type-icon.js +41 -16
  12. package/dist/es2019/extractors/flexible/icon/extract-file-formatIcon.js +89 -45
  13. package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +31 -12
  14. package/dist/es2019/utils/index.js +0 -8
  15. package/dist/es2019/view/EmbedModal/components/link-info/index.compiled.css +15 -1
  16. package/dist/es2019/view/EmbedModal/components/link-info/index.js +103 -1
  17. package/dist/es2019/view/EmbedModal/index.js +13 -4
  18. 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
  19. package/dist/esm/extractors/flexible/icon/extract-document-type-icon.js +41 -16
  20. package/dist/esm/extractors/flexible/icon/extract-file-formatIcon.js +89 -45
  21. package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +31 -12
  22. package/dist/esm/utils/index.js +0 -9
  23. package/dist/esm/view/EmbedModal/components/link-info/index.compiled.css +15 -1
  24. package/dist/esm/view/EmbedModal/components/link-info/index.js +108 -1
  25. package/dist/esm/view/EmbedModal/index.js +13 -4
  26. package/dist/types/utils/index.d.ts +0 -1
  27. package/dist/types/view/EmbedModal/components/link-info/index.d.ts +7 -2
  28. package/dist/types/view/EmbedModal/components/link-info/types.d.ts +2 -0
  29. package/dist/types-ts4.5/utils/index.d.ts +0 -1
  30. package/dist/types-ts4.5/view/EmbedModal/components/link-info/index.d.ts +7 -2
  31. package/dist/types-ts4.5/view/EmbedModal/components/link-info/types.d.ts +2 -0
  32. package/package.json +12 -6
@@ -1,12 +1,17 @@
1
1
 
2
+ ._qtt8glyw{list-style:none}
2
3
  ._zulp1b66{gap:var(--ds-space-050,4px)}
3
4
  ._zulpu2gc{gap:var(--ds-space-100,8px)}._11hh1tcg [data-smart-element-icon] svg{min-width:24px}
4
5
  ._15iz1tcg span{min-height:24px}
5
6
  ._16jlidpf{flex-grow:0}
6
7
  ._16jlkb7n{flex-grow:1}
7
8
  ._17521tcg svg{height:24px}
9
+ ._18u0ze3t{margin-left:var(--ds-space-0,0)}
8
10
  ._19bv1ejb{padding-left:var(--ds-space-300,24px)}
11
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
9
12
  ._19l31tcg img{max-height:24px}
13
+ ._19pkidpf{margin-top:0}
14
+ ._19pkze3t{margin-top:var(--ds-space-0,0)}
10
15
  ._1bah1h6o{justify-content:center}
11
16
  ._1bnm1tcg [data-smart-element-icon] svg{height:24px}
12
17
  ._1bsb1tcg{width:24px}
@@ -15,6 +20,7 @@
15
20
  ._1h1b1tcg [data-smart-element-icon] span{width:24px}
16
21
  ._1mj01tcg [data-smart-element-icon] img{max-width:24px}
17
22
  ._1o9zidpf{flex-shrink:0}
23
+ ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
18
24
  ._1pr21tcg span{max-height:24px}
19
25
  ._1q121tcg [data-smart-element-icon] img{max-height:24px}
20
26
  ._1r9c1tcg [data-smart-element-icon] span{max-width:24px}
@@ -27,14 +33,19 @@
27
33
  ._1xch1tcg [data-smart-element-icon] svg{max-width:24px}
28
34
  ._1xjx1tcg span{height:24px}
29
35
  ._1xyl1tcg [data-smart-element-icon] img{width:24px}
36
+ ._2hwxze3t{margin-right:var(--ds-space-0,0)}
30
37
  ._2lx21bp4{flex-direction:column}
31
38
  ._2s1x1tcg [data-smart-element-icon] span{max-height:24px}
39
+ ._4cvr1h6o{align-items:center}
32
40
  ._4t3i1tcg{height:24px}
33
41
  ._4x201tcg svg{max-width:24px}
42
+ ._6rthze3t{margin-block-end:var(--ds-space-0,0)}
34
43
  ._b8nk1tcg span{max-width:24px}
35
44
  ._bna71tcg img{height:24px}
45
+ ._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
36
46
  ._c71l1tcg{max-height:24px}
37
47
  ._ca0q1ejb{padding-top:var(--ds-space-300,24px)}
48
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
38
49
  ._e2oo1tcg span{width:24px}
39
50
  ._erub1tcg svg{min-height:24px}
40
51
  ._gire1tcg [data-smart-element-icon] img{height:24px}
@@ -43,16 +54,19 @@
43
54
  ._jbhf1tcg [data-smart-element-icon] span{min-width:24px}
44
55
  ._mezj1tcg img{width:24px}
45
56
  ._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
57
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
58
+ ._otyrze3t{margin-bottom:var(--ds-space-0,0)}
46
59
  ._p12f1tcg{max-width:24px}
47
60
  ._prfw1tcg [data-smart-element-icon] svg{width:24px}
48
61
  ._q7cv1tcg span{min-width:24px}
49
62
  ._qci81tcg img{min-height:24px}
50
63
  ._rtys1tcg img{max-width:24px}
51
64
  ._u5f31ejb{padding-right:var(--ds-space-300,24px)}
65
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
52
66
  ._v5981tcg [data-smart-element-icon] span{min-height:24px}
53
67
  ._w8l51tcg svg{width:24px}
54
68
  ._x9xj1tcg [data-smart-element-icon] img{min-height:24px}
55
69
  ._xwbj1tcg svg{min-width:24px}
56
70
  ._yrry1tcg [data-smart-element-icon] span{height:24px}
57
71
  ._z15s1tcg [data-smart-element-icon] svg{min-height:24px}
58
- @media only screen and (max-width:980px){._3kllglyw .smart-link-resize-button{display:none}}
72
+ @media only screen and (max-width:980px){._1dt6glyw{display:none}._3kllglyw .smart-link-resize-button{display:none}}
@@ -10,6 +10,7 @@ import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
10
10
  import ShortcutIcon from '@atlaskit/icon/core/link-external';
11
11
  import { CloseButton, useModal } from '@atlaskit/modal-dialog';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
13
14
  import Tooltip from '@atlaskit/tooltip';
14
15
  import { messages } from '../../../../messages';
15
16
  import { Icon } from '../../../common/Icon';
@@ -24,6 +25,9 @@ const iconSize = '24px';
24
25
  const iconCss = null;
25
26
  const titleCss = null;
26
27
  const actionCss = null;
28
+ const buttonGroupCss = null;
29
+ const listItemCSS = null;
30
+ const resizeButtonCss = null;
27
31
  const LinkInfo = ({
28
32
  icon,
29
33
  providerName,
@@ -125,4 +129,102 @@ const LinkInfo = ({
125
129
  testId: testId
126
130
  }))));
127
131
  };
128
- export default LinkInfo;
132
+ const LinkInfoNew = ({
133
+ focusRef,
134
+ icon,
135
+ providerName,
136
+ onDownloadButtonClick,
137
+ onResizeButtonClick,
138
+ onViewButtonClick,
139
+ size,
140
+ testId,
141
+ title
142
+ }) => {
143
+ const {
144
+ onClose
145
+ } = useModal();
146
+ const {
147
+ formatMessage
148
+ } = useIntl();
149
+ const downloadButton = useMemo(() => /*#__PURE__*/React.createElement(LinkInfoButton, {
150
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
151
+ icon: () => /*#__PURE__*/React.createElement(DownloadIcon, {
152
+ label: "",
153
+ spacing: "spacious",
154
+ color: "currentColor"
155
+ }),
156
+ label: messages.download,
157
+ onClick: onDownloadButtonClick,
158
+ testId: `${testId}-download`
159
+ }), [onDownloadButtonClick, testId]);
160
+ const urlButton = useMemo(() => {
161
+ if (onViewButtonClick) {
162
+ const content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
163
+ return /*#__PURE__*/React.createElement(LinkInfoButton, {
164
+ content: content,
165
+ icon: () => /*#__PURE__*/React.createElement(ShortcutIcon, {
166
+ label: "",
167
+ spacing: "spacious",
168
+ color: "currentColor"
169
+ }),
170
+ label: messages.viewOriginal,
171
+ onClick: onViewButtonClick,
172
+ testId: `${testId}-url`
173
+ });
174
+ }
175
+ }, [onViewButtonClick, providerName, testId]);
176
+ const sizeButton = useMemo(() => {
177
+ const isFullScreen = size === MAX_MODAL_SIZE;
178
+ const message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
179
+ const icon = isFullScreen ? /*#__PURE__*/React.createElement(FullscreenExitIcon, {
180
+ label: "",
181
+ spacing: "spacious",
182
+ color: "currentColor"
183
+ }) : /*#__PURE__*/React.createElement(VidFullScreenOnIcon, {
184
+ label: "",
185
+ spacing: "spacious",
186
+ color: "currentColor"
187
+ });
188
+ return /*#__PURE__*/React.createElement(LinkInfoButton, {
189
+ content: /*#__PURE__*/React.createElement(FormattedMessage, message),
190
+ icon: () => icon,
191
+ label: message,
192
+ onClick: onResizeButtonClick,
193
+ testId: `${testId}-resize`
194
+ });
195
+ }, [onResizeButtonClick, size, testId]);
196
+ return /*#__PURE__*/React.createElement("div", {
197
+ className: ax(["_zulpu2gc _1e0c1txw _19bv1ejb _u5f31ejb _ca0q1ejb _n3tdpxbi _1wpz1fhb _4t3i1tcg"])
198
+ }, icon && /*#__PURE__*/React.createElement("div", {
199
+ "data-testid": `${testId}-icon`,
200
+ className: 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"])
201
+ }, /*#__PURE__*/React.createElement(Icon, icon)), /*#__PURE__*/React.createElement("div", {
202
+ className: ax(["_16jlkb7n _1o9zidpf _i0dlf1ug _1e0c1txw _2lx21bp4 _1bah1h6o _1wpz1fhb"])
203
+ }, /*#__PURE__*/React.createElement(Heading, {
204
+ size: "small",
205
+ color: "color.text",
206
+ ref: focusRef,
207
+ testId: `${testId}-title`
208
+ }, title)), /*#__PURE__*/React.createElement("ul", {
209
+ role: "list",
210
+ className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _qtt8glyw _1e0c1txw _19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _1pfhze3t _6rthze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _bozgze3t"])
211
+ }, onDownloadButtonClick && /*#__PURE__*/React.createElement("li", {
212
+ className: ax(["_4cvr1h6o _19pkidpf"])
213
+ }, downloadButton), /*#__PURE__*/React.createElement("li", {
214
+ className: ax(["_4cvr1h6o _19pkidpf"])
215
+ }, urlButton), /*#__PURE__*/React.createElement("li", {
216
+ className: ax(["_4cvr1h6o _19pkidpf", "_1dt6glyw"])
217
+ }, sizeButton), /*#__PURE__*/React.createElement("li", {
218
+ className: ax(["_4cvr1h6o _19pkidpf"])
219
+ }, /*#__PURE__*/React.createElement(Tooltip, {
220
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
221
+ hideTooltipOnClick: true,
222
+ tag: "span",
223
+ testId: `${testId}-close-tooltip`
224
+ }, /*#__PURE__*/React.createElement(CloseButton, {
225
+ onClick: onClose,
226
+ label: formatMessage(messages.preview_close),
227
+ testId: testId
228
+ })))));
229
+ };
230
+ export default componentWithFG('platform_navx_sl_a11y_embed_modal', LinkInfoNew, LinkInfo);
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useRef, useState } from 'react';
3
3
  import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { useThemeObserver } from '@atlaskit/tokens';
5
6
  import { SmartLinkSize } from '../../constants';
6
7
  import useInvokeClientAction from '../../state/hooks/use-invoke-client-action';
@@ -38,6 +39,9 @@ const EmbedModal = ({
38
39
  const [isOpen, setIsOpen] = useState(showModal);
39
40
  const [width, setWidth] = useState(defaultWidth);
40
41
  const openAt = useRef();
42
+ const focusRef = fg('platform_navx_sl_a11y_embed_modal') ?
43
+ // eslint-disable-next-line react-hooks/rules-of-hooks
44
+ useRef(null) : undefined;
41
45
  const invoke = useInvokeClientAction({
42
46
  fireEvent
43
47
  });
@@ -79,7 +83,9 @@ const EmbedModal = ({
79
83
  if (previewUrl && isSupportTheming) {
80
84
  previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
81
85
  }
82
- return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
86
+ return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, _extends({}, fg('platform_navx_sl_a11y_embed_modal') ? {
87
+ autoFocus: focusRef
88
+ } : undefined, {
83
89
  height: "100%",
84
90
  onClose: handleOnClose,
85
91
  onCloseComplete: handleOnCloseComplete,
@@ -88,13 +94,16 @@ const EmbedModal = ({
88
94
  width: width,
89
95
  label: title,
90
96
  isBlanketHidden: isBlanketHidden
91
- }, /*#__PURE__*/React.createElement(LinkInfo, {
97
+ }), /*#__PURE__*/React.createElement(LinkInfo, _extends({
92
98
  icon: linkIcon && {
93
99
  icon: /*#__PURE__*/React.createElement(BaseIconElement, _extends({}, linkIcon, {
94
100
  size: SmartLinkSize.Large
95
101
  })),
96
102
  isFlexibleUi: true
97
- },
103
+ }
104
+ }, fg('platform_navx_sl_a11y_embed_modal') ? {
105
+ focusRef
106
+ } : undefined, {
98
107
  providerName: providerName,
99
108
  onViewButtonClick: invokeViewAction ? handleOnViewActionClick : undefined,
100
109
  onDownloadButtonClick: invokeDownloadAction ? handleOnDownloadActionClick : undefined,
@@ -102,7 +111,7 @@ const EmbedModal = ({
102
111
  size: width,
103
112
  title: title,
104
113
  testId: testId
105
- }), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
114
+ })), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(EmbedContent, {
106
115
  isTrusted: isTrusted,
107
116
  name: iframeName,
108
117
  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
  var extractDocumentTypeIcon = function extractDocumentTypeIcon(documentType, label, providerId) {
19
20
  switch (documentType) {
20
21
  case 'schema:BlogPosting':
21
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
22
- return {
22
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
23
23
  icon: IconType.Blog,
24
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
29
- return {
32
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
33
+ icon: IconType.LiveDocument,
34
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
35
- return {
41
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
42
+ icon: IconType.File,
43
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
42
- return {
51
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
43
52
  icon: IconType.Document,
53
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
48
- return {
60
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
49
61
  icon: IconType.Presentation,
62
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
54
- return {
69
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
55
70
  icon: IconType.Spreadsheet,
71
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
60
- return {
78
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
61
79
  icon: IconType.Template,
80
+ label: 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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
66
- return {
87
+ return fg('navx-2827-eslint-object-translation-smart-links') ? {
67
88
  icon: IconType.Document,
89
+ label: 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
- /* eslint-disable @atlassian/i18n/no-literal-string-in-object */
1
+ import { fg } from "@atlaskit/platform-feature-flags";
2
2
  import { IconType } from '../../../constants';
3
3
  var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
4
4
  switch (fileFormat) {
5
5
  // Generic documents
6
6
  case 'folder':
7
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
8
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
16
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
22
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
29
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
36
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
43
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
49
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
55
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
61
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
69
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
76
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
83
- return {
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 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
89
113
  case 'image/bmp':
90
114
  case 'image/webp':
91
115
  case 'image/svg+xml':
92
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
93
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
99
- return {
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 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
105
133
  case 'audio/webm':
106
134
  case 'audio/ogg':
107
135
  case 'audio/wav':
108
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
109
- return {
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 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
117
147
  case 'video/ogg':
118
148
  case 'video/x-ms-wmv':
119
149
  case 'video/x-msvideo':
120
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
121
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
130
- return {
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 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
137
171
  case 'application/x-7z-compressed':
138
172
  case 'application/x-apple-diskimage':
139
173
  case 'application/vnd.rar':
140
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
141
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
147
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
153
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
159
- return {
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
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
165
- return {
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: