@ckeditor/ckeditor5-slash-command 48.5.0-alpha.4 → 48.5.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x4bced6}from'@ckeditor/ckeditor5-core';import{Mention as _0x57e9bd}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x2387c0,uid as _0x1e8be5}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0xe697cf,IconBulletedList as _0x56017f,IconCodeBlock as _0x291030,IconEmoji as _0x160335,IconFootnote as _0x1afee4,IconHeading1 as _0xecc64c,IconHeading2 as _0x2f378a,IconHeading3 as _0x143432,IconHeading4 as _0x13cdda,IconHeading5 as _0x524a3e,IconHeading6 as _0x14b770,IconHorizontalLine as _0xa9fc91,IconHtml as _0x4a45e4,IconIndent as _0x55a09a,IconNumberedList as _0xf43e98,IconOutdent as _0x39ad6a,IconParagraph as _0x443196,IconPlay as _0x54d864,IconQuote as _0x17eaaf,IconRobotPencil as _0x1c59cb,IconTable as _0xbd51ac,IconTableOfContents as _0x346c57,IconTodoList as _0x282313}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x46ab99,View as _0x45ceb8}from'@ckeditor/ckeditor5-ui';var O=class extends _0x4bced6{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3af248){super(_0x3af248),this['_allowedCommands']=null;}afterInit(){const _0x38bf94=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x2e6a36=function(_0x77dfcd){let _0x794b00=['heading4','heading5','heading6'];if(_0x77dfcd){const _0x18dc3c=_0x77dfcd['map'](_0x4e5d0d=>_0x4e5d0d['model']);_0x794b00=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x38f124=>!_0x18dc3c['includes'](_0x38f124));}return _0x794b00;}(this['editor']['config']['get']('heading.options'));let _0x333110=this['getDefaultCommands']()['filter'](_0xe1ced2=>!_0x2e6a36['includes'](_0xe1ced2['id']))['filter'](_0x269279=>!_0x38bf94['includes'](_0x269279['commandName']));const _0x344eaa=this['editor']['config']['get']('slashCommand.extraCommands');_0x344eaa&&_0x344eaa['length']&&(_0x333110=_0x333110['concat'](_0x344eaa));const _0x344f15=this['editor']['config']['get']('template.definitions');_0x344f15&&_0x344f15['length']&&(_0x333110=_0x333110['concat'](function(_0x5e9fc9){return _0x5e9fc9['map'](_0x25d692=>{const {title:_0x522ac3,icon:_0x2596e9,description:_0xb6c950,data:_0x3ca1ac}=_0x25d692,_0x5c9eb0={'id':P(_0x522ac3,'template'),'commandName':'insertTemplate','execute':_0x4a938b=>{_0x4a938b['execute']('insertTemplate',_0x3ca1ac);},'description':_0xb6c950,'icon':_0x2596e9,'title':_0x522ac3};return _0x2596e9&&(_0x5c9eb0['isIconColorInherited']=!0x1),_0x5c9eb0;});}(_0x344f15)));const _0x5e5137=this['editor']['config']['get']('style.definitions');_0x5e5137&&_0x5e5137['length']&&(_0x333110=_0x333110['concat'](function(_0x9914e1){return _0x9914e1['map'](_0x513117=>({'id':P(_0x513117['name'],'style'),'commandName':'style','execute':_0x23a515=>{_0x23a515['execute']('style',{'styleName':_0x513117['name']});},'isEnabled':_0x51c97c=>{const _0x557e9c=_0x51c97c['commands']['get']('style');return _0x557e9c['isEnabled']&&_0x557e9c['enabledStyles']['includes'](_0x513117['name']);},'title':_0x513117['name']}));}(_0x5e5137)));const _0x2985b5=_0x333110['filter'](_0x452a55=>!_0x452a55['commandName']||void 0x0!==this['editor']['commands']['get'](_0x452a55['commandName'])),_0x19bacd=[];for(const _0x261e07 of _0x2985b5)_0x19bacd['push']({'id':_0x261e07['id'],'commandName':_0x261e07['commandName'],'title':'function'==typeof _0x261e07['title']?_0x261e07['title'](this['editor']):_0x261e07['title'],'description':_0x261e07['description'],'icon':_0x261e07['icon'],'isIconColorInherited':_0x261e07['isIconColorInherited'],'aliases':_0x261e07['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x261e07),'execute':()=>this['_proxyExecute'](_0x261e07)});this['_allowedCommands']=_0x19bacd['sort'](E),async function(_0x5c70d0){const _0x4af695='5goNZRxHzmBfrl0Fq6Cks1ahDGS2LUEWiby3wKvu4IVPdeT8jn9MOQJtcAY7Xp',_0x4378b5=0x79428,_0x2499ba={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x1284ad(_0x2b5ef8){const _0x1d5527=new window['Promise'](_0x281463=>{_0x2b5ef8['once']('ready',_0x281463);}),_0x3a03f3=window['Date']['now'](),_0xc349fa=_0x2b5ef8['config']['get']('licenseKey');async function _0x531678(){let _0x3ca0ef,_0x2a96d1=null,_0x1f355a=null;try{return'GPL'==_0xc349fa?'NotAllowed':(_0x3ca0ef=_0x3f78ec(),_0x3ca0ef?(_0x3ca0ef['usageEndpoint']&&(_0x1f355a=_0x431afd(_0x3ca0ef['usageEndpoint'],_0x3ca0ef['jti'])),await _0x53097a()?_0x418e54()?_0x13b422()?'Expired':_0x1d2f42()?('evaluation'==_0x3ca0ef['licenseType']&&(_0x2a96d1=_0x1c52b2('EvaluationLimit')),await _0x19833f()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x13b422(){const _0x4f7fae=['evaluation','trial']['includes'](_0x3ca0ef['licenseType'])?_0x3a03f3/0x3e8:0xe10*_0x4378b5;return _0x3ca0ef['exp']<_0x4f7fae;}function _0x418e54(){const _0x59b6e3=_0x3ca0ef['features'];return!!_0x59b6e3&&(!!_0x59b6e3['includes']('*')||(!!_0x59b6e3['includes']('SC')||(!!_0x59b6e3['includes']('PP')||!(!_0x59b6e3['includes']('TRILIUM')||!_0xc19a5d()))));}function _0x1d2f42(){const _0x4a4cf6=_0x3ca0ef['licensedHosts'];if(!_0x4a4cf6||0x0==_0x4a4cf6['length'])return!0x0;const {hostname:_0x4fdeed}=new URL(window['location']['href']);if(_0x4a4cf6['includes'](_0x4fdeed))return!0x0;const _0x5be98d=_0x4fdeed['split']('.');return _0x4a4cf6['filter'](_0x24c7d9=>_0x24c7d9['includes']('*'))['map'](_0x4b5180=>_0x4b5180['split']('.'))['filter'](_0x1f9d51=>_0x1f9d51['length']<=_0x5be98d['length'])['map'](_0x5d8485=>Array(_0x5be98d['length']-_0x5d8485['length'])['fill']('*'===_0x5d8485[0x0]?'*':'')['concat'](_0x5d8485))['some'](_0x1cac54=>_0x5be98d['every']((_0x3a6fc3,_0x2b8ac6)=>_0x1cac54[_0x2b8ac6]===_0x3a6fc3||'*'===_0x1cac54[_0x2b8ac6]));}function _0x19833f(){return _0x2a96d1&&_0x1f355a?new window['Promise']((_0x1b9699,_0x2fa275)=>{_0x2a96d1['then'](_0x1b9699,_0x2fa275),_0x1f355a['then'](_0x276aba=>{'Valid'!=_0x276aba&&_0x1b9699(_0x276aba);},_0x2fa275);}):_0x2a96d1||_0x1f355a||'Valid';}}function _0x431afd(_0x34c117,_0xe3745a){return new window['Promise'](_0x187b0c=>{if(_0x4439eb())return _0x187b0c('Valid');_0x1953ff(),_0x2b5ef8['decorate']('_sendUsageRequest');let _0xb89f76=!0x1;const _0x483802=_0x1e8be5();function _0x5f5878(_0x373588){return!!_0x373588&&('object'==typeof _0x373588||'function'==typeof _0x373588)&&'function'==typeof _0x373588['then']&&'function'==typeof _0x373588['catch'];}function _0x43d5c7(_0x22806b){_0x360d51(_0x22806b)['then'](_0x1cb063=>_0x1cb063&&'ok'==_0x1cb063['status']?_0x5a5e5c(_0x396ca6(_0x483802+_0xe3745a))!=_0x1cb063['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x22aa45=>(_0x4e923d(),_0x22aa45),()=>{const _0x399664=_0x5e4654();return null==_0x399664?(_0x4e923d(),'Valid'):_0x3a03f3-_0x399664>0x240c8400?'UsageLimit':'Valid';})['then'](_0x187b0c)['catch'](()=>{_0x187b0c('UsageLimit');});const _0x582779=0x36ee80;function _0x4e923d(){const _0x54e1f0='llct-'+_0x5a5e5c(_0x396ca6(_0x34c117)),_0x55135c=_0x2374d6(_0x5a5e5c(window['Math']['ceil'](_0x3a03f3/_0x582779)));window['localStorage']['setItem'](_0x54e1f0,_0x55135c);}function _0x5e4654(){const _0x408b64='llct-'+_0x5a5e5c(_0x396ca6(_0x34c117)),_0x3a5f43=window['localStorage']['getItem'](_0x408b64);return _0x3a5f43?window['parseInt'](_0x2374d6(_0x3a5f43),0x10)*_0x582779:null;}function _0x360d51(_0x296640){return new window['Promise']((_0x2bf57d,_0xb512f2)=>{_0x296640['then'](_0x2bf57d,_0xb512f2),window['setTimeout'](_0xb512f2,0x1d4c0);});}}_0x2b5ef8['on']('_sendUsageRequest',(_0x2cacb5,_0x53b39b)=>{if(_0x53b39b[0x0]!=_0x34c117)return _0x187b0c('UsageLimit');_0x53b39b[0x1]={..._0x53b39b[0x1],'requestId':_0x483802};},{'priority':'high'}),_0x2b5ef8['on']('_sendUsageRequest',_0x21241d=>{_0x5f5878(_0x21241d['return'])&&(_0xb89f76=!0x0,_0x43d5c7(_0x21241d['return']));},{'priority':'low'}),_0x1d5527['then'](()=>{_0xb89f76||_0x187b0c('UsageLimit');});});function _0x4439eb(){return'auto'==_0x2b5ef8['editing']['view']['_overlayModeHint'];}function _0x1953ff(){_0x2b5ef8['editing']['view']['_overlayModeHint']='auto';}}function _0x1c52b2(_0x3f9af1){const _0x1cb1c7=[new window['Promise'](_0x5d1d90=>setTimeout(_0x5d1d90,0x93ecc)),_0x1d5527['then'](()=>new window['Promise'](_0x38bc74=>{let _0xa6cb24=0x0;_0x2b5ef8['model']['on']('applyOperation',(_0x7ccaf5,_0x4eecf8)=>{_0x4eecf8[0x0]['isDocumentOperation']&&_0xa6cb24++,0x5e8==_0xa6cb24&&(_0x38bc74(),_0x7ccaf5['off']());});}))];return window['Promise']['race'](_0x1cb1c7)['then'](()=>_0x3f9af1);}async function _0x594d37(){await _0x1d5527,_0x2b5ef8['model']['change']=_0x203b03,_0x2b5ef8['model']['enqueueChange']=_0x203b03,_0x2b5ef8['enableReadOnlyMode']('model');}function _0xc19a5d(){return window['glob']&&window['glob']['triliumVersion'];}function _0x11b6bf(_0x1f3ca1){const _0x4dd7be=_0x23ee1f();_0x2b5ef8[_0x4dd7be]='slashCommandLicenseKey'+_0x1f3ca1,'Valid'!=_0x1f3ca1&&_0x594d37();}function _0x23ee1f(){const _0x27b441=window['String'](window['performance']['now']())['replace']('.','');let _0x28ed6e='g';for(let _0x2a6eac=0x0;_0x2a6eac<_0x27b441['length'];_0x2a6eac+=0x2){let _0x38a85b=window['parseInt'](_0x27b441['substring'](_0x2a6eac,_0x2a6eac+0x2));_0x38a85b>=0x3e&&(_0x38a85b-=0x3e),_0x28ed6e+=_0x4af695[_0x38a85b];}return _0x28ed6e;}function _0x3f78ec(){const _0x24ea17=_0xc349fa['split']('.');if(0x3!=_0x24ea17['length'])return null;return _0x49b685(_0x24ea17[0x1]);function _0x49b685(_0x4950e8){const _0x4133a9=_0x453946(_0x4950e8);return _0x4133a9&&_0x4fb40b()?_0x4133a9:null;function _0x4fb40b(){const _0x27ffcb=_0x4133a9['jti'],_0x40994c=window['parseInt'](_0x27ffcb['substring'](_0x27ffcb['length']-0x8),0x10),_0x48d270={..._0x4133a9,'jti':_0x27ffcb['substring'](0x0,_0x27ffcb['length']-0x8)};return delete _0x48d270['vc'],_0x396ca6(_0x48d270)==_0x40994c;}}}async function _0x53097a(){let _0xb5fbca=!0x0;try{const [_0x1de83a,_0xc2b3d8,_0x4af9d2]=_0xc349fa['split']('.');return _0x2548d3(_0x1de83a),await _0x3e3eae(_0x1de83a,_0xc2b3d8,_0x4af9d2),_0xb5fbca;}catch{return!0x1;}function _0x2548d3(_0x5f1e0c){const _0x141400=_0x453946(_0x5f1e0c);_0x141400&&'ES256'==_0x141400['alg']||(_0xb5fbca=!0x1);}async function _0x3e3eae(_0x24ef08,_0x4c775c,_0x4460bd){const _0x5e8a5c=window['Uint8Array']['from'](_0x2ab9fa(_0x4460bd),_0x47aff5=>_0x47aff5['charCodeAt'](0x0)),_0x5b3433=new window['TextEncoder']()['encode'](_0x24ef08+'.'+_0x4c775c),_0x3f5756=window['crypto']['subtle'];if(!_0x3f5756)return;const _0xd1d46d=await _0x3f5756['importKey']('jwk',_0x2499ba,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3f5756['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xd1d46d,_0x5e8a5c,_0x5b3433)||(_0xb5fbca=!0x1);}}function _0x453946(_0x2d5d7c){return _0x2d5d7c['startsWith']('ey')?JSON['parse'](_0x2ab9fa(_0x2d5d7c)):null;}function _0x2ab9fa(_0x5eb46a){return window['atob'](_0x5eb46a['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x396ca6(_0x3f25de){let _0x4ce64d=0x1505;function _0x4af04a(_0x1eb463){for(let _0x3f1aa6=0x0;_0x3f1aa6<_0x1eb463['length'];_0x3f1aa6++){const _0x58bf22=_0x1eb463['charCodeAt'](_0x3f1aa6);_0x4ce64d=(_0x4ce64d<<0x5)+_0x4ce64d+_0x58bf22,_0x4ce64d&=_0x4ce64d;}}function _0x52db41(_0x24da11){Array['isArray'](_0x24da11)?_0x24da11['forEach'](_0x52db41):_0x24da11&&'object'==typeof _0x24da11?Object['entries'](_0x24da11)['sort']()['forEach'](([_0x5dd35e,_0x11054c])=>{_0x4af04a(_0x5dd35e),_0x52db41(_0x11054c);}):_0x4af04a(window['String'](_0x24da11));}return _0x52db41(_0x3f25de),_0x4ce64d>>>0x0;}function _0x5a5e5c(_0x5d6ba5){return _0x5d6ba5['toString'](0x10)['padStart'](0x8,'0');}function _0x2374d6(_0x3e65d5){return _0x3e65d5['split']('')['reverse']()['join']('');}function _0x203b03(){}_0x11b6bf(await _0x531678());}_0x1284ad(_0x5c70d0['editor']);}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x243881=_0x286ecc=>function(_0x91217,_0x1648ef){const t=_0x91217['t'],_0x5528c9=_0x91217['t'];switch(_0x1648ef){case'AI\x20Assistant':return _0x5528c9('AI\x20Assistant');case'Block\x20quote':return _0x5528c9('Block\x20quote');case'Bulleted\x20List':return _0x5528c9('Bulleted\x20List');case'Insert\x20code\x20block':return _0x5528c9('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x5528c9('Open\x20file\x20manager');case'Insert\x20image':return _0x5528c9('Insert\x20image');case'Heading\x201':return _0x5528c9('Heading\x201');case'Heading\x202':return _0x5528c9('Heading\x202');case'Heading\x203':return _0x5528c9('Heading\x203');case'Heading\x204':return _0x5528c9('Heading\x204');case'Heading\x205':return _0x5528c9('Heading\x205');case'Heading\x206':return _0x5528c9('Heading\x206');case'Horizontal\x20line':return _0x5528c9('Horizontal\x20line');case'Insert\x20HTML':return _0x5528c9('Insert\x20HTML');case'Increase\x20indent':return _0x5528c9('Increase\x20indent');case'Insert\x20table':return _0x5528c9('Insert\x20table');case'Table\x20of\x20contents':return _0x5528c9('Table\x20of\x20contents');case'Numbered\x20List':return _0x5528c9('Numbered\x20List');case'Decrease\x20indent':return _0x5528c9('Decrease\x20indent');case'Paragraph':return _0x5528c9('Paragraph');case'To-do\x20List':return _0x5528c9('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 _0x1648ef;}}(this['editor']['locale'],_0x286ecc);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x1c59cb,'title':_0x243881('AI\x20Assistant'),'description':_0x243881('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x36075e=>{setTimeout(()=>_0x36075e['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x17eaaf,'title':_0x243881('Block\x20quote'),'description':_0x243881('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x56017f,'title':_0x243881('Bulleted\x20List'),'description':_0x243881('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x291030,'title':_0x243881('Insert\x20code\x20block'),'description':_0x243881('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0xe697cf,'title':_0x243881('Open\x20file\x20manager'),'description':_0x243881('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0xe697cf,'title':_0x243881('Insert\x20image'),'description':_0x243881('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x160335,'title':_0x243881('Emoji'),'description':_0x243881('Insert\x20an\x20emoji'),'execute':_0x45fb07=>{setTimeout(()=>_0x45fb07['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0xecc64c,'title':_0x243881('Heading\x201'),'description':_0x243881('Create\x20a\x20heading\x20level\x201'),'execute':_0x1f5f31=>{_0x1f5f31['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x2f378a,'title':_0x243881('Heading\x202'),'description':_0x243881('Create\x20a\x20heading\x20level\x202'),'execute':_0x1041e6=>{_0x1041e6['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x143432,'title':_0x243881('Heading\x203'),'description':_0x243881('Create\x20a\x20heading\x20level\x203'),'execute':_0x386c62=>{_0x386c62['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x13cdda,'title':_0x243881('Heading\x204'),'description':_0x243881('Create\x20a\x20heading\x20level\x204'),'execute':_0xa3ac01=>{_0xa3ac01['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x524a3e,'title':_0x243881('Heading\x205'),'description':_0x243881('Create\x20a\x20heading\x20level\x205'),'execute':_0x21d6b1=>{_0x21d6b1['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x14b770,'title':_0x243881('Heading\x206'),'description':_0x243881('Create\x20a\x20heading\x20level\x206'),'execute':_0x5f503e=>{_0x5f503e['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0xa9fc91,'title':_0x243881('Horizontal\x20line'),'description':_0x243881('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x4a45e4,'title':_0x243881('Insert\x20HTML'),'description':_0x243881('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x55a09a,'title':_0x243881('Increase\x20indent'),'description':_0x243881('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x243881('Insert\x20Mermaid\x20diagram'),'description':_0x243881('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0xbd51ac,'title':_0x243881('Insert\x20table'),'description':_0x243881('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x346c57,'title':_0x243881('Table\x20of\x20contents'),'description':_0x243881('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0xf43e98,'title':_0x243881('Numbered\x20List'),'description':_0x243881('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x39ad6a,'title':_0x243881('Decrease\x20indent'),'description':_0x243881('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x443196,'title':_0x243881('Paragraph'),'description':_0x243881('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x282313,'title':_0x243881('To-do\x20List'),'description':_0x243881('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x1afee4,'title':_0x243881('Footnote'),'description':_0x243881('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x18764b){return _0x18764b['isEnabled']?_0x18764b['isEnabled'](this['editor']):!_0x18764b['commandName']||this['editor']['commands']['get'](_0x18764b['commandName'])['isEnabled'];}_proxyExecute(_0x4265c5){if(_0x4265c5['execute'])_0x4265c5['execute'](this['editor']);else{if(!_0x4265c5['commandName'])throw new _0x2387c0('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x4265c5});this['editor']['execute'](_0x4265c5['commandName']);}}};function E(_0x57dd8f,_0x4192fd){return _0x57dd8f['title']<_0x4192fd['title']?-0x1:_0x57dd8f['title']>_0x4192fd['title']?0x1:0x0;}function P(_0x44550e,_0x5d0d4d){return _0x5d0d4d+'-'+_0x44550e['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x4bced6{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x40a111){const _0x21dba4=_0x40a111&&_0x40a111['toLowerCase']();let _0x334952=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x334952=_0x334952['filter'](_0x4fec3b=>_0x4fec3b['isEnabled']()),_0x21dba4){const _0x42ed00=[],_0x537653=[],_0x11d913=[],_0x51c29c=[];for(const _0x519a0c of _0x334952)_0x519a0c['id']['toLowerCase']()['includes'](_0x21dba4)?_0x42ed00['push'](_0x519a0c):_0x519a0c['title']['toLowerCase']()['includes'](_0x21dba4)?_0x537653['push'](_0x519a0c):_0x519a0c['aliases']&&_0x519a0c['aliases']['some'](_0x3ba008=>_0x3ba008['toLowerCase']()['includes'](_0x21dba4))?_0x11d913['push'](_0x519a0c):_0x519a0c['description']&&_0x519a0c['description']['toLowerCase']()['includes'](_0x21dba4)&&_0x51c29c['push'](_0x519a0c);_0x334952=_0x42ed00['concat'](_0x537653,_0x11d913,_0x51c29c);}return _0x334952;}},M=class extends _0x46ab99{constructor(_0x217715,_0x4cf999){super(_0x217715),this['textPartView']=this['_createTextPartView'](_0x217715,_0x4cf999),void 0x0!==_0x4cf999['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x4cf999['isIconColorInherited']),this['set']({'icon':_0x4cf999['icon']||_0x54d864,'withText':!0x0,'label':_0x4cf999['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0x588f72,_0x349e57){const _0x1a206f=new _0x45ceb8(_0x588f72);return _0x1a206f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x349e57['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x349e57['description']}]}]:[this['labelView']]}),_0x1a206f;}},S=class extends _0x4bced6{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x37161f){super(_0x37161f),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x406f0b=[this['editor']];for(const _0x3f6976 of _0x406f0b){let _0x531874;for(const _0x47470c in _0x3f6976){const _0x3b07e3=_0x47470c,_0x2136e6=_0x3f6976[_0x3b07e3];if('slashCommandLicenseKeyValid'==_0x2136e6||'slashCommandLicenseKeyInvalid'==_0x2136e6||'slashCommandLicenseKeyExpired'==_0x2136e6||'slashCommandLicenseKeyDomainLimit'==_0x2136e6||'slashCommandLicenseKeyNotAllowed'==_0x2136e6||'slashCommandLicenseKeyEvaluationLimit'==_0x2136e6||'slashCommandLicenseKeyUsageLimit'==_0x2136e6){delete _0x3f6976[_0x3b07e3],_0x531874=_0x2136e6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x531874&&_0x3f6976['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x531874&&_0x3f6976['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x531874&&_0x3f6976['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x531874&&_0x3f6976['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x531874&&_0x3f6976['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x531874&&_0x3f6976['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x4d7346=this['editor'],_0x48ff18=this['editor']['plugins']['get']('SlashCommandEditing'),_0x510724=_0x4d7346['config']['get']('mention.feeds');_0x510724['push']({'marker':'/','feed':_0x311462=>_0x48ff18['getMatchingCommands'](_0x311462),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x4d7346['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x4d7346['config']['set']('mention.feeds',_0x510724);}_overrideMentionExecuteListener(){const _0x427683=this['editor'];_0x427683['commands']['get']('mention')['on']('execute',(_0x33f521,_0x578835)=>{const _0x1d3203=_0x578835[0x0],_0x5b56a7=_0x427683['model'];'/'===_0x1d3203['marker']&&_0x5b56a7['change'](_0x2cf56e=>{_0x2cf56e['remove'](_0x1d3203['range']),_0x1d3203['mention']['execute'](),_0x33f521['stop']();});},{'priority':'high'});}_customItemRenderer(_0x581904){const _0x3a1ae3=this['editor']['locale'],_0x2dc01f=new M(_0x3a1ae3,_0x581904);return _0x2dc01f['render'](),_0x2dc01f['element'];}},D=class extends _0x4bced6{static get requires(){return[_0x57e9bd,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 _0x2527f2}from'@ckeditor/ckeditor5-core';import{Mention as _0x3ea01f}from'@ckeditor/ckeditor5-mention';import{CKEditorError as _0x46af5e,uid as _0x5e9947}from'@ckeditor/ckeditor5-utils';import{IconBrowseFiles as _0x2bbdc8,IconBulletedList as _0x49330a,IconCodeBlock as _0x4034fc,IconEmoji as _0x3c37ef,IconFootnote as _0x240a37,IconHeading1 as _0x5383df,IconHeading2 as _0x7001d,IconHeading3 as _0x33c6fe,IconHeading4 as _0x5527e2,IconHeading5 as _0x5644e0,IconHeading6 as _0x2c5add,IconHorizontalLine as _0x2e03e3,IconHtml as _0x5d035d,IconIndent as _0xffb2df,IconNumberedList as _0x18c521,IconOutdent as _0x5e4dfa,IconParagraph as _0x580df5,IconPlay as _0x5dc559,IconQuote as _0x479f39,IconRobotPencil as _0x194acb,IconTable as _0x6db9d,IconTableOfContents as _0x5801c8,IconTodoList as _0x17979b}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x28c9d5,View as _0x13ff31}from'@ckeditor/ckeditor5-ui';var O=class extends _0x2527f2{static get['pluginName'](){return'SlashCommandConfig';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50292e){super(_0x50292e),this['_allowedCommands']=null;}afterInit(){const _0x2a6869=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x815baa=function(_0x177a42){let _0x22703e=['heading4','heading5','heading6'];if(_0x177a42){const _0x10cb98=_0x177a42['map'](_0x2550b8=>_0x2550b8['model']);_0x22703e=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x4b0fae=>!_0x10cb98['includes'](_0x4b0fae));}return _0x22703e;}(this['editor']['config']['get']('heading.options'));let _0x5c3ed3=this['getDefaultCommands']()['filter'](_0x518eaa=>!_0x815baa['includes'](_0x518eaa['id']))['filter'](_0xceaf18=>!_0x2a6869['includes'](_0xceaf18['commandName']));const _0x560c74=this['editor']['config']['get']('slashCommand.extraCommands');_0x560c74&&_0x560c74['length']&&(_0x5c3ed3=_0x5c3ed3['concat'](_0x560c74));const _0x2c5765=this['editor']['config']['get']('template.definitions');_0x2c5765&&_0x2c5765['length']&&(_0x5c3ed3=_0x5c3ed3['concat'](function(_0x201669){return _0x201669['map'](_0x46f634=>{const {title:_0x3f1776,icon:_0x1d0df2,description:_0xf60849,data:_0x1ee3b6}=_0x46f634,_0x484794={'id':P(_0x3f1776,'template'),'commandName':'insertTemplate','execute':_0x4aedde=>{_0x4aedde['execute']('insertTemplate',_0x1ee3b6);},'description':_0xf60849,'icon':_0x1d0df2,'title':_0x3f1776};return _0x1d0df2&&(_0x484794['isIconColorInherited']=!0x1),_0x484794;});}(_0x2c5765)));const _0x594c2f=this['editor']['config']['get']('style.definitions');_0x594c2f&&_0x594c2f['length']&&(_0x5c3ed3=_0x5c3ed3['concat'](function(_0x3ee190){return _0x3ee190['map'](_0x5ef4eb=>({'id':P(_0x5ef4eb['name'],'style'),'commandName':'style','execute':_0x359cef=>{_0x359cef['execute']('style',{'styleName':_0x5ef4eb['name']});},'isEnabled':_0x2bd675=>{const _0x318ee6=_0x2bd675['commands']['get']('style');return _0x318ee6['isEnabled']&&_0x318ee6['enabledStyles']['includes'](_0x5ef4eb['name']);},'title':_0x5ef4eb['name']}));}(_0x594c2f)));const _0x413b6d=_0x5c3ed3['filter'](_0x37faf3=>!_0x37faf3['commandName']||void 0x0!==this['editor']['commands']['get'](_0x37faf3['commandName'])),_0x3267d9=[];for(const _0x443544 of _0x413b6d)_0x3267d9['push']({'id':_0x443544['id'],'commandName':_0x443544['commandName'],'title':'function'==typeof _0x443544['title']?_0x443544['title'](this['editor']):_0x443544['title'],'description':_0x443544['description'],'icon':_0x443544['icon'],'isIconColorInherited':_0x443544['isIconColorInherited'],'aliases':_0x443544['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x443544),'execute':()=>this['_proxyExecute'](_0x443544)});this['_allowedCommands']=_0x3267d9['sort'](E),async function(_0x33987c){const _0x74973='5goNZRxHzmBfrl0Fq6Cks1ahDGS2LUEWiby3wKvu4IVPdeT8jn9MOQJtcAY7Xp',_0x46e40d=0x79440,_0x415f47={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x248531(_0x1ab258){const _0x2d053d=new window['Promise'](_0x4fffb4=>{_0x1ab258['once']('ready',_0x4fffb4);}),_0x413ea9=window['Date']['now'](),_0x37a286=_0x1ab258['config']['get']('licenseKey');async function _0x934cc1(){let _0x14791a,_0x144ca6=null,_0x4d0b21=null;try{return'GPL'==_0x37a286?'NotAllowed':(_0x14791a=_0x1f7178(),_0x14791a?(_0x14791a['usageEndpoint']&&(_0x4d0b21=_0x4475a0(_0x14791a['usageEndpoint'],_0x14791a['jti'])),await _0x408080()?_0x26c020()?_0x12a32c()?'Expired':_0x479f54()?('evaluation'==_0x14791a['licenseType']&&(_0x144ca6=_0x430640('EvaluationLimit')),await _0x348565()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x12a32c(){const _0x5b93d3=['evaluation','trial']['includes'](_0x14791a['licenseType'])?_0x413ea9/0x3e8:0xe10*_0x46e40d;return _0x14791a['exp']<_0x5b93d3;}function _0x26c020(){const _0x1ebe9f=_0x14791a['features'];return!!_0x1ebe9f&&(!!_0x1ebe9f['includes']('*')||(!!_0x1ebe9f['includes']('SC')||(!!_0x1ebe9f['includes']('PP')||!(!_0x1ebe9f['includes']('TRILIUM')||!_0x222178()))));}function _0x479f54(){const _0xcc0fa4=_0x14791a['licensedHosts'];if(!_0xcc0fa4||0x0==_0xcc0fa4['length'])return!0x0;const {hostname:_0xe19ce3}=new URL(window['location']['href']);if(_0xcc0fa4['includes'](_0xe19ce3))return!0x0;const _0x1fc469=_0xe19ce3['split']('.');return _0xcc0fa4['filter'](_0x5f1378=>_0x5f1378['includes']('*'))['map'](_0x160e72=>_0x160e72['split']('.'))['filter'](_0x15c457=>_0x15c457['length']<=_0x1fc469['length'])['map'](_0x31cec6=>Array(_0x1fc469['length']-_0x31cec6['length'])['fill']('*'===_0x31cec6[0x0]?'*':'')['concat'](_0x31cec6))['some'](_0x1dd8ad=>_0x1fc469['every']((_0x2d64e8,_0x2dbcbd)=>_0x1dd8ad[_0x2dbcbd]===_0x2d64e8||'*'===_0x1dd8ad[_0x2dbcbd]));}function _0x348565(){return _0x144ca6&&_0x4d0b21?new window['Promise']((_0x1d8a87,_0x20060b)=>{_0x144ca6['then'](_0x1d8a87,_0x20060b),_0x4d0b21['then'](_0x3a14b3=>{'Valid'!=_0x3a14b3&&_0x1d8a87(_0x3a14b3);},_0x20060b);}):_0x144ca6||_0x4d0b21||'Valid';}}function _0x4475a0(_0x462da5,_0x6f52a9){return new window['Promise'](_0x676326=>{if(_0x114c4a())return _0x676326('Valid');_0x127d9a(),_0x1ab258['decorate']('_sendUsageRequest');let _0x16c771=!0x1;const _0x56eaba=_0x5e9947();function _0x28b1dd(_0x4f10fd){return!!_0x4f10fd&&('object'==typeof _0x4f10fd||'function'==typeof _0x4f10fd)&&'function'==typeof _0x4f10fd['then']&&'function'==typeof _0x4f10fd['catch'];}function _0x33fef7(_0x3b5d61){_0x404b32(_0x3b5d61)['then'](_0x1059c4=>_0x1059c4&&'ok'==_0x1059c4['status']?_0x4e2650(_0x97e85d(_0x56eaba+_0x6f52a9))!=_0x1059c4['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3992b1=>(_0x513d7a(),_0x3992b1),()=>{const _0x46dee8=_0x32e2ac();return null==_0x46dee8?(_0x513d7a(),'Valid'):_0x413ea9-_0x46dee8>0x240c8400?'UsageLimit':'Valid';})['then'](_0x676326)['catch'](()=>{_0x676326('UsageLimit');});const _0x5e78ad=0x36ee80;function _0x513d7a(){const _0x33f566='llct-'+_0x4e2650(_0x97e85d(_0x462da5)),_0x30f6a9=_0x4c4450(_0x4e2650(window['Math']['ceil'](_0x413ea9/_0x5e78ad)));window['localStorage']['setItem'](_0x33f566,_0x30f6a9);}function _0x32e2ac(){const _0x5d70cd='llct-'+_0x4e2650(_0x97e85d(_0x462da5)),_0x2d11ec=window['localStorage']['getItem'](_0x5d70cd);return _0x2d11ec?window['parseInt'](_0x4c4450(_0x2d11ec),0x10)*_0x5e78ad:null;}function _0x404b32(_0x1f3426){return new window['Promise']((_0x2c1b5b,_0x3f280e)=>{_0x1f3426['then'](_0x2c1b5b,_0x3f280e),window['setTimeout'](_0x3f280e,0x1d4c0);});}}_0x1ab258['on']('_sendUsageRequest',(_0x3e054d,_0x27df29)=>{if(_0x27df29[0x0]!=_0x462da5)return _0x676326('UsageLimit');_0x27df29[0x1]={..._0x27df29[0x1],'requestId':_0x56eaba};},{'priority':'high'}),_0x1ab258['on']('_sendUsageRequest',_0x4b8e72=>{_0x28b1dd(_0x4b8e72['return'])&&(_0x16c771=!0x0,_0x33fef7(_0x4b8e72['return']));},{'priority':'low'}),_0x2d053d['then'](()=>{_0x16c771||_0x676326('UsageLimit');});});function _0x114c4a(){return'auto'==_0x1ab258['editing']['view']['_overlayModeHint'];}function _0x127d9a(){_0x1ab258['editing']['view']['_overlayModeHint']='auto';}}function _0x430640(_0x4c3f65){const _0x57df81=[new window['Promise'](_0xb850b4=>setTimeout(_0xb850b4,0x93ecc)),_0x2d053d['then'](()=>new window['Promise'](_0x1ff81d=>{let _0x5c771d=0x0;_0x1ab258['model']['on']('applyOperation',(_0x5c4fc2,_0x49d316)=>{_0x49d316[0x0]['isDocumentOperation']&&_0x5c771d++,0x5e8==_0x5c771d&&(_0x1ff81d(),_0x5c4fc2['off']());});}))];return window['Promise']['race'](_0x57df81)['then'](()=>_0x4c3f65);}async function _0x2ca8ca(){await _0x2d053d,_0x1ab258['model']['change']=_0x559e68,_0x1ab258['model']['enqueueChange']=_0x559e68,_0x1ab258['enableReadOnlyMode']('model');}function _0x222178(){return window['glob']&&window['glob']['triliumVersion'];}function _0xf863ec(_0x3f1529){const _0x436b27=_0x1f5d7b();_0x1ab258[_0x436b27]='slashCommandLicenseKey'+_0x3f1529,'Valid'!=_0x3f1529&&_0x2ca8ca();}function _0x1f5d7b(){const _0x2ea913=window['String'](window['performance']['now']())['replace']('.','');let _0x37f69c='g';for(let _0x20a200=0x0;_0x20a200<_0x2ea913['length'];_0x20a200+=0x2){let _0x324b96=window['parseInt'](_0x2ea913['substring'](_0x20a200,_0x20a200+0x2));_0x324b96>=0x3e&&(_0x324b96-=0x3e),_0x37f69c+=_0x74973[_0x324b96];}return _0x37f69c;}function _0x1f7178(){const _0x57cc47=_0x37a286['split']('.');if(0x3!=_0x57cc47['length'])return null;return _0x278c25(_0x57cc47[0x1]);function _0x278c25(_0x1c8cfb){const _0x17ce58=_0x44dab8(_0x1c8cfb);return _0x17ce58&&_0x4ba729()?_0x17ce58:null;function _0x4ba729(){const _0x4396a0=_0x17ce58['jti'],_0x24fe2e=window['parseInt'](_0x4396a0['substring'](_0x4396a0['length']-0x8),0x10),_0x7cff02={..._0x17ce58,'jti':_0x4396a0['substring'](0x0,_0x4396a0['length']-0x8)};return delete _0x7cff02['vc'],_0x97e85d(_0x7cff02)==_0x24fe2e;}}}async function _0x408080(){let _0xda09e0=!0x0;try{const [_0x398bcd,_0x5161bb,_0x2e3864]=_0x37a286['split']('.');return _0x246b96(_0x398bcd),await _0x1f94bf(_0x398bcd,_0x5161bb,_0x2e3864),_0xda09e0;}catch{return!0x1;}function _0x246b96(_0x384ddd){const _0x389a0f=_0x44dab8(_0x384ddd);_0x389a0f&&'ES256'==_0x389a0f['alg']||(_0xda09e0=!0x1);}async function _0x1f94bf(_0x56e455,_0x37fbfe,_0x4cd006){const _0x14feca=window['Uint8Array']['from'](_0x169382(_0x4cd006),_0x10274e=>_0x10274e['charCodeAt'](0x0)),_0xb9415f=new window['TextEncoder']()['encode'](_0x56e455+'.'+_0x37fbfe),_0xac40e4=window['crypto']['subtle'];if(!_0xac40e4)return;const _0x3c1c38=await _0xac40e4['importKey']('jwk',_0x415f47,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0xac40e4['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3c1c38,_0x14feca,_0xb9415f)||(_0xda09e0=!0x1);}}function _0x44dab8(_0x46946f){return _0x46946f['startsWith']('ey')?JSON['parse'](_0x169382(_0x46946f)):null;}function _0x169382(_0x472804){return window['atob'](_0x472804['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x97e85d(_0x3eef32){let _0x446b42=0x1505;function _0x11967a(_0x21f662){for(let _0x2c15ae=0x0;_0x2c15ae<_0x21f662['length'];_0x2c15ae++){const _0x15fa87=_0x21f662['charCodeAt'](_0x2c15ae);_0x446b42=(_0x446b42<<0x5)+_0x446b42+_0x15fa87,_0x446b42&=_0x446b42;}}function _0x427be6(_0x468842){Array['isArray'](_0x468842)?_0x468842['forEach'](_0x427be6):_0x468842&&'object'==typeof _0x468842?Object['entries'](_0x468842)['sort']()['forEach'](([_0xf30ded,_0x5696d4])=>{_0x11967a(_0xf30ded),_0x427be6(_0x5696d4);}):_0x11967a(window['String'](_0x468842));}return _0x427be6(_0x3eef32),_0x446b42>>>0x0;}function _0x4e2650(_0xd83f19){return _0xd83f19['toString'](0x10)['padStart'](0x8,'0');}function _0x4c4450(_0x529fe0){return _0x529fe0['split']('')['reverse']()['join']('');}function _0x559e68(){}_0xf863ec(await _0x934cc1());}_0x248531(_0x33987c['editor']);}(this);}getAllowedCommands(){return this['_allowedCommands'];}getDefaultCommands(){const _0x5321b4=_0x17a042=>function(_0x4819aa,_0x2f9747){const t=_0x4819aa['t'],_0x53157e=_0x4819aa['t'];switch(_0x2f9747){case'AI\x20Assistant':return _0x53157e('AI\x20Assistant');case'Block\x20quote':return _0x53157e('Block\x20quote');case'Bulleted\x20List':return _0x53157e('Bulleted\x20List');case'Insert\x20code\x20block':return _0x53157e('Insert\x20code\x20block');case'Open\x20file\x20manager':return _0x53157e('Open\x20file\x20manager');case'Insert\x20image':return _0x53157e('Insert\x20image');case'Heading\x201':return _0x53157e('Heading\x201');case'Heading\x202':return _0x53157e('Heading\x202');case'Heading\x203':return _0x53157e('Heading\x203');case'Heading\x204':return _0x53157e('Heading\x204');case'Heading\x205':return _0x53157e('Heading\x205');case'Heading\x206':return _0x53157e('Heading\x206');case'Horizontal\x20line':return _0x53157e('Horizontal\x20line');case'Insert\x20HTML':return _0x53157e('Insert\x20HTML');case'Increase\x20indent':return _0x53157e('Increase\x20indent');case'Insert\x20table':return _0x53157e('Insert\x20table');case'Table\x20of\x20contents':return _0x53157e('Table\x20of\x20contents');case'Numbered\x20List':return _0x53157e('Numbered\x20List');case'Decrease\x20indent':return _0x53157e('Decrease\x20indent');case'Paragraph':return _0x53157e('Paragraph');case'To-do\x20List':return _0x53157e('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 _0x2f9747;}}(this['editor']['locale'],_0x17a042);return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x194acb,'title':_0x5321b4('AI\x20Assistant'),'description':_0x5321b4('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x27935b=>{setTimeout(()=>_0x27935b['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x479f39,'title':_0x5321b4('Block\x20quote'),'description':_0x5321b4('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x49330a,'title':_0x5321b4('Bulleted\x20List'),'description':_0x5321b4('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x4034fc,'title':_0x5321b4('Insert\x20code\x20block'),'description':_0x5321b4('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x2bbdc8,'title':_0x5321b4('Open\x20file\x20manager'),'description':_0x5321b4('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x2bbdc8,'title':_0x5321b4('Insert\x20image'),'description':_0x5321b4('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'emoji','commandName':'emoji','icon':_0x3c37ef,'title':_0x5321b4('Emoji'),'description':_0x5321b4('Insert\x20an\x20emoji'),'execute':_0xd28777=>{setTimeout(()=>_0xd28777['execute']('emoji'));}},{'id':'heading1','commandName':'heading','icon':_0x5383df,'title':_0x5321b4('Heading\x201'),'description':_0x5321b4('Create\x20a\x20heading\x20level\x201'),'execute':_0xe1019e=>{_0xe1019e['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x7001d,'title':_0x5321b4('Heading\x202'),'description':_0x5321b4('Create\x20a\x20heading\x20level\x202'),'execute':_0x3edd11=>{_0x3edd11['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x33c6fe,'title':_0x5321b4('Heading\x203'),'description':_0x5321b4('Create\x20a\x20heading\x20level\x203'),'execute':_0x31a7fb=>{_0x31a7fb['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x5527e2,'title':_0x5321b4('Heading\x204'),'description':_0x5321b4('Create\x20a\x20heading\x20level\x204'),'execute':_0x4e3d53=>{_0x4e3d53['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x5644e0,'title':_0x5321b4('Heading\x205'),'description':_0x5321b4('Create\x20a\x20heading\x20level\x205'),'execute':_0x6ab492=>{_0x6ab492['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x2c5add,'title':_0x5321b4('Heading\x206'),'description':_0x5321b4('Create\x20a\x20heading\x20level\x206'),'execute':_0xca0058=>{_0xca0058['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x2e03e3,'title':_0x5321b4('Horizontal\x20line'),'description':_0x5321b4('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x5d035d,'title':_0x5321b4('Insert\x20HTML'),'description':_0x5321b4('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0xffb2df,'title':_0x5321b4('Increase\x20indent'),'description':_0x5321b4('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':_0x5321b4('Insert\x20Mermaid\x20diagram'),'description':_0x5321b4('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x6db9d,'title':_0x5321b4('Insert\x20table'),'description':_0x5321b4('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x5801c8,'title':_0x5321b4('Table\x20of\x20contents'),'description':_0x5321b4('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x18c521,'title':_0x5321b4('Numbered\x20List'),'description':_0x5321b4('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x5e4dfa,'title':_0x5321b4('Decrease\x20indent'),'description':_0x5321b4('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x580df5,'title':_0x5321b4('Paragraph'),'description':_0x5321b4('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x17979b,'title':_0x5321b4('To-do\x20List'),'description':_0x5321b4('Create\x20a\x20to-do\x20list')},{'id':'footnote','commandName':'insertFootnote','icon':_0x240a37,'title':_0x5321b4('Footnote'),'description':_0x5321b4('Insert\x20a\x20footnote')}];}['_proxyIsEnabled'](_0x35e28d){return _0x35e28d['isEnabled']?_0x35e28d['isEnabled'](this['editor']):!_0x35e28d['commandName']||this['editor']['commands']['get'](_0x35e28d['commandName'])['isEnabled'];}_proxyExecute(_0x5b28c7){if(_0x5b28c7['execute'])_0x5b28c7['execute'](this['editor']);else{if(!_0x5b28c7['commandName'])throw new _0x46af5e('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x5b28c7});this['editor']['execute'](_0x5b28c7['commandName']);}}};function E(_0x40184b,_0x253a8e){return _0x40184b['title']<_0x253a8e['title']?-0x1:_0x40184b['title']>_0x253a8e['title']?0x1:0x0;}function P(_0x3577d8,_0x24732c){return _0x24732c+'-'+_0x3577d8['toLowerCase']()['split']('\x20')['join']('-');}var K=class extends _0x2527f2{static get['pluginName'](){return'SlashCommandEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[O];}getMatchingCommands(_0x4ebe1b){const _0x5bf30f=_0x4ebe1b&&_0x4ebe1b['toLowerCase']();let _0x43f6f6=this['editor']['plugins']['get']('SlashCommandConfig')['getAllowedCommands']();if(_0x43f6f6=_0x43f6f6['filter'](_0x5dd518=>_0x5dd518['isEnabled']()),_0x5bf30f){const _0x393584=[],_0x2aba45=[],_0x26fef7=[],_0xf3fb52=[];for(const _0x3631c5 of _0x43f6f6)_0x3631c5['id']['toLowerCase']()['includes'](_0x5bf30f)?_0x393584['push'](_0x3631c5):_0x3631c5['title']['toLowerCase']()['includes'](_0x5bf30f)?_0x2aba45['push'](_0x3631c5):_0x3631c5['aliases']&&_0x3631c5['aliases']['some'](_0x5265dc=>_0x5265dc['toLowerCase']()['includes'](_0x5bf30f))?_0x26fef7['push'](_0x3631c5):_0x3631c5['description']&&_0x3631c5['description']['toLowerCase']()['includes'](_0x5bf30f)&&_0xf3fb52['push'](_0x3631c5);_0x43f6f6=_0x393584['concat'](_0x2aba45,_0x26fef7,_0xf3fb52);}return _0x43f6f6;}},M=class extends _0x28c9d5{constructor(_0x2e3db7,_0x32987c){super(_0x2e3db7),this['textPartView']=this['_createTextPartView'](_0x2e3db7,_0x32987c),void 0x0!==_0x32987c['isIconColorInherited']&&(this['iconView']['isColorInherited']=_0x32987c['isIconColorInherited']),this['set']({'icon':_0x32987c['icon']||_0x5dc559,'withText':!0x0,'label':_0x32987c['title'],'class':'ck-slash-command-button'});}['render'](){super['render'](),this['children']['add'](this['textPartView']);}_createTextPartView(_0x12319b,_0x4c479c){const _0x2cf96e=new _0x13ff31(_0x12319b);return _0x2cf96e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-slash-command-button__text-part']},'children':_0x4c479c['description']?[this['labelView'],{'tag':'span','attributes':{'class':['ck','ck-slash-command-button__description']},'children':[{'text':_0x4c479c['description']}]}]:[this['labelView']]}),_0x2cf96e;}},S=class extends _0x2527f2{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SlashCommandUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x535848){super(_0x535848),this['_setupMentionConfiguration']();}init(){this['editor']['once']('ready',this['_overrideMentionExecuteListener']['bind'](this)),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x332635=[this['editor']];for(const _0x1f0d08 of _0x332635){let _0x4ab936;for(const _0x30a1eb in _0x1f0d08){const _0x26defe=_0x30a1eb,_0x3bd8ab=_0x1f0d08[_0x26defe];if('slashCommandLicenseKeyValid'==_0x3bd8ab||'slashCommandLicenseKeyInvalid'==_0x3bd8ab||'slashCommandLicenseKeyExpired'==_0x3bd8ab||'slashCommandLicenseKeyDomainLimit'==_0x3bd8ab||'slashCommandLicenseKeyNotAllowed'==_0x3bd8ab||'slashCommandLicenseKeyEvaluationLimit'==_0x3bd8ab||'slashCommandLicenseKeyUsageLimit'==_0x3bd8ab){delete _0x1f0d08[_0x26defe],_0x4ab936=_0x3bd8ab,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'slashCommandLicenseKeyInvalid'==_0x4ab936&&_0x1f0d08['_showLicenseError']('invalid'),'slashCommandLicenseKeyExpired'==_0x4ab936&&_0x1f0d08['_showLicenseError']('expired'),'slashCommandLicenseKeyDomainLimit'==_0x4ab936&&_0x1f0d08['_showLicenseError']('domainLimit'),'slashCommandLicenseKeyNotAllowed'==_0x4ab936&&_0x1f0d08['_showLicenseError']('featureNotAllowed','SlashCommand'),'slashCommandLicenseKeyEvaluationLimit'==_0x4ab936&&_0x1f0d08['_showLicenseError']('evaluationLimit'),'slashCommandLicenseKeyUsageLimit'==_0x4ab936&&_0x1f0d08['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_setupMentionConfiguration(){const _0x2a26a2=this['editor'],_0x46a09c=this['editor']['plugins']['get']('SlashCommandEditing'),_0x216dc2=_0x2a26a2['config']['get']('mention.feeds');_0x216dc2['push']({'marker':'/','feed':_0x30d107=>_0x46a09c['getMatchingCommands'](_0x30d107),'itemRenderer':this['_customItemRenderer']['bind'](this),'dropdownLimit':_0x2a26a2['config']['get']('slashCommand.dropdownLimit')||0x1/0x0}),_0x2a26a2['config']['set']('mention.feeds',_0x216dc2);}_overrideMentionExecuteListener(){const _0x1acfac=this['editor'];_0x1acfac['commands']['get']('mention')['on']('execute',(_0x4eaaf7,_0x143c97)=>{const _0x34642b=_0x143c97[0x0],_0x226508=_0x1acfac['model'];'/'===_0x34642b['marker']&&_0x226508['change'](_0x533e31=>{_0x533e31['remove'](_0x34642b['range']),_0x34642b['mention']['execute'](),_0x4eaaf7['stop']();});},{'priority':'high'});}_customItemRenderer(_0x3c801d){const _0x3fe360=this['editor']['locale'],_0x856339=new M(_0x3fe360,_0x3c801d);return _0x856339['render'](),_0x856339['element'];}},D=class extends _0x2527f2{static get requires(){return[_0x3ea01f,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.5.0-alpha.
|
|
3
|
+
"version": "48.5.0-alpha.5",
|
|
4
4
|
"description": "Slash command feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ckeditor/ckeditor5-core": "48.5.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-heading": "48.5.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-mention": "48.5.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-style": "48.5.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-template": "48.5.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.5.0-alpha.5",
|
|
25
|
+
"@ckeditor/ckeditor5-heading": "48.5.0-alpha.5",
|
|
26
|
+
"@ckeditor/ckeditor5-icons": "48.5.0-alpha.5",
|
|
27
|
+
"@ckeditor/ckeditor5-mention": "48.5.0-alpha.5",
|
|
28
|
+
"@ckeditor/ckeditor5-style": "48.5.0-alpha.5",
|
|
29
|
+
"@ckeditor/ckeditor5-template": "48.5.0-alpha.5",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "48.5.0-alpha.5",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "48.5.0-alpha.5"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|