@ckbox/i18n 2.0.0 → 2.1.0-rc.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 +3 -3
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Using a build served from the CDN is the simplest and fastest way of embedding C
|
|
|
12
12
|
To start using CKBox on your website, embed the following `script` element in the HTML code of the page:
|
|
13
13
|
|
|
14
14
|
```html
|
|
15
|
-
<script src="https://cdn.ckbox.io/ckbox/2.0.0/ckbox.js"></script>
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/2.1.0-rc.0/ckbox.js"></script>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Quick implementation example:
|
|
@@ -22,7 +22,7 @@ Quick implementation example:
|
|
|
22
22
|
<html>
|
|
23
23
|
<head>
|
|
24
24
|
<meta charset="UTF-8" />
|
|
25
|
-
<script src="https://cdn.ckbox.io/ckbox/2.0.0/ckbox.js"></script>
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/2.1.0-rc.0/ckbox.js"></script>
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
28
28
|
<div id="ckbox"></div>
|
|
@@ -48,7 +48,7 @@ The code snippet below presents the simplest scenario for integration of CKEdito
|
|
|
48
48
|
<head>
|
|
49
49
|
<meta charset="UTF-8" />
|
|
50
50
|
<script src="https://cdn.ckeditor.com/ckeditor5/36.0.0/classic/ckeditor.js"></script>
|
|
51
|
-
<script src="https://cdn.ckbox.io/ckbox/2.0.0/ckbox.js"></script>
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/2.1.0-rc.0/ckbox.js"></script>
|
|
52
52
|
</head>
|
|
53
53
|
<body>
|
|
54
54
|
<div id="editor"></div>
|
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 _0x119d6a=_0x4360;(function(_0x2e30a9,_0x399e22){const _0x2fa837=_0x4360,_0x261571=_0x2e30a9();while(!![]){try{const _0x2fe1d4=parseInt(_0x2fa837(0x13c))/0x1+parseInt(_0x2fa837(0x141))/0x2+-parseInt(_0x2fa837(0x151))/0x3*(-parseInt(_0x2fa837(0x159))/0x4)+parseInt(_0x2fa837(0x13f))/0x5+-parseInt(_0x2fa837(0x153))/0x6+parseInt(_0x2fa837(0x162))/0x7+parseInt(_0x2fa837(0x139))/0x8*(-parseInt(_0x2fa837(0x148))/0x9);if(_0x2fe1d4===_0x399e22)break;else _0x261571['push'](_0x261571['shift']());}catch(_0x1cd779){_0x261571['push'](_0x261571['shift']());}}}(_0x2d98,0x76d44));import*as _0xc422a from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x594f60){const _0x4962a4=_0x4360;this['lang']=_0x594f60;try{this['_rules']=new Intl['PluralRules'](_0x594f60);}catch(_0x4a5e93){console[_0x4962a4(0x150)](_0x4962a4(0x157));}}[_0x119d6a(0x138)](_0x48fa0b,_0x41f4eb){const _0x13bcd3=_0x119d6a;if(!this[_0x13bcd3(0x143)])return _0x48fa0b+_0x13bcd3(0x14d);const _0xaa9be0=this[_0x13bcd3(0x143)][_0x13bcd3(0x158)](_0x41f4eb);return _0x48fa0b+'_'+_0xaa9be0;}}Plural[_0x119d6a(0x14c)]=_0x2f4456=>{const _0x17708a=_0x119d6a;try{return Intl['PluralRules'][_0x17708a(0x14e)]([_0x2f4456])[_0x17708a(0x13a)]>0x0;}catch(_0x5885f0){return![];}};const I18nContext=_0xc422a['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x208a13,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x21af0f=_0x119d6a;return _0xc422a[_0x21af0f(0x13e)](()=>{const _0x83594c=_0x21af0f,_0xfb9856=Plural[_0x83594c(0x14c)](lang);!_0xfb9856&&console[_0x83594c(0x150)](_0x83594c(0x15f)+lang+_0x83594c(0x15c));},[lang]),_0xc422a[_0x21af0f(0x13b)](I18nContext[_0x21af0f(0x146)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x208a13);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x119d6a(0x14f),_0x119d6a(0x15d)],getMsg=(_0xad254c,_0x201539={},_0x1b4ba4)=>{const _0x4b71fa=_0x119d6a,_0x30f49a=_0x1b4ba4[_0x4b71fa(0x147)];if(_0x201539[_0xad254c]&&_0x30f49a===undefined)return{'found':!![],'msg':_0x201539[_0xad254c]};const _0x35299f=Object[_0x4b71fa(0x15e)](_0x201539)[_0x4b71fa(0x14b)](_0x5b0de1=>_0x5b0de1[_0x4b71fa(0x140)](_0xad254c)===0x0);if(_0x35299f[_0x4b71fa(0x13a)]===0x0||_0x30f49a===undefined)return{'found':![],'msg':_0xad254c};const _0x204ef6=_0x1b4ba4[_0x4b71fa(0x15a)]['getKey'](_0xad254c,_0x30f49a);return{'found':!![],'msg':_0x201539[_0x204ef6]};},parseMsgTags=_0x5e0c4b=>{const _0x165029=_0x119d6a,_0x452ce9=[];let _0x44fbaa=0x0,_0x360de1;while((_0x360de1=TAG_REGEX['exec'](_0x5e0c4b))!==null){const _0x325720=_0x360de1[0x0],{index:_0x33ad69}=_0x360de1,_0x2c1d9e=_0x325720[_0x165029(0x13d)](0x1)==='/',_0x2acdc4=_0x2c1d9e?_0x325720['slice'](0x2,-0x1):_0x325720[_0x165029(0x160)](0x1,-0x1),_0x1ad208=ALLOWED_TAGS['includes'](_0x2acdc4);if(!_0x1ad208)continue;const _0x236fcc=_0x5e0c4b[_0x165029(0x160)](_0x44fbaa,_0x33ad69);if(!_0x236fcc){_0x44fbaa=_0x33ad69+_0x325720[_0x165029(0x13a)];continue;}_0x2c1d9e?_0x452ce9[_0x165029(0x14a)]({'type':_0x165029(0x144),'name':_0x325720[_0x165029(0x160)](0x2,-0x1),'content':_0x236fcc}):_0x452ce9[_0x165029(0x14a)]({'type':'text','content':_0x236fcc}),_0x44fbaa=_0x33ad69+_0x325720['length'];}return _0x44fbaa<_0x5e0c4b[_0x165029(0x13a)]&&_0x452ce9[_0x165029(0x14a)]({'type':_0x165029(0x156),'content':_0x5e0c4b[_0x165029(0x160)](_0x44fbaa)}),_0x452ce9;};function formatMsgWithTags(_0x351465){const _0x5724fe=_0x119d6a,_0x434d7e=parseMsgTags(_0x351465),_0x270c45=_0x434d7e[_0x5724fe(0x149)](({content:_0x56546d,type:_0x16ea3f,name:_0x201743},_0x1e61b9)=>{const _0xeeda28=_0x5724fe,_0x55b3c8=_0x16ea3f!=='text'&&_0x201743?_0x201743:_0xc422a[_0xeeda28(0x142)];return _0xc422a['createElement'](_0x55b3c8,{'key':''+_0x1e61b9},_0x56546d);});return _0x270c45;}function formatMsg(_0x3b4379,_0x324189,_0x1273a6){const _0xe4e6e9=sprintf(_0x3b4379,..._0x324189!==null&&_0x324189!==void 0x0?_0x324189:[]);if(!_0x1273a6)return _0xe4e6e9;return formatMsgWithTags(_0xe4e6e9);}function _0x4360(_0x555e7e,_0x2651d8){const _0x2d9897=_0x2d98();return _0x4360=function(_0x4360cf,_0x40afbc){_0x4360cf=_0x4360cf-0x138;let _0xb4f0fd=_0x2d9897[_0x4360cf];return _0xb4f0fd;},_0x4360(_0x555e7e,_0x2651d8);}const useTranslation=()=>{const _0x44edc5=_0x119d6a,{lang:_0x1326fc,debug:_0x5f3b72,pluralUtils:_0x5332ad,resources:_0x4b32fa}=_0xc422a[_0x44edc5(0x15b)](I18nContext);function _0x8106b7(_0x2d17c4,_0x5e74d4){const _0x343b33=_0x44edc5,{found:_0x446483,msg:_0x36b9ef}=getMsg(_0x2d17c4,_0x4b32fa[_0x1326fc],{'plural':_0x5e74d4===null||_0x5e74d4===void 0x0?void 0x0:_0x5e74d4[_0x343b33(0x147)],'pluralUtils':_0x5332ad});_0x5f3b72&&!_0x446483&&console[_0x343b33(0x155)]('['+_0x1326fc+_0x343b33(0x161)+_0x2d17c4+_0x343b33(0x152));if(_0x5e74d4===null||_0x5e74d4===void 0x0?void 0x0:_0x5e74d4[_0x343b33(0x154)])return formatMsg(_0x36b9ef,_0x5e74d4===null||_0x5e74d4===void 0x0?void 0x0:_0x5e74d4['values'],!![]);return formatMsg(_0x36b9ef,_0x5e74d4===null||_0x5e74d4===void 0x0?void 0x0:_0x5e74d4[_0x343b33(0x145)],![]);}return{'t':_0x8106b7,'lang':_0x1326fc};};function _0x2d98(){const _0x5c39a9=['9868xcmhbJ','pluralUtils','useContext','\x22\x20is\x20not\x20supported.','code','keys','Plural\x20form\x20for\x20language\x20\x22','slice',']:\x20Translation\x20for\x20key\x20\x27','1694210JUnDFE','getKey','16KfnbhD','length','createElement','512666xpkpQC','charAt','useEffect','3727140RxqRtd','indexOf','202364yTzfZA','Fragment','_rules','tag','values','Provider','plural','3711222CyBhNE','map','push','filter','isSupported','_one','supportedLocalesOf','strong','warn','624vrunwR','\x27\x20is\x20missing.','4818012xvHlWw','processTags','log','text','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','select'];_0x2d98=function(){return _0x5c39a9;};return _0x2d98();}export{I18nContext,I18nProvider,useTranslation};
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
22
22
|
"name": "@ckbox/i18n",
|
|
23
|
-
"version": "2.0.0",
|
|
23
|
+
"version": "2.1.0-rc.0",
|
|
24
24
|
"description": "I18n utils of CKBox",
|
|
25
25
|
"main": "dist/index.js",
|
|
26
26
|
"types": "dist/index.d.ts",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"sprintf-js": "^1.1.2",
|
|
32
|
-
"tslib": "^2.6.
|
|
32
|
+
"tslib": "^2.6.2"
|
|
33
33
|
}
|
|
34
34
|
}
|