Skip to content

Commit

Permalink
Block Editor: Rename experimental prop used in BlockControls (#34644)
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo authored Sep 9, 2021
1 parent 753706d commit 30bac4d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
7 changes: 5 additions & 2 deletions packages/block-editor/src/components/block-controls/fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/block-editor/src/components/block-controls/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -22,7 +22,7 @@ export default function useBlockControlsFill( group, exposeToChildren ) {
);
const { hasBlockSupport } = select( blocksStore );
return (
exposeToChildren &&
shareWithChildBlocks &&
hasBlockSupport(
getBlockName( clientId ),
'__experimentalExposeControlsToChildren',
Expand All @@ -31,7 +31,7 @@ export default function useBlockControlsFill( group, exposeToChildren ) {
hasSelectedInnerBlock( clientId )
);
},
[ exposeToChildren, clientId ]
[ shareWithChildBlocks, clientId ]
);

if ( isDisplayed ) {
Expand Down
5 changes: 4 additions & 1 deletion packages/block-editor/src/hooks/align.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export const withToolbarControls = createHigherOrderComponent(
return (
<>
{ blockAllowedAlignments.length > 0 && (
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls
group="block"
__experimentalShareWithChildBlocks
>
<BlockAlignmentControl
value={ props.attributes.align }
onChange={ updateAlignment }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/duotone.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function DuotonePanel( { attributes, setAttributes } ) {
}

return (
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls group="block" __experimentalShareWithChildBlocks>
<DuotoneControl
duotonePalette={ duotonePalette }
colorPalette={ colorPalette }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/layouts/flex.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
return null;
}
return (
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls group="block" __experimentalShareWithChildBlocks>
<FlexLayoutJustifyContentControl
layout={ layout }
onChange={ onChange }
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/buttons/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function ButtonsEdit( {

return (
<>
<BlockControls group="block" __experimentalExposeToChildren>
<BlockControls group="block" __experimentalShareWithChildBlocks>
<JustifyContentControl
allowedControls={ justifyControls }
value={ contentJustification }
Expand Down

0 comments on commit 30bac4d

Please sign in to comment.