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.

Built from https://develop.svn.wordpress.org/trunk@56755


git-svn-id: http://core.svn.wordpress.org/trunk@56267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Tammie Lister 2023-10-02 18:58:22 +00:00
parent 5496e4b70b
commit ddc07c4598
41 changed files with 1077 additions and 853 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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 );

View File

@ -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">

View File

@ -124,10 +124,10 @@
}
.wp-lightbox-overlay .close-button{
cursor:pointer;
left:calc(env(safe-area-inset-left) + 12.5px);
left:calc(env(safe-area-inset-left) + 20px);
padding:0;
position:absolute;
top:calc(env(safe-area-inset-top) + 12.5px);
top:calc(env(safe-area-inset-top) + 20px);
z-index:5000000;
}
.wp-lightbox-overlay .lightbox-image-container{
@ -216,10 +216,6 @@
}
}
html.wp-has-lightbox-open{
overflow:hidden;
}
@keyframes turn-on-visibility{
0%{
opacity:0;

File diff suppressed because one or more lines are too long

View File

@ -126,8 +126,8 @@
cursor:pointer;
padding:0;
position:absolute;
right:calc(env(safe-area-inset-right) + 12.5px);
top:calc(env(safe-area-inset-top) + 12.5px);
right:calc(env(safe-area-inset-right) + 20px);
top:calc(env(safe-area-inset-top) + 20px);
z-index:5000000;
}
.wp-lightbox-overlay .lightbox-image-container{
@ -216,10 +216,6 @@
}
}
html.wp-has-lightbox-open{
overflow:hidden;
}
@keyframes turn-on-visibility{
0%{
opacity:0;

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'a61b46e3f411e7d14cfc');
<?php return array('dependencies' => array(), 'version' => '8d947c6c7d5f7f3771d1');

View File

@ -10,6 +10,66 @@
*/
const focusableSelectors = ['a[href]', 'area[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])'];
/*
* Stores a context-bound scroll handler.
*
* This callback could be defined inline inside of the store
* object but it's created externally to avoid confusion about
* how its logic is called. This logic is not referenced directly
* by the directives in the markup because the scroll event we
* need to listen to is triggered on the window; so by defining it
* outside of the store, we signal that the behavior here is different.
* If we find a compelling reason to move it to the store, feel free.
*
* @type {Function}
*/
let scrollCallback;
/*
* Tracks whether user is touching screen; used to
* differentiate behavior for touch and mouse input.
*
* @type {boolean}
*/
let isTouching = false;
/*
* Tracks the last time the screen was touched; used to
* differentiate behavior for touch and mouse input.
*
* @type {number}
*/
let lastTouchTime = 0;
/*
* Lightbox page-scroll handler: prevents scrolling.
*
* This handler is added to prevent scrolling behaviors that
* trigger content shift while the lightbox is open.
*
* It would be better to accomplish this through CSS alone, but
* using overflow: hidden is currently the only way to do so, and
* that causes the layout to shift and prevents the zoom animation
* from working in some cases because we're unable to account for
* the layout shift when doing the animation calculations. Instead,
* here we use JavaScript to prevent and reset the scrolling
* behavior. In the future, we may be able to use CSS or overflow: hidden
* instead to not rely on JavaScript, but this seems to be the best approach
* for now that provides the best visual experience.
*
* @param {Object} context Interactivity page context?
*/
function handleScroll(context) {
// We can't override the scroll behavior on mobile devices
// because doing so breaks the pinch to zoom functionality, and we
// want to allow users to zoom in further on the high-res image.
if (!isTouching && Date.now() - lastTouchTime > 450) {
// We are unable to use event.preventDefault() to prevent scrolling
// because the scroll event can't be canceled, so we reset the position instead.
window.scrollTo(context.core.image.scrollLeftReset, context.core.image.scrollTopReset);
}
}
(0,_wordpress_interactivity__WEBPACK_IMPORTED_MODULE_0__/* .store */ .h)({
state: {
core: {
@ -36,38 +96,39 @@ const focusableSelectors = ['a[href]', 'area[href]', 'input:not([disabled]):not(
context.core.image.scrollDelta = 0;
context.core.image.lightboxEnabled = true;
setStyles(context, event);
// Hide overflow only when the animation is in progress,
// otherwise the removal of the scrollbars will draw attention
// to itself and look like an error
document.documentElement.classList.add('wp-has-lightbox-open');
context.core.image.scrollTopReset = window.pageYOffset || document.documentElement.scrollTop;
// In most cases, this value will be 0, but this is included
// in case a user has created a page with horizontal scrolling.
context.core.image.scrollLeftReset = window.pageXOffset || document.documentElement.scrollLeft;
// We define and bind the scroll callback here so
// that we can pass the context and as an argument.
// We may be able to change this in the future if we
// define the scroll callback in the store instead, but
// this approach seems to tbe clearest for now.
scrollCallback = handleScroll.bind(null, context);
// We need to add a scroll event listener to the window
// here because we are unable to otherwise access it via
// the Interactivity API directives. If we add a native way
// to access the window, we can remove this.
window.addEventListener('scroll', scrollCallback, false);
},
hideLightbox: async ({
context,
event
context
}) => {
context.core.image.hideAnimationEnabled = true;
if (context.core.image.lightboxEnabled) {
// If scrolling, wait a moment before closing the lightbox.
if (context.core.image.lightboxAnimation === 'fade') {
context.core.image.scrollDelta += event.deltaY;
if (event.type === 'mousewheel' && Math.abs(window.scrollY - context.core.image.scrollDelta) < 10) {
return;
}
} else if (context.core.image.lightboxAnimation === 'zoom') {
// Disable scroll until the zoom animation ends.
// Get the current page scroll position
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
// if any scroll is attempted, set this to the previous value.
window.onscroll = function () {
window.scrollTo(scrollLeft, scrollTop);
};
// Enable scrolling after the animation finishes
setTimeout(function () {
window.onscroll = function () {};
}, 400);
}
document.documentElement.classList.remove('wp-has-lightbox-open');
// We want to wait until the close animation is completed
// before allowing a user to scroll again. The duration of this
// animation is defined in the styles.scss and depends on if the
// animation is 'zoom' or 'fade', but in any case we should wait
// a few milliseconds longer than the duration, otherwise a user
// may scroll too soon and cause the animation to look sloppy.
setTimeout(function () {
window.removeEventListener('scroll', scrollCallback);
}, 450);
context.core.image.lightboxEnabled = false;
context.core.image.lastFocusedElement.focus({
preventScroll: true
@ -111,6 +172,30 @@ const focusableSelectors = ['a[href]', 'area[href]', 'input:not([disabled]):not(
context,
ref
});
},
handleTouchStart: () => {
isTouching = true;
},
handleTouchMove: ({
context,
event
}) => {
// On mobile devices, we want to prevent triggering the
// scroll event because otherwise the page jumps around as
// we reset the scroll position. This also means that closing
// the lightbox requires that a user perform a simple tap. This
// may be changed in the future if we find a better alternative
// to override or reset the scroll position during swipe actions.
if (context.core.image.lightboxEnabled) {
event.preventDefault();
}
},
handleTouchEnd: () => {
// We need to wait a few milliseconds before resetting
// to ensure that pinch to zoom works consistently
// on mobile devices when the lightbox is open.
lastTouchTime = Date.now();
isTouching = false;
}
}
}
@ -228,6 +313,14 @@ const focusableSelectors = ['a[href]', 'area[href]', 'input:not([disabled]):not(
}));
}
});
/*
* Computes styles for the lightbox and adds them to the document.
*
* @function
* @param {Object} context - An Interactivity API context
* @param {Object} event - A triggering event
*/
function setStyles(context, event) {
// The reference img element lies adjacent
// to the event target button in the DOM.
@ -378,6 +471,14 @@ function setStyles(context, event) {
}
`;
}
/*
* Debounces a function call.
*
* @function
* @param {Function} func - A function to be called
* @param {number} wait - The time to wait before calling the function
*/
function debounce(func, wait = 50) {
let timeout;
return () => {

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '1ba4adb54bc7c9f552d5');
<?php return array('dependencies' => array(), 'version' => 'd147cc02d5d2c29b2a8e');

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,5 @@
.wp-block-navigation .wp-block-navigation-item__label{
overflow-wrap:break-word;
word-break:normal;
}
.wp-block-navigation .wp-block-navigation-item__description{
display:none;

View File

@ -1 +1 @@
.wp-block-navigation .wp-block-navigation-item__label{overflow-wrap:break-word;word-break:normal}.wp-block-navigation .wp-block-navigation-item__description{display:none}
.wp-block-navigation .wp-block-navigation-item__label{overflow-wrap:break-word}.wp-block-navigation .wp-block-navigation-item__description{display:none}

View File

@ -1,6 +1,5 @@
.wp-block-navigation .wp-block-navigation-item__label{
overflow-wrap:break-word;
word-break:normal;
}
.wp-block-navigation .wp-block-navigation-item__description{
display:none;

View File

@ -1 +1 @@
.wp-block-navigation .wp-block-navigation-item__label{overflow-wrap:break-word;word-break:normal}.wp-block-navigation .wp-block-navigation-item__description{display:none}
.wp-block-navigation .wp-block-navigation-item__label{overflow-wrap:break-word}.wp-block-navigation .wp-block-navigation-item__description{display:none}

View File

@ -1201,10 +1201,10 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
}
.wp-lightbox-overlay .close-button{
cursor:pointer;
left:calc(env(safe-area-inset-left) + 12.5px);
left:calc(env(safe-area-inset-left) + 20px);
padding:0;
position:absolute;
top:calc(env(safe-area-inset-top) + 12.5px);
top:calc(env(safe-area-inset-top) + 20px);
z-index:5000000;
}
.wp-lightbox-overlay .lightbox-image-container{
@ -1293,10 +1293,6 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
}
}
html.wp-has-lightbox-open{
overflow:hidden;
}
@keyframes turn-on-visibility{
0%{
opacity:0;
@ -2047,7 +2043,6 @@ html.has-modal-open{
.wp-block-navigation .wp-block-navigation-item__label{
overflow-wrap:break-word;
word-break:normal;
}
.wp-block-navigation .wp-block-navigation-item__description{
display:none;

File diff suppressed because one or more lines are too long

View File

@ -1203,8 +1203,8 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
cursor:pointer;
padding:0;
position:absolute;
right:calc(env(safe-area-inset-right) + 12.5px);
top:calc(env(safe-area-inset-top) + 12.5px);
right:calc(env(safe-area-inset-right) + 20px);
top:calc(env(safe-area-inset-top) + 20px);
z-index:5000000;
}
.wp-lightbox-overlay .lightbox-image-container{
@ -1293,10 +1293,6 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
}
}
html.wp-has-lightbox-open{
overflow:hidden;
}
@keyframes turn-on-visibility{
0%{
opacity:0;
@ -2047,7 +2043,6 @@ html.has-modal-open{
.wp-block-navigation .wp-block-navigation-item__label{
overflow-wrap:break-word;
word-break:normal;
}
.wp-block-navigation .wp-block-navigation-item__description{
display:none;

File diff suppressed because one or more lines are too long

View File

@ -3055,7 +3055,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
.edit-site-sidebar-navigation-screen__title{
flex-grow:1;
overflow:hidden;
overflow-wrap:break-word;
padding:6px 0 0;
}
@ -3649,11 +3648,22 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
align-items:center;
background-color:#f0f0f0;
display:flex;
height:100px;
height:250px;
justify-content:center;
width:100%;
}
.font-library-modal__local-fonts{
margin:0 auto;
width:80%;
}
.font-library-modal__local-fonts .font-library-modal__upload-area__text{
color:#6e6e6e;
}
.font-library-modal__local-fonts .font-library-modal__upload-area__notice{
margin:0;
}
.font-library-modal__font-name{
font-weight:700;
}
@ -3692,6 +3702,10 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
width:50%;
}
.font-library-modal__font-collection__notice{
margin:0;
}
body.js #wpadminbar{
display:none;
}

File diff suppressed because one or more lines are too long

View File

@ -3055,7 +3055,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
.edit-site-sidebar-navigation-screen__title{
flex-grow:1;
overflow:hidden;
overflow-wrap:break-word;
padding:6px 0 0;
}
@ -3649,11 +3648,22 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
align-items:center;
background-color:#f0f0f0;
display:flex;
height:100px;
height:250px;
justify-content:center;
width:100%;
}
.font-library-modal__local-fonts{
margin:0 auto;
width:80%;
}
.font-library-modal__local-fonts .font-library-modal__upload-area__text{
color:#6e6e6e;
}
.font-library-modal__local-fonts .font-library-modal__upload-area__notice{
margin:0;
}
.font-library-modal__font-name{
font-weight:700;
}
@ -3692,6 +3702,10 @@ body:has(.edit-site-resizable-frame__inner.is-resizing){
width:50%;
}
.font-library-modal__font-collection__notice{
margin:0;
}
body.js #wpadminbar{
display:none;
}

File diff suppressed because one or more lines are too long

View File

@ -13580,6 +13580,27 @@ function scopeSelector(scope, selector) {
return selectorsScoped.join(', ');
}
/**
* Appends a sub-selector to an existing one.
*
* Given the compounded `selector` "h1, h2, h3"
* and the `toAppend` selector ".some-class" the result will be
* "h1.some-class, h2.some-class, h3.some-class".
*
* @param {string} selector Original selector.
* @param {string} toAppend Selector to append.
*
* @return {string} The new selector.
*/
function appendToSelector(selector, toAppend) {
if (!selector.includes(',')) {
return selector + toAppend;
}
const selectors = selector.split(',');
const newSelectors = selectors.map(sel => sel + toAppend);
return newSelectors.join(',');
}
/**
* Compares global style variations according to their styles and settings properties.
*
@ -13673,7 +13694,7 @@ function useGlobalSetting(propertyPath, blockName, source = 'all') {
VALID_SETTINGS.forEach(setting => {
var _getValueFromObjectPa2;
const value = (_getValueFromObjectPa2 = getValueFromObjectPath(configToUse, `settings${appendedBlockPath}.${setting}`)) !== null && _getValueFromObjectPa2 !== void 0 ? _getValueFromObjectPa2 : getValueFromObjectPath(configToUse, `settings.${setting}`);
if (value) {
if (value !== undefined) {
result = setImmutably(result, setting.split('.'), value);
}
});
@ -33577,6 +33598,7 @@ const globe = (0,external_wp_element_namespaceObject.createElement)(external_wp_
const ICONS_MAP = {
post: post_list,
page: library_page,
@ -33602,6 +33624,40 @@ function SearchItemIcon({
}
return null;
}
/**
* Adds a leading slash to a url if it doesn't already have one.
* @param {string} url the url to add a leading slash to.
* @return {string} the url with a leading slash.
*/
function addLeadingSlash(url) {
const trimmedURL = url?.trim();
if (!trimmedURL?.length) return url;
return url?.replace(/^\/?/, '/');
}
function removeTrailingSlash(url) {
const trimmedURL = url?.trim();
if (!trimmedURL?.length) return url;
return url?.replace(/\/$/, '');
}
const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs);
const defaultTo = d => v => {
return v === null || v === undefined || v !== v ? d : v;
};
/**
* Prepares a URL for display in the UI.
* - decodes the URL.
* - filters it (removes protocol, www, etc.).
* - truncates it if necessary.
* - adds a leading slash.
* @param {string} url the url.
* @return {string} the processed url to display.
*/
function getURLForDisplay(url) {
if (!url) return url;
return (0,external_wp_compose_namespaceObject.pipe)(external_wp_url_namespaceObject.safeDecodeURI, external_wp_url_namespaceObject.getPath, defaultTo(''), partialRight(external_wp_url_namespaceObject.filterURLForDisplay, 24), removeTrailingSlash, addLeadingSlash)(url);
}
const LinkControlSearchItem = ({
itemProps,
suggestion,
@ -33610,7 +33666,7 @@ const LinkControlSearchItem = ({
isURL = false,
shouldShowType = false
}) => {
const info = isURL ? (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link') : (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(suggestion?.url), 24);
const info = isURL ? (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link') : getURLForDisplay(suggestion.url);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
...itemProps,
info: info,
@ -44119,9 +44175,12 @@ function RenameModal({
const autoSelectInputText = event => event.target.select();
const dialogDescription = (0,external_wp_compose_namespaceObject.useInstanceId)(RenameModal, `block-editor-rename-modal__description`);
const handleSubmit = () => {
const message = nameIsOriginal || nameIsEmpty ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name reset to: "%s".'), editedBlockName) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'), editedBlockName);
// Must be assertive to immediately announce change.
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %1$s: type of update (either reset of changed). %2$s: new name/label for the block */
(0,external_wp_i18n_namespaceObject.__)('Block name %1$s to: "%2$s".'), nameIsOriginal || nameIsEmpty ? (0,external_wp_i18n_namespaceObject.__)('reset') : (0,external_wp_i18n_namespaceObject.__)('changed'), editedBlockName), 'assertive');
(0,external_wp_a11y_namespaceObject.speak)(message, 'assertive');
onSave(editedBlockName);
// Immediate close avoids ability to hit save multiple times.
@ -56123,7 +56182,8 @@ function ToolSelector(props, ref) {
label: (0,external_wp_i18n_namespaceObject.__)('Tools')
}),
popoverProps: {
placement: 'bottom-start'
placement: 'bottom-start',
variant: undefined
},
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, {
role: "menu",
@ -62160,18 +62220,29 @@ function updateConfigWithSeparator(config) {
}
return config;
}
const processCSSNesting = (css, blockSelector) => {
function processCSSNesting(css, blockSelector) {
let processedCSS = '';
// Split CSS nested rules.
const parts = css.split('&');
parts.forEach(part => {
processedCSS += !part.includes('{') ? blockSelector + '{' + part + '}' // If the part doesn't contain braces, it applies to the root level.
: blockSelector + part; // Prepend the selector, which effectively replaces the "&" character.
const isRootCss = !part.includes('{');
if (isRootCss) {
// If the part doesn't contain braces, it applies to the root level.
processedCSS += `${blockSelector}{${part.trim()}}`;
} else {
// If the part contains braces, it's a nested CSS rule.
const splittedPart = part.replace('}', '').split('{');
if (splittedPart.length !== 2) {
return;
}
const [nestedSelector, cssValue] = splittedPart;
const combinedSelector = nestedSelector.startsWith(' ') ? scopeSelector(blockSelector, nestedSelector) : appendToSelector(blockSelector, nestedSelector);
processedCSS += `${combinedSelector}{${cssValue.trim()}}`;
}
});
return processedCSS;
};
}
/**
* Returns the global styles output using a global styles configuration.

File diff suppressed because one or more lines are too long

View File

@ -24103,7 +24103,7 @@ function image_Image({
availableUnits: ['px']
});
const lightboxSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('lightbox');
const showLightboxToggle = lightboxSetting === true || lightboxSetting?.allowEditing === true;
const showLightboxToggle = !!lightbox || lightboxSetting?.allowEditing === true;
const lightboxChecked = lightbox?.enabled || !lightbox && lightboxSetting?.enabled;
const dimensionsControl = (0,external_wp_element_namespaceObject.createElement)(DimensionsTool, {
value: {
@ -36709,7 +36709,7 @@ function ParagraphBlock({
onMerge: mergeBlocks,
onReplace: onReplace,
onRemove: onRemove,
"aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Paragraph block') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
"aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Block: Paragraph') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
"data-empty": content ? false : true,
placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
"data-custom-placeholder": placeholder ? true : undefined,
@ -46918,7 +46918,7 @@ function SearchEdit({
isSearchFieldHidden,
style
} = attributes;
const insertedInNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
const wasJustInsertedIntoNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockParentsByBlockName,
wasBlockJustInserted
@ -46928,15 +46928,17 @@ function SearchEdit({
const {
__unstableMarkNextChangeAsNotPersistent
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
if (insertedInNavigationBlock) {
// This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
setAttributes({
showLabel: false,
buttonUseIcon: true,
buttonPosition: 'button-inside'
});
}
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (wasJustInsertedIntoNavigationBlock) {
// This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
setAttributes({
showLabel: false,
buttonUseIcon: true,
buttonPosition: 'button-inside'
});
}
}, [__unstableMarkNextChangeAsNotPersistent, wasJustInsertedIntoNavigationBlock, setAttributes]);
const borderRadius = style?.border?.radius;
const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);

File diff suppressed because one or more lines are too long

View File

@ -36760,6 +36760,7 @@ function overlayMiddlewares() {
/**
* Name of slot in which popover should fill.
*
@ -37031,7 +37032,9 @@ const UnforwardedPopover = (props, forwardedRef) => {
name: slotName
}, content);
} else if (!inline) {
content = (0,external_wp_element_namespaceObject.createPortal)(content, getPopoverFallbackContainer());
content = (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(StyleProvider, {
document: document
}, content), getPopoverFallbackContainer());
}
if (hasAnchor) {
return content;

File diff suppressed because one or more lines are too long

View File

@ -299,7 +299,8 @@ function orderEntityRecordsBySearch(records = [], search = '') {
const {
useHistory: site_editor_navigation_commands_useHistory
useHistory: site_editor_navigation_commands_useHistory,
useLocation
} = unlock(external_wp_router_namespaceObject.privateApis);
const icons = {
post: library_post,
@ -388,6 +389,9 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
search
}) {
const history = site_editor_navigation_commands_useHistory();
const location = useLocation();
const isPatternsPage = location?.params?.path === '/patterns' || location?.params?.postType === 'wp_block';
const didAccessPatternsPage = !!location?.params?.didAccessPatternsPage;
const isBlockBasedTheme = useIsBlockBasedTheme();
const {
records,
@ -433,6 +437,7 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
const args = {
postType: templateType,
postId: record.id,
didAccessPatternsPage: !isBlockBasedTheme && (isPatternsPage || didAccessPatternsPage) ? 1 : undefined,
...extraArgs
};
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1318,6 +1318,11 @@ function InlineColorUI({
onClose,
contentRef
}) {
const popoverAnchor = (0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: text_color_textColor
});
/*
As you change the text color by typing a HEX value into a field,
the return value of document.getSelection jumps to the field you're editing,
@ -1325,10 +1330,8 @@ function InlineColorUI({
it will return null, since it can't find the <mark> element within the HEX input.
This caches the last truthy value of the selection anchor reference.
*/
const popoverAnchor = (0,external_wp_blockEditor_namespaceObject.useCachedTruthy)((0,external_wp_richText_namespaceObject.useAnchor)({
editableContentElement: contentRef.current,
settings: text_color_textColor
}));
const cachedRect = (0,external_wp_blockEditor_namespaceObject.useCachedTruthy)(popoverAnchor.getBoundingClientRect());
popoverAnchor.getBoundingClientRect = () => cachedRect;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
onClose: onClose,
className: "components-inline-color-popover",

File diff suppressed because one or more lines are too long

View File

@ -28,8 +28,8 @@ var preact_module_n,
preact_module_c = {},
s = [],
a = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,
h = Array.isArray;
function v(n, l) {
v = Array.isArray;
function h(n, l) {
for (var u in l) n[u] = l[u];
return n;
}
@ -77,7 +77,7 @@ function b(n, l) {
}
function g(n, l) {
if (null == l) return n.__ ? g(n.__, n.__.__k.indexOf(n) + 1) : null;
for (var u; l < n.__k.length; l++) if (null != (u = n.__k[l]) && null != u.__e) return u.__e;
for (var u; l < n.__k.length; l++) if (null != (u = n.__k[l]) && null != u.__e) return u.__d || u.__e;
return "function" == typeof n.type ? g(n) : null;
}
function m(n) {
@ -95,10 +95,10 @@ function w(n) {
}
function x() {
var n, l, u, t, o, r, e, c, s;
for (i.sort(preact_module_f); n = i.shift();) n.__d && (l = i.length, t = void 0, o = void 0, r = void 0, c = (e = (u = n).__v).__e, (s = u.__P) && (t = [], o = [], (r = v({}, e)).__v = e.__v + 1, L(s, e, r, u.__n, void 0 !== s.ownerSVGElement, null != e.__h ? [c] : null, t, null == c ? g(e) : c, e.__h, o), M(t, e, o), e.__e != c && m(e)), i.length > l && i.sort(preact_module_f));
for (i.sort(preact_module_f); n = i.shift();) n.__d && (l = i.length, t = void 0, o = void 0, r = void 0, c = (e = (u = n).__v).__e, (s = u.__P) && (t = [], o = [], (r = h({}, e)).__v = e.__v + 1, z(s, e, r, u.__n, void 0 !== s.ownerSVGElement, null != e.__h ? [c] : null, t, null == c ? g(e) : c, e.__h, o), L(t, e, o), e.__e != c && m(e)), i.length > l && i.sort(preact_module_f));
x.__r = 0;
}
function P(n, l, u, t, i, o, r, f, e, a, v) {
function P(n, l, u, t, i, o, r, f, e, a, h) {
var p,
y,
_,
@ -108,22 +108,22 @@ function P(n, l, u, t, i, o, r, f, e, a, v) {
x,
P,
C,
H = 0,
I = t && t.__k || s,
T = I.length,
j = T,
z = l.length;
for (u.__k = [], p = 0; p < z; p++) null != (b = u.__k[p] = null == (b = l[p]) || "boolean" == typeof b || "function" == typeof b ? null : "string" == typeof b || "number" == typeof b || "bigint" == typeof b ? d(null, b, null, null, b) : h(b) ? d(k, {
D = 0,
H = t && t.__k || s,
I = H.length,
T = I,
j = l.length;
for (u.__k = [], p = 0; p < j; p++) null != (b = u.__k[p] = null == (b = l[p]) || "boolean" == typeof b || "function" == typeof b ? null : "string" == typeof b || "number" == typeof b || "bigint" == typeof b ? d(null, b, null, null, b) : v(b) ? d(k, {
children: b
}, null, null, null) : b.__b > 0 ? d(b.type, b.props, b.key, b.ref ? b.ref : null, b.__v) : b) ? (b.__ = u, b.__b = u.__b + 1, -1 === (P = A(b, I, x = p + H, j)) ? _ = preact_module_c : (_ = I[P] || preact_module_c, I[P] = void 0, j--), L(n, b, _, i, o, r, f, e, a, v), m = b.__e, (y = b.ref) && _.ref != y && (_.ref && O(_.ref, null, b), v.push(y, b.__c || m, b)), null != m && (null == w && (w = m), (C = _ === preact_module_c || null === _.__v) ? -1 == P && H-- : P !== x && (P === x + 1 ? H++ : P > x ? j > z - x ? H += P - x : H-- : H = P < x && P == x - 1 ? P - x : 0), x = p + H, "function" != typeof b.type || P === x && _.__k !== b.__k ? "function" == typeof b.type || P === x && !C ? void 0 !== b.__d ? (e = b.__d, b.__d = void 0) : e = m.nextSibling : e = S(n, m, e) : e = $(b, e, n), "function" == typeof u.type && (u.__d = e))) : (_ = I[p]) && null == _.key && _.__e && (_.__e == e && (e = g(_)), q(_, _, !1), I[p] = null);
for (u.__e = w, p = T; p--;) null != I[p] && ("function" == typeof u.type && null != I[p].__e && I[p].__e == u.__d && (u.__d = I[p].__e.nextSibling), q(I[p], I[p]));
}, null, null, null) : b.__b > 0 ? d(b.type, b.props, b.key, b.ref ? b.ref : null, b.__v) : b) ? (b.__ = u, b.__b = u.__b + 1, -1 === (P = A(b, H, x = p + D, T)) ? _ = preact_module_c : (_ = H[P] || preact_module_c, H[P] = void 0, T--), z(n, b, _, i, o, r, f, e, a, h), m = b.__e, (y = b.ref) && _.ref != y && (_.ref && N(_.ref, null, b), h.push(y, b.__c || m, b)), null != m && (null == w && (w = m), (C = _ === preact_module_c || null === _.__v) ? -1 == P && D-- : P !== x && (P === x + 1 ? D++ : P > x ? T > j - x ? D += P - x : D-- : D = P < x && P == x - 1 ? P - x : 0), x = p + D, "function" != typeof b.type || P === x && _.__k !== b.__k ? "function" == typeof b.type || P === x && !C ? void 0 !== b.__d ? (e = b.__d, b.__d = void 0) : e = m.nextSibling : e = S(n, m, e) : e = $(b, e, n), "function" == typeof u.type && (u.__d = e))) : (_ = H[p]) && null == _.key && _.__e && (_.__e == e && (_.__ = t, e = g(_)), O(_, _, !1), H[p] = null);
for (u.__e = w, p = I; p--;) null != H[p] && ("function" == typeof u.type && null != H[p].__e && H[p].__e == u.__d && (u.__d = H[p].__e.nextSibling), O(H[p], H[p]));
}
function $(n, l, u) {
for (var t, i = n.__k, o = 0; i && o < i.length; o++) (t = i[o]) && (t.__ = n, l = "function" == typeof t.type ? $(t, l, u) : S(u, t.__e, l));
return l;
}
function C(n, l) {
return l = l || [], null == n || "boolean" == typeof n || (h(n) ? n.some(function (n) {
return l = l || [], null == n || "boolean" == typeof n || (v(n) ? n.some(function (n) {
C(n, l);
}) : l.push(n)), l;
}
@ -149,36 +149,40 @@ function A(n, l, u, t) {
}
return -1;
}
function H(n, l, u, t, i) {
function D(n, l, u, t, i) {
var o;
for (o in u) "children" === o || "key" === o || o in l || T(n, o, null, u[o], t);
for (o in l) i && "function" != typeof l[o] || "children" === o || "key" === o || "value" === o || "checked" === o || u[o] === l[o] || T(n, o, l[o], u[o], t);
for (o in u) "children" === o || "key" === o || o in l || I(n, o, null, u[o], t);
for (o in l) i && "function" != typeof l[o] || "children" === o || "key" === o || "value" === o || "checked" === o || u[o] === l[o] || I(n, o, l[o], u[o], t);
}
function I(n, l, u) {
function H(n, l, u) {
"-" === l[0] ? n.setProperty(l, null == u ? "" : u) : n[l] = null == u ? "" : "number" != typeof u || a.test(l) ? u : u + "px";
}
function T(n, l, u, t, i) {
function I(n, l, u, t, i) {
var o;
n: if ("style" === l) {
if ("string" == typeof u) n.style.cssText = u;else {
if ("string" == typeof t && (n.style.cssText = t = ""), t) for (l in t) u && l in u || I(n.style, l, "");
if (u) for (l in u) t && u[l] === t[l] || I(n.style, l, u[l]);
if ("string" == typeof t && (n.style.cssText = t = ""), t) for (l in t) u && l in u || H(n.style, l, "");
if (u) for (l in u) t && u[l] === t[l] || H(n.style, l, u[l]);
}
} else if ("o" === l[0] && "n" === l[1]) o = l !== (l = l.replace(/(PointerCapture)$|Capture$/, "$1")), l = l.toLowerCase() in n ? l.toLowerCase().slice(2) : l.slice(2), n.l || (n.l = {}), n.l[l + o] = u, u ? t || n.addEventListener(l, o ? z : j, o) : n.removeEventListener(l, o ? z : j, o);else if ("dangerouslySetInnerHTML" !== l) {
if (i) l = l.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");else if ("width" !== l && "height" !== l && "href" !== l && "list" !== l && "form" !== l && "tabIndex" !== l && "download" !== l && "rowSpan" !== l && "colSpan" !== l && l in n) try {
} else if ("o" === l[0] && "n" === l[1]) o = l !== (l = l.replace(/(PointerCapture)$|Capture$/, "$1")), l = l.toLowerCase() in n ? l.toLowerCase().slice(2) : l.slice(2), n.l || (n.l = {}), n.l[l + o] = u, u ? t ? u.u = t.u : (u.u = Date.now(), n.addEventListener(l, o ? j : T, o)) : n.removeEventListener(l, o ? j : T, o);else if ("dangerouslySetInnerHTML" !== l) {
if (i) l = l.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");else if ("width" !== l && "height" !== l && "href" !== l && "list" !== l && "form" !== l && "tabIndex" !== l && "download" !== l && "rowSpan" !== l && "colSpan" !== l && "role" !== l && l in n) try {
n[l] = null == u ? "" : u;
break n;
} catch (n) {}
"function" == typeof u || (null == u || !1 === u && "-" !== l[4] ? n.removeAttribute(l) : n.setAttribute(l, u));
}
}
function j(n) {
return this.l[n.type + !1](preact_module_l.event ? preact_module_l.event(n) : n);
function T(n) {
var u = this.l[n.type + !1];
if (n.t) {
if (n.t <= u.u) return;
} else n.t = Date.now();
return u(preact_module_l.event ? preact_module_l.event(n) : n);
}
function z(n) {
function j(n) {
return this.l[n.type + !0](preact_module_l.event ? preact_module_l.event(n) : n);
}
function L(n, u, t, i, o, r, f, e, c, s) {
function z(n, u, t, i, o, r, f, e, c, s) {
var a,
p,
y,
@ -192,14 +196,14 @@ function L(n, u, t, i, o, r, f, e, c, s) {
C,
S,
A,
D,
H,
I,
T = u.type;
I = u.type;
if (void 0 !== u.constructor) return null;
null != t.__h && (c = t.__h, e = u.__e = t.__e, u.__h = null, r = [e]), (a = preact_module_l.__b) && a(u);
n: if ("function" == typeof T) try {
if (w = u.props, x = (a = T.contextType) && i[a.__c], $ = a ? x ? x.props.value : a.__ : i, t.__c ? m = (p = u.__c = t.__c).__ = p.__E : ("prototype" in T && T.prototype.render ? u.__c = p = new T(w, $) : (u.__c = p = new b(w, $), p.constructor = T, p.render = B), x && x.sub(p), p.props = w, p.state || (p.state = {}), p.context = $, p.__n = i, y = p.__d = !0, p.__h = [], p._sb = []), null == p.__s && (p.__s = p.state), null != T.getDerivedStateFromProps && (p.__s == p.state && (p.__s = v({}, p.__s)), v(p.__s, T.getDerivedStateFromProps(w, p.__s))), d = p.props, _ = p.state, p.__v = u, y) null == T.getDerivedStateFromProps && null != p.componentWillMount && p.componentWillMount(), null != p.componentDidMount && p.__h.push(p.componentDidMount);else {
if (null == T.getDerivedStateFromProps && w !== d && null != p.componentWillReceiveProps && p.componentWillReceiveProps(w, $), !p.__e && (null != p.shouldComponentUpdate && !1 === p.shouldComponentUpdate(w, p.__s, $) || u.__v === t.__v)) {
n: if ("function" == typeof I) try {
if (w = u.props, x = (a = I.contextType) && i[a.__c], $ = a ? x ? x.props.value : a.__ : i, t.__c ? m = (p = u.__c = t.__c).__ = p.__E : ("prototype" in I && I.prototype.render ? u.__c = p = new I(w, $) : (u.__c = p = new b(w, $), p.constructor = I, p.render = q), x && x.sub(p), p.props = w, p.state || (p.state = {}), p.context = $, p.__n = i, y = p.__d = !0, p.__h = [], p._sb = []), null == p.__s && (p.__s = p.state), null != I.getDerivedStateFromProps && (p.__s == p.state && (p.__s = h({}, p.__s)), h(p.__s, I.getDerivedStateFromProps(w, p.__s))), d = p.props, _ = p.state, p.__v = u, y) null == I.getDerivedStateFromProps && null != p.componentWillMount && p.componentWillMount(), null != p.componentDidMount && p.__h.push(p.componentDidMount);else {
if (null == I.getDerivedStateFromProps && w !== d && null != p.componentWillReceiveProps && p.componentWillReceiveProps(w, $), !p.__e && (null != p.shouldComponentUpdate && !1 === p.shouldComponentUpdate(w, p.__s, $) || u.__v === t.__v)) {
for (u.__v !== t.__v && (p.props = w, p.state = p.__s, p.__d = !1), u.__e = t.__e, u.__k = t.__k, u.__k.forEach(function (n) {
n && (n.__ = u);
}), C = 0; C < p._sb.length; C++) p.__h.push(p._sb[C]);
@ -210,20 +214,20 @@ function L(n, u, t, i, o, r, f, e, c, s) {
p.componentDidUpdate(d, _, g);
});
}
if (p.context = $, p.props = w, p.__P = n, p.__e = !1, S = preact_module_l.__r, A = 0, "prototype" in T && T.prototype.render) {
for (p.state = p.__s, p.__d = !1, S && S(u), a = p.render(p.props, p.state, p.context), H = 0; H < p._sb.length; H++) p.__h.push(p._sb[H]);
if (p.context = $, p.props = w, p.__P = n, p.__e = !1, S = preact_module_l.__r, A = 0, "prototype" in I && I.prototype.render) {
for (p.state = p.__s, p.__d = !1, S && S(u), a = p.render(p.props, p.state, p.context), D = 0; D < p._sb.length; D++) p.__h.push(p._sb[D]);
p._sb = [];
} else do {
p.__d = !1, S && S(u), a = p.render(p.props, p.state, p.context), p.state = p.__s;
} while (p.__d && ++A < 25);
p.state = p.__s, null != p.getChildContext && (i = v(v({}, i), p.getChildContext())), y || null == p.getSnapshotBeforeUpdate || (g = p.getSnapshotBeforeUpdate(d, _)), P(n, h(I = null != a && a.type === k && null == a.key ? a.props.children : a) ? I : [I], u, t, i, o, r, f, e, c, s), p.base = u.__e, u.__h = null, p.__h.length && f.push(p), m && (p.__E = p.__ = null);
p.state = p.__s, null != p.getChildContext && (i = h(h({}, i), p.getChildContext())), y || null == p.getSnapshotBeforeUpdate || (g = p.getSnapshotBeforeUpdate(d, _)), P(n, v(H = null != a && a.type === k && null == a.key ? a.props.children : a) ? H : [H], u, t, i, o, r, f, e, c, s), p.base = u.__e, u.__h = null, p.__h.length && f.push(p), m && (p.__E = p.__ = null);
} catch (n) {
u.__v = null, (c || null != r) && (u.__e = e, u.__h = !!c, r[r.indexOf(e)] = null), preact_module_l.__e(n, u, t);
} else null == r && u.__v === t.__v ? (u.__k = t.__k, u.__e = t.__e) : u.__e = N(t.__e, u, t, i, o, r, f, c, s);
} else null == r && u.__v === t.__v ? (u.__k = t.__k, u.__e = t.__e) : u.__e = M(t.__e, u, t, i, o, r, f, c, s);
(a = preact_module_l.diffed) && a(u);
}
function M(n, u, t) {
for (var i = 0; i < t.length; i++) O(t[i], t[++i], t[++i]);
function L(n, u, t) {
for (var i = 0; i < t.length; i++) N(t[i], t[++i], t[++i]);
preact_module_l.__c && preact_module_l.__c(u, n), n.some(function (u) {
try {
n = u.__h, u.__h = [], n.some(function (n) {
@ -234,9 +238,9 @@ function M(n, u, t) {
}
});
}
function N(l, u, t, i, o, r, f, e, s) {
function M(l, u, t, i, o, r, f, e, s) {
var a,
v,
h,
y,
d = t.props,
_ = u.props,
@ -251,25 +255,25 @@ function N(l, u, t, i, o, r, f, e, s) {
l = o ? document.createElementNS("http://www.w3.org/2000/svg", k) : document.createElement(k, _.is && _), r = null, e = !1;
}
if (null === k) d === _ || e && l.data === _ || (l.data = _);else {
if (r = r && preact_module_n.call(l.childNodes), v = (d = t.props || preact_module_c).dangerouslySetInnerHTML, y = _.dangerouslySetInnerHTML, !e) {
if (r = r && preact_module_n.call(l.childNodes), h = (d = t.props || preact_module_c).dangerouslySetInnerHTML, y = _.dangerouslySetInnerHTML, !e) {
if (null != r) for (d = {}, b = 0; b < l.attributes.length; b++) d[l.attributes[b].name] = l.attributes[b].value;
(y || v) && (y && (v && y.__html == v.__html || y.__html === l.innerHTML) || (l.innerHTML = y && y.__html || ""));
(y || h) && (y && (h && y.__html == h.__html || y.__html === l.innerHTML) || (l.innerHTML = y && y.__html || ""));
}
if (H(l, _, d, o, e), y) u.__k = [];else if (P(l, h(b = u.props.children) ? b : [b], u, t, i, o && "foreignObject" !== k, r, f, r ? r[0] : t.__k && g(t, 0), e, s), null != r) for (b = r.length; b--;) null != r[b] && p(r[b]);
e || ("value" in _ && void 0 !== (b = _.value) && (b !== l.value || "progress" === k && !b || "option" === k && b !== d.value) && T(l, "value", b, d.value, !1), "checked" in _ && void 0 !== (b = _.checked) && b !== l.checked && T(l, "checked", b, d.checked, !1));
if (D(l, _, d, o, e), y) u.__k = [];else if (P(l, v(b = u.props.children) ? b : [b], u, t, i, o && "foreignObject" !== k, r, f, r ? r[0] : t.__k && g(t, 0), e, s), null != r) for (b = r.length; b--;) null != r[b] && p(r[b]);
e || ("value" in _ && void 0 !== (b = _.value) && (b !== l.value || "progress" === k && !b || "option" === k && b !== d.value) && I(l, "value", b, d.value, !1), "checked" in _ && void 0 !== (b = _.checked) && b !== l.checked && I(l, "checked", b, d.checked, !1));
}
return l;
}
function O(n, u, t) {
function N(n, u, t) {
try {
"function" == typeof n ? n(u) : n.current = u;
} catch (n) {
preact_module_l.__e(n, t);
}
}
function q(n, u, t) {
function O(n, u, t) {
var i, o;
if (preact_module_l.unmount && preact_module_l.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || O(i, null, u)), null != (i = n.__c)) {
if (preact_module_l.unmount && preact_module_l.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || N(i, null, u)), null != (i = n.__c)) {
if (i.componentWillUnmount) try {
i.componentWillUnmount();
} catch (n) {
@ -277,25 +281,25 @@ function q(n, u, t) {
}
i.base = i.__P = null, n.__c = void 0;
}
if (i = n.__k) for (o = 0; o < i.length; o++) i[o] && q(i[o], u, t || "function" != typeof n.type);
if (i = n.__k) for (o = 0; o < i.length; o++) i[o] && O(i[o], u, t || "function" != typeof n.type);
t || null == n.__e || p(n.__e), n.__ = n.__e = n.__d = void 0;
}
function B(n, l, u) {
function q(n, l, u) {
return this.constructor(n, u);
}
function D(u, t, i) {
function B(u, t, i) {
var o, r, f, e;
preact_module_l.__ && preact_module_l.__(u, t), r = (o = "function" == typeof i) ? null : i && i.__k || t.__k, f = [], e = [], L(t, u = (!o && i || t).__k = y(k, null, [u]), r || preact_module_c, preact_module_c, void 0 !== t.ownerSVGElement, !o && i ? [i] : r ? null : t.firstChild ? preact_module_n.call(t.childNodes) : null, f, !o && i ? i : r ? r.__e : t.firstChild, o, e), M(f, u, e);
preact_module_l.__ && preact_module_l.__(u, t), r = (o = "function" == typeof i) ? null : i && i.__k || t.__k, f = [], e = [], z(t, u = (!o && i || t).__k = y(k, null, [u]), r || preact_module_c, preact_module_c, void 0 !== t.ownerSVGElement, !o && i ? [i] : r ? null : t.firstChild ? preact_module_n.call(t.childNodes) : null, f, !o && i ? i : r ? r.__e : t.firstChild, o, e), L(f, u, e);
}
function E(n, l) {
D(n, l, E);
B(n, l, E);
}
function F(l, u, t) {
var i,
o,
r,
f,
e = v({}, l.props);
e = h({}, l.props);
for (r in l.type && l.type.defaultProps && (f = l.type.defaultProps), u) "key" == r ? i = u[r] : "ref" == r ? o = u[r] : e[r] = void 0 === u[r] && void 0 !== f ? f[r] : u[r];
return arguments.length > 2 && (e.children = arguments.length > 3 ? preact_module_n.call(arguments, 2) : t), d(l.type, e, i || l.key, o || l.ref, null);
}
@ -338,7 +342,7 @@ preact_module_n = s.slice, preact_module_l = {
return null != n && void 0 === n.constructor;
}, b.prototype.setState = function (n, l) {
var u;
u = null != this.__s && this.__s !== this.state ? this.__s : this.__s = v({}, this.state), "function" == typeof n && (n = n(v({}, u), this.props)), n && v(u, n), null != n && this.__v && (l && this._sb.push(l), w(this));
u = null != this.__s && this.__s !== this.state ? this.__s : this.__s = h({}, this.state), "function" == typeof n && (n = n(h({}, u), this.props)), n && h(u, n), null != n && this.__v && (l && this._sb.push(l), w(this));
}, b.prototype.forceUpdate = function (n) {
this.__v && (this.__e = !0, n && this.__h.push(n), w(this));
}, b.prototype.render = k, i = [], r = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, preact_module_f = function (n, l) {
@ -1248,7 +1252,7 @@ function Portal(props) {
const _this = this;
const container = props._container;
_this.componentWillUnmount = function () {
D(null, _this._temp);
B(null, _this._temp);
_this._temp = null;
_this._container = null;
};
@ -1288,7 +1292,7 @@ function Portal(props) {
}
// Render our wrapping element into temp.
D(y(ContextProvider, {
B(y(ContextProvider, {
context: _this.context
}, props._vnode), _this._temp);
}
@ -2373,7 +2377,7 @@ const renderRegions = page => {
document.querySelectorAll(`[${attrName}]`).forEach(region => {
const id = region.getAttribute(attrName);
const fragment = getRegionRootFragment(region);
D(page.regions[id], fragment);
B(page.regions[id], fragment);
});
};

File diff suppressed because one or more lines are too long

View File

@ -1064,10 +1064,10 @@ const {
* @return {import('@wordpress/element').WPElement} Component.
*/
function ShortcutProvider(props) {
const keyboardShortcuts = (0,external_wp_element_namespaceObject.useRef)(new Set());
const [keyboardShortcuts] = (0,external_wp_element_namespaceObject.useState)(() => new Set());
function onKeyDown(event) {
if (props.onKeyDown) props.onKeyDown(event);
for (const keyboardShortcut of keyboardShortcuts.current) {
for (const keyboardShortcut of keyboardShortcuts) {
keyboardShortcut(event);
}
}

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ShortcutProvider:function(){return K},__unstableUseShortcutEventMatch:function(){return T},store:function(){return C},useShortcut:function(){return O}});var n={};e.r(n),e.d(n,{registerShortcut:function(){return i},unregisterShortcut:function(){return u}});var r={};e.r(r),e.d(r,{getAllShortcutKeyCombinations:function(){return m},getAllShortcutRawKeyCombinations:function(){return b},getCategoryShortcuts:function(){return R},getShortcutAliases:function(){return w},getShortcutDescription:function(){return g},getShortcutKeyCombination:function(){return v},getShortcutRepresentation:function(){return S}});var o=window.wp.data;var a=function(e={},t){switch(t.type){case"REGISTER_SHORTCUT":return{...e,[t.name]:{category:t.category,keyCombination:t.keyCombination,aliases:t.aliases,description:t.description}};case"UNREGISTER_SHORTCUT":const{[t.name]:n,...r}=e;return r}return e};function i({name:e,category:t,description:n,keyCombination:r,aliases:o}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:r,aliases:o,description:n}}function u(e){return{type:"UNREGISTER_SHORTCUT",name:e}}var c={};function s(e){return[e]}function l(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function f(e,t){var n,r=t||s;function o(){n=new WeakMap}function a(){var t,o,a,i,u,s=arguments.length;for(i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];for(t=function(e){var t,r,o,a,i,u=n,s=!0;for(t=0;t<e.length;t++){if(!(i=r=e[t])||"object"!=typeof i){s=!1;break}u.has(r)?u=u.get(r):(o=new WeakMap,u.set(r,o),u=o)}return u.has(c)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,u.set(c,a)),u.get(c)}(u=r.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!l(u,t.lastDependants,0)&&t.clear(),t.lastDependants=u),o=t.head;o;){if(l(o.args,i,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return a.getDependants=r,a.clear=o,o(),a}var d=window.wp.keycodes;const p=[],y={display:d.displayShortcut,raw:d.rawShortcut,ariaLabel:d.shortcutAriaLabel};function h(e,t){return e?e.modifier?y[t][e.modifier](e.character):e.character:null}function v(e,t){return e[t]?e[t].keyCombination:null}function S(e,t,n="display"){return h(v(e,t),n)}function g(e,t){return e[t]?e[t].description:null}function w(e,t){return e[t]&&e[t].aliases?e[t].aliases:p}const m=f(((e,t)=>[v(e,t),...w(e,t)].filter(Boolean)),((e,t)=>[e[t]])),b=f(((e,t)=>m(e,t).map((e=>h(e,"raw")))),((e,t)=>[e[t]])),R=f(((e,t)=>Object.entries(e).filter((([,e])=>e.category===t)).map((([e])=>e))),(e=>[e])),C=(0,o.createReduxStore)("core/keyboard-shortcuts",{reducer:a,actions:n,selectors:r});(0,o.register)(C);var E=window.wp.element;function T(){const{getAllShortcutKeyCombinations:e}=(0,o.useSelect)(C);return function(t,n){return e(t).some((({modifier:e,character:t})=>d.isKeyboardEvent[e](n,t)))}}const k=new Set,D=e=>{for(const t of k)t(e)},x=(0,E.createContext)({add:e=>{0===k.size&&document.addEventListener("keydown",D),k.add(e)},delete:e=>{k.delete(e),0===k.size&&document.removeEventListener("keydown",D)}});function O(e,t,{isDisabled:n=!1}={}){const r=(0,E.useContext)(x),o=T(),a=(0,E.useRef)();(0,E.useEffect)((()=>{a.current=t}),[t]),(0,E.useEffect)((()=>{if(!n)return r.add(t),()=>{r.delete(t)};function t(t){o(e,t)&&a.current(t)}}),[e,n,r])}const{Provider:U}=x;function K(e){const t=(0,E.useRef)(new Set);return(0,E.createElement)(U,{value:t},(0,E.createElement)("div",{...e,onKeyDown:function(n){e.onKeyDown&&e.onKeyDown(n);for(const e of t.current)e(n)}}))}(window.wp=window.wp||{}).keyboardShortcuts=t}();
!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ShortcutProvider:function(){return K},__unstableUseShortcutEventMatch:function(){return T},store:function(){return E},useShortcut:function(){return O}});var n={};e.r(n),e.d(n,{registerShortcut:function(){return i},unregisterShortcut:function(){return u}});var r={};e.r(r),e.d(r,{getAllShortcutKeyCombinations:function(){return m},getAllShortcutRawKeyCombinations:function(){return b},getCategoryShortcuts:function(){return C},getShortcutAliases:function(){return w},getShortcutDescription:function(){return g},getShortcutKeyCombination:function(){return v},getShortcutRepresentation:function(){return S}});var o=window.wp.data;var a=function(e={},t){switch(t.type){case"REGISTER_SHORTCUT":return{...e,[t.name]:{category:t.category,keyCombination:t.keyCombination,aliases:t.aliases,description:t.description}};case"UNREGISTER_SHORTCUT":const{[t.name]:n,...r}=e;return r}return e};function i({name:e,category:t,description:n,keyCombination:r,aliases:o}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:r,aliases:o,description:n}}function u(e){return{type:"UNREGISTER_SHORTCUT",name:e}}var c={};function s(e){return[e]}function l(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function d(e,t){var n,r=t||s;function o(){n=new WeakMap}function a(){var t,o,a,i,u,s=arguments.length;for(i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];for(t=function(e){var t,r,o,a,i,u=n,s=!0;for(t=0;t<e.length;t++){if(!(i=r=e[t])||"object"!=typeof i){s=!1;break}u.has(r)?u=u.get(r):(o=new WeakMap,u.set(r,o),u=o)}return u.has(c)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=s,u.set(c,a)),u.get(c)}(u=r.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!l(u,t.lastDependants,0)&&t.clear(),t.lastDependants=u),o=t.head;o;){if(l(o.args,i,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return a.getDependants=r,a.clear=o,o(),a}var f=window.wp.keycodes;const p=[],y={display:f.displayShortcut,raw:f.rawShortcut,ariaLabel:f.shortcutAriaLabel};function h(e,t){return e?e.modifier?y[t][e.modifier](e.character):e.character:null}function v(e,t){return e[t]?e[t].keyCombination:null}function S(e,t,n="display"){return h(v(e,t),n)}function g(e,t){return e[t]?e[t].description:null}function w(e,t){return e[t]&&e[t].aliases?e[t].aliases:p}const m=d(((e,t)=>[v(e,t),...w(e,t)].filter(Boolean)),((e,t)=>[e[t]])),b=d(((e,t)=>m(e,t).map((e=>h(e,"raw")))),((e,t)=>[e[t]])),C=d(((e,t)=>Object.entries(e).filter((([,e])=>e.category===t)).map((([e])=>e))),(e=>[e])),E=(0,o.createReduxStore)("core/keyboard-shortcuts",{reducer:a,actions:n,selectors:r});(0,o.register)(E);var R=window.wp.element;function T(){const{getAllShortcutKeyCombinations:e}=(0,o.useSelect)(E);return function(t,n){return e(t).some((({modifier:e,character:t})=>f.isKeyboardEvent[e](n,t)))}}const k=new Set,D=e=>{for(const t of k)t(e)},x=(0,R.createContext)({add:e=>{0===k.size&&document.addEventListener("keydown",D),k.add(e)},delete:e=>{k.delete(e),0===k.size&&document.removeEventListener("keydown",D)}});function O(e,t,{isDisabled:n=!1}={}){const r=(0,R.useContext)(x),o=T(),a=(0,R.useRef)();(0,R.useEffect)((()=>{a.current=t}),[t]),(0,R.useEffect)((()=>{if(!n)return r.add(t),()=>{r.delete(t)};function t(t){o(e,t)&&a.current(t)}}),[e,n,r])}const{Provider:U}=x;function K(e){const[t]=(0,R.useState)((()=>new Set));return(0,R.createElement)(U,{value:t},(0,R.createElement)("div",{...e,onKeyDown:function(n){e.onKeyDown&&e.onKeyDown(n);for(const e of t)e(n)}}))}(window.wp=window.wp||{}).keyboardShortcuts=t}();

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-beta1-56754';
$wp_version = '6.4-beta1-56755';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.