@ckbox/i18n 1.4.1-rc.0 → 1.5.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.
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/1.5.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.
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/1.5.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.
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/1.5.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
|
-
function
|
|
4
|
+
const _0x1222fd=_0x3dba;function _0x3dba(_0x3418d3,_0x1e8b80){const _0x5d835a=_0x5d83();return _0x3dba=function(_0x3dbae4,_0x219855){_0x3dbae4=_0x3dbae4-0xb1;let _0x516e74=_0x5d835a[_0x3dbae4];return _0x516e74;},_0x3dba(_0x3418d3,_0x1e8b80);}(function(_0x23516d,_0xe4c720){const _0x375fb1=_0x3dba,_0x2fe18b=_0x23516d();while(!![]){try{const _0x2b7f95=-parseInt(_0x375fb1(0xd0))/0x1*(-parseInt(_0x375fb1(0xb8))/0x2)+parseInt(_0x375fb1(0xc0))/0x3+-parseInt(_0x375fb1(0xbb))/0x4+parseInt(_0x375fb1(0xcc))/0x5+-parseInt(_0x375fb1(0xd9))/0x6*(parseInt(_0x375fb1(0xc4))/0x7)+parseInt(_0x375fb1(0xd3))/0x8*(-parseInt(_0x375fb1(0xb2))/0x9)+-parseInt(_0x375fb1(0xbd))/0xa*(parseInt(_0x375fb1(0xb9))/0xb);if(_0x2b7f95===_0xe4c720)break;else _0x2fe18b['push'](_0x2fe18b['shift']());}catch(_0x5a69fc){_0x2fe18b['push'](_0x2fe18b['shift']());}}}(_0x5d83,0xaf3f6));import*as _0xba684f from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x42f217){const _0x341320=_0x3dba;this[_0x341320(0xc5)]=_0x42f217;try{this[_0x341320(0xda)]=new Intl[(_0x341320(0xb4))](_0x42f217);}catch(_0xc29ce2){console['warn']('Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?');}}[_0x1222fd(0xb1)](_0x392e41,_0x46a066){const _0x2b7459=_0x1222fd;if(!this[_0x2b7459(0xda)])return _0x392e41+_0x2b7459(0xd8);const _0x37ca80=this[_0x2b7459(0xda)]['select'](_0x46a066);return _0x392e41+'_'+_0x37ca80;}}Plural[_0x1222fd(0xc9)]=_0x433353=>{const _0x242695=_0x1222fd;try{return Intl[_0x242695(0xb4)][_0x242695(0xb3)]([_0x433353])[_0x242695(0xb6)]>0x0;}catch(_0x4633cc){return![];}};const I18nContext=_0xba684f[_0x1222fd(0xb7)]({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x585364,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0xf27b8d=_0x1222fd;return _0xba684f[_0xf27b8d(0xcd)](()=>{const _0x103197=_0xf27b8d,_0x29f7a0=Plural[_0x103197(0xc9)](lang);!_0x29f7a0&&console[_0x103197(0xd4)]('Plural\x20form\x20for\x20language\x20\x22'+lang+'\x22\x20is\x20not\x20supported.');},[lang]),_0xba684f[_0xf27b8d(0xd2)](I18nContext[_0xf27b8d(0xbc)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x585364);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x1222fd(0xd1),_0x1222fd(0xd6)],getMsg=(_0x53d84b,_0x140ffd={},_0x2514b4)=>{const _0x2245f4=_0x1222fd,_0xbe5c9d=_0x2514b4[_0x2245f4(0xc7)];if(_0x140ffd[_0x53d84b]&&_0xbe5c9d===undefined)return{'found':!![],'msg':_0x140ffd[_0x53d84b]};const _0x1a8506=Object[_0x2245f4(0xd5)](_0x140ffd)['filter'](_0x23f7e9=>_0x23f7e9[_0x2245f4(0xb5)](_0x53d84b)===0x0);if(_0x1a8506[_0x2245f4(0xb6)]===0x0||_0xbe5c9d===undefined)return{'found':![],'msg':_0x53d84b};const _0xf059c6=_0x2514b4['pluralUtils'][_0x2245f4(0xb1)](_0x53d84b,_0xbe5c9d);return{'found':!![],'msg':_0x140ffd[_0xf059c6]};},parseMsgTags=_0x1fb7c4=>{const _0x475911=_0x1222fd,_0x2c10c2=[];let _0x2c07ea=0x0,_0x34ce79;while((_0x34ce79=TAG_REGEX[_0x475911(0xbf)](_0x1fb7c4))!==null){const _0x490072=_0x34ce79[0x0],{index:_0x5968b3}=_0x34ce79,_0x3d75c0=_0x490072['charAt'](0x1)==='/',_0x116a4d=_0x3d75c0?_0x490072[_0x475911(0xcb)](0x2,-0x1):_0x490072[_0x475911(0xcb)](0x1,-0x1),_0xd7db33=ALLOWED_TAGS[_0x475911(0xbe)](_0x116a4d);if(!_0xd7db33)continue;const _0x42fb4c=_0x1fb7c4[_0x475911(0xcb)](_0x2c07ea,_0x5968b3);if(!_0x42fb4c){_0x2c07ea=_0x5968b3+_0x490072[_0x475911(0xb6)];continue;}_0x3d75c0?_0x2c10c2[_0x475911(0xd7)]({'type':_0x475911(0xc2),'name':_0x490072[_0x475911(0xcb)](0x2,-0x1),'content':_0x42fb4c}):_0x2c10c2[_0x475911(0xd7)]({'type':_0x475911(0xc6),'content':_0x42fb4c}),_0x2c07ea=_0x5968b3+_0x490072[_0x475911(0xb6)];}return _0x2c07ea<_0x1fb7c4[_0x475911(0xb6)]&&_0x2c10c2[_0x475911(0xd7)]({'type':_0x475911(0xc6),'content':_0x1fb7c4[_0x475911(0xcb)](_0x2c07ea)}),_0x2c10c2;};function formatMsgWithTags(_0x57314e){const _0x40347e=_0x1222fd,_0x4b9026=parseMsgTags(_0x57314e),_0x5d72bf=_0x4b9026[_0x40347e(0xca)](({content:_0x54fb23,type:_0x15dd78,name:_0x32d0f7},_0xe7c094)=>{const _0x172130=_0x40347e,_0x596673=_0x15dd78!==_0x172130(0xc6)&&_0x32d0f7?_0x32d0f7:_0xba684f[_0x172130(0xc3)];return _0xba684f[_0x172130(0xd2)](_0x596673,{'key':''+_0xe7c094},_0x54fb23);});return _0x5d72bf;}function formatMsg(_0x32a2e5,_0x37b5e7,_0x4fbf4b){const _0x4dabbb=sprintf(_0x32a2e5,..._0x37b5e7!==null&&_0x37b5e7!==void 0x0?_0x37b5e7:[]);if(!_0x4fbf4b)return _0x4dabbb;return formatMsgWithTags(_0x4dabbb);}function _0x5d83(){const _0x51a127=[']:\x20Translation\x20for\x20key\x20\x27','3304676QWfmtk','Provider','1270laaSPt','includes','exec','1817481zFcNgg','useContext','tag','Fragment','1092dPRccm','lang','text','plural','values','isSupported','map','slice','2354170ZXLtrk','useEffect','processTags','\x27\x20is\x20missing.','23266PCPtER','strong','createElement','96SRrtmt','warn','keys','code','push','_one','24162LxjXLZ','_rules','getKey','120546BoudaF','supportedLocalesOf','PluralRules','indexOf','length','createContext','110oNhJUc','2024XCrcMH'];_0x5d83=function(){return _0x51a127;};return _0x5d83();}const useTranslation=()=>{const _0x8d811=_0x1222fd,{lang:_0x596790,debug:_0xc29fbb,pluralUtils:_0x598328,resources:_0x5a565a}=_0xba684f[_0x8d811(0xc1)](I18nContext);function _0x181f8a(_0x4f0d94,_0x52b72d){const _0x2539fa=_0x8d811,{found:_0x182ab8,msg:_0x55a291}=getMsg(_0x4f0d94,_0x5a565a[_0x596790],{'plural':_0x52b72d===null||_0x52b72d===void 0x0?void 0x0:_0x52b72d['plural'],'pluralUtils':_0x598328});_0xc29fbb&&!_0x182ab8&&console['log']('['+_0x596790+_0x2539fa(0xba)+_0x4f0d94+_0x2539fa(0xcf));if(_0x52b72d===null||_0x52b72d===void 0x0?void 0x0:_0x52b72d[_0x2539fa(0xce)])return formatMsg(_0x55a291,_0x52b72d===null||_0x52b72d===void 0x0?void 0x0:_0x52b72d[_0x2539fa(0xc8)],!![]);return formatMsg(_0x55a291,_0x52b72d===null||_0x52b72d===void 0x0?void 0x0:_0x52b72d['values'],![]);}return{'t':_0x181f8a,'lang':_0x596790};};export{I18nContext,I18nProvider,useTranslation};
|