@univerjs-pro/sheets-history-ui 1.0.0-rc.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.
Files changed (140) hide show
  1. package/README.md +22 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/es/index.js +1 -0
  23. package/lib/es/locale/ar-SA.js +1 -0
  24. package/lib/es/locale/ca-ES.js +1 -0
  25. package/lib/es/locale/de-DE.js +1 -0
  26. package/lib/es/locale/en-US.js +1 -0
  27. package/lib/es/locale/es-ES.js +1 -0
  28. package/lib/es/locale/fa-IR.js +1 -0
  29. package/lib/es/locale/fr-FR.js +1 -0
  30. package/lib/es/locale/id-ID.js +1 -0
  31. package/lib/es/locale/it-IT.js +1 -0
  32. package/lib/es/locale/ja-JP.js +1 -0
  33. package/lib/es/locale/ko-KR.js +1 -0
  34. package/lib/es/locale/pl-PL.js +1 -0
  35. package/lib/es/locale/pt-BR.js +1 -0
  36. package/lib/es/locale/ru-RU.js +1 -0
  37. package/lib/es/locale/sk-SK.js +1 -0
  38. package/lib/es/locale/vi-VN.js +1 -0
  39. package/lib/es/locale/zh-CN.js +1 -0
  40. package/lib/es/locale/zh-HK.js +1 -0
  41. package/lib/es/locale/zh-TW.js +1 -0
  42. package/lib/index.css +617 -0
  43. package/lib/index.js +1 -0
  44. package/lib/locale/ar-SA.js +1 -0
  45. package/lib/locale/ca-ES.js +1 -0
  46. package/lib/locale/de-DE.js +1 -0
  47. package/lib/locale/en-US.js +1 -0
  48. package/lib/locale/es-ES.js +1 -0
  49. package/lib/locale/fa-IR.js +1 -0
  50. package/lib/locale/fr-FR.js +1 -0
  51. package/lib/locale/id-ID.js +1 -0
  52. package/lib/locale/it-IT.js +1 -0
  53. package/lib/locale/ja-JP.js +1 -0
  54. package/lib/locale/ko-KR.js +1 -0
  55. package/lib/locale/pl-PL.js +1 -0
  56. package/lib/locale/pt-BR.js +1 -0
  57. package/lib/locale/ru-RU.js +1 -0
  58. package/lib/locale/sk-SK.js +1 -0
  59. package/lib/locale/vi-VN.js +1 -0
  60. package/lib/locale/zh-CN.js +1 -0
  61. package/lib/locale/zh-HK.js +1 -0
  62. package/lib/locale/zh-TW.js +1 -0
  63. package/lib/types/commands/history.operate.d.ts +3 -0
  64. package/lib/types/config/config.d.ts +55 -0
  65. package/lib/types/controllers/components.controller.d.ts +5 -0
  66. package/lib/types/controllers/history-loader.controller.d.ts +26 -0
  67. package/lib/types/controllers/history-menu.d.ts +4 -0
  68. package/lib/types/controllers/mobile/components.controller.d.ts +5 -0
  69. package/lib/types/controllers/mobile-history-loader.controller.d.ts +26 -0
  70. package/lib/types/controllers/revert-acknowledgement.d.ts +3 -0
  71. package/lib/types/index.d.ts +5 -0
  72. package/lib/types/locale/ar-SA.d.ts +3 -0
  73. package/lib/types/locale/ca-ES.d.ts +3 -0
  74. package/lib/types/locale/de-DE.d.ts +3 -0
  75. package/lib/types/locale/en-US.d.ts +157 -0
  76. package/lib/types/locale/es-ES.d.ts +3 -0
  77. package/lib/types/locale/fa-IR.d.ts +3 -0
  78. package/lib/types/locale/fr-FR.d.ts +3 -0
  79. package/lib/types/locale/id-ID.d.ts +3 -0
  80. package/lib/types/locale/it-IT.d.ts +3 -0
  81. package/lib/types/locale/ja-JP.d.ts +3 -0
  82. package/lib/types/locale/ko-KR.d.ts +3 -0
  83. package/lib/types/locale/pl-PL.d.ts +3 -0
  84. package/lib/types/locale/pt-BR.d.ts +3 -0
  85. package/lib/types/locale/ru-RU.d.ts +3 -0
  86. package/lib/types/locale/sk-SK.d.ts +3 -0
  87. package/lib/types/locale/types.d.ts +3 -0
  88. package/lib/types/locale/vi-VN.d.ts +3 -0
  89. package/lib/types/locale/zh-CN.d.ts +3 -0
  90. package/lib/types/locale/zh-HK.d.ts +3 -0
  91. package/lib/types/locale/zh-TW.d.ts +3 -0
  92. package/lib/types/menu/schema.d.ts +2 -0
  93. package/lib/types/mobile-plugin.d.ts +14 -0
  94. package/lib/types/plugin.d.ts +14 -0
  95. package/lib/types/services/history-loader.service.d.ts +36 -0
  96. package/lib/types/services/history-locale.d.ts +5 -0
  97. package/lib/types/services/history-version-param.d.ts +3 -0
  98. package/lib/types/services/mobile-history-loader.service.d.ts +35 -0
  99. package/lib/types/viewer/controllers/disable-state.controller.d.ts +7 -0
  100. package/lib/types/viewer/controllers/history-manager.controller.d.ts +16 -0
  101. package/lib/types/viewer/controllers/mobile-history-manager.controller.d.ts +16 -0
  102. package/lib/types/viewer/controllers/mobile-version-list.controller.d.ts +7 -0
  103. package/lib/types/viewer/controllers/version-diff.render.controller.d.ts +58 -0
  104. package/lib/types/viewer/controllers/version-list.controller.d.ts +14 -0
  105. package/lib/types/viewer/mobile-plugin.d.ts +16 -0
  106. package/lib/types/viewer/plugin.d.ts +16 -0
  107. package/lib/types/viewer/services/disable-dialog.service.d.ts +13 -0
  108. package/lib/types/viewer/services/history-fetch.service.d.ts +106 -0
  109. package/lib/types/viewer/services/history-manager.service.d.ts +84 -0
  110. package/lib/types/viewer/services/sheets-history-diff-color.service.d.ts +16 -0
  111. package/lib/types/viewer/services/version-diff.service.d.ts +89 -0
  112. package/lib/types/viewer/views/HistoryLoadingMask.d.ts +1 -0
  113. package/lib/types/viewer/views/HistoryViewHeader.d.ts +1 -0
  114. package/lib/types/viewer/views/MobileHistoryViewHeader.d.ts +1 -0
  115. package/lib/types/viewer/views/MobileVersionListPanel.d.ts +1 -0
  116. package/lib/types/viewer/views/VersionListPanel.d.ts +21 -0
  117. package/lib/types/viewer/views/all-mutations.d.ts +101 -0
  118. package/lib/types/viewer/views/shapes/sheet-history-arrow.shape.d.ts +29 -0
  119. package/lib/types/viewer/views/utils.d.ts +11 -0
  120. package/lib/umd/index.js +1 -0
  121. package/lib/umd/locale/ar-SA.js +1 -0
  122. package/lib/umd/locale/ca-ES.js +1 -0
  123. package/lib/umd/locale/de-DE.js +1 -0
  124. package/lib/umd/locale/en-US.js +1 -0
  125. package/lib/umd/locale/es-ES.js +1 -0
  126. package/lib/umd/locale/fa-IR.js +1 -0
  127. package/lib/umd/locale/fr-FR.js +1 -0
  128. package/lib/umd/locale/id-ID.js +1 -0
  129. package/lib/umd/locale/it-IT.js +1 -0
  130. package/lib/umd/locale/ja-JP.js +1 -0
  131. package/lib/umd/locale/ko-KR.js +1 -0
  132. package/lib/umd/locale/pl-PL.js +1 -0
  133. package/lib/umd/locale/pt-BR.js +1 -0
  134. package/lib/umd/locale/ru-RU.js +1 -0
  135. package/lib/umd/locale/sk-SK.js +1 -0
  136. package/lib/umd/locale/vi-VN.js +1 -0
  137. package/lib/umd/locale/zh-CN.js +1 -0
  138. package/lib/umd/locale/zh-HK.js +1 -0
  139. package/lib/umd/locale/zh-TW.js +1 -0
  140. package/package.json +108 -0
@@ -0,0 +1,16 @@
1
+ import type { IUniverSheetsHistoryUIConfig } from '../config/config';
2
+ import { IConfigService, Injector, Plugin } from '@univerjs/core';
3
+ import { IRenderManagerService } from '@univerjs/engine-render';
4
+ export declare class SheetsHistoryViewerMobileUIPlugin extends Plugin {
5
+ private readonly _config;
6
+ protected _injector: Injector;
7
+ private readonly _renderManagerService;
8
+ private readonly _configService;
9
+ static pluginName: string;
10
+ static packageName: string;
11
+ static version: string;
12
+ constructor(_config: IUniverSheetsHistoryUIConfig | undefined, _injector: Injector, _renderManagerService: IRenderManagerService, _configService: IConfigService);
13
+ onStarting(): void;
14
+ onRendered(): void;
15
+ onSteady(): void;
16
+ }
@@ -0,0 +1,16 @@
1
+ import type { IUniverSheetsHistoryUIConfig } from '../config/config';
2
+ import { IConfigService, Injector, Plugin } from '@univerjs/core';
3
+ import { IRenderManagerService } from '@univerjs/engine-render';
4
+ export declare class SheetsHistoryViewerPlugin extends Plugin {
5
+ private readonly _config;
6
+ protected _injector: Injector;
7
+ private readonly _renderManagerService;
8
+ private readonly _configService;
9
+ static pluginName: string;
10
+ static packageName: string;
11
+ static version: string;
12
+ constructor(_config: IUniverSheetsHistoryUIConfig | undefined, _injector: Injector, _renderManagerService: IRenderManagerService, _configService: IConfigService);
13
+ onStarting(): void;
14
+ onRendered(): void;
15
+ onSteady(): void;
16
+ }
@@ -0,0 +1,13 @@
1
+ import type { IDisposable } from '@univerjs/core';
2
+ import type { IDialogPartMethodOptions, IDialogService } from '@univerjs/ui';
3
+ import type { Observable } from 'rxjs';
4
+ import { Disposable } from '@univerjs/core';
5
+ import { Subject } from 'rxjs';
6
+ export declare class DisableDialogService extends Disposable implements IDialogService {
7
+ protected readonly _dialogOptions$: Subject<IDialogPartMethodOptions[]>;
8
+ constructor();
9
+ open(): IDisposable;
10
+ close(): void;
11
+ closeAll(_expectIds?: string[]): void;
12
+ getDialogs$(): Observable<IDialogPartMethodOptions[]>;
13
+ }
@@ -0,0 +1,106 @@
1
+ import type { ILogContext } from '@univerjs-pro/collaboration';
2
+ import type { Nullable, Workbook } from '@univerjs/core';
3
+ import type { IGetHistoryCsRequest, IGetHistoryCsResponse } from '@univerjs/protocol';
4
+ import { CompressMutationService, ISnapshotServerService } from '@univerjs-pro/collaboration';
5
+ import { Disposable, ICommandService, IConfigService, IPermissionService, IUniverInstanceService } from '@univerjs/core';
6
+ import { IDrawingManagerService } from '@univerjs/drawing';
7
+ import { HTTPService } from '@univerjs/network';
8
+ import { SheetPermissionInitController } from '@univerjs/sheets';
9
+ export interface IHistoryVersion {
10
+ unitId: string;
11
+ id: string;
12
+ startRev: number;
13
+ endRev: number;
14
+ time?: number;
15
+ user: string;
16
+ users: string[];
17
+ recoverTime?: number;
18
+ commands: string[];
19
+ isAnonymous: boolean;
20
+ additionalFields?: string;
21
+ startRevCreateTime?: number;
22
+ endRevCreateTime?: number;
23
+ }
24
+ export interface IServiceVersionsData {
25
+ hasMore: boolean;
26
+ lastLabel: string;
27
+ entities: {
28
+ datas: Record<string, IVersionItem>;
29
+ users: Record<string, IUser>;
30
+ };
31
+ historyIds: string[];
32
+ }
33
+ export interface IVersionItem {
34
+ unitId: string;
35
+ userId: string;
36
+ userIds: string[];
37
+ command: string[];
38
+ createTime: number;
39
+ startRevision: number;
40
+ endRevision: number;
41
+ recoverTime?: string;
42
+ additionalFields?: string;
43
+ startRevCreateTime: number;
44
+ endRevCreateTime: number;
45
+ }
46
+ export interface IUser {
47
+ userID: string;
48
+ name: string;
49
+ avatar: string;
50
+ anonymous: boolean;
51
+ canBindAnonymous: boolean;
52
+ }
53
+ /**
54
+ * @description The origin of the history
55
+ */
56
+ export declare enum HistoryOrigin {
57
+ Unspecified = 0,
58
+ User = 1,
59
+ Character = 2
60
+ }
61
+ export interface IHistoryCreator {
62
+ userId: string;
63
+ name: string;
64
+ avatar: string;
65
+ origins: HistoryOrigin[];
66
+ }
67
+ export declare class HistoryFetchService extends Disposable {
68
+ private readonly _snapshotServerService;
69
+ private readonly _univerInstanceService;
70
+ private readonly _commandService;
71
+ private readonly _permissionService;
72
+ private readonly _drawingManagerService;
73
+ private readonly _configService;
74
+ private readonly _httpService;
75
+ private _compressMutationService;
76
+ private _sheetPermissionInitController;
77
+ /**
78
+ * ✅ LRU cache for workbookData by (unitID, rev).
79
+ * Key: `${unitID}:${rev}`
80
+ * Value: IWorkbookData
81
+ *
82
+ * No _inflight, no _loadToken — outer layer is assumed to serialize loadSheet calls.
83
+ */
84
+ private _workbookDataCache;
85
+ constructor(_snapshotServerService: ISnapshotServerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _permissionService: IPermissionService, _drawingManagerService: IDrawingManagerService, _configService: IConfigService, _httpService: HTTPService, _compressMutationService: CompressMutationService, _sheetPermissionInitController: SheetPermissionInitController);
86
+ dispose(): void;
87
+ fetchCreatorList(unitID: string): Promise<IHistoryCreator[]>;
88
+ getVersions(unitID: string, params?: {
89
+ userIds?: string[];
90
+ lastLabel?: string;
91
+ origin?: HistoryOrigin;
92
+ }): Promise<Nullable<{
93
+ hasMore: boolean;
94
+ lastLabel: string;
95
+ versions: IHistoryVersion[];
96
+ members: Record<string, IUser>;
97
+ }>>;
98
+ getHistoryChangesets(_context: ILogContext, params: IGetHistoryCsRequest): Promise<IGetHistoryCsResponse>;
99
+ private _getAPIPrefix;
100
+ private _cacheKey;
101
+ loadSheet(unitID: string, rev: number, context?: ILogContext): Promise<boolean>;
102
+ private _applyWorkbookData;
103
+ private _createUnit;
104
+ }
105
+ export declare function disableHistoryWorkbookEditing(permissionService: IPermissionService, drawingManagerService: IDrawingManagerService, workbook: Workbook): void;
106
+ export declare function convertEntitiesToVersions(data: IServiceVersionsData): IHistoryVersion[];
@@ -0,0 +1,84 @@
1
+ import type { HistoryOrigin, IHistoryCreator, IHistoryVersion, IUser } from './history-fetch.service';
2
+ import { Disposable, IConfirmService, ILogService, LocaleService } from '@univerjs/core';
3
+ import { IMessageService } from '@univerjs/ui';
4
+ import { HistoryFetchService } from './history-fetch.service';
5
+ export declare enum HistoryModeStatus {
6
+ Entered = "entered",
7
+ Exited = "exited",
8
+ Error = "error"
9
+ }
10
+ export declare enum LoadingState {
11
+ Init = "init",
12
+ Loading = "loading",
13
+ Loaded = "loaded",
14
+ Error = "error"
15
+ }
16
+ export declare const VIRTUAL_VERSION_NOW = "VIRTUAL_VERSION_NOW";
17
+ export declare class HistoryManagerService extends Disposable {
18
+ private readonly _messageService;
19
+ private readonly _confirmService;
20
+ private readonly _logService;
21
+ private readonly _localeService;
22
+ private readonly _historyFetchService;
23
+ private _versions$;
24
+ readonly versions$: import("rxjs").Observable<IHistoryVersion[]>;
25
+ private _currentVersion$;
26
+ readonly currentVersion$: import("rxjs").Observable<string>;
27
+ private _status$;
28
+ readonly status$: import("rxjs").Observable<HistoryModeStatus>;
29
+ private _revertRevision$;
30
+ readonly revertRevision$: import("rxjs").Observable<number>;
31
+ private _unitId$;
32
+ readonly unitId$: import("rxjs").Observable<string | null>;
33
+ private _fetching$;
34
+ readonly fetching$: import("rxjs").Observable<boolean>;
35
+ private _creators$;
36
+ readonly creators$: import("rxjs").Observable<IHistoryCreator[]>;
37
+ private _openPanel$;
38
+ readonly openPanel$: import("rxjs").Observable<boolean>;
39
+ private _detailVersionsMap;
40
+ private _setFetching;
41
+ get fetching(): boolean;
42
+ private _loadingState$;
43
+ readonly loadingState$: import("rxjs").Observable<LoadingState>;
44
+ private _lastLabel;
45
+ private _hasMore;
46
+ private _members;
47
+ private _canRevert;
48
+ private _loadParams;
49
+ private _unitCurrentVersionMap;
50
+ constructor(_messageService: IMessageService, _confirmService: IConfirmService, _logService: ILogService, _localeService: LocaleService, _historyFetchService: HistoryFetchService);
51
+ triggerLoadVersions(unitId: string, canRevert: boolean): Promise<void>;
52
+ triggerCustomVersions(unitId: string, canRevert: boolean, param: {
53
+ hasMore: boolean;
54
+ lastLabel: string;
55
+ versions: IHistoryVersion[];
56
+ members: Record<string, IUser>;
57
+ }): void;
58
+ loadInitialVersions(unitId: string, params?: {
59
+ userIds?: string[];
60
+ origin?: HistoryOrigin;
61
+ }): Promise<void>;
62
+ loadMoreVersions(): Promise<boolean>;
63
+ loadHistoryCreatorList(): Promise<void>;
64
+ triggerLoadSheet(versionId: string): Promise<void>;
65
+ triggerRevert(id?: string): Promise<void>;
66
+ private _updateVersions;
67
+ getCurrentVersion(): IHistoryVersion | undefined;
68
+ private _setVersions;
69
+ getVersion(id: string): IHistoryVersion | undefined;
70
+ registerDetailVersion(version: IHistoryVersion): void;
71
+ getCurrentUnitCurrentVersion(): number | undefined;
72
+ getSelectedVersionIsCurrentVersion(): boolean;
73
+ getSelectedVersionCanRevert(): boolean;
74
+ getMember(id: string): IUser | undefined;
75
+ exitHistoryMode(): void;
76
+ set status(value: HistoryModeStatus);
77
+ get status(): HistoryModeStatus;
78
+ selectVersion(value: string): void;
79
+ get currentVersion(): string;
80
+ set unitId(value: string | null);
81
+ get unitId(): string | null;
82
+ get canRevert(): boolean;
83
+ get loadingState(): LoadingState;
84
+ }
@@ -0,0 +1,16 @@
1
+ import type { HistoryChangeKind } from '@univerjs-pro/edit-history';
2
+ import type { Observable } from 'rxjs';
3
+ import { Disposable, ThemeService } from '@univerjs/core';
4
+ export interface ISheetsHistoryDiffStyle {
5
+ readonly fill: string;
6
+ readonly stroke: string;
7
+ }
8
+ export type SheetsHistoryDiffPalette = Readonly<Record<HistoryChangeKind, ISheetsHistoryDiffStyle>>;
9
+ export declare class SheetsHistoryDiffColorService extends Disposable {
10
+ private readonly _themeService;
11
+ private readonly _palette$;
12
+ readonly palette$: Observable<SheetsHistoryDiffPalette>;
13
+ constructor(_themeService: ThemeService);
14
+ private _createPalette;
15
+ private _createStyle;
16
+ }
@@ -0,0 +1,89 @@
1
+ import type { IMutationInfo, IRange } from '@univerjs/core';
2
+ import { ISnapshotServerService, ITransformService } from '@univerjs-pro/collaboration';
3
+ import { SheetsChartService } from '@univerjs-pro/sheets-chart';
4
+ import { SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
5
+ import { SparklineDataSourceModel } from '@univerjs-pro/sheets-sparkline';
6
+ import { Disposable, LocaleService } from '@univerjs/core';
7
+ import { RangeProtectionRuleModel } from '@univerjs/sheets';
8
+ import { ConditionalFormattingRuleModel } from '@univerjs/sheets-conditional-formatting';
9
+ import { SheetDataValidationModel } from '@univerjs/sheets-data-validation';
10
+ import { SheetsFilterService } from '@univerjs/sheets-filter';
11
+ import { SheetTableService } from '@univerjs/sheets-table';
12
+ import { HistoryFetchService } from './history-fetch.service';
13
+ import { HistoryManagerService } from './history-manager.service';
14
+ export interface ISheetRange {
15
+ unitId: string;
16
+ subUnitId: string;
17
+ range: IRange;
18
+ highlightRow?: boolean;
19
+ highlightColumn?: boolean;
20
+ showText?: string;
21
+ }
22
+ export interface ISheetDrawing {
23
+ unitId: string;
24
+ subUnitId: string;
25
+ drawingId: string;
26
+ showText?: string;
27
+ }
28
+ export interface IVersionDiff {
29
+ ranges: Map<string, ISheetRange[]>;
30
+ insertCellRanges?: Map<string, ISheetRange[]>;
31
+ deleteCellRanges?: Map<string, ISheetRange[]>;
32
+ updateCellRanges?: Map<string, ISheetRange[]>;
33
+ insertBorderRanges?: Map<string, ISheetRange[]>;
34
+ deleteBorderRanges?: Map<string, ISheetRange[]>;
35
+ updateBorderRanges?: Map<string, ISheetRange[]>;
36
+ arrowRowRanges?: Map<string, ISheetRange[]>;
37
+ arrowColumnRanges?: Map<string, ISheetRange[]>;
38
+ updateDrawings?: Map<string, ISheetDrawing[]>;
39
+ insertDrawings?: Map<string, ISheetDrawing[]>;
40
+ deleteDrawings?: Map<string, ISheetDrawing[]>;
41
+ subUnitIds: string[];
42
+ active: string | null;
43
+ }
44
+ export interface IMutationInfoWithMemberId extends IMutationInfo {
45
+ memberId: string;
46
+ }
47
+ export declare class VersionDiffService extends Disposable {
48
+ private readonly _historyManagerService;
49
+ private readonly _transformService;
50
+ private readonly _snapshotServerService;
51
+ private readonly _rangeProtectionRuleModel;
52
+ private _conditionalFormattingRuleModel;
53
+ private _dataValidationModel;
54
+ private _sheetsFilterService;
55
+ private readonly _sparklineDataSourceModel;
56
+ private readonly _sheetsPivotTableConfigModel;
57
+ private _sheetTableService;
58
+ protected readonly _localeService: LocaleService;
59
+ private readonly _sheetsChartService;
60
+ private readonly _historyFetchService;
61
+ private _diffRangesMap;
62
+ private _currentVersionDiff$;
63
+ readonly currentVersionDiff$: import("rxjs").Observable<IVersionDiff>;
64
+ constructor(_historyManagerService: HistoryManagerService, _transformService: ITransformService, _snapshotServerService: ISnapshotServerService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _dataValidationModel: SheetDataValidationModel, _sheetsFilterService: SheetsFilterService, _sparklineDataSourceModel: SparklineDataSourceModel, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetTableService: SheetTableService, _localeService: LocaleService, _sheetsChartService: SheetsChartService, _historyFetchService: HistoryFetchService);
65
+ private _init;
66
+ ensureVersion(versionId: string): Promise<void>;
67
+ getMutationActionMap(): Map<string, string>;
68
+ categorizeMutationRanges(mutation: IMutationInfo, mutationActionMap: Map<string, string>): {
69
+ allRanges: ISheetRange[];
70
+ insertCellRanges: ISheetRange[];
71
+ deleteCellRanges: ISheetRange[];
72
+ updateCellRanges: ISheetRange[];
73
+ insertBorderRanges: ISheetRange[];
74
+ deleteBorderRanges: ISheetRange[];
75
+ updateBorderRanges: ISheetRange[];
76
+ arrowRowRanges: ISheetRange[];
77
+ arrowColumnRanges: ISheetRange[];
78
+ insertDrawings: ISheetDrawing[];
79
+ deleteDrawings: ISheetDrawing[];
80
+ updateDrawings: ISheetDrawing[];
81
+ subUnitIds: string[];
82
+ };
83
+ private _transformMutationByOrder;
84
+ private _yieldToMain;
85
+ private _getActiveSubUnitId;
86
+ private _extractRanges;
87
+ private _categorizeMutationRanges;
88
+ private _combineRanges;
89
+ }
@@ -0,0 +1 @@
1
+ export declare function HistoryLoadingMask(): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function HistoryViewHeader(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function MobileHistoryViewHeader(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function MobileVersionListPanel(): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import type { IHistoryVersion } from '../services/history-fetch.service';
2
+ export interface IVersionWitDate {
3
+ versions: IHistoryVersion[];
4
+ dateString: string;
5
+ startDateString: string;
6
+ endDateString: string;
7
+ }
8
+ export declare function VersionListPanel(): import("react").JSX.Element;
9
+ export declare function Empty(): import("react").JSX.Element;
10
+ export declare function VersionDate(props: {
11
+ date: string;
12
+ startDate?: string;
13
+ endDate?: string;
14
+ }): import("react").JSX.Element;
15
+ export declare function VersionItem(props: {
16
+ item: IHistoryVersion;
17
+ onToggleExpand?: (version: IHistoryVersion) => Promise<void>;
18
+ isExpanded?: boolean;
19
+ isLoadingDetail?: boolean;
20
+ isDetail?: boolean;
21
+ }): import("react").JSX.Element;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * All mutations collected from the Univer Pro project
3
+ * Organized by plugin/package with comments indicating the source
4
+ *
5
+ * Note: The action field uses locale keys with the format `${localePrefix}actionName`
6
+ * You may need to add corresponding translations in your locale files
7
+ */
8
+ /**
9
+ * All mutations organized by plugin
10
+ * Format: { id: MutationClass.id, action: `${localePrefix}actionKey` }
11
+ */
12
+ export declare function getAllMutations(localePrefix?: string): {
13
+ collaboration: {
14
+ id: string;
15
+ action: string;
16
+ }[];
17
+ sheets: {
18
+ id: string;
19
+ action: string;
20
+ }[];
21
+ sheetsConditionalFormatting: {
22
+ id: string;
23
+ action: string;
24
+ }[];
25
+ sheetsFilter: {
26
+ id: string;
27
+ action: string;
28
+ }[];
29
+ dataValidation: {
30
+ id: string;
31
+ action: string;
32
+ }[];
33
+ sheetsChart: {
34
+ id: string;
35
+ action: string;
36
+ }[];
37
+ sheetsSparkline: {
38
+ id: string;
39
+ action: string;
40
+ }[];
41
+ sheetsPivot: {
42
+ id: string;
43
+ action: string;
44
+ }[];
45
+ sheetsShape: {
46
+ id: string;
47
+ action: string;
48
+ }[];
49
+ sheetsTable: {
50
+ id: string;
51
+ action: string;
52
+ }[];
53
+ sheetsDrawing: {
54
+ id: string;
55
+ action: string;
56
+ }[];
57
+ };
58
+ /**
59
+ * Get a flat array of all mutations
60
+ */
61
+ export declare function getAllMutationsFlat(localePrefix?: string): ({
62
+ id: string;
63
+ action: string;
64
+ } | {
65
+ id: string;
66
+ action: string;
67
+ } | {
68
+ id: string;
69
+ action: string;
70
+ } | {
71
+ id: string;
72
+ action: string;
73
+ } | {
74
+ id: string;
75
+ action: string;
76
+ } | {
77
+ id: string;
78
+ action: string;
79
+ } | {
80
+ id: string;
81
+ action: string;
82
+ } | {
83
+ id: string;
84
+ action: string;
85
+ } | {
86
+ id: string;
87
+ action: string;
88
+ } | {
89
+ id: string;
90
+ action: string;
91
+ } | {
92
+ id: string;
93
+ action: string;
94
+ })[];
95
+ /**
96
+ * Get mutations for specific plugins
97
+ */
98
+ export declare function getMutationsByPlugins(plugins: string[], localePrefix?: string): {
99
+ id: string;
100
+ action: string;
101
+ }[];
@@ -0,0 +1,29 @@
1
+ import type { IMouseEvent, IPointerEvent, IShapeProps } from '@univerjs/engine-render';
2
+ import { Shape } from '@univerjs/engine-render';
3
+ export declare const SHEET_HISTORY_ARROW_ZINDEX = 1;
4
+ export declare const SHEET_HISTORY_ARROW_BORDER_WIDTH = 4;
5
+ export declare const ARROW_HEAD_SIZE = 12;
6
+ export interface ISheetHistoryArrowShapeProps extends IShapeProps {
7
+ color: string;
8
+ direction: 'horizontal' | 'vertical';
9
+ highlight?: boolean;
10
+ highlightSecond?: number;
11
+ }
12
+ export declare class SheetHistoryArrowShape<T extends ISheetHistoryArrowShapeProps = ISheetHistoryArrowShapeProps> extends Shape<T> {
13
+ private _color;
14
+ private _direction;
15
+ private _highlight;
16
+ private _highlightSecond;
17
+ private _blinkTimer?;
18
+ private _blinkIntervalTimer?;
19
+ private _isBlinkVisible;
20
+ constructor(key: string, props: T);
21
+ setShapeProps(props: Partial<ISheetHistoryArrowShapeProps>): void;
22
+ triggerDblclick(_evt: IPointerEvent | IMouseEvent): boolean;
23
+ dispose(): void;
24
+ protected _draw(ctx: CanvasRenderingContext2D): void;
25
+ private _startBlinking;
26
+ private _stopBlinking;
27
+ private _drawHorizontalArrow;
28
+ private _drawVerticalArrow;
29
+ }
@@ -0,0 +1,11 @@
1
+ import type { LocaleService, Nullable } from '@univerjs/core';
2
+ import type { IHistoryVersion } from '../services/history-fetch.service';
3
+ import type { IVersionWitDate } from './VersionListPanel';
4
+ export declare const parseDateWithLocale: (date: Nullable<number>, localeService: LocaleService) => {
5
+ date: string;
6
+ time: string;
7
+ };
8
+ export declare const parseAction: (version: IHistoryVersion, localeService: LocaleService) => string;
9
+ export declare function extractMainMutation(version: IHistoryVersion): string[];
10
+ export declare function parseDateDayWithLocale(dateString: string, localeService: LocaleService): string;
11
+ export declare function transformVersionsToDateGroup(versions?: IHistoryVersion[]): IVersionWitDate[];