diff --git a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-colors.tsx b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-colors.tsx index 251f1c944b..27a2b651fb 100644 --- a/packages/js/email-editor/src/components/styles-sidebar/screens/screen-colors.tsx +++ b/packages/js/email-editor/src/components/styles-sidebar/screens/screen-colors.tsx @@ -1,16 +1,22 @@ +/** + * WordPress dependencies + */ import { __ } from '@wordpress/i18n'; import { useSelect } from '@wordpress/data'; -import { - // @ts-expect-error No types for this exist yet. - privateApis as blockEditorPrivateApis, -} from '@wordpress/block-editor'; + +/** + * WordPress private dependencies + */ +import { StylesColorPanel } from '../../../private-apis'; + +/** + * Internal dependencies + */ import ScreenHeader from './screen-header'; -import { unlock } from '../../../lock-unlock'; import { useEmailStyles } from '../../../hooks'; import { storeName } from '../../../store'; export function ScreenColors(): JSX.Element { - const { ColorPanel: StylesColorPanel } = unlock( blockEditorPrivateApis ); const { styles, defaultStyles, updateStyles } = useEmailStyles(); const theme = useSelect( ( select ) => select( storeName ).getTheme(), [] ); diff --git a/packages/js/email-editor/src/private-apis/index.ts b/packages/js/email-editor/src/private-apis/index.ts index 48fe4696a3..1373c0cce6 100644 --- a/packages/js/email-editor/src/private-apis/index.ts +++ b/packages/js/email-editor/src/private-apis/index.ts @@ -50,9 +50,15 @@ const unlockGetEnabledClientIdsTree = ( selectHook ) => { return getEnabledClientIdsTree; }; +/** + * We use the ColorPanel component from the block editor to render the color panel in the style settings sidebar. + */ +const { ColorPanel: StylesColorPanel } = unlock( blockEditorPrivateApis ); + export { BlockCanvas, Tabs, + StylesColorPanel, unlockPatternsRelatedSelectorsFromCoreStore, unlockGetEnabledClientIdsTree, };