intro
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.
install
sveditorjs can be installed via .
npm install --save sveditorjs
//usage
import Editor from "sveditorjs";
//check out the events and slot tabs
// the editor will load editor to window object as current_sveditorjs
events
there are 2 events baked in . these custom events areeditor_ready
fired when the editor has been fully initialised. the ready event fires the ready state to true when success and to false if an error occures,and a ready initialised editorjs objecteditor_change
this event is fired on every change in the editor,it fires editorjs api object ,editor object and the event firedslots
slots are the ui building blocks for the editor which are optional,but very useful. slots available are :- >> top
>> aside
>> extra
customize
sveditorjs can be customized with css
- .editor-cont
- .editor-header
- .editor-aside
- #editorjs
- .extra-box
props
the editor exports some required props and optional ones
required props
- >data //editorjs json
- >urls //upload and load urls
- >modes //these are coding modes
optional props
- >top //type bolean true
- >aside //type bolean true