@ckeditor/ckeditor5-source-editing-enhanced 48.3.0-alpha.4 → 48.3.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 _0xbd5af7,PendingActions as _0x1f6891,Plugin as _0x114674}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x42a12e,env as _0x387b18,formatHtml as _0x4321e8,uid as _0x1535af}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x38bce4}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x1cb0f7,MenuBarMenuListItemButtonView as _0x13f3d2,View as _0x2df3b2}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x1d359c,crosshairCursor as _0x5aa68b,drawSelection as _0x3690e6,dropCursor as _0x287a6e,highlightActiveLine as _0xb847c4,highlightActiveLineGutter as _0xebf907,highlightSpecialChars as _0x411329,keymap as _0x36b440,lineNumbers as _0x997a78,rectangularSelection as _0x3d3ca7}from'@codemirror/view';import{Compartment as _0x26c320,Transaction as _0xea69dd}from'@codemirror/state';import{bracketMatching as _0x3ea946,defaultHighlightStyle as _0x32f59e,foldGutter as _0x3ada4d,foldKeymap as _0x4b74c9,indentOnInput as _0x40e3d9,syntaxHighlighting as _0x45bb1b}from'@codemirror/language';import{defaultKeymap as _0x4ca695,history as _0x497364,historyKeymap as _0x3c1ec9,indentLess as _0x11cd2e,indentMore as _0xbada7f,redo as _0x508d7b,toggleTabFocusMode as _0x3e79e9,undo as _0xa64217}from'@codemirror/commands';import{autocompletion as _0x4e431a,closeBrackets as _0x27d40c,closeBracketsKeymap as _0x2491b0,completionKeymap as _0x221438}from'@codemirror/autocomplete';import{html as _0xb7cfad}from'@codemirror/lang-html';import{markdown as _0x4d323a}from'@codemirror/lang-markdown';import{oneDark as _0x2e4ffa}from'@codemirror/theme-one-dark';function Q(_0x1826bd,_0x25198b){const t=_0x1826bd['t'];switch(_0x25198b){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 _0x25198b;}}function B(_0x391400){const _0x352f01=_0x391400['editing']['view']['document']['roots'],_0x3c2e4a=_0x352f01['length'];if(0x0===_0x3c2e4a)throw new _0x42a12e('source-editing-enhanced-editor-no-root',_0x391400);return 0x1===_0x3c2e4a?_0x352f01['first']['rootName']:Array['from'](_0x391400['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x1127f8){return J(_0x1127f8['replace'](/^[\n\s]*/g,''))?_0x1127f8['replace'](/\s+/g,''):_0x1127f8;}function J(_0x48af97){return _0x48af97['startsWith']('<');}function X(_0x56399b){const _0x2946a2=[_0x1d359c['lineWrapping'],_0x4e431a(),_0x3ea946(),_0x27d40c(),_0x5aa68b(),_0x3690e6(),_0x287a6e(),_0x997a78(),_0x3ada4d(),_0xb847c4(),_0xebf907(),_0x411329(),_0x497364(),_0x40e3d9(),_0x3d3ca7(),_0x45bb1b(_0x32f59e,{'fallback':!0x0})],_0x1cb70b=new _0x26c320();_0x2946a2['push'](_0x1cb70b['of'](_0x1d359c['editable']['of'](!0x0))),'html'===_0x56399b['syntaxLanguage']?_0x2946a2['push'](_0xb7cfad()):_0x2946a2['push'](_0x4d323a());const _0x525e47=(_0x490877=_0x56399b['theme'])&&'default'!==_0x490877?'dark'===_0x490877?_0x2e4ffa:_0x490877:null;var _0x490877;_0x525e47&&_0x2946a2['push'](_0x525e47),_0x2946a2['push'](_0x36b440['of']([..._0x2491b0,..._0x4ca695,..._0x3c1ec9,..._0x4b74c9,..._0x221438,{'key':'Tab','run':_0xbada7f,'shift':_0x11cd2e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x508d7b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x508d7b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xa64217,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x42cf06=new _0x1d359c({'extensions':_0x2946a2,'parent':_0x56399b['parent']});return _0x3e79e9(_0x42cf06),{'focus':()=>{_0x42cf06['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x42cf06['focus']();},'getData':()=>_0x42cf06['state']['doc']['toString'](),'setData':_0x369654=>{_0x42cf06['dispatch']({'changes':{'from':0x0,'to':_0x42cf06['state']['doc']['length'],'insert':_0x369654},'annotations':_0xea69dd['addToHistory']['of'](!0x1)});},'setReadOnly':_0x3a351b=>{_0x42cf06['dispatch']({'effects':[_0x1cb70b['reconfigure'](_0x1d359c['editable']['of'](!_0x3a351b))]});},'destroy':()=>{_0x42cf06['destroy']();},'instance':_0x42cf06};}var Z=class extends _0x2df3b2{['_codeEditorApi']=null;['_options'];constructor(_0x1d31f2,_0x419a42){super(_0x1d31f2),this['_options']=_0x419a42,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',(_0x55b10a,_0x2c72f4,_0x3b64c6)=>{this['setReadOnly'](_0x3b64c6);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x34f12e){this['_codeEditorApi']['setData'](_0x34f12e);}['setReadOnly'](_0x50bb33){this['_codeEditorApi']['setReadOnly'](_0x50bb33);}};const G='SourceEditingEnhancedMode';var W=class extends _0xbd5af7{constructor(_0x17726b){super(_0x17726b),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x1f6891)['on']('change:hasAny',(_0x4c6e37,_0x22e4ce,_0x262799)=>{_0x262799?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x3711fc=this['editor'];for(const _0x58c875 of _0x3711fc['commands']['names']())['replaceSource','editSource']['includes'](_0x58c875)||_0x3711fc['commands']['get'](_0x58c875)['forceDisabled'](G);}['_enableCommands'](){const _0x461f8f=this['editor'];for(const _0x1162f4 of _0x461f8f['commands']['commands']())_0x1162f4['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0x3b7e54=this['editor'],_0x10c5e9=_0x3b7e54['locale'],_0x284036=_0x3b7e54['plugins']['get']('Dialog'),_0x153c81=B(_0x3b7e54),_0x4401ef=J(_0x60dfbb=_0x3b7e54['data']['get']({'rootName':_0x153c81}))?_0x4321e8(_0x60dfbb):_0x60dfbb;var _0x60dfbb;const _0x271b08=new Z(_0x10c5e9,{'syntaxLanguage':_0x3b7e54['plugins']['has']('Markdown')?'markdown':'html','theme':_0x3b7e54['config']['get']('sourceEditingEnhanced.theme')});let _0x3e371e=!0x0;const _0x26b4d2=_0x1d1d1a=>{if(_0x3e371e&&Y(_0x271b08['getData']())!==Y(_0x4401ef))return window['confirm'](Q(_0x10c5e9,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x1d1d1a['stop']();};_0x284036['show']({'id':'sourceEditingEnhanced','title':Q(_0x10c5e9,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x271b08,'actionButtons':[{'label':Q(_0x10c5e9,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x284036['hide']();}},{'label':Q(_0x10c5e9,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x3a9d3d=Y(_0x271b08['getData']())!==Y(_0x4401ef);_0x3a9d3d&&_0x3b7e54['execute']('replaceSource',_0x271b08['getData']()),_0x3e371e=!0x1,_0x284036['hide'](),_0x3a9d3d&&'editables'in _0x3b7e54['ui']['view']&&_0x3b7e54['ui']['view']['editables'][_0x153c81]['element']['focus']();},'onCreate':_0x3872e5=>{_0x3872e5['set']('isEnabled',!_0x3b7e54['isReadOnly']),_0x3872e5['bind']('isEnabled')['to'](_0x3b7e54,'isReadOnly',this,'isEnabled',(_0x59529a,_0x3ed902)=>!_0x59529a&&_0x3ed902);}}],'onHide':()=>{this['_enableCommands'](),_0x284036['off']('hide',_0x26b4d2),_0x271b08['destroy']();},'onShow':()=>{_0x271b08['bind']('isReadOnly')['to'](_0x3b7e54,'isReadOnly',this,'isEnabled',(_0x295caf,_0x23c668)=>_0x295caf||!_0x23c668),_0x271b08['setData'](_0x4401ef),_0x271b08['focus'](),_0x284036['on']('hide',_0x26b4d2,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x114674{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x1f6891];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd59e90=this['editor'],_0x2f3a91=_0xd59e90['locale'],_0xbc557f=new W(_0xd59e90);_0xd59e90['commands']['add']('editSource',_0xbc557f),_0xd59e90['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0xe38762=this['_createButton'](_0x1cb0f7,_0xbc557f);return _0xe38762['set']({'label':Q(_0x2f3a91,'Source'),'icon':_0x38bce4,'tooltip':Q(_0x2f3a91,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0xe38762;}),_0xd59e90['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x5b67c2=this['_createButton'](_0x13f3d2,_0xbc557f,!0x0);return _0x5b67c2['set']({'label':Q(_0x2f3a91,'Edit\x20source\x20modal\x20label'),'icon':_0x38bce4,'role':'menuitemcheckbox'}),_0x5b67c2;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0x470ee5){const _0x3fc867='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x3a62e8=0x78e28,_0x422b42=window['Date']['now'](),_0x4aa526=_0x470ee5['editor'],_0x2d36a2=new window['Promise'](_0x2b32a0=>{_0x4aa526['once']('ready',_0x2b32a0);}),_0x2a443f={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x41b409=_0x4aa526['config']['get']('licenseKey');async function _0x4540e3(){let _0x42e414,_0x259cdf=null,_0x55a5ca=null;try{return'GPL'==_0x41b409?'NotAllowed':(_0x42e414=_0x5e95ff(),_0x42e414?(_0x42e414['usageEndpoint']&&(_0x55a5ca=_0x3999c1(_0x42e414['usageEndpoint'],_0x42e414['jti'])),await _0x4dae89()?_0x54b8a9()?_0x3eef97()?'Expired':_0xf646bb()?('evaluation'==_0x42e414['licenseType']&&(_0x259cdf=_0xb8a742('EvaluationLimit')),await _0xb56afa()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3eef97(){const _0x4f5016=['evaluation','trial']['includes'](_0x42e414['licenseType'])?_0x422b42/0x3e8:0xe10*_0x3a62e8;return _0x42e414['exp']<_0x4f5016;}function _0x54b8a9(){const _0x3f3ee4=_0x42e414['features'];return!!_0x3f3ee4&&(!!_0x3f3ee4['includes']('*')||!!_0x3f3ee4['includes']('SEE'));}function _0xf646bb(){const _0x3a0aa5=_0x42e414['licensedHosts'];if(!_0x3a0aa5||0x0==_0x3a0aa5['length'])return!0x0;const {hostname:_0x244542}=new URL(window['location']['href']);if(_0x3a0aa5['includes'](_0x244542))return!0x0;const _0x239be5=_0x244542['split']('.');return _0x3a0aa5['filter'](_0x404621=>_0x404621['includes']('*'))['map'](_0x267d39=>_0x267d39['split']('.'))['filter'](_0x17b311=>_0x17b311['length']<=_0x239be5['length'])['map'](_0x4ac016=>Array(_0x239be5['length']-_0x4ac016['length'])['fill']('*'===_0x4ac016[0x0]?'*':'')['concat'](_0x4ac016))['some'](_0x34b503=>_0x239be5['every']((_0x5aa6ba,_0x5e7a2d)=>_0x34b503[_0x5e7a2d]===_0x5aa6ba||'*'===_0x34b503[_0x5e7a2d]));}function _0xb56afa(){return _0x259cdf&&_0x55a5ca?new window['Promise']((_0x17f1c6,_0x2a4dc6)=>{_0x259cdf['then'](_0x17f1c6,_0x2a4dc6),_0x55a5ca['then'](_0x2d170e=>{'Valid'!=_0x2d170e&&_0x17f1c6(_0x2d170e);},_0x2a4dc6);}):_0x259cdf||_0x55a5ca||'Valid';}}function _0x3999c1(_0x46c2ef,_0xa825be){return new window['Promise'](_0x351546=>{if(_0x470e17())return _0x351546('Valid');_0x27f76f(),_0x4aa526['decorate']('_sendUsageRequest');let _0x67352=!0x1;const _0x47143f=_0x1535af();function _0x2da748(_0x1b795e){return!!_0x1b795e&&('object'==typeof _0x1b795e||'function'==typeof _0x1b795e)&&'function'==typeof _0x1b795e['then']&&'function'==typeof _0x1b795e['catch'];}function _0x395348(_0x17730d){_0x1f36d7(_0x17730d)['then'](_0x324e3f=>_0x324e3f&&'ok'==_0x324e3f['status']?_0x2da84b(_0x5f1fd7(_0x47143f+_0xa825be))!=_0x324e3f['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x337715=>(_0x5e81c3(),_0x337715),()=>{const _0x46d588=_0x54d362();return null==_0x46d588?(_0x5e81c3(),'Valid'):_0x422b42-_0x46d588>0x240c8400?'UsageLimit':'Valid';})['then'](_0x351546)['catch'](()=>{_0x351546('UsageLimit');});const _0x28a1b5=0x36ee80;function _0x5e81c3(){const _0x3aeace='llct-'+_0x2da84b(_0x5f1fd7(_0x46c2ef)),_0x896b9=_0x37e317(_0x2da84b(window['Math']['ceil'](_0x422b42/_0x28a1b5)));window['localStorage']['setItem'](_0x3aeace,_0x896b9);}function _0x54d362(){const _0x22cafb='llct-'+_0x2da84b(_0x5f1fd7(_0x46c2ef)),_0xd700f=window['localStorage']['getItem'](_0x22cafb);return _0xd700f?window['parseInt'](_0x37e317(_0xd700f),0x10)*_0x28a1b5:null;}function _0x1f36d7(_0x465252){return new window['Promise']((_0xfff638,_0x2c3eee)=>{_0x465252['then'](_0xfff638,_0x2c3eee),window['setTimeout'](_0x2c3eee,0x1d4c0);});}}_0x4aa526['on']('_sendUsageRequest',(_0x39096f,_0x42a258)=>{if(_0x42a258[0x0]!=_0x46c2ef)return _0x351546('UsageLimit');_0x42a258[0x1]={..._0x42a258[0x1],'requestId':_0x47143f};},{'priority':'high'}),_0x4aa526['on']('_sendUsageRequest',_0x543865=>{_0x2da748(_0x543865['return'])&&(_0x67352=!0x0,_0x395348(_0x543865['return']));},{'priority':'low'}),_0x2d36a2['then'](()=>{_0x67352||_0x351546('UsageLimit');});});function _0x470e17(){return'auto'==_0x4aa526['editing']['view']['_overlayModeHint'];}function _0x27f76f(){_0x4aa526['editing']['view']['_overlayModeHint']='auto';}}function _0xb8a742(_0x3b3380){const _0x8e4c72=[new window['Promise'](_0x5a7228=>setTimeout(_0x5a7228,0x93ecc)),_0x2d36a2['then'](()=>new window['Promise'](_0x30ae74=>{let _0x4da146=0x0;_0x4aa526['model']['on']('applyOperation',(_0x35b0db,_0x24e6d2)=>{_0x24e6d2[0x0]['isDocumentOperation']&&_0x4da146++,0x5e8==_0x4da146&&(_0x30ae74(),_0x35b0db['off']());});}))];return window['Promise']['race'](_0x8e4c72)['then'](()=>_0x3b3380);}async function _0x247da9(){await _0x2d36a2,_0x4aa526['model']['change']=_0x42d214,_0x4aa526['model']['enqueueChange']=_0x42d214,_0x4aa526['enableReadOnlyMode']('model');}function _0x3ad1b0(_0x39b851){const _0x4f3684=_0x4750f7();_0x4aa526[_0x4f3684]='sourceEditingEnhancedLicenseKey'+_0x39b851,'Valid'!=_0x39b851&&_0x247da9();}function _0x4750f7(){const _0x130319=window['String'](window['performance']['now']())['replace']('.','');let _0x265cb4='N';for(let _0x58faa7=0x0;_0x58faa7<_0x130319['length'];_0x58faa7+=0x2){let _0x319f39=window['parseInt'](_0x130319['substring'](_0x58faa7,_0x58faa7+0x2));_0x319f39>=0x3e&&(_0x319f39-=0x3e),_0x265cb4+=_0x3fc867[_0x319f39];}return _0x265cb4;}function _0x5e95ff(){const _0x5d3a87=_0x41b409['split']('.');if(0x3!=_0x5d3a87['length'])return null;return _0x33d29e(_0x5d3a87[0x1]);function _0x33d29e(_0x167e07){const _0x351ab9=_0x5848ef(_0x167e07);return _0x351ab9&&_0xd0208f()?_0x351ab9:null;function _0xd0208f(){const _0xc33196=_0x351ab9['jti'],_0x45ebba=window['parseInt'](_0xc33196['substring'](_0xc33196['length']-0x8),0x10),_0x2e5be8={..._0x351ab9,'jti':_0xc33196['substring'](0x0,_0xc33196['length']-0x8)};return delete _0x2e5be8['vc'],_0x5f1fd7(_0x2e5be8)==_0x45ebba;}}}async function _0x4dae89(){let _0x39ae6e=!0x0;try{const [_0x102f9e,_0x4c2011,_0x3fdef9]=_0x41b409['split']('.');return _0x383b4c(_0x102f9e),await _0x272208(_0x102f9e,_0x4c2011,_0x3fdef9),_0x39ae6e;}catch{return!0x1;}function _0x383b4c(_0x5b12c2){const _0x396b43=_0x5848ef(_0x5b12c2);_0x396b43&&'ES256'==_0x396b43['alg']||(_0x39ae6e=!0x1);}async function _0x272208(_0x5ac059,_0x2ed131,_0x471de7){const _0x22af17=window['Uint8Array']['from'](_0x9df472(_0x471de7),_0x20e318=>_0x20e318['charCodeAt'](0x0)),_0x4784e9=new window['TextEncoder']()['encode'](_0x5ac059+'.'+_0x2ed131),_0x5f1d79=window['crypto']['subtle'];if(!_0x5f1d79)return;const _0x3b2868=await _0x5f1d79['importKey']('jwk',_0x2a443f,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x5f1d79['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3b2868,_0x22af17,_0x4784e9)||(_0x39ae6e=!0x1);}}function _0x5848ef(_0x356b68){return _0x356b68['startsWith']('ey')?JSON['parse'](_0x9df472(_0x356b68)):null;}function _0x9df472(_0xfa41d){return window['atob'](_0xfa41d['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5f1fd7(_0x25131b){let _0x5aba72=0x1505;function _0xb75522(_0x1a739f){for(let _0xc226a2=0x0;_0xc226a2<_0x1a739f['length'];_0xc226a2++){const _0x3bc0fc=_0x1a739f['charCodeAt'](_0xc226a2);_0x5aba72=(_0x5aba72<<0x5)+_0x5aba72+_0x3bc0fc,_0x5aba72&=_0x5aba72;}}function _0x2e623f(_0x3e2e15){Array['isArray'](_0x3e2e15)?_0x3e2e15['forEach'](_0x2e623f):_0x3e2e15&&'object'==typeof _0x3e2e15?Object['entries'](_0x3e2e15)['sort']()['forEach'](([_0x3f75dc,_0x4b6a4a])=>{_0xb75522(_0x3f75dc),_0x2e623f(_0x4b6a4a);}):_0xb75522(window['String'](_0x3e2e15));}return _0x2e623f(_0x25131b),_0x5aba72>>>0x0;}function _0x2da84b(_0x11ec92){return _0x11ec92['toString'](0x10)['padStart'](0x8,'0');}function _0x37e317(_0x382c66){return _0x382c66['split']('')['reverse']()['join']('');}function _0x42d214(){}_0x3ad1b0(await _0x4540e3());}(this);}['_createButton'](_0x54e00a,_0x5d3580,_0x5c9147=!0x1){const _0x2778ac=new _0x54e00a(this['editor']['locale']);return _0x2778ac['set']({'withText':_0x5c9147,'isToggleable':!0x1}),_0x2778ac['bind']('isEnabled')['to'](_0x5d3580,'isEnabled'),this['listenTo'](_0x2778ac,'execute',()=>_0x5d3580['execute']()),_0x2778ac;}['_registerKeybindings'](){const _0x274f91=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x274f91,'Source\x20Editing\x20Enhanced')});const _0x28dbe6=_0x387b18['isMac']||_0x387b18['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x274f91,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x274f91,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x274f91,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x274f91,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x274f91,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x274f91,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x274f91,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x28dbe6?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x274f91,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x274f91,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x274f91,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x274f91,'Select\x20line'),'keystroke':_0x28dbe6?'Ctrl!+L':'Alt+L'},{'label':Q(_0x274f91,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x28dbe6?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x274f91,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x274f91,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x274f91,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x274f91,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x274f91,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x28dbe6?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0xbd5af7{constructor(_0x5391be){super(_0x5391be),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x1b306f,_0x31dd39){const _0x4a0210=this['editor'],_0x3478ba=_0x31dd39?.['rootName']??B(_0x4a0210);_0x4a0210['data']['set']({[_0x3478ba]:_0x1b306f},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x114674{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x3b8cd9){super(_0x3b8cd9),_0x3b8cd9['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}['init'](){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1e6155=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1d9e24;for(const _0x3a396c in _0x1e6155){const _0x2601a8=_0x3a396c,_0x46d4ce=_0x1e6155[_0x2601a8];if('sourceEditingEnhancedLicenseKeyValid'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyInvalid'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyExpired'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x46d4ce){delete _0x1e6155[_0x2601a8],_0x1d9e24=_0x46d4ce,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x1d9e24&&_0x1e6155['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x1d9e24&&_0x1e6155['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x1d9e24&&_0x1e6155['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x1d9e24&&_0x1e6155['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x1d9e24&&_0x1e6155['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x1d9e24&&_0x1e6155['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x11c61f=this['editor'],_0x12c337=_0x11c61f['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x12c337&&_0x11c61f['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x42a12e('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x12c337&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x567bd9=>_0x11c61f['plugins']['has'](_0x567bd9))&&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.'),_0x11c61f['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 _0x1ddc59,PendingActions as _0x1872e7,Plugin as _0x579330}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x1bec98,env as _0x438824,formatHtml as _0x20f422,uid as _0xf7647f}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x4e67c5}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x491d16,MenuBarMenuListItemButtonView as _0x34c52a,View as _0x1585d2}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x53f418,crosshairCursor as _0x580e2c,drawSelection as _0x286c53,dropCursor as _0x31ccad,highlightActiveLine as _0x3e8e68,highlightActiveLineGutter as _0x3788e6,highlightSpecialChars as _0x34dc59,keymap as _0x4781c5,lineNumbers as _0x2d3429,rectangularSelection as _0x35d962}from'@codemirror/view';import{Compartment as _0x23a66c,Transaction as _0x3b5728}from'@codemirror/state';import{bracketMatching as _0x3f92dd,defaultHighlightStyle as _0x4e833d,foldGutter as _0x445608,foldKeymap as _0x5e10be,indentOnInput as _0x5ec608,syntaxHighlighting as _0x10ccd2}from'@codemirror/language';import{defaultKeymap as _0x1b2a9c,history as _0x11d06b,historyKeymap as _0x279433,indentLess as _0x1a273d,indentMore as _0x51c22d,redo as _0x5e9c86,toggleTabFocusMode as _0x34de91,undo as _0x9d6477}from'@codemirror/commands';import{autocompletion as _0x3207e0,closeBrackets as _0x490156,closeBracketsKeymap as _0x14a4c1,completionKeymap as _0x3b30c2}from'@codemirror/autocomplete';import{html as _0x219b7c}from'@codemirror/lang-html';import{markdown as _0x202c25}from'@codemirror/lang-markdown';import{oneDark as _0xad4d44}from'@codemirror/theme-one-dark';function Q(_0x2a1e34,_0x3c06f6){const t=_0x2a1e34['t'];switch(_0x3c06f6){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 _0x3c06f6;}}function B(_0x567279){const _0x210b4c=_0x567279['editing']['view']['document']['roots'],_0x1274a0=_0x210b4c['length'];if(0x0===_0x1274a0)throw new _0x1bec98('source-editing-enhanced-editor-no-root',_0x567279);return 0x1===_0x1274a0?_0x210b4c['first']['rootName']:Array['from'](_0x567279['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x1b868e){return J(_0x1b868e['replace'](/^[\n\s]*/g,''))?_0x1b868e['replace'](/\s+/g,''):_0x1b868e;}function J(_0x1fbd29){return _0x1fbd29['startsWith']('<');}function X(_0x59069e){const _0xb42804=[_0x53f418['lineWrapping'],_0x3207e0(),_0x3f92dd(),_0x490156(),_0x580e2c(),_0x286c53(),_0x31ccad(),_0x2d3429(),_0x445608(),_0x3e8e68(),_0x3788e6(),_0x34dc59(),_0x11d06b(),_0x5ec608(),_0x35d962(),_0x10ccd2(_0x4e833d,{'fallback':!0x0})],_0x2761b0=new _0x23a66c();_0xb42804['push'](_0x2761b0['of'](_0x53f418['editable']['of'](!0x0))),'html'===_0x59069e['syntaxLanguage']?_0xb42804['push'](_0x219b7c()):_0xb42804['push'](_0x202c25());const _0x159e80=(_0x3b4f3b=_0x59069e['theme'])&&'default'!==_0x3b4f3b?'dark'===_0x3b4f3b?_0xad4d44:_0x3b4f3b:null;var _0x3b4f3b;_0x159e80&&_0xb42804['push'](_0x159e80),_0xb42804['push'](_0x4781c5['of']([..._0x14a4c1,..._0x1b2a9c,..._0x279433,..._0x5e10be,..._0x3b30c2,{'key':'Tab','run':_0x51c22d,'shift':_0x1a273d,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x5e9c86,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x5e9c86,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x9d6477,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x535854=new _0x53f418({'extensions':_0xb42804,'parent':_0x59069e['parent']});return _0x34de91(_0x535854),{'focus':()=>{_0x535854['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x535854['focus']();},'getData':()=>_0x535854['state']['doc']['toString'](),'setData':_0x533cf0=>{_0x535854['dispatch']({'changes':{'from':0x0,'to':_0x535854['state']['doc']['length'],'insert':_0x533cf0},'annotations':_0x3b5728['addToHistory']['of'](!0x1)});},'setReadOnly':_0x34f4f0=>{_0x535854['dispatch']({'effects':[_0x2761b0['reconfigure'](_0x53f418['editable']['of'](!_0x34f4f0))]});},'destroy':()=>{_0x535854['destroy']();},'instance':_0x535854};}var Z=class extends _0x1585d2{['_codeEditorApi']=null;['_options'];constructor(_0x2bdd93,_0x50634c){super(_0x2bdd93),this['_options']=_0x50634c,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',(_0x38a1d9,_0x434264,_0x2bf6c0)=>{this['setReadOnly'](_0x2bf6c0);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x402dad){this['_codeEditorApi']['setData'](_0x402dad);}['setReadOnly'](_0x879e32){this['_codeEditorApi']['setReadOnly'](_0x879e32);}};const G='SourceEditingEnhancedMode';var W=class extends _0x1ddc59{constructor(_0x4adc7b){super(_0x4adc7b),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x1872e7)['on']('change:hasAny',(_0xfb1de2,_0x402112,_0x4dc48f)=>{_0x4dc48f?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x226fb5=this['editor'];for(const _0x1ae145 of _0x226fb5['commands']['names']())['replaceSource','editSource']['includes'](_0x1ae145)||_0x226fb5['commands']['get'](_0x1ae145)['forceDisabled'](G);}['_enableCommands'](){const _0x368e69=this['editor'];for(const _0x1f83bd of _0x368e69['commands']['commands']())_0x1f83bd['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0x3a2bc6=this['editor'],_0x151db2=_0x3a2bc6['locale'],_0x55f410=_0x3a2bc6['plugins']['get']('Dialog'),_0x18febf=B(_0x3a2bc6),_0xdeac3e=J(_0x20240f=_0x3a2bc6['data']['get']({'rootName':_0x18febf}))?_0x20f422(_0x20240f):_0x20240f;var _0x20240f;const _0x52bf2e=new Z(_0x151db2,{'syntaxLanguage':_0x3a2bc6['plugins']['has']('Markdown')?'markdown':'html','theme':_0x3a2bc6['config']['get']('sourceEditingEnhanced.theme')});let _0x1dc496=!0x0;const _0x39a3d8=_0x4ceb48=>{if(_0x1dc496&&Y(_0x52bf2e['getData']())!==Y(_0xdeac3e))return window['confirm'](Q(_0x151db2,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x4ceb48['stop']();};_0x55f410['show']({'id':'sourceEditingEnhanced','title':Q(_0x151db2,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x52bf2e,'actionButtons':[{'label':Q(_0x151db2,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x55f410['hide']();}},{'label':Q(_0x151db2,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x5a72cf=Y(_0x52bf2e['getData']())!==Y(_0xdeac3e);_0x5a72cf&&_0x3a2bc6['execute']('replaceSource',_0x52bf2e['getData']()),_0x1dc496=!0x1,_0x55f410['hide'](),_0x5a72cf&&'editables'in _0x3a2bc6['ui']['view']&&_0x3a2bc6['ui']['view']['editables'][_0x18febf]['element']['focus']();},'onCreate':_0x25153b=>{_0x25153b['set']('isEnabled',!_0x3a2bc6['isReadOnly']),_0x25153b['bind']('isEnabled')['to'](_0x3a2bc6,'isReadOnly',this,'isEnabled',(_0xacd0ce,_0x25ac78)=>!_0xacd0ce&&_0x25ac78);}}],'onHide':()=>{this['_enableCommands'](),_0x55f410['off']('hide',_0x39a3d8),_0x52bf2e['destroy']();},'onShow':()=>{_0x52bf2e['bind']('isReadOnly')['to'](_0x3a2bc6,'isReadOnly',this,'isEnabled',(_0x20d504,_0x14dc16)=>_0x20d504||!_0x14dc16),_0x52bf2e['setData'](_0xdeac3e),_0x52bf2e['focus'](),_0x55f410['on']('hide',_0x39a3d8,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x579330{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x1872e7];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3c2940=this['editor'],_0xfa38fa=_0x3c2940['locale'],_0x3b2f8d=new W(_0x3c2940);_0x3c2940['commands']['add']('editSource',_0x3b2f8d),_0x3c2940['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x28bc55=this['_createButton'](_0x491d16,_0x3b2f8d);return _0x28bc55['set']({'label':Q(_0xfa38fa,'Source'),'icon':_0x4e67c5,'tooltip':Q(_0xfa38fa,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x28bc55;}),_0x3c2940['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x52fff6=this['_createButton'](_0x34c52a,_0x3b2f8d,!0x0);return _0x52fff6['set']({'label':Q(_0xfa38fa,'Edit\x20source\x20modal\x20label'),'icon':_0x4e67c5,'role':'menuitemcheckbox'}),_0x52fff6;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0xc785cc){const _0x1f6807='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x328d36=0x78e40,_0x1b4091=window['Date']['now'](),_0x30c56f=_0xc785cc['editor'],_0x32d2a6=new window['Promise'](_0x3d2363=>{_0x30c56f['once']('ready',_0x3d2363);}),_0x3680e8={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x366c34=_0x30c56f['config']['get']('licenseKey');async function _0x35c54e(){let _0x1a0a4c,_0x5de6cc=null,_0x2e63a8=null;try{return'GPL'==_0x366c34?'NotAllowed':(_0x1a0a4c=_0x988bd3(),_0x1a0a4c?(_0x1a0a4c['usageEndpoint']&&(_0x2e63a8=_0x44bb9e(_0x1a0a4c['usageEndpoint'],_0x1a0a4c['jti'])),await _0x77a432()?_0x52e756()?_0x32b5a4()?'Expired':_0x36e5c3()?('evaluation'==_0x1a0a4c['licenseType']&&(_0x5de6cc=_0x509c97('EvaluationLimit')),await _0x79bd4f()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x32b5a4(){const _0x19af20=['evaluation','trial']['includes'](_0x1a0a4c['licenseType'])?_0x1b4091/0x3e8:0xe10*_0x328d36;return _0x1a0a4c['exp']<_0x19af20;}function _0x52e756(){const _0x9eaea6=_0x1a0a4c['features'];return!!_0x9eaea6&&(!!_0x9eaea6['includes']('*')||!!_0x9eaea6['includes']('SEE'));}function _0x36e5c3(){const _0x2832f6=_0x1a0a4c['licensedHosts'];if(!_0x2832f6||0x0==_0x2832f6['length'])return!0x0;const {hostname:_0x582d0b}=new URL(window['location']['href']);if(_0x2832f6['includes'](_0x582d0b))return!0x0;const _0x5c045a=_0x582d0b['split']('.');return _0x2832f6['filter'](_0x35473e=>_0x35473e['includes']('*'))['map'](_0x4fea3c=>_0x4fea3c['split']('.'))['filter'](_0x4cfc59=>_0x4cfc59['length']<=_0x5c045a['length'])['map'](_0x42dc02=>Array(_0x5c045a['length']-_0x42dc02['length'])['fill']('*'===_0x42dc02[0x0]?'*':'')['concat'](_0x42dc02))['some'](_0x8f5661=>_0x5c045a['every']((_0x507af9,_0x39f47b)=>_0x8f5661[_0x39f47b]===_0x507af9||'*'===_0x8f5661[_0x39f47b]));}function _0x79bd4f(){return _0x5de6cc&&_0x2e63a8?new window['Promise']((_0x1b89ad,_0x25e7af)=>{_0x5de6cc['then'](_0x1b89ad,_0x25e7af),_0x2e63a8['then'](_0x1774b0=>{'Valid'!=_0x1774b0&&_0x1b89ad(_0x1774b0);},_0x25e7af);}):_0x5de6cc||_0x2e63a8||'Valid';}}function _0x44bb9e(_0x5681f3,_0x2294a9){return new window['Promise'](_0x1363f5=>{if(_0x2466ec())return _0x1363f5('Valid');_0x3096a7(),_0x30c56f['decorate']('_sendUsageRequest');let _0x1e7efb=!0x1;const _0x15bf52=_0xf7647f();function _0x1c8dc4(_0x11c7a8){return!!_0x11c7a8&&('object'==typeof _0x11c7a8||'function'==typeof _0x11c7a8)&&'function'==typeof _0x11c7a8['then']&&'function'==typeof _0x11c7a8['catch'];}function _0x148594(_0x4c09cc){_0x5cff24(_0x4c09cc)['then'](_0x58e0e1=>_0x58e0e1&&'ok'==_0x58e0e1['status']?_0xb74b02(_0x3e8ee3(_0x15bf52+_0x2294a9))!=_0x58e0e1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5b0437=>(_0x51021f(),_0x5b0437),()=>{const _0x266cb2=_0x440fc5();return null==_0x266cb2?(_0x51021f(),'Valid'):_0x1b4091-_0x266cb2>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1363f5)['catch'](()=>{_0x1363f5('UsageLimit');});const _0x5097d5=0x36ee80;function _0x51021f(){const _0x13d9ab='llct-'+_0xb74b02(_0x3e8ee3(_0x5681f3)),_0x6b59ca=_0x4f2bda(_0xb74b02(window['Math']['ceil'](_0x1b4091/_0x5097d5)));window['localStorage']['setItem'](_0x13d9ab,_0x6b59ca);}function _0x440fc5(){const _0x515e4e='llct-'+_0xb74b02(_0x3e8ee3(_0x5681f3)),_0x194c49=window['localStorage']['getItem'](_0x515e4e);return _0x194c49?window['parseInt'](_0x4f2bda(_0x194c49),0x10)*_0x5097d5:null;}function _0x5cff24(_0x503d34){return new window['Promise']((_0x3cef74,_0x1017a7)=>{_0x503d34['then'](_0x3cef74,_0x1017a7),window['setTimeout'](_0x1017a7,0x1d4c0);});}}_0x30c56f['on']('_sendUsageRequest',(_0x222ef3,_0x5b42f1)=>{if(_0x5b42f1[0x0]!=_0x5681f3)return _0x1363f5('UsageLimit');_0x5b42f1[0x1]={..._0x5b42f1[0x1],'requestId':_0x15bf52};},{'priority':'high'}),_0x30c56f['on']('_sendUsageRequest',_0x547ec0=>{_0x1c8dc4(_0x547ec0['return'])&&(_0x1e7efb=!0x0,_0x148594(_0x547ec0['return']));},{'priority':'low'}),_0x32d2a6['then'](()=>{_0x1e7efb||_0x1363f5('UsageLimit');});});function _0x2466ec(){return'auto'==_0x30c56f['editing']['view']['_overlayModeHint'];}function _0x3096a7(){_0x30c56f['editing']['view']['_overlayModeHint']='auto';}}function _0x509c97(_0x3af9af){const _0x29dd62=[new window['Promise'](_0x3bcdd8=>setTimeout(_0x3bcdd8,0x93ecc)),_0x32d2a6['then'](()=>new window['Promise'](_0x40f755=>{let _0x14f189=0x0;_0x30c56f['model']['on']('applyOperation',(_0x31b3e4,_0x26aeba)=>{_0x26aeba[0x0]['isDocumentOperation']&&_0x14f189++,0x5e8==_0x14f189&&(_0x40f755(),_0x31b3e4['off']());});}))];return window['Promise']['race'](_0x29dd62)['then'](()=>_0x3af9af);}async function _0x74e33(){await _0x32d2a6,_0x30c56f['model']['change']=_0x1325d0,_0x30c56f['model']['enqueueChange']=_0x1325d0,_0x30c56f['enableReadOnlyMode']('model');}function _0x477795(_0x318e50){const _0x14063a=_0x4f2da9();_0x30c56f[_0x14063a]='sourceEditingEnhancedLicenseKey'+_0x318e50,'Valid'!=_0x318e50&&_0x74e33();}function _0x4f2da9(){const _0x419c12=window['String'](window['performance']['now']())['replace']('.','');let _0x36c26f='N';for(let _0x45fd95=0x0;_0x45fd95<_0x419c12['length'];_0x45fd95+=0x2){let _0x21fa8d=window['parseInt'](_0x419c12['substring'](_0x45fd95,_0x45fd95+0x2));_0x21fa8d>=0x3e&&(_0x21fa8d-=0x3e),_0x36c26f+=_0x1f6807[_0x21fa8d];}return _0x36c26f;}function _0x988bd3(){const _0x2634b4=_0x366c34['split']('.');if(0x3!=_0x2634b4['length'])return null;return _0x365ab9(_0x2634b4[0x1]);function _0x365ab9(_0x2db03f){const _0x46247c=_0x30162e(_0x2db03f);return _0x46247c&&_0x2522f7()?_0x46247c:null;function _0x2522f7(){const _0x43ded2=_0x46247c['jti'],_0x467488=window['parseInt'](_0x43ded2['substring'](_0x43ded2['length']-0x8),0x10),_0x181185={..._0x46247c,'jti':_0x43ded2['substring'](0x0,_0x43ded2['length']-0x8)};return delete _0x181185['vc'],_0x3e8ee3(_0x181185)==_0x467488;}}}async function _0x77a432(){let _0x3c98ac=!0x0;try{const [_0x49cd1f,_0x517aae,_0x56b870]=_0x366c34['split']('.');return _0x461a95(_0x49cd1f),await _0x1548ed(_0x49cd1f,_0x517aae,_0x56b870),_0x3c98ac;}catch{return!0x1;}function _0x461a95(_0x37acea){const _0x441304=_0x30162e(_0x37acea);_0x441304&&'ES256'==_0x441304['alg']||(_0x3c98ac=!0x1);}async function _0x1548ed(_0x3239f5,_0x1e80ea,_0x15a677){const _0x13a324=window['Uint8Array']['from'](_0x73176e(_0x15a677),_0x2aae45=>_0x2aae45['charCodeAt'](0x0)),_0x29e8a2=new window['TextEncoder']()['encode'](_0x3239f5+'.'+_0x1e80ea),_0x5a8b71=window['crypto']['subtle'];if(!_0x5a8b71)return;const _0x3624c7=await _0x5a8b71['importKey']('jwk',_0x3680e8,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x5a8b71['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3624c7,_0x13a324,_0x29e8a2)||(_0x3c98ac=!0x1);}}function _0x30162e(_0x89297f){return _0x89297f['startsWith']('ey')?JSON['parse'](_0x73176e(_0x89297f)):null;}function _0x73176e(_0x33e80f){return window['atob'](_0x33e80f['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3e8ee3(_0x83190e){let _0x57ddc7=0x1505;function _0x3fe3c8(_0x2610e9){for(let _0x5c1e20=0x0;_0x5c1e20<_0x2610e9['length'];_0x5c1e20++){const _0x13d3cf=_0x2610e9['charCodeAt'](_0x5c1e20);_0x57ddc7=(_0x57ddc7<<0x5)+_0x57ddc7+_0x13d3cf,_0x57ddc7&=_0x57ddc7;}}function _0x5c06ec(_0x9625fa){Array['isArray'](_0x9625fa)?_0x9625fa['forEach'](_0x5c06ec):_0x9625fa&&'object'==typeof _0x9625fa?Object['entries'](_0x9625fa)['sort']()['forEach'](([_0x1abb01,_0x2d346b])=>{_0x3fe3c8(_0x1abb01),_0x5c06ec(_0x2d346b);}):_0x3fe3c8(window['String'](_0x9625fa));}return _0x5c06ec(_0x83190e),_0x57ddc7>>>0x0;}function _0xb74b02(_0x29a62d){return _0x29a62d['toString'](0x10)['padStart'](0x8,'0');}function _0x4f2bda(_0x4aa12d){return _0x4aa12d['split']('')['reverse']()['join']('');}function _0x1325d0(){}_0x477795(await _0x35c54e());}(this);}['_createButton'](_0x55d24e,_0x561c8f,_0x2ca0d0=!0x1){const _0x4bef37=new _0x55d24e(this['editor']['locale']);return _0x4bef37['set']({'withText':_0x2ca0d0,'isToggleable':!0x1}),_0x4bef37['bind']('isEnabled')['to'](_0x561c8f,'isEnabled'),this['listenTo'](_0x4bef37,'execute',()=>_0x561c8f['execute']()),_0x4bef37;}['_registerKeybindings'](){const _0xf52464=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0xf52464,'Source\x20Editing\x20Enhanced')});const _0x44d762=_0x438824['isMac']||_0x438824['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0xf52464,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0xf52464,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0xf52464,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0xf52464,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0xf52464,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0xf52464,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0xf52464,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x44d762?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0xf52464,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0xf52464,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0xf52464,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0xf52464,'Select\x20line'),'keystroke':_0x44d762?'Ctrl!+L':'Alt+L'},{'label':Q(_0xf52464,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x44d762?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0xf52464,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0xf52464,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0xf52464,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0xf52464,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0xf52464,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x44d762?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x1ddc59{constructor(_0x4240b4){super(_0x4240b4),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x41c006,_0x1736ef){const _0x542ed7=this['editor'],_0x541d07=_0x1736ef?.['rootName']??B(_0x542ed7);_0x542ed7['data']['set']({[_0x541d07]:_0x41c006},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x579330{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x5aad08){super(_0x5aad08),_0x5aad08['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}['init'](){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x201374=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1e89ca;for(const _0x4fb9e4 in _0x201374){const _0x3f9f33=_0x4fb9e4,_0x149258=_0x201374[_0x3f9f33];if('sourceEditingEnhancedLicenseKeyValid'==_0x149258||'sourceEditingEnhancedLicenseKeyInvalid'==_0x149258||'sourceEditingEnhancedLicenseKeyExpired'==_0x149258||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x149258||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x149258||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x149258||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x149258){delete _0x201374[_0x3f9f33],_0x1e89ca=_0x149258,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x1e89ca&&_0x201374['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x1e89ca&&_0x201374['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x1e89ca&&_0x201374['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x1e89ca&&_0x201374['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x1e89ca&&_0x201374['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x1e89ca&&_0x201374['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x444c48=this['editor'],_0x39052a=_0x444c48['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x39052a&&_0x444c48['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x1bec98('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x39052a&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x2da09b=>_0x444c48['plugins']['has'](_0x2da09b))&&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.'),_0x444c48['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-source-editing-enhanced",
|
|
3
|
-
"version": "48.3.0-alpha.
|
|
3
|
+
"version": "48.3.0-alpha.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/)",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"dist/translations/*.umd.js"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ckeditor/ckeditor5-core": "48.3.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.
|
|
28
|
+
"@ckeditor/ckeditor5-core": "48.3.0-alpha.5",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "48.3.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.5",
|
|
32
|
+
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.5",
|
|
33
33
|
"@codemirror/autocomplete": "^6.7.1",
|
|
34
34
|
"@codemirror/commands": "6.8.1",
|
|
35
35
|
"@codemirror/lang-html": "^6.0.0",
|