@ckeditor/ckeditor5-slash-command 48.3.0-alpha.5 → 48.3.0-alpha.6
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 _0x5abc92}from'@ckeditor/ckeditor5-core';import{Mention as _0x463592}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x24216f,uid as _0x199098}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x1ae631,IconBulletedList as _0x34a56d,IconCodeBlock as _0x293872,IconEmoji as _0x1cd2ed,IconFootnote as _0x471d67,IconHeading1 as _0x642e32,IconHeading2 as _0x3cc76c,IconHeading3 as _0x505c65,IconHeading4 as _0x48341c,IconHeading5 as _0x58878e,IconHeading6 as _0x53410d,IconHorizontalLine as _0x2030ec,IconHtml as _0x78938d,IconIndent as _0x54d539,IconNumberedList as _0x4ee602,IconOutdent as _0x5af0f4,IconParagraph as _0x1c2561,IconPlay as _0x2d6392,IconQuote as _0x4dd3db,IconRobotPencil as _0x2d951c,IconTable as _0x33b964,IconTableOfContents as _0x233e76,IconTodoList as _0xcc27e8}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x498f61,View as _0x5541cf}from'@ckeditor/ckeditor5-ui';var O=class extends _0x5abc92{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x150bb4){super(_0x150bb4),this['_allowedCommands']=null;}['afterInit'](){const _0x22798a=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x5a39d1=function(_0x166ed5){let _0x3d34ac=['heading4','heading5','heading6'];if(_0x166ed5){const _0x245bb3=_0x166ed5['map'](_0x543afd=>_0x543afd['model']);_0x3d34ac=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x501b41=>!_0x245bb3['includes'](_0x501b41));}return _0x3d34ac;}(this['editor']['config']['get']('heading.options'));let _0x58edfc=this['getDefaultCommands']()['filter'](_0x12283c=>!_0x5a39d1['includes'](_0x12283c['id']))['filter'](_0x1468e1=>!_0x22798a['includes'](_0x1468e1['commandName']));const _0xf647ae=this['editor']['config']['get']('slashCommand.extraCommands');_0xf647ae&&_0xf647ae['length']&&(_0x58edfc=_0x58edfc['concat'](_0xf647ae));const _0x417e3b=this['editor']['config']['get']('template.definitions');_0x417e3b&&_0x417e3b['length']&&(_0x58edfc=_0x58edfc['concat'](function(_0x187715){return _0x187715['map'](_0x4c373e=>{const {title:_0x2656de,icon:_0xf15b81,description:_0x41f689,data:_0x502870}=_0x4c373e,_0x853774={'id':P(_0x2656de,'template'),'commandName':'insertTemplate','execute':_0x1a7585=>{_0x1a7585['execute']('insertTemplate',_0x502870);},'description':_0x41f689,'icon':_0xf15b81,'title':_0x2656de};return _0xf15b81&&(_0x853774['isIconColorInherited']=!0x1),_0x853774;});}(_0x417e3b)));const _0xa3be6c=this['editor']['config']['get']('style.definitions');_0xa3be6c&&_0xa3be6c['length']&&(_0x58edfc=_0x58edfc['concat'](function(_0x1d28d6){return _0x1d28d6['map'](_0x5376ea=>({'id':P(_0x5376ea['name'],'style'),'commandName':'style','execute':_0x477369=>{_0x477369['execute']('style',{'styleName':_0x5376ea['name']});},'isEnabled':_0x5822ee=>{const _0xd4ea6d=_0x5822ee['commands']['get']('style');return _0xd4ea6d['isEnabled']&&_0xd4ea6d['enabledStyles']['includes'](_0x5376ea['name']);},'title':_0x5376ea['name']}));}(_0xa3be6c)));const _0xee11f2=_0x58edfc['filter'](_0x2f37f6=>!_0x2f37f6['commandName']||void 0x0!==this['editor']['commands']['get'](_0x2f37f6['commandName'])),_0x2d680d=[];for(const _0x1fbd68 of _0xee11f2)_0x2d680d['push']({'id':_0x1fbd68['id'],'commandName':_0x1fbd68['commandName'],'title':'function'==typeof _0x1fbd68['title']?_0x1fbd68['title'](this['editor']):_0x1fbd68['title'],'description':_0x1fbd68['description'],'icon':_0x1fbd68['icon'],'isIconColorInherited':_0x1fbd68['isIconColorInherited'],'aliases':_0x1fbd68['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x1fbd68),'execute':()=>this['_proxyExecute'](_0x1fbd68)});this['_allowedCommands']=_0x2d680d['sort'](E),async function(_0x3690c2){const _0x31e8f4='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x3ad629=0x78e40,_0x1787e8=window['Date']['now'](),_0x42d947=_0x3690c2['editor'],_0xed4b19=new window['Promise'](_0x3c2ee3=>{_0x42d947['once']('ready',_0x3c2ee3);}),_0x2fb4cf={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x230cd7=_0x42d947['config']['get']('licenseKey');async function _0x398842(){let _0x4e7bc7,_0x169d84=null,_0x10647a=null;try{return'GPL'==_0x230cd7?'NotAllowed':(_0x4e7bc7=_0x3ed9f7(),_0x4e7bc7?(_0x4e7bc7['usageEndpoint']&&(_0x10647a=_0x4eb6b6(_0x4e7bc7['usageEndpoint'],_0x4e7bc7['jti'])),await _0x5d0701()?_0x4937a7()?_0xce42cf()?'Expired':_0x251f5f()?('evaluation'==_0x4e7bc7['licenseType']&&(_0x169d84=_0x4fdd59('EvaluationLimit')),await _0x511c6c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xce42cf(){const _0x447450=['evaluation','trial']['includes'](_0x4e7bc7['licenseType'])?_0x1787e8/0x3e8:0xe10*_0x3ad629;return _0x4e7bc7['exp']<_0x447450;}function _0x4937a7(){const _0x52bb11=_0x4e7bc7['features'];return!!_0x52bb11&&(!!_0x52bb11['includes']('*')||(!!_0x52bb11['includes']('SC')||(!!_0x52bb11['includes']('PP')||!(!_0x52bb11['includes']('TRILIUM')||!_0x59092e()))));}function _0x251f5f(){const _0x21530b=_0x4e7bc7['licensedHosts'];if(!_0x21530b||0x0==_0x21530b['length'])return!0x0;const {hostname:_0x5229fb}=new URL(window['location']['href']);if(_0x21530b['includes'](_0x5229fb))return!0x0;const _0x531d3f=_0x5229fb['split']('.');return _0x21530b['filter'](_0x1fbdf4=>_0x1fbdf4['includes']('*'))['map'](_0x4770c7=>_0x4770c7['split']('.'))['filter'](_0x3aed84=>_0x3aed84['length']<=_0x531d3f['length'])['map'](_0x225841=>Array(_0x531d3f['length']-_0x225841['length'])['fill']('*'===_0x225841[0x0]?'*':'')['concat'](_0x225841))['some'](_0x38b094=>_0x531d3f['every']((_0x3031e4,_0x5ec79a)=>_0x38b094[_0x5ec79a]===_0x3031e4||'*'===_0x38b094[_0x5ec79a]));}function _0x511c6c(){return _0x169d84&&_0x10647a?new window['Promise']((_0x3743f5,_0x2eeb06)=>{_0x169d84['then'](_0x3743f5,_0x2eeb06),_0x10647a['then'](_0x3cd040=>{'Valid'!=_0x3cd040&&_0x3743f5(_0x3cd040);},_0x2eeb06);}):_0x169d84||_0x10647a||'Valid';}}function _0x4eb6b6(_0x22c4cc,_0x12b1a5){return new window['Promise'](_0x32f12b=>{if(_0x3fc5f3())return _0x32f12b('Valid');_0x88c863(),_0x42d947['decorate']('_sendUsageRequest');let _0x5234e9=!0x1;const _0x30c6d7=_0x199098();function _0x3abd5f(_0x812cd2){return!!_0x812cd2&&('object'==typeof _0x812cd2||'function'==typeof _0x812cd2)&&'function'==typeof _0x812cd2['then']&&'function'==typeof _0x812cd2['catch'];}function _0x4a3db6(_0x3bdb31){_0x51640a(_0x3bdb31)['then'](_0x2c0ac1=>_0x2c0ac1&&'ok'==_0x2c0ac1['status']?_0x58cb4e(_0x4e3c3c(_0x30c6d7+_0x12b1a5))!=_0x2c0ac1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3bf2df=>(_0xf6a893(),_0x3bf2df),()=>{const _0x4c1fd6=_0x1e32d3();return null==_0x4c1fd6?(_0xf6a893(),'Valid'):_0x1787e8-_0x4c1fd6>0x240c8400?'UsageLimit':'Valid';})['then'](_0x32f12b)['catch'](()=>{_0x32f12b('UsageLimit');});const _0x399363=0x36ee80;function _0xf6a893(){const _0x1feea4='llct-'+_0x58cb4e(_0x4e3c3c(_0x22c4cc)),_0x5526d6=_0x379de0(_0x58cb4e(window['Math']['ceil'](_0x1787e8/_0x399363)));window['localStorage']['setItem'](_0x1feea4,_0x5526d6);}function _0x1e32d3(){const _0x35445b='llct-'+_0x58cb4e(_0x4e3c3c(_0x22c4cc)),_0x7a3d33=window['localStorage']['getItem'](_0x35445b);return _0x7a3d33?window['parseInt'](_0x379de0(_0x7a3d33),0x10)*_0x399363:null;}function _0x51640a(_0x21ba91){return new window['Promise']((_0x3264a6,_0x33c9e3)=>{_0x21ba91['then'](_0x3264a6,_0x33c9e3),window['setTimeout'](_0x33c9e3,0x1d4c0);});}}_0x42d947['on']('_sendUsageRequest',(_0x41249f,_0x56f706)=>{if(_0x56f706[0x0]!=_0x22c4cc)return _0x32f12b('UsageLimit');_0x56f706[0x1]={..._0x56f706[0x1],'requestId':_0x30c6d7};},{'priority':'high'}),_0x42d947['on']('_sendUsageRequest',_0x1a20bc=>{_0x3abd5f(_0x1a20bc['return'])&&(_0x5234e9=!0x0,_0x4a3db6(_0x1a20bc['return']));},{'priority':'low'}),_0xed4b19['then'](()=>{_0x5234e9||_0x32f12b('UsageLimit');});});function _0x3fc5f3(){return'auto'==_0x42d947['editing']['view']['_overlayModeHint'];}function _0x88c863(){_0x42d947['editing']['view']['_overlayModeHint']='auto';}}function _0x4fdd59(_0x35f146){const _0x1db2c2=[new window['Promise'](_0x3a9ba3=>setTimeout(_0x3a9ba3,0x93ecc)),_0xed4b19['then'](()=>new window['Promise'](_0x20a740=>{let _0x27388b=0x0;_0x42d947['model']['on']('applyOperation',(_0x29bb85,_0x563fa2)=>{_0x563fa2[0x0]['isDocumentOperation']&&_0x27388b++,0x5e8==_0x27388b&&(_0x20a740(),_0x29bb85['off']());});}))];return window['Promise']['race'](_0x1db2c2)['then'](()=>_0x35f146);}async function _0x53b42c(){await _0xed4b19,_0x42d947['model']['change']=_0x1a1b3b,_0x42d947['model']['enqueueChange']=_0x1a1b3b,_0x42d947['enableReadOnlyMode']('model');}function _0x59092e(){return window['glob']&&window['glob']['triliumVersion'];}function _0x104e23(_0x3e5299){const _0x3befb0=_0x4b5dfa();_0x42d947[_0x3befb0]='slashCommandLicenseKey'+_0x3e5299,'Valid'!=_0x3e5299&&_0x53b42c();}function _0x4b5dfa(){const _0x13be32=window['String'](window['performance']['now']())['replace']('.','');let _0x55747b='u';for(let _0x52b129=0x0;_0x52b129<_0x13be32['length'];_0x52b129+=0x2){let _0x76c912=window['parseInt'](_0x13be32['substring'](_0x52b129,_0x52b129+0x2));_0x76c912>=0x3e&&(_0x76c912-=0x3e),_0x55747b+=_0x31e8f4[_0x76c912];}return _0x55747b;}function _0x3ed9f7(){const _0x4c673b=_0x230cd7['split']('.');if(0x3!=_0x4c673b['length'])return null;return _0x24da73(_0x4c673b[0x1]);function _0x24da73(_0x1b9d47){const _0x26716f=_0x1ea505(_0x1b9d47);return _0x26716f&&_0x2adf77()?_0x26716f:null;function _0x2adf77(){const _0x3416c5=_0x26716f['jti'],_0x2cfb22=window['parseInt'](_0x3416c5['substring'](_0x3416c5['length']-0x8),0x10),_0x1825b3={..._0x26716f,'jti':_0x3416c5['substring'](0x0,_0x3416c5['length']-0x8)};return delete _0x1825b3['vc'],_0x4e3c3c(_0x1825b3)==_0x2cfb22;}}}async function _0x5d0701(){let _0x32ba74=!0x0;try{const [_0x2c7e16,_0xab3789,_0x207170]=_0x230cd7['split']('.');return _0x4966cf(_0x2c7e16),await _0x3c5111(_0x2c7e16,_0xab3789,_0x207170),_0x32ba74;}catch{return!0x1;}function _0x4966cf(_0x31c7cd){const _0xda472=_0x1ea505(_0x31c7cd);_0xda472&&'ES256'==_0xda472['alg']||(_0x32ba74=!0x1);}async function _0x3c5111(_0x2d86da,_0x4f1070,_0x57832f){const _0x139b7d=window['Uint8Array']['from'](_0x18e03c(_0x57832f),_0x2fe001=>_0x2fe001['charCodeAt'](0x0)),_0x56f1d4=new window['TextEncoder']()['encode'](_0x2d86da+'.'+_0x4f1070),_0x4b241e=window['crypto']['subtle'];if(!_0x4b241e)return;const _0x536c97=await _0x4b241e['importKey']('jwk',_0x2fb4cf,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4b241e['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x536c97,_0x139b7d,_0x56f1d4)||(_0x32ba74=!0x1);}}function _0x1ea505(_0x4c2264){return _0x4c2264['startsWith']('ey')?JSON['parse'](_0x18e03c(_0x4c2264)):null;}function _0x18e03c(_0x4abf3a){return window['atob'](_0x4abf3a['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x4e3c3c(_0x20a45f){let _0x274113=0x1505;function _0xb16976(_0x462bb5){for(let _0x384054=0x0;_0x384054<_0x462bb5['length'];_0x384054++){const _0x35de29=_0x462bb5['charCodeAt'](_0x384054);_0x274113=(_0x274113<<0x5)+_0x274113+_0x35de29,_0x274113&=_0x274113;}}function _0x304300(_0x567662){Array['isArray'](_0x567662)?_0x567662['forEach'](_0x304300):_0x567662&&'object'==typeof _0x567662?Object['entries'](_0x567662)['sort']()['forEach'](([_0x2f83af,_0x3ac151])=>{_0xb16976(_0x2f83af),_0x304300(_0x3ac151);}):_0xb16976(window['String'](_0x567662));}return _0x304300(_0x20a45f),_0x274113>>>0x0;}function _0x58cb4e(_0x166128){return _0x166128['toString'](0x10)['padStart'](0x8,'0');}function _0x379de0(_0x519b19){return _0x519b19['split']('')['reverse']()['join']('');}function _0x1a1b3b(){}_0x104e23(await _0x398842());}(this);}['getAllowedCommands'](){return this['_allowedCommands'];}['getDefaultCommands'](){const _0x5b8a4a=_0x2897e6=>function(_0x102a60,_0x597c6a){const t=_0x102a60['t'],_0x38b359=_0x102a60['t'];switch(_0x597c6a){case'AI\x20Assistant':return _0x38b359('AI\x20Assistant');case'Block\x20quote':return _0x38b359('Block\x20quote');case'Bulleted\x20List':return _0x38b359('Bulleted\x20List');case'Insert\x20code\x20block':return _0x38b359('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x38b359('Open\x20file\x20manager');case'Insert\x20image':return _0x38b359('Insert\x20image');case'Heading\x201':return _0x38b359('Heading\x201');case'Heading\x202':return _0x38b359('Heading\x202');case'Heading\x203':return _0x38b359('Heading\x203');case'Heading\x204':return _0x38b359('Heading\x204');case'Heading\x205':return _0x38b359('Heading\x205');case'Heading\x206':return _0x38b359('Heading\x206');case'Horizontal\x20line':return _0x38b359('Horizontal\x20line');case'Insert\x20HTML':return _0x38b359('Insert\x20HTML');case'Increase\x20indent':return _0x38b359('Increase\x20indent');case'Insert\x20table':return _0x38b359('Insert\x20table');case'Table\x20of\x20contents':return _0x38b359('Table\x20of\x20contents');case'Numbered\x20List':return _0x38b359('Numbered\x20List');case'Decrease\x20indent':return _0x38b359('Decrease\x20indent');case'Paragraph':return _0x38b359('Paragraph');case'To-do\x20List':return _0x38b359('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 _0x597c6a;}}(this['editor']['locale'],_0x2897e6);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x2d951c,'title':_0x5b8a4a('AI\x20Assistant'),'description':_0x5b8a4a('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x454689=>{setTimeout(()=>_0x454689['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x4dd3db,'title':_0x5b8a4a('Block\x20quote'),'description':_0x5b8a4a('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x34a56d,'title':_0x5b8a4a('Bulleted\x20List'),'description':_0x5b8a4a('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x293872,'title':_0x5b8a4a('Insert\x20code\x20block'),'description':_0x5b8a4a('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x1ae631,'title':_0x5b8a4a('Open\x20file\x20manager'),'description':_0x5b8a4a('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x1ae631,'title':_0x5b8a4a('Insert\x20image'),'description':_0x5b8a4a('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x1cd2ed,'title':_0x5b8a4a('Emoji'),'description':_0x5b8a4a('Insert\x20an\x20emoji'),'execute':_0x4c8394=>{setTimeout(()=>_0x4c8394['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x642e32,'title':_0x5b8a4a('Heading\x201'),'description':_0x5b8a4a('Create\x20a\x20heading\x20level\x201'),'execute':_0x1f19c4=>{_0x1f19c4['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x3cc76c,'title':_0x5b8a4a('Heading\x202'),'description':_0x5b8a4a('Create\x20a\x20heading\x20level\x202'),'execute':_0x50b9e6=>{_0x50b9e6['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x505c65,'title':_0x5b8a4a('Heading\x203'),'description':_0x5b8a4a('Create\x20a\x20heading\x20level\x203'),'execute':_0x281979=>{_0x281979['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x48341c,'title':_0x5b8a4a('Heading\x204'),'description':_0x5b8a4a('Create\x20a\x20heading\x20level\x204'),'execute':_0x302f14=>{_0x302f14['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x58878e,'title':_0x5b8a4a('Heading\x205'),'description':_0x5b8a4a('Create\x20a\x20heading\x20level\x205'),'execute':_0x5583ad=>{_0x5583ad['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x53410d,'title':_0x5b8a4a('Heading\x206'),'description':_0x5b8a4a('Create\x20a\x20heading\x20level\x206'),'execute':_0x4cf373=>{_0x4cf373['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x2030ec,'title':_0x5b8a4a('Horizontal\x20line'),'description':_0x5b8a4a('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x78938d,'title':_0x5b8a4a('Insert\x20HTML'),'description':_0x5b8a4a('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x54d539,'title':_0x5b8a4a('Increase\x20indent'),'description':_0x5b8a4a('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x5b8a4a('Insert\x20Mermaid\x20diagram'),'description':_0x5b8a4a('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x33b964,'title':_0x5b8a4a('Insert\x20table'),'description':_0x5b8a4a('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x233e76,'title':_0x5b8a4a('Table\x20of\x20contents'),'description':_0x5b8a4a('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x4ee602,'title':_0x5b8a4a('Numbered\x20List'),'description':_0x5b8a4a('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x5af0f4,'title':_0x5b8a4a('Decrease\x20indent'),'description':_0x5b8a4a('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x1c2561,'title':_0x5b8a4a('Paragraph'),'description':_0x5b8a4a('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0xcc27e8,'title':_0x5b8a4a('To-do\x20List'),'description':_0x5b8a4a('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x471d67,'title':_0x5b8a4a('Footnote'),'description':_0x5b8a4a('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x4d1857){return _0x4d1857['isEnabled']?_0x4d1857['isEnabled'](this['editor']):!_0x4d1857['commandName']||this['editor']['commands']['get'](_0x4d1857['commandName'])['isEnabled'];}['_proxyExecute'](_0x21055c){if(_0x21055c['execute'])_0x21055c['execute'](this['editor']);else{if(!_0x21055c['commandName'])throw new _0x24216f('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x21055c});this['editor']['execute'](_0x21055c['commandName']);}}};function E(_0x3a24e3,_0x8b1c6f){return _0x3a24e3['title']<_0x8b1c6f['title']?-0x1:_0x3a24e3['title']>_0x8b1c6f['title']?0x1:0x0;}function P(_0x5cfee6,_0x5c476a){return _0x5c476a+'-'+_0x5cfee6['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x5abc92{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[O];}['getMatchingCommands'](_0x90c5f0){const _0x1fab39=_0x90c5f0&&_0x90c5f0['toLowerCase']();let _0xbd662e=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0xbd662e=_0xbd662e['filter'](_0x2fad79=>_0x2fad79['isEnabled']()),_0x1fab39){const _0x507377=[],_0x251982=[],_0x441cca=[],_0x2c45f7=[];for(const _0x1668a5 of _0xbd662e)_0x1668a5['id']['toLowerCase']()['includes'](_0x1fab39)?_0x507377['push'](_0x1668a5):_0x1668a5['title']['toLowerCase']()['includes'](_0x1fab39)?_0x251982['push'](_0x1668a5):_0x1668a5['aliases']&&_0x1668a5['aliases']['some'](_0x1019b9=>_0x1019b9['toLowerCase']()['includes'](_0x1fab39))?_0x441cca['push'](_0x1668a5):_0x1668a5['description']&&_0x1668a5['description']['toLowerCase']()['includes'](_0x1fab39)&&_0x2c45f7['push'](_0x1668a5);_0xbd662e=_0x507377['concat'](_0x251982,_0x441cca,_0x2c45f7);}return _0xbd662e;}},M=class extends _0x498f61{constructor(_0x31dae1,_0x8fc338){super(_0x31dae1),this['textPartView']=this['_createTextPartView'](_0x31dae1,_0x8fc338),void 0x0!==_0x8fc338['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x8fc338['isIconColorInherited']),this['set']({'icon':_0x8fc338['icon']||_0x2d6392,'withText':!0x0,'label':_0x8fc338['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}['_createTextPartView'](_0x5b76be,_0x2aea47){const _0x2a385d=new _0x5541cf(_0x5b76be);return _0x2a385d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x2aea47['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x2aea47['description']}]}]:[this['labelView']]}),_0x2a385d;}},S=class extends _0x5abc92{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x303b34){super(_0x303b34),this['_setupMentionConfiguration']();}['init'](){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2437e6=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4938a0;for(const _0x36accb in _0x2437e6){const _0x5f03b9=_0x36accb,_0x24bf48=_0x2437e6[_0x5f03b9];if('slashCommandLicenseKeyValid'==_0x24bf48||'slashCommandLicenseKeyInvalid'==_0x24bf48||'slashCommandLicenseKeyExpired'==_0x24bf48||'slashCommandLicenseKeyDomainLimit'==_0x24bf48||'slashCommandLicenseKeyNotAllowed'==_0x24bf48||'slashCommandLicenseKeyEvaluationLimit'==_0x24bf48||'slashCommandLicenseKeyUsageLimit'==_0x24bf48){delete _0x2437e6[_0x5f03b9],_0x4938a0=_0x24bf48,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x4938a0&&_0x2437e6['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x4938a0&&_0x2437e6['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x4938a0&&_0x2437e6['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x4938a0&&_0x2437e6['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x4938a0&&_0x2437e6['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x4938a0&&_0x2437e6['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_setupMentionConfiguration'](){const _0x70d9ac=this['editor'],_0x1c8e46=this['editor']['plugins']['get']('SlashCommandEditing'),_0x4a726a=_0x70d9ac['config']['get']('mention.feeds');_0x4a726a['push']({'marker':'/','feed':_0x1b12ad=>_0x1c8e46['getMatchingCommands'](_0x1b12ad),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x70d9ac['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x70d9ac['config']['set']('mention.feeds',_0x4a726a);}['_overrideMentionExecuteListener'](){const _0x249f21=this['editor'];_0x249f21['commands']['get']('mention')['on']('execute',(_0x2e02a0,_0x380f5a)=>{const _0x3c4039=_0x380f5a[0x0],_0x5f50e8=_0x249f21['model'];'/'===_0x3c4039['marker']&&_0x5f50e8['change'](_0x482ba4=>{_0x482ba4['remove'](_0x3c4039['range']),_0x3c4039['mention']['execute'](),_0x2e02a0['stop']();});},{'priority':'high'});}['_customItemRenderer'](_0x394afd){const _0x442def=this['editor']['locale'],_0x3a9f03=new M(_0x442def,_0x394afd);return _0x3a9f03['render'](),_0x3a9f03['element'];}},D=class extends _0x5abc92{static get['requires'](){return[_0x463592,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 _0x5d37ef}from'@ckeditor/ckeditor5-core';import{Mention as _0x445721}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x1024da,uid as _0x49f517}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x5406f8,IconBulletedList as _0xf2684a,IconCodeBlock as _0x248464,IconEmoji as _0x463b6e,IconFootnote as _0x3ea027,IconHeading1 as _0x361c64,IconHeading2 as _0x12f8b9,IconHeading3 as _0x55686d,IconHeading4 as _0xc544f,IconHeading5 as _0x4abf76,IconHeading6 as _0x6cb51c,IconHorizontalLine as _0x2218e9,IconHtml as _0x31acd6,IconIndent as _0x50a356,IconNumberedList as _0x50a1f1,IconOutdent as _0x572f4d,IconParagraph as _0x1f0edb,IconPlay as _0xc3a532,IconQuote as _0x7b3cf9,IconRobotPencil as _0x559a62,IconTable as _0x4a5cff,IconTableOfContents as _0x57ef8b,IconTodoList as _0x197f5d}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x2f13d7,View as _0x4bfb0a}from'@ckeditor/ckeditor5-ui';var O=class extends _0x5d37ef{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x264b1e){super(_0x264b1e),this['_allowedCommands']=null;}['afterInit'](){const _0x49f6da=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x3b5b31=function(_0x48693b){let _0x397ce2=['heading4','heading5','heading6'];if(_0x48693b){const _0x5dac55=_0x48693b['map'](_0x18d550=>_0x18d550['model']);_0x397ce2=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x23f65a=>!_0x5dac55['includes'](_0x23f65a));}return _0x397ce2;}(this['editor']['config']['get']('heading.options'));let _0x5828f8=this['getDefaultCommands']()['filter'](_0x21cee1=>!_0x3b5b31['includes'](_0x21cee1['id']))['filter'](_0x4c53b0=>!_0x49f6da['includes'](_0x4c53b0['commandName']));const _0x3facd3=this['editor']['config']['get']('slashCommand.extraCommands');_0x3facd3&&_0x3facd3['length']&&(_0x5828f8=_0x5828f8['concat'](_0x3facd3));const _0x5da76b=this['editor']['config']['get']('template.definitions');_0x5da76b&&_0x5da76b['length']&&(_0x5828f8=_0x5828f8['concat'](function(_0x5ccc37){return _0x5ccc37['map'](_0x1afafa=>{const {title:_0x5b30b5,icon:_0x199649,description:_0x183276,data:_0x3e93b1}=_0x1afafa,_0x312bc2={'id':P(_0x5b30b5,'template'),'commandName':'insertTemplate','execute':_0x3d0d81=>{_0x3d0d81['execute']('insertTemplate',_0x3e93b1);},'description':_0x183276,'icon':_0x199649,'title':_0x5b30b5};return _0x199649&&(_0x312bc2['isIconColorInherited']=!0x1),_0x312bc2;});}(_0x5da76b)));const _0x383b09=this['editor']['config']['get']('style.definitions');_0x383b09&&_0x383b09['length']&&(_0x5828f8=_0x5828f8['concat'](function(_0x5c224d){return _0x5c224d['map'](_0x49aa98=>({'id':P(_0x49aa98['name'],'style'),'commandName':'style','execute':_0x1dac57=>{_0x1dac57['execute']('style',{'styleName':_0x49aa98['name']});},'isEnabled':_0x35c6a8=>{const _0x4358ef=_0x35c6a8['commands']['get']('style');return _0x4358ef['isEnabled']&&_0x4358ef['enabledStyles']['includes'](_0x49aa98['name']);},'title':_0x49aa98['name']}));}(_0x383b09)));const _0x3dab68=_0x5828f8['filter'](_0xdf17e6=>!_0xdf17e6['commandName']||void 0x0!==this['editor']['commands']['get'](_0xdf17e6['commandName'])),_0x1fe43d=[];for(const _0xbf0250 of _0x3dab68)_0x1fe43d['push']({'id':_0xbf0250['id'],'commandName':_0xbf0250['commandName'],'title':'function'==typeof _0xbf0250['title']?_0xbf0250['title'](this['editor']):_0xbf0250['title'],'description':_0xbf0250['description'],'icon':_0xbf0250['icon'],'isIconColorInherited':_0xbf0250['isIconColorInherited'],'aliases':_0xbf0250['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0xbf0250),'execute':()=>this['_proxyExecute'](_0xbf0250)});this['_allowedCommands']=_0x1fe43d['sort'](E),async function(_0x3eb51f){const _0x467d25='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x928c8b=0x78e58,_0x6f3170=window['Date']['now'](),_0x6ffc8=_0x3eb51f['editor'],_0x2cb632=new window['Promise'](_0x5e0928=>{_0x6ffc8['once']('ready',_0x5e0928);}),_0x429171={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0xb02902=_0x6ffc8['config']['get']('licenseKey');async function _0x475b83(){let _0x1cbc87,_0x1ee595=null,_0x11b4b5=null;try{return'GPL'==_0xb02902?'NotAllowed':(_0x1cbc87=_0xae8d42(),_0x1cbc87?(_0x1cbc87['usageEndpoint']&&(_0x11b4b5=_0x1ba777(_0x1cbc87['usageEndpoint'],_0x1cbc87['jti'])),await _0x49a043()?_0x3721ed()?_0x2a1194()?'Expired':_0x30747e()?('evaluation'==_0x1cbc87['licenseType']&&(_0x1ee595=_0x51e22e('EvaluationLimit')),await _0xb60e61()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2a1194(){const _0x273f52=['evaluation','trial']['includes'](_0x1cbc87['licenseType'])?_0x6f3170/0x3e8:0xe10*_0x928c8b;return _0x1cbc87['exp']<_0x273f52;}function _0x3721ed(){const _0x28e503=_0x1cbc87['features'];return!!_0x28e503&&(!!_0x28e503['includes']('*')||(!!_0x28e503['includes']('SC')||(!!_0x28e503['includes']('PP')||!(!_0x28e503['includes']('TRILIUM')||!_0x3e53c9()))));}function _0x30747e(){const _0x2753f7=_0x1cbc87['licensedHosts'];if(!_0x2753f7||0x0==_0x2753f7['length'])return!0x0;const {hostname:_0x24fbdb}=new URL(window['location']['href']);if(_0x2753f7['includes'](_0x24fbdb))return!0x0;const _0x27cd5d=_0x24fbdb['split']('.');return _0x2753f7['filter'](_0x46dd4a=>_0x46dd4a['includes']('*'))['map'](_0x2771ba=>_0x2771ba['split']('.'))['filter'](_0x292f7d=>_0x292f7d['length']<=_0x27cd5d['length'])['map'](_0x40dba3=>Array(_0x27cd5d['length']-_0x40dba3['length'])['fill']('*'===_0x40dba3[0x0]?'*':'')['concat'](_0x40dba3))['some'](_0x3108f2=>_0x27cd5d['every']((_0x4cbe23,_0xd58f9b)=>_0x3108f2[_0xd58f9b]===_0x4cbe23||'*'===_0x3108f2[_0xd58f9b]));}function _0xb60e61(){return _0x1ee595&&_0x11b4b5?new window['Promise']((_0x60f4be,_0x2747fd)=>{_0x1ee595['then'](_0x60f4be,_0x2747fd),_0x11b4b5['then'](_0x31a3af=>{'Valid'!=_0x31a3af&&_0x60f4be(_0x31a3af);},_0x2747fd);}):_0x1ee595||_0x11b4b5||'Valid';}}function _0x1ba777(_0x47ce21,_0x4bf7e5){return new window['Promise'](_0x185ebe=>{if(_0x74528f())return _0x185ebe('Valid');_0x1e99f9(),_0x6ffc8['decorate']('_sendUsageRequest');let _0x754918=!0x1;const _0x336c3d=_0x49f517();function _0x1b72eb(_0x213596){return!!_0x213596&&('object'==typeof _0x213596||'function'==typeof _0x213596)&&'function'==typeof _0x213596['then']&&'function'==typeof _0x213596['catch'];}function _0x3dc0ef(_0x43a673){_0x299d5e(_0x43a673)['then'](_0x148b36=>_0x148b36&&'ok'==_0x148b36['status']?_0x4def54(_0x3ac162(_0x336c3d+_0x4bf7e5))!=_0x148b36['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3238c5=>(_0x27525f(),_0x3238c5),()=>{const _0x5d827e=_0x7c7eea();return null==_0x5d827e?(_0x27525f(),'Valid'):_0x6f3170-_0x5d827e>0x240c8400?'UsageLimit':'Valid';})['then'](_0x185ebe)['catch'](()=>{_0x185ebe('UsageLimit');});const _0x1d9b39=0x36ee80;function _0x27525f(){const _0x5cdc01='llct-'+_0x4def54(_0x3ac162(_0x47ce21)),_0x44423d=_0x3c8c83(_0x4def54(window['Math']['ceil'](_0x6f3170/_0x1d9b39)));window['localStorage']['setItem'](_0x5cdc01,_0x44423d);}function _0x7c7eea(){const _0x24b11c='llct-'+_0x4def54(_0x3ac162(_0x47ce21)),_0x504362=window['localStorage']['getItem'](_0x24b11c);return _0x504362?window['parseInt'](_0x3c8c83(_0x504362),0x10)*_0x1d9b39:null;}function _0x299d5e(_0xbfa8b3){return new window['Promise']((_0x20a31d,_0x30bb5a)=>{_0xbfa8b3['then'](_0x20a31d,_0x30bb5a),window['setTimeout'](_0x30bb5a,0x1d4c0);});}}_0x6ffc8['on']('_sendUsageRequest',(_0x88e6fa,_0x5bcdb9)=>{if(_0x5bcdb9[0x0]!=_0x47ce21)return _0x185ebe('UsageLimit');_0x5bcdb9[0x1]={..._0x5bcdb9[0x1],'requestId':_0x336c3d};},{'priority':'high'}),_0x6ffc8['on']('_sendUsageRequest',_0xe7ad7a=>{_0x1b72eb(_0xe7ad7a['return'])&&(_0x754918=!0x0,_0x3dc0ef(_0xe7ad7a['return']));},{'priority':'low'}),_0x2cb632['then'](()=>{_0x754918||_0x185ebe('UsageLimit');});});function _0x74528f(){return'auto'==_0x6ffc8['editing']['view']['_overlayModeHint'];}function _0x1e99f9(){_0x6ffc8['editing']['view']['_overlayModeHint']='auto';}}function _0x51e22e(_0x237b19){const _0x62c47f=[new window['Promise'](_0x3723e4=>setTimeout(_0x3723e4,0x93ecc)),_0x2cb632['then'](()=>new window['Promise'](_0x511764=>{let _0x2609cc=0x0;_0x6ffc8['model']['on']('applyOperation',(_0x48bc4a,_0x440cac)=>{_0x440cac[0x0]['isDocumentOperation']&&_0x2609cc++,0x5e8==_0x2609cc&&(_0x511764(),_0x48bc4a['off']());});}))];return window['Promise']['race'](_0x62c47f)['then'](()=>_0x237b19);}async function _0x23460c(){await _0x2cb632,_0x6ffc8['model']['change']=_0x5b8a03,_0x6ffc8['model']['enqueueChange']=_0x5b8a03,_0x6ffc8['enableReadOnlyMode']('model');}function _0x3e53c9(){return window['glob']&&window['glob']['triliumVersion'];}function _0x5c89cc(_0x1eabd0){const _0x408b1a=_0x186c5c();_0x6ffc8[_0x408b1a]='slashCommandLicenseKey'+_0x1eabd0,'Valid'!=_0x1eabd0&&_0x23460c();}function _0x186c5c(){const _0x52ce3f=window['String'](window['performance']['now']())['replace']('.','');let _0x5e5f57='u';for(let _0x3333f=0x0;_0x3333f<_0x52ce3f['length'];_0x3333f+=0x2){let _0xfa821c=window['parseInt'](_0x52ce3f['substring'](_0x3333f,_0x3333f+0x2));_0xfa821c>=0x3e&&(_0xfa821c-=0x3e),_0x5e5f57+=_0x467d25[_0xfa821c];}return _0x5e5f57;}function _0xae8d42(){const _0x376ae5=_0xb02902['split']('.');if(0x3!=_0x376ae5['length'])return null;return _0x1011b3(_0x376ae5[0x1]);function _0x1011b3(_0x1488fa){const _0x87f869=_0x29fab3(_0x1488fa);return _0x87f869&&_0x31a438()?_0x87f869:null;function _0x31a438(){const _0x40146e=_0x87f869['jti'],_0x3b5c72=window['parseInt'](_0x40146e['substring'](_0x40146e['length']-0x8),0x10),_0x410d07={..._0x87f869,'jti':_0x40146e['substring'](0x0,_0x40146e['length']-0x8)};return delete _0x410d07['vc'],_0x3ac162(_0x410d07)==_0x3b5c72;}}}async function _0x49a043(){let _0x19b7d6=!0x0;try{const [_0x5544fd,_0x3a710c,_0x20f821]=_0xb02902['split']('.');return _0x324b7b(_0x5544fd),await _0x158005(_0x5544fd,_0x3a710c,_0x20f821),_0x19b7d6;}catch{return!0x1;}function _0x324b7b(_0x91eef2){const _0x1141c7=_0x29fab3(_0x91eef2);_0x1141c7&&'ES256'==_0x1141c7['alg']||(_0x19b7d6=!0x1);}async function _0x158005(_0x193027,_0x386097,_0x40335f){const _0x2f5282=window['Uint8Array']['from'](_0x5c741e(_0x40335f),_0x440e59=>_0x440e59['charCodeAt'](0x0)),_0x21f5b0=new window['TextEncoder']()['encode'](_0x193027+'.'+_0x386097),_0x42012c=window['crypto']['subtle'];if(!_0x42012c)return;const _0x39c5f1=await _0x42012c['importKey']('jwk',_0x429171,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x42012c['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x39c5f1,_0x2f5282,_0x21f5b0)||(_0x19b7d6=!0x1);}}function _0x29fab3(_0x3e4f1c){return _0x3e4f1c['startsWith']('ey')?JSON['parse'](_0x5c741e(_0x3e4f1c)):null;}function _0x5c741e(_0x3023cf){return window['atob'](_0x3023cf['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3ac162(_0x5109aa){let _0x9e6f98=0x1505;function _0x5086d6(_0x3b638f){for(let _0x4ca40a=0x0;_0x4ca40a<_0x3b638f['length'];_0x4ca40a++){const _0x4c9059=_0x3b638f['charCodeAt'](_0x4ca40a);_0x9e6f98=(_0x9e6f98<<0x5)+_0x9e6f98+_0x4c9059,_0x9e6f98&=_0x9e6f98;}}function _0x21ee9a(_0xb37dea){Array['isArray'](_0xb37dea)?_0xb37dea['forEach'](_0x21ee9a):_0xb37dea&&'object'==typeof _0xb37dea?Object['entries'](_0xb37dea)['sort']()['forEach'](([_0x28d7ea,_0x2c057e])=>{_0x5086d6(_0x28d7ea),_0x21ee9a(_0x2c057e);}):_0x5086d6(window['String'](_0xb37dea));}return _0x21ee9a(_0x5109aa),_0x9e6f98>>>0x0;}function _0x4def54(_0x5e4ece){return _0x5e4ece['toString'](0x10)['padStart'](0x8,'0');}function _0x3c8c83(_0x2306c5){return _0x2306c5['split']('')['reverse']()['join']('');}function _0x5b8a03(){}_0x5c89cc(await _0x475b83());}(this);}['getAllowedCommands'](){return this['_allowedCommands'];}['getDefaultCommands'](){const _0x589d41=_0x1882f4=>function(_0x53f9b2,_0x56d7f3){const t=_0x53f9b2['t'],_0x1b0582=_0x53f9b2['t'];switch(_0x56d7f3){case'AI\x20Assistant':return _0x1b0582('AI\x20Assistant');case'Block\x20quote':return _0x1b0582('Block\x20quote');case'Bulleted\x20List':return _0x1b0582('Bulleted\x20List');case'Insert\x20code\x20block':return _0x1b0582('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x1b0582('Open\x20file\x20manager');case'Insert\x20image':return _0x1b0582('Insert\x20image');case'Heading\x201':return _0x1b0582('Heading\x201');case'Heading\x202':return _0x1b0582('Heading\x202');case'Heading\x203':return _0x1b0582('Heading\x203');case'Heading\x204':return _0x1b0582('Heading\x204');case'Heading\x205':return _0x1b0582('Heading\x205');case'Heading\x206':return _0x1b0582('Heading\x206');case'Horizontal\x20line':return _0x1b0582('Horizontal\x20line');case'Insert\x20HTML':return _0x1b0582('Insert\x20HTML');case'Increase\x20indent':return _0x1b0582('Increase\x20indent');case'Insert\x20table':return _0x1b0582('Insert\x20table');case'Table\x20of\x20contents':return _0x1b0582('Table\x20of\x20contents');case'Numbered\x20List':return _0x1b0582('Numbered\x20List');case'Decrease\x20indent':return _0x1b0582('Decrease\x20indent');case'Paragraph':return _0x1b0582('Paragraph');case'To-do\x20List':return _0x1b0582('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 _0x56d7f3;}}(this['editor']['locale'],_0x1882f4);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x559a62,'title':_0x589d41('AI\x20Assistant'),'description':_0x589d41('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x48ad3f=>{setTimeout(()=>_0x48ad3f['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x7b3cf9,'title':_0x589d41('Block\x20quote'),'description':_0x589d41('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0xf2684a,'title':_0x589d41('Bulleted\x20List'),'description':_0x589d41('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x248464,'title':_0x589d41('Insert\x20code\x20block'),'description':_0x589d41('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x5406f8,'title':_0x589d41('Open\x20file\x20manager'),'description':_0x589d41('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x5406f8,'title':_0x589d41('Insert\x20image'),'description':_0x589d41('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x463b6e,'title':_0x589d41('Emoji'),'description':_0x589d41('Insert\x20an\x20emoji'),'execute':_0x5ac7df=>{setTimeout(()=>_0x5ac7df['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x361c64,'title':_0x589d41('Heading\x201'),'description':_0x589d41('Create\x20a\x20heading\x20level\x201'),'execute':_0x71f490=>{_0x71f490['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x12f8b9,'title':_0x589d41('Heading\x202'),'description':_0x589d41('Create\x20a\x20heading\x20level\x202'),'execute':_0x4b8c3f=>{_0x4b8c3f['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x55686d,'title':_0x589d41('Heading\x203'),'description':_0x589d41('Create\x20a\x20heading\x20level\x203'),'execute':_0x57bfea=>{_0x57bfea['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0xc544f,'title':_0x589d41('Heading\x204'),'description':_0x589d41('Create\x20a\x20heading\x20level\x204'),'execute':_0x77b42e=>{_0x77b42e['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x4abf76,'title':_0x589d41('Heading\x205'),'description':_0x589d41('Create\x20a\x20heading\x20level\x205'),'execute':_0x6003c8=>{_0x6003c8['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x6cb51c,'title':_0x589d41('Heading\x206'),'description':_0x589d41('Create\x20a\x20heading\x20level\x206'),'execute':_0x2348f8=>{_0x2348f8['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x2218e9,'title':_0x589d41('Horizontal\x20line'),'description':_0x589d41('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x31acd6,'title':_0x589d41('Insert\x20HTML'),'description':_0x589d41('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x50a356,'title':_0x589d41('Increase\x20indent'),'description':_0x589d41('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x589d41('Insert\x20Mermaid\x20diagram'),'description':_0x589d41('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x4a5cff,'title':_0x589d41('Insert\x20table'),'description':_0x589d41('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x57ef8b,'title':_0x589d41('Table\x20of\x20contents'),'description':_0x589d41('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x50a1f1,'title':_0x589d41('Numbered\x20List'),'description':_0x589d41('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x572f4d,'title':_0x589d41('Decrease\x20indent'),'description':_0x589d41('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x1f0edb,'title':_0x589d41('Paragraph'),'description':_0x589d41('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x197f5d,'title':_0x589d41('To-do\x20List'),'description':_0x589d41('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x3ea027,'title':_0x589d41('Footnote'),'description':_0x589d41('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x40126e){return _0x40126e['isEnabled']?_0x40126e['isEnabled'](this['editor']):!_0x40126e['commandName']||this['editor']['commands']['get'](_0x40126e['commandName'])['isEnabled'];}['_proxyExecute'](_0x14ad81){if(_0x14ad81['execute'])_0x14ad81['execute'](this['editor']);else{if(!_0x14ad81['commandName'])throw new _0x1024da('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x14ad81});this['editor']['execute'](_0x14ad81['commandName']);}}};function E(_0x5818be,_0x2a7026){return _0x5818be['title']<_0x2a7026['title']?-0x1:_0x5818be['title']>_0x2a7026['title']?0x1:0x0;}function P(_0x493755,_0x217877){return _0x217877+'-'+_0x493755['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x5d37ef{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[O];}['getMatchingCommands'](_0x4654b8){const _0x379978=_0x4654b8&&_0x4654b8['toLowerCase']();let _0xd2b6be=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0xd2b6be=_0xd2b6be['filter'](_0x2a7f59=>_0x2a7f59['isEnabled']()),_0x379978){const _0x4224d3=[],_0x58f729=[],_0x488281=[],_0x13178e=[];for(const _0x36bb47 of _0xd2b6be)_0x36bb47['id']['toLowerCase']()['includes'](_0x379978)?_0x4224d3['push'](_0x36bb47):_0x36bb47['title']['toLowerCase']()['includes'](_0x379978)?_0x58f729['push'](_0x36bb47):_0x36bb47['aliases']&&_0x36bb47['aliases']['some'](_0x411992=>_0x411992['toLowerCase']()['includes'](_0x379978))?_0x488281['push'](_0x36bb47):_0x36bb47['description']&&_0x36bb47['description']['toLowerCase']()['includes'](_0x379978)&&_0x13178e['push'](_0x36bb47);_0xd2b6be=_0x4224d3['concat'](_0x58f729,_0x488281,_0x13178e);}return _0xd2b6be;}},M=class extends _0x2f13d7{constructor(_0x15a084,_0x1aeb8c){super(_0x15a084),this['textPartView']=this['_createTextPartView'](_0x15a084,_0x1aeb8c),void 0x0!==_0x1aeb8c['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x1aeb8c['isIconColorInherited']),this['set']({'icon':_0x1aeb8c['icon']||_0xc3a532,'withText':!0x0,'label':_0x1aeb8c['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}['_createTextPartView'](_0x560d1e,_0x591b54){const _0x47f9b0=new _0x4bfb0a(_0x560d1e);return _0x47f9b0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x591b54['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x591b54['description']}]}]:[this['labelView']]}),_0x47f9b0;}},S=class extends _0x5d37ef{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b7117){super(_0x5b7117),this['_setupMentionConfiguration']();}['init'](){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3058b0=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1c6b04;for(const _0x8aa3d9 in _0x3058b0){const _0x59e0d1=_0x8aa3d9,_0x4dfd7c=_0x3058b0[_0x59e0d1];if('slashCommandLicenseKeyValid'==_0x4dfd7c||'slashCommandLicenseKeyInvalid'==_0x4dfd7c||'slashCommandLicenseKeyExpired'==_0x4dfd7c||'slashCommandLicenseKeyDomainLimit'==_0x4dfd7c||'slashCommandLicenseKeyNotAllowed'==_0x4dfd7c||'slashCommandLicenseKeyEvaluationLimit'==_0x4dfd7c||'slashCommandLicenseKeyUsageLimit'==_0x4dfd7c){delete _0x3058b0[_0x59e0d1],_0x1c6b04=_0x4dfd7c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x1c6b04&&_0x3058b0['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x1c6b04&&_0x3058b0['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x1c6b04&&_0x3058b0['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x1c6b04&&_0x3058b0['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x1c6b04&&_0x3058b0['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x1c6b04&&_0x3058b0['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_setupMentionConfiguration'](){const _0x26ddd5=this['editor'],_0x39a81b=this['editor']['plugins']['get']('SlashCommandEditing'),_0x5cfd6b=_0x26ddd5['config']['get']('mention.feeds');_0x5cfd6b['push']({'marker':'/','feed':_0x3a21ab=>_0x39a81b['getMatchingCommands'](_0x3a21ab),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x26ddd5['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x26ddd5['config']['set']('mention.feeds',_0x5cfd6b);}['_overrideMentionExecuteListener'](){const _0x55cf3d=this['editor'];_0x55cf3d['commands']['get']('mention')['on']('execute',(_0x2d9705,_0x32b43c)=>{const _0x3ab832=_0x32b43c[0x0],_0x5e3fe0=_0x55cf3d['model'];'/'===_0x3ab832['marker']&&_0x5e3fe0['change'](_0x1e7e10=>{_0x1e7e10['remove'](_0x3ab832['range']),_0x3ab832['mention']['execute'](),_0x2d9705['stop']();});},{'priority':'high'});}['_customItemRenderer'](_0x1b422e){const _0x2d091e=this['editor']['locale'],_0x473fb3=new M(_0x2d091e,_0x1b422e);return _0x473fb3['render'](),_0x473fb3['element'];}},D=class extends _0x5d37ef{static get['requires'](){return[_0x445721,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.3.0-alpha.
|
|
3
|
+
"version": "48.3.0-alpha.6",
|
|
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.3.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-heading": "48.3.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-mention": "48.3.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-style": "48.3.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-template": "48.3.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.3.0-alpha.6",
|
|
25
|
+
"@ckeditor/ckeditor5-heading": "48.3.0-alpha.6",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.3.0-alpha.6",
|
|
27
|
+
"@ckeditor/ckeditor5-mention": "48.3.0-alpha.6",
|
|
28
|
+
"@ckeditor/ckeditor5-style": "48.3.0-alpha.6",
|
|
29
|
+
"@ckeditor/ckeditor5-template": "48.3.0-alpha.6",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "48.3.0-alpha.6",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "48.3.0-alpha.6"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|