@ckbox/i18n 2.10.1 → 2.11.0-rc.1
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.11.0-rc.1/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.11.0-rc.1/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.11.0-rc.1/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.11.0-rc.1/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 _0x7d9d4d=_0x1883;(function(_0x279e70,_0x218ad8){const _0x5d1051=_0x1883,_0xa20f1=_0x279e70();while(!![]){try{const _0x5deefd=parseInt(_0x5d1051(0x12a))/0x1+parseInt(_0x5d1051(0x11e))/0x2+parseInt(_0x5d1051(0x11c))/0x3+parseInt(_0x5d1051(0x115))/0x4+parseInt(_0x5d1051(0x129))/0x5*(-parseInt(_0x5d1051(0x11a))/0x6)+parseInt(_0x5d1051(0x12f))/0x7+-parseInt(_0x5d1051(0x131))/0x8;if(_0x5deefd===_0x218ad8)break;else _0xa20f1['push'](_0xa20f1['shift']());}catch(_0x935706){_0xa20f1['push'](_0xa20f1['shift']());}}}(_0x46fd,0xacd31));import*as _0x590c5a from'react';import{sprintf}from'sprintf-js';function _0x1883(_0x1744f4,_0x4d907f){_0x1744f4=_0x1744f4-0x115;const _0x46fd11=_0x46fd();let _0x188343=_0x46fd11[_0x1744f4];return _0x188343;}class Plural{constructor(_0x5093c8){const _0x65a86b=_0x1883;this[_0x65a86b(0x120)]=_0x5093c8;try{this['_rules']=new Intl[(_0x65a86b(0x127))](_0x5093c8);}catch(_0x36e117){console[_0x65a86b(0x128)](_0x65a86b(0x139));}}[_0x7d9d4d(0x126)](_0x4d601f,_0x3d8f70){const _0x24b3fa=_0x7d9d4d;if(!this[_0x24b3fa(0x13c)])return _0x4d601f+'_one';const _0x3560a8=this[_0x24b3fa(0x13c)][_0x24b3fa(0x132)](_0x3d8f70);return _0x4d601f+'_'+_0x3560a8;}}function _0x46fd(){const _0x568f44=[']:\x20Translation\x20for\x20key\x20\x27','map','strong','913656qPlwML','log','3526527SJBtaV','tag','836422FRHDll','push','lang','Plural\x20form\x20for\x20language\x20\x22','plural','useEffect','Provider','filter','getKey','PluralRules','warn','25ySivtK','83985BnxolI','supportedLocalesOf','exec','includes','code','3319596HyUiSm','slice','13475680XSORYl','select','\x27\x20is\x20missing.','values','\x22\x20is\x20not\x20supported.','createElement','text','length','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','pluralUtils','isSupported','_rules','4007184jnhoXL','indexOf'];_0x46fd=function(){return _0x568f44;};return _0x46fd();}Plural[_0x7d9d4d(0x13b)]=_0x4de96c=>{const _0x3be8fb=_0x7d9d4d;try{return Intl['PluralRules'][_0x3be8fb(0x12b)]([_0x4de96c])[_0x3be8fb(0x138)]>0x0;}catch(_0x536f7f){return![];}};const I18nContext=_0x590c5a['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x448482,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x3cb011=_0x7d9d4d;return _0x590c5a[_0x3cb011(0x123)](()=>{const _0x22ab53=_0x3cb011,_0x5d6872=Plural[_0x22ab53(0x13b)](lang);!_0x5d6872&&console[_0x22ab53(0x128)](_0x22ab53(0x121)+lang+_0x22ab53(0x135));},[lang]),_0x590c5a['createElement'](I18nContext[_0x3cb011(0x124)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x448482);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x7d9d4d(0x119),_0x7d9d4d(0x12e)],getMsg=(_0x33f384,_0x1f34e3={},_0x5a8c0e)=>{const _0x183d6b=_0x7d9d4d,_0x1dd4d3=_0x5a8c0e['plural'];if(_0x1f34e3[_0x33f384]&&_0x1dd4d3===undefined)return{'found':!![],'msg':_0x1f34e3[_0x33f384]};const _0x4041f3=Object['keys'](_0x1f34e3)[_0x183d6b(0x125)](_0x246e8d=>_0x246e8d[_0x183d6b(0x116)](_0x33f384)===0x0);if(_0x4041f3['length']===0x0||_0x1dd4d3===undefined)return{'found':![],'msg':_0x33f384};const _0x22fb92=_0x5a8c0e[_0x183d6b(0x13a)][_0x183d6b(0x126)](_0x33f384,_0x1dd4d3);return{'found':!![],'msg':_0x1f34e3[_0x22fb92]};},parseMsgTags=_0x4ae1ca=>{const _0x5807a1=_0x7d9d4d,_0x520610=[];let _0xc6a898=0x0,_0x1e8cc1;while((_0x1e8cc1=TAG_REGEX[_0x5807a1(0x12c)](_0x4ae1ca))!==null){const _0x3d5448=_0x1e8cc1[0x0],{index:_0x178362}=_0x1e8cc1,_0x3f6a6e=_0x3d5448['charAt'](0x1)==='/',_0x7a2494=_0x3f6a6e?_0x3d5448[_0x5807a1(0x130)](0x2,-0x1):_0x3d5448[_0x5807a1(0x130)](0x1,-0x1),_0xae585f=ALLOWED_TAGS[_0x5807a1(0x12d)](_0x7a2494);if(!_0xae585f)continue;const _0x52c8c6=_0x4ae1ca['slice'](_0xc6a898,_0x178362);if(!_0x52c8c6){_0xc6a898=_0x178362+_0x3d5448['length'];continue;}_0x3f6a6e?_0x520610[_0x5807a1(0x11f)]({'type':_0x5807a1(0x11d),'name':_0x3d5448[_0x5807a1(0x130)](0x2,-0x1),'content':_0x52c8c6}):_0x520610[_0x5807a1(0x11f)]({'type':_0x5807a1(0x137),'content':_0x52c8c6}),_0xc6a898=_0x178362+_0x3d5448[_0x5807a1(0x138)];}return _0xc6a898<_0x4ae1ca['length']&&_0x520610[_0x5807a1(0x11f)]({'type':_0x5807a1(0x137),'content':_0x4ae1ca['slice'](_0xc6a898)}),_0x520610;};function formatMsgWithTags(_0x371f23){const _0x7b2ce4=_0x7d9d4d,_0x4c9d0f=parseMsgTags(_0x371f23),_0xef966b=_0x4c9d0f[_0x7b2ce4(0x118)](({content:_0x4427bc,type:_0x4c2c9e,name:_0x5bce8c},_0x3523ed)=>{const _0x478d69=_0x7b2ce4,_0xb185b8=_0x4c2c9e!==_0x478d69(0x137)&&_0x5bce8c?_0x5bce8c:_0x590c5a['Fragment'];return _0x590c5a[_0x478d69(0x136)](_0xb185b8,{'key':''+_0x3523ed},_0x4427bc);});return _0xef966b;}function formatMsg(_0x124868,_0x1e0173,_0x58ac0c){const _0x57177c=sprintf(_0x124868,..._0x1e0173!==null&&_0x1e0173!==void 0x0?_0x1e0173:[]);if(!_0x58ac0c)return _0x57177c;return formatMsgWithTags(_0x57177c);}const useTranslation=()=>{const {lang:_0x347823,debug:_0xb2f7db,pluralUtils:_0x12a1eb,resources:_0xe30cd9}=_0x590c5a['useContext'](I18nContext);function _0x16aab5(_0x369596,_0x28418c){const _0x13edaa=_0x1883,{found:_0x831642,msg:_0x353c75}=getMsg(_0x369596,_0xe30cd9[_0x347823],{'plural':_0x28418c===null||_0x28418c===void 0x0?void 0x0:_0x28418c[_0x13edaa(0x122)],'pluralUtils':_0x12a1eb});_0xb2f7db&&!_0x831642&&console[_0x13edaa(0x11b)]('['+_0x347823+_0x13edaa(0x117)+_0x369596+_0x13edaa(0x133));if(_0x28418c===null||_0x28418c===void 0x0?void 0x0:_0x28418c['processTags'])return formatMsg(_0x353c75,_0x28418c===null||_0x28418c===void 0x0?void 0x0:_0x28418c[_0x13edaa(0x134)],!![]);return formatMsg(_0x353c75,_0x28418c===null||_0x28418c===void 0x0?void 0x0:_0x28418c['values'],![]);}return{'t':_0x16aab5,'lang':_0x347823};};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.11.0-rc.1",
|
|
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": "^4.0.
|
|
33
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
34
34
|
"sprintf-js": "^1.1.3",
|
|
35
35
|
"tslib": "^2.8.1",
|
|
36
|
-
"vitest": "^4.0.
|
|
36
|
+
"vitest": "^4.0.18"
|
|
37
37
|
}
|
|
38
38
|
}
|