@ckbox/i18n 1.5.1-rc.0 → 1.6.0-dev.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 +2 -2
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.6.0-dev.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.6.0-dev.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.6.0-dev.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
|
+
function _0x1a24(_0x6ba3cf,_0x670538){const _0x5195ee=_0x5195();return _0x1a24=function(_0x1a24aa,_0x5ad993){_0x1a24aa=_0x1a24aa-0x178;let _0x56178f=_0x5195ee[_0x1a24aa];return _0x56178f;},_0x1a24(_0x6ba3cf,_0x670538);}const _0x3f9459=_0x1a24;(function(_0x497ba1,_0x5ac280){const _0x35b646=_0x1a24,_0x308570=_0x497ba1();while(!![]){try{const _0x574f50=parseInt(_0x35b646(0x195))/0x1*(-parseInt(_0x35b646(0x18a))/0x2)+-parseInt(_0x35b646(0x181))/0x3+parseInt(_0x35b646(0x17d))/0x4*(-parseInt(_0x35b646(0x18d))/0x5)+parseInt(_0x35b646(0x190))/0x6+parseInt(_0x35b646(0x19b))/0x7+-parseInt(_0x35b646(0x1a2))/0x8+parseInt(_0x35b646(0x19c))/0x9;if(_0x574f50===_0x5ac280)break;else _0x308570['push'](_0x308570['shift']());}catch(_0x2ffd9e){_0x308570['push'](_0x308570['shift']());}}}(_0x5195,0xd172d));import*as _0x5d26f1 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x48686a){const _0x51d09d=_0x1a24;this[_0x51d09d(0x17f)]=_0x48686a;try{this[_0x51d09d(0x1a0)]=new Intl[(_0x51d09d(0x187))](_0x48686a);}catch(_0xf0cb98){console[_0x51d09d(0x188)](_0x51d09d(0x197));}}[_0x3f9459(0x193)](_0x20c0df,_0xaaa745){const _0x237f8f=_0x3f9459;if(!this['_rules'])return _0x20c0df+_0x237f8f(0x191);const _0x3e8f59=this[_0x237f8f(0x1a0)][_0x237f8f(0x189)](_0xaaa745);return _0x20c0df+'_'+_0x3e8f59;}}function _0x5195(){const _0x1cafd9=['PluralRules','warn','select','2MVrymr','charAt','filter','257545bDIegZ','isSupported','useContext','1104600TNsYCr','_one','supportedLocalesOf','getKey','createElement','633838TkRSQq','keys','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','pluralUtils','slice','processTags','8734950JYutSt','33686802UOoiAd','length','Provider','indexOf','_rules','code','7758344rVjskl','tag','exec','plural','Fragment','values','116bUnppJ','push','lang','useEffect','3658905RGAyCF','text','\x27\x20is\x20missing.','log',']:\x20Translation\x20for\x20key\x20\x27','strong'];_0x5195=function(){return _0x1cafd9;};return _0x5195();}Plural[_0x3f9459(0x18e)]=_0xe0dc4a=>{const _0x1f48a6=_0x3f9459;try{return Intl[_0x1f48a6(0x187)][_0x1f48a6(0x192)]([_0xe0dc4a])[_0x1f48a6(0x19d)]>0x0;}catch(_0xe4a1ba){return![];}};const I18nContext=_0x5d26f1['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x43def6,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x34e1db=_0x3f9459;return _0x5d26f1[_0x34e1db(0x180)](()=>{const _0x57df3a=_0x34e1db,_0x586b37=Plural[_0x57df3a(0x18e)](lang);!_0x586b37&&console[_0x57df3a(0x188)]('Plural\x20form\x20for\x20language\x20\x22'+lang+'\x22\x20is\x20not\x20supported.');},[lang]),_0x5d26f1[_0x34e1db(0x194)](I18nContext[_0x34e1db(0x19e)],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x43def6);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x3f9459(0x186),_0x3f9459(0x1a1)],getMsg=(_0x69c255,_0x1fa897={},_0xa6784)=>{const _0x3a05d4=_0x3f9459,_0x4318cb=_0xa6784[_0x3a05d4(0x17a)];if(_0x1fa897[_0x69c255]&&_0x4318cb===undefined)return{'found':!![],'msg':_0x1fa897[_0x69c255]};const _0x1b93e7=Object[_0x3a05d4(0x196)](_0x1fa897)[_0x3a05d4(0x18c)](_0x569820=>_0x569820[_0x3a05d4(0x19f)](_0x69c255)===0x0);if(_0x1b93e7[_0x3a05d4(0x19d)]===0x0||_0x4318cb===undefined)return{'found':![],'msg':_0x69c255};const _0x1114cc=_0xa6784[_0x3a05d4(0x198)]['getKey'](_0x69c255,_0x4318cb);return{'found':!![],'msg':_0x1fa897[_0x1114cc]};},parseMsgTags=_0x46efdb=>{const _0x4e25be=_0x3f9459,_0x16ac0f=[];let _0xa9bb35=0x0,_0x4c06c8;while((_0x4c06c8=TAG_REGEX[_0x4e25be(0x179)](_0x46efdb))!==null){const _0x82a0e0=_0x4c06c8[0x0],{index:_0x1672d5}=_0x4c06c8,_0x4d6201=_0x82a0e0[_0x4e25be(0x18b)](0x1)==='/',_0x1d0f31=_0x4d6201?_0x82a0e0['slice'](0x2,-0x1):_0x82a0e0['slice'](0x1,-0x1),_0x852ed6=ALLOWED_TAGS['includes'](_0x1d0f31);if(!_0x852ed6)continue;const _0x1e1d62=_0x46efdb[_0x4e25be(0x199)](_0xa9bb35,_0x1672d5);if(!_0x1e1d62){_0xa9bb35=_0x1672d5+_0x82a0e0['length'];continue;}_0x4d6201?_0x16ac0f[_0x4e25be(0x17e)]({'type':_0x4e25be(0x178),'name':_0x82a0e0[_0x4e25be(0x199)](0x2,-0x1),'content':_0x1e1d62}):_0x16ac0f[_0x4e25be(0x17e)]({'type':'text','content':_0x1e1d62}),_0xa9bb35=_0x1672d5+_0x82a0e0['length'];}return _0xa9bb35<_0x46efdb['length']&&_0x16ac0f['push']({'type':_0x4e25be(0x182),'content':_0x46efdb[_0x4e25be(0x199)](_0xa9bb35)}),_0x16ac0f;};function formatMsgWithTags(_0x138746){const _0x3438e2=parseMsgTags(_0x138746),_0x3343ec=_0x3438e2['map'](({content:_0x50163d,type:_0x38e437,name:_0x45a016},_0x417ec2)=>{const _0x32f5b2=_0x1a24,_0x54db1c=_0x38e437!==_0x32f5b2(0x182)&&_0x45a016?_0x45a016:_0x5d26f1[_0x32f5b2(0x17b)];return _0x5d26f1[_0x32f5b2(0x194)](_0x54db1c,{'key':''+_0x417ec2},_0x50163d);});return _0x3343ec;}function formatMsg(_0x4da205,_0x2604db,_0x39a076){const _0x269681=sprintf(_0x4da205,..._0x2604db!==null&&_0x2604db!==void 0x0?_0x2604db:[]);if(!_0x39a076)return _0x269681;return formatMsgWithTags(_0x269681);}const useTranslation=()=>{const _0x33d9f8=_0x3f9459,{lang:_0x2df3cc,debug:_0x3cc89b,pluralUtils:_0x3b9774,resources:_0x57ca36}=_0x5d26f1[_0x33d9f8(0x18f)](I18nContext);function _0x112bfe(_0x5c02fd,_0x5cc09b){const _0x44c7b9=_0x33d9f8,{found:_0x23a987,msg:_0x3c6ec8}=getMsg(_0x5c02fd,_0x57ca36[_0x2df3cc],{'plural':_0x5cc09b===null||_0x5cc09b===void 0x0?void 0x0:_0x5cc09b[_0x44c7b9(0x17a)],'pluralUtils':_0x3b9774});_0x3cc89b&&!_0x23a987&&console[_0x44c7b9(0x184)]('['+_0x2df3cc+_0x44c7b9(0x185)+_0x5c02fd+_0x44c7b9(0x183));if(_0x5cc09b===null||_0x5cc09b===void 0x0?void 0x0:_0x5cc09b[_0x44c7b9(0x19a)])return formatMsg(_0x3c6ec8,_0x5cc09b===null||_0x5cc09b===void 0x0?void 0x0:_0x5cc09b[_0x44c7b9(0x17c)],!![]);return formatMsg(_0x3c6ec8,_0x5cc09b===null||_0x5cc09b===void 0x0?void 0x0:_0x5cc09b['values'],![]);}return{'t':_0x112bfe,'lang':_0x2df3cc};};export{I18nContext,I18nProvider,useTranslation};
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
22
22
|
"name": "@ckbox/i18n",
|
|
23
|
-
"version": "1.
|
|
23
|
+
"version": "1.6.0-dev.0",
|
|
24
24
|
"description": "I18n utils of CKBox",
|
|
25
25
|
"main": "dist/index.js",
|
|
26
26
|
"types": "dist/index.d.ts",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"sprintf-js": "^1.1.2",
|
|
32
|
-
"tslib": "^2.5.
|
|
32
|
+
"tslib": "^2.5.3"
|
|
33
33
|
}
|
|
34
34
|
}
|