@ckeditor/ckeditor5-word-count 41.3.0-alpha.1 → 41.3.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/dist/translations/ar.d.ts +8 -0
  2. package/dist/translations/ar.js +5 -0
  3. package/dist/translations/az.d.ts +8 -0
  4. package/dist/translations/az.js +5 -0
  5. package/dist/translations/bg.d.ts +8 -0
  6. package/dist/translations/bg.js +5 -0
  7. package/dist/translations/bn.d.ts +8 -0
  8. package/dist/translations/bn.js +5 -0
  9. package/dist/translations/ca.d.ts +8 -0
  10. package/dist/translations/ca.js +5 -0
  11. package/dist/translations/cs.d.ts +8 -0
  12. package/dist/translations/cs.js +5 -0
  13. package/dist/translations/da.d.ts +8 -0
  14. package/dist/translations/da.js +5 -0
  15. package/dist/translations/de-ch.d.ts +8 -0
  16. package/dist/translations/de-ch.js +5 -0
  17. package/dist/translations/de.d.ts +8 -0
  18. package/dist/translations/de.js +5 -0
  19. package/dist/translations/el.d.ts +8 -0
  20. package/dist/translations/el.js +5 -0
  21. package/dist/translations/en-au.d.ts +8 -0
  22. package/dist/translations/en-au.js +5 -0
  23. package/dist/translations/en-gb.d.ts +8 -0
  24. package/dist/translations/en-gb.js +5 -0
  25. package/dist/translations/en.d.ts +8 -0
  26. package/dist/translations/en.js +5 -0
  27. package/dist/translations/es-co.d.ts +8 -0
  28. package/dist/translations/es-co.js +5 -0
  29. package/dist/translations/es.d.ts +8 -0
  30. package/dist/translations/es.js +5 -0
  31. package/dist/translations/et.d.ts +8 -0
  32. package/dist/translations/et.js +5 -0
  33. package/dist/translations/fa.d.ts +8 -0
  34. package/dist/translations/fa.js +5 -0
  35. package/dist/translations/fi.d.ts +8 -0
  36. package/dist/translations/fi.js +5 -0
  37. package/dist/translations/fr.d.ts +8 -0
  38. package/dist/translations/fr.js +5 -0
  39. package/dist/translations/gl.d.ts +8 -0
  40. package/dist/translations/gl.js +5 -0
  41. package/dist/translations/he.d.ts +8 -0
  42. package/dist/translations/he.js +5 -0
  43. package/dist/translations/hi.d.ts +8 -0
  44. package/dist/translations/hi.js +5 -0
  45. package/dist/translations/hr.d.ts +8 -0
  46. package/dist/translations/hr.js +5 -0
  47. package/dist/translations/hu.d.ts +8 -0
  48. package/dist/translations/hu.js +5 -0
  49. package/dist/translations/hy.d.ts +8 -0
  50. package/dist/translations/hy.js +5 -0
  51. package/dist/translations/id.d.ts +8 -0
  52. package/dist/translations/id.js +5 -0
  53. package/dist/translations/it.d.ts +8 -0
  54. package/dist/translations/it.js +5 -0
  55. package/dist/translations/ja.d.ts +8 -0
  56. package/dist/translations/ja.js +5 -0
  57. package/dist/translations/ko.d.ts +8 -0
  58. package/dist/translations/ko.js +5 -0
  59. package/dist/translations/ku.d.ts +8 -0
  60. package/dist/translations/ku.js +5 -0
  61. package/dist/translations/lt.d.ts +8 -0
  62. package/dist/translations/lt.js +5 -0
  63. package/dist/translations/lv.d.ts +8 -0
  64. package/dist/translations/lv.js +5 -0
  65. package/dist/translations/ms.d.ts +8 -0
  66. package/dist/translations/ms.js +5 -0
  67. package/dist/translations/ne.d.ts +8 -0
  68. package/dist/translations/ne.js +5 -0
  69. package/dist/translations/nl.d.ts +8 -0
  70. package/dist/translations/nl.js +5 -0
  71. package/dist/translations/no.d.ts +8 -0
  72. package/dist/translations/no.js +5 -0
  73. package/dist/translations/pl.d.ts +8 -0
  74. package/dist/translations/pl.js +5 -0
  75. package/dist/translations/pt-br.d.ts +8 -0
  76. package/dist/translations/pt-br.js +5 -0
  77. package/dist/translations/pt.d.ts +8 -0
  78. package/dist/translations/pt.js +5 -0
  79. package/dist/translations/ro.d.ts +8 -0
  80. package/dist/translations/ro.js +5 -0
  81. package/dist/translations/ru.d.ts +8 -0
  82. package/dist/translations/ru.js +5 -0
  83. package/dist/translations/sk.d.ts +8 -0
  84. package/dist/translations/sk.js +5 -0
  85. package/dist/translations/sq.d.ts +8 -0
  86. package/dist/translations/sq.js +5 -0
  87. package/dist/translations/sr-latn.d.ts +8 -0
  88. package/dist/translations/sr-latn.js +5 -0
  89. package/dist/translations/sr.d.ts +8 -0
  90. package/dist/translations/sr.js +5 -0
  91. package/dist/translations/sv.d.ts +8 -0
  92. package/dist/translations/sv.js +5 -0
  93. package/dist/translations/th.d.ts +8 -0
  94. package/dist/translations/th.js +5 -0
  95. package/dist/translations/tk.d.ts +8 -0
  96. package/dist/translations/tk.js +5 -0
  97. package/dist/translations/tr.d.ts +8 -0
  98. package/dist/translations/tr.js +5 -0
  99. package/dist/translations/ug.d.ts +8 -0
  100. package/dist/translations/ug.js +5 -0
  101. package/dist/translations/uk.d.ts +8 -0
  102. package/dist/translations/uk.js +5 -0
  103. package/dist/translations/ur.d.ts +8 -0
  104. package/dist/translations/ur.js +5 -0
  105. package/dist/translations/vi.d.ts +8 -0
  106. package/dist/translations/vi.js +5 -0
  107. package/dist/translations/zh-cn.d.ts +8 -0
  108. package/dist/translations/zh-cn.js +5 -0
  109. package/dist/translations/zh.d.ts +8 -0
  110. package/dist/translations/zh.js +5 -0
  111. package/dist/types/augmentation.d.ts +4 -0
  112. package/dist/types/index.d.ts +4 -0
  113. package/dist/types/utils.d.ts +4 -0
  114. package/dist/types/wordcount.d.ts +4 -0
  115. package/dist/types/wordcountconfig.d.ts +4 -0
  116. package/package.json +2 -2
  117. package/dist/index.js +0 -246
  118. package/dist/index.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"no":{"dictionary":{"Words: %0":"Ord: %0","Characters: %0":"Tegn: %0"},getPluralForm(n){return (n != 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"pl":{"dictionary":{"Words: %0":"Słowa: %0","Characters: %0":"Znaki: %0"},getPluralForm(n){return (n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"pt-br":{"dictionary":{"Words: %0":"Palavras: %0","Characters: %0":"Caracteres: %0"},getPluralForm(n){return (n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"pt":{"dictionary":{"Words: %0":"Palavras: %0","Characters: %0":"Caracteres: %0"},getPluralForm(n){return (n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"ro":{"dictionary":{"Words: %0":"Cuvinte: %0","Characters: %0":"Caractere: %0"},getPluralForm(n){return (n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"ru":{"dictionary":{"Words: %0":"Слов: %0","Characters: %0":"Символов: %0"},getPluralForm(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"sk":{"dictionary":{"Words: %0":"Slov: %0","Characters: %0":"Znakov: %0"},getPluralForm(n){return (n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"sq":{"dictionary":{"Words: %0":"Fjalë: %0","Characters: %0":"Karaktere: %0"},getPluralForm(n){return (n != 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"sr-latn":{"dictionary":{"Words: %0":"Reči: %0","Characters: %0":"Karakteri: %0"},getPluralForm(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"sr":{"dictionary":{"Words: %0":"Речи: %0","Characters: %0":"Карактери: %0"},getPluralForm(n){return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"sv":{"dictionary":{"Words: %0":"Ord: %0","Characters: %0":"Tecken: %0"},getPluralForm(n){return (n != 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"th":{"dictionary":{"Words: %0":"คำ: %0","Characters: %0":"ตัวอักษร: %0"},getPluralForm(n){return 0;}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"tk":{"dictionary":{"Words: %0":"Sözler: %0","Characters: %0":"Nyşanlar: %0"},getPluralForm(n){return (n != 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"tr":{"dictionary":{"Words: %0":"Kelimeler: %0","Characters: %0":"Karakterler: %0"},getPluralForm(n){return (n > 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"ug":{"dictionary":{"Words: %0":"سۆز: %0","Characters: %0":"ھەرپ: %0"},getPluralForm(n){return (n != 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"uk":{"dictionary":{"Words: %0":"Слова: %0","Characters: %0":"Символи: %0"},getPluralForm(n){return (n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"ur":{"dictionary":{"Words: %0":"الفاظ: 0%","Characters: %0":"حروف: 0%"},getPluralForm(n){return (n != 1);}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"vi":{"dictionary":{"Words: %0":"Số chữ: %0","Characters: %0":"Số ký tự: %0"},getPluralForm(n){return 0;}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"zh-cn":{"dictionary":{"Words: %0":"单词数:%0","Characters: %0":"字符数:%0"},getPluralForm(n){return 0;}}}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ import type { Translations } from 'ckeditor5';
7
+ declare const translations: Translations;
8
+ export default translations;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export default {"zh":{"dictionary":{"Words: %0":"字數: %0","Characters: %0":"字元數: %0"},getPluralForm(n){return 0;}}}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
@@ -1,3 +1,7 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-word-count",
3
- "version": "41.3.0-alpha.1",
3
+ "version": "41.3.0-alpha.2",
4
4
  "description": "Word and character count feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -14,7 +14,7 @@
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
16
  "lodash-es": "4.17.21",
17
- "ckeditor5": "41.3.0-alpha.1"
17
+ "ckeditor5": "41.3.0-alpha.2"
18
18
  },
19
19
  "author": "CKSource (http://cksource.com/)",
20
20
  "license": "GPL-2.0-or-later",
package/dist/index.js DELETED
@@ -1,246 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { Template, View } from '@ckeditor/ckeditor5-ui/dist/index.js';
7
- import { env } from '@ckeditor/ckeditor5-utils/dist/index.js';
8
- import { throttle, isElement } from 'lodash-es';
9
-
10
- /**
11
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
12
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
13
- */
14
- /**
15
- * Returns a plain text representation of an element and its children.
16
- *
17
- * @returns Plain text representing the model's data.
18
- */
19
- function modelElementToPlainText(item) {
20
- if (item.is('$text') || item.is('$textProxy')) {
21
- return item.data;
22
- }
23
- const element = item;
24
- let text = '';
25
- let prev = null;
26
- for (const child of element.getChildren()) {
27
- const childText = modelElementToPlainText(child);
28
- // If last block was finish, start from new line.
29
- if (prev && prev.is('element')) {
30
- text += '\n';
31
- }
32
- text += childText;
33
- prev = child;
34
- }
35
- return text;
36
- }
37
-
38
- /**
39
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
40
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
41
- */
42
- /**
43
- * The word count plugin.
44
- *
45
- * This plugin calculates all words and characters in all {@link module:engine/model/text~Text text nodes} available in the model.
46
- * It also provides an HTML element that updates its state whenever the editor content is changed.
47
- *
48
- * The model's data is first converted to plain text using {@link module:word-count/utils~modelElementToPlainText}.
49
- * The number of words and characters in your text are determined based on the created plain text. Please keep in mind
50
- * that every block in the editor is separated with a newline character, which is included in the calculation.
51
- *
52
- * Here are some examples of how the word and character calculations are made:
53
- *
54
- * ```html
55
- * <paragraph>foo</paragraph>
56
- * <paragraph>bar</paragraph>
57
- * // Words: 2, Characters: 7
58
- *
59
- * <paragraph><$text bold="true">foo</$text>bar</paragraph>
60
- * // Words: 1, Characters: 6
61
- *
62
- * <paragraph>*&^%)</paragraph>
63
- * // Words: 0, Characters: 5
64
- *
65
- * <paragraph>foo(bar)</paragraph>
66
- * //Words: 1, Characters: 8
67
- *
68
- * <paragraph>12345</paragraph>
69
- * // Words: 1, Characters: 5
70
- * ```
71
- */
72
- class WordCount extends Plugin {
73
- /**
74
- * @inheritDoc
75
- */
76
- constructor(editor) {
77
- super(editor);
78
- this.set('characters', 0);
79
- this.set('words', 0);
80
- // Don't wait for the #update event to set the value of the properties but obtain it right away.
81
- // This way, accessing the properties directly returns precise numbers, e.g. for validation, etc.
82
- // If not accessed directly, the properties will be refreshed upon #update anyway.
83
- Object.defineProperties(this, {
84
- characters: {
85
- get() {
86
- return (this.characters = this._getCharacters(this._getText()));
87
- }
88
- },
89
- words: {
90
- get() {
91
- return (this.words = this._getWords(this._getText()));
92
- }
93
- }
94
- });
95
- this.set('_wordsLabel', undefined);
96
- this.set('_charactersLabel', undefined);
97
- this._config = editor.config.get('wordCount') || {};
98
- this._outputView = undefined;
99
- this._wordsMatchRegExp = env.features.isRegExpUnicodePropertySupported ?
100
- // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).
101
- // Groups:
102
- // {L} - Any kind of letter from any language.
103
- // {N} - Any kind of numeric character in any script.
104
- new RegExp('([\\p{L}\\p{N}]+\\S?)+', 'gu') :
105
- /([a-zA-Z0-9À-ž]+\S?)+/gu;
106
- }
107
- /**
108
- * @inheritDoc
109
- */
110
- static get pluginName() {
111
- return 'WordCount';
112
- }
113
- /**
114
- * @inheritDoc
115
- */
116
- init() {
117
- const editor = this.editor;
118
- editor.model.document.on('change:data', throttle(this._refreshStats.bind(this), 250));
119
- if (typeof this._config.onUpdate == 'function') {
120
- this.on('update', (evt, data) => {
121
- this._config.onUpdate(data);
122
- });
123
- }
124
- if (isElement(this._config.container)) {
125
- this._config.container.appendChild(this.wordCountContainer);
126
- }
127
- }
128
- /**
129
- * @inheritDoc
130
- */
131
- destroy() {
132
- if (this._outputView) {
133
- this._outputView.element.remove();
134
- this._outputView.destroy();
135
- }
136
- super.destroy();
137
- }
138
- /**
139
- * Creates a self-updating HTML element. Repeated executions return the same element.
140
- * The returned element has the following HTML structure:
141
- *
142
- * ```html
143
- * <div class="ck ck-word-count">
144
- * <div class="ck-word-count__words">Words: 4</div>
145
- * <div class="ck-word-count__characters">Characters: 28</div>
146
- * </div>
147
- * ```
148
- */
149
- get wordCountContainer() {
150
- const editor = this.editor;
151
- const t = editor.t;
152
- const displayWords = editor.config.get('wordCount.displayWords');
153
- const displayCharacters = editor.config.get('wordCount.displayCharacters');
154
- const bind = Template.bind(this, this);
155
- const children = [];
156
- if (!this._outputView) {
157
- this._outputView = new View();
158
- if (displayWords || displayWords === undefined) {
159
- this.bind('_wordsLabel').to(this, 'words', words => {
160
- return t('Words: %0', words);
161
- });
162
- children.push({
163
- tag: 'div',
164
- children: [
165
- {
166
- text: [bind.to('_wordsLabel')]
167
- }
168
- ],
169
- attributes: {
170
- class: 'ck-word-count__words'
171
- }
172
- });
173
- }
174
- if (displayCharacters || displayCharacters === undefined) {
175
- this.bind('_charactersLabel').to(this, 'characters', words => {
176
- return t('Characters: %0', words);
177
- });
178
- children.push({
179
- tag: 'div',
180
- children: [
181
- {
182
- text: [bind.to('_charactersLabel')]
183
- }
184
- ],
185
- attributes: {
186
- class: 'ck-word-count__characters'
187
- }
188
- });
189
- }
190
- this._outputView.setTemplate({
191
- tag: 'div',
192
- attributes: {
193
- class: [
194
- 'ck',
195
- 'ck-word-count'
196
- ]
197
- },
198
- children
199
- });
200
- this._outputView.render();
201
- }
202
- return this._outputView.element;
203
- }
204
- _getText() {
205
- let txt = '';
206
- for (const root of this.editor.model.document.getRoots()) {
207
- if (txt !== '') {
208
- // Add a delimiter, so words from each root are treated independently.
209
- txt += '\n';
210
- }
211
- txt += modelElementToPlainText(root);
212
- }
213
- return txt;
214
- }
215
- /**
216
- * Determines the number of characters in the current editor's model.
217
- */
218
- _getCharacters(txt) {
219
- return txt.replace(/\n/g, '').length;
220
- }
221
- /**
222
- * Determines the number of words in the current editor's model.
223
- */
224
- _getWords(txt) {
225
- const detectedWords = txt.match(this._wordsMatchRegExp) || [];
226
- return detectedWords.length;
227
- }
228
- /**
229
- * Determines the number of words and characters in the current editor's model and assigns it to {@link #characters} and {@link #words}.
230
- * It also fires the {@link #event:update}.
231
- *
232
- * @fires update
233
- */
234
- _refreshStats() {
235
- const txt = this._getText();
236
- const words = this.words = this._getWords(txt);
237
- const characters = this.characters = this._getCharacters(txt);
238
- this.fire('update', {
239
- words,
240
- characters
241
- });
242
- }
243
- }
244
-
245
- export { WordCount };
246
- //# sourceMappingURL=index.js.map