@ckbox/i18n 1.6.0-rc.3 → 2.0.0-rc.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/
|
|
15
|
+
<script src="https://cdn.ckbox.io/ckbox/2.0.0-rc.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/
|
|
25
|
+
<script src="https://cdn.ckbox.io/ckbox/2.0.0-rc.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/
|
|
51
|
+
<script src="https://cdn.ckbox.io/ckbox/2.0.0-rc.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 _0xfd0b(_0x3196e7,_0x234d80){const _0x4fabe3=_0x4fab();return _0xfd0b=function(_0xfd0be7,_0x1c3a8d){_0xfd0be7=_0xfd0be7-0x82;let _0x1a3840=_0x4fabe3[_0xfd0be7];return _0x1a3840;},_0xfd0b(_0x3196e7,_0x234d80);}const _0x265380=_0xfd0b;function _0x4fab(){const _0x13f62e=['_one','code','keys','plural','strong','468syMUAQ','\x27\x20is\x20missing.','13796RkSEBg','4557320KIJIRo','values','warn','isSupported','text','createElement','select','log','exec','length','95248dvLCCO','1CysrCY','push','lang','5455626kuKlhN','_rules','Fragment','125feCYtW','PluralRules','supportedLocalesOf','\x22\x20is\x20not\x20supported.','useContext','getKey',']:\x20Translation\x20for\x20key\x20\x27','377390flKZUc','map','Plural\x20rules\x20could\x20not\x20be\x20created.\x20Perhaps\x20`Intl.PluralRules`\x20is\x20not\x20supported?','Plural\x20form\x20for\x20language\x20\x22','69DXQSod','14514BQVYPE','4864657TqyKGU','slice'];_0x4fab=function(){return _0x13f62e;};return _0x4fab();}(function(_0xa04bf5,_0x4e2bf9){const _0x25c4ef=_0xfd0b,_0x2cad84=_0xa04bf5();while(!![]){try{const _0x100882=-parseInt(_0x25c4ef(0xa9))/0x1*(-parseInt(_0x25c4ef(0x8e))/0x2)+parseInt(_0x25c4ef(0x92))/0x3*(parseInt(_0x25c4ef(0x9d))/0x4)+parseInt(_0x25c4ef(0x87))/0x5*(parseInt(_0x25c4ef(0x93))/0x6)+parseInt(_0x25c4ef(0x94))/0x7+parseInt(_0x25c4ef(0xa8))/0x8*(-parseInt(_0x25c4ef(0x9b))/0x9)+-parseInt(_0x25c4ef(0x9e))/0xa+parseInt(_0x25c4ef(0x84))/0xb;if(_0x100882===_0x4e2bf9)break;else _0x2cad84['push'](_0x2cad84['shift']());}catch(_0x16ab12){_0x2cad84['push'](_0x2cad84['shift']());}}}(_0x4fab,0x6c89a));import*as _0x630186 from'react';import{sprintf}from'sprintf-js';class Plural{constructor(_0x2d045b){const _0x3f7491=_0xfd0b;this[_0x3f7491(0x83)]=_0x2d045b;try{this['_rules']=new Intl['PluralRules'](_0x2d045b);}catch(_0x1a1dbf){console[_0x3f7491(0xa0)](_0x3f7491(0x90));}}[_0x265380(0x8c)](_0x54b3c6,_0xdea702){const _0x2d4d2f=_0x265380;if(!this[_0x2d4d2f(0x85)])return _0x54b3c6+_0x2d4d2f(0x96);const _0x3bd3b4=this[_0x2d4d2f(0x85)][_0x2d4d2f(0xa4)](_0xdea702);return _0x54b3c6+'_'+_0x3bd3b4;}}Plural[_0x265380(0xa1)]=_0x4e0fe7=>{const _0x3bf307=_0x265380;try{return Intl[_0x3bf307(0x88)][_0x3bf307(0x89)]([_0x4e0fe7])[_0x3bf307(0xa7)]>0x0;}catch(_0x2f6861){return![];}};const I18nContext=_0x630186['createContext']({'debug':![],'lang':'en','resources':{},'pluralUtils':new Plural('en')}),I18nProvider=({children:_0x3f7d47,debug:debug=![],lang:lang='en',resources:resources={}})=>{const _0x2a1177=_0x265380;return _0x630186['useEffect'](()=>{const _0x595378=_0xfd0b,_0x3cb135=Plural[_0x595378(0xa1)](lang);!_0x3cb135&&console[_0x595378(0xa0)](_0x595378(0x91)+lang+_0x595378(0x8a));},[lang]),_0x630186[_0x2a1177(0xa3)](I18nContext['Provider'],{'value':{'debug':debug,'lang':lang,'pluralUtils':new Plural(lang),'resources':resources}},_0x3f7d47);},TAG_REGEX=/<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,ALLOWED_TAGS=['em',_0x265380(0x9a),_0x265380(0x97)],getMsg=(_0x205f57,_0x713b32={},_0x9b2300)=>{const _0x33dedd=_0x265380,_0x389be9=_0x9b2300[_0x33dedd(0x99)];if(_0x713b32[_0x205f57]&&_0x389be9===undefined)return{'found':!![],'msg':_0x713b32[_0x205f57]};const _0x1eba7d=Object[_0x33dedd(0x98)](_0x713b32)['filter'](_0x265247=>_0x265247['indexOf'](_0x205f57)===0x0);if(_0x1eba7d[_0x33dedd(0xa7)]===0x0||_0x389be9===undefined)return{'found':![],'msg':_0x205f57};const _0x6e3652=_0x9b2300['pluralUtils'][_0x33dedd(0x8c)](_0x205f57,_0x389be9);return{'found':!![],'msg':_0x713b32[_0x6e3652]};},parseMsgTags=_0x536170=>{const _0x3e824d=_0x265380,_0x3a8948=[];let _0x2da77b=0x0,_0x2b5a8e;while((_0x2b5a8e=TAG_REGEX[_0x3e824d(0xa6)](_0x536170))!==null){const _0x432e65=_0x2b5a8e[0x0],{index:_0x10e44d}=_0x2b5a8e,_0x5ab88e=_0x432e65['charAt'](0x1)==='/',_0x257b73=_0x5ab88e?_0x432e65[_0x3e824d(0x95)](0x2,-0x1):_0x432e65[_0x3e824d(0x95)](0x1,-0x1),_0xac19fe=ALLOWED_TAGS['includes'](_0x257b73);if(!_0xac19fe)continue;const _0x137c4f=_0x536170['slice'](_0x2da77b,_0x10e44d);if(!_0x137c4f){_0x2da77b=_0x10e44d+_0x432e65[_0x3e824d(0xa7)];continue;}_0x5ab88e?_0x3a8948[_0x3e824d(0x82)]({'type':'tag','name':_0x432e65[_0x3e824d(0x95)](0x2,-0x1),'content':_0x137c4f}):_0x3a8948[_0x3e824d(0x82)]({'type':_0x3e824d(0xa2),'content':_0x137c4f}),_0x2da77b=_0x10e44d+_0x432e65[_0x3e824d(0xa7)];}return _0x2da77b<_0x536170[_0x3e824d(0xa7)]&&_0x3a8948[_0x3e824d(0x82)]({'type':_0x3e824d(0xa2),'content':_0x536170[_0x3e824d(0x95)](_0x2da77b)}),_0x3a8948;};function formatMsgWithTags(_0x1f4f63){const _0x1f36c3=_0x265380,_0x54731e=parseMsgTags(_0x1f4f63),_0xc8c4ff=_0x54731e[_0x1f36c3(0x8f)](({content:_0x52dff3,type:_0x2ea862,name:_0x29efde},_0x22c60e)=>{const _0x28b43f=_0x1f36c3,_0x32523a=_0x2ea862!==_0x28b43f(0xa2)&&_0x29efde?_0x29efde:_0x630186[_0x28b43f(0x86)];return _0x630186[_0x28b43f(0xa3)](_0x32523a,{'key':''+_0x22c60e},_0x52dff3);});return _0xc8c4ff;}function formatMsg(_0x4bb9de,_0x548770,_0x215d91){const _0x3c017a=sprintf(_0x4bb9de,..._0x548770!==null&&_0x548770!==void 0x0?_0x548770:[]);if(!_0x215d91)return _0x3c017a;return formatMsgWithTags(_0x3c017a);}const useTranslation=()=>{const _0x49a808=_0x265380,{lang:_0x5ad537,debug:_0x4d6886,pluralUtils:_0x45f18e,resources:_0x4a9af6}=_0x630186[_0x49a808(0x8b)](I18nContext);function _0x446915(_0x537422,_0x3e1a95){const _0x40699d=_0x49a808,{found:_0x660d51,msg:_0x4a2d16}=getMsg(_0x537422,_0x4a9af6[_0x5ad537],{'plural':_0x3e1a95===null||_0x3e1a95===void 0x0?void 0x0:_0x3e1a95[_0x40699d(0x99)],'pluralUtils':_0x45f18e});_0x4d6886&&!_0x660d51&&console[_0x40699d(0xa5)]('['+_0x5ad537+_0x40699d(0x8d)+_0x537422+_0x40699d(0x9c));if(_0x3e1a95===null||_0x3e1a95===void 0x0?void 0x0:_0x3e1a95['processTags'])return formatMsg(_0x4a2d16,_0x3e1a95===null||_0x3e1a95===void 0x0?void 0x0:_0x3e1a95[_0x40699d(0x9f)],!![]);return formatMsg(_0x4a2d16,_0x3e1a95===null||_0x3e1a95===void 0x0?void 0x0:_0x3e1a95['values'],![]);}return{'t':_0x446915,'lang':_0x5ad537};};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": "
|
|
23
|
+
"version": "2.0.0-rc.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.
|
|
32
|
+
"tslib": "^2.6.0"
|
|
33
33
|
}
|
|
34
34
|
}
|