@univerjs-pro/collaboration-client 1.0.3 → 1.1.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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/controllers/collaboration/collaboration-state.d.ts +51 -11
- package/lib/types/facade/f-collaboration.d.ts +3 -4
- package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +3 -3
- package/lib/types/services/collaboration-ui-event/collaboration-ui-event.d.ts +1 -0
- package/lib/types/services/data-loader/data-loader.service.d.ts +9 -2
- package/lib/types/services/local-cache/local-cache.service.d.ts +11 -6
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +16 -16
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x3b8851=_0x5e7a;(function(_0x458da0,_0x2d6656){const _0x4880f6=_0x5e7a,_0x226fc1=_0x458da0();while(!![]){try{const _0x19d86d=parseInt(_0x4880f6(0x1f3))/0x1*(parseInt(_0x4880f6(0x1db))/0x2)+parseInt(_0x4880f6(0x1de))/0x3+-parseInt(_0x4880f6(0x1e0))/0x4*(-parseInt(_0x4880f6(0x1f1))/0x5)+parseInt(_0x4880f6(0x1ec))/0x6*(-parseInt(_0x4880f6(0x1ea))/0x7)+-parseInt(_0x4880f6(0x1f4))/0x8*(parseInt(_0x4880f6(0x1eb))/0x9)+parseInt(_0x4880f6(0x1ed))/0xa*(parseInt(_0x4880f6(0x1dd))/0xb)+-parseInt(_0x4880f6(0x1ee))/0xc;if(_0x19d86d===_0x2d6656)break;else _0x226fc1['push'](_0x226fc1['shift']());}catch(_0x37d32c){_0x226fc1['push'](_0x226fc1['shift']());}}}(_0x47fc,0x6e244));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':'點擊重新連線'}},'collabStatus':{'fetchMiss':_0x3b8851(0x1e2),'conflict':_0x3b8851(0x1e5),'notCollab':_0x3b8851(0x1e1),'synced':_0x3b8851(0x1e3),'syncing':_0x3b8851(0x1e9),'offline':'已離線,編輯將儲存在本機'},'session':{'connection-failed':_0x3b8851(0x1f2),'will-retry':_0x3b8851(0x1ef),'room-full':_0x3b8851(0x1d9),'join-failed':_0x3b8851(0x1e6),'room-not-exists':'加入協作失敗,您的編輯將暫存於本機。','room-permission-denied':_0x3b8851(0x1e7),'room-cnt-exceeds':'協作文件數量超過限制,您的編輯將暫存於本機。','collaboration-timeout':'伺服器未回應協作請求,您的編輯將儲存在本機。'},'conflict':{'title':_0x3b8851(0x1dc),'content':_0x3b8851(0x1e4)},'permission':{'title':_0x3b8851(0x1df),'content':_0x3b8851(0x1e8)},'collaboration':{'single-unit':{'warning':_0x3b8851(0x1da)},'closeRoom':'由於協作房間已關閉,編輯權限已被收回。'},'auth':{'needGotoLoginAlert':_0x3b8851(0x1f0)}}};function _0x5e7a(_0x3f4940,_0x1cfd05){_0x3f4940=_0x3f4940-0x1d9;const _0x47fc5e=_0x47fc();let _0x5e7a99=_0x47fc5e[_0x3f4940];return _0x5e7a99;}function _0x47fc(){const _0x3bae62=['沒有協作權限,您的編輯將暫存於本機。','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','同步中...','259nbSoVZ','99vKJwxg','47418WhBGHN','70eVkUSc','7097544RBEGxw','連線失敗,將在稍後重試連線。','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','5tMjDit','連線失敗,請檢查您的網路。','503545sraJxd','68984GdEPIv','此文件協作人數已達上限,您的編輯將暫存於本機。','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','2VVXenT','協作衝突','1355739bhtQrz','105480mSqOzv','認證錯誤','113672DbtIwV','本機檔案','正在擷取伺服器資料...','已同步','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','編輯衝突','加入協作失敗,請稍後重試,您的編輯將暫存於本機。'];_0x47fc=function(){return _0x3bae62;};return _0x47fc();}export{e as default};
|
|
@@ -47,6 +47,20 @@ export declare enum CollaborationStatus {
|
|
|
47
47
|
CONFLICT = "conflict",
|
|
48
48
|
OFFLINE = "offline"
|
|
49
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* The retry of an awaiting changeset. It is handed from one state to the next while the awaiting changeset is
|
|
52
|
+
* kept, so the pending timer, the backoff and the total retry time survive state transitions.
|
|
53
|
+
*/
|
|
54
|
+
export interface IResendSchedule {
|
|
55
|
+
/** The pending retry. `undefined` once it has fired and the awaiting changeset was resent. */
|
|
56
|
+
timer: Observable<{
|
|
57
|
+
reqId: number;
|
|
58
|
+
}> | undefined;
|
|
59
|
+
/** The backoff before the next retry. */
|
|
60
|
+
timeout: number;
|
|
61
|
+
/** The total backoff spent on this awaiting changeset, bounded by `MAX_RETRY_TOTAL_TIMEOUT`. */
|
|
62
|
+
total: number;
|
|
63
|
+
}
|
|
50
64
|
/**
|
|
51
65
|
* Use state machine to manage syncing states.
|
|
52
66
|
* An explanation to how these states are transformed to each other.
|
|
@@ -115,6 +129,22 @@ export declare abstract class CollaborationState {
|
|
|
115
129
|
protected _transformRemoteChangesetByStateCache(changeset: IChangeset): IChangeset;
|
|
116
130
|
protected _syncEditingCollabCursor(changeset: IChangeset): void;
|
|
117
131
|
protected _getCurrentRevision(): number;
|
|
132
|
+
/**
|
|
133
|
+
* Servers may deliver a changeset more than once or out of order, e.g. when several server nodes relay
|
|
134
|
+
* changesets, or after the snapshot used to join already contains it. Revisions already applied are ignored.
|
|
135
|
+
*/
|
|
136
|
+
protected _isAppliedRevision(changeset: IChangeset): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* The awaiting changeset may come back as a broadcast instead of an acknowledgement, e.g. when the request
|
|
139
|
+
* was committed after the client reconnected with another member id.
|
|
140
|
+
*/
|
|
141
|
+
protected _isEchoedAwaitingChangeset(remoteChangeset: IChangeset): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* The acknowledgement echoes the committed changeset, so it can be matched to the awaiting changeset by sid/reqId
|
|
144
|
+
* even when its revision is already contained in the loaded snapshot, e.g. the ack was lost and the awaiting
|
|
145
|
+
* changeset was resent after a reload.
|
|
146
|
+
*/
|
|
147
|
+
protected _isAckOfAwaitingChangeset(ack: IAcknowledgedChangeset): boolean;
|
|
118
148
|
protected _incrementRevisionNumber(): void;
|
|
119
149
|
protected _executeRemoteChangeset(changeset: IChangeset): void;
|
|
120
150
|
}
|
|
@@ -179,7 +209,7 @@ export declare class AwaitingState extends CollaborationState {
|
|
|
179
209
|
private _maxTotalRetryTimeout;
|
|
180
210
|
private _resendTimer;
|
|
181
211
|
private _sender;
|
|
182
|
-
constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, handler: ICollaborationStateHandler, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService);
|
|
212
|
+
constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, handler: ICollaborationStateHandler, schedule: IResendSchedule | undefined, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService);
|
|
183
213
|
appendMutation(mutation: IMutationInfo): CollaborationState;
|
|
184
214
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
|
185
215
|
onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
|
|
@@ -191,7 +221,10 @@ export declare class AwaitingState extends CollaborationState {
|
|
|
191
221
|
toggleOnline(): CollaborationState;
|
|
192
222
|
resend(): void;
|
|
193
223
|
private _onConflict;
|
|
194
|
-
private
|
|
224
|
+
private _subscribeResendTimer;
|
|
225
|
+
private _runScheduledResend;
|
|
226
|
+
/** The retry of the awaiting changeset, to hand to the next state that keeps the changeset. */
|
|
227
|
+
private _resendSchedule;
|
|
195
228
|
private _clearScheduledTask;
|
|
196
229
|
}
|
|
197
230
|
/**
|
|
@@ -208,10 +241,7 @@ export declare class AwaitingWithPendingState extends CollaborationState {
|
|
|
208
241
|
private _maxTotalRetryTimeout;
|
|
209
242
|
private _resendTimer;
|
|
210
243
|
private _sender;
|
|
211
|
-
constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler,
|
|
212
|
-
timeout: number;
|
|
213
|
-
reqId: number;
|
|
214
|
-
}> | undefined, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService | undefined);
|
|
244
|
+
constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: IChangeset, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, schedule: IResendSchedule | undefined, _injector: Injector, revisionService: RevisionService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService, undoRedoService: ICollaborativeUndoRedoService, localCacheService?: ILocalCacheService | undefined);
|
|
215
245
|
appendMutation(mutation: IMutationInfo): CollaborationState;
|
|
216
246
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
|
217
247
|
onRemoteAck(changeset: IAcknowledgedChangeset): CollaborationState;
|
|
@@ -223,7 +253,10 @@ export declare class AwaitingWithPendingState extends CollaborationState {
|
|
|
223
253
|
toggleOnline(): CollaborationState;
|
|
224
254
|
resend(): void;
|
|
225
255
|
private _onConflict;
|
|
226
|
-
private
|
|
256
|
+
private _subscribeResendTimer;
|
|
257
|
+
private _runScheduledResend;
|
|
258
|
+
/** The retry of the awaiting changeset, to hand to the next state that keeps the changeset. */
|
|
259
|
+
private _resendSchedule;
|
|
227
260
|
private _clearScheduledTask;
|
|
228
261
|
}
|
|
229
262
|
/**
|
|
@@ -236,10 +269,12 @@ export declare class ConflictState extends CollaborationState {
|
|
|
236
269
|
private _isPermissionRej;
|
|
237
270
|
private readonly _permissionService;
|
|
238
271
|
private readonly _localeService;
|
|
272
|
+
private readonly _userManagerService;
|
|
273
|
+
private readonly _logService;
|
|
239
274
|
private readonly _collaborationUIEventService;
|
|
240
275
|
private readonly localCacheService?;
|
|
241
276
|
readonly status = CollaborationStatus.CONFLICT;
|
|
242
|
-
constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, _isPermissionRej: boolean | undefined, _permissionService: IPermissionService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, revisionService: RevisionService, _localeService: LocaleService, _collaborationUIEventService: CollaborationUIEventService, localCacheService?: ILocalCacheService | undefined);
|
|
277
|
+
constructor(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[], handler: ICollaborationStateHandler, _isPermissionRej: boolean | undefined, _permissionService: IPermissionService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, revisionService: RevisionService, _localeService: LocaleService, _userManagerService: UserManagerService, _logService: ILogService, _collaborationUIEventService: CollaborationUIEventService, localCacheService?: ILocalCacheService | undefined);
|
|
243
278
|
appendMutation(): CollaborationState;
|
|
244
279
|
onRemoteChangeset(): CollaborationState;
|
|
245
280
|
onRemoteAck(): CollaborationState;
|
|
@@ -280,6 +315,8 @@ export declare class FetchingMissState extends CollaborationState {
|
|
|
280
315
|
*/
|
|
281
316
|
private _acknowledgedAwaitingRevision;
|
|
282
317
|
private _queuedRemoteChangesets;
|
|
318
|
+
/** The retry of the awaiting changeset. The next awaiting state runs it after the fetch. */
|
|
319
|
+
private _resendSchedule;
|
|
283
320
|
private readonly _injector;
|
|
284
321
|
private readonly _logService;
|
|
285
322
|
private readonly _transformService;
|
|
@@ -291,13 +328,16 @@ export declare class FetchingMissState extends CollaborationState {
|
|
|
291
328
|
* Keep the changeset in `_awaitingChangeset` for transform and sid/reqId de-duplication, and store only
|
|
292
329
|
* the acknowledged server revision here.
|
|
293
330
|
*/
|
|
294
|
-
_acknowledgedAwaitingRevision: Nullable<number>, _queuedRemoteChangesets: IChangeset[], handler: ICollaborationStateHandler,
|
|
331
|
+
_acknowledgedAwaitingRevision: Nullable<number>, _queuedRemoteChangesets: IChangeset[], handler: ICollaborationStateHandler,
|
|
332
|
+
/** The retry of the awaiting changeset. The next awaiting state runs it after the fetch. */
|
|
333
|
+
_resendSchedule: IResendSchedule | undefined, _injector: Injector, revisionService: RevisionService, _logService: ILogService, commandService: ICommandService, undoRedoService: ICollaborativeUndoRedoService, _transformService: ITransformService, localCacheService?: ILocalCacheService | undefined);
|
|
295
334
|
onMissedChangesetFetched(changesets: IChangeset[]): CollaborationState;
|
|
296
335
|
private _handleRemoteChangesets;
|
|
297
336
|
private _transformAndApplyRemoteChangeset;
|
|
298
337
|
private _acknowledgeAwaitingIfReady;
|
|
299
338
|
private _acknowledgeAwaiting;
|
|
300
|
-
|
|
339
|
+
/** The awaiting changeset was committed before the loaded snapshot, so there is no new revision to count. */
|
|
340
|
+
private _dropAcknowledgedAwaiting;
|
|
301
341
|
resend(): void;
|
|
302
342
|
appendMutation(mutation: IMutationInfo<object>): CollaborationState;
|
|
303
343
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
|
@@ -305,7 +345,7 @@ export declare class FetchingMissState extends CollaborationState {
|
|
|
305
345
|
onRemoteRej(config?: {
|
|
306
346
|
isPermissionRej: boolean;
|
|
307
347
|
}): CollaborationState;
|
|
308
|
-
onRemoteRetry(): CollaborationState;
|
|
348
|
+
onRemoteRetry(changeset: IChangeset): CollaborationState;
|
|
309
349
|
toggleOffline(): CollaborationState;
|
|
310
350
|
toggleOnline(): CollaborationState;
|
|
311
351
|
private _onConflict;
|
|
@@ -7,8 +7,7 @@ import type { IDisposable } from '@univerjs/core';
|
|
|
7
7
|
import type { FDocument } from '@univerjs/docs/facade';
|
|
8
8
|
import type { IMember } from '@univerjs/protocol';
|
|
9
9
|
import type { FWorkbook } from '@univerjs/sheets/facade';
|
|
10
|
-
import {
|
|
11
|
-
import { CollaborationController, CollaborationStatus } from '@univerjs-pro/collaboration-client';
|
|
10
|
+
import { CollaborationController, CollaborationStatus, DataLoaderService } from '@univerjs-pro/collaboration-client';
|
|
12
11
|
import { Injector, IUniverInstanceService } from '@univerjs/core';
|
|
13
12
|
import { FBase } from '@univerjs/core/facade';
|
|
14
13
|
export interface ICollaborationFlushOptions {
|
|
@@ -27,7 +26,7 @@ export declare class FCollaboration extends FBase {
|
|
|
27
26
|
private readonly _handler;
|
|
28
27
|
protected readonly _injector: Injector;
|
|
29
28
|
protected readonly _univerInstanceService: IUniverInstanceService;
|
|
30
|
-
protected readonly
|
|
29
|
+
protected readonly _dataLoaderService: DataLoaderService;
|
|
31
30
|
protected readonly _collaborationController: CollaborationController;
|
|
32
31
|
constructor(_handler: {
|
|
33
32
|
getWorkbook: (id: string) => FWorkbook | null;
|
|
@@ -36,7 +35,7 @@ export declare class FCollaboration extends FBase {
|
|
|
36
35
|
getBase: (id: string) => FBaseFacade | null;
|
|
37
36
|
getBoard: (id: string) => FBoard | null;
|
|
38
37
|
getPdf: (id: string) => FPdf | null;
|
|
39
|
-
}, _injector: Injector, _univerInstanceService: IUniverInstanceService,
|
|
38
|
+
}, _injector: Injector, _univerInstanceService: IUniverInstanceService, _dataLoaderService: DataLoaderService, _collaborationController: CollaborationController);
|
|
40
39
|
/**
|
|
41
40
|
* Load a Univer Sheet from the server with a unit ID.
|
|
42
41
|
* @param {string} unitId ID of the Univer Sheet that you would like to load.
|
|
@@ -3,7 +3,6 @@ import type { ICollaborationSocket } from '../socket/collaboration-socket.servic
|
|
|
3
3
|
import type { ICollaborationClientAdapter } from './collaboration-client-adapter';
|
|
4
4
|
import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
|
|
5
5
|
import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
|
|
6
|
-
import { INetworkConditionService } from '../network-condition/network-condition.service';
|
|
7
6
|
import { ICollaborationSocketService } from '../socket/collaboration-socket.service';
|
|
8
7
|
import { CollaborationSession, SessionStatus } from './collaboration-session';
|
|
9
8
|
/**
|
|
@@ -17,18 +16,18 @@ export declare class CollaborationSessionService extends Disposable {
|
|
|
17
16
|
private readonly _socketService;
|
|
18
17
|
private readonly _collaborationUIEventService;
|
|
19
18
|
private readonly _adapter;
|
|
20
|
-
private readonly _networkConditionService?;
|
|
21
19
|
private _sessions;
|
|
22
20
|
private _pendingSessions;
|
|
23
21
|
private _sessionChannels;
|
|
24
22
|
private _socketChannels;
|
|
23
|
+
private _networkConditionService?;
|
|
25
24
|
/**
|
|
26
25
|
* Socket for collaboration sessions on the default endpoint.
|
|
27
26
|
*/
|
|
28
27
|
readonly socket$: import("rxjs").Observable<Nullable<ICollaborationSocket>>;
|
|
29
28
|
private _status$;
|
|
30
29
|
status$: import("rxjs").Observable<SessionStatus>;
|
|
31
|
-
constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _adapter: ICollaborationClientAdapter
|
|
30
|
+
constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _adapter: ICollaborationClientAdapter);
|
|
32
31
|
private _listenToNetworkCondition;
|
|
33
32
|
dispose(): void;
|
|
34
33
|
/**
|
|
@@ -66,6 +65,7 @@ export declare class CollaborationSessionService extends Disposable {
|
|
|
66
65
|
private _onMessage;
|
|
67
66
|
private _hasSessionsForEndpoint;
|
|
68
67
|
private _getSocketChannel;
|
|
68
|
+
private _clearHandshakeTimer;
|
|
69
69
|
private _rescheduleHeartbeat;
|
|
70
70
|
private _sendHeartbeat;
|
|
71
71
|
private _waitForHeartbeatResponse;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ILogContext } from '@univerjs-pro/collaboration';
|
|
1
2
|
import type { UnitModel } from '@univerjs/core';
|
|
2
3
|
import { SnapshotService } from '@univerjs-pro/collaboration';
|
|
3
4
|
import { ILogService, RxDisposable, UniverInstanceType } from '@univerjs/core';
|
|
@@ -20,6 +21,12 @@ export declare class DataLoaderService extends RxDisposable {
|
|
|
20
21
|
readonly unitLoaded$: import("rxjs").Observable<UnitModel<object, UniverInstanceType>>;
|
|
21
22
|
constructor(_logService: ILogService, _snapshotService: SnapshotService, _localCacheService?: ILocalCacheService | undefined);
|
|
22
23
|
dispose(): void;
|
|
23
|
-
loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number, subUnitId?: string): Promise<UnitModel | null>;
|
|
24
|
-
|
|
24
|
+
loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number, subUnitId?: string, context?: ILogContext): Promise<UnitModel | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Load a unit from the server. Edits cached locally are replayed on the revision they were cached on, so the
|
|
27
|
+
* snapshot of that revision is loaded when there are any.
|
|
28
|
+
*/
|
|
29
|
+
loadUnit(unitId: string, type: UniverInstanceType, subUnitId?: string, context?: ILogContext): Promise<UnitModel | null>;
|
|
30
|
+
private _loadUnit;
|
|
31
|
+
private _loadSnapshot;
|
|
25
32
|
}
|
|
@@ -2,21 +2,26 @@ import type { IChangeset } from '@univerjs-pro/collaboration';
|
|
|
2
2
|
import type { IMutationInfo, Nullable, UniverInstanceType } from '@univerjs/core';
|
|
3
3
|
export interface IUnitCacheData {
|
|
4
4
|
unitID: string;
|
|
5
|
+
userId?: string | null;
|
|
5
6
|
type: UniverInstanceType;
|
|
6
7
|
rev: number;
|
|
7
8
|
awaitingChangeset: Nullable<IChangeset>;
|
|
8
9
|
mutations: IMutationInfo[];
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Omit userId to use the current UserManagerService user. An explicit empty string
|
|
13
|
+
* or null targets document-only data, including retries after an account change.
|
|
14
|
+
*/
|
|
10
15
|
export interface ILocalCacheService {
|
|
11
|
-
loadOfflineData(unitID: string): Promise<Nullable<IUnitCacheData>>;
|
|
12
|
-
saveOfflineData(unitID: string, data: IUnitCacheData): Promise<boolean>;
|
|
13
|
-
backupOfflineData?(unitID: string, reason: string): Promise<void>;
|
|
14
|
-
clearOfflineData(unitID: string): Promise<void>;
|
|
15
|
-
updateOfflineData(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[]): void;
|
|
16
|
+
loadOfflineData(unitID: string, userId?: string | null): Promise<Nullable<IUnitCacheData>>;
|
|
17
|
+
saveOfflineData(unitID: string, data: IUnitCacheData, userId?: string | null): Promise<boolean>;
|
|
18
|
+
backupOfflineData?(unitID: string, reason: string, userId?: string | null): Promise<void>;
|
|
19
|
+
clearOfflineData(unitID: string, userId?: string | null): Promise<void>;
|
|
20
|
+
updateOfflineData(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[], userId?: string | null): void;
|
|
16
21
|
disableLocalCache(): void;
|
|
17
22
|
enableLocalCache(): void;
|
|
18
23
|
exhaustSavingTask(): Promise<void>;
|
|
19
24
|
saveTaskMap: Map<string, number>;
|
|
20
25
|
}
|
|
21
26
|
export declare const ILocalCacheService: import("@wendellhu/redi").IdentifierDecorator<ILocalCacheService>;
|
|
22
|
-
export declare function getLocalCacheKey(unitID: string): string;
|
|
27
|
+
export declare function getLocalCacheKey(unitID: string, userId?: string | null): string;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x4178(){const _0x171a91=['exports','DataLoaderService','FEventName','add','@univerjs/core/facade','DisposableCollection','getCollaboration','@univerjs-pro/collaboration-client','17745SQhgPs','UniverCore','getCollabEntity','115906EQColz','Event','toStringTag','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','getUnitId','toDisposable','ms.','loadServerUnit','loadBaseAsync','_handler','loadDoc','loadSlide','_resolveUnitId','readyForCollab','\x22\x20after\x20','loadUnitOfRevision','CollaborationStatusChanged','flush','_snapshotService','loadServerUnitOfRevision','UniverProCollaborationClientFacade','object','325991ARBIxG','1411056KUGugY','getBoard','_univerInstanceService','getPresentation','2268837FETNUs','loadBase','358076herWWJ','FEnum','FUniver','FBase','NOT_COLLAB','function','loadPdf','FCollaboration','extend','unsubscribe','status$','switchMap','amd','Injector','UniverProCollaboration','getOwnPropertyDescriptor','CollaborationController','get','getFocusedUnit','10hPlzjB','loadPdfAsync','getDocument','fireEvent','6uoBtHT','Inject','disposeWithMe','pipe','loadSlideAsync','getCollaborationStatus','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','defineProperty','values','144shBQUj','rxjs','MemberService','subscribeCollaborators','timeout','decorate','Module','getBase','waitForRoom$','loadBoardAsync','loadUnit','_collaborationController','getWorkbook','registerEventHandler','@univerjs-pro/collaboration','loadBoard','3046410UkfBrG','SYNCED','length','CollaborationStatus','unitID','subscribe','resolve','status','loadSheet','members$','reject','state','UniverCoreFacade','getPdf','_injector'];_0x4178=function(){return _0x171a91;};return _0x4178();}function _0x46ec(_0x11ab44,_0x45e4ac){_0x11ab44=_0x11ab44-0xd0;const _0x4178a3=_0x4178();let _0x46ec85=_0x4178a3[_0x11ab44];return _0x46ec85;}(function(_0x1627c0,_0x1dbf51){const _0x1ddbf4=_0x46ec,_0x4b36d4=_0x1627c0();while(!![]){try{const _0x40fc8f=parseInt(_0x1ddbf4(0x121))/0x1+parseInt(_0x1ddbf4(0x10b))/0x2*(parseInt(_0x1ddbf4(0xd8))/0x3)+parseInt(_0x1ddbf4(0x128))/0x4*(parseInt(_0x1ddbf4(0xd4))/0x5)+-parseInt(_0x1ddbf4(0xe1))/0x6*(parseInt(_0x1ddbf4(0x108))/0x7)+parseInt(_0x1ddbf4(0x122))/0x8+-parseInt(_0x1ddbf4(0x126))/0x9+-parseInt(_0x1ddbf4(0xf1))/0xa;if(_0x40fc8f===_0x1dbf51)break;else _0x4b36d4['push'](_0x4b36d4['shift']());}catch(_0x30d4a7){_0x4b36d4['push'](_0x4b36d4['shift']());}}}(_0x4178,0x2be1f),function(_0x4b3fac,_0x2390bc){const _0x32761d=_0x46ec;typeof exports==_0x32761d(0x120)&&typeof module<'u'?_0x2390bc(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define==_0x32761d(0x12d)&&define[_0x32761d(0x134)]?define([_0x32761d(0x100),_0x32761d(0x107),_0x32761d(0x104),'@univerjs/core',_0x32761d(0xef),_0x32761d(0xe2)],_0x2390bc):(_0x4b3fac=typeof globalThis<'u'?globalThis:_0x4b3fac||self,_0x2390bc(_0x4b3fac[_0x32761d(0x11f)]={},_0x4b3fac['UniverProCollaborationClient'],_0x4b3fac[_0x32761d(0xfd)],_0x4b3fac[_0x32761d(0x109)],_0x4b3fac[_0x32761d(0x136)],_0x4b3fac[_0x32761d(0xe2)]));}(this,function(_0x4d25f7,_0x5a9ff5,_0x74564e,_0x28b429,_0x429641,_0x5c90fd){const _0x7bb825=_0x46ec;Object[_0x7bb825(0xdf)](_0x4d25f7,Symbol[_0x7bb825(0x10d)],{'value':_0x7bb825(0xe7)});var _0x1044e0=class extends _0x74564e[_0x7bb825(0x129)]{get[_0x7bb825(0xf4)](){const _0x3d1416=_0x7bb825;return _0x5a9ff5[_0x3d1416(0xf4)];}};_0x74564e['FEnum'][_0x7bb825(0x130)](_0x1044e0);var _0x4dbfe5=class extends _0x74564e['FEventName']{get[_0x7bb825(0x11b)](){const _0x400495=_0x7bb825;return _0x400495(0x11b);}};_0x74564e[_0x7bb825(0x102)][_0x7bb825(0x130)](_0x4dbfe5);function _0x63836b(_0x261404,_0x55cfae){return function(_0x1fbaa7,_0x48d7d7){_0x55cfae(_0x1fbaa7,_0x48d7d7,_0x261404);};}function _0x59ec6b(_0x3063a2,_0xee7bd0,_0x5d6f78,_0x56b86c){const _0x25793b=_0x7bb825;var _0x143648=arguments[_0x25793b(0xf3)],_0x6c828c=_0x143648<0x3?_0xee7bd0:_0x56b86c===null?_0x56b86c=Object[_0x25793b(0xd0)](_0xee7bd0,_0x5d6f78):_0x56b86c,_0x38b4cd;if(typeof Reflect==_0x25793b(0x120)&&typeof Reflect['decorate']==_0x25793b(0x12d))_0x6c828c=Reflect[_0x25793b(0xe6)](_0x3063a2,_0xee7bd0,_0x5d6f78,_0x56b86c);else{for(var _0x5b9095=_0x3063a2['length']-0x1;_0x5b9095>=0x0;_0x5b9095--)(_0x38b4cd=_0x3063a2[_0x5b9095])&&(_0x6c828c=(_0x143648<0x3?_0x38b4cd(_0x6c828c):_0x143648>0x3?_0x38b4cd(_0xee7bd0,_0x5d6f78,_0x6c828c):_0x38b4cd(_0xee7bd0,_0x5d6f78))||_0x6c828c);}return _0x143648>0x3&&_0x6c828c&&Object[_0x25793b(0xdf)](_0xee7bd0,_0x5d6f78,_0x6c828c),_0x6c828c;}let _0x1a2363=class extends _0x74564e[_0x7bb825(0x12b)]{constructor(_0x2a6daa,_0x482f5a,_0x15c930,_0x519c7a,_0x13c953){const _0x115b46=_0x7bb825;super(),this['_handler']=_0x2a6daa,this[_0x115b46(0xff)]=_0x482f5a,this[_0x115b46(0x124)]=_0x15c930,this[_0x115b46(0x11d)]=_0x519c7a,this[_0x115b46(0xec)]=_0x13c953;}async['loadSheetAsync'](_0x3bfd68,_0x3351cd){const _0xf4a1a8=_0x7bb825;return await this[_0xf4a1a8(0x11d)][_0xf4a1a8(0xf9)](_0x3bfd68,0x0,_0x3351cd)?(await this[_0xf4a1a8(0xec)]['readyForCollab'](_0x3bfd68),this[_0xf4a1a8(0x114)]['getWorkbook'](_0x3bfd68)):null;}async['loadDocAsync'](_0x41c835,_0x529f25){const _0x513f59=_0x7bb825;return await this['_snapshotService'][_0x513f59(0x115)](_0x41c835,0x0,_0x529f25)?(await this[_0x513f59(0xec)]['readyForCollab'](_0x41c835),this['_handler'][_0x513f59(0xd6)](_0x41c835)):null;}async[_0x7bb825(0x113)](_0xd05731,_0x2b44c6){const _0x43b3e0=_0x7bb825;return await this['_snapshotService'][_0x43b3e0(0x127)](_0xd05731,0x0,_0x2b44c6)?(await this['_collaborationController'][_0x43b3e0(0x118)](_0xd05731),this[_0x43b3e0(0x114)]['getBase'](_0xd05731)):null;}async[_0x7bb825(0xdc)](_0x22b36e,_0x4aa71e){const _0x15d76=_0x7bb825;return await this[_0x15d76(0x11d)][_0x15d76(0x116)](_0x22b36e,0x0,_0x4aa71e)?(await this[_0x15d76(0xec)]['readyForCollab'](_0x22b36e),this[_0x15d76(0x114)][_0x15d76(0x125)](_0x22b36e)):null;}async[_0x7bb825(0xea)](_0x4b6c30,_0x32613c){const _0x5258cd=_0x7bb825;return await this[_0x5258cd(0x11d)][_0x5258cd(0xf0)](_0x4b6c30,0x0,_0x32613c)?(await this[_0x5258cd(0xec)][_0x5258cd(0x118)](_0x4b6c30),this[_0x5258cd(0x114)]['getBoard'](_0x4b6c30)):null;}async[_0x7bb825(0xd5)](_0x97ae9b,_0x325e08){const _0x5c500a=_0x7bb825;return await this[_0x5c500a(0x11d)][_0x5c500a(0x12e)](_0x97ae9b,0x0,_0x325e08)?(await this['_collaborationController'][_0x5c500a(0x118)](_0x97ae9b),this[_0x5c500a(0x114)][_0x5c500a(0xfe)](_0x97ae9b)):null;}[_0x7bb825(0xe4)](_0x4c7e47,_0x46f332){const _0x2b642d=_0x7bb825;let _0x14b85a=this[_0x2b642d(0xff)][_0x2b642d(0xd2)](_0x5a9ff5[_0x2b642d(0xe3)])[_0x2b642d(0xe9)](_0x4c7e47)[_0x2b642d(0xdb)]((0x0,_0x5c90fd[_0x2b642d(0x133)])(_0x58897d=>_0x58897d[_0x2b642d(0xfa)]))[_0x2b642d(0xf6)](_0x49a577=>_0x46f332(Array['from'](_0x49a577[_0x2b642d(0xe0)]())));return(0x0,_0x28b429[_0x2b642d(0x110)])(_0x14b85a);}[_0x7bb825(0xdd)](_0x7570ec){const _0x251b8b=_0x7bb825;let _0x1c0911=this[_0x251b8b(0x117)](_0x7570ec);if(!_0x1c0911)return _0x5a9ff5[_0x251b8b(0xf4)]['NOT_COLLAB'];let _0x36496e=this[_0x251b8b(0xec)][_0x251b8b(0x10a)](_0x1c0911);return(_0x36496e==null?void 0x0:_0x36496e[_0x251b8b(0xfc)][_0x251b8b(0xf8)])??_0x5a9ff5['CollaborationStatus'][_0x251b8b(0x12c)];}[_0x7bb825(0x11c)](_0x4a023f,_0x100c41={}){const _0x3947de=_0x7bb825;let _0x27ff9c=this['_resolveUnitId'](_0x4a023f);if(!_0x27ff9c)return Promise[_0x3947de(0xfb)](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0x13e910=this[_0x3947de(0xec)][_0x3947de(0x10a)](_0x27ff9c);if(!_0x13e910)return Promise[_0x3947de(0xfb)](Error('[FCollaboration]:\x20Unit\x20\x22'+_0x27ff9c+_0x3947de(0x10e)));let _0x4b4c35=_0x13e910[_0x3947de(0xfc)][_0x3947de(0xf8)];if(_0x4b4c35===_0x5a9ff5[_0x3947de(0xf4)][_0x3947de(0xf2)])return Promise[_0x3947de(0xf7)]();let _0x5cdd31=_0x11cd49(_0x27ff9c,_0x4b4c35);if(_0x5cdd31)return Promise['reject'](_0x5cdd31);let _0x599ea1=_0x100c41[_0x3947de(0xe5)]??0x7530;return new Promise((_0x48c11d,_0x31e204)=>{const _0x19d6e2=_0x3947de;let _0x3f6d3b=!0x1,_0x561cee=null,_0x6070d3=setTimeout(()=>{const _0x252f87=_0x46ec;_0x3f6d3b=!0x0,_0x561cee==null||_0x561cee[_0x252f87(0x131)](),_0x31e204(Error('[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22'+_0x27ff9c+_0x252f87(0x119)+_0x599ea1+_0x252f87(0x111)));},_0x599ea1),_0x845cfe=()=>{const _0x5cef9a=_0x46ec;_0x3f6d3b=!0x0,clearTimeout(_0x6070d3),_0x561cee==null||_0x561cee[_0x5cef9a(0x131)]();};_0x561cee=_0x13e910[_0x19d6e2(0x132)][_0x19d6e2(0xf6)](_0x33dbbf=>{const _0x3ef791=_0x19d6e2;if(_0x3f6d3b)return;if(_0x33dbbf===_0x5a9ff5[_0x3ef791(0xf4)][_0x3ef791(0xf2)]){_0x845cfe(),_0x48c11d();return;}let _0x4f90c1=_0x11cd49(_0x27ff9c,_0x33dbbf);_0x4f90c1&&(_0x845cfe(),_0x31e204(_0x4f90c1));});});}[_0x7bb825(0x117)](_0x32bfca){const _0x3a2e97=_0x7bb825;var _0xb3003d;return _0x32bfca||((_0xb3003d=this['_univerInstanceService'][_0x3a2e97(0xd3)]())==null?void 0x0:_0xb3003d[_0x3a2e97(0x10f)]());}};_0x1a2363=_0x59ec6b([_0x63836b(0x1,(0x0,_0x28b429[_0x7bb825(0xd9)])(_0x28b429[_0x7bb825(0x135)])),_0x63836b(0x2,_0x28b429['IUniverInstanceService']),_0x63836b(0x3,(0x0,_0x28b429['Inject'])(_0x429641['SnapshotService'])),_0x63836b(0x4,(0x0,_0x28b429['Inject'])(_0x5a9ff5[_0x7bb825(0xd1)]))],_0x1a2363);function _0x11cd49(_0x4ff4db,_0x514984){const _0x40864b=_0x7bb825;return _0x514984===_0x5a9ff5[_0x40864b(0xf4)]['CONFLICT']||_0x514984===_0x5a9ff5[_0x40864b(0xf4)][_0x40864b(0x12c)]?Error(_0x40864b(0xde)+_0x4ff4db+'\x22\x20while\x20collaboration\x20status\x20is\x20'+_0x514984+'.'):null;}var _0x20caa4=class extends _0x74564e['FUniver']{['_initialize'](_0x2fb22b){const _0x30e37b=_0x7bb825;let _0x3bc4cd=_0x2fb22b[_0x30e37b(0xd2)](_0x5a9ff5[_0x30e37b(0xd1)]);this[_0x30e37b(0xda)](this[_0x30e37b(0xee)](this['Event']['CollaborationStatusChanged'],()=>{const _0xca243a=_0x30e37b;let _0x6f8478=new _0x28b429[(_0xca243a(0x105))](),_0x39ed31=_0x3bc4cd['entityInit$'][_0xca243a(0xf6)](_0x31fa3b=>{const _0x14ac47=_0xca243a;let _0xd532a7=_0x31fa3b[_0x14ac47(0x132)][_0x14ac47(0xf6)](_0x4a0e64=>{const _0x2dc196=_0x14ac47;let _0x1b240c={'unitId':_0x31fa3b[_0x2dc196(0xf5)],'status':_0x4a0e64};this[_0x2dc196(0xd7)](this[_0x2dc196(0x10c)][_0x2dc196(0x11b)],_0x1b240c);});_0x6f8478[_0x14ac47(0x103)]((0x0,_0x28b429[_0x14ac47(0x110)])(_0xd532a7));});return _0x6f8478[_0xca243a(0x103)]((0x0,_0x28b429[_0xca243a(0x110)])(_0x39ed31)),_0x6f8478;}));}[_0x7bb825(0x106)](){const _0x4892a4=_0x7bb825;return this['_injector']['createInstance'](_0x1a2363,{'getWorkbook':_0x3eda6a=>this[_0x4892a4(0xed)](_0x3eda6a),'getDocument':_0xd3458c=>this[_0x4892a4(0xd6)](_0xd3458c),'getPresentation':_0x1a1d94=>this[_0x4892a4(0x125)](_0x1a1d94),'getBase':_0x4c2095=>this[_0x4892a4(0xe8)](_0x4c2095),'getBoard':_0x125da5=>this[_0x4892a4(0x123)](_0x125da5),'getPdf':_0x43f355=>this['getPdf'](_0x43f355)});}[_0x7bb825(0x112)](_0x1b8218,_0x14eb26,_0x42d8a6){const _0x423bd6=_0x7bb825;return this[_0x423bd6(0xff)][_0x423bd6(0xd2)](_0x5a9ff5['DataLoaderService'])[_0x423bd6(0xeb)](_0x1b8218,_0x14eb26,_0x42d8a6);}[_0x7bb825(0x11e)](_0x2db66e,_0x2cace7,_0x29e469){const _0x574435=_0x7bb825;return this[_0x574435(0xff)][_0x574435(0xd2)](_0x5a9ff5[_0x574435(0x101)])[_0x574435(0x11a)](_0x2db66e,_0x2cace7,_0x29e469);}};_0x74564e[_0x7bb825(0x12a)]['extend'](_0x20caa4),Object[_0x7bb825(0xdf)](_0x4d25f7,_0x7bb825(0x12f),{'enumerable':!0x0,'get':function(){return _0x1a2363;}});}));
|
|
1
|
+
function _0x128c(){const _0x360678=['7732182JtusmM','NOT_COLLAB','object','CollaborationController','CONFLICT','IUniverInstanceService','readyForCollab','getFocusedUnit','disposeWithMe','loadDocAsync','entityInit$','CollaborationStatus','MemberService','UNIVER_SHEET','loadUnit','_collaborationController','waitForRoom$','getWorkbook','6190940lTMfgH','UniverProCollaborationClientFacade','add','flush','6408832DdYOPn','1vNdgxw','switchMap','_univerInstanceService','Event','@univerjs-pro/collaboration-client','2452154eLHuiL','Injector','status','@univerjs/core/facade','getOwnPropertyDescriptor','_resolveUnitId','getPdf','FEventName','reject','loadBoardAsync','UniverProCollaborationClient','DataLoaderService','UNIVER_DOC','createInstance','loadServerUnit','26071398mbDfQe','toDisposable','length','getCollabEntity','unsubscribe','92925dOoRpP','rxjs','getBoard','10787637GkqnAH','FBase','UniverCoreFacade','pipe','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','state','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','loadPdfAsync','\x22\x20after\x20','DisposableCollection','CollaborationStatusChanged','UNIVER_PDF','_dataLoaderService','defineProperty','loadBaseAsync','status$','FCollaboration','_handler','loadUnitOfRevision','\x22\x20while\x20collaboration\x20status\x20is\x20','UNIVER_BOARD','toStringTag','Module','subscribe','function','resolve','get','UniverInstanceType','FEnum','Inject','SYNCED','24MXrhDG','from','[FCollaboration]:\x20Unit\x20\x22','getBase','UNIVER_BASE','@univerjs/core','decorate','loadSheetAsync','extend','subscribeCollaborators','amd','loadServerUnitOfRevision','members$','unitID','getPresentation','_injector','registerEventHandler'];_0x128c=function(){return _0x360678;};return _0x128c();}function _0x3b1b(_0x514561,_0x53dfd4){_0x514561=_0x514561-0x136;const _0x128c2a=_0x128c();let _0x3b1ba4=_0x128c2a[_0x514561];return _0x3b1ba4;}(function(_0x33c55c,_0x1b55a9){const _0x55dee1=_0x3b1b,_0x3aade2=_0x33c55c();while(!![]){try{const _0x4c0a9e=-parseInt(_0x55dee1(0x154))/0x1*(parseInt(_0x55dee1(0x159))/0x2)+-parseInt(_0x55dee1(0x16d))/0x3*(-parseInt(_0x55dee1(0x18f))/0x4)+parseInt(_0x55dee1(0x14f))/0x5+parseInt(_0x55dee1(0x13d))/0x6+parseInt(_0x55dee1(0x170))/0x7+parseInt(_0x55dee1(0x153))/0x8+-parseInt(_0x55dee1(0x168))/0x9;if(_0x4c0a9e===_0x1b55a9)break;else _0x3aade2['push'](_0x3aade2['shift']());}catch(_0x3e5dc7){_0x3aade2['push'](_0x3aade2['shift']());}}}(_0x128c,0xe38bf),function(_0x4325e1,_0x4cca04){const _0x129dd9=_0x3b1b;typeof exports==_0x129dd9(0x13f)&&typeof module<'u'?_0x4cca04(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define==_0x129dd9(0x188)&&define[_0x129dd9(0x136)]?define(['exports',_0x129dd9(0x158),_0x129dd9(0x15c),_0x129dd9(0x194),'rxjs'],_0x4cca04):(_0x4325e1=typeof globalThis<'u'?globalThis:_0x4325e1||self,_0x4cca04(_0x4325e1[_0x129dd9(0x150)]={},_0x4325e1[_0x129dd9(0x163)],_0x4325e1[_0x129dd9(0x172)],_0x4325e1['UniverCore'],_0x4325e1[_0x129dd9(0x16e)]));}(this,function(_0x1d5524,_0x23fd0b,_0x35a254,_0x43e644,_0x2aa361){const _0x2dd743=_0x3b1b;Object[_0x2dd743(0x17d)](_0x1d5524,Symbol[_0x2dd743(0x185)],{'value':_0x2dd743(0x186)});var _0x560aec=class extends _0x35a254[_0x2dd743(0x18c)]{get[_0x2dd743(0x148)](){const _0x6919ab=_0x2dd743;return _0x23fd0b[_0x6919ab(0x148)];}};_0x35a254[_0x2dd743(0x18c)][_0x2dd743(0x197)](_0x560aec);var _0x562c24=class extends _0x35a254[_0x2dd743(0x160)]{get['CollaborationStatusChanged'](){const _0x1f3463=_0x2dd743;return _0x1f3463(0x17a);}};_0x35a254[_0x2dd743(0x160)]['extend'](_0x562c24);function _0x1d1bb8(_0x2ca686,_0x116160){return function(_0x396941,_0x3065fd){_0x116160(_0x396941,_0x3065fd,_0x2ca686);};}function _0x598a38(_0x16fd5d,_0x384e64,_0x4ddaea,_0x1c54d9){const _0x52d387=_0x2dd743;var _0x3efc6d=arguments[_0x52d387(0x16a)],_0x53e171=_0x3efc6d<0x3?_0x384e64:_0x1c54d9===null?_0x1c54d9=Object[_0x52d387(0x15d)](_0x384e64,_0x4ddaea):_0x1c54d9,_0x48dd96;if(typeof Reflect=='object'&&typeof Reflect['decorate']==_0x52d387(0x188))_0x53e171=Reflect[_0x52d387(0x195)](_0x16fd5d,_0x384e64,_0x4ddaea,_0x1c54d9);else{for(var _0x53f12e=_0x16fd5d['length']-0x1;_0x53f12e>=0x0;_0x53f12e--)(_0x48dd96=_0x16fd5d[_0x53f12e])&&(_0x53e171=(_0x3efc6d<0x3?_0x48dd96(_0x53e171):_0x3efc6d>0x3?_0x48dd96(_0x384e64,_0x4ddaea,_0x53e171):_0x48dd96(_0x384e64,_0x4ddaea))||_0x53e171);}return _0x3efc6d>0x3&&_0x53e171&&Object['defineProperty'](_0x384e64,_0x4ddaea,_0x53e171),_0x53e171;}let _0x36cb72=class extends _0x35a254[_0x2dd743(0x171)]{constructor(_0x2cda6d,_0x56e978,_0x3a99f8,_0xeadb36,_0x3bae3b){const _0x317ae8=_0x2dd743;super(),this['_handler']=_0x2cda6d,this[_0x317ae8(0x13b)]=_0x56e978,this['_univerInstanceService']=_0x3a99f8,this[_0x317ae8(0x17c)]=_0xeadb36,this[_0x317ae8(0x14c)]=_0x3bae3b;}async[_0x2dd743(0x196)](_0x4cd708,_0xed34f3){const _0x488f14=_0x2dd743;return await this[_0x488f14(0x17c)]['loadUnit'](_0x4cd708,_0x43e644[_0x488f14(0x18b)][_0x488f14(0x14a)],void 0x0,_0xed34f3)?(await this[_0x488f14(0x14c)][_0x488f14(0x143)](_0x4cd708),this[_0x488f14(0x181)][_0x488f14(0x14e)](_0x4cd708)):null;}async[_0x2dd743(0x146)](_0x486264,_0x49b879){const _0x11518d=_0x2dd743;return await this[_0x11518d(0x17c)][_0x11518d(0x14b)](_0x486264,_0x43e644['UniverInstanceType'][_0x11518d(0x165)],void 0x0,_0x49b879)?(await this['_collaborationController'][_0x11518d(0x143)](_0x486264),this[_0x11518d(0x181)]['getDocument'](_0x486264)):null;}async[_0x2dd743(0x17e)](_0x2d4afe,_0x1a57ee){const _0x2baec6=_0x2dd743;return await this[_0x2baec6(0x17c)][_0x2baec6(0x14b)](_0x2d4afe,_0x43e644['UniverInstanceType'][_0x2baec6(0x193)],void 0x0,_0x1a57ee)?(await this[_0x2baec6(0x14c)]['readyForCollab'](_0x2d4afe),this[_0x2baec6(0x181)][_0x2baec6(0x192)](_0x2d4afe)):null;}async['loadSlideAsync'](_0x311b63,_0x5372e1){const _0x8de62c=_0x2dd743;return await this[_0x8de62c(0x17c)][_0x8de62c(0x14b)](_0x311b63,_0x43e644[_0x8de62c(0x18b)]['UNIVER_SLIDE'],void 0x0,_0x5372e1)?(await this[_0x8de62c(0x14c)][_0x8de62c(0x143)](_0x311b63),this[_0x8de62c(0x181)][_0x8de62c(0x13a)](_0x311b63)):null;}async[_0x2dd743(0x162)](_0x36af75,_0x2675b9){const _0x1cec0b=_0x2dd743;return await this['_dataLoaderService'][_0x1cec0b(0x14b)](_0x36af75,_0x43e644[_0x1cec0b(0x18b)][_0x1cec0b(0x184)],void 0x0,_0x2675b9)?(await this[_0x1cec0b(0x14c)][_0x1cec0b(0x143)](_0x36af75),this['_handler'][_0x1cec0b(0x16f)](_0x36af75)):null;}async[_0x2dd743(0x177)](_0x19dcde,_0x40a754){const _0x2b4089=_0x2dd743;return await this[_0x2b4089(0x17c)][_0x2b4089(0x14b)](_0x19dcde,_0x43e644[_0x2b4089(0x18b)][_0x2b4089(0x17b)],void 0x0,_0x40a754)?(await this[_0x2b4089(0x14c)]['readyForCollab'](_0x19dcde),this[_0x2b4089(0x181)][_0x2b4089(0x15f)](_0x19dcde)):null;}[_0x2dd743(0x198)](_0x39ad9a,_0x4b278d){const _0x16a217=_0x2dd743;let _0x294ad6=this['_injector'][_0x16a217(0x18a)](_0x23fd0b[_0x16a217(0x149)])[_0x16a217(0x14d)](_0x39ad9a)[_0x16a217(0x173)]((0x0,_0x2aa361[_0x16a217(0x155)])(_0x506b3a=>_0x506b3a[_0x16a217(0x138)]))['subscribe'](_0x4a2c77=>_0x4b278d(Array[_0x16a217(0x190)](_0x4a2c77['values']())));return(0x0,_0x43e644['toDisposable'])(_0x294ad6);}['getCollaborationStatus'](_0x39c8e3){const _0x3e99fe=_0x2dd743;let _0x106b7a=this[_0x3e99fe(0x15e)](_0x39c8e3);if(!_0x106b7a)return _0x23fd0b['CollaborationStatus'][_0x3e99fe(0x13e)];let _0x109d08=this[_0x3e99fe(0x14c)][_0x3e99fe(0x16b)](_0x106b7a);return(_0x109d08==null?void 0x0:_0x109d08[_0x3e99fe(0x175)][_0x3e99fe(0x15b)])??_0x23fd0b[_0x3e99fe(0x148)][_0x3e99fe(0x13e)];}[_0x2dd743(0x152)](_0x50dfdb,_0x4a0220={}){const _0x4ebc1b=_0x2dd743;let _0xf50fe7=this[_0x4ebc1b(0x15e)](_0x50dfdb);if(!_0xf50fe7)return Promise[_0x4ebc1b(0x161)](Error('[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.'));let _0x7a4a45=this[_0x4ebc1b(0x14c)][_0x4ebc1b(0x16b)](_0xf50fe7);if(!_0x7a4a45)return Promise[_0x4ebc1b(0x161)](Error(_0x4ebc1b(0x191)+_0xf50fe7+_0x4ebc1b(0x176)));let _0x2a0678=_0x7a4a45[_0x4ebc1b(0x175)][_0x4ebc1b(0x15b)];if(_0x2a0678===_0x23fd0b[_0x4ebc1b(0x148)][_0x4ebc1b(0x18e)])return Promise[_0x4ebc1b(0x189)]();let _0x37d58d=_0x5ec889(_0xf50fe7,_0x2a0678);if(_0x37d58d)return Promise['reject'](_0x37d58d);let _0x25e9ff=_0x4a0220['timeout']??0x7530;return new Promise((_0x18664e,_0x34400d)=>{const _0x518b86=_0x4ebc1b;let _0x117992=!0x1,_0x1a873e=null,_0x152f7b=setTimeout(()=>{const _0x1676f2=_0x3b1b;_0x117992=!0x0,_0x1a873e==null||_0x1a873e[_0x1676f2(0x16c)](),_0x34400d(Error('[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22'+_0xf50fe7+_0x1676f2(0x178)+_0x25e9ff+'ms.'));},_0x25e9ff),_0x1834f3=()=>{const _0x27fef5=_0x3b1b;_0x117992=!0x0,clearTimeout(_0x152f7b),_0x1a873e==null||_0x1a873e[_0x27fef5(0x16c)]();};_0x1a873e=_0x7a4a45[_0x518b86(0x17f)][_0x518b86(0x187)](_0x2e5b6f=>{const _0x5a2066=_0x518b86;if(_0x117992)return;if(_0x2e5b6f===_0x23fd0b[_0x5a2066(0x148)]['SYNCED']){_0x1834f3(),_0x18664e();return;}let _0x12ad62=_0x5ec889(_0xf50fe7,_0x2e5b6f);_0x12ad62&&(_0x1834f3(),_0x34400d(_0x12ad62));});});}[_0x2dd743(0x15e)](_0x15b8f7){const _0x55015c=_0x2dd743;var _0x20bca3;return _0x15b8f7||((_0x20bca3=this[_0x55015c(0x156)][_0x55015c(0x144)]())==null?void 0x0:_0x20bca3['getUnitId']());}};_0x36cb72=_0x598a38([_0x1d1bb8(0x1,(0x0,_0x43e644[_0x2dd743(0x18d)])(_0x43e644[_0x2dd743(0x15a)])),_0x1d1bb8(0x2,_0x43e644[_0x2dd743(0x142)]),_0x1d1bb8(0x3,(0x0,_0x43e644[_0x2dd743(0x18d)])(_0x23fd0b[_0x2dd743(0x164)])),_0x1d1bb8(0x4,(0x0,_0x43e644['Inject'])(_0x23fd0b[_0x2dd743(0x140)]))],_0x36cb72);function _0x5ec889(_0x45b850,_0x12d8de){const _0x4cf263=_0x2dd743;return _0x12d8de===_0x23fd0b['CollaborationStatus'][_0x4cf263(0x141)]||_0x12d8de===_0x23fd0b[_0x4cf263(0x148)]['NOT_COLLAB']?Error(_0x4cf263(0x174)+_0x45b850+_0x4cf263(0x183)+_0x12d8de+'.'):null;}var _0x24a4b5=class extends _0x35a254['FUniver']{['_initialize'](_0x520664){const _0x405076=_0x2dd743;let _0x7fba16=_0x520664['get'](_0x23fd0b[_0x405076(0x140)]);this[_0x405076(0x145)](this[_0x405076(0x13c)](this[_0x405076(0x157)]['CollaborationStatusChanged'],()=>{const _0x4a16a1=_0x405076;let _0x450461=new _0x43e644[(_0x4a16a1(0x179))](),_0x195f42=_0x7fba16[_0x4a16a1(0x147)][_0x4a16a1(0x187)](_0xec8592=>{const _0x3367ed=_0x4a16a1;let _0x59b9e7=_0xec8592['status$'][_0x3367ed(0x187)](_0xe2805b=>{const _0x498c7f=_0x3367ed;let _0x4adf7b={'unitId':_0xec8592[_0x498c7f(0x139)],'status':_0xe2805b};this['fireEvent'](this['Event']['CollaborationStatusChanged'],_0x4adf7b);});_0x450461['add']((0x0,_0x43e644['toDisposable'])(_0x59b9e7));});return _0x450461[_0x4a16a1(0x151)]((0x0,_0x43e644[_0x4a16a1(0x169)])(_0x195f42)),_0x450461;}));}['getCollaboration'](){const _0x2e23f0=_0x2dd743;return this[_0x2e23f0(0x13b)][_0x2e23f0(0x166)](_0x36cb72,{'getWorkbook':_0xad1d66=>this[_0x2e23f0(0x14e)](_0xad1d66),'getDocument':_0x5948a1=>this['getDocument'](_0x5948a1),'getPresentation':_0x315c9a=>this[_0x2e23f0(0x13a)](_0x315c9a),'getBase':_0xa177ff=>this[_0x2e23f0(0x192)](_0xa177ff),'getBoard':_0xc448c2=>this[_0x2e23f0(0x16f)](_0xc448c2),'getPdf':_0x3fbbc2=>this[_0x2e23f0(0x15f)](_0x3fbbc2)});}[_0x2dd743(0x167)](_0x33f262,_0x3ef435,_0x523005){const _0xce3e7a=_0x2dd743;return this[_0xce3e7a(0x13b)][_0xce3e7a(0x18a)](_0x23fd0b['DataLoaderService'])[_0xce3e7a(0x14b)](_0x33f262,_0x3ef435,_0x523005);}[_0x2dd743(0x137)](_0x4a7e0e,_0x5db160,_0x179f21){const _0xbb9c82=_0x2dd743;return this[_0xbb9c82(0x13b)]['get'](_0x23fd0b['DataLoaderService'])[_0xbb9c82(0x182)](_0x4a7e0e,_0x5db160,_0x179f21);}};_0x35a254['FUniver'][_0x2dd743(0x197)](_0x24a4b5),Object[_0x2dd743(0x17d)](_0x1d5524,_0x2dd743(0x180),{'enumerable':!0x0,'get':function(){return _0x36cb72;}});}));
|