@ckeditor/ckeditor5-slash-command 48.3.1-alpha.0 → 48.3.1-alpha.1
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 _0x572dcc}from'@ckeditor/ckeditor5-core';import{Mention as _0x220393}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x320be7,uid as _0x3539d1}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0xc9e073,IconBulletedList as _0x3184d4,IconCodeBlock as _0xfcdd4,IconEmoji as _0x1d4773,IconFootnote as _0x2079b0,IconHeading1 as _0x4febf7,IconHeading2 as _0x23bf69,IconHeading3 as _0x4bd0bb,IconHeading4 as _0x1a8c88,IconHeading5 as _0x2a29d6,IconHeading6 as _0x1ff7d7,IconHorizontalLine as _0x546ac8,IconHtml as _0x295d19,IconIndent as _0xc551d0,IconNumberedList as _0x603734,IconOutdent as _0x5365c3,IconParagraph as _0x633c92,IconPlay as _0x265c80,IconQuote as _0x28f55f,IconRobotPencil as _0xb38a48,IconTable as _0x110102,IconTableOfContents as _0xa85bb4,IconTodoList as _0xf113dd}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x201759,View as _0x1baa04}from'@ckeditor/ckeditor5-ui';var O=class extends _0x572dcc{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x381317){super(_0x381317),this['_allowedCommands']=null;}['afterInit'](){const _0x4e24d9=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x538994=function(_0x4a82db){let _0x3fa18f=['heading4','heading5','heading6'];if(_0x4a82db){const _0x5ce4d4=_0x4a82db['map'](_0x47906e=>_0x47906e['model']);_0x3fa18f=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x972f40=>!_0x5ce4d4['includes'](_0x972f40));}return _0x3fa18f;}(this['editor']['config']['get']('heading.options'));let _0x51e13f=this['getDefaultCommands']()['filter'](_0x861919=>!_0x538994['includes'](_0x861919['id']))['filter'](_0x1e4a89=>!_0x4e24d9['includes'](_0x1e4a89['commandName']));const _0x25b234=this['editor']['config']['get']('slashCommand.extraCommands');_0x25b234&&_0x25b234['length']&&(_0x51e13f=_0x51e13f['concat'](_0x25b234));const _0x38c1ad=this['editor']['config']['get']('template.definitions');_0x38c1ad&&_0x38c1ad['length']&&(_0x51e13f=_0x51e13f['concat'](function(_0x19de8e){return _0x19de8e['map'](_0x2682c1=>{const {title:_0x1731f7,icon:_0x238a76,description:_0x3e93b6,data:_0x28f221}=_0x2682c1,_0x132ee9={'id':P(_0x1731f7,'template'),'commandName':'insertTemplate','execute':_0xe91ba2=>{_0xe91ba2['execute']('insertTemplate',_0x28f221);},'description':_0x3e93b6,'icon':_0x238a76,'title':_0x1731f7};return _0x238a76&&(_0x132ee9['isIconColorInherited']=!0x1),_0x132ee9;});}(_0x38c1ad)));const _0x3934ec=this['editor']['config']['get']('style.definitions');_0x3934ec&&_0x3934ec['length']&&(_0x51e13f=_0x51e13f['concat'](function(_0x3c739e){return _0x3c739e['map'](_0x31175c=>({'id':P(_0x31175c['name'],'style'),'commandName':'style','execute':_0x2a233d=>{_0x2a233d['execute']('style',{'styleName':_0x31175c['name']});},'isEnabled':_0x2dcd24=>{const _0x31010e=_0x2dcd24['commands']['get']('style');return _0x31010e['isEnabled']&&_0x31010e['enabledStyles']['includes'](_0x31175c['name']);},'title':_0x31175c['name']}));}(_0x3934ec)));const _0xec7a6e=_0x51e13f['filter'](_0x5e0867=>!_0x5e0867['commandName']||void 0x0!==this['editor']['commands']['get'](_0x5e0867['commandName'])),_0x5e3df3=[];for(const _0x153f56 of _0xec7a6e)_0x5e3df3['push']({'id':_0x153f56['id'],'commandName':_0x153f56['commandName'],'title':'function'==typeof _0x153f56['title']?_0x153f56['title'](this['editor']):_0x153f56['title'],'description':_0x153f56['description'],'icon':_0x153f56['icon'],'isIconColorInherited':_0x153f56['isIconColorInherited'],'aliases':_0x153f56['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x153f56),'execute':()=>this['_proxyExecute'](_0x153f56)});this['_allowedCommands']=_0x5e3df3['sort'](E),async function(_0x17897e){const _0xb54cba='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x124ed7=0x78fa8,_0x273ef1=window['Date']['now'](),_0x40b294=_0x17897e['editor'],_0x537f5d=new window['Promise'](_0x19676c=>{_0x40b294['once']('ready',_0x19676c);}),_0x4c9f6d={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x53db4b=_0x40b294['config']['get']('licenseKey');async function _0x1b7cb4(){let _0x547b0b,_0x52b58b=null,_0x378189=null;try{return'GPL'==_0x53db4b?'NotAllowed':(_0x547b0b=_0x1113f8(),_0x547b0b?(_0x547b0b['usageEndpoint']&&(_0x378189=_0x1cc82f(_0x547b0b['usageEndpoint'],_0x547b0b['jti'])),await _0x38c0df()?_0x2d6612()?_0x432357()?'Expired':_0x2c7932()?('evaluation'==_0x547b0b['licenseType']&&(_0x52b58b=_0x5ccd29('EvaluationLimit')),await _0x29f8d2()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x432357(){const _0xa814ab=['evaluation','trial']['includes'](_0x547b0b['licenseType'])?_0x273ef1/0x3e8:0xe10*_0x124ed7;return _0x547b0b['exp']<_0xa814ab;}function _0x2d6612(){const _0x15af2f=_0x547b0b['features'];return!!_0x15af2f&&(!!_0x15af2f['includes']('*')||(!!_0x15af2f['includes']('SC')||(!!_0x15af2f['includes']('PP')||!(!_0x15af2f['includes']('TRILIUM')||!_0x342f46()))));}function _0x2c7932(){const _0x3e3ec5=_0x547b0b['licensedHosts'];if(!_0x3e3ec5||0x0==_0x3e3ec5['length'])return!0x0;const {hostname:_0xd13f8e}=new URL(window['location']['href']);if(_0x3e3ec5['includes'](_0xd13f8e))return!0x0;const _0x5b5000=_0xd13f8e['split']('.');return _0x3e3ec5['filter'](_0x3935c7=>_0x3935c7['includes']('*'))['map'](_0x8e0079=>_0x8e0079['split']('.'))['filter'](_0x3d8ad4=>_0x3d8ad4['length']<=_0x5b5000['length'])['map'](_0x3b3639=>Array(_0x5b5000['length']-_0x3b3639['length'])['fill']('*'===_0x3b3639[0x0]?'*':'')['concat'](_0x3b3639))['some'](_0x1c597f=>_0x5b5000['every']((_0x2e9eed,_0x12a963)=>_0x1c597f[_0x12a963]===_0x2e9eed||'*'===_0x1c597f[_0x12a963]));}function _0x29f8d2(){return _0x52b58b&&_0x378189?new window['Promise']((_0x757ccb,_0x3eec1a)=>{_0x52b58b['then'](_0x757ccb,_0x3eec1a),_0x378189['then'](_0x539e4c=>{'Valid'!=_0x539e4c&&_0x757ccb(_0x539e4c);},_0x3eec1a);}):_0x52b58b||_0x378189||'Valid';}}function _0x1cc82f(_0x339177,_0x200901){return new window['Promise'](_0x96ec61=>{if(_0x3a7532())return _0x96ec61('Valid');_0x35404f(),_0x40b294['decorate']('_sendUsageRequest');let _0xa3f499=!0x1;const _0x5e9882=_0x3539d1();function _0x3ac9ef(_0x4657f0){return!!_0x4657f0&&('object'==typeof _0x4657f0||'function'==typeof _0x4657f0)&&'function'==typeof _0x4657f0['then']&&'function'==typeof _0x4657f0['catch'];}function _0x3d2457(_0x20a252){_0x4417aa(_0x20a252)['then'](_0x5d7e0c=>_0x5d7e0c&&'ok'==_0x5d7e0c['status']?_0x164ff2(_0x28547b(_0x5e9882+_0x200901))!=_0x5d7e0c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2a4e33=>(_0x3a9108(),_0x2a4e33),()=>{const _0x4bfbaf=_0x282b61();return null==_0x4bfbaf?(_0x3a9108(),'Valid'):_0x273ef1-_0x4bfbaf>0x240c8400?'UsageLimit':'Valid';})['then'](_0x96ec61)['catch'](()=>{_0x96ec61('UsageLimit');});const _0x110088=0x36ee80;function _0x3a9108(){const _0x133b00='llct-'+_0x164ff2(_0x28547b(_0x339177)),_0x2ecb1c=_0x3d01a8(_0x164ff2(window['Math']['ceil'](_0x273ef1/_0x110088)));window['localStorage']['setItem'](_0x133b00,_0x2ecb1c);}function _0x282b61(){const _0x4673c3='llct-'+_0x164ff2(_0x28547b(_0x339177)),_0x3d1692=window['localStorage']['getItem'](_0x4673c3);return _0x3d1692?window['parseInt'](_0x3d01a8(_0x3d1692),0x10)*_0x110088:null;}function _0x4417aa(_0x38041e){return new window['Promise']((_0x3a4914,_0x178d05)=>{_0x38041e['then'](_0x3a4914,_0x178d05),window['setTimeout'](_0x178d05,0x1d4c0);});}}_0x40b294['on']('_sendUsageRequest',(_0x233d23,_0x2cee01)=>{if(_0x2cee01[0x0]!=_0x339177)return _0x96ec61('UsageLimit');_0x2cee01[0x1]={..._0x2cee01[0x1],'requestId':_0x5e9882};},{'priority':'high'}),_0x40b294['on']('_sendUsageRequest',_0x26ae70=>{_0x3ac9ef(_0x26ae70['return'])&&(_0xa3f499=!0x0,_0x3d2457(_0x26ae70['return']));},{'priority':'low'}),_0x537f5d['then'](()=>{_0xa3f499||_0x96ec61('UsageLimit');});});function _0x3a7532(){return'auto'==_0x40b294['editing']['view']['_overlayModeHint'];}function _0x35404f(){_0x40b294['editing']['view']['_overlayModeHint']='auto';}}function _0x5ccd29(_0x5672e6){const _0x1a257f=[new window['Promise'](_0x2c21ba=>setTimeout(_0x2c21ba,0x93ecc)),_0x537f5d['then'](()=>new window['Promise'](_0x21de93=>{let _0xbc8763=0x0;_0x40b294['model']['on']('applyOperation',(_0x77de40,_0x4f7763)=>{_0x4f7763[0x0]['isDocumentOperation']&&_0xbc8763++,0x5e8==_0xbc8763&&(_0x21de93(),_0x77de40['off']());});}))];return window['Promise']['race'](_0x1a257f)['then'](()=>_0x5672e6);}async function _0x143333(){await _0x537f5d,_0x40b294['model']['change']=_0x5ed59a,_0x40b294['model']['enqueueChange']=_0x5ed59a,_0x40b294['enableReadOnlyMode']('model');}function _0x342f46(){return window['glob']&&window['glob']['triliumVersion'];}function _0xacb59b(_0xf28200){const _0x5cc2bc=_0x2ae1c8();_0x40b294[_0x5cc2bc]='slashCommandLicenseKey'+_0xf28200,'Valid'!=_0xf28200&&_0x143333();}function _0x2ae1c8(){const _0x7745f7=window['String'](window['performance']['now']())['replace']('.','');let _0x4d4016='u';for(let _0x2dd2d5=0x0;_0x2dd2d5<_0x7745f7['length'];_0x2dd2d5+=0x2){let _0x17d5f2=window['parseInt'](_0x7745f7['substring'](_0x2dd2d5,_0x2dd2d5+0x2));_0x17d5f2>=0x3e&&(_0x17d5f2-=0x3e),_0x4d4016+=_0xb54cba[_0x17d5f2];}return _0x4d4016;}function _0x1113f8(){const _0x400e8f=_0x53db4b['split']('.');if(0x3!=_0x400e8f['length'])return null;return _0x16f7ca(_0x400e8f[0x1]);function _0x16f7ca(_0x180a5d){const _0xe0087d=_0x4aab3e(_0x180a5d);return _0xe0087d&&_0x58749e()?_0xe0087d:null;function _0x58749e(){const _0x585cb2=_0xe0087d['jti'],_0x326c8b=window['parseInt'](_0x585cb2['substring'](_0x585cb2['length']-0x8),0x10),_0x244af3={..._0xe0087d,'jti':_0x585cb2['substring'](0x0,_0x585cb2['length']-0x8)};return delete _0x244af3['vc'],_0x28547b(_0x244af3)==_0x326c8b;}}}async function _0x38c0df(){let _0x3f4c5a=!0x0;try{const [_0x3414eb,_0x401e9d,_0x39702b]=_0x53db4b['split']('.');return _0xf53640(_0x3414eb),await _0xe089e8(_0x3414eb,_0x401e9d,_0x39702b),_0x3f4c5a;}catch{return!0x1;}function _0xf53640(_0x51e1b9){const _0xda7632=_0x4aab3e(_0x51e1b9);_0xda7632&&'ES256'==_0xda7632['alg']||(_0x3f4c5a=!0x1);}async function _0xe089e8(_0x737810,_0x35d397,_0x145d79){const _0x4fc933=window['Uint8Array']['from'](_0x24d1aa(_0x145d79),_0xf77b09=>_0xf77b09['charCodeAt'](0x0)),_0x5cf489=new window['TextEncoder']()['encode'](_0x737810+'.'+_0x35d397),_0x571ad9=window['crypto']['subtle'];if(!_0x571ad9)return;const _0xb89780=await _0x571ad9['importKey']('jwk',_0x4c9f6d,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x571ad9['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xb89780,_0x4fc933,_0x5cf489)||(_0x3f4c5a=!0x1);}}function _0x4aab3e(_0x39fc18){return _0x39fc18['startsWith']('ey')?JSON['parse'](_0x24d1aa(_0x39fc18)):null;}function _0x24d1aa(_0x58dc10){return window['atob'](_0x58dc10['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x28547b(_0x1cc5d0){let _0x321c88=0x1505;function _0x3180df(_0xd6f2ab){for(let _0x35b57b=0x0;_0x35b57b<_0xd6f2ab['length'];_0x35b57b++){const _0x34a0a6=_0xd6f2ab['charCodeAt'](_0x35b57b);_0x321c88=(_0x321c88<<0x5)+_0x321c88+_0x34a0a6,_0x321c88&=_0x321c88;}}function _0x4a09c6(_0x5e9787){Array['isArray'](_0x5e9787)?_0x5e9787['forEach'](_0x4a09c6):_0x5e9787&&'object'==typeof _0x5e9787?Object['entries'](_0x5e9787)['sort']()['forEach'](([_0x3a795,_0x3215bd])=>{_0x3180df(_0x3a795),_0x4a09c6(_0x3215bd);}):_0x3180df(window['String'](_0x5e9787));}return _0x4a09c6(_0x1cc5d0),_0x321c88>>>0x0;}function _0x164ff2(_0x132374){return _0x132374['toString'](0x10)['padStart'](0x8,'0');}function _0x3d01a8(_0x58a0a0){return _0x58a0a0['split']('')['reverse']()['join']('');}function _0x5ed59a(){}_0xacb59b(await _0x1b7cb4());}(this);}['getAllowedCommands'](){return this['_allowedCommands'];}['getDefaultCommands'](){const _0x57cfa5=_0x5b03fe=>function(_0x15de2d,_0x46d24e){const t=_0x15de2d['t'],_0xbd5d38=_0x15de2d['t'];switch(_0x46d24e){case'AI\x20Assistant':return _0xbd5d38('AI\x20Assistant');case'Block\x20quote':return _0xbd5d38('Block\x20quote');case'Bulleted\x20List':return _0xbd5d38('Bulleted\x20List');case'Insert\x20code\x20block':return _0xbd5d38('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0xbd5d38('Open\x20file\x20manager');case'Insert\x20image':return _0xbd5d38('Insert\x20image');case'Heading\x201':return _0xbd5d38('Heading\x201');case'Heading\x202':return _0xbd5d38('Heading\x202');case'Heading\x203':return _0xbd5d38('Heading\x203');case'Heading\x204':return _0xbd5d38('Heading\x204');case'Heading\x205':return _0xbd5d38('Heading\x205');case'Heading\x206':return _0xbd5d38('Heading\x206');case'Horizontal\x20line':return _0xbd5d38('Horizontal\x20line');case'Insert\x20HTML':return _0xbd5d38('Insert\x20HTML');case'Increase\x20indent':return _0xbd5d38('Increase\x20indent');case'Insert\x20table':return _0xbd5d38('Insert\x20table');case'Table\x20of\x20contents':return _0xbd5d38('Table\x20of\x20contents');case'Numbered\x20List':return _0xbd5d38('Numbered\x20List');case'Decrease\x20indent':return _0xbd5d38('Decrease\x20indent');case'Paragraph':return _0xbd5d38('Paragraph');case'To-do\x20List':return _0xbd5d38('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 _0x46d24e;}}(this['editor']['locale'],_0x5b03fe);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0xb38a48,'title':_0x57cfa5('AI\x20Assistant'),'description':_0x57cfa5('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x152189=>{setTimeout(()=>_0x152189['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x28f55f,'title':_0x57cfa5('Block\x20quote'),'description':_0x57cfa5('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x3184d4,'title':_0x57cfa5('Bulleted\x20List'),'description':_0x57cfa5('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0xfcdd4,'title':_0x57cfa5('Insert\x20code\x20block'),'description':_0x57cfa5('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0xc9e073,'title':_0x57cfa5('Open\x20file\x20manager'),'description':_0x57cfa5('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0xc9e073,'title':_0x57cfa5('Insert\x20image'),'description':_0x57cfa5('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x1d4773,'title':_0x57cfa5('Emoji'),'description':_0x57cfa5('Insert\x20an\x20emoji'),'execute':_0x54c3f7=>{setTimeout(()=>_0x54c3f7['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x4febf7,'title':_0x57cfa5('Heading\x201'),'description':_0x57cfa5('Create\x20a\x20heading\x20level\x201'),'execute':_0x2d4f3d=>{_0x2d4f3d['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x23bf69,'title':_0x57cfa5('Heading\x202'),'description':_0x57cfa5('Create\x20a\x20heading\x20level\x202'),'execute':_0x11be17=>{_0x11be17['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x4bd0bb,'title':_0x57cfa5('Heading\x203'),'description':_0x57cfa5('Create\x20a\x20heading\x20level\x203'),'execute':_0x2914b9=>{_0x2914b9['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x1a8c88,'title':_0x57cfa5('Heading\x204'),'description':_0x57cfa5('Create\x20a\x20heading\x20level\x204'),'execute':_0x5a166a=>{_0x5a166a['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x2a29d6,'title':_0x57cfa5('Heading\x205'),'description':_0x57cfa5('Create\x20a\x20heading\x20level\x205'),'execute':_0x4e185e=>{_0x4e185e['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x1ff7d7,'title':_0x57cfa5('Heading\x206'),'description':_0x57cfa5('Create\x20a\x20heading\x20level\x206'),'execute':_0x13c1a6=>{_0x13c1a6['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x546ac8,'title':_0x57cfa5('Horizontal\x20line'),'description':_0x57cfa5('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x295d19,'title':_0x57cfa5('Insert\x20HTML'),'description':_0x57cfa5('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0xc551d0,'title':_0x57cfa5('Increase\x20indent'),'description':_0x57cfa5('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x57cfa5('Insert\x20Mermaid\x20diagram'),'description':_0x57cfa5('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x110102,'title':_0x57cfa5('Insert\x20table'),'description':_0x57cfa5('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0xa85bb4,'title':_0x57cfa5('Table\x20of\x20contents'),'description':_0x57cfa5('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x603734,'title':_0x57cfa5('Numbered\x20List'),'description':_0x57cfa5('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x5365c3,'title':_0x57cfa5('Decrease\x20indent'),'description':_0x57cfa5('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x633c92,'title':_0x57cfa5('Paragraph'),'description':_0x57cfa5('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0xf113dd,'title':_0x57cfa5('To-do\x20List'),'description':_0x57cfa5('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x2079b0,'title':_0x57cfa5('Footnote'),'description':_0x57cfa5('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x1fd7d6){return _0x1fd7d6['isEnabled']?_0x1fd7d6['isEnabled'](this['editor']):!_0x1fd7d6['commandName']||this['editor']['commands']['get'](_0x1fd7d6['commandName'])['isEnabled'];}['_proxyExecute'](_0x484525){if(_0x484525['execute'])_0x484525['execute'](this['editor']);else{if(!_0x484525['commandName'])throw new _0x320be7('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x484525});this['editor']['execute'](_0x484525['commandName']);}}};function E(_0x4c0883,_0x13fd8a){return _0x4c0883['title']<_0x13fd8a['title']?-0x1:_0x4c0883['title']>_0x13fd8a['title']?0x1:0x0;}function P(_0x167f68,_0x439f6a){return _0x439f6a+'-'+_0x167f68['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x572dcc{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[O];}['getMatchingCommands'](_0x4e220e){const _0x1cb0a4=_0x4e220e&&_0x4e220e['toLowerCase']();let _0x2a66b0=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x2a66b0=_0x2a66b0['filter'](_0xcb9164=>_0xcb9164['isEnabled']()),_0x1cb0a4){const _0xb69247=[],_0x71e173=[],_0x43295c=[],_0x3509e8=[];for(const _0x3371a7 of _0x2a66b0)_0x3371a7['id']['toLowerCase']()['includes'](_0x1cb0a4)?_0xb69247['push'](_0x3371a7):_0x3371a7['title']['toLowerCase']()['includes'](_0x1cb0a4)?_0x71e173['push'](_0x3371a7):_0x3371a7['aliases']&&_0x3371a7['aliases']['some'](_0x272b91=>_0x272b91['toLowerCase']()['includes'](_0x1cb0a4))?_0x43295c['push'](_0x3371a7):_0x3371a7['description']&&_0x3371a7['description']['toLowerCase']()['includes'](_0x1cb0a4)&&_0x3509e8['push'](_0x3371a7);_0x2a66b0=_0xb69247['concat'](_0x71e173,_0x43295c,_0x3509e8);}return _0x2a66b0;}},M=class extends _0x201759{constructor(_0x59783a,_0x247a2a){super(_0x59783a),this['textPartView']=this['_createTextPartView'](_0x59783a,_0x247a2a),void 0x0!==_0x247a2a['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x247a2a['isIconColorInherited']),this['set']({'icon':_0x247a2a['icon']||_0x265c80,'withText':!0x0,'label':_0x247a2a['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}['_createTextPartView'](_0xa9b95d,_0x281598){const _0xb4e90a=new _0x1baa04(_0xa9b95d);return _0xb4e90a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x281598['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x281598['description']}]}]:[this['labelView']]}),_0xb4e90a;}},S=class extends _0x572dcc{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d5310){super(_0x3d5310),this['_setupMentionConfiguration']();}['init'](){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x501acf=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1e10ea;for(const _0x1c032e in _0x501acf){const _0x574079=_0x1c032e,_0x2cd8d9=_0x501acf[_0x574079];if('slashCommandLicenseKeyValid'==_0x2cd8d9||'slashCommandLicenseKeyInvalid'==_0x2cd8d9||'slashCommandLicenseKeyExpired'==_0x2cd8d9||'slashCommandLicenseKeyDomainLimit'==_0x2cd8d9||'slashCommandLicenseKeyNotAllowed'==_0x2cd8d9||'slashCommandLicenseKeyEvaluationLimit'==_0x2cd8d9||'slashCommandLicenseKeyUsageLimit'==_0x2cd8d9){delete _0x501acf[_0x574079],_0x1e10ea=_0x2cd8d9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x1e10ea&&_0x501acf['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x1e10ea&&_0x501acf['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x1e10ea&&_0x501acf['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x1e10ea&&_0x501acf['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x1e10ea&&_0x501acf['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x1e10ea&&_0x501acf['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_setupMentionConfiguration'](){const _0x25f01b=this['editor'],_0x126fef=this['editor']['plugins']['get']('SlashCommandEditing'),_0x4c1d77=_0x25f01b['config']['get']('mention.feeds');_0x4c1d77['push']({'marker':'/','feed':_0x261033=>_0x126fef['getMatchingCommands'](_0x261033),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x25f01b['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x25f01b['config']['set']('mention.feeds',_0x4c1d77);}['_overrideMentionExecuteListener'](){const _0x4fbf19=this['editor'];_0x4fbf19['commands']['get']('mention')['on']('execute',(_0x590da7,_0x43f545)=>{const _0x317ca9=_0x43f545[0x0],_0x613906=_0x4fbf19['model'];'/'===_0x317ca9['marker']&&_0x613906['change'](_0x14a91e=>{_0x14a91e['remove'](_0x317ca9['range']),_0x317ca9['mention']['execute'](),_0x590da7['stop']();});},{'priority':'high'});}['_customItemRenderer'](_0x59000a){const _0x2852a8=this['editor']['locale'],_0x6ba064=new M(_0x2852a8,_0x59000a);return _0x6ba064['render'](),_0x6ba064['element'];}},D=class extends _0x572dcc{static get['requires'](){return[_0x220393,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 _0x2456b0}from'@ckeditor/ckeditor5-core';import{Mention as _0x10d424}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x19107c,uid as _0x1163a0}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x23a0cf,IconBulletedList as _0x4c6517,IconCodeBlock as _0x144ce7,IconEmoji as _0x88f9a6,IconFootnote as _0x5e0b7b,IconHeading1 as _0x234492,IconHeading2 as _0x1d8c5a,IconHeading3 as _0x5bf2ad,IconHeading4 as _0x2e062c,IconHeading5 as _0x2283df,IconHeading6 as _0x5a2454,IconHorizontalLine as _0xb2b0ba,IconHtml as _0x30df35,IconIndent as _0x55e3a0,IconNumberedList as _0x2710bb,IconOutdent as _0x325102,IconParagraph as _0x982fdf,IconPlay as _0xdf7726,IconQuote as _0x26c383,IconRobotPencil as _0x398d47,IconTable as _0x15d308,IconTableOfContents as _0x5e9b32,IconTodoList as _0x3b9250}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x5de7ab,View as _0x87497}from'@ckeditor/ckeditor5-ui';var O=class extends _0x2456b0{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x172e8f){super(_0x172e8f),this['_allowedCommands']=null;}['afterInit'](){const _0x36015a=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x43d155=function(_0x326f79){let _0x2f8fb6=['heading4','heading5','heading6'];if(_0x326f79){const _0xe63269=_0x326f79['map'](_0x3dda57=>_0x3dda57['model']);_0x2f8fb6=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0xa76bfa=>!_0xe63269['includes'](_0xa76bfa));}return _0x2f8fb6;}(this['editor']['config']['get']('heading.options'));let _0x3f45aa=this['getDefaultCommands']()['filter'](_0x5d4fe2=>!_0x43d155['includes'](_0x5d4fe2['id']))['filter'](_0x3342c6=>!_0x36015a['includes'](_0x3342c6['commandName']));const _0xe5da99=this['editor']['config']['get']('slashCommand.extraCommands');_0xe5da99&&_0xe5da99['length']&&(_0x3f45aa=_0x3f45aa['concat'](_0xe5da99));const _0x5348f0=this['editor']['config']['get']('template.definitions');_0x5348f0&&_0x5348f0['length']&&(_0x3f45aa=_0x3f45aa['concat'](function(_0x4b7cce){return _0x4b7cce['map'](_0x1ffd0c=>{const {title:_0x5b34c6,icon:_0xcc0fcb,description:_0x1be03c,data:_0x2c02b9}=_0x1ffd0c,_0x59df76={'id':P(_0x5b34c6,'template'),'commandName':'insertTemplate','execute':_0xf988fe=>{_0xf988fe['execute']('insertTemplate',_0x2c02b9);},'description':_0x1be03c,'icon':_0xcc0fcb,'title':_0x5b34c6};return _0xcc0fcb&&(_0x59df76['isIconColorInherited']=!0x1),_0x59df76;});}(_0x5348f0)));const _0x5f0604=this['editor']['config']['get']('style.definitions');_0x5f0604&&_0x5f0604['length']&&(_0x3f45aa=_0x3f45aa['concat'](function(_0x47c0e8){return _0x47c0e8['map'](_0x3a7fdf=>({'id':P(_0x3a7fdf['name'],'style'),'commandName':'style','execute':_0x537993=>{_0x537993['execute']('style',{'styleName':_0x3a7fdf['name']});},'isEnabled':_0x17193c=>{const _0x2fbaf6=_0x17193c['commands']['get']('style');return _0x2fbaf6['isEnabled']&&_0x2fbaf6['enabledStyles']['includes'](_0x3a7fdf['name']);},'title':_0x3a7fdf['name']}));}(_0x5f0604)));const _0x4140cf=_0x3f45aa['filter'](_0xc0077a=>!_0xc0077a['commandName']||void 0x0!==this['editor']['commands']['get'](_0xc0077a['commandName'])),_0x1d791d=[];for(const _0x508841 of _0x4140cf)_0x1d791d['push']({'id':_0x508841['id'],'commandName':_0x508841['commandName'],'title':'function'==typeof _0x508841['title']?_0x508841['title'](this['editor']):_0x508841['title'],'description':_0x508841['description'],'icon':_0x508841['icon'],'isIconColorInherited':_0x508841['isIconColorInherited'],'aliases':_0x508841['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x508841),'execute':()=>this['_proxyExecute'](_0x508841)});this['_allowedCommands']=_0x1d791d['sort'](E),async function(_0x319eb9){const _0x211a55='umgl1F4YkAVEtv0TcN6nKiXCrhODd2PaGMSIJbspyz9QLBoWxUfj5HZew738Rq',_0x2bbcfc=0x78fc0,_0x5b56cd=window['Date']['now'](),_0x4b2743=_0x319eb9['editor'],_0x341a7f=new window['Promise'](_0x5d7016=>{_0x4b2743['once']('ready',_0x5d7016);}),_0x42ccea={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x271d6a=_0x4b2743['config']['get']('licenseKey');async function _0x5d6a3c(){let _0x457ffd,_0x281a49=null,_0x3bdf30=null;try{return'GPL'==_0x271d6a?'NotAllowed':(_0x457ffd=_0x1d4746(),_0x457ffd?(_0x457ffd['usageEndpoint']&&(_0x3bdf30=_0x1973ca(_0x457ffd['usageEndpoint'],_0x457ffd['jti'])),await _0x2f61c0()?_0x437c3e()?_0x2bd0e8()?'Expired':_0x4aba9a()?('evaluation'==_0x457ffd['licenseType']&&(_0x281a49=_0x275a3d('EvaluationLimit')),await _0x167d49()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2bd0e8(){const _0x223f20=['evaluation','trial']['includes'](_0x457ffd['licenseType'])?_0x5b56cd/0x3e8:0xe10*_0x2bbcfc;return _0x457ffd['exp']<_0x223f20;}function _0x437c3e(){const _0x1ced70=_0x457ffd['features'];return!!_0x1ced70&&(!!_0x1ced70['includes']('*')||(!!_0x1ced70['includes']('SC')||(!!_0x1ced70['includes']('PP')||!(!_0x1ced70['includes']('TRILIUM')||!_0x59bfc5()))));}function _0x4aba9a(){const _0x16ca90=_0x457ffd['licensedHosts'];if(!_0x16ca90||0x0==_0x16ca90['length'])return!0x0;const {hostname:_0x24ebf2}=new URL(window['location']['href']);if(_0x16ca90['includes'](_0x24ebf2))return!0x0;const _0x679889=_0x24ebf2['split']('.');return _0x16ca90['filter'](_0x5c8718=>_0x5c8718['includes']('*'))['map'](_0x400a99=>_0x400a99['split']('.'))['filter'](_0x161341=>_0x161341['length']<=_0x679889['length'])['map'](_0x4c086b=>Array(_0x679889['length']-_0x4c086b['length'])['fill']('*'===_0x4c086b[0x0]?'*':'')['concat'](_0x4c086b))['some'](_0x5ff7bc=>_0x679889['every']((_0x2aa9ec,_0x68f9ac)=>_0x5ff7bc[_0x68f9ac]===_0x2aa9ec||'*'===_0x5ff7bc[_0x68f9ac]));}function _0x167d49(){return _0x281a49&&_0x3bdf30?new window['Promise']((_0x5998bd,_0x3120e5)=>{_0x281a49['then'](_0x5998bd,_0x3120e5),_0x3bdf30['then'](_0x463ab5=>{'Valid'!=_0x463ab5&&_0x5998bd(_0x463ab5);},_0x3120e5);}):_0x281a49||_0x3bdf30||'Valid';}}function _0x1973ca(_0x460be7,_0x4cdd2d){return new window['Promise'](_0x585311=>{if(_0x53e2dd())return _0x585311('Valid');_0x52677a(),_0x4b2743['decorate']('_sendUsageRequest');let _0x324754=!0x1;const _0x2bc065=_0x1163a0();function _0x3cd8d3(_0x31328b){return!!_0x31328b&&('object'==typeof _0x31328b||'function'==typeof _0x31328b)&&'function'==typeof _0x31328b['then']&&'function'==typeof _0x31328b['catch'];}function _0x2205fd(_0x5c57ca){_0x27f01b(_0x5c57ca)['then'](_0x1f71f7=>_0x1f71f7&&'ok'==_0x1f71f7['status']?_0xa475c2(_0x3ffdca(_0x2bc065+_0x4cdd2d))!=_0x1f71f7['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x22bea1=>(_0xa820fc(),_0x22bea1),()=>{const _0x12e934=_0xb85be8();return null==_0x12e934?(_0xa820fc(),'Valid'):_0x5b56cd-_0x12e934>0x240c8400?'UsageLimit':'Valid';})['then'](_0x585311)['catch'](()=>{_0x585311('UsageLimit');});const _0x14215b=0x36ee80;function _0xa820fc(){const _0x1aec81='llct-'+_0xa475c2(_0x3ffdca(_0x460be7)),_0x3237a0=_0xcc84b5(_0xa475c2(window['Math']['ceil'](_0x5b56cd/_0x14215b)));window['localStorage']['setItem'](_0x1aec81,_0x3237a0);}function _0xb85be8(){const _0x30349d='llct-'+_0xa475c2(_0x3ffdca(_0x460be7)),_0x2e1196=window['localStorage']['getItem'](_0x30349d);return _0x2e1196?window['parseInt'](_0xcc84b5(_0x2e1196),0x10)*_0x14215b:null;}function _0x27f01b(_0x452860){return new window['Promise']((_0x19e9ac,_0xa8b71f)=>{_0x452860['then'](_0x19e9ac,_0xa8b71f),window['setTimeout'](_0xa8b71f,0x1d4c0);});}}_0x4b2743['on']('_sendUsageRequest',(_0x366a92,_0x54707a)=>{if(_0x54707a[0x0]!=_0x460be7)return _0x585311('UsageLimit');_0x54707a[0x1]={..._0x54707a[0x1],'requestId':_0x2bc065};},{'priority':'high'}),_0x4b2743['on']('_sendUsageRequest',_0x452318=>{_0x3cd8d3(_0x452318['return'])&&(_0x324754=!0x0,_0x2205fd(_0x452318['return']));},{'priority':'low'}),_0x341a7f['then'](()=>{_0x324754||_0x585311('UsageLimit');});});function _0x53e2dd(){return'auto'==_0x4b2743['editing']['view']['_overlayModeHint'];}function _0x52677a(){_0x4b2743['editing']['view']['_overlayModeHint']='auto';}}function _0x275a3d(_0x31e5a3){const _0x54df2b=[new window['Promise'](_0x2dc598=>setTimeout(_0x2dc598,0x93ecc)),_0x341a7f['then'](()=>new window['Promise'](_0x5db5f1=>{let _0x19d6cb=0x0;_0x4b2743['model']['on']('applyOperation',(_0x26d028,_0x228fad)=>{_0x228fad[0x0]['isDocumentOperation']&&_0x19d6cb++,0x5e8==_0x19d6cb&&(_0x5db5f1(),_0x26d028['off']());});}))];return window['Promise']['race'](_0x54df2b)['then'](()=>_0x31e5a3);}async function _0x28857f(){await _0x341a7f,_0x4b2743['model']['change']=_0x3abc07,_0x4b2743['model']['enqueueChange']=_0x3abc07,_0x4b2743['enableReadOnlyMode']('model');}function _0x59bfc5(){return window['glob']&&window['glob']['triliumVersion'];}function _0x36edbc(_0x1ae4cf){const _0x367497=_0x200830();_0x4b2743[_0x367497]='slashCommandLicenseKey'+_0x1ae4cf,'Valid'!=_0x1ae4cf&&_0x28857f();}function _0x200830(){const _0x3a403e=window['String'](window['performance']['now']())['replace']('.','');let _0x11d591='u';for(let _0x252c40=0x0;_0x252c40<_0x3a403e['length'];_0x252c40+=0x2){let _0x56d3a2=window['parseInt'](_0x3a403e['substring'](_0x252c40,_0x252c40+0x2));_0x56d3a2>=0x3e&&(_0x56d3a2-=0x3e),_0x11d591+=_0x211a55[_0x56d3a2];}return _0x11d591;}function _0x1d4746(){const _0x1bb577=_0x271d6a['split']('.');if(0x3!=_0x1bb577['length'])return null;return _0x5a9235(_0x1bb577[0x1]);function _0x5a9235(_0x4ea530){const _0x2f038a=_0x1fe971(_0x4ea530);return _0x2f038a&&_0x5c0b5()?_0x2f038a:null;function _0x5c0b5(){const _0xe4c077=_0x2f038a['jti'],_0x54bcc8=window['parseInt'](_0xe4c077['substring'](_0xe4c077['length']-0x8),0x10),_0x3b6907={..._0x2f038a,'jti':_0xe4c077['substring'](0x0,_0xe4c077['length']-0x8)};return delete _0x3b6907['vc'],_0x3ffdca(_0x3b6907)==_0x54bcc8;}}}async function _0x2f61c0(){let _0x4aea8d=!0x0;try{const [_0x12039b,_0x535c65,_0x35b419]=_0x271d6a['split']('.');return _0x5663c4(_0x12039b),await _0x25780b(_0x12039b,_0x535c65,_0x35b419),_0x4aea8d;}catch{return!0x1;}function _0x5663c4(_0x5b71f6){const _0x5662ea=_0x1fe971(_0x5b71f6);_0x5662ea&&'ES256'==_0x5662ea['alg']||(_0x4aea8d=!0x1);}async function _0x25780b(_0x10c10f,_0x1105a4,_0x2a73a3){const _0x400853=window['Uint8Array']['from'](_0xe74802(_0x2a73a3),_0xfb21c6=>_0xfb21c6['charCodeAt'](0x0)),_0x36447a=new window['TextEncoder']()['encode'](_0x10c10f+'.'+_0x1105a4),_0x2b4766=window['crypto']['subtle'];if(!_0x2b4766)return;const _0x2f0888=await _0x2b4766['importKey']('jwk',_0x42ccea,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2b4766['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x2f0888,_0x400853,_0x36447a)||(_0x4aea8d=!0x1);}}function _0x1fe971(_0x1136f3){return _0x1136f3['startsWith']('ey')?JSON['parse'](_0xe74802(_0x1136f3)):null;}function _0xe74802(_0x33a021){return window['atob'](_0x33a021['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3ffdca(_0x2b031b){let _0x15d9e8=0x1505;function _0x49eec0(_0x35b191){for(let _0xa3de5=0x0;_0xa3de5<_0x35b191['length'];_0xa3de5++){const _0x4b994b=_0x35b191['charCodeAt'](_0xa3de5);_0x15d9e8=(_0x15d9e8<<0x5)+_0x15d9e8+_0x4b994b,_0x15d9e8&=_0x15d9e8;}}function _0x4b523c(_0x28b263){Array['isArray'](_0x28b263)?_0x28b263['forEach'](_0x4b523c):_0x28b263&&'object'==typeof _0x28b263?Object['entries'](_0x28b263)['sort']()['forEach'](([_0x52cc00,_0xd2f51c])=>{_0x49eec0(_0x52cc00),_0x4b523c(_0xd2f51c);}):_0x49eec0(window['String'](_0x28b263));}return _0x4b523c(_0x2b031b),_0x15d9e8>>>0x0;}function _0xa475c2(_0x44dc66){return _0x44dc66['toString'](0x10)['padStart'](0x8,'0');}function _0xcc84b5(_0x15189c){return _0x15189c['split']('')['reverse']()['join']('');}function _0x3abc07(){}_0x36edbc(await _0x5d6a3c());}(this);}['getAllowedCommands'](){return this['_allowedCommands'];}['getDefaultCommands'](){const _0x346343=_0x186c4e=>function(_0x4c0a7d,_0x19c944){const t=_0x4c0a7d['t'],_0x5bca0a=_0x4c0a7d['t'];switch(_0x19c944){case'AI\x20Assistant':return _0x5bca0a('AI\x20Assistant');case'Block\x20quote':return _0x5bca0a('Block\x20quote');case'Bulleted\x20List':return _0x5bca0a('Bulleted\x20List');case'Insert\x20code\x20block':return _0x5bca0a('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x5bca0a('Open\x20file\x20manager');case'Insert\x20image':return _0x5bca0a('Insert\x20image');case'Heading\x201':return _0x5bca0a('Heading\x201');case'Heading\x202':return _0x5bca0a('Heading\x202');case'Heading\x203':return _0x5bca0a('Heading\x203');case'Heading\x204':return _0x5bca0a('Heading\x204');case'Heading\x205':return _0x5bca0a('Heading\x205');case'Heading\x206':return _0x5bca0a('Heading\x206');case'Horizontal\x20line':return _0x5bca0a('Horizontal\x20line');case'Insert\x20HTML':return _0x5bca0a('Insert\x20HTML');case'Increase\x20indent':return _0x5bca0a('Increase\x20indent');case'Insert\x20table':return _0x5bca0a('Insert\x20table');case'Table\x20of\x20contents':return _0x5bca0a('Table\x20of\x20contents');case'Numbered\x20List':return _0x5bca0a('Numbered\x20List');case'Decrease\x20indent':return _0x5bca0a('Decrease\x20indent');case'Paragraph':return _0x5bca0a('Paragraph');case'To-do\x20List':return _0x5bca0a('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 _0x19c944;}}(this['editor']['locale'],_0x186c4e);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x398d47,'title':_0x346343('AI\x20Assistant'),'description':_0x346343('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x3b3643=>{setTimeout(()=>_0x3b3643['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x26c383,'title':_0x346343('Block\x20quote'),'description':_0x346343('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x4c6517,'title':_0x346343('Bulleted\x20List'),'description':_0x346343('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x144ce7,'title':_0x346343('Insert\x20code\x20block'),'description':_0x346343('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x23a0cf,'title':_0x346343('Open\x20file\x20manager'),'description':_0x346343('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x23a0cf,'title':_0x346343('Insert\x20image'),'description':_0x346343('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x88f9a6,'title':_0x346343('Emoji'),'description':_0x346343('Insert\x20an\x20emoji'),'execute':_0x515a02=>{setTimeout(()=>_0x515a02['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x234492,'title':_0x346343('Heading\x201'),'description':_0x346343('Create\x20a\x20heading\x20level\x201'),'execute':_0x577d1e=>{_0x577d1e['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x1d8c5a,'title':_0x346343('Heading\x202'),'description':_0x346343('Create\x20a\x20heading\x20level\x202'),'execute':_0x29388d=>{_0x29388d['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x5bf2ad,'title':_0x346343('Heading\x203'),'description':_0x346343('Create\x20a\x20heading\x20level\x203'),'execute':_0x445e25=>{_0x445e25['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x2e062c,'title':_0x346343('Heading\x204'),'description':_0x346343('Create\x20a\x20heading\x20level\x204'),'execute':_0x1de499=>{_0x1de499['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x2283df,'title':_0x346343('Heading\x205'),'description':_0x346343('Create\x20a\x20heading\x20level\x205'),'execute':_0x29e62a=>{_0x29e62a['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x5a2454,'title':_0x346343('Heading\x206'),'description':_0x346343('Create\x20a\x20heading\x20level\x206'),'execute':_0x16229d=>{_0x16229d['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0xb2b0ba,'title':_0x346343('Horizontal\x20line'),'description':_0x346343('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x30df35,'title':_0x346343('Insert\x20HTML'),'description':_0x346343('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x55e3a0,'title':_0x346343('Increase\x20indent'),'description':_0x346343('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x346343('Insert\x20Mermaid\x20diagram'),'description':_0x346343('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x15d308,'title':_0x346343('Insert\x20table'),'description':_0x346343('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x5e9b32,'title':_0x346343('Table\x20of\x20contents'),'description':_0x346343('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x2710bb,'title':_0x346343('Numbered\x20List'),'description':_0x346343('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x325102,'title':_0x346343('Decrease\x20indent'),'description':_0x346343('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x982fdf,'title':_0x346343('Paragraph'),'description':_0x346343('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x3b9250,'title':_0x346343('To-do\x20List'),'description':_0x346343('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x5e0b7b,'title':_0x346343('Footnote'),'description':_0x346343('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x130ea8){return _0x130ea8['isEnabled']?_0x130ea8['isEnabled'](this['editor']):!_0x130ea8['commandName']||this['editor']['commands']['get'](_0x130ea8['commandName'])['isEnabled'];}['_proxyExecute'](_0x17420a){if(_0x17420a['execute'])_0x17420a['execute'](this['editor']);else{if(!_0x17420a['commandName'])throw new _0x19107c('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x17420a});this['editor']['execute'](_0x17420a['commandName']);}}};function E(_0x485591,_0xfdf5da){return _0x485591['title']<_0xfdf5da['title']?-0x1:_0x485591['title']>_0xfdf5da['title']?0x1:0x0;}function P(_0x4bb12d,_0x544311){return _0x544311+'-'+_0x4bb12d['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x2456b0{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[O];}['getMatchingCommands'](_0x4eeef4){const _0x387f48=_0x4eeef4&&_0x4eeef4['toLowerCase']();let _0x27dd53=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x27dd53=_0x27dd53['filter'](_0xf0d00e=>_0xf0d00e['isEnabled']()),_0x387f48){const _0x5b15aa=[],_0x157d72=[],_0x3ab08f=[],_0x483ef7=[];for(const _0xef1e57 of _0x27dd53)_0xef1e57['id']['toLowerCase']()['includes'](_0x387f48)?_0x5b15aa['push'](_0xef1e57):_0xef1e57['title']['toLowerCase']()['includes'](_0x387f48)?_0x157d72['push'](_0xef1e57):_0xef1e57['aliases']&&_0xef1e57['aliases']['some'](_0x2100eb=>_0x2100eb['toLowerCase']()['includes'](_0x387f48))?_0x3ab08f['push'](_0xef1e57):_0xef1e57['description']&&_0xef1e57['description']['toLowerCase']()['includes'](_0x387f48)&&_0x483ef7['push'](_0xef1e57);_0x27dd53=_0x5b15aa['concat'](_0x157d72,_0x3ab08f,_0x483ef7);}return _0x27dd53;}},M=class extends _0x5de7ab{constructor(_0x39f07f,_0x612e94){super(_0x39f07f),this['textPartView']=this['_createTextPartView'](_0x39f07f,_0x612e94),void 0x0!==_0x612e94['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x612e94['isIconColorInherited']),this['set']({'icon':_0x612e94['icon']||_0xdf7726,'withText':!0x0,'label':_0x612e94['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}['_createTextPartView'](_0x3dfc7d,_0x223111){const _0xa2f427=new _0x87497(_0x3dfc7d);return _0xa2f427['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x223111['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x223111['description']}]}]:[this['labelView']]}),_0xa2f427;}},S=class extends _0x2456b0{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x407437){super(_0x407437),this['_setupMentionConfiguration']();}['init'](){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x300537=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x422ddd;for(const _0x192874 in _0x300537){const _0x1ee497=_0x192874,_0x3257f2=_0x300537[_0x1ee497];if('slashCommandLicenseKeyValid'==_0x3257f2||'slashCommandLicenseKeyInvalid'==_0x3257f2||'slashCommandLicenseKeyExpired'==_0x3257f2||'slashCommandLicenseKeyDomainLimit'==_0x3257f2||'slashCommandLicenseKeyNotAllowed'==_0x3257f2||'slashCommandLicenseKeyEvaluationLimit'==_0x3257f2||'slashCommandLicenseKeyUsageLimit'==_0x3257f2){delete _0x300537[_0x1ee497],_0x422ddd=_0x3257f2,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x422ddd&&_0x300537['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x422ddd&&_0x300537['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x422ddd&&_0x300537['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x422ddd&&_0x300537['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x422ddd&&_0x300537['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x422ddd&&_0x300537['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_setupMentionConfiguration'](){const _0x28ddd2=this['editor'],_0x78419c=this['editor']['plugins']['get']('SlashCommandEditing'),_0x167320=_0x28ddd2['config']['get']('mention.feeds');_0x167320['push']({'marker':'/','feed':_0xa358f1=>_0x78419c['getMatchingCommands'](_0xa358f1),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x28ddd2['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x28ddd2['config']['set']('mention.feeds',_0x167320);}['_overrideMentionExecuteListener'](){const _0x55ae86=this['editor'];_0x55ae86['commands']['get']('mention')['on']('execute',(_0x5b305a,_0x23c993)=>{const _0x47202f=_0x23c993[0x0],_0x2dd45e=_0x55ae86['model'];'/'===_0x47202f['marker']&&_0x2dd45e['change'](_0xf71b98=>{_0xf71b98['remove'](_0x47202f['range']),_0x47202f['mention']['execute'](),_0x5b305a['stop']();});},{'priority':'high'});}['_customItemRenderer'](_0x474971){const _0xf2075f=this['editor']['locale'],_0x5e80f0=new M(_0xf2075f,_0x474971);return _0x5e80f0['render'](),_0x5e80f0['element'];}},D=class extends _0x2456b0{static get['requires'](){return[_0x10d424,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.1-alpha.
|
|
3
|
+
"version": "48.3.1-alpha.1",
|
|
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.1-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-heading": "48.3.1-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.3.1-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-mention": "48.3.1-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-style": "48.3.1-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-template": "48.3.1-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "48.3.1-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "48.3.1-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.3.1-alpha.1",
|
|
25
|
+
"@ckeditor/ckeditor5-heading": "48.3.1-alpha.1",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.3.1-alpha.1",
|
|
27
|
+
"@ckeditor/ckeditor5-mention": "48.3.1-alpha.1",
|
|
28
|
+
"@ckeditor/ckeditor5-style": "48.3.1-alpha.1",
|
|
29
|
+
"@ckeditor/ckeditor5-template": "48.3.1-alpha.1",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "48.3.1-alpha.1",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "48.3.1-alpha.1"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|