@ckeditor/ckeditor5-source-editing-enhanced 48.4.0-alpha.4 → 48.4.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 _0x3b2fde,PendingActions as _0x3f715c,Plugin as _0x54c4a5}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x510066,env as _0x592e7f,formatHtml as _0x4b4a77,uid as _0x573555}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x297380}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x49d334,MenuBarMenuListItemButtonView as _0x2517f8,View as _0x5778db}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x30aaa2,crosshairCursor as _0x3be862,drawSelection as _0x48c87b,dropCursor as _0x4e624a,highlightActiveLine as _0x59deb6,highlightActiveLineGutter as _0x46c5e2,highlightSpecialChars as _0x821633,keymap as _0x49531d,lineNumbers as _0x5b7bed,rectangularSelection as _0x3edb11}from'@codemirror/view';import{Compartment as _0x315de1,Transaction as _0x4ee730}from'@codemirror/state';import{bracketMatching as _0x6542a8,defaultHighlightStyle as _0x239333,foldGutter as _0x3db8d5,foldKeymap as _0x2deeee,indentOnInput as _0x416efd,syntaxHighlighting as _0x114268}from'@codemirror/language';import{defaultKeymap as _0x37056c,history as _0x58208f,historyKeymap as _0x5357ec,indentLess as _0x16acc4,indentMore as _0x4524c0,redo as _0x1d465e,toggleTabFocusMode as _0x1f9b2d,undo as _0x6777f1}from'@codemirror/commands';import{autocompletion as _0x14ea03,closeBrackets as _0x3275ce,closeBracketsKeymap as _0x239dcc,completionKeymap as _0x172af3}from'@codemirror/autocomplete';import{html as _0x4cbd56}from'@codemirror/lang-html';import{markdown as _0xab2fec}from'@codemirror/lang-markdown';import{oneDark as _0x274762}from'@codemirror/theme-one-dark';function Q(_0xc9d228,_0x26e22a){const t=_0xc9d228['t'];switch(_0x26e22a){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 _0x26e22a;}}function B(_0x3e18d3){const _0x9e9395=_0x3e18d3['editing']['view']['document']['roots'],_0x1a0379=_0x9e9395['length'];if(0x0===_0x1a0379)throw new _0x510066('source-editing-enhanced-editor-no-root',_0x3e18d3);return 0x1===_0x1a0379?_0x9e9395['first']['rootName']:Array['from'](_0x3e18d3['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x51aee0){return J(_0x51aee0['replace'](/^[\n\s]*/g,''))?_0x51aee0['replace'](/\s+/g,''):_0x51aee0;}function J(_0x51f10d){return _0x51f10d['startsWith']('<');}function X(_0x1b2fc7){const _0x5936a1=[_0x30aaa2['lineWrapping'],_0x14ea03(),_0x6542a8(),_0x3275ce(),_0x3be862(),_0x48c87b(),_0x4e624a(),_0x5b7bed(),_0x3db8d5(),_0x59deb6(),_0x46c5e2(),_0x821633(),_0x58208f(),_0x416efd(),_0x3edb11(),_0x114268(_0x239333,{'fallback':!0x0})],_0x3f3eed=new _0x315de1();_0x5936a1['push'](_0x3f3eed['of'](_0x30aaa2['editable']['of'](!0x0))),'html'===_0x1b2fc7['syntaxLanguage']?_0x5936a1['push'](_0x4cbd56()):_0x5936a1['push'](_0xab2fec());const _0x2c70e5=(_0x16f096=_0x1b2fc7['theme'])&&'default'!==_0x16f096?'dark'===_0x16f096?_0x274762:_0x16f096:null;var _0x16f096;_0x2c70e5&&_0x5936a1['push'](_0x2c70e5),_0x5936a1['push'](_0x49531d['of']([..._0x239dcc,..._0x37056c,..._0x5357ec,..._0x2deeee,..._0x172af3,{'key':'Tab','run':_0x4524c0,'shift':_0x16acc4,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x1d465e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x1d465e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x6777f1,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x5dd615=new _0x30aaa2({'extensions':_0x5936a1,'parent':_0x1b2fc7['parent']});return _0x1f9b2d(_0x5dd615),{'focus':()=>{_0x5dd615['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x5dd615['focus']();},'getData':()=>_0x5dd615['state']['doc']['toString'](),'setData':_0x5d610e=>{_0x5dd615['dispatch']({'changes':{'from':0x0,'to':_0x5dd615['state']['doc']['length'],'insert':_0x5d610e},'annotations':_0x4ee730['addToHistory']['of'](!0x1)});},'setReadOnly':_0x3d4d6d=>{_0x5dd615['dispatch']({'effects':[_0x3f3eed['reconfigure'](_0x30aaa2['editable']['of'](!_0x3d4d6d))]});},'destroy':()=>{_0x5dd615['destroy']();},'instance':_0x5dd615};}var Z=class extends _0x5778db{_codeEditorApi=null;_options;constructor(_0x2bf3bc,_0x114493){super(_0x2bf3bc),this['_options']=_0x114493,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',(_0x99becf,_0x3f7b9b,_0x82b664)=>{this['setReadOnly'](_0x82b664);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x1b4dce){this['_codeEditorApi']['setData'](_0x1b4dce);}setReadOnly(_0x102d53){this['_codeEditorApi']['setReadOnly'](_0x102d53);}};const G='SourceEditingEnhancedMode';var W=class extends _0x3b2fde{constructor(_0xcf4044){super(_0xcf4044),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x3f715c)['on']('change:hasAny',(_0x497997,_0xca86da,_0x4dd816)=>{_0x4dd816?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x24d3ab=this['editor'];for(const _0x17f6d3 of _0x24d3ab['commands']['names']())['replaceSource','editSource']['includes'](_0x17f6d3)||_0x24d3ab['commands']['get'](_0x17f6d3)['forceDisabled'](G);}['_enableCommands'](){const _0x2888cc=this['editor'];for(const _0x487f8e of _0x2888cc['commands']['commands']())_0x487f8e['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x3431f8=this['editor'],_0x22655f=_0x3431f8['locale'],_0x1a6be2=_0x3431f8['plugins']['get']('Dialog'),_0x2a7ed6=B(_0x3431f8),_0x1361db=J(_0x649978=_0x3431f8['data']['get']({'rootName':_0x2a7ed6}))?_0x4b4a77(_0x649978):_0x649978;var _0x649978;const _0x1c16ce=new Z(_0x22655f,{'syntaxLanguage':_0x3431f8['plugins']['has']('Markdown')?'markdown':'html','theme':_0x3431f8['config']['get']('sourceEditingEnhanced.theme')});let _0x5e527f=!0x0;const _0x5e6903=_0x6c3fc9=>{if(_0x5e527f&&Y(_0x1c16ce['getData']())!==Y(_0x1361db))return window['confirm'](Q(_0x22655f,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x6c3fc9['stop']();};_0x1a6be2['show']({'id':'sourceEditingEnhanced','title':Q(_0x22655f,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x1c16ce,'actionButtons':[{'label':Q(_0x22655f,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x1a6be2['hide']();}},{'label':Q(_0x22655f,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x226fda=Y(_0x1c16ce['getData']())!==Y(_0x1361db);_0x226fda&&_0x3431f8['execute']('replaceSource',_0x1c16ce['getData']()),_0x5e527f=!0x1,_0x1a6be2['hide'](),_0x226fda&&'editables'in _0x3431f8['ui']['view']&&_0x3431f8['ui']['view']['editables'][_0x2a7ed6]['element']['focus']();},'onCreate':_0x19ffeb=>{_0x19ffeb['set']('isEnabled',!_0x3431f8['isReadOnly']),_0x19ffeb['bind']('isEnabled')['to'](_0x3431f8,'isReadOnly',this,'isEnabled',(_0x3d9ec9,_0x3ddf74)=>!_0x3d9ec9&&_0x3ddf74);}}],'onHide':()=>{this['_enableCommands'](),_0x1a6be2['off']('hide',_0x5e6903),_0x1c16ce['destroy']();},'onShow':()=>{_0x1c16ce['bind']('isReadOnly')['to'](_0x3431f8,'isReadOnly',this,'isEnabled',(_0x43383d,_0x414098)=>_0x43383d||!_0x414098),_0x1c16ce['setData'](_0x1361db),_0x1c16ce['focus'](),_0x1a6be2['on']('hide',_0x5e6903,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x54c4a5{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x3f715c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x44bff1=this['editor'],_0x387211=_0x44bff1['locale'],_0x34c7d9=new W(_0x44bff1);_0x44bff1['commands']['add']('editSource',_0x34c7d9),_0x44bff1['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x1b7f06=this['_createButton'](_0x49d334,_0x34c7d9);return _0x1b7f06['set']({'label':Q(_0x387211,'Source'),'icon':_0x297380,'tooltip':Q(_0x387211,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x1b7f06;}),_0x44bff1['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x36865f=this['_createButton'](_0x2517f8,_0x34c7d9,!0x0);return _0x36865f['set']({'label':Q(_0x387211,'Edit\x20source\x20modal\x20label'),'icon':_0x297380,'role':'menuitemcheckbox'}),_0x36865f;}),this['_registerKeybindings']();}afterInit(){!async function(_0x2cb856){const _0x4ff35f='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x8aa1a1=0x79188,_0x29cd40=window['Date']['now'](),_0x23b678=_0x2cb856['editor'],_0x2c6367=new window['Promise'](_0x1b1d5e=>{_0x23b678['once']('ready',_0x1b1d5e);}),_0x5d3e2b={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x58fed2=_0x23b678['config']['get']('licenseKey');async function _0x44b13d(){let _0x162c2c,_0x2258c9=null,_0x23149a=null;try{return'GPL'==_0x58fed2?'NotAllowed':(_0x162c2c=_0x55d034(),_0x162c2c?(_0x162c2c['usageEndpoint']&&(_0x23149a=_0x4556c0(_0x162c2c['usageEndpoint'],_0x162c2c['jti'])),await _0x46f8d6()?_0x9e4771()?_0x3ed258()?'Expired':_0x47586d()?('evaluation'==_0x162c2c['licenseType']&&(_0x2258c9=_0x2757bb('EvaluationLimit')),await _0x5d6600()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3ed258(){const _0x383197=['evaluation','trial']['includes'](_0x162c2c['licenseType'])?_0x29cd40/0x3e8:0xe10*_0x8aa1a1;return _0x162c2c['exp']<_0x383197;}function _0x9e4771(){const _0x58fdd1=_0x162c2c['features'];return!!_0x58fdd1&&(!!_0x58fdd1['includes']('*')||!!_0x58fdd1['includes']('SEE'));}function _0x47586d(){const _0x39d7c6=_0x162c2c['licensedHosts'];if(!_0x39d7c6||0x0==_0x39d7c6['length'])return!0x0;const {hostname:_0x10a86b}=new URL(window['location']['href']);if(_0x39d7c6['includes'](_0x10a86b))return!0x0;const _0x4c533b=_0x10a86b['split']('.');return _0x39d7c6['filter'](_0x2e7cf2=>_0x2e7cf2['includes']('*'))['map'](_0x375e90=>_0x375e90['split']('.'))['filter'](_0x2b73f0=>_0x2b73f0['length']<=_0x4c533b['length'])['map'](_0xeff94f=>Array(_0x4c533b['length']-_0xeff94f['length'])['fill']('*'===_0xeff94f[0x0]?'*':'')['concat'](_0xeff94f))['some'](_0x502554=>_0x4c533b['every']((_0x2e9dd6,_0x3c32a5)=>_0x502554[_0x3c32a5]===_0x2e9dd6||'*'===_0x502554[_0x3c32a5]));}function _0x5d6600(){return _0x2258c9&&_0x23149a?new window['Promise']((_0x4d9f09,_0x367dde)=>{_0x2258c9['then'](_0x4d9f09,_0x367dde),_0x23149a['then'](_0x3959bb=>{'Valid'!=_0x3959bb&&_0x4d9f09(_0x3959bb);},_0x367dde);}):_0x2258c9||_0x23149a||'Valid';}}function _0x4556c0(_0x1deb41,_0x100084){return new window['Promise'](_0x50bd8f=>{if(_0x4c7e67())return _0x50bd8f('Valid');_0x17e612(),_0x23b678['decorate']('_sendUsageRequest');let _0xd82dfe=!0x1;const _0x554fd4=_0x573555();function _0x19e275(_0x586677){return!!_0x586677&&('object'==typeof _0x586677||'function'==typeof _0x586677)&&'function'==typeof _0x586677['then']&&'function'==typeof _0x586677['catch'];}function _0x11ecb2(_0x39ceb1){_0x3f3569(_0x39ceb1)['then'](_0x3b6017=>_0x3b6017&&'ok'==_0x3b6017['status']?_0x5c1b82(_0x5d1007(_0x554fd4+_0x100084))!=_0x3b6017['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3b8aa1=>(_0x32d947(),_0x3b8aa1),()=>{const _0x2ba024=_0x57678a();return null==_0x2ba024?(_0x32d947(),'Valid'):_0x29cd40-_0x2ba024>0x240c8400?'UsageLimit':'Valid';})['then'](_0x50bd8f)['catch'](()=>{_0x50bd8f('UsageLimit');});const _0x563d9b=0x36ee80;function _0x32d947(){const _0x18f060='llct-'+_0x5c1b82(_0x5d1007(_0x1deb41)),_0x267f8a=_0x89e6f0(_0x5c1b82(window['Math']['ceil'](_0x29cd40/_0x563d9b)));window['localStorage']['setItem'](_0x18f060,_0x267f8a);}function _0x57678a(){const _0x36129e='llct-'+_0x5c1b82(_0x5d1007(_0x1deb41)),_0x5837e0=window['localStorage']['getItem'](_0x36129e);return _0x5837e0?window['parseInt'](_0x89e6f0(_0x5837e0),0x10)*_0x563d9b:null;}function _0x3f3569(_0xdd6c68){return new window['Promise']((_0x390929,_0x43a362)=>{_0xdd6c68['then'](_0x390929,_0x43a362),window['setTimeout'](_0x43a362,0x1d4c0);});}}_0x23b678['on']('_sendUsageRequest',(_0x4b6c30,_0x47e741)=>{if(_0x47e741[0x0]!=_0x1deb41)return _0x50bd8f('UsageLimit');_0x47e741[0x1]={..._0x47e741[0x1],'requestId':_0x554fd4};},{'priority':'high'}),_0x23b678['on']('_sendUsageRequest',_0xc1f210=>{_0x19e275(_0xc1f210['return'])&&(_0xd82dfe=!0x0,_0x11ecb2(_0xc1f210['return']));},{'priority':'low'}),_0x2c6367['then'](()=>{_0xd82dfe||_0x50bd8f('UsageLimit');});});function _0x4c7e67(){return'auto'==_0x23b678['editing']['view']['_overlayModeHint'];}function _0x17e612(){_0x23b678['editing']['view']['_overlayModeHint']='auto';}}function _0x2757bb(_0x2111ac){const _0x2941c9=[new window['Promise'](_0x198f1d=>setTimeout(_0x198f1d,0x93ecc)),_0x2c6367['then'](()=>new window['Promise'](_0x4ad7cd=>{let _0x2a5644=0x0;_0x23b678['model']['on']('applyOperation',(_0xce1c5f,_0x41cbda)=>{_0x41cbda[0x0]['isDocumentOperation']&&_0x2a5644++,0x5e8==_0x2a5644&&(_0x4ad7cd(),_0xce1c5f['off']());});}))];return window['Promise']['race'](_0x2941c9)['then'](()=>_0x2111ac);}async function _0x4aefe5(){await _0x2c6367,_0x23b678['model']['change']=_0x54e9d2,_0x23b678['model']['enqueueChange']=_0x54e9d2,_0x23b678['enableReadOnlyMode']('model');}function _0x2ae657(_0x14ef92){const _0x152cd5=_0x4cc027();_0x23b678[_0x152cd5]='sourceEditingEnhancedLicenseKey'+_0x14ef92,'Valid'!=_0x14ef92&&_0x4aefe5();}function _0x4cc027(){const _0x1edb60=window['String'](window['performance']['now']())['replace']('.','');let _0x5c77ab='N';for(let _0x147583=0x0;_0x147583<_0x1edb60['length'];_0x147583+=0x2){let _0x3efe8c=window['parseInt'](_0x1edb60['substring'](_0x147583,_0x147583+0x2));_0x3efe8c>=0x3e&&(_0x3efe8c-=0x3e),_0x5c77ab+=_0x4ff35f[_0x3efe8c];}return _0x5c77ab;}function _0x55d034(){const _0x5ed557=_0x58fed2['split']('.');if(0x3!=_0x5ed557['length'])return null;return _0xd23fb0(_0x5ed557[0x1]);function _0xd23fb0(_0x420f52){const _0x3f56d3=_0x2bf792(_0x420f52);return _0x3f56d3&&_0x415ca7()?_0x3f56d3:null;function _0x415ca7(){const _0x59a399=_0x3f56d3['jti'],_0x3d753d=window['parseInt'](_0x59a399['substring'](_0x59a399['length']-0x8),0x10),_0x5cc7b4={..._0x3f56d3,'jti':_0x59a399['substring'](0x0,_0x59a399['length']-0x8)};return delete _0x5cc7b4['vc'],_0x5d1007(_0x5cc7b4)==_0x3d753d;}}}async function _0x46f8d6(){let _0x36c4a8=!0x0;try{const [_0xdcf931,_0x2e611a,_0xd484ef]=_0x58fed2['split']('.');return _0x5d5659(_0xdcf931),await _0x17d577(_0xdcf931,_0x2e611a,_0xd484ef),_0x36c4a8;}catch{return!0x1;}function _0x5d5659(_0x22163c){const _0x4d38a6=_0x2bf792(_0x22163c);_0x4d38a6&&'ES256'==_0x4d38a6['alg']||(_0x36c4a8=!0x1);}async function _0x17d577(_0x4696a0,_0x3609ff,_0x5b77d2){const _0x50b0f5=window['Uint8Array']['from'](_0x584f68(_0x5b77d2),_0x227aea=>_0x227aea['charCodeAt'](0x0)),_0x51c8f5=new window['TextEncoder']()['encode'](_0x4696a0+'.'+_0x3609ff),_0xf6e742=window['crypto']['subtle'];if(!_0xf6e742)return;const _0x34fbe3=await _0xf6e742['importKey']('jwk',_0x5d3e2b,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0xf6e742['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x34fbe3,_0x50b0f5,_0x51c8f5)||(_0x36c4a8=!0x1);}}function _0x2bf792(_0x2e3a9a){return _0x2e3a9a['startsWith']('ey')?JSON['parse'](_0x584f68(_0x2e3a9a)):null;}function _0x584f68(_0x5b9135){return window['atob'](_0x5b9135['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5d1007(_0x29ccc3){let _0x3af90f=0x1505;function _0x14f58e(_0xed85d2){for(let _0x195f7c=0x0;_0x195f7c<_0xed85d2['length'];_0x195f7c++){const _0x17dc8b=_0xed85d2['charCodeAt'](_0x195f7c);_0x3af90f=(_0x3af90f<<0x5)+_0x3af90f+_0x17dc8b,_0x3af90f&=_0x3af90f;}}function _0x58cb01(_0x242c63){Array['isArray'](_0x242c63)?_0x242c63['forEach'](_0x58cb01):_0x242c63&&'object'==typeof _0x242c63?Object['entries'](_0x242c63)['sort']()['forEach'](([_0x1c8539,_0x4058b])=>{_0x14f58e(_0x1c8539),_0x58cb01(_0x4058b);}):_0x14f58e(window['String'](_0x242c63));}return _0x58cb01(_0x29ccc3),_0x3af90f>>>0x0;}function _0x5c1b82(_0x5962f9){return _0x5962f9['toString'](0x10)['padStart'](0x8,'0');}function _0x89e6f0(_0x4e3b39){return _0x4e3b39['split']('')['reverse']()['join']('');}function _0x54e9d2(){}_0x2ae657(await _0x44b13d());}(this);}_createButton(_0x40dd92,_0xbfda4d,_0x219149=!0x1){const _0x544979=new _0x40dd92(this['editor']['locale']);return _0x544979['set']({'withText':_0x219149,'isToggleable':!0x1}),_0x544979['bind']('isEnabled')['to'](_0xbfda4d,'isEnabled'),this['listenTo'](_0x544979,'execute',()=>_0xbfda4d['execute']()),_0x544979;}_registerKeybindings(){const _0xd4b374=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0xd4b374,'Source\x20Editing\x20Enhanced')});const _0x349817=_0x592e7f['isMac']||_0x592e7f['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0xd4b374,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0xd4b374,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0xd4b374,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0xd4b374,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0xd4b374,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0xd4b374,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0xd4b374,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x349817?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0xd4b374,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0xd4b374,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0xd4b374,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0xd4b374,'Select\x20line'),'keystroke':_0x349817?'Ctrl!+L':'Alt+L'},{'label':Q(_0xd4b374,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x349817?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0xd4b374,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0xd4b374,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0xd4b374,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0xd4b374,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0xd4b374,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x349817?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x3b2fde{constructor(_0x300e36){super(_0x300e36),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x394257,_0x207043){const _0x29374e=this['editor'],_0x40ac7e=_0x207043?.['rootName']??B(_0x29374e);_0x29374e['data']['set']({[_0x40ac7e]:_0x394257},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x54c4a5{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0xfeb3d7){super(_0xfeb3d7),_0xfeb3d7['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 _0x3a1b20=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3a3ca1;for(const _0xcb84e1 in _0x3a1b20){const _0x305ce5=_0xcb84e1,_0x211843=_0x3a1b20[_0x305ce5];if('sourceEditingEnhancedLicenseKeyValid'==_0x211843||'sourceEditingEnhancedLicenseKeyInvalid'==_0x211843||'sourceEditingEnhancedLicenseKeyExpired'==_0x211843||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x211843||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x211843||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x211843||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x211843){delete _0x3a1b20[_0x305ce5],_0x3a3ca1=_0x211843,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('usageLimit');},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x3c3971=this['editor'],_0x41b775=_0x3c3971['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x41b775&&_0x3c3971['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x510066('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x41b775&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0xfdfab5=>_0x3c3971['plugins']['has'](_0xfdfab5))&&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.'),_0x3c3971['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 _0x197602,PendingActions as _0x5f081f,Plugin as _0x392ff7}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4e572f,env as _0x27e0ea,formatHtml as _0x218bd9,uid as _0x5214b4}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x42be3a}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x24104b,MenuBarMenuListItemButtonView as _0x4cf236,View as _0x384686}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x5c4fb5,crosshairCursor as _0x235eaf,drawSelection as _0x4b9877,dropCursor as _0x42af7c,highlightActiveLine as _0x1bc76d,highlightActiveLineGutter as _0x286e44,highlightSpecialChars as _0x17557d,keymap as _0x1de7f3,lineNumbers as _0x148e1f,rectangularSelection as _0x28c587}from'@codemirror/view';import{Compartment as _0x38c97f,Transaction as _0x28e39d}from'@codemirror/state';import{bracketMatching as _0x35bc5e,defaultHighlightStyle as _0x171420,foldGutter as _0x385fbb,foldKeymap as _0x2ef4a4,indentOnInput as _0x54cb17,syntaxHighlighting as _0x4f810d}from'@codemirror/language';import{defaultKeymap as _0x2658ec,history as _0x16d876,historyKeymap as _0x10ca1f,indentLess as _0x6af145,indentMore as _0x58ed55,redo as _0x5f077d,toggleTabFocusMode as _0x18a2f9,undo as _0xbea1e2}from'@codemirror/commands';import{autocompletion as _0x22c2ac,closeBrackets as _0x54b491,closeBracketsKeymap as _0x2d17f4,completionKeymap as _0x42c4dc}from'@codemirror/autocomplete';import{html as _0x3138a9}from'@codemirror/lang-html';import{markdown as _0x1b2f0c}from'@codemirror/lang-markdown';import{oneDark as _0x473fe4}from'@codemirror/theme-one-dark';function Q(_0x14d662,_0x24d15d){const t=_0x14d662['t'];switch(_0x24d15d){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 _0x24d15d;}}function B(_0x3cbcda){const _0x1a53f2=_0x3cbcda['editing']['view']['document']['roots'],_0xb05345=_0x1a53f2['length'];if(0x0===_0xb05345)throw new _0x4e572f('source-editing-enhanced-editor-no-root',_0x3cbcda);return 0x1===_0xb05345?_0x1a53f2['first']['rootName']:Array['from'](_0x3cbcda['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x180e52){return J(_0x180e52['replace'](/^[\n\s]*/g,''))?_0x180e52['replace'](/\s+/g,''):_0x180e52;}function J(_0x711714){return _0x711714['startsWith']('<');}function X(_0x3d6882){const _0xb1772e=[_0x5c4fb5['lineWrapping'],_0x22c2ac(),_0x35bc5e(),_0x54b491(),_0x235eaf(),_0x4b9877(),_0x42af7c(),_0x148e1f(),_0x385fbb(),_0x1bc76d(),_0x286e44(),_0x17557d(),_0x16d876(),_0x54cb17(),_0x28c587(),_0x4f810d(_0x171420,{'fallback':!0x0})],_0x39c388=new _0x38c97f();_0xb1772e['push'](_0x39c388['of'](_0x5c4fb5['editable']['of'](!0x0))),'html'===_0x3d6882['syntaxLanguage']?_0xb1772e['push'](_0x3138a9()):_0xb1772e['push'](_0x1b2f0c());const _0x17e0bf=(_0x598923=_0x3d6882['theme'])&&'default'!==_0x598923?'dark'===_0x598923?_0x473fe4:_0x598923:null;var _0x598923;_0x17e0bf&&_0xb1772e['push'](_0x17e0bf),_0xb1772e['push'](_0x1de7f3['of']([..._0x2d17f4,..._0x2658ec,..._0x10ca1f,..._0x2ef4a4,..._0x42c4dc,{'key':'Tab','run':_0x58ed55,'shift':_0x6af145,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x5f077d,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x5f077d,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xbea1e2,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x406bf5=new _0x5c4fb5({'extensions':_0xb1772e,'parent':_0x3d6882['parent']});return _0x18a2f9(_0x406bf5),{'focus':()=>{_0x406bf5['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x406bf5['focus']();},'getData':()=>_0x406bf5['state']['doc']['toString'](),'setData':_0x3ed8d1=>{_0x406bf5['dispatch']({'changes':{'from':0x0,'to':_0x406bf5['state']['doc']['length'],'insert':_0x3ed8d1},'annotations':_0x28e39d['addToHistory']['of'](!0x1)});},'setReadOnly':_0x54e529=>{_0x406bf5['dispatch']({'effects':[_0x39c388['reconfigure'](_0x5c4fb5['editable']['of'](!_0x54e529))]});},'destroy':()=>{_0x406bf5['destroy']();},'instance':_0x406bf5};}var Z=class extends _0x384686{_codeEditorApi=null;_options;constructor(_0x4aaf62,_0x18954e){super(_0x4aaf62),this['_options']=_0x18954e,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',(_0x3c45cf,_0x721917,_0x19ff24)=>{this['setReadOnly'](_0x19ff24);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x28a0ca){this['_codeEditorApi']['setData'](_0x28a0ca);}setReadOnly(_0x4c57d2){this['_codeEditorApi']['setReadOnly'](_0x4c57d2);}};const G='SourceEditingEnhancedMode';var W=class extends _0x197602{constructor(_0x4685ea){super(_0x4685ea),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x5f081f)['on']('change:hasAny',(_0x332308,_0x1f3f04,_0x1b92b3)=>{_0x1b92b3?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x46c09c=this['editor'];for(const _0x2612db of _0x46c09c['commands']['names']())['replaceSource','editSource']['includes'](_0x2612db)||_0x46c09c['commands']['get'](_0x2612db)['forceDisabled'](G);}['_enableCommands'](){const _0x1a4e62=this['editor'];for(const _0x344159 of _0x1a4e62['commands']['commands']())_0x344159['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x291e01=this['editor'],_0x3d6d7c=_0x291e01['locale'],_0x3a5b89=_0x291e01['plugins']['get']('Dialog'),_0x1ac684=B(_0x291e01),_0x90ddc2=J(_0x489975=_0x291e01['data']['get']({'rootName':_0x1ac684}))?_0x218bd9(_0x489975):_0x489975;var _0x489975;const _0x3f2596=new Z(_0x3d6d7c,{'syntaxLanguage':_0x291e01['plugins']['has']('Markdown')?'markdown':'html','theme':_0x291e01['config']['get']('sourceEditingEnhanced.theme')});let _0x505244=!0x0;const _0x4d4664=_0x1abcd9=>{if(_0x505244&&Y(_0x3f2596['getData']())!==Y(_0x90ddc2))return window['confirm'](Q(_0x3d6d7c,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x1abcd9['stop']();};_0x3a5b89['show']({'id':'sourceEditingEnhanced','title':Q(_0x3d6d7c,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x3f2596,'actionButtons':[{'label':Q(_0x3d6d7c,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x3a5b89['hide']();}},{'label':Q(_0x3d6d7c,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x2975df=Y(_0x3f2596['getData']())!==Y(_0x90ddc2);_0x2975df&&_0x291e01['execute']('replaceSource',_0x3f2596['getData']()),_0x505244=!0x1,_0x3a5b89['hide'](),_0x2975df&&'editables'in _0x291e01['ui']['view']&&_0x291e01['ui']['view']['editables'][_0x1ac684]['element']['focus']();},'onCreate':_0x13eac6=>{_0x13eac6['set']('isEnabled',!_0x291e01['isReadOnly']),_0x13eac6['bind']('isEnabled')['to'](_0x291e01,'isReadOnly',this,'isEnabled',(_0x3c215e,_0x32eccb)=>!_0x3c215e&&_0x32eccb);}}],'onHide':()=>{this['_enableCommands'](),_0x3a5b89['off']('hide',_0x4d4664),_0x3f2596['destroy']();},'onShow':()=>{_0x3f2596['bind']('isReadOnly')['to'](_0x291e01,'isReadOnly',this,'isEnabled',(_0x5589c0,_0x3c0975)=>_0x5589c0||!_0x3c0975),_0x3f2596['setData'](_0x90ddc2),_0x3f2596['focus'](),_0x3a5b89['on']('hide',_0x4d4664,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x392ff7{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x5f081f];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x193890=this['editor'],_0x55278a=_0x193890['locale'],_0x23de0c=new W(_0x193890);_0x193890['commands']['add']('editSource',_0x23de0c),_0x193890['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x2fcb77=this['_createButton'](_0x24104b,_0x23de0c);return _0x2fcb77['set']({'label':Q(_0x55278a,'Source'),'icon':_0x42be3a,'tooltip':Q(_0x55278a,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x2fcb77;}),_0x193890['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x4115d9=this['_createButton'](_0x4cf236,_0x23de0c,!0x0);return _0x4115d9['set']({'label':Q(_0x55278a,'Edit\x20source\x20modal\x20label'),'icon':_0x42be3a,'role':'menuitemcheckbox'}),_0x4115d9;}),this['_registerKeybindings']();}afterInit(){!async function(_0x113c22){const _0x59fad9='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0xd16335=0x791a0,_0x39aa68=window['Date']['now'](),_0x438fd4=_0x113c22['editor'],_0x2dda4f=new window['Promise'](_0xdbed36=>{_0x438fd4['once']('ready',_0xdbed36);}),_0x3f2881={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x17cbdf=_0x438fd4['config']['get']('licenseKey');async function _0x10c24d(){let _0x37d53a,_0x15fc24=null,_0x1ec5de=null;try{return'GPL'==_0x17cbdf?'NotAllowed':(_0x37d53a=_0x4e0b28(),_0x37d53a?(_0x37d53a['usageEndpoint']&&(_0x1ec5de=_0xf02dac(_0x37d53a['usageEndpoint'],_0x37d53a['jti'])),await _0x1f0a8b()?_0x520885()?_0x7064a1()?'Expired':_0x248bee()?('evaluation'==_0x37d53a['licenseType']&&(_0x15fc24=_0x30c41e('EvaluationLimit')),await _0x4476ac()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x7064a1(){const _0x52a0d1=['evaluation','trial']['includes'](_0x37d53a['licenseType'])?_0x39aa68/0x3e8:0xe10*_0xd16335;return _0x37d53a['exp']<_0x52a0d1;}function _0x520885(){const _0x14a976=_0x37d53a['features'];return!!_0x14a976&&(!!_0x14a976['includes']('*')||!!_0x14a976['includes']('SEE'));}function _0x248bee(){const _0x1c8d89=_0x37d53a['licensedHosts'];if(!_0x1c8d89||0x0==_0x1c8d89['length'])return!0x0;const {hostname:_0x766f35}=new URL(window['location']['href']);if(_0x1c8d89['includes'](_0x766f35))return!0x0;const _0x2375ff=_0x766f35['split']('.');return _0x1c8d89['filter'](_0x7953b7=>_0x7953b7['includes']('*'))['map'](_0x1fa833=>_0x1fa833['split']('.'))['filter'](_0x1cb817=>_0x1cb817['length']<=_0x2375ff['length'])['map'](_0x2d6e20=>Array(_0x2375ff['length']-_0x2d6e20['length'])['fill']('*'===_0x2d6e20[0x0]?'*':'')['concat'](_0x2d6e20))['some'](_0x5bac15=>_0x2375ff['every']((_0xa972d3,_0x21ea38)=>_0x5bac15[_0x21ea38]===_0xa972d3||'*'===_0x5bac15[_0x21ea38]));}function _0x4476ac(){return _0x15fc24&&_0x1ec5de?new window['Promise']((_0x493415,_0x4433c3)=>{_0x15fc24['then'](_0x493415,_0x4433c3),_0x1ec5de['then'](_0x44b0ba=>{'Valid'!=_0x44b0ba&&_0x493415(_0x44b0ba);},_0x4433c3);}):_0x15fc24||_0x1ec5de||'Valid';}}function _0xf02dac(_0x5a550b,_0x51d466){return new window['Promise'](_0x3f9f65=>{if(_0x10a0e5())return _0x3f9f65('Valid');_0x2b39ff(),_0x438fd4['decorate']('_sendUsageRequest');let _0x4db7ea=!0x1;const _0x41f56e=_0x5214b4();function _0x20fc14(_0x4e399c){return!!_0x4e399c&&('object'==typeof _0x4e399c||'function'==typeof _0x4e399c)&&'function'==typeof _0x4e399c['then']&&'function'==typeof _0x4e399c['catch'];}function _0x2938c1(_0x554ab1){_0x50beb0(_0x554ab1)['then'](_0xfea411=>_0xfea411&&'ok'==_0xfea411['status']?_0xe7bb2a(_0x3bccd6(_0x41f56e+_0x51d466))!=_0xfea411['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1d2745=>(_0x4354fe(),_0x1d2745),()=>{const _0x2c7067=_0xde4ea1();return null==_0x2c7067?(_0x4354fe(),'Valid'):_0x39aa68-_0x2c7067>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3f9f65)['catch'](()=>{_0x3f9f65('UsageLimit');});const _0x484420=0x36ee80;function _0x4354fe(){const _0x435068='llct-'+_0xe7bb2a(_0x3bccd6(_0x5a550b)),_0x57d17e=_0x14110d(_0xe7bb2a(window['Math']['ceil'](_0x39aa68/_0x484420)));window['localStorage']['setItem'](_0x435068,_0x57d17e);}function _0xde4ea1(){const _0x5a1bee='llct-'+_0xe7bb2a(_0x3bccd6(_0x5a550b)),_0x12444d=window['localStorage']['getItem'](_0x5a1bee);return _0x12444d?window['parseInt'](_0x14110d(_0x12444d),0x10)*_0x484420:null;}function _0x50beb0(_0x52886e){return new window['Promise']((_0x27b66a,_0x2ba09f)=>{_0x52886e['then'](_0x27b66a,_0x2ba09f),window['setTimeout'](_0x2ba09f,0x1d4c0);});}}_0x438fd4['on']('_sendUsageRequest',(_0x2a4ece,_0x2f5ac3)=>{if(_0x2f5ac3[0x0]!=_0x5a550b)return _0x3f9f65('UsageLimit');_0x2f5ac3[0x1]={..._0x2f5ac3[0x1],'requestId':_0x41f56e};},{'priority':'high'}),_0x438fd4['on']('_sendUsageRequest',_0x5b82b1=>{_0x20fc14(_0x5b82b1['return'])&&(_0x4db7ea=!0x0,_0x2938c1(_0x5b82b1['return']));},{'priority':'low'}),_0x2dda4f['then'](()=>{_0x4db7ea||_0x3f9f65('UsageLimit');});});function _0x10a0e5(){return'auto'==_0x438fd4['editing']['view']['_overlayModeHint'];}function _0x2b39ff(){_0x438fd4['editing']['view']['_overlayModeHint']='auto';}}function _0x30c41e(_0x58532d){const _0x53fc0e=[new window['Promise'](_0x5ef2c7=>setTimeout(_0x5ef2c7,0x93ecc)),_0x2dda4f['then'](()=>new window['Promise'](_0x2007c5=>{let _0x3fd3f4=0x0;_0x438fd4['model']['on']('applyOperation',(_0x3636f4,_0x1e10af)=>{_0x1e10af[0x0]['isDocumentOperation']&&_0x3fd3f4++,0x5e8==_0x3fd3f4&&(_0x2007c5(),_0x3636f4['off']());});}))];return window['Promise']['race'](_0x53fc0e)['then'](()=>_0x58532d);}async function _0x50825c(){await _0x2dda4f,_0x438fd4['model']['change']=_0x4c2151,_0x438fd4['model']['enqueueChange']=_0x4c2151,_0x438fd4['enableReadOnlyMode']('model');}function _0x32579a(_0x4ffd69){const _0x2537c0=_0x377b05();_0x438fd4[_0x2537c0]='sourceEditingEnhancedLicenseKey'+_0x4ffd69,'Valid'!=_0x4ffd69&&_0x50825c();}function _0x377b05(){const _0x580b61=window['String'](window['performance']['now']())['replace']('.','');let _0x32efce='N';for(let _0x25a28e=0x0;_0x25a28e<_0x580b61['length'];_0x25a28e+=0x2){let _0x34943d=window['parseInt'](_0x580b61['substring'](_0x25a28e,_0x25a28e+0x2));_0x34943d>=0x3e&&(_0x34943d-=0x3e),_0x32efce+=_0x59fad9[_0x34943d];}return _0x32efce;}function _0x4e0b28(){const _0xd42747=_0x17cbdf['split']('.');if(0x3!=_0xd42747['length'])return null;return _0x296925(_0xd42747[0x1]);function _0x296925(_0x34aba2){const _0xa79b8b=_0x38924c(_0x34aba2);return _0xa79b8b&&_0x343838()?_0xa79b8b:null;function _0x343838(){const _0x3bf42e=_0xa79b8b['jti'],_0x2c28f1=window['parseInt'](_0x3bf42e['substring'](_0x3bf42e['length']-0x8),0x10),_0x4e9804={..._0xa79b8b,'jti':_0x3bf42e['substring'](0x0,_0x3bf42e['length']-0x8)};return delete _0x4e9804['vc'],_0x3bccd6(_0x4e9804)==_0x2c28f1;}}}async function _0x1f0a8b(){let _0x951f51=!0x0;try{const [_0x5d21ec,_0x221479,_0x21118e]=_0x17cbdf['split']('.');return _0x565d16(_0x5d21ec),await _0x4326ae(_0x5d21ec,_0x221479,_0x21118e),_0x951f51;}catch{return!0x1;}function _0x565d16(_0x2d728d){const _0x32709d=_0x38924c(_0x2d728d);_0x32709d&&'ES256'==_0x32709d['alg']||(_0x951f51=!0x1);}async function _0x4326ae(_0x281967,_0x10cbba,_0x16d7e9){const _0x29e61f=window['Uint8Array']['from'](_0x1a05ed(_0x16d7e9),_0x1ede44=>_0x1ede44['charCodeAt'](0x0)),_0x20a06c=new window['TextEncoder']()['encode'](_0x281967+'.'+_0x10cbba),_0x4e6104=window['crypto']['subtle'];if(!_0x4e6104)return;const _0x435cbd=await _0x4e6104['importKey']('jwk',_0x3f2881,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4e6104['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x435cbd,_0x29e61f,_0x20a06c)||(_0x951f51=!0x1);}}function _0x38924c(_0x41f236){return _0x41f236['startsWith']('ey')?JSON['parse'](_0x1a05ed(_0x41f236)):null;}function _0x1a05ed(_0x2343f1){return window['atob'](_0x2343f1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3bccd6(_0x21b243){let _0x477c2c=0x1505;function _0x5bf987(_0x1bb708){for(let _0x5813e1=0x0;_0x5813e1<_0x1bb708['length'];_0x5813e1++){const _0x162f3a=_0x1bb708['charCodeAt'](_0x5813e1);_0x477c2c=(_0x477c2c<<0x5)+_0x477c2c+_0x162f3a,_0x477c2c&=_0x477c2c;}}function _0x4bd6e4(_0x4b0a11){Array['isArray'](_0x4b0a11)?_0x4b0a11['forEach'](_0x4bd6e4):_0x4b0a11&&'object'==typeof _0x4b0a11?Object['entries'](_0x4b0a11)['sort']()['forEach'](([_0x5d8295,_0x396666])=>{_0x5bf987(_0x5d8295),_0x4bd6e4(_0x396666);}):_0x5bf987(window['String'](_0x4b0a11));}return _0x4bd6e4(_0x21b243),_0x477c2c>>>0x0;}function _0xe7bb2a(_0x1b6ee4){return _0x1b6ee4['toString'](0x10)['padStart'](0x8,'0');}function _0x14110d(_0x176bcc){return _0x176bcc['split']('')['reverse']()['join']('');}function _0x4c2151(){}_0x32579a(await _0x10c24d());}(this);}_createButton(_0x506c17,_0x4cd952,_0x1942b7=!0x1){const _0xa1f279=new _0x506c17(this['editor']['locale']);return _0xa1f279['set']({'withText':_0x1942b7,'isToggleable':!0x1}),_0xa1f279['bind']('isEnabled')['to'](_0x4cd952,'isEnabled'),this['listenTo'](_0xa1f279,'execute',()=>_0x4cd952['execute']()),_0xa1f279;}_registerKeybindings(){const _0x45839e=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x45839e,'Source\x20Editing\x20Enhanced')});const _0x130b68=_0x27e0ea['isMac']||_0x27e0ea['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x45839e,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x45839e,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x45839e,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x45839e,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x45839e,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x45839e,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x45839e,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x130b68?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x45839e,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x45839e,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x45839e,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x45839e,'Select\x20line'),'keystroke':_0x130b68?'Ctrl!+L':'Alt+L'},{'label':Q(_0x45839e,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x130b68?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x45839e,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x45839e,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x45839e,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x45839e,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x45839e,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x130b68?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x197602{constructor(_0x475aac){super(_0x475aac),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x54533d,_0x3a4983){const _0x512f5c=this['editor'],_0x487494=_0x3a4983?.['rootName']??B(_0x512f5c);_0x512f5c['data']['set']({[_0x487494]:_0x54533d},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x392ff7{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x11158e){super(_0x11158e),_0x11158e['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 _0x331661=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3bf2dc;for(const _0x376bef in _0x331661){const _0x34a171=_0x376bef,_0x3a72c6=_0x331661[_0x34a171];if('sourceEditingEnhancedLicenseKeyValid'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyInvalid'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyExpired'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3a72c6){delete _0x331661[_0x34a171],_0x3bf2dc=_0x3a72c6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x3bf2dc&&_0x331661['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x3bf2dc&&_0x331661['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3bf2dc&&_0x331661['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3bf2dc&&_0x331661['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3bf2dc&&_0x331661['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3bf2dc&&_0x331661['_showLicenseError']('usageLimit');},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x458ba3=this['editor'],_0x3a2bff=_0x458ba3['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x3a2bff&&_0x458ba3['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x4e572f('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x3a2bff&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x17a107=>_0x458ba3['plugins']['has'](_0x17a107))&&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.'),_0x458ba3['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.4.0-alpha.
|
|
3
|
+
"version": "48.4.0-alpha.5",
|
|
4
4
|
"description": "Source editing enhanced feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"dist/translations/*.umd.js"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ckeditor/ckeditor5-core": "48.4.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
29
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.5",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.5",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.5",
|
|
34
34
|
"@codemirror/autocomplete": "^6.7.1",
|
|
35
35
|
"@codemirror/commands": "6.8.1",
|
|
36
36
|
"@codemirror/lang-html": "^6.0.0",
|