diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index de914a553c0bca..b260b1f1e93df2 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -804,10 +804,6 @@ _Related_ - -### ToolSelector - -Undocumented declaration. - ### transformStyles Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed. diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index 2a127feb3df1cc..ec9f0a7373efe5 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -86,7 +86,6 @@ export { RichTextToolbarButton, __unstableRichTextInputEvent, } from './rich-text'; -export { default as ToolSelector } from './tool-selector'; export { default as __experimentalUnitControl } from './unit-control'; export { default as URLInput } from './url-input'; export { default as URLInputButton } from './url-input/button'; diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index 484d79e8db9fa0..21b499aa8a7af1 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -43,7 +43,6 @@ @import "./components/rich-text/style.scss"; @import "./components/segmented-text-control/style.scss"; @import "./components/skip-to-selected-block/style.scss"; -@import "./components/tool-selector/style.scss"; @import "./components/url-input/style.scss"; @import "./components/url-popover/style.scss"; @import "./hooks/block-bindings.scss"; diff --git a/packages/editor/src/components/document-tools/index.js b/packages/editor/src/components/document-tools/index.js index 6952fa34e31ae9..000c3a40defbd5 100644 --- a/packages/editor/src/components/document-tools/index.js +++ b/packages/editor/src/components/document-tools/index.js @@ -11,10 +11,9 @@ import { useSelect, useDispatch } from '@wordpress/data'; import { __, _x } from '@wordpress/i18n'; import { NavigableToolbar, - ToolSelector, store as blockEditorStore, } from '@wordpress/block-editor'; -import { Button, ToolbarItem } from '@wordpress/components'; +import { ToolbarItem } from '@wordpress/components'; import { listView, plus } from '@wordpress/icons'; import { useCallback } from '@wordpress/element'; import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; @@ -27,6 +26,8 @@ import { unlock } from '../../lock-unlock'; import { store as editorStore } from '../../store'; import EditorHistoryRedo from '../editor-history/redo'; import EditorHistoryUndo from '../editor-history/undo'; +import ToolSelector from '../tool-selector'; +import PreferencesAwareButton from '../preferences-aware-button'; const preventDefault = ( event ) => { event.preventDefault(); @@ -118,7 +119,7 @@ function DocumentTools( { { ! isDistractionFree && ( { ! isDistractionFree && ( .components-button.has-icon, + .editor-document-tools__left > .components-button.is-showing-icon-label, .editor-document-tools__left > .components-dropdown > .components-button.has-icon { // @todo override toolbar group inherited paddings from components/block-tools/style.scss. // This is best fixed by making the mover control area a proper single toolbar group. @@ -73,19 +88,6 @@ margin-right: $grid-unit-10; } -.editor-document-tools .editor-document-tools__left > .editor-document-tools__inserter-toggle.has-icon { - min-width: $button-size-compact; - width: $button-size-compact; - height: $button-size-compact; - padding: 0; - - .show-icon-labels & { - width: auto; - height: $button-size-compact; - padding: 0 $grid-unit-10; - } -} - .show-icon-labels .editor-document-tools__left > * + * { margin-left: $grid-unit-10; } diff --git a/packages/editor/src/components/editor-history/redo.js b/packages/editor/src/components/editor-history/redo.js index 2ded5bfd52539a..b997ca1a90e239 100644 --- a/packages/editor/src/components/editor-history/redo.js +++ b/packages/editor/src/components/editor-history/redo.js @@ -2,7 +2,6 @@ * WordPress dependencies */ import { __, isRTL } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; import { displayShortcut, isAppleOS } from '@wordpress/keycodes'; import { redo as redoIcon, undo as undoIcon } from '@wordpress/icons'; @@ -12,6 +11,7 @@ import { forwardRef } from '@wordpress/element'; * Internal dependencies */ import { store as editorStore } from '../../store'; +import PreferencesAwareButton from '../preferences-aware-button'; function EditorHistoryRedo( props, ref ) { const shortcut = isAppleOS() @@ -24,7 +24,7 @@ function EditorHistoryRedo( props, ref ) { ); const { redo } = useDispatch( editorStore ); return ( -