@ckeditor/ckeditor5-format-painter 48.4.0-alpha.3 → 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.
- 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 _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.
|
|
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.
|
|
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.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",
|