diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index 136cdef91286e..5c52ca62e01d6 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -300,7 +300,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
diff --git a/packages/block-editor/src/components/global-styles/background-panel.js b/packages/block-editor/src/components/global-styles/background-panel.js index c1354bbc4a4e1..ef1f9673d601f 100644 --- a/packages/block-editor/src/components/global-styles/background-panel.js +++ b/packages/block-editor/src/components/global-styles/background-panel.js @@ -40,6 +40,10 @@ import MediaReplaceFlow from '../media-replace-flow'; import { store as blockEditorStore } from '../../store'; const IMAGE_BACKGROUND_TYPE = 'image'; +const DEFAULT_CONTROLS = { + backgroundImage: true, + backgroundSize: false, +}; /** * Checks site settings to see if the background panel may be used. @@ -135,28 +139,30 @@ export const backgroundPositionToCoords = ( value ) => { }; function InspectorImagePreview( { label, filename, url: imgUrl } ) { - const imgLabel = label || getFilename( imgUrl ); + const imgLabel = + label || getFilename( imgUrl ) || __( 'Add background image' ); + return ( - - - { imgUrl && ( + + { imgUrl && ( + - ) } - + + ) } { mediaUpload( { - allowedTypes: [ 'image' ], + allowedTypes: [ IMAGE_BACKGROUND_TYPE ], filesList, onFileChange( [ image ] ) { if ( isBlobURL( image?.url ) ) { @@ -295,7 +301,7 @@ function BackgroundImageToolsPanelItem( { onSelect={ onSelectMedia } name={ @@ -518,6 +524,7 @@ function BackgroundToolsPanel( { value, panelId, children, + headerLabel, } ) { const resetAll = () => { const updatedValue = resetAllFilter( value ); @@ -527,8 +534,8 @@ function BackgroundToolsPanel( { return ( { return { @@ -568,6 +571,7 @@ export default function BackgroundPanel( { value={ value } onChange={ onChange } panelId={ panelId } + headerLabel={ headerLabel } > { /> ); } diff --git a/packages/edit-site/src/components/global-styles/root-menu.js b/packages/edit-site/src/components/global-styles/root-menu.js index 97598635f7b85..c747efee635d8 100644 --- a/packages/edit-site/src/components/global-styles/root-menu.js +++ b/packages/edit-site/src/components/global-styles/root-menu.js @@ -64,9 +64,9 @@ function RootMenu() { - { __( 'Background' ) } + { __( 'Background image' ) } ) } diff --git a/packages/edit-site/src/components/global-styles/screen-background.js b/packages/edit-site/src/components/global-styles/screen-background.js index 5e8a7832a42b4..e6d338ffcbef1 100644 --- a/packages/edit-site/src/components/global-styles/screen-background.js +++ b/packages/edit-site/src/components/global-styles/screen-background.js @@ -20,7 +20,7 @@ function ScreenBackground() { const hasBackgroundPanel = useHasBackgroundPanel( settings ); return ( <> - + { hasBackgroundPanel && } );