Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Add more literal unions based off of options.lists #63

Open
2 tasks
ricokahler opened this issue Jan 19, 2021 · 1 comment · May be fixed by #295
Open
2 tasks

Add more literal unions based off of options.lists #63

ricokahler opened this issue Jan 19, 2021 · 1 comment · May be fixed by #295
Labels
enhancement New feature or request
Milestone

Comments

@ricokahler
Copy link
Owner

ricokahler commented Jan 19, 2021

If you add options.list to a string field, the codegen will take the values of that and produce a union of string literals

e.g.

{
  name: 'someField',
  type: 'string',
  options: { list: ['foo', 'bar'] },
}

will produce the type

'foo' | 'bar'

This issue is to add that support for other fields that allow options.list.

This includes:

  • numbers
  • arrays
@ricokahler ricokahler added this to the v1.0.0 milestone Apr 13, 2021
@ricokahler
Copy link
Owner Author

This has been partially completed in the alpha branch

@ricokahler ricokahler added the enhancement New feature or request label May 14, 2021
refactorized added a commit to refactorized/sanity-codegen that referenced this issue Dec 9, 2021
* tablet breakpoint and code refactors for Layout/Block

* fixing phantom top padding of inner element for Layout/Block

* wrapping TextAndImage with div

* overflow: hidden on Layout/Block children to actually fix margin collapse

* merge master and fix conflicts with TextAndImage
@ochicf ochicf linked a pull request Jun 8, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant