@ckbox/i18n 2.9.0-rc.4 → 2.9.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.9.0-rc.4/ckbox.js"></script>
16
+ <script src="https://cdn.ckbox.io/ckbox/2.9.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.9.0-rc.4/ckbox.js"></script>
26
+ <script src="https://cdn.ckbox.io/ckbox/2.9.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.9.0-rc.4/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/2.9.0/ckbox.js"></script>
52
52
  <link
53
53
  rel="stylesheet"
54
- href="https://cdn.ckbox.io/ckbox/2.9.0-rc.4/styles/themes/lark.css"
54
+ href="https://cdn.ckbox.io/ckbox/2.9.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 _0x1bc0f5=_0x2118;(function(_0x395f1b,_0x644a8d){const _0x843455=_0x2118,_0x37b37d=_0x395f1b();while(!![]){try{const _0x4a7a45=-parseInt(_0x843455(0xa1))/0x1+-parseInt(_0x843455(0x8d))/0x2+-parseInt(_0x843455(0x9a))/0x3*(-parseInt(_0x843455(0xa3))/0x4)+parseInt(_0x843455(0x8a))/0x5+parseInt(_0x843455(0x88))/0x6+parseInt(_0x843455(0x8c))/0x7+-parseInt(_0x843455(0xa2))/0x8*(-parseInt(_0x843455(0x90))/0x9);if(_0x4a7a45===_0x644a8d)break;else _0x37b37d['push'](_0x37b37d['shift']());}catch(_0x3d18f0){_0x37b37d['push'](_0x37b37d['shift']());}}}(_0x30d5,0xb0287));import*as _0x30a93a from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x52c3c6){const _0x5d5235=_0x2118;this[_0x5d5235(0x87)]=_0x52c3c6;try{this[_0x5d5235(0x93)]=new Intl['PluralRules'](_0x52c3c6);}catch(_0x1ac034){console[_0x5d5235(0xb0)](_0x5d5235(0xa0));}}[_0x1bc0f5(0x94)](_0x147f3d,_0x5c9e32){const _0x2aa1b1=_0x1bc0f5;if(!this[_0x2aa1b1(0x93)])return _0x147f3d+_0x2aa1b1(0x96);const _0x479959=this[_0x2aa1b1(0x93)][_0x2aa1b1(0xa5)](_0x5c9e32);return _0x147f3d+'_'+_0x479959;}}function _0x30d5(){const _0x37c28a=['\x22\x20is\x20not\x20supported.','5629267FtAdzS','2793572WTiOMk','keys','Plural\x20form\x20for\x20language\x20\x22','3124728tDXAUV','text','map','_rules','getKey','createElement','_one','pluralUtils','indexOf','push','7818uVqlCu',']:\x20Translation\x20for\x20key\x20\x27','Provider','useEffect','filter','exec','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','248466xWXGYh','8xNyqnd','200mxCjti','length','select','useContext','log','\x27\x20is\x20missing.','processTags','createContext','values','isSupported','slice','Fragment','charAt','warn','lang','2533164qwEqUK','PluralRules','3314640kNjaJe'];_0x30d5=function(){return _0x37c28a;};return _0x30d5();}function _0x2118(_0x42305b,_0x551cac){const _0x30d51e=_0x30d5();return _0x2118=function(_0x2118ad,_0x2bed92){_0x2118ad=_0x2118ad-0x87;let _0x40a4e7=_0x30d51e[_0x2118ad];return _0x40a4e7;},_0x2118(_0x42305b,_0x551cac);}Plural['isSupported']=_0x53f242=>{const _0x10dcc6=_0x1bc0f5;try{return Intl[_0x10dcc6(0x89)]['supportedLocalesOf']([_0x53f242])[_0x10dcc6(0xa4)]>0x0;}catch(_0x3ffa8b){return![];}};const I18nContext=_0x30a93a[_0x1bc0f5(0xaa)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x5d3d02,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x4d975d=_0x1bc0f5;return _0x30a93a[_0x4d975d(0x9d)](()=>{const _0x31eebb=_0x4d975d,_0x27cd8b=Plural[_0x31eebb(0xac)](lang);!_0x27cd8b&&console['warn'](_0x31eebb(0x8f)+lang+_0x31eebb(0x8b));},[lang]),_0x30a93a[_0x4d975d(0x95)](I18nContext[_0x4d975d(0x9c)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x5d3d02);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em','strong','code'],getMsg=(_0xe5e440,_0x5978fe={},_0x21a734)=>{const _0x576df4=_0x1bc0f5,_0x4367d9=_0x21a734['plural'];if(_0x5978fe[_0xe5e440]&&_0x4367d9===undefined)return{'found':!![],'msg':_0x5978fe[_0xe5e440]};const _0x318548=Object[_0x576df4(0x8e)](_0x5978fe)[_0x576df4(0x9e)](_0x5f0268=>_0x5f0268[_0x576df4(0x98)](_0xe5e440)===0x0);if(_0x318548[_0x576df4(0xa4)]===0x0||_0x4367d9===undefined)return{'found':![],'msg':_0xe5e440};const _0x472c64=_0x21a734[_0x576df4(0x97)][_0x576df4(0x94)](_0xe5e440,_0x4367d9);return{'found':!![],'msg':_0x5978fe[_0x472c64]};},parseMsgTags=_0xa7d3c6=>{const _0x2b9a91=_0x1bc0f5,_0x362b8d=[];let _0x39d393=0x0,_0x2a8366;while((_0x2a8366=TAG_REGEX[_0x2b9a91(0x9f)](_0xa7d3c6))!==null){const _0x477b0f=_0x2a8366[0x0],{index:_0x145f9f}=_0x2a8366,_0x115099=_0x477b0f[_0x2b9a91(0xaf)](0x1)==='/',_0x5b6c45=_0x115099?_0x477b0f[_0x2b9a91(0xad)](0x2,-0x1):_0x477b0f[_0x2b9a91(0xad)](0x1,-0x1),_0x24e0fb=ALLOWED_TAGS['includes'](_0x5b6c45);if(!_0x24e0fb)continue;const _0x4f4d05=_0xa7d3c6[_0x2b9a91(0xad)](_0x39d393,_0x145f9f);if(!_0x4f4d05){_0x39d393=_0x145f9f+_0x477b0f['length'];continue;}_0x115099?_0x362b8d[_0x2b9a91(0x99)]({'type':'tag','name':_0x477b0f['slice'](0x2,-0x1),'content':_0x4f4d05}):_0x362b8d[_0x2b9a91(0x99)]({'type':'text','content':_0x4f4d05}),_0x39d393=_0x145f9f+_0x477b0f[_0x2b9a91(0xa4)];}return _0x39d393<_0xa7d3c6['length']&&_0x362b8d[_0x2b9a91(0x99)]({'type':'text','content':_0xa7d3c6[_0x2b9a91(0xad)](_0x39d393)}),_0x362b8d;};function formatMsgWithTags(_0xb05f01){const _0x14036d=_0x1bc0f5,_0x599578=parseMsgTags(_0xb05f01),_0x3d83e7=_0x599578[_0x14036d(0x92)](({content:_0x1c83fa,type:_0x26f1af,name:_0x4ca6b2},_0x32f3c3)=>{const _0x44339b=_0x14036d,_0x4fb98a=_0x26f1af!==_0x44339b(0x91)&&_0x4ca6b2?_0x4ca6b2:_0x30a93a[_0x44339b(0xae)];return _0x30a93a[_0x44339b(0x95)](_0x4fb98a,{'key':''+_0x32f3c3},_0x1c83fa);});return _0x3d83e7;}function formatMsg(_0x389008,_0xeb2600,_0x2d03f1){const _0x51489d=sprintf(_0x389008,..._0xeb2600!==null&&_0xeb2600!==void 0x0?_0xeb2600:[]);if(!_0x2d03f1)return _0x51489d;return formatMsgWithTags(_0x51489d);}const useTranslation=()=>{const _0x4fadab=_0x1bc0f5,{lang:_0x40f530,debug:_0x5d9c6d,pluralUtils:_0x44ec2f,resources:_0x3c35a4}=_0x30a93a[_0x4fadab(0xa6)](I18nContext);function _0x310a33(_0x27ab89,_0x4f770a){const _0x30ec1f=_0x4fadab,{found:_0x39f47b,msg:_0x7204ee}=getMsg(_0x27ab89,_0x3c35a4[_0x40f530],{'plural':_0x4f770a===null||_0x4f770a===void 0x0?void 0x0:_0x4f770a['plural'],'pluralUtils':_0x44ec2f});_0x5d9c6d&&!_0x39f47b&&console[_0x30ec1f(0xa7)]('['+_0x40f530+_0x30ec1f(0x9b)+_0x27ab89+_0x30ec1f(0xa8));if(_0x4f770a===null||_0x4f770a===void 0x0?void 0x0:_0x4f770a[_0x30ec1f(0xa9)])return formatMsg(_0x7204ee,_0x4f770a===null||_0x4f770a===void 0x0?void 0x0:_0x4f770a[_0x30ec1f(0xab)],!![]);return formatMsg(_0x7204ee,_0x4f770a===null||_0x4f770a===void 0x0?void 0x0:_0x4f770a[_0x30ec1f(0xab)],![]);}return{'t':_0x310a33,'lang':_0x40f530};};export{I18nContext,I18nProvider,useTranslation};
4
+ const _0x49d9c5=_0xf270;function _0xf270(_0x4d8f4c,_0x5bd788){const _0x182be9=_0x182b();return _0xf270=function(_0xf2708,_0x34c4ce){_0xf2708=_0xf2708-0x1a4;let _0x5244ec=_0x182be9[_0xf2708];return _0x5244ec;},_0xf270(_0x4d8f4c,_0x5bd788);}function _0x182b(){const _0x18f9e1=['indexOf','log','warn','394480ubcOta','values','length','text','plural','slice',']:\x20Translation\x20for\x20key\x20\x27','3763626rcTbad','isSupported','217348bBRSOQ','7DnkhxA','Plural\x20form\x20for\x20language\x20\x22','11JztQxd','select','tag','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','828189iyDfZs','341ZHEVAX','2683040ysVGxY','exec','includes','15Rbbgui','createElement','lang','filter','_rules','Fragment','4999770bVkYin','push','86930zutkwi','\x22\x20is\x20not\x20supported.','strong','PluralRules','createContext','getKey','\x27\x20is\x20missing.','charAt','_one','supportedLocalesOf'];_0x182b=function(){return _0x18f9e1;};return _0x182b();}(function(_0x169819,_0xd8a259){const _0x585095=_0xf270,_0x13d426=_0x169819();while(!![]){try{const _0x402beb=parseInt(_0x585095(0x1ba))/0x1*(parseInt(_0x585095(0x1cb))/0x2)+parseInt(_0x585095(0x1be))/0x3+-parseInt(_0x585095(0x1b7))/0x4*(-parseInt(_0x585095(0x1c3))/0x5)+-parseInt(_0x585095(0x1b5))/0x6*(-parseInt(_0x585095(0x1b8))/0x7)+-parseInt(_0x585095(0x1c0))/0x8+parseInt(_0x585095(0x1c9))/0x9+-parseInt(_0x585095(0x1ae))/0xa*(parseInt(_0x585095(0x1bf))/0xb);if(_0x402beb===_0xd8a259)break;else _0x13d426['push'](_0x13d426['shift']());}catch(_0x2b85d7){_0x13d426['push'](_0x13d426['shift']());}}}(_0x182b,0x8441a));import*as _0x4cbb62 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x2676bd){const _0x45a9da=_0xf270;this[_0x45a9da(0x1c5)]=_0x2676bd;try{this[_0x45a9da(0x1c7)]=new Intl[(_0x45a9da(0x1a4))](_0x2676bd);}catch(_0x424031){console[_0x45a9da(0x1ad)](_0x45a9da(0x1bd));}}[_0x49d9c5(0x1a6)](_0x4b7e31,_0x4e2fdf){const _0x560254=_0x49d9c5;if(!this[_0x560254(0x1c7)])return _0x4b7e31+_0x560254(0x1a9);const _0x132ed0=this[_0x560254(0x1c7)][_0x560254(0x1bb)](_0x4e2fdf);return _0x4b7e31+'_'+_0x132ed0;}}Plural['isSupported']=_0x97456d=>{const _0x4930ca=_0x49d9c5;try{return Intl[_0x4930ca(0x1a4)][_0x4930ca(0x1aa)]([_0x97456d])['length']>0x0;}catch(_0x55ed1a){return![];}};const I18nContext=_0x4cbb62[_0x49d9c5(0x1a5)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x253b8a,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x160ece=_0x49d9c5;return _0x4cbb62['useEffect'](()=>{const _0x5f17ae=_0xf270,_0x2ecca2=Plural[_0x5f17ae(0x1b6)](lang);!_0x2ecca2&&console[_0x5f17ae(0x1ad)](_0x5f17ae(0x1b9)+lang+_0x5f17ae(0x1cc));},[lang]),_0x4cbb62[_0x160ece(0x1c4)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x253b8a);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x49d9c5(0x1cd),'code'],getMsg=(_0xfcea08,_0x3a0923={},_0x3aa380)=>{const _0x1c566a=_0x49d9c5,_0x404b94=_0x3aa380[_0x1c566a(0x1b2)];if(_0x3a0923[_0xfcea08]&&_0x404b94===undefined)return{'found':!![],'msg':_0x3a0923[_0xfcea08]};const _0x1c6f09=Object['keys'](_0x3a0923)[_0x1c566a(0x1c6)](_0x26643d=>_0x26643d[_0x1c566a(0x1ab)](_0xfcea08)===0x0);if(_0x1c6f09[_0x1c566a(0x1b0)]===0x0||_0x404b94===undefined)return{'found':![],'msg':_0xfcea08};const _0x5877bc=_0x3aa380['pluralUtils'][_0x1c566a(0x1a6)](_0xfcea08,_0x404b94);return{'found':!![],'msg':_0x3a0923[_0x5877bc]};},parseMsgTags=_0x3cc395=>{const _0xfbce7b=_0x49d9c5,_0x497e51=[];let _0x155677=0x0,_0x389cf3;while((_0x389cf3=TAG_REGEX[_0xfbce7b(0x1c1)](_0x3cc395))!==null){const _0x39bb4c=_0x389cf3[0x0],{index:_0x330631}=_0x389cf3,_0x14f246=_0x39bb4c[_0xfbce7b(0x1a8)](0x1)==='/',_0x236b54=_0x14f246?_0x39bb4c[_0xfbce7b(0x1b3)](0x2,-0x1):_0x39bb4c[_0xfbce7b(0x1b3)](0x1,-0x1),_0x133154=ALLOWED_TAGS[_0xfbce7b(0x1c2)](_0x236b54);if(!_0x133154)continue;const _0x246d7d=_0x3cc395[_0xfbce7b(0x1b3)](_0x155677,_0x330631);if(!_0x246d7d){_0x155677=_0x330631+_0x39bb4c[_0xfbce7b(0x1b0)];continue;}_0x14f246?_0x497e51[_0xfbce7b(0x1ca)]({'type':_0xfbce7b(0x1bc),'name':_0x39bb4c[_0xfbce7b(0x1b3)](0x2,-0x1),'content':_0x246d7d}):_0x497e51['push']({'type':_0xfbce7b(0x1b1),'content':_0x246d7d}),_0x155677=_0x330631+_0x39bb4c[_0xfbce7b(0x1b0)];}return _0x155677<_0x3cc395[_0xfbce7b(0x1b0)]&&_0x497e51[_0xfbce7b(0x1ca)]({'type':_0xfbce7b(0x1b1),'content':_0x3cc395[_0xfbce7b(0x1b3)](_0x155677)}),_0x497e51;};function formatMsgWithTags(_0x2ecf4a){const _0x5e4318=parseMsgTags(_0x2ecf4a),_0x15903c=_0x5e4318['map'](({content:_0x4796a0,type:_0x1ef11c,name:_0x5e5ec5},_0x2436db)=>{const _0x2d36e6=_0xf270,_0x31d4a9=_0x1ef11c!==_0x2d36e6(0x1b1)&&_0x5e5ec5?_0x5e5ec5:_0x4cbb62[_0x2d36e6(0x1c8)];return _0x4cbb62[_0x2d36e6(0x1c4)](_0x31d4a9,{'key':''+_0x2436db},_0x4796a0);});return _0x15903c;}function formatMsg(_0x3255be,_0x2b1d35,_0x333268){const _0x256f82=sprintf(_0x3255be,..._0x2b1d35!==null&&_0x2b1d35!==void 0x0?_0x2b1d35:[]);if(!_0x333268)return _0x256f82;return formatMsgWithTags(_0x256f82);}const useTranslation=()=>{const {lang:_0x52f79f,debug:_0x3728b7,pluralUtils:_0x3e01a4,resources:_0xadbaa1}=_0x4cbb62['useContext'](I18nContext);function _0x225c4d(_0x4f53d0,_0x58fda9){const _0x4f39a5=_0xf270,{found:_0x1fb875,msg:_0x4bbe88}=getMsg(_0x4f53d0,_0xadbaa1[_0x52f79f],{'plural':_0x58fda9===null||_0x58fda9===void 0x0?void 0x0:_0x58fda9[_0x4f39a5(0x1b2)],'pluralUtils':_0x3e01a4});_0x3728b7&&!_0x1fb875&&console[_0x4f39a5(0x1ac)]('['+_0x52f79f+_0x4f39a5(0x1b4)+_0x4f53d0+_0x4f39a5(0x1a7));if(_0x58fda9===null||_0x58fda9===void 0x0?void 0x0:_0x58fda9['processTags'])return formatMsg(_0x4bbe88,_0x58fda9===null||_0x58fda9===void 0x0?void 0x0:_0x58fda9[_0x4f39a5(0x1af)],!![]);return formatMsg(_0x4bbe88,_0x58fda9===null||_0x58fda9===void 0x0?void 0x0:_0x58fda9[_0x4f39a5(0x1af)],![]);}return{'t':_0x225c4d,'lang':_0x52f79f};};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.4",
25
+ "version": "2.9.0",
26
26
  "description": "I18n utils of CKBox",
27
27
  "main": "dist/index.js",
28
28
  "types": "dist/index.d.ts",