diff --git a/packages/edit-site/src/components/editor-canvas-container/index.js b/packages/edit-site/src/components/editor-canvas-container/index.js index 050d2e19585cc4..fb3d2574c4cb79 100644 --- a/packages/edit-site/src/components/editor-canvas-container/index.js +++ b/packages/edit-site/src/components/editor-canvas-container/index.js @@ -10,7 +10,7 @@ import { ESCAPE } from '@wordpress/keycodes'; import { __ } from '@wordpress/i18n'; import { useDispatch, useSelect } from '@wordpress/data'; import { closeSmall } from '@wordpress/icons'; -import { useFocusOnMount, useFocusReturn } from '@wordpress/compose'; +import { useFocusReturn } from '@wordpress/compose'; import { store as preferencesStore } from '@wordpress/preferences'; import { store as editorStore, @@ -74,7 +74,6 @@ function EditorCanvasContainer( { ); const { setIsListViewOpened } = useDispatch( editorStore ); - const focusOnMountRef = useFocusOnMount( 'firstElement' ); const sectionFocusReturnRef = useFocusReturn(); function onCloseContainer() { @@ -119,7 +118,6 @@ function EditorCanvasContainer( { { /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }
diff --git a/packages/edit-site/src/components/global-styles-sidebar/index.js b/packages/edit-site/src/components/global-styles-sidebar/index.js index 02a29dac5c0b7d..4e9c47c51f1d3c 100644 --- a/packages/edit-site/src/components/global-styles-sidebar/index.js +++ b/packages/edit-site/src/components/global-styles-sidebar/index.js @@ -3,7 +3,7 @@ */ import { FlexItem, Flex, Button } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { styles, seen, backup } from '@wordpress/icons'; +import { styles, seen } from '@wordpress/icons'; import { useSelect, useDispatch } from '@wordpress/data'; import { useEffect, useRef } from '@wordpress/element'; import { store as preferencesStore } from '@wordpress/preferences'; @@ -21,7 +21,6 @@ import { GlobalStylesUI } from '../global-styles'; import { store as editSiteStore } from '../../store'; import { GlobalStylesMenuSlot } from '../global-styles/ui'; import { unlock } from '../../lock-unlock'; -import { store as coreStore } from '@wordpress/core-data'; import DefaultSidebar from './default-sidebar'; const { interfaceStore } = unlock( editorPrivateApis ); @@ -34,7 +33,6 @@ export default function GlobalStylesSidebar() { shouldClearCanvasContainerView, isStyleBookOpened, showListViewByDefault, - hasRevisions, isRevisionsOpened, isRevisionsStyleBookOpened, } = useSelect( @@ -51,13 +49,6 @@ export default function GlobalStylesSidebar() { 'core', 'showListViewByDefault' ); - const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = - select( coreStore ); - - const globalStylesId = __experimentalGetCurrentGlobalStylesId(); - const globalStyles = globalStylesId - ? getEntityRecord( 'root', 'globalStyles', globalStylesId ) - : undefined; return { isStyleBookOpened: 'style-book' === canvasContainerView, @@ -67,9 +58,6 @@ export default function GlobalStylesSidebar() { ! _isVisualEditorMode || ! _isEditCanvasMode, showListViewByDefault: _showListViewByDefault, - hasRevisions: - !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ] - ?.count, isRevisionsStyleBookOpened: 'global-styles-revisions:style-book' === canvasContainerView, @@ -92,25 +80,6 @@ export default function GlobalStylesSidebar() { const { setIsListViewOpened } = useDispatch( editorStore ); - const toggleRevisions = () => { - setIsListViewOpened( false ); - if ( isRevisionsStyleBookOpened ) { - setEditorCanvasContainerView( 'style-book' ); - return; - } - if ( isRevisionsOpened ) { - setEditorCanvasContainerView( undefined ); - return; - } - - if ( isStyleBookOpened ) { - setEditorCanvasContainerView( - 'global-styles-revisions:style-book' - ); - } else { - setEditorCanvasContainerView( 'global-styles-revisions' ); - } - }; const toggleStyleBook = () => { if ( isRevisionsOpened ) { setEditorCanvasContainerView( @@ -181,20 +150,6 @@ export default function GlobalStylesSidebar() { /> ) } - -