Skip to content

Commit

Permalink
Merge branch 'trunk' into update/item-group-focus-visible
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Jun 22, 2023
2 parents bb9332f + ee36ebc commit 95881b8
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 39 deletions.
24 changes: 0 additions & 24 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -503,30 +503,6 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
left: 0;
}

// Without this, the block cannot be selected, nor does the right container get focus.
// @todo: this is disruptive. Ideally we can retire a few of the containers,
// so focus is applied naturally on the block container.
// It's important the right container has focus, otherwise you can't press
// "Delete" to remove the block.
.wp-block-navigation:not(.is-editing-disabled) {
.wp-block-navigation__responsive-container,
.wp-block-navigation__responsive-close {
@include break-small() {
pointer-events: none;

.wp-block-navigation__responsive-container-close,
.block-editor-block-list__layout * {
pointer-events: all;
}
}

// Page List items should remain inert.
.wp-block-pages-list__item__link {
pointer-events: none;
}
}
}

// The menu and close buttons need higher specificity in the editor.
.components-button.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open,
.components-button.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function KeyboardShortcutsRegister() {
} );

registerShortcut( {
name: `core/customize-widgets/transform-heading-to-paragraph`,
name: 'core/customize-widgets/transform-heading-to-paragraph',
category: 'block-library',
description: __( 'Transform heading to paragraph.' ),
keyCombination: {
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/create-reusable-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const createReusableBlock = async ( content, title ) => {
await page.keyboard.type( content );

await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Create a Pattern' );
await clickMenuItem( 'Create pattern' );
const nameInput = await page.waitForSelector(
reusableBlockNameInputSelector
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe( 'block editor keyboard shortcuts', () => {
} );
it( 'should prevent deleting multiple selected blocks from inputs', async () => {
await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Create a Pattern' );
await clickMenuItem( 'Create pattern' );
const reusableBlockNameInputSelector =
'.reusable-blocks-menu-items__convert-modal .components-text-control__input';
const nameInput = await page.waitForSelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe( 'Reusable blocks', () => {

// Convert block to a reusable block.
await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Create a Pattern' );
await clickMenuItem( 'Create pattern' );

// Set title.
const nameInput = await page.waitForSelector(
Expand Down Expand Up @@ -383,7 +383,7 @@ describe( 'Reusable blocks', () => {

// Convert to reusable.
await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Create a Pattern' );
await clickMenuItem( 'Create pattern' );
const nameInput = await page.waitForSelector(
reusableBlockNameInputSelector
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function KeyboardShortcuts() {
} );

registerShortcut( {
name: `core/edit-post/transform-heading-to-paragraph`,
name: 'core/edit-post/transform-heading-to-paragraph',
category: 'block-library',
description: __( 'Transform heading to paragraph.' ),
keyCombination: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function KeyboardShortcutsRegister() {
} );

registerShortcut( {
name: `core/edit-site/transform-heading-to-paragraph`,
name: 'core/edit-site/transform-heading-to-paragraph',
category: 'block-library',
description: __( 'Transform heading to paragraph.' ),
keyCombination: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function ConvertToTemplatePart( { clientIds, blocks } ) {
setIsModalOpen( true );
} }
>
{ __( 'Create Template part' ) }
{ __( 'Create template part' ) }
</MenuItem>
{ isModalOpen && (
<CreateTemplatePartModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function KeyboardShortcuts() {
} );

useShortcut(
'core/edit-widgets//transform-heading-to-paragraph',
'core/edit-widgets/transform-heading-to-paragraph',
( event ) => handleTextLevelShortcut( event, 0 )
);

Expand All @@ -79,7 +79,7 @@ function KeyboardShortcuts() {
//the hook will execute the same way every time
//eslint-disable-next-line react-hooks/rules-of-hooks
useShortcut(
`core/edit-widgets//transform-paragraph-to-heading-${ level }`,
`core/edit-widgets/transform-paragraph-to-heading-${ level }`,
( event ) => handleTextLevelShortcut( event, level )
);
} );
Expand Down Expand Up @@ -180,7 +180,7 @@ function KeyboardShortcutsRegister() {
} );

registerShortcut( {
name: `core/edit-widgets//transform-heading-to-paragraph`,
name: 'core/edit-widgets/transform-heading-to-paragraph',
category: 'block-library',
description: __( 'Transform heading to paragraph.' ),
keyCombination: {
Expand All @@ -191,7 +191,7 @@ function KeyboardShortcutsRegister() {

[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
registerShortcut( {
name: `core/edit-widgets//transform-paragraph-to-heading-${ level }`,
name: `core/edit-widgets/transform-paragraph-to-heading-${ level }`,
category: 'block-library',
description: __( 'Transform paragraph to heading.' ),
keyCombination: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ export default function ReusableBlockConvertButton( {
icon={ symbol }
onClick={ () => setIsModalOpen( true ) }
>
{ __( 'Create a Pattern' ) }
{ __( 'Create pattern' ) }
</MenuItem>
{ isModalOpen && (
<Modal
title={ __( 'Create a Pattern' ) }
title={ __( 'Create pattern' ) }
onRequestClose={ () => {
setIsModalOpen( false );
setTitle( '' );
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/site-editor/template-part.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test.describe( 'Template Part', () => {
await editor.selectBlocks( paragraphBlock1, paragraphBlock2 );

// Convert block to a template part.
await editor.clickBlockOptionsMenuItem( 'Create Template part' );
await editor.clickBlockOptionsMenuItem( 'Create template part' );
await page.type( 'role=dialog >> role=textbox[name="Name"i]', 'Test' );
await page.keyboard.press( 'Enter' );

Expand Down

0 comments on commit 95881b8

Please sign in to comment.