UNPKG

@ckeditor/ckeditor5-case-change

Version:

Case change feature for CKEditor 5.

23 lines 9.25 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x28889c=_0x5b1c;(function(_0x57e421,_0x435353){const _0x2b256c=_0x5b1c,_0x4427ad=_0x57e421();while(!![]){try{const _0x4313ad=parseInt(_0x2b256c(0x14a))/0x1*(-parseInt(_0x2b256c(0x163))/0x2)+parseInt(_0x2b256c(0x16c))/0x3+-parseInt(_0x2b256c(0x13e))/0x4*(-parseInt(_0x2b256c(0x14e))/0x5)+-parseInt(_0x2b256c(0x186))/0x6+-parseInt(_0x2b256c(0x183))/0x7*(-parseInt(_0x2b256c(0x146))/0x8)+-parseInt(_0x2b256c(0x150))/0x9*(parseInt(_0x2b256c(0x182))/0xa)+parseInt(_0x2b256c(0x13b))/0xb;if(_0x4313ad===_0x435353)break;else _0x4427ad['push'](_0x4427ad['shift']());}catch(_0x2a4390){_0x4427ad['push'](_0x4427ad['shift']());}}}(_0x19f0,0x551d2));import{Plugin as _0xe9449f}from'ckeditor5/src/core.js';function _0x19f0(){const _0x4a1837=['1428909uduoNH','caseChangeLicenseKeyDomainLimit','init','isPremiumPlugin','delegate','editing','Case\x20change','view','CaseChangeUI','evaluationLimit','usageLimit','caseChangeLicenseKeyInvalid','button','caseChangeLicenseKeyUsageLimit','config','caseChangeLicenseKeyEvaluationLimit','commands','label','domainLimit','_createDropdownView','some','add','11810xRwRsC','941311oyCcPq','push','_licenseKeyCheckInterval','4111956ioHHmu','menuBar:caseChange','bind','invalid','buttonView','CaseChange','model','9002092nYJAPn','_showLicenseError','listenTo','4qQBjRT','componentFactory','locale','set','caseChangeLicenseKeyExpired','caseChange','expired','featureNotAllowed','8WKSlbD','caseChangeLicenseKeyValid','pluginName','_registerComponents','13ksjAac','destroy','Change\x20text\x20case','Shift+F3','856995wAOvjP','isEnabled','2034IrLdZA','execute','get','menuitemradio','menu','extendTemplate','accessibility','addKeystrokeInfos','items','licenseKey','isOfficialPlugin','ck-case-change-dropdown','_createMenuBarMenuView','keys','editor','Shift+f3','commandName','source','_getListItemDefinitionsAndCommands','46106DkgYdX','_setButtonProperties','children','caseChangeLicenseKeyNotAllowed','trialLimit','toMany','focus','caseChangeLicenseKeyTrialLimit','panelView'];_0x19f0=function(){return _0x4a1837;};return _0x19f0();}import{addListToDropdown as _0x361cf9,createDropdown as _0x3346b6,MenuBarMenuListItemButtonView as _0xee4f4e,MenuBarMenuListItemView as _0x1a2667,MenuBarMenuListView as _0x1ccfa4,MenuBarMenuView as _0x2063f0,UIModel as _0x4fe32a}from'ckeditor5/src/ui.js';import{IconCaseChange as _0x94a7a7}from'ckeditor5/src/icons.js';function _0x5b1c(_0x4ff2eb,_0x2c492e){const _0x19f097=_0x19f0();return _0x5b1c=function(_0x5b1c5c,_0x21ba08){_0x5b1c5c=_0x5b1c5c-0x139;let _0xf92dfd=_0x19f097[_0x5b1c5c];return _0xf92dfd;},_0x5b1c(_0x4ff2eb,_0x2c492e);}import{Collection as _0x5ab7fd}from'ckeditor5/src/utils.js';import{_getOptions as _0x181f12}from'./casechangeediting.js';import{getTranslation as _0x315a3d}from'./utils/common-translations.js';export class CaseChangeUI extends _0xe9449f{[_0x28889c(0x159)];[_0x28889c(0x185)];static get[_0x28889c(0x148)](){const _0x2b5d9e=_0x28889c;return _0x2b5d9e(0x174);}static get[_0x28889c(0x15a)](){return!0x0;}static get[_0x28889c(0x16f)](){return!0x0;}[_0x28889c(0x16e)](){const _0x4133de=_0x28889c,_0x3ce9c5=this[_0x4133de(0x15e)];this[_0x4133de(0x149)](),_0x3ce9c5[_0x4133de(0x156)][_0x4133de(0x157)]({'keystrokes':[{'label':_0x315a3d(_0x3ce9c5[_0x4133de(0x140)],_0x4133de(0x14c)),'keystroke':_0x4133de(0x15f),'mayRequireFn':!0x0}]}),this[_0x4133de(0x159)]=this[_0x4133de(0x15e)][_0x4133de(0x17a)][_0x4133de(0x152)](_0x4133de(0x159));const _0x2c7faa=this[_0x4133de(0x15e)];this[_0x4133de(0x185)]=setInterval(()=>{const _0x330f3d=_0x4133de;let _0x477b10;for(const _0x23a49f in _0x2c7faa){const _0x5a81c5=_0x23a49f,_0x1ebd31=_0x2c7faa[_0x5a81c5];if(_0x330f3d(0x147)==_0x1ebd31||_0x330f3d(0x177)==_0x1ebd31||_0x330f3d(0x142)==_0x1ebd31||_0x330f3d(0x16d)==_0x1ebd31||_0x330f3d(0x166)==_0x1ebd31||_0x330f3d(0x17b)==_0x1ebd31||_0x330f3d(0x16a)==_0x1ebd31||_0x330f3d(0x179)==_0x1ebd31){delete _0x2c7faa[_0x5a81c5],_0x477b10=_0x1ebd31,clearInterval(this[_0x330f3d(0x185)]),this[_0x330f3d(0x185)]=void 0x0;break;}}_0x330f3d(0x177)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x189)),_0x330f3d(0x142)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x144)),_0x330f3d(0x16d)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x17e)),_0x330f3d(0x166)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x145),_0x330f3d(0x139)),_0x330f3d(0x17b)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x175)),_0x330f3d(0x16a)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x167)),_0x330f3d(0x179)==_0x477b10&&_0x2c7faa[_0x330f3d(0x13c)](_0x330f3d(0x176));},0x3e8);}[_0x28889c(0x14b)](){const _0x144c42=_0x28889c;super[_0x144c42(0x14b)](),this[_0x144c42(0x185)]&&clearInterval(this[_0x144c42(0x185)]);}[_0x28889c(0x149)](){const _0x33702a=_0x28889c,_0x1670f9=this[_0x33702a(0x15e)],{itemDefinitions:_0x583d48,commands:_0x49bf80}=this[_0x33702a(0x162)]();_0x1670f9['ui'][_0x33702a(0x13f)][_0x33702a(0x181)](_0x33702a(0x143),()=>this[_0x33702a(0x17f)](_0x583d48,_0x49bf80)),_0x1670f9['ui'][_0x33702a(0x13f)][_0x33702a(0x181)](_0x33702a(0x187),()=>this[_0x33702a(0x15c)](_0x583d48,_0x49bf80));}[_0x28889c(0x15c)](_0x4c1c7b,_0x45227a){const _0x72ec20=_0x28889c,_0x70b25b=this[_0x72ec20(0x15e)],_0xffc3e1=_0x70b25b[_0x72ec20(0x140)],_0x14812e=new _0x2063f0(_0xffc3e1),_0x29d2aa=new _0x1ccfa4(_0xffc3e1);_0x29d2aa[_0x72ec20(0x141)]({'ariaLabel':_0x315a3d(_0xffc3e1,_0x72ec20(0x172)),'role':_0x72ec20(0x154)}),this[_0x72ec20(0x164)](_0x14812e[_0x72ec20(0x18a)]),_0x14812e[_0x72ec20(0x188)](_0x72ec20(0x14f))[_0x72ec20(0x168)](_0x45227a,_0x72ec20(0x14f),(..._0x2b6d1e)=>_0x2b6d1e[_0x72ec20(0x180)](_0x359a69=>_0x359a69));for(const _0x325b21 of _0x4c1c7b){const _0xf855d7=new _0x1a2667(_0xffc3e1,_0x14812e),_0x41ab0f=new _0xee4f4e(_0xffc3e1);_0x41ab0f[_0x72ec20(0x170)](_0x72ec20(0x151))['to'](_0x14812e),_0x41ab0f[_0x72ec20(0x188)](...Object[_0x72ec20(0x15d)](_0x325b21[_0x72ec20(0x13a)]))['to'](_0x325b21[_0x72ec20(0x13a)]),_0x41ab0f['on'](_0x72ec20(0x151),()=>{const _0x18bdd2=_0x72ec20;_0x70b25b[_0x18bdd2(0x151)](_0x325b21[_0x18bdd2(0x13a)][_0x18bdd2(0x160)]),_0x70b25b[_0x18bdd2(0x171)][_0x18bdd2(0x173)][_0x18bdd2(0x169)]();}),_0xf855d7[_0x72ec20(0x165)][_0x72ec20(0x181)](_0x41ab0f),_0x29d2aa[_0x72ec20(0x158)][_0x72ec20(0x181)](_0xf855d7);}return _0x14812e[_0x72ec20(0x16b)][_0x72ec20(0x165)][_0x72ec20(0x181)](_0x29d2aa),_0x14812e;}[_0x28889c(0x17f)](_0xdff5a6,_0x329ef5){const _0x3c17a9=_0x28889c,_0x5d0965=this[_0x3c17a9(0x15e)],_0x331ae4=_0x3346b6(_0x5d0965[_0x3c17a9(0x140)]);return this[_0x3c17a9(0x164)](_0x331ae4[_0x3c17a9(0x18a)]),_0x331ae4[_0x3c17a9(0x18a)][_0x3c17a9(0x141)]({'tooltip':!0x0}),_0x331ae4[_0x3c17a9(0x155)]({'attributes':{'class':[_0x3c17a9(0x15b)]}}),_0x361cf9(_0x331ae4,_0xdff5a6,{'ariaLabel':_0x315a3d(_0x5d0965[_0x3c17a9(0x140)],_0x3c17a9(0x172)),'role':_0x3c17a9(0x154)}),_0x331ae4[_0x3c17a9(0x188)](_0x3c17a9(0x14f))[_0x3c17a9(0x168)](_0x329ef5,_0x3c17a9(0x14f),(..._0x2c87de)=>_0x2c87de[_0x3c17a9(0x180)](_0x30e74e=>_0x30e74e)),this[_0x3c17a9(0x13d)](_0x331ae4,_0x3c17a9(0x151),_0x5678f0=>{const _0x5e39bd=_0x3c17a9;_0x5d0965[_0x5e39bd(0x151)](_0x5678f0[_0x5e39bd(0x161)][_0x5e39bd(0x160)]),_0x5d0965[_0x5e39bd(0x171)][_0x5e39bd(0x173)][_0x5e39bd(0x169)]();}),_0x331ae4;}[_0x28889c(0x164)](_0x290748){const _0xdf0876=_0x28889c,_0x1eeb9f=this[_0xdf0876(0x15e)];_0x290748[_0xdf0876(0x141)]({'label':_0x315a3d(_0x1eeb9f[_0xdf0876(0x140)],_0xdf0876(0x172)),'icon':_0x94a7a7,'keystroke':_0xdf0876(0x14d)});}[_0x28889c(0x162)](){const _0x5e2aaf=_0x28889c,_0x2bb3ff=new _0x5ab7fd(),_0x4bc67b=[];for(const _0x26bc1c of _0x181f12(this[_0x5e2aaf(0x15e)][_0x5e2aaf(0x140)])){const _0x2ead9e=this[_0x5e2aaf(0x15e)][_0x5e2aaf(0x17c)][_0x5e2aaf(0x152)](_0x26bc1c[_0x5e2aaf(0x160)]),_0x133f10=new _0x4fe32a({'commandName':_0x26bc1c[_0x5e2aaf(0x160)],'label':_0x26bc1c[_0x5e2aaf(0x17d)],'role':_0x5e2aaf(0x153),'withText':!0x0});_0x133f10[_0x5e2aaf(0x188)](_0x5e2aaf(0x14f))['to'](_0x2ead9e,_0x5e2aaf(0x14f)),_0x2bb3ff[_0x5e2aaf(0x181)]({'type':_0x5e2aaf(0x178),'model':_0x133f10}),_0x4bc67b[_0x5e2aaf(0x184)](_0x2ead9e);}return{'itemDefinitions':_0x2bb3ff,'commands':_0x4bc67b};}}