All Projects → wowlusitong → Re Editor

wowlusitong / Re Editor

Licence: mit
一个开箱即用的React富文本编辑器 🚀re-editor

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Re Editor

Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+191.83%)
Mutual labels:  slate, editor, rich-text-editor, wysiwyg, wysiwyg-editor
Angular Editor
A simple native WYSIWYG editor component for Angular 6 -10+
Stars: ✭ 428 (+16.62%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Megadraft
Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility
Stars: ✭ 982 (+167.57%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Jodit
Jodit - Best WYSIWYG Editor for You
Stars: ✭ 947 (+158.04%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Awesome Web Editor
🔨 Open source WEB editor summary
Stars: ✭ 306 (-16.62%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Awesome Wysiwyg
A curated list of awesome WYSIWYG editors.
Stars: ✭ 1,801 (+390.74%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Text
📑 Collaborative document editing using Markdown
Stars: ✭ 282 (-23.16%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Pell
📝 the simplest and smallest WYSIWYG text editor for web, with no dependencies
Stars: ✭ 11,653 (+3075.2%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Flutter Quill
Rich text editor for Flutter
Stars: ✭ 177 (-51.77%)
Mutual labels:  editor, rich-text-editor, wysiwyg, wysiwyg-editor
Slate Plugins
🔌 Next-gen slate plugins
Stars: ✭ 399 (+8.72%)
Mutual labels:  slate, rich-text-editor, wysiwyg, wysiwyg-editor
wysiwyg-editor-dotnet-sdk
.NET SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 23 (-93.73%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
textbus
Textbus 是一个组件化的、数据驱动的富文本框架,支持在线协同编辑,同时也可以作为一个开箱即用的富文本编辑器,拥有非常好的扩展性和可定制性,是构建复杂富文本的不二之选!
Stars: ✭ 642 (+74.93%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
Slate Edit Table
Slate plugin for table edition
Stars: ✭ 97 (-73.57%)
Mutual labels:  slate, rich-text-editor, wysiwyg
typester
✒️ A WYSIWYG that gives you predictable and clean HTML
Stars: ✭ 29 (-92.1%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
wysiwyg-editor-python-sdk
Python SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 20 (-94.55%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
ngx-wall
Helps build content editor for note-taking application
Stars: ✭ 78 (-78.75%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
wysihtml5-rails
A wysiwyg text editor for use in the Rails asset pipeline
Stars: ✭ 28 (-92.37%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
wysiwyg-editor-php-sdk
PHP SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 37 (-89.92%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-editor
Slate Edit Code
A Slate plugin for code block editing
Stars: ✭ 44 (-88.01%)
Mutual labels:  slate, rich-text-editor, wysiwyg
svelte-slate
slate svelte view layer
Stars: ✭ 43 (-88.28%)
Mutual labels:  wysiwyg, slate, wysiwyg-editor

re-editor · Netlify Status CircleCI npm GitHub license code style: prettier

一个开箱即用的React富文本编辑器 🚀

image

特点

  • 开箱即用,无需配置
  • 定制化,可自行开发任意风格和形式的工具条 [API补全中]
  • 支持元素功能设置,例如修改图片大小
  • 支持markdown语法
  • 查看更多

使用方法

编辑器为适应不同开发需求,提供下面两种使用方法

开箱即用

re-editor是一个封装好的组件, 安装就可以使用, 它里面包含 @re-editor/core@re-editor/toolbar-antd, 工具条默认使用antd风格,如果要使用其他工具条请参考下面自定义文档

安装依赖

$ npm install re-editor

引入样式

在js里面引入

import 're-editor/lib/styles/index.css'

也可以在css里面引入(需要css预处理支持)

@import 're-editor/lib/styles/index.css'

props

属性 说明 类型
value 编辑器的值 object
onChange 编辑器更改内容的回调 (value: Value) => void
placeholder 占位文本 string
readOnly 只读模式 boolean
onImageUpload 自定义图床 (file: File) => Promise<url: string>
tools 设置工具栏的显示内容 Array<Array

设置工具栏显示内容

tools props支持数组形式,如果是二维数组会分组显示

tools={['bold', 'italic', 'underline', 'strikethrough']}
// 或者
tools={[
  ['bold', 'italic', 'underline', 'strikethrough'],
  ['orderedlist', 'unorderedlist']
]}
名称 功能
bold 粗体
italic 斜体
underline 下划线
strikethrough 删除线
orderedlist 有序列表
unorderedlist 无序列表
heading 标题
align 对齐方式
image 图片
table 表格
code 代码
undo 撤销
redo 重做
fullscreen 全屏

自定义

编辑器拆分为两个部分,内容编辑区域 和 工具条,下面介绍如何自定义工具条

安装编辑器核心

$ npm install @re-editor/core

创建工具条

可以用任何方式创建编辑器工具条,需要将编辑器的实例传给工具条,可参考 re-editor@re-editor/toolbar-antd的实现,详情查看API文档(这部分文档还没写完,会在近期补全😂)

例如实现一个加粗功能:

import { command } from '@re-editor/core';

const Demo = (props) => {
  function handleClick() {
    command(props.editor)('bold')
  }
  return <div onClick={handleClick}>bold</div>
}

packages介绍

  • re-editor: 一个封装好的,包含工具条的编辑器
  • @re-editor/core: 编辑器核心
  • @re-editor/toolbar-antd: 基于antd制作的工具条,默认
  • @re-editor/examples: 演示项目

FAQ

和slate或draft-js对比有什么区别?

slate或draft并不是一个纯编辑器,它们更像是一个用于构建编辑器的框架,re-editor是基于slate开发,让你不必关注构建编辑器的过程。

怎么修改样式

样式分为两部分,node(粗体、h1、h2等)和工具栏,它们都可以通过css重写基础样式,工具栏也可以做到完全重写 样式可以通过css自定义

每次保存数据量太大怎么办?

使用增量更新,onChange回调的value是 immutable格式,可以使用immutable-js-diff等方法获取diff的内容进行增量更新

如何指定上传图片服务器

图片默认保存为base64,如果需要将图片上传到指定服务器,可使用onImageUpload函数, (file: File) => Promise<url: string> 示例代码

功能

文字装饰

粗体 斜体 下划线 删除线 上标 下标

列表

有序列表 无序列表

对齐方式

左对齐 右对齐 居中对齐 两端对齐

标题

h1 h2 h3 h4 h5 h6

其他

  • 图片
    • 设置大小
    • 从剪贴板复制
    • 支持自定义上传图片服务器地址
  • 表格
    • 增加行
    • 增加列
    • 删除行
    • 删除列
  • 代码高亮
    • js
    • css
    • html
  • markdown
    • h1-h6: #
    • 引用: >
    • 有序列表: -
    • 无序列表: 1.
  • 全屏编辑

其他功能持续增加中...

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].