'use strict'; var React = require('react'); var ReactDOM = require('react-dom'); var createClass = require('create-react-class'); var QuillMixin = require('./mixin'); var find = require('lodash/find'); var some = require('lodash/some'); var isEqual = require('lodash/isEqual'); var T = require('prop-types'); var DOM = require('react-dom-factories'); var QuillComponent = createClass({ displayName: 'Quill', mixins: [ QuillMixin ], propTypes: { id: T.string, className: T.string, theme: T.string, style: T.object, readOnly: T.bool, value: T.oneOfType([T.string, T.shape({ops: T.array})]), defaultValue: T.oneOfType([T.string, T.shape({ops: T.array})]), placeholder: T.string, tabIndex: T.number, bounds: T.oneOfType([T.string, T.element]), onChange: T.func, onChangeSelection: T.func, onFocus: T.func, onBlur: T.func, onKeyPress: T.func, onKeyDown: T.func, onKeyUp: T.func, preserveWhitespace: T.bool, modules: function(props) { var isNotObject = T.object.apply(this, arguments); if (isNotObject) return isNotObject; if ( props.modules && props.modules.toolbar && props.modules.toolbar[0] && props.modules.toolbar[0].type ) return new Error( 'Since v1.0.0, React Quill will not create a custom toolbar for you ' + 'anymore. Create a toolbar explictly, or let Quill create one. ' + 'See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100' ); }, toolbar: function(props) { if ('toolbar' in props) return new Error( 'The `toolbar` prop has been deprecated. Use `modules.toolbar` instead. ' + 'See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100' ); }, formats: function(props) { var isNotArrayOfString = T.arrayOf(T.string).apply(this, arguments); if (isNotArrayOfString) return new Error( 'You cannot specify custom `formats` anymore. Use Parchment instead. ' + 'See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100.' ); }, styles: function(props) { if ('styles' in props) return new Error( 'The `styles` prop has been deprecated. Use custom stylesheets instead. ' + 'See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100.' ); }, pollInterval: function(props) { if ('pollInterval' in props) return new Error( 'The `pollInterval` property does not have any effect anymore. ' + 'You can safely remove it from your props.' + 'See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100.' ); }, children: function(props) { // Validate that the editor has only one child element and it is not a