@wordpress/block-library
Version:
Block library for the WordPress editor.
28 lines (27 loc) • 992 B
JavaScript
import { __ } from "@wordpress/i18n";
import { PlainText, useBlockProps } from "@wordpress/block-editor";
import { useInstanceId } from "@wordpress/compose";
import { Placeholder } from "@wordpress/components";
import { shortcode } from "@wordpress/icons";
import { jsx } from "react/jsx-runtime";
// packages/block-library/src/shortcode/edit.jsx
function ShortcodeEdit({ attributes, setAttributes }) {
const inputId = `blocks-shortcode-input-${useInstanceId(ShortcodeEdit)}`;
return /* @__PURE__ */ jsx("div", {
...useBlockProps(),
children: /* @__PURE__ */ jsx(Placeholder, {
icon: shortcode,
label: __("Shortcode"),
children: /* @__PURE__ */ jsx(PlainText, {
className: "blocks-shortcode__textarea",
id: inputId,
value: attributes.text,
"aria-label": __("Shortcode text"),
placeholder: __("Write shortcode here…"),
onChange: (text) => setAttributes({ text })
})
})
});
}
export { ShortcodeEdit as default };
//# sourceMappingURL=edit.mjs.map