@univerjs-pro/collaboration-client 0.5.1-nightly.202412031606 → 0.5.1-nightly.202412051606

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.
Files changed (68) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +1 -1
  10. package/lib/es/locale/en-US.js +1 -1
  11. package/lib/es/locale/fa-IR.js +1 -1
  12. package/lib/es/locale/fr-FR.js +1 -1
  13. package/lib/es/locale/ru-RU.js +1 -1
  14. package/lib/es/locale/vi-VN.js +1 -1
  15. package/lib/es/locale/zh-CN.js +1 -1
  16. package/lib/es/locale/zh-TW.js +1 -1
  17. package/lib/index.css +0 -1
  18. package/lib/types/controllers/collaboration/collaboration-entity.d.ts +20 -18
  19. package/lib/types/controllers/collaboration/collaboration-state.d.ts +17 -14
  20. package/lib/types/controllers/collaboration/collaboration.controller.d.ts +1 -0
  21. package/lib/types/index.d.ts +11 -11
  22. package/lib/types/plugin.d.ts +1 -6
  23. package/lib/types/services/collaboration-session/collaboration-session.d.ts +3 -4
  24. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +3 -3
  25. package/lib/types/services/collaboration-ui-event/collaboration-ui-event.d.ts +19 -0
  26. package/lib/types/services/data-loader/data-loader.service.d.ts +23 -0
  27. package/lib/types/services/image-remote/image-io.service.d.ts +1 -1
  28. package/lib/types/services/local-cache/local-cache.service.d.ts +7 -23
  29. package/lib/types/services/permission/permission.service.d.ts +8 -3
  30. package/lib/types/services/single-active-unit/single-active-unit.service.d.ts +0 -24
  31. package/lib/umd/index.js +1 -1
  32. package/lib/umd/locale/en-US.js +1 -1
  33. package/lib/umd/locale/fa-IR.js +1 -1
  34. package/lib/umd/locale/fr-FR.js +1 -1
  35. package/lib/umd/locale/ru-RU.js +1 -1
  36. package/lib/umd/locale/vi-VN.js +1 -1
  37. package/lib/umd/locale/zh-CN.js +1 -1
  38. package/lib/umd/locale/zh-TW.js +1 -1
  39. package/package.json +8 -17
  40. package/lib/types/controllers/clipboard/docs/image/image-paste.controller.d.ts +0 -9
  41. package/lib/types/controllers/collab-cursor/__tests__/doc-collab-cursor.controller.spec.d.ts +0 -23
  42. package/lib/types/controllers/collab-cursor/__tests__/serialize-text-ranges.spec.d.ts +0 -1
  43. package/lib/types/controllers/collab-cursor/__tests__/sheet-collab-cursor.controller.spec.d.ts +0 -1
  44. package/lib/types/controllers/collab-cursor/collab-cursor.controller.d.ts +0 -22
  45. package/lib/types/controllers/collab-cursor/doc-collab-cursor-entity.d.ts +0 -38
  46. package/lib/types/controllers/collab-cursor/doc-collab-cursor-render.controller.d.ts +0 -24
  47. package/lib/types/controllers/collab-cursor/serialize-text-ranges.d.ts +0 -3
  48. package/lib/types/controllers/collab-cursor/sheet-collab-cursor-entity.d.ts +0 -39
  49. package/lib/types/controllers/collab-cursor/sheet-collab-cursor-render.controller.d.ts +0 -21
  50. package/lib/types/controllers/collab-status/collab-status.controller.d.ts +0 -18
  51. package/lib/types/controllers/collaboration/__tests__/collaboration.controller.spec.d.ts +0 -4
  52. package/lib/types/controllers/collaboration/__tests__/mock-text-selection-render-manager.service.d.ts +0 -0
  53. package/lib/types/controllers/collaboration/__tests__/mocks.d.ts +0 -58
  54. package/lib/types/controllers/data-loader/__tests__/data-loader.controller.spec.d.ts +0 -1
  55. package/lib/types/controllers/data-loader/data-loader.controller.d.ts +0 -22
  56. package/lib/types/models/cursor.d.ts +0 -30
  57. package/lib/types/services/color-assign/color-assign.service.d.ts +0 -10
  58. package/lib/types/services/ime-cache-transform/doc-transform-ime-cache.service.d.ts +0 -13
  59. package/lib/types/services/state-cache-transform/doc-transform-state-cache.service.d.ts +0 -12
  60. package/lib/types/services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service.d.ts +0 -13
  61. package/lib/types/services/text-selection/doc-transform-selections.service.d.ts +0 -8
  62. package/lib/types/services/url/url.service.d.ts +0 -12
  63. package/lib/types/services/url/web-url.service.d.ts +0 -10
  64. package/lib/types/views/components/CollabStatus.d.ts +0 -10
  65. package/lib/types/views/components/CollabStatus.stories.d.ts +0 -8
  66. package/lib/types/views/shapes/doc-collab-cursor.d.ts +0 -27
  67. package/lib/types/views/shapes/sheet-collab-cursor.shape.d.ts +0 -27
  68. package/lib/types/views/shapes/text-bubble.shape.d.ts +0 -19
@@ -0,0 +1,19 @@
1
+ export interface ICollaborationUIEvent {
2
+ id: CollaborationUIEventId;
3
+ data?: string;
4
+ }
5
+ export declare enum CollaborationUIEventId {
6
+ OTHER_CLIENT_EDITING = "OTHER_CLIENT_EDITING",
7
+ PERMISSION_DENIED = "PERMISSION_DENIED",
8
+ CONFLICT = "CONFLICT",
9
+ CLOSE_ROOM = "CLOSE_ROOM",
10
+ JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
11
+ SOCKET_FAILED_RETRY = "SOCKET_FAILED_RETRY",
12
+ SOCKET_FAILED = "SOCKET_FAILED",
13
+ SUBMIT_CHANGESET_TIMEOUT = "SUBMIT_CHANGESET_TIMEOUT"
14
+ }
15
+ export declare class CollaborationUIEventService {
16
+ private readonly _event$;
17
+ readonly event$: import('rxjs').Observable<ICollaborationUIEvent>;
18
+ emitEvent(event: ICollaborationUIEvent): void;
19
+ }
@@ -0,0 +1,23 @@
1
+ import { UnitModel, ILogService, RxDisposable } from '@univerjs/core';
2
+ import { SnapshotService } from '@univerjs-pro/collaboration';
3
+ import { UniverType } from '@univerjs/protocol';
4
+ import { ILocalCacheService } from '../local-cache/local-cache.service';
5
+ export interface IUnitInfo {
6
+ unitId: string;
7
+ type: UniverType;
8
+ subUnitId?: string;
9
+ }
10
+ /**
11
+ * This service provides a way to load data from the server and initialize the Univer instance.
12
+ */
13
+ export declare class DataLoaderService extends RxDisposable {
14
+ private readonly _logService;
15
+ private readonly _snapshotService;
16
+ private readonly _localCacheService?;
17
+ private readonly _unitInfo$;
18
+ readonly unitInfo$: import('rxjs').Observable<IUnitInfo | null>;
19
+ constructor(_logService: ILogService, _snapshotService: SnapshotService, _localCacheService?: ILocalCacheService | undefined);
20
+ init(unitId: string, type: UniverType, subUnitId?: string): Promise<UnitModel | null>;
21
+ private _loadSheet;
22
+ private _loadDoc;
23
+ }
@@ -12,7 +12,7 @@ export interface ISignUrlResponse {
12
12
  error: IError | undefined;
13
13
  url: string;
14
14
  }
15
- export declare class CollabrationImageIoService implements IImageIoService {
15
+ export declare class CollaborationImageIoService implements IImageIoService {
16
16
  private readonly _httpService;
17
17
  private readonly _configService;
18
18
  private readonly _univerInstanceService;
@@ -1,7 +1,6 @@
1
- import { IMutationInfo, Nullable, Disposable, IConfigService, ILocalStorageService, LocaleService } from '@univerjs/core';
1
+ import { IMutationInfo, Nullable } from '@univerjs/core';
2
2
  import { UniverType } from '@univerjs/protocol';
3
- import { IChangeset, RevisionService } from '@univerjs-pro/collaboration';
4
- import { IBeforeCloseService } from '@univerjs/ui';
3
+ import { IChangeset } from '@univerjs-pro/collaboration';
5
4
  export interface IUnitCacheData {
6
5
  unitID: string;
7
6
  type: UniverType;
@@ -9,29 +8,14 @@ export interface IUnitCacheData {
9
8
  awaitingChangeset: Nullable<IChangeset>;
10
9
  mutations: IMutationInfo[];
11
10
  }
12
- /**
13
- * This service provide caching to the collaboration controller.
14
- */
15
- export declare class LocalCacheService extends Disposable {
16
- private readonly _configService;
17
- private readonly _localStorageService;
18
- private readonly _beforeCloseService;
19
- private readonly _localeService;
20
- private readonly _revisionService;
21
- private _cachedData;
22
- private _saveTaskMap;
23
- private _disabled;
24
- constructor(_configService: IConfigService, _localStorageService: ILocalStorageService, _beforeCloseService: IBeforeCloseService, _localeService: LocaleService, _revisionService: RevisionService);
25
- disableLocalCache(): void;
26
- enableLocalCache(): void;
27
- dispose(): void;
11
+ export interface ILocalCacheService {
28
12
  loadOfflineData(unitID: string): Promise<Nullable<IUnitCacheData>>;
29
13
  saveOfflineData(unitID: string, data: IUnitCacheData): Promise<boolean>;
30
14
  updateOfflineData(unitID: string, type: UniverType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[]): void;
31
- private _scheduleSaving;
32
- private _getSaveTimeout;
33
- private _saveCache;
15
+ disableLocalCache(): void;
16
+ enableLocalCache(): void;
34
17
  exhaustSavingTask(): Promise<void>;
35
- private _setupBeforeClosingHandler;
18
+ saveTaskMap: Map<string, number>;
36
19
  }
20
+ export declare const ILocalCacheService: import('@wendellhu/redi').IdentifierDecorator<ILocalCacheService>;
37
21
  export declare function getLocalCacheKey(unitID: string): string;
@@ -1,12 +1,17 @@
1
- import { Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
1
+ import { IAuthzIoService, Injector, IPermissionService, IUndoRedoService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
2
  import { CollaborationSessionService } from '../collaboration-session/collaboration-session.service';
3
+ import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
3
4
  export declare class PermissionService extends RxDisposable {
4
5
  private _injector;
5
6
  private _univerInstanceService;
6
7
  private _permissionService;
7
8
  private _collaborationSessionService;
8
- private _localeService;
9
- constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _collaborationSessionService: CollaborationSessionService, _localeService: LocaleService);
9
+ private _collaborationUIEventService;
10
+ private _authzIoService;
11
+ private readonly _undoRedoService;
12
+ constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _collaborationSessionService: CollaborationSessionService, _collaborationUIEventService: CollaborationUIEventService, _authzIoService: IAuthzIoService, _undoRedoService: IUndoRedoService);
10
13
  private _initCloseConn;
11
14
  private _initUnitPermissionChange;
15
+ initWorkbookPermissionChange(_unitId?: string): Promise<void>;
16
+ refreshPermission(unitId: string, permissionId: string): void;
12
17
  }
@@ -1,4 +1,3 @@
1
- import { Disposable } from '@univerjs/core';
2
1
  import { Observable } from 'rxjs';
3
2
  /**
4
3
  * It is not recommended to open multiple units in different browser tabs at the same time,
@@ -14,26 +13,3 @@ export declare enum UnitStatus {
14
13
  NO_OTHER_CLIENTS_EDITING = 0,
15
14
  OTHER_CLIENTS_EDITING = 1
16
15
  }
17
- export declare class WebBrowserSingleActiveUnitService extends Disposable implements ISingleActiveUnitService {
18
- private _id;
19
- private _selfUnitIDs;
20
- private _unitOnClients;
21
- private _heartbeatTimer;
22
- private _clearOtherTimers;
23
- private _unitStatus;
24
- constructor();
25
- dispose(): void;
26
- getUnitStatus$(unitID: string): Observable<UnitStatus>;
27
- editingUnit(unitID: string): void;
28
- disposeUnit(unitID: string): void;
29
- private _init;
30
- private _handleEvent;
31
- private _handleJoinEvent;
32
- private _scheduleClearOtherTimer;
33
- private _removeClearOtherTimer;
34
- private _handleLeaveEvent;
35
- private _handleHeartbeatEvent;
36
- private _send;
37
- private _scheduleHeartbeat;
38
- private _ensureSubject;
39
- }