@wordpress/block-library 9.15.1 → 9.16.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/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/columns/edit.js +1 -1
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/comment-template/edit.js +2 -2
- package/build/comment-template/edit.js.map +1 -1
- package/build/comments-pagination-next/index.js +7 -6
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +7 -6
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/cover/deprecated.js +1 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/details/edit.js +12 -17
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +3 -0
- package/build/details/index.js.map +1 -1
- package/build/embed/util.js +1 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.js +7 -4
- package/build/file/edit.js.map +1 -1
- package/build/file/transforms.js +1 -1
- package/build/file/transforms.js.map +1 -1
- package/build/file/utils/index.js +1 -1
- package/build/file/utils/index.js.map +1 -1
- package/build/form-input/edit.js +1 -1
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/transforms.js +2 -2
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-new-images.js +1 -1
- package/build/gallery/use-get-new-images.js.map +1 -1
- package/build/list-item/edit.native.js +2 -2
- package/build/list-item/edit.native.js.map +1 -1
- package/build/media-text/edit.native.js +2 -2
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +4 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js +8 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +15 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +9 -18
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/index.js +11 -0
- package/build/page-list/index.js.map +1 -1
- package/build/post-author-name/edit.js +41 -12
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-comments-link/index.js +7 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-featured-image/overlay-controls.js +2 -1
- package/build/post-featured-image/overlay-controls.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +1 -1
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +110 -61
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/query-title/edit.js +39 -14
- package/build/query-title/edit.js.map +1 -1
- package/build/query-total/index.js +7 -1
- package/build/query-total/index.js.map +1 -1
- package/build/quote/transforms.js +1 -1
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +1 -0
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +6 -0
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +2 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +26 -35
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/edit.js +2 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +24 -8
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/video/edit.native.js +3 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/button/edit.js +3 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/columns/edit.js +1 -1
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +1 -1
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/comment-template/edit.js +2 -2
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +7 -6
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +7 -6
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/cover/deprecated.js +1 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/details/edit.js +13 -18
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +3 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/embed/util.js +1 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.js +7 -4
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/transforms.js +1 -1
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/file/utils/index.js +1 -1
- package/build-module/file/utils/index.js.map +1 -1
- package/build-module/form-input/edit.js +1 -1
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/transforms.js +2 -2
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-new-images.js +1 -1
- package/build-module/gallery/use-get-new-images.js.map +1 -1
- package/build-module/list-item/edit.native.js +2 -2
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/media-text/edit.native.js +2 -2
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +4 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +8 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +15 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +9 -18
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/index.js +11 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +42 -13
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-comments-link/index.js +7 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-featured-image/overlay-controls.js +2 -1
- package/build-module/post-featured-image/overlay-controls.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +111 -62
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-title/edit.js +40 -15
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-total/index.js +7 -1
- package/build-module/query-total/index.js.map +1 -1
- package/build-module/quote/transforms.js +1 -1
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +1 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +6 -0
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +3 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +27 -36
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-links/edit.js +2 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +25 -9
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/video/edit.native.js +3 -3
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/editor-rtl.css +6 -43
- package/build-style/editor.css +6 -43
- package/build-style/freeform/editor-rtl.css +2 -4
- package/build-style/freeform/editor.css +2 -4
- package/build-style/gallery/editor-rtl.css +2 -4
- package/build-style/gallery/editor.css +2 -4
- package/build-style/image/style-rtl.css +24 -10
- package/build-style/image/style.css +24 -10
- package/build-style/navigation/style-rtl.css +8 -6
- package/build-style/navigation/style.css +8 -6
- package/build-style/query/editor-rtl.css +0 -27
- package/build-style/query/editor.css +0 -27
- package/build-style/site-logo/editor-rtl.css +2 -8
- package/build-style/site-logo/editor.css +2 -8
- package/build-style/social-links/style-rtl.css +2 -5
- package/build-style/social-links/style.css +2 -5
- package/build-style/style-rtl.css +34 -21
- package/build-style/style.css +34 -21
- package/package.json +35 -35
- package/src/audio/test/transforms.native.js +4 -3
- package/src/button/edit.js +6 -2
- package/src/columns/edit.js +1 -1
- package/src/columns/edit.native.js +1 -1
- package/src/comment-template/edit.js +2 -2
- package/src/comments-pagination-next/block.json +0 -5
- package/src/comments-pagination-next/index.js +6 -0
- package/src/comments-pagination-previous/block.json +0 -5
- package/src/comments-pagination-previous/index.js +6 -0
- package/src/cover/deprecated.js +1 -1
- package/src/cover/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/cover/test/edit.js +7 -7
- package/src/cover/test/edit.native.js +2 -2
- package/src/cover/test/transforms.native.js +9 -5
- package/src/details/block.json +3 -0
- package/src/details/edit.js +12 -23
- package/src/editor.scss +1 -1
- package/src/embed/test/index.js +1 -1
- package/src/embed/util.js +1 -1
- package/src/file/edit.js +4 -3
- package/src/file/test/transforms.native.js +4 -3
- package/src/file/transforms.js +1 -1
- package/src/file/utils/index.js +1 -1
- package/src/form-input/edit.js +1 -1
- package/src/freeform/editor.scss +4 -3
- package/src/gallery/edit.js +1 -1
- package/src/gallery/editor.scss +4 -2
- package/src/gallery/test/transforms.native.js +4 -3
- package/src/gallery/transforms.js +2 -2
- package/src/gallery/use-get-new-images.js +1 -1
- package/src/image/block.json +8 -1
- package/src/image/editor.scss +1 -1
- package/src/image/index.php +9 -13
- package/src/image/style.scss +17 -7
- package/src/image/test/edit.native.js +1 -1
- package/src/image/test/transforms.native.js +4 -3
- package/src/list/test/edit.native.js +1 -1
- package/src/list-item/edit.native.js +2 -2
- package/src/media-text/edit.native.js +2 -2
- package/src/media-text/media-container.native.js +4 -4
- package/src/media-text/test/transforms.native.js +9 -5
- package/src/navigation/edit/index.js +4 -0
- package/src/navigation/index.js +20 -0
- package/src/navigation/style.scss +7 -4
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-link/link-ui.js +7 -13
- package/src/navigation-submenu/edit.js +1 -1
- package/src/page-list/block.json +11 -0
- package/src/paragraph/style.scss +1 -1
- package/src/post-author-name/edit.js +53 -15
- package/src/post-comments-link/block.json +7 -1
- package/src/post-content/block.json +1 -1
- package/src/post-featured-image/overlay-controls.js +1 -0
- package/src/query/edit/inspector-controls/author-control.js +1 -1
- package/src/query/edit/inspector-controls/index.js +148 -88
- package/src/query/editor.scss +0 -31
- package/src/query/utils.js +1 -1
- package/src/query-title/edit.js +60 -19
- package/src/query-total/block.json +7 -1
- package/src/quote/transforms.js +1 -1
- package/src/rss/block.json +6 -0
- package/src/rss/edit.js +1 -0
- package/src/search/edit.js +6 -2
- package/src/separator/deprecated.scss +1 -1
- package/src/site-logo/edit.js +34 -47
- package/src/site-logo/editor.scss +3 -6
- package/src/social-link/index.php +2 -2
- package/src/social-links/edit.js +1 -0
- package/src/social-links/style.scss +3 -3
- package/src/table-of-contents/edit.js +38 -19
- package/src/video/edit.native.js +3 -3
- package/src/video/test/transforms.native.js +4 -3
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
PanelBody,
|
|
6
5
|
TextControl,
|
|
7
6
|
SelectControl,
|
|
8
7
|
RangeControl,
|
|
@@ -187,110 +186,171 @@ export default function QueryInspectorControls( props ) {
|
|
|
187
186
|
return (
|
|
188
187
|
<>
|
|
189
188
|
{ showSettingsPanel && (
|
|
190
|
-
<
|
|
189
|
+
<ToolsPanel
|
|
190
|
+
label={ __( 'Settings' ) }
|
|
191
|
+
resetAll={ () => {
|
|
192
|
+
setQuery( {
|
|
193
|
+
postType: 'post',
|
|
194
|
+
order: 'desc',
|
|
195
|
+
orderBy: 'date',
|
|
196
|
+
sticky: '',
|
|
197
|
+
inherit: true,
|
|
198
|
+
} );
|
|
199
|
+
} }
|
|
200
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
201
|
+
>
|
|
191
202
|
{ showInheritControl && (
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
__nextHasNoMarginBottom
|
|
203
|
+
<ToolsPanelItem
|
|
204
|
+
hasValue={ () => ! inherit }
|
|
195
205
|
label={ __( 'Query type' ) }
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
setQuery( { inherit: value === 'default' } );
|
|
199
|
-
} }
|
|
200
|
-
help={
|
|
201
|
-
inherit
|
|
202
|
-
? __(
|
|
203
|
-
'Display a list of posts or custom post types based on the current template.'
|
|
204
|
-
)
|
|
205
|
-
: __(
|
|
206
|
-
'Display a list of posts or custom post types based on specific criteria.'
|
|
207
|
-
)
|
|
208
|
-
}
|
|
209
|
-
value={ !! inherit ? 'default' : 'custom' }
|
|
206
|
+
onDeselect={ () => setQuery( { inherit: true } ) }
|
|
207
|
+
isShownByDefault
|
|
210
208
|
>
|
|
211
|
-
<ToggleGroupControlOption
|
|
212
|
-
value="default"
|
|
213
|
-
label={ __( 'Default' ) }
|
|
214
|
-
/>
|
|
215
|
-
<ToggleGroupControlOption
|
|
216
|
-
value="custom"
|
|
217
|
-
label={ __( 'Custom' ) }
|
|
218
|
-
/>
|
|
219
|
-
</ToggleGroupControl>
|
|
220
|
-
) }
|
|
221
|
-
{ showPostTypeControl &&
|
|
222
|
-
( postTypesSelectOptions.length > 2 ? (
|
|
223
|
-
<SelectControl
|
|
224
|
-
__nextHasNoMarginBottom
|
|
225
|
-
__next40pxDefaultSize
|
|
226
|
-
options={ postTypesSelectOptions }
|
|
227
|
-
value={ postType }
|
|
228
|
-
label={ postTypeControlLabel }
|
|
229
|
-
onChange={ onPostTypeChange }
|
|
230
|
-
help={ postTypeControlHelp }
|
|
231
|
-
/>
|
|
232
|
-
) : (
|
|
233
209
|
<ToggleGroupControl
|
|
234
|
-
__nextHasNoMarginBottom
|
|
235
210
|
__next40pxDefaultSize
|
|
211
|
+
__nextHasNoMarginBottom
|
|
212
|
+
label={ __( 'Query type' ) }
|
|
236
213
|
isBlock
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
214
|
+
onChange={ ( value ) => {
|
|
215
|
+
setQuery( {
|
|
216
|
+
inherit: value === 'default',
|
|
217
|
+
} );
|
|
218
|
+
} }
|
|
219
|
+
help={
|
|
220
|
+
inherit
|
|
221
|
+
? __(
|
|
222
|
+
'Display a list of posts or custom post types based on the current template.'
|
|
223
|
+
)
|
|
224
|
+
: __(
|
|
225
|
+
'Display a list of posts or custom post types based on specific criteria.'
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
value={ !! inherit ? 'default' : 'custom' }
|
|
241
229
|
>
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
230
|
+
<ToggleGroupControlOption
|
|
231
|
+
value="default"
|
|
232
|
+
label={ __( 'Default' ) }
|
|
233
|
+
/>
|
|
234
|
+
<ToggleGroupControlOption
|
|
235
|
+
value="custom"
|
|
236
|
+
label={ __( 'Custom' ) }
|
|
237
|
+
/>
|
|
249
238
|
</ToggleGroupControl>
|
|
250
|
-
|
|
239
|
+
</ToolsPanelItem>
|
|
240
|
+
) }
|
|
251
241
|
|
|
252
|
-
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
242
|
+
{ showPostTypeControl && (
|
|
243
|
+
<ToolsPanelItem
|
|
244
|
+
hasValue={ () => postType !== 'post' }
|
|
245
|
+
label={ postTypeControlLabel }
|
|
246
|
+
onDeselect={ () => onPostTypeChange( 'post' ) }
|
|
247
|
+
isShownByDefault
|
|
248
|
+
>
|
|
249
|
+
{ postTypesSelectOptions.length > 2 ? (
|
|
250
|
+
<SelectControl
|
|
251
|
+
__nextHasNoMarginBottom
|
|
252
|
+
__next40pxDefaultSize
|
|
253
|
+
options={ postTypesSelectOptions }
|
|
254
|
+
value={ postType }
|
|
255
|
+
label={ postTypeControlLabel }
|
|
256
|
+
onChange={ onPostTypeChange }
|
|
257
|
+
help={ postTypeControlHelp }
|
|
258
|
+
/>
|
|
259
|
+
) : (
|
|
260
|
+
<ToggleGroupControl
|
|
261
|
+
__nextHasNoMarginBottom
|
|
262
|
+
__next40pxDefaultSize
|
|
263
|
+
isBlock
|
|
264
|
+
value={ postType }
|
|
265
|
+
label={ postTypeControlLabel }
|
|
266
|
+
onChange={ onPostTypeChange }
|
|
267
|
+
help={ postTypeControlHelp }
|
|
271
268
|
>
|
|
272
|
-
{
|
|
273
|
-
|
|
269
|
+
{ postTypesSelectOptions.map(
|
|
270
|
+
( option ) => (
|
|
271
|
+
<ToggleGroupControlOption
|
|
272
|
+
key={ option.value }
|
|
273
|
+
value={ option.value }
|
|
274
|
+
label={ option.label }
|
|
275
|
+
/>
|
|
276
|
+
)
|
|
274
277
|
) }
|
|
275
|
-
</
|
|
278
|
+
</ToggleGroupControl>
|
|
276
279
|
) }
|
|
277
|
-
|
|
280
|
+
</ToolsPanelItem>
|
|
278
281
|
) }
|
|
282
|
+
|
|
283
|
+
{ showColumnsControl && (
|
|
284
|
+
<ToolsPanelItem
|
|
285
|
+
hasValue={ () => displayLayout?.columns !== 2 }
|
|
286
|
+
label={ __( 'Columns' ) }
|
|
287
|
+
onDeselect={ () =>
|
|
288
|
+
setDisplayLayout( { columns: 2 } )
|
|
289
|
+
}
|
|
290
|
+
isShownByDefault
|
|
291
|
+
>
|
|
292
|
+
<>
|
|
293
|
+
<RangeControl
|
|
294
|
+
__nextHasNoMarginBottom
|
|
295
|
+
__next40pxDefaultSize
|
|
296
|
+
label={ __( 'Columns' ) }
|
|
297
|
+
value={ displayLayout.columns }
|
|
298
|
+
onChange={ ( value ) =>
|
|
299
|
+
setDisplayLayout( {
|
|
300
|
+
columns: value,
|
|
301
|
+
} )
|
|
302
|
+
}
|
|
303
|
+
min={ 2 }
|
|
304
|
+
max={ Math.max( 6, displayLayout.columns ) }
|
|
305
|
+
/>
|
|
306
|
+
{ displayLayout.columns > 6 && (
|
|
307
|
+
<Notice
|
|
308
|
+
status="warning"
|
|
309
|
+
isDismissible={ false }
|
|
310
|
+
>
|
|
311
|
+
{ __(
|
|
312
|
+
'This column count exceeds the recommended amount and may cause visual breakage.'
|
|
313
|
+
) }
|
|
314
|
+
</Notice>
|
|
315
|
+
) }
|
|
316
|
+
</>
|
|
317
|
+
</ToolsPanelItem>
|
|
318
|
+
) }
|
|
319
|
+
|
|
279
320
|
{ showOrderControl && (
|
|
280
|
-
<
|
|
281
|
-
{
|
|
282
|
-
|
|
283
|
-
|
|
321
|
+
<ToolsPanelItem
|
|
322
|
+
hasValue={ () =>
|
|
323
|
+
order !== 'desc' || orderBy !== 'date'
|
|
324
|
+
}
|
|
325
|
+
label={ __( 'Order by' ) }
|
|
326
|
+
onDeselect={ () =>
|
|
327
|
+
setQuery( { order: 'desc', orderBy: 'date' } )
|
|
328
|
+
}
|
|
329
|
+
isShownByDefault
|
|
330
|
+
>
|
|
331
|
+
<OrderControl
|
|
332
|
+
{ ...{ order, orderBy } }
|
|
333
|
+
onChange={ setQuery }
|
|
334
|
+
/>
|
|
335
|
+
</ToolsPanelItem>
|
|
284
336
|
) }
|
|
337
|
+
|
|
285
338
|
{ showStickyControl && (
|
|
286
|
-
<
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
339
|
+
<ToolsPanelItem
|
|
340
|
+
hasValue={ () => !! sticky }
|
|
341
|
+
label={ __( 'Sticky posts' ) }
|
|
342
|
+
onDeselect={ () => setQuery( { sticky: '' } ) }
|
|
343
|
+
isShownByDefault
|
|
344
|
+
>
|
|
345
|
+
<StickyControl
|
|
346
|
+
value={ sticky }
|
|
347
|
+
onChange={ ( value ) =>
|
|
348
|
+
setQuery( { sticky: value } )
|
|
349
|
+
}
|
|
350
|
+
/>
|
|
351
|
+
</ToolsPanelItem>
|
|
292
352
|
) }
|
|
293
|
-
</
|
|
353
|
+
</ToolsPanel>
|
|
294
354
|
) }
|
|
295
355
|
{ ! inherit && showDisplayPanel && (
|
|
296
356
|
<ToolsPanel
|
package/src/query/editor.scss
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
.block-library-query-toolbar__popover .components-popover__content {
|
|
2
|
-
min-width: 230px;
|
|
3
|
-
|
|
4
|
-
.block-library-query-toolbar__popover-number-control {
|
|
5
|
-
margin-bottom: $grid-unit-10;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.block-library-query__pattern-selection-content .block-editor-block-patterns-list {
|
|
10
|
-
display: grid;
|
|
11
|
-
grid-template-columns: 1fr 1fr 1fr;
|
|
12
|
-
grid-gap: $grid-unit-10;
|
|
13
|
-
|
|
14
|
-
.block-editor-block-patterns-list__list-item {
|
|
15
|
-
margin-bottom: 0;
|
|
16
|
-
.block-editor-block-preview__container {
|
|
17
|
-
max-height: 250px;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
1
|
.block-library-query-pattern__selection-modal {
|
|
23
2
|
|
|
24
3
|
.block-editor-block-patterns-list {
|
|
@@ -45,22 +24,12 @@
|
|
|
45
24
|
}
|
|
46
25
|
}
|
|
47
26
|
|
|
48
|
-
.block-library-query-toolspanel__design {
|
|
49
|
-
.block-library-query-pattern__selection-content {
|
|
50
|
-
margin-top: $grid-unit-10;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
27
|
.wp-block-query__enhanced-pagination-modal {
|
|
55
28
|
@include break-small() {
|
|
56
29
|
max-width: $break-mobile;
|
|
57
30
|
}
|
|
58
31
|
}
|
|
59
32
|
|
|
60
|
-
.wp-block-query__enhanced-pagination-notice {
|
|
61
|
-
margin: 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
33
|
.block-editor-block-settings-menu__popover {
|
|
65
34
|
&.is-expanded {
|
|
66
35
|
overflow-y: scroll;
|
package/src/query/utils.js
CHANGED
|
@@ -81,7 +81,7 @@ export const getValueFromObjectPath = ( object, path ) => {
|
|
|
81
81
|
*
|
|
82
82
|
* @param {Object[]} entities The array of entities.
|
|
83
83
|
* @param {string} path The path to map a `name` property from the entity.
|
|
84
|
-
* @return {IHasNameAndId[]} An array of
|
|
84
|
+
* @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface.
|
|
85
85
|
*/
|
|
86
86
|
export const mapToIHasNameAndId = ( entities, path ) => {
|
|
87
87
|
return ( entities || [] ).map( ( entity ) => ( {
|
package/src/query-title/edit.js
CHANGED
|
@@ -14,13 +14,18 @@ import {
|
|
|
14
14
|
Warning,
|
|
15
15
|
HeadingLevelDropdown,
|
|
16
16
|
} from '@wordpress/block-editor';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
ToggleControl,
|
|
19
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
20
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
21
|
+
} from '@wordpress/components';
|
|
18
22
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* Internal dependencies
|
|
22
26
|
*/
|
|
23
27
|
import { useArchiveLabel } from './use-archive-label';
|
|
28
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
24
29
|
|
|
25
30
|
const SUPPORTED_TYPES = [ 'archive', 'search' ];
|
|
26
31
|
|
|
@@ -36,6 +41,7 @@ export default function QueryTitleEdit( {
|
|
|
36
41
|
setAttributes,
|
|
37
42
|
} ) {
|
|
38
43
|
const { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();
|
|
44
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
39
45
|
|
|
40
46
|
const TagName = `h${ level }`;
|
|
41
47
|
const blockProps = useBlockProps( {
|
|
@@ -89,16 +95,35 @@ export default function QueryTitleEdit( {
|
|
|
89
95
|
titleElement = (
|
|
90
96
|
<>
|
|
91
97
|
<InspectorControls>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
<ToolsPanel
|
|
99
|
+
label={ __( 'Settings' ) }
|
|
100
|
+
resetAll={ () =>
|
|
101
|
+
setAttributes( {
|
|
102
|
+
showPrefix: true,
|
|
103
|
+
} )
|
|
104
|
+
}
|
|
105
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
106
|
+
>
|
|
107
|
+
<ToolsPanelItem
|
|
108
|
+
hasValue={ () => ! showPrefix }
|
|
95
109
|
label={ __( 'Show archive type in title' ) }
|
|
96
|
-
|
|
97
|
-
setAttributes( { showPrefix:
|
|
110
|
+
onDeselect={ () =>
|
|
111
|
+
setAttributes( { showPrefix: true } )
|
|
98
112
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
isShownByDefault
|
|
114
|
+
>
|
|
115
|
+
<ToggleControl
|
|
116
|
+
__nextHasNoMarginBottom
|
|
117
|
+
label={ __( 'Show archive type in title' ) }
|
|
118
|
+
onChange={ () =>
|
|
119
|
+
setAttributes( {
|
|
120
|
+
showPrefix: ! showPrefix,
|
|
121
|
+
} )
|
|
122
|
+
}
|
|
123
|
+
checked={ showPrefix }
|
|
124
|
+
/>
|
|
125
|
+
</ToolsPanelItem>
|
|
126
|
+
</ToolsPanel>
|
|
102
127
|
</InspectorControls>
|
|
103
128
|
<TagName { ...blockProps }>{ title }</TagName>
|
|
104
129
|
</>
|
|
@@ -109,18 +134,34 @@ export default function QueryTitleEdit( {
|
|
|
109
134
|
titleElement = (
|
|
110
135
|
<>
|
|
111
136
|
<InspectorControls>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
137
|
+
<ToolsPanel
|
|
138
|
+
label={ __( 'Settings' ) }
|
|
139
|
+
resetAll={ () =>
|
|
140
|
+
setAttributes( {
|
|
141
|
+
showSearchTerm: true,
|
|
142
|
+
} )
|
|
143
|
+
}
|
|
144
|
+
>
|
|
145
|
+
<ToolsPanelItem
|
|
146
|
+
hasValue={ () => ! showSearchTerm }
|
|
115
147
|
label={ __( 'Show search term in title' ) }
|
|
116
|
-
|
|
117
|
-
setAttributes( {
|
|
118
|
-
showSearchTerm: ! showSearchTerm,
|
|
119
|
-
} )
|
|
148
|
+
onDeselect={ () =>
|
|
149
|
+
setAttributes( { showSearchTerm: true } )
|
|
120
150
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
151
|
+
isShownByDefault
|
|
152
|
+
>
|
|
153
|
+
<ToggleControl
|
|
154
|
+
__nextHasNoMarginBottom
|
|
155
|
+
label={ __( 'Show search term in title' ) }
|
|
156
|
+
onChange={ () =>
|
|
157
|
+
setAttributes( {
|
|
158
|
+
showSearchTerm: ! showSearchTerm,
|
|
159
|
+
} )
|
|
160
|
+
}
|
|
161
|
+
checked={ showSearchTerm }
|
|
162
|
+
/>
|
|
163
|
+
</ToolsPanelItem>
|
|
164
|
+
</ToolsPanel>
|
|
124
165
|
</InspectorControls>
|
|
125
166
|
|
|
126
167
|
<TagName { ...blockProps }>
|
|
@@ -45,7 +45,13 @@
|
|
|
45
45
|
"radius": true,
|
|
46
46
|
"color": true,
|
|
47
47
|
"width": true,
|
|
48
|
-
"style": true
|
|
48
|
+
"style": true,
|
|
49
|
+
"__experimentalDefaultControls": {
|
|
50
|
+
"radius": true,
|
|
51
|
+
"color": true,
|
|
52
|
+
"width": true,
|
|
53
|
+
"style": true
|
|
54
|
+
}
|
|
49
55
|
}
|
|
50
56
|
},
|
|
51
57
|
"style": "wp-block-query-total"
|
package/src/quote/transforms.js
CHANGED
|
@@ -67,7 +67,7 @@ const transforms = {
|
|
|
67
67
|
isMultiBlock: true,
|
|
68
68
|
blocks: [ '*' ],
|
|
69
69
|
isMatch: ( {}, blocks ) => {
|
|
70
|
-
// When a single block is selected make the
|
|
70
|
+
// When a single block is selected make the transformation
|
|
71
71
|
// available only to specific blocks that make sense.
|
|
72
72
|
if ( blocks.length === 1 ) {
|
|
73
73
|
return [
|
package/src/rss/block.json
CHANGED
package/src/rss/edit.js
CHANGED
package/src/search/edit.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from '@wordpress/components';
|
|
35
35
|
import { useInstanceId } from '@wordpress/compose';
|
|
36
36
|
import { Icon, search } from '@wordpress/icons';
|
|
37
|
-
import { __ } from '@wordpress/i18n';
|
|
37
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
38
38
|
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -470,7 +470,11 @@ export default function SearchEdit( {
|
|
|
470
470
|
<ToggleGroupControlOption
|
|
471
471
|
key={ widthValue }
|
|
472
472
|
value={ widthValue }
|
|
473
|
-
label={
|
|
473
|
+
label={ sprintf(
|
|
474
|
+
/* translators: Percentage value. */
|
|
475
|
+
__( '%d%%' ),
|
|
476
|
+
widthValue
|
|
477
|
+
) }
|
|
474
478
|
/>
|
|
475
479
|
);
|
|
476
480
|
} ) }
|
package/src/site-logo/edit.js
CHANGED
|
@@ -33,8 +33,6 @@ import {
|
|
|
33
33
|
BlockControls,
|
|
34
34
|
InspectorControls,
|
|
35
35
|
MediaPlaceholder,
|
|
36
|
-
MediaUpload,
|
|
37
|
-
MediaUploadCheck,
|
|
38
36
|
MediaReplaceFlow,
|
|
39
37
|
useBlockProps,
|
|
40
38
|
store as blockEditorStore,
|
|
@@ -347,29 +345,24 @@ const SiteLogo = ( {
|
|
|
347
345
|
|
|
348
346
|
// This is a light wrapper around MediaReplaceFlow because the block has two
|
|
349
347
|
// different MediaReplaceFlows, one for the inspector and one for the toolbar.
|
|
350
|
-
function SiteLogoReplaceFlow( {
|
|
351
|
-
mediaURL,
|
|
352
|
-
onRemoveLogo,
|
|
353
|
-
...mediaReplaceProps
|
|
354
|
-
} ) {
|
|
348
|
+
function SiteLogoReplaceFlow( { mediaURL, ...mediaReplaceProps } ) {
|
|
355
349
|
return (
|
|
356
350
|
<MediaReplaceFlow
|
|
357
351
|
{ ...mediaReplaceProps }
|
|
358
352
|
mediaURL={ mediaURL }
|
|
359
353
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
360
354
|
accept={ ACCEPT_MEDIA_STRING }
|
|
361
|
-
onReset={ onRemoveLogo }
|
|
362
355
|
/>
|
|
363
356
|
);
|
|
364
357
|
}
|
|
365
358
|
|
|
366
|
-
const InspectorLogoPreview = ( {
|
|
359
|
+
const InspectorLogoPreview = ( { media, itemGroupProps } ) => {
|
|
367
360
|
const {
|
|
368
361
|
alt_text: alt,
|
|
369
362
|
source_url: logoUrl,
|
|
370
363
|
slug: logoSlug,
|
|
371
364
|
media_details: logoMediaDetails,
|
|
372
|
-
} =
|
|
365
|
+
} = media ?? {};
|
|
373
366
|
const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug;
|
|
374
367
|
return (
|
|
375
368
|
<ItemGroup { ...itemGroupProps } as="span">
|
|
@@ -506,6 +499,11 @@ export default function LogoEdit( {
|
|
|
506
499
|
};
|
|
507
500
|
|
|
508
501
|
const onFilesDrop = ( filesList ) => {
|
|
502
|
+
if ( filesList?.length > 1 ) {
|
|
503
|
+
onUploadError( __( 'Only one image can be used as a site logo.' ) );
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
509
507
|
getSettings().mediaUpload( {
|
|
510
508
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
511
509
|
filesList,
|
|
@@ -517,7 +515,6 @@ export default function LogoEdit( {
|
|
|
517
515
|
onInitialSelectLogo( image );
|
|
518
516
|
},
|
|
519
517
|
onError: onUploadError,
|
|
520
|
-
onRemoveLogo,
|
|
521
518
|
} );
|
|
522
519
|
};
|
|
523
520
|
|
|
@@ -526,7 +523,7 @@ export default function LogoEdit( {
|
|
|
526
523
|
name: ! logoUrl ? __( 'Choose logo' ) : __( 'Replace' ),
|
|
527
524
|
onSelect: onSelectLogo,
|
|
528
525
|
onError: onUploadError,
|
|
529
|
-
onRemoveLogo,
|
|
526
|
+
onReset: onRemoveLogo,
|
|
530
527
|
};
|
|
531
528
|
const controls = canUserEdit && (
|
|
532
529
|
<BlockControls group="other">
|
|
@@ -599,50 +596,40 @@ export default function LogoEdit( {
|
|
|
599
596
|
<InspectorControls>
|
|
600
597
|
<PanelBody title={ __( 'Media' ) }>
|
|
601
598
|
<div className="block-library-site-logo__inspector-media-replace-container">
|
|
602
|
-
{ ! canUserEdit
|
|
599
|
+
{ ! canUserEdit ? (
|
|
603
600
|
<InspectorLogoPreview
|
|
604
|
-
|
|
601
|
+
media={ mediaItemData }
|
|
605
602
|
itemGroupProps={ {
|
|
606
603
|
isBordered: true,
|
|
607
604
|
className:
|
|
608
605
|
'block-library-site-logo__inspector-readonly-logo-preview',
|
|
609
606
|
} }
|
|
610
607
|
/>
|
|
611
|
-
)
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
onClick={ open }
|
|
633
|
-
variant="secondary"
|
|
634
|
-
>
|
|
635
|
-
{ isLoading ? (
|
|
636
|
-
<Spinner />
|
|
637
|
-
) : (
|
|
638
|
-
__( 'Choose logo' )
|
|
639
|
-
) }
|
|
640
|
-
</Button>
|
|
641
|
-
<DropZone onFilesDrop={ onFilesDrop } />
|
|
642
|
-
</div>
|
|
608
|
+
) : (
|
|
609
|
+
<>
|
|
610
|
+
<SiteLogoReplaceFlow
|
|
611
|
+
{ ...mediaReplaceFlowProps }
|
|
612
|
+
name={
|
|
613
|
+
!! logoUrl ? (
|
|
614
|
+
<InspectorLogoPreview
|
|
615
|
+
media={ mediaItemData }
|
|
616
|
+
/>
|
|
617
|
+
) : (
|
|
618
|
+
__( 'Choose logo' )
|
|
619
|
+
)
|
|
620
|
+
}
|
|
621
|
+
renderToggle={ ( props ) => (
|
|
622
|
+
<Button { ...props } __next40pxDefaultSize>
|
|
623
|
+
{ temporaryURL ? (
|
|
624
|
+
<Spinner />
|
|
625
|
+
) : (
|
|
626
|
+
props.children
|
|
627
|
+
) }
|
|
628
|
+
</Button>
|
|
643
629
|
) }
|
|
644
630
|
/>
|
|
645
|
-
|
|
631
|
+
<DropZone onFilesDrop={ onFilesDrop } />
|
|
632
|
+
</>
|
|
646
633
|
) }
|
|
647
634
|
</div>
|
|
648
635
|
</PanelBody>
|