@@ -4,6 +4,7 @@ import { useMemo, useState } from '@wordpress/element';
44import { privateApis as routerPrivateApis } from '@wordpress/router' ;
55import { privateApis as editorPrivateApis } from '@wordpress/editor' ;
66import { useViewportMatch } from '@wordpress/compose' ;
7+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor' ;
78import { useSelect } from '@wordpress/data' ;
89import { Button , __experimentalHStack as HStack } from '@wordpress/components' ;
910import { addQueryArgs , removeQueryArgs } from '@wordpress/url' ;
@@ -14,6 +15,13 @@ import { unlock } from '../../lock-unlock';
1415const { GlobalStylesUIWrapper, GlobalStylesActionMenu } =
1516 unlock ( editorPrivateApis ) ;
1617const { useLocation, useHistory } = unlock ( routerPrivateApis ) ;
18+ const { ToolsPanelPopoverPropsContext } = unlock ( blockEditorPrivateApis ) ;
19+
20+ // Panel padding (16px) + screen padding (12px) + spacing (4px)
21+ const TOOLS_PANEL_POPOVER_PROPS = {
22+ dropdown : { placement : 'right-start' , offset : 32 } ,
23+ item : { placement : 'right-start' , offset : 32 , shift : true } ,
24+ } ;
1725
1826const GlobalStylesPageActions = ( {
1927 isStyleBookOpened,
@@ -99,11 +107,15 @@ export default function SidebarGlobalStyles() {
99107 headingLevel = { 2 }
100108 >
101109 < div className = "edit-site-styles__content" >
102- < GlobalStylesUIWrapper
103- path = { section }
104- onPathChange = { onChangeSection }
105- settings = { settings }
106- />
110+ < ToolsPanelPopoverPropsContext . Provider
111+ value = { TOOLS_PANEL_POPOVER_PROPS }
112+ >
113+ < GlobalStylesUIWrapper
114+ path = { section }
115+ onPathChange = { onChangeSection }
116+ settings = { settings }
117+ />
118+ </ ToolsPanelPopoverPropsContext . Provider >
107119 </ div >
108120 </ Page >
109121 ) ;
0 commit comments