@ckeditor/ckeditor5-word-count 32.0.0 → 34.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +2 -2
- package/README.md +2 -1
- package/build/translations/el.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/word-count.js +1 -1
- package/lang/translations/el.po +25 -0
- package/lang/translations/ur.po +25 -0
- package/package.json +16 -16
package/LICENSE.md
CHANGED
|
@@ -2,7 +2,7 @@ Software License Agreement
|
|
|
2
2
|
==========================
|
|
3
3
|
|
|
4
4
|
**CKEditor 5 word and character count feature** – https://github.com/ckeditor/ckeditor5-word-count <br>
|
|
5
|
-
Copyright (c) 2003-2022, [CKSource
|
|
5
|
+
Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com) 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).
|
|
8
8
|
|
|
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
|
|
|
14
14
|
Trademarks
|
|
15
15
|
----------
|
|
16
16
|
|
|
17
|
-
**CKEditor** is a trademark of [CKSource
|
|
17
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@ CKEditor 5 word and character count feature
|
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-word-count)
|
|
5
5
|
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
-
[](https://travis-ci.com/ckeditor/ckeditor5)
|
|
6
|
+
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
|
7
|
+

|
|
7
8
|
|
|
8
9
|
This package implements word count and character count support for CKEditor 5.
|
|
9
10
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(i){const n=i.el=i.el||{};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.ur=i.ur||{};n.dictionary=Object.assign(n.dictionary||{},{"Characters: %0":"حروف: 0%","Words: %0":"الفاظ: 0%"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
|
package/build/word-count.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
!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={})),
|
|
2
2
|
/*!
|
|
3
|
-
* @license Copyright (c) 2003-2022, CKSource
|
|
3
|
+
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md.
|
|
5
5
|
*/(()=>{var t={704:(t,e,r)=>{t.exports=r(79)("./src/core.js")},273:(t,e,r)=>{t.exports=r(79)("./src/ui.js")},209:(t,e,r)=>{t.exports=r(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{WordCount:()=>z});var t=r(704),e=r(273),n=r(209);const i=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const s="object"==typeof global&&global&&global.Object===Object&&global;var c="object"==typeof self&&self&&self.Object===Object&&self;const a=s||c||Function("return this")();const u=function(){return a.Date.now()};var d=/\s/;const l=function(t){for(var e=t.length;e--&&d.test(t.charAt(e)););return e};var f=/^\s+/;const h=function(t){return t?t.slice(0,l(t)+1).replace(f,""):t};const p=a.Symbol;var g=Object.prototype,v=g.hasOwnProperty,b=g.toString,w=p?p.toStringTag:void 0;const y=function(t){var e=v.call(t,w),r=t[w];try{t[w]=void 0;var o=!0}catch(t){}var n=b.call(t);return o&&(e?t[w]=r:delete t[w]),n};var _=Object.prototype.toString;const m=function(t){return _.call(t)};var j=p?p.toStringTag:void 0;const O=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?y(t):m(t)};const x=function(t){return null!=t&&"object"==typeof t};const C=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==O(t)};var S=/^[-+]0x[0-9a-f]+$/i,T=/^0b[01]+$/i,E=/^0o[0-7]+$/i,W=parseInt;const N=function(t){if("number"==typeof t)return t;if(C(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=h(t);var r=T.test(t);return r||E.test(t)?W(t.slice(2),r?2:8):S.test(t)?NaN:+t};var P=Math.max,R=Math.min;const V=function(t,e,r){var o,n,s,c,a,d,l=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=o,i=n;return o=n=void 0,l=e,c=t.apply(i,r)}function v(t){return l=t,a=setTimeout(w,e),f?g(t):c}function b(t){var r=t-d;return void 0===d||r>=e||r<0||h&&t-l>=s}function w(){var t=u();if(b(t))return y(t);a=setTimeout(w,function(t){var r=e-(t-d);return h?R(r,s-(t-l)):r}(t))}function y(t){return a=void 0,p&&o?g(t):(o=n=void 0,c)}function _(){var t=u(),r=b(t);if(o=arguments,n=this,d=t,r){if(void 0===a)return v(d);if(h)return clearTimeout(a),a=setTimeout(w,e),g(d)}return void 0===a&&(a=setTimeout(w,e)),c}return e=N(e)||0,i(r)&&(f=!!r.leading,s=(h="maxWait"in r)?P(N(r.maxWait)||0,e):s,p="trailing"in r?!!r.trailing:p),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,o=d=n=a=void 0},_.flush=function(){return void 0===a?c:y(u())},_};const L=function(t,e,r){var o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return i(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),V(t,e,{leading:o,maxWait:e,trailing:n})};const A=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object);var M=Function.prototype,I=Object.prototype,K=M.toString,$=I.hasOwnProperty,k=K.call(Object);const U=function(t){if(!x(t)||"[object Object]"!=O(t))return!1;var e=A(t);if(null===e)return!0;var r=$.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&K.call(r)==k};const D=function(t){return x(t)&&1===t.nodeType&&!U(t)};function F(t){if(t.is("$text")||t.is("$textProxy"))return t.data;let e="",r=null;for(const o of t.getChildren()){const t=F(o);r&&r.is("element")&&(e+="\n"),e+=t,r=o}return e}class z extends t.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=n.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",L(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,r=t.t,o=t.config.get("wordCount.displayWords"),n=t.config.get("wordCount.displayCharacters"),i=e.Template.bind(this,this),s=[];return this._outputView||(this._outputView=new e.View,(o||void 0===o)&&(this.bind("_wordsLabel").to(this,"words",(t=>r("Words: %0",t))),s.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=>r("Characters: %0",t))),s.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:s}),this._outputView.render()),this._outputView.element}_getCharacters(){return F(this.editor.model.document.getRoot()).replace(/\n/g,"").length}_getWords(){return(F(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})}}})(),(window.CKEditor5=window.CKEditor5||{}).wordCount=o})();
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Greek (https://www.transifex.com/ckeditor/teams/11143/el/)\n"
|
|
16
|
+
"Language: el\n"
|
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Label showing the number of words in the editor content."
|
|
20
|
+
msgid "Words: %0"
|
|
21
|
+
msgstr "Λέξεις: %0"
|
|
22
|
+
|
|
23
|
+
msgctxt "Label showing the number of characters in the editor content."
|
|
24
|
+
msgid "Characters: %0"
|
|
25
|
+
msgstr "Χαρακτήρες: %0"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
2
|
+
#
|
|
3
|
+
# !!! IMPORTANT !!!
|
|
4
|
+
#
|
|
5
|
+
# Before you edit this file, please keep in mind that contributing to the project
|
|
6
|
+
# translations is possible ONLY via the Transifex online service.
|
|
7
|
+
#
|
|
8
|
+
# To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
|
|
9
|
+
#
|
|
10
|
+
# To learn more, check out the official contributor's guide:
|
|
11
|
+
# https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
|
|
12
|
+
#
|
|
13
|
+
msgid ""
|
|
14
|
+
msgstr ""
|
|
15
|
+
"Language-Team: Urdu (https://www.transifex.com/ckeditor/teams/11143/ur/)\n"
|
|
16
|
+
"Language: ur\n"
|
|
17
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
18
|
+
|
|
19
|
+
msgctxt "Label showing the number of words in the editor content."
|
|
20
|
+
msgid "Words: %0"
|
|
21
|
+
msgstr "الفاظ: 0%"
|
|
22
|
+
|
|
23
|
+
msgctxt "Label showing the number of characters in the editor content."
|
|
24
|
+
msgid "Characters: %0"
|
|
25
|
+
msgstr "حروف: 0%"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-word-count",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "34.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": "^
|
|
16
|
+
"ckeditor5": "^34.1.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
|
20
|
-
"@ckeditor/ckeditor5-block-quote": "^
|
|
21
|
-
"@ckeditor/ckeditor5-core": "^
|
|
22
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
|
23
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
|
24
|
-
"@ckeditor/ckeditor5-engine": "^
|
|
25
|
-
"@ckeditor/ckeditor5-enter": "^
|
|
26
|
-
"@ckeditor/ckeditor5-image": "^
|
|
27
|
-
"@ckeditor/ckeditor5-link": "^
|
|
28
|
-
"@ckeditor/ckeditor5-list": "^
|
|
29
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
30
|
-
"@ckeditor/ckeditor5-table": "^
|
|
31
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
32
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
19
|
+
"@ckeditor/ckeditor5-basic-styles": "^34.1.0",
|
|
20
|
+
"@ckeditor/ckeditor5-block-quote": "^34.1.0",
|
|
21
|
+
"@ckeditor/ckeditor5-core": "^34.1.0",
|
|
22
|
+
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
|
|
23
|
+
"@ckeditor/ckeditor5-editor-classic": "^34.1.0",
|
|
24
|
+
"@ckeditor/ckeditor5-engine": "^34.1.0",
|
|
25
|
+
"@ckeditor/ckeditor5-enter": "^34.1.0",
|
|
26
|
+
"@ckeditor/ckeditor5-image": "^34.1.0",
|
|
27
|
+
"@ckeditor/ckeditor5-link": "^34.1.0",
|
|
28
|
+
"@ckeditor/ckeditor5-list": "^34.1.0",
|
|
29
|
+
"@ckeditor/ckeditor5-paragraph": "^34.1.0",
|
|
30
|
+
"@ckeditor/ckeditor5-table": "^34.1.0",
|
|
31
|
+
"@ckeditor/ckeditor5-theme-lark": "^34.1.0",
|
|
32
|
+
"@ckeditor/ckeditor5-utils": "^34.1.0",
|
|
33
33
|
"webpack": "^5.58.1",
|
|
34
34
|
"webpack-cli": "^4.9.0"
|
|
35
35
|
},
|