File tree Expand file tree Collapse file tree
packages/blocks-library/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7979 " textarea"
8080 ]
8181 },
82- "styles " : {
82+ "style " : {
8383 "type" : " object" ,
8484 "default" : {
8585 "spacing" : {
Original file line number Diff line number Diff line change 6868 "autogeneratedName" : {
6969 "type" : " string" ,
7070 "default" : " "
71+ },
72+ "style" : {
73+ "type" : " object" ,
74+ "default" : {
75+ "spacing" : {
76+ "margin" : {
77+ "top" : " 0" ,
78+ "right" : " 0" ,
79+ "left" : " 0" ,
80+ "bottom" : " 20px"
81+ }
82+ }
83+ }
84+ }
85+ },
86+ "supports" : {
87+ "spacing" : {
88+ "margin" : true
7189 }
7290 },
73- "supports" : {},
7491 "styles" : []
7592}
Original file line number Diff line number Diff line change 1818 "id" : {
1919 "type" : " string" ,
2020 "default" : " "
21+ },
22+ "style" : {
23+ "type" : " object" ,
24+ "default" : {
25+ "spacing" : {
26+ "margin" : {
27+ "top" : " 0" ,
28+ "right" : " 0" ,
29+ "left" : " 0" ,
30+ "bottom" : " 20px"
31+ }
32+ }
33+ }
2134 }
2235 },
2336 "supports" : {
2437 "multiple" : false ,
2538 "spacing" : {
26- "margin" : true ,
27- "padding" : true
28- },
29- "typography" : {
30- "fontSize" : true ,
31- "lineHeight" : true
39+ "margin" : true
3240 }
3341 },
3442 "styles" : []
Original file line number Diff line number Diff line change 11/**
22 * WordPress Dependencies
33 */
4- import { isEmpty , omit , pick } from 'lodash' ;
4+ import { isEmpty } from 'lodash' ;
55import { __ } from '@wordpress/i18n' ;
66import { useBlockProps } from '@wordpress/block-editor' ;
77/**
@@ -15,31 +15,15 @@ export default function edit( props ) {
1515 className : classnames ( 'cf7-submit-field' ) ,
1616 } ) ;
1717
18- const blockPropsWithoutStyles = omit ( blockProps , [ 'style' ] ) ;
19-
2018 const { id, label } = props . attributes ;
2119
22- const buttonStyleProps = [
23- 'paddingTop' ,
24- 'paddingRight' ,
25- 'paddingBottom' ,
26- 'paddingLeft' ,
27- 'padding' ,
28- 'fontSize' ,
29- 'lineHeight' ,
30- ] ;
31-
3220 return (
3321 < >
34- < div
35- { ...blockPropsWithoutStyles }
36- style = { omit ( blockProps ?. style , buttonStyleProps ) }
37- >
22+ < div { ...blockProps } >
3823 < input
3924 id = { id }
4025 type = "submit"
4126 value = { isEmpty ( label ) ? 'Submit' : label }
42- style = { pick ( blockProps ?. style , buttonStyleProps ) }
4327 />
4428 </ div >
4529 < Inspector { ...props } />
You can’t perform that action at this time.
0 commit comments