Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] trunk from WordPress:trunk #138

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions packages/block-editor/src/components/block-inspector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ import { BlockInspector } from '@wordpress/block-editor';
const MyBlockInspector = () => <BlockInspector />;
```

### Props

#### showNoBlockSelectedMessage

Whether to display a "No block selected" message when no block is selected.

- Type: `boolean`
- Required: No
- Default: `true`

## Related components

Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree.
17 changes: 7 additions & 10 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function BlockStylesPanel( { clientId } ) {
);
}

const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
function BlockInspector() {
const {
count,
selectedBlockName,
Expand Down Expand Up @@ -137,14 +137,11 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
! selectedBlockClientId ||
isSelectedBlockUnregistered
) {
if ( showNoBlockSelectedMessage ) {
return (
<span className="block-editor-block-inspector__no-blocks">
{ __( 'No block selected.' ) }
</span>
);
}
return null;
return (
<span className="block-editor-block-inspector__no-blocks">
{ __( 'No block selected.' ) }
</span>
);
}

return (
Expand All @@ -168,7 +165,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
/>
</BlockInspectorSingleBlockWrapper>
);
};
}

const BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {
return animate ? wrapper( children ) : children;
Expand Down
Loading