@ckeditor/ckeditor5-real-time-collaboration
Version:
A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.
23 lines • 13.8 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 _0x409489=_0x1056;(function(_0x13f1ca,_0x8b5cf){const _0x52d1f6=_0x1056,_0x8709b6=_0x13f1ca();while(!![]){try{const _0x39885e=parseInt(_0x52d1f6(0x12c))/0x1*(-parseInt(_0x52d1f6(0xba))/0x2)+-parseInt(_0x52d1f6(0x13c))/0x3+-parseInt(_0x52d1f6(0x104))/0x4+parseInt(_0x52d1f6(0xcb))/0x5+-parseInt(_0x52d1f6(0x125))/0x6+parseInt(_0x52d1f6(0xf9))/0x7+parseInt(_0x52d1f6(0x11f))/0x8*(parseInt(_0x52d1f6(0x140))/0x9);if(_0x39885e===_0x8b5cf)break;else _0x8709b6['push'](_0x8709b6['shift']());}catch(_0x2570a5){_0x8709b6['push'](_0x8709b6['shift']());}}}(_0x41ff,0x8b13d));import{Plugin as _0x292a66}from'ckeditor5/src/core.js';import{global as _0x11455b,DomEmitterMixin as _0x469926}from'ckeditor5/src/utils.js';import{Sessions as _0x53f96b}from'./sessions.js';import{ModelLiveRange as _0x29c3ac}from'ckeditor5/src/engine.js';import'../../theme/usermarkers.css';export class UserMarkers extends _0x292a66{[_0x409489(0x126)]=new(_0x469926())();static get[_0x409489(0x127)](){return[_0x53f96b];}static get[_0x409489(0xc0)](){const _0x165e4a=_0x409489;return _0x165e4a(0xbb);}static get[_0x409489(0x109)](){return!0x0;}static get[_0x409489(0xd3)](){return!0x0;}[_0x409489(0xcf)](){const _0x5f2d4c=_0x409489,_0x2211a8=this[_0x5f2d4c(0xbf)],_0xd6b543=_0x2211a8[_0x5f2d4c(0xd6)][_0x5f2d4c(0xe4)](_0x53f96b);_0x2211a8[_0x5f2d4c(0x11a)][_0x5f2d4c(0xb8)](_0x5f2d4c(0x134))[_0x5f2d4c(0x113)]({'model':_0x5f2d4c(0x106),'view':(_0x3bf705,{writer:_0x4efe64})=>function(_0x50b9bf,_0x55d1aa,_0x1963a0,_0x5367bb){const _0x548aee=_0x5f2d4c,_0x3230e2=_0x50b9bf[_0x548aee(0xee)][_0x548aee(0xc2)](':')[0x2],_0x188cce=_0x1963a0[_0x548aee(0xc4)](_0x3230e2);if(!_0x188cce||_0x3230e2===_0x1963a0[_0x548aee(0xf3)])return;if(!_0x5367bb[_0x548aee(0x101)][_0x548aee(0x112)][_0x548aee(0x12b)](_0x50b9bf[_0x548aee(0xd4)][_0x548aee(0xc1)],_0x548aee(0xd1)))return;const _0x120617={'class':_0x548aee(0xea)+_0x188cce[_0x548aee(0x116)][_0x548aee(0xc9)](),'data-name':_0x188cce[_0x548aee(0xe5)],'data-session-id':_0x3230e2},_0x1032a5=_0x5367bb[_0x548aee(0x101)][_0x548aee(0xc6)][_0x548aee(0xe4)](_0x50b9bf[_0x548aee(0xee)]),_0xe96e16=_0x1032a5[_0x548aee(0x141)](),_0x407422=_0xe96e16[_0x548aee(0xd5)],_0x3979f3=_0x5367bb[_0x548aee(0x101)][_0x548aee(0x112)];if(_0x407422&&_0x3979f3[_0x548aee(0xfc)](_0x407422)&&_0x3979f3[_0x548aee(0x129)](_0x407422)&&!_0x5367bb[_0x548aee(0x101)][_0x548aee(0xc6)][_0x548aee(0xe4)](_0x548aee(0x128)+_0x3230e2)[_0x548aee(0x12e)]()[_0x548aee(0xe9)])return;const _0x423112=_0xe96e16[_0x548aee(0x123)];return _0x5367bb[_0x548aee(0x101)][_0x548aee(0x112)][_0x548aee(0x120)](_0x423112)&&!_0x5367bb[_0x548aee(0x101)][_0x548aee(0x130)](_0x423112)&&(_0x120617[_0x548aee(0x137)]=!0x1),function(_0x5d5502,_0x3941b2,_0x3333c8){const _0x530593=_0x548aee,_0x57ab87=_0x5d5502[_0x530593(0x11c)](_0x530593(0xd2),_0x3941b2);return _0x5d5502[_0x530593(0x10e)](_0x530593(0x12f),!0x0,_0x57ab87),_0x57ab87[_0x530593(0xfd)]=function(_0x3e7901){const _0x4cbc71=_0x530593,_0x166eb0=this[_0x4cbc71(0x102)](_0x3e7901),_0x6d0dfe=document[_0x4cbc71(0xfe)](_0x4cbc71(0xd2));return _0x6d0dfe[_0x4cbc71(0xbc)][_0x4cbc71(0xcc)](_0x4cbc71(0x10f)),_0x6d0dfe[_0x4cbc71(0xf4)](_0x4cbc71(0x137),_0x4cbc71(0x10a)),_0x6d0dfe[_0x4cbc71(0xf4)](_0x4cbc71(0xe2),_0x4cbc71(0x10a)),_0x6d0dfe[_0x4cbc71(0x11e)]=_0x3333c8[_0x4cbc71(0xe5)],_0x166eb0[_0x4cbc71(0xb9)]=_0x4cbc71(0x11d)+_0x6d0dfe[_0x4cbc71(0x10c)]+'',_0x166eb0[_0x4cbc71(0xda)](_0x4cbc71(0x124),()=>{const _0x2bb721=_0x4cbc71;_0x166eb0[_0x2bb721(0xbc)][_0x2bb721(0xcc)](_0x2bb721(0x12a));}),_0x166eb0[_0x4cbc71(0xda)](_0x4cbc71(0xec),()=>{const _0x24b318=_0x4cbc71;_0x166eb0[_0x24b318(0xbc)][_0x24b318(0xce)](_0x24b318(0x12a));}),_0x166eb0;},_0x57ab87[_0x530593(0xfb)]=function(_0x559d65){const _0x22c4f4=_0x530593;return!(!this[_0x22c4f4(0xd9)](_0x22c4f4(0x12f))||!_0x559d65[_0x22c4f4(0xd9)](_0x22c4f4(0x12f))||this[_0x22c4f4(0xd8)](_0x22c4f4(0x135))!=_0x559d65[_0x22c4f4(0xd8)](_0x22c4f4(0x135)));},_0x57ab87;}(_0x55d1aa,_0x120617,_0x188cce);}(_0x3bf705,_0x4efe64,_0xd6b543,_0x2211a8)}),_0x2211a8[_0x5f2d4c(0x11a)][_0x5f2d4c(0xb8)](_0x5f2d4c(0x134))[_0x5f2d4c(0x117)]({'model':_0x5f2d4c(0x115),'view':_0x84d6f1=>function(_0x375845,_0x1c9acb){const _0x482439=_0x5f2d4c,_0x2e0a53=_0x375845[_0x482439(0xee)][_0x482439(0xc2)](':')[0x2];if(_0x2e0a53===_0x1c9acb[_0x482439(0xf3)])return null;const _0x5a3272=_0x1c9acb[_0x482439(0xc4)](_0x2e0a53);if(!_0x5a3272)return{'id':_0x2e0a53,'classes':[]};return{'id':_0x2e0a53,'classes':[_0x482439(0xf1),_0x5a3272[_0x482439(0x116)][_0x482439(0xe3)]()],'attributes':{'data-session-id':_0x2e0a53},'priority':0x7d0+_0x5a3272[_0x482439(0xfa)]};}(_0x84d6f1,_0xd6b543)}),function(_0x110884){const _0xc5eb3f=_0x5f2d4c,_0x3d192b=_0x110884[_0xc5eb3f(0x101)],_0x4adad4=new Map(),_0x213446=_0x110884[_0xc5eb3f(0xd6)][_0xc5eb3f(0xe4)](_0x53f96b);_0x3d192b[_0xc5eb3f(0xc6)]['on'](_0xc5eb3f(0x10b),(_0x5af4cf,_0x49528b,_0x20bf4e,_0x122814)=>{const _0x1f38f6=_0xc5eb3f;if(!_0x122814&&_0x4adad4[_0x1f38f6(0xe4)](_0x49528b[_0x1f38f6(0xe5)]))return _0x4adad4[_0x1f38f6(0xe4)](_0x49528b[_0x1f38f6(0xe5)])[_0x1f38f6(0x132)](),void _0x4adad4[_0x1f38f6(0xdc)](_0x49528b[_0x1f38f6(0xe5)]);const _0x2e0cdf=_0x49528b[_0x1f38f6(0xe5)][_0x1f38f6(0xc2)](':')[0x2];if(_0x2e0cdf===_0x213446[_0x1f38f6(0xf3)])return;const _0x101cd4=_0x1f38f6(0x108)+_0x2e0cdf;_0x3d192b[_0x1f38f6(0xc6)][_0x1f38f6(0x111)](_0x101cd4)&&_0x110884[_0x1f38f6(0x138)][_0x1f38f6(0x131)](_0x101cd4),_0x49528b['on'](_0x1f38f6(0xdb),(_0x2874b9,_0x388b0e,_0x50defd)=>{const _0x2cb063=_0x1f38f6;if(_0x2cb063(0x12d)!=_0x388b0e[_0x2cb063(0xc3)][_0x2cb063(0xf2)]&&_0x2cb063(0x12d)==_0x49528b[_0x2cb063(0x12e)]()[_0x2cb063(0xc3)][_0x2cb063(0xf2)]&&!_0x4adad4[_0x2cb063(0x111)](_0x49528b[_0x2cb063(0xe5)])){const _0x53aec0=_0x3d192b[_0x2cb063(0x112)][_0x2cb063(0xde)](_0x50defd[_0x2cb063(0x122)]);if(_0x53aec0){const _0xb0522f=_0x29c3ac[_0x2cb063(0xdf)](_0x53aec0);_0x4adad4[_0x2cb063(0xe8)](_0x49528b[_0x2cb063(0xe5)],_0xb0522f),_0xb0522f['on'](_0x2cb063(0xdb),(_0x51fcf5,_0xe9298d,_0x54af52)=>{const _0x524bc5=_0x2cb063;if(_0x524bc5(0x12d)==_0xb0522f[_0x524bc5(0xc3)][_0x524bc5(0xf2)]){const _0x17115a=_0x3d192b[_0x524bc5(0x112)][_0x524bc5(0xde)](_0x54af52[_0x524bc5(0x122)]);_0x17115a?(_0xb0522f[_0x524bc5(0xc1)]=_0x17115a[_0x524bc5(0xc1)],_0xb0522f[_0x524bc5(0xdd)]=_0x17115a[_0x524bc5(0xdd)]):(_0x4adad4[_0x524bc5(0xdc)](_0x49528b[_0x524bc5(0xe5)]),_0xb0522f[_0x524bc5(0x132)]());}});}}});}),_0x3d192b[_0xc5eb3f(0x11b)]['on'](_0xc5eb3f(0xef),()=>{const _0x49e6e9=_0xc5eb3f;_0x4adad4[_0x49e6e9(0x107)]>0x0&&_0x3d192b[_0x49e6e9(0x105)]({'isUndoable':!0x1},_0x24904f=>{const _0x4f82bb=_0x49e6e9;for(const [_0x15bee9,_0x268755]of _0x4adad4)_0x4f82bb(0x12d)==_0x3d192b[_0x4f82bb(0xc6)][_0x4f82bb(0xe4)](_0x15bee9)[_0x4f82bb(0x12e)]()[_0x4f82bb(0xc3)][_0x4f82bb(0xf2)]&&(te(_0x15bee9[_0x4f82bb(0xc2)](':')[0x2],_0x268755[_0x4f82bb(0xd7)](),_0x3d192b,_0x24904f),_0x268755[_0x4f82bb(0x132)]());_0x4adad4[_0x4f82bb(0xe1)]();});});}(_0x2211a8),this[_0x5f2d4c(0x126)][_0x5f2d4c(0x100)](_0x11455b[_0x5f2d4c(0x11b)],_0x5f2d4c(0xc5),(_0x5cf540,{key:_0x596e8a})=>{const _0x4b291d=_0x5f2d4c;_0x4b291d(0xe0)===_0x596e8a&&function(_0x59b5af){const _0x5ad509=_0x4b291d;_0x59b5af[_0x5ad509(0x138)][_0x5ad509(0xf8)][_0x5ad509(0xef)](_0x45b738=>{const _0xa3ca71=_0x5ad509;for(const _0x3f86b4 of _0x59b5af[_0xa3ca71(0x101)][_0xa3ca71(0xc6)]){if(!_0x3f86b4[_0xa3ca71(0xe5)][_0xa3ca71(0xbd)](_0xa3ca71(0x106)))continue;const _0x5a8734=_0x59b5af[_0xa3ca71(0x138)][_0xa3ca71(0x13e)][_0xa3ca71(0x13f)](_0x3f86b4[_0xa3ca71(0xe5)]);if(_0x5a8734){for(const _0xc527c2 of _0x5a8734)_0x45b738[_0xa3ca71(0x119)](_0xa3ca71(0x12a),_0xc527c2);}}});}(_0x2211a8);},{'useCapture':!0x0});}[_0x409489(0xbe)](){const _0x293d82=_0x409489,_0x231d3f=this[_0x293d82(0xbf)],_0x3bf559=_0x231d3f[_0x293d82(0xf0)][_0x293d82(0xe4)](_0x293d82(0xc8));_0x3bf559&&_0x231d3f[_0x293d82(0x101)]['on'](_0x293d82(0x13d),(_0xc49cb3,_0x5a9e1d)=>{const _0x2b2850=_0x293d82,_0x4f1528=_0x5a9e1d[0x0];if(!_0x4f1528[_0x2b2850(0x121)])return;if(_0x2b2850(0x133)!=_0x4f1528[_0x2b2850(0xc7)]||!_0x4f1528[_0x2b2850(0xe5)][_0x2b2850(0xbd)](_0x2b2850(0x10d)))return;const _0x7dd8c4=_0x4f1528[_0x2b2850(0xf6)];_0x3bf559[_0x2b2850(0x118)][_0x2b2850(0x111)](_0x7dd8c4)&&(_0x4f1528[_0x2b2850(0xe6)]=_0x4f1528[_0x2b2850(0xed)]?_0x231d3f[_0x2b2850(0x101)][_0x2b2850(0x114)](_0x4f1528[_0x2b2850(0xed)][_0x2b2850(0xc1)],_0x4f1528[_0x2b2850(0xed)][_0x2b2850(0xdd)]):null);},{'priority':_0x293d82(0xe7)});}[_0x409489(0xf5)](){const _0x32f747=_0x409489;return this[_0x32f747(0x126)][_0x32f747(0x13b)](),super[_0x32f747(0xf5)]();}[_0x409489(0x13a)](){const _0x53247f=_0x409489,_0xd14461=this[_0x53247f(0xbf)],_0x18fa34=_0xd14461[_0x53247f(0x101)][_0x53247f(0x11b)],_0x134a06=_0xd14461[_0x53247f(0xd6)][_0x53247f(0xe4)](_0x53f96b);_0xd14461[_0x53247f(0x101)][_0x53247f(0x105)]({'isUndoable':!0x1},_0x104857=>{const _0x46d9f3=_0x53247f,_0x11e9b1=_0x46d9f3(0x128)+_0x134a06[_0x46d9f3(0xf3)],_0x11e84e=_0x46d9f3(0x108)+_0x134a06[_0x46d9f3(0xf3)],_0x3f339d=_0xd14461[_0x46d9f3(0x101)][_0x46d9f3(0xc6)][_0x46d9f3(0x111)](_0x11e9b1);_0xd14461[_0x46d9f3(0x138)][_0x46d9f3(0xf8)][_0x46d9f3(0x110)]?te(_0x134a06[_0x46d9f3(0xf3)],_0x18fa34[_0x46d9f3(0xcd)][_0x46d9f3(0x136)](),_0xd14461[_0x46d9f3(0x101)],_0x104857):_0x3f339d&&(_0x104857[_0x46d9f3(0xeb)](_0x11e9b1),_0x104857[_0x46d9f3(0xeb)](_0x11e84e));});}}function _0x1056(_0x31311c,_0x22ab0d){const _0x41ff74=_0x41ff();return _0x1056=function(_0x1056be,_0x3a9511){_0x1056be=_0x1056be-0xb8;let _0x39fd4a=_0x41ff74[_0x1056be];return _0x39fd4a;},_0x1056(_0x31311c,_0x22ab0d);}function te(_0x4eeda6,_0xeed483,_0x353420,_0x1ebdec){const _0x1499e2=_0x409489,_0x41f202=_0x1499e2(0x128)+_0x4eeda6,_0x58fa16=_0x1499e2(0x108)+_0x4eeda6,_0x4c20e8=_0xeed483[_0x1499e2(0x139)]();let _0x533d6a=_0xeed483[_0x1499e2(0xc1)];if(_0x4c20e8&&_0x4c20e8['is'](_0x1499e2(0x103),_0x1499e2(0xf7))){const _0x12b970=function(_0x176ff1,_0x1e5585){const _0x198374=_0x1499e2;for(const _0x269a08 of _0x176ff1[_0x198374(0xca)]())if(_0x1e5585[_0x198374(0x112)][_0x198374(0x12b)](_0x269a08,_0x198374(0xd1)))return _0x269a08;}(_0xeed483,_0x353420);_0x12b970&&(_0x533d6a=_0x12b970,_0xeed483=_0x1ebdec[_0x1499e2(0x114)](_0x533d6a));}const _0x21817e=_0x1ebdec[_0x1499e2(0x114)](_0x533d6a);_0x353420[_0x1499e2(0xc6)][_0x1499e2(0x111)](_0x41f202)?(_0x1ebdec[_0x1499e2(0xd0)](_0x41f202,{'range':_0xeed483}),_0x1ebdec[_0x1499e2(0xd0)](_0x58fa16,{'range':_0x21817e})):(_0x1ebdec[_0x1499e2(0xff)](_0x41f202,{'range':_0xeed483,'usingOperation':!0x0}),_0x1ebdec[_0x1499e2(0xff)](_0x58fa16,{'range':_0x21817e,'usingOperation':!0x0}));}function _0x41ff(){const _0x4b5880=['mouseleave','oldRange','markerName','change','commands','ck-user__selection','rootName','mySessionId','setAttribute','destroy','batch','tableCell','view','6256873ppkTeA','orderNumber','isSimilar','isObject','render','createElement','addMarker','listenTo','model','toDomElement','element','3926824VjfIMG','enqueueChange','user:position','size','user:position:','isOfficialPlugin','false','update:user:range','outerHTML','user:','setCustomProperty','ck-user__marker-tooltip','hasDomSelection','has','schema','markerToElement','createRange','user:range','color','markerToHighlight','_createdBatches','removeClass','conversion','document','createUIElement','<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>','textContent','3448dametE','isLimit','isDocumentOperation','deletionPosition','parent','mouseenter','1224528tnidUG','_domEmitter','requires','user:range:','isInline','ck-user__marker_hovered','checkChild','4LXPyxo','$graveyard','getRange','userPositionMarker','hasContent','reconvertMarker','detach','marker','editingDowncast','data-session-id','getFirstRange','contenteditable','editing','getContainedElement','createUserMarkerOperations','stopListening','786291gVhnnN','applyOperation','mapper','markerNameToElements','34119ucfOMK','getStart','for','innerHTML','353110wBNhXo','UserMarkers','classList','startsWith','afterInit','editor','pluginName','start','split','root','getUserBySessionId','keydown','markers','type','undo','getMarkerClass','getPositions','980060BpkfgQ','add','selection','remove','init','updateMarker','$text','span','isPremiumPlugin','markerRange','nodeAfter','plugins','toRange','getAttribute','getCustomProperty','addEventListener','change:range','delete','end','getNearestSelectionRange','fromRange','Escape','clear','spellcheck','getSelectionClass','get','name','newRange','highest','set','isCollapsed','ck-user__marker\x20','removeMarker'];_0x41ff=function(){return _0x4b5880;};return _0x41ff();}