@ckeditor/ckeditor5-real-time-collaboration 29.2.0 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +2 -2
- package/README.md +2 -2
- package/lang/contexts.json +6 -1
- package/lang/translations/cs.po +21 -1
- package/lang/translations/de-ch.po +21 -1
- package/lang/translations/de.po +21 -1
- package/lang/translations/en-au.po +21 -1
- package/lang/translations/en.po +21 -1
- package/lang/translations/es.po +21 -1
- package/lang/translations/et.po +21 -1
- package/lang/translations/fr.po +21 -1
- package/lang/translations/gl.po +21 -1
- package/lang/translations/hi.po +21 -1
- package/lang/translations/hr.po +21 -1
- package/lang/translations/hu.po +21 -1
- package/lang/translations/id.po +46 -0
- package/lang/translations/it.po +21 -1
- package/lang/translations/ko.po +21 -1
- package/lang/translations/nl.po +21 -1
- package/lang/translations/no.po +21 -1
- package/lang/translations/pl.po +21 -1
- package/lang/translations/pt-br.po +22 -2
- package/lang/translations/ro.po +21 -1
- package/lang/translations/ru.po +21 -1
- package/lang/translations/sk.po +21 -1
- package/lang/translations/sr-latn.po +21 -1
- package/lang/translations/sr.po +21 -1
- package/lang/translations/tk.po +21 -1
- package/lang/translations/tr.po +21 -1
- package/lang/translations/uk.po +21 -1
- package/lang/translations/zh-cn.po +21 -1
- package/lang/translations/zh.po +21 -1
- package/package.json +10 -8
- package/src/presencelist/presencelistui.js +2 -2
- package/src/presencelist/view/presencecounterview.js +2 -2
- package/src/presencelist/view/presencedropdownlistitemview.js +2 -2
- package/src/presencelist/view/presencedropdownlistview.js +2 -2
- package/src/presencelist/view/presenceinlinelistitemview.js +2 -2
- package/src/presencelist/view/presenceinlinelistview.js +2 -2
- package/src/presencelist/view/presencelistview.js +2 -2
- package/src/presencelist/view/tooltipview.js +2 -2
- package/src/presencelist.js +2 -2
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +2 -2
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +2 -2
- package/src/realtimecollaborativeediting/usermarkers.js +2 -2
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +2 -2
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +23 -0
- package/src/realtimecollaborativerevisionhistory.js +23 -0
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +2 -2
- package/theme/presencelist.css +1 -1
- package/theme/usermarkers.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x24ad=['assign','cloudservicescommentsadapter-connect-already-connected','listenTo','add','context','commentThreadId','getConnectedSessions','404','code','_terminateService','getCommentThreads','getCommentThread','catch','off','_fetchMissingUsersForThreads','from','comments','permissions','removeCommentThread','content','commentThreadRemoved','getUser','set','config','adapter','attributes','has','_connectService','addComment','map','removeComment','updateComment','collaboration.channelId','userId','mySessionId','get','createdAt','commentId','connect','init','update','commentUpdated','destroy','remove','plugins','addToReconnectionStack','commentAdded','CommentsService','addUser','all','cloudservicescommentsadapter-disconnect-not-exist','delete','_services','requires','_getService','register','getComment','addCommentThread','reconnect'];(function(_0x24a7c2,_0x24adcc){const _0x158b26=function(_0x152d39){while(--_0x152d39){_0x24a7c2['push'](_0x24a7c2['shift']());}};_0x158b26(++_0x24adcc);}(_0x24ad,0xfe));const _0x158b=function(_0x24a7c2,_0x24adcc){_0x24a7c2=_0x24a7c2-0x0;let _0x158b26=_0x24ad[_0x24a7c2];return _0x158b26;};import{Context as _0x1d9a7a,ContextPlugin as _0x3e855c}from'ckeditor5/src/core';import _0x2ceaa0 from'@ckeditor/ckeditor-cloud-services-collaboration/src/comments-v2/commentsservice';import _0x3e396e from'../realtimecollaborativeediting/websocketgateway';import _0x2d8358 from'../realtimecollaborativeediting/sessions';import _0x36d372 from'@ckeditor/ckeditor5-comments/src/comments/commentsrepository';import _0x23c23c from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import _0x29c85b from'@ckeditor/ckeditor5-collaboration-core/src/users';import{CKEditorError as _0x3287fa}from'ckeditor5/src/utils';export default class c extends _0x3e855c{static get[_0x158b('0x23')](){return[_0x3e396e,_0x36d372,_0x2d8358,_0x29c85b];}constructor(_0x11d819){super(_0x11d819),this[_0x158b('0x22')]=new Map();}async[_0x158b('0x15')](){const _0x543980=this[_0x158b('0x2d')],_0x4700cb=_0x543980['plugins'][_0x158b('0x11')](_0x36d372);if(_0x543980['plugins'][_0x158b('0x11')](_0x3e396e)[_0x158b('0x1b')](this),_0x4700cb[_0x158b('0x6')]={'getCommentThread':async({channelId:_0x3d2759,threadId:_0x5179a1})=>{const _0x2fa76c=await this[_0x158b('0x24')](_0x3d2759)[_0x158b('0x34')](_0x5179a1);return await this[_0x158b('0x37')]([_0x2fa76c]),{'threadId':_0x2fa76c['commentThreadId'],'comments':_0x2fa76c[_0x158b('0x39')][_0x158b('0xb')](M)};},'removeCommentThread':({channelId:_0x58571e,threadId:_0x56eb69})=>this[_0x158b('0x24')](_0x58571e)[_0x158b('0x0')](_0x56eb69)[_0x158b('0x35')](j),'addComment':({channelId:_0x5b8e4c,threadId:_0x1a9b6c,commentId:_0x1caf2d,content:_0x47fe96,attributes:_0x5ee7fd})=>this[_0x158b('0x24')](_0x5b8e4c)[_0x158b('0xa')](_0x1a9b6c,_0x1caf2d,_0x47fe96,_0x5ee7fd),'updateComment':({channelId:_0xb12c15,threadId:_0x1b2c90,commentId:_0x2b0455,content:_0x4bd5d8,attributes:_0xfdaee2})=>this[_0x158b('0x24')](_0xb12c15)[_0x158b('0xd')](_0x1b2c90,_0x2b0455,_0x4bd5d8,_0xfdaee2)[_0x158b('0x35')](j),'removeComment':({channelId:_0x41d90e,threadId:_0x508f16,commentId:_0x205999})=>this[_0x158b('0x24')](_0x41d90e)[_0x158b('0xc')](_0x508f16,_0x205999)[_0x158b('0x35')](j)},_0x543980 instanceof _0x1d9a7a){const _0x160049=_0x543980[_0x158b('0x5')][_0x158b('0x11')](_0x158b('0xe')),_0x369f3c=_0x543980[_0x158b('0x1a')][_0x158b('0x11')](_0x2d8358);await this['_setUpService'](_0x160049);const _0x3f0f5b=await this[_0x158b('0x22')]['get'](_0x160049)['getConnectedSessions']();this[_0x158b('0x2b')](_0x369f3c,'sessionAdd:'+_0x160049,(_0x31ce64,{session:_0xe6b653})=>{_0xe6b653['id']===_0x369f3c[_0x158b('0x10')]&&(_0x31ce64[_0x158b('0x36')](),this[_0x158b('0x2d')][_0x158b('0x1a')][_0x158b('0x11')]('Permissions')['setPermissions'](_0xe6b653[_0x158b('0x3a')],_0x160049));}),_0x369f3c[_0x158b('0x25')](_0x160049,_0x3f0f5b);}}async['_setUpService'](_0x1bd043){if(this[_0x158b('0x22')]['has'](_0x1bd043))throw new _0x3287fa(_0x158b('0x2a'),null,{'channelId':_0x1bd043});const _0x1efdc7=this[_0x158b('0x2d')][_0x158b('0x1a')]['get'](_0x36d372),_0x5e9b9d=new c[(_0x158b('0x1d'))](_0x1bd043);this[_0x158b('0x22')][_0x158b('0x4')](_0x1bd043,_0x5e9b9d),this['listenTo'](_0x5e9b9d,_0x158b('0x2'),(_0x19eaeb,{commentThreadId:_0x2747c7})=>{const _0x16c535=_0x1efdc7[_0x158b('0x34')](_0x2747c7);_0x16c535&&_0x16c535[_0x158b('0x19')]({'isFromAdapter':!0x0});}),this[_0x158b('0x2b')](_0x5e9b9d,_0x158b('0x1c'),(_0x3ff406,_0x34c342)=>{const _0x2e7ab6=_0x34c342['commentThreadId'];_0x1efdc7['hasCommentThread'](_0x2e7ab6)||_0x1efdc7[_0x158b('0x27')]({'channelId':_0x1bd043,'threadId':_0x2e7ab6,'isFromAdapter':!0x0});const _0x30b97e=_0x1efdc7[_0x158b('0x34')](_0x2e7ab6);_0x30b97e&&_0x30b97e[_0x158b('0xa')](Object['assign'](M(_0x34c342),{'isFromAdapter':!0x0}));}),this['listenTo'](_0x5e9b9d,_0x158b('0x17'),(_0x29474d,{commentThreadId:_0x50ee93,commentId:_0x1631b2,content:_0x1d5ae6,attributes:_0xcf6ea0})=>{const _0x2f462f=_0x1efdc7[_0x158b('0x34')](_0x50ee93);if(_0x2f462f){const _0x58f895=_0x2f462f['getComment'](_0x1631b2);_0x58f895&&_0x58f895[_0x158b('0x16')]({'content':_0x1d5ae6,'attributes':_0xcf6ea0,'isFromAdapter':!0x0});}}),this[_0x158b('0x2b')](_0x5e9b9d,'commentRemoved',(_0x288edf,{commentThreadId:_0x551aeb,commentId:_0x45edf7})=>{const _0x4d4fd9=_0x1efdc7[_0x158b('0x34')](_0x551aeb);if(_0x4d4fd9){const _0x35a89c=_0x4d4fd9[_0x158b('0x26')](_0x45edf7);_0x35a89c&&_0x35a89c[_0x158b('0x19')]({'isFromAdapter':!0x0});}}),await this[_0x158b('0x9')](_0x1bd043);}[_0x158b('0x18')](){if(this[_0x158b('0x2d')]instanceof _0x1d9a7a){const _0x47287d=this[_0x158b('0x2d')][_0x158b('0x5')][_0x158b('0x11')](_0x158b('0xe'));this[_0x158b('0x32')](_0x47287d);}}[_0x158b('0x32')](_0x34c3c2){if(!this[_0x158b('0x22')][_0x158b('0x8')](_0x34c3c2))throw new _0x3287fa(_0x158b('0x20'),null,{'channelId':_0x34c3c2});this[_0x158b('0x24')](_0x34c3c2)['disconnect'](),this[_0x158b('0x22')][_0x158b('0x21')](_0x34c3c2);}async[_0x158b('0x28')](){for(const _0x359983 of this[_0x158b('0x22')]['keys']())await this[_0x158b('0x9')](_0x359983);if(this['context']instanceof _0x1d9a7a){const _0x49ca86=this[_0x158b('0x2d')][_0x158b('0x5')][_0x158b('0x11')]('collaboration.channelId'),_0x27b337=this['context'][_0x158b('0x1a')][_0x158b('0x11')](_0x2d8358);_0x27b337['unregister'](_0x49ca86);const _0x4516fc=await this[_0x158b('0x22')][_0x158b('0x11')](_0x49ca86)[_0x158b('0x2f')]();_0x27b337[_0x158b('0x25')](_0x49ca86,_0x4516fc);}}async[_0x158b('0x9')](_0xe87134){const {connection:_0x2693c7}=this[_0x158b('0x2d')]['plugins'][_0x158b('0x11')](_0x3e396e),_0x416b4d=this['context'][_0x158b('0x1a')][_0x158b('0x11')](_0x36d372),_0xea5a1=this[_0x158b('0x22')]['get'](_0xe87134),_0x441123=await _0xea5a1[_0x158b('0x14')](_0x2693c7);await this[_0x158b('0x37')](_0x441123);const _0x305741=new Set(Array['from'](_0x416b4d[_0x158b('0x33')]({'channelId':_0xe87134}),_0x1205bc=>_0x1205bc['id']));for(const _0x2e22c5 of _0x441123)_0x305741[_0x158b('0x21')](_0x2e22c5[_0x158b('0x2e')]);for(const _0x39e77e of _0x305741)_0x416b4d[_0x158b('0x34')](_0x39e77e)['remove']({'isFromAdapter':!0x0});for(const _0x56455e of _0x441123){let _0x40e951=_0x416b4d[_0x158b('0x34')](_0x56455e[_0x158b('0x2e')]);_0x40e951||(_0x40e951=_0x416b4d['addCommentThread']({'channelId':_0xe87134,'threadId':_0x56455e['commentThreadId'],'isFromAdapter':!0x0}));const _0x248c50=new Set(Array[_0x158b('0x38')](_0x40e951[_0x158b('0x39')],_0x21c804=>_0x21c804['id']));for(const _0x8e713 of _0x56455e[_0x158b('0x39')])_0x248c50[_0x158b('0x21')](_0x8e713[_0x158b('0x13')]);for(const _0x174c30 of _0x248c50)_0x40e951[_0x158b('0x26')](_0x174c30)[_0x158b('0x19')]({'isFromAdapter':!0x0});for(const _0x44d734 of _0x56455e[_0x158b('0x39')]){const _0x14524b=_0x40e951[_0x158b('0x26')](_0x44d734['commentId']);_0x14524b?_0x14524b[_0x158b('0x1')]!==_0x44d734[_0x158b('0x1')]&&_0x14524b['update']({'content':_0x44d734['content'],'isFromAdapter':!0x0}):_0x40e951['addComment'](Object[_0x158b('0x29')](M(_0x44d734),{'isFromAdapter':!0x0}));}}}['_getService'](_0x12167c){if(!this[_0x158b('0x22')][_0x158b('0x8')](_0x12167c))throw new _0x3287fa('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x12167c});return this[_0x158b('0x22')][_0x158b('0x11')](_0x12167c);}[_0x158b('0x37')](_0x5c9f59){const _0x3f8126=this[_0x158b('0x2d')][_0x158b('0x1a')][_0x158b('0x11')](_0x29c85b),{connection:_0xe9db97}=this['context']['plugins'][_0x158b('0x11')](_0x3e396e),_0x3b1219=new Set();for(const {comments:_0x4df878}of _0x5c9f59)for(const {userId:_0x42fea3}of _0x4df878)_0x3f8126[_0x158b('0x3')](_0x42fea3)||_0x3b1219[_0x158b('0x2c')](_0x42fea3);return Promise[_0x158b('0x1f')](Array[_0x158b('0x38')](_0x3b1219,async _0x5d5592=>{const _0x543a1b=await _0x23c23c[_0x158b('0x11')](_0xe9db97,_0x5d5592);_0x3f8126[_0x158b('0x3')](_0x5d5592)||_0x3f8126[_0x158b('0x1e')](_0x543a1b);}));}}async function j(_0x314950){if(_0x158b('0x30')!==_0x314950[_0x158b('0x31')])throw _0x314950;}function M(_0x12712b){return{'threadId':_0x12712b[_0x158b('0x2e')],'commentId':_0x12712b[_0x158b('0x13')],'content':_0x12712b[_0x158b('0x1')],'createdAt':_0x12712b[_0x158b('0x12')],'authorId':_0x12712b[_0x158b('0xf')],'attributes':_0x12712b[_0x158b('0x7')]};}c['CommentsService']=_0x2ceaa0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5033=['editor','RealTimeCollaborativeComments','once','ready','data','change:state','collaboration.channelId','config','switchReadOnly','requires','get','isThreadsLoadingPaused','init','_terminateService','pluginName','_setUpService','connected','plugins','listenTo'];(function(_0x3df329,_0x5033ba){const _0x2c29bb=function(_0x3545b4){while(--_0x3545b4){_0x3df329['push'](_0x3df329['shift']());}};_0x2c29bb(++_0x5033ba);}(_0x5033,0x168));const _0x2c29=function(_0x3df329,_0x5033ba){_0x3df329=_0x3df329-0x0;let _0x2c29bb=_0x5033[_0x3df329];return _0x2c29bb;};import{Plugin as _0x3a1093}from'ckeditor5/src/core';import _0x3241f2 from'./realtimecollaborativecomments/cloudservicescommentsadapter';import _0x92ac09 from'./realtimecollaborativeediting';import _0x3e3cee from'@ckeditor/ckeditor5-comments/src/comments';import _0x4f3d0c from'@ckeditor/ckeditor5-comments/src/comments/commentsediting';import _0x3bc8c4 from'@ckeditor/ckeditor5-comments/src/comments/commentsrepository';import _0x266a8d from'./realtimecollaborativeediting/websocketgateway';export default class h extends _0x3a1093{static get[_0x2c29('0xa')](){return[_0x3e3cee,_0x4f3d0c,_0x3241f2,_0x92ac09,_0x266a8d];}static get[_0x2c29('0xf')](){return _0x2c29('0x2');}[_0x2c29('0xd')](){const _0x104823=this['editor'][_0x2c29('0x12')][_0x2c29('0xb')](_0x266a8d),_0xa8fe30=this[_0x2c29('0x1')][_0x2c29('0x12')][_0x2c29('0xb')](_0x4f3d0c),_0x559f6d=this[_0x2c29('0x1')][_0x2c29('0x12')][_0x2c29('0xb')](_0x3241f2);return this[_0x2c29('0x1')][_0x2c29('0x5')][_0x2c29('0x3')](_0x2c29('0x4'),()=>{this[_0x2c29('0x0')](_0x104823,_0x2c29('0x6'),(_0x39be77,_0x1ac08c,_0xa80e8a)=>{_0xa8fe30[_0x2c29('0xc')]=_0x2c29('0x11')!==_0xa80e8a;});}),this['listenTo'](_0x104823,_0x2c29('0x6'),(_0x2d7a9f,_0xb59fd,_0x82eb9e)=>{this[_0x2c29('0x1')][_0x2c29('0x12')][_0x2c29('0xb')](_0x3bc8c4)[_0x2c29('0x9')](_0x2c29('0x11')!==_0x82eb9e);}),_0x559f6d[_0x2c29('0x10')](this[_0x2c29('0x1')][_0x2c29('0x8')][_0x2c29('0xb')](_0x2c29('0x7')));}['destroy'](){this['editor'][_0x2c29('0x12')][_0x2c29('0xb')](_0x3241f2)[_0x2c29('0xe')](this[_0x2c29('0x1')][_0x2c29('0x8')][_0x2c29('0xb')](_0x2c29('0x7'))),super['destroy']();}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x7c5f,PendingActions as _0x44fb06}from'ckeditor5/src/core';import _0x43374b from'./websocketgateway';import _0x1f1abf from'./sessions';import _0x20cd91 from'./usermarkers';import _0x180a24 from'@ckeditor/ckeditor5-collaboration-core/src/users';import _0x21c93a from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import{CKEditorError as _0x63bf55,version as _0x7c875b}from'ckeditor5/src/utils';import _0xd7ca13 from'@ckeditor/ckeditor-cloud-services-collaboration/src/collaborativeeditingservice/collaborativeeditingservice';import{transformSets as _0x348074,InsertOperation as _0x161d45,MarkerOperation as _0x402ff8,OperationFactory as _0xe1526d}from'ckeditor5/src/engine';let W=0x1;export default class g extends _0x7c5f{static get['requires'](){return[_0x43374b,_0x1f1abf,_0x20cd91,_0x44fb06,_0x180a24];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['lastSyncVersion']+this['offset'];}['init'](){const _0x316cff=this['editor'],_0x2e0710=_0x316cff['plugins']['get'](_0x180a24),_0x12871a=_0x316cff['plugins']['get'](_0x43374b);if(this['lastSyncVersion']=0x0,this['offset']=0x0,this['_channelId']=_0x316cff['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x63bf55('collaboration-missing-channelid',this);this['listenTo'](_0x2e0710,'getOperationAuthor',(_0x29dfee,_0x749fd8)=>{const _0x47b7cc=_0x749fd8[0x0];_0x47b7cc['_authorId']&&(_0x29dfee['return']=_0x2e0710['getUser'](_0x47b7cc['_authorId']),_0x29dfee['stop']()),null===_0x47b7cc['_authorId']&&(_0x29dfee['return']=null,_0x29dfee['stop']());},{'priority':'high'});const _0x203efa=_0x316cff['config']['get']('cloudServices.bundleVersion')||_0x7c875b;this['_service']=new g['CollaborativeEditingService'](_0x203efa,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x21c93a(),this['_bufferedOperations']=new Set(),this['_knownOperations']=new WeakSet(),this['set']('_isPendingUpdate',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['listenTo'](_0x316cff['model']['document']['selection'],'change:range',(_0x2f8308,_0x1b13c8)=>{_0x1b13c8['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x316cff['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),g['CollaborativeEditingService']['getConnectedSessions'](_0x12871a['connection'],this['_channelId'])['then'](_0x264255=>this['_initSessionsHandling'](_0x264255))['catch'](_0x26d329=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x26d329);}),this['_initThrowingOnDataSet'](),this['_initService'](),_0x316cff['plugins']['get'](_0x43374b)['addToReconnectionStack'](this),_0x316cff['model']['on']('applyOperation',(_0x35c567,_0x53b165)=>{const _0x43ba4e=_0x53b165[0x0];_0x43ba4e['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x43ba4e),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['editor']['bind']('isReadOnly')['to'](_0x12871a,'state',_0x540e04=>'connected'!==_0x540e04);}async['reconnect'](){const _0x1c3663=this['editor']['plugins']['get'](_0x1f1abf),_0x369bb9=this['editor']['plugins']['get'](_0x43374b);_0x1c3663['unregister'](this['_channelId']);const _0x23af25=await this['_service']['reconnect'](_0x369bb9['connection'],this['lastSyncVersion']);this['_handleServerResponse']([],Object['assign']({},_0x23af25,{'data':_0x23af25['data'],'wereChangesApplied':!0x1}),'reconnect');const _0x444ad=await g['CollaborativeEditingService']['getConnectedSessions'](_0x369bb9['connection'],this['_channelId']);_0x1c3663['register'](this['_channelId'],_0x444ad),this['_isPendingUpdate']=!0x1;}['destroy'](){const _0x19e0ea=this['editor']['plugins']['get'](_0x43374b),_0x368f11=this['editor']['plugins']['get'](_0x1f1abf);this['editor']['isReadOnly']=!0x0,_0x368f11['channelSessions']['has'](this['_channelId'])&&_0x368f11['unregister'](this['_channelId']),super['destroy'](),_0x19e0ea['removeFromReconnectionStack'](this),clearTimeout(this['_sendBufferedOperationsDelayId']);}['_initSessionsHandling'](_0x4dd828){const _0x510c61=this['editor']['plugins']['get'](_0x1f1abf);this['listenTo'](_0x510c61,'sessionAdd:'+this['_channelId'],(_0x2c2308,{session:_0x1eb243})=>{if(_0x1eb243['id']===_0x510c61['mySessionId']){_0x2c2308['off']();const _0x1666a8=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x18a59e=_0x1eb243['permissions'];_0x1666a8&&_0x1666a8['isEnabled']&&(_0x18a59e=_0x18a59e['filter'](_0x22e16b=>'document:write'!==_0x22e16b)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x18a59e,this['_channelId']);}}),_0x510c61['register'](this['_channelId'],_0x4dd828);}['_initThrowingOnDataSet'](){const _0x3c07a1=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4ecc8e)=>{if(!_0x4ecc8e[_0x4ecc8e['length']-0x1]['suppressErrorInCollaboration'])throw new _0x63bf55('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3c07a1['apply'](this['editor']['data'],_0x4ecc8e);};}['_initService'](){this['listenTo'](this['_service'],'operationsReceived',(_0x2249a4,_0x18941d,_0x54d518,_0x469d81)=>{if(!this['_isPendingUpdate']&&this['_document']['version']==_0x18941d){const _0x1bb36c=this['_decompressOperations'](_0x54d518);this['_assignOperationAuthors'](_0x1bb36c,_0x469d81),this['lastSyncVersion']=_0x18941d+_0x1bb36c['length'],this['_handleExternalOperations'](_0x1bb36c)||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}),this['listenTo'](this['_service'],'error',(_0xb0ba3,_0x39d808)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x39d808);});}['_setUpDataInit'](){const {connection:_0x1f9d56}=this['editor']['plugins']['get'](_0x43374b);this['editor']['data']['on']('init',(_0x245d4d,[_0x2cf2a9])=>{if(this['_document']['version'])throw new _0x63bf55('realtimecollaborationclient-init-document-already-initialized',this);_0x245d4d['stop']();const _0x1be6b9=this['_getOperationsFromInitData'](_0x2cf2a9);this['_setPendingAction'](),_0x245d4d['return']=this['_service']['connect'](_0x1f9d56,this['_compressOperations'](_0x1be6b9))['then'](_0x31e67f=>{this['_clearPendingAction'](),this['_handleConnectionData'](_0x31e67f,_0x1be6b9);const _0x2f128e=this['editor']['plugins']['get'](_0x1f1abf),_0xa9b45b=_0x2f128e['channelSessions']['get'](this['_channelId']);_0xa9b45b&&_0xa9b45b['length']>0x1?(this['_hasSelectionChanged']=!0x0,this['_sendBufferedOperationsDelayed']()):_0x2f128e['on']('sessionAdd:'+this['_channelId'],_0x1539b3=>{_0x2f128e['channelSessions']['get'](this['_channelId'])['length']>0x1&&(this['_hasSelectionChanged']=!0x0,this['_sendBufferedOperationsDelayed'](),_0x1539b3['off']());}),this['editor']['data']['fire']('ready');})['catch'](_0x126f30=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x126f30));},{'priority':'high'});}['_getOperationsFromInitData'](_0x4e7c82){const _0xfb319e=this['editor']['model'],_0x35f7a4=[];let _0x1e7f9b=0x0;const _0x47d50d='string'==typeof _0x4e7c82?{'main':_0x4e7c82}:_0x4e7c82;for(const _0x475a71 of Object['keys'](_0x47d50d)){if(!this['_document']['roots']['has'](_0x475a71))throw new _0x63bf55('realtimecollaborationclient-init-non-existent-root',this);const _0x18ba14=this['editor']['data']['parse'](_0x47d50d[_0x475a71]),_0x26554e=this['_document']['getRoot'](_0x475a71),_0x2a6d14=new _0x161d45(_0xfb319e['createPositionAt'](_0x26554e,0x0),_0x18ba14,_0x1e7f9b++);_0x35f7a4['push'](_0x2a6d14);for(const [_0x3a4af0,_0x524fb3]of _0x18ba14['markers']){const _0x502cf7=_0xfb319e['createRange'](_0xfb319e['createPositionFromPath'](_0x26554e,_0x524fb3['start']['path']['slice']()),_0xfb319e['createPositionFromPath'](_0x26554e,_0x524fb3['end']['path']['slice']())),_0x27121a=new _0x402ff8(_0x3a4af0,null,_0x502cf7,_0xfb319e['markers'],!0x0,_0x1e7f9b++);_0x35f7a4['push'](_0x27121a);}}return _0x35f7a4;}['_handleConnectionData'](_0x5b5748,_0x3f45ae){let _0x168f46;this['offset']=_0x5b5748['offset'];const _0x2fe9c9=_0x5b5748['wereChangesApplied']&&!_0x5b5748['initData'];if(_0x2fe9c9)_0x168f46=_0x3f45ae;else{if(_0x5b5748['initData']){const _0x571bf6=this['_getOperationsFromInitData'](_0x5b5748['initData']);this['_document']['version']=-_0x571bf6['length'],_0x571bf6['forEach'](_0xea10ec=>{_0xea10ec['baseVersion']-=_0x571bf6['length'];}),this['_applyOperationsSet'](_0x571bf6,!0x0);}this['_document']['version']=_0x5b5748['data']['baseVersion'],_0x168f46=this['_decompressOperations'](_0x5b5748['data']),this['_assignOperationAuthors'](_0x168f46,_0x5b5748['metadata']);}this['lastSyncVersion']=_0x5b5748['version'],this['_applyOperationsSet'](_0x168f46,_0x2fe9c9);}['_crash'](_0x3f57f0,_0x5742aa){throw this['_isPendingUpdate']=!0x0,_0x5742aa&&console['error'](_0x5742aa),new _0x63bf55(_0x3f57f0,this['editor']);}['_saveOperationInBuffer'](_0x254615){this['_knownOperations']['has'](_0x254615)||(this['_knownOperations']['add'](_0x254615),this['_bufferedOperations']['add'](_0x254615),this['_pendingAction']||'marker'==_0x254615['type']&&!_0x254615['affectsData']||this['_setPendingAction']());}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()&&this['_sendBufferedOperationsDelayed']();}['_shouldSendSelectionUpdate'](){const _0x1ebca0=this['editor']['plugins']['get'](_0x1f1abf)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&_0x1ebca0&&_0x1ebca0['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['size']>0x0||this['_shouldSendSelectionUpdate']();}async['_sendBufferedOperations'](){const _0x583354=this['editor']['plugins']['get'](_0x20cd91);if(this['_shouldSendSelectionUpdate']()&&(_0x583354['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return Promise['resolve'](!0x0);const _0x1ad7cf=Array['from'](this['_bufferedOperations']);for(const _0x18ec2c of _0x1ad7cf)_0x18ec2c['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x18ec2c);const _0x5e10f6=W++,_0x1d92e9=await this['_service']['sendOperations'](this['_compressOperations'](_0x1ad7cf),this['lastSyncVersion']);try{return this['_handleServerResponse'](_0x1ad7cf,_0x1d92e9,_0x5e10f6);}catch(_0x5745a1){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5745a1);}}['_sendBufferedOperationsDelayed'](_0x4210e7=!0x1){!_0x4210e7&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4f17f2=>{_0x4f17f2&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x17c766=>{throw this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,_0x17c766;});},0x12c));}['_handleServerResponse'](_0x30fc0e,_0x2a4607,_0x179e4e){if(_0x2a4607['error'])throw _0x2a4607['error'];let _0x5704b8=!0x1;if(_0x2a4607['wereChangesApplied']){for(const _0x28f1b7 of _0x30fc0e)this['_bufferedOperations']['delete'](_0x28f1b7),delete _0x28f1b7['wasUndone'];_0x5704b8=!0x0;}else{const _0x599486=this['_decompressOperations'](_0x2a4607['data']);this['_assignOperationAuthors'](_0x599486,_0x2a4607['metadata']),_0x5704b8=this['_handleExternalOperations'](_0x599486,_0x2a4607['version']);}return _0x5704b8?(this['lastSyncVersion']=_0x2a4607['version'],!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1)):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2ab1bf,_0x57fe87){try{const _0x53c23d=Array['from'](this['_bufferedOperations']),_0x671966={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x376c85,operationsB:_0x525ccb,originalOperations:_0x293609}=_0x348074(_0x2ab1bf,_0x53c23d,_0x671966);q(_0x376c85,this['_document']['version']),q(_0x525ccb,_0x57fe87);for(const _0x49377f of _0x376c85){const _0x1ff423=_0x293609['get'](_0x49377f);_0x49377f['_authorId']=_0x1ff423?_0x1ff423['_authorId']:null;}this['_bufferedOperations']=new Set(_0x525ccb),this['_applyOperationsSet'](_0x376c85);}catch(_0x419e18){return console['error'](_0x419e18),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2465d2,_0x1438ac=!0x1){this['editor']['model']['enqueueChange']('transparent',_0x24b4f5=>{for(const _0x1ecd84 of _0x2465d2)this['_knownOperations']['add'](_0x1ecd84),_0x24b4f5['batch']['addOperation'](_0x1ecd84),this['editor']['model']['applyOperation'](_0x1ecd84);});}['_setPendingAction'](){const {t:t}=this['editor']['locale'];this['_pendingAction']=this['editor']['plugins']['get'](_0x44fb06)['add'](t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'}));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x44fb06)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x181203){return this['_compressor']['compress'](_0x181203['map'](_0x448052=>_0x448052['toJSON']()));}['_decompressOperations'](_0x461fb9){return this['_compressor']['decompress'](_0x461fb9)['map'](_0x394f1e=>{const _0x2a2628=_0xe1526d['fromJSON'](_0x394f1e,this['_document']);return _0x2a2628['wasUndone']=_0x394f1e['wasUndone'],_0x2a2628;});}['_assignOperationAuthors'](_0x3dc927,_0x7f88cc){for(let _0x15c715=0x0;_0x15c715<_0x3dc927['length'];_0x15c715++)'init'!=_0x7f88cc[_0x15c715]['type']?_0x3dc927[_0x15c715]['_authorId']=_0x7f88cc[_0x15c715]['userId']:_0x3dc927[_0x15c715]['_authorId']=null;}}function q(_0x2d0bed,_0x2f8a9d){for(const _0x4a0018 of _0x2d0bed)_0x4a0018['baseVersion']=_0x2f8a9d++;}g['CollaborativeEditingService']=_0xd7ca13;
|
|
23
|
+
import{Plugin as _0x56c96e,PendingActions as _0x2843fc}from'ckeditor5/src/core';import{CKEditorError as _0x15b6a9,version as _0x2eb082,uid as _0x5b754a}from'ckeditor5/src/utils';import{transformSets as _0xa1539,InsertOperation as _0x3df190,MarkerOperation as _0x1926d7,OperationFactory as _0x316fca}from'ckeditor5/src/engine';import{Notification as _0x2c9415}from'ckeditor5/src/ui';import _0x12a04f from'@ckeditor/ckeditor5-engine/src/model/history';import _0x52a8a9 from'./websocketgateway';import _0xe950d2 from'./sessions';import _0x45499e from'./usermarkers';import _0x34772a from'@ckeditor/ckeditor5-collaboration-core/src/users';import _0x42cfc7 from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import _0x506c35 from'@ckeditor/ckeditor-cloud-services-collaboration/src/collaborativeeditingservice/collaborativeeditingservice';import _0x4ad998 from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';let tt=0x1;export default class g extends _0x56c96e{static get['requires'](){return[_0x52a8a9,_0xe950d2,_0x45499e,_0x2843fc,_0x34772a,_0x2c9415];}static get['pluginName'](){return'RealTimeCollaborationClient';}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){const _0x3456e5=this['serverHistory']['_operations'];return _0x3456e5['length']?_0x3456e5[_0x3456e5['length']-0x1]['baseVersion']+0x1-this['_offset']:0x0;}['init'](){const _0xc762ac=this['editor'],_0x5804cd=_0xc762ac['plugins']['get'](_0x34772a),_0x595544=_0xc762ac['plugins']['get'](_0x52a8a9);if(this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x12a04f(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=_0xc762ac['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x15b6a9('collaboration-missing-channelid',this);this['listenTo'](_0x5804cd,'getOperationAuthor',(_0x4c0450,_0x13f67a)=>{const _0x2f3aa9=_0x13f67a[0x0];_0x2f3aa9['_authorId']&&(_0x4c0450['return']=_0x5804cd['getUser'](_0x2f3aa9['_authorId']),_0x4c0450['stop']()),null===_0x2f3aa9['_authorId']&&(_0x4c0450['return']=null,_0x4c0450['stop']());},{'priority':'high'});const _0x438159=_0xc762ac['config']['get']('cloudServices.bundleVersion')||_0x2eb082;this['_service']=new g['CollaborativeEditingService'](_0x438159,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x42cfc7(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new et(this['_disconnectionOperations']),this['listenTo'](_0xc762ac['model']['document']['selection'],'change:range',(_0x1958c2,_0x2259fa)=>{_0x2259fa['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xc762ac['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xc762ac['plugins']['get'](_0x52a8a9)['addToReconnectionStack'](this),_0xc762ac['model']['on']('applyOperation',(_0xe0bf70,_0x5b96a4)=>{const _0x1ba1cb=_0x5b96a4[0x0];_0x1ba1cb['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1ba1cb),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['editor']['bind']('isReadOnly')['to'](_0x595544,'state',this,'_hasSynchronizationProblem',(_0x5c4c08,_0x33c080)=>'connected'!==_0x5c4c08||_0x33c080),this['set']('_isConnected',!0x1);}get['lastSyncVersion'](){const _0xda07a8=this['serverHistory']['_operations'];let _0x3a332e=_0xda07a8['length'];for(;_0x3a332e--;){const _0x489f6e=_0xda07a8[_0x3a332e];if(!this['_disconnectionOperations']['has'](_0x489f6e))return _0x489f6e['baseVersion']+0x1-this['_offset'];}return 0x0;}async['reconnect'](){const _0x82f862=this['editor']['plugins']['get'](_0xe950d2),_0x528715=this['editor']['plugins']['get'](_0x52a8a9);try{this['_isPendingUpdate']=!0x0,_0x82f862['unregister'](this['_channelId']);const _0x359e73=await this['_service']['reconnect'](_0x528715['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x359e73)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x14c0ed=await this['_service']['getConnectedSessions']();_0x82f862['register'](this['_channelId'],_0x14c0ed),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x37c6ca){if(function(_0x44d672){return'404'===_0x44d672['code'];}(_0x37c6ca)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1c94c9){return'409'===_0x1c94c9['code'];}(_0x37c6ca)){const _0x4dd205=(0x0,this['editor']['t'])('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x4dd205);}else{if(!(_0x37c6ca instanceof it))throw _0x37c6ca;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1880c4=this['editor']['plugins']['get'](_0x52a8a9),_0x4cba69=this['editor']['plugins']['get'](_0xe950d2);this['editor']['isReadOnly']=!0x0,_0x4cba69['channelSessions']['has'](this['_channelId'])&&_0x4cba69['unregister'](this['_channelId']),_0x1880c4['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x160202){if(this['sessionId']!==_0x160202['sessionId']&&this['_lastSyncedOperationId']!==_0x160202['lastOperationId'])throw new it();return this['sessionId']=_0x160202['sessionId'],this['_handleServerResponse']([],{..._0x160202,'wereChangesApplied':!0x1,'data':_0x160202['data']},'reconnect');}async['_connectService'](_0xf76ddf,_0x5da85a=!0x1){const {connection:_0x2cc672}=this['editor']['plugins']['get'](_0x52a8a9);g['CollaborativeEditingService']['getConnectedSessions'](_0x2cc672,this['_channelId'])['then'](_0x386004=>this['_initSessionsHandling'](_0x386004))['catch'](_0x4c3f77=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4c3f77);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x47100d,_0x5bd676)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x5bd676);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xdfa236=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xf76ddf),_0x2ef0f8=await this['_service']['connect'](_0x2cc672,this['_compressOperations'](_0xf76ddf),_0xdfa236);if(this['sessionId']=_0x2ef0f8['sessionId'],_0x2ef0f8['wereChangesApplied']&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']()),_0x5da85a){if(!_0x2ef0f8['wereChangesApplied'])return void this['_handleReconnectionError']();this['_offset']=_0x2ef0f8['offset'],this['serverHistory']['_operations']=[],await this['_handleServerResponse'](_0xf76ddf,_0x2ef0f8,'reconnection:\x20flushed\x20session');}else await this['_handleConnectionData'](_0x2ef0f8,_0xf76ddf);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1b02bf=this['editor']['plugins']['get'](_0xe950d2),_0x2c3152=_0x1b02bf['channelSessions']['get'](this['_channelId']);_0x2c3152&&_0x2c3152['length']>0x1?(this['_hasSelectionChanged']=!0x0,this['_sendBufferedOperationsDelayed']()):this['listenTo'](_0x1b02bf,'sessionAdd:'+this['_channelId'],_0x243666=>{_0x1b02bf['channelSessions']['get'](this['_channelId'])['length']>0x1&&(this['_hasSelectionChanged']=!0x0,this['_sendBufferedOperationsDelayed'](),_0x243666['off']());});}async['_handleReceivedOperations'](_0x2b15e5,_0x3efa12,_0x1e05b4,_0x1fe22c){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3efa12){const _0x180f3d=this['_decompressOperations'](_0x1e05b4,_0x1fe22c);await this['_fetchMissingUsers'](_0x180f3d),this['_handleExternalOperations'](_0x180f3d,_0x3efa12,_0x1e05b4['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const t=this['editor']['t'];let _0x949f25;try{_0x949f25=await this['_service']['getDocumentDetails']();}catch(_0x1b3148){const _0x312e5f=t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x312e5f);}const _0x4776d4=_0x949f25['currentDocumentSession']||_0x949f25['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x4776d4['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x176247=t('The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x176247);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelay']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x38eeb5){const _0x414f16=this['editor']['plugins']['get'](_0xe950d2);this['listenTo'](_0x414f16,'sessionAdd:'+this['_channelId'],(_0x12db9a,{session:_0xcb0bb4})=>{if(_0xcb0bb4['id']===_0x414f16['mySessionId']){_0x12db9a['off']();const _0x241d91=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x31e60c=_0xcb0bb4['permissions'];_0x241d91&&_0x241d91['isEnabled']&&(_0x31e60c=_0x31e60c['filter'](_0x4b0134=>'document:write'!==_0x4b0134)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x31e60c,this['_channelId']);}}),_0x414f16['register'](this['_channelId'],_0x38eeb5);}['_initThrowingOnDataSet'](){const _0x3ff369=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x29d350)=>{if(!_0x29d350[_0x29d350['length']-0x1]['suppressErrorInCollaboration'])throw new _0x15b6a9('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x3ff369['apply'](this['editor']['data'],_0x29d350);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1397c3,[_0x41f082])=>{if(this['_document']['version'])throw new _0x15b6a9('realtimecollaborationclient-init-document-already-initialized',this);_0x1397c3['stop'](),this['_setPendingAction']();const _0x892fe4=this['_getOperationsFromInitData'](_0x41f082);_0x1397c3['return']=this['_connectService'](_0x892fe4)['then'](()=>{this['editor']['data']['fire']('ready');})['catch'](_0x4d6133=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4d6133))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'});}['_fetchMissingUsers'](_0x335586){const _0x53e827=this['editor']['plugins']['get'](_0x34772a),{connection:_0x2f8533}=this['editor']['plugins']['get'](_0x52a8a9),_0x17e460=new Set();for(const _0x68cf07 of _0x335586)_0x39d047(_0x68cf07['_authorId']);return Promise['all'](Array['from'](_0x17e460,async _0x1969bf=>{const _0x3179d3=await _0x4ad998['get'](_0x2f8533,_0x1969bf);_0x53e827['getUser'](_0x1969bf)||_0x53e827['addUser'](_0x3179d3);}));function _0x39d047(_0x27dba7){_0x27dba7&&!_0x53e827['getUser'](_0x27dba7)&&_0x17e460['add'](_0x27dba7);}}['_getOperationsFromInitData'](_0x33a674){const _0x20fdb8=this['editor']['model'],_0x248c10=[];let _0x33dd5a=0x0;const _0x20a86f='string'==typeof _0x33a674?{'main':_0x33a674}:_0x33a674;for(const _0x5bf1f4 of Object['keys'](_0x20a86f)){if(!this['_document']['roots']['has'](_0x5bf1f4))throw new _0x15b6a9('realtimecollaborationclient-init-non-existent-root',this);const _0x409d9a=this['editor']['data']['parse'](_0x20a86f[_0x5bf1f4]),_0x35c69f=this['_document']['getRoot'](_0x5bf1f4),_0x3b4e30=new _0x3df190(_0x20fdb8['createPositionAt'](_0x35c69f,0x0),_0x409d9a,_0x33dd5a++);_0x248c10['push'](_0x3b4e30);for(const [_0x5eb217,_0x6a6e3a]of _0x409d9a['markers']){const _0x10cfdc=_0x20fdb8['createRange'](_0x20fdb8['createPositionFromPath'](_0x35c69f,_0x6a6e3a['start']['path']['slice']()),_0x20fdb8['createPositionFromPath'](_0x35c69f,_0x6a6e3a['end']['path']['slice']())),_0x5e5c85=new _0x1926d7(_0x5eb217,null,_0x10cfdc,_0x20fdb8['markers'],!0x0,_0x33dd5a++);_0x248c10['push'](_0x5e5c85);}}return _0x248c10;}async['_handleConnectionData'](_0x137a2b,_0x2ab233){let _0x466967;this['_offset']=_0x137a2b['offset'];const _0x3cb295=_0x137a2b['wereChangesApplied']&&!_0x137a2b['initData'];if(_0x3cb295)_0x466967=_0x2ab233;else{if(_0x137a2b['initData']){const _0x220656=this['_getOperationsFromInitData'](_0x137a2b['initData']);this['_document']['version']=-_0x220656['length'],_0x220656['forEach'](_0x307155=>{_0x307155['baseVersion']-=_0x220656['length'];}),this['_applyOperationsSet'](_0x220656,!0x0),this['_updateServerHistory'](_0x220656);}this['_document']['version']=_0x137a2b['data']['baseVersion'],_0x466967=this['_decompressOperations'](_0x137a2b['data'],_0x137a2b['metadata']),await this['_fetchMissingUsers'](_0x466967);}_0x137a2b['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x466967,_0x137a2b['lastOperationId']),this['_lastSyncedOperationId']=_0x137a2b['lastOperationId']),this['_applyOperationsSet'](_0x466967,_0x3cb295),this['_updateServerHistory'](_0x466967);}['_crash'](_0x1681eb,_0x3f09e6){throw this['_isPendingUpdate']=!0x0,_0x3f09e6&&console['error'](_0x3f09e6),new _0x15b6a9(_0x1681eb,this['editor']);}['_saveOperationInBuffer'](_0x20722a){this['_knownOperations']['has'](_0x20722a)||(this['_knownOperations']['add'](_0x20722a),this['_bufferedOperations']['push'](_0x20722a),this['_pendingAction']||'marker'==_0x20722a['type']&&!_0x20722a['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x76e1a1=!0x1){!_0x76e1a1&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3d531c=>{_0x3d531c&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x13c298=>{throw this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,_0x13c298;});},this['_currentBufferDelay']));}async['_sendBufferedOperations'](){const _0x399e89=this['editor']['plugins']['get'](_0x45499e);if(this['_shouldSendSelectionUpdate']()&&(_0x399e89['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x449929=[...this['_bufferedOperations']];for(const _0x22e5a1 of _0x449929)_0x22e5a1['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x22e5a1);const _0x70bd96=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x449929),_0x55a9b6=tt++,_0x1623ef=this['_compressOperations'](_0x449929),_0x5271b3=await this['_service']['sendOperations'](_0x1623ef,_0x1623ef['baseVersion'],_0x70bd96);try{return await this['_handleServerResponse'](_0x449929,_0x5271b3,_0x55a9b6);}catch(_0x4e6cf0){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4e6cf0);}}async['_handleServerResponse'](_0x7577f6,_0xec86e2,_0x4edebd){if(_0xec86e2['error'])throw _0xec86e2['error'];let _0x3aafb3=!0x1;if(_0xec86e2['wereChangesApplied'])this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2f01c3=>!_0x7577f6['includes'](_0x2f01c3)),this['_lastSyncedOperationId']=_0xec86e2['lastOperationId'],this['_updateServerHistory'](_0x7577f6),_0x3aafb3=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];else{const _0x4a196a=this['_decompressOperations'](_0xec86e2['data'],_0xec86e2['metadata'])['filter'](_0x43422e=>_0x43422e['baseVersion']>=this['_lastServerVersion']);await this['_fetchMissingUsers'](_0x4a196a),_0x3aafb3=this['_handleExternalOperations'](_0x4a196a,_0xec86e2['version'],_0xec86e2['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x3aafb3?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1a7034,_0x3d1203,_0x3d9ca3){try{const _0x6d46d9={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2ee2ae,operationsB:_0x565358,originalOperations:_0xf2c6b6}=_0xa1539(_0x1a7034,this['_bufferedOperations'],_0x6d46d9);st(_0x2ee2ae,this['_document']['version']),st(_0x565358,_0x3d1203);for(const _0x46c2f8 of _0x2ee2ae){const _0x577258=_0xf2c6b6['get'](_0x46c2f8);_0x46c2f8['_authorId']=_0x577258?_0x577258['_authorId']:null;}this['_lastSyncedOperationId']=_0x3d9ca3,this['_operationIdentifier']['setIdForTheLastOperation'](_0x1a7034,_0x3d9ca3),this['_bufferedOperations']=[..._0x565358],this['_applyOperationsSet'](_0x2ee2ae),this['_updateServerHistory'](_0x1a7034);}catch(_0xe27bde){return console['error'](_0xe27bde),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4693ad,_0x53f240=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x188d00=>{for(const _0x319640 of _0x4693ad)this['_knownOperations']['add'](_0x319640),_0x188d00['batch']['addOperation'](_0x319640),this['editor']['model']['applyOperation'](_0x319640);});}['_updateServerHistory'](_0x2bb222){_0x2bb222['forEach'](_0x389177=>{const _0x29a584=_0x389177['clone']();_0x29a584['_authorId']=_0x389177['_authorId'],_0x29a584['baseVersion']+=this['_offset'],_0x389177['isDisconnection']&&this['_disconnectionOperations']['add'](_0x29a584),this['serverHistory']['addOperation'](_0x29a584);});}['_handleReconnectionError'](_0x368f7e){const _0x175649=this['editor']['plugins']['get']('Notification'),t=this['editor']['t'];_0x368f7e||(_0x368f7e=t('The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x175649['showWarning'](_0x368f7e,{'title':t('Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](_0x52a8a9)['destroy']();}['_setPendingAction'](){if(!this['_pendingAction']){const {t:t}=this['editor']['locale'];this['_pendingAction']=this['editor']['plugins']['get'](_0x2843fc)['add'](t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'}));}}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2843fc)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x481a64){const _0x579657=_0x481a64['map'](_0x3a41c2=>_0x3a41c2['toJSON']());return this['_compressor']['compress'](_0x579657);}['_decompressOperations'](_0x5cd4df,_0x39a96f){const _0x25a394=this['_compressor']['decompress'](_0x5cd4df)['map']((_0x4007ba,_0x119ef8)=>{const _0x3f79c6=_0x316fca['fromJSON'](_0x4007ba,this['_document']);return _0x3f79c6['wasUndone']=_0x4007ba['wasUndone'],'cs:removeUser'===_0x39a96f[_0x119ef8]['type']&&(_0x3f79c6['isDisconnection']=!0x0),_0x3f79c6;});return this['_assignOperationAuthors'](_0x25a394,_0x39a96f),_0x25a394;}['_assignOperationAuthors'](_0x26e0a1,_0x2559bf){for(let _0x822252=0x0;_0x822252<_0x26e0a1['length'];_0x822252++)'init'!=_0x2559bf[_0x822252]['type']?_0x26e0a1[_0x822252]['_authorId']=_0x2559bf[_0x822252]['userId']:_0x26e0a1[_0x822252]['_authorId']=null;}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()&&this['_sendBufferedOperationsDelayed']();}['_shouldSendSelectionUpdate'](){const _0x47d47c=this['editor']['plugins']['get'](_0xe950d2)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&_0x47d47c&&_0x47d47c['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class it extends Error{}function st(_0x452574,_0x45b71a){for(const _0x53f9f1 of _0x452574)_0x53f9f1['baseVersion']=_0x45b71a++;}g['CollaborativeEditingService']=_0x506c35;class et{constructor(_0x3bf329){this['_ignoredOperations']=_0x3bf329,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x422b31){let _0x12d8c0=_0x422b31['length'];for(;_0x12d8c0--;){const _0x405fed=_0x422b31[_0x12d8c0];if(!this['_ignoredOperations']['has'](_0x405fed)){if(!this['_operationToId']['has'](_0x405fed)){const _0x479a18=_0x5b754a()['slice'](0x1,0x12);this['_operationToId']['set'](_0x405fed,_0x479a18);}return this['_operationToId']['get'](_0x405fed);}}}['setIdForTheLastOperation'](_0x406a58,_0x3d442a){if(!_0x3d442a)return;let _0x5b65ea=_0x406a58['length'];for(;_0x5b65ea--;){const _0x39c123=_0x406a58[_0x5b65ea];this['_ignoredOperations']['has'](_0x39c123)||this['_operationToId']['set'](_0x39c123,_0x3d442a);}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3a89=['clear','plugins','_uniqueUsersCount','_registeredSessions','forEach','channelSessions','get','_createUser','remove','allConnectedUsers','size','connection','fire','_handleSessionRemove','register','sessions-register-already-registered','defineMe','stopListening','_users','mySessionId','orderNumber','add','delete','getUser','sessionId','context','sessions-unregister-not-exist','unregister','getUserBySessionId','pluginName','addUser','listenTo','values','connected','set','user','channelConnectedUsers','state','has','requires','getUserSessions','_handleSessionAdd'];(function(_0x5d0a60,_0x3a89c6){const _0x4f4b73=function(_0xa257e8){while(--_0xa257e8){_0x5d0a60['push'](_0x5d0a60['shift']());}};_0x4f4b73(++_0x3a89c6);}(_0x3a89,0x1eb));const _0x4f4b=function(_0x5d0a60,_0x3a89c6){_0x5d0a60=_0x5d0a60-0x0;let _0x4f4b73=_0x3a89[_0x5d0a60];return _0x4f4b73;};import{ContextPlugin as _0x15a1e2}from'ckeditor5/src/core';import{Collection as _0x1a03e5,CKEditorError as _0x2ce95d}from'ckeditor5/src/utils';import _0x20a267 from'./websocketgateway';import _0x4ee6a4 from'@ckeditor/ckeditor5-collaboration-core/src/users';export default class r extends _0x15a1e2{static get[_0x4f4b('0x0')](){return'Sessions';}static get[_0x4f4b('0xa')](){return[_0x20a267,_0x4ee6a4];}['init'](){const _0xb9c39b=this[_0x4f4b('0x26')],_0x5a3e08=_0xb9c39b[_0x4f4b('0xe')][_0x4f4b('0x13')](_0x20a267);this[_0x4f4b('0x12')]=new Map(),this[_0x4f4b('0x7')]=new Map(),this[_0x4f4b('0x16')]=new _0x1a03e5(),this[_0x4f4b('0x10')]=new Map(),this[_0x4f4b('0xf')]=0x0,this['_users']=_0xb9c39b[_0x4f4b('0xe')][_0x4f4b('0x13')](_0x4ee6a4),this[_0x4f4b('0x2')](_0x5a3e08,'change:state',(_0x372f5d,_0x27cae3,_0x2de02f)=>{if(_0x4f4b('0x4')!==_0x2de02f)this[_0x4f4b('0x12')][_0x4f4b('0x11')](_0x4d965e=>_0x4d965e[_0x4f4b('0xd')]()),this[_0x4f4b('0x7')][_0x4f4b('0x11')](_0x13f9c1=>_0x13f9c1[_0x4f4b('0xd')]()),this[_0x4f4b('0x16')][_0x4f4b('0xd')]();else for(const [_0x1c630c,_0x1deaba]of this['_registeredSessions'])for(const _0x6c52f7 of _0x1deaba)this[_0x4f4b('0xc')](_0x1c630c,_0x6c52f7);}),this[_0x4f4b('0x14')](_0x5a3e08[_0x4f4b('0x18')]['me'],!0x0);}[_0x4f4b('0x1b')](_0x519c05,_0xe4440){if(this['_registeredSessions'][_0x4f4b('0x9')](_0x519c05))throw new _0x2ce95d(_0x4f4b('0x1c'),null,{'channelId':_0x519c05});this[_0x4f4b('0x10')][_0x4f4b('0x5')](_0x519c05,_0xe4440),this['channelSessions'][_0x4f4b('0x5')](_0x519c05,new _0x1a03e5()),this[_0x4f4b('0x7')][_0x4f4b('0x5')](_0x519c05,new _0x1a03e5()),this[_0x4f4b('0x2')](_0xe4440,_0x4f4b('0x22'),(_0x2ad13e,_0x42906f)=>this[_0x4f4b('0xc')](_0x519c05,_0x42906f)),this[_0x4f4b('0x2')](_0xe4440,_0x4f4b('0x15'),(_0x4bd65e,_0x3bff19)=>this[_0x4f4b('0x1a')](_0x519c05,_0x3bff19));for(const _0x900013 of _0xe4440)this[_0x4f4b('0xc')](_0x519c05,_0x900013);}[_0x4f4b('0x28')](_0x2256d9){if(!this[_0x4f4b('0x10')]['has'](_0x2256d9))throw new _0x2ce95d(_0x4f4b('0x27'),null,{'channelId':_0x2256d9});const _0x1cda2a=this['_registeredSessions'][_0x4f4b('0x13')](_0x2256d9);this[_0x4f4b('0x1e')](_0x1cda2a);for(const _0x3c8eab of _0x1cda2a)_0x4f4b('0x4')===this[_0x4f4b('0x26')][_0x4f4b('0xe')][_0x4f4b('0x13')](_0x20a267)[_0x4f4b('0x8')]&&this[_0x4f4b('0x1a')](_0x2256d9,_0x3c8eab);this[_0x4f4b('0x10')][_0x4f4b('0x23')](_0x2256d9),this['channelSessions']['delete'](_0x2256d9),this[_0x4f4b('0x7')]['delete'](_0x2256d9);}get[_0x4f4b('0x20')](){return this[_0x4f4b('0x26')]['plugins'][_0x4f4b('0x13')](_0x20a267)['connection'][_0x4f4b('0x25')];}[_0x4f4b('0x29')](_0x64fc45){for(const _0x5491a5 of this[_0x4f4b('0x12')]['values']())for(const _0x5674c7 of _0x5491a5)if(_0x5674c7['id']===_0x64fc45)return _0x5674c7[_0x4f4b('0x6')];}[_0x4f4b('0xb')](_0x4583c1,_0x7155af){const _0x32e20a=_0x7155af?[this[_0x4f4b('0x12')][_0x4f4b('0x13')](_0x7155af)]:this[_0x4f4b('0x12')][_0x4f4b('0x3')](),_0x401943=new Set();for(const _0x34ee40 of _0x32e20a)for(const _0x9d0849 of _0x34ee40)_0x9d0849[_0x4f4b('0x6')]['id']===_0x4583c1['id']&&_0x401943['add'](_0x9d0849['id']);return _0x401943;}['getUserRole'](_0x5ebefe){for(const _0x54a762 of this['channelSessions'][_0x4f4b('0x3')]())for(const _0x2b6ff0 of _0x54a762)if(_0x2b6ff0[_0x4f4b('0x6')]===_0x5ebefe)return _0x2b6ff0['role'];}[_0x4f4b('0xc')](_0x5decd0,_0x11c490){if(_0x4f4b('0x4')!==this['context'][_0x4f4b('0xe')][_0x4f4b('0x13')](_0x20a267)[_0x4f4b('0x8')])return;const _0x21e888=_0x11c490[_0x4f4b('0x6')],_0x280f78=this['_users'][_0x4f4b('0x24')](_0x21e888['id'])||this['_createUser'](_0x21e888),_0x44e81f=Object['assign']({},_0x11c490,{'user':_0x280f78});this[_0x4f4b('0x12')][_0x4f4b('0x13')](_0x5decd0)['add'](_0x44e81f);const _0x427279=this[_0x4f4b('0x7')][_0x4f4b('0x13')](_0x5decd0);_0x427279[_0x4f4b('0x9')](_0x280f78['id'])||_0x427279[_0x4f4b('0x22')](_0x280f78),this[_0x4f4b('0x16')][_0x4f4b('0x9')](_0x280f78['id'])||this[_0x4f4b('0x16')][_0x4f4b('0x22')](_0x280f78),this[_0x4f4b('0x19')]('sessionAdd:'+_0x5decd0,{'channelId':_0x5decd0,'session':_0x44e81f});}[_0x4f4b('0x1a')](_0x22aca8,_0x4bf6){if(_0x4f4b('0x4')!==this[_0x4f4b('0x26')][_0x4f4b('0xe')][_0x4f4b('0x13')](_0x20a267)[_0x4f4b('0x8')])return;const _0x32b5f=this['channelConnectedUsers']['get'](_0x22aca8),_0x10a238=_0x4bf6[_0x4f4b('0x6')];this[_0x4f4b('0x12')][_0x4f4b('0x13')](_0x22aca8)['remove'](_0x4bf6['id']),_0x32b5f['has'](_0x10a238['id'])&&!this['getUserSessions'](_0x10a238,_0x22aca8)[_0x4f4b('0x17')]&&_0x32b5f[_0x4f4b('0x15')](_0x10a238['id']),this[_0x4f4b('0x16')][_0x4f4b('0x13')](_0x10a238['id'])&&!this['getUserSessions'](_0x10a238)[_0x4f4b('0x17')]&&this[_0x4f4b('0x16')]['remove'](_0x10a238['id']);}[_0x4f4b('0x14')](_0x1da6a3,_0x38a588){const _0x313482=this[_0x4f4b('0x1f')][_0x4f4b('0x1')](_0x1da6a3);return _0x38a588&&this[_0x4f4b('0x1f')][_0x4f4b('0x1d')](_0x1da6a3['id']),_0x313482[_0x4f4b('0x21')]=this[_0x4f4b('0xf')]++,_0x313482;}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1ef3=['clear','editor','has','undo','getAttribute','getCustomProperty','color','markerToElement','afterInit','hasDomSelection','for','change:range','editingDowncast','createRange','$graveyard','$text','getUserBySessionId','render','commands','checkChild','ck-user__selection','user:range','selection','createUserMarkerOperations','getFirstRange','update:user:range','view','getSelectionClass','change','_createdBatches','detach','setCustomProperty','deletionPosition','element','isCollapsed','addMarker','get','pluginName','isObject','start','orderNumber','schema','updateMarker','getNearestSelectionRange','isSimilar','name','user:range:','contenteditable','isInline','parent','isLimit','markers','markerRange','editing','mySessionId','model','oldRange','innerHTML','document','newRange','getStart','getMarkerClass','delete','size','enqueueChange','getRange','applyOperation','plugins','userPositionMarker','rootName','removeMarker','nodeAfter','markerName','tableCell','hasContent','init','conversion','highest','end','batch','createUIElement','root','split'];(function(_0x3ef211,_0x1ef3eb){const _0x2cf7f3=function(_0x591cbe){while(--_0x591cbe){_0x3ef211['push'](_0x3ef211['shift']());}};_0x2cf7f3(++_0x1ef3eb);}(_0x1ef3,0x74));const _0x2cf7=function(_0x3ef211,_0x1ef3eb){_0x3ef211=_0x3ef211-0x0;let _0x2cf7f3=_0x1ef3[_0x3ef211];return _0x2cf7f3;};import{Plugin as _0x53755a}from'ckeditor5/src/core';import _0x1e0f0e from'./sessions';import{LiveRange as _0x18ae74}from'ckeditor5/src/engine';import'../../theme/usermarkers.css';export default class Y extends _0x53755a{static get['requires'](){return[_0x1e0f0e];}static get[_0x2cf7('0x4')](){return'UserMarkers';}[_0x2cf7('0x2a')](){const _0x23afaf=this[_0x2cf7('0x33')],_0x25398d=_0x23afaf[_0x2cf7('0x22')][_0x2cf7('0x3')](_0x1e0f0e);_0x23afaf[_0x2cf7('0x2b')][_0x2cf7('0x3c')](_0x2cf7('0x3e'))[_0x2cf7('0x39')]({'model':'user:position','view':(_0xe96155,{writer:_0x626e94})=>function(_0x58e44f,_0x5499b1,_0x32a2e6,_0x2e01e4){const _0x5ddd9d=_0x58e44f[_0x2cf7('0x27')][_0x2cf7('0x31')](':')[0x2],_0x49549f=_0x32a2e6[_0x2cf7('0x42')](_0x5ddd9d);if(!_0x49549f||_0x5ddd9d===_0x32a2e6['mySessionId'])return;if(!_0x2e01e4['model']['schema'][_0x2cf7('0x45')](_0x58e44f[_0x2cf7('0x13')][_0x2cf7('0x6')],'$text'))return;const _0x29e8cc={'class':'ck-user__marker\x20'+_0x49549f[_0x2cf7('0x38')][_0x2cf7('0x1c')](),'data-name':_0x49549f[_0x2cf7('0xc')],'data-session-id':_0x5ddd9d},_0x2e7c24=_0x2e01e4[_0x2cf7('0x16')][_0x2cf7('0x12')][_0x2cf7('0x3')](_0x58e44f[_0x2cf7('0x27')])[_0x2cf7('0x1b')](),_0x3e88a7=_0x2e7c24[_0x2cf7('0x26')],_0x3d2cc1=_0x2e01e4[_0x2cf7('0x16')][_0x2cf7('0x8')];if(_0x3e88a7&&_0x3d2cc1[_0x2cf7('0x5')](_0x3e88a7)&&_0x3d2cc1[_0x2cf7('0xf')](_0x3e88a7)&&!_0x2e01e4[_0x2cf7('0x16')][_0x2cf7('0x12')][_0x2cf7('0x3')](_0x2cf7('0xd')+_0x5ddd9d)[_0x2cf7('0x20')]()[_0x2cf7('0x1')])return;const _0x5cdf33=_0x2e7c24[_0x2cf7('0x10')];_0x2e01e4[_0x2cf7('0x16')][_0x2cf7('0x8')][_0x2cf7('0x11')](_0x5cdf33)&&!_0x2e01e4['model'][_0x2cf7('0x29')](_0x5cdf33)&&(_0x29e8cc[_0x2cf7('0xe')]=!0x1);const _0x4f8859=function(_0x22bd5a,_0x21713f){const _0x1e5764=_0x22bd5a[_0x2cf7('0x2f')]('span',_0x21713f);return _0x22bd5a[_0x2cf7('0x51')]('userPositionMarker',!0x0,_0x1e5764),_0x1e5764[_0x2cf7('0x43')]=function(_0x28ca68){const _0x4fc498=this['toDomElement'](_0x28ca68);return _0x4fc498[_0x2cf7('0x18')]='​<span\x20class=\x22ck-user__marker-line\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>',_0x4fc498;},_0x1e5764[_0x2cf7('0xb')]=function(_0x5b2df0){return this['getCustomProperty'](_0x2cf7('0x23'))&&_0x5b2df0[_0x2cf7('0x37')](_0x2cf7('0x23'))&&this[_0x2cf7('0x36')]('data-session-id')==_0x5b2df0[_0x2cf7('0x36')]('data-session-id');},_0x1e5764;}(_0x5499b1,_0x29e8cc);return _0x4f8859['priority']=0x3e8+_0x49549f[_0x2cf7('0x7')],_0x4f8859;}(_0xe96155,_0x626e94,_0x25398d,_0x23afaf)}),_0x23afaf['conversion']['for'](_0x2cf7('0x3e'))['markerToHighlight']({'model':_0x2cf7('0x47'),'view':_0x20da33=>function(_0x2afad8,_0x128a3d){const _0x590c2c=_0x2afad8[_0x2cf7('0x27')][_0x2cf7('0x31')](':')[0x2];if(_0x590c2c===_0x128a3d[_0x2cf7('0x15')])return;const _0x5523dc=_0x128a3d[_0x2cf7('0x42')](_0x590c2c);if(!_0x5523dc)return{'id':_0x590c2c};return{'id':_0x590c2c,'classes':[_0x2cf7('0x46'),_0x5523dc[_0x2cf7('0x38')][_0x2cf7('0x4d')]()],'attributes':{'data-session-id':_0x590c2c},'priority':0x7d0+_0x5523dc[_0x2cf7('0x7')]};}(_0x20da33,_0x25398d)}),function(_0x3baf9b){const _0xa4e061=_0x3baf9b[_0x2cf7('0x16')],_0x1b1ebe=new Map(),_0x112964=_0x3baf9b[_0x2cf7('0x22')][_0x2cf7('0x3')](_0x1e0f0e);_0xa4e061[_0x2cf7('0x12')]['on'](_0x2cf7('0x4b'),(_0x138393,_0x346de9,_0x178890,_0x3ae86e)=>{if(!_0x3ae86e&&_0x1b1ebe['get'](_0x346de9[_0x2cf7('0xc')]))return _0x1b1ebe[_0x2cf7('0x3')](_0x346de9[_0x2cf7('0xc')])[_0x2cf7('0x50')](),void _0x1b1ebe[_0x2cf7('0x1d')](_0x346de9[_0x2cf7('0xc')]);const _0x59333b=_0x346de9[_0x2cf7('0xc')][_0x2cf7('0x31')](':')[0x2];if(_0x59333b===_0x112964[_0x2cf7('0x15')])return;const _0x3c7523='user:position:'+_0x59333b;_0xa4e061['markers'][_0x2cf7('0x34')](_0x3c7523)&&_0xa4e061[_0x2cf7('0x4e')](_0x52a7cf=>_0x52a7cf[_0x2cf7('0x9')](_0x3c7523)),_0x346de9['on'](_0x2cf7('0x3d'),(_0x39024a,_0x10ca35,_0x45b49e)=>{if(_0x2cf7('0x40')!=_0x10ca35[_0x2cf7('0x30')]['rootName']&&_0x2cf7('0x40')==_0x346de9[_0x2cf7('0x20')]()[_0x2cf7('0x30')][_0x2cf7('0x24')]&&!_0x1b1ebe[_0x2cf7('0x34')](_0x346de9['name'])){const _0x3b43fa=_0xa4e061[_0x2cf7('0x8')][_0x2cf7('0xa')](_0x45b49e[_0x2cf7('0x52')]);if(_0x3b43fa){const _0x2b0763=_0x18ae74['fromRange'](_0x3b43fa);_0x1b1ebe['set'](_0x346de9[_0x2cf7('0xc')],_0x2b0763),_0x2b0763['on'](_0x2cf7('0x3d'),(_0x3e14cb,_0x40b3c8,_0x194be5)=>{if(_0x2cf7('0x40')==_0x2b0763[_0x2cf7('0x30')][_0x2cf7('0x24')]){const _0x42e86c=_0xa4e061[_0x2cf7('0x8')]['getNearestSelectionRange'](_0x194be5[_0x2cf7('0x52')]);_0x42e86c?(_0x2b0763['start']=_0x42e86c[_0x2cf7('0x6')],_0x2b0763[_0x2cf7('0x2d')]=_0x42e86c['end']):(_0x1b1ebe[_0x2cf7('0x1d')](_0x346de9['name']),_0x2b0763[_0x2cf7('0x50')]());}});}}});}),_0xa4e061[_0x2cf7('0x19')]['on']('change',()=>{_0x1b1ebe[_0x2cf7('0x1e')]>0x0&&_0xa4e061[_0x2cf7('0x1f')]({'isUndoable':!0x1},_0x5a01a3=>{for(const [_0x4c6cf9,_0x46f88d]of _0x1b1ebe)_0x2cf7('0x40')==_0xa4e061[_0x2cf7('0x12')][_0x2cf7('0x3')](_0x4c6cf9)[_0x2cf7('0x20')]()[_0x2cf7('0x30')][_0x2cf7('0x24')]&&(re(_0x4c6cf9[_0x2cf7('0x31')](':')[0x2],_0x46f88d['toRange'](),_0xa4e061,_0x5a01a3),_0x46f88d['detach']());_0x1b1ebe[_0x2cf7('0x32')]();});});}(_0x23afaf);}[_0x2cf7('0x3a')](){const _0xa93903=this['editor'],_0x330055=_0xa93903[_0x2cf7('0x44')]['get'](_0x2cf7('0x35'));_0x330055&&_0xa93903[_0x2cf7('0x16')]['on'](_0x2cf7('0x21'),(_0x5534c5,_0x55a96d)=>{const _0x41c557=_0x55a96d[0x0];if('marker'!=_0x41c557['type']||!_0x41c557[_0x2cf7('0xc')]['startsWith']('user:'))return;const _0x3a28a3=_0x41c557[_0x2cf7('0x2e')];_0x330055[_0x2cf7('0x4f')][_0x2cf7('0x34')](_0x3a28a3)&&(_0x41c557[_0x2cf7('0x1a')]=_0x41c557['oldRange']?_0xa93903[_0x2cf7('0x16')][_0x2cf7('0x3f')](_0x41c557[_0x2cf7('0x17')][_0x2cf7('0x6')],_0x41c557[_0x2cf7('0x17')][_0x2cf7('0x2d')]):null);},{'priority':_0x2cf7('0x2c')});}[_0x2cf7('0x49')](){const _0x1ffd9a=this[_0x2cf7('0x33')],_0x2e3c7b=_0x1ffd9a[_0x2cf7('0x16')][_0x2cf7('0x19')],_0x1a6d5b=_0x1ffd9a[_0x2cf7('0x22')][_0x2cf7('0x3')](_0x1e0f0e);_0x1ffd9a[_0x2cf7('0x16')][_0x2cf7('0x1f')]({'isUndoable':!0x1},_0x370937=>{const _0x22dc9f=_0x2cf7('0xd')+_0x1a6d5b[_0x2cf7('0x15')],_0x18518d='user:position:'+_0x1a6d5b[_0x2cf7('0x15')],_0x470fec=_0x1ffd9a[_0x2cf7('0x16')]['markers'][_0x2cf7('0x34')](_0x22dc9f);_0x1ffd9a[_0x2cf7('0x14')][_0x2cf7('0x4c')][_0x2cf7('0x3b')]?re(_0x1a6d5b[_0x2cf7('0x15')],_0x2e3c7b[_0x2cf7('0x48')][_0x2cf7('0x4a')](),_0x1ffd9a['model'],_0x370937):_0x470fec&&(_0x370937[_0x2cf7('0x25')](_0x22dc9f),_0x370937[_0x2cf7('0x25')](_0x18518d));});}}function re(_0x540b23,_0x42ba54,_0x5b7830,_0x5ac110){const _0x5484e0=_0x2cf7('0xd')+_0x540b23,_0xf8268d='user:position:'+_0x540b23,_0x2b5bd6=_0x42ba54['getContainedElement']();let _0x33daae=_0x42ba54[_0x2cf7('0x6')];_0x2b5bd6&&_0x2b5bd6['is'](_0x2cf7('0x0'),_0x2cf7('0x28'))&&(_0x33daae=function(_0x170d2e,_0x829d5f){for(const _0x822f0b of _0x170d2e['getPositions']())if(_0x829d5f[_0x2cf7('0x8')][_0x2cf7('0x45')](_0x822f0b,_0x2cf7('0x41')))return _0x822f0b;}(_0x42ba54,_0x5b7830),_0x42ba54=_0x5ac110[_0x2cf7('0x3f')](_0x33daae)),_0x33daae=_0x5ac110['createRange'](_0x33daae),_0x5b7830[_0x2cf7('0x12')]['has'](_0x5484e0)?(_0x5ac110[_0x2cf7('0x9')](_0x5484e0,{'range':_0x42ba54}),_0x5ac110[_0x2cf7('0x9')](_0xf8268d,{'range':_0x33daae})):(_0x5ac110['addMarker'](_0x5484e0,{'range':_0x42ba54,'usingOperation':!0x0}),_0x5ac110[_0x2cf7('0x2')](_0xf8268d,{'range':_0x33daae,'usingOperation':!0x0}));}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xbe37=['all','init','add','catch','connect','webSocketUrl','The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.','get','has','_isBrowserOffline','online','connecting','pluginName','delete','connection','showWarning','websocketgateway-missing-websocket-url','destroy','removeFromReconnectionStack','constructor','_reconnectionStack','reconnect','cloudservices-reconnection-error','state','set','plugins','initialReconnectionInterval','then','bind','context','_domEmitter','error','_reconnect','connected','from','websocketgateway-invalid-plugin-interface','token','Connected\x20users\x20limit\x20exceeded','real-time-collaboration','listenTo','function','create','limitExceeded','disconnected','_shouldPluginsReconnect','isInReconnectionStack','code'];(function(_0x4de758,_0xbe372){const _0x16e49a=function(_0x119529){while(--_0x119529){_0x4de758['push'](_0x4de758['shift']());}};_0x16e49a(++_0xbe372);}(_0xbe37,0x1ab));const _0x16e4=function(_0x4de758,_0xbe372){_0x4de758=_0x4de758-0x0;let _0x16e49a=_0xbe37[_0x4de758];return _0x16e49a;};import{ContextPlugin as _0x1effc7}from'ckeditor5/src/core';import{DomEmitterMixin as _0x49419a,CKEditorError as _0x529c1b}from'ckeditor5/src/utils';import _0xc2cfed from'@ckeditor/ckeditor-cloud-services-collaboration/src/websocketgateway/websocketgateway';import _0x457ba6 from'@ckeditor/ckeditor5-cloud-services/src/cloudservices';import{Notification as _0x5c7e05}from'ckeditor5/src/ui';export default class d extends _0x1effc7{static get['requires'](){return[_0x457ba6,_0x5c7e05];}static get['pluginName'](){return'WebSocketGateway';}[_0x16e4('0x2c')](){const _0x10aec0=this[_0x16e4('0x19')],_0x496d0a=_0x10aec0[_0x16e4('0x15')][_0x16e4('0x3')](_0x457ba6),_0x23e0d8=_0x10aec0[_0x16e4('0x15')][_0x16e4('0x3')](_0x5c7e05);if(!_0x496d0a[_0x16e4('0x20')])throw new _0x529c1b('websocketgateway-missing-token',this);if(!_0x496d0a[_0x16e4('0x1')])throw new _0x529c1b(_0x16e4('0xc'),this);return this[_0x16e4('0x14')](_0x16e4('0x13'),'connecting'),this[_0x16e4('0x14')](_0x16e4('0x5'),!0x1),this[_0x16e4('0x10')]=new Set(),this[_0x16e4('0x28')]=!0x1,this[_0x16e4('0x1a')]=Object[_0x16e4('0x25')](_0x49419a),this[_0x16e4('0x1a')][_0x16e4('0x23')](window,'offline',()=>this[_0x16e4('0x5')]=!0x0),this[_0x16e4('0x1a')][_0x16e4('0x23')](window,_0x16e4('0x6'),()=>this[_0x16e4('0x5')]=!0x1),d['WebSocketGateway'][_0x16e4('0x0')](_0x496d0a[_0x16e4('0x20')],_0x496d0a[_0x16e4('0x1')],{'disconnectOnUnload':!0x1})[_0x16e4('0x17')](_0x4974de=>{if(this[_0x16e4('0xa')]=_0x4974de,this[_0x16e4('0x18')](_0x16e4('0x13'))['to'](_0x4974de,_0x16e4('0x13'),this,_0x16e4('0x5'),(_0xe41da7,_0x25343e)=>(_0x16e4('0x1d')!==_0xe41da7&&(this[_0x16e4('0x28')]=!0x0),_0x25343e||'connected'!==_0xe41da7?_0x16e4('0x27'):_0x16e4('0x27')==this['state']&&this[_0x16e4('0x28')]?(this[_0x16e4('0x28')]=!0x1,this[_0x16e4('0x1c')](),_0x16e4('0x7')):_0x16e4('0x1d'))),this[_0x16e4('0xa')]['on']('error',(_0x49c2f8,_0x3e65d8)=>{if(_0x16e4('0x26')!==_0x3e65d8[_0x16e4('0x2a')])throw console[_0x16e4('0x1b')](_0x3e65d8),new _0x529c1b('cloudservices-init',null,{'originalError':_0x3e65d8});_0x23e0d8[_0x16e4('0xb')](_0x16e4('0x2'),{'title':_0x16e4('0x21'),'namespace':_0x16e4('0x22')});}),!_0x4974de['me'])return new Promise(_0x20a0b9=>_0x4974de['on']('change:me',_0x20a0b9));})[_0x16e4('0x2e')](_0x43a1a5=>{throw console[_0x16e4('0x1b')](_0x43a1a5),new _0x529c1b('cloudservices-init',null,{'originalError':_0x43a1a5});});}['addToReconnectionStack'](_0x21e2bf){if(_0x16e4('0x24')!=typeof _0x21e2bf[_0x16e4('0x11')])throw new _0x529c1b(_0x16e4('0x1f'),this);if(this['isInReconnectionStack'](_0x21e2bf))throw new _0x529c1b('websocketgateway-plugin-already-registered',this,{'name':_0x21e2bf[_0x16e4('0xf')][_0x16e4('0x8')]});this[_0x16e4('0x10')][_0x16e4('0x2d')](_0x21e2bf);}[_0x16e4('0xe')](_0x441f21){this[_0x16e4('0x10')][_0x16e4('0x9')](_0x441f21);}[_0x16e4('0x29')](_0x206f12){return this['_reconnectionStack'][_0x16e4('0x4')](_0x206f12);}['_reconnect'](){return this[_0x16e4('0xa')]['reconnect']()[_0x16e4('0x17')](()=>Promise[_0x16e4('0x2b')](Array[_0x16e4('0x1e')](this[_0x16e4('0x10')],_0x1d27be=>_0x1d27be['reconnect']())))['then'](()=>this['state']='connected')[_0x16e4('0x2e')](_0x238f3d=>{throw console[_0x16e4('0x1b')](_0x238f3d),new _0x529c1b(_0x16e4('0x12'),this[_0x16e4('0x19')]);});}[_0x16e4('0xd')](){this[_0x16e4('0xa')]&&this[_0x16e4('0xa')]['disconnect'](),this[_0x16e4('0x13')]=_0x16e4('0x27'),this[_0x16e4('0x1a')]['stopListening'](),super[_0x16e4('0xd')]();}}d['WebSocketGateway']=_0xc2cfed,d[_0x16e4('0x16')]=0x3e8;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2016 -
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
*
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x37f0=['RealTimeCollaborativeEditing','requires'];(function(_0x31842b,_0x37f0c7){var _0x1748f9=function(_0x249df0){while(--_0x249df0){_0x31842b['push'](_0x31842b['shift']());}};_0x1748f9(++_0x37f0c7);}(_0x37f0,0x134));var _0x1748=function(_0x31842b,_0x37f0c7){_0x31842b=_0x31842b-0x0;var _0x1748f9=_0x37f0[_0x31842b];return _0x1748f9;};import{Plugin as _0x27212f}from'ckeditor5/src/core';import _0xc7ea71 from'./realtimecollaborativeediting/realtimecollaborationclient';export default class m extends _0x27212f{static get[_0x1748('0x1')](){return[_0xc7ea71];}static get['pluginName'](){return _0x1748('0x0');}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
import{Plugin as _0x4f2a9e}from'ckeditor5/src/core';import _0x12795b from'@ckeditor/ckeditor5-revision-history/src/revisiontracker';import _0x18ec26 from'../realtimecollaborativeediting/realtimecollaborationclient';import _0x5e911d from'../realtimecollaborativeediting/websocketgateway';import _0x3fb41e from'../realtimecollaborativeediting/sessions';import _0x11d28d from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import _0x32b390 from'@ckeditor/ckeditor5-collaboration-core/src/users';import _0x48ebad from'@ckeditor/ckeditor-cloud-services-collaboration/src/revision-history/revisionhistoryservice';import{debounce as _0x40aaee}from'lodash-es';import{DomEmitterMixin as _0x2f2a69}from'ckeditor5/src/utils';export default class v extends _0x4f2a9e{static get['requires'](){return[_0x5e911d,_0x18ec26,_0x12795b,_0x3fb41e,_0x32b390];}['_getLatestVersionFromServerOperations'](){const _0x3e135c=this['editor']['plugins']['get'](_0x18ec26)['serverHistory']['_operations'];for(let _0x81e997=_0x3e135c['length']-0x1;_0x81e997>=0x0;_0x81e997--)if('marker'!==_0x3e135c[_0x81e997]['type']||_0x3e135c[_0x81e997]['affectsData'])return _0x3e135c[_0x81e997]['baseVersion']+0x1;}async['init'](){this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get'](_0x12795b);const _0x5778d9=this['editor']['plugins']['get'](_0x18ec26),_0xa5752d=_0x5778d9['serverHistory'],_0x1be8f8=this['editor']['plugins']['get'](_0x5e911d);_0x1be8f8['addToReconnectionStack'](this);const _0x4e2867=this['editor']['config']['get']('collaboration.channelId');this['_revisionHistoryService']=new v['RevisionHistoryService'](_0x4e2867),this['_revisionTracker']['setSource']({'history':_0xa5752d,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5778d9['sessionId']});const _0x4ab6b4=new Set();this['editor']['plugins']['get'](_0x5e911d)['connection']['on']('change:state',(_0xc16a35,_0x121b7e,_0x4c621e)=>{if('disconnected'===_0x4c621e){for(const _0x4f6e97 of _0x4ab6b4)_0x4f6e97('Disconnected');_0x4ab6b4['clear']();}}),this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x239508})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x239508)),'updateRevisions':async _0x5c3c47=>{await this['_waitForServiceReady']();const _0x2d609f=this['_revisionTracker']['currentRevision'];for(const _0x47f0df of _0x5c3c47)_0x47f0df['id']===_0x2d609f['id']&&(_0x47f0df['isEmptyCurrent']=_0x47f0df['fromVersion']===_0x47f0df['toVersion']);return Promise['race']([this['_revisionHistoryService']['updateRevisions'](_0x5c3c47,this['_lastRequestId']),new Promise((_0x5a6ab8,_0xff1afb)=>_0x4ab6b4['add'](_0xff1afb))])['then'](_0x3ff1ff=>{this['_lastRequestId']=_0x3ff1ff;})['catch'](_0x33be69=>{if('Disconnected'!==_0x33be69&&('400'!==_0x33be69['code']||void 0x0===_0x33be69['data']['wrongRequestId']))throw _0x33be69;for(const _0x20b9e6 of _0x5c3c47){!this['_revisionTracker']['repository']['getRevision'](_0x20b9e6['id'])||this['_revisionTracker']['_bufferUpdate'](_0x20b9e6['id'],_0x20b9e6,!0x1);}if('Disconnected'===_0x33be69)throw _0x33be69;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x43f8a4,{revisionsData:_0x4475df,requestId:_0x315be6})=>{Math['max'](..._0x4475df['map'](_0x22ef9d=>_0x22ef9d['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x4475df,_0x315be6);}):this['_handleRevisionsUpdate'](_0x4475df,_0x315be6);});const {revisions:_0x1a8c63,requestId:_0x438cee}=await this['_revisionHistoryService']['connect'](_0x1be8f8['connection']);this['_lastRequestId']=_0x438cee,await this['_fetchMissingUsers'](_0x1a8c63);for(const _0x4a5f28 of _0x1a8c63)this['_revisionTracker']['addRevisionData'](_0x4a5f28);this['listenTo'](_0x5778d9,'change:_isConnected',(_0x22c05a,_0x2f7a05,_0x3aa24c)=>{_0x3aa24c&&(this['_oldOffset']=_0x5778d9['_offset'],_0x22c05a['off']());}),this['editor']['plugins']['has']('Autosave')||this['_initForDocumentStorage'](),this['_revisionTracker']['bind']('isEnabled')['to'](_0x1be8f8,'state',_0x3f96e5=>'connected'===_0x3f96e5);}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1400ea=>{this['listenTo'](this['_revisionHistoryService'],'connect',_0x114e3b=>{_0x114e3b['off'](),_0x1400ea();});});}['_getLatestVersion'](){const _0x307c9e=this['editor']['plugins']['get'](_0x18ec26);return new Promise(_0x280073=>{_0x307c9e['_isPendingUpdate']?_0x307c9e['once']('change:_isPendingUpdate',()=>{_0x280073(this['_getLatestVersionFromServerOperations']());}):_0x280073(this['_getLatestVersionFromServerOperations']());});}['_initForDocumentStorage'](){this['_domEmitter']=Object['create'](_0x2f2a69);const t=this['editor']['t'],_0x1f75d2=this['editor']['plugins']['get']('PendingActions');let _0x139fb0=null;const _0x26e24f=_0x40aaee(()=>{this['_revisionTracker']['update']()['finally'](()=>{_0x1f75d2['remove'](_0x139fb0),_0x139fb0=null;});},0x1f4);this['listenTo'](this['editor'],'ready',()=>{this['listenTo'](this['editor']['model']['document'],'change:data',(_0x4a8cd2,_0x59d9b8)=>{_0x59d9b8['isLocal']&&(_0x139fb0||(_0x139fb0=_0x1f75d2['add'](t({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'}))),_0x26e24f());});}),this['_domEmitter']['listenTo'](window,'beforeunload',(_0x25e556,_0x57a717)=>{_0x1f75d2['hasAny']&&(_0x57a717['returnValue']=_0x1f75d2['first']['message']);});}['destroy'](){this['_domEmitter']&&this['_domEmitter']['stopListening'](),super['destroy']();}async['reconnect'](){const _0x43c171=this['editor']['plugins']['get'](_0x5e911d),_0x21c522=this['editor']['plugins']['get'](_0x18ec26),_0x3d8651=async()=>{const _0x57ba28=this['_revisionTracker']['currentRevision'],_0x141cea=_0x57ba28['id'],_0x50bee1=_0x141cea!==_0x21c522['sessionId'];if(_0x50bee1){const _0x29a2c2=_0x21c522['_offset']-this['_oldOffset'],_0x21e55d=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x57ba28['toVersion']+_0x29a2c2!==_0x21e55d){const _0x5291c0=_0x57ba28['fromVersion']+_0x29a2c2,_0x34ad1a=this['editor']['plugins']['get']('Users'),_0x1a5368=this['_revisionTracker']['buildRevisionData']({'currentRevision':_0x57ba28,'from':_0x5291c0,'to':_0x21e55d});_0x1a5368['id']=_0x57ba28['id'];const _0x227ec1=_0x1a5368['authorsIds']['map'](_0x54b08f=>_0x34ad1a['getUser'](_0x54b08f));_0x57ba28['_update']({..._0x1a5368,'authors':_0x227ec1},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x57ba28['id'],_0x1a5368,!0x0);}this['_revisionTracker']['_startingVersion']=_0x21e55d,(_0x57ba28['toVersion']===_0x57ba28['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x141cea)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x141cea),this['_revisionTracker']['_createCurrentRevision'](_0x21e55d));}const {revisions:_0x1db31b,requestId:_0x1348b7}=await this['_revisionHistoryService']['reconnect'](_0x43c171['connection'],this['_lastRequestId']);_0x50bee1&&_0x1db31b['length']>0x0?_0x21c522['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x1db31b),this['_handleRevisionsUpdate'](_0x1db31b,_0x1348b7),this['_revisionTracker']['sendBufferedUpdates']());};return _0x21c522['_isConnected']?_0x3d8651():new Promise((_0x157cc8,_0x4bae98)=>{_0x21c522['once']('change:_isConnected',()=>{_0x3d8651()['then'](_0x157cc8)['catch'](_0x4bae98);});});}['_handleRevisionsUpdate'](_0x198c86,_0xe0017){const _0x4f8092=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xe0017;for(const _0x5574a8 of _0x198c86){const _0x4ef53b=_0x4f8092['getRevision'](_0x5574a8['id']);if(_0x4ef53b){if((_0x5574a8['fromVersion']||_0x5574a8['toVersion'])&&(_0x5574a8['diffData']=null),_0x4ef53b===this['_revisionTracker']['currentRevision']){const _0x3ef6ea=Math['max'](_0x4ef53b['toVersion'],_0x5574a8['toVersion']),_0x51e71b=Math['max'](_0x4ef53b['fromVersion'],_0x5574a8['fromVersion']);let _0x2dfd8c;_0x4ef53b['toVersion']===_0x5574a8['toVersion']&&_0x4ef53b['fromVersion']===_0x5574a8['fromVersion']?(_0x2dfd8c=!0x0,this['_preventResendingRevisionData'](_0x5574a8)):_0x5574a8['toVersion']===_0x3ef6ea&&_0x5574a8['fromVersion']===_0x51e71b?_0x2dfd8c=!0x1:(_0x4ef53b['toVersion']===_0x3ef6ea&&_0x4ef53b['fromVersion']===_0x51e71b||this['_fixRevision']({'revision':_0x4ef53b,'from':_0x51e71b,'to':_0x3ef6ea}),_0x2dfd8c=!0x0),_0x2dfd8c&&(delete _0x5574a8['fromVersion'],delete _0x5574a8['toVersion'],delete _0x5574a8['diffData'],delete _0x5574a8['createdAt'],delete _0x5574a8['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x5574a8),this['_preventResendingRevisionData'](_0x5574a8);}else this['_revisionTracker']['addRevisionData'](_0x5574a8);}const _0x2bca31=_0x4f8092['getRevisions']();_0x2bca31['reverse']();for(let _0x3098b8=0x0;_0x3098b8<_0x2bca31['length']-0x1;_0x3098b8++){const _0x37a9ae=_0x2bca31[_0x3098b8],_0x75ef78=_0x2bca31[_0x3098b8+0x1];if(_0x37a9ae['fromVersion']<_0x75ef78['toVersion']){const _0x4edc1d=_0x75ef78['toVersion'];this['_fixRevision']({'revision':_0x37a9ae,'from':_0x4edc1d});}}}['_fixRevision']({revision:_0x257069,from:_0x2d0ab6,to:_0x20678e}={}){const _0x53c673=this['editor']['plugins']['get']('Users'),_0x29fb45=this['_revisionTracker']['buildRevisionData']({'revision':_0x257069,'from':_0x2d0ab6,'to':_0x20678e});_0x29fb45['authors']=_0x29fb45['authorsIds']['map'](_0x19e7ef=>_0x53c673['getUser'](_0x19e7ef)),_0x257069['_update'](_0x29fb45);}['_preventResendingRevisionData'](_0x38cfff){const _0xe8030b={};_0xe8030b['id']=_0x38cfff['id'];for(const _0x300f93 of Object['keys'](_0x38cfff))'id'!==_0x300f93&&(_0xe8030b[_0x300f93]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xe8030b['id'],_0xe8030b,!0x0);}['_fetchMissingUsers'](_0x5b8d20){const _0x404ab4=this['editor']['plugins']['get'](_0x32b390),{connection:_0x1bf60d}=this['editor']['plugins']['get'](_0x5e911d),_0xcdf5eb=new Set();for(const _0x3a4d8a of _0x5b8d20){for(const _0x44e3e2 of _0x3a4d8a['authorsIds'])_0x526462(_0x44e3e2);_0x3a4d8a['creatorId']&&_0x526462(_0x3a4d8a['creatorId']);}return Promise['all'](Array['from'](_0xcdf5eb,async _0x550891=>{const _0x1cfa52=await _0x11d28d['get'](_0x1bf60d,_0x550891);_0x404ab4['getUser'](_0x550891)||_0x404ab4['addUser'](_0x1cfa52);}));function _0x526462(_0x59a44d){_0x404ab4['getUser'](_0x59a44d)||_0xcdf5eb['add'](_0x59a44d);}}}v['RevisionHistoryService']=_0x48ebad;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
var _0x4b65=['pluginName'];(function(_0x53cdd8,_0x4b6568){var _0x5b5e53=function(_0x4398a9){while(--_0x4398a9){_0x53cdd8['push'](_0x53cdd8['shift']());}};_0x5b5e53(++_0x4b6568);}(_0x4b65,0x1c4));var _0x5b5e=function(_0x53cdd8,_0x4b6568){_0x53cdd8=_0x53cdd8-0x0;var _0x5b5e53=_0x4b65[_0x53cdd8];return _0x5b5e53;};import{Plugin as _0xabc15c}from'ckeditor5/src/core';import _0x4e84a4 from'./realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter';import _0x3698c3 from'@ckeditor/ckeditor5-revision-history/src/revisionhistory';import _0x2ed63a from'./realtimecollaborativeediting';export default class u extends _0xabc15c{static get['requires'](){return[_0x3698c3,_0x4e84a4,_0x2ed63a];}static get[_0x5b5e('0x0')](){return'RealTimeCollaborativeRevisionHistory';}}
|