UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

67 lines (64 loc) 3.38 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.MainToolbarWrapper = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _react = _interopRequireDefault(require("react")); var _react2 = require("@emotion/react"); var _editorSharedStyles = require("@atlaskit/editor-shared-styles"); var _MainToolbar = require("./MainToolbar"); /** * @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 // Base styles that don't depend on feature flags var baseToolbarStyles = (0, _react2.css)({ position: 'relative', alignItems: 'center', boxShadow: 'none', borderBottom: "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 transition: "box-shadow 200ms ".concat(_editorSharedStyles.akEditorSwoopCubicBezier), // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values zIndex: _editorSharedStyles.akEditorFloatingDialogZIndex, // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values display: 'flex', height: 'var(--ak-editor-fullpage-toolbar-height)', flexShrink: 0, backgroundColor: "var(--ds-surface, #FFFFFF)", // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors '& object': { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles height: '0 !important' } }); var flexibleIconSize = (0, _react2.css)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors '& span svg': { maxWidth: '100%' } }); // box-shadow is overriden by the mainToolbar var mainToolbarWithKeyline = (0, _react2.css)({ // 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: "var(--ds-shadow-overflow, 0px 0px 8px #1E1F2128, 0px 0px 1px #1E1F211e)" }); var mainToolbarTwoLineStyle = (0, _react2.css)((0, _defineProperty2.default)({}, "@media (max-width: ".concat(_MainToolbar.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), { flexWrap: 'wrap', // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766 height: "calc(var(--ak-editor-fullpage-toolbar-height) * 2)" })); var MainToolbarWrapper = exports.MainToolbarWrapper = function MainToolbarWrapper(_ref) { var showKeyline = _ref.showKeyline, twoLineEditorToolbar = _ref.twoLineEditorToolbar, children = _ref.children, testId = _ref['data-testid']; return (0, _react2.jsx)("div", { // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage css: [baseToolbarStyles, flexibleIconSize, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle], "data-testid": testId }, children); };