@ckbox/i18n 2.9.1 → 2.10.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 +4 -4
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-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.10.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.10.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.10.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
|
-
|
|
4
|
+
const _0x34a91f=_0x1410;(function(_0x11c439,_0x29135f){const _0x504404=_0x1410,_0x37161d=_0x11c439();while(!![]){try{const _0x34be65=parseInt(_0x504404(0x8f))/0x1*(-parseInt(_0x504404(0x75))/0x2)+parseInt(_0x504404(0x89))/0x3*(-parseInt(_0x504404(0x79))/0x4)+parseInt(_0x504404(0x76))/0x5+-parseInt(_0x504404(0x90))/0x6+parseInt(_0x504404(0x9a))/0x7+parseInt(_0x504404(0x82))/0x8*(-parseInt(_0x504404(0x99))/0x9)+parseInt(_0x504404(0x95))/0xa;if(_0x34be65===_0x29135f)break;else _0x37161d['push'](_0x37161d['shift']());}catch(_0x9dc125){_0x37161d['push'](_0x37161d['shift']());}}}(_0x23c4,0xa7624));function _0x23c4(){const _0x2a9cfd=['useEffect','slice','15615qRgSlQ','726635HRPQeT','createElement','PluralRules','2NPFEbW','153545nrCrLp','getKey','lang','4wYOoCR','_rules','Plural\x20form\x20for\x20language\x20\x22','keys','warn','\x22\x20is\x20not\x20supported.','push','isSupported','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','1448BjtWJH','charAt','filter','processTags','map','\x27\x20is\x20missing.','useContext','401736CYkLVv','text','values','pluralUtils','select','_one','156859KNTvyN','4004220ZwTFko','supportedLocalesOf','indexOf','plural','length','18232660VemunO','log'];_0x23c4=function(){return _0x2a9cfd;};return _0x23c4();}import*as _0x19f3d7 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x2b4602){const _0x38c0aa=_0x1410;this[_0x38c0aa(0x78)]=_0x2b4602;try{this[_0x38c0aa(0x7a)]=new Intl[(_0x38c0aa(0x9c))](_0x2b4602);}catch(_0x7331e0){console[_0x38c0aa(0x7d)](_0x38c0aa(0x81));}}[_0x34a91f(0x77)](_0x2c9ade,_0x3ff5c1){const _0x13e548=_0x34a91f;if(!this[_0x13e548(0x7a)])return _0x2c9ade+_0x13e548(0x8e);const _0x36f505=this[_0x13e548(0x7a)][_0x13e548(0x8d)](_0x3ff5c1);return _0x2c9ade+'_'+_0x36f505;}}Plural[_0x34a91f(0x80)]=_0x7ad15b=>{const _0x4ef764=_0x34a91f;try{return Intl['PluralRules'][_0x4ef764(0x91)]([_0x7ad15b])['length']>0x0;}catch(_0x499dd2){return![];}};const I18nContext=_0x19f3d7['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x7478be,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x5f4666=_0x34a91f;return _0x19f3d7[_0x5f4666(0x97)](()=>{const _0x54a1ad=_0x5f4666,_0x1e5c58=Plural[_0x54a1ad(0x80)](lang);!_0x1e5c58&&console[_0x54a1ad(0x7d)](_0x54a1ad(0x7b)+lang+_0x54a1ad(0x7e));},[lang]),_0x19f3d7[_0x5f4666(0x9b)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x7478be);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em','strong','code'],getMsg=(_0x7c701f,_0x27eb95={},_0x242f84)=>{const _0x494847=_0x34a91f,_0x49d045=_0x242f84[_0x494847(0x93)];if(_0x27eb95[_0x7c701f]&&_0x49d045===undefined)return{'found':!![],'msg':_0x27eb95[_0x7c701f]};const _0x1e2707=Object[_0x494847(0x7c)](_0x27eb95)[_0x494847(0x84)](_0x359afa=>_0x359afa[_0x494847(0x92)](_0x7c701f)===0x0);if(_0x1e2707[_0x494847(0x94)]===0x0||_0x49d045===undefined)return{'found':![],'msg':_0x7c701f};const _0xe88821=_0x242f84[_0x494847(0x8c)][_0x494847(0x77)](_0x7c701f,_0x49d045);return{'found':!![],'msg':_0x27eb95[_0xe88821]};},parseMsgTags=_0xd7461e=>{const _0x107a03=_0x34a91f,_0x47bdbc=[];let _0x440f03=0x0,_0x256898;while((_0x256898=TAG_REGEX['exec'](_0xd7461e))!==null){const _0x133467=_0x256898[0x0],{index:_0xf47232}=_0x256898,_0x378d5a=_0x133467[_0x107a03(0x83)](0x1)==='/',_0x577dd1=_0x378d5a?_0x133467[_0x107a03(0x98)](0x2,-0x1):_0x133467[_0x107a03(0x98)](0x1,-0x1),_0x38f6cc=ALLOWED_TAGS['includes'](_0x577dd1);if(!_0x38f6cc)continue;const _0x52f08c=_0xd7461e[_0x107a03(0x98)](_0x440f03,_0xf47232);if(!_0x52f08c){_0x440f03=_0xf47232+_0x133467[_0x107a03(0x94)];continue;}_0x378d5a?_0x47bdbc[_0x107a03(0x7f)]({'type':'tag','name':_0x133467[_0x107a03(0x98)](0x2,-0x1),'content':_0x52f08c}):_0x47bdbc[_0x107a03(0x7f)]({'type':'text','content':_0x52f08c}),_0x440f03=_0xf47232+_0x133467[_0x107a03(0x94)];}return _0x440f03<_0xd7461e[_0x107a03(0x94)]&&_0x47bdbc['push']({'type':_0x107a03(0x8a),'content':_0xd7461e[_0x107a03(0x98)](_0x440f03)}),_0x47bdbc;};function formatMsgWithTags(_0x123776){const _0x5d5db3=_0x34a91f,_0x1ce63f=parseMsgTags(_0x123776),_0x3e7677=_0x1ce63f[_0x5d5db3(0x86)](({content:_0x323b48,type:_0x2aee03,name:_0x32f6c6},_0x6ac03c)=>{const _0x39e4ab=_0x5d5db3,_0x18561a=_0x2aee03!==_0x39e4ab(0x8a)&&_0x32f6c6?_0x32f6c6:_0x19f3d7['Fragment'];return _0x19f3d7[_0x39e4ab(0x9b)](_0x18561a,{'key':''+_0x6ac03c},_0x323b48);});return _0x3e7677;}function formatMsg(_0x2b9389,_0x3d50f4,_0x228294){const _0x5b2ac2=sprintf(_0x2b9389,..._0x3d50f4!==null&&_0x3d50f4!==void 0x0?_0x3d50f4:[]);if(!_0x228294)return _0x5b2ac2;return formatMsgWithTags(_0x5b2ac2);}function _0x1410(_0x5b03bc,_0x109ab2){_0x5b03bc=_0x5b03bc-0x75;const _0x23c442=_0x23c4();let _0x1410a1=_0x23c442[_0x5b03bc];return _0x1410a1;}const useTranslation=()=>{const _0x35dff8=_0x34a91f,{lang:_0x44b9ab,debug:_0x394fb2,pluralUtils:_0x15ce7e,resources:_0x455973}=_0x19f3d7[_0x35dff8(0x88)](I18nContext);function _0x1fb94c(_0x22a325,_0x3c1be5){const _0x3125b2=_0x35dff8,{found:_0x5a04e2,msg:_0x4a5e30}=getMsg(_0x22a325,_0x455973[_0x44b9ab],{'plural':_0x3c1be5===null||_0x3c1be5===void 0x0?void 0x0:_0x3c1be5[_0x3125b2(0x93)],'pluralUtils':_0x15ce7e});_0x394fb2&&!_0x5a04e2&&console[_0x3125b2(0x96)]('['+_0x44b9ab+']:\x20Translation\x20for\x20key\x20\x27'+_0x22a325+_0x3125b2(0x87));if(_0x3c1be5===null||_0x3c1be5===void 0x0?void 0x0:_0x3c1be5[_0x3125b2(0x85)])return formatMsg(_0x4a5e30,_0x3c1be5===null||_0x3c1be5===void 0x0?void 0x0:_0x3c1be5['values'],!![]);return formatMsg(_0x4a5e30,_0x3c1be5===null||_0x3c1be5===void 0x0?void 0x0:_0x3c1be5[_0x3125b2(0x8b)],![]);}return{'t':_0x1fb94c,'lang':_0x44b9ab};};export{I18nContext,I18nProvider,useTranslation};
|
package/package.json
CHANGED
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
24
|
"name": "@ckbox/i18n",
|
|
25
|
-
"version": "2.
|
|
25
|
+
"version": "2.10.0-rc.1",
|
|
26
26
|
"description": "I18n utils of CKBox",
|
|
27
27
|
"main": "dist/index.js",
|
|
28
28
|
"types": "dist/index.d.ts",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"react": "^
|
|
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
|
}
|