From 30bac4dc6d140da6591aba355c49c3c3e178f34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Thu, 9 Sep 2021 07:08:48 +0200 Subject: [PATCH] Block Editor: Rename experimental prop used in `BlockControls` (#34644) --- .../block-editor/src/components/block-controls/fill.js | 7 +++++-- .../block-editor/src/components/block-controls/hook.js | 6 +++--- packages/block-editor/src/hooks/align.js | 5 ++++- packages/block-editor/src/hooks/duotone.js | 2 +- packages/block-editor/src/layouts/flex.js | 2 +- packages/block-library/src/buttons/edit.js | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/block-editor/src/components/block-controls/fill.js b/packages/block-editor/src/components/block-controls/fill.js index 10b9472830686..73c6a4c8c912f 100644 --- a/packages/block-editor/src/components/block-controls/fill.js +++ b/packages/block-editor/src/components/block-controls/fill.js @@ -21,9 +21,12 @@ export default function BlockControlsFill( { group = 'default', controls, children, - __experimentalExposeToChildren = false, + __experimentalShareWithChildBlocks = false, } ) { - const Fill = useBlockControlsFill( group, __experimentalExposeToChildren ); + const Fill = useBlockControlsFill( + group, + __experimentalShareWithChildBlocks + ); if ( ! Fill ) { return null; } diff --git a/packages/block-editor/src/components/block-controls/hook.js b/packages/block-editor/src/components/block-controls/hook.js index d907a9aad5c36..caeb2fd9e04a0 100644 --- a/packages/block-editor/src/components/block-controls/hook.js +++ b/packages/block-editor/src/components/block-controls/hook.js @@ -12,7 +12,7 @@ import { store as blockEditorStore } from '../../store'; import { useBlockEditContext } from '../block-edit/context'; import useDisplayBlockControls from '../use-display-block-controls'; -export default function useBlockControlsFill( group, exposeToChildren ) { +export default function useBlockControlsFill( group, shareWithChildBlocks ) { const isDisplayed = useDisplayBlockControls(); const { clientId } = useBlockEditContext(); const isParentDisplayed = useSelect( @@ -22,7 +22,7 @@ export default function useBlockControlsFill( group, exposeToChildren ) { ); const { hasBlockSupport } = select( blocksStore ); return ( - exposeToChildren && + shareWithChildBlocks && hasBlockSupport( getBlockName( clientId ), '__experimentalExposeControlsToChildren', @@ -31,7 +31,7 @@ export default function useBlockControlsFill( group, exposeToChildren ) { hasSelectedInnerBlock( clientId ) ); }, - [ exposeToChildren, clientId ] + [ shareWithChildBlocks, clientId ] ); if ( isDisplayed ) { diff --git a/packages/block-editor/src/hooks/align.js b/packages/block-editor/src/hooks/align.js index c72b1aa29f796..5a25d43385f2c 100644 --- a/packages/block-editor/src/hooks/align.js +++ b/packages/block-editor/src/hooks/align.js @@ -140,7 +140,10 @@ export const withToolbarControls = createHigherOrderComponent( return ( <> { blockAllowedAlignments.length > 0 && ( - + + + - +