diff --git a/src/components/editor/Editor.d.ts b/src/components/editor/Editor.d.ts index 97fda2e10f..a473cfcaf5 100644 --- a/src/components/editor/Editor.d.ts +++ b/src/components/editor/Editor.d.ts @@ -1,15 +1,16 @@ import * as React from 'react'; interface EditorProps { - id?: string, - value?: string, - style?: object, - className?: string, - placeholder?: string, - readonly?: boolean, - formats?: any[], + id?: string; + value?: string; + style?: object; + className?: string; + placeholder?: string; + readonly?: boolean; + modules?: any; + formats?: any[]; headerTemplate?: JSX.Element | undefined, - onTextChange?(e: { htmlValue: string|null, textValue: string, delta: any, source: string }): void, + onTextChange?(e: { htmlValue: string|null, textValue: string, delta: any, source: string }): void; onSelectionChange?(e: { range: any, oldRange: any, source: string }): void; } diff --git a/src/components/editor/Editor.js b/src/components/editor/Editor.js index bb1e24bb27..cf44f864e9 100644 --- a/src/components/editor/Editor.js +++ b/src/components/editor/Editor.js @@ -14,6 +14,7 @@ export class Editor extends Component { className: null, placeholder: null, readOnly: false, + modules: null, formats: null, headerTemplate: null, onTextChange: null, @@ -27,6 +28,7 @@ export class Editor extends Component { className: PropTypes.string, placeholder: PropTypes.string, readOnly: PropTypes.bool, + modules: PropTypes.object, formats: PropTypes.array, headerTemplate: PropTypes.any, onTextChange: PropTypes.func, @@ -36,7 +38,8 @@ export class Editor extends Component { componentDidMount() { this.quill = new Quill(this.editorElement, { modules: { - toolbar: this.toolbarElement + toolbar: this.toolbarElement, + ...this.props.modules }, placeholder: this.props.placeholder, readOnly: this.props.readOnly, diff --git a/src/showcase/editor/EditorDemo.js b/src/showcase/editor/EditorDemo.js index 43841dfa2e..377d70fbc0 100644 --- a/src/showcase/editor/EditorDemo.js +++ b/src/showcase/editor/EditorDemo.js @@ -153,6 +153,12 @@ const header = ( false Whether to instantiate the editor to read-only mode. + + modules + object + null + Modules configuration, see here for available options. + formats string[]