@univerjs/core 0.6.3 → 0.6.4
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.
|
@@ -10,6 +10,10 @@ export interface IUndoRedoItem {
|
|
|
10
10
|
unitID: string;
|
|
11
11
|
undoMutations: IMutationInfo[];
|
|
12
12
|
redoMutations: IMutationInfo[];
|
|
13
|
+
/**
|
|
14
|
+
* sometimes we need an id to mark the undo-redo item
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
13
17
|
}
|
|
14
18
|
export interface IUndoRedoService {
|
|
15
19
|
undoRedoStatus$: Observable<IUndoRedoStatus>;
|
|
@@ -20,6 +24,7 @@ export interface IUndoRedoService {
|
|
|
20
24
|
pitchTopRedoElement(): Nullable<IUndoRedoItem>;
|
|
21
25
|
popUndoToRedo(): void;
|
|
22
26
|
popRedoToUndo(): void;
|
|
27
|
+
rollback(id: string, unitId?: string): void;
|
|
23
28
|
clearUndoRedo(unitId: string): void;
|
|
24
29
|
/**
|
|
25
30
|
* Batch undo redo elements into a single `IUndoRedoItem` util the returned `IDisposable` is called.
|
|
@@ -90,6 +95,7 @@ export declare class LocalUndoRedoService extends Disposable implements IUndoRed
|
|
|
90
95
|
private _pitchRedoElement;
|
|
91
96
|
popUndoToRedo(): void;
|
|
92
97
|
popRedoToUndo(): void;
|
|
98
|
+
rollback(id: string, unitID?: string): void;
|
|
93
99
|
__tempBatchingUndoRedo(unitId: string): IDisposable;
|
|
94
100
|
protected _updateStatus(): void;
|
|
95
101
|
protected _getUndoStack(unitId: string): IUndoRedoItem[] | null;
|
|
@@ -72,6 +72,25 @@ export declare class Rectangle {
|
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
74
|
static intersects(src: IRange, target: IRange): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Checks if any of the ranges in the target array intersect with any of the ranges in the source array.
|
|
77
|
+
* Attention! Please make sure there is no NaN in the ranges.
|
|
78
|
+
* @param src
|
|
79
|
+
* @param target
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const ranges1 = [
|
|
83
|
+
* { startRow: 0, startColumn: 0, endRow: 2, endColumn: 2 },
|
|
84
|
+
* { startRow: 3, startColumn: 3, endRow: 5, endColumn: 5 }
|
|
85
|
+
* ];
|
|
86
|
+
* const ranges2 = [
|
|
87
|
+
* { startRow: 1, startColumn: 1, endRow: 4, endColumn: 4 },
|
|
88
|
+
* { startRow: 6, startColumn: 6, endRow: 8, endColumn: 8 }
|
|
89
|
+
* ];
|
|
90
|
+
* const doIntersect = Rectangle.doAnyRangesIntersect(ranges1, ranges2); // true
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
static doAnyRangesIntersect(src: IRange[], target: IRange[]): boolean;
|
|
75
94
|
/**
|
|
76
95
|
* Gets the intersection range between two ranges
|
|
77
96
|
* @param src
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IInterceptor } from '../common/interceptor';
|
|
2
2
|
import { Nullable, ObjectMatrix } from '../shared';
|
|
3
|
+
import { BooleanNumber, HorizontalAlign, TextDirection, VerticalAlign, WrapStrategy, CellValueType } from '../types/enum';
|
|
3
4
|
import { IPaddingData, IStyleData, ITextRotation } from '../types/interfaces';
|
|
4
5
|
import { Styles } from './styles';
|
|
5
6
|
import { CustomData, ICellData, ICellDataForSheetInterceptor, ICellDataWithSpanAndDisplay, IFreeze, IRange, ISelectionCell, IWorksheetData, CellModeEnum } from './typedef';
|
|
6
7
|
import { DocumentDataModel } from '../docs';
|
|
7
|
-
import { BooleanNumber, CellValueType, HorizontalAlign, TextDirection, VerticalAlign, WrapStrategy } from '../types/enum';
|
|
8
8
|
import { ColumnManager } from './column-manager';
|
|
9
9
|
import { Range } from './range';
|
|
10
10
|
import { RowManager } from './row-manager';
|