Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Editor: Deprecate 'BlockColorsStyleSelector' component #40502

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { DOWN } from '@wordpress/keycodes';
import deprecated from '@wordpress/deprecated';

const ColorSelectorSVGIcon = () => (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 20 20">
Expand Down Expand Up @@ -78,14 +79,22 @@ const renderToggleComponent = ( { TextColor, BackgroundColor } ) => ( {
);
};

const BlockColorsStyleSelector = ( { children, ...other } ) => (
<Dropdown
position="bottom right"
className="block-library-colors-selector"
contentClassName="block-library-colors-selector__popover"
renderToggle={ renderToggleComponent( other ) }
renderContent={ () => children }
/>
);
const BlockColorsStyleSelector = ( { children, ...other } ) => {
deprecated( `wp.blockEditor.BlockColorsStyleSelector`, {
alternative: 'block supports API',
since: '6.1',
version: '6.3',
} );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, is it time to remove this API or if judged too impactful, consider extending the version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were no longer removing deprecated components and APIs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we've came to a concrete decision yet. If you want to keep it, then update the version maybe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t feel a strong attachment to this component, but some people have strong feelings on public API removals.


return (
<Dropdown
position="bottom right"
className="block-library-colors-selector"
contentClassName="block-library-colors-selector__popover"
renderToggle={ renderToggleComponent( other ) }
renderContent={ () => children }
/>
);
};

export default BlockColorsStyleSelector;