Editor: Update npm WordPress npm packages.

This fixes a fatal error in the Navigation block, which was due to a reference
to `WP_Navigation_Fallback_Gutenberg` that isn’t present in Core under that name.

Follow-up to [56065].
Props ramonjd, isabel_brison, dmsnell.
Fixes #58623.
Built from https://develop.svn.wordpress.org/trunk@56076


git-svn-id: http://core.svn.wordpress.org/trunk@55588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Bernhard Reiter 2023-06-27 18:27:50 +00:00
parent 0d9723a44e
commit a6a1ebcc11
5 changed files with 32 additions and 18 deletions

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,7 @@ function render_block_core_latest_posts( $attributes ) {
$filter_latest_posts_excerpt_more = static function( $more ) use ( $attributes ) {
$use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
/* translators: %1$s is a URL to a post, excerpt truncation character, default … */
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>', 'gutenberg' ), esc_url( get_permalink() ) ) : $more;
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
};
add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );

View File

@ -94,7 +94,7 @@ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
*
* @return string Submenu markup with the directives injected.
*/
function gutenberg_block_core_navigation_add_directives_to_submenu( $w, $block_attributes ) {
function block_core_navigation_add_directives_to_submenu( $w, $block_attributes ) {
while ( $w->next_tag(
array(
'tag_name' => 'LI',
@ -124,7 +124,7 @@ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
};
// Iterate through subitems if exist.
gutenberg_block_core_navigation_add_directives_to_submenu( $w, $block_attributes );
block_core_navigation_add_directives_to_submenu( $w, $block_attributes );
}
return $w->get_updated_html();
};
@ -341,7 +341,11 @@ function block_core_navigation_get_fallback_blocks() {
// If `core/page-list` is not registered then return empty blocks.
$fallback_blocks = $registry->is_registered( 'core/page-list' ) ? $page_list_fallback : array();
$navigation_post = WP_Navigation_Fallback_Gutenberg::get_fallback();
if ( class_exists( 'WP_Navigation_Fallback' ) ) {
$navigation_post = WP_Navigation_Fallback::get_fallback();
} else {
$navigation_post = Gutenberg_Navigation_Fallback::get_fallback();
}
// Use the first non-empty Navigation as fallback if available.
if ( $navigation_post ) {
@ -673,7 +677,7 @@ function render_block_core_navigation( $attributes, $content, $block ) {
// Add directives to the submenu if needed.
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && $has_submenus && $should_load_view_script ) {
$w = new WP_HTML_Tag_Processor( $inner_blocks_html );
$inner_blocks_html = gutenberg_block_core_navigation_add_directives_to_submenu( $w, $attributes );
$inner_blocks_html = block_core_navigation_add_directives_to_submenu( $w, $attributes );
}
$modal_unique_id = wp_unique_id( 'modal-' );
@ -836,6 +840,8 @@ add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_back
/**
* Turns menu item data into a nested array of parsed blocks
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::parse_blocks_from_menu_items() instead.
*
* @param array $menu_items An array of menu items that represent
* an individual level of a menu.
* @param array $menu_items_by_parent_id An array keyed by the id of the
@ -846,7 +852,7 @@ add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_back
*/
function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) {
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::parse_blocks_from_menu_items' );
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::parse_blocks_from_menu_items' );
if ( empty( $menu_items ) ) {
return array();
@ -891,11 +897,13 @@ function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_
/**
* Get the classic navigation menu to use as a fallback.
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback() instead.
*
* @return object WP_Term The classic navigation.
*/
function block_core_navigation_get_classic_menu_fallback() {
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::get_classic_menu_fallback' );
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::get_classic_menu_fallback' );
$classic_nav_menus = wp_get_nav_menus();
@ -933,12 +941,14 @@ function block_core_navigation_get_classic_menu_fallback() {
/**
* Converts a classic navigation to blocks.
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback_blocks() instead.
*
* @param object $classic_nav_menu WP_Term The classic navigation object to convert.
* @return array the normalized parsed blocks.
*/
function block_core_navigation_get_classic_menu_fallback_blocks( $classic_nav_menu ) {
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::get_classic_menu_fallback_blocks' );
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::get_classic_menu_fallback_blocks' );
// BEGIN: Code that already exists in wp_nav_menu().
$menu_items = wp_get_nav_menu_items( $classic_nav_menu->term_id, array( 'update_post_term_cache' => false ) );
@ -971,13 +981,15 @@ function block_core_navigation_get_classic_menu_fallback_blocks( $classic_nav_me
}
/**
* If there's a the classic menu then use it as a fallback.
* If there's a classic menu then use it as a fallback.
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::create_classic_menu_fallback() instead.
*
* @return array the normalized parsed blocks.
*/
function block_core_navigation_maybe_use_classic_menu_fallback() {
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::create_classic_menu_fallback' );
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::create_classic_menu_fallback' );
// See if we have a classic menu.
$classic_nav_menu = block_core_navigation_get_classic_menu_fallback();
@ -1016,11 +1028,13 @@ function block_core_navigation_maybe_use_classic_menu_fallback() {
/**
* Finds the most recently published `wp_navigation` Post.
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_most_recently_published_navigation() instead.
*
* @return WP_Post|null the first non-empty Navigation or null.
*/
function block_core_navigation_get_most_recently_published_navigation() {
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::get_most_recently_published_navigation' );
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::get_most_recently_published_navigation' );
// Default to the most recently created menu.
$parsed_args = array(

View File

@ -58029,7 +58029,7 @@ function FootnotesEdit({
}, "\u21A9\uFE0E"))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/rng.js
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
@ -58049,9 +58049,9 @@ function rng() {
return getRandomValues(rnds8);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/regex.js
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js
/* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/validate.js
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js
function validate(uuid) {
@ -58059,7 +58059,7 @@ function validate(uuid) {
}
/* harmony default export */ var esm_browser_validate = (validate);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/stringify.js
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
/**
* Convert array of 16 byte values to UUID string format of the form:
@ -58090,7 +58090,7 @@ function stringify(arr) {
}
/* harmony default export */ var esm_browser_stringify = (stringify);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/node_modules/uuid/dist/esm-browser/v4.js
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-alpha-56075';
$wp_version = '6.3-alpha-56076';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.