@ckbox/i18n 1.4.0-rc.1 → 1.4.1-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
@@ -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.4.0-rc.1/ckbox.js"></script>
15
+ <script src="https://cdn.ckbox.io/ckbox/1.4.1-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.4.0-rc.1/ckbox.js"></script>
25
+ <script src="https://cdn.ckbox.io/ckbox/1.4.1-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.4.0-rc.1/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/1.4.1-rc.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 _0xab5ed9=_0x1ceb;(function(_0x3f0f5d,_0xeba3b0){const _0xf8b821=_0x1ceb,_0x43d0fd=_0x3f0f5d();while(!![]){try{const _0x5653d1=-parseInt(_0xf8b821(0x20a))/0x1*(-parseInt(_0xf8b821(0x201))/0x2)+-parseInt(_0xf8b821(0x1ed))/0x3*(-parseInt(_0xf8b821(0x1eb))/0x4)+parseInt(_0xf8b821(0x1e2))/0x5+-parseInt(_0xf8b821(0x1e3))/0x6*(parseInt(_0xf8b821(0x1fb))/0x7)+parseInt(_0xf8b821(0x1f1))/0x8+parseInt(_0xf8b821(0x207))/0x9*(parseInt(_0xf8b821(0x1f5))/0xa)+-parseInt(_0xf8b821(0x1e5))/0xb*(parseInt(_0xf8b821(0x1f0))/0xc);if(_0x5653d1===_0xeba3b0)break;else _0x43d0fd['push'](_0x43d0fd['shift']());}catch(_0x283a8f){_0x43d0fd['push'](_0x43d0fd['shift']());}}}(_0x50e0,0xd4a75));function _0x1ceb(_0x5b5d5a,_0x478e3b){const _0x50e0de=_0x50e0();return _0x1ceb=function(_0x1cebfd,_0x4340bf){_0x1cebfd=_0x1cebfd-0x1e2;let _0x3c2a79=_0x50e0de[_0x1cebfd];return _0x3c2a79;},_0x1ceb(_0x5b5d5a,_0x478e3b);}import*as _0x3ba0d4 from'react';import{sprintf}from'sprintf-js';function _0x50e0(){const _0x12d625=['getKey','8635150vjnwWo','7214340djZfbB','exec','33MBJPpJ','log','createContext','Fragment','plural','Provider','4fweJTI','Plural\x20form\x20for\x20language\x20\x22','532293PsXlNW','text','createElement','6600372eeYwbi','276192nXNdqu','keys','map','slice','580rKKdQU','PluralRules','filter','values','_rules','supportedLocalesOf','7JBnPSR','processTags','pluralUtils','useEffect','tag','push','5378APDoIH','warn','lang','useContext','length','includes','174681KNxnZy','select','\x22\x20is\x20not\x20supported.','245aDciBO','isSupported'];_0x50e0=function(){return _0x12d625;};return _0x50e0();}class Plural{constructor(_0x18baa9){const _0xf81512=_0x1ceb;this[_0xf81512(0x203)]=_0x18baa9;try{this[_0xf81512(0x1f9)]=new Intl[(_0xf81512(0x1f6))](_0x18baa9);}catch(_0x460c27){console['warn']('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}[_0xab5ed9(0x20c)](_0x4bcbbf,_0x257299){const _0x5cb817=_0xab5ed9;if(!this[_0x5cb817(0x1f9)])return _0x4bcbbf+'_one';const _0x36c3d8=this['_rules'][_0x5cb817(0x208)](_0x257299);return _0x4bcbbf+'_'+_0x36c3d8;}}Plural[_0xab5ed9(0x20b)]=_0x34b7f6=>{const _0x1db729=_0xab5ed9;try{return Intl[_0x1db729(0x1f6)][_0x1db729(0x1fa)]([_0x34b7f6])[_0x1db729(0x205)]>0x0;}catch(_0x438e13){return![];}};const I18nContext=_0x3ba0d4[_0xab5ed9(0x1e7)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x3e3331,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x3ee819=_0xab5ed9;return _0x3ba0d4[_0x3ee819(0x1fe)](()=>{const _0x52668e=_0x3ee819,_0x5a7e19=Plural[_0x52668e(0x20b)](lang);!_0x5a7e19&&console[_0x52668e(0x202)](_0x52668e(0x1ec)+lang+_0x52668e(0x209));},[lang]),_0x3ba0d4[_0x3ee819(0x1ef)](I18nContext[_0x3ee819(0x1ea)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x3e3331);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em','strong','code'],getMsg=(_0x4909a7,_0x1206fd={},_0x2e473c)=>{const _0x534e25=_0xab5ed9,_0xe96a68=_0x2e473c[_0x534e25(0x1e9)];if(_0x1206fd[_0x4909a7]&&_0xe96a68===undefined)return{'found':!![],'msg':_0x1206fd[_0x4909a7]};const _0x26555d=Object[_0x534e25(0x1f2)](_0x1206fd)[_0x534e25(0x1f7)](_0x3c7085=>_0x3c7085['indexOf'](_0x4909a7)===0x0);if(_0x26555d[_0x534e25(0x205)]===0x0||_0xe96a68===undefined)return{'found':![],'msg':_0x4909a7};const _0x5a0a31=_0x2e473c[_0x534e25(0x1fd)]['getKey'](_0x4909a7,_0xe96a68);return{'found':!![],'msg':_0x1206fd[_0x5a0a31]};},parseMsgTags=_0xd7fe9f=>{const _0x48cfc3=_0xab5ed9,_0x4adff0=[];let _0x588d59=0x0,_0x20ae2b;while((_0x20ae2b=TAG_REGEX[_0x48cfc3(0x1e4)](_0xd7fe9f))!==null){const _0x1aa478=_0x20ae2b[0x0],{index:_0x600a09}=_0x20ae2b,_0x2d82eb=_0x1aa478['charAt'](0x1)==='/',_0xb5d4e9=_0x2d82eb?_0x1aa478[_0x48cfc3(0x1f4)](0x2,-0x1):_0x1aa478[_0x48cfc3(0x1f4)](0x1,-0x1),_0x1c2d32=ALLOWED_TAGS[_0x48cfc3(0x206)](_0xb5d4e9);if(!_0x1c2d32)continue;const _0x1025fb=_0xd7fe9f[_0x48cfc3(0x1f4)](_0x588d59,_0x600a09);if(!_0x1025fb){_0x588d59=_0x600a09+_0x1aa478[_0x48cfc3(0x205)];continue;}_0x2d82eb?_0x4adff0[_0x48cfc3(0x200)]({'type':_0x48cfc3(0x1ff),'name':_0x1aa478[_0x48cfc3(0x1f4)](0x2,-0x1),'content':_0x1025fb}):_0x4adff0[_0x48cfc3(0x200)]({'type':_0x48cfc3(0x1ee),'content':_0x1025fb}),_0x588d59=_0x600a09+_0x1aa478[_0x48cfc3(0x205)];}return _0x588d59<_0xd7fe9f[_0x48cfc3(0x205)]&&_0x4adff0[_0x48cfc3(0x200)]({'type':_0x48cfc3(0x1ee),'content':_0xd7fe9f[_0x48cfc3(0x1f4)](_0x588d59)}),_0x4adff0;};function formatMsgWithTags(_0x19385b){const _0x73f48a=_0xab5ed9,_0x1ec9d9=parseMsgTags(_0x19385b),_0x113377=_0x1ec9d9[_0x73f48a(0x1f3)](({content:_0x2ea71d,type:_0x53bdc8,name:_0x293a06},_0x41090c)=>{const _0x54c428=_0x73f48a,_0x35aa8e=_0x53bdc8!==_0x54c428(0x1ee)&&_0x293a06?_0x293a06:_0x3ba0d4[_0x54c428(0x1e8)];return _0x3ba0d4['createElement'](_0x35aa8e,{'key':''+_0x41090c},_0x2ea71d);});return _0x113377;}function formatMsg(_0x2d7d9a,_0x2a970f,_0x2d6ad0){const _0x44d1bd=sprintf(_0x2d7d9a,..._0x2a970f!==null&&_0x2a970f!==void 0x0?_0x2a970f:[]);if(!_0x2d6ad0)return _0x44d1bd;return formatMsgWithTags(_0x44d1bd);}const useTranslation=()=>{const _0x48ce44=_0xab5ed9,{lang:_0x2aac58,debug:_0x3d5269,pluralUtils:_0x180175,resources:_0x26ec45}=_0x3ba0d4[_0x48ce44(0x204)](I18nContext);function _0x3bfbe2(_0x3a79f4,_0x285b6e){const _0x36f2a0=_0x48ce44,{found:_0x465b6b,msg:_0x1ec200}=getMsg(_0x3a79f4,_0x26ec45[_0x2aac58],{'plural':_0x285b6e===null||_0x285b6e===void 0x0?void 0x0:_0x285b6e[_0x36f2a0(0x1e9)],'pluralUtils':_0x180175});_0x3d5269&&!_0x465b6b&&console[_0x36f2a0(0x1e6)]('['+_0x2aac58+']:\x20Translation\x20for\x20key\x20\x27'+_0x3a79f4+'\x27\x20is\x20missing.');if(_0x285b6e===null||_0x285b6e===void 0x0?void 0x0:_0x285b6e[_0x36f2a0(0x1fc)])return formatMsg(_0x1ec200,_0x285b6e===null||_0x285b6e===void 0x0?void 0x0:_0x285b6e['values'],!![]);return formatMsg(_0x1ec200,_0x285b6e===null||_0x285b6e===void 0x0?void 0x0:_0x285b6e[_0x36f2a0(0x1f8)],![]);}return{'t':_0x3bfbe2,'lang':_0x2aac58};};export{I18nContext,I18nProvider,useTranslation};
4
+ function _0x3111(_0x169df2,_0x69cbae){const _0x23bb99=_0x23bb();return _0x3111=function(_0x31112b,_0x22cc0e){_0x31112b=_0x31112b-0x11a;let _0xa146a3=_0x23bb99[_0x31112b];return _0xa146a3;},_0x3111(_0x169df2,_0x69cbae);}const _0x35f909=_0x3111;(function(_0x3e81d0,_0x4c21d4){const _0x19aa2c=_0x3111,_0x3cc8c3=_0x3e81d0();while(!![]){try{const _0x370839=-parseInt(_0x19aa2c(0x11a))/0x1+-parseInt(_0x19aa2c(0x11e))/0x2*(-parseInt(_0x19aa2c(0x12a))/0x3)+-parseInt(_0x19aa2c(0x141))/0x4+parseInt(_0x19aa2c(0x11b))/0x5+parseInt(_0x19aa2c(0x135))/0x6*(-parseInt(_0x19aa2c(0x13d))/0x7)+-parseInt(_0x19aa2c(0x11c))/0x8*(-parseInt(_0x19aa2c(0x12b))/0x9)+parseInt(_0x19aa2c(0x143))/0xa*(-parseInt(_0x19aa2c(0x122))/0xb);if(_0x370839===_0x4c21d4)break;else _0x3cc8c3['push'](_0x3cc8c3['shift']());}catch(_0x13d9f5){_0x3cc8c3['push'](_0x3cc8c3['shift']());}}}(_0x23bb,0x37f30));import*as _0x102945 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x4e781c){const _0x35c099=_0x3111;this[_0x35c099(0x142)]=_0x4e781c;try{this[_0x35c099(0x124)]=new Intl['PluralRules'](_0x4e781c);}catch(_0x1c1d17){console[_0x35c099(0x11d)](_0x35c099(0x130));}}['getKey'](_0x53daa5,_0x24682a){const _0x37af2a=_0x3111;if(!this['_rules'])return _0x53daa5+_0x37af2a(0x138);const _0x2128d8=this[_0x37af2a(0x124)][_0x37af2a(0x12d)](_0x24682a);return _0x53daa5+'_'+_0x2128d8;}}Plural[_0x35f909(0x131)]=_0x3fda5a=>{const _0x12afec=_0x35f909;try{return Intl['PluralRules'][_0x12afec(0x126)]([_0x3fda5a])['length']>0x0;}catch(_0x247d8a){return![];}};const I18nContext=_0x102945[_0x35f909(0x137)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x55e851,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x413b3e=_0x35f909;return _0x102945[_0x413b3e(0x13f)](()=>{const _0x249478=_0x413b3e,_0x319781=Plural['isSupported'](lang);!_0x319781&&console[_0x249478(0x11d)]('Plural\x20form\x20for\x20language\x20\x22'+lang+_0x249478(0x121));},[lang]),_0x102945[_0x413b3e(0x12f)](I18nContext[_0x413b3e(0x12c)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x55e851);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x35f909(0x13e),'code'],getMsg=(_0xe47e33,_0x235b07={},_0x1230be)=>{const _0x19ef29=_0x35f909,_0x1e883a=_0x1230be[_0x19ef29(0x133)];if(_0x235b07[_0xe47e33]&&_0x1e883a===undefined)return{'found':!![],'msg':_0x235b07[_0xe47e33]};const _0x11de53=Object[_0x19ef29(0x12e)](_0x235b07)['filter'](_0x409a97=>_0x409a97[_0x19ef29(0x140)](_0xe47e33)===0x0);if(_0x11de53[_0x19ef29(0x13b)]===0x0||_0x1e883a===undefined)return{'found':![],'msg':_0xe47e33};const _0x54df51=_0x1230be[_0x19ef29(0x129)]['getKey'](_0xe47e33,_0x1e883a);return{'found':!![],'msg':_0x235b07[_0x54df51]};},parseMsgTags=_0x59bd71=>{const _0x31bc68=_0x35f909,_0x22acdd=[];let _0x2d30e1=0x0,_0x4353dd;while((_0x4353dd=TAG_REGEX[_0x31bc68(0x132)](_0x59bd71))!==null){const _0xa69a54=_0x4353dd[0x0],{index:_0x47a2dc}=_0x4353dd,_0x9dc3ed=_0xa69a54['charAt'](0x1)==='/',_0x57f2f2=_0x9dc3ed?_0xa69a54['slice'](0x2,-0x1):_0xa69a54[_0x31bc68(0x123)](0x1,-0x1),_0x3209ce=ALLOWED_TAGS[_0x31bc68(0x144)](_0x57f2f2);if(!_0x3209ce)continue;const _0x450428=_0x59bd71[_0x31bc68(0x123)](_0x2d30e1,_0x47a2dc);if(!_0x450428){_0x2d30e1=_0x47a2dc+_0xa69a54[_0x31bc68(0x13b)];continue;}_0x9dc3ed?_0x22acdd['push']({'type':_0x31bc68(0x128),'name':_0xa69a54['slice'](0x2,-0x1),'content':_0x450428}):_0x22acdd['push']({'type':_0x31bc68(0x11f),'content':_0x450428}),_0x2d30e1=_0x47a2dc+_0xa69a54[_0x31bc68(0x13b)];}return _0x2d30e1<_0x59bd71[_0x31bc68(0x13b)]&&_0x22acdd[_0x31bc68(0x13a)]({'type':_0x31bc68(0x11f),'content':_0x59bd71[_0x31bc68(0x123)](_0x2d30e1)}),_0x22acdd;};function formatMsgWithTags(_0x3002a2){const _0x567b9b=_0x35f909,_0x40904b=parseMsgTags(_0x3002a2),_0x29adbb=_0x40904b[_0x567b9b(0x134)](({content:_0x133b01,type:_0x4edbe9,name:_0x471ea0},_0x53bd54)=>{const _0x413a29=_0x567b9b,_0x23c751=_0x4edbe9!==_0x413a29(0x11f)&&_0x471ea0?_0x471ea0:_0x102945[_0x413a29(0x120)];return _0x102945[_0x413a29(0x12f)](_0x23c751,{'key':''+_0x53bd54},_0x133b01);});return _0x29adbb;}function formatMsg(_0x1eef35,_0x49cf26,_0x19b446){const _0x2d0f8e=sprintf(_0x1eef35,..._0x49cf26!==null&&_0x49cf26!==void 0x0?_0x49cf26:[]);if(!_0x19b446)return _0x2d0f8e;return formatMsgWithTags(_0x2d0f8e);}function _0x23bb(){const _0x3b7247=['\x22\x20is\x20not\x20supported.','11QIyAJJ','slice','_rules',']:\x20Translation\x20for\x20key\x20\x27','supportedLocalesOf','processTags','tag','pluralUtils','1092ghrxlA','111861gUVAJG','Provider','select','keys','createElement','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','isSupported','exec','plural','map','6Hjofwk','\x27\x20is\x20missing.','createContext','_one','useContext','push','length','values','701519zOrYoi','strong','useEffect','indexOf','473000GIielf','lang','170490gCDjad','includes','log','58230ccGMTC','325400VeFMuF','208hQyKnk','warn','740ZfXbNG','text','Fragment'];_0x23bb=function(){return _0x3b7247;};return _0x23bb();}const useTranslation=()=>{const _0x450b54=_0x35f909,{lang:_0x4039c4,debug:_0x53a5a7,pluralUtils:_0xdbf7f0,resources:_0x391df7}=_0x102945[_0x450b54(0x139)](I18nContext);function _0x18e10c(_0x4112e6,_0x2e8e85){const _0x1562ab=_0x450b54,{found:_0x2df6dc,msg:_0x3f24e0}=getMsg(_0x4112e6,_0x391df7[_0x4039c4],{'plural':_0x2e8e85===null||_0x2e8e85===void 0x0?void 0x0:_0x2e8e85[_0x1562ab(0x133)],'pluralUtils':_0xdbf7f0});_0x53a5a7&&!_0x2df6dc&&console[_0x1562ab(0x145)]('['+_0x4039c4+_0x1562ab(0x125)+_0x4112e6+_0x1562ab(0x136));if(_0x2e8e85===null||_0x2e8e85===void 0x0?void 0x0:_0x2e8e85[_0x1562ab(0x127)])return formatMsg(_0x3f24e0,_0x2e8e85===null||_0x2e8e85===void 0x0?void 0x0:_0x2e8e85['values'],!![]);return formatMsg(_0x3f24e0,_0x2e8e85===null||_0x2e8e85===void 0x0?void 0x0:_0x2e8e85[_0x1562ab(0x13c)],![]);}return{'t':_0x18e10c,'lang':_0x4039c4};};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.4.0-rc.1",
23
+ "version": "1.4.1-rc.0",
24
24
  "description": "I18n utils of CKBox",
25
25
  "main": "dist/index.js",
26
26
  "types": "dist/index.d.ts",