UNPKG

@wordpress/block-library

Version:
1 lines • 1.44 kB
{"version":3,"file":"deprecated.cjs","names":["useBlockProps"],"sources":["../../src/spacer/deprecated.jsx"],"sourcesContent":["import { useBlockProps } from '@wordpress/block-editor';\n\nconst deprecated = [\n\t{\n\t\tattributes: {\n\t\t\theight: {\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 100,\n\t\t\t},\n\t\t\twidth: {\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t},\n\t\tmigrate( attributes ) {\n\t\t\tconst { height, width } = attributes;\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\twidth: width !== undefined ? `${ width }px` : undefined,\n\t\t\t\theight: height !== undefined ? `${ height }px` : undefined,\n\t\t\t};\n\t\t},\n\t\tsave( { attributes } ) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\t{ ...useBlockProps.save( {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\theight: attributes.height,\n\t\t\t\t\t\t\twidth: attributes.width,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'aria-hidden': true,\n\t\t\t\t\t} ) }\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"],"mappings":";;;;;;;;AAEA,MAAM,aAAa,CAClB;CACC,YAAY;EACX,QAAQ;GACP,MAAM;GACN,SAAS;EACV;EACA,OAAO,EACN,MAAM,SACP;CACD;CACA,QAAS,YAAa;EACrB,MAAM,EAAE,QAAQ,UAAU;EAC1B,OAAO;GACN,GAAG;GACH,OAAO,UAAU,KAAA,IAAY,GAAI,MAAO,MAAM,KAAA;GAC9C,QAAQ,WAAW,KAAA,IAAY,GAAI,OAAQ,MAAM,KAAA;EAClD;CACD;CACA,KAAM,EAAE,cAAe;EACtB,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EACC,GAAKA,wBAAAA,cAAc,KAAM;GACxB,OAAO;IACN,QAAQ,WAAW;IACnB,OAAO,WAAW;GACnB;GACA,eAAe;EAChB,CAAE,EACF,CAAA;CAEH;AACD,CACD"}