UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 11.7 kB
/* * Copyright (c) 2003-2026, 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 _0x97d840=_0x51ea;(function(_0x131108,_0x5efa84){const _0xa435c0=_0x51ea,_0x2c3207=_0x131108();while(!![]){try{const _0x53691c=parseInt(_0xa435c0(0x14f))/0x1*(-parseInt(_0xa435c0(0x177))/0x2)+-parseInt(_0xa435c0(0x17c))/0x3*(parseInt(_0xa435c0(0x1a0))/0x4)+-parseInt(_0xa435c0(0x19f))/0x5*(-parseInt(_0xa435c0(0x163))/0x6)+parseInt(_0xa435c0(0x19c))/0x7+-parseInt(_0xa435c0(0x1ac))/0x8+parseInt(_0xa435c0(0x152))/0x9+parseInt(_0xa435c0(0x192))/0xa;if(_0x53691c===_0x5efa84)break;else _0x2c3207['push'](_0x2c3207['shift']());}catch(_0x37f8e1){_0x2c3207['push'](_0x2c3207['shift']());}}}(_0x4ce2,0x3c6f0));function _0x4ce2(){const _0x138d7c=['_rearrangeExpand','resolvedBy','8938640VUKYtv','delegate','render','set','focus','added','arrowup','maxCommentCharsWhenCollapsed','insert','updateComment','1523585xbcTnU','focusCycler','formatDateTime','344680wzhroY','200XtpjCn','_handleNewCommentModel','removed','keystrokes','authoredAt','resolvedCommentView','resolvedAt','destroy','remove','from','CommentView','includes','3024832SNRqop','bindTemplate','hasDirtyComment','focusFirst','9qERQTJ','Marked\x20as\x20resolved','change:isActive','3158532CyNpjy','arrowdown','setTemplate','visibleViews','weight','isActive','_rearrangeCollapse','editorDestroyed','commentViews','_updateHasDirtyComment','target','_handleInfoComment','_model','_collapsedCommentsView','collapse','_config','ck-thread__comments','6ItofQr','change','_handleRemoveCommentModel','bind','listenTo','resolveCommentThread','_calculatePosition','isEditMode','editorReady','length','focusTracker','change:hasDirtyComment','some','ck-hidden','_shouldCollapse','equal','maxThreadTotalWeight','add','_findOptimalIndex','focusLast','97914lGSzuR','locale','resolved','forEach','change:isResolved','27909kVUQSZ','viewUid','Thread\x20comments','_setupKeyboardNavigation','editorConfig','comments','stopListening','reverse','removeComment','get','expand','map','element','delete','commentUpdated','maxCommentsWhenCollapsed','count','change:isEditMode','createCollection','refreshVisibleViews'];_0x4ce2=function(){return _0x138d7c;};return _0x4ce2();}import{View as _0x3f1838,FocusCycler as _0x4ada8c}from'ckeditor5/src/ui.js';function _0x51ea(_0x5de4e3,_0x3040ad){const _0x4ce2ce=_0x4ce2();return _0x51ea=function(_0x51eafe,_0x445e4c){_0x51eafe=_0x51eafe-0x14f;let _0x139dc9=_0x4ce2ce[_0x51eafe];return _0x139dc9;},_0x51ea(_0x5de4e3,_0x3040ad);}import{diff as _0x57123f,Collection as _0xa5ff06,FocusTracker as _0x29cc54,KeystrokeHandler as _0xc07026}from'ckeditor5/src/utils.js';import{getTranslation as _0x506e67}from'../../../utils/common-translations.js';import{CollapsedCommentsView as _0x79c3a4}from'./collapsedcommentsview.js';export class CommentsListView extends _0x3f1838{[_0x97d840(0x15a)];[_0x97d840(0x1a5)];[_0x97d840(0x16d)];[_0x97d840(0x1a3)];[_0x97d840(0x19d)];[_0x97d840(0x15e)];[_0x97d840(0x161)];[_0x97d840(0x15f)];constructor(_0x56eda4,_0x2b1a68,_0x557462){const _0x5b3c57=_0x97d840;super(_0x56eda4);const _0x53864f=this[_0x5b3c57(0x1ad)];this[_0x5b3c57(0x195)](_0x5b3c57(0x1ae),!0x1),this[_0x5b3c57(0x195)](_0x5b3c57(0x16c),_0x2b1a68[_0x5b3c57(0x181)][_0x5b3c57(0x16c)]),this[_0x5b3c57(0x195)](_0x5b3c57(0x157),!0x1),this[_0x5b3c57(0x15e)]=_0x2b1a68,this[_0x5b3c57(0x161)]=_0x557462,this[_0x5b3c57(0x15a)]=this[_0x5b3c57(0x18e)](),this[_0x5b3c57(0x155)]=this[_0x5b3c57(0x18e)](),this[_0x5b3c57(0x1a5)]=null,this[_0x5b3c57(0x16d)]=new _0x29cc54(),this[_0x5b3c57(0x1a3)]=new _0xc07026(),this[_0x5b3c57(0x19d)]=new _0x4ada8c({'focusables':this[_0x5b3c57(0x15a)],'focusTracker':this[_0x5b3c57(0x16d)],'keystrokeHandler':this[_0x5b3c57(0x1a3)],'keystrokeHandlerOptions':{'filter':_0x407b83=>this[_0x5b3c57(0x15a)][_0x5b3c57(0x187)](_0x1164ea=>_0x1164ea[_0x5b3c57(0x188)])[_0x5b3c57(0x1ab)](_0x407b83[_0x5b3c57(0x15c)])},'actions':{'focusPrevious':_0x5b3c57(0x198),'focusNext':_0x5b3c57(0x153)}}),this[_0x5b3c57(0x15f)]=new _0x79c3a4(_0x56eda4),this[_0x5b3c57(0x15f)][_0x5b3c57(0x166)](_0x5b3c57(0x18c))['to'](this,_0x5b3c57(0x16c),_0x440592=>_0x440592-this[_0x5b3c57(0x161)][_0x5b3c57(0x18b)]);for(const _0x56ffd5 of _0x2b1a68[_0x5b3c57(0x181)])this[_0x5b3c57(0x1a1)](_0x56ffd5);this[_0x5b3c57(0x15d)](),this[_0x5b3c57(0x167)](_0x2b1a68[_0x5b3c57(0x181)],_0x5b3c57(0x174),(_0x3c52ef,_0x4bb25d)=>{const _0x57f0b3=_0x5b3c57,_0x2bc98f=this[_0x57f0b3(0x169)](_0x4bb25d);this[_0x57f0b3(0x16c)]++,this[_0x57f0b3(0x1a1)](_0x4bb25d,_0x2bc98f),this[_0x57f0b3(0x18f)]();}),this[_0x5b3c57(0x167)](_0x2b1a68[_0x5b3c57(0x181)],_0x5b3c57(0x1a8),(_0x3c9f37,_0x541158)=>{const _0x4a5b41=_0x5b3c57;this[_0x4a5b41(0x16c)]--,this[_0x4a5b41(0x165)](_0x541158),this[_0x4a5b41(0x18f)]();}),this[_0x5b3c57(0x167)](_0x2b1a68,_0x5b3c57(0x18a),()=>this[_0x5b3c57(0x18f)]()),this[_0x5b3c57(0x167)](_0x2b1a68,_0x5b3c57(0x17b),()=>this[_0x5b3c57(0x15d)]()),this['on'](_0x5b3c57(0x151),()=>this[_0x5b3c57(0x18f)]()),this['on'](_0x5b3c57(0x16e),()=>this[_0x5b3c57(0x18f)]()),this[_0x5b3c57(0x154)]({'tag':'ul','attributes':{'class':[_0x5b3c57(0x162),_0x53864f['if'](_0x5b3c57(0x16c),_0x5b3c57(0x170),_0x395ed9=>!_0x395ed9)],'aria-label':_0x506e67(_0x56eda4,_0x5b3c57(0x17e))},'children':this[_0x5b3c57(0x155)]});}get[_0x97d840(0x171)](){const _0xb2e409=_0x97d840;return this[_0xb2e409(0x15e)][_0xb2e409(0x156)]>this[_0xb2e409(0x161)][_0xb2e409(0x173)]&&!this[_0xb2e409(0x157)]&&!this[_0xb2e409(0x1ae)];}[_0x97d840(0x194)](){const _0x5528d6=_0x97d840;super[_0x5528d6(0x194)](),this[_0x5528d6(0x18f)](),this[_0x5528d6(0x17f)]();}[_0x97d840(0x196)](_0xa265ae){const _0x32ac75=_0x97d840;-0x1===_0xa265ae?this[_0x32ac75(0x19d)][_0x32ac75(0x176)]():this[_0x32ac75(0x19d)][_0x32ac75(0x1af)]();}[_0x97d840(0x1a7)](){const _0x4047f4=_0x97d840;this[_0x4047f4(0x15f)][_0x4047f4(0x1a7)]();for(const _0x1c8c6c of this[_0x4047f4(0x15a)])_0x1c8c6c[_0x4047f4(0x1a7)]();super[_0x4047f4(0x1a7)]();}[_0x97d840(0x18f)](){const _0x3f8867=_0x97d840;this[_0x3f8867(0x171)]?this[_0x3f8867(0x158)]():this[_0x3f8867(0x190)]();}[_0x97d840(0x1a1)](_0x3227b1,_0xb7196f){const _0x226c04=_0x97d840,_0xdf6057=new this[(_0x226c04(0x161))][(_0x226c04(0x1aa))](this[_0x226c04(0x178)],_0x3227b1,{'maxCommentCharsWhenCollapsed':this[_0x226c04(0x161)][_0x226c04(0x199)],'formatDateTime':this[_0x226c04(0x161)][_0x226c04(0x19e)],'editorConfig':this[_0x226c04(0x161)][_0x226c04(0x180)]});_0xdf6057[_0x226c04(0x17d)]=_0x3227b1['id'],_0xdf6057[_0x226c04(0x193)](_0x226c04(0x184))['to'](this),_0xdf6057[_0x226c04(0x193)](_0x226c04(0x19b))['to'](this),_0xdf6057[_0x226c04(0x193)](_0x226c04(0x168))['to'](this),_0xdf6057[_0x226c04(0x193)](_0x226c04(0x16b))['to'](this),_0xdf6057[_0x226c04(0x193)](_0x226c04(0x159))['to'](this),this[_0x226c04(0x167)](_0xdf6057,_0x226c04(0x18d),()=>this[_0x226c04(0x15b)]()),this[_0x226c04(0x15a)][_0x226c04(0x174)](_0xdf6057,_0xb7196f);}[_0x97d840(0x169)](_0x2c2f8e){const _0x1048fc=_0x97d840,_0x48503a=this[_0x1048fc(0x15e)][_0x1048fc(0x175)](_0x2c2f8e);return this[_0x1048fc(0x1a5)]?this[_0x1048fc(0x1a5)][_0x1048fc(0x1a4)]>_0x2c2f8e[_0x1048fc(0x1a4)]?_0x48503a-0x1:_0x48503a:_0x48503a-0x1;}[_0x97d840(0x15d)](){const _0x2217fb=_0x97d840;if(this[_0x2217fb(0x15e)][_0x2217fb(0x191)]&&this[_0x2217fb(0x15e)][_0x2217fb(0x1a6)]){const _0x3152db={'id':_0x2217fb(0x179),'author':this[_0x2217fb(0x15e)][_0x2217fb(0x191)],'authoredAt':this[_0x2217fb(0x15e)][_0x2217fb(0x1a6)],'content':_0x506e67(this[_0x2217fb(0x178)],_0x2217fb(0x150)),'attributes':{}};this[_0x2217fb(0x1a5)]=new this[(_0x2217fb(0x161))][(_0x2217fb(0x1aa))](this[_0x2217fb(0x178)],_0x3152db,{'maxCommentCharsWhenCollapsed':this[_0x2217fb(0x161)][_0x2217fb(0x199)],'formatDateTime':this[_0x2217fb(0x161)][_0x2217fb(0x19e)],'editorConfig':this[_0x2217fb(0x161)][_0x2217fb(0x180)],'isSystemComment':!0x0}),this[_0x2217fb(0x15a)][_0x2217fb(0x174)](this[_0x2217fb(0x1a5)],this[_0x2217fb(0x15e)][_0x2217fb(0x175)](_0x3152db));}else this[_0x2217fb(0x1a5)]&&(this[_0x2217fb(0x15a)][_0x2217fb(0x1a8)](this[_0x2217fb(0x1a5)]),this[_0x2217fb(0x1a5)][_0x2217fb(0x1a7)](),this[_0x2217fb(0x1a5)]=null);this[_0x2217fb(0x18f)]();}[_0x97d840(0x165)](_0x5e2fd0){const _0x5b4703=_0x97d840,_0x1018cc=this[_0x5b4703(0x15a)][_0x5b4703(0x1a8)](_0x5e2fd0['id']);this[_0x5b4703(0x182)](_0x1018cc),_0x1018cc[_0x5b4703(0x16a)]&&this[_0x5b4703(0x15b)](),_0x1018cc[_0x5b4703(0x1a7)]();}[_0x97d840(0x15b)](){const _0x506392=_0x97d840;this[_0x506392(0x1ae)]=Array[_0x506392(0x1a9)](this[_0x506392(0x15a)])[_0x506392(0x16f)](_0x27c7d6=>_0x27c7d6[_0x506392(0x16a)]);}[_0x97d840(0x158)](){const _0x1ffd32=_0x97d840,_0x623b37=function(_0x2825bb){const _0x53334a=_0x51ea,_0x776ba4=new _0xa5ff06();for(const _0x56deac of _0x2825bb)_0x776ba4[_0x53334a(0x174)](_0x56deac);return _0x776ba4;}(this[_0x1ffd32(0x15a)]),_0x3f744f=this[_0x1ffd32(0x15f)][_0x1ffd32(0x18c)];for(let _0x15c692=0x1;_0x15c692<=_0x3f744f;_0x15c692++)_0x623b37[_0x1ffd32(0x1a8)](0x1);for(const _0x3ca402 of _0x623b37)_0x3ca402[_0x1ffd32(0x160)]();_0x3f744f>0x0&&_0x623b37[_0x1ffd32(0x174)](this[_0x1ffd32(0x15f)],0x1),ns(_0x57123f(Array[_0x1ffd32(0x1a9)](this[_0x1ffd32(0x155)]),Array[_0x1ffd32(0x1a9)](_0x623b37)),this[_0x1ffd32(0x155)],_0x623b37);}[_0x97d840(0x190)](){const _0x33f2e7=_0x97d840;ns(_0x57123f(Array[_0x33f2e7(0x1a9)](this[_0x33f2e7(0x155)]),Array[_0x33f2e7(0x1a9)](this[_0x33f2e7(0x15a)])),this[_0x33f2e7(0x155)],this[_0x33f2e7(0x15a)]);for(const _0x4fd0f1 of this[_0x33f2e7(0x155)])_0x4fd0f1[_0x33f2e7(0x186)]();}[_0x97d840(0x17f)](){const _0x39b3bf=_0x97d840;this[_0x39b3bf(0x15a)][_0x39b3bf(0x17a)](_0x1365c8=>{const _0xc3d0f1=_0x39b3bf;this[_0xc3d0f1(0x16d)][_0xc3d0f1(0x174)](_0x1365c8[_0xc3d0f1(0x188)]),this[_0xc3d0f1(0x1a3)][_0xc3d0f1(0x167)](_0x1365c8[_0xc3d0f1(0x188)]);}),this[_0x39b3bf(0x15a)]['on'](_0x39b3bf(0x164),(_0x5f1fad,_0x2ca751)=>{const _0x8e4487=_0x39b3bf;for(const _0x5578aa of _0x2ca751[_0x8e4487(0x1a2)])this[_0x8e4487(0x16d)][_0x8e4487(0x1a8)](_0x5578aa[_0x8e4487(0x188)]),this[_0x8e4487(0x1a3)][_0x8e4487(0x182)](_0x5578aa[_0x8e4487(0x188)]);for(const _0x4fcaf1 of Array[_0x8e4487(0x1a9)](_0x2ca751[_0x8e4487(0x197)])[_0x8e4487(0x183)]())this[_0x8e4487(0x16d)][_0x8e4487(0x174)](_0x4fcaf1[_0x8e4487(0x188)]),this[_0x8e4487(0x1a3)][_0x8e4487(0x167)](_0x4fcaf1[_0x8e4487(0x188)]);});}}function ns(_0x558f65,_0x118a1c,_0xef5585){const _0x468a47=_0x97d840;let _0x1c7753=0x0;for(const _0x49da66 of _0x558f65)switch(_0x49da66){case _0x468a47(0x19a):_0x118a1c[_0x468a47(0x174)](_0xef5585[_0x468a47(0x185)](_0x1c7753),_0x1c7753),_0x1c7753++;break;case _0x468a47(0x189):_0x118a1c[_0x468a47(0x1a8)](_0x1c7753);break;case _0x468a47(0x172):_0x1c7753++;}}