参考: https://github.com/WordPress/gutenberg/pull/56912 ### padding.js ``` export function useBlockProps( settings ) { const { attributes, name, wrapperProps } = settings; return { ...settings, wrapperProps: { ...settings.wrapperProps, ...savePaddingProp( wrapperProps, name, attributes ), }, }; } ``` ### style.js ``` addFilter( 'editor.BlockListBlock', 'unitone/style/addEditProps', createHigherOrderComponent( ( BlockListBlock ) => { return ( props ) => { props = usePaddingBlockProps( props ); return <BlockListBlock { ...props } />; }; }, 'addEditProps' ) ); ```
Activity