Editor: Update WordPress packages to Gutenberg 16.7 RC3.

It brings with a set of iterations and follow-ups to the initial package update.
It also fixes a regression that happened for interactive blocks.

Props gziolo, luisherranz, cbravobernal.
See #60315.

git-svn-id: https://develop.svn.wordpress.org/trunk@57499 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella
2024-01-31 11:54:09 +00:00
parent 38ff9709b2
commit 9453f3a85b
13 changed files with 308 additions and 334 deletions
File diff suppressed because one or more lines are too long
-1
View File
@@ -2073,7 +2073,6 @@
)
),
'dimensions' => array(
'aspectRatio' => true,
'minHeight' => true
),
'__experimentalBorder' => array(
-1
View File
@@ -55,7 +55,6 @@
}
},
"dimensions": {
"aspectRatio": true,
"minHeight": true
},
"__experimentalBorder": {
+9 -13
View File
@@ -192,7 +192,7 @@ class WP_Navigation_Block_Renderer {
// it encounters whitespace. This code strips it.
$blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks );
if ( function_exists( 'get_hooked_blocks' ) ) {
if ( function_exists( 'get_hooked_block_markup' ) ) {
// Run Block Hooks algorithm to inject hooked blocks.
$markup = block_core_navigation_insert_hooked_blocks( $blocks, $navigation_post );
$root_nav_block = parse_blocks( $markup )[0];
@@ -992,7 +992,7 @@ function block_core_navigation_get_fallback_blocks() {
// In this case default to the (Page List) fallback.
$fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks;
if ( function_exists( 'get_hooked_blocks' ) ) {
if ( function_exists( 'get_hooked_block_markup' ) ) {
// Run Block Hooks algorithm to inject hooked blocks.
// We have to run it here because we need the post ID of the Navigation block to track ignored hooked blocks.
$markup = block_core_navigation_insert_hooked_blocks( $fallback_blocks, $navigation_post );
@@ -1358,7 +1358,7 @@ function block_core_navigation_get_most_recently_published_navigation() {
* @param WP_Post $post `wp_navigation` post object corresponding to the block.
* @return string Serialized inner blocks in mock Navigation block wrapper, with hooked blocks inserted, if any.
*/
function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post = null ) {
function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) {
$before_block_visitor = null;
$after_block_visitor = null;
$hooked_blocks = get_hooked_blocks();
@@ -1397,10 +1397,6 @@ function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post = null
* @param WP_Post $post Post object.
*/
function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
if ( ! isset( $post->ID ) ) {
return;
}
// We run the Block Hooks mechanism so it will return the list of ignored hooked blocks
// in the mock root Navigation block's metadata attribute.
// We ignore the rest of the returned `$markup`; `$post->post_content` already has the hooked
@@ -1422,9 +1418,9 @@ function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
}
}
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.4
// that are not present in Gutenberg's WP 6.4 compatibility layer.
if ( function_exists( 'get_hooked_blocks' ) ) {
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
// that are not present in Gutenberg's WP 6.5 compatibility layer.
if ( function_exists( 'get_hooked_block_markup' ) ) {
add_action( 'rest_insert_wp_navigation', 'block_core_navigation_update_ignore_hooked_blocks_meta', 10, 3 );
}
@@ -1454,8 +1450,8 @@ function block_core_navigation_insert_hooked_blocks_into_rest_response( $respons
return $response;
}
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.4
// that are not present in Gutenberg's WP 6.4 compatibility layer.
if ( function_exists( 'get_hooked_blocks' ) ) {
// Injection of hooked blocks into the Navigation block relies on some functions present in WP >= 6.5
// that are not present in Gutenberg's WP 6.5 compatibility layer.
if ( function_exists( 'get_hooked_block_markup' ) ) {
add_filter( 'rest_prepare_wp_navigation', 'block_core_navigation_insert_hooked_blocks_into_rest_response', 10, 3 );
}
+2
View File
@@ -22,6 +22,8 @@ function register_block_core_pattern() {
*
* @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper.
*
* @global WP_Embed $wp_embed Used to process embedded content within patterns
*
* @param array $attributes Block attributes.
*
* @return string Returns the output of the pattern.
@@ -102,12 +102,12 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
$in_same_term = isset( $attributes['inSameTerm'] ) ? $attributes['inSameTerm'] : false;
$taxonomy = isset( $attributes['taxonomy'] ) && $in_same_term ? $attributes['taxonomy'] : '';
/**
/*
* The dynamic portion of the function name, `$navigation_type`,
* Refers to the type of adjacency, 'next' or 'previous'.
*
* @See https://developer.wordpress.org/reference/functions/get_previous_post_link/
* @See https://developer.wordpress.org/reference/functions/get_next_post_link/
* @see https://developer.wordpress.org/reference/functions/get_previous_post_link/
* @see https://developer.wordpress.org/reference/functions/get_next_post_link/
*/
$get_link_function = "get_{$navigation_type}_post_link";
+26
View File
@@ -0,0 +1,26 @@
<?php
/**
* Interactivity API: Functions and hooks
*
* @package WordPress
* @subpackage Interactivity API
*/
/**
* Registers the interactivity modules.
*/
function wp_interactivity_register_script_modules() {
wp_register_script_module(
'@wordpress/interactivity',
includes_url( '/js/dist/interactivity.min.js' ),
array()
);
wp_register_script_module(
'@wordpress/interactivity-router',
includes_url( '/js/dist/interactivity-router.min.js' ),
array( '@wordpress/interactivity' )
);
}
add_action( 'init', 'wp_interactivity_register_script_modules' );
+1
View File
@@ -376,6 +376,7 @@ require ABSPATH . WPINC . '/fonts/class-wp-font-face.php';
require ABSPATH . WPINC . '/fonts.php';
require ABSPATH . WPINC . '/class-wp-script-modules.php';
require ABSPATH . WPINC . '/script-modules.php';
require ABSPATH . WPINC . '/interactivity-api.php';
$GLOBALS['wp_embed'] = new WP_Embed();