UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines 5.89 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 _0x5c9cc3=_0x3130;(function(_0x744113,_0x4d04d9){const _0x35bf73=_0x3130,_0x33751e=_0x744113();while(!![]){try{const _0x518388=-parseInt(_0x35bf73(0x199))/0x1+-parseInt(_0x35bf73(0x178))/0x2*(parseInt(_0x35bf73(0x19b))/0x3)+parseInt(_0x35bf73(0x19e))/0x4*(-parseInt(_0x35bf73(0x16e))/0x5)+-parseInt(_0x35bf73(0x17a))/0x6*(parseInt(_0x35bf73(0x175))/0x7)+parseInt(_0x35bf73(0x16f))/0x8+-parseInt(_0x35bf73(0x18a))/0x9+-parseInt(_0x35bf73(0x182))/0xa*(-parseInt(_0x35bf73(0x17b))/0xb);if(_0x518388===_0x4d04d9)break;else _0x33751e['push'](_0x33751e['shift']());}catch(_0x45891b){_0x33751e['push'](_0x33751e['shift']());}}}(_0x19d9,0xb2f34));import{Command as _0x5e7578}from'ckeditor5/src/core.js';import{uid as _0x388bd7,CKEditorError as _0x6c06c4}from'ckeditor5/src/utils.js';function _0x3130(_0x2dd1da,_0x528925){const _0x19d9ab=_0x19d9();return _0x3130=function(_0x3130c1,_0x665ba6){_0x3130c1=_0x3130c1-0x169;let _0x350c56=_0x19d9ab[_0x3130c1];return _0x350c56;},_0x3130(_0x2dd1da,_0x528925);}export class AddCommentThreadCommand extends _0x5e7578{constructor(_0x245084){const _0x145df2=_0x3130;super(_0x245084),this[_0x145df2(0x173)](_0x145df2(0x18b),!0x1);}[_0x5c9cc3(0x169)](){const _0x41824d=_0x5c9cc3,_0x219979=this[_0x41824d(0x190)][_0x41824d(0x192)][_0x41824d(0x193)][_0x41824d(0x19a)];this[_0x41824d(0x171)]=!0x0,this[_0x41824d(0x18b)]=!0x1;for(const _0xdba320 of _0x219979[_0x41824d(0x181)]())if(this[_0x41824d(0x16d)](_0xdba320))return void(this[_0x41824d(0x18b)]=!0x0);}[_0x5c9cc3(0x17c)]({threadId:_0x59c229=_0x388bd7(),ranges:_0x2ee119,comment:_0x95117f}={}){const _0xb21010=_0x5c9cc3,_0x173ef6=this[_0xb21010(0x190)][_0xb21010(0x192)],_0x1487d7=_0x2ee119??Array[_0xb21010(0x172)](_0x173ef6[_0xb21010(0x193)][_0xb21010(0x19a)][_0xb21010(0x181)]()),_0xa7685b=[];for(const _0x82520f of _0x1487d7)this[_0xb21010(0x16d)](_0x82520f)&&_0xa7685b[_0xb21010(0x18c)](this[_0xb21010(0x186)](_0x82520f));if(!_0xa7685b[_0xb21010(0x179)])throw new _0x6c06c4(_0xb21010(0x194),null);_0x95117f&&this[_0xb21010(0x19c)](_0x59c229,_0x95117f),this[_0xb21010(0x17f)](_0x59c229,_0xa7685b,!!_0x95117f);}[_0x5c9cc3(0x17f)](_0x9af6e0,_0x3cc9ae,_0x314226){const _0x258deb=_0x5c9cc3;this[_0x258deb(0x190)][_0x258deb(0x192)][_0x258deb(0x16b)](_0x4336fc=>{const _0x71ef31=_0x258deb;for(const _0x2b5672 of _0x3cc9ae){const _0x4dca9f=_0x388bd7()[_0x71ef31(0x198)](0x1,0x5),_0x3c2dae=_0x71ef31(0x16c)+_0x9af6e0+':'+_0x4dca9f;_0x4336fc[_0x71ef31(0x196)](_0x3c2dae,{'range':_0x2b5672,'usingOperation':_0x314226,'affectsData':_0x314226});}});}[_0x5c9cc3(0x19c)](_0x30a442,_0xd75097){const _0x186cb2=_0x5c9cc3,_0x565826=this[_0x186cb2(0x190)][_0x186cb2(0x176)][_0x186cb2(0x180)](_0x186cb2(0x197)),_0x4c7898=this[_0x186cb2(0x190)][_0x186cb2(0x187)][_0x186cb2(0x180)](_0x186cb2(0x19d)),_0x216a6f=this[_0x186cb2(0x190)][_0x186cb2(0x176)][_0x186cb2(0x180)](_0x186cb2(0x174))['me'];if(!_0x216a6f)throw new _0x6c06c4(_0x186cb2(0x188),null);_0x565826[_0x186cb2(0x170)]({'threadId':_0x30a442,'channelId':_0x4c7898,'comments':[{'authorId':_0x216a6f['id'],'content':_0xd75097,'createdAt':new Date(),'attributes':{}}]});}[_0x5c9cc3(0x16d)](_0x81299c){const _0xeb2abb=_0x5c9cc3;for(const _0x4eb710 of _0x81299c[_0xeb2abb(0x185)]())if(this[_0xeb2abb(0x183)](_0x4eb710))return!0x0;return!0x1;}[_0x5c9cc3(0x183)](_0x13ae74){const _0x478cc2=_0x5c9cc3;return _0x13ae74['is'](_0x478cc2(0x18e))||this[_0x478cc2(0x190)][_0x478cc2(0x192)][_0x478cc2(0x184)][_0x478cc2(0x18f)](_0x13ae74)&&!_0x13ae74['is'](_0x478cc2(0x16a),_0x478cc2(0x189));}[_0x5c9cc3(0x186)](_0x4d2534){const _0x125187=_0x5c9cc3,_0x514573=_0xf2c4b8=>!this[_0x125187(0x183)](_0xf2c4b8[_0x125187(0x17d)]),_0x16e64e=_0x4d2534[_0x125187(0x191)][_0x125187(0x195)](_0x514573),_0x53cd20=_0x4d2534[_0x125187(0x17e)][_0x125187(0x195)](_0x514573,{'direction':_0x125187(0x18d)});return this[_0x125187(0x190)][_0x125187(0x192)][_0x125187(0x177)](_0x16e64e,_0x53cd20);}}function _0x19d9(){const _0x5cb743=['tableCell','1539927iRvDom','hasContent','push','backward','$textProxy','isObject','editor','start','model','document','addcommentthreadcommand-incorrect-ranges','getLastMatchingPosition','addMarker','CommentsRepository','substr','682338MOgVWE','selection','6TCOgKp','_createCommentThread','collaboration.channelId','17740uilstO','refresh','element','change','comment:','_hasContent','45hocCyD','10502648aCOtZl','addCommentThread','isEnabled','from','set','Users','1484dvxmRQ','plugins','createRange','699814uQlLiM','length','10938ByMFqw','4565oMiRKu','execute','item','end','_createMarkersFromRanges','get','getRanges','33730MKTfnf','_itemIsContent','schema','getItems','_trimToContent','config','addcommentthreadcommand-user-not-found'];_0x19d9=function(){return _0x5cb743;};return _0x19d9();}