From 962eed501f54d662963dd85261a5dcf9fefaa9b4 Mon Sep 17 00:00:00 2001 From: Huub <50170696+huubl@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:34:19 +0200 Subject: [PATCH] Revert "Only show zoom out inserters on block selection (#65759)" This reverts commit 6641b290b13415a706fbe5ec0e4b5db9bb25bca3. --- .../src/components/block-tools/style.scss | 8 ++++++++ .../zoom-out-mode-inserter-button.js | 19 +++++++++++++++++-- .../block-tools/zoom-out-mode-inserters.js | 17 +++++++++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/packages/block-editor/src/components/block-tools/style.scss b/packages/block-editor/src/components/block-tools/style.scss index b7586a6715dcc..a3d9153273e98 100644 --- a/packages/block-editor/src/components/block-tools/style.scss +++ b/packages/block-editor/src/components/block-tools/style.scss @@ -202,3 +202,11 @@ border: none; } } + +.block-editor-block-tools__zoom-out-mode-inserter-button { + visibility: hidden; + + &.is-visible { + visibility: visible; + } +} diff --git a/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js b/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js index 961552caa66e0..8ea80a5383013 100644 --- a/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js +++ b/packages/block-editor/src/components/block-tools/zoom-out-mode-inserter-button.js @@ -6,11 +6,17 @@ import clsx from 'clsx'; /** * WordPress dependencies */ +import { useState } from '@wordpress/element'; import { Button } from '@wordpress/components'; import { plus } from '@wordpress/icons'; import { _x } from '@wordpress/i18n'; -function ZoomOutModeInserterButton( { onClick } ) { +function ZoomOutModeInserterButton( { isVisible, onClick } ) { + const [ + zoomOutModeInserterButtonHovered, + setZoomOutModeInserterButtonHovered, + ] = useState( false ); + return (