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

Make BlockNavigationList component experimental #17446

Merged
merged 2 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 0 additions & 4 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ Undocumented declaration.

Undocumented declaration.

<a name="BlockNavigationList" href="#BlockNavigationList">#</a> **BlockNavigationList**

Undocumented declaration.

<a name="BlockPreview" href="#BlockPreview">#</a> **BlockPreview**

BlockPreview renders a preview of a block or array of blocks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import BlockNavigationList from './list';
import __experimentalBlockNavigationList from './list';

function BlockNavigation( { rootBlock, rootBlocks, selectedBlockClientId, selectBlock } ) {
if ( ! rootBlocks || rootBlocks.length === 0 ) {
Expand All @@ -35,15 +35,15 @@ function BlockNavigation( { rootBlock, rootBlocks, selectedBlockClientId, select
>
<p className="editor-block-navigation__label block-editor-block-navigation__label">{ __( 'Block navigation' ) }</p>
{ hasHierarchy && (
<BlockNavigationList
<__experimentalBlockNavigationList
blocks={ [ rootBlock ] }
selectedBlockClientId={ selectedBlockClientId }
selectBlock={ selectBlock }
showNestedBlocks
/>
) }
{ ! hasHierarchy && (
<BlockNavigationList
<__experimentalBlockNavigationList
blocks={ rootBlocks }
selectedBlockClientId={ selectedBlockClientId }
selectBlock={ selectBlock }
Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/block-navigation/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { __ } from '@wordpress/i18n';
*/
import BlockIcon from '../block-icon';

export default function BlockNavigationList( {
export default function __experimentalBlockNavigationList( {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we can keep the name as is internally and just rename the one exported in the public API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youknowriad Yep, that's now been changed 👍

blocks,
selectedBlockClientId,
selectBlock,
Expand Down Expand Up @@ -48,7 +48,7 @@ export default function BlockNavigationList( {
</Button>
</div>
{ showNestedBlocks && !! block.innerBlocks && !! block.innerBlocks.length && (
<BlockNavigationList
<__experimentalBlockNavigationList
blocks={ block.innerBlocks }
selectedBlockClientId={ selectedBlockClientId }
selectBlock={ selectBlock }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export { default as BlockEdit } from './block-edit';
export { default as BlockFormatControls } from './block-format-controls';
export { default as BlockIcon } from './block-icon';
export { default as BlockNavigationDropdown } from './block-navigation/dropdown';
export { default as BlockNavigationList } from './block-navigation/list';
export { default as __experimentalBlockNavigationList } from './block-navigation/list';
export { default as BlockVerticalAlignmentToolbar } from './block-vertical-alignment-toolbar';
export { default as ButtonBlockerAppender } from './button-block-appender';
export { default as ColorPalette } from './color-palette';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useDispatch,
} from '@wordpress/data';
import {
BlockNavigationList,
__experimentalBlockNavigationList,
} from '@wordpress/block-editor';
import {
IconButton,
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function useBlockNavigator( clientId ) {
setIsNavigationListOpen( false );
} }
>
<BlockNavigationList
<__experimentalBlockNavigationList
blocks={ [ block ] }
selectedBlockClientId={ selectedBlockClientId }
selectBlock={ selectBlock }
Expand Down