@univerjs/engine-render 0.1.11 → 0.1.13
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 +2 -2
- package/lib/es/index.js +11656 -10388
- package/lib/types/base-object.d.ts +30 -22
- package/lib/types/basics/const.d.ts +7 -2
- package/lib/types/basics/group-transform.d.ts +16 -0
- package/lib/types/basics/i-document-skeleton-cached.d.ts +5 -4
- package/lib/types/basics/i-events.d.ts +9 -0
- package/lib/types/basics/index.d.ts +1 -0
- package/lib/types/basics/interfaces.d.ts +4 -9
- package/lib/types/basics/offset-rotation-axis.d.ts +3 -0
- package/lib/types/basics/tools.d.ts +34 -2
- package/lib/types/basics/transform.d.ts +8 -0
- package/lib/types/basics/transformer-config.d.ts +37 -0
- package/lib/types/basics/vector2.d.ts +44 -2
- package/lib/types/components/component.d.ts +2 -2
- package/lib/types/components/docs/doc-background.d.ts +3 -3
- package/lib/types/components/docs/doc-component.d.ts +4 -4
- package/lib/types/components/docs/document.d.ts +3 -4
- package/lib/types/components/docs/extensions/line.d.ts +1 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +2 -2
- package/lib/types/components/docs/layout/model/glyph.d.ts +1 -1
- package/lib/types/components/docs/text-selection/text-range.d.ts +6 -0
- package/lib/types/components/docs/text-selection/text-selection-render-manager.d.ts +1 -0
- package/lib/types/components/extension.d.ts +7 -2
- package/lib/types/components/sheets/column-header.d.ts +2 -2
- package/lib/types/components/sheets/extensions/background.d.ts +2 -1
- package/lib/types/components/sheets/extensions/font.d.ts +3 -2
- package/lib/types/components/sheets/extensions/marker.d.ts +1 -1
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +8 -1
- package/lib/types/components/sheets/interfaces.d.ts +47 -0
- package/lib/types/components/sheets/row-header.d.ts +2 -2
- package/lib/types/components/sheets/sheet-component.d.ts +4 -4
- package/lib/types/components/sheets/sheet-skeleton.d.ts +10 -22
- package/lib/types/components/sheets/spreadsheet.d.ts +52 -11
- package/lib/types/custom/custom-object.d.ts +2 -2
- package/lib/types/engine.d.ts +5 -0
- package/lib/types/group.d.ts +22 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/layer.d.ts +3 -3
- package/lib/types/scene-viewer.d.ts +3 -3
- package/lib/types/scene.d.ts +14 -6
- package/lib/types/scene.input-manager.d.ts +5 -0
- package/lib/types/scene.transformer.d.ts +59 -40
- package/lib/types/shape/image.d.ts +54 -0
- package/lib/types/shape/index.d.ts +1 -1
- package/lib/types/shape/regular-polygon.d.ts +4 -1
- package/lib/types/shape/rich-text.d.ts +2 -3
- package/lib/types/shape/shape.d.ts +4 -3
- package/lib/types/thin-engine.d.ts +1 -0
- package/lib/types/thin-scene.d.ts +11 -2
- package/lib/types/viewport.d.ts +134 -16
- package/lib/umd/index.js +2 -2
- package/package.json +10 -7
- package/lib/types/services/object-transform-manager.service.d.ts +0 -41
- package/lib/types/shape/picture.d.ts +0 -24
|
@@ -6,5 +6,5 @@ import { SheetExtension } from './sheet-extension';
|
|
|
6
6
|
export declare class Marker extends SheetExtension {
|
|
7
7
|
protected Z_INDEX: number;
|
|
8
8
|
uKey: string;
|
|
9
|
-
draw(ctx: UniverRenderingContext, parentScale: IScale, skeleton: SpreadsheetSkeleton, diffRanges
|
|
9
|
+
draw(ctx: UniverRenderingContext, parentScale: IScale, skeleton: SpreadsheetSkeleton, diffRanges: IRange[]): void;
|
|
10
10
|
}
|
|
@@ -8,7 +8,14 @@ export declare enum SHEET_EXTENSION_TYPE {
|
|
|
8
8
|
export declare class SheetExtension extends ComponentExtension<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
|
|
9
9
|
type: SHEET_EXTENSION_TYPE;
|
|
10
10
|
getCellIndex(rowIndex: number, columnIndex: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], dataMergeCache: IRange[]): import('@univerjs/core').ISelectionCellWithCoord;
|
|
11
|
-
isRenderDiffRangesByCell(
|
|
11
|
+
isRenderDiffRangesByCell(rangeP: IRange, diffRanges?: IRange[]): boolean;
|
|
12
12
|
isRenderDiffRangesByColumn(curStartColumn: number, curEndColumn: number, diffRanges?: IRange[]): boolean;
|
|
13
13
|
isRenderDiffRangesByRow(curStartRow: number, curEndRow: number, diffRanges?: IRange[]): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 传入的 row 范围和 diffRanges 有相交, 返回 true
|
|
16
|
+
* @param curStartRow
|
|
17
|
+
* @param curEndRow
|
|
18
|
+
* @param viewranges
|
|
19
|
+
*/
|
|
20
|
+
isRowInRanges(curStartRow: number, curEndRow: number, viewranges?: IRange[]): boolean;
|
|
14
21
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BorderStyleTypes, HorizontalAlign, ISelectionCellWithCoord, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
2
2
|
import { BORDER_TYPE } from '../../basics/const';
|
|
3
3
|
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
4
|
+
import { Canvas } from '../../canvas';
|
|
5
|
+
import { UniverRenderingContext } from '../../context';
|
|
6
|
+
import { ISheetFontRenderExtension } from './extensions';
|
|
4
7
|
|
|
5
8
|
export interface BorderCache {
|
|
6
9
|
[key: string]: BorderCacheItem | {};
|
|
@@ -34,4 +37,48 @@ export declare enum ShowGridlinesState {
|
|
|
34
37
|
OFF = 0,
|
|
35
38
|
ON = 1
|
|
36
39
|
}
|
|
40
|
+
export declare enum SHEET_VIEWPORT_KEY {
|
|
41
|
+
VIEW_MAIN = "viewMain",
|
|
42
|
+
VIEW_MAIN_LEFT_TOP = "viewMainLeftTop",
|
|
43
|
+
VIEW_MAIN_TOP = "viewMainTop",
|
|
44
|
+
VIEW_MAIN_LEFT = "viewMainLeft",
|
|
45
|
+
VIEW_ROW_TOP = "viewRowTop",
|
|
46
|
+
VIEW_ROW_BOTTOM = "viewRowBottom",
|
|
47
|
+
VIEW_COLUMN_LEFT = "viewColumnLeft",
|
|
48
|
+
VIEW_COLUMN_RIGHT = "viewColumnRight",
|
|
49
|
+
VIEW_LEFT_TOP = "viewLeftTop"
|
|
50
|
+
}
|
|
51
|
+
export interface IPaintForRefresh {
|
|
52
|
+
cacheCanvas: Canvas;
|
|
53
|
+
cacheCtx: UniverRenderingContext;
|
|
54
|
+
mainCtx: UniverRenderingContext;
|
|
55
|
+
topOrigin: number;
|
|
56
|
+
leftOrigin: number;
|
|
57
|
+
bufferEdgeX: number;
|
|
58
|
+
bufferEdgeY: number;
|
|
59
|
+
}
|
|
60
|
+
export interface IPaintForScrolling {
|
|
61
|
+
cacheCanvas: Canvas;
|
|
62
|
+
cacheCtx: UniverRenderingContext;
|
|
63
|
+
mainCtx: UniverRenderingContext;
|
|
64
|
+
topOrigin: number;
|
|
65
|
+
leftOrigin: number;
|
|
66
|
+
bufferEdgeX: number;
|
|
67
|
+
bufferEdgeY: number;
|
|
68
|
+
rowHeaderWidth: number;
|
|
69
|
+
columnHeaderHeight: number;
|
|
70
|
+
scaleX: number;
|
|
71
|
+
scaleY: number;
|
|
72
|
+
}
|
|
73
|
+
export type ISheetRenderExtension = ISheetFontRenderExtension & ISheetBackgroundRenderExtension & ISheetBorderRenderExtension;
|
|
74
|
+
export interface ISheetBackgroundRenderExtension {
|
|
75
|
+
backgroundRenderExtension?: {
|
|
76
|
+
isSkip?: boolean;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface ISheetBorderRenderExtension {
|
|
80
|
+
borderRenderExtension?: {
|
|
81
|
+
isSkip?: boolean;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
37
84
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
3
3
|
import { UniverRenderingContext } from '../../context';
|
|
4
4
|
import { RowHeaderLayout } from './extensions/row-header-layout';
|
|
5
5
|
import { SpreadsheetHeader } from './sheet-component';
|
|
@@ -22,7 +22,7 @@ export declare class SpreadsheetRowHeader extends SpreadsheetHeader {
|
|
|
22
22
|
private _rowHeaderLayoutExtension;
|
|
23
23
|
constructor(oKey: string, spreadsheetSkeleton?: SpreadsheetSkeleton);
|
|
24
24
|
get rowHeaderLayoutExtension(): RowHeaderLayout;
|
|
25
|
-
draw(ctx: UniverRenderingContext, bounds?:
|
|
25
|
+
draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
26
26
|
isHit(coord: Vector2): boolean;
|
|
27
27
|
private _initialDefaultExtension;
|
|
28
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRange, Nullable } from '@univerjs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
3
3
|
import { UniverRenderingContext } from '../../context';
|
|
4
4
|
import { RenderComponent } from '../component';
|
|
5
5
|
import { SHEET_EXTENSION_TYPE } from './extensions/sheet-extension';
|
|
@@ -10,7 +10,7 @@ export declare abstract class SheetComponent extends RenderComponent<Spreadsheet
|
|
|
10
10
|
constructor(oKey: string, _skeleton?: SpreadsheetSkeleton | undefined);
|
|
11
11
|
getSkeleton(): SpreadsheetSkeleton | undefined;
|
|
12
12
|
updateSkeleton(spreadsheetSkeleton: SpreadsheetSkeleton): void;
|
|
13
|
-
render(mainCtx: UniverRenderingContext, bounds?:
|
|
13
|
+
render(mainCtx: UniverRenderingContext, bounds?: IViewportInfo): this | undefined;
|
|
14
14
|
getParentScale(): {
|
|
15
15
|
scaleX: number;
|
|
16
16
|
scaleY: number;
|
|
@@ -32,12 +32,12 @@ export declare abstract class SheetComponent extends RenderComponent<Spreadsheet
|
|
|
32
32
|
endRow: number;
|
|
33
33
|
endColumn: number;
|
|
34
34
|
}>;
|
|
35
|
-
protected abstract _draw(ctx: UniverRenderingContext, bounds?:
|
|
35
|
+
protected abstract _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
36
36
|
/**
|
|
37
37
|
* TODO: DR-Univer, fix as unknown as
|
|
38
38
|
*/
|
|
39
39
|
dispose(): void;
|
|
40
40
|
}
|
|
41
41
|
export declare abstract class SpreadsheetHeader extends SheetComponent {
|
|
42
|
-
protected _draw(ctx: UniverRenderingContext, bounds?:
|
|
42
|
+
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
43
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy, ICellData, IPaddingData, IRange, ISelectionCellWithCoord, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet } from '@univerjs/core';
|
|
2
|
-
import { IBoundRectNoAngle,
|
|
2
|
+
import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
|
|
3
3
|
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
4
4
|
import { Skeleton } from '../skeleton';
|
|
5
5
|
import { IStylesCache } from './interfaces';
|
|
@@ -50,6 +50,9 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
50
50
|
private _columnTotalWidth;
|
|
51
51
|
private _rowHeaderWidth;
|
|
52
52
|
private _columnHeaderHeight;
|
|
53
|
+
/**
|
|
54
|
+
* skeletonData(row col range) of visible area
|
|
55
|
+
*/
|
|
53
56
|
private _rowColumnSegment;
|
|
54
57
|
private _dataMergeCache;
|
|
55
58
|
private _overflowCache;
|
|
@@ -101,30 +104,20 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
101
104
|
setOverflowCache(value: ObjectMatrix<IRange>): void;
|
|
102
105
|
setMarginLeft(left: number): void;
|
|
103
106
|
setMarginTop(top: number): void;
|
|
104
|
-
calculateSegment(bounds?:
|
|
105
|
-
calculateWithoutClearingCache(bounds?:
|
|
106
|
-
calculate(bounds?:
|
|
107
|
+
calculateSegment(bounds?: IViewportInfo): true | undefined;
|
|
108
|
+
calculateWithoutClearingCache(bounds?: IViewportInfo): this | undefined;
|
|
109
|
+
calculate(bounds?: IViewportInfo): this;
|
|
107
110
|
calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
|
|
108
111
|
private _calculateRowAutoHeight;
|
|
109
112
|
private _updateLayout;
|
|
110
113
|
private _dynamicallyUpdateRowHeaderWidth;
|
|
111
|
-
getRowColumnSegment(bounds?:
|
|
112
|
-
startRow: number;
|
|
113
|
-
endRow: number;
|
|
114
|
-
startColumn: number;
|
|
115
|
-
endColumn: number;
|
|
116
|
-
};
|
|
114
|
+
getRowColumnSegment(bounds?: IViewportInfo): IRange;
|
|
117
115
|
/**
|
|
118
116
|
* @deprecated should never expose a property that is provided by another module!
|
|
119
117
|
* @returns
|
|
120
118
|
*/
|
|
121
119
|
getWorksheetConfig(): IWorksheetData;
|
|
122
|
-
getRowColumnSegmentByViewBound(bound?: IBoundRectNoAngle):
|
|
123
|
-
startRow: number;
|
|
124
|
-
endRow: number;
|
|
125
|
-
startColumn: number;
|
|
126
|
-
endColumn: number;
|
|
127
|
-
};
|
|
120
|
+
getRowColumnSegmentByViewBound(bound?: IBoundRectNoAngle): IRange;
|
|
128
121
|
getMergeBounding(startRow: number, startColumn: number, endRow: number, endColumn: number): {
|
|
129
122
|
startRow: number;
|
|
130
123
|
startColumn: number;
|
|
@@ -284,12 +277,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
284
277
|
* @param viewBound The range of the visible area of the canvas
|
|
285
278
|
* @returns The range cell index of the canvas visible area
|
|
286
279
|
*/
|
|
287
|
-
protected _getBounding(rowHeightAccumulation: number[], columnWidthAccumulation: number[], viewBound?: IBoundRectNoAngle):
|
|
288
|
-
startRow: number;
|
|
289
|
-
endRow: number;
|
|
290
|
-
startColumn: number;
|
|
291
|
-
endColumn: number;
|
|
292
|
-
};
|
|
280
|
+
protected _getBounding(rowHeightAccumulation: number[], columnWidthAccumulation: number[], viewBound?: IBoundRectNoAngle): IRange;
|
|
293
281
|
private _generateRowMatrixCache;
|
|
294
282
|
private _generateColumnMatrixCache;
|
|
295
283
|
private _getOverflowBound;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IBoundRectNoAngle, IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
2
|
+
import { Canvas } from '../../canvas';
|
|
2
3
|
import { UniverRenderingContext } from '../../context';
|
|
3
4
|
import { Documents } from '../docs/document';
|
|
4
5
|
import { Background } from './extensions/background';
|
|
@@ -6,15 +7,15 @@ import { Border } from './extensions/border';
|
|
|
6
7
|
import { Font } from './extensions/font';
|
|
7
8
|
import { SheetComponent } from './sheet-component';
|
|
8
9
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
10
|
+
import { IPaintForRefresh, IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces';
|
|
9
11
|
|
|
10
12
|
export declare class Spreadsheet extends SheetComponent {
|
|
11
13
|
private _allowCache;
|
|
12
14
|
private _backgroundExtension;
|
|
13
15
|
private _borderExtension;
|
|
14
16
|
private _fontExtension;
|
|
15
|
-
private _cacheCanvas;
|
|
16
17
|
private _refreshIncrementalState;
|
|
17
|
-
private
|
|
18
|
+
private _dirtyBounds;
|
|
18
19
|
private _forceDisableGridlines;
|
|
19
20
|
private _documents;
|
|
20
21
|
isPrinting: boolean;
|
|
@@ -29,7 +30,14 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
29
30
|
* TODO: DR-Univer, fix as unknown as
|
|
30
31
|
*/
|
|
31
32
|
dispose(): void;
|
|
32
|
-
|
|
33
|
+
/**
|
|
34
|
+
* draw by viewport
|
|
35
|
+
* cacheBound ---> viewBound
|
|
36
|
+
* diffCacheBounds ---> diffRange
|
|
37
|
+
* @param ctx
|
|
38
|
+
* @param viewportInfo
|
|
39
|
+
*/
|
|
40
|
+
draw(ctx: UniverRenderingContext, viewportInfo: IViewportInfo): void;
|
|
33
41
|
isHit(coord: Vector2): boolean;
|
|
34
42
|
getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): {
|
|
35
43
|
startY: number;
|
|
@@ -41,6 +49,11 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
41
49
|
x: number;
|
|
42
50
|
y: number;
|
|
43
51
|
};
|
|
52
|
+
isForceDirty(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* canvas resize & zoom would call forceDirty
|
|
55
|
+
* @param state
|
|
56
|
+
*/
|
|
44
57
|
makeForceDirty(state?: boolean): void;
|
|
45
58
|
setForceDisableGridlines(disabled: boolean): void;
|
|
46
59
|
getSelectionBounding(startRow: number, startColumn: number, endRow: number, endColumn: number): {
|
|
@@ -49,20 +62,48 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
49
62
|
endRow: number;
|
|
50
63
|
endColumn: number;
|
|
51
64
|
} | undefined;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @param state
|
|
67
|
+
*/
|
|
68
|
+
makeDirty(state?: boolean): this;
|
|
69
|
+
setDirtyArea(dirtyBounds: IBoundRectNoAngle[]): void;
|
|
70
|
+
renderByViewport(mainCtx: UniverRenderingContext, viewportInfo: IViewportInfo, spreadsheetSkeleton: SpreadsheetSkeleton): void;
|
|
71
|
+
paintNewAreaForScrolling(viewportInfo: IViewportInfo, param: IPaintForScrolling): void;
|
|
72
|
+
/**
|
|
73
|
+
* Redraw the entire viewport.
|
|
74
|
+
*/
|
|
75
|
+
refreshCacheCanvas(viewportInfo: IViewportInfo, param: IPaintForRefresh): void;
|
|
76
|
+
render(mainCtx: UniverRenderingContext, viewportInfo: IViewportInfo): this | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* applyCache from cache canvas
|
|
79
|
+
* @param cacheCanvas Source Image
|
|
80
|
+
* @param ctx MainCtx
|
|
81
|
+
* @param sx
|
|
82
|
+
* @param sy
|
|
83
|
+
* @param sw
|
|
84
|
+
* @param sh
|
|
85
|
+
* @param dx
|
|
86
|
+
* @param dy
|
|
87
|
+
* @param dw
|
|
88
|
+
* @param dh
|
|
89
|
+
*/
|
|
90
|
+
protected _applyCache(cacheCanvas: Canvas, ctx: UniverRenderingContext, sx?: number, sy?: number, sw?: number, sh?: number, dx?: number, dy?: number, dw?: number, dh?: number): void;
|
|
91
|
+
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
56
92
|
private _getAncestorSize;
|
|
57
93
|
private _getAncestorParent;
|
|
58
94
|
private _initialDefaultExtension;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
95
|
+
/**
|
|
96
|
+
* draw gridlines
|
|
97
|
+
* @param ctx
|
|
98
|
+
*/
|
|
62
99
|
private _drawAuxiliary;
|
|
63
100
|
/**
|
|
64
101
|
* Clear the guide lines within a range in the table, to make room for merged cells and overflow.
|
|
65
102
|
*/
|
|
66
103
|
private _clearRectangle;
|
|
67
104
|
private _clearBackground;
|
|
105
|
+
sheetContentViewport(): SHEET_VIEWPORT_KEY[];
|
|
106
|
+
sheetHeaderViewport(): SHEET_VIEWPORT_KEY[];
|
|
107
|
+
testShowRuler(cacheCtx: UniverRenderingContext, viewportInfo: IViewportInfo): void;
|
|
108
|
+
testGetRandomLightColor(): string;
|
|
68
109
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseObject } from '../base-object';
|
|
2
|
-
import {
|
|
2
|
+
import { IViewportInfo, Vector2 } from '../basics/vector2';
|
|
3
3
|
import { UniverRenderingContext } from '../context';
|
|
4
4
|
|
|
5
5
|
export declare class CustomObject extends BaseObject {
|
|
@@ -9,6 +9,6 @@ export declare class CustomObject extends BaseObject {
|
|
|
9
9
|
toJson(): {
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
};
|
|
12
|
-
render(mainCtx: UniverRenderingContext, bounds?:
|
|
12
|
+
render(mainCtx: UniverRenderingContext, bounds?: IViewportInfo): this;
|
|
13
13
|
isHit(coord: Vector2): boolean;
|
|
14
14
|
}
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ export declare class Engine extends ThinEngine<Scene> {
|
|
|
33
33
|
private _pointerWheelEvent;
|
|
34
34
|
private _pointerEnterEvent;
|
|
35
35
|
private _pointerLeaveEvent;
|
|
36
|
+
private _dragEnterEvent;
|
|
37
|
+
private _dragLeaveEvent;
|
|
38
|
+
private _dragOverEvent;
|
|
39
|
+
private _dropEvent;
|
|
36
40
|
private _remainCapture;
|
|
37
41
|
/** previous pointer position */
|
|
38
42
|
private pointer;
|
|
@@ -98,6 +102,7 @@ export declare class Engine extends ThinEngine<Scene> {
|
|
|
98
102
|
private _measureFps;
|
|
99
103
|
private _handleKeyboardAction;
|
|
100
104
|
private _handlePointerAction;
|
|
105
|
+
private _handleDragAction;
|
|
101
106
|
private _getWheelEventName;
|
|
102
107
|
private _getPassive;
|
|
103
108
|
private _getPointerType;
|
package/lib/types/group.d.ts
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
import { BaseObject } from './base-object';
|
|
2
2
|
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
3
|
-
import {
|
|
3
|
+
import { IViewportInfo, Vector2 } from './basics/vector2';
|
|
4
4
|
import { UniverRenderingContext } from './context';
|
|
5
5
|
|
|
6
6
|
export declare class Group extends BaseObject {
|
|
7
7
|
private _objects;
|
|
8
|
+
private _selfSizeMode;
|
|
8
9
|
constructor(key?: string, ...objects: BaseObject[]);
|
|
9
10
|
get classType(): RENDER_CLASS_TYPE;
|
|
10
11
|
set cursor(val: CURSOR_TYPE);
|
|
12
|
+
getState(): import('@univerjs/core').ITransformState | {
|
|
13
|
+
left: number;
|
|
14
|
+
top: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
angle: number;
|
|
18
|
+
scaleX: number;
|
|
19
|
+
scaleY: number;
|
|
20
|
+
};
|
|
21
|
+
get width(): number;
|
|
22
|
+
get height(): number;
|
|
23
|
+
set width(val: number);
|
|
24
|
+
set height(val: number);
|
|
25
|
+
get maxZIndex(): number;
|
|
26
|
+
openSelfSizeMode(): void;
|
|
27
|
+
closeSelfSizeMode(): void;
|
|
28
|
+
reCalculateObjects(): void;
|
|
11
29
|
addObjects(...objects: BaseObject[]): void;
|
|
12
30
|
addObject(o: BaseObject | string): void;
|
|
13
31
|
removeObject(object: BaseObject | string): void;
|
|
32
|
+
removeSelfObjectAndTransform(oKey: string, width?: number, height?: number, isTransform?: boolean): void;
|
|
33
|
+
private _transformObject;
|
|
14
34
|
getObjectsByOrder(): BaseObject[];
|
|
15
35
|
getObjects(): BaseObject[];
|
|
16
|
-
render(ctx: UniverRenderingContext, bounds?:
|
|
36
|
+
render(ctx: UniverRenderingContext, bounds?: IViewportInfo): void;
|
|
17
37
|
resize(width?: number | string, height?: number | string): this;
|
|
18
38
|
scale(scaleX?: number, scaleY?: number): this;
|
|
19
39
|
skew(skewX?: number, skewY?: number): this;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -42,3 +42,4 @@ export type { IPageRenderConfig } from './components/docs/document';
|
|
|
42
42
|
export { DocumentSkeleton } from './components/docs/layout/doc-skeleton';
|
|
43
43
|
export { ThinEngine } from './thin-engine';
|
|
44
44
|
export { getCharSpaceApply, getNumberUnitValue } from './components/docs/layout/tools';
|
|
45
|
+
export { type IChangeObserverConfig } from './scene.transformer';
|
package/lib/types/layer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Disposable } from '@univerjs/core';
|
|
2
2
|
import { BaseObject } from './base-object';
|
|
3
3
|
import { UniverRenderingContext } from './context';
|
|
4
|
-
import {
|
|
4
|
+
import { Scene } from './scene';
|
|
5
5
|
|
|
6
6
|
export declare class Layer extends Disposable {
|
|
7
7
|
private _scene;
|
|
@@ -11,8 +11,8 @@ export declare class Layer extends Disposable {
|
|
|
11
11
|
private _cacheCanvas;
|
|
12
12
|
protected _dirty: boolean;
|
|
13
13
|
private _debounceDirtyFunc;
|
|
14
|
-
constructor(_scene:
|
|
15
|
-
get scene():
|
|
14
|
+
constructor(_scene: Scene, objects?: BaseObject[], _zIndex?: number, _allowCache?: boolean);
|
|
15
|
+
get scene(): Scene;
|
|
16
16
|
get zIndex(): number;
|
|
17
17
|
enableCache(): void;
|
|
18
18
|
disableCache(): void;
|
|
@@ -2,7 +2,7 @@ import { Nullable } from '@univerjs/core';
|
|
|
2
2
|
import { BaseObject } from './base-object';
|
|
3
3
|
import { RENDER_CLASS_TYPE } from './basics/const';
|
|
4
4
|
import { IObjectFullState } from './basics/interfaces';
|
|
5
|
-
import {
|
|
5
|
+
import { IViewportInfo, Vector2 } from './basics/vector2';
|
|
6
6
|
import { UniverRenderingContext } from './context';
|
|
7
7
|
import { ThinScene } from './thin-scene';
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ export declare class SceneViewer extends BaseObject {
|
|
|
12
12
|
private _allowSelectedClipElement;
|
|
13
13
|
constructor(key?: string, props?: IObjectFullState);
|
|
14
14
|
get classType(): RENDER_CLASS_TYPE;
|
|
15
|
-
render(mainCtx: UniverRenderingContext, bounds?:
|
|
15
|
+
render(mainCtx: UniverRenderingContext, bounds?: IViewportInfo): this;
|
|
16
16
|
getSubScenes(): Map<string, ThinScene>;
|
|
17
17
|
getActiveSubScene(): Nullable<ThinScene>;
|
|
18
18
|
getSubScene(sceneKey: string): ThinScene | undefined;
|
|
@@ -22,7 +22,7 @@ export declare class SceneViewer extends BaseObject {
|
|
|
22
22
|
enableSelectedClipElement(): void;
|
|
23
23
|
disableSelectedClipElement(): void;
|
|
24
24
|
allowSelectedClipElement(): boolean;
|
|
25
|
-
pick(coord: Vector2): Nullable<
|
|
25
|
+
pick(coord: Vector2): Nullable<BaseObject | ThinScene>;
|
|
26
26
|
dispose(): void;
|
|
27
27
|
private _initialProps;
|
|
28
28
|
}
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Nullable } from '@univerjs/core';
|
|
2
2
|
import { BaseObject } from './base-object';
|
|
3
3
|
import { CURSOR_TYPE } from './basics/const';
|
|
4
|
-
import { IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
|
|
4
|
+
import { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
|
|
5
5
|
import { ISceneTransformState } from './basics/interfaces';
|
|
6
6
|
import { Vector2 } from './basics/vector2';
|
|
7
7
|
import { UniverRenderingContext } from './context';
|
|
8
8
|
import { Layer } from './layer';
|
|
9
|
-
import {
|
|
9
|
+
import { Transformer } from './scene.transformer';
|
|
10
10
|
import { SceneViewer } from './scene-viewer';
|
|
11
11
|
import { ThinEngine } from './thin-engine';
|
|
12
12
|
import { ThinScene } from './thin-scene';
|
|
13
13
|
import { Viewport } from './viewport';
|
|
14
|
+
import { ITransformerConfig } from './basics/transformer-config';
|
|
14
15
|
|
|
15
16
|
export declare class Scene extends ThinScene {
|
|
16
17
|
private _parent;
|
|
@@ -26,12 +27,13 @@ export declare class Scene extends ThinScene {
|
|
|
26
27
|
* when you resize them. Instead it changes `scaleX` and `scaleY` properties.
|
|
27
28
|
*/
|
|
28
29
|
private _transformer;
|
|
29
|
-
private _transformerOpenState;
|
|
30
30
|
/** @hidden */
|
|
31
31
|
private _inputManager;
|
|
32
32
|
constructor(sceneKey: string, _parent: ThinEngine<Scene> | SceneViewer, state?: ISceneTransformState);
|
|
33
33
|
get ancestorScaleX(): number;
|
|
34
34
|
get ancestorScaleY(): number;
|
|
35
|
+
get ancestorLeft(): number;
|
|
36
|
+
get ancestorTop(): number;
|
|
35
37
|
set cursor(val: CURSOR_TYPE);
|
|
36
38
|
attachControl(hasDown?: boolean, hasUp?: boolean, hasMove?: boolean, hasWheel?: boolean): this | undefined;
|
|
37
39
|
detachControl(): this;
|
|
@@ -69,6 +71,7 @@ export declare class Scene extends ThinScene {
|
|
|
69
71
|
getAllObjectsByOrder(isDesc?: boolean): BaseObject[];
|
|
70
72
|
getAllObjectsByOrderForPick(isDesc?: boolean): BaseObject[];
|
|
71
73
|
getObject(oKey: string): BaseObject | undefined;
|
|
74
|
+
getObjectIncludeInGroup(oKey: string): BaseObject | undefined;
|
|
72
75
|
fuzzyMathObjects(oKey: string): BaseObject[];
|
|
73
76
|
addViewport(...viewport: Viewport[]): this;
|
|
74
77
|
removeViewport(key: string): Viewport | undefined;
|
|
@@ -76,9 +79,10 @@ export declare class Scene extends ThinScene {
|
|
|
76
79
|
getViewport(key: string): Viewport | undefined;
|
|
77
80
|
render(parentCtx?: UniverRenderingContext): void;
|
|
78
81
|
requestRender(parentCtx?: UniverRenderingContext): Promise<unknown>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
attachTransformerTo(o: BaseObject): void;
|
|
83
|
+
detachTransformerFrom(o: BaseObject): void;
|
|
84
|
+
initTransformer(config?: ITransformerConfig): void;
|
|
85
|
+
getTransformerByCreate(): Transformer;
|
|
82
86
|
getTransformer(): Nullable<Transformer>;
|
|
83
87
|
getActiveViewportByRelativeCoord(coord: Vector2): Viewport | undefined;
|
|
84
88
|
getActiveViewportByCoord(coord: Vector2): Viewport | undefined;
|
|
@@ -120,6 +124,10 @@ export declare class Scene extends ThinScene {
|
|
|
120
124
|
triggerPointerLeave(evt: IPointerEvent | IMouseEvent): boolean;
|
|
121
125
|
triggerPointerOver(evt: IPointerEvent | IMouseEvent): boolean;
|
|
122
126
|
triggerPointerEnter(evt: IPointerEvent | IMouseEvent): boolean;
|
|
127
|
+
triggerDragLeave(evt: IDragEvent): boolean;
|
|
128
|
+
triggerDragOver(evt: IDragEvent): boolean;
|
|
129
|
+
triggerDragEnter(evt: IDragEvent): boolean;
|
|
130
|
+
triggerDrop(evt: IDragEvent): boolean;
|
|
123
131
|
private _createDefaultLayer;
|
|
124
132
|
private _setTransForm;
|
|
125
133
|
private _getGroupCumLeftRight;
|
|
@@ -23,6 +23,10 @@ export declare class InputManager extends Disposable {
|
|
|
23
23
|
private _onMouseWheel;
|
|
24
24
|
private _onKeyDown;
|
|
25
25
|
private _onKeyUp;
|
|
26
|
+
private _onDragEnter;
|
|
27
|
+
private _onDragLeave;
|
|
28
|
+
private _onDragOver;
|
|
29
|
+
private _onDrop;
|
|
26
30
|
private _scene;
|
|
27
31
|
private _currentMouseEnterPicked;
|
|
28
32
|
private _startingPosition;
|
|
@@ -37,6 +41,7 @@ export declare class InputManager extends Disposable {
|
|
|
37
41
|
*/
|
|
38
42
|
dispose(): void;
|
|
39
43
|
mouseLeaveEnterHandler(evt: IMouseEvent): void;
|
|
44
|
+
dragLeaveEnterHandler(evt: IMouseEvent): void;
|
|
40
45
|
attachControl(hasDown?: boolean, hasUp?: boolean, hasMove?: boolean, hasWheel?: boolean, hasEnter?: boolean, hasLeave?: boolean): void;
|
|
41
46
|
/**
|
|
42
47
|
* Detaches all event handlers
|