josdejong / svelte-jsoneditor

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

feat: implement support for vanilla JS components in `onRenderValue` (WIP) #398

Closed josdejong closed 4 months ago

josdejong commented 5 months ago

Implements a solution for #375, this allows to use vanilla JS components in onRenderValue by defining a Svelte Action:

export interface MyComponentProps {
  // ...
}

export const MyComponent = Action<HTMLDivElement, MyComponentProps> = (node, props) => {
  // ...
  return {
    update: (props) => {
      // ...
    },
    destroy: () => {
      // ...
    }
  }
}

TODO:

josdejong commented 4 months ago

Published now in v0.21.5