Editor FAQ
约 1 分钟阅读
标签:FAQ
- Block 之间的 virtual 位置
- EditContext API
- w3c/edit-contextGitHubw3c/edit-context
- caniuse.com/mdn-api_editcontext
- Chrome 121+
yjs vs automerge
- yjs/yjsGitHubyjs/yjsyjs/yjs · Shared data types for building collaborative software · Providers · y-webrtc · y-websocket · y-indexeddb · y-libp2p笔记:yjs
- 构建协作富文本编辑器
- automerge/automergeGitHubautomerge/automergeMIT, JS, Rust, WASM · 2.3 MB, 865.9kB · 参考 · Binary Document Format · - · Rust -> WASM · @automerge/automerge-repo-storage-indexeddb笔记:automerge
- 通用状态合并
- 参考
- yjs vs automerge #145GitHub Issueyjs/yjs#145
Lexical vs TiptapV2 vs DraftJS vs SlateJS
- lexical -
- reconcile dom
- 体积小
- 借鉴 Draft, Slate, ProseMirror 实现
- 默认支持 Markdown
- 基础体验比 tiptap 好
- TextNode 支持 format、style - 在 tiptap 里需要很多 extension
- 不够成熟
- 部分功能欠缺 - draggable block
- 社区生态
- tiptap - starter-kit
+ 80kB @tiptap/react (@popperjs/core,tippy.js)
- 基于 prosemirror
- 生态好
- 基础体积大
- 更加 low level - 基础格式语义也要通过 Extension 实现
- schema 可扩展
- tiptap v1 vue -> tiptap v2 + binding
- React 体验弱于 lexical
- 可能需要和 prosemirror 打交道
- 学习曲线高
- 依赖大量 Extension
- 基于 prosemirror
- SlateJS -
- 开发不活跃
- 原生 React
- DraftJS -
- Web 早期 - contentEditable 跨浏览器不好,很多额外处理
- React 早期 - 对 React 18+ 不友好 - 性能差
- ImmutableJS didn't scale well
处理从 MS Word 粘贴的问题
- 读取 text/rtf,解析内容,转换
osascript -e 'the clipboard as record' | less- codex-team/editor.js#729GitHub Issuecodex-team/editor.js#729
Modeline
# vim: ts=2 sw=2 etFrontmatter
---
title: abc
---- jekyllrb.com/docs/front-matter
- gohugo.io/content-management/front-matter
- docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs
- jonschlinkert/gray-matterGitHubjonschlinkert/gray-matter
PromseMirror vs Slate
- PromseMirror
- DOM 优先
- 有 Schema
- 光标使用 整数 绝对定位
- 支持更复杂的选区
- Slate
- React 优先
- 无 Schema
- 光标 path+offset
关联信息
反向链接、本文链接的其他页面和外部资料。
反向链接
- 编辑器笔记 · FAQ
基于 Web 的编辑器分为几个层次 · 增强 textarea - 例如 mention · 基于 contentEditbale - 富文本编辑器 - WYSIWYG - 所见即所得 · 直接实现编辑功能 · core+render · Block Editor
参考资料
GitHub7 条
- automerge/automergegithub.com/automerge/automerge
- codex-team/editor.js#729github.com/codex-team/editor.js/issues/729
- facebook/lexical/discussions/5219github.com/facebook/lexical/discussions/5219
- jonschlinkert/gray-mattergithub.com/jonschlinkert/gray-matter
- w3c/edit-contextgithub.com/w3c/edit-context
- yjs/yjsgithub.com/yjs/yjs
- yjs/yjs#145github.com/yjs/yjs/issues/145
其他外链11 条
- badgen.net/bundlephobia/min/@tiptap/starter-kitbadgen.net/bundlephobia/min/@tiptap/starter-kit
- badgen.net/bundlephobia/min/draft-jsbadgen.net/bundlephobia/min/draft-js
- badgen.net/bundlephobia/min/lexicalbadgen.net/bundlephobia/min/lexical
- badgen.net/bundlephobia/min/slatebadgen.net/bundlephobia/min/slate
- caniuse.com/mdn-api_editcontextcaniuse.com/mdn-api_editcontext
- curvenote.github.io/prosemirror-codemarkcurvenote.github.io/prosemirror-codemark
- docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docsdocusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs
- gohugo.io/content-management/front-mattergohugo.io/content-management/front-matter
- jekyllrb.com/docs/front-matterjekyllrb.com/docs/front-matter
- twitter.com/nikitonsky/status/1649093609151684608twitter.com/nikitonsky/status/1649093609151684608
- vim.wikia.com/wiki/Modeline_magicvim.wikia.com/wiki/Modeline_magic