@ckeditor/ckeditor5-real-time-collaboration 36.0.1 → 37.0.0-rc.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/build/real-time-collaboration.js +1 -1
- package/package.json +22 -5
- package/src/augmentation.d.ts +57 -0
- package/src/augmentation.js +23 -0
- package/src/common-translations.d.ts +5 -0
- package/src/common-translations.js +1 -1
- package/src/config.d.ts +33 -0
- package/src/config.js +23 -0
- package/src/index.d.ts +9 -0
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.d.ts +38 -0
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.d.ts +7 -0
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.d.ts +7 -0
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.d.ts +6 -0
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.d.ts +14 -0
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.d.ts +7 -0
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.d.ts +11 -0
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.d.ts +22 -0
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +42 -0
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
- package/src/realtimecollaborativecomments.d.ts +29 -0
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +119 -0
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
- package/src/realtimecollaborativeediting/sessions.d.ts +114 -0
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.d.ts +31 -0
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.d.ts +51 -0
- package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
- package/src/realtimecollaborativeediting.d.ts +21 -0
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +38 -0
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
- package/src/realtimecollaborativerevisionhistory.d.ts +23 -0
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +34 -0
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
- package/src/realtimecollaborativetrackchanges.d.ts +21 -0
- package/src/realtimecollaborativetrackchanges.js +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
|
|
2
|
+
import '../../theme/usermarkers.css';
|
|
3
|
+
/**
|
|
4
|
+
* This plugin:
|
|
5
|
+
*
|
|
6
|
+
* 1. Creates marker operations with current user selection on demand.
|
|
7
|
+
* 2. Renders clients selection markers.
|
|
8
|
+
*
|
|
9
|
+
* This plugin does not create markers automatically, instead it provides an API for it {@link #createUserMarkerOperations}.
|
|
10
|
+
* {@link RealTimeCollaborationClient} uses this API to create user selection operations in the most optimal moment
|
|
11
|
+
* (as the last operation in the operations package) - this is to reach the best compression result.
|
|
12
|
+
*/
|
|
13
|
+
export default class UserMarkers extends Plugin {
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
static get requires(): PluginDependencies;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): 'UserMarkers';
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
init(): void;
|
|
26
|
+
afterInit(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Creates marker operations with current user selection.
|
|
29
|
+
*/
|
|
30
|
+
createUserMarkerOperations(): void;
|
|
31
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2e0a=['get','$graveyard','mySessionId','root','view','updateMarker','markers','isLimit','getRange','editor','nodeAfter','innerHTML','deletionPosition','user:','userPositionMarker','getStart','editing','toRange','isSimilar','removeMarker','toDomElement','render','pluginName','enqueueChange','detach','getContainedElement','applyOperation','start','change','afterInit','for','oldRange','createRange','name','isCollapsed','user:position:','highest','user:range:','getMarkerClass','split','_createdBatches','$text','setCustomProperty','batch','model','plugins','tableCell','ck-user__marker\x20','ck-user__selection','document','getNearestSelectionRange','hasContent','createUIElement','marker','isInline','getUserBySessionId','orderNumber','startsWith','rootName','user:position','markerRange','end','change:range','getSelectionClass','newRange','parent','user:range','getAttribute','markerName','conversion','schema','data-session-id','element','init','checkChild','color','clear','addMarker','has','getCustomProperty','delete','getFirstRange'];(function(_0x548a60,_0x2e0af4){const _0x434f8e=function(_0x140279){while(--_0x140279){_0x548a60['push'](_0x548a60['shift']());}};_0x434f8e(++_0x2e0af4);}(_0x2e0a,0x1c7));const _0x434f=function(_0x548a60,_0x2e0af4){_0x548a60=_0x548a60-0x0;let _0x434f8e=_0x2e0a[_0x548a60];return _0x434f8e;};import{Plugin as _0x4c8482}from'ckeditor5/src/core';import _0x4d5d93 from'./sessions';import{LiveRange as _0x5520e0}from'ckeditor5/src/engine';import'../../theme/usermarkers.css';export default class P extends _0x4c8482{static get['requires'](){return[_0x4d5d93];}static get[_0x434f('0x3b')](){return'UserMarkers';}[_0x434f('0x1c')](){const _0x40cc65=this[_0x434f('0x2e')],_0x2c17b4=_0x40cc65['plugins'][_0x434f('0x25')](_0x4d5d93);_0x40cc65[_0x434f('0x18')][_0x434f('0x43')]('editingDowncast')['markerToElement']({'model':_0x434f('0xe'),'view':(_0x497ac1,{writer:_0x3c7b14})=>function(_0x455c3d,_0x274829,_0x81433,_0x141dc0){const _0x3a2f92=_0x455c3d['markerName'][_0x434f('0x4c')](':')[0x2],_0x43331f=_0x81433['getUserBySessionId'](_0x3a2f92);if(!_0x43331f||_0x3a2f92===_0x81433[_0x434f('0x27')])return;if(!_0x141dc0[_0x434f('0x51')][_0x434f('0x19')][_0x434f('0x1d')](_0x455c3d[_0x434f('0xf')][_0x434f('0x40')],_0x434f('0x4e')))return;const _0x867154={'class':_0x434f('0x2')+_0x43331f[_0x434f('0x1e')][_0x434f('0x4b')](),'data-name':_0x43331f[_0x434f('0x46')],'data-session-id':_0x3a2f92},_0x1f5ed3=_0x141dc0[_0x434f('0x51')][_0x434f('0x2b')][_0x434f('0x25')](_0x455c3d[_0x434f('0x17')]),_0x581b88=_0x1f5ed3[_0x434f('0x34')](),_0xba8dad=_0x581b88[_0x434f('0x2f')],_0xdc7967=_0x141dc0[_0x434f('0x51')]['schema'];if(_0xba8dad&&_0xdc7967['isObject'](_0xba8dad)&&_0xdc7967[_0x434f('0x9')](_0xba8dad)&&!_0x141dc0[_0x434f('0x51')][_0x434f('0x2b')]['get'](_0x434f('0x4a')+_0x3a2f92)['getRange']()[_0x434f('0x47')])return;const _0x7b08ed=_0x581b88[_0x434f('0x14')];return _0x141dc0[_0x434f('0x51')]['schema'][_0x434f('0x2c')](_0x7b08ed)&&!_0x141dc0[_0x434f('0x51')][_0x434f('0x6')](_0x7b08ed)&&(_0x867154['contenteditable']=!0x1),function(_0x3b2f68,_0x49b8cc){const _0x3126ff=_0x3b2f68[_0x434f('0x7')]('span',_0x49b8cc);return _0x3b2f68[_0x434f('0x4f')](_0x434f('0x33'),!0x0,_0x3126ff),_0x3126ff[_0x434f('0x3a')]=function(_0x7e99ff){const _0x3b444f=this[_0x434f('0x39')](_0x7e99ff);return _0x3b444f[_0x434f('0x30')]='​<span\x20class=\x22ck-user__marker-line\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>',_0x3b444f;},_0x3126ff[_0x434f('0x37')]=function(_0x3f6019){return!(!this[_0x434f('0x22')]('userPositionMarker')||!_0x3f6019['getCustomProperty'](_0x434f('0x33'))||this['getAttribute'](_0x434f('0x1a'))!=_0x3f6019[_0x434f('0x16')](_0x434f('0x1a')));},_0x3126ff;}(_0x274829,_0x867154);}(_0x497ac1,_0x3c7b14,_0x2c17b4,_0x40cc65)}),_0x40cc65[_0x434f('0x18')][_0x434f('0x43')]('editingDowncast')['markerToHighlight']({'model':_0x434f('0x15'),'view':_0x2d7b75=>function(_0x565db0,_0x4109fb){const _0x1fb190=_0x565db0[_0x434f('0x17')][_0x434f('0x4c')](':')[0x2];if(_0x1fb190===_0x4109fb[_0x434f('0x27')])return null;const _0x4fd25b=_0x4109fb[_0x434f('0xa')](_0x1fb190);if(!_0x4fd25b)return{'id':_0x1fb190,'classes':[]};return{'id':_0x1fb190,'classes':[_0x434f('0x3'),_0x4fd25b[_0x434f('0x1e')][_0x434f('0x12')]()],'attributes':{'data-session-id':_0x1fb190},'priority':0x7d0+_0x4fd25b[_0x434f('0xb')]};}(_0x2d7b75,_0x2c17b4)}),function(_0x33f518){const _0x24eb74=_0x33f518['model'],_0x35cf7f=new Map(),_0x1770d8=_0x33f518['plugins'][_0x434f('0x25')](_0x4d5d93);_0x24eb74[_0x434f('0x2b')]['on']('update:user:range',(_0x504361,_0x129260,_0x5bfb16,_0x157e50)=>{if(!_0x157e50&&_0x35cf7f[_0x434f('0x25')](_0x129260['name']))return _0x35cf7f['get'](_0x129260[_0x434f('0x46')])[_0x434f('0x3d')](),void _0x35cf7f[_0x434f('0x23')](_0x129260['name']);const _0x529a1e=_0x129260[_0x434f('0x46')][_0x434f('0x4c')](':')[0x2];if(_0x529a1e===_0x1770d8[_0x434f('0x27')])return;const _0x20f6a4=_0x434f('0x48')+_0x529a1e;_0x24eb74['markers'][_0x434f('0x21')](_0x20f6a4)&&_0x33f518[_0x434f('0x35')]['reconvertMarker'](_0x20f6a4),_0x129260['on'](_0x434f('0x11'),(_0x188f98,_0x20100b,_0x114939)=>{if('$graveyard'!=_0x20100b[_0x434f('0x28')][_0x434f('0xd')]&&'$graveyard'==_0x129260[_0x434f('0x2d')]()[_0x434f('0x28')][_0x434f('0xd')]&&!_0x35cf7f[_0x434f('0x21')](_0x129260['name'])){const _0x3de433=_0x24eb74[_0x434f('0x19')][_0x434f('0x5')](_0x114939[_0x434f('0x31')]);if(_0x3de433){const _0x5544a4=_0x5520e0['fromRange'](_0x3de433);_0x35cf7f['set'](_0x129260[_0x434f('0x46')],_0x5544a4),_0x5544a4['on']('change:range',(_0x2c148e,_0x43ca6d,_0x1638b3)=>{if(_0x434f('0x26')==_0x5544a4[_0x434f('0x28')][_0x434f('0xd')]){const _0x5f4fc9=_0x24eb74[_0x434f('0x19')][_0x434f('0x5')](_0x1638b3[_0x434f('0x31')]);_0x5f4fc9?(_0x5544a4['start']=_0x5f4fc9[_0x434f('0x40')],_0x5544a4[_0x434f('0x10')]=_0x5f4fc9[_0x434f('0x10')]):(_0x35cf7f[_0x434f('0x23')](_0x129260['name']),_0x5544a4['detach']());}});}}});}),_0x24eb74['document']['on'](_0x434f('0x41'),()=>{_0x35cf7f['size']>0x0&&_0x24eb74[_0x434f('0x3c')]({'isUndoable':!0x1},_0x467918=>{for(const [_0xc83530,_0x177f32]of _0x35cf7f)_0x434f('0x26')==_0x24eb74[_0x434f('0x2b')]['get'](_0xc83530)[_0x434f('0x2d')]()[_0x434f('0x28')]['rootName']&&(G(_0xc83530['split'](':')[0x2],_0x177f32[_0x434f('0x36')](),_0x24eb74,_0x467918),_0x177f32[_0x434f('0x3d')]());_0x35cf7f[_0x434f('0x1f')]();});});}(_0x40cc65);}[_0x434f('0x42')](){const _0x50778d=this[_0x434f('0x2e')],_0x26634c=_0x50778d['commands'][_0x434f('0x25')]('undo');_0x26634c&&_0x50778d[_0x434f('0x51')]['on'](_0x434f('0x3f'),(_0x319130,_0x5f308d)=>{const _0x570b8e=_0x5f308d[0x0];if(_0x434f('0x8')!=_0x570b8e['type']||!_0x570b8e['name'][_0x434f('0xc')](_0x434f('0x32')))return;const _0x3882c9=_0x570b8e[_0x434f('0x50')];_0x26634c[_0x434f('0x4d')][_0x434f('0x21')](_0x3882c9)&&(_0x570b8e[_0x434f('0x13')]=_0x570b8e['oldRange']?_0x50778d[_0x434f('0x51')]['createRange'](_0x570b8e[_0x434f('0x44')][_0x434f('0x40')],_0x570b8e[_0x434f('0x44')]['end']):null);},{'priority':_0x434f('0x49')});}['createUserMarkerOperations'](){const _0x3d733a=this[_0x434f('0x2e')],_0x2d244e=_0x3d733a[_0x434f('0x51')][_0x434f('0x4')],_0x959632=_0x3d733a[_0x434f('0x0')][_0x434f('0x25')](_0x4d5d93);_0x3d733a[_0x434f('0x51')][_0x434f('0x3c')]({'isUndoable':!0x1},_0x57f09a=>{const _0x46d7f7=_0x434f('0x4a')+_0x959632['mySessionId'],_0x5719f0=_0x434f('0x48')+_0x959632['mySessionId'],_0x524cc5=_0x3d733a['model']['markers'][_0x434f('0x21')](_0x46d7f7);_0x3d733a[_0x434f('0x35')][_0x434f('0x29')]['hasDomSelection']?G(_0x959632[_0x434f('0x27')],_0x2d244e['selection'][_0x434f('0x24')](),_0x3d733a['model'],_0x57f09a):_0x524cc5&&(_0x57f09a[_0x434f('0x38')](_0x46d7f7),_0x57f09a[_0x434f('0x38')](_0x5719f0));});}}function G(_0x1610c3,_0xd70b7e,_0x3e4d74,_0x1cfaf1){const _0x516bed=_0x434f('0x4a')+_0x1610c3,_0x24bc00='user:position:'+_0x1610c3,_0xf5f20=_0xd70b7e[_0x434f('0x3e')]();let _0x26bf5d=_0xd70b7e[_0x434f('0x40')];_0xf5f20&&_0xf5f20['is'](_0x434f('0x1b'),_0x434f('0x1'))&&(_0x26bf5d=function(_0x5de3ad,_0x12fc36){for(const _0x47ded4 of _0x5de3ad['getPositions']())if(_0x12fc36[_0x434f('0x19')][_0x434f('0x1d')](_0x47ded4,_0x434f('0x4e')))return _0x47ded4;}(_0xd70b7e,_0x3e4d74),_0xd70b7e=_0x1cfaf1[_0x434f('0x45')](_0x26bf5d));const _0x189b15=_0x1cfaf1['createRange'](_0x26bf5d);_0x3e4d74['markers'][_0x434f('0x21')](_0x516bed)?(_0x1cfaf1[_0x434f('0x2a')](_0x516bed,{'range':_0xd70b7e}),_0x1cfaf1[_0x434f('0x2a')](_0x24bc00,{'range':_0x189b15})):(_0x1cfaf1[_0x434f('0x20')](_0x516bed,{'range':_0xd70b7e,'usingOperation':!0x0}),_0x1cfaf1[_0x434f('0x20')](_0x24bc00,{'range':_0x189b15,'usingOperation':!0x0}));}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module real-time-collaboration/realtimecollaborativeediting/websocketgateway
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ContextPlugin, type Plugin, type ContextPluginDependencies, type Editor, type Context } from 'ckeditor5/src/core';
|
|
6
|
+
import { type Emitter, type Observable } from 'ckeditor5/src/utils';
|
|
7
|
+
import WebSocketGatewayProvider, { WEB_SOCKET_GATEWAY_STATES } from '@ckeditor/ckeditor-cloud-services-collaboration/src/websocketgateway/websocketgateway';
|
|
8
|
+
export default class WebSocketGateway extends ContextPlugin {
|
|
9
|
+
static WebSocketGateway: typeof WebSocketGatewayProvider;
|
|
10
|
+
static initialReconnectionInterval: number;
|
|
11
|
+
connection: WebSocketGatewayProvider & Emitter & Observable;
|
|
12
|
+
/**
|
|
13
|
+
* The connection state.
|
|
14
|
+
*
|
|
15
|
+
* The `connected` state is set when both, the browser and the WebSocket, are connected.
|
|
16
|
+
*/
|
|
17
|
+
state: WEB_SOCKET_GATEWAY_STATES;
|
|
18
|
+
static get requires(): ContextPluginDependencies;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): 'WebSocketGateway';
|
|
23
|
+
constructor(context: Editor | Context);
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init(): Promise<unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Registers a plugin that will be reconnected when the connection is back.
|
|
30
|
+
* The plugin needs to implement the `reconnect()` method.
|
|
31
|
+
*/
|
|
32
|
+
addToReconnectionStack(plugin: ReconnectPlugin | ReconnectContextPlugin): void;
|
|
33
|
+
/**
|
|
34
|
+
* Removes the plugin from the reconnection stack.
|
|
35
|
+
*/
|
|
36
|
+
removeFromReconnectionStack(plugin: ReconnectPlugin | ReconnectContextPlugin): void;
|
|
37
|
+
/**
|
|
38
|
+
* Checks if the plugin is present in the reconnection stack.
|
|
39
|
+
*/
|
|
40
|
+
isInReconnectionStack(plugin: ReconnectPlugin | ReconnectContextPlugin): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @inheritDoc
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
46
|
+
interface Reconnect {
|
|
47
|
+
reconnect: () => void | Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export type ReconnectPlugin = Plugin & Reconnect;
|
|
50
|
+
export type ReconnectContextPlugin = ContextPlugin & Reconnect;
|
|
51
|
+
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1650=['error','all','cloudServices.connectionTimeout','webSocketUrl','_shouldPluginsReconnect','token','cloudservices-init','pluginName','bind','connected','online','offline','cloudServices.requestTimeout','_isBrowserOffline','DISCONNECTED','listenTo','cloudservices-reconnection-error','removeFromReconnectionStack','from','websocketgateway-missing-token','connection','stopListening','get','set','catch','has','then','destroy','delete','_reconnectionStack','_reconnect','websocketgateway-plugin-already-registered','context','function','CONNECTING','config','disconnect','addToReconnectionStack','requires','CONNECTED','limitExceeded','init','showWarning','reconnect','create','_domEmitter','CloudServices','code','plugins','real-time-collaboration','add','isInReconnectionStack','websocketgateway-missing-websocket-url','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.','websocketgateway-invalid-plugin-interface','state','WebSocketGateway'];(function(_0x335e13,_0x1650a9){const _0x3ec349=function(_0x4422aa){while(--_0x4422aa){_0x335e13['push'](_0x335e13['shift']());}};_0x3ec349(++_0x1650a9);}(_0x1650,0x13b));const _0x3ec3=function(_0x335e13,_0x1650a9){_0x335e13=_0x335e13-0x0;let _0x3ec349=_0x1650[_0x335e13];return _0x3ec349;};import{ContextPlugin as _0xa2efb8}from'ckeditor5/src/core';import{DomEmitterMixin as _0x37d6b7,CKEditorError as _0x446bfe}from'ckeditor5/src/utils';import _0x10e600,{WEB_SOCKET_GATEWAY_STATES as _0x4f30de}from'@ckeditor/ckeditor-cloud-services-collaboration/src/websocketgateway/websocketgateway';import{Notification as _0x38307d}from'ckeditor5/src/ui';export default class c extends _0xa2efb8{static get[_0x3ec3('0x8')](){return[_0x3ec3('0x10'),_0x38307d];}static get['pluginName'](){return _0x3ec3('0x1a');}constructor(_0x291b91){super(_0x291b91),this[_0x3ec3('0x32')](_0x3ec3('0x19'),_0x4f30de[_0x3ec3('0x9')]),this[_0x3ec3('0x32')](_0x3ec3('0x28'),!0x1),this[_0x3ec3('0x38')]=new Set(),this[_0x3ec3('0x1f')]=!0x1,this[_0x3ec3('0xf')]=Object[_0x3ec3('0xe')](_0x37d6b7);}[_0x3ec3('0xb')](){const _0x14b883=this[_0x3ec3('0x2')],_0x4a74b1=_0x14b883[_0x3ec3('0x12')][_0x3ec3('0x31')](_0x3ec3('0x10')),_0x5f328a=_0x14b883[_0x3ec3('0x12')][_0x3ec3('0x31')](_0x38307d);if(!_0x4a74b1[_0x3ec3('0x20')])throw new _0x446bfe(_0x3ec3('0x2e'),this);if(!_0x4a74b1['webSocketUrl'])throw new _0x446bfe(_0x3ec3('0x16'),this);return this[_0x3ec3('0xf')][_0x3ec3('0x2a')](window,_0x3ec3('0x26'),()=>this[_0x3ec3('0x28')]=!0x0),this['_domEmitter'][_0x3ec3('0x2a')](window,_0x3ec3('0x25'),()=>this['_isBrowserOffline']=!0x1),this[_0x3ec3('0x2')]['config']['define'](_0x3ec3('0x1d'),0xa),this[_0x3ec3('0x2')][_0x3ec3('0x5')]['define'](_0x3ec3('0x27'),0x14),c['WebSocketGateway']['connect'](_0x4a74b1[_0x3ec3('0x20')],_0x4a74b1[_0x3ec3('0x1e')],{'timeout':0x3e8*this[_0x3ec3('0x2')][_0x3ec3('0x5')][_0x3ec3('0x31')](_0x3ec3('0x1d')),'requestTimeout':0x3e8*this[_0x3ec3('0x2')]['config']['get'](_0x3ec3('0x27'))})['then'](_0x11dee3=>{if(this['connection']=_0x11dee3,this[_0x3ec3('0x23')](_0x3ec3('0x19'))['to'](_0x11dee3,'state',this,_0x3ec3('0x28'),(_0x39db33,_0x4bf94c)=>(_0x3ec3('0x24')!==_0x39db33&&(this[_0x3ec3('0x1f')]=!0x0),_0x4bf94c||_0x39db33!==_0x4f30de['CONNECTED']?_0x4f30de[_0x3ec3('0x29')]:this[_0x3ec3('0x19')]==_0x4f30de['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this[_0x3ec3('0x1f')]=!0x1,this[_0x3ec3('0x0')](),_0x4f30de[_0x3ec3('0x4')]):_0x4f30de[_0x3ec3('0x9')])),this[_0x3ec3('0x2f')]['on'](_0x3ec3('0x1b'),(_0x5e67d4,_0x352f67)=>{if(_0x3ec3('0xa')!==_0x352f67[_0x3ec3('0x11')])throw console[_0x3ec3('0x1b')](_0x352f67),new _0x446bfe(_0x3ec3('0x21'),null,{'originalError':_0x352f67});_0x5f328a[_0x3ec3('0xc')](_0x3ec3('0x17'),{'title':'Connected\x20users\x20limit\x20exceeded','namespace':_0x3ec3('0x13')});}),!_0x11dee3['me'])return new Promise(_0x1b68b2=>_0x11dee3['on']('change:me',_0x1b68b2));})[_0x3ec3('0x33')](_0x401478=>{throw console[_0x3ec3('0x1b')](_0x401478),new _0x446bfe('cloudservices-init',null,{'originalError':_0x401478});});}[_0x3ec3('0x7')](_0x5f2c96){if(_0x3ec3('0x3')!=typeof _0x5f2c96[_0x3ec3('0xd')])throw new _0x446bfe(_0x3ec3('0x18'),this);if(this[_0x3ec3('0x15')](_0x5f2c96))throw new _0x446bfe(_0x3ec3('0x1'),this,{'name':_0x5f2c96['constructor'][_0x3ec3('0x22')]});this[_0x3ec3('0x38')][_0x3ec3('0x14')](_0x5f2c96);}[_0x3ec3('0x2c')](_0x115b17){this[_0x3ec3('0x38')][_0x3ec3('0x37')](_0x115b17);}['isInReconnectionStack'](_0x44f459){return this[_0x3ec3('0x38')][_0x3ec3('0x34')](_0x44f459);}['_reconnect'](){return this[_0x3ec3('0x2f')]['reconnect']()[_0x3ec3('0x35')](()=>Promise[_0x3ec3('0x1c')](Array[_0x3ec3('0x2d')](this[_0x3ec3('0x38')],_0x3f3216=>_0x3f3216[_0x3ec3('0xd')]())))[_0x3ec3('0x35')](()=>this[_0x3ec3('0x19')]=_0x4f30de['CONNECTED'])['catch'](_0xd04cef=>{throw console['error'](_0xd04cef),new _0x446bfe(_0x3ec3('0x2b'),this[_0x3ec3('0x2')]);});}[_0x3ec3('0x36')](){this['connection']&&this[_0x3ec3('0x2f')][_0x3ec3('0x6')](),this['state']=_0x4f30de[_0x3ec3('0x29')],this[_0x3ec3('0xf')][_0x3ec3('0x30')](),super[_0x3ec3('0x36')]();}}c[_0x3ec3('0x1a')]=_0x10e600,c['initialReconnectionInterval']=0x3e8;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module real-time-collaboration/realtimecollaborativeediting
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
|
|
6
|
+
/**
|
|
7
|
+
* Enables the real-time collaborative editing feature.
|
|
8
|
+
*
|
|
9
|
+
* Check the {@glink features/collaboration/real-time-collaboration/real-time-collaboration-integration Real-time collaboration} guide
|
|
10
|
+
* to see how to launch the editor in the real-time collaboration mode.
|
|
11
|
+
*/
|
|
12
|
+
export default class RealTimeCollaborativeEditing extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get requires(): PluginDependencies;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): 'RealTimeCollaborativeEditing';
|
|
21
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x4c05=['pluginName','requires','RealTimeCollaborativeEditing'];(function(_0x4c3fbb,_0x4c0534){var _0x398560=function(_0x445e25){while(--_0x445e25){_0x4c3fbb['push'](_0x4c3fbb['shift']());}};_0x398560(++_0x4c0534);}(_0x4c05,0x1a4));var _0x3985=function(_0x4c3fbb,_0x4c0534){_0x4c3fbb=_0x4c3fbb-0x0;var _0x398560=_0x4c05[_0x4c3fbb];return _0x398560;};import{Plugin as _0x15b250}from'ckeditor5/src/core';import _0x3e5b13 from'./realtimecollaborativeediting/realtimecollaborationclient';export default class n extends _0x15b250{static get[_0x3985('0x1')](){return[_0x3e5b13];}static get[_0x3985('0x0')](){return _0x3985('0x2');}}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module real-time-collaboration/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import { type ReconnectPlugin } from '../realtimecollaborativeediting/websocketgateway';
|
|
7
|
+
import RevisionHistoryService from '@ckeditor/ckeditor-cloud-services-collaboration/src/revision-history/revisionhistoryservice';
|
|
8
|
+
/**
|
|
9
|
+
* The Cloud Services revision history adapter plugin.
|
|
10
|
+
*/
|
|
11
|
+
export default class CloudServicesRevisionHistoryAdapter extends Plugin implements ReconnectPlugin {
|
|
12
|
+
static RevisionHistoryService: typeof RevisionHistoryService;
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get requires(): PluginDependencies;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
constructor(editor: Editor);
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* A method that will be executed when the `WebSocketGateway` will reconnect.
|
|
27
|
+
*/
|
|
28
|
+
reconnect(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
destroy(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Waits for the service to be ready before calling the service API.
|
|
35
|
+
*/
|
|
36
|
+
private _waitForServiceReady;
|
|
37
|
+
private _fetchMissingUsers;
|
|
38
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0x5bca=['affectsData','size','_lastRequestId','_revisionDataBuilder','data','remove','getUser','_waitForServiceReady','connected','_revisionTracker','_domEmitter','once','isEnabled','addRevisionData','plugins','repository','fromVersion','authorsIds','400','cloudServices.bundleVersion','Users','_revisions','setSource','RevisionHistoryService','then','cloud-services-internal-error:\x20Not\x20connected.','collaboration.channelId','requires','_handleReconnectionError','_preventResendingRevisionData','buildRevisionData','init','map','baseVersion','cloud-services-internal-error:\x20Request\x20timeout.','code','diffData','getRevisions','_bufferUpdate','_isPendingUpdate','_update','setRevisionData','reverse','length','serverHistory','_getLatestVersion','revisionsUpdated','_startingVersion','_fixRevision','reInit','editor','stopListening','getRevision','change:_isPendingUpdate','_getLatestVersionFromServerOperations','connect','get','catch','_bufferedUpdates','reconnect','change:_isConnected','keys','marker','_revisionHistoryService','isEmptyCurrent','_oldOffset','off','addToReconnectionStack','_offset','message','_isConnected','destroy','listenTo','updateRevisions','creatorId','currentRevision','max','_handleRevisionsUpdate','connection','RevisionTracker','type','wrongRequestId','cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.','toVersion','config','_createCurrentRevision'];(function(_0x410d43,_0x5bcaf7){const _0x1e7f2f=function(_0xf26124){while(--_0xf26124){_0x410d43['push'](_0x410d43['shift']());}};_0x1e7f2f(++_0x5bcaf7);}(_0x5bca,0x175));const _0x1e7f=function(_0x410d43,_0x5bcaf7){_0x410d43=_0x410d43-0x0;let _0x1e7f2f=_0x5bca[_0x410d43];return _0x1e7f2f;};import{Plugin as _0x56a4eb}from'ckeditor5/src/core';import{version as _0x84df53}from'ckeditor5/src/utils';import{Users as _0x22c699}from'ckeditor5-collaboration/src/collaboration-core';import _0x2c1bfa from'../realtimecollaborativeediting/realtimecollaborationclient';import _0x15dafd from'../realtimecollaborativeediting/websocketgateway';import _0x58089d from'../realtimecollaborativeediting/sessions';import _0x56c5f8 from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import _0x613f68 from'@ckeditor/ckeditor-cloud-services-collaboration/src/revision-history/revisionhistoryservice';import _0x5732f0 from'@ckeditor/ckeditor-cloud-services-collaboration/src/editor/editorservice';export default class v extends _0x56a4eb{static get[_0x1e7f('0x54')](){return[_0x15dafd,_0x2c1bfa,_0x1e7f('0x32'),_0x58089d,_0x22c699];}async[_0x1e7f('0x2')](){this[_0x1e7f('0x3b')]=null,this[_0x1e7f('0x42')]=this[_0x1e7f('0x15')][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x1e7f('0x32'));const _0x365b97=this['editor']['plugins'][_0x1e7f('0x1b')](_0x2c1bfa),_0x12e9a9=_0x365b97[_0x1e7f('0xf')],_0x37d206=this[_0x1e7f('0x15')][_0x1e7f('0x47')]['get'](_0x15dafd),_0x5d0572=this[_0x1e7f('0x15')][_0x1e7f('0x37')][_0x1e7f('0x1b')](_0x1e7f('0x53'));this[_0x1e7f('0x22')]=new v[(_0x1e7f('0x50'))](_0x5d0572),this[_0x1e7f('0x42')][_0x1e7f('0x4f')]({'history':_0x12e9a9,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x365b97['sessionId']});const _0x1d6b2c=this[_0x1e7f('0x15')][_0x1e7f('0x37')]['get'](_0x1e7f('0x4c'))||_0x84df53,_0x2678c7=await _0x5732f0['isBundleUploaded'](_0x37d206[_0x1e7f('0x31')],_0x1d6b2c);this[_0x1e7f('0x42')]['adapter']={'getRevision':async({revisionId:_0x20ed31})=>(await this[_0x1e7f('0x40')](),await this[_0x1e7f('0x22')]['getRevision'](_0x20ed31)),'updateRevisions':async _0x3ed8d9=>{await this['_waitForServiceReady']();const _0x4c8942=this['_revisionTracker'][_0x1e7f('0x2e')];if(!_0x2678c7||0x1!==_0x3ed8d9[_0x1e7f('0xe')]||_0x3ed8d9[0x0]['id']!==_0x4c8942['id']){for(const _0x2f9551 of _0x3ed8d9)_0x2f9551['id']===_0x4c8942['id']&&(_0x2f9551[_0x1e7f('0x23')]=_0x2f9551['fromVersion']===_0x2f9551[_0x1e7f('0x36')]);return this[_0x1e7f('0x22')][_0x1e7f('0x2c')](_0x3ed8d9,this['_lastRequestId'])[_0x1e7f('0x51')](_0x4f4ff4=>{this[_0x1e7f('0x3b')]=_0x4f4ff4;})[_0x1e7f('0x1c')](_0x4cffe6=>{if(!(Q(_0x4cffe6)||_0x1e7f('0x4b')===_0x4cffe6[_0x1e7f('0x6')]&&void 0x0!==_0x4cffe6[_0x1e7f('0x3d')][_0x1e7f('0x34')]))throw _0x4cffe6;for(const _0x474f3d of _0x3ed8d9){!this[_0x1e7f('0x42')][_0x1e7f('0x48')][_0x1e7f('0x17')](_0x474f3d['id'])||this[_0x1e7f('0x42')]['_bufferUpdate'](_0x474f3d['id'],_0x474f3d,!0x1);}if(Q(_0x4cffe6))throw _0x4cffe6;});}}},this[_0x1e7f('0x2b')](this[_0x1e7f('0x22')],_0x1e7f('0x11'),(_0x13d2b4,{revisionsData:_0x4c9ebb,requestId:_0x401987})=>{Math[_0x1e7f('0x2f')](..._0x4c9ebb['map'](_0x6744db=>_0x6744db[_0x1e7f('0x36')]))>this['_getLatestVersionFromServerOperations']()-0x1?this[_0x1e7f('0x10')]()[_0x1e7f('0x51')](()=>{this[_0x1e7f('0x30')](_0x4c9ebb,_0x401987);}):this['_handleRevisionsUpdate'](_0x4c9ebb,_0x401987);});const {revisions:_0x5d2637,requestId:_0x1e0f6d}=await this[_0x1e7f('0x22')][_0x1e7f('0x1a')](_0x37d206['connection']);_0x37d206[_0x1e7f('0x26')](this),this['_lastRequestId']=_0x1e0f6d,await this['_fetchMissingUsers'](_0x5d2637);for(const _0x50f5e6 of _0x5d2637)this[_0x1e7f('0x42')][_0x1e7f('0x46')](_0x50f5e6);this['listenTo'](_0x365b97,_0x1e7f('0x1f'),(_0x3d6841,_0xbf90e8,_0x2b5725)=>{_0x2b5725&&(this[_0x1e7f('0x24')]=_0x365b97[_0x1e7f('0x27')],_0x3d6841[_0x1e7f('0x25')]());}),this[_0x1e7f('0x42')]['bind'](_0x1e7f('0x45'))['to'](_0x37d206,'state',_0x4c3db9=>_0x1e7f('0x41')===_0x4c3db9);}async[_0x1e7f('0x1e')](){const _0xf7d13c=this[_0x1e7f('0x15')][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x15dafd),_0x28693e=this[_0x1e7f('0x15')][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x2c1bfa),_0x44898a=async()=>{const _0x1f82d5=this[_0x1e7f('0x42')]['currentRevision'],_0x59677c=_0x1f82d5['id'],_0x4dbeb8=_0x59677c!==_0x28693e['sessionId'];if(_0x4dbeb8){const _0x137f59=_0x28693e['_offset']-this['_oldOffset'],_0x2e30e5=this[_0x1e7f('0x19')]();this[_0x1e7f('0x42')][_0x1e7f('0x3c')][_0x1e7f('0x14')]();if(_0x1f82d5[_0x1e7f('0x36')]+_0x137f59!==_0x2e30e5){const _0x44f7a1=_0x1f82d5[_0x1e7f('0x49')]+_0x137f59,_0x50c721=this['editor'][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x1e7f('0x4d')),_0x298d9c=this[_0x1e7f('0x42')]['buildRevisionData']({'currentRevision':_0x1f82d5,'from':_0x44f7a1,'to':_0x2e30e5});_0x298d9c['id']=_0x1f82d5['id'];const _0x546d32=_0x298d9c[_0x1e7f('0x4a')][_0x1e7f('0x3')](_0x4e41fd=>_0x50c721[_0x1e7f('0x3f')](_0x4e41fd));_0x1f82d5[_0x1e7f('0xb')]({..._0x298d9c,'authors':_0x546d32},!0x0),this['_revisionTracker'][_0x1e7f('0x9')](_0x1f82d5['id'],_0x298d9c,!0x0);}this['_revisionTracker'][_0x1e7f('0x12')]=_0x2e30e5,(_0x1f82d5[_0x1e7f('0x36')]===_0x1f82d5[_0x1e7f('0x49')]&&!this[_0x1e7f('0x42')][_0x1e7f('0x1d')]['has'](_0x59677c)&&this[_0x1e7f('0x42')][_0x1e7f('0x48')][_0x1e7f('0x4e')][_0x1e7f('0x3e')](_0x59677c),this[_0x1e7f('0x42')][_0x1e7f('0x38')](_0x2e30e5));}const {revisions:_0x404d38,requestId:_0x56f529}=await this['_revisionHistoryService'][_0x1e7f('0x1e')](_0xf7d13c['connection'],this[_0x1e7f('0x3b')]);_0x4dbeb8&&_0x404d38[_0x1e7f('0xe')]>0x0?_0x28693e[_0x1e7f('0x55')]():(await this['_fetchMissingUsers'](_0x404d38),this[_0x1e7f('0x30')](_0x404d38,_0x56f529),this[_0x1e7f('0x42')]['sendBufferedUpdates']());};return _0x28693e[_0x1e7f('0x29')]?_0x44898a():new Promise((_0x5bdbbd,_0x341269)=>{_0x28693e[_0x1e7f('0x44')](_0x1e7f('0x1f'),()=>{_0x44898a()[_0x1e7f('0x51')](_0x5bdbbd)[_0x1e7f('0x1c')](_0x341269);});});}['destroy'](){this[_0x1e7f('0x43')]&&this[_0x1e7f('0x43')][_0x1e7f('0x16')](),super[_0x1e7f('0x2a')]();}async[_0x1e7f('0x40')](){this[_0x1e7f('0x22')]['isConnected']||await new Promise(_0x5f426d=>{this[_0x1e7f('0x2b')](this[_0x1e7f('0x22')],_0x1e7f('0x41'),_0x17ae5c=>{_0x17ae5c['off'](),_0x5f426d();});});}[_0x1e7f('0x19')](){const _0x41f5a4=this['editor'][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x2c1bfa)['serverHistory'];for(const _0x3fc7a2 of _0x41f5a4['getOperations']()[_0x1e7f('0xd')]())if(_0x1e7f('0x21')!==_0x3fc7a2[_0x1e7f('0x33')]||_0x3fc7a2[_0x1e7f('0x39')])return _0x3fc7a2[_0x1e7f('0x4')]+0x1;}['_getLatestVersion'](){const _0x49c419=this[_0x1e7f('0x15')][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x2c1bfa);return new Promise(_0x10c286=>{_0x49c419[_0x1e7f('0xa')]?_0x49c419[_0x1e7f('0x44')](_0x1e7f('0x18'),()=>{_0x10c286(this[_0x1e7f('0x19')]());}):_0x10c286(this['_getLatestVersionFromServerOperations']());});}[_0x1e7f('0x30')](_0x4fe9ec,_0x48dcf7){const _0x2b40e1=this[_0x1e7f('0x42')][_0x1e7f('0x48')];this['_lastRequestId']=_0x48dcf7;for(const _0x1134fd of _0x4fe9ec){const _0x1b4540=_0x2b40e1[_0x1e7f('0x17')](_0x1134fd['id']);if(_0x1b4540){if((_0x1134fd[_0x1e7f('0x49')]||_0x1134fd[_0x1e7f('0x36')])&&(_0x1134fd['diffData']=null),_0x1b4540===this[_0x1e7f('0x42')][_0x1e7f('0x2e')]){const _0x5d3d83=Math['max'](_0x1b4540['toVersion'],_0x1134fd[_0x1e7f('0x36')]),_0x5f5ad8=Math['max'](_0x1b4540['fromVersion'],_0x1134fd[_0x1e7f('0x49')]);let _0x2f07fd;_0x1b4540['toVersion']===_0x1134fd[_0x1e7f('0x36')]&&_0x1b4540[_0x1e7f('0x49')]===_0x1134fd[_0x1e7f('0x49')]?(_0x2f07fd=!0x0,this[_0x1e7f('0x0')](_0x1134fd)):_0x1134fd[_0x1e7f('0x36')]===_0x5d3d83&&_0x1134fd[_0x1e7f('0x49')]===_0x5f5ad8?_0x2f07fd=!0x1:(_0x1b4540['toVersion']===_0x5d3d83&&_0x1b4540[_0x1e7f('0x49')]===_0x5f5ad8||this[_0x1e7f('0x13')]({'revision':_0x1b4540,'from':_0x5f5ad8,'to':_0x5d3d83}),_0x2f07fd=!0x0),_0x2f07fd&&(delete _0x1134fd[_0x1e7f('0x49')],delete _0x1134fd[_0x1e7f('0x36')],delete _0x1134fd[_0x1e7f('0x7')],delete _0x1134fd['createdAt'],delete _0x1134fd[_0x1e7f('0x4a')]);}this[_0x1e7f('0x42')][_0x1e7f('0xc')](_0x1134fd),this[_0x1e7f('0x0')](_0x1134fd);}else this[_0x1e7f('0x42')][_0x1e7f('0x46')](_0x1134fd);}const _0x1588c6=_0x2b40e1[_0x1e7f('0x8')]();_0x1588c6[_0x1e7f('0xd')]();for(let _0x49379f=0x0;_0x49379f<_0x1588c6[_0x1e7f('0xe')]-0x1;_0x49379f++){const _0x4d94c7=_0x1588c6[_0x49379f],_0x2e1ab0=_0x1588c6[_0x49379f+0x1];if(_0x4d94c7['fromVersion']<_0x2e1ab0[_0x1e7f('0x36')]){const _0x3a4ffb=_0x2e1ab0[_0x1e7f('0x36')],_0x2bd4fc=Math[_0x1e7f('0x2f')](_0x3a4ffb,_0x4d94c7[_0x1e7f('0x36')]);this['_fixRevision']({'revision':_0x4d94c7,'from':_0x3a4ffb,'to':_0x2bd4fc});}}}['_fixRevision']({revision:_0x48cbfc,from:_0x2f8cb8,to:_0x12b8fc}={}){const _0x3d7612=this[_0x1e7f('0x15')][_0x1e7f('0x47')]['get'](_0x1e7f('0x4d')),_0x5ba25d=this[_0x1e7f('0x42')][_0x1e7f('0x1')]({'revision':_0x48cbfc,'from':_0x2f8cb8,'to':_0x12b8fc});_0x5ba25d['authors']=_0x5ba25d[_0x1e7f('0x4a')][_0x1e7f('0x3')](_0xb9e5cf=>_0x3d7612[_0x1e7f('0x3f')](_0xb9e5cf)),_0x48cbfc[_0x1e7f('0xb')](_0x5ba25d);}[_0x1e7f('0x0')](_0x127fa2){const _0x4da659={};_0x4da659['id']=_0x127fa2['id'];for(const _0xa115 of Object[_0x1e7f('0x20')](_0x127fa2))'id'!==_0xa115&&(_0x4da659[_0xa115]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4da659['id'],_0x4da659,!0x0);}async['_fetchMissingUsers'](_0x3c6bac){const _0x50eaa4=this[_0x1e7f('0x15')]['plugins'][_0x1e7f('0x1b')](_0x22c699),{connection:_0x13de3f}=this[_0x1e7f('0x15')][_0x1e7f('0x47')][_0x1e7f('0x1b')](_0x15dafd),_0x444186=new Set();for(const _0x4c9a68 of _0x3c6bac){for(const _0x49ea45 of _0x4c9a68[_0x1e7f('0x4a')])_0x47fc95(_0x49ea45);_0x4c9a68[_0x1e7f('0x2d')]&&_0x47fc95(_0x4c9a68[_0x1e7f('0x2d')]);}if(0x0===_0x444186[_0x1e7f('0x3a')])return;const _0x4f520e=await _0x56c5f8['getMany'](_0x13de3f,Array['from'](_0x444186));for(const _0x4e63a9 of _0x4f520e)_0x50eaa4[_0x1e7f('0x3f')](_0x4e63a9['id'])||_0x50eaa4['addUser'](_0x4e63a9);function _0x47fc95(_0x506fb0){_0x50eaa4[_0x1e7f('0x3f')](_0x506fb0)||_0x444186['add'](_0x506fb0);}}}function Q(_0x5ed04b){return _0x5ed04b[_0x1e7f('0x28')]['startsWith'](_0x1e7f('0x35'))||_0x5ed04b[_0x1e7f('0x28')]['startsWith'](_0x1e7f('0x52'))||_0x5ed04b[_0x1e7f('0x28')]['startsWith'](_0x1e7f('0x5'));}v[_0x1e7f('0x50')]=_0x613f68;
|
|
23
|
+
const _0x3ad9=['_lastRequestId','editor','sessionId','getRevision','_revisionHistoryService','sendBufferedUpdates','isEmptyCurrent','isConnected','toVersion','revisionsUpdated','isBundleUploaded','cloudServices.bundleVersion','_fetchMissingUsers','keys','getRevisions','400','destroy','config','_handleRevisionsUpdate','cloud-services-internal-error:\x20Request\x20timeout.','plugins','map','setRevisionData','change:_isPendingUpdate','requires','buildRevisionData','adapter','_revisions','_preventResendingRevisionData','off','startsWith','change:_isConnected','baseVersion','_revisionTracker','_update','getUser','reconnect','fromVersion','catch','reverse','cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.','diffData','_fixRevision','message','get','_startingVersion','_bufferUpdate','listenTo','state','authors','setSource','RevisionTracker','serverHistory','_offset','length','size','repository','creatorId','bind','marker','_getLatestVersionFromServerOperations','code','_oldOffset','connection','init','RevisionHistoryService','once','createdAt','cloud-services-internal-error:\x20Not\x20connected.','affectsData','_waitForServiceReady','remove','addUser','data','type','isEnabled','addRevisionData','collaboration.channelId','currentRevision','authorsIds','_handleReconnectionError','max','then'];(function(_0x5bd477,_0x3ad964){const _0x1e2bd8=function(_0x2e5ad5){while(--_0x2e5ad5){_0x5bd477['push'](_0x5bd477['shift']());}};_0x1e2bd8(++_0x3ad964);}(_0x3ad9,0x1e6));const _0x1e2b=function(_0x5bd477,_0x3ad964){_0x5bd477=_0x5bd477-0x0;let _0x1e2bd8=_0x3ad9[_0x5bd477];return _0x1e2bd8;};import{Plugin as _0x128552}from'ckeditor5/src/core';import{version as _0x134d20}from'ckeditor5/src/utils';import{Users as _0x292587}from'ckeditor5-collaboration/src/collaboration-core';import _0x36f851 from'../realtimecollaborativeediting/realtimecollaborationclient';import _0x3625f4 from'../realtimecollaborativeediting/websocketgateway';import _0x4599c5 from'../realtimecollaborativeediting/sessions';import _0x1aa608 from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import _0x3f9f90 from'@ckeditor/ckeditor-cloud-services-collaboration/src/revision-history/revisionhistoryservice';import _0x4617f5 from'@ckeditor/ckeditor-cloud-services-collaboration/src/editor/editorservice';import{WEB_SOCKET_GATEWAY_STATES as _0x1e020a}from'@ckeditor/ckeditor-cloud-services-collaboration/src/websocketgateway/websocketgateway';export default class v extends _0x128552{static get[_0x1e2b('0x24')](){return[_0x3625f4,_0x36f851,_0x1e2b('0x3f'),_0x4599c5,_0x292587];}constructor(_0x16bf30){super(_0x16bf30);const _0x569bb9=this[_0x1e2b('0xd')][_0x1e2b('0x1d')]['get'](_0x1e2b('0x6'));this[_0x1e2b('0xc')]=null,this['_revisionTracker']=this[_0x1e2b('0xd')][_0x1e2b('0x20')][_0x1e2b('0x38')](_0x1e2b('0x3f')),this[_0x1e2b('0x10')]=new v[(_0x1e2b('0x4d'))](_0x569bb9);}async[_0x1e2b('0x4c')](){const _0x1bacc4=this[_0x1e2b('0xd')]['plugins'][_0x1e2b('0x38')](_0x36f851),_0x129eee=_0x1bacc4['serverHistory'],_0x515994=this[_0x1e2b('0xd')][_0x1e2b('0x20')][_0x1e2b('0x38')](_0x3625f4);this[_0x1e2b('0x2d')][_0x1e2b('0x3e')]({'history':_0x129eee,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1bacc4['sessionId']});const _0x1143dd=this[_0x1e2b('0xd')]['config']['get'](_0x1e2b('0x17'))||_0x134d20,_0x31b947=await _0x4617f5[_0x1e2b('0x16')](_0x515994[_0x1e2b('0x4b')],_0x1143dd);this[_0x1e2b('0x2d')][_0x1e2b('0x26')]={'getRevision':async({revisionId:_0x100ace})=>(await this[_0x1e2b('0x52')](),await this[_0x1e2b('0x10')][_0x1e2b('0xf')](_0x100ace)),'updateRevisions':async _0x2abdc5=>{await this[_0x1e2b('0x52')]();const _0x53ad6d=this['_revisionTracker'][_0x1e2b('0x7')];if(_0x31b947&&0x1===_0x2abdc5[_0x1e2b('0x42')]&&_0x2abdc5[0x0]['id']===_0x53ad6d['id'])return _0x2abdc5;for(const _0x1c76a4 of _0x2abdc5)_0x1c76a4['id']===_0x53ad6d['id']&&(_0x1c76a4[_0x1e2b('0x12')]=_0x1c76a4[_0x1e2b('0x31')]===_0x1c76a4['toVersion']);return this[_0x1e2b('0x10')]['updateRevisions'](_0x2abdc5,this['_lastRequestId'])[_0x1e2b('0xb')](_0x202841=>(this[_0x1e2b('0xc')]=_0x202841,_0x2abdc5))['catch'](_0x45b8af=>{if(ot(_0x45b8af)||_0x1e2b('0x1b')===_0x45b8af[_0x1e2b('0x49')]&&void 0x0!==_0x45b8af[_0x1e2b('0x2')]['wrongRequestId']){for(const _0x578807 of _0x2abdc5){!this['_revisionTracker'][_0x1e2b('0x44')][_0x1e2b('0xf')](_0x578807['id'])||this[_0x1e2b('0x2d')][_0x1e2b('0x3a')](_0x578807['id'],_0x578807,!0x1);}if(ot(_0x45b8af))throw _0x45b8af;return _0x2abdc5;}throw _0x45b8af;});}},this[_0x1e2b('0x3b')](this[_0x1e2b('0x10')],_0x1e2b('0x15'),(_0xc40528,{revisionsData:_0x5dc31f,requestId:_0x1abef6})=>{Math[_0x1e2b('0xa')](..._0x5dc31f[_0x1e2b('0x21')](_0x397b94=>_0x397b94[_0x1e2b('0x14')]))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()[_0x1e2b('0xb')](()=>{this['_handleRevisionsUpdate'](_0x5dc31f,_0x1abef6);}):this[_0x1e2b('0x1e')](_0x5dc31f,_0x1abef6);});const {revisions:_0x4c7fb0,requestId:_0x5f5947}=await this[_0x1e2b('0x10')]['connect'](_0x515994[_0x1e2b('0x4b')]);_0x515994['addToReconnectionStack'](this),this['_lastRequestId']=_0x5f5947,await this[_0x1e2b('0x18')](_0x4c7fb0);for(const _0x3863a8 of _0x4c7fb0)this[_0x1e2b('0x2d')]['addRevisionData'](_0x3863a8);this[_0x1e2b('0x3b')](_0x1bacc4,_0x1e2b('0x2b'),(_0x4e2c8f,_0xd3cf10,_0x4c7d1b)=>{_0x4c7d1b&&(this[_0x1e2b('0x4a')]=_0x1bacc4[_0x1e2b('0x41')],_0x4e2c8f['off']());}),this[_0x1e2b('0x2d')][_0x1e2b('0x46')](_0x1e2b('0x4'))['to'](_0x515994,_0x1e2b('0x3c'),_0x505b4d=>_0x505b4d===_0x1e020a['CONNECTED']);}async[_0x1e2b('0x30')](){const _0x4e87a0=this[_0x1e2b('0xd')]['plugins'][_0x1e2b('0x38')](_0x3625f4),_0x37f400=this[_0x1e2b('0xd')]['plugins']['get'](_0x36f851),_0x30ef70=async()=>{const _0x9f8caf=this[_0x1e2b('0x2d')][_0x1e2b('0x7')],_0x113aeb=_0x9f8caf['id'],_0x30f4b8=_0x113aeb!==_0x37f400[_0x1e2b('0xe')];if(_0x30f4b8){const _0x3742ea=_0x37f400['_offset']-this[_0x1e2b('0x4a')],_0x3e8ce9=this[_0x1e2b('0x48')]();this[_0x1e2b('0x2d')]['_revisionDataBuilder']['reInit']();if(_0x9f8caf[_0x1e2b('0x14')]+_0x3742ea!==_0x3e8ce9){const _0x2a1c4d=_0x9f8caf[_0x1e2b('0x31')]+_0x3742ea,_0x27a313=this[_0x1e2b('0xd')][_0x1e2b('0x20')]['get'](_0x292587),_0x27eadb=this[_0x1e2b('0x2d')][_0x1e2b('0x25')]({'revision':_0x9f8caf,'from':_0x2a1c4d,'to':_0x3e8ce9});_0x27eadb['id']=_0x9f8caf['id'];const _0x1f2edd=_0x27eadb[_0x1e2b('0x8')]['map'](_0x31be79=>_0x27a313[_0x1e2b('0x2f')](_0x31be79));_0x9f8caf[_0x1e2b('0x2e')]({..._0x27eadb,'authors':_0x1f2edd},!0x0),this[_0x1e2b('0x2d')]['_bufferUpdate'](_0x9f8caf['id'],_0x27eadb,!0x0);}this[_0x1e2b('0x2d')][_0x1e2b('0x39')]=_0x3e8ce9,(_0x9f8caf[_0x1e2b('0x14')]===_0x9f8caf[_0x1e2b('0x31')]&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x113aeb)&&this[_0x1e2b('0x2d')][_0x1e2b('0x44')][_0x1e2b('0x27')][_0x1e2b('0x0')](_0x113aeb),this[_0x1e2b('0x2d')]['_createCurrentRevision'](_0x3e8ce9));}const {revisions:_0x63cd2e,requestId:_0x50534b}=await this[_0x1e2b('0x10')][_0x1e2b('0x30')](_0x4e87a0[_0x1e2b('0x4b')],this[_0x1e2b('0xc')]);_0x30f4b8&&_0x63cd2e['length']>0x0?_0x37f400[_0x1e2b('0x9')]():(await this[_0x1e2b('0x18')](_0x63cd2e),this[_0x1e2b('0x1e')](_0x63cd2e,_0x50534b),this['_revisionTracker'][_0x1e2b('0x11')]());};return _0x37f400['_isConnected']?_0x30ef70():new Promise((_0x3de57c,_0x2ae7b1)=>{_0x37f400[_0x1e2b('0x4e')]('change:_isConnected',()=>{_0x30ef70()[_0x1e2b('0xb')](_0x3de57c)[_0x1e2b('0x32')](_0x2ae7b1);});});}[_0x1e2b('0x1c')](){super[_0x1e2b('0x1c')]();}async['_waitForServiceReady'](){this[_0x1e2b('0x10')][_0x1e2b('0x13')]||await new Promise(_0x37bf6f=>{this[_0x1e2b('0x3b')](this[_0x1e2b('0x10')],'connected',_0xd7e099=>{_0xd7e099[_0x1e2b('0x29')](),_0x37bf6f();});});}[_0x1e2b('0x48')](){const _0x4e8ffb=this[_0x1e2b('0xd')][_0x1e2b('0x20')][_0x1e2b('0x38')](_0x36f851)[_0x1e2b('0x40')]['getOperations']()[_0x1e2b('0x33')]();for(const _0x6e612b of _0x4e8ffb)if(_0x1e2b('0x47')!==_0x6e612b[_0x1e2b('0x3')]||_0x6e612b[_0x1e2b('0x51')])return _0x6e612b[_0x1e2b('0x2c')]+0x1;}['_getLatestVersion'](){const _0x21755f=this[_0x1e2b('0xd')][_0x1e2b('0x20')][_0x1e2b('0x38')](_0x36f851);return new Promise(_0x2a4969=>{_0x21755f['_isPendingUpdate']?_0x21755f[_0x1e2b('0x4e')](_0x1e2b('0x23'),()=>{_0x2a4969(this['_getLatestVersionFromServerOperations']());}):_0x2a4969(this[_0x1e2b('0x48')]());});}[_0x1e2b('0x1e')](_0x171615,_0x2297f8){const _0x101cb9=this['_revisionTracker'][_0x1e2b('0x44')];this[_0x1e2b('0xc')]=_0x2297f8;for(const _0x2b69a2 of _0x171615){const _0x4a9a84=_0x101cb9[_0x1e2b('0xf')](_0x2b69a2['id']);if(_0x4a9a84){if((_0x2b69a2['fromVersion']||_0x2b69a2[_0x1e2b('0x14')])&&(_0x2b69a2[_0x1e2b('0x35')]=null),_0x4a9a84===this[_0x1e2b('0x2d')]['currentRevision']){const _0xd061da=Math['max'](_0x4a9a84[_0x1e2b('0x14')],_0x2b69a2[_0x1e2b('0x14')]),_0x3b64a8=Math[_0x1e2b('0xa')](_0x4a9a84['fromVersion'],_0x2b69a2[_0x1e2b('0x31')]);let _0x18526a;_0x4a9a84['toVersion']===_0x2b69a2[_0x1e2b('0x14')]&&_0x4a9a84[_0x1e2b('0x31')]===_0x2b69a2[_0x1e2b('0x31')]?(_0x18526a=!0x0,this['_preventResendingRevisionData'](_0x2b69a2)):_0x2b69a2[_0x1e2b('0x14')]===_0xd061da&&_0x2b69a2[_0x1e2b('0x31')]===_0x3b64a8?_0x18526a=!0x1:(_0x4a9a84[_0x1e2b('0x14')]===_0xd061da&&_0x4a9a84['fromVersion']===_0x3b64a8||this[_0x1e2b('0x36')]({'revision':_0x4a9a84,'from':_0x3b64a8,'to':_0xd061da}),_0x18526a=!0x0),_0x18526a&&(delete _0x2b69a2['fromVersion'],delete _0x2b69a2[_0x1e2b('0x14')],delete _0x2b69a2[_0x1e2b('0x35')],delete _0x2b69a2[_0x1e2b('0x4f')],delete _0x2b69a2[_0x1e2b('0x8')]);}this[_0x1e2b('0x2d')][_0x1e2b('0x22')](_0x2b69a2),this[_0x1e2b('0x28')](_0x2b69a2);}else this[_0x1e2b('0x2d')][_0x1e2b('0x5')](_0x2b69a2);}const _0x1c7a46=_0x101cb9[_0x1e2b('0x1a')]();_0x1c7a46[_0x1e2b('0x33')]();for(let _0x5af896=0x0;_0x5af896<_0x1c7a46[_0x1e2b('0x42')]-0x1;_0x5af896++){const _0x35fc86=_0x1c7a46[_0x5af896],_0x312fb1=_0x1c7a46[_0x5af896+0x1];if(_0x35fc86[_0x1e2b('0x31')]<_0x312fb1[_0x1e2b('0x14')]){const _0x1704d0=_0x312fb1[_0x1e2b('0x14')],_0x3819f9=Math[_0x1e2b('0xa')](_0x1704d0,_0x35fc86[_0x1e2b('0x14')]);this['_fixRevision']({'revision':_0x35fc86,'from':_0x1704d0,'to':_0x3819f9});}}}[_0x1e2b('0x36')]({revision:_0x198ca3,from:_0x583d3a,to:_0x192fee}={}){const _0x2b14d4=this[_0x1e2b('0xd')][_0x1e2b('0x20')]['get'](_0x292587),_0x4175a8=this[_0x1e2b('0x2d')][_0x1e2b('0x25')]({'revision':_0x198ca3,'from':_0x583d3a,'to':_0x192fee});_0x4175a8[_0x1e2b('0x3d')]=_0x4175a8[_0x1e2b('0x8')][_0x1e2b('0x21')](_0x863eae=>_0x2b14d4[_0x1e2b('0x2f')](_0x863eae)),_0x198ca3[_0x1e2b('0x2e')](_0x4175a8);}[_0x1e2b('0x28')](_0x3e71b9){const _0x1a6ba8={};_0x1a6ba8['id']=_0x3e71b9['id'];for(const _0xc9ecbc of Object[_0x1e2b('0x19')](_0x3e71b9))'id'!==_0xc9ecbc&&(_0x1a6ba8[_0xc9ecbc]=void 0x0);this['_revisionTracker'][_0x1e2b('0x3a')](_0x1a6ba8['id'],_0x1a6ba8,!0x0);}async[_0x1e2b('0x18')](_0x4b55ee){const _0x3dc6a6=this['editor'][_0x1e2b('0x20')][_0x1e2b('0x38')](_0x292587),{connection:_0x1fa9f3}=this['editor']['plugins'][_0x1e2b('0x38')](_0x3625f4),_0x1a1ff1=new Set();for(const _0x3f344e of _0x4b55ee){for(const _0x211244 of _0x3f344e['authorsIds'])_0x405f24(_0x211244);_0x3f344e[_0x1e2b('0x45')]&&_0x405f24(_0x3f344e[_0x1e2b('0x45')]);}if(0x0===_0x1a1ff1[_0x1e2b('0x43')])return;const _0x4000b7=await _0x1aa608['getMany'](_0x1fa9f3,Array['from'](_0x1a1ff1));for(const _0x158d83 of _0x4000b7)_0x3dc6a6['getUser'](_0x158d83['id'])||_0x3dc6a6[_0x1e2b('0x1')](_0x158d83);function _0x405f24(_0x1efa70){_0x3dc6a6[_0x1e2b('0x2f')](_0x1efa70)||_0x1a1ff1['add'](_0x1efa70);}}}function ot(_0x2aa1e4){return _0x2aa1e4['message']['startsWith'](_0x1e2b('0x34'))||_0x2aa1e4[_0x1e2b('0x37')][_0x1e2b('0x2a')](_0x1e2b('0x50'))||_0x2aa1e4['message'][_0x1e2b('0x2a')](_0x1e2b('0x1f'));}v['RevisionHistoryService']=_0x3f9f90;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module real-time-collaboration/realtimecollaborativerevisionhistory
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
|
|
6
|
+
/**
|
|
7
|
+
* Enables the real-time collaborative revision history feature.
|
|
8
|
+
*
|
|
9
|
+
* Requires adding `RevisionHistory` to the list of editor plugins.
|
|
10
|
+
*
|
|
11
|
+
* Check the {@glink features/collaboration/real-time-collaboration/real-time-collaboration-integration Real-time collaboration guide}
|
|
12
|
+
* to see how to launch the editor in the real-time collaboration mode.
|
|
13
|
+
*/
|
|
14
|
+
export default class RealTimeCollaborativeRevisionHistory extends Plugin {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get requires(): PluginDependencies;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): 'RealTimeCollaborativeRevisionHistory';
|
|
23
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x45ca=['requires','pluginName'];(function(_0x32084e,_0x45ca5d){var _0x481ae9=function(_0x17ca95){while(--_0x17ca95){_0x32084e['push'](_0x32084e['shift']());}};_0x481ae9(++_0x45ca5d);}(_0x45ca,0x136));var _0x481a=function(_0x32084e,_0x45ca5d){_0x32084e=_0x32084e-0x0;var _0x481ae9=_0x45ca[_0x32084e];return _0x481ae9;};import{Plugin as _0x592ad0}from'ckeditor5/src/core';import _0x7b037c from'./realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter';import _0x3d9bd0 from'./realtimecollaborativeediting';export default class d extends _0x592ad0{static get[_0x481a('0x0')](){return['RevisionHistory',_0x7b037c,_0x3d9bd0];}static get[_0x481a('0x1')](){return'RealTimeCollaborativeRevisionHistory';}}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module real-time-collaboration/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import TrackChangesService from '@ckeditor/ckeditor-cloud-services-collaboration/src/track-changes/trackchangesservice';
|
|
7
|
+
import { type ReconnectPlugin } from '../realtimecollaborativeediting/websocketgateway';
|
|
8
|
+
/**
|
|
9
|
+
* The Cloud Services Track Changes Adapter plugin.
|
|
10
|
+
*/
|
|
11
|
+
export default class CloudServicesTrackChangesAdapter extends Plugin implements ReconnectPlugin {
|
|
12
|
+
static TrackChangesService: typeof TrackChangesService;
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get requires(): PluginDependencies;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
constructor(editor: Editor);
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* A method that will be executed when the `WebSocketGateway` will reconnect.
|
|
27
|
+
*/
|
|
28
|
+
reconnect(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Waits for the service to be ready before calling the service API.
|
|
31
|
+
*/
|
|
32
|
+
private _waitForServiceReady;
|
|
33
|
+
private _fetchMissingUsersForThreads;
|
|
34
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2dfb=['collaboration.channelId','plugins','requires','off','addSuggestionData','TrackChangesService','update','TrackChangesEditing','catch','size','add','hasSuggestion','init','type','listenTo','adapter','startsWith','config','from','find','editor','_waitForServiceReady','cloud-services-internal-error:\x20Not\x20connected.','connect','delete','values','attributes','addUser','connected','set','_fetchMissingUsersForThreads','_bufferedRequests','suggestionUpdated','getMany','message','_trackChangesService','getSuggestion','get','addToReconnectionStack','isConnected','reconnect','cloud-services-internal-error:\x20Request\x20timeout.'];(function(_0x4454b9,_0x2dfbe2){const _0xb58c3f=function(_0x543a94){while(--_0x543a94){_0x4454b9['push'](_0x4454b9['shift']());}};_0xb58c3f(++_0x2dfbe2);}(_0x2dfb,0x75));const _0xb58c=function(_0x4454b9,_0x2dfbe2){_0x4454b9=_0x4454b9-0x0;let _0xb58c3f=_0x2dfb[_0x4454b9];return _0xb58c3f;};import{Plugin as _0x5d341c}from'ckeditor5/src/core';import _0x5ef3bb from'@ckeditor/ckeditor-cloud-services-collaboration/src/track-changes/trackchangesservice';import _0x1f15d7 from'../realtimecollaborativeediting/websocketgateway';import _0x382ae5 from'../realtimecollaborativecomments/cloudservicescommentsadapter';import _0xfb4c93 from'@ckeditor/ckeditor-cloud-services-collaboration/src/users/user';import{Users as _0x491abf}from'ckeditor5-collaboration/src/collaboration-core';export default class g extends _0x5d341c{static get[_0xb58c('0xb')](){return[_0x382ae5,_0xb58c('0x10'),_0x1f15d7];}constructor(_0x1a34e7){super(_0x1a34e7);const _0x394b57=this[_0xb58c('0x1d')][_0xb58c('0x1a')][_0xb58c('0x4')](_0xb58c('0x9'));this[_0xb58c('0x28')]=new Map(),this['_trackChangesService']=new g[(_0xb58c('0xe'))](_0x394b57);}[_0xb58c('0x15')](){const _0x1bacc9=this[_0xb58c('0x1d')][_0xb58c('0xa')][_0xb58c('0x4')](_0x1f15d7),_0x4fa710=this[_0xb58c('0x1d')][_0xb58c('0xa')]['get'](_0xb58c('0x10'));return _0x4fa710[_0xb58c('0x18')]={'getSuggestion':async _0x426cd3=>{await this['_waitForServiceReady']();const _0x53cf76=await this[_0xb58c('0x2')][_0xb58c('0x4')](_0x426cd3)[_0xb58c('0x11')](tt);return await this[_0xb58c('0x27')]([_0x53cf76]),_0x53cf76;},'addSuggestion':async({id:_0x512e84,type:_0x1ec36e,data:_0x585718,originalSuggestionId:_0x130fd3,attributes:_0x2b8001})=>{await this[_0xb58c('0x1e')]();const _0x11cba6={'id':_0x512e84,'type':_0x1ec36e,'data':_0x585718,'originalSuggestionId':_0x130fd3,'attributes':_0x2b8001},_0x22e846=await this[_0xb58c('0x2')][_0xb58c('0x13')](_0x512e84,_0x1ec36e,_0x585718,_0x130fd3,_0x2b8001)[_0xb58c('0x11')](_0x5760d1=>{if(ot(_0x5760d1))return new Promise(_0x29f65b=>{this[_0xb58c('0x28')][_0xb58c('0x26')](_0x512e84,{'resolve':_0x29f65b,'suggestionData':_0x11cba6});});throw _0x5760d1;});return this[_0xb58c('0x28')][_0xb58c('0x21')](_0x512e84),_0x22e846;},'updateSuggestion':async(_0x1990a5,_0x42db6a)=>{if(await this[_0xb58c('0x1e')](),'open'!==_0x42db6a['state'])return this['_trackChangesService'][_0xb58c('0xf')](_0x1990a5,_0x42db6a)[_0xb58c('0x11')](tt);}},this[_0xb58c('0x17')](this[_0xb58c('0x2')],_0xb58c('0x29'),(_0x34bdb1,_0x4ad485)=>{_0x4fa710[_0xb58c('0x14')](_0x4ad485['id'])&&(_0x4fa710[_0xb58c('0x3')](_0x4ad485['id'])['attributes']=_0x4ad485[_0xb58c('0x23')]);}),this[_0xb58c('0x2')]['connect'](_0x1bacc9['connection'])['then'](_0x4ffae3=>(_0x1bacc9[_0xb58c('0x5')](this),this[_0xb58c('0x27')](_0x4ffae3)['then'](()=>{for(const _0xe2a0f8 of _0x4ffae3){_0x4fa710[_0xb58c('0xd')](_0xe2a0f8)['_saved']=!0x0;}})));}async[_0xb58c('0x7')](){const _0x4b714b=this[_0xb58c('0x1d')]['plugins'][_0xb58c('0x4')](_0xb58c('0x10')),{connection:_0x2502b8}=this[_0xb58c('0x1d')][_0xb58c('0xa')][_0xb58c('0x4')](_0x1f15d7),_0x497840=await this[_0xb58c('0x2')][_0xb58c('0x20')](_0x2502b8);await this[_0xb58c('0x27')](_0x497840);for(const {suggestionData:_0x4fde33,resolve:_0x15cb4f}of this[_0xb58c('0x28')][_0xb58c('0x22')]()){let _0x2b2fa0=_0x497840[_0xb58c('0x1c')](_0x412dcd=>_0x412dcd['id']===_0x4fde33['id']);_0x2b2fa0||(_0x2b2fa0=await this[_0xb58c('0x2')][_0xb58c('0x13')](_0x4fde33['id'],_0x4fde33[_0xb58c('0x16')],_0x4fde33['data'],_0x4fde33['originalSuggestionId'])),_0x15cb4f(_0x2b2fa0);}for(const _0x5da0cc of _0x497840)_0x4b714b[_0xb58c('0x14')](_0x5da0cc['id'])||_0x4b714b[_0xb58c('0xd')](_0x5da0cc);}async[_0xb58c('0x1e')](){this[_0xb58c('0x2')][_0xb58c('0x6')]||await new Promise(_0x11e7ea=>{this[_0xb58c('0x17')](this[_0xb58c('0x2')],_0xb58c('0x25'),_0x2b9a6a=>{_0x2b9a6a[_0xb58c('0xc')](),_0x11e7ea();});});}async[_0xb58c('0x27')](_0xb39322){const _0x10f089=this[_0xb58c('0x1d')][_0xb58c('0xa')][_0xb58c('0x4')](_0x491abf),{connection:_0x4da1e8}=this[_0xb58c('0x1d')][_0xb58c('0xa')][_0xb58c('0x4')](_0x1f15d7),_0x2b4a5b=new Set();for(const {authorId:_0xa9b537}of _0xb39322)_0x10f089['getUser'](_0xa9b537)||_0x2b4a5b[_0xb58c('0x13')](_0xa9b537);if(0x0===_0x2b4a5b[_0xb58c('0x12')])return;const _0x16ed52=await _0xfb4c93[_0xb58c('0x0')](_0x4da1e8,Array[_0xb58c('0x1b')](_0x2b4a5b));for(const _0xdccff of _0x16ed52)_0x10f089['getUser'](_0xdccff['id'])||_0x10f089[_0xb58c('0x24')](_0xdccff);}}function tt(_0x35ae85){if(ot(_0x35ae85))return new Promise(()=>{});throw _0x35ae85;}function ot(_0x73a103){return _0x73a103[_0xb58c('0x1')][_0xb58c('0x19')](_0xb58c('0x1f'))||_0x73a103['message'][_0xb58c('0x19')](_0xb58c('0x8'));}g[_0xb58c('0xe')]=_0x5ef3bb;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module real-time-collaboration/realtimecollaborativetrackchanges
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
|
|
6
|
+
/**
|
|
7
|
+
* Enables the real-time collaborative track changes feature.
|
|
8
|
+
*
|
|
9
|
+
* Check the {@glink features/collaboration/real-time-collaboration/real-time-collaboration-integration Real-time collaboration}
|
|
10
|
+
* guide to see how to launch the editor in the real-time collaboration mode.
|
|
11
|
+
*/
|
|
12
|
+
export default class RealTimeCollaborativeTrackChanges extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get requires(): PluginDependencies;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): 'RealTimeCollaborativeTrackChanges';
|
|
21
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0xcd40=['TrackChanges','pluginName','requires'];(function(_0x50b8d1,_0xcd40a2){var _0x50a1e5=function(_0x259abe){while(--_0x259abe){_0x50b8d1['push'](_0x50b8d1['shift']());}};_0x50a1e5(++_0xcd40a2);}(_0xcd40,0x1b7));var _0x50a1=function(_0x50b8d1,_0xcd40a2){_0x50b8d1=_0x50b8d1-0x0;var _0x50a1e5=_0xcd40[_0x50b8d1];return _0x50a1e5;};import{Plugin as _0x67b4ab}from'ckeditor5/src/core';import _0x54f5ba from'./realtimecollaborativetrackchanges/cloudservicestrackchangesadapter';import _0x1e558c from'./realtimecollaborativecomments';export default class p extends _0x67b4ab{static get[_0x50a1('0x1')](){return[_0x1e558c,_0x54f5ba,_0x50a1('0x2')];}static get[_0x50a1('0x0')](){return'RealTimeCollaborativeTrackChanges';}}
|