@ckbox/i18n 2.10.1 → 2.11.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 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.10.1/ckbox.js"></script>
16
+ <script src="https://cdn.ckbox.io/ckbox/2.11.0-rc.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.10.1/ckbox.js"></script>
26
+ <script src="https://cdn.ckbox.io/ckbox/2.11.0-rc.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.10.1/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/2.11.0-rc.0/ckbox.js"></script>
52
52
  <link
53
53
  rel="stylesheet"
54
- href="https://cdn.ckbox.io/ckbox/2.10.1/styles/themes/lark.css"
54
+ href="https://cdn.ckbox.io/ckbox/2.11.0-rc.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 _0x4479ab=_0x1497;function _0x1497(_0x39c22a,_0x567af3){_0x39c22a=_0x39c22a-0x81;const _0x24a53c=_0x24a5();let _0x149700=_0x24a53c[_0x39c22a];return _0x149700;}(function(_0x24b2b5,_0x3390bd){const _0x122683=_0x1497,_0x1cb5ed=_0x24b2b5();while(!![]){try{const _0x9555be=-parseInt(_0x122683(0x8f))/0x1+-parseInt(_0x122683(0x95))/0x2+-parseInt(_0x122683(0x9a))/0x3+parseInt(_0x122683(0xa6))/0x4+-parseInt(_0x122683(0x8b))/0x5*(-parseInt(_0x122683(0x87))/0x6)+-parseInt(_0x122683(0x82))/0x7*(-parseInt(_0x122683(0xa2))/0x8)+parseInt(_0x122683(0x85))/0x9;if(_0x9555be===_0x3390bd)break;else _0x1cb5ed['push'](_0x1cb5ed['shift']());}catch(_0x4049a7){_0x1cb5ed['push'](_0x1cb5ed['shift']());}}}(_0x24a5,0x67b92));import*as _0x47bf9f from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x36a3a1){const _0x18210d=_0x1497;this['lang']=_0x36a3a1;try{this['_rules']=new Intl[(_0x18210d(0x99))](_0x36a3a1);}catch(_0x4cfee1){console['warn'](_0x18210d(0xa5));}}[_0x4479ab(0x8d)](_0x1ab953,_0x3d12d8){const _0x1a70cc=_0x4479ab;if(!this[_0x1a70cc(0x93)])return _0x1ab953+_0x1a70cc(0x86);const _0x2ff1a6=this[_0x1a70cc(0x93)]['select'](_0x3d12d8);return _0x1ab953+'_'+_0x2ff1a6;}}Plural['isSupported']=_0x161a1f=>{const _0x12db38=_0x4479ab;try{return Intl[_0x12db38(0x99)][_0x12db38(0x98)]([_0x161a1f])[_0x12db38(0x8a)]>0x0;}catch(_0x50edd3){return![];}};const I18nContext=_0x47bf9f[_0x4479ab(0xa8)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x360b5e,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x894b89=_0x4479ab;return _0x47bf9f['useEffect'](()=>{const _0x4c66fe=_0x1497,_0x2dc2de=Plural['isSupported'](lang);!_0x2dc2de&&console[_0x4c66fe(0xa7)](_0x4c66fe(0xa4)+lang+_0x4c66fe(0xa3));},[lang]),_0x47bf9f[_0x894b89(0x8c)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x360b5e);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x4479ab(0x89),'code'],getMsg=(_0x7fe732,_0x55afb6={},_0x3aba62)=>{const _0xb6db7a=_0x4479ab,_0x2edeca=_0x3aba62[_0xb6db7a(0x92)];if(_0x55afb6[_0x7fe732]&&_0x2edeca===undefined)return{'found':!![],'msg':_0x55afb6[_0x7fe732]};const _0x466c3f=Object[_0xb6db7a(0x8e)](_0x55afb6)[_0xb6db7a(0x9e)](_0x2006a4=>_0x2006a4[_0xb6db7a(0x9d)](_0x7fe732)===0x0);if(_0x466c3f[_0xb6db7a(0x8a)]===0x0||_0x2edeca===undefined)return{'found':![],'msg':_0x7fe732};const _0x4bcea7=_0x3aba62[_0xb6db7a(0x90)]['getKey'](_0x7fe732,_0x2edeca);return{'found':!![],'msg':_0x55afb6[_0x4bcea7]};},parseMsgTags=_0x2bea78=>{const _0x2a6f73=_0x4479ab,_0x31e633=[];let _0x4b1da6=0x0,_0x1b3ee5;while((_0x1b3ee5=TAG_REGEX['exec'](_0x2bea78))!==null){const _0x5ce44f=_0x1b3ee5[0x0],{index:_0x5c85dc}=_0x1b3ee5,_0xb69b54=_0x5ce44f[_0x2a6f73(0x9b)](0x1)==='/',_0x37c294=_0xb69b54?_0x5ce44f['slice'](0x2,-0x1):_0x5ce44f[_0x2a6f73(0x96)](0x1,-0x1),_0x59f322=ALLOWED_TAGS[_0x2a6f73(0x91)](_0x37c294);if(!_0x59f322)continue;const _0x359352=_0x2bea78[_0x2a6f73(0x96)](_0x4b1da6,_0x5c85dc);if(!_0x359352){_0x4b1da6=_0x5c85dc+_0x5ce44f['length'];continue;}_0xb69b54?_0x31e633[_0x2a6f73(0xa0)]({'type':'tag','name':_0x5ce44f[_0x2a6f73(0x96)](0x2,-0x1),'content':_0x359352}):_0x31e633['push']({'type':_0x2a6f73(0x9f),'content':_0x359352}),_0x4b1da6=_0x5c85dc+_0x5ce44f[_0x2a6f73(0x8a)];}return _0x4b1da6<_0x2bea78[_0x2a6f73(0x8a)]&&_0x31e633['push']({'type':_0x2a6f73(0x9f),'content':_0x2bea78[_0x2a6f73(0x96)](_0x4b1da6)}),_0x31e633;};function formatMsgWithTags(_0x389a25){const _0x1ba62d=_0x4479ab,_0x3737b9=parseMsgTags(_0x389a25),_0x5156b5=_0x3737b9[_0x1ba62d(0x88)](({content:_0x20acaf,type:_0x5879b6,name:_0x4b4655},_0x5bcd54)=>{const _0x447cac=_0x1ba62d,_0x5a196a=_0x5879b6!==_0x447cac(0x9f)&&_0x4b4655?_0x4b4655:_0x47bf9f[_0x447cac(0x9c)];return _0x47bf9f['createElement'](_0x5a196a,{'key':''+_0x5bcd54},_0x20acaf);});return _0x5156b5;}function formatMsg(_0x2240bb,_0x2a942e,_0x3bb2d9){const _0x5a6cd2=sprintf(_0x2240bb,..._0x2a942e!==null&&_0x2a942e!==void 0x0?_0x2a942e:[]);if(!_0x3bb2d9)return _0x5a6cd2;return formatMsgWithTags(_0x5a6cd2);}function _0x24a5(){const _0x3c7292=['push','processTags','6273752BRZszV','\x22\x20is\x20not\x20supported.','Plural\x20form\x20for\x20language\x20\x22','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','2291776bLdhSG','warn','createContext','useContext','7nzDZgR','values','\x27\x20is\x20missing.','6184278IEnzZK','_one','6102VPeqco','map','strong','length','1245dhtbfW','createElement','getKey','keys','738161HTMCFb','pluralUtils','includes','plural','_rules','log','1516556wtfJIm','slice',']:\x20Translation\x20for\x20key\x20\x27','supportedLocalesOf','PluralRules','1128747nZgdfA','charAt','Fragment','indexOf','filter','text'];_0x24a5=function(){return _0x3c7292;};return _0x24a5();}const useTranslation=()=>{const _0x3aaa7c=_0x4479ab,{lang:_0x5bf36a,debug:_0x354b41,pluralUtils:_0x5535f5,resources:_0x3a30d4}=_0x47bf9f[_0x3aaa7c(0x81)](I18nContext);function _0x43f471(_0x49f156,_0x494d07){const _0x51432=_0x3aaa7c,{found:_0x408713,msg:_0x4dec55}=getMsg(_0x49f156,_0x3a30d4[_0x5bf36a],{'plural':_0x494d07===null||_0x494d07===void 0x0?void 0x0:_0x494d07[_0x51432(0x92)],'pluralUtils':_0x5535f5});_0x354b41&&!_0x408713&&console[_0x51432(0x94)]('['+_0x5bf36a+_0x51432(0x97)+_0x49f156+_0x51432(0x84));if(_0x494d07===null||_0x494d07===void 0x0?void 0x0:_0x494d07[_0x51432(0xa1)])return formatMsg(_0x4dec55,_0x494d07===null||_0x494d07===void 0x0?void 0x0:_0x494d07[_0x51432(0x83)],!![]);return formatMsg(_0x4dec55,_0x494d07===null||_0x494d07===void 0x0?void 0x0:_0x494d07[_0x51432(0x83)],![]);}return{'t':_0x43f471,'lang':_0x5bf36a};};export{I18nContext,I18nProvider,useTranslation};
4
+ const _0x21a43b=_0x5f46;(function(_0x4d0280,_0x366792){const _0x223569=_0x5f46,_0xaea35c=_0x4d0280();while(!![]){try{const _0x2680b2=-parseInt(_0x223569(0x87))/0x1*(parseInt(_0x223569(0x88))/0x2)+-parseInt(_0x223569(0xa5))/0x3+-parseInt(_0x223569(0x9a))/0x4*(parseInt(_0x223569(0x89))/0x5)+-parseInt(_0x223569(0xa6))/0x6+parseInt(_0x223569(0x9c))/0x7*(-parseInt(_0x223569(0x9d))/0x8)+parseInt(_0x223569(0xa4))/0x9+parseInt(_0x223569(0xa1))/0xa*(parseInt(_0x223569(0xac))/0xb);if(_0x2680b2===_0x366792)break;else _0xaea35c['push'](_0xaea35c['shift']());}catch(_0x539ed2){_0xaea35c['push'](_0xaea35c['shift']());}}}(_0x452d,0x27dd7));import*as _0x46efb8 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x1d180c){const _0x1cdc27=_0x5f46;this['lang']=_0x1d180c;try{this['_rules']=new Intl[(_0x1cdc27(0xad))](_0x1d180c);}catch(_0x549e98){console[_0x1cdc27(0x9e)](_0x1cdc27(0x97));}}['getKey'](_0x25b169,_0x48b357){const _0x1ca91a=_0x5f46;if(!this[_0x1ca91a(0xa9)])return _0x25b169+_0x1ca91a(0x94);const _0x27ca63=this[_0x1ca91a(0xa9)][_0x1ca91a(0x96)](_0x48b357);return _0x25b169+'_'+_0x27ca63;}}Plural[_0x21a43b(0x91)]=_0x29334e=>{const _0x37bae8=_0x21a43b;try{return Intl[_0x37bae8(0xad)]['supportedLocalesOf']([_0x29334e])[_0x37bae8(0xaa)]>0x0;}catch(_0x8357b3){return![];}};const I18nContext=_0x46efb8[_0x21a43b(0x90)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x77351c,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x29611f=_0x21a43b;return _0x46efb8[_0x29611f(0x8d)](()=>{const _0x5d7a87=_0x29611f,_0x478b92=Plural[_0x5d7a87(0x91)](lang);!_0x478b92&&console[_0x5d7a87(0x9e)](_0x5d7a87(0xa7)+lang+_0x5d7a87(0xa2));},[lang]),_0x46efb8[_0x29611f(0xa8)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x77351c);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x21a43b(0xa3),_0x21a43b(0xae)],getMsg=(_0x2c535f,_0xb04eae={},_0x502543)=>{const _0x204ee6=_0x21a43b,_0x139348=_0x502543[_0x204ee6(0x8b)];if(_0xb04eae[_0x2c535f]&&_0x139348===undefined)return{'found':!![],'msg':_0xb04eae[_0x2c535f]};const _0x22a580=Object['keys'](_0xb04eae)[_0x204ee6(0x95)](_0x5206b2=>_0x5206b2[_0x204ee6(0x8c)](_0x2c535f)===0x0);if(_0x22a580['length']===0x0||_0x139348===undefined)return{'found':![],'msg':_0x2c535f};const _0x306a8e=_0x502543[_0x204ee6(0x98)]['getKey'](_0x2c535f,_0x139348);return{'found':!![],'msg':_0xb04eae[_0x306a8e]};},parseMsgTags=_0x17c081=>{const _0x1372fc=_0x21a43b,_0x166284=[];let _0x5a9bb1=0x0,_0x46dd9a;while((_0x46dd9a=TAG_REGEX[_0x1372fc(0xab)](_0x17c081))!==null){const _0x5c4f5e=_0x46dd9a[0x0],{index:_0x42803b}=_0x46dd9a,_0x5d0e4f=_0x5c4f5e[_0x1372fc(0x93)](0x1)==='/',_0x28ee85=_0x5d0e4f?_0x5c4f5e[_0x1372fc(0x8a)](0x2,-0x1):_0x5c4f5e['slice'](0x1,-0x1),_0x1be4e8=ALLOWED_TAGS[_0x1372fc(0x8f)](_0x28ee85);if(!_0x1be4e8)continue;const _0xe71f04=_0x17c081[_0x1372fc(0x8a)](_0x5a9bb1,_0x42803b);if(!_0xe71f04){_0x5a9bb1=_0x42803b+_0x5c4f5e[_0x1372fc(0xaa)];continue;}_0x5d0e4f?_0x166284[_0x1372fc(0x9b)]({'type':_0x1372fc(0x92),'name':_0x5c4f5e[_0x1372fc(0x8a)](0x2,-0x1),'content':_0xe71f04}):_0x166284[_0x1372fc(0x9b)]({'type':_0x1372fc(0x99),'content':_0xe71f04}),_0x5a9bb1=_0x42803b+_0x5c4f5e[_0x1372fc(0xaa)];}return _0x5a9bb1<_0x17c081[_0x1372fc(0xaa)]&&_0x166284['push']({'type':_0x1372fc(0x99),'content':_0x17c081['slice'](_0x5a9bb1)}),_0x166284;};function formatMsgWithTags(_0x50b5c9){const _0x2e5661=parseMsgTags(_0x50b5c9),_0x4886a4=_0x2e5661['map'](({content:_0x4174cb,type:_0x15078f,name:_0x5a60aa},_0x364910)=>{const _0x1b771d=_0x5f46,_0x16cf52=_0x15078f!=='text'&&_0x5a60aa?_0x5a60aa:_0x46efb8[_0x1b771d(0x8e)];return _0x46efb8[_0x1b771d(0xa8)](_0x16cf52,{'key':''+_0x364910},_0x4174cb);});return _0x4886a4;}function _0x452d(){const _0x26b335=['7ArmgeR','1493176DzSlxt','warn','useContext','log','11439230dIlWjM','\x22\x20is\x20not\x20supported.','strong','958419MNVvIa','977928PRgVlf','1937430kcVNjk','Plural\x20form\x20for\x20language\x20\x22','createElement','_rules','length','exec','11ittXoC','PluralRules','code','values','169693zKrnYl','2ocyOFk','37230gMFgOp','slice','plural','indexOf','useEffect','Fragment','includes','createContext','isSupported','tag','charAt','_one','filter','select','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','pluralUtils','text','44UEPuAc','push'];_0x452d=function(){return _0x26b335;};return _0x452d();}function formatMsg(_0x5264aa,_0x457d6e,_0x391c15){const _0x50f7ba=sprintf(_0x5264aa,..._0x457d6e!==null&&_0x457d6e!==void 0x0?_0x457d6e:[]);if(!_0x391c15)return _0x50f7ba;return formatMsgWithTags(_0x50f7ba);}const useTranslation=()=>{const _0x1c764d=_0x21a43b,{lang:_0x1571e8,debug:_0x5ddb76,pluralUtils:_0x490f6a,resources:_0x3baece}=_0x46efb8[_0x1c764d(0x9f)](I18nContext);function _0x57be52(_0x555bae,_0x48ec3c){const _0x5a59b4=_0x1c764d,{found:_0x2354e9,msg:_0x457298}=getMsg(_0x555bae,_0x3baece[_0x1571e8],{'plural':_0x48ec3c===null||_0x48ec3c===void 0x0?void 0x0:_0x48ec3c[_0x5a59b4(0x8b)],'pluralUtils':_0x490f6a});_0x5ddb76&&!_0x2354e9&&console[_0x5a59b4(0xa0)]('['+_0x1571e8+']:\x20Translation\x20for\x20key\x20\x27'+_0x555bae+'\x27\x20is\x20missing.');if(_0x48ec3c===null||_0x48ec3c===void 0x0?void 0x0:_0x48ec3c['processTags'])return formatMsg(_0x457298,_0x48ec3c===null||_0x48ec3c===void 0x0?void 0x0:_0x48ec3c[_0x5a59b4(0x86)],!![]);return formatMsg(_0x457298,_0x48ec3c===null||_0x48ec3c===void 0x0?void 0x0:_0x48ec3c['values'],![]);}return{'t':_0x57be52,'lang':_0x1571e8};};function _0x5f46(_0x58641b,_0xe4f987){_0x58641b=_0x58641b-0x86;const _0x452d7a=_0x452d();let _0x5f46e1=_0x452d7a[_0x58641b];return _0x5f46e1;}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.10.1",
25
+ "version": "2.11.0-rc.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": "^4.0.17",
33
+ "@vitest/coverage-v8": "^4.0.18",
34
34
  "sprintf-js": "^1.1.3",
35
35
  "tslib": "^2.8.1",
36
- "vitest": "^4.0.17"
36
+ "vitest": "^4.0.18"
37
37
  }
38
38
  }