diff --git a/changelog.txt b/changelog.txt index 2262dee883f9af..51206319e5aa21 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,19 @@ == Changelog == += 10.7.3 = + +### Bug Fixes + +- Fix alligned blocks. ([32454](https://github.com/WordPress/gutenberg/pull/32454)) + + += 10.7.2 = + +### Bug Fixes + +- Fix Logic to enable custom colors, gradients, and font sizes. ([32200](https://github.com/WordPress/gutenberg/pull/32200)) + + = 10.8.0-rc.1 = diff --git a/docs/contributors/code/release.md b/docs/contributors/code/release.md index 07bee7bd6f7a2b..e3bbb225e7e1fa 100644 --- a/docs/contributors/code/release.md +++ b/docs/contributors/code/release.md @@ -50,22 +50,44 @@ Once released, all that's left to do is writing a release post on [make.wordpres ### Writing the Release Notes and Post +Documenting the release is comprised of the following steps: +1. Curating the changelog +2. Selecting the release highlights +3. Drafting the release post +4. Running the performance tests +5. Publishing the post + +#### 1. Curating the changelog The release notes draft is auto-generated by a script that looks for pull requests for the current milestone, and groups them by pull request label. -This is intended to be a starting point for release notes; you will still want to manually review and curate the changelog entries. +This is intended to be a starting point for release notes; you will still want to manually review and curate the changelog entries. Because the release candidate changelog is reused in the stable release and it can be a time-consuming process, it is recommended to start this process as soon as the milestone is closed and the release candidate is published. Guidelines for proof-reading include: -- Fix spelling errors or clarify wording. Phrasing should be easy to understand where the intended audience are those who use the plugin or are keeping up with ongoing development. +- Fix spelling errors or clarify wording. Phrasing should be easy to understand where the intended audience is those who use the plugin or are keeping up with ongoing development. - Create new groupings as applicable, and move pull requests between. - When multiple pull requests relate to the same task (such as a follow-up pull request), try to combine them to a single entry. - If subtasks of a related set of pull requests are substantial, consider organizing as entries in a nested list. +- If one or more pull requests revert one or more pull requests in the same release netting a zero-sum of code changes, remove them. - Remove mobile app pull request entries. -Once you have cleaned up the changelog, choose a few features to highlight in the release post and record an animation of them in use. +#### 2. Selecting the release highlights +Once you have cleaned up the changelog, the next step is to choose a few changes to highlight in the release post. These highlights usually focus on new features and enhancements, including performance and accessibility ones, but can also include important API changes or critical bug fixes. -You should also include a performance audit at the end of the release post. You can use `bin/plugin/cli.js perf` to automatically do this. +Given the big scope of Gutenberg and the high number of pull requests merged in each milestone, it is not uncommon to overlook impactful changes worth highlighting; it is recommended to make this step a collaborative effort and share your picks with the Gutenberg Core team. -Compile this to a draft post on [make.wordpress.org/core](https://make.wordpress.org/core/); this post should be published after the actual release. +#### 3. Drafting the release post + +When possible, the highlighted changes in the release post should include an animation (video or GIF) or a static image of them in use. Choosing between an animation or a static image will depend on the best way to showcase each highlight: while animations are better to demonstrate workflows, more direct highlights can be shown with an image; having too many video players adds a layer of friction for users to see the highlight, whereas too many simultaneous animated GIFs can distract and overwhelm the reader. + +These visual assets should maintain consistency with previous release posts; using lean, white themes helps in this regard and visually integrate well with the [make.wordpress.org/core](https://make.wordpress.org/core/) blog aesthetics. Including copyrighted material should be avoided, and browser plugins that can be seen in the browser canvas (spell checkers, form fillers, etc.) disabled when capturing the assets. If you would like help creating the visual assets, please ping somebody in the Gutenberg Core team in advance so that it can be planned for. + +#### 4. Running the performance tests + +Your post should also include a performance audit at the end, comparing the current Gutenberg release with both the previous one and the latest WordPress major version. You can use `bin/plugin/cli.js perf` to automatically do this for you by passing as parameters the tags to run the performance suite against, such as `bin/plugin/cli.js perf release/x.y release/x.z wp/a.b` + +#### 5. Publishing the post + +Compile this to a draft post on [make.wordpress.org/core](https://make.wordpress.org/core/); this post should be published after the actual release. Remember asking for peer review is encouraged by the [make/core posting guidelines](https://make.wordpress.org/core/handbook/best-practices/post-comment-guidelines/#peer-review)! If you don't have access to [make.wordpress.org/core](https://make.wordpress.org/core/), ping someone on the Gutenberg Core team in the [WordPress #core-editor Slack channel](https://wordpress.slack.com/messages/C02QB2JS7) to publish the post. diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index 5b920ab3b5adf5..3a5e4be2c761e8 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -86,7 +86,7 @@ supports: { - Default value: null - Subproperties: - `background`: type `boolean`, default value `true` - - `duotone`: type `string`, default value undefined + - `__experimentalDuotone`: type `string`, default value undefined - `gradients`: type `boolean`, default value `false` - `text`: type `boolean`, default value `true` @@ -196,7 +196,7 @@ supports: { Duotone presets are sourced from `color.duotone` in [theme.json](/docs/how-to-guides/themes/theme-json.md). -When the block declares support for `color.duotone`, the attributes definition is extended to include the attribute `style`: +When the block declares support for `color.__experimentalDuotone`, the attributes definition is extended to include the attribute `style`: - `style`: attribute of `object` type with no default assigned. @@ -210,7 +210,7 @@ When the block declares support for `color.duotone`, the attributes definition i color: { duotone: [ '#FFF', - '#000 + '#000' ] } } diff --git a/lib/block-supports/border.php b/lib/block-supports/border.php index e400a89fc0119d..9d8d97c690a7b8 100644 --- a/lib/block-supports/border.php +++ b/lib/block-supports/border.php @@ -56,8 +56,14 @@ function gutenberg_apply_border_support( $block_type, $block_attributes ) { gutenberg_has_border_feature_support( $block_type, 'radius' ) && isset( $block_attributes['style']['border']['radius'] ) ) { - $border_radius = (int) $block_attributes['style']['border']['radius']; - $styles[] = sprintf( 'border-radius: %dpx;', $border_radius ); + $border_radius = $block_attributes['style']['border']['radius']; + + // This check handles original unitless implementation. + if ( is_numeric( $border_radius ) ) { + $border_radius .= 'px'; + } + + $styles[] = sprintf( 'border-radius: %s;', $border_radius ); } // Border style. @@ -74,8 +80,14 @@ function gutenberg_apply_border_support( $block_type, $block_attributes ) { gutenberg_has_border_feature_support( $block_type, 'width' ) && isset( $block_attributes['style']['border']['width'] ) ) { - $border_width = intval( $block_attributes['style']['border']['width'] ); - $styles[] = sprintf( 'border-width: %dpx;', $border_width ); + $border_width = $block_attributes['style']['border']['width']; + + // This check handles original unitless implementation. + if ( is_numeric( $border_width ) ) { + $border_width .= 'px'; + } + + $styles[] = sprintf( 'border-width: %s;', $border_width ); } // Border color. diff --git a/lib/block-supports/typography.php b/lib/block-supports/typography.php index fe68605f475607..811c96b9083d0b 100644 --- a/lib/block-supports/typography.php +++ b/lib/block-supports/typography.php @@ -70,15 +70,20 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) { return array(); } - $attributes = array(); - $classes = array(); - $styles = array(); - $typography_supports = _wp_array_get( $block_type->supports, array( 'typography' ), false ); if ( ! $typography_supports ) { return array(); } + $skip_typography_serialization = _wp_array_get( $typography_supports, array( '__experimentalSkipSerialization' ), false ); + if ( $skip_typography_serialization ) { + return array(); + } + + $attributes = array(); + $classes = array(); + $styles = array(); + $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false ); $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false ); $has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false ); @@ -88,17 +93,10 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) { $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false ); $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false ); - $skip_font_size_support_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipFontSizeSerialization' ), false ); - - // Covers all typography features _except_ font size. - $skip_typography_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipTypographySerialization' ), false ); - - // Font Size. - if ( $has_font_size_support && ! $skip_font_size_support_serialization ) { + if ( $has_font_size_support ) { $has_named_font_size = array_key_exists( 'fontSize', $block_attributes ); $has_custom_font_size = isset( $block_attributes['style']['typography']['fontSize'] ); - // Apply required class or style. if ( $has_named_font_size ) { $classes[] = sprintf( 'has-%s-font-size', $block_attributes['fontSize'] ); } elseif ( $has_custom_font_size ) { @@ -106,10 +104,8 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) { } } - // Font Family. - if ( $has_font_family_support && ! $skip_typography_serialization ) { + if ( $has_font_family_support ) { $has_font_family = isset( $block_attributes['style']['typography']['fontFamily'] ); - // Apply required class and style. if ( $has_font_family ) { $font_family = $block_attributes['style']['typography']['fontFamily']; if ( strpos( $font_family, 'var:preset|font-family' ) !== false ) { @@ -123,43 +119,35 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) { } } - // Font style. - if ( $has_font_style_support && ! $skip_typography_serialization ) { - // Apply font style. + if ( $has_font_style_support ) { $font_style = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'fontStyle', 'font-style' ); if ( $font_style ) { $styles[] = $font_style; } } - // Font weight. - if ( $has_font_weight_support && ! $skip_typography_serialization ) { - // Apply font weight. + if ( $has_font_weight_support ) { $font_weight = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'fontWeight', 'font-weight' ); if ( $font_weight ) { $styles[] = $font_weight; } } - // Line Height. - if ( $has_line_height_support && ! $skip_typography_serialization ) { + if ( $has_line_height_support ) { $has_line_height = isset( $block_attributes['style']['typography']['lineHeight'] ); - // Add the style (no classes for line-height). if ( $has_line_height ) { $styles[] = sprintf( 'line-height: %s;', $block_attributes['style']['typography']['lineHeight'] ); } } - // Text Decoration. - if ( $has_text_decoration_support && ! $skip_typography_serialization ) { + if ( $has_text_decoration_support ) { $text_decoration_style = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'textDecoration', 'text-decoration' ); if ( $text_decoration_style ) { $styles[] = $text_decoration_style; } } - // Text Transform. - if ( $has_text_transform_support && ! $skip_typography_serialization ) { + if ( $has_text_transform_support ) { $text_transform_style = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'textTransform', 'text-transform' ); if ( $text_transform_style ) { $styles[] = $text_transform_style; diff --git a/lib/class-wp-theme-json-resolver-gutenberg.php b/lib/class-wp-theme-json-resolver-gutenberg.php index 987f3e5400fc26..bcdedda86f30b7 100644 --- a/lib/class-wp-theme-json-resolver-gutenberg.php +++ b/lib/class-wp-theme-json-resolver-gutenberg.php @@ -74,7 +74,7 @@ private static function read_json_file( $file_path ) { $json_decoding_error = json_last_error(); if ( JSON_ERROR_NONE !== $json_decoding_error ) { - error_log( 'Error when decoding file schema: ' . json_last_error_msg() ); + trigger_error( "Error when decoding a theme.json schema at path $file_path " . json_last_error_msg() ); return $config; } @@ -367,7 +367,7 @@ public static function get_user_data() { $json_decoding_error = json_last_error(); if ( JSON_ERROR_NONE !== $json_decoding_error ) { - error_log( 'Error when decoding user schema: ' . json_last_error_msg() ); + trigger_error( 'Error when decoding a theme.json schema for user data. ' . json_last_error_msg() ); return new WP_Theme_JSON_Gutenberg( $config ); } diff --git a/lib/full-site-editing/templates.php b/lib/full-site-editing/templates.php index 13e9885eafd0d2..418b534a3eaf6a 100644 --- a/lib/full-site-editing/templates.php +++ b/lib/full-site-editing/templates.php @@ -188,10 +188,16 @@ function gutenberg_the_skip_link() { return; } - // Early exit if not an FSE theme. + // Early exit if not a block theme. if ( ! gutenberg_supports_block_templates() ) { return; } + + // Early exit if not a block template. + global $_wp_current_template_content; + if ( ! $_wp_current_template_content ) { + return; + } ?> value, Object.values( value ) ); diff --git a/packages/block-editor/src/components/block-list/use-block-props/index.js b/packages/block-editor/src/components/block-list/use-block-props/index.js index bbffe084d575c7..4c4c5a6612ad9e 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/index.js +++ b/packages/block-editor/src/components/block-list/use-block-props/index.js @@ -58,7 +58,7 @@ const BLOCK_ANIMATION_THRESHOLD = 200; * @return {Object} Props to pass to the element to mark as a block. */ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) { - const { clientId, className, wrapperProps = {} } = useContext( + const { clientId, className, wrapperProps = {}, isAligned } = useContext( BlockListBlockContext ); const { @@ -141,7 +141,9 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) { 'data-title': blockTitle, className: classnames( // The wp-block className is important for editor styles. - 'wp-block block-editor-block-list__block', + classnames( 'block-editor-block-list__block', { + 'wp-block': ! isAligned, + } ), className, props.className, wrapperProps.className, diff --git a/packages/block-editor/src/components/floating-toolbar/index.native.js b/packages/block-editor/src/components/floating-toolbar/index.native.js index 1f71ac7c28684c..50fce7857ff59a 100644 --- a/packages/block-editor/src/components/floating-toolbar/index.native.js +++ b/packages/block-editor/src/components/floating-toolbar/index.native.js @@ -7,7 +7,7 @@ import { Animated, Easing, View, Platform } from 'react-native'; * WordPress dependencies */ import { ToolbarButton, Toolbar } from '@wordpress/components'; -import { useEffect, useState } from '@wordpress/element'; +import { useEffect, useState, useRef } from '@wordpress/element'; import { withSelect, withDispatch } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { __ } from '@wordpress/i18n'; @@ -24,8 +24,6 @@ const EASE_IN_DURATION = 250; const EASE_OUT_DURATION = 80; const TRANSLATION_RANGE = 8; -const opacity = new Animated.Value( 0 ); - const FloatingToolbar = ( { selectedClientId, parentId, @@ -33,6 +31,7 @@ const FloatingToolbar = ( { onNavigateUp, isRTL, } ) => { + const opacity = useRef( new Animated.Value( 0 ) ).current; // Sustain old selection for proper block selection button rendering when exit animation is ongoing. const [ previousSelection, setPreviousSelection ] = useState( {} ); @@ -79,7 +78,10 @@ const FloatingToolbar = ( { return ( !! opacity && ( - + { showNavUpButton && ( { + setStep( newUnit === 'px' ? 1 : 0.25 ); + }; + const onChange = ( newRadius ) => { let newStyle = { ...style, @@ -33,7 +43,7 @@ export function BorderRadiusEdit( props ) { }, }; - if ( newRadius === undefined ) { + if ( newRadius === undefined || newRadius === '' ) { newStyle = cleanEmptyObject( newStyle ); } @@ -41,14 +51,14 @@ export function BorderRadiusEdit( props ) { }; return ( - ); } diff --git a/packages/block-editor/src/hooks/border-width.js b/packages/block-editor/src/hooks/border-width.js index 24e25f6a063850..341fca06fdc5bc 100644 --- a/packages/block-editor/src/hooks/border-width.js +++ b/packages/block-editor/src/hooks/border-width.js @@ -1,16 +1,17 @@ /** * WordPress dependencies */ -import { RangeControl } from '@wordpress/components'; +import { __experimentalUnitControl as UnitControl } from '@wordpress/components'; +import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ +import { CSS_UNITS, parseUnit } from './border'; import { cleanEmptyObject } from './utils'; const MIN_BORDER_WIDTH = 0; -const MAX_BORDER_WIDTH = 50; /** * Inspector control for configuring border width property. @@ -24,8 +25,17 @@ export const BorderWidthEdit = ( props ) => { setAttributes, } = props; + // Step value is maintained in state so step is appropriate for current unit + // even when current radius value is undefined. + const initialStep = parseUnit( style?.border?.width ) === 'px' ? 1 : 0.25; + const [ step, setStep ] = useState( initialStep ); + + const onUnitChange = ( newUnit ) => { + setStep( newUnit === 'px' ? 1 : 0.25 ); + }; + const onChange = ( newWidth ) => { - const newStyle = { + let newStyle = { ...style, border: { ...style?.border, @@ -33,18 +43,22 @@ export const BorderWidthEdit = ( props ) => { }, }; - setAttributes( { style: cleanEmptyObject( newStyle ) } ); + if ( newWidth === undefined || newWidth === '' ) { + newStyle = cleanEmptyObject( newStyle ); + } + + setAttributes( { style: newStyle } ); }; return ( - ); }; diff --git a/packages/block-editor/src/hooks/border.js b/packages/block-editor/src/hooks/border.js index 6749afa663482f..f7db904d666aa1 100644 --- a/packages/block-editor/src/hooks/border.js +++ b/packages/block-editor/src/hooks/border.js @@ -16,7 +16,44 @@ import { BorderRadiusEdit } from './border-radius'; import { BorderStyleEdit } from './border-style'; import { BorderWidthEdit } from './border-width'; +const isWeb = Platform.OS === 'web'; + export const BORDER_SUPPORT_KEY = '__experimentalBorder'; +export const CSS_UNITS = [ + { + value: 'px', + label: isWeb ? 'px' : __( 'Pixels (px)' ), + default: '', + a11yLabel: __( 'Pixels (px)' ), + }, + { + value: 'em', + label: isWeb ? 'em' : __( 'Relative to parent font size (em)' ), + default: '', + a11yLabel: __( 'Relative to parent font size (em)' ), + }, + { + value: 'rem', + label: isWeb ? 'rem' : __( 'Relative to root font size (rem)' ), + default: '', + a11yLabel: __( 'Relative to root font size (rem)' ), + }, +]; + +/** + * Parses a CSS unit from a border CSS value. + * + * @param {string} cssValue CSS value to parse e.g. `10px` or `1.5em`. + * @return {string} CSS unit from provided value or default 'px'. + */ +export function parseUnit( cssValue ) { + const value = String( cssValue ).trim(); + const unitMatch = value.match( /[\d.\-\+]*\s*(.*)/ )[ 1 ]; + const unit = unitMatch !== undefined ? unitMatch.toLowerCase() : ''; + const currentUnit = CSS_UNITS.find( ( item ) => item.value === unit ); + + return currentUnit?.value || 'px'; +} export function BorderPanel( props ) { const isDisabled = useIsBorderDisabled( props ); @@ -44,7 +81,11 @@ export function BorderPanel( props ) { return ( - + { isStyleSupported && } { isWidthSupported && } { isRadiusSupported && } diff --git a/packages/block-editor/src/hooks/border.scss b/packages/block-editor/src/hooks/border.scss new file mode 100644 index 00000000000000..61d75c59454635 --- /dev/null +++ b/packages/block-editor/src/hooks/border.scss @@ -0,0 +1,10 @@ +.block-editor-hooks__border-controls { + .components-unit-control-wrapper { + margin-bottom: $grid-unit-30; + + &:last-child { + margin-bottom: $grid-unit-10; + } + } +} + diff --git a/packages/block-editor/src/hooks/font-size.js b/packages/block-editor/src/hooks/font-size.js index 498ea20769fac0..e678f31abd48cf 100644 --- a/packages/block-editor/src/hooks/font-size.js +++ b/packages/block-editor/src/hooks/font-size.js @@ -58,7 +58,10 @@ function addSaveProps( props, blockType, attributes ) { } if ( - hasBlockSupport( blockType, '__experimentalSkipFontSizeSerialization' ) + hasBlockSupport( + blockType, + 'typography.__experimentalSkipSerialization' + ) ) { return props; } @@ -182,7 +185,7 @@ const withFontSizeInlineStyles = createHigherOrderComponent( ! hasBlockSupport( blockName, FONT_SIZE_SUPPORT_KEY ) || hasBlockSupport( blockName, - '__experimentalSkipFontSizeSerialization' + 'typography.__experimentalSkipSerialization' ) || ! fontSize || style?.typography?.fontSize diff --git a/packages/block-editor/src/hooks/style.js b/packages/block-editor/src/hooks/style.js index 859bde72addcfb..601ceb6791f7d0 100644 --- a/packages/block-editor/src/hooks/style.js +++ b/packages/block-editor/src/hooks/style.js @@ -3,18 +3,15 @@ */ import { capitalize, - find, first, forEach, get, has, isEmpty, - isEqual, kebabCase, map, omit, startsWith, - without, } from 'lodash'; import classnames from 'classnames'; @@ -35,8 +32,11 @@ import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose'; */ import { BORDER_SUPPORT_KEY, BorderPanel } from './border'; import { COLOR_SUPPORT_KEY, ColorEdit } from './color'; -import { FONT_SIZE_SUPPORT_KEY } from './font-size'; -import { TypographyPanel, TYPOGRAPHY_SUPPORT_KEYS } from './typography'; +import { + TypographyPanel, + TYPOGRAPHY_SUPPORT_KEY, + TYPOGRAPHY_SUPPORT_KEYS, +} from './typography'; import { SPACING_SUPPORT_KEY, SpacingPanel } from './spacing'; import useDisplayBlockControls from '../components/use-display-block-controls'; @@ -140,19 +140,12 @@ const skipSerializationPaths = { [ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ COLOR_SUPPORT_KEY, ], + [ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ + TYPOGRAPHY_SUPPORT_KEY, + ], [ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'spacing', ], - [ `__experimentalSkipFontSizeSerialization` ]: [ 'typography', 'fontSize' ], - [ `__experimentalSkipTypographySerialization` ]: without( - TYPOGRAPHY_SUPPORT_KEYS, - FONT_SIZE_SUPPORT_KEY - ).map( - ( feature ) => - find( STYLE_PROPERTY, ( property ) => - isEqual( property.support, [ feature ] ) - )?.value - ), }; /** diff --git a/packages/block-editor/src/hooks/test/style.js b/packages/block-editor/src/hooks/test/style.js index 75a520b14ec6f5..85adb56c802e19 100644 --- a/packages/block-editor/src/hooks/test/style.js +++ b/packages/block-editor/src/hooks/test/style.js @@ -18,8 +18,8 @@ describe( 'getInlineStyles', () => { color: { text: 'red', background: 'black' }, typography: { lineHeight: 1.5, fontSize: 10 }, border: { - radius: 10, - width: 3, + radius: '10px', + width: '1em', style: 'dotted', color: '#21759b', }, @@ -31,9 +31,9 @@ describe( 'getInlineStyles', () => { ).toEqual( { backgroundColor: 'black', borderColor: '#21759b', - borderRadius: 10, + borderRadius: '10px', borderStyle: 'dotted', - borderWidth: 3, + borderWidth: '1em', color: 'red', lineHeight: 1.5, fontSize: 10, diff --git a/packages/block-editor/src/hooks/typography.js b/packages/block-editor/src/hooks/typography.js index 3038fab9662149..1b961990acaaae 100644 --- a/packages/block-editor/src/hooks/typography.js +++ b/packages/block-editor/src/hooks/typography.js @@ -50,6 +50,7 @@ import { useIsLetterSpacingDisabled, } from './letter-spacing'; +export const TYPOGRAPHY_SUPPORT_KEY = 'typography'; export const TYPOGRAPHY_SUPPORT_KEYS = [ LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index 0d9b9b01cbde18..92fc673e65ccf5 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -58,6 +58,7 @@ @import "./components/warning/style.scss"; @import "./hooks/anchor.scss"; @import "./hooks/layout.scss"; +@import "./hooks/border.scss"; // This tag marks the end of the styles that apply to editing canvas contents and need to be manipulated when we resize the editor. #end-resizable-editor-section { diff --git a/packages/block-editor/src/utils/dom.js b/packages/block-editor/src/utils/dom.js index 3a6db1685aebb1..4416f8eb4861e8 100644 --- a/packages/block-editor/src/utils/dom.js +++ b/packages/block-editor/src/utils/dom.js @@ -1,6 +1,4 @@ -// Consider the block appender to be a child block of its own, which also has -// this class. -const BLOCK_SELECTOR = '.wp-block'; +const BLOCK_SELECTOR = '.block-editor-block-list__block'; /** * Returns true if two elements are contained within the same block. diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 5c0010b0ec52ec..367c3b9c450a0a 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-library", - "version": "3.2.2", + "version": "3.2.3", "description": "Block library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-library/src/button/edit.js b/packages/block-library/src/button/edit.js index 70ce701138999b..15235369b2ee05 100644 --- a/packages/block-library/src/button/edit.js +++ b/packages/block-library/src/button/edit.js @@ -225,9 +225,7 @@ function ButtonEdit( props ) { } ) } style={ { - borderRadius: borderRadius - ? borderRadius + 'px' - : undefined, + borderRadius: borderRadius ? borderRadius : undefined, ...colorProps.style, } } onSplit={ ( value ) => diff --git a/packages/block-library/src/button/save.js b/packages/block-library/src/button/save.js index 695e27e07b5b40..af4f4e6f566f35 100644 --- a/packages/block-library/src/button/save.js +++ b/packages/block-library/src/button/save.js @@ -38,7 +38,7 @@ export default function save( { attributes, className } ) { } ); const buttonStyle = { - borderRadius: borderRadius ? borderRadius + 'px' : undefined, + borderRadius: borderRadius ? borderRadius : undefined, ...colorProps.style, }; diff --git a/packages/block-library/src/heading/editor.scss b/packages/block-library/src/heading/editor.scss index 051a2827139f5d..a1af2ba3702442 100644 --- a/packages/block-library/src/heading/editor.scss +++ b/packages/block-library/src/heading/editor.scss @@ -14,4 +14,7 @@ // level toolbar. .block-library-heading-level-toolbar { border: none; + .components-toolbar-group { + flex-wrap: nowrap; + } } diff --git a/packages/block-library/src/loginout/index.php b/packages/block-library/src/loginout/index.php index c9c23cf90b7b96..ac10ced20f3d1b 100644 --- a/packages/block-library/src/loginout/index.php +++ b/packages/block-library/src/loginout/index.php @@ -38,7 +38,7 @@ function render_block_core_loginout( $attributes ) { } /** - * Registers the `core/latest-posts` block on server. + * Registers the `core/loginout` block on server. */ function register_block_core_loginout() { register_block_type_from_metadata( diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index 0796971e8f9a1a..d4b6cd57b497b5 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -197,10 +197,15 @@ export default compose( [ const selectedBlockHasDescendants = !! getClientIdsOfDescendants( [ selectedBlockId, ] )?.length; + return { isImmediateParentOfSelectedBlock, selectedBlockHasDescendants, hasExistingNavItems: !! innerBlocks.length, + + // This prop is already available but computing it here ensures it's + // fresh compared to isImmediateParentOfSelectedBlock + isSelected: selectedBlockId === clientId, }; } ), withDispatch( ( dispatch, { clientId } ) => { diff --git a/packages/block-library/src/post-author/icon.js b/packages/block-library/src/post-author/icon.js deleted file mode 100644 index 87fa4ecf2a52fb..00000000000000 --- a/packages/block-library/src/post-author/icon.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * WordPress dependencies - */ -import { Path, SVG } from '@wordpress/components'; - -export default ( - - - -); diff --git a/packages/block-library/src/post-author/index.js b/packages/block-library/src/post-author/index.js index d3c19ddabf1116..68fb2c2f737c25 100644 --- a/packages/block-library/src/post-author/index.js +++ b/packages/block-library/src/post-author/index.js @@ -3,7 +3,11 @@ */ import metadata from './block.json'; import edit from './edit'; -import icon from './icon'; + +/** + * WordPress dependencies + */ +import { postAuthor as icon } from '@wordpress/icons'; const { name } = metadata; export { metadata, name }; diff --git a/packages/block-library/src/post-comment-author/icon.js b/packages/block-library/src/post-comment-author/icon.js deleted file mode 100644 index 87fa4ecf2a52fb..00000000000000 --- a/packages/block-library/src/post-comment-author/icon.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * WordPress dependencies - */ -import { Path, SVG } from '@wordpress/components'; - -export default ( - - - -); diff --git a/packages/block-library/src/post-comment-author/index.js b/packages/block-library/src/post-comment-author/index.js index d3c19ddabf1116..68fb2c2f737c25 100644 --- a/packages/block-library/src/post-comment-author/index.js +++ b/packages/block-library/src/post-comment-author/index.js @@ -3,7 +3,11 @@ */ import metadata from './block.json'; import edit from './edit'; -import icon from './icon'; + +/** + * WordPress dependencies + */ +import { postAuthor as icon } from '@wordpress/icons'; const { name } = metadata; export { metadata, name }; diff --git a/packages/block-library/src/search/edit.js b/packages/block-library/src/search/edit.js index ec794a60e44aca..8301ca2c0616be 100644 --- a/packages/block-library/src/search/edit.js +++ b/packages/block-library/src/search/edit.js @@ -50,7 +50,7 @@ import { // Used to calculate border radius adjustment to avoid "fat" corners when // button is placed inside wrapper. -const DEFAULT_INNER_PADDING = 4; +const DEFAULT_INNER_PADDING = '4px'; export default function SearchEdit( { className, @@ -323,10 +323,16 @@ export default function SearchEdit( { if ( 'button-inside' === buttonPosition && style?.border?.radius ) { // We have button inside wrapper and a border radius value to apply. // Add default padding so we don't get "fat" corners. - const outerRadius = - parseInt( style?.border?.radius, 10 ) + DEFAULT_INNER_PADDING; + // + // CSS calc() is used here to support non-pixel units. The inline + // style using calc() will only apply if both values have units. + const radius = Number.isInteger( borderRadius ) + ? `${ borderRadius }px` + : borderRadius; - return { borderRadius: `${ outerRadius }px` }; + return { + borderRadius: `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`, + }; } return undefined; diff --git a/packages/block-library/src/search/index.php b/packages/block-library/src/search/index.php index eba67deeecdce6..faf8741ce7e8bc 100644 --- a/packages/block-library/src/search/index.php +++ b/packages/block-library/src/search/index.php @@ -190,7 +190,8 @@ function styles_for_block_core_search( $attributes ) { if ( $has_border_radius ) { // Shared style for button and input radius values. $border_radius = $attributes['style']['border']['radius']; - $shared_styles[] = sprintf( 'border-radius: %spx;', esc_attr( $border_radius ) ); + $border_radius = is_numeric( $border_radius ) ? $border_radius . 'px' : $border_radius; + $shared_styles[] = sprintf( 'border-radius: %s;', esc_attr( $border_radius ) ); // Apply wrapper border radius if button placed inside. $button_inside = ! empty( $attributes['buttonPosition'] ) && @@ -199,10 +200,13 @@ function styles_for_block_core_search( $attributes ) { if ( $button_inside ) { // We adjust the border radius value for the outer wrapper element // to make it visually consistent with the radius applied to inner - // elements. - $default_padding = 4; - $adjusted_radius = $border_radius + $default_padding; - $wrapper_styles[] = sprintf( 'border-radius: %dpx;', esc_attr( $adjusted_radius ) ); + // elements. calc() is used to support non-pixel CSS units. + $default_padding = '4px'; + $wrapper_styles[] = sprintf( + 'border-radius: calc(%s + %s);', + esc_attr( $border_radius ), + esc_attr( $default_padding ) + ); } } diff --git a/packages/block-library/src/site-logo/index.php b/packages/block-library/src/site-logo/index.php index 46af15ad6dbc66..44d63505cc4ffb 100644 --- a/packages/block-library/src/site-logo/index.php +++ b/packages/block-library/src/site-logo/index.php @@ -111,24 +111,35 @@ function _override_custom_logo_theme_mod( $custom_logo ) { /** * Updates the site_logo option when the custom_logo theme-mod gets updated. * - * @param string $custom_logo The custom logo set by a theme. + * This function is hooked on "update_option_theme_mods_$theme" and not + * "pre_set_theme_mod_custom_logo" because by hooking in `update_option` + * the function accounts for remove_theme_mod() as well. * - * @return string The custom logo. + * @param mixed $old_value The old option value. + * @param mixed $value The new option value. */ -function _sync_custom_logo_to_site_logo( $custom_logo ) { +function _sync_custom_logo_to_site_logo( $old_value, $value ) { // Delete the option when the custom logo does not exist or was removed. // This step ensures the option stays in sync. - if ( empty( $custom_logo ) ) { + if ( empty( $value['custom_logo'] ) ) { delete_option( 'site_logo' ); } else { remove_action( 'update_option_site_logo', '_sync_site_logo_to_custom_logo' ); - update_option( 'site_logo', $custom_logo ); + update_option( 'site_logo', $value['custom_logo'] ); add_action( 'update_option_site_logo', '_sync_site_logo_to_custom_logo', 10, 2 ); } - return $custom_logo; } -add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' ); +/** + * Hooks `_sync_custom_logo_to_site_logo` in `update_option_theme_mods_$theme`. + * + * Runs on `setup_theme` to account for dynamically-switched themes in the Customizer. + */ +function _sync_custom_logo_to_site_logo_on_setup_theme() { + $theme = get_option( 'stylesheet' ); + add_action( "update_option_theme_mods_$theme", '_sync_custom_logo_to_site_logo', 10, 2 ); +} +add_action( 'setup_theme', '_sync_custom_logo_to_site_logo_on_setup_theme', 11 ); /** * Updates the custom_logo theme-mod when the site_logo option gets updated. diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 2ecb3a5b03f9f5..a48af0e56d5ea7 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blocks", - "version": "9.1.1", + "version": "9.1.2", "description": "Block API for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/blocks/src/api/factory.js b/packages/blocks/src/api/factory.js index f01edef37f4f48..a0fab5c32cd39c 100644 --- a/packages/blocks/src/api/factory.js +++ b/packages/blocks/src/api/factory.js @@ -5,7 +5,7 @@ import { v4 as uuid } from 'uuid'; import { every, castArray, - findIndex, + some, isObjectLike, filter, first, @@ -538,28 +538,18 @@ export function switchToBlockType( blocks, name ) { return null; } - const firstSwitchedBlock = findIndex( + const hasSwitchedBlock = some( transformationResults, ( result ) => result.name === name ); // Ensure that at least one block object returned by the transformation has // the expected "destination" block type. - if ( firstSwitchedBlock < 0 ) { + if ( ! hasSwitchedBlock ) { return null; } - return transformationResults.map( ( result, index ) => { - const transformedBlock = { - ...result, - // The first transformed block whose type matches the "destination" - // type gets to keep the existing client ID of the first block. - clientId: - index === firstSwitchedBlock - ? firstBlock.clientId - : result.clientId, - }; - + const ret = transformationResults.map( ( result ) => { /** * Filters an individual transform result from block transformation. * All of the original blocks are passed, since transformations are @@ -570,10 +560,12 @@ export function switchToBlockType( blocks, name ) { */ return applyFilters( 'blocks.switchToBlockType.transformedBlock', - transformedBlock, + result, blocks ); } ); + + return ret; } /** diff --git a/packages/blocks/src/api/test/factory.js b/packages/blocks/src/api/test/factory.js index a840f65135cc61..fc38d753e997b6 100644 --- a/packages/blocks/src/api/test/factory.js +++ b/packages/blocks/src/api/test/factory.js @@ -1537,15 +1537,11 @@ describe( 'block factory', () => { // to keep the existing block's client ID. expect( transformedBlocks ).toHaveLength( 2 ); expect( transformedBlocks[ 0 ] ).toHaveProperty( 'clientId' ); - expect( transformedBlocks[ 0 ].clientId ).not.toBe( - block.clientId - ); expect( transformedBlocks[ 0 ].name ).toBe( 'core/text-block' ); expect( transformedBlocks[ 0 ].isValid ).toBe( true ); expect( transformedBlocks[ 0 ].attributes ).toEqual( { value: 'chicken ribs', } ); - expect( transformedBlocks[ 1 ].clientId ).toBe( block.clientId ); expect( transformedBlocks[ 1 ] ).toHaveProperty( 'clientId' ); expect( transformedBlocks[ 1 ].name ).toBe( 'core/updated-text-block' diff --git a/packages/components/package.json b/packages/components/package.json index e0e932c2639716..b84b3d70ca9d95 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/components", - "version": "14.1.1", + "version": "14.1.2", "description": "UI components for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/core-data/package.json b/packages/core-data/package.json index c16e50e9dfec32..43bdc29d2d8f19 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/core-data", - "version": "3.1.2", + "version": "3.1.3", "description": "Access to and manipulation of core WordPress entities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/core-data/src/resolvers.js b/packages/core-data/src/resolvers.js index 4b61b8f0b63631..e9aabbae6ce0d0 100644 --- a/packages/core-data/src/resolvers.js +++ b/packages/core-data/src/resolvers.js @@ -92,7 +92,7 @@ export function* getEntityRecord( kind, name, key = '', query ) { ); try { if ( query !== undefined && query._fields ) { - // If requesting specific fields, items and query assocation to said + // If requesting specific fields, items and query association to said // records are stored by ID reference. Thus, fields must always include // the ID. query = { @@ -181,7 +181,7 @@ export function* getEntityRecords( kind, name, query = {} ) { ); try { if ( query._fields ) { - // If requesting specific fields, items and query assocation to said + // If requesting specific fields, items and query association to said // records are stored by ID reference. Thus, fields must always include // the ID. query = { diff --git a/packages/customize-widgets/package.json b/packages/customize-widgets/package.json index 4663c747a20e01..20230c41a918c4 100644 --- a/packages/customize-widgets/package.json +++ b/packages/customize-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/customize-widgets", - "version": "1.0.2", + "version": "1.0.3", "description": "Widgets blocks in Customizer Module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index bce64afc3de1e9..e1015a74fc8be5 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/e2e-tests", - "version": "2.2.2", + "version": "2.2.3", "description": "End-To-End (E2E) tests for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap b/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap index c2421bc8c80e2f..a07d125536586f 100644 --- a/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap +++ b/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap @@ -200,6 +200,10 @@ exports[`List should insert a line break on shift+enter in a non trailing list i " `; +exports[`List should not change the contents when you change the list type to Unordered 1`] = `"
  • a
  • b
  • c
  • "`; + +exports[`List should not change the contents when you change the list type to Ordered 1`] = `"
  • 1
  • 2
  • 3
  • "`; + exports[`List should not indent list on space with modifier 1`] = ` "
    • 1
    diff --git a/packages/e2e-tests/specs/editor/blocks/list.test.js b/packages/e2e-tests/specs/editor/blocks/list.test.js index ddc115e2195c45..b75f79bb7af532 100644 --- a/packages/e2e-tests/specs/editor/blocks/list.test.js +++ b/packages/e2e-tests/specs/editor/blocks/list.test.js @@ -507,4 +507,36 @@ describe( 'List', () => { expect( await getEditedPostContent() ).toMatchSnapshot(); } ); + + it( 'should not change the contents when you change the list type to Ordered', async () => { + await clickBlockAppender(); + await page.keyboard.type( '* 1' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( '2' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( '3' ); + await clickBlockToolbarButton( 'Ordered' ); + + const content = await page.$eval( + '.wp-block-list', + ( el ) => el.innerHTML + ); + expect( content ).toMatchSnapshot(); + } ); + + it( 'should not change the contents when you change the list type to Unordered', async () => { + await clickBlockAppender(); + await page.keyboard.type( '1. a' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( 'b' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( 'c' ); + await clickBlockToolbarButton( 'Unordered' ); + + const content = await page.$eval( + '.wp-block-list', + ( el ) => el.innerHTML + ); + expect( content ).toMatchSnapshot(); + } ); } ); diff --git a/packages/edit-navigation/package.json b/packages/edit-navigation/package.json index 8ef55c65a754e2..3d9fe367b8be6c 100644 --- a/packages/edit-navigation/package.json +++ b/packages/edit-navigation/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-navigation", - "version": "1.9.1", + "version": "1.9.2", "private": true, "description": "Module for the Navigation page in WordPress.", "author": "The WordPress Contributors", diff --git a/packages/edit-post/package.json b/packages/edit-post/package.json index c48754808c516a..393a7aa95415bd 100644 --- a/packages/edit-post/package.json +++ b/packages/edit-post/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-post", - "version": "4.1.3", + "version": "4.1.4", "description": "Edit Post module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-site/package.json b/packages/edit-site/package.json index 28ed0b1c76f35a..adc02a0b2504e6 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-site", - "version": "2.1.3", + "version": "2.1.4", "description": "Edit Site Page module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json index 947f4123aa0610..4368a805fab6fe 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-widgets", - "version": "2.1.3", + "version": "2.1.4", "description": "Widgets Page module for WordPress..", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-widgets/src/components/sidebar/index.js b/packages/edit-widgets/src/components/sidebar/index.js index 9f643c2ad9852d..7101d2daca1532 100644 --- a/packages/edit-widgets/src/components/sidebar/index.js +++ b/packages/edit-widgets/src/components/sidebar/index.js @@ -78,17 +78,17 @@ export default function Sidebar() { const selectedBlock = getSelectedBlock(); - let activeArea = getActiveComplementaryArea( editWidgetsStore.name ); - if ( ! activeArea ) { + const activeArea = getActiveComplementaryArea( editWidgetsStore.name ); + + let currentSelection = activeArea; + if ( ! currentSelection ) { if ( selectedBlock ) { - activeArea = BLOCK_INSPECTOR_IDENTIFIER; + currentSelection = BLOCK_INSPECTOR_IDENTIFIER; } else { - activeArea = WIDGET_AREAS_IDENTIFIER; + currentSelection = WIDGET_AREAS_IDENTIFIER; } } - const isSidebarOpen = !! activeArea; - let widgetAreaBlock; if ( selectedBlock ) { if ( selectedBlock.name === 'core/widget-area' ) { @@ -104,11 +104,11 @@ export default function Sidebar() { } return { - currentArea: activeArea, + currentArea: currentSelection, hasSelectedNonAreaBlock: !! ( selectedBlock && selectedBlock.name !== 'core/widget-area' ), - isGeneralSidebarOpen: isSidebarOpen, + isGeneralSidebarOpen: !! activeArea, selectedWidgetAreaBlock: widgetAreaBlock, }; }, [] ); diff --git a/packages/editor/package.json b/packages/editor/package.json index f6649d63309b61..74e9b3dd5491eb 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/editor", - "version": "10.1.2", + "version": "10.1.3", "description": "Enhanced block editor for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/editor/src/components/local-autosave-monitor/index.js b/packages/editor/src/components/local-autosave-monitor/index.js index 4ecc69dc431f10..33230486750ed4 100644 --- a/packages/editor/src/components/local-autosave-monitor/index.js +++ b/packages/editor/src/components/local-autosave-monitor/index.js @@ -168,7 +168,7 @@ function useAutosavePurge() { function LocalAutosaveMonitor() { const { autosave } = useDispatch( editorStore ); - const deferedAutosave = useCallback( () => { + const deferredAutosave = useCallback( () => { requestIdleCallback( () => autosave( { local: true } ) ); }, [] ); useAutosaveNotice(); @@ -185,7 +185,7 @@ function LocalAutosaveMonitor() { return ( ); } diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js index 894596819e68a8..a204aed8465222 100644 --- a/packages/editor/src/components/provider/index.js +++ b/packages/editor/src/components/provider/index.js @@ -60,7 +60,7 @@ function EditorProvider( { } = useDispatch( editorStore ); const { createWarningNotice } = useDispatch( noticesStore ); - // Iniitialize and tear down the editor. + // Initialize and tear down the editor. // Ideally this should be synced on each change and not just something you do once. useLayoutEffect( () => { // Assume that we don't need to initialize in the case of an error recovery. diff --git a/packages/editor/src/store/actions.js b/packages/editor/src/store/actions.js index 64f9a6362d53af..dcd47548b09d48 100644 --- a/packages/editor/src/store/actions.js +++ b/packages/editor/src/store/actions.js @@ -169,7 +169,7 @@ export function __experimentalRequestPostUpdateFinish( options = {} ) { export function updatePost() { deprecated( "wp.data.dispatch( 'core/editor' ).updatePost", { since: '5.7', - alternative: 'User the core entitires store instead', + alternative: 'Use the core entities store instead', } ); return { type: 'DO_NOTHING', diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index aded0dbc2ae410..5f8a5492f86e28 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -772,7 +772,7 @@ export function isEditedPostDateFloating( state ) { // This should be the status of the persisted post // It shouldn't use the "edited" status otherwise it breaks the - // infered post data floating status + // inferred post data floating status // See https://github.com/WordPress/gutenberg/issues/28083 const status = getCurrentPost( state ).status; if ( diff --git a/packages/format-library/package.json b/packages/format-library/package.json index 3288b46fb25ca6..57ae566a838398 100644 --- a/packages/format-library/package.json +++ b/packages/format-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/format-library", - "version": "2.1.1", + "version": "2.1.2", "description": "Format library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/icons/src/index.js b/packages/icons/src/index.js index 7e65e59008b533..29e656324f076c 100644 --- a/packages/icons/src/index.js +++ b/packages/icons/src/index.js @@ -1,5 +1,6 @@ export { default as Icon } from './icon'; +export { default as addCard } from './library/add-card'; export { default as addSubmenu } from './library/add-submenu'; export { default as alignCenter } from './library/align-center'; export { default as alignJustify } from './library/align-justify'; @@ -19,6 +20,7 @@ export { default as blockDefault } from './library/block-default'; export { default as blockTable } from './library/block-table'; export { default as box } from './library/box'; export { default as brush } from './library/brush'; +export { default as bug } from './library/bug'; export { default as button } from './library/button'; export { default as buttons } from './library/buttons'; export { default as calendar } from './library/calendar'; @@ -94,6 +96,7 @@ export { default as justifyLeft } from './library/justify-left'; export { default as justifyCenter } from './library/justify-center'; export { default as justifyRight } from './library/justify-right'; export { default as justifySpaceBetween } from './library/justify-space-between'; +export { default as key } from './library/key'; export { default as keyboardClose } from './library/keyboard-close'; export { default as keyboardReturn } from './library/keyboard-return'; export { default as layout } from './library/layout'; @@ -136,6 +139,7 @@ export { default as plugins } from './library/plugins'; export { default as plusCircleFilled } from './library/plus-circle-filled'; export { default as plusCircle } from './library/plus-circle'; export { default as plus } from './library/plus'; +export { default as postAuthor } from './library/post-author'; export { default as postCategories } from './library/post-categories'; export { default as postContent } from './library/post-content'; export { default as postComments } from './library/post-comments'; @@ -159,6 +163,7 @@ export { default as queryPaginationPrevious } from './library/query-pagination-p export { default as quote } from './library/quote'; export { default as receipt } from './library/receipt'; export { default as redo } from './library/redo'; +export { default as removeBug } from './library/remove-bug'; export { default as replace } from './library/replace'; export { default as resizeCornerNE } from './library/resize-corner-n-e'; export { default as reusableBlock } from './library/reusable-block'; @@ -169,8 +174,9 @@ export { default as search } from './library/search'; export { default as separator } from './library/separator'; export { default as settings } from './library/settings'; export { default as share } from './library/share'; -export { default as siteLogo } from './library/site-logo'; +export { default as shield } from './library/shield'; export { default as shortcode } from './library/shortcode'; +export { default as siteLogo } from './library/site-logo'; export { default as stack } from './library/stack'; export { default as starEmpty } from './library/star-empty'; export { default as starFilled } from './library/star-filled'; diff --git a/packages/icons/src/library/add-card.js b/packages/icons/src/library/add-card.js new file mode 100644 index 00000000000000..17610fbe31b407 --- /dev/null +++ b/packages/icons/src/library/add-card.js @@ -0,0 +1,12 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const addCard = ( + + + +); + +export default addCard; diff --git a/packages/icons/src/library/bug.js b/packages/icons/src/library/bug.js new file mode 100644 index 00000000000000..1837ab47749adc --- /dev/null +++ b/packages/icons/src/library/bug.js @@ -0,0 +1,16 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const bug = ( + + + +); + +export default bug; diff --git a/packages/icons/src/library/key.js b/packages/icons/src/library/key.js new file mode 100644 index 00000000000000..6eb7a4a40065aa --- /dev/null +++ b/packages/icons/src/library/key.js @@ -0,0 +1,16 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const key = ( + + + +); + +export default key; diff --git a/packages/icons/src/library/people.js b/packages/icons/src/library/people.js index a521af10f3b77b..cda1f9128a445e 100644 --- a/packages/icons/src/library/people.js +++ b/packages/icons/src/library/people.js @@ -5,7 +5,10 @@ import { SVG, Path } from '@wordpress/primitives'; const people = ( - + ); diff --git a/packages/icons/src/library/post-author.js b/packages/icons/src/library/post-author.js new file mode 100644 index 00000000000000..fc0567f146b01c --- /dev/null +++ b/packages/icons/src/library/post-author.js @@ -0,0 +1,16 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const postAuthor = ( + + + +); + +export default postAuthor; diff --git a/packages/icons/src/library/remove-bug.js b/packages/icons/src/library/remove-bug.js new file mode 100644 index 00000000000000..d92fc76d3dda4d --- /dev/null +++ b/packages/icons/src/library/remove-bug.js @@ -0,0 +1,12 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const removeBug = ( + + + +); + +export default removeBug; diff --git a/packages/icons/src/library/shield.js b/packages/icons/src/library/shield.js new file mode 100644 index 00000000000000..3dc11ab96a1313 --- /dev/null +++ b/packages/icons/src/library/shield.js @@ -0,0 +1,16 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const shield = ( + + + +); + +export default shield; diff --git a/packages/interface/package.json b/packages/interface/package.json index a8b7c50fe29737..d787f3df8a7729 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/interface", - "version": "3.1.1", + "version": "3.1.2", "description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/list-reusable-blocks/package.json b/packages/list-reusable-blocks/package.json index 606990ffd8da93..5b23f96d369cb1 100644 --- a/packages/list-reusable-blocks/package.json +++ b/packages/list-reusable-blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/list-reusable-blocks", - "version": "2.1.1", + "version": "2.1.2", "description": "Adding Export/Import support to the reusable blocks listing.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/nux/package.json b/packages/nux/package.json index 416194b1bfbdfd..5bfc0cdecfee4c 100644 --- a/packages/nux/package.json +++ b/packages/nux/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/nux", - "version": "4.1.1", + "version": "4.1.2", "description": "NUX (New User eXperience) module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/postcss-plugins-preset/package.json b/packages/postcss-plugins-preset/package.json index 59bb26a2d09d33..dd98955ad5c603 100644 --- a/packages/postcss-plugins-preset/package.json +++ b/packages/postcss-plugins-preset/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/postcss-plugins-preset", - "version": "3.1.1", + "version": "3.1.2", "description": "PostCSS sharable plugins preset for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/reusable-blocks/package.json b/packages/reusable-blocks/package.json index db980f985e56d4..8263dd6527dbb6 100644 --- a/packages/reusable-blocks/package.json +++ b/packages/reusable-blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/reusable-blocks", - "version": "2.1.2", + "version": "2.1.3", "description": "Reusable blocks utilities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/scripts/package.json b/packages/scripts/package.json index bd00e1ac37598f..60a7aa53ab6b85 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/scripts", - "version": "16.1.1", + "version": "16.1.2", "description": "Collection of reusable scripts for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/server-side-render/package.json b/packages/server-side-render/package.json index 36be72ac1f7a64..2887a7fd7372fe 100644 --- a/packages/server-side-render/package.json +++ b/packages/server-side-render/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/server-side-render", - "version": "2.1.1", + "version": "2.1.2", "description": "The component used with WordPress to server-side render a preview of dynamic blocks to display in the editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/widgets/package.json b/packages/widgets/package.json index 1bbf7d0d64de5a..d43d74297013d0 100644 --- a/packages/widgets/package.json +++ b/packages/widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/widgets", - "version": "1.1.2", + "version": "1.1.3", "description": "Functionality used by the widgets block editor in the Widgets screen and the Customizer.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later",