You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sveditorjs can be embed into any svelte or sveltekit project,the editor is wraped around editorjs ,for block editing that outputs clean json document.json can be consumed by any app.
on version we added support for sveltekit
and added a utility helper
that generates html
<script>
import Editor ,{genHtml} from "$lib/index.js";
let modes = {'js': 'JavaScript','py': 'Python','go': 'Go','cpp': 'C++','cs': 'C#','md': 'Markdown',}
let data = {}; //correct editorjs json data
let urls = {} //this object should be
//{upload:"",load:"",}asyncfunctionhandleChange(ev){console.log(ev.detail)leteditor=ev.detail.editor;editor.save().then(async(savedData)=>{// do something with dataconsole.log(window.current_sveditor);// use helper to gen htmllethtml=awaitgenHtml(savedData);console.log(html);}).catch((err)=>{console.log(err)})}</script><Editordata={data}urls={urls}modes={modes}top="carview.php?tsp=true"aside="carview.php?tsp=true"on:editor_ready={(ev)=>{console.log("ready",ev.detail)}}on:editor_change={(ev)=>{handleChange(ev)}}><svelte:fragmentslot="top">
top
</svelte:fragment><svelte:fragmentslot="aside">
aside
</svelte:fragment><svelte:fragmentslot="extra">
extra unstyled
</svelte:fragment></Editor>