From 8512930215aa3e6df1bf3e514293de8b69e31f13 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 3 Feb 2020 15:12:31 +0100 Subject: [PATCH 01/29] Try the link control in the link format (#19462) * Block Editor: LinkControl: Allow onChange parent to manage focus * Try the link control in the link format Co-Authored-By: Dave Smith Co-Authored-By: Riad Benguella * Block Editor: LinkControl: Fix test case typo Co-authored-by: Andrew Duthie Co-authored-by: Dave Smith --- .../src/components/link-control/index.js | 4 +- .../src/components/link-control/test/index.js | 52 +++- .../specs/editor/various/links.test.js | 190 ++++++------- packages/format-library/src/link/index.js | 21 +- packages/format-library/src/link/inline.js | 253 ++++-------------- .../format-library/src/link/test/inline.js | 24 -- 6 files changed, 218 insertions(+), 326 deletions(-) diff --git a/packages/block-editor/src/components/link-control/index.js b/packages/block-editor/src/components/link-control/index.js index cda7986a9f8c44..5f95d64adde6d9 100644 --- a/packages/block-editor/src/components/link-control/index.js +++ b/packages/block-editor/src/components/link-control/index.js @@ -292,8 +292,8 @@ function LinkControl( { ) } suggestion={ suggestion } onClick={ () => { - stopEditing(); onChange( { ...value, ...suggestion } ); + stopEditing(); } } isSelected={ index === selectedSuggestion } isURL={ manualLinkEntryTypes.includes( @@ -318,8 +318,8 @@ function LinkControl( { value={ inputValue } onChange={ onInputChange } onSelect={ ( suggestion ) => { - stopEditing(); onChange( { ...value, ...suggestion } ); + stopEditing(); } } renderSuggestions={ renderSearchResults } fetchSuggestions={ getSearchHandler } diff --git a/packages/block-editor/src/components/link-control/test/index.js b/packages/block-editor/src/components/link-control/test/index.js index 44424efe334295..65d7729c973dc4 100644 --- a/packages/block-editor/src/components/link-control/test/index.js +++ b/packages/block-editor/src/components/link-control/test/index.js @@ -7,7 +7,7 @@ import { first, last, nth } from 'lodash'; /** * WordPress dependencies */ -import { useState } from '@wordpress/element'; +import { useState, useRef } from '@wordpress/element'; import { UP, DOWN, ENTER } from '@wordpress/keycodes'; /** * Internal dependencies @@ -766,6 +766,56 @@ describe( 'Selecting links', () => { } ); } ); + + it( 'does not forcefully regain focus if onChange handler had shifted it', () => { + // Regression: Previously, there had been issues where if `onChange` + // would programmatically shift focus, LinkControl would try to force it + // back, based on its internal logic to determine whether it had focus + // when finishing an edit occuring _before_ `onChange` having been run. + // + // See: https://github.com/WordPress/gutenberg/pull/19462 + + const LinkControlConsumer = () => { + const focusTarget = useRef(); + + return ( + <> +
+ focusTarget.current.focus() } + /> + + ); + }; + + act( () => { + render( , container ); + } ); + + // Change value. + const form = container.querySelector( 'form' ); + const searchInput = container.querySelector( + 'input[aria-label="URL"]' + ); + + // Simulate searching for a term + act( () => { + Simulate.change( searchInput, { + target: { value: 'https://example.com' }, + } ); + } ); + act( () => { + Simulate.keyDown( searchInput, { keyCode: ENTER } ); + } ); + act( () => { + Simulate.submit( form ); + } ); + + const isExpectedFocusTarget = document.activeElement.hasAttribute( + 'data-expected' + ); + expect( isExpectedFocusTarget ).toBe( true ); + } ); } ); describe( 'Addition Settings UI', () => { diff --git a/packages/e2e-tests/specs/editor/various/links.test.js b/packages/e2e-tests/specs/editor/various/links.test.js index c6d8d12263e75d..0f21d248a86500 100644 --- a/packages/e2e-tests/specs/editor/various/links.test.js +++ b/packages/e2e-tests/specs/editor/various/links.test.js @@ -7,7 +7,6 @@ import { getEditedPostContent, createNewPost, pressKeyWithModifier, - insertBlock, } from '@wordpress/e2e-test-utils'; /** @@ -44,8 +43,8 @@ describe( 'Links', () => { // Type a URL await page.keyboard.type( 'https://wordpress.org/gutenberg' ); - // Click on the Apply button - await page.click( 'button[aria-label="Apply"]' ); + // Submit the link + await page.keyboard.press( 'Enter' ); // The link should have been inserted expect( await getEditedPostContent() ).toMatchSnapshot(); @@ -80,9 +79,6 @@ describe( 'Links', () => { await clickBlockAppender(); await page.keyboard.type( 'This is Gutenberg: ' ); - // Press escape to show the block toolbar - await page.keyboard.press( 'Escape' ); - // Press Cmd+K to insert a link await pressKeyWithModifier( 'primary', 'K' ); @@ -157,15 +153,16 @@ describe( 'Links', () => { // Type a URL await page.keyboard.type( 'https://wordpress.org/gutenberg' ); - // Click on the Apply button - await page.click( 'button[aria-label="Apply"]' ); + // Click on the Submit button + await page.keyboard.press( 'Enter' ); }; it( 'can be edited', async () => { await createAndReselectLink(); // Click on the Edit button - await page.click( 'button[aria-label="Edit"]' ); + const [ editButton ] = await page.$x( '//button[text()="Edit"]' ); + await editButton.click(); // Wait for the URL field to auto-focus await waitForAutoFocus(); @@ -173,8 +170,8 @@ describe( 'Links', () => { // Change the URL await page.keyboard.type( '/handbook' ); - // Click on the Apply button - await page.click( 'button[aria-label="Apply"]' ); + // Submit the link + await page.keyboard.press( 'Enter' ); // The link should have been updated expect( await getEditedPostContent() ).toMatchSnapshot(); @@ -211,12 +208,16 @@ describe( 'Links', () => { // Typing "left" should not close the dialog await page.keyboard.press( 'ArrowLeft' ); - let popover = await page.$( '.block-editor-url-popover' ); + let popover = await page.$( + '.components-popover__content .block-editor-link-control' + ); expect( popover ).not.toBeNull(); // Escape should close the dialog still. await page.keyboard.press( 'Escape' ); - popover = await page.$( '.block-editor-url-popover' ); + popover = await page.$( + '.components-popover__content .block-editor-link-control' + ); expect( popover ).toBeNull(); } ); @@ -230,12 +231,16 @@ describe( 'Links', () => { // Typing "left" should not close the dialog await page.keyboard.press( 'ArrowLeft' ); - let popover = await page.$( '.block-editor-url-popover' ); + let popover = await page.$( + '.components-popover__content .block-editor-link-control' + ); expect( popover ).not.toBeNull(); // Escape should close the dialog still. await page.keyboard.press( 'Escape' ); - popover = await page.$( '.block-editor-url-popover' ); + popover = await page.$( + '.components-popover__content .block-editor-link-control' + ); expect( popover ).toBeNull(); } ); @@ -247,10 +252,11 @@ describe( 'Links', () => { // Move the mouse to show the block toolbar await page.mouse.move( 0, 0 ); await page.mouse.move( 10, 10 ); - await page.click( 'button[aria-label="Edit"]' ); + const [ editButton ] = await page.$x( '//button[text()="Edit"]' ); + await editButton.click(); await waitForAutoFocus(); await page.keyboard.type( '/handbook' ); - await page.click( 'button[aria-label="Apply"]' ); + await page.keyboard.press( 'Enter' ); expect( await getEditedPostContent() ).toMatchSnapshot(); } ); @@ -295,34 +301,54 @@ describe( 'Links', () => { // Wait for the URL field to auto-focus await waitForAutoFocus(); - expect( await page.$( '.block-editor-url-popover' ) ).not.toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).not.toBeNull(); // Trigger the autocomplete suggestion list and select the first suggestion. await page.keyboard.type( titleText ); - await page.waitForSelector( '.block-editor-url-input__suggestion' ); + await page.waitForSelector( '.block-editor-link-control__search-item' ); await page.keyboard.press( 'ArrowDown' ); // Expect the the escape key to dismiss the popover when the autocomplete suggestion list is open. await page.keyboard.press( 'Escape' ); - expect( await page.$( '.block-editor-url-popover' ) ).toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).toBeNull(); // Press Cmd+K to insert a link await pressKeyWithModifier( 'primary', 'K' ); // Wait for the URL field to auto-focus await waitForAutoFocus(); - expect( await page.$( '.block-editor-url-popover' ) ).not.toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).not.toBeNull(); // Expect the the escape key to dismiss the popover normally. await page.keyboard.press( 'Escape' ); - expect( await page.$( '.block-editor-url-popover' ) ).toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).toBeNull(); // Press Cmd+K to insert a link await pressKeyWithModifier( 'primary', 'K' ); // Wait for the URL field to auto-focus await waitForAutoFocus(); - expect( await page.$( '.block-editor-url-popover' ) ).not.toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).not.toBeNull(); // Tab to the settings icon button. await page.keyboard.press( 'Tab' ); @@ -330,7 +356,11 @@ describe( 'Links', () => { // Expect the the escape key to dismiss the popover normally. await page.keyboard.press( 'Escape' ); - expect( await page.$( '.block-editor-url-popover' ) ).toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).toBeNull(); } ); it( 'can be modified using the keyboard once a link has been set', async () => { @@ -348,16 +378,30 @@ describe( 'Links', () => { // Deselect the link text by moving the caret to the end of the line // and the link popover should not be displayed. await page.keyboard.press( 'End' ); - expect( await page.$( '.block-editor-url-popover' ) ).toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).toBeNull(); // Move the caret back into the link text and the link popover // should be displayed. await page.keyboard.press( 'ArrowLeft' ); - expect( await page.$( '.block-editor-url-popover' ) ).not.toBeNull(); + expect( + await page.$( + '.components-popover__content .block-editor-link-control' + ) + ).not.toBeNull(); // Press Cmd+K to edit the link and the url-input should become // focused with the value previously inserted. await pressKeyWithModifier( 'primary', 'K' ); + await page.waitForSelector( + ':focus.block-editor-link-control__search-item-title' + ); + await page.keyboard.press( 'Tab' ); // Shift focus to "Edit" button + await page.keyboard.press( 'Enter' ); // Click "Edit" button + await waitForAutoFocus(); const activeElementParentClasses = await page.evaluate( () => Object.values( @@ -389,44 +433,6 @@ describe( 'Links', () => { ); } ); - it( 'link popover remains visible after a mouse drag event', async () => { - // Create some blocks so we have components with event handlers on the page - for ( let loop = 0; loop < 5; loop++ ) { - await insertBlock( 'Paragraph' ); - await page.keyboard.type( 'This is Gutenberg' ); - } - - // Focus on first paragraph, so the link popover will appear over the subsequent ones - await page.click( '[aria-label="Block navigation"]' ); - await page.click( '.block-editor-block-navigation__item button' ); - - // Select some text - await pressKeyWithModifier( 'shiftAlt', 'ArrowLeft' ); - - // Click on the Link button - await page.click( 'button[aria-label="Link"]' ); - // Wait for the URL field to auto-focus - await waitForAutoFocus(); - - // Click on the Link Settings button - await page.click( 'button[aria-label="Link settings"]' ); - - // Move mouse over the 'open in new tab' section, then click and drag - const settings = await page.$( '.block-editor-url-popover__settings' ); - const bounds = await settings.boundingBox(); - - await page.mouse.move( bounds.x, bounds.y ); - await page.mouse.down(); - await page.mouse.move( bounds.x + bounds.width / 2, bounds.y, { - steps: 10, - } ); - await page.mouse.up(); - - // The link popover should still be visible - const popover = await page.$$( '.block-editor-url-popover' ); - expect( popover ).toHaveLength( 1 ); - } ); - it( 'should contain a label when it should open in a new tab', async () => { await clickBlockAppender(); await page.keyboard.type( 'This is WordPress' ); @@ -435,19 +441,22 @@ describe( 'Links', () => { await pressKeyWithModifier( 'primary', 'k' ); await waitForAutoFocus(); await page.keyboard.type( 'w.org' ); - // Navigate to the settings toggle. - await page.keyboard.press( 'Tab' ); - await page.keyboard.press( 'Tab' ); - // Open settings. - await page.keyboard.press( 'Space' ); + + // Insert the link + await page.keyboard.press( 'Enter' ); + + // Navigate back to the popover + await pressKeyWithModifier( 'primary', 'k' ); + await page.waitForSelector( + '.components-popover__content .block-editor-link-control' + ); + // Navigate to the "Open in New Tab" checkbox. await page.keyboard.press( 'Tab' ); + await page.keyboard.press( 'Tab' ); + // Check the checkbox. await page.keyboard.press( 'Space' ); - // Navigate back to the input field. - await page.keyboard.press( 'Tab' ); - // Submit the form. - await page.keyboard.press( 'Enter' ); expect( await getEditedPostContent() ).toMatchSnapshot(); @@ -463,36 +472,29 @@ describe( 'Links', () => { await page.keyboard.press( 'ArrowRight' ); // Edit link. await pressKeyWithModifier( 'primary', 'k' ); + await page.waitForSelector( + ':focus.block-editor-link-control__search-item-title' + ); + await page.keyboard.press( 'Tab' ); // Shift focus to "Edit" button + await page.keyboard.press( 'Enter' ); // Click "Edit" button await waitForAutoFocus(); await pressKeyWithModifier( 'primary', 'a' ); await page.keyboard.type( 'wordpress.org' ); - // Navigate to the settings toggle. - await page.keyboard.press( 'Tab' ); - await page.keyboard.press( 'Tab' ); - // Open settings. - await page.keyboard.press( 'Space' ); - // Navigate to the "Open in New Tab" checkbox. - await page.keyboard.press( 'Tab' ); - // Uncheck the checkbox. - await page.keyboard.press( 'Space' ); - // Navigate back to the input field. - await page.keyboard.press( 'Tab' ); - // Submit the form. + + // Update the link await page.keyboard.press( 'Enter' ); - // Navigate back to inputs to verify appears as changed. + // Navigate back to the popover await pressKeyWithModifier( 'primary', 'k' ); - await waitForAutoFocus(); - const link = await page.evaluate( () => document.activeElement.value ); - expect( link ).toBe( 'http://wordpress.org' ); + await page.waitForSelector( + '.components-popover__content .block-editor-link-control' + ); + + // Navigate to the "Open in New Tab" checkbox. await page.keyboard.press( 'Tab' ); await page.keyboard.press( 'Tab' ); + // Uncheck the checkbox. await page.keyboard.press( 'Space' ); - await page.keyboard.press( 'Tab' ); - const isChecked = await page.evaluate( - () => document.activeElement.checked - ); - expect( isChecked ).toBe( false ); expect( await getEditedPostContent() ).toMatchSnapshot(); } ); diff --git a/packages/format-library/src/link/index.js b/packages/format-library/src/link/index.js index 1a63d9621e8059..8680d006e41e7e 100644 --- a/packages/format-library/src/link/index.js +++ b/packages/format-library/src/link/index.js @@ -149,16 +149,17 @@ export const link = { shortcutCharacter="k" /> ) } - + { ( this.state.addingLink || isActive ) && ( + + ) } ); } diff --git a/packages/format-library/src/link/inline.js b/packages/format-library/src/link/inline.js index aaeeb5006caa8e..58e767b2262620 100644 --- a/packages/format-library/src/link/inline.js +++ b/packages/format-library/src/link/inline.js @@ -1,10 +1,14 @@ +/** + * External dependencies + */ +import { uniqueId } from 'lodash'; + /** * WordPress dependencies */ +import { useMemo } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; -import { Component, createRef, useMemo } from '@wordpress/element'; -import { ToggleControl, withSpokenMessages } from '@wordpress/components'; -import { LEFT, RIGHT, UP, DOWN, BACKSPACE, ENTER } from '@wordpress/keycodes'; +import { withSpokenMessages, Popover } from '@wordpress/components'; import { prependHTTP } from '@wordpress/url'; import { create, @@ -14,20 +18,39 @@ import { getTextContent, slice, } from '@wordpress/rich-text'; -import { URLPopover } from '@wordpress/block-editor'; +import { __experimentalLinkControl as LinkControl } from '@wordpress/block-editor'; /** * Internal dependencies */ import { createLinkFormat, isValidHref } from './utils'; -const stopKeyPropagation = ( event ) => event.stopPropagation(); +function InlineLinkUI( { + isActive, + activeAttributes, + addingLink, + value, + onChange, + onFocus, + speak, + stopAddingLink, +} ) { + /** + * A unique key is generated when switching between editing and not editing + * a link, based on: + * + * - This component may be rendered _either_ when a link is active _or_ + * when adding or editing a link. + * - It's only desirable to shift focus into the Popover when explicitly + * adding or editing a link, not when in the inline boundary of a link. + * - Focus behavior can only be controlled on a Popover at the time it + * mounts, so a new instance of the component must be mounted to + * programmatically enact the focusOnMount behavior. + * + * @type {string} + */ + const mountingKey = useMemo( uniqueId, [ addingLink ] ); -function isShowingInput( props, state ) { - return props.addingLink || state.editLink; -} - -const URLPopoverAtLink = ( { isActive, addingLink, value, ...props } ) => { const anchorRef = useMemo( () => { const selection = window.getSelection(); @@ -37,7 +60,7 @@ const URLPopoverAtLink = ( { isActive, addingLink, value, ...props } ) => { const range = selection.getRangeAt( 0 ); - if ( addingLink ) { + if ( addingLink && ! isActive ) { return range; } @@ -51,120 +74,28 @@ const URLPopoverAtLink = ( { isActive, addingLink, value, ...props } ) => { } return element.closest( 'a' ); - }, [ isActive, addingLink, value.start, value.end ] ); - - if ( ! anchorRef ) { - return null; - } - - return ; -}; - -class InlineLinkUI extends Component { - constructor() { - super( ...arguments ); - - this.editLink = this.editLink.bind( this ); - this.submitLink = this.submitLink.bind( this ); - this.onKeyDown = this.onKeyDown.bind( this ); - this.onChangeInputValue = this.onChangeInputValue.bind( this ); - this.setLinkTarget = this.setLinkTarget.bind( this ); - this.onFocusOutside = this.onFocusOutside.bind( this ); - this.resetState = this.resetState.bind( this ); - this.autocompleteRef = createRef(); - - this.state = { - opensInNewWindow: false, - inputValue: '', - }; - } - - static getDerivedStateFromProps( props, state ) { - const { - activeAttributes: { url, target }, - } = props; - const opensInNewWindow = target === '_blank'; - - if ( ! isShowingInput( props, state ) ) { - const update = {}; - if ( url !== state.inputValue ) { - update.inputValue = url; - } - - if ( opensInNewWindow !== state.opensInNewWindow ) { - update.opensInNewWindow = opensInNewWindow; - } - return Object.keys( update ).length ? update : null; - } - - return null; - } - - onKeyDown( event ) { - if ( - [ LEFT, DOWN, RIGHT, UP, BACKSPACE, ENTER ].indexOf( - event.keyCode - ) > -1 - ) { - // Stop the key event from propagating up to ObserveTyping.startTypingInTextField. - event.stopPropagation(); - } - } - - onChangeInputValue( inputValue ) { - this.setState( { inputValue } ); - } + }, [ addingLink, value.start, value.end ] ); - setLinkTarget( opensInNewWindow ) { - const { - activeAttributes: { url = '' }, - value, - onChange, - } = this.props; + const linkValue = { + url: activeAttributes.url, + opensInNewTab: activeAttributes.target === '_blank', + }; - this.setState( { opensInNewWindow } ); - - // Apply now if URL is not being edited. - if ( ! isShowingInput( this.props, this.state ) ) { - const selectedText = getTextContent( slice( value ) ); - - onChange( - applyFormat( - value, - createLinkFormat( { - url, - opensInNewWindow, - text: selectedText, - } ) - ) - ); - } - } - - editLink( event ) { - this.setState( { editLink: true } ); - event.preventDefault(); - } - - submitLink( event ) { - const { isActive, value, onChange, onFocus, speak } = this.props; - const { inputValue, opensInNewWindow } = this.state; - const url = prependHTTP( inputValue ); + function onChangeLink( nextValue ) { + const newUrl = prependHTTP( nextValue.url ); const selectedText = getTextContent( slice( value ) ); const format = createLinkFormat( { - url, - opensInNewWindow, + url: newUrl, + opensInNewWindow: nextValue.opensInNewTab, text: selectedText, } ); - event.preventDefault(); - if ( isCollapsed( value ) && ! isActive ) { const toInsert = applyFormat( - create( { text: url } ), + create( { text: newUrl } ), format, 0, - url.length + newUrl.length ); onChange( insert( value, toInsert ) ); } else { @@ -172,10 +103,9 @@ class InlineLinkUI extends Component { } onFocus(); + stopAddingLink(); - this.resetState(); - - if ( ! isValidHref( url ) ) { + if ( ! isValidHref( newUrl ) ) { speak( __( 'Warning: the link has been inserted but may have errors. Please test it.' @@ -189,84 +119,17 @@ class InlineLinkUI extends Component { } } - onFocusOutside() { - // The autocomplete suggestions list renders in a separate popover (in a portal), - // so onFocusOutside fails to detect that a click on a suggestion occurred in the - // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and - // return to avoid the popover being closed. - const autocompleteElement = this.autocompleteRef.current; - if ( - autocompleteElement && - autocompleteElement.contains( document.activeElement ) - ) { - return; - } - - this.resetState(); - } - - resetState() { - this.props.stopAddingLink(); - this.setState( { editLink: false } ); - } - - render() { - const { - isActive, - activeAttributes: { url }, - addingLink, - value, - } = this.props; - - if ( ! isActive && ! addingLink ) { - return null; - } - - const { inputValue, opensInNewWindow } = this.state; - const showInput = isShowingInput( this.props, this.state ); - - return ( - ( - - ) } - > - { showInput ? ( - - ) : ( - - ) } - - ); - } + return ( + + + + ); } export default withSpokenMessages( InlineLinkUI ); diff --git a/packages/format-library/src/link/test/inline.js b/packages/format-library/src/link/test/inline.js index cc59087e8c429b..b3be2c1de0720b 100644 --- a/packages/format-library/src/link/test/inline.js +++ b/packages/format-library/src/link/test/inline.js @@ -12,28 +12,4 @@ describe( 'InlineLinkUI', () => { const wrapper = shallow( ); expect( wrapper ).toBeTruthy(); } ); - - it( 'should set state.opensInNewWindow to false by default', () => { - const wrapper = shallow( - - ).dive(); - - expect( wrapper.state( 'opensInNewWindow' ) ).toEqual( false ); - } ); - - it( 'should set state.opensInNewWindow to true if props.activeAttributes.target is _blank', () => { - const givenProps = { - addingLink: false, - activeAttributes: { - url: 'http://www.google.com', - target: '_blank', - }, - }; - - const wrapper = shallow( - - ).dive(); - wrapper.setProps( givenProps ); - expect( wrapper.state( 'opensInNewWindow' ) ).toEqual( true ); - } ); } ); From 6de983f6bf838df794f361e6bc1641f11910a911 Mon Sep 17 00:00:00 2001 From: Enrique Piqueras Date: Mon, 3 Feb 2020 09:59:03 -0500 Subject: [PATCH 02/29] Block Library: Stop gallery images from creating undo levels as they load. (#19937) * Block Library: Stop gallery images from creating undo levels as they load. * E2E Tests: Test that converting a Classic block to a Gallery block can be undone in one step. * Lint --- .../src/gallery/gallery-image.js | 35 ++++++++++++++----- .../specs/editor/blocks/classic.test.js | 30 +++++++++++++--- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/packages/block-library/src/gallery/gallery-image.js b/packages/block-library/src/gallery/gallery-image.js index 089141fb5e2c66..f618e90b776d59 100644 --- a/packages/block-library/src/gallery/gallery-image.js +++ b/packages/block-library/src/gallery/gallery-image.js @@ -10,9 +10,10 @@ import { Component } from '@wordpress/element'; import { Button, Spinner } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { BACKSPACE, DELETE } from '@wordpress/keycodes'; -import { withSelect } from '@wordpress/data'; +import { withSelect, withDispatch } from '@wordpress/data'; import { RichText } from '@wordpress/block-editor'; import { isBlobURL } from '@wordpress/blob'; +import { compose } from '@wordpress/compose'; /** * Internal dependencies @@ -74,8 +75,14 @@ class GalleryImage extends Component { } componentDidUpdate( prevProps ) { - const { isSelected, image, url } = this.props; + const { + isSelected, + image, + url, + __unstableMarkNextChangeAsNotPersistent, + } = this.props; if ( image && ! url ) { + __unstableMarkNextChangeAsNotPersistent(); this.props.setAttributes( { url: image.source_url, alt: image.alt_text, @@ -200,11 +207,21 @@ class GalleryImage extends Component { } } -export default withSelect( ( select, ownProps ) => { - const { getMedia } = select( 'core' ); - const { id } = ownProps; +export default compose( [ + withSelect( ( select, ownProps ) => { + const { getMedia } = select( 'core' ); + const { id } = ownProps; - return { - image: id ? getMedia( id ) : null, - }; -} )( GalleryImage ); + return { + image: id ? getMedia( id ) : null, + }; + } ), + withDispatch( ( dispatch ) => { + const { __unstableMarkNextChangeAsNotPersistent } = dispatch( + 'core/block-editor' + ); + return { + __unstableMarkNextChangeAsNotPersistent, + }; + } ), +] )( GalleryImage ); diff --git a/packages/e2e-tests/specs/editor/blocks/classic.test.js b/packages/e2e-tests/specs/editor/blocks/classic.test.js index 456ce33f557930..b8295c64d53df1 100644 --- a/packages/e2e-tests/specs/editor/blocks/classic.test.js +++ b/packages/e2e-tests/specs/editor/blocks/classic.test.js @@ -14,6 +14,8 @@ import { createNewPost, insertBlock, pressKeyWithModifier, + clickBlockToolbarButton, + clickButton, } from '@wordpress/e2e-test-utils'; describe( 'Classic', () => { @@ -34,7 +36,7 @@ describe( 'Classic', () => { expect( await getEditedPostContent() ).toMatchSnapshot(); } ); - it( 'should insert media', async () => { + it( 'should insert media, convert to blocks, and undo in one step', async () => { await insertBlock( 'Classic' ); // Wait for TinyMCE to initialise. await page.waitForSelector( '.mce-content-body' ); @@ -45,6 +47,7 @@ describe( 'Classic', () => { // Click the image button. await page.waitForSelector( 'div[aria-label^="Add Media"]' ); await page.click( 'div[aria-label^="Add Media"]' ); + await page.click( '.media-menu-item#menu-item-gallery' ); // Wait for media modal to appear and upload image. await page.waitForSelector( '.media-modal input[type=file]' ); @@ -68,17 +71,34 @@ describe( 'Classic', () => { ); // Insert the uploaded image. + await page.click( '.media-modal button.media-button-gallery' ); await page.click( '.media-modal button.media-button-insert' ); // Wait for image to be inserted. await page.waitForSelector( '.mce-content-body img' ); - // Move focus away. + // Move focus away and verify gallery was inserted. await pressKeyWithModifier( 'shift', 'Tab' ); + expect( await getEditedPostContent() ).toMatch( + /\[gallery ids=\"\d+\"\]/ + ); - const regExp = new RegExp( - `test` + // Convert to blocks and verify it worked correctly. + await clickBlockToolbarButton( 'More options' ); + await clickButton( 'Convert to Blocks' ); + await page.waitForSelector( '.wp-block[data-type="core/gallery"]' ); + expect( await getEditedPostContent() ).toMatch( / " `; From f3d8bd1509bee61959de652d73b63ad4ea1fba23 Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Tue, 4 Feb 2020 09:34:47 +1000 Subject: [PATCH 13/29] [Mobile] Fix blank image size labels on mobile (#19800) * Fix blank image size labels on mobile * Use name instead of label in default imageSizes --- packages/block-editor/src/store/defaults.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/store/defaults.js b/packages/block-editor/src/store/defaults.js index a0ab78569c5083..790d65a5ae6dc6 100644 --- a/packages/block-editor/src/store/defaults.js +++ b/packages/block-editor/src/store/defaults.js @@ -126,10 +126,10 @@ export const SETTINGS_DEFAULTS = { ], imageSizes: [ - { slug: 'thumbnail', label: __( 'Thumbnail' ) }, - { slug: 'medium', label: __( 'Medium' ) }, - { slug: 'large', label: __( 'Large' ) }, - { slug: 'full', label: __( 'Full Size' ) }, + { slug: 'thumbnail', name: __( 'Thumbnail' ) }, + { slug: 'medium', name: __( 'Medium' ) }, + { slug: 'large', name: __( 'Large' ) }, + { slug: 'full', name: __( 'Full Size' ) }, ], // This is current max width of the block inner area From 1ded40d86d21e01518e60738763618dfcf8086aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Su=C3=A1rez?= Date: Mon, 3 Feb 2020 15:55:37 -0800 Subject: [PATCH 14/29] navigation: rename background color CSS class (#20018) --- packages/block-library/src/navigation-link/edit.js | 2 +- packages/block-library/src/navigation/edit.js | 2 +- packages/block-library/src/navigation/index.php | 4 ++-- packages/block-library/src/navigation/style.scss | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index f1202df74cef42..ee0a93e6f43f27 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -211,7 +211,7 @@ function NavigationLinkEdit( { 'has-child': hasDescendants, 'has-text-color': rgbTextColor, [ `has-${ textColor }-color` ]: !! textColor, - 'has-background-color': rgbBackgroundColor, + 'has-background': rgbBackgroundColor, [ `has-${ backgroundColor }-background-color` ]: !! backgroundColor, } ) } style={ { diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index 0f7892637ec546..d3b38c43fa83a5 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -68,7 +68,7 @@ function Navigation( { } = __experimentalUseColors( [ { name: 'textColor', property: 'color' }, - { name: 'backgroundColor', className: 'has-background-color' }, + { name: 'backgroundColor', className: 'has-background' }, ], { contrastCheckers: [ diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 723e30b8618474..e54f90a9e62b0c 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -42,8 +42,8 @@ function build_css_colors( $attributes ) { // If has background color. if ( $has_custom_background_color || $has_named_background_color ) { - // Add has-background-color class. - $colors['css_classes'][] = 'has-background-color'; + // Add has-background class. + $colors['css_classes'][] = 'has-background'; } if ( $has_named_background_color ) { diff --git a/packages/block-library/src/navigation/style.scss b/packages/block-library/src/navigation/style.scss index 1395041671b7ae..f3c0415a6244c9 100644 --- a/packages/block-library/src/navigation/style.scss +++ b/packages/block-library/src/navigation/style.scss @@ -208,8 +208,8 @@ $navigation-sub-menu-width: $grid-size * 25; } // No background color - &:not(.has-background-color) > .block-editor-inner-blocks, - &:not(.has-background-color) > .wp-block-navigation__container { + &:not(.has-background) > .block-editor-inner-blocks, + &:not(.has-background) > .wp-block-navigation__container { background-color: $light-style-sub-menu-background-color; } } @@ -223,8 +223,8 @@ $navigation-sub-menu-width: $grid-size * 25; } // No background color - &:not(.has-background-color) > .block-editor-inner-blocks, - &:not(.has-background-color) > .wp-block-navigation__container { + &:not(.has-background) > .block-editor-inner-blocks, + &:not(.has-background) > .wp-block-navigation__container { background-color: $dark-style-sub-menu-background-color; } } From 02ce73f798155bc3140257de2dfac8b6c5d10534 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 3 Feb 2020 23:14:57 -0500 Subject: [PATCH 15/29] Pull Request Automation: Avoid automation tasks for forked repository (#20021) * Pull Request Automation: Avoid automation tasks for forked repository * Fix doc block typo Co-authored-by: Daniel Richards --- .../lib/if-not-fork.js | 21 +++++++++++++++++++ .../lib/index.js | 5 +++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 packages/project-management-automation/lib/if-not-fork.js diff --git a/packages/project-management-automation/lib/if-not-fork.js b/packages/project-management-automation/lib/if-not-fork.js new file mode 100644 index 00000000000000..a4fc4ba611b4b7 --- /dev/null +++ b/packages/project-management-automation/lib/if-not-fork.js @@ -0,0 +1,21 @@ +/** + * Higher-order function which executes and returns the result of the given + * handler only if the enhanced function is called with a payload indicating a + * pull request event which did not originate from a forked repository. + * + * @param {Function} handler Original task. + * + * @return {Function} Enhanced task. + */ +function ifNotFork( handler ) { + return ( payload, ...args ) => { + if ( + payload.pull_request.head.repo.full_name === + payload.pull_request.base.repo.full_name + ) { + return handler( payload, ...args ); + } + }; +} + +module.exports = ifNotFork; diff --git a/packages/project-management-automation/lib/index.js b/packages/project-management-automation/lib/index.js index 7407c0ebe0a79e..15d2844c38e48a 100644 --- a/packages/project-management-automation/lib/index.js +++ b/packages/project-management-automation/lib/index.js @@ -11,17 +11,18 @@ const assignFixedIssues = require( './assign-fixed-issues' ); const addFirstTimeContributorLabel = require( './add-first-time-contributor-label' ); const addMilestone = require( './add-milestone' ); const debug = require( './debug' ); +const ifNotFork = require( './if-not-fork' ); const automations = [ { event: 'pull_request', action: 'opened', - task: assignFixedIssues, + task: ifNotFork( assignFixedIssues ), }, { event: 'pull_request', action: 'opened', - task: addFirstTimeContributorLabel, + task: ifNotFork( addFirstTimeContributorLabel ), }, { event: 'pull_request', From 83762b85a80cd4e4d7fb578ef9def223a4f9caba Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Tue, 4 Feb 2020 07:48:03 +0100 Subject: [PATCH 16/29] Docs: Add the published version for @wordpress/keyboard-shortcuts package --- packages/keyboard-shortcuts/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/keyboard-shortcuts/CHANGELOG.md b/packages/keyboard-shortcuts/CHANGELOG.md index 0a7aea6e822a5c..07595288b70282 100644 --- a/packages/keyboard-shortcuts/CHANGELOG.md +++ b/packages/keyboard-shortcuts/CHANGELOG.md @@ -1,3 +1,3 @@ -# Master +## 0.2.0 (2020-01-13) Initial release. From cd97bf44f5dfe1bb43e11fd99290bb41344d0dc1 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Tue, 4 Feb 2020 07:52:50 +0100 Subject: [PATCH 17/29] Update changelog files --- packages/babel-preset-default/CHANGELOG.md | 2 ++ packages/create-block/CHANGELOG.md | 2 ++ packages/docgen/CHANGELOG.md | 2 ++ packages/env/CHANGELOG.md | 2 ++ packages/eslint-plugin/CHANGELOG.md | 2 ++ packages/jest-preset-default/CHANGELOG.md | 2 ++ packages/priority-queue/CHANGELOG.md | 2 ++ packages/redux-routine/CHANGELOG.md | 2 ++ packages/scripts/CHANGELOG.md | 2 ++ packages/server-side-render/CHANGELOG.md | 2 ++ 10 files changed, 20 insertions(+) diff --git a/packages/babel-preset-default/CHANGELOG.md b/packages/babel-preset-default/CHANGELOG.md index 03a4a6fe228cc0..16bd181f83a302 100644 --- a/packages/babel-preset-default/CHANGELOG.md +++ b/packages/babel-preset-default/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 4.10.0 (2020-02-04) + ### New Feature - The bundled `@babel/core` dependency has been updated from requiring `^7.4.4` to requiring `^7.8.3`. All other Babel plugins were updated to the latest version. `@babel/preset-env` has now ESMAScript 2020 support enabled by default (see [Highlights](https://babeljs.io/blog/2020/01/11/7.8.0#highlights)). diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md index 4caef89dc97206..6b415aa59554e9 100644 --- a/packages/create-block/CHANGELOG.md +++ b/packages/create-block/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 0.6.0 (2020-02-04) + ### Enhancements - Removed the code that clears the terminal while the block is scaffolded ([#19867](https://github.com/WordPress/gutenberg/pull/19867)). diff --git a/packages/docgen/CHANGELOG.md b/packages/docgen/CHANGELOG.md index ad56d076e2f0ae..38f320046f180d 100644 --- a/packages/docgen/CHANGELOG.md +++ b/packages/docgen/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 1.7.0 (2020-02-04) + ### Bug Fixes - The built-in Markdown formatter will output text indicating that the type is unknown if a type cannot be parsed. Previously, these would be output wrongly as the `null` type. diff --git a/packages/env/CHANGELOG.md b/packages/env/CHANGELOG.md index bcd5fea3c64784..b769f45de65ae2 100644 --- a/packages/env/CHANGELOG.md +++ b/packages/env/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 0.4.0 (2020-02-04) + ### Bug Fixes - When running scripts using `wp-env run`, the output will not be formatted if not written to terminal display, resolving an issue where piped or redirected output could be unintentionally padded with newlines. diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 3f8ef085dd3a8b..b0e480f8abd20d 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 3.4.0 (2020-02-04) + ### New Features - The `recommended` ruleset no longer enables rules that check code formatting (whitespace, indenting, etc.) and that could conflict with Prettier. These rules are now enforced by Prettier itself through a plugin that diffs the code with its formatted output and reports the differences as lint errors. `eslint-plugin-prettier` was chosen over options like `prettier-eslint` because we don't run `eslint --fix` in hooks as we'd rather leave certain linting errors to be resolved or ignored at the author's discretion. We also don't apply any additional formatting with `eslint` over `prettier`, so the overhead would be unnecessary. `eslint-plugin-prettier` was chosen over options like `prettier --check` because it's nice to see format errors as you type as it leads you to write code with a more optimal auto-formatted output and it avoids issues like comment directives being moved out of place by `prettier` and the author not realizing it. diff --git a/packages/jest-preset-default/CHANGELOG.md b/packages/jest-preset-default/CHANGELOG.md index 0c5084eef00658..6113ac0aba4d7c 100644 --- a/packages/jest-preset-default/CHANGELOG.md +++ b/packages/jest-preset-default/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 5.4.0 (2020-02-04) + ### Bug Fixes - Use `require.resolve()` instead of `` to resolve `jest` config files according to the NodeJS lookup algorithm. ([#19957](https://github.com/WordPress/gutenberg/pull/19957)) diff --git a/packages/priority-queue/CHANGELOG.md b/packages/priority-queue/CHANGELOG.md index 6f2b1e56bfa8d5..e4a76269c9ca8a 100644 --- a/packages/priority-queue/CHANGELOG.md +++ b/packages/priority-queue/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 1.5.0 (2020-02-04) + ### Bug Fixes - Resolves an issue where `flush` would not invoke the callback associated with the given element. The previous implementation would simply remove the element from the queue. The updated behavior adheres to what one would expect from a flush as in to complete the deferred execution immediately. With these changes, all callbacks will always (eventually) be invoked unless the application is abruptly terminated. A future version could introduce support for a `remove` function to replicate the previous behavior of `flush`. diff --git a/packages/redux-routine/CHANGELOG.md b/packages/redux-routine/CHANGELOG.md index 34283bf35146ac..ee12aca29a4e3b 100644 --- a/packages/redux-routine/CHANGELOG.md +++ b/packages/redux-routine/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 3.7.0 (2020-02-04) + ### Bug Fix - Change the `isGenerator` check for better compatibility with generator helper libraries ([#19666](https://github.com/WordPress/gutenberg/pull/19666)). diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index f22a8d37f8fe61..9d89a3bca8194f 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 7.0.0 (2020-02-04) + ### Breaking Changes - This package requires now `node` v10.0.0 or later, and `npm` v6.9.0 or later ([#18048](https://github.com/WordPress/gutenberg/pull/18048)). diff --git a/packages/server-side-render/CHANGELOG.md b/packages/server-side-render/CHANGELOG.md index 2b193ca61e76b9..2ed1d51ef27fda 100644 --- a/packages/server-side-render/CHANGELOG.md +++ b/packages/server-side-render/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 1.7.0 (2020-02-04) + ### Bug - Fix errant `className` being output on default empty placeholder. [#19555](https://github.com/WordPress/gutenberg/pull/19555) From 227e8bfcf09a05e8222b7b967e558603cbc3d82f Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Tue, 4 Feb 2020 08:13:43 +0100 Subject: [PATCH 18/29] Docs: Update CHANGELOG entries for packages with initial releases --- packages/icons/CHANGELOG.md | 4 +++- packages/keyboard-shortcuts/CHANGELOG.md | 4 +++- packages/warning/CHANGELOG.md | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/icons/CHANGELOG.md b/packages/icons/CHANGELOG.md index fdaebccb1aa006..15517d8f1ce7c7 100644 --- a/packages/icons/CHANGELOG.md +++ b/packages/icons/CHANGELOG.md @@ -1,3 +1,5 @@ ## Master -- Initial release +## 1.0.0 (2020-02-04) + +Initial release. diff --git a/packages/keyboard-shortcuts/CHANGELOG.md b/packages/keyboard-shortcuts/CHANGELOG.md index 07595288b70282..15517d8f1ce7c7 100644 --- a/packages/keyboard-shortcuts/CHANGELOG.md +++ b/packages/keyboard-shortcuts/CHANGELOG.md @@ -1,3 +1,5 @@ -## 0.2.0 (2020-01-13) +## Master + +## 1.0.0 (2020-02-04) Initial release. diff --git a/packages/warning/CHANGELOG.md b/packages/warning/CHANGELOG.md index e69de29bb2d1d6..15517d8f1ce7c7 100644 --- a/packages/warning/CHANGELOG.md +++ b/packages/warning/CHANGELOG.md @@ -0,0 +1,5 @@ +## Master + +## 1.0.0 (2020-02-04) + +Initial release. From 262da029f54a9dcb70d6e6a83cc6efbd822bdb28 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Tue, 4 Feb 2020 09:20:33 +0100 Subject: [PATCH 19/29] chore(release): publish - @wordpress/a11y@2.7.0 - @wordpress/annotations@1.11.0 - @wordpress/api-fetch@3.10.0 - @wordpress/autop@2.6.0 - @wordpress/babel-plugin-import-jsx-pragma@2.5.0 - @wordpress/babel-plugin-makepot@3.4.0 - @wordpress/babel-preset-default@4.10.0 - @wordpress/base-styles@1.3.0 - @wordpress/blob@2.7.0 - @wordpress/block-directory@1.4.0 - @wordpress/block-editor@3.6.0 - @wordpress/block-library@2.13.0 - @wordpress/block-serialization-default-parser@3.5.0 - @wordpress/block-serialization-spec-parser@3.4.0 - @wordpress/blocks@6.11.0 - @wordpress/components@9.1.0 - @wordpress/compose@3.11.0 - @wordpress/core-data@2.11.0 - @wordpress/create-block@0.6.0 - @wordpress/custom-templated-path-webpack-plugin@1.6.0 - @wordpress/data-controls@1.7.0 - @wordpress/data@4.13.0 - @wordpress/date@3.8.0 - @wordpress/dependency-extraction-webpack-plugin@2.2.0 - @wordpress/deprecated@2.7.0 - @wordpress/docgen@1.7.0 - @wordpress/dom-ready@2.7.0 - @wordpress/dom@2.8.0 - @wordpress/e2e-test-utils@4.2.0 - @wordpress/e2e-tests@1.11.0 - @wordpress/edit-post@3.12.0 - @wordpress/edit-site@1.1.0 - @wordpress/edit-widgets@0.11.0 - @wordpress/editor@9.11.0 - @wordpress/element@2.11.0 - @wordpress/env@0.4.0 - @wordpress/escape-html@1.7.0 - @wordpress/eslint-plugin@3.4.0 - @wordpress/format-library@1.13.0 - @wordpress/hooks@2.7.0 - @wordpress/html-entities@2.6.0 - @wordpress/i18n@3.9.0 - @wordpress/icons@1.0.0 - @wordpress/is-shallow-equal@1.8.0 - @wordpress/jest-console@3.5.0 - @wordpress/jest-preset-default@5.4.0 - @wordpress/jest-puppeteer-axe@1.6.0 - @wordpress/keyboard-shortcuts@1.0.0 - @wordpress/keycodes@2.9.0 - @wordpress/library-export-default-webpack-plugin@1.6.0 - @wordpress/list-reusable-blocks@1.12.0 - @wordpress/media-utils@1.6.0 - @wordpress/notices@1.12.0 - @wordpress/npm-package-json-lint-config@2.2.0 - @wordpress/nux@3.11.0 - @wordpress/plugins@2.11.0 - @wordpress/postcss-themes@2.3.0 - @wordpress/primitives@1.0.0 - @wordpress/priority-queue@1.5.0 - @wordpress/project-management-automation@1.1.0 - @wordpress/redux-routine@3.7.0 - @wordpress/rich-text@3.11.0 - @wordpress/scripts@7.0.0 - @wordpress/server-side-render@1.7.0 - @wordpress/shortcode@2.6.0 - @wordpress/token-list@1.9.0 - @wordpress/url@2.10.0 - @wordpress/viewport@2.12.0 - @wordpress/warning@1.0.0 - @wordpress/wordcount@2.7.0 --- packages/a11y/package.json | 2 +- packages/annotations/package.json | 2 +- packages/api-fetch/package.json | 2 +- packages/autop/package.json | 2 +- packages/babel-plugin-import-jsx-pragma/package.json | 2 +- packages/babel-plugin-makepot/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 | 4 ++-- packages/custom-templated-path-webpack-plugin/package.json | 2 +- packages/data-controls/package.json | 2 +- packages/data/package.json | 2 +- packages/date/package.json | 2 +- packages/dependency-extraction-webpack-plugin/package.json | 2 +- packages/deprecated/package.json | 2 +- packages/docgen/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/is-shallow-equal/package.json | 2 +- packages/jest-console/package.json | 2 +- packages/jest-preset-default/package.json | 2 +- packages/jest-puppeteer-axe/package.json | 2 +- packages/keyboard-shortcuts/package.json | 2 +- packages/keycodes/package.json | 2 +- packages/library-export-default-webpack-plugin/package.json | 2 +- packages/list-reusable-blocks/package.json | 2 +- packages/media-utils/package.json | 2 +- packages/notices/package.json | 2 +- packages/npm-package-json-lint-config/package.json | 2 +- packages/nux/package.json | 2 +- packages/plugins/package.json | 2 +- packages/postcss-themes/package.json | 2 +- packages/primitives/package.json | 2 +- packages/priority-queue/package.json | 2 +- packages/project-management-automation/package.json | 2 +- packages/redux-routine/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/token-list/package.json | 2 +- packages/url/package.json | 2 +- packages/viewport/package.json | 2 +- packages/warning/package.json | 2 +- packages/wordcount/package.json | 2 +- 69 files changed, 70 insertions(+), 70 deletions(-) diff --git a/packages/a11y/package.json b/packages/a11y/package.json index 20efdcbe2c69b9..3f2dc80ae20901 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/a11y", - "version": "2.6.0", + "version": "2.7.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 f2440087022d84..dffff978d8667a 100644 --- a/packages/annotations/package.json +++ b/packages/annotations/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/annotations", - "version": "1.10.0", + "version": "1.11.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 8bf265119dab42..9040c5a1591a91 100644 --- a/packages/api-fetch/package.json +++ b/packages/api-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/api-fetch", - "version": "3.9.0", + "version": "3.10.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 dab9b1330e4f6d..9a4f5d7fbaaacb 100644 --- a/packages/autop/package.json +++ b/packages/autop/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/autop", - "version": "2.5.1", + "version": "2.6.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-plugin-import-jsx-pragma/package.json b/packages/babel-plugin-import-jsx-pragma/package.json index 7de33046158ac0..dc1f364e6b9bca 100644 --- a/packages/babel-plugin-import-jsx-pragma/package.json +++ b/packages/babel-plugin-import-jsx-pragma/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/babel-plugin-import-jsx-pragma", - "version": "2.4.0", + "version": "2.5.0", "description": "Babel transform plugin for automatically injecting an import to be used as the pragma for the React JSX Transform plugin.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/babel-plugin-makepot/package.json b/packages/babel-plugin-makepot/package.json index 1db4205d3b36f2..2219269afd4b65 100644 --- a/packages/babel-plugin-makepot/package.json +++ b/packages/babel-plugin-makepot/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/babel-plugin-makepot", - "version": "3.3.0", + "version": "3.4.0", "description": "WordPress Babel internationalization (i18n) plugin.", "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 b27ce490af91ba..9661558f620a48 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": "4.9.0", + "version": "4.10.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 0c47cd8b3ac820..ef05584ee46ea0 100644 --- a/packages/base-styles/package.json +++ b/packages/base-styles/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/base-styles", - "version": "1.2.0", + "version": "1.3.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 a64f8bf3f7fd72..86a19462a1e219 100644 --- a/packages/blob/package.json +++ b/packages/blob/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blob", - "version": "2.6.0", + "version": "2.7.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 bfe40f6669b516..e4a605d09bafed 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-directory", - "version": "1.3.0", + "version": "1.4.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 49b4e4fd8fa59b..e7780f68a3e25b 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-editor", - "version": "3.5.0", + "version": "3.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 9f040c95070518..e292ffe981c1a9 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-library", - "version": "2.12.0", + "version": "2.13.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 8edb62a29e442a..fdefc9a59fa7bd 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": "3.4.1", + "version": "3.5.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 289e8b8e86afd4..1c5e9f2c6d715a 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": "3.3.1", + "version": "3.4.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 6c4c14f191e8e5..1aae1940208f3e 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blocks", - "version": "6.10.0", + "version": "6.11.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 33d1ade2865880..93cb4efcbcab59 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/components", - "version": "9.0.0", + "version": "9.1.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 ad57b911e86240..8f677e9c875209 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/compose", - "version": "3.10.0", + "version": "3.11.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 53e1213e9bd5e1..f120ea8259e453 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/core-data", - "version": "2.10.0", + "version": "2.11.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 b438e113fc86f5..3e8c01f6f25414 100644 --- a/packages/create-block/package.json +++ b/packages/create-block/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/create-block", - "version": "0.5.1", + "version": "0.6.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", @@ -12,7 +12,7 @@ "homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/create-block/README.md", "repository": { "type": "git", - "url": "https://github.com/WordPress/gutenberg.git", + "url": "https://github.com/WordPress/gutenberg.git", "directory": "packages/create-block" }, "bugs": { diff --git a/packages/custom-templated-path-webpack-plugin/package.json b/packages/custom-templated-path-webpack-plugin/package.json index e00a9b36cfbefe..cddc8182f2ad8d 100644 --- a/packages/custom-templated-path-webpack-plugin/package.json +++ b/packages/custom-templated-path-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/custom-templated-path-webpack-plugin", - "version": "1.5.0", + "version": "1.6.0", "description": "Webpack plugin for creating custom path template tags.", "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 b594ad9d395029..a1348a50f30694 100644 --- a/packages/data-controls/package.json +++ b/packages/data-controls/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data-controls", - "version": "1.6.0", + "version": "1.7.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 a252f9b9f93179..e444276fb7e5bb 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data", - "version": "4.12.0", + "version": "4.13.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 7a33eeda5f5259..c095c6a6a8aac9 100644 --- a/packages/date/package.json +++ b/packages/date/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/date", - "version": "3.7.0", + "version": "3.8.0", "description": "Date module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dependency-extraction-webpack-plugin/package.json b/packages/dependency-extraction-webpack-plugin/package.json index 1b2fc0100f848e..68ea17505e2ddc 100644 --- a/packages/dependency-extraction-webpack-plugin/package.json +++ b/packages/dependency-extraction-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dependency-extraction-webpack-plugin", - "version": "2.1.0", + "version": "2.2.0", "description": "Extract WordPress script dependencies from webpack bundles.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/deprecated/package.json b/packages/deprecated/package.json index d32cddb4c07d85..fd5b82f0a52da1 100644 --- a/packages/deprecated/package.json +++ b/packages/deprecated/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/deprecated", - "version": "2.6.1", + "version": "2.7.0", "description": "Deprecation utility for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/docgen/package.json b/packages/docgen/package.json index ad9514da201fa1..d0fc143594a7c6 100644 --- a/packages/docgen/package.json +++ b/packages/docgen/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/docgen", - "version": "1.6.0", + "version": "1.7.0", "description": "Autogenerate public API documentation from exports and JSDoc comments.", "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 e2f90141a61a18..6fd51bdd0b7144 100644 --- a/packages/dom-ready/package.json +++ b/packages/dom-ready/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom-ready", - "version": "2.6.0", + "version": "2.7.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 ba00693ce6ed75..e0199899bb23a3 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom", - "version": "2.7.0", + "version": "2.8.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 ad3cedd9c02963..68096411fe8b6a 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": "4.1.0", + "version": "4.2.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 5dd307b14f2089..1ba7356f544206 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/e2e-tests", - "version": "1.10.0", + "version": "1.11.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 96b9ae2fb4802d..784ee9757d746e 100644 --- a/packages/edit-post/package.json +++ b/packages/edit-post/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-post", - "version": "3.11.0", + "version": "3.12.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 dba4705d9c3511..1daa2484564e5f 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-site", - "version": "1.0.0", + "version": "1.1.0", "private": true, "description": "Edit Site Page module for WordPress.", "author": "The WordPress Contributors", diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json index 5e20e2542da47d..215a15f1ca5bad 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-widgets", - "version": "0.10.0", + "version": "0.11.0", "private": true, "description": "Widgets Page module for WordPress..", "author": "The WordPress Contributors", diff --git a/packages/editor/package.json b/packages/editor/package.json index 25b93d197d6eac..7b46f86ae89e28 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/editor", - "version": "9.10.0", + "version": "9.11.0", "description": "Building blocks for WordPress editors.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/element/package.json b/packages/element/package.json index 27b0baa493d26a..24a1efe4ef6091 100644 --- a/packages/element/package.json +++ b/packages/element/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/element", - "version": "2.10.0", + "version": "2.11.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 9c7d0e5c577c42..64b8bd6bdeabfb 100644 --- a/packages/env/package.json +++ b/packages/env/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/env", - "version": "0.3.0", + "version": "0.4.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 73224ac85f92f1..fab30cccc0bece 100644 --- a/packages/escape-html/package.json +++ b/packages/escape-html/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/escape-html", - "version": "1.6.0", + "version": "1.7.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 f2ead7d1ecb7d1..e01afc03ec5b1a 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/eslint-plugin", - "version": "3.3.0", + "version": "3.4.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 9bc1986d977908..49c7b488a0b0dc 100644 --- a/packages/format-library/package.json +++ b/packages/format-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/format-library", - "version": "1.12.0", + "version": "1.13.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 6023d6fd4291ef..260515652d5b3d 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/hooks", - "version": "2.6.0", + "version": "2.7.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 027d5851074db9..5e0cb8c0f1d047 100644 --- a/packages/html-entities/package.json +++ b/packages/html-entities/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/html-entities", - "version": "2.5.0", + "version": "2.6.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 405862ba99b779..a328ecf0959d09 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/i18n", - "version": "3.8.0", + "version": "3.9.0", "description": "WordPress internationalization (i18n) library.", "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 566cc4199a2919..0800bdb4e75437 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": "1.7.0", + "version": "1.8.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-console/package.json b/packages/jest-console/package.json index e3c87ca9724aed..1403c4b16d858c 100644 --- a/packages/jest-console/package.json +++ b/packages/jest-console/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/jest-console", - "version": "3.4.0", + "version": "3.5.0", "description": "Custom Jest matchers for the Console object.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/jest-preset-default/package.json b/packages/jest-preset-default/package.json index aca3dfc47fcccd..f21666ff2f55a6 100644 --- a/packages/jest-preset-default/package.json +++ b/packages/jest-preset-default/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/jest-preset-default", - "version": "5.3.1", + "version": "5.4.0", "description": "Default Jest preset for WordPress development.", "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 9cbd767ca3406b..03e84e46c75e0b 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": "1.5.0", + "version": "1.6.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 7c41057b115243..6d24bca8d2630b 100644 --- a/packages/keyboard-shortcuts/package.json +++ b/packages/keyboard-shortcuts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keyboard-shortcuts", - "version": "0.2.0", + "version": "1.0.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 5a7fb1584955a6..8aae78cf107225 100644 --- a/packages/keycodes/package.json +++ b/packages/keycodes/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keycodes", - "version": "2.8.0", + "version": "2.9.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/library-export-default-webpack-plugin/package.json b/packages/library-export-default-webpack-plugin/package.json index 6edc1347ea027b..8eac81b456df60 100644 --- a/packages/library-export-default-webpack-plugin/package.json +++ b/packages/library-export-default-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/library-export-default-webpack-plugin", - "version": "1.5.0", + "version": "1.6.0", "description": "Webpack plugin for exporting default property for selected libraries.", "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 20f555c5919241..3b5e11d881c9ac 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": "1.11.0", + "version": "1.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 7ae6744aebcf31..8842215cac8636 100644 --- a/packages/media-utils/package.json +++ b/packages/media-utils/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/media-utils", - "version": "1.5.0", + "version": "1.6.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 62c7edf918a636..eb96ae94f85c8b 100644 --- a/packages/notices/package.json +++ b/packages/notices/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/notices", - "version": "1.11.0", + "version": "1.12.0", "description": "State management for notices.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/npm-package-json-lint-config/package.json b/packages/npm-package-json-lint-config/package.json index 058dadc1d4eff4..891d197e331219 100644 --- a/packages/npm-package-json-lint-config/package.json +++ b/packages/npm-package-json-lint-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/npm-package-json-lint-config", - "version": "2.1.0", + "version": "2.2.0", "description": "WordPress npm-package-json-lint shareable configuration.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/nux/package.json b/packages/nux/package.json index cd8d44da60e5f5..7f6fdd6f4f1e00 100644 --- a/packages/nux/package.json +++ b/packages/nux/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/nux", - "version": "3.10.0", + "version": "3.11.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 97fb84ae1bab07..5f099903e4e998 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/plugins", - "version": "2.10.0", + "version": "2.11.0", "description": "Plugins module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/postcss-themes/package.json b/packages/postcss-themes/package.json index b19f52e5ef976b..10acc270b33ae2 100644 --- a/packages/postcss-themes/package.json +++ b/packages/postcss-themes/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/postcss-themes", - "version": "2.2.0", + "version": "2.3.0", "description": "PostCSS plugin to generate theme colors.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/primitives/package.json b/packages/primitives/package.json index b36aa3511d855f..4e6fc510a75a6f 100644 --- a/packages/primitives/package.json +++ b/packages/primitives/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/primitives", - "version": "0.0.1", + "version": "1.0.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 5ec0688abeee97..913c73189d2ea2 100644 --- a/packages/priority-queue/package.json +++ b/packages/priority-queue/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/priority-queue", - "version": "1.4.0", + "version": "1.5.0", "description": "Generic browser priority queue.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/project-management-automation/package.json b/packages/project-management-automation/package.json index 55a57f2e140d56..2adcb9bef5b75e 100644 --- a/packages/project-management-automation/package.json +++ b/packages/project-management-automation/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/project-management-automation", - "version": "1.0.0", + "version": "1.1.0", "description": "GitHub Action that implements various automation to assist with managing the Gutenberg GitHub repository.", "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 1dbd43561270d0..89db00b09fff9f 100644 --- a/packages/redux-routine/package.json +++ b/packages/redux-routine/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/redux-routine", - "version": "3.6.2", + "version": "3.7.0", "description": "Redux middleware for generator coroutines.", "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 350e2a5c5d11e3..78032252b1d48c 100644 --- a/packages/rich-text/package.json +++ b/packages/rich-text/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/rich-text", - "version": "3.10.0", + "version": "3.11.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 2696ea7ac5929f..7d72c5fe134bfd 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/scripts", - "version": "6.2.0", + "version": "7.0.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 82ab0dd3ae72c4..9a83e9c9e0ac10 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": "1.6.0", + "version": "1.7.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 fbcc62a3bd8d9b..ed8ce524c2f45a 100644 --- a/packages/shortcode/package.json +++ b/packages/shortcode/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/shortcode", - "version": "2.5.0", + "version": "2.6.0", "description": "Shortcode module for WordPress.", "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 01c9d53cc28436..2e7947df9e8f59 100644 --- a/packages/token-list/package.json +++ b/packages/token-list/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/token-list", - "version": "1.8.0", + "version": "1.9.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 9e1a16eeccc617..dcaa2ba60c7846 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/url", - "version": "2.9.0", + "version": "2.10.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 76c9e95f8e9e25..dc8f8fa4135bea 100644 --- a/packages/viewport/package.json +++ b/packages/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/viewport", - "version": "2.11.0", + "version": "2.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 076f28d16150ed..fd94779db9e83b 100644 --- a/packages/warning/package.json +++ b/packages/warning/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/warning", - "version": "0.0.1", + "version": "1.0.0", "description": "Warning utility for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/wordcount/package.json b/packages/wordcount/package.json index b7f7c277262dc0..1b7dbcbf5bcb46 100644 --- a/packages/wordcount/package.json +++ b/packages/wordcount/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/wordcount", - "version": "2.6.2", + "version": "2.7.0", "description": "WordPress word count utility.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", From 6fc88cade742036261bfb31140ed0bc134e9407d Mon Sep 17 00:00:00 2001 From: andrei draganescu Date: Tue, 4 Feb 2020 12:55:38 +0200 Subject: [PATCH 20/29] Generates excerpt using core get_the_excerpt (#19669) * generates exerpt using core get_the_excerpt; fixes excerpt raw logic in client side editor rendering * removes unused variable * removes the fall back on post content in case excerpt is empty --- packages/block-library/src/latest-posts/edit.js | 4 +--- packages/block-library/src/latest-posts/index.php | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js index 1127716fd0833a..018f1ba8e51ae4 100644 --- a/packages/block-library/src/latest-posts/edit.js +++ b/packages/block-library/src/latest-posts/edit.js @@ -233,9 +233,7 @@ class LatestPostsEdit extends Component { { displayPosts.map( ( post, i ) => { const titleTrimmed = post.title.rendered.trim(); let excerpt = post.excerpt.rendered; - if ( post.excerpt.raw === '' ) { - excerpt = post.content.raw; - } + const excerptElement = document.createElement( 'div' ); excerptElement.innerHTML = excerpt; excerpt = diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index b8fc02cf80daa1..5d05fb92181814 100644 --- a/packages/block-library/src/latest-posts/index.php +++ b/packages/block-library/src/latest-posts/index.php @@ -29,8 +29,6 @@ function render_block_core_latest_posts( $attributes ) { $list_items_markup = ''; - $excerpt_length = $attributes['excerptLength']; - foreach ( $recent_posts as $post ) { $title = get_the_title( $post ); if ( ! $title ) { @@ -52,11 +50,8 @@ function render_block_core_latest_posts( $attributes ) { if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] && isset( $attributes['displayPostContentRadio'] ) && 'excerpt' === $attributes['displayPostContentRadio'] ) { - $post_excerpt = $post->post_excerpt; - if ( ! ( $post_excerpt ) ) { - $post_excerpt = $post->post_content; - } - $trimmed_excerpt = esc_html( wp_trim_words( $post_excerpt, $excerpt_length, ' … ' ) ); + + $trimmed_excerpt = get_the_excerpt( $post ); $list_items_markup .= sprintf( '
%1$s', From 3b00abfab14dacb9e4c7b2e9ae135be8f3864376 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Tue, 4 Feb 2020 16:13:30 +0200 Subject: [PATCH 21/29] Add prettier dependency to @wordpress/eslint-plugin (#20028) * The recommended ruleset now requires prettier * Sync the lock file --- package-lock.json | 1 + packages/eslint-plugin/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index 9fd0ce179aa06a..7f375d237a929e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10521,6 +10521,7 @@ "eslint-plugin-react": "^7.14.3", "eslint-plugin-react-hooks": "^1.6.1", "globals": "^12.0.0", + "prettier": "npm:wp-prettier@1.19.1", "requireindex": "^1.2.0" } }, diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e01afc03ec5b1a..de9fd254d57fbf 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -33,6 +33,7 @@ "eslint-plugin-react": "^7.14.3", "eslint-plugin-react-hooks": "^1.6.1", "globals": "^12.0.0", + "prettier": "npm:wp-prettier@1.19.1", "requireindex": "^1.2.0" }, "peerDependencies": { From 2193ce9368817efdc68ca5a70ad59f19d3f0fe6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=28Greg=29=20Zi=C3=B3=C5=82kowski?= Date: Tue, 4 Feb 2020 16:14:59 +0100 Subject: [PATCH 22/29] Accessibility: Show open button when the sidebar is closed and tabbing out of the content (#19726) --- .../src/components/editor-regions/style.scss | 25 +++++++++-- .../edit-post/src/components/layout/index.js | 36 ++++++++++++--- .../src/components/layout/style.scss | 44 ++++++++++--------- 3 files changed, 75 insertions(+), 30 deletions(-) diff --git a/packages/edit-post/src/components/editor-regions/style.scss b/packages/edit-post/src/components/editor-regions/style.scss index 65eceb6e17f040..671b782901fe59 100644 --- a/packages/edit-post/src/components/editor-regions/style.scss +++ b/packages/edit-post/src/components/editor-regions/style.scss @@ -74,6 +74,27 @@ html { } .edit-post-editor-regions__sidebar { + display: none; + + @include break-medium() { + display: block; + z-index: z-index(".edit-post-editor-regions__sidebar"); + position: fixed !important; // Need to override the default relative positionning + top: -9999em; + bottom: auto; + left: auto; + right: 0; + width: $sidebar-width; + + &:focus { + top: auto; + bottom: 0; + } + } +} + +.is-sidebar-opened .edit-post-editor-regions__sidebar { + display: block; width: auto; // Keep the sidebar width flexible. flex-shrink: 0; position: absolute; @@ -84,10 +105,6 @@ html { left: 0; background: $white; - &:empty { - display: none; - } - // On Mobile the header is fixed to keep HTML as scrollable. @include break-medium() { overflow: auto; diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index adefc6eb48d83d..f09141b9a89055 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -52,9 +52,11 @@ import WelcomeGuide from '../welcome-guide'; function Layout() { const isMobileViewport = useViewportMatch( 'small', '<' ); - const { closePublishSidebar, togglePublishSidebar } = useDispatch( - 'core/edit-post' - ); + const { + closePublishSidebar, + openGeneralSidebar, + togglePublishSidebar, + } = useDispatch( 'core/edit-post' ); const { mode, isRichEditingEnabled, @@ -66,6 +68,7 @@ function Layout() { hasFixedToolbar, previousShortcut, nextShortcut, + hasBlockSelected, } = useSelect( ( select ) => { return { hasFixedToolbar: select( 'core/edit-post' ).isFeatureActive( @@ -93,6 +96,9 @@ function Layout() { nextShortcut: select( 'core/keyboard-shortcuts' ).getAllShortcutRawKeyCombinations( 'core/edit-post/next-region' ), + hasBlockSelected: select( + 'core/block-editor' + ).getBlockSelectionStart(), }; }, [] ); const showPageTemplatePicker = __experimentalUsePageTemplatePickerVisible(); @@ -103,6 +109,10 @@ function Layout() { 'has-fixed-toolbar': hasFixedToolbar, 'has-metaboxes': hasActiveMetaboxes, } ); + const openSidebarPanel = () => + openGeneralSidebar( + hasBlockSelected ? 'edit-post/block' : 'edit-post/document' + ); return ( <> @@ -120,6 +130,22 @@ function Layout() { sidebar={ ! publishSidebarOpened && ( <> + { ! sidebarIsOpened && ( +
+ +
+ ) } @@ -165,10 +191,10 @@ function Layout() { } /> ) : ( -
+