@wordpress/block-library
Version:
Block library for the WordPress editor.
43 lines (42 loc) • 1.06 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { InnerBlocks, useBlockProps } from "@wordpress/block-editor";
const v1 = {
attributes: {
tagName: {
type: "string",
default: "div"
}
},
apiVersion: 3,
supports: {
align: ["wide", "full"],
html: false,
color: {
gradients: true,
link: true,
__experimentalDefaultControls: {
background: true,
text: true,
link: true
}
}
},
save({ attributes: { tagName: Tag } }) {
const blockProps = useBlockProps.save();
const { className } = blockProps;
const classes = className?.split(" ") || [];
const newClasses = classes?.filter(
(cls) => cls !== "wp-block-comments"
);
const newBlockProps = {
...blockProps,
className: newClasses.join(" ")
};
return /* @__PURE__ */ jsx(Tag, { ...newBlockProps, children: /* @__PURE__ */ jsx(InnerBlocks.Content, {}) });
}
};
var deprecated_default = [v1];
export {
deprecated_default as default
};
//# sourceMappingURL=deprecated.js.map