@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 12.3 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 _0x3ccada=_0x16a9;(function(_0x20004e,_0x5c81c2){const _0x2b7dd7=_0x16a9,_0x4a3980=_0x20004e();while(!![]){try{const _0x310f9e=parseInt(_0x2b7dd7(0xe6))/0x1*(-parseInt(_0x2b7dd7(0xc5))/0x2)+-parseInt(_0x2b7dd7(0xe9))/0x3+-parseInt(_0x2b7dd7(0xe5))/0x4+parseInt(_0x2b7dd7(0x105))/0x5+-parseInt(_0x2b7dd7(0x10e))/0x6+-parseInt(_0x2b7dd7(0xe1))/0x7+parseInt(_0x2b7dd7(0x115))/0x8;if(_0x310f9e===_0x5c81c2)break;else _0x4a3980['push'](_0x4a3980['shift']());}catch(_0x4ece57){_0x4a3980['push'](_0x4a3980['shift']());}}}(_0x59d5,0x5a86f));import{Plugin as _0x281ded}from'ckeditor5/src/core.js';function _0x59d5(){const _0x1fc3cd=['getByView','inline','right','listenTo','detach','remove','document','view','_removeAnnotationFromBalloon','1559230RZUXrO','set','isAttached','_closeAnnotation','inlineannotations-detach-not-attached','clear','setActiveAnnotation','afterInit','has','2578548HAzjyf','every','push','length','_addAnnotationToBalloon','_setSelectedAnnotations','getOrderedSelectedAnnotations','11486120yzaacM','blur','_manuallyClosed','selection','plugins','change:isFocused','find','editing','from','includes','width','getBoundingClientRect','left','addObserver','destroy','focusTracker','collapse','422968pbKKRN','add','delete','InlineAnnotations','Esc','pluginName','visibleView','update','showStack','editor','get','keystrokes','isActive','_selectedAnnotations','isPremiumPlugin','updatePosition','targetRect','_getBalloonTargetForAnnotation','getClientRects','hasView','mousedown','isOfficialPlugin','inlineannotations-not-allowed-with-context','editableElement','register','requires','focus','top','1203454StOPje','getFirstRange','viewRangeToDom','init','1428264QHiLgw','1biqKxO','annotations','switchTo','619746sLuyQc','change:height','inlineannotations-attach-already-attached','_forceRefresh','isFocused','bottom','hasActive','fromRect','domConverter','_addedAnnotations','target','activeAnnotation','_balloon','map','attach','context','stopListening','refresh','change:visibleView'];_0x59d5=function(){return _0x1fc3cd;};return _0x59d5();}import _0x121757 from'./annotationsuis.js';import _0x59867b from'./editorannotations.js';import{ContextualBalloon as _0x4b4586}from'ckeditor5/src/ui.js';function _0x16a9(_0x3a7e0f,_0x24d42){const _0x59d5ad=_0x59d5();return _0x16a9=function(_0x16a9b0,_0x3b23ed){_0x16a9b0=_0x16a9b0-0xbf;let _0x1621af=_0x59d5ad[_0x16a9b0];return _0x1621af;},_0x16a9(_0x3a7e0f,_0x24d42);}import{MouseObserver as _0x599a57}from'ckeditor5/src/engine.js';import{CKEditorError as _0x229da5,Rect as _0x51bc48}from'ckeditor5/src/utils.js';import'./../../theme/annotation-inline.css';export default class c extends _0x281ded{[_0x3ccada(0x107)];[_0x3ccada(0xe7)];[_0x3ccada(0x117)];[_0x3ccada(0xf5)];[_0x3ccada(0xf2)];[_0x3ccada(0xd2)];[_0x3ccada(0xec)];static get[_0x3ccada(0xde)](){return[_0x59867b,_0x4b4586,_0x121757];}static get[_0x3ccada(0xca)](){const _0x15f67a=_0x3ccada;return _0x15f67a(0xc8);}static get[_0x3ccada(0xda)](){return!0x0;}static get[_0x3ccada(0xd3)](){return!0x0;}constructor(_0xba0db4){const _0x476910=_0x3ccada;super(_0xba0db4),_0xba0db4[_0x476910(0x11c)][_0x476910(0x103)][_0x476910(0xc1)](_0x599a57),this[_0x476910(0x107)]=!0x1,this[_0x476910(0x106)](_0x476910(0xf4),null),this[_0x476910(0xe7)]=null,this[_0x476910(0x117)]=new Set(),this[_0x476910(0xf5)]=_0xba0db4[_0x476910(0x119)][_0x476910(0xcf)](_0x4b4586),this[_0x476910(0xf2)]=new Set(),this[_0x476910(0xd2)]=[],this[_0x476910(0xec)]=!0x1;}[_0x3ccada(0xe4)](){const _0x2ca4d7=_0x3ccada,_0x31f0dd=this[_0x2ca4d7(0xce)][_0x2ca4d7(0x119)][_0x2ca4d7(0xcf)](_0x121757);_0x31f0dd[_0x2ca4d7(0xf8)]===this[_0x2ca4d7(0xce)]&&(_0x31f0dd[_0x2ca4d7(0xdd)](_0x2ca4d7(0xfd),this),this[_0x2ca4d7(0xce)][_0x2ca4d7(0xd0)][_0x2ca4d7(0x106)](_0x2ca4d7(0xc9),(_0x5fcde2,_0x5ac9a6)=>{const _0x4e539c=_0x2ca4d7,_0x109ade=this[_0x4e539c(0xf5)];if(this[_0x4e539c(0x107)]&&_0x109ade[_0x4e539c(0xcb)]){const _0x34c040=this[_0x4e539c(0xe7)][_0x4e539c(0xfc)](_0x109ade[_0x4e539c(0xcb)]);_0x34c040&&this[_0x4e539c(0x108)](_0x34c040),_0x5ac9a6();}}));}[_0x3ccada(0x10c)](){const _0x360e95=_0x3ccada,_0x5e8a8b=this[_0x360e95(0xce)][_0x360e95(0x119)][_0x360e95(0xcf)](_0x121757);_0x5e8a8b[_0x360e95(0xf8)]===this[_0x360e95(0xce)]&&(_0x5e8a8b[_0x360e95(0xef)]()||_0x5e8a8b[_0x360e95(0xe8)](_0x360e95(0xfd)));}[_0x3ccada(0x10b)](_0x344e6d){const _0x9c8fd7=_0x3ccada;_0x344e6d!==this[_0x9c8fd7(0xf4)]&&(this[_0x9c8fd7(0xf4)]&&(this[_0x9c8fd7(0xf4)][_0x9c8fd7(0xd1)]=!0x1),_0x344e6d&&this[_0x9c8fd7(0xce)]['ui'][_0x9c8fd7(0xc3)][_0x9c8fd7(0xed)]&&(this[_0x9c8fd7(0xe7)][_0x9c8fd7(0x10d)](_0x344e6d)&&this[_0x9c8fd7(0x112)](_0x344e6d,!0x0),_0x344e6d[_0x9c8fd7(0xd1)]=!0x0),_0x344e6d||this[_0x9c8fd7(0x113)]([]),this[_0x9c8fd7(0xf4)]=_0x344e6d);}[_0x3ccada(0xf7)](_0x2bcf5d){const _0x5717bc=_0x3ccada;this[_0x5717bc(0xe7)]=_0x2bcf5d;const _0x23d2b0=this[_0x5717bc(0xce)][_0x5717bc(0x119)][_0x5717bc(0xcf)](_0x121757),_0x701cec=this[_0x5717bc(0xf5)];if(this[_0x5717bc(0x107)])throw new _0x229da5(_0x5717bc(0xeb),this);if(_0x23d2b0[_0x5717bc(0xf8)]!==this[_0x5717bc(0xce)])throw new _0x229da5(_0x5717bc(0xdb),this);const _0x18a2bc=this[_0x5717bc(0xce)][_0x5717bc(0x119)][_0x5717bc(0xcf)](_0x59867b);this[_0x5717bc(0xff)](_0x18a2bc,_0x5717bc(0xfa),()=>{const _0x5aaa19=_0x5717bc,_0x527c6a=_0x18a2bc[_0x5aaa19(0x114)]({'annotations':this[_0x5aaa19(0xe7)],'activeAnnotation':this[_0x5aaa19(0xf4)]});var _0x5a06bc,_0x5c6a4b;!this[_0x5aaa19(0xec)]&&(_0x5a06bc=_0x527c6a,_0x5c6a4b=this[_0x5aaa19(0xd2)],_0x5a06bc[_0x5aaa19(0x111)]===_0x5c6a4b[_0x5aaa19(0x111)]&&_0x5a06bc[_0x5aaa19(0x10f)](_0x53a6cb=>_0x5c6a4b[_0x5aaa19(0x11e)](_0x53a6cb)))||(this[_0x5aaa19(0xec)]=!0x1,this[_0x5aaa19(0x113)](_0x527c6a),this[_0x5aaa19(0x10b)](_0x527c6a[0x0]||null));}),this[_0x5717bc(0xff)](_0x18a2bc,_0x5717bc(0x116),(_0x55a3ea,{isAnnotationTracked:_0x1dc48c})=>{const _0x778d86=_0x5717bc;this[_0x778d86(0xf4)]&&_0x1dc48c(this[_0x778d86(0xf4)])&&(this[_0x778d86(0x113)]([]),this[_0x778d86(0x10b)](null));}),this[_0x5717bc(0xff)](this[_0x5717bc(0xce)]['ui'][_0x5717bc(0xc3)],_0x5717bc(0x11a),(_0x2ed245,_0x3b33f1,_0x57e31a)=>{const _0x2f0ec5=_0x5717bc;_0x57e31a||this[_0x2f0ec5(0x10b)](null);}),this[_0x5717bc(0xff)](_0x2bcf5d,_0x5717bc(0x101),(_0x2a1d26,_0x1394aa)=>{const _0x5c0c55=_0x5717bc;this[_0x5c0c55(0x104)](_0x1394aa),_0x1394aa===this[_0x5c0c55(0xf4)]&&this[_0x5c0c55(0x10b)](null);}),this[_0x5717bc(0xff)](_0x701cec,_0x5717bc(0xfb),(_0x162c1f,_0x5b7090,_0x4bd6e1,_0x59aaae)=>{const _0x4bf251=_0x5717bc;_0x59aaae&&this[_0x4bf251(0xf9)](_0x59aaae);const _0x3d8ced=_0x2bcf5d[_0x4bf251(0xfc)](_0x4bd6e1);_0x4bd6e1&&_0x3d8ced&&(this[_0x4bf251(0xff)](_0x4bd6e1,_0x4bf251(0xea),()=>{const _0x2dbec1=_0x4bf251;_0x701cec[_0x2dbec1(0xd4)]();}),this[_0x4bf251(0xff)](_0x4bd6e1,_0x4bf251(0xc9),()=>{const _0x55c28c=_0x4bf251;this[_0x55c28c(0x108)](_0x3d8ced),this[_0x55c28c(0xce)][_0x55c28c(0x11c)][_0x55c28c(0x103)][_0x55c28c(0xdf)]();}),this[_0x4bf251(0xf4)]!==_0x3d8ced&&this[_0x4bf251(0x10b)](_0x3d8ced));}),this[_0x5717bc(0xff)](this[_0x5717bc(0xce)]['ui'],_0x5717bc(0xcc),()=>{const _0x19074a=_0x5717bc;_0x701cec[_0x19074a(0xcb)]&&(_0x2bcf5d[_0x19074a(0xfc)](_0x701cec[_0x19074a(0xcb)])&&_0x701cec[_0x19074a(0xd4)]());}),this[_0x5717bc(0xff)](this[_0x5717bc(0xce)][_0x5717bc(0x11c)][_0x5717bc(0x103)][_0x5717bc(0x102)],_0x5717bc(0xd9),()=>{const _0x4e744e=_0x5717bc;this[_0x4e744e(0xec)]=!0x0,this[_0x4e744e(0x117)][_0x4e744e(0x10a)]();}),this[_0x5717bc(0xce)][_0x5717bc(0x11c)][_0x5717bc(0x103)][_0x5717bc(0x102)][_0x5717bc(0x118)][_0x5717bc(0xdc)]&&this[_0x5717bc(0xce)][_0x5717bc(0x11c)][_0x5717bc(0x103)][_0x5717bc(0xdf)](),this[_0x5717bc(0x107)]=!0x0;}[_0x3ccada(0x100)](){const _0x656dac=_0x3ccada;if(!this[_0x656dac(0x107)])throw new _0x229da5(_0x656dac(0x109),this);this[_0x656dac(0x10b)](null);for(const _0x4c62e1 of this[_0x656dac(0xf2)])this[_0x656dac(0x104)](_0x4c62e1);this[_0x656dac(0xf9)](),this[_0x656dac(0x107)]=!0x1,this[_0x656dac(0xe7)]=null;}[_0x3ccada(0xc2)](){const _0x14e4bc=_0x3ccada;this[_0x14e4bc(0x107)]&&this[_0x14e4bc(0x100)]();}[_0x3ccada(0x113)](_0x2baef0){const _0xca290=_0x3ccada;for(const _0x447ab5 of this[_0xca290(0xd2)])_0x2baef0[_0xca290(0x11e)](_0x447ab5)||this[_0xca290(0x117)][_0xca290(0xc7)](_0x447ab5);for(const _0x593339 of this[_0xca290(0xe7)])_0x2baef0[_0xca290(0x11e)](_0x593339)||this[_0xca290(0x104)](_0x593339);if(this[_0xca290(0xce)]['ui'][_0xca290(0xc3)][_0xca290(0xed)]){for(const _0x2e079e of _0x2baef0)this[_0xca290(0x112)](_0x2e079e);}this[_0xca290(0xd2)]=_0x2baef0;}[_0x3ccada(0x112)](_0x3f4d9c,_0x244e3e=!0x1){const _0x19eaf8=_0x3ccada;this[_0x19eaf8(0x117)][_0x19eaf8(0x10d)](_0x3f4d9c)||(this[_0x19eaf8(0xf2)][_0x19eaf8(0x10d)](_0x3f4d9c)||this[_0x19eaf8(0xf5)][_0x19eaf8(0xd8)](_0x3f4d9c[_0x19eaf8(0x103)])||(this[_0x19eaf8(0xf2)][_0x19eaf8(0xc6)](_0x3f4d9c),this[_0x19eaf8(0xf5)][_0x19eaf8(0xc6)]({'stackId':_0x3f4d9c[_0x19eaf8(0x103)]['id'],'view':_0x3f4d9c[_0x19eaf8(0x103)],'position':{'target':()=>this[_0x19eaf8(0xd6)](_0x3f4d9c)}})),_0x244e3e&&this[_0x19eaf8(0xf5)][_0x19eaf8(0xcd)](_0x3f4d9c[_0x19eaf8(0x103)]['id']));}[_0x3ccada(0xd6)](_0x50177f){const _0x4c11ce=_0x3ccada,_0xee1f92=_0x50177f[_0x4c11ce(0xf3)],_0x8989ad=this[_0x4c11ce(0xce)][_0x4c11ce(0x11c)][_0x4c11ce(0x103)],_0x568799=_0x8989ad[_0x4c11ce(0x102)][_0x4c11ce(0x118)][_0x4c11ce(0xe2)](),_0x6f902b=_0x8989ad[_0x4c11ce(0xf1)][_0x4c11ce(0xe3)](_0x568799);if(_0x6f902b[_0x4c11ce(0xc4)](!0x0),_0xee1f92){if(_0xee1f92 instanceof _0x51bc48)return _0xee1f92;let _0x2de42a=[];for(const _0x1a19dd of _0xee1f92)_0x2de42a[_0x4c11ce(0x110)](...(_0x36b3aa=_0x1a19dd[_0x4c11ce(0xd7)](),Array[_0x4c11ce(0x11d)](_0x36b3aa)[_0x4c11ce(0xf6)](DOMRect[_0x4c11ce(0xf0)])));_0x2de42a=function(_0x448d3c){const _0x57a136=_0x4c11ce,_0x6af6a3=[];let _0x5843d2=_0x448d3c[0x0];for(let _0xba96cc=0x1;_0xba96cc<_0x448d3c[_0x57a136(0x111)];_0xba96cc++)B(_0x5843d2,_0x448d3c[_0xba96cc])?_0x5843d2[_0x57a136(0x11f)]+=_0x448d3c[_0xba96cc][_0x57a136(0x11f)]:(_0x6af6a3[_0x57a136(0x110)](_0x5843d2),_0x5843d2=_0x448d3c[_0xba96cc]);return _0x6af6a3[_0x57a136(0x110)](_0x5843d2),_0x6af6a3;}(_0x2de42a);const _0x4efabd=_0x6f902b[_0x4c11ce(0xbf)]();return _0x2de42a[_0x4c11ce(0x11b)](_0x5cecf8=>_0x5cecf8[_0x4c11ce(0xe0)]<=_0x4efabd[_0x4c11ce(0xe0)]&&_0x5cecf8[_0x4c11ce(0xee)]>=_0x4efabd[_0x4c11ce(0xee)]&&_0x5cecf8[_0x4c11ce(0xc0)]<=_0x4efabd[_0x4c11ce(0xc0)]&&_0x5cecf8[_0x4c11ce(0xfe)]>=_0x4efabd[_0x4c11ce(0xfe)])||_0x2de42a[0x0];}var _0x36b3aa;return _0x50177f[_0x4c11ce(0xd5)]||_0x6f902b;}[_0x3ccada(0x104)](_0xadbb5a){const _0xb18f51=_0x3ccada;this[_0xb18f51(0xf2)][_0xb18f51(0x10d)](_0xadbb5a)&&this[_0xb18f51(0xf5)][_0xb18f51(0xd8)](_0xadbb5a[_0xb18f51(0x103)])&&(this[_0xb18f51(0xf2)][_0xb18f51(0xc7)](_0xadbb5a),this[_0xb18f51(0xf5)][_0xb18f51(0x101)](_0xadbb5a[_0xb18f51(0x103)]));}[_0x3ccada(0x108)](_0x45f69d){const _0x52d2a8=_0x3ccada;this[_0x52d2a8(0x117)][_0x52d2a8(0xc6)](_0x45f69d),this[_0x52d2a8(0x104)](_0x45f69d);}}function B(_0x45a23c,_0x186d2a){const _0xbe9b9d=_0x3ccada;return _0x45a23c[_0xbe9b9d(0xe0)]===_0x186d2a[_0xbe9b9d(0xe0)]&&_0x45a23c[_0xbe9b9d(0xee)]===_0x186d2a[_0xbe9b9d(0xee)]&&_0x45a23c[_0xbe9b9d(0xfe)]===_0x186d2a[_0xbe9b9d(0xc0)];}