All Projects → margox → Braft Editor

margox / Braft Editor

Licence: mit
美观易用的React富文本编辑器,基于draft-js开发

Programming Languages

javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
HTML
75241 projects

Projects that are alternatives of or similar to Braft Editor

typester
✒️ A WYSIWYG that gives you predictable and clean HTML
Stars: ✭ 29 (-99.33%)
Mutual labels:  wysiwyg, rich-text-editor, wysiwyg-js-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 (-77.22%)
Mutual labels:  rich-text-editor, draft-js, wysiwyg
Trumbowyg
A lightweight and amazing WYSIWYG JavaScript editor under 10kB
Stars: ✭ 3,664 (-14.99%)
Mutual labels:  rich-text-editor, wysiwyg
rich input
Rich input box, implement @Someone and subject with color highlighting
Stars: ✭ 58 (-98.65%)
Mutual labels:  rich-text-editor, rich
textbus
Textbus 是一个组件化的、数据驱动的富文本框架,支持在线协同编辑,同时也可以作为一个开箱即用的富文本编辑器,拥有非常好的扩展性和可定制性,是构建复杂富文本的不二之选!
Stars: ✭ 642 (-85.1%)
Mutual labels:  wysiwyg, rich-text-editor
Text
📑 Collaborative document editing using Markdown
Stars: ✭ 282 (-93.46%)
Mutual labels:  rich-text-editor, wysiwyg
am-editor
A rich text collaborative editor framework that can use React and Vue custom plug-ins. 一个富文本实时协同编辑器框架,可以使用React和Vue自定义插件。
Stars: ✭ 542 (-87.42%)
Mutual labels:  wysiwyg, rich-text-editor
Django Front
Django-front is a front-end editing Django application
Stars: ✭ 257 (-94.04%)
Mutual labels:  rich-text-editor, wysiwyg
bangle.dev
Collection of higher level rich text editing tools. It powers the local only note taking app https://bangle.io
Stars: ✭ 541 (-87.45%)
Mutual labels:  wysiwyg, rich-text-editor
draftjs-conductor
📝✨ Little Draft.js helpers to make rich text editors “just work”
Stars: ✭ 39 (-99.1%)
Mutual labels:  wysiwyg, draft-js
rtexteditorview
A simple WYSIWYG editor for Android
Stars: ✭ 51 (-98.82%)
Mutual labels:  wysiwyg, rich-text-editor
Awesome Web Editor
🔨 Open source WEB editor summary
Stars: ✭ 306 (-92.9%)
Mutual labels:  rich-text-editor, wysiwyg
Craft.js
🚀 A React Framework for building extensible drag and drop page editors
Stars: ✭ 4,512 (+4.69%)
Mutual labels:  draft-js, wysiwyg
draftjs-filters
Filter Draft.js content to preserve only the formatting you allow
Stars: ✭ 53 (-98.77%)
Mutual labels:  wysiwyg, draft-js
wysiwyg-editor-php-sdk
PHP SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 37 (-99.14%)
Mutual labels:  wysiwyg, rich-text-editor
cazary
jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language.
Stars: ✭ 12 (-99.72%)
Mutual labels:  wysiwyg, rich-text-editor
wysiwyg-editor-dotnet-sdk
.NET SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 23 (-99.47%)
Mutual labels:  wysiwyg, rich-text-editor
iOS-HTMLTextEditor
A simple implementation of an HTML Editor using CKEditor in a web view.
Stars: ✭ 57 (-98.68%)
Mutual labels:  wysiwyg, rich-text-editor
wysihtml5-rails
A wysiwyg text editor for use in the Rails asset pipeline
Stars: ✭ 28 (-99.35%)
Mutual labels:  wysiwyg, rich-text-editor
Re Editor
一个开箱即用的React富文本编辑器 🚀re-editor
Stars: ✭ 367 (-91.48%)
Mutual labels:  rich-text-editor, wysiwyg

Braft Editor-EN

Thanks to Google Translate

A web rich text editor based on draft-js, suitable for React framework, compatible with mainstream modern browsers.

Use Document Online Demo

Note that the current version of the project is 2.x. If you are using 1.xx version, please refer to [Old Version Document](https://github.com/margox/braft-editor/blob/old-master/README. md)

Please understand before using

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.

Editor-specific extension packs have been released, please see Braft Extensions

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

Features

  • Perfect text content editing function
  • Many open editing interfaces, good scalability
  • Allows inserting multimedia content such as pictures, audio and video
  • Allows to customize the upload interface of multimedia content
  • Allow to set the image to float left and right (ie text wrapping function)
  • Allows setting the color list, font size, and fonts available to the editor
  • Allows customizing the control buttons and display order to be displayed
  • Allows adding additional custom buttons
  • Multi-language support (Simplified Chinese, Traditional Chinese, English, Polish, Japanese, Korean, Turkish)
  • ... More features under development

Thanks

Recent updates

  • 2019-08-06 v2.3.8
    • Fixed the issue that javascript statements in a tag href caused a warning
    • Merge PR # 560, # 593 , # 588, # 582
  • 2019-06-20 v2.3.7
    • Fix issues # 542, # 541 , # 467
    • Fix the problem # 512 and add the imageResizable attribute, which allows to turn off the drag and resize function of the image
  • 2019-06-18 v2.3.6
    • Supports inserting links without selecting text
    • Added allowInsertLinkText property, allowing link text to be entered when inserting a link directly, default false
  • 2019-06-14 v2.3.5
    • Perfect index.d.ts
  • 2019-06-11 v2.3.4
    • Support the retention of some more custom html attributes (need to upgrade craft-convert to v2.3.0)
    • Added Korean (kr), Japanese (jpn), Turkish (tr)
    • Add more hooks support
  • 2019-05-28 v2.3.2
    • Fixed the issue that incoming RAW strings could not be parsed normally
  • 2019-05-20 v2.3.1
    • Fixed fatal bug in v2.3.0
  • 2019-05-20 v2.3.0
  • 2019-04-29 v2.2.10
    • The picture supports dragging and resizing. Thanks to ArthasDragon for your contribution!
    • Optimized the use of pure numbers to initialize the editor's content. Thank you WzFFzW for your contribution!
    • Added fixPlaceholder attribute (Boolean), which is used to fix the problem that placeholder text is displayed abnormally in some cases. The default is false.
    • Optimize forceRender
  • 2019-03-06 v2.2.9
    • Modify index.d.ts
  • 2019-02-22 v2.2.7
    • Added boilerplate CSS files for beautifying output HTML(node_modules/braft-editor/dist/output.css)
  • 2019-02-22 v2.2.6
    • Optimize the blockRenerMap property and support passing in a function that returns a blockRenerMap object
    • Optimize the settings of subscript style
    • Optimize the display of text indentation and text alignment in the editor when colleagues are present
  • 2019-01-11 v2.2.4
    • Added the editorId property, which has the same effect as the id property, and is used to solve the problem that the id property will be overwritten in the Ant Design Form component and the extension module cannot be used normally
  • 2019-01-11 v2.2.2
    • Optimized the playback interaction between audio and video and embedded media, instead playing in the modal box
  • 2019-01-06 v2.2.1
  • 2018-12-29 v2.2.0

View history update record

installation

# Install using yarn
yarn add braft-editor
# Install using npm
npm install braft-editor --save

use

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>
    )

  }

}

Of course, this editor also supports the defaultValue property, so you can also use this editor as a uncontrolled component.

For more introduction, please see Detailed Document

Buy me a beer

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!

  

    支付宝           WeChat

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].