Skip to content

Commit 01cfc4f

Browse files
authored
Fix (editor): multiple block editor JavaScript warnings (#3585)
* fix warning isEditingTemplate is deprecated * fixed all margin warnings --------- Co-authored-by: [email protected] <>
1 parent 68dbbc3 commit 01cfc4f

File tree

37 files changed

+83
-26
lines changed

37 files changed

+83
-26
lines changed

src/block-components/linking/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const _Linking = () => {
4444
return <div
4545
className="stk-linking-wrapper"
4646
>
47-
<Tooltip position="bottom" text={
47+
<Tooltip placement="bottom" text={
4848
<>
4949
{ __( 'When linked, styling this block would also style other linked blocks in adjacent columns.', i18n ) }
5050
<br />

src/block/map/location-control.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const LocationControl = props => {
6262
onChange={ value => {
6363
props.onTextChange( value )
6464
} }
65+
__next40pxDefaultSize
6566
/>
6667
)
6768
}

src/components/advanced-autosuggest-control/editor.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
.ugb-advanced-autosuggest-control {
22
margin-bottom: 16px;
3+
4+
.stk-inspector-control__reset-button {
5+
transform: translateY(-3px);
6+
}
37
}
48
.ugb-advanced-autosuggest-control__select {
59
> * {
610
position: relative;
711
}
812
input {
913
width: 100%;
14+
height: 40px; // Follow new WP standard.
1015
}
1116
.react-autosuggest__suggestions-container {
1217
position: absolute;

src/components/advanced-focal-point-control/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const AdvancedFocalPointControl = props => {
4242
{ ...propsToPass }
4343
value={ value || FOCAL_DEFAULT_VALUE }
4444
onChange={ typeof props.onChange === 'undefined' ? onChange : props.onChange }
45+
__nextHasNoMarginBottom
4546
/>
4647
<ResetButton
4748
allowReset={ props.allowReset }

src/components/advanced-range-control/editor.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
flex: 1;
1616
display: flex;
1717
align-items: center;
18+
height: 40px; // Follow new WP standard.
1819
.components-range-control {
1920
flex: 1;
2021
margin: 0 !important;

src/components/advanced-range-control/range-control.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ const StackableRangeControl = memo( props => {
163163
? props.sliderMax
164164
: ( props.max === Infinity ? 100 : props.max ) // Dont' allow Infinity on the slider since it will not move.
165165
}
166+
__next40pxDefaultSize
167+
__nextHasNoMarginBottom
166168
/>
167169
{ withInputField && isNumberControlSupported && (
168170
<NumberControl
@@ -177,6 +179,8 @@ const StackableRangeControl = memo( props => {
177179
value={ value }
178180
placeholder={ placeholderValue }
179181
type="text"
182+
__next40pxDefaultSize
183+
__nextHasNoMarginBottom
180184
/>
181185
) }
182186
{ _children }

src/components/advanced-select-control/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ const AdvancedSelectControl = memo( props => {
3535
role="listbox"
3636
value={ typeof props.value === 'undefined' ? value : props.value }
3737
onChange={ typeof props.onChange === 'undefined' ? onChange : props.onChange }
38+
__nextHasNoMarginBottom
39+
__next40pxDefaultSize
3840
/>
3941
<ResetButton
4042
allowReset={ props.allowReset }

src/components/advanced-text-control/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const AdvancedTextControl = memo( props => {
6666
value={ internalValue }
6767
onChange={ internalOnChange }
6868
className={ classnames( propsToPass.className, 'ugb-advanced-text-control' ) }
69+
__nextHasNoMarginBottom
70+
__next40pxDefaultSize
6971
/>
7072
</DynamicContentControl>
7173
<ResetButton

src/components/advanced-toggle-control/editor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.stk-toggle-control .components-base-control__field {
66
display: flex;
7-
align-items: center;
7+
align-items: flex-start;
88
.components-form-toggle {
99
margin-inline-end: 12px;
1010
}

src/components/advanced-toggle-control/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const AdvancedToggleControl = memo( props => {
5050
id={ id }
5151
help={ helpLabel }
5252
className={ className }
53-
allowReset={ true }
53+
allowReset={ props.allowReset }
5454
value={ checked }
5555
showReset={ props.defaultValue ? checked !== props.defaultValue : checked }
5656
onChange={ onChange }
@@ -72,7 +72,7 @@ const AdvancedToggleControl = memo( props => {
7272

7373
AdvancedToggleControl.defaultProps = {
7474
className: '',
75-
allowReset: false,
75+
allowReset: true,
7676
showReset: null,
7777
defaultValue: '',
7878

0 commit comments

Comments
 (0)