Skip to content

Commit

Permalink
Revert "[Try] Customizable toolbar contents (#23613)"
Browse files Browse the repository at this point in the history
This reverts commit 5078c43.
  • Loading branch information
talldan committed Oct 7, 2020
1 parent 5b7b294 commit cf4ffbf
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 211 deletions.
46 changes: 20 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@wordpress/token-list": "file:../token-list",
"@wordpress/url": "file:../url",
"@wordpress/viewport": "file:../viewport",
"@wordpress/warning": "file:../warning",
"@wordpress/wordcount": "file:../wordcount",
"classnames": "^2.2.5",
"css-mediaquery": "^0.1.2",
Expand All @@ -61,7 +60,6 @@
"memize": "^1.1.0",
"react-autosize-textarea": "^3.0.2",
"react-spring": "^8.0.19",
"react-transition-group": "^2.9.0",
"reakit": "1.1.0",
"redux-multi": "^0.1.12",
"refx": "^3.0.0",
Expand Down
17 changes: 4 additions & 13 deletions packages/block-editor/src/components/block-controls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,18 @@ import useDisplayBlockControls from '../use-display-block-controls';

const { Fill, Slot } = createSlotFill( 'BlockControls' );

function BlockControlsSlot( { __experimentalIsExpanded = false, ...props } ) {
function BlockControlsSlot( props ) {
const accessibleToolbarState = useContext( ToolbarContext );
return (
<Slot
name={ buildSlotName( __experimentalIsExpanded ) }
{ ...props }
fillProps={ accessibleToolbarState }
/>
);
return <Slot { ...props } fillProps={ accessibleToolbarState } />;
}

function BlockControlsFill( { controls, __experimentalIsExpanded, children } ) {
function BlockControlsFill( { controls, children } ) {
if ( ! useDisplayBlockControls() ) {
return null;
}

return (
<Fill name={ buildSlotName( __experimentalIsExpanded ) }>
<Fill>
{ ( fillProps ) => {
// Children passed to BlockControlsFill will not have access to any
// React Context whose Provider is part of the BlockControlsSlot tree.
Expand All @@ -54,9 +48,6 @@ function BlockControlsFill( { controls, __experimentalIsExpanded, children } ) {
);
}

const buildSlotName = ( isExpanded ) =>
`BlockControls${ isExpanded ? '-expanded' : '' }`;

const BlockControls = BlockControlsFill;

BlockControls.Slot = BlockControlsSlot;
Expand Down

This file was deleted.

14 changes: 3 additions & 11 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ import BlockControls from '../block-controls';
import BlockFormatControls from '../block-format-controls';
import BlockSettingsMenu from '../block-settings-menu';
import { useShowMoversGestures } from './utils';
import ExpandedBlockControlsContainer from './expanded-block-controls-container';

export default function BlockToolbar( {
hideDragHandle,
__experimentalExpandedControl = false,
} ) {
export default function BlockToolbar( { hideDragHandle } ) {
const {
blockClientIds,
blockClientId,
Expand Down Expand Up @@ -106,12 +102,8 @@ export default function BlockToolbar( {
shouldShowMovers && 'is-showing-movers'
);

const Wrapper = __experimentalExpandedControl
? ExpandedBlockControlsContainer
: 'div';

return (
<Wrapper className={ classes }>
<div className={ classes }>
<div ref={ nodeRef } { ...showMoversGestures }>
{ ! isMultiToolbar && (
<div className="block-editor-block-toolbar__block-parent-selector-wrapper">
Expand Down Expand Up @@ -141,6 +133,6 @@ export default function BlockToolbar( {
</>
) }
<BlockSettingsMenu clientIds={ blockClientIds } />
</Wrapper>
</div>
);
}
28 changes: 0 additions & 28 deletions packages/block-editor/src/components/block-toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,3 @@
transform: translateY(-($block-toolbar-height + $grid-unit-15));
}
}

.block-editor-block-toolbar-animated-width-container {
position: relative;
overflow: hidden;
transition: width 300ms;
}

.block-editor-block-toolbar-content-enter {
position: absolute;
top: 0;
left: 0;
width: auto;
opacity: 0;
}
.block-editor-block-toolbar-content-enter-active {
position: absolute;
opacity: 1;
transition: opacity 300ms;
}
.block-editor-block-toolbar-content-exit {
width: auto;
opacity: 1;
pointer-events: none;
}
.block-editor-block-toolbar-content-exit-active {
opacity: 0;
transition: opacity 300ms;
}

0 comments on commit cf4ffbf

Please sign in to comment.