UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 11.4 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x1196(_0x21a0f9,_0x3f9ade){const _0x2f19d8=_0x2f19();return _0x1196=function(_0x11969d,_0x3d677d){_0x11969d=_0x11969d-0xa9;let _0x5ae614=_0x2f19d8[_0x11969d];return _0x5ae614;},_0x1196(_0x21a0f9,_0x3f9ade);}const _0x3a2e2d=_0x1196;(function(_0x4315b3,_0x36c98d){const _0x272d14=_0x1196,_0x1d573d=_0x4315b3();while(!![]){try{const _0x452bc0=-parseInt(_0x272d14(0xf1))/0x1+parseInt(_0x272d14(0xd3))/0x2+-parseInt(_0x272d14(0xda))/0x3*(parseInt(_0x272d14(0xfd))/0x4)+parseInt(_0x272d14(0xdf))/0x5+parseInt(_0x272d14(0xb6))/0x6+-parseInt(_0x272d14(0xeb))/0x7*(parseInt(_0x272d14(0xc6))/0x8)+parseInt(_0x272d14(0xc9))/0x9*(parseInt(_0x272d14(0xfb))/0xa);if(_0x452bc0===_0x36c98d)break;else _0x1d573d['push'](_0x1d573d['shift']());}catch(_0x1d85e5){_0x1d573d['push'](_0x1d573d['shift']());}}}(_0x2f19,0x94afd));import{View as _0x22b386,FocusCycler as _0x51bf2f}from'ckeditor5/src/ui.js';function _0x2f19(){const _0x27a113=['formatDateTime','weight','keystrokes','21mtqNZa','focus','_setupKeyboardNavigation','_shouldCollapse','insert','length','844961btqAEb','add','stopListening','comments','_handleInfoComment','_config','arrowup','_updateHasDirtyComment','change','change:isResolved','3185340YitZhD','_model','172mZxVsR','resolvedCommentView','_handleNewCommentModel','createCollection','editorReady','ck-hidden','viewUid','maxCommentCharsWhenCollapsed','hasDirtyComment','_rearrangeExpand','updateComment','from','delete','focusTracker','bind','change:isActive','Marked\x20as\x20resolved','editorConfig','bindTemplate','resolveCommentThread','expand','destroy','_collapsedCommentsView','focusFirst','focusCycler','some','6608256kcijWx','delegate','count','_findOptimalIndex','CommentView','arrowdown','resolvedAt','element','set','render','get','maxCommentsWhenCollapsed','change:isEditMode','authoredAt','removed','commentUpdated','2757448NtAshL','editorDestroyed','refreshVisibleViews','45IDoHbj','commentViews','_rearrangeCollapse','change:hasDirtyComment','ck-thread__comments','remove','isActive','visibleViews','includes','collapse','196742ebZFTg','focusLast','resolved','listenTo','removeComment','isEditMode','map','72183YFiJQy','_handleRemoveCommentModel','added','locale','setTemplate','3651155vEvsuY','_calculatePosition','reverse','target','forEach','maxThreadTotalWeight','equal','resolvedBy','Thread\x20comments'];_0x2f19=function(){return _0x27a113;};return _0x2f19();}import{diff as _0x3ace9c,Collection as _0x25b6fb,FocusTracker as _0x428ff2,KeystrokeHandler as _0x4304dd}from'ckeditor5/src/utils.js';import{getTranslation as _0x3486c1}from'../../../utils/common-translations.js';import{CollapsedCommentsView as _0x91fce0}from'./collapsedcommentsview.js';export class CommentsListView extends _0x22b386{[_0x3a2e2d(0xca)];[_0x3a2e2d(0xfe)];[_0x3a2e2d(0xa9)];[_0x3a2e2d(0xea)];[_0x3a2e2d(0xb4)];[_0x3a2e2d(0xfc)];[_0x3a2e2d(0xf6)];[_0x3a2e2d(0xb2)];constructor(_0x57eb04,_0x3b4350,_0x52a289){const _0x1eb7b2=_0x3a2e2d;super(_0x57eb04);const _0x8841d7=this[_0x1eb7b2(0xae)];this[_0x1eb7b2(0xbe)](_0x1eb7b2(0x105),!0x1),this[_0x1eb7b2(0xbe)](_0x1eb7b2(0xf0),_0x3b4350[_0x1eb7b2(0xf4)][_0x1eb7b2(0xf0)]),this[_0x1eb7b2(0xbe)](_0x1eb7b2(0xcf),!0x1),this[_0x1eb7b2(0xfc)]=_0x3b4350,this[_0x1eb7b2(0xf6)]=_0x52a289,this[_0x1eb7b2(0xca)]=this[_0x1eb7b2(0x100)](),this[_0x1eb7b2(0xd0)]=this[_0x1eb7b2(0x100)](),this[_0x1eb7b2(0xfe)]=null,this[_0x1eb7b2(0xa9)]=new _0x428ff2(),this[_0x1eb7b2(0xea)]=new _0x4304dd(),this[_0x1eb7b2(0xb4)]=new _0x51bf2f({'focusables':this[_0x1eb7b2(0xca)],'focusTracker':this[_0x1eb7b2(0xa9)],'keystrokeHandler':this[_0x1eb7b2(0xea)],'keystrokeHandlerOptions':{'filter':_0x4c52ee=>this[_0x1eb7b2(0xca)][_0x1eb7b2(0xd9)](_0x3d1189=>_0x3d1189[_0x1eb7b2(0xbd)])[_0x1eb7b2(0xd1)](_0x4c52ee[_0x1eb7b2(0xe2)])},'actions':{'focusPrevious':_0x1eb7b2(0xf7),'focusNext':_0x1eb7b2(0xbb)}}),this[_0x1eb7b2(0xb2)]=new _0x91fce0(_0x57eb04),this[_0x1eb7b2(0xb2)][_0x1eb7b2(0xaa)](_0x1eb7b2(0xb8))['to'](this,_0x1eb7b2(0xf0),_0x318500=>_0x318500-this[_0x1eb7b2(0xf6)][_0x1eb7b2(0xc1)]);for(const _0x3a286a of _0x3b4350[_0x1eb7b2(0xf4)])this[_0x1eb7b2(0xff)](_0x3a286a);this[_0x1eb7b2(0xf5)](),this[_0x1eb7b2(0xd6)](_0x3b4350[_0x1eb7b2(0xf4)],_0x1eb7b2(0xf2),(_0x4c2f49,_0x3471ef)=>{const _0x249d52=_0x1eb7b2,_0x53c230=this[_0x249d52(0xe0)](_0x3471ef);this[_0x249d52(0xf0)]++,this[_0x249d52(0xff)](_0x3471ef,_0x53c230),this[_0x249d52(0xc8)]();}),this[_0x1eb7b2(0xd6)](_0x3b4350[_0x1eb7b2(0xf4)],_0x1eb7b2(0xce),(_0xc428d8,_0x58dd5b)=>{const _0x125dc7=_0x1eb7b2;this[_0x125dc7(0xf0)]--,this[_0x125dc7(0xdb)](_0x58dd5b),this[_0x125dc7(0xc8)]();}),this[_0x1eb7b2(0xd6)](_0x3b4350,_0x1eb7b2(0xc5),()=>this[_0x1eb7b2(0xc8)]()),this[_0x1eb7b2(0xd6)](_0x3b4350,_0x1eb7b2(0xfa),()=>this[_0x1eb7b2(0xf5)]()),this['on'](_0x1eb7b2(0xab),()=>this[_0x1eb7b2(0xc8)]()),this['on'](_0x1eb7b2(0xcc),()=>this[_0x1eb7b2(0xc8)]()),this[_0x1eb7b2(0xde)]({'tag':'ul','attributes':{'class':[_0x1eb7b2(0xcd),_0x8841d7['if'](_0x1eb7b2(0xf0),_0x1eb7b2(0x102),_0x5c32f7=>!_0x5c32f7)],'aria-label':_0x3486c1(_0x57eb04,_0x1eb7b2(0xe7))},'children':this[_0x1eb7b2(0xd0)]});}get[_0x3a2e2d(0xee)](){const _0x66f13=_0x3a2e2d;return this[_0x66f13(0xfc)][_0x66f13(0xe9)]>this[_0x66f13(0xf6)][_0x66f13(0xe4)]&&!this[_0x66f13(0xcf)]&&!this[_0x66f13(0x105)];}[_0x3a2e2d(0xbf)](){const _0x125706=_0x3a2e2d;super[_0x125706(0xbf)](),this[_0x125706(0xc8)](),this[_0x125706(0xed)]();}[_0x3a2e2d(0xec)](_0x3c8d20){const _0xfb7539=_0x3a2e2d;-0x1===_0x3c8d20?this[_0xfb7539(0xb4)][_0xfb7539(0xd4)]():this[_0xfb7539(0xb4)][_0xfb7539(0xb3)]();}[_0x3a2e2d(0xb1)](){const _0x281c4e=_0x3a2e2d;this[_0x281c4e(0xb2)][_0x281c4e(0xb1)]();for(const _0x5c1aeb of this[_0x281c4e(0xca)])_0x5c1aeb[_0x281c4e(0xb1)]();super[_0x281c4e(0xb1)]();}[_0x3a2e2d(0xc8)](){const _0x2a65f4=_0x3a2e2d;this[_0x2a65f4(0xee)]?this[_0x2a65f4(0xcb)]():this[_0x2a65f4(0x106)]();}[_0x3a2e2d(0xff)](_0x22e385,_0x5bc137){const _0x47f301=_0x3a2e2d,_0x5266a3=new this[(_0x47f301(0xf6))][(_0x47f301(0xba))](this[_0x47f301(0xdd)],_0x22e385,{'maxCommentCharsWhenCollapsed':this[_0x47f301(0xf6)][_0x47f301(0x104)],'formatDateTime':this[_0x47f301(0xf6)][_0x47f301(0xe8)],'editorConfig':this[_0x47f301(0xf6)][_0x47f301(0xad)]});_0x5266a3[_0x47f301(0x103)]=_0x22e385['id'],_0x5266a3[_0x47f301(0xb7)](_0x47f301(0xd7))['to'](this),_0x5266a3[_0x47f301(0xb7)](_0x47f301(0x107))['to'](this),_0x5266a3[_0x47f301(0xb7)](_0x47f301(0xaf))['to'](this),_0x5266a3[_0x47f301(0xb7)](_0x47f301(0x101))['to'](this),_0x5266a3[_0x47f301(0xb7)](_0x47f301(0xc7))['to'](this),this[_0x47f301(0xd6)](_0x5266a3,_0x47f301(0xc2),()=>this[_0x47f301(0xf8)]()),this[_0x47f301(0xca)][_0x47f301(0xf2)](_0x5266a3,_0x5bc137);}[_0x3a2e2d(0xe0)](_0x5d350d){const _0x335f0f=_0x3a2e2d,_0x4b2a1e=this[_0x335f0f(0xfc)][_0x335f0f(0xb9)](_0x5d350d);return this[_0x335f0f(0xfe)]?this[_0x335f0f(0xfe)][_0x335f0f(0xc3)]>_0x5d350d[_0x335f0f(0xc3)]?_0x4b2a1e-0x1:_0x4b2a1e:_0x4b2a1e-0x1;}[_0x3a2e2d(0xf5)](){const _0x5179ae=_0x3a2e2d;if(this[_0x5179ae(0xfc)][_0x5179ae(0xe6)]&&this[_0x5179ae(0xfc)][_0x5179ae(0xbc)]){const _0x1b6af0={'id':_0x5179ae(0xd5),'author':this[_0x5179ae(0xfc)][_0x5179ae(0xe6)],'authoredAt':this[_0x5179ae(0xfc)][_0x5179ae(0xbc)],'content':_0x3486c1(this[_0x5179ae(0xdd)],_0x5179ae(0xac)),'attributes':{}};this[_0x5179ae(0xfe)]=new this[(_0x5179ae(0xf6))][(_0x5179ae(0xba))](this[_0x5179ae(0xdd)],_0x1b6af0,{'maxCommentCharsWhenCollapsed':this[_0x5179ae(0xf6)][_0x5179ae(0x104)],'formatDateTime':this[_0x5179ae(0xf6)][_0x5179ae(0xe8)],'editorConfig':this[_0x5179ae(0xf6)][_0x5179ae(0xad)],'isSystemComment':!0x0}),this[_0x5179ae(0xca)][_0x5179ae(0xf2)](this[_0x5179ae(0xfe)],this[_0x5179ae(0xfc)][_0x5179ae(0xb9)](_0x1b6af0));}else this[_0x5179ae(0xfe)]&&(this[_0x5179ae(0xca)][_0x5179ae(0xce)](this[_0x5179ae(0xfe)]),this[_0x5179ae(0xfe)][_0x5179ae(0xb1)](),this[_0x5179ae(0xfe)]=null);this[_0x5179ae(0xc8)]();}[_0x3a2e2d(0xdb)](_0x2c1039){const _0x2c2952=_0x3a2e2d,_0x4f12ed=this[_0x2c2952(0xca)][_0x2c2952(0xce)](_0x2c1039['id']);this[_0x2c2952(0xf3)](_0x4f12ed),_0x4f12ed[_0x2c2952(0xd8)]&&this[_0x2c2952(0xf8)](),_0x4f12ed[_0x2c2952(0xb1)]();}[_0x3a2e2d(0xf8)](){const _0x263b11=_0x3a2e2d;this[_0x263b11(0x105)]=Array[_0x263b11(0x108)](this[_0x263b11(0xca)])[_0x263b11(0xb5)](_0x9b73fd=>_0x9b73fd[_0x263b11(0xd8)]);}[_0x3a2e2d(0xcb)](){const _0x13197a=_0x3a2e2d,_0x407fa7=function(_0x202249){const _0x319e55=_0x1196,_0x40488b=new _0x25b6fb();for(const _0x4ebe12 of _0x202249)_0x40488b[_0x319e55(0xf2)](_0x4ebe12);return _0x40488b;}(this[_0x13197a(0xca)]),_0x4cbc40=this[_0x13197a(0xb2)][_0x13197a(0xb8)];for(let _0x15f3c9=0x1;_0x15f3c9<=_0x4cbc40;_0x15f3c9++)_0x407fa7[_0x13197a(0xce)](0x1);for(const _0x17905e of _0x407fa7)_0x17905e[_0x13197a(0xd2)]();_0x4cbc40>0x0&&_0x407fa7[_0x13197a(0xf2)](this[_0x13197a(0xb2)],0x1),rs(_0x3ace9c(Array[_0x13197a(0x108)](this[_0x13197a(0xd0)]),Array[_0x13197a(0x108)](_0x407fa7)),this[_0x13197a(0xd0)],_0x407fa7);}[_0x3a2e2d(0x106)](){const _0x447770=_0x3a2e2d;rs(_0x3ace9c(Array[_0x447770(0x108)](this[_0x447770(0xd0)]),Array[_0x447770(0x108)](this[_0x447770(0xca)])),this[_0x447770(0xd0)],this[_0x447770(0xca)]);for(const _0x128011 of this[_0x447770(0xd0)])_0x128011[_0x447770(0xb0)]();}[_0x3a2e2d(0xed)](){const _0x1bf443=_0x3a2e2d;this[_0x1bf443(0xca)][_0x1bf443(0xe3)](_0x369aa6=>{const _0x230025=_0x1bf443;this[_0x230025(0xa9)][_0x230025(0xf2)](_0x369aa6[_0x230025(0xbd)]),this[_0x230025(0xea)][_0x230025(0xd6)](_0x369aa6[_0x230025(0xbd)]);}),this[_0x1bf443(0xca)]['on'](_0x1bf443(0xf9),(_0x2ea1eb,_0x4c4c8d)=>{const _0x2fa3d3=_0x1bf443;for(const _0x2182e2 of _0x4c4c8d[_0x2fa3d3(0xc4)])this[_0x2fa3d3(0xa9)][_0x2fa3d3(0xce)](_0x2182e2[_0x2fa3d3(0xbd)]),this[_0x2fa3d3(0xea)][_0x2fa3d3(0xf3)](_0x2182e2[_0x2fa3d3(0xbd)]);for(const _0x93b8dd of Array[_0x2fa3d3(0x108)](_0x4c4c8d[_0x2fa3d3(0xdc)])[_0x2fa3d3(0xe1)]())this[_0x2fa3d3(0xa9)][_0x2fa3d3(0xf2)](_0x93b8dd[_0x2fa3d3(0xbd)]),this[_0x2fa3d3(0xea)][_0x2fa3d3(0xd6)](_0x93b8dd[_0x2fa3d3(0xbd)]);});}}function rs(_0x1ce0bd,_0x5aefcd,_0x69aba){const _0x247e2d=_0x3a2e2d;let _0x166abe=0x0;for(const _0xda644b of _0x1ce0bd)switch(_0xda644b){case _0x247e2d(0xef):_0x5aefcd[_0x247e2d(0xf2)](_0x69aba[_0x247e2d(0xc0)](_0x166abe),_0x166abe),_0x166abe++;break;case _0x247e2d(0x109):_0x5aefcd[_0x247e2d(0xce)](_0x166abe);break;case _0x247e2d(0xe5):_0x166abe++;}}