CarlosNZ / json-edit-react

React component for editing/viewing JSON/object data
https://carlosnz.github.io/json-edit-react/
MIT License
128 stars 14 forks source link

Drag and drop from external sources #111

Open marco-gagliardi opened 1 month ago

marco-gagliardi commented 1 month ago

Beside moving around internal existing nodes, it would be nice to also have a functionality to drag and drop elements from external sources. External sources can be pre-defined templates for available nodes that a user can drag and drop as items of an array or object values.

CarlosNZ commented 1 month ago

That's an interesting idea. Just wondering how you imagine it would work? Presumably dragging in would need to create a new key-value pair, but most dragged data would probably be a single value, so what would we set the key to?. I guess it makes sense for arrays, but harder for object values. It sounds like you have something in mind with "pre-defined templates", so could you elaborate on that?

But also, I have to ask: what would be the use case where dragging/dropping some data would be easier than just copy-pasting?