UNPKG

@wordpress/block-library

Version:
40 lines (39 loc) 1.01 kB
import { jsx } from "react/jsx-runtime"; import clsx from "clsx"; import { InnerBlocks } from "@wordpress/block-editor"; const deprecated = [ { attributes: { verticalAlignment: { type: "string" }, width: { type: "number", min: 0, max: 100 } }, isEligible({ width }) { return isFinite(width); }, migrate(attributes) { return { ...attributes, width: `${attributes.width}%` }; }, save({ attributes }) { const { verticalAlignment, width } = attributes; const wrapperClasses = clsx({ [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); const style = { flexBasis: width + "%" }; return /* @__PURE__ */ jsx("div", { className: wrapperClasses, style, children: /* @__PURE__ */ jsx(InnerBlocks.Content, {}) }); } } ]; var deprecated_default = deprecated; export { deprecated_default as default }; //# sourceMappingURL=deprecated.js.map