UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 15.9 kB
/* * Copyright (c) 2003-2026, 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 _0x3d2827=_0x3acf;(function(_0x1ef212,_0x2d3043){const _0x2f3e67=_0x3acf,_0x343733=_0x1ef212();while(!![]){try{const _0xb44fdc=parseInt(_0x2f3e67(0x184))/0x1*(-parseInt(_0x2f3e67(0x170))/0x2)+-parseInt(_0x2f3e67(0x175))/0x3*(parseInt(_0x2f3e67(0x162))/0x4)+parseInt(_0x2f3e67(0x155))/0x5+-parseInt(_0x2f3e67(0x1a9))/0x6*(-parseInt(_0x2f3e67(0x1a4))/0x7)+-parseInt(_0x2f3e67(0x188))/0x8+-parseInt(_0x2f3e67(0x1a3))/0x9+parseInt(_0x2f3e67(0x18f))/0xa;if(_0xb44fdc===_0x2d3043)break;else _0x343733['push'](_0x343733['shift']());}catch(_0x546e2b){_0x343733['push'](_0x343733['shift']());}}}(_0x1de5,0xd158f));import{ContextPlugin as _0x6a6ea4,Context as _0x4ce588}from'ckeditor5/src/core.js';import{AnnotationsUIs as _0x21eace}from'./annotationsuis.js';import{Sidebar as _0x29fc83}from'./sidebar.js';function _0x1de5(){const _0x2e6e6b=['_setSelectedAnnotations','102gSfeCF','target','view','unpin','6018912qALMYN','change:container','bodyCollection','execute','editors','_editorAnnotations','stop','17175470lhiJRR','cancel','ck-sidebar--narrow','_domEmitter','isAttached','defaultPositions','annotations','bind','isOfficialPlugin','_attachListeners','context','requires','northArrowSouthWest','init','narrowSidebar','add','blur','refreshPositioning','from','_updateBalloonPosition','11931354ZNRHeV','11679598ClVqSV','_attachToContainer','attach','pluginName','uiUpdate','6DtVsoz','_detachListeners','_annotationToNarrowView','balloonPanelView','addEventListener','change:height','off','EditorAnnotations','hasDomSelection','clear','_showBalloon','find','refreshVisibility','detachFromDom','mousedown','Esc','length','southArrowNorth','content','narrowsidebar-detach-not-attached','NarrowSidebar','getOrderedSelectedAnnotations','contains','values','narrowsidebar-attach-already-attached','removeEventListener','addAnnotation','activeAnnotation','keydown','annotationType','getByView','Annotations','preventClosingBalloon','_refreshPositioning','high','element','locale','ready','includes','number','_manuallyClosedAnnotationViews','7455365JUyapv','_selectedAnnotations','refresh','destroy','_detachFromContainer','getSidebarItemView','set:container','_destroyEditorAnnotationsIntegration','type','northArrowSouthEast','preventDefault','low','get','20hexsEa','focus','_hideBalloon','stopListening','_integrateWithEditorAnnotations','isPremiumPlugin','_annotations','remove','esc','isDirty','southArrowNorthWest','set','_refreshPositioningDebounced','northArrowSouth','22782ehlQPB','focusableElements','isVisible','stopPropagation','listenTo','467817ALqCQc','resize','first','pin','setActiveAnnotation','attachToDom','keyCode','detach','has','register','delete','plugins','southArrowNorthEast','rearrange'];_0x1de5=function(){return _0x2e6e6b;};return _0x1de5();}import{AnnotationCounterButtonView as _0xa6a19e}from'./view/annotationcounterbuttonview.js';import{BalloonPanelView as _0x4ddb5f,BodyCollection as _0x33560e}from'ckeditor5/src/ui.js';import{CKEditorError as _0x1f8090,DomEmitterMixin as _0x3e01ce,keyCodes as _0x150b7a,Collection as _0x37dfda}from'ckeditor5/src/utils.js';function _0x3acf(_0x4ef4b2,_0x1a81af){const _0x1de56e=_0x1de5();return _0x3acf=function(_0x3acf1f,_0x98fbb8){_0x3acf1f=_0x3acf1f-0x140;let _0x2730c9=_0x1de56e[_0x3acf1f];return _0x2730c9;},_0x3acf(_0x4ef4b2,_0x1a81af);}import'../../theme/sidebar-narrow.css';import{debounce as _0x58dd7a}from'es-toolkit/compat';export class NarrowSidebar extends _0x6a6ea4{[_0x3d2827(0x193)];[_0x3d2827(0x195)];[_0x3d2827(0x154)];[_0x3d2827(0x192)];[_0x3d2827(0x1ab)];[_0x3d2827(0x156)];[_0x3d2827(0x18d)];[_0x3d2827(0x16e)];static get[_0x3d2827(0x19a)](){return[_0x29fc83,_0x21eace];}static get[_0x3d2827(0x1a7)](){const _0xef974e=_0x3d2827;return _0xef974e(0x140);}static get[_0x3d2827(0x197)](){return!0x0;}static get[_0x3d2827(0x167)](){return!0x0;}constructor(_0x84449a){const _0x5e696d=_0x3d2827;super(_0x84449a),this[_0x5e696d(0x193)]=!0x1,this[_0x5e696d(0x154)]=new Set(),this[_0x5e696d(0x192)]=new(_0x3e01ce())(),this[_0x5e696d(0x1ab)]=new Map(),this[_0x5e696d(0x16d)](_0x5e696d(0x147),null),this[_0x5e696d(0x195)]=null,this[_0x5e696d(0x156)]=[],this[_0x5e696d(0x18d)]=new _0x37dfda(),this[_0x5e696d(0x16e)]=_0x58dd7a(()=>{const _0x59ac39=_0x5e696d;this[_0x59ac39(0x14d)]();},0xfa,{'leading':!0x1});}[_0x3d2827(0x19c)](){const _0x31bef3=_0x3d2827;this[_0x31bef3(0x199)][_0x31bef3(0x180)][_0x31bef3(0x161)](_0x21eace)[_0x31bef3(0x17e)](_0x31bef3(0x19d),this),this[_0x31bef3(0x18a)]=new _0x33560e(this[_0x31bef3(0x199)][_0x31bef3(0x150)]),this[_0x31bef3(0x1ac)]=new _0x4ddb5f(this[_0x31bef3(0x199)][_0x31bef3(0x150)]),this[_0x31bef3(0x18a)][_0x31bef3(0x17a)](),this[_0x31bef3(0x18a)][_0x31bef3(0x19e)](this[_0x31bef3(0x1ac)]);}[_0x3d2827(0x1a6)](_0x1cbc21){const _0x3f9049=_0x3d2827;this[_0x3f9049(0x195)]=_0x1cbc21;const _0x137961=this[_0x3f9049(0x199)][_0x3f9049(0x180)][_0x3f9049(0x161)](_0x29fc83),_0x502441=this[_0x3f9049(0x1ac)];if(_0x137961[_0x3f9049(0x168)]=_0x1cbc21,this[_0x3f9049(0x193)])throw new _0x1f8090(_0x3f9049(0x144),this);this[_0x3f9049(0x193)]=!0x0,this[_0x3f9049(0x174)](_0x137961,_0x3f9049(0x15b),()=>{const _0x4d7c9d=_0x3f9049;this[_0x4d7c9d(0x17c)](),this[_0x4d7c9d(0x174)](_0x137961,_0x4d7c9d(0x189),_0x238c4a=>{const _0x4e15b3=_0x4d7c9d;_0x238c4a[_0x4e15b3(0x1af)](),this[_0x4e15b3(0x1a6)](_0x1cbc21);});}),_0x137961[_0x3f9049(0x1a5)]({'viewClass':_0x3f9049(0x191),'spaceBetweenItems':0x5});const _0x1239c1=_0x1d2fc4=>{const _0x3e5a96=_0x3f9049,_0x4e45c8=new _0xa6a19e(this[_0x3e5a96(0x199)][_0x3e5a96(0x150)]);_0x137961[_0x3e5a96(0x146)](_0x1d2fc4,_0x4e45c8),this[_0x3e5a96(0x1ab)][_0x3e5a96(0x16d)](_0x1d2fc4,_0x4e45c8),_0x4e45c8[_0x3e5a96(0x196)](_0x3e5a96(0x16b),_0x3e5a96(0x149),_0x3e5a96(0x153))['to'](_0x1d2fc4[_0x3e5a96(0x186)],_0x3e5a96(0x16b),_0x3e5a96(0x15d),_0x3e5a96(0x1b9)),_0x4e45c8['on'](_0x3e5a96(0x18b),()=>{const _0x5cff6b=_0x3e5a96;this[_0x5cff6b(0x154)][_0x5cff6b(0x1b2)](),_0x502441[_0x5cff6b(0x1bb)][_0x5cff6b(0x177)]!==_0x1d2fc4[_0x5cff6b(0x186)]?(this[_0x5cff6b(0x1b3)](_0x1d2fc4),_0x1d2fc4[_0x5cff6b(0x186)][_0x5cff6b(0x14f)][_0x5cff6b(0x163)](),this[_0x5cff6b(0x179)](_0x1d2fc4)):this[_0x5cff6b(0x179)](null);});};for(const _0x2ff674 of _0x1cbc21)_0x1239c1(_0x2ff674);this[_0x3f9049(0x174)](_0x1cbc21,_0x3f9049(0x19e),(_0x3fef2a,_0x3207dc)=>{_0x1239c1(_0x3207dc);}),this[_0x3f9049(0x174)](_0x1cbc21,_0x3f9049(0x169),(_0x20c6e0,_0x257b8b,_0x28e47a)=>{const _0x524f10=_0x3f9049;this[_0x524f10(0x1ab)][_0x524f10(0x161)](_0x257b8b)[_0x524f10(0x158)](),this[_0x524f10(0x1ab)][_0x524f10(0x17f)](_0x257b8b),_0x137961[_0x524f10(0x182)]({'removedAnnotation':_0x257b8b,'previousAnnotation':_0x1cbc21[_0x524f10(0x161)](_0x28e47a-0x1),'nextAnnotation':_0x1cbc21[_0x524f10(0x161)](_0x28e47a+0x1)}),_0x257b8b===this[_0x524f10(0x147)]&&this[_0x524f10(0x179)](null);},{'priority':_0x3f9049(0x160)}),this[_0x3f9049(0x174)](_0x1cbc21,_0x3f9049(0x163),(_0xdbe1c3,_0x5aef86)=>{const _0x5239d3=_0x3f9049;this[_0x5239d3(0x179)](_0x5aef86);}),this[_0x3f9049(0x174)](_0x1cbc21,_0x3f9049(0x19f),()=>{const _0x1e5109=_0x3f9049;this[_0x1e5109(0x179)](null);}),this[_0x3f9049(0x192)][_0x3f9049(0x174)](document,_0x3f9049(0x148),(_0x5a42a0,_0xc18a6e)=>{const _0x24771c=_0x3f9049;_0xc18a6e[_0x24771c(0x17b)]===_0x150b7a[_0x24771c(0x16a)]&&_0x502441[_0x24771c(0x172)]&&(this[_0x24771c(0x154)][_0x24771c(0x19e)](_0x502441[_0x24771c(0x1bb)][_0x24771c(0x177)]),this[_0x24771c(0x164)](),_0xc18a6e[_0x24771c(0x173)](),_0xc18a6e[_0x24771c(0x15f)]());}),this[_0x3f9049(0x192)][_0x3f9049(0x174)](document,_0x3f9049(0x1b7),(_0x30453a,_0x136e1b)=>{const _0x4e33d7=_0x3f9049,_0x15720b=_0x136e1b[_0x4e33d7(0x185)];_0x502441[_0x4e33d7(0x172)]&&_0x502441[_0x4e33d7(0x14f)][_0x4e33d7(0x142)](_0x15720b)||_0x137961[_0x4e33d7(0x186)][_0x4e33d7(0x14f)][_0x4e33d7(0x142)](_0x15720b)||_0x30453a[_0x4e33d7(0x14c)]||this[_0x4e33d7(0x147)]&&this[_0x4e33d7(0x147)][_0x4e33d7(0x171)][_0x4e33d7(0x1b4)](_0x1cfd6b=>_0x1cfd6b[_0x4e33d7(0x142)](_0x15720b))||(this[_0x4e33d7(0x154)][_0x4e33d7(0x1b2)](),this[_0x4e33d7(0x164)](),this[_0x4e33d7(0x179)](null));});const _0x4ebe7d=this[_0x3f9049(0x199)]instanceof _0x4ce588?this[_0x3f9049(0x199)][_0x3f9049(0x18c)]:new _0x37dfda([this[_0x3f9049(0x199)]]);for(const _0x3d2f98 of _0x4ebe7d)this[_0x3f9049(0x166)](_0x3d2f98);this[_0x3f9049(0x174)](_0x4ebe7d,_0x3f9049(0x19e),(_0x12a9a4,_0x3b3571)=>{const _0x9f6e5b=_0x3f9049;this[_0x9f6e5b(0x174)](_0x3b3571,_0x9f6e5b(0x151),()=>{const _0x5687ab=_0x9f6e5b;this[_0x5687ab(0x166)](_0x3b3571);});}),this[_0x3f9049(0x174)](_0x4ebe7d,_0x3f9049(0x169),(_0x32e0cf,_0x442219)=>{const _0x5cecc6=_0x3f9049;_0x442219[_0x5cecc6(0x180)][_0x5cecc6(0x17d)](_0x5cecc6(0x1b0))&&this[_0x5cecc6(0x15c)](_0x442219[_0x5cecc6(0x180)][_0x5cecc6(0x161)](_0x5cecc6(0x1b0)));}),window[_0x3f9049(0x1ad)](_0x3f9049(0x176),this[_0x3f9049(0x16e)]),this[_0x3f9049(0x14d)]();}[_0x3d2827(0x179)](_0x40c194){const _0x4eade5=_0x3d2827;if(_0x40c194===this[_0x4eade5(0x147)])return;const _0x4658ba=this[_0x4eade5(0x199)][_0x4eade5(0x180)][_0x4eade5(0x161)](_0x29fc83);if(_0x4658ba[_0x4eade5(0x157)]({'blurredAnnotation':this[_0x4eade5(0x147)],'activatedAnnotation':_0x40c194,'disableAnimationOnActivatedAnnotation':!0x0}),_0x40c194)_0x4658ba[_0x4eade5(0x15a)](_0x40c194)?this[_0x4eade5(0x1b3)](_0x40c194):this[_0x4eade5(0x164)]();else this[_0x4eade5(0x164)]();this[_0x4eade5(0x147)]=_0x40c194;}[_0x3d2827(0x17c)](){const _0x3979e1=_0x3d2827;if(!this[_0x3979e1(0x193)])throw new _0x1f8090(_0x3979e1(0x1bc),this);this[_0x3979e1(0x179)](null);const _0x39e505=this[_0x3979e1(0x199)][_0x3979e1(0x180)][_0x3979e1(0x161)](_0x29fc83);this[_0x3979e1(0x164)](),Array[_0x3979e1(0x1a1)](this[_0x3979e1(0x1ab)][_0x3979e1(0x143)](),_0xc6e948=>_0xc6e948[_0x3979e1(0x158)]()),this[_0x3979e1(0x1ab)][_0x3979e1(0x1b2)](),_0x39e505[_0x3979e1(0x159)](this[_0x3979e1(0x195)]),this[_0x3979e1(0x165)](),this[_0x3979e1(0x192)][_0x3979e1(0x165)](),this[_0x3979e1(0x199)]instanceof _0x4ce588&&this[_0x3979e1(0x165)](this[_0x3979e1(0x199)][_0x3979e1(0x18c)]);for(const _0x931c56 of Array[_0x3979e1(0x1a1)](this[_0x3979e1(0x18d)]))this[_0x3979e1(0x15c)](_0x931c56);window[_0x3979e1(0x145)](_0x3979e1(0x176),this[_0x3979e1(0x16e)]),this[_0x3979e1(0x16e)][_0x3979e1(0x190)](),this[_0x3979e1(0x156)]=[],this[_0x3979e1(0x193)]=!0x1,this[_0x3979e1(0x195)]=null;}[_0x3d2827(0x158)](){const _0x56c126=_0x3d2827;this[_0x56c126(0x193)]&&this[_0x56c126(0x17c)](),this[_0x56c126(0x18a)][_0x56c126(0x1b6)]();}[_0x3d2827(0x166)](_0x53b42a){const _0x10626a=_0x3d2827;if(!_0x53b42a[_0x10626a(0x180)][_0x10626a(0x17d)](_0x10626a(0x1b0)))return;const _0x4a1bf9=_0x53b42a[_0x10626a(0x180)][_0x10626a(0x161)](_0x10626a(0x1b0)),_0x365ee8=this[_0x10626a(0x199)][_0x10626a(0x180)][_0x10626a(0x161)](_0x29fc83),_0x562261=this[_0x10626a(0x195)],_0x5e88bb=this[_0x10626a(0x1ac)],_0x67e04e=()=>{const _0x35df95=_0x10626a,_0x524ca6=_0x4a1bf9[_0x35df95(0x141)]({'annotations':this[_0x35df95(0x195)],'activeAnnotation':this[_0x35df95(0x147)]});this[_0x35df95(0x183)](_0x524ca6),this[_0x35df95(0x179)](_0x524ca6[0x0]||null);};this[_0x10626a(0x174)](_0x4a1bf9,_0x10626a(0x157),_0x67e04e),this[_0x10626a(0x174)](_0x4a1bf9,_0x10626a(0x19f),(_0xc27243,{isAnnotationTracked:_0x2a0ab5})=>{const _0x599f96=_0x10626a;this[_0x599f96(0x147)]&&_0x2a0ab5(this[_0x599f96(0x147)])&&(this[_0x599f96(0x183)]([]),this[_0x599f96(0x179)](null));}),this[_0x10626a(0x174)](_0x4a1bf9,_0x10626a(0x1a8),()=>{const _0x11a585=_0x10626a;this[_0x11a585(0x16e)]();}),this[_0x10626a(0x174)](_0x562261,_0x10626a(0x19f),_0x474074=>{const _0x425ce1=_0x10626a;_0x4a1bf9[_0x425ce1(0x1b1)]()&&_0x474074[_0x425ce1(0x18e)]();},{'priority':_0x10626a(0x14e)}),this[_0x10626a(0x174)](this[_0x10626a(0x192)],_0x10626a(0x1b7),(_0x16625f,_0x28a9e3)=>{const _0x136868=_0x10626a,_0x5200cf=_0x28a9e3[_0x136868(0x185)];_0x5e88bb[_0x136868(0x172)]&&_0x5e88bb[_0x136868(0x14f)][_0x136868(0x142)](_0x5200cf)||_0x365ee8[_0x136868(0x186)][_0x136868(0x14f)][_0x136868(0x142)](_0x5200cf)||this[_0x136868(0x147)]&&_0x4a1bf9[_0x136868(0x1b1)]()&&(_0x67e04e(),_0x16625f[_0x136868(0x14c)]=!0x0);},{'priority':_0x10626a(0x14e)}),this[_0x10626a(0x18d)][_0x10626a(0x19e)](_0x4a1bf9);}[_0x3d2827(0x15c)](_0xe517bf){const _0x3316f3=_0x3d2827;_0xe517bf&&(this[_0x3316f3(0x165)](_0xe517bf),this[_0x3316f3(0x18d)][_0x3316f3(0x169)](_0xe517bf));}[_0x3d2827(0x183)](_0x2d5b81){const _0x5ac0da=_0x3d2827;for(const _0x265fcf of this[_0x5ac0da(0x156)])_0x2d5b81[_0x5ac0da(0x152)](_0x265fcf)||this[_0x5ac0da(0x154)][_0x5ac0da(0x17f)](_0x265fcf[_0x5ac0da(0x186)]);this[_0x5ac0da(0x156)]=_0x2d5b81;}[_0x3d2827(0x14d)](){const _0x2e310f=_0x3d2827,_0x2a11ac=this[_0x2e310f(0x1ac)];this[_0x2e310f(0x199)][_0x2e310f(0x180)][_0x2e310f(0x161)](_0x2e310f(0x14b))[_0x2e310f(0x1b5)](),this[_0x2e310f(0x195)][_0x2e310f(0x1a0)](),_0x2a11ac[_0x2e310f(0x172)]&&this[_0x2e310f(0x1a2)]();}[_0x3d2827(0x1b3)](_0x2c202f){const _0x2be633=_0x3d2827;if(this[_0x2be633(0x154)][_0x2be633(0x17d)](_0x2c202f[_0x2be633(0x186)]))return;const _0x255697=this[_0x2be633(0x1ac)][_0x2be633(0x1bb)][_0x2be633(0x177)];_0x255697!==_0x2c202f[_0x2be633(0x186)]?(_0x255697&&this[_0x2be633(0x1aa)](_0x255697),this[_0x2be633(0x198)](_0x2c202f[_0x2be633(0x186)]),this[_0x2be633(0x1ac)][_0x2be633(0x1bb)][_0x2be633(0x1b2)](),this[_0x2be633(0x1ac)][_0x2be633(0x1bb)][_0x2be633(0x19e)](_0x2c202f[_0x2be633(0x186)]),this[_0x2be633(0x1a2)]()):this[_0x2be633(0x1a2)]();}[_0x3d2827(0x1a2)](){const _0x1807f1=_0x3d2827,_0x3b4b6b=this[_0x1807f1(0x1ac)][_0x1807f1(0x1bb)][_0x1807f1(0x177)],_0x1c9df1=_0x3b4b6b&&this[_0x1807f1(0x195)][_0x1807f1(0x14a)](_0x3b4b6b);if(!_0x1c9df1||!this[_0x1807f1(0x1ab)][_0x1807f1(0x17d)](_0x1c9df1))return;const _0x30ce4b=this[_0x1807f1(0x1ab)][_0x1807f1(0x161)](_0x1c9df1)[_0x1807f1(0x14f)],_0x5e48b1=(function(){const _0x296183=_0x1807f1,_0x59112e=_0x4ddb5f[_0x296183(0x194)];return[_0x59112e[_0x296183(0x181)],_0x59112e[_0x296183(0x15e)],_0x59112e[_0x296183(0x1ba)],_0x59112e[_0x296183(0x16f)],_0x59112e[_0x296183(0x16c)],_0x59112e[_0x296183(0x19b)]];}());this[_0x1807f1(0x1ac)][_0x1807f1(0x178)]({'target':_0x30ce4b,'positions':_0x5e48b1});}[_0x3d2827(0x164)](){const _0x7bca02=_0x3d2827,_0x355595=this[_0x7bca02(0x1ac)],_0x2a66b1=_0x355595[_0x7bca02(0x1bb)][_0x7bca02(0x177)];_0x2a66b1&&(this[_0x7bca02(0x1aa)](_0x2a66b1),_0x355595[_0x7bca02(0x187)](),_0x355595[_0x7bca02(0x1bb)][_0x7bca02(0x1b2)]());}[_0x3d2827(0x198)](_0x1c5e94){const _0x1389ee=_0x3d2827;this[_0x1389ee(0x174)](_0x1c5e94,_0x1389ee(0x1ae),()=>this[_0x1389ee(0x1a2)]()),this[_0x1389ee(0x174)](_0x1c5e94,_0x1389ee(0x1b8),(_0x20aced,_0x35902b)=>{const _0x539436=_0x1389ee;this[_0x539436(0x154)][_0x539436(0x19e)](_0x1c5e94),this[_0x539436(0x164)](),_0x35902b();});}[_0x3d2827(0x1aa)](_0x3b16c6){const _0x1f3d72=_0x3d2827;this[_0x1f3d72(0x165)](_0x3b16c6);}}