1.0.0 • Published 3 years ago

elementary-editor v1.0.0

Weekly downloads
45
License
MIT
Repository
-
Last release
3 years ago

Elementary Editor

A WYSWYG editor based on Draft

Build Status

codecov

Getting Started

Prerequisites

You will need:

Usage

To use this editor in your project:

  • Install the npm package:
 yarn add elementary-editor
  • Then use the editor inside your code

Using Classes

import Editor from 'elementary-editor';

class MyComponent extends Component  {

 constructor(props) {
   super(props);
   this.state = { editorState: null }
   this.containerRef = null;
 }

 render() {
   return(
   <Editor
     initialState={null}
     containerRef={(editor) => this.editor = editor}
   />
   );
 }

}

Using hooks

import React, { useRef } from 'react';
import Editor from 'elementary-editor';

const MyComponent = () =>  {

 const containerRef = useRef(null);

 return(
 <div>
   <Editor
     initialState={null}
     containerRef={containerRef}
   />
 </div>
  );
}

The ref property is needed if you want to access the editor's internal methods.

To use the default renderer that is bundled with the editor:

import { DefaultRenderer } from 'elementary-editor';

class MyComponent extends Component  {
 /*
 ...
 */
 render() {
  return(
  <div>
	<DefaultRenderer raw={rawText} />
  </div>
  );
 }

Here rawText is a javascript object that contains a valid Draft-JS raw state object.

The ref property is needed if you want to access the editor's internal methods.

API

Properties

Styles

Note: styles can be filtered by passing the style names to the filterStyles argument of the editor.

Methods

  • Internal editor methods.

Built With

  • React - A Javascript library for building user interfaces.
  • DraftJS - Rich text editor framework for React.
  • Ant.Design - A UI Design Language.

    Authors

  • Federico Caminiti - Maintainer

    License

    This project is licensed under the MIT License - see the LICENSE file for details

1.0.0-alpha

3 years ago

1.0.0

3 years ago

0.9.99

3 years ago

0.9.51

3 years ago

0.9.40

3 years ago

0.9.34

3 years ago

0.9.35

3 years ago

0.9.36

3 years ago

0.9.37

3 years ago

0.9.30

3 years ago

0.9.31

3 years ago

0.9.32

3 years ago

0.9.33

3 years ago

0.9.38

3 years ago

0.9.39

3 years ago

0.9.81

3 years ago

0.9.71

3 years ago

0.9.23

3 years ago

0.9.24

3 years ago

0.9.25

3 years ago

0.9.26

3 years ago

0.9.27

3 years ago

0.9.28

3 years ago

0.9.29

3 years ago

0.9.20

3 years ago

0.9.21

3 years ago

0.9.22

3 years ago

0.9.18

3 years ago

0.9.17

3 years ago

0.9.15

4 years ago

0.9.12

4 years ago

0.9.9

4 years ago

0.9.11

4 years ago

0.9.9-rc1

4 years ago

0.9.8

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago

0.9.4

4 years ago

0.9.5

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.8.5

4 years ago

0.9.0

4 years ago

0.8.55

5 years ago

0.8.91

5 years ago

0.8.50

5 years ago

0.8.90

5 years ago

0.8.25

5 years ago

0.8.24

5 years ago

0.8.23

5 years ago

0.8.22

5 years ago

0.8.21

5 years ago

0.8.20

5 years ago

0.8.19

5 years ago

0.8.17

5 years ago

0.8.16

5 years ago

0.8.15

5 years ago

0.8.14

6 years ago

0.8.13

6 years ago

0.8.12

6 years ago

0.8.11

6 years ago

0.8.10

6 years ago

0.8.9

6 years ago

0.8.8

6 years ago

0.8.7

6 years ago

0.8.6

6 years ago

0.8.4

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.0

7 years ago

0.6.21

7 years ago

0.6.20

7 years ago

0.6.19

7 years ago

0.6.18

7 years ago

0.6.17

7 years ago

0.6.16

7 years ago

0.6.15

7 years ago

0.6.14

7 years ago

0.6.13

7 years ago

0.6.12

7 years ago

0.6.11

7 years ago

0.6.10

7 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.7

7 years ago

6.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.3

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.9

7 years ago

0.4.8

7 years ago

0.4.7

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.0

7 years ago

0.1.7

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago