From f2b3b174f763319d5507dc689f1dc5795b2a921c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= <4710635+ellatrix@users.noreply.github.com> Date: Tue, 26 Jul 2022 19:30:49 +0200 Subject: [PATCH 001/104] List v2: remove Quote transforms as removed by Quote v2 (#42700) --- packages/block-library/src/list/transforms.js | 17 -------- .../block-library/src/list/v2/transforms.js | 42 +------------------ .../editor/various/block-switcher.test.js | 3 +- 3 files changed, 3 insertions(+), 59 deletions(-) diff --git a/packages/block-library/src/list/transforms.js b/packages/block-library/src/list/transforms.js index 32667a99a735af..8f2c768a343b77 100644 --- a/packages/block-library/src/list/transforms.js +++ b/packages/block-library/src/list/transforms.js @@ -161,23 +161,6 @@ const transforms = { } ) ), }, - { - type: 'block', - blocks: [ 'core/pullquote' ], - transform: ( { values, anchor } ) => { - return createBlock( 'core/pullquote', { - value: toHTMLString( { - value: create( { - html: values, - multilineTag: 'li', - multilineWrapperTags: [ 'ul', 'ol' ], - } ), - multilineTag: 'p', - } ), - anchor, - } ); - }, - }, { type: 'block', blocks: [ 'core/table-of-contents' ], diff --git a/packages/block-library/src/list/v2/transforms.js b/packages/block-library/src/list/v2/transforms.js index d357df3d8ed656..ab23c4c75cd916 100644 --- a/packages/block-library/src/list/v2/transforms.js +++ b/packages/block-library/src/list/v2/transforms.js @@ -9,13 +9,8 @@ import { flatMap } from 'lodash'; /** * WordPress dependencies */ -import { createBlock, switchToBlockType } from '@wordpress/blocks'; -import { - __UNSTABLE_LINE_SEPARATOR, - create, - split, - toHTMLString, -} from '@wordpress/rich-text'; +import { createBlock } from '@wordpress/blocks'; +import { create, split, toHTMLString } from '@wordpress/rich-text'; /** * Internal dependencies @@ -83,26 +78,6 @@ const transforms = { ); }, }, - { - type: 'block', - blocks: [ 'core/quote', 'core/pullquote' ], - transform: ( { value, anchor } ) => { - return createBlock( - 'core/list', - { - anchor, - }, - split( - create( { html: value, multilineTag: 'p' } ), - __UNSTABLE_LINE_SEPARATOR - ).map( ( result ) => { - return createBlock( 'core/list-item', { - content: toHTMLString( { value: result } ), - } ); - } ) - ); - }, - }, ...[ '*', '-' ].map( ( prefix ) => ( { type: 'prefix', prefix, @@ -147,19 +122,6 @@ const transforms = { ); }, } ) ), - ...[ 'core/quote', 'core/pullquote' ].map( ( block ) => ( { - type: 'block', - blocks: [ block ], - transform: ( attributes, innerBlocks ) => { - return switchToBlockType( - switchToBlockType( - createBlock( 'core/list', attributes, innerBlocks ), - 'core/paragraph' - ), - block - ); - }, - } ) ), ], }; diff --git a/packages/e2e-tests/specs/editor/various/block-switcher.test.js b/packages/e2e-tests/specs/editor/various/block-switcher.test.js index 7adbac136cd2e1..1b82f1f23ad025 100644 --- a/packages/e2e-tests/specs/editor/various/block-switcher.test.js +++ b/packages/e2e-tests/specs/editor/various/block-switcher.test.js @@ -29,7 +29,7 @@ describe( 'Block Switcher', () => { 'Group', 'Paragraph', 'Heading', - 'Pullquote', + 'Quote', 'Columns', 'Table of Contents', ] ) @@ -55,7 +55,6 @@ describe( 'Block Switcher', () => { expect.arrayContaining( [ 'Group', 'Paragraph', - 'Pullquote', 'Heading', 'Table of Contents', ] ) From 12b77c309a248b88eb241ee6e3899c7f39858f2b Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Tue, 26 Jul 2022 17:37:17 +0000 Subject: [PATCH 002/104] Bump plugin version to 13.7.3 --- gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gutenberg.php b/gutenberg.php index 101ae0c82f20e5..fbf3b5ab9a64b0 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -5,7 +5,7 @@ * Description: Printing since 1440. This is the development plugin for the new block editor in core. * Requires at least: 5.9 * Requires PHP: 5.6 - * Version: 13.7.2 + * Version: 13.7.3 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index 8e4259dd278b5a..67c7b536ee6131 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "13.7.2", + "version": "13.7.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 92de4efdab2269..cdb5c5659b0b89 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "13.7.2", + "version": "13.7.3", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", From c81fb68193ef25fb42a05f3f004a0c0921fd1643 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Tue, 26 Jul 2022 17:47:43 +0000 Subject: [PATCH 003/104] Update Changelog for 13.7.3 --- changelog.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/changelog.txt b/changelog.txt index 38560c78224b21..2377924306f430 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,22 @@ == Changelog == += 13.7.3 = + + + +## Changelog + +### Various + +- Redirect old `theme_page` Site Editor routes to the new `site-editor.php` page. ([42643](https://github.com/WordPress/gutenberg/pull/42643)) + +## Contributors + +The following contributors merged PRs in this release: + +@fullofcaffeine + + = 13.7.2 = ## Changelog From f42ea1ae4bef2a4ba0e63847c46ea42193240f86 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Tue, 26 Jul 2022 14:54:26 -0700 Subject: [PATCH 004/104] `ColorPalette`: Display checkered preview background when `value` is transparent (#42232) * ColorPalette: `background` is already styled when `value` is 'transparent' * Use `colord( currentValue ).alpha()` to determine transparency * Add a test case for `undefined` value * Add a changelog entry * Clarify test description Co-authored-by: Lena Morita * Updated expected behavior for `undefined` value Co-authored-by: Lena Morita --- packages/components/CHANGELOG.md | 1 + .../components/src/color-palette/index.js | 27 +++++++++++++------ .../src/color-palette/test/utils.ts | 20 +++++++++++++- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index bac27e61ad0e57..d73bbe6b79a85b 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -19,6 +19,7 @@ - `InputControl`: Implement wrapper subcomponents for adding responsive padding to `prefix`/`suffix` ([#42378](https://github.com/WordPress/gutenberg/pull/42378)). - `SelectControl`: Add flag for larger default size ([#42456](https://github.com/WordPress/gutenberg/pull/42456/)). - `UnitControl`: Update unit select's focus styles to match input's ([#42383](https://github.com/WordPress/gutenberg/pull/42383)). +- `ColorPalette`: Display checkered preview background when `value` is transparent ([#42232](https://github.com/WordPress/gutenberg/pull/42232)). - `CustomSelectControl`: Add size variants ([#42460](https://github.com/WordPress/gutenberg/pull/42460/)). - `CustomSelectControl`: Add flag to opt in to unconstrained width ([#42460](https://github.com/WordPress/gutenberg/pull/42460/)). - `Dropdown`: Implement wrapper subcomponent for adding different padding to the dropdown content ([#42595](https://github.com/WordPress/gutenberg/pull/42595/)). diff --git a/packages/components/src/color-palette/index.js b/packages/components/src/color-palette/index.js index 5ef690eb1e4fa8..024fabdb672028 100644 --- a/packages/components/src/color-palette/index.js +++ b/packages/components/src/color-palette/index.js @@ -162,6 +162,13 @@ export const extractColorNameFromCurrentValue = ( return __( 'Custom' ); }; +export const showTransparentBackground = ( currentValue ) => { + if ( typeof currentValue === 'undefined' ) { + return true; + } + return colord( currentValue ).alpha() === 0; +}; + export default function ColorPalette( { clearable = true, className, @@ -228,14 +235,18 @@ export default function ColorPalette( { aria-haspopup="true" onClick={ onToggle } aria-label={ customColorAccessibleLabel } - style={ { - background: value, - color: - colordColor.contrast() > - colordColor.contrast( '#000' ) - ? '#fff' - : '#000', - } } + style={ + showTransparentBackground( value ) + ? { color: '#000' } + : { + background: value, + color: + colordColor.contrast() > + colordColor.contrast( '#000' ) + ? '#fff' + : '#000', + } + } > { describe( 'extractColorNameFromCurrentValue', () => { @@ -21,4 +24,19 @@ describe( 'ColorPalette: Utils', () => { expect( result ).toBe( 'Blue' ); } ); } ); + describe( 'showTransparentBackground', () => { + test( 'should return true for undefined color values', () => { + expect( showTransparentBackground( undefined ) ).toBe( true ); + } ); + test( 'should return true for transparent colors', () => { + expect( showTransparentBackground( 'transparent' ) ).toBe( true ); + expect( showTransparentBackground( '#75757500' ) ).toBe( true ); + } ); + + test( 'should return false for non-transparent colors', () => { + expect( showTransparentBackground( '#FFF' ) ).toBe( false ); + expect( showTransparentBackground( '#757575' ) ).toBe( false ); + expect( showTransparentBackground( '#f5f5f524' ) ).toBe( false ); // 0.14 alpha. + } ); + } ); } ); From 8d2e12d1debaf0e9e051f1c3810db2493d98effc Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Wed, 27 Jul 2022 11:25:23 +0800 Subject: [PATCH 005/104] Add block variations for individual template parts (#42454) * Show individual template parts in the inserter * Use proper icons * Add example * Fix icon/area mixup * lint * Fix block previews for variations when the main block has no example * Prevent the fallback to the block description * Truncate inserter items to 3 lines of text * Avoid removing public stable PHP function * Fix typo --- .../components/inserter-list-item/index.js | 5 +- .../src/components/inserter/preview-panel.js | 20 ++----- .../block-library/src/template-part/index.php | 58 ++++++++++++++++++- 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/packages/block-editor/src/components/inserter-list-item/index.js b/packages/block-editor/src/components/inserter-list-item/index.js index 9fdf42f91eeb93..f791dfb5fdc2ae 100644 --- a/packages/block-editor/src/components/inserter-list-item/index.js +++ b/packages/block-editor/src/components/inserter-list-item/index.js @@ -11,6 +11,7 @@ import { createBlock, createBlocksFromInnerBlocksTemplate, } from '@wordpress/blocks'; +import { __experimentalTruncate as Truncate } from '@wordpress/components'; import { ENTER } from '@wordpress/keycodes'; /** @@ -135,7 +136,9 @@ function InserterListItem( { - { item.title } + + { item.title } + diff --git a/packages/block-editor/src/components/inserter/preview-panel.js b/packages/block-editor/src/components/inserter/preview-panel.js index f6508a0a9d363a..2814975c329d22 100644 --- a/packages/block-editor/src/components/inserter/preview-panel.js +++ b/packages/block-editor/src/components/inserter/preview-panel.js @@ -5,7 +5,6 @@ import { isReusableBlock, createBlock, getBlockFromExample, - getBlockType, } from '@wordpress/blocks'; import { __ } from '@wordpress/i18n'; @@ -16,31 +15,24 @@ import BlockCard from '../block-card'; import BlockPreview from '../block-preview'; function InserterPreviewPanel( { item } ) { - const { name, title, icon, description, initialAttributes } = item; - const hoveredItemBlockType = getBlockType( name ); + const { name, title, icon, description, initialAttributes, example } = item; const isReusable = isReusableBlock( item ); return (
- { isReusable || hoveredItemBlockType?.example ? ( + { isReusable || example ? (
'wp_template_part', + ), + 'wp_template_part' + ); + + $defined_areas = get_allowed_block_template_part_areas(); + $icon_by_area = array_combine( array_column( $defined_areas, 'area' ), array_column( $defined_areas, 'icon' ) ); + + foreach ( $template_parts as $template_part ) { + $variations[] = array( + 'name' => sanitize_title( $template_part->slug ), + 'title' => $template_part->title, + // If there's no description for the template part don't show the + // block description. This is a bit hacky, but prevent the fallback + // by using a non-breaking space so that the value of description + // isn't falsey. + 'description' => $template_part->description || ' ', + 'attributes' => array( + 'slug' => $template_part->slug, + 'theme' => $template_part->theme, + 'area' => $template_part->area, + ), + 'scope' => array( 'inserter' ), + 'icon' => $icon_by_area[ $template_part->area ], + 'example' => array( + 'attributes' => array( + 'slug' => $template_part->slug, + 'theme' => $template_part->theme, + 'area' => $template_part->area, + ), + ), + ); + } + return $variations; +} + +/** + * Returns an array of all template part block variations. + * + * @return array Array containing the block variation objects. + */ +function build_template_part_block_variations() { + return array_merge( build_template_part_block_area_variations(), build_template_part_block_instance_variations() ); +} + /** * Registers the `core/template-part` block on the server. */ From b9967bfde2f006a354ddfbc14c003df8641ca7b9 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Wed, 27 Jul 2022 07:54:59 +0200 Subject: [PATCH 006/104] Replace clickable div elements with buttons in the Add template modal. (#42668) --- .../add-custom-template-modal.js | 11 ++++---- .../components/add-new-template/style.scss | 28 +++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/packages/edit-site/src/components/add-new-template/add-custom-template-modal.js b/packages/edit-site/src/components/add-new-template/add-custom-template-modal.js index 964c1f9f5099d2..378bfbed4d8e36 100644 --- a/packages/edit-site/src/components/add-new-template/add-custom-template-modal.js +++ b/packages/edit-site/src/components/add-new-template/add-custom-template-modal.js @@ -11,7 +11,6 @@ import { SearchControl, TextHighlight, __experimentalText as Text, - __experimentalHeading as Heading, __unstableComposite as Composite, __unstableUseCompositeState as useCompositeState, __unstableCompositeItem as CompositeItem, @@ -191,15 +190,16 @@ function AddCustomTemplateModal( { onClose, onSelect, entityForSuggestions } ) { > { const { slug, title, description } = entityForSuggestions.template; onSelect( { slug, title, description } ); } } > - + { entityForSuggestions.labels.all_items } - + { // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. @@ -209,13 +209,14 @@ function AddCustomTemplateModal( { onClose, onSelect, entityForSuggestions } ) { { setShowSearchEntities( true ); } } > - + { entityForSuggestions.labels.singular_name } - + { // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. diff --git a/packages/edit-site/src/components/add-new-template/style.scss b/packages/edit-site/src/components/add-new-template/style.scss index 7ee65f4f94a9f8..46ec1f28fa6084 100644 --- a/packages/edit-site/src/components/add-new-template/style.scss +++ b/packages/edit-site/src/components/add-new-template/style.scss @@ -12,33 +12,45 @@ .edit-site-custom-template-modal { &__contents { - > div { - text-align: center; - cursor: pointer; + > .components-button { padding: $grid-unit-30; - border: 1px solid $gray-300; + box-shadow: inset 0 0 0 $border-width $gray-600; border-radius: $radius-block-ui; width: 256px; + height: auto; display: flex; flex-direction: column; gap: $grid-unit; - align-items: center; - justify-content: center; + + // Show the boundary of the button, in High Contrast Mode. + outline: 1px solid transparent; + + span:first-child { + color: $gray-900; + } span { color: $gray-700; } &:hover { - border-color: var(--wp-admin-theme-color); + color: var(--wp-admin-theme-color-darker-10); + box-shadow: inset 0 0 0 $border-width var(--wp-admin-theme-color-darker-10); - h5 { + span:first-child { color: var(--wp-admin-theme-color); } } &:focus { box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color); + + // Windows High Contrast mode will show this outline, but not the box-shadow. + outline: 3px solid transparent; + + span:first-child { + color: var(--wp-admin-theme-color); + } } } } From ddd61e42f27a4301f83a0f604df84bac724ec93c Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 27 Jul 2022 10:07:09 +0400 Subject: [PATCH 007/104] Display post template selection for non-admin users (#42705) --- .../edit-post/src/components/sidebar/post-template/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/sidebar/post-template/index.js b/packages/edit-post/src/components/sidebar/post-template/index.js index 46eb55c6ffa88f..87b905b5a434a3 100644 --- a/packages/edit-post/src/components/sidebar/post-template/index.js +++ b/packages/edit-post/src/components/sidebar/post-template/index.js @@ -27,7 +27,11 @@ export default function PostTemplate() { const hasTemplates = !! settings.availableTemplates && Object.keys( settings.availableTemplates ).length > 0; - if ( ! hasTemplates && ! settings.supportsTemplateMode ) { + if ( hasTemplates ) { + return true; + } + + if ( ! settings.supportsTemplateMode ) { return false; } From 226f3fe1db35332f730d2902ab4782e750e7f8ce Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Wed, 27 Jul 2022 11:03:13 +0100 Subject: [PATCH 008/104] Link elements: Add a :where selector to the :not to lower specificity (#42669) * Link elements: Add a :where selector to the :not to lower specificity * update tests * fix missing : --- lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php | 2 +- phpunit/class-wp-theme-json-test.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php b/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php index ac2f983721aa74..e8dda25216a8f9 100644 --- a/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php +++ b/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php @@ -87,7 +87,7 @@ class WP_Theme_JSON_6_1 extends WP_Theme_JSON_6_0 { * @var string[] */ const ELEMENTS = array( - 'link' => 'a:not(.wp-element-button)', + 'link' => 'a:where(:not(.wp-element-button))', // The where is needed to lower the specificity. 'heading' => 'h1, h2, h3, h4, h5, h6', 'h1' => 'h1', 'h2' => 'h2', diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index 655c5c5e5f8c92..e5260cde9d3501 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -220,7 +220,7 @@ function test_get_stylesheet_handles_whitelisted_element_pseudo_selectors() { $base_styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; - $element_styles = 'a:not(.wp-element-button){background-color: red;color: green;}a:not(.wp-element-button):hover{background-color: green;color: red;font-size: 10em;text-transform: uppercase;}a:not(.wp-element-button):focus{background-color: black;color: yellow;}'; + $element_styles = 'a:where(:not(.wp-element-button)){background-color: red;color: green;}a:where(:not(.wp-element-button)):hover{background-color: green;color: red;font-size: 10em;text-transform: uppercase;}a:where(:not(.wp-element-button)):focus{background-color: black;color: yellow;}'; $expected = $base_styles . $element_styles; @@ -259,7 +259,7 @@ function test_get_stylesheet_handles_only_pseudo_selector_rules_for_given_proper $base_styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; - $element_styles = 'a:not(.wp-element-button):hover{background-color: green;color: red;font-size: 10em;text-transform: uppercase;}a:not(.wp-element-button):focus{background-color: black;color: yellow;}'; + $element_styles = 'a:where(:not(.wp-element-button)):hover{background-color: green;color: red;font-size: 10em;text-transform: uppercase;}a:where(:not(.wp-element-button)):focus{background-color: black;color: yellow;}'; $expected = $base_styles . $element_styles; @@ -337,7 +337,7 @@ function test_get_stylesheet_ignores_non_whitelisted_pseudo_selectors() { $base_styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; - $element_styles = 'a:not(.wp-element-button){background-color: red;color: green;}a:not(.wp-element-button):hover{background-color: green;color: red;}'; + $element_styles = 'a:where(:not(.wp-element-button)){background-color: red;color: green;}a:where(:not(.wp-element-button)):hover{background-color: green;color: red;}'; $expected = $base_styles . $element_styles; @@ -385,7 +385,7 @@ function test_get_stylesheet_handles_priority_of_elements_vs_block_elements_pseu $base_styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; - $element_styles = '.wp-block-group a:not(.wp-element-button){background-color: red;color: green;}.wp-block-group a:not(.wp-element-button):hover{background-color: green;color: red;font-size: 10em;text-transform: uppercase;}.wp-block-group a:not(.wp-element-button):focus{background-color: black;color: yellow;}'; + $element_styles = '.wp-block-group a:where(:not(.wp-element-button)){background-color: red;color: green;}.wp-block-group a:where(:not(.wp-element-button)):hover{background-color: green;color: red;font-size: 10em;text-transform: uppercase;}.wp-block-group a:where(:not(.wp-element-button)):focus{background-color: black;color: yellow;}'; $expected = $base_styles . $element_styles; @@ -432,7 +432,7 @@ function test_get_stylesheet_handles_whitelisted_block_level_element_pseudo_sele $base_styles = 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; - $element_styles = 'a:not(.wp-element-button){background-color: red;color: green;}a:not(.wp-element-button):hover{background-color: green;color: red;}.wp-block-group a:not(.wp-element-button):hover{background-color: black;color: yellow;}'; + $element_styles = 'a:where(:not(.wp-element-button)){background-color: red;color: green;}a:where(:not(.wp-element-button)):hover{background-color: green;color: red;}.wp-block-group a:where(:not(.wp-element-button)):hover{background-color: black;color: yellow;}'; $expected = $base_styles . $element_styles; From a1256e179ce37e70ee58e4c3e54ee9af13dbf219 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 27 Jul 2022 13:16:13 +0000 Subject: [PATCH 009/104] Bump plugin version to 13.8.0-rc.1 --- gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gutenberg.php b/gutenberg.php index fbf3b5ab9a64b0..5ec7ba38c90122 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -5,7 +5,7 @@ * Description: Printing since 1440. This is the development plugin for the new block editor in core. * Requires at least: 5.9 * Requires PHP: 5.6 - * Version: 13.7.3 + * Version: 13.8.0-rc.1 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index 67c7b536ee6131..d99d2ce2d5e03f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "13.7.3", + "version": "13.8.0-rc.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cdb5c5659b0b89..837e3c7276a803 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "13.7.3", + "version": "13.8.0-rc.1", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", From e3d15d659a33aea084434b6da417115406649fe1 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 27 Jul 2022 13:43:22 +0000 Subject: [PATCH 010/104] Update changelog files --- packages/a11y/CHANGELOG.md | 2 ++ packages/a11y/package.json | 2 +- packages/annotations/CHANGELOG.md | 2 ++ packages/annotations/package.json | 2 +- packages/api-fetch/CHANGELOG.md | 2 ++ packages/api-fetch/package.json | 2 +- packages/autop/CHANGELOG.md | 2 ++ packages/autop/package.json | 2 +- packages/blob/CHANGELOG.md | 2 ++ packages/blob/package.json | 2 +- packages/block-directory/CHANGELOG.md | 2 ++ packages/block-directory/package.json | 2 +- packages/block-editor/CHANGELOG.md | 2 ++ packages/block-editor/package.json | 2 +- packages/block-library/CHANGELOG.md | 2 ++ packages/block-library/package.json | 2 +- packages/block-serialization-default-parser/CHANGELOG.md | 2 ++ packages/block-serialization-default-parser/package.json | 2 +- packages/block-serialization-spec-parser/CHANGELOG.md | 2 ++ packages/block-serialization-spec-parser/package.json | 2 +- packages/blocks/CHANGELOG.md | 2 ++ packages/blocks/package.json | 2 +- packages/components/CHANGELOG.md | 2 ++ packages/components/package.json | 2 +- packages/compose/CHANGELOG.md | 2 ++ packages/compose/package.json | 2 +- packages/core-data/CHANGELOG.md | 2 ++ packages/core-data/package.json | 2 +- packages/customize-widgets/CHANGELOG.md | 2 ++ packages/customize-widgets/package.json | 2 +- packages/data-controls/CHANGELOG.md | 2 ++ packages/data-controls/package.json | 2 +- packages/data/CHANGELOG.md | 2 ++ packages/data/package.json | 2 +- packages/date/CHANGELOG.md | 2 ++ packages/date/package.json | 2 +- packages/deprecated/CHANGELOG.md | 2 ++ packages/deprecated/package.json | 2 +- packages/dom-ready/CHANGELOG.md | 2 ++ packages/dom-ready/package.json | 2 +- packages/dom/CHANGELOG.md | 2 ++ packages/dom/package.json | 2 +- packages/edit-post/CHANGELOG.md | 2 ++ packages/edit-post/package.json | 2 +- packages/edit-site/CHANGELOG.md | 2 ++ packages/edit-site/package.json | 2 +- packages/edit-widgets/CHANGELOG.md | 2 ++ packages/edit-widgets/package.json | 2 +- packages/editor/CHANGELOG.md | 2 ++ packages/editor/package.json | 2 +- packages/element/CHANGELOG.md | 2 ++ packages/element/package.json | 2 +- packages/env/CHANGELOG.md | 2 ++ packages/env/package.json | 2 +- packages/escape-html/CHANGELOG.md | 2 ++ packages/escape-html/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 2 ++ packages/eslint-plugin/package.json | 2 +- packages/format-library/CHANGELOG.md | 2 ++ packages/format-library/package.json | 2 +- packages/hooks/CHANGELOG.md | 2 ++ packages/hooks/package.json | 2 +- packages/html-entities/CHANGELOG.md | 2 ++ packages/html-entities/package.json | 2 +- packages/i18n/CHANGELOG.md | 2 ++ packages/i18n/package.json | 2 +- packages/icons/CHANGELOG.md | 2 ++ packages/icons/package.json | 2 +- packages/interface/CHANGELOG.md | 2 ++ packages/interface/package.json | 2 +- packages/is-shallow-equal/CHANGELOG.md | 2 ++ packages/is-shallow-equal/package.json | 2 +- packages/keyboard-shortcuts/CHANGELOG.md | 2 ++ packages/keyboard-shortcuts/package.json | 2 +- packages/keycodes/CHANGELOG.md | 2 ++ packages/keycodes/package.json | 2 +- packages/list-reusable-blocks/CHANGELOG.md | 2 ++ packages/list-reusable-blocks/package.json | 2 +- packages/media-utils/CHANGELOG.md | 2 ++ packages/media-utils/package.json | 2 +- packages/notices/CHANGELOG.md | 2 ++ packages/notices/package.json | 2 +- packages/nux/CHANGELOG.md | 2 ++ packages/nux/package.json | 2 +- packages/plugins/CHANGELOG.md | 2 ++ packages/plugins/package.json | 2 +- packages/preferences-persistence/CHANGELOG.md | 2 ++ packages/preferences-persistence/package.json | 2 +- packages/preferences/CHANGELOG.md | 2 ++ packages/preferences/package.json | 2 +- packages/primitives/CHANGELOG.md | 2 ++ packages/primitives/package.json | 2 +- packages/priority-queue/CHANGELOG.md | 2 ++ packages/priority-queue/package.json | 2 +- packages/react-i18n/CHANGELOG.md | 2 ++ packages/react-i18n/package.json | 2 +- packages/redux-routine/CHANGELOG.md | 2 ++ packages/redux-routine/package.json | 2 +- packages/reusable-blocks/CHANGELOG.md | 2 ++ packages/reusable-blocks/package.json | 2 +- packages/rich-text/CHANGELOG.md | 2 ++ packages/rich-text/package.json | 2 +- packages/scripts/CHANGELOG.md | 2 ++ packages/scripts/package.json | 2 +- packages/server-side-render/CHANGELOG.md | 2 ++ packages/server-side-render/package.json | 2 +- packages/shortcode/CHANGELOG.md | 2 ++ packages/shortcode/package.json | 2 +- packages/style-engine/CHANGELOG.md | 2 ++ packages/style-engine/package.json | 2 +- packages/token-list/CHANGELOG.md | 2 ++ packages/token-list/package.json | 2 +- packages/url/CHANGELOG.md | 2 ++ packages/url/package.json | 2 +- packages/viewport/CHANGELOG.md | 2 ++ packages/viewport/package.json | 2 +- packages/warning/CHANGELOG.md | 2 ++ packages/warning/package.json | 2 +- packages/widgets/CHANGELOG.md | 2 ++ packages/widgets/package.json | 2 +- packages/wordcount/CHANGELOG.md | 2 ++ packages/wordcount/package.json | 2 +- 122 files changed, 183 insertions(+), 61 deletions(-) diff --git a/packages/a11y/CHANGELOG.md b/packages/a11y/CHANGELOG.md index a75b81bd85df02..8b313161d97870 100644 --- a/packages/a11y/CHANGELOG.md +++ b/packages/a11y/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/a11y/package.json b/packages/a11y/package.json index ed4b62c1e5bf78..bd3d2ddcac925a 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/a11y", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "Accessibility (a11y) utilities for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/annotations/CHANGELOG.md b/packages/annotations/CHANGELOG.md index 5cf14cee604ac8..f9c7f503d43ac3 100644 --- a/packages/annotations/CHANGELOG.md +++ b/packages/annotations/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.14.0 (2022-07-27) + ## 2.13.0 (2022-07-13) ## 2.12.0 (2022-06-29) diff --git a/packages/annotations/package.json b/packages/annotations/package.json index ff320b53c557b8..aaf0b720f25590 100644 --- a/packages/annotations/package.json +++ b/packages/annotations/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/annotations", - "version": "2.13.0", + "version": "2.14.0-prerelease", "description": "Annotate content in the Gutenberg editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/api-fetch/CHANGELOG.md b/packages/api-fetch/CHANGELOG.md index 49244c34120245..d7cced93983080 100644 --- a/packages/api-fetch/CHANGELOG.md +++ b/packages/api-fetch/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 6.11.0 (2022-07-27) + ## 6.10.0 (2022-07-13) ## 6.9.0 (2022-06-29) diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json index a8cc26951bea0e..899478ca9485c6 100644 --- a/packages/api-fetch/package.json +++ b/packages/api-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/api-fetch", - "version": "6.10.0", + "version": "6.11.0-prerelease", "description": "Utility to make WordPress REST API requests.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/autop/CHANGELOG.md b/packages/autop/CHANGELOG.md index 931cd06f21d488..d9503622cd2662 100644 --- a/packages/autop/CHANGELOG.md +++ b/packages/autop/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/autop/package.json b/packages/autop/package.json index 3740a0973fc1fc..16dfeb8db861a4 100644 --- a/packages/autop/package.json +++ b/packages/autop/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/autop", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "WordPress's automatic paragraph functions `autop` and `removep`.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/blob/CHANGELOG.md b/packages/blob/CHANGELOG.md index ad86b81dd917c5..73f100c4daf0c1 100644 --- a/packages/blob/CHANGELOG.md +++ b/packages/blob/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/blob/package.json b/packages/blob/package.json index 908205a2041b3e..4fdb8d685b4910 100644 --- a/packages/blob/package.json +++ b/packages/blob/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blob", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "Blob utilities for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-directory/CHANGELOG.md b/packages/block-directory/CHANGELOG.md index b6e595211e59e2..bcdab866d4d364 100644 --- a/packages/block-directory/CHANGELOG.md +++ b/packages/block-directory/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json index 0bb6c1106b6e55..0332aa422bdb74 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-directory", - "version": "3.11.0", + "version": "3.12.0-prerelease", "description": "Extend editor with block directory features to search, download and install blocks.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-editor/CHANGELOG.md b/packages/block-editor/CHANGELOG.md index 19a6d64d420d64..9b9b9a4c1bfd11 100644 --- a/packages/block-editor/CHANGELOG.md +++ b/packages/block-editor/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 9.6.0 (2022-07-27) + ## 9.5.0 (2022-07-13) ## 9.4.0 (2022-06-29) diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json index 42e8eafa6398de..a3d345289ad273 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-editor", - "version": "9.5.0", + "version": "9.6.0-prerelease", "description": "Generic block editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-library/CHANGELOG.md b/packages/block-library/CHANGELOG.md index f0bc0b2b73e44b..32ed9cc6925d18 100644 --- a/packages/block-library/CHANGELOG.md +++ b/packages/block-library/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 7.11.0 (2022-07-27) + ## 7.10.0 (2022-07-13) ## 7.9.0 (2022-06-29) diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 9dbca1ea7b85a6..3c6956ca5dec71 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-library", - "version": "7.10.0", + "version": "7.11.0-prerelease", "description": "Block library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-serialization-default-parser/CHANGELOG.md b/packages/block-serialization-default-parser/CHANGELOG.md index 51ec028f1a6520..2aad9acfe54a35 100644 --- a/packages/block-serialization-default-parser/CHANGELOG.md +++ b/packages/block-serialization-default-parser/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.14.0 (2022-07-27) + ## 4.13.0 (2022-07-13) ## 4.12.0 (2022-06-29) diff --git a/packages/block-serialization-default-parser/package.json b/packages/block-serialization-default-parser/package.json index 97ea5643561607..d9b9b981fbc799 100644 --- a/packages/block-serialization-default-parser/package.json +++ b/packages/block-serialization-default-parser/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-serialization-default-parser", - "version": "4.13.0", + "version": "4.14.0-prerelease", "description": "Block serialization specification parser for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-serialization-spec-parser/CHANGELOG.md b/packages/block-serialization-spec-parser/CHANGELOG.md index 64c04374509cb8..83e348a2c6b836 100644 --- a/packages/block-serialization-spec-parser/CHANGELOG.md +++ b/packages/block-serialization-spec-parser/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.14.0 (2022-07-27) + ## 4.13.0 (2022-07-13) ## 4.12.0 (2022-06-29) diff --git a/packages/block-serialization-spec-parser/package.json b/packages/block-serialization-spec-parser/package.json index 41ba397b29a54a..aba7c7ee9312fe 100644 --- a/packages/block-serialization-spec-parser/package.json +++ b/packages/block-serialization-spec-parser/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-serialization-spec-parser", - "version": "4.13.0", + "version": "4.14.0-prerelease", "description": "Block serialization specification parser for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/blocks/CHANGELOG.md b/packages/blocks/CHANGELOG.md index 4597d808186d3c..6d1babbdf74679 100644 --- a/packages/blocks/CHANGELOG.md +++ b/packages/blocks/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 11.13.0 (2022-07-27) + ## 11.12.0 (2022-07-13) ### Deprecations diff --git a/packages/blocks/package.json b/packages/blocks/package.json index b3e9bcc9f0d922..8b34ea0020ac9d 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blocks", - "version": "11.12.0", + "version": "11.13.0-prerelease", "description": "Block API for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index d73bbe6b79a85b..aa98467b51155e 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 19.16.0 (2022-07-27) + ### Bug Fix - Context System: Stop explicitly setting `undefined` to the `children` prop. This fixes a bug where `Icon` could not be correctly rendered via the `as` prop of a context-connected component ([#42686](https://github.com/WordPress/gutenberg/pull/42686)). diff --git a/packages/components/package.json b/packages/components/package.json index e678c3a5514939..f9a6e9eb62d767 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/components", - "version": "19.15.0", + "version": "19.16.0-prerelease", "description": "UI components for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/compose/CHANGELOG.md b/packages/compose/CHANGELOG.md index 677e331b31e102..7fa80e4e8caab3 100644 --- a/packages/compose/CHANGELOG.md +++ b/packages/compose/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 5.12.0 (2022-07-27) + ## 5.11.0 (2022-07-13) ## 5.10.0 (2022-06-29) diff --git a/packages/compose/package.json b/packages/compose/package.json index d9320b45af8992..ba28651c0f0c7d 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/compose", - "version": "5.11.0", + "version": "5.12.0-prerelease", "description": "WordPress higher-order components (HOCs).", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/core-data/CHANGELOG.md b/packages/core-data/CHANGELOG.md index 89915c6bef650f..189a35bc1e1021 100644 --- a/packages/core-data/CHANGELOG.md +++ b/packages/core-data/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.12.0 (2022-07-27) + ## 4.11.0 (2022-07-13) ## 4.10.0 (2022-06-29) diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 487fcd8772424e..c2400043f70506 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/core-data", - "version": "4.11.0", + "version": "4.12.0-prerelease", "description": "Access to and manipulation of core WordPress entities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/customize-widgets/CHANGELOG.md b/packages/customize-widgets/CHANGELOG.md index 38a535867a8e96..99cf70bf48b199 100644 --- a/packages/customize-widgets/CHANGELOG.md +++ b/packages/customize-widgets/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.11.0 (2022-07-27) + ## 3.10.0 (2022-07-13) ## 3.9.0 (2022-06-29) diff --git a/packages/customize-widgets/package.json b/packages/customize-widgets/package.json index 59fff4ade8704a..d07d28992c330e 100644 --- a/packages/customize-widgets/package.json +++ b/packages/customize-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/customize-widgets", - "version": "3.10.0", + "version": "3.11.0-prerelease", "description": "Widgets blocks in Customizer Module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/data-controls/CHANGELOG.md b/packages/data-controls/CHANGELOG.md index 90730edfcb53f0..376c6b853f628f 100644 --- a/packages/data-controls/CHANGELOG.md +++ b/packages/data-controls/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.14.0 (2022-07-27) + ## 2.13.0 (2022-07-13) ## 2.12.0 (2022-06-29) diff --git a/packages/data-controls/package.json b/packages/data-controls/package.json index 335bf6d8713ca8..1b2ac9be539988 100644 --- a/packages/data-controls/package.json +++ b/packages/data-controls/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data-controls", - "version": "2.13.0", + "version": "2.14.0-prerelease", "description": "A set of common controls for the @wordpress/data api.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/data/CHANGELOG.md b/packages/data/CHANGELOG.md index 9308cfbae3b5fc..a222f4c5567e35 100644 --- a/packages/data/CHANGELOG.md +++ b/packages/data/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 6.14.0 (2022-07-27) + ## 6.13.0 (2022-07-13) ### Enhancements diff --git a/packages/data/package.json b/packages/data/package.json index 0b5bc7103247e3..edc6ad09caf678 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data", - "version": "6.13.0", + "version": "6.14.0-prerelease", "description": "Data module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/date/CHANGELOG.md b/packages/date/CHANGELOG.md index 6221939abcb1e2..a452ae2f5c6799 100644 --- a/packages/date/CHANGELOG.md +++ b/packages/date/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.14.0 (2022-07-27) + ## 4.13.0 (2022-07-13) ## 4.12.0 (2022-06-29) diff --git a/packages/date/package.json b/packages/date/package.json index df9459f3fc40b7..bb49f971ccd898 100644 --- a/packages/date/package.json +++ b/packages/date/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/date", - "version": "4.13.0", + "version": "4.14.0-prerelease", "description": "Date module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/deprecated/CHANGELOG.md b/packages/deprecated/CHANGELOG.md index 14a495e23c027e..69d33d6580bac9 100644 --- a/packages/deprecated/CHANGELOG.md +++ b/packages/deprecated/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/deprecated/package.json b/packages/deprecated/package.json index ea5b56bfc77bdf..93f9edba899583 100644 --- a/packages/deprecated/package.json +++ b/packages/deprecated/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/deprecated", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "Deprecation utility for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dom-ready/CHANGELOG.md b/packages/dom-ready/CHANGELOG.md index de82e16d44156e..20536490788658 100644 --- a/packages/dom-ready/CHANGELOG.md +++ b/packages/dom-ready/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/dom-ready/package.json b/packages/dom-ready/package.json index eae31bc6bfba7a..e3ad75724c7981 100644 --- a/packages/dom-ready/package.json +++ b/packages/dom-ready/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom-ready", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "Execute callback after the DOM is loaded.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dom/CHANGELOG.md b/packages/dom/CHANGELOG.md index fc6faae26aa5be..bce0e3f0085496 100644 --- a/packages/dom/CHANGELOG.md +++ b/packages/dom/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + - `getRectangleFromRange` may now return `null`. ## 3.13.0 (2022-07-13) diff --git a/packages/dom/package.json b/packages/dom/package.json index 0f7ef5a5e8450f..ee3a46e707f1e7 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "DOM utilities module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-post/CHANGELOG.md b/packages/edit-post/CHANGELOG.md index c12bcf0e1e54ca..0263e7e61a8c5f 100644 --- a/packages/edit-post/CHANGELOG.md +++ b/packages/edit-post/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 6.11.0 (2022-07-27) + ## 6.10.0 (2022-07-13) ## 6.9.0 (2022-06-29) diff --git a/packages/edit-post/package.json b/packages/edit-post/package.json index fde0fc57311b80..5a95f63df8c171 100644 --- a/packages/edit-post/package.json +++ b/packages/edit-post/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-post", - "version": "6.10.0", + "version": "6.11.0-prerelease", "description": "Edit Post module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-site/CHANGELOG.md b/packages/edit-site/CHANGELOG.md index fa923c95d70d53..014e40443f6e52 100644 --- a/packages/edit-site/CHANGELOG.md +++ b/packages/edit-site/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.11.0 (2022-07-27) + ## 4.10.0 (2022-07-13) ## 4.9.0 (2022-06-29) diff --git a/packages/edit-site/package.json b/packages/edit-site/package.json index bad32546fa6686..6392275b693e45 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-site", - "version": "4.10.0", + "version": "4.11.0-prerelease", "description": "Edit Site Page module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-widgets/CHANGELOG.md b/packages/edit-widgets/CHANGELOG.md index 398d6bc74eecd4..add1024a76a2e6 100644 --- a/packages/edit-widgets/CHANGELOG.md +++ b/packages/edit-widgets/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.11.0 (2022-07-27) + ## 4.10.0 (2022-07-13) ## 4.9.0 (2022-06-29) diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json index 673485cb82daa9..ab7e3d1a945163 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-widgets", - "version": "4.10.0", + "version": "4.11.0-prerelease", "description": "Widgets Page module for WordPress..", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/editor/CHANGELOG.md b/packages/editor/CHANGELOG.md index 9279542802a9ca..7e7966b81b9c8d 100644 --- a/packages/editor/CHANGELOG.md +++ b/packages/editor/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 12.13.0 (2022-07-27) + ## 12.12.0 (2022-07-13) ## 12.11.0 (2022-06-29) diff --git a/packages/editor/package.json b/packages/editor/package.json index 37ca182c2bfa7e..2c1215c2a42a0c 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/editor", - "version": "12.12.0", + "version": "12.13.0-prerelease", "description": "Enhanced block editor for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/element/CHANGELOG.md b/packages/element/CHANGELOG.md index 3e61f06ce2450b..7317a171f95bb7 100644 --- a/packages/element/CHANGELOG.md +++ b/packages/element/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.12.0 (2022-07-27) + ## 4.11.0 (2022-07-13) ## 4.10.0 (2022-06-29) diff --git a/packages/element/package.json b/packages/element/package.json index f1df161755a790..6a58e1d3c4f407 100644 --- a/packages/element/package.json +++ b/packages/element/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/element", - "version": "4.11.0", + "version": "4.12.0-prerelease", "description": "Element React module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/env/CHANGELOG.md b/packages/env/CHANGELOG.md index d8c70943c6a75b..0c128c813684f7 100644 --- a/packages/env/CHANGELOG.md +++ b/packages/env/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 5.0.0 (2022-07-27) + ### Breaking Changes - Removed the `WP_PHPUNIT__TESTS_CONFIG` environment variable from the `phpunit` container. **This removes automatic support for the `wp-phpunit/wp-phpunit` Composer package. To continue using the package, set the following two environment variables in your `phpunit.xml` file or similar: `WP_TESTS_DIR=""` and `WP_PHPUNIT__TESTS_CONFIG="/wordpress-phpunit/wp-tests-config.php"`.** - Removed the generated `/var/www/html/phpunit-wp-config.php` file from the environment. diff --git a/packages/env/package.json b/packages/env/package.json index b28be85e2a283f..0809d8e4bfcf7d 100644 --- a/packages/env/package.json +++ b/packages/env/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/env", - "version": "4.9.0", + "version": "5.0.0-prerelease", "description": "A zero-config, self contained local WordPress environment for development and testing.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/escape-html/CHANGELOG.md b/packages/escape-html/CHANGELOG.md index bcc1a660fd9459..b2debfa72630df 100644 --- a/packages/escape-html/CHANGELOG.md +++ b/packages/escape-html/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.14.0 (2022-07-27) + ## 2.13.0 (2022-07-13) ## 2.12.0 (2022-06-29) diff --git a/packages/escape-html/package.json b/packages/escape-html/package.json index 8ba69b6d7d8e9b..522ef82cd4928c 100644 --- a/packages/escape-html/package.json +++ b/packages/escape-html/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/escape-html", - "version": "2.13.0", + "version": "2.14.0-prerelease", "description": "Escape HTML utils.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index e5b7b1c39c9b7d..6df5397d88fa8a 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 12.8.0 (2022-07-27) + ### Code Quality - Remove deprecated rules `no-negated-in-lhs` replaced with `no-unsafe-negation`, and `jsx-a11y/label-has-for` replaced with `jsx-a11/label-has-associated-control` ([#42654](https://github.com/WordPress/gutenberg/pull/42654)). diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 9c09e71c7688a1..04d2cbb0ac8e2d 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/eslint-plugin", - "version": "12.7.0", + "version": "12.8.0-prerelease", "description": "ESLint plugin for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/format-library/CHANGELOG.md b/packages/format-library/CHANGELOG.md index 6371899a72aa35..54224f4dd2a430 100644 --- a/packages/format-library/CHANGELOG.md +++ b/packages/format-library/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/format-library/package.json b/packages/format-library/package.json index e0eb24f3992ca2..eeef8e67e2720d 100644 --- a/packages/format-library/package.json +++ b/packages/format-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/format-library", - "version": "3.11.0", + "version": "3.12.0-prerelease", "description": "Format library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index 2d2bac8a13d4c3..e108649a133286 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/hooks/package.json b/packages/hooks/package.json index acd824ca1e9254..d32969ca99a848 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/hooks", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "WordPress hooks library.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/html-entities/CHANGELOG.md b/packages/html-entities/CHANGELOG.md index dea326be1b5992..ce6c6f7cb41bf4 100644 --- a/packages/html-entities/CHANGELOG.md +++ b/packages/html-entities/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/html-entities/package.json b/packages/html-entities/package.json index ed8ca9f3026c7b..9c91b76d536b23 100644 --- a/packages/html-entities/package.json +++ b/packages/html-entities/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/html-entities", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "HTML entity utilities for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/i18n/CHANGELOG.md b/packages/i18n/CHANGELOG.md index f8f9256a5fb472..f8b019866eb3c9 100644 --- a/packages/i18n/CHANGELOG.md +++ b/packages/i18n/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.14.0 (2022-07-27) + ## 4.13.0 (2022-07-13) ## 4.12.0 (2022-06-29) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 18befc1d4487bf..940d57cc0ac0cd 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/i18n", - "version": "4.13.0", + "version": "4.14.0-prerelease", "description": "WordPress internationalization (i18n) library.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/icons/CHANGELOG.md b/packages/icons/CHANGELOG.md index 9e73aa15ab4c5a..5eb68bf9da43a0 100644 --- a/packages/icons/CHANGELOG.md +++ b/packages/icons/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 9.5.0 (2022-07-27) + ## 9.4.0 (2022-07-13) ## 9.3.0 (2022-06-29) diff --git a/packages/icons/package.json b/packages/icons/package.json index 513d8268e053f8..0278def1253cd9 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/icons", - "version": "9.4.0", + "version": "9.5.0-prerelease", "description": "WordPress Icons package, based on dashicon.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md index 966116d9e6f29e..e242e33d872d45 100644 --- a/packages/interface/CHANGELOG.md +++ b/packages/interface/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.13.0 (2022-07-27) + ## 4.12.0 (2022-07-13) ## 4.11.0 (2022-06-29) diff --git a/packages/interface/package.json b/packages/interface/package.json index 9a1fd5084f8f39..2e8f18c9f68c0d 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/interface", - "version": "4.12.0", + "version": "4.13.0-prerelease", "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/is-shallow-equal/CHANGELOG.md b/packages/is-shallow-equal/CHANGELOG.md index 2d5660e7abce9c..fa8d2199705665 100644 --- a/packages/is-shallow-equal/CHANGELOG.md +++ b/packages/is-shallow-equal/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.14.0 (2022-07-27) + ## 4.13.0 (2022-07-13) ## 4.12.0 (2022-06-29) diff --git a/packages/is-shallow-equal/package.json b/packages/is-shallow-equal/package.json index 9c084ce8cfd9ef..f3df3d9b7704ef 100644 --- a/packages/is-shallow-equal/package.json +++ b/packages/is-shallow-equal/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/is-shallow-equal", - "version": "4.13.0", + "version": "4.14.0-prerelease", "description": "Test for shallow equality between two objects or arrays.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/keyboard-shortcuts/CHANGELOG.md b/packages/keyboard-shortcuts/CHANGELOG.md index b3e234daf3e6c7..d43356e75a8cb1 100644 --- a/packages/keyboard-shortcuts/CHANGELOG.md +++ b/packages/keyboard-shortcuts/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/keyboard-shortcuts/package.json b/packages/keyboard-shortcuts/package.json index 62100c67a5b75f..a25bcc7bbadeff 100644 --- a/packages/keyboard-shortcuts/package.json +++ b/packages/keyboard-shortcuts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keyboard-shortcuts", - "version": "3.11.0", + "version": "3.12.0-prerelease", "description": "Handling keyboard shortcuts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/keycodes/CHANGELOG.md b/packages/keycodes/CHANGELOG.md index 5dfb6813b8a895..9bf1d288d83b82 100644 --- a/packages/keycodes/CHANGELOG.md +++ b/packages/keycodes/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/keycodes/package.json b/packages/keycodes/package.json index b8a6d87c690e0f..0732f9f68cf4ae 100644 --- a/packages/keycodes/package.json +++ b/packages/keycodes/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keycodes", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "Keycodes utilities for WordPress. Used to check for keyboard events across browsers/operating systems.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/list-reusable-blocks/CHANGELOG.md b/packages/list-reusable-blocks/CHANGELOG.md index 2d5ffaf004994d..f1e15139ae2a02 100644 --- a/packages/list-reusable-blocks/CHANGELOG.md +++ b/packages/list-reusable-blocks/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/list-reusable-blocks/package.json b/packages/list-reusable-blocks/package.json index e6b5b78d536e3e..c6d81f17b93120 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": "3.11.0", + "version": "3.12.0-prerelease", "description": "Adding Export/Import support to the reusable blocks listing.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/media-utils/CHANGELOG.md b/packages/media-utils/CHANGELOG.md index c684fcdf85fd6c..9f43454fa8a995 100644 --- a/packages/media-utils/CHANGELOG.md +++ b/packages/media-utils/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.5.0 (2022-07-27) + ## 4.4.0 (2022-07-13) ## 4.3.0 (2022-06-29) diff --git a/packages/media-utils/package.json b/packages/media-utils/package.json index 62c97977286be4..487408c2690c0f 100644 --- a/packages/media-utils/package.json +++ b/packages/media-utils/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/media-utils", - "version": "4.4.0", + "version": "4.5.0-prerelease", "description": "WordPress Media Upload Utils.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/notices/CHANGELOG.md b/packages/notices/CHANGELOG.md index 8b4330015f7e19..4da9eae7051610 100644 --- a/packages/notices/CHANGELOG.md +++ b/packages/notices/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/notices/package.json b/packages/notices/package.json index 1334dcba3b204c..dbf26000730f7b 100644 --- a/packages/notices/package.json +++ b/packages/notices/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/notices", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "State management for notices.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/nux/CHANGELOG.md b/packages/nux/CHANGELOG.md index 595c3289bcf10d..cf80a8e24a6743 100644 --- a/packages/nux/CHANGELOG.md +++ b/packages/nux/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 5.12.0 (2022-07-27) + ## 5.11.0 (2022-07-13) ## 5.10.0 (2022-06-29) diff --git a/packages/nux/package.json b/packages/nux/package.json index c2c907deabcc68..657f985acd8b6b 100644 --- a/packages/nux/package.json +++ b/packages/nux/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/nux", - "version": "5.11.0", + "version": "5.12.0-prerelease", "description": "NUX (New User eXperience) module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/plugins/CHANGELOG.md b/packages/plugins/CHANGELOG.md index a0d37b5fbe9915..09f326a4ad75ce 100644 --- a/packages/plugins/CHANGELOG.md +++ b/packages/plugins/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.12.0 (2022-07-27) + ## 4.11.0 (2022-07-13) ## 4.10.0 (2022-06-29) diff --git a/packages/plugins/package.json b/packages/plugins/package.json index f20420127bf5a6..0379cc5c17d097 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/plugins", - "version": "4.11.0", + "version": "4.12.0-prerelease", "description": "Plugins module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/preferences-persistence/CHANGELOG.md b/packages/preferences-persistence/CHANGELOG.md index 2a6410862ee120..efdeb075c7d5d9 100644 --- a/packages/preferences-persistence/CHANGELOG.md +++ b/packages/preferences-persistence/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 1.6.0 (2022-07-27) + ## 1.5.0 (2022-07-13) ## 1.4.0 (2022-06-29) diff --git a/packages/preferences-persistence/package.json b/packages/preferences-persistence/package.json index 6fbeb874d6a20c..b6609782dbdbe2 100644 --- a/packages/preferences-persistence/package.json +++ b/packages/preferences-persistence/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/preferences-persistence", - "version": "1.5.0", + "version": "1.6.0-prerelease", "description": "Persistence utilities for `wordpress/preferences`.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/preferences/CHANGELOG.md b/packages/preferences/CHANGELOG.md index b4c2310ba778bd..b885ebe9fb2d90 100644 --- a/packages/preferences/CHANGELOG.md +++ b/packages/preferences/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.6.0 (2022-07-27) + ## 2.5.0 (2022-07-13) ## 2.4.0 (2022-06-29) diff --git a/packages/preferences/package.json b/packages/preferences/package.json index f84b61ed8852ec..8d8a5792692fc4 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/preferences", - "version": "2.5.0", + "version": "2.6.0-prerelease", "description": "Utilities for managing WordPress preferences.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/primitives/CHANGELOG.md b/packages/primitives/CHANGELOG.md index 7ffdcb496f60d7..a7bea426956e66 100644 --- a/packages/primitives/CHANGELOG.md +++ b/packages/primitives/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/primitives/package.json b/packages/primitives/package.json index 07b772cca8d4f6..ffefd77b0c5d6d 100644 --- a/packages/primitives/package.json +++ b/packages/primitives/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/primitives", - "version": "3.11.0", + "version": "3.12.0-prerelease", "description": "WordPress cross-platform primitives.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/priority-queue/CHANGELOG.md b/packages/priority-queue/CHANGELOG.md index 1a3dda41c5ec26..7a215ceed816d4 100644 --- a/packages/priority-queue/CHANGELOG.md +++ b/packages/priority-queue/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.14.0 (2022-07-27) + ## 2.13.0 (2022-07-13) ## 2.12.0 (2022-06-29) diff --git a/packages/priority-queue/package.json b/packages/priority-queue/package.json index 066551f17bbde8..ab99cbb22ba105 100644 --- a/packages/priority-queue/package.json +++ b/packages/priority-queue/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/priority-queue", - "version": "2.13.0", + "version": "2.14.0-prerelease", "description": "Generic browser priority queue.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/react-i18n/CHANGELOG.md b/packages/react-i18n/CHANGELOG.md index e4c8233a7b807f..62f54834a96941 100644 --- a/packages/react-i18n/CHANGELOG.md +++ b/packages/react-i18n/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json index 09ad6cbb6dfe28..5aa22190bbffe8 100644 --- a/packages/react-i18n/package.json +++ b/packages/react-i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-i18n", - "version": "3.11.0", + "version": "3.12.0-prerelease", "description": "React bindings for @wordpress/i18n.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/redux-routine/CHANGELOG.md b/packages/redux-routine/CHANGELOG.md index 79db065634b0e3..b5ffd79aeec9e9 100644 --- a/packages/redux-routine/CHANGELOG.md +++ b/packages/redux-routine/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.14.0 (2022-07-27) + ## 4.13.0 (2022-07-13) ## 4.12.0 (2022-06-29) diff --git a/packages/redux-routine/package.json b/packages/redux-routine/package.json index 24091f7471c15e..e0d4758f45e3dd 100644 --- a/packages/redux-routine/package.json +++ b/packages/redux-routine/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/redux-routine", - "version": "4.13.0", + "version": "4.14.0-prerelease", "description": "Redux middleware for generator coroutines.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/reusable-blocks/CHANGELOG.md b/packages/reusable-blocks/CHANGELOG.md index 940a4874f02495..304ca6676957e9 100644 --- a/packages/reusable-blocks/CHANGELOG.md +++ b/packages/reusable-blocks/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/reusable-blocks/package.json b/packages/reusable-blocks/package.json index f3233d1987883e..d900b240c43278 100644 --- a/packages/reusable-blocks/package.json +++ b/packages/reusable-blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/reusable-blocks", - "version": "3.11.0", + "version": "3.12.0-prerelease", "description": "Reusable blocks utilities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/rich-text/CHANGELOG.md b/packages/rich-text/CHANGELOG.md index a46b4c86cfa4a7..022d1b9f1612cb 100644 --- a/packages/rich-text/CHANGELOG.md +++ b/packages/rich-text/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 5.12.0 (2022-07-27) + ## 5.11.0 (2022-07-13) ## 5.10.0 (2022-06-29) diff --git a/packages/rich-text/package.json b/packages/rich-text/package.json index b2e437a1c7dad2..e8d34922ea4a95 100644 --- a/packages/rich-text/package.json +++ b/packages/rich-text/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/rich-text", - "version": "5.11.0", + "version": "5.12.0-prerelease", "description": "Rich text value and manipulation API.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index a221594293df14..d4a370a1b1b4af 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 23.6.0 (2022-07-27) + ### Bug Fix - Fix the incorrect exit error code when status missing in `webpack` call for `build` and `start` commands ([#42396](https://github.com/WordPress/gutenberg/pull/42396)). diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 6f334e05cfed37..c4f37e73f4f44e 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/scripts", - "version": "23.5.0", + "version": "23.6.0-prerelease", "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/CHANGELOG.md b/packages/server-side-render/CHANGELOG.md index 7fee4da9a70041..96f0a77b7dd175 100644 --- a/packages/server-side-render/CHANGELOG.md +++ b/packages/server-side-render/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.12.0 (2022-07-27) + ## 3.11.0 (2022-07-13) ## 3.10.0 (2022-06-29) diff --git a/packages/server-side-render/package.json b/packages/server-side-render/package.json index 22150e6b86f44f..8d4c81abdc18c3 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": "3.11.0", + "version": "3.12.0-prerelease", "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/shortcode/CHANGELOG.md b/packages/shortcode/CHANGELOG.md index cf5df37154094f..f479d6d0ae3e39 100644 --- a/packages/shortcode/CHANGELOG.md +++ b/packages/shortcode/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/shortcode/package.json b/packages/shortcode/package.json index ce94aa3de02313..9f99ea68295da3 100644 --- a/packages/shortcode/package.json +++ b/packages/shortcode/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/shortcode", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "Shortcode module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/style-engine/CHANGELOG.md b/packages/style-engine/CHANGELOG.md index 99582f1862f535..6bec8d77012821 100644 --- a/packages/style-engine/CHANGELOG.md +++ b/packages/style-engine/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.13.0 (2022-07-27) + ## 0.12.0 (2022-07-13) ## 0.11.0 (2022-06-29) diff --git a/packages/style-engine/package.json b/packages/style-engine/package.json index 92af40f7256279..1da79e74e8cdfd 100644 --- a/packages/style-engine/package.json +++ b/packages/style-engine/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/style-engine", - "version": "0.12.0", + "version": "0.13.0-prerelease", "description": "WordPress Style engine.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/token-list/CHANGELOG.md b/packages/token-list/CHANGELOG.md index 562dd7a5295a2a..9d4d85eb0f73d1 100644 --- a/packages/token-list/CHANGELOG.md +++ b/packages/token-list/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.14.0 (2022-07-27) + ## 2.13.0 (2022-07-13) ## 2.12.0 (2022-06-29) diff --git a/packages/token-list/package.json b/packages/token-list/package.json index 601c5924f1e156..ba112494ac20ea 100644 --- a/packages/token-list/package.json +++ b/packages/token-list/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/token-list", - "version": "2.13.0", + "version": "2.14.0-prerelease", "description": "Constructable, plain JavaScript DOMTokenList implementation, supporting non-browser runtimes.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/url/CHANGELOG.md b/packages/url/CHANGELOG.md index 549c5657e3be0f..a2a1e35ac66eef 100644 --- a/packages/url/CHANGELOG.md +++ b/packages/url/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.15.0 (2022-07-27) + ## 3.14.0 (2022-07-13) ## 3.13.0 (2022-06-29) diff --git a/packages/url/package.json b/packages/url/package.json index b45e25c15d6b2b..12a56270282739 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/url", - "version": "3.14.0", + "version": "3.15.0-prerelease", "description": "WordPress URL utilities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/viewport/CHANGELOG.md b/packages/viewport/CHANGELOG.md index 773b658e2f0710..2078b17767a2eb 100644 --- a/packages/viewport/CHANGELOG.md +++ b/packages/viewport/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.12.0 (2022-07-27) + ## 4.11.0 (2022-07-13) ## 4.10.0 (2022-06-29) diff --git a/packages/viewport/package.json b/packages/viewport/package.json index 49bbc26f170091..0d7553237f8f80 100644 --- a/packages/viewport/package.json +++ b/packages/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/viewport", - "version": "4.11.0", + "version": "4.12.0-prerelease", "description": "Viewport module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/warning/CHANGELOG.md b/packages/warning/CHANGELOG.md index cfd185ef1ef791..d1a3beb36103f0 100644 --- a/packages/warning/CHANGELOG.md +++ b/packages/warning/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.14.0 (2022-07-27) + ## 2.13.0 (2022-07-13) ## 2.12.0 (2022-06-29) diff --git a/packages/warning/package.json b/packages/warning/package.json index 031d555871dbbf..54583f6dd511c7 100644 --- a/packages/warning/package.json +++ b/packages/warning/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/warning", - "version": "2.13.0", + "version": "2.14.0-prerelease", "description": "Warning utility for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/widgets/CHANGELOG.md b/packages/widgets/CHANGELOG.md index f835735996f838..5c776132f005f1 100644 --- a/packages/widgets/CHANGELOG.md +++ b/packages/widgets/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.12.0 (2022-07-27) + ## 2.11.0 (2022-07-13) ## 2.10.0 (2022-06-29) diff --git a/packages/widgets/package.json b/packages/widgets/package.json index 581cb3dca2e382..c1f9cda8c115a9 100644 --- a/packages/widgets/package.json +++ b/packages/widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/widgets", - "version": "2.11.0", + "version": "2.12.0-prerelease", "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", diff --git a/packages/wordcount/CHANGELOG.md b/packages/wordcount/CHANGELOG.md index 91c2cd440b681d..45bea4a365b122 100644 --- a/packages/wordcount/CHANGELOG.md +++ b/packages/wordcount/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.14.0 (2022-07-27) + ## 3.13.0 (2022-07-13) ## 3.12.0 (2022-06-29) diff --git a/packages/wordcount/package.json b/packages/wordcount/package.json index d1d98fcef6686a..7feafef879670c 100644 --- a/packages/wordcount/package.json +++ b/packages/wordcount/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/wordcount", - "version": "3.13.0", + "version": "3.14.0-prerelease", "description": "WordPress word count utility.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", From f40ac5c6430ef4f0186523459630a64bd22a69d7 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 27 Jul 2022 13:44:21 +0000 Subject: [PATCH 011/104] chore(release): publish - @wordpress/a11y@3.14.0 - @wordpress/annotations@2.14.0 - @wordpress/api-fetch@6.11.0 - @wordpress/autop@3.14.0 - @wordpress/babel-preset-default@6.16.0 - @wordpress/base-styles@4.7.0 - @wordpress/blob@3.14.0 - @wordpress/block-directory@3.12.0 - @wordpress/block-editor@9.6.0 - @wordpress/block-library@7.11.0 - @wordpress/block-serialization-default-parser@4.14.0 - @wordpress/block-serialization-spec-parser@4.14.0 - @wordpress/blocks@11.13.0 - @wordpress/components@19.16.0 - @wordpress/compose@5.12.0 - @wordpress/core-data@4.12.0 - @wordpress/create-block@3.7.0 - @wordpress/customize-widgets@3.11.0 - @wordpress/data-controls@2.14.0 - @wordpress/data@6.14.0 - @wordpress/date@4.14.0 - @wordpress/deprecated@3.14.0 - @wordpress/dom-ready@3.14.0 - @wordpress/dom@3.14.0 - @wordpress/e2e-test-utils@7.10.0 - @wordpress/e2e-tests@4.8.0 - @wordpress/edit-post@6.11.0 - @wordpress/edit-site@4.11.0 - @wordpress/edit-widgets@4.11.0 - @wordpress/editor@12.13.0 - @wordpress/element@4.12.0 - @wordpress/env@5.0.0 - @wordpress/escape-html@2.14.0 - @wordpress/eslint-plugin@12.8.0 - @wordpress/format-library@3.12.0 - @wordpress/hooks@3.14.0 - @wordpress/html-entities@3.14.0 - @wordpress/i18n@4.14.0 - @wordpress/icons@9.5.0 - @wordpress/interface@4.13.0 - @wordpress/is-shallow-equal@4.14.0 - @wordpress/jest-puppeteer-axe@4.1.0 - @wordpress/keyboard-shortcuts@3.12.0 - @wordpress/keycodes@3.14.0 - @wordpress/list-reusable-blocks@3.12.0 - @wordpress/media-utils@4.5.0 - @wordpress/notices@3.14.0 - @wordpress/nux@5.12.0 - @wordpress/plugins@4.12.0 - @wordpress/postcss-plugins-preset@3.10.0 - @wordpress/preferences-persistence@1.6.0 - @wordpress/preferences@2.6.0 - @wordpress/primitives@3.12.0 - @wordpress/priority-queue@2.14.0 - @wordpress/react-i18n@3.12.0 - @wordpress/redux-routine@4.14.0 - @wordpress/reusable-blocks@3.12.0 - @wordpress/rich-text@5.12.0 - @wordpress/scripts@23.6.0 - @wordpress/server-side-render@3.12.0 - @wordpress/shortcode@3.14.0 - @wordpress/style-engine@0.13.0 - @wordpress/token-list@2.14.0 - @wordpress/url@3.15.0 - @wordpress/viewport@4.12.0 - @wordpress/warning@2.14.0 - @wordpress/widgets@2.12.0 - @wordpress/wordcount@3.14.0 --- packages/a11y/package.json | 2 +- packages/annotations/package.json | 2 +- packages/api-fetch/package.json | 2 +- packages/autop/package.json | 2 +- packages/babel-preset-default/package.json | 2 +- packages/base-styles/package.json | 2 +- packages/blob/package.json | 2 +- packages/block-directory/package.json | 2 +- packages/block-editor/package.json | 2 +- packages/block-library/package.json | 2 +- packages/block-serialization-default-parser/package.json | 2 +- packages/block-serialization-spec-parser/package.json | 2 +- packages/blocks/package.json | 2 +- packages/components/package.json | 2 +- packages/compose/package.json | 2 +- packages/core-data/package.json | 2 +- packages/create-block/package.json | 2 +- packages/customize-widgets/package.json | 2 +- packages/data-controls/package.json | 2 +- packages/data/package.json | 2 +- packages/date/package.json | 2 +- packages/deprecated/package.json | 2 +- packages/dom-ready/package.json | 2 +- packages/dom/package.json | 2 +- packages/e2e-test-utils/package.json | 2 +- packages/e2e-tests/package.json | 2 +- packages/edit-post/package.json | 2 +- packages/edit-site/package.json | 2 +- packages/edit-widgets/package.json | 2 +- packages/editor/package.json | 2 +- packages/element/package.json | 2 +- packages/env/package.json | 2 +- packages/escape-html/package.json | 2 +- packages/eslint-plugin/package.json | 2 +- packages/format-library/package.json | 2 +- packages/hooks/package.json | 2 +- packages/html-entities/package.json | 2 +- packages/i18n/package.json | 2 +- packages/icons/package.json | 2 +- packages/interface/package.json | 2 +- packages/is-shallow-equal/package.json | 2 +- packages/jest-puppeteer-axe/package.json | 2 +- packages/keyboard-shortcuts/package.json | 2 +- packages/keycodes/package.json | 2 +- packages/list-reusable-blocks/package.json | 2 +- packages/media-utils/package.json | 2 +- packages/notices/package.json | 2 +- packages/nux/package.json | 2 +- packages/plugins/package.json | 2 +- packages/postcss-plugins-preset/package.json | 2 +- packages/preferences-persistence/package.json | 2 +- packages/preferences/package.json | 2 +- packages/primitives/package.json | 2 +- packages/priority-queue/package.json | 2 +- packages/react-i18n/package.json | 2 +- packages/redux-routine/package.json | 2 +- packages/reusable-blocks/package.json | 2 +- packages/rich-text/package.json | 2 +- packages/scripts/package.json | 2 +- packages/server-side-render/package.json | 2 +- packages/shortcode/package.json | 2 +- packages/style-engine/package.json | 2 +- packages/token-list/package.json | 2 +- packages/url/package.json | 2 +- packages/viewport/package.json | 2 +- packages/warning/package.json | 2 +- packages/widgets/package.json | 2 +- packages/wordcount/package.json | 2 +- 68 files changed, 68 insertions(+), 68 deletions(-) diff --git a/packages/a11y/package.json b/packages/a11y/package.json index bd3d2ddcac925a..11e5b7e6cb4f0c 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/a11y", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "Accessibility (a11y) utilities for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/annotations/package.json b/packages/annotations/package.json index aaf0b720f25590..4cbd65894de97a 100644 --- a/packages/annotations/package.json +++ b/packages/annotations/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/annotations", - "version": "2.14.0-prerelease", + "version": "2.14.0", "description": "Annotate content in the Gutenberg editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json index 899478ca9485c6..45e09bb42dc86f 100644 --- a/packages/api-fetch/package.json +++ b/packages/api-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/api-fetch", - "version": "6.11.0-prerelease", + "version": "6.11.0", "description": "Utility to make WordPress REST API requests.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/autop/package.json b/packages/autop/package.json index 16dfeb8db861a4..365abd874d943a 100644 --- a/packages/autop/package.json +++ b/packages/autop/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/autop", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "WordPress's automatic paragraph functions `autop` and `removep`.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json index fa7a8e9de9245a..1ff05ef16d3580 100644 --- a/packages/babel-preset-default/package.json +++ b/packages/babel-preset-default/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/babel-preset-default", - "version": "6.15.0", + "version": "6.16.0", "description": "Default Babel preset for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/base-styles/package.json b/packages/base-styles/package.json index fb69fd104f7a01..add5536dc70d76 100644 --- a/packages/base-styles/package.json +++ b/packages/base-styles/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/base-styles", - "version": "4.6.0", + "version": "4.7.0", "description": "Base SCSS utilities and variables for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/blob/package.json b/packages/blob/package.json index 4fdb8d685b4910..f3b042b4bb7c68 100644 --- a/packages/blob/package.json +++ b/packages/blob/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blob", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "Blob utilities for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json index 0332aa422bdb74..5e80fc0a7de196 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-directory", - "version": "3.12.0-prerelease", + "version": "3.12.0", "description": "Extend editor with block directory features to search, download and install blocks.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json index a3d345289ad273..c817b8dd2b6f14 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-editor", - "version": "9.6.0-prerelease", + "version": "9.6.0", "description": "Generic block editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 3c6956ca5dec71..556a5bf19c5bc2 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-library", - "version": "7.11.0-prerelease", + "version": "7.11.0", "description": "Block library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-serialization-default-parser/package.json b/packages/block-serialization-default-parser/package.json index d9b9b981fbc799..59a821e55f136b 100644 --- a/packages/block-serialization-default-parser/package.json +++ b/packages/block-serialization-default-parser/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-serialization-default-parser", - "version": "4.14.0-prerelease", + "version": "4.14.0", "description": "Block serialization specification parser for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/block-serialization-spec-parser/package.json b/packages/block-serialization-spec-parser/package.json index aba7c7ee9312fe..49fbad1f9a2307 100644 --- a/packages/block-serialization-spec-parser/package.json +++ b/packages/block-serialization-spec-parser/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-serialization-spec-parser", - "version": "4.14.0-prerelease", + "version": "4.14.0", "description": "Block serialization specification parser for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 8b34ea0020ac9d..7cbb0e9673bfaf 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blocks", - "version": "11.13.0-prerelease", + "version": "11.13.0", "description": "Block API for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/components/package.json b/packages/components/package.json index f9a6e9eb62d767..ce3dc7133c8ed1 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/components", - "version": "19.16.0-prerelease", + "version": "19.16.0", "description": "UI components for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/compose/package.json b/packages/compose/package.json index ba28651c0f0c7d..8154271edb5a27 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/compose", - "version": "5.12.0-prerelease", + "version": "5.12.0", "description": "WordPress higher-order components (HOCs).", "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 c2400043f70506..259004d141589f 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/core-data", - "version": "4.12.0-prerelease", + "version": "4.12.0", "description": "Access to and manipulation of core WordPress entities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/create-block/package.json b/packages/create-block/package.json index 2cc9722f3b85e1..30b9735f0a1d22 100644 --- a/packages/create-block/package.json +++ b/packages/create-block/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/create-block", - "version": "3.6.0", + "version": "3.7.0", "description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/customize-widgets/package.json b/packages/customize-widgets/package.json index d07d28992c330e..2dcb09bf68ef1b 100644 --- a/packages/customize-widgets/package.json +++ b/packages/customize-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/customize-widgets", - "version": "3.11.0-prerelease", + "version": "3.11.0", "description": "Widgets blocks in Customizer Module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/data-controls/package.json b/packages/data-controls/package.json index 1b2ac9be539988..640b4eeabc0040 100644 --- a/packages/data-controls/package.json +++ b/packages/data-controls/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data-controls", - "version": "2.14.0-prerelease", + "version": "2.14.0", "description": "A set of common controls for the @wordpress/data api.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/data/package.json b/packages/data/package.json index edc6ad09caf678..7f50bbd8383b00 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data", - "version": "6.14.0-prerelease", + "version": "6.14.0", "description": "Data module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/date/package.json b/packages/date/package.json index bb49f971ccd898..a1c62416eb954c 100644 --- a/packages/date/package.json +++ b/packages/date/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/date", - "version": "4.14.0-prerelease", + "version": "4.14.0", "description": "Date module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/deprecated/package.json b/packages/deprecated/package.json index 93f9edba899583..e0f6cb7a7d7862 100644 --- a/packages/deprecated/package.json +++ b/packages/deprecated/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/deprecated", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "Deprecation utility for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dom-ready/package.json b/packages/dom-ready/package.json index e3ad75724c7981..0b2d995700dfc0 100644 --- a/packages/dom-ready/package.json +++ b/packages/dom-ready/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom-ready", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "Execute callback after the DOM is loaded.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dom/package.json b/packages/dom/package.json index ee3a46e707f1e7..db0a52e5a3eeff 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "DOM utilities module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/e2e-test-utils/package.json b/packages/e2e-test-utils/package.json index fc4c75a86a2529..c7a093d91b57c3 100644 --- a/packages/e2e-test-utils/package.json +++ b/packages/e2e-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/e2e-test-utils", - "version": "7.9.0", + "version": "7.10.0", "description": "End-To-End (E2E) test utils 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 4828d9ff17ef8f..fb4e234cfd81ce 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/e2e-tests", - "version": "4.7.0", + "version": "4.8.0", "description": "End-To-End (E2E) tests for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/edit-post/package.json b/packages/edit-post/package.json index 5a95f63df8c171..a9cbf5448d5023 100644 --- a/packages/edit-post/package.json +++ b/packages/edit-post/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-post", - "version": "6.11.0-prerelease", + "version": "6.11.0", "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 6392275b693e45..75328078ce894c 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-site", - "version": "4.11.0-prerelease", + "version": "4.11.0", "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 ab7e3d1a945163..d8d6d4880d5c59 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-widgets", - "version": "4.11.0-prerelease", + "version": "4.11.0", "description": "Widgets Page module for WordPress..", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/editor/package.json b/packages/editor/package.json index 2c1215c2a42a0c..4e6472e728fca0 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/editor", - "version": "12.13.0-prerelease", + "version": "12.13.0", "description": "Enhanced block editor for WordPress posts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/element/package.json b/packages/element/package.json index 6a58e1d3c4f407..769dfcfa44c7ac 100644 --- a/packages/element/package.json +++ b/packages/element/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/element", - "version": "4.12.0-prerelease", + "version": "4.12.0", "description": "Element React module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/env/package.json b/packages/env/package.json index 0809d8e4bfcf7d..08a6524c24647c 100644 --- a/packages/env/package.json +++ b/packages/env/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/env", - "version": "5.0.0-prerelease", + "version": "5.0.0", "description": "A zero-config, self contained local WordPress environment for development and testing.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/escape-html/package.json b/packages/escape-html/package.json index 522ef82cd4928c..d2bd0509861d3b 100644 --- a/packages/escape-html/package.json +++ b/packages/escape-html/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/escape-html", - "version": "2.14.0-prerelease", + "version": "2.14.0", "description": "Escape HTML utils.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 04d2cbb0ac8e2d..9d8b3159f10736 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/eslint-plugin", - "version": "12.8.0-prerelease", + "version": "12.8.0", "description": "ESLint plugin for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/format-library/package.json b/packages/format-library/package.json index eeef8e67e2720d..3e7324a7826cf5 100644 --- a/packages/format-library/package.json +++ b/packages/format-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/format-library", - "version": "3.12.0-prerelease", + "version": "3.12.0", "description": "Format library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/hooks/package.json b/packages/hooks/package.json index d32969ca99a848..52a7ca0c7527cf 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/hooks", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "WordPress hooks library.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/html-entities/package.json b/packages/html-entities/package.json index 9c91b76d536b23..855d61991bbe06 100644 --- a/packages/html-entities/package.json +++ b/packages/html-entities/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/html-entities", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "HTML entity utilities for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 940d57cc0ac0cd..d56422ad3b31af 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/i18n", - "version": "4.14.0-prerelease", + "version": "4.14.0", "description": "WordPress internationalization (i18n) library.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/icons/package.json b/packages/icons/package.json index 0278def1253cd9..627dd57e174b61 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/icons", - "version": "9.5.0-prerelease", + "version": "9.5.0", "description": "WordPress Icons package, based on dashicon.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/interface/package.json b/packages/interface/package.json index 2e8f18c9f68c0d..d0081fbc15604b 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/interface", - "version": "4.13.0-prerelease", + "version": "4.13.0", "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/is-shallow-equal/package.json b/packages/is-shallow-equal/package.json index f3df3d9b7704ef..f9e624bbcbcead 100644 --- a/packages/is-shallow-equal/package.json +++ b/packages/is-shallow-equal/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/is-shallow-equal", - "version": "4.14.0-prerelease", + "version": "4.14.0", "description": "Test for shallow equality between two objects or arrays.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/jest-puppeteer-axe/package.json b/packages/jest-puppeteer-axe/package.json index 76aea0e21e6b98..a62dc961268045 100644 --- a/packages/jest-puppeteer-axe/package.json +++ b/packages/jest-puppeteer-axe/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/jest-puppeteer-axe", - "version": "4.0.2", + "version": "4.1.0", "description": "Axe API integration with Jest and Puppeteer.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/keyboard-shortcuts/package.json b/packages/keyboard-shortcuts/package.json index a25bcc7bbadeff..adbb9a82174850 100644 --- a/packages/keyboard-shortcuts/package.json +++ b/packages/keyboard-shortcuts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keyboard-shortcuts", - "version": "3.12.0-prerelease", + "version": "3.12.0", "description": "Handling keyboard shortcuts.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/keycodes/package.json b/packages/keycodes/package.json index 0732f9f68cf4ae..164585ffcfc458 100644 --- a/packages/keycodes/package.json +++ b/packages/keycodes/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keycodes", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "Keycodes utilities for WordPress. Used to check for keyboard events across browsers/operating systems.", "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 c6d81f17b93120..e8bee19459285c 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": "3.12.0-prerelease", + "version": "3.12.0", "description": "Adding Export/Import support to the reusable blocks listing.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/media-utils/package.json b/packages/media-utils/package.json index 487408c2690c0f..0dca427a64b4b7 100644 --- a/packages/media-utils/package.json +++ b/packages/media-utils/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/media-utils", - "version": "4.5.0-prerelease", + "version": "4.5.0", "description": "WordPress Media Upload Utils.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/notices/package.json b/packages/notices/package.json index dbf26000730f7b..0605c71a102ded 100644 --- a/packages/notices/package.json +++ b/packages/notices/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/notices", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "State management for notices.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/nux/package.json b/packages/nux/package.json index 657f985acd8b6b..c57e5a89e5a04c 100644 --- a/packages/nux/package.json +++ b/packages/nux/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/nux", - "version": "5.12.0-prerelease", + "version": "5.12.0", "description": "NUX (New User eXperience) module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/plugins/package.json b/packages/plugins/package.json index 0379cc5c17d097..113a80826661b5 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/plugins", - "version": "4.12.0-prerelease", + "version": "4.12.0", "description": "Plugins 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 23518a26fd1169..257464d9328eef 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.9.0", + "version": "3.10.0", "description": "PostCSS sharable plugins preset for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/preferences-persistence/package.json b/packages/preferences-persistence/package.json index b6609782dbdbe2..3f43c8c35cd0bb 100644 --- a/packages/preferences-persistence/package.json +++ b/packages/preferences-persistence/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/preferences-persistence", - "version": "1.6.0-prerelease", + "version": "1.6.0", "description": "Persistence utilities for `wordpress/preferences`.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/preferences/package.json b/packages/preferences/package.json index 8d8a5792692fc4..3d9e86a02a2450 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/preferences", - "version": "2.6.0-prerelease", + "version": "2.6.0", "description": "Utilities for managing WordPress preferences.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/primitives/package.json b/packages/primitives/package.json index ffefd77b0c5d6d..aa9f4ab30f4197 100644 --- a/packages/primitives/package.json +++ b/packages/primitives/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/primitives", - "version": "3.12.0-prerelease", + "version": "3.12.0", "description": "WordPress cross-platform primitives.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/priority-queue/package.json b/packages/priority-queue/package.json index ab99cbb22ba105..6e632826f78e6d 100644 --- a/packages/priority-queue/package.json +++ b/packages/priority-queue/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/priority-queue", - "version": "2.14.0-prerelease", + "version": "2.14.0", "description": "Generic browser priority queue.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json index 5aa22190bbffe8..c195baa3602a4d 100644 --- a/packages/react-i18n/package.json +++ b/packages/react-i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-i18n", - "version": "3.12.0-prerelease", + "version": "3.12.0", "description": "React bindings for @wordpress/i18n.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/redux-routine/package.json b/packages/redux-routine/package.json index e0d4758f45e3dd..f99a2f87d8b753 100644 --- a/packages/redux-routine/package.json +++ b/packages/redux-routine/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/redux-routine", - "version": "4.14.0-prerelease", + "version": "4.14.0", "description": "Redux middleware for generator coroutines.", "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 d900b240c43278..f5414a59968b6f 100644 --- a/packages/reusable-blocks/package.json +++ b/packages/reusable-blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/reusable-blocks", - "version": "3.12.0-prerelease", + "version": "3.12.0", "description": "Reusable blocks utilities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/rich-text/package.json b/packages/rich-text/package.json index e8d34922ea4a95..447a147cc9a86e 100644 --- a/packages/rich-text/package.json +++ b/packages/rich-text/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/rich-text", - "version": "5.12.0-prerelease", + "version": "5.12.0", "description": "Rich text value and manipulation API.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/scripts/package.json b/packages/scripts/package.json index c4f37e73f4f44e..5cfa0ff51a1c26 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/scripts", - "version": "23.6.0-prerelease", + "version": "23.6.0", "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 8d4c81abdc18c3..5d3e8ec6639378 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": "3.12.0-prerelease", + "version": "3.12.0", "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/shortcode/package.json b/packages/shortcode/package.json index 9f99ea68295da3..e7cfcd010d2da9 100644 --- a/packages/shortcode/package.json +++ b/packages/shortcode/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/shortcode", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "Shortcode module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/style-engine/package.json b/packages/style-engine/package.json index 1da79e74e8cdfd..40c8df9677ca69 100644 --- a/packages/style-engine/package.json +++ b/packages/style-engine/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/style-engine", - "version": "0.13.0-prerelease", + "version": "0.13.0", "description": "WordPress Style engine.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/token-list/package.json b/packages/token-list/package.json index ba112494ac20ea..d22f37fea8b146 100644 --- a/packages/token-list/package.json +++ b/packages/token-list/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/token-list", - "version": "2.14.0-prerelease", + "version": "2.14.0", "description": "Constructable, plain JavaScript DOMTokenList implementation, supporting non-browser runtimes.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/url/package.json b/packages/url/package.json index 12a56270282739..2420096628d52b 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/url", - "version": "3.15.0-prerelease", + "version": "3.15.0", "description": "WordPress URL utilities.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/viewport/package.json b/packages/viewport/package.json index 0d7553237f8f80..912edd5a791493 100644 --- a/packages/viewport/package.json +++ b/packages/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/viewport", - "version": "4.12.0-prerelease", + "version": "4.12.0", "description": "Viewport module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/warning/package.json b/packages/warning/package.json index 54583f6dd511c7..2f816dfe29461a 100644 --- a/packages/warning/package.json +++ b/packages/warning/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/warning", - "version": "2.14.0-prerelease", + "version": "2.14.0", "description": "Warning utility for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/widgets/package.json b/packages/widgets/package.json index c1f9cda8c115a9..da04a5ce8f6c2b 100644 --- a/packages/widgets/package.json +++ b/packages/widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/widgets", - "version": "2.12.0-prerelease", + "version": "2.12.0", "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", diff --git a/packages/wordcount/package.json b/packages/wordcount/package.json index 7feafef879670c..f539befcbf68bf 100644 --- a/packages/wordcount/package.json +++ b/packages/wordcount/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/wordcount", - "version": "3.14.0-prerelease", + "version": "3.14.0", "description": "WordPress word count utility.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", From 8e089f734254423adee026fe8b7dfab6e4b72cc9 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 27 Jul 2022 13:50:38 +0000 Subject: [PATCH 012/104] Update Changelog for 13.8.0-rc.1 --- changelog.txt | 247 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 247 insertions(+) diff --git a/changelog.txt b/changelog.txt index 2377924306f430..409c8e08f3a4dd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,252 @@ == Changelog == += 13.8.0-rc.1 = + + + +## Changelog + +### Features + +#### Block Editor +- feat: Inserter displays block collections. ([42405](https://github.com/WordPress/gutenberg/pull/42405)) + + +### Enhancements + +- Allow removing CSS declarations from the WP_Style_Engine_CSS_Declarations object. ([42428](https://github.com/WordPress/gutenberg/pull/42428)) +- Equalize modal content padding. ([42370](https://github.com/WordPress/gutenberg/pull/42370)) +- Remove top margin on the first paragraph in a modal. ([42369](https://github.com/WordPress/gutenberg/pull/42369)) + +#### Components +- BorderControl: Render border color/style dropdown as UnitControl prefix. ([42212](https://github.com/WordPress/gutenberg/pull/42212)) +- ColorPicker: Cleanly implement large size. ([42002](https://github.com/WordPress/gutenberg/pull/42002)) +- ComboboxControl: Refactor `onKeyDown` to use `keyboardEvent.code`. ([42569](https://github.com/WordPress/gutenberg/pull/42569)) +- Elevation: Convert component to TypeScript. ([42302](https://github.com/WordPress/gutenberg/pull/42302)) +- InputControl: Decrease large default padding if has prefix/suffix. ([42166](https://github.com/WordPress/gutenberg/pull/42166)) +- ScrollLock: Covert component to TypeScript. ([42303](https://github.com/WordPress/gutenberg/pull/42303)) +- SelectControl: Add flag for larger default size. ([42456](https://github.com/WordPress/gutenberg/pull/42456)) +- Shortcut: Covert component to TypeScript. ([42272](https://github.com/WordPress/gutenberg/pull/42272)) +- Divider: Complete TypeScript migration of component. ([41991](https://github.com/WordPress/gutenberg/pull/41991)) +- ToggleGroupControl: Add size variants. ([42008](https://github.com/WordPress/gutenberg/pull/42008)) +- UnitControl: Update unit select's focus styles. ([42383](https://github.com/WordPress/gutenberg/pull/42383)) +- BorderControl: Add missing changelog for accessibility enhancements. ([42411](https://github.com/WordPress/gutenberg/pull/42411)) +- CustomSelectControl: Use styles from SelectControl. ([42460](https://github.com/WordPress/gutenberg/pull/42460)) +- Dropdown: Add wrapper for custom padding. ([42595](https://github.com/WordPress/gutenberg/pull/42595)) +- InputControl: Add padding wrapper for prefix/suffix. ([42378](https://github.com/WordPress/gutenberg/pull/42378)) +- ScrollLock: Improve Storybook story for documentation view. ([42344](https://github.com/WordPress/gutenberg/pull/42344)) +- `ColorPalette`: Display checkered preview background when `value` is transparent. ([42232](https://github.com/WordPress/gutenberg/pull/42232)) + +#### Block Library +- Added WhatsApp icon to the Social Icon Block. ([42137](https://github.com/WordPress/gutenberg/pull/42137)) +- Template Part: Swap block action places. ([42221](https://github.com/WordPress/gutenberg/pull/42221)) +- Template Parts: Add search to replacement modal. ([42459](https://github.com/WordPress/gutenberg/pull/42459)) +- Image: Add border block support for color, width, and style. ([31366](https://github.com/WordPress/gutenberg/pull/31366)) +- List v2: Remove quote transforms as removed by Quote v2. ([42700](https://github.com/WordPress/gutenberg/pull/42700)) +- Merge Comments and Post Comments blocks. ([41807](https://github.com/WordPress/gutenberg/pull/41807)) +- Theme.json: Add support for heading / caption elements in theme.json schema. ([42433](https://github.com/WordPress/gutenberg/pull/42433)) + +#### Global Styles +- Add layout content size controls to global styles. ([42309](https://github.com/WordPress/gutenberg/pull/42309)) +- Core CSS support for root padding and alignfull blocks. ([42085](https://github.com/WordPress/gutenberg/pull/42085)) +- Theme.json: Add block support feature level selectors for blocks. ([42087](https://github.com/WordPress/gutenberg/pull/42087)) + +#### Document Settings +- Make 'Move to trash' button full width. ([42577](https://github.com/WordPress/gutenberg/pull/42577)) + +#### Block Editor +- Add setting to display rich text toolbar inline. ([42399](https://github.com/WordPress/gutenberg/pull/42399)) +- Add block variations for individual template parts. ([42454](https://github.com/WordPress/gutenberg/pull/42454)) +- Enable `onEnter` support for group block. ([40724](https://github.com/WordPress/gutenberg/pull/40724)) + +#### Site Editor +- On template creation, don't show search if not needed. ([42357](https://github.com/WordPress/gutenberg/pull/42357)) + +#### Accessibility +- BorderControl: Update labelling, tooltips and wrap with fieldset and legend. ([42348](https://github.com/WordPress/gutenberg/pull/42348)) + +#### Icons +- Add shuffle icon to library. ([42193](https://github.com/WordPress/gutenberg/pull/42193)) + +#### Nested / Inner Blocks +- Quote: Use nested blocks. ([25892](https://github.com/WordPress/gutenberg/pull/25892)) + +#### Colors +- Update color palette popover style. ([41900](https://github.com/WordPress/gutenberg/pull/41900)) + + +### Bug Fixes + +- Env: Download WordPress PHPUnit Into Container. ([41780](https://github.com/WordPress/gutenberg/pull/41780)) +- Env: Restrict `WP_TESTS_DOMAIN` constant to just hostname and not home URL. ([41039](https://github.com/WordPress/gutenberg/pull/41039)) +- Fix: Condition bug on BoxControl. ([42402](https://github.com/WordPress/gutenberg/pull/42402)) +- MaybeCategoryPanel: Update category selector. ([42663](https://github.com/WordPress/gutenberg/pull/42663)) +- Post title: Fix single line paste. ([42321](https://github.com/WordPress/gutenberg/pull/42321)) +- Scripts: Exit error code 1 when status value is null. ([42396](https://github.com/WordPress/gutenberg/pull/42396)) +- Style engine: Check item value validity. ([42487](https://github.com/WordPress/gutenberg/pull/42487)) +- Utilize WordPress PHPUnit Test Library Included By `wp-env`. ([41852](https://github.com/WordPress/gutenberg/pull/41852)) +- fix: Correct alt text footnote spacing. ([42504](https://github.com/WordPress/gutenberg/pull/42504)) + +#### Block Library +- Cover Block: Prevent transform to Group block when featured image is set. ([42638](https://github.com/WordPress/gutenberg/pull/42638)) +- Cover block: Adding background-size and background-repeat properties to the block CSS. ([42470](https://github.com/WordPress/gutenberg/pull/42470)) +- Fix tab/focus order issue in Media & text block. ([40806](https://github.com/WordPress/gutenberg/pull/40806)) +- List v2: Add forward delete. ([42564](https://github.com/WordPress/gutenberg/pull/42564)) +- List v2: Improve paste handling. ([42524](https://github.com/WordPress/gutenberg/pull/42524)) +- List v2: Merge with nested items. ([42551](https://github.com/WordPress/gutenberg/pull/42551)) +- List v2: Switch to default block type on Backspace from start. ([42633](https://github.com/WordPress/gutenberg/pull/42633)) +- Page List: Fetch items with 'view' context. ([42559](https://github.com/WordPress/gutenberg/pull/42559)) +- Social Icons Block: Fix button opacity in template parts. ([42641](https://github.com/WordPress/gutenberg/pull/42641)) +- Group block: Add context to the word "Row". ([42255](https://github.com/WordPress/gutenberg/pull/42255)) +- Hide prefix and suffix placeholders in post terms. ([42418](https://github.com/WordPress/gutenberg/pull/42418)) +- Theme.json: Fix schema for button elements. ([42431](https://github.com/WordPress/gutenberg/pull/42431)) + +#### Components +- AnglePickerControl: Fix gap between elements in RTL mode. ([42534](https://github.com/WordPress/gutenberg/pull/42534)) +- ColorPalette: Fix background image in RTL mode. ([42510](https://github.com/WordPress/gutenberg/pull/42510)) +- Context System: Don't explicitly set `undefined` value to `children`. ([42686](https://github.com/WordPress/gutenberg/pull/42686)) +- Popover: Fix width on `expandOnMobile`. ([42635](https://github.com/WordPress/gutenberg/pull/42635)) +- RangeControl: Clamp initialPosition between min and max values. ([42571](https://github.com/WordPress/gutenberg/pull/42571)) +- Tooltip: Avoid unnecessary re-renders of ` styles in WP forms.css + && { + appearance: none; + background: transparent; + border-radius: 2px; + border: none; + display: block; + outline: none; + /* Removing margin ensures focus styles neatly overlay the wrapper. */ + margin: 0; + min-height: auto; + font-family: inherit; + + &:not( :disabled ) { + cursor: pointer; } + + ${ baseUnitLabelStyles }; + ${ unitSelectSizes }; } `; diff --git a/packages/components/src/unit-control/types.ts b/packages/components/src/unit-control/types.ts index d967378f1432d5..0372d2935733bb 100644 --- a/packages/components/src/unit-control/types.ts +++ b/packages/components/src/unit-control/types.ts @@ -43,7 +43,7 @@ export type UnitControlOnChangeCallback = InputChangeCallback< { data?: WPUnitControlUnit } >; -export type UnitSelectControlProps = { +export type UnitSelectControlProps = Pick< InputControlProps, 'size' > & { /** * Whether the control can be focused via keyboard navigation. * @@ -54,12 +54,6 @@ export type UnitSelectControlProps = { * A callback function invoked when the value is changed. */ onChange?: UnitControlOnChangeCallback; - /** - * Size of the control option. Supports "default" and "small". - * - * @default 'default' - */ - size?: SelectSize; /** * Current unit. */ From 3f58ed5d5becedbf1f406710b56ba014e87a79de Mon Sep 17 00:00:00 2001 From: Ramon Date: Tue, 2 Aug 2022 13:16:06 +1000 Subject: [PATCH 065/104] Style engine: enqueue block support styles (#42452) * Enqueuing block support styles version 1. * Linter, this one's for you. * Post trunk merge cleanup and update tests. * Removed spacing around curly braces in CSS rules. Updated tests. We could maybe add a prettify option down the road. Juggling methods around to cater for adding styles to (any) store. Also making return values consistent. * Splitting `wp_style_engine_enqueue_block_supports_styles` and `wp_style_engine_get_block_supports_styles` so we can enqueue styles that don't need parsing, e.g., layout * Integrate the processor class * Migrate layout styles to style engine store. * Update packages/style-engine/class-wp-style-engine.php Co-authored-by: Ari Stathopoulos * Tweaks for #42452 (#42691) * abstract stores * "else" not needed * compile_classnames method not needed * we have a method to get the store here * Make the wp_style_engine_add_to_store function always return a store * wp_style_engine_get_stylesheet - always return string * Merged with base branch. Added test for new method. Co-authored-by: ramonjd Co-authored-by: Ramon * Adding check for the context argument. Adding tests. * Updating the processor so that it's ignorant of stores. Why? So that it can be used to process any CSS and not just stored CSS. Updating layout for backwards compatibility in gutenberg_get_layout_style (returning the styles that are collected in the function body only) Created a new mode for incoming $css_rules to be a collection of selector + css_declaration keys. Removed wp_style_engine_get_stylesheet (from store) since we don't use it yet Added a new function wp_style_engine_get_stylesheet_from_css_rules() that will process and compile a collection of CSS rules, and not store them. * dump var_dump() * Improve the processor * remove trailing commas - compatibility with PHP < 7.2 * rename css_declarations to declarations * remove unused variable Removing unused function wp_style_engine_get_stylesheet_from_store Updating tests to check for merging and deduping * Switch parse_block_styles from public to protected static * Now that all methods are static, there's no need to call `get_instance()` * Revert get_instance() in wp_style_engine_add_to_store because we want to ensure the hook is enqueued here. * Adding a test for the 'enqueue' flag. * Update lib/block-supports/layout.php Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> * Adding a test for the 'enqueue' flag. * Add named stores to the processor * avoid setting var for something that only gets used once * Only use "else" if absolutely necessary * Add a set_name method * combine & simplify conditions * use empty() instead of isset() checks here * shorten it Co-authored-by: Ari Stathopoulos Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> --- lib/block-supports/elements.php | 20 +- lib/block-supports/layout.php | 120 ++++-- .../class-wp-style-engine-css-rule.php | 2 +- .../class-wp-style-engine-css-rules-store.php | 49 +++ .../class-wp-style-engine-processor.php | 73 +++- .../style-engine/class-wp-style-engine.php | 395 +++++++++++++----- ...s-wp-style-engine-css-rules-store-test.php | 42 ++ .../class-wp-style-engine-processor-test.php | 100 +++-- .../phpunit/class-wp-style-engine-test.php | 195 ++++++++- 9 files changed, 786 insertions(+), 210 deletions(-) diff --git a/lib/block-supports/elements.php b/lib/block-supports/elements.php index b0328c6a5f227c..2a512eab82ca96 100644 --- a/lib/block-supports/elements.php +++ b/lib/block-supports/elements.php @@ -104,18 +104,14 @@ function gutenberg_render_elements_support_styles( $pre_render, $block ) { $class_name = gutenberg_get_elements_class_name( $block ); $link_block_styles = isset( $element_block_styles['link'] ) ? $element_block_styles['link'] : null; - if ( $link_block_styles ) { - $styles = gutenberg_style_engine_get_styles( - $link_block_styles, - array( - 'selector' => ".$class_name a", - ) - ); - - if ( ! empty( $styles['css'] ) ) { - gutenberg_enqueue_block_support_styles( $styles['css'] ); - } - } + gutenberg_style_engine_get_styles( + $link_block_styles, + array( + 'selector' => ".$class_name a", + 'context' => 'block-supports', + 'enqueue' => true, + ) + ); return null; } diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index 43f0e9beffba24..8ae0ffc007fa98 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -39,9 +39,8 @@ function gutenberg_register_layout_support( $block_type ) { * @return string CSS style. */ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support = false, $gap_value = null, $should_skip_gap_serialization = false, $fallback_gap_value = '0.5em', $block_spacing = null ) { - $layout_type = isset( $layout['type'] ) ? $layout['type'] : 'default'; - - $style = ''; + $layout_type = isset( $layout['type'] ) ? $layout['type'] : 'default'; + $layout_styles = array(); if ( 'default' === $layout_type ) { $content_size = isset( $layout['contentSize'] ) ? $layout['contentSize'] : ''; $wide_size = isset( $layout['wideSize'] ) ? $layout['wideSize'] : ''; @@ -55,14 +54,25 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support $wide_max_width_value = wp_strip_all_tags( explode( ';', $wide_max_width_value )[0] ); if ( $content_size || $wide_size ) { - $style = "$selector > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {"; - $style .= 'max-width: ' . esc_html( $all_max_width_value ) . ';'; - $style .= 'margin-left: auto !important;'; - $style .= 'margin-right: auto !important;'; - $style .= '}'; - - $style .= "$selector > .alignwide { max-width: " . esc_html( $wide_max_width_value ) . ';}'; - $style .= "$selector .alignfull { max-width: none; }"; + array_push( + $layout_styles, + array( + 'selector' => "$selector > :where(:not(.alignleft):not(.alignright):not(.alignfull))", + 'declarations' => array( + 'max-width' => $all_max_width_value, + 'margin-left' => 'auto !important', + 'margin-right' => 'auto !important', + ), + ), + array( + 'selector' => "$selector > .alignwide", + 'declarations' => array( 'max-width' => $wide_max_width_value ), + ), + array( + 'selector' => "$selector .alignfull", + 'declarations' => array( 'max-width' => 'none' ), + ) + ); if ( isset( $block_spacing ) ) { $block_spacing_values = gutenberg_style_engine_get_styles( @@ -74,12 +84,18 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support // Handle negative margins for alignfull children of blocks with custom padding set. // They're added separately because padding might only be set on one side. if ( isset( $block_spacing_values['declarations']['padding-right'] ) ) { - $padding_right = $block_spacing_values['declarations']['padding-right']; - $style .= "$selector > .alignfull { margin-right:calc($padding_right * -1); }"; + $padding_right = $block_spacing_values['declarations']['padding-right']; + $layout_styles[] = array( + 'selector' => "$selector > .alignfull", + 'declarations' => array( 'margin-right' => "calc($padding_right * -1)" ), + ); } if ( isset( $block_spacing_values['declarations']['padding-left'] ) ) { - $padding_left = $block_spacing_values['declarations']['padding-left']; - $style .= "$selector > .alignfull { margin-left: calc($padding_left * -1); }"; + $padding_left = $block_spacing_values['declarations']['padding-left']; + $layout_styles[] = array( + 'selector' => "$selector > .alignfull", + 'declarations' => array( 'margin-left' => "calc($padding_left * -1)" ), + ); } } } @@ -89,8 +105,23 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support $gap_value = isset( $gap_value['top'] ) ? $gap_value['top'] : null; } if ( $gap_value && ! $should_skip_gap_serialization ) { - $style .= "$selector > * { margin-block-start: 0; margin-block-end: 0; }"; - $style .= "$selector > * + * { margin-block-start: $gap_value; margin-block-end: 0; }"; + array_push( + $layout_styles, + array( + 'selector' => "$selector > *", + 'declarations' => array( + 'margin-block-start' => '0', + 'margin-block-end' => '0', + ), + ), + array( + 'selector' => "$selector > * + *", + 'declarations' => array( + 'margin-block-start' => $gap_value, + 'margin-block-end' => '0', + ), + ) + ); } } } elseif ( 'flex' === $layout_type ) { @@ -113,7 +144,10 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support } if ( ! empty( $layout['flexWrap'] ) && 'nowrap' === $layout['flexWrap'] ) { - $style .= "$selector { flex-wrap: nowrap; }"; + $layout_styles[] = array( + 'selector' => $selector, + 'declarations' => array( 'flex-wrap' => 'nowrap' ), + ); } if ( $has_block_gap_support ) { @@ -123,9 +157,10 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support $gap_value = $gap_row === $gap_column ? $gap_row : $gap_row . ' ' . $gap_column; } if ( $gap_value && ! $should_skip_gap_serialization ) { - $style .= "$selector {"; - $style .= "gap: $gap_value;"; - $style .= '}'; + $layout_styles[] = array( + 'selector' => $selector, + 'declarations' => array( 'gap' => $gap_value ), + ); } } @@ -136,29 +171,47 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support * by custom css. */ if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) { - $style .= "$selector {"; - $style .= "justify-content: {$justify_content_options[ $layout['justifyContent'] ]};"; - $style .= '}'; + $layout_styles[] = array( + 'selector' => $selector, + 'declarations' => array( 'justify-content' => $justify_content_options[ $layout['justifyContent'] ] ), + ); } if ( ! empty( $layout['verticalAlignment'] ) && array_key_exists( $layout['verticalAlignment'], $vertical_alignment_options ) ) { - $style .= "$selector {"; - $style .= "align-items: {$vertical_alignment_options[ $layout['verticalAlignment'] ]};"; - $style .= '}'; + $layout_styles[] = array( + 'selector' => $selector, + 'declarations' => array( 'align-items' => $vertical_alignment_options[ $layout['verticalAlignment'] ] ), + ); } } else { - $style .= "$selector {"; - $style .= 'flex-direction: column;'; + $layout_styles[ $selector ] = array( + 'flex-direction' => 'column', + 'align-items' => 'flex-start', + ); if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) { - $style .= "align-items: {$justify_content_options[ $layout['justifyContent'] ]};"; + $layout_styles[] = array( + 'selector' => $selector, + 'declarations' => array( 'align-items' => $justify_content_options[ $layout['justifyContent'] ] ), + ); } else { - $style .= 'align-items: flex-start;'; + $layout_styles[] = array( + 'selector' => $selector, + 'declarations' => array( 'align-items' => 'flex-start' ), + ); } - $style .= '}'; } } - return $style; + if ( ! empty( $layout_styles ) ) { + // Add to the style engine store to enqueue and render layout styles. + gutenberg_style_engine_add_to_store( 'layout-block-supports', $layout_styles ); + + // Return compiled layout styles to retain backwards compatibility. + // Since https://github.com/WordPress/gutenberg/pull/42452 we no longer call wp_enqueue_block_support_styles in this block supports file. + return gutenberg_style_engine_get_stylesheet_from_css_rules( $layout_styles ); + } + + return ''; } /** @@ -253,7 +306,6 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { // Only add container class and enqueue block support styles if unique styles were generated. if ( ! empty( $style ) ) { $class_names[] = $container_class; - wp_enqueue_block_support_styles( $style ); } } diff --git a/packages/style-engine/class-wp-style-engine-css-rule.php b/packages/style-engine/class-wp-style-engine-css-rule.php index 9e77420f0577c2..5429b282f328db 100644 --- a/packages/style-engine/class-wp-style-engine-css-rule.php +++ b/packages/style-engine/class-wp-style-engine-css-rule.php @@ -51,7 +51,7 @@ public function __construct( $selector = '', $declarations = array() ) { * * @param string $selector The CSS selector. * - * @return WP_Style_Engine_CSS_Rule Returns the object to allow chaining of methods. + * @return WP_Style_Engine_CSS_Rule|void Returns the object to allow chaining of methods. */ public function set_selector( $selector ) { if ( empty( $selector ) ) { diff --git a/packages/style-engine/class-wp-style-engine-css-rules-store.php b/packages/style-engine/class-wp-style-engine-css-rules-store.php index 1dc4da265accc7..d3cc079afe6e96 100644 --- a/packages/style-engine/class-wp-style-engine-css-rules-store.php +++ b/packages/style-engine/class-wp-style-engine-css-rules-store.php @@ -27,6 +27,14 @@ class WP_Style_Engine_CSS_Rules_Store { */ protected static $stores = array(); + + /** + * The store name. + * + * @var string + */ + protected $name = ''; + /** * An array of CSS Rules objects assigned to the store. * @@ -44,9 +52,50 @@ class WP_Style_Engine_CSS_Rules_Store { public static function get_store( $store_name = 'default' ) { if ( ! isset( static::$stores[ $store_name ] ) ) { static::$stores[ $store_name ] = new static(); + // Set the store name. + static::$stores[ $store_name ]->set_name( $store_name ); } return static::$stores[ $store_name ]; } + + /** + * Get an array of all available stores. + * + * @return WP_Style_Engine_CSS_Rules_Store[] + */ + public static function get_stores() { + return static::$stores; + } + + /** + * Clears all stores from static::$stores. + * + * @return void + */ + public static function remove_all_stores() { + static::$stores = array(); + } + + /** + * Set the store name. + * + * @param string $name The store name. + * + * @return void + */ + public function set_name( $name ) { + $this->name = $name; + } + + /** + * Get the store name. + * + * @return string + */ + public function get_name() { + return $this->name; + } + /** * Get an array of all rules. * diff --git a/packages/style-engine/class-wp-style-engine-processor.php b/packages/style-engine/class-wp-style-engine-processor.php index 646ea43e7261a8..088513e83284d1 100644 --- a/packages/style-engine/class-wp-style-engine-processor.php +++ b/packages/style-engine/class-wp-style-engine-processor.php @@ -2,7 +2,7 @@ /** * WP_Style_Engine_Processor * - * Compiles styles from a store of CSS rules. + * Compiles styles from stores or collection of CSS rules. * * @package Gutenberg */ @@ -12,26 +12,52 @@ } /** - * Compiles styles from a store of CSS rules. + * Compiles styles from stores or collection of CSS rules. * * @access private */ class WP_Style_Engine_Processor { /** - * The Style-Engine Store object. + * The Style-Engine Store objects * - * @var WP_Style_Engine_CSS_Rules_Store + * @var WP_Style_Engine_CSS_Rules_Store[] */ - protected $store; + protected $stores = array(); /** - * Constructor. + * The set of CSS rules that this processor will work on. * - * @param WP_Style_Engine_CSS_Rules_Store $store The store to render. + * @var WP_Style_Engine_CSS_Rule[] */ - public function __construct( WP_Style_Engine_CSS_Rules_Store $store ) { - $this->store = $store; + protected $css_rules = array(); + + /** + * Add a store to the processor. + * + * @param WP_Style_Engine_CSS_Rules_Store $store The store to add. + */ + public function add_store( WP_Style_Engine_CSS_Rules_Store $store ) { + $this->stores[ $store->get_name() ] = $store; + } + + /** + * Adds rules to be processed. + * + * @param WP_Style_Engine_CSS_Rule|WP_Style_Engine_CSS_Rule[] $css_rules A single, or an array of, WP_Style_Engine_CSS_Rule objects from a store or otherwise. + */ + public function add_rules( $css_rules ) { + if ( ! is_array( $css_rules ) ) { + $css_rules = array( $css_rules ); + } + foreach ( $css_rules as $rule ) { + $selector = $rule->get_selector(); + if ( isset( $this->css_rules[ $selector ] ) ) { + $this->css_rules[ $selector ]->add_declarations( $rule->get_declarations() ); + continue; + } + $this->css_rules[ $rule->get_selector() ] = $rule; + } } /** @@ -40,13 +66,17 @@ public function __construct( WP_Style_Engine_CSS_Rules_Store $store ) { * @return string The computed CSS. */ public function get_css() { + // If we have stores, get the rules from them. + foreach ( $this->stores as $store ) { + $this->add_rules( $store->get_all_rules() ); + } + // Combine CSS selectors that have identical declarations. $this->combine_rules_selectors(); // Build the CSS. - $css = ''; - $rules = $this->store->get_all_rules(); - foreach ( $rules as $rule ) { + $css = ''; + foreach ( $this->css_rules as $rule ) { $css .= $rule->get_css(); } return $css; @@ -58,14 +88,12 @@ public function get_css() { * @return void */ private function combine_rules_selectors() { - $rules = $this->store->get_all_rules(); - // Build an array of selectors along with the JSON-ified styles to make comparisons easier. $selectors_json = array(); - foreach ( $rules as $selector => $rule ) { + foreach ( $this->css_rules as $rule ) { $declarations = $rule->get_declarations()->get_declarations(); ksort( $declarations ); - $selectors_json[ $selector ] = json_encode( $declarations ); + $selectors_json[ $rule->get_selector() ] = wp_json_encode( $declarations ); } // Combine selectors that have the same styles. @@ -76,18 +104,17 @@ private function combine_rules_selectors() { if ( 1 >= count( $duplicates ) ) { continue; } + + $declarations = $this->css_rules[ $selector ]->get_declarations(); + foreach ( $duplicates as $key ) { // Unset the duplicates from the $selectors_json array to avoid looping through them as well. unset( $selectors_json[ $key ] ); - // Remove the rules from the store. - $this->store->remove_rule( $key ); + // Remove the rules from the rules collection. + unset( $this->css_rules[ $key ] ); } // Create a new rule with the combined selectors. - $new_rule = $this->store->add_rule( implode( ',', $duplicates ) ); - // Set the declarations. The extra check is in place because `add_rule` in the store can return `null`. - if ( $new_rule ) { - $new_rule->add_declarations( $rules[ $selector ]->get_declarations() ); - } + $this->css_rules[ implode( ',', $duplicates ) ] = new WP_Style_Engine_CSS_Rule( implode( ',', $duplicates ), $declarations ); } } } diff --git a/packages/style-engine/class-wp-style-engine.php b/packages/style-engine/class-wp-style-engine.php index c2d778066ca071..33533fc872f699 100644 --- a/packages/style-engine/class-wp-style-engine.php +++ b/packages/style-engine/class-wp-style-engine.php @@ -222,22 +222,7 @@ class WP_Style_Engine { ); /** - * Utility method to retrieve the main instance of the class. - * - * The instance will be created if it does not exist yet. - * - * @return WP_Style_Engine The main instance. - */ - public static function get_instance() { - if ( null === static::$instance ) { - static::$instance = new static(); - } - - return static::$instance; - } - - /** - * Extracts the slug in kebab case from a preset string, e.g., "heavenly-blue" from 'var:preset|color|heavenlyBlue'. + * Util: Extracts the slug in kebab case from a preset string, e.g., "heavenly-blue" from 'var:preset|color|heavenlyBlue'. * * @param string? $style_value A single css preset value. * @param string $property_key The CSS property that is the second element of the preset string. Used for matching. @@ -253,7 +238,7 @@ protected static function get_slug_from_preset_value( $style_value, $property_ke } /** - * Generates a css var string, eg var(--wp--preset--color--background) from a preset string, eg. `var:preset|space|50`. + * Util: Generates a css var string, eg var(--wp--preset--color--background) from a preset string, eg. `var:preset|space|50`. * * @param string $style_value A single css preset value. * @param array $css_vars The css var patterns used to generate the var string. @@ -275,7 +260,7 @@ protected static function get_css_var_value( $style_value, $css_vars ) { } /** - * Checks whether an incoming block style value is valid. + * Util: Checks whether an incoming block style value is valid. * * @param string? $style_value A single css preset value. * @@ -293,6 +278,150 @@ protected static function is_valid_style_value( $style_value ) { return true; } + /** + * Private constructor to prevent instantiation. + */ + private function __construct() { + // Register the hook callback to render stored styles to the page. + static::register_actions( array( __CLASS__, 'process_and_enqueue_stored_styles' ) ); + } + + /** + * Utility method to retrieve the main instance of the class. + * + * The instance will be created if it does not exist yet. + * + * @return WP_Style_Engine The main instance. + */ + public static function get_instance() { + if ( null === static::$instance ) { + static::$instance = new static(); + } + + return static::$instance; + } + + /** + * Stores a CSS rule using the provide CSS selector and CSS declarations. + * + * @param string $store_key A valid store key. + * @param string $css_selector When a selector is passed, the function will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. + * @param array $css_declarations An array of parsed CSS property => CSS value pairs. + * + * @return void. + */ + public static function store_css_rule( $store_key, $css_selector, $css_declarations ) { + if ( empty( $store_key ) || empty( $css_selector ) || empty( $css_declarations ) ) { + return; + } + static::get_store( $store_key )->add_rule( $css_selector )->add_declarations( $css_declarations ); + } + + /** + * Returns a store by store key. + * + * @param string $store_key A store key. + * + * @return WP_Style_Engine_CSS_Rules_Store + */ + public static function get_store( $store_key ) { + return WP_Style_Engine_CSS_Rules_Store::get_store( $store_key ); + } + + /** + * Taken from gutenberg_enqueue_block_support_styles() + * + * This function takes care of registering hooks to add inline styles + * in the proper place, depending on the theme in use. + * + * For block themes, it's loaded in the head. + * For classic ones, it's loaded in the body + * because the wp_head action happens before + * the render_block. + * + * @param callable $callable A user-defined callback function for a WordPress hook. + * @param int $priority To set the priority for the add_action. + * + * @see gutenberg_enqueue_block_support_styles() + */ + protected static function register_actions( $callable, $priority = 10 ) { + if ( ! $callable ) { + return; + } + add_action( 'wp_enqueue_scripts', $callable ); + add_action( + wp_is_block_theme() ? 'wp_head' : 'wp_footer', + $callable, + $priority + ); + } + + /** + * Fetches, processes and compiles stored styles, then renders them to the page. + */ + public static function process_and_enqueue_stored_styles() { + $stores = WP_Style_Engine_CSS_Rules_Store::get_stores(); + + foreach ( $stores as $key => $store ) { + $processor = new WP_Style_Engine_Processor(); + $processor->add_store( $store ); + $styles = $processor->get_css(); + + if ( ! empty( $styles ) ) { + wp_register_style( $key, false, array(), true, true ); + wp_add_inline_style( $key, $styles ); + wp_enqueue_style( $key ); + } + } + } + + /** + * Returns classnames and CSS based on the values in a styles object. + * Return values are parsed based on the instructions in BLOCK_STYLE_DEFINITIONS_METADATA. + * + * @param array $block_styles The style object. + * @param array $options array( + * 'selector' => (string) When a selector is passed, `generate()` will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. + * 'convert_vars_to_classnames' => (boolean) Whether to skip converting CSS var:? values to var( --wp--preset--* ) values. Default is `false`. + * );. + * + * @return array array( + * 'declarations' => (array) An array of parsed CSS property => CSS value pairs. + * 'classnames' => (array) A flat array of classnames. + * ); + */ + public static function parse_block_styles( $block_styles, $options ) { + if ( empty( $block_styles ) || ! is_array( $block_styles ) ) { + return array(); + } + + $css_declarations = array(); + $classnames = array(); + $should_skip_css_vars = isset( $options['convert_vars_to_classnames'] ) && true === $options['convert_vars_to_classnames']; + + // Collect CSS and classnames. + foreach ( static::BLOCK_STYLE_DEFINITIONS_METADATA as $definition_group_key => $definition_group_style ) { + if ( empty( $block_styles[ $definition_group_key ] ) ) { + continue; + } + foreach ( $definition_group_style as $style_definition ) { + $style_value = _wp_array_get( $block_styles, $style_definition['path'], null ); + + if ( ! static::is_valid_style_value( $style_value ) ) { + continue; + } + + $classnames = array_merge( $classnames, static::get_classnames( $style_value, $style_definition ) ); + $css_declarations = array_merge( $css_declarations, static::get_css_declarations( $style_value, $style_definition, $should_skip_css_vars ) ); + } + } + + return array( + 'classnames' => $classnames, + 'declarations' => $css_declarations, + ); + } + /** * Returns classnames, and generates classname(s) from a CSS preset property pattern, e.g., 'var:preset|color|heavenly-blue'. * @@ -339,10 +468,7 @@ protected static function get_classnames( $style_value, $style_definition ) { * @return array An array of CSS definitions, e.g., array( "$property" => "$value" ). */ protected static function get_css_declarations( $style_value, $style_definition, $should_skip_css_vars = false ) { - if ( - isset( $style_definition['value_func'] ) && - is_callable( $style_definition['value_func'] ) - ) { + if ( isset( $style_definition['value_func'] ) && is_callable( $style_definition['value_func'] ) ) { return call_user_func( $style_definition['value_func'], $style_value, $style_definition, $should_skip_css_vars ); } @@ -369,7 +495,9 @@ protected static function get_css_declarations( $style_value, $style_definition, if ( is_string( $value ) && strpos( $value, 'var:' ) !== false && ! $should_skip_css_vars && ! empty( $style_definition['css_vars'] ) ) { $value = static::get_css_var_value( $value, $style_definition['css_vars'] ); } + $individual_property = sprintf( $style_property_keys['individual'], _wp_to_kebab_case( $key ) ); + if ( $individual_property && static::is_valid_style_value( $value ) ) { $css_declarations[ $individual_property ] = $value; } @@ -381,73 +509,6 @@ protected static function get_css_declarations( $style_value, $style_definition, return $css_declarations; } - /** - * Returns classnames and CSS based on the values in a styles object. - * Return values are parsed based on the instructions in BLOCK_STYLE_DEFINITIONS_METADATA. - * - * @param array $block_styles The style object. - * @param array $options array( - * 'selector' => (string) When a selector is passed, `generate()` will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. - * 'convert_vars_to_classnames' => (boolean) Whether to skip converting CSS var:? values to var( --wp--preset--* ) values. Default is `false`. - * );. - * - * @return array|null array( - * 'css' => (string) A CSS ruleset formatted to be placed in an HTML `style` attribute or tag. Default is a string of inline styles. - * 'classnames' => (string) Classnames separated by a space. - * ); - */ - public function get_styles( $block_styles, $options ) { - if ( empty( $block_styles ) || ! is_array( $block_styles ) ) { - return null; - } - - $css_declarations = array(); - $classnames = array(); - $should_skip_css_vars = isset( $options['convert_vars_to_classnames'] ) && true === $options['convert_vars_to_classnames']; - - // Collect CSS and classnames. - foreach ( static::BLOCK_STYLE_DEFINITIONS_METADATA as $definition_group_key => $definition_group_style ) { - if ( empty( $block_styles[ $definition_group_key ] ) ) { - continue; - } - foreach ( $definition_group_style as $style_definition ) { - $style_value = _wp_array_get( $block_styles, $style_definition['path'], null ); - - if ( ! static::is_valid_style_value( $style_value ) ) { - continue; - } - - $classnames = array_merge( $classnames, static::get_classnames( $style_value, $style_definition ) ); - $css_declarations = array_merge( $css_declarations, static::get_css_declarations( $style_value, $style_definition, $should_skip_css_vars ) ); - } - } - - // Build CSS rules output. - $css_selector = isset( $options['selector'] ) ? $options['selector'] : null; - $css_declarations = new WP_Style_Engine_CSS_Declarations( $css_declarations ); - - // The return object. - $styles_output = array(); - $css = $css_declarations->get_declarations_string(); - - // Return css, if any. - if ( ! empty( $css ) ) { - $styles_output['css'] = $css; - $styles_output['declarations'] = $css_declarations->get_declarations(); - // Return an entire rule if there is a selector. - if ( $css_selector ) { - $styles_output['css'] = $css_selector . ' { ' . $css . ' }'; - } - } - - // Return classnames, if any. - if ( ! empty( $classnames ) ) { - $styles_output['classnames'] = implode( ' ', array_unique( $classnames ) ); - } - - return $styles_output; - } - /** * Style value parser that returns a CSS definition array comprising style properties * that have keys representing individual style properties, otherwise known as longhand CSS properties. @@ -494,10 +555,45 @@ protected static function get_individual_property_css_declarations( $style_value } return $css_declarations; } + + /** + * Returns compiled CSS from css_declarations. + * + * @param array $css_declarations An array of parsed CSS property => CSS value pairs. + * @param string $css_selector When a selector is passed, the function will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. + * + * @return string A compiled CSS string. + */ + public static function compile_css( $css_declarations, $css_selector ) { + if ( empty( $css_declarations ) || ! is_array( $css_declarations ) ) { + return ''; + } + + // Return an entire rule if there is a selector. + if ( $css_selector ) { + $css_rule = new WP_Style_Engine_CSS_Rule( $css_selector, $css_declarations ); + return $css_rule->get_css(); + } + $css_declarations = new WP_Style_Engine_CSS_Declarations( $css_declarations ); + return $css_declarations->get_declarations_string(); + } + + /** + * Returns a compiled stylesheet from stored CSS rules. + * + * @param WP_Style_Engine_CSS_Rule[] $css_rules An array of WP_Style_Engine_CSS_Rule objects from a store or otherwise. + * + * @return string A compiled stylesheet from stored CSS rules. + */ + public static function compile_stylesheet_from_css_rules( $css_rules ) { + $processor = new WP_Style_Engine_Processor(); + $processor->add_rules( $css_rules ); + return $processor->get_css(); + } } /** - * Global public interface method to WP_Style_Engine->get_styles to generate styles from a single style object, e.g., + * Global public interface method to generate styles from a single style object, e.g., * the value of a block's attributes.style object or the top level styles in theme.json. * See: https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/#styles and * https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/ @@ -511,21 +607,124 @@ protected static function get_individual_property_css_declarations( $style_value * * @param array $block_styles The style object. * @param array $options array( - * 'selector' => (string) When a selector is passed, `generate()` will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. * 'context' => (string) An identifier describing the origin of the style object, e.g., 'block-supports' or 'global-styles'. Default is 'block-supports'. + * 'enqueue' => (boolean) When `true` will attempt to store and enqueue for rendering on the frontend. * 'convert_vars_to_classnames' => (boolean) Whether to skip converting CSS var:? values to var( --wp--preset--* ) values. Default is `false`. + * 'selector' => (string) When a selector is passed, `generate()` will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. * );. * * @return array|null array( - * 'css' => (string) A CSS ruleset or declarations block formatted to be placed in an HTML `style` attribute or tag. - * 'declarations' => (array) An array of property/value pairs representing parsed CSS declarations. - * 'classnames' => (string) Classnames separated by a space. + * 'css' => (string) A CSS ruleset or declarations block formatted to be placed in an HTML `style` attribute or tag. + * 'declarations' => (array) An array of property/value pairs representing parsed CSS declarations. + * 'classnames' => (string) Classnames separated by a space. * ); */ function wp_style_engine_get_styles( $block_styles, $options = array() ) { - if ( class_exists( 'WP_Style_Engine' ) ) { - $style_engine = WP_Style_Engine::get_instance(); - return $style_engine->get_styles( $block_styles, $options ); + if ( ! class_exists( 'WP_Style_Engine' ) ) { + return array(); + } + $defaults = array( + 'selector' => null, + 'context' => 'block-supports', + 'convert_vars_to_classnames' => false, + 'enqueue' => false, + ); + + $style_engine = WP_Style_Engine::get_instance(); + $options = wp_parse_args( $options, $defaults ); + $parsed_styles = null; + + // Block supports styles. + if ( 'block-supports' === $options['context'] ) { + $parsed_styles = $style_engine::parse_block_styles( $block_styles, $options ); } - return null; + + // Output. + $styles_output = array(); + + if ( ! $parsed_styles ) { + return $styles_output; + } + + if ( ! empty( $parsed_styles['declarations'] ) ) { + $styles_output['css'] = $style_engine::compile_css( $parsed_styles['declarations'], $options['selector'] ); + $styles_output['declarations'] = $parsed_styles['declarations']; + if ( true === $options['enqueue'] ) { + $style_engine::store_css_rule( $options['context'], $options['selector'], $parsed_styles['declarations'] ); + } + } + + if ( ! empty( $parsed_styles['classnames'] ) ) { + $styles_output['classnames'] = implode( ' ', array_unique( $parsed_styles['classnames'] ) ); + } + + return array_filter( $styles_output ); +} + +/** + * Global public interface method to register styles to be enqueued and rendered. + * + * @access public + * + * @param string $store_key A valid store key. + * @param array $css_rules array( + * 'selector' => (string) A CSS selector. + * 'declarations' => (boolean) An array of CSS definitions, e.g., array( "$property" => "$value" ). + * );. + * + * @return WP_Style_Engine_CSS_Rules_Store|null. + */ +function wp_style_engine_add_to_store( $store_key, $css_rules = array() ) { + if ( ! class_exists( 'WP_Style_Engine' ) || ! $store_key ) { + return null; + } + + // Get instance here to ensure that we register hooks to enqueue stored styles. + $style_engine = WP_Style_Engine::get_instance(); + + if ( empty( $css_rules ) ) { + return $style_engine::get_store( $store_key ); + } + + foreach ( $css_rules as $css_rule ) { + if ( empty( $css_rule['selector'] ) || empty( $css_rule['declarations'] ) ) { + continue; + } + $style_engine::store_css_rule( $store_key, $css_rule['selector'], $css_rule['declarations'] ); + } + return $style_engine::get_store( $store_key ); +} + +/** + * Returns compiled CSS from a collection of selectors and declarations. + * This won't add to any store, but is useful for returning a compiled style sheet from any CSS selector + declarations combos. + * + * @access public + * + * @param array $css_rules array( + * 'selector' => (string) A CSS selector. + * 'declarations' => (boolean) An array of CSS definitions, e.g., array( "$property" => "$value" ). + * );. + * + * @return string A compiled CSS string. + */ +function wp_style_engine_get_stylesheet_from_css_rules( $css_rules = array() ) { + if ( ! class_exists( 'WP_Style_Engine' ) ) { + return ''; + } + + $css_rule_objects = array(); + + foreach ( $css_rules as $css_rule ) { + if ( empty( $css_rule['selector'] ) || empty( $css_rule['declarations'] ) || ! is_array( $css_rule['declarations'] ) ) { + continue; + } + $css_rule_objects[] = new WP_Style_Engine_CSS_Rule( $css_rule['selector'], $css_rule['declarations'] ); + } + + if ( empty( $css_rule_objects ) ) { + return ''; + } + + return WP_Style_Engine::compile_stylesheet_from_css_rules( $css_rule_objects ); } diff --git a/packages/style-engine/phpunit/class-wp-style-engine-css-rules-store-test.php b/packages/style-engine/phpunit/class-wp-style-engine-css-rules-store-test.php index 84dc6b5f2e82a1..9fe664752e4bff 100644 --- a/packages/style-engine/phpunit/class-wp-style-engine-css-rules-store-test.php +++ b/packages/style-engine/phpunit/class-wp-style-engine-css-rules-store-test.php @@ -14,6 +14,13 @@ * Tests for registering, storing and retrieving CSS Rules. */ class WP_Style_Engine_CSS_Rules_Store_Test extends WP_UnitTestCase { + /** + * Tear down after each test. + */ + public function tear_down() { + parent::tear_down(); + WP_Style_Engine_CSS_Rules_Store::remove_all_stores(); + } /** * Should create a new store. */ @@ -36,6 +43,41 @@ public function test_get_store() { $this->assertEquals( $selector, $the_same_fish_store->add_rule( $selector )->get_selector() ); } + /** + * Should return all previously created stores. + */ + public function test_get_stores() { + $burrito_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'burrito' ); + $quesadilla_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'quesadilla' ); + $this->assertEquals( + array( + 'burrito' => $burrito_store, + 'quesadilla' => $quesadilla_store, + ), + WP_Style_Engine_CSS_Rules_Store::get_stores() + ); + } + + /** + * Should delete all previously created stores. + */ + public function test_remove_all_stores() { + $dolmades_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'dolmades' ); + $tzatziki_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'tzatziki' ); + $this->assertEquals( + array( + 'dolmades' => $dolmades_store, + 'tzatziki' => $tzatziki_store, + ), + WP_Style_Engine_CSS_Rules_Store::get_stores() + ); + WP_Style_Engine_CSS_Rules_Store::remove_all_stores(); + $this->assertEquals( + array(), + WP_Style_Engine_CSS_Rules_Store::get_stores() + ); + } + /** * Should return a stored rule. */ diff --git a/packages/style-engine/phpunit/class-wp-style-engine-processor-test.php b/packages/style-engine/phpunit/class-wp-style-engine-processor-test.php index 8070024adf3133..ebee00f05ce16a 100644 --- a/packages/style-engine/phpunit/class-wp-style-engine-processor-test.php +++ b/packages/style-engine/phpunit/class-wp-style-engine-processor-test.php @@ -14,12 +14,35 @@ * Tests for compiling and rendering styles from a store of CSS rules. */ class WP_Style_Engine_Processor_Test extends WP_UnitTestCase { + /** + * Should compile CSS rules. + */ + public function test_return_rules_as_css() { + $a_nice_css_rule = new WP_Style_Engine_CSS_Rule( '.a-nice-rule' ); + $a_nice_css_rule->add_declarations( + array( + 'color' => 'var(--nice-color)', + 'background-color' => 'purple', + ) + ); + $a_nicer_css_rule = new WP_Style_Engine_CSS_Rule( '.a-nicer-rule' ); + $a_nicer_css_rule->add_declarations( + array( + 'font-family' => 'Nice sans', + 'font-size' => '1em', + 'background-color' => 'purple', + ) + ); + $a_nice_processor = new WP_Style_Engine_Processor(); + $a_nice_processor->add_rules( array( $a_nice_css_rule, $a_nicer_css_rule ) ); + $this->assertEquals( '.a-nice-rule {color: var(--nice-color); background-color: purple;}.a-nicer-rule {font-family: Nice sans; font-size: 1em; background-color: purple;}', $a_nice_processor->get_css() ); + } + /** * Should compile CSS rules from the store. */ public function test_return_store_rules_as_css() { - $a_nice_store = WP_Style_Engine_CSS_Rules_Store_Gutenberg::get_store( 'nice' ); - $a_nice_renderer = new WP_Style_Engine_Processor_Gutenberg( $a_nice_store ); + $a_nice_store = WP_Style_Engine_CSS_Rules_Store_Gutenberg::get_store( 'nice' ); $a_nice_store->add_rule( '.a-nice-rule' )->add_declarations( array( 'color' => 'var(--nice-color)', @@ -33,7 +56,8 @@ public function test_return_store_rules_as_css() { 'background-color' => 'purple', ) ); - + $a_nice_renderer = new WP_Style_Engine_Processor_Gutenberg(); + $a_nice_renderer->add_store( $a_nice_store ); $this->assertEquals( '.a-nice-rule {color: var(--nice-color); background-color: purple;}.a-nicer-rule {font-family: Nice sans; font-size: 1em; background-color: purple;}', $a_nice_renderer->get_css() ); } @@ -41,87 +65,101 @@ public function test_return_store_rules_as_css() { * Should merge CSS declarations. */ public function test_dedupe_and_merge_css_declarations() { - $an_excellent_store = WP_Style_Engine_CSS_Rules_Store_Gutenberg::get_store( 'excellent' ); - $an_excellent_renderer = new WP_Style_Engine_Processor_Gutenberg( $an_excellent_store ); - $an_excellent_store->add_rule( '.an-excellent-rule' )->add_declarations( + $an_excellent_rule = new WP_Style_Engine_CSS_Rule( '.an-excellent-rule' ); + $an_excellent_processor = new WP_Style_Engine_Processor(); + $an_excellent_rule->add_declarations( array( 'color' => 'var(--excellent-color)', 'border-style' => 'dotted', ) ); - $an_excellent_store->add_rule( '.an-excellent-rule' )->add_declarations( + $an_excellent_processor->add_rules( $an_excellent_rule ); + + $another_excellent_rule = new WP_Style_Engine_CSS_Rule( '.an-excellent-rule' ); + $another_excellent_rule->add_declarations( array( 'color' => 'var(--excellent-color)', 'border-style' => 'dotted', 'border-color' => 'brown', ) ); + $an_excellent_processor->add_rules( $another_excellent_rule ); + $this->assertEquals( '.an-excellent-rule {color: var(--excellent-color); border-style: dotted; border-color: brown;}', $an_excellent_processor->get_css() ); - $this->assertEquals( '.an-excellent-rule {color: var(--excellent-color); border-style: dotted; border-color: brown;}', $an_excellent_renderer->get_css() ); - - $an_excellent_store->add_rule( '.an-excellent-rule' )->add_declarations( + $yet_another_excellent_rule = new WP_Style_Engine_CSS_Rule( '.an-excellent-rule' ); + $yet_another_excellent_rule->add_declarations( array( 'color' => 'var(--excellent-color)', 'border-style' => 'dashed', 'border-width' => '2px', ) ); - - $this->assertEquals( '.an-excellent-rule {color: var(--excellent-color); border-style: dashed; border-color: brown; border-width: 2px;}', $an_excellent_renderer->get_css() ); + $an_excellent_processor->add_rules( $yet_another_excellent_rule ); + $this->assertEquals( '.an-excellent-rule {color: var(--excellent-color); border-style: dashed; border-color: brown; border-width: 2px;}', $an_excellent_processor->get_css() ); } /** * Should combine duplicate CSS rules. */ public function test_combine_css_rules() { - $a_sweet_store = WP_Style_Engine_CSS_Rules_Store_Gutenberg::get_store( 'sweet' ); - $a_sweet_renderer = new WP_Style_Engine_Processor_Gutenberg( $a_sweet_store ); - $a_sweet_store->add_rule( '.a-sweet-rule' )->add_declarations( + $a_sweet_rule = new WP_Style_Engine_CSS_Rule( + '.a-sweet-rule', array( 'color' => 'var(--sweet-color)', 'background-color' => 'purple', ) ); - $a_sweet_store->add_rule( '#an-even-sweeter-rule > marquee' )->add_declarations( + + $a_sweeter_rule = new WP_Style_Engine_CSS_Rule( + '#an-even-sweeter-rule > marquee', array( 'color' => 'var(--sweet-color)', 'background-color' => 'purple', ) ); - $this->assertEquals( '.a-sweet-rule,#an-even-sweeter-rule > marquee {color: var(--sweet-color); background-color: purple;}', $a_sweet_renderer->get_css() ); - } + $a_sweet_processor = new WP_Style_Engine_Processor(); + $a_sweet_processor->add_rules( array( $a_sweet_rule, $a_sweeter_rule ) ); - /** - * Should combine and store CSS rules. - */ - public function test_store_combined_css_rules() { - $a_lovely_store = WP_Style_Engine_CSS_Rules_Store_Gutenberg::get_store( 'lovely' ); - $a_lovely_renderer = new WP_Style_Engine_Processor_Gutenberg( $a_lovely_store ); - $a_lovely_store->add_rule( '.a-lovely-rule' )->add_declarations( + $this->assertEquals( '.a-sweet-rule,#an-even-sweeter-rule > marquee {color: var(--sweet-color); background-color: purple;}', $a_sweet_processor->get_css() ); + } + /** + * Should combine and store CSS rules. + */ + public function test_combine_previously_added_css_rules() { + $a_lovely_processor = new WP_Style_Engine_Processor(); + $a_lovely_rule = new WP_Style_Engine_CSS_Rule( + '.a-lovely-rule', array( 'border-color' => 'purple', ) ); - $a_lovely_store->add_rule( '.a-lovelier-rule' )->add_declarations( + $a_lovely_processor->add_rules( $a_lovely_rule ); + $a_lovelier_rule = new WP_Style_Engine_CSS_Rule( + '.a-lovelier-rule', array( 'border-color' => 'purple', ) ); + $a_lovely_processor->add_rules( $a_lovelier_rule ); + $this->assertEquals( '.a-lovely-rule,.a-lovelier-rule {border-color: purple;}', $a_lovely_processor->get_css() ); - $this->assertEquals( '.a-lovely-rule,.a-lovelier-rule {border-color: purple;}', $a_lovely_renderer->get_css() ); - - $a_lovely_store->add_rule( '.a-most-lovely-rule' )->add_declarations( + $a_most_lovely_rule = new WP_Style_Engine_CSS_Rule( + '.a-most-lovely-rule', array( 'border-color' => 'purple', ) ); - $a_lovely_store->add_rule( '.a-perfectly-lovely-rule' )->add_declarations( + $a_lovely_processor->add_rules( $a_most_lovely_rule ); + + $a_perfectly_lovely_rule = new WP_Style_Engine_CSS_Rule( + '.a-perfectly-lovely-rule', array( 'border-color' => 'purple', ) ); + $a_lovely_processor->add_rules( $a_perfectly_lovely_rule ); - $this->assertEquals( '.a-lovely-rule,.a-lovelier-rule,.a-most-lovely-rule,.a-perfectly-lovely-rule {border-color: purple;}', $a_lovely_renderer->get_css() ); + $this->assertEquals( '.a-lovely-rule,.a-lovelier-rule,.a-most-lovely-rule,.a-perfectly-lovely-rule {border-color: purple;}', $a_lovely_processor->get_css() ); } } diff --git a/packages/style-engine/phpunit/class-wp-style-engine-test.php b/packages/style-engine/phpunit/class-wp-style-engine-test.php index 81ca7f931f7644..14938e075fa260 100644 --- a/packages/style-engine/phpunit/class-wp-style-engine-test.php +++ b/packages/style-engine/phpunit/class-wp-style-engine-test.php @@ -6,44 +6,55 @@ * @subpackage style-engine */ +require __DIR__ . '/../class-wp-style-engine-processor.php'; require __DIR__ . '/../class-wp-style-engine-css-declarations.php'; +require __DIR__ . '/../class-wp-style-engine-css-rule.php'; +require __DIR__ . '/../class-wp-style-engine-css-rules-store.php'; require __DIR__ . '/../class-wp-style-engine.php'; /** * Tests for registering, storing and generating styles. */ class WP_Style_Engine_Test extends WP_UnitTestCase { + /** + * Tear down after each test. + */ + public function tear_down() { + parent::tear_down(); + WP_Style_Engine_CSS_Rules_Store::remove_all_stores(); + } + /** * Tests generating block styles and classnames based on various manifestations of the $block_styles argument. * - * @dataProvider data_generate_block_supports_styles_fixtures + * @dataProvider data_get_styles_fixtures * - * @param array $block_styles The incoming block styles object. - * @param array $options Style engine options. + * @param array $block_styles The incoming block styles object. + * @param array $options Style engine options. * @param string $expected_output The expected output. */ - public function test_generate_block_supports_styles( $block_styles, $options, $expected_output ) { + public function test_generate_get_styles( $block_styles, $options, $expected_output ) { $generated_styles = wp_style_engine_get_styles( $block_styles, $options ); $this->assertSame( $expected_output, $generated_styles ); } /** - * Data provider. + * Data provider for test_generate_get_styles(). * * @return array */ - public function data_generate_block_supports_styles_fixtures() { + public function data_get_styles_fixtures() { return array( 'default_return_value' => array( 'block_styles' => array(), 'options' => null, - 'expected_output' => null, + 'expected_output' => array(), ), 'inline_invalid_block_styles_empty' => array( 'block_styles' => 'hello world!', 'options' => null, - 'expected_output' => null, + 'expected_output' => array(), ), 'inline_invalid_block_styles_unknown_style' => array( @@ -72,7 +83,7 @@ public function data_generate_block_supports_styles_fixtures() { 'expected_output' => array(), ), - 'valid_inline_css_and_classnames' => array( + 'valid_inline_css_and_classnames_as_default_context' => array( 'block_styles' => array( 'color' => array( 'text' => 'var:preset|color|texas-flood', @@ -100,6 +111,44 @@ public function data_generate_block_supports_styles_fixtures() { ), ), + 'valid_inline_css_and_classnames_with_context' => array( + 'block_styles' => array( + 'color' => array( + 'text' => 'var:preset|color|little-lamb', + ), + 'spacing' => array( + 'margin' => '20px', + ), + ), + 'options' => array( + 'convert_vars_to_classnames' => true, + 'context' => 'block-supports', + ), + 'expected_output' => array( + 'css' => 'margin: 20px;', + 'declarations' => array( + 'margin' => '20px', + ), + 'classnames' => 'has-text-color has-little-lamb-color', + ), + ), + + 'invalid_context' => array( + 'block_styles' => array( + 'color' => array( + 'text' => 'var:preset|color|sugar', + ), + 'spacing' => array( + 'padding' => '20000px', + ), + ), + 'options' => array( + 'convert_vars_to_classnames' => true, + 'context' => 'i-love-doughnuts', + ), + 'expected_output' => array(), + ), + 'inline_valid_box_model_style' => array( 'block_styles' => array( 'spacing' => array( @@ -187,7 +236,7 @@ public function data_generate_block_supports_styles_fixtures() { ), 'options' => array( 'selector' => '.wp-selector > p' ), 'expected_output' => array( - 'css' => '.wp-selector > p { padding-top: 42px; padding-left: 2%; padding-bottom: 44px; padding-right: 5rem; }', + 'css' => '.wp-selector > p {padding-top: 42px; padding-left: 2%; padding-bottom: 44px; padding-right: 5rem;}', 'declarations' => array( 'padding-top' => '42px', 'padding-left' => '2%', @@ -207,7 +256,7 @@ public function data_generate_block_supports_styles_fixtures() { 'selector' => '.wp-selector', ), 'expected_output' => array( - 'css' => '.wp-selector { color: var(--wp--preset--color--my-little-pony); }', + 'css' => '.wp-selector {color: var(--wp--preset--color--my-little-pony);}', 'declarations' => array( 'color' => 'var(--wp--preset--color--my-little-pony)', ), @@ -458,4 +507,128 @@ public function data_generate_block_supports_styles_fixtures() { ), ); } + + /** + * Tests adding rules to a store and retrieving a generated stylesheet. + */ + public function test_enqueue_block_styles_store() { + $block_styles = array( + 'spacing' => array( + 'padding' => array( + 'top' => '42px', + 'left' => '2%', + 'bottom' => '44px', + 'right' => '5rem', + ), + ), + ); + + $generated_styles = wp_style_engine_get_styles( + $block_styles, + array( + 'enqueue' => true, + 'context' => 'block-supports', + 'selector' => 'article', + ) + ); + $store = WP_Style_Engine::get_instance()::get_store( 'block-supports' ); + $rule = $store->get_all_rules()['article']; + $this->assertSame( $generated_styles['css'], $rule->get_css() ); + } + + /** + * Tests adding rules to a store and retrieving a generated stylesheet. + */ + public function test_add_to_store() { + $store = wp_style_engine_add_to_store( 'test-store', array() ); + + // wp_style_engine_add_to_store returns a store object. + $this->assertInstanceOf( 'WP_Style_Engine_CSS_Rules_Store', $store ); + + // Check that the style engine knows about the store. + $stored_store = WP_Style_Engine::get_instance()::get_store( 'test-store' ); + $this->assertInstanceOf( 'WP_Style_Engine_CSS_Rules_Store', $stored_store ); + } + + /** + * Tests retrieving a generated stylesheet from any rules. + */ + public function test_get_stylesheet_from_css_rules() { + $css_rules = array( + array( + 'selector' => '.saruman', + 'declarations' => array( + 'color' => 'white', + 'height' => '100px', + 'border-style' => 'solid', + 'align-self' => 'unset', + ), + ), + array( + 'selector' => '.gandalf', + 'declarations' => array( + 'color' => 'grey', + 'height' => '90px', + 'border-style' => 'dotted', + 'align-self' => 'safe center', + ), + ), + array( + 'selector' => '.radagast', + 'declarations' => array( + 'color' => 'brown', + 'height' => '60px', + 'border-style' => 'dashed', + 'align-self' => 'stretch', + ), + ), + ); + + $compiled_stylesheet = wp_style_engine_get_stylesheet_from_css_rules( $css_rules ); + $this->assertSame( '.saruman {color: white; height: 100px; border-style: solid; align-self: unset;}.gandalf {color: grey; height: 90px; border-style: dotted; align-self: safe center;}.radagast {color: brown; height: 60px; border-style: dashed; align-self: stretch;}', $compiled_stylesheet ); + } + + /** + * Tests that incoming styles are deduped and merged. + */ + public function test_get_deduped_and_merged_stylesheet() { + $css_rules = array( + array( + 'selector' => '.gandalf', + 'declarations' => array( + 'color' => 'grey', + 'height' => '90px', + 'border-style' => 'dotted', + ), + ), + array( + 'selector' => '.gandalf', + 'declarations' => array( + 'color' => 'white', + 'height' => '190px', + 'padding' => '10px', + 'margin-bottom' => '100px', + ), + ), + array( + 'selector' => '.dumbledore', + 'declarations' => array( + 'color' => 'grey', + 'height' => '90px', + 'border-style' => 'dotted', + ), + ), + array( + 'selector' => '.rincewind', + 'declarations' => array( + 'color' => 'grey', + 'height' => '90px', + 'border-style' => 'dotted', + ), + ), + ); + + $compiled_stylesheet = wp_style_engine_get_stylesheet_from_css_rules( $css_rules ); + $this->assertSame( '.gandalf {color: white; height: 190px; border-style: dotted; padding: 10px; margin-bottom: 100px;}.dumbledore,.rincewind {color: grey; height: 90px; border-style: dotted;}', $compiled_stylesheet ); + } } From 56bd25a1a3b364db0761384f88afc951632e0cb0 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Tue, 2 Aug 2022 12:38:17 +0900 Subject: [PATCH 066/104] Components: Add missing font sizes (#42844) * Components: Add missing font sizes * Add changelog * Update snapshot --- packages/components/CHANGELOG.md | 1 + packages/components/src/custom-select-control/style.scss | 1 + packages/components/src/date-time/time/styles.ts | 4 +++- packages/components/src/ui/tooltip/styles.js | 1 + .../src/ui/tooltip/test/__snapshots__/index.js.snap | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 56956bbeada9dd..9f5289942129f6 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -6,6 +6,7 @@ - `BorderControl`: Ensure box-sizing is reset for the control ([#42754](https://github.com/WordPress/gutenberg/pull/42754)). - `InputControl`: Fix acceptance of falsy values in controlled updates ([#42484](https://github.com/WordPress/gutenberg/pull/42484/)). +- `Tooltip (Experimental)`, `CustomSelectControl`, `TimePicker`: Add missing font-size styles which were necessary in non-WordPress contexts ([#42844](https://github.com/WordPress/gutenberg/pull/42844/)). ### Enhancements diff --git a/packages/components/src/custom-select-control/style.scss b/packages/components/src/custom-select-control/style.scss index 1130763451a630..507983f20ee2c4 100644 --- a/packages/components/src/custom-select-control/style.scss +++ b/packages/components/src/custom-select-control/style.scss @@ -1,5 +1,6 @@ .components-custom-select-control { position: relative; + font-size: $default-font-size; } .components-custom-select-control__label { diff --git a/packages/components/src/date-time/time/styles.ts b/packages/components/src/date-time/time/styles.ts index 7bd3377376d9f9..1e7de446bdc286 100644 --- a/packages/components/src/date-time/time/styles.ts +++ b/packages/components/src/date-time/time/styles.ts @@ -17,7 +17,9 @@ import NumberControl from '../../number-control'; import SelectControl from '../../select-control'; import { Select } from '../../select-control/styles/select-control-styles'; -export const Wrapper = styled.div``; +export const Wrapper = styled.div` + font-size: ${ CONFIG.fontSize }; +`; export const Fieldset = styled.fieldset` border: 0; diff --git a/packages/components/src/ui/tooltip/styles.js b/packages/components/src/ui/tooltip/styles.js index c1d535bb782927..fca4875a9d1c17 100644 --- a/packages/components/src/ui/tooltip/styles.js +++ b/packages/components/src/ui/tooltip/styles.js @@ -20,6 +20,7 @@ export const TooltipContent = css` outline: none; transform-origin: top center; transition: opacity ${ CONFIG.transitionDurationFastest } ease; + font-size: ${ CONFIG.fontSize }; &[data-enter] { opacity: 1; diff --git a/packages/components/src/ui/tooltip/test/__snapshots__/index.js.snap b/packages/components/src/ui/tooltip/test/__snapshots__/index.js.snap index 7e9248a65c04d4..60edeba1681a25 100644 --- a/packages/components/src/ui/tooltip/test/__snapshots__/index.js.snap +++ b/packages/components/src/ui/tooltip/test/__snapshots__/index.js.snap @@ -9,6 +9,7 @@ exports[`props should render correctly 1`] = ` transform-origin: top center; -webkit-transition: opacity 100ms ease; transition: opacity 100ms ease; + font-size: 13px; } .emotion-0[data-enter] { From d0bbcf6bdee1af72d31e3ca643cbbe96d1b438af Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 2 Aug 2022 06:58:03 +0200 Subject: [PATCH 067/104] External link component: Add a check for on page anchor links (#42259) * Add a check for on page anchor links * Update index.tsx * Update CHANGELOG.md --- packages/components/CHANGELOG.md | 1 + packages/components/src/external-link/index.tsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 9f5289942129f6..4196d8be8f5524 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -4,6 +4,7 @@ ### Bug Fix +- `ExternalLink`: Check if the link is an internal anchor link and prevent anchor links from being opened. ([#42259](https://github.com/WordPress/gutenberg/pull/42259)). - `BorderControl`: Ensure box-sizing is reset for the control ([#42754](https://github.com/WordPress/gutenberg/pull/42754)). - `InputControl`: Fix acceptance of falsy values in controlled updates ([#42484](https://github.com/WordPress/gutenberg/pull/42484/)). - `Tooltip (Experimental)`, `CustomSelectControl`, `TimePicker`: Add missing font-size styles which were necessary in non-WordPress contexts ([#42844](https://github.com/WordPress/gutenberg/pull/42844/)). diff --git a/packages/components/src/external-link/index.tsx b/packages/components/src/external-link/index.tsx index 56e9a8494a184c..d034d0b0d83386 100644 --- a/packages/components/src/external-link/index.tsx +++ b/packages/components/src/external-link/index.tsx @@ -38,12 +38,22 @@ function UnforwardedExternalLink( ), ].join( ' ' ); const classes = classnames( 'components-external-link', className ); + /* Anchor links are percieved as external links. + This constant helps check for on page anchor links, + to prevent them from being opened in the editor. */ + const isInternalAnchor = !! href?.startsWith( '#' ); + return ( /* eslint-disable react/jsx-no-target-blank */ event.preventDefault() + : undefined + } target="_blank" rel={ optimizedRel } ref={ ref } From 53bb298aa907ef99f3b5e9a9ff3d527505c32486 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Tue, 2 Aug 2022 17:24:26 +0900 Subject: [PATCH 068/104] Create Block: update document links in templates (#42839) --- .../block-templates/edit.js.mustache | 4 ++-- .../block-templates/save.js.mustache | 4 ++-- .../create-block/lib/templates/block/edit.js.mustache | 6 +++--- .../create-block/lib/templates/block/save.js.mustache | 6 +++--- packages/create-block/lib/templates/es5/index.js.mustache | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/create-block-tutorial-template/block-templates/edit.js.mustache b/packages/create-block-tutorial-template/block-templates/edit.js.mustache index ea37df4c9aeb5c..af0cb1629f62f2 100644 --- a/packages/create-block-tutorial-template/block-templates/edit.js.mustache +++ b/packages/create-block-tutorial-template/block-templates/edit.js.mustache @@ -9,7 +9,7 @@ import { TextControl } from '@wordpress/components'; * React hook that is used to mark the block wrapper element. * It provides all the necessary props like the class name. * - * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops */ import { useBlockProps } from '@wordpress/block-editor'; @@ -17,7 +17,7 @@ import { useBlockProps } from '@wordpress/block-editor'; * The edit function describes the structure of your block in the context of the * editor. This represents what the editor will render when the block is used. * - * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit * * @param {Object} props Properties passed to the function. * @param {Object} props.attributes Available block attributes. diff --git a/packages/create-block-tutorial-template/block-templates/save.js.mustache b/packages/create-block-tutorial-template/block-templates/save.js.mustache index 29cbc91450c02c..605c5165c35b0f 100644 --- a/packages/create-block-tutorial-template/block-templates/save.js.mustache +++ b/packages/create-block-tutorial-template/block-templates/save.js.mustache @@ -2,7 +2,7 @@ * React hook that is used to mark the block wrapper element. * It provides all the necessary props like the class name. * - * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops */ import { useBlockProps } from '@wordpress/block-editor'; @@ -11,7 +11,7 @@ import { useBlockProps } from '@wordpress/block-editor'; * be combined into the final markup, which is then serialized by the block * editor into `post_content`. * - * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#save + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save * * @param {Object} props Properties passed to the function. * @param {Object} props.attributes Available block attributes. diff --git a/packages/create-block/lib/templates/block/edit.js.mustache b/packages/create-block/lib/templates/block/edit.js.mustache index 8ed2bb5d381980..89574380a3c2e3 100644 --- a/packages/create-block/lib/templates/block/edit.js.mustache +++ b/packages/create-block/lib/templates/block/edit.js.mustache @@ -1,7 +1,7 @@ /** * Retrieves the translation of text. * - * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/ + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ */ import { __ } from '@wordpress/i18n'; @@ -9,7 +9,7 @@ import { __ } from '@wordpress/i18n'; * React hook that is used to mark the block wrapper element. * It provides all the necessary props like the class name. * - * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops */ import { useBlockProps } from '@wordpress/block-editor'; @@ -25,7 +25,7 @@ import './editor.scss'; * The edit function describes the structure of your block in the context of the * editor. This represents what the editor will render when the block is used. * - * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit * * @return {WPElement} Element to render. */ diff --git a/packages/create-block/lib/templates/block/save.js.mustache b/packages/create-block/lib/templates/block/save.js.mustache index 4493a836019ee8..705e06973e6de0 100644 --- a/packages/create-block/lib/templates/block/save.js.mustache +++ b/packages/create-block/lib/templates/block/save.js.mustache @@ -1,7 +1,7 @@ /** * Retrieves the translation of text. * - * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/ + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ */ import { __ } from '@wordpress/i18n'; @@ -9,7 +9,7 @@ import { __ } from '@wordpress/i18n'; * React hook that is used to mark the block wrapper element. * It provides all the necessary props like the class name. * - * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops */ import { useBlockProps } from '@wordpress/block-editor'; @@ -18,7 +18,7 @@ import { useBlockProps } from '@wordpress/block-editor'; * be combined into the final markup, which is then serialized by the block * editor into `post_content`. * - * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#save + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save * * @return {WPElement} Element to render. */ diff --git a/packages/create-block/lib/templates/es5/index.js.mustache b/packages/create-block/lib/templates/es5/index.js.mustache index 10a6939465d0e2..89ea222570061d 100644 --- a/packages/create-block/lib/templates/es5/index.js.mustache +++ b/packages/create-block/lib/templates/es5/index.js.mustache @@ -16,14 +16,14 @@ /** * Retrieves the translation of text. * - * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/ + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ */ var __ = wp.i18n.__; /** * This hook is used to mark the block wrapper element. * - * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps + * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops */ var useBlockProps = wp.blockEditor.useBlockProps; @@ -84,7 +84,7 @@ * The edit function describes the structure of your block in the context of the editor. * This represents what the editor will render when the block is used. * - * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit * * @return {WPElement} Element to render. */ @@ -100,7 +100,7 @@ * The save function defines the way in which the different attributes should be combined * into the final markup, which is then serialized by the block editor into `post_content`. * - * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#save + * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save * * @return {WPElement} Element to render. */ From 80be633c19b341f603329ec0c37671ae2e84026f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= <4710635+ellatrix@users.noreply.github.com> Date: Tue, 2 Aug 2022 10:24:50 +0200 Subject: [PATCH 069/104] List v2: fix Cmd+A (#42858) --- .../block-editor/src/components/writing-flow/use-select-all.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/writing-flow/use-select-all.js b/packages/block-editor/src/components/writing-flow/use-select-all.js index 7af6b1598fc66e..15473e3a201c78 100644 --- a/packages/block-editor/src/components/writing-flow/use-select-all.js +++ b/packages/block-editor/src/components/writing-flow/use-select-all.js @@ -19,7 +19,7 @@ import { store as blockEditorStore } from '../../store'; export default function useSelectAll() { const { getBlockOrder, getSelectedBlockClientIds, getBlockRootClientId } = useSelect( blockEditorStore ); - const { multiSelect } = useDispatch( blockEditorStore ); + const { multiSelect, selectBlock } = useDispatch( blockEditorStore ); const isMatch = useShortcutEventMatch(); return useRefEffect( ( node ) => { @@ -53,6 +53,7 @@ export default function useSelectAll() { const lastClientId = last( blockClientIds ); if ( firstClientId === lastClientId ) { + selectBlock( firstClientId ); return; } From dcbcbfb93569f1c3b7b8598820040d115fe6848c Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Tue, 2 Aug 2022 16:30:55 +0800 Subject: [PATCH 070/104] Prevent multiselection via dragging when already dragging blocks (#42877) --- .../src/components/writing-flow/use-drag-selection.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/writing-flow/use-drag-selection.js b/packages/block-editor/src/components/writing-flow/use-drag-selection.js index df5ab145b2c16b..87d5e93f90994e 100644 --- a/packages/block-editor/src/components/writing-flow/use-drag-selection.js +++ b/packages/block-editor/src/components/writing-flow/use-drag-selection.js @@ -27,7 +27,7 @@ function setContentEditableWrapper( node, value ) { export default function useDragSelection() { const { startMultiSelect, stopMultiSelect } = useDispatch( blockEditorStore ); - const { isSelectionEnabled, hasMultiSelection } = + const { isSelectionEnabled, hasMultiSelection, isDraggingBlocks } = useSelect( blockEditorStore ); return useRefEffect( ( node ) => { @@ -72,6 +72,12 @@ export default function useDragSelection() { } function onMouseLeave( { buttons, target } ) { + // Avoid triggering a multi-selection if the user is already + // dragging blocks. + if ( isDraggingBlocks() ) { + return; + } + // The primary button must be pressed to initiate selection. // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons if ( buttons !== 1 ) { From 784b33105930d9c171e3d72daa2a706d5db08b6d Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Tue, 2 Aug 2022 09:50:17 +0100 Subject: [PATCH 071/104] Query Pagination: Correctly position the "next" link on the first page. (#42764) * Move the next link to the right when it's the only one displayed * add explanatory comment * use margin-inline-start for RTL * Add margin-inline-end to the previous link * restrict CSS to first and last children --- .../block-library/src/query-pagination/style.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/block-library/src/query-pagination/style.scss b/packages/block-library/src/query-pagination/style.scss index 95da9e1231f5d6..db5e90232532d0 100644 --- a/packages/block-library/src/query-pagination/style.scss +++ b/packages/block-library/src/query-pagination/style.scss @@ -13,6 +13,20 @@ $pagination-margin: 0.5em; margin-right: 0; } } + + // This moves the next link to the right side of the container, + // which is important when it's the only block displayed + // and the block has a "space-between" justification. + &.is-content-justification-space-between { + > .wp-block-query-pagination-next:last-child { + margin-inline-start: auto; + } + > .wp-block-query-pagination-previous:first-child { + margin-inline-end: auto; + } + } + + .wp-block-query-pagination-previous-arrow { margin-right: 1ch; display: inline-block; // Needed so that the transform works. From 8b9db3dc025f73e9dad9b076c6f14394b898a9b5 Mon Sep 17 00:00:00 2001 From: James Koster Date: Tue, 2 Aug 2022 10:07:48 +0100 Subject: [PATCH 072/104] Update color button style (#41838) * Removed fixed height * Truncate color name and add title attribute Results in better support of extra long color names. --- .../src/components/colors-gradients/dropdown.js | 7 ++++++- .../src/components/colors-gradients/style.scss | 16 +++++++++++++++- .../components/global-styles/screen-colors.js | 16 ++++++++++++---- .../src/components/global-styles/style.scss | 8 ++++++++ 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/packages/block-editor/src/components/colors-gradients/dropdown.js b/packages/block-editor/src/components/colors-gradients/dropdown.js index e44ed72775ef2e..4349cbb6f49cae 100644 --- a/packages/block-editor/src/components/colors-gradients/dropdown.js +++ b/packages/block-editor/src/components/colors-gradients/dropdown.js @@ -61,7 +61,12 @@ const LabeledColorIndicator = ( { colorValue, label } ) => ( className="block-editor-panel-color-gradient-settings__color-indicator" colorValue={ colorValue } /> - { label } + + { label } + ); diff --git a/packages/block-editor/src/components/colors-gradients/style.scss b/packages/block-editor/src/components/colors-gradients/style.scss index c024d8eaad20ad..fcbdaef266107a 100644 --- a/packages/block-editor/src/components/colors-gradients/style.scss +++ b/packages/block-editor/src/components/colors-gradients/style.scss @@ -58,6 +58,7 @@ $swatch-gap: 12px; */ .block-editor-tools-panel-color-gradient-settings__item { padding: 0; + max-width: 100%; // Border styles. border-left: 1px solid rgba(0, 0, 0, 0.1); @@ -87,17 +88,30 @@ $swatch-gap: 12px; padding: 0; > button { - height: 46px; + height: auto; + padding-top: $grid-unit * 1.25; + padding-bottom: $grid-unit * 1.25; + text-align: left; &.is-open { background: $gray-100; color: var(--wp-admin-theme-color); } } + + .block-editor-panel-color-gradient-settings__color-name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } .block-editor-panel-color-gradient-settings__dropdown { width: 100%; + + .component-color-indicator { + flex-shrink: 0; + } } .block-editor-color-gradient-control__tab-panel { diff --git a/packages/edit-site/src/components/global-styles/screen-colors.js b/packages/edit-site/src/components/global-styles/screen-colors.js index d11d863b46f46e..b6af8f40095e69 100644 --- a/packages/edit-site/src/components/global-styles/screen-colors.js +++ b/packages/edit-site/src/components/global-styles/screen-colors.js @@ -45,7 +45,9 @@ function BackgroundColorItem( { name, parentMenu } ) { data-testid="background-color-indicator" /> - { __( 'Background' ) } + + { __( 'Background' ) } + ); @@ -72,7 +74,9 @@ function TextColorItem( { name, parentMenu } ) { data-testid="text-color-indicator" /> - { __( 'Text' ) } + + { __( 'Text' ) } + ); @@ -102,7 +106,9 @@ function LinkColorItem( { name, parentMenu } ) { - { __( 'Links' ) } + + { __( 'Links' ) } + ); @@ -129,7 +135,9 @@ function ButtonColorItem( { name, parentMenu } ) { - { __( 'Buttons' ) } + + { __( 'Buttons' ) } + ); diff --git a/packages/edit-site/src/components/global-styles/style.scss b/packages/edit-site/src/components/global-styles/style.scss index 31f6c6f888027e..f94a6dcc1620a1 100644 --- a/packages/edit-site/src/components/global-styles/style.scss +++ b/packages/edit-site/src/components/global-styles/style.scss @@ -41,6 +41,7 @@ .component-color-indicator { // Show a diagonal line (crossed out) for empty swatches. background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%); + flex-shrink: 0; } } @@ -107,4 +108,11 @@ .edit-site-global-styles__color-indicator-wrapper { // Match the height of the rest of the icons (24px). height: $grid-unit * 3; + flex-shrink: 0; +} + +.edit-site-global-styles__color-label { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } From 3c2aa4075e84790fabbc0a00779a499f36173c11 Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Tue, 2 Aug 2022 13:21:10 +0300 Subject: [PATCH 073/104] Lodash: Refactor away from _.flatMap() (#42360) --- .eslintrc.js | 1 + packages/block-library/src/list/v2/transforms.js | 10 +--------- tools/webpack/packages.js | 6 ++---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a5c1d80254f7c7..5f88587b915c22 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -93,6 +93,7 @@ module.exports = { 'findIndex', 'findKey', 'findLast', + 'flatMap', 'flatten', 'flattenDeep', 'fromPairs', diff --git a/packages/block-library/src/list/v2/transforms.js b/packages/block-library/src/list/v2/transforms.js index ab23c4c75cd916..ba5514815fc72d 100644 --- a/packages/block-library/src/list/v2/transforms.js +++ b/packages/block-library/src/list/v2/transforms.js @@ -1,11 +1,3 @@ -/** - * WordPress dependencies - */ -/** - * External dependencies - */ -import { flatMap } from 'lodash'; - /** * WordPress dependencies */ @@ -39,7 +31,7 @@ function getListContentSchema( { phrasingContentSchema } ) { } function getListContentFlat( blocks ) { - return flatMap( blocks, ( { name, attributes, innerBlocks = [] } ) => { + return blocks.flatMap( ( { name, attributes, innerBlocks = [] } ) => { if ( name === 'core/list-item' ) { return [ attributes.content, ...getListContentFlat( innerBlocks ) ]; } diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 0b145fef2ebfd7..7d463a78258c70 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -3,7 +3,6 @@ */ const CopyWebpackPlugin = require( 'copy-webpack-plugin' ); const { join } = require( 'path' ); -const { flatMap } = require( 'lodash' ); /** * WordPress dependencies @@ -105,9 +104,8 @@ const vendors = { 'react-dom/umd/react-dom.production.min.js', ], }; -const vendorsCopyConfig = flatMap( - vendors, - ( [ devFilename, prodFilename ], key ) => { +const vendorsCopyConfig = Object.entries( vendors ).flatMap( + ( [ key, [ devFilename, prodFilename ] ] ) => { return [ { from: `node_modules/${ devFilename }`, From 9994ad16cf4f343bcdbd8958a2011af105347068 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Tue, 2 Aug 2022 11:48:53 +0100 Subject: [PATCH 074/104] Navigation block: Extract navigation block utils (#42865) * Move detectColors to utils * import detect colors --- .../src/navigation/edit/index.js | 28 +---------------- .../src/navigation/edit/utils.js | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 packages/block-library/src/navigation/edit/utils.js diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index 6ef396e3eac321..5e03b859e481fd 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -62,33 +62,7 @@ import useConvertClassicToBlockMenu, { } from './use-convert-classic-menu-to-block-menu'; import useCreateNavigationMenu from './use-create-navigation-menu'; import { useInnerBlocks } from './use-inner-blocks'; - -function getComputedStyle( node ) { - return node.ownerDocument.defaultView.getComputedStyle( node ); -} - -function detectColors( colorsDetectionElement, setColor, setBackground ) { - if ( ! colorsDetectionElement ) { - return; - } - setColor( getComputedStyle( colorsDetectionElement ).color ); - - let backgroundColorNode = colorsDetectionElement; - let backgroundColor = - getComputedStyle( backgroundColorNode ).backgroundColor; - while ( - backgroundColor === 'rgba(0, 0, 0, 0)' && - backgroundColorNode.parentNode && - backgroundColorNode.parentNode.nodeType === - backgroundColorNode.parentNode.ELEMENT_NODE - ) { - backgroundColorNode = backgroundColorNode.parentNode; - backgroundColor = - getComputedStyle( backgroundColorNode ).backgroundColor; - } - - setBackground( backgroundColor ); -} +import { detectColors } from './utils'; function Navigation( { attributes, diff --git a/packages/block-library/src/navigation/edit/utils.js b/packages/block-library/src/navigation/edit/utils.js new file mode 100644 index 00000000000000..b152d9874e8e97 --- /dev/null +++ b/packages/block-library/src/navigation/edit/utils.js @@ -0,0 +1,30 @@ +function getComputedStyle( node ) { + return node.ownerDocument.defaultView.getComputedStyle( node ); +} + +export function detectColors( + colorsDetectionElement, + setColor, + setBackground +) { + if ( ! colorsDetectionElement ) { + return; + } + setColor( getComputedStyle( colorsDetectionElement ).color ); + + let backgroundColorNode = colorsDetectionElement; + let backgroundColor = + getComputedStyle( backgroundColorNode ).backgroundColor; + while ( + backgroundColor === 'rgba(0, 0, 0, 0)' && + backgroundColorNode.parentNode && + backgroundColorNode.parentNode.nodeType === + backgroundColorNode.parentNode.ELEMENT_NODE + ) { + backgroundColorNode = backgroundColorNode.parentNode; + backgroundColor = + getComputedStyle( backgroundColorNode ).backgroundColor; + } + + setBackground( backgroundColor ); +} From 3cfc058a1cde8fa2078757973e9beceae16dc77d Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Tue, 2 Aug 2022 13:05:51 +0200 Subject: [PATCH 075/104] Popover: fix arrow placement and design (#42874) * Popover: fix arrow logic, use SVG to render triangle * CHANGELOG * Add RTL support * Use modifier classes instead of traditional BEM * Use full classnames for triangle SVG * Use SCSS variable instead of CSS custom property --- packages/components/CHANGELOG.md | 1 + packages/components/src/popover/index.js | 58 ++++++++++++------- packages/components/src/popover/style.scss | 66 ++++++++++++++++++++-- 3 files changed, 100 insertions(+), 25 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 4196d8be8f5524..2fbc3447917a1e 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -8,6 +8,7 @@ - `BorderControl`: Ensure box-sizing is reset for the control ([#42754](https://github.com/WordPress/gutenberg/pull/42754)). - `InputControl`: Fix acceptance of falsy values in controlled updates ([#42484](https://github.com/WordPress/gutenberg/pull/42484/)). - `Tooltip (Experimental)`, `CustomSelectControl`, `TimePicker`: Add missing font-size styles which were necessary in non-WordPress contexts ([#42844](https://github.com/WordPress/gutenberg/pull/42844/)). +- `Popover`: fix arrow placement and design ([#42874](https://github.com/WordPress/gutenberg/pull/42874/)). ### Enhancements diff --git a/packages/components/src/popover/index.js b/packages/components/src/popover/index.js index 0b9e3f0a981772..c3f56c93895fe5 100644 --- a/packages/components/src/popover/index.js +++ b/packages/components/src/popover/index.js @@ -32,6 +32,7 @@ import { } from '@wordpress/compose'; import { close } from '@wordpress/icons'; import deprecated from '@wordpress/deprecated'; +import { Path, SVG } from '@wordpress/primitives'; /** * Internal dependencies @@ -48,6 +49,30 @@ import { getAnimateClassName } from '../animate'; */ const SLOT_NAME = 'Popover'; +// An SVG displaying a triangle facing down, filled with a solid +// color and bordered in such a way to create an arrow-like effect. +// Keeping the SVG's viewbox squared simplify the arrow positioning +// calculations. +const ArrowTriangle = ( props ) => ( + + + + +); + const slotNameContext = createContext(); const positionToPlacement = ( position ) => { @@ -266,12 +291,7 @@ const Popover = ( placement: usedPlacement, middleware: middlewares, } ); - const staticSide = { - top: 'bottom', - right: 'left', - bottom: 'top', - left: 'right', - }[ placementData.split( '-' )[ 0 ] ]; + const mergedRefs = useMergeRefs( [ floating, dialogRef, ref ] ); // Updates references @@ -407,22 +427,22 @@ const Popover = (
{ children }
{ hasArrow && (
+ > + +
) }
); diff --git a/packages/components/src/popover/style.scss b/packages/components/src/popover/style.scss index 6002139c2c8566..00639f67216781 100644 --- a/packages/components/src/popover/style.scss +++ b/packages/components/src/popover/style.scss @@ -1,3 +1,5 @@ +$arrow-triangle-base-size: 14px; + .components-popover { z-index: z-index(".components-popover"); @@ -60,12 +62,64 @@ .components-popover__arrow { position: absolute; - background: $gray-400; - width: 8px; - height: 8px; - transform: rotate(45deg); - z-index: -1; + width: $arrow-triangle-base-size; + height: $arrow-triangle-base-size; + pointer-events: none; + + // Thin line that helps to make sure that the underlying + // popover__content's outline is fully overlapped by the + // arrow + &::before { + content: ""; + position: absolute; + top: -1px; + left: 0; + height: 2px; + width: 100%; + background-color: $white; + } + + // Position and rotate the arrow depending on the popover's placement. + // The `!important' is necessary to override the inline styles. + &.is-top { + bottom: -1 * $arrow-triangle-base-size !important; + transform: rotate(0); + } + &.is-right { + /*rtl:begin:ignore*/ + left: -1 * $arrow-triangle-base-size !important; + transform: rotate(90deg); + } + &.is-bottom { + top: -1 * $arrow-triangle-base-size !important; + transform: rotate(180deg); + } + &.is-left { + /*rtl:begin:ignore*/ + right: -1 * $arrow-triangle-base-size !important; + transform: rotate(-90deg); + /*rtl:end:ignore*/ + } +} + +.components-popover__triangle { + position: absolute; + height: 100%; + width: 100%; +} + +.components-popover__triangle-bg { + // Fill color is the same as the .components-popover__content's background + fill: $white; +} + +.components-popover__triangle-border { + // Stroke colors are the same as the .components-popover__content's outline + fill: transparent; + stroke-width: $border-width; + stroke: $gray-400; + .is-alternate & { - background: $gray-900; + stroke: $gray-900; } } From 9171278788274c9dc85a0c3e11f913424cbda43d Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Tue, 2 Aug 2022 14:59:41 +0200 Subject: [PATCH 076/104] Try: Tab style subpixel fix. (#42892) --- packages/components/src/panel/style.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/src/panel/style.scss b/packages/components/src/panel/style.scss index 890a72c6add48f..500e5e6fd1a798 100644 --- a/packages/components/src/panel/style.scss +++ b/packages/components/src/panel/style.scss @@ -35,9 +35,12 @@ justify-content: space-between; align-items: center; padding: 0 $grid-unit-20; - height: $grid-unit-60; border-bottom: $border-width solid $gray-300; + // This helps ensure the correct panel height, including the border, avoiding subpixel rounding issues. + box-sizing: content-box; + height: $grid-unit-60 - $border-width; + h2 { margin: 0; font-size: inherit; From 22ba73a487c2c6aeae54d584833c7fe06b5c90d8 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Tue, 2 Aug 2022 22:07:06 +0900 Subject: [PATCH 077/104] Change shortcut text for redo tooltip on Windows (#42830) * A11y: add Ctrl+Y text for redo tooltip on Windows * Change shortcut text for redo tooltip on Windows --- packages/customize-widgets/src/components/header/index.js | 8 ++++++-- .../edit-navigation/src/components/header/redo-button.js | 8 ++++++-- .../edit-site/src/components/header/undo-redo/redo.js | 8 ++++++-- .../edit-widgets/src/components/header/undo-redo/redo.js | 8 ++++++-- packages/editor/src/components/editor-history/redo.js | 8 ++++++-- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/packages/customize-widgets/src/components/header/index.js b/packages/customize-widgets/src/components/header/index.js index b23c75de1d7ed6..201831b90cd78a 100644 --- a/packages/customize-widgets/src/components/header/index.js +++ b/packages/customize-widgets/src/components/header/index.js @@ -10,7 +10,7 @@ import { createPortal, useState, useEffect } from '@wordpress/element'; import { __, _x, isRTL } from '@wordpress/i18n'; import { ToolbarButton } from '@wordpress/components'; import { NavigableToolbar } from '@wordpress/block-editor'; -import { displayShortcut } from '@wordpress/keycodes'; +import { displayShortcut, isAppleOS } from '@wordpress/keycodes'; import { plus, undo as undoIcon, redo as redoIcon } from '@wordpress/icons'; /** @@ -31,6 +31,10 @@ function Header( { sidebar.hasRedo(), ] ); + const shortcut = isAppleOS() + ? displayShortcut.primaryShift( 'z' ) + : displayShortcut.primary( 'y' ); + useEffect( () => { return sidebar.subscribeHistory( () => { setUndoRedo( [ sidebar.hasUndo(), sidebar.hasRedo() ] ); @@ -64,7 +68,7 @@ function Header( { icon={ ! isRTL() ? redoIcon : undoIcon } /* translators: button label text should, if possible, be under 16 characters. */ label={ __( 'Redo' ) } - shortcut={ displayShortcut.primaryShift( 'z' ) } + shortcut={ shortcut } // If there are no undo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 diff --git a/packages/edit-navigation/src/components/header/redo-button.js b/packages/edit-navigation/src/components/header/redo-button.js index 70521b1d0eceaf..c4f4e6df37b915 100644 --- a/packages/edit-navigation/src/components/header/redo-button.js +++ b/packages/edit-navigation/src/components/header/redo-button.js @@ -5,10 +5,14 @@ import { __, isRTL } from '@wordpress/i18n'; import { ToolbarButton } from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; import { redo as redoIcon, undo as undoIcon } from '@wordpress/icons'; -import { displayShortcut } from '@wordpress/keycodes'; +import { displayShortcut, isAppleOS } from '@wordpress/keycodes'; import { store as coreStore } from '@wordpress/core-data'; export default function RedoButton() { + const shortcut = isAppleOS() + ? displayShortcut.primaryShift( 'z' ) + : displayShortcut.primary( 'y' ); + const hasRedo = useSelect( ( select ) => select( coreStore ).hasRedo(), [] @@ -18,7 +22,7 @@ export default function RedoButton() { select( coreStore ).hasRedo(), [] @@ -21,7 +25,7 @@ function RedoButton( props, ref ) { ref={ ref } icon={ ! isRTL() ? redoIcon : undoIcon } label={ __( 'Redo' ) } - shortcut={ displayShortcut.primaryShift( 'z' ) } + shortcut={ shortcut } // If there are no undo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 diff --git a/packages/edit-widgets/src/components/header/undo-redo/redo.js b/packages/edit-widgets/src/components/header/undo-redo/redo.js index 70521b1d0eceaf..c4f4e6df37b915 100644 --- a/packages/edit-widgets/src/components/header/undo-redo/redo.js +++ b/packages/edit-widgets/src/components/header/undo-redo/redo.js @@ -5,10 +5,14 @@ import { __, isRTL } from '@wordpress/i18n'; import { ToolbarButton } from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; import { redo as redoIcon, undo as undoIcon } from '@wordpress/icons'; -import { displayShortcut } from '@wordpress/keycodes'; +import { displayShortcut, isAppleOS } from '@wordpress/keycodes'; import { store as coreStore } from '@wordpress/core-data'; export default function RedoButton() { + const shortcut = isAppleOS() + ? displayShortcut.primaryShift( 'z' ) + : displayShortcut.primary( 'y' ); + const hasRedo = useSelect( ( select ) => select( coreStore ).hasRedo(), [] @@ -18,7 +22,7 @@ export default function RedoButton() { select( editorStore ).hasEditorRedo(), [] @@ -26,7 +30,7 @@ function EditorHistoryRedo( props, ref ) { icon={ ! isRTL() ? redoIcon : undoIcon } /* translators: button label text should, if possible, be under 16 characters. */ label={ __( 'Redo' ) } - shortcut={ displayShortcut.primaryShift( 'z' ) } + shortcut={ shortcut } // If there are no redo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 From e3c8a6cb0f7890f21d688be28fe4ead1b11a1bc0 Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Tue, 2 Aug 2022 16:10:52 +0300 Subject: [PATCH 078/104] Lodash: Refactor away from `_.isPlainObject()` (#42508) * Lodash: Refactor away from _.isPlainObject() * Revert package-lock.json changes * Dedupe is-plain-obj * Get rid of dev deps --- .eslintrc.js | 1 + package-lock.json | 51 +++++++++++++++++-- packages/blocks/package.json | 1 + packages/blocks/src/store/actions.js | 3 +- packages/components/src/text/hook.js | 8 +-- packages/data/package.json | 1 + .../data/src/plugins/persistence/index.js | 3 +- packages/element/package.json | 1 + packages/element/src/serialize.js | 3 +- .../test/index.test.js | 14 ++--- packages/prettier-config/test/index.js | 14 ++--- packages/redux-routine/package.json | 1 + packages/redux-routine/src/is-action.js | 2 +- test/native/jest.config.js | 2 +- test/unit/jest.config.js | 1 + 15 files changed, 76 insertions(+), 30 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5f88587b915c22..2b3ed51d5f4b28 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -107,6 +107,7 @@ module.exports = { 'isNumber', 'isObject', 'isObjectLike', + 'isPlainObject', 'isString', 'isUndefined', 'keyBy', diff --git a/package-lock.json b/package-lock.json index 8b37b070930571..2a6eda78081483 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16653,6 +16653,7 @@ "@wordpress/shortcode": "file:packages/shortcode", "colord": "^2.7.0", "hpq": "^1.3.0", + "is-plain-obj": "^4.1.0", "lodash": "^4.17.21", "memize": "^1.1.0", "rememo": "^4.0.0", @@ -16889,6 +16890,7 @@ "@wordpress/priority-queue": "file:packages/priority-queue", "@wordpress/redux-routine": "file:packages/redux-routine", "equivalent-key-map": "^0.2.2", + "is-plain-obj": "^4.1.0", "is-promise": "^4.0.0", "lodash": "^4.17.21", "redux": "^4.1.2", @@ -17180,6 +17182,7 @@ "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", "@wordpress/escape-html": "file:packages/escape-html", + "is-plain-obj": "^4.1.0", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2" @@ -17745,6 +17748,7 @@ "version": "file:packages/redux-routine", "requires": { "@babel/runtime": "^7.16.0", + "is-plain-obj": "^4.1.0", "is-promise": "^4.0.0", "lodash": "^4.17.21", "rungen": "^0.3.2" @@ -38668,10 +38672,9 @@ } }, "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==" }, "is-plain-object": { "version": "2.0.4", @@ -44360,6 +44363,14 @@ "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", "kind-of": "^6.0.3" + }, + "dependencies": { + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + } } }, "normalize-package-data": { @@ -45703,6 +45714,14 @@ "requires": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0" + }, + "dependencies": { + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + } } }, "minipass": { @@ -54034,6 +54053,14 @@ "dev": true, "requires": { "is-plain-obj": "^1.0.0" + }, + "dependencies": { + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + } } }, "source-list-map": { @@ -55846,6 +55873,14 @@ "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", "kind-of": "^6.0.3" + }, + "dependencies": { + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + } } }, "ms": { @@ -57591,6 +57626,14 @@ "trough": "^1.0.0", "vfile": "^3.0.0", "x-is-string": "^0.1.0" + }, + "dependencies": { + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true + } } }, "union-value": { diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 7cbb0e9673bfaf..b756451e81990c 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -43,6 +43,7 @@ "@wordpress/shortcode": "file:../shortcode", "colord": "^2.7.0", "hpq": "^1.3.0", + "is-plain-obj": "^4.1.0", "lodash": "^4.17.21", "memize": "^1.1.0", "rememo": "^4.0.0", diff --git a/packages/blocks/src/store/actions.js b/packages/blocks/src/store/actions.js index 141fd9e79d4310..0ef38acfc2e0c5 100644 --- a/packages/blocks/src/store/actions.js +++ b/packages/blocks/src/store/actions.js @@ -1,7 +1,8 @@ /** * External dependencies */ -import { castArray, isPlainObject, omit, pick, some } from 'lodash'; +import isPlainObject from 'is-plain-obj'; +import { castArray, omit, pick, some } from 'lodash'; /** * WordPress dependencies diff --git a/packages/components/src/text/hook.js b/packages/components/src/text/hook.js index c914293c70e5e4..7a83bc9c336999 100644 --- a/packages/components/src/text/hook.js +++ b/packages/components/src/text/hook.js @@ -2,7 +2,6 @@ * External dependencies */ import { css } from '@emotion/react'; -import { isPlainObject } from 'lodash'; /** * WordPress dependencies @@ -167,8 +166,11 @@ export default function useText( props ) { */ if ( ! truncate && Array.isArray( children ) ) { content = Children.map( children, ( child ) => { - // @ts-ignore - if ( ! isPlainObject( child ) || ! ( 'props' in child ) ) { + if ( + typeof child !== 'object' || + child === null || + ! ( 'props' in child ) + ) { return child; } diff --git a/packages/data/package.json b/packages/data/package.json index 7f50bbd8383b00..5aeadf1ed6bf66 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -35,6 +35,7 @@ "@wordpress/priority-queue": "file:../priority-queue", "@wordpress/redux-routine": "file:../redux-routine", "equivalent-key-map": "^0.2.2", + "is-plain-obj": "^4.1.0", "is-promise": "^4.0.0", "lodash": "^4.17.21", "redux": "^4.1.2", diff --git a/packages/data/src/plugins/persistence/index.js b/packages/data/src/plugins/persistence/index.js index 3029b459b3ad91..a9eb1d21bd1e9e 100644 --- a/packages/data/src/plugins/persistence/index.js +++ b/packages/data/src/plugins/persistence/index.js @@ -1,7 +1,8 @@ /** * External dependencies */ -import { merge, isPlainObject } from 'lodash'; +import isPlainObject from 'is-plain-obj'; +import { merge } from 'lodash'; /** * Internal dependencies diff --git a/packages/element/package.json b/packages/element/package.json index 769dfcfa44c7ac..051b396793abbe 100644 --- a/packages/element/package.json +++ b/packages/element/package.json @@ -32,6 +32,7 @@ "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", "@wordpress/escape-html": "file:../escape-html", + "is-plain-obj": "^4.1.0", "lodash": "^4.17.21", "react": "^17.0.2", "react-dom": "^17.0.2" diff --git a/packages/element/src/serialize.js b/packages/element/src/serialize.js index 9e14a089f8eb4c..dd3d26b6c4b8f9 100644 --- a/packages/element/src/serialize.js +++ b/packages/element/src/serialize.js @@ -28,7 +28,8 @@ /** * External dependencies */ -import { kebabCase, isPlainObject } from 'lodash'; +import isPlainObject from 'is-plain-obj'; +import { kebabCase } from 'lodash'; /** * WordPress dependencies diff --git a/packages/npm-package-json-lint-config/test/index.test.js b/packages/npm-package-json-lint-config/test/index.test.js index 16dd989d61fd36..15733d7d0198c7 100644 --- a/packages/npm-package-json-lint-config/test/index.test.js +++ b/packages/npm-package-json-lint-config/test/index.test.js @@ -1,17 +1,13 @@ +/** + * External dependencies + */ +import isPlainObject from 'is-plain-obj'; + /** * Internal dependencies */ import config from '../'; -const isPlainObject = ( obj ) => { - return ( - typeof obj === 'object' && - obj !== null && - obj.constructor === Object && - Object.prototype.toString.call( obj ) === '[object Object]' - ); -}; - describe( 'npm-package-json-lint config tests', () => { it( 'should be an object', () => { expect( isPlainObject( config ) ).toBeTruthy(); diff --git a/packages/prettier-config/test/index.js b/packages/prettier-config/test/index.js index 991ed5d3bbe5e4..13b136107db884 100644 --- a/packages/prettier-config/test/index.js +++ b/packages/prettier-config/test/index.js @@ -1,17 +1,13 @@ +/** + * External dependencies + */ +import isPlainObject from 'is-plain-obj'; + /** * Internal dependencies */ import config from '../lib/'; -const isPlainObject = ( obj ) => { - return ( - typeof obj === 'object' && - obj !== null && - obj.constructor === Object && - Object.prototype.toString.call( obj ) === '[object Object]' - ); -}; - describe( 'prettier config tests', () => { it( 'should be an object', () => { expect( isPlainObject( config ) ).toBeTruthy(); diff --git a/packages/redux-routine/package.json b/packages/redux-routine/package.json index f99a2f87d8b753..321d66b563649e 100644 --- a/packages/redux-routine/package.json +++ b/packages/redux-routine/package.json @@ -30,6 +30,7 @@ "sideEffects": false, "dependencies": { "@babel/runtime": "^7.16.0", + "is-plain-obj": "^4.1.0", "is-promise": "^4.0.0", "lodash": "^4.17.21", "rungen": "^0.3.2" diff --git a/packages/redux-routine/src/is-action.js b/packages/redux-routine/src/is-action.js index bcabab4e07a88b..cdd59c8cd63d25 100644 --- a/packages/redux-routine/src/is-action.js +++ b/packages/redux-routine/src/is-action.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { isPlainObject } from 'lodash'; +import isPlainObject from 'is-plain-obj'; /* eslint-disable jsdoc/valid-types */ /** diff --git a/test/native/jest.config.js b/test/native/jest.config.js index a6ccf676882fb2..0a7bf84287f421 100644 --- a/test/native/jest.config.js +++ b/test/native/jest.config.js @@ -65,7 +65,7 @@ module.exports = { // See: https://github.com/wordpress-mobile/gutenberg-mobile/pull/257#discussion_r234978268 // There is no overloading in jest so we need to rewrite the config from react-native-jest-preset: // https://github.com/facebook/react-native/blob/HEAD/jest-preset.json#L20 - 'node_modules/(?!(simple-html-tokenizer|(jest-)?react-native|@react-native|react-clone-referenced-element|@react-navigation))', + 'node_modules/(?!(simple-html-tokenizer|is-plain-obj|(jest-)?react-native|@react-native|react-clone-referenced-element|@react-navigation))', ], snapshotSerializers: [ '@emotion/jest/serializer' ], reporters: [ 'default', 'jest-junit' ], diff --git a/test/unit/jest.config.js b/test/unit/jest.config.js index c430aae0ed244c..2294974ffea32a 100644 --- a/test/unit/jest.config.js +++ b/test/unit/jest.config.js @@ -36,6 +36,7 @@ module.exports = { transform: { '^.+\\.[jt]sx?$': '/test/unit/scripts/babel-transformer.js', }, + transformIgnorePatterns: [ 'node_modules/(?!(is-plain-obj))' ], snapshotSerializers: [ 'enzyme-to-json/serializer', '@emotion/jest/serializer', From 031d50e6c2acfed94b8637c2771313ff37b9bc47 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Tue, 2 Aug 2022 14:15:30 +0100 Subject: [PATCH 079/104] Nav block: Move overlay colors to the responsive wrapper (#42875) * Nav block: Move overlay colors to the responsive wrapper * add overlay color and background to the repsonsive wrapper component --- .../src/navigation/edit/index.js | 29 +++---------------- .../src/navigation/edit/responsive-wrapper.js | 27 +++++++++++++++-- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index 5e03b859e481fd..eda2a2b7967dfd 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -303,27 +303,6 @@ function Navigation( { { __unstableIsDisabled: hasBlockOverlay } ); - const overlayClassnames = classnames( { - 'has-text-color': - !! overlayTextColor.color || !! overlayTextColor?.class, - [ getColorClassName( 'color', overlayTextColor?.slug ) ]: - !! overlayTextColor?.slug, - 'has-background': - !! overlayBackgroundColor.color || overlayBackgroundColor?.class, - [ getColorClassName( - 'background-color', - overlayBackgroundColor?.slug - ) ]: !! overlayBackgroundColor?.slug, - } ); - - const overlayStyles = { - color: ! overlayTextColor?.slug && overlayTextColor?.color, - backgroundColor: - ! overlayBackgroundColor?.slug && - overlayBackgroundColor?.color && - overlayBackgroundColor.color, - }; - // Turn on contrast checker for web only since it's not supported on mobile yet. const enableContrastChecking = Platform.OS === 'web'; @@ -644,8 +623,8 @@ function Navigation( { isOpen={ isResponsiveMenuOpen } isResponsive={ 'never' !== overlayMenu } isHiddenByDefault={ 'always' === overlayMenu } - classNames={ overlayClassnames } - styles={ overlayStyles } + overlayBackgroundColor={ overlayBackgroundColor } + overlayTextColor={ overlayTextColor } > { isEntityAvailable && ( Date: Tue, 2 Aug 2022 16:15:45 +0300 Subject: [PATCH 080/104] Lodash: Refactor away from `_.isMatch()` (#42271) * Lodash: Refactor away from _.isMatch() * Handle nested objects and arrays --- .eslintrc.js | 1 + .../src/utils/block-variation-transforms.js | 19 ++++++++++----- .../utils/test/block-variation-transforms.js | 24 +++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2b3ed51d5f4b28..d6e0f02904330d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -103,6 +103,7 @@ module.exports = { 'isBoolean', 'isFinite', 'isFunction', + 'isMatch', 'isNil', 'isNumber', 'isObject', diff --git a/packages/block-editor/src/utils/block-variation-transforms.js b/packages/block-editor/src/utils/block-variation-transforms.js index 19f8e05c822056..7b1dd2068f84a3 100644 --- a/packages/block-editor/src/utils/block-variation-transforms.js +++ b/packages/block-editor/src/utils/block-variation-transforms.js @@ -1,10 +1,17 @@ -/** - * External dependencies - */ -import { isMatch } from 'lodash'; - /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ +function matchesAttributes( blockAttributes, variation ) { + return Object.entries( variation ).every( ( [ key, value ] ) => { + if ( + typeof value === 'object' && + typeof blockAttributes[ key ] === 'object' + ) { + return matchesAttributes( blockAttributes[ key ], value ); + } + return blockAttributes[ key ] === value; + } ); +} + /** * Matches the provided block variations with a block's attributes. If no match * or more than one matches are found it returns `undefined`. If a single match is @@ -24,7 +31,7 @@ export const __experimentalGetMatchingVariation = ( if ( ! variations || ! blockAttributes ) return; const matches = variations.filter( ( { attributes } ) => { if ( ! attributes || ! Object.keys( attributes ).length ) return false; - return isMatch( blockAttributes, attributes ); + return matchesAttributes( blockAttributes, attributes ); } ); if ( matches.length !== 1 ) return; return matches[ 0 ]; diff --git a/packages/block-editor/src/utils/test/block-variation-transforms.js b/packages/block-editor/src/utils/test/block-variation-transforms.js index 17c82bdb951329..47844ba0309426 100644 --- a/packages/block-editor/src/utils/test/block-variation-transforms.js +++ b/packages/block-editor/src/utils/test/block-variation-transforms.js @@ -40,6 +40,18 @@ describe( 'getMatchingVariation', () => { getMatchingVariation( { level: 1, other: 'prop' }, variations ) ).toBeUndefined(); } ); + it( 'when variation has a nested attribute', () => { + const variations = [ + { name: 'one', attributes: { query: { author: 'somebody' } } }, + { name: 'two', attributes: { query: { author: 'nobody' } } }, + ]; + expect( + getMatchingVariation( + { query: { author: 'foobar' }, other: 'prop' }, + variations + ) + ).toBeUndefined(); + } ); } ); describe( 'should find a match', () => { it( 'when variation has one attribute', () => { @@ -66,5 +78,17 @@ describe( 'getMatchingVariation', () => { ).name ).toEqual( 'one' ); } ); + it( 'when variation has a nested attribute', () => { + const variations = [ + { name: 'one', attributes: { query: { author: 'somebody' } } }, + { name: 'two', attributes: { query: { author: 'nobody' } } }, + ]; + expect( + getMatchingVariation( + { query: { author: 'somebody' }, other: 'prop' }, + variations + ).name + ).toEqual( 'one' ); + } ); } ); } ); From 32aeeaac24949df93c67e03c6fdd8d9e4b2c3d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petter=20Walb=C3=B8=20Johnsg=C3=A5rd?= Date: Tue, 2 Aug 2022 15:19:28 +0200 Subject: [PATCH 081/104] Block library: Round position attribute on media-text focal point save (#33915) --- .../src/media-text/deprecated.js | 1016 +++++++++-------- .../src/media-text/media-container.js | 4 +- .../src/media-text/test/media-container.js | 24 + .../core__media-text__deprecated-v5.html | 12 + .../core__media-text__deprecated-v5.json | 32 + ...ore__media-text__deprecated-v5.parsed.json | 30 + ..._media-text__deprecated-v5.serialized.html | 5 + ..._image-fill-with-focal-point-selected.html | 4 +- ..._image-fill-with-focal-point-selected.json | 4 +- ...fill-with-focal-point-selected.parsed.json | 8 +- ...-with-focal-point-selected.serialized.html | 4 +- ..._media-right-custom-width__deprecated.json | 4 +- 12 files changed, 679 insertions(+), 468 deletions(-) create mode 100644 packages/block-library/src/media-text/test/media-container.js create mode 100644 test/integration/fixtures/blocks/core__media-text__deprecated-v5.html create mode 100644 test/integration/fixtures/blocks/core__media-text__deprecated-v5.json create mode 100644 test/integration/fixtures/blocks/core__media-text__deprecated-v5.parsed.json create mode 100644 test/integration/fixtures/blocks/core__media-text__deprecated-v5.serialized.html diff --git a/packages/block-library/src/media-text/deprecated.js b/packages/block-library/src/media-text/deprecated.js index b81e1632188d3c..f79dd947641464 100644 --- a/packages/block-library/src/media-text/deprecated.js +++ b/packages/block-library/src/media-text/deprecated.js @@ -17,9 +17,19 @@ import { /** * Internal dependencies */ -import { imageFillStyles } from './media-container'; import { DEFAULT_MEDIA_SIZE_SLUG } from './constants'; +const v1ToV5ImageFillStyles = ( url, focalPoint ) => { + return url + ? { + backgroundImage: `url(${ url })`, + backgroundPosition: focalPoint + ? `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%` + : `50% 50%`, + } + : {}; +}; + const DEFAULT_MEDIA_WIDTH = 50; const noop = () => {}; @@ -43,9 +53,6 @@ const baseAttributes = { type: 'string', default: 'wide', }, - backgroundColor: { - type: 'string', - }, mediaAlt: { type: 'string', source: 'attribute', @@ -73,257 +80,464 @@ const baseAttributes = { }, }; -export default [ - // Version with CSS grid - { - attributes: { - align: { - type: 'string', - default: 'wide', - }, - mediaAlt: { - type: 'string', - source: 'attribute', - selector: 'figure img', - attribute: 'alt', - default: '', - }, - mediaPosition: { - type: 'string', - default: 'left', - }, - mediaId: { - type: 'number', - }, - mediaUrl: { - type: 'string', - source: 'attribute', - selector: 'figure video,figure img', - attribute: 'src', - }, - mediaLink: { - type: 'string', - }, - linkDestination: { - type: 'string', - }, - linkTarget: { - type: 'string', - source: 'attribute', - selector: 'figure a', - attribute: 'target', - }, - href: { - type: 'string', - source: 'attribute', - selector: 'figure a', - attribute: 'href', - }, - rel: { - type: 'string', - source: 'attribute', - selector: 'figure a', - attribute: 'rel', - }, - linkClass: { - type: 'string', - source: 'attribute', - selector: 'figure a', - attribute: 'class', - }, - mediaType: { - type: 'string', - }, - mediaWidth: { - type: 'number', - default: 50, - }, - mediaSizeSlug: { - type: 'string', - }, - isStackedOnMobile: { - type: 'boolean', - default: true, - }, - verticalAlignment: { - type: 'string', - }, - imageFill: { - type: 'boolean', - }, - focalPoint: { - type: 'object', - }, - }, - supports: { - anchor: true, - align: [ 'wide', 'full' ], - html: false, - color: { - gradients: true, - link: true, - }, - }, - save( { attributes } ) { - const { - isStackedOnMobile, - mediaAlt, - mediaPosition, - mediaType, - mediaUrl, - mediaWidth, - mediaId, - verticalAlignment, - imageFill, - focalPoint, - linkClass, - href, - linkTarget, - rel, - } = attributes; - const mediaSizeSlug = - attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; - const newRel = isEmpty( rel ) ? undefined : rel; - - const imageClasses = classnames( { - [ `wp-image-${ mediaId }` ]: mediaId && mediaType === 'image', - [ `size-${ mediaSizeSlug }` ]: mediaId && mediaType === 'image', - } ); - - let image = ( - { +const v4ToV5BlockAttributes = { + ...baseAttributes, + mediaUrl: { + type: 'string', + source: 'attribute', + selector: 'figure video,figure img', + attribute: 'src', + }, + mediaLink: { + type: 'string', + }, + linkDestination: { + type: 'string', + }, + linkTarget: { + type: 'string', + source: 'attribute', + selector: 'figure a', + attribute: 'target', + }, + href: { + type: 'string', + source: 'attribute', + selector: 'figure a', + attribute: 'href', + }, + rel: { + type: 'string', + source: 'attribute', + selector: 'figure a', + attribute: 'rel', + }, + linkClass: { + type: 'string', + source: 'attribute', + selector: 'figure a', + attribute: 'class', + }, + mediaSizeSlug: { + type: 'string', + }, + verticalAlignment: { + type: 'string', + }, + imageFill: { + type: 'boolean', + }, + focalPoint: { + type: 'object', + }, +}; + +const v4ToV5Supports = { + anchor: true, + align: [ 'wide', 'full' ], + html: false, + color: { + gradients: true, + link: true, + }, +}; + +const v5 = { + attributes: v4ToV5BlockAttributes, + supports: v4ToV5Supports, + save( { attributes } ) { + const { + isStackedOnMobile, + mediaAlt, + mediaPosition, + mediaType, + mediaUrl, + mediaWidth, + mediaId, + verticalAlignment, + imageFill, + focalPoint, + linkClass, + href, + linkTarget, + rel, + } = attributes; + const mediaSizeSlug = + attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG; + const newRel = isEmpty( rel ) ? undefined : rel; + + const imageClasses = classnames( { + [ `wp-image-${ mediaId }` ]: mediaId && mediaType === 'image', + [ `size-${ mediaSizeSlug }` ]: mediaId && mediaType === 'image', + } ); + + let image = ( + { + ); + + if ( href ) { + image = ( + + { image } + ); + } - if ( href ) { - image = ( - - { image } - - ); - } - - const mediaTypeRenders = { - image: () => image, - video: () =>