@ckeditor/ckeditor5-word-count 29.1.0 → 31.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/build/translations/az.js +1 -0
  2. package/build/translations/cs.js +1 -0
  3. package/build/translations/da.js +1 -0
  4. package/build/translations/de-ch.js +1 -0
  5. package/build/translations/de.js +1 -0
  6. package/build/translations/en-au.js +1 -0
  7. package/build/translations/en-gb.js +1 -0
  8. package/build/translations/es.js +1 -0
  9. package/build/translations/et.js +1 -0
  10. package/build/translations/fa.js +1 -0
  11. package/build/translations/fi.js +1 -0
  12. package/build/translations/fr.js +1 -0
  13. package/build/translations/gl.js +1 -0
  14. package/build/translations/he.js +1 -0
  15. package/build/translations/hi.js +1 -0
  16. package/build/translations/hr.js +1 -0
  17. package/build/translations/hu.js +1 -0
  18. package/build/translations/id.js +1 -0
  19. package/build/translations/it.js +1 -0
  20. package/build/translations/ja.js +1 -0
  21. package/build/translations/ko.js +1 -0
  22. package/build/translations/ku.js +1 -0
  23. package/build/translations/lt.js +1 -0
  24. package/build/translations/lv.js +1 -0
  25. package/build/translations/ne.js +1 -0
  26. package/build/translations/nl.js +1 -0
  27. package/build/translations/no.js +1 -0
  28. package/build/translations/pl.js +1 -0
  29. package/build/translations/pt-br.js +1 -0
  30. package/build/translations/ro.js +1 -0
  31. package/build/translations/ru.js +1 -0
  32. package/build/translations/sk.js +1 -0
  33. package/build/translations/sr-latn.js +1 -0
  34. package/build/translations/sr.js +1 -0
  35. package/build/translations/tk.js +1 -0
  36. package/build/translations/tr.js +1 -0
  37. package/build/translations/uk.js +1 -0
  38. package/build/translations/vi.js +1 -0
  39. package/build/translations/zh-cn.js +1 -0
  40. package/build/translations/zh.js +1 -0
  41. package/build/word-count.js +1 -1
  42. package/package.json +16 -16
  43. package/CHANGELOG.md +0 -62
@@ -0,0 +1 @@
1
+ !function(i){const a=i.az=i.az||{};a.dictionary=Object.assign(a.dictionary||{},{"Characters: %0":"Simvolar: %0","Words: %0":"Sözlər: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const n=o.cs=o.cs||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Počet znaků: %0","Words: %0":"Počet slov: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(a){const r=a.da=a.da||{};r.dictionary=Object.assign(r.dictionary||{},{"Characters: %0":"Karakterer: %0","Words: %0":"Ord: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(c){const i=c["de-ch"]=c["de-ch"]||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Zeichen: %0","Words: %0":"Wörter: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.de=i.de||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Zeichen: %0 ","Words: %0":"Wörter: %0 "})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const a=n["en-au"]=n["en-au"]||{};a.dictionary=Object.assign(a.dictionary||{},{"Characters: %0":"Characters: %0","Words: %0":"Words: %0"})}(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||{},{"Characters: %0":"Characters: %0","Words: %0":"Words: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(a){const s=a.es=a.es||{};s.dictionary=Object.assign(s.dictionary||{},{"Characters: %0":"Caracteres: %0","Words: %0":"Palabras: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.et=n.et||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Märke: %0","Words: %0":"Sõnu: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.fa=i.fa||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"تعداد حروف : 0%","Words: %0":"تعداد لغات : 0%"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.fi=i.fi||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Merkkejä: %0","Words: %0":"Sanoja: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(r){const i=r.fr=r.fr||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Caractères : %0","Words: %0":"Mots : %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(a){const i=a.gl=a.gl||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Caracteres: %0","Words: %0":"Palabras: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.he=i.he||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"מס' תווים: %0","Words: %0":"מס' מילים: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.hi=i.hi||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Characters: %0","Words: %0":"Words: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.hr=i.hr||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Znakova: %0","Words: %0":"Riječi: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(a){const i=a.hu=a.hu||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Karakterek: %0","Words: %0":"Szavak: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const a=i.id=i.id||{};a.dictionary=Object.assign(a.dictionary||{},{"Characters: %0":"Karakter: %0","Words: %0":"Kata: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const t=i.it=i.it||{};t.dictionary=Object.assign(t.dictionary||{},{"Characters: %0":"Caratteri: %0","Words: %0":"Parole: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ja=i.ja||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"文字数: %0","Words: %0":"単語数: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(o){const i=o.ko=o.ko||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"문자 수: %0","Words: %0":"단어 수: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ku=i.ku||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"نووسەکان: %0","Words: %0":"وشەکان: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const o=i.lt=i.lt||{};o.dictionary=Object.assign(o.dictionary||{},{"Characters: %0":"Simbolių: %0","Words: %0":"Žodžių: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.lv=i.lv||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Rakstzīmes: %0","Words: %0":"Vārdi: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.ne=n.ne||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"क्यारेक्टरहरू: 0%","Words: %0":"शब्दहरू: 0%"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.nl=n.nl||{};o.dictionary=Object.assign(o.dictionary||{},{"Characters: %0":"Tekens: 0%","Words: %0":"Woorden: 0%"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.no=n.no||{};o.dictionary=Object.assign(o.dictionary||{},{"Characters: %0":"Tegn: %0","Words: %0":"Ord: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.pl=i.pl||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Znaki: %0","Words: %0":"Słowa: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(a){const r=a["pt-br"]=a["pt-br"]||{};r.dictionary=Object.assign(r.dictionary||{},{"Characters: %0":"Caracteres: %0","Words: %0":"Palavras: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ro=i.ro||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Caractere: %0","Words: %0":"Cuvinte: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.ru=i.ru||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Символов: %0","Words: %0":"Слов: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const o=n.sk=n.sk||{};o.dictionary=Object.assign(o.dictionary||{},{"Characters: %0":"Znakov: %0","Words: %0":"Slov: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i["sr-latn"]=i["sr-latn"]||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Karakteri: %0","Words: %0":"Reči: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.sr=i.sr||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Карактери: %0","Words: %0":"Речи: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.tk=n.tk||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Nyşanlar: %0","Words: %0":"Sözler: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(r){const i=r.tr=r.tr||{};i.dictionary=Object.assign(i.dictionary||{},{"Characters: %0":"Karakterler: %0","Words: %0":"Kelimeler: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.uk=i.uk||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Символи: %0","Words: %0":"Слова: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.vi=i.vi||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"Số ký tự: %0","Words: %0":"Số chữ: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const c=n["zh-cn"]=n["zh-cn"]||{};c.dictionary=Object.assign(c.dictionary||{},{"Characters: %0":"字符数:%0","Words: %0":"单词数:%0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const n=i.zh=i.zh||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"字元數: %0","Words: %0":"字數: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -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.wordCount=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e){t.exports=CKEditor5.dll},function(t,e,r){t.exports=r(0)("./src/ui.js")},function(t,e,r){t.exports=r(0)("./src/core.js")},function(t,e,r){t.exports=r(0)("./src/utils.js")},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(5))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"WordCount",(function(){return Z}));var n=r(2),o=r(1),i=r(3);var u=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},c=r(4),a="object"==typeof self&&self&&self.Object===Object&&self,s=c.a||a||Function("return this")(),f=function(){return s.Date.now()},d=/\s/;var l=function(t){for(var e=t.length;e--&&d.test(t.charAt(e)););return e},h=/^\s+/;var p=function(t){return t?t.slice(0,l(t)+1).replace(h,""):t},g=s.Symbol,v=Object.prototype,b=v.hasOwnProperty,w=v.toString,y=g?g.toStringTag:void 0;var _=function(t){var e=b.call(t,y),r=t[y];try{t[y]=void 0;var n=!0}catch(t){}var o=w.call(t);return n&&(e?t[y]=r:delete t[y]),o},m=Object.prototype.toString;var j=function(t){return m.call(t)},x=g?g.toStringTag:void 0;var O=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":x&&x in Object(t)?_(t):j(t)};var C=function(t){return null!=t&&"object"==typeof t};var S=function(t){return"symbol"==typeof t||C(t)&&"[object Symbol]"==O(t)},T=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,P=/^0o[0-7]+$/i,V=parseInt;var W=function(t){if("number"==typeof t)return t;if(S(t))return NaN;if(u(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=u(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=p(t);var r=E.test(t);return r||P.test(t)?V(t.slice(2),r?2:8):T.test(t)?NaN:+t},M=Math.max,L=Math.min;var N=function(t,e,r){var n,o,i,c,a,s,d=0,l=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=n,i=o;return n=o=void 0,d=e,c=t.apply(i,r)}function v(t){return d=t,a=setTimeout(w,e),l?g(t):c}function b(t){var r=t-s;return void 0===s||r>=e||r<0||h&&t-d>=i}function w(){var t=f();if(b(t))return y(t);a=setTimeout(w,function(t){var r=e-(t-s);return h?L(r,i-(t-d)):r}(t))}function y(t){return a=void 0,p&&n?g(t):(n=o=void 0,c)}function _(){var t=f(),r=b(t);if(n=arguments,o=this,s=t,r){if(void 0===a)return v(s);if(h)return clearTimeout(a),a=setTimeout(w,e),g(s)}return void 0===a&&(a=setTimeout(w,e)),c}return e=W(e)||0,u(r)&&(l=!!r.leading,i=(h="maxWait"in r)?M(W(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p),_.cancel=function(){void 0!==a&&clearTimeout(a),d=0,n=s=o=a=void 0},_.flush=function(){return void 0===a?c:y(f())},_};var R=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return u(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),N(t,e,{leading:n,maxWait:e,trailing:o})};var $=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object),k=Function.prototype,K=Object.prototype,U=k.toString,F=K.hasOwnProperty,A=U.call(Object);var z=function(t){if(!C(t)||"[object Object]"!=O(t))return!1;var e=$(t);if(null===e)return!0;var r=F.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&U.call(r)==A};var D=function(t){return C(t)&&1===t.nodeType&&!z(t)};function I(t){if(t.is("$text")||t.is("$textProxy"))return t.data;let e="",r=null;for(const n of t.getChildren()){const t=I(n);r&&r.is("element")&&(e+="\n"),e+=t,r=n}return e}class Z extends n.Plugin{constructor(t){super(t),this.set("characters",0),this.set("words",0),Object.defineProperties(this,{characters:{get(){return this.characters=this._getCharacters()}},words:{get(){return this.words=this._getWords()}}}),this.set("_wordsLabel"),this.set("_charactersLabel"),this._config=t.config.get("wordCount")||{},this._outputView=void 0,this._wordsMatchRegExp=i.env.features.isRegExpUnicodePropertySupported?new RegExp("([\\p{L}\\p{N}]+\\S?)+","gu"):/([a-zA-Z0-9À-ž]+\S?)+/gu}static get pluginName(){return"WordCount"}init(){this.editor.model.document.on("change:data",R(this._refreshStats.bind(this),250)),"function"==typeof this._config.onUpdate&&this.on("update",(t,e)=>{this._config.onUpdate(e)}),D(this._config.container)&&this._config.container.appendChild(this.wordCountContainer)}destroy(){this._outputView&&(this._outputView.element.remove(),this._outputView.destroy()),super.destroy()}get wordCountContainer(){const t=this.editor,e=t.t,r=t.config.get("wordCount.displayWords"),n=t.config.get("wordCount.displayCharacters"),i=o.Template.bind(this,this),u=[];return this._outputView||(this._outputView=new o.View,(r||void 0===r)&&(this.bind("_wordsLabel").to(this,"words",t=>e("Words: %0",t)),u.push({tag:"div",children:[{text:[i.to("_wordsLabel")]}],attributes:{class:"ck-word-count__words"}})),(n||void 0===n)&&(this.bind("_charactersLabel").to(this,"characters",t=>e("Characters: %0",t)),u.push({tag:"div",children:[{text:[i.to("_charactersLabel")]}],attributes:{class:"ck-word-count__characters"}})),this._outputView.setTemplate({tag:"div",attributes:{class:["ck","ck-word-count"]},children:u}),this._outputView.render()),this._outputView.element}_getCharacters(){return I(this.editor.model.document.getRoot()).replace(/\n/g,"").length}_getWords(){return(I(this.editor.model.document.getRoot()).match(this._wordsMatchRegExp)||[]).length}_refreshStats(){const t=this.words=this._getWords(),e=this.characters=this._getCharacters();this.fire("update",{words:t,characters:e})}}}]);
5
+ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Characters: %0":"Characters: %0","Words: %0":"Words: %0"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),window.CKEditor5=window.CKEditor5||{},window.CKEditor5.wordCount=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e){t.exports=CKEditor5.dll},function(t,e,r){t.exports=r(0)("./src/ui.js")},function(t,e,r){t.exports=r(0)("./src/core.js")},function(t,e,r){t.exports=r(0)("./src/utils.js")},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(5))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"WordCount",(function(){return Z}));var n=r(2),o=r(1),i=r(3);var u=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},c=r(4),a="object"==typeof self&&self&&self.Object===Object&&self,s=c.a||a||Function("return this")(),d=function(){return s.Date.now()},f=/\s/;var l=function(t){for(var e=t.length;e--&&f.test(t.charAt(e)););return e},h=/^\s+/;var p=function(t){return t?t.slice(0,l(t)+1).replace(h,""):t},g=s.Symbol,v=Object.prototype,w=v.hasOwnProperty,b=v.toString,y=g?g.toStringTag:void 0;var _=function(t){var e=w.call(t,y),r=t[y];try{t[y]=void 0;var n=!0}catch(t){}var o=b.call(t);return n&&(e?t[y]=r:delete t[y]),o},m=Object.prototype.toString;var j=function(t){return m.call(t)},O=g?g.toStringTag:void 0;var x=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?_(t):j(t)};var C=function(t){return null!=t&&"object"==typeof t};var S=function(t){return"symbol"==typeof t||C(t)&&"[object Symbol]"==x(t)},T=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,P=/^0o[0-7]+$/i,W=parseInt;var N=function(t){if("number"==typeof t)return t;if(S(t))return NaN;if(u(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=u(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=p(t);var r=E.test(t);return r||P.test(t)?W(t.slice(2),r?2:8):T.test(t)?NaN:+t},R=Math.max,V=Math.min;var L=function(t,e,r){var n,o,i,c,a,s,f=0,l=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=n,i=o;return n=o=void 0,f=e,c=t.apply(i,r)}function v(t){return f=t,a=setTimeout(b,e),l?g(t):c}function w(t){var r=t-s;return void 0===s||r>=e||r<0||h&&t-f>=i}function b(){var t=d();if(w(t))return y(t);a=setTimeout(b,function(t){var r=e-(t-s);return h?V(r,i-(t-f)):r}(t))}function y(t){return a=void 0,p&&n?g(t):(n=o=void 0,c)}function _(){var t=d(),r=w(t);if(n=arguments,o=this,s=t,r){if(void 0===a)return v(s);if(h)return clearTimeout(a),a=setTimeout(b,e),g(s)}return void 0===a&&(a=setTimeout(b,e)),c}return e=N(e)||0,u(r)&&(l=!!r.leading,i=(h="maxWait"in r)?R(N(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p),_.cancel=function(){void 0!==a&&clearTimeout(a),f=0,n=s=o=a=void 0},_.flush=function(){return void 0===a?c:y(d())},_};var M=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return u(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),L(t,e,{leading:n,maxWait:e,trailing:o})};var A=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object),K=Function.prototype,I=Object.prototype,$=K.toString,k=I.hasOwnProperty,U=$.call(Object);var D=function(t){if(!C(t)||"[object Object]"!=x(t))return!1;var e=A(t);if(null===e)return!0;var r=k.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&$.call(r)==U};var F=function(t){return C(t)&&1===t.nodeType&&!D(t)};function z(t){if(t.is("$text")||t.is("$textProxy"))return t.data;let e="",r=null;for(const n of t.getChildren()){const t=z(n);r&&r.is("element")&&(e+="\n"),e+=t,r=n}return e}class Z extends n.Plugin{constructor(t){super(t),this.set("characters",0),this.set("words",0),Object.defineProperties(this,{characters:{get(){return this.characters=this._getCharacters()}},words:{get(){return this.words=this._getWords()}}}),this.set("_wordsLabel"),this.set("_charactersLabel"),this._config=t.config.get("wordCount")||{},this._outputView=void 0,this._wordsMatchRegExp=i.env.features.isRegExpUnicodePropertySupported?new RegExp("([\\p{L}\\p{N}]+\\S?)+","gu"):/([a-zA-Z0-9À-ž]+\S?)+/gu}static get pluginName(){return"WordCount"}init(){this.editor.model.document.on("change:data",M(this._refreshStats.bind(this),250)),"function"==typeof this._config.onUpdate&&this.on("update",(t,e)=>{this._config.onUpdate(e)}),F(this._config.container)&&this._config.container.appendChild(this.wordCountContainer)}destroy(){this._outputView&&(this._outputView.element.remove(),this._outputView.destroy()),super.destroy()}get wordCountContainer(){const t=this.editor,e=t.t,r=t.config.get("wordCount.displayWords"),n=t.config.get("wordCount.displayCharacters"),i=o.Template.bind(this,this),u=[];return this._outputView||(this._outputView=new o.View,(r||void 0===r)&&(this.bind("_wordsLabel").to(this,"words",t=>e("Words: %0",t)),u.push({tag:"div",children:[{text:[i.to("_wordsLabel")]}],attributes:{class:"ck-word-count__words"}})),(n||void 0===n)&&(this.bind("_charactersLabel").to(this,"characters",t=>e("Characters: %0",t)),u.push({tag:"div",children:[{text:[i.to("_charactersLabel")]}],attributes:{class:"ck-word-count__characters"}})),this._outputView.setTemplate({tag:"div",attributes:{class:["ck","ck-word-count"]},children:u}),this._outputView.render()),this._outputView.element}_getCharacters(){return z(this.editor.model.document.getRoot()).replace(/\n/g,"").length}_getWords(){return(z(this.editor.model.document.getRoot()).match(this._wordsMatchRegExp)||[]).length}_refreshStats(){const t=this.words=this._getWords(),e=this.characters=this._getCharacters();this.fire("update",{words:t,characters:e})}}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-word-count",
3
- "version": "29.1.0",
3
+ "version": "31.1.0",
4
4
  "description": "Word and character count feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,23 +13,23 @@
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
15
  "lodash-es": "^4.17.15",
16
- "ckeditor5": "^29.1.0"
16
+ "ckeditor5": "^31.1.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@ckeditor/ckeditor5-basic-styles": "^29.1.0",
20
- "@ckeditor/ckeditor5-block-quote": "^29.1.0",
21
- "@ckeditor/ckeditor5-core": "^29.1.0",
22
- "@ckeditor/ckeditor5-dev-utils": "^25.3.0",
23
- "@ckeditor/ckeditor5-editor-classic": "^29.1.0",
24
- "@ckeditor/ckeditor5-engine": "^29.1.0",
25
- "@ckeditor/ckeditor5-enter": "^29.1.0",
26
- "@ckeditor/ckeditor5-image": "^29.1.0",
27
- "@ckeditor/ckeditor5-link": "^29.1.0",
28
- "@ckeditor/ckeditor5-list": "^29.1.0",
29
- "@ckeditor/ckeditor5-paragraph": "^29.1.0",
30
- "@ckeditor/ckeditor5-table": "^29.1.0",
31
- "@ckeditor/ckeditor5-theme-lark": "^29.1.0",
32
- "@ckeditor/ckeditor5-utils": "^29.1.0",
19
+ "@ckeditor/ckeditor5-basic-styles": "^31.1.0",
20
+ "@ckeditor/ckeditor5-block-quote": "^31.1.0",
21
+ "@ckeditor/ckeditor5-core": "^31.1.0",
22
+ "@ckeditor/ckeditor5-dev-utils": "^26.0.0",
23
+ "@ckeditor/ckeditor5-editor-classic": "^31.1.0",
24
+ "@ckeditor/ckeditor5-engine": "^31.1.0",
25
+ "@ckeditor/ckeditor5-enter": "^31.1.0",
26
+ "@ckeditor/ckeditor5-image": "^31.1.0",
27
+ "@ckeditor/ckeditor5-link": "^31.1.0",
28
+ "@ckeditor/ckeditor5-list": "^31.1.0",
29
+ "@ckeditor/ckeditor5-paragraph": "^31.1.0",
30
+ "@ckeditor/ckeditor5-table": "^31.1.0",
31
+ "@ckeditor/ckeditor5-theme-lark": "^31.1.0",
32
+ "@ckeditor/ckeditor5-utils": "^31.1.0",
33
33
  "webpack": "^4.43.0",
34
34
  "webpack-cli": "^3.3.11"
35
35
  },
package/CHANGELOG.md DELETED
@@ -1,62 +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-word-count/compare/v18.0.0...v19.0.0) (2020-04-29)
9
-
10
- ### Other changes
11
-
12
- * Updated translations. ([091f2e7](https://github.com/ckeditor/ckeditor5-word-count/commit/091f2e7))
13
-
14
-
15
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-word-count/compare/v17.0.0...v18.0.0) (2020-03-19)
16
-
17
- Internal changes only (updated dependencies, documentation, etc.).
18
-
19
-
20
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-word-count/compare/v16.0.0...v17.0.0) (2020-02-19)
21
-
22
- ### Other changes
23
-
24
- * Updated translations. ([d8e40e5](https://github.com/ckeditor/ckeditor5-word-count/commit/d8e40e5))
25
-
26
-
27
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-word-count/compare/v15.0.0...v16.0.0) (2019-12-04)
28
-
29
- ### Other changes
30
-
31
- * Updated translations. ([ffa4b14](https://github.com/ckeditor/ckeditor5-word-count/commit/ffa4b14))
32
-
33
-
34
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-word-count/compare/v10.0.2...v15.0.0) (2019-10-23)
35
-
36
- ### Other changes
37
-
38
- * Updated translations. ([ff823db](https://github.com/ckeditor/ckeditor5-word-count/commit/ff823db)) ([6d2cc2b](https://github.com/ckeditor/ckeditor5-word-count/commit/6d2cc2b))
39
-
40
-
41
- ## [10.0.2](https://github.com/ckeditor/ckeditor5-word-count/compare/v10.0.1...v10.0.2) (2019-08-26)
42
-
43
- ### Bug fixes
44
-
45
- * Improve words recognition, remove enter from counted characters. Closes [#4](https://github.com/ckeditor/ckeditor5-word-count/issues/4). Closes [#5](https://github.com/ckeditor/ckeditor5-word-count/issues/5). ([7e7ee48](https://github.com/ckeditor/ckeditor5-word-count/commit/7e7ee48))
46
- * Word count plugin no longer throws an error when a container is undefined. Closes [#16](https://github.com/ckeditor/ckeditor5-word-count/issues/16). ([e1a7a7e](https://github.com/ckeditor/ckeditor5-word-count/commit/e1a7a7e))
47
-
48
- ### Other changes
49
-
50
- * 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). ([f8035d1](https://github.com/ckeditor/ckeditor5-word-count/commit/f8035d1))
51
- * Made `WordCount#characters` and `WordCount#words` getters synchronous to make it possible to retrieve precise content stats on demand. Closes [#6](https://github.com/ckeditor/ckeditor5-word-count/issues/6). ([780dfbf](https://github.com/ckeditor/ckeditor5-word-count/commit/780dfbf))
52
- * Updated translations. ([9aab7fb](https://github.com/ckeditor/ckeditor5-word-count/commit/9aab7fb))
53
-
54
-
55
- ## [10.0.1](https://github.com/ckeditor/ckeditor5-word-count/compare/v10.0.0...v10.0.1) (2019-07-10)
56
-
57
- Internal changes only (updated dependencies, documentation, etc.).
58
-
59
-
60
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-word-count/tree/v10.0.0) (2019-07-04)
61
-
62
- The initial font feature implementation.