@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 15.8 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 _0x5ed191=_0x120d;(function(_0x16fa84,_0x310025){const _0x504ded=_0x120d,_0x448275=_0x16fa84();while(!![]){try{const _0x1a26c2=parseInt(_0x504ded(0xcc))/0x1+-parseInt(_0x504ded(0x10d))/0x2*(-parseInt(_0x504ded(0xd1))/0x3)+-parseInt(_0x504ded(0xf7))/0x4+parseInt(_0x504ded(0x127))/0x5*(-parseInt(_0x504ded(0x121))/0x6)+-parseInt(_0x504ded(0x134))/0x7*(parseInt(_0x504ded(0x136))/0x8)+parseInt(_0x504ded(0x11f))/0x9+-parseInt(_0x504ded(0x13b))/0xa*(-parseInt(_0x504ded(0x149))/0xb);if(_0x1a26c2===_0x310025)break;else _0x448275['push'](_0x448275['shift']());}catch(_0x254e7d){_0x448275['push'](_0x448275['shift']());}}}(_0x5bb0,0x1e0b5));import{ContextPlugin as _0x40ef37,Context as _0x3c129e}from'ckeditor5/src/core.js';function _0x5bb0(){const _0x55a08d=['attach','NarrowSidebar','has','hasDomSelection','Annotations','bind','_updateBalloonPosition','find','preventClosingBalloon','addEventListener','set:container','destroy','high','delete','type','stopPropagation','removeEventListener','resize','_integrateWithEditorAnnotations','get','getSidebarItemView','includes','editors','370332QDpAcv','locale','cancel','refreshVisibility','_manuallyClosedAnnotationViews','defaultPositions','change:height','keydown','activeAnnotation','narrowsidebar-detach-not-attached','_setSelectedAnnotations','focus','low','setActiveAnnotation','view','annotationType','isPremiumPlugin','southArrowNorth','plugins','element','_editorAnnotations','narrowsidebar-attach-already-attached','30WZvXhc','southArrowNorthWest','stopListening','_hideBalloon','requires','isDirty','balloonPanelView','values','from','off','EditorAnnotations','clear','isOfficialPlugin','pin','_annotationToNarrowView','northArrowSouthEast','getByView','refresh','1508787NEAlqg','getOrderedSelectedAnnotations','6zcQhTM','blur','Esc','_detachFromContainer','isVisible','execute','11345KbyeuZ','_detachListeners','rearrange','add','refreshPositioning','mousedown','attachToDom','listenTo','register','ready','_selectedAnnotations','number','first','850892KlRTCB','change:container','8VVOYyP','keyCode','_showBalloon','content','isAttached','10YdGvMu','_destroyEditorAnnotationsIntegration','_attachListeners','_domEmitter','_refreshPositioningDebounced','northArrowSouth','southArrowNorthEast','esc','detachFromDom','_attachToContainer','stop','annotations','_annotations','contains','360305MrQpBe','107136XpZXqa','narrowSidebar','bodyCollection','ck-sidebar--narrow','uiUpdate','6387fqTFka','northArrowSouthWest','preventDefault','target','addAnnotation','init','focusableElements','context','unpin','length','pluginName','detach','_refreshPositioning','set','remove'];_0x5bb0=function(){return _0x55a08d;};return _0x5bb0();}import{AnnotationsUIs as _0x4b5431}from'./annotationsuis.js';import{Sidebar as _0x4278e6}from'./sidebar.js';import{AnnotationCounterButtonView as _0x14429f}from'./view/annotationcounterbuttonview.js';import{BalloonPanelView as _0x341f11,BodyCollection as _0x46cd96}from'ckeditor5/src/ui.js';import{CKEditorError as _0x4e548a,DomEmitterMixin as _0x197729,keyCodes as _0x7d9f1,Collection as _0x382c02}from'ckeditor5/src/utils.js';import'../../theme/sidebar-narrow.css';function _0x120d(_0x32f7a8,_0x5b540a){const _0x5bb0fc=_0x5bb0();return _0x120d=function(_0x120df9,_0x305543){_0x120df9=_0x120df9-0xcc;let _0x15cacf=_0x5bb0fc[_0x120df9];return _0x15cacf;},_0x120d(_0x32f7a8,_0x5b540a);}import{debounce as _0x544562}from'es-toolkit/compat';export class NarrowSidebar extends _0x40ef37{[_0x5ed191(0x13a)];[_0x5ed191(0x146)];[_0x5ed191(0xfb)];[_0x5ed191(0x13e)];[_0x5ed191(0x11b)];[_0x5ed191(0x131)];[_0x5ed191(0x10b)];[_0x5ed191(0x13f)];static get[_0x5ed191(0x111)](){return[_0x4278e6,_0x4b5431];}static get[_0x5ed191(0xdb)](){const _0x1eb838=_0x5ed191;return _0x1eb838(0xe1);}static get[_0x5ed191(0x119)](){return!0x0;}static get[_0x5ed191(0x107)](){return!0x0;}constructor(_0x2fa148){const _0x187b89=_0x5ed191;super(_0x2fa148),this[_0x187b89(0x13a)]=!0x1,this[_0x187b89(0xfb)]=new Set(),this[_0x187b89(0x13e)]=new(_0x197729())(),this[_0x187b89(0x11b)]=new Map(),this[_0x187b89(0xde)](_0x187b89(0xff),null),this[_0x187b89(0x146)]=null,this[_0x187b89(0x131)]=[],this[_0x187b89(0x10b)]=new _0x382c02(),this[_0x187b89(0x13f)]=_0x544562(()=>{const _0x7bc18c=_0x187b89;this[_0x7bc18c(0xdd)]();},0xfa,{'leading':!0x1});}[_0x5ed191(0xd6)](){const _0x2c3c80=_0x5ed191;this[_0x2c3c80(0xd8)][_0x2c3c80(0x109)][_0x2c3c80(0xf3)](_0x4b5431)[_0x2c3c80(0x12f)](_0x2c3c80(0xcd),this),this[_0x2c3c80(0xce)]=new _0x46cd96(this[_0x2c3c80(0xd8)][_0x2c3c80(0xf8)]),this[_0x2c3c80(0x113)]=new _0x341f11(this[_0x2c3c80(0xd8)][_0x2c3c80(0xf8)]),this[_0x2c3c80(0xce)][_0x2c3c80(0x12d)](),this[_0x2c3c80(0xce)][_0x2c3c80(0x12a)](this[_0x2c3c80(0x113)]);}[_0x5ed191(0xe0)](_0x3e2c86){const _0x14fa70=_0x5ed191;this[_0x14fa70(0x146)]=_0x3e2c86;const _0xb45a07=this[_0x14fa70(0xd8)][_0x14fa70(0x109)][_0x14fa70(0xf3)](_0x4278e6),_0x24fd55=this[_0x14fa70(0x113)];if(_0xb45a07[_0x14fa70(0x147)]=_0x3e2c86,this[_0x14fa70(0x13a)])throw new _0x4e548a(_0x14fa70(0x10c),this);this[_0x14fa70(0x13a)]=!0x0,this[_0x14fa70(0x12e)](_0xb45a07,_0x14fa70(0xea),()=>{const _0x56f135=_0x14fa70;this[_0x56f135(0xdc)](),this[_0x56f135(0x12e)](_0xb45a07,_0x56f135(0x135),_0x3933a6=>{const _0x9fc445=_0x56f135;_0x3933a6[_0x9fc445(0x116)](),this[_0x9fc445(0xe0)](_0x3e2c86);});}),_0xb45a07[_0x14fa70(0x144)]({'viewClass':_0x14fa70(0xcf),'spaceBetweenItems':0x5});const _0x53b899=_0x337e30=>{const _0x400ff6=_0x14fa70,_0x4b25a9=new _0x14429f(this[_0x400ff6(0xd8)][_0x400ff6(0xf8)]);_0xb45a07[_0x400ff6(0xd5)](_0x337e30,_0x4b25a9),this[_0x400ff6(0x11b)][_0x400ff6(0xde)](_0x337e30,_0x4b25a9),_0x4b25a9[_0x400ff6(0xe5)](_0x400ff6(0x112),_0x400ff6(0x106),_0x400ff6(0x132))['to'](_0x337e30[_0x400ff6(0x105)],_0x400ff6(0x112),_0x400ff6(0xee),_0x400ff6(0xda)),_0x4b25a9['on'](_0x400ff6(0x126),()=>{const _0x7bf596=_0x400ff6;this[_0x7bf596(0xfb)][_0x7bf596(0x118)](),_0x24fd55[_0x7bf596(0x139)][_0x7bf596(0x133)]!==_0x337e30[_0x7bf596(0x105)]?(this[_0x7bf596(0x138)](_0x337e30),_0x337e30[_0x7bf596(0x105)][_0x7bf596(0x10a)][_0x7bf596(0x102)](),this[_0x7bf596(0x104)](_0x337e30)):this[_0x7bf596(0x104)](null);});};for(const _0x229bdd of _0x3e2c86)_0x53b899(_0x229bdd);this[_0x14fa70(0x12e)](_0x3e2c86,_0x14fa70(0x12a),(_0x35d3fa,_0x47ffac)=>{_0x53b899(_0x47ffac);}),this[_0x14fa70(0x12e)](_0x3e2c86,_0x14fa70(0xdf),(_0x50fd36,_0x31d976,_0xd1cfbc)=>{const _0x3b519e=_0x14fa70;this[_0x3b519e(0x11b)][_0x3b519e(0xf3)](_0x31d976)[_0x3b519e(0xeb)](),this[_0x3b519e(0x11b)][_0x3b519e(0xed)](_0x31d976),_0xb45a07[_0x3b519e(0x129)]({'removedAnnotation':_0x31d976,'previousAnnotation':_0x3e2c86[_0x3b519e(0xf3)](_0xd1cfbc-0x1),'nextAnnotation':_0x3e2c86[_0x3b519e(0xf3)](_0xd1cfbc+0x1)}),_0x31d976===this[_0x3b519e(0xff)]&&this[_0x3b519e(0x104)](null);},{'priority':_0x14fa70(0x103)}),this[_0x14fa70(0x12e)](_0x3e2c86,_0x14fa70(0x102),(_0xf2f0f2,_0x52ffb3)=>{const _0x106da9=_0x14fa70;this[_0x106da9(0x104)](_0x52ffb3);}),this[_0x14fa70(0x12e)](_0x3e2c86,_0x14fa70(0x122),()=>{const _0x1c817a=_0x14fa70;this[_0x1c817a(0x104)](null);}),this[_0x14fa70(0x13e)][_0x14fa70(0x12e)](document,_0x14fa70(0xfe),(_0x197a74,_0x1a204d)=>{const _0x1a773f=_0x14fa70;_0x1a204d[_0x1a773f(0x137)]===_0x7d9f1[_0x1a773f(0x142)]&&_0x24fd55[_0x1a773f(0x125)]&&(this[_0x1a773f(0xfb)][_0x1a773f(0x12a)](_0x24fd55[_0x1a773f(0x139)][_0x1a773f(0x133)]),this[_0x1a773f(0x110)](),_0x1a204d[_0x1a773f(0xef)](),_0x1a204d[_0x1a773f(0xd3)]());}),this[_0x14fa70(0x13e)][_0x14fa70(0x12e)](document,_0x14fa70(0x12c),(_0x8dd08,_0x2f2340)=>{const _0x3d311c=_0x14fa70,_0xc51403=_0x2f2340[_0x3d311c(0xd4)];_0x24fd55[_0x3d311c(0x125)]&&_0x24fd55[_0x3d311c(0x10a)][_0x3d311c(0x148)](_0xc51403)||_0xb45a07[_0x3d311c(0x105)][_0x3d311c(0x10a)][_0x3d311c(0x148)](_0xc51403)||_0x8dd08[_0x3d311c(0xe8)]||this[_0x3d311c(0xff)]&&this[_0x3d311c(0xff)][_0x3d311c(0xd7)][_0x3d311c(0xe7)](_0x31de12=>_0x31de12[_0x3d311c(0x148)](_0xc51403))||(this[_0x3d311c(0xfb)][_0x3d311c(0x118)](),this[_0x3d311c(0x110)](),this[_0x3d311c(0x104)](null));});const _0x537a35=this[_0x14fa70(0xd8)]instanceof _0x3c129e?this[_0x14fa70(0xd8)][_0x14fa70(0xf6)]:new _0x382c02([this[_0x14fa70(0xd8)]]);for(const _0x234e86 of _0x537a35)this[_0x14fa70(0xf2)](_0x234e86);this[_0x14fa70(0x12e)](_0x537a35,_0x14fa70(0x12a),(_0x56b504,_0x507da9)=>{const _0x584ca1=_0x14fa70;this[_0x584ca1(0x12e)](_0x507da9,_0x584ca1(0x130),()=>{const _0x29de7d=_0x584ca1;this[_0x29de7d(0xf2)](_0x507da9);});}),this[_0x14fa70(0x12e)](_0x537a35,_0x14fa70(0xdf),(_0xc9af0,_0xb057ad)=>{const _0x49a95b=_0x14fa70;_0xb057ad[_0x49a95b(0x109)][_0x49a95b(0xe2)](_0x49a95b(0x117))&&this[_0x49a95b(0x13c)](_0xb057ad[_0x49a95b(0x109)][_0x49a95b(0xf3)](_0x49a95b(0x117)));}),window[_0x14fa70(0xe9)](_0x14fa70(0xf1),this[_0x14fa70(0x13f)]),this[_0x14fa70(0xdd)]();}[_0x5ed191(0x104)](_0x36ff46){const _0x51f184=_0x5ed191;if(_0x36ff46===this[_0x51f184(0xff)])return;const _0x3ea97d=this[_0x51f184(0xd8)][_0x51f184(0x109)][_0x51f184(0xf3)](_0x4278e6);if(_0x3ea97d[_0x51f184(0x11e)]({'blurredAnnotation':this[_0x51f184(0xff)],'activatedAnnotation':_0x36ff46,'disableAnimationOnActivatedAnnotation':!0x0}),_0x36ff46)_0x3ea97d[_0x51f184(0xf4)](_0x36ff46)?this[_0x51f184(0x138)](_0x36ff46):this[_0x51f184(0x110)]();else this[_0x51f184(0x110)]();this[_0x51f184(0xff)]=_0x36ff46;}[_0x5ed191(0xdc)](){const _0x41d155=_0x5ed191;if(!this[_0x41d155(0x13a)])throw new _0x4e548a(_0x41d155(0x100),this);this[_0x41d155(0x104)](null);const _0x2814bb=this[_0x41d155(0xd8)][_0x41d155(0x109)][_0x41d155(0xf3)](_0x4278e6);this[_0x41d155(0x110)](),Array[_0x41d155(0x115)](this[_0x41d155(0x11b)][_0x41d155(0x114)](),_0x1f17f6=>_0x1f17f6[_0x41d155(0xeb)]()),this[_0x41d155(0x11b)][_0x41d155(0x118)](),_0x2814bb[_0x41d155(0x124)](this[_0x41d155(0x146)]),this[_0x41d155(0x10f)](),this[_0x41d155(0x13e)][_0x41d155(0x10f)](),this[_0x41d155(0xd8)]instanceof _0x3c129e&&this[_0x41d155(0x10f)](this[_0x41d155(0xd8)][_0x41d155(0xf6)]);for(const _0x36212f of Array[_0x41d155(0x115)](this[_0x41d155(0x10b)]))this[_0x41d155(0x13c)](_0x36212f);window[_0x41d155(0xf0)](_0x41d155(0xf1),this[_0x41d155(0x13f)]),this[_0x41d155(0x13f)][_0x41d155(0xf9)](),this[_0x41d155(0x131)]=[],this[_0x41d155(0x13a)]=!0x1,this[_0x41d155(0x146)]=null;}[_0x5ed191(0xeb)](){const _0x4b8d55=_0x5ed191;this[_0x4b8d55(0x13a)]&&this[_0x4b8d55(0xdc)](),this[_0x4b8d55(0xce)][_0x4b8d55(0x143)]();}[_0x5ed191(0xf2)](_0x17c3e8){const _0xbb172e=_0x5ed191;if(!_0x17c3e8[_0xbb172e(0x109)][_0xbb172e(0xe2)](_0xbb172e(0x117)))return;const _0x2c4650=_0x17c3e8[_0xbb172e(0x109)][_0xbb172e(0xf3)](_0xbb172e(0x117)),_0x4b8d73=this[_0xbb172e(0xd8)][_0xbb172e(0x109)][_0xbb172e(0xf3)](_0x4278e6),_0x466a10=this[_0xbb172e(0x146)],_0x5336e8=this[_0xbb172e(0x113)],_0x3dee49=()=>{const _0x33e7c1=_0xbb172e,_0xdb5f48=_0x2c4650[_0x33e7c1(0x120)]({'annotations':this[_0x33e7c1(0x146)],'activeAnnotation':this[_0x33e7c1(0xff)]});this[_0x33e7c1(0x101)](_0xdb5f48),this[_0x33e7c1(0x104)](_0xdb5f48[0x0]||null);};this[_0xbb172e(0x12e)](_0x2c4650,_0xbb172e(0x11e),_0x3dee49),this[_0xbb172e(0x12e)](_0x2c4650,_0xbb172e(0x122),(_0x46fa60,{isAnnotationTracked:_0x1dfaee})=>{const _0x3d306a=_0xbb172e;this[_0x3d306a(0xff)]&&_0x1dfaee(this[_0x3d306a(0xff)])&&(this[_0x3d306a(0x101)]([]),this[_0x3d306a(0x104)](null));}),this[_0xbb172e(0x12e)](_0x2c4650,_0xbb172e(0xd0),()=>{const _0x3ec9b0=_0xbb172e;this[_0x3ec9b0(0x13f)]();}),this[_0xbb172e(0x12e)](_0x466a10,_0xbb172e(0x122),_0x5693d8=>{const _0x200f9e=_0xbb172e;_0x2c4650[_0x200f9e(0xe3)]()&&_0x5693d8[_0x200f9e(0x145)]();},{'priority':_0xbb172e(0xec)}),this[_0xbb172e(0x12e)](this[_0xbb172e(0x13e)],_0xbb172e(0x12c),(_0x2bfc12,_0x27f851)=>{const _0x1c6742=_0xbb172e,_0x9ae3bb=_0x27f851[_0x1c6742(0xd4)];_0x5336e8[_0x1c6742(0x125)]&&_0x5336e8[_0x1c6742(0x10a)][_0x1c6742(0x148)](_0x9ae3bb)||_0x4b8d73[_0x1c6742(0x105)][_0x1c6742(0x10a)][_0x1c6742(0x148)](_0x9ae3bb)||this[_0x1c6742(0xff)]&&_0x2c4650[_0x1c6742(0xe3)]()&&(_0x3dee49(),_0x2bfc12[_0x1c6742(0xe8)]=!0x0);},{'priority':_0xbb172e(0xec)}),this[_0xbb172e(0x10b)][_0xbb172e(0x12a)](_0x2c4650);}[_0x5ed191(0x13c)](_0x2a7045){const _0x436203=_0x5ed191;_0x2a7045&&(this[_0x436203(0x10f)](_0x2a7045),this[_0x436203(0x10b)][_0x436203(0xdf)](_0x2a7045));}[_0x5ed191(0x101)](_0x2dc3fe){const _0x10298e=_0x5ed191;for(const _0x573f97 of this[_0x10298e(0x131)])_0x2dc3fe[_0x10298e(0xf5)](_0x573f97)||this[_0x10298e(0xfb)][_0x10298e(0xed)](_0x573f97[_0x10298e(0x105)]);this[_0x10298e(0x131)]=_0x2dc3fe;}[_0x5ed191(0xdd)](){const _0x2068bd=_0x5ed191,_0x16beb1=this[_0x2068bd(0x113)];this[_0x2068bd(0xd8)][_0x2068bd(0x109)][_0x2068bd(0xf3)](_0x2068bd(0xe4))[_0x2068bd(0xfa)](),this[_0x2068bd(0x146)][_0x2068bd(0x12b)](),_0x16beb1[_0x2068bd(0x125)]&&this[_0x2068bd(0xe6)]();}[_0x5ed191(0x138)](_0x7117d0){const _0x4f07fe=_0x5ed191;if(this[_0x4f07fe(0xfb)][_0x4f07fe(0xe2)](_0x7117d0[_0x4f07fe(0x105)]))return;const _0x9c7bae=this[_0x4f07fe(0x113)][_0x4f07fe(0x139)][_0x4f07fe(0x133)];_0x9c7bae!==_0x7117d0[_0x4f07fe(0x105)]?(_0x9c7bae&&this[_0x4f07fe(0x128)](_0x9c7bae),this[_0x4f07fe(0x13d)](_0x7117d0[_0x4f07fe(0x105)]),this[_0x4f07fe(0x113)][_0x4f07fe(0x139)][_0x4f07fe(0x118)](),this[_0x4f07fe(0x113)][_0x4f07fe(0x139)][_0x4f07fe(0x12a)](_0x7117d0[_0x4f07fe(0x105)]),this[_0x4f07fe(0xe6)]()):this[_0x4f07fe(0xe6)]();}[_0x5ed191(0xe6)](){const _0x5481df=_0x5ed191,_0xc48fb2=this[_0x5481df(0x113)][_0x5481df(0x139)][_0x5481df(0x133)],_0x286d9b=_0xc48fb2&&this[_0x5481df(0x146)][_0x5481df(0x11d)](_0xc48fb2);if(!_0x286d9b||!this[_0x5481df(0x11b)][_0x5481df(0xe2)](_0x286d9b))return;const _0x1db3be=this[_0x5481df(0x11b)][_0x5481df(0xf3)](_0x286d9b)[_0x5481df(0x10a)],_0x9e9a12=(function(){const _0x312f6d=_0x5481df,_0x1eab06=_0x341f11[_0x312f6d(0xfc)];return[_0x1eab06[_0x312f6d(0x141)],_0x1eab06[_0x312f6d(0x11c)],_0x1eab06[_0x312f6d(0x108)],_0x1eab06[_0x312f6d(0x140)],_0x1eab06[_0x312f6d(0x10e)],_0x1eab06[_0x312f6d(0xd2)]];}());this[_0x5481df(0x113)][_0x5481df(0x11a)]({'target':_0x1db3be,'positions':_0x9e9a12});}[_0x5ed191(0x110)](){const _0x29b2f4=_0x5ed191,_0x37b6a0=this[_0x29b2f4(0x113)],_0x167c8b=_0x37b6a0[_0x29b2f4(0x139)][_0x29b2f4(0x133)];_0x167c8b&&(this[_0x29b2f4(0x128)](_0x167c8b),_0x37b6a0[_0x29b2f4(0xd9)](),_0x37b6a0[_0x29b2f4(0x139)][_0x29b2f4(0x118)]());}[_0x5ed191(0x13d)](_0x2c93e5){const _0x123b46=_0x5ed191;this[_0x123b46(0x12e)](_0x2c93e5,_0x123b46(0xfd),()=>this[_0x123b46(0xe6)]()),this[_0x123b46(0x12e)](_0x2c93e5,_0x123b46(0x123),(_0x120e6f,_0x3c19c2)=>{const _0x3479f1=_0x123b46;this[_0x3479f1(0xfb)][_0x3479f1(0x12a)](_0x2c93e5),this[_0x3479f1(0x110)](),_0x3c19c2();});}[_0x5ed191(0x128)](_0x154b6f){const _0x177f98=_0x5ed191;this[_0x177f98(0x10f)](_0x154b6f);}}