@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 11.7 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 _0xa9657a=_0x3b6e;(function(_0x371c3d,_0x4018d0){const _0x1a8d25=_0x3b6e,_0x4eb215=_0x371c3d();while(!![]){try{const _0x16f3ed=-parseInt(_0x1a8d25(0x200))/0x1+parseInt(_0x1a8d25(0x1f5))/0x2*(-parseInt(_0x1a8d25(0x202))/0x3)+-parseInt(_0x1a8d25(0x203))/0x4+parseInt(_0x1a8d25(0x211))/0x5+parseInt(_0x1a8d25(0x21d))/0x6+-parseInt(_0x1a8d25(0x205))/0x7*(-parseInt(_0x1a8d25(0x1e4))/0x8)+-parseInt(_0x1a8d25(0x218))/0x9*(-parseInt(_0x1a8d25(0x1f3))/0xa);if(_0x16f3ed===_0x4018d0)break;else _0x4eb215['push'](_0x4eb215['shift']());}catch(_0x19dd4b){_0x4eb215['push'](_0x4eb215['shift']());}}}(_0x7d54,0x2d56a));import{View as _0x47163e,FocusCycler as _0x13e69b}from'ckeditor5/src/ui.js';import{diff as _0x26cfc7,Collection as _0x19bc54,FocusTracker as _0x3c8320,KeystrokeHandler as _0x53f90f}from'ckeditor5/src/utils.js';function _0x7d54(){const _0x5e844b=['resolvedAt','bind','updateComment','count','ck-hidden','expand','remove','add','delegate','Marked\x20as\x20resolved','collapse','focus','resolved','focusLast','_rearrangeExpand','comments','reverse','7512YHDsOI','_setupKeyboardNavigation','hasDirtyComment','_calculatePosition','get','maxCommentCharsWhenCollapsed','bindTemplate','removeComment','stopListening','locale','_handleInfoComment','insert','arrowdown','focusTracker','resolvedBy','2966420ENfhWR','change:hasDirtyComment','586BOxCsJ','_model','maxThreadTotalWeight','Thread\x20comments','resolvedCommentView','added','keystrokes','destroy','_handleRemoveCommentModel','authoredAt','isEditMode','243236kXWWGw','change:isResolved','2478ssXvnG','1151720pKRvWc','render','217GnuOBr','_handleNewCommentModel','formatDateTime','forEach','weight','createCollection','from','editorDestroyed','CommentView','change','map','some','1578840iJQvVW','delete','focusFirst','_config','change:isEditMode','target','_updateHasDirtyComment','18ycuWui','editorConfig','ck-thread__comments','_collapsedCommentsView','equal','124374aoZVpf','isActive','removed','_rearrangeCollapse','setTemplate','focusCycler','element','resolveCommentThread','refreshVisibleViews','_findOptimalIndex','change:isActive','length','set','listenTo','visibleViews','includes','editorReady','viewUid','commentUpdated','_shouldCollapse','arrowup','commentViews','maxCommentsWhenCollapsed'];_0x7d54=function(){return _0x5e844b;};return _0x7d54();}function _0x3b6e(_0x21c1e4,_0x3a14cb){const _0x7d54f9=_0x7d54();return _0x3b6e=function(_0x3b6ed1,_0x483d5b){_0x3b6ed1=_0x3b6ed1-0x1ca;let _0x493c8e=_0x7d54f9[_0x3b6ed1];return _0x493c8e;},_0x3b6e(_0x21c1e4,_0x3a14cb);}import{getTranslation as _0x19595a}from'../../../utils/common-translations.js';import _0x2fce0a from'./collapsedcommentsview.js';export default class te extends _0x47163e{[_0xa9657a(0x1d1)];[_0xa9657a(0x1f9)];[_0xa9657a(0x1f1)];[_0xa9657a(0x1fb)];[_0xa9657a(0x222)];[_0xa9657a(0x1f6)];[_0xa9657a(0x214)];[_0xa9657a(0x21b)];constructor(_0x47deaf,_0x3498e3,_0x88aa2){const _0x52fc85=_0xa9657a;super(_0x47deaf);const _0x595d1f=this[_0x52fc85(0x1ea)];this[_0x52fc85(0x229)](_0x52fc85(0x1e6),!0x1),this[_0x52fc85(0x229)](_0x52fc85(0x228),_0x3498e3[_0x52fc85(0x1e2)][_0x52fc85(0x228)]),this[_0x52fc85(0x229)](_0x52fc85(0x21e),!0x1),this[_0x52fc85(0x1f6)]=_0x3498e3,this[_0x52fc85(0x214)]=_0x88aa2,this[_0x52fc85(0x1d1)]=this[_0x52fc85(0x20a)](),this[_0x52fc85(0x1ca)]=this[_0x52fc85(0x20a)](),this[_0x52fc85(0x1f9)]=null,this[_0x52fc85(0x1f1)]=new _0x3c8320(),this[_0x52fc85(0x1fb)]=new _0x53f90f(),this[_0x52fc85(0x222)]=new _0x13e69b({'focusables':this[_0x52fc85(0x1d1)],'focusTracker':this[_0x52fc85(0x1f1)],'keystrokeHandler':this[_0x52fc85(0x1fb)],'keystrokeHandlerOptions':{'filter':_0x515704=>this[_0x52fc85(0x1d1)][_0x52fc85(0x20f)](_0xe25136=>_0xe25136[_0x52fc85(0x223)])[_0x52fc85(0x1cb)](_0x515704[_0x52fc85(0x216)])},'actions':{'focusPrevious':_0x52fc85(0x1d0),'focusNext':_0x52fc85(0x1f0)}}),this[_0x52fc85(0x21b)]=new _0x2fce0a(_0x47deaf),this[_0x52fc85(0x21b)][_0x52fc85(0x1d4)](_0x52fc85(0x1d6))['to'](this,_0x52fc85(0x228),_0x2086f6=>_0x2086f6-this[_0x52fc85(0x214)][_0x52fc85(0x1d2)]);for(const _0x2d8b2b of _0x3498e3[_0x52fc85(0x1e2)])this[_0x52fc85(0x206)](_0x2d8b2b);this[_0x52fc85(0x1ee)](),this[_0x52fc85(0x22a)](_0x3498e3[_0x52fc85(0x1e2)],_0x52fc85(0x1da),(_0x73354a,_0x48b5e9)=>{const _0x447540=_0x52fc85,_0x5e9888=this[_0x447540(0x1e7)](_0x48b5e9);this[_0x447540(0x228)]++,this[_0x447540(0x206)](_0x48b5e9,_0x5e9888),this[_0x447540(0x225)]();}),this[_0x52fc85(0x22a)](_0x3498e3[_0x52fc85(0x1e2)],_0x52fc85(0x1d9),(_0x7a4a1d,_0x337bd5)=>{const _0xf60f28=_0x52fc85;this[_0xf60f28(0x228)]--,this[_0xf60f28(0x1fd)](_0x337bd5),this[_0xf60f28(0x225)]();}),this[_0x52fc85(0x22a)](_0x3498e3,_0x52fc85(0x1ce),()=>this[_0x52fc85(0x225)]()),this[_0x52fc85(0x22a)](_0x3498e3,_0x52fc85(0x201),()=>this[_0x52fc85(0x1ee)]()),this['on'](_0x52fc85(0x227),()=>this[_0x52fc85(0x225)]()),this['on'](_0x52fc85(0x1f4),()=>this[_0x52fc85(0x225)]()),this[_0x52fc85(0x221)]({'tag':'ul','attributes':{'class':[_0x52fc85(0x21a),_0x595d1f['if'](_0x52fc85(0x228),_0x52fc85(0x1d7),_0x226902=>!_0x226902)],'aria-label':_0x19595a(_0x47deaf,_0x52fc85(0x1f8))},'children':this[_0x52fc85(0x1ca)]});}get[_0xa9657a(0x1cf)](){const _0x5afc9b=_0xa9657a;return this[_0x5afc9b(0x1f6)][_0x5afc9b(0x209)]>this[_0x5afc9b(0x214)][_0x5afc9b(0x1f7)]&&!this[_0x5afc9b(0x21e)]&&!this[_0x5afc9b(0x1e6)];}[_0xa9657a(0x204)](){const _0x4c71f0=_0xa9657a;super[_0x4c71f0(0x204)](),this[_0x4c71f0(0x225)](),this[_0x4c71f0(0x1e5)]();}[_0xa9657a(0x1de)](_0x3d9352){const _0x42a0f8=_0xa9657a;-0x1===_0x3d9352?this[_0x42a0f8(0x222)][_0x42a0f8(0x1e0)]():this[_0x42a0f8(0x222)][_0x42a0f8(0x213)]();}[_0xa9657a(0x1fc)](){const _0x31cda9=_0xa9657a;this[_0x31cda9(0x21b)][_0x31cda9(0x1fc)]();for(const _0x36aeb4 of this[_0x31cda9(0x1d1)])_0x36aeb4[_0x31cda9(0x1fc)]();super[_0x31cda9(0x1fc)]();}[_0xa9657a(0x225)](){const _0x101227=_0xa9657a;this[_0x101227(0x1cf)]?this[_0x101227(0x220)]():this[_0x101227(0x1e1)]();}[_0xa9657a(0x206)](_0x282c23,_0x5c9491){const _0x2feb1a=_0xa9657a,_0x31cf38=new this[(_0x2feb1a(0x214))][(_0x2feb1a(0x20d))](this[_0x2feb1a(0x1ed)],_0x282c23,{'maxCommentCharsWhenCollapsed':this[_0x2feb1a(0x214)][_0x2feb1a(0x1e9)],'formatDateTime':this[_0x2feb1a(0x214)][_0x2feb1a(0x207)],'editorConfig':this[_0x2feb1a(0x214)][_0x2feb1a(0x219)]});_0x31cf38[_0x2feb1a(0x1cd)]=_0x282c23['id'],_0x31cf38[_0x2feb1a(0x1db)](_0x2feb1a(0x1eb))['to'](this),_0x31cf38[_0x2feb1a(0x1db)](_0x2feb1a(0x1d5))['to'](this),_0x31cf38[_0x2feb1a(0x1db)](_0x2feb1a(0x224))['to'](this),_0x31cf38[_0x2feb1a(0x1db)](_0x2feb1a(0x1cc))['to'](this),_0x31cf38[_0x2feb1a(0x1db)](_0x2feb1a(0x20c))['to'](this),this[_0x2feb1a(0x22a)](_0x31cf38,_0x2feb1a(0x215),()=>this[_0x2feb1a(0x217)]()),this[_0x2feb1a(0x1d1)][_0x2feb1a(0x1da)](_0x31cf38,_0x5c9491);}[_0xa9657a(0x1e7)](_0x5952e3){const _0x37f27a=_0xa9657a,_0x2601e2=this[_0x37f27a(0x1f6)][_0x37f27a(0x226)](_0x5952e3);return this[_0x37f27a(0x1f9)]?this[_0x37f27a(0x1f9)][_0x37f27a(0x1fe)]>_0x5952e3[_0x37f27a(0x1fe)]?_0x2601e2-0x1:_0x2601e2:_0x2601e2-0x1;}[_0xa9657a(0x1ee)](){const _0x2ee9f6=_0xa9657a;if(this[_0x2ee9f6(0x1f6)][_0x2ee9f6(0x1f2)]&&this[_0x2ee9f6(0x1f6)][_0x2ee9f6(0x1d3)]){const _0x21ed68={'id':_0x2ee9f6(0x1df),'author':this[_0x2ee9f6(0x1f6)][_0x2ee9f6(0x1f2)],'authoredAt':this[_0x2ee9f6(0x1f6)][_0x2ee9f6(0x1d3)],'content':_0x19595a(this[_0x2ee9f6(0x1ed)],_0x2ee9f6(0x1dc)),'attributes':{}};this[_0x2ee9f6(0x1f9)]=new this[(_0x2ee9f6(0x214))][(_0x2ee9f6(0x20d))](this[_0x2ee9f6(0x1ed)],_0x21ed68,{'maxCommentCharsWhenCollapsed':this[_0x2ee9f6(0x214)][_0x2ee9f6(0x1e9)],'formatDateTime':this[_0x2ee9f6(0x214)][_0x2ee9f6(0x207)],'editorConfig':this[_0x2ee9f6(0x214)][_0x2ee9f6(0x219)],'isSystemComment':!0x0}),this[_0x2ee9f6(0x1d1)][_0x2ee9f6(0x1da)](this[_0x2ee9f6(0x1f9)],this[_0x2ee9f6(0x1f6)][_0x2ee9f6(0x226)](_0x21ed68));}else this[_0x2ee9f6(0x1f9)]&&(this[_0x2ee9f6(0x1d1)][_0x2ee9f6(0x1d9)](this[_0x2ee9f6(0x1f9)]),this[_0x2ee9f6(0x1f9)][_0x2ee9f6(0x1fc)](),this[_0x2ee9f6(0x1f9)]=null);this[_0x2ee9f6(0x225)]();}[_0xa9657a(0x1fd)](_0x1cbc76){const _0x4bcfcd=_0xa9657a,_0x3039ff=this[_0x4bcfcd(0x1d1)][_0x4bcfcd(0x1d9)](_0x1cbc76['id']);this[_0x4bcfcd(0x1ec)](_0x3039ff),_0x3039ff[_0x4bcfcd(0x1ff)]&&this[_0x4bcfcd(0x217)](),_0x3039ff[_0x4bcfcd(0x1fc)]();}[_0xa9657a(0x217)](){const _0x201648=_0xa9657a;this[_0x201648(0x1e6)]=Array[_0x201648(0x20b)](this[_0x201648(0x1d1)])[_0x201648(0x210)](_0x3822c0=>_0x3822c0[_0x201648(0x1ff)]);}[_0xa9657a(0x220)](){const _0x4707cb=_0xa9657a,_0x3749dd=function(_0x40fa65){const _0x5e7d27=_0x3b6e,_0x3454f2=new _0x19bc54();for(const _0x272083 of _0x40fa65)_0x3454f2[_0x5e7d27(0x1da)](_0x272083);return _0x3454f2;}(this[_0x4707cb(0x1d1)]),_0x29ccd2=this[_0x4707cb(0x21b)][_0x4707cb(0x1d6)];for(let _0x45fb6c=0x1;_0x45fb6c<=_0x29ccd2;_0x45fb6c++)_0x3749dd[_0x4707cb(0x1d9)](0x1);for(const _0x312e8e of _0x3749dd)_0x312e8e[_0x4707cb(0x1dd)]();_0x29ccd2>0x0&&_0x3749dd[_0x4707cb(0x1da)](this[_0x4707cb(0x21b)],0x1),ns(_0x26cfc7(Array[_0x4707cb(0x20b)](this[_0x4707cb(0x1ca)]),Array[_0x4707cb(0x20b)](_0x3749dd)),this[_0x4707cb(0x1ca)],_0x3749dd);}[_0xa9657a(0x1e1)](){const _0x781496=_0xa9657a;ns(_0x26cfc7(Array[_0x781496(0x20b)](this[_0x781496(0x1ca)]),Array[_0x781496(0x20b)](this[_0x781496(0x1d1)])),this[_0x781496(0x1ca)],this[_0x781496(0x1d1)]);for(const _0x5e6d87 of this[_0x781496(0x1ca)])_0x5e6d87[_0x781496(0x1d8)]();}[_0xa9657a(0x1e5)](){const _0x4f8b5f=_0xa9657a;this[_0x4f8b5f(0x1d1)][_0x4f8b5f(0x208)](_0x5c32ea=>{const _0x28ee2f=_0x4f8b5f;this[_0x28ee2f(0x1f1)][_0x28ee2f(0x1da)](_0x5c32ea[_0x28ee2f(0x223)]),this[_0x28ee2f(0x1fb)][_0x28ee2f(0x22a)](_0x5c32ea[_0x28ee2f(0x223)]);}),this[_0x4f8b5f(0x1d1)]['on'](_0x4f8b5f(0x20e),(_0x472eec,_0x519ef4)=>{const _0x1f399d=_0x4f8b5f;for(const _0x279835 of _0x519ef4[_0x1f399d(0x21f)])this[_0x1f399d(0x1f1)][_0x1f399d(0x1d9)](_0x279835[_0x1f399d(0x223)]),this[_0x1f399d(0x1fb)][_0x1f399d(0x1ec)](_0x279835[_0x1f399d(0x223)]);for(const _0x31c7e6 of Array[_0x1f399d(0x20b)](_0x519ef4[_0x1f399d(0x1fa)])[_0x1f399d(0x1e3)]())this[_0x1f399d(0x1f1)][_0x1f399d(0x1da)](_0x31c7e6[_0x1f399d(0x223)]),this[_0x1f399d(0x1fb)][_0x1f399d(0x22a)](_0x31c7e6[_0x1f399d(0x223)]);});}}function ns(_0x10cfe4,_0x266255,_0x22760d){const _0x20644d=_0xa9657a;let _0x573e6f=0x0;for(const _0x1d51cc of _0x10cfe4)switch(_0x1d51cc){case _0x20644d(0x1ef):_0x266255[_0x20644d(0x1da)](_0x22760d[_0x20644d(0x1e8)](_0x573e6f),_0x573e6f),_0x573e6f++;break;case _0x20644d(0x212):_0x266255[_0x20644d(0x1d9)](_0x573e6f);break;case _0x20644d(0x21c):_0x573e6f++;}}