Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Slate | 27,915 | 3,499 | 1,092 | 7 days ago | 720 | May 09, 2023 | 613 | mit | TypeScript | |
A completely customizable framework for building rich text editors. (Currently in beta.) | ||||||||||
Tiptap | 21,315 | 278 | 3 days ago | 24 | July 17, 2023 | 326 | mit | TypeScript | ||
The headless editor framework for web artisans. | ||||||||||
Awesome Lowcode | 12,226 | a month ago | 4 | cc0-1.0 | ||||||
国内低代码平台从业者交流 | ||||||||||
Oni | 11,477 | 3 | 4 years ago | 6 | April 02, 2017 | 518 | mit | TypeScript | ||
Oni: Modern Modal Editing - powered by Neovim | ||||||||||
Tinacms | 9,345 | 5 | 93 | 3 days ago | 197 | August 01, 2023 | 58 | apache-2.0 | TypeScript | |
A fully open-source headless CMS that supports Git and Visual Editing | ||||||||||
React Page | 9,269 | 23 | 2 months ago | 315 | April 26, 2023 | 12 | mit | TypeScript | ||
Next-gen, highly customizable content editor for the browser - based on React and written in TypeScript. WYSIWYG on steroids. | ||||||||||
H5 Dooring | 7,298 | 7 months ago | 29 | gpl-3.0 | JavaScript | |||||
H5 Page Maker, H5 Editor, LowCode. Make H5 as easy as building blocks. | 让H5制作像搭积木一样简单, 轻松搭建H5页面, H5网站, PC端网站,LowCode平台. | ||||||||||
Vditor | 6,789 | 11 | 46 | 6 days ago | 316 | June 20, 2023 | 80 | mit | TypeScript | |
♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes. | ||||||||||
React Data Grid | 6,276 | 441 | 256 | 15 hours ago | 1,034 | August 01, 2023 | 157 | other | TypeScript | |
Feature-rich and customizable data grid React component | ||||||||||
Craft.js | 6,207 | 35 | a day ago | 74 | June 30, 2023 | 177 | mit | TypeScript | ||
🚀 A React Framework for building extensible drag and drop page editors |
Thanks to Google Translate
Braft Editor is an editor based on draft-js. Draft-js does not directly use HTML as the component state. It implements an EditorState type, which is essentially a JS object. In the traditional rich text editor, The piece of HTML content corresponding to EditorState is a block; this can be verified by looking at editorState.toRAW ().
The advantage of using EditorState instead of HTML strings is that a set of EditorState can be used on multiple ends, and the content produced by the editor is no longer limited to being displayed on the web platform (of course, each platform also needs to implement the corresponding EditorState to View conversion function) At the same time, it is more suitable for the component state of React.
However, in the above implementation, the biggest problem is that it cannot perfectly convert external HTML into EditorState, because its supported styles, tags, tag attributes, and so on are extremely limited, and there is no way to convert all the features in HTML to the state in EditorState. , When using third-party or historical HTML strings to initialize the editor content, and when pasting external HTML content, only a small number of styles and tag attributes supported by the editor can be retained, most of the content will be filtered or Ignore it.
Based on the above shortcomings, if your project strongly depends on the original HTML tags and attributes, etc., this editor is not recommended.
The form extension module has been released in a test version. Please upgrade craft-editor and craft-utils to the latest version and install the latest version of craft-extensions. For the usage, please see [form extension module]
Exchange feedback, please add QQ group: 725634541
allowInsertLinkText
property, allowing link text to be entered when inserting a link directly, defaultfalse
node_modules/braft-editor/dist/output.css
)# Install using yarn
yarn add braft-editor
# Install using npm
npm install braft-editor --save
The editor supports value and onChange properties, which are similar to the native input components in React. In general, you can use this editor in the form of a typical controlled component:
import React from 'react'
import BraftEditor from 'braft-editor'
import 'braft-editor/dist/index.css'
export default class EditorDemo extends React.Component {
state = {
editorState: null
}
async componentDidMount () {
// Assume here to get the editor content in html format from the server
const htmlContent = await fetchEditorContent()
// Use BraftEditor.createEditorState to convert html strings to editorState data needed by the editor
this.setState({
editorState: BraftEditor.createEditorState(htmlContent)
})
}
submitContent = async () => {
// Pressing ctrl + s when the editor has focus will execute this method
// Before the editor content is submitted to the server, you can directly call editorState.toHTML () to get the HTML content
const htmlContent = this.state.editorState.toHTML()
const result = await saveEditorContent(htmlContent)
}
handleEditorChange = (editorState) => {
this.setState({ editorState })
}
render () {
const { editorState } = this.state
return (
<div className="my-component">
<BraftEditor
value={editorState}
onChange={this.handleEditorChange}
onSave={this.submitContent}
/>
</div>
)
}
}
If you want to thank this editor for saving time for your project, or simply like this editor, you can scan the code and appreciate a few dollars to invite me for a beer!