UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 15.7 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x4d32db=_0x83ed;(function(_0x50f969,_0x2a6fb2){const _0x4f34ee=_0x83ed,_0x27bd92=_0x50f969();while(!![]){try{const _0x4e6311=-parseInt(_0x4f34ee(0x17d))/0x1+parseInt(_0x4f34ee(0x156))/0x2+-parseInt(_0x4f34ee(0x197))/0x3+parseInt(_0x4f34ee(0x162))/0x4*(-parseInt(_0x4f34ee(0x184))/0x5)+-parseInt(_0x4f34ee(0x174))/0x6+-parseInt(_0x4f34ee(0x169))/0x7+parseInt(_0x4f34ee(0x176))/0x8;if(_0x4e6311===_0x2a6fb2)break;else _0x27bd92['push'](_0x27bd92['shift']());}catch(_0x944e5d){_0x27bd92['push'](_0x27bd92['shift']());}}}(_0x133f,0xe5bbb));import{ContextPlugin as _0x492e42,Context as _0x4b9406}from'ckeditor5/src/core.js';import{AnnotationsUIs as _0x2b1ff7}from'./annotationsuis.js';function _0x83ed(_0x289431,_0x5324d0){const _0x133fe2=_0x133f();return _0x83ed=function(_0x83ed7f,_0x1de590){_0x83ed7f=_0x83ed7f-0x141;let _0x250a34=_0x133fe2[_0x83ed7f];return _0x250a34;},_0x83ed(_0x289431,_0x5324d0);}import{Sidebar as _0x2e0594}from'./sidebar.js';import{AnnotationCounterButtonView as _0x3ca0a5}from'./view/annotationcounterbuttonview.js';import{BalloonPanelView as _0x432156,BodyCollection as _0x21448e}from'ckeditor5/src/ui.js';function _0x133f(){const _0x853f5c=['from','stopListening','bodyCollection','_manuallyClosedAnnotationViews','type','narrowsidebar-detach-not-attached','bind','plugins','balloonPanelView','length','_selectedAnnotations','2264724WpVuSB','attachToDom','remove','target','isAttached','annotations','isDirty','narrowSidebar','register','northArrowSouthEast','listenTo','blur','has','attach','_refreshPositioning','refreshPositioning','includes','number','_attachToContainer','resize','detachFromDom','northArrowSouthWest','getOrderedSelectedAnnotations','pin','preventDefault','hasDomSelection','addEventListener','off','add','annotationType','northArrowSouth','_annotationToNarrowView','addAnnotation','change:container','requires','destroy','_refreshPositioningDebounced','ck-sidebar--narrow','removeEventListener','keydown','EditorAnnotations','defaultPositions','high','_annotations','_detachListeners','find','set:container','focus','pluginName','isOfficialPlugin','isPremiumPlugin','southArrowNorthEast','first','getSidebarItemView','_integrateWithEditorAnnotations','southArrowNorth','2769848xEdWKi','low','_setSelectedAnnotations','mousedown','ready','content','change:height','_hideBalloon','focusableElements','element','Esc','editors','11892NPjLuh','setActiveAnnotation','preventClosingBalloon','getByView','isVisible','NarrowSidebar','southArrowNorthWest','8811782XEMhSC','delete','_showBalloon','init','values','refresh','contains','narrowsidebar-attach-already-attached','uiUpdate','locale','_updateBalloonPosition','7453848ExHqtA','cancel','35821160VmSmKt','execute','activeAnnotation','context','_destroyEditorAnnotationsIntegration','keyCode','_attachListeners','1519863aokQxr','esc','rearrange','_detachFromContainer','clear','unpin','_editorAnnotations','245aLaWBd','stopPropagation','_domEmitter','get','view','set','stop','detach'];_0x133f=function(){return _0x853f5c;};return _0x133f();}import{CKEditorError as _0x20a06f,DomEmitterMixin as _0x361dc1,keyCodes as _0x50cbe1,Collection as _0x1c0bca}from'ckeditor5/src/utils.js';import'../../theme/sidebar-narrow.css';import{debounce as _0x2d3613}from'es-toolkit/compat';export class NarrowSidebar extends _0x492e42{[_0x4d32db(0x19b)];[_0x4d32db(0x19c)];[_0x4d32db(0x18f)];[_0x4d32db(0x186)];[_0x4d32db(0x1b6)];[_0x4d32db(0x196)];[_0x4d32db(0x183)];[_0x4d32db(0x142)];static get[_0x4d32db(0x1b9)](){return[_0x2e0594,_0x2b1ff7];}static get[_0x4d32db(0x14e)](){const _0x4cb427=_0x4d32db;return _0x4cb427(0x167);}static get[_0x4d32db(0x14f)](){return!0x0;}static get[_0x4d32db(0x150)](){return!0x0;}constructor(_0x6d7524){const _0x392ddd=_0x4d32db;super(_0x6d7524),this[_0x392ddd(0x19b)]=!0x1,this[_0x392ddd(0x18f)]=new Set(),this[_0x392ddd(0x186)]=new(_0x361dc1())(),this[_0x392ddd(0x1b6)]=new Map(),this[_0x392ddd(0x189)](_0x392ddd(0x178),null),this[_0x392ddd(0x19c)]=null,this[_0x392ddd(0x196)]=[],this[_0x392ddd(0x183)]=new _0x1c0bca(),this[_0x392ddd(0x142)]=_0x2d3613(()=>{const _0x182ff8=_0x392ddd;this[_0x182ff8(0x1a5)]();},0xfa,{'leading':!0x1});}[_0x4d32db(0x16c)](){const _0x32e91b=_0x4d32db;this[_0x32e91b(0x179)][_0x32e91b(0x193)][_0x32e91b(0x187)](_0x2b1ff7)[_0x32e91b(0x19f)](_0x32e91b(0x19e),this),this[_0x32e91b(0x18e)]=new _0x21448e(this[_0x32e91b(0x179)][_0x32e91b(0x172)]),this[_0x32e91b(0x194)]=new _0x432156(this[_0x32e91b(0x179)][_0x32e91b(0x172)]),this[_0x32e91b(0x18e)][_0x32e91b(0x198)](),this[_0x32e91b(0x18e)][_0x32e91b(0x1b3)](this[_0x32e91b(0x194)]);}[_0x4d32db(0x1a4)](_0x230646){const _0x396d65=_0x4d32db;this[_0x396d65(0x19c)]=_0x230646;const _0x1fd2fe=this[_0x396d65(0x179)][_0x396d65(0x193)][_0x396d65(0x187)](_0x2e0594),_0xedd8d4=this[_0x396d65(0x194)];if(_0x1fd2fe[_0x396d65(0x149)]=_0x230646,this[_0x396d65(0x19b)])throw new _0x20a06f(_0x396d65(0x170),this);this[_0x396d65(0x19b)]=!0x0,this[_0x396d65(0x1a1)](_0x1fd2fe,_0x396d65(0x14c),()=>{const _0x2d6b67=_0x396d65;this[_0x2d6b67(0x18b)](),this[_0x2d6b67(0x1a1)](_0x1fd2fe,_0x2d6b67(0x1b8),_0x190929=>{const _0x7fbe40=_0x2d6b67;_0x190929[_0x7fbe40(0x1b2)](),this[_0x7fbe40(0x1a4)](_0x230646);});}),_0x1fd2fe[_0x396d65(0x1a9)]({'viewClass':_0x396d65(0x143),'spaceBetweenItems':0x5});const _0x5d941d=_0x364ab0=>{const _0x1a784f=_0x396d65,_0x185f5c=new _0x3ca0a5(this[_0x1a784f(0x179)][_0x1a784f(0x172)]);_0x1fd2fe[_0x1a784f(0x1b7)](_0x364ab0,_0x185f5c),this[_0x1a784f(0x1b6)][_0x1a784f(0x189)](_0x364ab0,_0x185f5c),_0x185f5c[_0x1a784f(0x192)](_0x1a784f(0x19d),_0x1a784f(0x1b4),_0x1a784f(0x1a8))['to'](_0x364ab0[_0x1a784f(0x188)],_0x1a784f(0x19d),_0x1a784f(0x190),_0x1a784f(0x195)),_0x185f5c['on'](_0x1a784f(0x177),()=>{const _0x366366=_0x1a784f;this[_0x366366(0x18f)][_0x366366(0x181)](),_0xedd8d4[_0x366366(0x15b)][_0x366366(0x152)]!==_0x364ab0[_0x366366(0x188)]?(this[_0x366366(0x16b)](_0x364ab0),_0x364ab0[_0x366366(0x188)][_0x366366(0x15f)][_0x366366(0x14d)](),this[_0x366366(0x163)](_0x364ab0)):this[_0x366366(0x163)](null);});};for(const _0x2b1665 of _0x230646)_0x5d941d(_0x2b1665);this[_0x396d65(0x1a1)](_0x230646,_0x396d65(0x1b3),(_0x47ffc2,_0x2c684d)=>{_0x5d941d(_0x2c684d);}),this[_0x396d65(0x1a1)](_0x230646,_0x396d65(0x199),(_0xcd28a8,_0x2927ee,_0x16c496)=>{const _0x4d9c03=_0x396d65;this[_0x4d9c03(0x1b6)][_0x4d9c03(0x187)](_0x2927ee)[_0x4d9c03(0x141)](),this[_0x4d9c03(0x1b6)][_0x4d9c03(0x16a)](_0x2927ee),_0x1fd2fe[_0x4d9c03(0x17f)]({'removedAnnotation':_0x2927ee,'previousAnnotation':_0x230646[_0x4d9c03(0x187)](_0x16c496-0x1),'nextAnnotation':_0x230646[_0x4d9c03(0x187)](_0x16c496+0x1)}),_0x2927ee===this[_0x4d9c03(0x178)]&&this[_0x4d9c03(0x163)](null);},{'priority':_0x396d65(0x157)}),this[_0x396d65(0x1a1)](_0x230646,_0x396d65(0x14d),(_0x3d4287,_0x21ec4b)=>{const _0x5e95dd=_0x396d65;this[_0x5e95dd(0x163)](_0x21ec4b);}),this[_0x396d65(0x1a1)](_0x230646,_0x396d65(0x1a2),()=>{const _0x3efb08=_0x396d65;this[_0x3efb08(0x163)](null);}),this[_0x396d65(0x186)][_0x396d65(0x1a1)](document,_0x396d65(0x145),(_0x160058,_0x5251e)=>{const _0x3ea7bf=_0x396d65;_0x5251e[_0x3ea7bf(0x17b)]===_0x50cbe1[_0x3ea7bf(0x17e)]&&_0xedd8d4[_0x3ea7bf(0x166)]&&(this[_0x3ea7bf(0x18f)][_0x3ea7bf(0x1b3)](_0xedd8d4[_0x3ea7bf(0x15b)][_0x3ea7bf(0x152)]),this[_0x3ea7bf(0x15d)](),_0x5251e[_0x3ea7bf(0x185)](),_0x5251e[_0x3ea7bf(0x1af)]());}),this[_0x396d65(0x186)][_0x396d65(0x1a1)](document,_0x396d65(0x159),(_0x187fc0,_0x5f4c02)=>{const _0x25b07a=_0x396d65,_0xbc1892=_0x5f4c02[_0x25b07a(0x19a)];_0xedd8d4[_0x25b07a(0x166)]&&_0xedd8d4[_0x25b07a(0x15f)][_0x25b07a(0x16f)](_0xbc1892)||_0x1fd2fe[_0x25b07a(0x188)][_0x25b07a(0x15f)][_0x25b07a(0x16f)](_0xbc1892)||_0x187fc0[_0x25b07a(0x164)]||this[_0x25b07a(0x178)]&&this[_0x25b07a(0x178)][_0x25b07a(0x15e)][_0x25b07a(0x14b)](_0x3a9ad1=>_0x3a9ad1[_0x25b07a(0x16f)](_0xbc1892))||(this[_0x25b07a(0x18f)][_0x25b07a(0x181)](),this[_0x25b07a(0x15d)](),this[_0x25b07a(0x163)](null));});const _0x57262a=this[_0x396d65(0x179)]instanceof _0x4b9406?this[_0x396d65(0x179)][_0x396d65(0x161)]:new _0x1c0bca([this[_0x396d65(0x179)]]);for(const _0x484a1f of _0x57262a)this[_0x396d65(0x154)](_0x484a1f);this[_0x396d65(0x1a1)](_0x57262a,_0x396d65(0x1b3),(_0x589d50,_0x17d913)=>{const _0x8960b2=_0x396d65;this[_0x8960b2(0x1a1)](_0x17d913,_0x8960b2(0x15a),()=>{const _0x5187d6=_0x8960b2;this[_0x5187d6(0x154)](_0x17d913);});}),this[_0x396d65(0x1a1)](_0x57262a,_0x396d65(0x199),(_0x826903,_0x4660f8)=>{const _0x49fc15=_0x396d65;_0x4660f8[_0x49fc15(0x193)][_0x49fc15(0x1a3)](_0x49fc15(0x146))&&this[_0x49fc15(0x17a)](_0x4660f8[_0x49fc15(0x193)][_0x49fc15(0x187)](_0x49fc15(0x146)));}),window[_0x396d65(0x1b1)](_0x396d65(0x1aa),this[_0x396d65(0x142)]),this[_0x396d65(0x1a5)]();}[_0x4d32db(0x163)](_0x16045e){const _0x441bf1=_0x4d32db;if(_0x16045e===this[_0x441bf1(0x178)])return;const _0x5c97aa=this[_0x441bf1(0x179)][_0x441bf1(0x193)][_0x441bf1(0x187)](_0x2e0594);if(_0x5c97aa[_0x441bf1(0x16e)]({'blurredAnnotation':this[_0x441bf1(0x178)],'activatedAnnotation':_0x16045e,'disableAnimationOnActivatedAnnotation':!0x0}),_0x16045e)_0x5c97aa[_0x441bf1(0x153)](_0x16045e)?this[_0x441bf1(0x16b)](_0x16045e):this[_0x441bf1(0x15d)]();else this[_0x441bf1(0x15d)]();this[_0x441bf1(0x178)]=_0x16045e;}[_0x4d32db(0x18b)](){const _0x519645=_0x4d32db;if(!this[_0x519645(0x19b)])throw new _0x20a06f(_0x519645(0x191),this);this[_0x519645(0x163)](null);const _0x3b5650=this[_0x519645(0x179)][_0x519645(0x193)][_0x519645(0x187)](_0x2e0594);this[_0x519645(0x15d)](),Array[_0x519645(0x18c)](this[_0x519645(0x1b6)][_0x519645(0x16d)](),_0x270fa6=>_0x270fa6[_0x519645(0x141)]()),this[_0x519645(0x1b6)][_0x519645(0x181)](),_0x3b5650[_0x519645(0x180)](this[_0x519645(0x19c)]),this[_0x519645(0x18d)](),this[_0x519645(0x186)][_0x519645(0x18d)](),this[_0x519645(0x179)]instanceof _0x4b9406&&this[_0x519645(0x18d)](this[_0x519645(0x179)][_0x519645(0x161)]);for(const _0x894e2f of Array[_0x519645(0x18c)](this[_0x519645(0x183)]))this[_0x519645(0x17a)](_0x894e2f);window[_0x519645(0x144)](_0x519645(0x1aa),this[_0x519645(0x142)]),this[_0x519645(0x142)][_0x519645(0x175)](),this[_0x519645(0x196)]=[],this[_0x519645(0x19b)]=!0x1,this[_0x519645(0x19c)]=null;}[_0x4d32db(0x141)](){const _0xc2daf6=_0x4d32db;this[_0xc2daf6(0x19b)]&&this[_0xc2daf6(0x18b)](),this[_0xc2daf6(0x18e)][_0xc2daf6(0x1ab)]();}[_0x4d32db(0x154)](_0x1c6341){const _0x4d2503=_0x4d32db;if(!_0x1c6341[_0x4d2503(0x193)][_0x4d2503(0x1a3)](_0x4d2503(0x146)))return;const _0x21c6bd=_0x1c6341[_0x4d2503(0x193)][_0x4d2503(0x187)](_0x4d2503(0x146)),_0x87f808=this[_0x4d2503(0x179)][_0x4d2503(0x193)][_0x4d2503(0x187)](_0x2e0594),_0x5ca602=this[_0x4d2503(0x19c)],_0x496de5=this[_0x4d2503(0x194)],_0x36cb02=()=>{const _0x3d5e73=_0x4d2503,_0x421143=_0x21c6bd[_0x3d5e73(0x1ad)]({'annotations':this[_0x3d5e73(0x19c)],'activeAnnotation':this[_0x3d5e73(0x178)]});this[_0x3d5e73(0x158)](_0x421143),this[_0x3d5e73(0x163)](_0x421143[0x0]||null);};this[_0x4d2503(0x1a1)](_0x21c6bd,_0x4d2503(0x16e),_0x36cb02),this[_0x4d2503(0x1a1)](_0x21c6bd,_0x4d2503(0x1a2),(_0x1e8e65,{isAnnotationTracked:_0x25cb02})=>{const _0x4219a1=_0x4d2503;this[_0x4219a1(0x178)]&&_0x25cb02(this[_0x4219a1(0x178)])&&(this[_0x4219a1(0x158)]([]),this[_0x4219a1(0x163)](null));}),this[_0x4d2503(0x1a1)](_0x21c6bd,_0x4d2503(0x171),()=>{const _0x149c17=_0x4d2503;this[_0x149c17(0x142)]();}),this[_0x4d2503(0x1a1)](_0x5ca602,_0x4d2503(0x1a2),_0x3c8c81=>{const _0x411738=_0x4d2503;_0x21c6bd[_0x411738(0x1b0)]()&&_0x3c8c81[_0x411738(0x18a)]();},{'priority':_0x4d2503(0x148)}),this[_0x4d2503(0x1a1)](this[_0x4d2503(0x186)],_0x4d2503(0x159),(_0x3967cf,_0x1e8b36)=>{const _0x2e1305=_0x4d2503,_0x4fa05a=_0x1e8b36[_0x2e1305(0x19a)];_0x496de5[_0x2e1305(0x166)]&&_0x496de5[_0x2e1305(0x15f)][_0x2e1305(0x16f)](_0x4fa05a)||_0x87f808[_0x2e1305(0x188)][_0x2e1305(0x15f)][_0x2e1305(0x16f)](_0x4fa05a)||this[_0x2e1305(0x178)]&&_0x21c6bd[_0x2e1305(0x1b0)]()&&(_0x36cb02(),_0x3967cf[_0x2e1305(0x164)]=!0x0);},{'priority':_0x4d2503(0x148)}),this[_0x4d2503(0x183)][_0x4d2503(0x1b3)](_0x21c6bd);}[_0x4d32db(0x17a)](_0x53f9e2){const _0x27aa0c=_0x4d32db;_0x53f9e2&&(this[_0x27aa0c(0x18d)](_0x53f9e2),this[_0x27aa0c(0x183)][_0x27aa0c(0x199)](_0x53f9e2));}[_0x4d32db(0x158)](_0x4b3119){const _0xe6f2de=_0x4d32db;for(const _0x2916db of this[_0xe6f2de(0x196)])_0x4b3119[_0xe6f2de(0x1a7)](_0x2916db)||this[_0xe6f2de(0x18f)][_0xe6f2de(0x16a)](_0x2916db[_0xe6f2de(0x188)]);this[_0xe6f2de(0x196)]=_0x4b3119;}[_0x4d32db(0x1a5)](){const _0x2fba82=_0x4d32db,_0x165cc7=this[_0x2fba82(0x194)];this[_0x2fba82(0x19c)][_0x2fba82(0x1a6)](),_0x165cc7[_0x2fba82(0x166)]&&this[_0x2fba82(0x173)]();}[_0x4d32db(0x16b)](_0x4655fc){const _0x472b0d=_0x4d32db;if(this[_0x472b0d(0x18f)][_0x472b0d(0x1a3)](_0x4655fc[_0x472b0d(0x188)]))return;const _0x55faab=this[_0x472b0d(0x194)][_0x472b0d(0x15b)][_0x472b0d(0x152)];_0x55faab!==_0x4655fc[_0x472b0d(0x188)]?(_0x55faab&&this[_0x472b0d(0x14a)](_0x55faab),this[_0x472b0d(0x17c)](_0x4655fc[_0x472b0d(0x188)]),this[_0x472b0d(0x194)][_0x472b0d(0x15b)][_0x472b0d(0x181)](),this[_0x472b0d(0x194)][_0x472b0d(0x15b)][_0x472b0d(0x1b3)](_0x4655fc[_0x472b0d(0x188)]),this[_0x472b0d(0x173)]()):this[_0x472b0d(0x173)]();}[_0x4d32db(0x173)](){const _0x455024=_0x4d32db,_0x7c82d0=this[_0x455024(0x194)][_0x455024(0x15b)][_0x455024(0x152)],_0x321071=_0x7c82d0&&this[_0x455024(0x19c)][_0x455024(0x165)](_0x7c82d0);if(!_0x321071||!this[_0x455024(0x1b6)][_0x455024(0x1a3)](_0x321071))return;const _0x4b2d7f=this[_0x455024(0x1b6)][_0x455024(0x187)](_0x321071)[_0x455024(0x15f)],_0x34ee96=(function(){const _0x485800=_0x455024,_0xc374d5=_0x432156[_0x485800(0x147)];return[_0xc374d5[_0x485800(0x151)],_0xc374d5[_0x485800(0x1a0)],_0xc374d5[_0x485800(0x155)],_0xc374d5[_0x485800(0x1b5)],_0xc374d5[_0x485800(0x168)],_0xc374d5[_0x485800(0x1ac)]];}());this[_0x455024(0x194)][_0x455024(0x1ae)]({'target':_0x4b2d7f,'positions':_0x34ee96});}[_0x4d32db(0x15d)](){const _0x4c83cf=_0x4d32db,_0x4636fa=this[_0x4c83cf(0x194)],_0x3945e7=_0x4636fa[_0x4c83cf(0x15b)][_0x4c83cf(0x152)];_0x3945e7&&(this[_0x4c83cf(0x14a)](_0x3945e7),_0x4636fa[_0x4c83cf(0x182)](),_0x4636fa[_0x4c83cf(0x15b)][_0x4c83cf(0x181)]());}[_0x4d32db(0x17c)](_0x4b2c6d){const _0x554166=_0x4d32db;this[_0x554166(0x1a1)](_0x4b2c6d,_0x554166(0x15c),()=>this[_0x554166(0x173)]()),this[_0x554166(0x1a1)](_0x4b2c6d,_0x554166(0x160),(_0x3a084c,_0x249a4d)=>{const _0x3b0e4b=_0x554166;this[_0x3b0e4b(0x18f)][_0x3b0e4b(0x1b3)](_0x4b2c6d),this[_0x3b0e4b(0x15d)](),_0x249a4d();});}[_0x4d32db(0x14a)](_0x4ff99e){const _0x5b7415=_0x4d32db;this[_0x5b7415(0x18d)](_0x4ff99e);}}