@ckbox/i18n 2.9.0-rc.0 → 2.9.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 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.9.0-rc.0/ckbox.js"></script>
16
+ <script src="https://cdn.ckbox.io/ckbox/2.9.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.9.0-rc.0/ckbox.js"></script>
26
+ <script src="https://cdn.ckbox.io/ckbox/2.9.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.9.0-rc.0/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/2.9.0-rc.1/ckbox.js"></script>
52
52
  <link
53
53
  rel="stylesheet"
54
- href="https://cdn.ckbox.io/ckbox/2.9.0-rc.0/styles/themes/lark.css"
54
+ href="https://cdn.ckbox.io/ckbox/2.9.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
- const _0x1670b1=_0x444f;function _0x1e25(){const _0x824918=['_one','623357ZsEoKJ','log','\x27\x20is\x20missing.','filter','_rules','30PROBCJ','isSupported','values','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','supportedLocalesOf','select','useEffect','1SjlBTS','warn','35nGTQGA','PluralRules','plural','153848laWHqq','includes','1392RFBgzV','map','getKey','push','698236qHyVWv','914856ZvcpRu','63VcSVIN','length','tag','slice','createElement','strong','620068fpADbh','65lyMWom','charAt','lang','exec','processTags','Plural\x20form\x20for\x20language\x20\x22','595380IVUqHT','42OnXfDr',']:\x20Translation\x20for\x20key\x20\x27','keys','indexOf'];_0x1e25=function(){return _0x824918;};return _0x1e25();}(function(_0x10ecd4,_0x255591){const _0x317177=_0x444f,_0x34a56b=_0x10ecd4();while(!![]){try{const _0x3406a9=parseInt(_0x317177(0x16a))/0x1*(parseInt(_0x317177(0x151))/0x2)+parseInt(_0x317177(0x14a))/0x3+-parseInt(_0x317177(0x16f))/0x4*(-parseInt(_0x317177(0x16c))/0x5)+parseInt(_0x317177(0x159))/0x6*(-parseInt(_0x317177(0x15e))/0x7)+parseInt(_0x317177(0x171))/0x8*(parseInt(_0x317177(0x14b))/0x9)+parseInt(_0x317177(0x163))/0xa*(-parseInt(_0x317177(0x175))/0xb)+parseInt(_0x317177(0x158))/0xc*(parseInt(_0x317177(0x152))/0xd);if(_0x3406a9===_0x255591)break;else _0x34a56b['push'](_0x34a56b['shift']());}catch(_0x1a5466){_0x34a56b['push'](_0x34a56b['shift']());}}}(_0x1e25,0x4e0f0));import*as _0x29980a from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x19a62a){const _0x1f8658=_0x444f;this[_0x1f8658(0x154)]=_0x19a62a;try{this[_0x1f8658(0x162)]=new Intl[(_0x1f8658(0x16d))](_0x19a62a);}catch(_0x34beda){console[_0x1f8658(0x16b)](_0x1f8658(0x166));}}[_0x1670b1(0x173)](_0x588746,_0xdaf734){const _0x5d8627=_0x1670b1;if(!this[_0x5d8627(0x162)])return _0x588746+_0x5d8627(0x15d);const _0x47b7b8=this['_rules'][_0x5d8627(0x168)](_0xdaf734);return _0x588746+'_'+_0x47b7b8;}}Plural[_0x1670b1(0x164)]=_0x3a1acd=>{const _0x5d0e88=_0x1670b1;try{return Intl[_0x5d0e88(0x16d)][_0x5d0e88(0x167)]([_0x3a1acd])[_0x5d0e88(0x14c)]>0x0;}catch(_0x3e0db3){return![];}};const I18nContext=_0x29980a['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x34eb36,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x2b8658=_0x1670b1;return _0x29980a[_0x2b8658(0x169)](()=>{const _0x510d5c=_0x2b8658,_0x2057a5=Plural['isSupported'](lang);!_0x2057a5&&console[_0x510d5c(0x16b)](_0x510d5c(0x157)+lang+'\x22\x20is\x20not\x20supported.');},[lang]),_0x29980a[_0x2b8658(0x14f)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x34eb36);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x1670b1(0x150),'code'],getMsg=(_0x44f799,_0x2c2ba0={},_0x1b722f)=>{const _0xa3adc3=_0x1670b1,_0x189368=_0x1b722f[_0xa3adc3(0x16e)];if(_0x2c2ba0[_0x44f799]&&_0x189368===undefined)return{'found':!![],'msg':_0x2c2ba0[_0x44f799]};const _0x6a7c8c=Object[_0xa3adc3(0x15b)](_0x2c2ba0)[_0xa3adc3(0x161)](_0x27e613=>_0x27e613[_0xa3adc3(0x15c)](_0x44f799)===0x0);if(_0x6a7c8c[_0xa3adc3(0x14c)]===0x0||_0x189368===undefined)return{'found':![],'msg':_0x44f799};const _0x4d62c0=_0x1b722f['pluralUtils'][_0xa3adc3(0x173)](_0x44f799,_0x189368);return{'found':!![],'msg':_0x2c2ba0[_0x4d62c0]};},parseMsgTags=_0xa88d04=>{const _0x523e16=_0x1670b1,_0x47596c=[];let _0x3724fd=0x0,_0x2fca07;while((_0x2fca07=TAG_REGEX[_0x523e16(0x155)](_0xa88d04))!==null){const _0x44325c=_0x2fca07[0x0],{index:_0x2c782d}=_0x2fca07,_0x4ef030=_0x44325c[_0x523e16(0x153)](0x1)==='/',_0x1f0160=_0x4ef030?_0x44325c[_0x523e16(0x14e)](0x2,-0x1):_0x44325c['slice'](0x1,-0x1),_0x44bef6=ALLOWED_TAGS[_0x523e16(0x170)](_0x1f0160);if(!_0x44bef6)continue;const _0x2a42c7=_0xa88d04[_0x523e16(0x14e)](_0x3724fd,_0x2c782d);if(!_0x2a42c7){_0x3724fd=_0x2c782d+_0x44325c[_0x523e16(0x14c)];continue;}_0x4ef030?_0x47596c[_0x523e16(0x174)]({'type':_0x523e16(0x14d),'name':_0x44325c[_0x523e16(0x14e)](0x2,-0x1),'content':_0x2a42c7}):_0x47596c['push']({'type':'text','content':_0x2a42c7}),_0x3724fd=_0x2c782d+_0x44325c[_0x523e16(0x14c)];}return _0x3724fd<_0xa88d04[_0x523e16(0x14c)]&&_0x47596c['push']({'type':'text','content':_0xa88d04[_0x523e16(0x14e)](_0x3724fd)}),_0x47596c;};function formatMsgWithTags(_0x467cc0){const _0x158d4b=_0x1670b1,_0x9a69c1=parseMsgTags(_0x467cc0),_0xbb973=_0x9a69c1[_0x158d4b(0x172)](({content:_0x424d51,type:_0x19730e,name:_0x527fcb},_0x4d6d17)=>{const _0x50b7ce=_0x19730e!=='text'&&_0x527fcb?_0x527fcb:_0x29980a['Fragment'];return _0x29980a['createElement'](_0x50b7ce,{'key':''+_0x4d6d17},_0x424d51);});return _0xbb973;}function formatMsg(_0x5a797f,_0x254eeb,_0x203e22){const _0x15bb6f=sprintf(_0x5a797f,..._0x254eeb!==null&&_0x254eeb!==void 0x0?_0x254eeb:[]);if(!_0x203e22)return _0x15bb6f;return formatMsgWithTags(_0x15bb6f);}const useTranslation=()=>{const {lang:_0x4f70e6,debug:_0x16cb18,pluralUtils:_0x5bacd2,resources:_0x59e235}=_0x29980a['useContext'](I18nContext);function _0x32d458(_0x3b95ff,_0x4d1aa6){const _0x547e8b=_0x444f,{found:_0x23eac7,msg:_0x2c2a37}=getMsg(_0x3b95ff,_0x59e235[_0x4f70e6],{'plural':_0x4d1aa6===null||_0x4d1aa6===void 0x0?void 0x0:_0x4d1aa6[_0x547e8b(0x16e)],'pluralUtils':_0x5bacd2});_0x16cb18&&!_0x23eac7&&console[_0x547e8b(0x15f)]('['+_0x4f70e6+_0x547e8b(0x15a)+_0x3b95ff+_0x547e8b(0x160));if(_0x4d1aa6===null||_0x4d1aa6===void 0x0?void 0x0:_0x4d1aa6[_0x547e8b(0x156)])return formatMsg(_0x2c2a37,_0x4d1aa6===null||_0x4d1aa6===void 0x0?void 0x0:_0x4d1aa6[_0x547e8b(0x165)],!![]);return formatMsg(_0x2c2a37,_0x4d1aa6===null||_0x4d1aa6===void 0x0?void 0x0:_0x4d1aa6[_0x547e8b(0x165)],![]);}return{'t':_0x32d458,'lang':_0x4f70e6};};function _0x444f(_0xc1dced,_0x211b6e){const _0x1e255f=_0x1e25();return _0x444f=function(_0x444f45,_0x2ebbdb){_0x444f45=_0x444f45-0x14a;let _0x5df6c6=_0x1e255f[_0x444f45];return _0x5df6c6;},_0x444f(_0xc1dced,_0x211b6e);}export{I18nContext,I18nProvider,useTranslation};
4
+ const _0x517e53=_0x32d7;function _0x2dcb(){const _0x475abe=['strong','pluralUtils','length','10zTgEic','\x27\x20is\x20missing.','isSupported','_rules','PluralRules','filter','text','slice','charAt','39LdFtRZ','Fragment','tag','plural','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','includes','select','2017614UBZjNe','8461863lLmKdr','1482665dnfazz','94624ixwPQG','lang','createContext','exec','createElement','warn','getKey','push','452344UPqgXW','1WoorMF','map','code','54776hRmUoo','_one','1052982dlHesU','\x22\x20is\x20not\x20supported.','log','useEffect'];_0x2dcb=function(){return _0x475abe;};return _0x2dcb();}(function(_0x58abfd,_0x1b5873){const _0x562492=_0x32d7,_0x3be8f5=_0x58abfd();while(!![]){try{const _0x56b18c=parseInt(_0x562492(0x19d))/0x1*(-parseInt(_0x562492(0x194))/0x2)+parseInt(_0x562492(0x18a))/0x3*(-parseInt(_0x562492(0x1a0))/0x4)+-parseInt(_0x562492(0x193))/0x5+-parseInt(_0x562492(0x191))/0x6+parseInt(_0x562492(0x17a))/0x7+-parseInt(_0x562492(0x19c))/0x8+-parseInt(_0x562492(0x192))/0x9*(-parseInt(_0x562492(0x181))/0xa);if(_0x56b18c===_0x1b5873)break;else _0x3be8f5['push'](_0x3be8f5['shift']());}catch(_0x51dc24){_0x3be8f5['push'](_0x3be8f5['shift']());}}}(_0x2dcb,0x2af52));function _0x32d7(_0x240735,_0xf5773f){const _0x2dcb69=_0x2dcb();return _0x32d7=function(_0x32d787,_0xf24c9b){_0x32d787=_0x32d787-0x179;let _0x44a155=_0x2dcb69[_0x32d787];return _0x44a155;},_0x32d7(_0x240735,_0xf5773f);}import*as _0x23134e from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x595c9d){const _0x3ce782=_0x32d7;this[_0x3ce782(0x195)]=_0x595c9d;try{this['_rules']=new Intl[(_0x3ce782(0x185))](_0x595c9d);}catch(_0x111f4c){console['warn'](_0x3ce782(0x18e));}}[_0x517e53(0x19a)](_0x1489c9,_0x4174bd){const _0xeab506=_0x517e53;if(!this[_0xeab506(0x184)])return _0x1489c9+_0xeab506(0x179);const _0x46b5e5=this[_0xeab506(0x184)][_0xeab506(0x190)](_0x4174bd);return _0x1489c9+'_'+_0x46b5e5;}}Plural[_0x517e53(0x183)]=_0x15c793=>{const _0x543074=_0x517e53;try{return Intl[_0x543074(0x185)]['supportedLocalesOf']([_0x15c793])['length']>0x0;}catch(_0x1981f6){return![];}};const I18nContext=_0x23134e[_0x517e53(0x196)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x3dff54,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x578b8a=_0x517e53;return _0x23134e[_0x578b8a(0x17d)](()=>{const _0x1e2744=_0x578b8a,_0x2b20fe=Plural['isSupported'](lang);!_0x2b20fe&&console[_0x1e2744(0x199)]('Plural\x20form\x20for\x20language\x20\x22'+lang+_0x1e2744(0x17b));},[lang]),_0x23134e[_0x578b8a(0x198)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x3dff54);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x517e53(0x17e),_0x517e53(0x19f)],getMsg=(_0x534328,_0xc57f5e={},_0x15e198)=>{const _0x18843f=_0x517e53,_0x5b70a2=_0x15e198['plural'];if(_0xc57f5e[_0x534328]&&_0x5b70a2===undefined)return{'found':!![],'msg':_0xc57f5e[_0x534328]};const _0x151771=Object['keys'](_0xc57f5e)[_0x18843f(0x186)](_0x397849=>_0x397849['indexOf'](_0x534328)===0x0);if(_0x151771[_0x18843f(0x180)]===0x0||_0x5b70a2===undefined)return{'found':![],'msg':_0x534328};const _0x5be878=_0x15e198[_0x18843f(0x17f)]['getKey'](_0x534328,_0x5b70a2);return{'found':!![],'msg':_0xc57f5e[_0x5be878]};},parseMsgTags=_0x34f5c3=>{const _0xac2416=_0x517e53,_0x673ea1=[];let _0x4d1a92=0x0,_0x5ef956;while((_0x5ef956=TAG_REGEX[_0xac2416(0x197)](_0x34f5c3))!==null){const _0x415e36=_0x5ef956[0x0],{index:_0x1f321c}=_0x5ef956,_0x6c0922=_0x415e36[_0xac2416(0x189)](0x1)==='/',_0x65ba75=_0x6c0922?_0x415e36[_0xac2416(0x188)](0x2,-0x1):_0x415e36['slice'](0x1,-0x1),_0x168a94=ALLOWED_TAGS[_0xac2416(0x18f)](_0x65ba75);if(!_0x168a94)continue;const _0x4ecf48=_0x34f5c3[_0xac2416(0x188)](_0x4d1a92,_0x1f321c);if(!_0x4ecf48){_0x4d1a92=_0x1f321c+_0x415e36['length'];continue;}_0x6c0922?_0x673ea1[_0xac2416(0x19b)]({'type':_0xac2416(0x18c),'name':_0x415e36[_0xac2416(0x188)](0x2,-0x1),'content':_0x4ecf48}):_0x673ea1[_0xac2416(0x19b)]({'type':_0xac2416(0x187),'content':_0x4ecf48}),_0x4d1a92=_0x1f321c+_0x415e36['length'];}return _0x4d1a92<_0x34f5c3[_0xac2416(0x180)]&&_0x673ea1[_0xac2416(0x19b)]({'type':_0xac2416(0x187),'content':_0x34f5c3[_0xac2416(0x188)](_0x4d1a92)}),_0x673ea1;};function formatMsgWithTags(_0x466338){const _0x5a5ed6=_0x517e53,_0x4bdb30=parseMsgTags(_0x466338),_0x5ed1c5=_0x4bdb30[_0x5a5ed6(0x19e)](({content:_0x1c769c,type:_0x32c1e1,name:_0x5cb6b9},_0x1e5062)=>{const _0xb24aac=_0x5a5ed6,_0x59a680=_0x32c1e1!==_0xb24aac(0x187)&&_0x5cb6b9?_0x5cb6b9:_0x23134e[_0xb24aac(0x18b)];return _0x23134e[_0xb24aac(0x198)](_0x59a680,{'key':''+_0x1e5062},_0x1c769c);});return _0x5ed1c5;}function formatMsg(_0x2f496c,_0x18958c,_0x3f30e4){const _0x15ed23=sprintf(_0x2f496c,..._0x18958c!==null&&_0x18958c!==void 0x0?_0x18958c:[]);if(!_0x3f30e4)return _0x15ed23;return formatMsgWithTags(_0x15ed23);}const useTranslation=()=>{const {lang:_0x39977b,debug:_0x21fafb,pluralUtils:_0x525ccf,resources:_0x443f03}=_0x23134e['useContext'](I18nContext);function _0x1aad72(_0x2d9df0,_0x57da04){const _0x1d57df=_0x32d7,{found:_0x3c79cb,msg:_0x2cb8b9}=getMsg(_0x2d9df0,_0x443f03[_0x39977b],{'plural':_0x57da04===null||_0x57da04===void 0x0?void 0x0:_0x57da04[_0x1d57df(0x18d)],'pluralUtils':_0x525ccf});_0x21fafb&&!_0x3c79cb&&console[_0x1d57df(0x17c)]('['+_0x39977b+']:\x20Translation\x20for\x20key\x20\x27'+_0x2d9df0+_0x1d57df(0x182));if(_0x57da04===null||_0x57da04===void 0x0?void 0x0:_0x57da04['processTags'])return formatMsg(_0x2cb8b9,_0x57da04===null||_0x57da04===void 0x0?void 0x0:_0x57da04['values'],!![]);return formatMsg(_0x2cb8b9,_0x57da04===null||_0x57da04===void 0x0?void 0x0:_0x57da04['values'],![]);}return{'t':_0x1aad72,'lang':_0x39977b};};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.9.0-rc.0",
25
+ "version": "2.9.0-rc.1",
26
26
  "description": "I18n utils of CKBox",
27
27
  "main": "dist/index.js",
28
28
  "types": "dist/index.d.ts",