@univerjs-pro/collaboration 1.0.0-beta.0 → 1.0.0-beta.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IDataValidationRule, IRange } from '@univerjs/core';
17
+ export declare function resolveDataValidationRuleRanges(rules: Array<Pick<IDataValidationRule, 'uid' | 'ranges'>>): Map<string, IRange[]>;
@@ -17,7 +17,7 @@ export type { ICombRequestEvent, ICombResponseEvent, IHeartbeatRequestEvent, IHe
17
17
  export { UniverCollaborationPlugin } from './plugin';
18
18
  export { CompressMutationService } from './services/compress-mutation/compress-mutation.service';
19
19
  export { RevisionService, SINGLE_HISTORY_MUTATIONS, SINGLE_SNAPSHOT_MUTATIONS, } from './services/rev/rev.service';
20
- export { SNAPSHOT_LOADING_PREVIEW_BLOCK_LIMIT, SnapshotLoadingService, SnapshotLoadStage, } from './services/snapshot/snapshot-loading.service';
20
+ export { SnapshotLoadingService, SnapshotLoadStage, } from './services/snapshot/snapshot-loading.service';
21
21
  export type { ISnapshotLoadState } from './services/snapshot/snapshot-loading.service';
22
22
  export { SnapshotSaveService } from './services/snapshot/snapshot-save.service';
23
23
  export { getSheetBlocksFromSnapshot, transformBaseDataToSnapshot, transformBoardDataToSnapshot, transformDocumentDataToSnapshot, transformPdfDataToSnapshot, transformSlideDataToSnapshot, transformSnapshotToBaseData, transformSnapshotToBoardData, transformSnapshotToDocumentData, transformSnapshotToPdfData, transformSnapshotToSlideData, transformSnapshotToWorkbookData, transformWorkbookDataToSnapshot, } from './services/snapshot/snapshot-transform';
@@ -1,6 +1,5 @@
1
- import type { ICellData, IObjectMatrixPrimitiveType, IWorkbookData, UniverInstanceType } from '@univerjs/core';
1
+ import type { UniverInstanceType } from '@univerjs/core';
2
2
  import { Disposable } from '@univerjs/core';
3
- export declare const SNAPSHOT_LOADING_PREVIEW_BLOCK_LIMIT = 3;
4
3
  export declare enum SnapshotLoadStage {
5
4
  LOADING_SNAPSHOT = "loading-snapshot",
6
5
  LOADING_BLOCKS = "loading-blocks",
@@ -13,22 +12,16 @@ export interface ISnapshotLoadState {
13
12
  stage: SnapshotLoadStage;
14
13
  totalBlocks: number;
15
14
  loadedBlocks: number;
16
- totalPreviewBlocks: number;
17
- loadedPreviewBlocks: number;
18
- previewReady: boolean;
19
- activeSheetId?: string;
20
- workbookShell?: IWorkbookData;
21
- previewCellData?: IObjectMatrixPrimitiveType<ICellData>;
22
15
  error?: Error;
23
16
  }
24
- /** Sheet snapshot loading state consumed by loading UI and preview renderers. */
17
+ /** Sheet snapshot loading state consumed by loading UI. */
25
18
  export declare class SnapshotLoadingService extends Disposable {
26
19
  private readonly _stateByUnit;
27
20
  private readonly _state$;
28
21
  readonly state$: import("rxjs").Observable<ReadonlyMap<string, ISnapshotLoadState>>;
29
22
  begin(unitId: string, type: UniverInstanceType): void;
30
- setSnapshot(unitId: string, workbookShell: IWorkbookData, activeSheetId: string, totalBlocks: number, totalPreviewBlocks: number): void;
31
- addBlock(unitId: string, subUnitId: string, cellData: IObjectMatrixPrimitiveType<ICellData>, isPreviewBlock?: boolean): void;
23
+ setSnapshot(unitId: string, totalBlocks: number): void;
24
+ addBlock(unitId: string): void;
32
25
  complete(unitId: string): void;
33
26
  fail(unitId: string, error: Error): void;
34
27
  getState(unitId: string): ISnapshotLoadState | undefined;
@@ -29,10 +29,6 @@ export declare function transformBaseDataToSnapshot(context: ILogContext, base:
29
29
  * @param sheetBlocks
30
30
  */
31
31
  export declare function transformSnapshotToWorkbookData(snapshot: ISnapshot, sheetBlocks: (IDeserializedSheetBlock | ISheetBlock)[], _context?: ILogContext, logService?: ILogService): Promise<IWorkbookData>;
32
- /**
33
- * Builds the workbook shell from snapshot metadata without loading cell blocks.
34
- */
35
- export declare function transformSnapshotToWorkbookDataWithoutBlocks(snapshot: ISnapshot): IWorkbookData;
36
32
  export declare function transformSnapshotToBaseData(snapshot: ISnapshot, baseBlocks?: (IDeserializedSheetBlock | ISheetBlock)[], _context?: ILogContext, logService?: ILogService): Promise<IBaseSnapshot>;
37
33
  export declare function transformSnapshotToDocumentData(snapshot: ISnapshot): IDocumentData;
38
34
  export declare function transformDocumentDataToSnapshot(context: ILogContext, document: IDocumentData, unitID: string, rev: number, snapshotService: ISnapshotServerService): Promise<{
@@ -59,7 +59,7 @@ export declare class SnapshotService {
59
59
  constructor(_revisionService: RevisionService, _univerInstanceService: IUniverInstanceService, _snapshotServerService: ISnapshotServerService, _commandService: ICommandService, _logService: ILogService, _compressMutationService: CompressMutationService, _resourceManagerService: IResourceManagerService, _snapshotLoadingService: SnapshotLoadingService);
60
60
  isUnitLoadedFromServer(unit: UnitModel): boolean;
61
61
  loadSheet(unitId: string, rev: number, context?: ILogContext, options?: ISnapshotLoadOptions): Promise<Workbook>;
62
- private _getPrioritizedSheetBlocks;
62
+ private _getPrioritizedSheetBlockIds;
63
63
  private _getCompressedChangesetMutations;
64
64
  loadBase(unitId: string, rev: number, context?: ILogContext, options?: ISnapshotLoadOptions): Promise<BaseDataModel>;
65
65
  loadDoc(unitID: string, rev: number, context?: ILogContext, options?: ISnapshotLoadOptions): Promise<DocumentDataModel>;