-
-
Notifications
You must be signed in to change notification settings - Fork 726
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
Enhance ColorPickerWidget
#5585
Conversation
✅ Deploy Preview for volto canceled.
|
✅ Deploy Preview for plone-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
In this comment is the link for the Deploy Preview correct? https://deploy-preview-5585--plone-components.netlify.app/ I expected to see something like this: https://6.docs.plone.org/storybook/?path=/story/edit-widgets-colorpicker--default If it is not correct, then is this a configuration item in GitHub Workflows or Netlify? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly grammar and MyST syntax fixes, but added some structure and some questions.
No, it's not correct. Good catch. I configured the |
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Víctor Fernández de Alba <sneridagh@gmail.com> Co-authored-by: ichim-david <ichim.david@gmail.com>
…style name generator (#5586) Co-authored-by: Steve Piercy <web@stevepiercy.com>
@stevepiercy the |
@sneridagh I will poke around inside Netlify and GitHub actions and Makefile. There must be something in there that triggers it. |
@sneridagh needs a change log entry. |
@sneridagh also unit tests fail in CI. |
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@sneridagh I found it. There is another site in Netlify, https://app.netlify.com/sites/plone-components/overview, that gets built on every pull request in Volto. I think we want it to build only when something in its package builds, not within the entire volto repo, correct? |
@stevepiercy I will take a look at the unit tests I still want to polish the code a bit. |
@stevepiercy is there a way to filter when to build it? |
Yup, similar to what we do for Volto docs, we can do a diff. Let's do this in a separate PR, because I don't want this one to become a victim of feature creep. I also want to add the Storybook build for docs to be reachable at |
return ( | ||
<Button | ||
key={id + color.name} | ||
className={color.name} | ||
key={id + colorName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could just use the index in colors
here and avoid requiring name
. It seems unlikely that they will be reordered frequently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davisagli so you'd change the style
use case branch? as in:
type Color =
| {
name: undefined;
label: string;
style: Record<`--${string}`, string>;
}
| {
name: string;
label: string;
style: undefined;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sneridagh yeah, that's the suggestion, but I don't feel strongly about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davisagli I don't know, I feel the way it is now is more consistent, when we deal with choices, we always have a "display name" (label) and a "token" (value). The token is invariable, but the display name could be i18n'd. If at some point you need to identify the color entry, you will have to equal the style property (which you could still do...) Answering myself while writing :)
Anyways, I don't have a strong opinion either at this point.
/cc @tiberiuichim @ichim-david @giuliaghisini @pnicolli any opinions about this?
Co-authored-by: David Glick <david@glicksoftware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good: https://deploy-preview-5585--volto.netlify.app/recipes/color-picker-widget.html
Just a minor suggestion to the news item, and it's GTG.
Co-authored-by: Steve Piercy <web@stevepiercy.com>
* main: (1505 commits) Links references view cypress tests (#5111) Unify start command, trigger `build:deps` command too (#5633) Release generate-volto 9.0.0-alpha.3 Release @plone/types 1.0.0-alpha.2 Improve Blocks typings. Refactor `volto-coresandbox` to TS. (#5624) i18n polishing (#5542) Release @plone/scripts 3.2.1 Fix @plone/scripts for 17 and below (#5613) Release @plone/scripts 3.2.0 Enhance `ColorPickerWidget` (#5585) edit recurrence button is aligned properly (#5590) Revert "Attempt to build the volto/components Storybook only when something c…" (#5601) Revert "Added Storybook to Netlify build to allow relative links from documen…" (#5598) Added Storybook to Netlify build to allow relative links from documen… (#5596) Attempt to build the volto/components Storybook only when something c… (#5595) Pin mrs.developer to an updated version, never to star. (#5593) Allow to bail off the nested name build in the custom CSS properties style name generator (#5586) Clarify how CSS properties work (#5592) Release 18.0.0-alpha.6 Release @plone/client 1.0.0-alpha.12 ...
* main: (39 commits) Attempt to build the components storybook only when its source files … (#5600) Added Storybook to Netlify build to allow relative links from documentation (#5599) Fix multilingual redirector (#5628) (#5665) Update ref from install-from-packages to create-project (#5654) Pin Vale to 2.30.0 to allow build of documentation until we can upgrade to v3.x (#5656) Temporarily pin `sphinxcontrib-*help` dependencies so docs can build (#5655) Merge the StyleWrapper styles with the draggable props from b-D&D (#5652) Fix order of preference in addons-registry for the theme (#5649) Unify variables in Makefile (#5637) Links references view cypress tests (#5111) Unify start command, trigger `build:deps` command too (#5633) Release generate-volto 9.0.0-alpha.3 Release @plone/types 1.0.0-alpha.2 Improve Blocks typings. Refactor `volto-coresandbox` to TS. (#5624) i18n polishing (#5542) Release @plone/scripts 3.2.1 Fix @plone/scripts for 17 and below (#5613) Release @plone/scripts 3.2.0 Enhance `ColorPickerWidget` (#5585) edit recurrence button is aligned properly (#5590) ...
Now it accepts also colors definitions like:
So now it supports to save an object containing a list of custom CSS properties definitions.
See documentation for more background.