react-quill
Advanced tools
Comparing version 1.3.1 to 1.3.2
Changelog | ||
========= | ||
v1.3.1 | ||
------ | ||
- Add back default export (#374, #384 one19) | ||
v1.3.0 | ||
@@ -5,0 +10,0 @@ ------ |
@@ -37,2 +37,3 @@ 'use strict'; | ||
onKeyUp: T.func, | ||
preserveWhitespace: T.bool, | ||
@@ -335,2 +336,3 @@ modules: function(props) { | ||
var children = this.props.children; | ||
var preserveWhitespace = this.props.preserveWhitespace; | ||
@@ -346,6 +348,6 @@ var properties = { | ||
: null; | ||
var defaultElement = preserveWhitespace ? DOM.pre : DOM.div; | ||
var editingArea = customElement | ||
? React.cloneElement(customElement, properties) | ||
: DOM.div(properties); | ||
: defaultElement(properties); | ||
@@ -352,0 +354,0 @@ return editingArea; |
@@ -48,4 +48,11 @@ 'use strict'; | ||
editor.on('text-change', this.handleTextChange); | ||
editor.on('selection-change', this.handleSelectionChange); | ||
editor.on('editor-change', function(eventType, rangeOrDelta, oldRangeOrOldDelta, source) { | ||
if (eventType === Quill.events.SELECTION_CHANGE) { | ||
this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source); | ||
} | ||
if (eventType === Quill.events.TEXT_CHANGE) { | ||
this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source); | ||
} | ||
}.bind(this)); | ||
}, | ||
@@ -52,0 +59,0 @@ |
{ | ||
"name": "react-quill", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "The Quill rich-text editor as a React component.", | ||
@@ -5,0 +5,0 @@ "author": "zenoamaro <zenoamaro@gmail.com>", |
@@ -151,5 +151,11 @@ React-Quill [![Build Status](https://travis-ci.org/zenoamaro/react-quill.svg?branch=master)](https://travis-ci.org/zenoamaro/react-quill) [![npm](https://img.shields.io/npm/v/react-quill.svg)](https://www.npmjs.com/package/react-quill) | ||
```jsx | ||
var MyComponent = React.createClass({ | ||
class MyComponent extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
text: "", | ||
} | ||
} | ||
modules: { | ||
modules = { | ||
toolbar: [ | ||
@@ -164,3 +170,3 @@ [{ 'header': [1, 2, false] }], | ||
formats: [ | ||
formats = [ | ||
'header', | ||
@@ -172,3 +178,3 @@ 'bold', 'italic', 'underline', 'strike', 'blockquote', | ||
render: function() { | ||
render() { | ||
return ( | ||
@@ -182,5 +188,6 @@ <div className="text-editor"> | ||
); | ||
}, | ||
} | ||
} | ||
}); | ||
export default MyComponent; | ||
``` | ||
@@ -622,2 +629,5 @@ | ||
`preserveWhitespace` | ||
: If true, a `pre` tag is used for the editor area instead of the default `div` tag. This prevents Quill from | ||
collapsing continuous whitespaces on paste. [Related issue](https://github.com/quilljs/quill/issues/1751). | ||
@@ -703,3 +713,3 @@ ### Methods | ||
During events, ReactQuill will make a restricted subset of the Quill API available as the `editor` argument. This prevents access to destructive methods, which might case ReactQuill to get out-of-sync with the component. It provides the following methods, which are mostly proxies of existing [Quill methods](https://quilljs.com/docs/api/): | ||
During events, ReactQuill will make a restricted subset of the Quill API available as the `editor` argument. This prevents access to destructive methods, which might cause ReactQuill to get out-of-sync with the component. It provides the following methods, which are mostly proxies of existing [Quill methods](https://quilljs.com/docs/api/): | ||
@@ -706,0 +716,0 @@ `getLength()` |
@@ -25,2 +25,3 @@ import * as React from "react"; | ||
bounds?: string | HTMLElement; | ||
scrollingContainer?: string | HTMLElement; | ||
onChange?: ( | ||
@@ -27,0 +28,0 @@ content: string, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3398419
19849
831