UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 13.1 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x17a1(){const _0x5a87ef=['change:targetRect','_recalculateBuffer','getIndex','targetRect','max','init','locale','element','28qdBAjz','set','_alignForBottomChange','2643282TNujRT','nodeType','context','_spaceBetweenItems','_targetTop','add','destroy','delete','class','bind','config','appendChild','define','rearrange','render','get','setContainer','unbind','_getItemAfter','Sidebar','74298xaYESZ','_detachFromContainer','_alignForTopChange','last','view','sidebar.preventScrollOutOfView','_destroySidebarItemView','4158810MfrfJa','clear','_annotations','_createSidebarView','sidebar-setcontainer-invalid-element','_activeAnnotation','stopListening','addAnnotation','list','_getItemBefore','remove','1524162qgHyvt','minHeight','_sidebarItemViewToAnnotation','217hiHQoo','content','5QaIszf','sidebar.container','getSidebarItemView','_getTargetTop','isAnimationDisabled','_getMaxAvailableTop','672380WNTivj','updateHeight','target','pluginName','isActive','push','isPremiumPlugin','isOfficialPlugin','24616aflViS','container','_alignAfterItem','sidebar-attachtocontainer-missing-container','_alignToTargetRect','_attachToContainer','top','_setItemTop','bottom','_annotationToSidebarItemView','change:top','_recalculate','change:bottom','change:_lastItem','_updateLastItem','refresh','height','length','_alignBeforeItem','listenTo','582997vgVAlK','object','_lastItem'];_0x17a1=function(){return _0x5a87ef;};return _0x17a1();}const _0x3be1e3=_0x355b;(function(_0x2e2bd0,_0x2ea5f9){const _0x76dfb1=_0x355b,_0x1156aa=_0x2e2bd0();while(!![]){try{const _0x3aaf34=parseInt(_0x76dfb1(0x11c))/0x1+-parseInt(_0x76dfb1(0x127))/0x2*(parseInt(_0x76dfb1(0x13e))/0x3)+-parseInt(_0x76dfb1(0x100))/0x4+-parseInt(_0x76dfb1(0xfa))/0x5*(-parseInt(_0x76dfb1(0x150))/0x6)+parseInt(_0x76dfb1(0xf8))/0x7*(-parseInt(_0x76dfb1(0x108))/0x8)+-parseInt(_0x76dfb1(0x12a))/0x9+parseInt(_0x76dfb1(0x145))/0xa;if(_0x3aaf34===_0x2ea5f9)break;else _0x1156aa['push'](_0x1156aa['shift']());}catch(_0x4b42cc){_0x1156aa['push'](_0x1156aa['shift']());}}}(_0x17a1,0x55349));import{ContextPlugin as _0x55ed71}from'ckeditor5/src/core.js';import{Rect as _0x11d021,CKEditorError as _0x26c6f9}from'ckeditor5/src/utils.js';import{AnnotationsSidebarView as _0xed0bff}from'./view/sidebarview.js';import{AnnotationsSidebarItemView as _0x55e4e8}from'./view/sidebaritemview.js';function _0x355b(_0x51591e,_0x1c83f0){const _0x17a1ba=_0x17a1();return _0x355b=function(_0x355b87,_0x42fe2b){_0x355b87=_0x355b87-0xf6;let _0x4fa295=_0x17a1ba[_0x355b87];return _0x4fa295;},_0x355b(_0x51591e,_0x1c83f0);}export class Sidebar extends _0x55ed71{[_0x3be1e3(0x142)];[_0x3be1e3(0x14a)];[_0x3be1e3(0x147)];[_0x3be1e3(0x12d)];[_0x3be1e3(0xf7)];[_0x3be1e3(0x111)];[_0x3be1e3(0x120)];static get[_0x3be1e3(0x103)](){const _0x2fc203=_0x3be1e3;return _0x2fc203(0x13d);}static get[_0x3be1e3(0x107)](){return!0x0;}static get[_0x3be1e3(0x106)](){return!0x0;}constructor(_0x546dd2){const _0x1e199f=_0x3be1e3;super(_0x546dd2),this[_0x1e199f(0x128)](_0x1e199f(0x11e),void 0x0),this[_0x1e199f(0x142)]=this[_0x1e199f(0x148)](),this[_0x1e199f(0x128)](_0x1e199f(0x109),null),this[_0x1e199f(0x12d)]=0x19,this[_0x1e199f(0xf7)]=new Map(),this[_0x1e199f(0x111)]=new Map(),this[_0x1e199f(0x12c)][_0x1e199f(0x134)][_0x1e199f(0x136)](_0x1e199f(0x143),!0x1),this[_0x1e199f(0x147)]=null,this[_0x1e199f(0x14a)]=null,this[_0x1e199f(0x120)]=[];}[_0x3be1e3(0x124)](){const _0x48a0cc=_0x3be1e3,_0x4d671a=this[_0x48a0cc(0x12c)][_0x48a0cc(0x134)][_0x48a0cc(0x139)](_0x48a0cc(0xfb));_0x4d671a&&this[_0x48a0cc(0x13a)](_0x4d671a);}[_0x3be1e3(0x13a)](_0x1a9f8f){const _0x8282af=_0x3be1e3;if(!g(_0x1a9f8f))throw new _0x26c6f9(_0x8282af(0x149));this[_0x8282af(0x109)]=_0x1a9f8f;}[_0x3be1e3(0x10d)]({viewClass:_0x1fe959='',spaceBetweenItems:_0x96d7a4=0x19}={}){const _0xda5245=_0x3be1e3;if(!g(this[_0xda5245(0x109)]))throw new _0x26c6f9(_0xda5245(0x10b),this);this[_0xda5245(0x109)][_0xda5245(0x135)](this[_0xda5245(0x142)][_0xda5245(0x126)]),this[_0xda5245(0x142)][_0xda5245(0x132)]=_0x1fe959,this[_0xda5245(0x12d)]=_0x96d7a4;}[_0x3be1e3(0x137)]({removedAnnotation:_0x2b7249,previousAnnotation:_0x560f66,nextAnnotation:_0x10c982}){const _0x52214f=_0x3be1e3,_0x5832e1=this[_0x52214f(0xfc)](_0x2b7249);this[_0x52214f(0x142)][_0x52214f(0x14d)][_0x52214f(0x14f)](_0x5832e1),this[_0x52214f(0x144)](_0x2b7249),_0x560f66&&this[_0x52214f(0x10c)](this[_0x52214f(0xfc)](_0x560f66)),_0x10c982&&this[_0x52214f(0x10c)](this[_0x52214f(0xfc)](_0x10c982)),this[_0x52214f(0x116)]();}[_0x3be1e3(0x117)]({blurredAnnotation:_0xd8790d,activatedAnnotation:_0x336ed4,disableAnimationOnActivatedAnnotation:_0x5ca42c}){const _0x47e4b3=_0x3be1e3;if(this[_0x47e4b3(0x14a)]=_0x336ed4,_0xd8790d){_0xd8790d[_0x47e4b3(0x104)]=!0x1;const _0x4e6ee5=this[_0x47e4b3(0xfc)](_0xd8790d);_0x4e6ee5&&_0x5ca42c&&(_0x4e6ee5[_0x47e4b3(0xfe)]=!0x1);}if(_0x336ed4){const _0x1ee917=this[_0x47e4b3(0xfc)](_0x336ed4);_0x1ee917&&(_0x336ed4[_0x47e4b3(0x104)]=!0x0,_0x5ca42c&&(_0x1ee917[_0x47e4b3(0xfe)]=!0x0,_0x1ee917[_0x47e4b3(0x10e)]+=0x1),this[_0x47e4b3(0x10c)](_0x1ee917));}}[_0x3be1e3(0x13f)](_0x411c79){const _0xa882da=_0x3be1e3;if(this[_0xa882da(0x142)][_0xa882da(0x126)][_0xa882da(0x14f)](),_0x411c79){for(const _0x1a50f7 of _0x411c79)this[_0xa882da(0x144)](_0x1a50f7);}this[_0xa882da(0x142)][_0xa882da(0x14d)][_0xa882da(0x146)](),this[_0xa882da(0x142)][_0xa882da(0x132)]='',this[_0xa882da(0x11e)]=null;}[_0x3be1e3(0x14c)](_0x3f1582,_0xb9c7b2){const _0x45eeb1=_0x3be1e3;_0xb9c7b2||(_0xb9c7b2=_0x3f1582[_0x45eeb1(0x142)]);const _0x19c7dc=new _0x55e4e8(this[_0x45eeb1(0x12c)][_0x45eeb1(0x125)]);this[_0x45eeb1(0xf7)][_0x45eeb1(0x128)](_0x19c7dc,_0x3f1582),this[_0x45eeb1(0x111)][_0x45eeb1(0x128)](_0x3f1582,_0x19c7dc),_0x19c7dc[_0x45eeb1(0xf9)][_0x45eeb1(0x12f)](_0xb9c7b2),this[_0x45eeb1(0x11b)](_0x3f1582[_0x45eeb1(0x142)],_0x45eeb1(0x11f),(_0x28ae45,_0x3555a3,_0x2622a1)=>{const _0x18731e=_0x45eeb1,_0x4bd7c5=this[_0x18731e(0xfd)](_0x3f1582,_0x2622a1);_0x19c7dc[_0x18731e(0x12e)]!=_0x4bd7c5&&(_0x19c7dc[_0x18731e(0x12e)]=_0x4bd7c5,this[_0x18731e(0x10f)](_0x19c7dc,_0x4bd7c5));}),this[_0x45eeb1(0x11b)](_0x19c7dc,_0x45eeb1(0x112),()=>{const _0x4b81b7=_0x45eeb1;this[_0x4b81b7(0x113)](_0x19c7dc,_0x4b81b7(0x10e));}),this[_0x45eeb1(0x11b)](_0x19c7dc,_0x45eeb1(0x114),()=>{const _0x20be6e=_0x45eeb1;this[_0x20be6e(0x113)](_0x19c7dc,_0x20be6e(0x110));}),this[_0x45eeb1(0x10c)](_0x19c7dc);const _0x5a811c=this[_0x45eeb1(0x14e)](_0x19c7dc);if(_0x5a811c)this[_0x45eeb1(0x10a)](_0x5a811c,_0x19c7dc)||this[_0x45eeb1(0x10c)](_0x19c7dc);else this[_0x45eeb1(0x10c)](_0x19c7dc);return this[_0x45eeb1(0x116)](),this[_0x45eeb1(0x142)][_0x45eeb1(0x14d)][_0x45eeb1(0x12f)](_0x19c7dc),_0x19c7dc;}[_0x3be1e3(0x140)](_0x5719cf){const _0x1b66cc=_0x3be1e3;if(!_0x5719cf[_0x1b66cc(0xf9)][_0x1b66cc(0x119)])return;const _0x4785aa=this[_0x1b66cc(0x14e)](_0x5719cf);if(!_0x4785aa)return;const _0x197673=this[_0x1b66cc(0xf7)][_0x1b66cc(0x139)](_0x4785aa),_0x8c66f8=this[_0x1b66cc(0x14a)];_0x8c66f8&&_0x8c66f8===_0x197673?this[_0x1b66cc(0x10a)](_0x4785aa,_0x5719cf):this[_0x1b66cc(0x11a)](_0x5719cf,_0x4785aa);}[_0x3be1e3(0x129)](_0x2754f8){const _0x3032d3=_0x3be1e3;if(!_0x2754f8[_0x3032d3(0xf9)][_0x3032d3(0x119)])return;const _0x1410aa=this[_0x3032d3(0x13c)](_0x2754f8);if(!_0x1410aa)return;const _0x143ac8=this[_0x3032d3(0xf7)][_0x3032d3(0x139)](_0x1410aa),_0x22c71e=this[_0x3032d3(0x12c)][_0x3032d3(0x134)][_0x3032d3(0x139)](_0x3032d3(0x143)),_0x3d8630=this[_0x3032d3(0x14a)];_0x3d8630&&_0x3d8630===_0x143ac8&&_0x22c71e?(this[_0x3032d3(0x11a)](_0x1410aa,_0x2754f8),this[_0x3032d3(0x10a)](_0x2754f8,_0x1410aa)):_0x3d8630&&_0x3d8630===_0x143ac8?this[_0x3032d3(0x11a)](_0x1410aa,_0x2754f8):this[_0x3032d3(0x10a)](_0x2754f8,_0x1410aa);}[_0x3be1e3(0x113)](_0x474650,_0x51f172){const _0x117c2e=_0x3be1e3;0x0===this[_0x117c2e(0x120)][_0x117c2e(0x119)]&&setTimeout(()=>{const _0x3a969d=_0x117c2e;for(const {sidebarItemView:_0x4b4dd6,changedProp:_0xcc78df}of this[_0x3a969d(0x120)])_0x3a969d(0x10e)===_0xcc78df?this[_0x3a969d(0x140)](_0x4b4dd6):this[_0x3a969d(0x129)](_0x4b4dd6);this[_0x3a969d(0x120)]=[];},0xa),this[_0x117c2e(0x120)][_0x117c2e(0x105)]({'sidebarItemView':_0x474650,'changedProp':_0x51f172});}[_0x3be1e3(0xfc)](_0x3a1935){const _0x1bb97f=_0x3be1e3;return this[_0x1bb97f(0x111)][_0x1bb97f(0x139)](_0x3a1935);}[_0x3be1e3(0x130)](){const _0x437957=_0x3be1e3;this[_0x437957(0x14b)](),this[_0x437957(0x142)][_0x437957(0x130)]();}[_0x3be1e3(0x144)](_0x3dffd2){const _0x30492e=_0x3be1e3,_0x30ffef=this[_0x30492e(0xfc)](_0x3dffd2);this[_0x30492e(0x14b)](_0x30ffef),this[_0x30492e(0x14b)](_0x3dffd2[_0x30492e(0x142)]),_0x30ffef[_0x30492e(0x130)](),this[_0x30492e(0x111)][_0x30492e(0x131)](_0x3dffd2),this[_0x30492e(0xf7)][_0x30492e(0x131)](_0x30ffef);}[_0x3be1e3(0x148)](){const _0x1f5fe4=_0x3be1e3,_0x4cc3e6=new _0xed0bff(this[_0x1f5fe4(0x12c)][_0x1f5fe4(0x125)]);return _0x4cc3e6[_0x1f5fe4(0x138)](),this['on'](_0x1f5fe4(0x115),(_0x22432a,_0x511eb5,_0x1a5960,_0x2312c3)=>{const _0x139b67=_0x1f5fe4;_0x2312c3&&_0x4cc3e6[_0x139b67(0x13b)](_0x139b67(0xf6)),_0x1a5960?_0x4cc3e6[_0x139b67(0x133)](_0x139b67(0xf6))['to'](_0x1a5960,_0x139b67(0x110)):_0x4cc3e6[_0x139b67(0xf6)]=null;}),_0x4cc3e6;}[_0x3be1e3(0x116)](){const _0x4145d5=_0x3be1e3;this[_0x4145d5(0x11e)]=this[_0x4145d5(0x147)]?.[_0x4145d5(0x141)]?this[_0x4145d5(0xfc)](this[_0x4145d5(0x147)][_0x4145d5(0x141)]):null;}[_0x3be1e3(0x14e)](_0x5192ec){const _0x368b59=_0x3be1e3,_0x526adf=this[_0x368b59(0xf7)][_0x368b59(0x139)](_0x5192ec),_0x39d067=_0x526adf&&this[_0x368b59(0x147)]?.[_0x368b59(0x139)](this[_0x368b59(0x147)][_0x368b59(0x121)](_0x526adf)-0x1);return _0x39d067&&this[_0x368b59(0xfc)](_0x39d067)||null;}[_0x3be1e3(0x13c)](_0x2d4cc1){const _0x36a347=_0x3be1e3,_0x432215=this[_0x36a347(0xf7)][_0x36a347(0x139)](_0x2d4cc1),_0x28451c=_0x432215&&this[_0x36a347(0x147)]?.[_0x36a347(0x139)](this[_0x36a347(0x147)][_0x36a347(0x121)](_0x432215)+0x1);return _0x28451c&&this[_0x36a347(0xfc)](_0x28451c)||null;}[_0x3be1e3(0x11a)](_0x1fd204,_0x20d223){const _0x28b658=_0x3be1e3;_0x1fd204[_0x28b658(0x101)]();const _0x4fd8fd=G(_0x20d223[_0x28b658(0x110)]+this[_0x28b658(0x12d)],_0x1fd204[_0x28b658(0x10e)]);return!!_0x4fd8fd&&(this[_0x28b658(0x10f)](_0x20d223,_0x20d223[_0x28b658(0x10e)]-_0x4fd8fd),!0x0);}[_0x3be1e3(0x10a)](_0x4e4051,_0x3e10d7){const _0x1b6279=_0x3be1e3;_0x4e4051[_0x1b6279(0x101)]();const _0xaeb2c8=G(_0x4e4051[_0x1b6279(0x110)]+this[_0x1b6279(0x12d)],_0x3e10d7[_0x1b6279(0x10e)]);return!!_0xaeb2c8&&(this[_0x1b6279(0x10f)](_0x3e10d7,_0x3e10d7[_0x1b6279(0x10e)]+_0xaeb2c8,!0x1),!0x0);}[_0x3be1e3(0x10c)](_0x1c28ba){const _0x425dbb=_0x3be1e3,_0xa0df45=this[_0x425dbb(0xf7)][_0x425dbb(0x139)](_0x1c28ba);if(!_0xa0df45||!_0xa0df45[_0x425dbb(0x102)]||!_0xa0df45[_0x425dbb(0x122)])return;const _0x2cf422=this[_0x425dbb(0xfd)](_0xa0df45,_0xa0df45[_0x425dbb(0x122)]);this[_0x425dbb(0x10f)](_0x1c28ba,_0x2cf422);}[_0x3be1e3(0xfd)](_0x123909,_0x21bee6){const _0x5b22cb=_0x3be1e3;if(null===_0x21bee6)return 0x0;if(_0x123909[_0x5b22cb(0x102)]instanceof _0x11d021)return _0x21bee6[_0x5b22cb(0x10e)];{const _0xf8835=new _0x11d021(this[_0x5b22cb(0x142)][_0x5b22cb(0x126)])[_0x5b22cb(0x10e)];return _0x21bee6[_0x5b22cb(0x10e)]-_0xf8835;}}[_0x3be1e3(0x10f)](_0x520244,_0x5cca03,_0x163788=this[_0x3be1e3(0x12c)][_0x3be1e3(0x134)][_0x3be1e3(0x139)](_0x3be1e3(0x143))){const _0x20e7ed=_0x3be1e3;_0x163788&&(_0x5cca03=Math[_0x20e7ed(0x123)](_0x5cca03,this[_0x20e7ed(0xff)](_0x520244))),_0x520244[_0x20e7ed(0x10e)]=_0x5cca03;}[_0x3be1e3(0xff)](_0x1d40ab){const _0x220c0c=_0x3be1e3;let _0x105f42=this[_0x220c0c(0x14e)](_0x1d40ab),_0x172361=0x0;for(;_0x105f42;)_0x105f42[_0x220c0c(0x101)](),_0x172361+=this[_0x220c0c(0x12d)]+_0x105f42[_0x220c0c(0x118)],_0x105f42=this[_0x220c0c(0x14e)](_0x105f42);return _0x172361;}}function G(_0x1744b3,_0x571a09){const _0x48c025=_0x3be1e3;return Math[_0x48c025(0x123)](_0x1744b3-_0x571a09,0x0);}function g(_0x4ae0aa){const _0x9e85ee=_0x3be1e3;return null!==_0x4ae0aa&&_0x9e85ee(0x11d)==typeof _0x4ae0aa&&0x1===_0x4ae0aa[_0x9e85ee(0x12b)];}