@ckeditor/ckeditor5-source-editing-enhanced 48.3.0-alpha.0 → 48.3.0-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 _0x53397,PendingActions as _0x354f62,Plugin as _0x35d64a}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x525cbe,env as _0x316111,formatHtml as _0x4857c8,uid as _0x140246}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x1dc415}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x290fc6,MenuBarMenuListItemButtonView as _0x268d28,View as _0x317019}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x129930,crosshairCursor as _0x502cc9,drawSelection as _0x3f15a1,dropCursor as _0x23c881,highlightActiveLine as _0x1a1c40,highlightActiveLineGutter as _0x3e6a2f,highlightSpecialChars as _0x8f26,keymap as _0x37b815,lineNumbers as _0x54c421,rectangularSelection as _0x196382}from'@codemirror/view';import{Compartment as _0xf3526e,Transaction as _0x2995b6}from'@codemirror/state';import{bracketMatching as _0x53de5a,defaultHighlightStyle as _0x860518,foldGutter as _0x1e7390,foldKeymap as _0x4681cd,indentOnInput as _0x4304dd,syntaxHighlighting as _0x22488e}from'@codemirror/language';import{defaultKeymap as _0x510ee3,history as _0x40402a,historyKeymap as _0x179b3f,indentLess as _0x18aea6,indentMore as _0x5f5191,redo as _0x36ac02,toggleTabFocusMode as _0x56278c,undo as _0x208238}from'@codemirror/commands';import{autocompletion as _0x261c75,closeBrackets as _0x4fae46,closeBracketsKeymap as _0x596ff2,completionKeymap as _0x188d7e}from'@codemirror/autocomplete';import{html as _0x2cdf5b}from'@codemirror/lang-html';import{markdown as _0x11d1e9}from'@codemirror/lang-markdown';import{oneDark as _0x5ce618}from'@codemirror/theme-one-dark';function Q(_0x1accaa,_0x577529){const t=_0x1accaa['t'];switch(_0x577529){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 _0x577529;}}function B(_0x30cbc4){const _0x38c124=_0x30cbc4['editing']['view']['document']['roots'],_0x4c2032=_0x38c124['length'];if(0x0===_0x4c2032)throw new _0x525cbe('source-editing-enhanced-editor-no-root',_0x30cbc4);return 0x1===_0x4c2032?_0x38c124['first']['rootName']:Array['from'](_0x30cbc4['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x56710f){return J(_0x56710f['replace'](/^[\n\s]*/g,''))?_0x56710f['replace'](/\s+/g,''):_0x56710f;}function J(_0x3cc1c3){return _0x3cc1c3['startsWith']('<');}function X(_0x392dbf){const _0x15d41f=[_0x129930['lineWrapping'],_0x261c75(),_0x53de5a(),_0x4fae46(),_0x502cc9(),_0x3f15a1(),_0x23c881(),_0x54c421(),_0x1e7390(),_0x1a1c40(),_0x3e6a2f(),_0x8f26(),_0x40402a(),_0x4304dd(),_0x196382(),_0x22488e(_0x860518,{'fallback':!0x0})],_0x426f0a=new _0xf3526e();_0x15d41f['push'](_0x426f0a['of'](_0x129930['editable']['of'](!0x0))),'html'===_0x392dbf['syntaxLanguage']?_0x15d41f['push'](_0x2cdf5b()):_0x15d41f['push'](_0x11d1e9());const _0x24dd6d=(_0x52d769=_0x392dbf['theme'])&&'default'!==_0x52d769?'dark'===_0x52d769?_0x5ce618:_0x52d769:null;var _0x52d769;_0x24dd6d&&_0x15d41f['push'](_0x24dd6d),_0x15d41f['push'](_0x37b815['of']([..._0x596ff2,..._0x510ee3,..._0x179b3f,..._0x4681cd,..._0x188d7e,{'key':'Tab','run':_0x5f5191,'shift':_0x18aea6,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x36ac02,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x36ac02,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x208238,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0xe4e296=new _0x129930({'extensions':_0x15d41f,'parent':_0x392dbf['parent']});return _0x56278c(_0xe4e296),{'focus':()=>{_0xe4e296['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0xe4e296['focus']();},'getData':()=>_0xe4e296['state']['doc']['toString'](),'setData':_0x39ca70=>{_0xe4e296['dispatch']({'changes':{'from':0x0,'to':_0xe4e296['state']['doc']['length'],'insert':_0x39ca70},'annotations':_0x2995b6['addToHistory']['of'](!0x1)});},'setReadOnly':_0x1464c6=>{_0xe4e296['dispatch']({'effects':[_0x426f0a['reconfigure'](_0x129930['editable']['of'](!_0x1464c6))]});},'destroy':()=>{_0xe4e296['destroy']();},'instance':_0xe4e296};}var Z=class extends _0x317019{['_codeEditorApi']=null;['_options'];constructor(_0x4e224e,_0x59aa6c){super(_0x4e224e),this['_options']=_0x59aa6c,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',(_0x4acc7c,_0x2db643,_0x17380b)=>{this['setReadOnly'](_0x17380b);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x2fcf10){this['_codeEditorApi']['setData'](_0x2fcf10);}['setReadOnly'](_0x35716b){this['_codeEditorApi']['setReadOnly'](_0x35716b);}};const G='SourceEditingEnhancedMode';var W=class extends _0x53397{constructor(_0x5c7382){super(_0x5c7382),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x354f62)['on']('change:hasAny',(_0xbfbf27,_0x5f5948,_0x1d4991)=>{_0x1d4991?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x173957=this['editor'];for(const _0x3b0b86 of _0x173957['commands']['names']())['replaceSource','editSource']['includes'](_0x3b0b86)||_0x173957['commands']['get'](_0x3b0b86)['forceDisabled'](G);}['_enableCommands'](){const _0x38ab24=this['editor'];for(const _0x1ab1a4 of _0x38ab24['commands']['commands']())_0x1ab1a4['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0x511137=this['editor'],_0x43be62=_0x511137['locale'],_0x358bb6=_0x511137['plugins']['get']('Dialog'),_0x521de6=B(_0x511137),_0x1e7abf=J(_0x353334=_0x511137['data']['get']({'rootName':_0x521de6}))?_0x4857c8(_0x353334):_0x353334;var _0x353334;const _0x164a89=new Z(_0x43be62,{'syntaxLanguage':_0x511137['plugins']['has']('Markdown')?'markdown':'html','theme':_0x511137['config']['get']('sourceEditingEnhanced.theme')});let _0x4dc209=!0x0;const _0x40bdca=_0x2760ac=>{if(_0x4dc209&&Y(_0x164a89['getData']())!==Y(_0x1e7abf))return window['confirm'](Q(_0x43be62,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x2760ac['stop']();};_0x358bb6['show']({'id':'sourceEditingEnhanced','title':Q(_0x43be62,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x164a89,'actionButtons':[{'label':Q(_0x43be62,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x358bb6['hide']();}},{'label':Q(_0x43be62,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x21e8f4=Y(_0x164a89['getData']())!==Y(_0x1e7abf);_0x21e8f4&&_0x511137['execute']('replaceSource',_0x164a89['getData']()),_0x4dc209=!0x1,_0x358bb6['hide'](),_0x21e8f4&&'editables'in _0x511137['ui']['view']&&_0x511137['ui']['view']['editables'][_0x521de6]['element']['focus']();},'onCreate':_0x26d053=>{_0x26d053['set']('isEnabled',!_0x511137['isReadOnly']),_0x26d053['bind']('isEnabled')['to'](_0x511137,'isReadOnly',this,'isEnabled',(_0x59ff9f,_0xa70fae)=>!_0x59ff9f&&_0xa70fae);}}],'onHide':()=>{this['_enableCommands'](),_0x358bb6['off']('hide',_0x40bdca),_0x164a89['destroy']();},'onShow':()=>{_0x164a89['bind']('isReadOnly')['to'](_0x511137,'isReadOnly',this,'isEnabled',(_0x1f262f,_0x5c4562)=>_0x1f262f||!_0x5c4562),_0x164a89['setData'](_0x1e7abf),_0x164a89['focus'](),_0x358bb6['on']('hide',_0x40bdca,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x35d64a{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x354f62];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x436d7e=this['editor'],_0x1f6fd1=_0x436d7e['locale'],_0x58d47e=new W(_0x436d7e);_0x436d7e['commands']['add']('editSource',_0x58d47e),_0x436d7e['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x503c8d=this['_createButton'](_0x290fc6,_0x58d47e);return _0x503c8d['set']({'label':Q(_0x1f6fd1,'Source'),'icon':_0x1dc415,'tooltip':Q(_0x1f6fd1,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x503c8d;}),_0x436d7e['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x349924=this['_createButton'](_0x268d28,_0x58d47e,!0x0);return _0x349924['set']({'label':Q(_0x1f6fd1,'Edit\x20source\x20modal\x20label'),'icon':_0x1dc415,'role':'menuitemcheckbox'}),_0x349924;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0xafa5c6){const _0x557dac='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x735d67=0x78de0,_0x480949=window['Date']['now'](),_0x5d184b=_0xafa5c6['editor'],_0x4cb4db=new window['Promise'](_0x46413a=>{_0x5d184b['once']('ready',_0x46413a);}),_0x112e19={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x5392be=_0x5d184b['config']['get']('licenseKey');async function _0x9af259(){let _0x3c553d,_0x718894=null,_0x282ac9=null;try{return'GPL'==_0x5392be?'NotAllowed':(_0x3c553d=_0xe2fd84(),_0x3c553d?(_0x3c553d['usageEndpoint']&&(_0x282ac9=_0xf821e9(_0x3c553d['usageEndpoint'],_0x3c553d['jti'])),await _0x3fbfcf()?_0x1bd836()?_0x1e2cb5()?'Expired':_0x39e22e()?('evaluation'==_0x3c553d['licenseType']&&(_0x718894=_0x78eefe('EvaluationLimit')),await _0x5cd842()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1e2cb5(){const _0x11d691=['evaluation','trial']['includes'](_0x3c553d['licenseType'])?_0x480949/0x3e8:0xe10*_0x735d67;return _0x3c553d['exp']<_0x11d691;}function _0x1bd836(){const _0x57d882=_0x3c553d['features'];return!!_0x57d882&&(!!_0x57d882['includes']('*')||!!_0x57d882['includes']('SEE'));}function _0x39e22e(){const _0x3c2d72=_0x3c553d['licensedHosts'];if(!_0x3c2d72||0x0==_0x3c2d72['length'])return!0x0;const {hostname:_0x6c8756}=new URL(window['location']['href']);if(_0x3c2d72['includes'](_0x6c8756))return!0x0;const _0x43dd53=_0x6c8756['split']('.');return _0x3c2d72['filter'](_0x3f9d5d=>_0x3f9d5d['includes']('*'))['map'](_0xbd1913=>_0xbd1913['split']('.'))['filter'](_0x439541=>_0x439541['length']<=_0x43dd53['length'])['map'](_0x16766f=>Array(_0x43dd53['length']-_0x16766f['length'])['fill']('*'===_0x16766f[0x0]?'*':'')['concat'](_0x16766f))['some'](_0x871c91=>_0x43dd53['every']((_0xeeba81,_0xb53818)=>_0x871c91[_0xb53818]===_0xeeba81||'*'===_0x871c91[_0xb53818]));}function _0x5cd842(){return _0x718894&&_0x282ac9?new window['Promise']((_0x50f6a1,_0x47fc84)=>{_0x718894['then'](_0x50f6a1,_0x47fc84),_0x282ac9['then'](_0x9efd03=>{'Valid'!=_0x9efd03&&_0x50f6a1(_0x9efd03);},_0x47fc84);}):_0x718894||_0x282ac9||'Valid';}}function _0xf821e9(_0x1c2ba4,_0x30c3cb){return new window['Promise'](_0x13abd6=>{if(_0x5602bb())return _0x13abd6('Valid');_0x3061f8(),_0x5d184b['decorate']('_sendUsageRequest');let _0x3984cf=!0x1;const _0x5eb208=_0x140246();function _0x546b41(_0x59b28a){return!!_0x59b28a&&('object'==typeof _0x59b28a||'function'==typeof _0x59b28a)&&'function'==typeof _0x59b28a['then']&&'function'==typeof _0x59b28a['catch'];}function _0x431c99(_0xb6d882){_0x40919c(_0xb6d882)['then'](_0x397ea3=>_0x397ea3&&'ok'==_0x397ea3['status']?_0x4b5444(_0x5aa5c1(_0x5eb208+_0x30c3cb))!=_0x397ea3['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2ae233=>(_0xd1d490(),_0x2ae233),()=>{const _0x1d042c=_0xcaab2a();return null==_0x1d042c?(_0xd1d490(),'Valid'):_0x480949-_0x1d042c>0x240c8400?'UsageLimit':'Valid';})['then'](_0x13abd6)['catch'](()=>{_0x13abd6('UsageLimit');});const _0x4b5134=0x36ee80;function _0xd1d490(){const _0x5c2562='llct-'+_0x4b5444(_0x5aa5c1(_0x1c2ba4)),_0x475911=_0x1bdeba(_0x4b5444(window['Math']['ceil'](_0x480949/_0x4b5134)));window['localStorage']['setItem'](_0x5c2562,_0x475911);}function _0xcaab2a(){const _0x27a9c8='llct-'+_0x4b5444(_0x5aa5c1(_0x1c2ba4)),_0x2d07c2=window['localStorage']['getItem'](_0x27a9c8);return _0x2d07c2?window['parseInt'](_0x1bdeba(_0x2d07c2),0x10)*_0x4b5134:null;}function _0x40919c(_0x134411){return new window['Promise']((_0x57cb68,_0xd455f5)=>{_0x134411['then'](_0x57cb68,_0xd455f5),window['setTimeout'](_0xd455f5,0x1d4c0);});}}_0x5d184b['on']('_sendUsageRequest',(_0xa7e31a,_0x3216ad)=>{if(_0x3216ad[0x0]!=_0x1c2ba4)return _0x13abd6('UsageLimit');_0x3216ad[0x1]={..._0x3216ad[0x1],'requestId':_0x5eb208};},{'priority':'high'}),_0x5d184b['on']('_sendUsageRequest',_0x535849=>{_0x546b41(_0x535849['return'])&&(_0x3984cf=!0x0,_0x431c99(_0x535849['return']));},{'priority':'low'}),_0x4cb4db['then'](()=>{_0x3984cf||_0x13abd6('UsageLimit');});});function _0x5602bb(){return'auto'==_0x5d184b['editing']['view']['_overlayModeHint'];}function _0x3061f8(){_0x5d184b['editing']['view']['_overlayModeHint']='auto';}}function _0x78eefe(_0x4e7522){const _0x5ae973=[new window['Promise'](_0x111f27=>setTimeout(_0x111f27,0x93ecc)),_0x4cb4db['then'](()=>new window['Promise'](_0x200e26=>{let _0x545b61=0x0;_0x5d184b['model']['on']('applyOperation',(_0x5ce497,_0x386278)=>{_0x386278[0x0]['isDocumentOperation']&&_0x545b61++,0x5e8==_0x545b61&&(_0x200e26(),_0x5ce497['off']());});}))];return window['Promise']['race'](_0x5ae973)['then'](()=>_0x4e7522);}async function _0x220aa7(){await _0x4cb4db,_0x5d184b['model']['change']=_0x22871a,_0x5d184b['model']['enqueueChange']=_0x22871a,_0x5d184b['enableReadOnlyMode']('model');}function _0x3e217e(_0x4c8492){const _0x34e9e2=_0x583eb6();_0x5d184b[_0x34e9e2]='sourceEditingEnhancedLicenseKey'+_0x4c8492,'Valid'!=_0x4c8492&&_0x220aa7();}function _0x583eb6(){const _0x4a9334=window['String'](window['performance']['now']())['replace']('.','');let _0x253c15='N';for(let _0x4e0594=0x0;_0x4e0594<_0x4a9334['length'];_0x4e0594+=0x2){let _0x4d42e1=window['parseInt'](_0x4a9334['substring'](_0x4e0594,_0x4e0594+0x2));_0x4d42e1>=0x3e&&(_0x4d42e1-=0x3e),_0x253c15+=_0x557dac[_0x4d42e1];}return _0x253c15;}function _0xe2fd84(){const _0x1221bd=_0x5392be['split']('.');if(0x3!=_0x1221bd['length'])return null;return _0xff5768(_0x1221bd[0x1]);function _0xff5768(_0x314c11){const _0x45bd6d=_0x3ebe3f(_0x314c11);return _0x45bd6d&&_0x238e6b()?_0x45bd6d:null;function _0x238e6b(){const _0x4502c7=_0x45bd6d['jti'],_0x1f3dac=window['parseInt'](_0x4502c7['substring'](_0x4502c7['length']-0x8),0x10),_0x18fd1a={..._0x45bd6d,'jti':_0x4502c7['substring'](0x0,_0x4502c7['length']-0x8)};return delete _0x18fd1a['vc'],_0x5aa5c1(_0x18fd1a)==_0x1f3dac;}}}async function _0x3fbfcf(){let _0x5ca79e=!0x0;try{const [_0x1a0065,_0x4efcea,_0x43468c]=_0x5392be['split']('.');return _0x19f7dd(_0x1a0065),await _0x58c6b9(_0x1a0065,_0x4efcea,_0x43468c),_0x5ca79e;}catch{return!0x1;}function _0x19f7dd(_0x26066d){const _0x580e2a=_0x3ebe3f(_0x26066d);_0x580e2a&&'ES256'==_0x580e2a['alg']||(_0x5ca79e=!0x1);}async function _0x58c6b9(_0x221cd3,_0x1f5e43,_0x225bc7){const _0x4dad91=window['Uint8Array']['from'](_0x54fba7(_0x225bc7),_0xd6ce60=>_0xd6ce60['charCodeAt'](0x0)),_0x3ab3b6=new window['TextEncoder']()['encode'](_0x221cd3+'.'+_0x1f5e43),_0xaf1723=window['crypto']['subtle'];if(!_0xaf1723)return;const _0x35f8cf=await _0xaf1723['importKey']('jwk',_0x112e19,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0xaf1723['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x35f8cf,_0x4dad91,_0x3ab3b6)||(_0x5ca79e=!0x1);}}function _0x3ebe3f(_0x3c8f48){return _0x3c8f48['startsWith']('ey')?JSON['parse'](_0x54fba7(_0x3c8f48)):null;}function _0x54fba7(_0x49a8db){return window['atob'](_0x49a8db['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5aa5c1(_0x357bf6){let _0x1ca3f0=0x1505;function _0xd2ed9d(_0xa09e4a){for(let _0x590bb1=0x0;_0x590bb1<_0xa09e4a['length'];_0x590bb1++){const _0x3c55cb=_0xa09e4a['charCodeAt'](_0x590bb1);_0x1ca3f0=(_0x1ca3f0<<0x5)+_0x1ca3f0+_0x3c55cb,_0x1ca3f0&=_0x1ca3f0;}}function _0x35de73(_0x1ae45f){Array['isArray'](_0x1ae45f)?_0x1ae45f['forEach'](_0x35de73):_0x1ae45f&&'object'==typeof _0x1ae45f?Object['entries'](_0x1ae45f)['sort']()['forEach'](([_0x24ab1b,_0x4d9cfc])=>{_0xd2ed9d(_0x24ab1b),_0x35de73(_0x4d9cfc);}):_0xd2ed9d(window['String'](_0x1ae45f));}return _0x35de73(_0x357bf6),_0x1ca3f0>>>0x0;}function _0x4b5444(_0x32e6aa){return _0x32e6aa['toString'](0x10)['padStart'](0x8,'0');}function _0x1bdeba(_0xfcc3f7){return _0xfcc3f7['split']('')['reverse']()['join']('');}function _0x22871a(){}_0x3e217e(await _0x9af259());}(this);}['_createButton'](_0x512565,_0x1a5bc6,_0x3425b7=!0x1){const _0x2095ce=new _0x512565(this['editor']['locale']);return _0x2095ce['set']({'withText':_0x3425b7,'isToggleable':!0x1}),_0x2095ce['bind']('isEnabled')['to'](_0x1a5bc6,'isEnabled'),this['listenTo'](_0x2095ce,'execute',()=>_0x1a5bc6['execute']()),_0x2095ce;}['_registerKeybindings'](){const _0x59476e=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x59476e,'Source\x20Editing\x20Enhanced')});const _0x411183=_0x316111['isMac']||_0x316111['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x59476e,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x59476e,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x59476e,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x59476e,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x59476e,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x59476e,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x59476e,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x411183?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x59476e,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x59476e,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x59476e,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x59476e,'Select\x20line'),'keystroke':_0x411183?'Ctrl!+L':'Alt+L'},{'label':Q(_0x59476e,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x411183?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x59476e,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x59476e,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x59476e,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x59476e,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x59476e,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x411183?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x53397{constructor(_0x1d95bf){super(_0x1d95bf),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x42d7f5,_0x4970d0){const _0x10e7d8=this['editor'],_0x500811=_0x4970d0?.['rootName']??B(_0x10e7d8);_0x10e7d8['data']['set']({[_0x500811]:_0x42d7f5},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x35d64a{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x3c4d85){super(_0x3c4d85),_0x3c4d85['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 _0xc4bbca=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xda0e41;for(const _0x42a693 in _0xc4bbca){const _0x323926=_0x42a693,_0x5d51e2=_0xc4bbca[_0x323926];if('sourceEditingEnhancedLicenseKeyValid'==_0x5d51e2||'sourceEditingEnhancedLicenseKeyInvalid'==_0x5d51e2||'sourceEditingEnhancedLicenseKeyExpired'==_0x5d51e2||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x5d51e2||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x5d51e2||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x5d51e2||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x5d51e2){delete _0xc4bbca[_0x323926],_0xda0e41=_0x5d51e2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0xda0e41&&_0xc4bbca['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0xda0e41&&_0xc4bbca['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0xda0e41&&_0xc4bbca['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0xda0e41&&_0xc4bbca['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0xda0e41&&_0xc4bbca['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0xda0e41&&_0xc4bbca['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x486161=this['editor'],_0x42dce7=_0x486161['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x42dce7&&_0x486161['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x525cbe('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x42dce7&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x5b51c9=>_0x486161['plugins']['has'](_0x5b51c9))&&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.'),_0x486161['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 _0x51fea7,PendingActions as _0x342075,Plugin as _0x4af84d}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x47be9c,env as _0x3b4eac,formatHtml as _0x19f517,uid as _0x2d3cec}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x34635e}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x1e896e,MenuBarMenuListItemButtonView as _0x3486d2,View as _0x4b8f83}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x4b2e59,crosshairCursor as _0x3d2c06,drawSelection as _0x8a1a39,dropCursor as _0x19f631,highlightActiveLine as _0x43e3ab,highlightActiveLineGutter as _0x31bad7,highlightSpecialChars as _0x48cc59,keymap as _0x164c50,lineNumbers as _0x41b886,rectangularSelection as _0x2c610b}from'@codemirror/view';import{Compartment as _0x28157a,Transaction as _0x9009c7}from'@codemirror/state';import{bracketMatching as _0x56facc,defaultHighlightStyle as _0x397a74,foldGutter as _0x4860f1,foldKeymap as _0x44abff,indentOnInput as _0x25d334,syntaxHighlighting as _0xec6cbc}from'@codemirror/language';import{defaultKeymap as _0x2c21df,history as _0x8827ae,historyKeymap as _0x4d9a86,indentLess as _0x45510f,indentMore as _0x3c54c3,redo as _0x2710d3,toggleTabFocusMode as _0x181e3f,undo as _0x517a72}from'@codemirror/commands';import{autocompletion as _0x2e77c6,closeBrackets as _0x2f3870,closeBracketsKeymap as _0x5ce32b,completionKeymap as _0x3bc2f2}from'@codemirror/autocomplete';import{html as _0x562ac8}from'@codemirror/lang-html';import{markdown as _0x3b7664}from'@codemirror/lang-markdown';import{oneDark as _0x2171fb}from'@codemirror/theme-one-dark';function Q(_0x467271,_0x4bb9b9){const t=_0x467271['t'];switch(_0x4bb9b9){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 _0x4bb9b9;}}function B(_0x1e5a77){const _0x4dc3f8=_0x1e5a77['editing']['view']['document']['roots'],_0x47cb18=_0x4dc3f8['length'];if(0x0===_0x47cb18)throw new _0x47be9c('source-editing-enhanced-editor-no-root',_0x1e5a77);return 0x1===_0x47cb18?_0x4dc3f8['first']['rootName']:Array['from'](_0x1e5a77['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x37297e){return J(_0x37297e['replace'](/^[\n\s]*/g,''))?_0x37297e['replace'](/\s+/g,''):_0x37297e;}function J(_0x589a72){return _0x589a72['startsWith']('<');}function X(_0x47f3d2){const _0x31f7db=[_0x4b2e59['lineWrapping'],_0x2e77c6(),_0x56facc(),_0x2f3870(),_0x3d2c06(),_0x8a1a39(),_0x19f631(),_0x41b886(),_0x4860f1(),_0x43e3ab(),_0x31bad7(),_0x48cc59(),_0x8827ae(),_0x25d334(),_0x2c610b(),_0xec6cbc(_0x397a74,{'fallback':!0x0})],_0x296b99=new _0x28157a();_0x31f7db['push'](_0x296b99['of'](_0x4b2e59['editable']['of'](!0x0))),'html'===_0x47f3d2['syntaxLanguage']?_0x31f7db['push'](_0x562ac8()):_0x31f7db['push'](_0x3b7664());const _0x325b86=(_0x22d0a3=_0x47f3d2['theme'])&&'default'!==_0x22d0a3?'dark'===_0x22d0a3?_0x2171fb:_0x22d0a3:null;var _0x22d0a3;_0x325b86&&_0x31f7db['push'](_0x325b86),_0x31f7db['push'](_0x164c50['of']([..._0x5ce32b,..._0x2c21df,..._0x4d9a86,..._0x44abff,..._0x3bc2f2,{'key':'Tab','run':_0x3c54c3,'shift':_0x45510f,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2710d3,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2710d3,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x517a72,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x109c70=new _0x4b2e59({'extensions':_0x31f7db,'parent':_0x47f3d2['parent']});return _0x181e3f(_0x109c70),{'focus':()=>{_0x109c70['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x109c70['focus']();},'getData':()=>_0x109c70['state']['doc']['toString'](),'setData':_0x246a2a=>{_0x109c70['dispatch']({'changes':{'from':0x0,'to':_0x109c70['state']['doc']['length'],'insert':_0x246a2a},'annotations':_0x9009c7['addToHistory']['of'](!0x1)});},'setReadOnly':_0x5629c2=>{_0x109c70['dispatch']({'effects':[_0x296b99['reconfigure'](_0x4b2e59['editable']['of'](!_0x5629c2))]});},'destroy':()=>{_0x109c70['destroy']();},'instance':_0x109c70};}var Z=class extends _0x4b8f83{['_codeEditorApi']=null;['_options'];constructor(_0x3dde9a,_0x30e0de){super(_0x3dde9a),this['_options']=_0x30e0de,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',(_0x45d9f2,_0x3c21d9,_0x5ebe2a)=>{this['setReadOnly'](_0x5ebe2a);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x77c5d8){this['_codeEditorApi']['setData'](_0x77c5d8);}['setReadOnly'](_0x3ea0b3){this['_codeEditorApi']['setReadOnly'](_0x3ea0b3);}};const G='SourceEditingEnhancedMode';var W=class extends _0x51fea7{constructor(_0x3bda99){super(_0x3bda99),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x342075)['on']('change:hasAny',(_0xf32e5c,_0x38db72,_0xf67296)=>{_0xf67296?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x2da8d1=this['editor'];for(const _0x4d9672 of _0x2da8d1['commands']['names']())['replaceSource','editSource']['includes'](_0x4d9672)||_0x2da8d1['commands']['get'](_0x4d9672)['forceDisabled'](G);}['_enableCommands'](){const _0x386da0=this['editor'];for(const _0x4c943f of _0x386da0['commands']['commands']())_0x4c943f['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0x165dee=this['editor'],_0x4a45b0=_0x165dee['locale'],_0x18c9ca=_0x165dee['plugins']['get']('Dialog'),_0x5a4da8=B(_0x165dee),_0x1e0a53=J(_0x16ef8b=_0x165dee['data']['get']({'rootName':_0x5a4da8}))?_0x19f517(_0x16ef8b):_0x16ef8b;var _0x16ef8b;const _0x4c5c7e=new Z(_0x4a45b0,{'syntaxLanguage':_0x165dee['plugins']['has']('Markdown')?'markdown':'html','theme':_0x165dee['config']['get']('sourceEditingEnhanced.theme')});let _0x32def8=!0x0;const _0x100d01=_0x4e6665=>{if(_0x32def8&&Y(_0x4c5c7e['getData']())!==Y(_0x1e0a53))return window['confirm'](Q(_0x4a45b0,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x4e6665['stop']();};_0x18c9ca['show']({'id':'sourceEditingEnhanced','title':Q(_0x4a45b0,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x4c5c7e,'actionButtons':[{'label':Q(_0x4a45b0,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x18c9ca['hide']();}},{'label':Q(_0x4a45b0,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x3a0385=Y(_0x4c5c7e['getData']())!==Y(_0x1e0a53);_0x3a0385&&_0x165dee['execute']('replaceSource',_0x4c5c7e['getData']()),_0x32def8=!0x1,_0x18c9ca['hide'](),_0x3a0385&&'editables'in _0x165dee['ui']['view']&&_0x165dee['ui']['view']['editables'][_0x5a4da8]['element']['focus']();},'onCreate':_0x390d75=>{_0x390d75['set']('isEnabled',!_0x165dee['isReadOnly']),_0x390d75['bind']('isEnabled')['to'](_0x165dee,'isReadOnly',this,'isEnabled',(_0x3492e3,_0x392fac)=>!_0x3492e3&&_0x392fac);}}],'onHide':()=>{this['_enableCommands'](),_0x18c9ca['off']('hide',_0x100d01),_0x4c5c7e['destroy']();},'onShow':()=>{_0x4c5c7e['bind']('isReadOnly')['to'](_0x165dee,'isReadOnly',this,'isEnabled',(_0x18bf5c,_0x2b4cca)=>_0x18bf5c||!_0x2b4cca),_0x4c5c7e['setData'](_0x1e0a53),_0x4c5c7e['focus'](),_0x18c9ca['on']('hide',_0x100d01,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x4af84d{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x342075];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3cc543=this['editor'],_0x4ff959=_0x3cc543['locale'],_0x4abc46=new W(_0x3cc543);_0x3cc543['commands']['add']('editSource',_0x4abc46),_0x3cc543['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x1deef6=this['_createButton'](_0x1e896e,_0x4abc46);return _0x1deef6['set']({'label':Q(_0x4ff959,'Source'),'icon':_0x34635e,'tooltip':Q(_0x4ff959,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x1deef6;}),_0x3cc543['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x59a6f6=this['_createButton'](_0x3486d2,_0x4abc46,!0x0);return _0x59a6f6['set']({'label':Q(_0x4ff959,'Edit\x20source\x20modal\x20label'),'icon':_0x34635e,'role':'menuitemcheckbox'}),_0x59a6f6;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0x31691b){const _0x307346='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x500036=0x78df8,_0x440707=window['Date']['now'](),_0x432916=_0x31691b['editor'],_0x1fa62a=new window['Promise'](_0x399731=>{_0x432916['once']('ready',_0x399731);}),_0x223457={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x41386b=_0x432916['config']['get']('licenseKey');async function _0x2583dd(){let _0x1a2893,_0x37ebf8=null,_0x3c14a8=null;try{return'GPL'==_0x41386b?'NotAllowed':(_0x1a2893=_0x475af5(),_0x1a2893?(_0x1a2893['usageEndpoint']&&(_0x3c14a8=_0x3b82e8(_0x1a2893['usageEndpoint'],_0x1a2893['jti'])),await _0x1f69a7()?_0x335c71()?_0x544d2e()?'Expired':_0x1e0029()?('evaluation'==_0x1a2893['licenseType']&&(_0x37ebf8=_0x53430d('EvaluationLimit')),await _0x11fda0()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x544d2e(){const _0x25709e=['evaluation','trial']['includes'](_0x1a2893['licenseType'])?_0x440707/0x3e8:0xe10*_0x500036;return _0x1a2893['exp']<_0x25709e;}function _0x335c71(){const _0x392af3=_0x1a2893['features'];return!!_0x392af3&&(!!_0x392af3['includes']('*')||!!_0x392af3['includes']('SEE'));}function _0x1e0029(){const _0x10709e=_0x1a2893['licensedHosts'];if(!_0x10709e||0x0==_0x10709e['length'])return!0x0;const {hostname:_0x28aeb9}=new URL(window['location']['href']);if(_0x10709e['includes'](_0x28aeb9))return!0x0;const _0xa6e5a0=_0x28aeb9['split']('.');return _0x10709e['filter'](_0x575335=>_0x575335['includes']('*'))['map'](_0x37d80e=>_0x37d80e['split']('.'))['filter'](_0x5f4460=>_0x5f4460['length']<=_0xa6e5a0['length'])['map'](_0x388a9b=>Array(_0xa6e5a0['length']-_0x388a9b['length'])['fill']('*'===_0x388a9b[0x0]?'*':'')['concat'](_0x388a9b))['some'](_0x33174f=>_0xa6e5a0['every']((_0x6d8022,_0x564056)=>_0x33174f[_0x564056]===_0x6d8022||'*'===_0x33174f[_0x564056]));}function _0x11fda0(){return _0x37ebf8&&_0x3c14a8?new window['Promise']((_0x4be5c3,_0x1d882c)=>{_0x37ebf8['then'](_0x4be5c3,_0x1d882c),_0x3c14a8['then'](_0x33b77f=>{'Valid'!=_0x33b77f&&_0x4be5c3(_0x33b77f);},_0x1d882c);}):_0x37ebf8||_0x3c14a8||'Valid';}}function _0x3b82e8(_0x5065ff,_0x2ce400){return new window['Promise'](_0x24ab09=>{if(_0x381b38())return _0x24ab09('Valid');_0x16ec74(),_0x432916['decorate']('_sendUsageRequest');let _0x5e5c1b=!0x1;const _0x1f3f93=_0x2d3cec();function _0x5a9caa(_0x4fd295){return!!_0x4fd295&&('object'==typeof _0x4fd295||'function'==typeof _0x4fd295)&&'function'==typeof _0x4fd295['then']&&'function'==typeof _0x4fd295['catch'];}function _0x5d37b9(_0x824b74){_0x3ceb70(_0x824b74)['then'](_0x3963ed=>_0x3963ed&&'ok'==_0x3963ed['status']?_0x2b9be2(_0x11cd46(_0x1f3f93+_0x2ce400))!=_0x3963ed['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4aee92=>(_0x708e2f(),_0x4aee92),()=>{const _0x25bbbd=_0x525cd7();return null==_0x25bbbd?(_0x708e2f(),'Valid'):_0x440707-_0x25bbbd>0x240c8400?'UsageLimit':'Valid';})['then'](_0x24ab09)['catch'](()=>{_0x24ab09('UsageLimit');});const _0x332483=0x36ee80;function _0x708e2f(){const _0x1c84a0='llct-'+_0x2b9be2(_0x11cd46(_0x5065ff)),_0xa4ee49=_0x3983bc(_0x2b9be2(window['Math']['ceil'](_0x440707/_0x332483)));window['localStorage']['setItem'](_0x1c84a0,_0xa4ee49);}function _0x525cd7(){const _0x19bd6d='llct-'+_0x2b9be2(_0x11cd46(_0x5065ff)),_0xf190de=window['localStorage']['getItem'](_0x19bd6d);return _0xf190de?window['parseInt'](_0x3983bc(_0xf190de),0x10)*_0x332483:null;}function _0x3ceb70(_0x1688f3){return new window['Promise']((_0x344ba7,_0x5b8a61)=>{_0x1688f3['then'](_0x344ba7,_0x5b8a61),window['setTimeout'](_0x5b8a61,0x1d4c0);});}}_0x432916['on']('_sendUsageRequest',(_0x56ec1d,_0x18e1b8)=>{if(_0x18e1b8[0x0]!=_0x5065ff)return _0x24ab09('UsageLimit');_0x18e1b8[0x1]={..._0x18e1b8[0x1],'requestId':_0x1f3f93};},{'priority':'high'}),_0x432916['on']('_sendUsageRequest',_0x36b1d2=>{_0x5a9caa(_0x36b1d2['return'])&&(_0x5e5c1b=!0x0,_0x5d37b9(_0x36b1d2['return']));},{'priority':'low'}),_0x1fa62a['then'](()=>{_0x5e5c1b||_0x24ab09('UsageLimit');});});function _0x381b38(){return'auto'==_0x432916['editing']['view']['_overlayModeHint'];}function _0x16ec74(){_0x432916['editing']['view']['_overlayModeHint']='auto';}}function _0x53430d(_0x1b5a7f){const _0x15cec6=[new window['Promise'](_0x29a701=>setTimeout(_0x29a701,0x93ecc)),_0x1fa62a['then'](()=>new window['Promise'](_0x4665b4=>{let _0x312931=0x0;_0x432916['model']['on']('applyOperation',(_0x4c5c6a,_0x416738)=>{_0x416738[0x0]['isDocumentOperation']&&_0x312931++,0x5e8==_0x312931&&(_0x4665b4(),_0x4c5c6a['off']());});}))];return window['Promise']['race'](_0x15cec6)['then'](()=>_0x1b5a7f);}async function _0xf38ce3(){await _0x1fa62a,_0x432916['model']['change']=_0xc019a6,_0x432916['model']['enqueueChange']=_0xc019a6,_0x432916['enableReadOnlyMode']('model');}function _0x13026d(_0xa7e31d){const _0x5d7ae8=_0x385db5();_0x432916[_0x5d7ae8]='sourceEditingEnhancedLicenseKey'+_0xa7e31d,'Valid'!=_0xa7e31d&&_0xf38ce3();}function _0x385db5(){const _0x4b86d7=window['String'](window['performance']['now']())['replace']('.','');let _0x20e7be='N';for(let _0x136d7a=0x0;_0x136d7a<_0x4b86d7['length'];_0x136d7a+=0x2){let _0x7a8ece=window['parseInt'](_0x4b86d7['substring'](_0x136d7a,_0x136d7a+0x2));_0x7a8ece>=0x3e&&(_0x7a8ece-=0x3e),_0x20e7be+=_0x307346[_0x7a8ece];}return _0x20e7be;}function _0x475af5(){const _0x52f7c9=_0x41386b['split']('.');if(0x3!=_0x52f7c9['length'])return null;return _0x450cbd(_0x52f7c9[0x1]);function _0x450cbd(_0x5528f0){const _0x147c2f=_0x5d7be6(_0x5528f0);return _0x147c2f&&_0x35e09c()?_0x147c2f:null;function _0x35e09c(){const _0x311524=_0x147c2f['jti'],_0x34d99b=window['parseInt'](_0x311524['substring'](_0x311524['length']-0x8),0x10),_0x23bd53={..._0x147c2f,'jti':_0x311524['substring'](0x0,_0x311524['length']-0x8)};return delete _0x23bd53['vc'],_0x11cd46(_0x23bd53)==_0x34d99b;}}}async function _0x1f69a7(){let _0x3b5755=!0x0;try{const [_0x112b68,_0x2c1f85,_0x284a12]=_0x41386b['split']('.');return _0x25c2cc(_0x112b68),await _0x427ec3(_0x112b68,_0x2c1f85,_0x284a12),_0x3b5755;}catch{return!0x1;}function _0x25c2cc(_0x1f8734){const _0x5e7178=_0x5d7be6(_0x1f8734);_0x5e7178&&'ES256'==_0x5e7178['alg']||(_0x3b5755=!0x1);}async function _0x427ec3(_0x263c06,_0x542374,_0x12f604){const _0x4499a9=window['Uint8Array']['from'](_0xde92e6(_0x12f604),_0x424223=>_0x424223['charCodeAt'](0x0)),_0x1ac7a3=new window['TextEncoder']()['encode'](_0x263c06+'.'+_0x542374),_0x7c733c=window['crypto']['subtle'];if(!_0x7c733c)return;const _0x39e6cb=await _0x7c733c['importKey']('jwk',_0x223457,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x7c733c['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x39e6cb,_0x4499a9,_0x1ac7a3)||(_0x3b5755=!0x1);}}function _0x5d7be6(_0x5383a3){return _0x5383a3['startsWith']('ey')?JSON['parse'](_0xde92e6(_0x5383a3)):null;}function _0xde92e6(_0x5c2ef1){return window['atob'](_0x5c2ef1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x11cd46(_0x147c1e){let _0x39ca1c=0x1505;function _0x26f208(_0x3a1c67){for(let _0x4d844d=0x0;_0x4d844d<_0x3a1c67['length'];_0x4d844d++){const _0x3946ea=_0x3a1c67['charCodeAt'](_0x4d844d);_0x39ca1c=(_0x39ca1c<<0x5)+_0x39ca1c+_0x3946ea,_0x39ca1c&=_0x39ca1c;}}function _0x3b9cb9(_0x1da37a){Array['isArray'](_0x1da37a)?_0x1da37a['forEach'](_0x3b9cb9):_0x1da37a&&'object'==typeof _0x1da37a?Object['entries'](_0x1da37a)['sort']()['forEach'](([_0x33d2cf,_0x24009f])=>{_0x26f208(_0x33d2cf),_0x3b9cb9(_0x24009f);}):_0x26f208(window['String'](_0x1da37a));}return _0x3b9cb9(_0x147c1e),_0x39ca1c>>>0x0;}function _0x2b9be2(_0xb07161){return _0xb07161['toString'](0x10)['padStart'](0x8,'0');}function _0x3983bc(_0x18ebc8){return _0x18ebc8['split']('')['reverse']()['join']('');}function _0xc019a6(){}_0x13026d(await _0x2583dd());}(this);}['_createButton'](_0x1be51f,_0x3bf7bb,_0x478532=!0x1){const _0x3f9af8=new _0x1be51f(this['editor']['locale']);return _0x3f9af8['set']({'withText':_0x478532,'isToggleable':!0x1}),_0x3f9af8['bind']('isEnabled')['to'](_0x3bf7bb,'isEnabled'),this['listenTo'](_0x3f9af8,'execute',()=>_0x3bf7bb['execute']()),_0x3f9af8;}['_registerKeybindings'](){const _0x36c484=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x36c484,'Source\x20Editing\x20Enhanced')});const _0x4680b1=_0x3b4eac['isMac']||_0x3b4eac['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x36c484,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x36c484,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x36c484,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x36c484,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x36c484,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x36c484,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x36c484,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x4680b1?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x36c484,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x36c484,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x36c484,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x36c484,'Select\x20line'),'keystroke':_0x4680b1?'Ctrl!+L':'Alt+L'},{'label':Q(_0x36c484,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x4680b1?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x36c484,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x36c484,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x36c484,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x36c484,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x36c484,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x4680b1?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x51fea7{constructor(_0x280173){super(_0x280173),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x5efdeb,_0x457a91){const _0x219c5e=this['editor'],_0x550a78=_0x457a91?.['rootName']??B(_0x219c5e);_0x219c5e['data']['set']({[_0x550a78]:_0x5efdeb},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x4af84d{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x1d8765){super(_0x1d8765),_0x1d8765['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 _0x19d611=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5c79d4;for(const _0x42d591 in _0x19d611){const _0x16e248=_0x42d591,_0x75598=_0x19d611[_0x16e248];if('sourceEditingEnhancedLicenseKeyValid'==_0x75598||'sourceEditingEnhancedLicenseKeyInvalid'==_0x75598||'sourceEditingEnhancedLicenseKeyExpired'==_0x75598||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x75598||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x75598||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x75598||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x75598){delete _0x19d611[_0x16e248],_0x5c79d4=_0x75598,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x5c79d4&&_0x19d611['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x5c79d4&&_0x19d611['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x5c79d4&&_0x19d611['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x5c79d4&&_0x19d611['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x5c79d4&&_0x19d611['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x5c79d4&&_0x19d611['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x5e9920=this['editor'],_0x3027a8=_0x5e9920['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x3027a8&&_0x5e9920['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x47be9c('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x3027a8&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x2cc170=>_0x5e9920['plugins']['has'](_0x2cc170))&&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.'),_0x5e9920['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.0-alpha.
|
|
3
|
+
"version": "48.3.0-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.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.
|
|
28
|
+
"@ckeditor/ckeditor5-core": "48.3.0-alpha.1",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.1",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.1",
|
|
31
|
+
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.1",
|
|
32
|
+
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.1",
|
|
33
33
|
"@codemirror/autocomplete": "^6.7.1",
|
|
34
34
|
"@codemirror/commands": "6.8.1",
|
|
35
35
|
"@codemirror/lang-html": "^6.0.0",
|