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: Rename experimental prop used in BlockControls #34644

Merged
merged 1 commit into from
Sep 9, 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
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