diff --git a/packages/block-directory/src/components/downloadable-block-list-item/style.scss b/packages/block-directory/src/components/downloadable-block-list-item/style.scss index e13e46ef8d8786..e30722c88ee791 100644 --- a/packages/block-directory/src/components/downloadable-block-list-item/style.scss +++ b/packages/block-directory/src/components/downloadable-block-list-item/style.scss @@ -15,7 +15,10 @@ background: none; border: 0; text-align: left; - transition: box-shadow 0.1s linear; + + @media not (prefers-reduced-motion) { + transition: box-shadow 0.1s linear; + } // The item contains absolutely positioned items. // Set `position: relative` on the parent to prevent overflow issues diff --git a/packages/block-library/src/navigation/index.js b/packages/block-library/src/navigation/index.js index d0405be794ffe8..36156e5f45bbaa 100644 --- a/packages/block-library/src/navigation/index.js +++ b/packages/block-library/src/navigation/index.js @@ -3,6 +3,9 @@ */ import { __ } from '@wordpress/i18n'; import { navigation as icon } from '@wordpress/icons'; +import { select } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; +import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies @@ -52,6 +55,23 @@ export const settings = { }, edit, save, + __experimentalLabel: ( { ref } ) => { + if ( ! ref ) { + return; + } + + const navigation = select( coreStore ).getEditedEntityRecord( + 'postType', + 'wp_navigation', + ref + ); + + if ( ! navigation?.title ) { + return; + } + + return decodeEntities( navigation.title ); + }, deprecated, }; diff --git a/packages/block-library/src/post-author-name/edit.js b/packages/block-library/src/post-author-name/edit.js index 2b4bb0709356b0..8c0281edb5df8a 100644 --- a/packages/block-library/src/post-author-name/edit.js +++ b/packages/block-library/src/post-author-name/edit.js @@ -15,7 +15,16 @@ import { import { useSelect } from '@wordpress/data'; import { __, sprintf } from '@wordpress/i18n'; import { store as coreStore } from '@wordpress/core-data'; -import { PanelBody, ToggleControl } from '@wordpress/components'; +import { + ToggleControl, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem, +} from '@wordpress/components'; + +/** + * Internal dependencies + */ +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; function PostAuthorNameEdit( { context: { postType, postId }, @@ -61,6 +70,8 @@ function PostAuthorNameEdit( { displayName ); + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + return ( <> @@ -72,26 +83,53 @@ function PostAuthorNameEdit( { /> - - { + setAttributes( { + isLink: false, + linkTarget: '_self', + } ); + } } + dropdownMenuProps={ dropdownMenuProps } + > + setAttributes( { isLink: ! isLink } ) } - checked={ isLink } - /> - { isLink && ( + isShownByDefault + hasValue={ () => isLink } + onDeselect={ () => setAttributes( { isLink: false } ) } + > - setAttributes( { - linkTarget: value ? '_blank' : '_self', - } ) + label={ __( 'Link to author archive' ) } + onChange={ () => + setAttributes( { isLink: ! isLink } ) } - checked={ linkTarget === '_blank' } + checked={ isLink } /> + + { isLink && ( + linkTarget !== '_self' } + onDeselect={ () => + setAttributes( { linkTarget: '_self' } ) + } + > + + setAttributes( { + linkTarget: value ? '_blank' : '_self', + } ) + } + checked={ linkTarget === '_blank' } + /> + ) } - +
{ supportsAuthor diff --git a/packages/block-library/src/query/editor.scss b/packages/block-library/src/query/editor.scss index 5bf0db81870403..ab6b361ed9e98e 100644 --- a/packages/block-library/src/query/editor.scss +++ b/packages/block-library/src/query/editor.scss @@ -1,24 +1,3 @@ -.block-library-query-toolbar__popover .components-popover__content { - min-width: 230px; - - .block-library-query-toolbar__popover-number-control { - margin-bottom: $grid-unit-10; - } -} - -.block-library-query__pattern-selection-content .block-editor-block-patterns-list { - display: grid; - grid-template-columns: 1fr 1fr 1fr; - grid-gap: $grid-unit-10; - - .block-editor-block-patterns-list__list-item { - margin-bottom: 0; - .block-editor-block-preview__container { - max-height: 250px; - } - } -} - .block-library-query-pattern__selection-modal { .block-editor-block-patterns-list { @@ -45,22 +24,12 @@ } } -.block-library-query-toolspanel__design { - .block-library-query-pattern__selection-content { - margin-top: $grid-unit-10; - } -} - .wp-block-query__enhanced-pagination-modal { @include break-small() { max-width: $break-mobile; } } -.wp-block-query__enhanced-pagination-notice { - margin: 0; -} - .block-editor-block-settings-menu__popover { &.is-expanded { overflow-y: scroll; diff --git a/packages/block-library/src/site-logo/edit.js b/packages/block-library/src/site-logo/edit.js index 5bcfafac9f3a08..6d3eda830878ec 100644 --- a/packages/block-library/src/site-logo/edit.js +++ b/packages/block-library/src/site-logo/edit.js @@ -506,6 +506,11 @@ export default function LogoEdit( { }; const onFilesDrop = ( filesList ) => { + if ( filesList?.length > 1 ) { + onUploadError( __( 'Only one image can be used as a site logo.' ) ); + return; + } + getSettings().mediaUpload( { allowedTypes: ALLOWED_MEDIA_TYPES, filesList, diff --git a/packages/block-library/src/table-of-contents/edit.js b/packages/block-library/src/table-of-contents/edit.js index 394ff2666067d4..1b1da0f3d78baa 100644 --- a/packages/block-library/src/table-of-contents/edit.js +++ b/packages/block-library/src/table-of-contents/edit.js @@ -10,11 +10,12 @@ import { } from '@wordpress/block-editor'; import { createBlock } from '@wordpress/blocks'; import { - PanelBody, Placeholder, ToggleControl, ToolbarButton, ToolbarGroup, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem, } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; import { renderToString } from '@wordpress/element'; @@ -29,6 +30,7 @@ import { tableOfContents as icon } from '@wordpress/icons'; import TableOfContentsList from './list'; import { linearToNestedHeadingList } from './utils'; import { useObserveHeadings } from './hooks'; +import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; /** @typedef {import('./utils').HeadingData} HeadingData */ @@ -79,7 +81,7 @@ export default function TableOfContentsEdit( { ); const { replaceBlocks } = useDispatch( blockEditorStore ); - + const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const headingTree = linearToNestedHeadingList( headings ); const toolbarControls = canInsertList && ( @@ -108,25 +110,42 @@ export default function TableOfContentsEdit( { const inspectorControls = ( - - { + setAttributes( { + onlyIncludeCurrentPage: false, + } ); + } } + dropdownMenuProps={ dropdownMenuProps } + > + !! onlyIncludeCurrentPage } label={ __( 'Only include current page' ) } - checked={ onlyIncludeCurrentPage } - onChange={ ( value ) => - setAttributes( { onlyIncludeCurrentPage: value } ) - } - help={ - onlyIncludeCurrentPage - ? __( - 'Only including headings from the current page (if the post is paginated).' - ) - : __( - 'Include headings from all pages (if the post is paginated).' - ) + onDeselect={ () => + setAttributes( { onlyIncludeCurrentPage: false } ) } - /> - + isShownByDefault + > + + setAttributes( { onlyIncludeCurrentPage: value } ) + } + help={ + onlyIncludeCurrentPage + ? __( + 'Only including headings from the current page (if the post is paginated).' + ) + : __( + 'Include headings from all pages (if the post is paginated).' + ) + } + /> + + ); diff --git a/packages/dataviews/src/components/dataviews-footer/style.scss b/packages/dataviews/src/components/dataviews-footer/style.scss index a5cd4dcac9ca02..d8f205f6c8f75c 100644 --- a/packages/dataviews/src/components/dataviews-footer/style.scss +++ b/packages/dataviews/src/components/dataviews-footer/style.scss @@ -6,8 +6,11 @@ padding: $grid-unit-15 $grid-unit-60; border-top: $border-width solid $gray-100; flex-shrink: 0; - transition: padding ease-out 0.1s; - @include reduce-motion("transition"); + + @media not (prefers-reduced-motion) { + transition: padding ease-out 0.1s; + } + z-index: z-index(".dataviews-footer"); } diff --git a/packages/dataviews/src/components/dataviews/style.scss b/packages/dataviews/src/components/dataviews/style.scss index 3c85115c06dddf..b44d5b2543f4af 100644 --- a/packages/dataviews/src/components/dataviews/style.scss +++ b/packages/dataviews/src/components/dataviews/style.scss @@ -18,8 +18,10 @@ flex-shrink: 0; position: sticky; left: 0; - transition: padding ease-out 0.1s; - @include reduce-motion( "transition" ); + + @media not (prefers-reduced-motion) { + transition: padding ease-out 0.1s; + } } .dataviews-no-results, @@ -29,8 +31,10 @@ display: flex; align-items: center; justify-content: center; - transition: padding ease-out 0.1s; - @include reduce-motion( "transition" ); + + @media not (prefers-reduced-motion) { + transition: padding ease-out 0.1s; + } } @container (max-width: 430px) { diff --git a/packages/dataviews/src/dataviews-layouts/grid/style.scss b/packages/dataviews/src/dataviews-layouts/grid/style.scss index 333e6e9a4caf9f..a741b185572934 100644 --- a/packages/dataviews/src/dataviews-layouts/grid/style.scss +++ b/packages/dataviews/src/dataviews-layouts/grid/style.scss @@ -2,10 +2,11 @@ margin-bottom: auto; grid-template-rows: max-content; padding: 0 $grid-unit-60 $grid-unit-30; - transition: padding ease-out 0.1s; container-type: inline-size; - @include reduce-motion("transition"); + @media not (prefers-reduced-motion) { + transition: padding ease-out 0.1s; + } .dataviews-view-grid__card { height: 100%; diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js index 11635c6c6abb12..4138280c2ba28e 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js @@ -42,7 +42,7 @@ function useDeleteNavigationMenu() { type: 'snackbar', } ); - history.navivate( '/navigation' ); + history.navigate( '/navigation' ); } catch ( error ) { createErrorNotice( sprintf( diff --git a/test/e2e/specs/editor/blocks/navigation-list-view.spec.js b/test/e2e/specs/editor/blocks/navigation-list-view.spec.js index 2f9963169a5230..47313590f65794 100644 --- a/test/e2e/specs/editor/blocks/navigation-list-view.spec.js +++ b/test/e2e/specs/editor/blocks/navigation-list-view.spec.js @@ -555,7 +555,10 @@ test.describe( 'Navigation block - List view editing', () => { await editor.openDocumentSettingsSidebar(); - await page.getByLabel( 'Test Menu' ).click(); + await page + .getByRole( 'tabpanel' ) + .getByRole( 'button', { name: 'Test Menu' } ) + .click(); await page.keyboard.press( 'ArrowUp' ); diff --git a/test/e2e/specs/site-editor/navigation-editor.spec.js b/test/e2e/specs/site-editor/navigation-editor.spec.js index 64a80e814d6298..2ceaea06ec2d44 100644 --- a/test/e2e/specs/site-editor/navigation-editor.spec.js +++ b/test/e2e/specs/site-editor/navigation-editor.spec.js @@ -40,6 +40,10 @@ test.describe( 'Editing Navigation Menus', () => { canvas: 'edit', } ); + await expect( + page.getByRole( 'button', { name: 'Document Overview' } ) + ).toBeVisible(); + // Open List View. await pageUtils.pressKeys( 'access+o' ); @@ -54,7 +58,7 @@ test.describe( 'Editing Navigation Menus', () => { await expect( listView ).toBeVisible(); const navBlockNode = listView.getByRole( 'link', { - name: 'Navigation', + name: 'Primary Menu', exact: true, } );