mirror of
git://develop.git.wordpress.org/
synced 2025-01-29 10:38:22 +01:00
Editor: Update npm packages for WP 6.6 Beta 2.
See https://github.com/WordPress/wordpress-develop/pull/6773. Fixes #61410. Props vcanales. git-svn-id: https://develop.svn.wordpress.org/trunk@58387 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0b988ac119
commit
7cf81d37b0
3067
package-lock.json
generated
3067
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
144
package.json
144
package.json
@ -27,12 +27,12 @@
|
||||
"@lodder/grunt-postcss": "^3.1.1",
|
||||
"@playwright/test": "1.32.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
|
||||
"@wordpress/babel-preset-default": "8.0.0",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "6.0.0",
|
||||
"@wordpress/e2e-test-utils": "11.0.0",
|
||||
"@wordpress/e2e-test-utils-playwright": "1.0.0",
|
||||
"@wordpress/prettier-config": "4.0.0",
|
||||
"@wordpress/scripts": "28.0.0",
|
||||
"@wordpress/babel-preset-default": "8.0.1",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "6.0.1",
|
||||
"@wordpress/e2e-test-utils": "11.0.1",
|
||||
"@wordpress/e2e-test-utils-playwright": "1.0.1",
|
||||
"@wordpress/prettier-config": "4.0.1",
|
||||
"@wordpress/scripts": "28.0.1",
|
||||
"autoprefixer": "10.4.17",
|
||||
"chalk": "5.3.0",
|
||||
"check-node-version": "4.2.1",
|
||||
@ -78,72 +78,72 @@
|
||||
"webpack-livereload-plugin": "3.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/a11y": "4.0.0",
|
||||
"@wordpress/annotations": "3.0.0",
|
||||
"@wordpress/api-fetch": "7.0.0",
|
||||
"@wordpress/autop": "4.0.0",
|
||||
"@wordpress/blob": "4.0.0",
|
||||
"@wordpress/block-directory": "5.0.0",
|
||||
"@wordpress/block-editor": "13.0.0",
|
||||
"@wordpress/block-library": "9.0.0",
|
||||
"@wordpress/block-serialization-default-parser": "5.0.0",
|
||||
"@wordpress/blocks": "13.0.0",
|
||||
"@wordpress/commands": "1.0.0",
|
||||
"@wordpress/components": "28.0.0",
|
||||
"@wordpress/compose": "7.0.0",
|
||||
"@wordpress/core-commands": "1.0.0",
|
||||
"@wordpress/core-data": "7.0.0",
|
||||
"@wordpress/customize-widgets": "5.0.0",
|
||||
"@wordpress/data": "10.0.0",
|
||||
"@wordpress/data-controls": "4.0.0",
|
||||
"@wordpress/dataviews": "2.0.0",
|
||||
"@wordpress/date": "5.0.0",
|
||||
"@wordpress/deprecated": "4.0.0",
|
||||
"@wordpress/dom": "4.0.0",
|
||||
"@wordpress/dom-ready": "4.0.0",
|
||||
"@wordpress/edit-post": "8.0.0",
|
||||
"@wordpress/edit-site": "6.0.0",
|
||||
"@wordpress/edit-widgets": "6.0.0",
|
||||
"@wordpress/editor": "14.0.0",
|
||||
"@wordpress/element": "6.0.0",
|
||||
"@wordpress/escape-html": "3.0.0",
|
||||
"@wordpress/format-library": "5.0.0",
|
||||
"@wordpress/hooks": "4.0.0",
|
||||
"@wordpress/html-entities": "4.0.0",
|
||||
"@wordpress/i18n": "5.0.0",
|
||||
"@wordpress/icons": "10.0.0",
|
||||
"@wordpress/interactivity": "6.0.0",
|
||||
"@wordpress/interactivity-router": "2.0.0",
|
||||
"@wordpress/interface": "6.0.0",
|
||||
"@wordpress/is-shallow-equal": "5.0.0",
|
||||
"@wordpress/keyboard-shortcuts": "5.0.0",
|
||||
"@wordpress/keycodes": "4.0.0",
|
||||
"@wordpress/list-reusable-blocks": "5.0.0",
|
||||
"@wordpress/media-utils": "5.0.0",
|
||||
"@wordpress/notices": "5.0.0",
|
||||
"@wordpress/nux": "9.0.0",
|
||||
"@wordpress/patterns": "2.0.0",
|
||||
"@wordpress/plugins": "7.0.0",
|
||||
"@wordpress/preferences": "4.0.0",
|
||||
"@wordpress/preferences-persistence": "2.0.0",
|
||||
"@wordpress/primitives": "4.0.0",
|
||||
"@wordpress/priority-queue": "3.0.0",
|
||||
"@wordpress/private-apis": "1.0.0",
|
||||
"@wordpress/redux-routine": "5.0.0",
|
||||
"@wordpress/reusable-blocks": "5.0.0",
|
||||
"@wordpress/rich-text": "7.0.0",
|
||||
"@wordpress/router": "1.0.0",
|
||||
"@wordpress/server-side-render": "5.0.0",
|
||||
"@wordpress/shortcode": "4.0.0",
|
||||
"@wordpress/style-engine": "2.0.0",
|
||||
"@wordpress/sync": "1.0.0",
|
||||
"@wordpress/token-list": "3.0.0",
|
||||
"@wordpress/undo-manager": "1.0.0",
|
||||
"@wordpress/url": "4.0.0",
|
||||
"@wordpress/viewport": "6.0.0",
|
||||
"@wordpress/warning": "3.0.0",
|
||||
"@wordpress/widgets": "4.0.0",
|
||||
"@wordpress/wordcount": "4.0.0",
|
||||
"@wordpress/a11y": "4.0.1",
|
||||
"@wordpress/annotations": "3.0.1",
|
||||
"@wordpress/api-fetch": "7.0.1",
|
||||
"@wordpress/autop": "4.0.1",
|
||||
"@wordpress/blob": "4.0.1",
|
||||
"@wordpress/block-directory": "5.0.1",
|
||||
"@wordpress/block-editor": "13.0.1",
|
||||
"@wordpress/block-library": "9.0.1",
|
||||
"@wordpress/block-serialization-default-parser": "5.0.1",
|
||||
"@wordpress/blocks": "13.0.1",
|
||||
"@wordpress/commands": "1.0.1",
|
||||
"@wordpress/components": "28.0.1",
|
||||
"@wordpress/compose": "7.0.1",
|
||||
"@wordpress/core-commands": "1.0.1",
|
||||
"@wordpress/core-data": "7.0.1",
|
||||
"@wordpress/customize-widgets": "5.0.1",
|
||||
"@wordpress/data": "10.0.1",
|
||||
"@wordpress/data-controls": "4.0.1",
|
||||
"@wordpress/dataviews": "2.0.1",
|
||||
"@wordpress/date": "5.0.1",
|
||||
"@wordpress/deprecated": "4.0.1",
|
||||
"@wordpress/dom": "4.0.1",
|
||||
"@wordpress/dom-ready": "4.0.1",
|
||||
"@wordpress/edit-post": "8.0.1",
|
||||
"@wordpress/edit-site": "6.0.1",
|
||||
"@wordpress/edit-widgets": "6.0.1",
|
||||
"@wordpress/editor": "14.0.1",
|
||||
"@wordpress/element": "6.0.1",
|
||||
"@wordpress/escape-html": "3.0.1",
|
||||
"@wordpress/format-library": "5.0.1",
|
||||
"@wordpress/hooks": "4.0.1",
|
||||
"@wordpress/html-entities": "4.0.1",
|
||||
"@wordpress/i18n": "5.0.1",
|
||||
"@wordpress/icons": "10.0.1",
|
||||
"@wordpress/interactivity": "6.0.1",
|
||||
"@wordpress/interactivity-router": "2.0.1",
|
||||
"@wordpress/interface": "6.0.1",
|
||||
"@wordpress/is-shallow-equal": "5.0.1",
|
||||
"@wordpress/keyboard-shortcuts": "5.0.1",
|
||||
"@wordpress/keycodes": "4.0.1",
|
||||
"@wordpress/list-reusable-blocks": "5.0.1",
|
||||
"@wordpress/media-utils": "5.0.1",
|
||||
"@wordpress/notices": "5.0.1",
|
||||
"@wordpress/nux": "9.0.1",
|
||||
"@wordpress/patterns": "2.0.1",
|
||||
"@wordpress/plugins": "7.0.1",
|
||||
"@wordpress/preferences": "4.0.1",
|
||||
"@wordpress/preferences-persistence": "2.0.1",
|
||||
"@wordpress/primitives": "4.0.1",
|
||||
"@wordpress/priority-queue": "3.0.1",
|
||||
"@wordpress/private-apis": "1.0.1",
|
||||
"@wordpress/redux-routine": "5.0.1",
|
||||
"@wordpress/reusable-blocks": "5.0.1",
|
||||
"@wordpress/rich-text": "7.0.1",
|
||||
"@wordpress/router": "1.0.1",
|
||||
"@wordpress/server-side-render": "5.0.1",
|
||||
"@wordpress/shortcode": "4.0.1",
|
||||
"@wordpress/style-engine": "2.0.1",
|
||||
"@wordpress/sync": "1.0.1",
|
||||
"@wordpress/token-list": "3.0.1",
|
||||
"@wordpress/undo-manager": "1.0.1",
|
||||
"@wordpress/url": "4.0.1",
|
||||
"@wordpress/viewport": "6.0.1",
|
||||
"@wordpress/warning": "3.0.1",
|
||||
"@wordpress/widgets": "4.0.1",
|
||||
"@wordpress/wordcount": "4.0.1",
|
||||
"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
80
src/wp-includes/blocks/button.php
Normal file
80
src/wp-includes/blocks/button.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/button` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the `core/button` block on the server,
|
||||
*
|
||||
* @since 6.6.0
|
||||
*
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content The block content.
|
||||
* @param WP_Block $block The block object.
|
||||
*
|
||||
* @return string The block content.
|
||||
*/
|
||||
function render_block_core_button( $attributes, $content ) {
|
||||
$p = new WP_HTML_Tag_Processor( $content );
|
||||
|
||||
/*
|
||||
* The button block can render an `<a>` or `<button>` and also has a
|
||||
* `<div>` wrapper. Find the a or button tag.
|
||||
*/
|
||||
$tag = null;
|
||||
while ( $p->next_tag() ) {
|
||||
$tag = $p->get_tag();
|
||||
if ( 'A' === $tag || 'BUTTON' === $tag ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If this happens, the likelihood is there's no block content,
|
||||
* or the block has been modified by a plugin.
|
||||
*/
|
||||
if ( null === $tag ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
// If the next token is the closing tag, the button is empty.
|
||||
$is_empty = true;
|
||||
while ( $p->next_token() && $tag !== $p->get_token_name() && $is_empty ) {
|
||||
if ( '#comment' !== $p->get_token_type() ) {
|
||||
/**
|
||||
* Anything else implies this is not empty.
|
||||
* This might include any text content (including a space),
|
||||
* inline images or other HTML.
|
||||
*/
|
||||
$is_empty = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* When there's no text, render nothing for the block.
|
||||
* See https://github.com/WordPress/gutenberg/issues/17221 for the
|
||||
* reasoning behind this.
|
||||
*/
|
||||
if ( $is_empty ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the `core/button` block on server.
|
||||
*
|
||||
* @since 6.6.0
|
||||
*/
|
||||
function register_block_core_button() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/button',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_button',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_button' );
|
@ -495,7 +495,7 @@ class WP_Navigation_Block_Renderer {
|
||||
$close_button_directives = '';
|
||||
if ( $is_interactive ) {
|
||||
$open_button_directives = '
|
||||
data-wp-on--click="actions.openMenuOnClick"
|
||||
data-wp-on-async--click="actions.openMenuOnClick"
|
||||
data-wp-on--keydown="actions.handleMenuKeydown"
|
||||
';
|
||||
$responsive_container_directives = '
|
||||
@ -503,7 +503,7 @@ class WP_Navigation_Block_Renderer {
|
||||
data-wp-class--is-menu-open="state.isMenuOpen"
|
||||
data-wp-watch="callbacks.initMenu"
|
||||
data-wp-on--keydown="actions.handleMenuKeydown"
|
||||
data-wp-on--focusout="actions.handleMenuFocusout"
|
||||
data-wp-on-async--focusout="actions.handleMenuFocusout"
|
||||
tabindex="-1"
|
||||
';
|
||||
$responsive_dialog_directives = '
|
||||
@ -512,7 +512,7 @@ class WP_Navigation_Block_Renderer {
|
||||
data-wp-bind--role="state.roleAttribute"
|
||||
';
|
||||
$close_button_directives = '
|
||||
data-wp-on--click="actions.closeMenuOnClick"
|
||||
data-wp-on-async--click="actions.closeMenuOnClick"
|
||||
';
|
||||
$responsive_container_content_directives = '
|
||||
data-wp-watch="callbacks.focusFirstElement"
|
||||
@ -826,7 +826,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
|
||||
$tags->set_attribute( 'data-wp-interactive', 'core/navigation' );
|
||||
$tags->set_attribute( 'data-wp-context', '{ "submenuOpenedBy": { "click": false, "hover": false, "focus": false }, "type": "submenu" }' );
|
||||
$tags->set_attribute( 'data-wp-watch', 'callbacks.initMenu' );
|
||||
$tags->set_attribute( 'data-wp-on--focusout', 'actions.handleMenuFocusout' );
|
||||
$tags->set_attribute( 'data-wp-on-async--focusout', 'actions.handleMenuFocusout' );
|
||||
$tags->set_attribute( 'data-wp-on--keydown', 'actions.handleMenuKeydown' );
|
||||
|
||||
// This is a fix for Safari. Without it, Safari doesn't change the active
|
||||
@ -836,8 +836,8 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
|
||||
$tags->set_attribute( 'tabindex', '-1' );
|
||||
|
||||
if ( ! isset( $block_attributes['openSubmenusOnClick'] ) || false === $block_attributes['openSubmenusOnClick'] ) {
|
||||
$tags->set_attribute( 'data-wp-on--mouseenter', 'actions.openMenuOnHover' );
|
||||
$tags->set_attribute( 'data-wp-on--mouseleave', 'actions.closeMenuOnHover' );
|
||||
$tags->set_attribute( 'data-wp-on-async--mouseenter', 'actions.openMenuOnHover' );
|
||||
$tags->set_attribute( 'data-wp-on-async--mouseleave', 'actions.closeMenuOnHover' );
|
||||
}
|
||||
|
||||
// Add directives to the toggle submenu button.
|
||||
@ -847,7 +847,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
|
||||
'class_name' => 'wp-block-navigation-submenu__toggle',
|
||||
)
|
||||
) ) {
|
||||
$tags->set_attribute( 'data-wp-on--click', 'actions.toggleMenuOnClick' );
|
||||
$tags->set_attribute( 'data-wp-on-async--click', 'actions.toggleMenuOnClick' );
|
||||
$tags->set_attribute( 'data-wp-bind--aria-expanded', 'state.isMenuOpen' );
|
||||
// The `aria-expanded` attribute for SSR is already added in the submenu block.
|
||||
}
|
||||
@ -858,7 +858,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
|
||||
'class_name' => 'wp-block-navigation__submenu-container',
|
||||
)
|
||||
) ) {
|
||||
$tags->set_attribute( 'data-wp-on--focus', 'actions.openMenuOnFocus' );
|
||||
$tags->set_attribute( 'data-wp-on-async--focus', 'actions.openMenuOnFocus' );
|
||||
}
|
||||
|
||||
// Iterate through subitems if exist.
|
||||
|
@ -77,7 +77,7 @@ function render_block_core_query_pagination_next( $attributes, $content, $block
|
||||
) ) {
|
||||
$p->set_attribute( 'data-wp-key', 'query-pagination-next' );
|
||||
$p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' );
|
||||
$p->set_attribute( 'data-wp-on--mouseenter', 'core/query::actions.prefetch' );
|
||||
$p->set_attribute( 'data-wp-on-async--mouseenter', 'core/query::actions.prefetch' );
|
||||
$p->set_attribute( 'data-wp-watch', 'core/query::callbacks.prefetch' );
|
||||
$content = $p->get_updated_html();
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ function render_block_core_query_pagination_previous( $attributes, $content, $bl
|
||||
) ) {
|
||||
$p->set_attribute( 'data-wp-key', 'query-pagination-previous' );
|
||||
$p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' );
|
||||
$p->set_attribute( 'data-wp-on--mouseenter', 'core/query::actions.prefetch' );
|
||||
$p->set_attribute( 'data-wp-on-async--mouseenter', 'core/query::actions.prefetch' );
|
||||
$p->set_attribute( 'data-wp-watch', 'core/query::callbacks.prefetch' );
|
||||
$content = $p->get_updated_html();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
require_once ABSPATH . WPINC . '/blocks/archives.php';
|
||||
require_once ABSPATH . WPINC . '/blocks/avatar.php';
|
||||
require_once ABSPATH . WPINC . '/blocks/block.php';
|
||||
require_once ABSPATH . WPINC . '/blocks/button.php';
|
||||
require_once ABSPATH . WPINC . '/blocks/calendar.php';
|
||||
require_once ABSPATH . WPINC . '/blocks/categories.php';
|
||||
require_once ABSPATH . WPINC . '/blocks/comment-author-name.php';
|
||||
|
@ -4,7 +4,6 @@
|
||||
// Returns folder names for static blocks necessary for core blocks registration.
|
||||
return array(
|
||||
'audio',
|
||||
'button',
|
||||
'buttons',
|
||||
'code',
|
||||
'column',
|
||||
|
@ -191,8 +191,8 @@ function render_block_core_search( $attributes ) {
|
||||
data-wp-interactive="core/search"'
|
||||
. $form_context .
|
||||
'data-wp-class--wp-block-search__searchfield-hidden="!context.isSearchInputVisible"
|
||||
data-wp-on--keydown="actions.handleSearchKeydown"
|
||||
data-wp-on--focusout="actions.handleSearchFocusout"
|
||||
data-wp-on-async--keydown="actions.handleSearchKeydown"
|
||||
data-wp-on-async--focusout="actions.handleSearchFocusout"
|
||||
';
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
remove_action( 'init', 'register_block_core_archives' );
|
||||
remove_action( 'init', 'register_block_core_avatar' );
|
||||
remove_action( 'init', 'register_block_core_block' );
|
||||
remove_action( 'init', 'register_block_core_button' );
|
||||
remove_action( 'init', 'register_block_core_calendar' );
|
||||
remove_action( 'init', 'register_block_core_categories' );
|
||||
remove_action( 'init', 'register_block_core_comment_author_name' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user