@ckeditor/ckeditor5-format-painter 48.5.0-alpha.3 → 48.5.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.
- 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
|
-
_0x1006c7(_0x386092);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xfd8c73=this['editor'];_0xfd8c73['editing']['view']['addObserver'](_0x138d46),_0xfd8c73['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0xfd8c73['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0xfd8c73['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0xfd8c73['ui']['componentFactory']['add']('formatPainter',_0x4b7445=>{const _0x38fa79=_0x5f5ac4(_0x4b7445,_0x472b59),_0x202dda=_0xfd8c73['commands']['get'](w);_0x38fa79['buttonView']['set']({'label':L(_0xfd8c73['locale'],'Paint\x20formatting'),'icon':_0x229f41,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x38fa79['class']='ck-format-painter-dropdown',_0x202dda&&(_0x38fa79['bind']('isEnabled')['to'](_0x202dda,'isEnabled'),this['listenTo'](_0x202dda,'change:isEnabled',(_0x492673,_0x95b24c,_0x1a815d)=>{_0x1a815d||this['_finishPainting']();}),_0x38fa79['buttonView']['bind']('isOn')['to'](_0x202dda,'value',_0x40c842=>!!_0x40c842),this['listenTo'](_0xfd8c73,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x202dda,'change:value',(_0x2d2066,_0x4c0dc9,_0x962458)=>{this['_toggleSpecialCursor'](!!_0x962458);}));const _0x3541eb=new _0x496958({'withText':!0x0,'label':L(_0xfd8c73['locale'],'Continuous\x20painting'),'tooltip':L(_0xfd8c73['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x2105d8(_0x38fa79,new _0x1c819f([{'type':'switchbutton','model':_0x3541eb}]),{'role':'menu'});const _0x30e5b6=()=>{this['_copyFormatting'](),this['listenTo'](_0x1ad09b['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x3541eb['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x38fa79,'execute',()=>{_0x3541eb['isOn']=!_0x3541eb['isOn'];}),this['listenTo'](_0x38fa79['buttonView'],'execute',()=>{_0xfd8c73['editing']['view']['focus'](),_0x38fa79['buttonView']['isOn']?this['_finishPainting']():_0x30e5b6();}),_0xfd8c73['keystrokes']['set']('Ctrl+Alt+C',(_0x28fe01,_0x46d4e2)=>{_0x30e5b6(),_0x3541eb['isOn']=!0x0,_0x46d4e2();},{'priority':'high'}),_0xfd8c73['keystrokes']['set']('Ctrl+Alt+V',(_0x3d8581,_0x4a2aea)=>{_0x38fa79['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x3541eb['isOn']||this['_finishPainting'](),_0x4a2aea());},{'priority':'high'}),_0xfd8c73['keystrokes']['set']('Esc',(_0x5210c1,_0xd535fe)=>{_0x38fa79['buttonView']['isOn']&&(_0x3541eb['isOn']=!0x1,this['_finishPainting'](),_0xfd8c73['ui']['ariaLiveAnnouncer']['announce'](L(_0xfd8c73['locale'],'Painting\x20cancelled.')),_0xd535fe());}),_0x38fa79;});}afterInit(){!async function(_0x467c13){const _0x3c860f='un0NFQUoX1evzk3yMEfwl7TxbDrisOZaWtKq52P98dchBVpjS4mYLC6gJIHGRA',_0x5f8cad=0x79410,_0x550d7a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x591ed1(_0x598290){const _0xb43df6=new window['Promise'](_0x2bebb0=>{_0x598290['once']('ready',_0x2bebb0);}),_0x424883=window['Date']['now'](),_0x320f15=_0x598290['config']['get']('licenseKey');async function _0x2eb3b1(){let _0x55903e,_0x3a1a2a=null,_0x4b1ebb=null;try{return'GPL'==_0x320f15?'NotAllowed':(_0x55903e=_0x4c3bba(),_0x55903e?(_0x55903e['usageEndpoint']&&(_0x4b1ebb=_0x34563e(_0x55903e['usageEndpoint'],_0x55903e['jti'])),await _0x52ef1d()?_0xbfa78d()?_0x31e90b()?'Expired':_0x354883()?('evaluation'==_0x55903e['licenseType']&&(_0x3a1a2a=_0x3a3777('EvaluationLimit')),await _0x25e54c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x31e90b(){const _0x1065bb=['evaluation','trial']['includes'](_0x55903e['licenseType'])?_0x424883/0x3e8:0xe10*_0x5f8cad;return _0x55903e['exp']<_0x1065bb;}function _0xbfa78d(){const _0x1a2dc9=_0x55903e['features'];return!!_0x1a2dc9&&(!!_0x1a2dc9['includes']('*')||(!!_0x1a2dc9['includes']('FP')||(!!_0x1a2dc9['includes']('PP')||!(!_0x1a2dc9['includes']('TRILIUM')||!_0x3ddd89()))));}function _0x354883(){const _0x4689e3=_0x55903e['licensedHosts'];if(!_0x4689e3||0x0==_0x4689e3['length'])return!0x0;const {hostname:_0x46c626}=new URL(window['location']['href']);if(_0x4689e3['includes'](_0x46c626))return!0x0;const _0xf92749=_0x46c626['split']('.');return _0x4689e3['filter'](_0x380e11=>_0x380e11['includes']('*'))['map'](_0x34fb9a=>_0x34fb9a['split']('.'))['filter'](_0x13192b=>_0x13192b['length']<=_0xf92749['length'])['map'](_0x1ca15a=>Array(_0xf92749['length']-_0x1ca15a['length'])['fill']('*'===_0x1ca15a[0x0]?'*':'')['concat'](_0x1ca15a))['some'](_0xa5f776=>_0xf92749['every']((_0x5b14f9,_0x1e6545)=>_0xa5f776[_0x1e6545]===_0x5b14f9||'*'===_0xa5f776[_0x1e6545]));}function _0x25e54c(){return _0x3a1a2a&&_0x4b1ebb?new window['Promise']((_0x153708,_0x570a75)=>{_0x3a1a2a['then'](_0x153708,_0x570a75),_0x4b1ebb['then'](_0x55cd74=>{'Valid'!=_0x55cd74&&_0x153708(_0x55cd74);},_0x570a75);}):_0x3a1a2a||_0x4b1ebb||'Valid';}}function _0x34563e(_0x3736f8,_0x2bf464){return new window['Promise'](_0x38bde1=>{if(_0x2006fd())return _0x38bde1('Valid');_0x2da0fb(),_0x598290['decorate']('_sendUsageRequest');let _0x50f891=!0x1;const _0x28ee6c=_0x5ade59();function _0x28f179(_0x4561a3){return!!_0x4561a3&&('object'==typeof _0x4561a3||'function'==typeof _0x4561a3)&&'function'==typeof _0x4561a3['then']&&'function'==typeof _0x4561a3['catch'];}function _0x5f4b02(_0x3b458e){_0x4c9d90(_0x3b458e)['then'](_0x122c7c=>_0x122c7c&&'ok'==_0x122c7c['status']?_0x3fb993(_0x5106f9(_0x28ee6c+_0x2bf464))!=_0x122c7c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x39bf87=>(_0x21bb0c(),_0x39bf87),()=>{const _0x37fea0=_0x2a0533();return null==_0x37fea0?(_0x21bb0c(),'Valid'):_0x424883-_0x37fea0>0x240c8400?'UsageLimit':'Valid';})['then'](_0x38bde1)['catch'](()=>{_0x38bde1('UsageLimit');});const _0x29c945=0x36ee80;function _0x21bb0c(){const _0x29b827='llct-'+_0x3fb993(_0x5106f9(_0x3736f8)),_0x1a89d0=_0x2cd339(_0x3fb993(window['Math']['ceil'](_0x424883/_0x29c945)));window['localStorage']['setItem'](_0x29b827,_0x1a89d0);}function _0x2a0533(){const _0x2f910f='llct-'+_0x3fb993(_0x5106f9(_0x3736f8)),_0xfff36b=window['localStorage']['getItem'](_0x2f910f);return _0xfff36b?window['parseInt'](_0x2cd339(_0xfff36b),0x10)*_0x29c945:null;}function _0x4c9d90(_0x2d8ace){return new window['Promise']((_0x4b2803,_0x1a021f)=>{_0x2d8ace['then'](_0x4b2803,_0x1a021f),window['setTimeout'](_0x1a021f,0x1d4c0);});}}_0x598290['on']('_sendUsageRequest',(_0x3c80eb,_0x4d3c3c)=>{if(_0x4d3c3c[0x0]!=_0x3736f8)return _0x38bde1('UsageLimit');_0x4d3c3c[0x1]={..._0x4d3c3c[0x1],'requestId':_0x28ee6c};},{'priority':'high'}),_0x598290['on']('_sendUsageRequest',_0x1c8826=>{_0x28f179(_0x1c8826['return'])&&(_0x50f891=!0x0,_0x5f4b02(_0x1c8826['return']));},{'priority':'low'}),_0xb43df6['then'](()=>{_0x50f891||_0x38bde1('UsageLimit');});});function _0x2006fd(){return'auto'==_0x598290['editing']['view']['_overlayModeHint'];}function _0x2da0fb(){_0x598290['editing']['view']['_overlayModeHint']='auto';}}function _0x3a3777(_0x1a308c){const _0x91b5fb=[new window['Promise'](_0x187ad4=>setTimeout(_0x187ad4,0x93ecc)),_0xb43df6['then'](()=>new window['Promise'](_0x1a36d2=>{let _0x6be1b2=0x0;_0x598290['model']['on']('applyOperation',(_0x1eaef2,_0x14308c)=>{_0x14308c[0x0]['isDocumentOperation']&&_0x6be1b2++,0x5e8==_0x6be1b2&&(_0x1a36d2(),_0x1eaef2['off']());});}))];return window['Promise']['race'](_0x91b5fb)['then'](()=>_0x1a308c);}async function _0x31b805(){await _0xb43df6,_0x598290['model']['change']=_0x1efd6c,_0x598290['model']['enqueueChange']=_0x1efd6c,_0x598290['enableReadOnlyMode']('model');}function _0x3ddd89(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5a95ac(_0x268394){const _0x32dba1=_0x2a3172();_0x598290[_0x32dba1]='formatPainterLicenseKey'+_0x268394,'Valid'!=_0x268394&&_0x31b805();}function _0x2a3172(){const _0x3fa88e=window['String'](window['performance']['now']())['replace']('.','');let _0x2bfb8a='u';for(let _0x3231a5=0x0;_0x3231a5<_0x3fa88e['length'];_0x3231a5+=0x2){let _0x3067da=window['parseInt'](_0x3fa88e['substring'](_0x3231a5,_0x3231a5+0x2));_0x3067da>=0x3e&&(_0x3067da-=0x3e),_0x2bfb8a+=_0x3c860f[_0x3067da];}return _0x2bfb8a;}function _0x4c3bba(){const _0x3bb013=_0x320f15['split']('.');if(0x3!=_0x3bb013['length'])return null;return _0x37197e(_0x3bb013[0x1]);function _0x37197e(_0x7a68b8){const _0x2b17be=_0x38cfb8(_0x7a68b8);return _0x2b17be&&_0x2c6154()?_0x2b17be:null;function _0x2c6154(){const _0x5ce3dd=_0x2b17be['jti'],_0x5d0dc4=window['parseInt'](_0x5ce3dd['substring'](_0x5ce3dd['length']-0x8),0x10),_0x4d0194={..._0x2b17be,'jti':_0x5ce3dd['substring'](0x0,_0x5ce3dd['length']-0x8)};return delete _0x4d0194['vc'],_0x5106f9(_0x4d0194)==_0x5d0dc4;}}}async function _0x52ef1d(){let _0x56283d=!0x0;try{const [_0x5c262a,_0x36f14d,_0x22a88f]=_0x320f15['split']('.');return _0x569890(_0x5c262a),await _0x5efe01(_0x5c262a,_0x36f14d,_0x22a88f),_0x56283d;}catch{return!0x1;}function _0x569890(_0x216931){const _0x3dd6e6=_0x38cfb8(_0x216931);_0x3dd6e6&&'ES256'==_0x3dd6e6['alg']||(_0x56283d=!0x1);}async function _0x5efe01(_0x32806b,_0x58287a,_0x50fd7b){const _0x52ff05=window['Uint8Array']['from'](_0x185a66(_0x50fd7b),_0x43de2e=>_0x43de2e['charCodeAt'](0x0)),_0x1e477a=new window['TextEncoder']()['encode'](_0x32806b+'.'+_0x58287a),_0x550b1a=window['crypto']['subtle'];if(!_0x550b1a)return;const _0x535a95=await _0x550b1a['importKey']('jwk',_0x550d7a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x550b1a['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x535a95,_0x52ff05,_0x1e477a)||(_0x56283d=!0x1);}}function _0x38cfb8(_0x26ec77){return _0x26ec77['startsWith']('ey')?JSON['parse'](_0x185a66(_0x26ec77)):null;}function _0x185a66(_0x28a71f){return window['atob'](_0x28a71f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5106f9(_0x2d61b1){let _0xf37b3d=0x1505;function _0x4616cf(_0x3e158a){for(let _0x582cc1=0x0;_0x582cc1<_0x3e158a['length'];_0x582cc1++){const _0x4cab87=_0x3e158a['charCodeAt'](_0x582cc1);_0xf37b3d=(_0xf37b3d<<0x5)+_0xf37b3d+_0x4cab87,_0xf37b3d&=_0xf37b3d;}}function _0x53f4a0(_0x17080f){Array['isArray'](_0x17080f)?_0x17080f['forEach'](_0x53f4a0):_0x17080f&&'object'==typeof _0x17080f?Object['entries'](_0x17080f)['sort']()['forEach'](([_0x33daaf,_0x5ed7d1])=>{_0x4616cf(_0x33daaf),_0x53f4a0(_0x5ed7d1);}):_0x4616cf(window['String'](_0x17080f));}return _0x53f4a0(_0x2d61b1),_0xf37b3d>>>0x0;}function _0x3fb993(_0x2a62f9){return _0x2a62f9['toString'](0x10)['padStart'](0x8,'0');}function _0x2cd339(_0x3a06c5){return _0x3a06c5['split']('')['reverse']()['join']('');}function _0x1efd6c(){}_0x5a95ac(await _0x2eb3b1());}_0x591ed1(_0x467c13['editor']);}(this);}_toggleSpecialCursor(_0x395f51){this['editor']['editing']['view']['change'](_0x4cc971=>{for(const _0x4611d0 of this['editor']['editing']['view']['document']['roots'])_0x395f51?_0x4cc971['addClass'](h,_0x4611d0):_0x4cc971['removeClass'](h,_0x4611d0);});}_copyFormatting(){const {editor:_0x43b812}=this;_0x43b812['execute'](w),_0x43b812['ui']['ariaLiveAnnouncer']['announce'](L(_0x43b812['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x706fe5}=this,_0x465937=_0x706fe5['commands']['get'](w)['value'];_0x706fe5['execute'](g,_0x465937),_0x706fe5['ui']['ariaLiveAnnouncer']['announce'](L(_0x706fe5['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x1ad09b['window']['document'],'mouseup');}},x=class extends _0x386092{static get requires(){return[P,k];}static get['pluginName'](){return'FormatPainter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{y as CopyFormatCommand,x as FormatPainter,P as FormatPainterEditing,k as FormatPainterUI,p as PasteFormatCommand};
|
|
23
|
+
import{Command as _0x16a113,Plugin as _0xec8b73}from'@ckeditor/ckeditor5-core';import{RemoveFormatCommand as _0x1b8e09}from'@ckeditor/ckeditor5-remove-format';import{SplitButtonView as _0x5cde4c,UIModel as _0x1b253a,addListToDropdown as _0x5824c1,createDropdown as _0x22f27a}from'@ckeditor/ckeditor5-ui';import{Collection as _0x48744e,DomEmitterMixin as _0x1b575b,global as _0x258616,uid as _0x1057c5}from'@ckeditor/ckeditor5-utils';import{ClickObserver as _0x4ed0ce}from'@ckeditor/ckeditor5-engine';import{IconPaintRoller as _0x4cc0b7}from'@ckeditor/ckeditor5-icons';const w='copyFormat',g='pasteFormat',h='ck-format-painter-active';var y=class extends _0x16a113{constructor(_0x5ba964){super(_0x5ba964),this['value']=void 0x0,this['on']('change:isEnabled',(_0xef98fb,_0x39a4bb,_0x52bd4e)=>{_0x52bd4e||this['reset']();}),this['on']('change:value',()=>_0x5ba964['commands']['get'](g)['refresh']());}execute(){this['value']=this['_getFormattingAttributes']();}reset(){this['value']=void 0x0;}_getFormattingAttributes(){const _0x59250f=this['editor']['model'],_0x46da99=_0x59250f['document']['selection'];return Object['fromEntries'](Array['from'](_0x46da99['getAttributes']())['filter'](([_0xaec84f])=>_0x59250f['schema']['getAttributeProperties'](_0xaec84f)['isFormatting']));}},p=class extends _0x16a113{constructor(_0x1f0cba){super(_0x1f0cba),this['_removeFormatCommand']=new _0x1b8e09(_0x1f0cba);}execute(_0x187fbe={}){const _0x416c64=this['editor']['model'],_0x2c2521=_0x416c64['document']['selection'],_0x2d3522=Array['from'](_0x2c2521['getRanges']()),_0x36ee96=_0x2c2521['isCollapsed']?[this['_createRangeOnEntireWord'](_0x416c64,_0x2c2521)]:_0x2d3522;_0x416c64['change'](_0x4ab115=>{_0x4ab115['setSelection'](_0x36ee96),this['_removeFormatCommand']['execute']();for(const _0x2f5cfa in _0x187fbe)for(const _0x8ca604 of _0x416c64['schema']['getValidRanges'](_0x36ee96,_0x2f5cfa))_0x4ab115['setAttribute'](_0x2f5cfa,_0x187fbe[_0x2f5cfa],_0x8ca604);_0x4ab115['setSelection'](_0x2d3522);});}_createRangeOnEntireWord(_0x521ce9,_0x65da84){const _0xba3ab6=_0x521ce9['createSelection'](_0x65da84);_0x521ce9['modifySelection'](_0xba3ab6,{'unit':'word','direction':'backward'});const _0x32b7b2=_0xba3ab6['getFirstPosition']();_0x521ce9['modifySelection'](_0xba3ab6,{'unit':'word','direction':'forward'});const _0x5c84e0=_0xba3ab6['getLastPosition']();return _0x521ce9['createRange'](_0x32b7b2,_0x5c84e0);}},P=class extends _0xec8b73{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'FormatPainterEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x3f1177=this['editor'];_0x3f1177['commands']['add'](w,new y(_0x3f1177)),_0x3f1177['commands']['add'](g,new p(_0x3f1177)),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x136354=[this['editor']];for(const _0x215a90 of _0x136354){let _0x27efb4;for(const _0x32e9f0 in _0x215a90){const _0x4bf768=_0x32e9f0,_0x121463=_0x215a90[_0x4bf768];if('formatPainterLicenseKeyValid'==_0x121463||'formatPainterLicenseKeyInvalid'==_0x121463||'formatPainterLicenseKeyExpired'==_0x121463||'formatPainterLicenseKeyDomainLimit'==_0x121463||'formatPainterLicenseKeyNotAllowed'==_0x121463||'formatPainterLicenseKeyEvaluationLimit'==_0x121463||'formatPainterLicenseKeyUsageLimit'==_0x121463){delete _0x215a90[_0x4bf768],_0x27efb4=_0x121463,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'formatPainterLicenseKeyInvalid'==_0x27efb4&&_0x215a90['_showLicenseError']('invalid'),'formatPainterLicenseKeyExpired'==_0x27efb4&&_0x215a90['_showLicenseError']('expired'),'formatPainterLicenseKeyDomainLimit'==_0x27efb4&&_0x215a90['_showLicenseError']('domainLimit'),'formatPainterLicenseKeyNotAllowed'==_0x27efb4&&_0x215a90['_showLicenseError']('featureNotAllowed','FormatPainter'),'formatPainterLicenseKeyEvaluationLimit'==_0x27efb4&&_0x215a90['_showLicenseError']('evaluationLimit'),'formatPainterLicenseKeyUsageLimit'==_0x27efb4&&_0x215a90['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};function L(_0x405176,_0x54cf0d){const t=_0x405176['t'];switch(_0x54cf0d){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 _0x54cf0d;}}const v=/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1b575b(_0xec8b73);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x3b37c0=this['editor'];_0x3b37c0['editing']['view']['addObserver'](_0x4ed0ce),_0x3b37c0['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0x3b37c0['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0x3b37c0['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0x3b37c0['ui']['componentFactory']['add']('formatPainter',_0x350401=>{const _0x26ecb3=_0x22f27a(_0x350401,_0x5cde4c),_0x1dfcb1=_0x3b37c0['commands']['get'](w);_0x26ecb3['buttonView']['set']({'label':L(_0x3b37c0['locale'],'Paint\x20formatting'),'icon':_0x4cc0b7,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x26ecb3['class']='ck-format-painter-dropdown',_0x1dfcb1&&(_0x26ecb3['bind']('isEnabled')['to'](_0x1dfcb1,'isEnabled'),this['listenTo'](_0x1dfcb1,'change:isEnabled',(_0x2bec4c,_0x29b9ee,_0x256ae6)=>{_0x256ae6||this['_finishPainting']();}),_0x26ecb3['buttonView']['bind']('isOn')['to'](_0x1dfcb1,'value',_0x30a007=>!!_0x30a007),this['listenTo'](_0x3b37c0,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x1dfcb1,'change:value',(_0x4fbeef,_0x442581,_0x1679ad)=>{this['_toggleSpecialCursor'](!!_0x1679ad);}));const _0x258803=new _0x1b253a({'withText':!0x0,'label':L(_0x3b37c0['locale'],'Continuous\x20painting'),'tooltip':L(_0x3b37c0['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x5824c1(_0x26ecb3,new _0x48744e([{'type':'switchbutton','model':_0x258803}]),{'role':'menu'});const _0x576c62=()=>{this['_copyFormatting'](),this['listenTo'](_0x258616['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x258803['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x26ecb3,'execute',()=>{_0x258803['isOn']=!_0x258803['isOn'];}),this['listenTo'](_0x26ecb3['buttonView'],'execute',()=>{_0x3b37c0['editing']['view']['focus'](),_0x26ecb3['buttonView']['isOn']?this['_finishPainting']():_0x576c62();}),_0x3b37c0['keystrokes']['set']('Ctrl+Alt+C',(_0x1030e7,_0xb7bd83)=>{_0x576c62(),_0x258803['isOn']=!0x0,_0xb7bd83();},{'priority':'high'}),_0x3b37c0['keystrokes']['set']('Ctrl+Alt+V',(_0x3a6fef,_0x9c04c2)=>{_0x26ecb3['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x258803['isOn']||this['_finishPainting'](),_0x9c04c2());},{'priority':'high'}),_0x3b37c0['keystrokes']['set']('Esc',(_0x33e60e,_0x2eafce)=>{_0x26ecb3['buttonView']['isOn']&&(_0x258803['isOn']=!0x1,this['_finishPainting'](),_0x3b37c0['ui']['ariaLiveAnnouncer']['announce'](L(_0x3b37c0['locale'],'Painting\x20cancelled.')),_0x2eafce());}),_0x26ecb3;});}afterInit(){!async function(_0x16e9b5){const _0x4db100='un0NFQUoX1evzk3yMEfwl7TxbDrisOZaWtKq52P98dchBVpjS4mYLC6gJIHGRA',_0x418065=0x79440,_0x31bd28={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x2ecabb(_0x560431){const _0x1fedb3=new window['Promise'](_0xdd2cb2=>{_0x560431['once']('ready',_0xdd2cb2);}),_0x17066c=window['Date']['now'](),_0x16aa92=_0x560431['config']['get']('licenseKey');async function _0x44febc(){let _0x587e19,_0x2de406=null,_0x51de88=null;try{return'GPL'==_0x16aa92?'NotAllowed':(_0x587e19=_0x3ffc80(),_0x587e19?(_0x587e19['usageEndpoint']&&(_0x51de88=_0x384480(_0x587e19['usageEndpoint'],_0x587e19['jti'])),await _0x1634bd()?_0x2b1816()?_0x2a1e26()?'Expired':_0x4b3fa5()?('evaluation'==_0x587e19['licenseType']&&(_0x2de406=_0x1f9d0a('EvaluationLimit')),await _0x4248fe()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2a1e26(){const _0x31c69a=['evaluation','trial']['includes'](_0x587e19['licenseType'])?_0x17066c/0x3e8:0xe10*_0x418065;return _0x587e19['exp']<_0x31c69a;}function _0x2b1816(){const _0x4b470d=_0x587e19['features'];return!!_0x4b470d&&(!!_0x4b470d['includes']('*')||(!!_0x4b470d['includes']('FP')||(!!_0x4b470d['includes']('PP')||!(!_0x4b470d['includes']('TRILIUM')||!_0x3ccb00()))));}function _0x4b3fa5(){const _0xa45e27=_0x587e19['licensedHosts'];if(!_0xa45e27||0x0==_0xa45e27['length'])return!0x0;const {hostname:_0xde66f5}=new URL(window['location']['href']);if(_0xa45e27['includes'](_0xde66f5))return!0x0;const _0x47c7a8=_0xde66f5['split']('.');return _0xa45e27['filter'](_0x4e6498=>_0x4e6498['includes']('*'))['map'](_0x34a5f8=>_0x34a5f8['split']('.'))['filter'](_0x4272ad=>_0x4272ad['length']<=_0x47c7a8['length'])['map'](_0xd20b1a=>Array(_0x47c7a8['length']-_0xd20b1a['length'])['fill']('*'===_0xd20b1a[0x0]?'*':'')['concat'](_0xd20b1a))['some'](_0x333c08=>_0x47c7a8['every']((_0x2f1149,_0x2cd0c9)=>_0x333c08[_0x2cd0c9]===_0x2f1149||'*'===_0x333c08[_0x2cd0c9]));}function _0x4248fe(){return _0x2de406&&_0x51de88?new window['Promise']((_0x3bb896,_0x563643)=>{_0x2de406['then'](_0x3bb896,_0x563643),_0x51de88['then'](_0x23f750=>{'Valid'!=_0x23f750&&_0x3bb896(_0x23f750);},_0x563643);}):_0x2de406||_0x51de88||'Valid';}}function _0x384480(_0x4c2913,_0x83bd60){return new window['Promise'](_0x325ed2=>{if(_0x496103())return _0x325ed2('Valid');_0x392369(),_0x560431['decorate']('_sendUsageRequest');let _0x18aed8=!0x1;const _0x1f285a=_0x1057c5();function _0x17b82a(_0x476694){return!!_0x476694&&('object'==typeof _0x476694||'function'==typeof _0x476694)&&'function'==typeof _0x476694['then']&&'function'==typeof _0x476694['catch'];}function _0x5e1fea(_0x120183){_0x1daff9(_0x120183)['then'](_0x1711b5=>_0x1711b5&&'ok'==_0x1711b5['status']?_0x5b0532(_0x48c509(_0x1f285a+_0x83bd60))!=_0x1711b5['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3cfc9b=>(_0x351b96(),_0x3cfc9b),()=>{const _0x17f38c=_0x15dd82();return null==_0x17f38c?(_0x351b96(),'Valid'):_0x17066c-_0x17f38c>0x240c8400?'UsageLimit':'Valid';})['then'](_0x325ed2)['catch'](()=>{_0x325ed2('UsageLimit');});const _0x46952c=0x36ee80;function _0x351b96(){const _0x26bebd='llct-'+_0x5b0532(_0x48c509(_0x4c2913)),_0x514657=_0x1fd7e9(_0x5b0532(window['Math']['ceil'](_0x17066c/_0x46952c)));window['localStorage']['setItem'](_0x26bebd,_0x514657);}function _0x15dd82(){const _0x516ba1='llct-'+_0x5b0532(_0x48c509(_0x4c2913)),_0xddebd7=window['localStorage']['getItem'](_0x516ba1);return _0xddebd7?window['parseInt'](_0x1fd7e9(_0xddebd7),0x10)*_0x46952c:null;}function _0x1daff9(_0x4dd31c){return new window['Promise']((_0x2d39d2,_0x43881b)=>{_0x4dd31c['then'](_0x2d39d2,_0x43881b),window['setTimeout'](_0x43881b,0x1d4c0);});}}_0x560431['on']('_sendUsageRequest',(_0xba28c1,_0x5df64c)=>{if(_0x5df64c[0x0]!=_0x4c2913)return _0x325ed2('UsageLimit');_0x5df64c[0x1]={..._0x5df64c[0x1],'requestId':_0x1f285a};},{'priority':'high'}),_0x560431['on']('_sendUsageRequest',_0x45b889=>{_0x17b82a(_0x45b889['return'])&&(_0x18aed8=!0x0,_0x5e1fea(_0x45b889['return']));},{'priority':'low'}),_0x1fedb3['then'](()=>{_0x18aed8||_0x325ed2('UsageLimit');});});function _0x496103(){return'auto'==_0x560431['editing']['view']['_overlayModeHint'];}function _0x392369(){_0x560431['editing']['view']['_overlayModeHint']='auto';}}function _0x1f9d0a(_0x580a20){const _0x21ef1f=[new window['Promise'](_0x1db7d2=>setTimeout(_0x1db7d2,0x93ecc)),_0x1fedb3['then'](()=>new window['Promise'](_0x24040a=>{let _0x81c470=0x0;_0x560431['model']['on']('applyOperation',(_0x131788,_0x1942e5)=>{_0x1942e5[0x0]['isDocumentOperation']&&_0x81c470++,0x5e8==_0x81c470&&(_0x24040a(),_0x131788['off']());});}))];return window['Promise']['race'](_0x21ef1f)['then'](()=>_0x580a20);}async function _0x2aca13(){await _0x1fedb3,_0x560431['model']['change']=_0x383db4,_0x560431['model']['enqueueChange']=_0x383db4,_0x560431['enableReadOnlyMode']('model');}function _0x3ccb00(){return window['glob']&&window['glob']['triliumVersion'];}function _0x4c51f0(_0x21e283){const _0x544dbf=_0x70a0bf();_0x560431[_0x544dbf]='formatPainterLicenseKey'+_0x21e283,'Valid'!=_0x21e283&&_0x2aca13();}function _0x70a0bf(){const _0x19c360=window['String'](window['performance']['now']())['replace']('.','');let _0xe021c4='u';for(let _0x2c31b9=0x0;_0x2c31b9<_0x19c360['length'];_0x2c31b9+=0x2){let _0x5419b6=window['parseInt'](_0x19c360['substring'](_0x2c31b9,_0x2c31b9+0x2));_0x5419b6>=0x3e&&(_0x5419b6-=0x3e),_0xe021c4+=_0x4db100[_0x5419b6];}return _0xe021c4;}function _0x3ffc80(){const _0x2d66c8=_0x16aa92['split']('.');if(0x3!=_0x2d66c8['length'])return null;return _0x156923(_0x2d66c8[0x1]);function _0x156923(_0xafeee6){const _0x2a1b30=_0x1988f0(_0xafeee6);return _0x2a1b30&&_0x989bee()?_0x2a1b30:null;function _0x989bee(){const _0x1ca07a=_0x2a1b30['jti'],_0x5d2be4=window['parseInt'](_0x1ca07a['substring'](_0x1ca07a['length']-0x8),0x10),_0x3b9506={..._0x2a1b30,'jti':_0x1ca07a['substring'](0x0,_0x1ca07a['length']-0x8)};return delete _0x3b9506['vc'],_0x48c509(_0x3b9506)==_0x5d2be4;}}}async function _0x1634bd(){let _0x3fe101=!0x0;try{const [_0x31f2a7,_0x1de097,_0x12dcea]=_0x16aa92['split']('.');return _0x4c62b0(_0x31f2a7),await _0x338920(_0x31f2a7,_0x1de097,_0x12dcea),_0x3fe101;}catch{return!0x1;}function _0x4c62b0(_0x45aa50){const _0x239229=_0x1988f0(_0x45aa50);_0x239229&&'ES256'==_0x239229['alg']||(_0x3fe101=!0x1);}async function _0x338920(_0x32818c,_0x3f6304,_0x57e84e){const _0x32dc4c=window['Uint8Array']['from'](_0xe18a5a(_0x57e84e),_0x5aed5e=>_0x5aed5e['charCodeAt'](0x0)),_0x498240=new window['TextEncoder']()['encode'](_0x32818c+'.'+_0x3f6304),_0x1104e9=window['crypto']['subtle'];if(!_0x1104e9)return;const _0x136559=await _0x1104e9['importKey']('jwk',_0x31bd28,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x1104e9['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x136559,_0x32dc4c,_0x498240)||(_0x3fe101=!0x1);}}function _0x1988f0(_0x17459f){return _0x17459f['startsWith']('ey')?JSON['parse'](_0xe18a5a(_0x17459f)):null;}function _0xe18a5a(_0x22bdff){return window['atob'](_0x22bdff['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x48c509(_0x37112b){let _0x32fa2f=0x1505;function _0x467b8d(_0x336243){for(let _0x216356=0x0;_0x216356<_0x336243['length'];_0x216356++){const _0x4de188=_0x336243['charCodeAt'](_0x216356);_0x32fa2f=(_0x32fa2f<<0x5)+_0x32fa2f+_0x4de188,_0x32fa2f&=_0x32fa2f;}}function _0x5450fb(_0x3c1c8c){Array['isArray'](_0x3c1c8c)?_0x3c1c8c['forEach'](_0x5450fb):_0x3c1c8c&&'object'==typeof _0x3c1c8c?Object['entries'](_0x3c1c8c)['sort']()['forEach'](([_0xc9f806,_0x9ca512])=>{_0x467b8d(_0xc9f806),_0x5450fb(_0x9ca512);}):_0x467b8d(window['String'](_0x3c1c8c));}return _0x5450fb(_0x37112b),_0x32fa2f>>>0x0;}function _0x5b0532(_0x1e0cd1){return _0x1e0cd1['toString'](0x10)['padStart'](0x8,'0');}function _0x1fd7e9(_0x1873ae){return _0x1873ae['split']('')['reverse']()['join']('');}function _0x383db4(){}_0x4c51f0(await _0x44febc());}_0x2ecabb(_0x16e9b5['editor']);}(this);}_toggleSpecialCursor(_0x371585){this['editor']['editing']['view']['change'](_0x8aa7d6=>{for(const _0x19f252 of this['editor']['editing']['view']['document']['roots'])_0x371585?_0x8aa7d6['addClass'](h,_0x19f252):_0x8aa7d6['removeClass'](h,_0x19f252);});}_copyFormatting(){const {editor:_0x43246e}=this;_0x43246e['execute'](w),_0x43246e['ui']['ariaLiveAnnouncer']['announce'](L(_0x43246e['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x37e673}=this,_0x525ac2=_0x37e673['commands']['get'](w)['value'];_0x37e673['execute'](g,_0x525ac2),_0x37e673['ui']['ariaLiveAnnouncer']['announce'](L(_0x37e673['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0x258616['window']['document'],'mouseup');}},x=class extends _0xec8b73{static get requires(){return[P,k];}static get['pluginName'](){return'FormatPainter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{y as CopyFormatCommand,x as FormatPainter,P as FormatPainterEditing,k as FormatPainterUI,p as PasteFormatCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-format-painter",
|
|
3
|
-
"version": "48.5.0-alpha.
|
|
3
|
+
"version": "48.5.0-alpha.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.5.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-remove-format": "48.5.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.5.0-alpha.5",
|
|
25
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.5",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.5",
|
|
27
|
+
"@ckeditor/ckeditor5-remove-format": "48.5.0-alpha.5",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.5",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.5"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|