@ckeditor/ckeditor5-slash-command 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 +9 -9
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x5c7e5a}from'@ckeditor/ckeditor5-core';import{Mention as _0x548642}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x4c9dae,uid as _0x2463b3}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x50749e,IconBulletedList as _0x154cc9,IconCodeBlock as _0x529dd1,IconEmoji as _0x4fd196,IconFootnote as _0x56e131,IconHeading1 as _0x52a9c4,IconHeading2 as _0x54e567,IconHeading3 as _0x29a8bd,IconHeading4 as _0x459c9a,IconHeading5 as _0x45c842,IconHeading6 as _0x40fcae,IconHorizontalLine as _0x17a129,IconHtml as _0x581e3a,IconIndent as _0x2e932a,IconNumberedList as _0x6434f6,IconOutdent as _0x2aa1a9,IconParagraph as _0x213bb3,IconPlay as _0x1292d1,IconQuote as _0x494ad8,IconRobotPencil as _0x43ac8b,IconTable as _0x2d49ce,IconTableOfContents as _0x6a0e7,IconTodoList as _0xe4a300}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x676360,View as _0x16c410}from'@ckeditor/ckeditor5-ui';var O=class extends _0x5c7e5a{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19abdb){super(_0x19abdb),this['_allowedCommands']=null;}afterInit(){const _0x42e977=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x32e4f4=function(_0x2ebf49){let _0x104dc6=['heading4','heading5','heading6'];if(_0x2ebf49){const _0x49ca5a=_0x2ebf49['map'](_0x337be8=>_0x337be8['model']);_0x104dc6=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x39a24d=>!_0x49ca5a['includes'](_0x39a24d));}return _0x104dc6;}(this['editor']['config']['get']('heading.options'));let _0x49d01f=this['getDefaultCommands']()['filter'](_0x4e0569=>!_0x32e4f4['includes'](_0x4e0569['id']))['filter'](_0x3e7405=>!_0x42e977['includes'](_0x3e7405['commandName']));const _0x57d988=this['editor']['config']['get']('slashCommand.extraCommands');_0x57d988&&_0x57d988['length']&&(_0x49d01f=_0x49d01f['concat'](_0x57d988));const _0x40d19a=this['editor']['config']['get']('template.definitions');_0x40d19a&&_0x40d19a['length']&&(_0x49d01f=_0x49d01f['concat'](function(_0x2d8aaf){return _0x2d8aaf['map'](_0x138106=>{const {title:_0x3f417f,icon:_0x3ea7ab,description:_0x38328c,data:_0x569aff}=_0x138106,_0x3d001c={'id':P(_0x3f417f,'template'),'commandName':'insertTemplate','execute':_0x1e0e1a=>{_0x1e0e1a['execute']('insertTemplate',_0x569aff);},'description':_0x38328c,'icon':_0x3ea7ab,'title':_0x3f417f};return _0x3ea7ab&&(_0x3d001c['isIconColorInherited']=!0x1),_0x3d001c;});}(_0x40d19a)));const _0x2a33bd=this['editor']['config']['get']('style.definitions');_0x2a33bd&&_0x2a33bd['length']&&(_0x49d01f=_0x49d01f['concat'](function(_0x4afe99){return _0x4afe99['map'](_0x17fa57=>({'id':P(_0x17fa57['name'],'style'),'commandName':'style','execute':_0x1fd0e1=>{_0x1fd0e1['execute']('style',{'styleName':_0x17fa57['name']});},'isEnabled':_0x12e248=>{const _0x29650=_0x12e248['commands']['get']('style');return _0x29650['isEnabled']&&_0x29650['enabledStyles']['includes'](_0x17fa57['name']);},'title':_0x17fa57['name']}));}(_0x2a33bd)));const _0x1fbe5d=_0x49d01f['filter'](_0x38f7c9=>!_0x38f7c9['commandName']||void 0x0!==this['editor']['commands']['get'](_0x38f7c9['commandName'])),_0x9f26fc=[];for(const _0x3ebace of _0x1fbe5d)_0x9f26fc['push']({'id':_0x3ebace['id'],'commandName':_0x3ebace['commandName'],'title':'function'==typeof _0x3ebace['title']?_0x3ebace['title'](this['editor']):_0x3ebace['title'],'description':_0x3ebace['description'],'icon':_0x3ebace['icon'],'isIconColorInherited':_0x3ebace['isIconColorInherited'],'aliases':_0x3ebace['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x3ebace),'execute':()=>this['_proxyExecute'](_0x3ebace)});this['_allowedCommands']=_0x9f26fc['sort'](E),async function(_0x5de9a7){const _0x2d2f0='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x61fb50=0x79188,_0x404798=window['Date']['now'](),_0x587f5c=_0x5de9a7['editor'],_0x231f0f=new window['Promise'](_0x3f3f10=>{_0x587f5c['once']('ready',_0x3f3f10);}),_0xece302={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x328577=_0x587f5c['config']['get']('licenseKey');async function _0x2eb206(){let _0x19f005,_0x4a1779=null,_0x38f2ee=null;try{return'GPL'==_0x328577?'NotAllowed':(_0x19f005=_0x303081(),_0x19f005?(_0x19f005['usageEndpoint']&&(_0x38f2ee=_0x59fd21(_0x19f005['usageEndpoint'],_0x19f005['jti'])),await _0x147207()?_0x35a5ef()?_0x2a5b56()?'Expired':_0x195a27()?('evaluation'==_0x19f005['licenseType']&&(_0x4a1779=_0x355114('EvaluationLimit')),await _0x2d70df()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2a5b56(){const _0xb3428d=['evaluation','trial']['includes'](_0x19f005['licenseType'])?_0x404798/0x3e8:0xe10*_0x61fb50;return _0x19f005['exp']<_0xb3428d;}function _0x35a5ef(){const _0x367df1=_0x19f005['features'];return!!_0x367df1&&(!!_0x367df1['includes']('*')||(!!_0x367df1['includes']('SC')||(!!_0x367df1['includes']('PP')||!(!_0x367df1['includes']('TRILIUM')||!_0x403958()))));}function _0x195a27(){const _0x22ea09=_0x19f005['licensedHosts'];if(!_0x22ea09||0x0==_0x22ea09['length'])return!0x0;const {hostname:_0x3efdc7}=new URL(window['location']['href']);if(_0x22ea09['includes'](_0x3efdc7))return!0x0;const _0x102c2f=_0x3efdc7['split']('.');return _0x22ea09['filter'](_0x240840=>_0x240840['includes']('*'))['map'](_0xa7ed2b=>_0xa7ed2b['split']('.'))['filter'](_0x312668=>_0x312668['length']<=_0x102c2f['length'])['map'](_0x1d85b4=>Array(_0x102c2f['length']-_0x1d85b4['length'])['fill']('*'===_0x1d85b4[0x0]?'*':'')['concat'](_0x1d85b4))['some'](_0x31f1f5=>_0x102c2f['every']((_0x3f6d29,_0x10c1e4)=>_0x31f1f5[_0x10c1e4]===_0x3f6d29||'*'===_0x31f1f5[_0x10c1e4]));}function _0x2d70df(){return _0x4a1779&&_0x38f2ee?new window['Promise']((_0x4db1e2,_0x5a7911)=>{_0x4a1779['then'](_0x4db1e2,_0x5a7911),_0x38f2ee['then'](_0x27c358=>{'Valid'!=_0x27c358&&_0x4db1e2(_0x27c358);},_0x5a7911);}):_0x4a1779||_0x38f2ee||'Valid';}}function _0x59fd21(_0x2bf17c,_0x29881d){return new window['Promise'](_0x48767a=>{if(_0x2c83df())return _0x48767a('Valid');_0x4a5fb2(),_0x587f5c['decorate']('_sendUsageRequest');let _0x2d3049=!0x1;const _0x2c7662=_0x2463b3();function _0x5bcf65(_0x177fe5){return!!_0x177fe5&&('object'==typeof _0x177fe5||'function'==typeof _0x177fe5)&&'function'==typeof _0x177fe5['then']&&'function'==typeof _0x177fe5['catch'];}function _0x195946(_0x42d5c7){_0x1e2f2a(_0x42d5c7)['then'](_0x4b9c9d=>_0x4b9c9d&&'ok'==_0x4b9c9d['status']?_0x372d3b(_0x55b5c6(_0x2c7662+_0x29881d))!=_0x4b9c9d['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5222f5=>(_0x2bfc54(),_0x5222f5),()=>{const _0x50b092=_0x4e532b();return null==_0x50b092?(_0x2bfc54(),'Valid'):_0x404798-_0x50b092>0x240c8400?'UsageLimit':'Valid';})['then'](_0x48767a)['catch'](()=>{_0x48767a('UsageLimit');});const _0x12b40f=0x36ee80;function _0x2bfc54(){const _0x2348b2='llct-'+_0x372d3b(_0x55b5c6(_0x2bf17c)),_0x29d72e=_0x53844c(_0x372d3b(window['Math']['ceil'](_0x404798/_0x12b40f)));window['localStorage']['setItem'](_0x2348b2,_0x29d72e);}function _0x4e532b(){const _0x15ae5c='llct-'+_0x372d3b(_0x55b5c6(_0x2bf17c)),_0x2ad4e6=window['localStorage']['getItem'](_0x15ae5c);return _0x2ad4e6?window['parseInt'](_0x53844c(_0x2ad4e6),0x10)*_0x12b40f:null;}function _0x1e2f2a(_0x2364bf){return new window['Promise']((_0x13b789,_0x4ef11a)=>{_0x2364bf['then'](_0x13b789,_0x4ef11a),window['setTimeout'](_0x4ef11a,0x1d4c0);});}}_0x587f5c['on']('_sendUsageRequest',(_0x3f5ebe,_0x4fcc36)=>{if(_0x4fcc36[0x0]!=_0x2bf17c)return _0x48767a('UsageLimit');_0x4fcc36[0x1]={..._0x4fcc36[0x1],'requestId':_0x2c7662};},{'priority':'high'}),_0x587f5c['on']('_sendUsageRequest',_0x132189=>{_0x5bcf65(_0x132189['return'])&&(_0x2d3049=!0x0,_0x195946(_0x132189['return']));},{'priority':'low'}),_0x231f0f['then'](()=>{_0x2d3049||_0x48767a('UsageLimit');});});function _0x2c83df(){return'auto'==_0x587f5c['editing']['view']['_overlayModeHint'];}function _0x4a5fb2(){_0x587f5c['editing']['view']['_overlayModeHint']='auto';}}function _0x355114(_0x206530){const _0x4d28a7=[new window['Promise'](_0x46c2cb=>setTimeout(_0x46c2cb,0x93ecc)),_0x231f0f['then'](()=>new window['Promise'](_0x1b6631=>{let _0x2ee538=0x0;_0x587f5c['model']['on']('applyOperation',(_0x14c124,_0x30b0f8)=>{_0x30b0f8[0x0]['isDocumentOperation']&&_0x2ee538++,0x5e8==_0x2ee538&&(_0x1b6631(),_0x14c124['off']());});}))];return window['Promise']['race'](_0x4d28a7)['then'](()=>_0x206530);}async function _0x39d59b(){await _0x231f0f,_0x587f5c['model']['change']=_0xaf3681,_0x587f5c['model']['enqueueChange']=_0xaf3681,_0x587f5c['enableReadOnlyMode']('model');}function _0x403958(){return window['glob']&&window['glob']['triliumVersion'];}function _0x3dc045(_0x21e609){const _0x105361=_0x2f9df5();_0x587f5c[_0x105361]='slashCommandLicenseKey'+_0x21e609,'Valid'!=_0x21e609&&_0x39d59b();}function _0x2f9df5(){const _0xfbd9ff=window['String'](window['performance']['now']())['replace']('.','');let _0x4c0371='u';for(let _0x2fa63e=0x0;_0x2fa63e<_0xfbd9ff['length'];_0x2fa63e+=0x2){let _0x19ed81=window['parseInt'](_0xfbd9ff['substring'](_0x2fa63e,_0x2fa63e+0x2));_0x19ed81>=0x3e&&(_0x19ed81-=0x3e),_0x4c0371+=_0x2d2f0[_0x19ed81];}return _0x4c0371;}function _0x303081(){const _0x461fb5=_0x328577['split']('.');if(0x3!=_0x461fb5['length'])return null;return _0x24d3fd(_0x461fb5[0x1]);function _0x24d3fd(_0x166799){const _0x27e44d=_0xb9f9b(_0x166799);return _0x27e44d&&_0x3881a2()?_0x27e44d:null;function _0x3881a2(){const _0x52a9b3=_0x27e44d['jti'],_0x8622bd=window['parseInt'](_0x52a9b3['substring'](_0x52a9b3['length']-0x8),0x10),_0xe0cbc8={..._0x27e44d,'jti':_0x52a9b3['substring'](0x0,_0x52a9b3['length']-0x8)};return delete _0xe0cbc8['vc'],_0x55b5c6(_0xe0cbc8)==_0x8622bd;}}}async function _0x147207(){let _0x1ff9c6=!0x0;try{const [_0x4e5a92,_0x28cf99,_0x410a86]=_0x328577['split']('.');return _0x4d6922(_0x4e5a92),await _0x55b0ca(_0x4e5a92,_0x28cf99,_0x410a86),_0x1ff9c6;}catch{return!0x1;}function _0x4d6922(_0x2c5a07){const _0x7acf08=_0xb9f9b(_0x2c5a07);_0x7acf08&&'ES256'==_0x7acf08['alg']||(_0x1ff9c6=!0x1);}async function _0x55b0ca(_0x24fbe5,_0x226869,_0x213890){const _0x5f0f38=window['Uint8Array']['from'](_0x8be700(_0x213890),_0x40612=>_0x40612['charCodeAt'](0x0)),_0x5d25b8=new window['TextEncoder']()['encode'](_0x24fbe5+'.'+_0x226869),_0x2d17b8=window['crypto']['subtle'];if(!_0x2d17b8)return;const _0x4b8b2b=await _0x2d17b8['importKey']('jwk',_0xece302,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2d17b8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4b8b2b,_0x5f0f38,_0x5d25b8)||(_0x1ff9c6=!0x1);}}function _0xb9f9b(_0x3537db){return _0x3537db['startsWith']('ey')?JSON['parse'](_0x8be700(_0x3537db)):null;}function _0x8be700(_0x32cb00){return window['atob'](_0x32cb00['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x55b5c6(_0xf24a96){let _0x5523ab=0x1505;function _0x1502b6(_0xafebdf){for(let _0x454f05=0x0;_0x454f05<_0xafebdf['length'];_0x454f05++){const _0x17be1e=_0xafebdf['charCodeAt'](_0x454f05);_0x5523ab=(_0x5523ab<<0x5)+_0x5523ab+_0x17be1e,_0x5523ab&=_0x5523ab;}}function _0xd5b3c7(_0x5c76d4){Array['isArray'](_0x5c76d4)?_0x5c76d4['forEach'](_0xd5b3c7):_0x5c76d4&&'object'==typeof _0x5c76d4?Object['entries'](_0x5c76d4)['sort']()['forEach'](([_0x5c1121,_0x3a5c91])=>{_0x1502b6(_0x5c1121),_0xd5b3c7(_0x3a5c91);}):_0x1502b6(window['String'](_0x5c76d4));}return _0xd5b3c7(_0xf24a96),_0x5523ab>>>0x0;}function _0x372d3b(_0x434479){return _0x434479['toString'](0x10)['padStart'](0x8,'0');}function _0x53844c(_0x59c465){return _0x59c465['split']('')['reverse']()['join']('');}function _0xaf3681(){}_0x3dc045(await _0x2eb206());}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x1ad710=_0x33b56d=>function(_0x1ef9f9,_0x5da1cc){const t=_0x1ef9f9['t'],_0x348bba=_0x1ef9f9['t'];switch(_0x5da1cc){case'AI\x20Assistant':return _0x348bba('AI\x20Assistant');case'Block\x20quote':return _0x348bba('Block\x20quote');case'Bulleted\x20List':return _0x348bba('Bulleted\x20List');case'Insert\x20code\x20block':return _0x348bba('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x348bba('Open\x20file\x20manager');case'Insert\x20image':return _0x348bba('Insert\x20image');case'Heading\x201':return _0x348bba('Heading\x201');case'Heading\x202':return _0x348bba('Heading\x202');case'Heading\x203':return _0x348bba('Heading\x203');case'Heading\x204':return _0x348bba('Heading\x204');case'Heading\x205':return _0x348bba('Heading\x205');case'Heading\x206':return _0x348bba('Heading\x206');case'Horizontal\x20line':return _0x348bba('Horizontal\x20line');case'Insert\x20HTML':return _0x348bba('Insert\x20HTML');case'Increase\x20indent':return _0x348bba('Increase\x20indent');case'Insert\x20table':return _0x348bba('Insert\x20table');case'Table\x20of\x20contents':return _0x348bba('Table\x20of\x20contents');case'Numbered\x20List':return _0x348bba('Numbered\x20List');case'Decrease\x20indent':return _0x348bba('Decrease\x20indent');case'Paragraph':return _0x348bba('Paragraph');case'To-do\x20List':return _0x348bba('To-do\x20List');case'Create\x20a\x20block\x20quote':return t('Create\x20a\x20block\x20quote');case'Create\x20a\x20bulleted\x20list':return t('Create\x20a\x20bulleted\x20list');case'Create\x20a\x20code\x20block':return t('Create\x20a\x20code\x20block');case'Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':return t('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file');case'Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':return t('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file');case'Create\x20a\x20heading\x20level\x201':return t('Create\x20a\x20heading\x20level\x201');case'Create\x20a\x20heading\x20level\x202':return t('Create\x20a\x20heading\x20level\x202');case'Create\x20a\x20heading\x20level\x203':return t('Create\x20a\x20heading\x20level\x203');case'Create\x20a\x20heading\x20level\x204':return t('Create\x20a\x20heading\x20level\x204');case'Create\x20a\x20heading\x20level\x205':return t('Create\x20a\x20heading\x20level\x205');case'Create\x20a\x20heading\x20level\x206':return t('Create\x20a\x20heading\x20level\x206');case'Insert\x20a\x20horizontal\x20line':return t('Insert\x20a\x20horizontal\x20line');case'Insert\x20an\x20HTML\x20snippet':return t('Insert\x20an\x20HTML\x20snippet');case'Increase\x20the\x20indentation':return t('Increase\x20the\x20indentation');case'Insert\x20Mermaid\x20diagram':return t('Insert\x20Mermaid\x20diagram');case'Insert\x20the\x20Mermaid\x20diagram':return t('Insert\x20the\x20Mermaid\x20diagram');case'Create\x20a\x20table':return t('Create\x20a\x20table');case'Insert\x20table\x20of\x20contents':return t('Insert\x20table\x20of\x20contents');case'Create\x20a\x20numbered\x20list':return t('Create\x20a\x20numbered\x20list');case'Decrease\x20the\x20indentation':return t('Decrease\x20the\x20indentation');case'Insert\x20a\x20paragraph':return t('Insert\x20a\x20paragraph');case'Create\x20a\x20to-do\x20list':return t('Create\x20a\x20to-do\x20list');case'Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':return t('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content');case'Insert\x20an\x20emoji':return t('Insert\x20an\x20emoji');case'Insert\x20a\x20footnote':return t('Insert\x20a\x20footnote');default:return _0x5da1cc;}}(this['editor']['locale'],_0x33b56d);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x43ac8b,'title':_0x1ad710('AI\x20Assistant'),'description':_0x1ad710('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x124697=>{setTimeout(()=>_0x124697['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x494ad8,'title':_0x1ad710('Block\x20quote'),'description':_0x1ad710('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x154cc9,'title':_0x1ad710('Bulleted\x20List'),'description':_0x1ad710('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x529dd1,'title':_0x1ad710('Insert\x20code\x20block'),'description':_0x1ad710('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x50749e,'title':_0x1ad710('Open\x20file\x20manager'),'description':_0x1ad710('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x50749e,'title':_0x1ad710('Insert\x20image'),'description':_0x1ad710('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x4fd196,'title':_0x1ad710('Emoji'),'description':_0x1ad710('Insert\x20an\x20emoji'),'execute':_0x2cfde5=>{setTimeout(()=>_0x2cfde5['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x52a9c4,'title':_0x1ad710('Heading\x201'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x201'),'execute':_0xaebdef=>{_0xaebdef['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x54e567,'title':_0x1ad710('Heading\x202'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x202'),'execute':_0x378c49=>{_0x378c49['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x29a8bd,'title':_0x1ad710('Heading\x203'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x203'),'execute':_0x9a3320=>{_0x9a3320['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x459c9a,'title':_0x1ad710('Heading\x204'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x204'),'execute':_0x5e6f92=>{_0x5e6f92['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x45c842,'title':_0x1ad710('Heading\x205'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x205'),'execute':_0x50de87=>{_0x50de87['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x40fcae,'title':_0x1ad710('Heading\x206'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x206'),'execute':_0x5e109b=>{_0x5e109b['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x17a129,'title':_0x1ad710('Horizontal\x20line'),'description':_0x1ad710('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x581e3a,'title':_0x1ad710('Insert\x20HTML'),'description':_0x1ad710('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x2e932a,'title':_0x1ad710('Increase\x20indent'),'description':_0x1ad710('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x1ad710('Insert\x20Mermaid\x20diagram'),'description':_0x1ad710('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x2d49ce,'title':_0x1ad710('Insert\x20table'),'description':_0x1ad710('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x6a0e7,'title':_0x1ad710('Table\x20of\x20contents'),'description':_0x1ad710('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x6434f6,'title':_0x1ad710('Numbered\x20List'),'description':_0x1ad710('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x2aa1a9,'title':_0x1ad710('Decrease\x20indent'),'description':_0x1ad710('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x213bb3,'title':_0x1ad710('Paragraph'),'description':_0x1ad710('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0xe4a300,'title':_0x1ad710('To-do\x20List'),'description':_0x1ad710('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x56e131,'title':_0x1ad710('Footnote'),'description':_0x1ad710('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x8ead74){return _0x8ead74['isEnabled']?_0x8ead74['isEnabled'](this['editor']):!_0x8ead74['commandName']||this['editor']['commands']['get'](_0x8ead74['commandName'])['isEnabled'];}_proxyExecute(_0x29d873){if(_0x29d873['execute'])_0x29d873['execute'](this['editor']);else{if(!_0x29d873['commandName'])throw new _0x4c9dae('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x29d873});this['editor']['execute'](_0x29d873['commandName']);}}};function E(_0x515a60,_0xda4e55){return _0x515a60['title']<_0xda4e55['title']?-0x1:_0x515a60['title']>_0xda4e55['title']?0x1:0x0;}function P(_0x10db7a,_0x1da7ad){return _0x1da7ad+'-'+_0x10db7a['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x5c7e5a{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x168384){const _0x507966=_0x168384&&_0x168384['toLowerCase']();let _0x33d4d7=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x33d4d7=_0x33d4d7['filter'](_0x5e9e19=>_0x5e9e19['isEnabled']()),_0x507966){const _0x88eed4=[],_0x593664=[],_0x52d598=[],_0x3dacfd=[];for(const _0x211937 of _0x33d4d7)_0x211937['id']['toLowerCase']()['includes'](_0x507966)?_0x88eed4['push'](_0x211937):_0x211937['title']['toLowerCase']()['includes'](_0x507966)?_0x593664['push'](_0x211937):_0x211937['aliases']&&_0x211937['aliases']['some'](_0x26f5ed=>_0x26f5ed['toLowerCase']()['includes'](_0x507966))?_0x52d598['push'](_0x211937):_0x211937['description']&&_0x211937['description']['toLowerCase']()['includes'](_0x507966)&&_0x3dacfd['push'](_0x211937);_0x33d4d7=_0x88eed4['concat'](_0x593664,_0x52d598,_0x3dacfd);}return _0x33d4d7;}},M=class extends _0x676360{constructor(_0x29e069,_0x248929){super(_0x29e069),this['textPartView']=this['_createTextPartView'](_0x29e069,_0x248929),void 0x0!==_0x248929['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x248929['isIconColorInherited']),this['set']({'icon':_0x248929['icon']||_0x1292d1,'withText':!0x0,'label':_0x248929['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0x58441c,_0x1f4ebc){const _0x398c6f=new _0x16c410(_0x58441c);return _0x398c6f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x1f4ebc['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x1f4ebc['description']}]}]:[this['labelView']]}),_0x398c6f;}},S=class extends _0x5c7e5a{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x204132){super(_0x204132),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1d7646=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x35eb6e;for(const _0x5215ed in _0x1d7646){const _0x2fd7e5=_0x5215ed,_0x28dfd8=_0x1d7646[_0x2fd7e5];if('slashCommandLicenseKeyValid'==_0x28dfd8||'slashCommandLicenseKeyInvalid'==_0x28dfd8||'slashCommandLicenseKeyExpired'==_0x28dfd8||'slashCommandLicenseKeyDomainLimit'==_0x28dfd8||'slashCommandLicenseKeyNotAllowed'==_0x28dfd8||'slashCommandLicenseKeyEvaluationLimit'==_0x28dfd8||'slashCommandLicenseKeyUsageLimit'==_0x28dfd8){delete _0x1d7646[_0x2fd7e5],_0x35eb6e=_0x28dfd8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x35eb6e&&_0x1d7646['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x35eb6e&&_0x1d7646['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x35eb6e&&_0x1d7646['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x35eb6e&&_0x1d7646['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x35eb6e&&_0x1d7646['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x35eb6e&&_0x1d7646['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x5afe15=this['editor'],_0x579cd6=this['editor']['plugins']['get']('SlashCommandEditing'),_0x5bd3da=_0x5afe15['config']['get']('mention.feeds');_0x5bd3da['push']({'marker':'/','feed':_0x62d4bd=>_0x579cd6['getMatchingCommands'](_0x62d4bd),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x5afe15['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x5afe15['config']['set']('mention.feeds',_0x5bd3da);}_overrideMentionExecuteListener(){const _0x56169e=this['editor'];_0x56169e['commands']['get']('mention')['on']('execute',(_0x185708,_0x46eb51)=>{const _0xa9f8ae=_0x46eb51[0x0],_0x44970f=_0x56169e['model'];'/'===_0xa9f8ae['marker']&&_0x44970f['change'](_0xf73bb0=>{_0xf73bb0['remove'](_0xa9f8ae['range']),_0xa9f8ae['mention']['execute'](),_0x185708['stop']();});},{'priority':'high'});}_customItemRenderer(_0x44bb3b){const _0x10eac6=this['editor']['locale'],_0x24355b=new M(_0x10eac6,_0x44bb3b);return _0x24355b['render'](),_0x24355b['element'];}},D=class extends _0x5c7e5a{static get requires(){return[_0x548642,K,S];}static get['pluginName'](){return'SlashCommand';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{D as SlashCommand,O as SlashCommandConfig,K as SlashCommandEditing,S as SlashCommandUI};
|
|
23
|
+
import{Plugin as _0x170c4b}from'@ckeditor/ckeditor5-core';import{Mention as _0x1ac00d}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x50c559,uid as _0x232ed6}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x2b7008,IconBulletedList as _0x2c9d1c,IconCodeBlock as _0x187744,IconEmoji as _0xe5155d,IconFootnote as _0x269a5d,IconHeading1 as _0x3d7add,IconHeading2 as _0x49b633,IconHeading3 as _0x580153,IconHeading4 as _0x155ef3,IconHeading5 as _0x161f54,IconHeading6 as _0x2c6229,IconHorizontalLine as _0x266c0a,IconHtml as _0x21815b,IconIndent as _0x54a6d2,IconNumberedList as _0x1a5723,IconOutdent as _0x51f411,IconParagraph as _0x18c66e,IconPlay as _0x42638d,IconQuote as _0x592bb1,IconRobotPencil as _0x4462d3,IconTable as _0xa0b6,IconTableOfContents as _0x294bb4,IconTodoList as _0x37df5b}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x5db0e8,View as _0x27c612}from'@ckeditor/ckeditor5-ui';var O=class extends _0x170c4b{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d36b0){super(_0x4d36b0),this['_allowedCommands']=null;}afterInit(){const _0x1c60c4=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x810c51=function(_0x5735df){let _0x2d7364=['heading4','heading5','heading6'];if(_0x5735df){const _0x2f2005=_0x5735df['map'](_0x4b45a=>_0x4b45a['model']);_0x2d7364=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x1368d5=>!_0x2f2005['includes'](_0x1368d5));}return _0x2d7364;}(this['editor']['config']['get']('heading.options'));let _0x497927=this['getDefaultCommands']()['filter'](_0xab82c4=>!_0x810c51['includes'](_0xab82c4['id']))['filter'](_0x53cdd6=>!_0x1c60c4['includes'](_0x53cdd6['commandName']));const _0x54196a=this['editor']['config']['get']('slashCommand.extraCommands');_0x54196a&&_0x54196a['length']&&(_0x497927=_0x497927['concat'](_0x54196a));const _0x1a75f7=this['editor']['config']['get']('template.definitions');_0x1a75f7&&_0x1a75f7['length']&&(_0x497927=_0x497927['concat'](function(_0x34e4ff){return _0x34e4ff['map'](_0x3ad46b=>{const {title:_0x39d96a,icon:_0x3c45a5,description:_0x67b68f,data:_0x9eb8ba}=_0x3ad46b,_0x593c96={'id':P(_0x39d96a,'template'),'commandName':'insertTemplate','execute':_0x4bdfa4=>{_0x4bdfa4['execute']('insertTemplate',_0x9eb8ba);},'description':_0x67b68f,'icon':_0x3c45a5,'title':_0x39d96a};return _0x3c45a5&&(_0x593c96['isIconColorInherited']=!0x1),_0x593c96;});}(_0x1a75f7)));const _0x4724e6=this['editor']['config']['get']('style.definitions');_0x4724e6&&_0x4724e6['length']&&(_0x497927=_0x497927['concat'](function(_0x213da4){return _0x213da4['map'](_0x3071d1=>({'id':P(_0x3071d1['name'],'style'),'commandName':'style','execute':_0x1a95a4=>{_0x1a95a4['execute']('style',{'styleName':_0x3071d1['name']});},'isEnabled':_0x1862c2=>{const _0x23314c=_0x1862c2['commands']['get']('style');return _0x23314c['isEnabled']&&_0x23314c['enabledStyles']['includes'](_0x3071d1['name']);},'title':_0x3071d1['name']}));}(_0x4724e6)));const _0x27387f=_0x497927['filter'](_0x252d65=>!_0x252d65['commandName']||void 0x0!==this['editor']['commands']['get'](_0x252d65['commandName'])),_0x14970f=[];for(const _0xcea899 of _0x27387f)_0x14970f['push']({'id':_0xcea899['id'],'commandName':_0xcea899['commandName'],'title':'function'==typeof _0xcea899['title']?_0xcea899['title'](this['editor']):_0xcea899['title'],'description':_0xcea899['description'],'icon':_0xcea899['icon'],'isIconColorInherited':_0xcea899['isIconColorInherited'],'aliases':_0xcea899['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0xcea899),'execute':()=>this['_proxyExecute'](_0xcea899)});this['_allowedCommands']=_0x14970f['sort'](E),async function(_0x5bfcd9){const _0x4083d0='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x544652=0x791a0,_0x2c44f4=window['Date']['now'](),_0x485002=_0x5bfcd9['editor'],_0x394d27=new window['Promise'](_0x561f4b=>{_0x485002['once']('ready',_0x561f4b);}),_0x21e7a0={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x15eae0=_0x485002['config']['get']('licenseKey');async function _0x57d740(){let _0x4618df,_0x441855=null,_0x729baa=null;try{return'GPL'==_0x15eae0?'NotAllowed':(_0x4618df=_0x15198e(),_0x4618df?(_0x4618df['usageEndpoint']&&(_0x729baa=_0x22e78a(_0x4618df['usageEndpoint'],_0x4618df['jti'])),await _0x336120()?_0x362f47()?_0x148bfa()?'Expired':_0xb370c0()?('evaluation'==_0x4618df['licenseType']&&(_0x441855=_0x5eb19c('EvaluationLimit')),await _0x548a3b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x148bfa(){const _0x3d67a8=['evaluation','trial']['includes'](_0x4618df['licenseType'])?_0x2c44f4/0x3e8:0xe10*_0x544652;return _0x4618df['exp']<_0x3d67a8;}function _0x362f47(){const _0x34cb6a=_0x4618df['features'];return!!_0x34cb6a&&(!!_0x34cb6a['includes']('*')||(!!_0x34cb6a['includes']('SC')||(!!_0x34cb6a['includes']('PP')||!(!_0x34cb6a['includes']('TRILIUM')||!_0x295445()))));}function _0xb370c0(){const _0x367f9d=_0x4618df['licensedHosts'];if(!_0x367f9d||0x0==_0x367f9d['length'])return!0x0;const {hostname:_0x31d543}=new URL(window['location']['href']);if(_0x367f9d['includes'](_0x31d543))return!0x0;const _0x2d8da3=_0x31d543['split']('.');return _0x367f9d['filter'](_0x4e6762=>_0x4e6762['includes']('*'))['map'](_0x36a6b7=>_0x36a6b7['split']('.'))['filter'](_0xf0781d=>_0xf0781d['length']<=_0x2d8da3['length'])['map'](_0x195568=>Array(_0x2d8da3['length']-_0x195568['length'])['fill']('*'===_0x195568[0x0]?'*':'')['concat'](_0x195568))['some'](_0x7b3c88=>_0x2d8da3['every']((_0x4e1fbf,_0x337093)=>_0x7b3c88[_0x337093]===_0x4e1fbf||'*'===_0x7b3c88[_0x337093]));}function _0x548a3b(){return _0x441855&&_0x729baa?new window['Promise']((_0x27e967,_0xf7592e)=>{_0x441855['then'](_0x27e967,_0xf7592e),_0x729baa['then'](_0x36ed70=>{'Valid'!=_0x36ed70&&_0x27e967(_0x36ed70);},_0xf7592e);}):_0x441855||_0x729baa||'Valid';}}function _0x22e78a(_0x3df62c,_0x11147c){return new window['Promise'](_0x519b18=>{if(_0x1be76c())return _0x519b18('Valid');_0x2d66eb(),_0x485002['decorate']('_sendUsageRequest');let _0x40f08a=!0x1;const _0x374280=_0x232ed6();function _0x3df036(_0x3ae8f1){return!!_0x3ae8f1&&('object'==typeof _0x3ae8f1||'function'==typeof _0x3ae8f1)&&'function'==typeof _0x3ae8f1['then']&&'function'==typeof _0x3ae8f1['catch'];}function _0x2d5724(_0x18ec1e){_0x271482(_0x18ec1e)['then'](_0x4fbf62=>_0x4fbf62&&'ok'==_0x4fbf62['status']?_0x43408d(_0x3db77e(_0x374280+_0x11147c))!=_0x4fbf62['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x16c17a=>(_0x17903b(),_0x16c17a),()=>{const _0x754975=_0x714610();return null==_0x754975?(_0x17903b(),'Valid'):_0x2c44f4-_0x754975>0x240c8400?'UsageLimit':'Valid';})['then'](_0x519b18)['catch'](()=>{_0x519b18('UsageLimit');});const _0x132874=0x36ee80;function _0x17903b(){const _0x204a42='llct-'+_0x43408d(_0x3db77e(_0x3df62c)),_0x1cd84a=_0xca8afc(_0x43408d(window['Math']['ceil'](_0x2c44f4/_0x132874)));window['localStorage']['setItem'](_0x204a42,_0x1cd84a);}function _0x714610(){const _0x1da87d='llct-'+_0x43408d(_0x3db77e(_0x3df62c)),_0x4b992a=window['localStorage']['getItem'](_0x1da87d);return _0x4b992a?window['parseInt'](_0xca8afc(_0x4b992a),0x10)*_0x132874:null;}function _0x271482(_0x3cd7b2){return new window['Promise']((_0x5b62d1,_0x49311b)=>{_0x3cd7b2['then'](_0x5b62d1,_0x49311b),window['setTimeout'](_0x49311b,0x1d4c0);});}}_0x485002['on']('_sendUsageRequest',(_0x2cf24b,_0x1243b1)=>{if(_0x1243b1[0x0]!=_0x3df62c)return _0x519b18('UsageLimit');_0x1243b1[0x1]={..._0x1243b1[0x1],'requestId':_0x374280};},{'priority':'high'}),_0x485002['on']('_sendUsageRequest',_0x432bc2=>{_0x3df036(_0x432bc2['return'])&&(_0x40f08a=!0x0,_0x2d5724(_0x432bc2['return']));},{'priority':'low'}),_0x394d27['then'](()=>{_0x40f08a||_0x519b18('UsageLimit');});});function _0x1be76c(){return'auto'==_0x485002['editing']['view']['_overlayModeHint'];}function _0x2d66eb(){_0x485002['editing']['view']['_overlayModeHint']='auto';}}function _0x5eb19c(_0x2ee576){const _0x585a99=[new window['Promise'](_0x21cc1b=>setTimeout(_0x21cc1b,0x93ecc)),_0x394d27['then'](()=>new window['Promise'](_0x3d1578=>{let _0x1bfec0=0x0;_0x485002['model']['on']('applyOperation',(_0x2483f3,_0x5af12c)=>{_0x5af12c[0x0]['isDocumentOperation']&&_0x1bfec0++,0x5e8==_0x1bfec0&&(_0x3d1578(),_0x2483f3['off']());});}))];return window['Promise']['race'](_0x585a99)['then'](()=>_0x2ee576);}async function _0x1a1765(){await _0x394d27,_0x485002['model']['change']=_0x51d769,_0x485002['model']['enqueueChange']=_0x51d769,_0x485002['enableReadOnlyMode']('model');}function _0x295445(){return window['glob']&&window['glob']['triliumVersion'];}function _0x505bf1(_0x8cd37a){const _0x510808=_0x41c9f0();_0x485002[_0x510808]='slashCommandLicenseKey'+_0x8cd37a,'Valid'!=_0x8cd37a&&_0x1a1765();}function _0x41c9f0(){const _0x2a36c9=window['String'](window['performance']['now']())['replace']('.','');let _0x112285='u';for(let _0x3e5243=0x0;_0x3e5243<_0x2a36c9['length'];_0x3e5243+=0x2){let _0x59732a=window['parseInt'](_0x2a36c9['substring'](_0x3e5243,_0x3e5243+0x2));_0x59732a>=0x3e&&(_0x59732a-=0x3e),_0x112285+=_0x4083d0[_0x59732a];}return _0x112285;}function _0x15198e(){const _0xf4fb53=_0x15eae0['split']('.');if(0x3!=_0xf4fb53['length'])return null;return _0x50afe0(_0xf4fb53[0x1]);function _0x50afe0(_0x666067){const _0x2c26e0=_0xdf64ea(_0x666067);return _0x2c26e0&&_0x3e2779()?_0x2c26e0:null;function _0x3e2779(){const _0x36b407=_0x2c26e0['jti'],_0x2d8a45=window['parseInt'](_0x36b407['substring'](_0x36b407['length']-0x8),0x10),_0x19d575={..._0x2c26e0,'jti':_0x36b407['substring'](0x0,_0x36b407['length']-0x8)};return delete _0x19d575['vc'],_0x3db77e(_0x19d575)==_0x2d8a45;}}}async function _0x336120(){let _0x288e52=!0x0;try{const [_0x420949,_0x4a5020,_0x41a797]=_0x15eae0['split']('.');return _0x686016(_0x420949),await _0x266e99(_0x420949,_0x4a5020,_0x41a797),_0x288e52;}catch{return!0x1;}function _0x686016(_0x343d29){const _0x114a92=_0xdf64ea(_0x343d29);_0x114a92&&'ES256'==_0x114a92['alg']||(_0x288e52=!0x1);}async function _0x266e99(_0x4df50f,_0x2b2b1d,_0x4e9e1d){const _0x465732=window['Uint8Array']['from'](_0x487868(_0x4e9e1d),_0x250a96=>_0x250a96['charCodeAt'](0x0)),_0x1f1026=new window['TextEncoder']()['encode'](_0x4df50f+'.'+_0x2b2b1d),_0x19f66a=window['crypto']['subtle'];if(!_0x19f66a)return;const _0x4467b1=await _0x19f66a['importKey']('jwk',_0x21e7a0,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x19f66a['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4467b1,_0x465732,_0x1f1026)||(_0x288e52=!0x1);}}function _0xdf64ea(_0x5d3039){return _0x5d3039['startsWith']('ey')?JSON['parse'](_0x487868(_0x5d3039)):null;}function _0x487868(_0x527215){return window['atob'](_0x527215['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3db77e(_0x3b6cd1){let _0x22b9ac=0x1505;function _0xda62dd(_0x519c98){for(let _0xcd3a93=0x0;_0xcd3a93<_0x519c98['length'];_0xcd3a93++){const _0x5e3128=_0x519c98['charCodeAt'](_0xcd3a93);_0x22b9ac=(_0x22b9ac<<0x5)+_0x22b9ac+_0x5e3128,_0x22b9ac&=_0x22b9ac;}}function _0x944363(_0x18f996){Array['isArray'](_0x18f996)?_0x18f996['forEach'](_0x944363):_0x18f996&&'object'==typeof _0x18f996?Object['entries'](_0x18f996)['sort']()['forEach'](([_0xac12d3,_0x24a6eb])=>{_0xda62dd(_0xac12d3),_0x944363(_0x24a6eb);}):_0xda62dd(window['String'](_0x18f996));}return _0x944363(_0x3b6cd1),_0x22b9ac>>>0x0;}function _0x43408d(_0x5a95cd){return _0x5a95cd['toString'](0x10)['padStart'](0x8,'0');}function _0xca8afc(_0x2c2168){return _0x2c2168['split']('')['reverse']()['join']('');}function _0x51d769(){}_0x505bf1(await _0x57d740());}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0xd8252=_0x2b259a=>function(_0x4231cd,_0x4d69bd){const t=_0x4231cd['t'],_0x2a92d0=_0x4231cd['t'];switch(_0x4d69bd){case'AI\x20Assistant':return _0x2a92d0('AI\x20Assistant');case'Block\x20quote':return _0x2a92d0('Block\x20quote');case'Bulleted\x20List':return _0x2a92d0('Bulleted\x20List');case'Insert\x20code\x20block':return _0x2a92d0('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x2a92d0('Open\x20file\x20manager');case'Insert\x20image':return _0x2a92d0('Insert\x20image');case'Heading\x201':return _0x2a92d0('Heading\x201');case'Heading\x202':return _0x2a92d0('Heading\x202');case'Heading\x203':return _0x2a92d0('Heading\x203');case'Heading\x204':return _0x2a92d0('Heading\x204');case'Heading\x205':return _0x2a92d0('Heading\x205');case'Heading\x206':return _0x2a92d0('Heading\x206');case'Horizontal\x20line':return _0x2a92d0('Horizontal\x20line');case'Insert\x20HTML':return _0x2a92d0('Insert\x20HTML');case'Increase\x20indent':return _0x2a92d0('Increase\x20indent');case'Insert\x20table':return _0x2a92d0('Insert\x20table');case'Table\x20of\x20contents':return _0x2a92d0('Table\x20of\x20contents');case'Numbered\x20List':return _0x2a92d0('Numbered\x20List');case'Decrease\x20indent':return _0x2a92d0('Decrease\x20indent');case'Paragraph':return _0x2a92d0('Paragraph');case'To-do\x20List':return _0x2a92d0('To-do\x20List');case'Create\x20a\x20block\x20quote':return t('Create\x20a\x20block\x20quote');case'Create\x20a\x20bulleted\x20list':return t('Create\x20a\x20bulleted\x20list');case'Create\x20a\x20code\x20block':return t('Create\x20a\x20code\x20block');case'Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':return t('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file');case'Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':return t('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file');case'Create\x20a\x20heading\x20level\x201':return t('Create\x20a\x20heading\x20level\x201');case'Create\x20a\x20heading\x20level\x202':return t('Create\x20a\x20heading\x20level\x202');case'Create\x20a\x20heading\x20level\x203':return t('Create\x20a\x20heading\x20level\x203');case'Create\x20a\x20heading\x20level\x204':return t('Create\x20a\x20heading\x20level\x204');case'Create\x20a\x20heading\x20level\x205':return t('Create\x20a\x20heading\x20level\x205');case'Create\x20a\x20heading\x20level\x206':return t('Create\x20a\x20heading\x20level\x206');case'Insert\x20a\x20horizontal\x20line':return t('Insert\x20a\x20horizontal\x20line');case'Insert\x20an\x20HTML\x20snippet':return t('Insert\x20an\x20HTML\x20snippet');case'Increase\x20the\x20indentation':return t('Increase\x20the\x20indentation');case'Insert\x20Mermaid\x20diagram':return t('Insert\x20Mermaid\x20diagram');case'Insert\x20the\x20Mermaid\x20diagram':return t('Insert\x20the\x20Mermaid\x20diagram');case'Create\x20a\x20table':return t('Create\x20a\x20table');case'Insert\x20table\x20of\x20contents':return t('Insert\x20table\x20of\x20contents');case'Create\x20a\x20numbered\x20list':return t('Create\x20a\x20numbered\x20list');case'Decrease\x20the\x20indentation':return t('Decrease\x20the\x20indentation');case'Insert\x20a\x20paragraph':return t('Insert\x20a\x20paragraph');case'Create\x20a\x20to-do\x20list':return t('Create\x20a\x20to-do\x20list');case'Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':return t('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content');case'Insert\x20an\x20emoji':return t('Insert\x20an\x20emoji');case'Insert\x20a\x20footnote':return t('Insert\x20a\x20footnote');default:return _0x4d69bd;}}(this['editor']['locale'],_0x2b259a);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x4462d3,'title':_0xd8252('AI\x20Assistant'),'description':_0xd8252('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x5f5849=>{setTimeout(()=>_0x5f5849['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x592bb1,'title':_0xd8252('Block\x20quote'),'description':_0xd8252('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x2c9d1c,'title':_0xd8252('Bulleted\x20List'),'description':_0xd8252('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x187744,'title':_0xd8252('Insert\x20code\x20block'),'description':_0xd8252('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x2b7008,'title':_0xd8252('Open\x20file\x20manager'),'description':_0xd8252('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x2b7008,'title':_0xd8252('Insert\x20image'),'description':_0xd8252('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0xe5155d,'title':_0xd8252('Emoji'),'description':_0xd8252('Insert\x20an\x20emoji'),'execute':_0x17d93c=>{setTimeout(()=>_0x17d93c['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x3d7add,'title':_0xd8252('Heading\x201'),'description':_0xd8252('Create\x20a\x20heading\x20level\x201'),'execute':_0x2170f2=>{_0x2170f2['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x49b633,'title':_0xd8252('Heading\x202'),'description':_0xd8252('Create\x20a\x20heading\x20level\x202'),'execute':_0x5382f2=>{_0x5382f2['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x580153,'title':_0xd8252('Heading\x203'),'description':_0xd8252('Create\x20a\x20heading\x20level\x203'),'execute':_0x11c9b7=>{_0x11c9b7['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x155ef3,'title':_0xd8252('Heading\x204'),'description':_0xd8252('Create\x20a\x20heading\x20level\x204'),'execute':_0x57d1fe=>{_0x57d1fe['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x161f54,'title':_0xd8252('Heading\x205'),'description':_0xd8252('Create\x20a\x20heading\x20level\x205'),'execute':_0x1467f5=>{_0x1467f5['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x2c6229,'title':_0xd8252('Heading\x206'),'description':_0xd8252('Create\x20a\x20heading\x20level\x206'),'execute':_0x230420=>{_0x230420['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x266c0a,'title':_0xd8252('Horizontal\x20line'),'description':_0xd8252('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x21815b,'title':_0xd8252('Insert\x20HTML'),'description':_0xd8252('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x54a6d2,'title':_0xd8252('Increase\x20indent'),'description':_0xd8252('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0xd8252('Insert\x20Mermaid\x20diagram'),'description':_0xd8252('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0xa0b6,'title':_0xd8252('Insert\x20table'),'description':_0xd8252('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x294bb4,'title':_0xd8252('Table\x20of\x20contents'),'description':_0xd8252('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x1a5723,'title':_0xd8252('Numbered\x20List'),'description':_0xd8252('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x51f411,'title':_0xd8252('Decrease\x20indent'),'description':_0xd8252('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x18c66e,'title':_0xd8252('Paragraph'),'description':_0xd8252('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x37df5b,'title':_0xd8252('To-do\x20List'),'description':_0xd8252('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x269a5d,'title':_0xd8252('Footnote'),'description':_0xd8252('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x3eac36){return _0x3eac36['isEnabled']?_0x3eac36['isEnabled'](this['editor']):!_0x3eac36['commandName']||this['editor']['commands']['get'](_0x3eac36['commandName'])['isEnabled'];}_proxyExecute(_0xd12153){if(_0xd12153['execute'])_0xd12153['execute'](this['editor']);else{if(!_0xd12153['commandName'])throw new _0x50c559('slash-command-execute-missing',this['editor'],{'commandDefinition':_0xd12153});this['editor']['execute'](_0xd12153['commandName']);}}};function E(_0x2b8a4d,_0x40988a){return _0x2b8a4d['title']<_0x40988a['title']?-0x1:_0x2b8a4d['title']>_0x40988a['title']?0x1:0x0;}function P(_0xc108ad,_0x2386f0){return _0x2386f0+'-'+_0xc108ad['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x170c4b{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x26c02b){const _0x37e551=_0x26c02b&&_0x26c02b['toLowerCase']();let _0x5d50b=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x5d50b=_0x5d50b['filter'](_0x172fef=>_0x172fef['isEnabled']()),_0x37e551){const _0x59e606=[],_0x41f1b8=[],_0x457a0d=[],_0x2083e4=[];for(const _0x136479 of _0x5d50b)_0x136479['id']['toLowerCase']()['includes'](_0x37e551)?_0x59e606['push'](_0x136479):_0x136479['title']['toLowerCase']()['includes'](_0x37e551)?_0x41f1b8['push'](_0x136479):_0x136479['aliases']&&_0x136479['aliases']['some'](_0x2e29c7=>_0x2e29c7['toLowerCase']()['includes'](_0x37e551))?_0x457a0d['push'](_0x136479):_0x136479['description']&&_0x136479['description']['toLowerCase']()['includes'](_0x37e551)&&_0x2083e4['push'](_0x136479);_0x5d50b=_0x59e606['concat'](_0x41f1b8,_0x457a0d,_0x2083e4);}return _0x5d50b;}},M=class extends _0x5db0e8{constructor(_0x5e20eb,_0xfe4034){super(_0x5e20eb),this['textPartView']=this['_createTextPartView'](_0x5e20eb,_0xfe4034),void 0x0!==_0xfe4034['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0xfe4034['isIconColorInherited']),this['set']({'icon':_0xfe4034['icon']||_0x42638d,'withText':!0x0,'label':_0xfe4034['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0x2eacb0,_0x35bfb8){const _0x1c12ac=new _0x27c612(_0x2eacb0);return _0x1c12ac['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x35bfb8['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x35bfb8['description']}]}]:[this['labelView']]}),_0x1c12ac;}},S=class extends _0x170c4b{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4078ed){super(_0x4078ed),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x56ee03=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5aa2e6;for(const _0x3662c9 in _0x56ee03){const _0x5d6eb3=_0x3662c9,_0x275ffc=_0x56ee03[_0x5d6eb3];if('slashCommandLicenseKeyValid'==_0x275ffc||'slashCommandLicenseKeyInvalid'==_0x275ffc||'slashCommandLicenseKeyExpired'==_0x275ffc||'slashCommandLicenseKeyDomainLimit'==_0x275ffc||'slashCommandLicenseKeyNotAllowed'==_0x275ffc||'slashCommandLicenseKeyEvaluationLimit'==_0x275ffc||'slashCommandLicenseKeyUsageLimit'==_0x275ffc){delete _0x56ee03[_0x5d6eb3],_0x5aa2e6=_0x275ffc,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x5aa2e6&&_0x56ee03['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x5aa2e6&&_0x56ee03['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x5aa2e6&&_0x56ee03['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x5aa2e6&&_0x56ee03['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x5aa2e6&&_0x56ee03['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x5aa2e6&&_0x56ee03['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x183f9b=this['editor'],_0x2a08e1=this['editor']['plugins']['get']('SlashCommandEditing'),_0x51e6cb=_0x183f9b['config']['get']('mention.feeds');_0x51e6cb['push']({'marker':'/','feed':_0x313e5d=>_0x2a08e1['getMatchingCommands'](_0x313e5d),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x183f9b['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x183f9b['config']['set']('mention.feeds',_0x51e6cb);}_overrideMentionExecuteListener(){const _0x40e2fc=this['editor'];_0x40e2fc['commands']['get']('mention')['on']('execute',(_0x1230a3,_0x35067a)=>{const _0x1f3c3e=_0x35067a[0x0],_0x13f1ee=_0x40e2fc['model'];'/'===_0x1f3c3e['marker']&&_0x13f1ee['change'](_0x5776ba=>{_0x5776ba['remove'](_0x1f3c3e['range']),_0x1f3c3e['mention']['execute'](),_0x1230a3['stop']();});},{'priority':'high'});}_customItemRenderer(_0x209e15){const _0x3cd7db=this['editor']['locale'],_0x422e90=new M(_0x3cd7db,_0x209e15);return _0x422e90['render'](),_0x422e90['element'];}},D=class extends _0x170c4b{static get requires(){return[_0x1ac00d,K,S];}static get['pluginName'](){return'SlashCommand';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{D as SlashCommand,O as SlashCommandConfig,K as SlashCommandEditing,S as SlashCommandUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-slash-command",
|
|
3
|
-
"version": "48.4.0-alpha.
|
|
3
|
+
"version": "48.4.0-alpha.5",
|
|
4
4
|
"description": "Slash command feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ckeditor/ckeditor5-core": "48.4.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-heading": "48.4.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-mention": "48.4.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-style": "48.4.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-template": "48.4.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.5",
|
|
25
|
+
"@ckeditor/ckeditor5-heading": "48.4.0-alpha.5",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.5",
|
|
27
|
+
"@ckeditor/ckeditor5-mention": "48.4.0-alpha.5",
|
|
28
|
+
"@ckeditor/ckeditor5-style": "48.4.0-alpha.5",
|
|
29
|
+
"@ckeditor/ckeditor5-template": "48.4.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.5"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|