@ckbox/i18n 1.4.0-rc.1 → 1.4.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.4.0
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/1.4.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
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/1.4.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
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/1.4.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 _0x1e68cb=_0x49e4;(function(_0xaba5fd,_0x89a80f){const _0x3df73e=_0x49e4,_0x3c6ed1=_0xaba5fd();while(!![]){try{const _0x39d7bb=-parseInt(_0x3df73e(0x150))/0x1*(parseInt(_0x3df73e(0x140))/0x2)+parseInt(_0x3df73e(0x139))/0x3*(parseInt(_0x3df73e(0x157))/0x4)+-parseInt(_0x3df73e(0x15b))/0x5+parseInt(_0x3df73e(0x144))/0x6*(parseInt(_0x3df73e(0x141))/0x7)+parseInt(_0x3df73e(0x13d))/0x8*(parseInt(_0x3df73e(0x137))/0x9)+parseInt(_0x3df73e(0x15a))/0xa+-parseInt(_0x3df73e(0x13a))/0xb;if(_0x39d7bb===_0x89a80f)break;else _0x3c6ed1['push'](_0x3c6ed1['shift']());}catch(_0x1c38f6){_0x3c6ed1['push'](_0x3c6ed1['shift']());}}}(_0x19af,0x7b8db));import*as _0x3f4c42 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x21457d){const _0x4ad81f=_0x49e4;this['lang']=_0x21457d;try{this[_0x4ad81f(0x153)]=new Intl['PluralRules'](_0x21457d);}catch(_0x1a2a39){console[_0x4ad81f(0x13b)](_0x4ad81f(0x142));}}[_0x1e68cb(0x14f)](_0x15a241,_0x3ce203){const _0x52f746=_0x1e68cb;if(!this[_0x52f746(0x153)])return _0x15a241+'_one';const _0x190eb1=this[_0x52f746(0x153)][_0x52f746(0x13f)](_0x3ce203);return _0x15a241+'_'+_0x190eb1;}}Plural['isSupported']=_0x124e05=>{const _0x3bebe2=_0x1e68cb;try{return Intl[_0x3bebe2(0x15c)][_0x3bebe2(0x135)]([_0x124e05])['length']>0x0;}catch(_0x99df84){return![];}};function _0x49e4(_0x558dc4,_0x1c6d4c){const _0x19af77=_0x19af();return _0x49e4=function(_0x49e40e,_0xb801ef){_0x49e40e=_0x49e40e-0x135;let _0x5c48da=_0x19af77[_0x49e40e];return _0x5c48da;},_0x49e4(_0x558dc4,_0x1c6d4c);}const I18nContext=_0x3f4c42['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x1954c9,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x46a6e9=_0x1e68cb;return _0x3f4c42[_0x46a6e9(0x136)](()=>{const _0x198c72=_0x46a6e9,_0x4076c2=Plural[_0x198c72(0x158)](lang);!_0x4076c2&&console[_0x198c72(0x13b)]('Plural\x20form\x20for\x20language\x20\x22'+lang+_0x198c72(0x14d));},[lang]),_0x3f4c42[_0x46a6e9(0x14c)](I18nContext[_0x46a6e9(0x13c)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x1954c9);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x1e68cb(0x138),_0x1e68cb(0x151)],getMsg=(_0x18663a,_0x5cc266={},_0x1275e3)=>{const _0x5a7fef=_0x1e68cb,_0x7c3efd=_0x1275e3['plural'];if(_0x5cc266[_0x18663a]&&_0x7c3efd===undefined)return{'found':!![],'msg':_0x5cc266[_0x18663a]};const _0x57ea8f=Object[_0x5a7fef(0x152)](_0x5cc266)['filter'](_0x38b553=>_0x38b553[_0x5a7fef(0x148)](_0x18663a)===0x0);if(_0x57ea8f[_0x5a7fef(0x145)]===0x0||_0x7c3efd===undefined)return{'found':![],'msg':_0x18663a};const _0x300fa1=_0x1275e3[_0x5a7fef(0x143)][_0x5a7fef(0x14f)](_0x18663a,_0x7c3efd);return{'found':!![],'msg':_0x5cc266[_0x300fa1]};},parseMsgTags=_0x50793d=>{const _0x4e8418=_0x1e68cb,_0x442d0c=[];let _0x1440be=0x0,_0x17471b;while((_0x17471b=TAG_REGEX['exec'](_0x50793d))!==null){const _0x5dc8e4=_0x17471b[0x0],{index:_0x3ba5b9}=_0x17471b,_0x5397a7=_0x5dc8e4[_0x4e8418(0x14e)](0x1)==='/',_0x2ae131=_0x5397a7?_0x5dc8e4['slice'](0x2,-0x1):_0x5dc8e4['slice'](0x1,-0x1),_0x29a1df=ALLOWED_TAGS['includes'](_0x2ae131);if(!_0x29a1df)continue;const _0x13ac53=_0x50793d[_0x4e8418(0x159)](_0x1440be,_0x3ba5b9);if(!_0x13ac53){_0x1440be=_0x3ba5b9+_0x5dc8e4['length'];continue;}_0x5397a7?_0x442d0c['push']({'type':_0x4e8418(0x147),'name':_0x5dc8e4[_0x4e8418(0x159)](0x2,-0x1),'content':_0x13ac53}):_0x442d0c[_0x4e8418(0x154)]({'type':'text','content':_0x13ac53}),_0x1440be=_0x3ba5b9+_0x5dc8e4[_0x4e8418(0x145)];}return _0x1440be<_0x50793d[_0x4e8418(0x145)]&&_0x442d0c[_0x4e8418(0x154)]({'type':_0x4e8418(0x155),'content':_0x50793d[_0x4e8418(0x159)](_0x1440be)}),_0x442d0c;};function formatMsgWithTags(_0x2f5191){const _0x43a119=_0x1e68cb,_0x28ea57=parseMsgTags(_0x2f5191),_0x40efdd=_0x28ea57[_0x43a119(0x146)](({content:_0x3f25f6,type:_0x1c8e55,name:_0x4831bd},_0x88061)=>{const _0x570741=_0x43a119,_0x496379=_0x1c8e55!=='text'&&_0x4831bd?_0x4831bd:_0x3f4c42[_0x570741(0x14b)];return _0x3f4c42[_0x570741(0x14c)](_0x496379,{'key':''+_0x88061},_0x3f25f6);});return _0x40efdd;}function formatMsg(_0x4cf065,_0x3dd23a,_0x4a2e3f){const _0x21d29f=sprintf(_0x4cf065,..._0x3dd23a!==null&&_0x3dd23a!==void 0x0?_0x3dd23a:[]);if(!_0x4a2e3f)return _0x21d29f;return formatMsgWithTags(_0x21d29f);}const useTranslation=()=>{const _0x2ff0f3=_0x1e68cb,{lang:_0x3e1bf7,debug:_0x3b44fe,pluralUtils:_0x36030f,resources:_0x5bfc1a}=_0x3f4c42[_0x2ff0f3(0x156)](I18nContext);function _0x22ffce(_0x416de9,_0x4dc006){const _0xeb4964=_0x2ff0f3,{found:_0x26a54b,msg:_0x26f74e}=getMsg(_0x416de9,_0x5bfc1a[_0x3e1bf7],{'plural':_0x4dc006===null||_0x4dc006===void 0x0?void 0x0:_0x4dc006['plural'],'pluralUtils':_0x36030f});_0x3b44fe&&!_0x26a54b&&console['log']('['+_0x3e1bf7+']:\x20Translation\x20for\x20key\x20\x27'+_0x416de9+_0xeb4964(0x149));if(_0x4dc006===null||_0x4dc006===void 0x0?void 0x0:_0x4dc006[_0xeb4964(0x13e)])return formatMsg(_0x26f74e,_0x4dc006===null||_0x4dc006===void 0x0?void 0x0:_0x4dc006[_0xeb4964(0x14a)],!![]);return formatMsg(_0x26f74e,_0x4dc006===null||_0x4dc006===void 0x0?void 0x0:_0x4dc006[_0xeb4964(0x14a)],![]);}return{'t':_0x22ffce,'lang':_0x3e1bf7};};function _0x19af(){const _0x4a5987=['length','map','tag','indexOf','\x27\x20is\x20missing.','values','Fragment','createElement','\x22\x20is\x20not\x20supported.','charAt','getKey','69683Jupuwn','code','keys','_rules','push','text','useContext','1732saWXeJ','isSupported','slice','8009610ksXkgM','1109875yYucfj','PluralRules','supportedLocalesOf','useEffect','3082680MamGUS','strong','3849tkQiRV','15617327ZzzVnN','warn','Provider','16hZkUdE','processTags','select','10LOXHSA','301uSfHWT','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','pluralUtils','63444relPii'];_0x19af=function(){return _0x4a5987;};return _0x19af();}export{I18nContext,I18nProvider,useTranslation};
|