@viveeditor/ext-image
v1.1.0
Published
Image extension for viveEditor with validated sources, safe uploads and alt-text checks.
Maintainers
Readme
@viveeditor/ext-image
Image extension for viveEditor with validated sources, safe uploads and alt-text checks.
Part of viveEditor, a free, open-source rich text editor.
Install
npm install @viveeditor/ext-image @viveeditor/coreUsage
import { Editor } from '@viveeditor/core'
import '@viveeditor/core/style.css'
import { Image } from '@viveeditor/ext-image'
import '@viveeditor/ext-image/style.css'
const editor = await Editor.create(document.querySelector('#editor'), {
extensions: [Image.configure({ upload })],
})upload(file, { signal, onProgress }) returns { src, width, height }. Addresses and file bytes are checked before they reach the document; your server must still re-validate uploads. See Images and uploads.
License
MIT
