@ckbox/i18n 1.5.0 → 1.5.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 +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
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.5.0/ckbox.js"></script>
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/1.5.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.5.0/ckbox.js"></script>
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/1.5.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.5.0/ckbox.js"></script>
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/1.5.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
|
|
4
|
+
const _0x15e686=_0x4960;(function(_0x546ead,_0x313119){const _0x459b49=_0x4960,_0x53af09=_0x546ead();while(!![]){try{const _0x5b1f4d=parseInt(_0x459b49(0x189))/0x1+-parseInt(_0x459b49(0x19e))/0x2+-parseInt(_0x459b49(0x192))/0x3+parseInt(_0x459b49(0x180))/0x4*(-parseInt(_0x459b49(0x19f))/0x5)+-parseInt(_0x459b49(0x187))/0x6+parseInt(_0x459b49(0x186))/0x7+-parseInt(_0x459b49(0x18d))/0x8*(-parseInt(_0x459b49(0x18b))/0x9);if(_0x5b1f4d===_0x313119)break;else _0x53af09['push'](_0x53af09['shift']());}catch(_0x5df8bb){_0x53af09['push'](_0x53af09['shift']());}}}(_0x2c04,0x86866));import*as _0x3ddb3c from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x519497){const _0x4bad57=_0x4960;this['lang']=_0x519497;try{this['_rules']=new Intl[(_0x4bad57(0x199))](_0x519497);}catch(_0x17f6de){console['warn'](_0x4bad57(0x1a4));}}[_0x15e686(0x195)](_0x115376,_0x10ba23){const _0x3bd1aa=_0x15e686;if(!this['_rules'])return _0x115376+'_one';const _0x16df12=this[_0x3bd1aa(0x18c)][_0x3bd1aa(0x18e)](_0x10ba23);return _0x115376+'_'+_0x16df12;}}Plural['isSupported']=_0x142c6b=>{const _0x47d94b=_0x15e686;try{return Intl[_0x47d94b(0x199)][_0x47d94b(0x1a0)]([_0x142c6b])[_0x47d94b(0x1a1)]>0x0;}catch(_0x29f553){return![];}};function _0x2c04(){const _0x3e5a48=['createContext','text','Provider','Plural\x20form\x20for\x20language\x20\x22','942406ddEZHo','5LpLvHp','supportedLocalesOf','length','charAt','slice','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','3913428CDFroS','\x27\x20is\x20missing.','useEffect','plural','indexOf','code','6546239kNSQRl','2961900fByYsq','exec','422450ZJCHrS','map','27vDICrR','_rules','5583640BwISvm','select','filter',']:\x20Translation\x20for\x20key\x20\x27','warn','2871804fegdaK','values','keys','getKey','createElement','includes','push','PluralRules'];_0x2c04=function(){return _0x3e5a48;};return _0x2c04();}const I18nContext=_0x3ddb3c[_0x15e686(0x19a)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x4755f3,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x5c53a8=_0x15e686;return _0x3ddb3c[_0x5c53a8(0x182)](()=>{const _0x546e19=_0x5c53a8,_0x4a7d73=Plural['isSupported'](lang);!_0x4a7d73&&console[_0x546e19(0x191)](_0x546e19(0x19d)+lang+'\x22\x20is\x20not\x20supported.');},[lang]),_0x3ddb3c['createElement'](I18nContext[_0x5c53a8(0x19c)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x4755f3);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em','strong',_0x15e686(0x185)],getMsg=(_0x4e3f73,_0x3fbd28={},_0x1c6c3d)=>{const _0x4d6f73=_0x15e686,_0x510dfb=_0x1c6c3d[_0x4d6f73(0x183)];if(_0x3fbd28[_0x4e3f73]&&_0x510dfb===undefined)return{'found':!![],'msg':_0x3fbd28[_0x4e3f73]};const _0xf723e2=Object[_0x4d6f73(0x194)](_0x3fbd28)[_0x4d6f73(0x18f)](_0x41e7f9=>_0x41e7f9[_0x4d6f73(0x184)](_0x4e3f73)===0x0);if(_0xf723e2[_0x4d6f73(0x1a1)]===0x0||_0x510dfb===undefined)return{'found':![],'msg':_0x4e3f73};const _0x361c6c=_0x1c6c3d['pluralUtils'][_0x4d6f73(0x195)](_0x4e3f73,_0x510dfb);return{'found':!![],'msg':_0x3fbd28[_0x361c6c]};},parseMsgTags=_0x3feac7=>{const _0x45fd95=_0x15e686,_0x1ac0b8=[];let _0x41beff=0x0,_0x1ae919;while((_0x1ae919=TAG_REGEX[_0x45fd95(0x188)](_0x3feac7))!==null){const _0x13ebaf=_0x1ae919[0x0],{index:_0x138d74}=_0x1ae919,_0x8cbb01=_0x13ebaf[_0x45fd95(0x1a2)](0x1)==='/',_0x6455d1=_0x8cbb01?_0x13ebaf[_0x45fd95(0x1a3)](0x2,-0x1):_0x13ebaf[_0x45fd95(0x1a3)](0x1,-0x1),_0x17ec3d=ALLOWED_TAGS[_0x45fd95(0x197)](_0x6455d1);if(!_0x17ec3d)continue;const _0x53a4e0=_0x3feac7['slice'](_0x41beff,_0x138d74);if(!_0x53a4e0){_0x41beff=_0x138d74+_0x13ebaf[_0x45fd95(0x1a1)];continue;}_0x8cbb01?_0x1ac0b8[_0x45fd95(0x198)]({'type':'tag','name':_0x13ebaf[_0x45fd95(0x1a3)](0x2,-0x1),'content':_0x53a4e0}):_0x1ac0b8[_0x45fd95(0x198)]({'type':_0x45fd95(0x19b),'content':_0x53a4e0}),_0x41beff=_0x138d74+_0x13ebaf['length'];}return _0x41beff<_0x3feac7[_0x45fd95(0x1a1)]&&_0x1ac0b8[_0x45fd95(0x198)]({'type':_0x45fd95(0x19b),'content':_0x3feac7['slice'](_0x41beff)}),_0x1ac0b8;};function formatMsgWithTags(_0x434c32){const _0x2962dc=_0x15e686,_0x36833a=parseMsgTags(_0x434c32),_0x55383d=_0x36833a[_0x2962dc(0x18a)](({content:_0x22fd51,type:_0x5e78f0,name:_0x18324c},_0x973dd6)=>{const _0x1ddbbc=_0x2962dc,_0x504739=_0x5e78f0!==_0x1ddbbc(0x19b)&&_0x18324c?_0x18324c:_0x3ddb3c['Fragment'];return _0x3ddb3c[_0x1ddbbc(0x196)](_0x504739,{'key':''+_0x973dd6},_0x22fd51);});return _0x55383d;}function formatMsg(_0x1eb009,_0x6cd411,_0x4db93e){const _0x527cf6=sprintf(_0x1eb009,..._0x6cd411!==null&&_0x6cd411!==void 0x0?_0x6cd411:[]);if(!_0x4db93e)return _0x527cf6;return formatMsgWithTags(_0x527cf6);}function _0x4960(_0x40eaf1,_0x407e40){const _0x2c04a6=_0x2c04();return _0x4960=function(_0x4960c3,_0x3295dc){_0x4960c3=_0x4960c3-0x180;let _0x5e2f57=_0x2c04a6[_0x4960c3];return _0x5e2f57;},_0x4960(_0x40eaf1,_0x407e40);}const useTranslation=()=>{const {lang:_0x4b619b,debug:_0x5d2648,pluralUtils:_0x25c891,resources:_0x2e0404}=_0x3ddb3c['useContext'](I18nContext);function _0x214158(_0xb99015,_0x492e41){const _0x323164=_0x4960,{found:_0x2def6d,msg:_0x4606d7}=getMsg(_0xb99015,_0x2e0404[_0x4b619b],{'plural':_0x492e41===null||_0x492e41===void 0x0?void 0x0:_0x492e41[_0x323164(0x183)],'pluralUtils':_0x25c891});_0x5d2648&&!_0x2def6d&&console['log']('['+_0x4b619b+_0x323164(0x190)+_0xb99015+_0x323164(0x181));if(_0x492e41===null||_0x492e41===void 0x0?void 0x0:_0x492e41['processTags'])return formatMsg(_0x4606d7,_0x492e41===null||_0x492e41===void 0x0?void 0x0:_0x492e41['values'],!![]);return formatMsg(_0x4606d7,_0x492e41===null||_0x492e41===void 0x0?void 0x0:_0x492e41[_0x323164(0x193)],![]);}return{'t':_0x214158,'lang':_0x4b619b};};export{I18nContext,I18nProvider,useTranslation};
|