@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 11.4 kB
JavaScript
/*
* 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 _0x23ce1c=_0x3eea;(function(_0x727f42,_0x498048){const _0x379f6e=_0x3eea,_0x112904=_0x727f42();while(!![]){try{const _0x452f03=-parseInt(_0x379f6e(0x11b))/0x1+parseInt(_0x379f6e(0x11d))/0x2*(-parseInt(_0x379f6e(0xcf))/0x3)+parseInt(_0x379f6e(0xca))/0x4*(parseInt(_0x379f6e(0x10f))/0x5)+parseInt(_0x379f6e(0x100))/0x6+-parseInt(_0x379f6e(0x113))/0x7*(parseInt(_0x379f6e(0xde))/0x8)+parseInt(_0x379f6e(0xf7))/0x9+parseInt(_0x379f6e(0x116))/0xa*(parseInt(_0x379f6e(0xc5))/0xb);if(_0x452f03===_0x498048)break;else _0x112904['push'](_0x112904['shift']());}catch(_0x10a9f5){_0x112904['push'](_0x112904['shift']());}}}(_0x4acc,0x2efe1));function _0x3eea(_0x198833,_0x4bc689){const _0x4acc7f=_0x4acc();return _0x3eea=function(_0x3eeaa7,_0x26cef3){_0x3eeaa7=_0x3eeaa7-0xbc;let _0x4d04eb=_0x4acc7f[_0x3eeaa7];return _0x4d04eb;},_0x3eea(_0x198833,_0x4bc689);}import{View as _0x49df93,FocusCycler as _0x32c860}from'ckeditor5/src/ui.js';import{diff as _0x7a008f,Collection as _0x8fc697,FocusTracker as _0x39bc19,KeystrokeHandler as _0x127ecf}from'ckeditor5/src/utils.js';import{getTranslation as _0x2f2f88}from'../../../utils/common-translations.js';import _0xafa19a from'./collapsedcommentsview.js';function _0x4acc(){const _0x304f0f=['element','map','_rearrangeExpand','setTemplate','maxThreadTotalWeight','expand','removed','formatDateTime','isActive','change:isResolved','96456XlBUoB','equal','bind','stopListening','_handleRemoveCommentModel','resolveCommentThread','change:hasDirtyComment','_handleInfoComment','_model','CommentView','resolved','weight','_setupKeyboardNavigation','change:isEditMode','locale','resolvedAt','from','focusLast','editorConfig','arrowup','remove','bindTemplate','Thread\x20comments','_collapsedCommentsView','add','2154951CgbIVm','focus','editorDestroyed','reverse','visibleViews','authoredAt','set','viewUid','maxCommentsWhenCollapsed','412338YJHsfp','comments','get','commentViews','change','focusCycler','collapse','commentUpdated','resolvedBy','ck-thread__comments','hasDirtyComment','render','maxCommentCharsWhenCollapsed','removeComment','_rearrangeCollapse','390oqdYDD','createCollection','listenTo','refreshVisibleViews','217DNHikq','ck-hidden','some','133870ucVAYu','isEditMode','_calculatePosition','insert','editorReady','147302BFiKrP','_updateHasDirtyComment','542RWZrlh','updateComment','length','forEach','resolvedCommentView','delete','_config','_shouldCollapse','delegate','destroy','297bizkbq','arrowdown','Marked\x20as\x20resolved','keystrokes','_findOptimalIndex','6492PxygEK','_handleNewCommentModel','added','count','focusFirst','915ECsfaZ','target','focusTracker','change:isActive','includes'];_0x4acc=function(){return _0x304f0f;};return _0x4acc();}export default class te extends _0x49df93{constructor(_0x3f77cc,_0x30b464,_0x2a96b3){const _0x584194=_0x3eea;super(_0x3f77cc);const _0x57c666=this[_0x584194(0xf3)];this[_0x584194(0xfd)](_0x584194(0x10a),!0x1),this[_0x584194(0xfd)](_0x584194(0xbd),_0x30b464[_0x584194(0x101)][_0x584194(0xbd)]),this[_0x584194(0xfd)](_0x584194(0xdc),!0x1),this[_0x584194(0xe6)]=_0x30b464,this[_0x584194(0xc1)]=_0x2a96b3,this[_0x584194(0x103)]=this[_0x584194(0x110)](),this[_0x584194(0xfb)]=this[_0x584194(0x110)](),this[_0x584194(0xbf)]=null,this[_0x584194(0xd1)]=new _0x39bc19(),this[_0x584194(0xc8)]=new _0x127ecf(),this[_0x584194(0x105)]=new _0x32c860({'focusables':this[_0x584194(0x103)],'focusTracker':this[_0x584194(0xd1)],'keystrokeHandler':this[_0x584194(0xc8)],'keystrokeHandlerOptions':{'filter':_0x19bea2=>this[_0x584194(0x103)][_0x584194(0xd5)](_0x3b52e4=>_0x3b52e4[_0x584194(0xd4)])[_0x584194(0xd3)](_0x19bea2[_0x584194(0xd0)])},'actions':{'focusPrevious':_0x584194(0xf1),'focusNext':_0x584194(0xc6)}}),this[_0x584194(0xf5)]=new _0xafa19a(_0x3f77cc),this[_0x584194(0xf5)][_0x584194(0xe0)](_0x584194(0xcd))['to'](this,_0x584194(0xbd),_0x338db5=>_0x338db5-this[_0x584194(0xc1)][_0x584194(0xff)]);for(const _0x2464c4 of _0x30b464[_0x584194(0x101)])this[_0x584194(0xcb)](_0x2464c4);this[_0x584194(0xe5)](),this[_0x584194(0x111)](_0x30b464[_0x584194(0x101)],_0x584194(0xf6),(_0xe3a744,_0x2ebe37)=>{const _0x402a5e=_0x584194,_0x5a80f3=this[_0x402a5e(0x118)](_0x2ebe37);this[_0x402a5e(0xbd)]++,this[_0x402a5e(0xcb)](_0x2ebe37,_0x5a80f3),this[_0x402a5e(0x112)]();}),this[_0x584194(0x111)](_0x30b464[_0x584194(0x101)],_0x584194(0xf2),(_0x3b744b,_0x4b49ea)=>{const _0x9ed944=_0x584194;this[_0x9ed944(0xbd)]--,this[_0x9ed944(0xe2)](_0x4b49ea),this[_0x9ed944(0x112)]();}),this[_0x584194(0x111)](_0x30b464,_0x584194(0x107),()=>this[_0x584194(0x112)]()),this[_0x584194(0x111)](_0x30b464,_0x584194(0xdd),()=>this[_0x584194(0xe5)]()),this['on'](_0x584194(0xd2),()=>this[_0x584194(0x112)]()),this['on'](_0x584194(0xe4),()=>this[_0x584194(0x112)]()),this[_0x584194(0xd7)]({'tag':'ul','attributes':{'class':[_0x584194(0x109),_0x57c666['if'](_0x584194(0xbd),_0x584194(0x114),_0x188dfa=>!_0x188dfa)],'aria-label':_0x2f2f88(_0x3f77cc,_0x584194(0xf4))},'children':this[_0x584194(0xfb)]});}get[_0x23ce1c(0xc2)](){const _0x217e02=_0x23ce1c;return this[_0x217e02(0xe6)][_0x217e02(0xe9)]>this[_0x217e02(0xc1)][_0x217e02(0xd8)]&&!this[_0x217e02(0xdc)]&&!this[_0x217e02(0x10a)];}[_0x23ce1c(0x10b)](){const _0xf73f0f=_0x23ce1c;super[_0xf73f0f(0x10b)](),this[_0xf73f0f(0x112)](),this[_0xf73f0f(0xea)]();}[_0x23ce1c(0xf8)](_0x1a7fbc){const _0x41c6f4=_0x23ce1c;-0x1===_0x1a7fbc?this[_0x41c6f4(0x105)][_0x41c6f4(0xef)]():this[_0x41c6f4(0x105)][_0x41c6f4(0xce)]();}[_0x23ce1c(0xc4)](){const _0x232497=_0x23ce1c;this[_0x232497(0xf5)][_0x232497(0xc4)]();for(const _0x372db7 of this[_0x232497(0x103)])_0x372db7[_0x232497(0xc4)]();super[_0x232497(0xc4)]();}[_0x23ce1c(0x112)](){const _0x3c900c=_0x23ce1c;this[_0x3c900c(0xc2)]?this[_0x3c900c(0x10e)]():this[_0x3c900c(0xd6)]();}[_0x23ce1c(0xcb)](_0x35eb5e,_0x2168e9){const _0xc03c0b=_0x23ce1c,_0x366b40=new this[(_0xc03c0b(0xc1))][(_0xc03c0b(0xe7))](this[_0xc03c0b(0xec)],_0x35eb5e,{'maxCommentCharsWhenCollapsed':this[_0xc03c0b(0xc1)][_0xc03c0b(0x10c)],'formatDateTime':this[_0xc03c0b(0xc1)][_0xc03c0b(0xdb)],'editorConfig':this[_0xc03c0b(0xc1)][_0xc03c0b(0xf0)]});_0x366b40[_0xc03c0b(0xfe)]=_0x35eb5e['id'],_0x366b40[_0xc03c0b(0xc3)](_0xc03c0b(0x10d))['to'](this),_0x366b40[_0xc03c0b(0xc3)](_0xc03c0b(0xbc))['to'](this),_0x366b40[_0xc03c0b(0xc3)](_0xc03c0b(0xe3))['to'](this),_0x366b40[_0xc03c0b(0xc3)](_0xc03c0b(0x11a))['to'](this),_0x366b40[_0xc03c0b(0xc3)](_0xc03c0b(0xf9))['to'](this),this[_0xc03c0b(0x111)](_0x366b40,_0xc03c0b(0xeb),()=>this[_0xc03c0b(0x11c)]()),this[_0xc03c0b(0x103)][_0xc03c0b(0xf6)](_0x366b40,_0x2168e9);}[_0x23ce1c(0x118)](_0x1a5c0a){const _0x16e54f=_0x23ce1c,_0xad6cb8=this[_0x16e54f(0xe6)][_0x16e54f(0xc9)](_0x1a5c0a);return this[_0x16e54f(0xbf)]?this[_0x16e54f(0xbf)][_0x16e54f(0xfc)]>_0x1a5c0a[_0x16e54f(0xfc)]?_0xad6cb8-0x1:_0xad6cb8:_0xad6cb8-0x1;}[_0x23ce1c(0xe5)](){const _0x6fc9c7=_0x23ce1c;if(this[_0x6fc9c7(0xe6)][_0x6fc9c7(0x108)]&&this[_0x6fc9c7(0xe6)][_0x6fc9c7(0xed)]){const _0x5e61f4={'id':_0x6fc9c7(0xe8),'author':this[_0x6fc9c7(0xe6)][_0x6fc9c7(0x108)],'authoredAt':this[_0x6fc9c7(0xe6)][_0x6fc9c7(0xed)],'content':_0x2f2f88(this[_0x6fc9c7(0xec)],_0x6fc9c7(0xc7)),'attributes':{}};this[_0x6fc9c7(0xbf)]=new this[(_0x6fc9c7(0xc1))][(_0x6fc9c7(0xe7))](this[_0x6fc9c7(0xec)],_0x5e61f4,{'maxCommentCharsWhenCollapsed':this[_0x6fc9c7(0xc1)][_0x6fc9c7(0x10c)],'formatDateTime':this[_0x6fc9c7(0xc1)][_0x6fc9c7(0xdb)],'editorConfig':this[_0x6fc9c7(0xc1)][_0x6fc9c7(0xf0)],'isSystemComment':!0x0}),this[_0x6fc9c7(0x103)][_0x6fc9c7(0xf6)](this[_0x6fc9c7(0xbf)],this[_0x6fc9c7(0xe6)][_0x6fc9c7(0xc9)](_0x5e61f4));}else this[_0x6fc9c7(0xbf)]&&(this[_0x6fc9c7(0x103)][_0x6fc9c7(0xf2)](this[_0x6fc9c7(0xbf)]),this[_0x6fc9c7(0xbf)][_0x6fc9c7(0xc4)](),this[_0x6fc9c7(0xbf)]=null);this[_0x6fc9c7(0x112)]();}[_0x23ce1c(0xe2)](_0x350d87){const _0x30658c=_0x23ce1c,_0x1a7a0c=this[_0x30658c(0x103)][_0x30658c(0xf2)](_0x350d87['id']);this[_0x30658c(0xe1)](_0x1a7a0c),_0x1a7a0c[_0x30658c(0x117)]&&this[_0x30658c(0x11c)](),_0x1a7a0c[_0x30658c(0xc4)]();}[_0x23ce1c(0x11c)](){const _0x1cf65a=_0x23ce1c;this[_0x1cf65a(0x10a)]=Array[_0x1cf65a(0xee)](this[_0x1cf65a(0x103)])[_0x1cf65a(0x115)](_0x562c3d=>_0x562c3d[_0x1cf65a(0x117)]);}[_0x23ce1c(0x10e)](){const _0x368e42=_0x23ce1c,_0x4ccd3b=function(_0x268544){const _0x4a4924=_0x3eea,_0x53fcf2=new _0x8fc697();for(const _0x28f92e of _0x268544)_0x53fcf2[_0x4a4924(0xf6)](_0x28f92e);return _0x53fcf2;}(this[_0x368e42(0x103)]),_0x67cc4c=this[_0x368e42(0xf5)][_0x368e42(0xcd)];for(let _0x183b26=0x1;_0x183b26<=_0x67cc4c;_0x183b26++)_0x4ccd3b[_0x368e42(0xf2)](0x1);for(const _0x25d60a of _0x4ccd3b)_0x25d60a[_0x368e42(0x106)]();_0x67cc4c>0x0&&_0x4ccd3b[_0x368e42(0xf6)](this[_0x368e42(0xf5)],0x1),as(_0x7a008f(Array[_0x368e42(0xee)](this[_0x368e42(0xfb)]),Array[_0x368e42(0xee)](_0x4ccd3b)),this[_0x368e42(0xfb)],_0x4ccd3b);}[_0x23ce1c(0xd6)](){const _0x125ac3=_0x23ce1c;as(_0x7a008f(Array[_0x125ac3(0xee)](this[_0x125ac3(0xfb)]),Array[_0x125ac3(0xee)](this[_0x125ac3(0x103)])),this[_0x125ac3(0xfb)],this[_0x125ac3(0x103)]);for(const _0x56f1cc of this[_0x125ac3(0xfb)])_0x56f1cc[_0x125ac3(0xd9)]();}[_0x23ce1c(0xea)](){const _0x4aebc9=_0x23ce1c;this[_0x4aebc9(0x103)][_0x4aebc9(0xbe)](_0x55dea2=>{const _0x39aeea=_0x4aebc9;this[_0x39aeea(0xd1)][_0x39aeea(0xf6)](_0x55dea2[_0x39aeea(0xd4)]),this[_0x39aeea(0xc8)][_0x39aeea(0x111)](_0x55dea2[_0x39aeea(0xd4)]);}),this[_0x4aebc9(0x103)]['on'](_0x4aebc9(0x104),(_0x20d52e,_0x166c4b)=>{const _0x38fa3b=_0x4aebc9;for(const _0x2befbd of _0x166c4b[_0x38fa3b(0xda)])this[_0x38fa3b(0xd1)][_0x38fa3b(0xf2)](_0x2befbd[_0x38fa3b(0xd4)]),this[_0x38fa3b(0xc8)][_0x38fa3b(0xe1)](_0x2befbd[_0x38fa3b(0xd4)]);for(const _0xea9829 of Array[_0x38fa3b(0xee)](_0x166c4b[_0x38fa3b(0xcc)])[_0x38fa3b(0xfa)]())this[_0x38fa3b(0xd1)][_0x38fa3b(0xf6)](_0xea9829[_0x38fa3b(0xd4)]),this[_0x38fa3b(0xc8)][_0x38fa3b(0x111)](_0xea9829[_0x38fa3b(0xd4)]);});}}function as(_0x3abf2a,_0x2f1273,_0x4b6a0b){const _0x1fc78b=_0x23ce1c;let _0x26ce2a=0x0;for(const _0x4937a0 of _0x3abf2a)switch(_0x4937a0){case _0x1fc78b(0x119):_0x2f1273[_0x1fc78b(0xf6)](_0x4b6a0b[_0x1fc78b(0x102)](_0x26ce2a),_0x26ce2a),_0x26ce2a++;break;case _0x1fc78b(0xc0):_0x2f1273[_0x1fc78b(0xf2)](_0x26ce2a);break;case _0x1fc78b(0xdf):_0x26ce2a++;}}