josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
816 stars 108 forks source link

Add an instance to a window on the site #346

Closed AlexRMU closed 6 months ago

AlexRMU commented 7 months ago

Add the editor instance and all package exports to the window object so that they can be used from the console on the site

josdejong commented 7 months ago

Ah, that wouldn't be hard to do. I suppose you're referring to https://jsoneditoronline.org ?

This makes me curious: what kind of things are you currently missing that you would like to do via the developer console?

AlexRMU commented 7 months ago

You also need to write about this in the site docs

AlexRMU commented 7 months ago
josdejong commented 7 months ago

Thanks for the clarification.

  1. Note that you can change JSON (sorting, filtering, etc) in the Transform modal too, using JavaScript + Lodash. I understand though that using the developer console may give more freedom (I'm a developer myself 😅 ). afbeelding
  2. So which API do you want to use directly via JS exactly? Most features are configurable via Options > Editor configuration and Configure JSON Schema.
AlexRMU commented 7 months ago
  1. Instance methods, utility functions, functions, what will appear in the future. Maybe someone will come in handy.
josdejong commented 7 months ago

I like your ideas. More generally: we can expose all stuff in the developer console that is useful to work with JSON data.

Things that cross my mind:

AlexRMU commented 7 months ago

Yes, it will be cool

josdejong commented 6 months ago

I think you'll like the latest version of https://jsoneditoronline.org (v6.14.0), it has exposed all the mentioned libraries and the two editors in the Developer Console. If you open the Developer Console you'll find detailed information.