Earlier quoted context omitted.
I just published a dnd library for nested tree structures ( https://www.npmjs.com/package/vue-tree-dnd ), and I can't believe how much of a PITA dnd is! Working on browser-compatibility took me back to pre-jquery days...
Interesting.. do you think it's a good use case for a drag an drop editor compared to other DND out there?
Show HN: Puck – Open-source visual editor for React
31–40 of 105 posts
Re: Show HN: Puck – Open-source visual editor for React
#32I would've expected some kind of WYSIWYG functionality for "make this API call and map the fields/properties of the response into the components" Like on the demo where it says https://puck-editor-demo.vercel.app/edit Users Reached 20M+, I thought instead of static text, it would've shown some kind of {{template}} that shows JSON query format like `jq` does to pluck fields from arrays/objects of fetch() response bodi…
However you can use an adaptor if you need to pull data in via a third party API: https://github.com/measuredco/puck/tree/main/packages/adapto...
Re: Show HN: Puck – Open-source visual editor for React
#33Can I make my own prop editor? Ex. instead of an input for the prop `name` I want a picker that fetches data from some API
You can use adaptors for this. Adaptors let you request a third party API via the `adaptor` field type. Docs are limited, but there's a reference data shape here: https://github.com/measuredco/puck#adaptor Example implementation here: https://github.com/measuredco/puck/blob/main/packages/adapto... Example usage here: https://github.com/measuredco/puck/blob/main/apps/demo/app/c... You can either use it for a specific…
Re: Show HN: Puck – Open-source visual editor for React
#34This looks decent and the idea is sound. I was looking at headless CMS recently and it only vaguely struck me that what is needed is the front-end builder component. Looking at the comments from the dev in this thread it seems this really only supports vertically stacked layouts right now? At least the demos were responsive but each component seems to assume that it fills the width of the screen. Making responsive co…
Scott from Measured here, we're dog-fooding puck on https://measured.co . There's a WIP branch with support for more sophisticated layouts here: https://github.com/measuredco/puck/tree/nested-dropzones And I think `use client` is a Next 13 thing. Not sure of the details, but Puck definately does render server-side.
Multi-column layouts are incoming very soon
And Puck does support either server or client rendering
Re: Show HN: Puck – Open-source visual editor for React
#35Earlier quoted context omitted.
We let the user decide how they want to store the data via the `onSave` and `onChange` callback props you provide to the ` ` component. So you would likely save to your own database in the callback. The data shape is detailed here: https://github.com/measuredco/puck#data
I'm trying to understand if the layout immediately becomes brittle once the data is saved (unless someone goes in to the saved data and patches it by hand when the layout is updated).
Re: Show HN: Puck – Open-source visual editor for React
#36Earlier quoted context omitted.
Interesting.. do you think it's a good use case for a drag an drop editor compared to other DND out there?
It's not for editing UIs like the OP's post. This is for editing nested lists. So it's probably not what you're looking for. But I made it because when I looked for a vue library that could do what I needed, I didn't find one that I wanted to use/thought would work.
Re: Show HN: Puck – Open-source visual editor for React
#37Looks good - does it support callback props, and how do you enter them?
However, you might be able to either wrap your component inside the `render` function and define your callback there, or use context to pass in a function from higher up the tree.
If you share your use case, I might be be able to help you out.
Re: Show HN: Puck – Open-source visual editor for React
#38Re: Show HN: Puck – Open-source visual editor for React
#39Wow, I've seen so many of these kinds of things over the years but this one is really special: extremely intuitive design, really powerful and flexible, and MIT licensed too. Super impressed.