react-json-view
react-json-view copied to clipboard
Custom Actions per Node - ability to paste clipboard under selected node
Hello - not seen anything in the issue log or similar questions - apologies if duplication.
I am happy with the copy action, with the ability to store the selected node in the clipboard. As a JSON editor, the instant follow on is how do I paste that same JSON into another part of the tree?
- User selects a node, with a tree beneath depicting a shape they wish to clone.
- User select Copy icon.
- They hover over another node and click Paste Icon.
- JSON in clipboard is appended under node selected.
For this it would be most generic to add an ability to add custom actions to a node, I can add my own Paste Icon with callback and add the clipboard to the node in the event parameters. Or even simpler for me, React-Json-View adds enablePaste to the properties and support paste out of the box.
Any hints or tips most welcome.
Matt
https://github.com/mac-s-g/react-json-view/issues/354 is for custom buttons, I don't know how easy it would be to implement a custom 'Paste Json' button.