UNPKG

@atlaskit/renderer

Version:
54 lines 4.16 kB
/* panel-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */ import _extends from "@babel/runtime/helpers/extends"; import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["backgroundColor", "children", "className", "hasIcon"]; import "./panel-compiled.compiled.css"; import { ax, ix } from "@compiled/react/runtime"; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** * Compiled branch of the `platform_editor_static_css` experiment. * Used via `componentWithCondition` in `panel.tsx`. * * Cleanup: delete this file once the experiment has shipped. */ import React from 'react'; import { PanelType } from '@atlaskit/adf-schema'; import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts'; import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette'; import { fg } from '@atlaskit/platform-feature-flags'; // New custom icons are a little smaller than predefined icons. // To fix alignment issues with custom icons, vertical alignment is updated. var panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2; var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1; var blockNodesVerticalMargin = '0.75rem'; var akEditorTableCellMinWidth = 48; var panelBaseStyles = null; var panelHasNoIconStyles = null; var panelNestedIconStyles = null; var nestedPanelStyles = null; var panelCustomBackground = null; var PanelStyledCompiled = function PanelStyledCompiled(_ref) { var backgroundColor = _ref.backgroundColor, children = _ref.children, className = _ref.className, hasIcon = _ref.hasIcon, props = _objectWithoutProperties(_ref, _excluded); var customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined; return /*#__PURE__*/React.createElement("div", _extends({}, props, { // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class className: ax(["_lklzfajl _imyb1bbz _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3jmsf _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hauowts _7c6p1t9x _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", fg('platform_editor_nested_dnd_styles_changes') && "_9dunutpp _pzbautpp", "_1wvnia51", className]), style: _objectSpread(_objectSpread({}, { // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable '--ak-renderer-panel-custom-bg-color': customBackgroundColor }), {}, { "--_15dzi2n": ix("".concat(blockNodesVerticalMargin, " 0 0")), "--_1jw427p": ix("".concat(akEditorTableCellMinWidth, "px")), "--_qwtrmr": ix("".concat(panelEmojiSpriteVerticalAlignment, "px")), "--_1glv3p1": ix("".concat(panelEmojiImageVerticalAlignment, "px")) }) }), children); }; export { PanelStyledCompiled }; PanelStyledCompiled.displayName = 'PanelStyledCompiled';