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

Block Editor: Use groups for InspectorControls #34069

Merged
merged 5 commits into from
Aug 23, 2021
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
4 changes: 1 addition & 3 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,7 @@ Undocumented declaration.

### InspectorAdvancedControls

_Related_

- <https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-advanced-controls/README.md>
Undocumented declaration.

### InspectorControls

Expand Down
18 changes: 9 additions & 9 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ import { useSelect } from '@wordpress/data';
*/
import SkipToSelectedBlock from '../skip-to-selected-block';
import BlockCard from '../block-card';
import InspectorControls from '../inspector-controls';
import InspectorAdvancedControls from '../inspector-advanced-controls';
import {
default as InspectorControls,
InspectorAdvancedControls,
} from '../inspector-controls';
import BlockStyles from '../block-styles';
import MultiSelectionInspector from '../multi-selection-inspector';
import DefaultStylePicker from '../default-style-picker';
Expand Down Expand Up @@ -128,18 +130,15 @@ const BlockInspectorSingleBlock = ( {
) }
<InspectorControls.Slot bubblesVirtually={ bubblesVirtually } />
<div>
<AdvancedControls
slotName={ InspectorAdvancedControls.slotName }
bubblesVirtually={ bubblesVirtually }
/>
<AdvancedControls bubblesVirtually={ bubblesVirtually } />
</div>
<SkipToSelectedBlock key="back" />
</div>
);
};

const AdvancedControls = ( { slotName, bubblesVirtually } ) => {
const slot = useSlot( slotName );
const AdvancedControls = ( { bubblesVirtually } ) => {
const slot = useSlot( InspectorAdvancedControls.slotName );
const hasFills = Boolean( slot.fills && slot.fills.length );

if ( ! hasFills ) {
Expand All @@ -152,7 +151,8 @@ const AdvancedControls = ( { slotName, bubblesVirtually } ) => {
title={ __( 'Advanced' ) }
initialOpen={ false }
>
<InspectorAdvancedControls.Slot
<InspectorControls.Slot
__experimentalGroup="advanced"
bubblesVirtually={ bubblesVirtually }
/>
</PanelBody>
Expand Down
6 changes: 4 additions & 2 deletions packages/block-editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ export {
default as InnerBlocks,
useInnerBlocksProps as __experimentalUseInnerBlocksProps,
} from './inner-blocks';
export { default as InspectorAdvancedControls } from './inspector-advanced-controls';
export { default as InspectorControls } from './inspector-controls';
export {
default as InspectorControls,
InspectorAdvancedControls,
} from './inspector-controls';
export {
JustifyToolbar,
JustifyContentControl,
Expand Down
6 changes: 4 additions & 2 deletions packages/block-editor/src/components/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export {
default as InnerBlocks,
useInnerBlocksProps as __experimentalUseInnerBlocksProps,
} from './inner-blocks';
export { default as InspectorAdvancedControls } from './inspector-advanced-controls';
gziolo marked this conversation as resolved.
Show resolved Hide resolved
export { default as InspectorControls } from './inspector-controls';
export {
default as InspectorControls,
InspectorAdvancedControls,
} from './inspector-controls';
export {
JustifyToolbar,
JustifyContentControl,
Expand Down

This file was deleted.

This file was deleted.

Loading