@ckbox/i18n 1.3.2-rc.0 → 1.4.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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  **CKBox** (https://ckeditor.com/ckbox/)
2
2
 
3
- Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com/) All rights reserved.
3
+ Copyright (c) 2003-2023, [CKSource Holding sp. z o.o.](https://cksource.com/) All rights reserved.
4
4
  **CKBox** is licensed under a commercial license and is protected by copyright law. For more details about available licensing options please contact us at [sales@cksource.com](mailto:sales@cksource.com).
5
5
 
6
6
  Trademarks
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/1.3.2-rc.0/ckbox.js"></script>
15
+ <script src="https://cdn.ckbox.io/ckbox/1.4.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/1.3.2-rc.0/ckbox.js"></script>
25
+ <script src="https://cdn.ckbox.io/ckbox/1.4.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/1.3.2-rc.0/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/1.4.0-rc.0/ckbox.js"></script>
52
52
  </head>
53
53
  <body>
54
54
  <div id="editor"></div>
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  */
4
4
  import * as React from 'react';
5
5
 
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  */
4
- function _0x1b53(){const _0x3a44b=['length','createElement','charAt','code','slice','tag','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','4568370QyrCMJ',']:\x20Translation\x20for\x20key\x20\x27','703745ariVlI','map','filter','log','Provider','plural','warn','1906TnXgEa','pluralUtils','indexOf','_rules','exec','7599305BIrjtU','useContext','push','lang','processTags','useEffect','8357344anzXJa','text','values','5356475keBznl','createContext','getKey','2217GEfmls','2145604zzwNBD','PluralRules','isSupported'];_0x1b53=function(){return _0x3a44b;};return _0x1b53();}const _0x3b87ab=_0x6ae3;(function(_0x1f65d8,_0x43aa80){const _0x66e804=_0x6ae3,_0x42adcd=_0x1f65d8();while(!![]){try{const _0x108d2e=-parseInt(_0x66e804(0x1a8))/0x1+-parseInt(_0x66e804(0x1af))/0x2*(parseInt(_0x66e804(0x1c0))/0x3)+parseInt(_0x66e804(0x1c1))/0x4+-parseInt(_0x66e804(0x1bd))/0x5+parseInt(_0x66e804(0x1cb))/0x6+parseInt(_0x66e804(0x1b4))/0x7+parseInt(_0x66e804(0x1ba))/0x8;if(_0x108d2e===_0x43aa80)break;else _0x42adcd['push'](_0x42adcd['shift']());}catch(_0x5a5a42){_0x42adcd['push'](_0x42adcd['shift']());}}}(_0x1b53,0xe7a24));import*as _0x48deec from'react';import{sprintf}from'sprintf-js';function _0x6ae3(_0x22f204,_0x7c92c4){const _0x1b5328=_0x1b53();return _0x6ae3=function(_0x6ae364,_0x5e57f3){_0x6ae364=_0x6ae364-0x1a8;let _0x2dc1ef=_0x1b5328[_0x6ae364];return _0x2dc1ef;},_0x6ae3(_0x22f204,_0x7c92c4);}class Plural{constructor(_0x3c9d1a){const _0x51e168=_0x6ae3;this[_0x51e168(0x1b7)]=_0x3c9d1a;try{this[_0x51e168(0x1b2)]=new Intl[(_0x51e168(0x1c2))](_0x3c9d1a);}catch(_0x3368b0){console['warn'](_0x51e168(0x1ca));}}[_0x3b87ab(0x1bf)](_0x470ce4,_0x5af70b){const _0x481dce=_0x3b87ab;if(!this[_0x481dce(0x1b2)])return _0x470ce4+'_one';const _0x1c9e6f=this[_0x481dce(0x1b2)]['select'](_0x5af70b);return _0x470ce4+'_'+_0x1c9e6f;}}Plural[_0x3b87ab(0x1c3)]=_0x2c474a=>{const _0x1b2fde=_0x3b87ab;try{return Intl['PluralRules']['supportedLocalesOf']([_0x2c474a])[_0x1b2fde(0x1c4)]>0x0;}catch(_0x1ed33a){return![];}};const I18nContext=_0x48deec[_0x3b87ab(0x1be)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x1e4b39,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x1d81cf=_0x3b87ab;return _0x48deec[_0x1d81cf(0x1b9)](()=>{const _0x42c55a=_0x1d81cf,_0x28cc75=Plural['isSupported'](lang);!_0x28cc75&&console[_0x42c55a(0x1ae)]('Plural\x20form\x20for\x20language\x20\x22'+lang+'\x22\x20is\x20not\x20supported.');},[lang]),_0x48deec[_0x1d81cf(0x1c5)](I18nContext[_0x1d81cf(0x1ac)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x1e4b39);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em','strong',_0x3b87ab(0x1c7)],getMsg=(_0x2da9bf,_0x5e917b={},_0x13fffe)=>{const _0x2c9e0d=_0x3b87ab,_0x2a0d84=_0x13fffe['plural'];if(_0x5e917b[_0x2da9bf]&&_0x2a0d84===undefined)return{'found':!![],'msg':_0x5e917b[_0x2da9bf]};const _0xd271d7=Object['keys'](_0x5e917b)[_0x2c9e0d(0x1aa)](_0x25c434=>_0x25c434[_0x2c9e0d(0x1b1)](_0x2da9bf)===0x0);if(_0xd271d7[_0x2c9e0d(0x1c4)]===0x0||_0x2a0d84===undefined)return{'found':![],'msg':_0x2da9bf};const _0x4b9e6f=_0x13fffe[_0x2c9e0d(0x1b0)]['getKey'](_0x2da9bf,_0x2a0d84);return{'found':!![],'msg':_0x5e917b[_0x4b9e6f]};},parseMsgTags=_0x422b89=>{const _0x32093f=_0x3b87ab,_0x13fa2c=[];let _0x4f789a=0x0,_0x592a7b;while((_0x592a7b=TAG_REGEX[_0x32093f(0x1b3)](_0x422b89))!==null){const _0x422fea=_0x592a7b[0x0],{index:_0x4cd984}=_0x592a7b,_0x1c427c=_0x422fea[_0x32093f(0x1c6)](0x1)==='/',_0x6dfea0=_0x1c427c?_0x422fea[_0x32093f(0x1c8)](0x2,-0x1):_0x422fea[_0x32093f(0x1c8)](0x1,-0x1),_0x55d6c5=ALLOWED_TAGS['includes'](_0x6dfea0);if(!_0x55d6c5)continue;const _0x51cc42=_0x422b89['slice'](_0x4f789a,_0x4cd984);if(!_0x51cc42){_0x4f789a=_0x4cd984+_0x422fea[_0x32093f(0x1c4)];continue;}_0x1c427c?_0x13fa2c[_0x32093f(0x1b6)]({'type':_0x32093f(0x1c9),'name':_0x422fea['slice'](0x2,-0x1),'content':_0x51cc42}):_0x13fa2c[_0x32093f(0x1b6)]({'type':_0x32093f(0x1bb),'content':_0x51cc42}),_0x4f789a=_0x4cd984+_0x422fea['length'];}return _0x4f789a<_0x422b89[_0x32093f(0x1c4)]&&_0x13fa2c[_0x32093f(0x1b6)]({'type':_0x32093f(0x1bb),'content':_0x422b89[_0x32093f(0x1c8)](_0x4f789a)}),_0x13fa2c;};function formatMsgWithTags(_0x59ebe0){const _0x4aa938=_0x3b87ab,_0x37d0cf=parseMsgTags(_0x59ebe0),_0x1bf460=_0x37d0cf[_0x4aa938(0x1a9)](({content:_0xa53aa1,type:_0x4d1c0d,name:_0x1c2897},_0x25713b)=>{const _0x242a1b=_0x4aa938,_0x26d672=_0x4d1c0d!==_0x242a1b(0x1bb)&&_0x1c2897?_0x1c2897:_0x48deec['Fragment'];return _0x48deec['createElement'](_0x26d672,{'key':''+_0x25713b},_0xa53aa1);});return _0x1bf460;}function formatMsg(_0x54214b,_0x2416cf,_0x5542bd){const _0x137b25=sprintf(_0x54214b,..._0x2416cf!==null&&_0x2416cf!==void 0x0?_0x2416cf:[]);if(!_0x5542bd)return _0x137b25;return formatMsgWithTags(_0x137b25);}const useTranslation=()=>{const _0x38c5a5=_0x3b87ab,{lang:_0x3fbdee,debug:_0x2b7957,pluralUtils:_0x58e8ab,resources:_0x28b30d}=_0x48deec[_0x38c5a5(0x1b5)](I18nContext);function _0x550acd(_0x5dd475,_0x555b32){const _0x47f66e=_0x38c5a5,{found:_0x3deee9,msg:_0x2bd6fe}=getMsg(_0x5dd475,_0x28b30d[_0x3fbdee],{'plural':_0x555b32===null||_0x555b32===void 0x0?void 0x0:_0x555b32[_0x47f66e(0x1ad)],'pluralUtils':_0x58e8ab});_0x2b7957&&!_0x3deee9&&console[_0x47f66e(0x1ab)]('['+_0x3fbdee+_0x47f66e(0x1cc)+_0x5dd475+'\x27\x20is\x20missing.');if(_0x555b32===null||_0x555b32===void 0x0?void 0x0:_0x555b32[_0x47f66e(0x1b8)])return formatMsg(_0x2bd6fe,_0x555b32===null||_0x555b32===void 0x0?void 0x0:_0x555b32[_0x47f66e(0x1bc)],!![]);return formatMsg(_0x2bd6fe,_0x555b32===null||_0x555b32===void 0x0?void 0x0:_0x555b32[_0x47f66e(0x1bc)],![]);}return{'t':_0x550acd,'lang':_0x3fbdee};};export{I18nContext,I18nProvider,useTranslation};
4
+ const _0x3ec0b3=_0x1d50;(function(_0x298041,_0x8421e9){const _0x232f91=_0x1d50,_0x36a8f7=_0x298041();while(!![]){try{const _0xc71197=-parseInt(_0x232f91(0x15e))/0x1+parseInt(_0x232f91(0x171))/0x2*(-parseInt(_0x232f91(0x15d))/0x3)+parseInt(_0x232f91(0x157))/0x4*(parseInt(_0x232f91(0x165))/0x5)+parseInt(_0x232f91(0x15f))/0x6*(-parseInt(_0x232f91(0x161))/0x7)+-parseInt(_0x232f91(0x16b))/0x8+-parseInt(_0x232f91(0x170))/0x9+-parseInt(_0x232f91(0x172))/0xa*(-parseInt(_0x232f91(0x154))/0xb);if(_0xc71197===_0x8421e9)break;else _0x36a8f7['push'](_0x36a8f7['shift']());}catch(_0x2c5428){_0x36a8f7['push'](_0x36a8f7['shift']());}}}(_0x44d4,0xbc9f3));import*as _0x4e987d from'react';function _0x44d4(){const _0x47282a=['\x27\x20is\x20missing.','187998jwxTwc','223413nfwqnm','2906958Rpvibx','push','14SsiSVV','length','log','useEffect','14690gUbhHc','slice','_rules','pluralUtils','PluralRules','createContext','5701360Cftrhw','supportedLocalesOf','createElement','Provider','values','13637151xEqZZC','32MrXtZb','212870oGfzFI','keys','lang','getKey','isSupported',']:\x20Translation\x20for\x20key\x20\x27','plural','code','strong','filter','2035UyaEYF','indexOf','text','1712aHrfNf','warn','exec','select','processTags'];_0x44d4=function(){return _0x47282a;};return _0x44d4();}import{sprintf}from'sprintf-js';class Plural{constructor(_0x38ac06){const _0x296a51=_0x1d50;this[_0x296a51(0x174)]=_0x38ac06;try{this[_0x296a51(0x167)]=new Intl[(_0x296a51(0x169))](_0x38ac06);}catch(_0x5c2740){console[_0x296a51(0x158)]('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}['getKey'](_0x38fa15,_0x4bb408){const _0x1652f5=_0x1d50;if(!this['_rules'])return _0x38fa15+'_one';const _0x282d1e=this['_rules'][_0x1652f5(0x15a)](_0x4bb408);return _0x38fa15+'_'+_0x282d1e;}}Plural[_0x3ec0b3(0x176)]=_0x17dd14=>{const _0x560ce2=_0x3ec0b3;try{return Intl[_0x560ce2(0x169)][_0x560ce2(0x16c)]([_0x17dd14])[_0x560ce2(0x162)]>0x0;}catch(_0x114fa7){return![];}};const I18nContext=_0x4e987d[_0x3ec0b3(0x16a)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x2462aa,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x533e01=_0x3ec0b3;return _0x4e987d[_0x533e01(0x164)](()=>{const _0x31f14e=_0x533e01,_0x472808=Plural[_0x31f14e(0x176)](lang);!_0x472808&&console[_0x31f14e(0x158)]('Plural\x20form\x20for\x20language\x20\x22'+lang+'\x22\x20is\x20not\x20supported.');},[lang]),_0x4e987d[_0x533e01(0x16d)](I18nContext[_0x533e01(0x16e)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x2462aa);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x3ec0b3(0x152),_0x3ec0b3(0x151)],getMsg=(_0x30ba80,_0x2a570f={},_0x539951)=>{const _0x7939d1=_0x3ec0b3,_0x2b8821=_0x539951[_0x7939d1(0x150)];if(_0x2a570f[_0x30ba80]&&_0x2b8821===undefined)return{'found':!![],'msg':_0x2a570f[_0x30ba80]};const _0x495f70=Object[_0x7939d1(0x173)](_0x2a570f)[_0x7939d1(0x153)](_0xefe345=>_0xefe345[_0x7939d1(0x155)](_0x30ba80)===0x0);if(_0x495f70[_0x7939d1(0x162)]===0x0||_0x2b8821===undefined)return{'found':![],'msg':_0x30ba80};const _0x538267=_0x539951[_0x7939d1(0x168)][_0x7939d1(0x175)](_0x30ba80,_0x2b8821);return{'found':!![],'msg':_0x2a570f[_0x538267]};},parseMsgTags=_0x959648=>{const _0x3e6999=_0x3ec0b3,_0xfe389a=[];let _0x4a116f=0x0,_0x49f927;while((_0x49f927=TAG_REGEX[_0x3e6999(0x159)](_0x959648))!==null){const _0x1ef1fc=_0x49f927[0x0],{index:_0x1631a0}=_0x49f927,_0x5375dd=_0x1ef1fc['charAt'](0x1)==='/',_0xda7ae4=_0x5375dd?_0x1ef1fc['slice'](0x2,-0x1):_0x1ef1fc[_0x3e6999(0x166)](0x1,-0x1),_0xf3abc5=ALLOWED_TAGS['includes'](_0xda7ae4);if(!_0xf3abc5)continue;const _0x380b5c=_0x959648[_0x3e6999(0x166)](_0x4a116f,_0x1631a0);if(!_0x380b5c){_0x4a116f=_0x1631a0+_0x1ef1fc[_0x3e6999(0x162)];continue;}_0x5375dd?_0xfe389a[_0x3e6999(0x160)]({'type':'tag','name':_0x1ef1fc['slice'](0x2,-0x1),'content':_0x380b5c}):_0xfe389a['push']({'type':_0x3e6999(0x156),'content':_0x380b5c}),_0x4a116f=_0x1631a0+_0x1ef1fc['length'];}return _0x4a116f<_0x959648[_0x3e6999(0x162)]&&_0xfe389a['push']({'type':_0x3e6999(0x156),'content':_0x959648[_0x3e6999(0x166)](_0x4a116f)}),_0xfe389a;};function formatMsgWithTags(_0x281d96){const _0x526eff=parseMsgTags(_0x281d96),_0x5d3999=_0x526eff['map'](({content:_0x47716c,type:_0x51ae23,name:_0x20025c},_0x31ad44)=>{const _0x1466b5=_0x1d50,_0x1481ea=_0x51ae23!==_0x1466b5(0x156)&&_0x20025c?_0x20025c:_0x4e987d['Fragment'];return _0x4e987d['createElement'](_0x1481ea,{'key':''+_0x31ad44},_0x47716c);});return _0x5d3999;}function _0x1d50(_0x265d10,_0x47ea5b){const _0x44d459=_0x44d4();return _0x1d50=function(_0x1d50c5,_0x511ae3){_0x1d50c5=_0x1d50c5-0x150;let _0x1814d0=_0x44d459[_0x1d50c5];return _0x1814d0;},_0x1d50(_0x265d10,_0x47ea5b);}function formatMsg(_0xa16ac3,_0x536213,_0x188728){const _0x1adce9=sprintf(_0xa16ac3,..._0x536213!==null&&_0x536213!==void 0x0?_0x536213:[]);if(!_0x188728)return _0x1adce9;return formatMsgWithTags(_0x1adce9);}const useTranslation=()=>{const {lang:_0x25dbcc,debug:_0x209653,pluralUtils:_0x285210,resources:_0x5859ec}=_0x4e987d['useContext'](I18nContext);function _0xad9d59(_0x5cd918,_0x28bc89){const _0x2be2fb=_0x1d50,{found:_0x31110d,msg:_0x5c43a9}=getMsg(_0x5cd918,_0x5859ec[_0x25dbcc],{'plural':_0x28bc89===null||_0x28bc89===void 0x0?void 0x0:_0x28bc89[_0x2be2fb(0x150)],'pluralUtils':_0x285210});_0x209653&&!_0x31110d&&console[_0x2be2fb(0x163)]('['+_0x25dbcc+_0x2be2fb(0x177)+_0x5cd918+_0x2be2fb(0x15c));if(_0x28bc89===null||_0x28bc89===void 0x0?void 0x0:_0x28bc89[_0x2be2fb(0x15b)])return formatMsg(_0x5c43a9,_0x28bc89===null||_0x28bc89===void 0x0?void 0x0:_0x28bc89['values'],!![]);return formatMsg(_0x5c43a9,_0x28bc89===null||_0x28bc89===void 0x0?void 0x0:_0x28bc89[_0x2be2fb(0x16f)],![]);}return{'t':_0xad9d59,'lang':_0x25dbcc};};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": "1.3.2-rc.0",
23
+ "version": "1.4.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.4.1"
32
+ "tslib": "^2.5.0"
33
33
  }
34
34
  }