@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 12.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 _0x521c02=_0x18dc;(function(_0x51b673,_0x4a7307){const _0x164629=_0x18dc,_0x1ae6cd=_0x51b673();while(!![]){try{const _0x32c9ea=parseInt(_0x164629(0x149))/0x1+-parseInt(_0x164629(0x134))/0x2+-parseInt(_0x164629(0x106))/0x3*(parseInt(_0x164629(0x11f))/0x4)+parseInt(_0x164629(0x12f))/0x5*(-parseInt(_0x164629(0x129))/0x6)+-parseInt(_0x164629(0x153))/0x7*(-parseInt(_0x164629(0x157))/0x8)+parseInt(_0x164629(0x13d))/0x9+parseInt(_0x164629(0x146))/0xa*(parseInt(_0x164629(0x152))/0xb);if(_0x32c9ea===_0x4a7307)break;else _0x1ae6cd['push'](_0x1ae6cd['shift']());}catch(_0x1dcb2d){_0x1ae6cd['push'](_0x1ae6cd['shift']());}}}(_0x516d,0x74669));import{Plugin as _0x3e6fdd}from'ckeditor5/src/core.js';import{AnnotationsUIs as _0x371c6f}from'./annotationsuis.js';import{EditorAnnotations as _0x3fe285}from'./editorannotations.js';function _0x18dc(_0x18334c,_0x3c0ac1){const _0x516d1c=_0x516d();return _0x18dc=function(_0x18dc28,_0x2e887f){_0x18dc28=_0x18dc28-0xfa;let _0x5429f9=_0x516d1c[_0x18dc28];return _0x5429f9;},_0x18dc(_0x18334c,_0x3c0ac1);}import{ContextualBalloon as _0x3ddb17}from'ckeditor5/src/ui.js';import{MouseObserver as _0x2421a1}from'ckeditor5/src/engine.js';import{CKEditorError as _0x56083f,Rect as _0x161983}from'ckeditor5/src/utils.js';import'./../../theme/annotation-inline.css';function _0x516d(){const _0x1715ca=['InlineAnnotations','find','_balloon','focus','257709SttDki','push','requires','isActive','getByView','stopListening','top','length','inlineannotations-detach-not-attached','inlineannotations-not-allowed-with-context','plugins','clear','collapse','addObserver','getFirstRange','afterInit','_addAnnotationToBalloon','isAttached','_removeAnnotationFromBalloon','get','fromRect','every','register','getOrderedSelectedAnnotations','delete','8lVGQve','isFocused','keystrokes','change:visibleView','isOfficialPlugin','activeAnnotation','map','attach','hasView','context','318810AqNozC','includes','from','_addedAnnotations','update','remove','10rjDvGG','right','isPremiumPlugin','inlineannotations-attach-already-attached','_setSelectedAnnotations','990424rQsbwH','domConverter','change:height','detach','add','selection','pluginName','_manuallyClosed','left','2241108lTXfCR','target','hasActive','bottom','inline','annotations','Esc','updatePosition','targetRect','55690mrjbCa','width','blur','627783xZpmYF','document','setActiveAnnotation','change:isFocused','focusTracker','view','listenTo','visibleView','viewRangeToDom','539gyHJDM','763ootAAS','showStack','_selectedAnnotations','editing','7368PoUXox','_closeAnnotation','init','editor','has','editableElement','_forceRefresh','mousedown','switchTo','destroy','getBoundingClientRect','_getBalloonTargetForAnnotation','set','refresh','getClientRects'];_0x516d=function(){return _0x1715ca;};return _0x516d();}export class InlineAnnotations extends _0x3e6fdd{[_0x521c02(0x117)];[_0x521c02(0x142)];[_0x521c02(0x13b)];[_0x521c02(0x104)];[_0x521c02(0x12c)];[_0x521c02(0x155)];[_0x521c02(0x15d)];static get[_0x521c02(0x108)](){return[_0x3fe285,_0x3ddb17,_0x371c6f];}static get[_0x521c02(0x13a)](){const _0xf4b89b=_0x521c02;return _0xf4b89b(0x102);}static get[_0x521c02(0x123)](){return!0x0;}static get[_0x521c02(0x131)](){return!0x0;}constructor(_0x59b9b6){const _0x64bd43=_0x521c02;super(_0x59b9b6),_0x59b9b6[_0x64bd43(0x156)][_0x64bd43(0x14e)][_0x64bd43(0x113)](_0x2421a1),this[_0x64bd43(0x117)]=!0x1,this[_0x64bd43(0xff)](_0x64bd43(0x124),null),this[_0x64bd43(0x142)]=null,this[_0x64bd43(0x13b)]=new Set(),this[_0x64bd43(0x104)]=_0x59b9b6[_0x64bd43(0x110)][_0x64bd43(0x119)](_0x3ddb17),this[_0x64bd43(0x12c)]=new Set(),this[_0x64bd43(0x155)]=[],this[_0x64bd43(0x15d)]=!0x1;}[_0x521c02(0x159)](){const _0x3d8d58=_0x521c02,_0x511f5e=this[_0x3d8d58(0x15a)][_0x3d8d58(0x110)][_0x3d8d58(0x119)](_0x371c6f);_0x511f5e[_0x3d8d58(0x128)]===this[_0x3d8d58(0x15a)]&&(_0x511f5e[_0x3d8d58(0x11c)](_0x3d8d58(0x141),this),this[_0x3d8d58(0x15a)][_0x3d8d58(0x121)][_0x3d8d58(0xff)](_0x3d8d58(0x143),(_0x37985a,_0x26b97b)=>{const _0x4cd34b=_0x3d8d58,_0x1d7a81=this[_0x4cd34b(0x104)];if(this[_0x4cd34b(0x117)]&&_0x1d7a81[_0x4cd34b(0x150)]){const _0x5339da=this[_0x4cd34b(0x142)][_0x4cd34b(0x10a)](_0x1d7a81[_0x4cd34b(0x150)]);_0x5339da&&this[_0x4cd34b(0x158)](_0x5339da),_0x26b97b();}}));}[_0x521c02(0x115)](){const _0x2a4d2d=_0x521c02,_0x34af6f=this[_0x2a4d2d(0x15a)][_0x2a4d2d(0x110)][_0x2a4d2d(0x119)](_0x371c6f);_0x34af6f[_0x2a4d2d(0x128)]===this[_0x2a4d2d(0x15a)]&&(_0x34af6f[_0x2a4d2d(0x13f)]()||_0x34af6f[_0x2a4d2d(0xfb)](_0x2a4d2d(0x141)));}[_0x521c02(0x14b)](_0x15ff73){const _0x4022dd=_0x521c02;_0x15ff73!==this[_0x4022dd(0x124)]&&(this[_0x4022dd(0x124)]&&(this[_0x4022dd(0x124)][_0x4022dd(0x109)]=!0x1),_0x15ff73&&this[_0x4022dd(0x15a)]['ui'][_0x4022dd(0x14d)][_0x4022dd(0x120)]&&(this[_0x4022dd(0x142)][_0x4022dd(0x15b)](_0x15ff73)&&this[_0x4022dd(0x116)](_0x15ff73,!0x0),_0x15ff73[_0x4022dd(0x109)]=!0x0),_0x15ff73||this[_0x4022dd(0x133)]([]),this[_0x4022dd(0x124)]=_0x15ff73);}[_0x521c02(0x126)](_0x547249){const _0x28506c=_0x521c02;this[_0x28506c(0x142)]=_0x547249;const _0x318991=this[_0x28506c(0x15a)][_0x28506c(0x110)][_0x28506c(0x119)](_0x371c6f),_0x2345f2=this[_0x28506c(0x104)];if(this[_0x28506c(0x117)])throw new _0x56083f(_0x28506c(0x132),this);if(_0x318991[_0x28506c(0x128)]!==this[_0x28506c(0x15a)])throw new _0x56083f(_0x28506c(0x10f),this);const _0x2f6e94=this[_0x28506c(0x15a)][_0x28506c(0x110)][_0x28506c(0x119)](_0x3fe285);this[_0x28506c(0x14f)](_0x2f6e94,_0x28506c(0x100),()=>{const _0x18a18c=_0x28506c,_0x2eea56=_0x2f6e94[_0x18a18c(0x11d)]({'annotations':this[_0x18a18c(0x142)],'activeAnnotation':this[_0x18a18c(0x124)]});var _0x5259a9,_0x1d855f;!this[_0x18a18c(0x15d)]&&(_0x5259a9=_0x2eea56,_0x1d855f=this[_0x18a18c(0x155)],_0x5259a9[_0x18a18c(0x10d)]===_0x1d855f[_0x18a18c(0x10d)]&&_0x5259a9[_0x18a18c(0x11b)](_0x2a46f6=>_0x1d855f[_0x18a18c(0x12a)](_0x2a46f6)))||(this[_0x18a18c(0x15d)]=!0x1,this[_0x18a18c(0x133)](_0x2eea56),this[_0x18a18c(0x14b)](_0x2eea56[0x0]||null));}),this[_0x28506c(0x14f)](_0x2f6e94,_0x28506c(0x148),(_0x15f2ea,{isAnnotationTracked:_0x30daf5})=>{const _0x1a3a60=_0x28506c;this[_0x1a3a60(0x124)]&&_0x30daf5(this[_0x1a3a60(0x124)])&&(this[_0x1a3a60(0x133)]([]),this[_0x1a3a60(0x14b)](null));}),this[_0x28506c(0x14f)](this[_0x28506c(0x15a)]['ui'][_0x28506c(0x14d)],_0x28506c(0x14c),(_0x4c36bf,_0x3ab7bf,_0x36b8b8)=>{const _0x38f37e=_0x28506c;_0x36b8b8||this[_0x38f37e(0x14b)](null);}),this[_0x28506c(0x14f)](_0x547249,_0x28506c(0x12e),(_0x3dabf5,_0x5b795d)=>{const _0x4585e2=_0x28506c;this[_0x4585e2(0x118)](_0x5b795d),_0x5b795d===this[_0x4585e2(0x124)]&&this[_0x4585e2(0x14b)](null);}),this[_0x28506c(0x14f)](_0x2345f2,_0x28506c(0x122),(_0x357e1a,_0x230462,_0x22956b,_0x4c4392)=>{const _0x4669df=_0x28506c;_0x4c4392&&this[_0x4669df(0x10b)](_0x4c4392);const _0x23b1ae=_0x547249[_0x4669df(0x10a)](_0x22956b);_0x22956b&&_0x23b1ae&&(this[_0x4669df(0x14f)](_0x22956b,_0x4669df(0x136),()=>{const _0x142e7c=_0x4669df;_0x2345f2[_0x142e7c(0x144)]();}),this[_0x4669df(0x14f)](_0x22956b,_0x4669df(0x143),()=>{const _0x4c21db=_0x4669df;this[_0x4c21db(0x158)](_0x23b1ae),this[_0x4c21db(0x15a)][_0x4c21db(0x156)][_0x4c21db(0x14e)][_0x4c21db(0x105)]();}),this[_0x4669df(0x124)]!==_0x23b1ae&&this[_0x4669df(0x14b)](_0x23b1ae));}),this[_0x28506c(0x14f)](this[_0x28506c(0x15a)]['ui'],_0x28506c(0x12d),()=>{const _0x11f74d=_0x28506c;_0x2345f2[_0x11f74d(0x150)]&&(_0x547249[_0x11f74d(0x10a)](_0x2345f2[_0x11f74d(0x150)])&&_0x2345f2[_0x11f74d(0x144)]());}),this[_0x28506c(0x14f)](this[_0x28506c(0x15a)][_0x28506c(0x156)][_0x28506c(0x14e)][_0x28506c(0x14a)],_0x28506c(0xfa),()=>{const _0x545a62=_0x28506c;this[_0x545a62(0x15d)]=!0x0,this[_0x545a62(0x13b)][_0x545a62(0x111)]();}),this[_0x28506c(0x15a)][_0x28506c(0x156)][_0x28506c(0x14e)][_0x28506c(0x14a)][_0x28506c(0x139)][_0x28506c(0x15c)]&&this[_0x28506c(0x15a)][_0x28506c(0x156)][_0x28506c(0x14e)][_0x28506c(0x105)](),this[_0x28506c(0x117)]=!0x0;}[_0x521c02(0x137)](){const _0x32a5e3=_0x521c02;if(!this[_0x32a5e3(0x117)])throw new _0x56083f(_0x32a5e3(0x10e),this);this[_0x32a5e3(0x14b)](null);for(const _0x598794 of this[_0x32a5e3(0x12c)])this[_0x32a5e3(0x118)](_0x598794);this[_0x32a5e3(0x10b)](),this[_0x32a5e3(0x117)]=!0x1,this[_0x32a5e3(0x142)]=null;}[_0x521c02(0xfc)](){const _0x44fce9=_0x521c02;this[_0x44fce9(0x117)]&&this[_0x44fce9(0x137)]();}[_0x521c02(0x133)](_0x4e9d36){const _0x2eaa9a=_0x521c02;for(const _0x6273f8 of this[_0x2eaa9a(0x155)])_0x4e9d36[_0x2eaa9a(0x12a)](_0x6273f8)||this[_0x2eaa9a(0x13b)][_0x2eaa9a(0x11e)](_0x6273f8);for(const _0x2b0848 of this[_0x2eaa9a(0x142)])_0x4e9d36[_0x2eaa9a(0x12a)](_0x2b0848)||this[_0x2eaa9a(0x118)](_0x2b0848);if(this[_0x2eaa9a(0x15a)]['ui'][_0x2eaa9a(0x14d)][_0x2eaa9a(0x120)]){for(const _0x494483 of _0x4e9d36)this[_0x2eaa9a(0x116)](_0x494483);}this[_0x2eaa9a(0x155)]=_0x4e9d36;}[_0x521c02(0x116)](_0x2c1d91,_0x4412c9=!0x1){const _0x618ac=_0x521c02;this[_0x618ac(0x13b)][_0x618ac(0x15b)](_0x2c1d91)||(this[_0x618ac(0x12c)][_0x618ac(0x15b)](_0x2c1d91)||this[_0x618ac(0x104)][_0x618ac(0x127)](_0x2c1d91[_0x618ac(0x14e)])||(this[_0x618ac(0x12c)][_0x618ac(0x138)](_0x2c1d91),this[_0x618ac(0x104)][_0x618ac(0x138)]({'stackId':_0x2c1d91[_0x618ac(0x14e)]['id'],'view':_0x2c1d91[_0x618ac(0x14e)],'position':{'target':()=>this[_0x618ac(0xfe)](_0x2c1d91)}})),_0x4412c9&&this[_0x618ac(0x104)][_0x618ac(0x154)](_0x2c1d91[_0x618ac(0x14e)]['id']));}[_0x521c02(0xfe)](_0x3ce7a4){const _0x4065e4=_0x521c02,_0x54b449=_0x3ce7a4[_0x4065e4(0x13e)],_0x3ba5b6=this[_0x4065e4(0x15a)][_0x4065e4(0x156)][_0x4065e4(0x14e)],_0x44de2e=_0x3ba5b6[_0x4065e4(0x14a)][_0x4065e4(0x139)][_0x4065e4(0x114)](),_0x1f9145=_0x3ba5b6[_0x4065e4(0x135)][_0x4065e4(0x151)](_0x44de2e);if(_0x1f9145[_0x4065e4(0x112)](!0x0),_0x54b449){if(_0x54b449 instanceof _0x161983)return _0x54b449;let _0xf274af=[];for(const _0x4575f7 of _0x54b449)_0xf274af[_0x4065e4(0x107)](...F(_0x4575f7[_0x4065e4(0x101)]()));_0xf274af=function(_0x36c6c1){const _0x11b30a=_0x4065e4,_0x40c822=[];let _0x29eec7=_0x36c6c1[0x0];for(let _0x299150=0x1;_0x299150<_0x36c6c1[_0x11b30a(0x10d)];_0x299150++)P(_0x29eec7,_0x36c6c1[_0x299150])?_0x29eec7[_0x11b30a(0x147)]+=_0x36c6c1[_0x299150][_0x11b30a(0x147)]:(_0x40c822[_0x11b30a(0x107)](_0x29eec7),_0x29eec7=_0x36c6c1[_0x299150]);return _0x40c822[_0x11b30a(0x107)](_0x29eec7),_0x40c822;}(_0xf274af);const _0x57aebd=_0x1f9145[_0x4065e4(0xfd)]();return _0xf274af[_0x4065e4(0x103)](_0xfe1ad9=>_0xfe1ad9[_0x4065e4(0x10c)]<=_0x57aebd[_0x4065e4(0x10c)]&&_0xfe1ad9[_0x4065e4(0x140)]>=_0x57aebd[_0x4065e4(0x140)]&&_0xfe1ad9[_0x4065e4(0x13c)]<=_0x57aebd[_0x4065e4(0x13c)]&&_0xfe1ad9[_0x4065e4(0x130)]>=_0x57aebd[_0x4065e4(0x130)])||_0xf274af[0x0];}return _0x3ce7a4[_0x4065e4(0x145)]||_0x1f9145;}[_0x521c02(0x118)](_0x36f954){const _0x5caca3=_0x521c02;this[_0x5caca3(0x12c)][_0x5caca3(0x15b)](_0x36f954)&&this[_0x5caca3(0x104)][_0x5caca3(0x127)](_0x36f954[_0x5caca3(0x14e)])&&(this[_0x5caca3(0x12c)][_0x5caca3(0x11e)](_0x36f954),this[_0x5caca3(0x104)][_0x5caca3(0x12e)](_0x36f954[_0x5caca3(0x14e)]));}[_0x521c02(0x158)](_0x134209){const _0x28a576=_0x521c02;this[_0x28a576(0x13b)][_0x28a576(0x138)](_0x134209),this[_0x28a576(0x118)](_0x134209);}}function F(_0xd40ba9){const _0x345428=_0x521c02;return Array[_0x345428(0x12b)](_0xd40ba9)[_0x345428(0x125)](DOMRect[_0x345428(0x11a)]);}function P(_0x21f35b,_0x42a81f){const _0x58d8c2=_0x521c02;return _0x21f35b[_0x58d8c2(0x10c)]===_0x42a81f[_0x58d8c2(0x10c)]&&_0x21f35b[_0x58d8c2(0x140)]===_0x42a81f[_0x58d8c2(0x140)]&&_0x21f35b[_0x58d8c2(0x130)]===_0x42a81f[_0x58d8c2(0x13c)];}