@ckeditor/ckeditor5-source-editing-enhanced 48.5.0-alpha.4 → 48.5.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +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 _0x4c7b83,PendingActions as _0x3a4ee5,Plugin as _0x2583a9}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x6f75a9,env as _0x5180b9,formatHtml as _0x5c65ca,uid as _0x59696c}from'@ckeditor/ckeditor5-utils';import{IconSource as _0xa9408e}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x2321ef,MenuBarMenuListItemButtonView as _0x2e8605,View as _0x3e11ce}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x58277b,crosshairCursor as _0x3d6043,drawSelection as _0x2bb4ad,dropCursor as _0x20d2cb,highlightActiveLine as _0x2f8a8f,highlightActiveLineGutter as _0x22e90d,highlightSpecialChars as _0x52eadf,keymap as _0xc35af1,lineNumbers as _0x7f7042,rectangularSelection as _0x2da7cf}from'@codemirror/view';import{Compartment as _0x2fd582,Transaction as _0x2b6f01}from'@codemirror/state';import{bracketMatching as _0x2032b1,defaultHighlightStyle as _0x4878c2,foldGutter as _0x20054d,foldKeymap as _0x317930,indentOnInput as _0x21fc8b,syntaxHighlighting as _0x4b4f51}from'@codemirror/language';import{defaultKeymap as _0x31cf5c,history as _0x4f4a23,historyKeymap as _0x350adf,indentLess as _0x148a81,indentMore as _0x472004,redo as _0x1cb7db,toggleTabFocusMode as _0x1cc07c,undo as _0x487f8c}from'@codemirror/commands';import{autocompletion as _0x4a9ba,closeBrackets as _0x413f0f,closeBracketsKeymap as _0x32fd54,completionKeymap as _0x567a3d}from'@codemirror/autocomplete';import{html as _0x3041ac}from'@codemirror/lang-html';import{markdown as _0x267f31}from'@codemirror/lang-markdown';import{oneDark as _0x7f589b}from'@codemirror/theme-one-dark';function Q(_0x48ae07,_0x4d608a){const t=_0x48ae07['t'];switch(_0x4d608a){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 _0x4d608a;}}function B(_0x5a30bc){const _0x27f6dc=_0x5a30bc['editing']['view']['document']['roots'],_0x95b920=_0x27f6dc['length'];if(0x0===_0x95b920)throw new _0x6f75a9('source-editing-enhanced-editor-no-root',_0x5a30bc);return 0x1===_0x95b920?_0x27f6dc['first']['rootName']:Array['from'](_0x5a30bc['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x524eb8){return J(_0x524eb8['replace'](/^[\n\s]*/g,''))?_0x524eb8['replace'](/\s+/g,''):_0x524eb8;}function J(_0x27bc87){return _0x27bc87['startsWith']('<');}function X(_0x6383e6){const _0x48ae12=[_0x58277b['lineWrapping'],_0x4a9ba(),_0x2032b1(),_0x413f0f(),_0x3d6043(),_0x2bb4ad(),_0x20d2cb(),_0x7f7042(),_0x20054d(),_0x2f8a8f(),_0x22e90d(),_0x52eadf(),_0x4f4a23(),_0x21fc8b(),_0x2da7cf(),_0x4b4f51(_0x4878c2,{'fallback':!0x0})],_0x45e8c4=new _0x2fd582();_0x48ae12['push'](_0x45e8c4['of'](_0x58277b['editable']['of'](!0x0))),'html'===_0x6383e6['syntaxLanguage']?_0x48ae12['push'](_0x3041ac()):_0x48ae12['push'](_0x267f31());const _0x478da7=(_0x5993b5=_0x6383e6['theme'])&&'default'!==_0x5993b5?'dark'===_0x5993b5?_0x7f589b:_0x5993b5:null;var _0x5993b5;_0x478da7&&_0x48ae12['push'](_0x478da7),_0x48ae12['push'](_0xc35af1['of']([..._0x32fd54,..._0x31cf5c,..._0x350adf,..._0x317930,..._0x567a3d,{'key':'Tab','run':_0x472004,'shift':_0x148a81,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x1cb7db,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x1cb7db,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x487f8c,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x4c3b95=new _0x58277b({'extensions':_0x48ae12,'parent':_0x6383e6['parent']});return _0x1cc07c(_0x4c3b95),{'focus':()=>{_0x4c3b95['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x4c3b95['focus']();},'getData':()=>_0x4c3b95['state']['doc']['toString'](),'setData':_0x474d58=>{_0x4c3b95['dispatch']({'changes':{'from':0x0,'to':_0x4c3b95['state']['doc']['length'],'insert':_0x474d58},'annotations':_0x2b6f01['addToHistory']['of'](!0x1)});},'setReadOnly':_0x19623b=>{_0x4c3b95['dispatch']({'effects':[_0x45e8c4['reconfigure'](_0x58277b['editable']['of'](!_0x19623b))]});},'destroy':()=>{_0x4c3b95['destroy']();},'instance':_0x4c3b95};}var Z=class extends _0x3e11ce{_codeEditorApi=null;_options;constructor(_0x321710,_0x5bb513){super(_0x321710),this['_options']=_0x5bb513,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',(_0x217651,_0x164159,_0xad3d2b)=>{this['setReadOnly'](_0xad3d2b);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x81b41b){this['_codeEditorApi']['setData'](_0x81b41b);}setReadOnly(_0x33a7cd){this['_codeEditorApi']['setReadOnly'](_0x33a7cd);}};const G='SourceEditingEnhancedMode';var W=class extends _0x4c7b83{constructor(_0x243be5){super(_0x243be5),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x3a4ee5)['on']('change:hasAny',(_0x440411,_0x190549,_0x24bb65)=>{_0x24bb65?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x2e1c12=this['editor'];for(const _0x51f94d of _0x2e1c12['commands']['names']())['replaceSource','editSource']['includes'](_0x51f94d)||_0x2e1c12['commands']['get'](_0x51f94d)['forceDisabled'](G);}['_enableCommands'](){const _0x463146=this['editor'];for(const _0x4604d4 of _0x463146['commands']['commands']())_0x4604d4['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x1ac4a9=this['editor'],_0x52dae1=_0x1ac4a9['locale'],_0x111c1f=_0x1ac4a9['plugins']['get']('Dialog'),_0x17c3a4=B(_0x1ac4a9),_0x17428a=_0x1ac4a9['data']['get']({'rootName':_0x17c3a4}),_0x57c192=J(_0x3f5d0f=_0x17428a)?_0x5c65ca(_0x3f5d0f):_0x3f5d0f;var _0x3f5d0f;const _0x51fe52=new Z(_0x52dae1,{'syntaxLanguage':_0x1ac4a9['plugins']['has']('Markdown')?'markdown':'html','theme':_0x1ac4a9['config']['get']('sourceEditingEnhanced.theme')});let _0x292d26=!0x0;const _0x80226a=_0x2faad1=>{if(!_0x292d26)return;return Y(_0x51fe52['getData']())!==Y(_0x57c192)?window['confirm'](Q(_0x52dae1,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x2faad1['stop']():void 0x0;};_0x111c1f['show']({'id':'sourceEditingEnhanced','title':Q(_0x52dae1,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x51fe52,'actionButtons':[{'label':Q(_0x52dae1,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x111c1f['hide']();}},{'label':Q(_0x52dae1,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x174367=Y(_0x51fe52['getData']())!==Y(_0x57c192);_0x174367&&_0x1ac4a9['execute']('replaceSource',_0x51fe52['getData']()),_0x292d26=!0x1,_0x111c1f['hide'](),_0x174367&&'editables'in _0x1ac4a9['ui']['view']&&_0x1ac4a9['ui']['view']['editables'][_0x17c3a4]['element']['focus']();},'onCreate':_0x232f48=>{_0x232f48['set']('isEnabled',!_0x1ac4a9['isReadOnly']),_0x232f48['bind']('isEnabled')['to'](_0x1ac4a9,'isReadOnly',this,'isEnabled',(_0x41a2f0,_0x483914)=>!_0x41a2f0&&_0x483914);}}],'onHide':()=>{this['_enableCommands'](),_0x111c1f['off']('hide',_0x80226a),_0x51fe52['destroy']();},'onShow':()=>{_0x51fe52['bind']('isReadOnly')['to'](_0x1ac4a9,'isReadOnly',this,'isEnabled',(_0x263682,_0x426748)=>_0x263682||!_0x426748),_0x51fe52['setData'](_0x57c192),_0x51fe52['focus'](),_0x111c1f['on']('hide',_0x80226a,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x2583a9{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x3a4ee5];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2e804a=this['editor'],_0x4f8115=_0x2e804a['locale'],_0x446208=new W(_0x2e804a);_0x2e804a['commands']['add']('editSource',_0x446208),_0x2e804a['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x4806a7=this['_createButton'](_0x2321ef,_0x446208);return _0x4806a7['set']({'label':Q(_0x4f8115,'Source'),'icon':_0xa9408e,'tooltip':Q(_0x4f8115,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x4806a7;}),_0x2e804a['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x52dcd3=this['_createButton'](_0x2e8605,_0x446208,!0x0);return _0x52dcd3['set']({'label':Q(_0x4f8115,'Edit\x20source\x20modal\x20label'),'icon':_0xa9408e,'role':'menuitemcheckbox'}),_0x52dcd3;}),this['_registerKeybindings']();}afterInit(){!async function(_0x3d1790){const _0x2858bf='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x3eaaeb=0x79428,_0x13cb45={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x3930cc(_0x3af828){const _0x14b868=new window['Promise'](_0x5867e5=>{_0x3af828['once']('ready',_0x5867e5);}),_0x362022=window['Date']['now'](),_0x433c41=_0x3af828['config']['get']('licenseKey');async function _0x372ea8(){let _0x22e643,_0x309e4e=null,_0x84178=null;try{return'GPL'==_0x433c41?'NotAllowed':(_0x22e643=_0x35f3de(),_0x22e643?(_0x22e643['usageEndpoint']&&(_0x84178=_0x3b0995(_0x22e643['usageEndpoint'],_0x22e643['jti'])),await _0x6b135c()?_0x49b211()?_0x40fde9()?'Expired':_0x41a9ec()?('evaluation'==_0x22e643['licenseType']&&(_0x309e4e=_0x1f6d9a('EvaluationLimit')),await _0x42d34d()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x40fde9(){const _0x167614=['evaluation','trial']['includes'](_0x22e643['licenseType'])?_0x362022/0x3e8:0xe10*_0x3eaaeb;return _0x22e643['exp']<_0x167614;}function _0x49b211(){const _0x290e73=_0x22e643['features'];return!!_0x290e73&&(!!_0x290e73['includes']('*')||!!_0x290e73['includes']('SEE'));}function _0x41a9ec(){const _0x59413d=_0x22e643['licensedHosts'];if(!_0x59413d||0x0==_0x59413d['length'])return!0x0;const {hostname:_0x50f789}=new URL(window['location']['href']);if(_0x59413d['includes'](_0x50f789))return!0x0;const _0x269796=_0x50f789['split']('.');return _0x59413d['filter'](_0x243cb7=>_0x243cb7['includes']('*'))['map'](_0x1f1633=>_0x1f1633['split']('.'))['filter'](_0xcca91a=>_0xcca91a['length']<=_0x269796['length'])['map'](_0x3fbce7=>Array(_0x269796['length']-_0x3fbce7['length'])['fill']('*'===_0x3fbce7[0x0]?'*':'')['concat'](_0x3fbce7))['some'](_0x556c32=>_0x269796['every']((_0x5764ee,_0x3a0903)=>_0x556c32[_0x3a0903]===_0x5764ee||'*'===_0x556c32[_0x3a0903]));}function _0x42d34d(){return _0x309e4e&&_0x84178?new window['Promise']((_0x3cbea3,_0x5d119e)=>{_0x309e4e['then'](_0x3cbea3,_0x5d119e),_0x84178['then'](_0x135a9b=>{'Valid'!=_0x135a9b&&_0x3cbea3(_0x135a9b);},_0x5d119e);}):_0x309e4e||_0x84178||'Valid';}}function _0x3b0995(_0x5e0c6e,_0x4604da){return new window['Promise'](_0x3511b8=>{if(_0x5320a0())return _0x3511b8('Valid');_0x2399b0(),_0x3af828['decorate']('_sendUsageRequest');let _0x2ac9dc=!0x1;const _0x42aa27=_0x59696c();function _0x4dc805(_0x4c8b17){return!!_0x4c8b17&&('object'==typeof _0x4c8b17||'function'==typeof _0x4c8b17)&&'function'==typeof _0x4c8b17['then']&&'function'==typeof _0x4c8b17['catch'];}function _0x3e815d(_0x278027){_0x3c531(_0x278027)['then'](_0x48b905=>_0x48b905&&'ok'==_0x48b905['status']?_0x315778(_0x550eb2(_0x42aa27+_0x4604da))!=_0x48b905['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3d2739=>(_0x263f0d(),_0x3d2739),()=>{const _0x41c90d=_0x5e8e5e();return null==_0x41c90d?(_0x263f0d(),'Valid'):_0x362022-_0x41c90d>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3511b8)['catch'](()=>{_0x3511b8('UsageLimit');});const _0x275fd9=0x36ee80;function _0x263f0d(){const _0x56aee0='llct-'+_0x315778(_0x550eb2(_0x5e0c6e)),_0x8b3f7d=_0x4abeaa(_0x315778(window['Math']['ceil'](_0x362022/_0x275fd9)));window['localStorage']['setItem'](_0x56aee0,_0x8b3f7d);}function _0x5e8e5e(){const _0xc56a3a='llct-'+_0x315778(_0x550eb2(_0x5e0c6e)),_0x2aa10a=window['localStorage']['getItem'](_0xc56a3a);return _0x2aa10a?window['parseInt'](_0x4abeaa(_0x2aa10a),0x10)*_0x275fd9:null;}function _0x3c531(_0x221d6e){return new window['Promise']((_0x3ceb3d,_0x1064d9)=>{_0x221d6e['then'](_0x3ceb3d,_0x1064d9),window['setTimeout'](_0x1064d9,0x1d4c0);});}}_0x3af828['on']('_sendUsageRequest',(_0x369955,_0xf91d2d)=>{if(_0xf91d2d[0x0]!=_0x5e0c6e)return _0x3511b8('UsageLimit');_0xf91d2d[0x1]={..._0xf91d2d[0x1],'requestId':_0x42aa27};},{'priority':'high'}),_0x3af828['on']('_sendUsageRequest',_0x3c3bed=>{_0x4dc805(_0x3c3bed['return'])&&(_0x2ac9dc=!0x0,_0x3e815d(_0x3c3bed['return']));},{'priority':'low'}),_0x14b868['then'](()=>{_0x2ac9dc||_0x3511b8('UsageLimit');});});function _0x5320a0(){return'auto'==_0x3af828['editing']['view']['_overlayModeHint'];}function _0x2399b0(){_0x3af828['editing']['view']['_overlayModeHint']='auto';}}function _0x1f6d9a(_0x3a80fb){const _0x54143b=[new window['Promise'](_0xb26a81=>setTimeout(_0xb26a81,0x93ecc)),_0x14b868['then'](()=>new window['Promise'](_0x3fb854=>{let _0x404e2c=0x0;_0x3af828['model']['on']('applyOperation',(_0x2a3386,_0xcfe546)=>{_0xcfe546[0x0]['isDocumentOperation']&&_0x404e2c++,0x5e8==_0x404e2c&&(_0x3fb854(),_0x2a3386['off']());});}))];return window['Promise']['race'](_0x54143b)['then'](()=>_0x3a80fb);}async function _0x156f6e(){await _0x14b868,_0x3af828['model']['change']=_0x53e83d,_0x3af828['model']['enqueueChange']=_0x53e83d,_0x3af828['enableReadOnlyMode']('model');}function _0x3b2f87(_0x58b0cb){const _0x27f767=_0x462c09();_0x3af828[_0x27f767]='sourceEditingEnhancedLicenseKey'+_0x58b0cb,'Valid'!=_0x58b0cb&&_0x156f6e();}function _0x462c09(){const _0x37f26d=window['String'](window['performance']['now']())['replace']('.','');let _0x85689b='R';for(let _0x20c9cd=0x0;_0x20c9cd<_0x37f26d['length'];_0x20c9cd+=0x2){let _0x4cd2ac=window['parseInt'](_0x37f26d['substring'](_0x20c9cd,_0x20c9cd+0x2));_0x4cd2ac>=0x3e&&(_0x4cd2ac-=0x3e),_0x85689b+=_0x2858bf[_0x4cd2ac];}return _0x85689b;}function _0x35f3de(){const _0x544f57=_0x433c41['split']('.');if(0x3!=_0x544f57['length'])return null;return _0x1d2a37(_0x544f57[0x1]);function _0x1d2a37(_0x16b2ba){const _0x285706=_0x5ae4fe(_0x16b2ba);return _0x285706&&_0x372caf()?_0x285706:null;function _0x372caf(){const _0x381eae=_0x285706['jti'],_0x217f57=window['parseInt'](_0x381eae['substring'](_0x381eae['length']-0x8),0x10),_0x1d381d={..._0x285706,'jti':_0x381eae['substring'](0x0,_0x381eae['length']-0x8)};return delete _0x1d381d['vc'],_0x550eb2(_0x1d381d)==_0x217f57;}}}async function _0x6b135c(){let _0x21bb54=!0x0;try{const [_0x5ea193,_0x2228d6,_0x5b97d3]=_0x433c41['split']('.');return _0x4230cc(_0x5ea193),await _0x6cb9(_0x5ea193,_0x2228d6,_0x5b97d3),_0x21bb54;}catch{return!0x1;}function _0x4230cc(_0x1cc744){const _0x14de48=_0x5ae4fe(_0x1cc744);_0x14de48&&'ES256'==_0x14de48['alg']||(_0x21bb54=!0x1);}async function _0x6cb9(_0x1fc350,_0x513cab,_0x430369){const _0x5410a0=window['Uint8Array']['from'](_0x302f4e(_0x430369),_0x480ebf=>_0x480ebf['charCodeAt'](0x0)),_0x2fc49b=new window['TextEncoder']()['encode'](_0x1fc350+'.'+_0x513cab),_0x68e69e=window['crypto']['subtle'];if(!_0x68e69e)return;const _0x569304=await _0x68e69e['importKey']('jwk',_0x13cb45,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x68e69e['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x569304,_0x5410a0,_0x2fc49b)||(_0x21bb54=!0x1);}}function _0x5ae4fe(_0x4a8d91){return _0x4a8d91['startsWith']('ey')?JSON['parse'](_0x302f4e(_0x4a8d91)):null;}function _0x302f4e(_0x14477a){return window['atob'](_0x14477a['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x550eb2(_0x2a65d7){let _0x56c7a5=0x1505;function _0x4bcf3f(_0x2dcaf3){for(let _0x411094=0x0;_0x411094<_0x2dcaf3['length'];_0x411094++){const _0xb7cbbe=_0x2dcaf3['charCodeAt'](_0x411094);_0x56c7a5=(_0x56c7a5<<0x5)+_0x56c7a5+_0xb7cbbe,_0x56c7a5&=_0x56c7a5;}}function _0xf39247(_0x19567e){Array['isArray'](_0x19567e)?_0x19567e['forEach'](_0xf39247):_0x19567e&&'object'==typeof _0x19567e?Object['entries'](_0x19567e)['sort']()['forEach'](([_0x99b3d3,_0x49421e])=>{_0x4bcf3f(_0x99b3d3),_0xf39247(_0x49421e);}):_0x4bcf3f(window['String'](_0x19567e));}return _0xf39247(_0x2a65d7),_0x56c7a5>>>0x0;}function _0x315778(_0x1e35e7){return _0x1e35e7['toString'](0x10)['padStart'](0x8,'0');}function _0x4abeaa(_0x631037){return _0x631037['split']('')['reverse']()['join']('');}function _0x53e83d(){}_0x3b2f87(await _0x372ea8());}_0x3930cc(_0x3d1790['editor']);}(this);}_createButton(_0x42bd8c,_0x4e69b9,_0x429d2c=!0x1){const _0x3925bb=new _0x42bd8c(this['editor']['locale']);return _0x3925bb['set']({'withText':_0x429d2c,'isToggleable':!0x1}),_0x3925bb['bind']('isEnabled')['to'](_0x4e69b9,'isEnabled'),this['listenTo'](_0x3925bb,'execute',()=>_0x4e69b9['execute']()),_0x3925bb;}_registerKeybindings(){const _0x409573=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x409573,'Source\x20Editing\x20Enhanced')});const _0x5eb001=_0x5180b9['isMac']||_0x5180b9['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x409573,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x409573,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x409573,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x409573,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x409573,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x409573,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x409573,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x5eb001?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x409573,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x409573,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x409573,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x409573,'Select\x20line'),'keystroke':_0x5eb001?'Ctrl!+L':'Alt+L'},{'label':Q(_0x409573,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x5eb001?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x409573,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x409573,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x409573,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x409573,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x409573,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x5eb001?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x4c7b83{constructor(_0xa8e5fd){super(_0xa8e5fd),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x1e6580,_0x4e20d5){const _0x3f1675=this['editor'],_0x5bac03=_0x4e20d5?.['rootName']??B(_0x3f1675);_0x3f1675['data']['set']({[_0x5bac03]:_0x1e6580},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x2583a9{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x594319){super(_0x594319),_0x594319['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0xfc0f45=[this['editor']];for(const _0x4bc2db of _0xfc0f45){let _0x151b04;for(const _0x1cc49a in _0x4bc2db){const _0x571a6d=_0x1cc49a,_0x4ef31f=_0x4bc2db[_0x571a6d];if('sourceEditingEnhancedLicenseKeyValid'==_0x4ef31f||'sourceEditingEnhancedLicenseKeyInvalid'==_0x4ef31f||'sourceEditingEnhancedLicenseKeyExpired'==_0x4ef31f||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x4ef31f||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x4ef31f||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x4ef31f||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x4ef31f){delete _0x4bc2db[_0x571a6d],_0x151b04=_0x4ef31f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x151b04&&_0x4bc2db['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x151b04&&_0x4bc2db['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x151b04&&_0x4bc2db['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x151b04&&_0x4bc2db['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x151b04&&_0x4bc2db['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x151b04&&_0x4bc2db['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x77e2bd=this['editor'],_0x837734=_0x77e2bd['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x837734&&_0x77e2bd['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x6f75a9('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x837734&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x4bc642=>_0x77e2bd['plugins']['has'](_0x4bc642))&&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.'),_0x77e2bd['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 _0x326d67,PendingActions as _0x57f29a,Plugin as _0x4f1cba}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x2f14dd,env as _0x128781,formatHtml as _0x36e360,uid as _0x3324dd}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x464357}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x5c6bf1,MenuBarMenuListItemButtonView as _0xb8e1cb,View as _0x318c82}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x3b21fa,crosshairCursor as _0xdf9f79,drawSelection as _0x2e6763,dropCursor as _0x58a431,highlightActiveLine as _0x42f349,highlightActiveLineGutter as _0x14f9d0,highlightSpecialChars as _0x2a0d2d,keymap as _0x2ac5b9,lineNumbers as _0x1861b2,rectangularSelection as _0xbb9115}from'@codemirror/view';import{Compartment as _0x232e13,Transaction as _0x21ad24}from'@codemirror/state';import{bracketMatching as _0x2f2018,defaultHighlightStyle as _0x252c1b,foldGutter as _0x428c84,foldKeymap as _0x1269e0,indentOnInput as _0x44e8d4,syntaxHighlighting as _0x1774aa}from'@codemirror/language';import{defaultKeymap as _0x608432,history as _0x217e91,historyKeymap as _0x87996a,indentLess as _0x400ee5,indentMore as _0x4d13ab,redo as _0x2634fd,toggleTabFocusMode as _0x43ad06,undo as _0x21dab7}from'@codemirror/commands';import{autocompletion as _0x3d6f01,closeBrackets as _0x22caaf,closeBracketsKeymap as _0x5cc231,completionKeymap as _0x1878c3}from'@codemirror/autocomplete';import{html as _0xf8cf1d}from'@codemirror/lang-html';import{markdown as _0x321adf}from'@codemirror/lang-markdown';import{oneDark as _0x571914}from'@codemirror/theme-one-dark';function Q(_0x138a81,_0x442cbf){const t=_0x138a81['t'];switch(_0x442cbf){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 _0x442cbf;}}function B(_0x5ac5f5){const _0x26c02c=_0x5ac5f5['editing']['view']['document']['roots'],_0x451225=_0x26c02c['length'];if(0x0===_0x451225)throw new _0x2f14dd('source-editing-enhanced-editor-no-root',_0x5ac5f5);return 0x1===_0x451225?_0x26c02c['first']['rootName']:Array['from'](_0x5ac5f5['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0xaf317d){return J(_0xaf317d['replace'](/^[\n\s]*/g,''))?_0xaf317d['replace'](/\s+/g,''):_0xaf317d;}function J(_0x405d0e){return _0x405d0e['startsWith']('<');}function X(_0x3b04df){const _0x4e8284=[_0x3b21fa['lineWrapping'],_0x3d6f01(),_0x2f2018(),_0x22caaf(),_0xdf9f79(),_0x2e6763(),_0x58a431(),_0x1861b2(),_0x428c84(),_0x42f349(),_0x14f9d0(),_0x2a0d2d(),_0x217e91(),_0x44e8d4(),_0xbb9115(),_0x1774aa(_0x252c1b,{'fallback':!0x0})],_0x570491=new _0x232e13();_0x4e8284['push'](_0x570491['of'](_0x3b21fa['editable']['of'](!0x0))),'html'===_0x3b04df['syntaxLanguage']?_0x4e8284['push'](_0xf8cf1d()):_0x4e8284['push'](_0x321adf());const _0x356e4f=(_0x301212=_0x3b04df['theme'])&&'default'!==_0x301212?'dark'===_0x301212?_0x571914:_0x301212:null;var _0x301212;_0x356e4f&&_0x4e8284['push'](_0x356e4f),_0x4e8284['push'](_0x2ac5b9['of']([..._0x5cc231,..._0x608432,..._0x87996a,..._0x1269e0,..._0x1878c3,{'key':'Tab','run':_0x4d13ab,'shift':_0x400ee5,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2634fd,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2634fd,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x21dab7,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x2cd05c=new _0x3b21fa({'extensions':_0x4e8284,'parent':_0x3b04df['parent']});return _0x43ad06(_0x2cd05c),{'focus':()=>{_0x2cd05c['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x2cd05c['focus']();},'getData':()=>_0x2cd05c['state']['doc']['toString'](),'setData':_0x2fea0e=>{_0x2cd05c['dispatch']({'changes':{'from':0x0,'to':_0x2cd05c['state']['doc']['length'],'insert':_0x2fea0e},'annotations':_0x21ad24['addToHistory']['of'](!0x1)});},'setReadOnly':_0x5f757f=>{_0x2cd05c['dispatch']({'effects':[_0x570491['reconfigure'](_0x3b21fa['editable']['of'](!_0x5f757f))]});},'destroy':()=>{_0x2cd05c['destroy']();},'instance':_0x2cd05c};}var Z=class extends _0x318c82{_codeEditorApi=null;_options;constructor(_0x532078,_0x11a1e0){super(_0x532078),this['_options']=_0x11a1e0,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',(_0x172717,_0x431ed3,_0x23b7a5)=>{this['setReadOnly'](_0x23b7a5);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x50fc0b){this['_codeEditorApi']['setData'](_0x50fc0b);}setReadOnly(_0x443b24){this['_codeEditorApi']['setReadOnly'](_0x443b24);}};const G='SourceEditingEnhancedMode';var W=class extends _0x326d67{constructor(_0x4a80d9){super(_0x4a80d9),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x57f29a)['on']('change:hasAny',(_0x16ceb3,_0xfef10,_0x726e6b)=>{_0x726e6b?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x33a45a=this['editor'];for(const _0x40636c of _0x33a45a['commands']['names']())['replaceSource','editSource']['includes'](_0x40636c)||_0x33a45a['commands']['get'](_0x40636c)['forceDisabled'](G);}['_enableCommands'](){const _0x9f1c5=this['editor'];for(const _0x44e68f of _0x9f1c5['commands']['commands']())_0x44e68f['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x2540da=this['editor'],_0x177b7b=_0x2540da['locale'],_0x46588a=_0x2540da['plugins']['get']('Dialog'),_0x2d5bec=B(_0x2540da),_0xe0a6b4=_0x2540da['data']['get']({'rootName':_0x2d5bec}),_0x4d2e67=J(_0x1a612a=_0xe0a6b4)?_0x36e360(_0x1a612a):_0x1a612a;var _0x1a612a;const _0x469623=new Z(_0x177b7b,{'syntaxLanguage':_0x2540da['plugins']['has']('Markdown')?'markdown':'html','theme':_0x2540da['config']['get']('sourceEditingEnhanced.theme')});let _0x598de6=!0x0;const _0x389c85=_0x2d7d6e=>{if(!_0x598de6)return;return Y(_0x469623['getData']())!==Y(_0x4d2e67)?window['confirm'](Q(_0x177b7b,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x2d7d6e['stop']():void 0x0;};_0x46588a['show']({'id':'sourceEditingEnhanced','title':Q(_0x177b7b,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x469623,'actionButtons':[{'label':Q(_0x177b7b,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x46588a['hide']();}},{'label':Q(_0x177b7b,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x29f394=Y(_0x469623['getData']())!==Y(_0x4d2e67);_0x29f394&&_0x2540da['execute']('replaceSource',_0x469623['getData']()),_0x598de6=!0x1,_0x46588a['hide'](),_0x29f394&&'editables'in _0x2540da['ui']['view']&&_0x2540da['ui']['view']['editables'][_0x2d5bec]['element']['focus']();},'onCreate':_0x5d5ac0=>{_0x5d5ac0['set']('isEnabled',!_0x2540da['isReadOnly']),_0x5d5ac0['bind']('isEnabled')['to'](_0x2540da,'isReadOnly',this,'isEnabled',(_0x56c93b,_0x680538)=>!_0x56c93b&&_0x680538);}}],'onHide':()=>{this['_enableCommands'](),_0x46588a['off']('hide',_0x389c85),_0x469623['destroy']();},'onShow':()=>{_0x469623['bind']('isReadOnly')['to'](_0x2540da,'isReadOnly',this,'isEnabled',(_0x27d9d0,_0x4377f4)=>_0x27d9d0||!_0x4377f4),_0x469623['setData'](_0x4d2e67),_0x469623['focus'](),_0x46588a['on']('hide',_0x389c85,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x4f1cba{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x57f29a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x189c0a=this['editor'],_0x1447b6=_0x189c0a['locale'],_0x389641=new W(_0x189c0a);_0x189c0a['commands']['add']('editSource',_0x389641),_0x189c0a['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x50ae04=this['_createButton'](_0x5c6bf1,_0x389641);return _0x50ae04['set']({'label':Q(_0x1447b6,'Source'),'icon':_0x464357,'tooltip':Q(_0x1447b6,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x50ae04;}),_0x189c0a['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x1f68f1=this['_createButton'](_0xb8e1cb,_0x389641,!0x0);return _0x1f68f1['set']({'label':Q(_0x1447b6,'Edit\x20source\x20modal\x20label'),'icon':_0x464357,'role':'menuitemcheckbox'}),_0x1f68f1;}),this['_registerKeybindings']();}afterInit(){!async function(_0x5e4276){const _0x312333='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x174151=0x79440,_0x7b5f74={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x30ae09(_0x105bf6){const _0x38ca2c=new window['Promise'](_0x34853f=>{_0x105bf6['once']('ready',_0x34853f);}),_0x3016a5=window['Date']['now'](),_0x263c17=_0x105bf6['config']['get']('licenseKey');async function _0x533cd9(){let _0x2772c7,_0x55eaf2=null,_0x15c93b=null;try{return'GPL'==_0x263c17?'NotAllowed':(_0x2772c7=_0x2c1ede(),_0x2772c7?(_0x2772c7['usageEndpoint']&&(_0x15c93b=_0x5ad1b8(_0x2772c7['usageEndpoint'],_0x2772c7['jti'])),await _0x199383()?_0x495cc0()?_0x1b9939()?'Expired':_0x3db4()?('evaluation'==_0x2772c7['licenseType']&&(_0x55eaf2=_0x178d0e('EvaluationLimit')),await _0x543ee1()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x1b9939(){const _0x40b213=['evaluation','trial']['includes'](_0x2772c7['licenseType'])?_0x3016a5/0x3e8:0xe10*_0x174151;return _0x2772c7['exp']<_0x40b213;}function _0x495cc0(){const _0x624020=_0x2772c7['features'];return!!_0x624020&&(!!_0x624020['includes']('*')||!!_0x624020['includes']('SEE'));}function _0x3db4(){const _0xadbb11=_0x2772c7['licensedHosts'];if(!_0xadbb11||0x0==_0xadbb11['length'])return!0x0;const {hostname:_0x545395}=new URL(window['location']['href']);if(_0xadbb11['includes'](_0x545395))return!0x0;const _0x4d12a5=_0x545395['split']('.');return _0xadbb11['filter'](_0x3d9023=>_0x3d9023['includes']('*'))['map'](_0x254fbb=>_0x254fbb['split']('.'))['filter'](_0x450d10=>_0x450d10['length']<=_0x4d12a5['length'])['map'](_0x2ec7a2=>Array(_0x4d12a5['length']-_0x2ec7a2['length'])['fill']('*'===_0x2ec7a2[0x0]?'*':'')['concat'](_0x2ec7a2))['some'](_0x3c8151=>_0x4d12a5['every']((_0x175327,_0x137b57)=>_0x3c8151[_0x137b57]===_0x175327||'*'===_0x3c8151[_0x137b57]));}function _0x543ee1(){return _0x55eaf2&&_0x15c93b?new window['Promise']((_0x28e021,_0x396e71)=>{_0x55eaf2['then'](_0x28e021,_0x396e71),_0x15c93b['then'](_0x2cda1c=>{'Valid'!=_0x2cda1c&&_0x28e021(_0x2cda1c);},_0x396e71);}):_0x55eaf2||_0x15c93b||'Valid';}}function _0x5ad1b8(_0x92828d,_0x44cd91){return new window['Promise'](_0x4f3ebb=>{if(_0x2ae80f())return _0x4f3ebb('Valid');_0x5f3b13(),_0x105bf6['decorate']('_sendUsageRequest');let _0x7ed389=!0x1;const _0x18bd09=_0x3324dd();function _0x57cd9a(_0xcfbd37){return!!_0xcfbd37&&('object'==typeof _0xcfbd37||'function'==typeof _0xcfbd37)&&'function'==typeof _0xcfbd37['then']&&'function'==typeof _0xcfbd37['catch'];}function _0x3d7977(_0x3a174c){_0x1da524(_0x3a174c)['then'](_0x77b30e=>_0x77b30e&&'ok'==_0x77b30e['status']?_0x3f83a0(_0x5ec059(_0x18bd09+_0x44cd91))!=_0x77b30e['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0xa4dfc1=>(_0x1c7195(),_0xa4dfc1),()=>{const _0x1c95d5=_0x54aaa6();return null==_0x1c95d5?(_0x1c7195(),'Valid'):_0x3016a5-_0x1c95d5>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4f3ebb)['catch'](()=>{_0x4f3ebb('UsageLimit');});const _0x22b17a=0x36ee80;function _0x1c7195(){const _0x4dcfb8='llct-'+_0x3f83a0(_0x5ec059(_0x92828d)),_0x165022=_0x4bfa76(_0x3f83a0(window['Math']['ceil'](_0x3016a5/_0x22b17a)));window['localStorage']['setItem'](_0x4dcfb8,_0x165022);}function _0x54aaa6(){const _0x1f856a='llct-'+_0x3f83a0(_0x5ec059(_0x92828d)),_0x4ed4c0=window['localStorage']['getItem'](_0x1f856a);return _0x4ed4c0?window['parseInt'](_0x4bfa76(_0x4ed4c0),0x10)*_0x22b17a:null;}function _0x1da524(_0x4fd5f9){return new window['Promise']((_0x38f471,_0x2fbc2f)=>{_0x4fd5f9['then'](_0x38f471,_0x2fbc2f),window['setTimeout'](_0x2fbc2f,0x1d4c0);});}}_0x105bf6['on']('_sendUsageRequest',(_0x942210,_0x1cbf99)=>{if(_0x1cbf99[0x0]!=_0x92828d)return _0x4f3ebb('UsageLimit');_0x1cbf99[0x1]={..._0x1cbf99[0x1],'requestId':_0x18bd09};},{'priority':'high'}),_0x105bf6['on']('_sendUsageRequest',_0x230fce=>{_0x57cd9a(_0x230fce['return'])&&(_0x7ed389=!0x0,_0x3d7977(_0x230fce['return']));},{'priority':'low'}),_0x38ca2c['then'](()=>{_0x7ed389||_0x4f3ebb('UsageLimit');});});function _0x2ae80f(){return'auto'==_0x105bf6['editing']['view']['_overlayModeHint'];}function _0x5f3b13(){_0x105bf6['editing']['view']['_overlayModeHint']='auto';}}function _0x178d0e(_0x248105){const _0x345a9a=[new window['Promise'](_0x2c9031=>setTimeout(_0x2c9031,0x93ecc)),_0x38ca2c['then'](()=>new window['Promise'](_0x169619=>{let _0xd1f8af=0x0;_0x105bf6['model']['on']('applyOperation',(_0x1f97ab,_0x156231)=>{_0x156231[0x0]['isDocumentOperation']&&_0xd1f8af++,0x5e8==_0xd1f8af&&(_0x169619(),_0x1f97ab['off']());});}))];return window['Promise']['race'](_0x345a9a)['then'](()=>_0x248105);}async function _0x265c9e(){await _0x38ca2c,_0x105bf6['model']['change']=_0x522e3e,_0x105bf6['model']['enqueueChange']=_0x522e3e,_0x105bf6['enableReadOnlyMode']('model');}function _0x856aa0(_0x23a73b){const _0x12d022=_0x400aca();_0x105bf6[_0x12d022]='sourceEditingEnhancedLicenseKey'+_0x23a73b,'Valid'!=_0x23a73b&&_0x265c9e();}function _0x400aca(){const _0x1897d3=window['String'](window['performance']['now']())['replace']('.','');let _0x5e34c2='R';for(let _0x581d7e=0x0;_0x581d7e<_0x1897d3['length'];_0x581d7e+=0x2){let _0x2cfc2c=window['parseInt'](_0x1897d3['substring'](_0x581d7e,_0x581d7e+0x2));_0x2cfc2c>=0x3e&&(_0x2cfc2c-=0x3e),_0x5e34c2+=_0x312333[_0x2cfc2c];}return _0x5e34c2;}function _0x2c1ede(){const _0x3d540c=_0x263c17['split']('.');if(0x3!=_0x3d540c['length'])return null;return _0x1d2a8c(_0x3d540c[0x1]);function _0x1d2a8c(_0x130fed){const _0x420ab2=_0xf18127(_0x130fed);return _0x420ab2&&_0x1e152d()?_0x420ab2:null;function _0x1e152d(){const _0x47fda7=_0x420ab2['jti'],_0x569da7=window['parseInt'](_0x47fda7['substring'](_0x47fda7['length']-0x8),0x10),_0x4e5230={..._0x420ab2,'jti':_0x47fda7['substring'](0x0,_0x47fda7['length']-0x8)};return delete _0x4e5230['vc'],_0x5ec059(_0x4e5230)==_0x569da7;}}}async function _0x199383(){let _0xe9c39d=!0x0;try{const [_0x342af0,_0x531aa4,_0x47c24d]=_0x263c17['split']('.');return _0x5c158c(_0x342af0),await _0x22caf3(_0x342af0,_0x531aa4,_0x47c24d),_0xe9c39d;}catch{return!0x1;}function _0x5c158c(_0x54f4a2){const _0x5536dd=_0xf18127(_0x54f4a2);_0x5536dd&&'ES256'==_0x5536dd['alg']||(_0xe9c39d=!0x1);}async function _0x22caf3(_0x498a80,_0x3f9e14,_0x39f436){const _0x587c84=window['Uint8Array']['from'](_0x151a96(_0x39f436),_0x5808ba=>_0x5808ba['charCodeAt'](0x0)),_0x3cc6bd=new window['TextEncoder']()['encode'](_0x498a80+'.'+_0x3f9e14),_0x4b10e3=window['crypto']['subtle'];if(!_0x4b10e3)return;const _0x508f7b=await _0x4b10e3['importKey']('jwk',_0x7b5f74,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4b10e3['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x508f7b,_0x587c84,_0x3cc6bd)||(_0xe9c39d=!0x1);}}function _0xf18127(_0x309c0c){return _0x309c0c['startsWith']('ey')?JSON['parse'](_0x151a96(_0x309c0c)):null;}function _0x151a96(_0x29e7ed){return window['atob'](_0x29e7ed['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5ec059(_0x37f401){let _0x368d65=0x1505;function _0x52dc18(_0x255f7a){for(let _0x4e4286=0x0;_0x4e4286<_0x255f7a['length'];_0x4e4286++){const _0x4491cd=_0x255f7a['charCodeAt'](_0x4e4286);_0x368d65=(_0x368d65<<0x5)+_0x368d65+_0x4491cd,_0x368d65&=_0x368d65;}}function _0x99ff78(_0x1c4681){Array['isArray'](_0x1c4681)?_0x1c4681['forEach'](_0x99ff78):_0x1c4681&&'object'==typeof _0x1c4681?Object['entries'](_0x1c4681)['sort']()['forEach'](([_0x36030e,_0x55e2b0])=>{_0x52dc18(_0x36030e),_0x99ff78(_0x55e2b0);}):_0x52dc18(window['String'](_0x1c4681));}return _0x99ff78(_0x37f401),_0x368d65>>>0x0;}function _0x3f83a0(_0x371ab2){return _0x371ab2['toString'](0x10)['padStart'](0x8,'0');}function _0x4bfa76(_0x457c9f){return _0x457c9f['split']('')['reverse']()['join']('');}function _0x522e3e(){}_0x856aa0(await _0x533cd9());}_0x30ae09(_0x5e4276['editor']);}(this);}_createButton(_0x87b879,_0x4576ba,_0x472063=!0x1){const _0x2bb292=new _0x87b879(this['editor']['locale']);return _0x2bb292['set']({'withText':_0x472063,'isToggleable':!0x1}),_0x2bb292['bind']('isEnabled')['to'](_0x4576ba,'isEnabled'),this['listenTo'](_0x2bb292,'execute',()=>_0x4576ba['execute']()),_0x2bb292;}_registerKeybindings(){const _0x15cb9c=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x15cb9c,'Source\x20Editing\x20Enhanced')});const _0x3a8565=_0x128781['isMac']||_0x128781['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x15cb9c,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x15cb9c,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x15cb9c,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x15cb9c,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x15cb9c,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x15cb9c,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x15cb9c,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x3a8565?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x15cb9c,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x15cb9c,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x15cb9c,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x15cb9c,'Select\x20line'),'keystroke':_0x3a8565?'Ctrl!+L':'Alt+L'},{'label':Q(_0x15cb9c,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x3a8565?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x15cb9c,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x15cb9c,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x15cb9c,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x15cb9c,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x15cb9c,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x3a8565?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x326d67{constructor(_0x4aa57d){super(_0x4aa57d),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x264ac5,_0x509a87){const _0x24c4e0=this['editor'],_0x3dec1e=_0x509a87?.['rootName']??B(_0x24c4e0);_0x24c4e0['data']['set']({[_0x3dec1e]:_0x264ac5},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x4f1cba{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x175741){super(_0x175741),_0x175741['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x56f3aa=[this['editor']];for(const _0x436fc3 of _0x56f3aa){let _0xd1c7fa;for(const _0x327f45 in _0x436fc3){const _0x358f4b=_0x327f45,_0x1449c2=_0x436fc3[_0x358f4b];if('sourceEditingEnhancedLicenseKeyValid'==_0x1449c2||'sourceEditingEnhancedLicenseKeyInvalid'==_0x1449c2||'sourceEditingEnhancedLicenseKeyExpired'==_0x1449c2||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x1449c2||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x1449c2||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x1449c2||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x1449c2){delete _0x436fc3[_0x358f4b],_0xd1c7fa=_0x1449c2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0xd1c7fa&&_0x436fc3['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0xd1c7fa&&_0x436fc3['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0xd1c7fa&&_0x436fc3['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0xd1c7fa&&_0x436fc3['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0xd1c7fa&&_0x436fc3['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0xd1c7fa&&_0x436fc3['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x147e91=this['editor'],_0x7d1d16=_0x147e91['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x7d1d16&&_0x147e91['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x2f14dd('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x7d1d16&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x2b5fb9=>_0x147e91['plugins']['has'](_0x2b5fb9))&&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.'),_0x147e91['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.5.0-alpha.
|
|
3
|
+
"version": "48.5.0-alpha.5",
|
|
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/)",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"dist/translations/*.umd.js"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ckeditor/ckeditor5-core": "48.5.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "48.5.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.5",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.5",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.5",
|
|
34
34
|
"@codemirror/autocomplete": "^6.7.1",
|
|
35
35
|
"@codemirror/commands": "6.8.1",
|
|
36
36
|
"@codemirror/lang-html": "^6.0.0",
|