UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 12.6 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x40bf57=_0x50c8;function _0x1866(){const _0x420c2c=['setActiveAnnotation','stopListening','push','selection','_setSelectedAnnotations','513585BygnrB','4qxTEYT','listenTo','_addAnnotationToBalloon','addObserver','354440RdUbYn','_manuallyClosed','_selectedAnnotations','31493KParHl','inline','change:isFocused','getClientRects','fromRect','annotations','_closeAnnotation','has','Esc','bottom','editableElement','5174ooYVNB','visibleView','detach','1038vqDeZS','InlineAnnotations','init','find','delete','document','isPremiumPlugin','isActive','1098056LJTQmL','editing','length','domConverter','isFocused','from','register','top','refresh','change:visibleView','pluginName','mousedown','3868840lOfsrj','getBoundingClientRect','target','focus','getByView','focusTracker','603dLrRzx','update','change:height','clear','hasView','collapse','targetRect','_balloon','activeAnnotation','attach','switchTo','left','every','isOfficialPlugin','keystrokes','_forceRefresh','width','requires','viewRangeToDom','blur','updatePosition','includes','_removeAnnotationFromBalloon','_addedAnnotations','get','context','inlineannotations-attach-already-attached','isAttached','getFirstRange','set','plugins','view','inlineannotations-detach-not-attached','getOrderedSelectedAnnotations','right','remove','destroy','inlineannotations-not-allowed-with-context','afterInit','showStack','map','_getBalloonTargetForAnnotation','editor','add','hasActive','265865iTRiUd'];_0x1866=function(){return _0x420c2c;};return _0x1866();}function _0x50c8(_0x5d9fae,_0xf81f4a){const _0x186620=_0x1866();return _0x50c8=function(_0x50c853,_0x45aee0){_0x50c853=_0x50c853-0x11e;let _0x134d4a=_0x186620[_0x50c853];return _0x134d4a;},_0x50c8(_0x5d9fae,_0xf81f4a);}(function(_0x5af341,_0x43732d){const _0x120449=_0x50c8,_0x3f1473=_0x5af341();while(!![]){try{const _0x3fdb76=-parseInt(_0x120449(0x167))/0x1+parseInt(_0x120449(0x175))/0x2*(-parseInt(_0x120449(0x12f))/0x3)+parseInt(_0x120449(0x163))/0x4*(parseInt(_0x120449(0x15c))/0x5)+parseInt(_0x120449(0x178))/0x6*(parseInt(_0x120449(0x16a))/0x7)+parseInt(_0x120449(0x180))/0x8+-parseInt(_0x120449(0x162))/0x9+parseInt(_0x120449(0x129))/0xa;if(_0x3fdb76===_0x43732d)break;else _0x3f1473['push'](_0x3f1473['shift']());}catch(_0x36a7d0){_0x3f1473['push'](_0x3f1473['shift']());}}}(_0x1866,0x678d5));import{Plugin as _0x178a26}from'ckeditor5/src/core.js';import{AnnotationsUIs as _0xf84c7f}from'./annotationsuis.js';import{EditorAnnotations as _0x18fd1f}from'./editorannotations.js';import{ContextualBalloon as _0x4fe7ef}from'ckeditor5/src/ui.js';import{MouseObserver as _0x35cff1}from'ckeditor5/src/engine.js';import{CKEditorError as _0x117a93,Rect as _0x4e3b2c}from'ckeditor5/src/utils.js';import'./../../theme/annotation-inline.css';export class InlineAnnotations extends _0x178a26{[_0x40bf57(0x14a)];[_0x40bf57(0x16f)];[_0x40bf57(0x168)];[_0x40bf57(0x136)];[_0x40bf57(0x146)];[_0x40bf57(0x169)];[_0x40bf57(0x13e)];static get[_0x40bf57(0x140)](){return[_0x18fd1f,_0x4fe7ef,_0xf84c7f];}static get[_0x40bf57(0x127)](){const _0x438c38=_0x40bf57;return _0x438c38(0x179);}static get[_0x40bf57(0x13c)](){return!0x0;}static get[_0x40bf57(0x17e)](){return!0x0;}constructor(_0x1a3f1c){const _0x18b3e9=_0x40bf57;super(_0x1a3f1c),_0x1a3f1c[_0x18b3e9(0x11e)][_0x18b3e9(0x14e)][_0x18b3e9(0x166)](_0x35cff1),this[_0x18b3e9(0x14a)]=!0x1,this[_0x18b3e9(0x14c)](_0x18b3e9(0x137),null),this[_0x18b3e9(0x16f)]=null,this[_0x18b3e9(0x168)]=new Set(),this[_0x18b3e9(0x136)]=_0x1a3f1c[_0x18b3e9(0x14d)][_0x18b3e9(0x147)](_0x4fe7ef),this[_0x18b3e9(0x146)]=new Set(),this[_0x18b3e9(0x169)]=[],this[_0x18b3e9(0x13e)]=!0x1;}[_0x40bf57(0x17a)](){const _0x17c354=_0x40bf57,_0x5c0f26=this[_0x17c354(0x159)][_0x17c354(0x14d)][_0x17c354(0x147)](_0xf84c7f);_0x5c0f26[_0x17c354(0x148)]===this[_0x17c354(0x159)]&&(_0x5c0f26[_0x17c354(0x123)](_0x17c354(0x16b),this),this[_0x17c354(0x159)][_0x17c354(0x13d)][_0x17c354(0x14c)](_0x17c354(0x172),(_0x59081f,_0x26c868)=>{const _0x972f8d=_0x17c354,_0xf7d549=this[_0x972f8d(0x136)];if(this[_0x972f8d(0x14a)]&&_0xf7d549[_0x972f8d(0x176)]){const _0x8dd372=this[_0x972f8d(0x16f)][_0x972f8d(0x12d)](_0xf7d549[_0x972f8d(0x176)]);_0x8dd372&&this[_0x972f8d(0x170)](_0x8dd372),_0x26c868();}}));}[_0x40bf57(0x155)](){const _0x6c3820=_0x40bf57,_0x17ba95=this[_0x6c3820(0x159)][_0x6c3820(0x14d)][_0x6c3820(0x147)](_0xf84c7f);_0x17ba95[_0x6c3820(0x148)]===this[_0x6c3820(0x159)]&&(_0x17ba95[_0x6c3820(0x15b)]()||_0x17ba95[_0x6c3820(0x139)](_0x6c3820(0x16b)));}[_0x40bf57(0x15d)](_0xbc00b1){const _0x28c318=_0x40bf57;_0xbc00b1!==this[_0x28c318(0x137)]&&(this[_0x28c318(0x137)]&&(this[_0x28c318(0x137)][_0x28c318(0x17f)]=!0x1),_0xbc00b1&&this[_0x28c318(0x159)]['ui'][_0x28c318(0x12e)][_0x28c318(0x121)]&&(this[_0x28c318(0x16f)][_0x28c318(0x171)](_0xbc00b1)&&this[_0x28c318(0x165)](_0xbc00b1,!0x0),_0xbc00b1[_0x28c318(0x17f)]=!0x0),_0xbc00b1||this[_0x28c318(0x161)]([]),this[_0x28c318(0x137)]=_0xbc00b1);}[_0x40bf57(0x138)](_0x262369){const _0x328f03=_0x40bf57;this[_0x328f03(0x16f)]=_0x262369;const _0x12cf27=this[_0x328f03(0x159)][_0x328f03(0x14d)][_0x328f03(0x147)](_0xf84c7f),_0x213767=this[_0x328f03(0x136)];if(this[_0x328f03(0x14a)])throw new _0x117a93(_0x328f03(0x149),this);if(_0x12cf27[_0x328f03(0x148)]!==this[_0x328f03(0x159)])throw new _0x117a93(_0x328f03(0x154),this);const _0x52a7d=this[_0x328f03(0x159)][_0x328f03(0x14d)][_0x328f03(0x147)](_0x18fd1f);this[_0x328f03(0x164)](_0x52a7d,_0x328f03(0x125),()=>{const _0x155253=_0x328f03,_0x932426=_0x52a7d[_0x155253(0x150)]({'annotations':this[_0x155253(0x16f)],'activeAnnotation':this[_0x155253(0x137)]});var _0x58fe0a,_0x3efcd1;!this[_0x155253(0x13e)]&&(_0x58fe0a=_0x932426,_0x3efcd1=this[_0x155253(0x169)],_0x58fe0a[_0x155253(0x11f)]===_0x3efcd1[_0x155253(0x11f)]&&_0x58fe0a[_0x155253(0x13b)](_0x35b96f=>_0x3efcd1[_0x155253(0x144)](_0x35b96f)))||(this[_0x155253(0x13e)]=!0x1,this[_0x155253(0x161)](_0x932426),this[_0x155253(0x15d)](_0x932426[0x0]||null));}),this[_0x328f03(0x164)](_0x52a7d,_0x328f03(0x142),(_0x298df0,{isAnnotationTracked:_0x161243})=>{const _0x1033f7=_0x328f03;this[_0x1033f7(0x137)]&&_0x161243(this[_0x1033f7(0x137)])&&(this[_0x1033f7(0x161)]([]),this[_0x1033f7(0x15d)](null));}),this[_0x328f03(0x164)](this[_0x328f03(0x159)]['ui'][_0x328f03(0x12e)],_0x328f03(0x16c),(_0x29d6f0,_0x3275d7,_0xd2af4b)=>{const _0x3c4827=_0x328f03;_0xd2af4b||this[_0x3c4827(0x15d)](null);}),this[_0x328f03(0x164)](_0x262369,_0x328f03(0x152),(_0x3f9f58,_0xd9887)=>{const _0x3db91b=_0x328f03;this[_0x3db91b(0x145)](_0xd9887),_0xd9887===this[_0x3db91b(0x137)]&&this[_0x3db91b(0x15d)](null);}),this[_0x328f03(0x164)](_0x213767,_0x328f03(0x126),(_0x6c1b9e,_0x25b1e0,_0x174fad,_0x39e098)=>{const _0x35842e=_0x328f03;_0x39e098&&this[_0x35842e(0x15e)](_0x39e098);const _0x19ea16=_0x262369[_0x35842e(0x12d)](_0x174fad);_0x174fad&&_0x19ea16&&(this[_0x35842e(0x164)](_0x174fad,_0x35842e(0x131),()=>{const _0x57021d=_0x35842e;_0x213767[_0x57021d(0x143)]();}),this[_0x35842e(0x164)](_0x174fad,_0x35842e(0x172),()=>{const _0x32da2c=_0x35842e;this[_0x32da2c(0x170)](_0x19ea16),this[_0x32da2c(0x159)][_0x32da2c(0x11e)][_0x32da2c(0x14e)][_0x32da2c(0x12c)]();}),this[_0x35842e(0x137)]!==_0x19ea16&&this[_0x35842e(0x15d)](_0x19ea16));}),this[_0x328f03(0x164)](this[_0x328f03(0x159)]['ui'],_0x328f03(0x130),()=>{const _0x1b478e=_0x328f03;_0x213767[_0x1b478e(0x176)]&&(_0x262369[_0x1b478e(0x12d)](_0x213767[_0x1b478e(0x176)])&&_0x213767[_0x1b478e(0x143)]());}),this[_0x328f03(0x164)](this[_0x328f03(0x159)][_0x328f03(0x11e)][_0x328f03(0x14e)][_0x328f03(0x17d)],_0x328f03(0x128),()=>{const _0x2dcbe4=_0x328f03;this[_0x2dcbe4(0x13e)]=!0x0,this[_0x2dcbe4(0x168)][_0x2dcbe4(0x132)]();}),this[_0x328f03(0x159)][_0x328f03(0x11e)][_0x328f03(0x14e)][_0x328f03(0x17d)][_0x328f03(0x160)][_0x328f03(0x174)]&&this[_0x328f03(0x159)][_0x328f03(0x11e)][_0x328f03(0x14e)][_0x328f03(0x12c)](),this[_0x328f03(0x14a)]=!0x0;}[_0x40bf57(0x177)](){const _0x72206f=_0x40bf57;if(!this[_0x72206f(0x14a)])throw new _0x117a93(_0x72206f(0x14f),this);this[_0x72206f(0x15d)](null);for(const _0x8d450f of this[_0x72206f(0x146)])this[_0x72206f(0x145)](_0x8d450f);this[_0x72206f(0x15e)](),this[_0x72206f(0x14a)]=!0x1,this[_0x72206f(0x16f)]=null;}[_0x40bf57(0x153)](){const _0x446d58=_0x40bf57;this[_0x446d58(0x14a)]&&this[_0x446d58(0x177)]();}[_0x40bf57(0x161)](_0x506d5b){const _0x2b4b77=_0x40bf57;for(const _0x107b75 of this[_0x2b4b77(0x169)])_0x506d5b[_0x2b4b77(0x144)](_0x107b75)||this[_0x2b4b77(0x168)][_0x2b4b77(0x17c)](_0x107b75);for(const _0x2a9716 of this[_0x2b4b77(0x16f)])_0x506d5b[_0x2b4b77(0x144)](_0x2a9716)||this[_0x2b4b77(0x145)](_0x2a9716);if(this[_0x2b4b77(0x159)]['ui'][_0x2b4b77(0x12e)][_0x2b4b77(0x121)]){for(const _0x13320b of _0x506d5b)this[_0x2b4b77(0x165)](_0x13320b);}this[_0x2b4b77(0x169)]=_0x506d5b;}[_0x40bf57(0x165)](_0x3ebf0f,_0x328bb2=!0x1){const _0x368298=_0x40bf57;this[_0x368298(0x168)][_0x368298(0x171)](_0x3ebf0f)||(this[_0x368298(0x146)][_0x368298(0x171)](_0x3ebf0f)||this[_0x368298(0x136)][_0x368298(0x133)](_0x3ebf0f[_0x368298(0x14e)])||(this[_0x368298(0x146)][_0x368298(0x15a)](_0x3ebf0f),this[_0x368298(0x136)][_0x368298(0x15a)]({'stackId':_0x3ebf0f[_0x368298(0x14e)]['id'],'view':_0x3ebf0f[_0x368298(0x14e)],'position':{'target':()=>this[_0x368298(0x158)](_0x3ebf0f)}})),_0x328bb2&&this[_0x368298(0x136)][_0x368298(0x156)](_0x3ebf0f[_0x368298(0x14e)]['id']));}[_0x40bf57(0x158)](_0x51b8c6){const _0x37338a=_0x40bf57,_0x5e743b=_0x51b8c6[_0x37338a(0x12b)],_0x444ff6=this[_0x37338a(0x159)][_0x37338a(0x11e)][_0x37338a(0x14e)],_0x13b56b=_0x444ff6[_0x37338a(0x17d)][_0x37338a(0x160)][_0x37338a(0x14b)](),_0x4b56ac=_0x444ff6[_0x37338a(0x120)][_0x37338a(0x141)](_0x13b56b);if(_0x4b56ac[_0x37338a(0x134)](!0x0),_0x5e743b){if(_0x5e743b instanceof _0x4e3b2c)return _0x5e743b;let _0x5038db=[];for(const _0x9fe6ab of _0x5e743b)_0x5038db[_0x37338a(0x15f)](...F(_0x9fe6ab[_0x37338a(0x16d)]()));_0x5038db=function(_0x20a8ab){const _0x502175=_0x37338a,_0x3d4fb3=[];let _0x4da132=_0x20a8ab[0x0];for(let _0x5d16f9=0x1;_0x5d16f9<_0x20a8ab[_0x502175(0x11f)];_0x5d16f9++)P(_0x4da132,_0x20a8ab[_0x5d16f9])?_0x4da132[_0x502175(0x13f)]+=_0x20a8ab[_0x5d16f9][_0x502175(0x13f)]:(_0x3d4fb3[_0x502175(0x15f)](_0x4da132),_0x4da132=_0x20a8ab[_0x5d16f9]);return _0x3d4fb3[_0x502175(0x15f)](_0x4da132),_0x3d4fb3;}(_0x5038db);const _0x512dca=_0x4b56ac[_0x37338a(0x12a)]();return _0x5038db[_0x37338a(0x17b)](_0x4259e4=>_0x4259e4[_0x37338a(0x124)]<=_0x512dca[_0x37338a(0x124)]&&_0x4259e4[_0x37338a(0x173)]>=_0x512dca[_0x37338a(0x173)]&&_0x4259e4[_0x37338a(0x13a)]<=_0x512dca[_0x37338a(0x13a)]&&_0x4259e4[_0x37338a(0x151)]>=_0x512dca[_0x37338a(0x151)])||_0x5038db[0x0];}return _0x51b8c6[_0x37338a(0x135)]||_0x4b56ac;}[_0x40bf57(0x145)](_0xcf8c2f){const _0x4b72d1=_0x40bf57;this[_0x4b72d1(0x146)][_0x4b72d1(0x171)](_0xcf8c2f)&&this[_0x4b72d1(0x136)][_0x4b72d1(0x133)](_0xcf8c2f[_0x4b72d1(0x14e)])&&(this[_0x4b72d1(0x146)][_0x4b72d1(0x17c)](_0xcf8c2f),this[_0x4b72d1(0x136)][_0x4b72d1(0x152)](_0xcf8c2f[_0x4b72d1(0x14e)]));}[_0x40bf57(0x170)](_0x348695){const _0x258aa2=_0x40bf57;this[_0x258aa2(0x168)][_0x258aa2(0x15a)](_0x348695),this[_0x258aa2(0x145)](_0x348695);}}function F(_0x42b4ae){const _0x2b47b5=_0x40bf57;return Array[_0x2b47b5(0x122)](_0x42b4ae)[_0x2b47b5(0x157)](DOMRect[_0x2b47b5(0x16e)]);}function P(_0x3a743c,_0x5c0e4f){const _0x420db9=_0x40bf57;return _0x3a743c[_0x420db9(0x124)]===_0x5c0e4f[_0x420db9(0x124)]&&_0x3a743c[_0x420db9(0x173)]===_0x5c0e4f[_0x420db9(0x173)]&&_0x3a743c[_0x420db9(0x151)]===_0x5c0e4f[_0x420db9(0x13a)];}