/canvas-editor

canvas-editor 是一个基于 canvas/svg 的富文本编辑器,类似 word。其具有以下特点: 所见即所得:类word可分页,所见即所得 轻量的数据结构:一段JSON即可呈现复杂样式 丰富的功能:支持常见富文本操作、表格、水印、控件、公式等 使用方便:官方发布核心npm包,菜单栏、工具栏可自行维护 灵活的开发机制:通过接口可获取生命周期、事件回调、自定义右键菜单、快捷键等 完全类型化的API:灵活的 API 和完整的 TypeScript 类型

Primary LanguageTypeScriptMIT LicenseMIT

canvas-editor

a rich text editor by canvas/svg

tips

  1. docs
  2. The render layer by svg is under development, see feature/svg
  3. The export pdf feature is available now, see feature/pdf

usage

npm i @hufe921/canvas-editor --save
<div class="canvas-editor"></div>
import Editor from "@hufe921/canvas-editor"

new Editor(document.querySelector(".canvas-editor"), [
    {
      value: "Hello World"
    }
  ])

next features

  1. improve list and title
  2. improve performance
  3. control rules
  4. table paging
  5. CRDT

snapshot

image

install

yarn

dev

npm run dev

build

app

npm run build

lib

npm run lib