@ckeditor/ckeditor5-source-editing-enhanced 48.5.0-alpha.1 → 48.5.0-alpha.2
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 _0x6b32a1,PendingActions as _0x3abdc3,Plugin as _0x56e508}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x5aeb9a,env as _0x4d09a3,formatHtml as _0x1a137c,uid as _0x1e1687}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x1ccacc}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x14cac4,MenuBarMenuListItemButtonView as _0x2931cd,View as _0x1a68e2}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x2ac7a6,crosshairCursor as _0x33f2cf,drawSelection as _0x39829e,dropCursor as _0x4e6634,highlightActiveLine as _0x50b637,highlightActiveLineGutter as _0x402f0c,highlightSpecialChars as _0x168ea2,keymap as _0x841807,lineNumbers as _0x34d537,rectangularSelection as _0x170f05}from'@codemirror/view';import{Compartment as _0x447fc2,Transaction as _0x5566c7}from'@codemirror/state';import{bracketMatching as _0x23c02e,defaultHighlightStyle as _0x50ed46,foldGutter as _0x48bfc5,foldKeymap as _0x478638,indentOnInput as _0x5a3c82,syntaxHighlighting as _0xde1a5e}from'@codemirror/language';import{defaultKeymap as _0x3ad4a8,history as _0x3f9931,historyKeymap as _0x329d49,indentLess as _0x5bc09e,indentMore as _0x3d7709,redo as _0x59f2f8,toggleTabFocusMode as _0x5a127b,undo as _0x27bfa9}from'@codemirror/commands';import{autocompletion as _0x370d69,closeBrackets as _0x4f479,closeBracketsKeymap as _0x2e2d11,completionKeymap as _0x2b5cad}from'@codemirror/autocomplete';import{html as _0x4e1f3a}from'@codemirror/lang-html';import{markdown as _0x439f75}from'@codemirror/lang-markdown';import{oneDark as _0x39c627}from'@codemirror/theme-one-dark';function Q(_0x5ad484,_0x2e411a){const t=_0x5ad484['t'];switch(_0x2e411a){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 _0x2e411a;}}function B(_0x1d6ba0){const _0x22bbe1=_0x1d6ba0['editing']['view']['document']['roots'],_0x5edd2d=_0x22bbe1['length'];if(0x0===_0x5edd2d)throw new _0x5aeb9a('source-editing-enhanced-editor-no-root',_0x1d6ba0);return 0x1===_0x5edd2d?_0x22bbe1['first']['rootName']:Array['from'](_0x1d6ba0['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x4db57b){return J(_0x4db57b['replace'](/^[\n\s]*/g,''))?_0x4db57b['replace'](/\s+/g,''):_0x4db57b;}function J(_0x1e5374){return _0x1e5374['startsWith']('<');}function X(_0x25a990){const _0x5c75f1=[_0x2ac7a6['lineWrapping'],_0x370d69(),_0x23c02e(),_0x4f479(),_0x33f2cf(),_0x39829e(),_0x4e6634(),_0x34d537(),_0x48bfc5(),_0x50b637(),_0x402f0c(),_0x168ea2(),_0x3f9931(),_0x5a3c82(),_0x170f05(),_0xde1a5e(_0x50ed46,{'fallback':!0x0})],_0x18af00=new _0x447fc2();_0x5c75f1['push'](_0x18af00['of'](_0x2ac7a6['editable']['of'](!0x0))),'html'===_0x25a990['syntaxLanguage']?_0x5c75f1['push'](_0x4e1f3a()):_0x5c75f1['push'](_0x439f75());const _0x63fcef=(_0x1b0c6d=_0x25a990['theme'])&&'default'!==_0x1b0c6d?'dark'===_0x1b0c6d?_0x39c627:_0x1b0c6d:null;var _0x1b0c6d;_0x63fcef&&_0x5c75f1['push'](_0x63fcef),_0x5c75f1['push'](_0x841807['of']([..._0x2e2d11,..._0x3ad4a8,..._0x329d49,..._0x478638,..._0x2b5cad,{'key':'Tab','run':_0x3d7709,'shift':_0x5bc09e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x59f2f8,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x59f2f8,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x27bfa9,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x5e8ebd=new _0x2ac7a6({'extensions':_0x5c75f1,'parent':_0x25a990['parent']});return _0x5a127b(_0x5e8ebd),{'focus':()=>{_0x5e8ebd['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x5e8ebd['focus']();},'getData':()=>_0x5e8ebd['state']['doc']['toString'](),'setData':_0x5037a8=>{_0x5e8ebd['dispatch']({'changes':{'from':0x0,'to':_0x5e8ebd['state']['doc']['length'],'insert':_0x5037a8},'annotations':_0x5566c7['addToHistory']['of'](!0x1)});},'setReadOnly':_0x3e6ff5=>{_0x5e8ebd['dispatch']({'effects':[_0x18af00['reconfigure'](_0x2ac7a6['editable']['of'](!_0x3e6ff5))]});},'destroy':()=>{_0x5e8ebd['destroy']();},'instance':_0x5e8ebd};}var Z=class extends _0x1a68e2{_codeEditorApi=null;_options;constructor(_0x96b6b6,_0x442e54){super(_0x96b6b6),this['_options']=_0x442e54,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',(_0x1089a5,_0x42f2b7,_0x2d7e89)=>{this['setReadOnly'](_0x2d7e89);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x470716){this['_codeEditorApi']['setData'](_0x470716);}setReadOnly(_0x3ffa89){this['_codeEditorApi']['setReadOnly'](_0x3ffa89);}};const G='SourceEditingEnhancedMode';var W=class extends _0x6b32a1{constructor(_0x54655b){super(_0x54655b),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x3abdc3)['on']('change:hasAny',(_0x2fbd5c,_0x710485,_0x4cab2d)=>{_0x4cab2d?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x53b95e=this['editor'];for(const _0x5acf32 of _0x53b95e['commands']['names']())['replaceSource','editSource']['includes'](_0x5acf32)||_0x53b95e['commands']['get'](_0x5acf32)['forceDisabled'](G);}['_enableCommands'](){const _0x34eff6=this['editor'];for(const _0x3d6232 of _0x34eff6['commands']['commands']())_0x3d6232['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x117172=this['editor'],_0x185235=_0x117172['locale'],_0x27003c=_0x117172['plugins']['get']('Dialog'),_0x5a70c4=B(_0x117172),_0x21b90c=_0x117172['data']['get']({'rootName':_0x5a70c4}),_0x26f415=J(_0x2a2fd5=_0x21b90c)?_0x1a137c(_0x2a2fd5):_0x2a2fd5;var _0x2a2fd5;const _0x14480e=new Z(_0x185235,{'syntaxLanguage':_0x117172['plugins']['has']('Markdown')?'markdown':'html','theme':_0x117172['config']['get']('sourceEditingEnhanced.theme')});let _0x22ae39=!0x0;const _0x3108ca=_0x2ae204=>{if(!_0x22ae39)return;return Y(_0x14480e['getData']())!==Y(_0x26f415)?window['confirm'](Q(_0x185235,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x2ae204['stop']():void 0x0;};_0x27003c['show']({'id':'sourceEditingEnhanced','title':Q(_0x185235,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x14480e,'actionButtons':[{'label':Q(_0x185235,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x27003c['hide']();}},{'label':Q(_0x185235,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x5dc8a4=Y(_0x14480e['getData']())!==Y(_0x26f415);_0x5dc8a4&&_0x117172['execute']('replaceSource',_0x14480e['getData']()),_0x22ae39=!0x1,_0x27003c['hide'](),_0x5dc8a4&&'editables'in _0x117172['ui']['view']&&_0x117172['ui']['view']['editables'][_0x5a70c4]['element']['focus']();},'onCreate':_0x966b81=>{_0x966b81['set']('isEnabled',!_0x117172['isReadOnly']),_0x966b81['bind']('isEnabled')['to'](_0x117172,'isReadOnly',this,'isEnabled',(_0x29f5c7,_0x434526)=>!_0x29f5c7&&_0x434526);}}],'onHide':()=>{this['_enableCommands'](),_0x27003c['off']('hide',_0x3108ca),_0x14480e['destroy']();},'onShow':()=>{_0x14480e['bind']('isReadOnly')['to'](_0x117172,'isReadOnly',this,'isEnabled',(_0x27aa1c,_0x3b4c44)=>_0x27aa1c||!_0x3b4c44),_0x14480e['setData'](_0x26f415),_0x14480e['focus'](),_0x27003c['on']('hide',_0x3108ca,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x56e508{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x3abdc3];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x31c0aa=this['editor'],_0x3d639f=_0x31c0aa['locale'],_0x2490d0=new W(_0x31c0aa);_0x31c0aa['commands']['add']('editSource',_0x2490d0),_0x31c0aa['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x25cde4=this['_createButton'](_0x14cac4,_0x2490d0);return _0x25cde4['set']({'label':Q(_0x3d639f,'Source'),'icon':_0x1ccacc,'tooltip':Q(_0x3d639f,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x25cde4;}),_0x31c0aa['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x589335=this['_createButton'](_0x2931cd,_0x2490d0,!0x0);return _0x589335['set']({'label':Q(_0x3d639f,'Edit\x20source\x20modal\x20label'),'icon':_0x1ccacc,'role':'menuitemcheckbox'}),_0x589335;}),this['_registerKeybindings']();}afterInit(){!async function(_0x19a64d){const _0x35caec='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0xe1ecb=0x793e0,_0x32d548={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x1e5712(_0x11ff97){const _0x5bed90=new window['Promise'](_0x1557cb=>{_0x11ff97['once']('ready',_0x1557cb);}),_0x334359=window['Date']['now'](),_0x3675ce=_0x11ff97['config']['get']('licenseKey');async function _0x305245(){let _0x1d3ebb,_0x1c03fb=null,_0x3a0645=null;try{return'GPL'==_0x3675ce?'NotAllowed':(_0x1d3ebb=_0x12aa4d(),_0x1d3ebb?(_0x1d3ebb['usageEndpoint']&&(_0x3a0645=_0x3db935(_0x1d3ebb['usageEndpoint'],_0x1d3ebb['jti'])),await _0xcf00da()?_0x40eb95()?_0x455795()?'Expired':_0x31906d()?('evaluation'==_0x1d3ebb['licenseType']&&(_0x1c03fb=_0x2a349d('EvaluationLimit')),await _0x10090b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x455795(){const _0x1f01f2=['evaluation','trial']['includes'](_0x1d3ebb['licenseType'])?_0x334359/0x3e8:0xe10*_0xe1ecb;return _0x1d3ebb['exp']<_0x1f01f2;}function _0x40eb95(){const _0x4722d5=_0x1d3ebb['features'];return!!_0x4722d5&&(!!_0x4722d5['includes']('*')||!!_0x4722d5['includes']('SEE'));}function _0x31906d(){const _0x4b8f20=_0x1d3ebb['licensedHosts'];if(!_0x4b8f20||0x0==_0x4b8f20['length'])return!0x0;const {hostname:_0xc2244e}=new URL(window['location']['href']);if(_0x4b8f20['includes'](_0xc2244e))return!0x0;const _0x413575=_0xc2244e['split']('.');return _0x4b8f20['filter'](_0x45c386=>_0x45c386['includes']('*'))['map'](_0x4bf3d9=>_0x4bf3d9['split']('.'))['filter'](_0x23ee57=>_0x23ee57['length']<=_0x413575['length'])['map'](_0x45e5c3=>Array(_0x413575['length']-_0x45e5c3['length'])['fill']('*'===_0x45e5c3[0x0]?'*':'')['concat'](_0x45e5c3))['some'](_0x5b15d0=>_0x413575['every']((_0x5a5603,_0x10e5c4)=>_0x5b15d0[_0x10e5c4]===_0x5a5603||'*'===_0x5b15d0[_0x10e5c4]));}function _0x10090b(){return _0x1c03fb&&_0x3a0645?new window['Promise']((_0x2a337a,_0x52eefa)=>{_0x1c03fb['then'](_0x2a337a,_0x52eefa),_0x3a0645['then'](_0x594722=>{'Valid'!=_0x594722&&_0x2a337a(_0x594722);},_0x52eefa);}):_0x1c03fb||_0x3a0645||'Valid';}}function _0x3db935(_0x237609,_0x12904a){return new window['Promise'](_0x2551f9=>{if(_0x4bbf3f())return _0x2551f9('Valid');_0x59eadf(),_0x11ff97['decorate']('_sendUsageRequest');let _0x4df55c=!0x1;const _0x1cb3a1=_0x1e1687();function _0x3a5e4d(_0x496534){return!!_0x496534&&('object'==typeof _0x496534||'function'==typeof _0x496534)&&'function'==typeof _0x496534['then']&&'function'==typeof _0x496534['catch'];}function _0x2894cd(_0x3f06eb){_0x13af54(_0x3f06eb)['then'](_0xd28617=>_0xd28617&&'ok'==_0xd28617['status']?_0x27cdd7(_0xadf6d1(_0x1cb3a1+_0x12904a))!=_0xd28617['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2f20aa=>(_0x48eefd(),_0x2f20aa),()=>{const _0x564f55=_0x410883();return null==_0x564f55?(_0x48eefd(),'Valid'):_0x334359-_0x564f55>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2551f9)['catch'](()=>{_0x2551f9('UsageLimit');});const _0x9a7225=0x36ee80;function _0x48eefd(){const _0xe17bc7='llct-'+_0x27cdd7(_0xadf6d1(_0x237609)),_0x548275=_0x507224(_0x27cdd7(window['Math']['ceil'](_0x334359/_0x9a7225)));window['localStorage']['setItem'](_0xe17bc7,_0x548275);}function _0x410883(){const _0x248926='llct-'+_0x27cdd7(_0xadf6d1(_0x237609)),_0xde0fcf=window['localStorage']['getItem'](_0x248926);return _0xde0fcf?window['parseInt'](_0x507224(_0xde0fcf),0x10)*_0x9a7225:null;}function _0x13af54(_0x3aafc0){return new window['Promise']((_0xdd7336,_0x185964)=>{_0x3aafc0['then'](_0xdd7336,_0x185964),window['setTimeout'](_0x185964,0x1d4c0);});}}_0x11ff97['on']('_sendUsageRequest',(_0x56806f,_0x197753)=>{if(_0x197753[0x0]!=_0x237609)return _0x2551f9('UsageLimit');_0x197753[0x1]={..._0x197753[0x1],'requestId':_0x1cb3a1};},{'priority':'high'}),_0x11ff97['on']('_sendUsageRequest',_0xbd1b58=>{_0x3a5e4d(_0xbd1b58['return'])&&(_0x4df55c=!0x0,_0x2894cd(_0xbd1b58['return']));},{'priority':'low'}),_0x5bed90['then'](()=>{_0x4df55c||_0x2551f9('UsageLimit');});});function _0x4bbf3f(){return'auto'==_0x11ff97['editing']['view']['_overlayModeHint'];}function _0x59eadf(){_0x11ff97['editing']['view']['_overlayModeHint']='auto';}}function _0x2a349d(_0x22d597){const _0x44e904=[new window['Promise'](_0x10057e=>setTimeout(_0x10057e,0x93ecc)),_0x5bed90['then'](()=>new window['Promise'](_0x430c5e=>{let _0x3c06a3=0x0;_0x11ff97['model']['on']('applyOperation',(_0x42612e,_0x1629db)=>{_0x1629db[0x0]['isDocumentOperation']&&_0x3c06a3++,0x5e8==_0x3c06a3&&(_0x430c5e(),_0x42612e['off']());});}))];return window['Promise']['race'](_0x44e904)['then'](()=>_0x22d597);}async function _0x546347(){await _0x5bed90,_0x11ff97['model']['change']=_0x18ea1d,_0x11ff97['model']['enqueueChange']=_0x18ea1d,_0x11ff97['enableReadOnlyMode']('model');}function _0x48dd48(_0x590967){const _0x255db2=_0x47f958();_0x11ff97[_0x255db2]='sourceEditingEnhancedLicenseKey'+_0x590967,'Valid'!=_0x590967&&_0x546347();}function _0x47f958(){const _0x5ca81c=window['String'](window['performance']['now']())['replace']('.','');let _0x49bb6c='R';for(let _0x97f22=0x0;_0x97f22<_0x5ca81c['length'];_0x97f22+=0x2){let _0x261fe2=window['parseInt'](_0x5ca81c['substring'](_0x97f22,_0x97f22+0x2));_0x261fe2>=0x3e&&(_0x261fe2-=0x3e),_0x49bb6c+=_0x35caec[_0x261fe2];}return _0x49bb6c;}function _0x12aa4d(){const _0xe3c1c7=_0x3675ce['split']('.');if(0x3!=_0xe3c1c7['length'])return null;return _0x467dcc(_0xe3c1c7[0x1]);function _0x467dcc(_0x4bbbaa){const _0x4edbf0=_0x1b5754(_0x4bbbaa);return _0x4edbf0&&_0x385c27()?_0x4edbf0:null;function _0x385c27(){const _0x116c22=_0x4edbf0['jti'],_0x29fbef=window['parseInt'](_0x116c22['substring'](_0x116c22['length']-0x8),0x10),_0x17521d={..._0x4edbf0,'jti':_0x116c22['substring'](0x0,_0x116c22['length']-0x8)};return delete _0x17521d['vc'],_0xadf6d1(_0x17521d)==_0x29fbef;}}}async function _0xcf00da(){let _0x3a93a7=!0x0;try{const [_0xf6fc2f,_0x16ff8f,_0x3cb287]=_0x3675ce['split']('.');return _0x4b1599(_0xf6fc2f),await _0x47de6b(_0xf6fc2f,_0x16ff8f,_0x3cb287),_0x3a93a7;}catch{return!0x1;}function _0x4b1599(_0x364a53){const _0x397e4a=_0x1b5754(_0x364a53);_0x397e4a&&'ES256'==_0x397e4a['alg']||(_0x3a93a7=!0x1);}async function _0x47de6b(_0x2a4fc9,_0x5c0295,_0x33c8ea){const _0x34d964=window['Uint8Array']['from'](_0x3f9c6e(_0x33c8ea),_0x43bc34=>_0x43bc34['charCodeAt'](0x0)),_0x503295=new window['TextEncoder']()['encode'](_0x2a4fc9+'.'+_0x5c0295),_0x4677f6=window['crypto']['subtle'];if(!_0x4677f6)return;const _0x379b90=await _0x4677f6['importKey']('jwk',_0x32d548,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4677f6['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x379b90,_0x34d964,_0x503295)||(_0x3a93a7=!0x1);}}function _0x1b5754(_0x395d12){return _0x395d12['startsWith']('ey')?JSON['parse'](_0x3f9c6e(_0x395d12)):null;}function _0x3f9c6e(_0x5973c1){return window['atob'](_0x5973c1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0xadf6d1(_0x2756bf){let _0x2c2eed=0x1505;function _0xa42a1a(_0xe0ccd0){for(let _0x39e8a6=0x0;_0x39e8a6<_0xe0ccd0['length'];_0x39e8a6++){const _0x4935ea=_0xe0ccd0['charCodeAt'](_0x39e8a6);_0x2c2eed=(_0x2c2eed<<0x5)+_0x2c2eed+_0x4935ea,_0x2c2eed&=_0x2c2eed;}}function _0x3c02ef(_0x3310fa){Array['isArray'](_0x3310fa)?_0x3310fa['forEach'](_0x3c02ef):_0x3310fa&&'object'==typeof _0x3310fa?Object['entries'](_0x3310fa)['sort']()['forEach'](([_0x33f9ab,_0x152e05])=>{_0xa42a1a(_0x33f9ab),_0x3c02ef(_0x152e05);}):_0xa42a1a(window['String'](_0x3310fa));}return _0x3c02ef(_0x2756bf),_0x2c2eed>>>0x0;}function _0x27cdd7(_0x388fad){return _0x388fad['toString'](0x10)['padStart'](0x8,'0');}function _0x507224(_0x404dd0){return _0x404dd0['split']('')['reverse']()['join']('');}function _0x18ea1d(){}_0x48dd48(await _0x305245());}_0x1e5712(_0x19a64d['editor']);}(this);}_createButton(_0x51e2b3,_0x2221b3,_0x32960d=!0x1){const _0x284a3c=new _0x51e2b3(this['editor']['locale']);return _0x284a3c['set']({'withText':_0x32960d,'isToggleable':!0x1}),_0x284a3c['bind']('isEnabled')['to'](_0x2221b3,'isEnabled'),this['listenTo'](_0x284a3c,'execute',()=>_0x2221b3['execute']()),_0x284a3c;}_registerKeybindings(){const _0x222360=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x222360,'Source\x20Editing\x20Enhanced')});const _0x54a4d3=_0x4d09a3['isMac']||_0x4d09a3['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x222360,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x222360,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x222360,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x222360,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x222360,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x222360,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x222360,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x54a4d3?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x222360,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x222360,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x222360,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x222360,'Select\x20line'),'keystroke':_0x54a4d3?'Ctrl!+L':'Alt+L'},{'label':Q(_0x222360,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x54a4d3?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x222360,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x222360,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x222360,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x222360,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x222360,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x54a4d3?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x6b32a1{constructor(_0x1f0b44){super(_0x1f0b44),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x18a32c,_0x56e462){const _0x3cad4c=this['editor'],_0x20f194=_0x56e462?.['rootName']??B(_0x3cad4c);_0x3cad4c['data']['set']({[_0x20f194]:_0x18a32c},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x56e508{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x28abfe){super(_0x28abfe),_0x28abfe['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 _0x12ea1c=[this['editor']];for(const _0x304295 of _0x12ea1c){let _0x274ae7;for(const _0x537a29 in _0x304295){const _0x15eefb=_0x537a29,_0x476960=_0x304295[_0x15eefb];if('sourceEditingEnhancedLicenseKeyValid'==_0x476960||'sourceEditingEnhancedLicenseKeyInvalid'==_0x476960||'sourceEditingEnhancedLicenseKeyExpired'==_0x476960||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x476960||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x476960||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x476960||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x476960){delete _0x304295[_0x15eefb],_0x274ae7=_0x476960,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x274ae7&&_0x304295['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x274ae7&&_0x304295['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x274ae7&&_0x304295['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x274ae7&&_0x304295['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x274ae7&&_0x304295['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x274ae7&&_0x304295['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x34e391=this['editor'],_0x4c53d0=_0x34e391['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x4c53d0&&_0x34e391['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x5aeb9a('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x4c53d0&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x3bd212=>_0x34e391['plugins']['has'](_0x3bd212))&&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.'),_0x34e391['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 _0x3513e7,PendingActions as _0x52a889,Plugin as _0x5b31a9}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x3748d7,env as _0x48c461,formatHtml as _0xadc358,uid as _0x273aa2}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x355428}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0xcc2b3,MenuBarMenuListItemButtonView as _0xbcc816,View as _0x34fa7e}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x21fe77,crosshairCursor as _0x10ca4e,drawSelection as _0x510e94,dropCursor as _0x434b8a,highlightActiveLine as _0x3d60e1,highlightActiveLineGutter as _0x3d256d,highlightSpecialChars as _0x10d2e8,keymap as _0x444c4c,lineNumbers as _0xb46127,rectangularSelection as _0x463753}from'@codemirror/view';import{Compartment as _0x32e4cc,Transaction as _0x2bb007}from'@codemirror/state';import{bracketMatching as _0x3a8d54,defaultHighlightStyle as _0x3d4511,foldGutter as _0x59601a,foldKeymap as _0x2c9526,indentOnInput as _0x2e914e,syntaxHighlighting as _0x1d547e}from'@codemirror/language';import{defaultKeymap as _0x1c4733,history as _0x20454f,historyKeymap as _0x269a30,indentLess as _0x50321b,indentMore as _0xdd74d1,redo as _0x2deaf7,toggleTabFocusMode as _0x10777a,undo as _0xecda6}from'@codemirror/commands';import{autocompletion as _0xd1947d,closeBrackets as _0x595cc8,closeBracketsKeymap as _0x5b5436,completionKeymap as _0x2c0593}from'@codemirror/autocomplete';import{html as _0x58b362}from'@codemirror/lang-html';import{markdown as _0x2f8e99}from'@codemirror/lang-markdown';import{oneDark as _0x5d5ad8}from'@codemirror/theme-one-dark';function Q(_0x407d78,_0x592367){const t=_0x407d78['t'];switch(_0x592367){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 _0x592367;}}function B(_0x351108){const _0x483a48=_0x351108['editing']['view']['document']['roots'],_0x5706cf=_0x483a48['length'];if(0x0===_0x5706cf)throw new _0x3748d7('source-editing-enhanced-editor-no-root',_0x351108);return 0x1===_0x5706cf?_0x483a48['first']['rootName']:Array['from'](_0x351108['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x2003da){return J(_0x2003da['replace'](/^[\n\s]*/g,''))?_0x2003da['replace'](/\s+/g,''):_0x2003da;}function J(_0x3a44cf){return _0x3a44cf['startsWith']('<');}function X(_0x289259){const _0xd61bb3=[_0x21fe77['lineWrapping'],_0xd1947d(),_0x3a8d54(),_0x595cc8(),_0x10ca4e(),_0x510e94(),_0x434b8a(),_0xb46127(),_0x59601a(),_0x3d60e1(),_0x3d256d(),_0x10d2e8(),_0x20454f(),_0x2e914e(),_0x463753(),_0x1d547e(_0x3d4511,{'fallback':!0x0})],_0x5e9912=new _0x32e4cc();_0xd61bb3['push'](_0x5e9912['of'](_0x21fe77['editable']['of'](!0x0))),'html'===_0x289259['syntaxLanguage']?_0xd61bb3['push'](_0x58b362()):_0xd61bb3['push'](_0x2f8e99());const _0x2f6bc9=(_0x363e9a=_0x289259['theme'])&&'default'!==_0x363e9a?'dark'===_0x363e9a?_0x5d5ad8:_0x363e9a:null;var _0x363e9a;_0x2f6bc9&&_0xd61bb3['push'](_0x2f6bc9),_0xd61bb3['push'](_0x444c4c['of']([..._0x5b5436,..._0x1c4733,..._0x269a30,..._0x2c9526,..._0x2c0593,{'key':'Tab','run':_0xdd74d1,'shift':_0x50321b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2deaf7,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2deaf7,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xecda6,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x1d3e59=new _0x21fe77({'extensions':_0xd61bb3,'parent':_0x289259['parent']});return _0x10777a(_0x1d3e59),{'focus':()=>{_0x1d3e59['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x1d3e59['focus']();},'getData':()=>_0x1d3e59['state']['doc']['toString'](),'setData':_0x262290=>{_0x1d3e59['dispatch']({'changes':{'from':0x0,'to':_0x1d3e59['state']['doc']['length'],'insert':_0x262290},'annotations':_0x2bb007['addToHistory']['of'](!0x1)});},'setReadOnly':_0x2c8101=>{_0x1d3e59['dispatch']({'effects':[_0x5e9912['reconfigure'](_0x21fe77['editable']['of'](!_0x2c8101))]});},'destroy':()=>{_0x1d3e59['destroy']();},'instance':_0x1d3e59};}var Z=class extends _0x34fa7e{_codeEditorApi=null;_options;constructor(_0x8241a,_0x5afa40){super(_0x8241a),this['_options']=_0x5afa40,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',(_0x301374,_0x3e8c5a,_0x1459b6)=>{this['setReadOnly'](_0x1459b6);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x34903c){this['_codeEditorApi']['setData'](_0x34903c);}setReadOnly(_0x17bd3f){this['_codeEditorApi']['setReadOnly'](_0x17bd3f);}};const G='SourceEditingEnhancedMode';var W=class extends _0x3513e7{constructor(_0x105c56){super(_0x105c56),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x52a889)['on']('change:hasAny',(_0x5caa1a,_0x1c86d0,_0x5020be)=>{_0x5020be?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x4719f7=this['editor'];for(const _0x596168 of _0x4719f7['commands']['names']())['replaceSource','editSource']['includes'](_0x596168)||_0x4719f7['commands']['get'](_0x596168)['forceDisabled'](G);}['_enableCommands'](){const _0xd69e84=this['editor'];for(const _0x2ae01c of _0xd69e84['commands']['commands']())_0x2ae01c['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x17e7b7=this['editor'],_0x56523f=_0x17e7b7['locale'],_0x373591=_0x17e7b7['plugins']['get']('Dialog'),_0x2f6b5f=B(_0x17e7b7),_0x421be8=_0x17e7b7['data']['get']({'rootName':_0x2f6b5f}),_0x584404=J(_0x2913ec=_0x421be8)?_0xadc358(_0x2913ec):_0x2913ec;var _0x2913ec;const _0x56e5f0=new Z(_0x56523f,{'syntaxLanguage':_0x17e7b7['plugins']['has']('Markdown')?'markdown':'html','theme':_0x17e7b7['config']['get']('sourceEditingEnhanced.theme')});let _0x19e161=!0x0;const _0xd4d701=_0x4573ff=>{if(!_0x19e161)return;return Y(_0x56e5f0['getData']())!==Y(_0x584404)?window['confirm'](Q(_0x56523f,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x4573ff['stop']():void 0x0;};_0x373591['show']({'id':'sourceEditingEnhanced','title':Q(_0x56523f,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x56e5f0,'actionButtons':[{'label':Q(_0x56523f,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x373591['hide']();}},{'label':Q(_0x56523f,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x44fbb5=Y(_0x56e5f0['getData']())!==Y(_0x584404);_0x44fbb5&&_0x17e7b7['execute']('replaceSource',_0x56e5f0['getData']()),_0x19e161=!0x1,_0x373591['hide'](),_0x44fbb5&&'editables'in _0x17e7b7['ui']['view']&&_0x17e7b7['ui']['view']['editables'][_0x2f6b5f]['element']['focus']();},'onCreate':_0x464aca=>{_0x464aca['set']('isEnabled',!_0x17e7b7['isReadOnly']),_0x464aca['bind']('isEnabled')['to'](_0x17e7b7,'isReadOnly',this,'isEnabled',(_0x310a43,_0x509e5e)=>!_0x310a43&&_0x509e5e);}}],'onHide':()=>{this['_enableCommands'](),_0x373591['off']('hide',_0xd4d701),_0x56e5f0['destroy']();},'onShow':()=>{_0x56e5f0['bind']('isReadOnly')['to'](_0x17e7b7,'isReadOnly',this,'isEnabled',(_0x3a08d1,_0x30b8a8)=>_0x3a08d1||!_0x30b8a8),_0x56e5f0['setData'](_0x584404),_0x56e5f0['focus'](),_0x373591['on']('hide',_0xd4d701,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x5b31a9{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x52a889];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xc1ba1a=this['editor'],_0xc3c194=_0xc1ba1a['locale'],_0x4e7514=new W(_0xc1ba1a);_0xc1ba1a['commands']['add']('editSource',_0x4e7514),_0xc1ba1a['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x194e0a=this['_createButton'](_0xcc2b3,_0x4e7514);return _0x194e0a['set']({'label':Q(_0xc3c194,'Source'),'icon':_0x355428,'tooltip':Q(_0xc3c194,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x194e0a;}),_0xc1ba1a['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x5d76ea=this['_createButton'](_0xbcc816,_0x4e7514,!0x0);return _0x5d76ea['set']({'label':Q(_0xc3c194,'Edit\x20source\x20modal\x20label'),'icon':_0x355428,'role':'menuitemcheckbox'}),_0x5d76ea;}),this['_registerKeybindings']();}afterInit(){!async function(_0x54403c){const _0x5cf061='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x1721c9=0x793f8,_0x17804d={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x3c926a(_0x19207c){const _0x452bc6=new window['Promise'](_0x59bc0a=>{_0x19207c['once']('ready',_0x59bc0a);}),_0x5717eb=window['Date']['now'](),_0x443b80=_0x19207c['config']['get']('licenseKey');async function _0x21d7fb(){let _0x3a9e0b,_0x1e8ec7=null,_0x2219ce=null;try{return'GPL'==_0x443b80?'NotAllowed':(_0x3a9e0b=_0x70d4af(),_0x3a9e0b?(_0x3a9e0b['usageEndpoint']&&(_0x2219ce=_0x5a7add(_0x3a9e0b['usageEndpoint'],_0x3a9e0b['jti'])),await _0x106e3b()?_0x4f49d8()?_0xa1aaf2()?'Expired':_0x217666()?('evaluation'==_0x3a9e0b['licenseType']&&(_0x1e8ec7=_0x2850ed('EvaluationLimit')),await _0x1f2781()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xa1aaf2(){const _0x64b61a=['evaluation','trial']['includes'](_0x3a9e0b['licenseType'])?_0x5717eb/0x3e8:0xe10*_0x1721c9;return _0x3a9e0b['exp']<_0x64b61a;}function _0x4f49d8(){const _0x35ebed=_0x3a9e0b['features'];return!!_0x35ebed&&(!!_0x35ebed['includes']('*')||!!_0x35ebed['includes']('SEE'));}function _0x217666(){const _0x15aafc=_0x3a9e0b['licensedHosts'];if(!_0x15aafc||0x0==_0x15aafc['length'])return!0x0;const {hostname:_0x216e0}=new URL(window['location']['href']);if(_0x15aafc['includes'](_0x216e0))return!0x0;const _0xffb3a2=_0x216e0['split']('.');return _0x15aafc['filter'](_0x1d8c43=>_0x1d8c43['includes']('*'))['map'](_0x81860a=>_0x81860a['split']('.'))['filter'](_0x18595b=>_0x18595b['length']<=_0xffb3a2['length'])['map'](_0x321369=>Array(_0xffb3a2['length']-_0x321369['length'])['fill']('*'===_0x321369[0x0]?'*':'')['concat'](_0x321369))['some'](_0x2487fb=>_0xffb3a2['every']((_0x146c97,_0x56b3eb)=>_0x2487fb[_0x56b3eb]===_0x146c97||'*'===_0x2487fb[_0x56b3eb]));}function _0x1f2781(){return _0x1e8ec7&&_0x2219ce?new window['Promise']((_0x5f103b,_0x3a87aa)=>{_0x1e8ec7['then'](_0x5f103b,_0x3a87aa),_0x2219ce['then'](_0x365230=>{'Valid'!=_0x365230&&_0x5f103b(_0x365230);},_0x3a87aa);}):_0x1e8ec7||_0x2219ce||'Valid';}}function _0x5a7add(_0x11e210,_0x3b88a4){return new window['Promise'](_0x3ecd11=>{if(_0x28f3b0())return _0x3ecd11('Valid');_0x289c2b(),_0x19207c['decorate']('_sendUsageRequest');let _0x48eb47=!0x1;const _0x4870e6=_0x273aa2();function _0x343213(_0x2c9c41){return!!_0x2c9c41&&('object'==typeof _0x2c9c41||'function'==typeof _0x2c9c41)&&'function'==typeof _0x2c9c41['then']&&'function'==typeof _0x2c9c41['catch'];}function _0x53eded(_0x518348){_0x345645(_0x518348)['then'](_0x411dd1=>_0x411dd1&&'ok'==_0x411dd1['status']?_0x306609(_0xe1b774(_0x4870e6+_0x3b88a4))!=_0x411dd1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x304646=>(_0x3ff7dc(),_0x304646),()=>{const _0xb3314a=_0x2187a0();return null==_0xb3314a?(_0x3ff7dc(),'Valid'):_0x5717eb-_0xb3314a>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3ecd11)['catch'](()=>{_0x3ecd11('UsageLimit');});const _0x5a7694=0x36ee80;function _0x3ff7dc(){const _0x4343a2='llct-'+_0x306609(_0xe1b774(_0x11e210)),_0x2d4d61=_0x4db8a6(_0x306609(window['Math']['ceil'](_0x5717eb/_0x5a7694)));window['localStorage']['setItem'](_0x4343a2,_0x2d4d61);}function _0x2187a0(){const _0x29ee63='llct-'+_0x306609(_0xe1b774(_0x11e210)),_0x4f0605=window['localStorage']['getItem'](_0x29ee63);return _0x4f0605?window['parseInt'](_0x4db8a6(_0x4f0605),0x10)*_0x5a7694:null;}function _0x345645(_0x5c1b54){return new window['Promise']((_0x30db21,_0x3d8421)=>{_0x5c1b54['then'](_0x30db21,_0x3d8421),window['setTimeout'](_0x3d8421,0x1d4c0);});}}_0x19207c['on']('_sendUsageRequest',(_0x29e59a,_0x21aae4)=>{if(_0x21aae4[0x0]!=_0x11e210)return _0x3ecd11('UsageLimit');_0x21aae4[0x1]={..._0x21aae4[0x1],'requestId':_0x4870e6};},{'priority':'high'}),_0x19207c['on']('_sendUsageRequest',_0x2c4272=>{_0x343213(_0x2c4272['return'])&&(_0x48eb47=!0x0,_0x53eded(_0x2c4272['return']));},{'priority':'low'}),_0x452bc6['then'](()=>{_0x48eb47||_0x3ecd11('UsageLimit');});});function _0x28f3b0(){return'auto'==_0x19207c['editing']['view']['_overlayModeHint'];}function _0x289c2b(){_0x19207c['editing']['view']['_overlayModeHint']='auto';}}function _0x2850ed(_0x464bbd){const _0x213b1f=[new window['Promise'](_0x33498f=>setTimeout(_0x33498f,0x93ecc)),_0x452bc6['then'](()=>new window['Promise'](_0x5813cc=>{let _0x385732=0x0;_0x19207c['model']['on']('applyOperation',(_0x57f198,_0x677bba)=>{_0x677bba[0x0]['isDocumentOperation']&&_0x385732++,0x5e8==_0x385732&&(_0x5813cc(),_0x57f198['off']());});}))];return window['Promise']['race'](_0x213b1f)['then'](()=>_0x464bbd);}async function _0x15670e(){await _0x452bc6,_0x19207c['model']['change']=_0x54a7f5,_0x19207c['model']['enqueueChange']=_0x54a7f5,_0x19207c['enableReadOnlyMode']('model');}function _0x198ede(_0x5998ae){const _0x506f15=_0x18f6b4();_0x19207c[_0x506f15]='sourceEditingEnhancedLicenseKey'+_0x5998ae,'Valid'!=_0x5998ae&&_0x15670e();}function _0x18f6b4(){const _0x41a610=window['String'](window['performance']['now']())['replace']('.','');let _0x22d8a3='R';for(let _0x32ae85=0x0;_0x32ae85<_0x41a610['length'];_0x32ae85+=0x2){let _0x36f944=window['parseInt'](_0x41a610['substring'](_0x32ae85,_0x32ae85+0x2));_0x36f944>=0x3e&&(_0x36f944-=0x3e),_0x22d8a3+=_0x5cf061[_0x36f944];}return _0x22d8a3;}function _0x70d4af(){const _0x51e482=_0x443b80['split']('.');if(0x3!=_0x51e482['length'])return null;return _0x4c8025(_0x51e482[0x1]);function _0x4c8025(_0x4cda17){const _0xe34446=_0x2a3573(_0x4cda17);return _0xe34446&&_0x2b7a26()?_0xe34446:null;function _0x2b7a26(){const _0x5dd5b8=_0xe34446['jti'],_0x518cf2=window['parseInt'](_0x5dd5b8['substring'](_0x5dd5b8['length']-0x8),0x10),_0x583314={..._0xe34446,'jti':_0x5dd5b8['substring'](0x0,_0x5dd5b8['length']-0x8)};return delete _0x583314['vc'],_0xe1b774(_0x583314)==_0x518cf2;}}}async function _0x106e3b(){let _0x2b27a4=!0x0;try{const [_0x32dec0,_0x19bba3,_0x273d26]=_0x443b80['split']('.');return _0x4d71d2(_0x32dec0),await _0x3ec210(_0x32dec0,_0x19bba3,_0x273d26),_0x2b27a4;}catch{return!0x1;}function _0x4d71d2(_0x2fdbce){const _0x5a0562=_0x2a3573(_0x2fdbce);_0x5a0562&&'ES256'==_0x5a0562['alg']||(_0x2b27a4=!0x1);}async function _0x3ec210(_0x2401c6,_0x1e8119,_0x1cd69e){const _0x456d2d=window['Uint8Array']['from'](_0x300f65(_0x1cd69e),_0x588b7d=>_0x588b7d['charCodeAt'](0x0)),_0x5f1af5=new window['TextEncoder']()['encode'](_0x2401c6+'.'+_0x1e8119),_0x305140=window['crypto']['subtle'];if(!_0x305140)return;const _0x3c75f2=await _0x305140['importKey']('jwk',_0x17804d,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x305140['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3c75f2,_0x456d2d,_0x5f1af5)||(_0x2b27a4=!0x1);}}function _0x2a3573(_0x219e45){return _0x219e45['startsWith']('ey')?JSON['parse'](_0x300f65(_0x219e45)):null;}function _0x300f65(_0x5e1e53){return window['atob'](_0x5e1e53['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0xe1b774(_0x4e3b4e){let _0xd2c476=0x1505;function _0x5038f3(_0x99fe1f){for(let _0x3efbf2=0x0;_0x3efbf2<_0x99fe1f['length'];_0x3efbf2++){const _0x3112b5=_0x99fe1f['charCodeAt'](_0x3efbf2);_0xd2c476=(_0xd2c476<<0x5)+_0xd2c476+_0x3112b5,_0xd2c476&=_0xd2c476;}}function _0x43952b(_0x450191){Array['isArray'](_0x450191)?_0x450191['forEach'](_0x43952b):_0x450191&&'object'==typeof _0x450191?Object['entries'](_0x450191)['sort']()['forEach'](([_0x38bec8,_0x5939a1])=>{_0x5038f3(_0x38bec8),_0x43952b(_0x5939a1);}):_0x5038f3(window['String'](_0x450191));}return _0x43952b(_0x4e3b4e),_0xd2c476>>>0x0;}function _0x306609(_0x7921df){return _0x7921df['toString'](0x10)['padStart'](0x8,'0');}function _0x4db8a6(_0x406b03){return _0x406b03['split']('')['reverse']()['join']('');}function _0x54a7f5(){}_0x198ede(await _0x21d7fb());}_0x3c926a(_0x54403c['editor']);}(this);}_createButton(_0x16501e,_0x5bac1b,_0x29aa56=!0x1){const _0x3c7ccd=new _0x16501e(this['editor']['locale']);return _0x3c7ccd['set']({'withText':_0x29aa56,'isToggleable':!0x1}),_0x3c7ccd['bind']('isEnabled')['to'](_0x5bac1b,'isEnabled'),this['listenTo'](_0x3c7ccd,'execute',()=>_0x5bac1b['execute']()),_0x3c7ccd;}_registerKeybindings(){const _0x9652f6=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x9652f6,'Source\x20Editing\x20Enhanced')});const _0x15970b=_0x48c461['isMac']||_0x48c461['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x9652f6,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x9652f6,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x9652f6,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x9652f6,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x9652f6,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x9652f6,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x9652f6,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x15970b?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x9652f6,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x9652f6,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x9652f6,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x9652f6,'Select\x20line'),'keystroke':_0x15970b?'Ctrl!+L':'Alt+L'},{'label':Q(_0x9652f6,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x15970b?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x9652f6,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x9652f6,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x9652f6,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x9652f6,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x9652f6,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x15970b?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x3513e7{constructor(_0x27b3e1){super(_0x27b3e1),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x2ec02d,_0x1078e3){const _0x5f083c=this['editor'],_0x473bb7=_0x1078e3?.['rootName']??B(_0x5f083c);_0x5f083c['data']['set']({[_0x473bb7]:_0x2ec02d},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x5b31a9{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x34158f){super(_0x34158f),_0x34158f['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 _0x4e4c97=[this['editor']];for(const _0x477f9f of _0x4e4c97){let _0x21330e;for(const _0x3f8b9e in _0x477f9f){const _0x370281=_0x3f8b9e,_0x52b366=_0x477f9f[_0x370281];if('sourceEditingEnhancedLicenseKeyValid'==_0x52b366||'sourceEditingEnhancedLicenseKeyInvalid'==_0x52b366||'sourceEditingEnhancedLicenseKeyExpired'==_0x52b366||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x52b366||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x52b366||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x52b366||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x52b366){delete _0x477f9f[_0x370281],_0x21330e=_0x52b366,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x21330e&&_0x477f9f['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x21330e&&_0x477f9f['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x21330e&&_0x477f9f['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x21330e&&_0x477f9f['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x21330e&&_0x477f9f['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x21330e&&_0x477f9f['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x2e55ac=this['editor'],_0x1a6575=_0x2e55ac['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x1a6575&&_0x2e55ac['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x3748d7('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x1a6575&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x4c8685=>_0x2e55ac['plugins']['has'](_0x4c8685))&&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.'),_0x2e55ac['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.2",
|
|
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.2",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.5.0-alpha.2",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.2",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.2",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.2",
|
|
34
34
|
"@codemirror/autocomplete": "^6.7.1",
|
|
35
35
|
"@codemirror/commands": "6.8.1",
|
|
36
36
|
"@codemirror/lang-html": "^6.0.0",
|