Open conorw opened 5 months ago
Thanks, good to hear. I'm not sure what you mean: do you mean copy/paste as an end user? (You can just edit the contents of the query in the "Query" input field). Or do you mean a programmatic API?
apologies @josdejong , I should have explained better: Ideally, I want to be able to save the javascript transformation code that is built in the transformation modal dialog. Hopefully the following quick and dirty PR should explain better https://github.com/josdejong/svelte-jsoneditor/pull/394
Ah, yes, so you want to be able to programmatically initialize the query when opening the transform modal, and, I guess, get a callback with the applied query when the user clicks "Transform" in the modal. I like to open up the API for this!
We have to think through what API we want exactly. Some first thoughts:
query
.query
and onQuery
. Or maybe we should introduce hooks like onTransformOpen
and onTransformClose
, allowing to get and set the query and all other state.
This control is exactly what I was looking for... with one exception:
Is it possible to expose the JavaScript query that is generated in the transform modal? Likewise, is it possible to populate the transform modal with an existing query?