Make WordPress Core


Ignore:
Timestamp:
11/23/2021 05:38:45 AM (2 years ago)
Author:
noisysocks
Message:

Update @wordpress packages

Update packages to include these bug fixes from Gutenberg:

  • FSE: Add welcome guide
  • Update theme styles for the code block
  • Add feature flag to toggle the new site editor sidebar
  • Add templates list page for site editor
  • Cover Block: Fix default background dim
  • E2E: Add more Cover block tests
  • Cover Block: Fix regressions
  • Post Comments Form: ensure typography styles are applied to child elements
  • Navigation: Fix space-between
  • Fix background colours in nested submenus.
  • Fix duplicate custom classnames in navigation submenu block
  • Fix colour rendering in Navigation overlay
  • Fix: Add ability to opt out of Core color palette V2
  • Change @package to WordPress in block-library
  • Make the core color palette opt-in for themes with not theme.json
  • Remove textdomain from calendar block
  • Page List block: fix space before href attribute
  • Try: Let Featured Image block inherit dimensions, look like a placeholder
  • [Global Styles]: Add block icon next to blocks list
  • Page List: Use core entities instead of direct apiFetch
  • Site Editor: Stabilize export endpoint
  • Fix mobile horizontal scrollbar.
  • Multi-entity save: Only set site entity to pending if really saving
  • Add page list to navigation direct insert conditions
  • Implement "Add New" for templates list in Site Editor
  • Post Featured Image: Remove withNotices HOC
  • Fix page list missing button styles when set to open on click.
  • Make appender fixed position to avoid jumps in the UI
  • Color UI component: reorder palettes and update names (core by defaults, user by custom)
  • Remove the Styles link in Site Editor
  • GlobalStyles sidebar: do not show default palette if theme opts-out
  • Only render the site editor canvas when the global styles are ready.
  • Global Styles: rename core origin key to default for presets
  • Clarify i18n context for PostTemplateActions's "New" label
  • Revert erroneous native editor package version bumps
  • Try: Hide the columns inserter in pattern previews.
  • Fix site editor region navigation
  • Update navigation sidebar responsiveness
  • Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
  • Make user able to change all color palette origins
  • Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
  • Site Editor: Validate the postType query argument
  • Navigation: Scale submenu icon.
  • Move the theme editor under tools for FSE themes
  • Deprecate navigation areas

See #54487.

File:
1 edited

Legend:

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

    r52161 r52232  
    33 * Server-side rendering of the `core/navigation` block.
    44 *
    5  * @package gutenberg
     5 * @package WordPress
    66 */
    77
     
    1515function block_core_navigation_build_css_colors( $attributes ) {
    1616    $colors = array(
    17         'css_classes'   => array(),
    18         'inline_styles' => '',
     17        'css_classes'           => array(),
     18        'inline_styles'         => '',
     19        'overlay_css_classes'   => array(),
     20        'overlay_inline_styles' => '',
    1921    );
    2022
     
    5355        // Add the custom background-color inline style.
    5456        $colors['inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customBackgroundColor'] );
     57    }
     58
     59    // Overlay text color.
     60    $has_named_overlay_text_color  = array_key_exists( 'overlayTextColor', $attributes );
     61    $has_custom_overlay_text_color = array_key_exists( 'customOverlayTextColor', $attributes );
     62
     63    // If has overlay text color.
     64    if ( $has_custom_overlay_text_color || $has_named_overlay_text_color ) {
     65        // Add has-text-color class.
     66        $colors['overlay_css_classes'][] = 'has-text-color';
     67    }
     68
     69    if ( $has_named_overlay_text_color ) {
     70        // Add the overlay color class.
     71        $colors['overlay_css_classes'][] = sprintf( 'has-%s-color', $attributes['overlayTextColor'] );
     72    } elseif ( $has_custom_overlay_text_color ) {
     73        // Add the custom overlay color inline style.
     74        $colors['overlay_inline_styles'] .= sprintf( 'color: %s;', $attributes['customOverlayTextColor'] );
     75    }
     76
     77    // Overlay background color.
     78    $has_named_overlay_background_color  = array_key_exists( 'overlayBackgroundColor', $attributes );
     79    $has_custom_overlay_background_color = array_key_exists( 'customOverlayBackgroundColor', $attributes );
     80
     81    // If has overlay background color.
     82    if ( $has_custom_overlay_background_color || $has_named_overlay_background_color ) {
     83        // Add has-background class.
     84        $colors['overlay_css_classes'][] = 'has-background';
     85    }
     86
     87    if ( $has_named_overlay_background_color ) {
     88        // Add the overlay background-color class.
     89        $colors['overlay_css_classes'][] = sprintf( 'has-%s-background-color', $attributes['overlayBackgroundColor'] );
     90    } elseif ( $has_custom_overlay_background_color ) {
     91        // Add the custom overlay background-color inline style.
     92        $colors['overlay_inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customOverlayBackgroundColor'] );
    5593    }
    5694
     
    248286        'wp-block-navigation__responsive-container',
    249287        $is_hidden_by_default ? 'hidden-by-default' : '',
     288        implode( ' ', $colors['overlay_css_classes'] ),
    250289    );
    251290    $open_button_classes          = array(
     
    256295    $responsive_container_markup = sprintf(
    257296        '<button aria-expanded="false" aria-haspopup="true" aria-label="%3$s" class="%6$s" data-micromodal-trigger="modal-%1$s"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false"><rect x="4" y="7.5" width="16" height="1.5" /><rect x="4" y="15" width="16" height="1.5" /></svg></button>
    258             <div class="%5$s" id="modal-%1$s">
     297            <div class="%5$s" style="%7$s" id="modal-%1$s">
    259298                <div class="wp-block-navigation__responsive-close" tabindex="-1" data-micromodal-close>
    260299                    <div class="wp-block-navigation__responsive-dialog" role="dialog" aria-modal="true" aria-labelledby="modal-%1$s-title" >
     
    271310        __( 'Close menu' ), // Close button label.
    272311        implode( ' ', $responsive_container_classes ),
    273         implode( ' ', $open_button_classes )
     312        implode( ' ', $open_button_classes ),
     313        $colors['overlay_inline_styles']
    274314    );
    275315
Note: See TracChangeset for help on using the changeset viewer.