@ckbox/i18n 2.9.0 → 2.9.2

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/ckbox.js"></script>
16
+ <script src="https://cdn.ckbox.io/ckbox/2.9.2/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/ckbox.js"></script>
26
+ <script src="https://cdn.ckbox.io/ckbox/2.9.2/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/ckbox.js"></script>
51
+ <script src="https://cdn.ckbox.io/ckbox/2.9.2/ckbox.js"></script>
52
52
  <link
53
53
  rel="stylesheet"
54
- href="https://cdn.ckbox.io/ckbox/2.9.0/styles/themes/lark.css"
54
+ href="https://cdn.ckbox.io/ckbox/2.9.2/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 _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};
4
+ const _0x477814=_0x38c7;function _0x38c7(_0xcf2483,_0x5cc089){const _0x4b0182=_0x4b01();return _0x38c7=function(_0x38c722,_0x488fc0){_0x38c722=_0x38c722-0x71;let _0x4c43f2=_0x4b0182[_0x38c722];return _0x4c43f2;},_0x38c7(_0xcf2483,_0x5cc089);}(function(_0x21e2c2,_0x15fefb){const _0x2b56b8=_0x38c7,_0x2f8ce3=_0x21e2c2();while(!![]){try{const _0x13f9c7=-parseInt(_0x2b56b8(0x86))/0x1*(parseInt(_0x2b56b8(0x8a))/0x2)+parseInt(_0x2b56b8(0x81))/0x3*(parseInt(_0x2b56b8(0x7a))/0x4)+parseInt(_0x2b56b8(0x8e))/0x5+-parseInt(_0x2b56b8(0x7c))/0x6+-parseInt(_0x2b56b8(0x72))/0x7+-parseInt(_0x2b56b8(0x76))/0x8*(-parseInt(_0x2b56b8(0x8c))/0x9)+-parseInt(_0x2b56b8(0x96))/0xa*(parseInt(_0x2b56b8(0x8d))/0xb);if(_0x13f9c7===_0x15fefb)break;else _0x2f8ce3['push'](_0x2f8ce3['shift']());}catch(_0x50dd71){_0x2f8ce3['push'](_0x2f8ce3['shift']());}}}(_0x4b01,0x31182));import*as _0x118815 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x4cdcc4){const _0x2bbf6d=_0x38c7;this[_0x2bbf6d(0x93)]=_0x4cdcc4;try{this['_rules']=new Intl[(_0x2bbf6d(0x90))](_0x4cdcc4);}catch(_0x1bb474){console[_0x2bbf6d(0x95)]('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}[_0x477814(0x80)](_0x1c706b,_0x25eb28){const _0x32e2bf=_0x477814;if(!this[_0x32e2bf(0x75)])return _0x1c706b+_0x32e2bf(0x7d);const _0x5b35ef=this[_0x32e2bf(0x75)][_0x32e2bf(0x94)](_0x25eb28);return _0x1c706b+'_'+_0x5b35ef;}}Plural[_0x477814(0x74)]=_0x2bc1ff=>{const _0x260396=_0x477814;try{return Intl[_0x260396(0x90)]['supportedLocalesOf']([_0x2bc1ff])['length']>0x0;}catch(_0x1bf2cc){return![];}};const I18nContext=_0x118815[_0x477814(0x92)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x53bef2,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x260bf2=_0x477814;return _0x118815[_0x260bf2(0x7b)](()=>{const _0x4af42f=_0x260bf2,_0x377369=Plural[_0x4af42f(0x74)](lang);!_0x377369&&console['warn'](_0x4af42f(0x98)+lang+_0x4af42f(0x71));},[lang]),_0x118815[_0x260bf2(0x87)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x53bef2);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x477814(0x82),_0x477814(0x7f)],getMsg=(_0x47e01b,_0x491e17={},_0x16694d)=>{const _0x1d9617=_0x477814,_0x5886c3=_0x16694d['plural'];if(_0x491e17[_0x47e01b]&&_0x5886c3===undefined)return{'found':!![],'msg':_0x491e17[_0x47e01b]};const _0x398546=Object[_0x1d9617(0x91)](_0x491e17)['filter'](_0x505a0e=>_0x505a0e[_0x1d9617(0x79)](_0x47e01b)===0x0);if(_0x398546[_0x1d9617(0x73)]===0x0||_0x5886c3===undefined)return{'found':![],'msg':_0x47e01b};const _0x2aeb05=_0x16694d[_0x1d9617(0x78)][_0x1d9617(0x80)](_0x47e01b,_0x5886c3);return{'found':!![],'msg':_0x491e17[_0x2aeb05]};},parseMsgTags=_0x39a436=>{const _0x58d376=_0x477814,_0x194708=[];let _0x3fa9c1=0x0,_0x456920;while((_0x456920=TAG_REGEX[_0x58d376(0x99)](_0x39a436))!==null){const _0x347897=_0x456920[0x0],{index:_0x5bc922}=_0x456920,_0x1e19d2=_0x347897['charAt'](0x1)==='/',_0x4f7e80=_0x1e19d2?_0x347897[_0x58d376(0x89)](0x2,-0x1):_0x347897['slice'](0x1,-0x1),_0x378308=ALLOWED_TAGS[_0x58d376(0x97)](_0x4f7e80);if(!_0x378308)continue;const _0x47fc1b=_0x39a436[_0x58d376(0x89)](_0x3fa9c1,_0x5bc922);if(!_0x47fc1b){_0x3fa9c1=_0x5bc922+_0x347897['length'];continue;}_0x1e19d2?_0x194708[_0x58d376(0x88)]({'type':'tag','name':_0x347897['slice'](0x2,-0x1),'content':_0x47fc1b}):_0x194708[_0x58d376(0x88)]({'type':_0x58d376(0x77),'content':_0x47fc1b}),_0x3fa9c1=_0x5bc922+_0x347897[_0x58d376(0x73)];}return _0x3fa9c1<_0x39a436[_0x58d376(0x73)]&&_0x194708[_0x58d376(0x88)]({'type':_0x58d376(0x77),'content':_0x39a436[_0x58d376(0x89)](_0x3fa9c1)}),_0x194708;};function formatMsgWithTags(_0x48200a){const _0x105b0e=_0x477814,_0x1797ba=parseMsgTags(_0x48200a),_0x5169ca=_0x1797ba[_0x105b0e(0x7e)](({content:_0x489c29,type:_0xe269f4,name:_0x39ef24},_0x19f7de)=>{const _0x4ddc41=_0x105b0e,_0x36375=_0xe269f4!==_0x4ddc41(0x77)&&_0x39ef24?_0x39ef24:_0x118815['Fragment'];return _0x118815[_0x4ddc41(0x87)](_0x36375,{'key':''+_0x19f7de},_0x489c29);});return _0x5169ca;}function formatMsg(_0x31b123,_0x4c534c,_0x37bcf5){const _0x2203ce=sprintf(_0x31b123,..._0x4c534c!==null&&_0x4c534c!==void 0x0?_0x4c534c:[]);if(!_0x37bcf5)return _0x2203ce;return formatMsgWithTags(_0x2203ce);}const useTranslation=()=>{const {lang:_0x37e0c5,debug:_0xec29f,pluralUtils:_0x3af914,resources:_0x394aa4}=_0x118815['useContext'](I18nContext);function _0x56cc29(_0x518085,_0x15b433){const _0x865a89=_0x38c7,{found:_0x594027,msg:_0x2458d7}=getMsg(_0x518085,_0x394aa4[_0x37e0c5],{'plural':_0x15b433===null||_0x15b433===void 0x0?void 0x0:_0x15b433[_0x865a89(0x85)],'pluralUtils':_0x3af914});_0xec29f&&!_0x594027&&console[_0x865a89(0x8f)]('['+_0x37e0c5+_0x865a89(0x84)+_0x518085+'\x27\x20is\x20missing.');if(_0x15b433===null||_0x15b433===void 0x0?void 0x0:_0x15b433[_0x865a89(0x83)])return formatMsg(_0x2458d7,_0x15b433===null||_0x15b433===void 0x0?void 0x0:_0x15b433[_0x865a89(0x8b)],!![]);return formatMsg(_0x2458d7,_0x15b433===null||_0x15b433===void 0x0?void 0x0:_0x15b433[_0x865a89(0x8b)],![]);}return{'t':_0x56cc29,'lang':_0x37e0c5};};function _0x4b01(){const _0xbb7b28=['code','getKey','489gnzGKR','strong','processTags',']:\x20Translation\x20for\x20key\x20\x27','plural','1PQGFbB','createElement','push','slice','189510RlDTwD','values','126054wzfhrn','341ZyNLET','1594165fMCvPK','log','PluralRules','keys','createContext','lang','select','warn','33190GzZGLG','includes','Plural\x20form\x20for\x20language\x20\x22','exec','\x22\x20is\x20not\x20supported.','1187760OocBDi','length','isSupported','_rules','152exdvhB','text','pluralUtils','indexOf','7196pMDTDE','useEffect','1858620VyEVsC','_one','map'];_0x4b01=function(){return _0xbb7b28;};return _0x4b01();}export{I18nContext,I18nProvider,useTranslation};
package/package.json CHANGED
@@ -22,12 +22,12 @@
22
22
  ],
23
23
  "license": "SEE LICENSE IN LICENSE.md",
24
24
  "name": "@ckbox/i18n",
25
- "version": "2.9.0",
25
+ "version": "2.9.2",
26
26
  "description": "I18n utils of CKBox",
27
27
  "main": "dist/index.js",
28
28
  "types": "dist/index.d.ts",
29
29
  "peerDependencies": {
30
- "react": "^18"
30
+ "react": "^19"
31
31
  },
32
32
  "dependencies": {
33
33
  "@vitest/coverage-v8": "^3.1.1",