@ckeditor/ckeditor5-format-painter 48.3.0-alpha.5 → 48.3.0-alpha.6
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
|
-
_0x3ac4ed(_0x4e9b8b);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xb63f8e=this['editor'];_0xb63f8e['editing']['view']['addObserver'](_0x15e0ae),_0xb63f8e['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0xb63f8e['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0xb63f8e['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0xb63f8e['ui']['componentFactory']['add']('formatPainter',_0x24a144=>{const _0x507652=_0x5017b1(_0x24a144,_0x2dd5b5),_0x37c68a=_0xb63f8e['commands']['get'](w);_0x507652['buttonView']['set']({'label':L(_0xb63f8e['locale'],'Paint\x20formatting'),'icon':_0x23bf0f,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x507652['class']='ck-format-painter-dropdown',_0x37c68a&&(_0x507652['bind']('isEnabled')['to'](_0x37c68a,'isEnabled'),this['listenTo'](_0x37c68a,'change:isEnabled',(_0x1e5aac,_0x1c8893,_0x16d75d)=>{_0x16d75d||this['_finishPainting']();}),_0x507652['buttonView']['bind']('isOn')['to'](_0x37c68a,'value',_0x4ad07b=>!!_0x4ad07b),this['listenTo'](_0xb63f8e,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x37c68a,'change:value',(_0x20b495,_0x5cbb2f,_0x204fb3)=>{this['_toggleSpecialCursor'](!!_0x204fb3);}));const _0x53ab49=new _0x4d7b73({'withText':!0x0,'label':L(_0xb63f8e['locale'],'Continuous\x20painting'),'tooltip':L(_0xb63f8e['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x148af3(_0x507652,new _0xf6db04([{'type':'switchbutton','model':_0x53ab49}]),{'role':'menu'});const _0x46c14f=()=>{this['_copyFormatting'](),this['listenTo'](_0x574cde['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x53ab49['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x507652,'execute',()=>{_0x53ab49['isOn']=!_0x53ab49['isOn'];}),this['listenTo'](_0x507652['buttonView'],'execute',()=>{_0xb63f8e['editing']['view']['focus'](),_0x507652['buttonView']['isOn']?this['_finishPainting']():_0x46c14f();}),_0xb63f8e['keystrokes']['set']('Ctrl+Alt+C',(_0x28ef8e,_0x351679)=>{_0x46c14f(),_0x53ab49['isOn']=!0x0,_0x351679();},{'priority':'high'}),_0xb63f8e['keystrokes']['set']('Ctrl+Alt+V',(_0x4f859a,_0x54a98d)=>{_0x507652['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x53ab49['isOn']||this['_finishPainting'](),_0x54a98d());},{'priority':'high'}),_0xb63f8e['keystrokes']['set']('Esc',(_0x57d795,_0x35a076)=>{_0x507652['buttonView']['isOn']&&(_0x53ab49['isOn']=!0x1,this['_finishPainting'](),_0xb63f8e['ui']['ariaLiveAnnouncer']['announce'](L(_0xb63f8e['locale'],'Painting\x20cancelled.')),_0x35a076());}),_0x507652;});}['afterInit'](){!async function(_0x52463e){const _0x3ee6fa='QiLRCSOsZ8pAvDdaPJUE3oxjKlzM2uXgrtGfeyh5cNFkmBw9I6WH0qnb4T17YV',_0x1d8f43=0x78e40,_0x8b726c=window['Date']['now'](),_0x1e794c=_0x52463e['editor'],_0xc246bf=new window['Promise'](_0x1fb2c3=>{_0x1e794c['once']('ready',_0x1fb2c3);}),_0x2556a7={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x358ee1=_0x1e794c['config']['get']('licenseKey');async function _0x3f2bd5(){let _0x565507,_0x19797b=null,_0xf65186=null;try{return'GPL'==_0x358ee1?'NotAllowed':(_0x565507=_0x525558(),_0x565507?(_0x565507['usageEndpoint']&&(_0xf65186=_0x3aa9f5(_0x565507['usageEndpoint'],_0x565507['jti'])),await _0x1cdc20()?_0x66b00e()?_0xba909c()?'Expired':_0x264980()?('evaluation'==_0x565507['licenseType']&&(_0x19797b=_0x4fc421('EvaluationLimit')),await _0x3abfe9()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xba909c(){const _0x519af2=['evaluation','trial']['includes'](_0x565507['licenseType'])?_0x8b726c/0x3e8:0xe10*_0x1d8f43;return _0x565507['exp']<_0x519af2;}function _0x66b00e(){const _0x583bb2=_0x565507['features'];return!!_0x583bb2&&(!!_0x583bb2['includes']('*')||(!!_0x583bb2['includes']('FP')||(!!_0x583bb2['includes']('PP')||!(!_0x583bb2['includes']('TRILIUM')||!_0x423a19()))));}function _0x264980(){const _0xcc8887=_0x565507['licensedHosts'];if(!_0xcc8887||0x0==_0xcc8887['length'])return!0x0;const {hostname:_0x14ff95}=new URL(window['location']['href']);if(_0xcc8887['includes'](_0x14ff95))return!0x0;const _0x175fc0=_0x14ff95['split']('.');return _0xcc8887['filter'](_0x363c2f=>_0x363c2f['includes']('*'))['map'](_0x1d79b8=>_0x1d79b8['split']('.'))['filter'](_0x4fe69d=>_0x4fe69d['length']<=_0x175fc0['length'])['map'](_0x25235e=>Array(_0x175fc0['length']-_0x25235e['length'])['fill']('*'===_0x25235e[0x0]?'*':'')['concat'](_0x25235e))['some'](_0x4a1250=>_0x175fc0['every']((_0x1d7138,_0x3676a4)=>_0x4a1250[_0x3676a4]===_0x1d7138||'*'===_0x4a1250[_0x3676a4]));}function _0x3abfe9(){return _0x19797b&&_0xf65186?new window['Promise']((_0x15a256,_0x32d842)=>{_0x19797b['then'](_0x15a256,_0x32d842),_0xf65186['then'](_0x3f3bb7=>{'Valid'!=_0x3f3bb7&&_0x15a256(_0x3f3bb7);},_0x32d842);}):_0x19797b||_0xf65186||'Valid';}}function _0x3aa9f5(_0xc8e1b0,_0x53fd4f){return new window['Promise'](_0x17e9bb=>{if(_0x177bb2())return _0x17e9bb('Valid');_0x125018(),_0x1e794c['decorate']('_sendUsageRequest');let _0x54c45d=!0x1;const _0x21f45c=_0x13acf5();function _0x508d0c(_0x13bf79){return!!_0x13bf79&&('object'==typeof _0x13bf79||'function'==typeof _0x13bf79)&&'function'==typeof _0x13bf79['then']&&'function'==typeof _0x13bf79['catch'];}function _0x3fa80e(_0x2892eb){_0x390637(_0x2892eb)['then'](_0x1ed888=>_0x1ed888&&'ok'==_0x1ed888['status']?_0x34fab8(_0x15000b(_0x21f45c+_0x53fd4f))!=_0x1ed888['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xcfc51=>(_0x495a19(),_0xcfc51),()=>{const _0x1553fe=_0x18eb39();return null==_0x1553fe?(_0x495a19(),'Valid'):_0x8b726c-_0x1553fe>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17e9bb)['catch'](()=>{_0x17e9bb('UsageLimit');});const _0x30b710=0x36ee80;function _0x495a19(){const _0x1132f0='llct-'+_0x34fab8(_0x15000b(_0xc8e1b0)),_0x142b9b=_0x1d690a(_0x34fab8(window['Math']['ceil'](_0x8b726c/_0x30b710)));window['localStorage']['setItem'](_0x1132f0,_0x142b9b);}function _0x18eb39(){const _0x5d2ba8='llct-'+_0x34fab8(_0x15000b(_0xc8e1b0)),_0x9964e2=window['localStorage']['getItem'](_0x5d2ba8);return _0x9964e2?window['parseInt'](_0x1d690a(_0x9964e2),0x10)*_0x30b710:null;}function _0x390637(_0x4627a9){return new window['Promise']((_0x214a2b,_0x110cd0)=>{_0x4627a9['then'](_0x214a2b,_0x110cd0),window['setTimeout'](_0x110cd0,0x1d4c0);});}}_0x1e794c['on']('_sendUsageRequest',(_0x587177,_0x2f9ed2)=>{if(_0x2f9ed2[0x0]!=_0xc8e1b0)return _0x17e9bb('UsageLimit');_0x2f9ed2[0x1]={..._0x2f9ed2[0x1],'requestId':_0x21f45c};},{'priority':'high'}),_0x1e794c['on']('_sendUsageRequest',_0x4906b8=>{_0x508d0c(_0x4906b8['return'])&&(_0x54c45d=!0x0,_0x3fa80e(_0x4906b8['return']));},{'priority':'low'}),_0xc246bf['then'](()=>{_0x54c45d||_0x17e9bb('UsageLimit');});});function _0x177bb2(){return'auto'==_0x1e794c['editing']['view']['_overlayModeHint'];}function _0x125018(){_0x1e794c['editing']['view']['_overlayModeHint']='auto';}}function _0x4fc421(_0x363c39){const _0x9e74ca=[new window['Promise'](_0x45ddc1=>setTimeout(_0x45ddc1,0x93ecc)),_0xc246bf['then'](()=>new window['Promise'](_0x459fe4=>{let _0x2fa964=0x0;_0x1e794c['model']['on']('applyOperation',(_0x2cc772,_0x2d719a)=>{_0x2d719a[0x0]['isDocumentOperation']&&_0x2fa964++,0x5e8==_0x2fa964&&(_0x459fe4(),_0x2cc772['off']());});}))];return window['Promise']['race'](_0x9e74ca)['then'](()=>_0x363c39);}async function _0x59a4c3(){await _0xc246bf,_0x1e794c['model']['change']=_0x339329,_0x1e794c['model']['enqueueChange']=_0x339329,_0x1e794c['enableReadOnlyMode']('model');}function _0x423a19(){return window['glob']&&window['glob']['triliumVersion'];}function _0x181efa(_0x2abc91){const _0x663990=_0x233268();_0x1e794c[_0x663990]='formatPainterLicenseKey'+_0x2abc91,'Valid'!=_0x2abc91&&_0x59a4c3();}function _0x233268(){const _0x31a680=window['String'](window['performance']['now']())['replace']('.','');let _0xcf47cf='Q';for(let _0x5ccdec=0x0;_0x5ccdec<_0x31a680['length'];_0x5ccdec+=0x2){let _0x392a18=window['parseInt'](_0x31a680['substring'](_0x5ccdec,_0x5ccdec+0x2));_0x392a18>=0x3e&&(_0x392a18-=0x3e),_0xcf47cf+=_0x3ee6fa[_0x392a18];}return _0xcf47cf;}function _0x525558(){const _0x7873df=_0x358ee1['split']('.');if(0x3!=_0x7873df['length'])return null;return _0xf2037b(_0x7873df[0x1]);function _0xf2037b(_0x3780d5){const _0x569eef=_0x3f9f3c(_0x3780d5);return _0x569eef&&_0x548217()?_0x569eef:null;function _0x548217(){const _0x4135ae=_0x569eef['jti'],_0x46e94d=window['parseInt'](_0x4135ae['substring'](_0x4135ae['length']-0x8),0x10),_0x4f47df={..._0x569eef,'jti':_0x4135ae['substring'](0x0,_0x4135ae['length']-0x8)};return delete _0x4f47df['vc'],_0x15000b(_0x4f47df)==_0x46e94d;}}}async function _0x1cdc20(){let _0x8643c4=!0x0;try{const [_0x5e4e69,_0x3c3c9e,_0x11c686]=_0x358ee1['split']('.');return _0x5906b8(_0x5e4e69),await _0x353789(_0x5e4e69,_0x3c3c9e,_0x11c686),_0x8643c4;}catch{return!0x1;}function _0x5906b8(_0x5ee6f0){const _0x5a9b34=_0x3f9f3c(_0x5ee6f0);_0x5a9b34&&'ES256'==_0x5a9b34['alg']||(_0x8643c4=!0x1);}async function _0x353789(_0x4280fb,_0xb14d2,_0x2a1cda){const _0x1e5d36=window['Uint8Array']['from'](_0x488a12(_0x2a1cda),_0x5460f7=>_0x5460f7['charCodeAt'](0x0)),_0x43b1ea=new window['TextEncoder']()['encode'](_0x4280fb+'.'+_0xb14d2),_0xd6057b=window['crypto']['subtle'];if(!_0xd6057b)return;const _0x383ce7=await _0xd6057b['importKey']('jwk',_0x2556a7,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0xd6057b['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x383ce7,_0x1e5d36,_0x43b1ea)||(_0x8643c4=!0x1);}}function _0x3f9f3c(_0x20a434){return _0x20a434['startsWith']('ey')?JSON['parse'](_0x488a12(_0x20a434)):null;}function _0x488a12(_0x37c8f6){return window['atob'](_0x37c8f6['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x15000b(_0x410971){let _0x556e09=0x1505;function _0x41df75(_0x15976a){for(let _0x42bbfb=0x0;_0x42bbfb<_0x15976a['length'];_0x42bbfb++){const _0x2038e7=_0x15976a['charCodeAt'](_0x42bbfb);_0x556e09=(_0x556e09<<0x5)+_0x556e09+_0x2038e7,_0x556e09&=_0x556e09;}}function _0x210d4c(_0xc96dbb){Array['isArray'](_0xc96dbb)?_0xc96dbb['forEach'](_0x210d4c):_0xc96dbb&&'object'==typeof _0xc96dbb?Object['entries'](_0xc96dbb)['sort']()['forEach'](([_0x505281,_0x1cfe08])=>{_0x41df75(_0x505281),_0x210d4c(_0x1cfe08);}):_0x41df75(window['String'](_0xc96dbb));}return _0x210d4c(_0x410971),_0x556e09>>>0x0;}function _0x34fab8(_0x16d590){return _0x16d590['toString'](0x10)['padStart'](0x8,'0');}function _0x1d690a(_0x190052){return _0x190052['split']('')['reverse']()['join']('');}function _0x339329(){}_0x181efa(await _0x3f2bd5());}(this);}['_toggleSpecialCursor'](_0x3c032b){this['editor']['editing']['view']['change'](_0x177ff9=>{for(const _0x2fc73b of this['editor']['editing']['view']['document']['roots'])_0x3c032b?_0x177ff9['addClass'](h,_0x2fc73b):_0x177ff9['removeClass'](h,_0x2fc73b);});}['_copyFormatting'](){const {editor:_0x13ae7f}=this;_0x13ae7f['execute'](w),_0x13ae7f['ui']['ariaLiveAnnouncer']['announce'](L(_0x13ae7f['locale'],'Formatting\x20copied.'));}['_pasteFormatting'](){const {editor:_0xaccbb6}=this,_0x1ca31a=_0xaccbb6['commands']['get'](w)['value'];_0xaccbb6['execute'](g,_0x1ca31a),_0xaccbb6['ui']['ariaLiveAnnouncer']['announce'](L(_0xaccbb6['locale'],'Pasted\x20formatting.'));}['_finishPainting'](){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x574cde['window']['document'],'mouseup');}},x=class extends _0x4e9b8b{static get['requires'](){return[P,k];}static get['pluginName'](){return'FormatPainter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{p as CopyFormatCommand,x as FormatPainter,P as FormatPainterEditing,k as FormatPainterUI,y as PasteFormatCommand};
|
|
23
|
+
import{Command as _0x2055bb,Plugin as _0x4ee068}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x36f495}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x74b8f,UIModel as _0x18b8c7,addListToDropdown as _0x56ea55,createDropdown as _0x425627}from'@ckeditor/ckeditor5-ui';import{Collection as _0x51beb4,DomEmitterMixin as _0x5e4b41,global as _0x3fad68,uid as _0x561f7f}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0xee2b3d}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x16c819}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var p=class extends _0x2055bb{constructor(_0x46c11a){super(_0x46c11a),this['value']=void 0x0,this['on']('change:isEnabled',(_0xe8d703,_0x173fdc,_0xa48742)=>{_0xa48742||this['reset']();}),this['on']('change:value',()=>_0x46c11a['commands']['get'](g)['refresh']());}['execute'](){this['value']=this['_getFormattingAttributes']();}['reset'](){this['value']=void 0x0;}['_getFormattingAttributes'](){const _0x3243d4=this['editor']['model'],_0x246c8f=_0x3243d4['document']['selection'];return Object['fromEntries'](Array['from'](_0x246c8f['getAttributes']())['filter'](([_0x2cad2a])=>_0x3243d4['schema']['getAttributeProperties'](_0x2cad2a)['isFormatting']));}},y=class extends _0x2055bb{constructor(_0x3c37ce){super(_0x3c37ce),this['_removeFormatCommand']=new _0x36f495(_0x3c37ce);}['execute'](_0x292da2={}){const _0x34e42b=this['editor']['model'],_0x1ebf83=_0x34e42b['document']['selection'],_0x40a6a0=Array['from'](_0x1ebf83['getRanges']()),_0x32a622=_0x1ebf83['isCollapsed']?[this['_createRangeOnEntireWord'](_0x34e42b,_0x1ebf83)]:_0x40a6a0;_0x34e42b['change'](_0x31c309=>{_0x31c309['setSelection'](_0x32a622),this['_removeFormatCommand']['execute']();for(const _0x25d0c4 in _0x292da2)for(const _0x5dc902 of _0x34e42b['schema']['getValidRanges'](_0x32a622,_0x25d0c4))_0x31c309['setAttribute'](_0x25d0c4,_0x292da2[_0x25d0c4],_0x5dc902);_0x31c309['setSelection'](_0x40a6a0);});}['_createRangeOnEntireWord'](_0x2c425a,_0x3aa216){const _0x41cffa=_0x2c425a['createSelection'](_0x3aa216);_0x2c425a['modifySelection'](_0x41cffa,{'unit':'word','direction':'backward'});const _0x384005=_0x41cffa['getFirstPosition']();_0x2c425a['modifySelection'](_0x41cffa,{'unit':'word','direction':'forward'});const _0xd2a0c7=_0x41cffa['getLastPosition']();return _0x2c425a['createRange'](_0x384005,_0xd2a0c7);}},P=class extends _0x4ee068{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xc46cc3=this['editor'];_0xc46cc3['commands']['add'](w,new p(_0xc46cc3)),_0xc46cc3['commands']['add'](g,new y(_0xc46cc3)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x149e39=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x266268;for(const _0x17295d in _0x149e39){const _0x2bff6d=_0x17295d,_0x44a5f8=_0x149e39[_0x2bff6d];if('formatPainterLicenseKeyValid'==_0x44a5f8||'formatPainterLicenseKeyInvalid'==_0x44a5f8||'formatPainterLicenseKeyExpired'==_0x44a5f8||'formatPainterLicenseKeyDomainLimit'==_0x44a5f8||'formatPainterLicenseKeyNotAllowed'==_0x44a5f8||'formatPainterLicenseKeyEvaluationLimit'==_0x44a5f8||'formatPainterLicenseKeyUsageLimit'==_0x44a5f8){delete _0x149e39[_0x2bff6d],_0x266268=_0x44a5f8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0x266268&&_0x149e39['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0x266268&&_0x149e39['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0x266268&&_0x149e39['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0x266268&&_0x149e39['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0x266268&&_0x149e39['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0x266268&&_0x149e39['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x426503,_0x1b80b7){const t=_0x426503['t'];switch(_0x1b80b7){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 _0x1b80b7;}}const v=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x5e4b41(_0x4ee068);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x49f0a0=this['editor'];_0x49f0a0['editing']['view']['addObserver'](_0xee2b3d),_0x49f0a0['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0x49f0a0['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0x49f0a0['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0x49f0a0['ui']['componentFactory']['add']('formatPainter',_0x34fbf2=>{const _0x5091a2=_0x425627(_0x34fbf2,_0x74b8f),_0x48653f=_0x49f0a0['commands']['get'](w);_0x5091a2['buttonView']['set']({'label':L(_0x49f0a0['locale'],'Paint\x20formatting'),'icon':_0x16c819,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x5091a2['class']='ck-format-painter-dropdown',_0x48653f&&(_0x5091a2['bind']('isEnabled')['to'](_0x48653f,'isEnabled'),this['listenTo'](_0x48653f,'change:isEnabled',(_0x57c45d,_0x1ff825,_0xc2abc)=>{_0xc2abc||this['_finishPainting']();}),_0x5091a2['buttonView']['bind']('isOn')['to'](_0x48653f,'value',_0x17fc0c=>!!_0x17fc0c),this['listenTo'](_0x49f0a0,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x48653f,'change:value',(_0x5f2e79,_0x43dec5,_0x4d991b)=>{this['_toggleSpecialCursor'](!!_0x4d991b);}));const _0x5b3fba=new _0x18b8c7({'withText':!0x0,'label':L(_0x49f0a0['locale'],'Continuous\x20painting'),'tooltip':L(_0x49f0a0['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x56ea55(_0x5091a2,new _0x51beb4([{'type':'switchbutton','model':_0x5b3fba}]),{'role':'menu'});const _0xd9506a=()=>{this['_copyFormatting'](),this['listenTo'](_0x3fad68['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x5b3fba['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x5091a2,'execute',()=>{_0x5b3fba['isOn']=!_0x5b3fba['isOn'];}),this['listenTo'](_0x5091a2['buttonView'],'execute',()=>{_0x49f0a0['editing']['view']['focus'](),_0x5091a2['buttonView']['isOn']?this['_finishPainting']():_0xd9506a();}),_0x49f0a0['keystrokes']['set']('Ctrl+Alt+C',(_0x59e572,_0x7b3be6)=>{_0xd9506a(),_0x5b3fba['isOn']=!0x0,_0x7b3be6();},{'priority':'high'}),_0x49f0a0['keystrokes']['set']('Ctrl+Alt+V',(_0x3cba12,_0x51d809)=>{_0x5091a2['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x5b3fba['isOn']||this['_finishPainting'](),_0x51d809());},{'priority':'high'}),_0x49f0a0['keystrokes']['set']('Esc',(_0x3220c9,_0x39cc4e)=>{_0x5091a2['buttonView']['isOn']&&(_0x5b3fba['isOn']=!0x1,this['_finishPainting'](),_0x49f0a0['ui']['ariaLiveAnnouncer']['announce'](L(_0x49f0a0['locale'],'Painting\x20cancelled.')),_0x39cc4e());}),_0x5091a2;});}['afterInit'](){!async function(_0x53d280){const _0x1a2b06='QiLRCSOsZ8pAvDdaPJUE3oxjKlzM2uXgrtGfeyh5cNFkmBw9I6WH0qnb4T17YV',_0x29292d=0x78e58,_0x4bcc81=window['Date']['now'](),_0x1f8aa4=_0x53d280['editor'],_0x139e06=new window['Promise'](_0x397dcf=>{_0x1f8aa4['once']('ready',_0x397dcf);}),_0xd2fd05={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x4e61e9=_0x1f8aa4['config']['get']('licenseKey');async function _0x1db20b(){let _0x48ff38,_0x116af4=null,_0x38e997=null;try{return'GPL'==_0x4e61e9?'NotAllowed':(_0x48ff38=_0x430473(),_0x48ff38?(_0x48ff38['usageEndpoint']&&(_0x38e997=_0x29632b(_0x48ff38['usageEndpoint'],_0x48ff38['jti'])),await _0x19ab17()?_0x4ad13c()?_0x19e635()?'Expired':_0x17baa1()?('evaluation'==_0x48ff38['licenseType']&&(_0x116af4=_0xf02e49('EvaluationLimit')),await _0x40952c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x19e635(){const _0x2d64ee=['evaluation','trial']['includes'](_0x48ff38['licenseType'])?_0x4bcc81/0x3e8:0xe10*_0x29292d;return _0x48ff38['exp']<_0x2d64ee;}function _0x4ad13c(){const _0x1e017c=_0x48ff38['features'];return!!_0x1e017c&&(!!_0x1e017c['includes']('*')||(!!_0x1e017c['includes']('FP')||(!!_0x1e017c['includes']('PP')||!(!_0x1e017c['includes']('TRILIUM')||!_0x18ccb0()))));}function _0x17baa1(){const _0x3e4985=_0x48ff38['licensedHosts'];if(!_0x3e4985||0x0==_0x3e4985['length'])return!0x0;const {hostname:_0x4b4458}=new URL(window['location']['href']);if(_0x3e4985['includes'](_0x4b4458))return!0x0;const _0x5414da=_0x4b4458['split']('.');return _0x3e4985['filter'](_0xbc112a=>_0xbc112a['includes']('*'))['map'](_0x4e0b0f=>_0x4e0b0f['split']('.'))['filter'](_0x46df0d=>_0x46df0d['length']<=_0x5414da['length'])['map'](_0x536e9e=>Array(_0x5414da['length']-_0x536e9e['length'])['fill']('*'===_0x536e9e[0x0]?'*':'')['concat'](_0x536e9e))['some'](_0x146833=>_0x5414da['every']((_0xc321f6,_0x2ac684)=>_0x146833[_0x2ac684]===_0xc321f6||'*'===_0x146833[_0x2ac684]));}function _0x40952c(){return _0x116af4&&_0x38e997?new window['Promise']((_0x23158f,_0x327d06)=>{_0x116af4['then'](_0x23158f,_0x327d06),_0x38e997['then'](_0x394a28=>{'Valid'!=_0x394a28&&_0x23158f(_0x394a28);},_0x327d06);}):_0x116af4||_0x38e997||'Valid';}}function _0x29632b(_0x57b209,_0x491f80){return new window['Promise'](_0x57614d=>{if(_0x9e6a08())return _0x57614d('Valid');_0xe26ba5(),_0x1f8aa4['decorate']('_sendUsageRequest');let _0x4e71e5=!0x1;const _0x131d47=_0x561f7f();function _0x497e16(_0x3058ad){return!!_0x3058ad&&('object'==typeof _0x3058ad||'function'==typeof _0x3058ad)&&'function'==typeof _0x3058ad['then']&&'function'==typeof _0x3058ad['catch'];}function _0x5aeda5(_0x45dd9d){_0x506e49(_0x45dd9d)['then'](_0x3cbf0c=>_0x3cbf0c&&'ok'==_0x3cbf0c['status']?_0x422b0b(_0x21f75f(_0x131d47+_0x491f80))!=_0x3cbf0c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3b6604=>(_0x56e62a(),_0x3b6604),()=>{const _0x4c96c8=_0xeb1404();return null==_0x4c96c8?(_0x56e62a(),'Valid'):_0x4bcc81-_0x4c96c8>0x240c8400?'UsageLimit':'Valid';})['then'](_0x57614d)['catch'](()=>{_0x57614d('UsageLimit');});const _0xf6c0b2=0x36ee80;function _0x56e62a(){const _0x5bbcaa='llct-'+_0x422b0b(_0x21f75f(_0x57b209)),_0x45271a=_0x5d6960(_0x422b0b(window['Math']['ceil'](_0x4bcc81/_0xf6c0b2)));window['localStorage']['setItem'](_0x5bbcaa,_0x45271a);}function _0xeb1404(){const _0x118af9='llct-'+_0x422b0b(_0x21f75f(_0x57b209)),_0x51b558=window['localStorage']['getItem'](_0x118af9);return _0x51b558?window['parseInt'](_0x5d6960(_0x51b558),0x10)*_0xf6c0b2:null;}function _0x506e49(_0xabc0e9){return new window['Promise']((_0x2a07fd,_0x4663e6)=>{_0xabc0e9['then'](_0x2a07fd,_0x4663e6),window['setTimeout'](_0x4663e6,0x1d4c0);});}}_0x1f8aa4['on']('_sendUsageRequest',(_0x120f03,_0x267f81)=>{if(_0x267f81[0x0]!=_0x57b209)return _0x57614d('UsageLimit');_0x267f81[0x1]={..._0x267f81[0x1],'requestId':_0x131d47};},{'priority':'high'}),_0x1f8aa4['on']('_sendUsageRequest',_0x5e8738=>{_0x497e16(_0x5e8738['return'])&&(_0x4e71e5=!0x0,_0x5aeda5(_0x5e8738['return']));},{'priority':'low'}),_0x139e06['then'](()=>{_0x4e71e5||_0x57614d('UsageLimit');});});function _0x9e6a08(){return'auto'==_0x1f8aa4['editing']['view']['_overlayModeHint'];}function _0xe26ba5(){_0x1f8aa4['editing']['view']['_overlayModeHint']='auto';}}function _0xf02e49(_0x49ca18){const _0x18122f=[new window['Promise'](_0x450873=>setTimeout(_0x450873,0x93ecc)),_0x139e06['then'](()=>new window['Promise'](_0x44a51e=>{let _0x5974eb=0x0;_0x1f8aa4['model']['on']('applyOperation',(_0x4f19ca,_0x93ebf8)=>{_0x93ebf8[0x0]['isDocumentOperation']&&_0x5974eb++,0x5e8==_0x5974eb&&(_0x44a51e(),_0x4f19ca['off']());});}))];return window['Promise']['race'](_0x18122f)['then'](()=>_0x49ca18);}async function _0x4fec80(){await _0x139e06,_0x1f8aa4['model']['change']=_0x2a439c,_0x1f8aa4['model']['enqueueChange']=_0x2a439c,_0x1f8aa4['enableReadOnlyMode']('model');}function _0x18ccb0(){return window['glob']&&window['glob']['triliumVersion'];}function _0x490feb(_0x1d51f7){const _0x242e91=_0x1fbf01();_0x1f8aa4[_0x242e91]='formatPainterLicenseKey'+_0x1d51f7,'Valid'!=_0x1d51f7&&_0x4fec80();}function _0x1fbf01(){const _0x32b3b5=window['String'](window['performance']['now']())['replace']('.','');let _0x1c7c9e='Q';for(let _0x3edf8d=0x0;_0x3edf8d<_0x32b3b5['length'];_0x3edf8d+=0x2){let _0xdc1dcd=window['parseInt'](_0x32b3b5['substring'](_0x3edf8d,_0x3edf8d+0x2));_0xdc1dcd>=0x3e&&(_0xdc1dcd-=0x3e),_0x1c7c9e+=_0x1a2b06[_0xdc1dcd];}return _0x1c7c9e;}function _0x430473(){const _0x1d499c=_0x4e61e9['split']('.');if(0x3!=_0x1d499c['length'])return null;return _0x3564cc(_0x1d499c[0x1]);function _0x3564cc(_0x1f3de9){const _0x56c8df=_0xec8438(_0x1f3de9);return _0x56c8df&&_0xb2b071()?_0x56c8df:null;function _0xb2b071(){const _0x454064=_0x56c8df['jti'],_0x543112=window['parseInt'](_0x454064['substring'](_0x454064['length']-0x8),0x10),_0xe02899={..._0x56c8df,'jti':_0x454064['substring'](0x0,_0x454064['length']-0x8)};return delete _0xe02899['vc'],_0x21f75f(_0xe02899)==_0x543112;}}}async function _0x19ab17(){let _0x2fe836=!0x0;try{const [_0x15d3f4,_0x11db33,_0x5ca4cf]=_0x4e61e9['split']('.');return _0x2eaa56(_0x15d3f4),await _0x1bcd97(_0x15d3f4,_0x11db33,_0x5ca4cf),_0x2fe836;}catch{return!0x1;}function _0x2eaa56(_0x341890){const _0x5f05a7=_0xec8438(_0x341890);_0x5f05a7&&'ES256'==_0x5f05a7['alg']||(_0x2fe836=!0x1);}async function _0x1bcd97(_0x5a23bd,_0x3e5d27,_0x5d7e8e){const _0x226c3e=window['Uint8Array']['from'](_0x31a632(_0x5d7e8e),_0x280eb4=>_0x280eb4['charCodeAt'](0x0)),_0x21fae3=new window['TextEncoder']()['encode'](_0x5a23bd+'.'+_0x3e5d27),_0x39b41e=window['crypto']['subtle'];if(!_0x39b41e)return;const _0x124f6d=await _0x39b41e['importKey']('jwk',_0xd2fd05,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x39b41e['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x124f6d,_0x226c3e,_0x21fae3)||(_0x2fe836=!0x1);}}function _0xec8438(_0x135ecb){return _0x135ecb['startsWith']('ey')?JSON['parse'](_0x31a632(_0x135ecb)):null;}function _0x31a632(_0x13c1f3){return window['atob'](_0x13c1f3['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x21f75f(_0x3e5d6a){let _0x33d9cb=0x1505;function _0x582440(_0x34aeb7){for(let _0x49e91f=0x0;_0x49e91f<_0x34aeb7['length'];_0x49e91f++){const _0x78f7a9=_0x34aeb7['charCodeAt'](_0x49e91f);_0x33d9cb=(_0x33d9cb<<0x5)+_0x33d9cb+_0x78f7a9,_0x33d9cb&=_0x33d9cb;}}function _0x40819a(_0x364404){Array['isArray'](_0x364404)?_0x364404['forEach'](_0x40819a):_0x364404&&'object'==typeof _0x364404?Object['entries'](_0x364404)['sort']()['forEach'](([_0x1a5d0a,_0x1abce3])=>{_0x582440(_0x1a5d0a),_0x40819a(_0x1abce3);}):_0x582440(window['String'](_0x364404));}return _0x40819a(_0x3e5d6a),_0x33d9cb>>>0x0;}function _0x422b0b(_0x3fa334){return _0x3fa334['toString'](0x10)['padStart'](0x8,'0');}function _0x5d6960(_0x50dedf){return _0x50dedf['split']('')['reverse']()['join']('');}function _0x2a439c(){}_0x490feb(await _0x1db20b());}(this);}['_toggleSpecialCursor'](_0x216a44){this['editor']['editing']['view']['change'](_0x190d59=>{for(const _0x19e2bb of this['editor']['editing']['view']['document']['roots'])_0x216a44?_0x190d59['addClass'](h,_0x19e2bb):_0x190d59['removeClass'](h,_0x19e2bb);});}['_copyFormatting'](){const {editor:_0x44aedf}=this;_0x44aedf['execute'](w),_0x44aedf['ui']['ariaLiveAnnouncer']['announce'](L(_0x44aedf['locale'],'Formatting\x20copied.'));}['_pasteFormatting'](){const {editor:_0x4bb598}=this,_0x26ea70=_0x4bb598['commands']['get'](w)['value'];_0x4bb598['execute'](g,_0x26ea70),_0x4bb598['ui']['ariaLiveAnnouncer']['announce'](L(_0x4bb598['locale'],'Pasted\x20formatting.'));}['_finishPainting'](){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x3fad68['window']['document'],'mouseup');}},x=class extends _0x4ee068{static get['requires'](){return[P,k];}static get['pluginName'](){return'FormatPainter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{p as CopyFormatCommand,x as FormatPainter,P as FormatPainterEditing,k as FormatPainterUI,y as PasteFormatCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-format-painter",
|
|
3
|
-
"version": "48.3.0-alpha.
|
|
3
|
+
"version": "48.3.0-alpha.6",
|
|
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.3.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-remove-format": "48.3.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.3.0-alpha.6",
|
|
25
|
+
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.6",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.6",
|
|
27
|
+
"@ckeditor/ckeditor5-remove-format": "48.3.0-alpha.6",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.6",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.6"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|