@ckeditor/ckeditor5-slash-command 48.4.0-alpha.3 → 48.4.0-alpha.4
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 _0xb3e9b}from'@ckeditor/ckeditor5-core';import{Mention as _0x31ef0b}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x58dbc6,uid as _0x51c197}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x3107ea,IconBulletedList as _0x1dd5ad,IconCodeBlock as _0xbe0339,IconEmoji as _0x6616ea,IconFootnote as _0x57faaa,IconHeading1 as _0x4a9312,IconHeading2 as _0x5aeeca,IconHeading3 as _0x28ca2f,IconHeading4 as _0x33cbd5,IconHeading5 as _0x384ea,IconHeading6 as _0x4424f8,IconHorizontalLine as _0x6829fb,IconHtml as _0x55173c,IconIndent as _0x643288,IconNumberedList as _0x5513b3,IconOutdent as _0x415888,IconParagraph as _0x5b0684,IconPlay as _0x4c8ee6,IconQuote as _0x26dec8,IconRobotPencil as _0x5970df,IconTable as _0x296ae0,IconTableOfContents as _0x4fd905,IconTodoList as _0x756b39}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x3c3363,View as _0x509a25}from'@ckeditor/ckeditor5-ui';var O=class extends _0xb3e9b{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x29b97e){super(_0x29b97e),this['_allowedCommands']=null;}afterInit(){const _0x1aef7c=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x1b2d64=function(_0x57185e){let _0xf2d3a9=['heading4','heading5','heading6'];if(_0x57185e){const _0x38557d=_0x57185e['map'](_0x2457f2=>_0x2457f2['model']);_0xf2d3a9=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x76dfb3=>!_0x38557d['includes'](_0x76dfb3));}return _0xf2d3a9;}(this['editor']['config']['get']('heading.options'));let _0x33005f=this['getDefaultCommands']()['filter'](_0x564c5f=>!_0x1b2d64['includes'](_0x564c5f['id']))['filter'](_0x569919=>!_0x1aef7c['includes'](_0x569919['commandName']));const _0x31140f=this['editor']['config']['get']('slashCommand.extraCommands');_0x31140f&&_0x31140f['length']&&(_0x33005f=_0x33005f['concat'](_0x31140f));const _0x2b36d9=this['editor']['config']['get']('template.definitions');_0x2b36d9&&_0x2b36d9['length']&&(_0x33005f=_0x33005f['concat'](function(_0x584f34){return _0x584f34['map'](_0x443872=>{const {title:_0x4990d8,icon:_0x561e36,description:_0x197949,data:_0x5463c9}=_0x443872,_0x272237={'id':P(_0x4990d8,'template'),'commandName':'insertTemplate','execute':_0x534147=>{_0x534147['execute']('insertTemplate',_0x5463c9);},'description':_0x197949,'icon':_0x561e36,'title':_0x4990d8};return _0x561e36&&(_0x272237['isIconColorInherited']=!0x1),_0x272237;});}(_0x2b36d9)));const _0x3fb026=this['editor']['config']['get']('style.definitions');_0x3fb026&&_0x3fb026['length']&&(_0x33005f=_0x33005f['concat'](function(_0x5de8f9){return _0x5de8f9['map'](_0x2f8084=>({'id':P(_0x2f8084['name'],'style'),'commandName':'style','execute':_0x527477=>{_0x527477['execute']('style',{'styleName':_0x2f8084['name']});},'isEnabled':_0x5d3bb7=>{const _0x5d6caf=_0x5d3bb7['commands']['get']('style');return _0x5d6caf['isEnabled']&&_0x5d6caf['enabledStyles']['includes'](_0x2f8084['name']);},'title':_0x2f8084['name']}));}(_0x3fb026)));const _0x300f94=_0x33005f['filter'](_0x5aed5f=>!_0x5aed5f['commandName']||void 0x0!==this['editor']['commands']['get'](_0x5aed5f['commandName'])),_0x21ad7b=[];for(const _0x27b397 of _0x300f94)_0x21ad7b['push']({'id':_0x27b397['id'],'commandName':_0x27b397['commandName'],'title':'function'==typeof _0x27b397['title']?_0x27b397['title'](this['editor']):_0x27b397['title'],'description':_0x27b397['description'],'icon':_0x27b397['icon'],'isIconColorInherited':_0x27b397['isIconColorInherited'],'aliases':_0x27b397['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x27b397),'execute':()=>this['_proxyExecute'](_0x27b397)});this['_allowedCommands']=_0x21ad7b['sort'](E),async function(_0x245631){const _0xc0528a='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x31bc3e=0x79170,_0x45ebd5=window['Date']['now'](),_0x14c202=_0x245631['editor'],_0x1cd27b=new window['Promise'](_0x2110d8=>{_0x14c202['once']('ready',_0x2110d8);}),_0x357fec={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x54088c=_0x14c202['config']['get']('licenseKey');async function _0x5cef00(){let _0x33dbec,_0x2f11ca=null,_0x831e0=null;try{return'GPL'==_0x54088c?'NotAllowed':(_0x33dbec=_0x59a887(),_0x33dbec?(_0x33dbec['usageEndpoint']&&(_0x831e0=_0x126c06(_0x33dbec['usageEndpoint'],_0x33dbec['jti'])),await _0xb9a506()?_0x17efda()?_0x775edb()?'Expired':_0xd374c5()?('evaluation'==_0x33dbec['licenseType']&&(_0x2f11ca=_0xb46b8('EvaluationLimit')),await _0x59fb7d()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x775edb(){const _0x38804c=['evaluation','trial']['includes'](_0x33dbec['licenseType'])?_0x45ebd5/0x3e8:0xe10*_0x31bc3e;return _0x33dbec['exp']<_0x38804c;}function _0x17efda(){const _0x44c59e=_0x33dbec['features'];return!!_0x44c59e&&(!!_0x44c59e['includes']('*')||(!!_0x44c59e['includes']('SC')||(!!_0x44c59e['includes']('PP')||!(!_0x44c59e['includes']('TRILIUM')||!_0x7a9ffe()))));}function _0xd374c5(){const _0x425bd2=_0x33dbec['licensedHosts'];if(!_0x425bd2||0x0==_0x425bd2['length'])return!0x0;const {hostname:_0x8384c3}=new URL(window['location']['href']);if(_0x425bd2['includes'](_0x8384c3))return!0x0;const _0x48fcdf=_0x8384c3['split']('.');return _0x425bd2['filter'](_0x59417f=>_0x59417f['includes']('*'))['map'](_0x91d2ea=>_0x91d2ea['split']('.'))['filter'](_0x32b308=>_0x32b308['length']<=_0x48fcdf['length'])['map'](_0x2e9ff0=>Array(_0x48fcdf['length']-_0x2e9ff0['length'])['fill']('*'===_0x2e9ff0[0x0]?'*':'')['concat'](_0x2e9ff0))['some'](_0x2ba014=>_0x48fcdf['every']((_0x5c2c7a,_0x3c791e)=>_0x2ba014[_0x3c791e]===_0x5c2c7a||'*'===_0x2ba014[_0x3c791e]));}function _0x59fb7d(){return _0x2f11ca&&_0x831e0?new window['Promise']((_0x3ae6ec,_0x2a9f37)=>{_0x2f11ca['then'](_0x3ae6ec,_0x2a9f37),_0x831e0['then'](_0x4507c1=>{'Valid'!=_0x4507c1&&_0x3ae6ec(_0x4507c1);},_0x2a9f37);}):_0x2f11ca||_0x831e0||'Valid';}}function _0x126c06(_0x56d3da,_0x41b88c){return new window['Promise'](_0x1021d0=>{if(_0x27097e())return _0x1021d0('Valid');_0x553546(),_0x14c202['decorate']('_sendUsageRequest');let _0x1fd602=!0x1;const _0x4b4927=_0x51c197();function _0x118a3d(_0x3c0d30){return!!_0x3c0d30&&('object'==typeof _0x3c0d30||'function'==typeof _0x3c0d30)&&'function'==typeof _0x3c0d30['then']&&'function'==typeof _0x3c0d30['catch'];}function _0x223d51(_0x2d4cce){_0x433267(_0x2d4cce)['then'](_0x3f9e7d=>_0x3f9e7d&&'ok'==_0x3f9e7d['status']?_0x588b18(_0x1f0e77(_0x4b4927+_0x41b88c))!=_0x3f9e7d['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2a0186=>(_0x2f81d8(),_0x2a0186),()=>{const _0x557a7d=_0x59fd72();return null==_0x557a7d?(_0x2f81d8(),'Valid'):_0x45ebd5-_0x557a7d>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1021d0)['catch'](()=>{_0x1021d0('UsageLimit');});const _0x336223=0x36ee80;function _0x2f81d8(){const _0x112470='llct-'+_0x588b18(_0x1f0e77(_0x56d3da)),_0x524086=_0x4bbae3(_0x588b18(window['Math']['ceil'](_0x45ebd5/_0x336223)));window['localStorage']['setItem'](_0x112470,_0x524086);}function _0x59fd72(){const _0x18d676='llct-'+_0x588b18(_0x1f0e77(_0x56d3da)),_0x53b2d4=window['localStorage']['getItem'](_0x18d676);return _0x53b2d4?window['parseInt'](_0x4bbae3(_0x53b2d4),0x10)*_0x336223:null;}function _0x433267(_0x464fb8){return new window['Promise']((_0x2fdf88,_0x1d84e5)=>{_0x464fb8['then'](_0x2fdf88,_0x1d84e5),window['setTimeout'](_0x1d84e5,0x1d4c0);});}}_0x14c202['on']('_sendUsageRequest',(_0x5f33aa,_0x210924)=>{if(_0x210924[0x0]!=_0x56d3da)return _0x1021d0('UsageLimit');_0x210924[0x1]={..._0x210924[0x1],'requestId':_0x4b4927};},{'priority':'high'}),_0x14c202['on']('_sendUsageRequest',_0xdd79a9=>{_0x118a3d(_0xdd79a9['return'])&&(_0x1fd602=!0x0,_0x223d51(_0xdd79a9['return']));},{'priority':'low'}),_0x1cd27b['then'](()=>{_0x1fd602||_0x1021d0('UsageLimit');});});function _0x27097e(){return'auto'==_0x14c202['editing']['view']['_overlayModeHint'];}function _0x553546(){_0x14c202['editing']['view']['_overlayModeHint']='auto';}}function _0xb46b8(_0x239539){const _0x414ef9=[new window['Promise'](_0x1750c4=>setTimeout(_0x1750c4,0x93ecc)),_0x1cd27b['then'](()=>new window['Promise'](_0x340432=>{let _0x476954=0x0;_0x14c202['model']['on']('applyOperation',(_0x4e200b,_0x460dfe)=>{_0x460dfe[0x0]['isDocumentOperation']&&_0x476954++,0x5e8==_0x476954&&(_0x340432(),_0x4e200b['off']());});}))];return window['Promise']['race'](_0x414ef9)['then'](()=>_0x239539);}async function _0x5dbe53(){await _0x1cd27b,_0x14c202['model']['change']=_0x564bfe,_0x14c202['model']['enqueueChange']=_0x564bfe,_0x14c202['enableReadOnlyMode']('model');}function _0x7a9ffe(){return window['glob']&&window['glob']['triliumVersion'];}function _0x2a23b9(_0xa5e932){const _0x2662c2=_0x4846e2();_0x14c202[_0x2662c2]='slashCommandLicenseKey'+_0xa5e932,'Valid'!=_0xa5e932&&_0x5dbe53();}function _0x4846e2(){const _0x48a896=window['String'](window['performance']['now']())['replace']('.','');let _0x10b758='u';for(let _0xce6660=0x0;_0xce6660<_0x48a896['length'];_0xce6660+=0x2){let _0x11fb93=window['parseInt'](_0x48a896['substring'](_0xce6660,_0xce6660+0x2));_0x11fb93>=0x3e&&(_0x11fb93-=0x3e),_0x10b758+=_0xc0528a[_0x11fb93];}return _0x10b758;}function _0x59a887(){const _0x117f62=_0x54088c['split']('.');if(0x3!=_0x117f62['length'])return null;return _0x202f24(_0x117f62[0x1]);function _0x202f24(_0x1b2a3e){const _0x2a7625=_0x336100(_0x1b2a3e);return _0x2a7625&&_0x4aa29f()?_0x2a7625:null;function _0x4aa29f(){const _0x130420=_0x2a7625['jti'],_0x1eda9d=window['parseInt'](_0x130420['substring'](_0x130420['length']-0x8),0x10),_0x3a3385={..._0x2a7625,'jti':_0x130420['substring'](0x0,_0x130420['length']-0x8)};return delete _0x3a3385['vc'],_0x1f0e77(_0x3a3385)==_0x1eda9d;}}}async function _0xb9a506(){let _0x5219b2=!0x0;try{const [_0x587ac7,_0x2df5d8,_0x9c97ba]=_0x54088c['split']('.');return _0x521bff(_0x587ac7),await _0x449095(_0x587ac7,_0x2df5d8,_0x9c97ba),_0x5219b2;}catch{return!0x1;}function _0x521bff(_0x4f1c50){const _0x29e822=_0x336100(_0x4f1c50);_0x29e822&&'ES256'==_0x29e822['alg']||(_0x5219b2=!0x1);}async function _0x449095(_0x4f02c9,_0x5e5eae,_0x13f7b7){const _0x489d4c=window['Uint8Array']['from'](_0x7a2d52(_0x13f7b7),_0x2e2ee3=>_0x2e2ee3['charCodeAt'](0x0)),_0x449143=new window['TextEncoder']()['encode'](_0x4f02c9+'.'+_0x5e5eae),_0x547045=window['crypto']['subtle'];if(!_0x547045)return;const _0x3f9843=await _0x547045['importKey']('jwk',_0x357fec,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x547045['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3f9843,_0x489d4c,_0x449143)||(_0x5219b2=!0x1);}}function _0x336100(_0x156cb1){return _0x156cb1['startsWith']('ey')?JSON['parse'](_0x7a2d52(_0x156cb1)):null;}function _0x7a2d52(_0x548545){return window['atob'](_0x548545['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1f0e77(_0x1f13a8){let _0x1b7109=0x1505;function _0x4647a9(_0x369e1b){for(let _0x380e49=0x0;_0x380e49<_0x369e1b['length'];_0x380e49++){const _0x2d3f70=_0x369e1b['charCodeAt'](_0x380e49);_0x1b7109=(_0x1b7109<<0x5)+_0x1b7109+_0x2d3f70,_0x1b7109&=_0x1b7109;}}function _0x5bffa5(_0x43a13b){Array['isArray'](_0x43a13b)?_0x43a13b['forEach'](_0x5bffa5):_0x43a13b&&'object'==typeof _0x43a13b?Object['entries'](_0x43a13b)['sort']()['forEach'](([_0x1f49c8,_0xb62f65])=>{_0x4647a9(_0x1f49c8),_0x5bffa5(_0xb62f65);}):_0x4647a9(window['String'](_0x43a13b));}return _0x5bffa5(_0x1f13a8),_0x1b7109>>>0x0;}function _0x588b18(_0x5909c7){return _0x5909c7['toString'](0x10)['padStart'](0x8,'0');}function _0x4bbae3(_0x37087f){return _0x37087f['split']('')['reverse']()['join']('');}function _0x564bfe(){}_0x2a23b9(await _0x5cef00());}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x340298=_0x1fd986=>function(_0x40e4c9,_0x4a2cae){const t=_0x40e4c9['t'],_0x19f536=_0x40e4c9['t'];switch(_0x4a2cae){case'AI\x20Assistant':return _0x19f536('AI\x20Assistant');case'Block\x20quote':return _0x19f536('Block\x20quote');case'Bulleted\x20List':return _0x19f536('Bulleted\x20List');case'Insert\x20code\x20block':return _0x19f536('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x19f536('Open\x20file\x20manager');case'Insert\x20image':return _0x19f536('Insert\x20image');case'Heading\x201':return _0x19f536('Heading\x201');case'Heading\x202':return _0x19f536('Heading\x202');case'Heading\x203':return _0x19f536('Heading\x203');case'Heading\x204':return _0x19f536('Heading\x204');case'Heading\x205':return _0x19f536('Heading\x205');case'Heading\x206':return _0x19f536('Heading\x206');case'Horizontal\x20line':return _0x19f536('Horizontal\x20line');case'Insert\x20HTML':return _0x19f536('Insert\x20HTML');case'Increase\x20indent':return _0x19f536('Increase\x20indent');case'Insert\x20table':return _0x19f536('Insert\x20table');case'Table\x20of\x20contents':return _0x19f536('Table\x20of\x20contents');case'Numbered\x20List':return _0x19f536('Numbered\x20List');case'Decrease\x20indent':return _0x19f536('Decrease\x20indent');case'Paragraph':return _0x19f536('Paragraph');case'To-do\x20List':return _0x19f536('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 _0x4a2cae;}}(this['editor']['locale'],_0x1fd986);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x5970df,'title':_0x340298('AI\x20Assistant'),'description':_0x340298('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x2bd76a=>{setTimeout(()=>_0x2bd76a['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x26dec8,'title':_0x340298('Block\x20quote'),'description':_0x340298('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x1dd5ad,'title':_0x340298('Bulleted\x20List'),'description':_0x340298('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0xbe0339,'title':_0x340298('Insert\x20code\x20block'),'description':_0x340298('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x3107ea,'title':_0x340298('Open\x20file\x20manager'),'description':_0x340298('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x3107ea,'title':_0x340298('Insert\x20image'),'description':_0x340298('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x6616ea,'title':_0x340298('Emoji'),'description':_0x340298('Insert\x20an\x20emoji'),'execute':_0x2e6873=>{setTimeout(()=>_0x2e6873['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x4a9312,'title':_0x340298('Heading\x201'),'description':_0x340298('Create\x20a\x20heading\x20level\x201'),'execute':_0x3be782=>{_0x3be782['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x5aeeca,'title':_0x340298('Heading\x202'),'description':_0x340298('Create\x20a\x20heading\x20level\x202'),'execute':_0x1ee237=>{_0x1ee237['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x28ca2f,'title':_0x340298('Heading\x203'),'description':_0x340298('Create\x20a\x20heading\x20level\x203'),'execute':_0x5c48b2=>{_0x5c48b2['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x33cbd5,'title':_0x340298('Heading\x204'),'description':_0x340298('Create\x20a\x20heading\x20level\x204'),'execute':_0xa584a7=>{_0xa584a7['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x384ea,'title':_0x340298('Heading\x205'),'description':_0x340298('Create\x20a\x20heading\x20level\x205'),'execute':_0x30342b=>{_0x30342b['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x4424f8,'title':_0x340298('Heading\x206'),'description':_0x340298('Create\x20a\x20heading\x20level\x206'),'execute':_0x854419=>{_0x854419['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x6829fb,'title':_0x340298('Horizontal\x20line'),'description':_0x340298('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x55173c,'title':_0x340298('Insert\x20HTML'),'description':_0x340298('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x643288,'title':_0x340298('Increase\x20indent'),'description':_0x340298('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x340298('Insert\x20Mermaid\x20diagram'),'description':_0x340298('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x296ae0,'title':_0x340298('Insert\x20table'),'description':_0x340298('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x4fd905,'title':_0x340298('Table\x20of\x20contents'),'description':_0x340298('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x5513b3,'title':_0x340298('Numbered\x20List'),'description':_0x340298('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x415888,'title':_0x340298('Decrease\x20indent'),'description':_0x340298('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x5b0684,'title':_0x340298('Paragraph'),'description':_0x340298('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x756b39,'title':_0x340298('To-do\x20List'),'description':_0x340298('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x57faaa,'title':_0x340298('Footnote'),'description':_0x340298('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x21f045){return _0x21f045['isEnabled']?_0x21f045['isEnabled'](this['editor']):!_0x21f045['commandName']||this['editor']['commands']['get'](_0x21f045['commandName'])['isEnabled'];}_proxyExecute(_0xb1a50e){if(_0xb1a50e['execute'])_0xb1a50e['execute'](this['editor']);else{if(!_0xb1a50e['commandName'])throw new _0x58dbc6('slash-command-execute-missing',this['editor'],{'commandDefinition':_0xb1a50e});this['editor']['execute'](_0xb1a50e['commandName']);}}};function E(_0x13d0fc,_0x3f7d2b){return _0x13d0fc['title']<_0x3f7d2b['title']?-0x1:_0x13d0fc['title']>_0x3f7d2b['title']?0x1:0x0;}function P(_0x390498,_0x81095a){return _0x81095a+'-'+_0x390498['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0xb3e9b{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x17d1c3){const _0x4b9814=_0x17d1c3&&_0x17d1c3['toLowerCase']();let _0x4a9f83=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x4a9f83=_0x4a9f83['filter'](_0x35234e=>_0x35234e['isEnabled']()),_0x4b9814){const _0x207e5d=[],_0x5197c0=[],_0x275657=[],_0x83bc94=[];for(const _0x4c04eb of _0x4a9f83)_0x4c04eb['id']['toLowerCase']()['includes'](_0x4b9814)?_0x207e5d['push'](_0x4c04eb):_0x4c04eb['title']['toLowerCase']()['includes'](_0x4b9814)?_0x5197c0['push'](_0x4c04eb):_0x4c04eb['aliases']&&_0x4c04eb['aliases']['some'](_0xac2c5c=>_0xac2c5c['toLowerCase']()['includes'](_0x4b9814))?_0x275657['push'](_0x4c04eb):_0x4c04eb['description']&&_0x4c04eb['description']['toLowerCase']()['includes'](_0x4b9814)&&_0x83bc94['push'](_0x4c04eb);_0x4a9f83=_0x207e5d['concat'](_0x5197c0,_0x275657,_0x83bc94);}return _0x4a9f83;}},M=class extends _0x3c3363{constructor(_0x207cb7,_0x25ff3c){super(_0x207cb7),this['textPartView']=this['_createTextPartView'](_0x207cb7,_0x25ff3c),void 0x0!==_0x25ff3c['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x25ff3c['isIconColorInherited']),this['set']({'icon':_0x25ff3c['icon']||_0x4c8ee6,'withText':!0x0,'label':_0x25ff3c['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0xc44064,_0x34d6d3){const _0x35f927=new _0x509a25(_0xc44064);return _0x35f927['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x34d6d3['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x34d6d3['description']}]}]:[this['labelView']]}),_0x35f927;}},S=class extends _0xb3e9b{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x143337){super(_0x143337),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1cfbda=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x48c169;for(const _0x498987 in _0x1cfbda){const _0x3610d5=_0x498987,_0x1ce32e=_0x1cfbda[_0x3610d5];if('slashCommandLicenseKeyValid'==_0x1ce32e||'slashCommandLicenseKeyInvalid'==_0x1ce32e||'slashCommandLicenseKeyExpired'==_0x1ce32e||'slashCommandLicenseKeyDomainLimit'==_0x1ce32e||'slashCommandLicenseKeyNotAllowed'==_0x1ce32e||'slashCommandLicenseKeyEvaluationLimit'==_0x1ce32e||'slashCommandLicenseKeyUsageLimit'==_0x1ce32e){delete _0x1cfbda[_0x3610d5],_0x48c169=_0x1ce32e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x48c169&&_0x1cfbda['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x48c169&&_0x1cfbda['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x48c169&&_0x1cfbda['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x48c169&&_0x1cfbda['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x48c169&&_0x1cfbda['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x48c169&&_0x1cfbda['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x4ed17c=this['editor'],_0xa7c064=this['editor']['plugins']['get']('SlashCommandEditing'),_0x44025c=_0x4ed17c['config']['get']('mention.feeds');_0x44025c['push']({'marker':'/','feed':_0x5cffea=>_0xa7c064['getMatchingCommands'](_0x5cffea),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x4ed17c['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x4ed17c['config']['set']('mention.feeds',_0x44025c);}_overrideMentionExecuteListener(){const _0x13306f=this['editor'];_0x13306f['commands']['get']('mention')['on']('execute',(_0x24ecb2,_0x50883b)=>{const _0x5223a1=_0x50883b[0x0],_0x112288=_0x13306f['model'];'/'===_0x5223a1['marker']&&_0x112288['change'](_0x3abf93=>{_0x3abf93['remove'](_0x5223a1['range']),_0x5223a1['mention']['execute'](),_0x24ecb2['stop']();});},{'priority':'high'});}_customItemRenderer(_0x25adab){const _0x3c5986=this['editor']['locale'],_0x56e960=new M(_0x3c5986,_0x25adab);return _0x56e960['render'](),_0x56e960['element'];}},D=class extends _0xb3e9b{static get requires(){return[_0x31ef0b,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 _0x5c7e5a}from'@ckeditor/ckeditor5-core';import{Mention as _0x548642}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x4c9dae,uid as _0x2463b3}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x50749e,IconBulletedList as _0x154cc9,IconCodeBlock as _0x529dd1,IconEmoji as _0x4fd196,IconFootnote as _0x56e131,IconHeading1 as _0x52a9c4,IconHeading2 as _0x54e567,IconHeading3 as _0x29a8bd,IconHeading4 as _0x459c9a,IconHeading5 as _0x45c842,IconHeading6 as _0x40fcae,IconHorizontalLine as _0x17a129,IconHtml as _0x581e3a,IconIndent as _0x2e932a,IconNumberedList as _0x6434f6,IconOutdent as _0x2aa1a9,IconParagraph as _0x213bb3,IconPlay as _0x1292d1,IconQuote as _0x494ad8,IconRobotPencil as _0x43ac8b,IconTable as _0x2d49ce,IconTableOfContents as _0x6a0e7,IconTodoList as _0xe4a300}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x676360,View as _0x16c410}from'@ckeditor/ckeditor5-ui';var O=class extends _0x5c7e5a{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19abdb){super(_0x19abdb),this['_allowedCommands']=null;}afterInit(){const _0x42e977=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x32e4f4=function(_0x2ebf49){let _0x104dc6=['heading4','heading5','heading6'];if(_0x2ebf49){const _0x49ca5a=_0x2ebf49['map'](_0x337be8=>_0x337be8['model']);_0x104dc6=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x39a24d=>!_0x49ca5a['includes'](_0x39a24d));}return _0x104dc6;}(this['editor']['config']['get']('heading.options'));let _0x49d01f=this['getDefaultCommands']()['filter'](_0x4e0569=>!_0x32e4f4['includes'](_0x4e0569['id']))['filter'](_0x3e7405=>!_0x42e977['includes'](_0x3e7405['commandName']));const _0x57d988=this['editor']['config']['get']('slashCommand.extraCommands');_0x57d988&&_0x57d988['length']&&(_0x49d01f=_0x49d01f['concat'](_0x57d988));const _0x40d19a=this['editor']['config']['get']('template.definitions');_0x40d19a&&_0x40d19a['length']&&(_0x49d01f=_0x49d01f['concat'](function(_0x2d8aaf){return _0x2d8aaf['map'](_0x138106=>{const {title:_0x3f417f,icon:_0x3ea7ab,description:_0x38328c,data:_0x569aff}=_0x138106,_0x3d001c={'id':P(_0x3f417f,'template'),'commandName':'insertTemplate','execute':_0x1e0e1a=>{_0x1e0e1a['execute']('insertTemplate',_0x569aff);},'description':_0x38328c,'icon':_0x3ea7ab,'title':_0x3f417f};return _0x3ea7ab&&(_0x3d001c['isIconColorInherited']=!0x1),_0x3d001c;});}(_0x40d19a)));const _0x2a33bd=this['editor']['config']['get']('style.definitions');_0x2a33bd&&_0x2a33bd['length']&&(_0x49d01f=_0x49d01f['concat'](function(_0x4afe99){return _0x4afe99['map'](_0x17fa57=>({'id':P(_0x17fa57['name'],'style'),'commandName':'style','execute':_0x1fd0e1=>{_0x1fd0e1['execute']('style',{'styleName':_0x17fa57['name']});},'isEnabled':_0x12e248=>{const _0x29650=_0x12e248['commands']['get']('style');return _0x29650['isEnabled']&&_0x29650['enabledStyles']['includes'](_0x17fa57['name']);},'title':_0x17fa57['name']}));}(_0x2a33bd)));const _0x1fbe5d=_0x49d01f['filter'](_0x38f7c9=>!_0x38f7c9['commandName']||void 0x0!==this['editor']['commands']['get'](_0x38f7c9['commandName'])),_0x9f26fc=[];for(const _0x3ebace of _0x1fbe5d)_0x9f26fc['push']({'id':_0x3ebace['id'],'commandName':_0x3ebace['commandName'],'title':'function'==typeof _0x3ebace['title']?_0x3ebace['title'](this['editor']):_0x3ebace['title'],'description':_0x3ebace['description'],'icon':_0x3ebace['icon'],'isIconColorInherited':_0x3ebace['isIconColorInherited'],'aliases':_0x3ebace['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x3ebace),'execute':()=>this['_proxyExecute'](_0x3ebace)});this['_allowedCommands']=_0x9f26fc['sort'](E),async function(_0x5de9a7){const _0x2d2f0='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x61fb50=0x79188,_0x404798=window['Date']['now'](),_0x587f5c=_0x5de9a7['editor'],_0x231f0f=new window['Promise'](_0x3f3f10=>{_0x587f5c['once']('ready',_0x3f3f10);}),_0xece302={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x328577=_0x587f5c['config']['get']('licenseKey');async function _0x2eb206(){let _0x19f005,_0x4a1779=null,_0x38f2ee=null;try{return'GPL'==_0x328577?'NotAllowed':(_0x19f005=_0x303081(),_0x19f005?(_0x19f005['usageEndpoint']&&(_0x38f2ee=_0x59fd21(_0x19f005['usageEndpoint'],_0x19f005['jti'])),await _0x147207()?_0x35a5ef()?_0x2a5b56()?'Expired':_0x195a27()?('evaluation'==_0x19f005['licenseType']&&(_0x4a1779=_0x355114('EvaluationLimit')),await _0x2d70df()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2a5b56(){const _0xb3428d=['evaluation','trial']['includes'](_0x19f005['licenseType'])?_0x404798/0x3e8:0xe10*_0x61fb50;return _0x19f005['exp']<_0xb3428d;}function _0x35a5ef(){const _0x367df1=_0x19f005['features'];return!!_0x367df1&&(!!_0x367df1['includes']('*')||(!!_0x367df1['includes']('SC')||(!!_0x367df1['includes']('PP')||!(!_0x367df1['includes']('TRILIUM')||!_0x403958()))));}function _0x195a27(){const _0x22ea09=_0x19f005['licensedHosts'];if(!_0x22ea09||0x0==_0x22ea09['length'])return!0x0;const {hostname:_0x3efdc7}=new URL(window['location']['href']);if(_0x22ea09['includes'](_0x3efdc7))return!0x0;const _0x102c2f=_0x3efdc7['split']('.');return _0x22ea09['filter'](_0x240840=>_0x240840['includes']('*'))['map'](_0xa7ed2b=>_0xa7ed2b['split']('.'))['filter'](_0x312668=>_0x312668['length']<=_0x102c2f['length'])['map'](_0x1d85b4=>Array(_0x102c2f['length']-_0x1d85b4['length'])['fill']('*'===_0x1d85b4[0x0]?'*':'')['concat'](_0x1d85b4))['some'](_0x31f1f5=>_0x102c2f['every']((_0x3f6d29,_0x10c1e4)=>_0x31f1f5[_0x10c1e4]===_0x3f6d29||'*'===_0x31f1f5[_0x10c1e4]));}function _0x2d70df(){return _0x4a1779&&_0x38f2ee?new window['Promise']((_0x4db1e2,_0x5a7911)=>{_0x4a1779['then'](_0x4db1e2,_0x5a7911),_0x38f2ee['then'](_0x27c358=>{'Valid'!=_0x27c358&&_0x4db1e2(_0x27c358);},_0x5a7911);}):_0x4a1779||_0x38f2ee||'Valid';}}function _0x59fd21(_0x2bf17c,_0x29881d){return new window['Promise'](_0x48767a=>{if(_0x2c83df())return _0x48767a('Valid');_0x4a5fb2(),_0x587f5c['decorate']('_sendUsageRequest');let _0x2d3049=!0x1;const _0x2c7662=_0x2463b3();function _0x5bcf65(_0x177fe5){return!!_0x177fe5&&('object'==typeof _0x177fe5||'function'==typeof _0x177fe5)&&'function'==typeof _0x177fe5['then']&&'function'==typeof _0x177fe5['catch'];}function _0x195946(_0x42d5c7){_0x1e2f2a(_0x42d5c7)['then'](_0x4b9c9d=>_0x4b9c9d&&'ok'==_0x4b9c9d['status']?_0x372d3b(_0x55b5c6(_0x2c7662+_0x29881d))!=_0x4b9c9d['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5222f5=>(_0x2bfc54(),_0x5222f5),()=>{const _0x50b092=_0x4e532b();return null==_0x50b092?(_0x2bfc54(),'Valid'):_0x404798-_0x50b092>0x240c8400?'UsageLimit':'Valid';})['then'](_0x48767a)['catch'](()=>{_0x48767a('UsageLimit');});const _0x12b40f=0x36ee80;function _0x2bfc54(){const _0x2348b2='llct-'+_0x372d3b(_0x55b5c6(_0x2bf17c)),_0x29d72e=_0x53844c(_0x372d3b(window['Math']['ceil'](_0x404798/_0x12b40f)));window['localStorage']['setItem'](_0x2348b2,_0x29d72e);}function _0x4e532b(){const _0x15ae5c='llct-'+_0x372d3b(_0x55b5c6(_0x2bf17c)),_0x2ad4e6=window['localStorage']['getItem'](_0x15ae5c);return _0x2ad4e6?window['parseInt'](_0x53844c(_0x2ad4e6),0x10)*_0x12b40f:null;}function _0x1e2f2a(_0x2364bf){return new window['Promise']((_0x13b789,_0x4ef11a)=>{_0x2364bf['then'](_0x13b789,_0x4ef11a),window['setTimeout'](_0x4ef11a,0x1d4c0);});}}_0x587f5c['on']('_sendUsageRequest',(_0x3f5ebe,_0x4fcc36)=>{if(_0x4fcc36[0x0]!=_0x2bf17c)return _0x48767a('UsageLimit');_0x4fcc36[0x1]={..._0x4fcc36[0x1],'requestId':_0x2c7662};},{'priority':'high'}),_0x587f5c['on']('_sendUsageRequest',_0x132189=>{_0x5bcf65(_0x132189['return'])&&(_0x2d3049=!0x0,_0x195946(_0x132189['return']));},{'priority':'low'}),_0x231f0f['then'](()=>{_0x2d3049||_0x48767a('UsageLimit');});});function _0x2c83df(){return'auto'==_0x587f5c['editing']['view']['_overlayModeHint'];}function _0x4a5fb2(){_0x587f5c['editing']['view']['_overlayModeHint']='auto';}}function _0x355114(_0x206530){const _0x4d28a7=[new window['Promise'](_0x46c2cb=>setTimeout(_0x46c2cb,0x93ecc)),_0x231f0f['then'](()=>new window['Promise'](_0x1b6631=>{let _0x2ee538=0x0;_0x587f5c['model']['on']('applyOperation',(_0x14c124,_0x30b0f8)=>{_0x30b0f8[0x0]['isDocumentOperation']&&_0x2ee538++,0x5e8==_0x2ee538&&(_0x1b6631(),_0x14c124['off']());});}))];return window['Promise']['race'](_0x4d28a7)['then'](()=>_0x206530);}async function _0x39d59b(){await _0x231f0f,_0x587f5c['model']['change']=_0xaf3681,_0x587f5c['model']['enqueueChange']=_0xaf3681,_0x587f5c['enableReadOnlyMode']('model');}function _0x403958(){return window['glob']&&window['glob']['triliumVersion'];}function _0x3dc045(_0x21e609){const _0x105361=_0x2f9df5();_0x587f5c[_0x105361]='slashCommandLicenseKey'+_0x21e609,'Valid'!=_0x21e609&&_0x39d59b();}function _0x2f9df5(){const _0xfbd9ff=window['String'](window['performance']['now']())['replace']('.','');let _0x4c0371='u';for(let _0x2fa63e=0x0;_0x2fa63e<_0xfbd9ff['length'];_0x2fa63e+=0x2){let _0x19ed81=window['parseInt'](_0xfbd9ff['substring'](_0x2fa63e,_0x2fa63e+0x2));_0x19ed81>=0x3e&&(_0x19ed81-=0x3e),_0x4c0371+=_0x2d2f0[_0x19ed81];}return _0x4c0371;}function _0x303081(){const _0x461fb5=_0x328577['split']('.');if(0x3!=_0x461fb5['length'])return null;return _0x24d3fd(_0x461fb5[0x1]);function _0x24d3fd(_0x166799){const _0x27e44d=_0xb9f9b(_0x166799);return _0x27e44d&&_0x3881a2()?_0x27e44d:null;function _0x3881a2(){const _0x52a9b3=_0x27e44d['jti'],_0x8622bd=window['parseInt'](_0x52a9b3['substring'](_0x52a9b3['length']-0x8),0x10),_0xe0cbc8={..._0x27e44d,'jti':_0x52a9b3['substring'](0x0,_0x52a9b3['length']-0x8)};return delete _0xe0cbc8['vc'],_0x55b5c6(_0xe0cbc8)==_0x8622bd;}}}async function _0x147207(){let _0x1ff9c6=!0x0;try{const [_0x4e5a92,_0x28cf99,_0x410a86]=_0x328577['split']('.');return _0x4d6922(_0x4e5a92),await _0x55b0ca(_0x4e5a92,_0x28cf99,_0x410a86),_0x1ff9c6;}catch{return!0x1;}function _0x4d6922(_0x2c5a07){const _0x7acf08=_0xb9f9b(_0x2c5a07);_0x7acf08&&'ES256'==_0x7acf08['alg']||(_0x1ff9c6=!0x1);}async function _0x55b0ca(_0x24fbe5,_0x226869,_0x213890){const _0x5f0f38=window['Uint8Array']['from'](_0x8be700(_0x213890),_0x40612=>_0x40612['charCodeAt'](0x0)),_0x5d25b8=new window['TextEncoder']()['encode'](_0x24fbe5+'.'+_0x226869),_0x2d17b8=window['crypto']['subtle'];if(!_0x2d17b8)return;const _0x4b8b2b=await _0x2d17b8['importKey']('jwk',_0xece302,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2d17b8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4b8b2b,_0x5f0f38,_0x5d25b8)||(_0x1ff9c6=!0x1);}}function _0xb9f9b(_0x3537db){return _0x3537db['startsWith']('ey')?JSON['parse'](_0x8be700(_0x3537db)):null;}function _0x8be700(_0x32cb00){return window['atob'](_0x32cb00['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x55b5c6(_0xf24a96){let _0x5523ab=0x1505;function _0x1502b6(_0xafebdf){for(let _0x454f05=0x0;_0x454f05<_0xafebdf['length'];_0x454f05++){const _0x17be1e=_0xafebdf['charCodeAt'](_0x454f05);_0x5523ab=(_0x5523ab<<0x5)+_0x5523ab+_0x17be1e,_0x5523ab&=_0x5523ab;}}function _0xd5b3c7(_0x5c76d4){Array['isArray'](_0x5c76d4)?_0x5c76d4['forEach'](_0xd5b3c7):_0x5c76d4&&'object'==typeof _0x5c76d4?Object['entries'](_0x5c76d4)['sort']()['forEach'](([_0x5c1121,_0x3a5c91])=>{_0x1502b6(_0x5c1121),_0xd5b3c7(_0x3a5c91);}):_0x1502b6(window['String'](_0x5c76d4));}return _0xd5b3c7(_0xf24a96),_0x5523ab>>>0x0;}function _0x372d3b(_0x434479){return _0x434479['toString'](0x10)['padStart'](0x8,'0');}function _0x53844c(_0x59c465){return _0x59c465['split']('')['reverse']()['join']('');}function _0xaf3681(){}_0x3dc045(await _0x2eb206());}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x1ad710=_0x33b56d=>function(_0x1ef9f9,_0x5da1cc){const t=_0x1ef9f9['t'],_0x348bba=_0x1ef9f9['t'];switch(_0x5da1cc){case'AI\x20Assistant':return _0x348bba('AI\x20Assistant');case'Block\x20quote':return _0x348bba('Block\x20quote');case'Bulleted\x20List':return _0x348bba('Bulleted\x20List');case'Insert\x20code\x20block':return _0x348bba('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x348bba('Open\x20file\x20manager');case'Insert\x20image':return _0x348bba('Insert\x20image');case'Heading\x201':return _0x348bba('Heading\x201');case'Heading\x202':return _0x348bba('Heading\x202');case'Heading\x203':return _0x348bba('Heading\x203');case'Heading\x204':return _0x348bba('Heading\x204');case'Heading\x205':return _0x348bba('Heading\x205');case'Heading\x206':return _0x348bba('Heading\x206');case'Horizontal\x20line':return _0x348bba('Horizontal\x20line');case'Insert\x20HTML':return _0x348bba('Insert\x20HTML');case'Increase\x20indent':return _0x348bba('Increase\x20indent');case'Insert\x20table':return _0x348bba('Insert\x20table');case'Table\x20of\x20contents':return _0x348bba('Table\x20of\x20contents');case'Numbered\x20List':return _0x348bba('Numbered\x20List');case'Decrease\x20indent':return _0x348bba('Decrease\x20indent');case'Paragraph':return _0x348bba('Paragraph');case'To-do\x20List':return _0x348bba('To-do\x20List');case'Create\x20a\x20block\x20quote':return t('Create\x20a\x20block\x20quote');case'Create\x20a\x20bulleted\x20list':return t('Create\x20a\x20bulleted\x20list');case'Create\x20a\x20code\x20block':return t('Create\x20a\x20code\x20block');case'Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':return t('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file');case'Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':return t('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file');case'Create\x20a\x20heading\x20level\x201':return t('Create\x20a\x20heading\x20level\x201');case'Create\x20a\x20heading\x20level\x202':return t('Create\x20a\x20heading\x20level\x202');case'Create\x20a\x20heading\x20level\x203':return t('Create\x20a\x20heading\x20level\x203');case'Create\x20a\x20heading\x20level\x204':return t('Create\x20a\x20heading\x20level\x204');case'Create\x20a\x20heading\x20level\x205':return t('Create\x20a\x20heading\x20level\x205');case'Create\x20a\x20heading\x20level\x206':return t('Create\x20a\x20heading\x20level\x206');case'Insert\x20a\x20horizontal\x20line':return t('Insert\x20a\x20horizontal\x20line');case'Insert\x20an\x20HTML\x20snippet':return t('Insert\x20an\x20HTML\x20snippet');case'Increase\x20the\x20indentation':return t('Increase\x20the\x20indentation');case'Insert\x20Mermaid\x20diagram':return t('Insert\x20Mermaid\x20diagram');case'Insert\x20the\x20Mermaid\x20diagram':return t('Insert\x20the\x20Mermaid\x20diagram');case'Create\x20a\x20table':return t('Create\x20a\x20table');case'Insert\x20table\x20of\x20contents':return t('Insert\x20table\x20of\x20contents');case'Create\x20a\x20numbered\x20list':return t('Create\x20a\x20numbered\x20list');case'Decrease\x20the\x20indentation':return t('Decrease\x20the\x20indentation');case'Insert\x20a\x20paragraph':return t('Insert\x20a\x20paragraph');case'Create\x20a\x20to-do\x20list':return t('Create\x20a\x20to-do\x20list');case'Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':return t('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content');case'Insert\x20an\x20emoji':return t('Insert\x20an\x20emoji');case'Insert\x20a\x20footnote':return t('Insert\x20a\x20footnote');default:return _0x5da1cc;}}(this['editor']['locale'],_0x33b56d);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x43ac8b,'title':_0x1ad710('AI\x20Assistant'),'description':_0x1ad710('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x124697=>{setTimeout(()=>_0x124697['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x494ad8,'title':_0x1ad710('Block\x20quote'),'description':_0x1ad710('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x154cc9,'title':_0x1ad710('Bulleted\x20List'),'description':_0x1ad710('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x529dd1,'title':_0x1ad710('Insert\x20code\x20block'),'description':_0x1ad710('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x50749e,'title':_0x1ad710('Open\x20file\x20manager'),'description':_0x1ad710('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x50749e,'title':_0x1ad710('Insert\x20image'),'description':_0x1ad710('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x4fd196,'title':_0x1ad710('Emoji'),'description':_0x1ad710('Insert\x20an\x20emoji'),'execute':_0x2cfde5=>{setTimeout(()=>_0x2cfde5['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x52a9c4,'title':_0x1ad710('Heading\x201'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x201'),'execute':_0xaebdef=>{_0xaebdef['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x54e567,'title':_0x1ad710('Heading\x202'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x202'),'execute':_0x378c49=>{_0x378c49['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x29a8bd,'title':_0x1ad710('Heading\x203'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x203'),'execute':_0x9a3320=>{_0x9a3320['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x459c9a,'title':_0x1ad710('Heading\x204'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x204'),'execute':_0x5e6f92=>{_0x5e6f92['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x45c842,'title':_0x1ad710('Heading\x205'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x205'),'execute':_0x50de87=>{_0x50de87['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x40fcae,'title':_0x1ad710('Heading\x206'),'description':_0x1ad710('Create\x20a\x20heading\x20level\x206'),'execute':_0x5e109b=>{_0x5e109b['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x17a129,'title':_0x1ad710('Horizontal\x20line'),'description':_0x1ad710('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x581e3a,'title':_0x1ad710('Insert\x20HTML'),'description':_0x1ad710('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x2e932a,'title':_0x1ad710('Increase\x20indent'),'description':_0x1ad710('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x1ad710('Insert\x20Mermaid\x20diagram'),'description':_0x1ad710('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x2d49ce,'title':_0x1ad710('Insert\x20table'),'description':_0x1ad710('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x6a0e7,'title':_0x1ad710('Table\x20of\x20contents'),'description':_0x1ad710('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x6434f6,'title':_0x1ad710('Numbered\x20List'),'description':_0x1ad710('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x2aa1a9,'title':_0x1ad710('Decrease\x20indent'),'description':_0x1ad710('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x213bb3,'title':_0x1ad710('Paragraph'),'description':_0x1ad710('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0xe4a300,'title':_0x1ad710('To-do\x20List'),'description':_0x1ad710('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x56e131,'title':_0x1ad710('Footnote'),'description':_0x1ad710('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x8ead74){return _0x8ead74['isEnabled']?_0x8ead74['isEnabled'](this['editor']):!_0x8ead74['commandName']||this['editor']['commands']['get'](_0x8ead74['commandName'])['isEnabled'];}_proxyExecute(_0x29d873){if(_0x29d873['execute'])_0x29d873['execute'](this['editor']);else{if(!_0x29d873['commandName'])throw new _0x4c9dae('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x29d873});this['editor']['execute'](_0x29d873['commandName']);}}};function E(_0x515a60,_0xda4e55){return _0x515a60['title']<_0xda4e55['title']?-0x1:_0x515a60['title']>_0xda4e55['title']?0x1:0x0;}function P(_0x10db7a,_0x1da7ad){return _0x1da7ad+'-'+_0x10db7a['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x5c7e5a{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x168384){const _0x507966=_0x168384&&_0x168384['toLowerCase']();let _0x33d4d7=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x33d4d7=_0x33d4d7['filter'](_0x5e9e19=>_0x5e9e19['isEnabled']()),_0x507966){const _0x88eed4=[],_0x593664=[],_0x52d598=[],_0x3dacfd=[];for(const _0x211937 of _0x33d4d7)_0x211937['id']['toLowerCase']()['includes'](_0x507966)?_0x88eed4['push'](_0x211937):_0x211937['title']['toLowerCase']()['includes'](_0x507966)?_0x593664['push'](_0x211937):_0x211937['aliases']&&_0x211937['aliases']['some'](_0x26f5ed=>_0x26f5ed['toLowerCase']()['includes'](_0x507966))?_0x52d598['push'](_0x211937):_0x211937['description']&&_0x211937['description']['toLowerCase']()['includes'](_0x507966)&&_0x3dacfd['push'](_0x211937);_0x33d4d7=_0x88eed4['concat'](_0x593664,_0x52d598,_0x3dacfd);}return _0x33d4d7;}},M=class extends _0x676360{constructor(_0x29e069,_0x248929){super(_0x29e069),this['textPartView']=this['_createTextPartView'](_0x29e069,_0x248929),void 0x0!==_0x248929['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x248929['isIconColorInherited']),this['set']({'icon':_0x248929['icon']||_0x1292d1,'withText':!0x0,'label':_0x248929['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0x58441c,_0x1f4ebc){const _0x398c6f=new _0x16c410(_0x58441c);return _0x398c6f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x1f4ebc['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x1f4ebc['description']}]}]:[this['labelView']]}),_0x398c6f;}},S=class extends _0x5c7e5a{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x204132){super(_0x204132),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1d7646=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x35eb6e;for(const _0x5215ed in _0x1d7646){const _0x2fd7e5=_0x5215ed,_0x28dfd8=_0x1d7646[_0x2fd7e5];if('slashCommandLicenseKeyValid'==_0x28dfd8||'slashCommandLicenseKeyInvalid'==_0x28dfd8||'slashCommandLicenseKeyExpired'==_0x28dfd8||'slashCommandLicenseKeyDomainLimit'==_0x28dfd8||'slashCommandLicenseKeyNotAllowed'==_0x28dfd8||'slashCommandLicenseKeyEvaluationLimit'==_0x28dfd8||'slashCommandLicenseKeyUsageLimit'==_0x28dfd8){delete _0x1d7646[_0x2fd7e5],_0x35eb6e=_0x28dfd8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x35eb6e&&_0x1d7646['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x35eb6e&&_0x1d7646['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x35eb6e&&_0x1d7646['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x35eb6e&&_0x1d7646['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x35eb6e&&_0x1d7646['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x35eb6e&&_0x1d7646['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x5afe15=this['editor'],_0x579cd6=this['editor']['plugins']['get']('SlashCommandEditing'),_0x5bd3da=_0x5afe15['config']['get']('mention.feeds');_0x5bd3da['push']({'marker':'/','feed':_0x62d4bd=>_0x579cd6['getMatchingCommands'](_0x62d4bd),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x5afe15['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x5afe15['config']['set']('mention.feeds',_0x5bd3da);}_overrideMentionExecuteListener(){const _0x56169e=this['editor'];_0x56169e['commands']['get']('mention')['on']('execute',(_0x185708,_0x46eb51)=>{const _0xa9f8ae=_0x46eb51[0x0],_0x44970f=_0x56169e['model'];'/'===_0xa9f8ae['marker']&&_0x44970f['change'](_0xf73bb0=>{_0xf73bb0['remove'](_0xa9f8ae['range']),_0xa9f8ae['mention']['execute'](),_0x185708['stop']();});},{'priority':'high'});}_customItemRenderer(_0x44bb3b){const _0x10eac6=this['editor']['locale'],_0x24355b=new M(_0x10eac6,_0x44bb3b);return _0x24355b['render'](),_0x24355b['element'];}},D=class extends _0x5c7e5a{static get requires(){return[_0x548642,K,S];}static get['pluginName'](){return'SlashCommand';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{D as SlashCommand,O as SlashCommandConfig,K as SlashCommandEditing,S as SlashCommandUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-slash-command",
|
|
3
|
-
"version": "48.4.0-alpha.
|
|
3
|
+
"version": "48.4.0-alpha.4",
|
|
4
4
|
"description": "Slash command feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ckeditor/ckeditor5-core": "48.4.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-heading": "48.4.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-mention": "48.4.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-style": "48.4.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-template": "48.4.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.4",
|
|
25
|
+
"@ckeditor/ckeditor5-heading": "48.4.0-alpha.4",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.4",
|
|
27
|
+
"@ckeditor/ckeditor5-mention": "48.4.0-alpha.4",
|
|
28
|
+
"@ckeditor/ckeditor5-style": "48.4.0-alpha.4",
|
|
29
|
+
"@ckeditor/ckeditor5-template": "48.4.0-alpha.4",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.4",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.4"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|