@ckbox/i18n 2.0.0-rc.0 → 2.0.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/2.0.0
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/2.0.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/2.0.0
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/2.0.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/2.0.0
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/2.0.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
|
-
|
|
4
|
+
const _0xdd2776=_0x19c3;(function(_0x37fa1b,_0x117fff){const _0xb3a0a7=_0x19c3,_0x342ae2=_0x37fa1b();while(!![]){try{const _0x444ac8=parseInt(_0xb3a0a7(0xf4))/0x1+-parseInt(_0xb3a0a7(0xf0))/0x2+parseInt(_0xb3a0a7(0xe7))/0x3*(parseInt(_0xb3a0a7(0xde))/0x4)+parseInt(_0xb3a0a7(0xcf))/0x5*(-parseInt(_0xb3a0a7(0xea))/0x6)+parseInt(_0xb3a0a7(0xda))/0x7+-parseInt(_0xb3a0a7(0xd1))/0x8*(parseInt(_0xb3a0a7(0xd5))/0x9)+-parseInt(_0xb3a0a7(0xdc))/0xa*(-parseInt(_0xb3a0a7(0xdd))/0xb);if(_0x444ac8===_0x117fff)break;else _0x342ae2['push'](_0x342ae2['shift']());}catch(_0x360775){_0x342ae2['push'](_0x342ae2['shift']());}}}(_0x3427,0xab3a3));import*as _0x5bfeee from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x525d76){const _0x344305=_0x19c3;this[_0x344305(0xeb)]=_0x525d76;try{this['_rules']=new Intl['PluralRules'](_0x525d76);}catch(_0x21b23e){console['warn'](_0x344305(0xe8));}}[_0xdd2776(0xd0)](_0x40d786,_0x4ac69b){const _0x4f35c4=_0xdd2776;if(!this[_0x4f35c4(0xd9)])return _0x40d786+_0x4f35c4(0xe5);const _0x381852=this[_0x4f35c4(0xd9)][_0x4f35c4(0xe2)](_0x4ac69b);return _0x40d786+'_'+_0x381852;}}Plural[_0xdd2776(0xd6)]=_0x58e38c=>{const _0x4a8503=_0xdd2776;try{return Intl[_0x4a8503(0xef)][_0x4a8503(0xdf)]([_0x58e38c])[_0x4a8503(0xf1)]>0x0;}catch(_0x51f304){return![];}};const I18nContext=_0x5bfeee['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x336974,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x196be6=_0xdd2776;return _0x5bfeee['useEffect'](()=>{const _0x64c238=_0x19c3,_0x1272ce=Plural[_0x64c238(0xd6)](lang);!_0x1272ce&&console['warn'](_0x64c238(0xce)+lang+_0x64c238(0xf3));},[lang]),_0x5bfeee[_0x196be6(0xe0)](I18nContext[_0x196be6(0xe4)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x336974);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0xdd2776(0xe6),'code'],getMsg=(_0x84a31f,_0xac6298={},_0x5bc95d)=>{const _0x27de63=_0xdd2776,_0x395d55=_0x5bc95d['plural'];if(_0xac6298[_0x84a31f]&&_0x395d55===undefined)return{'found':!![],'msg':_0xac6298[_0x84a31f]};const _0x531a3e=Object[_0x27de63(0xee)](_0xac6298)[_0x27de63(0xe1)](_0x526785=>_0x526785[_0x27de63(0xcc)](_0x84a31f)===0x0);if(_0x531a3e['length']===0x0||_0x395d55===undefined)return{'found':![],'msg':_0x84a31f};const _0xf3639e=_0x5bc95d[_0x27de63(0xcd)][_0x27de63(0xd0)](_0x84a31f,_0x395d55);return{'found':!![],'msg':_0xac6298[_0xf3639e]};},parseMsgTags=_0x520d6d=>{const _0x8324ee=_0xdd2776,_0x2f0f90=[];let _0x2e8661=0x0,_0x262f29;while((_0x262f29=TAG_REGEX[_0x8324ee(0xd8)](_0x520d6d))!==null){const _0x5c84c0=_0x262f29[0x0],{index:_0x762d0}=_0x262f29,_0x3f2942=_0x5c84c0[_0x8324ee(0xdb)](0x1)==='/',_0x3a664c=_0x3f2942?_0x5c84c0['slice'](0x2,-0x1):_0x5c84c0[_0x8324ee(0xd2)](0x1,-0x1),_0x5e0970=ALLOWED_TAGS['includes'](_0x3a664c);if(!_0x5e0970)continue;const _0x2751d0=_0x520d6d[_0x8324ee(0xd2)](_0x2e8661,_0x762d0);if(!_0x2751d0){_0x2e8661=_0x762d0+_0x5c84c0[_0x8324ee(0xf1)];continue;}_0x3f2942?_0x2f0f90['push']({'type':_0x8324ee(0xd4),'name':_0x5c84c0[_0x8324ee(0xd2)](0x2,-0x1),'content':_0x2751d0}):_0x2f0f90[_0x8324ee(0xed)]({'type':_0x8324ee(0xf2),'content':_0x2751d0}),_0x2e8661=_0x762d0+_0x5c84c0['length'];}return _0x2e8661<_0x520d6d[_0x8324ee(0xf1)]&&_0x2f0f90[_0x8324ee(0xed)]({'type':'text','content':_0x520d6d['slice'](_0x2e8661)}),_0x2f0f90;};function formatMsgWithTags(_0x3b346a){const _0x1e8083=_0xdd2776,_0xcaa7c7=parseMsgTags(_0x3b346a),_0x3d29f7=_0xcaa7c7[_0x1e8083(0xd3)](({content:_0x4bf757,type:_0x44489b,name:_0x39f2eb},_0x1df549)=>{const _0x336b44=_0x1e8083,_0x251723=_0x44489b!=='text'&&_0x39f2eb?_0x39f2eb:_0x5bfeee[_0x336b44(0xd7)];return _0x5bfeee[_0x336b44(0xe0)](_0x251723,{'key':''+_0x1df549},_0x4bf757);});return _0x3d29f7;}function _0x3427(){const _0x17db26=['6830615JLMqlz','getKey','7024aAfbFO','slice','map','tag','7389cBKxjS','isSupported','Fragment','exec','_rules','2094197AxTukt','charAt','10KgTaij','17860403ipXCTc','4HBmDiT','supportedLocalesOf','createElement','filter','select','values','Provider','_one','strong','1951635aosXkL','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','useContext','6WstfxG','lang','log','push','keys','PluralRules','349124wsqqaX','length','text','\x22\x20is\x20not\x20supported.','389481wBGQRV','\x27\x20is\x20missing.',']:\x20Translation\x20for\x20key\x20\x27','processTags','indexOf','pluralUtils','Plural\x20form\x20for\x20language\x20\x22'];_0x3427=function(){return _0x17db26;};return _0x3427();}function formatMsg(_0x42bde8,_0x9fe2c5,_0x435430){const _0x2891d9=sprintf(_0x42bde8,..._0x9fe2c5!==null&&_0x9fe2c5!==void 0x0?_0x9fe2c5:[]);if(!_0x435430)return _0x2891d9;return formatMsgWithTags(_0x2891d9);}const useTranslation=()=>{const _0xf7fd98=_0xdd2776,{lang:_0x394bfe,debug:_0x3244a5,pluralUtils:_0x82f18,resources:_0x19d359}=_0x5bfeee[_0xf7fd98(0xe9)](I18nContext);function _0x385392(_0x94623b,_0x10c1c0){const _0x2416b3=_0xf7fd98,{found:_0xb654e4,msg:_0x3b8bd9}=getMsg(_0x94623b,_0x19d359[_0x394bfe],{'plural':_0x10c1c0===null||_0x10c1c0===void 0x0?void 0x0:_0x10c1c0['plural'],'pluralUtils':_0x82f18});_0x3244a5&&!_0xb654e4&&console[_0x2416b3(0xec)]('['+_0x394bfe+_0x2416b3(0xf6)+_0x94623b+_0x2416b3(0xf5));if(_0x10c1c0===null||_0x10c1c0===void 0x0?void 0x0:_0x10c1c0[_0x2416b3(0xcb)])return formatMsg(_0x3b8bd9,_0x10c1c0===null||_0x10c1c0===void 0x0?void 0x0:_0x10c1c0[_0x2416b3(0xe3)],!![]);return formatMsg(_0x3b8bd9,_0x10c1c0===null||_0x10c1c0===void 0x0?void 0x0:_0x10c1c0['values'],![]);}return{'t':_0x385392,'lang':_0x394bfe};};function _0x19c3(_0x59747a,_0x5c84c3){const _0x342784=_0x3427();return _0x19c3=function(_0x19c337,_0x449328){_0x19c337=_0x19c337-0xcb;let _0x4999bd=_0x342784[_0x19c337];return _0x4999bd;},_0x19c3(_0x59747a,_0x5c84c3);}export{I18nContext,I18nProvider,useTranslation};
|