@wordpress/block-editor 13.0.3 → 13.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 +21 -17
- package/README.md +1 -1
- package/build/components/block-lock/modal.js +67 -67
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mover/index.js +12 -6
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +185 -127
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +18 -10
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +97 -0
- package/build/components/grid/grid-item-movers.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
- package/build/components/grid/grid-item-resizer.js.map +1 -0
- package/build/components/grid/grid-visualizer.js +225 -0
- package/build/components/grid/grid-visualizer.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/index.js +14 -0
- package/build/components/grid/index.js.map +1 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build/components/grid/use-grid-layout-sync.js +162 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build/components/grid/utils.js +145 -0
- package/build/components/grid/utils.js.map +1 -0
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/link-control/link-preview.js +12 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -7
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/index.native.js +14 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +20 -4
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/layout-child.js +29 -21
- package/build/hooks/layout-child.js.map +1 -1
- package/build/layouts/grid.js +24 -47
- package/build/layouts/grid.js.map +1 -1
- package/build/store/private-actions.js +0 -34
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/block-lock/modal.js +67 -67
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mover/index.js +12 -6
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +185 -127
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +19 -11
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +90 -0
- package/build-module/components/grid/grid-item-movers.js.map +1 -0
- package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
- package/build-module/components/grid/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid/grid-visualizer.js +217 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -0
- package/build-module/components/grid/index.js +5 -0
- package/build-module/components/grid/index.js.map +1 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js +155 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build-module/components/grid/utils.js +131 -0
- package/build-module/components/grid/utils.js.map +1 -0
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +14 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -7
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +15 -5
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +20 -4
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +2 -2
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/layout-child.js +27 -19
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/layouts/grid.js +24 -47
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/store/private-actions.js +0 -33
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +38 -16
- package/build-style/style.css +38 -16
- package/package.json +31 -31
- package/src/components/block-lock/modal.js +95 -82
- package/src/components/block-lock/style.scss +11 -1
- package/src/components/block-mover/index.js +37 -24
- package/src/components/child-layout-control/index.js +224 -159
- package/src/components/date-format-picker/index.js +25 -13
- package/src/components/grid/grid-item-movers.js +128 -0
- package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +14 -52
- package/src/components/grid/grid-visualizer.js +267 -0
- package/src/components/grid/index.js +4 -0
- package/src/components/grid/style.scss +63 -0
- package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
- package/src/components/grid/use-grid-layout-sync.js +167 -0
- package/src/components/grid/utils.js +178 -0
- package/src/components/inner-blocks/index.js +3 -1
- package/src/components/inserter/block-types-tab.native.js +2 -1
- package/src/components/link-control/link-preview.js +18 -1
- package/src/components/provider/use-block-sync.js +0 -6
- package/src/components/rich-text/event-listeners/input-rules.js +1 -1
- package/src/components/rich-text/index.native.js +14 -8
- package/src/components/rich-text/native/index.native.js +20 -1
- package/src/hooks/block-style-variation.js +2 -2
- package/src/hooks/layout-child.js +34 -14
- package/src/layouts/grid.js +54 -62
- package/src/store/private-actions.js +0 -29
- package/src/style.scss +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build/components/grid-visualizer/grid-visualizer.js +0 -92
- package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build/components/grid-visualizer/index.js.map +0 -1
- package/build/components/grid-visualizer/utils.js +0 -10
- package/build/components/grid-visualizer/utils.js.map +0 -1
- package/build/store/undo-ignore.js +0 -11
- package/build/store/undo-ignore.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build-module/components/grid-visualizer/index.js +0 -3
- package/build-module/components/grid-visualizer/index.js.map +0 -1
- package/build-module/components/grid-visualizer/utils.js +0 -4
- package/build-module/components/grid-visualizer/utils.js.map +0 -1
- package/build-module/store/undo-ignore.js +0 -5
- package/build-module/store/undo-ignore.js.map +0 -1
- package/src/components/grid-visualizer/grid-visualizer.js +0 -101
- package/src/components/grid-visualizer/index.js +0 -2
- package/src/components/grid-visualizer/style.scss +0 -34
- package/src/components/grid-visualizer/utils.js +0 -5
- package/src/store/undo-ignore.js +0 -4
- /package/src/components/font-sizes/{README.MD → README.md} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,35 +36,35 @@
|
|
|
36
36
|
"@emotion/react": "^11.7.1",
|
|
37
37
|
"@emotion/styled": "^11.6.0",
|
|
38
38
|
"@react-spring/web": "^9.4.5",
|
|
39
|
-
"@wordpress/a11y": "^4.0
|
|
40
|
-
"@wordpress/api-fetch": "^7.0
|
|
41
|
-
"@wordpress/blob": "^4.0
|
|
42
|
-
"@wordpress/blocks": "^13.0
|
|
43
|
-
"@wordpress/commands": "^1.0
|
|
44
|
-
"@wordpress/components": "^28.0
|
|
45
|
-
"@wordpress/compose": "^7.0
|
|
46
|
-
"@wordpress/data": "^10.0
|
|
47
|
-
"@wordpress/date": "^5.0
|
|
48
|
-
"@wordpress/deprecated": "^4.0
|
|
49
|
-
"@wordpress/dom": "^4.0
|
|
50
|
-
"@wordpress/element": "^6.0
|
|
51
|
-
"@wordpress/escape-html": "^3.0
|
|
52
|
-
"@wordpress/hooks": "^4.0
|
|
53
|
-
"@wordpress/html-entities": "^4.0
|
|
54
|
-
"@wordpress/i18n": "^5.0
|
|
55
|
-
"@wordpress/icons": "^10.0
|
|
56
|
-
"@wordpress/is-shallow-equal": "^5.0
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.0
|
|
58
|
-
"@wordpress/keycodes": "^4.0
|
|
59
|
-
"@wordpress/notices": "^5.0
|
|
60
|
-
"@wordpress/preferences": "^4.0
|
|
61
|
-
"@wordpress/private-apis": "^1.0
|
|
62
|
-
"@wordpress/rich-text": "^7.0
|
|
63
|
-
"@wordpress/style-engine": "^2.0
|
|
64
|
-
"@wordpress/token-list": "^3.0
|
|
65
|
-
"@wordpress/url": "^4.0
|
|
66
|
-
"@wordpress/warning": "^3.0
|
|
67
|
-
"@wordpress/wordcount": "^4.0
|
|
39
|
+
"@wordpress/a11y": "^4.2.0",
|
|
40
|
+
"@wordpress/api-fetch": "^7.2.0",
|
|
41
|
+
"@wordpress/blob": "^4.2.0",
|
|
42
|
+
"@wordpress/blocks": "^13.2.0",
|
|
43
|
+
"@wordpress/commands": "^1.2.0",
|
|
44
|
+
"@wordpress/components": "^28.2.0",
|
|
45
|
+
"@wordpress/compose": "^7.2.0",
|
|
46
|
+
"@wordpress/data": "^10.2.0",
|
|
47
|
+
"@wordpress/date": "^5.2.0",
|
|
48
|
+
"@wordpress/deprecated": "^4.2.0",
|
|
49
|
+
"@wordpress/dom": "^4.2.0",
|
|
50
|
+
"@wordpress/element": "^6.2.0",
|
|
51
|
+
"@wordpress/escape-html": "^3.2.0",
|
|
52
|
+
"@wordpress/hooks": "^4.2.0",
|
|
53
|
+
"@wordpress/html-entities": "^4.2.0",
|
|
54
|
+
"@wordpress/i18n": "^5.2.0",
|
|
55
|
+
"@wordpress/icons": "^10.2.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^5.2.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.2.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.2.0",
|
|
59
|
+
"@wordpress/notices": "^5.2.0",
|
|
60
|
+
"@wordpress/preferences": "^4.2.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.2.0",
|
|
62
|
+
"@wordpress/rich-text": "^7.2.0",
|
|
63
|
+
"@wordpress/style-engine": "^2.2.0",
|
|
64
|
+
"@wordpress/token-list": "^3.2.0",
|
|
65
|
+
"@wordpress/url": "^4.2.0",
|
|
66
|
+
"@wordpress/warning": "^3.2.0",
|
|
67
|
+
"@wordpress/wordcount": "^4.2.0",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"clsx": "^2.1.1",
|
|
70
70
|
"colord": "^2.7.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
|
|
90
90
|
}
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
ToggleControl,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
|
|
16
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
17
16
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
18
17
|
import { getBlockType } from '@wordpress/blocks';
|
|
19
18
|
|
|
@@ -64,10 +63,6 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
64
63
|
);
|
|
65
64
|
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
66
65
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
67
|
-
const instanceId = useInstanceId(
|
|
68
|
-
BlockLockModal,
|
|
69
|
-
'block-editor-block-lock-modal__options-title'
|
|
70
|
-
);
|
|
71
66
|
|
|
72
67
|
useEffect( () => {
|
|
73
68
|
setLock( {
|
|
@@ -90,11 +85,6 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
90
85
|
overlayClassName="block-editor-block-lock-modal"
|
|
91
86
|
onRequestClose={ onClose }
|
|
92
87
|
>
|
|
93
|
-
<p>
|
|
94
|
-
{ __(
|
|
95
|
-
'Choose specific attributes to restrict or lock all available options.'
|
|
96
|
-
) }
|
|
97
|
-
</p>
|
|
98
88
|
<form
|
|
99
89
|
onSubmit={ ( event ) => {
|
|
100
90
|
event.preventDefault();
|
|
@@ -107,84 +97,107 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
107
97
|
onClose();
|
|
108
98
|
} }
|
|
109
99
|
>
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
>
|
|
115
|
-
<CheckboxControl
|
|
116
|
-
__nextHasNoMarginBottom
|
|
117
|
-
className="block-editor-block-lock-modal__options-title"
|
|
118
|
-
label={
|
|
119
|
-
<span id={ instanceId }>{ __( 'Lock all' ) }</span>
|
|
120
|
-
}
|
|
121
|
-
checked={ isAllChecked }
|
|
122
|
-
indeterminate={ isMixed }
|
|
123
|
-
onChange={ ( newValue ) =>
|
|
124
|
-
setLock( {
|
|
125
|
-
move: newValue,
|
|
126
|
-
remove: newValue,
|
|
127
|
-
...( allowsEditLocking
|
|
128
|
-
? { edit: newValue }
|
|
129
|
-
: {} ),
|
|
130
|
-
} )
|
|
131
|
-
}
|
|
132
|
-
/>
|
|
133
|
-
<ul className="block-editor-block-lock-modal__checklist">
|
|
134
|
-
{ allowsEditLocking && (
|
|
135
|
-
<li className="block-editor-block-lock-modal__checklist-item">
|
|
136
|
-
<CheckboxControl
|
|
137
|
-
__nextHasNoMarginBottom
|
|
138
|
-
label={ __( 'Restrict editing' ) }
|
|
139
|
-
checked={ !! lock.edit }
|
|
140
|
-
onChange={ ( edit ) =>
|
|
141
|
-
setLock( ( prevLock ) => ( {
|
|
142
|
-
...prevLock,
|
|
143
|
-
edit,
|
|
144
|
-
} ) )
|
|
145
|
-
}
|
|
146
|
-
/>
|
|
147
|
-
<Icon
|
|
148
|
-
className="block-editor-block-lock-modal__lock-icon"
|
|
149
|
-
icon={ lock.edit ? lockIcon : unlockIcon }
|
|
150
|
-
/>
|
|
151
|
-
</li>
|
|
100
|
+
<fieldset className="block-editor-block-lock-modal__options">
|
|
101
|
+
<legend>
|
|
102
|
+
{ __(
|
|
103
|
+
'Choose specific attributes to restrict or lock all available options.'
|
|
152
104
|
) }
|
|
153
|
-
|
|
105
|
+
</legend>
|
|
106
|
+
{ /*
|
|
107
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
108
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
109
|
+
*/
|
|
110
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */ }
|
|
111
|
+
<ul
|
|
112
|
+
role="list"
|
|
113
|
+
className="block-editor-block-lock-modal__checklist"
|
|
114
|
+
>
|
|
115
|
+
<li>
|
|
154
116
|
<CheckboxControl
|
|
155
117
|
__nextHasNoMarginBottom
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
118
|
+
className="block-editor-block-lock-modal__options-all"
|
|
119
|
+
label={ __( 'Lock all' ) }
|
|
120
|
+
checked={ isAllChecked }
|
|
121
|
+
indeterminate={ isMixed }
|
|
122
|
+
onChange={ ( newValue ) =>
|
|
123
|
+
setLock( {
|
|
124
|
+
move: newValue,
|
|
125
|
+
remove: newValue,
|
|
126
|
+
...( allowsEditLocking
|
|
127
|
+
? { edit: newValue }
|
|
128
|
+
: {} ),
|
|
129
|
+
} )
|
|
163
130
|
}
|
|
164
131
|
/>
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
132
|
+
<ul
|
|
133
|
+
role="list"
|
|
134
|
+
className="block-editor-block-lock-modal__checklist"
|
|
135
|
+
>
|
|
136
|
+
{ allowsEditLocking && (
|
|
137
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
138
|
+
<CheckboxControl
|
|
139
|
+
__nextHasNoMarginBottom
|
|
140
|
+
label={ __( 'Restrict editing' ) }
|
|
141
|
+
checked={ !! lock.edit }
|
|
142
|
+
onChange={ ( edit ) =>
|
|
143
|
+
setLock( ( prevLock ) => ( {
|
|
144
|
+
...prevLock,
|
|
145
|
+
edit,
|
|
146
|
+
} ) )
|
|
147
|
+
}
|
|
148
|
+
/>
|
|
149
|
+
<Icon
|
|
150
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
151
|
+
icon={
|
|
152
|
+
lock.edit
|
|
153
|
+
? lockIcon
|
|
154
|
+
: unlockIcon
|
|
155
|
+
}
|
|
156
|
+
/>
|
|
157
|
+
</li>
|
|
158
|
+
) }
|
|
159
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
160
|
+
<CheckboxControl
|
|
161
|
+
__nextHasNoMarginBottom
|
|
162
|
+
label={ __( 'Disable movement' ) }
|
|
163
|
+
checked={ lock.move }
|
|
164
|
+
onChange={ ( move ) =>
|
|
165
|
+
setLock( ( prevLock ) => ( {
|
|
166
|
+
...prevLock,
|
|
167
|
+
move,
|
|
168
|
+
} ) )
|
|
169
|
+
}
|
|
170
|
+
/>
|
|
171
|
+
<Icon
|
|
172
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
173
|
+
icon={
|
|
174
|
+
lock.move ? lockIcon : unlockIcon
|
|
175
|
+
}
|
|
176
|
+
/>
|
|
177
|
+
</li>
|
|
178
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
179
|
+
<CheckboxControl
|
|
180
|
+
__nextHasNoMarginBottom
|
|
181
|
+
label={ __( 'Prevent removal' ) }
|
|
182
|
+
checked={ lock.remove }
|
|
183
|
+
onChange={ ( remove ) =>
|
|
184
|
+
setLock( ( prevLock ) => ( {
|
|
185
|
+
...prevLock,
|
|
186
|
+
remove,
|
|
187
|
+
} ) )
|
|
188
|
+
}
|
|
189
|
+
/>
|
|
190
|
+
<Icon
|
|
191
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
192
|
+
icon={
|
|
193
|
+
lock.remove ? lockIcon : unlockIcon
|
|
194
|
+
}
|
|
195
|
+
/>
|
|
196
|
+
</li>
|
|
197
|
+
</ul>
|
|
186
198
|
</li>
|
|
187
199
|
</ul>
|
|
200
|
+
{ /* eslint-enable jsx-a11y/no-redundant-roles */ }
|
|
188
201
|
{ hasTemplateLock && (
|
|
189
202
|
<ToggleControl
|
|
190
203
|
__nextHasNoMarginBottom
|
|
@@ -197,7 +210,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
197
210
|
}
|
|
198
211
|
/>
|
|
199
212
|
) }
|
|
200
|
-
</
|
|
213
|
+
</fieldset>
|
|
201
214
|
<Flex
|
|
202
215
|
className="block-editor-block-lock-modal__actions"
|
|
203
216
|
justify="flex-end"
|
|
@@ -8,17 +8,27 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.block-editor-block-lock-modal__options {
|
|
12
|
+
margin-top: $grid-unit-20;
|
|
13
|
+
|
|
14
|
+
legend {
|
|
15
|
+
margin-bottom: $grid-unit-20;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
.block-editor-block-lock-modal__checklist {
|
|
12
21
|
margin: 0;
|
|
13
22
|
}
|
|
14
23
|
|
|
15
|
-
.block-editor-block-lock-modal__options-
|
|
24
|
+
.block-editor-block-lock-modal__options-all {
|
|
16
25
|
padding: $grid-unit-15 0;
|
|
17
26
|
|
|
18
27
|
.components-checkbox-control__label {
|
|
19
28
|
font-weight: 600;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
31
|
+
|
|
22
32
|
.block-editor-block-lock-modal__checklist-item {
|
|
23
33
|
display: flex;
|
|
24
34
|
justify-content: space-between;
|
|
@@ -25,7 +25,14 @@ function BlockMover( {
|
|
|
25
25
|
isBlockMoverUpButtonDisabled,
|
|
26
26
|
isBlockMoverDownButtonDisabled,
|
|
27
27
|
} ) {
|
|
28
|
-
const {
|
|
28
|
+
const {
|
|
29
|
+
canMove,
|
|
30
|
+
rootClientId,
|
|
31
|
+
isFirst,
|
|
32
|
+
isLast,
|
|
33
|
+
orientation,
|
|
34
|
+
isManualGrid,
|
|
35
|
+
} = useSelect(
|
|
29
36
|
( select ) => {
|
|
30
37
|
const {
|
|
31
38
|
getBlockIndex,
|
|
@@ -33,6 +40,7 @@ function BlockMover( {
|
|
|
33
40
|
canMoveBlocks,
|
|
34
41
|
getBlockOrder,
|
|
35
42
|
getBlockRootClientId,
|
|
43
|
+
getBlockAttributes,
|
|
36
44
|
} = select( blockEditorStore );
|
|
37
45
|
const normalizedClientIds = Array.isArray( clientIds )
|
|
38
46
|
? clientIds
|
|
@@ -44,6 +52,7 @@ function BlockMover( {
|
|
|
44
52
|
normalizedClientIds[ normalizedClientIds.length - 1 ]
|
|
45
53
|
);
|
|
46
54
|
const blockOrder = getBlockOrder( _rootClientId );
|
|
55
|
+
const { layout = {} } = getBlockAttributes( _rootClientId ) ?? {};
|
|
47
56
|
|
|
48
57
|
return {
|
|
49
58
|
canMove: canMoveBlocks( clientIds ),
|
|
@@ -51,6 +60,10 @@ function BlockMover( {
|
|
|
51
60
|
isFirst: firstIndex === 0,
|
|
52
61
|
isLast: lastIndex === blockOrder.length - 1,
|
|
53
62
|
orientation: getBlockListSettings( _rootClientId )?.orientation,
|
|
63
|
+
isManualGrid:
|
|
64
|
+
layout.type === 'grid' &&
|
|
65
|
+
!! layout.columnCount &&
|
|
66
|
+
window.__experimentalEnableGridInteractivity,
|
|
54
67
|
};
|
|
55
68
|
},
|
|
56
69
|
[ clientIds ]
|
|
@@ -60,8 +73,6 @@ function BlockMover( {
|
|
|
60
73
|
return null;
|
|
61
74
|
}
|
|
62
75
|
|
|
63
|
-
const dragHandleLabel = __( 'Drag' );
|
|
64
|
-
|
|
65
76
|
return (
|
|
66
77
|
<ToolbarGroup
|
|
67
78
|
className={ clsx( 'block-editor-block-mover', {
|
|
@@ -75,7 +86,7 @@ function BlockMover( {
|
|
|
75
86
|
icon={ dragHandle }
|
|
76
87
|
className="block-editor-block-mover__drag-handle"
|
|
77
88
|
aria-hidden="true"
|
|
78
|
-
label={
|
|
89
|
+
label={ __( 'Drag' ) }
|
|
79
90
|
// Should not be able to tab to drag handle as this
|
|
80
91
|
// button can only be used with a pointer device.
|
|
81
92
|
tabIndex="-1"
|
|
@@ -84,26 +95,28 @@ function BlockMover( {
|
|
|
84
95
|
) }
|
|
85
96
|
</BlockDraggable>
|
|
86
97
|
) }
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
{ ! isManualGrid && (
|
|
99
|
+
<div className="block-editor-block-mover__move-button-container">
|
|
100
|
+
<ToolbarItem>
|
|
101
|
+
{ ( itemProps ) => (
|
|
102
|
+
<BlockMoverUpButton
|
|
103
|
+
disabled={ isBlockMoverUpButtonDisabled }
|
|
104
|
+
clientIds={ clientIds }
|
|
105
|
+
{ ...itemProps }
|
|
106
|
+
/>
|
|
107
|
+
) }
|
|
108
|
+
</ToolbarItem>
|
|
109
|
+
<ToolbarItem>
|
|
110
|
+
{ ( itemProps ) => (
|
|
111
|
+
<BlockMoverDownButton
|
|
112
|
+
disabled={ isBlockMoverDownButtonDisabled }
|
|
113
|
+
clientIds={ clientIds }
|
|
114
|
+
{ ...itemProps }
|
|
115
|
+
/>
|
|
116
|
+
) }
|
|
117
|
+
</ToolbarItem>
|
|
118
|
+
</div>
|
|
119
|
+
) }
|
|
107
120
|
</ToolbarGroup>
|
|
108
121
|
);
|
|
109
122
|
}
|