Skip to content

Commit

Permalink
Setting block-inspector as the context for the block styles slot si…
Browse files Browse the repository at this point in the history
…nce that's where the fill originates from.

Adding the block styles slot to the widget editor so we can preview block styles in /wp-admin/widgets.php
  • Loading branch information
ramonjd committed Nov 30, 2021
1 parent a295829 commit 8142c8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const BlockInspectorSingleBlock = ( {
<div>
<PanelBody title={ __( 'Styles' ) }>
<BlockStyles
scope="core/edit-post"
scope="core/block-inspector"
clientId={ clientId }
className="block-inspector__block-styles"
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function Layout( { styles } ) {
{ isMobileViewport && sidebarIsOpened && (
<ScrollLock />
) }
<BlockStyles.Slot scope="core/edit-post" />
<BlockStyles.Slot scope="core/block-inspector" />
</>
}
footer={
Expand Down
11 changes: 7 additions & 4 deletions packages/edit-widgets/src/components/layout/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { useViewportMatch } from '@wordpress/compose';
import { BlockBreadcrumb } from '@wordpress/block-editor';
import { BlockBreadcrumb, BlockStyles } from '@wordpress/block-editor';
import { useEffect } from '@wordpress/element';
import { useDispatch, useSelect } from '@wordpress/data';
import {
Expand Down Expand Up @@ -94,9 +94,12 @@ function Interface( { blockEditorSettings } ) {
)
}
content={
<WidgetAreasBlockEditorContent
blockEditorSettings={ blockEditorSettings }
/>
<>
<WidgetAreasBlockEditorContent
blockEditorSettings={ blockEditorSettings }
/>
<BlockStyles.Slot scope="core/block-inspector" />
</>
}
footer={
hasBlockBreadCrumbsEnabled &&
Expand Down

0 comments on commit 8142c8e

Please sign in to comment.