@ckeditor/ckeditor5-format-painter 48.4.0-alpha.4 → 48.4.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 _0x295268,Plugin as _0x119c38}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x38317}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x23bfa7,UIModel as _0x40c2b1,addListToDropdown as _0x4a4e9c,createDropdown as _0x53858a}from'@ckeditor/ckeditor5-ui';import{Collection as _0x59fe94,DomEmitterMixin as _0x515d24,global as _0x8a075a,uid as _0x420099}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0xe3d589}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x891c0f}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var p=class extends _0x295268{constructor(_0x4ee9e0){super(_0x4ee9e0),this['value']=void 0x0,this['on']('change:isEnabled',(_0x38eb80,_0x171dc7,_0x1924da)=>{_0x1924da||this['reset']();}),this['on']('change:value',()=>_0x4ee9e0['commands']['get'](g)['refresh']());}execute(){this['value']=this['_getFormattingAttributes']();}reset(){this['value']=void 0x0;}_getFormattingAttributes(){const _0x72a7bd=this['editor']['model'],_0x47e0cc=_0x72a7bd['document']['selection'];return Object['fromEntries'](Array['from'](_0x47e0cc['getAttributes']())['filter'](([_0xef9e49])=>_0x72a7bd['schema']['getAttributeProperties'](_0xef9e49)['isFormatting']));}},y=class extends _0x295268{constructor(_0x3dbdff){super(_0x3dbdff),this['_removeFormatCommand']=new _0x38317(_0x3dbdff);}execute(_0x105d33={}){const _0x32d3a2=this['editor']['model'],_0x29c3ed=_0x32d3a2['document']['selection'],_0x22fded=Array['from'](_0x29c3ed['getRanges']()),_0xcd87b0=_0x29c3ed['isCollapsed']?[this['_createRangeOnEntireWord'](_0x32d3a2,_0x29c3ed)]:_0x22fded;_0x32d3a2['change'](_0x5ecc94=>{_0x5ecc94['setSelection'](_0xcd87b0),this['_removeFormatCommand']['execute']();for(const _0x236b90 in _0x105d33)for(const _0x342916 of _0x32d3a2['schema']['getValidRanges'](_0xcd87b0,_0x236b90))_0x5ecc94['setAttribute'](_0x236b90,_0x105d33[_0x236b90],_0x342916);_0x5ecc94['setSelection'](_0x22fded);});}_createRangeOnEntireWord(_0x44f2ce,_0x46887c){const _0x5ba2d6=_0x44f2ce['createSelection'](_0x46887c);_0x44f2ce['modifySelection'](_0x5ba2d6,{'unit':'word','direction':'backward'});const _0x200059=_0x5ba2d6['getFirstPosition']();_0x44f2ce['modifySelection'](_0x5ba2d6,{'unit':'word','direction':'forward'});const _0x2135e7=_0x5ba2d6['getLastPosition']();return _0x44f2ce['createRange'](_0x200059,_0x2135e7);}},P=class extends _0x119c38{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5c403d=this['editor'];_0x5c403d['commands']['add'](w,new p(_0x5c403d)),_0x5c403d['commands']['add'](g,new y(_0x5c403d)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x360cec=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x8d9408;for(const _0x53a581 in _0x360cec){const _0x242d69=_0x53a581,_0x3ca474=_0x360cec[_0x242d69];if('formatPainterLicenseKeyValid'==_0x3ca474||'formatPainterLicenseKeyInvalid'==_0x3ca474||'formatPainterLicenseKeyExpired'==_0x3ca474||'formatPainterLicenseKeyDomainLimit'==_0x3ca474||'formatPainterLicenseKeyNotAllowed'==_0x3ca474||'formatPainterLicenseKeyEvaluationLimit'==_0x3ca474||'formatPainterLicenseKeyUsageLimit'==_0x3ca474){delete _0x360cec[_0x242d69],_0x8d9408=_0x3ca474,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0x8d9408&&_0x360cec['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0x8d9408&&_0x360cec['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0x8d9408&&_0x360cec['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0x8d9408&&_0x360cec['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0x8d9408&&_0x360cec['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0x8d9408&&_0x360cec['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x15adf7,_0xaa3bc7){const t=_0x15adf7['t'];switch(_0xaa3bc7){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 _0xaa3bc7;}}const v=/* #__PURE__ -- @preserve */
24
- _0x515d24(_0x119c38);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xd18392=this['editor'];_0xd18392['editing']['view']['addObserver'](_0xe3d589),_0xd18392['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0xd18392['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0xd18392['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0xd18392['ui']['componentFactory']['add']('formatPainter',_0x4f3311=>{const _0x32c4f7=_0x53858a(_0x4f3311,_0x23bfa7),_0x2a9a4d=_0xd18392['commands']['get'](w);_0x32c4f7['buttonView']['set']({'label':L(_0xd18392['locale'],'Paint\x20formatting'),'icon':_0x891c0f,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x32c4f7['class']='ck-format-painter-dropdown',_0x2a9a4d&&(_0x32c4f7['bind']('isEnabled')['to'](_0x2a9a4d,'isEnabled'),this['listenTo'](_0x2a9a4d,'change:isEnabled',(_0x1f1217,_0x9bd729,_0x508f10)=>{_0x508f10||this['_finishPainting']();}),_0x32c4f7['buttonView']['bind']('isOn')['to'](_0x2a9a4d,'value',_0x528337=>!!_0x528337),this['listenTo'](_0xd18392,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x2a9a4d,'change:value',(_0x2d5336,_0x5506a0,_0x3cf61f)=>{this['_toggleSpecialCursor'](!!_0x3cf61f);}));const _0x3dfeb=new _0x40c2b1({'withText':!0x0,'label':L(_0xd18392['locale'],'Continuous\x20painting'),'tooltip':L(_0xd18392['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x4a4e9c(_0x32c4f7,new _0x59fe94([{'type':'switchbutton','model':_0x3dfeb}]),{'role':'menu'});const _0x2457a0=()=>{this['_copyFormatting'](),this['listenTo'](_0x8a075a['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x3dfeb['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x32c4f7,'execute',()=>{_0x3dfeb['isOn']=!_0x3dfeb['isOn'];}),this['listenTo'](_0x32c4f7['buttonView'],'execute',()=>{_0xd18392['editing']['view']['focus'](),_0x32c4f7['buttonView']['isOn']?this['_finishPainting']():_0x2457a0();}),_0xd18392['keystrokes']['set']('Ctrl+Alt+C',(_0x16037c,_0x12a903)=>{_0x2457a0(),_0x3dfeb['isOn']=!0x0,_0x12a903();},{'priority':'high'}),_0xd18392['keystrokes']['set']('Ctrl+Alt+V',(_0x23a021,_0x551aea)=>{_0x32c4f7['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x3dfeb['isOn']||this['_finishPainting'](),_0x551aea());},{'priority':'high'}),_0xd18392['keystrokes']['set']('Esc',(_0x2d61fb,_0x2a16d0)=>{_0x32c4f7['buttonView']['isOn']&&(_0x3dfeb['isOn']=!0x1,this['_finishPainting'](),_0xd18392['ui']['ariaLiveAnnouncer']['announce'](L(_0xd18392['locale'],'Painting\x20cancelled.')),_0x2a16d0());}),_0x32c4f7;});}afterInit(){!async function(_0x5b8f05){const _0x39c331='QiLRCSOsZ8pAvDdaPJUE3oxjKlzM2uXgrtGfeyh5cNFkmBw9I6WH0qnb4T17YV',_0x42ecab=0x79188,_0x549521=window['Date']['now'](),_0x2d23aa=_0x5b8f05['editor'],_0x55eaee=new window['Promise'](_0x3a2ec1=>{_0x2d23aa['once']('ready',_0x3a2ec1);}),_0x585a4a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0xff4366=_0x2d23aa['config']['get']('licenseKey');async function _0x5badda(){let _0x501040,_0x3670ac=null,_0x370e1d=null;try{return'GPL'==_0xff4366?'NotAllowed':(_0x501040=_0x1d0d33(),_0x501040?(_0x501040['usageEndpoint']&&(_0x370e1d=_0x45330a(_0x501040['usageEndpoint'],_0x501040['jti'])),await _0x1934cd()?_0x5e70e7()?_0x108172()?'Expired':_0x74aa9a()?('evaluation'==_0x501040['licenseType']&&(_0x3670ac=_0x1c8f9a('EvaluationLimit')),await _0x3388f3()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x108172(){const _0x2efd68=['evaluation','trial']['includes'](_0x501040['licenseType'])?_0x549521/0x3e8:0xe10*_0x42ecab;return _0x501040['exp']<_0x2efd68;}function _0x5e70e7(){const _0x5b57ad=_0x501040['features'];return!!_0x5b57ad&&(!!_0x5b57ad['includes']('*')||(!!_0x5b57ad['includes']('FP')||(!!_0x5b57ad['includes']('PP')||!(!_0x5b57ad['includes']('TRILIUM')||!_0x311e62()))));}function _0x74aa9a(){const _0x593067=_0x501040['licensedHosts'];if(!_0x593067||0x0==_0x593067['length'])return!0x0;const {hostname:_0x12f8df}=new URL(window['location']['href']);if(_0x593067['includes'](_0x12f8df))return!0x0;const _0x1cb010=_0x12f8df['split']('.');return _0x593067['filter'](_0x2b251b=>_0x2b251b['includes']('*'))['map'](_0x5f53ed=>_0x5f53ed['split']('.'))['filter'](_0x2a9095=>_0x2a9095['length']<=_0x1cb010['length'])['map'](_0x79c7df=>Array(_0x1cb010['length']-_0x79c7df['length'])['fill']('*'===_0x79c7df[0x0]?'*':'')['concat'](_0x79c7df))['some'](_0x4dbfc3=>_0x1cb010['every']((_0x43cf20,_0xa8052e)=>_0x4dbfc3[_0xa8052e]===_0x43cf20||'*'===_0x4dbfc3[_0xa8052e]));}function _0x3388f3(){return _0x3670ac&&_0x370e1d?new window['Promise']((_0x369c42,_0x2eac17)=>{_0x3670ac['then'](_0x369c42,_0x2eac17),_0x370e1d['then'](_0x3fc0e0=>{'Valid'!=_0x3fc0e0&&_0x369c42(_0x3fc0e0);},_0x2eac17);}):_0x3670ac||_0x370e1d||'Valid';}}function _0x45330a(_0x1772e4,_0x1b814f){return new window['Promise'](_0x13af2c=>{if(_0x1709d4())return _0x13af2c('Valid');_0x4e3de1(),_0x2d23aa['decorate']('_sendUsageRequest');let _0x1b965a=!0x1;const _0x1745bf=_0x420099();function _0x3201da(_0x1d850d){return!!_0x1d850d&&('object'==typeof _0x1d850d||'function'==typeof _0x1d850d)&&'function'==typeof _0x1d850d['then']&&'function'==typeof _0x1d850d['catch'];}function _0xf70d74(_0xe6206d){_0x372466(_0xe6206d)['then'](_0x515bbe=>_0x515bbe&&'ok'==_0x515bbe['status']?_0x576ff1(_0x959385(_0x1745bf+_0x1b814f))!=_0x515bbe['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x361983=>(_0x149872(),_0x361983),()=>{const _0x4925b4=_0x5c20d0();return null==_0x4925b4?(_0x149872(),'Valid'):_0x549521-_0x4925b4>0x240c8400?'UsageLimit':'Valid';})['then'](_0x13af2c)['catch'](()=>{_0x13af2c('UsageLimit');});const _0x4afd05=0x36ee80;function _0x149872(){const _0x3c55b0='llct-'+_0x576ff1(_0x959385(_0x1772e4)),_0x271a91=_0x257234(_0x576ff1(window['Math']['ceil'](_0x549521/_0x4afd05)));window['localStorage']['setItem'](_0x3c55b0,_0x271a91);}function _0x5c20d0(){const _0xe97125='llct-'+_0x576ff1(_0x959385(_0x1772e4)),_0xee11d8=window['localStorage']['getItem'](_0xe97125);return _0xee11d8?window['parseInt'](_0x257234(_0xee11d8),0x10)*_0x4afd05:null;}function _0x372466(_0xf02e83){return new window['Promise']((_0x1456c6,_0x2d3ca8)=>{_0xf02e83['then'](_0x1456c6,_0x2d3ca8),window['setTimeout'](_0x2d3ca8,0x1d4c0);});}}_0x2d23aa['on']('_sendUsageRequest',(_0x18af1b,_0x37afa9)=>{if(_0x37afa9[0x0]!=_0x1772e4)return _0x13af2c('UsageLimit');_0x37afa9[0x1]={..._0x37afa9[0x1],'requestId':_0x1745bf};},{'priority':'high'}),_0x2d23aa['on']('_sendUsageRequest',_0x29110d=>{_0x3201da(_0x29110d['return'])&&(_0x1b965a=!0x0,_0xf70d74(_0x29110d['return']));},{'priority':'low'}),_0x55eaee['then'](()=>{_0x1b965a||_0x13af2c('UsageLimit');});});function _0x1709d4(){return'auto'==_0x2d23aa['editing']['view']['_overlayModeHint'];}function _0x4e3de1(){_0x2d23aa['editing']['view']['_overlayModeHint']='auto';}}function _0x1c8f9a(_0x5d1bd8){const _0x3b1e40=[new window['Promise'](_0x23d84c=>setTimeout(_0x23d84c,0x93ecc)),_0x55eaee['then'](()=>new window['Promise'](_0x4f7370=>{let _0x23177=0x0;_0x2d23aa['model']['on']('applyOperation',(_0x52125a,_0x4fa758)=>{_0x4fa758[0x0]['isDocumentOperation']&&_0x23177++,0x5e8==_0x23177&&(_0x4f7370(),_0x52125a['off']());});}))];return window['Promise']['race'](_0x3b1e40)['then'](()=>_0x5d1bd8);}async function _0x39e1a6(){await _0x55eaee,_0x2d23aa['model']['change']=_0x392bd7,_0x2d23aa['model']['enqueueChange']=_0x392bd7,_0x2d23aa['enableReadOnlyMode']('model');}function _0x311e62(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5e4854(_0x3e5726){const _0x48eb89=_0x1c57e3();_0x2d23aa[_0x48eb89]='formatPainterLicenseKey'+_0x3e5726,'Valid'!=_0x3e5726&&_0x39e1a6();}function _0x1c57e3(){const _0x5e5da4=window['String'](window['performance']['now']())['replace']('.','');let _0x48032c='Q';for(let _0x26d3d7=0x0;_0x26d3d7<_0x5e5da4['length'];_0x26d3d7+=0x2){let _0x5d7ef=window['parseInt'](_0x5e5da4['substring'](_0x26d3d7,_0x26d3d7+0x2));_0x5d7ef>=0x3e&&(_0x5d7ef-=0x3e),_0x48032c+=_0x39c331[_0x5d7ef];}return _0x48032c;}function _0x1d0d33(){const _0x1a1fe9=_0xff4366['split']('.');if(0x3!=_0x1a1fe9['length'])return null;return _0xe43033(_0x1a1fe9[0x1]);function _0xe43033(_0x5ed77b){const _0x3f5aeb=_0x29e406(_0x5ed77b);return _0x3f5aeb&&_0x3d7326()?_0x3f5aeb:null;function _0x3d7326(){const _0x88c054=_0x3f5aeb['jti'],_0x26bdb4=window['parseInt'](_0x88c054['substring'](_0x88c054['length']-0x8),0x10),_0x53db42={..._0x3f5aeb,'jti':_0x88c054['substring'](0x0,_0x88c054['length']-0x8)};return delete _0x53db42['vc'],_0x959385(_0x53db42)==_0x26bdb4;}}}async function _0x1934cd(){let _0x27aafc=!0x0;try{const [_0x3f0725,_0x3678fc,_0x30f916]=_0xff4366['split']('.');return _0x4d25d8(_0x3f0725),await _0x36d434(_0x3f0725,_0x3678fc,_0x30f916),_0x27aafc;}catch{return!0x1;}function _0x4d25d8(_0x5959c4){const _0x21e0d2=_0x29e406(_0x5959c4);_0x21e0d2&&'ES256'==_0x21e0d2['alg']||(_0x27aafc=!0x1);}async function _0x36d434(_0x4dbc83,_0x27b449,_0xbc3bc8){const _0x709fe7=window['Uint8Array']['from'](_0x2baa6c(_0xbc3bc8),_0x64ba18=>_0x64ba18['charCodeAt'](0x0)),_0x23ddbf=new window['TextEncoder']()['encode'](_0x4dbc83+'.'+_0x27b449),_0x37a69f=window['crypto']['subtle'];if(!_0x37a69f)return;const _0x51b020=await _0x37a69f['importKey']('jwk',_0x585a4a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x37a69f['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x51b020,_0x709fe7,_0x23ddbf)||(_0x27aafc=!0x1);}}function _0x29e406(_0x4e6a61){return _0x4e6a61['startsWith']('ey')?JSON['parse'](_0x2baa6c(_0x4e6a61)):null;}function _0x2baa6c(_0x413bae){return window['atob'](_0x413bae['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x959385(_0x5d1f72){let _0x19039f=0x1505;function _0x324f4a(_0x13e655){for(let _0x181026=0x0;_0x181026<_0x13e655['length'];_0x181026++){const _0x5e4c13=_0x13e655['charCodeAt'](_0x181026);_0x19039f=(_0x19039f<<0x5)+_0x19039f+_0x5e4c13,_0x19039f&=_0x19039f;}}function _0x472626(_0x1502fc){Array['isArray'](_0x1502fc)?_0x1502fc['forEach'](_0x472626):_0x1502fc&&'object'==typeof _0x1502fc?Object['entries'](_0x1502fc)['sort']()['forEach'](([_0x2872be,_0x158a01])=>{_0x324f4a(_0x2872be),_0x472626(_0x158a01);}):_0x324f4a(window['String'](_0x1502fc));}return _0x472626(_0x5d1f72),_0x19039f>>>0x0;}function _0x576ff1(_0xac0574){return _0xac0574['toString'](0x10)['padStart'](0x8,'0');}function _0x257234(_0x7a267e){return _0x7a267e['split']('')['reverse']()['join']('');}function _0x392bd7(){}_0x5e4854(await _0x5badda());}(this);}_toggleSpecialCursor(_0x27882b){this['editor']['editing']['view']['change'](_0x4a5760=>{for(const _0x32393c of this['editor']['editing']['view']['document']['roots'])_0x27882b?_0x4a5760['addClass'](h,_0x32393c):_0x4a5760['removeClass'](h,_0x32393c);});}_copyFormatting(){const {editor:_0xd51418}=this;_0xd51418['execute'](w),_0xd51418['ui']['ariaLiveAnnouncer']['announce'](L(_0xd51418['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x2b1469}=this,_0x116f5f=_0x2b1469['commands']['get'](w)['value'];_0x2b1469['execute'](g,_0x116f5f),_0x2b1469['ui']['ariaLiveAnnouncer']['announce'](L(_0x2b1469['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x8a075a['window']['document'],'mouseup');}},x=class extends _0x119c38{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 _0x104b64,Plugin as _0x2dc2ca}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x2f75ab}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x35c122,UIModel as _0x51af28,addListToDropdown as _0x5a6a34,createDropdown as _0x2e730a}from'@ckeditor/ckeditor5-ui';import{Collection as _0xcc8855,DomEmitterMixin as _0x28f3ad,global as _0x2be65b,uid as _0xeb07ef}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0x373603}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x598047}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var p=class extends _0x104b64{constructor(_0x1f0051){super(_0x1f0051),this['value']=void 0x0,this['on']('change:isEnabled',(_0xcabbed,_0x3e5b45,_0x4fbbd9)=>{_0x4fbbd9||this['reset']();}),this['on']('change:value',()=>_0x1f0051['commands']['get'](g)['refresh']());}execute(){this['value']=this['_getFormattingAttributes']();}reset(){this['value']=void 0x0;}_getFormattingAttributes(){const _0x20099a=this['editor']['model'],_0x3877ac=_0x20099a['document']['selection'];return Object['fromEntries'](Array['from'](_0x3877ac['getAttributes']())['filter'](([_0x39c064])=>_0x20099a['schema']['getAttributeProperties'](_0x39c064)['isFormatting']));}},y=class extends _0x104b64{constructor(_0x19fc8d){super(_0x19fc8d),this['_removeFormatCommand']=new _0x2f75ab(_0x19fc8d);}execute(_0xaba805={}){const _0x5ec80b=this['editor']['model'],_0x1e5eb2=_0x5ec80b['document']['selection'],_0x144b7f=Array['from'](_0x1e5eb2['getRanges']()),_0x51e391=_0x1e5eb2['isCollapsed']?[this['_createRangeOnEntireWord'](_0x5ec80b,_0x1e5eb2)]:_0x144b7f;_0x5ec80b['change'](_0x2dfeb9=>{_0x2dfeb9['setSelection'](_0x51e391),this['_removeFormatCommand']['execute']();for(const _0x37c659 in _0xaba805)for(const _0x211bd2 of _0x5ec80b['schema']['getValidRanges'](_0x51e391,_0x37c659))_0x2dfeb9['setAttribute'](_0x37c659,_0xaba805[_0x37c659],_0x211bd2);_0x2dfeb9['setSelection'](_0x144b7f);});}_createRangeOnEntireWord(_0x49fc3c,_0x412f5e){const _0x13ec08=_0x49fc3c['createSelection'](_0x412f5e);_0x49fc3c['modifySelection'](_0x13ec08,{'unit':'word','direction':'backward'});const _0x2db6b8=_0x13ec08['getFirstPosition']();_0x49fc3c['modifySelection'](_0x13ec08,{'unit':'word','direction':'forward'});const _0x262783=_0x13ec08['getLastPosition']();return _0x49fc3c['createRange'](_0x2db6b8,_0x262783);}},P=class extends _0x2dc2ca{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xd1933b=this['editor'];_0xd1933b['commands']['add'](w,new p(_0xd1933b)),_0xd1933b['commands']['add'](g,new y(_0xd1933b)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4b3556=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x211453;for(const _0x485148 in _0x4b3556){const _0x1ece6a=_0x485148,_0x33c775=_0x4b3556[_0x1ece6a];if('formatPainterLicenseKeyValid'==_0x33c775||'formatPainterLicenseKeyInvalid'==_0x33c775||'formatPainterLicenseKeyExpired'==_0x33c775||'formatPainterLicenseKeyDomainLimit'==_0x33c775||'formatPainterLicenseKeyNotAllowed'==_0x33c775||'formatPainterLicenseKeyEvaluationLimit'==_0x33c775||'formatPainterLicenseKeyUsageLimit'==_0x33c775){delete _0x4b3556[_0x1ece6a],_0x211453=_0x33c775,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0x211453&&_0x4b3556['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0x211453&&_0x4b3556['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0x211453&&_0x4b3556['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0x211453&&_0x4b3556['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0x211453&&_0x4b3556['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0x211453&&_0x4b3556['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x317eb9,_0x526f0f){const t=_0x317eb9['t'];switch(_0x526f0f){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 _0x526f0f;}}const v=/* #__PURE__ -- @preserve */
24
+ _0x28f3ad(_0x2dc2ca);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x4f98a5=this['editor'];_0x4f98a5['editing']['view']['addObserver'](_0x373603),_0x4f98a5['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0x4f98a5['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0x4f98a5['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0x4f98a5['ui']['componentFactory']['add']('formatPainter',_0x2857e8=>{const _0x2a8aa8=_0x2e730a(_0x2857e8,_0x35c122),_0xeca205=_0x4f98a5['commands']['get'](w);_0x2a8aa8['buttonView']['set']({'label':L(_0x4f98a5['locale'],'Paint\x20formatting'),'icon':_0x598047,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x2a8aa8['class']='ck-format-painter-dropdown',_0xeca205&&(_0x2a8aa8['bind']('isEnabled')['to'](_0xeca205,'isEnabled'),this['listenTo'](_0xeca205,'change:isEnabled',(_0x3bfe13,_0x6e7dfd,_0x5bb63c)=>{_0x5bb63c||this['_finishPainting']();}),_0x2a8aa8['buttonView']['bind']('isOn')['to'](_0xeca205,'value',_0x5be954=>!!_0x5be954),this['listenTo'](_0x4f98a5,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0xeca205,'change:value',(_0x3f3b44,_0x9ad406,_0x2a0548)=>{this['_toggleSpecialCursor'](!!_0x2a0548);}));const _0x4ee85e=new _0x51af28({'withText':!0x0,'label':L(_0x4f98a5['locale'],'Continuous\x20painting'),'tooltip':L(_0x4f98a5['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x5a6a34(_0x2a8aa8,new _0xcc8855([{'type':'switchbutton','model':_0x4ee85e}]),{'role':'menu'});const _0x31e6fd=()=>{this['_copyFormatting'](),this['listenTo'](_0x2be65b['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x4ee85e['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x2a8aa8,'execute',()=>{_0x4ee85e['isOn']=!_0x4ee85e['isOn'];}),this['listenTo'](_0x2a8aa8['buttonView'],'execute',()=>{_0x4f98a5['editing']['view']['focus'](),_0x2a8aa8['buttonView']['isOn']?this['_finishPainting']():_0x31e6fd();}),_0x4f98a5['keystrokes']['set']('Ctrl+Alt+C',(_0x303575,_0x4f43d3)=>{_0x31e6fd(),_0x4ee85e['isOn']=!0x0,_0x4f43d3();},{'priority':'high'}),_0x4f98a5['keystrokes']['set']('Ctrl+Alt+V',(_0x48cdcc,_0x53b8c0)=>{_0x2a8aa8['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x4ee85e['isOn']||this['_finishPainting'](),_0x53b8c0());},{'priority':'high'}),_0x4f98a5['keystrokes']['set']('Esc',(_0x357672,_0x536bfb)=>{_0x2a8aa8['buttonView']['isOn']&&(_0x4ee85e['isOn']=!0x1,this['_finishPainting'](),_0x4f98a5['ui']['ariaLiveAnnouncer']['announce'](L(_0x4f98a5['locale'],'Painting\x20cancelled.')),_0x536bfb());}),_0x2a8aa8;});}afterInit(){!async function(_0x5188aa){const _0x25844e='QiLRCSOsZ8pAvDdaPJUE3oxjKlzM2uXgrtGfeyh5cNFkmBw9I6WH0qnb4T17YV',_0x467752=0x791a0,_0x42d30b=window['Date']['now'](),_0x31e0d7=_0x5188aa['editor'],_0x1c3604=new window['Promise'](_0x3795d3=>{_0x31e0d7['once']('ready',_0x3795d3);}),_0x56f590={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x34cd61=_0x31e0d7['config']['get']('licenseKey');async function _0x3813eb(){let _0xacac69,_0x5e892d=null,_0x374621=null;try{return'GPL'==_0x34cd61?'NotAllowed':(_0xacac69=_0x1a3f29(),_0xacac69?(_0xacac69['usageEndpoint']&&(_0x374621=_0x3cd481(_0xacac69['usageEndpoint'],_0xacac69['jti'])),await _0x29e1d0()?_0xd7cdb7()?_0x4430d9()?'Expired':_0x5ef46f()?('evaluation'==_0xacac69['licenseType']&&(_0x5e892d=_0x4d6558('EvaluationLimit')),await _0xc3044b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x4430d9(){const _0x4eadbe=['evaluation','trial']['includes'](_0xacac69['licenseType'])?_0x42d30b/0x3e8:0xe10*_0x467752;return _0xacac69['exp']<_0x4eadbe;}function _0xd7cdb7(){const _0xf6eadc=_0xacac69['features'];return!!_0xf6eadc&&(!!_0xf6eadc['includes']('*')||(!!_0xf6eadc['includes']('FP')||(!!_0xf6eadc['includes']('PP')||!(!_0xf6eadc['includes']('TRILIUM')||!_0x33ca9f()))));}function _0x5ef46f(){const _0x5299a7=_0xacac69['licensedHosts'];if(!_0x5299a7||0x0==_0x5299a7['length'])return!0x0;const {hostname:_0x546b0e}=new URL(window['location']['href']);if(_0x5299a7['includes'](_0x546b0e))return!0x0;const _0x375f36=_0x546b0e['split']('.');return _0x5299a7['filter'](_0x5e5ecb=>_0x5e5ecb['includes']('*'))['map'](_0x3d3c8c=>_0x3d3c8c['split']('.'))['filter'](_0x33f2d6=>_0x33f2d6['length']<=_0x375f36['length'])['map'](_0x414132=>Array(_0x375f36['length']-_0x414132['length'])['fill']('*'===_0x414132[0x0]?'*':'')['concat'](_0x414132))['some'](_0xe4b0b1=>_0x375f36['every']((_0x3c3600,_0x257c10)=>_0xe4b0b1[_0x257c10]===_0x3c3600||'*'===_0xe4b0b1[_0x257c10]));}function _0xc3044b(){return _0x5e892d&&_0x374621?new window['Promise']((_0x205c15,_0x354403)=>{_0x5e892d['then'](_0x205c15,_0x354403),_0x374621['then'](_0x4f82c4=>{'Valid'!=_0x4f82c4&&_0x205c15(_0x4f82c4);},_0x354403);}):_0x5e892d||_0x374621||'Valid';}}function _0x3cd481(_0x3a477c,_0x5c9b6b){return new window['Promise'](_0x5578d6=>{if(_0x1fd6b1())return _0x5578d6('Valid');_0x4af637(),_0x31e0d7['decorate']('_sendUsageRequest');let _0x2d659d=!0x1;const _0x27fc62=_0xeb07ef();function _0x1d87ba(_0x256ac6){return!!_0x256ac6&&('object'==typeof _0x256ac6||'function'==typeof _0x256ac6)&&'function'==typeof _0x256ac6['then']&&'function'==typeof _0x256ac6['catch'];}function _0x14ff10(_0x1523cd){_0x804100(_0x1523cd)['then'](_0x5c05f3=>_0x5c05f3&&'ok'==_0x5c05f3['status']?_0x161020(_0x436b7c(_0x27fc62+_0x5c9b6b))!=_0x5c05f3['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3eabf2=>(_0x157060(),_0x3eabf2),()=>{const _0x51f1ee=_0x4d3544();return null==_0x51f1ee?(_0x157060(),'Valid'):_0x42d30b-_0x51f1ee>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5578d6)['catch'](()=>{_0x5578d6('UsageLimit');});const _0x19d132=0x36ee80;function _0x157060(){const _0x2e48af='llct-'+_0x161020(_0x436b7c(_0x3a477c)),_0x23f6f3=_0x5e92d2(_0x161020(window['Math']['ceil'](_0x42d30b/_0x19d132)));window['localStorage']['setItem'](_0x2e48af,_0x23f6f3);}function _0x4d3544(){const _0x210292='llct-'+_0x161020(_0x436b7c(_0x3a477c)),_0x53efec=window['localStorage']['getItem'](_0x210292);return _0x53efec?window['parseInt'](_0x5e92d2(_0x53efec),0x10)*_0x19d132:null;}function _0x804100(_0x59701f){return new window['Promise']((_0x46e015,_0x38ba0a)=>{_0x59701f['then'](_0x46e015,_0x38ba0a),window['setTimeout'](_0x38ba0a,0x1d4c0);});}}_0x31e0d7['on']('_sendUsageRequest',(_0x3759fa,_0x318b5b)=>{if(_0x318b5b[0x0]!=_0x3a477c)return _0x5578d6('UsageLimit');_0x318b5b[0x1]={..._0x318b5b[0x1],'requestId':_0x27fc62};},{'priority':'high'}),_0x31e0d7['on']('_sendUsageRequest',_0x53cb2b=>{_0x1d87ba(_0x53cb2b['return'])&&(_0x2d659d=!0x0,_0x14ff10(_0x53cb2b['return']));},{'priority':'low'}),_0x1c3604['then'](()=>{_0x2d659d||_0x5578d6('UsageLimit');});});function _0x1fd6b1(){return'auto'==_0x31e0d7['editing']['view']['_overlayModeHint'];}function _0x4af637(){_0x31e0d7['editing']['view']['_overlayModeHint']='auto';}}function _0x4d6558(_0x68f47c){const _0x750d43=[new window['Promise'](_0x4b66c4=>setTimeout(_0x4b66c4,0x93ecc)),_0x1c3604['then'](()=>new window['Promise'](_0x414be5=>{let _0x5178db=0x0;_0x31e0d7['model']['on']('applyOperation',(_0x5210ac,_0x7524d4)=>{_0x7524d4[0x0]['isDocumentOperation']&&_0x5178db++,0x5e8==_0x5178db&&(_0x414be5(),_0x5210ac['off']());});}))];return window['Promise']['race'](_0x750d43)['then'](()=>_0x68f47c);}async function _0x37c335(){await _0x1c3604,_0x31e0d7['model']['change']=_0x10db45,_0x31e0d7['model']['enqueueChange']=_0x10db45,_0x31e0d7['enableReadOnlyMode']('model');}function _0x33ca9f(){return window['glob']&&window['glob']['triliumVersion'];}function _0x4f5743(_0x144bd7){const _0xb9069f=_0x3ad9a();_0x31e0d7[_0xb9069f]='formatPainterLicenseKey'+_0x144bd7,'Valid'!=_0x144bd7&&_0x37c335();}function _0x3ad9a(){const _0x4e7460=window['String'](window['performance']['now']())['replace']('.','');let _0x2bb231='Q';for(let _0xd7625f=0x0;_0xd7625f<_0x4e7460['length'];_0xd7625f+=0x2){let _0x3ecfa3=window['parseInt'](_0x4e7460['substring'](_0xd7625f,_0xd7625f+0x2));_0x3ecfa3>=0x3e&&(_0x3ecfa3-=0x3e),_0x2bb231+=_0x25844e[_0x3ecfa3];}return _0x2bb231;}function _0x1a3f29(){const _0x3237bc=_0x34cd61['split']('.');if(0x3!=_0x3237bc['length'])return null;return _0x204d6b(_0x3237bc[0x1]);function _0x204d6b(_0x5e2f37){const _0x22f733=_0x39cedc(_0x5e2f37);return _0x22f733&&_0xf7940c()?_0x22f733:null;function _0xf7940c(){const _0xba82e=_0x22f733['jti'],_0x122e66=window['parseInt'](_0xba82e['substring'](_0xba82e['length']-0x8),0x10),_0x1826b8={..._0x22f733,'jti':_0xba82e['substring'](0x0,_0xba82e['length']-0x8)};return delete _0x1826b8['vc'],_0x436b7c(_0x1826b8)==_0x122e66;}}}async function _0x29e1d0(){let _0x7cfe1d=!0x0;try{const [_0x186176,_0x338b07,_0x50b919]=_0x34cd61['split']('.');return _0x491267(_0x186176),await _0x43aa9b(_0x186176,_0x338b07,_0x50b919),_0x7cfe1d;}catch{return!0x1;}function _0x491267(_0x1a54c2){const _0x4ec9d3=_0x39cedc(_0x1a54c2);_0x4ec9d3&&'ES256'==_0x4ec9d3['alg']||(_0x7cfe1d=!0x1);}async function _0x43aa9b(_0x58d440,_0x3f1803,_0x335471){const _0x23150b=window['Uint8Array']['from'](_0x1ddcf6(_0x335471),_0x329fa2=>_0x329fa2['charCodeAt'](0x0)),_0x4d691d=new window['TextEncoder']()['encode'](_0x58d440+'.'+_0x3f1803),_0x506cc8=window['crypto']['subtle'];if(!_0x506cc8)return;const _0x340a92=await _0x506cc8['importKey']('jwk',_0x56f590,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x506cc8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x340a92,_0x23150b,_0x4d691d)||(_0x7cfe1d=!0x1);}}function _0x39cedc(_0x117314){return _0x117314['startsWith']('ey')?JSON['parse'](_0x1ddcf6(_0x117314)):null;}function _0x1ddcf6(_0x4a669c){return window['atob'](_0x4a669c['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x436b7c(_0x4f8b00){let _0x1d9587=0x1505;function _0x141ebf(_0x256b21){for(let _0xd1252b=0x0;_0xd1252b<_0x256b21['length'];_0xd1252b++){const _0x54bc10=_0x256b21['charCodeAt'](_0xd1252b);_0x1d9587=(_0x1d9587<<0x5)+_0x1d9587+_0x54bc10,_0x1d9587&=_0x1d9587;}}function _0x1160c7(_0x550f1e){Array['isArray'](_0x550f1e)?_0x550f1e['forEach'](_0x1160c7):_0x550f1e&&'object'==typeof _0x550f1e?Object['entries'](_0x550f1e)['sort']()['forEach'](([_0x1a7ad2,_0xf704a])=>{_0x141ebf(_0x1a7ad2),_0x1160c7(_0xf704a);}):_0x141ebf(window['String'](_0x550f1e));}return _0x1160c7(_0x4f8b00),_0x1d9587>>>0x0;}function _0x161020(_0xae47c5){return _0xae47c5['toString'](0x10)['padStart'](0x8,'0');}function _0x5e92d2(_0x422d5c){return _0x422d5c['split']('')['reverse']()['join']('');}function _0x10db45(){}_0x4f5743(await _0x3813eb());}(this);}_toggleSpecialCursor(_0x2d9d74){this['editor']['editing']['view']['change'](_0x5be5ff=>{for(const _0x431d07 of this['editor']['editing']['view']['document']['roots'])_0x2d9d74?_0x5be5ff['addClass'](h,_0x431d07):_0x5be5ff['removeClass'](h,_0x431d07);});}_copyFormatting(){const {editor:_0x34395e}=this;_0x34395e['execute'](w),_0x34395e['ui']['ariaLiveAnnouncer']['announce'](L(_0x34395e['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x59bdb2}=this,_0x2a9de3=_0x59bdb2['commands']['get'](w)['value'];_0x59bdb2['execute'](g,_0x2a9de3),_0x59bdb2['ui']['ariaLiveAnnouncer']['announce'](L(_0x59bdb2['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x2be65b['window']['document'],'mouseup');}},x=class extends _0x2dc2ca{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.4.0-alpha.4",
3
+ "version": "48.4.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.4.0-alpha.4",
25
- "@ckeditor/ckeditor5-engine": "48.4.0-alpha.4",
26
- "@ckeditor/ckeditor5-icons": "48.4.0-alpha.4",
27
- "@ckeditor/ckeditor5-remove-format": "48.4.0-alpha.4",
28
- "@ckeditor/ckeditor5-ui": "48.4.0-alpha.4",
29
- "@ckeditor/ckeditor5-utils": "48.4.0-alpha.4"
24
+ "@ckeditor/ckeditor5-core": "48.4.0-alpha.5",
25
+ "@ckeditor/ckeditor5-engine": "48.4.0-alpha.5",
26
+ "@ckeditor/ckeditor5-icons": "48.4.0-alpha.5",
27
+ "@ckeditor/ckeditor5-remove-format": "48.4.0-alpha.5",
28
+ "@ckeditor/ckeditor5-ui": "48.4.0-alpha.5",
29
+ "@ckeditor/ckeditor5-utils": "48.4.0-alpha.5"
30
30
  },
31
31
  "files": [
32
32
  "dist",