@ckbox/i18n 1.6.0-rc.3 → 1.6.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
@@ -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.6.0-rc.3/ckbox.js"></script>
15
+ <script src="https://cdn.ckbox.io/ckbox/1.6.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.6.0-rc.3/ckbox.js"></script>
25
+ <script src="https://cdn.ckbox.io/ckbox/1.6.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.6.0-rc.3/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/1.6.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 _0x3292cb=_0x4a21;(function(_0x59a8e9,_0x14002f){const _0x12baf6=_0x4a21,_0x142391=_0x59a8e9();while(!![]){try{const _0x3fe0e0=-parseInt(_0x12baf6(0x1a6))/0x1*(parseInt(_0x12baf6(0x1b0))/0x2)+-parseInt(_0x12baf6(0x1a4))/0x3*(-parseInt(_0x12baf6(0x1c6))/0x4)+-parseInt(_0x12baf6(0x1cc))/0x5*(-parseInt(_0x12baf6(0x1ae))/0x6)+-parseInt(_0x12baf6(0x1c9))/0x7+parseInt(_0x12baf6(0x1c0))/0x8*(-parseInt(_0x12baf6(0x1b5))/0x9)+parseInt(_0x12baf6(0x1c1))/0xa+-parseInt(_0x12baf6(0x1aa))/0xb*(-parseInt(_0x12baf6(0x1bc))/0xc);if(_0x3fe0e0===_0x14002f)break;else _0x142391['push'](_0x142391['shift']());}catch(_0x47955a){_0x142391['push'](_0x142391['shift']());}}}(_0x31c1,0x628a0));import*as _0x19ac7d from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x5be216){const _0x59436d=_0x4a21;this[_0x59436d(0x1b7)]=_0x5be216;try{this['_rules']=new Intl[(_0x59436d(0x1bb))](_0x5be216);}catch(_0x9b9da4){console['warn']('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}[_0x3292cb(0x1b8)](_0x2cbec9,_0x1fec4e){const _0x52ce20=_0x3292cb;if(!this['_rules'])return _0x2cbec9+'_one';const _0x15fabb=this[_0x52ce20(0x1a3)][_0x52ce20(0x1a8)](_0x1fec4e);return _0x2cbec9+'_'+_0x15fabb;}}function _0x4a21(_0x2710ca,_0x4ae73b){const _0x31c1e0=_0x31c1();return _0x4a21=function(_0x4a213a,_0x147c3f){_0x4a213a=_0x4a213a-0x1a1;let _0x5c2a6c=_0x31c1e0[_0x4a213a];return _0x5c2a6c;},_0x4a21(_0x2710ca,_0x4ae73b);}Plural['isSupported']=_0xe269ca=>{const _0x698860=_0x3292cb;try{return Intl[_0x698860(0x1bb)][_0x698860(0x1b2)]([_0xe269ca])[_0x698860(0x1c8)]>0x0;}catch(_0x1fe158){return![];}};const I18nContext=_0x19ac7d[_0x3292cb(0x1a2)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x35bf03,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x7adc65=_0x3292cb;return _0x19ac7d[_0x7adc65(0x1c7)](()=>{const _0x4932b4=_0x7adc65,_0x9d7f23=Plural[_0x4932b4(0x1a1)](lang);!_0x9d7f23&&console[_0x4932b4(0x1b9)](_0x4932b4(0x1a7)+lang+_0x4932b4(0x1b1));},[lang]),_0x19ac7d[_0x7adc65(0x1ad)](I18nContext[_0x7adc65(0x1ca)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x35bf03);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em','strong',_0x3292cb(0x1be)],getMsg=(_0x527763,_0x23392f={},_0x176999)=>{const _0x31fbcb=_0x3292cb,_0x408304=_0x176999[_0x31fbcb(0x1a5)];if(_0x23392f[_0x527763]&&_0x408304===undefined)return{'found':!![],'msg':_0x23392f[_0x527763]};const _0x2e3cf7=Object[_0x31fbcb(0x1af)](_0x23392f)[_0x31fbcb(0x1b6)](_0x5cfa36=>_0x5cfa36[_0x31fbcb(0x1a9)](_0x527763)===0x0);if(_0x2e3cf7[_0x31fbcb(0x1c8)]===0x0||_0x408304===undefined)return{'found':![],'msg':_0x527763};const _0x2c65e9=_0x176999[_0x31fbcb(0x1b3)][_0x31fbcb(0x1b8)](_0x527763,_0x408304);return{'found':!![],'msg':_0x23392f[_0x2c65e9]};},parseMsgTags=_0x569d1f=>{const _0x1e6890=_0x3292cb,_0x43c819=[];let _0x1aaccd=0x0,_0x1a9314;while((_0x1a9314=TAG_REGEX[_0x1e6890(0x1bf)](_0x569d1f))!==null){const _0xa13352=_0x1a9314[0x0],{index:_0x1f1c61}=_0x1a9314,_0x598554=_0xa13352[_0x1e6890(0x1ba)](0x1)==='/',_0x2049fc=_0x598554?_0xa13352['slice'](0x2,-0x1):_0xa13352['slice'](0x1,-0x1),_0x5ad4a0=ALLOWED_TAGS[_0x1e6890(0x1bd)](_0x2049fc);if(!_0x5ad4a0)continue;const _0x1bc435=_0x569d1f[_0x1e6890(0x1c5)](_0x1aaccd,_0x1f1c61);if(!_0x1bc435){_0x1aaccd=_0x1f1c61+_0xa13352[_0x1e6890(0x1c8)];continue;}_0x598554?_0x43c819['push']({'type':_0x1e6890(0x1cb),'name':_0xa13352[_0x1e6890(0x1c5)](0x2,-0x1),'content':_0x1bc435}):_0x43c819[_0x1e6890(0x1c2)]({'type':_0x1e6890(0x1b4),'content':_0x1bc435}),_0x1aaccd=_0x1f1c61+_0xa13352['length'];}return _0x1aaccd<_0x569d1f[_0x1e6890(0x1c8)]&&_0x43c819[_0x1e6890(0x1c2)]({'type':_0x1e6890(0x1b4),'content':_0x569d1f[_0x1e6890(0x1c5)](_0x1aaccd)}),_0x43c819;};function formatMsgWithTags(_0x1c4a3b){const _0x5a54d7=_0x3292cb,_0x2f9eac=parseMsgTags(_0x1c4a3b),_0x494801=_0x2f9eac[_0x5a54d7(0x1c3)](({content:_0x3e1a71,type:_0x405293,name:_0x504c1f},_0x58a607)=>{const _0x1238a9=_0x5a54d7,_0x48e48b=_0x405293!==_0x1238a9(0x1b4)&&_0x504c1f?_0x504c1f:_0x19ac7d[_0x1238a9(0x1ac)];return _0x19ac7d[_0x1238a9(0x1ad)](_0x48e48b,{'key':''+_0x58a607},_0x3e1a71);});return _0x494801;}function formatMsg(_0x1a9b7c,_0x1cf021,_0x5e6c28){const _0x390b49=sprintf(_0x1a9b7c,..._0x1cf021!==null&&_0x1cf021!==void 0x0?_0x1cf021:[]);if(!_0x5e6c28)return _0x390b49;return formatMsgWithTags(_0x390b49);}const useTranslation=()=>{const _0x130c79=_0x3292cb,{lang:_0x1eebf0,debug:_0x537bd7,pluralUtils:_0x3e6076,resources:_0xf5fbc5}=_0x19ac7d[_0x130c79(0x1cd)](I18nContext);function _0x20a9c7(_0x17fae5,_0x4171f8){const _0x4c6e40=_0x130c79,{found:_0x350a6d,msg:_0x219254}=getMsg(_0x17fae5,_0xf5fbc5[_0x1eebf0],{'plural':_0x4171f8===null||_0x4171f8===void 0x0?void 0x0:_0x4171f8['plural'],'pluralUtils':_0x3e6076});_0x537bd7&&!_0x350a6d&&console['log']('['+_0x1eebf0+_0x4c6e40(0x1ab)+_0x17fae5+'\x27\x20is\x20missing.');if(_0x4171f8===null||_0x4171f8===void 0x0?void 0x0:_0x4171f8['processTags'])return formatMsg(_0x219254,_0x4171f8===null||_0x4171f8===void 0x0?void 0x0:_0x4171f8[_0x4c6e40(0x1c4)],!![]);return formatMsg(_0x219254,_0x4171f8===null||_0x4171f8===void 0x0?void 0x0:_0x4171f8[_0x4c6e40(0x1c4)],![]);}return{'t':_0x20a9c7,'lang':_0x1eebf0};};export{I18nContext,I18nProvider,useTranslation};function _0x31c1(){const _0x34982e=['Plural\x20form\x20for\x20language\x20\x22','select','indexOf','7428652jJUEmH',']:\x20Translation\x20for\x20key\x20\x27','Fragment','createElement','261552hxWpcv','keys','1147346EFtBKz','\x22\x20is\x20not\x20supported.','supportedLocalesOf','pluralUtils','text','315EvFvvp','filter','lang','getKey','warn','charAt','PluralRules','24AKiTZq','includes','code','exec','100664dYmUPF','2519360FxSZdz','push','map','values','slice','85996GXSWfk','useEffect','length','3568369eBwDqu','Provider','tag','20eLcQoh','useContext','isSupported','createContext','_rules','21GTShOa','plural','1WejsHC'];_0x31c1=function(){return _0x34982e;};return _0x31c1();}
4
+ function _0x15df(_0x2234b3,_0x48946f){const _0x3bee47=_0x3bee();return _0x15df=function(_0x15df46,_0x18b161){_0x15df46=_0x15df46-0x19c;let _0x5643d0=_0x3bee47[_0x15df46];return _0x5643d0;},_0x15df(_0x2234b3,_0x48946f);}const _0x331998=_0x15df;(function(_0x1d1b4d,_0x19749e){const _0x3f9612=_0x15df,_0x2d7a9a=_0x1d1b4d();while(!![]){try{const _0x541e83=parseInt(_0x3f9612(0x1b7))/0x1+parseInt(_0x3f9612(0x1a5))/0x2+parseInt(_0x3f9612(0x1a3))/0x3+-parseInt(_0x3f9612(0x1b6))/0x4+-parseInt(_0x3f9612(0x1a2))/0x5+-parseInt(_0x3f9612(0x1ba))/0x6+parseInt(_0x3f9612(0x1ae))/0x7;if(_0x541e83===_0x19749e)break;else _0x2d7a9a['push'](_0x2d7a9a['shift']());}catch(_0x1d49d7){_0x2d7a9a['push'](_0x2d7a9a['shift']());}}}(_0x3bee,0xd7ab6));import*as _0x9de0a3 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x3658b9){const _0x49e2c1=_0x15df;this[_0x49e2c1(0x1bb)]=_0x3658b9;try{this[_0x49e2c1(0x1c1)]=new Intl[(_0x49e2c1(0x1c4))](_0x3658b9);}catch(_0x276738){console[_0x49e2c1(0x19f)]('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}['getKey'](_0x190e11,_0x3dab08){const _0x5337a1=_0x15df;if(!this['_rules'])return _0x190e11+_0x5337a1(0x1b1);const _0x502bc3=this[_0x5337a1(0x1c1)][_0x5337a1(0x1bc)](_0x3dab08);return _0x190e11+'_'+_0x502bc3;}}function _0x3bee(){const _0x490ab8=['createContext','useContext','push','processTags','charAt','10165708jiqiyV','isSupported','text','_one','indexOf','code','Fragment',']:\x20Translation\x20for\x20key\x20\x27','5634092MWRdHV','1642529ZUWdVb','log','map','6455484ZyPfpS','lang','select','strong','values','filter','\x27\x20is\x20missing.','_rules','supportedLocalesOf','useEffect','PluralRules','plural','\x22\x20is\x20not\x20supported.','tag','length','warn','includes','pluralUtils','6811210URunmn','86976fkcDdw','getKey','3212592CdmCev','slice','keys','createElement'];_0x3bee=function(){return _0x490ab8;};return _0x3bee();}Plural[_0x331998(0x1af)]=_0x39ae9d=>{const _0x3047e4=_0x331998;try{return Intl['PluralRules'][_0x3047e4(0x1c2)]([_0x39ae9d])['length']>0x0;}catch(_0x2789c9){return![];}};const I18nContext=_0x9de0a3[_0x331998(0x1a9)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x10b6fe,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x28d799=_0x331998;return _0x9de0a3[_0x28d799(0x1c3)](()=>{const _0x1e2ac0=_0x28d799,_0x117203=Plural[_0x1e2ac0(0x1af)](lang);!_0x117203&&console[_0x1e2ac0(0x19f)]('Plural\x20form\x20for\x20language\x20\x22'+lang+_0x1e2ac0(0x19c));},[lang]),_0x9de0a3[_0x28d799(0x1a8)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x10b6fe);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x331998(0x1bd),_0x331998(0x1b3)],getMsg=(_0x2bb7b6,_0x5ce761={},_0x3328fa)=>{const _0x4a585c=_0x331998,_0x2589e9=_0x3328fa[_0x4a585c(0x1c5)];if(_0x5ce761[_0x2bb7b6]&&_0x2589e9===undefined)return{'found':!![],'msg':_0x5ce761[_0x2bb7b6]};const _0x15e85b=Object[_0x4a585c(0x1a7)](_0x5ce761)[_0x4a585c(0x1bf)](_0x19e9b0=>_0x19e9b0[_0x4a585c(0x1b2)](_0x2bb7b6)===0x0);if(_0x15e85b[_0x4a585c(0x19e)]===0x0||_0x2589e9===undefined)return{'found':![],'msg':_0x2bb7b6};const _0x32277d=_0x3328fa[_0x4a585c(0x1a1)][_0x4a585c(0x1a4)](_0x2bb7b6,_0x2589e9);return{'found':!![],'msg':_0x5ce761[_0x32277d]};},parseMsgTags=_0x482ca1=>{const _0x458acc=_0x331998,_0xfaab06=[];let _0x12ed4e=0x0,_0x147a81;while((_0x147a81=TAG_REGEX['exec'](_0x482ca1))!==null){const _0x5656b6=_0x147a81[0x0],{index:_0x18f88e}=_0x147a81,_0x584259=_0x5656b6[_0x458acc(0x1ad)](0x1)==='/',_0xc7b594=_0x584259?_0x5656b6[_0x458acc(0x1a6)](0x2,-0x1):_0x5656b6[_0x458acc(0x1a6)](0x1,-0x1),_0x34b85c=ALLOWED_TAGS[_0x458acc(0x1a0)](_0xc7b594);if(!_0x34b85c)continue;const _0x28faa2=_0x482ca1['slice'](_0x12ed4e,_0x18f88e);if(!_0x28faa2){_0x12ed4e=_0x18f88e+_0x5656b6[_0x458acc(0x19e)];continue;}_0x584259?_0xfaab06['push']({'type':_0x458acc(0x19d),'name':_0x5656b6[_0x458acc(0x1a6)](0x2,-0x1),'content':_0x28faa2}):_0xfaab06['push']({'type':_0x458acc(0x1b0),'content':_0x28faa2}),_0x12ed4e=_0x18f88e+_0x5656b6[_0x458acc(0x19e)];}return _0x12ed4e<_0x482ca1[_0x458acc(0x19e)]&&_0xfaab06[_0x458acc(0x1ab)]({'type':_0x458acc(0x1b0),'content':_0x482ca1[_0x458acc(0x1a6)](_0x12ed4e)}),_0xfaab06;};function formatMsgWithTags(_0x40d607){const _0x28181a=_0x331998,_0x22aac0=parseMsgTags(_0x40d607),_0x566772=_0x22aac0[_0x28181a(0x1b9)](({content:_0x3ddf23,type:_0x4570f4,name:_0x4cf089},_0x30c221)=>{const _0x51ad45=_0x28181a,_0x4595b9=_0x4570f4!==_0x51ad45(0x1b0)&&_0x4cf089?_0x4cf089:_0x9de0a3[_0x51ad45(0x1b4)];return _0x9de0a3[_0x51ad45(0x1a8)](_0x4595b9,{'key':''+_0x30c221},_0x3ddf23);});return _0x566772;}function formatMsg(_0x8802c3,_0x201aaf,_0x3aebad){const _0x1b8118=sprintf(_0x8802c3,..._0x201aaf!==null&&_0x201aaf!==void 0x0?_0x201aaf:[]);if(!_0x3aebad)return _0x1b8118;return formatMsgWithTags(_0x1b8118);}const useTranslation=()=>{const _0xe82ba7=_0x331998,{lang:_0x461df0,debug:_0x100edc,pluralUtils:_0x1fd591,resources:_0x4841de}=_0x9de0a3[_0xe82ba7(0x1aa)](I18nContext);function _0x2fa4ea(_0x17f53b,_0x405b53){const _0x6d1c05=_0xe82ba7,{found:_0x2a76fc,msg:_0x7668ef}=getMsg(_0x17f53b,_0x4841de[_0x461df0],{'plural':_0x405b53===null||_0x405b53===void 0x0?void 0x0:_0x405b53['plural'],'pluralUtils':_0x1fd591});_0x100edc&&!_0x2a76fc&&console[_0x6d1c05(0x1b8)]('['+_0x461df0+_0x6d1c05(0x1b5)+_0x17f53b+_0x6d1c05(0x1c0));if(_0x405b53===null||_0x405b53===void 0x0?void 0x0:_0x405b53[_0x6d1c05(0x1ac)])return formatMsg(_0x7668ef,_0x405b53===null||_0x405b53===void 0x0?void 0x0:_0x405b53[_0x6d1c05(0x1be)],!![]);return formatMsg(_0x7668ef,_0x405b53===null||_0x405b53===void 0x0?void 0x0:_0x405b53['values'],![]);}return{'t':_0x2fa4ea,'lang':_0x461df0};};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.6.0-rc.3",
23
+ "version": "1.6.0",
24
24
  "description": "I18n utils of CKBox",
25
25
  "main": "dist/index.js",
26
26
  "types": "dist/index.d.ts",