@wordpress/block-library 8.3.5 → 8.3.7
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/build/archives/index.js +0 -1
- package/build/archives/index.js.map +1 -1
- package/build/avatar/index.js +0 -1
- package/build/avatar/index.js.map +1 -1
- package/build/calendar/index.js +0 -1
- package/build/calendar/index.js.map +1 -1
- package/build/categories/index.js +0 -1
- package/build/categories/index.js.map +1 -1
- package/build/comment-author-avatar/index.js +0 -1
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/index.js +0 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +0 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +0 -1
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +0 -1
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +0 -1
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +0 -1
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/index.js +1 -2
- package/build/comments/index.js.map +1 -1
- package/build/comments-pagination/index.js +0 -1
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +0 -1
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +0 -1
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +0 -1
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/home-link/index.js +0 -1
- package/build/home-link/index.js.map +1 -1
- package/build/latest-comments/index.js +0 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +0 -1
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +0 -1
- package/build/latest-posts/index.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +2 -1
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/loginout/index.js +0 -1
- package/build/loginout/index.js.map +1 -1
- package/build/navigation/edit/index.js +4 -2
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +4 -1
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/index.js +0 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation-link/edit.js +5 -21
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -13
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +5 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +0 -1
- package/build/page-list/index.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +0 -1
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +0 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-count/index.js +0 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +0 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +0 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/index.js +0 -1
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/index.js +0 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/index.js +0 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/index.js +0 -1
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +0 -1
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/index.js +0 -1
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/index.js +0 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +0 -1
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/query-placeholder.js +3 -2
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/index.js +0 -1
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +0 -1
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/index.js +0 -1
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/index.js +0 -1
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination-next/index.js +0 -1
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +0 -1
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +0 -1
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/index.js +0 -1
- package/build/query-title/index.js.map +1 -1
- package/build/read-more/index.js +0 -1
- package/build/read-more/index.js.map +1 -1
- package/build/rss/index.js +0 -1
- package/build/rss/index.js.map +1 -1
- package/build/search/index.js +0 -1
- package/build/search/index.js.map +1 -1
- package/build/site-logo/index.js +0 -1
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/index.js +1 -1
- package/build/site-title/index.js +0 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/index.js +0 -1
- package/build/social-link/index.js.map +1 -1
- package/build/social-links/edit.js +2 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/tag-cloud/index.js +0 -1
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/import-controls.js +33 -30
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/utils/transformers.js +69 -19
- package/build/template-part/edit/utils/transformers.js.map +1 -1
- package/build/template-part/index.js +0 -1
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +0 -1
- package/build/term-description/index.js.map +1 -1
- package/build-module/archives/index.js +0 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/avatar/index.js +0 -1
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/calendar/index.js +0 -1
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/categories/index.js +0 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +0 -1
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +0 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +0 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +0 -1
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +0 -1
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +0 -1
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +0 -1
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/index.js +1 -2
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-pagination/index.js +0 -1
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +0 -1
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +0 -1
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +0 -1
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/home-link/index.js +0 -1
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/latest-comments/index.js +0 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +0 -1
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +0 -1
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +2 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/loginout/index.js +0 -1
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +4 -2
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +4 -1
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/index.js +0 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -21
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -13
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +5 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +0 -1
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +0 -1
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +0 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +0 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +0 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +0 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/index.js +0 -1
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/index.js +0 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/index.js +0 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/index.js +0 -1
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +0 -1
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/index.js +0 -1
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/index.js +0 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +0 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +4 -3
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/index.js +0 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +0 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/index.js +0 -1
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/index.js +0 -1
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination-next/index.js +0 -1
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +0 -1
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +0 -1
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/index.js +0 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/read-more/index.js +0 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/rss/index.js +0 -1
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/index.js +0 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/index.js +0 -1
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -1
- package/build-module/site-title/index.js +0 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/index.js +0 -1
- package/build-module/social-link/index.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/tag-cloud/index.js +0 -1
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +32 -29
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/utils/transformers.js +69 -20
- package/build-module/template-part/edit/utils/transformers.js.map +1 -1
- package/build-module/template-part/index.js +0 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +0 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-style/editor-rtl.css +8 -3
- package/build-style/editor.css +8 -3
- package/build-style/navigation/editor-rtl.css +1 -1
- package/build-style/navigation/editor.css +1 -1
- package/build-style/page-list/editor-rtl.css +4 -0
- package/build-style/page-list/editor.css +4 -0
- package/build-style/query/editor-rtl.css +1 -0
- package/build-style/query/editor.css +1 -0
- package/build-style/site-logo/editor-rtl.css +2 -2
- package/build-style/site-logo/editor.css +2 -2
- package/package.json +6 -6
- package/src/archives/block.json +0 -1
- package/src/avatar/block.json +0 -1
- package/src/calendar/block.json +0 -1
- package/src/categories/block.json +0 -1
- package/src/comment-author-avatar/block.json +0 -1
- package/src/comment-author-name/block.json +0 -1
- package/src/comment-content/block.json +0 -1
- package/src/comment-date/block.json +0 -1
- package/src/comment-edit-link/block.json +0 -1
- package/src/comment-reply-link/block.json +0 -1
- package/src/comment-template/block.json +0 -1
- package/src/comments/block.json +1 -2
- package/src/comments-pagination/block.json +0 -1
- package/src/comments-pagination-next/block.json +0 -1
- package/src/comments-pagination-numbers/block.json +0 -1
- package/src/comments-pagination-previous/block.json +0 -1
- package/src/home-link/block.json +0 -1
- package/src/latest-comments/block.json +0 -1
- package/src/latest-posts/block.json +0 -1
- package/src/list-item/hooks/use-outdent-list-item.js +2 -1
- package/src/loginout/block.json +0 -1
- package/src/navigation/block.json +0 -1
- package/src/navigation/edit/index.js +3 -1
- package/src/navigation/edit/inner-blocks.js +3 -0
- package/src/navigation/edit/menu-inspector-controls.js +1 -3
- package/src/navigation/editor.scss +23 -20
- package/src/navigation/index.php +8 -6
- package/src/navigation-link/edit.js +5 -19
- package/src/navigation-link/index.php +4 -5
- package/src/navigation-submenu/edit.js +0 -10
- package/src/navigation-submenu/index.php +23 -6
- package/src/page-list/block.json +0 -1
- package/src/page-list/edit.js +3 -1
- package/src/page-list/editor.scss +6 -0
- package/src/post-author/block.json +0 -1
- package/src/post-author-biography/block.json +0 -1
- package/src/post-author-name/block.json +0 -1
- package/src/post-comments-count/block.json +0 -1
- package/src/post-comments-form/block.json +0 -1
- package/src/post-comments-link/block.json +0 -1
- package/src/post-content/block.json +0 -1
- package/src/post-date/block.json +0 -1
- package/src/post-excerpt/block.json +0 -1
- package/src/post-featured-image/block.json +0 -1
- package/src/post-navigation-link/block.json +0 -1
- package/src/post-template/block.json +0 -1
- package/src/post-terms/block.json +0 -1
- package/src/post-title/block.json +0 -1
- package/src/query/block.json +0 -1
- package/src/query/edit/query-placeholder.js +10 -5
- package/src/query/editor.scss +1 -0
- package/src/query-no-results/block.json +0 -1
- package/src/query-pagination/block.json +0 -1
- package/src/query-pagination-next/block.json +0 -1
- package/src/query-pagination-numbers/block.json +0 -1
- package/src/query-pagination-previous/block.json +0 -1
- package/src/query-title/block.json +0 -1
- package/src/read-more/block.json +0 -1
- package/src/rss/block.json +0 -1
- package/src/search/block.json +0 -1
- package/src/site-logo/block.json +0 -1
- package/src/site-logo/editor.scss +3 -3
- package/src/site-tagline/block.json +1 -1
- package/src/site-title/block.json +0 -1
- package/src/social-link/block.json +0 -1
- package/src/social-links/edit.js +1 -0
- package/src/tag-cloud/block.json +0 -1
- package/src/template-part/block.json +0 -1
- package/src/template-part/edit/import-controls.js +26 -34
- package/src/template-part/edit/utils/transformers.js +96 -19
- package/src/term-description/block.json +0 -1
|
@@ -9,18 +9,17 @@
|
|
|
9
9
|
* Build an array with CSS classes and inline styles defining the colors
|
|
10
10
|
* which will be applied to the navigation markup in the front-end.
|
|
11
11
|
*
|
|
12
|
-
* @param array $context
|
|
13
|
-
* @param array $attributes
|
|
12
|
+
* @param array $context Navigation block context.
|
|
13
|
+
* @param array $attributes Block attributes.
|
|
14
|
+
* @param bool $is_sub_menu Whether the block is a sub-menu.
|
|
14
15
|
* @return array Colors CSS classes and inline styles.
|
|
15
16
|
*/
|
|
16
|
-
function block_core_navigation_submenu_build_css_colors( $context, $attributes ) {
|
|
17
|
+
function block_core_navigation_submenu_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
|
|
17
18
|
$colors = array(
|
|
18
19
|
'css_classes' => array(),
|
|
19
20
|
'inline_styles' => '',
|
|
20
21
|
);
|
|
21
22
|
|
|
22
|
-
$is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false;
|
|
23
|
-
|
|
24
23
|
// Text color.
|
|
25
24
|
$named_text_color = null;
|
|
26
25
|
$custom_text_color = null;
|
|
@@ -250,6 +249,15 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
250
249
|
}
|
|
251
250
|
|
|
252
251
|
if ( $has_submenu ) {
|
|
252
|
+
$colors = block_core_navigation_submenu_build_css_colors( $block->context, $attributes, $has_submenu );
|
|
253
|
+
$classes = array_merge(
|
|
254
|
+
array( 'wp-block-navigation__submenu-container' ),
|
|
255
|
+
$colors['css_classes']
|
|
256
|
+
);
|
|
257
|
+
$css_classes = trim( implode( ' ', $classes ) );
|
|
258
|
+
|
|
259
|
+
$style_attribute = $colors['inline_styles'];
|
|
260
|
+
|
|
253
261
|
$inner_blocks_html = '';
|
|
254
262
|
foreach ( $block->inner_blocks as $inner_block ) {
|
|
255
263
|
$inner_blocks_html .= $inner_block->render();
|
|
@@ -263,10 +271,19 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
263
271
|
$html = $tag_processor->get_updated_html();
|
|
264
272
|
}
|
|
265
273
|
|
|
274
|
+
$wrapper_attributes = get_block_wrapper_attributes(
|
|
275
|
+
array(
|
|
276
|
+
'class' => $css_classes,
|
|
277
|
+
'style' => $style_attribute,
|
|
278
|
+
)
|
|
279
|
+
);
|
|
280
|
+
|
|
266
281
|
$html .= sprintf(
|
|
267
|
-
'<ul
|
|
282
|
+
'<ul %s>%s</ul>',
|
|
283
|
+
$wrapper_attributes,
|
|
268
284
|
$inner_blocks_html
|
|
269
285
|
);
|
|
286
|
+
|
|
270
287
|
}
|
|
271
288
|
|
|
272
289
|
$html .= '</li>';
|
package/src/page-list/block.json
CHANGED
package/src/page-list/edit.js
CHANGED
|
@@ -55,7 +55,9 @@ function BlockContent( {
|
|
|
55
55
|
if ( ! hasResolvedPages ) {
|
|
56
56
|
return (
|
|
57
57
|
<div { ...blockProps }>
|
|
58
|
-
<
|
|
58
|
+
<div className="wp-block-page-list__loading-indicator-container">
|
|
59
|
+
<Spinner className="wp-block-page-list__loading-indicator" />
|
|
60
|
+
</div>
|
|
59
61
|
</div>
|
|
60
62
|
);
|
|
61
63
|
}
|
|
@@ -61,3 +61,9 @@
|
|
|
61
61
|
.wp-block-page-list .components-notice {
|
|
62
62
|
margin-left: 0;
|
|
63
63
|
}
|
|
64
|
+
|
|
65
|
+
// Space spinner to give it breathing
|
|
66
|
+
// room when block is selected and has focus outline.
|
|
67
|
+
.wp-block-page-list__loading-indicator-container {
|
|
68
|
+
padding: $grid-unit-10 $grid-unit-15;
|
|
69
|
+
}
|
package/src/post-date/block.json
CHANGED
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"usesContext": [ "postId", "postType", "queryId" ],
|
|
54
54
|
"supports": {
|
|
55
55
|
"align": [ "left", "right", "center", "wide", "full" ],
|
|
56
|
-
"anchor": true,
|
|
57
56
|
"color": {
|
|
58
57
|
"__experimentalDuotone": "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
|
|
59
58
|
"text": false,
|
package/src/query/block.json
CHANGED
|
@@ -19,7 +19,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
19
19
|
/**
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
|
-
import { useScopedBlockVariations } from '../utils';
|
|
22
|
+
import { useScopedBlockVariations, useBlockNameForPatterns } from '../utils';
|
|
23
23
|
|
|
24
24
|
export default function QueryPlaceholder( {
|
|
25
25
|
attributes,
|
|
@@ -30,6 +30,10 @@ export default function QueryPlaceholder( {
|
|
|
30
30
|
} ) {
|
|
31
31
|
const [ isStartingBlank, setIsStartingBlank ] = useState( false );
|
|
32
32
|
const blockProps = useBlockProps();
|
|
33
|
+
const blockNameForPatterns = useBlockNameForPatterns(
|
|
34
|
+
clientId,
|
|
35
|
+
attributes
|
|
36
|
+
);
|
|
33
37
|
|
|
34
38
|
const { blockType, allVariations, hasPatterns } = useSelect(
|
|
35
39
|
( select ) => {
|
|
@@ -37,15 +41,16 @@ export default function QueryPlaceholder( {
|
|
|
37
41
|
const { getBlockRootClientId, getPatternsByBlockTypes } =
|
|
38
42
|
select( blockEditorStore );
|
|
39
43
|
const rootClientId = getBlockRootClientId( clientId );
|
|
40
|
-
|
|
41
44
|
return {
|
|
42
45
|
blockType: getBlockType( name ),
|
|
43
46
|
allVariations: getBlockVariations( name ),
|
|
44
|
-
hasPatterns: !! getPatternsByBlockTypes(
|
|
45
|
-
|
|
47
|
+
hasPatterns: !! getPatternsByBlockTypes(
|
|
48
|
+
blockNameForPatterns,
|
|
49
|
+
rootClientId
|
|
50
|
+
).length,
|
|
46
51
|
};
|
|
47
52
|
},
|
|
48
|
-
[ name, clientId ]
|
|
53
|
+
[ name, blockNameForPatterns, clientId ]
|
|
49
54
|
);
|
|
50
55
|
|
|
51
56
|
const matchingVariation = getMatchingVariation( attributes, allVariations );
|
package/src/query/editor.scss
CHANGED
package/src/read-more/block.json
CHANGED
package/src/rss/block.json
CHANGED
package/src/search/block.json
CHANGED
package/src/site-logo/block.json
CHANGED
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
// Provide special styling for the placeholder.
|
|
34
34
|
// @todo: this particular minimal style of placeholder could be componentized further.
|
|
35
35
|
.wp-block-site-logo.wp-block-site-logo {
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
&.is-default-size .components-placeholder {
|
|
38
|
-
height:
|
|
39
|
-
width:
|
|
38
|
+
height: 60px;
|
|
39
|
+
width: 60px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// Inherit radius.
|
package/src/social-links/edit.js
CHANGED
|
@@ -109,6 +109,7 @@ export function SocialLinksEdit( props ) {
|
|
|
109
109
|
allowedBlocks: ALLOWED_BLOCKS,
|
|
110
110
|
placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
|
|
111
111
|
templateLock: false,
|
|
112
|
+
orientation: attributes.layout?.orientation ?? 'horizontal',
|
|
112
113
|
__experimentalAppenderTagName: 'li',
|
|
113
114
|
} );
|
|
114
115
|
|
package/src/tag-cloud/block.json
CHANGED
|
@@ -12,10 +12,6 @@ import {
|
|
|
12
12
|
__experimentalHStack as HStack,
|
|
13
13
|
__experimentalSpacer as Spacer,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
|
-
import {
|
|
16
|
-
switchToBlockType,
|
|
17
|
-
getPossibleBlockTransformations,
|
|
18
|
-
} from '@wordpress/blocks';
|
|
19
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
20
16
|
import { store as noticesStore } from '@wordpress/notices';
|
|
21
17
|
|
|
@@ -25,16 +21,25 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
25
21
|
import { useCreateTemplatePartFromBlocks } from './utils/hooks';
|
|
26
22
|
import { transformWidgetToBlock } from './utils/transformers';
|
|
27
23
|
|
|
24
|
+
const SIDEBARS_QUERY = {
|
|
25
|
+
per_page: -1,
|
|
26
|
+
_fields: 'id,name,description,status,widgets',
|
|
27
|
+
};
|
|
28
|
+
|
|
28
29
|
export function TemplatePartImportControls( { area, setAttributes } ) {
|
|
29
30
|
const [ selectedSidebar, setSelectedSidebar ] = useState( '' );
|
|
30
31
|
const [ isBusy, setIsBusy ] = useState( false );
|
|
31
32
|
|
|
32
33
|
const registry = useRegistry();
|
|
33
|
-
const sidebars = useSelect( ( select ) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const { sidebars, hasResolved } = useSelect( ( select ) => {
|
|
35
|
+
const { getSidebars, hasFinishedResolution } = select( coreStore );
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
sidebars: getSidebars( SIDEBARS_QUERY ),
|
|
39
|
+
hasResolved: hasFinishedResolution( 'getSidebars', [
|
|
40
|
+
SIDEBARS_QUERY,
|
|
41
|
+
] ),
|
|
42
|
+
};
|
|
38
43
|
}, [] );
|
|
39
44
|
const { createErrorNotice } = useDispatch( noticesStore );
|
|
40
45
|
|
|
@@ -67,6 +72,16 @@ export function TemplatePartImportControls( { area, setAttributes } ) {
|
|
|
67
72
|
];
|
|
68
73
|
}, [ sidebars ] );
|
|
69
74
|
|
|
75
|
+
// Render an empty node while data is loading to avoid SlotFill re-positioning bug.
|
|
76
|
+
// See: https://github.com/WordPress/gutenberg/issues/15641.
|
|
77
|
+
if ( ! hasResolved ) {
|
|
78
|
+
return <Spacer marginBottom="0" />;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if ( hasResolved && ! options.length ) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
70
85
|
async function createFromWidgets( event ) {
|
|
71
86
|
event.preventDefault();
|
|
72
87
|
|
|
@@ -91,36 +106,13 @@ export function TemplatePartImportControls( { area, setAttributes } ) {
|
|
|
91
106
|
const blocks = widgets.flatMap( ( widget ) => {
|
|
92
107
|
const block = transformWidgetToBlock( widget );
|
|
93
108
|
|
|
94
|
-
if ( block.name !== 'core/legacy-widget' ) {
|
|
95
|
-
return block;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const transforms = getPossibleBlockTransformations( [
|
|
99
|
-
block,
|
|
100
|
-
] ).filter( ( item ) => {
|
|
101
|
-
// The block without any transformations can't be a wildcard.
|
|
102
|
-
if ( ! item.transforms ) {
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const hasWildCardFrom = item.transforms?.from?.find(
|
|
107
|
-
( from ) => from.blocks && from.blocks.includes( '*' )
|
|
108
|
-
);
|
|
109
|
-
const hasWildCardTo = item.transforms?.to?.find(
|
|
110
|
-
( to ) => to.blocks && to.blocks.includes( '*' )
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
return ! hasWildCardFrom && ! hasWildCardTo;
|
|
114
|
-
} );
|
|
115
|
-
|
|
116
109
|
// Skip the block if we have no matching transformations.
|
|
117
|
-
if ( !
|
|
110
|
+
if ( ! block ) {
|
|
118
111
|
skippedWidgets.add( widget.id_base );
|
|
119
112
|
return [];
|
|
120
113
|
}
|
|
121
114
|
|
|
122
|
-
|
|
123
|
-
return switchToBlockType( block, transforms[ 0 ].name );
|
|
115
|
+
return block;
|
|
124
116
|
} );
|
|
125
117
|
|
|
126
118
|
await createFromBlocks(
|