UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

66 lines (65 loc) 4.06 kB
/* index-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */ "use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports.ContextPanelWrapperCompiled = exports.ContextPanelContentCompiled = void 0; require("./index-compiled.compiled.css"); var React = _interopRequireWildcard(require("react")); var _runtime = require("@compiled/react/runtime"); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var _editorSharedStyles = require("@atlaskit/editor-shared-styles"); var _excluded = ["children", "customWidth", "visible", "disableAnimation"], _excluded2 = ["children", "customWidth", "visible", "disableAnimation", "hasPadding"]; /** * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment. * Used via `componentWithCondition` in `index.tsx`. * * Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped. */ 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); } var ANIM_SPEED_MS = 500; var panelStyles = { panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h", panelHidden: "_1bsbidpf", disablePanelAnimation: "_v564glyw", content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug", padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi", customWidthOverflow: "_1reo15vq" }; var ContextPanelWrapperCompiled = exports.ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref) { var children = _ref.children, customWidth = _ref.customWidth, visible = _ref.visible, disableAnimation = _ref.disableAnimation, rest = (0, _objectWithoutProperties2.default)(_ref, _excluded); return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS style: customWidth && visible ? { width: "".concat(customWidth, "px") } : undefined // eslint-disable-next-line react/jsx-props-no-spreading }, rest, { className: (0, _runtime.ax)([panelStyles.panel, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation]) }), children); }; var ContextPanelContentCompiled = exports.ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref2) { var children = _ref2.children, customWidth = _ref2.customWidth, visible = _ref2.visible, disableAnimation = _ref2.disableAnimation, hasPadding = _ref2.hasPadding, rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2); return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS style: customWidth && visible ? { width: "".concat(customWidth, "px") } : undefined // eslint-disable-next-line react/jsx-props-no-spreading }, rest, { className: (0, _runtime.ax)([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation]) }), children); };