@univerjs-pro/collaboration-client 0.2.4 → 0.2.6
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/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/types/controllers/collab-cursor/__tests__/doc-collab-cursor.controller.spec.d.ts +1 -2
- package/lib/types/controllers/collab-cursor/collab-cursor.controller.d.ts +1 -2
- package/lib/types/controllers/collab-cursor/doc-collab-cursor-entity.d.ts +1 -2
- package/lib/types/controllers/collab-cursor/doc-collab-cursor-render.controller.d.ts +6 -7
- package/lib/types/controllers/collab-cursor/sheet-collab-cursor-entity.d.ts +1 -2
- package/lib/types/controllers/collab-cursor/sheet-collab-cursor-render.controller.d.ts +7 -8
- package/lib/types/controllers/collab-status/collab-status.controller.d.ts +1 -2
- package/lib/types/controllers/collaboration/__tests__/mock-text-selection-render-manager.service.d.ts +1 -1
- package/lib/types/controllers/collaboration/__tests__/mocks.d.ts +1 -2
- package/lib/types/controllers/collaboration/collaboration-state.d.ts +4 -3
- package/lib/types/controllers/collaboration/collaboration.controller.d.ts +1 -2
- package/lib/types/controllers/collaboration/utils/empty.d.ts +3 -0
- package/lib/types/plugin.d.ts +7 -4
- package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +1 -2
- package/lib/types/services/ime-cache-transform/doc-transform-ime-cache.service.d.ts +1 -1
- package/lib/types/services/permission/permission.service.d.ts +1 -2
- package/lib/types/services/range-selection/sheet-transform-selections.service.d.ts +1 -1
- package/lib/types/services/single-active-unit/single-active-unit.service.d.ts +1 -1
- package/lib/types/services/socket/collaboration-socket.service.d.ts +1 -1
- package/lib/types/services/text-selection/doc-transform-selections.service.d.ts +1 -1
- package/lib/types/services/url/url.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +26 -28
package/lib/types/controllers/collab-cursor/__tests__/doc-collab-cursor.controller.spec.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import { DocumentDataModel, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
1
|
+
import { DocumentDataModel, Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
3
2
|
import { Nullable } from 'vitest';
|
4
3
|
import { DocumentViewModel, IRenderManagerService, DocumentSkeleton, IRender, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
5
4
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
1
|
+
import { Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
3
2
|
import { Observable } from 'rxjs';
|
4
3
|
import { IDocCollabCursor, ISheetCollabCursor } from '../../models/cursor';
|
5
4
|
import { CollaborationSessionService } from '../../services/collaboration-session/collaboration-session.service';
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { ICommandService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
1
|
+
import { ICommandService, Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
2
2
|
import { ICollaborationUser, ITransformService } from '@univerjs-pro/collaboration';
|
3
|
-
import { Injector } from '@wendellhu/redi';
|
4
3
|
import { IDocCollabCursor } from '../../models/cursor';
|
5
4
|
import { CollaborationSession } from '../../services/collaboration-session/collaboration-session.service';
|
6
5
|
import { ColorAssignService } from '../../services/color-assign/color-assign.service';
|
@@ -1,22 +1,21 @@
|
|
1
|
-
import {
|
2
|
-
import { IRenderManagerService } from '@univerjs/engine-render';
|
1
|
+
import { DocumentDataModel, RxDisposable, ThemeService } from '@univerjs/core';
|
2
|
+
import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
|
3
3
|
import { DocSkeletonManagerService } from '@univerjs/docs';
|
4
4
|
import { CollabCursorController } from './collab-cursor.controller';
|
5
5
|
|
6
6
|
/**
|
7
7
|
* This controller works with `CollabCursorController` to render doc collaboration cursors.
|
8
8
|
*/
|
9
|
-
export declare class DocCollabCursorRenderController extends RxDisposable {
|
9
|
+
export declare class DocCollabCursorRenderController extends RxDisposable implements IRenderModule {
|
10
|
+
private readonly _context;
|
11
|
+
private readonly _docSkeletonManagerService;
|
10
12
|
private readonly _collabCursorController;
|
11
|
-
private readonly _univerInstanceService;
|
12
13
|
private readonly _renderManagerService;
|
13
|
-
private readonly _docSkeletonManagerService;
|
14
14
|
private readonly _themeService;
|
15
15
|
/** Cursors stored for different Workbooks. */
|
16
16
|
private _cursors;
|
17
|
-
constructor(
|
17
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSkeletonManagerService: DocSkeletonManagerService, _collabCursorController: CollabCursorController, _renderManagerService: IRenderManagerService, _themeService: ThemeService);
|
18
18
|
private _init;
|
19
19
|
private _updateCollabCursors;
|
20
20
|
private _removeCollabCursors;
|
21
|
-
private _getDocObject;
|
22
21
|
}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { ICommandService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
1
|
+
import { ICommandService, Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
2
2
|
import { RefRangeService } from '@univerjs/sheets';
|
3
3
|
import { ICollaborationUser } from '@univerjs-pro/collaboration';
|
4
|
-
import { Injector } from '@wendellhu/redi';
|
5
4
|
import { ISheetCollabCursor } from '../../models/cursor';
|
6
5
|
import { CollaborationSession } from '../../services/collaboration-session/collaboration-session.service';
|
7
6
|
import { ColorAssignService } from '../../services/color-assign/color-assign.service';
|
@@ -1,21 +1,20 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { Workbook, RxDisposable, ThemeService } from '@univerjs/core';
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
3
|
+
import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
3
4
|
import { CollabCursorController } from './collab-cursor.controller';
|
4
5
|
|
5
6
|
/**
|
6
7
|
* This controller works with `CollabCursorController` to render sheet collaboration cursors.
|
7
8
|
*/
|
8
|
-
export declare class SheetCollabCursorRenderController extends RxDisposable {
|
9
|
+
export declare class SheetCollabCursorRenderController extends RxDisposable implements IRenderModule {
|
10
|
+
private readonly _context;
|
11
|
+
private readonly _sheetSkeletonManagerService;
|
9
12
|
private readonly _collabCursorController;
|
10
|
-
private readonly _univerInstanceService;
|
11
|
-
private readonly _renderManagerService;
|
12
13
|
private readonly _themeService;
|
13
14
|
/** Cursors stored for different Workbooks. */
|
14
15
|
private _cursors;
|
15
16
|
private _lastPointer;
|
16
|
-
|
17
|
-
private get _unitId();
|
18
|
-
constructor(_collabCursorController: CollabCursorController, _univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _themeService: ThemeService);
|
17
|
+
constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService, _collabCursorController: CollabCursorController, _themeService: ThemeService);
|
19
18
|
private _init;
|
20
19
|
private _updateCollabCursors;
|
21
20
|
private _removeCollabCursors;
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
1
|
+
import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
|
2
2
|
import { IUIPartsService } from '@univerjs/ui';
|
3
|
-
import { Injector } from '@wendellhu/redi';
|
4
3
|
import { BehaviorSubject } from 'rxjs';
|
5
4
|
import { CollaborationController } from '../collaboration/collaboration.controller';
|
6
5
|
import { CollaborationStatus } from '../collaboration/collaboration-state';
|
@@ -7,4 +7,4 @@ export declare class TextSelectionRenderManager {
|
|
7
7
|
removeAllTextRanges(): void;
|
8
8
|
addTextRanges(): void;
|
9
9
|
}
|
10
|
-
export declare const ITextSelectionRenderManager: import('@
|
10
|
+
export declare const ITextSelectionRenderManager: import('@univerjs/core').IdentifierDecorator<TextSelectionRenderManager>;
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { ILocalStorageService, Nullable, ILogService } from '@univerjs/core';
|
1
|
+
import { IDisposable, ILocalStorageService, Nullable, ILogService } from '@univerjs/core';
|
2
2
|
import { IMessageOptions, IMessageProps } from '@univerjs/design';
|
3
3
|
import { IBeforeCloseService, IMessageService, INotificationService } from '@univerjs/ui';
|
4
4
|
import { ICombResponseEvent } from '@univerjs-pro/collaboration';
|
5
|
-
import { IDisposable } from '@wendellhu/redi';
|
6
5
|
import { Subject } from 'rxjs';
|
7
6
|
import { ICollaborationSocket, ICollaborationSocketService } from '../../../services/socket/collaboration-socket.service';
|
8
7
|
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { IMutationInfo, Nullable, ICommandService, IConfigService, ILogService, IPermissionService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
1
|
+
import { IMutationInfo, Nullable, ICommandService, IConfigService, ILogService, Injector, IPermissionService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
2
2
|
import { INotificationService } from '@univerjs/ui';
|
3
3
|
import { IAcknowledgedChangeset, IChangeset, ITransformService, RevisionService } from '@univerjs-pro/collaboration';
|
4
4
|
import { UniverType } from '@univerjs/protocol';
|
5
|
-
import { Injector } from '@wendellhu/redi';
|
6
5
|
import { LocalCacheService } from '../../services/local-cache/local-cache.service';
|
7
6
|
import { MemberService } from '../../services/member/member.service';
|
8
7
|
import { ICollaborativeUndoRedoService } from '../../services/undoredo/collaborative-undoredo.service';
|
@@ -111,10 +110,12 @@ export declare abstract class CollaborationState {
|
|
111
110
|
export declare class SyncedState extends CollaborationState {
|
112
111
|
private readonly _injector;
|
113
112
|
private readonly _logService;
|
113
|
+
private readonly _transformService;
|
114
114
|
readonly status = CollaborationStatus.SYNCED;
|
115
|
-
constructor(unitID: string, type: UniverType, handler: ICollaborationStateHandler, revisionService: RevisionService, localCacheService: LocalCacheService, _injector: Injector, undoRedoService: ICollaborativeUndoRedoService, commandService: ICommandService, _logService: ILogService);
|
115
|
+
constructor(unitID: string, type: UniverType, handler: ICollaborationStateHandler, revisionService: RevisionService, localCacheService: LocalCacheService, _injector: Injector, undoRedoService: ICollaborativeUndoRedoService, commandService: ICommandService, _logService: ILogService, _transformService: ITransformService);
|
116
116
|
appendMutation(mutation: IMutationInfo): CollaborationState;
|
117
117
|
onRemoteChangeset(changeset: IChangeset): CollaborationState;
|
118
|
+
private _onConflict;
|
118
119
|
onRemoteAck(): never;
|
119
120
|
onRemoteRej(): CollaborationState;
|
120
121
|
toggleOffline(): CollaborationState;
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import { IMutationInfo, Nullable, ICommandService, ILogService, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
1
|
+
import { IDisposable, IMutationInfo, Nullable, ICommandService, ILogService, Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
2
2
|
import { IMessageService } from '@univerjs/ui';
|
3
3
|
import { CompressMutationService, RevisionService } from '@univerjs-pro/collaboration';
|
4
4
|
import { UniverType } from '@univerjs/protocol';
|
5
|
-
import { IDisposable, Injector } from '@wendellhu/redi';
|
6
5
|
import { Observable, BehaviorSubject } from 'rxjs';
|
7
6
|
import { DocStateChangeManagerService } from '@univerjs/docs';
|
8
7
|
import { CollaborationSession, CollaborationSessionService } from '../../services/collaboration-session/collaboration-session.service';
|
package/lib/types/plugin.d.ts
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
import { DependencyOverride, ILogService,
|
2
|
-
import {
|
1
|
+
import { Ctor, DependencyOverride, ILogService, Injector, Plugin } from '@univerjs/core';
|
2
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
3
3
|
import { ICollaborationSocketService } from './services/socket/collaboration-socket.service';
|
4
4
|
|
5
5
|
export interface ICollaborationClientPluginConfig {
|
6
6
|
socketService?: Ctor<ICollaborationSocketService>;
|
7
7
|
enableOfflineEditing?: boolean;
|
8
8
|
enableSingleActiveInstanceLock?: boolean;
|
9
|
-
collaborationUniverTypes?: UniverInstanceType[];
|
10
9
|
enableAuthServer?: boolean;
|
11
10
|
/**
|
12
11
|
* Override internal modules with custom implementations.
|
@@ -16,9 +15,13 @@ export interface ICollaborationClientPluginConfig {
|
|
16
15
|
export declare class UniverCollaborationClientPlugin extends Plugin {
|
17
16
|
private readonly _config;
|
18
17
|
private readonly _logService;
|
18
|
+
private readonly _renderManagerService;
|
19
19
|
protected _injector: Injector;
|
20
20
|
static pluginName: string;
|
21
|
-
constructor(_config: ICollaborationClientPluginConfig | undefined, _logService: ILogService, _injector: Injector);
|
21
|
+
constructor(_config: ICollaborationClientPluginConfig | undefined, _logService: ILogService, _renderManagerService: IRenderManagerService, _injector: Injector);
|
22
22
|
onStarting(injector: Injector): void;
|
23
|
+
onRendered(): void;
|
24
|
+
private _registerDependencies;
|
25
|
+
private _registerRenderDependencies;
|
23
26
|
private _initModules;
|
24
27
|
}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { Nullable, Disposable, IConfigService, ILogService, LocaleService, RxDisposable } from '@univerjs/core';
|
1
|
+
import { IDisposable, Nullable, Disposable, IConfigService, ILogService, Injector, LocaleService, RxDisposable } from '@univerjs/core';
|
2
2
|
import { IBeforeCloseService, IMessageService } from '@univerjs/ui';
|
3
3
|
import { ICollaborationEvent } from '@univerjs-pro/collaboration';
|
4
|
-
import { IDisposable, Injector } from '@wendellhu/redi';
|
5
4
|
import { Observable } from 'rxjs';
|
6
5
|
import { MemberService } from '../member/member.service';
|
7
6
|
import { ICollaborationSocket, ICollaborationSocketService } from '../socket/collaboration-socket.service';
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { Injector } from '@
|
2
|
-
import { IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
1
|
+
import { Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
3
2
|
import { CollaborationSessionService } from '../collaboration-session/collaboration-session.service';
|
4
3
|
|
5
4
|
export declare class PermissionService extends RxDisposable {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
|
2
|
-
import { Injector } from '@
|
2
|
+
import { Injector } from '@univerjs/core';
|
3
3
|
|
4
4
|
export declare function extractTargetFromFirstChangeset(changeset: IChangeset): {
|
5
5
|
unitId: string;
|
@@ -6,7 +6,7 @@ import { Observable } from 'rxjs';
|
|
6
6
|
* especially when the there is not access to the internet. There is a great chance of loosing
|
7
7
|
* offline data! So we should make there is only one active unit at a time.
|
8
8
|
*/
|
9
|
-
export declare const ISingleActiveUnitService: import('@
|
9
|
+
export declare const ISingleActiveUnitService: import('@univerjs/core').IdentifierDecorator<ISingleActiveUnitService>;
|
10
10
|
export interface ISingleActiveUnitService {
|
11
11
|
editingUnit: (unitID: string) => void;
|
12
12
|
getUnitStatus$: (unitID: string) => Observable<UnitStatus>;
|
@@ -16,7 +16,7 @@ export interface ICollaborationSocket extends Pick<ISocket, 'open$' | 'error$' |
|
|
16
16
|
export interface ICollaborationSocketService {
|
17
17
|
createSocket: (url: string) => Nullable<ICollaborationSocket>;
|
18
18
|
}
|
19
|
-
export declare const ICollaborationSocketService: import('@
|
19
|
+
export declare const ICollaborationSocketService: import('@univerjs/core').IdentifierDecorator<ICollaborationSocketService>;
|
20
20
|
export declare class CollaborationSocketService implements ICollaborationSocketService {
|
21
21
|
protected readonly _http: HTTPService;
|
22
22
|
protected readonly _ws: WebSocketService;
|
@@ -10,4 +10,4 @@ export interface IURLService {
|
|
10
10
|
removeParam: (key: string, useReplace?: boolean) => void;
|
11
11
|
urlChange$: Observable<void>;
|
12
12
|
}
|
13
|
-
export declare const IURLService: import('@
|
13
|
+
export declare const IURLService: import('@univerjs/core').IdentifierDecorator<IURLService>;
|