@wordpress/block-library
Version:
Block library for the WordPress editor.
41 lines (39 loc) • 1.27 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ShortcodeEdit;
var _i18n = require("@wordpress/i18n");
var _blockEditor = require("@wordpress/block-editor");
var _compose = require("@wordpress/compose");
var _components = require("@wordpress/components");
var _icons = require("@wordpress/icons");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
function ShortcodeEdit({
attributes,
setAttributes
}) {
const instanceId = (0, _compose.useInstanceId)(ShortcodeEdit);
const inputId = `blocks-shortcode-input-${instanceId}`;
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
...(0, _blockEditor.useBlockProps)(),
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Placeholder, {
icon: _icons.shortcode,
label: (0, _i18n.__)('Shortcode'),
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.PlainText, {
className: "blocks-shortcode__textarea",
id: inputId,
value: attributes.text,
"aria-label": (0, _i18n.__)('Shortcode text'),
placeholder: (0, _i18n.__)('Write shortcode here…'),
onChange: text => setAttributes({
text
})
})
})
});
}
//# sourceMappingURL=edit.js.map
;