@univerjs-pro/collaboration-client 0.2.2 → 0.2.4-alpha.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/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/locale/en-US.json +2 -1
- package/lib/locale/ru-RU.json +2 -1
- package/lib/locale/vi-VN.json +33 -0
- package/lib/locale/zh-CN.json +2 -1
- package/lib/locale/zh-TW.json +33 -0
- 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/sheet-collab-cursor-entity.d.ts +1 -2
- 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 +2 -2
- package/lib/types/controllers/collaboration/collaboration-state.d.ts +1 -2
- package/lib/types/controllers/collaboration/collaboration.controller.d.ts +1 -2
- package/lib/types/locale/vi-VN.d.ts +4 -0
- package/lib/types/locale/zh-CN.d.ts +1 -0
- package/lib/types/locale/zh-TW.d.ts +4 -0
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/auth-server/authz-io-http.service.d.ts +3 -2
- package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +3 -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 +13 -0
- package/lib/types/services/range-selection/sheet-transform-selections.service.d.ts +5 -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 +33 -35
package/lib/locale/en-US.json
CHANGED
@@ -24,7 +24,8 @@
|
|
24
24
|
"collaboration": {
|
25
25
|
"single-unit": {
|
26
26
|
"warning": "You opened the same file in another tab. In case of data missing, you cannot edit on this tab."
|
27
|
-
}
|
27
|
+
},
|
28
|
+
"closeRoom": "Editing privileges were revoked because the collaborative room was closed."
|
28
29
|
},
|
29
30
|
"auth": {
|
30
31
|
"needGotoLoginAlert": "Your login has expired, click OK to re-login, click Cancel to save your local edits."
|
package/lib/locale/ru-RU.json
CHANGED
@@ -24,7 +24,8 @@
|
|
24
24
|
"collaboration": {
|
25
25
|
"single-unit": {
|
26
26
|
"warning": "You opened the same file in another tab. In case of data missing, you cannot edit on this tab."
|
27
|
-
}
|
27
|
+
},
|
28
|
+
"closeRoom": "Editing privileges were revoked because the collaborative room was closed."
|
28
29
|
},
|
29
30
|
"auth": {
|
30
31
|
"needGotoLoginAlert": "Your login has expired, click OK to re-login, click Cancel to save your local edits."
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"collabStatus": {
|
3
|
+
"fetchMiss": "Syncing server data...",
|
4
|
+
"conflict": "Edit conflicts",
|
5
|
+
"notCollab": "Local file",
|
6
|
+
"synced": "Synced",
|
7
|
+
"syncing": "Syncing...",
|
8
|
+
"offline": "Offline, edits would be save on local"
|
9
|
+
},
|
10
|
+
"session": {
|
11
|
+
"connection-failed": "Connection failed, please check your network.",
|
12
|
+
"will-retry": "Connection failed, we retry in a while.",
|
13
|
+
"room-full": "Collaboration room is full. You edits would be saved locally.",
|
14
|
+
"collaboration-timeout": "The server is not responding to your collaboration request. Your edits would be saved locally."
|
15
|
+
},
|
16
|
+
"conflict": {
|
17
|
+
"title": "Collaboration Conflict",
|
18
|
+
"content": "There is a conflict between your local copy and the copy on the server. Please save your local edits, because they will be lost when you reload the page."
|
19
|
+
},
|
20
|
+
"permission": {
|
21
|
+
"title": "Authentication Error",
|
22
|
+
"content": "Your actions are conflicting with the server's permissions. Please save your local edits elsewhere as they will be discarded after refreshing the page."
|
23
|
+
},
|
24
|
+
"collaboration": {
|
25
|
+
"single-unit": {
|
26
|
+
"warning": "You opened the same file in another tab. In case of data missing, you cannot edit on this tab."
|
27
|
+
},
|
28
|
+
"closeRoom": "Editing privileges were revoked because the collaborative room was closed."
|
29
|
+
},
|
30
|
+
"auth": {
|
31
|
+
"needGotoLoginAlert": "Your login has expired, click OK to re-login, click Cancel to save your local edits."
|
32
|
+
}
|
33
|
+
}
|
package/lib/locale/zh-CN.json
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"collabStatus": {
|
3
|
+
"fetchMiss": "Syncing server data...",
|
4
|
+
"conflict": "Edit conflicts",
|
5
|
+
"notCollab": "Local file",
|
6
|
+
"synced": "Synced",
|
7
|
+
"syncing": "Syncing...",
|
8
|
+
"offline": "Offline, edits would be save on local"
|
9
|
+
},
|
10
|
+
"session": {
|
11
|
+
"connection-failed": "Connection failed, please check your network.",
|
12
|
+
"will-retry": "Connection failed, we retry in a while.",
|
13
|
+
"room-full": "Collaboration room is full. You edits would be saved locally.",
|
14
|
+
"collaboration-timeout": "The server is not responding to your collaboration request. Your edits would be saved locally."
|
15
|
+
},
|
16
|
+
"conflict": {
|
17
|
+
"title": "Collaboration Conflict",
|
18
|
+
"content": "There is a conflict between your local copy and the copy on the server. Please save your local edits, because they will be lost when you reload the page."
|
19
|
+
},
|
20
|
+
"permission": {
|
21
|
+
"title": "Authentication Error",
|
22
|
+
"content": "Your actions are conflicting with the server's permissions. Please save your local edits elsewhere as they will be discarded after refreshing the page."
|
23
|
+
},
|
24
|
+
"collaboration": {
|
25
|
+
"single-unit": {
|
26
|
+
"warning": "You opened the same file in another tab. In case of data missing, you cannot edit on this tab."
|
27
|
+
},
|
28
|
+
"closeRoom": "Editing privileges were revoked because the collaborative room was closed."
|
29
|
+
},
|
30
|
+
"auth": {
|
31
|
+
"needGotoLoginAlert": "Your login has expired, click OK to re-login, click Cancel to save your local edits."
|
32
|
+
}
|
33
|
+
}
|
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,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,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
|
|
@@ -49,6 +48,7 @@ export declare class MockLocalStorageService implements ILocalStorageService {
|
|
49
48
|
export declare class MockMessageService implements IMessageService {
|
50
49
|
show(_options: IMessageOptions & Omit<IMessageProps, 'key'>): IDisposable;
|
51
50
|
setContainer(_container: HTMLElement): void;
|
51
|
+
getContainer(): HTMLElement;
|
52
52
|
}
|
53
53
|
export declare class MockNotificationService implements INotificationService {
|
54
54
|
show(): IDisposable;
|
@@ -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';
|
@@ -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,5 +1,4 @@
|
|
1
|
-
import { DependencyOverride, ILogService, Plugin, UniverInstanceType } from '@univerjs/core';
|
2
|
-
import { Ctor, Injector } from '@wendellhu/redi';
|
1
|
+
import { Ctor, DependencyOverride, ILogService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
3
2
|
import { ICollaborationSocketService } from './services/socket/collaboration-socket.service';
|
4
3
|
|
5
4
|
export interface ICollaborationClientPluginConfig {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IAuthzIoService, IConfigService } from '@univerjs/core';
|
1
|
+
import { IAuthzIoService, Disposable, IConfigService } from '@univerjs/core';
|
2
2
|
import { HTTPService } from '@univerjs/network';
|
3
3
|
import { IActionInfo, IAllowedRequest, IBatchAllowedResponse, ICollaborator, ICreateCollaboratorRequest, ICreateRequest, IDeleteCollaboratorRequest, IListCollaboratorRequest, IListPermPointRequest, IListPermPointResponse, IListRolesRequest, IPutCollaboratorsRequest, IUnitRoleKV, IUpdateCollaboratorRequest, IUpdatePermPointRequest, UnitAction } from '@univerjs/protocol';
|
4
4
|
|
@@ -7,10 +7,11 @@ import { IActionInfo, IAllowedRequest, IBatchAllowedResponse, ICollaborator, ICr
|
|
7
7
|
* The URL should not ends with a slash.
|
8
8
|
*/
|
9
9
|
export declare const AUTHZ_URL_KEY = "AUTHZ_URL_KEY";
|
10
|
-
export declare class AuthzIoHttpService implements IAuthzIoService {
|
10
|
+
export declare class AuthzIoHttpService extends Disposable implements IAuthzIoService {
|
11
11
|
private _HTTPService;
|
12
12
|
private _configService;
|
13
13
|
constructor(_HTTPService: HTTPService, _configService: IConfigService);
|
14
|
+
private _initMergeInterceptor;
|
14
15
|
private _getAPIPrefixPath;
|
15
16
|
create(config: ICreateRequest): Promise<string>;
|
16
17
|
list(config: IListPermPointRequest): Promise<IListPermPointResponse['objects']>;
|
@@ -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';
|
@@ -37,6 +36,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
|
|
37
36
|
constructor(_unitID: string, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _beforeCloseService: IBeforeCloseService, _messageService: IMessageService, _configService: IConfigService, _localeService: LocaleService, _memberService: MemberService, _commentService: CommentService);
|
38
37
|
getMemberID(): string | null;
|
39
38
|
dispose(): void;
|
39
|
+
close(): void;
|
40
40
|
private _onCombEvent;
|
41
41
|
private _joinRoom;
|
42
42
|
private _onJoinRoomEvent;
|
@@ -83,6 +83,7 @@ export declare class CollaborationSessionService extends Disposable {
|
|
83
83
|
* @returns a collaboration session.
|
84
84
|
*/
|
85
85
|
requireSession(unitID: string): Promise<CollaborationSession>;
|
86
|
+
closeSession(unitID: string): void;
|
86
87
|
private _createSocket;
|
87
88
|
/**
|
88
89
|
* Try to establish connection to the collaboration server.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
2
|
+
import { CollaborationSessionService } from '../collaboration-session/collaboration-session.service';
|
3
|
+
|
4
|
+
export declare class PermissionService extends RxDisposable {
|
5
|
+
private _injector;
|
6
|
+
private _univerInstanceService;
|
7
|
+
private _permissionService;
|
8
|
+
private _collaborationSessionService;
|
9
|
+
private _localeService;
|
10
|
+
constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _collaborationSessionService: CollaborationSessionService, _localeService: LocaleService);
|
11
|
+
private _initCloseConn;
|
12
|
+
private _initUnitPermissionChange;
|
13
|
+
}
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
|
2
|
-
import { Injector } from '@
|
2
|
+
import { Injector } from '@univerjs/core';
|
3
3
|
|
4
|
+
export declare function extractTargetFromFirstChangeset(changeset: IChangeset): {
|
5
|
+
unitId: string;
|
6
|
+
subUnitId: string;
|
7
|
+
};
|
4
8
|
export declare class SheetTransformSelectionsService {
|
5
9
|
private readonly _injector;
|
6
10
|
private readonly _transformService;
|
@@ -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>;
|