Skip to content

Commit

Permalink
Edit Widgets: Fix broken layout (#54372)
Browse files Browse the repository at this point in the history
* Edit Widgets: Fix broken layout

* Add copy handler
  • Loading branch information
t-hamano authored Sep 12, 2023
1 parent cc3512d commit 3714c11
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import {
BlockList,
BlockTools,
privateApis as blockEditorPrivateApis,
BlockSelectionClearer,
WritingFlow,
__unstableEditorStyles as EditorStyles,
} from '@wordpress/block-editor';
import { useSelect } from '@wordpress/data';
import { useMemo } from '@wordpress/element';
Expand All @@ -15,11 +17,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
*/
import Notices from '../notices';
import KeyboardShortcuts from '../keyboard-shortcuts';
import { unlock } from '../../lock-unlock';

const { ExperimentalBlockCanvas: BlockCanvas } = unlock(
blockEditorPrivateApis
);

export default function WidgetAreasBlockEditorContent( {
blockEditorSettings,
Expand All @@ -42,13 +39,15 @@ export default function WidgetAreasBlockEditorContent( {
<Notices />
<BlockTools>
<KeyboardShortcuts />
<BlockCanvas
shouldIframe={ false }
<EditorStyles
styles={ styles }
height="100%"
>
<BlockList className="edit-widgets-main-block-list" />
</BlockCanvas>
scope=".editor-styles-wrapper"
/>
<BlockSelectionClearer>
<WritingFlow>
<BlockList className="edit-widgets-main-block-list" />
</WritingFlow>
</BlockSelectionClearer>
</BlockTools>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
flex-grow: 1;

> div:last-of-type,
.block-editor-writing-flow,
.block-editor-writing-flow > div {
.block-editor-writing-flow {
display: flex;
flex-direction: column;
flex-grow: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {
useResourcePermissions,
} from '@wordpress/core-data';
import { useMemo } from '@wordpress/element';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import {
CopyHandler,
privateApis as blockEditorPrivateApis,
} from '@wordpress/block-editor';
import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
import { store as preferencesStore } from '@wordpress/preferences';

Expand Down Expand Up @@ -104,7 +107,7 @@ export default function WidgetAreasBlockEditorProvider( {
useSubRegistry={ false }
{ ...props }
>
{ children }
<CopyHandler>{ children }</CopyHandler>
<PatternsMenuItems rootClientId={ widgetAreaId } />
</ExperimentalBlockEditorProvider>
</SlotFillProvider>
Expand Down

0 comments on commit 3714c11

Please sign in to comment.