@univerjs-pro/collaboration-client 0.2.7 → 0.2.8

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 (52) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +1 -1
  3. package/lib/types/controllers/collab-cursor/__tests__/doc-collab-cursor.controller.spec.d.ts +0 -1
  4. package/lib/types/controllers/collab-cursor/collab-cursor.controller.d.ts +0 -1
  5. package/lib/types/controllers/collab-cursor/doc-collab-cursor-entity.d.ts +0 -1
  6. package/lib/types/controllers/collab-cursor/doc-collab-cursor-render.controller.d.ts +0 -1
  7. package/lib/types/controllers/collab-cursor/serialize-text-ranges.d.ts +0 -1
  8. package/lib/types/controllers/collab-cursor/sheet-collab-cursor-entity.d.ts +0 -1
  9. package/lib/types/controllers/collab-cursor/sheet-collab-cursor-render.controller.d.ts +0 -1
  10. package/lib/types/controllers/collab-status/collab-status.controller.d.ts +0 -1
  11. package/lib/types/controllers/collaboration/__tests__/collaboration.controller.spec.d.ts +0 -1
  12. package/lib/types/controllers/collaboration/__tests__/mock-text-selection-render-manager.service.d.ts +0 -1
  13. package/lib/types/controllers/collaboration/__tests__/mocks.d.ts +0 -1
  14. package/lib/types/controllers/collaboration/collaboration-state.d.ts +0 -1
  15. package/lib/types/controllers/collaboration/collaboration.controller.d.ts +0 -1
  16. package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +0 -1
  17. package/lib/types/controllers/collaboration/utils/empty.d.ts +0 -1
  18. package/lib/types/controllers/data-loader/data-loader.controller.d.ts +0 -1
  19. package/lib/types/controllers/file-name/file-name.controller.d.ts +0 -1
  20. package/lib/types/locale/en-US.d.ts +0 -1
  21. package/lib/types/locale/ru-RU.d.ts +0 -1
  22. package/lib/types/locale/vi-VN.d.ts +0 -1
  23. package/lib/types/locale/zh-TW.d.ts +0 -1
  24. package/lib/types/models/cursor.d.ts +0 -1
  25. package/lib/types/plugin.d.ts +0 -1
  26. package/lib/types/services/auth-server/auth-server.service.d.ts +0 -1
  27. package/lib/types/services/auth-server/authz-io-http.service.d.ts +0 -1
  28. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +0 -1
  29. package/lib/types/services/color-assign/color-assign.service.d.ts +0 -1
  30. package/lib/types/services/comment/comment.service.d.ts +0 -1
  31. package/lib/types/services/image-remote/image-io.service.d.ts +0 -1
  32. package/lib/types/services/ime-cache-transform/doc-transform-ime-cache.service.d.ts +0 -1
  33. package/lib/types/services/local-cache/local-cache.service.d.ts +0 -1
  34. package/lib/types/services/member/member.service.d.ts +0 -1
  35. package/lib/types/services/permission/permission.service.d.ts +0 -1
  36. package/lib/types/services/range-selection/sheet-transform-selections.service.d.ts +0 -1
  37. package/lib/types/services/single-active-unit/single-active-unit.service.d.ts +0 -1
  38. package/lib/types/services/snapshot-server/snapshot-server.service.d.ts +0 -1
  39. package/lib/types/services/socket/collaboration-socket.service.d.ts +0 -1
  40. package/lib/types/services/socket/serialize.d.ts +0 -1
  41. package/lib/types/services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service.d.ts +0 -1
  42. package/lib/types/services/text-selection/doc-transform-selections.service.d.ts +0 -1
  43. package/lib/types/services/undoredo/collaborative-undoredo.service.d.ts +0 -1
  44. package/lib/types/services/url/url.service.d.ts +0 -1
  45. package/lib/types/services/url/web-url.service.d.ts +0 -1
  46. package/lib/types/views/components/CollabStatus.d.ts +0 -1
  47. package/lib/types/views/components/CollabStatus.stories.d.ts +0 -1
  48. package/lib/types/views/shapes/doc-collab-cursor.d.ts +0 -1
  49. package/lib/types/views/shapes/sheet-collab-cursor.shape.d.ts +0 -1
  50. package/lib/types/views/shapes/text-bubble.shape.d.ts +0 -1
  51. package/lib/umd/index.js +1 -1
  52. package/package.json +27 -27
@@ -1,7 +1,6 @@
1
1
  import { DocumentDataModel, Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
2
  import { Nullable } from 'vitest';
3
3
  import { DocumentViewModel, IRenderManagerService, DocumentSkeleton, IRender, IRenderContext, IRenderModule } from '@univerjs/engine-render';
4
-
5
4
  export declare class MockRenderManagerService implements Pick<IRenderManagerService, 'getRenderById'> {
6
5
  private readonly _injector;
7
6
  constructor(_injector: Injector);
@@ -2,7 +2,6 @@ import { Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IDocCollabCursor, ISheetCollabCursor } from '../../models/cursor';
4
4
  import { CollaborationSessionService } from '../../services/collaboration-session/collaboration-session.service';
5
-
6
5
  /**
7
6
  * This controller adds collaboration cursors to Univer. It works with `CollabCursorRenderController`.
8
7
  *
@@ -5,7 +5,6 @@ import { CollaborationSession } from '../../services/collaboration-session/colla
5
5
  import { ColorAssignService } from '../../services/color-assign/color-assign.service';
6
6
  import { MemberService } from '../../services/member/member.service';
7
7
  import { DocSyncEditingCollabCursorService } from '../../services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service';
8
-
9
8
  /**
10
9
  * Each univer document instance would map to an `CollabCursorEntity` to handle collaborated editing events.
11
10
  */
@@ -2,7 +2,6 @@ import { DocumentDataModel, ICommandService, RxDisposable, ThemeService } from '
2
2
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { DocSkeletonManagerService } from '@univerjs/docs';
4
4
  import { CollabCursorController } from './collab-cursor.controller';
5
-
6
5
  /**
7
6
  * This controller works with `CollabCursorController` to render doc collaboration cursors.
8
7
  */
@@ -1,4 +1,3 @@
1
1
  import { ITextRangeWithStyle } from '@univerjs/engine-render';
2
-
3
2
  export declare function serializeDocTextRanges(ranges: ITextRangeWithStyle[]): string;
4
3
  export declare function deserializeDocTextRanges(serializedTextRanges: string): ITextRangeWithStyle[];
@@ -5,7 +5,6 @@ import { ISheetCollabCursor } from '../../models/cursor';
5
5
  import { CollaborationSession } from '../../services/collaboration-session/collaboration-session.service';
6
6
  import { ColorAssignService } from '../../services/color-assign/color-assign.service';
7
7
  import { MemberService } from '../../services/member/member.service';
8
-
9
8
  /**
10
9
  * Each univer document instance would map to an `CollabCursorEntity` to handle collaborated editing events.
11
10
  */
@@ -2,7 +2,6 @@ import { Workbook, RxDisposable, ThemeService } from '@univerjs/core';
2
2
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
4
4
  import { CollabCursorController } from './collab-cursor.controller';
5
-
6
5
  /**
7
6
  * This controller works with `CollabCursorController` to render sheet collaboration cursors.
8
7
  */
@@ -3,7 +3,6 @@ import { IUIPartsService } from '@univerjs/ui';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { CollaborationController } from '../collaboration/collaboration.controller';
5
5
  import { CollaborationStatus } from '../collaboration/collaboration-state';
6
-
7
6
  /**
8
7
  * This controller is responsible for monitoring the collaboration status of the currently focused unit.
9
8
  */
@@ -1,5 +1,4 @@
1
1
  import { IWorkbookData } from '@univerjs/core';
2
-
3
2
  export declare const TEST_UNIT_ID = "test";
4
3
  export declare const ANOTHER_TEST_UNIT_ID = "test2";
5
4
  export declare function getTestSheetData(id?: string): IWorkbookData;
@@ -1,6 +1,5 @@
1
1
  import { Nullable } from '@univerjs/core';
2
2
  import { ITextSelectionInnerParam } from '@univerjs/engine-render';
3
-
4
3
  export declare class TextSelectionRenderManager {
5
4
  private readonly _textSelectionInner$;
6
5
  readonly textSelectionInner$: import('rxjs').Observable<Nullable<ITextSelectionInnerParam>>;
@@ -4,7 +4,6 @@ import { IBeforeCloseService, IMessageService, INotificationService } from '@uni
4
4
  import { ICombResponseEvent } from '@univerjs-pro/collaboration';
5
5
  import { Subject } from 'rxjs';
6
6
  import { ICollaborationSocket, ICollaborationSocketService } from '../../../services/socket/collaboration-socket.service';
7
-
8
7
  /**
9
8
  * The handler object for a mocked socket connection. You can terminate, send messages / error through this object.
10
9
  */
@@ -6,7 +6,6 @@ import { LocalCacheService } from '../../services/local-cache/local-cache.servic
6
6
  import { MemberService } from '../../services/member/member.service';
7
7
  import { ICollaborativeUndoRedoService } from '../../services/undoredo/collaborative-undoredo.service';
8
8
  import { ICollabEditingCursor } from '../../services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service';
9
-
10
9
  /** Provide both states when and after changing, so the parent could examine if state transition is correct. */
11
10
  export type StateChangeHandler = (before: CollaborationState, after: CollaborationState) => void;
12
11
  /** A network interface to send changeset and */
@@ -12,7 +12,6 @@ import { DocTransformSelectionsService } from '../../services/text-selection/doc
12
12
  import { DocSyncEditingCollabCursorService } from '../../services/sync-editing-collab-cursor/doc-sync-editing-collab-cursor.service';
13
13
  import { SheetTransformSelectionsService } from '../../services/range-selection/sheet-transform-selections.service';
14
14
  import { CollaborationState, ICollaborationStateHandler, CollaborationStatus } from './collaboration-state';
15
-
16
15
  export declare class CollaborationController extends RxDisposable {
17
16
  private readonly _injector;
18
17
  private readonly _collabSessionService;
@@ -1,7 +1,6 @@
1
1
  import { IMutationInfo, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IChangeset, RevisionService } from '@univerjs-pro/collaboration';
3
3
  import { MemberService } from '../../../services/member/member.service';
4
-
5
4
  export interface IAssembledChangeset {
6
5
  changeset: IChangeset;
7
6
  pendingMutations: IMutationInfo[];
@@ -1,3 +1,2 @@
1
1
  import { IMutationInfo } from '@univerjs/core';
2
-
3
2
  export declare const EmptyMutationInfo: IMutationInfo;
@@ -3,7 +3,6 @@ import { IRemoteInstanceService } from '@univerjs/rpc';
3
3
  import { SnapshotService } from '@univerjs-pro/collaboration';
4
4
  import { LocalCacheService } from '../../services/local-cache/local-cache.service';
5
5
  import { IURLService } from '../../services/url/url.service';
6
-
7
6
  /**
8
7
  * This controller loads data when URL changes.
9
8
  */
@@ -1,5 +1,4 @@
1
1
  import { Disposable, IConfigService, IUniverInstanceService } from '@univerjs/core';
2
-
3
2
  export declare const DEFAULT_FILE_NAME_KEY = "DEFAULT_FILE_NAME";
4
3
  /**
5
4
  * This controller would change the current tab's title to the
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,4 +1,3 @@
1
1
  import { default as zhCN } from './zh-CN';
2
-
3
2
  declare const locale: typeof zhCN;
4
3
  export default locale;
@@ -1,6 +1,5 @@
1
1
  import { IRange } from '@univerjs/core';
2
2
  import { ITextRangeWithStyle } from '@univerjs/engine-render';
3
-
4
3
  /**
5
4
  * The data structure to store collab cursor info of sheet.
6
5
  */
@@ -1,7 +1,6 @@
1
1
  import { Ctor, DependencyOverride, ILogService, Injector, Plugin } from '@univerjs/core';
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ICollaborationSocketService } from './services/socket/collaboration-socket.service';
4
-
5
4
  export interface ICollaborationClientPluginConfig {
6
5
  socketService?: Ctor<ICollaborationSocketService>;
7
6
  enableOfflineEditing?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { IConfigService, LocaleService } from '@univerjs/core';
2
2
  import { HTTPService } from '@univerjs/network';
3
-
4
3
  export declare class AuthServerService {
5
4
  private readonly _configService;
6
5
  private readonly _httpService;
@@ -1,7 +1,6 @@
1
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
-
5
4
  /**
6
5
  * The config key to determined the URL provided by the author server.
7
6
  * The URL should not ends with a slash.
@@ -5,7 +5,6 @@ import { Observable } from 'rxjs';
5
5
  import { MemberService } from '../member/member.service';
6
6
  import { ICollaborationSocket, ICollaborationSocketService } from '../socket/collaboration-socket.service';
7
7
  import { CommentService } from '../comment/comment.service';
8
-
9
8
  export declare enum SessionStatus {
10
9
  IDLE = 0,
11
10
  JOINING = 1,
@@ -1,5 +1,4 @@
1
1
  import { Disposable } from '@univerjs/core';
2
-
3
2
  export declare const BACKGROUND_TOKENS: string[];
4
3
  /**
5
4
  * This service assign a color to each collaboration member.
@@ -1,5 +1,4 @@
1
1
  import { ICommentUpdate } from '@univerjs/protocol';
2
-
3
2
  export declare class CommentService {
4
3
  private readonly _commentUpdate$;
5
4
  readonly commentUpdate$: import('rxjs').Observable<ICommentUpdate>;
@@ -3,7 +3,6 @@ import { IImageIoService, IImageIoServiceParam, ImageSourceType } from '@univerj
3
3
  import { HTTPService } from '@univerjs/network';
4
4
  import { IError } from '@univerjs/protocol';
5
5
  import { Observable } from 'rxjs';
6
-
7
6
  export declare const ALLOW_IMAGE_LIST: string[];
8
7
  export declare const EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY = "EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY";
9
8
  export declare const EXCHANGE_SIGN_URL_SERVER_URL_KEY = "EXCHANGE_SIGN_URL_SERVER_URL_KEY";
@@ -1,6 +1,5 @@
1
1
  import { ITransformService, IChangeset } from '@univerjs-pro/collaboration';
2
2
  import { Injector } from '@univerjs/core';
3
-
4
3
  export declare class DocTransformIMECacheService {
5
4
  private readonly _injector;
6
5
  private readonly _transformService;
@@ -2,7 +2,6 @@ import { IMutationInfo, Nullable, Disposable, IConfigService, ILocalStorageServi
2
2
  import { IBeforeCloseService } from '@univerjs/ui';
3
3
  import { IChangeset, RevisionService } from '@univerjs-pro/collaboration';
4
4
  import { UniverType } from '@univerjs/protocol';
5
-
6
5
  export interface IUnitCacheData {
7
6
  unitID: string;
8
7
  type: UniverType;
@@ -1,6 +1,5 @@
1
1
  import { Nullable, Disposable, IUniverInstanceService, UserManagerService } from '@univerjs/core';
2
2
  import { IMember } from '@univerjs/protocol';
3
-
4
3
  export interface IUser extends IMember {
5
4
  userID: string;
6
5
  }
@@ -1,6 +1,5 @@
1
1
  import { Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
2
2
  import { CollaborationSessionService } from '../collaboration-session/collaboration-session.service';
3
-
4
3
  export declare class PermissionService extends RxDisposable {
5
4
  private _injector;
6
5
  private _univerInstanceService;
@@ -1,6 +1,5 @@
1
1
  import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
2
2
  import { Injector } from '@univerjs/core';
3
-
4
3
  export declare function extractTargetFromFirstChangeset(changeset: IChangeset): {
5
4
  unitId: string;
6
5
  subUnitId: string;
@@ -1,6 +1,5 @@
1
1
  import { Disposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
-
4
3
  /**
5
4
  * It is not recommended to open multiple units in different browser tabs at the same time,
6
5
  * especially when the there is not access to the internet. There is a great chance of loosing
@@ -1,7 +1,6 @@
1
1
  import { ILogContext, ISnapshotServerService, IConfigService } from '@univerjs/core';
2
2
  import { HTTPService } from '@univerjs/network';
3
3
  import { IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, ISaveChangesetResponse, ISaveSheetBlockResponse, ISaveSnapshotResponse } from '@univerjs/protocol';
4
-
5
4
  export declare class SnapshotServerOverHTTPService implements ISnapshotServerService {
6
5
  private readonly _configService;
7
6
  private readonly _httpService;
@@ -3,7 +3,6 @@ import { ISocket, HTTPService, WebSocketService } from '@univerjs/network';
3
3
  import { ICombRequestEvent, ICombResponseEvent, IFetchingMissEvent, ISubmitChangesetEvent } from '@univerjs-pro/collaboration';
4
4
  import { IChangeset } from '@univerjs/protocol';
5
5
  import { Observable } from 'rxjs';
6
-
7
6
  export interface ICollaborationSocket extends Pick<ISocket, 'open$' | 'error$' | 'close$'> {
8
7
  memberID: string;
9
8
  message$: Observable<ICombResponseEvent>;
@@ -1,4 +1,3 @@
1
1
  import { ICombRequestEvent, ICombResponseEvent } from '@univerjs-pro/collaboration';
2
-
3
2
  export declare function deserializeToCombResponse(event: MessageEvent): ICombResponseEvent;
4
3
  export declare function serializeCombRequest(event: ICombRequestEvent): string;
@@ -1,7 +1,6 @@
1
1
  import { IUpdateCursor } from '@univerjs/protocol';
2
2
  import { Nullable, RxDisposable } from '@univerjs/core';
3
3
  import { ITextRangeWithStyle } from '@univerjs/engine-render';
4
-
5
4
  export interface ICollabEditingCursor {
6
5
  unitID: string;
7
6
  memberID: string;
@@ -1,6 +1,5 @@
1
1
  import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
2
2
  import { Injector } from '@univerjs/core';
3
-
4
3
  export declare class DocTransformSelectionsService {
5
4
  private readonly _injector;
6
5
  private readonly _transformService;
@@ -1,6 +1,5 @@
1
1
  import { IUndoRedoService, ICommandService, IContextService, ILogService, IUniverInstanceService, LocalUndoRedoService } from '@univerjs/core';
2
2
  import { IChangeset, ITransformService } from '@univerjs-pro/collaboration';
3
-
4
3
  /**
5
4
  * `LocalUndoRedoService` cannot transform mutations in the undo redo stack under collaboration conditions.
6
5
  */
@@ -1,5 +1,4 @@
1
1
  import { Observable } from 'rxjs';
2
-
3
2
  /**
4
3
  * This service reads the url from the host platform and return url parts,
5
4
  * such as queries, hashes and path.
@@ -1,7 +1,6 @@
1
1
  import { RxDisposable } from '@univerjs/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { IURLService } from './url.service';
4
-
5
4
  export declare class WebURLService extends RxDisposable implements IURLService {
6
5
  readonly urlChange$: Observable<void>;
7
6
  constructor();
@@ -1,6 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { CollaborationStatus } from '../../controllers/collaboration/collaboration-state';
3
-
4
3
  export interface IOnlineStatusProps {
5
4
  /** The collaboration state of the currently focused unit. */
6
5
  status$: Observable<CollaborationStatus>;
@@ -1,7 +1,6 @@
1
1
  import { Meta } from '@storybook/react';
2
2
  import { default as React } from 'react';
3
3
  import { CollaborationStatusDisplay } from './CollabStatus';
4
-
5
4
  declare const meta: Meta<typeof CollaborationStatusDisplay>;
6
5
  export default meta;
7
6
  export declare const Playground: {
@@ -1,6 +1,5 @@
1
1
  import { Documents, DocumentSkeleton, Scene } from '@univerjs/engine-render';
2
2
  import { IDocCollabCursor } from '../../models/cursor';
3
-
4
3
  /**
5
4
  * Render a single collaborated cursor on the canvas.
6
5
  */
@@ -1,6 +1,5 @@
1
1
  import { IMouseEvent, IPointerEvent, IShapeProps, Shape } from '@univerjs/engine-render';
2
2
  import { ISheetCollabCursor } from '../../models/cursor';
3
-
4
3
  export declare const SHEET_COLLAB_CURSOR_ZINDEX = 1;
5
4
  export declare const SHEET_COLLAB_CURSOR_BORDER_WIDTH = 1.5;
6
5
  export interface ISheetCollabCursorShapeProps extends IShapeProps, ISheetCollabCursor {
@@ -1,5 +1,4 @@
1
1
  import { IShapeProps, UniverRenderingContext, Shape } from '@univerjs/engine-render';
2
-
3
2
  export declare const COLLAB_CURSOR_LABEL_HEIGHT = 20;
4
3
  export declare const COLLAB_CURSOR_LABEL_MAX_WIDTH = 200;
5
4
  export declare const COLLAB_CURSOR_LABEL_TEXT_PADDING_LR = 4;