@ckeditor/ckeditor5-autosave 29.0.0 → 31.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.md +1 -1
- package/build/autosave.js +1 -1
- package/build/translations/af.js +1 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/az.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de-ch.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/en-gb.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/km.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/ku.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ne.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sl.js +1 -0
- package/build/translations/sq.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/ug.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +11 -0
- package/package.json +12 -9
- package/src/autosave.js +28 -31
- package/CHANGELOG.md +0 -107
- package/build/autosave.js.map +0 -1
package/LICENSE.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Software License Agreement
|
2
2
|
==========================
|
3
3
|
|
4
|
-
**
|
4
|
+
**CKEditor 5 autosave feature** – https://github.com/ckeditor/ckeditor5-autosave <br>
|
5
5
|
Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
|
6
6
|
|
7
7
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
package/build/autosave.js
CHANGED
@@ -2,4 +2,4 @@
|
|
2
2
|
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md.
|
4
4
|
*/
|
5
|
-
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
|
5
|
+
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Saving changes":"Saving changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),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 K}));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()},d=/\s/;var l=function(t){for(var e=t.length;e--&&d.test(t.charAt(e)););return e},f=/^\s+/;var h=function(t){return t?t.slice(0,l(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 T=function(t){return"symbol"==typeof t||S(t)&&"[object Symbol]"==O(t)},x=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,E=/^0o[0-7]+$/i,P=parseInt;var N=function(t){if("number"==typeof t)return t;if(T(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||E.test(t)?P(t.slice(2),n?2:8):x.test(t)?NaN:+t},C=Math.max,M=Math.min;var D=function(t,e,n){var i,r,s,a,u,d,l=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,l=e,a=t.apply(o,n)}function g(t){return l=t,u=setTimeout(m,e),f?p(t):a}function b(t){var n=t-d;return void 0===d||n>=e||n<0||h&&t-l>=s}function m(){var t=c();if(b(t))return y(t);u=setTimeout(m,function(t){var n=e-(t-d);return h?M(n,s-(t-l)):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,d=t,n){if(void 0===u)return g(d);if(h)return clearTimeout(u),u=setTimeout(m,e),p(d)}return void 0===u&&(u=setTimeout(m,e)),a}return e=N(e)||0,o(n)&&(f=!!n.leading,s=(h="maxWait"in n)?C(N(n.maxWait)||0,e):s,v="trailing"in n?!!n.trailing:v),_.cancel=function(){void 0!==u&&clearTimeout(u),l=0,i=d=r=u=void 0},_.flush=function(){return void 0===u?a:y(c())},_};class K 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=D(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(t,"ready",()=>{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()}save(){this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,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)(K,r.ObservableMixin)}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.af=n.af||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Veranderinge word gestoor"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ar=n.ar||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"جاري حفظ التعديلات"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.az=i.az||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Dəyişikliklər saxlanılır"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.cs=n.cs||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Ukládání změn"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.da=n.da||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Gemmer ændringer"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const e=n["de-ch"]=n["de-ch"]||{};e.dictionary=Object.assign(e.dictionary||{},{"Saving changes":"Änderungen werden gespeichert"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const e=n.de=n.de||{};e.dictionary=Object.assign(e.dictionary||{},{"Saving changes":"Änderungen werden gespeichert"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n["en-au"]=n["en-au"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Saving changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n["en-gb"]=n["en-gb"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Saving changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.es=n.es||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Guardando cambios"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.et=n.et||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Muudatuste salvestamine"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.fa=n.fa||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"ذخیره سازی تغییرات"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.fi=n.fi||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Tallennetaan muutoksia"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.fr=i.fr||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Enregistrement des modifications"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.gl=n.gl||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Gardando os cambios"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.he=n.he||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"שומר שינויים"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.hi=i.hi||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Saving changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.hr=n.hr||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Snimanje promjena"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.hu=n.hu||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Módosítások mentése"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.id=n.id||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Menyimpan perubahan"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.it=i.it||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Salvataggio modifiche"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ja=n.ja||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"変更を保存中"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.km=n.km||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"កំពុងរក្សាទុកការផ្លាស់ប្ដូរ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ko=n.ko||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"변경된 내용을 저장하고 있습니다"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ku=n.ku||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"گۆڕانکاریەکان پاشکەوتدەکرێت"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.lt=i.lt||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Pakeitimai saugomi"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.lv=i.lv||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Saglabāju izmaiņas"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ne=n.ne||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"परिवर्तनहरू बचत हुदैछ"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.nl=n.nl||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Wijzigingen worden opgeslagen"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.no=n.no||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Lagrer endringer"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.pl=i.pl||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Zapisywanie zmian"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const a=n["pt-br"]=n["pt-br"]||{};a.dictionary=Object.assign(a.dictionary||{},{"Saving changes":"Salvando alterações"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.ro=i.ro||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Se salvează modificările"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ru=n.ru||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Сохранение изменений"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.sk=n.sk||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Ukladám zmeny"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.sl=n.sl||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Shrani spremembe"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.sq=n.sq||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Duke ruajtur ndryshimet"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n["sr-latn"]=n["sr-latn"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Sačuvaj izmene"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.sr=n.sr||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Сачувај измене"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.sv=n.sv||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Sparar ändringar"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.th=n.th||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"บันทึกการเปลี่ยนแปลง<br>"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.tk=i.tk||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Üýtgeşmeleri saklaň"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.tr=i.tr||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Değişiklikler Kaydediliyor"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.ug=n.ug||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"ئۆزگەرتىشلەرنى ساقلاش"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.uk=n.uk||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"Збереження змін"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(i){const n=i.vi=i.vi||{};n.dictionary=Object.assign(n.dictionary||{},{"Saving changes":"Đang lưu"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n["zh-cn"]=n["zh-cn"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"正在保存更改"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(n){const i=n.zh=n.zh||{};i.dictionary=Object.assign(i.dictionary||{},{"Saving changes":"正在儲存變更"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"plugins": [
|
3
|
+
{
|
4
|
+
"name": "Autosave",
|
5
|
+
"className": "Autosave",
|
6
|
+
"description": "Allows you to automatically save the data (e.g. send it to the server) when needed, for example, when the user changed the content.",
|
7
|
+
"docs": "builds/guides/integration/saving-data.html#autosave-feature",
|
8
|
+
"path": "src/autosave.js"
|
9
|
+
}
|
10
|
+
]
|
11
|
+
}
|
package/package.json
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-autosave",
|
3
|
-
"version": "
|
3
|
+
"version": "31.0.0",
|
4
4
|
"description": "Autosave feature for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
7
7
|
"ckeditor5",
|
8
8
|
"ckeditor 5",
|
9
9
|
"ckeditor5-feature",
|
10
|
-
"ckeditor5-plugin"
|
10
|
+
"ckeditor5-plugin",
|
11
|
+
"ckeditor5-dll"
|
11
12
|
],
|
12
13
|
"main": "src/index.js",
|
13
14
|
"dependencies": {
|
14
|
-
"ckeditor5": "^
|
15
|
+
"ckeditor5": "^31.0.0",
|
15
16
|
"lodash-es": "^4.17.15"
|
16
17
|
},
|
17
18
|
"devDependencies": {
|
18
|
-
"@ckeditor/ckeditor5-core": "^
|
19
|
-
"@ckeditor/ckeditor5-dev-utils": "^25.
|
20
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
21
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
22
|
-
"@ckeditor/ckeditor5-
|
19
|
+
"@ckeditor/ckeditor5-core": "^31.0.0",
|
20
|
+
"@ckeditor/ckeditor5-dev-utils": "^25.4.0",
|
21
|
+
"@ckeditor/ckeditor5-editor-classic": "^31.0.0",
|
22
|
+
"@ckeditor/ckeditor5-paragraph": "^31.0.0",
|
23
|
+
"@ckeditor/ckeditor5-source-editing": "^31.0.0",
|
24
|
+
"@ckeditor/ckeditor5-theme-lark": "^31.0.0",
|
23
25
|
"webpack": "^4.43.0",
|
24
26
|
"webpack-cli": "^3.3.11"
|
25
27
|
},
|
@@ -40,7 +42,8 @@
|
|
40
42
|
"lang",
|
41
43
|
"src",
|
42
44
|
"theme",
|
43
|
-
"build"
|
45
|
+
"build",
|
46
|
+
"ckeditor5-metadata.json"
|
44
47
|
],
|
45
48
|
"scripts": {
|
46
49
|
"dll:build": "webpack"
|
package/src/autosave.js
CHANGED
@@ -102,7 +102,7 @@ export default class Autosave extends Plugin {
|
|
102
102
|
this._debouncedSave = debounce( this._save.bind( this ), waitingTime );
|
103
103
|
|
104
104
|
/**
|
105
|
-
* The last document version.
|
105
|
+
* The last saved document version.
|
106
106
|
*
|
107
107
|
* @private
|
108
108
|
* @type {Number}
|
@@ -150,25 +150,28 @@ export default class Autosave extends Plugin {
|
|
150
150
|
|
151
151
|
this._pendingActions = editor.plugins.get( PendingActions );
|
152
152
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
153
|
+
// Add the listener only after the editor is initialized to prevent firing save callback on data init.
|
154
|
+
this.listenTo( editor, 'ready', () => {
|
155
|
+
this.listenTo( doc, 'change:data', () => {
|
156
|
+
if ( !this._saveCallbacks.length ) {
|
157
|
+
return;
|
158
|
+
}
|
157
159
|
|
158
|
-
|
159
|
-
|
160
|
-
|
160
|
+
if ( this.state == 'synchronized' ) {
|
161
|
+
this._action = this._pendingActions.add( t( 'Saving changes' ) );
|
162
|
+
this.state = 'waiting';
|
161
163
|
|
162
|
-
|
163
|
-
|
164
|
+
this._debouncedSave();
|
165
|
+
}
|
164
166
|
|
165
|
-
|
166
|
-
|
167
|
-
|
167
|
+
else if ( this.state == 'waiting' ) {
|
168
|
+
this._debouncedSave();
|
169
|
+
}
|
168
170
|
|
169
|
-
|
170
|
-
|
171
|
-
|
171
|
+
// If the plugin is in `saving` state, it will change its state later basing on the `document.version`.
|
172
|
+
// If the `document.version` will be higher than stored `#_lastDocumentVersion`, then it means, that some `change:data`
|
173
|
+
// event has fired in the meantime.
|
174
|
+
} );
|
172
175
|
} );
|
173
176
|
|
174
177
|
// Flush on the editor's destroy listener with the highest priority to ensure that
|
@@ -196,6 +199,14 @@ export default class Autosave extends Plugin {
|
|
196
199
|
super.destroy();
|
197
200
|
}
|
198
201
|
|
202
|
+
/**
|
203
|
+
* Calls autosave plugin callback and cancels any delayed callbacks that may have been already triggered.
|
204
|
+
*/
|
205
|
+
save() {
|
206
|
+
this._debouncedSave.cancel();
|
207
|
+
this._save();
|
208
|
+
}
|
209
|
+
|
199
210
|
/**
|
200
211
|
* Invokes the remaining `_save()` method call.
|
201
212
|
*
|
@@ -213,22 +224,8 @@ export default class Autosave extends Plugin {
|
|
213
224
|
* @private
|
214
225
|
*/
|
215
226
|
_save() {
|
216
|
-
const version = this.editor.model.document.version;
|
217
|
-
|
218
|
-
// Change may not produce an operation, so the document's version
|
219
|
-
// can be the same after that change.
|
220
|
-
if (
|
221
|
-
version < this._lastDocumentVersion ||
|
222
|
-
this.editor.state === 'initializing'
|
223
|
-
) {
|
224
|
-
this._debouncedSave.cancel();
|
225
|
-
|
226
|
-
return;
|
227
|
-
}
|
228
|
-
|
229
|
-
this._lastDocumentVersion = version;
|
230
|
-
|
231
227
|
this.state = 'saving';
|
228
|
+
this._lastDocumentVersion = this.editor.model.document.version;
|
232
229
|
|
233
230
|
// Wait one promise cycle to be sure that save callbacks are not called
|
234
231
|
// inside a conversion or when the editor's state changes.
|
package/CHANGELOG.md
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
Changelog
|
2
|
-
=========
|
3
|
-
|
4
|
-
All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
|
5
|
-
|
6
|
-
Changes for the past releases are available below.
|
7
|
-
|
8
|
-
## [19.0.0](https://github.com/ckeditor/ckeditor5-autosave/compare/v18.0.0...v19.0.0) (2020-04-29)
|
9
|
-
|
10
|
-
Internal changes only (updated dependencies, documentation, etc.).
|
11
|
-
|
12
|
-
|
13
|
-
## [18.0.0](https://github.com/ckeditor/ckeditor5-autosave/compare/v17.0.0...v18.0.0) (2020-03-19)
|
14
|
-
|
15
|
-
Internal changes only (updated dependencies, documentation, etc.).
|
16
|
-
|
17
|
-
|
18
|
-
## [17.0.0](https://github.com/ckeditor/ckeditor5-autosave/compare/v16.0.0...v17.0.0) (2020-02-18)
|
19
|
-
|
20
|
-
### Other changes
|
21
|
-
|
22
|
-
* Updated translations. ([d0042f4](https://github.com/ckeditor/ckeditor5-autosave/commit/d0042f4))
|
23
|
-
|
24
|
-
|
25
|
-
## [16.0.0](https://github.com/ckeditor/ckeditor5-autosave/compare/v15.0.0...v16.0.0) (2019-12-04)
|
26
|
-
|
27
|
-
### Other changes
|
28
|
-
|
29
|
-
* Updated translations. ([b99249d](https://github.com/ckeditor/ckeditor5-autosave/commit/b99249d))
|
30
|
-
|
31
|
-
|
32
|
-
## [15.0.0](https://github.com/ckeditor/ckeditor5-autosave/compare/v11.0.5...v15.0.0) (2019-10-23)
|
33
|
-
|
34
|
-
### Features
|
35
|
-
|
36
|
-
* Provided error handling for save actions. Closes [ckeditor/ckeditor5#1546](https://github.com/ckeditor/ckeditor5/issues/1546). ([d6079bf](https://github.com/ckeditor/ckeditor5-autosave/commit/d6079bf))
|
37
|
-
|
38
|
-
### Other changes
|
39
|
-
|
40
|
-
* Updated translations. ([115bf18](https://github.com/ckeditor/ckeditor5-autosave/commit/115bf18))
|
41
|
-
|
42
|
-
|
43
|
-
## [11.0.5](https://github.com/ckeditor/ckeditor5-autosave/compare/v11.0.4...v11.0.5) (2019-08-26)
|
44
|
-
|
45
|
-
### Other changes
|
46
|
-
|
47
|
-
* The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([0072e70](https://github.com/ckeditor/ckeditor5-autosave/commit/0072e70))
|
48
|
-
* Updated translations. ([2de7f77](https://github.com/ckeditor/ckeditor5-autosave/commit/2de7f77))
|
49
|
-
|
50
|
-
|
51
|
-
## [11.0.4](https://github.com/ckeditor/ckeditor5-autosave/compare/v11.0.3...v11.0.4) (2019-07-10)
|
52
|
-
|
53
|
-
Internal changes only (updated dependencies, documentation, etc.).
|
54
|
-
|
55
|
-
|
56
|
-
## [11.0.3](https://github.com/ckeditor/ckeditor5-autosave/compare/v11.0.2...v11.0.3) (2019-07-04)
|
57
|
-
|
58
|
-
### Other changes
|
59
|
-
|
60
|
-
* Updated translations. ([28230c2](https://github.com/ckeditor/ckeditor5-autosave/commit/28230c2)) ([3a16129](https://github.com/ckeditor/ckeditor5-autosave/commit/3a16129))
|
61
|
-
|
62
|
-
|
63
|
-
## [11.0.2](https://github.com/ckeditor/ckeditor5-autosave/compare/v11.0.1...v11.0.2) (2019-06-05)
|
64
|
-
|
65
|
-
### Other changes
|
66
|
-
|
67
|
-
* Updated translations. ([5541f00](https://github.com/ckeditor/ckeditor5-autosave/commit/5541f00))
|
68
|
-
|
69
|
-
|
70
|
-
## [11.0.1](https://github.com/ckeditor/ckeditor5-autosave/compare/v11.0.0...v11.0.1) (2019-04-10)
|
71
|
-
|
72
|
-
### Other changes
|
73
|
-
|
74
|
-
* Updated translations. ([e38aed3](https://github.com/ckeditor/ckeditor5-autosave/commit/e38aed3))
|
75
|
-
|
76
|
-
|
77
|
-
## [11.0.0](https://github.com/ckeditor/ckeditor5-autosave/compare/v10.0.2...v11.0.0) (2019-02-28)
|
78
|
-
|
79
|
-
### Other changes
|
80
|
-
|
81
|
-
* Updated translations. ([436d064](https://github.com/ckeditor/ckeditor5-autosave/commit/436d064)) ([b24b0aa](https://github.com/ckeditor/ckeditor5-autosave/commit/b24b0aa))
|
82
|
-
|
83
|
-
### BREAKING CHANGES
|
84
|
-
|
85
|
-
* Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c))
|
86
|
-
|
87
|
-
|
88
|
-
## [10.0.2](https://github.com/ckeditor/ckeditor5-autosave/compare/v10.0.1...v10.0.2) (2018-12-05)
|
89
|
-
|
90
|
-
### Other changes
|
91
|
-
|
92
|
-
* Updated translations. ([5a423f6](https://github.com/ckeditor/ckeditor5-autosave/commit/5a423f6)) ([c5bb743](https://github.com/ckeditor/ckeditor5-autosave/commit/c5bb743))
|
93
|
-
|
94
|
-
|
95
|
-
## [10.0.1](https://github.com/ckeditor/ckeditor5-autosave/compare/v10.0.0...v10.0.1) (2018-10-08)
|
96
|
-
|
97
|
-
### Other changes
|
98
|
-
|
99
|
-
* Improved heuristics for triggering the save callback. It will not be called before the previous save attempt completed. It will be called less often in when the user is in the middle of making changes. Closes [#9](https://github.com/ckeditor/ckeditor5-autosave/issues/9). Closes [#10](https://github.com/ckeditor/ckeditor5-autosave/issues/10). Closes [#12](https://github.com/ckeditor/ckeditor5-autosave/issues/12). Closes [ckeditor/ckeditor5#1158](https://github.com/ckeditor/ckeditor5/issues/1158). ([820e060](https://github.com/ckeditor/ckeditor5-autosave/commit/820e060))
|
100
|
-
* Updated translations. ([3f52ebc](https://github.com/ckeditor/ckeditor5-autosave/commit/3f52ebc)) ([8c702ee](https://github.com/ckeditor/ckeditor5-autosave/commit/8c702ee))
|
101
|
-
|
102
|
-
|
103
|
-
## [10.0.0](https://github.com/ckeditor/ckeditor5-autosave/tree/v10.0.0) (2018-07-18)
|
104
|
-
|
105
|
-
### Other changes
|
106
|
-
|
107
|
-
* The first implementation of the autosave plugin. Check out the [demo](https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/saving-data.html#autosave-feature).
|