@univerjs-pro/collaboration-client 1.1.0 → 1.3.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/README.md +2 -0
- 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/config/config.d.ts +19 -0
- package/lib/types/controllers/collaboration/changeset-submitter.d.ts +132 -0
- package/lib/types/controllers/collaboration/collaboration-entity.d.ts +29 -2
- package/lib/types/controllers/collaboration/collaboration-state.d.ts +181 -87
- package/lib/types/controllers/collaboration/collaboration.controller.d.ts +7 -0
- package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +7 -3
- package/lib/types/facade/f-collaboration.d.ts +17 -0
- package/lib/types/facade/f-event.d.ts +89 -2
- package/lib/types/index.d.ts +5 -3
- package/lib/types/services/collaboration-session/collaboration-session.d.ts +4 -8
- package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +2 -1
- package/lib/types/services/collaboration-ui-event/collaboration-ui-event.d.ts +10 -0
- package/lib/types/services/socket/collaboration-socket.service.d.ts +10 -2
- package/lib/types/services/undoredo/collaborative-undoredo.service.d.ts +5 -0
- 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 +15 -15
|
@@ -14,8 +14,15 @@ export declare class CollaborationController extends RxDisposable {
|
|
|
14
14
|
constructor(_injector: Injector, _collabSessionService: CollaborationSessionService, _configService: IConfigService, _univerInstanceService: IUniverInstanceService);
|
|
15
15
|
dispose(): void;
|
|
16
16
|
getCollabEntity(id: string): Nullable<CollaborationEntity>;
|
|
17
|
+
/** The entities of every unit that is collaborating now. */
|
|
18
|
+
getCollabEntities(): CollaborationEntity[];
|
|
17
19
|
getCollabEntity$(id: string): Observable<CollaborationEntity>;
|
|
18
20
|
readyForCollab(id: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a unit has local mutations that the server has not acknowledged yet.
|
|
23
|
+
* @param unitId The unit to check. When omitted, every collaborating unit is checked.
|
|
24
|
+
*/
|
|
25
|
+
hasWritePending(unitId?: string): boolean;
|
|
19
26
|
private _init;
|
|
20
27
|
/**
|
|
21
28
|
* Start collaboration on a document.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { IChangeset, RevisionService } from '@univerjs-pro/collaboration';
|
|
1
|
+
import type { IChangeset, IRevertRevisionMutationParams, RevisionService } from '@univerjs-pro/collaboration';
|
|
2
2
|
import type { IMutationInfo, IUniverInstanceService, UserManagerService } from '@univerjs/core';
|
|
3
|
-
import type { Observable } from 'rxjs';
|
|
4
3
|
export interface IAssembledChangeset {
|
|
5
4
|
changeset: IChangeset;
|
|
6
5
|
pendingMutations: IMutationInfo[];
|
|
@@ -23,4 +22,9 @@ export declare const assemblePdfChangeset: typeof assembleMutationChangeset;
|
|
|
23
22
|
export declare function assembleBaseChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, userManagerService: UserManagerService): IAssembledChangeset;
|
|
24
23
|
export declare function assembleSlideChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, userManagerService: UserManagerService): IAssembledChangeset;
|
|
25
24
|
export declare function assembleDocChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, userManagerService: UserManagerService): IAssembledChangeset;
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The revert of `unitID` carried by a remote changeset, if any. A revert is executed on the server: the next revision
|
|
27
|
+
* is the restored snapshot, so the local copy cannot transform it and has to be reloaded. Reverts of other units are
|
|
28
|
+
* ordinary changesets.
|
|
29
|
+
*/
|
|
30
|
+
export declare function findRemoteRevert(changeset: IChangeset, unitID: string): IRevertRevisionMutationParams | null;
|
|
@@ -160,6 +160,23 @@ export declare class FCollaboration extends FBase {
|
|
|
160
160
|
* ```
|
|
161
161
|
*/
|
|
162
162
|
getCollaborationStatus(unitId?: string): CollaborationStatus;
|
|
163
|
+
/**
|
|
164
|
+
* Whether a unit has local edits that the server has not acknowledged yet, including edits that are
|
|
165
|
+
* waiting to be sent, sent and awaiting acknowledgement, or cached while offline.
|
|
166
|
+
*
|
|
167
|
+
* @param {string} [unitId] Optional unit ID. If omitted, uses the focused unit.
|
|
168
|
+
* @returns {boolean} `true` when there are unacknowledged local edits.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* window.addEventListener('beforeunload', (event) => {
|
|
173
|
+
* if (univerAPI.getCollaboration().hasWritePending()) {
|
|
174
|
+
* event.preventDefault();
|
|
175
|
+
* }
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
hasWritePending(unitId?: string): boolean;
|
|
163
180
|
/**
|
|
164
181
|
* Wait until all currently queued collaboration changes for a unit are synchronized.
|
|
165
182
|
*
|
|
@@ -1,5 +1,33 @@
|
|
|
1
|
-
import type { CollaborationStatus } from '@univerjs-pro/collaboration-client';
|
|
1
|
+
import type { ChangesetResendReason, CollaborationStatus, ConflictReason, IRemoteRevertInfo, IUnitCacheData } from '@univerjs-pro/collaboration-client';
|
|
2
2
|
import type { IEventBase } from '@univerjs/core/facade';
|
|
3
|
+
/**
|
|
4
|
+
* Fired once when a unit enters `CollaborationStatus.CONFLICT`, after its offline cache has been cleared. Carries the
|
|
5
|
+
* reason and the local edits the server has not acknowledged.
|
|
6
|
+
*/
|
|
7
|
+
export interface ICollaborationConflictEventParams extends IEventBase {
|
|
8
|
+
/** The unit ID that entered the conflict status */
|
|
9
|
+
unitId: string;
|
|
10
|
+
/**
|
|
11
|
+
* - `transform_failed`: a remote changeset could not be transformed against the local edits
|
|
12
|
+
* - `apply_failed`: a remote changeset was transformed but one of its mutations failed to execute
|
|
13
|
+
* - `changeset_rejected`: the server rejected the local changeset
|
|
14
|
+
* - `permission_rejected`: the server rejected the local changeset for lack of permission
|
|
15
|
+
* - `remote_revert`: another collaborator reverted the unit to a historical revision
|
|
16
|
+
*/
|
|
17
|
+
reason: ConflictReason;
|
|
18
|
+
/** The error message, or the reason the server gave when it rejected the changeset */
|
|
19
|
+
message?: string;
|
|
20
|
+
/** The revert that caused the conflict, when `reason` is `remote_revert` */
|
|
21
|
+
revert?: IRemoteRevertInfo;
|
|
22
|
+
/**
|
|
23
|
+
* The local edits the server has not acknowledged, in the format of the offline cache, or `null` when there
|
|
24
|
+
* are none. Not available after this event. `awaitingChangeset` has been sent; whether the server applied it is
|
|
25
|
+
* unknown.
|
|
26
|
+
*/
|
|
27
|
+
localChanges: IUnitCacheData | null;
|
|
28
|
+
/** Whether the offline cache of the unit was cleared. When `false`, a page reload replays the cached edits. */
|
|
29
|
+
cacheCleared: boolean;
|
|
30
|
+
}
|
|
3
31
|
/**
|
|
4
32
|
* Event triggered when collaboration status changes for a unit
|
|
5
33
|
*/
|
|
@@ -9,10 +37,37 @@ export interface ICollaborationStatusChangedEventParams extends IEventBase {
|
|
|
9
37
|
*/
|
|
10
38
|
unitId: string;
|
|
11
39
|
/**
|
|
12
|
-
* The new collaboration status
|
|
40
|
+
* The new collaboration status. When it is `CONFLICT`, the `CollaborationConflict` event follows with the reason
|
|
41
|
+
* and the unacknowledged local edits.
|
|
13
42
|
*/
|
|
14
43
|
status: CollaborationStatus;
|
|
15
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Event triggered every time a changeset is sent to the server again because it was not acknowledged.
|
|
47
|
+
* The first send of a changeset does not trigger it.
|
|
48
|
+
*/
|
|
49
|
+
export interface ICollaborationChangesetResendEventParams extends IEventBase {
|
|
50
|
+
/** The unit ID whose changeset was resent */
|
|
51
|
+
unitId: string;
|
|
52
|
+
/** The request ID of the changeset within the current editing session */
|
|
53
|
+
reqId: number;
|
|
54
|
+
/**
|
|
55
|
+
* Why the changeset was resent:
|
|
56
|
+
* - `ack_timeout`: no acknowledgement arrived in time
|
|
57
|
+
* - `should_retry`: the server asked for the changeset to be resent
|
|
58
|
+
* - `reconnect`: the connection was restored or the changeset was restored from the local cache
|
|
59
|
+
* - `license_editing_connections_exceeded`: the server asked for a resend; its License editing connections were all in use
|
|
60
|
+
*/
|
|
61
|
+
reason: ChangesetResendReason;
|
|
62
|
+
/** How many times the changeset has been resent, counting this one */
|
|
63
|
+
attempt: number;
|
|
64
|
+
/** Milliseconds since the changeset was first sent */
|
|
65
|
+
elapsedMs: number;
|
|
66
|
+
/** Local mutations the server has not acknowledged yet, including those not sent yet */
|
|
67
|
+
unsyncedMutationCount: number;
|
|
68
|
+
/** Milliseconds until the next resend if the server stays silent */
|
|
69
|
+
nextDelayMs: number;
|
|
70
|
+
}
|
|
16
71
|
/**
|
|
17
72
|
* Collaboration event name mixin interface
|
|
18
73
|
* @ignore
|
|
@@ -34,6 +89,36 @@ export interface IFCollaborationEventNameMixin {
|
|
|
34
89
|
* ```
|
|
35
90
|
*/
|
|
36
91
|
readonly CollaborationStatusChanged: 'CollaborationStatusChanged';
|
|
92
|
+
/**
|
|
93
|
+
* Event triggered once per conflict, after the unit's offline cache was cleared: the reason and the local edits
|
|
94
|
+
* the server has not acknowledged
|
|
95
|
+
* @see {@link ICollaborationConflictEventParams}
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* univerAPI.addEvent(univerAPI.Event.CollaborationConflict, (event) => {
|
|
99
|
+
* const { unitId, reason, localChanges, cacheCleared } = event;
|
|
100
|
+
* if (localChanges) saveSomewhere(unitId, localChanges);
|
|
101
|
+
* if (reason === 'permission_rejected') return showNoPermission(unitId);
|
|
102
|
+
* if (reason === 'license_unit_type_rejected') return showLicenseLimit(unitId, event.message);
|
|
103
|
+
* if (cacheCleared) window.location.reload();
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
readonly CollaborationConflict: 'CollaborationConflict';
|
|
108
|
+
/**
|
|
109
|
+
* Event triggered every time a changeset is resent because the server did not acknowledge it
|
|
110
|
+
* @see {@link ICollaborationChangesetResendEventParams}
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* univerAPI.addEvent(univerAPI.Event.CollaborationChangesetResend, (event) => {
|
|
114
|
+
* const { unitId, reason, attempt, unsyncedMutationCount, elapsedMs } = event;
|
|
115
|
+
* if (reason === 'ack_timeout' && attempt >= 2) {
|
|
116
|
+
* console.warn(`${unsyncedMutationCount} unsaved mutations of ${unitId} for ${Math.round(elapsedMs / 1000)}s`);
|
|
117
|
+
* }
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
readonly CollaborationChangesetResend: 'CollaborationChangesetResend';
|
|
37
122
|
}
|
|
38
123
|
/**
|
|
39
124
|
* Collaboration event parameter configuration
|
|
@@ -41,6 +126,8 @@ export interface IFCollaborationEventNameMixin {
|
|
|
41
126
|
*/
|
|
42
127
|
export interface ICollaborationEventParamConfig {
|
|
43
128
|
CollaborationStatusChanged: ICollaborationStatusChangedEventParams;
|
|
129
|
+
CollaborationConflict: ICollaborationConflictEventParams;
|
|
130
|
+
CollaborationChangesetResend: ICollaborationChangesetResendEventParams;
|
|
44
131
|
}
|
|
45
132
|
declare module '@univerjs/core/facade' {
|
|
46
133
|
interface FEventName extends IFCollaborationEventNameMixin {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ export { DEFAULT_WS_SESSION_TICKET_URL, HEARTBEAT_INTERVAL_KEY, HEARTBEAT_TIMEOU
|
|
|
2
2
|
export { DEFAULT_COLLAB_WEB_SOCKET_URL, DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT, REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY, } from './config/config';
|
|
3
3
|
export type { IUniverCollaborationClientConfig } from './config/config';
|
|
4
4
|
export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY } from './config/config';
|
|
5
|
+
export { ChangesetSubmitter, DEFAULT_ACK_TIMEOUT, MAX_ACK_TIMEOUT } from './controllers/collaboration/changeset-submitter';
|
|
6
|
+
export type { ChangesetResendReason, IChangesetResendEvent, IChangesetSubmitterOptions, IChangesetSubmitterSource, SendChangeset } from './controllers/collaboration/changeset-submitter';
|
|
5
7
|
export { BaseCollaborationEntity, BoardCollaborationEntity, CollaborationEntity, DocCollaborationEntity, PdfCollaborationEntity, SheetCollaborationEntity, SlideCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
|
|
6
|
-
export type { IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
|
|
8
|
+
export type { ICollaborationConflictEvent, IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
|
|
7
9
|
export { AwaitingState, AwaitingWithPendingState, CollaborationStatus, ConflictState, FetchingMissState, OfflineState, PendingState, SyncedState, } from './controllers/collaboration/collaboration-state';
|
|
8
|
-
export type { ISelectionTransformTransaction } from './controllers/collaboration/collaboration-state';
|
|
10
|
+
export type { ConflictReason, IConflictInfo, IRemoteRejection, IRemoteRevertInfo, ISelectionTransformTransaction, } from './controllers/collaboration/collaboration-state';
|
|
9
11
|
export { CollaborationController } from './controllers/collaboration/collaboration.controller';
|
|
10
12
|
export { UniverCollaborationClientPlugin } from './plugin';
|
|
11
13
|
export { CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
|
|
@@ -27,7 +29,7 @@ export { INetworkConditionService } from './services/network-condition/network-c
|
|
|
27
29
|
export { SheetTransformSelectionsService } from './services/range-selection/sheet-transform-selections.service';
|
|
28
30
|
export { ISingleActiveUnitService, UnitStatus } from './services/single-active-unit/single-active-unit.service';
|
|
29
31
|
export { SnapshotServerOverHTTPService } from './services/snapshot-server/snapshot-server.service';
|
|
30
|
-
export type { ICollaborationSocket } from './services/socket/collaboration-socket.service';
|
|
32
|
+
export type { ICollaborationSendOptions, ICollaborationSocket } from './services/socket/collaboration-socket.service';
|
|
31
33
|
export { CollaborationSocketService, ICollaborationSocketService, } from './services/socket/collaboration-socket.service';
|
|
32
34
|
export { deserializeToCombResponse, serializeCombRequest } from './services/socket/serialize';
|
|
33
35
|
export { CollaborativeUndoRedoService } from './services/undoredo/collaborative-undoredo.service';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ICollaborationEvent } from '@univerjs-pro/collaboration';
|
|
2
2
|
import type { IDisposable, Nullable } from '@univerjs/core';
|
|
3
3
|
import type { Observable } from 'rxjs';
|
|
4
|
-
import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
|
|
4
|
+
import type { ICollaborationSendOptions, ICollaborationSocket } from '../socket/collaboration-socket.service';
|
|
5
5
|
import type { ICollaborationSessionIdentity } from './collaboration-client-adapter';
|
|
6
|
-
import {
|
|
6
|
+
import { ILogService, RxDisposable } from '@univerjs/core';
|
|
7
7
|
import { ITelemetryService } from '@univerjs/telemetry';
|
|
8
8
|
import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
|
|
9
9
|
import { CommentService } from '../comment/comment.service';
|
|
@@ -29,7 +29,6 @@ export declare const FailedReason: {
|
|
|
29
29
|
export declare class CollaborationSession extends RxDisposable implements IDisposable {
|
|
30
30
|
private readonly _identity;
|
|
31
31
|
private readonly _logService;
|
|
32
|
-
private readonly _configService;
|
|
33
32
|
private readonly _memberService;
|
|
34
33
|
private readonly _commentService;
|
|
35
34
|
private readonly _collaborationUIEventService;
|
|
@@ -41,7 +40,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
|
|
|
41
40
|
readonly event$: Observable<ICollaborationEvent>;
|
|
42
41
|
private _socket;
|
|
43
42
|
private _socketMessageSubscription;
|
|
44
|
-
constructor(_identity: ICollaborationSessionIdentity, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService,
|
|
43
|
+
constructor(_identity: ICollaborationSessionIdentity, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
|
|
45
44
|
getMemberID(): string | null;
|
|
46
45
|
dispose(): void;
|
|
47
46
|
close(): void;
|
|
@@ -54,10 +53,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
|
|
|
54
53
|
/**
|
|
55
54
|
* Send event to the collaboration server.
|
|
56
55
|
*/
|
|
57
|
-
send(event: ICollaborationEvent, _unitID: string): Promise<void>;
|
|
58
|
-
private _collaborationTimeoutTimer;
|
|
59
|
-
private _scheduleCollaborationTimeoutTimer;
|
|
60
|
-
private _clearCollaborationTimeoutTimer;
|
|
56
|
+
send(event: ICollaborationEvent, _unitID: string, options?: ICollaborationSendOptions): Promise<void>;
|
|
61
57
|
private _shouldReportTelemetry;
|
|
62
58
|
private _telemetryInfo;
|
|
63
59
|
private _startTelemetryCollaborationNewChangeset;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Nullable, UniverInstanceType } from '@univerjs/core';
|
|
2
|
+
import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
|
|
2
3
|
import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
|
|
3
4
|
import type { ICollaborationClientAdapter } from './collaboration-client-adapter';
|
|
4
|
-
import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
|
|
5
5
|
import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
|
|
6
6
|
import { ICollaborationSocketService } from '../socket/collaboration-socket.service';
|
|
7
7
|
import { CollaborationSession, SessionStatus } from './collaboration-session';
|
|
@@ -59,6 +59,7 @@ export declare class CollaborationSessionService extends Disposable {
|
|
|
59
59
|
private _tryEnsureSocket;
|
|
60
60
|
private _onConnectionOpen;
|
|
61
61
|
private _onOffline;
|
|
62
|
+
private _onLicenseRejected;
|
|
62
63
|
private _onConnectionFailed;
|
|
63
64
|
private _tryReconnect;
|
|
64
65
|
private _resolveSessionIdentity;
|
|
@@ -6,14 +6,24 @@ export interface ICollaborationUIEvent {
|
|
|
6
6
|
}
|
|
7
7
|
export declare enum CollaborationUIEventId {
|
|
8
8
|
OTHER_CLIENT_EDITING = "OTHER_CLIENT_EDITING",
|
|
9
|
+
/** @deprecated No longer emitted. Use `CollaborationEntity.conflict$` or the `CollaborationConflict` facade event. */
|
|
9
10
|
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
11
|
+
/** A unit entered the conflict state; `unitID` is set. */
|
|
10
12
|
CONFLICT_PROCESSING = "CONFLICT_PROCESSING",
|
|
13
|
+
/** Clearing the offline cache of a conflicted unit failed; `unitID` and `userId` are set. */
|
|
11
14
|
CONFLICT_CACHE_CLEAR_FAILED = "CONFLICT_CACHE_CLEAR_FAILED",
|
|
15
|
+
/** @deprecated No longer emitted. Use `CollaborationEntity.conflict$` or the `CollaborationConflict` facade event. */
|
|
12
16
|
CONFLICT = "CONFLICT",
|
|
13
17
|
CLOSE_ROOM = "CLOSE_ROOM",
|
|
14
18
|
JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
|
|
15
19
|
SOCKET_FAILED_RETRY = "SOCKET_FAILED_RETRY",
|
|
16
20
|
SOCKET_FAILED = "SOCKET_FAILED",
|
|
21
|
+
/** The server refused this page's domain under its License; no reconnect is scheduled until a manual one. */
|
|
22
|
+
LICENSE_DOMAIN_REJECTED = "LICENSE_DOMAIN_REJECTED",
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated No longer emitted. Unacknowledged changesets are resent automatically; subscribe to
|
|
25
|
+
* `CollaborationEntity.changesetResend$` (or the `CollaborationChangesetResend` facade event) instead.
|
|
26
|
+
*/
|
|
17
27
|
SUBMIT_CHANGESET_TIMEOUT = "SUBMIT_CHANGESET_TIMEOUT"
|
|
18
28
|
}
|
|
19
29
|
export declare class CollaborationUIEventService {
|
|
@@ -10,10 +10,18 @@ import { HTTPService } from '@univerjs/network';
|
|
|
10
10
|
* A special wrapper around of the original {@link ISocket} implementation to
|
|
11
11
|
* for collaboration.
|
|
12
12
|
*/
|
|
13
|
+
export interface ICollaborationSendOptions {
|
|
14
|
+
/** How long the server may take to answer the request, in milliseconds. Only used for submitted changesets. */
|
|
15
|
+
timeout?: number;
|
|
16
|
+
}
|
|
13
17
|
export interface ICollaborationSocket extends Pick<ISocket, 'open$' | 'error$' | 'close$'> {
|
|
14
18
|
memberID: string;
|
|
15
19
|
message$: Observable<ICombResponseEvent>;
|
|
16
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Send an event to the server. For a submitted changeset the returned promise resolves when the server
|
|
22
|
+
* answered the HTTP request and rejects when the request failed or timed out; other events return nothing.
|
|
23
|
+
*/
|
|
24
|
+
send: (event: ICombRequestEvent, options?: ICollaborationSendOptions) => void | Promise<void>;
|
|
17
25
|
close: () => void;
|
|
18
26
|
}
|
|
19
27
|
/**
|
|
@@ -39,6 +47,6 @@ export declare abstract class CollaborationSocketService extends Disposable impl
|
|
|
39
47
|
* @param URL The URL of the remote server.
|
|
40
48
|
*/
|
|
41
49
|
protected _doCreateSocket(URL: string): Nullable<ICollaborationSocket>;
|
|
42
|
-
protected _submitChangeset(socket: ICollaborationSocket, event: ISubmitChangesetEvent): Promise<void>;
|
|
50
|
+
protected _submitChangeset(socket: ICollaborationSocket, event: ISubmitChangesetEvent, timeoutMs: number): Promise<void>;
|
|
43
51
|
protected _fetchMissChangesets(event: IFetchingMissEvent): Promise<IChangeset[]>;
|
|
44
52
|
}
|
|
@@ -18,4 +18,9 @@ export declare class CollaborativeUndoRedoService extends LocalUndoRedoService i
|
|
|
18
18
|
private _substituteUndoStack;
|
|
19
19
|
private _substituteRedoStack;
|
|
20
20
|
private _transformStack;
|
|
21
|
+
private _transformHistoryMutations;
|
|
22
|
+
private _rebaseParagraphHistory;
|
|
23
|
+
private _rebaseUnchangedAttributes;
|
|
24
|
+
private _invertDocumentHistory;
|
|
25
|
+
private _filterTableActions;
|
|
21
26
|
}
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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;}});}));
|
|
1
|
+
(function(_0x4dea15,_0x1dd729){const _0x526174=_0x17b5,_0x37e073=_0x4dea15();while(!![]){try{const _0x35dab4=-parseInt(_0x526174(0x156))/0x1*(parseInt(_0x526174(0x146))/0x2)+-parseInt(_0x526174(0x17e))/0x3+-parseInt(_0x526174(0x11b))/0x4*(parseInt(_0x526174(0x17d))/0x5)+parseInt(_0x526174(0x14c))/0x6*(parseInt(_0x526174(0x169))/0x7)+-parseInt(_0x526174(0x13a))/0x8+parseInt(_0x526174(0x134))/0x9+parseInt(_0x526174(0x161))/0xa;if(_0x35dab4===_0x1dd729)break;else _0x37e073['push'](_0x37e073['shift']());}catch(_0x586608){_0x37e073['push'](_0x37e073['shift']());}}}(_0x19a3,0x55b0e),function(_0x18a468,_0x48014a){const _0x6476c1=_0x17b5;typeof exports==_0x6476c1(0x158)&&typeof module<'u'?_0x48014a(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('rxjs')):typeof define=='function'&&define['amd']?define([_0x6476c1(0x15a),_0x6476c1(0x122),'@univerjs/core/facade','@univerjs/core',_0x6476c1(0x16d)],_0x48014a):(_0x18a468=typeof globalThis<'u'?globalThis:_0x18a468||self,_0x48014a(_0x18a468['UniverProCollaborationClientFacade']={},_0x18a468[_0x6476c1(0x15f)],_0x18a468['UniverCoreFacade'],_0x18a468['UniverCore'],_0x18a468[_0x6476c1(0x16d)]));}(this,function(_0x1a9563,_0x3116ec,_0x5e3f0b,_0x55fa5b,_0x2a8999){const _0xd4bcc8=_0x17b5;Object[_0xd4bcc8(0x163)](_0x1a9563,Symbol[_0xd4bcc8(0x16b)],{'value':_0xd4bcc8(0x152)});var _0x314a94=class extends _0x5e3f0b[_0xd4bcc8(0x145)]{get[_0xd4bcc8(0x120)](){const _0xc53187=_0xd4bcc8;return _0x3116ec[_0xc53187(0x120)];}};_0x5e3f0b[_0xd4bcc8(0x145)][_0xd4bcc8(0x129)](_0x314a94);var _0x2ce332=class extends _0x5e3f0b[_0xd4bcc8(0x173)]{get[_0xd4bcc8(0x12a)](){const _0x54cd5b=_0xd4bcc8;return _0x54cd5b(0x12a);}get[_0xd4bcc8(0x136)](){const _0x3588a1=_0xd4bcc8;return _0x3588a1(0x136);}get['CollaborationChangesetResend'](){return'CollaborationChangesetResend';}};_0x5e3f0b[_0xd4bcc8(0x173)][_0xd4bcc8(0x129)](_0x2ce332);function _0x220f8c(_0x29a0d6,_0x26b32d){return function(_0x4d920c,_0x2aea01){_0x26b32d(_0x4d920c,_0x2aea01,_0x29a0d6);};}function _0x17ce5a(_0x46b383,_0x159458,_0x2f0cc6,_0x9bacaa){const _0x3ce176=_0xd4bcc8;var _0x6e5590=arguments['length'],_0x9188de=_0x6e5590<0x3?_0x159458:_0x9bacaa===null?_0x9bacaa=Object['getOwnPropertyDescriptor'](_0x159458,_0x2f0cc6):_0x9bacaa,_0x52ab3c;if(typeof Reflect==_0x3ce176(0x158)&&typeof Reflect[_0x3ce176(0x177)]==_0x3ce176(0x125))_0x9188de=Reflect[_0x3ce176(0x177)](_0x46b383,_0x159458,_0x2f0cc6,_0x9bacaa);else{for(var _0x3c49fd=_0x46b383[_0x3ce176(0x119)]-0x1;_0x3c49fd>=0x0;_0x3c49fd--)(_0x52ab3c=_0x46b383[_0x3c49fd])&&(_0x9188de=(_0x6e5590<0x3?_0x52ab3c(_0x9188de):_0x6e5590>0x3?_0x52ab3c(_0x159458,_0x2f0cc6,_0x9188de):_0x52ab3c(_0x159458,_0x2f0cc6))||_0x9188de);}return _0x6e5590>0x3&&_0x9188de&&Object[_0x3ce176(0x163)](_0x159458,_0x2f0cc6,_0x9188de),_0x9188de;}let _0x28a77d=class extends _0x5e3f0b[_0xd4bcc8(0x15d)]{constructor(_0x19fde2,_0x4710fd,_0xa70455,_0x287eec,_0x3b28f9){const _0x3386b6=_0xd4bcc8;super(),this['_handler']=_0x19fde2,this['_injector']=_0x4710fd,this['_univerInstanceService']=_0xa70455,this[_0x3386b6(0x166)]=_0x287eec,this[_0x3386b6(0x118)]=_0x3b28f9;}async[_0xd4bcc8(0x153)](_0x3c6171,_0x2995ba){const _0x109500=_0xd4bcc8;return await this[_0x109500(0x166)][_0x109500(0x12b)](_0x3c6171,_0x55fa5b[_0x109500(0x179)]['UNIVER_SHEET'],void 0x0,_0x2995ba)?(await this[_0x109500(0x118)][_0x109500(0x116)](_0x3c6171),this['_handler'][_0x109500(0x117)](_0x3c6171)):null;}async['loadDocAsync'](_0x3bea64,_0x3f0e8a){const _0x20fd6c=_0xd4bcc8;return await this[_0x20fd6c(0x166)]['loadUnit'](_0x3bea64,_0x55fa5b[_0x20fd6c(0x179)]['UNIVER_DOC'],void 0x0,_0x3f0e8a)?(await this[_0x20fd6c(0x118)][_0x20fd6c(0x116)](_0x3bea64),this['_handler']['getDocument'](_0x3bea64)):null;}async[_0xd4bcc8(0x17c)](_0x3d227c,_0x153c7b){const _0x5765cd=_0xd4bcc8;return await this[_0x5765cd(0x166)][_0x5765cd(0x12b)](_0x3d227c,_0x55fa5b[_0x5765cd(0x179)]['UNIVER_BASE'],void 0x0,_0x153c7b)?(await this[_0x5765cd(0x118)]['readyForCollab'](_0x3d227c),this[_0x5765cd(0x149)]['getBase'](_0x3d227c)):null;}async[_0xd4bcc8(0x13d)](_0x5950a0,_0x4028c6){const _0x22f484=_0xd4bcc8;return await this[_0x22f484(0x166)][_0x22f484(0x12b)](_0x5950a0,_0x55fa5b[_0x22f484(0x179)][_0x22f484(0x114)],void 0x0,_0x4028c6)?(await this[_0x22f484(0x118)][_0x22f484(0x116)](_0x5950a0),this[_0x22f484(0x149)][_0x22f484(0x14e)](_0x5950a0)):null;}async[_0xd4bcc8(0x11c)](_0x5a5ae8,_0x43ddc4){const _0x45761a=_0xd4bcc8;return await this[_0x45761a(0x166)]['loadUnit'](_0x5a5ae8,_0x55fa5b[_0x45761a(0x179)][_0x45761a(0x13f)],void 0x0,_0x43ddc4)?(await this[_0x45761a(0x118)][_0x45761a(0x116)](_0x5a5ae8),this[_0x45761a(0x149)][_0x45761a(0x144)](_0x5a5ae8)):null;}async[_0xd4bcc8(0x13e)](_0x15b94b,_0x198d72){const _0x546a57=_0xd4bcc8;return await this[_0x546a57(0x166)][_0x546a57(0x12b)](_0x15b94b,_0x55fa5b['UniverInstanceType']['UNIVER_PDF'],void 0x0,_0x198d72)?(await this[_0x546a57(0x118)][_0x546a57(0x116)](_0x15b94b),this[_0x546a57(0x149)][_0x546a57(0x150)](_0x15b94b)):null;}['subscribeCollaborators'](_0x225588,_0x2e6565){const _0x2e3574=_0xd4bcc8;let _0x133829=this[_0x2e3574(0x154)]['get'](_0x3116ec[_0x2e3574(0x137)])[_0x2e3574(0x124)](_0x225588)['pipe']((0x0,_0x2a8999[_0x2e3574(0x176)])(_0x4dee46=>_0x4dee46[_0x2e3574(0x135)]))[_0x2e3574(0x131)](_0x1a9740=>_0x2e6565(Array[_0x2e3574(0x171)](_0x1a9740[_0x2e3574(0x130)]())));return(0x0,_0x55fa5b[_0x2e3574(0x14a)])(_0x133829);}[_0xd4bcc8(0x16f)](_0x4e44ff){const _0x96535f=_0xd4bcc8;let _0x668ff2=this[_0x96535f(0x172)](_0x4e44ff);if(!_0x668ff2)return _0x3116ec[_0x96535f(0x120)][_0x96535f(0x143)];let _0x5e03e3=this[_0x96535f(0x118)][_0x96535f(0x140)](_0x668ff2);return(_0x5e03e3==null?void 0x0:_0x5e03e3[_0x96535f(0x164)]['status'])??_0x3116ec['CollaborationStatus'][_0x96535f(0x143)];}[_0xd4bcc8(0x15c)](_0xcf3a44){const _0xcfc81=_0xd4bcc8;let _0x463dae=this['_resolveUnitId'](_0xcf3a44);return _0x463dae?this[_0xcfc81(0x118)][_0xcfc81(0x15c)](_0x463dae):!0x1;}['flush'](_0x278cbf,_0x582ef0={}){const _0x5ae3d=_0xd4bcc8;let _0x555323=this['_resolveUnitId'](_0x278cbf);if(!_0x555323)return Promise['reject'](Error(_0x5ae3d(0x14b)));let _0x1756fd=this['_collaborationController'][_0x5ae3d(0x140)](_0x555323);if(!_0x1756fd)return Promise['reject'](Error(_0x5ae3d(0x178)+_0x555323+_0x5ae3d(0x13c)));let _0x33e6d3=_0x1756fd['state'][_0x5ae3d(0x147)];if(_0x33e6d3===_0x3116ec[_0x5ae3d(0x120)][_0x5ae3d(0x175)])return Promise[_0x5ae3d(0x115)]();let _0x194710=_0x1e70c3(_0x555323,_0x33e6d3);if(_0x194710)return Promise[_0x5ae3d(0x162)](_0x194710);let _0x39194d=_0x582ef0[_0x5ae3d(0x15e)]??0x7530;return new Promise((_0x3e0e34,_0x1abdda)=>{const _0x2ec7f3=_0x5ae3d;let _0x4956f4=!0x1,_0x191433=null,_0x12fdba=setTimeout(()=>{const _0x142acd=_0x17b5;_0x4956f4=!0x0,_0x191433==null||_0x191433[_0x142acd(0x15b)](),_0x1abdda(Error(_0x142acd(0x123)+_0x555323+_0x142acd(0x128)+_0x39194d+_0x142acd(0x16e)));},_0x39194d),_0x21c305=()=>{const _0x2a75cb=_0x17b5;_0x4956f4=!0x0,clearTimeout(_0x12fdba),_0x191433==null||_0x191433[_0x2a75cb(0x15b)]();};_0x191433=_0x1756fd['status$'][_0x2ec7f3(0x131)](_0x40fb6f=>{const _0x3e56d7=_0x2ec7f3;if(_0x4956f4)return;if(_0x40fb6f===_0x3116ec['CollaborationStatus'][_0x3e56d7(0x175)]){_0x21c305(),_0x3e0e34();return;}let _0x4fe745=_0x1e70c3(_0x555323,_0x40fb6f);_0x4fe745&&(_0x21c305(),_0x1abdda(_0x4fe745));});});}['_resolveUnitId'](_0x2b8153){const _0x5c5853=_0xd4bcc8;var _0x4edef5;return _0x2b8153||((_0x4edef5=this[_0x5c5853(0x12f)][_0x5c5853(0x17b)]())==null?void 0x0:_0x4edef5['getUnitId']());}};_0x28a77d=_0x17ce5a([_0x220f8c(0x1,(0x0,_0x55fa5b[_0xd4bcc8(0x11f)])(_0x55fa5b['Injector'])),_0x220f8c(0x2,_0x55fa5b[_0xd4bcc8(0x132)]),_0x220f8c(0x3,(0x0,_0x55fa5b[_0xd4bcc8(0x11f)])(_0x3116ec[_0xd4bcc8(0x165)])),_0x220f8c(0x4,(0x0,_0x55fa5b[_0xd4bcc8(0x11f)])(_0x3116ec[_0xd4bcc8(0x160)]))],_0x28a77d);function _0x1e70c3(_0x5564cd,_0x404c56){const _0x452281=_0xd4bcc8;return _0x404c56===_0x3116ec[_0x452281(0x120)]['CONFLICT']||_0x404c56===_0x3116ec[_0x452281(0x120)]['NOT_COLLAB']?Error(_0x452281(0x159)+_0x5564cd+_0x452281(0x11d)+_0x404c56+'.'):null;}var _0x241c5c=class extends _0x5e3f0b[_0xd4bcc8(0x126)]{[_0xd4bcc8(0x11a)](_0x22e9c0){const _0x2a2148=_0xd4bcc8;let _0x468f25=_0x22e9c0['get'](_0x3116ec['CollaborationController']);this[_0x2a2148(0x16a)](this[_0x2a2148(0x168)](this[_0x2a2148(0x139)]['CollaborationStatusChanged'],()=>{const _0x558c1c=_0x2a2148;let _0xcda015=new _0x55fa5b[(_0x558c1c(0x11e))](),_0x50cf07=_0x592e74=>{const _0x222eb8=_0x558c1c;let _0x2de0ee=_0x592e74['status$'][_0x222eb8(0x127)]((0x0,_0x2a8999[_0x222eb8(0x12c)])())[_0x222eb8(0x131)](_0x2aebf5=>{const _0x4cfaf4=_0x222eb8;let _0x2b3f4a={'unitId':_0x592e74['unitID'],'status':_0x2aebf5};this[_0x4cfaf4(0x121)](this[_0x4cfaf4(0x139)][_0x4cfaf4(0x12a)],_0x2b3f4a);});_0xcda015[_0x222eb8(0x141)]((0x0,_0x55fa5b['toDisposable'])(_0x2de0ee));};return _0x468f25[_0x558c1c(0x142)]()['forEach'](_0x50cf07),_0xcda015[_0x558c1c(0x141)]((0x0,_0x55fa5b[_0x558c1c(0x14a)])(_0x468f25[_0x558c1c(0x148)]['subscribe'](_0x50cf07))),_0xcda015;})),this['disposeWithMe'](this[_0x2a2148(0x168)](this[_0x2a2148(0x139)][_0x2a2148(0x136)],()=>{const _0xaee031=_0x2a2148;let _0x315571=new _0x55fa5b[(_0xaee031(0x11e))](),_0x125f40=_0x3b545f=>{const _0x59ed7d=_0xaee031;let _0x431c8a=_0x3b545f[_0x59ed7d(0x113)][_0x59ed7d(0x131)](_0x42c4e6=>{const _0x468e09=_0x59ed7d;let _0x48b804={'unitId':_0x42c4e6['unitID'],'reason':_0x42c4e6[_0x468e09(0x12d)],'message':_0x42c4e6[_0x468e09(0x12e)],'revert':_0x42c4e6[_0x468e09(0x13b)],'localChanges':_0x42c4e6['localChanges'],'cacheCleared':_0x42c4e6[_0x468e09(0x151)]};this[_0x468e09(0x121)](this[_0x468e09(0x139)][_0x468e09(0x136)],_0x48b804);});_0x315571[_0x59ed7d(0x141)]((0x0,_0x55fa5b[_0x59ed7d(0x14a)])(_0x431c8a));};return _0x468f25[_0xaee031(0x142)]()[_0xaee031(0x17a)](_0x125f40),_0x315571[_0xaee031(0x141)]((0x0,_0x55fa5b[_0xaee031(0x14a)])(_0x468f25[_0xaee031(0x148)][_0xaee031(0x131)](_0x125f40))),_0x315571;})),this[_0x2a2148(0x16a)](this['registerEventHandler'](this['Event'][_0x2a2148(0x170)],()=>{const _0x4f85de=_0x2a2148;let _0x93cc98=new _0x55fa5b['DisposableCollection'](),_0x40a7a8=_0x35be12=>{const _0x51b77c=_0x17b5;let _0x450ee1=_0x35be12[_0x51b77c(0x174)][_0x51b77c(0x131)](_0x8e30c0=>{const _0x404084=_0x51b77c;let _0x223c5c={'unitId':_0x8e30c0['unitID'],'reqId':_0x8e30c0['reqId'],'reason':_0x8e30c0[_0x404084(0x12d)],'attempt':_0x8e30c0[_0x404084(0x14f)],'elapsedMs':_0x8e30c0['elapsedMs'],'unsyncedMutationCount':_0x8e30c0['unsyncedMutationCount'],'nextDelayMs':_0x8e30c0[_0x404084(0x14d)]};this[_0x404084(0x121)](this[_0x404084(0x139)][_0x404084(0x170)],_0x223c5c);});_0x93cc98['add']((0x0,_0x55fa5b[_0x51b77c(0x14a)])(_0x450ee1));};return _0x468f25[_0x4f85de(0x142)]()[_0x4f85de(0x17a)](_0x40a7a8),_0x93cc98[_0x4f85de(0x141)]((0x0,_0x55fa5b[_0x4f85de(0x14a)])(_0x468f25[_0x4f85de(0x148)][_0x4f85de(0x131)](_0x40a7a8))),_0x93cc98;}));}['getCollaboration'](){const _0x24ce85=_0xd4bcc8;return this[_0x24ce85(0x154)]['createInstance'](_0x28a77d,{'getWorkbook':_0x3708cc=>this[_0x24ce85(0x117)](_0x3708cc),'getDocument':_0xa6f3b6=>this[_0x24ce85(0x167)](_0xa6f3b6),'getPresentation':_0x577d4a=>this[_0x24ce85(0x14e)](_0x577d4a),'getBase':_0x2f7823=>this[_0x24ce85(0x138)](_0x2f7823),'getBoard':_0xf6e3c0=>this['getBoard'](_0xf6e3c0),'getPdf':_0x527a8d=>this[_0x24ce85(0x150)](_0x527a8d)});}['loadServerUnit'](_0x8e08d4,_0x22c835,_0x5abb42){const _0x5483b2=_0xd4bcc8;return this[_0x5483b2(0x154)][_0x5483b2(0x133)](_0x3116ec[_0x5483b2(0x165)])[_0x5483b2(0x12b)](_0x8e08d4,_0x22c835,_0x5abb42);}[_0xd4bcc8(0x155)](_0x481147,_0x26a3ae,_0x1e120a){const _0x3d7461=_0xd4bcc8;return this[_0x3d7461(0x154)]['get'](_0x3116ec['DataLoaderService'])[_0x3d7461(0x16c)](_0x481147,_0x26a3ae,_0x1e120a);}};_0x5e3f0b[_0xd4bcc8(0x126)]['extend'](_0x241c5c),Object[_0xd4bcc8(0x163)](_0x1a9563,_0xd4bcc8(0x157),{'enumerable':!0x0,'get':function(){return _0x28a77d;}});}));function _0x17b5(_0x3d5e8c,_0x250a0f){_0x3d5e8c=_0x3d5e8c-0x113;const _0x19a30b=_0x19a3();let _0x17b595=_0x19a30b[_0x3d5e8c];return _0x17b595;}function _0x19a3(){const _0x360373=['getCollaborationStatus','CollaborationChangesetResend','from','_resolveUnitId','FEventName','changesetResend$','SYNCED','switchMap','decorate','[FCollaboration]:\x20Unit\x20\x22','UniverInstanceType','forEach','getFocusedUnit','loadBaseAsync','320DRxyVC','726015QxkKrt','conflict$','UNIVER_SLIDE','resolve','readyForCollab','getWorkbook','_collaborationController','length','_initialize','1368CZsQvv','loadBoardAsync','\x22\x20while\x20collaboration\x20status\x20is\x20','DisposableCollection','Inject','CollaborationStatus','fireEvent','@univerjs-pro/collaboration-client','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','waitForRoom$','function','FUniver','pipe','\x22\x20after\x20','extend','CollaborationStatusChanged','loadUnit','distinctUntilChanged','reason','message','_univerInstanceService','values','subscribe','IUniverInstanceService','get','142416iJaXxX','members$','CollaborationConflict','MemberService','getBase','Event','4406840nGtmaT','revert','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','loadSlideAsync','loadPdfAsync','UNIVER_BOARD','getCollabEntity','add','getCollabEntities','NOT_COLLAB','getBoard','FEnum','836810lVAAwy','status','entityInit$','_handler','toDisposable','[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.','71586iJvTFm','nextDelayMs','getPresentation','attempt','getPdf','cacheCleared','Module','loadSheetAsync','_injector','loadServerUnitOfRevision','1pXFQRn','FCollaboration','object','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','exports','unsubscribe','hasWritePending','FBase','timeout','UniverProCollaborationClient','CollaborationController','15325260NVTwJn','reject','defineProperty','state','DataLoaderService','_dataLoaderService','getDocument','registerEventHandler','21uCdMZg','disposeWithMe','toStringTag','loadUnitOfRevision','rxjs','ms.'];_0x19a3=function(){return _0x360373;};return _0x19a3();}
|