@univerjs/engine-render 0.6.0-alpha.0 → 0.6.0-experimental.20250212-dbe9830
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 +5582 -6082
- package/lib/types/basics/const.d.ts +1 -1
- package/lib/types/basics/index.d.ts +1 -1
- package/lib/types/basics/interfaces.d.ts +9 -0
- package/lib/types/basics/tools.d.ts +9 -17
- package/lib/types/basics/unit-convert.d.ts +1 -1
- package/lib/types/components/docs/extensions/index.d.ts +1 -1
- package/lib/types/components/docs/horizon-bar.d.ts +1 -1
- package/lib/types/components/docs/layout/block/block-error.d.ts +1 -1
- package/lib/types/components/docs/layout/doc-skeleton.d.ts +1 -2
- package/lib/types/components/docs/layout/hyphenation/lang.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/af.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/as.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/be.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/bg.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/bn.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ca.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/cop.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/cs.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/cu.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/cy.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/da.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/de-1901.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/de-1996.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/de-ch-1901.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/el-monoton.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/el-polyton.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/en-gb.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/en-us.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/es.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/et.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/eu.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/fi.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/fr.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/fur.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ga.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/gl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/grc.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/gu.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/hi.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/hr.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/hsb.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/hu.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/hy.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ia.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/id.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/is.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/it.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ka.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/kmr.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/kn.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/la-x-classic.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/la-x-liturgic.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/la.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/lt.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/lv.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ml.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/mn-cyrl-x-lmc.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/mn-cyrl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/mr.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/mul-ethi.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/nb.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/nl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/nn.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/no.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/oc.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/or.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/pa.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/pi.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/pl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/pms.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/pt.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/rm.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ro.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ru.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sa.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sh-cyrl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sh-latn.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sk.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sr-cyrl.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/sv.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/ta.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/te.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/th.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/tk.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/tr.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/uk.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/patterns/zh-latn-pinyin.d.ts +1 -1
- package/lib/types/components/docs/layout/hyphenation/tools.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/break.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/classes.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/enhancers/utils.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/index.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/pairs.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/swap.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/tiny-inflate.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/trie-data.d.ts +1 -1
- package/lib/types/components/docs/layout/line-breaker/unicode-trie.d.ts +1 -1
- package/lib/types/components/docs/layout/model/table.d.ts +1 -1
- package/lib/types/components/docs/vertical-bar.d.ts +1 -1
- package/lib/types/components/index.d.ts +2 -3
- package/lib/types/components/sheets/column-header.d.ts +1 -1
- package/lib/types/components/sheets/extensions/background.d.ts +1 -1
- package/lib/types/components/sheets/extensions/border.d.ts +1 -1
- package/lib/types/components/sheets/extensions/column-header-layout.d.ts +1 -1
- package/lib/types/components/sheets/extensions/custom.d.ts +1 -1
- package/lib/types/components/sheets/extensions/font.d.ts +6 -6
- package/lib/types/components/sheets/extensions/index.d.ts +1 -1
- package/lib/types/components/sheets/extensions/marker.d.ts +1 -1
- package/lib/types/components/sheets/extensions/row-header-layout.d.ts +1 -1
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +1 -1
- package/lib/types/components/sheets/index.d.ts +2 -2
- package/lib/types/components/sheets/interfaces.d.ts +5 -2
- package/lib/types/components/sheets/row-header.d.ts +1 -1
- package/lib/types/components/sheets/sheet-component.d.ts +1 -1
- package/lib/types/components/sheets/{sheet-skeleton.d.ts → sheet.render-skeleton.d.ts} +51 -231
- package/lib/types/components/sheets/spreadsheet.d.ts +3 -8
- package/lib/types/components/slides/index.d.ts +1 -1
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/custom/custom-object.d.ts +1 -1
- package/lib/types/custom/index.d.ts +1 -1
- package/lib/types/engine.d.ts +20 -2
- package/lib/types/index.d.ts +2 -3
- package/lib/types/render-manager/render-manager.service.d.ts +2 -4
- package/lib/types/render-manager/render-unit.d.ts +20 -0
- package/lib/types/scene.d.ts +35 -8
- package/lib/types/services/render-config.d.ts +1 -1
- package/lib/types/services/render-config.service.d.ts +1 -1
- package/lib/types/shape/control.d.ts +1 -1
- package/lib/types/shape/drawing.d.ts +1 -1
- package/lib/types/shape/index.d.ts +1 -1
- package/lib/types/viewport.d.ts +9 -2
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
- package/LICENSE +0 -176
- package/lib/types/components/skeleton.d.ts +0 -13
- package/lib/types/thin-engine.d.ts +0 -32
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { ICellData, ICellDataForSheetInterceptor, ICellInfo, ICellWithCoord, IColAutoWidthInfo, IColumnRange,
|
|
1
|
+
import { DocumentDataModel, ICellData, ICellDataForSheetInterceptor, ICellInfo, ICellWithCoord, IColAutoWidthInfo, IColumnRange, IGetRowColByPosOptions, IPaddingData, IRange, IRowAutoHeightInfo, IRowRange, ISize, IStyleData, ITextRotation, Nullable, Styles, VerticalAlign, Worksheet, BooleanNumber, HorizontalAlign, IConfigService, IContextService, Injector, LocaleService, ObjectMatrix, SheetSkeleton, WrapStrategy } from '@univerjs/core';
|
|
2
2
|
import { IBoundRectNoAngle, IPoint, IViewportInfo } from '../../basics/vector2';
|
|
3
|
-
import {
|
|
4
|
-
import { Skeleton } from '../skeleton';
|
|
3
|
+
import { Scene } from '../../scene';
|
|
5
4
|
import { IFontCacheItem, IStylesCache, SHEET_VIEWPORT_KEY } from './interfaces';
|
|
6
|
-
|
|
7
|
-
* Obtain the height and width of a cell's text, taking into account scenarios with rotated text.
|
|
8
|
-
* @param documentSkeleton Data of the document's ViewModel
|
|
9
|
-
* @param angleInDegree The rotation angle of an Excel cell, it's **degree**
|
|
10
|
-
*/
|
|
11
|
-
export declare function getDocsSkeletonPageSize(documentSkeleton: DocumentSkeleton, angleInDegree?: number): Nullable<Required<ISize>>;
|
|
5
|
+
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
12
6
|
interface IRowColumnRange extends IRowRange, IColumnRange {
|
|
13
7
|
}
|
|
14
8
|
export interface IDocumentLayoutObject {
|
|
@@ -32,15 +26,6 @@ export interface ICacheItem {
|
|
|
32
26
|
bg: boolean;
|
|
33
27
|
border: boolean;
|
|
34
28
|
}
|
|
35
|
-
export interface IGetRowColByPosOptions {
|
|
36
|
-
closeFirst?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* For searchArray(rowHeightAccumulation) & searchArray(colWidthAccumulation)
|
|
39
|
-
* true means return first matched index in matched sequence.
|
|
40
|
-
* default return last index in matched sequence.
|
|
41
|
-
*/
|
|
42
|
-
firstMatch?: boolean;
|
|
43
|
-
}
|
|
44
29
|
export interface IGetPosByRowColOptions {
|
|
45
30
|
closeFirst?: boolean;
|
|
46
31
|
/**
|
|
@@ -49,18 +34,7 @@ export interface IGetPosByRowColOptions {
|
|
|
49
34
|
*/
|
|
50
35
|
firstMatch?: boolean;
|
|
51
36
|
}
|
|
52
|
-
export declare class SpreadsheetSkeleton extends
|
|
53
|
-
readonly worksheet: Worksheet;
|
|
54
|
-
private _styles;
|
|
55
|
-
private readonly _contextService;
|
|
56
|
-
private readonly _configService;
|
|
57
|
-
private _injector;
|
|
58
|
-
private _rowHeightAccumulation;
|
|
59
|
-
private _columnWidthAccumulation;
|
|
60
|
-
private _rowTotalHeight;
|
|
61
|
-
private _columnTotalWidth;
|
|
62
|
-
private _rowHeaderWidth;
|
|
63
|
-
private _columnHeaderHeight;
|
|
37
|
+
export declare class SpreadsheetSkeleton extends SheetSkeleton {
|
|
64
38
|
/**
|
|
65
39
|
* Range viewBounds. only update by viewBounds.
|
|
66
40
|
* It would change multiple times in one frame if there is multiple viewport (after freeze row&col)
|
|
@@ -76,35 +50,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
76
50
|
private _handleFontMatrix;
|
|
77
51
|
private _showGridlines;
|
|
78
52
|
private _gridlinesColor;
|
|
79
|
-
private
|
|
80
|
-
private _marginLeft;
|
|
81
|
-
private _imageCacheMap;
|
|
82
|
-
/**
|
|
83
|
-
* Whether the row style precedes the column style.
|
|
84
|
-
*/
|
|
85
|
-
private _isRowStylePrecedeColumnStyle;
|
|
86
|
-
/**
|
|
87
|
-
* Whether auto height for merged cells
|
|
88
|
-
*/
|
|
89
|
-
private _skipAutoHeightForMergedCells;
|
|
90
|
-
private _renderRawFormula;
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated avoid use `IWorksheetData` directly, use API provided by `Worksheet`, otherwise
|
|
93
|
-
* `ViewModel` will be not working.
|
|
94
|
-
*/
|
|
95
|
-
private _worksheetData;
|
|
96
|
-
private _cellData;
|
|
53
|
+
private _scene;
|
|
97
54
|
constructor(worksheet: Worksheet, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService, _injector: Injector);
|
|
98
55
|
initConfig(): void;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
get columnWidthAccumulation(): number[];
|
|
102
|
-
get columnTotalWidth(): number;
|
|
103
|
-
get rowHeaderWidth(): number;
|
|
104
|
-
get columnHeaderHeight(): number;
|
|
105
|
-
set columnHeaderHeight(value: number);
|
|
106
|
-
set rowHeaderWidth(value: number);
|
|
107
|
-
get imageCacheMap(): ImageCacheMap;
|
|
56
|
+
setScene(scene: Scene): void;
|
|
57
|
+
_updateLayout(): void;
|
|
108
58
|
/**
|
|
109
59
|
* Range of visible area(range in viewBounds)
|
|
110
60
|
*/
|
|
@@ -119,23 +69,12 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
119
69
|
get overflowCache(): ObjectMatrix<IRange>;
|
|
120
70
|
get showGridlines(): BooleanNumber;
|
|
121
71
|
get gridlinesColor(): string | undefined;
|
|
122
|
-
get mergeData(): IRange[];
|
|
123
|
-
get rowHeaderWidthAndMarginLeft(): number;
|
|
124
|
-
get columnHeaderHeightAndMarginTop(): number;
|
|
125
72
|
dispose(): void;
|
|
126
73
|
/**
|
|
127
74
|
* @deprecated should never expose a property that is provided by another module!
|
|
128
75
|
*/
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Get which Workbook and Worksheet this skeleton is attached to.
|
|
132
|
-
* @returns [unitId, sheetId]
|
|
133
|
-
*/
|
|
134
|
-
getLocation(): [string, string];
|
|
135
|
-
private _initContextListener;
|
|
76
|
+
getStyles(): Styles;
|
|
136
77
|
setOverflowCache(value: ObjectMatrix<IRange>): void;
|
|
137
|
-
setMarginLeft(left: number): void;
|
|
138
|
-
setMarginTop(top: number): void;
|
|
139
78
|
getFont(rowIndex: number, columnIndex: number): Nullable<IFontCacheItem>;
|
|
140
79
|
/**
|
|
141
80
|
* Get range in visible area (range in view bounds) and set into this._rowColumnSegment.
|
|
@@ -150,12 +89,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
150
89
|
* @param vpInfo viewBounds
|
|
151
90
|
*/
|
|
152
91
|
setStylesCache(vpInfo?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
|
|
153
|
-
/**
|
|
154
|
-
* Refresh cache after markDirty by SheetSkeletonManagerService.reCalculate()
|
|
155
|
-
* @param bounds
|
|
156
|
-
*/
|
|
157
|
-
calculate(): Nullable<SpreadsheetSkeleton>;
|
|
158
|
-
private _hasUnMergedCellInRow;
|
|
159
92
|
/**
|
|
160
93
|
* Calc all auto height by getDocsSkeletonPageSize in ranges
|
|
161
94
|
* @param ranges
|
|
@@ -176,16 +109,9 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
176
109
|
/**
|
|
177
110
|
* For _calculateColMaxWidth
|
|
178
111
|
* @param cell
|
|
179
|
-
* @returns {number}
|
|
112
|
+
* @returns {number} currColWidth
|
|
180
113
|
*/
|
|
181
114
|
_getMeasuredWidthByCell(cell: ICellDataForSheetInterceptor, currColWidth: number): number;
|
|
182
|
-
/**
|
|
183
|
-
* Calculate data for row col & cell position.
|
|
184
|
-
* This method should be called whenever a sheet is dirty.
|
|
185
|
-
* Update position value to this._rowHeaderWidth & this._rowHeightAccumulation & this._columnHeaderHeight & this._columnWidthAccumulation.
|
|
186
|
-
*/
|
|
187
|
-
private _updateLayout;
|
|
188
|
-
private _dynamicallyUpdateRowHeaderWidth;
|
|
189
115
|
/**
|
|
190
116
|
* @deprecated use `getRangeByViewport` instead.
|
|
191
117
|
* @param bounds
|
|
@@ -194,24 +120,8 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
194
120
|
getRangeByViewport(vpInfo?: IViewportInfo): IRange;
|
|
195
121
|
getCacheRangeByViewport(vpInfo?: IViewportInfo): IRange;
|
|
196
122
|
getRangeByViewBound(bound?: IBoundRectNoAngle): IRange;
|
|
197
|
-
/**
|
|
198
|
-
* @deprecated should never expose a property that is provided by another module!
|
|
199
|
-
* @returns
|
|
200
|
-
*/
|
|
201
|
-
getWorksheetConfig(): IWorksheetData;
|
|
202
|
-
getMergeBounding(startRow: number, startColumn: number, endRow: number, endColumn: number): IRange;
|
|
203
|
-
/**
|
|
204
|
-
* expand curr range if it's intersect with merge range.
|
|
205
|
-
* @param range
|
|
206
|
-
* @returns {IRange} expanded range because merge info.
|
|
207
|
-
*/
|
|
208
|
-
expandRangeByMerge(range: IRange): IRange;
|
|
209
123
|
appendToOverflowCache(row: number, column: number, startColumn: number, endColumn: number): void;
|
|
210
|
-
getColumnCount(): number;
|
|
211
|
-
getRowCount(): number;
|
|
212
124
|
getOverflowPosition(contentSize: Required<ISize>, horizontalAlign: HorizontalAlign, row: number, column: number, columnCount: number): IColumnRange;
|
|
213
|
-
getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): IPosition;
|
|
214
|
-
getNoMergeCellPositionByIndexWithNoHeader(rowIndex: number, columnIndex: number): IPosition;
|
|
215
125
|
/**
|
|
216
126
|
* Get cell by pos(offsetX, offsetY).
|
|
217
127
|
* @deprecated Please use `getCellWithCoordByOffset` instead.
|
|
@@ -220,22 +130,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
220
130
|
x: number;
|
|
221
131
|
y: number;
|
|
222
132
|
}): Nullable<ICellWithCoord>;
|
|
223
|
-
/**
|
|
224
|
-
* Get cell by pos(offsetX, offsetY).
|
|
225
|
-
*
|
|
226
|
-
* options.matchFirst true means get cell would skip all invisible cells.
|
|
227
|
-
* @param offsetX position X in viewport.
|
|
228
|
-
* @param offsetY position Y in viewport.
|
|
229
|
-
* @param scaleX render scene scale x-axis, scene.getAncestorScale
|
|
230
|
-
* @param scaleY render scene scale y-axis, scene.getAncestorScale
|
|
231
|
-
* @param scrollXY render viewportScroll {x, y}
|
|
232
|
-
* @param options {IGetRowColByPosOptions}
|
|
233
|
-
* @returns {ICellWithCoord} Selection data with coordinates
|
|
234
|
-
*/
|
|
235
|
-
getCellWithCoordByOffset(offsetX: number, offsetY: number, scaleX: number, scaleY: number, scrollXY: {
|
|
236
|
-
x: number;
|
|
237
|
-
y: number;
|
|
238
|
-
}, options?: IGetRowColByPosOptions): ICellWithCoord;
|
|
239
133
|
/**
|
|
240
134
|
* This method has the same implementation as `getCellIndexByOffset`,
|
|
241
135
|
* but uses a different name to maintain backward compatibility with previous calls.
|
|
@@ -249,28 +143,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
249
143
|
row: number;
|
|
250
144
|
column: number;
|
|
251
145
|
};
|
|
252
|
-
/**
|
|
253
|
-
* Get cell index by offset(o)
|
|
254
|
-
* @param offsetX position X in viewport.
|
|
255
|
-
* @param offsetY position Y in viewport.
|
|
256
|
-
* @param scaleX render scene scale x-axis, scene.getAncestorScale
|
|
257
|
-
* @param scaleY render scene scale y-axis, scene.getAncestorScale
|
|
258
|
-
* @param scrollXY render viewport scroll {x, y}, scene.getScrollXYByRelativeCoords, scene.getScrollXY
|
|
259
|
-
* @param scrollXY.x
|
|
260
|
-
* @param scrollXY.y
|
|
261
|
-
* @returns cell index
|
|
262
|
-
*/
|
|
263
|
-
getCellIndexByOffset(offsetX: number, offsetY: number, scaleX: number, scaleY: number, scrollXY: {
|
|
264
|
-
x: number;
|
|
265
|
-
y: number;
|
|
266
|
-
}, options?: IGetRowColByPosOptions): {
|
|
267
|
-
row: number;
|
|
268
|
-
column: number;
|
|
269
|
-
};
|
|
270
|
-
getCellByOffset(offsetX: number, offsetY: number, scaleX: number, scaleY: number, scrollXY: {
|
|
271
|
-
x: number;
|
|
272
|
-
y: number;
|
|
273
|
-
}): Nullable<ICellInfo>;
|
|
274
146
|
getCellWithMergeInfoByIndex(row: number, column: number): Nullable<ICellInfo>;
|
|
275
147
|
/**
|
|
276
148
|
* Same as getColumnIndexByOffsetX
|
|
@@ -280,17 +152,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
280
152
|
x: number;
|
|
281
153
|
y: number;
|
|
282
154
|
}, options?: IGetRowColByPosOptions): number;
|
|
283
|
-
/**
|
|
284
|
-
* Get column index by offset x.
|
|
285
|
-
* @param offsetX scaled offset x
|
|
286
|
-
* @param scaleX scale x
|
|
287
|
-
* @param scrollXY scrollXY
|
|
288
|
-
* @returns column index
|
|
289
|
-
*/
|
|
290
|
-
getColumnIndexByOffsetX(evtOffsetX: number, scaleX: number, scrollXY: {
|
|
291
|
-
x: number;
|
|
292
|
-
y: number;
|
|
293
|
-
}, options?: IGetRowColByPosOptions): number;
|
|
294
155
|
/**
|
|
295
156
|
* Same as getRowIndexByOffsetY
|
|
296
157
|
* @deprecated Please use `getRowIndexByOffsetY` method instead.
|
|
@@ -299,28 +160,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
299
160
|
x: number;
|
|
300
161
|
y: number;
|
|
301
162
|
}, options?: IGetRowColByPosOptions): number;
|
|
302
|
-
/**
|
|
303
|
-
*
|
|
304
|
-
* @param offsetY scaled offset y
|
|
305
|
-
* @param scaleY scale y
|
|
306
|
-
* @param scrollXY
|
|
307
|
-
* @param scrollXY.x
|
|
308
|
-
* @param scrollXY.y
|
|
309
|
-
*/
|
|
310
|
-
getRowIndexByOffsetY(offsetY: number, scaleY: number, scrollXY: {
|
|
311
|
-
x: number;
|
|
312
|
-
y: number;
|
|
313
|
-
}, options?: IGetRowColByPosOptions): number;
|
|
314
|
-
getTransformOffsetX(offsetX: number, scaleX: number, scrollXY: {
|
|
315
|
-
x: number;
|
|
316
|
-
y: number;
|
|
317
|
-
}): number;
|
|
318
|
-
getTransformOffsetY(offsetY: number, scaleY: number, scrollXY: {
|
|
319
|
-
x: number;
|
|
320
|
-
y: number;
|
|
321
|
-
}): number;
|
|
322
|
-
getOffsetByPositionX(column: number): number;
|
|
323
|
-
getOffsetByPositionY(row: number): number;
|
|
324
163
|
/**
|
|
325
164
|
* Same as getCellWithCoordByIndex, but uses a different name to maintain backward compatibility with previous calls.
|
|
326
165
|
* @deprecated Please use `getCellWithCoordByIndex` instead.
|
|
@@ -332,33 +171,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
332
171
|
* @param column
|
|
333
172
|
*/
|
|
334
173
|
getCellByIndexWithNoHeader(row: number, column: number): ICellWithCoord;
|
|
335
|
-
/**
|
|
336
|
-
* Return cell information corresponding to the current coordinates, including the merged cell object.
|
|
337
|
-
*
|
|
338
|
-
* @param row Specified Row Coordinate
|
|
339
|
-
* @param column Specified Column Coordinate
|
|
340
|
-
*/
|
|
341
|
-
getCellWithCoordByIndex(row: number, column: number, header?: boolean): ICellWithCoord;
|
|
342
|
-
/**
|
|
343
|
-
* convert canvas content position to physical position in screen
|
|
344
|
-
* @param offsetX
|
|
345
|
-
* @param scaleX
|
|
346
|
-
* @param scrollXY
|
|
347
|
-
*/
|
|
348
|
-
convertTransformToOffsetX(offsetX: number, scaleX: number, scrollXY: {
|
|
349
|
-
x: number;
|
|
350
|
-
y: number;
|
|
351
|
-
}): number;
|
|
352
|
-
/**
|
|
353
|
-
* convert canvas content position to physical position in screen
|
|
354
|
-
* @param offsetY
|
|
355
|
-
* @param scaleY
|
|
356
|
-
* @param scrollXY
|
|
357
|
-
*/
|
|
358
|
-
convertTransformToOffsetY(offsetY: number, scaleY: number, scrollXY: {
|
|
359
|
-
x: number;
|
|
360
|
-
y: number;
|
|
361
|
-
}): number;
|
|
362
174
|
/**
|
|
363
175
|
* Only used for cell edit, and no need to rotate text when edit cell content!
|
|
364
176
|
* @deprecated use same method in worksheet.
|
|
@@ -381,12 +193,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
381
193
|
* @param options
|
|
382
194
|
*/
|
|
383
195
|
private _getCellDocumentModel;
|
|
384
|
-
getDecomposedOffset(offsetX: number, offsetY: number): {
|
|
385
|
-
row: number;
|
|
386
|
-
column: number;
|
|
387
|
-
columnOffset: number;
|
|
388
|
-
rowOffset: number;
|
|
389
|
-
};
|
|
390
196
|
/**
|
|
391
197
|
* Calculate the overflow of cell text. If there is no value on either side of the cell,
|
|
392
198
|
* the text content of this cell can be drawn to both sides, not limited by the cell's width.
|
|
@@ -401,16 +207,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
401
207
|
* @returns The range cell index of the canvas visible area
|
|
402
208
|
*/
|
|
403
209
|
protected _getRangeByViewBounding(rowHeightAccumulation: number[], columnWidthAccumulation: number[], viewBound?: IBoundRectNoAngle): IRange;
|
|
404
|
-
private _generateRowMatrixCache;
|
|
405
|
-
/**
|
|
406
|
-
* Calc columnWidthAccumulation by columnData
|
|
407
|
-
* @param colCount
|
|
408
|
-
* @param columnData
|
|
409
|
-
* @param defaultColumnWidth
|
|
410
|
-
*/
|
|
411
|
-
private _generateColumnMatrixCache;
|
|
412
|
-
private _getOverflowBound;
|
|
413
|
-
intersectMergeRange(row: number, column: number): boolean;
|
|
414
210
|
/**
|
|
415
211
|
* Get the current row and column segment visible merge data.
|
|
416
212
|
* @returns {IRange} The visible merge data
|
|
@@ -420,7 +216,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
420
216
|
/**
|
|
421
217
|
* Any changes to sheet model would reset cache.
|
|
422
218
|
*/
|
|
423
|
-
|
|
219
|
+
_resetCache(): void;
|
|
424
220
|
_setBorderStylesCache(row: number, col: number, style: Nullable<IStyleData>, options: {
|
|
425
221
|
mergeRange?: IRange;
|
|
426
222
|
cacheItem?: ICacheItem;
|
|
@@ -429,7 +225,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
429
225
|
mergeRange?: IRange;
|
|
430
226
|
cacheItem?: ICacheItem;
|
|
431
227
|
} | undefined): void;
|
|
432
|
-
_setFontStylesCache(row: number, col: number,
|
|
228
|
+
_setFontStylesCache(row: number, col: number, cellData: Nullable<ICellDataForSheetInterceptor>): void;
|
|
433
229
|
/**
|
|
434
230
|
* Set border background and font to this._stylesCache cell by cell.
|
|
435
231
|
* @param row {number}
|
|
@@ -437,32 +233,56 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
437
233
|
* @param options {{ mergeRange: IRange; cacheItem: ICacheItem } | undefined}
|
|
438
234
|
*/
|
|
439
235
|
private _setStylesCacheForOneCell;
|
|
440
|
-
private _updateConfigAndGetDocumentModel;
|
|
441
236
|
/**
|
|
442
237
|
* pro/issues/344
|
|
443
238
|
* In Excel, for the border rendering of merged cells to take effect, the outermost cells need to have the same border style.
|
|
444
239
|
*/
|
|
445
240
|
private _setMergeBorderProps;
|
|
446
241
|
private _setBorderProps;
|
|
447
|
-
/**
|
|
448
|
-
* New version to get merge data.
|
|
449
|
-
* @param row
|
|
450
|
-
* @param column
|
|
451
|
-
* @returns {ISelectionCell} The cell info with merge data
|
|
452
|
-
*/
|
|
453
|
-
private _getCellMergeInfo;
|
|
454
242
|
getDistanceFromTopLeft(row: number, col: number): IPoint;
|
|
243
|
+
colStartX(col: number): number;
|
|
244
|
+
rowStartY(row: number): number;
|
|
245
|
+
getHiddenRowsInRange(range: IRowRange): number[];
|
|
246
|
+
getHiddenColumnsInRange(range: IColumnRange): number[];
|
|
455
247
|
/**
|
|
456
|
-
*
|
|
457
|
-
* @param row
|
|
248
|
+
* @deprecated use function `convertTransformToOffsetX` in same package.
|
|
458
249
|
*/
|
|
459
|
-
|
|
250
|
+
convertTransformToOffsetX(offsetX: number, scaleX: number, scrollXY: {
|
|
251
|
+
x: number;
|
|
252
|
+
y: number;
|
|
253
|
+
}): number;
|
|
460
254
|
/**
|
|
461
|
-
*
|
|
462
|
-
* @param col
|
|
255
|
+
* @deprecated use function `convertTransformToOffsetY` in same package.
|
|
463
256
|
*/
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
257
|
+
convertTransformToOffsetY(offsetY: number, scaleY: number, scrollXY: {
|
|
258
|
+
x: number;
|
|
259
|
+
y: number;
|
|
260
|
+
}): number;
|
|
467
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* convert canvas content position to physical position in screen
|
|
264
|
+
* @param offsetX
|
|
265
|
+
* @param scaleX
|
|
266
|
+
* @param scrollXY
|
|
267
|
+
*/
|
|
268
|
+
export declare function convertTransformToOffsetX(offsetX: number, scaleX: number, scrollXY: {
|
|
269
|
+
x: number;
|
|
270
|
+
y: number;
|
|
271
|
+
}): number;
|
|
272
|
+
/**
|
|
273
|
+
* convert canvas content position to physical position in screen
|
|
274
|
+
* @param offsetY
|
|
275
|
+
* @param scaleY
|
|
276
|
+
* @param scrollXY
|
|
277
|
+
*/
|
|
278
|
+
export declare function convertTransformToOffsetY(offsetY: number, scaleY: number, scrollXY: {
|
|
279
|
+
x: number;
|
|
280
|
+
y: number;
|
|
281
|
+
}): number;
|
|
282
|
+
/**
|
|
283
|
+
* Obtain the height and width of a cell's text, taking into account scenarios with rotated text.
|
|
284
|
+
* @param documentSkeleton Data of the document's ViewModel
|
|
285
|
+
* @param angleInDegree The rotation angle of an Excel cell, it's **degree**
|
|
286
|
+
*/
|
|
287
|
+
export declare function getDocsSkeletonPageSize(documentSkeleton: DocumentSkeleton, angleInDegree?: number): Nullable<Required<ISize>>;
|
|
468
288
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRange } from '@univerjs/core';
|
|
1
|
+
import { IPosition, IRange } from '@univerjs/core';
|
|
2
2
|
import { IBoundRectNoAngle, IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
3
3
|
import { Canvas } from '../../canvas';
|
|
4
4
|
import { UniverRenderingContext2D } from '../../context';
|
|
@@ -7,7 +7,7 @@ import { Background } from './extensions/background';
|
|
|
7
7
|
import { Border } from './extensions/border';
|
|
8
8
|
import { Font } from './extensions/font';
|
|
9
9
|
import { IPaintForRefresh, IPaintForScrolling } from './interfaces';
|
|
10
|
-
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
10
|
+
import { SpreadsheetSkeleton } from './sheet.render-skeleton';
|
|
11
11
|
import { Documents } from '../docs/document';
|
|
12
12
|
import { SheetComponent } from './sheet-component';
|
|
13
13
|
export declare class Spreadsheet extends SheetComponent {
|
|
@@ -42,12 +42,7 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
42
42
|
*/
|
|
43
43
|
getScene(): Scene;
|
|
44
44
|
isHit(coord: Vector2): boolean;
|
|
45
|
-
getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number):
|
|
46
|
-
startY: number;
|
|
47
|
-
endY: number;
|
|
48
|
-
startX: number;
|
|
49
|
-
endX: number;
|
|
50
|
-
} | undefined;
|
|
45
|
+
getNoMergeCellPositionByIndex(rowIndex: number, columnIndex: number): IPosition;
|
|
51
46
|
getScrollXYByRelativeCoords(coord: Vector2): {
|
|
52
47
|
x: number;
|
|
53
48
|
y: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseObject } from '../base-object';
|
|
2
1
|
import { IViewportInfo, Vector2 } from '../basics/vector2';
|
|
3
2
|
import { UniverRenderingContext } from '../context';
|
|
3
|
+
import { BaseObject } from '../base-object';
|
|
4
4
|
export declare class CustomObject extends BaseObject {
|
|
5
5
|
private _render;
|
|
6
6
|
private _isHitCustom?;
|
package/lib/types/engine.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
1
2
|
import { IEvent } from './basics/i-events';
|
|
2
3
|
import { ITimeMetric, ITransformChangeState } from './basics/interfaces';
|
|
3
4
|
import { IBasicFrameInfo } from './basics/performance-monitor';
|
|
4
5
|
import { Scene } from './scene';
|
|
5
6
|
import { Disposable, EventSubject } from '@univerjs/core';
|
|
6
7
|
import { Observable, Subject } from 'rxjs';
|
|
7
|
-
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
8
8
|
import { Canvas, CanvasRenderMode } from './canvas';
|
|
9
9
|
export interface IEngineOption {
|
|
10
10
|
elementWidth: number;
|
|
@@ -101,7 +101,25 @@ export declare class Engine extends Disposable {
|
|
|
101
101
|
*/
|
|
102
102
|
setCapture(): void;
|
|
103
103
|
getPixelRatio(): number;
|
|
104
|
-
|
|
104
|
+
private _resizeListenerDisposable;
|
|
105
|
+
/**
|
|
106
|
+
* Mount the canvas to the element so it would be rendered on UI.
|
|
107
|
+
* @param {HTMLElement} element - The element the canvas will mount on.
|
|
108
|
+
* @param {true} [resize] If should perform resize when mounted and observe resize event.
|
|
109
|
+
*/
|
|
110
|
+
mount(element: HTMLElement, resize?: boolean): void;
|
|
111
|
+
/**
|
|
112
|
+
* Unmount the canvas without disposing it so it can be mounted again.
|
|
113
|
+
*/
|
|
114
|
+
unmount(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Mount the canvas to the element so it would be rendered on UI.
|
|
117
|
+
* @deprecated Please use `mount` instead.
|
|
118
|
+
* @param {HTMLElement} element - The element the canvas will mount on.
|
|
119
|
+
* @param {true} [resize] If should perform resize when mounted and observe resize event.
|
|
120
|
+
*/
|
|
121
|
+
setContainer(element: HTMLElement, resize?: boolean): void;
|
|
122
|
+
private _clearResizeListener;
|
|
105
123
|
resize(): void;
|
|
106
124
|
dprChange(): void;
|
|
107
125
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2023-present DreamNum
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -33,7 +33,7 @@ export { DocumentViewModel } from './components/docs/view-model/document-view-mo
|
|
|
33
33
|
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
|
|
34
34
|
export { parseDataStreamToTree } from './components/docs/view-model/document-view-model';
|
|
35
35
|
export { getLastColumn } from './components/docs/layout/tools';
|
|
36
|
-
export { DEFAULT_PADDING_DATA } from './components/sheets/sheet-skeleton';
|
|
36
|
+
export { DEFAULT_PADDING_DATA } from './components/sheets/sheet.render-skeleton';
|
|
37
37
|
export * from './context';
|
|
38
38
|
export * from './custom';
|
|
39
39
|
export * from './engine';
|
|
@@ -47,5 +47,4 @@ export { type IChangeObserverConfig } from './scene.transformer';
|
|
|
47
47
|
export * from './scene-viewer';
|
|
48
48
|
export * from './scroll-timer';
|
|
49
49
|
export * from './shape';
|
|
50
|
-
export { ThinEngine } from './thin-engine';
|
|
51
50
|
export * from './viewport';
|
|
@@ -4,12 +4,12 @@ import { BaseObject } from '../base-object';
|
|
|
4
4
|
import { DocComponent } from '../components/docs/doc-component';
|
|
5
5
|
import { SheetComponent } from '../components/sheets/sheet-component';
|
|
6
6
|
import { Slide } from '../components/slides/slide';
|
|
7
|
-
import { Engine } from '../engine';
|
|
8
7
|
import { IRender, RenderUnit } from './render-unit';
|
|
8
|
+
import { Engine } from '../engine';
|
|
9
9
|
export type RenderComponentType = SheetComponent | DocComponent | Slide | BaseObject;
|
|
10
10
|
export interface IRenderManagerService extends IDisposable {
|
|
11
|
-
/** @deprecated */
|
|
12
11
|
currentRender$: Observable<Nullable<string>>;
|
|
12
|
+
getCurrent(): Nullable<IRender>;
|
|
13
13
|
addRender(unitId: string, renderer: IRender): void;
|
|
14
14
|
/**
|
|
15
15
|
* create renderUnit & init deps from renderDependencies by renderUnit's type.
|
|
@@ -39,8 +39,6 @@ export interface IRenderManagerService extends IDisposable {
|
|
|
39
39
|
create(unitId: string): void;
|
|
40
40
|
created$: Observable<IRender>;
|
|
41
41
|
disposed$: Observable<string>;
|
|
42
|
-
/** @deprecated There will be multi units to render at the same time, so there is no *current*. */
|
|
43
|
-
getCurrent(): Nullable<IRender>;
|
|
44
42
|
/** @deprecated There will be multi units to render at the same time, so there is no *first*. */
|
|
45
43
|
getFirst(): Nullable<IRender>;
|
|
46
44
|
has(unitId: string): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, UnitType, UniverInstanceType, Disposable, Injector } from '@univerjs/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import { Engine } from '../engine';
|
|
3
4
|
import { Scene } from '../scene';
|
|
4
5
|
import { RenderComponentType } from './render-manager.service';
|
|
@@ -16,8 +17,23 @@ export interface IRender {
|
|
|
16
17
|
components: Map<string, RenderComponentType>;
|
|
17
18
|
isMainScene: boolean;
|
|
18
19
|
isThumbNail?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the render unit is activated. It should emit value when subscribed immediately.
|
|
22
|
+
* When created, the render unit is activated by default.
|
|
23
|
+
*/
|
|
24
|
+
activated$: Observable<boolean>;
|
|
19
25
|
with<T>(dependency: DependencyIdentifier<T>): T;
|
|
20
26
|
getRenderContext?(): IRenderContext;
|
|
27
|
+
/**
|
|
28
|
+
* Deactivate the render unit, means the render unit would be freezed and not updated,
|
|
29
|
+
* even removed from the webpage. However, the render unit is still in the memory and
|
|
30
|
+
* could be activated again.
|
|
31
|
+
*/
|
|
32
|
+
deactivate(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Activate the render unit, means the render unit would be updated and rendered.
|
|
35
|
+
*/
|
|
36
|
+
activate(): void;
|
|
21
37
|
}
|
|
22
38
|
/**
|
|
23
39
|
* Every render module should implement this interface.
|
|
@@ -38,6 +54,8 @@ export interface IRenderContext<T extends UnitModel = UnitModel> extends Omit<IR
|
|
|
38
54
|
*/
|
|
39
55
|
export declare class RenderUnit extends Disposable implements IRender {
|
|
40
56
|
readonly isRenderUnit: boolean;
|
|
57
|
+
private readonly _activated$;
|
|
58
|
+
readonly activated$: Observable<boolean>;
|
|
41
59
|
get unitId(): string;
|
|
42
60
|
get type(): UnitType;
|
|
43
61
|
private readonly _injector;
|
|
@@ -64,4 +82,6 @@ export declare class RenderUnit extends Disposable implements IRender {
|
|
|
64
82
|
addRenderDependencies(dependencies: Dependency[]): void;
|
|
65
83
|
private _initDependencies;
|
|
66
84
|
getRenderContext(): IRenderContext;
|
|
85
|
+
activate(): void;
|
|
86
|
+
deactivate(): void;
|
|
67
87
|
}
|