Skip to content

Commit 5a9635a

Browse files
committed
✨ updates
1 parent b42ca5b commit 5a9635a

5 files changed

Lines changed: 35 additions & 26 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

packages/blocks-library/src/input-base/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"textarea"
8080
]
8181
},
82-
"styles": {
82+
"style": {
8383
"type": "object",
8484
"default": {
8585
"spacing": {

packages/blocks-library/src/selection-base/block.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,25 @@
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
}

packages/blocks-library/src/submit/block.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@
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": []

packages/blocks-library/src/submit/edit.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* WordPress Dependencies
33
*/
4-
import { isEmpty, omit, pick } from 'lodash';
4+
import { isEmpty } from 'lodash';
55
import { __ } from '@wordpress/i18n';
66
import { 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 } />

0 commit comments

Comments
 (0)