1.0.0 • Published 2 years ago

elementary-editor v1.0.0

Weekly downloads
45
License
MIT
Repository
-
Last release
2 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

2 years ago

1.0.0

2 years ago

0.9.99

2 years ago

0.9.51

2 years ago

0.9.40

2 years ago

0.9.34

2 years ago

0.9.35

2 years ago

0.9.36

2 years ago

0.9.37

2 years ago

0.9.30

2 years ago

0.9.31

2 years ago

0.9.32

2 years ago

0.9.33

2 years ago

0.9.38

2 years ago

0.9.39

2 years ago

0.9.81

2 years ago

0.9.71

2 years ago

0.9.23

2 years ago

0.9.24

2 years ago

0.9.25

2 years ago

0.9.26

2 years ago

0.9.27

2 years ago

0.9.28

2 years ago

0.9.29

2 years ago

0.9.20

2 years ago

0.9.21

2 years ago

0.9.22

2 years ago

0.9.18

3 years ago

0.9.17

3 years ago

0.9.15

3 years ago

0.9.12

3 years ago

0.9.9

3 years ago

0.9.11

3 years ago

0.9.9-rc1

3 years ago

0.9.8

3 years ago

0.9.7

3 years ago

0.9.6

3 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

4 years ago

0.8.91

4 years ago

0.8.50

4 years ago

0.8.90

4 years ago

0.8.25

4 years ago

0.8.24

4 years ago

0.8.23

4 years ago

0.8.22

4 years ago

0.8.21

4 years ago

0.8.20

4 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

5 years ago

0.8.13

5 years ago

0.8.12

5 years ago

0.8.11

5 years ago

0.8.10

5 years ago

0.8.9

5 years ago

0.8.8

5 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

6 years ago

0.6.21

6 years ago

0.6.20

6 years ago

0.6.19

6 years ago

0.6.18

6 years ago

0.6.17

6 years ago

0.6.16

6 years ago

0.6.15

6 years ago

0.6.14

6 years ago

0.6.13

6 years ago

0.6.12

6 years ago

0.6.11

6 years ago

0.6.10

6 years ago

0.6.9

6 years ago

0.6.8

6 years ago

0.6.7

6 years ago

6.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.3

6 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