@ckeditor/ckeditor5-format-painter 48.3.0-alpha.4 → 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
|
-
_0x42fbd7(_0x42ffac);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd8592b=this['editor'];_0xd8592b['editing']['view']['addObserver'](_0x492ce2),_0xd8592b['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0xd8592b['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0xd8592b['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0xd8592b['ui']['componentFactory']['add']('formatPainter',_0x29316a=>{const _0x12da1d=_0x36e2f1(_0x29316a,_0x4e3dd4),_0x1afdcb=_0xd8592b['commands']['get'](w);_0x12da1d['buttonView']['set']({'label':L(_0xd8592b['locale'],'Paint\x20formatting'),'icon':_0x532952,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x12da1d['class']='ck-format-painter-dropdown',_0x1afdcb&&(_0x12da1d['bind']('isEnabled')['to'](_0x1afdcb,'isEnabled'),this['listenTo'](_0x1afdcb,'change:isEnabled',(_0x216ef,_0x53d06c,_0x5c8efc)=>{_0x5c8efc||this['_finishPainting']();}),_0x12da1d['buttonView']['bind']('isOn')['to'](_0x1afdcb,'value',_0xfea22d=>!!_0xfea22d),this['listenTo'](_0xd8592b,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x1afdcb,'change:value',(_0xacaca5,_0x644215,_0x9214ac)=>{this['_toggleSpecialCursor'](!!_0x9214ac);}));const _0x1a0f41=new _0x21936a({'withText':!0x0,'label':L(_0xd8592b['locale'],'Continuous\x20painting'),'tooltip':L(_0xd8592b['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x5b068b(_0x12da1d,new _0x4ec450([{'type':'switchbutton','model':_0x1a0f41}]),{'role':'menu'});const _0x3b5b71=()=>{this['_copyFormatting'](),this['listenTo'](_0x522238['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x1a0f41['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x12da1d,'execute',()=>{_0x1a0f41['isOn']=!_0x1a0f41['isOn'];}),this['listenTo'](_0x12da1d['buttonView'],'execute',()=>{_0xd8592b['editing']['view']['focus'](),_0x12da1d['buttonView']['isOn']?this['_finishPainting']():_0x3b5b71();}),_0xd8592b['keystrokes']['set']('Ctrl+Alt+C',(_0x5f1eb7,_0x546580)=>{_0x3b5b71(),_0x1a0f41['isOn']=!0x0,_0x546580();},{'priority':'high'}),_0xd8592b['keystrokes']['set']('Ctrl+Alt+V',(_0x204729,_0x276672)=>{_0x12da1d['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x1a0f41['isOn']||this['_finishPainting'](),_0x276672());},{'priority':'high'}),_0xd8592b['keystrokes']['set']('Esc',(_0x124508,_0x3947ef)=>{_0x12da1d['buttonView']['isOn']&&(_0x1a0f41['isOn']=!0x1,this['_finishPainting'](),_0xd8592b['ui']['ariaLiveAnnouncer']['announce'](L(_0xd8592b['locale'],'Painting\x20cancelled.')),_0x3947ef());}),_0x12da1d;});}['afterInit'](){!async function(_0x243430){const _0x58ce0b='QiLRCSOsZ8pAvDdaPJUE3oxjKlzM2uXgrtGfeyh5cNFkmBw9I6WH0qnb4T17YV',_0x204a32=0x78e28,_0x1f17c8=window['Date']['now'](),_0x1822f5=_0x243430['editor'],_0x384ee2=new window['Promise'](_0xfb4f2d=>{_0x1822f5['once']('ready',_0xfb4f2d);}),_0x552422={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x34968c=_0x1822f5['config']['get']('licenseKey');async function _0xaac9c2(){let _0x1fc728,_0x498ccb=null,_0xd007d9=null;try{return'GPL'==_0x34968c?'NotAllowed':(_0x1fc728=_0x31f6b7(),_0x1fc728?(_0x1fc728['usageEndpoint']&&(_0xd007d9=_0x1c79d7(_0x1fc728['usageEndpoint'],_0x1fc728['jti'])),await _0x4c5dc5()?_0x4bb050()?_0x2480b6()?'Expired':_0x797e8c()?('evaluation'==_0x1fc728['licenseType']&&(_0x498ccb=_0x5e7538('EvaluationLimit')),await _0x4f6c03()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2480b6(){const _0x404a8d=['evaluation','trial']['includes'](_0x1fc728['licenseType'])?_0x1f17c8/0x3e8:0xe10*_0x204a32;return _0x1fc728['exp']<_0x404a8d;}function _0x4bb050(){const _0x5e682c=_0x1fc728['features'];return!!_0x5e682c&&(!!_0x5e682c['includes']('*')||(!!_0x5e682c['includes']('FP')||(!!_0x5e682c['includes']('PP')||!(!_0x5e682c['includes']('TRILIUM')||!_0x372f4b()))));}function _0x797e8c(){const _0x298b6d=_0x1fc728['licensedHosts'];if(!_0x298b6d||0x0==_0x298b6d['length'])return!0x0;const {hostname:_0x474f48}=new URL(window['location']['href']);if(_0x298b6d['includes'](_0x474f48))return!0x0;const _0xc000f4=_0x474f48['split']('.');return _0x298b6d['filter'](_0x410f14=>_0x410f14['includes']('*'))['map'](_0x23afe0=>_0x23afe0['split']('.'))['filter'](_0x13099f=>_0x13099f['length']<=_0xc000f4['length'])['map'](_0x2b914b=>Array(_0xc000f4['length']-_0x2b914b['length'])['fill']('*'===_0x2b914b[0x0]?'*':'')['concat'](_0x2b914b))['some'](_0x1980f9=>_0xc000f4['every']((_0x4da20d,_0x17c2d5)=>_0x1980f9[_0x17c2d5]===_0x4da20d||'*'===_0x1980f9[_0x17c2d5]));}function _0x4f6c03(){return _0x498ccb&&_0xd007d9?new window['Promise']((_0x54fd07,_0x482b86)=>{_0x498ccb['then'](_0x54fd07,_0x482b86),_0xd007d9['then'](_0x438162=>{'Valid'!=_0x438162&&_0x54fd07(_0x438162);},_0x482b86);}):_0x498ccb||_0xd007d9||'Valid';}}function _0x1c79d7(_0x2999bc,_0x49cc51){return new window['Promise'](_0x4915cf=>{if(_0x8f630f())return _0x4915cf('Valid');_0x2fd5a0(),_0x1822f5['decorate']('_sendUsageRequest');let _0xe61201=!0x1;const _0x412bd5=_0x4965d9();function _0x5c9e1f(_0x5e5bf5){return!!_0x5e5bf5&&('object'==typeof _0x5e5bf5||'function'==typeof _0x5e5bf5)&&'function'==typeof _0x5e5bf5['then']&&'function'==typeof _0x5e5bf5['catch'];}function _0x232e4b(_0x2ff85e){_0x43230a(_0x2ff85e)['then'](_0x25bba2=>_0x25bba2&&'ok'==_0x25bba2['status']?_0x4791e9(_0x55fb56(_0x412bd5+_0x49cc51))!=_0x25bba2['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x625e90=>(_0x80e1fc(),_0x625e90),()=>{const _0x3851d4=_0x24119d();return null==_0x3851d4?(_0x80e1fc(),'Valid'):_0x1f17c8-_0x3851d4>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4915cf)['catch'](()=>{_0x4915cf('UsageLimit');});const _0x311a86=0x36ee80;function _0x80e1fc(){const _0x3dd2a2='llct-'+_0x4791e9(_0x55fb56(_0x2999bc)),_0x58e61a=_0x397066(_0x4791e9(window['Math']['ceil'](_0x1f17c8/_0x311a86)));window['localStorage']['setItem'](_0x3dd2a2,_0x58e61a);}function _0x24119d(){const _0x42e70b='llct-'+_0x4791e9(_0x55fb56(_0x2999bc)),_0x407e40=window['localStorage']['getItem'](_0x42e70b);return _0x407e40?window['parseInt'](_0x397066(_0x407e40),0x10)*_0x311a86:null;}function _0x43230a(_0x35b227){return new window['Promise']((_0x11d402,_0x11042b)=>{_0x35b227['then'](_0x11d402,_0x11042b),window['setTimeout'](_0x11042b,0x1d4c0);});}}_0x1822f5['on']('_sendUsageRequest',(_0x13ac98,_0x1536e4)=>{if(_0x1536e4[0x0]!=_0x2999bc)return _0x4915cf('UsageLimit');_0x1536e4[0x1]={..._0x1536e4[0x1],'requestId':_0x412bd5};},{'priority':'high'}),_0x1822f5['on']('_sendUsageRequest',_0x289a4d=>{_0x5c9e1f(_0x289a4d['return'])&&(_0xe61201=!0x0,_0x232e4b(_0x289a4d['return']));},{'priority':'low'}),_0x384ee2['then'](()=>{_0xe61201||_0x4915cf('UsageLimit');});});function _0x8f630f(){return'auto'==_0x1822f5['editing']['view']['_overlayModeHint'];}function _0x2fd5a0(){_0x1822f5['editing']['view']['_overlayModeHint']='auto';}}function _0x5e7538(_0x50b8b1){const _0x116e52=[new window['Promise'](_0x148c20=>setTimeout(_0x148c20,0x93ecc)),_0x384ee2['then'](()=>new window['Promise'](_0x264266=>{let _0x273e9d=0x0;_0x1822f5['model']['on']('applyOperation',(_0x589bb2,_0x300550)=>{_0x300550[0x0]['isDocumentOperation']&&_0x273e9d++,0x5e8==_0x273e9d&&(_0x264266(),_0x589bb2['off']());});}))];return window['Promise']['race'](_0x116e52)['then'](()=>_0x50b8b1);}async function _0x52cfa8(){await _0x384ee2,_0x1822f5['model']['change']=_0xa950d2,_0x1822f5['model']['enqueueChange']=_0xa950d2,_0x1822f5['enableReadOnlyMode']('model');}function _0x372f4b(){return window['glob']&&window['glob']['triliumVersion'];}function _0x43d533(_0x27d1b3){const _0x35a945=_0x326c8f();_0x1822f5[_0x35a945]='formatPainterLicenseKey'+_0x27d1b3,'Valid'!=_0x27d1b3&&_0x52cfa8();}function _0x326c8f(){const _0x391371=window['String'](window['performance']['now']())['replace']('.','');let _0xfa1270='Q';for(let _0x39d277=0x0;_0x39d277<_0x391371['length'];_0x39d277+=0x2){let _0xee19e6=window['parseInt'](_0x391371['substring'](_0x39d277,_0x39d277+0x2));_0xee19e6>=0x3e&&(_0xee19e6-=0x3e),_0xfa1270+=_0x58ce0b[_0xee19e6];}return _0xfa1270;}function _0x31f6b7(){const _0x3a9e68=_0x34968c['split']('.');if(0x3!=_0x3a9e68['length'])return null;return _0x49c1f4(_0x3a9e68[0x1]);function _0x49c1f4(_0x3e6e4f){const _0x1aa852=_0x316966(_0x3e6e4f);return _0x1aa852&&_0x2f8d9a()?_0x1aa852:null;function _0x2f8d9a(){const _0x3b7078=_0x1aa852['jti'],_0x3fc3e9=window['parseInt'](_0x3b7078['substring'](_0x3b7078['length']-0x8),0x10),_0x2d323a={..._0x1aa852,'jti':_0x3b7078['substring'](0x0,_0x3b7078['length']-0x8)};return delete _0x2d323a['vc'],_0x55fb56(_0x2d323a)==_0x3fc3e9;}}}async function _0x4c5dc5(){let _0x25b49f=!0x0;try{const [_0x19cf2d,_0x30d92b,_0x9397a9]=_0x34968c['split']('.');return _0xf08196(_0x19cf2d),await _0x5b657c(_0x19cf2d,_0x30d92b,_0x9397a9),_0x25b49f;}catch{return!0x1;}function _0xf08196(_0x24957d){const _0x2d2f1b=_0x316966(_0x24957d);_0x2d2f1b&&'ES256'==_0x2d2f1b['alg']||(_0x25b49f=!0x1);}async function _0x5b657c(_0x565957,_0x517685,_0x487a3a){const _0x7f9948=window['Uint8Array']['from'](_0x55dc90(_0x487a3a),_0x2fbd0b=>_0x2fbd0b['charCodeAt'](0x0)),_0x3c8364=new window['TextEncoder']()['encode'](_0x565957+'.'+_0x517685),_0x4a0225=window['crypto']['subtle'];if(!_0x4a0225)return;const _0x311ddb=await _0x4a0225['importKey']('jwk',_0x552422,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4a0225['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x311ddb,_0x7f9948,_0x3c8364)||(_0x25b49f=!0x1);}}function _0x316966(_0x35067e){return _0x35067e['startsWith']('ey')?JSON['parse'](_0x55dc90(_0x35067e)):null;}function _0x55dc90(_0x4d0d74){return window['atob'](_0x4d0d74['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x55fb56(_0x24595b){let _0x5b7a13=0x1505;function _0x187526(_0x20e7ea){for(let _0x19f9e4=0x0;_0x19f9e4<_0x20e7ea['length'];_0x19f9e4++){const _0x310635=_0x20e7ea['charCodeAt'](_0x19f9e4);_0x5b7a13=(_0x5b7a13<<0x5)+_0x5b7a13+_0x310635,_0x5b7a13&=_0x5b7a13;}}function _0x370711(_0x18605f){Array['isArray'](_0x18605f)?_0x18605f['forEach'](_0x370711):_0x18605f&&'object'==typeof _0x18605f?Object['entries'](_0x18605f)['sort']()['forEach'](([_0x7daa1,_0x5740e4])=>{_0x187526(_0x7daa1),_0x370711(_0x5740e4);}):_0x187526(window['String'](_0x18605f));}return _0x370711(_0x24595b),_0x5b7a13>>>0x0;}function _0x4791e9(_0x34ce82){return _0x34ce82['toString'](0x10)['padStart'](0x8,'0');}function _0x397066(_0x1d7e47){return _0x1d7e47['split']('')['reverse']()['join']('');}function _0xa950d2(){}_0x43d533(await _0xaac9c2());}(this);}['_toggleSpecialCursor'](_0x3d1851){this['editor']['editing']['view']['change'](_0x48fae9=>{for(const _0x19fb56 of this['editor']['editing']['view']['document']['roots'])_0x3d1851?_0x48fae9['addClass'](h,_0x19fb56):_0x48fae9['removeClass'](h,_0x19fb56);});}['_copyFormatting'](){const {editor:_0x361800}=this;_0x361800['execute'](w),_0x361800['ui']['ariaLiveAnnouncer']['announce'](L(_0x361800['locale'],'Formatting\x20copied.'));}['_pasteFormatting'](){const {editor:_0x5149c1}=this,_0x38f673=_0x5149c1['commands']['get'](w)['value'];_0x5149c1['execute'](g,_0x38f673),_0x5149c1['ui']['ariaLiveAnnouncer']['announce'](L(_0x5149c1['locale'],'Pasted\x20formatting.'));}['_finishPainting'](){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x522238['window']['document'],'mouseup');}},x=class extends _0x42ffac{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",
|