UNPKG

@quillforms/block-editor

Version:
40 lines (39 loc) 854 B
/** * WordPress Dependencies */ import { useDispatch } from '@wordpress/data'; /** * External Dependencies */ import classnames from 'classnames'; import { jsx as _jsx } from "react/jsx-runtime"; const BoxWrapper = ({ id, parentId, children, isSelected }) => { const { setCurrentBlock, setCurrentChildBlock } = useDispatch('quillForms/block-editor'); return /*#__PURE__*/_jsx("div", { role: "presentation", onClick: e => { e.stopPropagation(); if (parentId) { setCurrentBlock(parentId); setCurrentChildBlock(id); } else { setCurrentBlock(id); } }, id: `block-editor-box-wrapper-${id}`, className: classnames('block-editor-box-wrapper', { isSelected }), children: children }); }; export default BoxWrapper; //# sourceMappingURL=index.js.map