@ckbox/i18n 1.6.0-dev.0 → 1.6.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 +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.6.0-
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/1.6.0-rc.1/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.6.0-
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/1.6.0-rc.1/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.6.0-
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/1.6.0-rc.1/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
|
-
|
|
4
|
+
const _0xb91a46=_0xb850;(function(_0x13fb47,_0x2d9b1b){const _0x1c2691=_0xb850,_0x45b73c=_0x13fb47();while(!![]){try{const _0x2cbced=-parseInt(_0x1c2691(0x194))/0x1*(parseInt(_0x1c2691(0x186))/0x2)+-parseInt(_0x1c2691(0x17c))/0x3*(parseInt(_0x1c2691(0x176))/0x4)+parseInt(_0x1c2691(0x190))/0x5*(parseInt(_0x1c2691(0x180))/0x6)+parseInt(_0x1c2691(0x18f))/0x7*(parseInt(_0x1c2691(0x19c))/0x8)+-parseInt(_0x1c2691(0x18e))/0x9*(-parseInt(_0x1c2691(0x181))/0xa)+-parseInt(_0x1c2691(0x184))/0xb+parseInt(_0x1c2691(0x17e))/0xc*(-parseInt(_0x1c2691(0x197))/0xd);if(_0x2cbced===_0x2d9b1b)break;else _0x45b73c['push'](_0x45b73c['shift']());}catch(_0x8ab17a){_0x45b73c['push'](_0x45b73c['shift']());}}}(_0x57fe,0xb1b07));import*as _0x38c78d from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x2cfde7){const _0x3d63be=_0xb850;this['lang']=_0x2cfde7;try{this[_0x3d63be(0x183)]=new Intl['PluralRules'](_0x2cfde7);}catch(_0x22eab1){console['warn'](_0x3d63be(0x198));}}[_0xb91a46(0x18c)](_0x29312e,_0x123473){const _0x52460d=_0xb91a46;if(!this[_0x52460d(0x183)])return _0x29312e+'_one';const _0xa1b22d=this[_0x52460d(0x183)][_0x52460d(0x187)](_0x123473);return _0x29312e+'_'+_0xa1b22d;}}Plural[_0xb91a46(0x192)]=_0xf58f27=>{const _0x1ff83f=_0xb91a46;try{return Intl[_0x1ff83f(0x177)][_0x1ff83f(0x18d)]([_0xf58f27])[_0x1ff83f(0x196)]>0x0;}catch(_0x1b33c7){return![];}};const I18nContext=_0x38c78d['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x46e809,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x153e3a=_0xb91a46;return _0x38c78d['useEffect'](()=>{const _0x3b0fe9=_0xb850,_0x1265ec=Plural[_0x3b0fe9(0x192)](lang);!_0x1265ec&&console['warn']('Plural\x20form\x20for\x20language\x20\x22'+lang+_0x3b0fe9(0x182));},[lang]),_0x38c78d['createElement'](I18nContext[_0x153e3a(0x18b)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x46e809);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0xb91a46(0x178),_0xb91a46(0x195)],getMsg=(_0x2432cd,_0x3bd86f={},_0x36da55)=>{const _0x253546=_0xb91a46,_0x2c4b01=_0x36da55[_0x253546(0x17d)];if(_0x3bd86f[_0x2432cd]&&_0x2c4b01===undefined)return{'found':!![],'msg':_0x3bd86f[_0x2432cd]};const _0x4c3bd7=Object['keys'](_0x3bd86f)['filter'](_0x193f85=>_0x193f85[_0x253546(0x179)](_0x2432cd)===0x0);if(_0x4c3bd7['length']===0x0||_0x2c4b01===undefined)return{'found':![],'msg':_0x2432cd};const _0x3dfff5=_0x36da55[_0x253546(0x19a)][_0x253546(0x18c)](_0x2432cd,_0x2c4b01);return{'found':!![],'msg':_0x3bd86f[_0x3dfff5]};},parseMsgTags=_0x3045f7=>{const _0x34d37a=_0xb91a46,_0xc132b5=[];let _0x10ed03=0x0,_0xc12347;while((_0xc12347=TAG_REGEX['exec'](_0x3045f7))!==null){const _0x3b72aa=_0xc12347[0x0],{index:_0x4c8ca6}=_0xc12347,_0x32e961=_0x3b72aa[_0x34d37a(0x19b)](0x1)==='/',_0x5cdc39=_0x32e961?_0x3b72aa[_0x34d37a(0x17f)](0x2,-0x1):_0x3b72aa['slice'](0x1,-0x1),_0x1fb928=ALLOWED_TAGS['includes'](_0x5cdc39);if(!_0x1fb928)continue;const _0x328e03=_0x3045f7[_0x34d37a(0x17f)](_0x10ed03,_0x4c8ca6);if(!_0x328e03){_0x10ed03=_0x4c8ca6+_0x3b72aa[_0x34d37a(0x196)];continue;}_0x32e961?_0xc132b5[_0x34d37a(0x193)]({'type':'tag','name':_0x3b72aa[_0x34d37a(0x17f)](0x2,-0x1),'content':_0x328e03}):_0xc132b5[_0x34d37a(0x193)]({'type':_0x34d37a(0x191),'content':_0x328e03}),_0x10ed03=_0x4c8ca6+_0x3b72aa[_0x34d37a(0x196)];}return _0x10ed03<_0x3045f7[_0x34d37a(0x196)]&&_0xc132b5[_0x34d37a(0x193)]({'type':_0x34d37a(0x191),'content':_0x3045f7[_0x34d37a(0x17f)](_0x10ed03)}),_0xc132b5;};function formatMsgWithTags(_0x31bbfe){const _0x4b1dcd=_0xb91a46,_0x14f991=parseMsgTags(_0x31bbfe),_0x1d33f1=_0x14f991[_0x4b1dcd(0x17b)](({content:_0x3fb719,type:_0x429885,name:_0x2dd273},_0x468995)=>{const _0x2f5aed=_0x4b1dcd,_0x50becc=_0x429885!=='text'&&_0x2dd273?_0x2dd273:_0x38c78d['Fragment'];return _0x38c78d[_0x2f5aed(0x17a)](_0x50becc,{'key':''+_0x468995},_0x3fb719);});return _0x1d33f1;}function _0x57fe(){const _0x14c6cb=['pluralUtils','charAt','8cDwRsg','60612LqfbtG','PluralRules','strong','indexOf','createElement','map','165iMDbuV','plural','2544oebCpV','slice','36OGEEua','40GHjvsr','\x22\x20is\x20not\x20supported.','_rules','374165VOufKJ','values','232LYtZBs','select','\x27\x20is\x20missing.','useContext','processTags','Provider','getKey','supportedLocalesOf','3190248GmfLdE','3351089ExOnKt','139505QwGeCF','text','isSupported','push','2029SUofkt','code','length','14313lYpvkT','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','log'];_0x57fe=function(){return _0x14c6cb;};return _0x57fe();}function formatMsg(_0x16b2ad,_0x420aea,_0x12d2ea){const _0x586764=sprintf(_0x16b2ad,..._0x420aea!==null&&_0x420aea!==void 0x0?_0x420aea:[]);if(!_0x12d2ea)return _0x586764;return formatMsgWithTags(_0x586764);}const useTranslation=()=>{const _0x3cffc9=_0xb91a46,{lang:_0x322599,debug:_0x3796ca,pluralUtils:_0x3def73,resources:_0x463a13}=_0x38c78d[_0x3cffc9(0x189)](I18nContext);function _0x1546f4(_0x1157d8,_0x1774bd){const _0x1880dd=_0x3cffc9,{found:_0x13236e,msg:_0x4977f4}=getMsg(_0x1157d8,_0x463a13[_0x322599],{'plural':_0x1774bd===null||_0x1774bd===void 0x0?void 0x0:_0x1774bd[_0x1880dd(0x17d)],'pluralUtils':_0x3def73});_0x3796ca&&!_0x13236e&&console[_0x1880dd(0x199)]('['+_0x322599+']:\x20Translation\x20for\x20key\x20\x27'+_0x1157d8+_0x1880dd(0x188));if(_0x1774bd===null||_0x1774bd===void 0x0?void 0x0:_0x1774bd[_0x1880dd(0x18a)])return formatMsg(_0x4977f4,_0x1774bd===null||_0x1774bd===void 0x0?void 0x0:_0x1774bd[_0x1880dd(0x185)],!![]);return formatMsg(_0x4977f4,_0x1774bd===null||_0x1774bd===void 0x0?void 0x0:_0x1774bd['values'],![]);}return{'t':_0x1546f4,'lang':_0x322599};};function _0xb850(_0x1b281b,_0x1090dc){const _0x57febd=_0x57fe();return _0xb850=function(_0xb850f3,_0xc2995a){_0xb850f3=_0xb850f3-0x176;let _0x4f6ccd=_0x57febd[_0xb850f3];return _0x4f6ccd;},_0xb850(_0x1b281b,_0x1090dc);}export{I18nContext,I18nProvider,useTranslation};
|
package/package.json
CHANGED