@ckeditor/ckeditor5-format-painter 48.5.0-alpha.2 → 48.5.0-alpha.3
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/dist/index.js +2 -2
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as
|
|
24
|
-
_0xec8363(_0x445fa9);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x3fb626=this['editor'];_0x3fb626['editing']['view']['addObserver'](_0xc0cfbd),_0x3fb626['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0x3fb626['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0x3fb626['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0x3fb626['ui']['componentFactory']['add']('formatPainter',_0x2d1802=>{const _0x2586a3=_0x1f9d04(_0x2d1802,_0x2ba9bb),_0x483245=_0x3fb626['commands']['get'](w);_0x2586a3['buttonView']['set']({'label':L(_0x3fb626['locale'],'Paint\x20formatting'),'icon':_0x3b9faa,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x2586a3['class']='ck-format-painter-dropdown',_0x483245&&(_0x2586a3['bind']('isEnabled')['to'](_0x483245,'isEnabled'),this['listenTo'](_0x483245,'change:isEnabled',(_0x5c544d,_0x1c30f9,_0x1b261d)=>{_0x1b261d||this['_finishPainting']();}),_0x2586a3['buttonView']['bind']('isOn')['to'](_0x483245,'value',_0x178fdf=>!!_0x178fdf),this['listenTo'](_0x3fb626,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x483245,'change:value',(_0x5208ef,_0x1de904,_0x30802b)=>{this['_toggleSpecialCursor'](!!_0x30802b);}));const _0x523b47=new _0x5451f8({'withText':!0x0,'label':L(_0x3fb626['locale'],'Continuous\x20painting'),'tooltip':L(_0x3fb626['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x2a8295(_0x2586a3,new _0x4a6e72([{'type':'switchbutton','model':_0x523b47}]),{'role':'menu'});const _0x4042c3=()=>{this['_copyFormatting'](),this['listenTo'](_0xa56651['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x523b47['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x2586a3,'execute',()=>{_0x523b47['isOn']=!_0x523b47['isOn'];}),this['listenTo'](_0x2586a3['buttonView'],'execute',()=>{_0x3fb626['editing']['view']['focus'](),_0x2586a3['buttonView']['isOn']?this['_finishPainting']():_0x4042c3();}),_0x3fb626['keystrokes']['set']('Ctrl+Alt+C',(_0x2b6bac,_0xe5a6d1)=>{_0x4042c3(),_0x523b47['isOn']=!0x0,_0xe5a6d1();},{'priority':'high'}),_0x3fb626['keystrokes']['set']('Ctrl+Alt+V',(_0x43da24,_0x3db411)=>{_0x2586a3['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x523b47['isOn']||this['_finishPainting'](),_0x3db411());},{'priority':'high'}),_0x3fb626['keystrokes']['set']('Esc',(_0x272d35,_0xe69784)=>{_0x2586a3['buttonView']['isOn']&&(_0x523b47['isOn']=!0x1,this['_finishPainting'](),_0x3fb626['ui']['ariaLiveAnnouncer']['announce'](L(_0x3fb626['locale'],'Painting\x20cancelled.')),_0xe69784());}),_0x2586a3;});}afterInit(){!async function(_0x283307){const _0x15a9d7='un0NFQUoX1evzk3yMEfwl7TxbDrisOZaWtKq52P98dchBVpjS4mYLC6gJIHGRA',_0x69ba48=0x793f8,_0xcfd5e1={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0xf31b79(_0x52ed67){const _0x29b985=new window['Promise'](_0x2b3e8c=>{_0x52ed67['once']('ready',_0x2b3e8c);}),_0x5b01e3=window['Date']['now'](),_0x376306=_0x52ed67['config']['get']('licenseKey');async function _0x2a86d6(){let _0x37e72e,_0xbd0c80=null,_0x2e6b16=null;try{return'GPL'==_0x376306?'NotAllowed':(_0x37e72e=_0x5c9bd5(),_0x37e72e?(_0x37e72e['usageEndpoint']&&(_0x2e6b16=_0x29fefa(_0x37e72e['usageEndpoint'],_0x37e72e['jti'])),await _0x59aa55()?_0x4fbb72()?_0x26e78a()?'Expired':_0x3bb2cf()?('evaluation'==_0x37e72e['licenseType']&&(_0xbd0c80=_0x503ff1('EvaluationLimit')),await _0x5b2b06()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x26e78a(){const _0x196d58=['evaluation','trial']['includes'](_0x37e72e['licenseType'])?_0x5b01e3/0x3e8:0xe10*_0x69ba48;return _0x37e72e['exp']<_0x196d58;}function _0x4fbb72(){const _0x529190=_0x37e72e['features'];return!!_0x529190&&(!!_0x529190['includes']('*')||(!!_0x529190['includes']('FP')||(!!_0x529190['includes']('PP')||!(!_0x529190['includes']('TRILIUM')||!_0x538622()))));}function _0x3bb2cf(){const _0x168a38=_0x37e72e['licensedHosts'];if(!_0x168a38||0x0==_0x168a38['length'])return!0x0;const {hostname:_0x3aa810}=new URL(window['location']['href']);if(_0x168a38['includes'](_0x3aa810))return!0x0;const _0x32279b=_0x3aa810['split']('.');return _0x168a38['filter'](_0x162c6a=>_0x162c6a['includes']('*'))['map'](_0x1999e4=>_0x1999e4['split']('.'))['filter'](_0x531a6e=>_0x531a6e['length']<=_0x32279b['length'])['map'](_0x91b2ca=>Array(_0x32279b['length']-_0x91b2ca['length'])['fill']('*'===_0x91b2ca[0x0]?'*':'')['concat'](_0x91b2ca))['some'](_0x3450a4=>_0x32279b['every']((_0x2a9f1f,_0xb423)=>_0x3450a4[_0xb423]===_0x2a9f1f||'*'===_0x3450a4[_0xb423]));}function _0x5b2b06(){return _0xbd0c80&&_0x2e6b16?new window['Promise']((_0x1b9384,_0x1550c3)=>{_0xbd0c80['then'](_0x1b9384,_0x1550c3),_0x2e6b16['then'](_0x451031=>{'Valid'!=_0x451031&&_0x1b9384(_0x451031);},_0x1550c3);}):_0xbd0c80||_0x2e6b16||'Valid';}}function _0x29fefa(_0xe7376c,_0x14f97d){return new window['Promise'](_0x72826e=>{if(_0xbea4e())return _0x72826e('Valid');_0x474ea1(),_0x52ed67['decorate']('_sendUsageRequest');let _0x339b77=!0x1;const _0x106ed3=_0x410908();function _0x1a5f43(_0x2cf552){return!!_0x2cf552&&('object'==typeof _0x2cf552||'function'==typeof _0x2cf552)&&'function'==typeof _0x2cf552['then']&&'function'==typeof _0x2cf552['catch'];}function _0x3c428c(_0x5e0d0e){_0x16810a(_0x5e0d0e)['then'](_0x1afa9a=>_0x1afa9a&&'ok'==_0x1afa9a['status']?_0x11635e(_0x58c564(_0x106ed3+_0x14f97d))!=_0x1afa9a['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x403bba=>(_0x31a5f3(),_0x403bba),()=>{const _0x237dae=_0xf9e5();return null==_0x237dae?(_0x31a5f3(),'Valid'):_0x5b01e3-_0x237dae>0x240c8400?'UsageLimit':'Valid';})['then'](_0x72826e)['catch'](()=>{_0x72826e('UsageLimit');});const _0x29ee14=0x36ee80;function _0x31a5f3(){const _0x541328='llct-'+_0x11635e(_0x58c564(_0xe7376c)),_0x1a32b2=_0x1d1ec9(_0x11635e(window['Math']['ceil'](_0x5b01e3/_0x29ee14)));window['localStorage']['setItem'](_0x541328,_0x1a32b2);}function _0xf9e5(){const _0x372a45='llct-'+_0x11635e(_0x58c564(_0xe7376c)),_0x205d5c=window['localStorage']['getItem'](_0x372a45);return _0x205d5c?window['parseInt'](_0x1d1ec9(_0x205d5c),0x10)*_0x29ee14:null;}function _0x16810a(_0x2bbf1b){return new window['Promise']((_0x3185a5,_0x368d96)=>{_0x2bbf1b['then'](_0x3185a5,_0x368d96),window['setTimeout'](_0x368d96,0x1d4c0);});}}_0x52ed67['on']('_sendUsageRequest',(_0x2d57dd,_0x2eb714)=>{if(_0x2eb714[0x0]!=_0xe7376c)return _0x72826e('UsageLimit');_0x2eb714[0x1]={..._0x2eb714[0x1],'requestId':_0x106ed3};},{'priority':'high'}),_0x52ed67['on']('_sendUsageRequest',_0x164da9=>{_0x1a5f43(_0x164da9['return'])&&(_0x339b77=!0x0,_0x3c428c(_0x164da9['return']));},{'priority':'low'}),_0x29b985['then'](()=>{_0x339b77||_0x72826e('UsageLimit');});});function _0xbea4e(){return'auto'==_0x52ed67['editing']['view']['_overlayModeHint'];}function _0x474ea1(){_0x52ed67['editing']['view']['_overlayModeHint']='auto';}}function _0x503ff1(_0x16e079){const _0x4e1711=[new window['Promise'](_0x5428f4=>setTimeout(_0x5428f4,0x93ecc)),_0x29b985['then'](()=>new window['Promise'](_0x230b04=>{let _0x505995=0x0;_0x52ed67['model']['on']('applyOperation',(_0x7a6cba,_0x1756bf)=>{_0x1756bf[0x0]['isDocumentOperation']&&_0x505995++,0x5e8==_0x505995&&(_0x230b04(),_0x7a6cba['off']());});}))];return window['Promise']['race'](_0x4e1711)['then'](()=>_0x16e079);}async function _0x3ea3de(){await _0x29b985,_0x52ed67['model']['change']=_0x5a6950,_0x52ed67['model']['enqueueChange']=_0x5a6950,_0x52ed67['enableReadOnlyMode']('model');}function _0x538622(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5bb75e(_0x17ccef){const _0x3e9ef6=_0x4b311e();_0x52ed67[_0x3e9ef6]='formatPainterLicenseKey'+_0x17ccef,'Valid'!=_0x17ccef&&_0x3ea3de();}function _0x4b311e(){const _0x136eea=window['String'](window['performance']['now']())['replace']('.','');let _0x3be25a='u';for(let _0x56108a=0x0;_0x56108a<_0x136eea['length'];_0x56108a+=0x2){let _0x499ad9=window['parseInt'](_0x136eea['substring'](_0x56108a,_0x56108a+0x2));_0x499ad9>=0x3e&&(_0x499ad9-=0x3e),_0x3be25a+=_0x15a9d7[_0x499ad9];}return _0x3be25a;}function _0x5c9bd5(){const _0x54e147=_0x376306['split']('.');if(0x3!=_0x54e147['length'])return null;return _0x3b4aeb(_0x54e147[0x1]);function _0x3b4aeb(_0x2ad324){const _0xccf046=_0xb1c877(_0x2ad324);return _0xccf046&&_0x40e1ff()?_0xccf046:null;function _0x40e1ff(){const _0x58d6f4=_0xccf046['jti'],_0x49bdf5=window['parseInt'](_0x58d6f4['substring'](_0x58d6f4['length']-0x8),0x10),_0x70c039={..._0xccf046,'jti':_0x58d6f4['substring'](0x0,_0x58d6f4['length']-0x8)};return delete _0x70c039['vc'],_0x58c564(_0x70c039)==_0x49bdf5;}}}async function _0x59aa55(){let _0x4cbd19=!0x0;try{const [_0x1315de,_0x245832,_0x161a39]=_0x376306['split']('.');return _0x18ad99(_0x1315de),await _0x50e951(_0x1315de,_0x245832,_0x161a39),_0x4cbd19;}catch{return!0x1;}function _0x18ad99(_0x1983cf){const _0x33d8d6=_0xb1c877(_0x1983cf);_0x33d8d6&&'ES256'==_0x33d8d6['alg']||(_0x4cbd19=!0x1);}async function _0x50e951(_0x3f4513,_0x2bd288,_0x48fd7c){const _0x1b99f6=window['Uint8Array']['from'](_0x3b98fe(_0x48fd7c),_0x326818=>_0x326818['charCodeAt'](0x0)),_0xaaac54=new window['TextEncoder']()['encode'](_0x3f4513+'.'+_0x2bd288),_0x149a8a=window['crypto']['subtle'];if(!_0x149a8a)return;const _0x1e8b66=await _0x149a8a['importKey']('jwk',_0xcfd5e1,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x149a8a['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x1e8b66,_0x1b99f6,_0xaaac54)||(_0x4cbd19=!0x1);}}function _0xb1c877(_0x249fb2){return _0x249fb2['startsWith']('ey')?JSON['parse'](_0x3b98fe(_0x249fb2)):null;}function _0x3b98fe(_0x3e7195){return window['atob'](_0x3e7195['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x58c564(_0x457e56){let _0x25142=0x1505;function _0x4ad3cc(_0x36d67b){for(let _0xe12a8a=0x0;_0xe12a8a<_0x36d67b['length'];_0xe12a8a++){const _0x2b48d7=_0x36d67b['charCodeAt'](_0xe12a8a);_0x25142=(_0x25142<<0x5)+_0x25142+_0x2b48d7,_0x25142&=_0x25142;}}function _0x497c3d(_0xde0824){Array['isArray'](_0xde0824)?_0xde0824['forEach'](_0x497c3d):_0xde0824&&'object'==typeof _0xde0824?Object['entries'](_0xde0824)['sort']()['forEach'](([_0x5d845c,_0x1d6bd2])=>{_0x4ad3cc(_0x5d845c),_0x497c3d(_0x1d6bd2);}):_0x4ad3cc(window['String'](_0xde0824));}return _0x497c3d(_0x457e56),_0x25142>>>0x0;}function _0x11635e(_0x1a6b78){return _0x1a6b78['toString'](0x10)['padStart'](0x8,'0');}function _0x1d1ec9(_0x524289){return _0x524289['split']('')['reverse']()['join']('');}function _0x5a6950(){}_0x5bb75e(await _0x2a86d6());}_0xf31b79(_0x283307['editor']);}(this);}_toggleSpecialCursor(_0x4c4767){this['editor']['editing']['view']['change'](_0x3a3886=>{for(const _0x4f2fc3 of this['editor']['editing']['view']['document']['roots'])_0x4c4767?_0x3a3886['addClass'](h,_0x4f2fc3):_0x3a3886['removeClass'](h,_0x4f2fc3);});}_copyFormatting(){const {editor:_0x1fb82d}=this;_0x1fb82d['execute'](w),_0x1fb82d['ui']['ariaLiveAnnouncer']['announce'](L(_0x1fb82d['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x265a1c}=this,_0x414cfe=_0x265a1c['commands']['get'](w)['value'];_0x265a1c['execute'](g,_0x414cfe),_0x265a1c['ui']['ariaLiveAnnouncer']['announce'](L(_0x265a1c['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0xa56651['window']['document'],'mouseup');}},x=class extends _0x445fa9{static get requires(){return[P,k];}static get['pluginName'](){return'FormatPainter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{y as CopyFormatCommand,x as FormatPainter,P as FormatPainterEditing,k as FormatPainterUI,p as PasteFormatCommand};
|
|
23
|
+
import{Command as _0x17553b,Plugin as _0x386092}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x3d1861}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x472b59,UIModel as _0x496958,addListToDropdown as _0x2105d8,createDropdown as _0x5f5ac4}from'@ckeditor/ckeditor5-ui';import{Collection as _0x1c819f,DomEmitterMixin as _0x1006c7,global as _0x1ad09b,uid as _0x5ade59}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0x138d46}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x229f41}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var y=class extends _0x17553b{constructor(_0x5b6c49){super(_0x5b6c49),this['value']=void 0x0,this['on']('change:isEnabled',(_0x2f72b6,_0x28a665,_0x4ab94a)=>{_0x4ab94a||this['reset']();}),this['on']('change:value',()=>_0x5b6c49['commands']['get'](g)['refresh']());}execute(){this['value']=this['_getFormattingAttributes']();}reset(){this['value']=void 0x0;}_getFormattingAttributes(){const _0x4665e1=this['editor']['model'],_0x1d704e=_0x4665e1['document']['selection'];return Object['fromEntries'](Array['from'](_0x1d704e['getAttributes']())['filter'](([_0x3da2d5])=>_0x4665e1['schema']['getAttributeProperties'](_0x3da2d5)['isFormatting']));}},p=class extends _0x17553b{constructor(_0x1d72a6){super(_0x1d72a6),this['_removeFormatCommand']=new _0x3d1861(_0x1d72a6);}execute(_0x14b736={}){const _0x5cf9d2=this['editor']['model'],_0x4e29a5=_0x5cf9d2['document']['selection'],_0x1b32a8=Array['from'](_0x4e29a5['getRanges']()),_0x261907=_0x4e29a5['isCollapsed']?[this['_createRangeOnEntireWord'](_0x5cf9d2,_0x4e29a5)]:_0x1b32a8;_0x5cf9d2['change'](_0x47a415=>{_0x47a415['setSelection'](_0x261907),this['_removeFormatCommand']['execute']();for(const _0x4db298 in _0x14b736)for(const _0x5ad72d of _0x5cf9d2['schema']['getValidRanges'](_0x261907,_0x4db298))_0x47a415['setAttribute'](_0x4db298,_0x14b736[_0x4db298],_0x5ad72d);_0x47a415['setSelection'](_0x1b32a8);});}_createRangeOnEntireWord(_0x42d9ab,_0x23968d){const _0x80a947=_0x42d9ab['createSelection'](_0x23968d);_0x42d9ab['modifySelection'](_0x80a947,{'unit':'word','direction':'backward'});const _0x46ae8f=_0x80a947['getFirstPosition']();_0x42d9ab['modifySelection'](_0x80a947,{'unit':'word','direction':'forward'});const _0x8a92d1=_0x80a947['getLastPosition']();return _0x42d9ab['createRange'](_0x46ae8f,_0x8a92d1);}},P=class extends _0x386092{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x8c308e=this['editor'];_0x8c308e['commands']['add'](w,new y(_0x8c308e)),_0x8c308e['commands']['add'](g,new p(_0x8c308e)),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x590a40=[this['editor']];for(const _0xcd7935 of _0x590a40){let _0x839394;for(const _0x28828e in _0xcd7935){const _0x21b91c=_0x28828e,_0xc0f34f=_0xcd7935[_0x21b91c];if('formatPainterLicenseKeyValid'==_0xc0f34f||'formatPainterLicenseKeyInvalid'==_0xc0f34f||'formatPainterLicenseKeyExpired'==_0xc0f34f||'formatPainterLicenseKeyDomainLimit'==_0xc0f34f||'formatPainterLicenseKeyNotAllowed'==_0xc0f34f||'formatPainterLicenseKeyEvaluationLimit'==_0xc0f34f||'formatPainterLicenseKeyUsageLimit'==_0xc0f34f){delete _0xcd7935[_0x21b91c],_0x839394=_0xc0f34f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0x839394&&_0xcd7935['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0x839394&&_0xcd7935['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0x839394&&_0xcd7935['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0x839394&&_0xcd7935['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0x839394&&_0xcd7935['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0x839394&&_0xcd7935['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x26d647,_0x3582f0){const t=_0x26d647['t'];switch(_0x3582f0){case'Paint\x20formatting':return t('Paint\x20formatting');case'Copy\x20text\x20formatting':return t('Copy\x20text\x20formatting');case'Paste\x20text\x20formatting':return t('Paste\x20text\x20formatting');case'Continuous\x20painting':return t('Continuous\x20painting');case'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.':return t('Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.');case'Formatting\x20copied.':return t('Formatting\x20copied.');case'Pasted\x20formatting.':return t('Pasted\x20formatting.');case'Painting\x20cancelled.':return t('Painting\x20cancelled.');default:return _0x3582f0;}}const v=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1006c7(_0x386092);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xfd8c73=this['editor'];_0xfd8c73['editing']['view']['addObserver'](_0x138d46),_0xfd8c73['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0xfd8c73['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0xfd8c73['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0xfd8c73['ui']['componentFactory']['add']('formatPainter',_0x4b7445=>{const _0x38fa79=_0x5f5ac4(_0x4b7445,_0x472b59),_0x202dda=_0xfd8c73['commands']['get'](w);_0x38fa79['buttonView']['set']({'label':L(_0xfd8c73['locale'],'Paint\x20formatting'),'icon':_0x229f41,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x38fa79['class']='ck-format-painter-dropdown',_0x202dda&&(_0x38fa79['bind']('isEnabled')['to'](_0x202dda,'isEnabled'),this['listenTo'](_0x202dda,'change:isEnabled',(_0x492673,_0x95b24c,_0x1a815d)=>{_0x1a815d||this['_finishPainting']();}),_0x38fa79['buttonView']['bind']('isOn')['to'](_0x202dda,'value',_0x40c842=>!!_0x40c842),this['listenTo'](_0xfd8c73,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x202dda,'change:value',(_0x2d2066,_0x4c0dc9,_0x962458)=>{this['_toggleSpecialCursor'](!!_0x962458);}));const _0x3541eb=new _0x496958({'withText':!0x0,'label':L(_0xfd8c73['locale'],'Continuous\x20painting'),'tooltip':L(_0xfd8c73['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x2105d8(_0x38fa79,new _0x1c819f([{'type':'switchbutton','model':_0x3541eb}]),{'role':'menu'});const _0x30e5b6=()=>{this['_copyFormatting'](),this['listenTo'](_0x1ad09b['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x3541eb['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x38fa79,'execute',()=>{_0x3541eb['isOn']=!_0x3541eb['isOn'];}),this['listenTo'](_0x38fa79['buttonView'],'execute',()=>{_0xfd8c73['editing']['view']['focus'](),_0x38fa79['buttonView']['isOn']?this['_finishPainting']():_0x30e5b6();}),_0xfd8c73['keystrokes']['set']('Ctrl+Alt+C',(_0x28fe01,_0x46d4e2)=>{_0x30e5b6(),_0x3541eb['isOn']=!0x0,_0x46d4e2();},{'priority':'high'}),_0xfd8c73['keystrokes']['set']('Ctrl+Alt+V',(_0x3d8581,_0x4a2aea)=>{_0x38fa79['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x3541eb['isOn']||this['_finishPainting'](),_0x4a2aea());},{'priority':'high'}),_0xfd8c73['keystrokes']['set']('Esc',(_0x5210c1,_0xd535fe)=>{_0x38fa79['buttonView']['isOn']&&(_0x3541eb['isOn']=!0x1,this['_finishPainting'](),_0xfd8c73['ui']['ariaLiveAnnouncer']['announce'](L(_0xfd8c73['locale'],'Painting\x20cancelled.')),_0xd535fe());}),_0x38fa79;});}afterInit(){!async function(_0x467c13){const _0x3c860f='un0NFQUoX1evzk3yMEfwl7TxbDrisOZaWtKq52P98dchBVpjS4mYLC6gJIHGRA',_0x5f8cad=0x79410,_0x550d7a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x591ed1(_0x598290){const _0xb43df6=new window['Promise'](_0x2bebb0=>{_0x598290['once']('ready',_0x2bebb0);}),_0x424883=window['Date']['now'](),_0x320f15=_0x598290['config']['get']('licenseKey');async function _0x2eb3b1(){let _0x55903e,_0x3a1a2a=null,_0x4b1ebb=null;try{return'GPL'==_0x320f15?'NotAllowed':(_0x55903e=_0x4c3bba(),_0x55903e?(_0x55903e['usageEndpoint']&&(_0x4b1ebb=_0x34563e(_0x55903e['usageEndpoint'],_0x55903e['jti'])),await _0x52ef1d()?_0xbfa78d()?_0x31e90b()?'Expired':_0x354883()?('evaluation'==_0x55903e['licenseType']&&(_0x3a1a2a=_0x3a3777('EvaluationLimit')),await _0x25e54c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x31e90b(){const _0x1065bb=['evaluation','trial']['includes'](_0x55903e['licenseType'])?_0x424883/0x3e8:0xe10*_0x5f8cad;return _0x55903e['exp']<_0x1065bb;}function _0xbfa78d(){const _0x1a2dc9=_0x55903e['features'];return!!_0x1a2dc9&&(!!_0x1a2dc9['includes']('*')||(!!_0x1a2dc9['includes']('FP')||(!!_0x1a2dc9['includes']('PP')||!(!_0x1a2dc9['includes']('TRILIUM')||!_0x3ddd89()))));}function _0x354883(){const _0x4689e3=_0x55903e['licensedHosts'];if(!_0x4689e3||0x0==_0x4689e3['length'])return!0x0;const {hostname:_0x46c626}=new URL(window['location']['href']);if(_0x4689e3['includes'](_0x46c626))return!0x0;const _0xf92749=_0x46c626['split']('.');return _0x4689e3['filter'](_0x380e11=>_0x380e11['includes']('*'))['map'](_0x34fb9a=>_0x34fb9a['split']('.'))['filter'](_0x13192b=>_0x13192b['length']<=_0xf92749['length'])['map'](_0x1ca15a=>Array(_0xf92749['length']-_0x1ca15a['length'])['fill']('*'===_0x1ca15a[0x0]?'*':'')['concat'](_0x1ca15a))['some'](_0xa5f776=>_0xf92749['every']((_0x5b14f9,_0x1e6545)=>_0xa5f776[_0x1e6545]===_0x5b14f9||'*'===_0xa5f776[_0x1e6545]));}function _0x25e54c(){return _0x3a1a2a&&_0x4b1ebb?new window['Promise']((_0x153708,_0x570a75)=>{_0x3a1a2a['then'](_0x153708,_0x570a75),_0x4b1ebb['then'](_0x55cd74=>{'Valid'!=_0x55cd74&&_0x153708(_0x55cd74);},_0x570a75);}):_0x3a1a2a||_0x4b1ebb||'Valid';}}function _0x34563e(_0x3736f8,_0x2bf464){return new window['Promise'](_0x38bde1=>{if(_0x2006fd())return _0x38bde1('Valid');_0x2da0fb(),_0x598290['decorate']('_sendUsageRequest');let _0x50f891=!0x1;const _0x28ee6c=_0x5ade59();function _0x28f179(_0x4561a3){return!!_0x4561a3&&('object'==typeof _0x4561a3||'function'==typeof _0x4561a3)&&'function'==typeof _0x4561a3['then']&&'function'==typeof _0x4561a3['catch'];}function _0x5f4b02(_0x3b458e){_0x4c9d90(_0x3b458e)['then'](_0x122c7c=>_0x122c7c&&'ok'==_0x122c7c['status']?_0x3fb993(_0x5106f9(_0x28ee6c+_0x2bf464))!=_0x122c7c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x39bf87=>(_0x21bb0c(),_0x39bf87),()=>{const _0x37fea0=_0x2a0533();return null==_0x37fea0?(_0x21bb0c(),'Valid'):_0x424883-_0x37fea0>0x240c8400?'UsageLimit':'Valid';})['then'](_0x38bde1)['catch'](()=>{_0x38bde1('UsageLimit');});const _0x29c945=0x36ee80;function _0x21bb0c(){const _0x29b827='llct-'+_0x3fb993(_0x5106f9(_0x3736f8)),_0x1a89d0=_0x2cd339(_0x3fb993(window['Math']['ceil'](_0x424883/_0x29c945)));window['localStorage']['setItem'](_0x29b827,_0x1a89d0);}function _0x2a0533(){const _0x2f910f='llct-'+_0x3fb993(_0x5106f9(_0x3736f8)),_0xfff36b=window['localStorage']['getItem'](_0x2f910f);return _0xfff36b?window['parseInt'](_0x2cd339(_0xfff36b),0x10)*_0x29c945:null;}function _0x4c9d90(_0x2d8ace){return new window['Promise']((_0x4b2803,_0x1a021f)=>{_0x2d8ace['then'](_0x4b2803,_0x1a021f),window['setTimeout'](_0x1a021f,0x1d4c0);});}}_0x598290['on']('_sendUsageRequest',(_0x3c80eb,_0x4d3c3c)=>{if(_0x4d3c3c[0x0]!=_0x3736f8)return _0x38bde1('UsageLimit');_0x4d3c3c[0x1]={..._0x4d3c3c[0x1],'requestId':_0x28ee6c};},{'priority':'high'}),_0x598290['on']('_sendUsageRequest',_0x1c8826=>{_0x28f179(_0x1c8826['return'])&&(_0x50f891=!0x0,_0x5f4b02(_0x1c8826['return']));},{'priority':'low'}),_0xb43df6['then'](()=>{_0x50f891||_0x38bde1('UsageLimit');});});function _0x2006fd(){return'auto'==_0x598290['editing']['view']['_overlayModeHint'];}function _0x2da0fb(){_0x598290['editing']['view']['_overlayModeHint']='auto';}}function _0x3a3777(_0x1a308c){const _0x91b5fb=[new window['Promise'](_0x187ad4=>setTimeout(_0x187ad4,0x93ecc)),_0xb43df6['then'](()=>new window['Promise'](_0x1a36d2=>{let _0x6be1b2=0x0;_0x598290['model']['on']('applyOperation',(_0x1eaef2,_0x14308c)=>{_0x14308c[0x0]['isDocumentOperation']&&_0x6be1b2++,0x5e8==_0x6be1b2&&(_0x1a36d2(),_0x1eaef2['off']());});}))];return window['Promise']['race'](_0x91b5fb)['then'](()=>_0x1a308c);}async function _0x31b805(){await _0xb43df6,_0x598290['model']['change']=_0x1efd6c,_0x598290['model']['enqueueChange']=_0x1efd6c,_0x598290['enableReadOnlyMode']('model');}function _0x3ddd89(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5a95ac(_0x268394){const _0x32dba1=_0x2a3172();_0x598290[_0x32dba1]='formatPainterLicenseKey'+_0x268394,'Valid'!=_0x268394&&_0x31b805();}function _0x2a3172(){const _0x3fa88e=window['String'](window['performance']['now']())['replace']('.','');let _0x2bfb8a='u';for(let _0x3231a5=0x0;_0x3231a5<_0x3fa88e['length'];_0x3231a5+=0x2){let _0x3067da=window['parseInt'](_0x3fa88e['substring'](_0x3231a5,_0x3231a5+0x2));_0x3067da>=0x3e&&(_0x3067da-=0x3e),_0x2bfb8a+=_0x3c860f[_0x3067da];}return _0x2bfb8a;}function _0x4c3bba(){const _0x3bb013=_0x320f15['split']('.');if(0x3!=_0x3bb013['length'])return null;return _0x37197e(_0x3bb013[0x1]);function _0x37197e(_0x7a68b8){const _0x2b17be=_0x38cfb8(_0x7a68b8);return _0x2b17be&&_0x2c6154()?_0x2b17be:null;function _0x2c6154(){const _0x5ce3dd=_0x2b17be['jti'],_0x5d0dc4=window['parseInt'](_0x5ce3dd['substring'](_0x5ce3dd['length']-0x8),0x10),_0x4d0194={..._0x2b17be,'jti':_0x5ce3dd['substring'](0x0,_0x5ce3dd['length']-0x8)};return delete _0x4d0194['vc'],_0x5106f9(_0x4d0194)==_0x5d0dc4;}}}async function _0x52ef1d(){let _0x56283d=!0x0;try{const [_0x5c262a,_0x36f14d,_0x22a88f]=_0x320f15['split']('.');return _0x569890(_0x5c262a),await _0x5efe01(_0x5c262a,_0x36f14d,_0x22a88f),_0x56283d;}catch{return!0x1;}function _0x569890(_0x216931){const _0x3dd6e6=_0x38cfb8(_0x216931);_0x3dd6e6&&'ES256'==_0x3dd6e6['alg']||(_0x56283d=!0x1);}async function _0x5efe01(_0x32806b,_0x58287a,_0x50fd7b){const _0x52ff05=window['Uint8Array']['from'](_0x185a66(_0x50fd7b),_0x43de2e=>_0x43de2e['charCodeAt'](0x0)),_0x1e477a=new window['TextEncoder']()['encode'](_0x32806b+'.'+_0x58287a),_0x550b1a=window['crypto']['subtle'];if(!_0x550b1a)return;const _0x535a95=await _0x550b1a['importKey']('jwk',_0x550d7a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x550b1a['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x535a95,_0x52ff05,_0x1e477a)||(_0x56283d=!0x1);}}function _0x38cfb8(_0x26ec77){return _0x26ec77['startsWith']('ey')?JSON['parse'](_0x185a66(_0x26ec77)):null;}function _0x185a66(_0x28a71f){return window['atob'](_0x28a71f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5106f9(_0x2d61b1){let _0xf37b3d=0x1505;function _0x4616cf(_0x3e158a){for(let _0x582cc1=0x0;_0x582cc1<_0x3e158a['length'];_0x582cc1++){const _0x4cab87=_0x3e158a['charCodeAt'](_0x582cc1);_0xf37b3d=(_0xf37b3d<<0x5)+_0xf37b3d+_0x4cab87,_0xf37b3d&=_0xf37b3d;}}function _0x53f4a0(_0x17080f){Array['isArray'](_0x17080f)?_0x17080f['forEach'](_0x53f4a0):_0x17080f&&'object'==typeof _0x17080f?Object['entries'](_0x17080f)['sort']()['forEach'](([_0x33daaf,_0x5ed7d1])=>{_0x4616cf(_0x33daaf),_0x53f4a0(_0x5ed7d1);}):_0x4616cf(window['String'](_0x17080f));}return _0x53f4a0(_0x2d61b1),_0xf37b3d>>>0x0;}function _0x3fb993(_0x2a62f9){return _0x2a62f9['toString'](0x10)['padStart'](0x8,'0');}function _0x2cd339(_0x3a06c5){return _0x3a06c5['split']('')['reverse']()['join']('');}function _0x1efd6c(){}_0x5a95ac(await _0x2eb3b1());}_0x591ed1(_0x467c13['editor']);}(this);}_toggleSpecialCursor(_0x395f51){this['editor']['editing']['view']['change'](_0x4cc971=>{for(const _0x4611d0 of this['editor']['editing']['view']['document']['roots'])_0x395f51?_0x4cc971['addClass'](h,_0x4611d0):_0x4cc971['removeClass'](h,_0x4611d0);});}_copyFormatting(){const {editor:_0x43b812}=this;_0x43b812['execute'](w),_0x43b812['ui']['ariaLiveAnnouncer']['announce'](L(_0x43b812['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x706fe5}=this,_0x465937=_0x706fe5['commands']['get'](w)['value'];_0x706fe5['execute'](g,_0x465937),_0x706fe5['ui']['ariaLiveAnnouncer']['announce'](L(_0x706fe5['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x1ad09b['window']['document'],'mouseup');}},x=class extends _0x386092{static get requires(){return[P,k];}static get['pluginName'](){return'FormatPainter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{y as CopyFormatCommand,x as FormatPainter,P as FormatPainterEditing,k as FormatPainterUI,p as PasteFormatCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-format-painter",
|
|
3
|
-
"version": "48.5.0-alpha.
|
|
3
|
+
"version": "48.5.0-alpha.3",
|
|
4
4
|
"description": "Format painter feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ckeditor/ckeditor5-core": "48.5.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-remove-format": "48.5.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.5.0-alpha.3",
|
|
25
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.3",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.3",
|
|
27
|
+
"@ckeditor/ckeditor5-remove-format": "48.5.0-alpha.3",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.3",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.3"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|