From 55b723e965b957b88161d4f511d897fab9d4390d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Mon, 18 Jan 2021 23:51:34 +0100 Subject: [PATCH 01/61] Edit Site: Fix template export (#28292) We were trying to use an object as an array and this caused the export endpoint to fail. --- lib/full-site-editing/edit-site-export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/full-site-editing/edit-site-export.php b/lib/full-site-editing/edit-site-export.php index a08450f548b6c5..7056fa2c70f254 100644 --- a/lib/full-site-editing/edit-site-export.php +++ b/lib/full-site-editing/edit-site-export.php @@ -56,7 +56,7 @@ function gutenberg_edit_site_export() { // Load templates into the zip file. $templates = gutenberg_get_block_templates(); foreach ( $templates as $template ) { - $updated_content = _remove_theme_attribute_from_content( $template['content'] ); + $updated_content = _remove_theme_attribute_from_content( $template->content ); $template->content = $updated_content; $zip->addFromString( From 88eb44812d9bdbe0dca4fef2b7721e2c13240105 Mon Sep 17 00:00:00 2001 From: Kai Hao Date: Tue, 19 Jan 2021 10:17:53 +0800 Subject: [PATCH 02/61] [Widgets screen] Fix categorization not showing in the global inserter (#28036) * Make widget-area a special block to show cateogrization in the inserter * Fix test * Remove outdated childBlocks check in the inserter * Add test for the widgets screen * Remove unused ChildBlocks component --- .../components/inserter/block-types-tab.js | 118 +++++++----------- .../src/components/inserter/child-blocks.js | 35 ------ .../inserter/test/block-types-tab.js | 15 --- .../specs/widgets/adding-widgets.test.js | 5 + 4 files changed, 48 insertions(+), 125 deletions(-) delete mode 100644 packages/block-editor/src/components/inserter/child-blocks.js diff --git a/packages/block-editor/src/components/inserter/block-types-tab.js b/packages/block-editor/src/components/inserter/block-types-tab.js index 3b2ab959e3ef9c..94b76b02ac694f 100644 --- a/packages/block-editor/src/components/inserter/block-types-tab.js +++ b/packages/block-editor/src/components/inserter/block-types-tab.js @@ -7,15 +7,12 @@ import { map, findIndex, flow, sortBy, groupBy, orderBy } from 'lodash'; * WordPress dependencies */ import { __, _x } from '@wordpress/i18n'; -import { store as blocksStore } from '@wordpress/blocks'; import { useMemo, useEffect } from '@wordpress/element'; -import { useSelect } from '@wordpress/data'; /** * Internal dependencies */ import BlockTypesList from '../block-types-list'; -import ChildBlocks from './child-blocks'; import InserterPanel from './panel'; import useBlockTypesState from './hooks/use-block-types-state'; @@ -34,17 +31,6 @@ export function BlockTypesTab( { onInsert ); - const hasChildItems = useSelect( - ( select ) => { - const { getBlockName } = select( 'core/block-editor' ); - const { getChildBlockNames } = select( blocksStore ); - const rootBlockName = getBlockName( rootClientId ); - - return !! getChildBlockNames( rootBlockName ).length; - }, - [ rootClientId ] - ); - const suggestedItems = useMemo( () => { return orderBy( items, [ 'frecency' ], [ 'desc' ] ).slice( 0, @@ -94,56 +80,39 @@ export function BlockTypesTab( { return (
- { hasChildItems && ( - + { showMostUsedBlocks && !! suggestedItems.length && ( + - + ) } - { showMostUsedBlocks && - ! hasChildItems && - !! suggestedItems.length && ( - + { map( categories, ( category ) => { + const categoryItems = itemsPerCategory[ category.slug ]; + if ( ! categoryItems || ! categoryItems.length ) { + return null; + } + return ( + - ) } - - { ! hasChildItems && - map( categories, ( category ) => { - const categoryItems = itemsPerCategory[ category.slug ]; - if ( ! categoryItems || ! categoryItems.length ) { - return null; - } - return ( - - - - ); - } ) } - - { ! hasChildItems && !! uncategorizedItems.length && ( + ); + } ) } + + { ! uncategorizedItems.length && ( ) } - { ! hasChildItems && - map( collections, ( collection, namespace ) => { - const collectionItems = itemsPerCollection[ namespace ]; - if ( ! collectionItems || ! collectionItems.length ) { - return null; - } - - return ( - - - - ); - } ) } + { map( collections, ( collection, namespace ) => { + const collectionItems = itemsPerCollection[ namespace ]; + if ( ! collectionItems || ! collectionItems.length ) { + return null; + } + + return ( + + + + ); + } ) }
); } diff --git a/packages/block-editor/src/components/inserter/child-blocks.js b/packages/block-editor/src/components/inserter/child-blocks.js deleted file mode 100644 index 6e18131954b9dd..00000000000000 --- a/packages/block-editor/src/components/inserter/child-blocks.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * WordPress dependencies - */ -import { store as blocksStore } from '@wordpress/blocks'; -import { useSelect } from '@wordpress/data'; - -/** - * Internal dependencies - */ -import BlockIcon from '../block-icon'; - -export default function ChildBlocks( { rootClientId, children } ) { - const { rootBlockTitle, rootBlockIcon } = useSelect( ( select ) => { - const { getBlockType } = select( blocksStore ); - const { getBlockName } = select( 'core/block-editor' ); - const rootBlockName = getBlockName( rootClientId ); - const rootBlockType = getBlockType( rootBlockName ); - return { - rootBlockTitle: rootBlockType && rootBlockType.title, - rootBlockIcon: rootBlockType && rootBlockType.icon, - }; - } ); - - return ( -
- { ( rootBlockIcon || rootBlockTitle ) && ( -
- - { rootBlockTitle &&

{ rootBlockTitle }

} -
- ) } - { children } -
- ); -} diff --git a/packages/block-editor/src/components/inserter/test/block-types-tab.js b/packages/block-editor/src/components/inserter/test/block-types-tab.js index 2e0d465ce9f414..22e5f9bf81e7bd 100644 --- a/packages/block-editor/src/components/inserter/test/block-types-tab.js +++ b/packages/block-editor/src/components/inserter/test/block-types-tab.js @@ -7,7 +7,6 @@ import { render, fireEvent } from '@testing-library/react'; * WordPress dependencies */ import { registerBlockType, unregisterBlockType } from '@wordpress/blocks'; -import { useSelect } from '@wordpress/data'; /** * Internal dependencies @@ -80,8 +79,6 @@ describe( 'InserterMenu', () => { categories, collections, ] ); - - useSelect.mockImplementation( () => false ); } ); it( 'should show nothing if there are no items', () => { @@ -138,18 +135,6 @@ describe( 'InserterMenu', () => { expect( blocks[ 2 ].textContent ).toBe( 'Some Other Block' ); } ); - it( 'displays child blocks UI when root block has child blocks', () => { - useSelect.mockImplementation( () => true ); - - const { container } = render( ); - - const childBlocksContent = container.querySelector( - '.block-editor-inserter__child-blocks' - ); - - expect( childBlocksContent ).not.toBeNull(); - } ); - it( 'should disable items with `isDisabled`', () => { const { container } = initializeAllClosedMenuState(); const layoutTabContent = container.querySelectorAll( diff --git a/packages/e2e-tests/specs/widgets/adding-widgets.test.js b/packages/e2e-tests/specs/widgets/adding-widgets.test.js index 0123fab09fe86f..657fb46d801043 100644 --- a/packages/e2e-tests/specs/widgets/adding-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/adding-widgets.test.js @@ -52,6 +52,11 @@ describe( 'Widgets screen', () => { const blockLibrary = await page.waitForSelector( '[aria-label="Block Library"][role="region"]' ); + + // Check that there are categorizations in the inserter (#26329). + const categoryHeader = await blockLibrary.$$( 'h2' ); + expect( categoryHeader.length > 0 ).toBe( true ); + const [ addParagraphBlock ] = await blockLibrary.$x( '//*[@role="option"][*[text()="Paragraph"]]' ); From 56dd57d32cc4bfe541256018607aca3623d65de7 Mon Sep 17 00:00:00 2001 From: Kai Hao Date: Tue, 19 Jan 2021 10:27:00 +0800 Subject: [PATCH 03/61] Fix widgets screen e2e tests (#28264) * Wait for the inserter button to be visible * Get the visible inserter button * Delete the widgets one-by-one --- .../specs/widgets/adding-widgets.test.js | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/packages/e2e-tests/specs/widgets/adding-widgets.test.js b/packages/e2e-tests/specs/widgets/adding-widgets.test.js index 657fb46d801043..160798d5cbbe67 100644 --- a/packages/e2e-tests/specs/widgets/adding-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/adding-widgets.test.js @@ -82,6 +82,15 @@ describe( 'Widgets screen', () => { ).toBe( true ); } + async function getInlineInserterButton() { + return await page.waitForSelector( + 'button[aria-label="Add block"][aria-haspopup="true"]', + { + visible: true, + } + ); + } + it( 'Should insert content using the global inserter', async () => { const widgetAreas = await page.$$( '[aria-label="Block: Widget Area"][role="group"]' @@ -181,10 +190,7 @@ describe( 'Widgets screen', () => { 10 ); - // Aria selectors cannot select buttons with the aria-haspopup property, fallback to CSS selector. - const inlineInserterButton = await page.waitForSelector( - 'button[aria-label="Add block"][aria-haspopup="true"]' - ); + let inlineInserterButton = await getInlineInserterButton(); await inlineInserterButton.click(); const inlineQuickInserter = await page.waitForSelector( @@ -234,10 +240,8 @@ describe( 'Widgets screen', () => { secondParagraphBlockBoundingBox.y - 10 ); - const inserterButton = await page.waitForSelector( - 'button[aria-label="Add block"][aria-haspopup="true"]' - ); - await inserterButton.click(); + inlineInserterButton = await getInlineInserterButton(); + await inlineInserterButton.click(); // TODO: The query should be rewritten with role and label. const inserterSearchBox = await page.waitForSelector( @@ -333,21 +337,16 @@ async function getSerializedWidgetAreas() { async function cleanupWidgets() { await visitAdminPage( 'widgets.php' ); - await page.evaluate( () => { - const deleteButtons = document.querySelectorAll( - '#widgets-right .widget button.widget-control-remove' - ); - - deleteButtons.forEach( ( deleteButton ) => deleteButton.click() ); - } ); + let widget = await page.$( '.widgets-sortables .widget' ); - await page.click( '#inactive-widgets-control-remove' ); + // We have to do this one-by-one since there might be race condition when deleting multiple widgets at once. + while ( widget ) { + const deleteButton = await widget.$( 'button.widget-control-remove' ); + const id = await widget.evaluate( ( node ) => node.id ); + await deleteButton.evaluate( ( node ) => node.click() ); + // Wait for the widget to be removed from DOM. + await page.waitForSelector( `#${ id }`, { hidden: true } ); - await page.waitForFunction( - () => - document.querySelectorAll( '.widgets-sortables .widget' ).length === - 0 - ); - // No idea why we need this, but just asserting the widgets are gone seems to be not enough. - await page.waitForTimeout( 500 ); + widget = await page.$( '.widgets-sortables .widget' ); + } } From 8fe2ec8d23c3dc0ad6fc71ccaeadfcea0d548207 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Tue, 19 Jan 2021 09:19:26 +0200 Subject: [PATCH 04/61] Hide query block toolbar settings if query is inherited (#28290) * Hide block toolbar settings if query is inherited * cs --- .../src/query/edit/query-toolbar.js | 118 +++++++++--------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/packages/block-library/src/query/edit/query-toolbar.js b/packages/block-library/src/query/edit/query-toolbar.js index dd079aa1a81103..3420ecb0e8d886 100644 --- a/packages/block-library/src/query/edit/query-toolbar.js +++ b/packages/block-library/src/query/edit/query-toolbar.js @@ -34,63 +34,67 @@ export default function QueryToolbar( { ]; return ( <> - - ( - - ) } - renderContent={ () => ( - <> - - - setQuery( { perPage: +value ?? -1 } ) - } - step="1" - value={ query.perPage } - isDragEnabled={ false } - /> - - - - setQuery( { offset: +value } ) - } - step="1" - value={ query.offset } - isDragEnabled={ false } - /> - - - - setQuery( { pages: value ?? -1 } ) - } - /> - - - ) } - /> - + { ! query.inherit && ( + + ( + + ) } + renderContent={ () => ( + <> + + + setQuery( { + perPage: +value ?? -1, + } ) + } + step="1" + value={ query.perPage } + isDragEnabled={ false } + /> + + + + setQuery( { offset: +value } ) + } + step="1" + value={ query.offset } + isDragEnabled={ false } + /> + + + + setQuery( { pages: value ?? -1 } ) + } + /> + + + ) } + /> + + ) } ); From 9928dc0f36fcd1d346913cbbe888254041f5a1df Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Tue, 19 Jan 2021 09:19:53 +0200 Subject: [PATCH 05/61] Change the way RTL styles get enqueued (#28274) --- lib/blocks.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/blocks.php b/lib/blocks.php index f4f5a6536cee2a..4012e9784ca165 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -164,29 +164,27 @@ function gutenberg_register_core_block_styles( $block_name ) { $block_name = str_replace( 'core/', '', $block_name ); - $style_path = is_rtl() - ? "build/block-library/blocks/$block_name/style-rtl.css" - : "build/block-library/blocks/$block_name/style.css"; - $editor_style_path = is_rtl() - ? "build/block-library/blocks/$block_name/style-editor-rtl.css" - : "build/block-library/blocks/$block_name/style-editor.css"; + $style_path = "build/block-library/blocks/$block_name/style.css"; + $editor_style_path = "build/block-library/blocks/$block_name/style-editor.css"; if ( file_exists( gutenberg_dir_path() . $style_path ) ) { wp_register_style( - 'wp-block-' . $block_name, + "wp-block-{$block_name}", gutenberg_url( $style_path ), array(), filemtime( gutenberg_dir_path() . $style_path ) ); + wp_style_add_data( "wp-block-{$block_name}", 'rtl', 'replace' ); } if ( file_exists( gutenberg_dir_path() . $editor_style_path ) ) { wp_register_style( - 'wp-block-' . $block_name . '-editor', + "wp-block-{$block_name}-editor", gutenberg_url( $editor_style_path ), array(), filemtime( gutenberg_dir_path() . $editor_style_path ) ); + wp_style_add_data( "wp-block-{$block_name}-editor", 'rtl', 'replace' ); } } From d914ff9cdf7f1fdd6fc5362b3390537a755eca0e Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Tue, 19 Jan 2021 02:55:22 -0500 Subject: [PATCH 06/61] Add panel button props (#28147) * Add panel button props * Add tests for button props * Add note to readme on new props --- packages/components/src/panel/README.md | 8 ++++++++ packages/components/src/panel/body.js | 2 ++ packages/components/src/panel/stories/index.js | 5 +++++ packages/components/src/panel/test/body.js | 16 ++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/packages/components/src/panel/README.md b/packages/components/src/panel/README.md index d01bbdf01b1120..6b944732381ede 100644 --- a/packages/components/src/panel/README.md +++ b/packages/components/src/panel/README.md @@ -149,6 +149,14 @@ The rendered children. If the children is a `Function`, it will be called with a - Type: `React.ReactNode | Function` - Required: No +###### buttonProps + +Props that are passed to the `Button` component in the `PanelBodyTitle` within the panel body. + +- Type: `Object` +- Required: No +- Default: `{}` + --- #### PanelRow diff --git a/packages/components/src/panel/body.js b/packages/components/src/panel/body.js index d9d35113e37906..8496633357e027 100644 --- a/packages/components/src/panel/body.js +++ b/packages/components/src/panel/body.js @@ -21,6 +21,7 @@ import { useControlledState, useUpdateEffect } from '../utils'; export function PanelBody( { + buttonProps = {}, children, className, icon, @@ -82,6 +83,7 @@ export function PanelBody( isOpened={ isOpened } onClick={ handleOnToggle } title={ title } + { ...buttonProps } /> { typeof children === 'function' ? children( { opened: isOpened } ) diff --git a/packages/components/src/panel/stories/index.js b/packages/components/src/panel/stories/index.js index 778140694c9e88..22e2b4df4b38c3 100644 --- a/packages/components/src/panel/stories/index.js +++ b/packages/components/src/panel/stories/index.js @@ -49,6 +49,11 @@ export const multipleBodies = () => { + ); diff --git a/packages/components/src/panel/test/body.js b/packages/components/src/panel/test/body.js index cf1a570908c44b..596714274ff74a 100644 --- a/packages/components/src/panel/test/body.js +++ b/packages/components/src/panel/test/body.js @@ -136,5 +136,21 @@ describe( 'PanelBody', () => { expect( panelContent ).toBeFalsy(); } ); + + it( 'should pass button props to panel title', () => { + const mock = jest.fn(); + + const { container } = render( + +
Content
+
+ ); + + const panelToggle = getPanelToggle( container ); + + fireEvent.click( panelToggle ); + + expect( mock ).toHaveBeenCalled(); + } ); } ); } ); From f6129f664c4e22e61daa7ca9f1f6a6f7a0b84785 Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Tue, 19 Jan 2021 18:22:11 +1000 Subject: [PATCH 07/61] Social Icons: Add icon & background color options (#28084) * Add icon and bg color options to social links --- .../developers/themes/theme-json.md | 1 + .../block-library/src/social-links/block.json | 18 ++++ .../block-library/src/social-links/edit.js | 95 ++++++++++++++++++- .../block-library/src/social-links/save.js | 14 ++- .../block-library/src/social-links/style.scss | 13 +++ 5 files changed, 133 insertions(+), 8 deletions(-) diff --git a/docs/designers-developers/developers/themes/theme-json.md b/docs/designers-developers/developers/themes/theme-json.md index 223da07cb7e0c3..093f11e4851901 100644 --- a/docs/designers-developers/developers/themes/theme-json.md +++ b/docs/designers-developers/developers/themes/theme-json.md @@ -348,6 +348,7 @@ These are the current color properties supported by blocks: | Post Title | Yes | Yes | - | Yes | | Site Tagline | Yes | Yes | - | Yes | | Site Title | Yes | Yes | - | Yes | +| Social Links | Yes | - | - | Yes | | Template Part | Yes | Yes | Yes | Yes | [1] The heading block represents 6 distinct HTML elements: H1-H6. It comes with selectors to target each individual element (ex: core/heading/h1 for H1, etc). diff --git a/packages/block-library/src/social-links/block.json b/packages/block-library/src/social-links/block.json index 2bc44dd79f36e7..766ab4d52795b3 100644 --- a/packages/block-library/src/social-links/block.json +++ b/packages/block-library/src/social-links/block.json @@ -3,6 +3,24 @@ "name": "core/social-links", "category": "widgets", "attributes": { + "iconColor": { + "type": "string" + }, + "customIconColor": { + "type": "string" + }, + "iconColorValue": { + "type": "string" + }, + "iconBackgroundColor": { + "type": "string" + }, + "customIconBackgroundColor": { + "type": "string" + }, + "iconBackgroundColorValue": { + "type": "string" + }, "openInNewTab": { "type": "boolean", "default": false diff --git a/packages/block-library/src/social-links/edit.js b/packages/block-library/src/social-links/edit.js index b7d78bcf87821e..e0e62f1bd56c75 100644 --- a/packages/block-library/src/social-links/edit.js +++ b/packages/block-library/src/social-links/edit.js @@ -7,13 +7,16 @@ import classNames from 'classnames'; * WordPress dependencies */ -import { Fragment } from '@wordpress/element'; +import { Fragment, useEffect } from '@wordpress/element'; import { BlockControls, __experimentalUseInnerBlocksProps as useInnerBlocksProps, useBlockProps, InspectorControls, + ContrastChecker, + PanelColorSettings, + withColors, } from '@wordpress/block-editor'; import { DropdownMenu, @@ -38,10 +41,34 @@ const sizeOptions = [ export function SocialLinksEdit( props ) { const { - attributes: { size, openInNewTab }, + attributes, + iconBackgroundColor, + iconColor, setAttributes, + setIconBackgroundColor, + setIconColor, } = props; + const { + iconBackgroundColorValue, + iconColorValue, + openInNewTab, + size, + } = attributes; + + // Remove icon background color if logos only style selected. + const logosOnly = + attributes.className?.indexOf( 'is-style-logos-only' ) >= 0; + useEffect( () => { + if ( logosOnly ) { + setAttributes( { + iconBackgroundColor: undefined, + customIconBackgroundColor: undefined, + iconBackgroundColorValue: undefined, + } ); + } + }, [ logosOnly, setAttributes ] ); + const SocialPlaceholder = (
@@ -53,8 +80,21 @@ export function SocialLinksEdit( props ) {
); - const className = classNames( size ); - const blockProps = useBlockProps( { className } ); + // Fallback color values are used maintain selections in case switching + // themes and named colors in palette do not match. + const className = classNames( size, { + 'has-icon-color': iconColor.color || iconColorValue, + 'has-icon-background-color': + iconBackgroundColor.color || iconBackgroundColorValue, + } ); + + const style = { + '--wp--social-links--icon-color': iconColor.color || iconColorValue, + '--wp--social-links--icon-background-color': + iconBackgroundColor.color || iconBackgroundColorValue, + }; + + const blockProps = useBlockProps( { className, style } ); const innerBlocksProps = useInnerBlocksProps( blockProps, { allowedBlocks: ALLOWED_BLOCKS, orientation: 'horizontal', @@ -127,10 +167,55 @@ export function SocialLinksEdit( props ) { } />
+ { + setIconColor( colorValue ); + // Set explicit color value used to add CSS variable in save.js + setAttributes( { iconColorValue: colorValue } ); + }, + label: __( 'Icon color' ), + }, + ! logosOnly && { + // Use custom attribute as fallback to prevent loss of named color selection when + // switching themes to a new theme that does not have a matching named color. + value: + iconBackgroundColor.color || + iconBackgroundColorValue, + onChange: ( colorValue ) => { + setIconBackgroundColor( colorValue ); + // Set explicit color value used to add CSS variable in save.js + setAttributes( { + iconBackgroundColorValue: colorValue, + } ); + }, + label: __( 'Icon background color' ), + }, + ] } + /> + { ! logosOnly && ( + + ) }
    ); } -export default SocialLinksEdit; +const iconColorAttributes = { + iconColor: 'icon-color', + iconBackgroundColor: 'icon-background-color', +}; + +export default withColors( iconColorAttributes )( SocialLinksEdit ); diff --git a/packages/block-library/src/social-links/save.js b/packages/block-library/src/social-links/save.js index 09728cd12fc150..65699fd903635e 100644 --- a/packages/block-library/src/social-links/save.js +++ b/packages/block-library/src/social-links/save.js @@ -10,13 +10,21 @@ import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; export default function save( props ) { const { - attributes: { size }, + attributes: { iconBackgroundColorValue, iconColorValue, size }, } = props; - const className = classNames( size ); + const className = classNames( size, { + 'has-icon-color': iconColorValue, + 'has-icon-background-color': iconBackgroundColorValue, + } ); + + const style = { + '--wp--social-links--icon-color': iconColorValue, + '--wp--social-links--icon-background-color': iconBackgroundColorValue, + }; return ( -
      +
      ); diff --git a/packages/block-library/src/social-links/style.scss b/packages/block-library/src/social-links/style.scss index b95d01c771bd79..0305397c9b1138 100644 --- a/packages/block-library/src/social-links/style.scss +++ b/packages/block-library/src/social-links/style.scss @@ -68,6 +68,19 @@ &.alignright { justify-content: flex-end; } + + // Ensure user color selections are applied to inner Social Link blocks. + // Double selectors to increase specificity to avoid themes overwriting user selection. + &.has-icon-color.has-icon-color { + > .wp-social-link { + color: var(--wp--social-links--icon-color); + } + } + &.has-icon-background-color.has-icon-background-color { + > .wp-social-link { + background-color: var(--wp--social-links--icon-background-color); + } + } } .wp-social-link { From 8198daa15e7e41a25e4e9e9293a5f29403b4a922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Tue, 19 Jan 2021 11:31:40 +0100 Subject: [PATCH 08/61] Code Quality: Restrict usage of direct React imports (#28278) --- .eslintrc.js | 5 ++ package-lock.json | 1 + .../index.native.js | 4 +- .../inspector-controls/index.native.js | 6 +- .../media-upload-progress/index.native.js | 4 +- .../components/media-upload/index.native.js | 8 +- .../block-library/src/file/edit.native.js | 1 - .../block-library/src/image/edit.native.js | 4 +- .../block-library/src/video/edit.native.js | 4 +- .../src/color-picker/index.native.js | 1 - .../keyboard-avoiding-view.native.js | 8 +- .../src/mobile/color-settings/index.native.js | 7 +- .../color-settings/picker-screen.native.js | 1 - .../keyboard-aware-flat-list/index.ios.js | 5 +- .../src/mobile/link-picker/index.native.js | 3 +- .../link-picker/link-picker-screen.native.js | 2 +- .../link-settings-screen.native.js | 3 +- .../src/mobile/media-edit/index.native.js | 4 +- .../src/mobile/picker/index.android.js | 1 - .../header/header-toolbar/index.native.js | 2 +- .../components/visual-editor/header.native.js | 7 +- .../element/src/create-interpolate-element.js | 4 +- packages/element/src/react.js | 1 + .../link-picker-screen.native.js | 1 - .../link-settings-screen.native.js | 1 - .../format-library/src/link/modal.native.js | 4 - packages/react-native-aztec/package.json | 81 ++++++++++--------- packages/react-native-aztec/src/AztecView.js | 4 +- .../__mocks__/react-native-aztec/index.js | 6 +- 29 files changed, 90 insertions(+), 93 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5e20681906c425..37a4ede7f353c8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -63,6 +63,11 @@ module.exports = { importNames: [ 'memoize' ], message: 'Please use `memize` instead.', }, + { + name: 'react', + message: + 'Please use React API through `@wordpress/element` instead.', + }, { name: 'reakit', message: diff --git a/package-lock.json b/package-lock.json index c9150a55bd0814..67ddee56eebccb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12470,6 +12470,7 @@ "@wordpress/react-native-aztec": { "version": "file:packages/react-native-aztec", "requires": { + "@wordpress/element": "file:packages/element", "@wordpress/keycodes": "file:packages/keycodes" } }, diff --git a/packages/block-editor/src/components/block-media-update-progress/index.native.js b/packages/block-editor/src/components/block-media-update-progress/index.native.js index 279ef17d6e9987..c3f05ddd293496 100644 --- a/packages/block-editor/src/components/block-media-update-progress/index.native.js +++ b/packages/block-editor/src/components/block-media-update-progress/index.native.js @@ -1,12 +1,12 @@ /** * External dependencies */ -import React from 'react'; import { View } from 'react-native'; /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { Spinner } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { @@ -31,7 +31,7 @@ export const MEDIA_SAVE_STATE_RESET = 8; export const MEDIA_SAVE_FINAL_STATE_RESULT = 9; export const MEDIA_SAVE_MEDIAID_CHANGED = 10; -export class BlockMediaUpdateProgress extends React.Component { +export class BlockMediaUpdateProgress extends Component { constructor( props ) { super( props ); diff --git a/packages/block-editor/src/components/inspector-controls/index.native.js b/packages/block-editor/src/components/inspector-controls/index.native.js index 6c3e2026ddb805..4385ca69bce4df 100644 --- a/packages/block-editor/src/components/inspector-controls/index.native.js +++ b/packages/block-editor/src/components/inspector-controls/index.native.js @@ -1,12 +1,14 @@ /** * External dependencies */ -import React from 'react'; import { View } from 'react-native'; + /** * WordPress dependencies */ +import { Children } from '@wordpress/element'; import { createSlotFill, BottomSheetConsumer } from '@wordpress/components'; + /** * Internal dependencies */ @@ -30,7 +32,7 @@ const FillWithSettingsButton = ( { children, ...props } ) => { } - { React.Children.count( children ) > 0 && } + { Children.count( children ) > 0 && } ); }; diff --git a/packages/block-editor/src/components/media-upload-progress/index.native.js b/packages/block-editor/src/components/media-upload-progress/index.native.js index b0890e95df5834..97c9bef5ef9514 100644 --- a/packages/block-editor/src/components/media-upload-progress/index.native.js +++ b/packages/block-editor/src/components/media-upload-progress/index.native.js @@ -1,12 +1,12 @@ /** * External dependencies */ -import React from 'react'; import { View } from 'react-native'; /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { Spinner } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { subscribeMediaUpload } from '@wordpress/react-native-bridge'; @@ -21,7 +21,7 @@ export const MEDIA_UPLOAD_STATE_SUCCEEDED = 2; export const MEDIA_UPLOAD_STATE_FAILED = 3; export const MEDIA_UPLOAD_STATE_RESET = 4; -export class MediaUploadProgress extends React.Component { +export class MediaUploadProgress extends Component { constructor( props ) { super( props ); diff --git a/packages/block-editor/src/components/media-upload/index.native.js b/packages/block-editor/src/components/media-upload/index.native.js index 1147289c8d6b1b..dd3896cfdcbb83 100644 --- a/packages/block-editor/src/components/media-upload/index.native.js +++ b/packages/block-editor/src/components/media-upload/index.native.js @@ -1,11 +1,7 @@ -/** - * External dependencies - */ -import React from 'react'; - /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Picker } from '@wordpress/components'; import { @@ -29,7 +25,7 @@ export const OPTION_TAKE_VIDEO = __( 'Take a Video' ); export const OPTION_TAKE_PHOTO = __( 'Take a Photo' ); export const OPTION_TAKE_PHOTO_OR_VIDEO = __( 'Take a Photo or Video' ); -export class MediaUpload extends React.Component { +export class MediaUpload extends Component { constructor( props ) { super( props ); this.onPickerPresent = this.onPickerPresent.bind( this ); diff --git a/packages/block-library/src/file/edit.native.js b/packages/block-library/src/file/edit.native.js index 062270b322a58c..f40720f9a96bb1 100644 --- a/packages/block-library/src/file/edit.native.js +++ b/packages/block-library/src/file/edit.native.js @@ -2,7 +2,6 @@ * External dependencies */ import { View, Clipboard, TouchableWithoutFeedback, Text } from 'react-native'; -import React from 'react'; /** * WordPress dependencies diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index eb398aba372ee1..0f19daa830d30e 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -1,13 +1,13 @@ /** * External dependencies */ -import React from 'react'; import { View, TouchableWithoutFeedback } from 'react-native'; import { isEmpty, get, find, map } from 'lodash'; /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { requestMediaImport, mediaUploadSync, @@ -61,7 +61,7 @@ const getUrlForSlug = ( image, { sizeSlug } ) => { return get( image, [ 'media_details', 'sizes', sizeSlug, 'source_url' ] ); }; -export class ImageEdit extends React.Component { +export class ImageEdit extends Component { constructor( props ) { super( props ); diff --git a/packages/block-library/src/video/edit.native.js b/packages/block-library/src/video/edit.native.js index b1638fcdc70dea..5ceb7270404707 100644 --- a/packages/block-library/src/video/edit.native.js +++ b/packages/block-library/src/video/edit.native.js @@ -1,13 +1,13 @@ /** * External dependencies */ -import React from 'react'; import { View, TouchableWithoutFeedback, Text } from 'react-native'; import { isEmpty } from 'lodash'; /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { mediaUploadSync, requestImageFailedRetryDialog, @@ -49,7 +49,7 @@ const ICON_TYPE = { UPLOAD: 'upload', }; -class VideoEdit extends React.Component { +class VideoEdit extends Component { constructor( props ) { super( props ); diff --git a/packages/components/src/color-picker/index.native.js b/packages/components/src/color-picker/index.native.js index 27682f7ff25428..f41ae88cbba9f7 100644 --- a/packages/components/src/color-picker/index.native.js +++ b/packages/components/src/color-picker/index.native.js @@ -2,7 +2,6 @@ * External dependencies */ import { View, Text, TouchableWithoutFeedback, Platform } from 'react-native'; -import React from 'react'; import HsvColorPicker from 'react-native-hsv-color-picker'; import tinycolor from 'tinycolor2'; /** diff --git a/packages/components/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js b/packages/components/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js index 644c449fbd4b59..df75c5d78e9c20 100644 --- a/packages/components/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +++ b/packages/components/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js @@ -1,7 +1,6 @@ /** * External dependencies */ -import React from 'react'; import { Keyboard, LayoutAnimation, @@ -11,6 +10,11 @@ import { Dimensions, } from 'react-native'; +/** + * WordPress dependencies + */ +import { Component } from '@wordpress/element'; + /** * This is a simplified version of Facebook's KeyboardAvoidingView. * It's meant to work specifically with BottomSheets. @@ -18,7 +22,7 @@ import { * BottomSheet was presented on Landscape, with the keyboard already present, * and a TextField on Autofocus (situation present on Links UI) */ -class KeyboardAvoidingView extends React.Component { +class KeyboardAvoidingView extends Component { constructor() { super( ...arguments ); diff --git a/packages/components/src/mobile/color-settings/index.native.js b/packages/components/src/mobile/color-settings/index.native.js index ec8be2ac573c6f..2b898b7c63f906 100644 --- a/packages/components/src/mobile/color-settings/index.native.js +++ b/packages/components/src/mobile/color-settings/index.native.js @@ -1,14 +1,13 @@ /** * External dependencies */ -import React from 'react'; +import { useRoute } from '@react-navigation/native'; /** * WordPress dependencies */ -import { useEffect, useContext } from '@wordpress/element'; +import { memo, useEffect, useContext } from '@wordpress/element'; import { BottomSheetContext, BottomSheet } from '@wordpress/components'; -import { useRoute } from '@react-navigation/native'; /** * Internal dependencies @@ -19,7 +18,7 @@ import PaletteScreen from './palette.screen'; import { colorsUtils } from './utils'; -const ColorSettingsMemo = React.memo( +const ColorSettingsMemo = memo( ( { defaultSettings, onHandleClosingBottomSheet, diff --git a/packages/components/src/mobile/color-settings/picker-screen.native.js b/packages/components/src/mobile/color-settings/picker-screen.native.js index 3d11cbae38a828..edb7d260e86d97 100644 --- a/packages/components/src/mobile/color-settings/picker-screen.native.js +++ b/packages/components/src/mobile/color-settings/picker-screen.native.js @@ -2,7 +2,6 @@ * External dependencies */ import { useRoute, useNavigation } from '@react-navigation/native'; -import React from 'react'; /** * WordPress dependencies diff --git a/packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js b/packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js index 755ef5453ef862..a37edf9fdd009b 100644 --- a/packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js +++ b/packages/components/src/mobile/keyboard-aware-flat-list/index.ios.js @@ -1,15 +1,16 @@ /** * External dependencies */ -import React from 'react'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { FlatList } from 'react-native'; import { isEqual } from 'lodash'; + /** * WordPress dependencies */ +import { memo } from '@wordpress/element'; -const List = React.memo( FlatList, isEqual ); +const List = memo( FlatList, isEqual ); export const KeyboardAwareFlatList = ( { extraScrollHeight, diff --git a/packages/components/src/mobile/link-picker/index.native.js b/packages/components/src/mobile/link-picker/index.native.js index 1374cd0483cbd0..a007795a37450a 100644 --- a/packages/components/src/mobile/link-picker/index.native.js +++ b/packages/components/src/mobile/link-picker/index.native.js @@ -1,14 +1,13 @@ /** * External dependencies */ -import { useState } from 'react'; import { SafeAreaView, TouchableOpacity, View } from 'react-native'; import { lowerCase, startsWith } from 'lodash'; /** * WordPress dependencies */ - +import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { BottomSheet, Icon } from '@wordpress/components'; import { getProtocol, prependHTTP } from '@wordpress/url'; diff --git a/packages/components/src/mobile/link-picker/link-picker-screen.native.js b/packages/components/src/mobile/link-picker/link-picker-screen.native.js index 3301779646c016..7119fbfe0c322f 100644 --- a/packages/components/src/mobile/link-picker/link-picker-screen.native.js +++ b/packages/components/src/mobile/link-picker/link-picker-screen.native.js @@ -1,8 +1,8 @@ /** * External dependencies */ -import React from 'react'; import { useNavigation, useRoute } from '@react-navigation/native'; + /** * WordPress dependencies */ diff --git a/packages/components/src/mobile/link-settings/link-settings-screen.native.js b/packages/components/src/mobile/link-settings/link-settings-screen.native.js index c66892c9926c40..105bf553ea70c1 100644 --- a/packages/components/src/mobile/link-settings/link-settings-screen.native.js +++ b/packages/components/src/mobile/link-settings/link-settings-screen.native.js @@ -1,12 +1,13 @@ /** * External dependencies */ -import React from 'react'; import { useNavigation, useRoute } from '@react-navigation/native'; + /** * WordPress dependencies */ import { useMemo } from '@wordpress/element'; + /** * Internal dependencies */ diff --git a/packages/components/src/mobile/media-edit/index.native.js b/packages/components/src/mobile/media-edit/index.native.js index c098a9e3bcc1a2..1e2ab90cd0b9ee 100644 --- a/packages/components/src/mobile/media-edit/index.native.js +++ b/packages/components/src/mobile/media-edit/index.native.js @@ -1,12 +1,12 @@ /** * External dependencies */ -import React from 'react'; import { compact } from 'lodash'; /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Picker } from '@wordpress/components'; import { @@ -32,7 +32,7 @@ const replaceOption = { types: [ MEDIA_TYPE_IMAGE ], }; -export class MediaEdit extends React.Component { +export class MediaEdit extends Component { constructor( props ) { super( props ); this.onPickerPresent = this.onPickerPresent.bind( this ); diff --git a/packages/components/src/mobile/picker/index.android.js b/packages/components/src/mobile/picker/index.android.js index 2f727b2b92a9b3..b536dc2aed9c00 100644 --- a/packages/components/src/mobile/picker/index.android.js +++ b/packages/components/src/mobile/picker/index.android.js @@ -1,7 +1,6 @@ /** * External dependencies */ -import React from 'react'; import { View } from 'react-native'; /** diff --git a/packages/edit-post/src/components/header/header-toolbar/index.native.js b/packages/edit-post/src/components/header/header-toolbar/index.native.js index 26c0717b4f05fc..450ec38d48adc1 100644 --- a/packages/edit-post/src/components/header/header-toolbar/index.native.js +++ b/packages/edit-post/src/components/header/header-toolbar/index.native.js @@ -1,12 +1,12 @@ /** * External dependencies */ -import { useRef } from 'react'; import { ScrollView, View } from 'react-native'; /** * WordPress dependencies */ +import { useRef } from '@wordpress/element'; import { compose, withPreferredColorScheme } from '@wordpress/compose'; import { withSelect, withDispatch } from '@wordpress/data'; import { withViewportMatch } from '@wordpress/viewport'; diff --git a/packages/edit-post/src/components/visual-editor/header.native.js b/packages/edit-post/src/components/visual-editor/header.native.js index de04e09b4fca60..36995825499ff6 100644 --- a/packages/edit-post/src/components/visual-editor/header.native.js +++ b/packages/edit-post/src/components/visual-editor/header.native.js @@ -1,10 +1,7 @@ -/** - * External dependencies - */ -import React from 'react'; /** * WordPress dependencies */ +import { memo } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose, withPreferredColorScheme } from '@wordpress/compose'; @@ -16,7 +13,7 @@ import { ReadableContentView } from '@wordpress/components'; */ import styles from './style.scss'; -const Header = React.memo( +const Header = memo( function EditorHeader( { editTitle, setTitleRef, diff --git a/packages/element/src/create-interpolate-element.js b/packages/element/src/create-interpolate-element.js index d3da32354bb119..8eb6d73cbd2e30 100644 --- a/packages/element/src/create-interpolate-element.js +++ b/packages/element/src/create-interpolate-element.js @@ -1,7 +1,7 @@ /** - * External dependencies + * Internal dependencies */ -import { createElement, cloneElement, Fragment, isValidElement } from 'react'; +import { createElement, cloneElement, Fragment, isValidElement } from './react'; /** @typedef {import('./react').WPElement} WPElement */ diff --git a/packages/element/src/react.js b/packages/element/src/react.js index 78752a1b5a179a..f21fe4574c24fb 100644 --- a/packages/element/src/react.js +++ b/packages/element/src/react.js @@ -1,6 +1,7 @@ /** * External dependencies */ +// eslint-disable-next-line no-restricted-imports import { Children, cloneElement, diff --git a/packages/format-library/src/link/modal-screens/link-picker-screen.native.js b/packages/format-library/src/link/modal-screens/link-picker-screen.native.js index 30d0894281992e..21fc37563fbc60 100644 --- a/packages/format-library/src/link/modal-screens/link-picker-screen.native.js +++ b/packages/format-library/src/link/modal-screens/link-picker-screen.native.js @@ -1,7 +1,6 @@ /** * External dependencies */ -import React from 'react'; import { Platform, Keyboard } from 'react-native'; import { useNavigation, useRoute } from '@react-navigation/native'; import { delay } from 'lodash'; diff --git a/packages/format-library/src/link/modal-screens/link-settings-screen.native.js b/packages/format-library/src/link/modal-screens/link-settings-screen.native.js index b4bba800d69fee..70c51e326665bd 100644 --- a/packages/format-library/src/link/modal-screens/link-settings-screen.native.js +++ b/packages/format-library/src/link/modal-screens/link-settings-screen.native.js @@ -1,7 +1,6 @@ /** * External dependencies */ -import React from 'react'; import { useNavigation, useRoute } from '@react-navigation/native'; /** * WordPress dependencies diff --git a/packages/format-library/src/link/modal.native.js b/packages/format-library/src/link/modal.native.js index 666547090bf053..e3a52bb5a29bae 100644 --- a/packages/format-library/src/link/modal.native.js +++ b/packages/format-library/src/link/modal.native.js @@ -1,7 +1,3 @@ -/** - * External dependencies - */ -import React from 'react'; /** * WordPress dependencies */ diff --git a/packages/react-native-aztec/package.json b/packages/react-native-aztec/package.json index 98485f37b50092..915e78190f998b 100644 --- a/packages/react-native-aztec/package.json +++ b/packages/react-native-aztec/package.json @@ -1,42 +1,43 @@ { - "name": "@wordpress/react-native-aztec", - "version": "1.44.1", - "description": "Aztec view for react-native.", - "private": true, - "author": "The WordPress Contributors", - "license": "GPL-2.0-or-later", - "keywords": [ - "wordpress", - "react-native" - ], - "homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/react-native-aztec/README.md", - "repository": { - "type": "git", - "url": "https://github.com/WordPress/gutenberg.git", - "directory": "packages/react-native-aztec" - }, - "bugs": { - "url": "https://github.com/WordPress/gutenberg/issues" - }, - "dependencies": { - "@wordpress/keycodes": "file:../keycodes" - }, - "peerDependencies": { - "react": "*", - "react-native": "*" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "install-aztec-ios": "cd ./ios && carthage bootstrap --platform iOS --cache-builds", - "update-aztec-ios": "cd ./ios && carthage update --platform iOS --cache-builds", - "clean": "npm run clean-watchman; npm run clean-node; npm run clean-react; npm run clean-metro; npm run clean-jest;", - "clean-jest": "rm -rf $TMPDIR/jest_*;", - "clean-metro": "rm -rf $TMPDIR/metro-cache-*; rm -rf $TMPDIR/metro-bundler-cache-*;", - "clean-node": "rm -rf node_modules/;", - "clean-react": "rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/react-native-packager-cache-*;", - "clean-watchman": "command -v watchman >/dev/null 2>&1 && watchman watch-del-all;", - "clean:install": "npm run clean && npm install" - } + "name": "@wordpress/react-native-aztec", + "version": "1.44.1", + "description": "Aztec view for react-native.", + "private": true, + "author": "The WordPress Contributors", + "license": "GPL-2.0-or-later", + "keywords": [ + "wordpress", + "react-native" + ], + "homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/react-native-aztec/README.md", + "repository": { + "type": "git", + "url": "https://github.com/WordPress/gutenberg.git", + "directory": "packages/react-native-aztec" + }, + "bugs": { + "url": "https://github.com/WordPress/gutenberg/issues" + }, + "dependencies": { + "@wordpress/element": "file:../element", + "@wordpress/keycodes": "file:../keycodes" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "install-aztec-ios": "cd ./ios && carthage bootstrap --platform iOS --cache-builds", + "update-aztec-ios": "cd ./ios && carthage update --platform iOS --cache-builds", + "clean": "npm run clean-watchman; npm run clean-node; npm run clean-react; npm run clean-metro; npm run clean-jest;", + "clean-jest": "rm -rf $TMPDIR/jest_*;", + "clean-metro": "rm -rf $TMPDIR/metro-cache-*; rm -rf $TMPDIR/metro-bundler-cache-*;", + "clean-node": "rm -rf node_modules/;", + "clean-react": "rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/react-native-packager-cache-*;", + "clean-watchman": "command -v watchman >/dev/null 2>&1 && watchman watch-del-all;", + "clean:install": "npm run clean && npm install" + } } diff --git a/packages/react-native-aztec/src/AztecView.js b/packages/react-native-aztec/src/AztecView.js index 2e6686ce222bb3..9e92034710e11a 100644 --- a/packages/react-native-aztec/src/AztecView.js +++ b/packages/react-native-aztec/src/AztecView.js @@ -1,7 +1,6 @@ /** * External dependencies */ -import React from 'react'; import ReactNative, { requireNativeComponent, UIManager, @@ -12,11 +11,12 @@ import TextInputState from 'react-native/Libraries/Components/TextInput/TextInpu /** * WordPress dependencies */ +import { Component } from '@wordpress/element'; import { ENTER, BACKSPACE } from '@wordpress/keycodes'; const AztecManager = UIManager.getViewManagerConfig( 'RCTAztecView' ); -class AztecView extends React.Component { +class AztecView extends Component { constructor() { super( ...arguments ); this._onContentSizeChange = this._onContentSizeChange.bind( this ); diff --git a/test/native/__mocks__/react-native-aztec/index.js b/test/native/__mocks__/react-native-aztec/index.js index 4d963f6ff80647..6f0797e23d820a 100644 --- a/test/native/__mocks__/react-native-aztec/index.js +++ b/test/native/__mocks__/react-native-aztec/index.js @@ -1,9 +1,9 @@ /** - * External dependencies + * WordPress dependencies */ -import React from 'react'; +import { Component } from '@wordpress/element'; -class AztecView extends React.Component { +class AztecView extends Component { blur = () => {}; focus = () => {}; From f2929f3ebe79850232abc5581606ca580d105a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Tue, 19 Jan 2021 13:50:20 +0100 Subject: [PATCH 09/61] Remove border radius for root element (#28320) The support declaration was named "border" but should have been named "borderRadius", hence it didn't work. These styles are attached to the :root selector so I'm not sure it makes much sense to have this property. There's also the issue that there's no UI control for users to tweak this property via the global styles sidebar. An alternative that was considered to fix this is renaming it to borderRadius. --- lib/class-wp-theme-json.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/class-wp-theme-json.php b/lib/class-wp-theme-json.php index 0784bd2185e597..a4ecd2760e6c08 100644 --- a/lib/class-wp-theme-json.php +++ b/lib/class-wp-theme-json.php @@ -50,7 +50,6 @@ class WP_Theme_JSON { '--wp--style--color--link', 'background', 'backgroundColor', - 'border', 'color', 'fontFamily', 'fontSize', From bfaa2a4b4d9dcb9e0fb4c2ed5b3529a380322743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Tue, 19 Jan 2021 15:58:37 +0200 Subject: [PATCH 10/61] CODEOWNERS: tweak for ella (#28326) --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6a2c29e06c81e0..005d25f91cf3d6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,12 +18,12 @@ /packages/block-library/src/image @ajlende # Editor -/packages/annotations @atimmer @ellatrix +/packages/annotations @atimmer /packages/autop /packages/block-editor @ellatrix /packages/block-serialization-spec-parser @dmsnell /packages/block-serialization-default-parser @dmsnell -/packages/blocks @ellatrix +/packages/blocks /packages/edit-post /packages/editor /packages/list-reusable-blocks @@ -88,7 +88,7 @@ /packages/html-entities /packages/i18n @swissspidy /packages/is-shallow-equal -/packages/keycodes @ellatrix +/packages/keycodes /packages/priority-queue /packages/token-list /packages/url From c6b43a03b640a56156304c9762004353b295d9d5 Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Tue, 19 Jan 2021 15:17:17 +0100 Subject: [PATCH 11/61] Fix bad var name in BlockParentSelector (#28325) --- .../block-editor/src/components/block-parent-selector/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-parent-selector/index.js b/packages/block-editor/src/components/block-parent-selector/index.js index c4345841ec9a1b..7e45b0433285a7 100644 --- a/packages/block-editor/src/components/block-parent-selector/index.js +++ b/packages/block-editor/src/components/block-parent-selector/index.js @@ -36,7 +36,7 @@ export default function BlockParentSelector() { parentBlockType: _parentBlockType, firstParentClientId: _firstParentClientId, shouldHide: ! hasBlockSupport( - parentBlockType, + _parentBlockType, '__experimentalParentSelector', true ), From f6c79ce84b8523d6c1665d17fa1e74ad82014599 Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Tue, 19 Jan 2021 15:31:27 +0100 Subject: [PATCH 12/61] Update docs to use allowedFormats instead of the deprecated formattingControls (#25639) --- docs/designers-developers/developers/richtext.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/designers-developers/developers/richtext.md b/docs/designers-developers/developers/richtext.md index e565780a48bb24..d6ca4a5195a3d3 100644 --- a/docs/designers-developers/developers/richtext.md +++ b/docs/designers-developers/developers/richtext.md @@ -50,7 +50,7 @@ registerBlockType( /* ... */, { { ...blockProps } tagName="h2" // The tag here is the element output and editable in the admin value={ attributes.content } // Any existing content, either from the database or an attribute default - formattingControls={ [ 'bold', 'italic' ] } // Allow the content to be made bold or italic, but do not allow other formatting options + allowedFormats={ [ 'core/bold', 'core/italic' ] } // Allow the content to be made bold or italic, but do not allow other formatting options onChange={ ( content ) => setAttributes( { content } ) } // Store updated content as a block attribute placeholder={ __( 'Heading...' ) } // Display this text before any content has been added by the user /> @@ -83,7 +83,7 @@ wp.blocks.registerBlockType( /* ... */, { return wp.element.createElement( wp.blockEditor.RichText, Object.assign( blockProps, { tagName: 'h2', // The tag here is the element output and editable in the admin value: props.attributes.content, // Any existing content, either from the database or an attribute default - formattingControls: [ 'bold', 'italic' ], // Allow the content to be made bold or italic, but do not allow other formatting options + allowedFormats: [ 'core/bold', 'core/italic' ], // Allow the content to be made bold or italic, but do not allow other formatting options onChange: function( content ) { props.setAttributes( { content: content } ); // Store updated content as a block attribute }, @@ -121,4 +121,4 @@ If the HTML tags from text formatting such as `` or `` are being esc Before moving forward, consider if using the RichText component makes sense at all. Would it be better to use a basic `input` or `textarea` element? If you don't think any formatting should be possible, these HTML tags may make more sense. -If you'd still like to use RichText, you can eliminate all of the formatting options by specifying the `formattingControls` property as `formattingControls={ [] }` (ESNext). It's possible you'll continue to see formatting options for adding code, an inline image or other formatting. Don't worry, you've found an existing bug that should be fixed soon. +If you'd still like to use RichText, you can eliminate all of the formatting options by specifying the `withoutInteractiveFormatting` property. From 20b3cf024ea0368b7c5d2343483be57e261ab003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Su=C3=A1rez?= Date: Tue, 19 Jan 2021 11:41:48 -0300 Subject: [PATCH 13/61] block-transform: fix `isMultiblock` property name (#28321) --- .../developers/block-api/block-transforms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/designers-developers/developers/block-api/block-transforms.md b/docs/designers-developers/developers/block-api/block-transforms.md index ad4f7fcc903477..0be77a7c4f52c6 100644 --- a/docs/designers-developers/developers/block-api/block-transforms.md +++ b/docs/designers-developers/developers/block-api/block-transforms.md @@ -39,7 +39,7 @@ A transformation of type `block` is an object that takes the following parameter - **blocks** _(array)_: a list of known block types. It also accepts the wildcard value (`"*"`), meaning that the transform is available to _all_ block types (eg: all blocks can transform into `core/group`). - **transform** _(function)_: a callback that receives the attributes and inner blocks of the block being processed. It should return a block object or an array of block objects. - **isMatch** _(function, optional)_: a callback that receives the block attributes and should return a boolean. Returning `false` from this function will prevent the transform from being available and displayed as an option to the user. -- **isMultiblock** _(boolean, optional)_: whether the transformation can be applied when multiple blocks are selected. If true, the `transform` function's first parameter will be an array containing each selected block's attributes, and the second an array of each selected block's inner blocks. False by default. +- **isMultiBlock** _(boolean, optional)_: whether the transformation can be applied when multiple blocks are selected. If true, the `transform` function's first parameter will be an array containing each selected block's attributes, and the second an array of each selected block's inner blocks. False by default. - **priority** _(number, optional)_: controls the priority with which a transformation is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set. **Example: from Paragraph block to Heading block** From c0ca1e7d54068e7a913d50eb625473c9a5cf13d4 Mon Sep 17 00:00:00 2001 From: Addison Stavlo Date: Tue, 19 Jan 2021 10:00:37 -0500 Subject: [PATCH 14/61] Fix template part border states. (#28241) * re-add child selected border styles * fix selected but not focused state * use gray-900 --- .../block-library/src/template-part/editor.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/block-library/src/template-part/editor.scss b/packages/block-library/src/template-part/editor.scss index cfdf9b310fd8ad..af52ef32a67721 100644 --- a/packages/block-library/src/template-part/editor.scss +++ b/packages/block-library/src/template-part/editor.scss @@ -89,3 +89,18 @@ box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color); } } + +// Ensures a border is present when a child block is selected. +.block-editor-block-list__block[data-type="core/template-part"] { + &.is-selected, + &.has-child-selected { + &::after { + top: $border-width; + bottom: $border-width; + left: $border-width; + right: $border-width; + border-radius: $radius-block-ui - $border-width; // Border is outset, so so subtract the width to achieve correct radius. + box-shadow: 0 0 0 $border-width $gray-900; + } + } +} From 41bc8cdacf28af0781adecb39a6b8bc579dd1ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Wrede?= Date: Tue, 19 Jan 2021 16:10:20 +0100 Subject: [PATCH 15/61] Change supports value from gradient to gradients (#28328) --- .../developers/block-api/block-supports.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/designers-developers/developers/block-api/block-supports.md b/docs/designers-developers/developers/block-api/block-supports.md index b4d8634ed33816..dd53f613421788 100644 --- a/docs/designers-developers/developers/block-api/block-supports.md +++ b/docs/designers-developers/developers/block-api/block-supports.md @@ -86,7 +86,7 @@ supports: { - Default value: null - Subproperties: - `background`: type `boolean`, default value `true` - - `gradient`: type `boolean`, default value `false` + - `gradients`: type `boolean`, default value `false` - `text`: type `boolean`, default value `true` This value signals that a block supports some of the CSS style properties related to color. When it does, the block editor will show UI controls for the user to set their values. @@ -98,7 +98,7 @@ Note that the `text` and `background` keys have a default value of `true`, so if ```js supports: { color: { // This also enables text and background UI controls. - gradient: true // Enable gradients UI control. + gradients: true // Enable gradients UI control. } } ``` @@ -109,7 +109,7 @@ It's possible to disable them individually: supports: { color: { // Text UI control is enabled. background: false, // Disable background UI control. - gradient: true // Enable gradients UI control. + gradients: true // Enable gradients UI control. } } ``` @@ -144,7 +144,7 @@ attributes: { } ``` -- When `gradient` support is declared: it'll be added a new `gradient` attribute of type `string` with no default assigned. It stores the preset values set by the user. The block can apply a default text color by specifying its own attribute with a default e.g.: +- When `gradients` support is declared: it'll be added a new `gradient` attribute of type `string` with no default assigned. It stores the preset values set by the user. The block can apply a default text color by specifying its own attribute with a default e.g.: ```js attributes: { From 6eb5445798f764cdd1c6f4d501dfd422ab90936b Mon Sep 17 00:00:00 2001 From: Matt Wiebe Date: Tue, 19 Jan 2021 09:57:23 -0600 Subject: [PATCH 16/61] use `title.rendered` to prevent [object Object] in snackbar when Template Part is inserted (#28306) --- .../src/template-part/edit/selection/template-part-previews.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/template-part/edit/selection/template-part-previews.js b/packages/block-library/src/template-part/edit/selection/template-part-previews.js index e3b7b3e669926a..b437bb15e2ae81 100644 --- a/packages/block-library/src/template-part/edit/selection/template-part-previews.js +++ b/packages/block-library/src/template-part/edit/selection/template-part-previews.js @@ -49,7 +49,7 @@ function TemplatePartItem( { sprintf( /* translators: %s: template part title. */ __( 'Template Part "%s" inserted.' ), - title + title.rendered ), { type: 'snackbar', From 0585c2fc468a61f522b3494d1222d20d800069b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Tue, 19 Jan 2021 17:08:12 +0100 Subject: [PATCH 17/61] Site Editor: Add template part missing state (#28277) --- .../src/template-part/edit/index.js | 46 +++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/template-part/edit/index.js b/packages/block-library/src/template-part/edit/index.js index e258a9701d31e3..da36745fd4b3ce 100644 --- a/packages/block-library/src/template-part/edit/index.js +++ b/packages/block-library/src/template-part/edit/index.js @@ -6,6 +6,7 @@ import { BlockControls, InspectorAdvancedControls, useBlockProps, + Warning, } from '@wordpress/block-editor'; import { SelectControl, @@ -30,26 +31,32 @@ export default function TemplatePartEdit( { setAttributes, clientId, } ) { - const templatePartId = theme + '//' + slug; + const templatePartId = theme && slug ? theme + '//' + slug : null; // Set the postId block attribute if it did not exist, // but wait until the inner blocks have loaded to allow // new edits to trigger this. - const { isResolved, innerBlocks } = useSelect( + const { isResolved, innerBlocks, isMissing } = useSelect( ( select ) => { + const { getEntityRecord, hasFinishedResolution } = select( 'core' ); const { getBlocks } = select( 'core/block-editor' ); - const entityRecord = - theme && slug - ? select( 'core' ).getEntityRecord( - 'postType', - 'wp_template_part', - theme + '//' + slug - ) - : null; + + const getEntityArgs = [ + 'postType', + 'wp_template_part', + templatePartId, + ]; + const entityRecord = templatePartId + ? getEntityRecord( ...getEntityArgs ) + : null; + const hasResolvedEntity = templatePartId + ? hasFinishedResolution( 'getEntityRecord', getEntityArgs ) + : false; return { innerBlocks: getBlocks( clientId ), - isResolved: !! entityRecord, + isResolved: hasResolvedEntity, + isMissing: hasResolvedEntity && ! entityRecord, }; }, [ templatePartId, clientId ] @@ -57,6 +64,19 @@ export default function TemplatePartEdit( { const blockProps = useBlockProps(); const isPlaceholder = ! slug; + const isEntityAvailable = ! isPlaceholder && ! isMissing; + + if ( ! isPlaceholder && isMissing ) { + return ( + + + { __( + 'Template part has been deleted or is unavailable.' + ) } + + + ); + } const inspectorAdvancedControls = ( @@ -87,7 +107,7 @@ export default function TemplatePartEdit( { innerBlocks={ innerBlocks } /> ) } - { ! isPlaceholder && isResolved && ( + { isEntityAvailable && ( @@ -118,7 +138,7 @@ export default function TemplatePartEdit( { ) } - { ! isPlaceholder && isResolved && ( + { isEntityAvailable && ( 0 } From 49cff25486224f8c271e5ed2b30ee95fdf3a6beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Tue, 19 Jan 2021 17:09:48 +0100 Subject: [PATCH 18/61] NavigationMenu component: Add isSearchDebouncing prop (#28102) Complementary PR for #27280 --- packages/components/src/navigation/README.md | 7 +++++++ packages/components/src/navigation/menu/index.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/components/src/navigation/README.md b/packages/components/src/navigation/README.md index eeee3167382bdd..b793489d5a0002 100644 --- a/packages/components/src/navigation/README.md +++ b/packages/components/src/navigation/README.md @@ -123,6 +123,13 @@ The unique identifier of the menu. The root menu can omit this, and it will defa When `hasSearch` is active, this function handles the search input's `onChange` event, making it controlled from the outside. It requires setting the `search` prop as well. +### isSearchDebouncing + +- Type: `boolean` +- Required: No + +Indicates whether the search is debouncing or not. In case of `true` the "No results found." text is omitted. Used to prevent showing "No results found." text between debounced searches. + ### `parentMenu` - Type: `string` diff --git a/packages/components/src/navigation/menu/index.js b/packages/components/src/navigation/menu/index.js index 0890becbfb26cf..fd78b80da86bfc 100644 --- a/packages/components/src/navigation/menu/index.js +++ b/packages/components/src/navigation/menu/index.js @@ -32,6 +32,7 @@ export default function NavigationMenu( props ) { onSearch: setControlledSearch, parentMenu, search: controlledSearch, + isSearchDebouncing, title, titleAction, } = props; @@ -84,7 +85,7 @@ export default function NavigationMenu( props ) {
        { children } - { search && ( + { search && ! isSearchDebouncing && ( ) }
      From dd800221cb816193cc22f33ab82867b0a06b67d1 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 19 Jan 2021 18:48:34 +0100 Subject: [PATCH 19/61] Support both horizontal and vertical in-between inserters (#27860) --- .../components/block-list/insertion-point.js | 268 +++++++++++------- .../src/components/block-list/style.scss | 36 +-- .../src/components/inserter/index.js | 21 +- .../__snapshots__/writing-flow.test.js.snap | 10 - .../specs/editor/various/writing-flow.test.js | 38 +-- .../specs/widgets/adding-widgets.test.js | 6 +- 6 files changed, 217 insertions(+), 162 deletions(-) diff --git a/packages/block-editor/src/components/block-list/insertion-point.js b/packages/block-editor/src/components/block-list/insertion-point.js index f7e6b8b01884d6..e393710dc5a47c 100644 --- a/packages/block-editor/src/components/block-list/insertion-point.js +++ b/packages/block-editor/src/components/block-list/insertion-point.js @@ -2,97 +2,40 @@ * External dependencies */ import classnames from 'classnames'; -import { last } from 'lodash'; /** * WordPress dependencies */ -import { useSelect } from '@wordpress/data'; -import { useState, useRef, useEffect, useCallback } from '@wordpress/element'; +import { useSelect, useDispatch } from '@wordpress/data'; +import { + useState, + useEffect, + useCallback, + useRef, + useMemo, +} from '@wordpress/element'; import { Popover } from '@wordpress/components'; -import { placeCaretAtVerticalEdge } from '@wordpress/dom'; +import { isRTL } from '@wordpress/i18n'; /** * Internal dependencies */ import Inserter from '../inserter'; -import { getClosestTabbable } from '../writing-flow'; import { getBlockDOMNode } from '../../utils/dom'; -function InsertionPointInserter( { - clientId, - setIsInserterForced, - containerRef, -} ) { - const ref = useRef(); - // Hide the inserter above the selected block and during multi-selection. - const isInserterHidden = useSelect( - ( select ) => { - const { - getMultiSelectedBlockClientIds, - getSelectedBlockClientId, - hasMultiSelection, - getSettings, - } = select( 'core/block-editor' ); - const { hasReducedUI } = getSettings(); - if ( hasReducedUI ) { - return true; - } - const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(); - const selectedBlockClientId = getSelectedBlockClientId(); - return hasMultiSelection() - ? multiSelectedBlockClientIds.includes( clientId ) - : clientId === selectedBlockClientId; - }, - [ clientId ] - ); - - function focusClosestTabbable( event ) { - const { clientX, clientY, target } = event; - - // Only handle click on the wrapper specifically, and not an event - // bubbled from the inserter itself. - if ( target !== ref.current ) { - return; - } - - const { ownerDocument } = containerRef.current; - const targetRect = target.getBoundingClientRect(); - const isReverse = clientY < targetRect.top + targetRect.height / 2; - const blockNode = getBlockDOMNode( clientId, ownerDocument ); - const container = isReverse ? containerRef.current : blockNode; - const closest = - getClosestTabbable( blockNode, true, container ) || blockNode; - const rect = new window.DOMRect( clientX, clientY, 0, 16 ); - - placeCaretAtVerticalEdge( closest, isReverse, rect, false ); - } - +function InsertionPointInserter( { clientId, setIsInserterForced } ) { return ( - /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
      setIsInserterForced( true ) } - onBlur={ () => setIsInserterForced( false ) } - onClick={ focusClosestTabbable } - // While ideally it would be enough to capture the - // bubbling focus event from the Inserter, due to the - // characteristics of click focusing of `button`s in - // Firefox and Safari, it is not reliable. - // - // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus - tabIndex={ -1 } className={ classnames( - 'block-editor-block-list__insertion-point-inserter', - { - 'is-inserter-hidden': isInserterHidden, - } + 'block-editor-block-list__insertion-point-inserter' ) } > setIsInserterForced( false ) } />
      ); @@ -107,56 +50,159 @@ function InsertionPointPopover( { containerRef, showInsertionPoint, } ) { - const element = useSelect( + const { selectBlock } = useDispatch( 'core/block-editor' ); + const ref = useRef(); + + const { previousElement, nextElement, orientation, isHidden } = useSelect( ( select ) => { - const { getBlockOrder } = select( 'core/block-editor' ); + const { + getBlockOrder, + getBlockRootClientId, + getBlockListSettings, + getMultiSelectedBlockClientIds, + getSelectedBlockClientId, + hasMultiSelection, + getSettings, + } = select( 'core/block-editor' ); const { ownerDocument } = containerRef.current; - const targetClientId = - clientId || last( getBlockOrder( rootClientId ) ); + const targetRootClientId = clientId + ? getBlockRootClientId( clientId ) + : rootClientId; + const blockOrder = getBlockOrder( targetRootClientId ); + if ( blockOrder.length < 2 ) { + return {}; + } + const next = clientId + ? clientId + : blockOrder[ blockOrder.length - 1 ]; + const previous = blockOrder[ blockOrder.indexOf( next ) - 1 ]; + const { hasReducedUI } = getSettings(); + const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(); + const selectedBlockClientId = getSelectedBlockClientId(); + const blockOrientation = + getBlockListSettings( targetRootClientId )?.orientation || + 'vertical'; - return getBlockDOMNode( targetClientId, ownerDocument ); + return { + previousElement: getBlockDOMNode( previous, ownerDocument ), + nextElement: getBlockDOMNode( next, ownerDocument ), + isHidden: + hasReducedUI || + ( hasMultiSelection() + ? multiSelectedBlockClientIds.includes( clientId ) + : blockOrientation === 'vertical' && + clientId === selectedBlockClientId ), + orientation: blockOrientation, + }; }, [ clientId, rootClientId ] ); - const position = clientId ? 'top' : 'bottom'; - const className = classnames( 'block-editor-block-list__insertion-point', { - 'is-insert-after': ! clientId, - } ); + const style = useMemo( () => { + if ( ! previousElement || ! nextElement ) { + return {}; + } + const previousRect = previousElement.getBoundingClientRect(); + const nextRect = nextElement.getBoundingClientRect(); + + return orientation === 'vertical' + ? { + width: previousElement.offsetWidth, + height: nextRect.top - previousRect.bottom, + } + : { + width: isRTL() + ? previousRect.left - nextRect.right + : nextRect.left - previousRect.right, + height: previousElement.offsetHeight, + }; + }, [ previousElement, nextElement ] ); + + const getAnchorRect = useCallback( () => { + const previousRect = previousElement.getBoundingClientRect(); + const nextRect = nextElement.getBoundingClientRect(); + if ( orientation === 'vertical' ) { + return { + top: previousRect.bottom, + left: previousRect.left, + right: previousRect.right, + bottom: nextRect.top, + }; + } + return { + top: previousRect.top, + left: isRTL() ? nextRect.right : previousRect.right, + right: isRTL() ? previousRect.left : nextRect.left, + bottom: previousRect.bottom, + }; + }, [ previousElement, nextElement ] ); + if ( ! previousElement ) { + return null; + } + + const className = classnames( + 'block-editor-block-list__insertion-point', + 'is-' + orientation + ); + + function onClick( event ) { + if ( event.target === ref.current ) { + selectBlock( clientId, -1 ); + } + } + + function onFocus( event ) { + // Only handle click on the wrapper specifically, and not an event + // bubbled from the inserter itself. + if ( event.target !== ref.current ) { + setIsInserterForced( true ); + } + } + + /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ + // While ideally it would be enough to capture the + // bubbling focus event from the Inserter, due to the + // characteristics of click focusing of `button`s in + // Firefox and Safari, it is not reliable. + // + // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus return (
      - { ( showInsertionPoint || - isInserterShown || - isInserterForced ) && ( -
      - ) } - { ( isInserterShown || isInserterForced ) && ( + { ! isHidden && + ( showInsertionPoint || + isInserterShown || + isInserterForced ) && ( +
      + ) } + { ! isHidden && ( isInserterShown || isInserterForced ) && ( ) }
      ); + /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ } -export default function InsertionPoint( ref ) { +export default function useInsertionPoint( ref ) { const [ isInserterShown, setIsInserterShown ] = useState( false ); const [ isInserterForced, setIsInserterForced ] = useState( false ); const [ inserterClientId, setInserterClientId ] = useState( null ); @@ -165,18 +211,21 @@ export default function InsertionPoint( ref ) { isInserterVisible, selectedClientId, selectedRootClientId, + getBlockListSettings, } = useSelect( ( select ) => { const { isMultiSelecting: _isMultiSelecting, isBlockInsertionPointVisible, getBlockInsertionPoint, getBlockOrder, + getBlockListSettings: _getBlockListSettings, } = select( 'core/block-editor' ); const insertionPoint = getBlockInsertionPoint(); const order = getBlockOrder( insertionPoint.rootClientId ); return { + getBlockListSettings: _getBlockListSettings, isMultiSelecting: _isMultiSelecting(), isInserterVisible: isBlockInsertionPointVisible(), selectedClientId: order[ insertionPoint.index ], @@ -197,11 +246,29 @@ export default function InsertionPoint( ref ) { return; } + let rootClientId; + if ( ! event.target.classList.contains( 'is-root-container' ) ) { + const blockElement = !! event.target.getAttribute( + 'data-block' + ) + ? event.target + : event.target.closest( '[data-block]' ); + rootClientId = blockElement.getAttribute( 'data-block' ); + } + + const orientation = + getBlockListSettings( rootClientId )?.orientation || 'vertical'; const rect = event.target.getBoundingClientRect(); - const offset = event.clientY - rect.top; + const offsetTop = event.clientY - rect.top; + const offsetLeft = event.clientX - rect.left; let element = Array.from( event.target.children ).find( ( blockEl ) => { - return blockEl.offsetTop > offset; + return ( + ( orientation === 'vertical' && + blockEl.offsetTop > offsetTop ) || + ( orientation === 'horizontal' && + blockEl.offsetLeft > offsetLeft ) + ); } ); @@ -228,8 +295,12 @@ export default function InsertionPoint( ref ) { const elementRect = element.getBoundingClientRect(); if ( - event.clientX > elementRect.right || - event.clientX < elementRect.left + ( orientation === 'horizontal' && + ( event.clientY > elementRect.bottom || + event.clientY < elementRect.top ) ) || + ( orientation === 'vertical' && + ( event.clientX > elementRect.right || + event.clientX < elementRect.left ) ) ) { if ( isInserterShown ) { setIsInserterShown( false ); @@ -269,7 +340,12 @@ export default function InsertionPoint( ref ) { rootClientId={ selectedRootClientId } isInserterShown={ isInserterShown } isInserterForced={ isInserterForced } - setIsInserterForced={ setIsInserterForced } + setIsInserterForced={ ( value ) => { + setIsInserterForced( value ); + if ( ! value ) { + setIsInserterShown( value ); + } + } } containerRef={ ref } showInsertionPoint={ isInserterVisible } /> diff --git a/packages/block-editor/src/components/block-list/style.scss b/packages/block-editor/src/components/block-list/style.scss index e0dfc1ac29f92e..03eb7e7040c232 100644 --- a/packages/block-editor/src/components/block-list/style.scss +++ b/packages/block-editor/src/components/block-list/style.scss @@ -398,45 +398,47 @@ cursor: grab; } -// Insertion point (includes inbetween/sibling inserter and insertion indicator) .block-editor-block-list__insertion-point { - position: relative; - z-index: z-index(".block-editor-block-list__insertion-point"); - margin-top: -$block-padding; - - &.is-insert-after { - margin-top: $block-padding; - } + position: absolute; } .block-editor-block-list__insertion-point-indicator { position: absolute; - top: calc(50% - #{ $border-width }); - height: var(--wp-admin-border-width-focus); - left: 0; - right: 0; background: var(--wp-admin-theme-color); animation: block-editor-inserter__toggle__fade-in-animation 0.3s ease; animation-fill-mode: forwards; @include reduce-motion("animation"); + + .block-editor-block-list__insertion-point.is-vertical > & { + top: calc(50% - #{ $border-width }); + height: var(--wp-admin-border-width-focus); + left: 0; + right: 0; + } + + .block-editor-block-list__insertion-point.is-horizontal > & { + top: 0; + height: 100%; + left: calc(50% - #{ $border-width }); + right: 0; + width: var(--wp-admin-border-width-focus); + } } // This is the clickable plus. .block-editor-block-list__insertion-point-inserter { // Don't show on mobile. display: none; + position: absolute; @include break-mobile() { display: flex; } justify-content: center; - // Hide the inserter above the selected block. - &.is-inserter-hidden .block-editor-inserter__toggle { - visibility: hidden; - pointer-events: none; - } + top: calc(50% - #{ $button-size-small / 2 }); + left: calc(50% - #{ $button-size-small / 2 }); } .block-editor-block-list__block-popover-inserter { diff --git a/packages/block-editor/src/components/inserter/index.js b/packages/block-editor/src/components/inserter/index.js index 0a74cbbb5f0b05..b2c4c00a68f9cf 100644 --- a/packages/block-editor/src/components/inserter/index.js +++ b/packages/block-editor/src/components/inserter/index.js @@ -141,7 +141,9 @@ class Inserter extends Component { if ( isQuick ) { return ( { + onClose(); + } } rootClientId={ rootClientId } clientId={ clientId } isAppender={ isAppender } @@ -152,7 +154,9 @@ class Inserter extends Component { return ( { + onClose(); + } } rootClientId={ rootClientId } clientId={ clientId } isAppender={ isAppender } @@ -168,6 +172,7 @@ class Inserter extends Component { hasSingleBlockType, insertOnlyAllowedBlock, __experimentalIsQuick: isQuick, + onSelectOrClose, } = this.props; if ( hasSingleBlockType ) { @@ -187,6 +192,7 @@ class Inserter extends Component { headerTitle={ __( 'Add a block' ) } renderToggle={ this.renderToggle } renderContent={ this.renderContent } + onClose={ onSelectOrClose } /> ); } @@ -228,7 +234,12 @@ export default compose( [ withDispatch( ( dispatch, ownProps, { select } ) => { return { insertOnlyAllowedBlock() { - const { rootClientId, clientId, isAppender } = ownProps; + const { + rootClientId, + clientId, + isAppender, + onSelectOrClose, + } = ownProps; const { hasSingleBlockType, allowedBlockType, @@ -272,6 +283,10 @@ export default compose( [ selectBlockOnInsert ); + if ( onSelectOrClose ) { + onSelectOrClose(); + } + if ( ! selectBlockOnInsert ) { const message = sprintf( // translators: %s: the name of the block that has been added diff --git a/packages/e2e-tests/specs/editor/various/__snapshots__/writing-flow.test.js.snap b/packages/e2e-tests/specs/editor/various/__snapshots__/writing-flow.test.js.snap index 4ab3ea451a77c5..26f4b365f85da3 100644 --- a/packages/e2e-tests/specs/editor/various/__snapshots__/writing-flow.test.js.snap +++ b/packages/e2e-tests/specs/editor/various/__snapshots__/writing-flow.test.js.snap @@ -268,16 +268,6 @@ exports[`Writing Flow should not have a dead zone between blocks (lower) 1`] = ` " `; -exports[`Writing Flow should not have a dead zone between blocks (upper) 1`] = ` -" -

      13

      - - - -

      2

      -" -`; - exports[`Writing Flow should not prematurely multi-select 1`] = ` "

      1

      diff --git a/packages/e2e-tests/specs/editor/various/writing-flow.test.js b/packages/e2e-tests/specs/editor/various/writing-flow.test.js index eff7ad5c16ff11..cb6698bb3df4c1 100644 --- a/packages/e2e-tests/specs/editor/various/writing-flow.test.js +++ b/packages/e2e-tests/specs/editor/various/writing-flow.test.js @@ -535,11 +535,11 @@ describe( 'Writing Flow', () => { await page.mouse.move( x, y ); await page.waitForSelector( - '.block-editor-block-list__insertion-point-inserter' + '.block-editor-block-list__insertion-point' ); const inserter = await page.$( - '.block-editor-block-list__insertion-point-inserter' + '.block-editor-block-list__insertion-point' ); const inserterRect = await inserter.boundingBox(); const lowerInserterY = inserterRect.y + ( 2 * inserterRect.height ) / 3; @@ -550,36 +550,6 @@ describe( 'Writing Flow', () => { expect( await getEditedPostContent() ).toMatchSnapshot(); } ); - it( 'should not have a dead zone between blocks (upper)', async () => { - await page.keyboard.press( 'Enter' ); - await page.keyboard.type( '1' ); - await page.keyboard.press( 'Enter' ); - await page.keyboard.type( '2' ); - - // Find a point outside the paragraph between the blocks where it's - // expected that the sibling inserter would be placed. - const paragraph = await page.$( '[data-type="core/paragraph"]' ); - const paragraphRect = await paragraph.boundingBox(); - const x = paragraphRect.x + ( 2 * paragraphRect.width ) / 3; - const y = paragraphRect.y + paragraphRect.height + 1; - - await page.mouse.move( x, y ); - await page.waitForSelector( - '.block-editor-block-list__insertion-point-inserter' - ); - - const inserter = await page.$( - '.block-editor-block-list__insertion-point-inserter' - ); - const inserterRect = await inserter.boundingBox(); - const upperInserterY = inserterRect.y + inserterRect.height / 3; - - await page.mouse.click( x, upperInserterY ); - await page.keyboard.type( '3' ); - - expect( await getEditedPostContent() ).toMatchSnapshot(); - } ); - it( 'should not have a dead zone above an aligned block', async () => { await page.keyboard.press( 'Enter' ); await page.keyboard.type( '1' ); @@ -602,11 +572,11 @@ describe( 'Writing Flow', () => { await page.mouse.move( x, y ); await page.waitForSelector( - '.block-editor-block-list__insertion-point-inserter' + '.block-editor-block-list__insertion-point' ); const inserter = await page.$( - '.block-editor-block-list__insertion-point-inserter' + '.block-editor-block-list__insertion-point' ); const inserterRect = await inserter.boundingBox(); const lowerInserterY = inserterRect.y + ( 2 * inserterRect.height ) / 3; diff --git a/packages/e2e-tests/specs/widgets/adding-widgets.test.js b/packages/e2e-tests/specs/widgets/adding-widgets.test.js index 160798d5cbbe67..97a0bbd66500de 100644 --- a/packages/e2e-tests/specs/widgets/adding-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/adding-widgets.test.js @@ -64,6 +64,7 @@ describe( 'Widgets screen', () => { return addParagraphBlock; } + /* async function expectInsertionPointIndicatorToBeBelowLastBlock( widgetArea ) { @@ -81,6 +82,7 @@ describe( 'Widgets screen', () => { insertionPointIndicatorBoundingBox.y > lastBlockBoundingBox.y ).toBe( true ); } + */ async function getInlineInserterButton() { return await page.waitForSelector( @@ -122,9 +124,9 @@ describe( 'Widgets screen', () => { addParagraphBlock = await getParagraphBlockInGlobalInserter(); await addParagraphBlock.hover(); - await expectInsertionPointIndicatorToBeBelowLastBlock( + /*await expectInsertionPointIndicatorToBeBelowLastBlock( firstWidgetArea - ); + );*/ await addParagraphBlock.click(); await page.keyboard.type( 'Second Paragraph' ); From 1a4580f2ce7df4ca4fd737479aeddf9a0d8701e2 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Tue, 19 Jan 2021 20:07:18 +0100 Subject: [PATCH 20/61] Site Editor: Fix _wp_file_based term deletion in migration (#28300) * Hook into `init` instead of `plugins_loaded`. * Fix typo in taxonomy (`wp-theme` -> `wp_theme`). * Rename option to `gutenberg_version_migration` to conform with usual convention, and to distinguish from `_GUTENBERG_VERSION_MIGRATION` constant. --- lib/upgrade.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/upgrade.php b/lib/upgrade.php index 2573ed6d575dab..d930999a67890a 100644 --- a/lib/upgrade.php +++ b/lib/upgrade.php @@ -18,14 +18,14 @@ */ function _gutenberg_migrate_database() { // The default value used here is the first version before migrations were added. - $gutenberg_installed_version = get_option( '_GUTENBERG_VERSION_MIGRATION', '9.7.0' ); + $gutenberg_installed_version = get_option( 'gutenberg_version_migration', '9.7.0' ); if ( _GUTENBERG_VERSION_MIGRATION !== $gutenberg_installed_version ) { if ( version_compare( $gutenberg_installed_version, '9.8.0', '<' ) ) { _gutenberg_migrate_remove_fse_drafts(); } - update_option( '_GUTENBERG_VERSION_MIGRATION', _GUTENBERG_VERSION_MIGRATION ); + update_option( 'gutenberg_version_migration', _GUTENBERG_VERSION_MIGRATION ); } } @@ -49,9 +49,9 @@ function _gutenberg_migrate_remove_fse_drafts() { } // Delete _wp_file_based term. - $term = get_term_by( 'name', '_wp_file_based', 'wp-theme' ); + $term = get_term_by( 'name', '_wp_file_based', 'wp_theme' ); if ( $term ) { - wp_delete_term( $term->term_id, 'wp-theme' ); + wp_delete_term( $term->term_id, 'wp_theme' ); } // Delete useless options. @@ -59,4 +59,7 @@ function _gutenberg_migrate_remove_fse_drafts() { delete_option( 'gutenberg_last_synchronize_theme_template-part_checks' ); } -add_action( 'plugins_loaded', '_gutenberg_migrate_database' ); +// Deletion of the `_wp_file_based` term (in _gutenberg_migrate_remove_fse_drafts) must happen +// after its taxonomy (`wp_theme`) is registered. This happens in `gutenberg_register_wp_theme_taxonomy`, +// which is hooked into `init` (default priority, i.e. 10). +add_action( 'init', '_gutenberg_migrate_database', 20 ); From ab21e29ab2ac5ef6b650491959b95aac3957252c Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Tue, 19 Jan 2021 21:02:31 +0100 Subject: [PATCH 21/61] Changelog: Group entries for 9.8.0-rc.1 (#28332) --- changelog.txt | 66 +++++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/changelog.txt b/changelog.txt index 7029ea3abeee96..2ef5f8028a7151 100644 --- a/changelog.txt +++ b/changelog.txt @@ -18,18 +18,20 @@ ### Bug Fixes +- Reusable Blocks: + - Show an error message when a reusable block has gone missing. ([28126](https://github.com/WordPress/gutenberg/pull/28126)) + - Fix dismiss notice after error. ([28015](https://github.com/WordPress/gutenberg/pull/28015)) +- Cover Block: + - Fix nested cover block bug. ([28114](https://github.com/WordPress/gutenberg/pull/28114)) + - Fix invalid cover block transforms. ([28087](https://github.com/WordPress/gutenberg/pull/28087)) - Fix block error when transforming blocks with Link Popover opened. ([28136](https://github.com/WordPress/gutenberg/pull/28136)) - Fix PHP Notice in navigation-link. ([28134](https://github.com/WordPress/gutenberg/pull/28134)) - Prevent link paste in RichText components in Button and Navigation blocks. ([28130](https://github.com/WordPress/gutenberg/pull/28130)) - Fix floating date status inferred for posts where the status has been edited. ([28127](https://github.com/WordPress/gutenberg/pull/28127)) -- Show an error message when a reusable block has gone missing. ([28126](https://github.com/WordPress/gutenberg/pull/28126)) - BlockSwitcher: Fix crash due to null reference. ([28122](https://github.com/WordPress/gutenberg/pull/28122)) -- Fix nested cover block bug. ([28114](https://github.com/WordPress/gutenberg/pull/28114)) - Verse: Fix line-wrap rendering on front-end of site. ([28109](https://github.com/WordPress/gutenberg/pull/28109)) - FocalPointPicker: Fix rendering and dragging experience. ([28096](https://github.com/WordPress/gutenberg/pull/28096)) -- Fix invalid cover block transforms. ([28087](https://github.com/WordPress/gutenberg/pull/28087)) - Block Directory: Fix "missing" block when the block can be installed from the directory. ([28030](https://github.com/WordPress/gutenberg/pull/28030)) -- Reusable blocks: Fix dismiss notice after error. ([28015](https://github.com/WordPress/gutenberg/pull/28015)) - Fix locked template not updating when inner blocks template prop changes. ([28007](https://github.com/WordPress/gutenberg/pull/28007)) - Fix editor crash when registering a block pattern without `categories`. ([27970](https://github.com/WordPress/gutenberg/pull/27970)) - Fix the RTL editor styles and the theme styles option. ([27947](https://github.com/WordPress/gutenberg/pull/27947)) @@ -50,17 +52,21 @@ ### Experiments -- Delete unused options while upgrading the plugin. ([28164](https://github.com/WordPress/gutenberg/pull/28164)) +- Full Site Editing Framework: + - Load content in iframe. ([25775](https://github.com/WordPress/gutenberg/pull/25775)) + - Avoid using auto-drafts for theme templates and template parts. ([27910](https://github.com/WordPress/gutenberg/pull/27910)) + - Delete unused options while upgrading the plugin. ([28164](https://github.com/WordPress/gutenberg/pull/28164)) +- theme.json: + - Add border radius to the theme styles schema. ([27791](https://github.com/WordPress/gutenberg/pull/27791)) + - Add theme.json i18n mechanism and JSON file specifying which theme.json paths are translatable. ([27380](https://github.com/WordPress/gutenberg/pull/27380)) + - Add: Save time theme.json escaping. ([28061](https://github.com/WordPress/gutenberg/pull/28061)) - Hide the theme without comments.php deprecation message. ([28128](https://github.com/WordPress/gutenberg/pull/28128)) - Fix navigation editor. ([28080](https://github.com/WordPress/gutenberg/pull/28080)) - Widgets: Temporary fix for saving widgets. ([28078](https://github.com/WordPress/gutenberg/pull/28078)) - Decouple query from edit site. ([27972](https://github.com/WordPress/gutenberg/pull/27972)) - Only enable the template mode for viewable post types. ([27948](https://github.com/WordPress/gutenberg/pull/27948)) - Box control units: Ensure custom units are preserved. ([27800](https://github.com/WordPress/gutenberg/pull/27800)) -- Theme JSON: Add border radius to the theme styles schema. ([27791](https://github.com/WordPress/gutenberg/pull/27791)) -- Add theme.json i18n mechanism and JSON file specifying which theme.json paths are translatable. ([27380](https://github.com/WordPress/gutenberg/pull/27380)) - Navigation Block: Use draft status when user creates a post and don't render unpublished posts in menus. ([27207](https://github.com/WordPress/gutenberg/pull/27207)) -- Full site editor: Load content in iframe. ([25775](https://github.com/WordPress/gutenberg/pull/25775)) ### Documentation @@ -86,34 +92,37 @@ ### Tools -- Scripts: Align default engines for `check-engines` with the package. ([28143](https://github.com/WordPress/gutenberg/pull/28143)) -- end-to-end FSE: Fix intermittent errors in multi entity editing test. ([28107](https://github.com/WordPress/gutenberg/pull/28107)) +- Workflows (i.e. GitHub Actions): + - Create Release Draft when tagging version. ([27488](https://github.com/WordPress/gutenberg/pull/27488)) + - Add action to upload release to SVN repo. ([27591](https://github.com/WordPress/gutenberg/pull/27591)) + - Compare Performance upon Release. ([28046](https://github.com/WordPress/gutenberg/pull/28046)) + - Build Plugin Workflow: Bump node version to 14. ([28048](https://github.com/WordPress/gutenberg/pull/28048)) +- End-to-end tests: + - FSE: Fix intermittent errors in multi entity editing test. ([28107](https://github.com/WordPress/gutenberg/pull/28107)) + - Fix randomly failing end-to-end test. ([28073](https://github.com/WordPress/gutenberg/pull/28073)) + - Upgrade puppeteer to 5.5.0. ([28055](https://github.com/WordPress/gutenberg/pull/28055)) + - Performance tests: Fix. ([28026](https://github.com/WordPress/gutenberg/pull/28026)) +- Scripts: + - Align default engines for `check-engines` with the package. ([28143](https://github.com/WordPress/gutenberg/pull/28143)) + - Add support for static assets in build commands. ([28043](https://github.com/WordPress/gutenberg/pull/28043)) + - Make it possible to transpile `.jsx` files with build command. ([28002](https://github.com/WordPress/gutenberg/pull/28002)) + - ESLint minor version upgrade to 7.17.0. ([27965](https://github.com/WordPress/gutenberg/pull/27965)) + - Upgrade Jest to the new major version (26.x). ([27956](https://github.com/WordPress/gutenberg/pull/27956)) + - Use @wordpress/stylelint-config in @wordpress/scripts. ([27810](https://github.com/WordPress/gutenberg/pull/27810)) +- Linting: + - ESLint Plugin: Enable import rules used in Gutenberg. ([27387](https://github.com/WordPress/gutenberg/pull/27387)) + - Add no-unsafe-wp-apis to recommended configuration. ([27327](https://github.com/WordPress/gutenberg/pull/27327)) + - Remove /wordpress from test/linting ignore paths. ([20270](https://github.com/WordPress/gutenberg/pull/20270)) + - Update changelog for stylelint-config. ([28074](https://github.com/WordPress/gutenberg/pull/28074)) - Testing: Prevent a direct usage of Reakit. ([28095](https://github.com/WordPress/gutenberg/pull/28095)) -- Update changelog for stylelint-config. ([28074](https://github.com/WordPress/gutenberg/pull/28074)) -- Testing: Fix randomly failing end-to-end test. ([28073](https://github.com/WordPress/gutenberg/pull/28073)) -- Upgrade puppeteer to 5.5.0. ([28055](https://github.com/WordPress/gutenberg/pull/28055)) -- Build Plugin Workflow: Bump node version to 14. ([28048](https://github.com/WordPress/gutenberg/pull/28048)) -- GH Actions: Compare Performance upon Release. ([28046](https://github.com/WordPress/gutenberg/pull/28046)) -- Scripts: Add support for static assets in build commands. ([28043](https://github.com/WordPress/gutenberg/pull/28043)) -- Performance tests: Fix. ([28026](https://github.com/WordPress/gutenberg/pull/28026)) -- Scripts: Make it possible to transpile `.jsx` files with build command. ([28002](https://github.com/WordPress/gutenberg/pull/28002)) -- Revert "Upgrade webpack to version 5". ([27974](https://github.com/WordPress/gutenberg/pull/27974)) -- Scripts: ESLint minor version upgrade to 7.17.0. ([27965](https://github.com/WordPress/gutenberg/pull/27965)) -- Scripts: Upgrade Jest to the new major version (26.x). ([27956](https://github.com/WordPress/gutenberg/pull/27956)) - Update the minimum Node.js version to 12. ([27934](https://github.com/WordPress/gutenberg/pull/27934)) - wp-env: Ensure the environment is used with the logs command. ([27907](https://github.com/WordPress/gutenberg/pull/27907)) -- Use @wordpress/stylelint-config in @wordpress/scripts. ([27810](https://github.com/WordPress/gutenberg/pull/27810)) -- GH Actions: Add action to upload release to SVN repo. ([27591](https://github.com/WordPress/gutenberg/pull/27591)) -- GitHub Actions: Create Release Draft when tagging version. ([27488](https://github.com/WordPress/gutenberg/pull/27488)) -- ESLint Plugin: Enable import rules used in Gutenberg. ([27387](https://github.com/WordPress/gutenberg/pull/27387)) -- Eslint: Add no-unsafe-wp-apis to recommended configuration. ([27327](https://github.com/WordPress/gutenberg/pull/27327)) - Upgrade webpack to version 5. ([26382](https://github.com/WordPress/gutenberg/pull/26382)) -- Remove /wordpress from test/linting ignore paths. ([20270](https://github.com/WordPress/gutenberg/pull/20270)) +- Revert "Upgrade webpack to version 5". ([27974](https://github.com/WordPress/gutenberg/pull/27974)) ### Various - URL: Remove redundant array coercion. ([28072](https://github.com/WordPress/gutenberg/pull/28072)) -- Add: Save time theme.json escaping. ([28061](https://github.com/WordPress/gutenberg/pull/28061)) - Visual editor: Remove focusable wrapper. ([28058](https://github.com/WordPress/gutenberg/pull/28058)) - Readme: Increase tested Version up to WP 5.6. ([28050](https://github.com/WordPress/gutenberg/pull/28050)) - Interface: Remove deprecated prop from InterfaceSkeleton. ([28034](https://github.com/WordPress/gutenberg/pull/28034)) @@ -122,7 +131,6 @@ - Chore: Update Lerna dependency. ([27990](https://github.com/WordPress/gutenberg/pull/27990)) - Try: Make focus width a CSS variable. ([27968](https://github.com/WordPress/gutenberg/pull/27968)) - Add translation context to all block's titles. ([27933](https://github.com/WordPress/gutenberg/pull/27933)) -- Avoid using auto-drafts for theme templates and template parts. ([27910](https://github.com/WordPress/gutenberg/pull/27910)) - Add primary destructive button style. ([27774](https://github.com/WordPress/gutenberg/pull/27774)) - Modifies the widgets dashboard link to point to the new widgets editor. ([26880](https://github.com/WordPress/gutenberg/pull/26880)) - Use standard select element for small number of authors. ([26426](https://github.com/WordPress/gutenberg/pull/26426)) From c15ba814bf2faed8563e1bffc06920c25f8ff804 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Tue, 19 Jan 2021 21:17:48 +0100 Subject: [PATCH 22/61] Changelog: Restore other changelog edits for 9.8.0-rc.1 --- changelog.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2ef5f8028a7151..43e8deba01394d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,11 +4,8 @@ ### Enhancements -- Try: Transparent spacer. ([28103](https://github.com/WordPress/gutenberg/pull/28103)) -- Fix the border radius in the site editor. ([27986](https://github.com/WordPress/gutenberg/pull/27986)) +- Use a semi transparent background for the spacer block when selected. ([28103](https://github.com/WordPress/gutenberg/pull/28103)) - Display matching variation icon in Block Switcher. ([27903](https://github.com/WordPress/gutenberg/pull/27903)) -- Group Block: Add border radius. ([27665](https://github.com/WordPress/gutenberg/pull/27665)) -- Try: Fix appender margins again. ([27392](https://github.com/WordPress/gutenberg/pull/27392)) ### New APIs @@ -44,6 +41,7 @@ - Add aria labels to box control component inputs/button. ([27727](https://github.com/WordPress/gutenberg/pull/27727)) - Use clientWidth when no width is available for cropper. ([27687](https://github.com/WordPress/gutenberg/pull/27687)) - Core Data: Normalize `_fields` value for use in `stableKey`. ([27526](https://github.com/WordPress/gutenberg/pull/27526)) +- Fix appender margins again. ([27392](https://github.com/WordPress/gutenberg/pull/27392)) ### Performance @@ -56,10 +54,12 @@ - Load content in iframe. ([25775](https://github.com/WordPress/gutenberg/pull/25775)) - Avoid using auto-drafts for theme templates and template parts. ([27910](https://github.com/WordPress/gutenberg/pull/27910)) - Delete unused options while upgrading the plugin. ([28164](https://github.com/WordPress/gutenberg/pull/28164)) + - Fix the border radius in the site editor. ([27986](https://github.com/WordPress/gutenberg/pull/27986)) - theme.json: - Add border radius to the theme styles schema. ([27791](https://github.com/WordPress/gutenberg/pull/27791)) - Add theme.json i18n mechanism and JSON file specifying which theme.json paths are translatable. ([27380](https://github.com/WordPress/gutenberg/pull/27380)) - Add: Save time theme.json escaping. ([28061](https://github.com/WordPress/gutenberg/pull/28061)) +- Group Block: Add border radius. ([27665](https://github.com/WordPress/gutenberg/pull/27665)) - Hide the theme without comments.php deprecation message. ([28128](https://github.com/WordPress/gutenberg/pull/28128)) - Fix navigation editor. ([28080](https://github.com/WordPress/gutenberg/pull/28080)) - Widgets: Temporary fix for saving widgets. ([28078](https://github.com/WordPress/gutenberg/pull/28078)) From a88571f9815f2d2b2f692651d36d925c57b60b46 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Tue, 19 Jan 2021 12:32:31 -0800 Subject: [PATCH 23/61] wp-env: Fix upload directory conflict in phpunit service (#28120) * Fix upload directory conflict in phpunit service If a user mounts a wp-content/uploads directory, this conflicts with the upload directory in the phpunit service. The fix is to avoid mounting the user-specified option, and to instead use the named docker volume for this internal test service. * Switch to using the user-specified option * Add unit tests to cover the error --- .../env/lib/build-docker-compose-config.js | 9 +++- .../env/test/build-docker-compose-config.js | 42 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/packages/env/lib/build-docker-compose-config.js b/packages/env/lib/build-docker-compose-config.js index 8f97225a7a1b08..668836de88878e 100644 --- a/packages/env/lib/build-docker-compose-config.js +++ b/packages/env/lib/build-docker-compose-config.js @@ -164,6 +164,11 @@ module.exports = function buildDockerComposeConfig( config ) { // https://github.com/docker-library/wordpress/issues/256 const cliUser = '33:33'; + // If the user mounted their own uploads folder, we should not override it in the phpunit service. + const isMappingTestUploads = testsMounts.some( ( mount ) => + mount.endsWith( ':/var/www/html/wp-content/uploads' ) + ); + return { version: '3.7', services: { @@ -215,7 +220,9 @@ module.exports = function buildDockerComposeConfig( config ) { depends_on: [ 'tests-wordpress' ], volumes: [ ...testsMounts, - 'phpunit-uploads:/var/www/html/wp-content/uploads', + ...( ! isMappingTestUploads + ? [ 'phpunit-uploads:/var/www/html/wp-content/uploads' ] + : [] ), ], environment: { LOCAL_DIR: 'html', diff --git a/packages/env/test/build-docker-compose-config.js b/packages/env/test/build-docker-compose-config.js index f8adeb629bc7d4..b839d71ebcd14f 100644 --- a/packages/env/test/build-docker-compose-config.js +++ b/packages/env/test/build-docker-compose-config.js @@ -73,4 +73,46 @@ describe( 'buildDockerComposeConfig', () => { expect.arrayContaining( localSources ) ); } ); + + it( 'should not map the default phpunit uploads directory if the user has specified their own directory', () => { + const envConfig = { + ...CONFIG, + mappings: { + 'wp-content/uploads': { + path: '/path/to/wp-uploads', + }, + }, + }; + const dockerConfig = buildDockerComposeConfig( { + env: { development: envConfig, tests: envConfig }, + } ); + const expectedVolumes = [ + 'tests-wordpress:/var/www/html', + '/path/to/wp-uploads:/var/www/html/wp-content/uploads', + ]; + expect( dockerConfig.services.phpunit.volumes ).toEqual( + expectedVolumes + ); + } ); + + it( 'should map the default phpunit uploads directory even if the user has specified their own directory only for the development instance', () => { + const envConfig = { + ...CONFIG, + mappings: { + 'wp-content/uploads': { + path: '/path/to/wp-uploads', + }, + }, + }; + const dockerConfig = buildDockerComposeConfig( { + env: { development: envConfig, tests: CONFIG }, + } ); + const expectedVolumes = [ + 'tests-wordpress:/var/www/html', + 'phpunit-uploads:/var/www/html/wp-content/uploads', + ]; + expect( dockerConfig.services.phpunit.volumes ).toEqual( + expectedVolumes + ); + } ); } ); From 252dcd58ef544c6f127b2e4fda8328d010f5d687 Mon Sep 17 00:00:00 2001 From: Joel Dean Date: Tue, 19 Jan 2021 15:59:56 -0500 Subject: [PATCH 24/61] Custom script distclean to remove node_modules of all packages (#28177) * added a custom script distclean to remove node_modules of all packages. * Changed the alphabetic order of the script. * Switched to rimraf from rm -rf since it's cross platform. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 3d15cf55539cd3..311294a1aa46d8 100644 --- a/package.json +++ b/package.json @@ -218,6 +218,7 @@ "check-local-changes": "( git diff -U0 | xargs -0 node bin/process-git-diff ) || ( echo \"There are local uncommitted changes after one or both of 'npm install' or 'npm run docs:build'!\" && git diff --exit-code && exit 1 );", "dev": "npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"", "dev:packages": "node ./bin/packages/watch.js", + "distclean": "rimraf node_modules packages/*/node_modules", "docs:build": "node ./docs/tool/index.js && node ./bin/api-docs/update-api-docs.js", "fixtures:clean": "rimraf \"packages/e2e-tests/fixtures/blocks/*.+(json|serialized.html)\"", "fixtures:generate": "cross-env GENERATE_MISSING_FIXTURES=y npm run test-unit", From f2d3c09139ac13c17389dc5f12ca7fd45076abb1 Mon Sep 17 00:00:00 2001 From: Sara Marcondes Date: Tue, 19 Jan 2021 13:25:17 -0800 Subject: [PATCH 25/61] Docs: Update links to reference HEAD instead of a specific branch (#28331) --- .github/PULL_REQUEST_TEMPLATE.md | 4 +- .github/SUPPORT.md | 4 +- README.md | 4 +- bin/check-latest-npm.js | 2 +- docs/architecture/automated-testing.md | 2 +- docs/contributors/coding-guidelines.md | 8 ++-- docs/contributors/document.md | 2 +- .../getting-started-native-mobile.md | 4 +- docs/contributors/getting-started.md | 4 +- docs/contributors/managing-packages.md | 4 +- docs/contributors/readme.md | 2 +- docs/contributors/reference.md | 2 +- docs/contributors/release.md | 4 +- docs/contributors/testing-overview.md | 2 +- docs/contributors/triage.md | 2 +- .../backward-compatibility/deprecations.md | 6 +-- .../developers/block-api/block-deprecation.md | 2 +- .../developers/block-api/block-edit-save.md | 2 +- .../block-api/block-registration.md | 2 +- .../developers/block-api/block-templates.md | 2 +- .../developers/richtext.md | 10 ++--- .../developers/slotfills/README.md | 2 +- .../writing-your-first-block-type.md | 2 +- .../submitting-to-block-directory.md | 6 +-- gutenberg.php | 2 +- packages/README.md | 2 +- packages/annotations/src/store/index.js | 2 +- packages/babel-preset-default/README.md | 4 +- packages/block-directory/src/store/index.js | 4 +- packages/block-editor/README.md | 42 +++++++++---------- .../components/alignment-toolbar/README.md | 2 +- .../src/components/autocomplete/index.js | 2 +- .../block-alignment-toolbar/README.md | 2 +- .../src/components/block-breadcrumb/README.md | 2 +- .../src/components/block-card/README.md | 2 +- .../src/components/block-context/index.js | 2 +- .../src/components/block-icon/README.md | 2 +- .../src/components/block-inspector/README.md | 2 +- .../src/components/block-mover/README.md | 2 +- .../src/components/block-navigation/README.md | 2 +- .../block-parent-selector/README.md | 2 +- .../components/block-patterns-list/README.md | 2 +- .../src/components/block-preview/index.js | 2 +- .../block-settings-menu-controls/index.js | 2 +- .../src/components/block-toolbar/README.md | 2 +- .../src/components/block-types-list/README.md | 2 +- .../block-variation-picker/README.md | 2 +- .../block-variation-transforms/README.md | 2 +- .../block-vertical-alignment-toolbar/index.js | 2 +- .../components/button-block-appender/index.js | 2 +- .../button-block-appender/index.native.js | 2 +- .../src/components/copy-handler/README.md | 4 +- .../src/components/inner-blocks/index.js | 4 +- .../components/inner-blocks/index.native.js | 2 +- .../inspector-advanced-controls/README.md | 2 +- .../inspector-advanced-controls/index.js | 2 +- .../components/inspector-controls/index.js | 2 +- .../inspector-controls/index.native.js | 2 +- .../components/line-height-control/README.md | 2 +- .../src/components/media-placeholder/index.js | 2 +- .../src/components/media-upload/README.md | 2 +- .../src/components/media-upload/check.js | 2 +- .../src/components/media-upload/index.js | 2 +- .../multi-selection-inspector/README.md | 2 +- .../src/components/observe-typing/index.js | 2 +- .../src/components/plain-text/index.js | 2 +- .../src/components/preview-options/README.md | 2 +- .../src/components/rich-text/index.js | 2 +- .../src/components/ungroup-button/README.md | 2 +- .../src/components/url-input/button.js | 2 +- .../src/components/url-input/index.js | 2 +- .../src/components/url-popover/index.js | 2 +- .../src/components/warning/index.js | 2 +- packages/block-editor/src/store/index.js | 4 +- .../src/embed/wp-embed-preview.js | 4 +- packages/blocks/README.md | 2 +- packages/blocks/src/store/index.js | 2 +- packages/components/src/CONTRIBUTING.md | 4 +- packages/components/src/tree-grid/index.js | 2 +- .../src/tree-grid/roving-tab-index.js | 2 +- .../src/utils/hooks/use-update-effect.js | 2 +- packages/compose/README.md | 2 +- packages/core-data/src/index.js | 2 +- packages/edit-navigation/src/store/index.js | 4 +- packages/edit-post/README.md | 2 +- packages/edit-post/src/store/index.js | 2 +- .../src/store/batch-processing/index.js | 2 +- packages/edit-widgets/src/store/index.js | 4 +- packages/editor/src/store/index.js | 4 +- packages/env/lib/cli.js | 2 +- packages/eslint-plugin/CHANGELOG.md | 32 +++++++------- .../docs/rules/dependency-group.md | 2 +- .../docs/rules/i18n-no-variables.md | 2 +- .../docs/rules/i18n-text-domain.md | 2 +- .../docs/rules/i18n-translator-comments.md | 2 +- .../docs/rules/no-unsafe-wp-apis.md | 2 +- .../eslint-plugin/docs/rules/valid-sprintf.md | 2 +- .../eslint-plugin/rules/dependency-group.js | 2 +- packages/interface/src/store/index.js | 2 +- packages/jest-puppeteer-axe/README.md | 6 +-- packages/jest-puppeteer-axe/src/index.js | 4 +- packages/keyboard-shortcuts/README.md | 2 +- .../keyboard-shortcuts/src/store/index.js | 2 +- packages/media-utils/README.md | 2 +- packages/notices/src/store/index.js | 2 +- packages/nux/src/store/index.js | 2 +- .../lib/tasks/add-milestone/README.md | 2 +- packages/react-native-editor/README.md | 4 +- .../__device-tests__/README.md | 2 +- packages/reusable-blocks/src/store/index.js | 2 +- packages/rich-text/README.md | 2 +- packages/rich-text/src/store/index.js | 2 +- packages/scripts/README.md | 12 +++--- packages/scripts/scripts/lint-style.js | 2 +- packages/stylelint-config/CHANGELOG.md | 2 +- packages/viewport/README.md | 2 +- packages/viewport/src/store/index.js | 2 +- test/native/jest.config.js | 2 +- test/native/setup.js | 2 +- 119 files changed, 191 insertions(+), 191 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 94e2bce07afc13..7ba954ec61d6dd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ - + ## Description @@ -22,4 +22,4 @@ - [ ] My code follows the accessibility standards. - [ ] My code has proper inline documentation. - [ ] I've included developer documentation if appropriate. -- [ ] I've updated all React Native files affected by any refactorings/renamings in this PR. +- [ ] I've updated all React Native files affected by any refactorings/renamings in this PR. diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index e813100a83a9a5..02165e02a7f955 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -3,9 +3,9 @@ Welcome to Gutenberg, a WordPress project. We hope you join us in creating the future platform for publishing; all are welcome here. -* Please see the [Contributing Guidelines](https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md) for additional information on how to contribute. +* Please see the [Contributing Guidelines](https://github.com/WordPress/gutenberg/blob/HEAD/CONTRIBUTING.md) for additional information on how to contribute. -* As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://github.com/WordPress/gutenberg/blob/master/CODE_OF_CONDUCT.md). +* As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://github.com/WordPress/gutenberg/blob/HEAD/CODE_OF_CONDUCT.md). * Join us on Slack for real-time communication, it is where maintainers coordinate around the project. To get started using Slack, see: https://make.wordpress.org/chat/ diff --git a/README.md b/README.md index b5570c6dafdd13..3e06917e542547 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Review the [Create a Block tutorial](/docs/designers-developers/developers/tutor Gutenberg is an open-source project and welcomes all contributors from code to design, from documentation to triage. The project is built by many contributors and volunteers and we'd love your help building it. -See the [Contributors Handbook](https://developer.wordpress.org/block-editor/contributors/) for all the details on how you can contribute. See [CONTRIBUTING.md](https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md) for the contributing guidelines. +See the [Contributors Handbook](https://developer.wordpress.org/block-editor/contributors/) for all the details on how you can contribute. See [CONTRIBUTING.md](https://github.com/WordPress/gutenberg/blob/HEAD/CONTRIBUTING.md) for the contributing guidelines. -As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://github.com/WordPress/gutenberg/blob/master/CODE_OF_CONDUCT.md). +As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://github.com/WordPress/gutenberg/blob/HEAD/CODE_OF_CONDUCT.md). ## Get Involved diff --git a/bin/check-latest-npm.js b/bin/check-latest-npm.js index 95be20a0553f27..5cde902fc77075 100644 --- a/bin/check-latest-npm.js +++ b/bin/check-latest-npm.js @@ -23,7 +23,7 @@ async function getLatestNPMVersion() { // will return an abbreviated form of the package data which // includes enough detail to determine the latest version. // - // See: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md + // See: https://github.com/npm/registry/blob/HEAD/docs/responses/package-metadata.md Accept: 'application/vnd.npm.install-v1+json', }, }, diff --git a/docs/architecture/automated-testing.md b/docs/architecture/automated-testing.md index f7cee72b7cd7ed..803af58e17c0d8 100644 --- a/docs/architecture/automated-testing.md +++ b/docs/architecture/automated-testing.md @@ -13,7 +13,7 @@ These include: For more context, refer to the following resources: -- [Testing Overview: End-to-End Testing](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/testing-overview.md#end-to-end-testing) +- [Testing Overview: End-to-End Testing](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/testing-overview.md#end-to-end-testing) - [Testing: Experiment with Puppeteer for E2E testing](https://github.com/WordPress/gutenberg/pull/5618) - In early iterations, the contributing team opted to use Cypress for end-to-end testing. This pull request outlines problems with the approach, and proposed the initial transition to Puppeteer. - [JavaScript Chat Summary: January 28, 2020](https://make.wordpress.org/core/2020/02/04/javascript-chat-summary-january-28-2020/) diff --git a/docs/contributors/coding-guidelines.md b/docs/contributors/coding-guidelines.md index 19e7702cfbad98..786f098717858e 100644 --- a/docs/contributors/coding-guidelines.md +++ b/docs/contributors/coding-guidelines.md @@ -53,7 +53,7 @@ export default function Notice( { children, onRemove, isDismissible } ) { } ``` -A component's class name should **never** be used outside its own folder (with rare exceptions such as [`_z-index.scss`](https://github.com/WordPress/gutenberg/blob/master/packages/base-styles/_z-index.scss)). If you need to inherit styles of another component in your own components, you should render an instance of that other component. At worst, you should duplicate the styles within your own component's stylesheet. This is intended to improve maintainability by isolating shared components as a reusable interface, reducing the surface area of similar UI elements by adapting a limited set of common components to support a varied set of use-cases. +A component's class name should **never** be used outside its own folder (with rare exceptions such as [`_z-index.scss`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/base-styles/_z-index.scss)). If you need to inherit styles of another component in your own components, you should render an instance of that other component. At worst, you should duplicate the styles within your own component's stylesheet. This is intended to improve maintainability by isolating shared components as a reusable interface, reducing the surface area of similar UI elements by adapting a limited set of common components to support a varied set of use-cases. #### SCSS File Naming Conventions for Blocks @@ -210,7 +210,7 @@ alert( `My name is ${ name }.` ); - Example: `const hasFocus = ! nodeRef.current?.contains( document.activeElement );` will yield `true` if `nodeRef.current` is not assigned. - See related issue: [#21984](https://github.com/WordPress/gutenberg/issues/21984) - See similar ESLint rule: [`no-unsafe-negation`](https://eslint.org/docs/rules/no-unsafe-negation) -- When assigning a boolean value, observe that optional chaining may produce values which are [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) (`undefined`, `null`), but not strictly `false`. This can become an issue when the value is passed around in a way where it is expected to be a boolean (`true` or `false`). While it's a common occurrence for booleans—since booleans are often used in ways where the logic considers truthiness and falsyness broadly—these issues can also occur for other optional chaining when eagerly assuming a type resulting from the end of the property access chain. [Type-checking](https://github.com/WordPress/gutenberg/blob/master/packages/README.md#typescript) may help in preventing these sorts of errors. +- When assigning a boolean value, observe that optional chaining may produce values which are [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) (`undefined`, `null`), but not strictly `false`. This can become an issue when the value is passed around in a way where it is expected to be a boolean (`true` or `false`). While it's a common occurrence for booleans—since booleans are often used in ways where the logic considers truthiness and falsyness broadly—these issues can also occur for other optional chaining when eagerly assuming a type resulting from the end of the property access chain. [Type-checking](https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md#typescript) may help in preventing these sorts of errors. - Example: `document.body.classList.toggle( 'has-focus', nodeRef.current?.contains( document.activeElement ) );` may wrongly _add_ the class, since [the second argument is optional](https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/toggle). If `undefined` is passed, it would not unset the class as it would when `false` is passed. - Example: `` may inadvertently cause warnings in React by toggling between [controlled and uncontrolled inputs](https://reactjs.org/docs/uncontrolled-components.html). This is an easy trap to fall into when eagerly assuming that a result of `trim()` will always return a string value, overlooking the fact the optional chaining may have caused evaluation to abort earlier with a value of `undefined`. @@ -220,7 +220,7 @@ It is preferred to implement all components as [function components](https://rea ## JavaScript Documentation using JSDoc -Gutenberg follows the [WordPress JavaScript Documentation Standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/), with additional guidelines relevant for its distinct use of [import semantics](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/coding-guidelines.md#imports) in organizing files, the [use of TypeScript tooling](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/testing-overview.md#javascript-testing) for types validation, and automated documentation generation using [`@wordpress/docgen`](https://github.com/WordPress/gutenberg/tree/master/packages/docgen). +Gutenberg follows the [WordPress JavaScript Documentation Standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/), with additional guidelines relevant for its distinct use of [import semantics](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#imports) in organizing files, the [use of TypeScript tooling](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/testing-overview.md#javascript-testing) for types validation, and automated documentation generation using [`@wordpress/docgen`](https://github.com/WordPress/gutenberg/tree/master/packages/docgen). For additional guidance, consult the following resources: @@ -266,7 +266,7 @@ Note the use of quotes when defining a set of string literals. As in the [JavaSc Use the [TypeScript `import` function](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#import-types) to import type declarations from other files or third-party dependencies. -Since an imported type declaration can occupy an excess of the available line length and become verbose when referenced multiple times, you are encouraged to create an alias of the external type using a `@typedef` declaration at the top of the file, immediately following [the `import` groupings](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/coding-guidelines.md#imports). +Since an imported type declaration can occupy an excess of the available line length and become verbose when referenced multiple times, you are encouraged to create an alias of the external type using a `@typedef` declaration at the top of the file, immediately following [the `import` groupings](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#imports). ```js /** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */ diff --git a/docs/contributors/document.md b/docs/contributors/document.md index 2845f4e8b6e0ba..ae39f759b102e5 100644 --- a/docs/contributors/document.md +++ b/docs/contributors/document.md @@ -43,7 +43,7 @@ To add a new documentation page requires a working JavaScript development enviro 1. Create a Markdown file in the [docs](https://github.com/WordPress/gutenberg/tree/master/docs) folder, use lower-case, no spaces, if needed a dash separator, and .md extension. 2. Add content, all documents require one and only H1 tag, using markdown notation. -3. Add item to the [toc.json](https://github.com/WordPress/gutenberg/blob/master/docs/toc.json) hierarchy, see existing entries for format. +3. Add item to the [toc.json](https://github.com/WordPress/gutenberg/blob/HEAD/docs/toc.json) hierarchy, see existing entries for format. 4. Run `npm run docs:build` to update `manifest.json`. 5. Commit `manifest.json` with other files updated. diff --git a/docs/contributors/getting-started-native-mobile.md b/docs/contributors/getting-started-native-mobile.md index b794f70267be14..8c3bcc9b5ddae4 100644 --- a/docs/contributors/getting-started-native-mobile.md +++ b/docs/contributors/getting-started-native-mobile.md @@ -102,14 +102,14 @@ Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "R ## Writing and Running Unit Tests -This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/WordPress/gutenberg/blob/master/packages/react-native-editor/src/test/api-fetch-setup.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html). +This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/WordPress/gutenberg/blob/HEAD/packages/react-native-editor/src/test/api-fetch-setup.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html). ## UI Tests This repository uses Appium to run UI tests. The tests live in `__device-tests__` and are written using Appium to run tests against simulators and real devices. To run these you'll need to check off a few things: - When running the tests, you'll need to ensure the Metro bundler (`npm run native start`) is not running. -- [Appium CLI](https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md) installed and available globally. We also recommend using [appium-doctor](https://github.com/appium/appium-doctor) to ensure all of Appium's dependencies are good to go. You don't have to worry about starting the server yourself, the tests handle starting the server on port 4723, just be sure that the port is free or feel free to change the port number in the test file. +- [Appium CLI](https://github.com/appium/appium/blob/HEAD/docs/en/about-appium/getting-started.md) installed and available globally. We also recommend using [appium-doctor](https://github.com/appium/appium-doctor) to ensure all of Appium's dependencies are good to go. You don't have to worry about starting the server yourself, the tests handle starting the server on port 4723, just be sure that the port is free or feel free to change the port number in the test file. - For iOS a simulator should automatically launch but for Android you'll need to have an emulator _with at least platform version 8.0_ fired up and running. Then, to run the UI tests on iOS: diff --git a/docs/contributors/getting-started.md b/docs/contributors/getting-started.md index ddd38be4d16931..7fe2d71e2e5cb3 100644 --- a/docs/contributors/getting-started.md +++ b/docs/contributors/getting-started.md @@ -146,13 +146,13 @@ We recommend configuring your editor to automatically check for syntax and lint ### EditorConfig -[EditorConfig](https://editorconfig.org/) defines a standard configuration for setting up your editor, for example using tabs instead of spaces. You should install the [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=editorconfig.editorconfig) extension and it will automatically configure your editor to match the rules defined in [.editorconfig](https://github.com/WordPress/gutenberg/blob/master/.editorconfig). +[EditorConfig](https://editorconfig.org/) defines a standard configuration for setting up your editor, for example using tabs instead of spaces. You should install the [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=editorconfig.editorconfig) extension and it will automatically configure your editor to match the rules defined in [.editorconfig](https://github.com/WordPress/gutenberg/blob/HEAD/.editorconfig). ### ESLint [ESLint](https://eslint.org/) statically analyzes the code to find problems. The lint rules are integrated in the continuous integration process and must pass to be able to commit. You should install the [ESLint Extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) for Visual Studio Code, see eslint docs for [more editor integrations](https://eslint.org/docs/user-guide/integrations). -With the extension installed, ESLint will use the [.eslintrc.js](https://github.com/WordPress/gutenberg/blob/master/.eslintrc.js) file in the root of the Gutenberg repository for formatting rules. It will highlight issues as you develop, you can also set the following preference to fix lint rules on save. +With the extension installed, ESLint will use the [.eslintrc.js](https://github.com/WordPress/gutenberg/blob/HEAD/.eslintrc.js) file in the root of the Gutenberg repository for formatting rules. It will highlight issues as you develop, you can also set the following preference to fix lint rules on save. ```json "editor.codeActionsOnSave": { diff --git a/docs/contributors/managing-packages.md b/docs/contributors/managing-packages.md index 9032af8cf3acbe..e89298a10ada6c 100644 --- a/docs/contributors/managing-packages.md +++ b/docs/contributors/managing-packages.md @@ -1,8 +1,8 @@ # Managing Packages -This repository uses [lerna] to manage Gutenberg modules and publish them as packages to [npm]. This enforces certain steps in the workflow which are described in details in [packages](https://github.com/WordPress/gutenberg/blob/master/packages/README.md) documentation. +This repository uses [lerna] to manage Gutenberg modules and publish them as packages to [npm]. This enforces certain steps in the workflow which are described in details in [packages](https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md) documentation. -Maintaining dozens of npm packages is difficult—it can be tough to keep track of changes. That's why we use `CHANGELOG.md` files for each package to simplify the release process. As a contributor, you should add an entry to the aforementioned file each time you contribute adding production code as described in [Maintaining Changelogs](https://github.com/WordPress/gutenberg/blob/master/packages/README.md#maintaining-changelogs) section. +Maintaining dozens of npm packages is difficult—it can be tough to keep track of changes. That's why we use `CHANGELOG.md` files for each package to simplify the release process. As a contributor, you should add an entry to the aforementioned file each time you contribute adding production code as described in [Maintaining Changelogs](https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md#maintaining-changelogs) section. [lerna]: https://lerna.js.org [npm]: https://www.npmjs.com/ diff --git a/docs/contributors/readme.md b/docs/contributors/readme.md index e51702b7248424..03d6da96ab333e 100644 --- a/docs/contributors/readme.md +++ b/docs/contributors/readme.md @@ -30,4 +30,4 @@ The Gutenberg project uses Github for managing code and tracking issues. Please ## Guidelines -See the [Contributing Guidelines](https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md) for the rules around contributing: This includes the code of conduct and licensing information. +See the [Contributing Guidelines](https://github.com/WordPress/gutenberg/blob/HEAD/CONTRIBUTING.md) for the rules around contributing: This includes the code of conduct and licensing information. diff --git a/docs/contributors/reference.md b/docs/contributors/reference.md index e1e714f07940dc..f93111ec56fc37 100644 --- a/docs/contributors/reference.md +++ b/docs/contributors/reference.md @@ -10,7 +10,7 @@ Released under GPL license, made by [Cristel Rossignol](https://twitter.com/cristelrossi). -[Download the SVG logo](https://github.com/WordPress/gutenberg/blob/master/docs/final-g-wapuu-black.svg). +[Download the SVG logo](https://github.com/WordPress/gutenberg/blob/HEAD/docs/final-g-wapuu-black.svg). ## Mockups diff --git a/docs/contributors/release.md b/docs/contributors/release.md index a1bc58edce80a6..86ad2988da1ea0 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -328,7 +328,7 @@ Check the versions listed in the current `CHANGELOG.md` file, looking through th Note: You may discover the current version of each package is not up to date, if so updating the previous released versions would be appreciated. -Begin updating the _changelogs_ based on the [Maintaining Changelogs](https://github.com/WordPress/gutenberg/blob/master/packages/README.md#maintaining-changelogs) documentation and commit the changes: +Begin updating the _changelogs_ based on the [Maintaining Changelogs](https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md#maintaining-changelogs) documentation and commit the changes: 1. `git checkout wp/trunk` 2. Update each of the `CHANGELOG.md` files @@ -414,4 +414,4 @@ Time to announce the published changes in the #core-js and #core-editor Slack ch Ta-da! 🎉 [plugin repository]: https://plugins.trac.wordpress.org/browser/gutenberg/ -[package release process]: https://github.com/WordPress/gutenberg/blob/master/packages/README.md#releasing-packages +[package release process]: https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md#releasing-packages diff --git a/docs/contributors/testing-overview.md b/docs/contributors/testing-overview.md index 7616af58afacf0..d052abb1702e95 100644 --- a/docs/contributors/testing-overview.md +++ b/docs/contributors/testing-overview.md @@ -450,7 +450,7 @@ Related: https://chromedevtools.github.io/devtools-protocol/tot/Network#method-e ### Core Block Testing -Every core block is required to have at least one set of fixture files for its main save function and one for each deprecation. These fixtures test the parsing and serialization of the block. See [the e2e tests fixtures readme](https://github.com/wordpress/gutenberg/blob/master/packages/e2e-tests/fixtures/blocks/README.md) for more information and instructions. +Every core block is required to have at least one set of fixture files for its main save function and one for each deprecation. These fixtures test the parsing and serialization of the block. See [the e2e tests fixtures readme](https://github.com/wordpress/gutenberg/blob/HEAD/packages/e2e-tests/fixtures/blocks/README.md) for more information and instructions. ## PHP Testing diff --git a/docs/contributors/triage.md b/docs/contributors/triage.md index 6da30fc5526c98..47f9cdb82479bd 100644 --- a/docs/contributors/triage.md +++ b/docs/contributors/triage.md @@ -20,7 +20,7 @@ If you would like to join this team, simply ask in #core-editor [Slack](https:// To start simply choose from one of these filtered lists below. Note: You can find most of these filters by selecting the “Sort” option from the [overall Issues page](https://github.com/wordpress/gutenberg/issues). * All Gutenberg issues [without an assigned label](https://github.com/WordPress/gutenberg/issues?q=is%3Aopen+is%3Aissue+no%3Alabel+sort%3Aupdated-asc). Triaging by simply adding labels helps people focused on certain aspects of Gutenberg find relevant issues easier and start working on them. -* All Gutenberg pull requests [without an assigned label](https://github.com/WordPress/gutenberg/pulls?q=is%3Aopen+is%3Apr+no%3Alabel). This requires a level of comfortability with code. For more guidance on which labels are best to use, please [review this section on labeling pull requests](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/repository-management.md#pull-requests) for contributors. You can also always check with the person authoring the pull request to make sure the labels match what they are intending to do. +* All Gutenberg pull requests [without an assigned label](https://github.com/WordPress/gutenberg/pulls?q=is%3Aopen+is%3Apr+no%3Alabel). This requires a level of comfortability with code. For more guidance on which labels are best to use, please [review this section on labeling pull requests](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/repository-management.md#pull-requests) for contributors. You can also always check with the person authoring the pull request to make sure the labels match what they are intending to do. * [The least recently updated](https://github.com/WordPress/gutenberg/issues?q=is%3Aopen+is%3Aissue+sort%3Aupdated-asc) Gutenberg issues. Triaging issues that are getting old and possibly out of date keeps important work from being overlooked. * All Gutenberg issues [with no comments](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+comments%3A0+). Triaging this list helps make sure all issues are acknowledged, and can help identify issues that may need more information or discussion before they are actionable. * [The least commented](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-asc) on Gutenberg issues. Triaging this list helps the community figure out what things might still need traction for certain proposals. diff --git a/docs/designers-developers/developers/backward-compatibility/deprecations.md b/docs/designers-developers/developers/backward-compatibility/deprecations.md index 64fcab1c424a0a..8780e5f2c96ad5 100644 --- a/docs/designers-developers/developers/backward-compatibility/deprecations.md +++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md @@ -8,12 +8,12 @@ For features included in the Gutenberg plugin, the deprecation policy is intende ## 8.6.0 -- Block API integration with [Block Context](https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-context.md) was updated. When registering a block use `usesContext` and `providesContext` pair in JavaScript files and `uses_context` and `provides_context` pair in PHP files instead of previous pair `context` and `providesContext`. +- Block API integration with [Block Context](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-context.md) was updated. When registering a block use `usesContext` and `providesContext` pair in JavaScript files and `uses_context` and `provides_context` pair in PHP files instead of previous pair `context` and `providesContext`. ## 8.3.0 -- The PHP function `gutenberg_get_post_from_context` has been removed. Use [Block Context](https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-context.md) instead. -- The old Block Pattern APIs `register_pattern`/`unregister_pattern` have been removed. Use the [new functions](https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-patterns.md#register_block_pattern) instead. +- The PHP function `gutenberg_get_post_from_context` has been removed. Use [Block Context](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-context.md) instead. +- The old Block Pattern APIs `register_pattern`/`unregister_pattern` have been removed. Use the [new functions](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-patterns.md#register_block_pattern) instead. ## 5.5.0 diff --git a/docs/designers-developers/developers/block-api/block-deprecation.md b/docs/designers-developers/developers/block-api/block-deprecation.md index d598a157d4ab71..6cb9dcb72f60a5 100644 --- a/docs/designers-developers/developers/block-api/block-deprecation.md +++ b/docs/designers-developers/developers/block-api/block-deprecation.md @@ -33,7 +33,7 @@ var deprecated = [ v3, v2, v1 ]; ``` {% end %} -It is also recommended to keep [fixtures](https://github.com/WordPress/gutenberg/blob/master/packages/e2e-tests/fixtures/blocks/README.md) which contain the different versions of the block content to allow you to easily test that new deprecations and migrations are working across all previous versions of the block. +It is also recommended to keep [fixtures](https://github.com/WordPress/gutenberg/blob/HEAD/packages/e2e-tests/fixtures/blocks/README.md) which contain the different versions of the block content to allow you to easily test that new deprecations and migrations are working across all previous versions of the block. Deprecations are defined on a block type as its `deprecated` property, an array of deprecation objects where each object takes the form: diff --git a/docs/designers-developers/developers/block-api/block-edit-save.md b/docs/designers-developers/developers/block-api/block-edit-save.md index d51ae9f7820581..a1a37659963904 100644 --- a/docs/designers-developers/developers/block-api/block-edit-save.md +++ b/docs/designers-developers/developers/block-api/block-edit-save.md @@ -408,7 +408,7 @@ save: function( props ) { Ideally, the attributes saved should be included in the markup. However, there are times when this is not practical, so if no attribute source is specified the attribute is serialized and saved to the block's comment delimiter. -This example could be for a dynamic block, such as the [Latest Posts block](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/latest-posts/index.js), which renders the markup server-side. The save function is still required, however in this case it simply returns null since the block is not saving content from the editor. +This example could be for a dynamic block, such as the [Latest Posts block](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-library/src/latest-posts/index.js), which renders the markup server-side. The save function is still required, however in this case it simply returns null since the block is not saving content from the editor. {% codetabs %} {% ESNext %} diff --git a/docs/designers-developers/developers/block-api/block-registration.md b/docs/designers-developers/developers/block-api/block-registration.md index ffe0981510eb16..cab91e38c1de4f 100644 --- a/docs/designers-developers/developers/block-api/block-registration.md +++ b/docs/designers-developers/developers/block-api/block-registration.md @@ -303,7 +303,7 @@ Transforms provide rules for what a block can be transformed from and what it ca - **Type:** `Array` -Blocks are able to be inserted into blocks that use [`InnerBlocks`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md) as nested content. Sometimes it is useful to restrict a block so that it is only available as a nested block. For example, you might want to allow an 'Add to Cart' block to only be available within a 'Product' block. +Blocks are able to be inserted into blocks that use [`InnerBlocks`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md) as nested content. Sometimes it is useful to restrict a block so that it is only available as a nested block. For example, you might want to allow an 'Add to Cart' block to only be available within a 'Product' block. Setting `parent` lets a block require that it is only available when nested within the specified blocks. diff --git a/docs/designers-developers/developers/block-api/block-templates.md b/docs/designers-developers/developers/block-api/block-templates.md index 42e7a660545833..dc456d5dc3c195 100644 --- a/docs/designers-developers/developers/block-api/block-templates.md +++ b/docs/designers-developers/developers/block-api/block-templates.md @@ -32,7 +32,7 @@ function myplugin_register_template() { add_action( 'init', 'myplugin_register_template' ); ``` -The following example in JavaScript creates a new block using [InnerBlocks](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md) and templates, when inserted creates a set of blocks based off the template. +The following example in JavaScript creates a new block using [InnerBlocks](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md) and templates, when inserted creates a set of blocks based off the template. ```js const el = wp.element.createElement; diff --git a/docs/designers-developers/developers/richtext.md b/docs/designers-developers/developers/richtext.md index d6ca4a5195a3d3..98a22256b1dbfc 100644 --- a/docs/designers-developers/developers/richtext.md +++ b/docs/designers-developers/developers/richtext.md @@ -12,16 +12,16 @@ Unlike other components that exist in the [Component Reference](/packages/compon ## Property Reference -For a list of the possible properties to pass your RichText component, [check out the component documentation on Github](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/rich-text/README.md). +For a list of the possible properties to pass your RichText component, [check out the component documentation on Github](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md). ## Core Blocks Using the RichText Component There are a number of core blocks using the RichText component. The JavaScript edit function linked below for each block can be used as a best practice reference while creating your own blocks. -* **[Button](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/button/edit.js):** RichText is used to enter the button's text. -* **[Heading](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/heading/edit.js):** RichText is used to enter the heading's text. -* **[Quote](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/quote/edit.js):** RichText is used in two places, for both the quotation and citation text. -* **[Search](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/search/edit.js):** RichText is used in two places, for both the label above the search field and the submit button text. +* **[Button](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-library/src/button/edit.js):** RichText is used to enter the button's text. +* **[Heading](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-library/src/heading/edit.js):** RichText is used to enter the heading's text. +* **[Quote](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-library/src/quote/edit.js):** RichText is used in two places, for both the quotation and citation text. +* **[Search](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-library/src/search/edit.js):** RichText is used in two places, for both the label above the search field and the submit button text. ## Example diff --git a/docs/designers-developers/developers/slotfills/README.md b/docs/designers-developers/developers/slotfills/README.md index 2ed99cf47b3e15..d29a9efe3e21fb 100644 --- a/docs/designers-developers/developers/slotfills/README.md +++ b/docs/designers-developers/developers/slotfills/README.md @@ -33,7 +33,7 @@ registerPlugin( 'post-status-info-test', { render: PluginPostStatusInfoTest } ); SlotFills are created using `createSlotFill`. This creates two components, `Slot` and `Fill` which are then used to create a new component that is exported on the `wp.plugins` global. -**Definition of the `PluginPostStatusInfo` SlotFill** ([see core code](https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/src/components/sidebar/plugin-post-status-info/index.js#L54)) +**Definition of the `PluginPostStatusInfo` SlotFill** ([see core code](https://github.com/WordPress/gutenberg/blob/HEAD/packages/edit-post/src/components/sidebar/plugin-post-status-info/index.js#L54)) ```js /** diff --git a/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md b/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md index 53a73d7c5d7e80..87d98bd4f9e76d 100644 --- a/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md +++ b/docs/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type.md @@ -38,7 +38,7 @@ add_action( 'init', 'gutenberg_examples_01_register_block' ); Note the above example, shows using the [wp-scripts build step](/docs/designers-developers/developers/tutorials/javascript/js-build-setup/) that automatically sets dependencies and versions the file. -If you were using the ES5 code, you would specify `array( 'wp-blocks', 'wp-element' )` as the dependency array. See the [example 01](https://github.com/WordPress/gutenberg-examples/blob/master/01-basic/index.php) in Gutenberg Examples repository for full syntax. +If you were using the ES5 code, you would specify `array( 'wp-blocks', 'wp-element' )` as the dependency array. See the [example 01](https://github.com/WordPress/gutenberg-examples/blob/HEAD/01-basic/index.php) in Gutenberg Examples repository for full syntax. - __`wp-blocks`__ includes block type registration and related functions - __`wp-element`__ includes the [WordPress Element abstraction](/packages/element/README.md) for describing the structure of your blocks diff --git a/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md b/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md index b84ff46b041fd9..6f15f634a39fd9 100644 --- a/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md +++ b/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md @@ -46,7 +46,7 @@ Examples for an Image Slider block: - carousel - gallery -[Read more about keywords.](https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#keywords) +[Read more about keywords.](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-metadata.md#keywords) ### Choose the right category @@ -59,7 +59,7 @@ The Block Editor allows you to indicate the category your block belongs in, maki - widgets - embed -[Read more about categories.](https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#category) +[Read more about categories.](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-metadata.md#category) Wondering where to input all this information? Read the next section :) @@ -90,7 +90,7 @@ Here is an example of a basic block.json file. } ``` -The `block.json` file also contains other important properties. Take a look at an [example block.json](https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md) for additional properties to be included in the block.json file. +The `block.json` file also contains other important properties. Take a look at an [example block.json](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-metadata.md) for additional properties to be included in the block.json file. ## Step 3: Zip & Submit diff --git a/gutenberg.php b/gutenberg.php index cd5311ad3db311..2c475a7723dff8 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -182,7 +182,7 @@ function gutenberg_wordpress_version_notice() { */ function gutenberg_build_files_notice() { echo '

      '; - _e( 'Gutenberg development mode requires files to be built. Run npm install to install dependencies, npm run build to build the files or npm run dev to build the files and watch for changes. Read the contributing file for more information.', 'gutenberg' ); + _e( 'Gutenberg development mode requires files to be built. Run npm install to install dependencies, npm run build to build the files or npm run dev to build the files and watch for changes. Read the contributing file for more information.', 'gutenberg' ); echo '

      '; } diff --git a/packages/README.md b/packages/README.md index 6491b46957ba8c..3b31a69d488c4c 100644 --- a/packages/README.md +++ b/packages/README.md @@ -173,7 +173,7 @@ While other section naming can be used when appropriate, it's important that are When in doubt, refer to [Semantic Versioning specification](https://semver.org/). -If you are publishing new versions of packages, note that there are versioning recommendations outlined in the [Gutenberg Release Process document](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/release.md) which prescribe _minimum_ version bumps for specific types of releases. The chosen version should be the greater of the two between the semantic versioning and Gutenberg release minimum version bumps. +If you are publishing new versions of packages, note that there are versioning recommendations outlined in the [Gutenberg Release Process document](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/release.md) which prescribe _minimum_ version bumps for specific types of releases. The chosen version should be the greater of the two between the semantic versioning and Gutenberg release minimum version bumps. ## Releasing Packages diff --git a/packages/annotations/src/store/index.js b/packages/annotations/src/store/index.js index 50c3cab06a72e7..6267d1b339bef1 100644 --- a/packages/annotations/src/store/index.js +++ b/packages/annotations/src/store/index.js @@ -18,7 +18,7 @@ import { STORE_NAME } from './constants'; /** * Store definition for the annotations namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/babel-preset-default/README.md b/packages/babel-preset-default/README.md index 8c71f273532b43..21adcb1b57f640 100644 --- a/packages/babel-preset-default/README.md +++ b/packages/babel-preset-default/README.md @@ -2,7 +2,7 @@ Default [Babel](https://babeljs.io/) preset for WordPress development. -The preset includes configuration which enable language features and syntax extensions targeted for support by WordPress. This includes [ECMAScript proposals](https://github.com/tc39/proposals) which have reached [Stage 4 ("Finished")](https://tc39.es/process-document/), as well as the [JSX syntax extension](https://reactjs.org/docs/introducing-jsx.html). For more information, refer to the [JavaScript Coding Guidelines](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/coding-guidelines.md#javascript). +The preset includes configuration which enable language features and syntax extensions targeted for support by WordPress. This includes [ECMAScript proposals](https://github.com/tc39/proposals) which have reached [Stage 4 ("Finished")](https://tc39.es/process-document/), as well as the [JSX syntax extension](https://reactjs.org/docs/introducing-jsx.html). For more information, refer to the [JavaScript Coding Guidelines](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#javascript). ## Installation @@ -28,7 +28,7 @@ For example, using `.babelrc`: #### Extending Configuration -This preset is an opinionated configuration. If you would like to add to or change this configuration, you can do so by expanding your Babel configuration to include plugins or presets which override those included through this preset. It may help to familiarize yourself [the implementation of the configuration](https://github.com/WordPress/gutenberg/blob/master/packages/babel-preset-default/index.js) to see which specific plugins are enabled by default through this preset. +This preset is an opinionated configuration. If you would like to add to or change this configuration, you can do so by expanding your Babel configuration to include plugins or presets which override those included through this preset. It may help to familiarize yourself [the implementation of the configuration](https://github.com/WordPress/gutenberg/blob/HEAD/packages/babel-preset-default/index.js) to see which specific plugins are enabled by default through this preset. For example, if you'd like to use a new language feature proposal which has not reached the stability requirements of WordPress, you can add those as additional plugins in your Babel configuration: diff --git a/packages/block-directory/src/store/index.js b/packages/block-directory/src/store/index.js index ca3f2c8b939dd6..89f64e4485a495 100644 --- a/packages/block-directory/src/store/index.js +++ b/packages/block-directory/src/store/index.js @@ -21,7 +21,7 @@ const STORE_NAME = 'core/block-directory'; /** * Block editor data store configuration. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore * * @type {Object} */ @@ -36,7 +36,7 @@ export const storeConfig = { /** * Store definition for the block directory namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 95611432d3e1bb..81f1097bf30031 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -84,7 +84,7 @@ Undocumented declaration. _Related_ -- +- # **BlockAlignmentToolbar** @@ -108,7 +108,7 @@ Component which merges passed value with current consumed block context. _Related_ -- +- _Parameters_ @@ -160,7 +160,7 @@ BlockPreview renders a preview of a block or array of blocks. _Related_ -- +- _Parameters_ @@ -184,7 +184,7 @@ Undocumented declaration. _Related_ -- +- # **BlockTitle** @@ -214,13 +214,13 @@ Undocumented declaration. _Related_ -- +- # **ButtonBlockerAppender** _Related_ -- +- # **ColorPalette** @@ -384,7 +384,7 @@ _Returns_ _Related_ -- +- # **Inserter** @@ -394,13 +394,13 @@ Undocumented declaration. _Related_ -- +- # **InspectorControls** _Related_ -- +- # **LineHeightControl** @@ -410,7 +410,7 @@ Undocumented declaration. _Related_ -- +- # **MediaReplaceFlow** @@ -420,13 +420,13 @@ Undocumented declaration. _Related_ -- +- # **MediaUploadCheck** _Related_ -- +- # **MultiSelectScrollIntoView** @@ -441,7 +441,7 @@ Undocumented declaration. _Related_ -- +- # **PanelColorSettings** @@ -451,7 +451,7 @@ Undocumented declaration. _Related_ -- +- # **PreserveScrollInReorder** @@ -461,7 +461,7 @@ Undocumented declaration. _Related_ -- +- # **RichTextShortcut** @@ -509,7 +509,7 @@ Store definition for the block editor namespace. _Related_ -- +- _Type_ @@ -521,7 +521,7 @@ Block editor data store configuration. _Related_ -- +- _Type_ @@ -554,19 +554,19 @@ can vary. It is the last clicked or scrolled to position. _Related_ -- +- # **URLInputButton** _Related_ -- +- # **URLPopover** _Related_ -- +- # **useBlockDisplayInformation** @@ -640,7 +640,7 @@ _Returns_ _Related_ -- +- # **withColorContext** diff --git a/packages/block-editor/src/components/alignment-toolbar/README.md b/packages/block-editor/src/components/alignment-toolbar/README.md index 81697e70667723..e400bb1547dd07 100644 --- a/packages/block-editor/src/components/alignment-toolbar/README.md +++ b/packages/block-editor/src/components/alignment-toolbar/README.md @@ -50,4 +50,4 @@ A callback function invoked when the toolbar's alignment value is changed via an ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/autocomplete/index.js b/packages/block-editor/src/components/autocomplete/index.js index 5459128a8e475b..e4a214101d0df1 100644 --- a/packages/block-editor/src/components/autocomplete/index.js +++ b/packages/block-editor/src/components/autocomplete/index.js @@ -65,6 +65,6 @@ function BlockEditorAutocomplete( props ) { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/autocomplete/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/autocomplete/README.md */ export default BlockEditorAutocomplete; diff --git a/packages/block-editor/src/components/block-alignment-toolbar/README.md b/packages/block-editor/src/components/block-alignment-toolbar/README.md index 4288a68b49c1f5..116743673ae62a 100644 --- a/packages/block-editor/src/components/block-alignment-toolbar/README.md +++ b/packages/block-editor/src/components/block-alignment-toolbar/README.md @@ -48,4 +48,4 @@ A callback function invoked when the toolbar's alignment value is changed via an ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-breadcrumb/README.md b/packages/block-editor/src/components/block-breadcrumb/README.md index d28511d2a26526..537aa33b2cbbc8 100644 --- a/packages/block-editor/src/components/block-breadcrumb/README.md +++ b/packages/block-editor/src/components/block-breadcrumb/README.md @@ -26,4 +26,4 @@ const MyBreadcrumb = () => ; ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-card/README.md b/packages/block-editor/src/components/block-card/README.md index cc8740580952eb..4594ff6438facd 100644 --- a/packages/block-editor/src/components/block-card/README.md +++ b/packages/block-editor/src/components/block-card/README.md @@ -52,4 +52,4 @@ The description of the block. ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-context/index.js b/packages/block-editor/src/components/block-context/index.js index 617ae2ef2a8ed5..bf8e9b60935a28 100644 --- a/packages/block-editor/src/components/block-context/index.js +++ b/packages/block-editor/src/components/block-context/index.js @@ -19,7 +19,7 @@ const Context = createContext( {} ); /** * Component which merges passed value with current consumed block context. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/block-context/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-context/README.md * * @param {BlockContextProviderProps} props */ diff --git a/packages/block-editor/src/components/block-icon/README.md b/packages/block-editor/src/components/block-icon/README.md index 51aed14b340215..f2fc8308e45341 100644 --- a/packages/block-editor/src/components/block-icon/README.md +++ b/packages/block-editor/src/components/block-icon/README.md @@ -26,4 +26,4 @@ const MyBlockIcon = () => ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-inspector/README.md b/packages/block-editor/src/components/block-inspector/README.md index 45b2ac056afa21..29db59ee02bade 100644 --- a/packages/block-editor/src/components/block-inspector/README.md +++ b/packages/block-editor/src/components/block-inspector/README.md @@ -21,4 +21,4 @@ const MyBlockInspector = () => ``` ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. \ No newline at end of file +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. \ No newline at end of file diff --git a/packages/block-editor/src/components/block-mover/README.md b/packages/block-editor/src/components/block-mover/README.md index 1240c42bc6ed8f..379084f763178e 100644 --- a/packages/block-editor/src/components/block-mover/README.md +++ b/packages/block-editor/src/components/block-mover/README.md @@ -32,4 +32,4 @@ Blocks IDs ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. \ No newline at end of file +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. \ No newline at end of file diff --git a/packages/block-editor/src/components/block-navigation/README.md b/packages/block-editor/src/components/block-navigation/README.md index d849fac018439c..f8a360c91dafef 100644 --- a/packages/block-editor/src/components/block-navigation/README.md +++ b/packages/block-editor/src/components/block-navigation/README.md @@ -30,4 +30,4 @@ const MyNavigation = () => { BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/block-settings-menu-controls/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md */ export default BlockSettingsMenuControls; diff --git a/packages/block-editor/src/components/block-toolbar/README.md b/packages/block-editor/src/components/block-toolbar/README.md index 8c0ce66931563e..55e7b349670a76 100644 --- a/packages/block-editor/src/components/block-toolbar/README.md +++ b/packages/block-editor/src/components/block-toolbar/README.md @@ -26,4 +26,4 @@ const MyBlockToolbar = () => ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-types-list/README.md b/packages/block-editor/src/components/block-types-list/README.md index a074d730b73284..8fb67bf7266669 100644 --- a/packages/block-editor/src/components/block-types-list/README.md +++ b/packages/block-editor/src/components/block-types-list/README.md @@ -38,4 +38,4 @@ The blocks that will be displayed in the block list. ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-variation-picker/README.md b/packages/block-editor/src/components/block-variation-picker/README.md index 33c0c6e913b347..0c2a25bc9881db 100644 --- a/packages/block-editor/src/components/block-variation-picker/README.md +++ b/packages/block-editor/src/components/block-variation-picker/README.md @@ -49,4 +49,4 @@ The different variations of the block. ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-variation-transforms/README.md b/packages/block-editor/src/components/block-variation-transforms/README.md index 494c734502979e..cbaee69564ba98 100644 --- a/packages/block-editor/src/components/block-variation-transforms/README.md +++ b/packages/block-editor/src/components/block-variation-transforms/README.md @@ -51,4 +51,4 @@ The block's client id. ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/block-vertical-alignment-toolbar/index.js b/packages/block-editor/src/components/block-vertical-alignment-toolbar/index.js index d972230ca209df..babf6dc676ac92 100644 --- a/packages/block-editor/src/components/block-vertical-alignment-toolbar/index.js +++ b/packages/block-editor/src/components/block-vertical-alignment-toolbar/index.js @@ -71,6 +71,6 @@ export function BlockVerticalAlignmentToolbar( { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md */ export default BlockVerticalAlignmentToolbar; diff --git a/packages/block-editor/src/components/button-block-appender/index.js b/packages/block-editor/src/components/button-block-appender/index.js index 9b9167f9a04e7f..a37acc0429df7f 100644 --- a/packages/block-editor/src/components/button-block-appender/index.js +++ b/packages/block-editor/src/components/button-block-appender/index.js @@ -89,6 +89,6 @@ function ButtonBlockAppender( } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/button-block-appender/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md */ export default forwardRef( ButtonBlockAppender ); diff --git a/packages/block-editor/src/components/button-block-appender/index.native.js b/packages/block-editor/src/components/button-block-appender/index.native.js index e879ef243a0ca8..55b0a82278437d 100644 --- a/packages/block-editor/src/components/button-block-appender/index.native.js +++ b/packages/block-editor/src/components/button-block-appender/index.native.js @@ -71,6 +71,6 @@ function ButtonBlockAppender( { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/button-block-appender/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md */ export default withPreferredColorScheme( ButtonBlockAppender ); diff --git a/packages/block-editor/src/components/copy-handler/README.md b/packages/block-editor/src/components/copy-handler/README.md index 44ac1e3309603c..1599941b9bce2c 100644 --- a/packages/block-editor/src/components/copy-handler/README.md +++ b/packages/block-editor/src/components/copy-handler/README.md @@ -2,7 +2,7 @@ The `CopyHandler` component handles the copy/cut and paste events of its children blocks. It handles multiple selection of blocks as well. -Concretely, it handles the display of success messages and takes care of copying the block to the clipboard. It uses for that the [serialize function](https://github.com/WordPress/gutenberg/blob/master/packages/blocks/src/api/serializer.js), which outputs HTML augmented with the HTML-comment demarcations to denote blocks. +Concretely, it handles the display of success messages and takes care of copying the block to the clipboard. It uses for that the [serialize function](https://github.com/WordPress/gutenberg/blob/HEAD/packages/blocks/src/api/serializer.js), which outputs HTML augmented with the HTML-comment demarcations to denote blocks. ![Copy/cut behaviours](https://user-images.githubusercontent.com/150562/81698101-6e341d80-945d-11ea-9bfb-b20781f55033.gif) @@ -40,4 +40,4 @@ The elements to be rendered and whose `cut`, `copy` and `paste` events we'd like ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/inner-blocks/index.js b/packages/block-editor/src/components/inner-blocks/index.js index 3f0df33961dcc5..b8f3c72863318e 100644 --- a/packages/block-editor/src/components/inner-blocks/index.js +++ b/packages/block-editor/src/components/inner-blocks/index.js @@ -137,7 +137,7 @@ const ForwardedInnerBlocks = forwardRef( ( props, ref ) => { * the ref if one is defined. * @param {Object} options Optional. Inner blocks options. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md */ export function useInnerBlocksProps( props = {}, options = {} ) { const fallbackRef = useRef(); @@ -197,6 +197,6 @@ ForwardedInnerBlocks.Content = withBlockContentContext( ); /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md */ export default ForwardedInnerBlocks; diff --git a/packages/block-editor/src/components/inner-blocks/index.native.js b/packages/block-editor/src/components/inner-blocks/index.native.js index aa9646bcad84ac..13e6f2b5061388 100644 --- a/packages/block-editor/src/components/inner-blocks/index.native.js +++ b/packages/block-editor/src/components/inner-blocks/index.native.js @@ -152,6 +152,6 @@ InnerBlocks.Content = withBlockContentContext( ( { BlockContent } ) => ( ) ); /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md */ export default InnerBlocks; diff --git a/packages/block-editor/src/components/inspector-advanced-controls/README.md b/packages/block-editor/src/components/inspector-advanced-controls/README.md index 5ef35758bfee64..701ab50d0b0474 100644 --- a/packages/block-editor/src/components/inspector-advanced-controls/README.md +++ b/packages/block-editor/src/components/inspector-advanced-controls/README.md @@ -2,7 +2,7 @@ inspector-advanced-controls -Inspector Advanced Controls appear under the _Advanced_ panel of a block's [InspectorControls](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inspector-controls/README.md) -- that is, they appear as a specific set of controls within a block's settings panels. As the name suggests, `InspectorAdvancedControls` is meant for controls that most users aren't meant to interact with most of the time, such as adding an HTML anchor or custom CSS classes to a block. +Inspector Advanced Controls appear under the _Advanced_ panel of a block's [InspectorControls](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md) -- that is, they appear as a specific set of controls within a block's settings panels. As the name suggests, `InspectorAdvancedControls` is meant for controls that most users aren't meant to interact with most of the time, such as adding an HTML anchor or custom CSS classes to a block. ## Usage diff --git a/packages/block-editor/src/components/inspector-advanced-controls/index.js b/packages/block-editor/src/components/inspector-advanced-controls/index.js index b11a2f61583b29..11c30d7c41d254 100644 --- a/packages/block-editor/src/components/inspector-advanced-controls/index.js +++ b/packages/block-editor/src/components/inspector-advanced-controls/index.js @@ -20,6 +20,6 @@ InspectorAdvancedControls.slotName = name; InspectorAdvancedControls.Slot = Slot; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inspector-controls-advanced/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls-advanced/README.md */ export default InspectorAdvancedControls; diff --git a/packages/block-editor/src/components/inspector-controls/index.js b/packages/block-editor/src/components/inspector-controls/index.js index d7b25e72212c19..8db793f10ec392 100644 --- a/packages/block-editor/src/components/inspector-controls/index.js +++ b/packages/block-editor/src/components/inspector-controls/index.js @@ -17,6 +17,6 @@ function InspectorControls( { children } ) { InspectorControls.Slot = Slot; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inspector-controls/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md */ export default InspectorControls; diff --git a/packages/block-editor/src/components/inspector-controls/index.native.js b/packages/block-editor/src/components/inspector-controls/index.native.js index 4385ca69bce4df..ed131ddb4ce6a7 100644 --- a/packages/block-editor/src/components/inspector-controls/index.native.js +++ b/packages/block-editor/src/components/inspector-controls/index.native.js @@ -42,6 +42,6 @@ const InspectorControls = FillWithSettingsButton; InspectorControls.Slot = Slot; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inspector-controls/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md */ export default InspectorControls; diff --git a/packages/block-editor/src/components/line-height-control/README.md b/packages/block-editor/src/components/line-height-control/README.md index 28ed61c95f72bd..8930c4cd1c120d 100644 --- a/packages/block-editor/src/components/line-height-control/README.md +++ b/packages/block-editor/src/components/line-height-control/README.md @@ -41,4 +41,4 @@ A callback function that handles the application of the line height value. ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/media-placeholder/index.js b/packages/block-editor/src/components/media-placeholder/index.js index f04f1290ffbaec..a67ae8de5077c9 100644 --- a/packages/block-editor/src/components/media-placeholder/index.js +++ b/packages/block-editor/src/components/media-placeholder/index.js @@ -407,6 +407,6 @@ export function MediaPlaceholder( { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/media-placeholder/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md */ export default withFilters( 'editor.MediaPlaceholder' )( MediaPlaceholder ); diff --git a/packages/block-editor/src/components/media-upload/README.md b/packages/block-editor/src/components/media-upload/README.md index 8053e4080ab907..95d612599b51da 100644 --- a/packages/block-editor/src/components/media-upload/README.md +++ b/packages/block-editor/src/components/media-upload/README.md @@ -20,7 +20,7 @@ addFilter( ); ``` -You can check how this component is implemented for the edit post page using `wp.media` module in [edit-post](https://github.com/WordPress/gutenberg/blob/master/packages/media-utils/src/components/media-upload/index.js). +You can check how this component is implemented for the edit post page using `wp.media` module in [edit-post](https://github.com/WordPress/gutenberg/blob/HEAD/packages/media-utils/src/components/media-upload/index.js). ## Usage diff --git a/packages/block-editor/src/components/media-upload/check.js b/packages/block-editor/src/components/media-upload/check.js index becb7f030949ef..57644e696c6946 100644 --- a/packages/block-editor/src/components/media-upload/check.js +++ b/packages/block-editor/src/components/media-upload/check.js @@ -12,6 +12,6 @@ export function MediaUploadCheck( { fallback = null, children } ) { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/media-upload/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md */ export default MediaUploadCheck; diff --git a/packages/block-editor/src/components/media-upload/index.js b/packages/block-editor/src/components/media-upload/index.js index 2318ef93d5e4f4..ccaf902e497f43 100644 --- a/packages/block-editor/src/components/media-upload/index.js +++ b/packages/block-editor/src/components/media-upload/index.js @@ -13,6 +13,6 @@ import { withFilters } from '@wordpress/components'; const MediaUpload = () => null; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/media-upload/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md */ export default withFilters( 'editor.MediaUpload' )( MediaUpload ); diff --git a/packages/block-editor/src/components/multi-selection-inspector/README.md b/packages/block-editor/src/components/multi-selection-inspector/README.md index bccc2502d6a53e..bb8d219e0c5447 100644 --- a/packages/block-editor/src/components/multi-selection-inspector/README.md +++ b/packages/block-editor/src/components/multi-selection-inspector/README.md @@ -31,4 +31,4 @@ if ( SelectedBlockCount > 1 ) { ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. \ No newline at end of file +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. \ No newline at end of file diff --git a/packages/block-editor/src/components/observe-typing/index.js b/packages/block-editor/src/components/observe-typing/index.js index 3476d62c9692b6..38274cab5041fe 100644 --- a/packages/block-editor/src/components/observe-typing/index.js +++ b/packages/block-editor/src/components/observe-typing/index.js @@ -243,6 +243,6 @@ function ObserveTyping( { children } ) { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/observe-typing/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md */ export default ObserveTyping; diff --git a/packages/block-editor/src/components/plain-text/index.js b/packages/block-editor/src/components/plain-text/index.js index 7421fe3be0932f..2a4e1b423e6094 100644 --- a/packages/block-editor/src/components/plain-text/index.js +++ b/packages/block-editor/src/components/plain-text/index.js @@ -15,7 +15,7 @@ import { forwardRef } from '@wordpress/element'; import EditableText from '../editable-text'; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/plain-text/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md */ const PlainText = forwardRef( ( { __experimentalVersion, ...props }, ref ) => { if ( __experimentalVersion === 2 ) { diff --git a/packages/block-editor/src/components/preview-options/README.md b/packages/block-editor/src/components/preview-options/README.md index 766d2a2c951a78..5fc25894495a6a 100644 --- a/packages/block-editor/src/components/preview-options/README.md +++ b/packages/block-editor/src/components/preview-options/README.md @@ -83,4 +83,4 @@ Used to set the device type that will be used to display the preview inside the ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index b3919feb052ef7..493999742255e4 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -731,7 +731,7 @@ ForwardedRichTextContainer.Content.defaultProps = { }; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/rich-text/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md */ export default ForwardedRichTextContainer; export { RichTextShortcut } from './shortcut'; diff --git a/packages/block-editor/src/components/ungroup-button/README.md b/packages/block-editor/src/components/ungroup-button/README.md index 8a447ddf5d2bcc..64a3a1717e8215 100644 --- a/packages/block-editor/src/components/ungroup-button/README.md +++ b/packages/block-editor/src/components/ungroup-button/README.md @@ -27,4 +27,4 @@ const MyUngroupButton = () => ; ## Related components -Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/provider/README.md) in the components tree. +Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree. diff --git a/packages/block-editor/src/components/url-input/button.js b/packages/block-editor/src/components/url-input/button.js index c90332f1ff1846..6ee6b96f61e0e1 100644 --- a/packages/block-editor/src/components/url-input/button.js +++ b/packages/block-editor/src/components/url-input/button.js @@ -74,6 +74,6 @@ class URLInputButton extends Component { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/url-input/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md */ export default URLInputButton; diff --git a/packages/block-editor/src/components/url-input/index.js b/packages/block-editor/src/components/url-input/index.js index 944c9694fda8fe..c085fd8fcd45af 100644 --- a/packages/block-editor/src/components/url-input/index.js +++ b/packages/block-editor/src/components/url-input/index.js @@ -538,7 +538,7 @@ class URLInput extends Component { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/url-input/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md */ export default compose( withSafeTimeout, diff --git a/packages/block-editor/src/components/url-popover/index.js b/packages/block-editor/src/components/url-popover/index.js index 89a863e84a7608..35b13bbb336be8 100644 --- a/packages/block-editor/src/components/url-popover/index.js +++ b/packages/block-editor/src/components/url-popover/index.js @@ -68,6 +68,6 @@ URLPopover.LinkEditor = LinkEditor; URLPopover.LinkViewer = LinkViewer; /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/url-popover/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-popover/README.md */ export default URLPopover; diff --git a/packages/block-editor/src/components/warning/index.js b/packages/block-editor/src/components/warning/index.js index f34431cd868793..84c17726a518f6 100644 --- a/packages/block-editor/src/components/warning/index.js +++ b/packages/block-editor/src/components/warning/index.js @@ -63,6 +63,6 @@ function Warning( { className, actions, children, secondaryActions } ) { } /** - * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/warning/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md */ export default Warning; diff --git a/packages/block-editor/src/store/index.js b/packages/block-editor/src/store/index.js index 4ba66689166777..7e578c0d93818a 100644 --- a/packages/block-editor/src/store/index.js +++ b/packages/block-editor/src/store/index.js @@ -19,7 +19,7 @@ const STORE_NAME = 'core/block-editor'; /** * Block editor data store configuration. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore * * @type {Object} */ @@ -33,7 +33,7 @@ export const storeConfig = { /** * Store definition for the block editor namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/block-library/src/embed/wp-embed-preview.js b/packages/block-library/src/embed/wp-embed-preview.js index b2609381fbbd9c..2bdc086e3bc19f 100644 --- a/packages/block-library/src/embed/wp-embed-preview.js +++ b/packages/block-library/src/embed/wp-embed-preview.js @@ -20,8 +20,8 @@ export default function WpEmbedPreview( { html } ) { * * References: * window.postMessage: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage - * WordPress core embed-template on load: https://github.com/WordPress/WordPress/blob/master/wp-includes/js/wp-embed-template.js#L143 - * WordPress core embed-template on resize: https://github.com/WordPress/WordPress/blob/master/wp-includes/js/wp-embed-template.js#L187 + * WordPress core embed-template on load: https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143 + * WordPress core embed-template on resize: https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187 * * @param {WPSyntheticEvent} event Message event. */ diff --git a/packages/blocks/README.md b/packages/blocks/README.md index 9f94639641b52a..2f3e282cab2ca4 100644 --- a/packages/blocks/README.md +++ b/packages/blocks/README.md @@ -765,7 +765,7 @@ Store definition for the blocks namespace. _Related_ -- +- _Type_ diff --git a/packages/blocks/src/store/index.js b/packages/blocks/src/store/index.js index f88fe4c423fa4a..6d2dc7c822dbde 100644 --- a/packages/blocks/src/store/index.js +++ b/packages/blocks/src/store/index.js @@ -14,7 +14,7 @@ import { STORE_NAME } from './constants'; /** * Store definition for the blocks namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/components/src/CONTRIBUTING.md b/packages/components/src/CONTRIBUTING.md index 8acfc7811cf81b..3fa27beddfa31f 100644 --- a/packages/components/src/CONTRIBUTING.md +++ b/packages/components/src/CONTRIBUTING.md @@ -37,7 +37,7 @@ Once the team has discussed and approved the change, it's time to start implemen 1. **Provide a rationale**: Explain how your component will add value to the system and the greater product ecosystem. Be sure to include any user experience and interaction descriptions. 2. **Draft documentation**: New components need development, design, and accessibility guidelines. Additionally, if your change adds additional behavior or expands a component’s features, those changes will need to be fully documented as well. Read through existing component documentation for examples. Start with a rough draft, and reviewers will help polish documentation. -3. **Provide working code**: The component or enhancement must be built in React. See the [developer contribution guidelines](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/develop.md). +3. **Provide working code**: The component or enhancement must be built in React. See the [developer contribution guidelines](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/develop.md). 4. **Create a design spec**: Create sizing and styling annotations for all aspects of the component. This spec should provide a developer with everything they need to create the design in code. [Figma automatically does this for you](https://help.figma.com/article/32-developer-handoff). 5. **Create a Figma component**: Any new components or changes to existing components will be mirrored in the [WordPress Components Figma library](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=735%3A0), so we’ll need to update the Figma library and publish the changes. Please follow the [guidelines](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=746%3A38) for contributing to the Figma libraries. @@ -63,7 +63,7 @@ To ensure quality, each component should be tested. The testing process should b - **Responsiveness**: Does it incorporate responsive behaviors as needed? Is the component designed from a mobile-first perspective? Do all touch interactions work as expected? - **Content resilience**: Is each dynamic word or image element resilient to too much, too little, and no content at all, respectively? How long can labels be, and what happens when you run out of space? - **Composability**: Does it fit well when placed next to or layered with other components to form a larger composition? -- **Browser support**: Has the component visual quality and accuracy been checked across Safari, Chrome, Firefox, IE, etc? Please adhere to our [browser support requirements](https://github.com/WordPress/gutenberg/blob/master/packages/browserslist-config/index.js). +- **Browser support**: Has the component visual quality and accuracy been checked across Safari, Chrome, Firefox, IE, etc? Please adhere to our [browser support requirements](https://github.com/WordPress/gutenberg/blob/HEAD/packages/browserslist-config/index.js). ## Deprecation diff --git a/packages/components/src/tree-grid/index.js b/packages/components/src/tree-grid/index.js index cd5d6bb2a3cd3f..57df4417659878 100644 --- a/packages/components/src/tree-grid/index.js +++ b/packages/components/src/tree-grid/index.js @@ -38,7 +38,7 @@ function getRowFocusables( rowElement ) { /** * Renders both a table and tbody element, used to create a tree hierarchy. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/components/src/tree-grid/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md * @param {Object} props Component props. * @param {WPElement} props.children Children to be rendered. * @param {Object} ref A ref to the underlying DOM table element. diff --git a/packages/components/src/tree-grid/roving-tab-index.js b/packages/components/src/tree-grid/roving-tab-index.js index c5ed0ef9b9b0f1..b390c70f291d4d 100644 --- a/packages/components/src/tree-grid/roving-tab-index.js +++ b/packages/components/src/tree-grid/roving-tab-index.js @@ -11,7 +11,7 @@ import { RovingTabIndexProvider } from './roving-tab-index-context'; /** * Provider for adding roving tab index behaviors to tree grid structures. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/components/src/tree-grid/README.md + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md * * @param {Object} props Component props. * @param {WPElement} props.children Children to be rendered diff --git a/packages/components/src/utils/hooks/use-update-effect.js b/packages/components/src/utils/hooks/use-update-effect.js index 724be8746ba272..aaf04478b3860d 100644 --- a/packages/components/src/utils/hooks/use-update-effect.js +++ b/packages/components/src/utils/hooks/use-update-effect.js @@ -6,7 +6,7 @@ import { useRef, useEffect } from '@wordpress/element'; /** * A `React.useEffect` that will not run on the first render. * Source: - * https://github.com/reakit/reakit/blob/master/packages/reakit-utils/src/useUpdateEffect.ts + * https://github.com/reakit/reakit/blob/HEAD/packages/reakit-utils/src/useUpdateEffect.ts * * @param {import('react').EffectCallback} effect * @param {import('react').DependencyList} deps diff --git a/packages/compose/README.md b/packages/compose/README.md index 79df99458f6b69..a8fac9ba7ec73d 100644 --- a/packages/compose/README.md +++ b/packages/compose/README.md @@ -11,7 +11,7 @@ const compose = ( f, g ) => x => f( g( x ) ); ``` -Here's a simplified example of **compose** in use from Gutenberg's [`PluginSidebar` component](https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/src/components/sidebar/plugin-sidebar/index.js): +Here's a simplified example of **compose** in use from Gutenberg's [`PluginSidebar` component](https://github.com/WordPress/gutenberg/blob/HEAD/packages/edit-post/src/components/sidebar/plugin-sidebar/index.js): Using compose: diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index c59d5bcf97ce35..7d7ab99194c1d2 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -68,7 +68,7 @@ const storeConfig = { /** * Store definition for the code data namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/edit-navigation/src/store/index.js b/packages/edit-navigation/src/store/index.js index b55979e5d11868..6d3f4d5a401ee6 100644 --- a/packages/edit-navigation/src/store/index.js +++ b/packages/edit-navigation/src/store/index.js @@ -16,7 +16,7 @@ import { STORE_NAME } from './constants'; /** * Block editor data store configuration. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore * * @type {Object} */ @@ -31,7 +31,7 @@ const storeConfig = { /** * Store definition for the edit navigation namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/edit-post/README.md b/packages/edit-post/README.md index 1aa9181145c28f..c2936c8926862f 100644 --- a/packages/edit-post/README.md +++ b/packages/edit-post/README.md @@ -513,7 +513,7 @@ Store definition for the edit post namespace. _Related_ -- +- _Type_ diff --git a/packages/edit-post/src/store/index.js b/packages/edit-post/src/store/index.js index c461e54c601fc6..1cbe32e481c3c2 100644 --- a/packages/edit-post/src/store/index.js +++ b/packages/edit-post/src/store/index.js @@ -23,7 +23,7 @@ const storeConfig = { /** * Store definition for the edit post namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/edit-widgets/src/store/batch-processing/index.js b/packages/edit-widgets/src/store/batch-processing/index.js index c50ae697ed9985..2e94c4d0364f2d 100644 --- a/packages/edit-widgets/src/store/batch-processing/index.js +++ b/packages/edit-widgets/src/store/batch-processing/index.js @@ -15,7 +15,7 @@ import { STORE_NAME } from './constants'; /** * Block editor data store configuration. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore * * @type {Object} */ diff --git a/packages/edit-widgets/src/store/index.js b/packages/edit-widgets/src/store/index.js index f2524dca48125f..cedbcf8f1c7862 100644 --- a/packages/edit-widgets/src/store/index.js +++ b/packages/edit-widgets/src/store/index.js @@ -18,7 +18,7 @@ import { STORE_NAME } from './constants'; /** * Block editor data store configuration. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore * * @type {Object} */ @@ -33,7 +33,7 @@ const storeConfig = { /** * Store definition for the edit widgets namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/editor/src/store/index.js b/packages/editor/src/store/index.js index 9d4a0d6ad71881..ed7cb77a5c0afb 100644 --- a/packages/editor/src/store/index.js +++ b/packages/editor/src/store/index.js @@ -16,7 +16,7 @@ import { STORE_NAME } from './constants'; /** * Post editor data store configuration. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#registerStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore * * @type {Object} */ @@ -33,7 +33,7 @@ export const storeConfig = { /** * Store definition for the editor namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/env/lib/cli.js b/packages/env/lib/cli.js index 78e044c8da73e0..b6a5e146d24d31 100644 --- a/packages/env/lib/cli.js +++ b/packages/env/lib/cli.js @@ -48,7 +48,7 @@ const withSpinner = ( command ) => ( ...args ) => { 'out' in error ) { // Error is a docker-compose error. That means something docker-related failed. - // https://github.com/PDMLab/docker-compose/blob/master/src/index.ts + // https://github.com/PDMLab/docker-compose/blob/HEAD/src/index.ts spinner.fail( 'Error while running docker-compose command.' ); if ( error.out ) { process.stdout.write( error.out ); diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index c446ec96a933e8..c768ae5e6bd7e0 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -110,12 +110,12 @@ ### New Features -- New Rule: [`@wordpress/i18n-text-domain`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/i18n-text-domain.md) -- New Rule: [`@wordpress/i18n-translator-comments`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/i18n-translator-comments.md) -- New Rule: [`@wordpress/i18n-no-variables`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/i18n-no-variables.md) -- New Rule: [`@wordpress/i18n-no-placeholders-only`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/i18n-no-placeholders-only.md) -- New Rule: [`@wordpress/i18n-no-collapsible-whitespace`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/i18n-no-collapsible-whitespace.md) -- New Rule: [`@wordpress/i18n-ellipsis`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/i18n-ellipsis.md) +- New Rule: [`@wordpress/i18n-text-domain`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/i18n-text-domain.md) +- New Rule: [`@wordpress/i18n-translator-comments`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/i18n-translator-comments.md) +- New Rule: [`@wordpress/i18n-no-variables`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/i18n-no-variables.md) +- New Rule: [`@wordpress/i18n-no-placeholders-only`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/i18n-no-placeholders-only.md) +- New Rule: [`@wordpress/i18n-no-collapsible-whitespace`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/i18n-no-collapsible-whitespace.md) +- New Rule: [`@wordpress/i18n-ellipsis`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/i18n-ellipsis.md) - The bundled `eslint-plugin-react` dependency has been updated from requiring `^7.14.3` to requiring `^7.19.0` ([#21424](https://github.com/WordPress/gutenberg/pull/21424)). ### Bug Fixes @@ -158,13 +158,13 @@ ### Breaking Changes -- The [`@wordpress/no-unused-vars-before-return` rule](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) has been improved to exempt object destructuring only if destructuring to more than one property. +- The [`@wordpress/no-unused-vars-before-return` rule](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) has been improved to exempt object destructuring only if destructuring to more than one property. - Stricter JSDoc linting using [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc). - Stricter validation enabled for test files only using new `test-e2e` and `test-unit` rulesets. ### New Features -- New Rule: [`@wordpress/no-unguarded-get-range-at`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unguarded-get-range-at.md) +- New Rule: [`@wordpress/no-unguarded-get-range-at`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/no-unguarded-get-range-at.md) - Enable `wp` global by default in the `recommended` config. - New ruleset `test-e2e` added for end-to-end tests validation. - New ruleset `test-unit` added for unit tests validation. @@ -177,11 +177,11 @@ ### New Features -- [`@wordpress/no-unused-vars-before-return`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) now supports an `excludePattern` option to exempt function calls by name. +- [`@wordpress/no-unused-vars-before-return`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) now supports an `excludePattern` option to exempt function calls by name. ### Improvements -- The recommended `react` configuration specifies an option to [`@wordpress/no-unused-vars-before-return`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) to exempt React hooks usage, by convention of hooks beginning with "use" prefix. +- The recommended `react` configuration specifies an option to [`@wordpress/no-unused-vars-before-return`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) to exempt React hooks usage, by convention of hooks beginning with "use" prefix. - The plugin now uses [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc), rather than the `valid-jsdoc` rule, for more reliable linting of JSDoc blocks. ## 2.3.0 (2019-06-12) @@ -196,7 +196,7 @@ ### New Features -- New Rule: [`@wordpress/react-no-unsafe-timeout`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/react-no-unsafe-timeout.md) +- New Rule: [`@wordpress/react-no-unsafe-timeout`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/react-no-unsafe-timeout.md) - Add [React Hooks Rules](https://reactjs.org/docs/hooks-rules.html) config. ## 2.1.0 (2019-03-20) @@ -215,11 +215,11 @@ ### New Features -- New Rule: [`@wordpress/no-unused-vars-before-return`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) -- New Rule: [`@wordpress/dependency-group`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/dependency-group.md) -- New Rule: [`@wordpress/valid-sprintf`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/valid-sprintf.md) -- New Rule: [`@wordpress/gutenberg-phase`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/gutenberg-phase.md) -- New Rule: [`@wordpress/no-base-control-with-label-without-id`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-base-control-with-label-without-id.md) +- New Rule: [`@wordpress/no-unused-vars-before-return`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) +- New Rule: [`@wordpress/dependency-group`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/dependency-group.md) +- New Rule: [`@wordpress/valid-sprintf`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/valid-sprintf.md) +- New Rule: [`@wordpress/gutenberg-phase`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/gutenberg-phase.md) +- New Rule: [`@wordpress/no-base-control-with-label-without-id`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/no-base-control-with-label-without-id.md) ## 1.0.0 (2018-12-12) diff --git a/packages/eslint-plugin/docs/rules/dependency-group.md b/packages/eslint-plugin/docs/rules/dependency-group.md index 02c1c4ccb95fe0..3c933330fddae9 100644 --- a/packages/eslint-plugin/docs/rules/dependency-group.md +++ b/packages/eslint-plugin/docs/rules/dependency-group.md @@ -1,6 +1,6 @@ # Enforce dependencies docblocks formatting (dependency-group) -Ensures that all top-level package imports adhere to the dependencies grouping conventions as outlined in the [Coding Guidelines](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/coding-guidelines.md#imports). +Ensures that all top-level package imports adhere to the dependencies grouping conventions as outlined in the [Coding Guidelines](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#imports). Specifically, this ensures that: diff --git a/packages/eslint-plugin/docs/rules/i18n-no-variables.md b/packages/eslint-plugin/docs/rules/i18n-no-variables.md index 3478f02acf755d..358e030c272ff9 100644 --- a/packages/eslint-plugin/docs/rules/i18n-no-variables.md +++ b/packages/eslint-plugin/docs/rules/i18n-no-variables.md @@ -1,6 +1,6 @@ # Enforce string literals as translation function arguments (i18n-no-variables) -[Translation functions](https://github.com/WordPress/gutenberg/blob/master/packages/i18n/README.md#api) must be called with valid string literals as arguments. +[Translation functions](https://github.com/WordPress/gutenberg/blob/HEAD/packages/i18n/README.md#api) must be called with valid string literals as arguments. They cannot be variables or functions due to the way these strings are extracted through static analysis of the code. The exception to this rule is string concatenation within the argument itself. diff --git a/packages/eslint-plugin/docs/rules/i18n-text-domain.md b/packages/eslint-plugin/docs/rules/i18n-text-domain.md index 7a637fc43aaeb1..de02782d3af284 100644 --- a/packages/eslint-plugin/docs/rules/i18n-text-domain.md +++ b/packages/eslint-plugin/docs/rules/i18n-text-domain.md @@ -1,6 +1,6 @@ # Enforce passing valid text domains (i18n-text-domain) -[Translation functions](https://github.com/WordPress/gutenberg/blob/master/packages/i18n/README.md#api) must be called with a valid string literal as the text domain. +[Translation functions](https://github.com/WordPress/gutenberg/blob/HEAD/packages/i18n/README.md#api) must be called with a valid string literal as the text domain. ## Rule details diff --git a/packages/eslint-plugin/docs/rules/i18n-translator-comments.md b/packages/eslint-plugin/docs/rules/i18n-translator-comments.md index 59a9453e46ec01..08176521b0ac56 100644 --- a/packages/eslint-plugin/docs/rules/i18n-translator-comments.md +++ b/packages/eslint-plugin/docs/rules/i18n-translator-comments.md @@ -1,6 +1,6 @@ # Enforce adding translator comments (i18n-translator-comments) -If using [translation functions](https://github.com/WordPress/gutenberg/blob/master/packages/i18n/README.md#api) with placeholders in them, +If using [translation functions](https://github.com/WordPress/gutenberg/blob/HEAD/packages/i18n/README.md#api) with placeholders in them, they need accompanying translator comments. ## Rule details diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-wp-apis.md b/packages/eslint-plugin/docs/rules/no-unsafe-wp-apis.md index 59213648efcab5..0eaf5abf576395 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-wp-apis.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-wp-apis.md @@ -3,7 +3,7 @@ Prevent unsafe APIs from `@wordpress/*` packages from being imported. This includes experimental and unstable APIs which are expected to change and likely to cause issues in application code. -See the [documentation](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/coding-guidelines.md#experimental-and-unstable-apis). +See the [documentation](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#experimental-and-unstable-apis). > **There is no support commitment for experimental and unstable APIs.** They can and will be removed or changed without advance warning, including as part of a minor or patch release. As an external consumer, you should avoid these APIs. > … diff --git a/packages/eslint-plugin/docs/rules/valid-sprintf.md b/packages/eslint-plugin/docs/rules/valid-sprintf.md index 0ff0ccd67431f5..85bd09ad1acf73 100644 --- a/packages/eslint-plugin/docs/rules/valid-sprintf.md +++ b/packages/eslint-plugin/docs/rules/valid-sprintf.md @@ -1,6 +1,6 @@ # Enforce valid sprintf usage (valid-sprintf) -[`sprintf`](https://github.com/WordPress/gutenberg/blob/master/packages/i18n/README.md#api) must be called with a valid format string with at least one placeholder, and with a valid set of placeholder substitute values. +[`sprintf`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/i18n/README.md#api) must be called with a valid format string with at least one placeholder, and with a valid set of placeholder substitute values. ## Rule details diff --git a/packages/eslint-plugin/rules/dependency-group.js b/packages/eslint-plugin/rules/dependency-group.js index 52380418ac520c..8782ee0d5eeb02 100644 --- a/packages/eslint-plugin/rules/dependency-group.js +++ b/packages/eslint-plugin/rules/dependency-group.js @@ -8,7 +8,7 @@ module.exports = { docs: { description: 'Enforce dependencies docblocks formatting', url: - 'https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/dependency-group.md', + 'https://github.com/WordPress/gutenberg/blob/HEAD/packages/eslint-plugin/docs/rules/dependency-group.md', }, schema: [], fixable: 'code', diff --git a/packages/interface/src/store/index.js b/packages/interface/src/store/index.js index 6d0337997ae930..776f618a7b2d94 100644 --- a/packages/interface/src/store/index.js +++ b/packages/interface/src/store/index.js @@ -14,7 +14,7 @@ import { STORE_NAME } from './constants'; /** * Store definition for the interface namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/jest-puppeteer-axe/README.md b/packages/jest-puppeteer-axe/README.md index 309bfae9b798c3..74de4b04a2d817 100644 --- a/packages/jest-puppeteer-axe/README.md +++ b/packages/jest-puppeteer-axe/README.md @@ -43,9 +43,9 @@ It is also possible to pass optional params which allow Axe API to perform custo - `include` - CSS selector(s) to to add the list of elements to include in analysis. - `exclude` - CSS selector(s) to to add the list of elements to exclude from analysis. -- `disabledRules` - the list of [Axe rules](https://github.com/dequelabs/axe-core/blob/master/doc/rule-descriptions.md) to skip from verification. -- `options` - a flexible way to configure how Axe run operates. See [axe-core API documentation](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter) for information on the object structure. -- `config` - Axe configuration object. See [axe-core API documentation](https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure) for documentation on the object structure. +- `disabledRules` - the list of [Axe rules](https://github.com/dequelabs/axe-core/blob/HEAD/doc/rule-descriptions.md) to skip from verification. +- `options` - a flexible way to configure how Axe run operates. See [axe-core API documentation](https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#options-parameter) for information on the object structure. +- `config` - Axe configuration object. See [axe-core API documentation](https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#api-name-axeconfigure) for documentation on the object structure. ```js test( 'checks the test component with Axe excluding some button', async () => { diff --git a/packages/jest-puppeteer-axe/src/index.js b/packages/jest-puppeteer-axe/src/index.js index 587de4f8a142f2..16e571b9d1abb5 100644 --- a/packages/jest-puppeteer-axe/src/index.js +++ b/packages/jest-puppeteer-axe/src/index.js @@ -70,9 +70,9 @@ function formatViolations( violations ) { * to exclude from analysis. * @param {?Array} params.disabledRules The list of Axe rules to skip from verification. * @param {?RunOptions} params.options A flexible way to configure how Axe run operates, - * see https://github.com/dequelabs/axe-core/blob/master/doc/API.md#options-parameter. + * see https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#options-parameter. * @param {?Spec} params.config Axe configuration object, - * see https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure. + * see https://github.com/dequelabs/axe-core/blob/HEAD/doc/API.md#api-name-axeconfigure. * * @return {Object} A matcher object with two keys `pass` and `message`. */ diff --git a/packages/keyboard-shortcuts/README.md b/packages/keyboard-shortcuts/README.md index 27d7432447bd12..3a060fdf23af6c 100644 --- a/packages/keyboard-shortcuts/README.md +++ b/packages/keyboard-shortcuts/README.md @@ -22,7 +22,7 @@ Store definition for the keyboard shortcuts namespace. _Related_ -- +- _Type_ diff --git a/packages/keyboard-shortcuts/src/store/index.js b/packages/keyboard-shortcuts/src/store/index.js index 0f40e3f4d74829..350563df1d608a 100644 --- a/packages/keyboard-shortcuts/src/store/index.js +++ b/packages/keyboard-shortcuts/src/store/index.js @@ -15,7 +15,7 @@ const STORE_NAME = 'core/keyboard-shortcuts'; /** * Store definition for the keyboard shortcuts namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/media-utils/README.md b/packages/media-utils/README.md index 489214c5446765..99a8b9eb5000e0 100644 --- a/packages/media-utils/README.md +++ b/packages/media-utils/README.md @@ -42,4 +42,4 @@ Beware that first onFileChange is called with temporary blob URLs and then with ### MediaUpload Media upload component provides a UI button that allows users to open the WordPress media library. It is normally used in conjunction with the filter `editor.MediaUpload`. -The component follows the interface specified in https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/media-upload/README.md, and more details regarding its usage can be checked there. +The component follows the interface specified in https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md, and more details regarding its usage can be checked there. diff --git a/packages/notices/src/store/index.js b/packages/notices/src/store/index.js index 12b5b3a66e7965..49fa74e0eca6bc 100644 --- a/packages/notices/src/store/index.js +++ b/packages/notices/src/store/index.js @@ -13,7 +13,7 @@ import * as selectors from './selectors'; /** * Store definition for the notices namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/nux/src/store/index.js b/packages/nux/src/store/index.js index ccd79e59ec1e16..39fef6c78c7911 100644 --- a/packages/nux/src/store/index.js +++ b/packages/nux/src/store/index.js @@ -15,7 +15,7 @@ const STORE_NAME = 'core/nux'; /** * Store definition for the nux namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/project-management-automation/lib/tasks/add-milestone/README.md b/packages/project-management-automation/lib/tasks/add-milestone/README.md index 0865313203843b..8980f054f25a19 100644 --- a/packages/project-management-automation/lib/tasks/add-milestone/README.md +++ b/packages/project-management-automation/lib/tasks/add-milestone/README.md @@ -9,4 +9,4 @@ Creates the milestone if it does not yet exist. If a pull request is merged, it can be difficult to know which upcoming or past plugin version that change would be included within. This is useful for debugging if a change should be expected to be available for testing, and to know if a change should be anticipated to be released within an upcoming release of the plugin. -It is also used in automation associated with [release changelogs](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/release.md#writing-the-release-post-and-changelog), which aggregate pull requests based on the assigned milestone. +It is also used in automation associated with [release changelogs](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/release.md#writing-the-release-post-and-changelog), which aggregate pull requests based on the assigned milestone. diff --git a/packages/react-native-editor/README.md b/packages/react-native-editor/README.md index a11278e0f1deca..f51b28b524592c 100644 --- a/packages/react-native-editor/README.md +++ b/packages/react-native-editor/README.md @@ -109,14 +109,14 @@ Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "R ## Writing and Running Unit Tests -This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/WordPress/gutenberg/blob/master/packages/react-native-editor/src/test/api-fetch-setup.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html). +This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/WordPress/gutenberg/blob/HEAD/packages/react-native-editor/src/test/api-fetch-setup.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html). ## UI Tests This repository uses Appium to run UI tests. The tests live in `__device-tests__` and are written using Appium to run tests against simulators and real devices. To run these you'll need to check off a few things: * When running the tests, you'll need to ensure the Metro bundler (`npm run native start`) is not running. -* [Appium CLI](https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md) installed and available globally. We also recommend using [appium-doctor](https://github.com/appium/appium-doctor) to ensure all of Appium's dependencies are good to go. You don't have to worry about starting the server yourself, the tests handle starting the server on port 4723, just be sure that the port is free or feel free to change the port number in the test file. +* [Appium CLI](https://github.com/appium/appium/blob/HEAD/docs/en/about-appium/getting-started.md) installed and available globally. We also recommend using [appium-doctor](https://github.com/appium/appium-doctor) to ensure all of Appium's dependencies are good to go. You don't have to worry about starting the server yourself, the tests handle starting the server on port 4723, just be sure that the port is free or feel free to change the port number in the test file. * For iOS a simulator should automatically launch but for Android you'll need to have an emulator *with at least platform version 8.0* fired up and running. Then, to run the UI tests on iOS: diff --git a/packages/react-native-editor/__device-tests__/README.md b/packages/react-native-editor/__device-tests__/README.md index 030f2947dc744a..24e81f24e83a36 100644 --- a/packages/react-native-editor/__device-tests__/README.md +++ b/packages/react-native-editor/__device-tests__/README.md @@ -67,4 +67,4 @@ After the build is complete, an appium server is fired up on port 4723 and the d ----- -To read more about writing your own tests please read the [contributing guide](https://github.com/WordPress/gutenberg/blob/master/packages/react-native-editor/__device-tests__/CONTRIBUTING.md) +To read more about writing your own tests please read the [contributing guide](https://github.com/WordPress/gutenberg/blob/HEAD/packages/react-native-editor/__device-tests__/CONTRIBUTING.md) diff --git a/packages/reusable-blocks/src/store/index.js b/packages/reusable-blocks/src/store/index.js index 46a38b67f8b8f7..55de632a9edd1d 100644 --- a/packages/reusable-blocks/src/store/index.js +++ b/packages/reusable-blocks/src/store/index.js @@ -16,7 +16,7 @@ const STORE_NAME = 'core/reusable-blocks'; /** * Store definition for the reusable blocks namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/rich-text/README.md b/packages/rich-text/README.md index 766eb4566de490..effb098201fd56 100644 --- a/packages/rich-text/README.md +++ b/packages/rich-text/README.md @@ -308,7 +308,7 @@ Store definition for the rich-text namespace. _Related_ -- +- _Type_ diff --git a/packages/rich-text/src/store/index.js b/packages/rich-text/src/store/index.js index 02b320b2a43b07..67382d1152bced 100644 --- a/packages/rich-text/src/store/index.js +++ b/packages/rich-text/src/store/index.js @@ -15,7 +15,7 @@ const STORE_NAME = 'core/rich-text'; /** * Store definition for the rich-text namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/packages/scripts/README.md b/packages/scripts/README.md index 0dae85bc03ba76..f846cce6384171 100644 --- a/packages/scripts/README.md +++ b/packages/scripts/README.md @@ -48,9 +48,9 @@ It might also be a good idea to get familiar with the [JavaScript Build Setup tu ## Updating to New Release -To update an existing project to a new version of `@wordpress/scripts`, open the [changelog](https://github.com/WordPress/gutenberg/blob/master/packages/scripts/CHANGELOG.md), find the version you’re currently on (check `package.json` in the top-level directory of your project), and apply the migration instructions for the newer versions. +To update an existing project to a new version of `@wordpress/scripts`, open the [changelog](https://github.com/WordPress/gutenberg/blob/HEAD/packages/scripts/CHANGELOG.md), find the version you’re currently on (check `package.json` in the top-level directory of your project), and apply the migration instructions for the newer versions. -In most cases bumping the `@wordpress/scripts` version in `package.json` and running `npm install` in the root folder of your project should be enough, but it’s good to check the [changelog](https://github.com/WordPress/gutenberg/blob/master/packages/scripts/CHANGELOG.md) for potential breaking changes. There is also `packages-update` script included in this package that aims to automate the process of updating WordPress dependencies in your projects. +In most cases bumping the `@wordpress/scripts` version in `package.json` and running `npm install` in the root folder of your project should be enough, but it’s good to check the [changelog](https://github.com/WordPress/gutenberg/blob/HEAD/packages/scripts/CHANGELOG.md) for potential breaking changes. There is also `packages-update` script included in this package that aims to automate the process of updating WordPress dependencies in your projects. We commit to keeping the breaking changes minimal so you can upgrade `@wordpress/scripts` as seamless as possible. @@ -230,7 +230,7 @@ By default, files located in `build`, `node_modules`, and `vendor` folders are i #### Advanced information -It uses [markdownlint](https://github.com/DavidAnson/markdownlint) with the [.markdownlint.json](https://github.com/WordPress/gutenberg/blob/master/packages/scripts/config/.markdownlint.json) configuration. This configuration tunes the linting rules to match WordPress standard, you can override with your own config, see [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli/) for command-line parameters. +It uses [markdownlint](https://github.com/DavidAnson/markdownlint) with the [.markdownlint.json](https://github.com/WordPress/gutenberg/blob/HEAD/packages/scripts/config/.markdownlint.json) configuration. This configuration tunes the linting rules to match WordPress standard, you can override with your own config, see [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli/) for command-line parameters. ### `lint-md-js` @@ -254,7 +254,7 @@ By default, files located in `build`, `node_modules`, and `vendor` folders are i #### Advanced information -It uses [eslint-plugin-markdown](https://github.com/eslint/eslint-plugin-markdown) with the [.eslintrc-md.js](https://github.com/WordPress/gutenberg/blob/master/packages/scripts/config/.eslintrc-md.js) configuration. This configuration tunes down the linting rules since documentation often includes just snippets of code. It is recommended to use the markdown linting as a check, but not necessarily a blocker since it might report more false errors. +It uses [eslint-plugin-markdown](https://github.com/eslint/eslint-plugin-markdown) with the [.eslintrc-md.js](https://github.com/WordPress/gutenberg/blob/HEAD/packages/scripts/config/.eslintrc-md.js) configuration. This configuration tunes down the linting rules since documentation often includes just snippets of code. It is recommended to use the markdown linting as a check, but not necessarily a blocker since it might report more false errors. ### `lint-style` @@ -335,7 +335,7 @@ This script uses [webpack](https://webpack.js.org/) behind the scenes. It’ll l ### `test-e2e` -Launches the End-To-End (E2E) test runner. Writing tests can be done using the [Jest API](https://jestjs.io/docs/en/api) in combination with the [Puppeteer API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md): +Launches the End-To-End (E2E) test runner. Writing tests can be done using the [Jest API](https://jestjs.io/docs/en/api) in combination with the [Puppeteer API](https://github.com/GoogleChrome/puppeteer/blob/HEAD/docs/api.md): > [Jest](https://jestjs.io/) is a delightful JavaScript Testing Framework with a focus on simplicity. @@ -608,6 +608,6 @@ module.exports = { }; ``` -If you follow this approach, please, be aware that future versions of this package may change what webpack and Babel plugins we bundle, default configs, etc. Should those changes be necessary, they will be registered in the [package’s CHANGELOG](https://github.com/WordPress/gutenberg/blob/master/packages/scripts/CHANGELOG.md), so make sure to read it before upgrading. +If you follow this approach, please, be aware that future versions of this package may change what webpack and Babel plugins we bundle, default configs, etc. Should those changes be necessary, they will be registered in the [package’s CHANGELOG](https://github.com/WordPress/gutenberg/blob/HEAD/packages/scripts/CHANGELOG.md), so make sure to read it before upgrading.

      Code is Poetry.

      diff --git a/packages/scripts/scripts/lint-style.js b/packages/scripts/scripts/lint-style.js index 43bbfaa6e5524f..f9b28fc765e2a2 100644 --- a/packages/scripts/scripts/lint-style.js +++ b/packages/scripts/scripts/lint-style.js @@ -35,7 +35,7 @@ const defaultConfigArgs = ! hasLintConfig ? [ '--config', fromConfigRoot( '.stylelintrc.json' ) ] : []; -// See: https://github.com/stylelint/stylelint/blob/master/docs/user-guide/configuration.md#stylelintignore. +// See: https://github.com/stylelint/stylelint/blob/HEAD/docs/user-guide/ignore-code.md#files-entirely. const hasIgnoredFiles = hasArgInCLI( '--ignore-path' ) || hasProjectFile( '.stylelintignore' ); diff --git a/packages/stylelint-config/CHANGELOG.md b/packages/stylelint-config/CHANGELOG.md index 2f277363420456..ecaca1d485dd13 100644 --- a/packages/stylelint-config/CHANGELOG.md +++ b/packages/stylelint-config/CHANGELOG.md @@ -71,7 +71,7 @@ ## 12.0.0 (2017-07-18) -- Changed: `stylelint-config-wordpress` now extends [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended), which turns on the `at-rule-no-unknown`, `block-no-empty`, `comment-no-empty`, `declaration-block-no-ignored-properties`, `declaration-block-no-redundant-longhand-properties`, `font-family-no-duplicate-names`, `media-feature-name-no-unknown`, `no-empty-source` rule. These rules are part of stylelint's [possible errors](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/rules.md#possible-errors) rules. +- Changed: `stylelint-config-wordpress` now extends [`stylelint-config-recommended`](https://github.com/stylelint/stylelint-config-recommended), which turns on the `at-rule-no-unknown`, `block-no-empty`, `comment-no-empty`, `declaration-block-no-ignored-properties`, `declaration-block-no-redundant-longhand-properties`, `font-family-no-duplicate-names`, `media-feature-name-no-unknown`, `no-empty-source` rule. These rules are part of stylelint's [possible errors](https://github.com/stylelint/stylelint/blob/HEAD/docs/user-guide/rules/list.md#possible-errors) rules. - Removed: `stylelint-scss < 1.5.1` compatibility. - Removed: Removed style guide docs. - Removed: `at-rule-no-unknown` custom `ignoreAtRules` options in `stylelint-config-wordpress/scss` shared config. diff --git a/packages/viewport/README.md b/packages/viewport/README.md index 9c4c226c9ab62d..6c15ad6aa15709 100644 --- a/packages/viewport/README.md +++ b/packages/viewport/README.md @@ -88,7 +88,7 @@ Store definition for the viewport namespace. _Related_ -- +- _Type_ diff --git a/packages/viewport/src/store/index.js b/packages/viewport/src/store/index.js index 29f39dbccc1c16..e8fec728c2801b 100644 --- a/packages/viewport/src/store/index.js +++ b/packages/viewport/src/store/index.js @@ -15,7 +15,7 @@ const STORE_NAME = 'core/viewport'; /** * Store definition for the viewport namespace. * - * @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore + * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ diff --git a/test/native/jest.config.js b/test/native/jest.config.js index 6a314a259aba9e..97b63a035ddf5f 100644 --- a/test/native/jest.config.js +++ b/test/native/jest.config.js @@ -63,7 +63,7 @@ module.exports = { // This is required for now to have jest transform some of our modules // 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/master/jest-preset.json#L20 + // https://github.com/facebook/react-native/blob/HEAD/jest-preset.json#L20 'node_modules/(?!(simple-html-tokenizer|(jest-)?react-native|react-clone-referenced-element))', ], snapshotSerializers: [ 'enzyme-to-json/serializer', 'jest-emotion' ], diff --git a/test/native/setup.js b/test/native/setup.js index d6125cc22fe688..5a691f2698b9d2 100644 --- a/test/native/setup.js +++ b/test/native/setup.js @@ -107,7 +107,7 @@ jest.mock( '@react-native-community/blur', () => () => 'BlurView', { } ); // Overwrite some native module mocks from `react-native` jest preset: -// https://github.com/facebook/react-native/blob/master/jest/setup.js +// https://github.com/facebook/react-native/blob/HEAD/jest/setup.js // to fix issue "TypeError: Cannot read property 'Commands' of undefined" // raised when calling focus or blur on a native component const mockNativeModules = { From 8ff0c0adc90b544b6200496e5046c23b8039036f Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Wed, 20 Jan 2021 09:50:47 +0200 Subject: [PATCH 26/61] FSE: Parse the template before gets rendered (#28319) * Parse the template before head gets rendered * add phpcs-ignore --- lib/full-site-editing/template-loader.php | 18 +++++++++++------- lib/template-canvas.php | 7 ++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/full-site-editing/template-loader.php b/lib/full-site-editing/template-loader.php index 1ffdec27a3040a..e0047b81c21f1c 100644 --- a/lib/full-site-editing/template-loader.php +++ b/lib/full-site-editing/template-loader.php @@ -154,15 +154,14 @@ function gutenberg_render_title_tag() { } /** - * Renders the markup for the current template. + * Returns the markup for the current template. */ -function gutenberg_render_the_template() { +function gutenberg_get_the_template_html() { global $_wp_current_template_content; global $wp_embed; if ( ! $_wp_current_template_content ) { - echo '

      ' . esc_html__( 'No matching template found', 'gutenberg' ) . '

      '; - return; + return '

      ' . esc_html__( 'No matching template found', 'gutenberg' ) . '

      '; } $content = $wp_embed->run_shortcode( $_wp_current_template_content ); @@ -178,9 +177,14 @@ function gutenberg_render_the_template() { // Wrap block template in .wp-site-blocks to allow for specific descendant styles // (e.g. `.wp-site-blocks > *`). - echo '
      '; - echo $content; // phpcs:ignore WordPress.Security.EscapeOutput - echo '
      '; + return '
      ' . $content . '
      '; +} + +/** + * Renders the markup for the current template. + */ +function gutenberg_render_the_template() { + echo gutenberg_get_the_template_html(); // phpcs:ignore WordPress.Security.EscapeOutput } /** diff --git a/lib/template-canvas.php b/lib/template-canvas.php index a0e0da7ea01752..4d29113dbf8e04 100644 --- a/lib/template-canvas.php +++ b/lib/template-canvas.php @@ -5,6 +5,11 @@ * @package gutenberg */ +/** + * Get the template HTML. + * This needs to run before so that blocks can add scripts and styles in wp_head(). + */ +$template_html = gutenberg_get_the_template_html(); ?> > @@ -16,7 +21,7 @@ > - + From e40a88cba8db618b5a479a6919c976d2f05e5371 Mon Sep 17 00:00:00 2001 From: Ari Stathopoulos Date: Wed, 20 Jan 2021 10:20:00 +0200 Subject: [PATCH 27/61] CS: Fix PHPCS warnings (#28343) --- lib/client-assets.php | 2 +- ...class-wp-rest-template-controller-test.php | 4 +- phpunit/class-wp-theme-json-test.php | 68 +++++++++---------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/client-assets.php b/lib/client-assets.php index 454b11c0ed1387..10613bb46726cf 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -695,7 +695,7 @@ function gutenberg_extend_block_editor_styles_html() { $block_registry = WP_Block_Type_Registry::get_instance(); - foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) { + foreach ( $block_registry->get_all_registered() as $block_type ) { if ( ! empty( $block_type->style ) ) { $handles[] = $block_type->style; } diff --git a/phpunit/class-wp-rest-template-controller-test.php b/phpunit/class-wp-rest-template-controller-test.php index 9cbc07392db41c..f7d8ffd182c74f 100644 --- a/phpunit/class-wp-rest-template-controller-test.php +++ b/phpunit/class-wp-rest-template-controller-test.php @@ -107,7 +107,7 @@ public function test_get_item() { public function test_create_item() { wp_set_current_user( self::$admin_id ); - $request = new WP_REST_Request( 'POST', '/wp/v2/templates' ); + $request = new WP_REST_Request( 'POST', '/wp/v2/templates' ); $request->set_body_params( array( 'slug' => 'my_custom_template', @@ -144,7 +144,7 @@ public function test_create_item() { public function test_update_item() { wp_set_current_user( self::$admin_id ); - $request = new WP_REST_Request( 'PUT', '/wp/v2/templates/tt1-blocks//index' ); + $request = new WP_REST_Request( 'PUT', '/wp/v2/templates/tt1-blocks//index' ); $request->set_body_params( array( 'title' => 'My new Index Title', diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index 6cdbfacfcdb62c..057f340cfca7cd 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -415,7 +415,7 @@ public function test_merge_incoming_data() { function test_remove_insecure_properties_removes_invalid_contexts() { $theme_json = new WP_Theme_JSON( array( - 'global' => array( + 'global' => array( 'styles' => array( 'color' => array( 'background' => 'green', @@ -453,13 +453,13 @@ function test_remove_insecure_properties_removes_invalid_properties() { $theme_json = new WP_Theme_JSON( array( 'global' => array( - 'styles' => array( + 'styles' => array( 'color' => array( 'gradient' => 'linear-gradient(55deg,rgba(6,147,227,1) 0%,rgb(84,177,218) 54%,rgb(155,81,224) 100%)', - 'text' => 'var:preset|color|dark-gray', + 'text' => 'var:preset|color|dark-gray', ), ), - 'invalid' => array( + 'invalid' => array( 'background' => 'green', ), ), @@ -473,7 +473,7 @@ function test_remove_insecure_properties_removes_invalid_properties() { 'styles' => array( 'color' => array( 'gradient' => 'linear-gradient(55deg,rgba(6,147,227,1) 0%,rgb(84,177,218) 54%,rgb(155,81,224) 100%)', - 'text' => 'var:preset|color|dark-gray', + 'text' => 'var:preset|color|dark-gray', ), ), ), @@ -485,13 +485,13 @@ function test_remove_insecure_properties_removes_unsafe_properties() { $theme_json = new WP_Theme_JSON( array( 'global' => array( - 'styles' => array( + 'styles' => array( 'color' => array( 'gradient' => 'url(\'data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMCcgaGVpZ2h0PScxMCc+PHNjcmlwdD5hbGVydCgnb2snKTwvc2NyaXB0PjxsaW5lYXJHcmFkaWVudCBpZD0nZ3JhZGllbnQnPjxzdG9wIG9mZnNldD0nMTAlJyBzdG9wLWNvbG9yPScjRjAwJy8+PHN0b3Agb2Zmc2V0PSc5MCUnIHN0b3AtY29sb3I9JyNmY2MnLz4gPC9saW5lYXJHcmFkaWVudD48cmVjdCBmaWxsPSd1cmwoI2dyYWRpZW50KScgeD0nMCcgeT0nMCcgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScvPjwvc3ZnPg==\')', - 'text' => 'var:preset|color|dark-gray', + 'text' => 'var:preset|color|dark-gray', ), ), - 'invalid' => array( + 'invalid' => array( 'background' => 'green', ), ), @@ -504,7 +504,7 @@ function test_remove_insecure_properties_removes_unsafe_properties() { 'global' => array( 'styles' => array( 'color' => array( - 'text' => 'var:preset|color|dark-gray', + 'text' => 'var:preset|color|dark-gray', ), ), ), @@ -515,21 +515,21 @@ function test_remove_insecure_properties_removes_unsafe_properties() { function test_remove_insecure_properties_removes_properties_when_not_allowed_in_a_context() { $theme_json = new WP_Theme_JSON( array( - 'global' => array( - 'styles' => array( - 'color' => array( - 'text' => 'var:preset|color|dark-gray', + 'global' => array( + 'styles' => array( + 'color' => array( + 'text' => 'var:preset|color|dark-gray', ), 'spacing' => array( 'padding' => array( - 'top' => '1px', - 'right' => '1px', + 'top' => '1px', + 'right' => '1px', 'bottom' => '1px', - 'left' => '1px', + 'left' => '1px', ), ), ), - 'invalid' => array( + 'invalid' => array( 'background' => 'green', ), ), @@ -537,10 +537,10 @@ function test_remove_insecure_properties_removes_properties_when_not_allowed_in_ 'styles' => array( 'spacing' => array( 'padding' => array( - 'top' => '1px', - 'right' => '1px', + 'top' => '1px', + 'right' => '1px', 'bottom' => '1px', - 'left' => '1px', + 'left' => '1px', ), ), ), @@ -551,10 +551,10 @@ function test_remove_insecure_properties_removes_properties_when_not_allowed_in_ $theme_json->remove_insecure_properties(); $result = $theme_json->get_raw_data(); $expected = array( - 'global' => array( + 'global' => array( 'styles' => array( 'color' => array( - 'text' => 'var:preset|color|dark-gray', + 'text' => 'var:preset|color|dark-gray', ), ), ), @@ -562,10 +562,10 @@ function test_remove_insecure_properties_removes_properties_when_not_allowed_in_ 'styles' => array( 'spacing' => array( 'padding' => array( - 'top' => '1px', - 'right' => '1px', + 'top' => '1px', + 'right' => '1px', 'bottom' => '1px', - 'left' => '1px', + 'left' => '1px', ), ), ), @@ -581,10 +581,10 @@ function test_remove_insecure_properties_removes_unsafe_sub_properties() { 'styles' => array( 'spacing' => array( 'padding' => array( - 'top' => '1px', - 'right' => '1px', + 'top' => '1px', + 'right' => '1px', 'bottom' => 'var(--unsafe-var-y)', - 'left' => '1px', + 'left' => '1px', ), ), ), @@ -599,9 +599,9 @@ function test_remove_insecure_properties_removes_unsafe_sub_properties() { 'styles' => array( 'spacing' => array( 'padding' => array( - 'top' => '1px', + 'top' => '1px', 'right' => '1px', - 'left' => '1px', + 'left' => '1px', ), ), ), @@ -615,8 +615,8 @@ function test_remove_insecure_properties_removes_non_preset_settings() { array( 'global' => array( 'settings' => array( - 'color' => array( - 'custom' => true, + 'color' => array( + 'custom' => true, 'palette' => array( array( 'name' => 'Red', @@ -678,7 +678,7 @@ function test_remove_insecure_properties_removes_unsafe_preset_settings() { array( 'global' => array( 'settings' => array( - 'color' => array( + 'color' => array( 'palette' => array( array( 'name' => 'Red/>ok', @@ -736,7 +736,7 @@ function test_remove_insecure_properties_removes_unsafe_preset_settings() { $expected = array( 'global' => array( 'settings' => array( - 'color' => array( + 'color' => array( 'palette' => array( array( 'name' => 'Pink', From 1c59a2ca9e1130014ca038c63b1fbd0b056d7f11 Mon Sep 17 00:00:00 2001 From: Nik Tsekouras Date: Wed, 20 Jan 2021 11:10:27 +0200 Subject: [PATCH 28/61] Query pagination with InnerBlocks (#28125) * Add query pagination blocks * create fixtures * fix css var name * add new icons * use allowedFormats instead of formattingControls --- lib/blocks.php | 75 +++++++++--------- lib/load.php | 1 + lib/query-utils.php | 67 ++++++++++++++++ packages/block-library/src/editor.scss | 2 + packages/block-library/src/index.js | 6 ++ .../block-library/src/query-loop/index.php | 53 +------------ .../src/query-pagination-next/block.json | 24 ++++++ .../src/query-pagination-next/edit.js | 30 ++++++++ .../src/query-pagination-next/index.js | 22 ++++++ .../src/query-pagination-next/index.php | 67 ++++++++++++++++ .../src/query-pagination-numbers/block.json | 14 ++++ .../src/query-pagination-numbers/edit.js | 25 ++++++ .../src/query-pagination-numbers/editor.scss | 12 +++ .../src/query-pagination-numbers/index.js | 22 ++++++ .../src/query-pagination-numbers/index.php | 76 +++++++++++++++++++ .../src/query-pagination-previous/block.json | 24 ++++++ .../src/query-pagination-previous/edit.js | 30 ++++++++ .../src/query-pagination-previous/index.js | 22 ++++++ .../src/query-pagination-previous/index.php | 56 ++++++++++++++ .../src/query-pagination/block.json | 4 +- .../src/query-pagination/edit.js | 71 ++++++----------- .../src/query-pagination/editor.scss | 41 ++++++++++ .../src/query-pagination/index.js | 10 ++- .../src/query-pagination/index.php | 36 +-------- .../src/query-pagination/save.js | 12 +++ .../src/query-pagination/style.scss | 21 +++++ packages/block-library/src/query/block.json | 2 +- .../src/query/edit/query-toolbar.js | 29 +++++-- packages/block-library/src/style.scss | 1 + .../blocks/core__query-pagination-next.html | 1 + .../blocks/core__query-pagination-next.json | 10 +++ .../core__query-pagination-next.parsed.json | 18 +++++ ...ore__query-pagination-next.serialized.html | 1 + .../core__query-pagination-numbers.html | 1 + .../core__query-pagination-numbers.json | 10 +++ ...core__query-pagination-numbers.parsed.json | 18 +++++ ...__query-pagination-numbers.serialized.html | 1 + .../core__query-pagination-previous.html | 1 + .../core__query-pagination-previous.json | 10 +++ ...ore__query-pagination-previous.parsed.json | 18 +++++ ..._query-pagination-previous.serialized.html | 1 + .../blocks/core__query-pagination.html | 4 +- .../blocks/core__query-pagination.json | 2 +- .../blocks/core__query-pagination.parsed.json | 6 +- .../core__query-pagination.serialized.html | 4 +- .../fixtures/blocks/core__query.json | 2 +- packages/icons/src/index.js | 4 + .../src/library/query-pagination-next.js | 14 ++++ .../src/library/query-pagination-numbers.js | 17 +++++ .../src/library/query-pagination-previous.js | 30 ++++++++ .../icons/src/library/query-pagination.js | 14 ++++ 51 files changed, 856 insertions(+), 186 deletions(-) create mode 100644 lib/query-utils.php create mode 100644 packages/block-library/src/query-pagination-next/block.json create mode 100644 packages/block-library/src/query-pagination-next/edit.js create mode 100644 packages/block-library/src/query-pagination-next/index.js create mode 100644 packages/block-library/src/query-pagination-next/index.php create mode 100644 packages/block-library/src/query-pagination-numbers/block.json create mode 100644 packages/block-library/src/query-pagination-numbers/edit.js create mode 100644 packages/block-library/src/query-pagination-numbers/editor.scss create mode 100644 packages/block-library/src/query-pagination-numbers/index.js create mode 100644 packages/block-library/src/query-pagination-numbers/index.php create mode 100644 packages/block-library/src/query-pagination-previous/block.json create mode 100644 packages/block-library/src/query-pagination-previous/edit.js create mode 100644 packages/block-library/src/query-pagination-previous/index.js create mode 100644 packages/block-library/src/query-pagination-previous/index.php create mode 100644 packages/block-library/src/query-pagination/editor.scss create mode 100644 packages/block-library/src/query-pagination/save.js create mode 100644 packages/block-library/src/query-pagination/style.scss create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-next.html create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-next.json create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-next.parsed.json create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-next.serialized.html create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.html create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.json create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.parsed.json create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.serialized.html create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.html create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.json create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.parsed.json create mode 100644 packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.serialized.html create mode 100644 packages/icons/src/library/query-pagination-next.js create mode 100644 packages/icons/src/library/query-pagination-numbers.js create mode 100644 packages/icons/src/library/query-pagination-previous.js create mode 100644 packages/icons/src/library/query-pagination.js diff --git a/lib/blocks.php b/lib/blocks.php index 4012e9784ca165..d1428770e3540e 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -49,42 +49,45 @@ function gutenberg_reregister_core_block_types() { ), 'block_names' => array_merge( array( - 'archives.php' => 'core/archives', - 'block.php' => 'core/block', - 'calendar.php' => 'core/calendar', - 'categories.php' => 'core/categories', - 'cover.php' => 'core/cover', - 'latest-comments.php' => 'core/latest-comments', - 'latest-posts.php' => 'core/latest-posts', - 'navigation.php' => 'core/navigation', - 'navigation-link.php' => 'core/navigation-link', - 'rss.php' => 'core/rss', - 'search.php' => 'core/search', - 'shortcode.php' => 'core/shortcode', - 'social-link.php' => 'core/social-link', - 'tag-cloud.php' => 'core/tag-cloud', - 'post-author.php' => 'core/post-author', - 'post-comment.php' => 'core/post-comment', - 'post-comment-author.php' => 'core/post-comment-author', - 'post-comment-content.php' => 'core/post-comment-content', - 'post-comment-date.php' => 'core/post-comment-date', - 'post-comments.php' => 'core/post-comments', - 'post-comments-count.php' => 'core/post-comments-count', - 'post-comments-form.php' => 'core/post-comments-form', - 'post-content.php' => 'core/post-content', - 'post-date.php' => 'core/post-date', - 'post-excerpt.php' => 'core/post-excerpt', - 'post-featured-image.php' => 'core/post-featured-image', - 'post-hierarchical-terms.php' => 'core/post-hierarchical-terms', - 'post-tags.php' => 'core/post-tags', - 'post-title.php' => 'core/post-title', - 'query.php' => 'core/query', - 'query-loop.php' => 'core/query-loop', - 'query-pagination.php' => 'core/query-pagination', - 'site-logo.php' => 'core/site-logo', - 'site-tagline.php' => 'core/site-tagline', - 'site-title.php' => 'core/site-title', - 'template-part.php' => 'core/template-part', + 'archives.php' => 'core/archives', + 'block.php' => 'core/block', + 'calendar.php' => 'core/calendar', + 'categories.php' => 'core/categories', + 'cover.php' => 'core/cover', + 'latest-comments.php' => 'core/latest-comments', + 'latest-posts.php' => 'core/latest-posts', + 'navigation.php' => 'core/navigation', + 'navigation-link.php' => 'core/navigation-link', + 'rss.php' => 'core/rss', + 'search.php' => 'core/search', + 'shortcode.php' => 'core/shortcode', + 'social-link.php' => 'core/social-link', + 'tag-cloud.php' => 'core/tag-cloud', + 'post-author.php' => 'core/post-author', + 'post-comment.php' => 'core/post-comment', + 'post-comment-author.php' => 'core/post-comment-author', + 'post-comment-content.php' => 'core/post-comment-content', + 'post-comment-date.php' => 'core/post-comment-date', + 'post-comments.php' => 'core/post-comments', + 'post-comments-count.php' => 'core/post-comments-count', + 'post-comments-form.php' => 'core/post-comments-form', + 'post-content.php' => 'core/post-content', + 'post-date.php' => 'core/post-date', + 'post-excerpt.php' => 'core/post-excerpt', + 'post-featured-image.php' => 'core/post-featured-image', + 'post-hierarchical-terms.php' => 'core/post-hierarchical-terms', + 'post-tags.php' => 'core/post-tags', + 'post-title.php' => 'core/post-title', + 'query.php' => 'core/query', + 'query-loop.php' => 'core/query-loop', + 'query-pagination.php' => 'core/query-pagination', + 'query-pagination-next.php' => 'core/query-pagination-next', + 'query-pagination-numbers.php' => 'core/query-pagination-numbers', + 'query-pagination-previous.php' => 'core/query-pagination-previous', + 'site-logo.php' => 'core/site-logo', + 'site-tagline.php' => 'core/site-tagline', + 'site-title.php' => 'core/site-title', + 'template-part.php' => 'core/template-part', ) ), ), diff --git a/lib/load.php b/lib/load.php index cff4bb2f49734a..1d53a8122b43d3 100644 --- a/lib/load.php +++ b/lib/load.php @@ -105,6 +105,7 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/class-wp-theme-json.php'; require __DIR__ . '/class-wp-theme-json-resolver.php'; require __DIR__ . '/global-styles.php'; +require __DIR__ . '/query-utils.php'; if ( ! class_exists( 'WP_Block_Supports' ) ) { require_once __DIR__ . '/class-wp-block-supports.php'; diff --git a/lib/query-utils.php b/lib/query-utils.php new file mode 100644 index 00000000000000..477772728ab6a2 --- /dev/null +++ b/lib/query-utils.php @@ -0,0 +1,67 @@ + 'post', + 'order' => 'DESC', + 'orderby' => 'date', + 'post__not_in' => array(), + ); + + if ( isset( $block->context['query'] ) ) { + if ( isset( $block->context['query']['postType'] ) ) { + $query['post_type'] = $block->context['query']['postType']; + } + if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) { + $sticky = get_option( 'sticky_posts' ); + if ( 'only' === $block->context['query']['sticky'] ) { + $query['post__in'] = $sticky; + } else { + $query['post__not_in'] = array_merge( $query['post__not_in'], $sticky ); + } + } + if ( isset( $block->context['query']['exclude'] ) ) { + $query['post__not_in'] = array_merge( $query['post__not_in'], $block->context['query']['exclude'] ); + } + if ( isset( $block->context['query']['perPage'] ) ) { + $query['offset'] = ( $block->context['query']['perPage'] * ( $page - 1 ) ) + $block->context['query']['offset']; + $query['posts_per_page'] = $block->context['query']['perPage']; + } + if ( isset( $block->context['query']['categoryIds'] ) ) { + $query['category__in'] = $block->context['query']['categoryIds']; + } + if ( isset( $block->context['query']['tagIds'] ) ) { + $query['tag__in'] = $block->context['query']['tagIds']; + } + if ( isset( $block->context['query']['order'] ) ) { + $query['order'] = strtoupper( $block->context['query']['order'] ); + } + if ( isset( $block->context['query']['orderBy'] ) ) { + $query['orderby'] = $block->context['query']['orderBy']; + } + if ( isset( $block->context['query']['author'] ) ) { + $query['author'] = $block->context['query']['author']; + } + if ( isset( $block->context['query']['search'] ) ) { + $query['s'] = $block->context['query']['search']; + } + } + return $query; +} diff --git a/packages/block-library/src/editor.scss b/packages/block-library/src/editor.scss index c9aee9f8c1be7a..45449c927bac0d 100644 --- a/packages/block-library/src/editor.scss +++ b/packages/block-library/src/editor.scss @@ -50,6 +50,8 @@ @import "./video/editor.scss"; @import "./query-loop/editor.scss"; @import "./query/editor.scss"; +@import "./query-pagination/editor.scss"; +@import "./query-pagination-numbers/editor.scss"; @import "./post-featured-image/editor.scss"; :root .editor-styles-wrapper { diff --git a/packages/block-library/src/index.js b/packages/block-library/src/index.js index 7cfcb0e0c74a9f..376757f2bfb876 100644 --- a/packages/block-library/src/index.js +++ b/packages/block-library/src/index.js @@ -69,6 +69,9 @@ import * as templatePart from './template-part'; import * as query from './query'; import * as queryLoop from './query-loop'; import * as queryPagination from './query-pagination'; +import * as queryPaginationNext from './query-pagination-next'; +import * as queryPaginationNumbers from './query-pagination-numbers'; +import * as queryPaginationPrevious from './query-pagination-previous'; import * as postTitle from './post-title'; import * as postContent from './post-content'; import * as postAuthor from './post-author'; @@ -215,6 +218,9 @@ export const __experimentalRegisterExperimentalCoreBlocks = query, queryLoop, queryPagination, + queryPaginationNext, + queryPaginationNumbers, + queryPaginationPrevious, postTitle, postContent, postAuthor, diff --git a/packages/block-library/src/query-loop/index.php b/packages/block-library/src/query-loop/index.php index f611e4fbd81d70..2326898bea28f1 100644 --- a/packages/block-library/src/query-loop/index.php +++ b/packages/block-library/src/query-loop/index.php @@ -18,64 +18,19 @@ function render_block_core_query_loop( $attributes, $content, $block ) { $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT ); - $query = array( - 'post_type' => 'post', - 'offset' => 0, - 'order' => 'DESC', - 'orderby' => 'date', - 'post__not_in' => array(), - ); - - if ( isset( $block->context['query'] ) ) { - if ( isset( $block->context['query']['postType'] ) ) { - $query['post_type'] = $block->context['query']['postType']; - } - if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) { - $sticky = get_option( 'sticky_posts' ); - if ( 'only' === $block->context['query']['sticky'] ) { - $query['post__in'] = $sticky; - } else { - $query['post__not_in'] = array_merge( $query['post__not_in'], $sticky ); - } - } - if ( isset( $block->context['query']['exclude'] ) ) { - $query['post__not_in'] = array_merge( $query['post__not_in'], $block->context['query']['exclude'] ); - } - if ( isset( $block->context['query']['perPage'] ) ) { - $query['offset'] = ( $block->context['query']['perPage'] * ( $page - 1 ) ) + $block->context['query']['offset']; - $query['posts_per_page'] = $block->context['query']['perPage']; - } - if ( isset( $block->context['query']['categoryIds'] ) ) { - $query['category__in'] = $block->context['query']['categoryIds']; - } - if ( isset( $block->context['query']['tagIds'] ) ) { - $query['tag__in'] = $block->context['query']['tagIds']; - } - if ( isset( $block->context['query']['order'] ) ) { - $query['order'] = strtoupper( $block->context['query']['order'] ); - } - if ( isset( $block->context['query']['orderBy'] ) ) { - $query['orderby'] = $block->context['query']['orderBy']; - } - if ( isset( $block->context['query']['author'] ) ) { - $query['author'] = $block->context['query']['author']; - } - if ( isset( $block->context['query']['search'] ) ) { - $query['s'] = $block->context['query']['search']; - } - } - + $query = construct_wp_query_args( $block, $page ); // Override the custom query with the global query if needed. $use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ); if ( $use_global_query ) { global $wp_query; if ( $wp_query && isset( $wp_query->query_vars ) && is_array( $wp_query->query_vars ) ) { + // Unset `offset` because if is set, $wp_query overrides/ignores the paged parameter and breaks pagination. + unset( $query['offset'] ); $query = wp_parse_args( $wp_query->query_vars, $query ); } } - $posts = get_posts( $query ); - + $posts = get_posts( $query ); $classnames = ''; if ( isset( $block->context['layout'] ) && isset( $block->context['query'] ) ) { if ( isset( $block->context['layout']['type'] ) && 'flex' === $block->context['layout']['type'] ) { diff --git a/packages/block-library/src/query-pagination-next/block.json b/packages/block-library/src/query-pagination-next/block.json new file mode 100644 index 00000000000000..bb701a95f69c0b --- /dev/null +++ b/packages/block-library/src/query-pagination-next/block.json @@ -0,0 +1,24 @@ +{ + "apiVersion": 2, + "name": "core/query-pagination-next", + "category": "design", + "attributes": { + "label": { + "type": "string" + } + }, + "usesContext": [ + "queryId", + "query" + ], + "supports": { + "reusable": false, + "html": false, + "color": { + "gradients": true, + "link": true + }, + "fontSize": true, + "lineHeight": true + } +} diff --git a/packages/block-library/src/query-pagination-next/edit.js b/packages/block-library/src/query-pagination-next/edit.js new file mode 100644 index 00000000000000..ef7a5df725ceb8 --- /dev/null +++ b/packages/block-library/src/query-pagination-next/edit.js @@ -0,0 +1,30 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { useBlockProps, RichText } from '@wordpress/block-editor'; + +export default function QueryPaginationNextEdit( { + attributes: { label }, + setAttributes, +} ) { + const placeholder = __( 'Next Page' ); + return ( + <> +
      + { + + setAttributes( { label: newLabel } ) + } + /> + } +
      + + ); +} diff --git a/packages/block-library/src/query-pagination-next/index.js b/packages/block-library/src/query-pagination-next/index.js new file mode 100644 index 00000000000000..63236db84aa90f --- /dev/null +++ b/packages/block-library/src/query-pagination-next/index.js @@ -0,0 +1,22 @@ +/** + * WordPress dependencies + */ +import { _x, __ } from '@wordpress/i18n'; +import { queryPaginationNext as icon } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import metadata from './block.json'; +import edit from './edit'; + +const { name } = metadata; +export { metadata, name }; + +export const settings = { + title: _x( 'Query Pagination Next', 'block title' ), + description: __( 'Displays the next posts page link.' ), + icon, + edit, + parent: [ 'core/query-pagination' ], +}; diff --git a/packages/block-library/src/query-pagination-next/index.php b/packages/block-library/src/query-pagination-next/index.php new file mode 100644 index 00000000000000..0f9cf6544af50d --- /dev/null +++ b/packages/block-library/src/query-pagination-next/index.php @@ -0,0 +1,67 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT ); + $max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0; + + $wrapper_attributes = get_block_wrapper_attributes(); + $default_label = __( 'Next Page »', 'gutenberg' ); + $label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label; + $content = ''; + + // Check if the pagination is for Query that inherits the global context. + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + $filter_link_attributes = function() use ( $wrapper_attributes ) { + return $wrapper_attributes; + }; + add_filter( 'next_posts_link_attributes', $filter_link_attributes ); + // Take into account if we have set a bigger `max page` + // than what the query has. + global $wp_query; + if ( $max_page > $wp_query->max_num_pages ) { + $max_page = $wp_query->max_num_pages; + } + $content = get_next_posts_link( $label, $max_page ); + remove_filter( 'next_posts_link_attributes', $filter_link_attributes ); + } elseif ( ! $max_page || $max_page > $page ) { + $custom_query = new WP_Query( construct_wp_query_args( $block, $page ) ); + if ( (int) $custom_query->max_num_pages !== $page ) { + $content = sprintf( + '%3$s', + esc_url( add_query_arg( $page_key, $page + 1 ) ), + $wrapper_attributes, + $label + ); + } + wp_reset_postdata(); // Restore original Post Data. + } + return $content; +} + +/** + * Registers the `core/query-pagination-next` block on the server. + */ +function register_block_core_query_pagination_next() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-next', + array( + 'render_callback' => 'render_block_core_query_pagination_next', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_next' ); diff --git a/packages/block-library/src/query-pagination-numbers/block.json b/packages/block-library/src/query-pagination-numbers/block.json new file mode 100644 index 00000000000000..49970983fb28fe --- /dev/null +++ b/packages/block-library/src/query-pagination-numbers/block.json @@ -0,0 +1,14 @@ +{ + "apiVersion": 2, + "name": "core/query-pagination-numbers", + "category": "design", + "usesContext": [ + "queryId", + "query" + ], + "supports": { + "reusable": false, + "html": false + }, + "editorStyle": "query-pagination-numbers-editor" +} diff --git a/packages/block-library/src/query-pagination-numbers/edit.js b/packages/block-library/src/query-pagination-numbers/edit.js new file mode 100644 index 00000000000000..3832f673ea1248 --- /dev/null +++ b/packages/block-library/src/query-pagination-numbers/edit.js @@ -0,0 +1,25 @@ +/** + * WordPress dependencies + */ +import { useBlockProps } from '@wordpress/block-editor'; + +const createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => ( + { content } +); + +const previewPaginationNumbers = () => ( + <> + { createPaginationItem( 1 ) } + { createPaginationItem( 2 ) } + { createPaginationItem( 3, 'span', 'current' ) } + { createPaginationItem( 4 ) } + { createPaginationItem( 5 ) } + { createPaginationItem( '...', 'span', 'dots' ) } + { createPaginationItem( 8 ) } + +); + +export default function QueryPaginationNumbersEdit() { + const paginationNumbers = previewPaginationNumbers(); + return
      { paginationNumbers }
      ; +} diff --git a/packages/block-library/src/query-pagination-numbers/editor.scss b/packages/block-library/src/query-pagination-numbers/editor.scss new file mode 100644 index 00000000000000..a10729463ccc95 --- /dev/null +++ b/packages/block-library/src/query-pagination-numbers/editor.scss @@ -0,0 +1,12 @@ +.wp-block-query-pagination-numbers { + a { + text-decoration: underline; + } + .page-numbers { + margin-right: 2px; + &:last-child { + /*rtl:ignore*/ + margin-right: 0; + } + } +} diff --git a/packages/block-library/src/query-pagination-numbers/index.js b/packages/block-library/src/query-pagination-numbers/index.js new file mode 100644 index 00000000000000..41ab95578ee250 --- /dev/null +++ b/packages/block-library/src/query-pagination-numbers/index.js @@ -0,0 +1,22 @@ +/** + * WordPress dependencies + */ +import { _x, __ } from '@wordpress/i18n'; +import { queryPaginationNumbers as icon } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import metadata from './block.json'; +import edit from './edit'; + +const { name } = metadata; +export { metadata, name }; + +export const settings = { + title: _x( 'Query Pagination Numbers', 'block title' ), + description: __( 'Displays a list of page numbers for pagination' ), + icon, + edit, + parent: [ 'core/query-pagination' ], +}; diff --git a/packages/block-library/src/query-pagination-numbers/index.php b/packages/block-library/src/query-pagination-numbers/index.php new file mode 100644 index 00000000000000..14be314b322822 --- /dev/null +++ b/packages/block-library/src/query-pagination-numbers/index.php @@ -0,0 +1,76 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT ); + $max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0; + + $wrapper_attributes = get_block_wrapper_attributes(); + $content = ''; + global $wp_query; + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + // Take into account if we have set a bigger `max page` + // than what the query has. + $total = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page; + $paginate_args = array( + 'prev_next' => false, + 'total' => $total, + ); + $content = paginate_links( $paginate_args ); + } else { + $block_query = new WP_Query( construct_wp_query_args( $block, $page ) ); + // `paginate_links` works with the global $wp_query, so we have to + // temporarily switch it with our custom query. + $prev_wp_query = $wp_query; + $wp_query = $block_query; + $total = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page; + $paginate_args = array( + 'base' => '%_%', + 'format' => "?$page_key=%#%", + 'current' => max( 1, $page ), + 'total' => $total, + 'prev_next' => false, + ); + // We still need to preserve `paged` query param if exists, as is used + // for Queries that inherit from global context. + $paged = empty( $_GET['paged'] ) ? null : (int) $_GET['paged']; + if ( $paged ) { + $paginate_args['add_args'] = array( 'paged' => $paged ); + } + $content = paginate_links( $paginate_args ); + wp_reset_postdata(); // Restore original Post Data. + $wp_query = $prev_wp_query; + } + return sprintf( + '
      %2$s
      ', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/query-pagination-numbers` block on the server. + */ +function register_block_core_query_pagination_numbers() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-numbers', + array( + 'render_callback' => 'render_block_core_query_pagination_numbers', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_numbers' ); diff --git a/packages/block-library/src/query-pagination-previous/block.json b/packages/block-library/src/query-pagination-previous/block.json new file mode 100644 index 00000000000000..15bb8d7be399ec --- /dev/null +++ b/packages/block-library/src/query-pagination-previous/block.json @@ -0,0 +1,24 @@ +{ + "apiVersion": 2, + "name": "core/query-pagination-previous", + "category": "design", + "attributes": { + "label": { + "type": "string" + } + }, + "usesContext": [ + "queryId", + "query" + ], + "supports": { + "reusable": false, + "html": false, + "color": { + "gradients": true, + "link": true + }, + "fontSize": true, + "lineHeight": true + } +} diff --git a/packages/block-library/src/query-pagination-previous/edit.js b/packages/block-library/src/query-pagination-previous/edit.js new file mode 100644 index 00000000000000..c30067602bc4dd --- /dev/null +++ b/packages/block-library/src/query-pagination-previous/edit.js @@ -0,0 +1,30 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; +import { useBlockProps, RichText } from '@wordpress/block-editor'; + +export default function QueryPaginationPreviousEdit( { + attributes: { label }, + setAttributes, +} ) { + const placeholder = __( 'Previous Page' ); + return ( + <> +
      + { + + setAttributes( { label: newLabel } ) + } + /> + } +
      + + ); +} diff --git a/packages/block-library/src/query-pagination-previous/index.js b/packages/block-library/src/query-pagination-previous/index.js new file mode 100644 index 00000000000000..cc6ba94a0a091d --- /dev/null +++ b/packages/block-library/src/query-pagination-previous/index.js @@ -0,0 +1,22 @@ +/** + * WordPress dependencies + */ +import { _x, __ } from '@wordpress/i18n'; +import { queryPaginationPrevious as icon } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import metadata from './block.json'; +import edit from './edit'; + +const { name } = metadata; +export { metadata, name }; + +export const settings = { + title: _x( 'Query Pagination Previous', 'block title' ), + description: __( 'Displays the previous posts page link.' ), + icon, + edit, + parent: [ 'core/query-pagination' ], +}; diff --git a/packages/block-library/src/query-pagination-previous/index.php b/packages/block-library/src/query-pagination-previous/index.php new file mode 100644 index 00000000000000..735efea618152c --- /dev/null +++ b/packages/block-library/src/query-pagination-previous/index.php @@ -0,0 +1,56 @@ +context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT ); + + $wrapper_attributes = get_block_wrapper_attributes(); + $default_label = __( '« Previous Page', 'gutenberg' ); + $label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label; + $content = ''; + // Check if the pagination is for Query that inherits the global context + // and handle appropriately. + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + $filter_link_attributes = function() use ( $wrapper_attributes ) { + return $wrapper_attributes; + }; + add_filter( 'previous_posts_link_attributes', $filter_link_attributes ); + $content = get_previous_posts_link( $label ); + remove_filter( 'previous_posts_link_attributes', $filter_link_attributes ); + } elseif ( 1 !== $page ) { + $content = sprintf( + '%3$s', + esc_url( add_query_arg( $page_key, $page - 1 ) ), + $wrapper_attributes, + $label + ); + } + return $content; +} + +/** + * Registers the `core/query-pagination-previous` block on the server. + */ +function register_block_core_query_pagination_previous() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-previous', + array( + 'render_callback' => 'render_block_core_query_pagination_previous', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_previous' ); diff --git a/packages/block-library/src/query-pagination/block.json b/packages/block-library/src/query-pagination/block.json index bc68f40f714bf8..765e4c1f0bcceb 100644 --- a/packages/block-library/src/query-pagination/block.json +++ b/packages/block-library/src/query-pagination/block.json @@ -10,5 +10,7 @@ "supports": { "reusable": false, "html": false - } + }, + "editorStyle": "wp-block-query-pagination-editor", + "style": "wp-block-query-pagination" } diff --git a/packages/block-library/src/query-pagination/edit.js b/packages/block-library/src/query-pagination/edit.js index 60e38bbafb2f46..80fae98797880d 100644 --- a/packages/block-library/src/query-pagination/edit.js +++ b/packages/block-library/src/query-pagination/edit.js @@ -1,58 +1,31 @@ /** * WordPress dependencies */ -import { Button, ButtonGroup } from '@wordpress/components'; -import { chevronLeft, chevronRight } from '@wordpress/icons'; -import { __ } from '@wordpress/i18n'; -import { useBlockProps } from '@wordpress/block-editor'; +import { + useBlockProps, + __experimentalUseInnerBlocksProps as useInnerBlocksProps, +} from '@wordpress/block-editor'; -/** - * Internal dependencies - */ -import { useQueryContext } from '../query'; - -export default function QueryPaginationEdit( { - context: { - query: { pages = 1 }, - queryContext, - }, -} ) { - const [ { page }, setQueryContext ] = useQueryContext() || queryContext; +const TEMPLATE = [ + [ 'core/query-pagination-previous' ], + [ 'core/query-pagination-numbers' ], + [ 'core/query-pagination-next' ], +]; - let previous; - if ( page > 1 ) { - previous = ( - - ); - } - let next; - if ( page < pages ) { - next = ( - - ); - } +export default function QueryPaginationEdit() { + const blockProps = useBlockProps(); + const innerBlocksProps = useInnerBlocksProps( blockProps, { + template: TEMPLATE, + allowedBlocks: [ + 'core/query-pagination-previous', + 'core/query-pagination-numbers', + 'core/query-pagination-next', + ], + orientation: 'horizontal', + } ); return ( -
      - { previous || next ? ( - - { previous } - { next } - - ) : ( - __( 'No pages to paginate.' ) - ) } +
      +
      ); } diff --git a/packages/block-library/src/query-pagination/editor.scss b/packages/block-library/src/query-pagination/editor.scss new file mode 100644 index 00000000000000..04b40e77c8db92 --- /dev/null +++ b/packages/block-library/src/query-pagination/editor.scss @@ -0,0 +1,41 @@ +$pagination-margin: 0.5em; + +.wp-block > .wp-block-query-pagination { + display: flex; + flex-wrap: wrap; + flex-direction: row; +} + +.editor-styles-wrapper { + .wp-block-query-pagination { + max-width: 100%; + &.block-editor-block-list__layout { + margin: 0; + } + } +} + +.block-library-query-pagination-toolbar__popover .components-popover__content { + min-width: 230px; +} + +.wp-block-query-pagination { + > .wp-block-query-pagination-next, + > .wp-block-query-pagination-previous, + > .wp-block-query-pagination-numbers { + display: inline-block; + + // Override editor auto block margins. + margin-left: 0; + margin-top: $pagination-margin; + + /*rtl:ignore*/ + margin-right: $pagination-margin; + margin-bottom: $pagination-margin; + + &:last-child { + /*rtl:ignore*/ + margin-right: 0; + } + } +} diff --git a/packages/block-library/src/query-pagination/index.js b/packages/block-library/src/query-pagination/index.js index 235ec5a02d17d5..0bb7b98a54c0d8 100644 --- a/packages/block-library/src/query-pagination/index.js +++ b/packages/block-library/src/query-pagination/index.js @@ -1,18 +1,26 @@ /** * WordPress dependencies */ -import { _x } from '@wordpress/i18n'; +import { _x, __ } from '@wordpress/i18n'; +import { queryPagination as icon } from '@wordpress/icons'; /** * Internal dependencies */ import metadata from './block.json'; import edit from './edit'; +import save from './save'; const { name } = metadata; export { metadata, name }; export const settings = { title: _x( 'Query Pagination', 'block title' ), + description: __( + 'Displays a paginated navigation to next/previous set of posts, when applicable.' + ), + icon, edit, + save, + parent: [ 'core/query' ], }; diff --git a/packages/block-library/src/query-pagination/index.php b/packages/block-library/src/query-pagination/index.php index 9fba76cad43841..a9f31bf78fc4fe 100644 --- a/packages/block-library/src/query-pagination/index.php +++ b/packages/block-library/src/query-pagination/index.php @@ -5,46 +5,12 @@ * @package WordPress */ -/** - * Renders the `core/query-pagination` block on the server. - * - * @param array $attributes Block attributes. - * @param string $content Block default content. - * @param WP_Block $block Block instance. - * - * @return string Returns the pagination for the query. - */ -function render_block_core_query_pagination( $attributes, $content, $block ) { - $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; - $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT ); - - $content = ''; - if ( 1 !== $page ) { - $content .= sprintf( - '', - esc_url( add_query_arg( $page_key, '2' === $page ? false : $page - 1 ) ), - __( 'Previous', 'gutenberg' ) - ); - } - if ( $page < ( isset( $block->context['query']['pages'] ) ? $block->context['query']['pages'] : 1 ) ) { - $content .= sprintf( - '', - esc_url( add_query_arg( $page_key, $page + 1 ) ), - __( 'Next', 'gutenberg' ) - ); - } - return $content; -} - /** * Registers the `core/query-pagination` block on the server. */ function register_block_core_query_pagination() { register_block_type_from_metadata( - __DIR__ . '/query-pagination', - array( - 'render_callback' => 'render_block_core_query_pagination', - ) + __DIR__ . '/query-pagination' ); } add_action( 'init', 'register_block_core_query_pagination' ); diff --git a/packages/block-library/src/query-pagination/save.js b/packages/block-library/src/query-pagination/save.js new file mode 100644 index 00000000000000..000acdcd4a6055 --- /dev/null +++ b/packages/block-library/src/query-pagination/save.js @@ -0,0 +1,12 @@ +/** + * WordPress dependencies + */ +import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; + +export default function save() { + return ( +
      + +
      + ); +} diff --git a/packages/block-library/src/query-pagination/style.scss b/packages/block-library/src/query-pagination/style.scss new file mode 100644 index 00000000000000..e140863a7d981a --- /dev/null +++ b/packages/block-library/src/query-pagination/style.scss @@ -0,0 +1,21 @@ +$pagination-margin: 0.5em; +.wp-block-query-pagination { + display: flex; + flex-direction: row; + flex-wrap: wrap; + + // Increased specificity to override blocks default margin. + > .wp-block-query-pagination-next, + > .wp-block-query-pagination-previous, + > .wp-block-query-pagination-numbers { + display: inline-block; + /*rtl:ignore*/ + margin-right: $pagination-margin; + margin-bottom: $pagination-margin; + + &:last-child { + /*rtl:ignore*/ + margin-right: 0; + } + } +} diff --git a/packages/block-library/src/query/block.json b/packages/block-library/src/query/block.json index 302ea1a8e80856..1de605c652b02f 100644 --- a/packages/block-library/src/query/block.json +++ b/packages/block-library/src/query/block.json @@ -10,7 +10,7 @@ "type": "object", "default": { "perPage": null, - "pages": 1, + "pages": 0, "offset": 0, "postType": "post", "categoryIds": [], diff --git a/packages/block-library/src/query/edit/query-toolbar.js b/packages/block-library/src/query/edit/query-toolbar.js index 3420ecb0e8d886..467036842f2d5e 100644 --- a/packages/block-library/src/query/edit/query-toolbar.js +++ b/packages/block-library/src/query/edit/query-toolbar.js @@ -5,10 +5,10 @@ import { ToolbarGroup, Dropdown, ToolbarButton, - RangeControl, BaseControl, __experimentalNumberControl as NumberControl, } from '@wordpress/components'; +import { useInstanceId } from '@wordpress/compose'; import { __ } from '@wordpress/i18n'; import { settings, list, grid } from '@wordpress/icons'; @@ -17,6 +17,10 @@ export default function QueryToolbar( { setQuery, setLayout, } ) { + const maxPageInputId = useInstanceId( + QueryToolbar, + 'blocks-query-pagination-max-page-input' + ); const layoutControls = [ { icon: list, @@ -79,15 +83,24 @@ export default function QueryToolbar( { isDragEnabled={ false } /> - - + - setQuery( { pages: value ?? -1 } ) + setQuery( { pages: +value } ) } + step="1" + value={ query.pages } + isDragEnabled={ false } /> diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index 3a44e690c5e82e..a8d23e1563793d 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -29,6 +29,7 @@ @import "./preformatted/style.scss"; @import "./pullquote/style.scss"; @import "./query-loop/style.scss"; +@import "./query-pagination/style.scss"; @import "./quote/style.scss"; @import "./rss/style.scss"; @import "./search/style.scss"; diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.html new file mode 100644 index 00000000000000..6be83e191f5a3e --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.html @@ -0,0 +1 @@ + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.json new file mode 100644 index 00000000000000..b86a84f59bffa4 --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.json @@ -0,0 +1,10 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/query-pagination-next", + "isValid": true, + "attributes": {}, + "innerBlocks": [], + "originalContent": "" + } +] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.parsed.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.parsed.json new file mode 100644 index 00000000000000..47f7a175bad5bb --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.parsed.json @@ -0,0 +1,18 @@ +[ + { + "blockName": "core/query-pagination-next", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.serialized.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.serialized.html new file mode 100644 index 00000000000000..6be83e191f5a3e --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-next.serialized.html @@ -0,0 +1 @@ + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.html new file mode 100644 index 00000000000000..905d3c1d964c94 --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.html @@ -0,0 +1 @@ + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.json new file mode 100644 index 00000000000000..9735dfa643f431 --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.json @@ -0,0 +1,10 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/query-pagination-numbers", + "isValid": true, + "attributes": {}, + "innerBlocks": [], + "originalContent": "" + } +] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.parsed.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.parsed.json new file mode 100644 index 00000000000000..4ff12cad3b7f5d --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.parsed.json @@ -0,0 +1,18 @@ +[ + { + "blockName": "core/query-pagination-numbers", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.serialized.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.serialized.html new file mode 100644 index 00000000000000..905d3c1d964c94 --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-numbers.serialized.html @@ -0,0 +1 @@ + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.html new file mode 100644 index 00000000000000..83dd3e66e25aa0 --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.html @@ -0,0 +1 @@ + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.json new file mode 100644 index 00000000000000..b92dac9509b64c --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.json @@ -0,0 +1,10 @@ +[ + { + "clientId": "_clientId_0", + "name": "core/query-pagination-previous", + "isValid": true, + "attributes": {}, + "innerBlocks": [], + "originalContent": "" + } +] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.parsed.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.parsed.json new file mode 100644 index 00000000000000..4a27e5ce4270ed --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.parsed.json @@ -0,0 +1,18 @@ +[ + { + "blockName": "core/query-pagination-previous", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + }, + { + "blockName": null, + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n", + "innerContent": [ + "\n" + ] + } +] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.serialized.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.serialized.html new file mode 100644 index 00000000000000..83dd3e66e25aa0 --- /dev/null +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination-previous.serialized.html @@ -0,0 +1 @@ + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination.html index 912a9515fee7f9..c962c0346e6662 100644 --- a/packages/e2e-tests/fixtures/blocks/core__query-pagination.html +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination.html @@ -1 +1,3 @@ - + +
      + diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination.json index 079862a6cd1afd..91a969ea6cc098 100644 --- a/packages/e2e-tests/fixtures/blocks/core__query-pagination.json +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination.json @@ -5,6 +5,6 @@ "isValid": true, "attributes": {}, "innerBlocks": [], - "originalContent": "" + "originalContent": "
      " } ] diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination.parsed.json b/packages/e2e-tests/fixtures/blocks/core__query-pagination.parsed.json index 580f3b5ef78a7f..2f4be2406a7741 100644 --- a/packages/e2e-tests/fixtures/blocks/core__query-pagination.parsed.json +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination.parsed.json @@ -3,8 +3,10 @@ "blockName": "core/query-pagination", "attrs": {}, "innerBlocks": [], - "innerHTML": "", - "innerContent": [] + "innerHTML": "\n
      \n", + "innerContent": [ + "\n
      \n" + ] }, { "blockName": null, diff --git a/packages/e2e-tests/fixtures/blocks/core__query-pagination.serialized.html b/packages/e2e-tests/fixtures/blocks/core__query-pagination.serialized.html index 912a9515fee7f9..c962c0346e6662 100644 --- a/packages/e2e-tests/fixtures/blocks/core__query-pagination.serialized.html +++ b/packages/e2e-tests/fixtures/blocks/core__query-pagination.serialized.html @@ -1 +1,3 @@ - + +
      + diff --git a/packages/e2e-tests/fixtures/blocks/core__query.json b/packages/e2e-tests/fixtures/blocks/core__query.json index 6dd991c4ba284a..de5273ce8f64c7 100644 --- a/packages/e2e-tests/fixtures/blocks/core__query.json +++ b/packages/e2e-tests/fixtures/blocks/core__query.json @@ -6,7 +6,7 @@ "attributes": { "query": { "perPage": null, - "pages": 1, + "pages": 0, "offset": 0, "postType": "post", "categoryIds": [], diff --git a/packages/icons/src/index.js b/packages/icons/src/index.js index 8a7f6dba0502a2..1ef81d686dd22f 100644 --- a/packages/icons/src/index.js +++ b/packages/icons/src/index.js @@ -143,6 +143,10 @@ export { default as preformatted } from './library/preformatted'; export { default as pullLeft } from './library/pull-left'; export { default as pullRight } from './library/pull-right'; export { default as pullquote } from './library/pullquote'; +export { default as queryPagination } from './library/query-pagination'; +export { default as queryPaginationNext } from './library/query-pagination-next'; +export { default as queryPaginationNumbers } from './library/query-pagination-numbers'; +export { default as queryPaginationPrevious } from './library/query-pagination-previous'; export { default as quote } from './library/quote'; export { default as receipt } from './library/receipt'; export { default as redo } from './library/redo'; diff --git a/packages/icons/src/library/query-pagination-next.js b/packages/icons/src/library/query-pagination-next.js new file mode 100644 index 00000000000000..2adc48f676d536 --- /dev/null +++ b/packages/icons/src/library/query-pagination-next.js @@ -0,0 +1,14 @@ +/** + * WordPress dependencies + */ +import { SVG, Path, Rect } from '@wordpress/primitives'; + +const queryPaginationNext = ( + + + + + +); + +export default queryPaginationNext; diff --git a/packages/icons/src/library/query-pagination-numbers.js b/packages/icons/src/library/query-pagination-numbers.js new file mode 100644 index 00000000000000..88103544b1e7ff --- /dev/null +++ b/packages/icons/src/library/query-pagination-numbers.js @@ -0,0 +1,17 @@ +/** + * WordPress dependencies + */ +import { SVG, Path, Rect } from '@wordpress/primitives'; + +const queryPaginationNumbers = ( + + + + + +); + +export default queryPaginationNumbers; diff --git a/packages/icons/src/library/query-pagination-previous.js b/packages/icons/src/library/query-pagination-previous.js new file mode 100644 index 00000000000000..160b7f2edcfbcb --- /dev/null +++ b/packages/icons/src/library/query-pagination-previous.js @@ -0,0 +1,30 @@ +/** + * WordPress dependencies + */ +import { SVG, Path, Rect } from '@wordpress/primitives'; + +const queryPaginationPrevious = ( + + + + + +); + +export default queryPaginationPrevious; diff --git a/packages/icons/src/library/query-pagination.js b/packages/icons/src/library/query-pagination.js new file mode 100644 index 00000000000000..e2369fb0f8ef70 --- /dev/null +++ b/packages/icons/src/library/query-pagination.js @@ -0,0 +1,14 @@ +/** + * WordPress dependencies + */ +import { SVG, Rect } from '@wordpress/primitives'; + +const queryPagination = ( + + + + + +); + +export default queryPagination; From e9c756176dca46a396687c0f92ea71120a897bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Wed, 20 Jan 2021 10:17:57 +0100 Subject: [PATCH 29/61] Add "Show block breadcrumbs" preference (#28133) --- .../specs/editor/plugins/block-variations.js | 12 +++++++ .../edit-post/src/components/layout/index.js | 5 +++ .../src/components/preferences-modal/index.js | 33 +++++++++++++++++-- .../test/__snapshots__/index.js.snap | 5 +++ packages/edit-post/src/store/defaults.js | 1 + .../components/interface-skeleton/index.js | 3 +- .../components/interface-skeleton/style.scss | 6 ++-- 7 files changed, 60 insertions(+), 5 deletions(-) diff --git a/packages/e2e-tests/specs/editor/plugins/block-variations.js b/packages/e2e-tests/specs/editor/plugins/block-variations.js index 81862f42a5e304..1e3b48e656f31b 100644 --- a/packages/e2e-tests/specs/editor/plugins/block-variations.js +++ b/packages/e2e-tests/specs/editor/plugins/block-variations.js @@ -9,6 +9,8 @@ import { searchForBlock, pressKeyWithModifier, openDocumentSettingsSidebar, + toggleScreenOption, + toggleMoreMenu, } from '@wordpress/e2e-test-utils'; describe( 'Block variations', () => { @@ -107,6 +109,16 @@ describe( 'Block variations', () => { } ); // @see @wordpres/block-editor/src/components/use-block-display-information (`useBlockDisplayInformation` hook). describe( 'testing block display information with matching variations', () => { + beforeEach( async () => { + await toggleScreenOption( 'Display block breadcrumbs', true ); + await toggleMoreMenu(); + } ); + + afterEach( async () => { + await toggleScreenOption( 'Display block breadcrumbs', false ); + await toggleMoreMenu(); + } ); + const getActiveBreadcrumb = async () => page.evaluate( () => diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 61c617083deabc..37ca766fcd66f9 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -94,6 +94,7 @@ function Layout( { styles } ) { isInserterOpened, showIconLabels, hasReducedUI, + showBlockBreadcrumbs, } = useSelect( ( select ) => { return { hasFixedToolbar: select( editPostStore ).isFeatureActive( @@ -129,6 +130,9 @@ function Layout( { styles } ) { hasReducedUI: select( editPostStore ).isFeatureActive( 'reducedUI' ), + showBlockBreadcrumbs: select( editPostStore ).isFeatureActive( + 'showBlockBreadcrumbs' + ), }; }, [] ); const className = classnames( 'edit-post-layout', 'is-mode-' + mode, { @@ -269,6 +273,7 @@ function Layout( { styles } ) { } footer={ ! hasReducedUI && + showBlockBreadcrumbs && ! isMobileViewport && isRichEditingEnabled && mode === 'visual' && ( diff --git a/packages/edit-post/src/components/preferences-modal/index.js b/packages/edit-post/src/components/preferences-modal/index.js index e237984e29df7c..fde173f47c07cc 100644 --- a/packages/edit-post/src/components/preferences-modal/index.js +++ b/packages/edit-post/src/components/preferences-modal/index.js @@ -8,8 +8,8 @@ import { get } from 'lodash'; */ import { Modal } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { withSelect, withDispatch } from '@wordpress/data'; -import { compose } from '@wordpress/compose'; +import { withSelect, withDispatch, useSelect } from '@wordpress/data'; +import { compose, useViewportMatch } from '@wordpress/compose'; import { PostTaxonomies, PostExcerptCheck, @@ -34,9 +34,26 @@ import { store as editPostStore } from '../../store'; const MODAL_NAME = 'edit-post/preferences'; export function PreferencesModal( { isModalActive, isViewable, closeModal } ) { + const isMobileViewport = useViewportMatch( 'medium', '<' ); + const { mode, isRichEditingEnabled, hasReducedUI } = useSelect( + ( select ) => { + return { + mode: select( editPostStore ).getEditorMode(), + isRichEditingEnabled: select( + 'core/editor' + ).getEditorSettings().richEditingEnabled, + hasReducedUI: select( editPostStore ).isFeatureActive( + 'reducedUI' + ), + }; + }, + [] + ); + if ( ! isModalActive ) { return null; } + return ( + { ! hasReducedUI && + ! isMobileViewport && + isRichEditingEnabled && + mode === 'visual' && ( + + ) }
      +
      { !! drawer && ( diff --git a/packages/interface/src/components/interface-skeleton/style.scss b/packages/interface/src/components/interface-skeleton/style.scss index 374c70ae188cae..f038b4bb893d36 100644 --- a/packages/interface/src/components/interface-skeleton/style.scss +++ b/packages/interface/src/components/interface-skeleton/style.scss @@ -64,8 +64,10 @@ html.interface-interface-skeleton__html-container { overscroll-behavior-y: none; // Footer overlap prevention - @include break-medium() { - padding-bottom: $button-size-small + $border-width; + .has-footer & { + @include break-medium() { + padding-bottom: $button-size-small + $border-width; + } } } From d301220a2401bfb67b2de17e7b678b3c0e33781c Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Wed, 20 Jan 2021 18:08:31 +0800 Subject: [PATCH 30/61] Improve robustness of nav screen test (#28344) * Wait for snackbar message before clicking nav block * Wait for add all pages button too --- .../specs/experiments/navigation-editor.test.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/e2e-tests/specs/experiments/navigation-editor.test.js b/packages/e2e-tests/specs/experiments/navigation-editor.test.js index ad9f062101b827..44a6d5a8029867 100644 --- a/packages/e2e-tests/specs/experiments/navigation-editor.test.js +++ b/packages/e2e-tests/specs/experiments/navigation-editor.test.js @@ -144,6 +144,7 @@ describe( 'Navigation editor', () => { it( 'allows creation of a menu', async () => { const pagesResponse = createMockPages( pagesFixture ); + const menuResponse = { id: 4, description: '', @@ -179,8 +180,9 @@ describe( 'Navigation editor', () => { '//button[contains(., "Add new")]' ); await addNewButton.click(); + await page.keyboard.type( 'Main Menu' ); - const [ createMenuButton ] = await page.$x( + const createMenuButton = await page.waitForXPath( '//button[contains(., "Create menu")]' ); await createMenuButton.click(); @@ -188,11 +190,16 @@ describe( 'Navigation editor', () => { // Close the dropdown. await page.keyboard.press( 'Escape' ); + // A snackbar will appear when menu creation has completed. + await page.waitForXPath( '//div[contains(., "Menu created")]' ); + // Select the navigation block and create a block from existing pages. - await page.waitForSelector( 'div[aria-label="Block: Navigation"]' ); - await page.click( 'div[aria-label="Block: Navigation"]' ); + const navigationBlock = await page.waitForSelector( + 'div[aria-label="Block: Navigation"]' + ); + await navigationBlock.click(); - const [ addAllPagesButton ] = await page.$x( + const addAllPagesButton = await page.waitForXPath( '//button[contains(., "Add all pages")]' ); await addAllPagesButton.click(); From 6f0f007de2fc698e170b61499c1cf1226fc8d95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Wed, 20 Jan 2021 11:33:38 +0100 Subject: [PATCH 31/61] Warning component: Move margin styling to actions (#28316) --- packages/block-editor/src/components/warning/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/warning/style.scss b/packages/block-editor/src/components/warning/style.scss index cc082b0ea4e69c..c76d71e998be6a 100644 --- a/packages/block-editor/src/components/warning/style.scss +++ b/packages/block-editor/src/components/warning/style.scss @@ -15,8 +15,7 @@ font-family: $default-font; font-size: $default-font-size; color: $gray-900; - margin: 0 0 1em; - + margin: 0; } // Required extra-specifity to override paragraph block styles. @@ -35,6 +34,7 @@ .block-editor-warning__actions { display: flex; + margin-top: 1em; } .block-editor-warning__action { From e0ab33ea08f56d3fcac36158c4b3cf462dca9b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Wed, 20 Jan 2021 11:43:07 +0100 Subject: [PATCH 32/61] Packages: Fully automate npm publishing with the latest and next tags (#28335) * Packages: Fully automate npm publishing with the latest and next tags * Adjust documentation for publishing to npm * Make lerna commands interactive * Ensure that cherry-picking of commits is recognized as the manual step --- bin/plugin/cli.js | 20 ++-- bin/plugin/commands/packages.js | 79 ++++++++++--- docs/contributors/release.md | 198 +++++++++++++++++--------------- package.json | 6 +- 4 files changed, 182 insertions(+), 121 deletions(-) diff --git a/bin/plugin/cli.js b/bin/plugin/cli.js index 84db72639f6b2a..25ac3d891a2158 100755 --- a/bin/plugin/cli.js +++ b/bin/plugin/cli.js @@ -21,8 +21,8 @@ const catchException = ( command ) => { */ const { releaseRC, releaseStable } = require( './commands/release' ); const { - prepareLatestDistTag, - prepareNextDistTag, + publishNpmLatestDistTag, + publishNpmNextDistTag, } = require( './commands/packages' ); const { getReleaseChangelog } = require( './commands/changelog' ); const { runPerformanceTests } = require( './commands/performance' ); @@ -40,20 +40,20 @@ program .action( catchException( releaseStable ) ); program - .command( 'prepare-packages-stable' ) - .alias( 'npm-stable' ) + .command( 'publish-npm-packages-latest' ) + .alias( 'npm-latest' ) .description( - 'Prepares the packages to be published to npm as stable (latest dist-tag, production version)' + 'Publishes packages to npm (latest dist-tag, production version)' ) - .action( catchException( prepareLatestDistTag ) ); + .action( catchException( publishNpmLatestDistTag ) ); program - .command( 'prepare-packages-rc' ) - .alias( 'npm-rc' ) + .command( 'publish-npm-packages-next' ) + .alias( 'npm-next' ) .description( - 'Prepares the packages to be published to npm as RC (next dist-tag, RC version)' + 'Publishes packages to npm (next dist-tag, prerelease version)' ) - .action( catchException( prepareNextDistTag ) ); + .action( catchException( publishNpmNextDistTag ) ); program .command( 'release-plugin-changelog' ) diff --git a/bin/plugin/commands/packages.js b/bin/plugin/commands/packages.js index 7625bb8a71e27e..b34c70dc71fbf9 100644 --- a/bin/plugin/commands/packages.js +++ b/bin/plugin/commands/packages.js @@ -1,6 +1,7 @@ /** * External dependencies */ +const { command } = require( 'execa' ); const path = require( 'path' ); const glob = require( 'fast-glob' ); const fs = require( 'fs' ); @@ -32,15 +33,17 @@ const git = require( '../lib/git' ); * the last plugin release. * * @param {string} gitWorkingDirectoryPath Git working directory path. + * @param {boolean} isPrerelease Whether the package version to publish is a prerelease. * @param {string} abortMessage Abort Message. * * @return {Promise} WordPress release branch. */ async function runWordPressReleaseBranchSyncStep( gitWorkingDirectoryPath, + isPrerelease, abortMessage ) { - const wordpressReleaseBranch = 'wp/trunk'; + const wordpressReleaseBranch = isPrerelease ? 'wp/next' : 'wp/trunk'; await runStep( 'Getting into the WordPress release branch', abortMessage, @@ -190,7 +193,7 @@ async function updatePackages( content.replace( '## Unreleased', `## Unreleased\n\n## ${ - isPrerelease ? nextVersion + '-rc.0' : nextVersion + isPrerelease ? nextVersion + '-next.0' : nextVersion } (${ publishDate })` ) ); @@ -252,6 +255,42 @@ async function runPushGitChangesStep( ); } +/** + * Publishes all changed packages to npm. + * + * @param {string} gitWorkingDirectoryPath Git working directory path. + * @param {SemVer} minimumVersionBump Minimum version bump for the packages. + * @param {boolean} isPrerelease Whether the package version to publish is a prerelease. + */ +async function publishPackagesToNpm( + gitWorkingDirectoryPath, + minimumVersionBump, + isPrerelease +) { + log( '>> Installing npm packages.' ); + await command( 'npm ci', { + cwd: gitWorkingDirectoryPath, + } ); + + log( + '>> Bumping version of public packages changed since the last release.' + ); + const version = isPrerelease + ? 'prerelease --preid next' + : minimumVersionBump; + await command( `npx lerna version ${ version } --no-private`, { + cwd: gitWorkingDirectoryPath, + stdio: 'inherit', + } ); + + log( '>> Publishing packages to npm.' ); + const distTag = isPrerelease ? ' --dist-tag next' : ''; + await command( `npx lerna publish from-package${ distTag }`, { + cwd: gitWorkingDirectoryPath, + stdio: 'inherit', + } ); +} + /** * Prepare everything to publish WordPress packages to npm. * @@ -274,6 +313,7 @@ async function prepareForPackageRelease( isPrerelease ) { // Checking out the WordPress release branch and doing sync with the last plugin release. const { releaseBranch } = await runWordPressReleaseBranchSyncStep( gitWorkingDirectoryPath, + isPrerelease, abortMessage ); @@ -294,7 +334,6 @@ async function prepareForPackageRelease( isPrerelease ) { abortMessage ); - // Push the local changes abortMessage = `Aborting! Make sure to push changes applied to WordPress release branch "${ releaseBranch }" manually.`; await runPushGitChangesStep( gitWorkingDirectoryPath, @@ -302,50 +341,56 @@ async function prepareForPackageRelease( isPrerelease ) { abortMessage ); - abortMessage = 'Aborting! The release is finished though.'; + abortMessage = `Aborting! Make sure to finish publishing to npm manually.`; + await publishPackagesToNpm( + gitWorkingDirectoryPath, + minimumVersionBump, + isPrerelease, + abortMessage + ); + + abortMessage = 'Aborting! The publishing is finished though.'; await runCleanLocalFoldersStep( temporaryFolders, abortMessage ); } /** - * Prepares everything for publishing a new stable version of WordPress packages. + * Publishes a new latest version of WordPress packages. */ -async function prepareLatestDistTag() { +async function publishNpmLatestDistTag() { log( formats.title( '\n💃 Time to publish WordPress packages to npm 🕺\n\n' ), - 'Welcome! This tool is going to help you with preparing everything for publishing a new stable version of WordPress packages.\n', + 'Welcome! This tool is going to help you with publishing a new latest version of WordPress packages.\n', "To perform a release you'll have to be a member of the WordPress Team on npm.\n" ); await prepareForPackageRelease(); log( - '\n>> 🎉 WordPress packages are ready to publish!\n', - 'You need to run "npm run publish:prod" to release them to npm.\n', - 'Let also people know on WordPress Slack when everything is finished.\n' + '\n>> 🎉 WordPress packages are now published!\n', + 'Let also people know on WordPress Slack.\n' ); } /** - * Prepares everything for publishing a new RC version of WordPress packages. + * Publishes a new next version of WordPress packages. */ -async function prepareNextDistTag() { +async function publishNpmNextDistTag() { log( formats.title( '\n💃 Time to publish WordPress packages to npm 🕺\n\n' ), - 'Welcome! This tool is going to help you with preparing everything for publishing a new RC version of WordPress packages.\n', + 'Welcome! This tool is going to help you with publishing a new next version of WordPress packages.\n', "To perform a release you'll have to be a member of the WordPress Team on npm.\n" ); await prepareForPackageRelease( true ); log( - '\n>> 🎉 WordPress packages are ready to publish!\n', - 'You need to run "npm run publish:dev" to release them to npm.\n', - 'Let also people know on WordPress Slack when everything is finished.\n' + '\n>> 🎉 WordPress packages are now published!\n', + 'Let also people know on WordPress Slack.\n' ); } -module.exports = { prepareLatestDistTag, prepareNextDistTag }; +module.exports = { publishNpmLatestDistTag, publishNpmNextDistTag }; diff --git a/docs/contributors/release.md b/docs/contributors/release.md index 86ad2988da1ea0..6d72a05cc9aa77 100644 --- a/docs/contributors/release.md +++ b/docs/contributors/release.md @@ -10,9 +10,9 @@ To release Gutenberg, you need commit access to the [WordPress.org plugin reposi We release a new major version approximately every two weeks. The current and next versions are [tracked in GitHub milestones](https://github.com/WordPress/gutenberg/milestones), along with each version's tagging date (the day when _the release candidate_ is to be tagged). -- **On the date of the current milestone**, we publish a release candidate and make it available for plugin authors and users to test. If any regressions are found with a release candidate, a new one can be published. On this date, all remaining PRs on the milestone are moved automatically to the next release. Release candidates should be versioned incrementally, starting with `-rc.1`, then `-rc.2`, and so on. +- **On the date of the current milestone**, we publish a release candidate and make it available for plugin authors and users to test. If any regressions are found with a release candidate, a new one can be published. On this date, all remaining PRs on the milestone are moved automatically to the next release. Release candidates should be versioned incrementally, starting with `-rc.1`, then `-rc.2`, and so on. -- **Two days after the first release candidate**, the stable version is created based on the last release candidate and any necessary regression fixes. Once the stable version is released, a post [like this](https://make.wordpress.org/core/2019/06/26/whats-new-in-gutenberg-26th-june/) describing the changes and performing a [performance audit](/docs/block-editor/contributors/testing-overview/#performance-testing) is published. +- **Two days after the first release candidate**, the stable version is created based on the last release candidate and any necessary regression fixes. Once the stable version is released, a post [like this](https://make.wordpress.org/core/2019/06/26/whats-new-in-gutenberg-26th-june/) describing the changes and performing a [performance audit](/docs/block-editor/contributors/testing-overview/#performance-testing) is published. If critical bugs are discovered on stable versions of the plugin, patch versions can be released at any time. @@ -34,9 +34,9 @@ To release a stable version, run: During the release process, you'll be asked to provide: -- A changelog: prepare one beforehand by following the instructions below. -- A [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line): have one ready beforehand by visiting [this page](https://github.com/settings/tokens/new?scopes=repo,admin:org,write:packages), if you haven't got one yet. -- User and password for your GitHub account: if 2FA is enabled for your account (it should), you need to provide a personal access token instead of password (you can use the one necessary for the release). +- A changelog: prepare one beforehand by following the instructions below. +- A [personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line): have one ready beforehand by visiting [this page](https://github.com/settings/tokens/new?scopes=repo,admin:org,write:packages), if you haven't got one yet. +- User and password for your GitHub account: if 2FA is enabled for your account (it should), you need to provide a personal access token instead of password (you can use the one necessary for the release). ### Manual Release Process @@ -59,24 +59,24 @@ To generate a changelog for a release, use the changelog generator tool: npm run changelog ``` -By default, this will search for and organize all pull requests associated with the milestone for the next version of the project. +By default, this will search for and organize all pull requests associated with the milestone for the next version of the project. To override the default behavior, you can pass one or both of the following options. Remember to use `--` to let NPM pass the options to the script. -- `--milestone `: Provide the title of the milestone for which the changelog should be generated. This should exactly match the title as shown on [the milestones page](https://github.com/WordPress/gutenberg/milestones). - - Example: `npm run changelog -- --milestone="Gutenberg 8.1"` -- `--token `: Provide a [GitHub personal access token](https://github.com/settings/tokens) for authenticating requests. This should only be necessary if you run the script frequently enough to been blocked by [rate limiting](https://developer.github.com/v3/#rate-limiting). - - Example: `npm run changelog -- --token="..."` +- `--milestone `: Provide the title of the milestone for which the changelog should be generated. This should exactly match the title as shown on [the milestones page](https://github.com/WordPress/gutenberg/milestones). + - Example: `npm run changelog -- --milestone="Gutenberg 8.1"` +- `--token `: Provide a [GitHub personal access token](https://github.com/settings/tokens) for authenticating requests. This should only be necessary if you run the script frequently enough to been blocked by [rate limiting](https://developer.github.com/v3/#rate-limiting). + - Example: `npm run changelog -- --token="..."` The script will output a generated changelog, grouped by pull request label. _Note that this is intended to be a starting point for release notes_. You will still want to manually review and curate the changelog entries. Guidelines for proof-reading include: -- Fix spelling errors or clarify wording. Phrasing should be easy to understand where the intended audience are those who use the plugin or are keeping up with ongoing development. -- Create new groupings as applicable, and move pull requests between. -- When multiple pull requests relate to the same task (such as a follow-up pull request), try to combine them to a single entry. -- If subtasks of a related set of pull requests are substantial, consider organizing as entries in a nested list. -- Remove mobile app pull request entries. +- Fix spelling errors or clarify wording. Phrasing should be easy to understand where the intended audience are those who use the plugin or are keeping up with ongoing development. +- Create new groupings as applicable, and move pull requests between. +- When multiple pull requests relate to the same task (such as a follow-up pull request), try to combine them to a single entry. +- If subtasks of a related set of pull requests are substantial, consider organizing as entries in a nested list. +- Remove mobile app pull request entries. Once you have cleaned up the changelog, choose a few features to highlight in the release post and record an animation of them in use. @@ -190,29 +190,38 @@ Creating a release involves: You'll need to use Subversion to publish the plugin to WordPress.org. 1. Do an SVN checkout of `https://wordpress.org/plugins/gutenberg/trunk`: - * If this is your first checkout, run: `svn checkout https://plugins.svn.wordpress.org/gutenberg/trunk` - * If you already have a copy, run: `svn up` + +- If this is your first checkout, run: `svn checkout https://plugins.svn.wordpress.org/gutenberg/trunk` +- If you already have a copy, run: `svn up` + 2. Delete the contents except for the `readme.txt` and `changelog.txt` files (these files don’t exist in the `git` repo, only in Subversion). 3. Extract the contents of the zip file. 4. Edit `readme.txt`, replacing the changelog for the previous version with the current release's changelog. 5. Add the changelog for the current release to `changelog.txt`. 6. Add new files/remove deleted files from the repository: + ```bash # Add new files: svn st | grep '^\?' | awk '{print $2}' | xargs svn add # add the -r option to xargs if you use a linux-based OS # Delete old files: svn st | grep '^!' | awk '{print $2}' | xargs svn rm # add the -r option to xargs if you use a linux-based OS ``` + 7. Commit the new version: + ```bash # Replace X.X.X with your version: svn ci -m "Committing Gutenberg version X.X.X" ``` + 8. Tag the new version: + ```bash svn cp https://plugins.svn.wordpress.org/gutenberg/trunk https://plugins.svn.wordpress.org/gutenberg/tags/X.X.X -m "Tagging Gutenberg version X.X.X" ``` + 9. Edit `readme.txt` to point to the new tag. The **Stable version** header in `readme.txt` should be updated to match the new release version number. After updating and committing that, the new version should be released: + ```bash svn ci -m "Releasing Gutenberg version X.X.X" ``` @@ -232,8 +241,9 @@ If you don't have access to [make.wordpress.org/core](https://make.wordpress.org The Gutenberg repository mirrors the [WordPress SVN repository](https://make.wordpress.org/core/handbook/about/release-cycle/) in terms of branching for each SVN branch, a corresponding Gutenberg `wp/*` branch is created: -- The `wp/trunk` branch contains all the packages that are published and used in the `trunk` branch of WordPress. -- A Gutenberg branch targeting a specific WordPress major release (including its further minor increments) is created (example `wp/5.2`) based on the `wp/trunk` Gutenberg branch when the corresponding WordPress release branch is created. (This usually happens when the first `RC` of the next WordPress major version is released). +- The `wp/trunk` branch contains the same version of packages published to npm with the `latest` distribution tag. The WordPress core consumes those packages directly in the `trunk` branch and uses them for public releases. +- The `wp/next` branch contains the same version of packages published to npm with the `next` distribution tag. Projects should use those packages for development purposes only. +- A Gutenberg branch targeting a specific WordPress major release (including its further minor increments) is created (example `wp/5.2`) based on the `wp/trunk` Gutenberg branch when the corresponding WordPress release branch is created. (This usually happens when the first `RC` of the next WordPress major version is released). ### Synchronizing WordPress Trunk @@ -241,7 +251,7 @@ For each Gutenberg plugin release, WordPress trunk should be synchronized. Note The process has three steps: 1) update the `wp/trunk` branch within the Gutenberg repo 2) publish the new package versions to npm 3) update the WordPress `trunk` branch. -The first step is automated via `./bin/plugin/cli.js npm-stable` command. You only have to run the command, but, for the record, the manual process would look like this: +The first step is automated via `./bin/plugin/cli.js npm-latest` command. You only have to run the command, but, for the record, the manual process would look very close to the following steps: 1. Ensure the WordPress `trunk` branch is open for enhancements. 2. Get the last published Gutenberg release branch with `git fetch`. @@ -249,26 +259,22 @@ The first step is automated via `./bin/plugin/cli.js npm-stable` command. You on 4. Remove all files from the current branch: `git rm -r .`. 5. Check out all the files from the release branch: `git checkout release/x.x -- .`. 6. Commit all changes to the `wp/trunk` branch with `git commit -m "Merge changes published in the Gutenberg plugin vX.X release"` and push to the repository. -7. Update the `CHANGELOG.md` files of the packages with the new publish version calculated and commit to the `wp/trunk` branch. Assuming the package versions are written using this format `major.minor.patch`, make sure to bump at least the `minor` version number. For example, if the CHANGELOG of the package to be released indicates that the next unreleased version is `5.6.1`, choose `5.7.0` as a version in case of `minor` version. This is important as the patch version numbers should be reserved in case bug fixes are needed for a minor WordPress release (see below). - -Once the command is finished, you can start the second part: publishing the npm packages. +7. Update the `CHANGELOG.md` files of the packages with the new publish version calculated and commit to the `wp/trunk` branch. Assuming the package versions are written using this format `major.minor.patch`, make sure to bump at least the `minor` version number after every major WordPress release. For example, if the CHANGELOG of the package to be released indicates that the next unreleased version is `5.6.1`, choose `5.7.0` as a version in case of `minor` version. This is important as the patch version numbers should be reserved in case bug fixes are needed for a minor WordPress release (see below). +8. Log-in to npm via the console: `npm login`. Note that you should have 2FA enabled. +9. From the `wp/trunk` branch, install npm dependencies with `npm ci`. +10. Run the script `npm run publish:prod`. + - When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. + - You'll be asked for your One-Time Password (OTP) a couple of times. This is the code from the 2FA authenticator app you use. Depending on how many packages are to be released you may be asked for more than one OTP, as they tend to expire before all packages are released. + - If the publishing process ends up incomplete (perhaps because it timed-out or an bad OTP was introduce) you can resume it via [`lerna publish from-package`](https://github.com/lerna/lerna/tree/master/commands/publish#bump-from-package). -1. Update your local `wp/trunk` branch with the latest changes pushed to GitHub. -2. Log-in to npm via the console: `npm login`. Note that you should have 2FA enabled. -3. From the `wp/trunk` branch, run the script `npm run publish:prod`. - - When asked for the version numbers to choose for each package pick the values of the updated CHANGELOG files. - - You'll be asked for your One-Time Password (OTP) a couple of times. This is the code from the 2FA authenticator app you use. Depending on how many packages are to be released you may be asked for more than one OTP, as they tend to expire before all packages are released. - - If the publishing process ends up incomplete (perhaps because it timed-out or an bad OTP was introduce) you can resume it via [`lerna publish from-package`](https://github.com/lerna/lerna/tree/master/commands/publish#bump-from-package). -4. Cherry-pick the commits created by lerna ("Publish" and the CHANGELOG update) into the `master` branch of Gutenberg. - -Finally, now that the npm packages are ready, a patch can be created and committed into WordPress `trunk`. +Finally, now that the npm packages are ready, a patch can be created and committed into WordPress `trunk`. You should also cherry-pick the commits created by lerna ("Publish" and the CHANGELOG update) into the main branch of Gutenberg. ### Minor WordPress Releases The following workflow is needed when bug fixes or security releases need to be backported into WordPress Core. This can happen in a few use-cases: -- During the `beta` and the `RC` period of the WordPress release cycle. -- For WordPress minor releases and WordPress security releases (example `5.1.1`). +- During the `beta` and the `RC` period of the WordPress release cycle. +- For WordPress minor releases and WordPress security releases (example `5.1.1`). 1. Check out the relevant WordPress major branch (If the minor release is 5.2.1, check out `wp/5.2`). 2. Create a feature branch from that branch, and cherry-pick the merge commits for the needed bug fixes onto it. @@ -299,30 +305,35 @@ Identify the commit hashes from the pull requests that need to be ported from th The `wp/trunk` branch now needs to be prepared to release and publish the packages to _npm_. Open a terminal and perform the following steps: + 1. `git checkout master` 2. `git pull` 3. `git checkout wp/trunk` 4. `git pull` Before porting commits check that the `wp/trunk` branch does not have any outstanding packages waiting to be published: + 1. `git checkout wp/trunk` 2. `npm run publish:check` Now _cherry-pick_ the commits from `master` to `wp/trunk`, use `-m 1 commithash` if the commit was a pull request merge commit: + 1. `git cherry-pick -m 1 cb150a2` 2. `git push` Whilst waiting for the GitHub actions build for `wp/trunk`[branch to pass](https://github.com/WordPress/gutenberg/actions?query=branch%3Awp%2Ftrunk), identify and begin updating the `CHANGELOG.md` files: + 1. `git checkout wp/trunk` 2. `npm run publish:check` -> Example -> ```shell -> npm run publish:check -> @wordpress/e2e-tests -> @wordpress/jest-preset-default -> @wordpress/scripts -> lerna success found 3 packages ready to publish -> ``` + > Example + > + > ```shell + > npm run publish:check + > @wordpress/e2e-tests + > @wordpress/jest-preset-default + > @wordpress/scripts + > lerna success found 3 packages ready to publish + > ``` Check the versions listed in the current `CHANGELOG.md` file, looking through the commit history of a package e.g [@wordpress/scripts](https://github.com/WordPress/gutenberg/commits/master/packages/scripts) and look out for _"chore(release): publish"_ and _"Update changelogs"_ commits to determine recent version bumps, then looking at the commits since the most recent release should aid with discovering what changes have occurred since the last release. @@ -335,72 +346,77 @@ Begin updating the _changelogs_ based on the [Maintaining Changelogs](https://gi 3. Stage the _changelog_ changes `git add packages/` 4. `git commit -m "Update changelogs"` 5. Make a note of the commit hash of this commit -> Example -> ``` -> [master 278f524f16] Update changelogs` 278f524 -> ``` + > Example + > + > ``` + > [master 278f524f16] Update changelogs` 278f524 + > ``` 6. `git push` Now that the changes have been committed to the `wp/trunk` branch and the Travis CI builds for the `wp/trunk` [branch are passing](https://travis-ci.com/WordPress/gutenberg/branches) it's time to publish the packages to npm: + 1. Once again run `npm run publish:check` to confirm there are no unexpected packages ready to be published: -> Example -> ```shell -> npm run publish:check -> @wordpress/e2e-tests -> @wordpress/jest-preset-default -> @wordpress/scripts -> lerna success found 3 packages ready to publish -> ``` + > Example + > + > ```shell + > npm run publish:check + > @wordpress/e2e-tests + > @wordpress/jest-preset-default + > @wordpress/scripts + > lerna success found 3 packages ready to publish + > ``` 2. Run the [package release process] but when asked for the version numbers to choose for each package use the versions you made note of above when updating each packages `CHANGELOG.md` file. -> Truncated example of publishing process output -> ``` -> npm run publish:prod -> -> Build Progress: [==============================] 100% -> lerna notice cli v3.18.2 -> lerna info versioning independent -> ? Select a new version for @wordpress/e2e-tests (currently 1.9.0) Patch (1.9.1) -> ? Select a new version for @wordpress/jest-preset-default (currently 5.3.0) Patch (5.3.1) -> ? Select a new version for @wordpress/scripts (currently 6.1.0) Patch (6.1.1) -> -> Changes: -> - @wordpress/e2e-tests: 1.9.0 => 1.9.1 -> - @wordpress/jest-preset-default: 5.3.0 => 5.3.1 -> - @wordpress/scripts: 6.1.0 => 6.1.1 -> -> ? Are you sure you want to publish these packages? Yes -> lerna info execute Skipping releases -> lerna info git Pushing tags... -> lerna info publish Publishing packages to npm... -> lerna info Verifying npm credentials -> lerna info Checking two-factor auth mode -> ? Enter OTP: 753566 -> lerna success published @wordpress/jest-preset-default 5.3.1 -> lerna success published @wordpress/scripts 6.1.1 -> lerna success published @wordpress/e2e-tests 1.9.1 -> Successfully published: -> - @wordpress/e2e-tests@1.9.1 -> - @wordpress/jest-preset-default@5.3.1 -> - @wordpress/scripts@6.1.1 -> lerna success published 3 packages -> ``` + > Truncated example of publishing process output + > + > ``` + > npm run publish:prod + > + > Build Progress: [==============================] 100% + > lerna notice cli v3.18.2 + > lerna info versioning independent + > ? Select a new version for @wordpress/e2e-tests (currently 1.9.0) Patch (1.9.1) + > ? Select a new version for @wordpress/jest-preset-default (currently 5.3.0) Patch (5.3.1) + > ? Select a new version for @wordpress/scripts (currently 6.1.0) Patch (6.1.1) + > + > Changes: + > - @wordpress/e2e-tests: 1.9.0 => 1.9.1 + > - @wordpress/jest-preset-default: 5.3.0 => 5.3.1 + > - @wordpress/scripts: 6.1.0 => 6.1.1 + > + > ? Are you sure you want to publish these packages? Yes + > lerna info execute Skipping releases + > lerna info git Pushing tags... + > lerna info publish Publishing packages to npm... + > lerna info Verifying npm credentials + > lerna info Checking two-factor auth mode + > ? Enter OTP: 753566 + > lerna success published @wordpress/jest-preset-default 5.3.1 + > lerna success published @wordpress/scripts 6.1.1 + > lerna success published @wordpress/e2e-tests 1.9.1 + > Successfully published: + > - @wordpress/e2e-tests@1.9.1 + > - @wordpress/jest-preset-default@5.3.1 + > - @wordpress/scripts@6.1.1 + > lerna success published 3 packages + > ``` Now that the packages have been published the _"chore(release): publish"_ and _"Update changelogs"_ commits to `wp/trunk` need to be ported to the `master` branch: + 1. `git checkout master` 2. `git pull` 3. Cherry-pick the `278f524`hash you noted above from the _"Update changelogs"_ commit made to `wp/trunk` 4. `git cherry-pick 278f524` 5. Get the commit hash from the the lerna publish commit either from the terminal or [wp/trunk commits](https://github.com/WordPress/gutenberg/commits/wp/trunk) -6. Cherry-pick the `fe6ae0d` "chore(release): publish"_ commit made to `wp/trunk` +6. Cherry-pick the `fe6ae0d` "chore(release): publish"\_ commit made to `wp/trunk` 7. `git cherry-pick fe6ae0d` 8. `git push` Confirm the packages dependencies do not contain `file://` links in the `dependencies` or `devdependencies` section of the packages released, e.g: -> https://unpkg.com/browse/@wordpress/jest-preset-default@5.3.1/package.json -> https://unpkg.com/browse/@wordpress/scripts@6.1.1/package.json -> https://unpkg.com/browse/@wordpress/jest-preset-default@5.3.1/package.json + +> https://unpkg.com/browse/@wordpress/jest-preset-default@5.3.1/package.json > https://unpkg.com/browse/@wordpress/scripts@6.1.1/package.json > https://unpkg.com/browse/@wordpress/jest-preset-default@5.3.1/package.json Time to announce the published changes in the #core-js and #core-editor Slack channels + > ``` > 📣 Successfully published: > • @wordpress/e2e-tests@1.9.1 @@ -409,7 +425,7 @@ Time to announce the published changes in the #core-js and #core-editor Slack ch > Lerna success published 3 packages > ``` ---------- +--- Ta-da! 🎉 diff --git a/package.json b/package.json index 311294a1aa46d8..a95a6a7d9a4460 100644 --- a/package.json +++ b/package.json @@ -239,10 +239,10 @@ "native": "npm run --prefix packages/react-native-editor", "pot-to-php": "./bin/pot-to-php.js", "postinstall": "patch-package && node ./patches/patch-xcode.js", + "prepublishOnly": "npm run clean:package-types && npm run build:packages", "publish:check": "lerna updated", - "publish:dev": "npm run clean:package-types && npm run build:packages && lerna publish prerelease --preid rc --dist-tag next", - "publish:patch": "npm run clean:package-types && npm run build:packages && lerna publish --dist-tag patch", - "publish:prod": "npm run clean:package-types && npm run build:packages && lerna publish", + "publish:patch": "lerna publish --dist-tag patch", + "publish:prod": "lerna publish", "test": "npm run lint && npm run test-unit", "test:create-block": "./bin/test-create-block.sh", "test-e2e": "wp-scripts test-e2e --config packages/e2e-tests/jest.config.js", From 592d867abaa6ec4148fea4894694bc65e3c11cd4 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Wed, 20 Jan 2021 12:08:28 +0100 Subject: [PATCH 33/61] Chore: Tweaks to the npm publishing script --- bin/plugin/commands/packages.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/bin/plugin/commands/packages.js b/bin/plugin/commands/packages.js index b34c70dc71fbf9..93a266fe815c56 100644 --- a/bin/plugin/commands/packages.js +++ b/bin/plugin/commands/packages.js @@ -299,15 +299,14 @@ async function publishPackagesToNpm( * @return {Promise} Github release object. */ async function prepareForPackageRelease( isPrerelease ) { - // This is a variable that contains the abort message shown when the script is aborted. - let abortMessage = 'Aborting!'; - const temporaryFolders = []; - await askForConfirmation( 'Ready to go? ' ); + await askForConfirmation( 'Ready to go?' ); // Cloning the Git repository. + const abortMessage = 'Aborting!'; const gitWorkingDirectoryPath = await runGitRepositoryCloneStep( abortMessage ); + const temporaryFolders = []; temporaryFolders.push( gitWorkingDirectoryPath ); // Checking out the WordPress release branch and doing sync with the last plugin release. @@ -334,23 +333,19 @@ async function prepareForPackageRelease( isPrerelease ) { abortMessage ); - abortMessage = `Aborting! Make sure to push changes applied to WordPress release branch "${ releaseBranch }" manually.`; await runPushGitChangesStep( gitWorkingDirectoryPath, releaseBranch, - abortMessage + `Aborting! Make sure to push changes applied to WordPress release branch "${ releaseBranch }" manually.` ); - abortMessage = `Aborting! Make sure to finish publishing to npm manually.`; await publishPackagesToNpm( gitWorkingDirectoryPath, minimumVersionBump, - isPrerelease, - abortMessage + isPrerelease ); - abortMessage = 'Aborting! The publishing is finished though.'; - await runCleanLocalFoldersStep( temporaryFolders, abortMessage ); + await runCleanLocalFoldersStep( temporaryFolders, 'Cleaning failed.' ); } /** From f5cf72e321a56f1b2916c6b8f43b3f17350dfaee Mon Sep 17 00:00:00 2001 From: Luke Walczak Date: Wed, 20 Jan 2021 12:42:39 +0100 Subject: [PATCH 34/61] [RNMobile] Performance improvements in LatestPosts related controls (#28205) * Performance improvements in LatestPosts related controls * Use memo directly from wordpress/element package --- .../src/latest-posts/edit.native.js | 2 +- .../src/mobile/picker/index.android.js | 44 ++--- .../src/query-controls/category-select.js | 9 +- .../src/query-controls/index.native.js | 152 ++++++++++-------- .../src/range-control/index.native.js | 104 ++++++------ .../src/select-control/index.native.js | 60 +++---- .../src/toggle-control/index.native.js | 44 +++-- packages/components/src/tree-select/index.js | 15 +- 8 files changed, 234 insertions(+), 196 deletions(-) diff --git a/packages/block-library/src/latest-posts/edit.native.js b/packages/block-library/src/latest-posts/edit.native.js index 7ebd7557e3d8da..0aefc6b889cb91 100644 --- a/packages/block-library/src/latest-posts/edit.native.js +++ b/packages/block-library/src/latest-posts/edit.native.js @@ -219,7 +219,7 @@ class LatestPostsEdit extends Component { onPress={ openGeneralSidebar } > - { this.getInspectorControls() } + { isSelected && this.getInspectorControls() } { blockType.settings.title } diff --git a/packages/components/src/mobile/picker/index.android.js b/packages/components/src/mobile/picker/index.android.js index b536dc2aed9c00..16bc8afdc54e71 100644 --- a/packages/components/src/mobile/picker/index.android.js +++ b/packages/components/src/mobile/picker/index.android.js @@ -9,7 +9,7 @@ import { View } from 'react-native'; import { __ } from '@wordpress/i18n'; import { Component } from '@wordpress/element'; import { usePreferredColorSchemeStyle } from '@wordpress/compose'; -import { PanelBody } from '@wordpress/components'; +import { PanelBody, TextControl } from '@wordpress/components'; /** * Internal dependencies @@ -51,8 +51,27 @@ export default class Picker extends Component { this.onClose(); } + getOptions() { + const { options, leftAlign } = this.props; + + return options.map( ( option ) => ( + + { options.length > 1 && option.separated && } + this.onCellPress( option.value ) } + disabled={ option.disabled } + style={ option.disabled && styles.disabled } + /> + + ) ); + } + render() { - const { options, leftAlign, hideCancelButton, title } = this.props; + const { hideCancelButton, title } = this.props; const { isVisible } = this.state; return ( @@ -63,26 +82,9 @@ export default class Picker extends Component { hideHeader > - { options.map( ( option ) => ( - - { options.length > 1 && option.separated && ( - - ) } - - this.onCellPress( option.value ) - } - disabled={ option.disabled } - style={ option.disabled && styles.disabled } - /> - - ) ) } + { this.getOptions() } { ! hideCancelButton && ( - { + return buildTermsTree( categoriesList ); + }, [ categoriesList ] ); + return ( { - const [ newOrderBy, newOrder ] = value.split( '/' ); - if ( newOrder !== order ) { - onOrderChange( newOrder ); - } - if ( newOrderBy !== orderBy ) { - onOrderByChange( newOrderBy ); - } - } } - /> - ), - onCategoryChange && ( - - ), - onNumberOfItemsChange && ( - - ), - ]; -} +const options = [ + { + label: __( 'Newest to oldest' ), + value: 'date/desc', + }, + { + label: __( 'Oldest to newest' ), + value: 'date/asc', + }, + { + /* translators: label for ordering posts by title in ascending order */ + label: __( 'A → Z' ), + value: 'title/asc', + }, + { + /* translators: label for ordering posts by title in descending order */ + label: __( 'Z → A' ), + value: 'title/desc', + }, +]; + +const QueryControls = memo( + ( { + categoriesList, + selectedCategoryId, + numberOfItems, + order, + orderBy, + maxItems = DEFAULT_MAX_ITEMS, + minItems = DEFAULT_MIN_ITEMS, + onCategoryChange, + onNumberOfItemsChange, + onOrderChange, + onOrderByChange, + } ) => { + const onChange = useCallback( + ( value ) => { + const [ newOrderBy, newOrder ] = value.split( '/' ); + if ( newOrder !== order ) { + onOrderChange( newOrder ); + } + if ( newOrderBy !== orderBy ) { + onOrderByChange( newOrderBy ); + } + }, + [ order, orderBy, onOrderByChange, onOrderChange ] + ); + + return [ + onOrderChange && onOrderByChange && ( + + ), + onCategoryChange && ( + + ), + onNumberOfItemsChange && ( + + ), + ]; + } +); + +export default QueryControls; diff --git a/packages/components/src/range-control/index.native.js b/packages/components/src/range-control/index.native.js index 9488fdad160879..4717502785561d 100644 --- a/packages/components/src/range-control/index.native.js +++ b/packages/components/src/range-control/index.native.js @@ -1,64 +1,70 @@ +/** + * WordPress dependencies + */ +import { memo } from '@wordpress/element'; /** * Internal dependencies */ import RangeCell from '../mobile/bottom-sheet/range-cell'; import StepperCell from '../mobile/bottom-sheet/stepper-cell'; -function RangeControl( { - className, - currentInput, - label, - value, - instanceId, - onChange, - beforeIcon, - afterIcon, - help, - allowReset, - initialPosition, - min, - max, - type, - separatorType, - ...props -} ) { - if ( type === 'stepper' ) { +const RangeControl = memo( + ( { + className, + currentInput, + label, + value, + instanceId, + onChange, + beforeIcon, + afterIcon, + help, + allowReset, + initialPosition, + min, + max, + type, + separatorType, + ...props + } ) => { + if ( type === 'stepper' ) { + return ( + + ); + } + const id = `inspector-range-control-${ instanceId }`; + const currentInputValue = currentInput === null ? value : currentInput; + const initialSliderValue = isFinite( currentInputValue ) + ? currentInputValue + : initialPosition; + return ( - ); } - const id = `inspector-range-control-${ instanceId }`; - const currentInputValue = currentInput === null ? value : currentInput; - const initialSliderValue = isFinite( currentInputValue ) - ? currentInputValue - : initialPosition; - - return ( - - ); -} +); export default RangeControl; diff --git a/packages/components/src/select-control/index.native.js b/packages/components/src/select-control/index.native.js index 55b6064dfc1013..ee4ef01f15ab66 100644 --- a/packages/components/src/select-control/index.native.js +++ b/packages/components/src/select-control/index.native.js @@ -1,35 +1,41 @@ +/** + * WordPress dependencies + */ +import { memo } from '@wordpress/element'; /** * Internal dependencies */ import PickerCell from '../mobile/bottom-sheet/picker-cell'; -function SelectControl( { - help, - instanceId, - label, - multiple = false, - onChange, - options = [], - className, - hideLabelFromVision, - ...props -} ) { - const id = `inspector-select-control-${ instanceId }`; +const SelectControl = memo( + ( { + help, + instanceId, + label, + multiple = false, + onChange, + options = [], + className, + hideLabelFromVision, + ...props + } ) => { + const id = `inspector-select-control-${ instanceId }`; - return ( - - ); -} + return ( + + ); + } +); export default SelectControl; diff --git a/packages/components/src/toggle-control/index.native.js b/packages/components/src/toggle-control/index.native.js index b6ed81df13748f..0466abcf840302 100644 --- a/packages/components/src/toggle-control/index.native.js +++ b/packages/components/src/toggle-control/index.native.js @@ -1,31 +1,29 @@ +/** + * WordPress dependencies + */ +import { memo } from '@wordpress/element'; /** * Internal dependencies */ import SwitchCell from '../mobile/bottom-sheet/switch-cell'; -function ToggleControl( { - label, - checked, - help, - instanceId, - className, - onChange, - ...props -} ) { - const id = `inspector-toggle-control-${ instanceId }`; +const ToggleControl = memo( + ( { label, checked, help, instanceId, className, onChange, ...props } ) => { + const id = `inspector-toggle-control-${ instanceId }`; - return ( - - ); -} + return ( + + ); + } +); export default ToggleControl; diff --git a/packages/components/src/tree-select/index.js b/packages/components/src/tree-select/index.js index 20fe2a158c69a8..ef33f42584e380 100644 --- a/packages/components/src/tree-select/index.js +++ b/packages/components/src/tree-select/index.js @@ -3,6 +3,10 @@ */ import { unescape as unescapeString, repeat, flatMap, compact } from 'lodash'; +/** + * WordPress dependencies + */ +import { useMemo } from '@wordpress/element'; /** * Internal dependencies */ @@ -27,10 +31,13 @@ export default function TreeSelect( { tree, ...props } ) { - const options = compact( [ - noOptionLabel && { value: '', label: noOptionLabel }, - ...getSelectOptions( tree ), - ] ); + const options = useMemo( () => { + return compact( [ + noOptionLabel && { value: '', label: noOptionLabel }, + ...getSelectOptions( tree ), + ] ); + }, [ noOptionLabel, tree ] ); + return ( Date: Wed, 20 Jan 2021 14:05:46 +0100 Subject: [PATCH 35/61] Testing: Add CI workflow covering Node.js 12 (#28139) * Testing: Add CI workflow covering Node.js 12 * Use matrix for different node versions * Use matrix for node 12 and 14 with unit tests --- .github/workflows/create-block.yml | 16 +++++++++------- .github/workflows/unit-test.yml | 13 ++++++++----- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml index 65a39db4936932..4fc7ac75107a80 100644 --- a/.github/workflows/create-block.yml +++ b/.github/workflows/create-block.yml @@ -7,16 +7,20 @@ on: - '!packages/**/test/**' - '!packages/**/*.md' push: - branches: [master] + branches: [master, wp/trunk] paths: - 'packages/**' - '!packages/**/test/**' - '!packages/**/*.md' jobs: - build: - + checks: + name: Checks runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: [12, 14] steps: - uses: actions/checkout@v2 @@ -34,14 +38,12 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - - name: Use Node.js 14.x + - name: Use Node.js ${{ matrix.node }}.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: ${{ matrix.node }} - name: npm install, build, format and lint run: | npm ci npm run test:create-block - env: - CI: true diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 35aa4c4a1a34b8..7698f455132744 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -5,15 +5,18 @@ on: paths-ignore: - '**.md' push: - branches: [master] + branches: [master, wp-trunk] paths-ignore: - '**.md' jobs: unit-js: name: JavaScript - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: [12, 14] steps: - uses: actions/checkout@v2 @@ -31,10 +34,10 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - - name: Use Node.js 14.x + - name: Use Node.js ${{ matrix.node }}.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: ${{ matrix.node }} - name: Npm install and build # It's not necessary to run the full build, since Jest can interpret @@ -92,7 +95,7 @@ jobs: - name: Running single site unit tests run: npm run test-unit-php if: ${{ success() || failure() }} - + - name: Running multisite unit tests run: npm run test-unit-php-multisite if: ${{ success() || failure() }} From a5a35f701e33f2d0b985d429e4bf145b913147f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Wed, 20 Jan 2021 14:16:28 +0100 Subject: [PATCH 36/61] Docs: Update links used in the developer portal (#28354) * Docs: Update links used in the developer portal * Update docs/contributors/document.md * Update docs/contributors/reference.md --- docs/architecture/automated-testing.md | 18 +-- docs/contributors/coding-guidelines.md | 4 +- docs/contributors/reference.md | 9 +- docs/contributors/triage.md | 132 +++++++++--------- .../backward-compatibility/deprecations.md | 6 +- .../submitting-to-block-directory.md | 60 ++++---- packages/README.md | 2 +- 7 files changed, 120 insertions(+), 111 deletions(-) diff --git a/docs/architecture/automated-testing.md b/docs/architecture/automated-testing.md index 803af58e17c0d8..4ca6555c8fbfb9 100644 --- a/docs/architecture/automated-testing.md +++ b/docs/architecture/automated-testing.md @@ -6,15 +6,15 @@ There exists a rich ecosystem of tooling available for web-based end-to-end auto These include: -- **Interoperability with existing testing framework**. Puppeteer is "just" a tool for controlling a Chrome browser, and makes no assumptions about how it's integrated into a testing environment. While this requires some additional effort in ensuring the test environment is available, it also allows for cohesion in how it integrates with an existing setup. Gutenberg is able to consistently use Jest for both unit testing and end-to-end testing. This is contrasted with other solutions like Cypress, which provide their own testing framework and assertion library as part of an all-in-one solution. -- **An expressive but predictable API**. Puppeteer strikes a nice balance between low-level access to browser behavior, while retaining an expressive API for issuing and awaiting responses to those commands using modern JavaScript [`async` and `await` syntax](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await). This is contrasted with other solutions, which either don't support or leverage native language async functionality, don't expose direct access to the browser, or leverage custom domain-specific language syntaxes for expressing browser commands and assertions. The fact that Puppeteer largely targets the Chrome browser is non-ideal in how it does not provide full browser coverage. On the other hand, the limited set of browser targets offers more consistent results and stronger guarantees about how code is evaluated in the browser environment. -- **Surfacing bugs, not obscuring them**. Many alternative solutions offer options to automatically await settled network requests or asynchronous appearance of elements on the page. While this can serve as a convenience in accounting for unpredictable delays, it can also unknowingly cause oversight of legitimate user-facing issues. For example, if an element will only appear on the page after some network request or computation has completed, it may be easy to overlook that these delays can cause unpredictable and frustrating behavior for users ([example](https://github.com/WordPress/gutenberg/pull/11287)). Given that developers often test on high-end hardware and stable network connections, consideration of resiliency on low-end hardware or spotty network availability is not always on the forefront of one's considerations. Puppeteer forces us to acknowledge these delays with explicit `waitFor*` expressions, putting us in much greater alignment with the real-world experience of an end-user. -- **Debugging**. It's important that in that case that a test fails, there should be straight-forward means to diagnose and resolve the issue. While its offerings are rather simplistic relative to the competition, Puppeteer does expose options to run tests as "headful" (with the browser visible) and with delayed actions. Combined with the fact that it interoperates well with native language / runtime features (e.g. debugger statements or breakpoints), this provides developers with sufficient debugging access. +- **Interoperability with existing testing framework**. Puppeteer is "just" a tool for controlling a Chrome browser, and makes no assumptions about how it's integrated into a testing environment. While this requires some additional effort in ensuring the test environment is available, it also allows for cohesion in how it integrates with an existing setup. Gutenberg is able to consistently use Jest for both unit testing and end-to-end testing. This is contrasted with other solutions like Cypress, which provide their own testing framework and assertion library as part of an all-in-one solution. +- **An expressive but predictable API**. Puppeteer strikes a nice balance between low-level access to browser behavior, while retaining an expressive API for issuing and awaiting responses to those commands using modern JavaScript [`async` and `await` syntax](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await). This is contrasted with other solutions, which either don't support or leverage native language async functionality, don't expose direct access to the browser, or leverage custom domain-specific language syntaxes for expressing browser commands and assertions. The fact that Puppeteer largely targets the Chrome browser is non-ideal in how it does not provide full browser coverage. On the other hand, the limited set of browser targets offers more consistent results and stronger guarantees about how code is evaluated in the browser environment. +- **Surfacing bugs, not obscuring them**. Many alternative solutions offer options to automatically await settled network requests or asynchronous appearance of elements on the page. While this can serve as a convenience in accounting for unpredictable delays, it can also unknowingly cause oversight of legitimate user-facing issues. For example, if an element will only appear on the page after some network request or computation has completed, it may be easy to overlook that these delays can cause unpredictable and frustrating behavior for users ([example](https://github.com/WordPress/gutenberg/pull/11287)). Given that developers often test on high-end hardware and stable network connections, consideration of resiliency on low-end hardware or spotty network availability is not always on the forefront of one's considerations. Puppeteer forces us to acknowledge these delays with explicit `waitFor*` expressions, putting us in much greater alignment with the real-world experience of an end-user. +- **Debugging**. It's important that in that case that a test fails, there should be straight-forward means to diagnose and resolve the issue. While its offerings are rather simplistic relative to the competition, Puppeteer does expose options to run tests as "headful" (with the browser visible) and with delayed actions. Combined with the fact that it interoperates well with native language / runtime features (e.g. debugger statements or breakpoints), this provides developers with sufficient debugging access. For more context, refer to the following resources: -- [Testing Overview: End-to-End Testing](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/testing-overview.md#end-to-end-testing) -- [Testing: Experiment with Puppeteer for E2E testing](https://github.com/WordPress/gutenberg/pull/5618) - - In early iterations, the contributing team opted to use Cypress for end-to-end testing. This pull request outlines problems with the approach, and proposed the initial transition to Puppeteer. -- [JavaScript Chat Summary: January 28, 2020](https://make.wordpress.org/core/2020/02/04/javascript-chat-summary-january-28-2020/) - - Playwright is a new offering created by many of the original contributors to Puppeteer. It offers increased browser coverage and improved reliability of tests. While still early in development at the time of this writing, there has been some interest in evaluating it for future use as an end-to-end testing solution. +- [Testing Overview: End-to-End Testing](/docs/contributors/testing-overview.md#end-to-end-testing) +- [Testing: Experiment with Puppeteer for E2E testing](https://github.com/WordPress/gutenberg/pull/5618) + - In early iterations, the contributing team opted to use Cypress for end-to-end testing. This pull request outlines problems with the approach, and proposed the initial transition to Puppeteer. +- [JavaScript Chat Summary: January 28, 2020](https://make.wordpress.org/core/2020/02/04/javascript-chat-summary-january-28-2020/) + - Playwright is a new offering created by many of the original contributors to Puppeteer. It offers increased browser coverage and improved reliability of tests. While still early in development at the time of this writing, there has been some interest in evaluating it for future use as an end-to-end testing solution. diff --git a/docs/contributors/coding-guidelines.md b/docs/contributors/coding-guidelines.md index 786f098717858e..b9c7581a511276 100644 --- a/docs/contributors/coding-guidelines.md +++ b/docs/contributors/coding-guidelines.md @@ -220,7 +220,7 @@ It is preferred to implement all components as [function components](https://rea ## JavaScript Documentation using JSDoc -Gutenberg follows the [WordPress JavaScript Documentation Standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/), with additional guidelines relevant for its distinct use of [import semantics](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#imports) in organizing files, the [use of TypeScript tooling](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/testing-overview.md#javascript-testing) for types validation, and automated documentation generation using [`@wordpress/docgen`](https://github.com/WordPress/gutenberg/tree/master/packages/docgen). +Gutenberg follows the [WordPress JavaScript Documentation Standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/), with additional guidelines relevant for its distinct use of [import semantics](/docs/contributors/coding-guidelines.md#imports) in organizing files, the [use of TypeScript tooling](/docs/contributors/testing-overview.md#javascript-testing) for types validation, and automated documentation generation using [`@wordpress/docgen`](https://github.com/WordPress/gutenberg/tree/master/packages/docgen). For additional guidance, consult the following resources: @@ -266,7 +266,7 @@ Note the use of quotes when defining a set of string literals. As in the [JavaSc Use the [TypeScript `import` function](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#import-types) to import type declarations from other files or third-party dependencies. -Since an imported type declaration can occupy an excess of the available line length and become verbose when referenced multiple times, you are encouraged to create an alias of the external type using a `@typedef` declaration at the top of the file, immediately following [the `import` groupings](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/coding-guidelines.md#imports). +Since an imported type declaration can occupy an excess of the available line length and become verbose when referenced multiple times, you are encouraged to create an alias of the external type using a `@typedef` declaration at the top of the file, immediately following [the `import` groupings](/docs/contributors/coding-guidelines.md#imports). ```js /** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */ diff --git a/docs/contributors/reference.md b/docs/contributors/reference.md index f93111ec56fc37..ad4acdcfb410ca 100644 --- a/docs/contributors/reference.md +++ b/docs/contributors/reference.md @@ -1,11 +1,12 @@ # Reference -- [Glossary](/docs/designers-developers/glossary.md) -- [Coding Guidelines](/docs/contributors/coding-guidelines.md) -- [Testing Overview](/docs/contributors/testing-overview.md) -- [Frequently Asked Questions](/docs/designers-developers/faq.md) +- [Glossary](/docs/designers-developers/glossary.md) +- [Coding Guidelines](/docs/contributors/coding-guidelines.md) +- [Testing Overview](/docs/contributors/testing-overview.md) +- [Frequently Asked Questions](/docs/designers-developers/faq.md) ## Logo + Gutenberg Logo Released under GPL license, made by [Cristel Rossignol](https://twitter.com/cristelrossi). diff --git a/docs/contributors/triage.md b/docs/contributors/triage.md index 47f9cdb82479bd..c44dc0a4b8843b 100644 --- a/docs/contributors/triage.md +++ b/docs/contributors/triage.md @@ -1,100 +1,106 @@ ### Get involved in triage + To keep the repository healthy, it needs to be triaged regularly. Triage is the practice of reviewing existing issues and pull requests to make sure they’re relevant, actionable, and have all the information they need. Anyone can help triage, although you’ll need to be a member of the triage team for the Gutenberg repository to modify an issue’s labels or edit its title. ### Join the triage team + The triage team is an open group of people with a particular role of making sure triage is done consistently across the Gutenberg repo. There are various types of triage which happen: -* Regular self triage sessions done by members on their own time. -* Organised triage sessions done as a group at a set time. You can [review the meetings page](https://make.wordpress.org/meetings/) to find these triage sessions and appropriate slack channels. -* Focused triage sessions on a specific board, label or feature. +- Regular self triage sessions done by members on their own time. +- Organised triage sessions done as a group at a set time. You can [review the meetings page](https://make.wordpress.org/meetings/) to find these triage sessions and appropriate slack channels. +- Focused triage sessions on a specific board, label or feature. These are the expectations of being a triage team member: -* You are expected to do some triage even if it is self triage at least once a week. -* As you can, try to join organized triage sessions. -* If you join the triage team to focus on a specific label or board, the expectation is that your focus will be there. Please make this known to fellow triage team members. +- You are expected to do some triage even if it is self triage at least once a week. +- As you can, try to join organized triage sessions. +- If you join the triage team to focus on a specific label or board, the expectation is that your focus will be there. Please make this known to fellow triage team members. -If you would like to join this team, simply ask in #core-editor [Slack](https://make.wordpress.org/chat/) at any time. +If you would like to join this team, simply ask in #core-editor [Slack](https://make.wordpress.org/chat/) at any time. ### Getting started -To start simply choose from one of these filtered lists below. Note: You can find most of these filters by selecting the “Sort” option from the [overall Issues page](https://github.com/wordpress/gutenberg/issues). -* All Gutenberg issues [without an assigned label](https://github.com/WordPress/gutenberg/issues?q=is%3Aopen+is%3Aissue+no%3Alabel+sort%3Aupdated-asc). Triaging by simply adding labels helps people focused on certain aspects of Gutenberg find relevant issues easier and start working on them. -* All Gutenberg pull requests [without an assigned label](https://github.com/WordPress/gutenberg/pulls?q=is%3Aopen+is%3Apr+no%3Alabel). This requires a level of comfortability with code. For more guidance on which labels are best to use, please [review this section on labeling pull requests](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/repository-management.md#pull-requests) for contributors. You can also always check with the person authoring the pull request to make sure the labels match what they are intending to do. -* [The least recently updated](https://github.com/WordPress/gutenberg/issues?q=is%3Aopen+is%3Aissue+sort%3Aupdated-asc) Gutenberg issues. Triaging issues that are getting old and possibly out of date keeps important work from being overlooked. -* All Gutenberg issues [with no comments](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+comments%3A0+). Triaging this list helps make sure all issues are acknowledged, and can help identify issues that may need more information or discussion before they are actionable. -* [The least commented](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-asc) on Gutenberg issues. Triaging this list helps the community figure out what things might still need traction for certain proposals. -* [The most commented](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-desc) on Gutenberg issues. If you feel comfortable chiming in and the conversation has stagnated, the best way to triage these kinds of issues is to summarize the discussion thus far and do your best to identify action items, blockers, etc. Triaging this list allows finding solutions to important and complex issues to move forward. -* You can also create your own custom set of filters on GitHub. If you have a filter you think might be useful for the community, feel free to submit a PR to add it to this list. +To start simply choose from one of these filtered lists below. Note: You can find most of these filters by selecting the “Sort” option from the [overall Issues page](https://github.com/wordpress/gutenberg/issues). +- All Gutenberg issues [without an assigned label](https://github.com/WordPress/gutenberg/issues?q=is%3Aopen+is%3Aissue+no%3Alabel+sort%3Aupdated-asc). Triaging by simply adding labels helps people focused on certain aspects of Gutenberg find relevant issues easier and start working on them. +- All Gutenberg pull requests [without an assigned label](https://github.com/WordPress/gutenberg/pulls?q=is%3Aopen+is%3Apr+no%3Alabel). This requires a level of comfortability with code. For more guidance on which labels are best to use, please [review this section on labeling pull requests](/docs/contributors/repository-management.md#pull-requests) for contributors. You can also always check with the person authoring the pull request to make sure the labels match what they are intending to do. +- [The least recently updated](https://github.com/WordPress/gutenberg/issues?q=is%3Aopen+is%3Aissue+sort%3Aupdated-asc) Gutenberg issues. Triaging issues that are getting old and possibly out of date keeps important work from being overlooked. +- All Gutenberg issues [with no comments](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+comments%3A0+). Triaging this list helps make sure all issues are acknowledged, and can help identify issues that may need more information or discussion before they are actionable. +- [The least commented](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-asc) on Gutenberg issues. Triaging this list helps the community figure out what things might still need traction for certain proposals. +- [The most commented](https://github.com/wordpress/gutenberg/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-desc) on Gutenberg issues. If you feel comfortable chiming in and the conversation has stagnated, the best way to triage these kinds of issues is to summarize the discussion thus far and do your best to identify action items, blockers, etc. Triaging this list allows finding solutions to important and complex issues to move forward. +- You can also create your own custom set of filters on GitHub. If you have a filter you think might be useful for the community, feel free to submit a PR to add it to this list. ### General triage process + When triaging, either one of the lists above or issues in general, work through issues one-by-one. Here are some steps you can perform for each issue: -* First search for duplicates. If the issue is duplicate, close it by commenting with “Duplicate of #” and add any relevant new details to the existing issue. (Don’t forget to search for duplicates among closed issues as well!). -* If the issue is missing labels, add some to better categorize it (requires proper permissions given after joining the triage team). A good starting place when adding labels is to apply one of the labels prefixed [Type] (e.g. [Type] Enhancement or [Type] Bug) to indicate what kind of issue it is. After that consider adding more descriptive labels. If the issue concerns a particular core block, add one of the labels prefixed [Block]. Or if the issue affects a particular feature there are [Feature] labels. Finally, there are labels that affect particular interest areas, like Accessibility and Internationalization. You can view all possible labels [here](https://github.com/WordPress/gutenberg/labels). -* If the title doesn’t communicate the issue clearly enough, edit it for clarity (requires proper permissions). Specifically, we’d recommend having the main feature the issue relates to in the beginning of the title ([example](https://github.com/WordPress/gutenberg/issues/6193)) and for the title to generally be as succinct yet descriptive as possible ([example](https://github.com/WordPress/gutenberg/issues/6193)). -* If it’s a bug report, test to confirm the report or add the Needs Testing label. If there is not enough information to confirm the report, add the [Status] Needs More Info label and ask for the details needed. It’s particularly beneficial when a bug report has steps for reproduction so ask the reporter to add those if they’re missing. -* Remove the [Status] Needs More Info if the author of the issue has responded with enough details. -* Close the issue with a note if it has a [Status] Needs More Info label but the author didn't respond in 2+ weeks. -* If there was a conversation on the issue but no actionable steps identified, follow up with the participants to see what’s actionable. Make sure to @ each participant when responding in a comment. -* If you feel comfortable triaging the issue further, then you can also: - * Check that the bug report is valid by debugging it to see if you can track down the technical specifics. - * Check if the issue is missing some detail and see if you can fill in those details. For instance, if a bug report is missing visual detail, it’s helpful to reproduce the issue locally and upload a screenshot or GIF. - * Consider adding the Good First Issue label if you believe this is a relatively easy issue for a first-time contributor to try to solve. - +- First search for duplicates. If the issue is duplicate, close it by commenting with “Duplicate of #” and add any relevant new details to the existing issue. (Don’t forget to search for duplicates among closed issues as well!). +- If the issue is missing labels, add some to better categorize it (requires proper permissions given after joining the triage team). A good starting place when adding labels is to apply one of the labels prefixed [Type] (e.g. [Type] Enhancement or [Type] Bug) to indicate what kind of issue it is. After that consider adding more descriptive labels. If the issue concerns a particular core block, add one of the labels prefixed [Block]. Or if the issue affects a particular feature there are [Feature] labels. Finally, there are labels that affect particular interest areas, like Accessibility and Internationalization. You can view all possible labels [here](https://github.com/WordPress/gutenberg/labels). +- If the title doesn’t communicate the issue clearly enough, edit it for clarity (requires proper permissions). Specifically, we’d recommend having the main feature the issue relates to in the beginning of the title ([example](https://github.com/WordPress/gutenberg/issues/6193)) and for the title to generally be as succinct yet descriptive as possible ([example](https://github.com/WordPress/gutenberg/issues/6193)). +- If it’s a bug report, test to confirm the report or add the Needs Testing label. If there is not enough information to confirm the report, add the [Status] Needs More Info label and ask for the details needed. It’s particularly beneficial when a bug report has steps for reproduction so ask the reporter to add those if they’re missing. +- Remove the [Status] Needs More Info if the author of the issue has responded with enough details. +- Close the issue with a note if it has a [Status] Needs More Info label but the author didn't respond in 2+ weeks. +- If there was a conversation on the issue but no actionable steps identified, follow up with the participants to see what’s actionable. Make sure to @ each participant when responding in a comment. +- If you feel comfortable triaging the issue further, then you can also: + - Check that the bug report is valid by debugging it to see if you can track down the technical specifics. + - Check if the issue is missing some detail and see if you can fill in those details. For instance, if a bug report is missing visual detail, it’s helpful to reproduce the issue locally and upload a screenshot or GIF. + - Consider adding the Good First Issue label if you believe this is a relatively easy issue for a first-time contributor to try to solve. + **Commonly Used Labels** Generally speaking, the following labels are very useful for triaging issues and will likely be the ones you use the most consistently. You can view all possible labels [here](https://github.com/WordPress/gutenberg/labels). -| Label | Reason | -| ------------- | ------------- | -|`[Type] Bug` | When an intended feature is broken. | -|`[Type] Enhancement` | When someone is suggesting an enhancement to a current feature. | -| `[Type] Help Request` | When someone is asking for general help with setup/implementation. | -| `Needs Technical Feedback` | When you see new features or API changes proposed. | -| `Needs More Info` | When it’s not clear what the issue is or it would help to provide additional details. | -| `Needs Testing` | When a new issue needs to be confirmed or old bugs seem like they are no longer relevant. | +| Label | Reason | +| -------------------------- | ----------------------------------------------------------------------------------------- | +| `[Type] Bug` | When an intended feature is broken. | +| `[Type] Enhancement` | When someone is suggesting an enhancement to a current feature. | +| `[Type] Help Request` | When someone is asking for general help with setup/implementation. | +| `Needs Technical Feedback` | When you see new features or API changes proposed. | +| `Needs More Info` | When it’s not clear what the issue is or it would help to provide additional details. | +| `Needs Testing` | When a new issue needs to be confirmed or old bugs seem like they are no longer relevant. | **Determining Priority Labels** If you have enough knowledge about the report at hand and feel confident in doing so, you can consider adding priority. Note that it’s on purpose that no priority label infers a normal level. -| Label | Reason | -| ------------- | ------------- | -|`Priority OMGWTFBBQ` | Major issues that are causing failures and are reported frequently. Typically, these are issues that are critical because they break important behavior or functionality. An example might be, “Unable to remove a block after it is added to the editor”. | -|`Priority: High` | Fits one of the current focuses and is causing a major broken experience (including flow, visual bugs and blocks). | -| `Priority: Low` | Enhancements that aren’t part of focuses, niche bugs, problems with old browsers. | +| Label | Reason | +| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Priority OMGWTFBBQ` | Major issues that are causing failures and are reported frequently. Typically, these are issues that are critical because they break important behavior or functionality. An example might be, “Unable to remove a block after it is added to the editor”. | +| `Priority: High` | Fits one of the current focuses and is causing a major broken experience (including flow, visual bugs and blocks). | +| `Priority: Low` | Enhancements that aren’t part of focuses, niche bugs, problems with old browsers. | ### Closing issues -Issues are closed for the following reasons: +Issues are closed for the following reasons: -* A PR and/or latest release resolved the reported issue. -* Duplicate of a current report. -* Help request that is best handled in the WordPress.org forums. -* An issue that's not able to be replicated. -* An issue that needs more information that the author of the issue hasn't responded to for 2+ weeks. -* An item that is determined as unable to be fixed or is working as intended. +- A PR and/or latest release resolved the reported issue. +- Duplicate of a current report. +- Help request that is best handled in the WordPress.org forums. +- An issue that's not able to be replicated. +- An issue that needs more information that the author of the issue hasn't responded to for 2+ weeks. +- An item that is determined as unable to be fixed or is working as intended. ### Release specific triage + Here are some guidelines to follow when doing triage specifically around the time of a release. This is important to differentiate compared to general triage so problematic, release blocking bugs are properly identified and solutions are found. -* If a bug is introduced in a release candidate (RC) and it's going to break many workflows, add it to the version milestone and flag in the #core-editor channel in WordPress.org slack. -* If a bug was introduced in the most recent version, and a next RC hasn’t yet happened, ideally the developers can push to fix it prior to RC! The amount of push for a fix should scale proportional to the potential of breakage. In this case, add to the RC milestone and, if deemed urgent, ping in the #core-editor channel in WordPress.org slack. -* If a bug wasn’t introduced in the most recent version, do not add a milestone. Instead, use labels like “[Priority] High” if it’s a pressing issue, and if needed you can call attention to it in the weekly core meetings. +- If a bug is introduced in a release candidate (RC) and it's going to break many workflows, add it to the version milestone and flag in the #core-editor channel in WordPress.org slack. +- If a bug was introduced in the most recent version, and a next RC hasn’t yet happened, ideally the developers can push to fix it prior to RC! The amount of push for a fix should scale proportional to the potential of breakage. In this case, add to the RC milestone and, if deemed urgent, ping in the #core-editor channel in WordPress.org slack. +- If a bug wasn’t introduced in the most recent version, do not add a milestone. Instead, use labels like “[Priority] High” if it’s a pressing issue, and if needed you can call attention to it in the weekly core meetings. ### Design specific triage -Along with the general triage flows listed previously, there are some specific additions to the flows for more design-centric triage for design minded folks participating in triage. - -* PR testing and reviews: this should be your first stop for daily self triage. -* Needs design feedback: check if the issue does need design feedback and, if possible, give it. You can organize this by priority, project boards or by least commented. Once there are enough opinions, please remove this label and decide on next steps (ie adding the Needs Design label). -* Needs design: Does it really need a design? Does this fit a focus? If it has a design mark as ‘needs design feedback’ to better categorize the issue. - -Reminders: -* Ask for screenshots as needed. -* Ask for iterations and note any changes before merging. -* If the issue isn’t in a board, check to see if it doesn’t fit in a specific focus. -* If the issue/pull has not been prioritized yet, consider adding a priority label to help move the issue forward. - -For more detailed information about weekly design triage and to join in, please [review this guide](https://make.wordpress.org/design/handbook/workflows/weekly-gutenberg-design-triage/). + +Along with the general triage flows listed previously, there are some specific additions to the flows for more design-centric triage for design minded folks participating in triage. + +- PR testing and reviews: this should be your first stop for daily self triage. +- Needs design feedback: check if the issue does need design feedback and, if possible, give it. You can organize this by priority, project boards or by least commented. Once there are enough opinions, please remove this label and decide on next steps (ie adding the Needs Design label). +- Needs design: Does it really need a design? Does this fit a focus? If it has a design mark as ‘needs design feedback’ to better categorize the issue. + +Reminders: + +- Ask for screenshots as needed. +- Ask for iterations and note any changes before merging. +- If the issue isn’t in a board, check to see if it doesn’t fit in a specific focus. +- If the issue/pull has not been prioritized yet, consider adding a priority label to help move the issue forward. + +For more detailed information about weekly design triage and to join in, please [review this guide](https://make.wordpress.org/design/handbook/workflows/weekly-gutenberg-design-triage/). diff --git a/docs/designers-developers/developers/backward-compatibility/deprecations.md b/docs/designers-developers/developers/backward-compatibility/deprecations.md index 8780e5f2c96ad5..b643d3029e3ab8 100644 --- a/docs/designers-developers/developers/backward-compatibility/deprecations.md +++ b/docs/designers-developers/developers/backward-compatibility/deprecations.md @@ -8,12 +8,12 @@ For features included in the Gutenberg plugin, the deprecation policy is intende ## 8.6.0 -- Block API integration with [Block Context](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-context.md) was updated. When registering a block use `usesContext` and `providesContext` pair in JavaScript files and `uses_context` and `provides_context` pair in PHP files instead of previous pair `context` and `providesContext`. +- Block API integration with [Block Context](/docs/designers-developers/developers/block-api/block-context.md) was updated. When registering a block use `usesContext` and `providesContext` pair in JavaScript files and `uses_context` and `provides_context` pair in PHP files instead of previous pair `context` and `providesContext`. ## 8.3.0 -- The PHP function `gutenberg_get_post_from_context` has been removed. Use [Block Context](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-context.md) instead. -- The old Block Pattern APIs `register_pattern`/`unregister_pattern` have been removed. Use the [new functions](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-patterns.md#register_block_pattern) instead. +- The PHP function `gutenberg_get_post_from_context` has been removed. Use [Block Context](/docs/designers-developers/developers/block-api/block-context.md) instead. +- The old Block Pattern APIs `register_pattern`/`unregister_pattern` have been removed. Use the [new functions](/docs/designers-developers/developers/block-api/block-patterns.md#register_block_pattern) instead. ## 5.5.0 diff --git a/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md b/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md index 6f15f634a39fd9..65246542dcb017 100644 --- a/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md +++ b/docs/designers-developers/developers/tutorials/create-block/submitting-to-block-directory.md @@ -3,6 +3,7 @@ So you've created an awesome block? Care to share? **Contents**: + 1. Help users understand your block 2. Analyze your plugin 3. Zip & Submit @@ -13,10 +14,10 @@ It is important to the Block Directory and our end users to provide easy to unde **Guidelines**: -- Name your block based on what it does -- Clearly describe your block -- Add Keywords for all contexts -- Choose the right category +- Name your block based on what it does +- Clearly describe your block +- Add Keywords for all contexts +- Choose the right category ### Name your block based on what it does @@ -33,47 +34,50 @@ Try your best to make your block's name functional and unique to make it stand o The description really helps to communicate what your block does.The quicker a user understands how your block will help them, the more likely it is a user will use your block. Users will be reading your block's description within the Block Editor where space can be limited. Try to keep it short and concise. **Not So Good**: The best way to show images on your website using jQuery and CSS. -**Good**: A responsive image gallery block. +**Good**: A responsive image gallery block. **Tip**: It’s not about marketing your block, in fact we want to avoid marketing in blocks. You can read more about it in the [plugin guidelines]. Stick to being as clear as you can. The Block Directory will provide metrics to let users know how awesome your block is! ### Add Keywords for broader context -Keywords add extra context to your block and make it more likely to be found in the inserter. +Keywords add extra context to your block and make it more likely to be found in the inserter. Examples for an Image Slider block: -- slider -- carousel -- gallery -[Read more about keywords.](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-metadata.md#keywords) +- slider +- carousel +- gallery + +[Read more about keywords.](/docs/designers-developers/developers/block-api/block-metadata.md#keywords) ### Choose the right category The Block Editor allows you to indicate the category your block belongs in, making it easier for users to locate your block in the menu. **Possible Values**: -- text -- media -- design -- widgets -- embed -[Read more about categories.](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-metadata.md#category) +- text +- media +- design +- widgets +- embed + +[Read more about categories.](/docs/designers-developers/developers/block-api/block-metadata.md#category) Wondering where to input all this information? Read the next section :) ## Step 2: Analyze your plugin + Each block in your plugin should have a corresponding `block.json` file. This file provides the Block Directory important information about your block. Along with being the place to store contextual information about your block like the: `name`, `description`, `keywords` and `category`, the `block.json` file stores the location of your block’s files. Block plugins submitted to the Block Directory can contain mutliple blocks only if they are children of a single parent/ancestor. There should only be one main block. For example, a list block can contain list-item blocks. Children blocks must set the `parent` property in their `block.json` file. Double check that the following is true for your block: -- `editorScript` is pointing to the JavaScript bundle that includes all the code used in the **editor**. -- `editorStyle` is pointing to the CSS bundle that includes all the css used in the **editor**. -- `script` is pointing to the JavaScript bundle that includes all the code used on the **website**. -- `style` is pointing to the CSS bundle that includes all the code used on the **website**. +- `editorScript` is pointing to the JavaScript bundle that includes all the code used in the **editor**. +- `editorStyle` is pointing to the CSS bundle that includes all the css used in the **editor**. +- `script` is pointing to the JavaScript bundle that includes all the code used on the **website**. +- `style` is pointing to the CSS bundle that includes all the code used on the **website**. We encourage the separation of code by using both editorScript/editorStyle and script/style files listed in your block.json to keep the backend and frontend interfaces running smoothly. Even though only one file is required. @@ -81,21 +85,19 @@ Here is an example of a basic block.json file. ```json { - "name": "plugin-slug/image-slider", - "title": "Responsive Image Slider", - "description": "A responsive and easy to use image gallery block.", - "keywords": [ "slider", "carousel", "gallery" ], - "category": "media", - "editorScript": "file:./dist/editor.js", + "name": "plugin-slug/image-slider", + "title": "Responsive Image Slider", + "description": "A responsive and easy to use image gallery block.", + "keywords": [ "slider", "carousel", "gallery" ], + "category": "media", + "editorScript": "file:./dist/editor.js" } ``` -The `block.json` file also contains other important properties. Take a look at an [example block.json](https://github.com/WordPress/gutenberg/blob/HEAD/docs/designers-developers/developers/block-api/block-metadata.md) for additional properties to be included in the block.json file. - +The `block.json` file also contains other important properties. Take a look at an [example block.json](/docs/designers-developers/developers/block-api/block-metadata.md) for additional properties to be included in the block.json file. ## Step 3: Zip & Submit The community is thankful for your contribution. It is time to submit your plugin. Go through [the block guidelines](https://github.com/WordPress/wporg-plugin-guidelines/blob/block-guidelines/blocks.md). Create a zip file of your block and go to the [block plugin validator](https://wordpress.org/plugins/developers/block-plugin-validator/) and upload your plugin. - diff --git a/packages/README.md b/packages/README.md index 3b31a69d488c4c..920a01bb415005 100644 --- a/packages/README.md +++ b/packages/README.md @@ -173,7 +173,7 @@ While other section naming can be used when appropriate, it's important that are When in doubt, refer to [Semantic Versioning specification](https://semver.org/). -If you are publishing new versions of packages, note that there are versioning recommendations outlined in the [Gutenberg Release Process document](https://github.com/WordPress/gutenberg/blob/HEAD/docs/contributors/release.md) which prescribe _minimum_ version bumps for specific types of releases. The chosen version should be the greater of the two between the semantic versioning and Gutenberg release minimum version bumps. +If you are publishing new versions of packages, note that there are versioning recommendations outlined in the [Gutenberg Release Process document](/docs/contributors/release.md) which prescribe _minimum_ version bumps for specific types of releases. The chosen version should be the greater of the two between the semantic versioning and Gutenberg release minimum version bumps. ## Releasing Packages From 3bfea599a292de296fb989ec3c56909d26de1311 Mon Sep 17 00:00:00 2001 From: Addison Stavlo Date: Wed, 20 Jan 2021 09:59:55 -0500 Subject: [PATCH 37/61] Template Part - fix labels shown - use title instead of slug (#28330) * use title instead of slug * add special template-part check for * fix bad request made while creating new template part * add comment --- .../edit/selection/template-part-previews.js | 12 ++++++++---- packages/blocks/src/api/utils.js | 16 +++++++++++++++- .../navigation-panel/template-navigation-item.js | 5 ++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/template-part/edit/selection/template-part-previews.js b/packages/block-library/src/template-part/edit/selection/template-part-previews.js index b437bb15e2ae81..50480bfa3f35fc 100644 --- a/packages/block-library/src/template-part/edit/selection/template-part-previews.js +++ b/packages/block-library/src/template-part/edit/selection/template-part-previews.js @@ -36,7 +36,11 @@ function TemplatePartItem( { onClose, composite, } ) { - const { slug, theme, title } = templatePart; + const { + slug, + theme, + title: { rendered: title }, + } = templatePart; // The 'raw' property is not defined for a brief period in the save cycle. // The fallback prevents an error in the parse function while saving. const content = templatePart.content.raw || ''; @@ -49,7 +53,7 @@ function TemplatePartItem( { sprintf( /* translators: %s: template part title. */ __( 'Template Part "%s" inserted.' ), - title.rendered + title || slug ), { type: 'snackbar', @@ -70,12 +74,12 @@ function TemplatePartItem( { } } } tabIndex={ 0 } - aria-label={ templatePart.slug } + aria-label={ title || slug } { ...composite } >
      - { templatePart.slug } + { title || slug }
      ); diff --git a/packages/blocks/src/api/utils.js b/packages/blocks/src/api/utils.js index dbf1dc79049b9d..a45a80e972c8a7 100644 --- a/packages/blocks/src/api/utils.js +++ b/packages/blocks/src/api/utils.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { every, has, isFunction, isString } from 'lodash'; +import { every, has, isFunction, isString, startCase } from 'lodash'; import { default as tinycolor, mostReadable } from 'tinycolor2'; /** @@ -10,6 +10,7 @@ import { default as tinycolor, mostReadable } from 'tinycolor2'; import { Component, isValidElement } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; import { __unstableStripHTML as stripHTML } from '@wordpress/dom'; +import { select } from '@wordpress/data'; /** * Internal dependencies @@ -140,6 +141,19 @@ export function normalizeBlockType( blockTypeOrName ) { * @return {string} The block label. */ export function getBlockLabel( blockType, attributes, context = 'visual' ) { + // Attempt to find entity title if block is a template part. + // Require slug to request, otherwise entity is uncreated and will throw 404. + if ( 'core/template-part' === blockType.name && attributes.slug ) { + const entity = select( 'core' ).getEntityRecord( + 'postType', + 'wp_template_part', + attributes.theme + '//' + attributes.slug + ); + if ( entity ) { + return startCase( entity.title?.rendered || entity.slug ); + } + } + const { __experimentalLabel: getLabel, title } = blockType; const label = getLabel && getLabel( attributes, { context } ); diff --git a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js index f694b66bee6684..9d7e85094de1e5 100644 --- a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js +++ b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js @@ -20,7 +20,10 @@ export default function TemplateNavigationItem( { item } ) { ( select ) => 'wp_template' === item.type ? select( 'core/editor' ).__experimentalGetTemplateInfo( item ) - : { title: item?.slug, description: '' }, + : { + title: item?.title?.rendered || item?.slug, + description: '', + }, [] ); const { setTemplate, setTemplatePart } = useDispatch( 'core/edit-site' ); From c4102618dfc90d5428009e5fbd553668117fa3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Wed, 20 Jan 2021 16:08:29 +0100 Subject: [PATCH 38/61] Packages: Use canary flag for npm releases with next dist tag (#28357) * Packages: RTweaks to the npm publishing script * Use canary flag for next releases --- bin/plugin/commands/packages.js | 46 +++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/bin/plugin/commands/packages.js b/bin/plugin/commands/packages.js index 93a266fe815c56..f0fa9f1c9e043a 100644 --- a/bin/plugin/commands/packages.js +++ b/bin/plugin/commands/packages.js @@ -210,7 +210,9 @@ async function updatePackages( ); log( - ` - ${ packageName }: ${ version } -> ${ nextVersion }` + ` - ${ packageName }: ${ version } -> ${ + isPrerelease ? nextVersion + '-next.0' : nextVersion + }` ); } ) @@ -272,23 +274,33 @@ async function publishPackagesToNpm( cwd: gitWorkingDirectoryPath, } ); - log( - '>> Bumping version of public packages changed since the last release.' - ); - const version = isPrerelease - ? 'prerelease --preid next' - : minimumVersionBump; - await command( `npx lerna version ${ version } --no-private`, { - cwd: gitWorkingDirectoryPath, - stdio: 'inherit', - } ); + if ( isPrerelease ) { + log( '>> Publishing modified packages to npm.' ); + await command( + `npx lerna publish --canary ${ minimumVersionBump } --preid next`, + { + cwd: gitWorkingDirectoryPath, + stdio: 'inherit', + } + ); + } else { + log( + '>> Bumping version of public packages changed since the last release.' + ); + await command( + `npx lerna version ${ minimumVersionBump } --no-private`, + { + cwd: gitWorkingDirectoryPath, + stdio: 'inherit', + } + ); - log( '>> Publishing packages to npm.' ); - const distTag = isPrerelease ? ' --dist-tag next' : ''; - await command( `npx lerna publish from-package${ distTag }`, { - cwd: gitWorkingDirectoryPath, - stdio: 'inherit', - } ); + log( '>> Publishing modified packages to npm.' ); + await command( `npx lerna publish from-package`, { + cwd: gitWorkingDirectoryPath, + stdio: 'inherit', + } ); + } } /** From 13e7ab3e38bbc95d2e5e5e8b76e07bfb313c70e3 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Wed, 20 Jan 2021 06:51:21 -1000 Subject: [PATCH 39/61] Fix repeated backgrounds for cover srcset (#28310) --- packages/block-library/src/cover/deprecated.js | 9 ++++++++- packages/block-library/src/cover/edit.js | 2 +- packages/block-library/src/cover/save.js | 2 +- .../fixtures/blocks/core__cover__deprecated-6.json | 3 ++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/cover/deprecated.js b/packages/block-library/src/cover/deprecated.js index fe08fb9cd72a8b..b214f3e0ce3ae0 100644 --- a/packages/block-library/src/cover/deprecated.js +++ b/packages/block-library/src/cover/deprecated.js @@ -13,6 +13,7 @@ import { getColorClassName, InnerBlocks, __experimentalGetGradientClass, + useBlockProps, } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; @@ -71,6 +72,10 @@ const deprecated = [ type: 'string', default: 'center', }, + isRepeated: { + type: 'boolean', + default: false, + }, minHeight: { type: 'number', }, @@ -91,6 +96,7 @@ const deprecated = [ dimRatio, focalPoint, hasParallax, + isRepeated, overlayColor, url, minHeight: minHeightProp, @@ -142,6 +148,7 @@ const deprecated = [ { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, + 'is-repeated': isRepeated, 'has-background-gradient': gradient || customGradient, [ gradientClass ]: ! url && gradientClass, 'has-custom-content-position': ! isContentPositionCenter( @@ -152,7 +159,7 @@ const deprecated = [ ); return ( -
      +
      { url && ( gradient || customGradient ) && dimRatio !== 0 && ( diff --git a/packages/block-library/src/cover/edit.js b/packages/block-library/src/cover/edit.js index d9b685ed300aa4..e379797e2ef669 100644 --- a/packages/block-library/src/cover/edit.js +++ b/packages/block-library/src/cover/edit.js @@ -331,7 +331,7 @@ function CoverEdit( { : minHeight; const style = { - ...( isImageBackground && hasParallax + ...( isImageBackground && ( hasParallax || isRepeated ) ? backgroundImageStyles( url ) : {} ), backgroundColor: overlayColor.color, diff --git a/packages/block-library/src/cover/save.js b/packages/block-library/src/cover/save.js index 0297dd30ecdf27..f530ad77790a62 100644 --- a/packages/block-library/src/cover/save.js +++ b/packages/block-library/src/cover/save.js @@ -55,7 +55,7 @@ export default function save( { attributes } ) { const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const style = { - ...( isImageBackground && hasParallax + ...( isImageBackground && ( hasParallax || isRepeated ) ? backgroundImageStyles( url ) : {} ), backgroundColor: ! overlayColorClass ? customOverlayColor : undefined, diff --git a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json index c1902f57919ea6..4709d0adb36708 100644 --- a/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json +++ b/packages/e2e-tests/fixtures/blocks/core__cover__deprecated-6.json @@ -9,7 +9,8 @@ "dimRatio": 40, "backgroundType": "image", "title": "", - "contentAlign": "center" + "contentAlign": "center", + "isRepeated": false }, "innerBlocks": [ { From 24f99734139385ff34db8468da3947c9a3d6f3f1 Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 20 Jan 2021 19:35:42 +0100 Subject: [PATCH 40/61] Fix Cover focal point picker. (#28350) * Fix Cover focal point picker. * Remove overflow. --- packages/block-library/src/cover/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/cover/style.scss b/packages/block-library/src/cover/style.scss index e30fd09a70fbfa..fc9f05941b56ec 100644 --- a/packages/block-library/src/cover/style.scss +++ b/packages/block-library/src/cover/style.scss @@ -3,9 +3,9 @@ position: relative; background-size: cover; background-position: center center; - overflow: hidden; min-height: 430px; width: 100%; + height: 100%; // This explicit height rule is necessary for the focal point picker to work. display: flex; justify-content: center; align-items: center; From 1796afcc277c3f457904fd616c80fa903f3c74ea Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 20 Jan 2021 20:02:05 +0100 Subject: [PATCH 41/61] Cover: Fix matrix alignment issue. (#28361) For context, position absolute, combined with width/height 100% works in most cases, but is still subject to the box model, collapsing margins, and other hard-to-predict things. By replacing those with top/right/bottom/left values of zero, we set neither widths nor heights, but accomplish the same. --- packages/block-library/src/cover/style.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/cover/style.scss b/packages/block-library/src/cover/style.scss index fc9f05941b56ec..babccb49bf5c08 100644 --- a/packages/block-library/src/cover/style.scss +++ b/packages/block-library/src/cover/style.scss @@ -172,8 +172,10 @@ .wp-block-cover__image-background, .wp-block-cover__video-background { position: absolute; - width: 100%; - height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; object-fit: cover; } From ac988d062278b8f5a10da9bac6b242e9c45e6b09 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 20 Jan 2021 20:06:32 +0100 Subject: [PATCH 42/61] Bump plugin version to 9.8.0 --- changelog.txt | 11 ++++++++++- gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index 43e8deba01394d..ffff3896bb8939 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ == Changelog == -= 9.8.0-rc.1 = += 9.8.0 = ### Enhancements @@ -21,6 +21,9 @@ - Cover Block: - Fix nested cover block bug. ([28114](https://github.com/WordPress/gutenberg/pull/28114)) - Fix invalid cover block transforms. ([28087](https://github.com/WordPress/gutenberg/pull/28087)) + - Fix cover regression. ([28287](https://github.com/WordPress/gutenberg/pull/28287)) + - Fix Cover focal point picker. ([28350](https://github.com/WordPress/gutenberg/pull/28350)) + - Fix matrix alignment issue. ([28361](https://github.com/WordPress/gutenberg/pull/28361)) - Fix block error when transforming blocks with Link Popover opened. ([28136](https://github.com/WordPress/gutenberg/pull/28136)) - Fix PHP Notice in navigation-link. ([28134](https://github.com/WordPress/gutenberg/pull/28134)) - Prevent link paste in RichText components in Button and Navigation blocks. ([28130](https://github.com/WordPress/gutenberg/pull/28130)) @@ -54,6 +57,7 @@ - Load content in iframe. ([25775](https://github.com/WordPress/gutenberg/pull/25775)) - Avoid using auto-drafts for theme templates and template parts. ([27910](https://github.com/WordPress/gutenberg/pull/27910)) - Delete unused options while upgrading the plugin. ([28164](https://github.com/WordPress/gutenberg/pull/28164)) + - Fix _wp_file_based term deletion in migration. ([28300](https://github.com/WordPress/gutenberg/pull/28300)) - Fix the border radius in the site editor. ([27986](https://github.com/WordPress/gutenberg/pull/27986)) - theme.json: - Add border radius to the theme styles schema. ([27791](https://github.com/WordPress/gutenberg/pull/27791)) @@ -77,6 +81,7 @@ - Update Quickstart guide for the Development Environment documentation. ([28005](https://github.com/WordPress/gutenberg/pull/28005)) - Update copyright year to 2021 in `license.md`. ([27951](https://github.com/WordPress/gutenberg/pull/27951)) - Block API: Add more inline comments. ([20257](https://github.com/WordPress/gutenberg/pull/20257)) +- Changelog: Group entries for 9.8.0-rc.1. ([28332](https://github.com/WordPress/gutenberg/pull/28332)) ### Code Quality @@ -117,11 +122,15 @@ - Testing: Prevent a direct usage of Reakit. ([28095](https://github.com/WordPress/gutenberg/pull/28095)) - Update the minimum Node.js version to 12. ([27934](https://github.com/WordPress/gutenberg/pull/27934)) - wp-env: Ensure the environment is used with the logs command. ([27907](https://github.com/WordPress/gutenberg/pull/27907)) +- Packages: Fully automate npm publishing with the latest and next tags ([28335](https://github.com/WordPress/gutenberg/pull/28335)) - Upgrade webpack to version 5. ([26382](https://github.com/WordPress/gutenberg/pull/26382)) - Revert "Upgrade webpack to version 5". ([27974](https://github.com/WordPress/gutenberg/pull/27974)) ### Various +- Gutenpride Template: + - New Package to use with the tutorial. ([27881](https://github.com/WordPress/gutenberg/pull/27881)) + - Create Block: Enhancements to Gutenpride tutorial template. ([28215](https://github.com/WordPress/gutenberg/pull/28215)) - URL: Remove redundant array coercion. ([28072](https://github.com/WordPress/gutenberg/pull/28072)) - Visual editor: Remove focusable wrapper. ([28058](https://github.com/WordPress/gutenberg/pull/28058)) - Readme: Increase tested Version up to WP 5.6. ([28050](https://github.com/WordPress/gutenberg/pull/28050)) diff --git a/gutenberg.php b/gutenberg.php index 2c475a7723dff8..3e03582f761f11 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.3 * Requires PHP: 5.6 - * Version: 9.8.0-rc.1 + * Version: 9.8.0 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index 67ddee56eebccb..a7e933a9f5c39e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.8.0-rc.1", + "version": "9.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a95a6a7d9a4460..f62614d5ab8736 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "9.8.0-rc.1", + "version": "9.8.0", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", diff --git a/readme.txt b/readme.txt index 1df934ed2e1341..6e5ed18d0ea71d 100644 --- a/readme.txt +++ b/readme.txt @@ -57,4 +57,4 @@ View release page. +To read the changelog for Gutenberg 9.8.0, please navigate to the release page. From ec839611b9958568ac9d3d1a04fd27e09696cc25 Mon Sep 17 00:00:00 2001 From: Q Date: Wed, 20 Jan 2021 15:59:19 -0500 Subject: [PATCH 43/61] Component System: Upgrade FontSizePicker (#27594) * Update min/max for FontSizeControl and improve getSelectOptions() to assign option object (+5 squashed commits) Squashed commits: [3b2e8cd71d] Update @wp-g2/components to latest v0.0.127 [144a98ed93] Add new font size picker to global styles [80beed6b33] Remove additional props [8d288e5177] Move font size component into gutenberg repository. [1cf09cb4da] Component System: Upgrade FontSizePicker * Update @wp-g2 packages to latest 0.0.135 with babel runtime handling * Update package-lock.json * Update @wp-g2 to latest 0.0.139 * Re-enabled E2E font-size-picker reset test * Update @wp-g2 to v0.0.140 - Removing @wp-g2/substate as a dependency * Refactor usage of noop and is utils Co-authored-by: Jorge --- package-lock.json | 508 +++++++++++++++++- package.json | 3 +- packages/block-editor/src/hooks/font-size.js | 24 +- packages/block-editor/src/hooks/typography.js | 22 +- packages/components/package.json | 6 +- .../context/component-system-provider.js | 30 ++ .../components/src/__next/context/index.js | 2 + .../src/__next/context/with-next.js | 35 ++ .../components/src/font-size-picker/index.js | 27 +- .../next/font-size-control-select.js | 100 ++++ .../next/font-size-control-slider.js | 59 ++ .../next/font-size-control-styles.js | 11 + .../next/font-size-control-utils.js | 105 ++++ .../next/font-size-control.js | 76 +++ .../src/font-size-picker/next/index.js | 26 + .../next/use-font-size-control.js | 113 ++++ packages/components/src/index.js | 6 + .../sidebar/global-styles-sidebar.js | 13 +- webpack.config.js | 7 + 19 files changed, 1115 insertions(+), 58 deletions(-) create mode 100644 packages/components/src/__next/context/component-system-provider.js create mode 100644 packages/components/src/__next/context/index.js create mode 100644 packages/components/src/__next/context/with-next.js create mode 100755 packages/components/src/font-size-picker/next/font-size-control-select.js create mode 100755 packages/components/src/font-size-picker/next/font-size-control-slider.js create mode 100755 packages/components/src/font-size-picker/next/font-size-control-styles.js create mode 100755 packages/components/src/font-size-picker/next/font-size-control-utils.js create mode 100755 packages/components/src/font-size-picker/next/font-size-control.js create mode 100644 packages/components/src/font-size-picker/next/index.js create mode 100755 packages/components/src/font-size-picker/next/use-font-size-control.js diff --git a/package-lock.json b/package-lock.json index a7e933a9f5c39e..2d2c1ae381918a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1524,7 +1524,6 @@ "version": "10.0.29", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.29.tgz", "integrity": "sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ==", - "dev": true, "requires": { "@emotion/sheet": "0.9.4", "@emotion/stylis": "0.8.5", @@ -1535,8 +1534,7 @@ "@emotion/utils": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", - "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==", - "dev": true + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==" } } }, @@ -1677,8 +1675,7 @@ "@emotion/sheet": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.4.tgz", - "integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==", - "dev": true + "integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==" }, "@emotion/styled": { "version": "10.0.23", @@ -1703,8 +1700,7 @@ "@emotion/stylis": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", - "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==", - "dev": true + "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" }, "@emotion/utils": { "version": "0.11.2", @@ -1714,8 +1710,7 @@ "@emotion/weak-memoize": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz", - "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==", - "dev": true + "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" }, "@eslint/eslintrc": { "version": "0.2.2", @@ -2351,6 +2346,11 @@ "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, + "@itsjonq/is": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@itsjonq/is/-/is-0.0.2.tgz", + "integrity": "sha512-P0Ug+chfjCV1JV8MUxAGPz0BM76yDlR76AIfPwRZ6mAJW56k6b9j0s2cIcEsEAu0gNj/RJD1STw777AQyBN3CQ==" + }, "@jest/console": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", @@ -11807,6 +11807,10 @@ "@wordpress/primitives": "file:packages/primitives", "@wordpress/rich-text": "file:packages/rich-text", "@wordpress/warning": "file:packages/warning", + "@wp-g2/components": "^0.0.140", + "@wp-g2/context": "^0.0.140", + "@wp-g2/styles": "^0.0.140", + "@wp-g2/utils": "^0.0.140", "classnames": "^2.2.5", "dom-scroll-into-view": "^1.2.1", "downshift": "^5.4.0", @@ -11819,11 +11823,18 @@ "react-merge-refs": "^1.0.0", "react-resize-aware": "^3.0.1", "react-spring": "^8.0.20", - "react-use-gesture": "^7.0.15", + "react-use-gesture": "^7.0.16", "reakit": "^1.3.4", "rememo": "^3.0.0", "tinycolor2": "^1.4.1", "uuid": "^8.3.0" + }, + "dependencies": { + "react-use-gesture": { + "version": "7.0.16", + "resolved": "https://registry.npmjs.org/react-use-gesture/-/react-use-gesture-7.0.16.tgz", + "integrity": "sha512-gwgX+E+WQG0T1uFVl3z8j3ZwH3QQGIgVl7VtQEC2m0IscSs668sSps4Ss3CFp3Vns8xx0j9TVK4aBXH6+YrpEg==" + } } }, "@wordpress/compose": { @@ -12701,6 +12712,290 @@ "lodash": "^4.17.19" } }, + "@wp-g2/components": { + "version": "0.0.140", + "resolved": "https://registry.npmjs.org/@wp-g2/components/-/components-0.0.140.tgz", + "integrity": "sha512-bychuhZ3wPSB457CHYcogoPQPlP/eUA9GoTo0Fv0rj7f44Gr9XlPoqVT+GQa3CmPnvSCAl1sjoe75Vkaoo/O1w==", + "requires": { + "@popperjs/core": "^2.5.4", + "@wp-g2/context": "^0.0.140", + "@wp-g2/styles": "^0.0.140", + "@wp-g2/utils": "^0.0.140", + "csstype": "^3.0.3", + "downshift": "^6.0.15", + "framer-motion": "^2.1.0", + "highlight-words-core": "^1.2.2", + "history": "^4.9.0", + "lodash": "^4.17.19", + "path-to-regexp": "^1.7.0", + "react-colorful": "4.4.4", + "react-textarea-autosize": "^8.2.0", + "react-use-gesture": "^9.0.0", + "reakit": "1.1.0" + }, + "dependencies": { + "compute-scroll-into-view": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-1.0.16.tgz", + "integrity": "sha512-a85LHKY81oQnikatZYA90pufpZ6sQx++BoCxOEMsjpZx+ZnaKGQnCyCehTRr/1p9GBIAHTjcU9k71kSYWloLiQ==" + }, + "csstype": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz", + "integrity": "sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==" + }, + "downshift": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/downshift/-/downshift-6.1.0.tgz", + "integrity": "sha512-MnEJERij+1pTVAsOPsH3q9MJGNIZuu2sT90uxOCEOZYH6sEzkVGtUcTBVDRQkE8y96zpB7uEbRn24aE9VpHnZg==", + "requires": { + "@babel/runtime": "^7.12.5", + "compute-scroll-into-view": "^1.0.16", + "prop-types": "^15.7.2", + "react-is": "^17.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + }, + "react-is": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==" + }, + "reakit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reakit/-/reakit-1.1.0.tgz", + "integrity": "sha512-d/ERtwgBndBPsyPBPUl5jueyfFgsglIfQCnLMKuxM0PaWiIZ6Ys3XsYaNy/AaG8k46Ee5cQPMdRrR30nVcSToQ==", + "requires": { + "@popperjs/core": "^2.4.2", + "body-scroll-lock": "^3.0.2", + "reakit-system": "^0.13.0", + "reakit-utils": "^0.13.0", + "reakit-warning": "^0.4.0" + } + }, + "reakit-system": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/reakit-system/-/reakit-system-0.13.1.tgz", + "integrity": "sha512-qglfQ53FsJh5+VSkjMtBg7eZiowj9zXOyfJJxfaXh/XYTVe/5ibzWg6rvGHyvSm6C3D7Q2sg/NPCLmCtYGGvQA==", + "requires": { + "reakit-utils": "^0.13.1" + } + }, + "reakit-utils": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/reakit-utils/-/reakit-utils-0.13.1.tgz", + "integrity": "sha512-NBKgsot3tU91gZgK5MTInI/PR0T3kIsTmbU5MbGggSOcwU2dG/kbE8IrM2lC6ayCSL2W2QWkijT6kewdrIX7Gw==" + }, + "reakit-warning": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/reakit-warning/-/reakit-warning-0.4.1.tgz", + "integrity": "sha512-AgnRN6cf8DYBF/mK2JEMFVL67Sbon8fDbFy1kfm0EDibtGsMOQtsFYfozZL7TwmJ4yg68VMhg8tmPHchVQRrlg==", + "requires": { + "reakit-utils": "^0.13.1" + } + } + } + }, + "@wp-g2/context": { + "version": "0.0.140", + "resolved": "https://registry.npmjs.org/@wp-g2/context/-/context-0.0.140.tgz", + "integrity": "sha512-z32fxZ2tCVmYQC+wyyziyrhEvWBPFBQfUhUHF85JmTUPzQQeEPiLC3rgDAT0fUTFlJHinPJQq6871RDqFSwCUA==", + "requires": { + "@wp-g2/styles": "^0.0.140", + "@wp-g2/utils": "^0.0.140", + "lodash": "^4.17.19" + } + }, + "@wp-g2/create-styles": { + "version": "0.0.140", + "resolved": "https://registry.npmjs.org/@wp-g2/create-styles/-/create-styles-0.0.140.tgz", + "integrity": "sha512-/60DxWjCAhsoYOqY7aiHVbkTAF+L6qZIyHyH50oNs9FTVkcRLHQFSC0kHgAam+Z9K3eImQ7hM52wfBDqae0q2Q==", + "requires": { + "@emotion/core": "^10.1.1", + "@emotion/is-prop-valid": "^0.8.8", + "@wp-g2/utils": "^0.0.140", + "create-emotion": "^10.0.27", + "emotion": "^10.0.27", + "emotion-theming": "^10.0.27", + "lodash": "^4.17.19", + "mitt": "^2.1.0", + "rtlcss": "^2.6.2", + "styled-griddie": "^0.1.3" + }, + "dependencies": { + "@choojs/findup": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", + "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", + "requires": { + "commander": "^2.15.1" + } + }, + "@emotion/core": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.1.1.tgz", + "integrity": "sha512-ZMLG6qpXR8x031NXD8HJqugy/AZSkAuMxxqB46pmAR7ze47MhNJ56cdoX243QPZdGctrdfo+s08yZTiwaUcRKA==", + "requires": { + "@babel/runtime": "^7.5.5", + "@emotion/cache": "^10.0.27", + "@emotion/css": "^10.0.27", + "@emotion/serialize": "^0.11.15", + "@emotion/sheet": "0.9.4", + "@emotion/utils": "0.11.3" + } + }, + "@emotion/is-prop-valid": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz", + "integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==", + "requires": { + "@emotion/memoize": "0.7.4" + } + }, + "@emotion/memoize": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", + "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" + }, + "@emotion/utils": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + } + }, + "rtlcss": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-2.6.2.tgz", + "integrity": "sha512-06LFAr+GAPo+BvaynsXRfoYTJvSaWRyOhURCQ7aeI1MKph9meM222F+Zkt3bDamyHHJuGi3VPtiRkpyswmQbGA==", + "requires": { + "@choojs/findup": "^0.2.1", + "chalk": "^2.4.2", + "mkdirp": "^0.5.1", + "postcss": "^6.0.23", + "strip-json-comments": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "@wp-g2/styles": { + "version": "0.0.140", + "resolved": "https://registry.npmjs.org/@wp-g2/styles/-/styles-0.0.140.tgz", + "integrity": "sha512-wAvtqQOqX2zYpfEdVK4l4abH/hUUgw/+8+E5PvPgrsvqFg8IehNSksnjNF5/IloLRGAH70d8ytjMuMnUK8PVYA==", + "requires": { + "@wp-g2/create-styles": "^0.0.140", + "@wp-g2/utils": "^0.0.140" + } + }, + "@wp-g2/utils": { + "version": "0.0.140", + "resolved": "https://registry.npmjs.org/@wp-g2/utils/-/utils-0.0.140.tgz", + "integrity": "sha512-a4uYi/XQEDrOAIO3JUQ+L/oeSkgp+08pSy41xxQ1nIRHs7X+Du84X2EFQrvZfGBRuXuVlVuUIlN2e0IE8yUZKw==", + "requires": { + "copy-to-clipboard": "^3.3.1", + "create-emotion": "^10.0.27", + "deepmerge": "^4.2.2", + "fast-deep-equal": "^3.1.3", + "hoist-non-react-statics": "^3.3.2", + "json2mq": "^0.2.0", + "lodash": "^4.17.19", + "memize": "^1.1.0", + "react-merge-refs": "^1.1.0", + "react-resize-aware": "^3.1.0", + "reakit-warning": "^0.5.5", + "tinycolor2": "^1.4.2", + "use-enhanced-state": "^0.0.13", + "use-isomorphic-layout-effect": "^1.0.0" + }, + "dependencies": { + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, + "react-merge-refs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/react-merge-refs/-/react-merge-refs-1.1.0.tgz", + "integrity": "sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==" + }, + "react-resize-aware": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-resize-aware/-/react-resize-aware-3.1.0.tgz", + "integrity": "sha512-bIhHlxVTX7xKUz14ksXMEHjzCZPTpQZKZISY3nbTD273pDKPABGFNFBP6Tr42KECxzC5YQiKpMchjTVJCqaxpA==" + }, + "reakit-utils": { + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/reakit-utils/-/reakit-utils-0.14.4.tgz", + "integrity": "sha512-jDEf/NmZVJ6fs10G16ifD+RFhQikSLN7VfjRHu0CPoUj4g6lFXd5PPcRXCY81qiqc9FVHjr2d2fmsw1hs6xUxA==" + }, + "reakit-warning": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/reakit-warning/-/reakit-warning-0.5.5.tgz", + "integrity": "sha512-OuP1r7rlSSJZsoLuc0CPA2ACPKnWO8HDbFktiiidbT67UjuX6udYV1AUsIgMJ8ado9K5gZGjPj7IB/GDYo9Yjg==", + "requires": { + "reakit-utils": "^0.14.4" + } + }, + "tinycolor2": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" + } + } + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -24857,7 +25152,6 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz", "integrity": "sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==", - "dev": true, "requires": { "toggle-selection": "^1.0.6" } @@ -25074,6 +25368,24 @@ "elliptic": "^6.0.0" } }, + "create-emotion": { + "version": "10.0.27", + "resolved": "https://registry.npmjs.org/create-emotion/-/create-emotion-10.0.27.tgz", + "integrity": "sha512-fIK73w82HPPn/RsAij7+Zt8eCE8SptcJ3WoRMfxMtjteYxud8GDTKKld7MYwAX2TVhrw29uR1N/bVGxeStHILg==", + "requires": { + "@emotion/cache": "^10.0.27", + "@emotion/serialize": "^0.11.15", + "@emotion/sheet": "0.9.4", + "@emotion/utils": "0.11.3" + }, + "dependencies": { + "@emotion/utils": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==" + } + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -26485,11 +26797,19 @@ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "emotion": { + "version": "10.0.27", + "resolved": "https://registry.npmjs.org/emotion/-/emotion-10.0.27.tgz", + "integrity": "sha512-2xdDzdWWzue8R8lu4G76uWX5WhyQuzATon9LmNeCy/2BHVC6dsEpfhN1a0qhELgtDVdjyEA6J8Y/VlI5ZnaH0g==", + "requires": { + "babel-plugin-emotion": "^10.0.27", + "create-emotion": "^10.0.27" + } + }, "emotion-theming": { "version": "10.0.27", "resolved": "https://registry.npmjs.org/emotion-theming/-/emotion-theming-10.0.27.tgz", "integrity": "sha512-MlF1yu/gYh8u+sLUqA0YuA9JX0P4Hb69WlKc/9OLo+WCXuX6sy/KoIa+qJimgmr2dWqnypYKYPX37esjDBbhdw==", - "dev": true, "requires": { "@babel/runtime": "^7.5.5", "@emotion/weak-memoize": "0.2.5", @@ -26500,7 +26820,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, "requires": { "react-is": "^16.7.0" } @@ -30140,6 +30459,34 @@ "map-cache": "^0.2.2" } }, + "framer-motion": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-2.9.5.tgz", + "integrity": "sha512-epSX4Co1YbDv0mjfHouuY0q361TpHE7WQzCp/xMTilxy4kXd+Z23uJzPVorfzbm1a/9q1Yu8T5bndaw65NI4Tg==", + "requires": { + "@emotion/is-prop-valid": "^0.8.2", + "framesync": "^4.1.0", + "hey-listen": "^1.0.8", + "popmotion": "9.0.0-rc.20", + "style-value-types": "^3.1.9", + "tslib": "^1.10.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "framesync": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/framesync/-/framesync-4.1.0.tgz", + "integrity": "sha512-MmgZ4wCoeVxNbx2xp5hN/zPDCbLSKiDt4BbbslK7j/pM2lg5S0vhTNv1v8BCVb99JPIo6hXBFdwzU7Q4qcAaoQ==", + "requires": { + "hey-listen": "^1.0.5" + } + }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -31445,12 +31792,35 @@ "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", "dev": true }, + "hey-listen": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz", + "integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==" + }, + "highlight-words-core": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/highlight-words-core/-/highlight-words-core-1.2.2.tgz", + "integrity": "sha512-BXUKIkUuh6cmmxzi5OIbUJxrG8OAk2MqoL1DtO3Wo9D2faJg2ph5ntyuQeLqaHJmzER6H5tllCDA9ZnNe9BVGg==" + }, "highlight.js": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.4.1.tgz", "integrity": "sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg==", "dev": true }, + "history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -37594,6 +37964,14 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json2mq": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", + "integrity": "sha1-tje9O6nqvhIsg+lyBIOusQ0skEo=", + "requires": { + "string-convert": "^0.2.0" + } + }, "json2php": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/json2php/-/json2php-0.0.4.tgz", @@ -40970,6 +41348,11 @@ "through2": "^2.0.0" } }, + "mitt": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz", + "integrity": "sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg==" + }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -43580,6 +43963,24 @@ "@babel/runtime": "^7.9.2" } }, + "popmotion": { + "version": "9.0.0-rc.20", + "resolved": "https://registry.npmjs.org/popmotion/-/popmotion-9.0.0-rc.20.tgz", + "integrity": "sha512-f98sny03WuA+c8ckBjNNXotJD4G2utG/I3Q23NU69OEafrXtxxSukAaJBxzbtxwDvz3vtZK69pu9ojdkMoBNTg==", + "requires": { + "framesync": "^4.1.0", + "hey-listen": "^1.0.8", + "style-value-types": "^3.1.9", + "tslib": "^1.10.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, "portfinder": { "version": "1.0.25", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.25.tgz", @@ -45449,6 +45850,11 @@ "tinycolor2": "^1.4.1" } }, + "react-colorful": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-4.4.4.tgz", + "integrity": "sha512-01V2/6rr6sa1vaZntWZJXZxnU7ew02NG2rqq0eoVp4d3gFU5Ug9lDzNMbr+8ns0byXsJbBR8LbwQTlAjz6x7Kg==" + }, "react-dates": { "version": "17.2.0", "resolved": "https://registry.npmjs.org/react-dates/-/react-dates-17.2.0.tgz", @@ -47550,7 +47956,6 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.3.0.tgz", "integrity": "sha512-3GLWFAan2pbwBeoeNDoqGmSbrShORtgWfaWX0RJDivsUrpShh01saRM5RU/i4Zmf+whpBVEY5cA90Eq8Ub1N3w==", - "dev": true, "requires": { "@babel/runtime": "^7.10.2", "use-composed-ref": "^1.0.0", @@ -47570,9 +47975,9 @@ } }, "react-use-gesture": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/react-use-gesture/-/react-use-gesture-7.0.15.tgz", - "integrity": "sha512-vHQkaa7oUbSDTAcFk9huQXa7E8KPrZH91erPuOMoqZT513qvtbb/SzTQ33lHc71/kOoJkMbzOkc4uoA4sT7Ogg==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/react-use-gesture/-/react-use-gesture-9.0.0.tgz", + "integrity": "sha512-inTAcmX0Y8LWr7XViim5+6XlTsJ7kCgwYRrwxSu1Vkjv+8GyClHITFkGGKYXAv5QywZ8YqiJXpzFx8RZpEVF+w==" }, "react-with-direction": { "version": "1.3.0", @@ -48622,6 +49027,11 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" }, + "resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -50080,6 +50490,11 @@ "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", "dev": true }, + "string-convert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", + "integrity": "sha1-aYLMMEn7tM2F+LJFaLnZvznu/5c=" + }, "string-length": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.1.tgz", @@ -50880,8 +51295,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "strong-log-transformer": { "version": "2.1.0", @@ -50978,6 +51392,27 @@ "inline-style-parser": "0.1.1" } }, + "style-value-types": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/style-value-types/-/style-value-types-3.2.0.tgz", + "integrity": "sha512-ih0mGsrYYmVvdDi++/66O6BaQPRPRMQHoZevNNdMMcPlP/cH28Rnfsqf1UEba/Bwfuw9T8BmIMwbGdzsPwQKrQ==", + "requires": { + "hey-listen": "^1.0.8", + "tslib": "^1.10.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "styled-griddie": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/styled-griddie/-/styled-griddie-0.1.3.tgz", + "integrity": "sha512-RjsiiADJrRpdPTF8NR26nlZutnvkrX78tiM5/za/E+ftVdpjD8ZBb2iOzrIzfix80uDcHYQbg3iIR0lOGaYmEQ==" + }, "stylehacks": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", @@ -52739,6 +53174,11 @@ "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==" }, + "tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, "tiny-lr": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", @@ -52753,6 +53193,11 @@ "qs": "^6.4.0" } }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "tinycolor2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz", @@ -52835,8 +53280,7 @@ "toggle-selection": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", - "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI=", - "dev": true + "integrity": "sha1-bkWxJj8gF/oKzH2J14sVuL932jI=" }, "toidentifier": { "version": "1.0.0", @@ -52926,8 +53370,7 @@ "ts-essentials": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-2.0.12.tgz", - "integrity": "sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==", - "dev": true + "integrity": "sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==" }, "ts-pnp": { "version": "1.2.0", @@ -53488,22 +53931,28 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.1.0.tgz", "integrity": "sha512-my1lNHGWsSDAhhVAT4MKs6IjBUtG6ZG11uUqexPH9PptiIZDQOzaF4f5tEbJ2+7qvNbtXNBbU3SfmN+fXlWDhg==", - "dev": true, "requires": { "ts-essentials": "^2.0.3" } }, + "use-enhanced-state": { + "version": "0.0.13", + "resolved": "https://registry.npmjs.org/use-enhanced-state/-/use-enhanced-state-0.0.13.tgz", + "integrity": "sha512-RCtUQdhfUXu/0GAQqLnKPetUt3BheYFpOTogppHe9x1XGwluiu6DQLKVNnc3yMfj0HM3IOVBgw5nVJJuZS5TWQ==", + "requires": { + "@itsjonq/is": "0.0.2", + "tiny-warning": "^1.0.3" + } + }, "use-isomorphic-layout-effect": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.0.tgz", - "integrity": "sha512-kady5Z1O1qx5RitodCCKbpJSVEtECXYcnBnb5Q48Bz5V6gBmTu85ZcGdVwVFs8+DaOurNb/L5VdGHoQRMknghw==", - "dev": true + "integrity": "sha512-kady5Z1O1qx5RitodCCKbpJSVEtECXYcnBnb5Q48Bz5V6gBmTu85ZcGdVwVFs8+DaOurNb/L5VdGHoQRMknghw==" }, "use-latest": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-latest/-/use-latest-1.2.0.tgz", "integrity": "sha512-d2TEuG6nSLKQLAfW3By8mKr8HurOlTkul0sOpxbClIv4SQ4iOd7BYr7VIzdbktUCnv7dua/60xzd8igMU6jmyw==", - "dev": true, "requires": { "use-isomorphic-layout-effect": "^1.0.0" } @@ -53622,6 +54071,11 @@ "builtins": "^1.0.3" } }, + "value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, "vargs": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", diff --git a/package.json b/package.json index f62614d5ab8736..d9790ca796696a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "npm": ">=6.9.0" }, "config": { - "GUTENBERG_PHASE": 2 + "GUTENBERG_PHASE": 2, + "COMPONENT_SYSTEM_PHASE": 0 }, "dependencies": { "@wordpress/a11y": "file:packages/a11y", diff --git a/packages/block-editor/src/hooks/font-size.js b/packages/block-editor/src/hooks/font-size.js index 1c27ee3f7bd876..277c413e98b0a7 100644 --- a/packages/block-editor/src/hooks/font-size.js +++ b/packages/block-editor/src/hooks/font-size.js @@ -105,15 +105,6 @@ export function FontSizeEdit( props ) { const isDisabled = useIsFontSizeDisabled( props ); const fontSizes = useEditorFeature( 'typography.fontSizes' ); - if ( isDisabled ) { - return null; - } - - const fontSizeObject = getFontSize( - fontSizes, - fontSize, - style?.typography?.fontSize - ); const onChange = ( value ) => { const fontSizeSlug = getFontSizeObjectByValue( fontSizes, value ).slug; @@ -129,9 +120,20 @@ export function FontSizeEdit( props ) { } ); }; - return ( - + if ( isDisabled ) { + return null; + } + + const fontSizeObject = getFontSize( + fontSizes, + fontSize, + style?.typography?.fontSize ); + + const fontSizeValue = + fontSizeObject?.size || style?.typography?.fontSize || fontSize; + + return ; } /** diff --git a/packages/block-editor/src/hooks/typography.js b/packages/block-editor/src/hooks/typography.js index dfc27748acb00f..5edc061a0220f4 100644 --- a/packages/block-editor/src/hooks/typography.js +++ b/packages/block-editor/src/hooks/typography.js @@ -2,7 +2,13 @@ * WordPress dependencies */ import { hasBlockSupport } from '@wordpress/blocks'; -import { PanelBody } from '@wordpress/components'; +/** + * External dependencies + */ +import { + PanelBody, + __unstableComponentSystemProvider as ComponentSystemProvider, +} from '@wordpress/components'; import { Platform } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; @@ -61,11 +67,15 @@ export function TypographyPanel( props ) { return ( - - - - - + + + + + + + ); diff --git a/packages/components/package.json b/packages/components/package.json index 42076f4b6f37de..90625af60663af 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -45,6 +45,10 @@ "@wordpress/primitives": "file:../primitives", "@wordpress/rich-text": "file:../rich-text", "@wordpress/warning": "file:../warning", + "@wp-g2/components": "^0.0.140", + "@wp-g2/context": "^0.0.140", + "@wp-g2/styles": "^0.0.140", + "@wp-g2/utils": "^0.0.140", "classnames": "^2.2.5", "dom-scroll-into-view": "^1.2.1", "downshift": "^5.4.0", @@ -57,7 +61,7 @@ "react-merge-refs": "^1.0.0", "react-resize-aware": "^3.0.1", "react-spring": "^8.0.20", - "react-use-gesture": "^7.0.15", + "react-use-gesture": "^7.0.16", "reakit": "^1.3.4", "rememo": "^3.0.0", "tinycolor2": "^1.4.1", diff --git a/packages/components/src/__next/context/component-system-provider.js b/packages/components/src/__next/context/component-system-provider.js new file mode 100644 index 00000000000000..2b6ef12bc8a3b4 --- /dev/null +++ b/packages/components/src/__next/context/component-system-provider.js @@ -0,0 +1,30 @@ +/** + * External dependencies + */ +import { ContextSystemProvider } from '@wp-g2/components'; + +export function ComponentSystemProvider( { + __unstableNextInclude = [], + children, + value = {}, +} ) { + if ( process.env.COMPONENT_SYSTEM_PHASE === 1 ) { + const contextValue = { ...value }; + + __unstableNextInclude.forEach( ( namespace ) => { + const baseValue = contextValue[ namespace ] || {}; + contextValue[ namespace ] = { + ...baseValue, + __unstableVersion: 'next', + }; + } ); + + return ( + + { children } + + ); + } + + return children; +} diff --git a/packages/components/src/__next/context/index.js b/packages/components/src/__next/context/index.js new file mode 100644 index 00000000000000..da09738c58dd0b --- /dev/null +++ b/packages/components/src/__next/context/index.js @@ -0,0 +1,2 @@ +export { ComponentSystemProvider as __unstableComponentSystemProvider } from './component-system-provider'; +export { withNext as __unstableWithNext } from './with-next'; diff --git a/packages/components/src/__next/context/with-next.js b/packages/components/src/__next/context/with-next.js new file mode 100644 index 00000000000000..24e65e54dfce96 --- /dev/null +++ b/packages/components/src/__next/context/with-next.js @@ -0,0 +1,35 @@ +/** + * External dependencies + */ +import { contextConnect, useContextSystem } from '@wp-g2/components'; +/** + * WordPress dependencies + */ +import { forwardRef } from '@wordpress/element'; + +export function withNext( + CurrentComponent = () => null, + NextComponent = () => null, + namespace = 'Component', + adapter = ( p ) => p +) { + if ( process.env.COMPONENT_SYSTEM_PHASE === 1 ) { + const WrappedComponent = ( props, ref ) => { + const { __unstableVersion, ...otherProps } = useContextSystem( + props, + namespace + ); + + if ( __unstableVersion === 'next' ) { + const nextProps = adapter( otherProps ); + return ; + } + + return ; + }; + + return contextConnect( WrappedComponent, namespace ); + } + + return forwardRef( CurrentComponent ); +} diff --git a/packages/components/src/font-size-picker/index.js b/packages/components/src/font-size-picker/index.js index e2cdec0dcf522d..935923488fbc53 100644 --- a/packages/components/src/font-size-picker/index.js +++ b/packages/components/src/font-size-picker/index.js @@ -18,6 +18,7 @@ import Button from '../button'; import RangeControl from '../range-control'; import CustomSelectControl from '../custom-select-control'; import VisuallyHidden from '../visually-hidden'; +import { withNextComponent } from './next/'; const DEFAULT_FONT_SIZE = 'default'; const CUSTOM_FONT_SIZE = 'custom'; @@ -52,14 +53,17 @@ function getSelectOptions( optionsArray, disableCustomFontSizes ) { } ) ); } -export default function FontSizePicker( { - fallbackFontSize, - fontSizes = [], - disableCustomFontSizes = false, - onChange, - value, - withSlider = false, -} ) { +function FontSizePicker( + { + fallbackFontSize, + fontSizes = [], + disableCustomFontSizes = false, + onChange, + value, + withSlider = false, + }, + ref +) { const hasUnits = isString( value ) || ( fontSizes[ 0 ] && isString( fontSizes[ 0 ].size ) ); @@ -90,7 +94,10 @@ export default function FontSizePicker( { const fontSizePickerNumberId = `components-font-size-picker__number#${ instanceId }`; return ( -
      +
      { __( 'Font size' ) }
      { fontSizes.length > 0 && ( @@ -169,3 +176,5 @@ export default function FontSizePicker( {
      ); } + +export default withNextComponent( FontSizePicker ); diff --git a/packages/components/src/font-size-picker/next/font-size-control-select.js b/packages/components/src/font-size-picker/next/font-size-control-select.js new file mode 100755 index 00000000000000..e27789e1bfa872 --- /dev/null +++ b/packages/components/src/font-size-picker/next/font-size-control-select.js @@ -0,0 +1,100 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; + +/** + * External dependencies + */ +import { noop } from 'lodash'; +import { contextConnect, useContextSystem } from '@wp-g2/context'; +import { + Grid, + TextInput, + SelectDropdown, + FormGroup, + Button, + View, +} from '@wp-g2/components'; + +/** + * Internal dependencies + */ +import { getSelectTemplateColumns } from './font-size-control-utils'; + +function renderItem( { name, style } ) { + return { name }; +} + +function FontSizeControlSelect( props, forwardedRef ) { + const { + customLabel, + disabled, + inputValue, + isDefaultValue, + label, + max, + min, + onChange = noop, + onInputChange = noop, + onReset = noop, + options = [], + size, + value, + withNumberInput, + withSelect, + ...otherProps + } = useContextSystem( props, 'FontSizeControlSelect' ); + + const templateColumns = getSelectTemplateColumns( withNumberInput ); + const subControlsTemplateColumns = withNumberInput ? '1fr 1fr' : '1fr'; + + return ( + + { withSelect && ( + + + + ) } + + { withNumberInput && ( + + + + ) } + + + + + + ); +} + +export default contextConnect( FontSizeControlSelect, 'FontSizeControlSelect' ); diff --git a/packages/components/src/font-size-picker/next/font-size-control-slider.js b/packages/components/src/font-size-picker/next/font-size-control-slider.js new file mode 100755 index 00000000000000..7b3fa18cb66fca --- /dev/null +++ b/packages/components/src/font-size-picker/next/font-size-control-slider.js @@ -0,0 +1,59 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; + +/** + * External dependencies + */ +import { noop } from 'lodash'; + +/** + * Internal dependencies + */ +import { + ControlLabel, + Grid, + Slider, + TextInput, + VStack, +} from '@wp-g2/components'; +import { getSliderTemplateColumns } from './font-size-control-utils'; + +function FontSizeControlSlider( props ) { + const { + label = __( 'Custom size' ), + disabled, + min, + max, + onChange = noop, + size, + value, + withSlider, + } = props; + + if ( ! withSlider ) return null; + + const templateColumns = getSliderTemplateColumns(); + + const controlProps = { + disabled, + min, + max, + onChange, + size, + value, + }; + + return ( + + { label } + + + + + + ); +} + +export default FontSizeControlSlider; diff --git a/packages/components/src/font-size-picker/next/font-size-control-styles.js b/packages/components/src/font-size-picker/next/font-size-control-styles.js new file mode 100755 index 00000000000000..b4c34f8aa338e5 --- /dev/null +++ b/packages/components/src/font-size-picker/next/font-size-control-styles.js @@ -0,0 +1,11 @@ +/** + * External dependencies + */ +import { css } from '@wp-g2/styles'; + +export const FontSizeControl = css` + appearance: none; + border: none; + margin: 0; + padding: 0; +`; diff --git a/packages/components/src/font-size-picker/next/font-size-control-utils.js b/packages/components/src/font-size-picker/next/font-size-control-utils.js new file mode 100755 index 00000000000000..a3c085c1054b6e --- /dev/null +++ b/packages/components/src/font-size-picker/next/font-size-control-utils.js @@ -0,0 +1,105 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; + +/** + * External dependencies + */ +import { ui } from '@wp-g2/styles'; +import { createUnitValue, parseUnitValue } from '@wp-g2/utils'; + +const DEFAULT_FONT_SIZE = 'default'; +const CUSTOM_FONT_SIZE = 'custom'; +const MAX_FONT_SIZE_DISPLAY = '25px'; +const ASIDE_CONTROL_WIDTH = 70; + +export function hasUnit( value ) { + const [ , unit ] = parseUnitValue( value ); + return !! unit; +} + +function getFontSize( values = [], value ) { + return values.find( ( item ) => item.size === value ); +} + +export function isCustomValue( values = [], value ) { + const item = getFontSize( values, value ); + return !! item; +} + +export function isCustomSelectedItem( selectedItem ) { + return selectedItem?.key === CUSTOM_FONT_SIZE; +} + +export function getSelectValueFromFontSize( fontSizes, value ) { + if ( ! value ) return DEFAULT_FONT_SIZE; + + const fontSize = getFontSize( fontSizes, value ); + return fontSize ? fontSize.slug : CUSTOM_FONT_SIZE; +} + +export function getSelectOptions( { + disableCustomFontSizes, + hasCustomValue, + options, +} ) { + if ( disableCustomFontSizes && ! options.length ) return null; + + options = [ + { slug: DEFAULT_FONT_SIZE, name: __( 'Default' ), size: undefined }, + ...options, + ]; + + if ( ! hasCustomValue && ! disableCustomFontSizes ) { + options.push( { slug: CUSTOM_FONT_SIZE, name: __( 'Custom' ) } ); + } + + return options.map( ( option ) => { + const fontSize = + typeof option.size === 'number' + ? createUnitValue( option.size, 'px' ) + : option.size; + + return { + ...option, + key: option.slug, + style: { + fontSize: `min( ${ fontSize }, ${ MAX_FONT_SIZE_DISPLAY } )`, + }, + }; + } ); +} + +export function getInputValue( fontSizes = [], value ) { + const hasUnits = hasUnit( value || fontSizes[ 0 ]?.size ); + + let noUnitsValue; + if ( ! hasUnits ) { + noUnitsValue = value; + } else { + noUnitsValue = parseInt( value ); + } + + const isPixelValue = + typeof value === 'number' || + ( typeof value === 'string' && value.endsWith( 'px' ) ); + + const inputValue = ( isPixelValue && noUnitsValue ) || ''; + + return inputValue; +} + +export function getSelectTemplateColumns( withNumberInput ) { + return withNumberInput + ? `minmax(0, 1fr) minmax(auto, ${ ui.value.px( + ASIDE_CONTROL_WIDTH * 2 + ) })` + : `minmax(0, 2fr) minmax(auto, ${ ui.value.px( + ASIDE_CONTROL_WIDTH + ) })`; +} + +export function getSliderTemplateColumns() { + return `2fr minmax(auto, ${ ui.value.px( ASIDE_CONTROL_WIDTH ) })`; +} diff --git a/packages/components/src/font-size-picker/next/font-size-control.js b/packages/components/src/font-size-picker/next/font-size-control.js new file mode 100755 index 00000000000000..08e002a0038af3 --- /dev/null +++ b/packages/components/src/font-size-picker/next/font-size-control.js @@ -0,0 +1,76 @@ +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; + +/** + * External dependencies + */ +import { contextConnect } from '@wp-g2/context'; +import { View, VisuallyHidden, VStack } from '@wp-g2/components'; + +/** + * Internal dependencies + */ +import FontSizeControlSelect from './font-size-control-select'; +import FontSizeControlSlider from './font-size-control-slider'; +import { useFontSizeControl } from './use-font-size-control'; + +function FontSizeControl( props, forwardedRef ) { + const { + options, + inputValue, + isDefaultValue, + value, + onChange, + onReset, + onInputChange, + size, + withSlider, + withNumberInput, + withSelect, + ...otherProps + } = useFontSizeControl( props ); + + if ( ! options ) return null; + + const label = __( 'Font size' ); + const customLabel = __( 'Custom' ); + const max = 100; + const min = 1; + + return ( + + { label } + + + + + + ); +} + +export default contextConnect( FontSizeControl, 'FontSizeControl' ); diff --git a/packages/components/src/font-size-picker/next/index.js b/packages/components/src/font-size-picker/next/index.js new file mode 100644 index 00000000000000..d973f3218fb8e1 --- /dev/null +++ b/packages/components/src/font-size-picker/next/index.js @@ -0,0 +1,26 @@ +/** + * Internal dependencies + */ +import { __unstableWithNext as withNext } from '../../__next/context'; +import FontSizeControl from './font-size-control'; + +const FontSizePicker = + process.env.COMPONENT_SYSTEM_PHASE === 1 + ? ( props, ref ) => { + // @todo Wrapped with div.components-base-control for spacing reasons. + // Remove this when the inner Typography Tools component uses VStack + // to automatically space elements apart vertically. + return ( +
      + +
      + ); + } + : undefined; + +export function withNextComponent( current ) { + return withNext( current, FontSizePicker, 'WPComponentsFontSizePicker' ); +} diff --git a/packages/components/src/font-size-picker/next/use-font-size-control.js b/packages/components/src/font-size-picker/next/use-font-size-control.js new file mode 100755 index 00000000000000..df38503ef5bf51 --- /dev/null +++ b/packages/components/src/font-size-picker/next/use-font-size-control.js @@ -0,0 +1,113 @@ +/** + * External dependencies + */ +import { useContextSystem } from '@wp-g2/context'; +import { cx } from '@wp-g2/styles'; +import { createUnitValue, is, noop } from '@wp-g2/utils'; + +/** + * WordPress dependencies + */ +import { useCallback, useMemo } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import * as styles from './font-size-control-styles'; +import { + getInputValue, + getSelectOptions, + getSelectValueFromFontSize, + hasUnit, + isCustomSelectedItem, + isCustomValue, +} from './font-size-control-utils'; + +export function useFontSizeControl( props ) { + const { + disableCustomFontSizes, + fontSizes = [], + onChange = noop, + value, + withSlider = false, + className, + ...otherProps + } = useContextSystem( props ); + + const hasUnits = hasUnit( value || fontSizes[ 0 ]?.size ); + + const hasCustomValue = isCustomValue( fontSizes, value ); + + const options = useMemo( + () => + getSelectOptions( { + options: fontSizes, + disableCustomFontSizes, + hasCustomValue, + } ), + [ fontSizes, disableCustomFontSizes, hasCustomValue ] + ); + + const handleOnReset = useCallback( () => { + onChange( undefined ); + }, [ onChange ] ); + + const handleOnChange = useCallback( + ( { selectedItem } ) => { + if ( isCustomSelectedItem( selectedItem ) ) return; + + if ( hasUnits ) { + onChange( selectedItem.size ); + } else if ( is.defined( selectedItem.size ) ) { + onChange( Number( selectedItem.size ) ); + } else { + handleOnReset(); + } + }, + [ handleOnReset, hasUnits, onChange ] + ); + + const handleOnInputChange = useCallback( + ( next ) => { + if ( ! next && next !== 0 ) { + handleOnReset(); + return; + } + if ( hasUnits ) { + onChange( createUnitValue( next, 'px' ) ); + } else { + onChange( Number( next ) ); + } + }, + [ handleOnReset, hasUnits, onChange ] + ); + + const inputValue = getInputValue( fontSizes, value ); + + const selectedFontSizeSlug = getSelectValueFromFontSize( fontSizes, value ); + const currentValue = options.find( + ( option ) => option.key === selectedFontSizeSlug + ); + + const isDefaultValue = ! is.defined( value, className ); + + const classes = cx( styles.FontSizeControl ); + + const withSelect = fontSizes.length > 0; + const withNumberInput = ! withSlider && ! disableCustomFontSizes; + + return { + ...otherProps, + className: classes, + inputValue, + isDefaultValue, + onChange: handleOnChange, + onInputChange: handleOnInputChange, + onReset: handleOnReset, + options, + value: currentValue, + withNumberInput, + withSelect, + withSlider, + }; +} diff --git a/packages/components/src/index.js b/packages/components/src/index.js index 9911aa6faa887f..6ac5f7cdc4df0e 100644 --- a/packages/components/src/index.js +++ b/packages/components/src/index.js @@ -155,3 +155,9 @@ export { } from './higher-order/with-focus-return'; export { default as withNotices } from './higher-order/with-notices'; export { default as withSpokenMessages } from './higher-order/with-spoken-messages'; + +// Component System +export { + __unstableWithNext, + __unstableComponentSystemProvider, +} from './__next/context'; diff --git a/packages/edit-site/src/components/sidebar/global-styles-sidebar.js b/packages/edit-site/src/components/sidebar/global-styles-sidebar.js index 62592d8c20abbe..43054233b53ccd 100644 --- a/packages/edit-site/src/components/sidebar/global-styles-sidebar.js +++ b/packages/edit-site/src/components/sidebar/global-styles-sidebar.js @@ -6,7 +6,12 @@ import { map, sortBy } from 'lodash'; /** * WordPress dependencies */ -import { Button, PanelBody, TabPanel } from '@wordpress/components'; +import { + Button, + PanelBody, + TabPanel, + __unstableComponentSystemProvider as ComponentSystemProvider, +} from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { getBlockType } from '@wordpress/blocks'; import { useMemo } from '@wordpress/element'; @@ -44,7 +49,9 @@ function GlobalStylesPanel( { } const content = ( - <> + { hasTypographyPanel && ( ) } - + ); if ( ! wrapperPanelTitle ) { return content; diff --git a/webpack.config.js b/webpack.config.js index 4a553dab1af78e..29e5aceb9a87a8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -123,6 +123,13 @@ module.exports = { 10 ) || 1 ), + // Inject the `COMPONENT_SYSTEM_PHASE` global, used for controlling Component System roll-out. + 'process.env.COMPONENT_SYSTEM_PHASE': JSON.stringify( + parseInt( + process.env.npm_package_config_COMPONENT_SYSTEM_PHASE, + 10 + ) || 1 + ), 'process.env.FORCE_REDUCED_MOTION': JSON.stringify( process.env.FORCE_REDUCED_MOTION ), From 5b7544b4382f23f6a0bcf769111a55d5e92e5a58 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Thu, 21 Jan 2021 11:47:20 +1100 Subject: [PATCH 44/61] Update changelog files --- packages/babel-plugin-import-jsx-pragma/CHANGELOG.md | 2 ++ packages/babel-plugin-import-jsx-pragma/package.json | 2 +- packages/babel-plugin-makepot/CHANGELOG.md | 2 ++ packages/babel-plugin-makepot/package.json | 2 +- packages/babel-preset-default/CHANGELOG.md | 2 ++ packages/babel-preset-default/package.json | 2 +- packages/browserslist-config/CHANGELOG.md | 2 ++ packages/browserslist-config/package.json | 2 +- packages/compose/CHANGELOG.md | 2 ++ packages/compose/package.json | 2 +- packages/create-block/CHANGELOG.md | 2 ++ packages/create-block/package.json | 2 +- packages/custom-templated-path-webpack-plugin/CHANGELOG.md | 2 ++ packages/custom-templated-path-webpack-plugin/package.json | 2 +- packages/dependency-extraction-webpack-plugin/CHANGELOG.md | 2 ++ packages/dependency-extraction-webpack-plugin/package.json | 2 +- packages/e2e-test-utils/CHANGELOG.md | 2 ++ packages/e2e-test-utils/package.json | 2 +- packages/e2e-tests/CHANGELOG.md | 2 ++ packages/e2e-tests/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 2 ++ packages/eslint-plugin/package.json | 2 +- packages/interface/CHANGELOG.md | 2 ++ packages/interface/package.json | 2 +- packages/jest-console/CHANGELOG.md | 2 ++ packages/jest-console/package.json | 2 +- packages/jest-preset-default/CHANGELOG.md | 2 ++ packages/jest-preset-default/package.json | 2 +- packages/jest-puppeteer-axe/CHANGELOG.md | 2 ++ packages/jest-puppeteer-axe/package.json | 2 +- packages/library-export-default-webpack-plugin/CHANGELOG.md | 2 ++ packages/library-export-default-webpack-plugin/package.json | 2 +- packages/npm-package-json-lint-config/CHANGELOG.md | 2 ++ packages/npm-package-json-lint-config/package.json | 2 +- packages/postcss-plugins-preset/CHANGELOG.md | 2 ++ packages/postcss-plugins-preset/package.json | 2 +- packages/postcss-themes/CHANGELOG.md | 2 ++ packages/postcss-themes/package.json | 2 +- packages/prettier-config/CHANGELOG.md | 2 ++ packages/prettier-config/package.json | 2 +- packages/scripts/CHANGELOG.md | 2 ++ packages/scripts/package.json | 2 +- packages/stylelint-config/CHANGELOG.md | 2 ++ packages/stylelint-config/package.json | 2 +- 44 files changed, 66 insertions(+), 22 deletions(-) diff --git a/packages/babel-plugin-import-jsx-pragma/CHANGELOG.md b/packages/babel-plugin-import-jsx-pragma/CHANGELOG.md index c057d8a90538a9..0c5f676c50ac19 100644 --- a/packages/babel-plugin-import-jsx-pragma/CHANGELOG.md +++ b/packages/babel-plugin-import-jsx-pragma/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/babel-plugin-import-jsx-pragma/package.json b/packages/babel-plugin-import-jsx-pragma/package.json index 2fdd8153f19db7..50ee47d10b2328 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.7.0", + "version": "3.0.0-prerelease", "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/CHANGELOG.md b/packages/babel-plugin-makepot/CHANGELOG.md index c6c2d79b7bccad..74c8d983f8af7f 100644 --- a/packages/babel-plugin-makepot/CHANGELOG.md +++ b/packages/babel-plugin-makepot/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/babel-plugin-makepot/package.json b/packages/babel-plugin-makepot/package.json index ccc235513a0af8..fc09d73f7c3499 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.10.0", + "version": "4.0.0-prerelease", "description": "WordPress Babel internationalization (i18n) plugin.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/babel-preset-default/CHANGELOG.md b/packages/babel-preset-default/CHANGELOG.md index 20a3292797e9f7..2827f5f850f61b 100644 --- a/packages/babel-preset-default/CHANGELOG.md +++ b/packages/babel-preset-default/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 5.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/babel-preset-default/package.json b/packages/babel-preset-default/package.json index 329137ecba6d15..c4d5b9361f78d5 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.20.0", + "version": "5.0.0-prerelease", "description": "Default Babel preset for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/browserslist-config/CHANGELOG.md b/packages/browserslist-config/CHANGELOG.md index 9d7139edac1d3b..b777a66db64871 100644 --- a/packages/browserslist-config/CHANGELOG.md +++ b/packages/browserslist-config/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/browserslist-config/package.json b/packages/browserslist-config/package.json index 5c7f76f61b0afb..064faa92dd17f0 100644 --- a/packages/browserslist-config/package.json +++ b/packages/browserslist-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/browserslist-config", - "version": "2.7.0", + "version": "3.0.0-prerelease", "description": "WordPress Browserslist shared configuration.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/compose/CHANGELOG.md b/packages/compose/CHANGELOG.md index 5b52d4290ecceb..4f985ad574e87b 100644 --- a/packages/compose/CHANGELOG.md +++ b/packages/compose/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.24.0 (2021-01-21) + ### New Features - Add the `useIsomorphicLayoutEffect` hook. diff --git a/packages/compose/package.json b/packages/compose/package.json index 96e21beeeef1ea..cb411e67cb140f 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/compose", - "version": "3.23.1", + "version": "3.24.0-prerelease", "description": "WordPress higher-order components (HOCs).", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md index 8d66ca5d830dcc..ffbcfd68afd395 100644 --- a/packages/create-block/CHANGELOG.md +++ b/packages/create-block/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/create-block/package.json b/packages/create-block/package.json index 2d6ac5cc2cbdb7..90f8545f65f418 100644 --- a/packages/create-block/package.json +++ b/packages/create-block/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/create-block", - "version": "1.1.0", + "version": "2.0.0-prerelease", "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/custom-templated-path-webpack-plugin/CHANGELOG.md b/packages/custom-templated-path-webpack-plugin/CHANGELOG.md index 54017270362b1c..c798cd62aefcf4 100644 --- a/packages/custom-templated-path-webpack-plugin/CHANGELOG.md +++ b/packages/custom-templated-path-webpack-plugin/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/custom-templated-path-webpack-plugin/package.json b/packages/custom-templated-path-webpack-plugin/package.json index 614eb9caa2b3a4..1f4c5cd5066ea5 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.7.0", + "version": "2.0.0-prerelease", "description": "Webpack plugin for creating custom path template tags.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dependency-extraction-webpack-plugin/CHANGELOG.md b/packages/dependency-extraction-webpack-plugin/CHANGELOG.md index 81d7c89b8a2b06..adf3f711cc4b14 100644 --- a/packages/dependency-extraction-webpack-plugin/CHANGELOG.md +++ b/packages/dependency-extraction-webpack-plugin/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/dependency-extraction-webpack-plugin/package.json b/packages/dependency-extraction-webpack-plugin/package.json index 639089f32de62d..2e97f70f861901 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.9.0", + "version": "3.0.0-prerelease", "description": "Extract WordPress script dependencies from webpack bundles.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/e2e-test-utils/CHANGELOG.md b/packages/e2e-test-utils/CHANGELOG.md index 88dd1fbba037df..403e4f46d5511a 100644 --- a/packages/e2e-test-utils/CHANGELOG.md +++ b/packages/e2e-test-utils/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 5.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/e2e-test-utils/package.json b/packages/e2e-test-utils/package.json index 5e3e004b217d52..c7ee18f9152d6b 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.16.1", + "version": "5.0.0-prerelease", "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/CHANGELOG.md b/packages/e2e-tests/CHANGELOG.md index f40892dddc4074..7ddcf455897a63 100644 --- a/packages/e2e-tests/CHANGELOG.md +++ b/packages/e2e-tests/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 124a37087ae073..91be4ab814fc46 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/e2e-tests", - "version": "1.25.1", + "version": "2.0.0-prerelease", "description": "End-To-End (E2E) tests for WordPress.", "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 c768ae5e6bd7e0..1fbb2f6fee8263 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 8.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 12bf3695da7b70..4105a0fe053022 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/eslint-plugin", - "version": "7.4.0", + "version": "8.0.0-prerelease", "description": "ESLint plugin for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md index 7b4b17109f23f2..e77008add2b694 100644 --- a/packages/interface/CHANGELOG.md +++ b/packages/interface/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 1.0.0 (2021-01-21) + ### Breaking Changes - `leftSidebar` prop in `InterfaceSkeleton` component was removed ([#26517](https://github.com/WordPress/gutenberg/pull/26517). Use `secondarySidebar` prop instead. diff --git a/packages/interface/package.json b/packages/interface/package.json index d32cdf976d5443..476485e49bb36a 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/interface", - "version": "0.11.1", + "version": "1.0.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/jest-console/CHANGELOG.md b/packages/jest-console/CHANGELOG.md index 4fb94f351cb6d6..49351b0a895665 100644 --- a/packages/jest-console/CHANGELOG.md +++ b/packages/jest-console/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/jest-console/package.json b/packages/jest-console/package.json index 79ee476fb38fe4..6fb4586d3f322f 100644 --- a/packages/jest-console/package.json +++ b/packages/jest-console/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/jest-console", - "version": "3.10.0", + "version": "4.0.0-prerelease", "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/CHANGELOG.md b/packages/jest-preset-default/CHANGELOG.md index b50d6ea3a1e1f0..aec66441b2e69c 100644 --- a/packages/jest-preset-default/CHANGELOG.md +++ b/packages/jest-preset-default/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 7.0.0 (2021-01-21) + ### Breaking Changes - The peer `jest` dependency has been updated from requiring `>=25` to requiring `>=26` (see [Breaking Changes](https://jestjs.io/blog/2020/05/05/jest-26), [#27956](https://github.com/WordPress/gutenberg/pull/27956)). diff --git a/packages/jest-preset-default/package.json b/packages/jest-preset-default/package.json index fffdeb7214789c..3994ad98821c63 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": "6.6.0", + "version": "7.0.0-prerelease", "description": "Default Jest preset for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/jest-puppeteer-axe/CHANGELOG.md b/packages/jest-puppeteer-axe/CHANGELOG.md index 08de7b634c5fbb..9a448ac9e55dce 100644 --- a/packages/jest-puppeteer-axe/CHANGELOG.md +++ b/packages/jest-puppeteer-axe/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/jest-puppeteer-axe/package.json b/packages/jest-puppeteer-axe/package.json index 22d60d5533339e..caf3b4ba7c594f 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": "2.0.0", + "version": "3.0.0-prerelease", "description": "Axe API integration with Jest and Puppeteer.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/library-export-default-webpack-plugin/CHANGELOG.md b/packages/library-export-default-webpack-plugin/CHANGELOG.md index c6f18a3d66329e..59db1b85c89e98 100644 --- a/packages/library-export-default-webpack-plugin/CHANGELOG.md +++ b/packages/library-export-default-webpack-plugin/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/library-export-default-webpack-plugin/package.json b/packages/library-export-default-webpack-plugin/package.json index 1464c4e12cab13..3665196a33c740 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.9.0", + "version": "2.0.0-prerelease", "description": "Webpack plugin for exporting default property for selected libraries.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/npm-package-json-lint-config/CHANGELOG.md b/packages/npm-package-json-lint-config/CHANGELOG.md index 13e67c9568302a..d487d248e4b089 100644 --- a/packages/npm-package-json-lint-config/CHANGELOG.md +++ b/packages/npm-package-json-lint-config/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 4.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/npm-package-json-lint-config/package.json b/packages/npm-package-json-lint-config/package.json index 13b7854d92d91c..95b1e68d22c420 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": "3.1.0", + "version": "4.0.0-prerelease", "description": "WordPress npm-package-json-lint shareable configuration.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/postcss-plugins-preset/CHANGELOG.md b/packages/postcss-plugins-preset/CHANGELOG.md index 7b3338d0ac5ecf..6cad5d5ea6c89c 100644 --- a/packages/postcss-plugins-preset/CHANGELOG.md +++ b/packages/postcss-plugins-preset/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 2.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/postcss-plugins-preset/package.json b/packages/postcss-plugins-preset/package.json index 3118d04876cd22..9e8e7f290ea1bb 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": "1.6.0", + "version": "2.0.0-prerelease", "description": "PostCSS sharable plugins preset for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/postcss-themes/CHANGELOG.md b/packages/postcss-themes/CHANGELOG.md index ced4bb8e10a351..20a5490036552c 100644 --- a/packages/postcss-themes/CHANGELOG.md +++ b/packages/postcss-themes/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 3.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/postcss-themes/package.json b/packages/postcss-themes/package.json index 788ac2d70182f4..ea4a6539d7fc28 100644 --- a/packages/postcss-themes/package.json +++ b/packages/postcss-themes/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/postcss-themes", - "version": "2.6.0", + "version": "3.0.0-prerelease", "description": "PostCSS plugin to generate theme colors.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/prettier-config/CHANGELOG.md b/packages/prettier-config/CHANGELOG.md index 567c075903b661..9ed119f7e8b139 100644 --- a/packages/prettier-config/CHANGELOG.md +++ b/packages/prettier-config/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 1.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json index 64cc6938ed63b2..a02d7d37f75125 100644 --- a/packages/prettier-config/package.json +++ b/packages/prettier-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/prettier-config", - "version": "0.4.0", + "version": "1.0.0-prerelease", "description": "WordPress Prettier shared configuration.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index 2a36e77a7a63b4..0f34c27e1dfe50 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 13.0.0 (2021-01-21) + ### Breaking Changes - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/scripts/package.json b/packages/scripts/package.json index e0347d947901bc..fbca843bca88a5 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/scripts", - "version": "12.6.1", + "version": "13.0.0-prerelease", "description": "Collection of reusable scripts for WordPress development.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/stylelint-config/CHANGELOG.md b/packages/stylelint-config/CHANGELOG.md index ecaca1d485dd13..7cddf4838a3b1a 100644 --- a/packages/stylelint-config/CHANGELOG.md +++ b/packages/stylelint-config/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 19.0.0 (2021-01-21) + ### Breaking Change - Increase the minimum Node.js version to 12 ([#27934](https://github.com/WordPress/gutenberg/pull/27934)). diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json index 78669a46d0787c..aff374cd4ab683 100644 --- a/packages/stylelint-config/package.json +++ b/packages/stylelint-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/stylelint-config", - "version": "18.0.0", + "version": "19.0.0-prerelease", "description": "stylelint config for WordPress development.", "author": "The WordPress Contributors", "license": "MIT", From 86016bd9a6297cc0572e6bc50a5565ff3d8bb0cf Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Thu, 21 Jan 2021 11:49:11 +1100 Subject: [PATCH 45/61] chore(release): publish - @wordpress/annotations@1.24.2 - @wordpress/api-fetch@3.21.2 - @wordpress/babel-plugin-import-jsx-pragma@3.0.0 - @wordpress/babel-plugin-makepot@4.0.0 - @wordpress/babel-preset-default@5.0.0 - @wordpress/base-styles@3.3.1 - @wordpress/block-directory@1.18.2 - @wordpress/block-editor@5.2.2 - @wordpress/block-library@2.27.2 - @wordpress/block-serialization-spec-parser@3.7.1 - @wordpress/blocks@6.25.2 - @wordpress/browserslist-config@3.0.0 - @wordpress/components@12.0.2 - @wordpress/compose@3.24.0 - @wordpress/core-data@2.25.2 - @wordpress/create-block-tutorial-template@1.0.0 - @wordpress/create-block@2.0.0 - @wordpress/custom-templated-path-webpack-plugin@2.0.0 - @wordpress/data-controls@1.20.2 - @wordpress/data@4.26.2 - @wordpress/dependency-extraction-webpack-plugin@3.0.0 - @wordpress/dom@2.16.1 - @wordpress/e2e-test-utils@5.0.0 - @wordpress/e2e-tests@2.0.0 - @wordpress/edit-post@3.26.2 - @wordpress/edit-site@1.16.2 - @wordpress/edit-widgets@1.2.2 - @wordpress/editor@9.25.2 - @wordpress/env@3.0.1 - @wordpress/eslint-plugin@8.0.0 - @wordpress/format-library@1.26.2 - @wordpress/interface@1.0.0 - @wordpress/jest-console@4.0.0 - @wordpress/jest-preset-default@7.0.0 - @wordpress/jest-puppeteer-axe@3.0.0 - @wordpress/keyboard-shortcuts@1.13.2 - @wordpress/library-export-default-webpack-plugin@2.0.0 - @wordpress/list-reusable-blocks@1.25.2 - @wordpress/media-utils@1.19.2 - @wordpress/notices@2.12.2 - @wordpress/npm-package-json-lint-config@4.0.0 - @wordpress/nux@3.24.2 - @wordpress/plugins@2.24.2 - @wordpress/postcss-plugins-preset@2.0.0 - @wordpress/postcss-themes@3.0.0 - @wordpress/prettier-config@1.0.0 - @wordpress/reusable-blocks@1.1.2 - @wordpress/rich-text@3.24.2 - @wordpress/scripts@13.0.0 - @wordpress/server-side-render@1.20.2 - @wordpress/stylelint-config@19.0.0 - @wordpress/url@2.21.1 - @wordpress/viewport@2.25.2 --- packages/annotations/package.json | 2 +- packages/api-fetch/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/block-directory/package.json | 2 +- packages/block-editor/package.json | 2 +- packages/block-library/package.json | 2 +- packages/block-serialization-spec-parser/package.json | 2 +- packages/blocks/package.json | 2 +- packages/browserslist-config/package.json | 2 +- packages/components/package.json | 2 +- packages/compose/package.json | 2 +- packages/core-data/package.json | 2 +- packages/create-block-tutorial-template/package.json | 2 +- packages/create-block/package.json | 2 +- packages/custom-templated-path-webpack-plugin/package.json | 2 +- packages/data-controls/package.json | 2 +- packages/data/package.json | 2 +- packages/dependency-extraction-webpack-plugin/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/env/package.json | 2 +- packages/eslint-plugin/package.json | 2 +- packages/format-library/package.json | 2 +- packages/interface/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/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-plugins-preset/package.json | 2 +- packages/postcss-themes/package.json | 2 +- packages/prettier-config/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/stylelint-config/package.json | 2 +- packages/url/package.json | 2 +- packages/viewport/package.json | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) diff --git a/packages/annotations/package.json b/packages/annotations/package.json index 30921b544b4040..16e7686423cf8a 100644 --- a/packages/annotations/package.json +++ b/packages/annotations/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/annotations", - "version": "1.24.1", + "version": "1.24.2", "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 79a699e429f9c2..7952bd833f6b93 100644 --- a/packages/api-fetch/package.json +++ b/packages/api-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/api-fetch", - "version": "3.21.1", + "version": "3.21.2", "description": "Utility to make WordPress REST API requests.", "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 50ee47d10b2328..a1a7d91eb03975 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": "3.0.0-prerelease", + "version": "3.0.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 fc09d73f7c3499..11d78677826c3b 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": "4.0.0-prerelease", + "version": "4.0.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 c4d5b9361f78d5..aab8a81bf18d69 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": "5.0.0-prerelease", + "version": "5.0.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 404228338dc1e8..c4b166b6193b13 100644 --- a/packages/base-styles/package.json +++ b/packages/base-styles/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/base-styles", - "version": "3.3.0", + "version": "3.3.1", "description": "Base SCSS utilities and variables 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 deacdcfb8e78cc..91cfc06be1993e 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-directory", - "version": "1.18.1", + "version": "1.18.2", "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 05841cb049ec54..9d2815b23d5147 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-editor", - "version": "5.2.1", + "version": "5.2.2", "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 ebe3030f55ce58..819e36eea12037 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/block-library", - "version": "2.27.1", + "version": "2.27.2", "description": "Block library for the WordPress editor.", "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 36909ad495ebfb..062fa21ca5e002 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.7.0", + "version": "3.7.1", "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 8a95c7fa7fef7b..fa27ca529826ab 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/blocks", - "version": "6.25.1", + "version": "6.25.2", "description": "Block API for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/browserslist-config/package.json b/packages/browserslist-config/package.json index 064faa92dd17f0..153eb86b6f6191 100644 --- a/packages/browserslist-config/package.json +++ b/packages/browserslist-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/browserslist-config", - "version": "3.0.0-prerelease", + "version": "3.0.0", "description": "WordPress Browserslist shared configuration.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/components/package.json b/packages/components/package.json index 90625af60663af..a87a7c4d114539 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/components", - "version": "12.0.1", + "version": "12.0.2", "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 cb411e67cb140f..23947b0def0205 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/compose", - "version": "3.24.0-prerelease", + "version": "3.24.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 bbdc210f82f973..04153f148d6d18 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/core-data", - "version": "2.25.1", + "version": "2.25.2", "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-tutorial-template/package.json b/packages/create-block-tutorial-template/package.json index c23ce006e20c76..dbd7724798d7eb 100644 --- a/packages/create-block-tutorial-template/package.json +++ b/packages/create-block-tutorial-template/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/create-block-tutorial-template", - "version": "1.0.0-prerelease", + "version": "1.0.0", "description": "Template for @wordpress/create-block used in the official WordPress tutorial.", "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 90f8545f65f418..69b32424b62f14 100644 --- a/packages/create-block/package.json +++ b/packages/create-block/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/create-block", - "version": "2.0.0-prerelease", + "version": "2.0.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/custom-templated-path-webpack-plugin/package.json b/packages/custom-templated-path-webpack-plugin/package.json index 1f4c5cd5066ea5..42ae93dc70a7df 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": "2.0.0-prerelease", + "version": "2.0.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 92fe68c50fe328..16090cb457622e 100644 --- a/packages/data-controls/package.json +++ b/packages/data-controls/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data-controls", - "version": "1.20.1", + "version": "1.20.2", "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 376d40aeccc03f..1f8a9a72f5bdf7 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/data", - "version": "4.26.1", + "version": "4.26.2", "description": "Data 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 2e97f70f861901..8b426eab385466 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": "3.0.0-prerelease", + "version": "3.0.0", "description": "Extract WordPress script dependencies from webpack bundles.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/dom/package.json b/packages/dom/package.json index cee55f95b4fc13..620dd71889b503 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/dom", - "version": "2.16.0", + "version": "2.16.1", "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 c7ee18f9152d6b..a24b5e59876372 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": "5.0.0-prerelease", + "version": "5.0.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 91be4ab814fc46..5a0bba4787959a 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/e2e-tests", - "version": "2.0.0-prerelease", + "version": "2.0.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 2bb53f8a17e4d9..15e371d7c82ec9 100644 --- a/packages/edit-post/package.json +++ b/packages/edit-post/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-post", - "version": "3.26.1", + "version": "3.26.2", "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 356b6135e329e7..fa1c27ef05ef0a 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-site", - "version": "1.16.1", + "version": "1.16.2", "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 48a3ecbf665a00..21a4a23a08bcf6 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/edit-widgets", - "version": "1.2.1", + "version": "1.2.2", "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 fb6e3d15491fb3..17859e7c888a80 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/editor", - "version": "9.25.1", + "version": "9.25.2", "description": "Building blocks for WordPress editors.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/env/package.json b/packages/env/package.json index 211b8a3c38e577..54ff76bb446976 100644 --- a/packages/env/package.json +++ b/packages/env/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/env", - "version": "3.0.0", + "version": "3.0.1", "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/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 4105a0fe053022..e34eb2b721c712 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/eslint-plugin", - "version": "8.0.0-prerelease", + "version": "8.0.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 cd8bb9e672d59e..e75c9b9087805c 100644 --- a/packages/format-library/package.json +++ b/packages/format-library/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/format-library", - "version": "1.26.1", + "version": "1.26.2", "description": "Format library for the WordPress editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/interface/package.json b/packages/interface/package.json index 476485e49bb36a..e3cff8ba22a10e 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/interface", - "version": "1.0.0-prerelease", + "version": "1.0.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/jest-console/package.json b/packages/jest-console/package.json index 6fb4586d3f322f..141cf3826d330e 100644 --- a/packages/jest-console/package.json +++ b/packages/jest-console/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/jest-console", - "version": "4.0.0-prerelease", + "version": "4.0.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 3994ad98821c63..20400be7cab9e3 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": "7.0.0-prerelease", + "version": "7.0.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 caf3b4ba7c594f..ce50e1eb2fa573 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": "3.0.0-prerelease", + "version": "3.0.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 0ff92c27fe4f38..20141184582fa3 100644 --- a/packages/keyboard-shortcuts/package.json +++ b/packages/keyboard-shortcuts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/keyboard-shortcuts", - "version": "1.13.1", + "version": "1.13.2", "description": "Handling keyboard shortcuts.", "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 3665196a33c740..ff470cabb7e3e1 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": "2.0.0-prerelease", + "version": "2.0.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 a18ba7edb6a6b1..dec3dafa9e64fa 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.25.1", + "version": "1.25.2", "description": "Adding Export/Import support to the reusable blocks listing.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/media-utils/package.json b/packages/media-utils/package.json index 196f4d850640f4..605fc285bf01fa 100644 --- a/packages/media-utils/package.json +++ b/packages/media-utils/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/media-utils", - "version": "1.19.1", + "version": "1.19.2", "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 eefa1fefb98c18..15396eef98bf01 100644 --- a/packages/notices/package.json +++ b/packages/notices/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/notices", - "version": "2.12.1", + "version": "2.12.2", "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 95b1e68d22c420..cf43667dd464c3 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": "4.0.0-prerelease", + "version": "4.0.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 7ef278b00a1fe2..24f05091f8a5cf 100644 --- a/packages/nux/package.json +++ b/packages/nux/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/nux", - "version": "3.24.1", + "version": "3.24.2", "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 5c088e7e3fd72f..f221f13e23d852 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/plugins", - "version": "2.24.1", + "version": "2.24.2", "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 9e8e7f290ea1bb..460517a82f8ae0 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": "2.0.0-prerelease", + "version": "2.0.0", "description": "PostCSS sharable plugins preset for WordPress development.", "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 ea4a6539d7fc28..d0fdd8f0dfe064 100644 --- a/packages/postcss-themes/package.json +++ b/packages/postcss-themes/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/postcss-themes", - "version": "3.0.0-prerelease", + "version": "3.0.0", "description": "PostCSS plugin to generate theme colors.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json index a02d7d37f75125..6d4d400dfb95c1 100644 --- a/packages/prettier-config/package.json +++ b/packages/prettier-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/prettier-config", - "version": "1.0.0-prerelease", + "version": "1.0.0", "description": "WordPress Prettier shared configuration.", "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 29f46c0986750a..069db0f87be6f6 100644 --- a/packages/reusable-blocks/package.json +++ b/packages/reusable-blocks/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/reusable-blocks", - "version": "1.1.1", + "version": "1.1.2", "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 296701191860fc..206ff9e9f36131 100644 --- a/packages/rich-text/package.json +++ b/packages/rich-text/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/rich-text", - "version": "3.24.1", + "version": "3.24.2", "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 fbca843bca88a5..ad93a2aa22f620 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/scripts", - "version": "13.0.0-prerelease", + "version": "13.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 5b0ddd63205ace..460f6e62b825a0 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.20.1", + "version": "1.20.2", "description": "The component used with WordPress to server-side render a preview of dynamic blocks to display in the editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json index aff374cd4ab683..16735bfe203b5f 100644 --- a/packages/stylelint-config/package.json +++ b/packages/stylelint-config/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/stylelint-config", - "version": "19.0.0-prerelease", + "version": "19.0.0", "description": "stylelint config for WordPress development.", "author": "The WordPress Contributors", "license": "MIT", diff --git a/packages/url/package.json b/packages/url/package.json index 9928b50fec243a..70d7371b17ff72 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/url", - "version": "2.21.0", + "version": "2.21.1", "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 e6a54b9e0f34f6..2846c2802946e9 100644 --- a/packages/viewport/package.json +++ b/packages/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/viewport", - "version": "2.25.1", + "version": "2.25.2", "description": "Viewport module for WordPress.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", From 7a2b5a2f6ddef7588db49a82105d83a38706bcc2 Mon Sep 17 00:00:00 2001 From: jordesign Date: Thu, 21 Jan 2021 12:28:17 +1100 Subject: [PATCH 46/61] Disable alignment for innerBlocks of Nav Block (#27365) * Disable alignment for innerBlocks of Nav Block * Update edit.js * Update edit.js trying to fix conflict --- packages/block-library/src/navigation/edit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index 859fec8ee3ee51..c22be04525c8cd 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -93,6 +93,10 @@ function Navigation( { // Block on the experimental menus screen does not // inherit templateLock={ 'all' }. templateLock: false, + __experimentalLayout: { + type: 'default', + alignments: [], + }, placeholder: , } ); From f559d9580cbd404da9149407b2dcb872ca10f434 Mon Sep 17 00:00:00 2001 From: Kai Hao Date: Thu, 21 Jan 2021 12:11:19 +0800 Subject: [PATCH 47/61] Widget e2e tests: Wait for the added paragraph to appear (#28375) --- packages/e2e-tests/specs/widgets/adding-widgets.test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/e2e-tests/specs/widgets/adding-widgets.test.js b/packages/e2e-tests/specs/widgets/adding-widgets.test.js index 97a0bbd66500de..2547eb6e91f865 100644 --- a/packages/e2e-tests/specs/widgets/adding-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/adding-widgets.test.js @@ -204,8 +204,13 @@ describe( 'Widgets screen', () => { ); await paragraphBlock.click(); - const firstParagraphBlock = await firstWidgetArea.$( - '[data-block][data-type="core/paragraph"][aria-label^="Empty block"]' + const firstParagraphBlock = await page.waitForFunction( + ( widgetArea ) => + widgetArea.querySelector( + '[data-block][data-type="core/paragraph"][aria-label^="Empty block"]' + ), + {}, + firstWidgetArea ); expect( From d69bd86820c2296f5193f610bd062c3b4aae6ae8 Mon Sep 17 00:00:00 2001 From: Hsing-Yu Flowers-Chang Date: Wed, 20 Jan 2021 23:17:14 -0500 Subject: [PATCH 48/61] Ensure inline image width popover doesn't appear over media library modal (#28333) --- packages/base-styles/_z-index.scss | 3 +++ packages/format-library/src/image/index.js | 1 + packages/format-library/src/image/style.scss | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss index 630323a8713487..c4efa619060c5d 100644 --- a/packages/base-styles/_z-index.scss +++ b/packages/base-styles/_z-index.scss @@ -54,6 +54,9 @@ $z-layers: ( // Needs to be bellow media library that has a z-index of 160000. "{core/video track editor popover}": 160000 - 10, + // Needs to be bellow media library that has a z-index of 160000. + ".block-editor-format-toolbar__image-popover": 160000 - 10, + // Small screen inner blocks overlay must be displayed above drop zone, // settings menu, and movers. ".block-editor-block-list__layout.has-overlay::after": 60, diff --git a/packages/format-library/src/image/index.js b/packages/format-library/src/image/index.js index e250fb4f296fba..29be6feecd43ce 100644 --- a/packages/format-library/src/image/index.js +++ b/packages/format-library/src/image/index.js @@ -47,6 +47,7 @@ function InlineUI( { value, onChange, activeObjectAttributes, contentRef } ) { position="bottom center" focusOnMount={ false } anchorRef={ anchorRef } + className="block-editor-format-toolbar__image-popover" >
      Date: Thu, 21 Jan 2021 06:01:20 +0100 Subject: [PATCH 49/61] Replace deprecated waitFor in e2e tests (#28360) * Replace waitFor with waitForTimeout * Replace waitFor with waitForFunction * Replace waitFor with waitForSelector and waitForTimeout * Update message for waitFor and add rule for waitForTimeout * Disable rule for next line --- .eslintrc.js | 6 ++++++ packages/e2e-test-utils/src/delete-theme.js | 2 +- packages/e2e-test-utils/src/preview.js | 6 ++++-- .../specs/editor/plugins/custom-post-types.test.js | 3 +-- packages/e2e-tests/specs/editor/plugins/nonce.test.js | 2 +- .../e2e-tests/specs/editor/various/adding-blocks.test.js | 2 +- packages/e2e-tests/specs/editor/various/autosave.test.js | 2 +- packages/e2e-tests/specs/editor/various/links.test.js | 2 +- packages/e2e-tests/specs/editor/various/nux.test.js | 2 +- .../e2e-tests/specs/editor/various/reusable-blocks.test.js | 2 +- packages/e2e-tests/specs/widgets/adding-widgets.test.js | 1 + 11 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 37a4ede7f353c8..c51b9a24f745f0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -110,6 +110,12 @@ module.exports = { { selector: 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]', + message: + 'This method is deprecated. You should use the more explicit API methods available.', + }, + { + selector: + 'CallExpression[callee.object.name="page"][callee.property.name="waitForTimeout"]', message: 'Prefer page.waitForSelector instead.', }, { diff --git a/packages/e2e-test-utils/src/delete-theme.js b/packages/e2e-test-utils/src/delete-theme.js index 074fcb92c9d82d..40885968af7497 100644 --- a/packages/e2e-test-utils/src/delete-theme.js +++ b/packages/e2e-test-utils/src/delete-theme.js @@ -41,7 +41,7 @@ export async function deleteTheme( // Wait for the theme to be removed from the page. // eslint-disable-next-line no-restricted-syntax - await page.waitFor( + await page.waitForFunction( ( themeSlug ) => ! document.querySelector( `[data-slug="${ themeSlug }"]` ), slug diff --git a/packages/e2e-test-utils/src/preview.js b/packages/e2e-test-utils/src/preview.js index 90486bb174c65d..f1f5a8747b46bd 100644 --- a/packages/e2e-test-utils/src/preview.js +++ b/packages/e2e-test-utils/src/preview.js @@ -15,12 +15,14 @@ export async function openPreviewPage( editorPage = page ) { let openTabs = await browser.pages(); const expectedTabsCount = openTabs.length + 1; await editorPage.click( '.block-editor-post-preview__button-toggle' ); - await editorPage.waitFor( '.edit-post-header-preview__button-external' ); + await editorPage.waitForSelector( + '.edit-post-header-preview__button-external' + ); await editorPage.click( '.edit-post-header-preview__button-external' ); // Wait for the new tab to open. while ( openTabs.length < expectedTabsCount ) { - await editorPage.waitFor( 1 ); + await editorPage.waitForTimeout( 1 ); openTabs = await browser.pages(); } diff --git a/packages/e2e-tests/specs/editor/plugins/custom-post-types.test.js b/packages/e2e-tests/specs/editor/plugins/custom-post-types.test.js index 73e00ec1a5a918..0a874ac6ba8de3 100644 --- a/packages/e2e-tests/specs/editor/plugins/custom-post-types.test.js +++ b/packages/e2e-tests/specs/editor/plugins/custom-post-types.test.js @@ -63,8 +63,7 @@ describe( 'Test Custom Post Types', () => { await page.waitForSelector( PARENT_PAGE_INPUT ); // Wait for the list of suggestions to fetch // There should be a better way to do that. - // eslint-disable-next-line no-restricted-syntax - await page.waitFor( + await page.waitForFunction( ( [ value, inputSelector ] ) => document.querySelector( inputSelector ).value === value, {}, diff --git a/packages/e2e-tests/specs/editor/plugins/nonce.test.js b/packages/e2e-tests/specs/editor/plugins/nonce.test.js index 5fd76c4d11f510..f2be63aa9beaad 100644 --- a/packages/e2e-tests/specs/editor/plugins/nonce.test.js +++ b/packages/e2e-tests/specs/editor/plugins/nonce.test.js @@ -24,7 +24,7 @@ describe( 'Nonce', () => { it( 'should refresh when expired', async () => { await page.keyboard.press( 'Enter' ); // eslint-disable-next-line no-restricted-syntax - await page.waitFor( 5000 ); + await page.waitForTimeout( 5000 ); await page.keyboard.type( 'test' ); // `saveDraft` waits for saving to be successful, so this test would // timeout if it's not. diff --git a/packages/e2e-tests/specs/editor/various/adding-blocks.test.js b/packages/e2e-tests/specs/editor/various/adding-blocks.test.js index 8af2b7cd6b5b5e..efe1a049a78207 100644 --- a/packages/e2e-tests/specs/editor/various/adding-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/adding-blocks.test.js @@ -293,7 +293,7 @@ describe( 'adding blocks', () => { // We need to wait a bit after typing otherwise we might an "early" result // that is going to be "detached" when trying to click on it // eslint-disable-next-line no-restricted-syntax - await page.waitFor( 100 ); + await page.waitForTimeout( 100 ); const coverBlock = await page.waitForSelector( '.block-editor-block-types-list .editor-block-list-item-cover' ); diff --git a/packages/e2e-tests/specs/editor/various/autosave.test.js b/packages/e2e-tests/specs/editor/various/autosave.test.js index 6608b286980bac..432de3cd06ee42 100644 --- a/packages/e2e-tests/specs/editor/various/autosave.test.js +++ b/packages/e2e-tests/specs/editor/various/autosave.test.js @@ -34,7 +34,7 @@ async function sleep( durationInSeconds ) { // `waitFor`, which isn't apt for the use case, when provided an integer, // of waiting for a given amount of time. // eslint-disable-next-line no-restricted-syntax - await page.waitFor( durationInSeconds * 1000 ); + await page.waitForTimeout( durationInSeconds * 1000 ); } async function clearSessionStorage() { diff --git a/packages/e2e-tests/specs/editor/various/links.test.js b/packages/e2e-tests/specs/editor/various/links.test.js index 21c50094a0d1f3..a33132a28ac69d 100644 --- a/packages/e2e-tests/specs/editor/various/links.test.js +++ b/packages/e2e-tests/specs/editor/various/links.test.js @@ -318,7 +318,7 @@ describe( 'Links', () => { // Disable reason: Wait for the animation to complete, since otherwise the // click attempt may occur at the wrong point. // eslint-disable-next-line no-restricted-syntax - await page.waitFor( 100 ); + await page.waitForTimeout( 100 ); // Publish the post await page.click( '.editor-post-publish-button' ); diff --git a/packages/e2e-tests/specs/editor/various/nux.test.js b/packages/e2e-tests/specs/editor/various/nux.test.js index bb4ca717910306..a03e89cbeaaf24 100644 --- a/packages/e2e-tests/specs/editor/various/nux.test.js +++ b/packages/e2e-tests/specs/editor/various/nux.test.js @@ -50,7 +50,7 @@ describe( 'New User Experience (NUX)', () => { ); // This shouldn't be necessary // eslint-disable-next-line no-restricted-syntax - await page.waitFor( 500 ); + await page.waitForTimeout( 500 ); // Press the right arrow key for Page 3 await page.keyboard.press( 'ArrowRight' ); diff --git a/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js b/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js index 5a41aec6e7b00b..a8908c2b31f189 100644 --- a/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js @@ -315,7 +315,7 @@ describe( 'Reusable blocks', () => { // Wait for async mode to dispatch the update. // eslint-disable-next-line no-restricted-syntax - await page.waitFor( 1000 ); + await page.waitForTimeout( 1000 ); // Check that the content of the second reusable block has been updated. const reusableBlocks = await page.$$( '.wp-block-block' ); diff --git a/packages/e2e-tests/specs/widgets/adding-widgets.test.js b/packages/e2e-tests/specs/widgets/adding-widgets.test.js index 2547eb6e91f865..3fd2fe3c744a5a 100644 --- a/packages/e2e-tests/specs/widgets/adding-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/adding-widgets.test.js @@ -316,6 +316,7 @@ async function saveWidgets() { // FIXME: The snackbar above is enough for the widget areas to get saved, // but not enough for the widgets to get saved. + // eslint-disable-next-line no-restricted-syntax await page.waitForTimeout( 500 ); } From 48e53ad10b2e79f07fd7c265b1dc4d4872fc6e13 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 21 Jan 2021 15:00:19 +0900 Subject: [PATCH 50/61] Handle raw transforms that return multiple blocks (#28371) --- .../src/api/raw-handling/html-to-blocks.js | 2 +- test/integration/blocks-raw-handling.test.js | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/packages/blocks/src/api/raw-handling/html-to-blocks.js b/packages/blocks/src/api/raw-handling/html-to-blocks.js index a3cdfae5168f52..cd72c592cc70a3 100644 --- a/packages/blocks/src/api/raw-handling/html-to-blocks.js +++ b/packages/blocks/src/api/raw-handling/html-to-blocks.js @@ -19,7 +19,7 @@ export function htmlToBlocks( html ) { doc.body.innerHTML = html; - return Array.from( doc.body.children ).map( ( node ) => { + return Array.from( doc.body.children ).flatMap( ( node ) => { const rawTransform = findTransform( getRawTransforms(), ( { isMatch } ) => isMatch( node ) diff --git a/test/integration/blocks-raw-handling.test.js b/test/integration/blocks-raw-handling.test.js index 2c869e071c4e92..4493e202294828 100644 --- a/test/integration/blocks-raw-handling.test.js +++ b/test/integration/blocks-raw-handling.test.js @@ -87,6 +87,33 @@ describe( 'Blocks raw handling', () => { }, save: () => null, } ); + + registerBlockType( 'test/transform-to-multiple-blocks', { + title: 'Test Transform to Multiple Blocks', + category: 'text', + transforms: { + from: [ + { + type: 'raw', + isMatch: ( node ) => { + return node.textContent + .split( ' ' ) + .every( ( chunk ) => /^P\S+?/.test( chunk ) ); + }, + transform: ( node ) => { + return node.textContent + .split( ' ' ) + .map( ( chunk ) => + createBlock( 'core/paragraph', { + content: chunk.substring( 1 ), + } ) + ); + }, + }, + ], + }, + save: () => null, + } ); } ); it( 'should filter inline content', () => { @@ -362,6 +389,18 @@ describe( 'Blocks raw handling', () => { ).toBe( block ); } ); + it( 'should handle transforms that return an array of blocks', () => { + const transformed = pasteHandler( { + HTML: '

      P1 P2

      ', + plainText: 'P1 P2\n', + } ) + .map( getBlockContent ) + .join( '' ); + + expect( transformed ).toBe( '

      1

      2

      ' ); + expect( console ).toHaveLogged(); + } ); + describe( 'pasteHandler', () => { [ 'plain', From 5f32886a38fce83a0b56c977e75e01e28ddffa09 Mon Sep 17 00:00:00 2001 From: jennydupuy <75045144+jennydupuy@users.noreply.github.com> Date: Thu, 21 Jan 2021 07:06:58 +0100 Subject: [PATCH 51/61] Replace heading by block in anchor desc (#28367) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HTML Anchor field is described as follows: "Enter a word or two — without spaces — to make a unique web address just for this heading, called an “anchor.” Then, you’ll be able to link directly to this section of your page." Link to string on translate: https://translate.wordpress.org/projects/wp/dev/fr/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=8431365&filters%5Btranslation_id%5D=66590331 The problem lies in the use of the term "heading" which is inappropriate since it is possible to define an HTML anchor on all the blocks (with a few exceptions) whereas the term "heading" refers only to the Heading block. I propose to simply replace the term "heading" by the term "block" in these string. "Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page." Thus there will be no more inaccuracy on the element to which the anchor is applied. The line 80 has been edited, I replaced "heading" by "block". I hope I made the modification correctly. --- packages/block-editor/src/hooks/anchor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/hooks/anchor.js b/packages/block-editor/src/hooks/anchor.js index a5e5bcc9febf66..4b08d60ae91e14 100644 --- a/packages/block-editor/src/hooks/anchor.js +++ b/packages/block-editor/src/hooks/anchor.js @@ -77,7 +77,7 @@ export const withInspectorControl = createHigherOrderComponent( help={ <> { __( - 'Enter a word or two — without spaces — to make a unique web address just for this heading, called an “anchor.” Then, you’ll be able to link directly to this section of your page.' + 'Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page.' ) } Date: Thu, 21 Jan 2021 14:11:07 +0800 Subject: [PATCH 52/61] Fix typewriter test by using mouse.wheel and waiting for scroll (#28376) --- .../specs/editor/various/typewriter.test.js | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/packages/e2e-tests/specs/editor/various/typewriter.test.js b/packages/e2e-tests/specs/editor/various/typewriter.test.js index d1983e465e785d..563848b4f932fd 100644 --- a/packages/e2e-tests/specs/editor/various/typewriter.test.js +++ b/packages/e2e-tests/specs/editor/various/typewriter.test.js @@ -90,7 +90,8 @@ describe( 'TypeWriter', () => { // Create first block. await page.keyboard.press( 'Enter' ); - // Create blocks until there is a scrollable container. + // Create zero or more blocks until there is a scrollable container. + // No blocks should be created if there's already a scrollbar. while ( await page.evaluate( () => ! wp.dom.getScrollContainer( document.activeElement ) @@ -99,21 +100,37 @@ describe( 'TypeWriter', () => { await page.keyboard.press( 'Enter' ); } - await page.evaluate( + const scrollPosition = await page.evaluate( + () => wp.dom.getScrollContainer( document.activeElement ).scrollTop + ); + // Expect scrollbar to be at the top. + expect( scrollPosition ).toBe( 0 ); + + // Move the mouse to the scroll container, and scroll down + // a small amount to trigger the typewriter mode. + const mouseMovePosition = await page.evaluate( () => { + const caretRect = wp.dom.computeCaretRect( window ); + return [ Math.floor( caretRect.x ), Math.floor( caretRect.y ) ]; + } ); + await page.mouse.move( ...mouseMovePosition ); + await page.mouse.wheel( { deltaY: 2 } ); + await page.waitForFunction( () => - ( wp.dom.getScrollContainer( - document.activeElement - ).scrollTop = 1 ) + wp.dom.getScrollContainer( document.activeElement ) + .scrollTop === 2 ); + // After hitting Enter to create a new block, the caret screen + // coordinates should be the same. const initialPosition = await getCaretPosition(); - - // Should maintain scroll position. await page.keyboard.press( 'Enter' ); - - expect( await getDiff( initialPosition ) ).toBeLessThanOrEqual( - BUFFER + await page.waitForFunction( + () => + // Wait for the Typewriter to scroll down past the initial position. + wp.dom.getScrollContainer( document.activeElement ).scrollTop > + 2 ); + expect( await getDiff( initialPosition ) ).toBe( 0 ); } ); it( 'should maintain caret position after leaving last editable', async () => { From 59c4e2406f3d4ad73ee899f51b1fda0e91b6876a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justin=20S=C3=A8gb=C3=A9dji=20Ahinon?= Date: Thu, 21 Jan 2021 07:29:51 +0100 Subject: [PATCH 53/61] Update the main readme with the current Gutenberg project phase (#28359) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e06917e542547..1385857f486d89 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Welcome to the development hub for the WordPress Gutenberg project! -"Gutenberg" is a codename for a whole new paradigm in WordPress site building and publishing, that aims to revolutionize the entire publishing experience as much as Gutenberg did the printed word. Right now, the project is in the first phase of a four-phase process that will touch every piece of WordPress -- Editing, Customization, Collaboration, and Multilingual -- and is focused on a new editing experience, the block editor. +"Gutenberg" is a codename for a whole new paradigm in WordPress site building and publishing, that aims to revolutionize the entire publishing experience as much as Gutenberg did the printed word. Right now, the project is in the second phase of a four-phase process that will touch every piece of WordPress -- Editing, **Customization** (which includes Full Site Editing, Block Patterns, Block Directory and Block based themes), Collaboration, and Multilingual -- and is focused on a new editing experience, the block editor. The block editor introduces a modular approach to pages and posts: each piece of content in the editor, from a paragraph to an image gallery to a headline, is its own block. And just like physical blocks, WordPress blocks can added, arranged, and rearranged, allowing WordPress users to create media-rich pages in a visually intuitive way -- and without work-arounds like shortcodes or custom HTML. From d4cc9a424de4a718e098f8cc49c17950a2af59cc Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Thu, 21 Jan 2021 10:07:42 +0100 Subject: [PATCH 54/61] Keyboard shortcut to save naviagtion added. (#28257) * Keyboard shortcut to save naviagtion added. Also saving post logic moved to upper layer so both - save button and cmd+s shortcut are using the same piece of code. * undo changes as there is already a mechanism to use keyboard shortcuts. Use this mechanism Co-authored-by: grzegorz_marzencki --- packages/edit-navigation/src/components/layout/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/edit-navigation/src/components/layout/index.js b/packages/edit-navigation/src/components/layout/index.js index 77329aef004f62..37ce18de7580bf 100644 --- a/packages/edit-navigation/src/components/layout/index.js +++ b/packages/edit-navigation/src/components/layout/index.js @@ -6,6 +6,7 @@ import { Popover, SlotFillProvider, } from '@wordpress/components'; +import { useDispatch } from '@wordpress/data'; import { BlockEditorKeyboardShortcuts, BlockEditorProvider, @@ -24,8 +25,12 @@ import Notices from '../notices'; import Toolbar from '../toolbar'; import Editor from '../editor'; import InspectorAdditions from '../inspector-additions'; +import { store as editNavigationStore } from '../../store'; export default function Layout( { blockEditorSettings } ) { + const { saveNavigationPost } = useDispatch( editNavigationStore ); + const savePost = () => saveNavigationPost( navigationPost ); + const { menus, selectedMenuId, @@ -68,6 +73,10 @@ export default function Layout( { blockEditorSettings } ) { } } useSubRegistry={ false } > + + Date: Thu, 21 Jan 2021 11:00:45 +0100 Subject: [PATCH 55/61] [RNMobile] Reusable blocks - Present block content (preview mode) (#25265) --- .../src/components/inserter/menu.native.js | 7 +- .../src/block/edit-title.native.js | 63 ++++ .../block-library/src/block/edit.native.js | 273 ++++++++++++++++++ .../src/block/editor.native.scss | 115 ++++++++ packages/block-library/src/index.native.js | 1 + .../components/src/disabled/index.native.js | 10 + packages/components/src/index.native.js | 1 + .../components/src/spinner/index.native.js | 2 +- .../provider/use-block-editor-settings.js | 8 +- packages/icons/src/index.js | 1 + packages/icons/src/library/lock.js | 12 + .../src/api-fetch-setup.js | 2 +- .../src/test/api-fetch-setup.test.js | 1 + 13 files changed, 491 insertions(+), 5 deletions(-) create mode 100644 packages/block-library/src/block/edit-title.native.js create mode 100644 packages/block-library/src/block/edit.native.js create mode 100644 packages/block-library/src/block/editor.native.scss create mode 100644 packages/components/src/disabled/index.native.js create mode 100644 packages/icons/src/library/lock.js diff --git a/packages/block-editor/src/components/inserter/menu.native.js b/packages/block-editor/src/components/inserter/menu.native.js index 44cc04f428afd4..1e466713e5bb95 100644 --- a/packages/block-editor/src/components/inserter/menu.native.js +++ b/packages/block-editor/src/components/inserter/menu.native.js @@ -123,12 +123,17 @@ export class InserterMenu extends Component { */ getItems() { const { - items, + items: initialItems, canInsertBlockType, destinationRootClientId, getBlockType, } = this.props; + // Filter out reusable blocks (they will be added in another tab) + const items = initialItems.filter( + ( { name } ) => name !== 'core/block' + ); + const clipboard = getClipboard(); const clipboardBlock = clipboard && rawHandler( { HTML: clipboard } )[ 0 ]; diff --git a/packages/block-library/src/block/edit-title.native.js b/packages/block-library/src/block/edit-title.native.js new file mode 100644 index 00000000000000..0a574f2f0cfa83 --- /dev/null +++ b/packages/block-library/src/block/edit-title.native.js @@ -0,0 +1,63 @@ +/** + * External dependencies + */ +import { Text, View } from 'react-native'; + +/** + * WordPress dependencies + */ +import { Icon } from '@wordpress/components'; +import { __ } from '@wordpress/i18n'; +import { withPreferredColorScheme } from '@wordpress/compose'; +import { help, lock } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import styles from './editor.scss'; + +function EditTitle( { getStylesFromColorScheme, title } ) { + const lockIconStyle = getStylesFromColorScheme( + styles.lockIcon, + styles.lockIconDark + ); + const titleStyle = getStylesFromColorScheme( + styles.title, + styles.titleDark + ); + const infoIconStyle = getStylesFromColorScheme( + styles.infoIcon, + styles.infoIconDark + ); + const separatorStyle = getStylesFromColorScheme( + styles.separator, + styles.separatorDark + ); + + return ( + + + + + + { title } + + + + + + + ); +} + +export default withPreferredColorScheme( EditTitle ); diff --git a/packages/block-library/src/block/edit.native.js b/packages/block-library/src/block/edit.native.js new file mode 100644 index 00000000000000..be604a84f976c3 --- /dev/null +++ b/packages/block-library/src/block/edit.native.js @@ -0,0 +1,273 @@ +/** + * External dependencies + */ +import { + ActivityIndicator, + Platform, + Text, + TouchableWithoutFeedback, + View, +} from 'react-native'; + +/** + * WordPress dependencies + */ +import { useEffect, useRef, useState } from '@wordpress/element'; +import { useEntityBlockEditor } from '@wordpress/core-data'; +import { BottomSheet, Icon, Disabled } from '@wordpress/components'; +import { useSelect, useDispatch } from '@wordpress/data'; +import { __ } from '@wordpress/i18n'; +import { BlockEditorProvider, BlockList } from '@wordpress/block-editor'; +import { usePreferredColorSchemeStyle } from '@wordpress/compose'; +import { help } from '@wordpress/icons'; +import { + requestUnsupportedBlockFallback, + sendActionButtonPressedAction, + actionButtons, +} from '@wordpress/react-native-bridge'; +import { store as reusableBlocksStore } from '@wordpress/reusable-blocks'; +import { applyFilters } from '@wordpress/hooks'; + +/** + * Internal dependencies + */ +import styles from './editor.scss'; +import EditTitle from './edit-title'; + +export default function ReusableBlockEdit( { + attributes: { ref }, + clientId, + isSelected, +} ) { + const recordArgs = [ 'postType', 'wp_block', ref ]; + + const [ showHelp, setShowHelp ] = useState( false ); + const [ sendFallbackMessage, setSendFallbackMessage ] = useState( false ); + const [ sendButtonPressMessage, setSendButtonPressMessage ] = useState( + false + ); + const timeoutId = useRef(); + const infoTextStyle = usePreferredColorSchemeStyle( + styles.infoText, + styles.infoTextDark + ); + const infoTitleStyle = usePreferredColorSchemeStyle( + styles.infoTitle, + styles.infoTitleDark + ); + const infoSheetIconStyle = usePreferredColorSchemeStyle( + styles.infoSheetIcon, + styles.infoSheetIconDark + ); + const actionButtonStyle = usePreferredColorSchemeStyle( + styles.actionButton, + styles.actionButtonDark + ); + const spinnerStyle = usePreferredColorSchemeStyle( + styles.spinner, + styles.spinnerDark + ); + + const { + reusableBlock, + hasResolved, + isEditing, + settings, + isUnsupportedBlockEditorSupported, + canEnableUnsupportedBlockEditor, + } = useSelect( + ( select ) => { + const { getSettings } = select( 'core/block-editor' ); + + return { + reusableBlock: select( 'core' ).getEditedEntityRecord( + ...recordArgs + ), + hasResolved: select( 'core' ).hasFinishedResolution( + 'getEditedEntityRecord', + recordArgs + ), + isSaving: select( 'core' ).isSavingEntityRecord( + ...recordArgs + ), + canUserUpdate: select( 'core' ).canUser( + 'update', + 'blocks', + ref + ), + isEditing: select( + reusableBlocksStore + ).__experimentalIsEditingReusableBlock( clientId ), + settings: getSettings(), + isUnsupportedBlockEditorSupported: + getSettings( 'capabilities' ).unsupportedBlockEditor === + true, + canEnableUnsupportedBlockEditor: + getSettings( 'capabilities' ) + .canEnableUnsupportedBlockEditor === true, + }; + }, + [ ref, clientId ] + ); + + const { invalidateResolution } = useDispatch( 'core' ); + + const [ blocks, onInput, onChange ] = useEntityBlockEditor( + 'postType', + 'wp_block', + { id: ref } + ); + + useEffect( () => { + return () => { + clearTimeout( timeoutId.current ); + /** + * Invalidate entity record upon unmount to keep the reusable block updated + * in case it's modified through UBE + */ + invalidateResolution( 'getEntityRecord', recordArgs ); + }; + }, [] ); + + function openSheet() { + setShowHelp( true ); + } + + function closeSheet() { + setShowHelp( false ); + } + + function requestFallback() { + closeSheet(); + + if ( + canEnableUnsupportedBlockEditor && + ! isUnsupportedBlockEditorSupported + ) { + setSendButtonPressMessage( true ); + } else { + setSendFallbackMessage( true ); + } + } + + function renderSheet() { + const infoTitle = + Platform.OS === 'android' + ? __( + "Reusable blocks aren't editable on WordPress for Android" + ) + : __( "Reusable blocks aren't editable on WordPress for iOS" ); + const reusableBlockActionButton = applyFilters( + 'native.reusable_block_action_button', + __( 'Edit using web editor' ) + ); + + return ( + { + if ( sendFallbackMessage ) { + // On iOS, onModalHide is called when the controller is still part of the hierarchy. + // A small delay will ensure that the controller has already been removed. + timeoutId.current = setTimeout( () => { + requestUnsupportedBlockFallback( + ``, + clientId, + reusableBlock.name, + reusableBlock.title + ); + invalidateResolution( + 'getEntityRecord', + recordArgs + ); + }, 100 ); + setSendFallbackMessage( false ); + } else if ( sendButtonPressMessage ) { + timeoutId.current = setTimeout( () => { + sendActionButtonPressedAction( + actionButtons.missingBlockAlertActionButton + ); + }, 100 ); + setSendButtonPressMessage( false ); + } + } } + > + + + + { infoTitle } + + + { ( isUnsupportedBlockEditorSupported || + canEnableUnsupportedBlockEditor ) && ( + <> + + + + ) } + + ); + } + + if ( ! hasResolved ) { + return ( + + + + ); + } + + if ( ! reusableBlock ) { + return ( + { __( 'Block has been deleted or is unavailable.' ) } + ); + } + + const { title } = reusableBlock; + let element = ( + + + + ); + + if ( ! isEditing ) { + element = { element }; + } + + return ( + + + { isSelected && } + { element } + { renderSheet() } + + + ); +} diff --git a/packages/block-library/src/block/editor.native.scss b/packages/block-library/src/block/editor.native.scss new file mode 100644 index 00000000000000..9421e2f6cf9184 --- /dev/null +++ b/packages/block-library/src/block/editor.native.scss @@ -0,0 +1,115 @@ +.titleContainer { + flex-direction: row; + align-items: center; + padding-bottom: 12; +} + +.title { + font-weight: bold; + color: $light-secondary; + flex-grow: 1; + flex-shrink: 1; +} + +.titleDark { + color: $dark-secondary; +} + +.separator { + background-color: $light-gray-400; + height: 1px; + position: absolute; + left: -$block-selected-to-content + $block-selected-border-width; + right: -$block-selected-to-content + $block-selected-border-width; + bottom: 0; +} + +.separatorDark { + background-color: $gray-70; +} + +.lockIconContainer { + justify-content: flex-start; + align-items: flex-end; + padding-right: 8; +} + +.lockIcon { + color: $light-secondary; +} + +.lockIconDark { + color: $dark-secondary; +} + +.helpIconContainer { + justify-content: flex-start; + align-items: flex-end; +} + +.infoIcon { + color: $light-secondary; +} + +.infoIconDark { + color: $dark-secondary; +} + +.infoContainer { + flex-direction: column; + align-items: center; + justify-content: flex-end; +} + +.infoSheetIcon { + size: 36; + height: 36; + padding-top: 8; + padding-bottom: 8; + color: $gray; +} + +.infoSheetIconDark { + color: $gray-20; +} + +.infoText { + text-align: center; + color: $gray-dark; +} + +.infoTextDark { + color: $white; +} + +.infoTitle { + padding-top: 8; + padding-bottom: 12; + font-size: 20; + font-weight: bold; + color: $gray-dark; +} + +.infoTitleDark { + color: $white; +} + +.actionButton { + color: $blue-50; +} + +.actionButtonDark { + color: $blue-30; +} + +.spinner { + height: $grid-unit-60; + border-width: $border-width; + border-radius: $radius-block-ui; + border-color: $light-gray-400; + justify-content: center; +} + +.spinnerDark { + border-color: $gray-70; +} diff --git a/packages/block-library/src/index.native.js b/packages/block-library/src/index.native.js index 65785c7f3fb378..65d4e94ed6aca0 100644 --- a/packages/block-library/src/index.native.js +++ b/packages/block-library/src/index.native.js @@ -224,6 +224,7 @@ export const registerCoreBlocks = () => { socialLinks, pullquote, file, + devOnly( reusableBlock ), ].forEach( registerBlock ); registerBlockVariations( socialLink ); diff --git a/packages/components/src/disabled/index.native.js b/packages/components/src/disabled/index.native.js new file mode 100644 index 00000000000000..8cd36f5788911d --- /dev/null +++ b/packages/components/src/disabled/index.native.js @@ -0,0 +1,10 @@ +/** + * External dependencies + */ +import { View } from 'react-native'; + +function Disabled( { children } ) { + return { children }; +} + +export default Disabled; diff --git a/packages/components/src/index.native.js b/packages/components/src/index.native.js index 98ec6b2aa8e1a0..6c96e9e646b91a 100644 --- a/packages/components/src/index.native.js +++ b/packages/components/src/index.native.js @@ -46,6 +46,7 @@ export { default as Notice } from './notice'; export { default as NoticeList } from './notice/list'; export { default as RadioControl } from './radio-control'; export { default as UnitControl } from './unit-control'; +export { default as Disabled } from './disabled'; // Higher-Order Components export { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing'; diff --git a/packages/components/src/spinner/index.native.js b/packages/components/src/spinner/index.native.js index 263703486a5789..5b25cf7945c079 100644 --- a/packages/components/src/spinner/index.native.js +++ b/packages/components/src/spinner/index.native.js @@ -9,7 +9,7 @@ import { View } from 'react-native'; import style from './style.scss'; export default function Spinner( props ) { - const { progress } = props; + const { progress = 0 } = props; const width = progress + '%'; diff --git a/packages/editor/src/components/provider/use-block-editor-settings.js b/packages/editor/src/components/provider/use-block-editor-settings.js index 9338189d1ecec0..9e40ec16209498 100644 --- a/packages/editor/src/components/provider/use-block-editor-settings.js +++ b/packages/editor/src/components/provider/use-block-editor-settings.js @@ -6,7 +6,7 @@ import { map, pick, defaultTo, flatten, partialRight } from 'lodash'; /** * WordPress dependencies */ -import { useMemo } from '@wordpress/element'; +import { Platform, useMemo } from '@wordpress/element'; import { useDispatch, useSelect } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; import { store as coreStore } from '@wordpress/core-data'; @@ -130,7 +130,11 @@ function useBlockEditorSettings( settings, hasTemplate ) { reusableBlocks: select( 'core' ).getEntityRecords( 'postType', 'wp_block', - { per_page: -1 } + /** + * Unbounded queries are not supported on native so as a workaround we set per_page with the maximum value. + * Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661 + */ + { per_page: Platform.select( { web: -1, native: 100 } ) } ), hasUploadPermissions: defaultTo( canUser( 'create', 'media' ), diff --git a/packages/icons/src/index.js b/packages/icons/src/index.js index 1ef81d686dd22f..351be86902a6da 100644 --- a/packages/icons/src/index.js +++ b/packages/icons/src/index.js @@ -103,6 +103,7 @@ export { default as lifesaver } from './library/lifesaver'; export { default as link } from './library/link'; export { default as linkOff } from './library/link-off'; export { default as list } from './library/list'; +export { default as lock } from './library/lock'; export { default as loop } from './library/loop'; export { default as mapMarker } from './library/map-marker'; export { default as media } from './library/media'; diff --git a/packages/icons/src/library/lock.js b/packages/icons/src/library/lock.js new file mode 100644 index 00000000000000..6503093111a03b --- /dev/null +++ b/packages/icons/src/library/lock.js @@ -0,0 +1,12 @@ +/** + * WordPress dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +const lock = ( + + + +); + +export default lock; diff --git a/packages/react-native-editor/src/api-fetch-setup.js b/packages/react-native-editor/src/api-fetch-setup.js index ee2a15e1a3f8af..cbf34e78983c05 100644 --- a/packages/react-native-editor/src/api-fetch-setup.js +++ b/packages/react-native-editor/src/api-fetch-setup.js @@ -6,7 +6,7 @@ import apiFetch from '@wordpress/api-fetch'; // Please add only wp.org API paths here! const SUPPORTED_ENDPOINTS = [ - /wp\/v2\/(media|categories)\/?\d*?.*/i, + /wp\/v2\/(media|categories|blocks)\/?\d*?.*/i, /wp\/v2\/search\?.*/i, ]; diff --git a/packages/react-native-editor/src/test/api-fetch-setup.test.js b/packages/react-native-editor/src/test/api-fetch-setup.test.js index c7d5b230fbf8fd..562a5d7fc3475a 100644 --- a/packages/react-native-editor/src/test/api-fetch-setup.test.js +++ b/packages/react-native-editor/src/test/api-fetch-setup.test.js @@ -10,6 +10,7 @@ const supportedPaths = [ 'wp/v2/media/', 'wp/v2/media?context=edit&_locale=user', 'wp/v2/categories/', + 'wp/v2/blocks/28?_locale=user', ]; const unsupportedPaths = [ From 8d1e02254c19dc6715cf99c0984377af41e38194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Thu, 21 Jan 2021 11:31:38 +0100 Subject: [PATCH 56/61] Create Block: Extract the package name from the value passed as an external template (#28383) --- packages/create-block/CHANGELOG.md | 4 ++++ packages/create-block/lib/templates.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/create-block/CHANGELOG.md b/packages/create-block/CHANGELOG.md index ffbcfd68afd395..e4779817823ba8 100644 --- a/packages/create-block/CHANGELOG.md +++ b/packages/create-block/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Bug Fix + +- Extract the package name from the value passed as an external template ([#28383](https://github.com/WordPress/gutenberg/pull/28383)). + ## 2.0.0 (2021-01-21) ### Breaking Changes diff --git a/packages/create-block/lib/templates.js b/packages/create-block/lib/templates.js index f32d05aa3faa80..000e20222ecee8 100644 --- a/packages/create-block/lib/templates.js +++ b/packages/create-block/lib/templates.js @@ -5,6 +5,7 @@ const { command } = require( 'execa' ); const glob = require( 'fast-glob' ); const { mkdtemp, readFile } = require( 'fs' ).promises; const { fromPairs, isObject } = require( 'lodash' ); +const npmPackageArg = require( 'npm-package-arg' ); const { tmpdir } = require( 'os' ); const { join } = require( 'path' ); const rimraf = require( 'rimraf' ).sync; @@ -153,8 +154,9 @@ const getBlockTemplate = async ( templateName ) => { cwd: tempCwd, } ); + const { name } = npmPackageArg( templateName ); return await configToTemplate( - require( require.resolve( templateName, { + require( require.resolve( name, { paths: [ tempCwd ], } ) ) ); From aaeae660e4ffbde26f31d55b7d062993267beab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Thu, 21 Jan 2021 13:31:44 +0100 Subject: [PATCH 57/61] Components: Update dependencies shared with G2 components (#28280) * Components: Update dependncies shared with G2 components * Downgrade @emotion/core * Dowgrade rtlcss * Revert upgrade for react-merge-refs * Fix drag gesture binding for newer version of react-use-gesture * Apply changes to the package lock file Co-authored-by: Jon Q --- package-lock.json | 828 ++++++++++++------ package.json | 2 +- packages/block-editor/package.json | 2 +- packages/block-library/package.json | 2 +- packages/blocks/package.json | 2 +- packages/components/package.json | 10 +- .../src/input-control/input-field.js | 23 +- packages/compose/package.json | 2 +- 8 files changed, 565 insertions(+), 306 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2d2c1ae381918a..7f5fbbf736d779 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1503,6 +1503,21 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@choojs/findup": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", + "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", + "requires": { + "commander": "^2.15.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + } + } + }, "@cnakazawa/watch": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", @@ -1539,9 +1554,9 @@ } }, "@emotion/core": { - "version": "10.0.28", - "resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.0.28.tgz", - "integrity": "sha512-pH8UueKYO5jgg0Iq+AmCLxBsvuGtvlmiDCOuv8fGNYn3cowFpLN98L8zO56U0H1PjDIyAlXymgL3Wu7u7v6hbA==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.1.1.tgz", + "integrity": "sha512-ZMLG6qpXR8x031NXD8HJqugy/AZSkAuMxxqB46pmAR7ze47MhNJ56cdoX243QPZdGctrdfo+s08yZTiwaUcRKA==", "requires": { "@babel/runtime": "^7.5.5", "@emotion/cache": "^10.0.27", @@ -1551,36 +1566,10 @@ "@emotion/utils": "0.11.3" }, "dependencies": { - "@emotion/cache": { - "version": "10.0.29", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.29.tgz", - "integrity": "sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ==", - "requires": { - "@emotion/sheet": "0.9.4", - "@emotion/stylis": "0.8.5", - "@emotion/utils": "0.11.3", - "@emotion/weak-memoize": "0.2.5" - } - }, - "@emotion/sheet": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.4.tgz", - "integrity": "sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA==" - }, - "@emotion/stylis": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz", - "integrity": "sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==" - }, "@emotion/utils": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==" - }, - "@emotion/weak-memoize": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz", - "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==" } } }, @@ -11696,7 +11685,7 @@ "react-spring": "^8.0.19", "redux-multi": "^0.1.12", "rememo": "^3.0.0", - "tinycolor2": "^1.4.1", + "tinycolor2": "^1.4.2", "traverse": "^0.6.6" } }, @@ -11738,7 +11727,7 @@ "memize": "^1.1.0", "moment": "^2.22.1", "react-easy-crop": "^3.0.0", - "tinycolor2": "^1.4.1" + "tinycolor2": "^1.4.2" } }, "@wordpress/block-serialization-default-parser": { @@ -11777,7 +11766,7 @@ "rememo": "^3.0.0", "showdown": "^1.9.1", "simple-html-tokenizer": "^0.5.7", - "tinycolor2": "^1.4.1", + "tinycolor2": "^1.4.2", "uuid": "^8.3.0" } }, @@ -11789,7 +11778,7 @@ "version": "file:packages/components", "requires": { "@babel/runtime": "^7.12.5", - "@emotion/core": "^10.0.22", + "@emotion/core": "^10.1.1", "@emotion/css": "^10.0.22", "@emotion/native": "^10.0.22", "@emotion/styled": "^10.0.23", @@ -11813,7 +11802,7 @@ "@wp-g2/utils": "^0.0.140", "classnames": "^2.2.5", "dom-scroll-into-view": "^1.2.1", - "downshift": "^5.4.0", + "downshift": "^6.0.15", "gradient-parser": "^0.1.5", "lodash": "^4.17.19", "memize": "^1.1.0", @@ -11821,20 +11810,13 @@ "re-resizable": "^6.4.0", "react-dates": "^17.1.1", "react-merge-refs": "^1.0.0", - "react-resize-aware": "^3.0.1", + "react-resize-aware": "^3.1.0", "react-spring": "^8.0.20", - "react-use-gesture": "^7.0.16", + "react-use-gesture": "^9.0.0", "reakit": "^1.3.4", "rememo": "^3.0.0", - "tinycolor2": "^1.4.1", + "tinycolor2": "^1.4.2", "uuid": "^8.3.0" - }, - "dependencies": { - "react-use-gesture": { - "version": "7.0.16", - "resolved": "https://registry.npmjs.org/react-use-gesture/-/react-use-gesture-7.0.16.tgz", - "integrity": "sha512-gwgX+E+WQG0T1uFVl3z8j3ZwH3QQGIgVl7VtQEC2m0IscSs668sSps4Ss3CFp3Vns8xx0j9TVK4aBXH6+YrpEg==" - } } }, "@wordpress/compose": { @@ -11852,7 +11834,7 @@ "memize": "^1.1.0", "mousetrap": "^1.6.5", "react-merge-refs": "^1.0.0", - "react-resize-aware": "^3.0.1", + "react-resize-aware": "^3.1.0", "use-memo-one": "^1.1.1" } }, @@ -12734,27 +12716,11 @@ "reakit": "1.1.0" }, "dependencies": { - "compute-scroll-into-view": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-1.0.16.tgz", - "integrity": "sha512-a85LHKY81oQnikatZYA90pufpZ6sQx++BoCxOEMsjpZx+ZnaKGQnCyCehTRr/1p9GBIAHTjcU9k71kSYWloLiQ==" - }, "csstype": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz", "integrity": "sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==" }, - "downshift": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/downshift/-/downshift-6.1.0.tgz", - "integrity": "sha512-MnEJERij+1pTVAsOPsH3q9MJGNIZuu2sT90uxOCEOZYH6sEzkVGtUcTBVDRQkE8y96zpB7uEbRn24aE9VpHnZg==", - "requires": { - "@babel/runtime": "^7.12.5", - "compute-scroll-into-view": "^1.0.16", - "prop-types": "^15.7.2", - "react-is": "^17.0.1" - } - }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -12768,11 +12734,6 @@ "isarray": "0.0.1" } }, - "react-is": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", - "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==" - }, "reakit": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reakit/-/reakit-1.1.0.tgz", @@ -12835,27 +12796,6 @@ "styled-griddie": "^0.1.3" }, "dependencies": { - "@choojs/findup": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", - "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", - "requires": { - "commander": "^2.15.1" - } - }, - "@emotion/core": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.1.1.tgz", - "integrity": "sha512-ZMLG6qpXR8x031NXD8HJqugy/AZSkAuMxxqB46pmAR7ze47MhNJ56cdoX243QPZdGctrdfo+s08yZTiwaUcRKA==", - "requires": { - "@babel/runtime": "^7.5.5", - "@emotion/cache": "^10.0.27", - "@emotion/css": "^10.0.27", - "@emotion/serialize": "^0.11.15", - "@emotion/sheet": "0.9.4", - "@emotion/utils": "0.11.3" - } - }, "@emotion/is-prop-valid": { "version": "0.8.8", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz", @@ -12868,53 +12808,6 @@ "version": "0.7.4", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz", "integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==" - }, - "@emotion/utils": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", - "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==" - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "postcss": { - "version": "6.0.23", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", - "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "requires": { - "chalk": "^2.4.1", - "source-map": "^0.6.1", - "supports-color": "^5.4.0" - } - }, - "rtlcss": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-2.6.2.tgz", - "integrity": "sha512-06LFAr+GAPo+BvaynsXRfoYTJvSaWRyOhURCQ7aeI1MKph9meM222F+Zkt3bDamyHHJuGi3VPtiRkpyswmQbGA==", - "requires": { - "@choojs/findup": "^0.2.1", - "chalk": "^2.4.2", - "mkdirp": "^0.5.1", - "postcss": "^6.0.23", - "strip-json-comments": "^2.0.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" } } }, @@ -12948,11 +12841,6 @@ "use-isomorphic-layout-effect": "^1.0.0" }, "dependencies": { - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -12971,11 +12859,6 @@ "resolved": "https://registry.npmjs.org/react-merge-refs/-/react-merge-refs-1.1.0.tgz", "integrity": "sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==" }, - "react-resize-aware": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/react-resize-aware/-/react-resize-aware-3.1.0.tgz", - "integrity": "sha512-bIhHlxVTX7xKUz14ksXMEHjzCZPTpQZKZISY3nbTD273pDKPABGFNFBP6Tr42KECxzC5YQiKpMchjTVJCqaxpA==" - }, "reakit-utils": { "version": "0.14.4", "resolved": "https://registry.npmjs.org/reakit-utils/-/reakit-utils-0.14.4.tgz", @@ -12988,11 +12871,6 @@ "requires": { "reakit-utils": "^0.14.4" } - }, - "tinycolor2": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", - "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" } } }, @@ -13315,19 +13193,260 @@ } }, "airbnb-prop-types": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.10.0.tgz", - "integrity": "sha512-M7kDqFO6kFNGV0fHPZaBx672m0jwbpCdbrtW2lcevCEuPB2sKCY3IPa030K/N1iJLEGwCNk4NSag65XBEulwhg==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz", + "integrity": "sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg==", "requires": { - "array.prototype.find": "^2.0.4", - "function.prototype.name": "^1.1.0", - "has": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", + "array.prototype.find": "^2.1.1", + "function.prototype.name": "^1.1.2", + "is-regex": "^1.1.0", + "object-is": "^1.1.2", "object.assign": "^4.1.0", - "object.entries": "^1.0.4", - "prop-types": "^15.6.1", - "prop-types-exact": "^1.1.2" + "object.entries": "^1.1.2", + "prop-types": "^15.7.2", + "prop-types-exact": "^1.2.0", + "react-is": "^16.13.1" + }, + "dependencies": { + "array.prototype.find": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.1.tgz", + "integrity": "sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.4" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "function.prototype.name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.3.tgz", + "integrity": "sha512-H51qkbNSp8mtkJt+nyW1gyStBiKZxfRqySNUR99ylq6BPXHKI4SEvIlTKp4odLfjRKJV04DFWMU3G/YRlQOsag==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "functions-have-names": "^1.2.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + }, + "dependencies": { + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + }, + "object-is": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.4.tgz", + "integrity": "sha512-1ZvAZ4wlF7IyPVOcE1Omikt7UpaFlOQq0HlSti+ZvDH3UiD2brwGMwDbyV43jao2bKJ+4+WdPJHSd7kgzKYVqg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "object.entries": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", + "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + }, + "dependencies": { + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + } } }, "ajv": { @@ -21352,6 +21471,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array.prototype.find/-/array.prototype.find-2.1.0.tgz", "integrity": "sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.13.0" @@ -21361,6 +21481,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -21369,6 +21490,7 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.15.0.tgz", "integrity": "sha512-bhkEqWJ2t2lMeaJDuk7okMkJWI/yqgH/EoGwpcvv0XW9RWQsRspI4wt6xuyuvMvvQE3gg/D9HXppgk21w78GyQ==", + "dev": true, "requires": { "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", @@ -21385,7 +21507,8 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true } } }, @@ -21393,6 +21516,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -21403,6 +21527,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, "requires": { "has-symbols": "^1.0.0" } @@ -23559,7 +23684,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", - "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.0" @@ -24521,9 +24645,9 @@ } }, "compute-scroll-into-view": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-1.0.13.tgz", - "integrity": "sha512-o+w9w7A98aAFi/GjK8cxSV+CdASuPa2rR5UWs3+yHkJzWqaKoBEufFNWYaXInCSmUfDCVhesG+v9MTWqOjsxFg==" + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-1.0.16.tgz", + "integrity": "sha512-a85LHKY81oQnikatZYA90pufpZ6sQx++BoCxOEMsjpZx+ZnaKGQnCyCehTRr/1p9GBIAHTjcU9k71kSYWloLiQ==" }, "computed-style": { "version": "0.1.4", @@ -26112,9 +26236,9 @@ "dev": true }, "deepmerge": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz", - "integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==" + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" }, "defaults": { "version": "1.0.3", @@ -26496,9 +26620,9 @@ } }, "direction": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/direction/-/direction-1.0.2.tgz", - "integrity": "sha512-hSKoz5FBn+zhP9vWKkVQaaxnRDg3/MoPdcg2au54HIUDR8MrP8Ah1jXSJwCXel6SV3Afh5DSzc8Uqv2r1UoQwQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/direction/-/direction-1.0.4.tgz", + "integrity": "sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==" }, "discontinuous-range": { "version": "1.0.0", @@ -26521,6 +26645,24 @@ "esutils": "^2.0.2" } }, + "document.contains": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/document.contains/-/document.contains-1.0.2.tgz", + "integrity": "sha512-YcvYFs15mX8m3AO1QNQy3BlIpSMfNRj3Ujk2BEJxsZG+HZf7/hZ6jr7mDpXrF8q+ff95Vef5yjhiZxm8CGJr6Q==", + "requires": { + "define-properties": "^1.1.3" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + } + } + }, "dom-accessibility-api": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.4.tgz", @@ -26688,20 +26830,20 @@ "integrity": "sha1-9p+W+UDg0FU9rCkROYZaPNAQHjw=" }, "downshift": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/downshift/-/downshift-5.4.0.tgz", - "integrity": "sha512-r3ikikP6H/2c+WSWcP/1nOwBSXwmyiuH3LeEmsjKumWjqd+FAazNUIa/ox2VA+qQ86JuaAIaA4xw79G3Sz/XMA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/downshift/-/downshift-6.1.0.tgz", + "integrity": "sha512-MnEJERij+1pTVAsOPsH3q9MJGNIZuu2sT90uxOCEOZYH6sEzkVGtUcTBVDRQkE8y96zpB7uEbRn24aE9VpHnZg==", "requires": { - "@babel/runtime": "^7.9.1", - "compute-scroll-into-view": "^1.0.13", + "@babel/runtime": "^7.12.5", + "compute-scroll-into-view": "^1.0.16", "prop-types": "^15.7.2", - "react-is": "^16.13.1" + "react-is": "^17.0.1" }, "dependencies": { "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==" } } }, @@ -29772,9 +29914,9 @@ "dev": true }, "fast-memoize": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.1.tgz", - "integrity": "sha512-xdmw296PCL01tMOXx9mdJSmWY29jQgxyuZdq0rEHMu+Tpe1eOEtCycoG6chzlcrWsNgpZP7oL8RiQr7+G6Bl6g==" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==" }, "fastest-levenshtein": { "version": "1.0.12", @@ -30262,30 +30404,6 @@ } } }, - "findup": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", - "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", - "dev": true, - "requires": { - "colors": "~0.6.0-1", - "commander": "~2.1.0" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true - }, - "commander": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", - "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", - "dev": true - } - } - }, "findup-sync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", @@ -30578,6 +30696,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.0.tgz", "integrity": "sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg==", + "dev": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -30593,8 +30712,7 @@ "functions-have-names": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.1.tgz", - "integrity": "sha512-j48B/ZI7VKs3sgeI2cZp7WXWmZXu7Iq5pl5/vptV5N2mq+DGFuS/ulaDjtaoLpYzuD6u8UgrUKHfgo7fDTSiBA==", - "dev": true + "integrity": "sha512-j48B/ZI7VKs3sgeI2cZp7WXWmZXu7Iq5pl5/vptV5N2mq+DGFuS/ulaDjtaoLpYzuD6u8UgrUKHfgo7fDTSiBA==" }, "fuse.js": { "version": "3.6.1", @@ -30675,7 +30793,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -30685,8 +30802,7 @@ "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" } } }, @@ -33253,8 +33369,7 @@ "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" }, "is-number": { "version": "3.0.0", @@ -42828,12 +42943,14 @@ "object-inspect": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "dev": true }, "object-is": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", - "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=" + "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=", + "dev": true }, "object-keys": { "version": "1.0.12", @@ -42869,6 +42986,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz", "integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=", + "dev": true, "requires": { "define-properties": "^1.1.2", "es-abstract": "^1.6.1", @@ -43033,14 +43151,129 @@ } }, "object.values": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.0.4.tgz", - "integrity": "sha1-5STaCbT2b/Bd9FdUbscqyZ8TBpo=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", + "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.6.1", - "function-bind": "^1.1.0", - "has": "^1.0.1" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + }, + "dependencies": { + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "es-abstract": { + "version": "1.18.0-next.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz", + "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==", + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.1", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.3", + "string.prototype.trimstart": "^1.0.3" + }, + "dependencies": { + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + } } }, "objectorarray": { @@ -45799,9 +46032,9 @@ } }, "re-resizable": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/re-resizable/-/re-resizable-6.5.0.tgz", - "integrity": "sha512-jOUyas/4LyVLjFJokLbcUuO/BRpo4jUpBu6Ftx9GgA30mBMTw77z4dtVYc89yOkgwfzca3H3HAFuqZBCCugb5w==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/re-resizable/-/re-resizable-6.9.0.tgz", + "integrity": "sha512-3cUDG81ylyqI0Pdgle/RHwwRYq0ORZzsUaySOCO8IbEtNyaRtrIHYm/jMQ5pjcNiKCxR3vsSymIQZHwJq4gg2Q==", "requires": { "fast-memoize": "^2.5.1" } @@ -45817,11 +46050,10 @@ } }, "react-addons-shallow-compare": { - "version": "15.6.2", - "resolved": "https://registry.npmjs.org/react-addons-shallow-compare/-/react-addons-shallow-compare-15.6.2.tgz", - "integrity": "sha1-GYoAuR/DdiPbZKKP0XtZa6NicC8=", + "version": "15.6.3", + "resolved": "https://registry.npmjs.org/react-addons-shallow-compare/-/react-addons-shallow-compare-15.6.3.tgz", + "integrity": "sha512-EDJbgKTtGRLhr3wiGDXK/+AEJ59yqGS+tKE6mue0aNXT6ZMR7VJbbzIiT6akotmHg1BLj46ElJSb+NBMp80XBg==", "requires": { - "fbjs": "^0.8.4", "object-assign": "^4.1.0" } }, @@ -46743,9 +46975,9 @@ "integrity": "sha512-VkvWuCR5VoTjb+VYUcOjkFo66HDv1Hw8VjKcwQtWr2lJnT8g7epRRyfz8+Zkl2WhwqNeqR0gIe0XYrBa9ePeXg==" }, "react-moment-proptypes": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/react-moment-proptypes/-/react-moment-proptypes-1.6.0.tgz", - "integrity": "sha512-4h7EuhDMTzQqZ+02KUUO+AVA7PqhbD88yXB740nFpNDyDS/bj9jiPyn2rwr9sa8oDyaE1ByFN9+t5XPyPTmN6g==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/react-moment-proptypes/-/react-moment-proptypes-1.7.0.tgz", + "integrity": "sha512-ZbOn/P4u469WEGAw5hgkS/E+g1YZqdves2BjYsLluJobzUZCtManhjHiZKjniBVT7MSHM6D/iKtRVzlXVv3ikA==", "requires": { "moment": ">=1.6.0" } @@ -47815,14 +48047,15 @@ } }, "react-outside-click-handler": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/react-outside-click-handler/-/react-outside-click-handler-1.2.2.tgz", - "integrity": "sha512-MgCxmFARGN1VrZdwoLkER/y3So6mC/fSniXI4XcXcB+Jt05nw/k8a/R1hSoa7p414uZUZ8NfClN3eVmZm9bM5Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/react-outside-click-handler/-/react-outside-click-handler-1.3.0.tgz", + "integrity": "sha512-Te/7zFU0oHpAnctl//pP3hEAeobfeHMyygHB8MnjP6sX5OR8KHT1G3jmLsV3U9RnIYo+Yn+peJYWu+D5tUS8qQ==", "requires": { - "airbnb-prop-types": "^2.10.0", + "airbnb-prop-types": "^2.15.0", "consolidated-events": "^1.1.1 || ^2.0.0", - "object.values": "^1.0.4", - "prop-types": "^15.6.1" + "document.contains": "^1.0.1", + "object.values": "^1.1.0", + "prop-types": "^15.7.2" } }, "react-popper": { @@ -47855,9 +48088,9 @@ } }, "react-portal": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/react-portal/-/react-portal-4.1.5.tgz", - "integrity": "sha512-jJMy9DoVr4HRWPdO8IP/mDHP1Q972/aKkulVQeIrttOIyRNmCkR2IH7gK3HVjhzxy6M+k9TopSWN5q41wO/o6A==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/react-portal/-/react-portal-4.2.1.tgz", + "integrity": "sha512-fE9kOBagwmTXZ3YGRYb4gcMy+kSA+yLO0xnPankjRlfBv4uCpFXqKPfkpsGQQR15wkZ9EssnvTOl1yMzbkxhPQ==", "requires": { "prop-types": "^15.5.8" } @@ -47868,9 +48101,9 @@ "integrity": "sha512-kv5QlFFSZWo7OlJFNYbxRtY66JImuP2LcrFgyJfQaf85gSP+byzG21UbDQEYjU7f//ny8rwiEkO6py2Y+fEgAQ==" }, "react-resize-aware": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/react-resize-aware/-/react-resize-aware-3.0.1.tgz", - "integrity": "sha512-HdPzwdcAv+BMFQEgyacFB40G4IxNMO7tSqaMjbnAouot8LXi5/Rx3/Fv+LU2cQekqiivE1LF4sGnwQ7SnoHrpg==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-resize-aware/-/react-resize-aware-3.1.0.tgz", + "integrity": "sha512-bIhHlxVTX7xKUz14ksXMEHjzCZPTpQZKZISY3nbTD273pDKPABGFNFBP6Tr42KECxzC5YQiKpMchjTVJCqaxpA==" }, "react-select": { "version": "3.1.1", @@ -47886,6 +48119,28 @@ "prop-types": "^15.6.0", "react-input-autosize": "^2.2.2", "react-transition-group": "^4.3.0" + }, + "dependencies": { + "@emotion/core": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@emotion/core/-/core-10.1.1.tgz", + "integrity": "sha512-ZMLG6qpXR8x031NXD8HJqugy/AZSkAuMxxqB46pmAR7ze47MhNJ56cdoX243QPZdGctrdfo+s08yZTiwaUcRKA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.5.5", + "@emotion/cache": "^10.0.27", + "@emotion/css": "^10.0.27", + "@emotion/serialize": "^0.11.15", + "@emotion/sheet": "0.9.4", + "@emotion/utils": "0.11.3" + } + }, + "@emotion/utils": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz", + "integrity": "sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw==", + "dev": true + } } }, "react-sizeme": { @@ -47980,29 +48235,54 @@ "integrity": "sha512-inTAcmX0Y8LWr7XViim5+6XlTsJ7kCgwYRrwxSu1Vkjv+8GyClHITFkGGKYXAv5QywZ8YqiJXpzFx8RZpEVF+w==" }, "react-with-direction": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/react-with-direction/-/react-with-direction-1.3.0.tgz", - "integrity": "sha512-2TflEebNckTNUybw3Rzqjg4BwM/H380ZL5lsbZ5f4UTY2JyE5uQdQZK5T2w+BDJSAMcqoA2RDJYa4e7Cl6C2Kg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/react-with-direction/-/react-with-direction-1.3.1.tgz", + "integrity": "sha512-aGcM21ZzhqeXFvDCfPj0rVNYuaVXfTz5D3Rbn0QMz/unZe+CCiLHthrjQWO7s6qdfXORgYFtmS7OVsRgSk5LXQ==", "requires": { - "airbnb-prop-types": "^2.8.1", + "airbnb-prop-types": "^2.10.0", "brcast": "^2.0.2", - "deepmerge": "^1.5.1", - "direction": "^1.0.1", - "hoist-non-react-statics": "^2.3.1", + "deepmerge": "^1.5.2", + "direction": "^1.0.2", + "hoist-non-react-statics": "^3.3.0", "object.assign": "^4.1.0", "object.values": "^1.0.4", - "prop-types": "^15.6.0" + "prop-types": "^15.6.2" + }, + "dependencies": { + "deepmerge": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz", + "integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==" + }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + } } }, "react-with-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/react-with-styles/-/react-with-styles-3.2.1.tgz", - "integrity": "sha512-L+x/EDgrKkqV6pTfDtLMShf7Xs+bVQ+HAT5rByX88QYX+ft9t5Gn4PWMmg36Ur21IVEBMGjjQQIJGJpBrzbsyg==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/react-with-styles/-/react-with-styles-3.2.3.tgz", + "integrity": "sha512-MTI1UOvMHABRLj5M4WpODfwnveHaip6X7QUMI2x6zovinJiBXxzhA9AJP7MZNaKqg1JRFtHPXZdroUC8KcXwlQ==", "requires": { - "deepmerge": "^1.5.2", - "hoist-non-react-statics": "^2.5.0", - "prop-types": "^15.6.1", + "hoist-non-react-statics": "^3.2.1", + "object.assign": "^4.1.0", + "prop-types": "^15.6.2", "react-with-direction": "^1.3.0" + }, + "dependencies": { + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + } } }, "react-with-styles-interface-css": { @@ -49135,15 +49415,14 @@ "integrity": "sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==" }, "rtlcss": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-2.4.0.tgz", - "integrity": "sha512-hdjFhZ5FCI0ABOfyXOMOhBtwPWtANLCG7rOiOcRf+yi5eDdxmDjqBruWouEnwVdzfh/TWF6NNncIEsigOCFZOA==", - "dev": true, + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-2.6.2.tgz", + "integrity": "sha512-06LFAr+GAPo+BvaynsXRfoYTJvSaWRyOhURCQ7aeI1MKph9meM222F+Zkt3bDamyHHJuGi3VPtiRkpyswmQbGA==", "requires": { - "chalk": "^2.3.0", - "findup": "^0.1.5", + "@choojs/findup": "^0.2.1", + "chalk": "^2.4.2", "mkdirp": "^0.5.1", - "postcss": "^6.0.14", + "postcss": "^6.0.23", "strip-json-comments": "^2.0.0" }, "dependencies": { @@ -49151,7 +49430,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -49162,7 +49440,6 @@ "version": "6.0.23", "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", - "dev": true, "requires": { "chalk": "^2.4.1", "source-map": "^0.6.1", @@ -49172,8 +49449,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" } } }, @@ -51169,6 +51445,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, "requires": { "define-properties": "^1.1.3", "function-bind": "^1.1.1" @@ -51178,6 +51455,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -51188,6 +51466,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "dev": true, "requires": { "define-properties": "^1.1.3", "function-bind": "^1.1.1" @@ -51197,6 +51476,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -51207,7 +51487,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", - "dev": true, "requires": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" @@ -51217,7 +51496,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -53199,9 +53477,9 @@ "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" }, "tinycolor2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz", - "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=" + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" }, "tmp": { "version": "0.0.33", diff --git a/package.json b/package.json index d9790ca796696a..29e0c326be0805 100644 --- a/package.json +++ b/package.json @@ -188,7 +188,7 @@ "react-native": "0.61.5", "react-test-renderer": "16.13.1", "rimraf": "3.0.2", - "rtlcss": "2.4.0", + "rtlcss": "2.6.2", "sass": "1.26.11", "sass-loader": "8.0.2", "semver": "7.3.2", diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json index 9d2815b23d5147..55780673ad67ea 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -64,7 +64,7 @@ "react-spring": "^8.0.19", "redux-multi": "^0.1.12", "rememo": "^3.0.0", - "tinycolor2": "^1.4.1", + "tinycolor2": "^1.4.2", "traverse": "^0.6.6" }, "publishConfig": { diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 819e36eea12037..7cef994258542b 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -61,7 +61,7 @@ "memize": "^1.1.0", "moment": "^2.22.1", "react-easy-crop": "^3.0.0", - "tinycolor2": "^1.4.1" + "tinycolor2": "^1.4.2" }, "publishConfig": { "access": "public" diff --git a/packages/blocks/package.json b/packages/blocks/package.json index fa27ca529826ab..0b074c382c0c66 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -45,7 +45,7 @@ "rememo": "^3.0.0", "showdown": "^1.9.1", "simple-html-tokenizer": "^0.5.7", - "tinycolor2": "^1.4.1", + "tinycolor2": "^1.4.2", "uuid": "^8.3.0" }, "publishConfig": { diff --git a/packages/components/package.json b/packages/components/package.json index a87a7c4d114539..1acdbc939f5193 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -27,7 +27,7 @@ ], "dependencies": { "@babel/runtime": "^7.12.5", - "@emotion/core": "^10.0.22", + "@emotion/core": "^10.1.1", "@emotion/css": "^10.0.22", "@emotion/native": "^10.0.22", "@emotion/styled": "^10.0.23", @@ -51,7 +51,7 @@ "@wp-g2/utils": "^0.0.140", "classnames": "^2.2.5", "dom-scroll-into-view": "^1.2.1", - "downshift": "^5.4.0", + "downshift": "^6.0.15", "gradient-parser": "^0.1.5", "lodash": "^4.17.19", "memize": "^1.1.0", @@ -59,12 +59,12 @@ "re-resizable": "^6.4.0", "react-dates": "^17.1.1", "react-merge-refs": "^1.0.0", - "react-resize-aware": "^3.0.1", + "react-resize-aware": "^3.1.0", "react-spring": "^8.0.20", - "react-use-gesture": "^7.0.16", + "react-use-gesture": "^9.0.0", "reakit": "^1.3.4", "rememo": "^3.0.0", - "tinycolor2": "^1.4.1", + "tinycolor2": "^1.4.2", "uuid": "^8.3.0" }, "publishConfig": { diff --git a/packages/components/src/input-control/input-field.js b/packages/components/src/input-control/input-field.js index d4ec868172fc3c..80798cfa69c281 100644 --- a/packages/components/src/input-control/input-field.js +++ b/packages/components/src/input-control/input-field.js @@ -183,29 +183,12 @@ function InputField( } ); - const { onMouseDown, onTouchStart } = isDragEnabled - ? dragGestureProps() - : {}; - let handleOnMouseDown = onMouseDown; - - /* - * Works around the odd UA (e.g. Firefox) that does not focus inputs of - * type=number when their spinner arrows are pressed. - */ - if ( type === 'number' ) { - handleOnMouseDown = ( event ) => { - if ( event.target !== event.target.ownerDocument.activeElement ) { - event.target.focus(); - } - if ( isDragEnabled ) { - onMouseDown( event ); - } - }; - } + const dragProps = isDragEnabled ? dragGestureProps() : {}; return ( Date: Thu, 21 Jan 2021 14:09:21 +0100 Subject: [PATCH 58/61] Revert "Cover: Fix matrix alignment issue. (#28361)" (#28364) This reverts commit 1796afcc277c3f457904fd616c80fa903f3c74ea. Reason: Visually broken on the frontend This basically gets us back to the state of Cover block styling prior to #28114. --- packages/block-library/src/cover/style.scss | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/cover/style.scss b/packages/block-library/src/cover/style.scss index babccb49bf5c08..fc9f05941b56ec 100644 --- a/packages/block-library/src/cover/style.scss +++ b/packages/block-library/src/cover/style.scss @@ -172,10 +172,8 @@ .wp-block-cover__image-background, .wp-block-cover__video-background { position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; + width: 100%; + height: 100%; object-fit: cover; } From e4a6c1e3bafcdcb2761dd44a5448a332a5c29bb0 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Thu, 21 Jan 2021 14:15:18 +0100 Subject: [PATCH 59/61] Overlay on disabled elements, to catch events and show tooltips (#27529) * adding span to schema in order to handle text color. Remove backgorund color in order not to paste text with the selection highlight * adding possibility to paste coloured text * adding custom html tag in order to preserve information about text color * fix in destructuring * file refactor * sketch - instead of manualy writing schemas, another solution proposed - 1. get default styling (black text) 2. diff the default styling with styles of pasted element to get all nondefault styles applied to element 3. Sanitize output 4. paste the output * mechanism to compare stylings * parser fix * parser fix * children added * when an element with a tooltip is disabled, add additional layer which catch events * tests updated * changes from inline styles to css classes * fix in styling - .event-catcher class was not properly addressed in scss file * change back code block * revert back pharsing-content-reducer * revert back pharsing-content.js with readme * shortcode reverted * linter fix * linter fix * fix typo Co-authored-by: grzegorz_marzencki --- packages/base-styles/_z-index.scss | 5 +- packages/components/src/tooltip/index.js | 92 ++++++++++++++----- packages/components/src/tooltip/style.scss | 14 +++ packages/components/src/tooltip/test/index.js | 40 ++++---- 4 files changed, 107 insertions(+), 44 deletions(-) diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss index c4efa619060c5d..ea03b822ac9243 100644 --- a/packages/base-styles/_z-index.scss +++ b/packages/base-styles/_z-index.scss @@ -148,12 +148,15 @@ $z-layers: ( // Make sure block manager sticky category titles appear above the options ".edit-post-manage-blocks-modal__category-title": 1, + // Needs to be higher than any other element as this is an overlay to catch all events + ".components-tooltip .event-catcher": 100002, + // Needs to appear bellow other color circular picker related UI elements. ".components-circular-option-picker__option-wrapper::before": -1, ".components-circular-option-picker__option.is-pressed": 1, // Needs to be higher than .components-circular-option-picker__option.is-pressed. - ".components-circular-option-picker__option.is-pressed + svg": 2 + ".components-circular-option-picker__option.is-pressed + svg": 2, ); @function z-index( $key ) { diff --git a/packages/components/src/tooltip/index.js b/packages/components/src/tooltip/index.js index adcebdab9dcd9c..294b0df6e93772 100644 --- a/packages/components/src/tooltip/index.js +++ b/packages/components/src/tooltip/index.js @@ -28,6 +28,53 @@ import { useDebounce } from '@wordpress/compose'; */ export const TOOLTIP_DELAY = 700; +const eventCatcher =
      ; + +const getDisabledElement = ( { eventHandlers, child, childrenWithPopover } ) => + cloneElement( + + { cloneElement( eventCatcher, eventHandlers ) } + { cloneElement( child, { + children: childrenWithPopover, + } ) } + , + , + eventHandlers + ); + +const getRegularElement = ( { child, eventHandlers, childrenWithPopover } ) => + cloneElement( child, { + ...eventHandlers, + children: childrenWithPopover, + } ); + +const addPopoverToGrandchildren = ( { + grandchildren, + isOver, + position, + text, + shortcut, +} ) => + concatChildren( + grandchildren, + isOver && ( + + ) + ); + const emitToChild = ( children, eventName, event ) => { if ( Children.count( children ) !== 1 ) { return; @@ -136,33 +183,36 @@ function Tooltip( { children, position, text, shortcut } ) { return children; } - const child = Children.only( children ); - return cloneElement( child, { + const eventHandlers = { onMouseEnter: createToggleIsOver( 'onMouseEnter', true ), onMouseLeave: createToggleIsOver( 'onMouseLeave' ), onClick: createToggleIsOver( 'onClick' ), onFocus: createToggleIsOver( 'onFocus' ), onBlur: createToggleIsOver( 'onBlur' ), onMouseDown: createMouseEvent( 'mouseDown' ), - children: concatChildren( - child.props.children, - isOver && ( - - ) - ), + }; + + const child = Children.only( children ); + const { children: grandchildren, disabled } = child.props; + const getElementWithPopover = disabled + ? getDisabledElement + : getRegularElement; + + const popoverData = { + isOver, + position, + text, + shortcut, + }; + const childrenWithPopover = addPopoverToGrandchildren( { + grandchildren, + ...popoverData, + } ); + + return getElementWithPopover( { + child, + eventHandlers, + childrenWithPopover, } ); } diff --git a/packages/components/src/tooltip/style.scss b/packages/components/src/tooltip/style.scss index a7f4b09a1ffa74..df3cfbcf4826a8 100644 --- a/packages/components/src/tooltip/style.scss +++ b/packages/components/src/tooltip/style.scss @@ -26,3 +26,17 @@ display: inline-block; margin-left: $grid-unit-10; } + +.disabled-element-wrapper { + position: relative; + .event-catcher { + z-index: z-index(".components-tooltip .event-catcher"); + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + bottom: 0; + right: 0; + } +} diff --git a/packages/components/src/tooltip/test/index.js b/packages/components/src/tooltip/test/index.js index 919dc70e3b9b30..aebf7466220897 100644 --- a/packages/components/src/tooltip/test/index.js +++ b/packages/components/src/tooltip/test/index.js @@ -152,33 +152,29 @@ describe( 'Tooltip', () => { }, TOOLTIP_DELAY ); } ); - it( 'should ignore mouseenter on disabled elements', () => { - // Mount: Issues with using `setState` asynchronously with shallow- - // rendered components: https://github.com/airbnb/enzyme/issues/450 - const originalMouseEnter = jest.fn(); + it( 'should show tooltip when an element is disabled', () => { const wrapper = mount( - - + + ); - - wrapper.find( 'button' ).simulate( 'mouseenter', { - // Enzyme does not accurately emulate event targets - // See: https://github.com/airbnb/enzyme/issues/218 - currentTarget: wrapper.find( 'button' ).getDOMNode(), - target: wrapper.find( 'button > span' ).getDOMNode(), + const button = wrapper.find( 'button[disabled]' ); + const buttonNode = button.at( 0 ).getDOMNode(); + const buttonRect = buttonNode.getBoundingClientRect(); + const eventCatcher = wrapper.find( '.event-catcher' ); + const eventCatcherNode = eventCatcher.at( 0 ).getDOMNode(); + const eventCatcherRect = eventCatcherNode.getBoundingClientRect(); + expect( buttonRect ).toEqual( eventCatcherRect ); + + eventCatcher.simulate( 'mouseenter', { + type: 'mouseenter', + currentTarget: {}, } ); - expect( originalMouseEnter ).not.toHaveBeenCalled(); - - const popover = wrapper.find( 'Popover' ); - expect( popover ).toHaveLength( 0 ); + setTimeout( () => { + const popover = wrapper.find( 'Popover' ); + expect( popover ).toHaveLength( 1 ); + }, TOOLTIP_DELAY ); } ); it( 'should cancel pending setIsOver on mouseleave', () => { From 9811055310aaa38a8afcd316f54dae4f776430c7 Mon Sep 17 00:00:00 2001 From: Haz Date: Thu, 21 Jan 2021 16:12:28 +0100 Subject: [PATCH 60/61] Fix block inserter automatic reorder (#28392) --- package-lock.json | 9 ++++----- packages/components/package.json | 2 +- packages/edit-widgets/package.json | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f5fbbf736d779..f3cc99cc7309a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11813,7 +11813,7 @@ "react-resize-aware": "^3.1.0", "react-spring": "^8.0.20", "react-use-gesture": "^9.0.0", - "reakit": "^1.3.4", + "reakit": "^1.3.5", "rememo": "^3.0.0", "tinycolor2": "^1.4.2", "uuid": "^8.3.0" @@ -12118,7 +12118,6 @@ "@wordpress/url": "file:packages/url", "classnames": "^2.2.5", "lodash": "^4.17.19", - "reakit": "^1.3.4", "rememo": "^3.0.0", "uuid": "^8.3.0" } @@ -48437,9 +48436,9 @@ } }, "reakit": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/reakit/-/reakit-1.3.4.tgz", - "integrity": "sha512-aLR0GBOc9vELTk4PKK/zndBbIs4RSw4B7GSGY6yoMHQ/vna0iLNd5BMhjtXspD/B7hhkYERlT6di8pIyD3HSPw==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/reakit/-/reakit-1.3.5.tgz", + "integrity": "sha512-Luv1RPBFlWhRG32Ysjd86KC+vLoz5da3X0O8rqClaNEv259nWmnw5fG6BIUSYJwTG6PPxTidPlS+9bS6nLstfA==", "requires": { "@popperjs/core": "^2.5.4", "body-scroll-lock": "^3.1.5", diff --git a/packages/components/package.json b/packages/components/package.json index 1acdbc939f5193..b7bb587a6a334a 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -62,7 +62,7 @@ "react-resize-aware": "^3.1.0", "react-spring": "^8.0.20", "react-use-gesture": "^9.0.0", - "reakit": "^1.3.4", + "reakit": "^1.3.5", "rememo": "^3.0.0", "tinycolor2": "^1.4.2", "uuid": "^8.3.0" diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json index 21a4a23a08bcf6..261f163584d1ed 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -48,7 +48,6 @@ "@wordpress/url": "file:../url", "classnames": "^2.2.5", "lodash": "^4.17.19", - "reakit": "^1.3.4", "rememo": "^3.0.0", "uuid": "^8.3.0" }, From a0c91bcdfd8f86846a33227ba9851d84476e6bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Thu, 21 Jan 2021 17:55:49 +0100 Subject: [PATCH 61/61] Post Title block: Add placeholder state (#28198) --- packages/block-library/src/post-title/edit.js | 32 ++++++++++++------- .../block-library/src/post-title/index.js | 4 ++- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/post-title/edit.js b/packages/block-library/src/post-title/edit.js index e7c5b39f8cfaeb..34553e53de47ef 100644 --- a/packages/block-library/src/post-title/edit.js +++ b/packages/block-library/src/post-title/edit.js @@ -58,20 +58,28 @@ export default function PostTitleEdit( { const { title, link } = post; let titleElement = ( - - editEntityRecord( 'postType', postType, postId, { - title: value, - } ) - } - __experimentalVersion={ 2 } - { ...( isLink ? {} : blockProps ) } - /> + <TagName { ...( isLink ? {} : blockProps ) }> + { __( 'An example title' ) } + </TagName> ); + if ( postType && postId ) { + titleElement = ( + <PlainText + tagName={ TagName } + placeholder={ __( 'No Title' ) } + value={ title } + onChange={ ( value ) => + editEntityRecord( 'postType', postType, postId, { + title: value, + } ) + } + __experimentalVersion={ 2 } + { ...( isLink ? {} : blockProps ) } + /> + ); + } + if ( isLink ) { titleElement = ( <a diff --git a/packages/block-library/src/post-title/index.js b/packages/block-library/src/post-title/index.js index a62dea4017b883..609ad1405c31a5 100644 --- a/packages/block-library/src/post-title/index.js +++ b/packages/block-library/src/post-title/index.js @@ -15,7 +15,9 @@ export { metadata, name }; export const settings = { title: _x( 'Post Title', 'block title' ), - description: __( 'Add the title of your post.' ), + description: __( + 'Displays the title of a post, page, or any other content-type.' + ), icon, edit, };