@ckbox/i18n 2.9.2 → 2.10.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/README.md +4 -4
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Using a build served from the CDN is the simplest and fastest way of embedding C
|
|
|
13
13
|
To start using CKBox on your website, embed the following `script` element in the HTML code of the page:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
|
-
<script src="https://cdn.ckbox.io/ckbox/2.
|
|
16
|
+
<script src="https://cdn.ckbox.io/ckbox/2.10.0/ckbox.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Quick implementation example:
|
|
@@ -23,7 +23,7 @@ Quick implementation example:
|
|
|
23
23
|
<html>
|
|
24
24
|
<head>
|
|
25
25
|
<meta charset="UTF-8" />
|
|
26
|
-
<script src="https://cdn.ckbox.io/ckbox/2.
|
|
26
|
+
<script src="https://cdn.ckbox.io/ckbox/2.10.0/ckbox.js"></script>
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<div id="ckbox"></div>
|
|
@@ -48,10 +48,10 @@ The code snippet below presents the simplest scenario for integration of CKEdito
|
|
|
48
48
|
<html>
|
|
49
49
|
<head>
|
|
50
50
|
<meta charset="UTF-8" />
|
|
51
|
-
<script src="https://cdn.ckbox.io/ckbox/2.
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/2.10.0/ckbox.js"></script>
|
|
52
52
|
<link
|
|
53
53
|
rel="stylesheet"
|
|
54
|
-
href="https://cdn.ckbox.io/ckbox/2.
|
|
54
|
+
href="https://cdn.ckbox.io/ckbox/2.10.0/styles/themes/lark.css"
|
|
55
55
|
/>
|
|
56
56
|
<link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/42.0.0/ckeditor5.css" />
|
|
57
57
|
</head>
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
const
|
|
4
|
+
const _0x506ded=_0x165a;(function(_0x517915,_0x525654){const _0x487f96=_0x165a,_0x37cc64=_0x517915();while(!![]){try{const _0xa47e8f=parseInt(_0x487f96(0xf3))/0x1+parseInt(_0x487f96(0xfb))/0x2+parseInt(_0x487f96(0xf6))/0x3+-parseInt(_0x487f96(0xf9))/0x4+-parseInt(_0x487f96(0xe1))/0x5*(-parseInt(_0x487f96(0xeb))/0x6)+-parseInt(_0x487f96(0xde))/0x7+parseInt(_0x487f96(0xee))/0x8;if(_0xa47e8f===_0x525654)break;else _0x37cc64['push'](_0x37cc64['shift']());}catch(_0x11921f){_0x37cc64['push'](_0x37cc64['shift']());}}}(_0x21ec,0x7ec0c));import*as _0x201643 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x5d0f3b){const _0x89fa84=_0x165a;this['lang']=_0x5d0f3b;try{this[_0x89fa84(0x103)]=new Intl['PluralRules'](_0x5d0f3b);}catch(_0x563874){console['warn']('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}['getKey'](_0xb6a908,_0x520375){const _0x24772b=_0x165a;if(!this['_rules'])return _0xb6a908+'_one';const _0x30f87d=this['_rules'][_0x24772b(0xe9)](_0x520375);return _0xb6a908+'_'+_0x30f87d;}}Plural['isSupported']=_0x5c336f=>{const _0x583d7a=_0x165a;try{return Intl[_0x583d7a(0xe8)][_0x583d7a(0xf4)]([_0x5c336f])[_0x583d7a(0x101)]>0x0;}catch(_0x563bce){return![];}};const I18nContext=_0x201643[_0x506ded(0xe4)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x31d16a,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x403def=_0x506ded;return _0x201643[_0x403def(0xf8)](()=>{const _0xa64567=_0x403def,_0x37371b=Plural['isSupported'](lang);!_0x37371b&&console[_0xa64567(0xfd)]('Plural\x20form\x20for\x20language\x20\x22'+lang+_0xa64567(0xff));},[lang]),_0x201643['createElement'](I18nContext[_0x403def(0xfc)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x31d16a);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x506ded(0xf1),_0x506ded(0xef)],getMsg=(_0x407c9f,_0x582742={},_0x194c8a)=>{const _0xd02988=_0x506ded,_0x5b7ce3=_0x194c8a[_0xd02988(0x100)];if(_0x582742[_0x407c9f]&&_0x5b7ce3===undefined)return{'found':!![],'msg':_0x582742[_0x407c9f]};const _0x2ef7f2=Object[_0xd02988(0xe3)](_0x582742)[_0xd02988(0xe2)](_0x125249=>_0x125249[_0xd02988(0xec)](_0x407c9f)===0x0);if(_0x2ef7f2['length']===0x0||_0x5b7ce3===undefined)return{'found':![],'msg':_0x407c9f};const _0x3239ca=_0x194c8a[_0xd02988(0xe5)]['getKey'](_0x407c9f,_0x5b7ce3);return{'found':!![],'msg':_0x582742[_0x3239ca]};},parseMsgTags=_0x36c7ca=>{const _0x250be1=_0x506ded,_0x17932c=[];let _0x4137be=0x0,_0x1112f4;while((_0x1112f4=TAG_REGEX[_0x250be1(0xed)](_0x36c7ca))!==null){const _0x6baf08=_0x1112f4[0x0],{index:_0x3e2ab1}=_0x1112f4,_0x1fb052=_0x6baf08[_0x250be1(0xf0)](0x1)==='/',_0x2cfa67=_0x1fb052?_0x6baf08[_0x250be1(0xf7)](0x2,-0x1):_0x6baf08[_0x250be1(0xf7)](0x1,-0x1),_0x279a2b=ALLOWED_TAGS[_0x250be1(0xe6)](_0x2cfa67);if(!_0x279a2b)continue;const _0x118684=_0x36c7ca[_0x250be1(0xf7)](_0x4137be,_0x3e2ab1);if(!_0x118684){_0x4137be=_0x3e2ab1+_0x6baf08[_0x250be1(0x101)];continue;}_0x1fb052?_0x17932c[_0x250be1(0x102)]({'type':_0x250be1(0xf5),'name':_0x6baf08[_0x250be1(0xf7)](0x2,-0x1),'content':_0x118684}):_0x17932c[_0x250be1(0x102)]({'type':'text','content':_0x118684}),_0x4137be=_0x3e2ab1+_0x6baf08[_0x250be1(0x101)];}return _0x4137be<_0x36c7ca[_0x250be1(0x101)]&&_0x17932c[_0x250be1(0x102)]({'type':_0x250be1(0xe0),'content':_0x36c7ca[_0x250be1(0xf7)](_0x4137be)}),_0x17932c;};function _0x165a(_0x10239d,_0x3c2237){_0x10239d=_0x10239d-0xde;const _0x21ec87=_0x21ec();let _0x165a90=_0x21ec87[_0x10239d];return _0x165a90;}function formatMsgWithTags(_0x3f2c1a){const _0x744cba=_0x506ded,_0x3cf6fc=parseMsgTags(_0x3f2c1a),_0x285124=_0x3cf6fc[_0x744cba(0xfa)](({content:_0x369209,type:_0x202c00,name:_0x4e72da},_0x58b9fb)=>{const _0x18073b=_0x744cba,_0x1aaaf7=_0x202c00!=='text'&&_0x4e72da?_0x4e72da:_0x201643[_0x18073b(0xe7)];return _0x201643[_0x18073b(0xf2)](_0x1aaaf7,{'key':''+_0x58b9fb},_0x369209);});return _0x285124;}function formatMsg(_0x1459c5,_0x109f51,_0x5afe29){const _0xe32041=sprintf(_0x1459c5,..._0x109f51!==null&&_0x109f51!==void 0x0?_0x109f51:[]);if(!_0x5afe29)return _0xe32041;return formatMsgWithTags(_0xe32041);}function _0x21ec(){const _0x30f734=['push','_rules','6894076mqaEpC','\x27\x20is\x20missing.','text','25NhOrNk','filter','keys','createContext','pluralUtils','includes','Fragment','PluralRules','select','values','474522AsyBRR','indexOf','exec','3003832OAVlZZ','code','charAt','strong','createElement','76873qexPNX','supportedLocalesOf','tag','1984263fuDuiY','slice','useEffect','3748532DjjrxO','map','1863946eJPzXh','Provider','warn',']:\x20Translation\x20for\x20key\x20\x27','\x22\x20is\x20not\x20supported.','plural','length'];_0x21ec=function(){return _0x30f734;};return _0x21ec();}const useTranslation=()=>{const {lang:_0x44d5be,debug:_0x556de2,pluralUtils:_0x105a4b,resources:_0x1e91e3}=_0x201643['useContext'](I18nContext);function _0x19a6d2(_0x42c2cb,_0x2d3c9f){const _0x243265=_0x165a,{found:_0x730acb,msg:_0x56ee99}=getMsg(_0x42c2cb,_0x1e91e3[_0x44d5be],{'plural':_0x2d3c9f===null||_0x2d3c9f===void 0x0?void 0x0:_0x2d3c9f[_0x243265(0x100)],'pluralUtils':_0x105a4b});_0x556de2&&!_0x730acb&&console['log']('['+_0x44d5be+_0x243265(0xfe)+_0x42c2cb+_0x243265(0xdf));if(_0x2d3c9f===null||_0x2d3c9f===void 0x0?void 0x0:_0x2d3c9f['processTags'])return formatMsg(_0x56ee99,_0x2d3c9f===null||_0x2d3c9f===void 0x0?void 0x0:_0x2d3c9f['values'],!![]);return formatMsg(_0x56ee99,_0x2d3c9f===null||_0x2d3c9f===void 0x0?void 0x0:_0x2d3c9f[_0x243265(0xea)],![]);}return{'t':_0x19a6d2,'lang':_0x44d5be};};export{I18nContext,I18nProvider,useTranslation};
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
24
|
"name": "@ckbox/i18n",
|
|
25
|
-
"version": "2.
|
|
25
|
+
"version": "2.10.0",
|
|
26
26
|
"description": "I18n utils of CKBox",
|
|
27
27
|
"main": "dist/index.js",
|
|
28
28
|
"types": "dist/index.d.ts",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"react": "^19"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@vitest/coverage-v8": "^
|
|
33
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
34
34
|
"sprintf-js": "^1.1.3",
|
|
35
35
|
"tslib": "^2.8.1",
|
|
36
|
-
"vitest": "^
|
|
36
|
+
"vitest": "^4.0.17"
|
|
37
37
|
}
|
|
38
38
|
}
|