Make WordPress Core


Ignore:
Timestamp:
10/21/2025 07:11:53 AM (11 months ago)
Author:
ellatrix
Message:

Editor: update packages.

Updates the packages to match Gutenberg version 21.9.0 RC2.

Also updates the sync script to work with the new package-lock.json format.
Some reusable block tests were adjusted to work with more render arguments.
Added core-data to the ignore list for verify:source-maps because Yjs has been bundled by accident. To be removed in a follow-up. See https://core.trac.wordpress.org/ticket/64120. See https://github.com/WordPress/gutenberg/pull/72503.

See: https://github.com/WordPress/wordpress-develop/pull/10355.
See: https://core.trac.wordpress.org/ticket/64117.

Props ellatrix, dmsnell.
Fixes #64117.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/search.php

    r59775 r61009  
    1111 * @since 6.3.0 Using block.json `viewScript` to register script, and update `view_script_handles()` only when needed.
    1212 *
    13  * @param array    $attributes The block attributes.
    14  * @param string   $content    The saved content.
    15  * @param WP_Block $block      The parsed block.
     13 * @param array $attributes The block attributes.
    1614 *
    1715 * @return string The search block markup.
     
    153151        }
    154152
    155         $field_markup_classes = $is_button_inside ? $border_color_classes : '';
    156         $field_markup         = sprintf(
    157                 '<div class="wp-block-search__inside-wrapper %s" %s>%s</div>',
    158                 esc_attr( $field_markup_classes ),
     153        $field_markup_classes = array(
     154                'wp-block-search__inside-wrapper',
     155        );
     156        if ( $is_button_inside && ! empty( $border_color_classes ) ) {
     157                $field_markup_classes[] = $border_color_classes;
     158        }
     159        $field_markup       = sprintf(
     160                '<div class="%s" %s>%s</div>',
     161                esc_attr( implode( ' ', $field_markup_classes ) ),
    159162                $inline_styles['wrapper'],
    160163                $input . $query_params_markup . $button
    161164        );
    162         $wrapper_attributes   = get_block_wrapper_attributes(
     165        $wrapper_attributes = get_block_wrapper_attributes(
    163166                array( 'class' => $classnames )
    164167        );
    165         $form_directives      = '';
     168        $form_directives    = '';
    166169
    167170        // If it's interactive, add the directives.
     
    370373                        // Apply styles for individual corner border radii.
    371374                        foreach ( $border_radius as $key => $value ) {
     375                                // Get border-radius CSS variable from preset value if provided.
     376                                if ( is_string( $value ) && str_contains( $value, 'var:preset|border-radius|' ) ) {
     377                                        $index_to_splice = strrpos( $value, '|' ) + 1;
     378                                        $slug            = _wp_to_kebab_case( substr( $value, $index_to_splice ) );
     379                                        $value           = "var(--wp--preset--border-radius--$slug)";
     380                                }
     381
    372382                                if ( null !== $value ) {
    373383                                        // Convert camelCase key to kebab-case.
     
    385395                                        // Add adjusted border radius styles for the wrapper element
    386396                                        // if button is positioned inside.
    387                                         if ( $is_button_inside && intval( $value ) !== 0 ) {
     397                                        if ( $is_button_inside && ( intval( $value ) !== 0 || str_contains( $value, 'var(--wp--preset--border-radius--' ) ) ) {
    388398                                                $wrapper_styles[] = sprintf(
    389399                                                        'border-%s-radius: calc(%s + %s);',
     
    397407                } else {
    398408                        // Numeric check is for backwards compatibility purposes.
    399                         $border_radius   = is_numeric( $border_radius ) ? $border_radius . 'px' : $border_radius;
     409                        $border_radius = is_numeric( $border_radius ) ? $border_radius . 'px' : $border_radius;
     410                        // Get border-radius CSS variable from preset value if provided.
     411                        if ( is_string( $border_radius ) && str_contains( $border_radius, 'var:preset|border-radius|' ) ) {
     412                                $index_to_splice = strrpos( $border_radius, '|' ) + 1;
     413                                $slug            = _wp_to_kebab_case( substr( $border_radius, $index_to_splice ) );
     414                                $border_radius   = "var(--wp--preset--border-radius--$slug)";
     415                        }
     416
    400417                        $border_style    = sprintf( 'border-radius: %s;', esc_attr( $border_radius ) );
    401418                        $input_styles[]  = $border_style;
Note: See TracChangeset for help on using the changeset viewer.