From 41660c1f6d1deb870734e16f139a1eeb3df92fad Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 18 May 2023 15:20:32 +0400 Subject: [PATCH] Block Editor: Remove unused 'useIsDimensionsSupportValid' method --- packages/block-editor/src/hooks/dimensions.js | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/packages/block-editor/src/hooks/dimensions.js b/packages/block-editor/src/hooks/dimensions.js index 02c3931ef9850d..084763f0c21b16 100644 --- a/packages/block-editor/src/hooks/dimensions.js +++ b/packages/block-editor/src/hooks/dimensions.js @@ -136,43 +136,3 @@ export function useCustomSides() { version: '6.4', } ); } - -/** - * Custom hook to determine whether the sides configured in the - * block support are valid. A dimension property cannot declare - * support for a mix of axial and individual sides. - * - * @param {string} blockName Block name. - * @param {string} feature The feature custom sides relate to e.g. padding or margins. - * - * @return {boolean} If the feature has a valid configuration of sides. - */ -export function useIsDimensionsSupportValid( blockName, feature ) { - const sides = useCustomSides( blockName, feature ); - - if ( - sides && - sides.some( ( side ) => ALL_SIDES.includes( side ) ) && - sides.some( ( side ) => AXIAL_SIDES.includes( side ) ) - ) { - // eslint-disable-next-line no-console - console.warn( - `The ${ feature } support for the "${ blockName }" block can not be configured to support both axial and arbitrary sides.` - ); - return false; - } - - if ( - sides?.length && - feature === 'blockGap' && - ! AXIAL_SIDES.every( ( side ) => sides.includes( side ) ) - ) { - // eslint-disable-next-line no-console - console.warn( - `The ${ feature } support for the "${ blockName }" block can not be configured to support arbitrary sides.` - ); - return false; - } - - return true; -}