@ckeditor/ckeditor5-autosave
Advanced tools
Comparing version 28.0.0 to 29.0.0
@@ -5,2 +5,2 @@ /*! | ||
*/ | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.autosave=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){t.exports=n(2)("./src/core.js")},function(t,e,n){t.exports=n(2)("./src/utils.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var i=n(0),r=n(1);var o=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},s=n(3),a="object"==typeof self&&self&&self.Object===Object&&self,u=s.a||a||Function("return this")(),c=function(){return u.Date.now()},l=/\s/;var d=function(t){for(var e=t.length;e--&&l.test(t.charAt(e)););return e},f=/^\s+/;var h=function(t){return t?t.slice(0,d(t)+1).replace(f,""):t},v=u.Symbol,p=Object.prototype,g=p.hasOwnProperty,b=p.toString,m=v?v.toStringTag:void 0;var y=function(t){var e=g.call(t,m),n=t[m];try{t[m]=void 0;var i=!0}catch(t){}var r=b.call(t);return i&&(e?t[m]=n:delete t[m]),r},_=Object.prototype.toString;var j=function(t){return _.call(t)},w=v?v.toStringTag:void 0;var O=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":w&&w in Object(t)?y(t):j(t)};var S=function(t){return null!=t&&"object"==typeof t};var x=function(t){return"symbol"==typeof t||S(t)&&"[object Symbol]"==O(t)},T=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,P=/^0o[0-7]+$/i,E=parseInt;var M=function(t){if("number"==typeof t)return t;if(x(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=h(t);var n=A.test(t);return n||P.test(t)?E(t.slice(2),n?2:8):T.test(t)?NaN:+t},C=Math.max,D=Math.min;var N=function(t,e,n){var i,r,s,a,u,l,d=0,f=!1,h=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=i,o=r;return i=r=void 0,d=e,a=t.apply(o,n)}function g(t){return d=t,u=setTimeout(m,e),f?p(t):a}function b(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-d>=s}function m(){var t=c();if(b(t))return y(t);u=setTimeout(m,function(t){var n=e-(t-l);return h?D(n,s-(t-d)):n}(t))}function y(t){return u=void 0,v&&i?p(t):(i=r=void 0,a)}function _(){var t=c(),n=b(t);if(i=arguments,r=this,l=t,n){if(void 0===u)return g(l);if(h)return clearTimeout(u),u=setTimeout(m,e),p(l)}return void 0===u&&(u=setTimeout(m,e)),a}return e=M(e)||0,o(n)&&(f=!!n.leading,s=(h="maxWait"in n)?C(M(n.maxWait)||0,e):s,v="trailing"in n?!!n.trailing:v),_.cancel=function(){void 0!==u&&clearTimeout(u),d=0,i=l=r=u=void 0},_.flush=function(){return void 0===u?a:y(c())},_};class V extends i.Plugin{static get pluginName(){return"Autosave"}static get requires(){return[i.PendingActions]}constructor(t){super(t);const e=t.config.get("autosave")||{},n=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=N(this._save.bind(this),n),this._lastDocumentVersion=t.model.document.version,this._domEmitter=Object.create(r.DomEmitterMixin),this._config=e}init(){const t=this.editor,e=t.model.document,n=t.t;this._pendingActions=t.plugins.get(i.PendingActions),this.listenTo(e,"change:data",()=>{this._saveCallbacks.length&&("synchronized"==this.state?(this._action=this._pendingActions.add(n("Saving changes")),this.state="waiting",this._debouncedSave()):"waiting"==this.state&&this._debouncedSave())}),this.listenTo(t,"destroy",()=>this._flush(),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",(t,e)=>{this._pendingActions.hasAny&&(e.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}_flush(){this._debouncedSave.flush()}_save(){const t=this.editor.model.document.version;t<this._lastDocumentVersion||"initializing"===this.editor.state?this._debouncedSave.cancel():(this._lastDocumentVersion=t,this.state="saving",Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(t=>t(this.editor)))).catch(t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t}).then(()=>{this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}Object(r.mix)(V,r.ObservableMixin);e.default={Autosave:V}}]).default; | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.autosave=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){t.exports=n(2)("./src/core.js")},function(t,e,n){t.exports=n(2)("./src/utils.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(4))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"Autosave",(function(){return V}));var i=n(0),r=n(1);var o=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},s=n(3),a="object"==typeof self&&self&&self.Object===Object&&self,u=s.a||a||Function("return this")(),c=function(){return u.Date.now()},l=/\s/;var d=function(t){for(var e=t.length;e--&&l.test(t.charAt(e)););return e},f=/^\s+/;var h=function(t){return t?t.slice(0,d(t)+1).replace(f,""):t},v=u.Symbol,p=Object.prototype,g=p.hasOwnProperty,b=p.toString,m=v?v.toStringTag:void 0;var y=function(t){var e=g.call(t,m),n=t[m];try{t[m]=void 0;var i=!0}catch(t){}var r=b.call(t);return i&&(e?t[m]=n:delete t[m]),r},_=Object.prototype.toString;var j=function(t){return _.call(t)},w=v?v.toStringTag:void 0;var O=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":w&&w in Object(t)?y(t):j(t)};var S=function(t){return null!=t&&"object"==typeof t};var x=function(t){return"symbol"==typeof t||S(t)&&"[object Symbol]"==O(t)},T=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,P=/^0o[0-7]+$/i,E=parseInt;var M=function(t){if("number"==typeof t)return t;if(x(t))return NaN;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=h(t);var n=A.test(t);return n||P.test(t)?E(t.slice(2),n?2:8):T.test(t)?NaN:+t},C=Math.max,D=Math.min;var N=function(t,e,n){var i,r,s,a,u,l,d=0,f=!1,h=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=i,o=r;return i=r=void 0,d=e,a=t.apply(o,n)}function g(t){return d=t,u=setTimeout(m,e),f?p(t):a}function b(t){var n=t-l;return void 0===l||n>=e||n<0||h&&t-d>=s}function m(){var t=c();if(b(t))return y(t);u=setTimeout(m,function(t){var n=e-(t-l);return h?D(n,s-(t-d)):n}(t))}function y(t){return u=void 0,v&&i?p(t):(i=r=void 0,a)}function _(){var t=c(),n=b(t);if(i=arguments,r=this,l=t,n){if(void 0===u)return g(l);if(h)return clearTimeout(u),u=setTimeout(m,e),p(l)}return void 0===u&&(u=setTimeout(m,e)),a}return e=M(e)||0,o(n)&&(f=!!n.leading,s=(h="maxWait"in n)?C(M(n.maxWait)||0,e):s,v="trailing"in n?!!n.trailing:v),_.cancel=function(){void 0!==u&&clearTimeout(u),d=0,i=l=r=u=void 0},_.flush=function(){return void 0===u?a:y(c())},_};class V extends i.Plugin{static get pluginName(){return"Autosave"}static get requires(){return[i.PendingActions]}constructor(t){super(t);const e=t.config.get("autosave")||{},n=e.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=N(this._save.bind(this),n),this._lastDocumentVersion=t.model.document.version,this._domEmitter=Object.create(r.DomEmitterMixin),this._config=e}init(){const t=this.editor,e=t.model.document,n=t.t;this._pendingActions=t.plugins.get(i.PendingActions),this.listenTo(e,"change:data",()=>{this._saveCallbacks.length&&("synchronized"==this.state?(this._action=this._pendingActions.add(n("Saving changes")),this.state="waiting",this._debouncedSave()):"waiting"==this.state&&this._debouncedSave())}),this.listenTo(t,"destroy",()=>this._flush(),{priority:"highest"}),this._domEmitter.listenTo(window,"beforeunload",(t,e)=>{this._pendingActions.hasAny&&(e.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}_flush(){this._debouncedSave.flush()}_save(){const t=this.editor.model.document.version;t<this._lastDocumentVersion||"initializing"===this.editor.state?this._debouncedSave.cancel():(this._lastDocumentVersion=t,this.state="saving",Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(t=>t(this.editor)))).catch(t=>{throw this.state="error",this.state="saving",this._debouncedSave(),t}).then(()=>{this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}))}get _saveCallbacks(){const t=[];return this.adapter&&this.adapter.save&&t.push(this.adapter.save),this._config.save&&t.push(this._config.save),t}}Object(r.mix)(V,r.ObservableMixin)}]); |
{ | ||
"name": "@ckeditor/ckeditor5-autosave", | ||
"version": "28.0.0", | ||
"version": "29.0.0", | ||
"description": "Autosave feature for CKEditor 5.", | ||
@@ -14,11 +14,11 @@ "keywords": [ | ||
"dependencies": { | ||
"ckeditor5": "^28.0.0", | ||
"ckeditor5": "^29.0.0", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-core": "^28.0.0", | ||
"@ckeditor/ckeditor5-core": "^29.0.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^25.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^28.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^28.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^28.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^29.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^29.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^29.0.0", | ||
"webpack": "^4.43.0", | ||
@@ -25,0 +25,0 @@ "webpack-cli": "^3.3.11" |
@@ -5,4 +5,4 @@ CKEditor 5 autosave feature | ||
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-autosave.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-autosave) | ||
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-autosave/status.svg)](https://david-dm.org/ckeditor/ckeditor5-autosave) | ||
[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-autosave/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-autosave?type=dev) | ||
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master) | ||
[![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5) | ||
@@ -9,0 +9,0 @@ This package implements the autosave feature for CKEditor 5. |
@@ -29,3 +29,3 @@ /** | ||
* image: { | ||
* toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ], | ||
* toolbar: [ 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ], | ||
* }, | ||
@@ -32,0 +32,0 @@ * autosave: { |
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
997112
58
7
+ Added@ckeditor/ckeditor5-clipboard@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-core@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-engine@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-enter@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-paragraph@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-select-all@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-typing@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-ui@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-undo@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-upload@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-utils@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-widget@29.2.0(transitive)
+ Addedckeditor5@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-clipboard@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-core@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-engine@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-enter@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-paragraph@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-select-all@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-typing@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-ui@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-undo@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-upload@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-utils@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-widget@28.0.0(transitive)
- Removedckeditor5@28.0.0(transitive)
Updatedckeditor5@^29.0.0