From 828f9b977039de66f40912a31df56a2d791d5878 Mon Sep 17 00:00:00 2001 From: James Koster Date: Tue, 1 Dec 2020 12:24:37 +0000 Subject: [PATCH 1/2] Remove template part name input from toolbar --- .../src/template-part/edit/index.js | 2 +- .../src/template-part/edit/name-panel.js | 31 +++---------------- .../src/template-part/editor.scss | 4 ++- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/packages/block-library/src/template-part/edit/index.js b/packages/block-library/src/template-part/edit/index.js index 4dc0b89640c8ef..ff38401d57ee79 100644 --- a/packages/block-library/src/template-part/edit/index.js +++ b/packages/block-library/src/template-part/edit/index.js @@ -119,7 +119,7 @@ export default function TemplatePartEdit( { - { - setTitle( value ); - const newSlug = cleanForSlug( value ); - setSlug( newSlug ); - if ( status !== 'publish' ) { - setStatus( 'publish' ); - } - setAttributes( { slug: newSlug, postId } ); - } } - onFocus={ ( event ) => event.target.select() } - /> + { title || slug } ); } diff --git a/packages/block-library/src/template-part/editor.scss b/packages/block-library/src/template-part/editor.scss index aed32baffd118f..541fae1b844493 100644 --- a/packages/block-library/src/template-part/editor.scss +++ b/packages/block-library/src/template-part/editor.scss @@ -67,7 +67,9 @@ .wp-block-template-part__name-panel { outline: 1px solid transparent; - padding: $grid-unit-10 0 $grid-unit-10 $grid-unit-15; + padding: $grid-unit-10 0 $grid-unit-10 $grid-unit-20; + display: flex; + align-items: center; .components-base-control__field { align-items: center; From bc4ee0b658f0c64a775d94eb89d5edacf72bb303 Mon Sep 17 00:00:00 2001 From: James Koster Date: Tue, 1 Dec 2020 13:34:20 +0000 Subject: [PATCH 2/2] re-order template part tools --- .../block-library/src/template-part/edit/name-panel.js | 2 +- packages/block-library/src/template-part/editor.scss | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/template-part/edit/name-panel.js b/packages/block-library/src/template-part/edit/name-panel.js index ea30477898e285..e0ebc8854c5f08 100644 --- a/packages/block-library/src/template-part/edit/name-panel.js +++ b/packages/block-library/src/template-part/edit/name-panel.js @@ -20,7 +20,7 @@ export default function TemplatePartNamePanel( { postId } ) { return (
- { title || slug } + { title || slug }
); } diff --git a/packages/block-library/src/template-part/editor.scss b/packages/block-library/src/template-part/editor.scss index 541fae1b844493..b21c068ce2918f 100644 --- a/packages/block-library/src/template-part/editor.scss +++ b/packages/block-library/src/template-part/editor.scss @@ -91,3 +91,13 @@ box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color); } } + +.block-editor-block-toolbar__slot { + .components-toolbar-group { + order: 1; + } + + .wp-block-template-part__block-control-group { + order: 0; + } +}