@wordpress/block-library
Version:
Block library for the WordPress editor.
44 lines (40 loc) • 846 B
JavaScript
import { createElement } from "@wordpress/element";
/**
* WordPress dependencies
*/
import { useBlockProps } from '@wordpress/block-editor';
const deprecated = [{
attributes: {
height: {
type: 'number',
default: 100
},
width: {
type: 'number'
}
},
migrate(attributes) {
const {
height,
width
} = attributes;
return { ...attributes,
width: width !== undefined ? `${width}px` : undefined,
height: height !== undefined ? `${height}px` : undefined
};
},
save(_ref) {
let {
attributes
} = _ref;
return createElement("div", useBlockProps.save({
style: {
height: attributes.height,
width: attributes.width
},
'aria-hidden': true
}));
}
}];
export default deprecated;
//# sourceMappingURL=deprecated.js.map