@univerjs-pro/collaboration-client 0.25.1 → 1.0.0-alpha.1
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/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 +70 -0
- package/lib/types/controllers/collaboration/collaboration-entity.d.ts +15 -1
- package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +6 -14
- package/lib/types/facade/f-collaboration.d.ts +38 -25
- package/lib/types/index.d.ts +11 -7
- package/lib/types/locale/types.d.ts +3 -0
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/attachment-remote/attachment-io.service.d.ts +22 -0
- package/lib/types/services/attachment-remote/types.d.ts +23 -0
- package/lib/types/services/data-loader/data-loader.service.d.ts +3 -0
- package/lib/types/services/local-cache/local-cache.service.d.ts +1 -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 +16 -14
- package/lib/types/controllers/config.schema.d.ts +0 -64
|
@@ -1,3 +1,73 @@
|
|
|
1
|
+
import type { Ctor, DependencyOverride } from '@univerjs/core';
|
|
2
|
+
import type { IAttachmentUploadOptions } from '../services/attachment-remote/types';
|
|
3
|
+
import type { ICollaborationSocketService } from '../services/socket/collaboration-socket.service';
|
|
4
|
+
export declare const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY = "collaboration-client.config";
|
|
5
|
+
export declare const configSymbol: unique symbol;
|
|
6
|
+
export interface IUniverCollaborationClientConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Which socket should the plugin use to build connections to the collaborative engine.
|
|
9
|
+
* For normal cases, you should use `BrowserCollaborationSocketService` from the `collaboration-client-ui` plugin.
|
|
10
|
+
*/
|
|
11
|
+
socketService: Ctor<ICollaborationSocketService>;
|
|
12
|
+
/**
|
|
13
|
+
* If the plugin should enable collaborative editing. Which means the client will exchange edits with
|
|
14
|
+
* the collaboration server. It this is set to false, the client will simply load data from the server.
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
enableCollaboration?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If offline editing is enabled.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
enableOfflineEditing?: boolean;
|
|
24
|
+
enableSingleActiveInstanceLock?: boolean;
|
|
25
|
+
enableAuthServer?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Override internal modules with custom implementations.
|
|
28
|
+
*/
|
|
29
|
+
override?: DependencyOverride;
|
|
30
|
+
sendChangesetTimeout?: number;
|
|
31
|
+
snapshotServerUrl?: string;
|
|
32
|
+
collabSubmitChangesetUrl?: string;
|
|
33
|
+
collabWebSocketUrl?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The URL of the endpoint for getting the websocket session ticket.
|
|
36
|
+
*/
|
|
37
|
+
wsSessionTicketUrl?: string;
|
|
38
|
+
loginUrlKey?: string;
|
|
39
|
+
retryConnectingInterval?: number;
|
|
40
|
+
authzUrl?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The URL of the endpoint for downloading files.
|
|
43
|
+
* @default 'location.origin'
|
|
44
|
+
*/
|
|
45
|
+
downloadEndpointUrl?: string;
|
|
46
|
+
uploadFileServerUrl?: string;
|
|
47
|
+
signUrlServerUrl?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Shared attachment upload restrictions and optional custom uploader used by
|
|
50
|
+
* the collaboration attachment IO service.
|
|
51
|
+
*/
|
|
52
|
+
attachment?: IAttachmentUploadOptions;
|
|
53
|
+
/**
|
|
54
|
+
* The URL of the endpoint for starting formula limit.
|
|
55
|
+
*/
|
|
56
|
+
startFormulaLimitUrl?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The URL of the endpoint for getting formula limit status.
|
|
59
|
+
*/
|
|
60
|
+
getFormulaLimitStatusUrl?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The URL of the endpoint for releasing formula limit.
|
|
63
|
+
*/
|
|
64
|
+
releaseFormulaLimitUrl?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The socket connection custom headers.
|
|
67
|
+
*/
|
|
68
|
+
customHeaders?: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
export declare const defaultPluginConfig: Omit<IUniverCollaborationClientConfig, 'socketService'>;
|
|
1
71
|
/**
|
|
2
72
|
* Default value for `SNAPSHOT_SERVER_URL_KEY`.
|
|
3
73
|
*
|
|
@@ -4,6 +4,7 @@ import type { CollaborationSession } from '../../services/collaboration-session/
|
|
|
4
4
|
import type { CollaborationState, ICollaborationStateHandler, SyncEditingCollabCursorHandler, TransformIMEHandler, TransformRemoteChangesetByIMECache, TransformRemoteChangesetByStateCache, TransformSelectionsHandler, TransformStateHandler } from './collaboration-state';
|
|
5
5
|
import { CompressMutationService, RevisionService } from '@univerjs-pro/collaboration';
|
|
6
6
|
import { ICommandService, ILogService, Injector, IPermissionService, IUniverInstanceService, LocaleService, RxDisposable } from '@univerjs/core';
|
|
7
|
+
import { DocStateChangeManagerService } from '@univerjs/docs';
|
|
7
8
|
import { BehaviorSubject } from 'rxjs';
|
|
8
9
|
import { CollaborationUIEventService } from '../../services/collaboration-ui-event/collaboration-ui-event';
|
|
9
10
|
import { ILocalCacheService } from '../../services/local-cache/local-cache.service';
|
|
@@ -79,13 +80,20 @@ export interface IDocCollaborationEntityCallback {
|
|
|
79
80
|
export declare class DocCollaborationEntity extends CollaborationEntity {
|
|
80
81
|
readonly unitID: string;
|
|
81
82
|
readonly type: UniverInstanceType;
|
|
83
|
+
private readonly _docStateChangeManagerService?;
|
|
82
84
|
private _handlerCallback;
|
|
83
|
-
constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
|
|
85
|
+
constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, _docStateChangeManagerService?: DocStateChangeManagerService | undefined, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
|
|
84
86
|
addHandlerCallback(cb: IDocCollaborationEntityCallback): void;
|
|
85
87
|
dispose(): void;
|
|
86
88
|
protected _createHandler(): ICollaborationStateHandler;
|
|
87
89
|
protected _init(): Promise<CollaborationState>;
|
|
88
90
|
}
|
|
91
|
+
export declare class BaseCollaborationEntity extends CollaborationEntity {
|
|
92
|
+
readonly unitID: string;
|
|
93
|
+
readonly type: UniverInstanceType;
|
|
94
|
+
constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
|
|
95
|
+
protected _init(): Promise<CollaborationState>;
|
|
96
|
+
}
|
|
89
97
|
export declare class SheetCollaborationEntity extends CollaborationEntity {
|
|
90
98
|
readonly unitID: string;
|
|
91
99
|
readonly type: UniverInstanceType;
|
|
@@ -94,3 +102,9 @@ export declare class SheetCollaborationEntity extends CollaborationEntity {
|
|
|
94
102
|
protected _createHandler(): ICollaborationStateHandler;
|
|
95
103
|
protected _init(): Promise<CollaborationState>;
|
|
96
104
|
}
|
|
105
|
+
export declare class SlideCollaborationEntity extends CollaborationEntity {
|
|
106
|
+
readonly unitID: string;
|
|
107
|
+
readonly type: UniverInstanceType;
|
|
108
|
+
constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
|
|
109
|
+
protected _init(): Promise<CollaborationState>;
|
|
110
|
+
}
|
|
@@ -15,19 +15,11 @@ export declare function isSplitChunkMutation(mutation: IMutationInfo): boolean;
|
|
|
15
15
|
* Mutations those should be assembled into a single changeset.
|
|
16
16
|
*/
|
|
17
17
|
export declare const SINGLE_CHANGESET_MUTATIONS: Set<string>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @param pendingMutations - The list of pending mutations to assemble
|
|
25
|
-
* @param unitID - The unit ID
|
|
26
|
-
* @param univerInstanceService - The universe instance service
|
|
27
|
-
* @param revisionService - The revision service
|
|
28
|
-
* @param memberService - The member service
|
|
29
|
-
* @returns The assembled changeset and remaining pending mutations
|
|
30
|
-
*/
|
|
31
|
-
export declare function assembleSheetChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
|
18
|
+
export declare const SLIDE_SINGLE_CHANGESET_MUTATIONS: Set<string>;
|
|
19
|
+
export declare function takeMutationsForChangeset(pendingMutations: IMutationInfo[], singleChangesetMutations?: Set<string>): IMutationInfo[];
|
|
20
|
+
export declare function assembleMutationChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
|
21
|
+
export declare const assembleSheetChangeset: typeof assembleMutationChangeset;
|
|
22
|
+
export declare function assembleBaseChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
|
23
|
+
export declare function assembleSlideChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
|
32
24
|
export declare function assembleDocChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
|
|
33
25
|
export declare function createTimerObservable$<T>(ms: number, options: T): Observable<T>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { FBase as FBaseFacade } from '@univerjs-pro/bases/facade';
|
|
1
2
|
import type { ILogContext } from '@univerjs-pro/collaboration';
|
|
3
|
+
import type { FPresentation } from '@univerjs-pro/slides/facade';
|
|
2
4
|
import type { IDisposable } from '@univerjs/core';
|
|
5
|
+
import type { FDocument } from '@univerjs/docs/facade';
|
|
3
6
|
import type { IMember } from '@univerjs/protocol';
|
|
4
7
|
import type { FWorkbook } from '@univerjs/sheets/facade';
|
|
5
8
|
import { SnapshotService } from '@univerjs-pro/collaboration';
|
|
@@ -18,49 +21,59 @@ export declare class FCollaboration extends FBase {
|
|
|
18
21
|
protected readonly _snapshotService: SnapshotService;
|
|
19
22
|
protected readonly _collaborationController: CollaborationController;
|
|
20
23
|
constructor(_handler: {
|
|
21
|
-
|
|
24
|
+
getWorkbook: (id: string) => FWorkbook | null;
|
|
25
|
+
getDocument: (id: string) => FDocument | null;
|
|
26
|
+
getPresentation: (id: string) => FPresentation | null;
|
|
27
|
+
getBase: (id: string) => FBaseFacade | null;
|
|
22
28
|
}, _injector: Injector, _univerInstanceService: IUniverInstanceService, _snapshotService: SnapshotService, _collaborationController: CollaborationController);
|
|
23
29
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @
|
|
30
|
+
* Load a Univer Sheet from the server with a unit ID.
|
|
31
|
+
* @param {string} unitId ID of the Univer Sheet that you would like to load.
|
|
32
|
+
* @param {ILogContext} [context] Optional context.
|
|
33
|
+
* @returns {Promise<FWorkbook | null>} The {@link FWorkbook} or null if ID cannot be associated with a Univer Sheet.
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const collaboration = univerAPI.getCollaboration();
|
|
37
|
+
* const workbook = await collaboration.loadSheetAsync('your-unit-id');
|
|
38
|
+
* ```
|
|
27
39
|
*/
|
|
28
|
-
|
|
40
|
+
loadSheetAsync(unitId: string, context?: ILogContext): Promise<FWorkbook | null>;
|
|
29
41
|
/**
|
|
30
|
-
* Load
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
34
|
-
*
|
|
42
|
+
* Load a Univer Document from the server with a unit ID.
|
|
43
|
+
* @param {string} unitId ID of the Univer Document that you would like to load.
|
|
44
|
+
* @param {ILogContext} [context] Optional context.
|
|
45
|
+
* @returns {Promise<FDocument | null>} The {@link FDocument} or null if ID cannot be associated with a Univer Document.
|
|
35
46
|
* @example
|
|
36
47
|
* ```typescript
|
|
37
48
|
* const collaboration = univerAPI.getCollaboration();
|
|
38
|
-
* const
|
|
49
|
+
* const document = await collaboration.loadDocAsync('your-unit-id');
|
|
39
50
|
* ```
|
|
40
51
|
*/
|
|
41
|
-
|
|
52
|
+
loadDocAsync(unitId: string, context?: ILogContext): Promise<FDocument | null>;
|
|
42
53
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
54
|
+
* Load a Univer Base from the server with a unit ID.
|
|
55
|
+
* @param {string} unitId ID of the Univer Base that you would like to load.
|
|
56
|
+
* @param {ILogContext} [context] Optional context.
|
|
57
|
+
* @returns {Promise<FBaseFacade | null>} The Base facade or null if ID cannot be associated with a Univer Base.
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const collaboration = univerAPI.getCollaboration();
|
|
61
|
+
* const base = await collaboration.loadBaseAsync('your-unit-id');
|
|
62
|
+
* ```
|
|
47
63
|
*/
|
|
48
|
-
|
|
64
|
+
loadBaseAsync(unitId: string, context?: ILogContext): Promise<FBaseFacade | null>;
|
|
49
65
|
/**
|
|
50
|
-
* Load a Univer
|
|
51
|
-
*
|
|
52
|
-
* @param {string} unitId ID of the Univer Sheet that you would like to load.
|
|
66
|
+
* Load a Univer Slide from the server with a unit ID.
|
|
67
|
+
* @param {string} unitId ID of the Univer Slide that you would like to load.
|
|
53
68
|
* @param {ILogContext} [context] Optional context.
|
|
54
|
-
*
|
|
55
|
-
* @returns {Promise<FWorkbook | null>} The {@link FWorkbook} or null if ID cannot be associated with a Univer Sheet.
|
|
56
|
-
*
|
|
69
|
+
* @returns {Promise<FPresentation | null>} The {@link FPresentation} or null if ID cannot be associated with a Univer Slide.
|
|
57
70
|
* @example
|
|
58
71
|
* ```typescript
|
|
59
72
|
* const collaboration = univerAPI.getCollaboration();
|
|
60
|
-
* const
|
|
73
|
+
* const presentation = await collaboration.loadSlideAsync('your-unit-id');
|
|
61
74
|
* ```
|
|
62
75
|
*/
|
|
63
|
-
|
|
76
|
+
loadSlideAsync(unitId: string, context?: ILogContext): Promise<FPresentation | null>;
|
|
64
77
|
/**
|
|
65
78
|
* Subscribe collaborators of a Univer file.
|
|
66
79
|
*
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
export { DEFAULT_WS_SESSION_TICKET_URL, HEARTBEAT_INTERVAL_KEY, HEARTBEAT_TIMEOUT_KEY, LOCAL_CACHE_INTERVAL, LOCAL_CACHE_INTERVAL_KEY, RETRY_CONNECTING_MAX_COUNT_KEY, } from './config/config';
|
|
2
|
-
export { DEFAULT_COLLAB_WEB_SOCKET_URL, DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT, REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY } from './config/config';
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
2
|
+
export { DEFAULT_COLLAB_WEB_SOCKET_URL, DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT, REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY, } from './config/config';
|
|
3
|
+
export type { IUniverCollaborationClientConfig } from './config/config';
|
|
4
|
+
export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY } from './config/config';
|
|
5
|
+
export { CollaborationEntity, DocCollaborationEntity, SheetCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
|
|
6
|
+
export type { IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
|
|
7
|
+
export { AwaitingState, AwaitingWithPendingState, CollaborationStatus, ConflictState, FetchingMissState, OfflineState, PendingState, SyncedState, } from './controllers/collaboration/collaboration-state';
|
|
5
8
|
export { CollaborationController } from './controllers/collaboration/collaboration.controller';
|
|
6
|
-
export type { IUniverCollaborationClientConfig } from './controllers/config.schema';
|
|
7
|
-
export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY } from './controllers/config.schema';
|
|
8
9
|
export { UniverCollaborationClientPlugin } from './plugin';
|
|
10
|
+
export { AttachmentSourceType, CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
|
|
11
|
+
export type { AttachmentValue, IAttachmentIoService as IAttachmentIoServiceType, IAttachmentUploadOptions, IAttachmentValue, } from './services/attachment-remote/attachment-io.service';
|
|
9
12
|
export { AuthzIoHttpService } from './services/auth-server/authz-io-http.service';
|
|
10
13
|
export { CollaborationSession, SessionStatus } from './services/collaboration-session/collaboration-session';
|
|
11
14
|
export { CollaborationSessionService } from './services/collaboration-session/collaboration-session.service';
|
|
12
|
-
export { CollaborationUIEventId, CollaborationUIEventService } from './services/collaboration-ui-event/collaboration-ui-event';
|
|
15
|
+
export { CollaborationUIEventId, CollaborationUIEventService, } from './services/collaboration-ui-event/collaboration-ui-event';
|
|
13
16
|
export { CommentService } from './services/comment/comment.service';
|
|
14
17
|
export { DataLoaderService } from './services/data-loader/data-loader.service';
|
|
15
18
|
export { CollaborationImageIoService } from './services/image-remote/image-io.service';
|
|
16
|
-
export { getLocalCacheKey, ILocalCacheService
|
|
19
|
+
export { getLocalCacheKey, ILocalCacheService } from './services/local-cache/local-cache.service';
|
|
20
|
+
export type { IUnitCacheData } from './services/local-cache/local-cache.service';
|
|
17
21
|
export { MemberService } from './services/member/member.service';
|
|
18
22
|
export { MentionIoHttpService } from './services/mention-server/mention-io-http.service';
|
|
19
23
|
export { INetworkConditionService } from './services/network-condition/network-condition.service';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IUniverCollaborationClientConfig } from './
|
|
1
|
+
import type { IUniverCollaborationClientConfig } from './config/config';
|
|
2
2
|
import { IConfigService, ILogService, Injector, Plugin } from '@univerjs/core';
|
|
3
3
|
export declare class UniverCollaborationClientPlugin extends Plugin {
|
|
4
4
|
private readonly _config;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue } from './types';
|
|
2
|
+
import { IConfigService, IUniverInstanceService } from '@univerjs/core';
|
|
3
|
+
import { HTTPService } from '@univerjs/network';
|
|
4
|
+
import { AttachmentSourceType } from './types';
|
|
5
|
+
export { AttachmentSourceType };
|
|
6
|
+
export type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue };
|
|
7
|
+
export interface IAttachmentIoService {
|
|
8
|
+
getUploadOptions(): IAttachmentUploadOptions;
|
|
9
|
+
saveAttachment(file: File): Promise<IAttachmentValue>;
|
|
10
|
+
}
|
|
11
|
+
export declare const IAttachmentIoService: import("@wendellhu/redi").IdentifierDecorator<IAttachmentIoService>;
|
|
12
|
+
export declare class CollaborationAttachmentIoService implements IAttachmentIoService {
|
|
13
|
+
private readonly _httpService;
|
|
14
|
+
private readonly _configService;
|
|
15
|
+
private readonly _univerInstanceService;
|
|
16
|
+
constructor(_httpService: HTTPService, _configService: IConfigService, _univerInstanceService: IUniverInstanceService);
|
|
17
|
+
getUploadOptions(): IAttachmentUploadOptions;
|
|
18
|
+
saveAttachment(file: File): Promise<IAttachmentValue>;
|
|
19
|
+
private _upload;
|
|
20
|
+
private _getUploadFileURL;
|
|
21
|
+
private _getConfig;
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum AttachmentSourceType {
|
|
2
|
+
URL = "URL",
|
|
3
|
+
UUID = "UUID",
|
|
4
|
+
BASE64 = "BASE64"
|
|
5
|
+
}
|
|
6
|
+
export interface IAttachmentValue {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
mimeType?: string;
|
|
10
|
+
size?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
sourceType?: AttachmentSourceType;
|
|
14
|
+
source?: string;
|
|
15
|
+
base64?: string;
|
|
16
|
+
thumbnail?: string;
|
|
17
|
+
}
|
|
18
|
+
export type AttachmentValue = IAttachmentValue;
|
|
19
|
+
export interface IAttachmentUploadOptions {
|
|
20
|
+
accept?: string[];
|
|
21
|
+
maxSize?: number;
|
|
22
|
+
upload?: (file: File) => Promise<IAttachmentValue>;
|
|
23
|
+
}
|
|
@@ -15,8 +15,11 @@ export declare class DataLoaderService extends RxDisposable {
|
|
|
15
15
|
private readonly _snapshotService;
|
|
16
16
|
private readonly _localCacheService?;
|
|
17
17
|
private readonly _unitInfo$;
|
|
18
|
+
private readonly _unitLoaded$;
|
|
18
19
|
readonly unitInfo$: import("rxjs").Observable<IUnitInfo | null>;
|
|
20
|
+
readonly unitLoaded$: import("rxjs").Observable<UnitModel<object, UniverInstanceType>>;
|
|
19
21
|
constructor(_logService: ILogService, _snapshotService: SnapshotService, _localCacheService?: ILocalCacheService | undefined);
|
|
22
|
+
dispose(): void;
|
|
20
23
|
loadUnitOfRevision(unitId: string, type: UniverInstanceType, rev: number): Promise<UnitModel | null>;
|
|
21
24
|
loadUnit(unitId: string, type: UniverInstanceType, subUnitId?: string): Promise<UnitModel | null>;
|
|
22
25
|
}
|
|
@@ -10,6 +10,7 @@ export interface IUnitCacheData {
|
|
|
10
10
|
export interface ILocalCacheService {
|
|
11
11
|
loadOfflineData(unitID: string): Promise<Nullable<IUnitCacheData>>;
|
|
12
12
|
saveOfflineData(unitID: string, data: IUnitCacheData): Promise<boolean>;
|
|
13
|
+
backupOfflineData?(unitID: string, reason: string): Promise<void>;
|
|
13
14
|
updateOfflineData(unitID: string, type: UniverInstanceType, awaitingChangeset: Nullable<IChangeset>, pendingMutations: IMutationInfo[]): void;
|
|
14
15
|
disableLocalCache(): void;
|
|
15
16
|
enableLocalCache(): void;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x4322(_0x1d64c9,_0xa85045){_0x1d64c9=_0x1d64c9-0x1bb;const _0x3879e1=_0x3879();let _0x432296=_0x3879e1[_0x1d64c9];return _0x432296;}function _0x3879(){const _0x334e76=['CollaborationStatusChanged','FUniver','7gfrpiM','disposeWithMe','3971902CoQkJP','length','_handler','loadSlide','@univerjs/core/facade','decorate','add','_collaborationController','getCollaboration','defineProperty','FEventName','DataLoaderService','readyForCollab','877693tHCBnH','values','@univerjs/core','loadServerUnitOfRevision','Injector','toStringTag','registerEventHandler','entityInit$','_snapshotService','loadBaseAsync','FEnum','exports','loadUnitOfRevision','UniverProCollaborationClient','36IGCIcv','CollaborationController','UniverProCollaboration','973168TxITEy','toDisposable','getDocument','_injector','IUniverInstanceService','FCollaboration','pipe','1173096NKrbST','10YDSxUF','FBase','getFocusedUnit','CollaborationStatus','MemberService','object','loadSheet','getCollabEntity','2697955uaBdgN','subscribe','getWorkbook','state','loadBase','loadDocAsync','getPresentation','@univerjs-pro/collaboration','status$','function','18WXIyuR','switchMap','@univerjs-pro/collaboration-client','amd','948928IpHQyh','unitID','getUnitId','6939366asFhbS','Inject','createInstance','get','Event','DisposableCollection','loadDoc','_initialize','NOT_COLLAB','getOwnPropertyDescriptor','rxjs','extend','getBase'];_0x3879=function(){return _0x334e76;};return _0x3879();}(function(_0xd33a76,_0x59fe51){const _0x5f39f4=_0x4322,_0x482e71=_0xd33a76();while(!![]){try{const _0xafcf71=parseInt(_0x5f39f4(0x1c0))/0x1+-parseInt(_0x5f39f4(0x1d8))/0x2+parseInt(_0x5f39f4(0x1eb))/0x3*(parseInt(_0x5f39f4(0x1d1))/0x4)+-parseInt(_0x5f39f4(0x1e1))/0x5+-parseInt(_0x5f39f4(0x1f2))/0x6*(parseInt(_0x5f39f4(0x201))/0x7)+-parseInt(_0x5f39f4(0x1ef))/0x8*(-parseInt(_0x5f39f4(0x1ce))/0x9)+-parseInt(_0x5f39f4(0x1d9))/0xa*(-parseInt(_0x5f39f4(0x203))/0xb);if(_0xafcf71===_0x59fe51)break;else _0x482e71['push'](_0x482e71['shift']());}catch(_0x45c4e6){_0x482e71['push'](_0x482e71['shift']());}}}(_0x3879,0xd95b3),function(_0x3a1e6e,_0x1d5742){const _0x557fb1=_0x4322;typeof exports==_0x557fb1(0x1de)&&typeof module<'u'?_0x1d5742(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define==_0x557fb1(0x1ea)&&define[_0x557fb1(0x1ee)]?define([_0x557fb1(0x1cb),_0x557fb1(0x1ed),_0x557fb1(0x207),_0x557fb1(0x1c2),_0x557fb1(0x1e8),'rxjs'],_0x1d5742):(_0x3a1e6e=typeof globalThis<'u'?globalThis:_0x3a1e6e||self,_0x1d5742(_0x3a1e6e['UniverProCollaborationClientFacade']={},_0x3a1e6e[_0x557fb1(0x1cd)],_0x3a1e6e['UniverCoreFacade'],_0x3a1e6e['UniverCore'],_0x3a1e6e[_0x557fb1(0x1d0)],_0x3a1e6e[_0x557fb1(0x1fc)]));}(this,function(_0x35a544,_0x1ad98c,_0x131f9c,_0x80d3a0,_0x1a6ca0,_0x4d9d27){const _0x4c1a34=_0x4322;Object[_0x4c1a34(0x1bc)](_0x35a544,Symbol[_0x4c1a34(0x1c5)],{'value':'Module'});var _0x771dcd=class extends _0x131f9c[_0x4c1a34(0x1ca)]{get[_0x4c1a34(0x1dc)](){const _0x5e5025=_0x4c1a34;return _0x1ad98c[_0x5e5025(0x1dc)];}};_0x131f9c[_0x4c1a34(0x1ca)]['extend'](_0x771dcd);var _0x5213d3=class extends _0x131f9c[_0x4c1a34(0x1bd)]{get['CollaborationStatusChanged'](){const _0x5b53da=_0x4c1a34;return _0x5b53da(0x1ff);}};_0x131f9c[_0x4c1a34(0x1bd)][_0x4c1a34(0x1fd)](_0x5213d3);function _0x494468(_0x1d276a,_0x1f2d10){return function(_0x5a99b9,_0x3fee8a){_0x1f2d10(_0x5a99b9,_0x3fee8a,_0x1d276a);};}function _0x3abfd8(_0x10d3ad,_0x10065,_0x2b7495,_0x536fa6){const _0x35bc15=_0x4c1a34;var _0x17f015=arguments[_0x35bc15(0x204)],_0x297848=_0x17f015<0x3?_0x10065:_0x536fa6===null?_0x536fa6=Object[_0x35bc15(0x1fb)](_0x10065,_0x2b7495):_0x536fa6,_0x4de904;if(typeof Reflect=='object'&&typeof Reflect[_0x35bc15(0x208)]==_0x35bc15(0x1ea))_0x297848=Reflect[_0x35bc15(0x208)](_0x10d3ad,_0x10065,_0x2b7495,_0x536fa6);else{for(var _0x4d43fd=_0x10d3ad['length']-0x1;_0x4d43fd>=0x0;_0x4d43fd--)(_0x4de904=_0x10d3ad[_0x4d43fd])&&(_0x297848=(_0x17f015<0x3?_0x4de904(_0x297848):_0x17f015>0x3?_0x4de904(_0x10065,_0x2b7495,_0x297848):_0x4de904(_0x10065,_0x2b7495))||_0x297848);}return _0x17f015>0x3&&_0x297848&&Object[_0x35bc15(0x1bc)](_0x10065,_0x2b7495,_0x297848),_0x297848;}let _0x4eb2b5=class extends _0x131f9c[_0x4c1a34(0x1da)]{constructor(_0x542b71,_0x4772ac,_0x343266,_0x4fdbfd,_0x38e1bd){const _0x2a820b=_0x4c1a34;super(),this[_0x2a820b(0x205)]=_0x542b71,this[_0x2a820b(0x1d4)]=_0x4772ac,this['_univerInstanceService']=_0x343266,this[_0x2a820b(0x1c8)]=_0x4fdbfd,this[_0x2a820b(0x20a)]=_0x38e1bd;}async['loadSheetAsync'](_0x125406,_0x11eae5){const _0x14591f=_0x4c1a34;return await this[_0x14591f(0x1c8)][_0x14591f(0x1df)](_0x125406,0x0,_0x11eae5)?(await this['_collaborationController'][_0x14591f(0x1bf)](_0x125406),this[_0x14591f(0x205)][_0x14591f(0x1e3)](_0x125406)):null;}async[_0x4c1a34(0x1e6)](_0x2c5cb3,_0x401f68){const _0x1f4807=_0x4c1a34;return await this['_snapshotService'][_0x1f4807(0x1f8)](_0x2c5cb3,0x0,_0x401f68)?(await this[_0x1f4807(0x20a)][_0x1f4807(0x1bf)](_0x2c5cb3),this[_0x1f4807(0x205)]['getDocument'](_0x2c5cb3)):null;}async[_0x4c1a34(0x1c9)](_0x55c7f8,_0x5d71b1){const _0x220ef7=_0x4c1a34;return await this[_0x220ef7(0x1c8)][_0x220ef7(0x1e5)](_0x55c7f8,0x0,_0x5d71b1)?(await this[_0x220ef7(0x20a)]['readyForCollab'](_0x55c7f8),this[_0x220ef7(0x205)]['getBase'](_0x55c7f8)):null;}async['loadSlideAsync'](_0x48c220,_0x2e3cdd){const _0x253c6d=_0x4c1a34;return await this['_snapshotService'][_0x253c6d(0x206)](_0x48c220,0x0,_0x2e3cdd)?(await this[_0x253c6d(0x20a)]['readyForCollab'](_0x48c220),this[_0x253c6d(0x205)][_0x253c6d(0x1e7)](_0x48c220)):null;}['subscribeCollaborators'](_0x179493,_0x5c1d53){const _0x2490e4=_0x4c1a34;return(0x0,_0x80d3a0[_0x2490e4(0x1d2)])(this[_0x2490e4(0x1d4)][_0x2490e4(0x1f5)](_0x1ad98c[_0x2490e4(0x1dd)])['waitForRoom$'](_0x179493)[_0x2490e4(0x1d7)]((0x0,_0x4d9d27[_0x2490e4(0x1ec)])(_0x36d168=>_0x36d168['members$']))[_0x2490e4(0x1e2)](_0x2731ef=>_0x5c1d53(Array['from'](_0x2731ef[_0x2490e4(0x1c1)]()))));}['getCollaborationStatus'](_0x44ad64){const _0x24ef74=_0x4c1a34;var _0xb1ec65;let _0x427fa0;if(_0x44ad64)_0x427fa0=_0x44ad64;else{let _0x4fce71=this['_univerInstanceService'][_0x24ef74(0x1db)]();_0x427fa0=_0x4fce71==null?void 0x0:_0x4fce71[_0x24ef74(0x1f1)]();}if(!_0x427fa0)return _0x1ad98c[_0x24ef74(0x1dc)]['NOT_COLLAB'];let _0x421dfe=this[_0x24ef74(0x20a)][_0x24ef74(0x1e0)](_0x427fa0);return(_0xb1ec65=_0x421dfe==null?void 0x0:_0x421dfe[_0x24ef74(0x1e4)]['status'])==null?_0x1ad98c[_0x24ef74(0x1dc)][_0x24ef74(0x1fa)]:_0xb1ec65;}};_0x4eb2b5=_0x3abfd8([_0x494468(0x1,(0x0,_0x80d3a0[_0x4c1a34(0x1f3)])(_0x80d3a0[_0x4c1a34(0x1c4)])),_0x494468(0x2,_0x80d3a0[_0x4c1a34(0x1d5)]),_0x494468(0x3,(0x0,_0x80d3a0['Inject'])(_0x1a6ca0['SnapshotService'])),_0x494468(0x4,(0x0,_0x80d3a0[_0x4c1a34(0x1f3)])(_0x1ad98c[_0x4c1a34(0x1cf)]))],_0x4eb2b5);var _0x193672=class extends _0x131f9c[_0x4c1a34(0x200)]{[_0x4c1a34(0x1f9)](_0x55789a){const _0x24de41=_0x4c1a34;let _0x510a2f=_0x55789a[_0x24de41(0x1f5)](_0x1ad98c[_0x24de41(0x1cf)]);this[_0x24de41(0x202)](this[_0x24de41(0x1c6)](this[_0x24de41(0x1f6)]['CollaborationStatusChanged'],()=>{const _0x490391=_0x24de41;let _0xfb34d6=new _0x80d3a0[(_0x490391(0x1f7))](),_0x2f228c=_0x510a2f[_0x490391(0x1c7)]['subscribe'](_0x50737f=>{const _0x2c07cc=_0x490391;let _0x28a30b=_0x50737f[_0x2c07cc(0x1e9)][_0x2c07cc(0x1e2)](_0x1336cb=>{const _0x1e0542=_0x2c07cc;let _0x166f14={'unitId':_0x50737f[_0x1e0542(0x1f0)],'status':_0x1336cb};this['fireEvent'](this[_0x1e0542(0x1f6)][_0x1e0542(0x1ff)],_0x166f14);});_0xfb34d6[_0x2c07cc(0x209)]((0x0,_0x80d3a0[_0x2c07cc(0x1d2)])(_0x28a30b));});return _0xfb34d6[_0x490391(0x209)]((0x0,_0x80d3a0[_0x490391(0x1d2)])(_0x2f228c)),_0xfb34d6;}));}[_0x4c1a34(0x1bb)](){const _0x119bf1=_0x4c1a34;return this[_0x119bf1(0x1d4)][_0x119bf1(0x1f4)](_0x4eb2b5,{'getWorkbook':_0x4c8241=>this['getWorkbook'](_0x4c8241),'getDocument':_0x497a3a=>this[_0x119bf1(0x1d3)](_0x497a3a),'getPresentation':_0x5af403=>this['getPresentation'](_0x5af403),'getBase':_0x1f962c=>this[_0x119bf1(0x1fe)](_0x1f962c)});}['loadServerUnit'](_0x14f5d3,_0xb52ab,_0x268edf){const _0x901334=_0x4c1a34;return this[_0x901334(0x1d4)][_0x901334(0x1f5)](_0x1ad98c[_0x901334(0x1be)])['loadUnit'](_0x14f5d3,_0xb52ab,_0x268edf);}[_0x4c1a34(0x1c3)](_0x3825b9,_0x354efa,_0x3a42fd){const _0x4777bd=_0x4c1a34;return this['_injector'][_0x4777bd(0x1f5)](_0x1ad98c[_0x4777bd(0x1be)])[_0x4777bd(0x1cc)](_0x3825b9,_0x354efa,_0x3a42fd);}};_0x131f9c[_0x4c1a34(0x200)][_0x4c1a34(0x1fd)](_0x193672),Object[_0x4c1a34(0x1bc)](_0x35a544,_0x4c1a34(0x1d6),{'enumerable':!0x0,'get':function(){return _0x4eb2b5;}});}));
|