@atlaskit/editor-common 94.3.0 → 94.3.1
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 +8 -0
- package/dist/cjs/doc-utils/editor-use-only.js +2 -0
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +48 -21
- package/dist/cjs/element-browser/components/ElementList/EmptyState.js +1 -1
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +52 -47
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +56 -48
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/Caption/index.js +7 -6
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/doc-utils/editor-use-only.js +1 -0
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +50 -20
- package/dist/es2019/element-browser/components/ElementList/EmptyState.js +2 -2
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +52 -47
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +56 -48
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/Caption/index.js +7 -6
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/doc-utils/editor-use-only.js +1 -0
- package/dist/esm/element-browser/components/ElementList/ElementList.js +48 -21
- package/dist/esm/element-browser/components/ElementList/EmptyState.js +2 -2
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +52 -47
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +56 -48
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/Caption/index.js +7 -6
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/ui-menu/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/ColorPickerButton/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -11,6 +11,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
11
11
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
12
12
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
13
13
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
|
|
14
|
+
import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
|
|
14
15
|
import { DEVICE_BREAKPOINT_NUMBERS, ELEMENT_BROWSER_ID, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
|
|
15
16
|
import useContainerWidth from '../hooks/use-container-width';
|
|
16
17
|
import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
|
|
@@ -70,7 +71,8 @@ const sidebarHeading = css({
|
|
|
70
71
|
display: 'inline-flex',
|
|
71
72
|
alignItems: 'center',
|
|
72
73
|
paddingLeft: "var(--ds-space-150, 12px)",
|
|
73
|
-
|
|
74
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
75
|
+
font: editorUGCToken('editor.font.heading.h1', 'typography-modernized') // use editor h1 modernized here as the style matches
|
|
74
76
|
});
|
|
75
77
|
const mobileMainContent = css({
|
|
76
78
|
flex: '1 1 auto',
|
|
@@ -272,51 +274,54 @@ function MobileBrowser({
|
|
|
272
274
|
emptyStateHandler,
|
|
273
275
|
viewMoreItem
|
|
274
276
|
}) {
|
|
275
|
-
return
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
277
|
+
return (
|
|
278
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
279
|
+
jsx("div", {
|
|
280
|
+
css: mobileElementBrowserContainer,
|
|
281
|
+
onKeyDown: onKeyDown,
|
|
282
|
+
"data-testid": "mobile__element-browser"
|
|
283
|
+
}, jsx("div", {
|
|
284
|
+
css: showCategories ? [mobileSideBar, mobileSideBarShowCategories] : mobileSideBar
|
|
285
|
+
}, showSearch && jsx(ElementSearch, {
|
|
286
|
+
onSearch: onSearch,
|
|
287
|
+
onKeyDown: onKeyPress,
|
|
288
|
+
mode: mode,
|
|
289
|
+
focus: focusOnSearch,
|
|
290
|
+
onClick: setFocusOnSearch,
|
|
291
|
+
searchTerm: searchTerm,
|
|
292
|
+
items: items,
|
|
293
|
+
selectedItemIndex: selectedItemIndex
|
|
294
|
+
}), showCategories && jsx("nav", {
|
|
295
|
+
css: mobileCategoryListWrapper,
|
|
296
|
+
tabIndex: -1
|
|
297
|
+
}, jsx(CategoryList, {
|
|
298
|
+
categories: categories,
|
|
299
|
+
onSelectCategory: onSelectCategory,
|
|
300
|
+
selectedCategory: selectedCategory,
|
|
301
|
+
focusedCategoryIndex: focusedCategoryIndex,
|
|
302
|
+
setFocusedCategoryIndex: setFocusedCategoryIndex,
|
|
303
|
+
setFocusedItemIndex: setFocusedItemIndex,
|
|
304
|
+
setFocusOnSearch: setFocusOnSearch
|
|
305
|
+
}))), jsx("div", {
|
|
306
|
+
css: mobileMainContent
|
|
307
|
+
}, jsx(ElementList, {
|
|
308
|
+
items: items,
|
|
309
|
+
mode: mode,
|
|
310
|
+
onInsertItem: onInsertItem,
|
|
311
|
+
selectedItemIndex: selectedItemIndex,
|
|
312
|
+
focusedItemIndex: focusedItemIndex,
|
|
313
|
+
setFocusedItemIndex: setFocusedItemIndex,
|
|
314
|
+
columnCount: columnCount,
|
|
315
|
+
setColumnCount: setColumnCount,
|
|
316
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
317
|
+
emptyStateHandler: emptyStateHandler,
|
|
318
|
+
selectedCategory: selectedCategory,
|
|
319
|
+
searchTerm: searchTerm
|
|
320
|
+
})), viewMoreItem && jsx(ViewMore, {
|
|
321
|
+
item: viewMoreItem,
|
|
322
|
+
focus: focusOnViewMore
|
|
323
|
+
}))
|
|
324
|
+
);
|
|
320
325
|
}
|
|
321
326
|
function DesktopBrowser({
|
|
322
327
|
showCategories,
|
|
@@ -349,7 +354,7 @@ function DesktopBrowser({
|
|
|
349
354
|
"data-testid": "desktop__element-browser"
|
|
350
355
|
}, showCategories && jsx("div", {
|
|
351
356
|
css: showCategories ? sideBarShowCategories : sideBar
|
|
352
|
-
}, jsx("
|
|
357
|
+
}, jsx("div", {
|
|
353
358
|
css: sidebarHeading,
|
|
354
359
|
"data-testid": "sidebar-heading",
|
|
355
360
|
id: "sidebar-heading"
|
|
@@ -69,7 +69,7 @@ const buttonLabelStyles = css({
|
|
|
69
69
|
'&.remove-nested-left-margin': {
|
|
70
70
|
marginLeft: 0
|
|
71
71
|
},
|
|
72
|
-
fontSize:
|
|
72
|
+
fontSize: "var(--ds-space-200, 16px)",
|
|
73
73
|
fontWeight: "var(--ds-font-weight-regular, 400)"
|
|
74
74
|
});
|
|
75
75
|
const spacerStyles = css({
|
|
@@ -77,6 +77,9 @@ const spacerStyles = css({
|
|
|
77
77
|
height: '10px'
|
|
78
78
|
});
|
|
79
79
|
const textStyles = css({
|
|
80
|
+
// cannot use font.body or editor custom font.body here as line-height need to be 1 (from sharedLabelStyles)
|
|
81
|
+
// cannot use space token as there is not token for 14px
|
|
82
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
80
83
|
fontSize: '14px',
|
|
81
84
|
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
82
85
|
padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"}`
|
|
@@ -139,51 +142,56 @@ export const ExtensionLabel = ({
|
|
|
139
142
|
const iconClassNames = classnames({
|
|
140
143
|
'hide-icon': isBodiedMacro && !isNodeHovered
|
|
141
144
|
});
|
|
142
|
-
return
|
|
143
|
-
// eslint-disable-next-line
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
145
|
+
return (
|
|
146
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
147
|
+
jsx("div", {
|
|
148
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
149
|
+
css: containerStyles
|
|
150
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
151
|
+
,
|
|
152
|
+
className: containerClassNames
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
154
|
+
,
|
|
155
|
+
style: customContainerStyles
|
|
156
|
+
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
157
|
+
,
|
|
158
|
+
onMouseOver: () => {
|
|
159
|
+
setIsNodeHovered === null || setIsNodeHovered === void 0 ? void 0 : setIsNodeHovered(true);
|
|
160
|
+
},
|
|
161
|
+
onMouseLeave: () => {
|
|
162
|
+
setIsNodeHovered === null || setIsNodeHovered === void 0 ? void 0 : setIsNodeHovered(false);
|
|
163
|
+
},
|
|
164
|
+
"data-testid": "new-lozenge-container"
|
|
165
|
+
}, showMacroButtonUpdates ? jsx(Fragment, null, jsx(Tooltip, {
|
|
166
|
+
content: jsx(FormattedMessage, _extends({}, i18n.configure, {
|
|
167
|
+
values: {
|
|
168
|
+
macroName: text
|
|
169
|
+
}
|
|
170
|
+
})),
|
|
171
|
+
position: "top"
|
|
172
|
+
}, tooltipProps => jsx("span", _extends({
|
|
173
|
+
"data-testid": "new-lozenge-button"
|
|
174
|
+
}, tooltipProps, {
|
|
175
|
+
css: [sharedLabelStyles, buttonLabelStyles]
|
|
176
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
177
|
+
,
|
|
178
|
+
className: `${sharedLabelClassNames} ${newButtonLabelClassNames}`
|
|
179
|
+
}), text, jsx("span", {
|
|
180
|
+
css: iconStyles,
|
|
181
|
+
className: iconClassNames,
|
|
182
|
+
"data-testid": "config-icon"
|
|
183
|
+
}, jsx(PreferencesIcon, {
|
|
184
|
+
label: ""
|
|
185
|
+
})))), jsx("div", {
|
|
186
|
+
css: spacerStyles
|
|
187
|
+
})) : jsx("span", {
|
|
188
|
+
"data-testid": "new-lozenge",
|
|
189
|
+
css: [sharedLabelStyles, originalLabelStyles]
|
|
190
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
191
|
+
,
|
|
192
|
+
className: sharedLabelClassNames
|
|
193
|
+
}, jsx("span", {
|
|
194
|
+
css: textStyles
|
|
195
|
+
}, text)))
|
|
196
|
+
);
|
|
189
197
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "94.3.
|
|
4
|
+
const packageVersion = "94.3.1";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -8,6 +8,7 @@ import React from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
|
+
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
11
12
|
import { messages } from './messages';
|
|
12
13
|
const captionWrapperStyle = css({
|
|
13
14
|
marginTop: "var(--ds-space-100, 8px)",
|
|
@@ -15,10 +16,10 @@ const captionWrapperStyle = css({
|
|
|
15
16
|
position: 'relative',
|
|
16
17
|
color: "var(--ds-text-subtle, #44546F)"
|
|
17
18
|
});
|
|
18
|
-
const placeholderStyle =
|
|
19
|
-
color:
|
|
19
|
+
const placeholderStyle = xcss({
|
|
20
|
+
color: 'color.text.subtlest',
|
|
20
21
|
position: 'absolute',
|
|
21
|
-
top: 0,
|
|
22
|
+
top: 'space.0',
|
|
22
23
|
width: '100%'
|
|
23
24
|
});
|
|
24
25
|
export class CaptionComponent extends React.Component {
|
|
@@ -38,9 +39,9 @@ export class CaptionComponent extends React.Component {
|
|
|
38
39
|
"data-testid": "media-caption"
|
|
39
40
|
}, dataAttributes, {
|
|
40
41
|
css: captionWrapperStyle
|
|
41
|
-
}), showPlaceholder ? jsx(
|
|
42
|
-
|
|
43
|
-
}, formatMessage(messages.placeholder)) : null, children);
|
|
42
|
+
}), showPlaceholder ? jsx(Box, {
|
|
43
|
+
xcss: placeholderStyle
|
|
44
|
+
}, jsx(Text, null, formatMessage(messages.placeholder))) : null, children);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
export default injectIntl(CaptionComponent);
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "94.3.
|
|
16
|
+
const packageVersion = "94.3.1";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
class DropList extends Component {
|
|
@@ -17,6 +17,8 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
17
17
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
19
19
|
import { ButtonItem } from '@atlaskit/menu';
|
|
20
|
+
import { Stack, Text } from '@atlaskit/primitives';
|
|
21
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
22
|
import Tooltip from '@atlaskit/tooltip';
|
|
21
23
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../../analytics';
|
|
22
24
|
import { IconFallback } from '../../../quick-insert';
|
|
@@ -280,8 +282,7 @@ var itemStyleOverrides = {
|
|
|
280
282
|
alignItems: 'flex-start'
|
|
281
283
|
};
|
|
282
284
|
var ElementBefore = /*#__PURE__*/memo(function (_ref6) {
|
|
283
|
-
var icon = _ref6.icon
|
|
284
|
-
title = _ref6.title;
|
|
285
|
+
var icon = _ref6.icon;
|
|
285
286
|
return jsx("div", {
|
|
286
287
|
css: [itemIcon, itemIconStyle]
|
|
287
288
|
}, icon ? icon() : jsx(IconFallback, null));
|
|
@@ -290,25 +291,51 @@ var ItemContent = /*#__PURE__*/memo(function (_ref7) {
|
|
|
290
291
|
var title = _ref7.title,
|
|
291
292
|
description = _ref7.description,
|
|
292
293
|
keyshortcut = _ref7.keyshortcut;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
294
|
+
if (editorExperiment('typography_migration_ugc', true)) {
|
|
295
|
+
return (
|
|
296
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
297
|
+
jsx("div", {
|
|
298
|
+
css: itemBody,
|
|
299
|
+
className: "item-body"
|
|
300
|
+
}, jsx("div", {
|
|
301
|
+
css: itemText
|
|
302
|
+
}, jsx(Stack, {
|
|
303
|
+
space: "space.025"
|
|
304
|
+
}, jsx("div", {
|
|
305
|
+
css: itemTitleWrapper
|
|
306
|
+
}, jsx(Text, {
|
|
307
|
+
maxLines: 1
|
|
308
|
+
}, title), jsx("div", {
|
|
309
|
+
css: itemAfter
|
|
310
|
+
}, keyshortcut && jsx("div", {
|
|
311
|
+
css: shortcutStyle
|
|
312
|
+
}, keyshortcut))), description && jsx(Text, {
|
|
313
|
+
color: "color.text.subtle",
|
|
314
|
+
size: "small",
|
|
315
|
+
maxLines: 2
|
|
316
|
+
}, description))))
|
|
317
|
+
);
|
|
318
|
+
} else {
|
|
319
|
+
return (
|
|
320
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
321
|
+
jsx("div", {
|
|
322
|
+
css: itemBody,
|
|
323
|
+
className: "item-body"
|
|
324
|
+
}, jsx("div", {
|
|
325
|
+
css: itemText
|
|
326
|
+
}, jsx("div", {
|
|
327
|
+
css: itemTitleWrapper
|
|
328
|
+
}, jsx("p", {
|
|
329
|
+
css: itemTitle
|
|
330
|
+
}, title), jsx("div", {
|
|
331
|
+
css: itemAfter
|
|
332
|
+
}, keyshortcut && jsx("div", {
|
|
333
|
+
css: shortcutStyle
|
|
334
|
+
}, keyshortcut))), description && jsx("p", {
|
|
335
|
+
css: itemDescription
|
|
336
|
+
}, description)))
|
|
337
|
+
);
|
|
338
|
+
}
|
|
312
339
|
});
|
|
313
340
|
var elementItemsWrapper = css({
|
|
314
341
|
flex: 1,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { LinkButton } from '@atlaskit/button/new';
|
|
9
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
9
|
+
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
10
10
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
11
11
|
export default function EmptyState(_ref) {
|
|
12
12
|
var onExternalLinkClick = _ref.onExternalLinkClick;
|
|
@@ -21,7 +21,7 @@ export default function EmptyState(_ref) {
|
|
|
21
21
|
description: "Empty state heading"
|
|
22
22
|
})), jsx("div", {
|
|
23
23
|
css: emptyStateSubHeading
|
|
24
|
-
}, jsx(
|
|
24
|
+
}, jsx(Text, null, jsx(FormattedMessage, {
|
|
25
25
|
id: "fabric.editor.elementbrowser.search.empty-state.sub-heading",
|
|
26
26
|
defaultMessage: "Try searching with a different term or discover new apps for Atlassian products.",
|
|
27
27
|
description: "Empty state sub-heading"
|
|
@@ -12,6 +12,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
12
12
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
|
|
15
|
+
import editorUGCToken from '../../ugc-tokens/get-editor-ugc-token';
|
|
15
16
|
import { DEVICE_BREAKPOINT_NUMBERS, ELEMENT_BROWSER_ID, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
|
|
16
17
|
import useContainerWidth from '../hooks/use-container-width';
|
|
17
18
|
import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
|
|
@@ -71,7 +72,8 @@ var sidebarHeading = css({
|
|
|
71
72
|
display: 'inline-flex',
|
|
72
73
|
alignItems: 'center',
|
|
73
74
|
paddingLeft: "var(--ds-space-150, 12px)",
|
|
74
|
-
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
76
|
+
font: editorUGCToken('editor.font.heading.h1', 'typography-modernized') // use editor h1 modernized here as the style matches
|
|
75
77
|
});
|
|
76
78
|
var mobileMainContent = css({
|
|
77
79
|
flex: '1 1 auto',
|
|
@@ -271,51 +273,54 @@ function MobileBrowser(_ref) {
|
|
|
271
273
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
272
274
|
emptyStateHandler = _ref.emptyStateHandler,
|
|
273
275
|
viewMoreItem = _ref.viewMoreItem;
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
276
|
+
return (
|
|
277
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
278
|
+
jsx("div", {
|
|
279
|
+
css: mobileElementBrowserContainer,
|
|
280
|
+
onKeyDown: onKeyDown,
|
|
281
|
+
"data-testid": "mobile__element-browser"
|
|
282
|
+
}, jsx("div", {
|
|
283
|
+
css: showCategories ? [mobileSideBar, mobileSideBarShowCategories] : mobileSideBar
|
|
284
|
+
}, showSearch && jsx(ElementSearch, {
|
|
285
|
+
onSearch: onSearch,
|
|
286
|
+
onKeyDown: onKeyPress,
|
|
287
|
+
mode: mode,
|
|
288
|
+
focus: focusOnSearch,
|
|
289
|
+
onClick: setFocusOnSearch,
|
|
290
|
+
searchTerm: searchTerm,
|
|
291
|
+
items: items,
|
|
292
|
+
selectedItemIndex: selectedItemIndex
|
|
293
|
+
}), showCategories && jsx("nav", {
|
|
294
|
+
css: mobileCategoryListWrapper,
|
|
295
|
+
tabIndex: -1
|
|
296
|
+
}, jsx(CategoryList, {
|
|
297
|
+
categories: categories,
|
|
298
|
+
onSelectCategory: onSelectCategory,
|
|
299
|
+
selectedCategory: selectedCategory,
|
|
300
|
+
focusedCategoryIndex: focusedCategoryIndex,
|
|
301
|
+
setFocusedCategoryIndex: setFocusedCategoryIndex,
|
|
302
|
+
setFocusedItemIndex: setFocusedItemIndex,
|
|
303
|
+
setFocusOnSearch: setFocusOnSearch
|
|
304
|
+
}))), jsx("div", {
|
|
305
|
+
css: mobileMainContent
|
|
306
|
+
}, jsx(ElementList, {
|
|
307
|
+
items: items,
|
|
308
|
+
mode: mode,
|
|
309
|
+
onInsertItem: onInsertItem,
|
|
310
|
+
selectedItemIndex: selectedItemIndex,
|
|
311
|
+
focusedItemIndex: focusedItemIndex,
|
|
312
|
+
setFocusedItemIndex: setFocusedItemIndex,
|
|
313
|
+
columnCount: columnCount,
|
|
314
|
+
setColumnCount: setColumnCount,
|
|
315
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
316
|
+
emptyStateHandler: emptyStateHandler,
|
|
317
|
+
selectedCategory: selectedCategory,
|
|
318
|
+
searchTerm: searchTerm
|
|
319
|
+
})), viewMoreItem && jsx(ViewMore, {
|
|
320
|
+
item: viewMoreItem,
|
|
321
|
+
focus: focusOnViewMore
|
|
322
|
+
}))
|
|
323
|
+
);
|
|
319
324
|
}
|
|
320
325
|
function DesktopBrowser(_ref2) {
|
|
321
326
|
var showCategories = _ref2.showCategories,
|
|
@@ -347,7 +352,7 @@ function DesktopBrowser(_ref2) {
|
|
|
347
352
|
"data-testid": "desktop__element-browser"
|
|
348
353
|
}, showCategories && jsx("div", {
|
|
349
354
|
css: showCategories ? sideBarShowCategories : sideBar
|
|
350
|
-
}, jsx("
|
|
355
|
+
}, jsx("div", {
|
|
351
356
|
css: sidebarHeading,
|
|
352
357
|
"data-testid": "sidebar-heading",
|
|
353
358
|
id: "sidebar-heading"
|