@ckeditor/ckeditor5-format-painter 48.4.0-alpha.3 → 48.4.0-alpha.4
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
|
-
_0x38198c(_0x27e70);var k=class extends v{static get['pluginName'](){return'FormatPainterUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x4b826e=this['editor'];_0x4b826e['editing']['view']['addObserver'](_0x576276),_0x4b826e['accessibility']['addKeystrokeInfos']({'keystrokes':[{'label':L(_0x4b826e['locale'],'Copy\x20text\x20formatting'),'keystroke':'Ctrl+Alt+C'},{'label':L(_0x4b826e['locale'],'Paste\x20text\x20formatting'),'keystroke':'Ctrl+Alt+V'}]}),_0x4b826e['ui']['componentFactory']['add']('formatPainter',_0x2ac256=>{const _0x100427=_0x1233ec(_0x2ac256,_0x4a1d7f),_0x2065f3=_0x4b826e['commands']['get'](w);_0x100427['buttonView']['set']({'label':L(_0x4b826e['locale'],'Paint\x20formatting'),'icon':_0x3f5867,'keystroke':'Ctrl+Alt+C','tooltip':!0x0}),_0x100427['class']='ck-format-painter-dropdown',_0x2065f3&&(_0x100427['bind']('isEnabled')['to'](_0x2065f3,'isEnabled'),this['listenTo'](_0x2065f3,'change:isEnabled',(_0x2048dd,_0xde1746,_0x467f15)=>{_0x467f15||this['_finishPainting']();}),_0x100427['buttonView']['bind']('isOn')['to'](_0x2065f3,'value',_0x19ad2c=>!!_0x19ad2c),this['listenTo'](_0x4b826e,'destroy',()=>this['_toggleSpecialCursor'](!0x1)),this['listenTo'](_0x2065f3,'change:value',(_0x454048,_0xacc39a,_0x33c4f6)=>{this['_toggleSpecialCursor'](!!_0x33c4f6);}));const _0x25fcbc=new _0x1a09ab({'withText':!0x0,'label':L(_0x4b826e['locale'],'Continuous\x20painting'),'tooltip':L(_0x4b826e['locale'],'Keeps\x20the\x20painter\x20on\x20after\x20setting\x20the\x20formatting.'),'isOn':!0x1,'role':'menuitemcheckbox'});_0x4599f4(_0x100427,new _0x13d3f2([{'type':'switchbutton','model':_0x25fcbc}]),{'role':'menu'});const _0x29c852=()=>{this['_copyFormatting'](),this['listenTo'](_0xac2371['window']['document'],'mouseup',()=>{this['_pasteFormatting'](),_0x25fcbc['isOn']||this['_finishPainting']();});};return this['listenTo'](_0x100427,'execute',()=>{_0x25fcbc['isOn']=!_0x25fcbc['isOn'];}),this['listenTo'](_0x100427['buttonView'],'execute',()=>{_0x4b826e['editing']['view']['focus'](),_0x100427['buttonView']['isOn']?this['_finishPainting']():_0x29c852();}),_0x4b826e['keystrokes']['set']('Ctrl+Alt+C',(_0x2e72db,_0x1067dd)=>{_0x29c852(),_0x25fcbc['isOn']=!0x0,_0x1067dd();},{'priority':'high'}),_0x4b826e['keystrokes']['set']('Ctrl+Alt+V',(_0x14c047,_0x5e4227)=>{_0x100427['buttonView']['isOn']&&(this['_pasteFormatting'](),_0x25fcbc['isOn']||this['_finishPainting'](),_0x5e4227());},{'priority':'high'}),_0x4b826e['keystrokes']['set']('Esc',(_0x3cb52b,_0x4e5f58)=>{_0x100427['buttonView']['isOn']&&(_0x25fcbc['isOn']=!0x1,this['_finishPainting'](),_0x4b826e['ui']['ariaLiveAnnouncer']['announce'](L(_0x4b826e['locale'],'Painting\x20cancelled.')),_0x4e5f58());}),_0x100427;});}afterInit(){!async function(_0xbc64b0){const _0x53eb05='QiLRCSOsZ8pAvDdaPJUE3oxjKlzM2uXgrtGfeyh5cNFkmBw9I6WH0qnb4T17YV',_0x366552=0x79170,_0x3d20d4=window['Date']['now'](),_0x41d003=_0xbc64b0['editor'],_0x1d649b=new window['Promise'](_0x4e11ed=>{_0x41d003['once']('ready',_0x4e11ed);}),_0xdeb66c={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x27889f=_0x41d003['config']['get']('licenseKey');async function _0x40c990(){let _0x2f5e74,_0x3ac267=null,_0xd216e5=null;try{return'GPL'==_0x27889f?'NotAllowed':(_0x2f5e74=_0x28e9ad(),_0x2f5e74?(_0x2f5e74['usageEndpoint']&&(_0xd216e5=_0x54db47(_0x2f5e74['usageEndpoint'],_0x2f5e74['jti'])),await _0x7c1a98()?_0x1121ae()?_0x3a3758()?'Expired':_0xc595df()?('evaluation'==_0x2f5e74['licenseType']&&(_0x3ac267=_0x3a0d86('EvaluationLimit')),await _0x3eef94()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3a3758(){const _0x3a0e65=['evaluation','trial']['includes'](_0x2f5e74['licenseType'])?_0x3d20d4/0x3e8:0xe10*_0x366552;return _0x2f5e74['exp']<_0x3a0e65;}function _0x1121ae(){const _0x43a7f0=_0x2f5e74['features'];return!!_0x43a7f0&&(!!_0x43a7f0['includes']('*')||(!!_0x43a7f0['includes']('FP')||(!!_0x43a7f0['includes']('PP')||!(!_0x43a7f0['includes']('TRILIUM')||!_0x1b85c8()))));}function _0xc595df(){const _0x3c2f79=_0x2f5e74['licensedHosts'];if(!_0x3c2f79||0x0==_0x3c2f79['length'])return!0x0;const {hostname:_0x4be835}=new URL(window['location']['href']);if(_0x3c2f79['includes'](_0x4be835))return!0x0;const _0x281ff5=_0x4be835['split']('.');return _0x3c2f79['filter'](_0x185df2=>_0x185df2['includes']('*'))['map'](_0x31a0dc=>_0x31a0dc['split']('.'))['filter'](_0x3b9fae=>_0x3b9fae['length']<=_0x281ff5['length'])['map'](_0x4aba90=>Array(_0x281ff5['length']-_0x4aba90['length'])['fill']('*'===_0x4aba90[0x0]?'*':'')['concat'](_0x4aba90))['some'](_0x4b01b7=>_0x281ff5['every']((_0x2a25eb,_0x2d03f4)=>_0x4b01b7[_0x2d03f4]===_0x2a25eb||'*'===_0x4b01b7[_0x2d03f4]));}function _0x3eef94(){return _0x3ac267&&_0xd216e5?new window['Promise']((_0x51e3e2,_0x3bc338)=>{_0x3ac267['then'](_0x51e3e2,_0x3bc338),_0xd216e5['then'](_0x19e5bc=>{'Valid'!=_0x19e5bc&&_0x51e3e2(_0x19e5bc);},_0x3bc338);}):_0x3ac267||_0xd216e5||'Valid';}}function _0x54db47(_0x597c55,_0x464174){return new window['Promise'](_0x39bfa4=>{if(_0x2cc658())return _0x39bfa4('Valid');_0x5d569a(),_0x41d003['decorate']('_sendUsageRequest');let _0x3e164b=!0x1;const _0x5223c6=_0x54aad3();function _0x5cc7f8(_0x1aee99){return!!_0x1aee99&&('object'==typeof _0x1aee99||'function'==typeof _0x1aee99)&&'function'==typeof _0x1aee99['then']&&'function'==typeof _0x1aee99['catch'];}function _0x2adf93(_0x36adb5){_0x437d94(_0x36adb5)['then'](_0x3abf46=>_0x3abf46&&'ok'==_0x3abf46['status']?_0x4aa49c(_0x5ded2d(_0x5223c6+_0x464174))!=_0x3abf46['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3111fb=>(_0x48d997(),_0x3111fb),()=>{const _0x364e85=_0x50b4f0();return null==_0x364e85?(_0x48d997(),'Valid'):_0x3d20d4-_0x364e85>0x240c8400?'UsageLimit':'Valid';})['then'](_0x39bfa4)['catch'](()=>{_0x39bfa4('UsageLimit');});const _0x368c1f=0x36ee80;function _0x48d997(){const _0x345624='llct-'+_0x4aa49c(_0x5ded2d(_0x597c55)),_0x94b186=_0xbc04c2(_0x4aa49c(window['Math']['ceil'](_0x3d20d4/_0x368c1f)));window['localStorage']['setItem'](_0x345624,_0x94b186);}function _0x50b4f0(){const _0x33d435='llct-'+_0x4aa49c(_0x5ded2d(_0x597c55)),_0x5236ae=window['localStorage']['getItem'](_0x33d435);return _0x5236ae?window['parseInt'](_0xbc04c2(_0x5236ae),0x10)*_0x368c1f:null;}function _0x437d94(_0x1cf5fa){return new window['Promise']((_0x3caa72,_0x173c73)=>{_0x1cf5fa['then'](_0x3caa72,_0x173c73),window['setTimeout'](_0x173c73,0x1d4c0);});}}_0x41d003['on']('_sendUsageRequest',(_0x1dd3c4,_0x3cbf67)=>{if(_0x3cbf67[0x0]!=_0x597c55)return _0x39bfa4('UsageLimit');_0x3cbf67[0x1]={..._0x3cbf67[0x1],'requestId':_0x5223c6};},{'priority':'high'}),_0x41d003['on']('_sendUsageRequest',_0x4cc295=>{_0x5cc7f8(_0x4cc295['return'])&&(_0x3e164b=!0x0,_0x2adf93(_0x4cc295['return']));},{'priority':'low'}),_0x1d649b['then'](()=>{_0x3e164b||_0x39bfa4('UsageLimit');});});function _0x2cc658(){return'auto'==_0x41d003['editing']['view']['_overlayModeHint'];}function _0x5d569a(){_0x41d003['editing']['view']['_overlayModeHint']='auto';}}function _0x3a0d86(_0x4844b6){const _0x2729e1=[new window['Promise'](_0x1a77ab=>setTimeout(_0x1a77ab,0x93ecc)),_0x1d649b['then'](()=>new window['Promise'](_0x1b0351=>{let _0x16588d=0x0;_0x41d003['model']['on']('applyOperation',(_0x131c93,_0x3194c7)=>{_0x3194c7[0x0]['isDocumentOperation']&&_0x16588d++,0x5e8==_0x16588d&&(_0x1b0351(),_0x131c93['off']());});}))];return window['Promise']['race'](_0x2729e1)['then'](()=>_0x4844b6);}async function _0x5bb97(){await _0x1d649b,_0x41d003['model']['change']=_0x1288d1,_0x41d003['model']['enqueueChange']=_0x1288d1,_0x41d003['enableReadOnlyMode']('model');}function _0x1b85c8(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5dfdb2(_0x46eced){const _0x11d0c9=_0x416390();_0x41d003[_0x11d0c9]='formatPainterLicenseKey'+_0x46eced,'Valid'!=_0x46eced&&_0x5bb97();}function _0x416390(){const _0x38ae88=window['String'](window['performance']['now']())['replace']('.','');let _0x90fd9='Q';for(let _0x3a5924=0x0;_0x3a5924<_0x38ae88['length'];_0x3a5924+=0x2){let _0x28ca42=window['parseInt'](_0x38ae88['substring'](_0x3a5924,_0x3a5924+0x2));_0x28ca42>=0x3e&&(_0x28ca42-=0x3e),_0x90fd9+=_0x53eb05[_0x28ca42];}return _0x90fd9;}function _0x28e9ad(){const _0x2691e0=_0x27889f['split']('.');if(0x3!=_0x2691e0['length'])return null;return _0x370bfd(_0x2691e0[0x1]);function _0x370bfd(_0x10b793){const _0x18199e=_0x3b3c27(_0x10b793);return _0x18199e&&_0x358e30()?_0x18199e:null;function _0x358e30(){const _0x3faac6=_0x18199e['jti'],_0x2ac2c6=window['parseInt'](_0x3faac6['substring'](_0x3faac6['length']-0x8),0x10),_0xa95410={..._0x18199e,'jti':_0x3faac6['substring'](0x0,_0x3faac6['length']-0x8)};return delete _0xa95410['vc'],_0x5ded2d(_0xa95410)==_0x2ac2c6;}}}async function _0x7c1a98(){let _0x532c23=!0x0;try{const [_0x159aa7,_0x34ec5c,_0x3d8e2d]=_0x27889f['split']('.');return _0x3bd46a(_0x159aa7),await _0x42b69d(_0x159aa7,_0x34ec5c,_0x3d8e2d),_0x532c23;}catch{return!0x1;}function _0x3bd46a(_0x5e3031){const _0x731495=_0x3b3c27(_0x5e3031);_0x731495&&'ES256'==_0x731495['alg']||(_0x532c23=!0x1);}async function _0x42b69d(_0x479e0f,_0x457a24,_0x57bd05){const _0x37640f=window['Uint8Array']['from'](_0x7ab2f5(_0x57bd05),_0x28c707=>_0x28c707['charCodeAt'](0x0)),_0x591c8f=new window['TextEncoder']()['encode'](_0x479e0f+'.'+_0x457a24),_0x2e3561=window['crypto']['subtle'];if(!_0x2e3561)return;const _0x379016=await _0x2e3561['importKey']('jwk',_0xdeb66c,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2e3561['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x379016,_0x37640f,_0x591c8f)||(_0x532c23=!0x1);}}function _0x3b3c27(_0xea261a){return _0xea261a['startsWith']('ey')?JSON['parse'](_0x7ab2f5(_0xea261a)):null;}function _0x7ab2f5(_0x5dacb9){return window['atob'](_0x5dacb9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5ded2d(_0x7eb605){let _0x38468a=0x1505;function _0x59c8da(_0x16148f){for(let _0x360620=0x0;_0x360620<_0x16148f['length'];_0x360620++){const _0x5aed92=_0x16148f['charCodeAt'](_0x360620);_0x38468a=(_0x38468a<<0x5)+_0x38468a+_0x5aed92,_0x38468a&=_0x38468a;}}function _0x239324(_0x3383f2){Array['isArray'](_0x3383f2)?_0x3383f2['forEach'](_0x239324):_0x3383f2&&'object'==typeof _0x3383f2?Object['entries'](_0x3383f2)['sort']()['forEach'](([_0x1dd205,_0x597693])=>{_0x59c8da(_0x1dd205),_0x239324(_0x597693);}):_0x59c8da(window['String'](_0x3383f2));}return _0x239324(_0x7eb605),_0x38468a>>>0x0;}function _0x4aa49c(_0x52b636){return _0x52b636['toString'](0x10)['padStart'](0x8,'0');}function _0xbc04c2(_0x4c0eac){return _0x4c0eac['split']('')['reverse']()['join']('');}function _0x1288d1(){}_0x5dfdb2(await _0x40c990());}(this);}_toggleSpecialCursor(_0x53125e){this['editor']['editing']['view']['change'](_0x30c086=>{for(const _0x26edfc of this['editor']['editing']['view']['document']['roots'])_0x53125e?_0x30c086['addClass'](h,_0x26edfc):_0x30c086['removeClass'](h,_0x26edfc);});}_copyFormatting(){const {editor:_0x18b7c0}=this;_0x18b7c0['execute'](w),_0x18b7c0['ui']['ariaLiveAnnouncer']['announce'](L(_0x18b7c0['locale'],'Formatting\x20copied.'));}_pasteFormatting(){const {editor:_0x4742e1}=this,_0x52bd12=_0x4742e1['commands']['get'](w)['value'];_0x4742e1['execute'](g,_0x52bd12),_0x4742e1['ui']['ariaLiveAnnouncer']['announce'](L(_0x4742e1['locale'],'Pasted\x20formatting.'));}_finishPainting(){this['editor']['commands']['get'](w)['reset'](),this['stopListening'](_0xac2371['window']['document'],'mouseup');}},x=class extends _0x27e70{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 _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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-format-painter",
|
|
3
|
-
"version": "48.4.0-alpha.
|
|
3
|
+
"version": "48.4.0-alpha.4",
|
|
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.
|
|
25
|
-
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-remove-format": "48.4.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
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"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|