@wordpress/block-library
Version:
Block library for the WordPress editor.
38 lines (36 loc) • 898 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = save;
var _blockEditor = require("@wordpress/block-editor");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
function save({
attributes
}) {
const {
height,
width,
style
} = attributes;
const {
layout: {
selfStretch
} = {}
} = style || {};
// If selfStretch is set to 'fill' or 'fit', don't set default height.
const finalHeight = selfStretch === 'fill' || selfStretch === 'fit' ? undefined : height;
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
..._blockEditor.useBlockProps.save({
style: {
height: (0, _blockEditor.getSpacingPresetCssVar)(finalHeight),
width: (0, _blockEditor.getSpacingPresetCssVar)(width)
},
'aria-hidden': true
})
});
}
//# sourceMappingURL=save.js.map
;