mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Update npm packages to latest.
The npm packages needed a further update for beta 2 in preparation for 6.4. Props @mmaattiiaass , @wildworks , @aaronrobertshaw, @bartkalisz, @mamaduka, @artemiosans, @youknowriad, @czapla, @richtabor, @glendaviesnz, @pbking, @cbravobernal, @madhudollu, @kevin940726, @adamsilverstein, @get_dave, @ntsekouras, @ramonopoly, @jffng, @swissspidy, @carlosgprim, @siobhyb, @mikachan. See #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@56755 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e686e81122
commit
1d0876b676
3114
package-lock.json
generated
3114
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
138
package.json
138
package.json
@ -26,10 +26,10 @@
|
||||
"devDependencies": {
|
||||
"@lodder/grunt-postcss": "^3.1.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
|
||||
"@wordpress/babel-preset-default": "7.26.2",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "4.25.2",
|
||||
"@wordpress/e2e-test-utils": "10.13.2",
|
||||
"@wordpress/scripts": "26.13.2",
|
||||
"@wordpress/babel-preset-default": "7.26.3",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "4.25.3",
|
||||
"@wordpress/e2e-test-utils": "10.13.3",
|
||||
"@wordpress/scripts": "26.13.3",
|
||||
"autoprefixer": "10.4.16",
|
||||
"chalk": "5.3.0",
|
||||
"check-node-version": "4.2.1",
|
||||
@ -37,7 +37,7 @@
|
||||
"cssnano": "6.0.1",
|
||||
"dotenv": "16.3.1",
|
||||
"dotenv-expand": "10.0.0",
|
||||
"grunt": "~1.6.1",
|
||||
"grunt": "1.6.1",
|
||||
"grunt-banner": "^0.6.0",
|
||||
"grunt-contrib-clean": "~2.0.1",
|
||||
"grunt-contrib-concat": "2.1.0",
|
||||
@ -78,70 +78,70 @@
|
||||
"dependencies": {
|
||||
"@emotion/is-prop-valid": "0.8.8",
|
||||
"@emotion/memoize": "0.7.4",
|
||||
"@wordpress/a11y": "3.42.2",
|
||||
"@wordpress/annotations": "2.42.2",
|
||||
"@wordpress/api-fetch": "6.39.2",
|
||||
"@wordpress/autop": "3.42.2",
|
||||
"@wordpress/blob": "3.42.2",
|
||||
"@wordpress/block-directory": "4.19.2",
|
||||
"@wordpress/block-editor": "12.10.2",
|
||||
"@wordpress/block-library": "8.19.2",
|
||||
"@wordpress/block-serialization-default-parser": "4.42.2",
|
||||
"@wordpress/blocks": "12.19.2",
|
||||
"@wordpress/commands": "0.13.2",
|
||||
"@wordpress/components": "25.8.2",
|
||||
"@wordpress/compose": "6.19.2",
|
||||
"@wordpress/core-commands": "0.11.2",
|
||||
"@wordpress/core-data": "6.19.2",
|
||||
"@wordpress/customize-widgets": "4.19.2",
|
||||
"@wordpress/data": "9.12.2",
|
||||
"@wordpress/data-controls": "3.11.2",
|
||||
"@wordpress/date": "4.42.2",
|
||||
"@wordpress/deprecated": "3.42.2",
|
||||
"@wordpress/dom": "3.42.2",
|
||||
"@wordpress/dom-ready": "3.42.2",
|
||||
"@wordpress/edit-post": "7.19.2",
|
||||
"@wordpress/edit-site": "5.19.2",
|
||||
"@wordpress/edit-widgets": "5.19.2",
|
||||
"@wordpress/editor": "13.19.2",
|
||||
"@wordpress/element": "5.19.2",
|
||||
"@wordpress/escape-html": "2.42.2",
|
||||
"@wordpress/format-library": "4.19.2",
|
||||
"@wordpress/hooks": "3.42.2",
|
||||
"@wordpress/html-entities": "3.42.2",
|
||||
"@wordpress/i18n": "4.42.2",
|
||||
"@wordpress/icons": "9.33.2",
|
||||
"@wordpress/interactivity": "2.3.2",
|
||||
"@wordpress/interface": "5.19.2",
|
||||
"@wordpress/is-shallow-equal": "4.42.2",
|
||||
"@wordpress/keyboard-shortcuts": "4.19.2",
|
||||
"@wordpress/keycodes": "3.42.2",
|
||||
"@wordpress/list-reusable-blocks": "4.19.2",
|
||||
"@wordpress/media-utils": "4.33.2",
|
||||
"@wordpress/notices": "4.10.2",
|
||||
"@wordpress/nux": "8.4.2",
|
||||
"@wordpress/patterns": "1.3.2",
|
||||
"@wordpress/plugins": "6.10.2",
|
||||
"@wordpress/preferences": "3.19.2",
|
||||
"@wordpress/preferences-persistence": "1.34.2",
|
||||
"@wordpress/primitives": "3.40.2",
|
||||
"@wordpress/priority-queue": "2.42.2",
|
||||
"@wordpress/private-apis": "0.24.2",
|
||||
"@wordpress/redux-routine": "4.42.2",
|
||||
"@wordpress/reusable-blocks": "4.19.2",
|
||||
"@wordpress/rich-text": "6.19.2",
|
||||
"@wordpress/router": "0.11.2",
|
||||
"@wordpress/server-side-render": "4.19.2",
|
||||
"@wordpress/shortcode": "3.42.2",
|
||||
"@wordpress/style-engine": "1.25.2",
|
||||
"@wordpress/sync": "0.4.2",
|
||||
"@wordpress/token-list": "2.42.2",
|
||||
"@wordpress/undo-manager": "0.2.2",
|
||||
"@wordpress/url": "3.43.2",
|
||||
"@wordpress/viewport": "5.19.2",
|
||||
"@wordpress/warning": "2.42.2",
|
||||
"@wordpress/widgets": "3.19.2",
|
||||
"@wordpress/wordcount": "3.42.2",
|
||||
"@wordpress/a11y": "3.42.3",
|
||||
"@wordpress/annotations": "2.42.3",
|
||||
"@wordpress/api-fetch": "6.39.3",
|
||||
"@wordpress/autop": "3.42.3",
|
||||
"@wordpress/blob": "3.42.3",
|
||||
"@wordpress/block-directory": "4.19.3",
|
||||
"@wordpress/block-editor": "12.10.3",
|
||||
"@wordpress/block-library": "8.19.3",
|
||||
"@wordpress/block-serialization-default-parser": "4.42.3",
|
||||
"@wordpress/blocks": "12.19.3",
|
||||
"@wordpress/commands": "0.13.3",
|
||||
"@wordpress/components": "25.8.3",
|
||||
"@wordpress/compose": "6.19.3",
|
||||
"@wordpress/core-commands": "0.11.3",
|
||||
"@wordpress/core-data": "6.19.3",
|
||||
"@wordpress/customize-widgets": "4.19.3",
|
||||
"@wordpress/data": "9.12.3",
|
||||
"@wordpress/data-controls": "3.11.3",
|
||||
"@wordpress/date": "4.42.3",
|
||||
"@wordpress/deprecated": "3.42.3",
|
||||
"@wordpress/dom": "3.42.3",
|
||||
"@wordpress/dom-ready": "3.42.3",
|
||||
"@wordpress/edit-post": "7.19.3",
|
||||
"@wordpress/edit-site": "5.19.3",
|
||||
"@wordpress/edit-widgets": "5.19.3",
|
||||
"@wordpress/editor": "13.19.3",
|
||||
"@wordpress/element": "5.19.3",
|
||||
"@wordpress/escape-html": "2.42.3",
|
||||
"@wordpress/format-library": "4.19.3",
|
||||
"@wordpress/hooks": "3.42.3",
|
||||
"@wordpress/html-entities": "3.42.3",
|
||||
"@wordpress/i18n": "4.42.3",
|
||||
"@wordpress/icons": "9.33.3",
|
||||
"@wordpress/interactivity": "2.3.3",
|
||||
"@wordpress/interface": "5.19.3",
|
||||
"@wordpress/is-shallow-equal": "4.42.3",
|
||||
"@wordpress/keyboard-shortcuts": "4.19.3",
|
||||
"@wordpress/keycodes": "3.42.3",
|
||||
"@wordpress/list-reusable-blocks": "4.19.3",
|
||||
"@wordpress/media-utils": "4.33.3",
|
||||
"@wordpress/notices": "4.10.3",
|
||||
"@wordpress/nux": "8.4.3",
|
||||
"@wordpress/patterns": "1.3.3",
|
||||
"@wordpress/plugins": "6.10.3",
|
||||
"@wordpress/preferences": "3.19.3",
|
||||
"@wordpress/preferences-persistence": "1.34.3",
|
||||
"@wordpress/primitives": "3.40.3",
|
||||
"@wordpress/priority-queue": "2.42.3",
|
||||
"@wordpress/private-apis": "0.24.3",
|
||||
"@wordpress/redux-routine": "4.42.3",
|
||||
"@wordpress/reusable-blocks": "4.19.3",
|
||||
"@wordpress/rich-text": "6.19.3",
|
||||
"@wordpress/router": "0.11.3",
|
||||
"@wordpress/server-side-render": "4.19.3",
|
||||
"@wordpress/shortcode": "3.42.3",
|
||||
"@wordpress/style-engine": "1.25.3",
|
||||
"@wordpress/sync": "0.4.3",
|
||||
"@wordpress/token-list": "2.42.3",
|
||||
"@wordpress/undo-manager": "0.2.3",
|
||||
"@wordpress/url": "3.43.3",
|
||||
"@wordpress/viewport": "5.19.3",
|
||||
"@wordpress/warning": "2.42.3",
|
||||
"@wordpress/widgets": "3.19.3",
|
||||
"@wordpress/wordcount": "3.42.3",
|
||||
"backbone": "1.5.0",
|
||||
"clipboard": "2.0.11",
|
||||
"core-js-url-browser": "3.6.4",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -39,15 +39,20 @@ function render_block_core_footnotes( $attributes, $content, $block ) {
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
$footnote_index = 1;
|
||||
|
||||
$block_content = '';
|
||||
|
||||
foreach ( $footnotes as $footnote ) {
|
||||
// Translators: %d: Integer representing the number of return links on the page.
|
||||
$aria_label = sprintf( __( 'Jump to footnote reference %1$d' ), $footnote_index );
|
||||
$block_content .= sprintf(
|
||||
'<li id="%1$s">%2$s <a href="#%1$s-link">↩︎</a></li>',
|
||||
'<li id="%1$s">%2$s <a href="#%1$s-link" aria-label="%3$s">↩︎</a></li>',
|
||||
$footnote['id'],
|
||||
$footnote['content']
|
||||
$footnote['content'],
|
||||
$aria_label
|
||||
);
|
||||
++$footnote_index;
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
@ -68,9 +73,10 @@ function register_block_core_footnotes() {
|
||||
$post_type,
|
||||
'footnotes',
|
||||
array(
|
||||
'show_in_rest' => true,
|
||||
'single' => true,
|
||||
'type' => 'string',
|
||||
'show_in_rest' => true,
|
||||
'single' => true,
|
||||
'type' => 'string',
|
||||
'revisions_enabled' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -84,106 +90,7 @@ function register_block_core_footnotes() {
|
||||
add_action( 'init', 'register_block_core_footnotes' );
|
||||
|
||||
/**
|
||||
* Saves the footnotes meta value to the revision.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param int $revision_id The revision ID.
|
||||
*/
|
||||
function wp_save_footnotes_meta( $revision_id ) {
|
||||
$post_id = wp_is_post_revision( $revision_id );
|
||||
|
||||
if ( $post_id ) {
|
||||
$footnotes = get_post_meta( $post_id, 'footnotes', true );
|
||||
|
||||
if ( $footnotes ) {
|
||||
// Can't use update_post_meta() because it doesn't allow revisions.
|
||||
update_metadata( 'post', $revision_id, 'footnotes', wp_slash( $footnotes ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'wp_after_insert_post', 'wp_save_footnotes_meta' );
|
||||
|
||||
/**
|
||||
* Keeps track of the revision ID for "rest_after_insert_{$post_type}".
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @global int $wp_temporary_footnote_revision_id The footnote revision ID.
|
||||
*
|
||||
* @param int $revision_id The revision ID.
|
||||
*/
|
||||
function wp_keep_footnotes_revision_id( $revision_id ) {
|
||||
global $wp_temporary_footnote_revision_id;
|
||||
$wp_temporary_footnote_revision_id = $revision_id;
|
||||
}
|
||||
add_action( '_wp_put_post_revision', 'wp_keep_footnotes_revision_id' );
|
||||
|
||||
/**
|
||||
* This is a specific fix for the REST API. The REST API doesn't update
|
||||
* the post and post meta in one go (through `meta_input`). While it
|
||||
* does fix the `wp_after_insert_post` hook to be called correctly after
|
||||
* updating meta, it does NOT fix hooks such as post_updated and
|
||||
* save_post, which are normally also fired after post meta is updated
|
||||
* in `wp_insert_post()`. Unfortunately, `wp_save_post_revision` is
|
||||
* added to the `post_updated` action, which means the meta is not
|
||||
* available at the time, so we have to add it afterwards through the
|
||||
* `"rest_after_insert_{$post_type}"` action.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @global int $wp_temporary_footnote_revision_id The footnote revision ID.
|
||||
*
|
||||
* @param WP_Post $post The post object.
|
||||
*/
|
||||
function wp_add_footnotes_revisions_to_post_meta( $post ) {
|
||||
global $wp_temporary_footnote_revision_id;
|
||||
|
||||
if ( $wp_temporary_footnote_revision_id ) {
|
||||
$revision = get_post( $wp_temporary_footnote_revision_id );
|
||||
|
||||
if ( ! $revision ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$post_id = $revision->post_parent;
|
||||
|
||||
// Just making sure we're updating the right revision.
|
||||
if ( $post->ID === $post_id ) {
|
||||
$footnotes = get_post_meta( $post_id, 'footnotes', true );
|
||||
|
||||
if ( $footnotes ) {
|
||||
// Can't use update_post_meta() because it doesn't allow revisions.
|
||||
update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', wp_slash( $footnotes ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' );
|
||||
add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' );
|
||||
|
||||
/**
|
||||
* Restores the footnotes meta value from the revision.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param int $post_id The post ID.
|
||||
* @param int $revision_id The revision ID.
|
||||
*/
|
||||
function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
|
||||
$footnotes = get_post_meta( $revision_id, 'footnotes', true );
|
||||
|
||||
if ( $footnotes ) {
|
||||
update_post_meta( $post_id, 'footnotes', wp_slash( $footnotes ) );
|
||||
} else {
|
||||
delete_post_meta( $post_id, 'footnotes' );
|
||||
}
|
||||
}
|
||||
add_action( 'wp_restore_post_revision', 'wp_restore_footnotes_from_revision', 10, 2 );
|
||||
|
||||
/**
|
||||
* Adds the footnotes field to the revision.
|
||||
* Adds the footnotes field to the revisions display.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
@ -197,7 +104,7 @@ function wp_add_footnotes_to_revision( $fields ) {
|
||||
add_filter( '_wp_post_revision_fields', 'wp_add_footnotes_to_revision' );
|
||||
|
||||
/**
|
||||
* Gets the footnotes field from the revision.
|
||||
* Gets the footnotes field from the revision for the revisions screen.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
@ -211,76 +118,3 @@ function wp_get_footnotes_from_revision( $revision_field, $field, $revision ) {
|
||||
return get_metadata( 'post', $revision->ID, $field, true );
|
||||
}
|
||||
add_filter( '_wp_post_revision_field_footnotes', 'wp_get_footnotes_from_revision', 10, 3 );
|
||||
|
||||
/**
|
||||
* The REST API autosave endpoint doesn't save meta, so we can use the
|
||||
* `wp_creating_autosave` when it updates an exiting autosave, and
|
||||
* `_wp_put_post_revision` when it creates a new autosave.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param int|array $autosave The autosave ID or array.
|
||||
*/
|
||||
function _wp_rest_api_autosave_meta( $autosave ) {
|
||||
// Ensure it's a REST API request.
|
||||
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$body = rest_get_server()->get_raw_data();
|
||||
$body = json_decode( $body, true );
|
||||
|
||||
if ( ! isset( $body['meta']['footnotes'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// `wp_creating_autosave` passes the array,
|
||||
// `_wp_put_post_revision` passes the ID.
|
||||
$id = is_int( $autosave ) ? $autosave : $autosave['ID'];
|
||||
|
||||
if ( ! $id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) );
|
||||
}
|
||||
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
|
||||
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
|
||||
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L398.
|
||||
// Then https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/revision.php#L367.
|
||||
add_action( '_wp_put_post_revision', '_wp_rest_api_autosave_meta' );
|
||||
|
||||
/**
|
||||
* This is a workaround for the autosave endpoint returning early if the
|
||||
* revision field are equal. The problem is that "footnotes" is not real
|
||||
* revision post field, so there's nothing to compare against.
|
||||
*
|
||||
* This trick sets the "footnotes" field (value doesn't matter), which will
|
||||
* cause the autosave endpoint to always update the latest revision. That should
|
||||
* be fine, it should be ok to update the revision even if nothing changed. Of
|
||||
* course, this is temporary fix.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param WP_Post $prepared_post The prepared post object.
|
||||
* @param WP_REST_Request $request The request object.
|
||||
*
|
||||
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L365-L384.
|
||||
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L219.
|
||||
*/
|
||||
function _wp_rest_api_force_autosave_difference( $prepared_post, $request ) {
|
||||
// We only want to be altering POST requests.
|
||||
if ( $request->get_method() !== 'POST' ) {
|
||||
return $prepared_post;
|
||||
}
|
||||
|
||||
// Only alter requests for the '/autosaves' route.
|
||||
if ( substr( $request->get_route(), -strlen( '/autosaves' ) ) !== '/autosaves' ) {
|
||||
return $prepared_post;
|
||||
}
|
||||
|
||||
$prepared_post->footnotes = '[]';
|
||||
return $prepared_post;
|
||||
}
|
||||
|
||||
add_filter( 'rest_pre_insert_post', '_wp_rest_api_force_autosave_difference', 10, 2 );
|
||||
|
||||
@ -64,7 +64,12 @@ function render_block_core_image( $attributes, $content, $block ) {
|
||||
}
|
||||
|
||||
if ( $lightbox_enabled ) {
|
||||
return block_core_image_render_lightbox( $processor->get_updated_html(), $block->parsed_block );
|
||||
// This render needs to happen in a filter with priority 15 to ensure that it
|
||||
// runs after the duotone filter and that duotone styles are applied to the image
|
||||
// in the lightbox. We also need to ensure that the lightbox works with any plugins
|
||||
// that might use filters as well. We can consider removing this in the future if the
|
||||
// way the blocks are rendered changes, or if a new kind of filter is introduced.
|
||||
add_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15, 2 );
|
||||
}
|
||||
|
||||
return $processor->get_updated_html();
|
||||
@ -267,7 +272,9 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
aria-modal="false"
|
||||
data-wp-effect="effects.core.image.initLightbox"
|
||||
data-wp-on--keydown="actions.core.image.handleKeydown"
|
||||
data-wp-on--mousewheel="actions.core.image.hideLightbox"
|
||||
data-wp-on--touchstart="actions.core.image.handleTouchStart"
|
||||
data-wp-on--touchmove="actions.core.image.handleTouchMove"
|
||||
data-wp-on--touchend="actions.core.image.handleTouchEnd"
|
||||
data-wp-on--click="actions.core.image.hideLightbox"
|
||||
>
|
||||
<button type="button" aria-label="$close_button_label" style="fill: $close_button_color" class="close-button" data-wp-on--click="actions.core.image.hideLightbox">
|
||||
|
||||
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '14e8201a9955f8b5ed13');
|
||||
<?php return array('dependencies' => array(), 'version' => '05c1954ba30982dc9c41');
|
||||
|
||||
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '1ba4adb54bc7c9f552d5');
|
||||
<?php return array('dependencies' => array(), 'version' => 'd147cc02d5d2c29b2a8e');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user