From ac7db7528a80dbcc17407a977683ade0d62225d5 Mon Sep 17 00:00:00 2001 From: brookewp Date: Fri, 9 Dec 2022 18:47:16 -0800 Subject: [PATCH] SelectControl: remove margin overrides and add new opt-in prop --- .../components/default-style-picker/index.js | 1 + .../src/components/font-family/index.js | 1 + .../components/image-size-control/index.js | 1 + packages/block-library/src/archives/edit.js | 1 + packages/block-library/src/audio/edit.js | 1 + .../edit/comments-inspector-controls.js | 1 + packages/block-library/src/file/inspector.js | 1 + packages/block-library/src/gallery/edit.js | 2 + packages/block-library/src/gallery/v1/edit.js | 2 + packages/block-library/src/group/edit.js | 1 + .../block-library/src/post-author/edit.js | 2 + .../post-featured-image/dimension-controls.js | 1 + .../query/edit/inspector-controls/index.js | 1 + .../edit/inspector-controls/order-control.js | 1 + .../edit/inspector-controls/sticky-control.js | 1 + .../src/query/edit/query-content.js | 1 + packages/block-library/src/tag-cloud/edit.js | 1 + .../template-part/edit/advanced-controls.js | 2 + .../src/video/edit-common-settings.js | 1 + .../block-library/src/video/tracks-editor.js | 1 + .../components/sidebar/post-template/form.js | 1 + .../navigation-inspector.js | 10 ++-- .../components/template-details/style.scss | 4 ++ .../template-part-area-selector.js | 2 + .../src/components/post-author/select.js | 1 + .../src/components/post-format/index.js | 1 + .../src/components/post-template/index.js | 1 + .../src/blocks/legacy-widget/edit/index.js | 50 ++++++++++--------- .../edit/widget-type-selector.js | 2 + .../src/blocks/legacy-widget/editor.scss | 9 ++-- 30 files changed, 74 insertions(+), 31 deletions(-) diff --git a/packages/block-editor/src/components/default-style-picker/index.js b/packages/block-editor/src/components/default-style-picker/index.js index 4d4bbaac6a259c..0f3190a7a24f72 100644 --- a/packages/block-editor/src/components/default-style-picker/index.js +++ b/packages/block-editor/src/components/default-style-picker/index.js @@ -58,6 +58,7 @@ export default function DefaultStylePicker( { blockName } ) { onUpdatePreferredStyleVariations && (
{ ! isEmpty( imageSizeOptions ) && ( )' ), value: 'div' }, diff --git a/packages/block-library/src/file/inspector.js b/packages/block-library/src/file/inspector.js index 71e0885eae1c6b..c09e3b7685aec0 100644 --- a/packages/block-library/src/file/inspector.js +++ b/packages/block-library/src/file/inspector.js @@ -71,6 +71,7 @@ export default function FileBlockInspector( { ) } 0 && ( { shouldShowSizeOptions && ( )' ), value: 'div' }, diff --git a/packages/block-library/src/post-author/edit.js b/packages/block-library/src/post-author/edit.js index b0a2fb2883f79a..9573eedde66cfe 100644 --- a/packages/block-library/src/post-author/edit.js +++ b/packages/block-library/src/post-author/edit.js @@ -112,6 +112,7 @@ function PostAuthorEdit( { /> ) ) || ( { showAvatar && ( )' ), value: 'div' }, diff --git a/packages/block-library/src/tag-cloud/edit.js b/packages/block-library/src/tag-cloud/edit.js index dd669a7e840b3f..e13c70b1a97f10 100644 --- a/packages/block-library/src/tag-cloud/edit.js +++ b/packages/block-library/src/tag-cloud/edit.js @@ -109,6 +109,7 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) { ) } { checked={ playsInline } />
) : ( + { hasResolvedNavigationMenus && ! hasNavigationMenus && (

{ __( 'There are no Navigation Menus.' ) } @@ -180,6 +183,7 @@ export default function NavigationInspector() { ) } { hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && ( ) } - + ); } diff --git a/packages/edit-site/src/components/template-details/style.scss b/packages/edit-site/src/components/template-details/style.scss index ee840be7c43db7..60dedee84ecadf 100644 --- a/packages/edit-site/src/components/template-details/style.scss +++ b/packages/edit-site/src/components/template-details/style.scss @@ -2,6 +2,10 @@ .edit-site-template-details__group { margin: 0; padding: $grid-unit-20; + + .edit-site-template-details__area-select { + margin-bottom: $grid-unit-10; + } } .edit-site-template-details__group + .edit-site-template-details__group { diff --git a/packages/edit-site/src/components/template-details/template-part-area-selector.js b/packages/edit-site/src/components/template-details/template-part-area-selector.js index 1eff28d2d4c976..61279a26ca2373 100644 --- a/packages/edit-site/src/components/template-details/template-part-area-selector.js +++ b/packages/edit-site/src/components/template-details/template-part-area-selector.js @@ -28,6 +28,8 @@ export default function TemplatePartAreaSelector( { id } ) { return (

onUpdatePostFormat( format ) } diff --git a/packages/editor/src/components/post-template/index.js b/packages/editor/src/components/post-template/index.js index c52fab6316ba2d..3e73135321b183 100644 --- a/packages/editor/src/components/post-template/index.js +++ b/packages/editor/src/components/post-template/index.js @@ -44,6 +44,7 @@ export function PostTemplate() { return ( { diff --git a/packages/widgets/src/blocks/legacy-widget/edit/index.js b/packages/widgets/src/blocks/legacy-widget/edit/index.js index a763bbd0dd4045..96399c03769222 100644 --- a/packages/widgets/src/blocks/legacy-widget/edit/index.js +++ b/packages/widgets/src/blocks/legacy-widget/edit/index.js @@ -57,30 +57,32 @@ function Empty( { attributes: { id, idBase }, setAttributes } ) { icon={ } label={ __( 'Legacy Widget' ) } > - { - if ( ! selectedId ) { - setAttributes( { - id: null, - idBase: null, - instance: null, - } ); - } else if ( isMulti ) { - setAttributes( { - id: null, - idBase: selectedId, - instance: {}, - } ); - } else { - setAttributes( { - id: selectedId, - idBase: null, - instance: null, - } ); - } - } } - /> +
+ { + if ( ! selectedId ) { + setAttributes( { + id: null, + idBase: null, + instance: null, + } ); + } else if ( isMulti ) { + setAttributes( { + id: null, + idBase: selectedId, + instance: {}, + } ); + } else { + setAttributes( { + id: selectedId, + idBase: null, + instance: null, + } ); + } + } } + /> +
); } diff --git a/packages/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js b/packages/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js index 4afe1ee1359eae..12c31befe46178 100644 --- a/packages/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js +++ b/packages/widgets/src/blocks/legacy-widget/edit/widget-type-selector.js @@ -27,6 +27,8 @@ export default function WidgetTypeSelector( { selectedId, onSelect } ) { return (