From e6e248cba80bb1557ad214cc411def239583cc06 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Wed, 23 Oct 2024 10:56:42 -0500 Subject: [PATCH] Make useZoomOut hook private --- packages/block-editor/README.md | 8 -------- packages/block-editor/src/index.js | 1 - packages/block-editor/src/private-apis.js | 2 ++ .../components/global-styles/screen-style-variations.js | 5 ++++- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 7fc44c2ead9439..a0f75683914408 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -1075,14 +1075,6 @@ _Parameters_ - _override.id_ `?string`: Id of the style override, leave blank to create a new style. - _override.css_ `string`: CSS to apply. -### useZoomOut - -A hook used to set the editor mode to zoomed out mode, invoking the hook sets the mode. - -_Parameters_ - -- _zoomOut_ `boolean`: If we should enter into zoomOut mode or not - ### Warning _Related_ diff --git a/packages/block-editor/src/index.js b/packages/block-editor/src/index.js index db1bc0a06ec6d1..d81f23a702b04e 100644 --- a/packages/block-editor/src/index.js +++ b/packages/block-editor/src/index.js @@ -13,7 +13,6 @@ export { getGapCSSValue as __experimentalGetGapCSSValue, getShadowClassesAndStyles as __experimentalGetShadowClassesAndStyles, useCachedTruthy, - useZoomOut, useStyleOverride, } from './hooks'; export * from './components'; diff --git a/packages/block-editor/src/private-apis.js b/packages/block-editor/src/private-apis.js index 7205bef5798ec1..7a18c9169a1dc2 100644 --- a/packages/block-editor/src/private-apis.js +++ b/packages/block-editor/src/private-apis.js @@ -24,6 +24,7 @@ import { useLayoutClasses, useLayoutStyles, __unstableBlockStyleVariationOverridesWithConfig, + useZoomOut, } from './hooks'; import DimensionsTool from './components/dimensions-tool'; import ResolutionTool from './components/resolution-tool'; @@ -78,6 +79,7 @@ lock( privateApis, { TextAlignmentControl, usesContextKey, useFlashEditableBlocks, + useZoomOut, globalStylesDataKey, globalStylesLinksDataKey, selectBlockPatternsKey, diff --git a/packages/edit-site/src/components/global-styles/screen-style-variations.js b/packages/edit-site/src/components/global-styles/screen-style-variations.js index 70727ac6698801..12690966ba3c4f 100644 --- a/packages/edit-site/src/components/global-styles/screen-style-variations.js +++ b/packages/edit-site/src/components/global-styles/screen-style-variations.js @@ -3,7 +3,7 @@ */ import { Card, CardBody } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { useZoomOut } from '@wordpress/block-editor'; +import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import { useDispatch } from '@wordpress/data'; import { store as editorStore } from '@wordpress/editor'; @@ -12,6 +12,9 @@ import { store as editorStore } from '@wordpress/editor'; */ import ScreenHeader from './header'; import SidebarNavigationScreenGlobalStylesContent from '../sidebar-navigation-screen-global-styles/content'; +import { unlock } from '../../lock-unlock'; + +const { useZoomOut } = unlock( blockEditorPrivateApis ); function ScreenStyleVariations() { // Style Variations should only be previewed in with