@ckeditor/ckeditor5-react
Advanced tools
Comparing version 2.0.0 to 2.1.0
Changelog | ||
========= | ||
## [2.1.0](https://github.com/ckeditor/ckeditor5-react/compare/v2.0.0...v2.1.0) (2020-01-16) | ||
### Features | ||
* Introduced support for `onError` callback that is being called if an error occurred during the editor's initialization. Closes [#123](https://github.com/ckeditor/ckeditor5-react/issues/123). ([becf9f7](https://github.com/ckeditor/ckeditor5-react/commit/becf9f7)) | ||
Thanks to [@ansorensen](https://github.com/ansorensen). | ||
## [2.0.0](https://github.com/ckeditor/ckeditor5-react/compare/v1.1.3...v2.0.0) (2019-11-22) | ||
@@ -5,0 +14,0 @@ |
/*! | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.CKEditor=t(require("react")):e.CKEditor=t(e.React)}(window,function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){e.exports=n(3)()},function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return a});var o=n(1),r=n.n(o),i=n(0),s=n.n(i);class a extends r.a.Component{constructor(e){super(e),this.editor=null,this.domContainer=r.a.createRef()}shouldComponentUpdate(e){return!!this.editor&&(this._shouldUpdateContent(e)&&this.editor.setData(e.data),"disabled"in e&&(this.editor.isReadOnly=e.disabled),!1)}componentDidMount(){this._initializeEditor()}componentWillUnmount(){this._destroyEditor()}render(){return r.a.createElement("div",{ref:this.domContainer,dangerouslySetInnerHTML:{__html:this.props.data||""}})}_initializeEditor(){this.props.editor.create(this.domContainer.current,this.props.config).then(e=>{this.editor=e,"disabled"in this.props&&(e.isReadOnly=this.props.disabled),this.props.onInit&&this.props.onInit(e);const t=e.model.document,n=e.editing.view.document;t.on("change:data",t=>{this.props.onChange&&this.props.onChange(t,e)}),n.on("focus",t=>{this.props.onFocus&&this.props.onFocus(t,e)}),n.on("blur",t=>{this.props.onBlur&&this.props.onBlur(t,e)})}).catch(e=>{console.error(e)})}_destroyEditor(){this.editor&&this.editor.destroy().then(()=>{this.editor=null})}_shouldUpdateContent(e){return this.props.data!==e.data&&this.editor.getData()!==e.data}}a.propTypes={editor:s.a.func.isRequired,data:s.a.string,config:s.a.object,onChange:s.a.func,onInit:s.a.func,onFocus:s.a.func,onBlur:s.a.func,disabled:s.a.bool},a.defaultProps={config:{}}},function(e,t,n){"use strict";var o=n(4);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}]).default}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.CKEditor=t(require("react")):e.CKEditor=t(e.React)}(window,function(e){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t,o){e.exports=o(3)()},function(t,o){t.exports=e},function(e,t,o){"use strict";o.r(t),o.d(t,"default",function(){return a});var n=o(1),r=o.n(n),i=o(0),s=o.n(i);class a extends r.a.Component{constructor(e){super(e),this.editor=null,this.domContainer=r.a.createRef()}shouldComponentUpdate(e){return!!this.editor&&(this._shouldUpdateContent(e)&&this.editor.setData(e.data),"disabled"in e&&(this.editor.isReadOnly=e.disabled),!1)}componentDidMount(){this._initializeEditor()}componentWillUnmount(){this._destroyEditor()}render(){return r.a.createElement("div",{ref:this.domContainer,dangerouslySetInnerHTML:{__html:this.props.data||""}})}_initializeEditor(){this.props.editor.create(this.domContainer.current,this.props.config).then(e=>{this.editor=e,"disabled"in this.props&&(e.isReadOnly=this.props.disabled),this.props.onInit&&this.props.onInit(e);const t=e.model.document,o=e.editing.view.document;t.on("change:data",t=>{this.props.onChange&&this.props.onChange(t,e)}),o.on("focus",t=>{this.props.onFocus&&this.props.onFocus(t,e)}),o.on("blur",t=>{this.props.onBlur&&this.props.onBlur(t,e)})}).catch(e=>{(this.props.onError||console.error)(e)})}_destroyEditor(){this.editor&&this.editor.destroy().then(()=>{this.editor=null})}_shouldUpdateContent(e){return this.props.data!==e.data&&this.editor.getData()!==e.data}}a.propTypes={editor:s.a.func.isRequired,data:s.a.string,config:s.a.object,onChange:s.a.func,onInit:s.a.func,onFocus:s.a.func,onBlur:s.a.func,onError:s.a.func,disabled:s.a.bool},a.defaultProps={config:{}}},function(e,t,o){"use strict";var n=o(4);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,o,r,i,s){if(s!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return o.PropTypes=o,o}},function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}]).default}); | ||
//# sourceMappingURL=ckeditor.js.map |
@@ -5,3 +5,3 @@ Software License Agreement | ||
**CKEditor 5 component for React** – https://github.com/ckeditor/ckeditor5-react <br> | ||
Copyright (c) 2003-2019, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
Copyright (c) 2003-2020, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
@@ -8,0 +8,0 @@ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). |
{ | ||
"name": "@ckeditor/ckeditor5-react", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"main": "dist/ckeditor.js", | ||
@@ -5,0 +5,0 @@ "description": "Official React component for CKEditor 5 – the best browser-based rich text editor.", |
@@ -48,11 +48,4 @@ # CKEditor 5 rich text editor component for React | ||
* `--reporter` (`-r`) – Reporter for Karma (default: `mocha`, can be changed to `dots`). | ||
* `--browsers` (`-b`) – Browsers that will be used to run tests (default: `Chrome`, available: `Firefox`, `BrowserStack_Edge` and `BrowserStack_Safari`). | ||
* `--browsers` (`-b`) – Browsers that will be used to run tests (default: `Chrome`, available: `Firefox`). | ||
**Note:** If you would like to use the `BrowserStack_*` browser, you need to specify the `BROWSER_STACK_USERNAME` and `BROWSER_STACK_ACCESS_KEY` as | ||
an environment variable, e.g.: | ||
```bash | ||
BROWSER_STACK_USERNAME=[...] BROWSER_STACK_ACCESS_KEY=[...] npm t -- -b BrowserStack_Edge,BrowserStack_Safari -c | ||
``` | ||
### Building the package | ||
@@ -59,0 +52,0 @@ |
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
30864
93