react-ckeditor-wrapper
Advanced tools
Comparing version 1.0.5 to 1.0.6
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -30,30 +30,40 @@ | ||
var CKEditor = function (_Component) { | ||
(0, _inherits3["default"])(CKEditor, _Component); | ||
(0, _inherits3["default"])(CKEditor, _Component); | ||
function CKEditor(props) { | ||
(0, _classCallCheck3["default"])(this, CKEditor); | ||
return (0, _possibleConstructorReturn3["default"])(this, _Component.call(this)); | ||
} | ||
function CKEditor(props) { | ||
(0, _classCallCheck3["default"])(this, CKEditor); | ||
CKEditor.prototype.componentDidMount = function componentDidMount() { | ||
if (!CKEDITOR) { | ||
console.error('CKEditor not found'); | ||
return; | ||
} | ||
CKEDITOR.appendTo(_reactDom2["default"].findDOMNode(this)); | ||
}; | ||
var _this = (0, _possibleConstructorReturn3["default"])(this, _Component.call(this, props)); | ||
CKEditor.prototype.render = function render() { | ||
return _react2["default"].createElement( | ||
'div', | ||
null, | ||
_react2["default"].createElement( | ||
'h1', | ||
null, | ||
'Hello World!' | ||
) | ||
); | ||
}; | ||
_this.state = { | ||
value: _this.props.value, | ||
config: _this.props.config || {}, | ||
onChange: _this.props.onChange | ||
}; | ||
return _this; | ||
} | ||
return CKEditor; | ||
CKEditor.prototype.handleChange = function handleChange(value) { | ||
console.log(value); | ||
this.state.onChange(value); | ||
}; | ||
CKEditor.prototype.componentDidMount = function componentDidMount() { | ||
var _this2 = this; | ||
if (!window.CKEDITOR) { | ||
console.error('CKEditor not found'); | ||
return; | ||
} | ||
var instance = window.CKEDITOR.appendTo(_reactDom2["default"].findDOMNode(this), this.state.config, this.state.value); | ||
instance.on('change', function () { | ||
_this2.handleChange(instance.getData()); | ||
}); | ||
}; | ||
CKEditor.prototype.render = function render() { | ||
return _react2["default"].createElement('div', null); | ||
}; | ||
return CKEditor; | ||
}(_react.Component); | ||
@@ -60,0 +70,0 @@ |
{ | ||
"name": "react-ckeditor-wrapper", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "CKEditor wrapper for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
5237
56