@wordpress/block-library
Version:
Block library for the WordPress editor.
33 lines (32 loc) • 1.4 kB
JavaScript
;
Object.defineProperties(exports, {
__esModule: { value: true },
[Symbol.toStringTag]: { value: "Module" }
});
let _wordpress_i18n = require("@wordpress/i18n");
let _wordpress_block_editor = require("@wordpress/block-editor");
let _wordpress_compose = require("@wordpress/compose");
let _wordpress_components = require("@wordpress/components");
let _wordpress_icons = require("@wordpress/icons");
let react_jsx_runtime = require("react/jsx-runtime");
// packages/block-library/src/shortcode/edit.jsx
function ShortcodeEdit({ attributes, setAttributes }) {
const inputId = `blocks-shortcode-input-${(0, _wordpress_compose.useInstanceId)(ShortcodeEdit)}`;
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
...(0, _wordpress_block_editor.useBlockProps)(),
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_components.Placeholder, {
icon: _wordpress_icons.shortcode,
label: (0, _wordpress_i18n.__)("Shortcode"),
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_wordpress_block_editor.PlainText, {
className: "blocks-shortcode__textarea",
id: inputId,
value: attributes.text,
"aria-label": (0, _wordpress_i18n.__)("Shortcode text"),
placeholder: (0, _wordpress_i18n.__)("Write shortcode here…"),
onChange: (text) => setAttributes({ text })
})
})
});
}
exports.default = ShortcodeEdit;
//# sourceMappingURL=edit.cjs.map