@wordpress/block-library
Version:
Block library for the WordPress editor.
36 lines (35 loc) • 905 B
JavaScript
import clsx from "clsx";
import { InnerBlocks } from "@wordpress/block-editor";
import { jsx } from "react/jsx-runtime";
// packages/block-library/src/column/deprecated.jsx
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, {})
});
}
}];
export { deprecated as default };
//# sourceMappingURL=deprecated.mjs.map