@wordpress/block-editor 10.1.1-next.4d3b314fd5.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-controls/slot.js +2 -2
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +4 -5
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-parent-selector/index.js +2 -2
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-popover/inbetween.js +3 -1
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +20 -16
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -5
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/image-editor/use-transform-image.js +2 -2
- package/build/components/image-editor/use-transform-image.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +1 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/search-items.js +2 -17
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inspector-controls/slot.js +2 -1
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/rich-text/index.js +17 -0
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +10 -2
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +5 -4
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/store/reducer.js +5 -3
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/block-controls/slot.js +3 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +5 -6
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +2 -2
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +3 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +20 -16
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/image-editor/use-transform-image.js +2 -2
- package/build-module/components/image-editor/use-transform-image.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +3 -3
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/search-items.js +3 -17
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +3 -2
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/rich-text/index.js +17 -0
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +10 -3
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +6 -5
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/store/reducer.js +5 -4
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +28 -23
- package/build-style/style.css +28 -23
- package/package.json +28 -29
- package/src/components/block-controls/slot.js +3 -3
- package/src/components/block-inspector/index.js +6 -10
- package/src/components/block-parent-selector/index.js +2 -2
- package/src/components/block-popover/inbetween.js +1 -1
- package/src/components/block-popover/index.js +37 -21
- package/src/components/block-settings-menu/block-settings-dropdown.js +7 -7
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +104 -33
- package/src/components/block-switcher/test/index.js +121 -61
- package/src/components/button-block-appender/style.scss +3 -1
- package/src/components/image-editor/use-transform-image.js +2 -2
- package/src/components/inserter/block-types-tab.js +3 -3
- package/src/components/inserter/search-items.js +3 -15
- package/src/components/inserter/test/search-items.js +4 -0
- package/src/components/inspector-controls/slot.js +6 -2
- package/src/components/responsive-block-control/test/index.js +73 -118
- package/src/components/rich-text/index.js +22 -0
- package/src/components/spacing-sizes-control/index.js +15 -3
- package/src/components/spacing-sizes-control/spacing-input-control.js +8 -7
- package/src/components/spacing-sizes-control/style.scss +28 -24
- package/src/store/reducer.js +4 -4
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { render
|
|
5
|
-
import
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { Fragment, useState } from '@wordpress/element';
|
|
11
|
-
|
|
12
11
|
import { SelectControl } from '@wordpress/components';
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -16,20 +15,6 @@ import { SelectControl } from '@wordpress/components';
|
|
|
16
15
|
*/
|
|
17
16
|
import ResponsiveBlockControl from '../index';
|
|
18
17
|
|
|
19
|
-
let container = null;
|
|
20
|
-
beforeEach( () => {
|
|
21
|
-
// Setup a DOM element as a render target.
|
|
22
|
-
container = document.createElement( 'div' );
|
|
23
|
-
document.body.appendChild( container );
|
|
24
|
-
} );
|
|
25
|
-
|
|
26
|
-
afterEach( () => {
|
|
27
|
-
// Cleanup on exiting.
|
|
28
|
-
unmountComponentAtNode( container );
|
|
29
|
-
container.remove();
|
|
30
|
-
container = null;
|
|
31
|
-
} );
|
|
32
|
-
|
|
33
18
|
const inputId = 'input-12345678';
|
|
34
19
|
|
|
35
20
|
const sizeOptions = [
|
|
@@ -65,16 +50,13 @@ const renderTestDefaultControlComponent = ( labelComponent, device ) => {
|
|
|
65
50
|
|
|
66
51
|
describe( 'Basic rendering', () => {
|
|
67
52
|
it( 'should render with required props', () => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
container
|
|
76
|
-
);
|
|
77
|
-
} );
|
|
53
|
+
const { container } = render(
|
|
54
|
+
<ResponsiveBlockControl
|
|
55
|
+
title="Padding"
|
|
56
|
+
property="padding"
|
|
57
|
+
renderDefaultControl={ renderTestDefaultControlComponent }
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
78
60
|
|
|
79
61
|
const activePropertyLabel = Array.from(
|
|
80
62
|
container.querySelectorAll( 'legend' )
|
|
@@ -121,40 +103,31 @@ describe( 'Basic rendering', () => {
|
|
|
121
103
|
} );
|
|
122
104
|
|
|
123
105
|
it( 'should not render without valid legend', () => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
container
|
|
131
|
-
);
|
|
132
|
-
} );
|
|
106
|
+
const { container } = render(
|
|
107
|
+
<ResponsiveBlockControl
|
|
108
|
+
property="padding"
|
|
109
|
+
renderDefaultControl={ renderTestDefaultControlComponent }
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
133
112
|
|
|
134
113
|
expect( container.innerHTML ).toBe( '' );
|
|
135
114
|
} );
|
|
136
115
|
|
|
137
116
|
it( 'should not render without valid property', () => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
container
|
|
145
|
-
);
|
|
146
|
-
} );
|
|
117
|
+
const { container } = render(
|
|
118
|
+
<ResponsiveBlockControl
|
|
119
|
+
title="Padding"
|
|
120
|
+
renderDefaultControl={ renderTestDefaultControlComponent }
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
147
123
|
|
|
148
124
|
expect( container.innerHTML ).toBe( '' );
|
|
149
125
|
} );
|
|
150
126
|
|
|
151
127
|
it( 'should not render without valid default control render prop', () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
container
|
|
156
|
-
);
|
|
157
|
-
} );
|
|
128
|
+
const { container } = render(
|
|
129
|
+
<ResponsiveBlockControl title="Padding" property="padding" />
|
|
130
|
+
);
|
|
158
131
|
|
|
159
132
|
expect( container.innerHTML ).toBe( '' );
|
|
160
133
|
} );
|
|
@@ -162,17 +135,14 @@ describe( 'Basic rendering', () => {
|
|
|
162
135
|
it( 'should render with custom label for toggle control when provided', () => {
|
|
163
136
|
const customToggleLabel =
|
|
164
137
|
'Utilise a matching padding value on all viewports';
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
container
|
|
174
|
-
);
|
|
175
|
-
} );
|
|
138
|
+
const { container } = render(
|
|
139
|
+
<ResponsiveBlockControl
|
|
140
|
+
title="Padding"
|
|
141
|
+
property="padding"
|
|
142
|
+
renderDefaultControl={ renderTestDefaultControlComponent }
|
|
143
|
+
toggleLabel={ customToggleLabel }
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
176
146
|
|
|
177
147
|
const actualToggleLabel = container.querySelector(
|
|
178
148
|
'label.components-toggle-control__label'
|
|
@@ -184,17 +154,14 @@ describe( 'Basic rendering', () => {
|
|
|
184
154
|
it( 'should pass custom label for default control group to the renderDefaultControl function when provided', () => {
|
|
185
155
|
const customDefaultControlGroupLabel = 'Everything';
|
|
186
156
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
container
|
|
196
|
-
);
|
|
197
|
-
} );
|
|
157
|
+
const { container } = render(
|
|
158
|
+
<ResponsiveBlockControl
|
|
159
|
+
title="Padding"
|
|
160
|
+
property="padding"
|
|
161
|
+
renderDefaultControl={ renderTestDefaultControlComponent }
|
|
162
|
+
defaultLabel={ customDefaultControlGroupLabel }
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
198
165
|
|
|
199
166
|
const defaultControlLabel = Array.from(
|
|
200
167
|
container.querySelectorAll( 'label' )
|
|
@@ -206,17 +173,14 @@ describe( 'Basic rendering', () => {
|
|
|
206
173
|
|
|
207
174
|
describe( 'Default and Responsive modes', () => {
|
|
208
175
|
it( 'should render in responsive mode when isResponsive prop is set to true', () => {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
container
|
|
218
|
-
);
|
|
219
|
-
} );
|
|
176
|
+
const { container } = render(
|
|
177
|
+
<ResponsiveBlockControl
|
|
178
|
+
title="Padding"
|
|
179
|
+
property="padding"
|
|
180
|
+
isResponsive={ true }
|
|
181
|
+
renderDefaultControl={ renderTestDefaultControlComponent }
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
220
184
|
|
|
221
185
|
const defaultControlGroup = container.querySelector(
|
|
222
186
|
'.block-editor-responsive-block-control__group:not(.is-responsive)'
|
|
@@ -253,18 +217,15 @@ describe( 'Default and Responsive modes', () => {
|
|
|
253
217
|
renderTestDefaultControlComponent
|
|
254
218
|
);
|
|
255
219
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
container
|
|
266
|
-
);
|
|
267
|
-
} );
|
|
220
|
+
const { container } = render(
|
|
221
|
+
<ResponsiveBlockControl
|
|
222
|
+
title="Padding"
|
|
223
|
+
property="padding"
|
|
224
|
+
isResponsive={ true }
|
|
225
|
+
renderDefaultControl={ mockRenderDefaultControl }
|
|
226
|
+
viewports={ customViewportSet }
|
|
227
|
+
/>
|
|
228
|
+
);
|
|
268
229
|
|
|
269
230
|
const defaultRenderControlCall = 1;
|
|
270
231
|
|
|
@@ -287,7 +248,10 @@ describe( 'Default and Responsive modes', () => {
|
|
|
287
248
|
);
|
|
288
249
|
} );
|
|
289
250
|
|
|
290
|
-
it( 'should switch between default and responsive modes when interacting with toggle control', () => {
|
|
251
|
+
it( 'should switch between default and responsive modes when interacting with toggle control', async () => {
|
|
252
|
+
const user = userEvent.setup( {
|
|
253
|
+
advanceTimers: jest.advanceTimersByTime,
|
|
254
|
+
} );
|
|
291
255
|
const ResponsiveBlockControlConsumer = () => {
|
|
292
256
|
const [ isResponsive, setIsResponsive ] = useState( false );
|
|
293
257
|
|
|
@@ -304,9 +268,7 @@ describe( 'Default and Responsive modes', () => {
|
|
|
304
268
|
);
|
|
305
269
|
};
|
|
306
270
|
|
|
307
|
-
|
|
308
|
-
render( <ResponsiveBlockControlConsumer />, container );
|
|
309
|
-
} );
|
|
271
|
+
const { container } = render( <ResponsiveBlockControlConsumer /> );
|
|
310
272
|
|
|
311
273
|
let defaultControlGroup = container.querySelector(
|
|
312
274
|
'.block-editor-responsive-block-control__group:not(.is-responsive)'
|
|
@@ -332,9 +294,7 @@ describe( 'Default and Responsive modes', () => {
|
|
|
332
294
|
expect( responsiveControlGroup ).toBeNull();
|
|
333
295
|
|
|
334
296
|
// Toggle to "responsive" mode.
|
|
335
|
-
|
|
336
|
-
Simulate.change( toggleInput, { target: { checked: false } } );
|
|
337
|
-
} );
|
|
297
|
+
await user.click( toggleInput );
|
|
338
298
|
|
|
339
299
|
defaultControlGroup = container.querySelector(
|
|
340
300
|
'.block-editor-responsive-block-control__group:not(.is-responsive)'
|
|
@@ -347,9 +307,7 @@ describe( 'Default and Responsive modes', () => {
|
|
|
347
307
|
expect( responsiveControlGroup ).not.toBeNull();
|
|
348
308
|
|
|
349
309
|
// Toggle back to "default" mode.
|
|
350
|
-
|
|
351
|
-
Simulate.change( toggleInput, { target: { checked: true } } );
|
|
352
|
-
} );
|
|
310
|
+
await user.click( toggleInput );
|
|
353
311
|
|
|
354
312
|
defaultControlGroup = container.querySelector(
|
|
355
313
|
'.block-editor-responsive-block-control__group:not(.is-responsive)'
|
|
@@ -382,18 +340,15 @@ describe( 'Default and Responsive modes', () => {
|
|
|
382
340
|
} );
|
|
383
341
|
} );
|
|
384
342
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
container
|
|
395
|
-
);
|
|
396
|
-
} );
|
|
343
|
+
const { container } = render(
|
|
344
|
+
<ResponsiveBlockControl
|
|
345
|
+
title="Padding"
|
|
346
|
+
property="padding"
|
|
347
|
+
isResponsive={ true }
|
|
348
|
+
renderDefaultControl={ spyRenderDefaultControl }
|
|
349
|
+
renderResponsiveControls={ mockRenderResponsiveControls }
|
|
350
|
+
/>
|
|
351
|
+
);
|
|
397
352
|
|
|
398
353
|
// The user should see "range" controls so we can legitimately query for them here.
|
|
399
354
|
const customControls = Array.from(
|
|
@@ -159,6 +159,8 @@ function RichTextWrapper(
|
|
|
159
159
|
// retreived from the store on merge.
|
|
160
160
|
// To do: fix this somehow.
|
|
161
161
|
const { selectionStart, selectionEnd, isSelected } = useSelect( selector );
|
|
162
|
+
const { getSelectionStart, getSelectionEnd, getBlockRootClientId } =
|
|
163
|
+
useSelect( blockEditorStore );
|
|
162
164
|
const { selectionChange } = useDispatch( blockEditorStore );
|
|
163
165
|
const multilineTag = getMultilineTag( multiline );
|
|
164
166
|
const adjustedAllowedFormats = getAllowedFormats( {
|
|
@@ -195,6 +197,18 @@ function RichTextWrapper(
|
|
|
195
197
|
const unset = start === undefined && end === undefined;
|
|
196
198
|
|
|
197
199
|
if ( typeof start === 'number' || unset ) {
|
|
200
|
+
// If we are only setting the start (or the end below), which
|
|
201
|
+
// means a partial selection, and we're not updating a selection
|
|
202
|
+
// with the same client ID, abort. This means the selected block
|
|
203
|
+
// is a parent block.
|
|
204
|
+
if (
|
|
205
|
+
end === undefined &&
|
|
206
|
+
getBlockRootClientId( clientId ) !==
|
|
207
|
+
getBlockRootClientId( getSelectionEnd().clientId )
|
|
208
|
+
) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
198
212
|
selection.start = {
|
|
199
213
|
clientId,
|
|
200
214
|
attributeKey: identifier,
|
|
@@ -203,6 +217,14 @@ function RichTextWrapper(
|
|
|
203
217
|
}
|
|
204
218
|
|
|
205
219
|
if ( typeof end === 'number' || unset ) {
|
|
220
|
+
if (
|
|
221
|
+
start === undefined &&
|
|
222
|
+
getBlockRootClientId( clientId ) !==
|
|
223
|
+
getBlockRootClientId( getSelectionStart().clientId )
|
|
224
|
+
) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
206
228
|
selection.end = {
|
|
207
229
|
clientId,
|
|
208
230
|
attributeKey: identifier,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { useState } from '@wordpress/element';
|
|
5
10
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import {
|
|
11
|
+
import { BaseControl } from '@wordpress/components';
|
|
7
12
|
|
|
8
13
|
/**
|
|
9
14
|
* Internal dependencies
|
|
@@ -68,8 +73,15 @@ export default function SpacingSizesControl( {
|
|
|
68
73
|
};
|
|
69
74
|
|
|
70
75
|
return (
|
|
71
|
-
<fieldset
|
|
72
|
-
|
|
76
|
+
<fieldset
|
|
77
|
+
role="region"
|
|
78
|
+
className={ classnames( 'component-spacing-sizes-control', {
|
|
79
|
+
'is-unlinked': ! isLinked,
|
|
80
|
+
} ) }
|
|
81
|
+
>
|
|
82
|
+
<BaseControl.VisualLabel as="legend">
|
|
83
|
+
{ label }
|
|
84
|
+
</BaseControl.VisualLabel>
|
|
73
85
|
{ ! hasOneSide && (
|
|
74
86
|
<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />
|
|
75
87
|
) }
|
|
@@ -9,12 +9,12 @@ import classnames from 'classnames';
|
|
|
9
9
|
import { useState, useMemo } from '@wordpress/element';
|
|
10
10
|
import { useSelect } from '@wordpress/data';
|
|
11
11
|
import {
|
|
12
|
+
BaseControl,
|
|
12
13
|
Button,
|
|
13
14
|
RangeControl,
|
|
14
15
|
CustomSelectControl,
|
|
15
16
|
__experimentalUnitControl as UnitControl,
|
|
16
17
|
__experimentalHStack as HStack,
|
|
17
|
-
__experimentalText as Text,
|
|
18
18
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
19
19
|
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
20
20
|
} from '@wordpress/components';
|
|
@@ -167,21 +167,21 @@ export default function SpacingInputControl( {
|
|
|
167
167
|
<>
|
|
168
168
|
{ side !== 'all' && (
|
|
169
169
|
<HStack className="components-spacing-sizes-control__side-labels">
|
|
170
|
-
<
|
|
170
|
+
<BaseControl.VisualLabel className="components-spacing-sizes-control__side-label">
|
|
171
171
|
{ LABELS[ side ] }
|
|
172
|
-
</
|
|
172
|
+
</BaseControl.VisualLabel>
|
|
173
173
|
|
|
174
174
|
{ showHint && (
|
|
175
|
-
<
|
|
175
|
+
<BaseControl.VisualLabel className="components-spacing-sizes-control__hint-single">
|
|
176
176
|
{ currentValueHint }
|
|
177
|
-
</
|
|
177
|
+
</BaseControl.VisualLabel>
|
|
178
178
|
) }
|
|
179
179
|
</HStack>
|
|
180
180
|
) }
|
|
181
181
|
{ side === 'all' && showHint && (
|
|
182
|
-
<
|
|
182
|
+
<BaseControl.VisualLabel className="components-spacing-sizes-control__hint-all">
|
|
183
183
|
{ currentValueHint }
|
|
184
|
-
</
|
|
184
|
+
</BaseControl.VisualLabel>
|
|
185
185
|
) }
|
|
186
186
|
|
|
187
187
|
{ ! disableCustomSpacingSizes && (
|
|
@@ -256,6 +256,7 @@ export default function SpacingInputControl( {
|
|
|
256
256
|
marks={ marks }
|
|
257
257
|
label={ ariaLabel }
|
|
258
258
|
hideLabelFromVision={ true }
|
|
259
|
+
__nextHasNoMarginBottom={ true }
|
|
259
260
|
/>
|
|
260
261
|
) }
|
|
261
262
|
{ ! showRangeControl && ! showCustomValueControl && (
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
.tools-panel-item-spacing {
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: auto 1fr auto;
|
|
4
|
-
|
|
4
|
+
align-items: center;
|
|
5
|
+
grid-template-rows: 25px auto;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.component-spacing-sizes-control {
|
|
@@ -17,21 +18,34 @@
|
|
|
17
18
|
align-self: center;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
.components-base-control__label {
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
height: $grid-unit-20;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
.components-spacing-sizes-control__side-labels {
|
|
21
27
|
grid-column: 1 / 1;
|
|
22
|
-
min-height: 30px;
|
|
23
28
|
justify-content: left;
|
|
29
|
+
height: $grid-unit-20;
|
|
30
|
+
margin-top: $grid-unit-15;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.components-spacing-sizes-control__side-label {
|
|
34
|
+
grid-column: 1 / 1;
|
|
35
|
+
justify-self: left;
|
|
36
|
+
margin-bottom: 0;
|
|
24
37
|
}
|
|
25
38
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
&.is-unlinked {
|
|
40
|
+
.components-range-control.components-spacing-sizes-control__range-control {
|
|
41
|
+
margin-top: $grid-unit-15;
|
|
42
|
+
}
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
.components-spacing-sizes-control__hint-single,
|
|
32
46
|
.components-spacing-sizes-control__hint-all {
|
|
33
47
|
color: $gray-700;
|
|
34
|
-
|
|
48
|
+
margin-bottom: 0;
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
.components-spacing-sizes-control__hint-all {
|
|
@@ -47,6 +61,11 @@
|
|
|
47
61
|
grid-row: 1 / 1;
|
|
48
62
|
justify-self: end;
|
|
49
63
|
padding: 0;
|
|
64
|
+
&.is-small.has-icon {
|
|
65
|
+
padding: 0;
|
|
66
|
+
min-width: $icon-size;
|
|
67
|
+
height: $grid-unit-20;
|
|
68
|
+
}
|
|
50
69
|
}
|
|
51
70
|
|
|
52
71
|
.component-spacing-sizes-control__linked-button ~ .components-spacing-sizes-control__custom-toggle-all {
|
|
@@ -56,13 +75,11 @@
|
|
|
56
75
|
.components-spacing-sizes-control__custom-toggle-single {
|
|
57
76
|
grid-column: 3 / 3;
|
|
58
77
|
justify-self: end;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.components-spacing-sizes-control__custom-toggle-all,
|
|
62
|
-
.components-spacing-sizes-control__custom-toggle-single {
|
|
63
78
|
&.is-small.has-icon {
|
|
64
79
|
padding: 0;
|
|
65
80
|
min-width: $icon-size;
|
|
81
|
+
height: $grid-unit-20;
|
|
82
|
+
margin-top: $grid-unit-15;
|
|
66
83
|
}
|
|
67
84
|
}
|
|
68
85
|
|
|
@@ -75,7 +92,6 @@
|
|
|
75
92
|
.components-spacing-sizes-control__custom-value-range {
|
|
76
93
|
grid-column: span 2;
|
|
77
94
|
margin-left: $grid-unit-10;
|
|
78
|
-
padding-right: $grid-unit-10;
|
|
79
95
|
height: 30px;
|
|
80
96
|
}
|
|
81
97
|
|
|
@@ -85,12 +101,7 @@
|
|
|
85
101
|
|
|
86
102
|
.components-spacing-sizes-control__range-control {
|
|
87
103
|
grid-column: span 3;
|
|
88
|
-
|
|
89
|
-
height: 30px;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.components-range-control__wrapper {
|
|
93
|
-
margin-bottom: 0;
|
|
104
|
+
height: 40px;
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
.components-range-control__mark {
|
|
@@ -112,13 +123,6 @@
|
|
|
112
123
|
z-index: 3;
|
|
113
124
|
}
|
|
114
125
|
|
|
115
|
-
.components-spacing-sizes-control__side-label {
|
|
116
|
-
margin-right: $grid-unit-05;
|
|
117
|
-
grid-column: 1 / 1;
|
|
118
|
-
justify-self: left;
|
|
119
|
-
font-size: 12px;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
126
|
.components-spacing-sizes-control__custom-select-control {
|
|
123
127
|
grid-column: span 3;
|
|
124
128
|
}
|
package/src/store/reducer.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
flow,
|
|
6
5
|
reduce,
|
|
7
6
|
omit,
|
|
8
7
|
without,
|
|
@@ -15,6 +14,7 @@ import {
|
|
|
15
14
|
/**
|
|
16
15
|
* WordPress dependencies
|
|
17
16
|
*/
|
|
17
|
+
import { pipe } from '@wordpress/compose';
|
|
18
18
|
import { combineReducers, select } from '@wordpress/data';
|
|
19
19
|
import { store as blocksStore } from '@wordpress/blocks';
|
|
20
20
|
/**
|
|
@@ -789,7 +789,7 @@ const withResetControlledBlocks = ( reducer ) => ( state, action ) => {
|
|
|
789
789
|
*
|
|
790
790
|
* @return {Object} Updated state.
|
|
791
791
|
*/
|
|
792
|
-
export const blocks =
|
|
792
|
+
export const blocks = pipe(
|
|
793
793
|
combineReducers,
|
|
794
794
|
withSaveReusableBlock, // Needs to be before withBlockCache.
|
|
795
795
|
withBlockTree, // Needs to be before withInnerBlocksRemoveCascade.
|
|
@@ -1055,7 +1055,7 @@ export const blocks = flow(
|
|
|
1055
1055
|
|
|
1056
1056
|
const mappedBlocks = mapBlockOrder( action.blocks );
|
|
1057
1057
|
|
|
1058
|
-
return
|
|
1058
|
+
return pipe( [
|
|
1059
1059
|
( nextState ) =>
|
|
1060
1060
|
omit( nextState, action.replacedClientIds ),
|
|
1061
1061
|
( nextState ) => ( {
|
|
@@ -1089,7 +1089,7 @@ export const blocks = flow(
|
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
1091
|
case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
|
|
1092
|
-
return
|
|
1092
|
+
return pipe( [
|
|
1093
1093
|
// Remove inner block ordering for removed blocks.
|
|
1094
1094
|
( nextState ) => omit( nextState, action.removedClientIds ),
|
|
1095
1095
|
|