From 5b5a4b8e8385524933ed8e2f77085f3d3eda5c8a Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 22 Jun 2023 07:38:15 -0400 Subject: [PATCH 1/3] Block Options: Use consistent capitalization on template parts and patterns (#51761) * "Create Template part" to "Create template part" * "Create a Pattern" to "Create pattern" * Tests --- packages/e2e-test-utils/src/create-reusable-block.js | 2 +- .../editor/various/block-editor-keyboard-shortcuts.test.js | 2 +- .../e2e-tests/specs/editor/various/reusable-blocks.test.js | 4 ++-- .../template-part-converter/convert-to-template-part.js | 2 +- .../reusable-block-convert-button.js | 4 ++-- test/e2e/specs/site-editor/template-part.spec.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/e2e-test-utils/src/create-reusable-block.js b/packages/e2e-test-utils/src/create-reusable-block.js index 266e0525d34bd..7193db49a83ef 100644 --- a/packages/e2e-test-utils/src/create-reusable-block.js +++ b/packages/e2e-test-utils/src/create-reusable-block.js @@ -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 ); diff --git a/packages/e2e-tests/specs/editor/various/block-editor-keyboard-shortcuts.test.js b/packages/e2e-tests/specs/editor/various/block-editor-keyboard-shortcuts.test.js index 97248c472e4ac..24e8e3104aaaa 100644 --- a/packages/e2e-tests/specs/editor/various/block-editor-keyboard-shortcuts.test.js +++ b/packages/e2e-tests/specs/editor/various/block-editor-keyboard-shortcuts.test.js @@ -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( 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 416782733dfaa..6d9eaa562b48f 100644 --- a/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/reusable-blocks.test.js @@ -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( @@ -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 ); diff --git a/packages/edit-site/src/components/template-part-converter/convert-to-template-part.js b/packages/edit-site/src/components/template-part-converter/convert-to-template-part.js index d7571a0dcd628..8e49e9d92abb4 100644 --- a/packages/edit-site/src/components/template-part-converter/convert-to-template-part.js +++ b/packages/edit-site/src/components/template-part-converter/convert-to-template-part.js @@ -57,7 +57,7 @@ export default function ConvertToTemplatePart( { clientIds, blocks } ) { setIsModalOpen( true ); } } > - { __( 'Create Template part' ) } + { __( 'Create template part' ) } { isModalOpen && ( setIsModalOpen( true ) } > - { __( 'Create a Pattern' ) } + { __( 'Create pattern' ) } { isModalOpen && ( { setIsModalOpen( false ); setTitle( '' ); diff --git a/test/e2e/specs/site-editor/template-part.spec.js b/test/e2e/specs/site-editor/template-part.spec.js index 1eb5fdba0c70d..b6c124f2fbd3c 100644 --- a/test/e2e/specs/site-editor/template-part.spec.js +++ b/test/e2e/specs/site-editor/template-part.spec.js @@ -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' ); From 550c31ec6240a99cc4997f160dce9b056f0a02dd Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Thu, 22 Jun 2023 13:09:12 +0100 Subject: [PATCH 2/3] Navigation: Don't interfere with pointer events (#51378) --- .../block-library/src/navigation/editor.scss | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/packages/block-library/src/navigation/editor.scss b/packages/block-library/src/navigation/editor.scss index 4a6a6fe6b4395..107fb6e6de5fd 100644 --- a/packages/block-library/src/navigation/editor.scss +++ b/packages/block-library/src/navigation/editor.scss @@ -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 { From ee36ebc6ccd6becf57a7e346a083ec67546d973b Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Thu, 22 Jun 2023 22:33:39 +0900 Subject: [PATCH 3/3] Keyboard Shortcut: Clean up shortcut names (#51739) --- .../src/components/keyboard-shortcuts/index.js | 2 +- .../edit-post/src/components/keyboard-shortcuts/index.js | 2 +- .../src/components/keyboard-shortcuts/register.js | 2 +- .../src/components/keyboard-shortcuts/index.js | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/customize-widgets/src/components/keyboard-shortcuts/index.js b/packages/customize-widgets/src/components/keyboard-shortcuts/index.js index a83b730ddbb70..b7cdc1d42de86 100644 --- a/packages/customize-widgets/src/components/keyboard-shortcuts/index.js +++ b/packages/customize-widgets/src/components/keyboard-shortcuts/index.js @@ -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: { diff --git a/packages/edit-post/src/components/keyboard-shortcuts/index.js b/packages/edit-post/src/components/keyboard-shortcuts/index.js index 5344d9155c8a4..432bce0a3bff5 100644 --- a/packages/edit-post/src/components/keyboard-shortcuts/index.js +++ b/packages/edit-post/src/components/keyboard-shortcuts/index.js @@ -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: { diff --git a/packages/edit-site/src/components/keyboard-shortcuts/register.js b/packages/edit-site/src/components/keyboard-shortcuts/register.js index 0574125ba476b..9660b03e762ed 100644 --- a/packages/edit-site/src/components/keyboard-shortcuts/register.js +++ b/packages/edit-site/src/components/keyboard-shortcuts/register.js @@ -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: { diff --git a/packages/edit-widgets/src/components/keyboard-shortcuts/index.js b/packages/edit-widgets/src/components/keyboard-shortcuts/index.js index 7add778094c52..dff0ac57f78c1 100644 --- a/packages/edit-widgets/src/components/keyboard-shortcuts/index.js +++ b/packages/edit-widgets/src/components/keyboard-shortcuts/index.js @@ -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 ) ); @@ -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 ) ); } ); @@ -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: { @@ -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: {