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

Export useMultipleOriginColorsAndGradients #41438

Closed
rmorse opened this issue May 30, 2022 · 4 comments
Closed

Export useMultipleOriginColorsAndGradients #41438

rmorse opened this issue May 30, 2022 · 4 comments
Labels
[Package] Components /packages/components [Type] Question Questions about the design or development of the editor.

Comments

@rmorse
Copy link
Contributor

rmorse commented May 30, 2022

What problem does this address?

Not sure if this is a bug report of feature request...

I see useMultipleOriginColorsAndGradients() is not exported via the block editor components.

However it does seem to be exported in block editor components for native.

Without it we can't add the necessary colors + gradients that are supported in the current setup, eg when implementing ColorGradientSettingsDropdown in our own blocks/ui's.

What is your proposed solution?

Export it via the block editor components index.js.

I was wondering if it should be exported as experimental, although it seems in native it is not marked as such.

PR incoming

@rmorse
Copy link
Contributor Author

rmorse commented May 30, 2022

Ok it seems I am unable to contribute this change (or make a simple commit to the repo) as husky fails with an error when I try to commit...

Running tasks for packages/**/*.{js,ts,tsx,json} [failed]

Not sure what's going on here, but its my first time contributing again since husky was added. Seems it might be related to line endings but really not sure at this stage.

@annezazu annezazu added [Type] Question Questions about the design or development of the editor. [Package] Components /packages/components labels Jun 17, 2022
@corentin-gautier
Copy link
Contributor

corentin-gautier commented Jul 25, 2022

It's been added in #41102 but weirdly enough I was not able to use it using :

import { __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients } from "@wordpress/block-editor" 

It's used that way here

EDIT : I was not on the dev version of gutenberg, it works now even though the latest changes requires the <ColorGradientSettingsDropdown> to be used inside a <ToolsPanel> (because it's wrapped in a <ToolsPanelItem>)

@jorgefilipecosta
Copy link
Member

Closing this issue as according to the conversation, the hook seems to be exported now.

@justintadlock
Copy link
Contributor

I can confirm that this works now:

import {
	__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients
} from '@wordpress/block-editor';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

5 participants