@wizim-dev/rich-editor2
v0.0.2
Published
## Project setup ``` npm install ```
Readme
snark-rich-editor2
Project setup
npm installTest implementation of the lib.
npm run serveCompiles the lib and minifies for production
npm run buildUsage Rich Content Editor
<rich-content-editor v-model="value" :options="options"/>Options are
{
videoFinder: {
loader: () => Promise<Array<VideoFinderFileRef>>,
urlResolver: (ref: VideoFinderFileRef) => string|null
}
}- videoFinder
- loader is a function to retrieve videoref
- urlResolver is a function returning public url from a videoref.
VideoFinderFileRef
export type VideoFinderFileRef = {
id: string;
name: string;
path: string;
}Usage Rich Content View
<rich-content-view :content="value" :options="options"/>content is the rich content provided by editor :
{
blocks: [
{
id: "xxx",
name: "type of the block (simple-text|rich-text|image|video-finder)"
// other data depending of blocks.
}
[,...]
]
}Options are
{
video: {
urlResolver: (ref: VideoFinderFileRef) => string|null
}
}urlResolver is the same function provided to editor.
