UNPKG

@wordpress/block-library

Version:
1 lines • 1.09 kB
{"version":3,"file":"save.mjs","names":[],"sources":["../../src/spacer/save.jsx"],"sourcesContent":["import { useBlockProps, getSpacingPresetCssVar } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { height, width, style } = attributes;\n\tconst { layout: { selfStretch } = {} } = style || {};\n\t// If selfStretch is set to 'fill' or 'fit', don't set default height.\n\tconst finalHeight =\n\t\tselfStretch === 'fill' || selfStretch === 'fit' ? undefined : height;\n\treturn (\n\t\t<div\n\t\t\t{ ...useBlockProps.save( {\n\t\t\t\tstyle: {\n\t\t\t\t\theight: getSpacingPresetCssVar( finalHeight ),\n\t\t\t\t\twidth: getSpacingPresetCssVar( width ),\n\t\t\t\t},\n\t\t\t\t'aria-hidden': true,\n\t\t\t} ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;AAEA,SAAwB,KAAM,EAAE,cAAe;CAC9C,MAAM,EAAE,QAAQ,OAAO,UAAU;CACjC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,CAAC,MAAM,SAAS,CAAC;CAEnD,MAAM,cACL,gBAAgB,UAAU,gBAAgB,QAAQ,KAAA,IAAY;CAC/D,OACC,oBAAC,OAAD,EACC,GAAK,cAAc,KAAM;EACxB,OAAO;GACN,QAAQ,uBAAwB,WAAY;GAC5C,OAAO,uBAAwB,KAAM;EACtC;EACA,eAAe;CAChB,CAAE,EACF,CAAA;AAEH"}