@univerjs-pro/collaboration 1.0.4 → 1.2.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/index.js +1 -1
- package/lib/types/controllers/sheet-transform/algorithms/set-workbook-calculation-settings/set-workbook-calculation-settings.algo.d.ts +8 -0
- package/lib/types/models/collaboration-events.d.ts +6 -0
- package/lib/types/services/snapshot/formula-changeset-calculation.service.d.ts +33 -0
- package/lib/types/services/snapshot/snapshot-save.service.d.ts +1 -0
- package/lib/types/services/snapshot/snapshot.service.d.ts +11 -2
- package/lib/umd/index.js +1 -1
- package/package.json +31 -29
- package/lib/types/controllers/sheet-transform/algorithms/remove-sheets-filter/set-sheets-filter-range.algo.d.ts +0 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IWorkbookCalculationSettings } from '@univerjs/core';
|
|
2
|
+
import type { IMutationTransformAlgorithm } from '../../../../services/transform/transform.service';
|
|
3
|
+
interface ICalculationSettingsParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
settings: IWorkbookCalculationSettings;
|
|
6
|
+
}
|
|
7
|
+
export declare const setWorkbookCalculationSettingsWithSelf: IMutationTransformAlgorithm<ICalculationSettingsParams>;
|
|
8
|
+
export {};
|
|
@@ -102,6 +102,12 @@ export interface IAcknowledgedChangeset {
|
|
|
102
102
|
baseRev: number;
|
|
103
103
|
/** The rev version given by the server. */
|
|
104
104
|
revision: number;
|
|
105
|
+
/** The unit of the acknowledged changeset, when the server echoes the committed changeset. */
|
|
106
|
+
unitID?: string;
|
|
107
|
+
/** The edit session of the acknowledged changeset, when the server echoes the committed changeset. */
|
|
108
|
+
sid?: string;
|
|
109
|
+
/** The request id of the acknowledged changeset, when the server echoes the committed changeset. */
|
|
110
|
+
reqId?: number;
|
|
105
111
|
}
|
|
106
112
|
/**
|
|
107
113
|
* Awaiting mutations were rejected by the server.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IMutationInfo, IWorkbookData } from '@univerjs/core';
|
|
2
|
+
import type { IFormulaChangesetCalculationService } from '@univerjs/engine-formula';
|
|
3
|
+
import { Disposable, ICommandService, ILogService, IUniverInstanceService } from '@univerjs/core';
|
|
4
|
+
import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
5
|
+
/** Snapshot reconstruction uses isolated revision state and releases it before ordinary editing resumes. */
|
|
6
|
+
export declare class FormulaChangesetCalculationService extends Disposable implements IFormulaChangesetCalculationService {
|
|
7
|
+
private readonly _instanceService;
|
|
8
|
+
private readonly _commandService;
|
|
9
|
+
private readonly _dirtyManager;
|
|
10
|
+
private readonly _logService;
|
|
11
|
+
private readonly _formulaDataModel;
|
|
12
|
+
private readonly _states;
|
|
13
|
+
constructor(_instanceService: IUniverInstanceService, _commandService: ICommandService, _dirtyManager: IActiveDirtyManagerService, _logService: ILogService, _formulaDataModel: FormulaDataModel);
|
|
14
|
+
get managedUnitIds(): string[];
|
|
15
|
+
begin(unitId: string, mutations?: IMutationInfo[], baseSnapshot?: IWorkbookData): void;
|
|
16
|
+
applyChangeset(unitId: string, revision: number, mutations: IMutationInfo[]): void;
|
|
17
|
+
end(unitId: string): void;
|
|
18
|
+
flush(unitId: string, calculateOrdinary?: boolean): Promise<void>;
|
|
19
|
+
private _writeResults;
|
|
20
|
+
private _isSpillFollower;
|
|
21
|
+
private _writeArrayData;
|
|
22
|
+
private _applyMutations;
|
|
23
|
+
private _rebuildDependencies;
|
|
24
|
+
private _addFallbackDirtyData;
|
|
25
|
+
private _calculate;
|
|
26
|
+
private _dataset;
|
|
27
|
+
private _collectOutput;
|
|
28
|
+
private _collectCells;
|
|
29
|
+
private _dirtyRanges;
|
|
30
|
+
private _enqueue;
|
|
31
|
+
private _disposeUnit;
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
@@ -29,6 +29,7 @@ export declare class SnapshotSaveService {
|
|
|
29
29
|
getSheet(context: ILogContext, unitID: string, rev: number, workbook: Workbook): Promise<{
|
|
30
30
|
snapshot: ISnapshot;
|
|
31
31
|
}>;
|
|
32
|
+
private _assertSheetRevision;
|
|
32
33
|
getBase(context: ILogContext, unitID: string, rev: number, base: BaseDataModel): Promise<{
|
|
33
34
|
snapshot: ISnapshot;
|
|
34
35
|
}>;
|
|
@@ -4,7 +4,8 @@ import type { ISlideData, SlideModel } from '@univerjs-pro/slides';
|
|
|
4
4
|
import type { BaseDataModel, DocumentDataModel, IBaseSnapshot, ICreateUnitOptions, IDocumentData, IWorkbookData, UnitModel, Workbook } from '@univerjs/core';
|
|
5
5
|
import type { ICopyFileMetaRequest, ICopyFileMetaResponse, IFetchMissingChangesetsRequest, IFetchMissingChangesetsResponse, IGetDeserializedSheetBlockResponse, IGetLatestCsReqIdBySidRequest, IGetLatestCsReqIdBySidResponse, IGetResourcesRequest, IGetResourcesResponse, IGetSheetBlockRequest, IGetSheetBlockResponse, IGetUnitOnRevRequest, IGetUnitOnRevResponse, IReportUnitRoutingStatsRequest, IReportUnitRoutingStatsResponse, ISaveChangesetRequest, ISaveChangesetResponse, ISaveSheetBlockRequest, ISaveSheetBlockResponse, ISaveSnapshotRequest, ISaveSnapshotResponse, ISnapshot } from '@univerjs/protocol';
|
|
6
6
|
import type { ILogContext } from '../../utils';
|
|
7
|
-
import { ICommandService, ILogService, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
7
|
+
import { ICommandService, ILogService, Injector, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
8
|
+
import { FormulaCalculationTriggerService } from '@univerjs/engine-formula';
|
|
8
9
|
import { CompressMutationService } from '../compress-mutation/compress-mutation.service';
|
|
9
10
|
import { RevisionService } from '../rev/rev.service';
|
|
10
11
|
import { SnapshotLoadingService } from './snapshot-loading.service';
|
|
@@ -55,10 +56,18 @@ export declare class SnapshotService {
|
|
|
55
56
|
private _compressMutationService;
|
|
56
57
|
private _resourceManagerService;
|
|
57
58
|
private readonly _snapshotLoadingService;
|
|
59
|
+
private readonly _injector?;
|
|
60
|
+
private readonly _calculationTrigger?;
|
|
58
61
|
private readonly _serverUnits;
|
|
59
|
-
|
|
62
|
+
private readonly _calculatedRevisions;
|
|
63
|
+
private readonly _snapshotCalculations;
|
|
64
|
+
constructor(_revisionService: RevisionService, _univerInstanceService: IUniverInstanceService, _snapshotServerService: ISnapshotServerService, _commandService: ICommandService, _logService: ILogService, _compressMutationService: CompressMutationService, _resourceManagerService: IResourceManagerService, _snapshotLoadingService: SnapshotLoadingService, _injector?: Injector | undefined, _calculationTrigger?: FormulaCalculationTriggerService | undefined);
|
|
60
65
|
isUnitLoadedFromServer(unit: UnitModel): boolean;
|
|
61
66
|
loadSheet(unitId: string, rev: number, context?: ILogContext, options?: ISnapshotLoadOptions): Promise<Workbook>;
|
|
67
|
+
private _getChangesetCalculationService;
|
|
68
|
+
/** Rebuild persisted revisions only when a snapshot is requested; live apply never calls this. */
|
|
69
|
+
calculateSheetSnapshot(context: ILogContext, workbook: Workbook): Promise<boolean>;
|
|
70
|
+
private _calculateSheetSnapshot;
|
|
62
71
|
private _getPrioritizedSheetBlockIds;
|
|
63
72
|
private _getCompressedChangesetMutations;
|
|
64
73
|
loadBase(unitId: string, rev: number, context?: ILogContext, options?: ISnapshotLoadOptions): Promise<BaseDataModel>;
|