@wordpress/block-library
Version:
Block library for the WordPress editor.
56 lines (53 loc) • 1.55 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = TermDescriptionEdit;
var _clsx = _interopRequireDefault(require("clsx"));
var _i18n = require("@wordpress/i18n");
var _blockEditor = require("@wordpress/block-editor");
var _jsxRuntime = require("react/jsx-runtime");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
function TermDescriptionEdit({
attributes,
setAttributes,
mergedStyle
}) {
const {
textAlign
} = attributes;
const blockProps = (0, _blockEditor.useBlockProps)({
className: (0, _clsx.default)({
[`has-text-align-${textAlign}`]: textAlign
}),
style: mergedStyle
});
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
group: "block",
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
})
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
...blockProps,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
className: "wp-block-term-description__placeholder",
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
children: (0, _i18n.__)('Term Description')
})
})
})]
});
}
//# sourceMappingURL=edit.js.map
;