@ckeditor/ckeditor5-format-painter 48.3.0-alpha.4 → 48.3.0-alpha.5

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -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 _0x1fcbbe,Plugin as _0x42ffac}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x3ad184}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x4e3dd4,UIModel as _0x21936a,addListToDropdown as _0x5b068b,createDropdown as _0x36e2f1}from'@ckeditor/ckeditor5-ui';import{Collection as _0x4ec450,DomEmitterMixin as _0x42fbd7,global as _0x522238,uid as _0x4965d9}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0x492ce2}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x532952}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var p=class extends _0x1fcbbe{constructor(_0x4cd196){super(_0x4cd196),this['value']=void 0x0,this['on']('change:isEnabled',(_0x3c5f25,_0x557b9e,_0x3623d)=>{_0x3623d||this['reset']();}),this['on']('change:value',()=>_0x4cd196['commands']['get'](g)['refresh']());}['execute'](){this['value']=this['_getFormattingAttributes']();}['reset'](){this['value']=void 0x0;}['_getFormattingAttributes'](){const _0x3dd946=this['editor']['model'],_0x574fe8=_0x3dd946['document']['selection'];return Object['fromEntries'](Array['from'](_0x574fe8['getAttributes']())['filter'](([_0x4a4b1b])=>_0x3dd946['schema']['getAttributeProperties'](_0x4a4b1b)['isFormatting']));}},y=class extends _0x1fcbbe{constructor(_0x5c5dd2){super(_0x5c5dd2),this['_removeFormatCommand']=new _0x3ad184(_0x5c5dd2);}['execute'](_0x52da9a={}){const _0x4ca726=this['editor']['model'],_0x23a994=_0x4ca726['document']['selection'],_0x39261f=Array['from'](_0x23a994['getRanges']()),_0x505614=_0x23a994['isCollapsed']?[this['_createRangeOnEntireWord'](_0x4ca726,_0x23a994)]:_0x39261f;_0x4ca726['change'](_0x160cde=>{_0x160cde['setSelection'](_0x505614),this['_removeFormatCommand']['execute']();for(const _0x209154 in _0x52da9a)for(const _0x41f6be of _0x4ca726['schema']['getValidRanges'](_0x505614,_0x209154))_0x160cde['setAttribute'](_0x209154,_0x52da9a[_0x209154],_0x41f6be);_0x160cde['setSelection'](_0x39261f);});}['_createRangeOnEntireWord'](_0x1a7074,_0x7aa764){const _0xf57fe7=_0x1a7074['createSelection'](_0x7aa764);_0x1a7074['modifySelection'](_0xf57fe7,{'unit':'word','direction':'backward'});const _0x58883f=_0xf57fe7['getFirstPosition']();_0x1a7074['modifySelection'](_0xf57fe7,{'unit':'word','direction':'forward'});const _0x4b37c1=_0xf57fe7['getLastPosition']();return _0x1a7074['createRange'](_0x58883f,_0x4b37c1);}},P=class extends _0x42ffac{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x751d3d=this['editor'];_0x751d3d['commands']['add'](w,new p(_0x751d3d)),_0x751d3d['commands']['add'](g,new y(_0x751d3d)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x405034=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xd68c08;for(const _0x12c9cf in _0x405034){const _0x5129e8=_0x12c9cf,_0x4dc4c4=_0x405034[_0x5129e8];if('formatPainterLicenseKeyValid'==_0x4dc4c4||'formatPainterLicenseKeyInvalid'==_0x4dc4c4||'formatPainterLicenseKeyExpired'==_0x4dc4c4||'formatPainterLicenseKeyDomainLimit'==_0x4dc4c4||'formatPainterLicenseKeyNotAllowed'==_0x4dc4c4||'formatPainterLicenseKeyEvaluationLimit'==_0x4dc4c4||'formatPainterLicenseKeyUsageLimit'==_0x4dc4c4){delete _0x405034[_0x5129e8],_0xd68c08=_0x4dc4c4,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0xd68c08&&_0x405034['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0xd68c08&&_0x405034['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0xd68c08&&_0x405034['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0xd68c08&&_0x405034['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0xd68c08&&_0x405034['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0xd68c08&&_0x405034['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x582bc1,_0x2a51ac){const t=_0x582bc1['t'];switch(_0x2a51ac){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 _0x2a51ac;}}const v=/* #__PURE__ -- @preserve */
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 _0x5bc8db,Plugin as _0x4e9b8b}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x1e3ec2}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x2dd5b5,UIModel as _0x4d7b73,addListToDropdown as _0x148af3,createDropdown as _0x5017b1}from'@ckeditor/ckeditor5-ui';import{Collection as _0xf6db04,DomEmitterMixin as _0x3ac4ed,global as _0x574cde,uid as _0x13acf5}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0x15e0ae}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x23bf0f}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var p=class extends _0x5bc8db{constructor(_0x3f789a){super(_0x3f789a),this['value']=void 0x0,this['on']('change:isEnabled',(_0x353044,_0x2bc195,_0x56be46)=>{_0x56be46||this['reset']();}),this['on']('change:value',()=>_0x3f789a['commands']['get'](g)['refresh']());}['execute'](){this['value']=this['_getFormattingAttributes']();}['reset'](){this['value']=void 0x0;}['_getFormattingAttributes'](){const _0x4fd8f2=this['editor']['model'],_0x352b67=_0x4fd8f2['document']['selection'];return Object['fromEntries'](Array['from'](_0x352b67['getAttributes']())['filter'](([_0xe30c18])=>_0x4fd8f2['schema']['getAttributeProperties'](_0xe30c18)['isFormatting']));}},y=class extends _0x5bc8db{constructor(_0x14ebc3){super(_0x14ebc3),this['_removeFormatCommand']=new _0x1e3ec2(_0x14ebc3);}['execute'](_0x575604={}){const _0x2122d4=this['editor']['model'],_0x899da8=_0x2122d4['document']['selection'],_0x4c4b42=Array['from'](_0x899da8['getRanges']()),_0x21ed30=_0x899da8['isCollapsed']?[this['_createRangeOnEntireWord'](_0x2122d4,_0x899da8)]:_0x4c4b42;_0x2122d4['change'](_0x57547b=>{_0x57547b['setSelection'](_0x21ed30),this['_removeFormatCommand']['execute']();for(const _0xfe71a2 in _0x575604)for(const _0xb1a4ab of _0x2122d4['schema']['getValidRanges'](_0x21ed30,_0xfe71a2))_0x57547b['setAttribute'](_0xfe71a2,_0x575604[_0xfe71a2],_0xb1a4ab);_0x57547b['setSelection'](_0x4c4b42);});}['_createRangeOnEntireWord'](_0x55bad9,_0x469802){const _0x99f05c=_0x55bad9['createSelection'](_0x469802);_0x55bad9['modifySelection'](_0x99f05c,{'unit':'word','direction':'backward'});const _0x35a254=_0x99f05c['getFirstPosition']();_0x55bad9['modifySelection'](_0x99f05c,{'unit':'word','direction':'forward'});const _0x1a957a=_0x99f05c['getLastPosition']();return _0x55bad9['createRange'](_0x35a254,_0x1a957a);}},P=class extends _0x4e9b8b{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5f8582=this['editor'];_0x5f8582['commands']['add'](w,new p(_0x5f8582)),_0x5f8582['commands']['add'](g,new y(_0x5f8582)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2ab6e0=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xf81ea9;for(const _0x2f2fe6 in _0x2ab6e0){const _0x3a702e=_0x2f2fe6,_0x27ecd9=_0x2ab6e0[_0x3a702e];if('formatPainterLicenseKeyValid'==_0x27ecd9||'formatPainterLicenseKeyInvalid'==_0x27ecd9||'formatPainterLicenseKeyExpired'==_0x27ecd9||'formatPainterLicenseKeyDomainLimit'==_0x27ecd9||'formatPainterLicenseKeyNotAllowed'==_0x27ecd9||'formatPainterLicenseKeyEvaluationLimit'==_0x27ecd9||'formatPainterLicenseKeyUsageLimit'==_0x27ecd9){delete _0x2ab6e0[_0x3a702e],_0xf81ea9=_0x27ecd9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0xf81ea9&&_0x2ab6e0['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0xf81ea9&&_0x2ab6e0['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0xf81ea9&&_0x2ab6e0['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0xf81ea9&&_0x2ab6e0['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0xf81ea9&&_0x2ab6e0['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0xf81ea9&&_0x2ab6e0['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x56f34b,_0x115e9a){const t=_0x56f34b['t'];switch(_0x115e9a){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 _0x115e9a;}}const v=/* #__PURE__ -- @preserve */
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-format-painter",
3
- "version": "48.3.0-alpha.4",
3
+ "version": "48.3.0-alpha.5",
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.4",
25
- "@ckeditor/ckeditor5-engine": "48.3.0-alpha.4",
26
- "@ckeditor/ckeditor5-icons": "48.3.0-alpha.4",
27
- "@ckeditor/ckeditor5-remove-format": "48.3.0-alpha.4",
28
- "@ckeditor/ckeditor5-ui": "48.3.0-alpha.4",
29
- "@ckeditor/ckeditor5-utils": "48.3.0-alpha.4"
24
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.5",
25
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.5",
26
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.5",
27
+ "@ckeditor/ckeditor5-remove-format": "48.3.0-alpha.5",
28
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.5",
29
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.5"
30
30
  },
31
31
  "files": [
32
32
  "dist",