UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

634 lines (625 loc) • 27 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.ElementItem = ElementItem; exports.itemIcon = exports.default = exports.ICON_WIDTH = exports.ICON_HEIGHT = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); var _react = _interopRequireWildcard(require("react")); var _react2 = require("@emotion/react"); var _reactVirtualized = require("react-virtualized"); var _AutoSizer = require("react-virtualized/dist/commonjs/AutoSizer"); var _CellMeasurer = require("react-virtualized/dist/commonjs/CellMeasurer"); var _withAnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsContext")); var _editorSharedStyles = require("@atlaskit/editor-shared-styles"); var _shortcut = require("@atlaskit/editor-shared-styles/shortcut"); var _menu = require("@atlaskit/menu"); var _platformFeatureFlags = require("@atlaskit/platform-feature-flags"); var _compiled = require("@atlaskit/primitives/compiled"); var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals"); var _experiments = require("@atlaskit/tmp-editor-statsig/experiments"); var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip")); var _analytics = require("../../../analytics"); var _quickInsert = require("../../../quick-insert"); var _constants = require("../../constants"); var _useContainerWidth2 = _interopRequireDefault(require("../../hooks/use-container-width")); var _useFocus = _interopRequireDefault(require("../../hooks/use-focus")); var _types = require("../../types"); var _EmptyState = _interopRequireDefault(require("./EmptyState")); var _utils = require("./utils"); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } /* eslint-disable @atlaskit/ui-styling-standard/use-compiled -- Pre-existing lint debt surfaced by this mechanical type-import-only PR. */ /** * @jsxRuntime classic * @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic var ICON_HEIGHT = exports.ICON_HEIGHT = 40; var ICON_WIDTH = exports.ICON_WIDTH = 40; // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766 var itemIcon = exports.itemIcon = (0, _react2.css)({ width: "".concat(ICON_WIDTH, "px"), height: "".concat(ICON_HEIGHT, "px"), overflow: 'hidden', border: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #0B120E24)"), // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 borderRadius: "var(--ds-radius-small, 3px)", boxSizing: 'border-box', display: 'flex', justifyContent: 'center', alignItems: 'center', // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 div: { width: "".concat(ICON_WIDTH, "px"), height: "".concat(ICON_HEIGHT, "px") } }); function ElementList(_ref) { var items = _ref.items, mode = _ref.mode, selectedItemIndex = _ref.selectedItemIndex, focusedItemIndex = _ref.focusedItemIndex, focusOnEmptyStateButton = _ref.focusOnEmptyStateButton, columnCount = _ref.columnCount, setColumnCount = _ref.setColumnCount, createAnalyticsEvent = _ref.createAnalyticsEvent, emptyStateHandler = _ref.emptyStateHandler, selectedCategory = _ref.selectedCategory, selectedCategoryIndex = _ref.selectedCategoryIndex, searchTerm = _ref.searchTerm, setFocusedCategoryIndex = _ref.setFocusedCategoryIndex, setFocusedItemIndex = _ref.setFocusedItemIndex, cache = _ref.cache, onInsertItem = _ref.onInsertItem, _ref$hasTabListContex = _ref.hasTabListContext, hasTabListContext = _ref$hasTabListContex === void 0 ? false : _ref$hasTabListContex; var _useContainerWidth = (0, _useContainerWidth2.default)(), containerWidth = _useContainerWidth.containerWidth, ContainerWidthMonitor = _useContainerWidth.ContainerWidthMonitor; var _useState = (0, _react.useState)(_constants.SCROLLBAR_WIDTH), _useState2 = (0, _slicedToArray2.default)(_useState, 2), scrollbarWidth = _useState2[0], setScrollbarWidth = _useState2[1]; var fullMode = mode === _types.Modes.full; (0, _react.useEffect)(function () { /** * More of an optimization condition. * Initially the containerWidths are reported 0 twice. **/ if (fullMode && containerWidth > 0) { setColumnCount((0, _utils.getColumnCount)(containerWidth)); var updatedScrollbarWidth = (0, _utils.getScrollbarWidth)(); if (updatedScrollbarWidth > 0) { // eslint-disable-next-line @atlassian/perf-linting/no-chain-state-updates -- Ignored via go/ees017 (to be fixed) setScrollbarWidth(updatedScrollbarWidth); } } }, [fullMode, containerWidth, setColumnCount, scrollbarWidth]); var onExternalLinkClick = (0, _react.useCallback)(function () { (0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({ payload: { action: _analytics.ACTION.VISITED, actionSubject: _analytics.ACTION_SUBJECT.SMART_LINK, eventType: _analytics.EVENT_TYPE.TRACK } }); }, [createAnalyticsEvent]); var listCache = (0, _react.useMemo)(function () { return cache !== null && cache !== void 0 ? cache : new _CellMeasurer.CellMeasurerCache({ fixedWidth: true, defaultHeight: _constants.ELEMENT_ITEM_HEIGHT, minHeight: _constants.ELEMENT_ITEM_HEIGHT }); }, [cache]); (0, _react.useEffect)(function () { // need to recalculate values if we have the same items, but they're reordered listCache.clearAll(); }, [listCache, searchTerm]); var rowHeight = function rowHeight(_ref2) { var index = _ref2.index; return listCache.rowHeight({ index: index }); }; return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ContainerWidthMonitor, null), (0, _react2.jsx)("div", { css: elementItemsWrapper, "data-testid": "element-items", id: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab', "aria-labelledby": !hasTabListContext && (0, _platformFeatureFlags.fg)('platform_editor_ally_remove_role_tabpanel') ? undefined : selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button', role: !hasTabListContext && (0, _platformFeatureFlags.fg)('platform_editor_ally_remove_role_tabpanel') ? undefined : 'tabpanel', tabIndex: items.length === 0 ? 0 : undefined }, !items.length ? emptyStateHandler ? emptyStateHandler({ mode: mode, selectedCategory: selectedCategory, searchTerm: searchTerm }) : (0, _react2.jsx)(_EmptyState.default, { onExternalLinkClick: onExternalLinkClick, focusOnEmptyStateButton: focusOnEmptyStateButton }) : (0, _react2.jsx)(_react.Fragment, null, containerWidth > 0 && (0, _react2.jsx)(_AutoSizer.AutoSizer, { disableWidth: true }, function (_ref3) { var height = _ref3.height; return columnCount === 1 ? (0, _react2.jsx)(ElementListSingleColumn, { cache: listCache, setFocusedCategoryIndex: setFocusedCategoryIndex, selectedCategoryIndex: selectedCategoryIndex, items: items, setFocusedItemIndex: setFocusedItemIndex, fullMode: fullMode, selectedItemIndex: selectedItemIndex, focusedItemIndex: focusedItemIndex, rowHeight: rowHeight, containerWidth: containerWidth, height: height, onInsertItem: onInsertItem }) : (0, _react2.jsx)(ElementListMultipleColumns, { columnCount: columnCount, cache: listCache, setFocusedCategoryIndex: setFocusedCategoryIndex, selectedCategoryIndex: selectedCategoryIndex, items: items, setFocusedItemIndex: setFocusedItemIndex, fullMode: fullMode, selectedItemIndex: selectedItemIndex, focusedItemIndex: focusedItemIndex, rowHeight: rowHeight, containerWidth: containerWidth, height: height, onInsertItem: onInsertItem }); })))); } var ElementListSingleColumn = function ElementListSingleColumn(props) { var items = props.items, fullMode = props.fullMode, setFocusedItemIndex = props.setFocusedItemIndex, rowHeight = props.rowHeight, containerWidth = props.containerWidth, height = props.height, onInsertItem = props.onInsertItem, cache = props.cache, focusedItemIndex = props.focusedItemIndex, setFocusedCategoryIndex = props.setFocusedCategoryIndex, selectedCategoryIndex = props.selectedCategoryIndex, selectedItemIndex = props.selectedItemIndex; var rowRenderer = (0, _react.useMemo)(function () { return function (_ref4) { var index = _ref4.index, key = _ref4.key, style = _ref4.style, parent = _ref4.parent; return (0, _react2.jsx)(_CellMeasurer.CellMeasurer, { key: key, cache: cache, parent: parent, columnIndex: 0, rowIndex: index }, (0, _react2.jsx)("div", { // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 style: style, key: key // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 -- Ignored via go/DSP-18766 , className: "element-item-wrapper", css: elementItemWrapperSingle, role: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? 'presentation' : undefined, onKeyDown: function onKeyDown(e) { if (e.key === 'Tab') { if (e.shiftKey && index === 0) { if (setFocusedCategoryIndex) { if (!!selectedCategoryIndex) { setFocusedCategoryIndex(selectedCategoryIndex); } else { setFocusedCategoryIndex(0); } e.preventDefault(); } } // before focus jumps from elements list we need to rerender react-virtualized grid. // Otherwise on the next render 'scrollToCell' will have same cached value // and grid will not be scrolled to top. // So Tab press on category will not work anymore due to invisible 1-t element. else if (index === items.length - 2) { setFocusedItemIndex(items.length - 1); } } } }, (0, _react2.jsx)(MemoizedElementItem, { inlineMode: !fullMode, index: index, item: items[index], selected: selectedItemIndex === index, focus: focusedItemIndex === index, setFocusedItemIndex: setFocusedItemIndex, onInsertItem: onInsertItem, role: (0, _expValEquals.expValEquals)('platform_editor_august_a11y', 'isEnabled', true) ? 'option' : undefined }))); }; }, // eslint-disable-next-line react-hooks/exhaustive-deps [cache, items, fullMode, selectedItemIndex, focusedItemIndex, selectedCategoryIndex, setFocusedCategoryIndex, setFocusedItemIndex, props]); return (0, _react2.jsx)(_reactVirtualized.List, (0, _extends2.default)({ rowRenderer: rowRenderer, rowCount: items.length, rowHeight: rowHeight, width: containerWidth - _constants.ELEMENT_LIST_PADDING * 2, height: height, overscanRowCount: 3, containerRole: "presentation", role: "listbox" // Ignored via go/ees005 // eslint-disable-next-line react/jsx-props-no-spreading }, selectedItemIndex !== undefined && { scrollToIndex: selectedItemIndex })); }; var ElementListMultipleColumns = function ElementListMultipleColumns(props) { var columnCount = props.columnCount, items = props.items, fullMode = props.fullMode, setFocusedItemIndex = props.setFocusedItemIndex, rowHeight = props.rowHeight, containerWidth = props.containerWidth, height = props.height, onInsertItem = props.onInsertItem, cache = props.cache, focusedItemIndex = props.focusedItemIndex, setFocusedCategoryIndex = props.setFocusedCategoryIndex, selectedCategoryIndex = props.selectedCategoryIndex, selectedItemIndex = props.selectedItemIndex; var columnWidth = (containerWidth - _constants.ELEMENT_ITEM_PADDING * 2) / columnCount; var rowCount = Math.ceil(items.length / columnCount); var cellRenderer = (0, _react.useMemo)(function () { return function (_ref5) { var columnIndex = _ref5.columnIndex, key = _ref5.key, parent = _ref5.parent, rowIndex = _ref5.rowIndex, style = _ref5.style; var index = rowIndex * columnCount + columnIndex; if (items[index] == null) { return; } return index > items.length - 1 ? null : (0, _react2.jsx)(_CellMeasurer.CellMeasurer, { cache: cache, key: key, rowIndex: rowIndex, columnIndex: columnIndex, parent: parent }, (0, _react2.jsx)("div", { // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 style: style, key: key // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 -- Ignored via go/DSP-18766 , className: "element-item-wrapper", role: "gridcell", tabIndex: 0, css: elementItemWrapper, onKeyDown: function onKeyDown(e) { if (e.key === 'Tab') { if (e.shiftKey && index === 0) { if (setFocusedCategoryIndex) { if (!!selectedCategoryIndex) { setFocusedCategoryIndex(selectedCategoryIndex); } else { setFocusedCategoryIndex(0); } e.preventDefault(); } } // before focus jumps from elements list we need to rerender react-virtualized grid. // Otherwise on the next render 'scrollToCell' will have same cached value // and grid will not be scrolled to top. // So Tab press on category will not work anymore due to invisible 1-t element. else if (index === items.length - 2) { setFocusedItemIndex(items.length - 1); } } } }, (0, _react2.jsx)(MemoizedElementItem, { inlineMode: !fullMode, index: index, item: items[index], selected: selectedItemIndex === index, focus: focusedItemIndex === index, setFocusedItemIndex: setFocusedItemIndex, onInsertItem: onInsertItem }))); }; }, // eslint-disable-next-line react-hooks/exhaustive-deps [cache, items, fullMode, selectedItemIndex, columnCount, focusedItemIndex, selectedCategoryIndex, setFocusedCategoryIndex, setFocusedItemIndex, props]); return (0, _react2.jsx)(_reactVirtualized.Grid, (0, _extends2.default)({ containerRole: "row", cellRenderer: cellRenderer, height: height, width: containerWidth - _constants.ELEMENT_LIST_PADDING * 2 // containerWidth - padding on Left/Right (for focus outline) /** * Refresh Grid on WidthObserver value change. * Length of the items used to force re-render to solve Firefox bug with react-virtualized retaining * scroll position after updating the data. If new data has different number of cells, a re-render * is forced to prevent the scroll position render bug. */, key: containerWidth + items.length, rowHeight: rowHeight, rowCount: rowCount, columnCount: columnCount, columnWidth: columnWidth, deferredMeasurementCache: cache // Ignored via go/ees005 // eslint-disable-next-line react/jsx-props-no-spreading }, selectedItemIndex !== undefined && { scrollToRow: Math.floor(selectedItemIndex / columnCount) })); }; var MemoizedElementItem = /*#__PURE__*/(0, _react.memo)(ElementItem); MemoizedElementItem.displayName = 'MemoizedElementItem'; function ElementItem(_ref6) { var inlineMode = _ref6.inlineMode, selected = _ref6.selected, item = _ref6.item, index = _ref6.index, onInsertItem = _ref6.onInsertItem, focus = _ref6.focus, setFocusedItemIndex = _ref6.setFocusedItemIndex, role = _ref6.role; var ref = (0, _useFocus.default)(focus); /** * Note: props.onSelectItem(item) is not called here as the StatelessElementBrowser's * useEffect would trigger it on selectedItemIndex change. (Line 106-110) * This implementation was changed for keyboard/click selection to work with `onInsertItem`. */ var onClick = (0, _react.useCallback)(function (e) { e.preventDefault(); e.stopPropagation(); setFocusedItemIndex(index); switch (e.nativeEvent.detail) { case 0: onInsertItem(item); break; case 1: if (inlineMode) { onInsertItem(item); } break; case 2: if (!inlineMode) { onInsertItem(item); } break; default: return; } }, [index, inlineMode, item, onInsertItem, setFocusedItemIndex]); var icon = item.icon, title = item.title, description = item.description, keyshortcut = item.keyshortcut, isDisabled = item.isDisabled, lozenge = item.lozenge; return (0, _react2.jsx)(_tooltip.default, { content: description, testId: "element-item-tooltip-".concat(index) }, (0, _react2.jsx)(_menu.ButtonItem, { onClick: onClick, iconBefore: (0, _react2.jsx)(ElementBefore, { icon: icon, title: title }), isSelected: selected, "aria-describedby": (0, _expValEquals.expValEquals)('platform_editor_august_a11y', 'isEnabled', true) ? undefined : title, "aria-label": (0, _expValEquals.expValEquals)('platform_editor_august_a11y', 'isEnabled', true) ? title : undefined, ref: ref, testId: "element-item-".concat(index), id: "searched-item-".concat(index), isDisabled: isDisabled, role: role }, (0, _react2.jsx)(ItemContent // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 , { style: inlineMode ? null : itemStyleOverrides, tabIndex: 0, title: title, description: description, keyshortcut: keyshortcut, isDisabled: isDisabled, lozenge: lozenge }))); } /** * Inline mode should use the existing Align-items:center value. */ var itemStyleOverrides = { alignItems: 'flex-start' }; var ElementBefore = /*#__PURE__*/(0, _react.memo)(function (_ref7) { var icon = _ref7.icon; return (0, _react2.jsx)("div", { css: [itemIcon, itemIconStyle] }, icon ? icon() : (0, _react2.jsx)(_quickInsert.IconFallback, null)); }); var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref8) { var title = _ref8.title, description = _ref8.description, keyshortcut = _ref8.keyshortcut, lozenge = _ref8.lozenge, isDisabled = _ref8.isDisabled; if ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc')) { return ( // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 (0, _react2.jsx)("div", { css: itemBody, className: "item-body" }, (0, _react2.jsx)("div", { css: itemText }, (0, _react2.jsx)(_compiled.Stack, { space: "space.025" }, (0, _react2.jsx)("div", { css: itemTitleWrapper }, (0, _experiments.editorExperiment)('platform_synced_block', true) || lozenge ? (0, _react2.jsx)(_compiled.Flex, { alignItems: "center", gap: "space.050" }, (0, _react2.jsx)(_compiled.Text, { color: isDisabled ? 'color.text.disabled' : undefined, maxLines: 1 }, title), lozenge) : (0, _react2.jsx)(_compiled.Text, { color: isDisabled ? 'color.text.disabled' : undefined, maxLines: 1 }, title), (0, _react2.jsx)("div", { css: itemAfter }, keyshortcut && (0, _react2.jsx)("div", { css: _shortcut.shortcutStyle }, keyshortcut))), description && (0, _react2.jsx)(_compiled.Text, { color: isDisabled ? 'color.text.disabled' : 'color.text.subtle', size: "small", maxLines: 2 }, description)))) ); } else { return ( // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 (0, _react2.jsx)("div", { css: itemBody, className: "item-body" }, (0, _react2.jsx)("div", { css: itemText }, (0, _react2.jsx)("div", { css: itemTitleWrapper }, (0, _react2.jsx)("p", { css: isDisabled ? itemTitleDisabled : itemTitle }, title), (0, _react2.jsx)("div", { css: itemAfter }, keyshortcut && (0, _react2.jsx)("div", { css: _shortcut.shortcutStyle }, keyshortcut))), description && // eslint-disable-next-line @atlaskit/design-system/use-primitives-text (0, _react2.jsx)("p", { css: isDisabled ? itemDescriptionDisabled : itemDescription }, description))) ); } }); var elementItemsWrapper = (0, _react2.css)({ flex: 1, flexFlow: 'row wrap', alignItems: 'flex-start', justifyContent: 'flex-start', overflow: 'hidden', padding: "var(--ds-space-025, 2px)", // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 '.ReactVirtualized__Grid': { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/no-unsafe-design-token-usage -- Ignored via go/DSP-18766 borderRadius: "var(--ds-radius-small, 3px)", outline: 'none', '&:focus': { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 boxShadow: "0 0 0 ".concat(_constants.ELEMENT_LIST_PADDING, "px ", "var(--ds-border-focused, #4688EC)") } }, // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 '.ReactVirtualized__Grid__innerScrollContainer': { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766 "div[class='element-item-wrapper']:last-child": { paddingBottom: "var(--ds-space-050, 4px)" } } }); var elementItemWrapperSingle = (0, _react2.css)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 div: { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 button: { minHeight: '60px', alignItems: 'flex-start', padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 11px") } } }); var elementItemWrapper = (0, _react2.css)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 div: { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 button: { minHeight: '75px', alignItems: 'flex-start', padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 11px") } } }); var itemBody = (0, _react2.css)({ display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', justifyContent: 'space-between', // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography lineHeight: 1.4, width: '100%', marginTop: "var(--ds-space-negative-025, -2px)" }); /* * -webkit-line-clamp is also supported by firefox 🎉 * https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/68#CSS */ var multilineStyle = (0, _react2.css)({ display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' }); // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 var itemDescription = (0, _react2.css)(multilineStyle, { overflow: 'hidden', // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67), color: "var(--ds-text-subtle, #505258)", marginTop: "var(--ds-space-025, 2px)" }); // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 var itemDescriptionDisabled = (0, _react2.css)(multilineStyle, { overflow: 'hidden', // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67), color: "var(--ds-text-disabled, #080F214A)", marginTop: "var(--ds-space-025, 2px)" }); var itemText = (0, _react2.css)({ width: 'inherit', whiteSpace: 'initial' }); var itemTitleWrapper = (0, _react2.css)({ display: 'flex', justifyContent: 'space-between' }); var itemTitle = (0, _react2.css)({ width: '100%', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }); var itemTitleDisabled = (0, _react2.css)({ width: '100%', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', color: "var(--ds-text-disabled, #080F214A)" }); var itemAfter = (0, _react2.css)({ flex: '0 0 auto', paddingTop: "var(--ds-space-025, 2px)", marginBottom: "var(--ds-space-negative-025, -2px)" }); var itemIconStyle = (0, _react2.css)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766 img: { height: '40px', width: '40px', objectFit: 'cover' } }); var MemoizedElementListWithAnalytics = /*#__PURE__*/(0, _react.memo)((0, _withAnalyticsContext.default)({ component: 'ElementList' })(ElementList)); var _default = exports.default = MemoizedElementListWithAnalytics;