@univerjs/engine-render 0.2.13 → 0.2.15
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 +360 -408
- package/lib/types/basics/i-document-skeleton-cached.d.ts +0 -1
- package/lib/types/basics/tools.d.ts +14 -20
- package/lib/types/components/docs/extensions/font-and-base-line.d.ts +1 -1
- package/lib/types/components/docs/layout/block/paragraph/layout-ruler.d.ts +1 -1
- package/lib/types/components/docs/layout/model/glyph.d.ts +1 -1
- package/lib/types/components/sheets/extensions/sheet-extension.d.ts +1 -0
- package/lib/types/components/sheets/sheet-skeleton.d.ts +6 -4
- package/lib/types/shape/base-scroll-bar.d.ts +2 -2
- package/lib/types/shape/scroll-bar.d.ts +3 -3
- package/lib/types/thin-scene.d.ts +4 -4
- package/lib/types/viewport.d.ts +5 -16
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
|
@@ -166,7 +166,6 @@ export interface IDocumentSkeletonBullet {
|
|
|
166
166
|
ts: ITextStyle;
|
|
167
167
|
fontStyle?: IDocumentSkeletonFontStyle;
|
|
168
168
|
startIndexItem: number;
|
|
169
|
-
bBox: IDocumentSkeletonBoundingBox;
|
|
170
169
|
nestingLevel?: INestingLevel;
|
|
171
170
|
bulletAlign?: BulletAlignment;
|
|
172
171
|
bulletType?: boolean;
|
|
@@ -71,28 +71,22 @@ export declare function getCellPositionByIndex(row: number, column: number, rowH
|
|
|
71
71
|
startX: number;
|
|
72
72
|
endX: number;
|
|
73
73
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
endColumn: number;
|
|
88
|
-
startY: number;
|
|
89
|
-
endY: number;
|
|
90
|
-
startX: number;
|
|
91
|
-
endX: number;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
74
|
+
/**
|
|
75
|
+
* @description Get the cell position information of the specified row and column, including the position information of the cell and the merge information of the cell
|
|
76
|
+
* @param {number} row The row index of the cell
|
|
77
|
+
* @param {number} column The column index of the cell
|
|
78
|
+
* @param {number[]} rowHeightAccumulation The accumulated height of each row
|
|
79
|
+
* @param {number[]} columnWidthAccumulation The accumulated width of each column
|
|
80
|
+
* @param {ISelectionCell} mergeData The merge information of the cell
|
|
81
|
+
* @returns {ISelectionCellWithMergeInfo} The cell position information of the specified row and column, including the position information of the cell and the merge information of the cell
|
|
82
|
+
*/
|
|
83
|
+
export declare function getCellByIndexWithMergeInfo(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeDataInfo: ISelectionCell): ISelectionCellWithMergeInfo;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated please use getCellByIndexWithMergeInfo instead
|
|
86
|
+
*/
|
|
94
87
|
export declare function getCellByIndex(row: number, column: number, rowHeightAccumulation: number[], columnWidthAccumulation: number[], mergeData: IRange[]): ISelectionCellWithMergeInfo;
|
|
95
88
|
/**
|
|
89
|
+
* @deprecated please use _hasUnMergedCellInRow in SpreadsheetSkeleton
|
|
96
90
|
* Determine whether there are any cells in a row that are not in the merged cells, mainly used for the calculation of auto height
|
|
97
91
|
*/
|
|
98
92
|
export declare function hasUnMergedCellInRow(row: number, startColumn: number, endColumn: number, mergeData: IRange[]): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IScale } from '@univerjs/core';
|
|
2
|
+
import { docExtension } from '../doc-extension';
|
|
2
3
|
import { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
|
|
3
4
|
import { UniverRenderingContext } from '../../../context';
|
|
4
|
-
import { docExtension } from '../doc-extension';
|
|
5
5
|
export declare class FontAndBaseLine extends docExtension {
|
|
6
6
|
uKey: string;
|
|
7
7
|
Z_INDEX: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { BreakPointType } from '../../line-breaker/break';
|
|
1
2
|
import { IDocumentSkeletonDrawing, IDocumentSkeletonGlyph, IDocumentSkeletonLine, IDocumentSkeletonPage } from '../../../../../basics/i-document-skeleton-cached';
|
|
2
3
|
import { IParagraphConfig, ISectionBreakConfig } from '../../../../../basics/interfaces';
|
|
3
4
|
import { ILayoutContext } from '../../tools';
|
|
4
|
-
import { BreakPointType } from '../../line-breaker/break';
|
|
5
5
|
export declare function layoutParagraph(ctx: ILayoutContext, glyphGroup: IDocumentSkeletonGlyph[], pages: IDocumentSkeletonPage[], sectionBreakConfig: ISectionBreakConfig, paragraphConfig: IParagraphConfig, isParagraphFirstShapedText: boolean, breakPointType?: BreakPointType): IDocumentSkeletonPage[];
|
|
6
6
|
export declare function updateInlineDrawingPosition(line: IDocumentSkeletonLine, paragraphInlineSkeDrawings?: Map<string, IDocumentSkeletonDrawing>, blockAnchorTop?: number): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph
|
|
1
|
+
import { GlyphType, IAdjustability, IDocumentSkeletonBullet, IDocumentSkeletonDivide, IDocumentSkeletonGlyph } from '../../../../basics/i-document-skeleton-cached';
|
|
2
2
|
import { IFontCreateConfig } from '../../../../basics/interfaces';
|
|
3
3
|
import { IOpenTypeGlyphInfo } from '../shaping-engine/text-shaping';
|
|
4
4
|
export declare function isSpace(char: string): boolean;
|
|
@@ -11,6 +11,7 @@ export declare const SHEET_EXTENSION_PREFIX = "sheet-ext-";
|
|
|
11
11
|
export declare class SheetExtension extends ComponentExtension<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
|
|
12
12
|
type: SHEET_EXTENSION_TYPE;
|
|
13
13
|
/**
|
|
14
|
+
* @deprecated The function maybe cause performance issue, use spreadsheetSkeleton.getCellByIndexWithNoHeader instead.
|
|
14
15
|
* Get ISelectionCellWithMergeInfo by cell rowIndex and cell columnIndex.
|
|
15
16
|
* The startXY in return value does not include rowHeader and columnHeader.
|
|
16
17
|
* @param rowIndex
|
|
@@ -52,8 +52,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
52
52
|
* Range of visible area(range in viewBounds)
|
|
53
53
|
*/
|
|
54
54
|
private _rowColumnSegment;
|
|
55
|
-
private _dataMergeCache;
|
|
56
|
-
private _dataMergeCacheMap;
|
|
57
55
|
private _overflowCache;
|
|
58
56
|
private _stylesCache;
|
|
59
57
|
/** A matrix to store if a (row, column) position has render cache. */
|
|
@@ -78,7 +76,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
78
76
|
* Range of visible area(range in viewBounds)
|
|
79
77
|
*/
|
|
80
78
|
get rowColumnSegment(): IRowColumnRange;
|
|
81
|
-
get dataMergeCache(): IRange[];
|
|
82
79
|
get stylesCache(): IStylesCache;
|
|
83
80
|
get overflowCache(): ObjectMatrix<IRange>;
|
|
84
81
|
get showGridlines(): BooleanNumber;
|
|
@@ -109,6 +106,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
109
106
|
calculateWithoutClearingCache(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
|
|
110
107
|
calculate(bounds?: IViewportInfo): Nullable<SpreadsheetSkeleton>;
|
|
111
108
|
calculateAutoHeightInRange(ranges: Nullable<IRange[]>): IRowAutoHeightInfo[];
|
|
109
|
+
private _hasUnMergedCellInRow;
|
|
112
110
|
private _calculateRowAutoHeight;
|
|
113
111
|
/**
|
|
114
112
|
* Calculate data for row col & cell position, then update position value to this._rowHeaderWidth & this._rowHeightAccumulation & this._columnHeaderHeight & this._columnWidthAccumulation.
|
|
@@ -238,6 +236,11 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
238
236
|
private _generateColumnMatrixCache;
|
|
239
237
|
private _getOverflowBound;
|
|
240
238
|
intersectMergeRange(row: number, column: number): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* get the current row and column segment visible merge data
|
|
241
|
+
* @returns {IRange} The visible merge data
|
|
242
|
+
*/
|
|
243
|
+
getCurrentRowColumnSegmentMergeData(range?: IRange): IRange[];
|
|
241
244
|
private _calculateStylesCache;
|
|
242
245
|
/**
|
|
243
246
|
* Any changes to sheet model would reset cache.
|
|
@@ -262,7 +265,6 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
262
265
|
private _setBorderProps;
|
|
263
266
|
private _getFontFormat;
|
|
264
267
|
private _getOtherStyle;
|
|
265
|
-
private _getMergeCellsCache;
|
|
266
268
|
private _getCellMergeInfo;
|
|
267
269
|
/**
|
|
268
270
|
* Cache the merged cells on the current screen to improve computational performance.
|
|
@@ -26,9 +26,9 @@ export declare abstract class BaseScrollBar extends Disposable {
|
|
|
26
26
|
verticalThumbHeight: number;
|
|
27
27
|
verticalBarHeight: number;
|
|
28
28
|
verticalMinusMiniThumb: number;
|
|
29
|
-
|
|
29
|
+
horizonScrollTrack: Nullable<Rect>;
|
|
30
30
|
horizonThumbRect: Nullable<Rect>;
|
|
31
|
-
|
|
31
|
+
verticalScrollTrack: Nullable<Rect>;
|
|
32
32
|
verticalThumbRect: Nullable<Rect>;
|
|
33
33
|
placeholderBarRect: Nullable<Rect>;
|
|
34
34
|
get limitX(): number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { BaseScrollBar, IScrollBarProps } from './base-scroll-bar';
|
|
2
|
+
import { Rect } from './rect';
|
|
1
3
|
import { Vector2 } from '../basics/vector2';
|
|
2
4
|
import { UniverRenderingContext } from '../context';
|
|
3
5
|
import { Viewport } from '../viewport';
|
|
4
|
-
import { IScrollBarProps, BaseScrollBar } from './base-scroll-bar';
|
|
5
|
-
import { Rect } from './rect';
|
|
6
6
|
export declare class ScrollBar extends BaseScrollBar {
|
|
7
|
-
protected
|
|
7
|
+
protected _viewport: Viewport;
|
|
8
8
|
private _mainScene;
|
|
9
9
|
private _lastX;
|
|
10
10
|
private _lastY;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Disposable, EventSubject, Nullable } from '@univerjs/core';
|
|
2
|
+
import { RENDER_CLASS_TYPE, CURSOR_TYPE } from './basics/const';
|
|
3
|
+
import { Transform } from './basics/transform';
|
|
2
4
|
import { BaseObject } from './base-object';
|
|
3
|
-
import { CURSOR_TYPE, RENDER_CLASS_TYPE } from './basics/const';
|
|
4
5
|
import { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events';
|
|
5
6
|
import { ITransformChangeState } from './basics/interfaces';
|
|
6
|
-
import { Transform } from './basics/transform';
|
|
7
7
|
import { Vector2 } from './basics/vector2';
|
|
8
8
|
import { UniverRenderingContext } from './context';
|
|
9
|
-
import { ThinEngine } from './thin-engine';
|
|
10
9
|
import { Scene } from './scene';
|
|
10
|
+
import { ThinEngine } from './thin-engine';
|
|
11
11
|
export declare abstract class ThinScene extends Disposable {
|
|
12
12
|
onTransformChange$: EventSubject<ITransformChangeState>;
|
|
13
13
|
onFileLoaded$: EventSubject<string>;
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -87,7 +87,6 @@ export declare class Viewport {
|
|
|
87
87
|
private _sceneHeightAfterScale;
|
|
88
88
|
onMouseWheel$: EventSubject<IWheelEvent>;
|
|
89
89
|
onScrollAfter$: EventSubject<IScrollObserverParam>;
|
|
90
|
-
onScrollBefore$: EventSubject<IScrollObserverParam>;
|
|
91
90
|
onScrollEnd$: EventSubject<IScrollObserverParam>;
|
|
92
91
|
onScrollByBar$: EventSubject<IScrollObserverParam>;
|
|
93
92
|
private _viewportKey;
|
|
@@ -234,7 +233,7 @@ export declare class Viewport {
|
|
|
234
233
|
isLimitedY: boolean;
|
|
235
234
|
} | undefined;
|
|
236
235
|
/**
|
|
237
|
-
*
|
|
236
|
+
* Srolling by current position plus delta.
|
|
238
237
|
* the most common case is triggered by scroll-timer(in sheet)
|
|
239
238
|
* @param delta
|
|
240
239
|
* @returns isLimited
|
|
@@ -245,7 +244,6 @@ export declare class Viewport {
|
|
|
245
244
|
isLimitedX: boolean;
|
|
246
245
|
isLimitedY: boolean;
|
|
247
246
|
} | undefined;
|
|
248
|
-
scrollByBar(delta: Partial<IScrollBarPosition>, isTrigger?: boolean): void;
|
|
249
247
|
/**
|
|
250
248
|
* Viewport scroll to certain position.
|
|
251
249
|
* @param pos
|
|
@@ -264,19 +262,6 @@ export declare class Viewport {
|
|
|
264
262
|
isLimitedX: boolean;
|
|
265
263
|
isLimitedY: boolean;
|
|
266
264
|
} | undefined;
|
|
267
|
-
/**
|
|
268
|
-
* current position plus offset relatively
|
|
269
|
-
* the caller no need to deal with the padding when frozen
|
|
270
|
-
* @param offsetX
|
|
271
|
-
* @param offsetY
|
|
272
|
-
* @param isTrigger
|
|
273
|
-
*/
|
|
274
|
-
scrollByOffset(offsetX?: number, offsetY?: number, isTrigger?: boolean): {
|
|
275
|
-
scrollX: number;
|
|
276
|
-
scrollY: number;
|
|
277
|
-
isLimitedX: boolean;
|
|
278
|
-
isLimitedY: boolean;
|
|
279
|
-
} | undefined;
|
|
280
265
|
transViewportScroll2ScrollValue(viewportScrollX: number, viewportScrollY: number): {
|
|
281
266
|
x: number;
|
|
282
267
|
y: number;
|
|
@@ -368,6 +353,10 @@ export declare class Viewport {
|
|
|
368
353
|
* update pre scroll value has handled in updateScroll()
|
|
369
354
|
*/
|
|
370
355
|
private _afterRender;
|
|
356
|
+
/**
|
|
357
|
+
* mock scrollend.
|
|
358
|
+
* @param scrollSubParam
|
|
359
|
+
*/
|
|
371
360
|
private _emitScrollEnd$;
|
|
372
361
|
/**
|
|
373
362
|
*
|