@ckeditor/ckeditor5-source-editing-enhanced 48.3.1-alpha.0 → 48.3.1-alpha.1
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 +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as _0xae1ca1,PendingActions as _0x5f5ce3,Plugin as _0x3c3797}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x1dc3e6,env as _0x187bb7,formatHtml as _0x1cf4f8,uid as _0x27ea53}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x3445dd}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x5663b,MenuBarMenuListItemButtonView as _0x593780,View as _0x547204}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x24e203,crosshairCursor as _0x3a739e,drawSelection as _0x51a25f,dropCursor as _0x15c2b3,highlightActiveLine as _0x1a3990,highlightActiveLineGutter as _0x8974e9,highlightSpecialChars as _0x309a96,keymap as _0x10f701,lineNumbers as _0x4dafe4,rectangularSelection as _0x48caf5}from'@codemirror/view';import{Compartment as _0x595d59,Transaction as _0x3ffea5}from'@codemirror/state';import{bracketMatching as _0x39e7da,defaultHighlightStyle as _0x1799c6,foldGutter as _0x5d666f,foldKeymap as _0x183b68,indentOnInput as _0x36315c,syntaxHighlighting as _0x42150c}from'@codemirror/language';import{defaultKeymap as _0xe2c4e1,history as _0x485a30,historyKeymap as _0x707855,indentLess as _0x36dc60,indentMore as _0x5bf748,redo as _0x428347,toggleTabFocusMode as _0xac4c67,undo as _0x3d3a43}from'@codemirror/commands';import{autocompletion as _0x209df4,closeBrackets as _0xbc2eab,closeBracketsKeymap as _0x1377b3,completionKeymap as _0x5f32b1}from'@codemirror/autocomplete';import{html as _0x23636e}from'@codemirror/lang-html';import{markdown as _0x312354}from'@codemirror/lang-markdown';import{oneDark as _0x311d39}from'@codemirror/theme-one-dark';function Q(_0x461cdf,_0x49da03){const t=_0x461cdf['t'];switch(_0x49da03){case'Edit\x20source\x20modal\x20label':return t({'string':'Edit\x20source','id':'Edit\x20source\x20modal\x20label'});case'Source':return t('Source');case'Source\x20Editing\x20Enhanced':return t('Source\x20Editing\x20Enhanced');case'Copy\x20line\x20down':return t('Copy\x20line\x20down');case'Copy\x20line\x20up':return t('Copy\x20line\x20up');case'Delete\x20line':return t('Delete\x20line');case'Indent\x20less':return t('Indent\x20less');case'Indent\x20more':return t('Indent\x20more');case'Fold\x20all':return t('Fold\x20all');case'Fold\x20code\x20(current\x20level)':return t('Fold\x20code\x20(current\x20level)');case'Move\x20line\x20down':return t('Move\x20line\x20down');case'Move\x20line\x20up':return t('Move\x20line\x20up');case'Redo\x20(keystroke)':return t({'id':'Redo\x20(keystroke)','string':'Redo'});case'Select\x20line':return t('Select\x20line');case'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode':return t('Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode');case'Toggle\x20block\x20comment':return t('Toggle\x20block\x20comment');case'Toggle\x20comment':return t('Toggle\x20comment');case'Undo\x20(keystroke)':return t({'id':'Undo\x20(keystroke)','string':'Undo'});case'Unfold\x20all':return t('Unfold\x20all');case'Unfold\x20code\x20(current\x20level)':return t('Unfold\x20code\x20(current\x20level)');case'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.':return t('Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.');case'Cancel':return t('Cancel');case'Save':return t('Save');default:return _0x49da03;}}function B(_0x31afec){const _0x1991e0=_0x31afec['editing']['view']['document']['roots'],_0x180e95=_0x1991e0['length'];if(0x0===_0x180e95)throw new _0x1dc3e6('source-editing-enhanced-editor-no-root',_0x31afec);return 0x1===_0x180e95?_0x1991e0['first']['rootName']:Array['from'](_0x31afec['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x593692){return J(_0x593692['replace'](/^[\n\s]*/g,''))?_0x593692['replace'](/\s+/g,''):_0x593692;}function J(_0xcb6312){return _0xcb6312['startsWith']('<');}function X(_0x573cb0){const _0x563dfe=[_0x24e203['lineWrapping'],_0x209df4(),_0x39e7da(),_0xbc2eab(),_0x3a739e(),_0x51a25f(),_0x15c2b3(),_0x4dafe4(),_0x5d666f(),_0x1a3990(),_0x8974e9(),_0x309a96(),_0x485a30(),_0x36315c(),_0x48caf5(),_0x42150c(_0x1799c6,{'fallback':!0x0})],_0x1e86ce=new _0x595d59();_0x563dfe['push'](_0x1e86ce['of'](_0x24e203['editable']['of'](!0x0))),'html'===_0x573cb0['syntaxLanguage']?_0x563dfe['push'](_0x23636e()):_0x563dfe['push'](_0x312354());const _0x1481a7=(_0x5517be=_0x573cb0['theme'])&&'default'!==_0x5517be?'dark'===_0x5517be?_0x311d39:_0x5517be:null;var _0x5517be;_0x1481a7&&_0x563dfe['push'](_0x1481a7),_0x563dfe['push'](_0x10f701['of']([..._0x1377b3,..._0xe2c4e1,..._0x707855,..._0x183b68,..._0x5f32b1,{'key':'Tab','run':_0x5bf748,'shift':_0x36dc60,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x428347,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x428347,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x3d3a43,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x2a6a2c=new _0x24e203({'extensions':_0x563dfe,'parent':_0x573cb0['parent']});return _0xac4c67(_0x2a6a2c),{'focus':()=>{_0x2a6a2c['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x2a6a2c['focus']();},'getData':()=>_0x2a6a2c['state']['doc']['toString'](),'setData':_0x336a27=>{_0x2a6a2c['dispatch']({'changes':{'from':0x0,'to':_0x2a6a2c['state']['doc']['length'],'insert':_0x336a27},'annotations':_0x3ffea5['addToHistory']['of'](!0x1)});},'setReadOnly':_0x3db4bc=>{_0x2a6a2c['dispatch']({'effects':[_0x1e86ce['reconfigure'](_0x24e203['editable']['of'](!_0x3db4bc))]});},'destroy':()=>{_0x2a6a2c['destroy']();},'instance':_0x2a6a2c};}var Z=class extends _0x547204{['_codeEditorApi']=null;['_options'];constructor(_0x62274c,_0x83fd7e){super(_0x62274c),this['_options']=_0x83fd7e,this['set']('isReadOnly',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-code-editor'],'tabindex':-0x1}});}['render'](){super['render'](),this['_codeEditorApi']=X({'parent':this['element'],'syntaxLanguage':this['_options']['syntaxLanguage'],'theme':this['_options']['theme']}),this['on']('change:isReadOnly',(_0x546cb5,_0x330f5b,_0x10df14)=>{this['setReadOnly'](_0x10df14);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x3f2792){this['_codeEditorApi']['setData'](_0x3f2792);}['setReadOnly'](_0x24a6fd){this['_codeEditorApi']['setReadOnly'](_0x24a6fd);}};const G='SourceEditingEnhancedMode';var W=class extends _0xae1ca1{constructor(_0x3c3b48){super(_0x3c3b48),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x5f5ce3)['on']('change:hasAny',(_0x101a3e,_0x1104fc,_0x47a851)=>{_0x47a851?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x1f09e5=this['editor'];for(const _0x598cf7 of _0x1f09e5['commands']['names']())['replaceSource','editSource']['includes'](_0x598cf7)||_0x1f09e5['commands']['get'](_0x598cf7)['forceDisabled'](G);}['_enableCommands'](){const _0x2358f4=this['editor'];for(const _0x59cdef of _0x2358f4['commands']['commands']())_0x59cdef['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0xc339ac=this['editor'],_0x16a6b7=_0xc339ac['locale'],_0x541cdf=_0xc339ac['plugins']['get']('Dialog'),_0x40239c=B(_0xc339ac),_0x2aebbb=J(_0x163fd8=_0xc339ac['data']['get']({'rootName':_0x40239c}))?_0x1cf4f8(_0x163fd8):_0x163fd8;var _0x163fd8;const _0x4dcafb=new Z(_0x16a6b7,{'syntaxLanguage':_0xc339ac['plugins']['has']('Markdown')?'markdown':'html','theme':_0xc339ac['config']['get']('sourceEditingEnhanced.theme')});let _0x1d6345=!0x0;const _0x4a81a1=_0x561c38=>{if(_0x1d6345&&Y(_0x4dcafb['getData']())!==Y(_0x2aebbb))return window['confirm'](Q(_0x16a6b7,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x561c38['stop']();};_0x541cdf['show']({'id':'sourceEditingEnhanced','title':Q(_0x16a6b7,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x4dcafb,'actionButtons':[{'label':Q(_0x16a6b7,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x541cdf['hide']();}},{'label':Q(_0x16a6b7,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x14dd1b=Y(_0x4dcafb['getData']())!==Y(_0x2aebbb);_0x14dd1b&&_0xc339ac['execute']('replaceSource',_0x4dcafb['getData']()),_0x1d6345=!0x1,_0x541cdf['hide'](),_0x14dd1b&&'editables'in _0xc339ac['ui']['view']&&_0xc339ac['ui']['view']['editables'][_0x40239c]['element']['focus']();},'onCreate':_0x322afc=>{_0x322afc['set']('isEnabled',!_0xc339ac['isReadOnly']),_0x322afc['bind']('isEnabled')['to'](_0xc339ac,'isReadOnly',this,'isEnabled',(_0x3c1920,_0x4eb1b0)=>!_0x3c1920&&_0x4eb1b0);}}],'onHide':()=>{this['_enableCommands'](),_0x541cdf['off']('hide',_0x4a81a1),_0x4dcafb['destroy']();},'onShow':()=>{_0x4dcafb['bind']('isReadOnly')['to'](_0xc339ac,'isReadOnly',this,'isEnabled',(_0x4683f0,_0x1624b2)=>_0x4683f0||!_0x1624b2),_0x4dcafb['setData'](_0x2aebbb),_0x4dcafb['focus'](),_0x541cdf['on']('hide',_0x4a81a1,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x3c3797{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x5f5ce3];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4a9b60=this['editor'],_0x55b519=_0x4a9b60['locale'],_0x3ff173=new W(_0x4a9b60);_0x4a9b60['commands']['add']('editSource',_0x3ff173),_0x4a9b60['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x9e1418=this['_createButton'](_0x5663b,_0x3ff173);return _0x9e1418['set']({'label':Q(_0x55b519,'Source'),'icon':_0x3445dd,'tooltip':Q(_0x55b519,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x9e1418;}),_0x4a9b60['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x11581f=this['_createButton'](_0x593780,_0x3ff173,!0x0);return _0x11581f['set']({'label':Q(_0x55b519,'Edit\x20source\x20modal\x20label'),'icon':_0x3445dd,'role':'menuitemcheckbox'}),_0x11581f;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0x3eb62e){const _0x11f698='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x29dae9=0x78fa8,_0x4e3977=window['Date']['now'](),_0x1431d0=_0x3eb62e['editor'],_0x377e73=new window['Promise'](_0x50b2bb=>{_0x1431d0['once']('ready',_0x50b2bb);}),_0x2654de={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x2470c2=_0x1431d0['config']['get']('licenseKey');async function _0x2063c8(){let _0x5982bd,_0x2f851d=null,_0xa047d3=null;try{return'GPL'==_0x2470c2?'NotAllowed':(_0x5982bd=_0x1b1938(),_0x5982bd?(_0x5982bd['usageEndpoint']&&(_0xa047d3=_0x515536(_0x5982bd['usageEndpoint'],_0x5982bd['jti'])),await _0x43a88f()?_0x7a13()?_0x3f69a8()?'Expired':_0x20f080()?('evaluation'==_0x5982bd['licenseType']&&(_0x2f851d=_0xf3778f('EvaluationLimit')),await _0x146570()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3f69a8(){const _0x36b225=['evaluation','trial']['includes'](_0x5982bd['licenseType'])?_0x4e3977/0x3e8:0xe10*_0x29dae9;return _0x5982bd['exp']<_0x36b225;}function _0x7a13(){const _0x54ae9c=_0x5982bd['features'];return!!_0x54ae9c&&(!!_0x54ae9c['includes']('*')||!!_0x54ae9c['includes']('SEE'));}function _0x20f080(){const _0x302c1d=_0x5982bd['licensedHosts'];if(!_0x302c1d||0x0==_0x302c1d['length'])return!0x0;const {hostname:_0x4ba717}=new URL(window['location']['href']);if(_0x302c1d['includes'](_0x4ba717))return!0x0;const _0x534ac2=_0x4ba717['split']('.');return _0x302c1d['filter'](_0x51fd1d=>_0x51fd1d['includes']('*'))['map'](_0x24a369=>_0x24a369['split']('.'))['filter'](_0x4f0b18=>_0x4f0b18['length']<=_0x534ac2['length'])['map'](_0x590000=>Array(_0x534ac2['length']-_0x590000['length'])['fill']('*'===_0x590000[0x0]?'*':'')['concat'](_0x590000))['some'](_0x52dd84=>_0x534ac2['every']((_0x3466ef,_0x53eabd)=>_0x52dd84[_0x53eabd]===_0x3466ef||'*'===_0x52dd84[_0x53eabd]));}function _0x146570(){return _0x2f851d&&_0xa047d3?new window['Promise']((_0x576747,_0x5157a5)=>{_0x2f851d['then'](_0x576747,_0x5157a5),_0xa047d3['then'](_0x31b255=>{'Valid'!=_0x31b255&&_0x576747(_0x31b255);},_0x5157a5);}):_0x2f851d||_0xa047d3||'Valid';}}function _0x515536(_0x3c1dfe,_0x5cf7f2){return new window['Promise'](_0x29f7f5=>{if(_0x5958f5())return _0x29f7f5('Valid');_0xcc959c(),_0x1431d0['decorate']('_sendUsageRequest');let _0x255abe=!0x1;const _0x1444c8=_0x27ea53();function _0x53b4fe(_0x251cb6){return!!_0x251cb6&&('object'==typeof _0x251cb6||'function'==typeof _0x251cb6)&&'function'==typeof _0x251cb6['then']&&'function'==typeof _0x251cb6['catch'];}function _0x2ae5ef(_0x23a3b9){_0x1239e5(_0x23a3b9)['then'](_0x5ce581=>_0x5ce581&&'ok'==_0x5ce581['status']?_0x1fa5bf(_0x1ad0a6(_0x1444c8+_0x5cf7f2))!=_0x5ce581['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x325a60=>(_0x11caa1(),_0x325a60),()=>{const _0x4447e5=_0x1b9b3f();return null==_0x4447e5?(_0x11caa1(),'Valid'):_0x4e3977-_0x4447e5>0x240c8400?'UsageLimit':'Valid';})['then'](_0x29f7f5)['catch'](()=>{_0x29f7f5('UsageLimit');});const _0x13bbe7=0x36ee80;function _0x11caa1(){const _0x51ba4b='llct-'+_0x1fa5bf(_0x1ad0a6(_0x3c1dfe)),_0x2b6641=_0x16a01b(_0x1fa5bf(window['Math']['ceil'](_0x4e3977/_0x13bbe7)));window['localStorage']['setItem'](_0x51ba4b,_0x2b6641);}function _0x1b9b3f(){const _0x130133='llct-'+_0x1fa5bf(_0x1ad0a6(_0x3c1dfe)),_0x3eb4da=window['localStorage']['getItem'](_0x130133);return _0x3eb4da?window['parseInt'](_0x16a01b(_0x3eb4da),0x10)*_0x13bbe7:null;}function _0x1239e5(_0x49aefb){return new window['Promise']((_0x4ec761,_0x15232c)=>{_0x49aefb['then'](_0x4ec761,_0x15232c),window['setTimeout'](_0x15232c,0x1d4c0);});}}_0x1431d0['on']('_sendUsageRequest',(_0x1d4782,_0x30b507)=>{if(_0x30b507[0x0]!=_0x3c1dfe)return _0x29f7f5('UsageLimit');_0x30b507[0x1]={..._0x30b507[0x1],'requestId':_0x1444c8};},{'priority':'high'}),_0x1431d0['on']('_sendUsageRequest',_0x3040ba=>{_0x53b4fe(_0x3040ba['return'])&&(_0x255abe=!0x0,_0x2ae5ef(_0x3040ba['return']));},{'priority':'low'}),_0x377e73['then'](()=>{_0x255abe||_0x29f7f5('UsageLimit');});});function _0x5958f5(){return'auto'==_0x1431d0['editing']['view']['_overlayModeHint'];}function _0xcc959c(){_0x1431d0['editing']['view']['_overlayModeHint']='auto';}}function _0xf3778f(_0x360abf){const _0x4f0b7e=[new window['Promise'](_0x5df8e5=>setTimeout(_0x5df8e5,0x93ecc)),_0x377e73['then'](()=>new window['Promise'](_0x520aa0=>{let _0x125efb=0x0;_0x1431d0['model']['on']('applyOperation',(_0x61b753,_0x58413e)=>{_0x58413e[0x0]['isDocumentOperation']&&_0x125efb++,0x5e8==_0x125efb&&(_0x520aa0(),_0x61b753['off']());});}))];return window['Promise']['race'](_0x4f0b7e)['then'](()=>_0x360abf);}async function _0x4b2f75(){await _0x377e73,_0x1431d0['model']['change']=_0x115916,_0x1431d0['model']['enqueueChange']=_0x115916,_0x1431d0['enableReadOnlyMode']('model');}function _0x2bf299(_0xa463d9){const _0x402a94=_0x2abea7();_0x1431d0[_0x402a94]='sourceEditingEnhancedLicenseKey'+_0xa463d9,'Valid'!=_0xa463d9&&_0x4b2f75();}function _0x2abea7(){const _0x46ef9e=window['String'](window['performance']['now']())['replace']('.','');let _0x3ab522='N';for(let _0xe1c303=0x0;_0xe1c303<_0x46ef9e['length'];_0xe1c303+=0x2){let _0x259b38=window['parseInt'](_0x46ef9e['substring'](_0xe1c303,_0xe1c303+0x2));_0x259b38>=0x3e&&(_0x259b38-=0x3e),_0x3ab522+=_0x11f698[_0x259b38];}return _0x3ab522;}function _0x1b1938(){const _0x4dba43=_0x2470c2['split']('.');if(0x3!=_0x4dba43['length'])return null;return _0xb9d937(_0x4dba43[0x1]);function _0xb9d937(_0x1d6d6b){const _0xf4f0a6=_0x1b716b(_0x1d6d6b);return _0xf4f0a6&&_0x1675d2()?_0xf4f0a6:null;function _0x1675d2(){const _0x11e136=_0xf4f0a6['jti'],_0x40087e=window['parseInt'](_0x11e136['substring'](_0x11e136['length']-0x8),0x10),_0x560400={..._0xf4f0a6,'jti':_0x11e136['substring'](0x0,_0x11e136['length']-0x8)};return delete _0x560400['vc'],_0x1ad0a6(_0x560400)==_0x40087e;}}}async function _0x43a88f(){let _0x9ad3da=!0x0;try{const [_0x2aafe9,_0x5a2d09,_0x801bf]=_0x2470c2['split']('.');return _0x568a32(_0x2aafe9),await _0x430f02(_0x2aafe9,_0x5a2d09,_0x801bf),_0x9ad3da;}catch{return!0x1;}function _0x568a32(_0x32638b){const _0x16530e=_0x1b716b(_0x32638b);_0x16530e&&'ES256'==_0x16530e['alg']||(_0x9ad3da=!0x1);}async function _0x430f02(_0x318740,_0x2ce8e0,_0x2d387b){const _0x197e12=window['Uint8Array']['from'](_0x2037ad(_0x2d387b),_0x3e14f4=>_0x3e14f4['charCodeAt'](0x0)),_0x384c2b=new window['TextEncoder']()['encode'](_0x318740+'.'+_0x2ce8e0),_0x417ff7=window['crypto']['subtle'];if(!_0x417ff7)return;const _0x5aa2cc=await _0x417ff7['importKey']('jwk',_0x2654de,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x417ff7['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x5aa2cc,_0x197e12,_0x384c2b)||(_0x9ad3da=!0x1);}}function _0x1b716b(_0x233fb3){return _0x233fb3['startsWith']('ey')?JSON['parse'](_0x2037ad(_0x233fb3)):null;}function _0x2037ad(_0x1dafe9){return window['atob'](_0x1dafe9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1ad0a6(_0x4c42f3){let _0x22e03a=0x1505;function _0x2f3184(_0x11bee6){for(let _0x1de0df=0x0;_0x1de0df<_0x11bee6['length'];_0x1de0df++){const _0x44fbee=_0x11bee6['charCodeAt'](_0x1de0df);_0x22e03a=(_0x22e03a<<0x5)+_0x22e03a+_0x44fbee,_0x22e03a&=_0x22e03a;}}function _0xe6bf97(_0x3d8af1){Array['isArray'](_0x3d8af1)?_0x3d8af1['forEach'](_0xe6bf97):_0x3d8af1&&'object'==typeof _0x3d8af1?Object['entries'](_0x3d8af1)['sort']()['forEach'](([_0x5c5aa0,_0x995dc2])=>{_0x2f3184(_0x5c5aa0),_0xe6bf97(_0x995dc2);}):_0x2f3184(window['String'](_0x3d8af1));}return _0xe6bf97(_0x4c42f3),_0x22e03a>>>0x0;}function _0x1fa5bf(_0x15599e){return _0x15599e['toString'](0x10)['padStart'](0x8,'0');}function _0x16a01b(_0xfb9c20){return _0xfb9c20['split']('')['reverse']()['join']('');}function _0x115916(){}_0x2bf299(await _0x2063c8());}(this);}['_createButton'](_0x477876,_0x5db4b2,_0x7d964a=!0x1){const _0x385dbc=new _0x477876(this['editor']['locale']);return _0x385dbc['set']({'withText':_0x7d964a,'isToggleable':!0x1}),_0x385dbc['bind']('isEnabled')['to'](_0x5db4b2,'isEnabled'),this['listenTo'](_0x385dbc,'execute',()=>_0x5db4b2['execute']()),_0x385dbc;}['_registerKeybindings'](){const _0x47700e=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x47700e,'Source\x20Editing\x20Enhanced')});const _0x548f36=_0x187bb7['isMac']||_0x187bb7['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x47700e,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x47700e,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x47700e,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x47700e,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x47700e,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x47700e,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x47700e,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x548f36?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x47700e,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x47700e,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x47700e,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x47700e,'Select\x20line'),'keystroke':_0x548f36?'Ctrl!+L':'Alt+L'},{'label':Q(_0x47700e,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x548f36?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x47700e,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x47700e,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x47700e,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x47700e,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x47700e,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x548f36?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0xae1ca1{constructor(_0x176f18){super(_0x176f18),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x37b918,_0x54f499){const _0xe54890=this['editor'],_0x16e06f=_0x54f499?.['rootName']??B(_0xe54890);_0xe54890['data']['set']({[_0x16e06f]:_0x37b918},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x3c3797{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x3bb874){super(_0x3bb874),_0x3bb874['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}['init'](){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4a7d93=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x39a40f;for(const _0x203350 in _0x4a7d93){const _0x322576=_0x203350,_0x126d2d=_0x4a7d93[_0x322576];if('sourceEditingEnhancedLicenseKeyValid'==_0x126d2d||'sourceEditingEnhancedLicenseKeyInvalid'==_0x126d2d||'sourceEditingEnhancedLicenseKeyExpired'==_0x126d2d||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x126d2d||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x126d2d||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x126d2d||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x126d2d){delete _0x4a7d93[_0x322576],_0x39a40f=_0x126d2d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x39a40f&&_0x4a7d93['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x39a40f&&_0x4a7d93['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x39a40f&&_0x4a7d93['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x39a40f&&_0x4a7d93['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x39a40f&&_0x4a7d93['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x39a40f&&_0x4a7d93['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x121622=this['editor'],_0x45d7b1=_0x121622['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x45d7b1&&_0x121622['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x1dc3e6('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x45d7b1&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0xf3bad5=>_0x121622['plugins']['has'](_0xf3bad5))&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20at\x20least\x20one\x20of\x20the\x20collaboration\x20features.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20collaboration\x20features.'),_0x121622['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
|
|
23
|
+
import{Command as _0x3ad7c6,PendingActions as _0x25642a,Plugin as _0x51aec1}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3acd4f,env as _0x39427b,formatHtml as _0x1eb62f,uid as _0xb23b}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x104ee3}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x1c573d,MenuBarMenuListItemButtonView as _0x1faf4e,View as _0x1bb227}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x193dd8,crosshairCursor as _0x5643e5,drawSelection as _0x344296,dropCursor as _0x2ac0de,highlightActiveLine as _0x6293bc,highlightActiveLineGutter as _0x4f1cfc,highlightSpecialChars as _0x1017bd,keymap as _0x567408,lineNumbers as _0x34cc15,rectangularSelection as _0x10a575}from'@codemirror/view';import{Compartment as _0x15a6cf,Transaction as _0x7eac2d}from'@codemirror/state';import{bracketMatching as _0x21a7d4,defaultHighlightStyle as _0xce02cc,foldGutter as _0x4fde77,foldKeymap as _0x14663f,indentOnInput as _0x212d0a,syntaxHighlighting as _0xc77b51}from'@codemirror/language';import{defaultKeymap as _0x4ec872,history as _0x48b73a,historyKeymap as _0x33b089,indentLess as _0x4652e6,indentMore as _0x257e7f,redo as _0x5cac4b,toggleTabFocusMode as _0x69685d,undo as _0x1a9d7c}from'@codemirror/commands';import{autocompletion as _0x6bb948,closeBrackets as _0x33244b,closeBracketsKeymap as _0x452fa0,completionKeymap as _0x138db2}from'@codemirror/autocomplete';import{html as _0x9393db}from'@codemirror/lang-html';import{markdown as _0x349abf}from'@codemirror/lang-markdown';import{oneDark as _0x152d00}from'@codemirror/theme-one-dark';function Q(_0x447c17,_0x457406){const t=_0x447c17['t'];switch(_0x457406){case'Edit\x20source\x20modal\x20label':return t({'string':'Edit\x20source','id':'Edit\x20source\x20modal\x20label'});case'Source':return t('Source');case'Source\x20Editing\x20Enhanced':return t('Source\x20Editing\x20Enhanced');case'Copy\x20line\x20down':return t('Copy\x20line\x20down');case'Copy\x20line\x20up':return t('Copy\x20line\x20up');case'Delete\x20line':return t('Delete\x20line');case'Indent\x20less':return t('Indent\x20less');case'Indent\x20more':return t('Indent\x20more');case'Fold\x20all':return t('Fold\x20all');case'Fold\x20code\x20(current\x20level)':return t('Fold\x20code\x20(current\x20level)');case'Move\x20line\x20down':return t('Move\x20line\x20down');case'Move\x20line\x20up':return t('Move\x20line\x20up');case'Redo\x20(keystroke)':return t({'id':'Redo\x20(keystroke)','string':'Redo'});case'Select\x20line':return t('Select\x20line');case'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode':return t('Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode');case'Toggle\x20block\x20comment':return t('Toggle\x20block\x20comment');case'Toggle\x20comment':return t('Toggle\x20comment');case'Undo\x20(keystroke)':return t({'id':'Undo\x20(keystroke)','string':'Undo'});case'Unfold\x20all':return t('Unfold\x20all');case'Unfold\x20code\x20(current\x20level)':return t('Unfold\x20code\x20(current\x20level)');case'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.':return t('Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.');case'Cancel':return t('Cancel');case'Save':return t('Save');default:return _0x457406;}}function B(_0x56ffdb){const _0x89d144=_0x56ffdb['editing']['view']['document']['roots'],_0x597cc4=_0x89d144['length'];if(0x0===_0x597cc4)throw new _0x3acd4f('source-editing-enhanced-editor-no-root',_0x56ffdb);return 0x1===_0x597cc4?_0x89d144['first']['rootName']:Array['from'](_0x56ffdb['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x3bb96a){return J(_0x3bb96a['replace'](/^[\n\s]*/g,''))?_0x3bb96a['replace'](/\s+/g,''):_0x3bb96a;}function J(_0x12b557){return _0x12b557['startsWith']('<');}function X(_0x1cb822){const _0x3ced90=[_0x193dd8['lineWrapping'],_0x6bb948(),_0x21a7d4(),_0x33244b(),_0x5643e5(),_0x344296(),_0x2ac0de(),_0x34cc15(),_0x4fde77(),_0x6293bc(),_0x4f1cfc(),_0x1017bd(),_0x48b73a(),_0x212d0a(),_0x10a575(),_0xc77b51(_0xce02cc,{'fallback':!0x0})],_0x4bf43f=new _0x15a6cf();_0x3ced90['push'](_0x4bf43f['of'](_0x193dd8['editable']['of'](!0x0))),'html'===_0x1cb822['syntaxLanguage']?_0x3ced90['push'](_0x9393db()):_0x3ced90['push'](_0x349abf());const _0x584187=(_0x4b355f=_0x1cb822['theme'])&&'default'!==_0x4b355f?'dark'===_0x4b355f?_0x152d00:_0x4b355f:null;var _0x4b355f;_0x584187&&_0x3ced90['push'](_0x584187),_0x3ced90['push'](_0x567408['of']([..._0x452fa0,..._0x4ec872,..._0x33b089,..._0x14663f,..._0x138db2,{'key':'Tab','run':_0x257e7f,'shift':_0x4652e6,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x5cac4b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x5cac4b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x1a9d7c,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x5c839f=new _0x193dd8({'extensions':_0x3ced90,'parent':_0x1cb822['parent']});return _0x69685d(_0x5c839f),{'focus':()=>{_0x5c839f['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x5c839f['focus']();},'getData':()=>_0x5c839f['state']['doc']['toString'](),'setData':_0x1737cd=>{_0x5c839f['dispatch']({'changes':{'from':0x0,'to':_0x5c839f['state']['doc']['length'],'insert':_0x1737cd},'annotations':_0x7eac2d['addToHistory']['of'](!0x1)});},'setReadOnly':_0x31dfe4=>{_0x5c839f['dispatch']({'effects':[_0x4bf43f['reconfigure'](_0x193dd8['editable']['of'](!_0x31dfe4))]});},'destroy':()=>{_0x5c839f['destroy']();},'instance':_0x5c839f};}var Z=class extends _0x1bb227{['_codeEditorApi']=null;['_options'];constructor(_0x2cad59,_0x1f5819){super(_0x2cad59),this['_options']=_0x1f5819,this['set']('isReadOnly',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-code-editor'],'tabindex':-0x1}});}['render'](){super['render'](),this['_codeEditorApi']=X({'parent':this['element'],'syntaxLanguage':this['_options']['syntaxLanguage'],'theme':this['_options']['theme']}),this['on']('change:isReadOnly',(_0x48fb72,_0x30576c,_0x23fd8a)=>{this['setReadOnly'](_0x23fd8a);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x44f24e){this['_codeEditorApi']['setData'](_0x44f24e);}['setReadOnly'](_0x4348f3){this['_codeEditorApi']['setReadOnly'](_0x4348f3);}};const G='SourceEditingEnhancedMode';var W=class extends _0x3ad7c6{constructor(_0x57fc12){super(_0x57fc12),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x25642a)['on']('change:hasAny',(_0x3c545c,_0x2a27c0,_0x109ecd)=>{_0x109ecd?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0xb375bc=this['editor'];for(const _0x332901 of _0xb375bc['commands']['names']())['replaceSource','editSource']['includes'](_0x332901)||_0xb375bc['commands']['get'](_0x332901)['forceDisabled'](G);}['_enableCommands'](){const _0x1017d2=this['editor'];for(const _0xd68620 of _0x1017d2['commands']['commands']())_0xd68620['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0xa4352c=this['editor'],_0x9f9c11=_0xa4352c['locale'],_0x209c67=_0xa4352c['plugins']['get']('Dialog'),_0xba8c45=B(_0xa4352c),_0x40643c=J(_0x48e067=_0xa4352c['data']['get']({'rootName':_0xba8c45}))?_0x1eb62f(_0x48e067):_0x48e067;var _0x48e067;const _0x3e0be1=new Z(_0x9f9c11,{'syntaxLanguage':_0xa4352c['plugins']['has']('Markdown')?'markdown':'html','theme':_0xa4352c['config']['get']('sourceEditingEnhanced.theme')});let _0x3b7eb3=!0x0;const _0x274de9=_0x4ca361=>{if(_0x3b7eb3&&Y(_0x3e0be1['getData']())!==Y(_0x40643c))return window['confirm'](Q(_0x9f9c11,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x4ca361['stop']();};_0x209c67['show']({'id':'sourceEditingEnhanced','title':Q(_0x9f9c11,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x3e0be1,'actionButtons':[{'label':Q(_0x9f9c11,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x209c67['hide']();}},{'label':Q(_0x9f9c11,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0xdeca3a=Y(_0x3e0be1['getData']())!==Y(_0x40643c);_0xdeca3a&&_0xa4352c['execute']('replaceSource',_0x3e0be1['getData']()),_0x3b7eb3=!0x1,_0x209c67['hide'](),_0xdeca3a&&'editables'in _0xa4352c['ui']['view']&&_0xa4352c['ui']['view']['editables'][_0xba8c45]['element']['focus']();},'onCreate':_0x446ec2=>{_0x446ec2['set']('isEnabled',!_0xa4352c['isReadOnly']),_0x446ec2['bind']('isEnabled')['to'](_0xa4352c,'isReadOnly',this,'isEnabled',(_0x47a240,_0x5c1d47)=>!_0x47a240&&_0x5c1d47);}}],'onHide':()=>{this['_enableCommands'](),_0x209c67['off']('hide',_0x274de9),_0x3e0be1['destroy']();},'onShow':()=>{_0x3e0be1['bind']('isReadOnly')['to'](_0xa4352c,'isReadOnly',this,'isEnabled',(_0x2a1563,_0x206c59)=>_0x2a1563||!_0x206c59),_0x3e0be1['setData'](_0x40643c),_0x3e0be1['focus'](),_0x209c67['on']('hide',_0x274de9,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x51aec1{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x25642a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x396ac2=this['editor'],_0x70d534=_0x396ac2['locale'],_0x12dc2a=new W(_0x396ac2);_0x396ac2['commands']['add']('editSource',_0x12dc2a),_0x396ac2['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x97ea48=this['_createButton'](_0x1c573d,_0x12dc2a);return _0x97ea48['set']({'label':Q(_0x70d534,'Source'),'icon':_0x104ee3,'tooltip':Q(_0x70d534,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x97ea48;}),_0x396ac2['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x91a87a=this['_createButton'](_0x1faf4e,_0x12dc2a,!0x0);return _0x91a87a['set']({'label':Q(_0x70d534,'Edit\x20source\x20modal\x20label'),'icon':_0x104ee3,'role':'menuitemcheckbox'}),_0x91a87a;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0x5ef1dc){const _0x30e4b9='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x2fab31=0x78fc0,_0x3e2c38=window['Date']['now'](),_0x3150ec=_0x5ef1dc['editor'],_0x2da3cd=new window['Promise'](_0xb7f9aa=>{_0x3150ec['once']('ready',_0xb7f9aa);}),_0x54563d={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x5f0f5a=_0x3150ec['config']['get']('licenseKey');async function _0x207ba1(){let _0x300121,_0x5358b0=null,_0x15fde1=null;try{return'GPL'==_0x5f0f5a?'NotAllowed':(_0x300121=_0x1585d2(),_0x300121?(_0x300121['usageEndpoint']&&(_0x15fde1=_0xb12c5b(_0x300121['usageEndpoint'],_0x300121['jti'])),await _0x157f28()?_0x51b1ae()?_0x38bc62()?'Expired':_0x4adbad()?('evaluation'==_0x300121['licenseType']&&(_0x5358b0=_0x3eec8c('EvaluationLimit')),await _0x2d564b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x38bc62(){const _0x38b6f9=['evaluation','trial']['includes'](_0x300121['licenseType'])?_0x3e2c38/0x3e8:0xe10*_0x2fab31;return _0x300121['exp']<_0x38b6f9;}function _0x51b1ae(){const _0x1ee123=_0x300121['features'];return!!_0x1ee123&&(!!_0x1ee123['includes']('*')||!!_0x1ee123['includes']('SEE'));}function _0x4adbad(){const _0x4a3c91=_0x300121['licensedHosts'];if(!_0x4a3c91||0x0==_0x4a3c91['length'])return!0x0;const {hostname:_0x58c525}=new URL(window['location']['href']);if(_0x4a3c91['includes'](_0x58c525))return!0x0;const _0x56fd6b=_0x58c525['split']('.');return _0x4a3c91['filter'](_0x29df89=>_0x29df89['includes']('*'))['map'](_0x393533=>_0x393533['split']('.'))['filter'](_0x5d9f44=>_0x5d9f44['length']<=_0x56fd6b['length'])['map'](_0x414e76=>Array(_0x56fd6b['length']-_0x414e76['length'])['fill']('*'===_0x414e76[0x0]?'*':'')['concat'](_0x414e76))['some'](_0x5db546=>_0x56fd6b['every']((_0x3a3393,_0x445480)=>_0x5db546[_0x445480]===_0x3a3393||'*'===_0x5db546[_0x445480]));}function _0x2d564b(){return _0x5358b0&&_0x15fde1?new window['Promise']((_0x101ec8,_0x34fa83)=>{_0x5358b0['then'](_0x101ec8,_0x34fa83),_0x15fde1['then'](_0x5aad96=>{'Valid'!=_0x5aad96&&_0x101ec8(_0x5aad96);},_0x34fa83);}):_0x5358b0||_0x15fde1||'Valid';}}function _0xb12c5b(_0x169b92,_0x5298da){return new window['Promise'](_0x3a2eea=>{if(_0x2dc3e7())return _0x3a2eea('Valid');_0x4c78ae(),_0x3150ec['decorate']('_sendUsageRequest');let _0x50c0c4=!0x1;const _0x2e4159=_0xb23b();function _0x19ce68(_0x1748de){return!!_0x1748de&&('object'==typeof _0x1748de||'function'==typeof _0x1748de)&&'function'==typeof _0x1748de['then']&&'function'==typeof _0x1748de['catch'];}function _0x4cae8f(_0x176edf){_0x2accb7(_0x176edf)['then'](_0x13c51e=>_0x13c51e&&'ok'==_0x13c51e['status']?_0x5cf009(_0x5818c2(_0x2e4159+_0x5298da))!=_0x13c51e['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4a36c4=>(_0x3ea115(),_0x4a36c4),()=>{const _0x259973=_0x34d25f();return null==_0x259973?(_0x3ea115(),'Valid'):_0x3e2c38-_0x259973>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3a2eea)['catch'](()=>{_0x3a2eea('UsageLimit');});const _0x3d1dcf=0x36ee80;function _0x3ea115(){const _0x57fac8='llct-'+_0x5cf009(_0x5818c2(_0x169b92)),_0x35331e=_0x5be530(_0x5cf009(window['Math']['ceil'](_0x3e2c38/_0x3d1dcf)));window['localStorage']['setItem'](_0x57fac8,_0x35331e);}function _0x34d25f(){const _0xb0f6b9='llct-'+_0x5cf009(_0x5818c2(_0x169b92)),_0x1129c6=window['localStorage']['getItem'](_0xb0f6b9);return _0x1129c6?window['parseInt'](_0x5be530(_0x1129c6),0x10)*_0x3d1dcf:null;}function _0x2accb7(_0x883550){return new window['Promise']((_0x38844b,_0x34ae44)=>{_0x883550['then'](_0x38844b,_0x34ae44),window['setTimeout'](_0x34ae44,0x1d4c0);});}}_0x3150ec['on']('_sendUsageRequest',(_0x4e86a1,_0x47050c)=>{if(_0x47050c[0x0]!=_0x169b92)return _0x3a2eea('UsageLimit');_0x47050c[0x1]={..._0x47050c[0x1],'requestId':_0x2e4159};},{'priority':'high'}),_0x3150ec['on']('_sendUsageRequest',_0x3858d9=>{_0x19ce68(_0x3858d9['return'])&&(_0x50c0c4=!0x0,_0x4cae8f(_0x3858d9['return']));},{'priority':'low'}),_0x2da3cd['then'](()=>{_0x50c0c4||_0x3a2eea('UsageLimit');});});function _0x2dc3e7(){return'auto'==_0x3150ec['editing']['view']['_overlayModeHint'];}function _0x4c78ae(){_0x3150ec['editing']['view']['_overlayModeHint']='auto';}}function _0x3eec8c(_0x1ff205){const _0x42ab5f=[new window['Promise'](_0x1e5e47=>setTimeout(_0x1e5e47,0x93ecc)),_0x2da3cd['then'](()=>new window['Promise'](_0x45835e=>{let _0x257a8b=0x0;_0x3150ec['model']['on']('applyOperation',(_0x5642ed,_0x58cce5)=>{_0x58cce5[0x0]['isDocumentOperation']&&_0x257a8b++,0x5e8==_0x257a8b&&(_0x45835e(),_0x5642ed['off']());});}))];return window['Promise']['race'](_0x42ab5f)['then'](()=>_0x1ff205);}async function _0x3b4c6d(){await _0x2da3cd,_0x3150ec['model']['change']=_0x3f5e38,_0x3150ec['model']['enqueueChange']=_0x3f5e38,_0x3150ec['enableReadOnlyMode']('model');}function _0x1a2d27(_0xd11862){const _0x3fc9ec=_0x345446();_0x3150ec[_0x3fc9ec]='sourceEditingEnhancedLicenseKey'+_0xd11862,'Valid'!=_0xd11862&&_0x3b4c6d();}function _0x345446(){const _0x1e25bc=window['String'](window['performance']['now']())['replace']('.','');let _0x3e7861='N';for(let _0x8b33f6=0x0;_0x8b33f6<_0x1e25bc['length'];_0x8b33f6+=0x2){let _0x35f485=window['parseInt'](_0x1e25bc['substring'](_0x8b33f6,_0x8b33f6+0x2));_0x35f485>=0x3e&&(_0x35f485-=0x3e),_0x3e7861+=_0x30e4b9[_0x35f485];}return _0x3e7861;}function _0x1585d2(){const _0x4152a3=_0x5f0f5a['split']('.');if(0x3!=_0x4152a3['length'])return null;return _0x419779(_0x4152a3[0x1]);function _0x419779(_0x6d79e2){const _0x24f225=_0x3a9db2(_0x6d79e2);return _0x24f225&&_0x3e6872()?_0x24f225:null;function _0x3e6872(){const _0xfa9017=_0x24f225['jti'],_0x42237f=window['parseInt'](_0xfa9017['substring'](_0xfa9017['length']-0x8),0x10),_0x2f360e={..._0x24f225,'jti':_0xfa9017['substring'](0x0,_0xfa9017['length']-0x8)};return delete _0x2f360e['vc'],_0x5818c2(_0x2f360e)==_0x42237f;}}}async function _0x157f28(){let _0x370185=!0x0;try{const [_0x23827b,_0x527dcc,_0x45d484]=_0x5f0f5a['split']('.');return _0x60c869(_0x23827b),await _0x36fd97(_0x23827b,_0x527dcc,_0x45d484),_0x370185;}catch{return!0x1;}function _0x60c869(_0x2a4ba5){const _0x4fd9aa=_0x3a9db2(_0x2a4ba5);_0x4fd9aa&&'ES256'==_0x4fd9aa['alg']||(_0x370185=!0x1);}async function _0x36fd97(_0x51052f,_0x3dbf5d,_0x21eac6){const _0x28db1d=window['Uint8Array']['from'](_0x187ce1(_0x21eac6),_0x53dbf2=>_0x53dbf2['charCodeAt'](0x0)),_0x94fe8a=new window['TextEncoder']()['encode'](_0x51052f+'.'+_0x3dbf5d),_0x37cc50=window['crypto']['subtle'];if(!_0x37cc50)return;const _0x32c8f6=await _0x37cc50['importKey']('jwk',_0x54563d,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x37cc50['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x32c8f6,_0x28db1d,_0x94fe8a)||(_0x370185=!0x1);}}function _0x3a9db2(_0x4a3776){return _0x4a3776['startsWith']('ey')?JSON['parse'](_0x187ce1(_0x4a3776)):null;}function _0x187ce1(_0x4c0f07){return window['atob'](_0x4c0f07['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5818c2(_0x3ae976){let _0x565bd3=0x1505;function _0x4a3d13(_0x8113b8){for(let _0xf6e4a3=0x0;_0xf6e4a3<_0x8113b8['length'];_0xf6e4a3++){const _0x4fa92f=_0x8113b8['charCodeAt'](_0xf6e4a3);_0x565bd3=(_0x565bd3<<0x5)+_0x565bd3+_0x4fa92f,_0x565bd3&=_0x565bd3;}}function _0x5747da(_0x15d9ff){Array['isArray'](_0x15d9ff)?_0x15d9ff['forEach'](_0x5747da):_0x15d9ff&&'object'==typeof _0x15d9ff?Object['entries'](_0x15d9ff)['sort']()['forEach'](([_0x29ff30,_0x583806])=>{_0x4a3d13(_0x29ff30),_0x5747da(_0x583806);}):_0x4a3d13(window['String'](_0x15d9ff));}return _0x5747da(_0x3ae976),_0x565bd3>>>0x0;}function _0x5cf009(_0x49d98c){return _0x49d98c['toString'](0x10)['padStart'](0x8,'0');}function _0x5be530(_0x2692ee){return _0x2692ee['split']('')['reverse']()['join']('');}function _0x3f5e38(){}_0x1a2d27(await _0x207ba1());}(this);}['_createButton'](_0x371e44,_0x26b3ca,_0x45c673=!0x1){const _0x898e7e=new _0x371e44(this['editor']['locale']);return _0x898e7e['set']({'withText':_0x45c673,'isToggleable':!0x1}),_0x898e7e['bind']('isEnabled')['to'](_0x26b3ca,'isEnabled'),this['listenTo'](_0x898e7e,'execute',()=>_0x26b3ca['execute']()),_0x898e7e;}['_registerKeybindings'](){const _0x30ba98=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x30ba98,'Source\x20Editing\x20Enhanced')});const _0x5f451b=_0x39427b['isMac']||_0x39427b['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x30ba98,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x30ba98,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x30ba98,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x30ba98,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x30ba98,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x30ba98,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x30ba98,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x5f451b?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x30ba98,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x30ba98,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x30ba98,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x30ba98,'Select\x20line'),'keystroke':_0x5f451b?'Ctrl!+L':'Alt+L'},{'label':Q(_0x30ba98,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x5f451b?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x30ba98,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x30ba98,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x30ba98,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x30ba98,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x30ba98,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x5f451b?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x3ad7c6{constructor(_0x276842){super(_0x276842),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x3258a5,_0x40c457){const _0x453137=this['editor'],_0x5cb7f6=_0x40c457?.['rootName']??B(_0x453137);_0x453137['data']['set']({[_0x5cb7f6]:_0x3258a5},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x51aec1{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x42cb62){super(_0x42cb62),_0x42cb62['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}['init'](){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x39962a=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x43bcf8;for(const _0xa7d8e8 in _0x39962a){const _0x506e51=_0xa7d8e8,_0x251283=_0x39962a[_0x506e51];if('sourceEditingEnhancedLicenseKeyValid'==_0x251283||'sourceEditingEnhancedLicenseKeyInvalid'==_0x251283||'sourceEditingEnhancedLicenseKeyExpired'==_0x251283||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x251283||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x251283||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x251283||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x251283){delete _0x39962a[_0x506e51],_0x43bcf8=_0x251283,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x43bcf8&&_0x39962a['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x43bcf8&&_0x39962a['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x43bcf8&&_0x39962a['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x43bcf8&&_0x39962a['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x43bcf8&&_0x39962a['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x43bcf8&&_0x39962a['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x54b1c0=this['editor'],_0x5f237b=_0x54b1c0['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x5f237b&&_0x54b1c0['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x3acd4f('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x5f237b&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x4207c9=>_0x54b1c0['plugins']['has'](_0x4207c9))&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20at\x20least\x20one\x20of\x20the\x20collaboration\x20features.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20collaboration\x20features.'),_0x54b1c0['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-source-editing-enhanced",
|
|
3
|
-
"version": "48.3.1-alpha.
|
|
3
|
+
"version": "48.3.1-alpha.1",
|
|
4
4
|
"description": "Source editing enhanced feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"dist/translations/*.umd.js"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ckeditor/ckeditor5-core": "48.3.1-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "48.3.1-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "48.3.1-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-ui": "48.3.1-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-utils": "48.3.1-alpha.
|
|
28
|
+
"@ckeditor/ckeditor5-core": "48.3.1-alpha.1",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "48.3.1-alpha.1",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "48.3.1-alpha.1",
|
|
31
|
+
"@ckeditor/ckeditor5-ui": "48.3.1-alpha.1",
|
|
32
|
+
"@ckeditor/ckeditor5-utils": "48.3.1-alpha.1",
|
|
33
33
|
"@codemirror/autocomplete": "^6.7.1",
|
|
34
34
|
"@codemirror/commands": "6.8.1",
|
|
35
35
|
"@codemirror/lang-html": "^6.0.0",
|