-
Notifications
You must be signed in to change notification settings - Fork 309
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
Adding 'object' type as a datatype option #62
Conversation
@Danm72 is attempting to deploy a commit to the Measured Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thanks for the issue and WIP PR @Danm72! Great work!
I'm think I'm in favour of adding support for object params (because we have array
), and can certainly think of some use-cases where a flat model doesn't cut it. Styling inner components is likely just one use case of many (and one that will probably become less important with #37, which will allow for nested components).
A few things come to mind when looking through your PR and thinking about this feature:
- I'm not a huge fan of the
array
UI in general, and not totally sure if it makes sense forobject
fields. It's totally fine to reuse as part of this initial implementation, but we might want to revisit it at some point. Which brings me onto... - Inline fieldsets at the top-level (with headings) are something I've considered as a way to break the form up into separate areas of related fields. It strikes me that the Heading scenario here might also work with an inline Heading fieldset. Again, not for this PR but I think worth the discussion point.
- And finally, the only thing I think we should perhaps reconsider is whether to include the Heading fields in the Hero for the demo component. Whilst it shows the functionality well, I worry it bloats the demo out and isn't something need to necessary know about from first impressions.
PS how are you producing those lovely screen recordings? 😍
Awesome feedback I'll respond when I'm back at my PC but all sounds logical to me! I agree about the array UI and might noodle about with the fieldset concept! Good point on the demo. Videos are made with the awesome https://www.screen.studio |
Great! And no rush. I've made a separate ticket to discuss a fieldset API - #64 |
Hey @chrisvxd added those small changes lemme know if you see anything else. Feel free to go in another direction with this! |
Hey @Danm72! Just checking why you closed this? Was going to review as soon as I had time. Happy with general direction |
Hey Chris, Whoops sorry I thought it was going stagnant and didn't want to leave it sitting there! Feel free to merge it or run with it I was just thinking your other PR around field rendering might be a little more advanced with the 'custom' type. Maybe both flows could work. Change my PR to use type 'custom' instead of object and the default custom renderer is the array renderer? Unsure if id go with object or custom.. |
Which can be used to embed objects within the sidebar to embed other editor objects within blocks or to create more details objects.
In this case you can see the 'component' Heading is used to supply object fields to the Block Hero, the values are then used to actually style the heading object within the hero.
demo.mp4
#60