@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 12.7 kB
JavaScript
/*
* 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 _0x616dd0=_0x3003;(function(_0x1b6be4,_0x523110){const _0xc81d76=_0x3003,_0x3ed1fd=_0x1b6be4();while(!![]){try{const _0x3ae357=-parseInt(_0xc81d76(0x110))/0x1*(parseInt(_0xc81d76(0x113))/0x2)+parseInt(_0xc81d76(0x137))/0x3+-parseInt(_0xc81d76(0x10f))/0x4*(-parseInt(_0xc81d76(0x133))/0x5)+-parseInt(_0xc81d76(0x123))/0x6*(-parseInt(_0xc81d76(0x15f))/0x7)+-parseInt(_0xc81d76(0x167))/0x8*(parseInt(_0xc81d76(0x142))/0x9)+parseInt(_0xc81d76(0x150))/0xa+-parseInt(_0xc81d76(0x15c))/0xb;if(_0x3ae357===_0x523110)break;else _0x3ed1fd['push'](_0x3ed1fd['shift']());}catch(_0xd30d59){_0x3ed1fd['push'](_0x3ed1fd['shift']());}}}(_0x10b4,0xe9436));import{Plugin as _0xc7d215}from'ckeditor5/src/core.js';import{AnnotationsUIs as _0x774a6e}from'./annotationsuis.js';import{EditorAnnotations as _0x28a434}from'./editorannotations.js';function _0x3003(_0x141c90,_0xd66dce){const _0x10b4a1=_0x10b4();return _0x3003=function(_0x3003e1,_0x34204e){_0x3003e1=_0x3003e1-0x10d;let _0x138802=_0x10b4a1[_0x3003e1];return _0x138802;},_0x3003(_0x141c90,_0xd66dce);}import{ContextualBalloon as _0x2ec3e5}from'ckeditor5/src/ui.js';import{MouseObserver as _0x4921e9}from'ckeditor5/src/engine.js';import{CKEditorError as _0x382dae,Rect as _0x284032}from'ckeditor5/src/utils.js';import'./../../theme/annotation-inline.css';export class InlineAnnotations extends _0xc7d215{[_0x616dd0(0x15d)];[_0x616dd0(0x15b)];[_0x616dd0(0x144)];[_0x616dd0(0x15e)];[_0x616dd0(0x111)];[_0x616dd0(0x16e)];[_0x616dd0(0x143)];static get[_0x616dd0(0x154)](){return[_0x28a434,_0x2ec3e5,_0x774a6e];}static get[_0x616dd0(0x170)](){const _0x59b9e4=_0x616dd0;return _0x59b9e4(0x115);}static get[_0x616dd0(0x130)](){return!0x0;}static get[_0x616dd0(0x149)](){return!0x0;}constructor(_0x464966){const _0x5b615b=_0x616dd0;super(_0x464966),_0x464966[_0x5b615b(0x141)][_0x5b615b(0x16d)][_0x5b615b(0x13a)](_0x4921e9),this[_0x5b615b(0x15d)]=!0x1,this[_0x5b615b(0x124)](_0x5b615b(0x14a),null),this[_0x5b615b(0x15b)]=null,this[_0x5b615b(0x144)]=new Set(),this[_0x5b615b(0x15e)]=_0x464966[_0x5b615b(0x11c)][_0x5b615b(0x148)](_0x2ec3e5),this[_0x5b615b(0x111)]=new Set(),this[_0x5b615b(0x16e)]=[],this[_0x5b615b(0x143)]=!0x1;}[_0x616dd0(0x168)](){const _0x4da1b6=_0x616dd0,_0x40f1c6=this[_0x4da1b6(0x12e)][_0x4da1b6(0x11c)][_0x4da1b6(0x148)](_0x774a6e);_0x40f1c6[_0x4da1b6(0x16c)]===this[_0x4da1b6(0x12e)]&&(_0x40f1c6[_0x4da1b6(0x151)](_0x4da1b6(0x14e),this),this[_0x4da1b6(0x12e)][_0x4da1b6(0x15a)][_0x4da1b6(0x124)](_0x4da1b6(0x134),(_0x413fb8,_0x300fc5)=>{const _0x6e9ee6=_0x4da1b6,_0x5d1d55=this[_0x6e9ee6(0x15e)];if(this[_0x6e9ee6(0x15d)]&&_0x5d1d55[_0x6e9ee6(0x159)]){const _0x3d82c8=this[_0x6e9ee6(0x15b)][_0x6e9ee6(0x140)](_0x5d1d55[_0x6e9ee6(0x159)]);_0x3d82c8&&this[_0x6e9ee6(0x16a)](_0x3d82c8),_0x300fc5();}}));}[_0x616dd0(0x131)](){const _0x37f5e9=_0x616dd0,_0x123f1b=this[_0x37f5e9(0x12e)][_0x37f5e9(0x11c)][_0x37f5e9(0x148)](_0x774a6e);_0x123f1b[_0x37f5e9(0x16c)]===this[_0x37f5e9(0x12e)]&&(_0x123f1b[_0x37f5e9(0x145)]()||_0x123f1b[_0x37f5e9(0x14c)](_0x37f5e9(0x14e)));}[_0x616dd0(0x126)](_0x54b78a){const _0x4aaa75=_0x616dd0;_0x54b78a!==this[_0x4aaa75(0x14a)]&&(this[_0x4aaa75(0x14a)]&&(this[_0x4aaa75(0x14a)][_0x4aaa75(0x155)]=!0x1),_0x54b78a&&this[_0x4aaa75(0x12e)]['ui'][_0x4aaa75(0x11b)][_0x4aaa75(0x122)]&&(this[_0x4aaa75(0x15b)][_0x4aaa75(0x136)](_0x54b78a)&&this[_0x4aaa75(0x10e)](_0x54b78a,!0x0),_0x54b78a[_0x4aaa75(0x155)]=!0x0),_0x54b78a||this[_0x4aaa75(0x10d)]([]),this[_0x4aaa75(0x14a)]=_0x54b78a);}[_0x616dd0(0x12c)](_0x1da8ca){const _0x4b6314=_0x616dd0;this[_0x4b6314(0x15b)]=_0x1da8ca;const _0x3e9837=this[_0x4b6314(0x12e)][_0x4b6314(0x11c)][_0x4b6314(0x148)](_0x774a6e),_0x2043dc=this[_0x4b6314(0x15e)];if(this[_0x4b6314(0x15d)])throw new _0x382dae(_0x4b6314(0x169),this);if(_0x3e9837[_0x4b6314(0x16c)]!==this[_0x4b6314(0x12e)])throw new _0x382dae(_0x4b6314(0x16b),this);const _0x58a315=this[_0x4b6314(0x12e)][_0x4b6314(0x11c)][_0x4b6314(0x148)](_0x28a434);this[_0x4b6314(0x152)](_0x58a315,_0x4b6314(0x13c),()=>{const _0x141439=_0x4b6314,_0x2ea184=_0x58a315[_0x141439(0x162)]({'annotations':this[_0x141439(0x15b)],'activeAnnotation':this[_0x141439(0x14a)]});var _0x42cd45,_0x126b64;!this[_0x141439(0x143)]&&(_0x42cd45=_0x2ea184,_0x126b64=this[_0x141439(0x16e)],_0x42cd45[_0x141439(0x166)]===_0x126b64[_0x141439(0x166)]&&_0x42cd45[_0x141439(0x14b)](_0x441b74=>_0x126b64[_0x141439(0x156)](_0x441b74)))||(this[_0x141439(0x143)]=!0x1,this[_0x141439(0x10d)](_0x2ea184),this[_0x141439(0x126)](_0x2ea184[0x0]||null));}),this[_0x4b6314(0x152)](_0x58a315,_0x4b6314(0x13f),(_0x1ba5e6,{isAnnotationTracked:_0x554a3e})=>{const _0x3a24e0=_0x4b6314;this[_0x3a24e0(0x14a)]&&_0x554a3e(this[_0x3a24e0(0x14a)])&&(this[_0x3a24e0(0x10d)]([]),this[_0x3a24e0(0x126)](null));}),this[_0x4b6314(0x152)](this[_0x4b6314(0x12e)]['ui'][_0x4b6314(0x11b)],_0x4b6314(0x158),(_0x2684ad,_0x22e09c,_0x504e8e)=>{const _0x4401b3=_0x4b6314;_0x504e8e||this[_0x4401b3(0x126)](null);}),this[_0x4b6314(0x152)](_0x1da8ca,_0x4b6314(0x14f),(_0x47e5c6,_0x10c080)=>{const _0x7117c7=_0x4b6314;this[_0x7117c7(0x114)](_0x10c080),_0x10c080===this[_0x7117c7(0x14a)]&&this[_0x7117c7(0x126)](null);}),this[_0x4b6314(0x152)](_0x2043dc,_0x4b6314(0x16f),(_0x33e963,_0xf52f11,_0x4fd336,_0x30d30d)=>{const _0x5aa2b8=_0x4b6314;_0x30d30d&&this[_0x5aa2b8(0x14d)](_0x30d30d);const _0x1e9ced=_0x1da8ca[_0x5aa2b8(0x140)](_0x4fd336);_0x4fd336&&_0x1e9ced&&(this[_0x5aa2b8(0x152)](_0x4fd336,_0x5aa2b8(0x12b),()=>{const _0x416d89=_0x5aa2b8;_0x2043dc[_0x416d89(0x12d)]();}),this[_0x5aa2b8(0x152)](_0x4fd336,_0x5aa2b8(0x134),()=>{const _0x129429=_0x5aa2b8;this[_0x129429(0x16a)](_0x1e9ced),this[_0x129429(0x12e)][_0x129429(0x141)][_0x129429(0x16d)][_0x129429(0x139)]();}),this[_0x5aa2b8(0x14a)]!==_0x1e9ced&&this[_0x5aa2b8(0x126)](_0x1e9ced));}),this[_0x4b6314(0x152)](this[_0x4b6314(0x12e)]['ui'],_0x4b6314(0x12f),()=>{const _0x1de2cd=_0x4b6314;_0x2043dc[_0x1de2cd(0x159)]&&(_0x1da8ca[_0x1de2cd(0x140)](_0x2043dc[_0x1de2cd(0x159)])&&_0x2043dc[_0x1de2cd(0x12d)]());}),this[_0x4b6314(0x152)](this[_0x4b6314(0x12e)][_0x4b6314(0x141)][_0x4b6314(0x16d)][_0x4b6314(0x138)],_0x4b6314(0x11d),()=>{const _0x81bfd8=_0x4b6314;this[_0x81bfd8(0x143)]=!0x0,this[_0x81bfd8(0x144)][_0x81bfd8(0x12a)]();}),this[_0x4b6314(0x12e)][_0x4b6314(0x141)][_0x4b6314(0x16d)][_0x4b6314(0x138)][_0x4b6314(0x165)][_0x4b6314(0x116)]&&this[_0x4b6314(0x12e)][_0x4b6314(0x141)][_0x4b6314(0x16d)][_0x4b6314(0x139)](),this[_0x4b6314(0x15d)]=!0x0;}[_0x616dd0(0x132)](){const _0x502d44=_0x616dd0;if(!this[_0x502d44(0x15d)])throw new _0x382dae(_0x502d44(0x117),this);this[_0x502d44(0x126)](null);for(const _0xb4a5b7 of this[_0x502d44(0x111)])this[_0x502d44(0x114)](_0xb4a5b7);this[_0x502d44(0x14d)](),this[_0x502d44(0x15d)]=!0x1,this[_0x502d44(0x15b)]=null;}[_0x616dd0(0x119)](){const _0x993c10=_0x616dd0;this[_0x993c10(0x15d)]&&this[_0x993c10(0x132)]();}[_0x616dd0(0x10d)](_0x51b558){const _0x45a21b=_0x616dd0;for(const _0x48c8e7 of this[_0x45a21b(0x16e)])_0x51b558[_0x45a21b(0x156)](_0x48c8e7)||this[_0x45a21b(0x144)][_0x45a21b(0x147)](_0x48c8e7);for(const _0x25ff5b of this[_0x45a21b(0x15b)])_0x51b558[_0x45a21b(0x156)](_0x25ff5b)||this[_0x45a21b(0x114)](_0x25ff5b);if(this[_0x45a21b(0x12e)]['ui'][_0x45a21b(0x11b)][_0x45a21b(0x122)]){for(const _0x15c94a of _0x51b558)this[_0x45a21b(0x10e)](_0x15c94a);}this[_0x45a21b(0x16e)]=_0x51b558;}[_0x616dd0(0x10e)](_0x5e0a3f,_0x12c84d=!0x1){const _0x9a3c80=_0x616dd0;this[_0x9a3c80(0x144)][_0x9a3c80(0x136)](_0x5e0a3f)||(this[_0x9a3c80(0x111)][_0x9a3c80(0x136)](_0x5e0a3f)||this[_0x9a3c80(0x15e)][_0x9a3c80(0x125)](_0x5e0a3f[_0x9a3c80(0x16d)])||(this[_0x9a3c80(0x111)][_0x9a3c80(0x11a)](_0x5e0a3f),this[_0x9a3c80(0x15e)][_0x9a3c80(0x11a)]({'stackId':_0x5e0a3f[_0x9a3c80(0x16d)]['id'],'view':_0x5e0a3f[_0x9a3c80(0x16d)],'position':{'target':()=>this[_0x9a3c80(0x153)](_0x5e0a3f)}})),_0x12c84d&&this[_0x9a3c80(0x15e)][_0x9a3c80(0x135)](_0x5e0a3f[_0x9a3c80(0x16d)]['id']));}[_0x616dd0(0x153)](_0x102939){const _0x2d4152=_0x616dd0,_0x1b4927=_0x102939[_0x2d4152(0x157)],_0x35ca71=this[_0x2d4152(0x12e)][_0x2d4152(0x141)][_0x2d4152(0x16d)],_0x1a49eb=_0x35ca71[_0x2d4152(0x138)][_0x2d4152(0x165)][_0x2d4152(0x129)](),_0x328cb1=_0x35ca71[_0x2d4152(0x164)][_0x2d4152(0x13e)](_0x1a49eb);if(_0x328cb1[_0x2d4152(0x161)](!0x0),_0x1b4927){if(_0x1b4927 instanceof _0x284032)return _0x1b4927;let _0x76aa51=[];for(const _0x2332ad of _0x1b4927)_0x76aa51[_0x2d4152(0x120)](...F(_0x2332ad[_0x2d4152(0x160)]()));_0x76aa51=function(_0x414095){const _0x58f604=_0x2d4152,_0x8ae07e=[];let _0x310f00=_0x414095[0x0];for(let _0x274354=0x1;_0x274354<_0x414095[_0x58f604(0x166)];_0x274354++)P(_0x310f00,_0x414095[_0x274354])?_0x310f00[_0x58f604(0x11f)]+=_0x414095[_0x274354][_0x58f604(0x11f)]:(_0x8ae07e[_0x58f604(0x120)](_0x310f00),_0x310f00=_0x414095[_0x274354]);return _0x8ae07e[_0x58f604(0x120)](_0x310f00),_0x8ae07e;}(_0x76aa51);const _0x4bd3ba=_0x328cb1[_0x2d4152(0x13d)]();return _0x76aa51[_0x2d4152(0x146)](_0x2243c9=>_0x2243c9[_0x2d4152(0x163)]<=_0x4bd3ba[_0x2d4152(0x163)]&&_0x2243c9[_0x2d4152(0x127)]>=_0x4bd3ba[_0x2d4152(0x127)]&&_0x2243c9[_0x2d4152(0x13b)]<=_0x4bd3ba[_0x2d4152(0x13b)]&&_0x2243c9[_0x2d4152(0x11e)]>=_0x4bd3ba[_0x2d4152(0x11e)])||_0x76aa51[0x0];}return _0x102939[_0x2d4152(0x112)]||_0x328cb1;}[_0x616dd0(0x114)](_0x30c4df){const _0x2fd5e5=_0x616dd0;this[_0x2fd5e5(0x111)][_0x2fd5e5(0x136)](_0x30c4df)&&this[_0x2fd5e5(0x15e)][_0x2fd5e5(0x125)](_0x30c4df[_0x2fd5e5(0x16d)])&&(this[_0x2fd5e5(0x111)][_0x2fd5e5(0x147)](_0x30c4df),this[_0x2fd5e5(0x15e)][_0x2fd5e5(0x14f)](_0x30c4df[_0x2fd5e5(0x16d)]));}[_0x616dd0(0x16a)](_0xe9dcb8){const _0xd41fb=_0x616dd0;this[_0xd41fb(0x144)][_0xd41fb(0x11a)](_0xe9dcb8),this[_0xd41fb(0x114)](_0xe9dcb8);}}function _0x10b4(){const _0x48a7c0=['collapse','getOrderedSelectedAnnotations','top','domConverter','selection','length','8jTIhtD','init','inlineannotations-attach-already-attached','_closeAnnotation','inlineannotations-not-allowed-with-context','context','view','_selectedAnnotations','change:visibleView','pluginName','_setSelectedAnnotations','_addAnnotationToBalloon','7132CvQXvB','3yiXOUG','_addedAnnotations','targetRect','948964UOeWcq','_removeAnnotationFromBalloon','InlineAnnotations','editableElement','inlineannotations-detach-not-attached','from','destroy','add','focusTracker','plugins','mousedown','right','width','push','fromRect','isFocused','444wGPPiU','set','hasView','setActiveAnnotation','bottom','map','getFirstRange','clear','change:height','attach','updatePosition','editor','update','isOfficialPlugin','afterInit','detach','3755FLPOLF','Esc','showStack','has','5439753aZSmEq','document','focus','addObserver','left','refresh','getBoundingClientRect','viewRangeToDom','blur','getByView','editing','11108331Gqdfii','_forceRefresh','_manuallyClosed','hasActive','find','delete','get','isPremiumPlugin','activeAnnotation','every','switchTo','stopListening','inline','remove','16825050MMhdbq','register','listenTo','_getBalloonTargetForAnnotation','requires','isActive','includes','target','change:isFocused','visibleView','keystrokes','annotations','22103048pjiwxo','isAttached','_balloon','74515TvOipw','getClientRects'];_0x10b4=function(){return _0x48a7c0;};return _0x10b4();}function F(_0x253627){const _0x136813=_0x616dd0;return Array[_0x136813(0x118)](_0x253627)[_0x136813(0x128)](DOMRect[_0x136813(0x121)]);}function P(_0x3a2d9a,_0x1d0b4f){const _0x494039=_0x616dd0;return _0x3a2d9a[_0x494039(0x163)]===_0x1d0b4f[_0x494039(0x163)]&&_0x3a2d9a[_0x494039(0x127)]===_0x1d0b4f[_0x494039(0x127)]&&_0x3a2d9a[_0x494039(0x11e)]===_0x1d0b4f[_0x494039(0x13b)];}