UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines 8.85 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x549497=_0x5409;(function(_0x1e9682,_0x47af5b){const _0x45dee9=_0x5409,_0x2dbed0=_0x1e9682();while(!![]){try{const _0x4d8536=-parseInt(_0x45dee9(0x155))/0x1+-parseInt(_0x45dee9(0x191))/0x2+-parseInt(_0x45dee9(0x16f))/0x3+-parseInt(_0x45dee9(0x172))/0x4+parseInt(_0x45dee9(0x18c))/0x5*(-parseInt(_0x45dee9(0x186))/0x6)+-parseInt(_0x45dee9(0x192))/0x7*(parseInt(_0x45dee9(0x175))/0x8)+parseInt(_0x45dee9(0x183))/0x9;if(_0x4d8536===_0x47af5b)break;else _0x2dbed0['push'](_0x2dbed0['shift']());}catch(_0x164587){_0x2dbed0['push'](_0x2dbed0['shift']());}}}(_0x5a01,0xb9f73));import{Plugin as _0x65e028}from'ckeditor5/src/core.js';import{IconAddComment as _0x580eba}from'ckeditor5/src/icons.js';import{CommentsRepository as _0x348134}from'./commentsrepository.js';function _0x5409(_0x5806ce,_0x17963b){const _0x5a013f=_0x5a01();return _0x5409=function(_0x540984,_0x2f4f3a){_0x540984=_0x540984-0x14b;let _0x5a4b38=_0x5a013f[_0x540984];return _0x5a4b38;},_0x5409(_0x5806ce,_0x17963b);}import{CommentsEditing as _0x59c9f4}from'./commentsediting.js';import{EditorAnnotations as _0x7d896e}from'../annotations/editorannotations.js';import{ButtonView as _0xafaf73,MenuBarMenuListItemButtonView as _0x20857d}from'ckeditor5/src/ui.js';import{Annotations as _0x639c41}from'../annotations/annotations.js';import{CommentsListView as _0xddb00}from'./ui/view/commentslistview.js';function _0x5a01(){const _0x216be2=['focus','model','activeMarker','componentFactory','2007102VgKGsy','CommentsUI','_threadToController','1858164kdLSpZ','licenseKey','usageLimit','24wNWvLj','requires','editing','listenTo','destroy','_viewToController','map','_createUIButton','commands','commentsLicenseKeyTrialLimit','getRange','view','commentsLicenseKeyExpired','addComment','36909405kewzGm','set','stop','2482548eREaTt','locale','from','_showLicenseError','comment:','isOfficialPlugin','5ijNGqk','get','bind','push','change:activeAnnotations','2701100bEfcQr','7742TFRdMb','invalid','_licenseKeyCheckInterval','CommentsListView','Comments','plugins','hasContent','low','editor','addSourceCollector','config','innerView','commentsLicenseKeyDomainLimit','commentsLicenseKeyEvaluationLimit','domainLimit','commentsLicenseKeyNotAllowed','CommentThreadInputView','trialLimit','length','isPremiumPlugin','menuBar:comment','add','addCommentThread','isFocused','init','438129wENQQE','execute','commentsLicenseKeyValid','getAllMarkersForId','removeCommentThread','commentsLicenseKeyUsageLimit','isEnabled','hasMarkerForId','hasCommentThread','commentsLicenseKeyInvalid','has','evaluationLimit','comment','highest','getCommentThread','Comment','pluginName','focusTracker','featureNotAllowed','expired','find','tooltip'];_0x5a01=function(){return _0x216be2;};return _0x5a01();}import{CommentThreadInputView as _0x3d9e22}from'./ui/view/commentthreadinputview.js';import{getTranslation as _0x2e4e5e}from'../utils/common-translations.js';export class CommentsUI extends _0x65e028{[_0x549497(0x173)];[_0x549497(0x194)];static get[_0x549497(0x165)](){const _0x15c725=_0x549497;return _0x15c725(0x170);}static get[_0x549497(0x18b)](){return!0x0;}static get[_0x549497(0x14f)](){return!0x0;}static get[_0x549497(0x176)](){return[_0x348134,_0x59c9f4,_0x7d896e,_0x639c41];}get[_0x549497(0x195)](){return _0xddb00;}get[_0x549497(0x14c)](){return _0x3d9e22;}[_0x549497(0x154)](){const _0x1d33be=_0x549497,_0x53411b=this[_0x1d33be(0x19a)],_0x19216a=_0x53411b[_0x1d33be(0x197)][_0x1d33be(0x18d)](_0x348134),_0x1462dc=_0x53411b[_0x1d33be(0x197)][_0x1d33be(0x18d)](_0x59c9f4),_0x2f325b=_0x53411b[_0x1d33be(0x197)][_0x1d33be(0x18d)](_0x639c41),_0x5c81a6=_0x53411b[_0x1d33be(0x197)][_0x1d33be(0x18d)](_0x7d896e);_0x53411b['ui'][_0x1d33be(0x16e)][_0x1d33be(0x151)](_0x1d33be(0x161),()=>{const _0x37c484=_0x1d33be,_0x141724=this[_0x37c484(0x17c)](_0xafaf73);return _0x141724[_0x37c484(0x16a)]=!0x0,_0x141724;}),_0x53411b['ui'][_0x1d33be(0x16e)][_0x1d33be(0x151)](_0x1d33be(0x150),()=>this[_0x1d33be(0x17c)](_0x20857d)),_0x5c81a6[_0x1d33be(0x19b)](()=>{const _0x458768=_0x1d33be,_0x1c81f8=[];for(const [_0x2afd19,_0xaab1cd]of _0x19216a[_0x458768(0x171)]){const _0xbb9dbb=_0x1462dc[_0x458768(0x158)](_0x2afd19['id']),_0x2d357c=_0xbb9dbb[_0x458768(0x17b)](_0xad8bb2=>_0xad8bb2[_0x458768(0x17f)]());_0xbb9dbb[_0x458768(0x14e)]>0x0&&_0x1c81f8[_0x458768(0x18f)]([_0xaab1cd[_0x458768(0x180)],_0x2d357c]);}return _0x1c81f8;}),this[_0x1d33be(0x178)](_0x2f325b,_0x1d33be(0x190),(_0x468152,_0x4adfad,_0xe6d687)=>{const _0x52186f=_0x1d33be,_0x5e04c1=Array[_0x52186f(0x188)](_0xe6d687)[_0x52186f(0x17b)](_0x4a1fd2=>_0x4a1fd2[_0x52186f(0x19d)])[_0x52186f(0x169)](_0x5c38e8=>_0x19216a[_0x52186f(0x17a)][_0x52186f(0x15f)](_0x5c38e8));if(!_0x5e04c1)return void(_0x1462dc[_0x52186f(0x16d)]=null);const _0x2f2912=_0x19216a[_0x52186f(0x17a)][_0x52186f(0x18d)](_0x5e04c1)[_0x52186f(0x16c)]['id'],_0x539e22=_0x52186f(0x18a)+_0x2f2912;_0x2f2912&&_0x1462dc[_0x52186f(0x15c)](_0x2f2912)?_0x1462dc[_0x52186f(0x16d)]=_0x539e22:_0x1462dc[_0x52186f(0x16d)]&&(_0x1462dc[_0x52186f(0x16d)]=null);}),this[_0x1d33be(0x178)](_0x19216a,_0x1d33be(0x159),(_0x3057b7,{threadId:_0x5727f8,isFromAdapter:_0x302ac8})=>{const _0xb5a7e=_0x1d33be;!_0x302ac8&&_0x53411b['ui'][_0xb5a7e(0x166)][_0xb5a7e(0x153)]&&_0x1462dc[_0xb5a7e(0x15c)](_0x5727f8)&&_0x53411b[_0xb5a7e(0x177)][_0xb5a7e(0x180)][_0xb5a7e(0x16b)]();},{'priority':_0x1d33be(0x162)}),this[_0x1d33be(0x178)](_0x19216a,_0x1d33be(0x182),(_0x552f9b,{threadId:_0x293255,isFromAdapter:_0x53b5af})=>{const _0x91003e=_0x1d33be;if(_0x53b5af||!_0x1462dc[_0x91003e(0x15c)](_0x293255)||!_0x19216a[_0x91003e(0x15d)](_0x293255))return;0x1===_0x19216a[_0x91003e(0x163)](_0x293255)[_0x91003e(0x14e)]&&(_0x53411b[_0x91003e(0x177)][_0x91003e(0x180)][_0x91003e(0x16b)](),_0x552f9b[_0x91003e(0x185)]());},{'priority':_0x1d33be(0x199)}),this[_0x1d33be(0x173)]=this[_0x1d33be(0x19a)][_0x1d33be(0x19c)][_0x1d33be(0x18d)](_0x1d33be(0x173));const _0x6d143d=this[_0x1d33be(0x19a)];this[_0x1d33be(0x194)]=setInterval(()=>{const _0xb018be=_0x1d33be;let _0x100497;for(const _0x5de603 in _0x6d143d){const _0x5db449=_0x5de603,_0xc53249=_0x6d143d[_0x5db449];if(_0xb018be(0x157)==_0xc53249||_0xb018be(0x15e)==_0xc53249||_0xb018be(0x181)==_0xc53249||_0xb018be(0x19e)==_0xc53249||_0xb018be(0x14b)==_0xc53249||_0xb018be(0x19f)==_0xc53249||_0xb018be(0x17e)==_0xc53249||_0xb018be(0x15a)==_0xc53249){delete _0x6d143d[_0x5db449],_0x100497=_0xc53249,clearInterval(this[_0xb018be(0x194)]),this[_0xb018be(0x194)]=void 0x0;break;}}_0xb018be(0x15e)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x193)),_0xb018be(0x181)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x168)),_0xb018be(0x19e)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x1a0)),_0xb018be(0x14b)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x167),_0xb018be(0x196)),_0xb018be(0x19f)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x160)),_0xb018be(0x17e)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x14d)),_0xb018be(0x15a)==_0x100497&&_0x6d143d[_0xb018be(0x189)](_0xb018be(0x174));},0x3e8);}[_0x549497(0x179)](){const _0x2dfc78=_0x549497;super[_0x2dfc78(0x179)](),this[_0x2dfc78(0x194)]&&clearInterval(this[_0x2dfc78(0x194)]);}[_0x549497(0x17c)](_0x507b86){const _0x1058bf=_0x549497,_0x19c0df=this[_0x1058bf(0x19a)],_0x40f315=new _0x507b86(_0x19c0df[_0x1058bf(0x187)]),_0x3cce91=_0x19c0df[_0x1058bf(0x17d)][_0x1058bf(0x18d)](_0x1058bf(0x152));return _0x40f315[_0x1058bf(0x184)]({'label':_0x2e4e5e(_0x19c0df[_0x1058bf(0x187)],_0x1058bf(0x164)),'icon':_0x580eba}),_0x40f315[_0x1058bf(0x18e)](_0x1058bf(0x15b))['to'](_0x3cce91,_0x1058bf(0x198)),this[_0x1058bf(0x178)](_0x40f315,_0x1058bf(0x156),()=>{const _0x4b9942=_0x1058bf;_0x3cce91[_0x4b9942(0x156)]();}),_0x40f315;}}