From efebb78193ad6d1992b0f2533cc63b18854c6635 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 23 Mar 2023 10:35:19 +0100 Subject: [PATCH] Remove dead code --- .../src/components/global-styles/index.js | 2 - .../src/components/global-styles/hooks.js | 55 +------------------ 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/packages/block-editor/src/components/global-styles/index.js b/packages/block-editor/src/components/global-styles/index.js index 0c5b61579890cf..5c344cea3924e8 100644 --- a/packages/block-editor/src/components/global-styles/index.js +++ b/packages/block-editor/src/components/global-styles/index.js @@ -3,8 +3,6 @@ export { useGlobalSetting, useGlobalStyle, useSettingsForBlockElement, - useColorsPerOrigin, - useGradientsPerOrigin, } from './hooks'; export { useGlobalStylesOutput } from './use-global-styles-output'; export { GlobalStylesContext } from './context'; diff --git a/packages/edit-site/src/components/global-styles/hooks.js b/packages/edit-site/src/components/global-styles/hooks.js index 04a8081050e8ef..163ae58df8dcfa 100644 --- a/packages/edit-site/src/components/global-styles/hooks.js +++ b/packages/edit-site/src/components/global-styles/hooks.js @@ -16,64 +16,11 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor'; import { unlock } from '../../private-apis'; import { useSelect } from '@wordpress/data'; -const { - useGlobalSetting, - useColorsPerOrigin: useColorsPerOriginFromSettings, - useGradientsPerOrigin: useGradientsPerOriginFromSettings, -} = unlock( blockEditorPrivateApis ); +const { useGlobalSetting } = unlock( blockEditorPrivateApis ); // Enable colord's a11y plugin. extend( [ a11yPlugin ] ); -export function useColorsPerOrigin( name ) { - const [ customColors ] = useGlobalSetting( 'color.palette.custom', name ); - const [ themeColors ] = useGlobalSetting( 'color.palette.theme', name ); - const [ defaultColors ] = useGlobalSetting( 'color.palette.default', name ); - const [ shouldDisplayDefaultColors ] = useGlobalSetting( - 'color.defaultPalette' - ); - - return useColorsPerOriginFromSettings( { - color: { - palette: { - custom: customColors, - theme: themeColors, - default: defaultColors, - }, - defaultPalette: shouldDisplayDefaultColors, - }, - } ); -} - -export function useGradientsPerOrigin( name ) { - const [ customGradients ] = useGlobalSetting( - 'color.gradients.custom', - name - ); - const [ themeGradients ] = useGlobalSetting( - 'color.gradients.theme', - name - ); - const [ defaultGradients ] = useGlobalSetting( - 'color.gradients.default', - name - ); - const [ shouldDisplayDefaultGradients ] = useGlobalSetting( - 'color.defaultGradients' - ); - - return useGradientsPerOriginFromSettings( { - color: { - gradients: { - custom: customGradients, - theme: themeGradients, - default: defaultGradients, - }, - defaultGradients: shouldDisplayDefaultGradients, - }, - } ); -} - export function useColorRandomizer( name ) { const [ themeColors, setThemeColors ] = useGlobalSetting( 'color.palette.theme',