@wordpress/block-library 6.0.14 → 6.0.15
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-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/style-rtl.css +1 -0
- package/build-style/style.css +1 -0
- package/package.json +7 -7
- package/src/navigation/style.scss +1 -0
- package/src/navigation-submenu/index.php +8 -2
- package/src/page-list/index.php +8 -3
- package/src/post-comments/index.php +6 -4
- package/src/post-comments-form/index.php +6 -4
- package/src/template-part/index.php +5 -2
|
@@ -359,6 +359,7 @@ button.wp-block-navigation-item__content {
|
|
|
359
359
|
padding: 0;
|
|
360
360
|
}
|
|
361
361
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
362
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
|
362
363
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
363
364
|
justify-content: flex-start;
|
|
364
365
|
}
|
|
@@ -359,6 +359,7 @@ button.wp-block-navigation-item__content {
|
|
|
359
359
|
padding: 0;
|
|
360
360
|
}
|
|
361
361
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
362
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
|
362
363
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
363
364
|
justify-content: flex-start;
|
|
364
365
|
}
|
|
@@ -1771,6 +1771,7 @@ button.wp-block-navigation-item__content {
|
|
|
1771
1771
|
padding: 0;
|
|
1772
1772
|
}
|
|
1773
1773
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
1774
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
|
1774
1775
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
1775
1776
|
justify-content: flex-start;
|
|
1776
1777
|
}
|
package/build-style/style.css
CHANGED
|
@@ -1793,6 +1793,7 @@ button.wp-block-navigation-item__content {
|
|
|
1793
1793
|
padding: 0;
|
|
1794
1794
|
}
|
|
1795
1795
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
1796
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
|
1796
1797
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
1797
1798
|
justify-content: flex-start;
|
|
1798
1799
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.15",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@wordpress/api-fetch": "^5.2.6",
|
|
38
38
|
"@wordpress/autop": "^3.2.3",
|
|
39
39
|
"@wordpress/blob": "^3.2.2",
|
|
40
|
-
"@wordpress/block-editor": "^8.0.
|
|
40
|
+
"@wordpress/block-editor": "^8.0.11",
|
|
41
41
|
"@wordpress/blocks": "^11.1.4",
|
|
42
|
-
"@wordpress/components": "^19.1.
|
|
42
|
+
"@wordpress/components": "^19.1.5",
|
|
43
43
|
"@wordpress/compose": "^5.0.6",
|
|
44
44
|
"@wordpress/core-data": "^4.0.8",
|
|
45
45
|
"@wordpress/data": "^6.1.4",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"@wordpress/html-entities": "^3.2.3",
|
|
53
53
|
"@wordpress/i18n": "^4.2.4",
|
|
54
54
|
"@wordpress/icons": "^6.1.1",
|
|
55
|
-
"@wordpress/interface": "^4.1.
|
|
55
|
+
"@wordpress/interface": "^4.1.13",
|
|
56
56
|
"@wordpress/is-shallow-equal": "^4.2.1",
|
|
57
57
|
"@wordpress/keycodes": "^3.2.4",
|
|
58
58
|
"@wordpress/notices": "^3.2.7",
|
|
59
59
|
"@wordpress/primitives": "^3.0.4",
|
|
60
|
-
"@wordpress/reusable-blocks": "^3.0.
|
|
60
|
+
"@wordpress/reusable-blocks": "^3.0.17",
|
|
61
61
|
"@wordpress/rich-text": "^5.0.6",
|
|
62
|
-
"@wordpress/server-side-render": "^3.0.
|
|
62
|
+
"@wordpress/server-side-render": "^3.0.15",
|
|
63
63
|
"@wordpress/url": "^3.3.1",
|
|
64
64
|
"@wordpress/viewport": "^4.0.6",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "3665e3e1b121046300d8b2fa35074d748f16dbc2"
|
|
77
77
|
}
|
|
@@ -188,6 +188,12 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
$aria_label = sprintf(
|
|
192
|
+
/* translators: Accessibility text. %s: Parent page title. */
|
|
193
|
+
__( '%s submenu' ),
|
|
194
|
+
$label
|
|
195
|
+
);
|
|
196
|
+
|
|
191
197
|
$html = '<li ' . $wrapper_attributes . '>';
|
|
192
198
|
|
|
193
199
|
// If Submenus open on hover, we render an anchor tag with attributes.
|
|
@@ -226,11 +232,11 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
226
232
|
if ( $show_submenu_indicators ) {
|
|
227
233
|
// The submenu icon is rendered in a button here
|
|
228
234
|
// so that there's a clickable elment to open the submenu.
|
|
229
|
-
$html .= '<button aria-label="' . $
|
|
235
|
+
$html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
|
|
230
236
|
}
|
|
231
237
|
} else {
|
|
232
238
|
// If menus open on click, we render the parent as a button.
|
|
233
|
-
$html .= '<button aria-label="' . $
|
|
239
|
+
$html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
|
|
234
240
|
|
|
235
241
|
// Wrap title with span to isolate it from submenu icon.
|
|
236
242
|
$html .= '<span class="wp-block-navigation-item__label">';
|
package/src/page-list/index.php
CHANGED
|
@@ -173,12 +173,17 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
$title
|
|
176
|
+
$title = wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) );
|
|
177
|
+
$aria_label = sprintf(
|
|
178
|
+
/* translators: Accessibility text. %s: Parent page title. */
|
|
179
|
+
__( '%s submenu' ),
|
|
180
|
+
$title
|
|
181
|
+
);
|
|
177
182
|
|
|
178
183
|
$markup .= '<li class="wp-block-pages-list__item' . $css_class . '"' . $style_attribute . '>';
|
|
179
184
|
|
|
180
185
|
if ( isset( $page['children'] ) && $is_navigation_child && $open_submenus_on_click ) {
|
|
181
|
-
$markup .= '<button aria-label="' . $
|
|
186
|
+
$markup .= '<button aria-label="' . $aria_label . '" class="' . $navigation_child_content_class . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . $title . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>' .
|
|
182
187
|
'</button>';
|
|
183
188
|
} else {
|
|
184
189
|
$markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . $title . '</a>';
|
|
@@ -186,7 +191,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
|
|
|
186
191
|
|
|
187
192
|
if ( isset( $page['children'] ) ) {
|
|
188
193
|
if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) {
|
|
189
|
-
$markup .= '<button aria-label="' . $
|
|
194
|
+
$markup .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';
|
|
190
195
|
$markup .= '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';
|
|
191
196
|
$markup .= '</button>';
|
|
192
197
|
}
|
|
@@ -74,10 +74,12 @@ add_action( 'init', 'register_block_core_post_comments' );
|
|
|
74
74
|
*
|
|
75
75
|
* @return array Returns the modified fields.
|
|
76
76
|
*/
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
function post_comments_block_form_defaults( $fields ) {
|
|
78
|
+
if ( wp_is_block_theme() ) {
|
|
79
|
+
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
|
|
80
|
+
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
|
|
81
|
+
}
|
|
80
82
|
|
|
81
83
|
return $fields;
|
|
82
84
|
}
|
|
83
|
-
add_filter( 'comment_form_defaults', '
|
|
85
|
+
add_filter( 'comment_form_defaults', 'post_comments_block_form_defaults' );
|
|
@@ -54,10 +54,12 @@ add_action( 'init', 'register_block_core_post_comments_form' );
|
|
|
54
54
|
*
|
|
55
55
|
* @return array Returns the modified fields.
|
|
56
56
|
*/
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
function post_comments_form_block_form_defaults( $fields ) {
|
|
58
|
+
if ( wp_is_block_theme() ) {
|
|
59
|
+
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
|
|
60
|
+
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
|
|
61
|
+
}
|
|
60
62
|
|
|
61
63
|
return $fields;
|
|
62
64
|
}
|
|
63
|
-
add_filter( 'comment_form_defaults', '
|
|
65
|
+
add_filter( 'comment_form_defaults', 'post_comments_form_block_form_defaults' );
|
|
@@ -64,8 +64,11 @@ function render_block_core_template_part( $attributes ) {
|
|
|
64
64
|
} else {
|
|
65
65
|
// Else, if the template part was provided by the active theme,
|
|
66
66
|
// render the corresponding file content.
|
|
67
|
-
$
|
|
68
|
-
$
|
|
67
|
+
$parent_theme_folders = get_block_theme_folders( get_template() );
|
|
68
|
+
$child_theme_folders = get_block_theme_folders( get_stylesheet() );
|
|
69
|
+
$child_theme_part_file_path = get_theme_file_path( '/' . $child_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
|
70
|
+
$parent_theme_part_file_path = get_theme_file_path( '/' . $parent_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
|
71
|
+
$template_part_file_path = 0 === validate_file( $attributes['slug'] ) && file_exists( $child_theme_part_file_path ) ? $child_theme_part_file_path : $parent_theme_part_file_path;
|
|
69
72
|
if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) {
|
|
70
73
|
$content = file_get_contents( $template_part_file_path );
|
|
71
74
|
$content = is_string( $content ) && '' !== $content
|