UNPKG

@gechiui/block-editor

Version:
42 lines (37 loc) 1.07 kB
import { createElement } from "@gechiui/element"; /** * Internal dependencies */ import BorderStyleControl from '../components/border-style-control'; import { cleanEmptyObject } from './utils'; /** * Inspector control for configuring border style property. * * @param {Object} props Block properties. * * @return {GCElement} Border style edit element. */ export const BorderStyleEdit = props => { var _style$border; const { attributes: { style }, setAttributes } = props; const onChange = newBorderStyle => { const newStyleAttributes = { ...style, border: { ...(style === null || style === void 0 ? void 0 : style.border), style: newBorderStyle } }; setAttributes({ style: cleanEmptyObject(newStyleAttributes) }); }; return createElement(BorderStyleControl, { value: style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.style, onChange: onChange }); }; //# sourceMappingURL=border-style.js.map