diff --git a/docs/getting-started/devenv/README.md b/docs/getting-started/devenv/README.md index c891490437d431..47113c84d78dac 100644 --- a/docs/getting-started/devenv/README.md +++ b/docs/getting-started/devenv/README.md @@ -48,3 +48,10 @@ Refer to the [Get started with `wp-env`](/docs/getting-started/devenv/get-starte
wp-now
. This is a lightweight tool powered by WordPress Playground that streamlines setting up a simple local WordPress environment. While still experimental, this tool is great for quickly testing WordPress releases, plugins, and themes.
preformatted
core blocksave
function of the preformatted
core block...
+
+```js
+import { RichText, useBlockProps } from '@wordpress/block-editor';
+
+export default function save( { attributes } ) {
+ const { content } = attributes;
+
+ return (
+ ++ ); +} +``` + +...generates the following markup representation of the block when `attributes.content` has the value `"This is some preformatted text"`... + +```html + ++
This is some preformatted text+ +``` + +...and it will return the following markup for the block to the front end when there's a request. + +```html +
This is some preformatted text+``` + +
render_block
or via $render_callback
.
+site-title
core blockhttp://localhost:8888
. Log into the WordPress dashboard using username `admin` and password `password`. The plugin will already be installed and activated. Open the Editor or Site Editor, and insert the Copyright Date Block as you would any other block.
Visit the [Getting started](https://developer.wordpress.org/block-editor/getting-started/devenv/get-started-with-wp-env/) guide to learn more about `wp-env`.
diff --git a/docs/manifest.json b/docs/manifest.json
index 5629675c0b57e3..67b8fac99f7137 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -95,6 +95,12 @@
"markdown_source": "../docs/getting-started/fundamentals/markup-representation-block.md",
"parent": "fundamentals"
},
+ {
+ "title": "Static or Dynamic rendering of a block",
+ "slug": "static-dynamic-rendering",
+ "markdown_source": "../docs/getting-started/fundamentals/static-dynamic-rendering.md",
+ "parent": "fundamentals"
+ },
{
"title": "Working with Javascript for the Block Editor",
"slug": "javascript-in-the-block-editor",
diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md
index 38a93552bcbef2..7b0bd386daaf48 100644
--- a/docs/reference-guides/data/data-core-block-editor.md
+++ b/docs/reference-guides/data/data-core-block-editor.md
@@ -588,18 +588,6 @@ _Properties_
- _isDisabled_ `boolean`: Whether or not the user should be prevented from inserting this item.
- _frecency_ `number`: Heuristic that combines frequency and recency.
-### getLastFocus
-
-Returns the element of the last element that had focus when focus left the editor canvas.
-
-_Parameters_
-
-- _state_ `Object`: Block editor state.
-
-_Returns_
-
-- `Object`: Element.
-
### getLastMultiSelectedBlockClientId
Returns the client ID of the last block in the multi-selection set, or null if there is no multi-selection.
@@ -1663,18 +1651,6 @@ _Parameters_
- _clientId_ `string`: The block's clientId.
- _hasControlledInnerBlocks_ `boolean`: True if the block's inner blocks are controlled.
-### setLastFocus
-
-Action that sets the element that had focus when focus leaves the editor canvas.
-
-_Parameters_
-
-- _lastFocus_ `Object`: The last focused element.
-
-_Returns_
-
-- `Object`: Action object.
-
### setNavigationMode
Action that enables or disables the navigation mode.
diff --git a/docs/toc.json b/docs/toc.json
index 49110f8bed9579..849de991c78080 100644
--- a/docs/toc.json
+++ b/docs/toc.json
@@ -42,6 +42,9 @@
{
"docs/getting-started/fundamentals/markup-representation-block.md": []
},
+ {
+ "docs/getting-started/fundamentals/static-dynamic-rendering.md": []
+ },
{
"docs/getting-started/fundamentals/javascript-in-the-block-editor.md": []
}
diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php
index af750fa0599795..aa8de83df9597b 100644
--- a/lib/class-wp-theme-json-gutenberg.php
+++ b/lib/class-wp-theme-json-gutenberg.php
@@ -1021,8 +1021,7 @@ protected static function get_blocks_metadata() {
if ( ! empty( $block_type->styles ) ) {
$style_selectors = array();
foreach ( $block_type->styles as $style ) {
- // The style variation classname is duplicated in the selector to ensure that it overrides core block styles.
- $style_selectors[ $style['name'] ] = static::append_to_selector( '.is-style-' . $style['name'] . '.is-style-' . $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
+ $style_selectors[ $style['name'] ] = static::append_to_selector( '.is-style-' . $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
}
static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
}
diff --git a/lib/experimental/blocks.php b/lib/experimental/blocks.php
index 88e46b478389d2..d4bb6c9b4586eb 100644
--- a/lib/experimental/blocks.php
+++ b/lib/experimental/blocks.php
@@ -150,7 +150,7 @@ function gutenberg_render_block_connections( $block_content, $block, $block_inst
continue;
}
- $custom_value = $connection_sources[ $attribute_value['source'] ]( $block_instance );
+ $custom_value = $connection_sources[ $attribute_value['source'] ]( $block_instance, $attribute_name );
} else {
// If the attribute does not specify the name of the custom field, skip it.
if ( ! isset( $attribute_value['value'] ) ) {
diff --git a/lib/experimental/connection-sources/index.php b/lib/experimental/connection-sources/index.php
index bf89ba177b6e94..4f9e06cb13b945 100644
--- a/lib/experimental/connection-sources/index.php
+++ b/lib/experimental/connection-sources/index.php
@@ -12,8 +12,12 @@
// if it doesn't, `get_post_meta()` will just return an empty string.
return get_post_meta( $block_instance->context['postId'], $meta_field, true );
},
- 'pattern_attributes' => function ( $block_instance ) {
+ 'pattern_attributes' => function ( $block_instance, $attribute_name ) {
$block_id = $block_instance->attributes['metadata']['id'];
- return _wp_array_get( $block_instance->context, array( 'pattern/overrides', $block_id ), false );
+ return _wp_array_get(
+ $block_instance->context,
+ array( 'pattern/overrides', $block_id, $attribute_name ),
+ false
+ );
},
);
diff --git a/lib/experimental/fonts/font-library/class-wp-font-family.php b/lib/experimental/fonts/font-library/class-wp-font-family.php
index a4204dfe1fa2c7..e47cf0afdac1de 100644
--- a/lib/experimental/fonts/font-library/class-wp-font-family.php
+++ b/lib/experimental/fonts/font-library/class-wp-font-family.php
@@ -599,9 +599,9 @@ private function create_or_update_font_post() {
*/
public function install( $files = null ) {
add_filter( 'upload_mimes', array( 'WP_Font_Library', 'set_allowed_mime_types' ) );
- add_filter( 'upload_dir', array( 'WP_Font_Library', 'set_upload_dir' ) );
+ add_filter( 'upload_dir', array( 'WP_Font_Library', 'fonts_dir' ) );
$were_assets_written = $this->download_or_move_font_faces( $files );
- remove_filter( 'upload_dir', array( 'WP_Font_Library', 'set_upload_dir' ) );
+ remove_filter( 'upload_dir', array( 'WP_Font_Library', 'fonts_dir' ) );
remove_filter( 'upload_mimes', array( 'WP_Font_Library', 'set_allowed_mime_types' ) );
if ( ! $were_assets_written ) {
diff --git a/lib/experimental/fonts/font-library/class-wp-font-library.php b/lib/experimental/fonts/font-library/class-wp-font-library.php
index 9320a554e510c7..99de81e0bd74a3 100644
--- a/lib/experimental/fonts/font-library/class-wp-font-library.php
+++ b/lib/experimental/fonts/font-library/class-wp-font-library.php
@@ -63,15 +63,57 @@ public static function get_expected_font_mime_types_per_php_version( $php_versio
*/
public static function register_font_collection( $config ) {
$new_collection = new WP_Font_Collection( $config );
-
- if ( isset( self::$collections[ $config['id'] ] ) ) {
- return new WP_Error( 'font_collection_registration_error', 'Font collection already registered.' );
+ if ( self::is_collection_registered( $config['id'] ) ) {
+ $error_message = sprintf(
+ /* translators: %s: Font collection id. */
+ __( 'Font collection with id: "%s" is already registered.', 'default' ),
+ $config['id']
+ );
+ _doing_it_wrong(
+ __METHOD__,
+ $error_message,
+ '6.5.0'
+ );
+ return new WP_Error( 'font_collection_registration_error', $error_message );
}
-
self::$collections[ $config['id'] ] = $new_collection;
return $new_collection;
}
+ /**
+ * Unregisters a previously registered font collection.
+ *
+ * @since 6.5.0
+ *
+ * @param string $collection_id Font collection ID.
+ * @return bool True if the font collection was unregistered successfully and false otherwise.
+ */
+ public static function unregister_font_collection( $collection_id ) {
+ if ( ! self::is_collection_registered( $collection_id ) ) {
+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: %s: Font collection id. */
+ sprintf( __( 'Font collection "%s" not found.', 'default' ), $collection_id ),
+ '6.5.0'
+ );
+ return false;
+ }
+ unset( self::$collections[ $collection_id ] );
+ return true;
+ }
+
+ /**
+ * Checks if a font collection is registered.
+ *
+ * @since 6.5.0
+ *
+ * @param string $collection_id Font collection ID.
+ * @return bool True if the font collection is registered and false otherwise.
+ */
+ private static function is_collection_registered( $collection_id ) {
+ return array_key_exists( $collection_id, self::$collections );
+ }
+
/**
* Gets all the font collections available.
*
@@ -99,40 +141,72 @@ public static function get_font_collection( $id ) {
}
/**
- * Gets the upload directory for fonts.
+ * Returns an array containing the current fonts upload directory's path and URL.
*
* @since 6.5.0
*
- * @return string Path of the upload directory for fonts.
+ * @param array $defaults {
+ * Array of information about the upload directory.
+ *
+ * @type string $path Base directory and subdirectory or full path to the fonts upload directory.
+ * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory.
+ * @type string $subdir Subdirectory
+ * @type string $basedir Path without subdir.
+ * @type string $baseurl URL path without subdir.
+ * @type string|false $error False or error message.
+ * }
+ *
+ * @return array $defaults {
+ * Array of information about the upload directory.
+ *
+ * @type string $path Base directory and subdirectory or full path to the fonts upload directory.
+ * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory.
+ * @type string $subdir Subdirectory
+ * @type string $basedir Path without subdir.
+ * @type string $baseurl URL path without subdir.
+ * @type string|false $error False or error message.
+ * }
*/
- public static function get_fonts_dir() {
- return path_join( WP_CONTENT_DIR, 'fonts' );
+ public static function fonts_dir( $defaults = array() ) {
+ $site_path = self::get_multi_site_dir();
+
+ // Sets the defaults.
+ $defaults['path'] = path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path;
+ $defaults['url'] = untrailingslashit( content_url( 'fonts' ) ) . $site_path;
+ $defaults['subdir'] = '';
+ $defaults['basedir'] = path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path;
+ $defaults['baseurl'] = untrailingslashit( content_url( 'fonts' ) ) . $site_path;
+ $defaults['error'] = false;
+
+ // Filters the fonts directory data.
+ return apply_filters( 'fonts_dir', $defaults );
}
/**
- * Sets the upload directory for fonts.
+ * Gets the Site dir for fonts, using the blog ID if multi-site, empty otherwise.
*
* @since 6.5.0
*
- * @param array $defaults {
- * Default upload directory.
+ * @return string Site dir path.
+ */
+ private static function get_multi_site_dir() {
+ $font_sub_dir = '';
+ if ( is_multisite() && ! ( is_main_network() && is_main_site() ) ) {
+ $font_sub_dir = '/sites/' . get_current_blog_id();
+ }
+ return $font_sub_dir;
+ }
+
+ /**
+ * Gets the upload directory for fonts.
*
- * @type string $path Path to the directory.
- * @type string $url URL for the directory.
- * @type string $subdir Sub-directory of the directory.
- * @type string $basedir Base directory.
- * @type string $baseurl Base URL.
- * }
- * @return array Modified upload directory.
+ * @since 6.5.0
+ *
+ * @return string Path of the upload directory for fonts.
*/
- public static function set_upload_dir( $defaults ) {
- $defaults['basedir'] = WP_CONTENT_DIR;
- $defaults['baseurl'] = content_url();
- $defaults['subdir'] = '/fonts';
- $defaults['path'] = self::get_fonts_dir();
- $defaults['url'] = $defaults['baseurl'] . '/fonts';
-
- return $defaults;
+ public static function get_fonts_dir() {
+ $fonts_dir_settings = self::fonts_dir();
+ return $fonts_dir_settings['path'];
}
/**
diff --git a/lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php b/lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
index c92a0d2697f315..0147d80b7bde94 100644
--- a/lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
+++ b/lib/experimental/fonts/font-library/class-wp-rest-font-families-controller.php
@@ -44,8 +44,7 @@ public function register_routes() {
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
- 'permission_callback' => function () {
- return true;},
+ 'permission_callback' => array( $this, 'update_font_library_permissions_check' ),
),
)
);
@@ -59,7 +58,7 @@ public function register_routes() {
'callback' => array( $this, 'install_fonts' ),
'permission_callback' => array( $this, 'update_font_library_permissions_check' ),
'args' => array(
- 'font_families' => array(
+ 'font_family_settings' => array(
'required' => true,
'type' => 'string',
'validate_callback' => array( $this, 'validate_install_font_families' ),
@@ -92,85 +91,61 @@ public function register_routes() {
* @param array $files Files to install.
* @return array $error_messages Array of error messages.
*/
- private function get_validation_errors( $font_families, $files ) {
+ private function get_validation_errors( $font_family_settings, $files ) {
$error_messages = array();
- if ( ! is_array( $font_families ) ) {
- $error_messages[] = __( 'font_families should be an array of font families.', 'gutenberg' );
+ if ( ! is_array( $font_family_settings ) ) {
+ $error_messages[] = __( 'font_family_settings should be a font family definition.', 'gutenberg' );
return $error_messages;
}
- // Checks if there is at least one font family.
- if ( count( $font_families ) < 1 ) {
- $error_messages[] = __( 'font_families should have at least one font family definition.', 'gutenberg' );
+ if (
+ ! isset( $font_family_settings['slug'] ) ||
+ ! isset( $font_family_settings['name'] ) ||
+ ! isset( $font_family_settings['fontFamily'] )
+ ) {
+ $error_messages[] = __( 'Font family should have slug, name and fontFamily properties defined.', 'gutenberg' );
+
return $error_messages;
}
- for ( $family_index = 0; $family_index < count( $font_families ); $family_index++ ) {
- $font_family = $font_families[ $family_index ];
-
- if (
- ! isset( $font_family['slug'] ) ||
- ! isset( $font_family['name'] ) ||
- ! isset( $font_family['fontFamily'] )
- ) {
- $error_messages[] = sprintf(
- // translators: 1: font family index.
- __( 'Font family [%s] should have slug, name and fontFamily properties defined.', 'gutenberg' ),
- $family_index
- );
+ if ( isset( $font_family_settings['fontFace'] ) ) {
+ if ( ! is_array( $font_family_settings['fontFace'] ) ) {
+ $error_messages[] = __( 'Font family should have fontFace property defined as an array.', 'gutenberg' );
}
- if ( isset( $font_family['fontFace'] ) ) {
- if ( ! is_array( $font_family['fontFace'] ) ) {
- $error_messages[] = sprintf(
- // translators: 1: font family index.
- __( 'Font family [%s] should have fontFace property defined as an array.', 'gutenberg' ),
- $family_index
- );
- continue;
- }
+ if ( count( $font_family_settings['fontFace'] ) < 1 ) {
+ $error_messages[] = __( 'Font family should have at least one font face definition.', 'gutenberg' );
+ }
- if ( count( $font_family['fontFace'] ) < 1 ) {
- $error_messages[] = sprintf(
- // translators: 1: font family index.
- __( 'Font family [%s] should have at least one font face definition.', 'gutenberg' ),
- $family_index
- );
- }
+ if ( ! empty( $font_family_settings['fontFace'] ) ) {
+ for ( $face_index = 0; $face_index < count( $font_family_settings['fontFace'] ); $face_index++ ) {
- if ( ! empty( $font_family['fontFace'] ) ) {
- for ( $face_index = 0; $face_index < count( $font_family['fontFace'] ); $face_index++ ) {
+ $font_face = $font_family_settings['fontFace'][ $face_index ];
+ if ( ! isset( $font_face['fontWeight'] ) || ! isset( $font_face['fontStyle'] ) ) {
+ $error_messages[] = sprintf(
+ // translators: font face index.
+ __( 'Font family Font face [%1$s] should have fontWeight and fontStyle properties defined.', 'gutenberg' ),
+ $face_index
+ );
+ }
- $font_face = $font_family['fontFace'][ $face_index ];
- if ( ! isset( $font_face['fontWeight'] ) || ! isset( $font_face['fontStyle'] ) ) {
- $error_messages[] = sprintf(
- // translators: 1: font family index, 2: font face index.
- __( 'Font family [%1$s] Font face [%2$s] should have fontWeight and fontStyle properties defined.', 'gutenberg' ),
- $family_index,
- $face_index
- );
- }
+ if ( isset( $font_face['downloadFromUrl'] ) && isset( $font_face['uploadedFile'] ) ) {
+ $error_messages[] = sprintf(
+ // translators: font face index.
+ __( 'Font family Font face [%1$s] should have only one of the downloadFromUrl or uploadedFile properties defined and not both.', 'gutenberg' ),
+ $face_index
+ );
+ }
- if ( isset( $font_face['downloadFromUrl'] ) && isset( $font_face['uploadedFile'] ) ) {
+ if ( isset( $font_face['uploadedFile'] ) ) {
+ if ( ! isset( $files[ $font_face['uploadedFile'] ] ) ) {
$error_messages[] = sprintf(
- // translators: 1: font family index, 2: font face index.
- __( 'Font family [%1$s] Font face [%2$s] should have only one of the downloadFromUrl or uploadedFile properties defined and not both.', 'gutenberg' ),
- $family_index,
+ // translators: font face index.
+ __( 'Font family Font face [%1$s] file is not defined in the request files.', 'gutenberg' ),
$face_index
);
}
-
- if ( isset( $font_face['uploadedFile'] ) ) {
- if ( ! isset( $files[ $font_face['uploadedFile'] ] ) ) {
- $error_messages[] = sprintf(
- // translators: 1: font family index, 2: font face index.
- __( 'Font family [%1$s] Font face [%2$s] file is not defined in the request files.', 'gutenberg' ),
- $family_index,
- $face_index
- );
- }
- }
}
}
}
@@ -189,9 +164,9 @@ private function get_validation_errors( $font_families, $files ) {
* @return true|WP_Error True if the parameter is valid, WP_Error otherwise.
*/
public function validate_install_font_families( $param, $request ) {
- $font_families = json_decode( $param, true );
- $files = $request->get_file_params();
- $error_messages = $this->get_validation_errors( $font_families, $files );
+ $font_family_settings = json_decode( $param, true );
+ $files = $request->get_file_params();
+ $error_messages = $this->get_validation_errors( $font_family_settings, $files );
if ( empty( $error_messages ) ) {
return true;
@@ -327,17 +302,15 @@ private function has_write_permission() {
*
* @since 6.5.0
*
- * @param array[] $font_families Font families to install.
+ * @param array[] $font_family_settings Font family definition.
* @return bool Whether the request needs write permissions.
*/
- private function needs_write_permission( $font_families ) {
- foreach ( $font_families as $font ) {
- if ( isset( $font['fontFace'] ) ) {
- foreach ( $font['fontFace'] as $face ) {
- // If the font is being downloaded from a URL or uploaded, it needs write permissions.
- if ( isset( $face['downloadFromUrl'] ) || isset( $face['uploadedFile'] ) ) {
- return true;
- }
+ private function needs_write_permission( $font_family_settings ) {
+ if ( isset( $font_family_settings['fontFace'] ) ) {
+ foreach ( $font_family_settings['fontFace'] as $face ) {
+ // If the font is being downloaded from a URL or uploaded, it needs write permissions.
+ if ( isset( $face['downloadFromUrl'] ) || isset( $face['uploadedFile'] ) ) {
+ return true;
}
}
}
@@ -358,20 +331,20 @@ private function needs_write_permission( $font_families ) {
*/
public function install_fonts( $request ) {
// Get new fonts to install.
- $fonts_param = $request->get_param( 'font_families' );
+ $font_family_settings = $request->get_param( 'font_family_settings' );
/*
* As this is receiving form data, the font families are encoded as a string.
* The form data is used because local fonts need to use that format to
* attach the files in the request.
*/
- $fonts_to_install = json_decode( $fonts_param, true );
+ $font_family_settings = json_decode( $font_family_settings, true );
$successes = array();
$errors = array();
$response_status = 200;
- if ( empty( $fonts_to_install ) ) {
+ if ( empty( $font_family_settings ) ) {
$errors[] = new WP_Error(
'no_fonts_to_install',
__( 'No fonts to install', 'gutenberg' )
@@ -379,7 +352,7 @@ public function install_fonts( $request ) {
$response_status = 400;
}
- if ( $this->needs_write_permission( $fonts_to_install ) ) {
+ if ( $this->needs_write_permission( $font_family_settings ) ) {
$upload_dir = WP_Font_Library::get_fonts_dir();
if ( ! $this->has_upload_directory() ) {
if ( ! wp_mkdir_p( $upload_dir ) ) {
@@ -415,15 +388,13 @@ public function install_fonts( $request ) {
}
// Get uploaded files (used when installing local fonts).
- $files = $request->get_file_params();
- foreach ( $fonts_to_install as $font_data ) {
- $font = new WP_Font_Family( $font_data );
- $result = $font->install( $files );
- if ( is_wp_error( $result ) ) {
- $errors[] = $result;
- } else {
- $successes[] = $result;
- }
+ $files = $request->get_file_params();
+ $font = new WP_Font_Family( $font_family_settings );
+ $result = $font->install( $files );
+ if ( is_wp_error( $result ) ) {
+ $errors[] = $result;
+ } else {
+ $successes[] = $result;
}
$data = array(
diff --git a/lib/experimental/fonts/font-library/font-library.php b/lib/experimental/fonts/font-library/font-library.php
index 709f63e9126cbc..711a6bb40c282b 100644
--- a/lib/experimental/fonts/font-library/font-library.php
+++ b/lib/experimental/fonts/font-library/font-library.php
@@ -60,6 +60,19 @@ function wp_register_font_collection( $config ) {
}
}
+if ( ! function_exists( 'wp_unregister_font_collection' ) ) {
+ /**
+ * Unregisters a font collection from the Font Library.
+ *
+ * @since 6.5.0
+ *
+ * @param string $collection_id The font collection ID.
+ */
+ function wp_unregister_font_collection( $collection_id ) {
+ WP_Font_Library::unregister_font_collection( $collection_id );
+ }
+
+}
$default_font_collection = array(
'id' => 'default-font-collection',
diff --git a/lib/experimental/interactivity-api/class-wp-directive-processor.php b/lib/experimental/interactivity-api/class-wp-directive-processor.php
index bb70068aa9482b..3b8a38f973815d 100644
--- a/lib/experimental/interactivity-api/class-wp-directive-processor.php
+++ b/lib/experimental/interactivity-api/class-wp-directive-processor.php
@@ -35,7 +35,11 @@ class WP_Directive_Processor extends Gutenberg_HTML_Tag_Processor_6_5 {
* @param array $block The block to add.
*/
public static function mark_root_block( $block ) {
- self::$root_block = md5( serialize( $block ) );
+ if ( null !== $block['blockName'] ) {
+ self::$root_block = $block['blockName'] . md5( serialize( $block ) );
+ } else {
+ self::$root_block = md5( serialize( $block ) );
+ }
}
/**
@@ -52,6 +56,14 @@ public static function unmark_root_block() {
* @return bool True if block is a root block, false otherwise.
*/
public static function is_marked_as_root_block( $block ) {
+ // If self::$root_block is null, is impossible that any block has been marked as root.
+ if ( is_null( self::$root_block ) ) {
+ return false;
+ }
+ // Blocks whose blockName is null are specifically intended to convey - "this is a freeform HTML block."
+ if ( null !== $block['blockName'] ) {
+ return str_contains( self::$root_block, $block['blockName'] ) && $block['blockName'] . md5( serialize( $block ) ) === self::$root_block;
+ }
return md5( serialize( $block ) ) === self::$root_block;
}
@@ -256,4 +268,43 @@ public static function is_html_void_element( $tag_name ) {
public static function parse_attribute_name( $name ) {
return explode( '--', $name, 2 );
}
+
+ /**
+ * Parse and extract the namespace and path from the given value.
+ *
+ * If the value contains a JSON instead of a path, the function parses it
+ * and returns the resulting array.
+ *
+ * @param string $value Passed value.
+ * @param string $ns Namespace fallback.
+ * @return array The resulting array
+ */
+ public static function parse_attribute_value( $value, $ns = null ) {
+ $matches = array();
+ $has_ns = preg_match( '/^([\w\-_\/]+)::(.+)$/', $value, $matches );
+
+ /*
+ * Overwrite both `$ns` and `$value` variables if `$value` explicitly
+ * contains a namespace.
+ */
+ if ( $has_ns ) {
+ list( , $ns, $value ) = $matches;
+ }
+
+ /*
+ * Try to decode `$value` as a JSON object. If it works, `$value` is
+ * replaced with the resulting array. The original string is preserved
+ * otherwise.
+ *
+ * Note that `json_decode` returns `null` both for an invalid JSON or
+ * the `'null'` string (a valid JSON). In the latter case, `$value` is
+ * replaced with `null`.
+ */
+ $data = json_decode( $value, true );
+ if ( null !== $data || 'null' === trim( $value ) ) {
+ $value = $data;
+ }
+
+ return array( $ns, $value );
+ }
}
diff --git a/lib/experimental/interactivity-api/class-wp-interactivity-initial-state.php b/lib/experimental/interactivity-api/class-wp-interactivity-initial-state.php
new file mode 100644
index 00000000000000..15e57edfa4a6a2
--- /dev/null
+++ b/lib/experimental/interactivity-api/class-wp-interactivity-initial-state.php
@@ -0,0 +1,82 @@
+%s',
+ wp_json_encode( self::$initial_state, JSON_HEX_TAG | JSON_HEX_AMP )
+ );
+ }
+}
diff --git a/lib/experimental/interactivity-api/class-wp-interactivity-store.php b/lib/experimental/interactivity-api/class-wp-interactivity-store.php
deleted file mode 100644
index c53701b14e8aff..00000000000000
--- a/lib/experimental/interactivity-api/class-wp-interactivity-store.php
+++ /dev/null
@@ -1,69 +0,0 @@
-%s',
- wp_json_encode( self::$store, JSON_HEX_TAG | JSON_HEX_AMP )
- );
- }
-}
diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php
index 075d31d577634c..b49ee538390ff1 100644
--- a/lib/experimental/interactivity-api/directive-processing.php
+++ b/lib/experimental/interactivity-api/directive-processing.php
@@ -43,12 +43,13 @@ function gutenberg_process_directives_in_root_blocks( $block_content, $block ) {
$parsed_blocks = parse_blocks( $block_content );
$context = new WP_Directive_Context();
$processed_content = '';
+ $namespace_stack = array();
foreach ( $parsed_blocks as $parsed_block ) {
if ( 'core/interactivity-wrapper' === $parsed_block['blockName'] ) {
- $processed_content .= gutenberg_process_interactive_block( $parsed_block, $context );
+ $processed_content .= gutenberg_process_interactive_block( $parsed_block, $context, $namespace_stack );
} elseif ( 'core/non-interactivity-wrapper' === $parsed_block['blockName'] ) {
- $processed_content .= gutenberg_process_non_interactive_block( $parsed_block, $context );
+ $processed_content .= gutenberg_process_non_interactive_block( $parsed_block, $context, $namespace_stack );
} else {
$processed_content .= $parsed_block['innerHTML'];
}
@@ -118,10 +119,11 @@ function gutenberg_mark_block_interactivity( $block_content, $block, $block_inst
*
* @param array $interactive_block The interactive block to process.
* @param WP_Directive_Context $context The context to use when processing.
+ * @param array $namespace_stack Stack of namespackes passed by reference.
*
* @return string The processed HTML.
*/
-function gutenberg_process_interactive_block( $interactive_block, $context ) {
+function gutenberg_process_interactive_block( $interactive_block, $context, &$namespace_stack ) {
$block_index = 0;
$content = '';
$interactive_inner_blocks = array();
@@ -137,7 +139,7 @@ function gutenberg_process_interactive_block( $interactive_block, $context ) {
}
}
- return gutenberg_process_interactive_html( $content, $context, $interactive_inner_blocks );
+ return gutenberg_process_interactive_html( $content, $context, $interactive_inner_blocks, $namespace_stack );
}
/**
@@ -147,10 +149,11 @@ function gutenberg_process_interactive_block( $interactive_block, $context ) {
*
* @param array $non_interactive_block The non-interactive block to process.
* @param WP_Directive_Context $context The context to use when processing.
+ * @param array $namespace_stack Stack of namespackes passed by reference.
*
* @return string The processed HTML.
*/
-function gutenberg_process_non_interactive_block( $non_interactive_block, $context ) {
+function gutenberg_process_non_interactive_block( $non_interactive_block, $context, &$namespace_stack ) {
$block_index = 0;
$content = '';
foreach ( $non_interactive_block['innerContent'] as $inner_content ) {
@@ -164,9 +167,9 @@ function gutenberg_process_non_interactive_block( $non_interactive_block, $conte
$inner_block = $non_interactive_block['innerBlocks'][ $block_index++ ];
if ( 'core/interactivity-wrapper' === $inner_block['blockName'] ) {
- $content .= gutenberg_process_interactive_block( $inner_block, $context );
+ $content .= gutenberg_process_interactive_block( $inner_block, $context, $namespace_stack );
} elseif ( 'core/non-interactivity-wrapper' === $inner_block['blockName'] ) {
- $content .= gutenberg_process_non_interactive_block( $inner_block, $context );
+ $content .= gutenberg_process_non_interactive_block( $inner_block, $context, $namespace_stack );
}
}
}
@@ -184,16 +187,18 @@ function gutenberg_process_non_interactive_block( $non_interactive_block, $conte
* @param string $html The HTML to process.
* @param mixed $context The context to use when processing.
* @param array $inner_blocks The inner blocks to process.
+ * @param array $namespace_stack Stack of namespackes passed by reference.
*
* @return string The processed HTML.
*/
-function gutenberg_process_interactive_html( $html, $context, $inner_blocks = array() ) {
+function gutenberg_process_interactive_html( $html, $context, $inner_blocks = array(), &$namespace_stack = array() ) {
static $directives = array(
- 'data-wp-context' => 'gutenberg_interactivity_process_wp_context',
- 'data-wp-bind' => 'gutenberg_interactivity_process_wp_bind',
- 'data-wp-class' => 'gutenberg_interactivity_process_wp_class',
- 'data-wp-style' => 'gutenberg_interactivity_process_wp_style',
- 'data-wp-text' => 'gutenberg_interactivity_process_wp_text',
+ 'data-wp-interactive' => 'gutenberg_interactivity_process_wp_interactive',
+ 'data-wp-context' => 'gutenberg_interactivity_process_wp_context',
+ 'data-wp-bind' => 'gutenberg_interactivity_process_wp_bind',
+ 'data-wp-class' => 'gutenberg_interactivity_process_wp_class',
+ 'data-wp-style' => 'gutenberg_interactivity_process_wp_style',
+ 'data-wp-text' => 'gutenberg_interactivity_process_wp_text',
);
$tags = new WP_Directive_Processor( $html );
@@ -207,9 +212,9 @@ function gutenberg_process_interactive_html( $html, $context, $inner_blocks = ar
// Processes the inner blocks.
if ( str_contains( $tag_name, 'WP-INNER-BLOCKS' ) && ! empty( $inner_blocks ) && ! $tags->is_tag_closer() ) {
if ( 'core/interactivity-wrapper' === $inner_blocks[ $inner_blocks_index ]['blockName'] ) {
- $inner_processed_blocks[ strtolower( $tag_name ) ] = gutenberg_process_interactive_block( $inner_blocks[ $inner_blocks_index++ ], $context );
+ $inner_processed_blocks[ strtolower( $tag_name ) ] = gutenberg_process_interactive_block( $inner_blocks[ $inner_blocks_index++ ], $context, $namespace_stack );
} elseif ( 'core/non-interactivity-wrapper' === $inner_blocks[ $inner_blocks_index ]['blockName'] ) {
- $inner_processed_blocks[ strtolower( $tag_name ) ] = gutenberg_process_non_interactive_block( $inner_blocks[ $inner_blocks_index++ ], $context );
+ $inner_processed_blocks[ strtolower( $tag_name ) ] = gutenberg_process_non_interactive_block( $inner_blocks[ $inner_blocks_index++ ], $context, $namespace_stack );
}
}
if ( $tags->is_tag_closer() ) {
@@ -270,7 +275,15 @@ function gutenberg_process_interactive_html( $html, $context, $inner_blocks = ar
);
foreach ( $sorted_attrs as $attribute ) {
- call_user_func( $directives[ $attribute ], $tags, $context );
+ call_user_func_array(
+ $directives[ $attribute ],
+ array(
+ $tags,
+ $context,
+ end( $namespace_stack ),
+ &$namespace_stack,
+ )
+ );
}
}
@@ -290,17 +303,25 @@ function gutenberg_process_interactive_html( $html, $context, $inner_blocks = ar
}
/**
- * Resolves the reference using the store and the context from the provided
- * path.
+ * Resolves the passed reference from the store and the context under the given
+ * namespace.
*
- * @param string $path Path.
+ * A reference could be either a single path or a namespace followed by a path,
+ * separated by two colons, i.e, `namespace::path.to.prop`. If the reference
+ * contains a namespace, that namespace overrides the one passed as argument.
+ *
+ * @param string $reference Reference value.
+ * @param string $ns Inherited namespace.
* @param array $context Context data.
- * @return mixed
+ * @return mixed Resolved value.
*/
-function gutenberg_interactivity_evaluate_reference( $path, array $context = array() ) {
- $store = array_merge(
- WP_Interactivity_Store::get_data(),
- array( 'context' => $context )
+function gutenberg_interactivity_evaluate_reference( $reference, $ns, array $context = array() ) {
+ // Extract the namespace from the reference (if present).
+ list( $ns, $path ) = WP_Directive_Processor::parse_attribute_value( $reference, $ns );
+
+ $store = array(
+ 'state' => WP_Interactivity_Initial_State::get_state( $ns ),
+ 'context' => $context[ $ns ] ?? array(),
);
/*
@@ -329,7 +350,12 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr
* E.g., "file" is an string and a "callable" (the "file" function exists).
*/
if ( $current instanceof Closure ) {
- $current = call_user_func( $current, $store );
+ /*
+ * TODO: Figure out a way to implement derived state without having to
+ * pass the store as argument:
+ *
+ * $current = call_user_func( $current );
+ */
}
// Returns the opposite if it has a negator operator (!).
diff --git a/lib/experimental/interactivity-api/directives/wp-bind.php b/lib/experimental/interactivity-api/directives/wp-bind.php
index 54be4a9faeb7d2..57d2e5deb23ab4 100644
--- a/lib/experimental/interactivity-api/directives/wp-bind.php
+++ b/lib/experimental/interactivity-api/directives/wp-bind.php
@@ -11,8 +11,9 @@
*
* @param WP_Directive_Processor $tags Tags.
* @param WP_Directive_Context $context Directive context.
+ * @param string $ns Namespace.
*/
-function gutenberg_interactivity_process_wp_bind( $tags, $context ) {
+function gutenberg_interactivity_process_wp_bind( $tags, $context, $ns ) {
if ( $tags->is_tag_closer() ) {
return;
}
@@ -25,8 +26,8 @@ function gutenberg_interactivity_process_wp_bind( $tags, $context ) {
continue;
}
- $expr = $tags->get_attribute( $attr );
- $value = gutenberg_interactivity_evaluate_reference( $expr, $context->get_context() );
+ $reference = $tags->get_attribute( $attr );
+ $value = gutenberg_interactivity_evaluate_reference( $reference, $ns, $context->get_context() );
$tags->set_attribute( $bound_attr, $value );
}
}
diff --git a/lib/experimental/interactivity-api/directives/wp-class.php b/lib/experimental/interactivity-api/directives/wp-class.php
index 741cc75b42c60e..ef91835be86fc1 100644
--- a/lib/experimental/interactivity-api/directives/wp-class.php
+++ b/lib/experimental/interactivity-api/directives/wp-class.php
@@ -11,8 +11,9 @@
*
* @param WP_Directive_Processor $tags Tags.
* @param WP_Directive_Context $context Directive context.
+ * @param string $ns Namespace.
*/
-function gutenberg_interactivity_process_wp_class( $tags, $context ) {
+function gutenberg_interactivity_process_wp_class( $tags, $context, $ns ) {
if ( $tags->is_tag_closer() ) {
return;
}
@@ -25,8 +26,8 @@ function gutenberg_interactivity_process_wp_class( $tags, $context ) {
continue;
}
- $expr = $tags->get_attribute( $attr );
- $add_class = gutenberg_interactivity_evaluate_reference( $expr, $context->get_context() );
+ $reference = $tags->get_attribute( $attr );
+ $add_class = gutenberg_interactivity_evaluate_reference( $reference, $ns, $context->get_context() );
if ( $add_class ) {
$tags->add_class( $class_name );
} else {
diff --git a/lib/experimental/interactivity-api/directives/wp-context.php b/lib/experimental/interactivity-api/directives/wp-context.php
index 7d92b0ac7b0c67..b41b47c86c78c3 100644
--- a/lib/experimental/interactivity-api/directives/wp-context.php
+++ b/lib/experimental/interactivity-api/directives/wp-context.php
@@ -10,19 +10,21 @@
*
* @param WP_Directive_Processor $tags Tags.
* @param WP_Directive_Context $context Directive context.
+ * @param string $ns Namespace.
*/
-function gutenberg_interactivity_process_wp_context( $tags, $context ) {
+function gutenberg_interactivity_process_wp_context( $tags, $context, $ns ) {
if ( $tags->is_tag_closer() ) {
$context->rewind_context();
return;
}
- $value = $tags->get_attribute( 'data-wp-context' );
+ $attr_value = $tags->get_attribute( 'data-wp-context' );
- $new_context = json_decode(
- is_string( $value ) && ! empty( $value ) ? $value : '{}',
- true
- );
+ //Separate namespace and value from the context directive attribute.
+ list( $ns, $data ) = is_string( $attr_value ) && ! empty( $attr_value )
+ ? WP_Directive_Processor::parse_attribute_value( $attr_value, $ns )
+ : array( $ns, null );
- $context->set_context( $new_context ?? array() );
+ // Add parsed data to the context under the corresponding namespace.
+ $context->set_context( array( $ns => is_array( $data ) ? $data : array() ) );
}
diff --git a/lib/experimental/interactivity-api/directives/wp-interactive.php b/lib/experimental/interactivity-api/directives/wp-interactive.php
new file mode 100644
index 00000000000000..9f3471a8b4e6a9
--- /dev/null
+++ b/lib/experimental/interactivity-api/directives/wp-interactive.php
@@ -0,0 +1,44 @@
+is_tag_closer() ) {
+ array_pop( $ns_stack );
+ return;
+ }
+
+ /*
+ * Decode the data-wp-interactive attribute. In the case it is not a valid
+ * JSON string, NULL is stored in `$island_data`.
+ */
+ $island = $tags->get_attribute( 'data-wp-interactive' );
+ $island_data = is_string( $island ) && ! empty( $island )
+ ? json_decode( $island, true )
+ : null;
+
+ /*
+ * Push the newly defined namespace, or the current one if the island
+ * definition was invalid or does not contain a namespace.
+ *
+ * This is done because the function pops out the current namespace from the
+ * stack whenever it finds an island's closing tag, independently of whether
+ * the island definition was correct or it contained a valid namespace.
+ */
+ $ns_stack[] = isset( $island_data ) && $island_data['namespace']
+ ? $island_data['namespace']
+ : $ns;
+}
diff --git a/lib/experimental/interactivity-api/directives/wp-style.php b/lib/experimental/interactivity-api/directives/wp-style.php
index e5d7b269ace7cf..16432e57282606 100644
--- a/lib/experimental/interactivity-api/directives/wp-style.php
+++ b/lib/experimental/interactivity-api/directives/wp-style.php
@@ -11,8 +11,9 @@
*
* @param WP_Directive_Processor $tags Tags.
* @param WP_Directive_Context $context Directive context.
+ * @param string $ns Namespace.
*/
-function gutenberg_interactivity_process_wp_style( $tags, $context ) {
+function gutenberg_interactivity_process_wp_style( $tags, $context, $ns ) {
if ( $tags->is_tag_closer() ) {
return;
}
@@ -25,8 +26,8 @@ function gutenberg_interactivity_process_wp_style( $tags, $context ) {
continue;
}
- $expr = $tags->get_attribute( $attr );
- $style_value = gutenberg_interactivity_evaluate_reference( $expr, $context->get_context() );
+ $reference = $tags->get_attribute( $attr );
+ $style_value = gutenberg_interactivity_evaluate_reference( $reference, $ns, $context->get_context() );
if ( $style_value ) {
$style_attr = $tags->get_attribute( 'style' ) ?? '';
$style_attr = gutenberg_interactivity_set_style( $style_attr, $style_name, $style_value );
diff --git a/lib/experimental/interactivity-api/directives/wp-text.php b/lib/experimental/interactivity-api/directives/wp-text.php
index b0cfc98a74e702..c4c5bb27a31e10 100644
--- a/lib/experimental/interactivity-api/directives/wp-text.php
+++ b/lib/experimental/interactivity-api/directives/wp-text.php
@@ -11,8 +11,9 @@
*
* @param WP_Directive_Processor $tags Tags.
* @param WP_Directive_Context $context Directive context.
+ * @param string $ns Namespace.
*/
-function gutenberg_interactivity_process_wp_text( $tags, $context ) {
+function gutenberg_interactivity_process_wp_text( $tags, $context, $ns ) {
if ( $tags->is_tag_closer() ) {
return;
}
@@ -22,6 +23,6 @@ function gutenberg_interactivity_process_wp_text( $tags, $context ) {
return;
}
- $text = gutenberg_interactivity_evaluate_reference( $value, $context->get_context() );
+ $text = gutenberg_interactivity_evaluate_reference( $value, $ns, $context->get_context() );
$tags->set_inner_html( esc_html( $text ) );
}
diff --git a/lib/experimental/interactivity-api/initial-state.php b/lib/experimental/interactivity-api/initial-state.php
new file mode 100644
index 00000000000000..a38d0da631f3c4
--- /dev/null
+++ b/lib/experimental/interactivity-api/initial-state.php
@@ -0,0 +1,29 @@
+ gutenberg_url( '/build/modules/importmap-polyfill.min.js' ),
- 'defer' => true,
- )
- );
- }
+ $test = 'HTMLScriptElement.supports && HTMLScriptElement.supports("importmap")';
+ $src = gutenberg_url( '/build/modules/importmap-polyfill.min.js' );
+
+ echo (
+ // Test presence of feature...
+ ''
+ );
}
/**
@@ -273,4 +279,192 @@ function gutenberg_dequeue_module( $module_identifier ) {
add_action( $modules_position, array( 'Gutenberg_Modules', 'print_module_preloads' ) );
// Prints the script that loads the import map polyfill in the footer.
-add_action( 'wp_footer', array( 'Gutenberg_Modules', 'print_import_map_polyfill' ), 11 );
+add_action( 'wp_head', array( 'Gutenberg_Modules', 'print_import_map_polyfill' ), 11 );
+
+/**
+ * Add module fields from block metadata to WP_Block_Type settings.
+ *
+ * This filter allows us to register modules from block metadata and attach additional fields to
+ * WP_Block_Type instances.
+ *
+ * @param array $settings Array of determined settings for registering a block type.
+ * @param array $metadata Metadata provided for registering a block type.
+ */
+function gutenberg_filter_block_type_metadata_settings_register_modules( $settings, $metadata = null ) {
+ $module_fields = array(
+ 'viewModule' => 'view_module_ids',
+ );
+ foreach ( $module_fields as $metadata_field_name => $settings_field_name ) {
+ if ( ! empty( $settings[ $metadata_field_name ] ) ) {
+ $metadata[ $metadata_field_name ] = $settings[ $metadata_field_name ];
+ }
+ if ( ! empty( $metadata[ $metadata_field_name ] ) ) {
+ $modules = $metadata[ $metadata_field_name ];
+ $processed_modules = array();
+ if ( is_array( $modules ) ) {
+ for ( $index = 0; $index < count( $modules ); $index++ ) {
+ $processed_modules[] = gutenberg_register_block_module_id(
+ $metadata,
+ $metadata_field_name,
+ $index
+ );
+ }
+ } else {
+ $processed_modules[] = gutenberg_register_block_module_id(
+ $metadata,
+ $metadata_field_name
+ );
+ }
+ $settings[ $settings_field_name ] = $processed_modules;
+ }
+ }
+
+ return $settings;
+}
+
+add_filter( 'block_type_metadata_settings', 'gutenberg_filter_block_type_metadata_settings_register_modules', 10, 2 );
+
+/**
+ * Enqueue modules associated with the block.
+ *
+ * @param string $block_content The block content.
+ * @param array $block The full block, including name and attributes.
+ * @param WP_Block $instance The block instance.
+ */
+function gutenberg_filter_render_block_enqueue_view_modules( $block_content, $parsed_block, $block_instance ) {
+ $block_type = $block_instance->block_type;
+
+ if ( ! empty( $block_type->view_module_ids ) ) {
+ foreach ( $block_type->view_module_ids as $module_id ) {
+ gutenberg_enqueue_module( $module_id );
+ }
+ }
+
+ return $block_content;
+}
+
+add_filter( 'render_block', 'gutenberg_filter_render_block_enqueue_view_modules', 10, 3 );
+
+/**
+ * Finds a module ID for the selected block metadata field. It detects
+ * when a path to file was provided and finds a corresponding asset file
+ * with details necessary to register the module under an automatically
+ * generated module ID.
+ *
+ * This is analogous to the `register_block_script_handle` in WordPress Core.
+ *
+ * @param array $metadata Block metadata.
+ * @param string $field_name Field name to pick from metadata.
+ * @param int $index Optional. Index of the script to register when multiple items passed.
+ * Default 0.
+ * @return string Module ID.
+ */
+function gutenberg_register_block_module_id( $metadata, $field_name, $index = 0 ) {
+ if ( empty( $metadata[ $field_name ] ) ) {
+ return false;
+ }
+
+ $module_id = $metadata[ $field_name ];
+ if ( is_array( $module_id ) ) {
+ if ( empty( $module_id[ $index ] ) ) {
+ return false;
+ }
+ $module_id = $module_id[ $index ];
+ }
+
+ $module_path = remove_block_asset_path_prefix( $module_id );
+ if ( $module_id === $module_path ) {
+ return $module_id;
+ }
+
+ $path = dirname( $metadata['file'] );
+ $module_asset_raw_path = $path . '/' . substr_replace( $module_path, '.asset.php', - strlen( '.js' ) );
+ $module_id = gutenberg_generate_block_asset_module_id( $metadata['name'], $field_name, $index );
+ $module_asset_path = wp_normalize_path( realpath( $module_asset_raw_path ) );
+
+ if ( empty( $module_asset_path ) ) {
+ _doing_it_wrong(
+ __FUNCTION__,
+ sprintf(
+ // This string is from WordPress Core. See `register_block_script_handle`.
+ // Translators: This is a translation from WordPress Core (default). No need to translate.
+ __( 'The asset file (%1$s) for the "%2$s" defined in "%3$s" block definition is missing.', 'default' ),
+ $module_asset_raw_path,
+ $field_name,
+ $metadata['name']
+ ),
+ '6.5.0'
+ );
+ return false;
+ }
+
+ $module_path_norm = wp_normalize_path( realpath( $path . '/' . $module_path ) );
+ $module_uri = get_block_asset_url( $module_path_norm );
+ $module_asset = require $module_asset_path;
+ $module_dependencies = isset( $module_asset['dependencies'] ) ? $module_asset['dependencies'] : array();
+
+ gutenberg_register_module(
+ $module_id,
+ $module_uri,
+ $module_dependencies,
+ isset( $module_asset['version'] ) ? $module_asset['version'] : false
+ );
+
+ return $module_id;
+}
+
+/**
+ * Generates the module ID for an asset based on the name of the block
+ * and the field name provided.
+ *
+ * This is analogous to the `generate_block_asset_handle` in WordPress Core.
+ *
+ * @param string $block_name Name of the block.
+ * @param string $field_name Name of the metadata field.
+ * @param int $index Optional. Index of the asset when multiple items passed.
+ * Default 0.
+ * @return string Generated module ID for the block's field.
+ */
+function gutenberg_generate_block_asset_module_id( $block_name, $field_name, $index = 0 ) {
+ if ( str_starts_with( $block_name, 'core/' ) ) {
+ $asset_handle = str_replace( 'core/', 'wp-block-', $block_name );
+ if ( str_starts_with( $field_name, 'editor' ) ) {
+ $asset_handle .= '-editor';
+ }
+ if ( str_starts_with( $field_name, 'view' ) ) {
+ $asset_handle .= '-view';
+ }
+ if ( $index > 0 ) {
+ $asset_handle .= '-' . ( $index + 1 );
+ }
+ return $asset_handle;
+ }
+
+ $field_mappings = array(
+ 'viewModule' => 'view-module',
+ );
+ $asset_handle = str_replace( '/', '-', $block_name ) .
+ '-' . $field_mappings[ $field_name ];
+ if ( $index > 0 ) {
+ $asset_handle .= '-' . ( $index + 1 );
+ }
+ return $asset_handle;
+}
+
+function gutenberg_register_view_module_ids_rest_field() {
+ register_rest_field(
+ 'block-type',
+ 'view_module_ids',
+ array(
+ 'get_callback' => function ( $item ) {
+ $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $item['name'] );
+ if ( isset( $block_type->view_module_ids ) ) {
+ return $block_type->view_module_ids;
+ }
+ return array();
+ },
+ )
+ );
+}
+
+add_action( 'rest_api_init', 'gutenberg_register_view_module_ids_rest_field' );
diff --git a/lib/load.php b/lib/load.php
index 1aa55f7581c272..d413334227ee73 100644
--- a/lib/load.php
+++ b/lib/load.php
@@ -117,8 +117,8 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/experimental/disable-tinymce.php';
}
-require __DIR__ . '/experimental/interactivity-api/class-wp-interactivity-store.php';
-require __DIR__ . '/experimental/interactivity-api/store.php';
+require __DIR__ . '/experimental/interactivity-api/class-wp-interactivity-initial-state.php';
+require __DIR__ . '/experimental/interactivity-api/initial-state.php';
require __DIR__ . '/experimental/interactivity-api/modules.php';
require __DIR__ . '/experimental/interactivity-api/class-wp-directive-processor.php';
require __DIR__ . '/experimental/interactivity-api/class-wp-directive-context.php';
@@ -128,6 +128,7 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/experimental/interactivity-api/directives/wp-class.php';
require __DIR__ . '/experimental/interactivity-api/directives/wp-style.php';
require __DIR__ . '/experimental/interactivity-api/directives/wp-text.php';
+require __DIR__ . '/experimental/interactivity-api/directives/wp-interactive.php';
require __DIR__ . '/experimental/modules/class-gutenberg-modules.php';
diff --git a/package-lock.json b/package-lock.json
index 326c7ac7bf80c0..96a14ec8eeb50e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "gutenberg",
- "version": "17.4.1",
+ "version": "17.5.0-rc.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "gutenberg",
- "version": "17.4.1",
+ "version": "17.5.0-rc.1",
"hasInstallScript": true,
"license": "GPL-2.0-or-later",
"dependencies": {
@@ -86,7 +86,7 @@
"devDependencies": {
"@actions/core": "1.9.1",
"@actions/github": "5.0.0",
- "@ariakit/test": "^0.3.5",
+ "@ariakit/test": "^0.3.7",
"@babel/core": "7.16.0",
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
"@babel/plugin-syntax-jsx": "7.16.0",
@@ -212,7 +212,7 @@
"node-fetch": "2.6.1",
"node-watch": "0.7.0",
"npm-run-all": "4.1.5",
- "patch-package": "6.2.2",
+ "patch-package": "8.0.0",
"postcss": "8.4.16",
"postcss-loader": "6.2.1",
"prettier": "npm:wp-prettier@3.0.3",
@@ -1628,13 +1628,48 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/@ariakit/core": {
+ "version": "0.3.10",
+ "resolved": "https://registry.npmjs.org/@ariakit/core/-/core-0.3.10.tgz",
+ "integrity": "sha512-AcN+GSoVXuUOzKx5d3xPL3YsEHevh4PIO6QIt/mg/nRX1XQ6cvxQEiAjO/BJQm+/MVl7/VbuGBoTFjr0tPU6NQ=="
+ },
+ "node_modules/@ariakit/react": {
+ "version": "0.3.12",
+ "resolved": "https://registry.npmjs.org/@ariakit/react/-/react-0.3.12.tgz",
+ "integrity": "sha512-HxKMZZhWSkwwS/Sh9OdWyuNKQ2tjDAIQIy2KVI7IRa8ZQ6ze/4g3YLUHbfCxO7oDupXHfXaeZ4hWx8lP7l1U/g==",
+ "dependencies": {
+ "@ariakit/react-core": "0.3.12"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/ariakit"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@ariakit/react-core": {
+ "version": "0.3.12",
+ "resolved": "https://registry.npmjs.org/@ariakit/react-core/-/react-core-0.3.12.tgz",
+ "integrity": "sha512-w6P1A7TYb1fKUe9QbwaoTOWofl13g7TEuXdV4JyefJCQL1e9HQdEw9UL67I8aXRo8/cFHH94/z0N37t8hw5Ogg==",
+ "dependencies": {
+ "@ariakit/core": "0.3.10",
+ "@floating-ui/dom": "^1.0.0",
+ "use-sync-external-store": "^1.2.0"
+ },
+ "peerDependencies": {
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/@ariakit/test": {
- "version": "0.3.5",
- "resolved": "https://registry.npmjs.org/@ariakit/test/-/test-0.3.5.tgz",
- "integrity": "sha512-7UCQBnJZ88JptkEnAXT7iSgtxEZiFwqdkKtxLCXDssTOJNatbFsnq0Jow324y41jGfAE2n4Lf5qY2FsZUPf9XQ==",
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/@ariakit/test/-/test-0.3.7.tgz",
+ "integrity": "sha512-rOa9pJA0ZfPPSI4SkDX41CsBcvxs6BmxgzFEElZWZo/uBBqtnr8ZL4oe5HySeZKEAHRH86XDqfxFISkhV76m5g==",
"dev": true,
"dependencies": {
- "@ariakit/core": "0.3.8",
+ "@ariakit/core": "0.3.10",
"@testing-library/dom": "^8.0.0 || ^9.0.0"
},
"peerDependencies": {
@@ -1650,12 +1685,6 @@
}
}
},
- "node_modules/@ariakit/test/node_modules/@ariakit/core": {
- "version": "0.3.8",
- "resolved": "https://registry.npmjs.org/@ariakit/core/-/core-0.3.8.tgz",
- "integrity": "sha512-LlSCwbyyozMX4ZEobpYGcv1LFqOdBTdTYPZw3lAVgLcFSNivsazi3NkKM9qNWNIu00MS+xTa0+RuIcuWAjlB2Q==",
- "dev": true
- },
"node_modules/@aw-web-design/x-default-browser": {
"version": "1.4.126",
"resolved": "https://registry.npmjs.org/@aw-web-design/x-default-browser/-/x-default-browser-1.4.126.tgz",
@@ -19711,6 +19740,15 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
+ "node_modules/at-least-node": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
+ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4.0.0"
+ }
+ },
"node_modules/atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
@@ -21203,13 +21241,14 @@
}
},
"node_modules/call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz",
+ "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==",
"dev": true,
"dependencies": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.1",
+ "set-function-length": "^1.1.1"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -24631,6 +24670,20 @@
"node": ">=10"
}
},
+ "node_modules/define-data-property": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz",
+ "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==",
+ "dev": true,
+ "dependencies": {
+ "get-intrinsic": "^1.2.1",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/define-lazy-prop": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
@@ -28068,108 +28121,12 @@
}
},
"node_modules/find-yarn-workspace-root": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz",
- "integrity": "sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==",
- "dev": true,
- "dependencies": {
- "fs-extra": "^4.0.3",
- "micromatch": "^3.1.4"
- }
- },
- "node_modules/find-yarn-workspace-root/node_modules/braces": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
- "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
- "dev": true,
- "dependencies": {
- "arr-flatten": "^1.1.0",
- "array-unique": "^0.3.2",
- "extend-shallow": "^2.0.1",
- "fill-range": "^4.0.0",
- "isobject": "^3.0.1",
- "repeat-element": "^1.1.2",
- "snapdragon": "^0.8.1",
- "snapdragon-node": "^2.0.1",
- "split-string": "^3.0.2",
- "to-regex": "^3.0.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/find-yarn-workspace-root/node_modules/braces/node_modules/extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
- "dev": true,
- "dependencies": {
- "is-extendable": "^0.1.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/find-yarn-workspace-root/node_modules/fill-range": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
- "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==",
- "dev": true,
- "dependencies": {
- "extend-shallow": "^2.0.1",
- "is-number": "^3.0.0",
- "repeat-string": "^1.6.1",
- "to-regex-range": "^2.1.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/find-yarn-workspace-root/node_modules/fill-range/node_modules/extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
- "dev": true,
- "dependencies": {
- "is-extendable": "^0.1.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/find-yarn-workspace-root/node_modules/fs-extra": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
- "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
- "dev": true,
- "dependencies": {
- "graceful-fs": "^4.1.2",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
- }
- },
- "node_modules/find-yarn-workspace-root/node_modules/micromatch": {
- "version": "3.1.10",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
- "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz",
+ "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==",
"dev": true,
"dependencies": {
- "arr-diff": "^4.0.0",
- "array-unique": "^0.3.2",
- "braces": "^2.3.1",
- "define-property": "^2.0.2",
- "extend-shallow": "^3.0.2",
- "extglob": "^2.0.4",
- "fragment-cache": "^0.2.1",
- "kind-of": "^6.0.2",
- "nanomatch": "^1.2.9",
- "object.pick": "^1.3.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.2"
- },
- "engines": {
- "node": ">=0.10.0"
+ "micromatch": "^4.0.2"
}
},
"node_modules/flat": {
@@ -28603,9 +28560,12 @@
"dev": true
},
"node_modules/function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/function.prototype.name": {
"version": "1.1.5",
@@ -33323,12 +33283,36 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
+ "node_modules/json-stable-stringify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz",
+ "integrity": "sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.5",
+ "isarray": "^2.0.5",
+ "jsonify": "^0.0.1",
+ "object-keys": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true
},
+ "node_modules/json-stable-stringify/node_modules/isarray": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
+ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
+ "dev": true
+ },
"node_modules/json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
@@ -33366,6 +33350,15 @@
"graceful-fs": "^4.1.6"
}
},
+ "node_modules/jsonify": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz",
+ "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/jsonparse": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
@@ -42337,85 +42330,78 @@
}
},
"node_modules/patch-package": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.2.2.tgz",
- "integrity": "sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz",
+ "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==",
"dev": true,
"dependencies": {
"@yarnpkg/lockfile": "^1.1.0",
- "chalk": "^2.4.2",
- "cross-spawn": "^6.0.5",
- "find-yarn-workspace-root": "^1.2.1",
- "fs-extra": "^7.0.1",
- "is-ci": "^2.0.0",
+ "chalk": "^4.1.2",
+ "ci-info": "^3.7.0",
+ "cross-spawn": "^7.0.3",
+ "find-yarn-workspace-root": "^2.0.0",
+ "fs-extra": "^9.0.0",
+ "json-stable-stringify": "^1.0.2",
"klaw-sync": "^6.0.0",
- "minimist": "^1.2.0",
+ "minimist": "^1.2.6",
+ "open": "^7.4.2",
"rimraf": "^2.6.3",
- "semver": "^5.6.0",
+ "semver": "^7.5.3",
"slash": "^2.0.0",
- "tmp": "^0.0.33"
+ "tmp": "^0.0.33",
+ "yaml": "^2.2.2"
},
"bin": {
"patch-package": "index.js"
},
"engines": {
+ "node": ">=14",
"npm": ">5"
}
},
- "node_modules/patch-package/node_modules/ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/patch-package/node_modules/chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
},
"engines": {
- "node": ">=4"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/patch-package/node_modules/cross-spawn": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
- "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"dependencies": {
- "nice-try": "^1.0.4",
- "path-key": "^2.0.1",
- "semver": "^5.5.0",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
},
"engines": {
- "node": ">=4.8"
+ "node": ">= 8"
}
},
"node_modules/patch-package/node_modules/fs-extra": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
- "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
+ "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"dev": true,
"dependencies": {
- "graceful-fs": "^4.1.2",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "at-least-node": "^1.0.0",
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
},
"engines": {
- "node": ">=6 <7 || >=8"
+ "node": ">=10"
}
},
"node_modules/patch-package/node_modules/glob": {
@@ -42438,6 +42424,64 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/patch-package/node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/patch-package/node_modules/is-wsl": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
+ "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
+ "dev": true,
+ "dependencies": {
+ "is-docker": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/patch-package/node_modules/jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dev": true,
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/patch-package/node_modules/open": {
+ "version": "7.4.2",
+ "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
+ "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
+ "dev": true,
+ "dependencies": {
+ "is-docker": "^2.0.0",
+ "is-wsl": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/patch-package/node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/patch-package/node_modules/rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -42450,13 +42494,25 @@
"rimraf": "bin.js"
}
},
- "node_modules/patch-package/node_modules/semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "node_modules/patch-package/node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
- "bin": {
- "semver": "bin/semver"
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/patch-package/node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
}
},
"node_modules/patch-package/node_modules/slash": {
@@ -42468,6 +42524,51 @@
"node": ">=6"
}
},
+ "node_modules/patch-package/node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/patch-package/node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "dev": true,
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/patch-package/node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/patch-package/node_modules/yaml": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz",
+ "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 14"
+ }
+ },
"node_modules/path-browserify": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
@@ -47215,6 +47316,21 @@
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
},
+ "node_modules/set-function-length": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz",
+ "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==",
+ "dev": true,
+ "dependencies": {
+ "define-data-property": "^1.1.1",
+ "get-intrinsic": "^1.2.1",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/set-value": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
@@ -54157,7 +54273,7 @@
"version": "25.14.0",
"license": "GPL-2.0-or-later",
"dependencies": {
- "@ariakit/react": "^0.3.10",
+ "@ariakit/react": "^0.3.12",
"@babel/runtime": "^7.16.0",
"@emotion/cache": "^11.7.1",
"@emotion/css": "^11.7.1",
@@ -54216,41 +54332,6 @@
"react-dom": "^18.0.0"
}
},
- "packages/components/node_modules/@ariakit/core": {
- "version": "0.3.8",
- "resolved": "https://registry.npmjs.org/@ariakit/core/-/core-0.3.8.tgz",
- "integrity": "sha512-LlSCwbyyozMX4ZEobpYGcv1LFqOdBTdTYPZw3lAVgLcFSNivsazi3NkKM9qNWNIu00MS+xTa0+RuIcuWAjlB2Q=="
- },
- "packages/components/node_modules/@ariakit/react": {
- "version": "0.3.10",
- "resolved": "https://registry.npmjs.org/@ariakit/react/-/react-0.3.10.tgz",
- "integrity": "sha512-XRY69IOm8Oy+HSPoaspcVLAhLo3ToLhhJKSLK1voTAZtSzu5kUeUf4nUPxTzYFsvirKORZgOLAeNwuo1gPr61g==",
- "dependencies": {
- "@ariakit/react-core": "0.3.10"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/ariakit"
- },
- "peerDependencies": {
- "react": "^17.0.0 || ^18.0.0",
- "react-dom": "^17.0.0 || ^18.0.0"
- }
- },
- "packages/components/node_modules/@ariakit/react-core": {
- "version": "0.3.10",
- "resolved": "https://registry.npmjs.org/@ariakit/react-core/-/react-core-0.3.10.tgz",
- "integrity": "sha512-CzSffcNlOyS2xuy21UB6fgJXi5LriJ9JrTSJzcgJmE+P9/WfQlplJC3L75d8O2yKgaGPeFnQ0hhDA6ItsI98eQ==",
- "dependencies": {
- "@ariakit/core": "0.3.8",
- "@floating-ui/dom": "^1.0.0",
- "use-sync-external-store": "^1.2.0"
- },
- "peerDependencies": {
- "react": "^17.0.0 || ^18.0.0",
- "react-dom": "^17.0.0 || ^18.0.0"
- }
- },
"packages/components/node_modules/@floating-ui/react-dom": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.1.tgz",
@@ -55121,6 +55202,7 @@
"@wordpress/html-entities": "file:../html-entities",
"@wordpress/i18n": "file:../i18n",
"@wordpress/icons": "file:../icons",
+ "@wordpress/private-apis": "file:../private-apis",
"@wordpress/rich-text": "file:../rich-text",
"@wordpress/url": "file:../url"
},
@@ -57304,22 +57386,37 @@
}
}
},
+ "@ariakit/core": {
+ "version": "0.3.10",
+ "resolved": "https://registry.npmjs.org/@ariakit/core/-/core-0.3.10.tgz",
+ "integrity": "sha512-AcN+GSoVXuUOzKx5d3xPL3YsEHevh4PIO6QIt/mg/nRX1XQ6cvxQEiAjO/BJQm+/MVl7/VbuGBoTFjr0tPU6NQ=="
+ },
+ "@ariakit/react": {
+ "version": "0.3.12",
+ "resolved": "https://registry.npmjs.org/@ariakit/react/-/react-0.3.12.tgz",
+ "integrity": "sha512-HxKMZZhWSkwwS/Sh9OdWyuNKQ2tjDAIQIy2KVI7IRa8ZQ6ze/4g3YLUHbfCxO7oDupXHfXaeZ4hWx8lP7l1U/g==",
+ "requires": {
+ "@ariakit/react-core": "0.3.12"
+ }
+ },
+ "@ariakit/react-core": {
+ "version": "0.3.12",
+ "resolved": "https://registry.npmjs.org/@ariakit/react-core/-/react-core-0.3.12.tgz",
+ "integrity": "sha512-w6P1A7TYb1fKUe9QbwaoTOWofl13g7TEuXdV4JyefJCQL1e9HQdEw9UL67I8aXRo8/cFHH94/z0N37t8hw5Ogg==",
+ "requires": {
+ "@ariakit/core": "0.3.10",
+ "@floating-ui/dom": "^1.0.0",
+ "use-sync-external-store": "^1.2.0"
+ }
+ },
"@ariakit/test": {
- "version": "0.3.5",
- "resolved": "https://registry.npmjs.org/@ariakit/test/-/test-0.3.5.tgz",
- "integrity": "sha512-7UCQBnJZ88JptkEnAXT7iSgtxEZiFwqdkKtxLCXDssTOJNatbFsnq0Jow324y41jGfAE2n4Lf5qY2FsZUPf9XQ==",
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/@ariakit/test/-/test-0.3.7.tgz",
+ "integrity": "sha512-rOa9pJA0ZfPPSI4SkDX41CsBcvxs6BmxgzFEElZWZo/uBBqtnr8ZL4oe5HySeZKEAHRH86XDqfxFISkhV76m5g==",
"dev": true,
"requires": {
- "@ariakit/core": "0.3.8",
+ "@ariakit/core": "0.3.10",
"@testing-library/dom": "^8.0.0 || ^9.0.0"
- },
- "dependencies": {
- "@ariakit/core": {
- "version": "0.3.8",
- "resolved": "https://registry.npmjs.org/@ariakit/core/-/core-0.3.8.tgz",
- "integrity": "sha512-LlSCwbyyozMX4ZEobpYGcv1LFqOdBTdTYPZw3lAVgLcFSNivsazi3NkKM9qNWNIu00MS+xTa0+RuIcuWAjlB2Q==",
- "dev": true
- }
}
},
"@aw-web-design/x-default-browser": {
@@ -69275,7 +69372,7 @@
"@wordpress/components": {
"version": "file:packages/components",
"requires": {
- "@ariakit/react": "^0.3.10",
+ "@ariakit/react": "^0.3.12",
"@babel/runtime": "^7.16.0",
"@emotion/cache": "^11.7.1",
"@emotion/css": "^11.7.1",
@@ -69327,29 +69424,6 @@
"valtio": "1.7.0"
},
"dependencies": {
- "@ariakit/core": {
- "version": "0.3.8",
- "resolved": "https://registry.npmjs.org/@ariakit/core/-/core-0.3.8.tgz",
- "integrity": "sha512-LlSCwbyyozMX4ZEobpYGcv1LFqOdBTdTYPZw3lAVgLcFSNivsazi3NkKM9qNWNIu00MS+xTa0+RuIcuWAjlB2Q=="
- },
- "@ariakit/react": {
- "version": "0.3.10",
- "resolved": "https://registry.npmjs.org/@ariakit/react/-/react-0.3.10.tgz",
- "integrity": "sha512-XRY69IOm8Oy+HSPoaspcVLAhLo3ToLhhJKSLK1voTAZtSzu5kUeUf4nUPxTzYFsvirKORZgOLAeNwuo1gPr61g==",
- "requires": {
- "@ariakit/react-core": "0.3.10"
- }
- },
- "@ariakit/react-core": {
- "version": "0.3.10",
- "resolved": "https://registry.npmjs.org/@ariakit/react-core/-/react-core-0.3.10.tgz",
- "integrity": "sha512-CzSffcNlOyS2xuy21UB6fgJXi5LriJ9JrTSJzcgJmE+P9/WfQlplJC3L75d8O2yKgaGPeFnQ0hhDA6ItsI98eQ==",
- "requires": {
- "@ariakit/core": "0.3.8",
- "@floating-ui/dom": "^1.0.0",
- "use-sync-external-store": "^1.2.0"
- }
- },
"@floating-ui/react-dom": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.1.tgz",
@@ -69972,6 +70046,7 @@
"@wordpress/html-entities": "file:../html-entities",
"@wordpress/i18n": "file:../i18n",
"@wordpress/icons": "file:../icons",
+ "@wordpress/private-apis": "file:../private-apis",
"@wordpress/rich-text": "file:../rich-text",
"@wordpress/url": "file:../url"
}
@@ -71916,6 +71991,12 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
+ "at-least-node": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
+ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
+ "dev": true
+ },
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
@@ -73080,13 +73161,14 @@
}
},
"call-bind": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
- "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz",
+ "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==",
"dev": true,
"requires": {
- "function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2"
+ "function-bind": "^1.1.2",
+ "get-intrinsic": "^1.2.1",
+ "set-function-length": "^1.1.1"
}
},
"caller-callsite": {
@@ -75685,6 +75767,17 @@
"integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==",
"dev": true
},
+ "define-data-property": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz",
+ "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==",
+ "dev": true,
+ "requires": {
+ "get-intrinsic": "^1.2.1",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.0"
+ }
+ },
"define-lazy-prop": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
@@ -78348,99 +78441,12 @@
}
},
"find-yarn-workspace-root": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz",
- "integrity": "sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz",
+ "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==",
"dev": true,
"requires": {
- "fs-extra": "^4.0.3",
- "micromatch": "^3.1.4"
- },
- "dependencies": {
- "braces": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
- "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
- "dev": true,
- "requires": {
- "arr-flatten": "^1.1.0",
- "array-unique": "^0.3.2",
- "extend-shallow": "^2.0.1",
- "fill-range": "^4.0.0",
- "isobject": "^3.0.1",
- "repeat-element": "^1.1.2",
- "snapdragon": "^0.8.1",
- "snapdragon-node": "^2.0.1",
- "split-string": "^3.0.2",
- "to-regex": "^3.0.1"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "fill-range": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
- "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==",
- "dev": true,
- "requires": {
- "extend-shallow": "^2.0.1",
- "is-number": "^3.0.0",
- "repeat-string": "^1.6.1",
- "to-regex-range": "^2.1.0"
- },
- "dependencies": {
- "extend-shallow": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
- "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
- "dev": true,
- "requires": {
- "is-extendable": "^0.1.0"
- }
- }
- }
- },
- "fs-extra": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
- "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.2",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
- }
- },
- "micromatch": {
- "version": "3.1.10",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
- "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
- "dev": true,
- "requires": {
- "arr-diff": "^4.0.0",
- "array-unique": "^0.3.2",
- "braces": "^2.3.1",
- "define-property": "^2.0.2",
- "extend-shallow": "^3.0.2",
- "extglob": "^2.0.4",
- "fragment-cache": "^0.2.1",
- "kind-of": "^6.0.2",
- "nanomatch": "^1.2.9",
- "object.pick": "^1.3.0",
- "regex-not": "^1.0.0",
- "snapdragon": "^0.8.1",
- "to-regex": "^3.0.2"
- }
- }
+ "micromatch": "^4.0.2"
}
},
"flat": {
@@ -78771,9 +78777,9 @@
}
},
"function-bind": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
},
"function.prototype.name": {
"version": "1.1.5",
@@ -82297,6 +82303,26 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
+ "json-stable-stringify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz",
+ "integrity": "sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.5",
+ "isarray": "^2.0.5",
+ "jsonify": "^0.0.1",
+ "object-keys": "^1.1.1"
+ },
+ "dependencies": {
+ "isarray": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
+ "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
+ "dev": true
+ }
+ }
+ },
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
@@ -82334,6 +82360,12 @@
"graceful-fs": "^4.1.6"
}
},
+ "jsonify": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz",
+ "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==",
+ "dev": true
+ },
"jsonparse": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
@@ -89307,67 +89339,59 @@
"integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw=="
},
"patch-package": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.2.2.tgz",
- "integrity": "sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz",
+ "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==",
"dev": true,
"requires": {
"@yarnpkg/lockfile": "^1.1.0",
- "chalk": "^2.4.2",
- "cross-spawn": "^6.0.5",
- "find-yarn-workspace-root": "^1.2.1",
- "fs-extra": "^7.0.1",
- "is-ci": "^2.0.0",
+ "chalk": "^4.1.2",
+ "ci-info": "^3.7.0",
+ "cross-spawn": "^7.0.3",
+ "find-yarn-workspace-root": "^2.0.0",
+ "fs-extra": "^9.0.0",
+ "json-stable-stringify": "^1.0.2",
"klaw-sync": "^6.0.0",
- "minimist": "^1.2.0",
+ "minimist": "^1.2.6",
+ "open": "^7.4.2",
"rimraf": "^2.6.3",
- "semver": "^5.6.0",
+ "semver": "^7.5.3",
"slash": "^2.0.0",
- "tmp": "^0.0.33"
+ "tmp": "^0.0.33",
+ "yaml": "^2.2.2"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "^1.9.0"
- }
- },
"chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
}
},
"cross-spawn": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
- "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
+ "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
- "nice-try": "^1.0.4",
- "path-key": "^2.0.1",
- "semver": "^5.5.0",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
}
},
"fs-extra": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
- "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
+ "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"dev": true,
"requires": {
- "graceful-fs": "^4.1.2",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "at-least-node": "^1.0.0",
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
}
},
"glob": {
@@ -89384,6 +89408,47 @@
"path-is-absolute": "^1.0.0"
}
},
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "is-wsl": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
+ "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
+ "dev": true,
+ "requires": {
+ "is-docker": "^2.0.0"
+ }
+ },
+ "jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "^4.1.6",
+ "universalify": "^2.0.0"
+ }
+ },
+ "open": {
+ "version": "7.4.2",
+ "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
+ "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
+ "dev": true,
+ "requires": {
+ "is-docker": "^2.0.0",
+ "is-wsl": "^2.1.1"
+ }
+ },
+ "path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true
+ },
"rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@@ -89393,10 +89458,19 @@
"glob": "^7.1.3"
}
},
- "semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "requires": {
+ "shebang-regex": "^3.0.0"
+ }
+ },
+ "shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"slash": {
@@ -89404,6 +89478,36 @@
"resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
"integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
"dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ },
+ "universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "dev": true
+ },
+ "which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ },
+ "yaml": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz",
+ "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==",
+ "dev": true
}
}
},
@@ -92997,6 +93101,18 @@
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
},
+ "set-function-length": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz",
+ "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==",
+ "dev": true,
+ "requires": {
+ "define-data-property": "^1.1.1",
+ "get-intrinsic": "^1.2.1",
+ "gopd": "^1.0.1",
+ "has-property-descriptors": "^1.0.0"
+ }
+ },
"set-value": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
diff --git a/package.json b/package.json
index 5f99726146658e..684f35d408d3c2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "17.4.1",
+ "version": "17.5.0-rc.1",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
@@ -98,7 +98,7 @@
"devDependencies": {
"@actions/core": "1.9.1",
"@actions/github": "5.0.0",
- "@ariakit/test": "^0.3.5",
+ "@ariakit/test": "^0.3.7",
"@babel/core": "7.16.0",
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
"@babel/plugin-syntax-jsx": "7.16.0",
@@ -224,7 +224,7 @@
"node-fetch": "2.6.1",
"node-watch": "0.7.0",
"npm-run-all": "4.1.5",
- "patch-package": "6.2.2",
+ "patch-package": "8.0.0",
"postcss": "8.4.16",
"postcss-loader": "6.2.1",
"prettier": "npm:wp-prettier@3.0.3",
diff --git a/packages/block-editor/src/components/global-styles/dimensions-panel.js b/packages/block-editor/src/components/global-styles/dimensions-panel.js
index 47b5bd329725a7..47e50aa515e3c6 100644
--- a/packages/block-editor/src/components/global-styles/dimensions-panel.js
+++ b/packages/block-editor/src/components/global-styles/dimensions-panel.js
@@ -603,7 +603,7 @@ export default function DimensionsPanel( {
{ showMinHeightControl && (
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet ut nibh vitae ornare. Sed auctor nec augue at blandit.
" `; -exports[`