@ckeditor/ckeditor5-slash-command 49.0.0-alpha.4 → 49.0.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 _0x589f6e}from'@ckeditor/ckeditor5-core';import{Mention as _0x118984}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x28d470,uid as _0x1557cd}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x290642,IconBulletedList as _0x56b977,IconCodeBlock as _0x4719d7,IconEmoji as _0x99ae14,IconFootnote as _0x416c59,IconHeading1 as _0x475df8,IconHeading2 as _0x53e621,IconHeading3 as _0x3eec22,IconHeading4 as _0x15c043,IconHeading5 as _0x3dc8c0,IconHeading6 as _0x528f47,IconHorizontalLine as _0x48c8b0,IconHtml as _0x56574e,IconIndent as _0x330106,IconNumberedList as _0x54d0b1,IconOutdent as _0x508994,IconParagraph as _0x284190,IconPlay as _0x487942,IconQuote as _0x1bc25b,IconRobotPencil as _0x3c5658,IconTable as _0x134cea,IconTableOfContents as _0x465bc9,IconTodoList as _0x57a9b0}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x754563,View as _0x5d4972}from'@ckeditor/ckeditor5-ui';var O=class extends _0x589f6e{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x34d810){super(_0x34d810),this['_allowedCommands']=null;}afterInit(){const _0x339818=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x22620a=function(_0x281cea){let _0x2a56cd=['heading4','heading5','heading6'];if(_0x281cea){const _0x4aaae6=_0x281cea['map'](_0x3168c0=>_0x3168c0['model']);_0x2a56cd=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x23f2f4=>!_0x4aaae6['includes'](_0x23f2f4));}return _0x2a56cd;}(this['editor']['config']['get']('heading.options'));let _0x2ef502=this['getDefaultCommands']()['filter'](_0x7206dc=>!_0x22620a['includes'](_0x7206dc['id']))['filter'](_0x19466c=>!_0x339818['includes'](_0x19466c['commandName']));const _0x4af461=this['editor']['config']['get']('slashCommand.extraCommands');_0x4af461&&_0x4af461['length']&&(_0x2ef502=_0x2ef502['concat'](_0x4af461));const _0x2656cc=this['editor']['config']['get']('template.definitions');_0x2656cc&&_0x2656cc['length']&&(_0x2ef502=_0x2ef502['concat'](function(_0x201e23){return _0x201e23['map'](_0x226a3b=>{const {title:_0x25b229,icon:_0x3fcab9,description:_0x4af7f9,data:_0x16fa77}=_0x226a3b,_0x316caf={'id':P(_0x25b229,'template'),'commandName':'insertTemplate','execute':_0x51623c=>{_0x51623c['execute']('insertTemplate',_0x16fa77);},'description':_0x4af7f9,'icon':_0x3fcab9,'title':_0x25b229};return _0x3fcab9&&(_0x316caf['isIconColorInherited']=!0x1),_0x316caf;});}(_0x2656cc)));const _0x2daeab=this['editor']['config']['get']('style.definitions');_0x2daeab&&_0x2daeab['length']&&(_0x2ef502=_0x2ef502['concat'](function(_0x13034c){return _0x13034c['map'](_0x30cf17=>({'id':P(_0x30cf17['name'],'style'),'commandName':'style','execute':_0x3c856c=>{_0x3c856c['execute']('style',{'styleName':_0x30cf17['name']});},'isEnabled':_0x264304=>{const _0x442aa9=_0x264304['commands']['get']('style');return _0x442aa9['isEnabled']&&_0x442aa9['enabledStyles']['includes'](_0x30cf17['name']);},'title':_0x30cf17['name']}));}(_0x2daeab)));const _0x14f9ad=_0x2ef502['filter'](_0x7ffa7f=>!_0x7ffa7f['commandName']||void 0x0!==this['editor']['commands']['get'](_0x7ffa7f['commandName'])),_0x2feda5=[];for(const _0x379bdb of _0x14f9ad)_0x2feda5['push']({'id':_0x379bdb['id'],'commandName':_0x379bdb['commandName'],'title':'function'==typeof _0x379bdb['title']?_0x379bdb['title'](this['editor']):_0x379bdb['title'],'description':_0x379bdb['description'],'icon':_0x379bdb['icon'],'isIconColorInherited':_0x379bdb['isIconColorInherited'],'aliases':_0x379bdb['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x379bdb),'execute':()=>this['_proxyExecute'](_0x379bdb)});this['_allowedCommands']=_0x2feda5['sort'](E),async function(_0x58addb){const _0x20d8cd='5goNZRxHzmBfrl0Fq6Cks1ahDGS2LUEWiby3wKvu4IVPdeT8jn9MOQJtcAY7Xp',_0x256723=0x79770,_0xd3182f={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x40a472(_0x4dc2ae){const _0x46a72b=new window['Promise'](_0x84cdd3=>{_0x4dc2ae['once']('ready',_0x84cdd3);}),_0x4b0be3=window['Date']['now'](),_0x4ee334=_0x4dc2ae['config']['get']('licenseKey');async function _0x4d47cd(){let _0x181af4,_0xd7e002=null,_0x322eb2=null;try{return'GPL'==_0x4ee334?'NotAllowed':(_0x181af4=_0x2c4c1d(),_0x181af4?(_0x181af4['usageEndpoint']&&(_0x322eb2=_0x7343f2(_0x181af4['usageEndpoint'],_0x181af4['jti'])),await _0x37c2ca()?_0x1a6b79()?_0x34c5c8()?'Expired':_0x30f7dc()?('evaluation'==_0x181af4['licenseType']&&(_0xd7e002=_0x19c9b0('EvaluationLimit')),await _0x5052dd()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x34c5c8(){const _0x2c0ada=['evaluation','trial']['includes'](_0x181af4['licenseType'])?_0x4b0be3/0x3e8:0xe10*_0x256723;return _0x181af4['exp']<_0x2c0ada;}function _0x1a6b79(){const _0x5782c0=_0x181af4['features'];return!!_0x5782c0&&(!!_0x5782c0['includes']('*')||(!!_0x5782c0['includes']('SC')||(!!_0x5782c0['includes']('PP')||!(!_0x5782c0['includes']('TRILIUM')||!_0x2c214c()))));}function _0x30f7dc(){const _0x2bed55=_0x181af4['licensedHosts'];if(!_0x2bed55||0x0==_0x2bed55['length'])return!0x0;const {hostname:_0x3e7cc3}=new URL(window['location']['href']);if(_0x2bed55['includes'](_0x3e7cc3))return!0x0;const _0x4cdc7c=_0x3e7cc3['split']('.');return _0x2bed55['filter'](_0xeae767=>_0xeae767['includes']('*'))['map'](_0x26faa3=>_0x26faa3['split']('.'))['filter'](_0x485861=>_0x485861['length']<=_0x4cdc7c['length'])['map'](_0x519a68=>Array(_0x4cdc7c['length']-_0x519a68['length'])['fill']('*'===_0x519a68[0x0]?'*':'')['concat'](_0x519a68))['some'](_0x512e7a=>_0x4cdc7c['every']((_0x30c180,_0x478cef)=>_0x512e7a[_0x478cef]===_0x30c180||'*'===_0x512e7a[_0x478cef]));}function _0x5052dd(){return _0xd7e002&&_0x322eb2?new window['Promise']((_0xc5fbea,_0x45b432)=>{_0xd7e002['then'](_0xc5fbea,_0x45b432),_0x322eb2['then'](_0x58ea9c=>{'Valid'!=_0x58ea9c&&_0xc5fbea(_0x58ea9c);},_0x45b432);}):_0xd7e002||_0x322eb2||'Valid';}}function _0x7343f2(_0x3b6190,_0x5b092c){return new window['Promise'](_0x9b24a6=>{if(_0x5a2b90())return _0x9b24a6('Valid');_0x3d182a(),_0x4dc2ae['decorate']('_sendUsageRequest');let _0x296f1c=!0x1;const _0x54705c=_0x1557cd();function _0x13d63a(_0x5d84be){return!!_0x5d84be&&('object'==typeof _0x5d84be||'function'==typeof _0x5d84be)&&'function'==typeof _0x5d84be['then']&&'function'==typeof _0x5d84be['catch'];}function _0x10f5f5(_0x4653e8){_0x187f48(_0x4653e8)['then'](_0x1de484=>_0x1de484&&'ok'==_0x1de484['status']?_0x1e3e4a(_0x545dca(_0x54705c+_0x5b092c))!=_0x1de484['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4170f7=>(_0x260f74(),_0x4170f7),()=>{const _0x3711ab=_0x2e15cc();return null==_0x3711ab?(_0x260f74(),'Valid'):_0x4b0be3-_0x3711ab>0x240c8400?'UsageLimit':'Valid';})['then'](_0x9b24a6)['catch'](()=>{_0x9b24a6('UsageLimit');});const _0x63e62a=0x36ee80;function _0x260f74(){const _0x33c967='llct-'+_0x1e3e4a(_0x545dca(_0x3b6190)),_0x1d042a=_0x38ac25(_0x1e3e4a(window['Math']['ceil'](_0x4b0be3/_0x63e62a)));window['localStorage']['setItem'](_0x33c967,_0x1d042a);}function _0x2e15cc(){const _0x1e314a='llct-'+_0x1e3e4a(_0x545dca(_0x3b6190)),_0x51a0e4=window['localStorage']['getItem'](_0x1e314a);return _0x51a0e4?window['parseInt'](_0x38ac25(_0x51a0e4),0x10)*_0x63e62a:null;}function _0x187f48(_0x19b8bd){return new window['Promise']((_0x5166d5,_0x153ed3)=>{_0x19b8bd['then'](_0x5166d5,_0x153ed3),window['setTimeout'](_0x153ed3,0x1d4c0);});}}_0x4dc2ae['on']('_sendUsageRequest',(_0x4342bf,_0x44b16c)=>{if(_0x44b16c[0x0]!=_0x3b6190)return _0x9b24a6('UsageLimit');_0x44b16c[0x1]={..._0x44b16c[0x1],'requestId':_0x54705c};},{'priority':'high'}),_0x4dc2ae['on']('_sendUsageRequest',_0x1ec863=>{_0x13d63a(_0x1ec863['return'])&&(_0x296f1c=!0x0,_0x10f5f5(_0x1ec863['return']));},{'priority':'low'}),_0x46a72b['then'](()=>{_0x296f1c||_0x9b24a6('UsageLimit');});});function _0x5a2b90(){return'auto'==_0x4dc2ae['editing']['view']['_overlayModeHint'];}function _0x3d182a(){_0x4dc2ae['editing']['view']['_overlayModeHint']='auto';}}function _0x19c9b0(_0x5e98dc){const _0x217153=[new window['Promise'](_0x3f48d1=>setTimeout(_0x3f48d1,0x93ecc)),_0x46a72b['then'](()=>new window['Promise'](_0xa669aa=>{let _0x4f05a2=0x0;_0x4dc2ae['model']['on']('applyOperation',(_0x35d930,_0x537f6f)=>{_0x537f6f[0x0]['isDocumentOperation']&&_0x4f05a2++,0x5e8==_0x4f05a2&&(_0xa669aa(),_0x35d930['off']());});}))];return window['Promise']['race'](_0x217153)['then'](()=>_0x5e98dc);}async function _0x155396(){await _0x46a72b,_0x4dc2ae['model']['change']=_0x564415,_0x4dc2ae['model']['enqueueChange']=_0x564415,_0x4dc2ae['enableReadOnlyMode']('model');}function _0x2c214c(){return window['glob']&&window['glob']['triliumVersion'];}function _0x257b5a(_0x4dceb5){const _0x209e64=_0x1d7bca();_0x4dc2ae[_0x209e64]='slashCommandLicenseKey'+_0x4dceb5,'Valid'!=_0x4dceb5&&_0x155396();}function _0x1d7bca(){const _0x315d03=window['String'](window['performance']['now']())['replace']('.','');let _0x153ac2='g';for(let _0x3ced88=0x0;_0x3ced88<_0x315d03['length'];_0x3ced88+=0x2){let _0x8be074=window['parseInt'](_0x315d03['substring'](_0x3ced88,_0x3ced88+0x2));_0x8be074>=0x3e&&(_0x8be074-=0x3e),_0x153ac2+=_0x20d8cd[_0x8be074];}return _0x153ac2;}function _0x2c4c1d(){const _0x3a2b9f=_0x4ee334['split']('.');if(0x3!=_0x3a2b9f['length'])return null;return _0x58ed00(_0x3a2b9f[0x1]);function _0x58ed00(_0x58e747){const _0x5e9be5=_0x17244b(_0x58e747);return _0x5e9be5&&_0x2b3b21()?_0x5e9be5:null;function _0x2b3b21(){const _0x5dbbda=_0x5e9be5['jti'],_0x1c317e=window['parseInt'](_0x5dbbda['substring'](_0x5dbbda['length']-0x8),0x10),_0x38f8a7={..._0x5e9be5,'jti':_0x5dbbda['substring'](0x0,_0x5dbbda['length']-0x8)};return delete _0x38f8a7['vc'],_0x545dca(_0x38f8a7)==_0x1c317e;}}}async function _0x37c2ca(){let _0x2000a9=!0x0;try{const [_0x582427,_0x51b9d5,_0x2e8907]=_0x4ee334['split']('.');return _0x4ddb4e(_0x582427),await _0x45d54c(_0x582427,_0x51b9d5,_0x2e8907),_0x2000a9;}catch{return!0x1;}function _0x4ddb4e(_0x5858de){const _0x5b8e78=_0x17244b(_0x5858de);_0x5b8e78&&'ES256'==_0x5b8e78['alg']||(_0x2000a9=!0x1);}async function _0x45d54c(_0xa5da4,_0x268f0b,_0x322289){const _0x265274=window['Uint8Array']['from'](_0x4c565a(_0x322289),_0x64f5e2=>_0x64f5e2['charCodeAt'](0x0)),_0x4d61f8=new window['TextEncoder']()['encode'](_0xa5da4+'.'+_0x268f0b),_0x1130d4=window['crypto']['subtle'];if(!_0x1130d4)return;const _0x235a2e=await _0x1130d4['importKey']('jwk',_0xd3182f,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x1130d4['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x235a2e,_0x265274,_0x4d61f8)||(_0x2000a9=!0x1);}}function _0x17244b(_0x2faab7){return _0x2faab7['startsWith']('ey')?JSON['parse'](_0x4c565a(_0x2faab7)):null;}function _0x4c565a(_0x3081a1){return window['atob'](_0x3081a1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x545dca(_0x3c2017){let _0x121569=0x1505;function _0x439351(_0x441b58){for(let _0x4f00dd=0x0;_0x4f00dd<_0x441b58['length'];_0x4f00dd++){const _0x41f520=_0x441b58['charCodeAt'](_0x4f00dd);_0x121569=(_0x121569<<0x5)+_0x121569+_0x41f520,_0x121569&=_0x121569;}}function _0x595ef2(_0x5ef9e3){Array['isArray'](_0x5ef9e3)?_0x5ef9e3['forEach'](_0x595ef2):_0x5ef9e3&&'object'==typeof _0x5ef9e3?Object['entries'](_0x5ef9e3)['sort']()['forEach'](([_0x110b04,_0x3af4c8])=>{_0x439351(_0x110b04),_0x595ef2(_0x3af4c8);}):_0x439351(window['String'](_0x5ef9e3));}return _0x595ef2(_0x3c2017),_0x121569>>>0x0;}function _0x1e3e4a(_0x2995e3){return _0x2995e3['toString'](0x10)['padStart'](0x8,'0');}function _0x38ac25(_0x47211c){return _0x47211c['split']('')['reverse']()['join']('');}function _0x564415(){}_0x257b5a(await _0x4d47cd());}_0x40a472(_0x58addb['editor']);}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x5ab405=_0x110829=>function(_0x9cbce,_0xb69c28){const t=_0x9cbce['t'],_0x4a2020=_0x9cbce['t'];switch(_0xb69c28){case'AI\x20Assistant':return _0x4a2020('AI\x20Assistant');case'Block\x20quote':return _0x4a2020('Block\x20quote');case'Bulleted\x20List':return _0x4a2020('Bulleted\x20List');case'Insert\x20code\x20block':return _0x4a2020('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x4a2020('Open\x20file\x20manager');case'Insert\x20image':return _0x4a2020('Insert\x20image');case'Heading\x201':return _0x4a2020('Heading\x201');case'Heading\x202':return _0x4a2020('Heading\x202');case'Heading\x203':return _0x4a2020('Heading\x203');case'Heading\x204':return _0x4a2020('Heading\x204');case'Heading\x205':return _0x4a2020('Heading\x205');case'Heading\x206':return _0x4a2020('Heading\x206');case'Horizontal\x20line':return _0x4a2020('Horizontal\x20line');case'Insert\x20HTML':return _0x4a2020('Insert\x20HTML');case'Increase\x20indent':return _0x4a2020('Increase\x20indent');case'Insert\x20table':return _0x4a2020('Insert\x20table');case'Table\x20of\x20contents':return _0x4a2020('Table\x20of\x20contents');case'Numbered\x20List':return _0x4a2020('Numbered\x20List');case'Decrease\x20indent':return _0x4a2020('Decrease\x20indent');case'Paragraph':return _0x4a2020('Paragraph');case'To-do\x20List':return _0x4a2020('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 _0xb69c28;}}(this['editor']['locale'],_0x110829);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x3c5658,'title':_0x5ab405('AI\x20Assistant'),'description':_0x5ab405('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x2db52d=>{setTimeout(()=>_0x2db52d['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x1bc25b,'title':_0x5ab405('Block\x20quote'),'description':_0x5ab405('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x56b977,'title':_0x5ab405('Bulleted\x20List'),'description':_0x5ab405('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x4719d7,'title':_0x5ab405('Insert\x20code\x20block'),'description':_0x5ab405('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x290642,'title':_0x5ab405('Open\x20file\x20manager'),'description':_0x5ab405('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x290642,'title':_0x5ab405('Insert\x20image'),'description':_0x5ab405('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x99ae14,'title':_0x5ab405('Emoji'),'description':_0x5ab405('Insert\x20an\x20emoji'),'execute':_0x2068ac=>{setTimeout(()=>_0x2068ac['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x475df8,'title':_0x5ab405('Heading\x201'),'description':_0x5ab405('Create\x20a\x20heading\x20level\x201'),'execute':_0x3bd013=>{_0x3bd013['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x53e621,'title':_0x5ab405('Heading\x202'),'description':_0x5ab405('Create\x20a\x20heading\x20level\x202'),'execute':_0x5518eb=>{_0x5518eb['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x3eec22,'title':_0x5ab405('Heading\x203'),'description':_0x5ab405('Create\x20a\x20heading\x20level\x203'),'execute':_0x21f2ae=>{_0x21f2ae['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x15c043,'title':_0x5ab405('Heading\x204'),'description':_0x5ab405('Create\x20a\x20heading\x20level\x204'),'execute':_0x444e17=>{_0x444e17['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x3dc8c0,'title':_0x5ab405('Heading\x205'),'description':_0x5ab405('Create\x20a\x20heading\x20level\x205'),'execute':_0x2b64b8=>{_0x2b64b8['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x528f47,'title':_0x5ab405('Heading\x206'),'description':_0x5ab405('Create\x20a\x20heading\x20level\x206'),'execute':_0x2b220c=>{_0x2b220c['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x48c8b0,'title':_0x5ab405('Horizontal\x20line'),'description':_0x5ab405('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x56574e,'title':_0x5ab405('Insert\x20HTML'),'description':_0x5ab405('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x330106,'title':_0x5ab405('Increase\x20indent'),'description':_0x5ab405('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x5ab405('Insert\x20Mermaid\x20diagram'),'description':_0x5ab405('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x134cea,'title':_0x5ab405('Insert\x20table'),'description':_0x5ab405('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x465bc9,'title':_0x5ab405('Table\x20of\x20contents'),'description':_0x5ab405('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x54d0b1,'title':_0x5ab405('Numbered\x20List'),'description':_0x5ab405('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x508994,'title':_0x5ab405('Decrease\x20indent'),'description':_0x5ab405('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x284190,'title':_0x5ab405('Paragraph'),'description':_0x5ab405('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x57a9b0,'title':_0x5ab405('To-do\x20List'),'description':_0x5ab405('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x416c59,'title':_0x5ab405('Footnote'),'description':_0x5ab405('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x40390f){return _0x40390f['isEnabled']?_0x40390f['isEnabled'](this['editor']):!_0x40390f['commandName']||this['editor']['commands']['get'](_0x40390f['commandName'])['isEnabled'];}_proxyExecute(_0x5209cf){if(_0x5209cf['execute'])_0x5209cf['execute'](this['editor']);else{if(!_0x5209cf['commandName'])throw new _0x28d470('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x5209cf});this['editor']['execute'](_0x5209cf['commandName']);}}};function E(_0x4dd739,_0x305c4c){return _0x4dd739['title']<_0x305c4c['title']?-0x1:_0x4dd739['title']>_0x305c4c['title']?0x1:0x0;}function P(_0x58def9,_0x31c2ba){return _0x31c2ba+'-'+_0x58def9['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x589f6e{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x511311){const _0x1e007d=_0x511311&&_0x511311['toLowerCase']();let _0x5811f5=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x5811f5=_0x5811f5['filter'](_0x4e203d=>_0x4e203d['isEnabled']()),_0x1e007d){const _0x2495b6=[],_0xcaa3c0=[],_0x18ea26=[],_0x4aa406=[];for(const _0x1e610f of _0x5811f5)_0x1e610f['id']['toLowerCase']()['includes'](_0x1e007d)?_0x2495b6['push'](_0x1e610f):_0x1e610f['title']['toLowerCase']()['includes'](_0x1e007d)?_0xcaa3c0['push'](_0x1e610f):_0x1e610f['aliases']&&_0x1e610f['aliases']['some'](_0x225411=>_0x225411['toLowerCase']()['includes'](_0x1e007d))?_0x18ea26['push'](_0x1e610f):_0x1e610f['description']&&_0x1e610f['description']['toLowerCase']()['includes'](_0x1e007d)&&_0x4aa406['push'](_0x1e610f);_0x5811f5=_0x2495b6['concat'](_0xcaa3c0,_0x18ea26,_0x4aa406);}return _0x5811f5;}},M=class extends _0x754563{constructor(_0x151dcc,_0x1dbd96){super(_0x151dcc),this['textPartView']=this['_createTextPartView'](_0x151dcc,_0x1dbd96),void 0x0!==_0x1dbd96['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x1dbd96['isIconColorInherited']),this['set']({'icon':_0x1dbd96['icon']||_0x487942,'withText':!0x0,'label':_0x1dbd96['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0x4e7357,_0x2d0d54){const _0x55f5a4=new _0x5d4972(_0x4e7357);return _0x55f5a4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x2d0d54['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x2d0d54['description']}]}]:[this['labelView']]}),_0x55f5a4;}},S=class extends _0x589f6e{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10cc83){super(_0x10cc83),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x1ff392=[this['editor']];for(const _0x32ad9c of _0x1ff392){let _0x303866;for(const _0x523ba8 in _0x32ad9c){const _0xc37983=_0x523ba8,_0xf2239a=_0x32ad9c[_0xc37983];if('slashCommandLicenseKeyValid'==_0xf2239a||'slashCommandLicenseKeyInvalid'==_0xf2239a||'slashCommandLicenseKeyExpired'==_0xf2239a||'slashCommandLicenseKeyDomainLimit'==_0xf2239a||'slashCommandLicenseKeyNotAllowed'==_0xf2239a||'slashCommandLicenseKeyEvaluationLimit'==_0xf2239a||'slashCommandLicenseKeyUsageLimit'==_0xf2239a){delete _0x32ad9c[_0xc37983],_0x303866=_0xf2239a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x303866&&_0x32ad9c['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x303866&&_0x32ad9c['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x303866&&_0x32ad9c['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x303866&&_0x32ad9c['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x303866&&_0x32ad9c['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x303866&&_0x32ad9c['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x18ff69=this['editor'],_0x54eb7c=this['editor']['plugins']['get']('SlashCommandEditing'),_0x3508ae=_0x18ff69['config']['get']('mention.feeds');_0x3508ae['push']({'marker':'/','feed':_0x55460b=>_0x54eb7c['getMatchingCommands'](_0x55460b),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x18ff69['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x18ff69['config']['set']('mention.feeds',_0x3508ae);}_overrideMentionExecuteListener(){const _0x3a3ade=this['editor'];_0x3a3ade['commands']['get']('mention')['on']('execute',(_0x188cd2,_0x15c06f)=>{const _0x5104ae=_0x15c06f[0x0],_0x3e2133=_0x3a3ade['model'];'/'===_0x5104ae['marker']&&_0x3e2133['change'](_0xda8dff=>{_0xda8dff['remove'](_0x5104ae['range']),_0x5104ae['mention']['execute'](),_0x188cd2['stop']();});},{'priority':'high'});}_customItemRenderer(_0x1c365f){const _0x5dd60f=this['editor']['locale'],_0x5a85a8=new M(_0x5dd60f,_0x1c365f);return _0x5a85a8['render'](),_0x5a85a8['element'];}},D=class extends _0x589f6e{static get requires(){return[_0x118984,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 _0x55ef29}from'@ckeditor/ckeditor5-core';import{Mention as _0x3d421d}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0xc28b2,uid as _0x47e84f}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x1f0e6c,IconBulletedList as _0x594cf8,IconCodeBlock as _0x1ad09f,IconEmoji as _0x281d01,IconFootnote as _0x18b6e2,IconHeading1 as _0x4fa13b,IconHeading2 as _0xf94452,IconHeading3 as _0x543bd9,IconHeading4 as _0x3b1ee2,IconHeading5 as _0x455926,IconHeading6 as _0x286d5b,IconHorizontalLine as _0x1dabac,IconHtml as _0x75f72d,IconIndent as _0x28e38e,IconNumberedList as _0x4cd3c4,IconOutdent as _0x3bb700,IconParagraph as _0x3b23e2,IconPlay as _0x2e5d33,IconQuote as _0x332a89,IconRobotPencil as _0x187956,IconTable as _0x18a6a4,IconTableOfContents as _0x19d50e,IconTodoList as _0x479477}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x38bdab,View as _0x561728}from'@ckeditor/ckeditor5-ui';var O=class extends _0x55ef29{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55fe15){super(_0x55fe15),this['_allowedCommands']=null;}afterInit(){const _0x1af312=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x50f531=function(_0x300d23){let _0x2d92ac=['heading4','heading5','heading6'];if(_0x300d23){const _0x343385=_0x300d23['map'](_0x1409e5=>_0x1409e5['model']);_0x2d92ac=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x2ded6d=>!_0x343385['includes'](_0x2ded6d));}return _0x2d92ac;}(this['editor']['config']['get']('heading.options'));let _0x8a2e72=this['getDefaultCommands']()['filter'](_0xc73a0=>!_0x50f531['includes'](_0xc73a0['id']))['filter'](_0x2944dd=>!_0x1af312['includes'](_0x2944dd['commandName']));const _0x46b2e5=this['editor']['config']['get']('slashCommand.extraCommands');_0x46b2e5&&_0x46b2e5['length']&&(_0x8a2e72=_0x8a2e72['concat'](_0x46b2e5));const _0x530d46=this['editor']['config']['get']('template.definitions');_0x530d46&&_0x530d46['length']&&(_0x8a2e72=_0x8a2e72['concat'](function(_0x39a519){return _0x39a519['map'](_0x3ad884=>{const {title:_0x24a784,icon:_0x407622,description:_0x284af2,data:_0x8c447a}=_0x3ad884,_0x5ca9af={'id':P(_0x24a784,'template'),'commandName':'insertTemplate','execute':_0xe162b4=>{_0xe162b4['execute']('insertTemplate',_0x8c447a);},'description':_0x284af2,'icon':_0x407622,'title':_0x24a784};return _0x407622&&(_0x5ca9af['isIconColorInherited']=!0x1),_0x5ca9af;});}(_0x530d46)));const _0x37c50e=this['editor']['config']['get']('style.definitions');_0x37c50e&&_0x37c50e['length']&&(_0x8a2e72=_0x8a2e72['concat'](function(_0x41322e){return _0x41322e['map'](_0x3bb4a4=>({'id':P(_0x3bb4a4['name'],'style'),'commandName':'style','execute':_0x3b4201=>{_0x3b4201['execute']('style',{'styleName':_0x3bb4a4['name']});},'isEnabled':_0x37c2cb=>{const _0x1d16ef=_0x37c2cb['commands']['get']('style');return _0x1d16ef['isEnabled']&&_0x1d16ef['enabledStyles']['includes'](_0x3bb4a4['name']);},'title':_0x3bb4a4['name']}));}(_0x37c50e)));const _0x563612=_0x8a2e72['filter'](_0x2c3b87=>!_0x2c3b87['commandName']||void 0x0!==this['editor']['commands']['get'](_0x2c3b87['commandName'])),_0x473486=[];for(const _0x49b4fd of _0x563612)_0x473486['push']({'id':_0x49b4fd['id'],'commandName':_0x49b4fd['commandName'],'title':'function'==typeof _0x49b4fd['title']?_0x49b4fd['title'](this['editor']):_0x49b4fd['title'],'description':_0x49b4fd['description'],'icon':_0x49b4fd['icon'],'isIconColorInherited':_0x49b4fd['isIconColorInherited'],'aliases':_0x49b4fd['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x49b4fd),'execute':()=>this['_proxyExecute'](_0x49b4fd)});this['_allowedCommands']=_0x473486['sort'](E),async function(_0x16da63){const _0x3e4593='5goNZRxHzmBfrl0Fq6Cks1ahDGS2LUEWiby3wKvu4IVPdeT8jn9MOQJtcAY7Xp',_0x99c07e=0x79788,_0x1d6bcd={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x15e552(_0x3a6cd3){const _0x579c99=new window['Promise'](_0x41abed=>{_0x3a6cd3['once']('ready',_0x41abed);}),_0x4b6b17=window['Date']['now'](),_0x1bbf41=_0x3a6cd3['config']['get']('licenseKey');async function _0xb4e6e3(){let _0x58b1cb,_0x2c9b74=null,_0x1dcdf1=null;try{return'GPL'==_0x1bbf41?'NotAllowed':(_0x58b1cb=_0x1003e4(),_0x58b1cb?(_0x58b1cb['usageEndpoint']&&(_0x1dcdf1=_0x379bc1(_0x58b1cb['usageEndpoint'],_0x58b1cb['jti'])),await _0x29ec03()?_0x333769()?_0x97b260()?'Expired':_0x2cfd75()?('evaluation'==_0x58b1cb['licenseType']&&(_0x2c9b74=_0x3e1bc3('EvaluationLimit')),await _0x27bc0e()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x97b260(){const _0x5f2756=['evaluation','trial']['includes'](_0x58b1cb['licenseType'])?_0x4b6b17/0x3e8:0xe10*_0x99c07e;return _0x58b1cb['exp']<_0x5f2756;}function _0x333769(){const _0x4ad2f8=_0x58b1cb['features'];return!!_0x4ad2f8&&(!!_0x4ad2f8['includes']('*')||(!!_0x4ad2f8['includes']('SC')||(!!_0x4ad2f8['includes']('PP')||!(!_0x4ad2f8['includes']('TRILIUM')||!_0x137ae8()))));}function _0x2cfd75(){const _0x44bfdf=_0x58b1cb['licensedHosts'];if(!_0x44bfdf||0x0==_0x44bfdf['length'])return!0x0;const {hostname:_0x3781fd}=new URL(window['location']['href']);if(_0x44bfdf['includes'](_0x3781fd))return!0x0;const _0x3049b3=_0x3781fd['split']('.');return _0x44bfdf['filter'](_0x4d3612=>_0x4d3612['includes']('*'))['map'](_0x2fe74d=>_0x2fe74d['split']('.'))['filter'](_0xb4c9c=>_0xb4c9c['length']<=_0x3049b3['length'])['map'](_0x527720=>Array(_0x3049b3['length']-_0x527720['length'])['fill']('*'===_0x527720[0x0]?'*':'')['concat'](_0x527720))['some'](_0x5584e0=>_0x3049b3['every']((_0x23b5d3,_0x25b58b)=>_0x5584e0[_0x25b58b]===_0x23b5d3||'*'===_0x5584e0[_0x25b58b]));}function _0x27bc0e(){return _0x2c9b74&&_0x1dcdf1?new window['Promise']((_0x49564a,_0xedf94c)=>{_0x2c9b74['then'](_0x49564a,_0xedf94c),_0x1dcdf1['then'](_0x214e4d=>{'Valid'!=_0x214e4d&&_0x49564a(_0x214e4d);},_0xedf94c);}):_0x2c9b74||_0x1dcdf1||'Valid';}}function _0x379bc1(_0x2e9a9a,_0x3590d1){return new window['Promise'](_0x292d48=>{if(_0x52ba42())return _0x292d48('Valid');_0x168a7c(),_0x3a6cd3['decorate']('_sendUsageRequest');let _0x514145=!0x1;const _0x44275b=_0x47e84f();function _0x5271e8(_0x4a757d){return!!_0x4a757d&&('object'==typeof _0x4a757d||'function'==typeof _0x4a757d)&&'function'==typeof _0x4a757d['then']&&'function'==typeof _0x4a757d['catch'];}function _0x3c8f52(_0x4a787f){_0x1fbbe6(_0x4a787f)['then'](_0x242338=>_0x242338&&'ok'==_0x242338['status']?_0x307922(_0x38db7f(_0x44275b+_0x3590d1))!=_0x242338['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1c269c=>(_0x397e58(),_0x1c269c),()=>{const _0x1f1c68=_0x3ef23b();return null==_0x1f1c68?(_0x397e58(),'Valid'):_0x4b6b17-_0x1f1c68>0x240c8400?'UsageLimit':'Valid';})['then'](_0x292d48)['catch'](()=>{_0x292d48('UsageLimit');});const _0xa6e790=0x36ee80;function _0x397e58(){const _0x387f2d='llct-'+_0x307922(_0x38db7f(_0x2e9a9a)),_0x4f46fc=_0x21ae8d(_0x307922(window['Math']['ceil'](_0x4b6b17/_0xa6e790)));window['localStorage']['setItem'](_0x387f2d,_0x4f46fc);}function _0x3ef23b(){const _0x59c685='llct-'+_0x307922(_0x38db7f(_0x2e9a9a)),_0x52ac72=window['localStorage']['getItem'](_0x59c685);return _0x52ac72?window['parseInt'](_0x21ae8d(_0x52ac72),0x10)*_0xa6e790:null;}function _0x1fbbe6(_0x39151a){return new window['Promise']((_0x60f867,_0x38d4ac)=>{_0x39151a['then'](_0x60f867,_0x38d4ac),window['setTimeout'](_0x38d4ac,0x1d4c0);});}}_0x3a6cd3['on']('_sendUsageRequest',(_0x2b2524,_0x30090e)=>{if(_0x30090e[0x0]!=_0x2e9a9a)return _0x292d48('UsageLimit');_0x30090e[0x1]={..._0x30090e[0x1],'requestId':_0x44275b};},{'priority':'high'}),_0x3a6cd3['on']('_sendUsageRequest',_0x3c06fa=>{_0x5271e8(_0x3c06fa['return'])&&(_0x514145=!0x0,_0x3c8f52(_0x3c06fa['return']));},{'priority':'low'}),_0x579c99['then'](()=>{_0x514145||_0x292d48('UsageLimit');});});function _0x52ba42(){return'auto'==_0x3a6cd3['editing']['view']['_overlayModeHint'];}function _0x168a7c(){_0x3a6cd3['editing']['view']['_overlayModeHint']='auto';}}function _0x3e1bc3(_0x3806eb){const _0x1dc74b=[new window['Promise'](_0x581b69=>setTimeout(_0x581b69,0x93ecc)),_0x579c99['then'](()=>new window['Promise'](_0x2b0366=>{let _0x3facee=0x0;_0x3a6cd3['model']['on']('applyOperation',(_0x139649,_0x5983f)=>{_0x5983f[0x0]['isDocumentOperation']&&_0x3facee++,0x5e8==_0x3facee&&(_0x2b0366(),_0x139649['off']());});}))];return window['Promise']['race'](_0x1dc74b)['then'](()=>_0x3806eb);}async function _0x150682(){await _0x579c99,_0x3a6cd3['model']['change']=_0x39f448,_0x3a6cd3['model']['enqueueChange']=_0x39f448,_0x3a6cd3['enableReadOnlyMode']('model');}function _0x137ae8(){return window['glob']&&window['glob']['triliumVersion'];}function _0x32656f(_0x3c3fd1){const _0x1a959a=_0x30eef1();_0x3a6cd3[_0x1a959a]='slashCommandLicenseKey'+_0x3c3fd1,'Valid'!=_0x3c3fd1&&_0x150682();}function _0x30eef1(){const _0x2d4fe9=window['String'](window['performance']['now']())['replace']('.','');let _0x33c20e='g';for(let _0x8b25d8=0x0;_0x8b25d8<_0x2d4fe9['length'];_0x8b25d8+=0x2){let _0x158515=window['parseInt'](_0x2d4fe9['substring'](_0x8b25d8,_0x8b25d8+0x2));_0x158515>=0x3e&&(_0x158515-=0x3e),_0x33c20e+=_0x3e4593[_0x158515];}return _0x33c20e;}function _0x1003e4(){const _0x12832a=_0x1bbf41['split']('.');if(0x3!=_0x12832a['length'])return null;return _0x187f42(_0x12832a[0x1]);function _0x187f42(_0xedfdc){const _0x55dd01=_0x42f0bd(_0xedfdc);return _0x55dd01&&_0x4dbbf8()?_0x55dd01:null;function _0x4dbbf8(){const _0x4d16b9=_0x55dd01['jti'],_0x2039a3=window['parseInt'](_0x4d16b9['substring'](_0x4d16b9['length']-0x8),0x10),_0x3179d0={..._0x55dd01,'jti':_0x4d16b9['substring'](0x0,_0x4d16b9['length']-0x8)};return delete _0x3179d0['vc'],_0x38db7f(_0x3179d0)==_0x2039a3;}}}async function _0x29ec03(){let _0x1571aa=!0x0;try{const [_0x417fd2,_0xa77333,_0x582b07]=_0x1bbf41['split']('.');return _0x127fa6(_0x417fd2),await _0x3270ee(_0x417fd2,_0xa77333,_0x582b07),_0x1571aa;}catch{return!0x1;}function _0x127fa6(_0x23839d){const _0xfe9daf=_0x42f0bd(_0x23839d);_0xfe9daf&&'ES256'==_0xfe9daf['alg']||(_0x1571aa=!0x1);}async function _0x3270ee(_0x2dfd9b,_0x51b187,_0x18b648){const _0x4b78e9=window['Uint8Array']['from'](_0x34b0cf(_0x18b648),_0x13e5a6=>_0x13e5a6['charCodeAt'](0x0)),_0x15b4cb=new window['TextEncoder']()['encode'](_0x2dfd9b+'.'+_0x51b187),_0x4fd36e=window['crypto']['subtle'];if(!_0x4fd36e)return;const _0x37cef6=await _0x4fd36e['importKey']('jwk',_0x1d6bcd,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4fd36e['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x37cef6,_0x4b78e9,_0x15b4cb)||(_0x1571aa=!0x1);}}function _0x42f0bd(_0x4638a2){return _0x4638a2['startsWith']('ey')?JSON['parse'](_0x34b0cf(_0x4638a2)):null;}function _0x34b0cf(_0x5c8a8c){return window['atob'](_0x5c8a8c['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x38db7f(_0x46468f){let _0x3dff29=0x1505;function _0x13cc70(_0x1ed729){for(let _0x5bcc00=0x0;_0x5bcc00<_0x1ed729['length'];_0x5bcc00++){const _0xfb3bc5=_0x1ed729['charCodeAt'](_0x5bcc00);_0x3dff29=(_0x3dff29<<0x5)+_0x3dff29+_0xfb3bc5,_0x3dff29&=_0x3dff29;}}function _0x54d09a(_0x397359){Array['isArray'](_0x397359)?_0x397359['forEach'](_0x54d09a):_0x397359&&'object'==typeof _0x397359?Object['entries'](_0x397359)['sort']()['forEach'](([_0x4fe0cf,_0x5396dd])=>{_0x13cc70(_0x4fe0cf),_0x54d09a(_0x5396dd);}):_0x13cc70(window['String'](_0x397359));}return _0x54d09a(_0x46468f),_0x3dff29>>>0x0;}function _0x307922(_0x790b60){return _0x790b60['toString'](0x10)['padStart'](0x8,'0');}function _0x21ae8d(_0x3822fc){return _0x3822fc['split']('')['reverse']()['join']('');}function _0x39f448(){}_0x32656f(await _0xb4e6e3());}_0x15e552(_0x16da63['editor']);}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x14c1a4=_0x26d62e=>function(_0x5d7030,_0x29f70d){const t=_0x5d7030['t'],_0x46c3b=_0x5d7030['t'];switch(_0x29f70d){case'AI\x20Assistant':return _0x46c3b('AI\x20Assistant');case'Block\x20quote':return _0x46c3b('Block\x20quote');case'Bulleted\x20List':return _0x46c3b('Bulleted\x20List');case'Insert\x20code\x20block':return _0x46c3b('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x46c3b('Open\x20file\x20manager');case'Insert\x20image':return _0x46c3b('Insert\x20image');case'Heading\x201':return _0x46c3b('Heading\x201');case'Heading\x202':return _0x46c3b('Heading\x202');case'Heading\x203':return _0x46c3b('Heading\x203');case'Heading\x204':return _0x46c3b('Heading\x204');case'Heading\x205':return _0x46c3b('Heading\x205');case'Heading\x206':return _0x46c3b('Heading\x206');case'Horizontal\x20line':return _0x46c3b('Horizontal\x20line');case'Insert\x20HTML':return _0x46c3b('Insert\x20HTML');case'Increase\x20indent':return _0x46c3b('Increase\x20indent');case'Insert\x20table':return _0x46c3b('Insert\x20table');case'Table\x20of\x20contents':return _0x46c3b('Table\x20of\x20contents');case'Numbered\x20List':return _0x46c3b('Numbered\x20List');case'Decrease\x20indent':return _0x46c3b('Decrease\x20indent');case'Paragraph':return _0x46c3b('Paragraph');case'To-do\x20List':return _0x46c3b('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 _0x29f70d;}}(this['editor']['locale'],_0x26d62e);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x187956,'title':_0x14c1a4('AI\x20Assistant'),'description':_0x14c1a4('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x59bdfe=>{setTimeout(()=>_0x59bdfe['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x332a89,'title':_0x14c1a4('Block\x20quote'),'description':_0x14c1a4('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x594cf8,'title':_0x14c1a4('Bulleted\x20List'),'description':_0x14c1a4('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x1ad09f,'title':_0x14c1a4('Insert\x20code\x20block'),'description':_0x14c1a4('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x1f0e6c,'title':_0x14c1a4('Open\x20file\x20manager'),'description':_0x14c1a4('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x1f0e6c,'title':_0x14c1a4('Insert\x20image'),'description':_0x14c1a4('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x281d01,'title':_0x14c1a4('Emoji'),'description':_0x14c1a4('Insert\x20an\x20emoji'),'execute':_0x1e5fc0=>{setTimeout(()=>_0x1e5fc0['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x4fa13b,'title':_0x14c1a4('Heading\x201'),'description':_0x14c1a4('Create\x20a\x20heading\x20level\x201'),'execute':_0x4726eb=>{_0x4726eb['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0xf94452,'title':_0x14c1a4('Heading\x202'),'description':_0x14c1a4('Create\x20a\x20heading\x20level\x202'),'execute':_0x2b19bb=>{_0x2b19bb['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x543bd9,'title':_0x14c1a4('Heading\x203'),'description':_0x14c1a4('Create\x20a\x20heading\x20level\x203'),'execute':_0x1503af=>{_0x1503af['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x3b1ee2,'title':_0x14c1a4('Heading\x204'),'description':_0x14c1a4('Create\x20a\x20heading\x20level\x204'),'execute':_0x320a64=>{_0x320a64['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x455926,'title':_0x14c1a4('Heading\x205'),'description':_0x14c1a4('Create\x20a\x20heading\x20level\x205'),'execute':_0x40e175=>{_0x40e175['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x286d5b,'title':_0x14c1a4('Heading\x206'),'description':_0x14c1a4('Create\x20a\x20heading\x20level\x206'),'execute':_0x559b6d=>{_0x559b6d['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x1dabac,'title':_0x14c1a4('Horizontal\x20line'),'description':_0x14c1a4('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x75f72d,'title':_0x14c1a4('Insert\x20HTML'),'description':_0x14c1a4('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x28e38e,'title':_0x14c1a4('Increase\x20indent'),'description':_0x14c1a4('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x14c1a4('Insert\x20Mermaid\x20diagram'),'description':_0x14c1a4('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x18a6a4,'title':_0x14c1a4('Insert\x20table'),'description':_0x14c1a4('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x19d50e,'title':_0x14c1a4('Table\x20of\x20contents'),'description':_0x14c1a4('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x4cd3c4,'title':_0x14c1a4('Numbered\x20List'),'description':_0x14c1a4('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x3bb700,'title':_0x14c1a4('Decrease\x20indent'),'description':_0x14c1a4('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x3b23e2,'title':_0x14c1a4('Paragraph'),'description':_0x14c1a4('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x479477,'title':_0x14c1a4('To-do\x20List'),'description':_0x14c1a4('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x18b6e2,'title':_0x14c1a4('Footnote'),'description':_0x14c1a4('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x19e163){return _0x19e163['isEnabled']?_0x19e163['isEnabled'](this['editor']):!_0x19e163['commandName']||this['editor']['commands']['get'](_0x19e163['commandName'])['isEnabled'];}_proxyExecute(_0x3d3b96){if(_0x3d3b96['execute'])_0x3d3b96['execute'](this['editor']);else{if(!_0x3d3b96['commandName'])throw new _0xc28b2('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x3d3b96});this['editor']['execute'](_0x3d3b96['commandName']);}}};function E(_0x3d4cb0,_0x4a6cde){return _0x3d4cb0['title']<_0x4a6cde['title']?-0x1:_0x3d4cb0['title']>_0x4a6cde['title']?0x1:0x0;}function P(_0x45299c,_0x44699a){return _0x44699a+'-'+_0x45299c['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x55ef29{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x239573){const _0x3497bd=_0x239573&&_0x239573['toLowerCase']();let _0x503798=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x503798=_0x503798['filter'](_0x332de8=>_0x332de8['isEnabled']()),_0x3497bd){const _0x1e0922=[],_0x38f114=[],_0x2f0952=[],_0x248e1d=[];for(const _0x4ea3e5 of _0x503798)_0x4ea3e5['id']['toLowerCase']()['includes'](_0x3497bd)?_0x1e0922['push'](_0x4ea3e5):_0x4ea3e5['title']['toLowerCase']()['includes'](_0x3497bd)?_0x38f114['push'](_0x4ea3e5):_0x4ea3e5['aliases']&&_0x4ea3e5['aliases']['some'](_0x1618e2=>_0x1618e2['toLowerCase']()['includes'](_0x3497bd))?_0x2f0952['push'](_0x4ea3e5):_0x4ea3e5['description']&&_0x4ea3e5['description']['toLowerCase']()['includes'](_0x3497bd)&&_0x248e1d['push'](_0x4ea3e5);_0x503798=_0x1e0922['concat'](_0x38f114,_0x2f0952,_0x248e1d);}return _0x503798;}},M=class extends _0x38bdab{constructor(_0x8e7b59,_0x36348f){super(_0x8e7b59),this['textPartView']=this['_createTextPartView'](_0x8e7b59,_0x36348f),void 0x0!==_0x36348f['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x36348f['isIconColorInherited']),this['set']({'icon':_0x36348f['icon']||_0x2e5d33,'withText':!0x0,'label':_0x36348f['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0xee7b4,_0x57ba9f){const _0x5aeb90=new _0x561728(_0xee7b4);return _0x5aeb90['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x57ba9f['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x57ba9f['description']}]}]:[this['labelView']]}),_0x5aeb90;}},S=class extends _0x55ef29{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x555216){super(_0x555216),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2c13de=[this['editor']];for(const _0x169e08 of _0x2c13de){let _0x11ee8a;for(const _0x5098ed in _0x169e08){const _0x51668a=_0x5098ed,_0x257286=_0x169e08[_0x51668a];if('slashCommandLicenseKeyValid'==_0x257286||'slashCommandLicenseKeyInvalid'==_0x257286||'slashCommandLicenseKeyExpired'==_0x257286||'slashCommandLicenseKeyDomainLimit'==_0x257286||'slashCommandLicenseKeyNotAllowed'==_0x257286||'slashCommandLicenseKeyEvaluationLimit'==_0x257286||'slashCommandLicenseKeyUsageLimit'==_0x257286){delete _0x169e08[_0x51668a],_0x11ee8a=_0x257286,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x11ee8a&&_0x169e08['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x11ee8a&&_0x169e08['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x11ee8a&&_0x169e08['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x11ee8a&&_0x169e08['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x11ee8a&&_0x169e08['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x11ee8a&&_0x169e08['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x319ec5=this['editor'],_0x559b61=this['editor']['plugins']['get']('SlashCommandEditing'),_0x76aa8d=_0x319ec5['config']['get']('mention.feeds');_0x76aa8d['push']({'marker':'/','feed':_0x28ab5b=>_0x559b61['getMatchingCommands'](_0x28ab5b),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x319ec5['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x319ec5['config']['set']('mention.feeds',_0x76aa8d);}_overrideMentionExecuteListener(){const _0x46e5ee=this['editor'];_0x46e5ee['commands']['get']('mention')['on']('execute',(_0x4567ad,_0x34f03d)=>{const _0x3b5be5=_0x34f03d[0x0],_0x4707ee=_0x46e5ee['model'];'/'===_0x3b5be5['marker']&&_0x4707ee['change'](_0x23efcc=>{_0x23efcc['remove'](_0x3b5be5['range']),_0x3b5be5['mention']['execute'](),_0x4567ad['stop']();});},{'priority':'high'});}_customItemRenderer(_0x28ad17){const _0x423222=this['editor']['locale'],_0x5c160d=new M(_0x423222,_0x28ad17);return _0x5c160d['render'](),_0x5c160d['element'];}},D=class extends _0x55ef29{static get requires(){return[_0x3d421d,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": "49.0.0-alpha.
|
|
3
|
+
"version": "49.0.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": "49.0.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-heading": "49.0.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-mention": "49.0.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-style": "49.0.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-template": "49.0.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "49.0.0-alpha.5",
|
|
25
|
+
"@ckeditor/ckeditor5-heading": "49.0.0-alpha.5",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.5",
|
|
27
|
+
"@ckeditor/ckeditor5-mention": "49.0.0-alpha.5",
|
|
28
|
+
"@ckeditor/ckeditor5-style": "49.0.0-alpha.5",
|
|
29
|
+
"@ckeditor/ckeditor5-template": "49.0.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.5"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|