Skip to content

Commit

Permalink
Edit Site: Unlock private APIs outside of the component (#50534)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored May 11, 2023
1 parent ed9be12 commit 8346327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { ESCAPE } from '@wordpress/keycodes';
import { store as editSiteStore } from '../../store';
import { unlock } from '../../private-apis';

const { PrivateListView } = unlock( blockEditorPrivateApis );

export default function ListViewSidebar() {
const { setIsListViewOpened } = useDispatch( editSiteStore );

Expand All @@ -31,7 +33,6 @@ export default function ListViewSidebar() {
}
}

const { PrivateListView } = unlock( blockEditorPrivateApis );
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { store as coreStore } from '@wordpress/core-data';
*/
import { unlock } from '../../private-apis';

const { PrivateListView, LeafMoreMenu } = unlock( blockEditorPrivateApis );

function CustomLinkAdditionalBlockUI( { block, onClose } ) {
const { updateBlockAttributes } = useDispatch( blockEditorStore );
const { label, url, opensInNewTab } = block.attributes;
Expand Down Expand Up @@ -143,8 +145,6 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) {
};
}, [ shouldKeepLoading, clientIdsTree, isLoading ] );

const { PrivateListView, LeafMoreMenu } = unlock( blockEditorPrivateApis );

const offCanvasOnselect = useCallback(
( block ) => {
if (
Expand Down

0 comments on commit 8346327

Please sign in to comment.