Go to file
hanshiyang 37e4e4cc6a docs: 将页面标题从英文改为中文
将页面标题从"canvas-editor"改为"在线编辑器",以提供更直观的中文界面显示
2025-11-20 14:41:07 +08:00
.vscode init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
cypress init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
docs init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
public feat(iframe): 添加通过URL参数filePath自动加载文件功能 2025-11-19 15:32:54 +08:00
scripts init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
src feat: 添加本地文件读取功能并优化构建脚本 2025-11-20 14:34:58 +08:00
.editorconfig init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
.eslintrc init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
.gitignore init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
.prettierrc init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
CHANGELOG.md init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
cypress.config.ts init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
demo.html feat: 添加部署脚本并简化iframe加载逻辑 2025-11-19 16:08:27 +08:00
favicon.png init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
LICENSE init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
package.json feat: 添加本地文件读取功能并优化构建脚本 2025-11-20 14:34:58 +08:00
pnpm-lock.yaml init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
pnpm-workspace.yaml init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
README.md init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
tsconfig.json init from https://github.com/Hufe921/canvas-editor 2025-09-23 10:43:28 +08:00
vite.config.ts build: 将基础路径从项目名称改为相对路径 2025-11-19 16:57:47 +08:00
vocd.html docs: 将页面标题从英文改为中文 2025-11-20 14:41:07 +08:00

canvas-editor

Version Cypress Passing GitHub Contributors License PRs

a rich text editor by canvas/svg

View Demo · View Docs · Report Bug · Request Feature · FAQ

Love the project? Please consider donating(赞助) to help it improve!

Tips

  1. Official plugin: canvas-editor-plugin
  2. The render layer by svg is under development, see feature/svg
  3. The export pdf feature is available now, see feature/pdf
  4. The AI-powered text processing demo, see feature/ai
  5. Table pagination #41 is under active development, see: poc/table-paging · demo

Basic usage

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

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

Features

  • Rich text operations (Undo, Redo, Font, Size, Bold, Italic, Underline, Strikeout, Superscript, Alignment, Title, List, ...)
  • Insert elements (Table, Image, Link, Code Block, Page Break, Math Formula, Date Picker, Block, ...)
  • Print (Based on canvas to picture, pdf drawing)
  • Controls (Select, Text, Date, Radio, Checkbox)
  • Contextmenu (Internal, Custom)
  • Shortcut keys (Internal, Custom)
  • Drag and Drop(Text, Element, Control)
  • Header, Footer, Page Number
  • Page Margin
  • Watermark
  • Pagination
  • Comment
  • Catalog

Roadmap

  1. Table paging
  2. Control rules
  3. Improve performance
  4. CRDT

Snapshot

image

Install

yarn

Dev

npm run dev

Build

app

npm run build

lib

npm run lib