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

feat(ui): introduce CoreColorInput. WF-9 #486

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

madeindjs
Copy link
Collaborator

@madeindjs madeindjs commented Jul 5, 2024

Create a new component CoreColorInput using a sub-component BaseInputColor.

The component accept a list of predefined colors using datalist (see doc)

Screencast.from.2024-07-09.22-10-29.webm

@madeindjs madeindjs marked this pull request as ready for review July 6, 2024 13:51
@FabienArcellier
Copy link
Collaborator

FabienArcellier commented Jul 7, 2024

The implementation look promising but I fails to reproduce the video on review environment.

Peek 2024-07-07 19-41

@FabienArcellier
Copy link
Collaborator

FabienArcellier commented Jul 8, 2024

  • set a field color list (json array ?)
  • separate the label for the width of color picker
  • use different component between builder and component
  • for later, set existing color other than default one at the end, sort by occurence
  • for later, for history parsing, use field type color instead of color matching

src/ui/core/index.ts to get component definition based on its type

export function getComponentDefinition(type: string)

@madeindjs
Copy link
Collaborator Author

@FabienArcellier & @ramedina86 , I implemented the changes. Here the new screenshot

Screencast.from.2024-07-09.22-10-29.webm

I have a small doubt regarding predifined colors because:

  1. we use FieldType.Object since we don't have array field, so we have to check that the JSON is an array and it's not convenient for the user to edit it
  2. The browser accept only a list of hexadecimal colors (see doc)
  3. It's just a suggestion palette, the user can use the color picker to select whatever he wants

Let me know what you think about it

@madeindjs madeindjs changed the title feat: introduce CoreColorInput + last colors selected. WF-9 feat(ui): introduce CoreColorInput. WF-9 Jul 9, 2024
@FabienArcellier
Copy link
Collaborator

Thanks It seems good. An improvement for later would be to add a BuilderFieldsValueList component which takes inspiration from BuilderFieldsKeyValue to manipulate a proposal list and provide preformatted Json.

Copy link
Collaborator

@ramedina86 ramedina86 left a comment

Choose a reason for hiding this comment

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

Nice work, some small changes and I'll merge

src/ui/src/core/index.ts Outdated Show resolved Hide resolved
@ramedina86 ramedina86 merged commit dba74df into writer:dev Jul 23, 2024
16 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants