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. (#37012)

Adding the block styles slot to the widget editor so we can preview block styles in /wp-admin/widgets.php
  • Loading branch information
ramonjd authored Dec 6, 2021
1 parent c9400f7 commit 7edb0f0
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 @@ -115,7 +115,7 @@ const BlockInspectorSingleBlock = ( {
<div>
<PanelBody title={ __( 'Styles' ) }>
<BlockStyles
scope="core/edit-post"
scope="core/block-inspector"
clientId={ clientId }
/>
{ hasBlockSupport(
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 7edb0f0

Please sign in to comment.